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

Method .InsertParagraphAfterSelf(paragraph) does not move FollowingTables to a new paragraph #481

Open
SheinEA opened this issue Aug 23, 2024 · 1 comment

Comments

@SheinEA
Copy link

SheinEA commented Aug 23, 2024

Hi, I have found a problem that when I add a paragraph using the .InsertParagraphAfterSelf(paragraph) method, FollowingTables are not wrapped into the new paragraph.
Example:
image
If I start copying the first paragraph 1. One, it will be copied without the table. Which is why I have to write something like this:

      public static Paragraph InsertParagraphAfterSelfWithTables(this Paragraph self, Paragraph paragraph)
        {
            var newParagraph = self.InsertParagraphAfterSelf(paragraph);

            if ((paragraph.FollowingTables?.Count ?? 0) > 0 && 
                (newParagraph.FollowingTables?.Count ?? 0) == 0)
            {
                foreach (var table in paragraph.FollowingTables!)
                {
                    newParagraph.InsertTableAfterSelf(table);
                }
            }

            return newParagraph;
        }
@evancekafando
Copy link

evancekafando commented Sep 27, 2024

Hello

We have adjusted InsertParagraphAfterSelf( Paragraph paragraph ) and InsertParagraphBeforeSelf( Paragraph paragraph ) methods. Starting from version 3.2, when inserting from an existing paragraph, the paragraph will be inserted along with its following tables.

Thank you
The Xceed Team

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

No branches or pull requests

2 participants