r20628 by fschmid -

scribus-commit scribus-commit at lists.scribus.net
Sun Dec 20 08:44:52 UTC 2015


Author: fschmid
Date: Sun Dec 20 08:44:52 2015
New Revision: 20628

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20628
Log:
Fixed Bug #13603: PDF open : polygon fill color not imported

Modified:
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20628&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp	Sun Dec 20 08:44:52 2015
@@ -227,6 +227,7 @@
 	layersSetByOCG = false;
 	cropOffsetX = 0;
 	cropOffsetY = 0;
+	inPattern = 0;
 }
 
 SlaOutputDev::~SlaOutputDev()
@@ -1296,6 +1297,18 @@
 						m_groupStack.top().Items.append(ite);
 					}
 				}
+				else
+				{
+					if (m_groupStack.count() != 0)
+					{
+						for (int dre = 0; dre < gElements.Items.count(); ++dre)
+						{
+							PageItem *ite = gElements.Items.at(dre);
+							applyMask(ite);
+							m_groupStack.top().Items.append(ite);
+						}
+					}
+				}
 				tmpSel->clear();
 			}
 			else
@@ -1637,7 +1650,7 @@
 	FPoint wh = out.WidthHeight();
 	if ((out.size() > 3) && ((wh.x() != 0.0) || (wh.y() != 0.0)))
 	{
-//		CurrColorFill = getColor(state->getFillColorSpace(), state->getFillColor(), &CurrFillShade);
+		CurrColorFill = getColor(state->getFillColorSpace(), state->getFillColor(), &CurrFillShade);
 		int z;
 		if (pathIsClosed)
 			z = m_doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, xCoor, yCoor, 10, 10, 0, CurrColorFill, CommonStrings::None);
@@ -1682,7 +1695,7 @@
 	FPoint wh = out.WidthHeight();
 	if ((out.size() > 3) && ((wh.x() != 0.0) || (wh.y() != 0.0)))
 	{
-//		CurrColorFill = getColor(state->getFillColorSpace(), state->getFillColor(), &CurrFillShade);
+		CurrColorFill = getColor(state->getFillColorSpace(), state->getFillColor(), &CurrFillShade);
 		int z;
 		if (pathIsClosed)
 			z = m_doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, xCoor, yCoor, 10, 10, 0, CurrColorFill, CommonStrings::None);
@@ -2204,8 +2217,9 @@
 #else
 	gfx = new Gfx(xref, this, resDict, catalog, &box, NULL);
 #endif
-
+	inPattern++;
 	gfx->display(str);
+	inPattern--;
 	gElements = m_groupStack.pop();
 	m_doc->m_Selection->clear();
 //	double pwidth = 0;
@@ -2431,7 +2445,7 @@
 				m_groupStack.top().Items.append(ite);
 				applyMask(ite);
 			}
-			if (checkClip())
+			if ((checkClip()) && (inPattern == 0))
 			{
 				FPointArray out = m_currentClipPath.copy();
 				out.translate(m_doc->currentPage()->xOffset(), m_doc->currentPage()->yOffset());
@@ -2571,7 +2585,7 @@
 				m_groupStack.top().Items.append(ite);
 				applyMask(ite);
 			}
-			if (checkClip())
+			if ((checkClip()) && (inPattern == 0))
 			{
 				FPointArray out = m_currentClipPath.copy();
 				out.translate(m_doc->currentPage()->xOffset(), m_doc->currentPage()->yOffset());
@@ -2718,7 +2732,7 @@
 				m_groupStack.top().Items.append(ite);
 				applyMask(ite);
 			}
-			if (checkClip())
+			if ((checkClip()) && (inPattern == 0))
 			{
 				FPointArray out = m_currentClipPath.copy();
 				out.translate(m_doc->currentPage()->xOffset(), m_doc->currentPage()->yOffset());
@@ -2934,7 +2948,7 @@
 		}
 		delete tempFile;
 	}
-	if (checkClip())
+	if ((checkClip()) && (inPattern == 0))
 	{
 		FPointArray out = m_currentClipPath.copy();
 		out.translate(m_doc->currentPage()->xOffset(), m_doc->currentPage()->yOffset());
@@ -3752,11 +3766,11 @@
 	tmp.setSpotColor(false);
 	tmp.setRegistrationColor(false);
 	*shade = 100;
-	if (m_F3Stack.count() > 0)
+/*	if (m_F3Stack.count() > 0)
 	{
 		if (!m_F3Stack.top().colored)
 			return "Black";
-	}
+	}*/
 	if ((color_space->getMode() == csDeviceRGB) || (color_space->getMode() == csCalRGB))
 	{
 		GfxRGB rgb;
@@ -3809,7 +3823,7 @@
 		int Bc = qRound(colToDbl(rgb.b) * 255);
 		tmp.setColorRGB(Rc, Gc, Bc);
 		fNam = m_doc->PageColors.tryAddColor(namPrefix+tmp.name(), tmp);
-	//	qDebug() << "update fill color other colorspace" << color_space->getMode() << "treating as rgb" << Rc << Gc << Bc;
+//		qDebug() << "update fill color other colorspace" << color_space->getMode() << "treating as rgb" << Rc << Gc << Bc;
 	}
 	if (fNam == namPrefix+tmp.name())
 		m_importedColors->append(fNam);

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20628&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h	(original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h	Sun Dec 20 08:44:52 2015
@@ -307,6 +307,7 @@
 		QString ocgName;
 	};
 	QStack<mContent> m_mcStack;
+	int inPattern;
 	int layerNum;
 	int currentLayer;
 	bool firstLayer;




More information about the scribus-commit mailing list