r14914 by jghali - #8953 : crash when removing layer in script

scribus-commit scribus-commit at lists.scribus.net
Sat Mar 20 13:50:21 CET 2010


Revision: 14914
Author: jghali
Date: 2010-03-20T12:44:07.584767Z
Commit message: #8953 : crash when removing layer in script

Changeset: 
M  /branches/Version135/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp

Diffs:
Index: scribus/plugins/scriptplugin/cmdmisc.cpp
===================================================================
--- scribus/plugins/scriptplugin/cmdmisc.cpp	(revision 14913)
+++ scribus/plugins/scriptplugin/cmdmisc.cpp	(revision 14914)
@@ -708,16 +708,8 @@
 				Py_INCREF(Py_None);
 				return Py_None;
 			}
-			int num = it2.Level;
-			ScCore->primaryMainWindow()->doc->Layers.removeAt(lam);
-			ScLayer it;
-			for (int l = 0; l < ScCore->primaryMainWindow()->doc->Layers.count(); l++)
-			{
-				it = ScCore->primaryMainWindow()->doc->Layers.at(l);
-				if (it.Level > num)
-					it.Level -= 1;
-			}
 			ScCore->primaryMainWindow()->doc->removeLayer(num2);
+			ScCore->primaryMainWindow()->doc->Layers.removeLayerByNumber(num2);
 			ScCore->primaryMainWindow()->doc->setActiveLayer(0);
 			ScCore->primaryMainWindow()->changeLayer(0);
 			found = true;




More information about the scribus-commit mailing list