r18801 by fschmid - Fixed Bug #12025: SVG import crashes Scribus

scribus-commit scribus-commit at lists.scribus.net
Sat Feb 8 17:48:25 UTC 2014


Author: fschmid
Date: Sat Feb  8 17:48:23 2014
New Revision: 18801

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18801
Log:
Fixed Bug #12025: SVG import crashes Scribus

Modified:
    trunk/Scribus/scribus/canvasmode_nodeedit.cpp
    trunk/Scribus/scribus/fpointarray.cpp
    trunk/Scribus/scribus/fpointarray.h
    trunk/Scribus/scribus/pageitem_polyline.cpp
    trunk/Scribus/scribus/pageitem_spiral.cpp
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
    trunk/Scribus/scribus/plugins/import/pages/importpages.h
    trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
    trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
    trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
    trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
    trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
    trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp
    trunk/Scribus/scribus/plugins/xpsexport/xpsexplugin.cpp
    trunk/Scribus/scribus/pslib.cpp
    trunk/Scribus/scribus/scpageoutput.cpp
    trunk/Scribus/scribus/scpainter.cpp
    trunk/Scribus/scribus/scpainterex_cairo.cpp
    trunk/Scribus/scribus/scpainterex_ps2.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/third_party/lib2geom/scribushelper.cpp
    trunk/Scribus/scribus/util_math.cpp

