r19901 by craig - #12940: Fix qHash returning uints when we are only storing ints. Basic fix for 1.5.0

scribus-commit scribus-commit at lists.scribus.net
Wed Mar 4 21:48:56 UTC 2015


Author: craig
Date: Wed Mar  4 21:48:56 2015
New Revision: 19901

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19901
Log:
#12940: Fix qHash returning uints when we are only storing ints. Basic fix for 1.5.0

Modified:
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/scpage.cpp

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19901&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 Wed Mar  4 21:48:56 2015
@@ -544,7 +544,7 @@
 		docu.writeAttribute("Text",(*itbm).Text);
 		docu.writeAttribute("Aktion",(*itbm).Aktion);
 		docu.writeAttribute("ItemNr", (*itbm).ItemNr);
-		docu.writeAttribute("Element", qHash((*itbm).PageObject));
+		docu.writeAttribute("Element", qHash((*itbm).PageObject) & 0x7FFFFFFF);
 		docu.writeAttribute("First", (*itbm).First);
 		docu.writeAttribute("Last", (*itbm).Last);
 		docu.writeAttribute("Prev", (*itbm).Prev);
@@ -1249,7 +1249,7 @@
 		{
 			const PageItem* item = mrk->getItemPtr();
 			assert(item != NULL);
-			docu.writeAttribute("ItemID", qHash(item));
+			docu.writeAttribute("ItemID", qHash(item) & 0x7FFFFFFF);
 			//docu.writeAttribute("itemName", item->itemName());
 		}
 		else if (mrk->isType(MARKVariableTextType) && mrk->hasString())
@@ -1338,7 +1338,7 @@
 			docu.writeEmptyElement("ENDNOTEFRAME");
 			docu.writeAttribute("NSname", NS->name());
 			docu.writeAttribute("range", (int) NS->range());
-			docu.writeAttribute("myID", qHash(nF));
+			docu.writeAttribute("myID", qHash(nF) & 0x7FFFFFFF);
 			//docu.writeAttribute("name", nF->itemName());
 			
 			rangeItem rI = m_Doc->m_docEndNotesFramesMap.value(nF);
@@ -1347,16 +1347,16 @@
 			else if (NS->range() == NSRpage)
 				docu.writeAttribute("index", rI.page->pageNr());
 			else if (NS->range() == NSRstory)
-				docu.writeAttribute("ItemID", qHash(rI.firstStoryFrame));
+				docu.writeAttribute("ItemID", qHash(rI.firstStoryFrame) & 0x7FFFFFFF);
 				//docu.writeAttribute("item", rI.firstStoryFrame->itemName());
 		}
 		else //footnotes frame
 		{
 			docu.writeEmptyElement("FOOTNOTEFRAME");
 			docu.writeAttribute("NSname", NS->name());
-			docu.writeAttribute("myID", qHash(nF));
+			docu.writeAttribute("myID", qHash(nF) & 0x7FFFFFFF);
 			//docu.writeAttribute("name", nF->itemName());
-			docu.writeAttribute("MasterID", qHash(nF->masterFrame()));
+			docu.writeAttribute("MasterID", qHash(nF->masterFrame()) & 0x7FFFFFFF);
 			//docu.writeAttribute("master",nF->masterFrame()->itemName());
 		}
 	}
@@ -1929,12 +1929,12 @@
 		if (item->asTextFrame() || item->asPathText() || item->asImageFrame())
 		{
 			if (item->nextInChain() != 0)
-				docu.writeAttribute("NEXTITEM", qHash(item->nextInChain()));
+				docu.writeAttribute("NEXTITEM", qHash(item->nextInChain()) & 0x7FFFFFFF);
 			else
 				docu.writeAttribute("NEXTITEM", -1);
 			
 			if (item->prevInChain() != 0 && items->contains(item->prevInChain()))
-				docu.writeAttribute("BACKITEM", qHash(item->prevInChain()));
+				docu.writeAttribute("BACKITEM", qHash(item->prevInChain()) & 0x7FFFFFFF);
 			else
 			{
 				docu.writeAttribute("BACKITEM", -1);
@@ -1960,7 +1960,7 @@
 				if (pIt->isAutoNoteFrame())
 					continue;
 				docu.writeEmptyElement("WeldEntry");
-				docu.writeAttribute("Target", qHash(wInf.weldItem));
+				docu.writeAttribute("Target", qHash(wInf.weldItem) & 0x7FFFFFFF);
 				docu.writeAttribute("WX", wInf.weldPoint.x());
 				docu.writeAttribute("WY", wInf.weldPoint.y());
 			}
@@ -2406,7 +2406,7 @@
 //	double xf, yf;
 	QString tmp, tmpy;
 	docu.writeAttribute("OwnPage", item->OwnPage);
-	docu.writeAttribute("ItemID", qHash(item));
+	docu.writeAttribute("ItemID", qHash(item) & 0x7FFFFFFF);
 	docu.writeAttribute("PTYPE",item->realItemType());
 	docu.writeAttribute("WIDTH",item->width());
 	docu.writeAttribute("HEIGHT",item->height());
@@ -2463,7 +2463,7 @@
 		if (isWelded)
 		{
 			docu.writeAttribute("isWeldItem", 1);
-			docu.writeAttribute("WeldSource", qHash(item));
+			docu.writeAttribute("WeldSource", qHash(item) & 0x7FFFFFFF);
 		}
 	}
 	if (item->asRegularPolygon())

Modified: trunk/Scribus/scribus/scpage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19901&path=/trunk/Scribus/scribus/scpage.cpp
==============================================================================
--- trunk/Scribus/scribus/scpage.cpp (original)
+++ trunk/Scribus/scribus/scpage.cpp Wed Mar  4 21:48:56 2015
@@ -427,6 +427,7 @@
 
 void ScPage::restorePageItemConversionToSymbol(ScItemState<std::pair<PageItem*, PageItem*> >* state, bool isUndo)
 {
+	//#11365... this code is not finished and broken... fixing will fix 11365
 	if (!state)
 		return;
 




More information about the scribus-commit mailing list