r16252 by fschmid - More work on minimizing filesize.

scribus-commit scribus-commit at lists.scribus.net
Sat Jan 15 10:49:20 CET 2011


Author: fschmid
Date: Sat Jan 15 09:49:19 2011
New Revision: 16252

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16252
Log:
More work on minimizing filesize.

Modified:
    trunk/Scribus/scribus/fpointarray.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/plugins/import/ps/importps.cpp

Modified: trunk/Scribus/scribus/fpointarray.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16252&path=/trunk/Scribus/scribus/fpointarray.cpp
==============================================================================
--- trunk/Scribus/scribus/fpointarray.cpp (original)
+++ trunk/Scribus/scribus/fpointarray.cpp Sat Jan 15 09:49:19 2011
@@ -537,6 +537,7 @@
 					tmp += "Z ";
 				tmp += "M"+QString::number(np.x())+" "+QString::number(np.y())+" ";
 				nPath = false;
+				first = false;
 			}
 			np = point(poi);
 			np1 = point(poi+1);

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16252&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 Sat Jan 15 09:49:19 2011
@@ -3664,7 +3664,7 @@
 		}
 	}
 	else if (attrs.hasAttribute("copath"))
-		currItem->ContourLine.parseSVG(attrs.valueAsString("path"));
+		currItem->ContourLine.parseSVG(attrs.valueAsString("copath"));
 	else
 		currItem->ContourLine = currItem->PoLine.copy();
 

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16252&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 Sat Jan 15 09:49:19 2011
@@ -490,8 +490,10 @@
 			docu.writeAttribute("RGB",m_Doc->PageColors[itc.key()].nameRGB());
 		else
 			docu.writeAttribute("CMYK",m_Doc->PageColors[itc.key()].nameCMYK());
-		docu.writeAttribute("Spot",static_cast<int>(m_Doc->PageColors[itc.key()].isSpotColor()));
-		docu.writeAttribute("Register",static_cast<int>(m_Doc->PageColors[itc.key()].isRegistrationColor()));
+		if (m_Doc->PageColors[itc.key()].isSpotColor())
+			docu.writeAttribute("Spot",static_cast<int>(m_Doc->PageColors[itc.key()].isSpotColor()));
+		if (m_Doc->PageColors[itc.key()].isRegistrationColor())
+			docu.writeAttribute("Register",static_cast<int>(m_Doc->PageColors[itc.key()].isRegistrationColor()));
 	}
 	
 }
@@ -1283,9 +1285,10 @@
 			docu.writeAttribute("OnMasterPage", item->OnMasterPage);
 		if (!item->pixm.imgInfo.usedPath.isEmpty())
 			docu.writeAttribute("ImageClip", item->pixm.imgInfo.usedPath);
-		docu.writeAttribute("ImageRes", item->pixm.imgInfo.lowResType);
-		docu.writeAttribute("Pagenumber", item->pixm.imgInfo.actualPageNumber);
-		docu.writeAttribute("isInline", static_cast<int>(item->isEmbedded));
+		if (item->pixm.imgInfo.lowResType != 1)
+			docu.writeAttribute("ImageRes", item->pixm.imgInfo.lowResType);
+		if (item->isEmbedded)
+			docu.writeAttribute("isInline", 1);
 		if (!item->fillRule)
 			docu.writeAttribute("fillRule", 0);
 		if (item->doOverprint)
