diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index b7270afec..834f274e9 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -3043,7 +3043,8 @@ void MainWindow::Clear() { watcher->removePath(AbsoluteMPath(qApp->GetPatternPath(), doc->MPath())); } - doc->clear(); + doc->Clear(); + UpdateWindowTitle(); UpdateVisibilityGroups(); detailsWidget->UpdateList(); qCDebug(vMainWindow, "Clearing scenes."); diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 0a39c321e..b89b5b041 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -628,8 +628,14 @@ void VAbstractPattern::setCursor(const quint32 &value) //--------------------------------------------------------------------------------------------------------------------- void VAbstractPattern::setXMLContent(const QString &fileName) { + Clear(); VDomDocument::setXMLContent(fileName); +} +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractPattern::Clear() +{ + clear(); *patternNumberCached = unknownCharacter; *labelDateFormatCached = unknownCharacter; *patternNameCached = unknownCharacter; diff --git a/src/libs/ifc/xml/vabstractpattern.h b/src/libs/ifc/xml/vabstractpattern.h index 6c2bcf37a..baaf2fff1 100644 --- a/src/libs/ifc/xml/vabstractpattern.h +++ b/src/libs/ifc/xml/vabstractpattern.h @@ -116,6 +116,8 @@ public: virtual void UpdateToolData(const quint32 &id, VContainer *data)=0; + virtual void Clear(); + static VDataTool* getTool(quint32 id); static void AddTool(quint32 id, VDataTool *tool); static void RemoveTool(quint32 id);