r17497 by fschmid - Added a function to get the LayerID from the layer name.

scribus-commit scribus-commit at lists.scribus.net
Sun May 6 08:39:20 UTC 2012


Author: fschmid
Date: Sun May  6 08:39:20 2012
New Revision: 17497

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17497
Log:
Added a function to get the LayerID from the layer name.

Modified:
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17497&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sun May  6 08:39:20 2012
@@ -2894,6 +2894,17 @@
 	return -1;
 }
 
+int ScribusDoc::layerIDFromName(QString name)
+{
+	ScLayers::iterator itend=Layers.end();
+	ScLayers::iterator it;
+	for (it = Layers.begin(); it != itend; ++it)
+	{
+		if (it->Name == name)
+			return it->ID;
+	}
+	return -1;
+}
 
 bool ScribusDoc::lowerLayer(const int layerID)
 {

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17497&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Sun May  6 08:39:20 2012
@@ -459,6 +459,7 @@
 	 * @brief Return the layer count
 	 * @return Number of layers in doc
 	 */
+	int layerIDFromName(QString name);
 	int layerCount() const;
 	/**
 	 * @brief Lower a layer




More information about the scribus-commit mailing list