Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added basic Elements/ElementsByType property and few other improvements #240

Merged
merged 20 commits into from
Sep 21, 2024

Conversation

ChrisBellBO
Copy link
Contributor

Added AllElements method that works with all test documents, although I suspect there may be better ways to handle some of the elements and there are no doubt other elements we are currently ignoring

@PrzemyslawKlys
Copy link
Member

Shouldn't it be property in Section counting elements in section and then in Document merging the sections?

@ChrisBellBO
Copy link
Contributor Author

Possibly but I don't currently have any interest in sections so I'd be pulling apart into sections to recombine into the document

@ChrisBellBO
Copy link
Contributor Author

if you don't want to incorporate this into the library code base, I can implement it in my own code base if ConvertParagraphToWordParagraphs and the WordTable constructor taking a WordDocument and Table are made public?

@PrzemyslawKlys
Copy link
Member

I need to sit down and understand/test if this can be approved in current form or with changes. In the end I would like to have this ability just want to make sure we cover the basics of Sections/Documents orderwhich is what most users will require. I do understand that you have your own temporary need or later lack of need for sections, but this would mean I need to change it later anyways. So I will try to spend some time on it, see how you did it and whether it's working as expected and then let you know.

Don't worry. Either way you'll get your functionality as I believe it's needed.

@PrzemyslawKlys
Copy link
Member

Hi,

I had some time and reviewed your code for Elements and it wasn't covering some cases.

allElements = document.AllElements();
elements = document.Elements;

image

I still need to do some work, but we should have something solid soon. I may also add something like ElementsExpanded or so where it tries to convert WordParagraph to actual subtype, but I am not sure if it's worth the effort.

@PrzemyslawKlys
Copy link
Member

PrzemyslawKlys commented Sep 21, 2024

So, to summarize this PR:

  • Added Elements property in Document\Section
  • Added ElementsByType property in Document\Section
  • Added HasNestedTables and `NestedTables properties to WordTableCell
  • Added support for VerticalTextAlignment in Paragraph which allows for Baseline/Subscript/Superscript
  • Improved error handling for IsLastRun/IsFirstRun
  • Added SetVerticalTextAlignment() method
  • Added SetSubscript() method
  • Added SetSuperScript() method

I also changed behavior of VerticalTextAlignment so that if it's not set it should be null, and if it's explicitly set to Baseline it shows baseline. Setting it to null should clear the value as well

@PrzemyslawKlys PrzemyslawKlys changed the title Added basic AllElements method Added basic Elements/ElementsByType property and few other improvements Sep 21, 2024
@PrzemyslawKlys
Copy link
Member

Sorry for changing quite a bit, hopefully this will be useful to you too.

@PrzemyslawKlys PrzemyslawKlys merged commit 19507c5 into EvotecIT:master Sep 21, 2024
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants