r17730 by jghali - #10925: Crash when importing an .odt with bullet lists in it

scribus-commit scribus-commit at lists.scribus.net
Sat Jul 21 16:44:19 UTC 2012


Author: jghali
Date: Sat Jul 21 16:44:19 2012
New Revision: 17730

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17730
Log:
#10925: Crash when importing an .odt with bullet lists in it

Modified:
    trunk/Scribus/scribus/plugins/gettext/sxwim/contentreader.cpp
    trunk/Scribus/scribus/plugins/gettext/sxwim/contentreader.h

Modified: trunk/Scribus/scribus/plugins/gettext/sxwim/contentreader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17730&path=/trunk/Scribus/scribus/plugins/gettext/sxwim/contentreader.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/sxwim/contentreader.cpp (original)
+++ trunk/Scribus/scribus/plugins/gettext/sxwim/contentreader.cpp Sat Jul 21 16:44:19 2012
@@ -48,7 +48,6 @@
 	inList = false;
 	inNote = false;
 	inNoteBody = false;
-	isOrdered = false;
 	inSpan = false;
 	append    = 0;
 	listIndex = 0;
@@ -120,19 +119,17 @@
 		styleNames.clear();
 		styleNames.push_back(QString(currentList + "_%1").arg(listLevel));
 		if (name == "text:ordered-list")
-		{
-			isOrdered = true;
 			isOrdered2.push_back(true);
-		}
-		else
-		{
-			isOrdered = false;
+		else
 			isOrdered2.push_back(false);
-		}
 	}
 	else if (name == "text:list-item")
 	{
-		if (isOrdered2[listLevel - 1])
+		bool isOrdered = false;
+		int levelIndex = listLevel - 1;
+		if (levelIndex >= 0 && levelIndex < isOrdered2.size())
+			isOrdered = isOrdered2[listLevel - 1];
+		if (isOrdered)
 		{
 			++listIndex;
 			++listIndex2[listLevel - 1];

Modified: trunk/Scribus/scribus/plugins/gettext/sxwim/contentreader.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17730&path=/trunk/Scribus/scribus/plugins/gettext/sxwim/contentreader.h
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/sxwim/contentreader.h (original)
+++ trunk/Scribus/scribus/plugins/gettext/sxwim/contentreader.h Sat Jul 21 16:44:19 2012
@@ -63,7 +63,6 @@
 	bool inList;
 	bool inNote;
 	bool inNoteBody;
-	bool isOrdered;
 	bool inSpan;
 	int  append;
 	int  listLevel;




More information about the scribus-commit mailing list