@@ -1677,15 +1680,13 @@
 	{
 		docu.writeAttribute("PWIDTH",item->lineWidth());
 		if (item->fillColor() != CommonStrings::None)
-		{
 			docu.writeAttribute("PCOLOR",item->fillColor());
+		if (item->fillShade() != 100)
 			docu.writeAttribute("SHADE",item->fillShade());
-		}
 		if (item->lineColor() != CommonStrings::None)
-		{
 			docu.writeAttribute("PCOLOR2",item->lineColor());
+		if (item->lineShade() != 100)
 			docu.writeAttribute("SHADE2",item->lineShade());
-		}
 		if (!item->NamedLStyle.isEmpty())
 			docu.writeAttribute("NAMEDLST",item->NamedLStyle);
 		if (item->PLineArt != 0)
@@ -1854,6 +1855,7 @@
 	if (((item->asImageFrame() && !(item->asLatexFrame())) || (item->asTextFrame())) && (!item->Pfile.isEmpty()))
 #endif
 	{
+		docu.writeAttribute("Pagenumber", item->pixm.imgInfo.actualPageNumber);
 		if (item->isInlineImage)
 		{
 			docu.writeAttribute("PFILE", "");
@@ -1897,10 +1899,14 @@
 		docu.writeAttribute("PFILE2",Path2Relative(item->Pfile2, baseDir));
 	if (!item->Pfile3.isEmpty())
 		docu.writeAttribute("PFILE3",Path2Relative(item->Pfile3, baseDir));
-	docu.writeAttribute("PRFILE",item->IProfile);
-	docu.writeAttribute("EPROF", item->EmProfile);
-	docu.writeAttribute("IRENDER",item->IRender);
-	docu.writeAttribute("EMBEDDED", item->UseEmbedded ? 1 : 0);
+	if (!item->IProfile.isEmpty())
+		docu.writeAttribute("PRFILE",item->IProfile);
+	if (!item->EmProfile.isEmpty())
+		docu.writeAttribute("EPROF", item->EmProfile);
+	if (item->IRender != 1)
+		docu.writeAttribute("IRENDER",item->IRender);
+	if (!item->UseEmbedded)
+		docu.writeAttribute("EMBEDDED", 0);
 	if (item->asImageFrame())
 	{
 		if (item->OverrideCompressionMethod)

Modified: trunk/Scribus/scribus/plugins/import/ps/importps.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16252&path=/trunk/Scribus/scribus/plugins/import/ps/importps.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ps/importps.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ps/importps.cpp Sat Jan 15 09:49:19 2011
@@ -551,6 +551,8 @@
 						ite->setFillTransparency(1.0 - Opacity);
 						ite->setTextFlowMode(PageItem::TextFlowDisabled);
 						m_Doc->AdjustItemSize(ite);
+						if (ite->itemType() == PageItem::Polygon)
+							ite->ContourLine = ite->PoLine.copy();
 						if ((groupStack.count() != 0) && (groupStackP.count() != 0))
 							groupStackP.top().append(ite);
 						Elements.append(ite);
@@ -595,6 +597,8 @@
 						ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
 						ite->setLineTransparency(1.0 - Opacity);
 						m_Doc->AdjustItemSize(ite);
+						if (ite->itemType() == PageItem::Polygon)
+							ite->ContourLine = ite->PoLine.copy();
 						ite->setLineWidth(LineW);
 						ite->setTextFlowMode(PageItem::TextFlowDisabled);
 						if ((groupStack.count() != 0) && (groupStackP.count() != 0))
@@ -627,6 +631,7 @@
 						ite->setWidthHeight(wh.x(),wh.y());
 						ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
 						m_Doc->AdjustItemSize(ite, true);
+						ite->ContourLine = ite->PoLine.copy();
 						ite->setItemName( tr("Group%1").arg(m_Doc->GroupCounter));
 						ite->AutoName = false;
 						ite->setTextFlowMode(PageItem::TextFlowDisabled);
@@ -656,6 +661,7 @@
 							ite->setWidthHeight(wh.x(),wh.y());
 							ite->Clip = FlattenPath(ite->PoLine, ite->Segments);
 							m_Doc->AdjustItemSize(ite, true);
+							ite->ContourLine = ite->PoLine.copy();
 							ite->setItemName( tr("Group%1").arg(m_Doc->GroupCounter));
 							ite->AutoName = false;
 							ite->setTextFlowMode(PageItem::TextFlowDisabled);




More information about the scribus-commit mailing list