r17439 by fschmid - PDF Import: improved layer handling.

scribus-commit scribus-commit at lists.scribus.net
Sat Apr 14 06:53:29 UTC 2012


Author: fschmid
Date: Sat Apr 14 06:53:28 2012
New Revision: 17439

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17439
Log:
PDF Import: improved layer handling.

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=17439&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 Sat Apr 14 06:53:28 2012
@@ -1404,20 +1404,26 @@
 	{
 		if (QString(name) == "Layer")		// Handle Adobe Illustrator Layer command
 		{
+			Object obj;
+			QString lName = QString("Layer_%1").arg(layerNum + 1);
+			if (properties->lookup((char*)"Title", &obj))
+			{
+				if (obj.isString())
+					lName =  QString(obj.getString()->getCString());
+				obj.free();
+			}
+			for (ScLayers::iterator it = m_doc->Layers.begin(); it != m_doc->Layers.end(); ++it)
+			{
+				if (it->Name == lName)
+				{
+					m_doc->setActiveLayer(lName);
+					return;
+				}
+			}
 			layerNum++;
 			if (!firstLayer)
-				currentLayer = m_doc->addLayer(QString("Layer_%1").arg(layerNum), true);
+				currentLayer = m_doc->addLayer(lName, true);
 			firstLayer = false;
-			Object obj;
-			if (properties->lookup((char*)"Title", &obj))
-			{
-				if (obj.isString())
-				{
-					QString lName =  QString(obj.getString()->getCString());
-					m_doc->changeLayerName(currentLayer, lName);
-				}
-				obj.free();
-			}
 			if (properties->lookup((char*)"Visible", &obj))
 			{
 				if (obj.isBool())
@@ -1461,6 +1467,17 @@
 void SlaOutputDev::endMarkedContent(GfxState *state)
 {
 //	qDebug() << "End Marked Content";
+}
+
+void SlaOutputDev::markPoint(char *name)
+{
+//	qDebug() << "Begin Marked Point with Name " << QString(name);
+}
+
+void SlaOutputDev::markPoint(char *name, Dict *properties)
+{
+//	qDebug() << "Begin Marked Point with Name " << QString(name) << "and Properties";
+	beginMarkedContent(name, properties);
 }
 
 // POPPLER_VERSION appeared in 0.19.0 first

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17439&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 Sat Apr 14 06:53:28 2012
@@ -126,6 +126,8 @@
   //----- grouping operators
 	virtual void beginMarkedContent(char *name, Dict *properties);
 	virtual void endMarkedContent(GfxState *state);
+	virtual void markPoint(char *name);
+	virtual void markPoint(char *name, Dict *properties);
 	//----- image drawing
 	virtual void drawImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, GBool invert, GBool interpolate, GBool inlineImg);
 	virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, GBool interpolate, int *maskColors, GBool inlineImg);




More information about the scribus-commit mailing list