Skip to content

Conversation

@Tom-Kingstone
Copy link
Contributor

@Tom-Kingstone Tom-Kingstone commented Feb 13, 2025

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:
image

Changelog

  • Added ability to update tables within presentations with 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?

@Tom-Kingstone Tom-Kingstone added the type:feature New capability or enhancement label Feb 13, 2025
@Tom-Kingstone Tom-Kingstone self-assigned this Feb 13, 2025
@Tom-Kingstone Tom-Kingstone added the status:WIP PR in progress and still in draft, not ready for formal review label Feb 13, 2025
@bhombot-ci
Copy link

bhombot-ci bot commented Feb 14, 2025

@Tom-Kingstone fix requested for copyright headers.

The errors with the copyright headers on the CS (.cs) files have been recorded as annotations on the checks tab.

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 (.cs) file that does not have the current copyright header will have it applied. The current copyright header can be examined here.

If you are happy for me to go ahead and perform this action, please reply with:

@BHoMBot fix copyright headers ref. 37207010206

@Tom-Kingstone
Copy link
Contributor Author

@BHoMBot fix copyright headers ref. 37207010206

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 14, 2025

@Tom-Kingstone I have queued up your request to fix copyright headers. There are 1 requests in the queue ahead of you.

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 14, 2025

@Tom-Kingstone I am now going to fix the copyright compliance in accordance with the annotations previously made.

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 14, 2025

@Tom-Kingstone to confirm I have now resolved the copyright compliance and pushed a commit to this Pull Request.

@Tom-Kingstone
Copy link
Contributor Author

@pawelbaran FYI - The bot put the wrong date for the copyright compliance fix

@Tom-Kingstone
Copy link
Contributor Author

@BHoMBot check core
@BHoMBot check copyright-compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 17, 2025

@Tom-Kingstone to confirm, the following actions are now queued:

  • check core
  • check copyright-compliance

@Tom-Kingstone Tom-Kingstone removed the status:WIP PR in progress and still in draft, not ready for formal review label Mar 13, 2025
@adecler adecler requested a review from michaelhoehn May 8, 2025 15:47
Copy link
Member

@adecler adecler left a 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

Comment on lines +139 to +142
if (headerRow)
{
run.Text.Text = update.HeaderRow[c];
headerRow = false;
Copy link
Member

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

Copy link
Contributor Author

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;
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New capability or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding / Updating Tables

4 participants