-
Notifications
You must be signed in to change notification settings - Fork 0
Added table update #31
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
base: develop
Are you sure you want to change the base?
Conversation
|
@Tom-Kingstone fix requested for copyright headers. The errors with the copyright headers on the CS ( I will apply the fixes to every case detailed on the checks tab. If you want to perform the fixes in a different manner please resolve this manually and rerun the check. Each CS ( If you are happy for me to go ahead and perform this action, please reply with:
|
|
@BHoMBot fix copyright headers ref. 37207010206 |
|
@Tom-Kingstone I have queued up your request to fix copyright headers. There are 1 requests in the queue ahead of you. |
|
@Tom-Kingstone I am now going to fix the copyright compliance in accordance with the annotations previously made. |
|
@Tom-Kingstone to confirm I have now resolved the copyright compliance and pushed a commit to this Pull Request. |
|
@pawelbaran FYI - The bot put the wrong date for the copyright compliance fix |
|
@Tom-Kingstone to confirm, the following actions are now queued:
|
adecler
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of things that need fixing. See below
| if (headerRow) | ||
| { | ||
| run.Text.Text = update.HeaderRow[c]; | ||
| headerRow = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work for two reasons:
- You are in the loop going through the columns of a row. So this will be false on the second header regardless
- The row index
ris incremented regardless so you will get an index out of bounds when trying to access the last row of content.
I would suggest you loop through a separate List<List<string>> content variable that is either the original content or the header row concatenated with the content if headers are provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense, will do this
| par.AddChild(run); | ||
| } | ||
| else | ||
| fontSize = run.RunProperties.FontSize / 100; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails when FontSize is null. Which is the case for the table placeholder.
NOTE: Depends on
Issues addressed by this PR
Closes #18
Added ability to update text in a table within a slide. This also can apply to table placeholders (where the table isn't initially there but a placeholder shape is in its' place - in this case it converts the shape into the correct size table for the data being inserted).
Test files
unzip and make sure both files are in the same folder, then set run to true and compare the output.pptx file with template.pptx

18-TableUpdate.zip
The output slide should look like this:
Changelog
TableUpdate.Additional comments
Other ideas: maybe a bool to allow forced update where an old table has the wrong number of rows/columns - if set to true this would change the number of rows/columns in the table to fit needs?