r20994 by craig -

scribus-commit scribus-commit at lists.scribus.net
Fri Feb 12 06:35:18 UTC 2016


Author: craig
Date: Fri Feb 12 06:35:18 2016
New Revision: 20994

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20994
Log:
coverity fix a bunch of unchecked dynamic casts in Pageitem undo restore functions

Modified:
    trunk/Scribus/scribus/pageitem.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20994&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp	(original)
+++ trunk/Scribus/scribus/pageitem.cpp	Fri Feb 12 06:35:18 2016
@@ -6056,8 +6056,8 @@
 void PageItem::restoreArc(SimpleState *state, bool isUndo)
 {
 	ScItemState<QPair<FPointArray, FPointArray> > *ss = dynamic_cast<ScItemState<QPair<FPointArray, FPointArray> > *>(state);
-	if (!ss)
-		return;
+	if (!is)
+		qFatal("PageItem::restoreArc: dynamic cast failed");
 	PageItem_Arc *item = asArc();
 	if (isUndo)
 	{
@@ -6097,7 +6097,7 @@
 {
 	ScItemState<QList<QTransform> > *is = dynamic_cast<ScItemState<QList<QTransform > >*>(ss);
 	if (!is)
-		return;
+		qFatal("PageItem::restoreTransform: dynamic cast failed");
 	int x = is->getDouble("DX");
 	int y = is->getDouble("DY");
 	if (isUndo)
@@ -6262,7 +6262,7 @@
 {
 	ScItemState<QList<FPoint> > *is = dynamic_cast<ScItemState<QList<FPoint> > *>(state);
 	if (!is)
-		return;
+		qFatal("PageItem::restoreGradPos: dynamic cast failed");
 	if (isUndo)
 	{
 		GrStartX = is->getDouble("OLDSTARTX");




More information about the scribus-commit mailing list