Making changes to shapes in copied page affect both the source and copied

Using the current latest Aspose.Diagram version, v24.6.0.

Having an issue where changes made to a copied page are also affecting the original page. Please fix this bug or help me disassociate the copied data from the original. Thanks!

Here’s the test code snippet:

Page pgSoure = diagram.Pages.GetPage(0);
Page pgCopy = null;

int currMaxID = 0;
foreach (Page page in diagram.Pages)
{
    if (page.ID > currMaxID)
    {
        currMaxID = page.ID;
    }
}

pgCopy = new Page(++currMaxID);
pgCopy.Copy(pgSoure);
diagram.Pages.Add(pgCopy);

for (int i = 1; i <= 3; i++)
{
    Shape shape = pgCopy.Shapes.GetShape($"text.{i}");
    if (shape != null)
    {
        ChangeText(shape, $"New Text {i}");
    }

}
diagram.Save(Path.Combine(OutputPath, FileName), SaveFileFormat.Vsdx);

Here’s the code snippet for ChangeText():

private static void ChangeText(Shape shape, string text)
{
    foreach (FormatTxt txt in shape.Text.Value)
    {
        if (txt is Txt tx)
        {
            tx.Text = tx.Text.Replace(tx.Text, text);
            break;
        }
    }
}

Include sample diagram and its outputted diagram.
TestDiagram.zip (20.0 KB)

@ger.vue
Thanks for the template file and sample code.
We reproduced the problems you mentioned by using your template file.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): DIAGRAMNET-53433

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

The issues you have found earlier (filed as DIAGRAMNET-53433) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou

Thanks, confirmed that the bugs been fixed and seeing no issues at the moment.

@ger.vue
It’s good to know that your issue is sorted out now.
Please feel free to contact us in case you have further comments or questions.