Code Monkey home page Code Monkey logo

Comments (7)

PrzemyslawKlys avatar PrzemyslawKlys commented on June 6, 2024 1

Lists are complicated beasts. I'll take a look. For now I'll link to old PR maybe it will give you something:

from officeimo.

PrzemyslawKlys avatar PrzemyslawKlys commented on June 6, 2024 1

I found a reason why it doesn't work. It's related to Nsid.

image

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...

from officeimo.

PrzemyslawKlys avatar PrzemyslawKlys commented on June 6, 2024 1

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.

from officeimo.

PrzemyslawKlys avatar PrzemyslawKlys commented on June 6, 2024

So when I look at how Word deals with font size it seems to be applying it to ParagraphProperties

image

And not to AbstractNum. Is there a reason you want it done that way?

from officeimo.

tmpmachine avatar tmpmachine commented on June 6, 2024

It looks like randomizing nsid causing the continueNumbering to fail. Created a quick test in db16983.

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);
    }

}

image

from officeimo.

tmpmachine avatar tmpmachine commented on June 6, 2024

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).

from officeimo.

PrzemyslawKlys avatar PrzemyslawKlys commented on June 6, 2024

I've now removed restart numbering/continue numbering as it makes no sense:

If you feel this is somehow wrong please let me know.

from officeimo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.