Commit e10326cf authored by jan.koester's avatar jan.koester
Browse files

test

parent f8bc1c13
Loading
Loading
Loading
Loading
+3 −6
Changes for src/edit.cpp: 3 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -411,13 +411,10 @@ blogi::webedit::EditPlugin* blogi::webedit::WebEditor::deepCopySubtree(tinyxml2:
    EditPlugin *newWidget = createPluginByName(elementName);
    if (!newWidget) return nullptr;

    // Load properties but give the widget a NEW instance ID (createPluginByName already did that)
    // We need to load properties from XML but keep the new ID
    std::string newId = std::string(newWidget->getInstanceId().c_str());
    // Load properties from XML, then regenerate the instance ID
    // so the pasted copy always has a unique UUID
    newWidget->fromXmlObject(xmlEl);
    // Restore the new unique ID (fromXmlObject may not overwrite it, but be safe)
    // The instance_id in XML is loaded by the base class if applicable; widgets
    // get their ID from the constructor, and fromXmlObject only loads properties.
    newWidget->regenerateId();

    // Recursively copy children
    if (newWidget->canHaveChildren()) {
+4 −0
Changes for src/plugin.h: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -281,6 +281,10 @@ namespace blogi {
                child = el;
            }

            void regenerateId() {
                Id.generate();
            }

        protected:
            uuid::uuid                              Type;
            uuid::uuid                              Id;