r19953 by fschmid - Part of Bug #12120 Fixed crash during import.

scribus-commit scribus-commit at lists.scribus.net
Fri Mar 27 20:07:54 UTC 2015


Author: fschmid
Date: Fri Mar 27 20:07:54 2015
New Revision: 19953

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19953
Log:
Part of Bug #12120 Fixed crash during import.

Modified:
    trunk/Scribus/scribus/plugins/import/viva/importviva.cpp

Modified: trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19953&path=/trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/viva/importviva.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/viva/importviva.cpp Fri Mar 27 20:07:54 2015
@@ -1226,40 +1226,43 @@
 							}
 						}
 					}
-					if (ob_type == 2)
-					{
-						Path.addPoint(tPoints[0].PolyPoint);
-						Path.addPoint(tPoints[0].afterPolyPoint);
-						for (int ppx = 1; ppx < tPoints.count(); ppx++)
+					if (tPoints.count() > 0)
+					{
+						if (ob_type == 2)
 						{
-							Path.addPoint(tPoints[ppx].PolyPoint);
-							Path.addPoint(tPoints[ppx].beforePolyPoint);
-							Path.addPoint(tPoints[ppx].PolyPoint);
-							Path.addPoint(tPoints[ppx].afterPolyPoint);
+							Path.addPoint(tPoints[0].PolyPoint);
+							Path.addPoint(tPoints[0].afterPolyPoint);
+							for (int ppx = 1; ppx < tPoints.count(); ppx++)
+							{
+								Path.addPoint(tPoints[ppx].PolyPoint);
+								Path.addPoint(tPoints[ppx].beforePolyPoint);
+								Path.addPoint(tPoints[ppx].PolyPoint);
+								Path.addPoint(tPoints[ppx].afterPolyPoint);
+							}
+							Path.addPoint(tPoints[0].PolyPoint);
+							Path.addPoint(tPoints[0].beforePolyPoint);
 						}
-						Path.addPoint(tPoints[0].PolyPoint);
-						Path.addPoint(tPoints[0].beforePolyPoint);
-					}
-					else if (ob_type == 3)
-					{
-						Path.addPoint(tPoints[0].PolyPoint);
-						Path.addPoint(tPoints[0].PolyPoint);
-						Path.addPoint(tPoints[1].PolyPoint);
-						Path.addPoint(tPoints[1].PolyPoint);
-					}
-					else if (ob_type == 4)
-					{
-						Path.addPoint(tPoints[0].PolyPoint);
-						Path.addPoint(tPoints[0].afterPolyPoint);
-						for (int ppx = 1; ppx < tPoints.count()-1; ppx++)
+						else if (ob_type == 3)
 						{
-							Path.addPoint(tPoints[ppx].PolyPoint);
-							Path.addPoint(tPoints[ppx].beforePolyPoint);
-							Path.addPoint(tPoints[ppx].PolyPoint);
-							Path.addPoint(tPoints[ppx].afterPolyPoint);
+							Path.addPoint(tPoints[0].PolyPoint);
+							Path.addPoint(tPoints[0].PolyPoint);
+							Path.addPoint(tPoints[1].PolyPoint);
+							Path.addPoint(tPoints[1].PolyPoint);
 						}
-						Path.addPoint(tPoints[tPoints.count()-1].PolyPoint);
-						Path.addPoint(tPoints[tPoints.count()-1].beforePolyPoint);
+						else if (ob_type == 4)
+						{
+							Path.addPoint(tPoints[0].PolyPoint);
+							Path.addPoint(tPoints[0].afterPolyPoint);
+							for (int ppx = 1; ppx < tPoints.count()-1; ppx++)
+							{
+								Path.addPoint(tPoints[ppx].PolyPoint);
+								Path.addPoint(tPoints[ppx].beforePolyPoint);
+								Path.addPoint(tPoints[ppx].PolyPoint);
+								Path.addPoint(tPoints[ppx].afterPolyPoint);
+							}
+							Path.addPoint(tPoints[tPoints.count()-1].PolyPoint);
+							Path.addPoint(tPoints[tPoints.count()-1].beforePolyPoint);
+						}
 					}
 				}
 				else if (eog.tagName() == "vo:shadow")
@@ -1461,7 +1464,7 @@
 	{
 		PageItem* item = m_Doc->Items->at(z);
 		item->setTextFlowMode(textFlow);
-		if ((ob_type == 2) || (ob_type == 3) || (ob_type == 4))
+		if (((ob_type == 2) || (ob_type == 3) || (ob_type == 4)) && (Path.count() > 0))
 		{
 			item->PoLine = Path.copy();
 			FPoint wh = getMaxClipF(&item->PoLine);




More information about the scribus-commit mailing list