r18018 by fschmid - Write correct pattern list when exporting elements.

scribus-commit scribus-commit at lists.scribus.net
Mon Dec 31 11:28:48 UTC 2012


Author: fschmid
Date: Mon Dec 31 11:28:48 2012
New Revision: 18018

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18018
Log:
Write correct pattern list when exporting elements.

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

Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18018&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp Mon Dec 31 11:28:48 2012
@@ -554,6 +554,7 @@
 					int rotate = pdfDoc->getPageRotate(firstPage);
 					if ((rotate == 90) || (rotate == 270))
 						rotated = true;
+					dev->rotate = rotate;
 					rotate = 0;
 					if (importerFlags & LoadSavePlugin::lfCreateDoc)
 					{

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18018&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 Mon Dec 31 11:28:48 2012
@@ -2185,14 +2185,13 @@
 	{
 		for (int dre = 0; dre < gElements.Items.count(); ++dre)
 		{
-			tmpSel->addItem(gElements.Items.at(dre), true);
+			m_doc->m_Selection->addItem(gElements.Items.at(dre), true);
 			m_Elements->removeAll(gElements.Items.at(dre));
 		}
-		ite = m_doc->groupObjectsSelection(tmpSel);
+		m_doc->itemSelection_FlipV();
+		ite = m_doc->groupObjectsSelection();
 		ite->setFillTransparency(1.0 - state->getFillOpacity());
 		ite->setFillBlendmode(getBlendMode(state));
-		m_doc->m_Selection->addItem(ite, true);
-		m_doc->itemSelection_FlipV();
 		m_doc->m_Selection->clear();
 		ScPattern pat = ScPattern();
 		pat.setDoc(m_doc);
@@ -3416,14 +3415,13 @@
 	{
 		for (int dre = 0; dre < gElements.Items.count(); ++dre)
 		{
-			tmpSel->addItem(gElements.Items.at(dre), true);
+			m_doc->m_Selection->addItem(gElements.Items.at(dre), true);
 			m_Elements->removeAll(gElements.Items.at(dre));
 		}
-		PageItem *ite = m_doc->groupObjectsSelection(tmpSel);
+		m_doc->itemSelection_FlipV();
+		PageItem *ite = m_doc->groupObjectsSelection();
 		ite->setFillTransparency(1.0 - state->getFillOpacity());
 		ite->setFillBlendmode(getBlendMode(state));
-		m_doc->m_Selection->addItem(ite, true);
-		m_doc->itemSelection_FlipV();
 		m_doc->m_Selection->clear();
 		ScPattern pat = ScPattern();
 		pat.setDoc(m_doc);

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18018&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 Mon Dec 31 11:28:48 2012
@@ -252,6 +252,7 @@
 	bool layersSetByOCG;
 	double cropOffsetX;
 	double cropOffsetY;
+	int rotate;
 
 private:
 	void getPenState(GfxState *state);

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18018&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Mon Dec 31 11:28:48 2012
@@ -3929,18 +3929,28 @@
 		for (uint a = 0; a < selectedItemCount; ++a)
 		{
 			PageItem *currItem = customSelection->itemAt(a);
-			if ((currItem->GrType == 8) || (currItem->itemType() == PageItem::Symbol))
-			{
-				const QString& pat = currItem->pattern();
-				if (!pat.isEmpty() && !results.contains(pat))
-					results.append(currItem->pattern());
-			}
-			const QString& pat2 = currItem->strokePattern();
-			if (!pat2.isEmpty() && !results.contains(pat2))
-				results.append(currItem->strokePattern());
-			const QString& pat3 = currItem->patternMask();
-			if (!pat3.isEmpty() && !results.contains(pat3))
-				results.append(currItem->patternMask());
+			QList<PageItem*> allItems;
+			if (currItem->isGroup())
+				allItems = currItem->asGroupFrame()->getItemList();
+			else
+				allItems.append(currItem);
+			for (int ii = 0; ii < allItems.count(); ii++)
+			{
+				currItem = allItems.at(ii);
+				if ((currItem->GrType == 8) || (currItem->itemType() == PageItem::Symbol))
+				{
+					const QString& pat = currItem->pattern();
+					if (!pat.isEmpty() && !results.contains(pat))
+						results.append(currItem->pattern());
+				}
+				const QString& pat2 = currItem->strokePattern();
+				if (!pat2.isEmpty() && !results.contains(pat2))
+					results.append(currItem->strokePattern());
+				const QString& pat3 = currItem->patternMask();
+				if (!pat3.isEmpty() && !results.contains(pat3))
+					results.append(currItem->patternMask());
+			}
+			allItems.clear();
 		}
 		QStringList results2 = results;
 		for (int c = 0; c < results.count(); ++c)
@@ -3970,18 +3980,28 @@
 	pats.clear();
 	for (int c = 0; c < pat->items.count(); ++c)
 	{
-		if ((pat->items.at(c)->GrType == 8) || (pat->items.at(c)->itemType() == PageItem::Symbol))
-		{
-			const QString& patName = pat->items.at(c)->pattern();
-			if (!patName.isEmpty() && !results.contains(patName))
-				pats.append(patName);
-		}
-		const QString& pat2 = pat->items.at(c)->strokePattern();
-		if (!pat2.isEmpty() && !results.contains(pat2))
-			pats.append(pat->items.at(c)->strokePattern());
-		const QString& pat3 = pat->items.at(c)->patternMask();
-		if (!pat3.isEmpty() && !results.contains(pat3))
-			pats.append(pat->items.at(c)->patternMask());
+		QList<PageItem*> allItems;
+		if (pat->items.at(c)->isGroup())
+			allItems = pat->items.at(c)->asGroupFrame()->getItemList();
+		else
+			allItems.append(pat->items.at(c));
+		for (int ii = 0; ii < allItems.count(); ii++)
+		{
+			PageItem *currItem = allItems.at(ii);
+			if ((currItem->GrType == 8) || (currItem->itemType() == PageItem::Symbol))
+			{
+				const QString& patName = currItem->pattern();
+				if (!patName.isEmpty() && !results.contains(patName))
+					pats.append(patName);
+			}
+			const QString& pat2 = currItem->strokePattern();
+			if (!pat2.isEmpty() && !results.contains(pat2))
+				pats.append(currItem->strokePattern());
+			const QString& pat3 = currItem->patternMask();
+			if (!pat3.isEmpty() && !results.contains(pat3))
+				pats.append(currItem->patternMask());
+		}
+		allItems.clear();
 	}
 	if (!pats.isEmpty())
 	{




More information about the scribus-commit mailing list