r17745 by jghali - #10979: Crash after pasting welded frame
scribus-commit
scribus-commit at lists.scribus.net
Tue Jul 31 21:35:05 UTC 2012
Author: jghali
Date: Tue Jul 31 21:35:05 2012
New Revision: 17745
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17745
Log:
#10979: Crash after pasting welded frame
Modified:
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17745&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Tue Jul 31 21:35:05 2012
@@ -416,10 +416,12 @@
for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
{
PageItem* ta = WeldItems.at(ttc);
- for (int i = 0 ; i < ta->weldList.count(); i++)
+ for (int i = 0; i < ta->weldList.count(); ++i)
{
PageItem::weldingInfo wInf = ta->weldList.at(i);
- ta->weldList[i].weldItem = LinkID[wInf.weldID];
+ ta->weldList[i].weldItem = LinkID.value(wInf.weldID, 0);
+ if (ta->weldList[i].weldItem == NULL)
+ ta->weldList.removeAt(i--);
}
}
}
@@ -518,10 +520,12 @@
for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
{
PageItem* ta = WeldItems.at(ttc);
- for (int i = 0 ; i < ta->weldList.count(); i++)
+ for (int i = 0 ; i < ta->weldList.count(); ++i)
{
PageItem::weldingInfo wInf = ta->weldList.at(i);
- ta->weldList[i].weldItem = WeldID[wInf.weldID];
+ ta->weldList[i].weldItem = WeldID.value(wInf.weldID, 0);
+ if (ta->weldList[i].weldItem == NULL)
+ ta->weldList.removeAt(i--);
}
}
}
@@ -891,10 +895,12 @@
for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
{
PageItem* ta = WeldItems.at(ttc);
- for (int i = 0 ; i < ta->weldList.count(); i++)
+ for (int i = 0 ; i < ta->weldList.count(); ++i)
{
PageItem::weldingInfo wInf = ta->weldList.at(i);
- ta->weldList[i].weldItem = LinkID[wInf.weldID];
+ ta->weldList[i].weldItem = LinkID.value(wInf.weldID, 0);
+ if (ta->weldList[i].weldItem == NULL)
+ ta->weldList.removeAt(i--);
}
}
}
@@ -993,10 +999,12 @@
for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
{
PageItem* ta = WeldItems.at(ttc);
- for (int i = 0 ; i < ta->weldList.count(); i++)
+ for (int i = 0 ; i < ta->weldList.count(); ++i)
{
PageItem::weldingInfo wInf = ta->weldList.at(i);
- ta->weldList[i].weldItem = WeldID[wInf.weldID];
+ ta->weldList[i].weldItem = WeldID.value(wInf.weldID, 0);
+ if (ta->weldList[i].weldItem == NULL)
+ ta->weldList.removeAt(i--);
}
}
}
@@ -1535,10 +1543,12 @@
for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
{
PageItem* ta = WeldItems.at(ttc);
- for (int i = 0 ; i < ta->weldList.count(); i++)
+ for (int i = 0 ; i < ta->weldList.count(); ++i)
{
PageItem::weldingInfo wInf = ta->weldList.at(i);
- ta->weldList[i].weldItem = LinkID[wInf.weldID];
+ ta->weldList[i].weldItem = LinkID.value(wInf.weldID, 0);
+ if (ta->weldList[i].weldItem == NULL)
+ ta->weldList.removeAt(i--);
}
}
}
@@ -1637,10 +1647,12 @@
for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
{
PageItem* ta = WeldItems.at(ttc);
- for (int i = 0 ; i < ta->weldList.count(); i++)
+ for (int i = 0 ; i < ta->weldList.count(); ++i)
{
PageItem::weldingInfo wInf = ta->weldList.at(i);
- ta->weldList[i].weldItem = WeldID[wInf.weldID];
+ ta->weldList[i].weldItem = WeldID.value(wInf.weldID, 0);
+ if (ta->weldList[i].weldItem == NULL)
+ ta->weldList.removeAt(i--);
}
}
}
@@ -3747,10 +3759,12 @@
for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
{
PageItem* ta = WeldItems.at(ttc);
- for (int i = 0 ; i < ta->weldList.count(); i++)
+ for (int i = 0 ; i < ta->weldList.count(); ++i)
{
PageItem::weldingInfo wInf = ta->weldList.at(i);
- ta->weldList[i].weldItem = LinkID[wInf.weldID];
+ ta->weldList[i].weldItem = LinkID.value(wInf.weldID, 0);
+ if (ta->weldList[i].weldItem == NULL)
+ ta->weldList.removeAt(i--);
}
}
}
@@ -3785,10 +3799,12 @@
for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
{
PageItem* ta = WeldItems.at(ttc);
- for (int i = 0 ; i < ta->weldList.count(); i++)
+ for (int i = 0 ; i < ta->weldList.count(); ++i)
{
PageItem::weldingInfo wInf = ta->weldList.at(i);
- ta->weldList[i].weldItem = WeldID[wInf.weldID];
+ ta->weldList[i].weldItem = WeldID.value(wInf.weldID, 0);
+ if (ta->weldList[i].weldItem == NULL)
+ ta->weldList.removeAt(i--);
}
}
}
@@ -5520,10 +5536,12 @@
for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
{
PageItem* ta = WeldItems.at(ttc);
- for (int i = 0 ; i < ta->weldList.count(); i++)
+ for (int i = 0 ; i < ta->weldList.count(); ++i)
{
PageItem::weldingInfo wInf = ta->weldList.at(i);
- ta->weldList[i].weldItem = LinkID[wInf.weldID];
+ ta->weldList[i].weldItem = LinkID.value(wInf.weldID, 0);
+ if (ta->weldList[i].weldItem == NULL)
+ ta->weldList.removeAt(i--);
}
}
}
@@ -5576,10 +5594,12 @@
for (int ttc = 0; ttc < WeldItems.count(); ++ttc)
{
PageItem* ta = WeldItems.at(ttc);
- for (int i = 0 ; i < ta->weldList.count(); i++)
+ for (int i = 0 ; i < ta->weldList.count(); ++i)
{
PageItem::weldingInfo wInf = ta->weldList.at(i);
- ta->weldList[i].weldItem = WeldID[wInf.weldID];
+ ta->weldList[i].weldItem = WeldID.value(wInf.weldID, 0);
+ if (ta->weldList[i].weldItem == NULL)
+ ta->weldList.removeAt(i--);
}
}
}
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17745&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Tue Jul 31 21:35:05 2012
@@ -2143,8 +2143,6 @@
//write weld parameter
if (item->isWelded())
{
- docu.writeAttribute("isWeldItem", 1);
- docu.writeAttribute("WeldSource", qHash(item));
for (int i = 0 ; i < item->weldList.count(); i++)
{
PageItem::weldingInfo wInf = item->weldList.at(i);
@@ -2203,6 +2201,12 @@
docu.writeAttribute("PLINEEND", item->PLineEnd);
if (item->PLineJoin != 0)
docu.writeAttribute("PLINEJOIN", item->PLineJoin);
+ }
+ //write weld parameter
+ if (item->isWelded())
+ {
+ docu.writeAttribute("isWeldItem", 1);
+ docu.writeAttribute("WeldSource", qHash(item));
}
if (item->asRegularPolygon())
{
More information about the scribus-commit
mailing list