Open tmpmachine opened 8 months ago
Lists are complicated beasts. I'll take a look. For now I'll link to old PR maybe it will give you something:
So when I look at how Word deals with font size it seems to be applying it to ParagraphProperties
And not to AbstractNum. Is there a reason you want it done that way?
I found a reason why it doesn't work. It's related to Nsid.
In the original code each list has different Nsid, but only if the list is different. If the list is the same it uses same Nsid (as it's hardcoded).
For this to work, it needs to be fixed so that Nsid is randomized or have proper numbering like NumberingInstance/AbstractNum.
I did quick hack and it works...
It looks like randomizing nsid
causing the continueNumbering
to fail. Created a quick test in db169830e223ce975b5e5fb0ccf717fa5653c094.
Need more investigation, will check later.
[Fact]
public void Test_CreatingWordDocumentWithLists3() {
var filePath = Path.Combine(_directoryWithFiles, "CreatedDocumentWithLists2.docx");
using (var doc = WordDocument.Create(filePath)) {
doc.AddParagraph("Capybaras:");
{
WordList wl = doc.AddList(WordListStyle.HeadingIA1);
wl.AddItem("Pablo");
}
{
WordList wl = doc.AddList(WordListStyle.HeadingIA1, true);
wl.AddItem("Ponyo");
}
doc.Save(true);
}
}
I guess when we want to continuenumbering we will now need to refer to the original AbstractNum, instead of adding a new one...
SO when user uses WordListStyle.headingIA1, find it on the list if it's there already and if it's continueNumbering, attach to it - my guess.
So when I look at how Word deals with font size it seems to be applying it to ParagraphProperties
And not to AbstractNum. Is there a reason you want it done that way?
Not really, at that time I went straight to abstractnum instead of checking on a higher level (paragraph).
I've now removed restart numbering/continue numbering as it makes no sense:
If you feel this is somehow wrong please let me know.
Related PR : https://github.com/EvotecIT/OfficeIMO/pull/196
This PR adds option to set font size on list symbol by appending
NumberingSymbolRunProperties
on eachLevel
. The issue is that this font size affect all lists with the sameWordListStyle
.Here I have two list with
Headings111Shifted
style :Findings so far
Both list correctly reference it's own
NumberingInstance
with it's ownNumberingSymbolRunProperties
. What could be missing?