r18275 by jghali - some fixes for loading of legacy tables

scribus-commit scribus-commit at lists.scribus.net
Wed May 1 12:02:10 UTC 2013


Author: jghali
Date: Wed May  1 12:02:10 2013
New Revision: 18275

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18275
Log:
some fixes for loading of legacy tables

Modified:
    trunk/Scribus/scribus/util.cpp

Modified: trunk/Scribus/scribus/util.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18275&path=/trunk/Scribus/scribus/util.cpp
==============================================================================
--- trunk/Scribus/scribus/util.cpp (original)
+++ trunk/Scribus/scribus/util.cpp Wed May  1 12:02:10 2013
@@ -1046,6 +1046,11 @@
 	m_Doc->dontResize = true;
 	int z = m_Doc->itemAdd(PageItem::Table, PageItem::Unspecified, gItem->xPos(), gItem->yPos(), gItem->width(), gItem->height(), 0.0, CommonStrings::None, CommonStrings::None, true);
 	PageItem_Table* currItem = m_Doc->Items->takeAt(z)->asTable();
+
+	currItem->LayerID = gItem->LayerID;
+	currItem->OwnPage = gItem->OwnPage;
+	currItem->OnMasterPage = gItem->OnMasterPage;
+
 	currItem->insertRows(0, rowHeights.count()-1);
 	m_Doc->dontResize = true;
 	currItem->insertColumns(0, colWidths.count()-1);
@@ -1121,12 +1126,16 @@
 		if (groupStackT->count() > 0)
 		{
 			int ii = groupStackT->top().indexOf(gItem);
-			groupStackT->top().replace(ii, currItem);
+			if (ii >= 0)
+				groupStackT->top().replace(ii, currItem);
 		}
 	}
 	while (!gpL.isEmpty())
 	{
-		delete gpL.takeFirst();
+		PageItem* item = gpL.takeFirst();
+		if (item->asTextFrame())
+			item->dropLinks();
+		delete item;
 	}
 	delete gItem;
 }




More information about the scribus-commit mailing list