r19565 by jghali - #12753: Convert Symbol to Symbol crashes Scribus
scribus-commit
scribus-commit at lists.scribus.net
Wed Oct 8 20:49:26 UTC 2014
Author: jghali
Date: Wed Oct 8 20:49:26 2014
New Revision: 19565
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19565
Log:
#12753: Convert Symbol to Symbol crashes Scribus
Modified:
trunk/Scribus/scribus/scribus.cpp
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19565&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Wed Oct 8 20:49:26 2014
@@ -8082,47 +8082,44 @@
void ScribusMainWindow::editSymbolStart(QString temp)
{
- if (HaveDoc)
- {
- if (!doc->docPatterns.contains(temp))
- return;
- m_WasAutoSave = doc->autoSave();
- if (m_WasAutoSave)
- {
- doc->autoSaveTimer->stop();
- doc->setAutoSave(false);
- }
- view->Deselect(true);
- storedPageNum = doc->currentPageNumber();
- storedViewXCoor = view->contentsX();
- storedViewYCoor = view->contentsY();
- storedViewScale = view->scale();
- doc->stored_minCanvasCoordinate = doc->minCanvasCoordinate;
- doc->stored_maxCanvasCoordinate = doc->maxCanvasCoordinate;
- view->showSymbolPage(temp);
- appModeHelper->setSymbolEditMode(true, doc);
- pagePalette->enablePalette(false);
- layerPalette->setEnabled(false);
- patternsDependingOnThis.clear();
- QStringList mainPatterns = doc->docPatterns.keys();
- for (int a = 0; a < mainPatterns.count(); a++)
- {
- if (mainPatterns[a] != temp)
- {
- QStringList subPatterns;
- subPatterns = doc->getUsedPatternsHelper(mainPatterns[a], subPatterns);
- if (subPatterns.contains(temp))
- patternsDependingOnThis.prepend(mainPatterns[a]);
- }
- }
- patternsDependingOnThis.prepend(temp);
- symbolPalette->editingStart(patternsDependingOnThis);
- propertiesPalette->Cpal->hideEditedPatterns(patternsDependingOnThis);
- propertiesPalette->Tpal->hideEditedPatterns(patternsDependingOnThis);
- if (outlinePalette->isVisible())
- outlinePalette->BuildTree(false);
- updateActiveWindowCaption( tr("Editing Symbol: %1").arg(temp));
- }
+ if (!HaveDoc || !doc->docPatterns.contains(temp))
+ return;
+ m_WasAutoSave = doc->autoSave();
+ if (m_WasAutoSave)
+ {
+ doc->autoSaveTimer->stop();
+ doc->setAutoSave(false);
+ }
+ view->Deselect(true);
+ storedPageNum = doc->currentPageNumber();
+ storedViewXCoor = view->contentsX();
+ storedViewYCoor = view->contentsY();
+ storedViewScale = view->scale();
+ doc->stored_minCanvasCoordinate = doc->minCanvasCoordinate;
+ doc->stored_maxCanvasCoordinate = doc->maxCanvasCoordinate;
+ view->showSymbolPage(temp);
+ appModeHelper->setSymbolEditMode(true, doc);
+ pagePalette->enablePalette(false);
+ layerPalette->setEnabled(false);
+ patternsDependingOnThis.clear();
+ QStringList mainPatterns = doc->docPatterns.keys();
+ for (int a = 0; a < mainPatterns.count(); a++)
+ {
+ if (mainPatterns[a] != temp)
+ {
+ QStringList subPatterns;
+ subPatterns = doc->getUsedPatternsHelper(mainPatterns[a], subPatterns);
+ if (subPatterns.contains(temp))
+ patternsDependingOnThis.prepend(mainPatterns[a]);
+ }
+ }
+ patternsDependingOnThis.prepend(temp);
+ symbolPalette->editingStart(patternsDependingOnThis);
+ propertiesPalette->Cpal->hideEditedPatterns(patternsDependingOnThis);
+ propertiesPalette->Tpal->hideEditedPatterns(patternsDependingOnThis);
+ if (outlinePalette->isVisible())
+ outlinePalette->BuildTree(false);
+ updateActiveWindowCaption( tr("Editing Symbol: %1").arg(temp));
}
void ScribusMainWindow::editSymbolEnd()
@@ -9856,6 +9853,9 @@
}
patternsDependingOnThis.prepend(temp);
}
+ // #12753: We cannot replace currently edited symbol
+ if (doc->symbolEditMode())
+ patternsDependingOnThis.prepend(doc->getEditedSymbol());
allItems.clear();
Query dia(this, "tt", 1, tr("&Name:"), tr("New Entry"));
dia.setEditText(patternName, true);
More information about the scribus-commit
mailing list