r20464 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Tue Oct 13 11:13:17 UTC 2015


Author: jghali
Date: Tue Oct 13 11:13:16 2015
New Revision: 20464

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20464
Log:
#13416: Assert failure when loading document

Modified:
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20464&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	Tue Oct 13 11:13:16 2015
@@ -601,9 +601,12 @@
 		{
 			if (lc.value() >= 0)
 			{
-				PageItem * Its = m_Doc->DocItems.at(lc.key());
-				PageItem * Itn = m_Doc->DocItems.at(lc.value());
-				if (!Its->testLinkCandidate(Itn))
+				PageItem *Its(0), *Itn(0);
+				if (lc.key() < m_Doc->DocItems.count())
+					Its = m_Doc->DocItems.at(lc.key());
+				if (lc.value() < m_Doc->DocItems.count())
+					Itn = m_Doc->DocItems.at(lc.value());
+				if (!Its || !Itn || !Its->testLinkCandidate(Itn))
 				{
 					qDebug() << "scribus134format: corruption in linked textframes detected";
 					continue;
@@ -620,9 +623,12 @@
 		{
 			if (lc.value() >= 0)
 			{
-				PageItem * Its = m_Doc->MasterItems.at(lc.key());
-				PageItem * Itn = m_Doc->MasterItems.at(lc.value());
-				if (!Its->testLinkCandidate(Itn))
+				PageItem *Its(0), *Itn(0);
+				if (lc.key() < m_Doc->MasterItems.count())
+					Its = m_Doc->MasterItems.at(lc.key());
+				if (lc.value() < m_Doc->MasterItems.count())
+					Itn = m_Doc->MasterItems.at(lc.value());
+				if (!Its || !Itn || !Its->testLinkCandidate(Itn))
 				{
 					qDebug() << "scribus134format: corruption in linked textframes detected";
 					continue;
@@ -3387,17 +3393,17 @@
 		{
 			if (itemRemap[lc.value()] >= 0)
 			{
-				if ((lc.key() < m_Doc->Items->count()) && (itemRemap[lc.value()] < m_Doc->Items->count()))
+				PageItem *Its(0), *Itn(0);
+				if (lc.key() < m_Doc->DocItems.count())
+					Its = m_Doc->DocItems.at(lc.key());
+				if (itemRemap[lc.value()] < m_Doc->DocItems.count())
+					Itn = m_Doc->DocItems.at(itemRemap[lc.value()]);
+				if (!Its || !Itn || !Its->testLinkCandidate(Itn))
 				{
-					PageItem * Its = m_Doc->DocItems.at(lc.key());
-					PageItem * Itn = m_Doc->DocItems.at(itemRemap[lc.value()]);
-					if (!Its->testLinkCandidate(Itn))
-					{
-						qDebug() << "scribus134format: corruption in linked textframes detected";
-						continue;
-					}
-					Its->link(Itn);
+					qDebug() << "scribus134format: corruption in linked textframes detected";
+					continue;
 				}
+				Its->link(Itn);
 			}
 		}
 	}
@@ -3408,17 +3414,17 @@
 		{
 			if (itemRemapM[lc.value()] >= 0)
 			{
-				if ((lc.key() < m_Doc->MasterItems.count()) && (itemRemapM[lc.value()] < m_Doc->MasterItems.count()))
+				PageItem *Its(0), *Itn(0);
+				if (lc.key() < m_Doc->MasterItems.count())
+					Its = m_Doc->MasterItems.at(lc.key());
+				if (itemRemapM[lc.value()] < m_Doc->MasterItems.count())
+					Itn = m_Doc->MasterItems.at(itemRemapM[lc.value()]);
+				if (!Its || !Itn || !Its->testLinkCandidate(Itn))
 				{
-					PageItem * Its = m_Doc->MasterItems.at(lc.key());
-					PageItem * Itn = m_Doc->MasterItems.at(itemRemapM[lc.value()]);
-					if (!Its->testLinkCandidate(Itn))
-					{
-						qDebug() << "scribus134format: corruption in linked textframes detected";
-						continue;
-					}
-					Its->link(Itn);
+					qDebug() << "scribus134format: corruption in linked textframes detected";
+					continue;
 				}
+				Its->link(Itn);
 			}
 		}
 	}

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20464&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp	Tue Oct 13 11:13:16 2015
@@ -1097,9 +1097,12 @@
 		{
 			if (itemRemap[lc.value()] >= 0)
 			{
-				PageItem * Its = m_Doc->Items->at(lc.key());
-				PageItem * Itn = m_Doc->Items->at(itemRemap[lc.value()]);
-				if (!Its->testLinkCandidate(Itn))
+				PageItem *Its(0), *Itn(0);
+				if (lc.key() < m_Doc->Items->count())
+					Its = m_Doc->Items->at(lc.key());
+				if (itemRemap[lc.value()] < m_Doc->Items->count())
+					Itn = m_Doc->Items->at(itemRemap[lc.value()]);
+				if (!Its || !Itn || !Its->testLinkCandidate(Itn))
 				{
 					qDebug("scribus13format: corruption in linked textframes detected");
 					continue;
@@ -2414,17 +2417,17 @@
 		{
 			if (itemRemap[lc.value()] >= 0)
 			{
-				if ((lc.key() < m_Doc->Items->count()) && (itemRemap[lc.value()] < m_Doc->Items->count()))
-				{
-					PageItem * Its = m_Doc->Items->at(lc.key());
-					PageItem * Itn = m_Doc->Items->at(itemRemap[lc.value()]);
-					if (!Its->testLinkCandidate(Itn))
-					{
-						qDebug("scribus13format: corruption in linked textframes detected");
-						continue;
-					}
-					Its->link(Itn);
-				}
+				PageItem *Its(0), *Itn(0);
+				if (lc.key() < m_Doc->Items->count())
+					Its = m_Doc->Items->at(lc.key());
+				if (itemRemap[lc.value()] < m_Doc->Items->count())
+					Itn = m_Doc->Items->at(itemRemap[lc.value()]);
+				if (!Its || !Itn || !Its->testLinkCandidate(Itn))
+				{
+					qDebug("scribus13format: corruption in linked textframes detected");
+					continue;
+				}
+				Its->link(Itn);
 			}
 		}
 	}	

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20464&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 Oct 13 11:13:16 2015
@@ -562,9 +562,12 @@
 			{
 				if (lc.value() >= 0)
 				{
-					PageItem * Its = m_Doc->DocItems.at(lc.key());
-					PageItem * Itn = m_Doc->DocItems.at(lc.value());
-					if (!Its->testLinkCandidate(Itn))
+					PageItem *Its(0), *Itn(0);
+					if (lc.key() < m_Doc->DocItems.count())
+						Its = m_Doc->DocItems.at(lc.key());
+					if (lc.value() < m_Doc->DocItems.count())
+						Itn = m_Doc->DocItems.at(lc.value());
+					if (!Its || !Itn || !Its->testLinkCandidate(Itn))
 					{
 						qDebug() << "scribus150format: corruption in linked textframes detected";
 						continue;
@@ -1061,9 +1064,12 @@
 			{
 				if (lc.value() >= 0)
 				{
-					PageItem * Its = m_Doc->DocItems.at(lc.key());
-					PageItem * Itn = m_Doc->DocItems.at(lc.value());
-					if (!Its->testLinkCandidate(Itn))
+					PageItem *Its(0), *Itn(0);
+					if (lc.key() < m_Doc->DocItems.count())
+						Its = m_Doc->DocItems.at(lc.key());
+					if (lc.value() < m_Doc->DocItems.count())
+						Itn = m_Doc->DocItems.at(lc.value());
+					if (!Its || !Itn || !Its->testLinkCandidate(Itn))
 					{
 						qDebug() << "scribus150format: corruption in linked textframes detected";
 						continue;
@@ -1079,9 +1085,12 @@
 			{
 				if (lc.value() >= 0)
 				{
-					PageItem * Its = m_Doc->MasterItems.at(lc.key());
-					PageItem * Itn = m_Doc->MasterItems.at(lc.value());
-					if (!Its->testLinkCandidate(Itn))
+					PageItem *Its(0), *Itn(0);
+					if (lc.key() < m_Doc->MasterItems.count())
+						Its = m_Doc->MasterItems.at(lc.key());
+					if (lc.value() < m_Doc->MasterItems.count())
+						Itn = m_Doc->MasterItems.at(lc.value());
+					if (!Its || !Itn || !Its->testLinkCandidate(Itn))
 					{
 						qDebug() << "scribus150format: corruption in linked textframes detected";
 						continue;
@@ -1741,9 +1750,12 @@
 			{
 				if (lc.value() >= 0)
 				{
-					PageItem * Its = m_Doc->DocItems.at(lc.key());
-					PageItem * Itn = m_Doc->DocItems.at(lc.value());
-					if (!Its->testLinkCandidate(Itn))
+					PageItem *Its(0), *Itn(0);
+					if (lc.key() < m_Doc->DocItems.count())
+						Its = m_Doc->DocItems.at(lc.key());
+					if (lc.value() < m_Doc->DocItems.count())
+						Itn = m_Doc->DocItems.at(lc.value());
+					if (!Its || !Itn || !Its->testLinkCandidate(Itn))
 					{
 						qDebug() << "scribus150format: corruption in linked textframes detected";
 						continue;
@@ -1759,9 +1771,12 @@
 			{
 				if (lc.value() >= 0)
 				{
-					PageItem * Its = m_Doc->MasterItems.at(lc.key());
-					PageItem * Itn = m_Doc->MasterItems.at(lc.value());
-					if (!Its->testLinkCandidate(Itn))
+					PageItem *Its(0), *Itn(0);
+					if (lc.key() < m_Doc->MasterItems.count())
+						Its = m_Doc->MasterItems.at(lc.key());
+					if (lc.value() < m_Doc->MasterItems.count())
+						Itn = m_Doc->MasterItems.at(lc.value());
+					if (!Its || !Itn || !Its->testLinkCandidate(Itn))
 					{
 						qDebug() << "scribus150format: corruption in linked textframes detected";
 						continue;
@@ -6287,17 +6302,17 @@
 			{
 				if (itemRemap[lc.value()] >= 0)
 				{
-					if ((lc.key() < m_Doc->Items->count()) && (itemRemap[lc.value()] < m_Doc->Items->count()))
+					PageItem *Its(0), *Itn(0);
+					if (lc.key() < m_Doc->Items->count())
+						Its = m_Doc->DocItems.at(lc.key());
+					if (itemRemap[lc.value()] < m_Doc->DocItems.count())
+						Itn = m_Doc->DocItems.at(itemRemap[lc.value()]);
+					if (!Its || !Itn || !Its->testLinkCandidate(Itn))
 					{
-						PageItem * Its = m_Doc->DocItems.at(lc.key());
-						PageItem * Itn = m_Doc->DocItems.at(itemRemap[lc.value()]);
-						if (!Its->testLinkCandidate(Itn))
-						{
-							qDebug() << "scribus150format: corruption in linked textframes detected";
-							continue;
-						}
-						Its->link(Itn);
+						qDebug() << "scribus150format: corruption in linked textframes detected";
+						continue;
 					}
+					Its->link(Itn);
 				}
 			}
 		}
@@ -6308,17 +6323,17 @@
 			{
 				if (itemRemapM[lc.value()] >= 0)
 				{
-					if ((lc.key() < m_Doc->MasterItems.count()) && (itemRemapM[lc.value()] < m_Doc->MasterItems.count()))
+					PageItem *Its(0), *Itn(0);
+					if (lc.key() < m_Doc->MasterItems.count())
+						Its = m_Doc->MasterItems.at(lc.key());
+					if (itemRemapM[lc.value()] < m_Doc->MasterItems.count())
+						Itn = m_Doc->MasterItems.at(itemRemapM[lc.value()]);
+					if (!Its || !Itn || !Its->testLinkCandidate(Itn))
 					{
-						PageItem * Its = m_Doc->MasterItems.at(lc.key());
-						PageItem * Itn = m_Doc->MasterItems.at(itemRemapM[lc.value()]);
-						if (!Its->testLinkCandidate(Itn))
-						{
-							qDebug() << "scribus150format: corruption in linked textframes detected";
-							continue;
-						}
-						Its->link(Itn);
+						qDebug() << "scribus150format: corruption in linked textframes detected";
+						continue;
 					}
+					Its->link(Itn);
 				}
 			}
 		}




More information about the scribus-commit mailing list