Modified: trunk/Scribus/scribus/canvasmode_nodeedit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/canvasmode_nodeedit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.cpp Sat Feb  8 17:48:23 2014
@@ -91,7 +91,7 @@
 	{
 		for (int poi=0; poi<cli.size()-3; poi += 4)
 		{
-			if (cli.point(poi).x() > 900000)
+			if (cli.isMarker(poi))
 				continue;
 			p->setPen(QPen(Qt::blue, onePerScale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
 			FPoint a1 = cli.point(poi);
@@ -110,7 +110,7 @@
 	// draw points
 	for (int a = 0; a < cli.size()-1; a += 2)
 	{
-		if (cli.point(a).x() > 900000)
+		if (cli.isMarker(a))
 			continue;
 		if (m_doc->nodeEdit.EdPoints)
 		{
@@ -198,7 +198,7 @@
 		}
 		for (int a = 0; a < Clip.size(); ++a)
 		{
-			if (Clip.point(a).x() > 900000)
+			if (Clip.isMarker(a))
 				continue;
 			FPoint np = Clip.point(a);
 			FPoint npf2 = np.transformPoint(pm2, false);
@@ -564,7 +564,7 @@
 	{
 		for (int n = m_doc->nodeEdit.ClRe; n < Clip.size(); ++n)
 		{
-			if (Clip.point(n).x() > 900000)
+			if (Clip.isMarker(n))
 			{
 				EndInd = n;
 				break;
@@ -574,7 +574,7 @@
 		{
 			if (n2 == 0)
 				break;
-			if (Clip.point(n2).x() > 900000)
+			if (Clip.isMarker(n2))
 			{
 				StartInd = n2 + 1;
 				break;
@@ -665,7 +665,7 @@
 				StartInd = 0;
 				for (int n = m_doc->nodeEdit.ClRe; n < Clip.size(); ++n)
 				{
-					if (Clip.point(n).x() > 900000)
+					if (Clip.isMarker(n))
 					{
 						EndInd = n;
 						break;
@@ -677,7 +677,7 @@
 					{
 						if (n2 == 0)
 							break;
-						if (Clip.point(n2).x() > 900000)
+						if (Clip.isMarker(n2))
 						{
 							StartInd = n2 + 1;
 							break;

Modified: trunk/Scribus/scribus/fpointarray.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/fpointarray.cpp
==============================================================================
--- trunk/Scribus/scribus/fpointarray.cpp (original)
+++ trunk/Scribus/scribus/fpointarray.cpp Sat Feb  8 17:48:23 2014
@@ -33,6 +33,7 @@
 #include <QVector>
 
 #include "util.h"
+#include "sclimits.h"
 
 using namespace std;
 
@@ -183,7 +184,7 @@
 	pend += QVector<FPoint>::count();
 	for (Iterator p = begin(); p != pend; p++)
 	{
-		if (p->x() < 900000)
+		if (!isMarkerI(p))
 			*p += pt;
 	}
 }
@@ -194,9 +195,8 @@
 	pend += QVector<FPoint>::count();
 	for (Iterator p = begin(); p != pend; p++)
 	{
-		if (p->x() < 900000) {
+		if (!isMarkerI(p))
 			p->setXY(p->x() * sx, p->y() * sy);
-		}
 	}
 }
 
@@ -213,7 +213,7 @@
 	miny = maxy = pd->yp;
 	for ( ++pd; pd != pend; ++pd )
 	{	// find min+max x and y
-		if (pd->xp > 900000)
+		if (isMarkerI(pd))
 		{
 			continue;
 		}
@@ -244,7 +244,7 @@
 	pend += QVector<FPoint>::count();
 	for (Iterator p = begin(); p != pend; p++)
 	{
-		if (p->xp > 900000)
+		if (isMarkerD(p->xp, p->yp))
 		{
 			mx = p->xp;
 			my = p->yp;
@@ -261,10 +261,27 @@
 
 void FPointArray::setMarker()
 {
-	addQuadPoint(999999.0, 999999.0,
-				999999.0, 999999.0,
-				999999.0, 999999.0,
-				999999.0, 999999.0);
+	double maxVal = std::numeric_limits<double>::max() / 2.0;
+	addQuadPoint(maxVal, maxVal, maxVal, maxVal, maxVal, maxVal, maxVal, maxVal);
+}
+
+bool FPointArray::isMarker(int pos) const
+{
+	double maxVal = std::numeric_limits<double>::max() / 3.0;
+	const FPoint& p = QVector<FPoint>::at(pos);
+	return ((p.x() >= maxVal) && (p.y() >= maxVal));
+}
+
+bool FPointArray::isMarkerI(ConstIterator p) const
+{
+	double maxVal = std::numeric_limits<double>::max() / 3.0;
+	return ((p->xp >= maxVal) && (p->yp >= maxVal));
+}
+
+bool FPointArray::isMarkerD(double x, double y) const
+{
+	double maxVal = std::numeric_limits<double>::max() / 3.0;
+	return ((x >= maxVal) && (y >= maxVal));
 }
 
 void FPointArray::addPoint(double x, double y)
@@ -485,7 +502,7 @@
 	{
 		for (int poi=0; poi < size()-3; poi += 4)
 		{
-			if (point(poi).x() > 900000)
+			if (isMarker(poi))
 			{
 				nPath = true;
 				continue;
@@ -527,7 +544,7 @@
 	{
 		for (int poi = 0; poi < size()-3; poi += 4)
 		{
-			if (point(poi).x() > 900000)
+			if (isMarker(poi))
 			{
 				nPath = true;
 				continue;

Modified: trunk/Scribus/scribus/fpointarray.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/fpointarray.h
==============================================================================
--- trunk/Scribus/scribus/fpointarray.h (original)
+++ trunk/Scribus/scribus/fpointarray.h Sat Feb  8 17:48:23 2014
@@ -64,6 +64,9 @@
 	FPointArray &operator=( const FPointArray &a );
 	FPointArray copy() const;
 	void setMarker();
+	bool isMarker(int pos) const;
+	bool isMarkerI(ConstIterator p) const;
+	bool isMarkerD(double x, double y) const;
 	void addPoint(double x, double y);
 	void addPoint(FPoint p);
 	bool hasLastQuadPoint(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) const;

Modified: trunk/Scribus/scribus/pageitem_polyline.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/pageitem_polyline.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_polyline.cpp (original)
+++ trunk/Scribus/scribus/pageitem_polyline.cpp Sat Feb  8 17:48:23 2014
@@ -69,7 +69,7 @@
 					Start = PoLine.point(n);
 					firstp = false;
 				}
-				if (PoLine.point(n).x() > 900000)
+				if (PoLine.isMarker(n))
 				{
 					cli.addPoint(PoLine.point(n-2));
 					cli.addPoint(PoLine.point(n-2));

Modified: trunk/Scribus/scribus/pageitem_spiral.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/pageitem_spiral.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_spiral.cpp (original)
+++ trunk/Scribus/scribus/pageitem_spiral.cpp Sat Feb  8 17:48:23 2014
@@ -75,7 +75,7 @@
 					Start = PoLine.point(n);
 					firstp = false;
 				}
-				if (PoLine.point(n).x() > 900000)
+				if (PoLine.isMarker(n))
 				{
 					cli.addPoint(PoLine.point(n-2));
 					cli.addPoint(PoLine.point(n-2));

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Sat Feb  8 17:48:23 2014
@@ -1225,10 +1225,10 @@
 				UsedFontsP.insert(it.key(), "/Fo"+QString::number(a));
 				uint SubFonts = 0;
 				int glyphCount = 0;
-				double minx = 999999.9;
-				double miny = 999999.9;
-				double maxx = -999999.9;
-				double maxy = -999999.9;
+				double minx =  std::numeric_limits<double>::max();
+				double miny =  std::numeric_limits<double>::max();
+				double maxx = -std::numeric_limits<double>::max();
+				double maxy = -std::numeric_limits<double>::max();
 				QList<uint> glyphWidths;
 				QStringList charProcs;
 				QString encoding = "<< /Type /Encoding\n/Differences [ 0\n";
@@ -1252,7 +1252,7 @@
 						gly.translate(0, 1000);
 						for (int poi = 0; poi < gly.size()-3; poi += 4)
 						{
-							if (gly.point(poi).x() > 900000)
+							if (gly.isMarker(poi))
 							{
 								fon += "h\n";
 								nPath = true;
@@ -1339,10 +1339,10 @@
 //						glyphMapping.clear();
 						glyphCount = 0;
 						++SubFonts;
-						minx = 999999.9;
-						miny = 999999.9;
-						maxx = -999999.9;
-						maxy = -999999.9;
+						minx =  std::numeric_limits<double>::max();
+						miny =  std::numeric_limits<double>::max();
+						maxx = -std::numeric_limits<double>::max();
+						maxy = -std::numeric_limits<double>::max();
 						encoding = "<< /Type /Encoding\n/Differences [ 0\n";
 					}
 				}
@@ -1366,7 +1366,7 @@
 						gly.map(mat);
 						for (int poi = 0; poi < gly.size()-3; poi += 4)
 						{
-							if (gly.point(poi).x() > 900000)
+							if (gly.isMarker(poi))
 							{
 								fon += "h\n";
 								nPath = true;
@@ -5472,7 +5472,7 @@
 					{
 						for (int poi=0; poi<gly.size()-3; poi += 4)
 						{
-							if (gly.point(poi).x() > 900000)
+							if (gly.isMarker(poi))
 							{
 								tmp2 += "h\n";
 								nPath = true;
@@ -5577,7 +5577,7 @@
 					{
 						for (int poi=0; poi<gly.size()-3; poi += 4)
 						{
-							if (gly.point(poi).x() > 900000)
+							if (gly.isMarker(poi))
 							{
 								tmp2 += "h\n";
 								nPath = true;
@@ -5866,7 +5866,7 @@
 
 	for (int poi=0; poi<ite->PoLine.size()-3; poi += 4)
 	{
-		if (ite->PoLine.point(poi).x() > 900000)
+		if (ite->PoLine.isMarker(poi))
 		{
 			nPath = true;
 			continue;
@@ -5910,7 +5910,7 @@
 
 	for (int poi=0; poi<ite->size()-3; poi += 4)
 	{
-		if (ite->point(poi).x() > 900000)
+		if (ite->isMarker(poi))
 		{
 			nPath = true;
 			continue;
@@ -5952,7 +5952,7 @@
 	bool nPath = true;
 	for (int poi=0; poi<ite->imageClip.size()-3; poi += 4)
 	{
-		if (ite->imageClip.point(poi).x() > 900000)
+		if (ite->imageClip.isMarker(poi))
 		{
 			tmp += "h\n";
 			nPath = true;

Modified: trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pages/importpages.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pages/importpages.cpp Sat Feb  8 17:48:23 2014
@@ -200,6 +200,7 @@
 	bool ret = false;
 	firstPage = true;
 	pagecount = 1;
+	mpagecount = 0;
 	QFileInfo fi = QFileInfo(fName);
 	if ( !ScCore->usingGUI() )
 	{
@@ -389,10 +390,8 @@
 	bool retVal = true;
 	importedColors.clear();
 	importedPatterns.clear();
-	m_objStyles.clear();
-	m_parStyles.clear();
-	m_chrStyles.clear();
-	m_layoutStyles.clear();
+	m_StyleSheets.clear();
+	m_currentStyleSheet = "";
 	if(progressDialog)
 	{
 		progressDialog->setOverallProgress(2);
@@ -488,9 +487,53 @@
 			baseX = m_Doc->currentPage()->xOffset();
 			baseY = m_Doc->currentPage()->yOffset();
 		}
+		else if (drawPag.tagName() == "sl:section-prototypes")
+		{
+			for(QDomElement sp = drawPag.firstChildElement(); !sp.isNull(); sp = sp.nextSiblingElement() )
+			{
+				if (sp.tagName() == "sl:prototype")
+				{
+					QString pageNam = sp.attribute("sl:name");
+					if (!pageNam.isEmpty())
+					{
+						if (importerFlags & LoadSavePlugin::lfCreateDoc)
+						{
+							m_Doc->setMasterPageMode(true);
+							ScPage *oldCur = m_Doc->currentPage();
+							ScPage *addedPage = m_Doc->addMasterPage(mpagecount, pageNam);
+							m_Doc->setCurrentPage(addedPage);
+							addedPage->MPageNam = "";
+							m_Doc->view()->addPage(mpagecount, true);
+							baseX = addedPage->xOffset();
+							baseY = addedPage->yOffset();
+							mpagecount++;
+							for(QDomElement spd = sp.firstChildElement(); !spd.isNull(); spd = spd.nextSiblingElement() )
+							{
+								if (spd.tagName() == "sl:stylesheet")
+								{
+									parseStyleSheets(spd);
+									m_currentStyleSheet = spd.attribute("sfa:ID");
+								}
+								else if (spd.tagName() == "sl:drawables")
+								{
+									for(QDomElement spe = spd.firstChildElement(); !spe.isNull(); spe = spe.nextSiblingElement() )
+									{
+										if (spe.tagName() == "sl:page-group")
+											parsePageReference(spe);
+									}
+								}
+							}
+							m_Doc->setCurrentPage(oldCur);
+							m_Doc->setMasterPageMode(false);
+						}
+					}
+				}
+			}
+		}
 		else if (drawPag.tagName() == "sl:stylesheet")
 		{
 			parseStyleSheets(drawPag);
+			m_currentStyleSheet = drawPag.attribute("sfa:ID");
 		}
 		else if (drawPag.tagName() == "sl:drawables")
 		{
@@ -544,12 +587,109 @@
 				}
 			}
 		}
+		else if (drawPag.tagName() == "sf:text-storage")
+		{
+			for(QDomElement spf = drawPag.firstChildElement(); !spf.isNull(); spf = spf.nextSiblingElement() )
+			{
+				if (spf.tagName() == "sf:stylesheet-ref")
+				{
+					m_currentStyleSheet = spf.attribute("sfa:IDREF");
+				}
+				else if (spf.tagName() == "sf:text-body")
+				{
+					int txPage = 0;
+					StoryText itemText;
+					itemText.clear();
+					itemText.setDoc(m_Doc);
+					int posC = 0;
+					QString pStyle = CommonStrings::DefaultParagraphStyle;
+					ParagraphStyle newStyle;
+					newStyle.setDefaultStyle(false);
+					newStyle.setParent(pStyle);
+					ParagraphStyle ttx = m_Doc->paragraphStyle(pStyle);
+					CharStyle nstyle = ttx.charStyle();
+					newStyle.setLineSpacingMode(ParagraphStyle::FixedLineSpacing);
+					newStyle.setLineSpacing(nstyle.fontSize() / 10.0);
+					itemText.setDefaultStyle(newStyle);
+					for(QDomElement spg = spf.firstChildElement(); !spg.isNull(); spg = spg.nextSiblingElement() )
+					{
+						if (spg.tagName() == "sf:container-hint")
+						{
+							txPage = spg.attribute("sf:page-index").toInt();
+						}
+						else if (spg.tagName() == "sf:p")
+						{
+							ParagraphStyle tmpStyle = newStyle;
+							if (!spg.attribute("sf:style").isEmpty())
+							{
+								if (m_Doc->styleExists(spg.attribute("sf:style")))
+									tmpStyle = m_Doc->paragraphStyle(spg.attribute("sf:style"));
+								else
+								{
+									tmpStyle.setName(spg.attribute("sf:style"));
+									applyParagraphAttrs(tmpStyle, tmpStyle.charStyle(), spg.attribute("sf:style"));
+									StyleSet<ParagraphStyle>tmp;
+									tmp.create(tmpStyle);
+									m_Doc->redefineStyles(tmp, false);
+								}
+							}
+							int totalCount = 0;
+							if (spg.hasChildNodes())
+							{
+								for(QDomElement sph = spg.firstChildElement(); !sph.isNull(); sph = sph.nextSiblingElement() )
+								{
+									totalCount += sph.text().length();
+									if (sph.tagName() == "sf:container-hint")
+									{
+										txPage = sph.attribute("sf:page-index").toInt();
+									}
+								}
+							}
+							int count = spg.text().length();
+							QString tgText = spg.text();
+							tgText = tgText.left(count - totalCount);
+							if (tgText.length() > 0)
+							{
+								itemText.insertChars(posC, tgText);
+								itemText.applyStyle(posC, tmpStyle);
+								itemText.applyCharStyle(posC, count - totalCount, tmpStyle.charStyle());
+								posC = itemText.length();
+							}
+							if (spg.hasChildNodes())
+							{
+								for(QDomElement sph = spg.firstChildElement(); !sph.isNull(); sph = sph.nextSiblingElement() )
+								{
+									if (sph.tagName() == "sf:span")
+									{
+										CharStyle tmpCStyle = tmpStyle.charStyle();
+										applyCharAttrs(tmpCStyle, sph.attribute("sf:style"));
+										int count = sph.text().length();
+										if (count > 0)
+										{
+											itemText.insertChars(posC, sph.text());
+											itemText.applyStyle(posC, tmpStyle);
+											itemText.applyCharStyle(posC, count, tmpCStyle);
+											posC = itemText.length();
+										}
+									}
+								}
+							}
+							itemText.insertChars(posC, SpecialChars::PARSEP);
+							itemText.applyStyle(posC, tmpStyle);
+							posC = itemText.length();
+						}
+					}
+				}
+			}
+		}
 	}
 	return true;
 }
 
 void PagesPlug::parseStyleSheets(QDomElement &drawPag)
 {
+	QString sheetName = drawPag.attribute("sfa:ID");
+	StyleSheet styleSH;
 	for(QDomElement sp = drawPag.firstChildElement(); !sp.isNull(); sp = sp.nextSiblingElement() )
 	{
 		if ((sp.tagName() == "sf:styles") || (sp.tagName() == "sf:anon-styles"))
@@ -652,11 +792,11 @@
 					QString i = spd.attribute("sf:ident");
 					QString i2 = spd.attribute("sf:name");
 					if (!id.isEmpty())
-						m_chrStyles.insert(id, currStyle);
+						styleSH.m_chrStyles.insert(id, currStyle);
 					else if (!i.isEmpty())
-						m_chrStyles.insert(i, currStyle);
+						styleSH.m_chrStyles.insert(i, currStyle);
 					else if (!i2.isEmpty())
-						m_chrStyles.insert(i2, currStyle);
+						styleSH.m_chrStyles.insert(i2, currStyle);
 				}
 				if (spd.tagName() == "sf:paragraphstyle")
 				{
@@ -763,11 +903,11 @@
 					QString i = spd.attribute("sf:ident");
 					QString i2 = spd.attribute("sf:name");
 					if (!id.isEmpty())
-						m_parStyles.insert(id, currStyle);
+						styleSH.m_parStyles.insert(id, currStyle);
 					else if (!i.isEmpty())
-						m_parStyles.insert(i, currStyle);
+						styleSH.m_parStyles.insert(i, currStyle);
 					else if (!i2.isEmpty())
-						m_parStyles.insert(i2, currStyle);
+						styleSH.m_parStyles.insert(i2, currStyle);
 				}
 				else if (spd.tagName() == "sf:layoutstyle")
 				{
@@ -801,11 +941,11 @@
 					QString i = spd.attribute("sf:ident");
 					QString i2 = spd.attribute("sf:name");
 					if (!id.isEmpty())
-						m_layoutStyles.insert(id, currStyle);
+						styleSH.m_layoutStyles.insert(id, currStyle);
 					else if (!i.isEmpty())
-						m_layoutStyles.insert(i, currStyle);
+						styleSH.m_layoutStyles.insert(i, currStyle);
 					else if (!i2.isEmpty())
-						m_layoutStyles.insert(i2, currStyle);
+						styleSH.m_layoutStyles.insert(i2, currStyle);
 				}
 				else if (spd.tagName() == "sf:graphic-style")
 				{
@@ -970,15 +1110,16 @@
 					QString i = spd.attribute("sf:ident");
 					QString i2 = spd.attribute("sf:name");
 					if (!id.isEmpty())
-						m_objStyles.insert(id, currStyle);
+						styleSH.m_objStyles.insert(id, currStyle);
 					else if (!i.isEmpty())
-						m_objStyles.insert(i, currStyle);
+						styleSH.m_objStyles.insert(i, currStyle);
 					else if (!i2.isEmpty())
-						m_objStyles.insert(i2, currStyle);
-				}
-			}
-		}
-	}
+						styleSH.m_objStyles.insert(i2, currStyle);
+				}
+			}
+		}
+	}
+	m_StyleSheets.insert(sheetName, styleSH);
 }
 
 void PagesPlug::parsePageReference(QDomElement &drawPag)
@@ -1418,17 +1559,20 @@
 
 void PagesPlug::applyParagraphAttrs(ParagraphStyle &newStyle, CharStyle &tmpCStyle, QString pAttrs)
 {
-	if (m_parStyles.contains(pAttrs))
+	if (!m_StyleSheets.contains(m_currentStyleSheet))
+		return;
+	StyleSheet currSH = m_StyleSheets[m_currentStyleSheet];
+	if (currSH.m_parStyles.contains(pAttrs))
 	{
 		ParStyle actStyle;
-		ParStyle currStyle = m_parStyles[pAttrs];
+		ParStyle currStyle = currSH.m_parStyles[pAttrs];
 		QStringList parents;
 		while (currStyle.parentStyle.valid)
 		{
-			if (m_parStyles.contains(currStyle.parentStyle.value))
+			if (currSH.m_parStyles.contains(currStyle.parentStyle.value))
 			{
 				parents.prepend(currStyle.parentStyle.value);
-				currStyle = m_parStyles[currStyle.parentStyle.value];
+				currStyle = currSH.m_parStyles[currStyle.parentStyle.value];
 			}
 			else
 				break;
@@ -1438,7 +1582,7 @@
 		{
 			for (int p = 0; p < parents.count(); p++)
 			{
-				currStyle = m_parStyles[parents[p]];
+				currStyle = currSH.m_parStyles[parents[p]];
 				if (currStyle.fontName.valid)
 					actStyle.fontName = AttributeValue(currStyle.fontName.value);
 				if (currStyle.fontSize.valid)
@@ -1474,17 +1618,20 @@
 
 void PagesPlug::applyCharAttrs(CharStyle &tmpCStyle, QString pAttrs)
 {
-	if (m_chrStyles.contains(pAttrs))
+	if (!m_StyleSheets.contains(m_currentStyleSheet))
+		return;
+	StyleSheet currSH = m_StyleSheets[m_currentStyleSheet];
+	if (currSH.m_chrStyles.contains(pAttrs))
 	{
 		ChrStyle actStyle;
-		ChrStyle currStyle = m_chrStyles[pAttrs];
+		ChrStyle currStyle = currSH.m_chrStyles[pAttrs];
 		QStringList parents;
 		while (currStyle.parentStyle.valid)
 		{
-			if (m_chrStyles.contains(currStyle.parentStyle.value))
+			if (currSH.m_chrStyles.contains(currStyle.parentStyle.value))
 			{
 				parents.prepend(currStyle.parentStyle.value);
-				currStyle = m_chrStyles[currStyle.parentStyle.value];
+				currStyle = currSH.m_chrStyles[currStyle.parentStyle.value];
 			}
 			else
 				break;
@@ -1494,7 +1641,7 @@
 		{
 			for (int p = 0; p < parents.count(); p++)
 			{
-				currStyle = m_chrStyles[parents[p]];
+				currStyle = currSH.m_chrStyles[parents[p]];
 				if (currStyle.fontName.valid)
 					actStyle.fontName = AttributeValue(currStyle.fontName.value);
 				if (currStyle.fontSize.valid)
@@ -1523,138 +1670,142 @@
 	item->OldH2 = item->height();
 	item->updateClip();
 	item->OwnPage = m_Doc->OnPage(item);
-	if (!obState.layoutStyleRef.isEmpty())
-	{
-		if (m_layoutStyles.contains(obState.layoutStyleRef))
-		{
-			LayoutStyle actStyle;
-			LayoutStyle currStyle = m_layoutStyles[obState.layoutStyleRef];
-			QStringList parents;
-			while (currStyle.parentStyle.valid)
-			{
-				if (m_layoutStyles.contains(currStyle.parentStyle.value))
-				{
-					parents.prepend(currStyle.parentStyle.value);
-					currStyle = m_layoutStyles[currStyle.parentStyle.value];
-				}
-				else
-					break;
-			}
-			parents.append(obState.layoutStyleRef);
-			double textMarginLeft = 0.0;
-			double textMarginRight = 0.0;
-			double textMarginTop = 0.0;
-			double textMarginBottom = 0.0;
-			double textColumnGap = 0.0;
-			int textColumnCount = 1;
-			if (!parents.isEmpty())
-			{
-				for (int p = 0; p < parents.count(); p++)
-				{
-					currStyle = m_layoutStyles[parents[p]];
-					if (currStyle.Extra.valid)
-						actStyle.Extra = AttributeValue(currStyle.Extra.value);
-					if (currStyle.RExtra.valid)
-						actStyle.RExtra = AttributeValue(currStyle.RExtra.value);
-					if (currStyle.TExtra.valid)
-						actStyle.TExtra = AttributeValue(currStyle.TExtra.value);
-					if (currStyle.BExtra.valid)
-						actStyle.BExtra = AttributeValue(currStyle.BExtra.value);
-					if (currStyle.TextColumnGutter.valid)
-						actStyle.TextColumnGutter = AttributeValue(currStyle.TextColumnGutter.value);
-					if (currStyle.TextColumnCount.valid)
-						actStyle.TextColumnCount = AttributeValue(currStyle.TextColumnCount.value);
-				}
-			}
-			if (actStyle.Extra.valid)
-				textMarginLeft = actStyle.Extra.value.toDouble();
-			if (actStyle.RExtra.valid)
-				textMarginRight = actStyle.RExtra.value.toDouble();
-			if (actStyle.TExtra.valid)
-				textMarginTop = actStyle.TExtra.value.toDouble();
-			if (actStyle.BExtra.valid)
-				textMarginBottom = actStyle.BExtra.value.toDouble();
-			if (actStyle.TextColumnGutter.valid)
-				textColumnGap = actStyle.TextColumnGutter.value.toDouble();
-			if (actStyle.TextColumnCount.valid)
-				textColumnCount = actStyle.TextColumnCount.value.toInt();
-			item->setTextToFrameDist(textMarginLeft, textMarginRight, textMarginTop, textMarginBottom);
-			item->setColumns(textColumnCount);
-			item->setColumnGap(textColumnGap);
-		}
-	}
-	if (!obState.styleRef.isEmpty())
-	{
-		if (m_objStyles.contains(obState.styleRef))
-		{
-			ObjStyle actStyle;
-			ObjStyle currStyle = m_objStyles[obState.styleRef];
-			QStringList parents;
-			while (currStyle.parentStyle.valid)
-			{
-				if (m_objStyles.contains(currStyle.parentStyle.value))
-				{
-					parents.prepend(currStyle.parentStyle.value);
-					currStyle = m_objStyles[currStyle.parentStyle.value];
-				}
-				else
-					break;
-			}
-			parents.append(obState.styleRef);
-			if (!parents.isEmpty())
-			{
-				for (int p = 0; p < parents.count(); p++)
-				{
-					currStyle = m_objStyles[parents[p]];
-					if (currStyle.CurrColorFill.valid)
-						actStyle.CurrColorFill = AttributeValue(currStyle.CurrColorFill.value);
-					if (currStyle.CurrColorStroke.valid)
-						actStyle.CurrColorStroke = AttributeValue(currStyle.CurrColorStroke.value);
-					if (currStyle.fillOpacity.valid)
-						actStyle.fillOpacity = AttributeValue(currStyle.fillOpacity.value);
-					if (currStyle.strokeOpacity.valid)
-						actStyle.strokeOpacity = AttributeValue(currStyle.strokeOpacity.value);
-					if (currStyle.opacity.valid)
-						actStyle.opacity = AttributeValue(currStyle.opacity.value);
-					if (currStyle.LineW.valid)
-						actStyle.LineW = AttributeValue(currStyle.LineW.value);
-					if (currStyle.CapStyle.valid)
-						actStyle.CapStyle = AttributeValue(currStyle.CapStyle.value);
-					if (currStyle.JoinStyle.valid)
-						actStyle.JoinStyle = AttributeValue(currStyle.JoinStyle.value);
-				}
-			}
-			if (actStyle.CurrColorFill.valid)
-				item->setFillColor(actStyle.CurrColorFill.value);
-			if (actStyle.CurrColorStroke.valid)
-				item->setLineColor(actStyle.CurrColorStroke.value);
-			if (actStyle.fillOpacity.valid)
-				item->setFillTransparency(actStyle.fillOpacity.value.toDouble());
-			if (actStyle.strokeOpacity.valid)
-				item->setLineTransparency(actStyle.strokeOpacity.value.toDouble());
-			if (actStyle.LineW.valid)
-				item->setLineWidth(actStyle.LineW.value.toDouble());
-			if (actStyle.CapStyle.valid)
-			{
-				if (actStyle.CapStyle.value == "butt")
-					item->setLineEnd(Qt::FlatCap);
-				else if (actStyle.CapStyle.value == "round")
-					item->setLineEnd(Qt::RoundCap);
-				else if (actStyle.CapStyle.value == "square")
-					item->setLineEnd(Qt::SquareCap);
-				else
-					item->setLineEnd(Qt::FlatCap);
-			}
-			if (actStyle.JoinStyle.valid)
-			{
-				if (actStyle.JoinStyle.value == "miter")
-					item->setLineJoin(Qt::MiterJoin);
-				else if (actStyle.JoinStyle.value == "round")
-					item->setLineJoin(Qt::RoundJoin);
-				else if (actStyle.JoinStyle.value == "bevel")
-					item->setLineJoin(Qt::BevelJoin);
-				else
-					item->setLineJoin(Qt::MiterJoin);
+	if (m_StyleSheets.contains(m_currentStyleSheet))
+	{
+		StyleSheet currSH = m_StyleSheets[m_currentStyleSheet];
+		if (!obState.layoutStyleRef.isEmpty())
+		{
+			if (currSH.m_layoutStyles.contains(obState.layoutStyleRef))
+			{
+				LayoutStyle actStyle;
+				LayoutStyle currStyle = currSH.m_layoutStyles[obState.layoutStyleRef];
+				QStringList parents;
+				while (currStyle.parentStyle.valid)
+				{
+					if (currSH.m_layoutStyles.contains(currStyle.parentStyle.value))
+					{
+						parents.prepend(currStyle.parentStyle.value);
+						currStyle = currSH.m_layoutStyles[currStyle.parentStyle.value];
+					}
+					else
+						break;
+				}
+				parents.append(obState.layoutStyleRef);
+				double textMarginLeft = 0.0;
+				double textMarginRight = 0.0;
+				double textMarginTop = 0.0;
+				double textMarginBottom = 0.0;
+				double textColumnGap = 0.0;
+				int textColumnCount = 1;
+				if (!parents.isEmpty())
+				{
+					for (int p = 0; p < parents.count(); p++)
+					{
+						currStyle = currSH.m_layoutStyles[parents[p]];
+						if (currStyle.Extra.valid)
+							actStyle.Extra = AttributeValue(currStyle.Extra.value);
+						if (currStyle.RExtra.valid)
+							actStyle.RExtra = AttributeValue(currStyle.RExtra.value);
+						if (currStyle.TExtra.valid)
+							actStyle.TExtra = AttributeValue(currStyle.TExtra.value);
+						if (currStyle.BExtra.valid)
+							actStyle.BExtra = AttributeValue(currStyle.BExtra.value);
+						if (currStyle.TextColumnGutter.valid)
+							actStyle.TextColumnGutter = AttributeValue(currStyle.TextColumnGutter.value);
+						if (currStyle.TextColumnCount.valid)
+							actStyle.TextColumnCount = AttributeValue(currStyle.TextColumnCount.value);
+					}
+				}
+				if (actStyle.Extra.valid)
+					textMarginLeft = actStyle.Extra.value.toDouble();
+				if (actStyle.RExtra.valid)
+					textMarginRight = actStyle.RExtra.value.toDouble();
+				if (actStyle.TExtra.valid)
+					textMarginTop = actStyle.TExtra.value.toDouble();
+				if (actStyle.BExtra.valid)
+					textMarginBottom = actStyle.BExtra.value.toDouble();
+				if (actStyle.TextColumnGutter.valid)
+					textColumnGap = actStyle.TextColumnGutter.value.toDouble();
+				if (actStyle.TextColumnCount.valid)
+					textColumnCount = actStyle.TextColumnCount.value.toInt();
+				item->setTextToFrameDist(textMarginLeft, textMarginRight, textMarginTop, textMarginBottom);
+				item->setColumns(textColumnCount);
+				item->setColumnGap(textColumnGap);
+			}
+		}
+		if (!obState.styleRef.isEmpty())
+		{
+			if (currSH.m_objStyles.contains(obState.styleRef))
+			{
+				ObjStyle actStyle;
+				ObjStyle currStyle = currSH.m_objStyles[obState.styleRef];
+				QStringList parents;
+				while (currStyle.parentStyle.valid)
+				{
+					if (currSH.m_objStyles.contains(currStyle.parentStyle.value))
+					{
+						parents.prepend(currStyle.parentStyle.value);
+						currStyle = currSH.m_objStyles[currStyle.parentStyle.value];
+					}
+					else
+						break;
+				}
+				parents.append(obState.styleRef);
+				if (!parents.isEmpty())
+				{
+					for (int p = 0; p < parents.count(); p++)
+					{
+						currStyle = currSH.m_objStyles[parents[p]];
+						if (currStyle.CurrColorFill.valid)
+							actStyle.CurrColorFill = AttributeValue(currStyle.CurrColorFill.value);
+						if (currStyle.CurrColorStroke.valid)
+							actStyle.CurrColorStroke = AttributeValue(currStyle.CurrColorStroke.value);
+						if (currStyle.fillOpacity.valid)
+							actStyle.fillOpacity = AttributeValue(currStyle.fillOpacity.value);
+						if (currStyle.strokeOpacity.valid)
+							actStyle.strokeOpacity = AttributeValue(currStyle.strokeOpacity.value);
+						if (currStyle.opacity.valid)
+							actStyle.opacity = AttributeValue(currStyle.opacity.value);
+						if (currStyle.LineW.valid)
+							actStyle.LineW = AttributeValue(currStyle.LineW.value);
+						if (currStyle.CapStyle.valid)
+							actStyle.CapStyle = AttributeValue(currStyle.CapStyle.value);
+						if (currStyle.JoinStyle.valid)
+							actStyle.JoinStyle = AttributeValue(currStyle.JoinStyle.value);
+					}
+				}
+				if (actStyle.CurrColorFill.valid)
+					item->setFillColor(actStyle.CurrColorFill.value);
+				if (actStyle.CurrColorStroke.valid)
+					item->setLineColor(actStyle.CurrColorStroke.value);
+				if (actStyle.fillOpacity.valid)
+					item->setFillTransparency(actStyle.fillOpacity.value.toDouble());
+				if (actStyle.strokeOpacity.valid)
+					item->setLineTransparency(actStyle.strokeOpacity.value.toDouble());
+				if (actStyle.LineW.valid)
+					item->setLineWidth(actStyle.LineW.value.toDouble());
+				if (actStyle.CapStyle.valid)
+				{
+					if (actStyle.CapStyle.value == "butt")
+						item->setLineEnd(Qt::FlatCap);
+					else if (actStyle.CapStyle.value == "round")
+						item->setLineEnd(Qt::RoundCap);
+					else if (actStyle.CapStyle.value == "square")
+						item->setLineEnd(Qt::SquareCap);
+					else
+						item->setLineEnd(Qt::FlatCap);
+				}
+				if (actStyle.JoinStyle.valid)
+				{
+					if (actStyle.JoinStyle.value == "miter")
+						item->setLineJoin(Qt::MiterJoin);
+					else if (actStyle.JoinStyle.value == "round")
+						item->setLineJoin(Qt::RoundJoin);
+					else if (actStyle.JoinStyle.value == "bevel")
+						item->setLineJoin(Qt::BevelJoin);
+					else
+						item->setLineJoin(Qt::MiterJoin);
+				}
 			}
 		}
 	}

Modified: trunk/Scribus/scribus/plugins/import/pages/importpages.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/plugins/import/pages/importpages.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pages/importpages.h (original)
+++ trunk/Scribus/scribus/plugins/import/pages/importpages.h Sat Feb  8 17:48:23 2014
@@ -160,6 +160,14 @@
 		QString styleRef;
 		QString layoutStyleRef;
 	};
+	struct StyleSheet
+	{
+		QHash<QString, ObjStyle> m_objStyles;
+		QHash<QString, ParStyle> m_parStyles;
+		QHash<QString, ChrStyle> m_chrStyles;
+		QHash<QString, LayoutStyle> m_layoutStyles;
+	};
+
 	bool convert(QString fn);
 	bool parseDocReference(QString designMap, bool compressed);
 	void parseStyleSheets(QDomElement &drawPag);
@@ -182,6 +190,7 @@
 	QStringList importedPatterns;
 	bool firstPage;
 	int pagecount;
+	int mpagecount;
 	double topMargin;
 	double leftMargin;
 	double rightMargin;
@@ -190,10 +199,8 @@
 	double pgGap;
 	QString papersize;
 	QHash<int, QString> imageResources;
-	QHash<QString, ObjStyle> m_objStyles;
-	QHash<QString, ParStyle> m_parStyles;
-	QHash<QString, ChrStyle> m_chrStyles;
-	QHash<QString, LayoutStyle> m_layoutStyles;
+	QHash<QString, StyleSheet> m_StyleSheets;
+	QString m_currentStyleSheet;
 
 	PageItem* addClip(PageItem* retObj, ObjState &obState);
 

Modified: trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pub/importpub.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pub/importpub.cpp Sat Feb  8 17:48:23 2014
@@ -1315,7 +1315,7 @@
 				meshGradientPatch patch;
 				patch.BL = cP;
 				patch.BR = cP;
-				if (ite->PoLine.point(poi).x() > 900000)
+				if (ite->PoLine.isMarker(poi))
 					continue;
 				meshPoint tL;
 				tL.resetTo(ite->PoLine.point(poi));

Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp Sat Feb  8 17:48:23 2014
@@ -1648,8 +1648,16 @@
 			ite->PoLine.svgClosePath();
 		else
 			ite->convertTo(PageItem::PolyLine);
-		finishNode(e, ite);
-		PElements.append(ite);
+		if (ite->PoLine.size() < 4)
+		{
+			tmpSel->addItem(ite);
+			m_Doc->itemSelection_DeleteItem(tmpSel);
+		}
+		else
+		{
+			finishNode(e, ite);
+			PElements.append(ite);
+		}
 	}
 	delete( m_gc.pop() );
 	return PElements;

Modified: trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/viva/importviva.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/viva/importviva.cpp Sat Feb  8 17:48:23 2014
@@ -1514,7 +1514,7 @@
 					meshGradientPatch patch;
 					patch.BL = cP;
 					patch.BR = cP;
-					if (item->PoLine.point(poi).x() > 900000)
+					if (item->PoLine.isMarker(poi))
 						continue;
 					meshPoint tL;
 					tL.resetTo(item->PoLine.point(poi));

Modified: trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xar/importxar.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/xar/importxar.cpp Sat Feb  8 17:48:23 2014
@@ -3650,10 +3650,10 @@
 			}
 			else
 			{
-				double minx = 999999.9;
-				double miny = 999999.9;
-				double maxx = -999999.9;
-				double maxy = -999999.9;
+				double minx =  std::numeric_limits<double>::max();
+				double miny =  std::numeric_limits<double>::max();
+				double maxx = -std::numeric_limits<double>::max();
+				double maxy = -std::numeric_limits<double>::max();
 				PageItem* groupItem = Elements.at(gg.index);
 				for (int a = gg.index+1; a < Elements.count(); ++a)
 				{

Modified: trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp Sat Feb  8 17:48:23 2014
@@ -2372,7 +2372,7 @@
 
 	for (int poi=0; poi<ite->size()-3; poi += 4)
 	{
-		if (ite->point(poi).x() > 900000)
+		if (ite->isMarker(poi))
 		{
 			nPath = true;
 			continue;

Modified: trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp Sat Feb  8 17:48:23 2014
@@ -121,7 +121,7 @@
 				uint psize = currItem->ContourLine.size();
 				for (uint a = 0; a < psize-3; a += 4)
 				{
-					if (currItem->ContourLine.point(a).x() > 900000)
+					if (currItem->ContourLine.isMarker(a))
 					{
 						points.setMarker();
 						continue;
@@ -165,7 +165,7 @@
 				uint psize = currItem->PoLine.size();
 				for (uint a = 0; a < psize-3; a += 4)
 				{
-					if (currItem->PoLine.point(a).x() > 900000)
+					if (currItem->PoLine.isMarker(a))
 					{
 						points.setMarker();
 						continue;

Modified: trunk/Scribus/scribus/plugins/xpsexport/xpsexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/plugins/xpsexport/xpsexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/xpsexport/xpsexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/xpsexport/xpsexplugin.cpp Sat Feb  8 17:48:23 2014
@@ -2529,7 +2529,7 @@
 
 	for (int poi=0; poi<ite->size()-3; poi += 4)
 	{
-		if (ite->point(poi).x() > 900000)
+		if (ite->isMarker(poi))
 		{
 			nPath = true;
 			continue;

Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Sat Feb  8 17:48:23 2014
@@ -170,7 +170,7 @@
 				{
 					for (int poi = 0; poi < ig.value().size()-3; poi += 4)
 					{
-						if (ig.value().point(poi).x() > 900000)
+						if (ig.value().isMarker(poi))
 						{
 							FontDesc += "cl\n";
 							nPath = true;
@@ -1463,10 +1463,10 @@
 	uint docSelectionCount=Doc->m_Selection->count();
 	if ((!psExport) && (docSelectionCount != 0))
 	{
-		double minx = 999999.9;
-		double miny = 999999.9;
-		double maxx = -999999.9;
-		double maxy = -999999.9;
+		double minx =  std::numeric_limits<double>::max();
+		double miny =  std::numeric_limits<double>::max();
+		double maxx = -std::numeric_limits<double>::max();
+		double maxy = -std::numeric_limits<double>::max();
 		for (uint ep = 0; ep < docSelectionCount; ++ep)
 		{
 			PageItem* currItem = Doc->m_Selection->itemAt(ep);
@@ -5443,7 +5443,7 @@
 
 	for (int poi=0; poi < c->size()-3; poi += 4)
 	{
-		if (c->point(poi).x() > 900000)
+		if (c->isMarker(poi))
 		{
 			nPath = true;
 			continue;

Modified: trunk/Scribus/scribus/scpageoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/scpageoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.cpp (original)
+++ trunk/Scribus/scribus/scpageoutput.cpp Sat Feb  8 17:48:23 2014
@@ -1270,7 +1270,7 @@
 				Start = item->PoLine.point(n);
 				firstp = false;
 			}
-			if (item->PoLine.point(n).x() > 900000)
+			if (item->PoLine.isMarker(n))
 			{
 				cli.addPoint(item->PoLine.point(n-2));
 				cli.addPoint(item->PoLine.point(n-2));
@@ -1436,7 +1436,7 @@
 				Start = item->PoLine.point(n);
 				firstp = false;
 			}
-			if (item->PoLine.point(n).x() > 900000)
+			if (item->PoLine.isMarker(n))
 			{
 				cli.addPoint(item->PoLine.point(n-2));
 				cli.addPoint(item->PoLine.point(n-2));

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp (original)
+++ trunk/Scribus/scribus/scpainter.cpp Sat Feb  8 17:48:23 2014
@@ -1643,7 +1643,7 @@
 	newPath();
 	for (int poi=0; poi<points->size()-3; poi += 4)
 	{
-		if (points->point(poi).x() > 900000)
+		if (points->isMarker(poi))
 		{
 			nPath = true;
 			continue;
@@ -1685,7 +1685,7 @@
 	newPath();
 	for (int poi=0; poi<points->size()-3; poi += 4)
 	{
-		if (points->point(poi).x() > 900000)
+		if (points->isMarker(poi))
 		{
 			nPath = true;
 			continue;

Modified: trunk/Scribus/scribus/scpainterex_cairo.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/scpainterex_cairo.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainterex_cairo.cpp (original)
+++ trunk/Scribus/scribus/scpainterex_cairo.cpp Sat Feb  8 17:48:23 2014
@@ -557,7 +557,7 @@
 	newPath();
 	for (int poi=0; poi<points->size()-3; poi += 4)
 	{
-		if (points->point(poi).x() > 900000)
+		if (points->isMarker(poi))
 		{
 			nPath = true;
 			continue;

Modified: trunk/Scribus/scribus/scpainterex_ps2.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/scpainterex_ps2.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainterex_ps2.cpp (original)
+++ trunk/Scribus/scribus/scpainterex_ps2.cpp Sat Feb  8 17:48:23 2014
@@ -886,7 +886,7 @@
 		newPath();
 		for (int poi=0; poi<points->size()-3; poi += 4)
 		{
-			if (points->point(poi).x() > 900000)
+			if (points->isMarker(poi))
 			{
 				nPath = true;
 				continue;
@@ -1369,7 +1369,7 @@
 	for (int i = 0; i < points->size(); i++ )
 	{
 		point = points->point(i);
-		if( point.x() > 900000 )
+		if( points->isMarker(i) )
 			continue;
 		transformPoint(point, point);
 		if( point.x() < left ) left = point.x();

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Feb  8 17:48:23 2014
@@ -2519,7 +2519,7 @@
 	symNewLine.addQuadPoint(0.96875, 3.125, 0.96875, 3.125, 6.75, 3.125, 6.75, 3.125);
 	symNewLine.addQuadPoint(6.75, 3.125, 6.75, 3.125, 6.51562, 2.625, 6.51562, 2.625);
 	symNewLine.addQuadPoint(6.51562, 2.625, 6.51562, 2.625, 6.51562, 2.625, 6.51562, 2.625);
-	symNewLine.addQuadPoint(999999, 999999, 999999, 999999, 999999, 999999, 999999, 999999);
+	symNewLine.setMarker();
 	symNewLine.addQuadPoint(6.875, 0, 6.875, 0, 6.51562, 0, 6.51562, 0);
 	symNewLine.addQuadPoint(6.51562, 0, 6.51562, 0, 6.51562, 2.84375, 6.51562, 2.84375);
 	symNewLine.addQuadPoint(6.51562, 2.84375, 6.51562, 2.84375, 6.75, 3.125, 6.51562, 3.125);
@@ -13514,7 +13514,7 @@
 		{
 			ite = allItems.at(ii);
 			if (ite->LayerID == layerID)
-				ite->invalidateLayout();
+					ite->invalidateLayout();
 		}
 		allItems.clear();
 	}
@@ -15620,7 +15620,7 @@
 		m_Selection->addItem(currItem);
 		for (uint a = EndInd-1; a > 0; --a)
 		{
-			if (currItem->PoLine.point(a).x() > 900000)
+			if (currItem->PoLine.isMarker(a))
 			{
 				StartInd = a + 1;
 				bb = new PageItem_Polygon(*currItem);
@@ -16043,7 +16043,7 @@
 	uint StartInd = 0;
 	for (int n = ClRe; n < Clip.size(); ++n)
 	{
-		if (Clip.point(n).x() > 900000)
+		if (Clip.isMarker(n))
 		{
 			EndInd = n;
 			break;
@@ -16055,7 +16055,7 @@
 		{
 			if (n2 == 0)
 				break;
-			if (Clip.point(n2).x() > 900000)
+			if (Clip.isMarker(n2))
 			{
 				StartInd = n2 + 1;
 				break;
@@ -16273,7 +16273,7 @@
 	int StartInd = 0;
 	for (int n = ClRe; n < Clip.size(); ++n)
 	{
-		if (Clip.point(n).x() > 900000)
+		if (Clip.isMarker(n))
 		{
 			EndInd = n;
 			break;
@@ -16285,7 +16285,7 @@
 		{
 			if (n2 == 0)
 				break;
-			if (Clip.point(n2).x() > 900000)
+			if (Clip.isMarker(n2))
 			{
 				StartInd = n2 + 1;
 				break;

Modified: trunk/Scribus/scribus/third_party/lib2geom/scribushelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/third_party/lib2geom/scribushelper.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/lib2geom/scribushelper.cpp (original)
+++ trunk/Scribus/scribus/third_party/lib2geom/scribushelper.cpp Sat Feb  8 17:48:23 2014
@@ -114,7 +114,7 @@
 	{
 		for (int poi=0; poi < p.size()-3; poi += 4)
 		{
-			if (p.point(poi).x() > 900000)
+			if (p.isMarker(poi))
 			{
 				if (closed)
 					ret.close();

Modified: trunk/Scribus/scribus/util_math.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18801&path=/trunk/Scribus/scribus/util_math.cpp
==============================================================================
--- trunk/Scribus/scribus/util_math.cpp (original)
+++ trunk/Scribus/scribus/util_math.cpp Sat Feb  8 17:48:23 2014
@@ -400,7 +400,7 @@
 	{
 		for (int poi=0; poi<ina.size()-3; poi += 4)
 		{
-			if (ina.point(poi).x() > 900000) // && cli.size() > 0)
+			if (ina.isMarker(poi)) // && cli.size() > 0)
 			{
 //				outa << cli.point(cli.size()-1);
 				Segs.append(outa.size());
@@ -434,7 +434,7 @@
 	for (uint c = 0; c < clipSize; ++c)
 	{
 		np = Clip->point(c);
-		if (np.x() > 900000)
+		if (Clip->isMarker(c))
 			continue;
 		if (np.x() > mx)
 			mx = np.x();
@@ -454,7 +454,7 @@
 	for (uint c = 0; c < clipSize; ++c)
 	{
 		np = Clip->point(c);
-		if (np.x() > 900000)
+		if (Clip->isMarker(c))
 			continue;
 		if (np.x() < mx)
 			mx = np.x();




More information about the scribus-commit mailing list