r13875 by jghali - ScLayer and related refactoring : fix confusing layerNumber/layerLevel naming by replacing ScLayer LNr member (layer number) by the more explicit ID

scribus-commit scribus-commit at lists.scribus.net
Wed Aug 26 05:45:01 CEST 2009


Revision: 13875
Author: jghali
Date: 2009-08-17T23:12:04.919428Z
Commit message: ScLayer and related refactoring : fix confusing layerNumber/layerLevel naming by replacing ScLayer LNr member (layer number) by the more explicit ID 

Changeset: 
M  /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
M  /trunk/Scribus/scribus/scribusXml.cpp
M  /trunk/Scribus/scribus/pageitem.h
M  /trunk/Scribus/scribus/scribusdoc.cpp
M  /trunk/Scribus/scribus/sclayer.cpp
M  /trunk/Scribus/scribus/documentchecker.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
M  /trunk/Scribus/scribus/plugins/imposition/imposition.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
M  /trunk/Scribus/scribus/scpreview.cpp
M  /trunk/Scribus/scribus/scribusstructs.h
M  /trunk/Scribus/scribus/pageitem_imageframe.cpp
M  /trunk/Scribus/scribus/pdflib_core.cpp
M  /trunk/Scribus/scribus/pslib.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
M  /trunk/Scribus/scribus/util_layer.cpp
M  /trunk/Scribus/scribus/scribus.cpp
M  /trunk/Scribus/scribus/plugins/xfigimplugin/importxfig.cpp
M  /trunk/Scribus/scribus/ui/layers.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
M  /trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp
M  /trunk/Scribus/scribus/scpageoutput.cpp
M  /trunk/Scribus/scribus/pageitem_desaxe.cpp
M  /trunk/Scribus/scribus/canvasmode_edit.cpp
M  /trunk/Scribus/scribus/canvasmode_normal.cpp
M  /trunk/Scribus/scribus/ui/checkDocument.cpp
M  /trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
M  /trunk/Scribus/scribus/pageitem.cpp
M  /trunk/Scribus/scribus/pageitem_line.cpp
M  /trunk/Scribus/scribus/plugins/scriptplugin/scripter2/scripter2_scribus_pageitem.cpp
M  /trunk/Scribus/scribus/canvasmode_legacy.cpp
M  /trunk/Scribus/scribus/scribusview.cpp
M  /trunk/Scribus/scribus/scribusdoc.h
M  /trunk/Scribus/scribus/pageitem_polyline.cpp
M  /trunk/Scribus/scribus/sclayer.h
M  /trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
M  /trunk/Scribus/scribus/pageitem_textframe.cpp
M  /trunk/Scribus/scribus/canvas.cpp
M  /trunk/Scribus/scribus/pageitem_pathtext.cpp
M  /trunk/Scribus/scribus/ui/layers.h
M  /trunk/Scribus/scribus/ui/masterpagepalette.cpp
M  /trunk/Scribus/scribus/ui/contextmenu.cpp
M  /trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp

Diffs:
Index: scribus/documentchecker.cpp
===================================================================
--- scribus/documentchecker.cpp	(revision 13874)
+++ scribus/documentchecker.cpp	(revision 13875)
@@ -57,7 +57,7 @@
 	errorCodes layerError;
 	int Lnr;
 	ScLayer ll;
-	ll.LNr = 0;
+	ll.ID = 0;
 	Lnr = 0;
 	uint layerCount= currDoc->layerCount();
 	for (uint la = 0; la < layerCount; ++la)
@@ -74,14 +74,14 @@
 			layerError.insert(BlendMode, 1);
 		Lnr++;
 		if (layerError.count() != 0)
-			currDoc->docLayerErrors.insert(ll.LNr, layerError);
+			currDoc->docLayerErrors.insert(ll.ID, layerError);
 	}
 	for (int d = 0; d < currDoc->MasterItems.count(); ++d)
 	{
 		currItem = currDoc->MasterItems.at(d);
 		if (!currItem->printEnabled())
 			continue;
-		if (!(currDoc->layerPrintable(currItem->LayerNr)) && (checkerSettings.ignoreOffLayers))
+		if (!(currDoc->layerPrintable(currItem->LayerID)) && (checkerSettings.ignoreOffLayers))
 			continue;
 		itemError.clear();
 		if (((currItem->isAnnotation()) || (currItem->isBookmark)) && (checkerSettings.checkAnnotations))
@@ -203,7 +203,7 @@
 		currItem = currDoc->DocItems.at(d);
 		if (!currItem->printEnabled())
 			continue;
-		if (!(currDoc->layerPrintable(currItem->LayerNr)) && (checkerSettings.ignoreOffLayers))
+		if (!(currDoc->layerPrintable(currItem->LayerID)) && (checkerSettings.ignoreOffLayers))
 			continue;
 		itemError.clear();
 		if (((currItem->fillTransparency() != 0.0) || (currItem->lineTransparency() != 0.0) || (currItem->fillBlendmode() != 0) || (currItem->lineBlendmode() != 0)) && (checkerSettings.checkTransparency))
Index: scribus/pdflib_core.cpp
===================================================================
--- scribus/pdflib_core.cpp	(revision 13874)
+++ scribus/pdflib_core.cpp	(revision 13875)
@@ -1726,7 +1726,7 @@
 		ScLayer ll;
 		struct OCGInfo ocg;
 		ll.isPrintable = false;
-		ll.LNr = 0;
+		ll.ID = 0;
 		int Lnr = 0;
 		QString ocgNam("oc");
 		uint docLayersCount=doc.Layers.count();
@@ -1735,7 +1735,7 @@
 			uint optionalContent = newObject();
 			QString tmp("");
 			doc.Layers.levelToLayer(ll, Lnr);
-			ocg.Name = ocgNam+tmp.setNum(ll.LNr);
+			ocg.Name = ocgNam+tmp.setNum(ll.ID);
 			ocg.ObjNum = optionalContent;
 			ocg.visible = ll.isViewable;
 			OCGEntries.insert(ll.Name, ocg);
@@ -1773,7 +1773,7 @@
 	int Lnr = 0;
 	ScLayer ll;
 	ll.isPrintable = false;
-	ll.LNr = 0;
+	ll.ID = 0;
 	Content = "";
 	Seite.AObjects.clear();
 	for (int la = 0; la < doc.Layers.count(); ++la)
@@ -1788,7 +1788,7 @@
 			{
 				Content = "";
 				ite =PItems.at(a);
-				if (ite->LayerNr != ll.LNr)
+				if (ite->LayerID != ll.ID)
 					continue;
 				double bLeft, bRight, bBottom, bTop;
 				getBleeds(pag, bLeft, bRight, bBottom, bTop);
@@ -2763,7 +2763,7 @@
 			ite = pag->FromMaster.at(am);
 			if (usingGUI)
 				qApp->processEvents();
-			if ((ite->LayerNr != layer.LNr) || (!ite->printEnabled()))
+			if ((ite->LayerID != layer.ID) || (!ite->printEnabled()))
 				continue;
 			if ((!pag->pageName().isEmpty()) && (ite->OwnPage != static_cast<int>(pag->pageNr())) && (ite->OwnPage != -1))
 				continue;
@@ -2815,7 +2815,7 @@
 		for (int am = 0; am < pag->FromMaster.count(); ++am)
 		{
 			ite = pag->FromMaster.at(am);
-			if ((ite->LayerNr != layer.LNr) || (!ite->printEnabled()))
+			if ((ite->LayerID != layer.ID) || (!ite->printEnabled()))
 				continue;
 			if (ite->ChangedMasterItem)
 				continue;
@@ -2859,7 +2859,7 @@
 		for (int a = 0; a < PItems.count() && !abortExport; ++a)
 		{
 			ite = PItems.at(a);
-			if (ite->LayerNr != layer.LNr)
+			if (ite->LayerID != layer.ID)
 				continue;
 			if (usingGUI)
 			{
@@ -2937,7 +2937,7 @@
 		for (int a = 0; a < PItems.count() && !abortExport; ++a)
 		{
 			ite = PItems.at(a);
-			if (ite->LayerNr != layer.LNr)
+			if (ite->LayerID != layer.ID)
 				continue;
 			if (usingGUI)
 			{
@@ -3001,7 +3001,7 @@
 			if (Options.Compress)
 				PutDoc("\n/Filter /FlateDecode");
 			PutDoc(" >>\nstream\n"+EncStream(inh, formObject)+"\nendstream\nendobj\n");
-			QString name = layer.Name.simplified().replace(QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_") + QString::number(layer.LNr) + QString::number(PNr);
+			QString name = layer.Name.simplified().replace(QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_") + QString::number(layer.ID) + QString::number(PNr);
 			Seite.XObjects[name] = formObject;
 			PutPage("q\n");
 			PutPage("/"+ShName+" gs\n");
@@ -7555,7 +7555,7 @@
 		PutDoc("/Properties <<\n");
 		ScLayer ll;
 		ll.isPrintable = false;
-		ll.LNr = 0;
+		ll.ID = 0;
 		int Lnr = 0;
 		for (int la = 0; la < doc.Layers.count(); ++la)
 		{
@@ -7735,7 +7735,7 @@
 		PutDoc("/D << /Order [ ");
 		ScLayer ll;
 		ll.isPrintable = false;
-		ll.LNr = 0;
+		ll.ID = 0;
 		int Lnr = 0;
 		for (int la = 0; la < doc.Layers.count(); ++la)
 		{
Index: scribus/canvasmode_drawfreehand.cpp
===================================================================
--- scribus/canvasmode_drawfreehand.cpp	(revision 13874)
+++ scribus/canvasmode_drawfreehand.cpp	(revision 13875)
@@ -881,7 +881,7 @@
 					if ((m_doc->masterPageMode()) && (docItem->OnMasterPage != m_doc->currentPage()->pageName()))
 						continue;
 					//CB Finally Items are selected here
-					if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerNr == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerNr)))
+					if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerID)))
 					{
 					//CB set draw to true to (dis)enable some actions via emit to HaveNewSel in scapp.
 					//CB FIXME emit from selection when multiple selected instead
Index: scribus/pageitem_line.cpp
===================================================================
--- scribus/pageitem_line.cpp	(revision 13874)
+++ scribus/pageitem_line.cpp	(revision 13875)
@@ -52,7 +52,7 @@
 {
 	if (!m_Doc->RePos)
 	{
-		if (m_Doc->layerOutline(LayerNr))
+		if (m_Doc->layerOutline(LayerID))
 			p->drawLine(FPoint(0, 0), FPoint(Width, 0));
 		else
 		{
Index: scribus/canvasmode_legacy.cpp
===================================================================
--- scribus/canvasmode_legacy.cpp	(revision 13874)
+++ scribus/canvasmode_legacy.cpp	(revision 13875)
@@ -2391,7 +2391,7 @@
 					QRect apr2(docItem->getRedrawBounding(1.0));
 					if ((m_doc->masterPageMode()) && (docItem->OnMasterPage != m_doc->currentPage()->pageName()))
 						continue;
-					if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerNr == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerNr)))
+					if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerID)))
 					{
 						bool redrawSelection=false;
 						m_view->SelectItemNr(a, redrawSelection);
@@ -3931,7 +3931,7 @@
 					if ((m_doc->masterPageMode()) && (docItem->OnMasterPage != m_doc->currentPage()->pageName()))
 						continue;
 					//CB Finally Items are selected here
-					if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerNr == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerNr)))
+					if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerID)))
 					{
 					//CB set draw to true to (dis)enable some actions via emit to HaveNewSel in scapp.
 					//CB FIXME emit from selection when multiple selected instead
@@ -4486,7 +4486,7 @@
 		for (a = 0; a < m_doc->currentPage()->FromMaster.count(); ++a)
 		{
 			p = QMatrix();
-			if ((currItem->LayerNr == m_doc->activeLayer()) && (!m_doc->layerLocked(currItem->LayerNr)))
+			if ((currItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(currItem->LayerID)))
 			{
 				double OldX = currItem->xPos();
 				double OldY = currItem->yPos();
@@ -4638,7 +4638,7 @@
 		currItem = m_doc->Items->at(a);
 		if ((m_doc->masterPageMode())  && (!((currItem->OwnPage == -1) || (currItem->OwnPage == static_cast<int>(m_doc->currentPage()->pageNr())))))
 			continue;
-		if ((currItem->LayerNr == m_doc->activeLayer()) && (!m_doc->layerLocked(currItem->LayerNr)))
+		if ((currItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(currItem->LayerID)))
 		{
 			p = QMatrix();
 			m_canvas->Transform(currItem, p);
@@ -5060,7 +5060,7 @@
 		for (int a = 0; a < m_doc->m_Selection->count(); ++a)
 		{
 			PageItem *currItem = m_doc->m_Selection->itemAt(a);
-			currItem->LayerNr = m_doc->activeLayer();
+			currItem->LayerID = m_doc->activeLayer();
 		}
 		m_doc->useRaster = savedAlignGrid;
 		m_doc->SnapGuides = savedAlignGuides;
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp	(revision 13874)
+++ scribus/scribusdoc.cpp	(revision 13875)
@@ -1312,9 +1312,9 @@
 				deleteLayer(ss->getInt("LAYER_NR"), false);
 			else
 			{
-				int layerNumber=addLayer( ss->get("NAME"), false );
-				int newLayerNumber=ss->getInt("LAYER_NR");
-				bool renumberedOk=renumberLayer(layerNumber, newLayerNumber);
+				int layerID=addLayer( ss->get("NAME"), false );
+				int newLayerID=ss->getInt("LAYER_NR");
+				bool renumberedOk=renumberLayer(layerID, newLayerID);
 				Q_ASSERT(renumberedOk);
 			}
 			layersUndo=true;
@@ -1323,15 +1323,15 @@
 		{
 			if (isUndo)
 			{
-				int layerNumber=addLayer( ss->get("NAME"), false );
-				int newLayerNumber=ss->getInt("LAYER_NR");
-				bool renumberedOk=renumberLayer(layerNumber, newLayerNumber);
+				int layerID=addLayer( ss->get("NAME"), false );
+				int newLayerID=ss->getInt("LAYER_NR");
+				bool renumberedOk=renumberLayer(layerID, newLayerID);
 				Q_ASSERT(renumberedOk);
-				layerNumber=newLayerNumber;
+				layerID=newLayerID;
 				//Layer is at the top now, lower it until it reaches the old level
 				int level = ss->getInt("LEVEL");
-				while (layerLevelFromNumber(layerNumber)!=level)
-					lowerLayer(layerNumber);
+				while (layerLevelFromID(layerID)!=level)
+					lowerLayer(layerID);
 			}
 			else
 				deleteLayer(ss->getInt("LAYER_NR"), ss->getBool("DELETE"));
@@ -1910,12 +1910,12 @@
 
 int ScribusDoc::addLayer(const QString& layerName, const bool activate)
 {
-	int lnr = Layers.addLayer(layerName);
-	if (lnr==-1)
+	int lId = Layers.addLayer(layerName);
+	if (lId==-1)
 		return -1;
 	if (activate)
-		setActiveLayer(lnr);
-	const ScLayer* ll = Layers.layerByNumber(lnr);
+		setActiveLayer(lId);
+	const ScLayer* ll = Layers.layerByID(lId);
 	if (!ll)
 		qWarning() << "Layer added without undo, could not get layer back for undo action creation";
 	else
@@ -1925,14 +1925,14 @@
 		ss->set("ADD_LAYER", "add_layer");
 		ss->set("ACTIVE", ActiveLayer);
 		ss->set("NAME", ll->Name);
-		ss->set("LAYER_NR", ll->LNr);
+		ss->set("LAYER_NR", ll->ID);
 		undoManager->action(this, ss, DocName, Um::ILayer);
 	}
-	return lnr;
+	return lId;
 }
 
 
-void ScribusDoc::copyLayer(int layerNumberToCopy, int whereToInsert)
+void ScribusDoc::copyLayer(int layerIDToCopy, int whereToInsert)
 {
 	if(!setActiveLayer(whereToInsert))
 		return;
@@ -1940,7 +1940,7 @@
 	for (int ite(0); ite < Items->count(); ++ite)
 	{
 		PageItem *itemToCopy = Items->at(ite);
-		if (itemToCopy->LayerNr == layerNumberToCopy)
+		if (itemToCopy->LayerID == layerIDToCopy)
 		{
 			sourceSelection.addItem(itemToCopy);
 		}
@@ -1953,11 +1953,11 @@
 }
 
 
-bool ScribusDoc::deleteLayer(const int layerNumber, const bool deleteItems)
+bool ScribusDoc::deleteLayer(const int layerID, const bool deleteItems)
 {
 	if (Layers.count() < 2)
 		return false;
-	const ScLayer* lToRemove = Layers.layerByNumber(layerNumber);
+	const ScLayer* lToRemove = Layers.layerByID(layerID);
 	if (!lToRemove)
 		return false;
 	int layerLevel = lToRemove->Level;
@@ -1968,7 +1968,7 @@
 
 	rebuildItemLists();
 	if (ScCore->usingGUI())
-		removeLayer(layerNumber, deleteItems);
+		removeLayer(layerID, deleteItems);
 
 	/*
 	//Layer found, do we want to delete its items too?
@@ -1978,7 +1978,7 @@
 		DocPages = Pages;
 	for (uint b = 0; b < MasterItems.count(); ++b)
 	{
-		if (MasterItems.at(b)->LayerNr == layerNumber)
+		if (MasterItems.at(b)->LayerID == layerID)
 		{
 			if (deleteItems)
 			{
@@ -1994,7 +1994,7 @@
 //	view->SelItem.clear();
 	for (uint b = 0; b < DocItems.count(); ++b)
 	{
-		if (DocItems.at(b)->LayerNr == l)
+		if (DocItems.at(b)->LayerID == l)
 		{
 			if (deleteItems)
 			{
@@ -2013,23 +2013,23 @@
 
 	*/
 	//Now delete the layer
-	Layers.removeLayerByNumber(layerNumber);
+	Layers.removeLayerByID(layerID);
 
 	if (activeTransaction)
 	{
 		SimpleState *ss = new SimpleState(Um::DeleteLayer, "", Um::IDelete);
 		ss->set("REMOVE_LAYER", "remove_layer");
-		ss->set("ACTIVE", layerNumber);
+		ss->set("ACTIVE", layerID);
 		ss->set("LEVEL", layerLevel);
 		ss->set("NAME", name);
-		ss->set("LAYER_NR", layerNumber);
+		ss->set("LAYER_NR", layerID);
 		ss->set("DELETE", deleteItems);
 		undoManager->action(this, ss, DocName, Um::ILayer);
 		activeTransaction->commit();
 		delete activeTransaction;
 		activeTransaction = NULL;
 	}
-//	setActiveLayer(layerNumberFromLevel(0));
+//	setActiveLayer(layerIDFromLevel(0));
 	return true;
 }
 
@@ -2042,7 +2042,7 @@
 
 const QString& ScribusDoc::activeLayerName()
 {
-	const ScLayer* ll = Layers.layerByNumber(ActiveLayer);
+	const ScLayer* ll = Layers.layerByID(ActiveLayer);
 	Q_ASSERT(ll);
 	return ll->Name;
 }
@@ -2050,7 +2050,7 @@
 
 bool ScribusDoc::setActiveLayer(const int layerToActivate)
 {
-	const ScLayer* ll = Layers.layerByNumber(layerToActivate);
+	const ScLayer* ll = Layers.layerByID(layerToActivate);
 	Q_ASSERT(ll);
 	if (ll)
 		ActiveLayer=layerToActivate;
@@ -2063,19 +2063,19 @@
 	const ScLayer* ll = Layers.layerByName(layerNameToActivate);
 	Q_ASSERT(ll);
 	if (ll)
-		ActiveLayer=ll->LNr;
+		ActiveLayer=ll->ID;
 	return (ll != NULL);
 }
 
 
-bool ScribusDoc::setLayerPrintable(const int layerNumber, const bool isPrintable)
+bool ScribusDoc::setLayerPrintable(const int layerID, const bool isPrintable)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	bool found=false;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 		{
 			bool oldPrintable = (*it).isPrintable;
 			(*it).isPrintable = isPrintable;
@@ -2085,7 +2085,7 @@
 				SimpleState *ss = new SimpleState(isPrintable ? Um::PrintLayer : Um::DoNotPrintLayer,
 						                          "", Um::IPrint);
 				ss->set("PRINT_LAYER", "print_layer");
-				ss->set("ACTIVE", (*it).LNr);
+				ss->set("ACTIVE", (*it).ID);
 				ss->set("PRINT", isPrintable);
 				undoManager->action(this, ss, DocName, Um::IDocument);
 			}
@@ -2099,27 +2099,27 @@
 }
 
 
-bool ScribusDoc::layerPrintable(const int layerNumber)
+bool ScribusDoc::layerPrintable(const int layerID)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 			return (*it).isPrintable;
 	}
 	return false;
 }
 
 
-bool ScribusDoc::setLayerVisible(const int layerNumber, const bool isViewable)
+bool ScribusDoc::setLayerVisible(const int layerID, const bool isViewable)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	bool found=false;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 		{
 			(*it).isViewable = isViewable;
 			found=true;
@@ -2132,27 +2132,27 @@
 }
 
 
-bool ScribusDoc::layerVisible(const int layerNumber)
+bool ScribusDoc::layerVisible(const int layerID)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 			return (*it).isViewable;
 	}
 	return false;
 }
 
 
-bool ScribusDoc::setLayerLocked(const int layerNumber, const bool isLocked)
+bool ScribusDoc::setLayerLocked(const int layerID, const bool isLocked)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	bool found=false;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 		{
 			(*it).isEditable = !isLocked;
 			found=true;
@@ -2165,27 +2165,27 @@
 }
 
 
-bool ScribusDoc::layerLocked(const int layerNumber)
+bool ScribusDoc::layerLocked(const int layerID)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 			return !(*it).isEditable;
 	}
 	return false;
 }
 
 
-bool ScribusDoc::setLayerFlow(const int layerNumber, const bool flow)
+bool ScribusDoc::setLayerFlow(const int layerID, const bool flow)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	bool found=false;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 		{
 			(*it).flowControl = flow;
 			found=true;
@@ -2198,27 +2198,27 @@
 }
 
 
-bool ScribusDoc::layerFlow(const int layerNumber)
+bool ScribusDoc::layerFlow(const int layerID)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 			return (*it).flowControl;
 	}
 	return false;
 }
 
 
-bool ScribusDoc::setLayerTransparency(const int layerNumber, double trans)
+bool ScribusDoc::setLayerTransparency(const int layerID, double trans)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	bool found=false;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 		{
 			(*it).transparency = trans;
 			found=true;
@@ -2231,27 +2231,27 @@
 }
 
 
-double ScribusDoc::layerTransparency(const int layerNumber)
+double ScribusDoc::layerTransparency(const int layerID)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 			return (*it).transparency;
 	}
 	return 1.0;
 }
 
 
-bool ScribusDoc::setLayerBlendMode(const int layerNumber, int blend)
+bool ScribusDoc::setLayerBlendMode(const int layerID, int blend)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	bool found=false;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 		{
 			(*it).blendMode = blend;
 			found=true;
@@ -2264,27 +2264,27 @@
 }
 
 
-int ScribusDoc::layerBlendMode(const int layerNumber)
+int ScribusDoc::layerBlendMode(const int layerID)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 			return (*it).blendMode;
 	}
 	return 0;
 }
 
 
-bool ScribusDoc::setLayerOutline(const int layerNumber, const bool outline)
+bool ScribusDoc::setLayerOutline(const int layerID, const bool outline)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	bool found=false;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 		{
 			(*it).outlineMode = outline;
 			found=true;
@@ -2297,27 +2297,27 @@
 }
 
 
-bool ScribusDoc::layerOutline(const int layerNumber)
+bool ScribusDoc::layerOutline(const int layerID)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 			return (*it).outlineMode;
 	}
 	return false;
 }
 
 
-bool ScribusDoc::setLayerMarker(const int layerNumber, QColor color)
+bool ScribusDoc::setLayerMarker(const int layerID, QColor color)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	bool found=false;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 		{
 			(*it).markerColor = color;
 			found=true;
@@ -2330,25 +2330,25 @@
 }
 
 
-QColor ScribusDoc::layerMarker(const int layerNumber)
+QColor ScribusDoc::layerMarker(const int layerID)
 {
 	ScLayers::iterator itend=Layers.end();
 	ScLayers::iterator it;
 	for (it = Layers.begin(); it != itend; ++it)
 	{
-		if ((*it).LNr == layerNumber)
+		if ((*it).ID == layerID)
 			return (*it).markerColor;
 	}
 	return QColor(0, 0, 0);
 }
 
 
-int ScribusDoc::layerLevelFromNumber(const int layerNumber)
+int ScribusDoc::layerLevelFromID(const int layerID)
 {
 	uint layerCount=Layers.count();
 	for (uint i=0; i < layerCount; ++i)
 	{
-		if (Layers[i].LNr == layerNumber)
+		if (Layers[i].ID == layerID)
 			return Layers[i].Level;
 	}
 	return -1;
@@ -2361,21 +2361,21 @@
 }
 
 
-int ScribusDoc::layerNumberFromLevel(const int layerLevel)
+int ScribusDoc::layerIDFromLevel(const int layerLevel)
 {
 	uint layerCount=Layers.count();
 	for (uint i=0; i < layerCount; ++i)
 	{
 		if (Layers[i].Level == layerLevel)
-			return Layers[i].LNr;
+			return Layers[i].ID;
 	}
 	return -1;
 }
 
 
-bool ScribusDoc::lowerLayer(const int layerNumber)
+bool ScribusDoc::lowerLayer(const int layerID)
 {
-	return lowerLayerByLevel(layerLevelFromNumber(layerNumber));
+	return lowerLayerByLevel(layerLevelFromID(layerID));
 }
 
 
@@ -2411,9 +2411,9 @@
 }
 
 
-bool ScribusDoc::raiseLayer(const int layerNumber)
+bool ScribusDoc::raiseLayer(const int layerID)
 {
-	return raiseLayerByLevel(layerLevelFromNumber(layerNumber));
+	return raiseLayerByLevel(layerLevelFromID(layerID));
 }
 
 
@@ -2449,25 +2449,25 @@
 }
 
 
-QString ScribusDoc::layerName(const int layerNumber) const
+QString ScribusDoc::layerName(const int layerID) const
 {
 	uint layerCount=Layers.count();
 	for (uint i=0; i < layerCount; ++i)
 	{
-		if (Layers[i].LNr == layerNumber)
+		if (Layers[i].ID == layerID)
 			return Layers[i].Name;
 	}
 	return QString::null;
 }
 
 
-bool ScribusDoc::changeLayerName(const int layerNumber, const QString& newName)
+bool ScribusDoc::changeLayerName(const int layerID, const QString& newName)
 {
 	uint layerCount=Layers.count();
 	bool found=false;
 	for (uint i=0; i < layerCount; ++i)
 	{
-		if (Layers[i].LNr == layerNumber)
+		if (Layers[i].ID == layerID)
 		{
 			if (Layers[i].Name != newName)
 			{
@@ -2494,18 +2494,18 @@
 }
 
 
-bool ScribusDoc::layerContainsItems(const int layerNumber)
+bool ScribusDoc::layerContainsItems(const int layerID)
 {
 	uint masterItemsCount=MasterItems.count();
 	for (uint i = 0; i < masterItemsCount; ++i)
 	{
-		if (MasterItems.at(i)->LayerNr == layerNumber)
+		if (MasterItems.at(i)->LayerID == layerID)
 			return true;
 	}
 	uint docItemsCount=DocItems.count();
 	for (uint i = 0; i < docItemsCount; ++i)
 	{
-		if (DocItems.at(i)->LayerNr == layerNumber)
+		if (DocItems.at(i)->LayerID == layerID)
 			return true;
 	}
 	return false;
@@ -2531,7 +2531,7 @@
 }
 
 
-bool ScribusDoc::renumberLayer(const int layerNumber, const int newLayerNumber)
+bool ScribusDoc::renumberLayer(const int layerID, const int newLayerID)
 {
 	uint layerCount=Layers.count();
 	uint foundIndex = 0;
@@ -2539,18 +2539,18 @@
 	//Find layer to renumber, if found the new number, return as it exists already.
 	for (uint i=0; i < layerCount; ++i)
 	{
-		if (Layers[i].LNr == layerNumber)
+		if (Layers[i].ID == layerID)
 		{
 			foundIndex=i;
 			found=true;
 		}
 		else
-		if (Layers[i].LNr == newLayerNumber)
+		if (Layers[i].ID == newLayerID)
 			return false;
 	}
 	if (!found)
 		return false;
-	Layers[foundIndex].LNr=newLayerNumber;
+	Layers[foundIndex].ID=newLayerID;
 	return true;
 }
 
@@ -3460,11 +3460,11 @@
 				int currActiveLayer = activeLayer();
 				for (ScLayers::iterator it = Layers.begin(); it != Layers.end(); ++it)
 				{
-					setActiveLayer((*it).LNr);
+					setActiveLayer((*it).ID);
 					for (uint ite = 0; ite < end2; ++ite)
 					{
 						PageItem *itemToCopy = MasterItems.at(ite);
-						if ((itemToCopy->OnMasterPage == pageMaster->pageName()) && ((*it).LNr == itemToCopy->LayerNr))
+						if ((itemToCopy->OnMasterPage == pageMaster->pageName()) && ((*it).ID == itemToCopy->LayerID))
 							tempSelection.addItem(itemToCopy, true);
 					}
 					if (tempSelection.count() != 0)
@@ -3489,11 +3489,11 @@
 		int currActiveLayer = activeLayer();
 		for (ScLayers::iterator it = Layers.begin(); it != Layers.end(); ++it)
 		{
-			setActiveLayer((*it).LNr);
+			setActiveLayer((*it).ID);
 			for (uint ite = 0; ite < end; ++ite)
 			{
 				PageItem *itemToCopy = DocItems.at(ite);
-				if ((itemToCopy->OwnPage == static_cast<int>(sourcePage->pageNr())) && ((*it).LNr == itemToCopy->LayerNr))
+				if ((itemToCopy->OwnPage == static_cast<int>(sourcePage->pageNr())) && ((*it).ID == itemToCopy->LayerID))
 					tempSelection.addItem(itemToCopy, true);
 			}
 			if (tempSelection.count() != 0)
@@ -3911,11 +3911,11 @@
 	for (uint la = 0; la < layerCount; ++la)
 	{
 		PageItem* currItem;
-		int layerNr = Layers.at(la).LNr;
+		int layerID = Layers.at(la).ID;
 		for (int it = 0; it < DocItems.count(); ++it)
 		{
 			currItem = DocItems.at(it);
-			if (currItem->LayerNr != layerNr)
+			if (currItem->LayerID != layerID)
 				continue;
 			newDocItems.append(currItem);
 			currItem->ItemNr = itemIndex++;
@@ -3923,7 +3923,7 @@
 		for (int it = 0; it < MasterItems.count(); ++it)
 		{
 			currItem = MasterItems.at(it);
-			if (currItem->LayerNr != layerNr)
+			if (currItem->LayerID != layerID)
 				continue;
 			newMasterItems.append(currItem);
 			currItem->ItemNr = masterIndex++;
@@ -4871,11 +4871,11 @@
 			int currActiveLayer = activeLayer();
 			for (it = Layers.begin(); it != Layers.end(); ++it)
 			{
-				setActiveLayer((*it).LNr);
+				setActiveLayer((*it).ID);
 				for (uint ite = 0; ite < oldItems; ++ite)
 				{
 					PageItem *itemToCopy = Items->at(ite);
-					if ((itemToCopy->OwnPage == static_cast<int>(from->pageNr())) && ((*it).LNr == itemToCopy->LayerNr))
+					if ((itemToCopy->OwnPage == static_cast<int>(from->pageNr())) && ((*it).ID == itemToCopy->LayerID))
 						m_Selection->addItem(itemToCopy, true);
 				}
 				if (m_Selection->count() != 0)
@@ -4959,7 +4959,7 @@
 					if ((lcount < itemBuffer.count()) && !itemBuffer[lcount].isEmpty())
 					{
 						ScriXmlDoc *ss = new ScriXmlDoc();
-						ss->ReadElemToLayer(itemBuffer[lcount], prefsData.AvailFonts, this, destination->xOffset(), destination->yOffset(), false, true, prefsData.GFontSub, view(),(*it).LNr);
+						ss->ReadElemToLayer(itemBuffer[lcount], prefsData.AvailFonts, this, destination->xOffset(), destination->yOffset(), false, true, prefsData.GFontSub, view(),(*it).ID);
 						delete ss;
 					}
 					lcount++;
@@ -6864,9 +6864,9 @@
 	//FIXME: stop using m_View
 	m_View->Deselect();
 	Selection tmpSelection(this, false);
-	int newLayerNr = 0;
+	int newLayerID = 0;
 	// Find the new layer identifier
-	const ScLayer* lcurr = Layers.layerByNumber(l);
+	const ScLayer* lcurr = Layers.layerByID(l);
 	if (lcurr)
 	{
 		const ScLayer* lbelow = Layers.layerBelow(lcurr->Level);
@@ -6874,14 +6874,14 @@
 		{
 			const ScLayer* labove = Layers.layerAbove(lcurr->Level);
 			if (labove)
-				newLayerNr = labove->LNr;
+				newLayerID = labove->ID;
 		}
 		else if (lbelow)
-			newLayerNr = lbelow->LNr;
+			newLayerID = lbelow->ID;
 	}
 	for (int b = 0; b < MasterItems.count(); ++b)
 	{
-		if (MasterItems.at(b)->LayerNr == l)
+		if (MasterItems.at(b)->LayerID == l)
 		{
 			if (dl)
 			{
@@ -6889,7 +6889,7 @@
 				MasterItems.at(b)->setLocked(false);
 			}
 			else
-				MasterItems.at(b)->setLayer(newLayerNr);
+				MasterItems.at(b)->setLayer(newLayerID);
 		}
 	}
 	if (tmpSelection.count() != 0)
@@ -6897,7 +6897,7 @@
 	tmpSelection.clear();
 	for (int b = 0; b < DocItems.count(); ++b)
 	{
-		if (DocItems.at(b)->LayerNr == l)
+		if (DocItems.at(b)->LayerID == l)
 		{
 			if (dl)
 			{
@@ -6905,7 +6905,7 @@
 				DocItems.at(b)->setLocked(false);
 			}
 			else
-				DocItems.at(b)->setLayer(newLayerNr);
+				DocItems.at(b)->setLayer(newLayerID);
 		}
 	}
 	if (tmpSelection.count() != 0)
@@ -6915,7 +6915,7 @@
 	m_ScMW->rebuildLayersList();
 	//FIXME: stop using m_View
 	m_View->updateLayerMenu();
-	setActiveLayer(newLayerNr);
+	setActiveLayer(newLayerID);
 }
 
 
@@ -7578,7 +7578,7 @@
 }
 
 
-void ScribusDoc::itemSelection_SendToLayer(int layerNumber)
+void ScribusDoc::itemSelection_SendToLayer(int layerID)
 {
 	uint selectedItemCount=m_Selection->count();
 	if (selectedItemCount != 0)
@@ -7592,7 +7592,7 @@
 		for (uint a = 0; a < selectedItemCount; ++a)
 		{
 			PageItem *currItem = m_Selection->itemAt(a);
-			currItem->setLayer(layerNumber);
+			currItem->setLayer(layerID);
 			if (selectedItemCount <= Um::ItemsInvolvedLimit)
 				tooltip += "\t" + currItem->getUName() + "\n";
 		}
Index: scribus/pageitem_polyline.cpp
===================================================================
--- scribus/pageitem_polyline.cpp	(revision 13874)
+++ scribus/pageitem_polyline.cpp	(revision 13875)
@@ -51,7 +51,7 @@
 {
 	if (!m_Doc->RePos && PoLine.size()>=4)
 	{
-		if (!m_Doc->layerOutline(LayerNr))
+		if (!m_Doc->layerOutline(LayerID))
 		{
 			if ((fillColor() != CommonStrings::None) || (GrType != 0))
 			{
Index: scribus/scribusXml.cpp
===================================================================
--- scribus/scribusXml.cpp	(revision 13874)
+++ scribus/scribusXml.cpp	(revision 13875)
@@ -1224,7 +1224,7 @@
 			else
 				OB.IFont = DoFonts[tmf];
 			// #7725
-			OB.LayerNr   = toLayer;
+			OB.LayerID   = toLayer;
 			OB.Language  = attrAsString(attrs, "LANGUAGE", doc->Language);
 			tmp = "";
 			int numGroup = attrAsInt(attrs, "NUMGROUP", 0);
@@ -1617,7 +1617,7 @@
 				OB.IFont = doc->toolSettings.defFont;
 			else
 				OB.IFont = DoFonts[tmf];
-			OB.LayerNr  = attrAsInt(attrs1, "LAYER");
+			OB.LayerID  = attrAsInt(attrs1, "LAYER");
 			OB.Language = attrAsString(attrs1, "LANGUAGE", doc->Language);
 			tmp = "";
 			int numGroup = attrAsInt(attrs1, "NUMGROUP", 0);
Index: scribus/canvasmode_edit.cpp
===================================================================
--- scribus/canvasmode_edit.cpp	(revision 13874)
+++ scribus/canvasmode_edit.cpp	(revision 13875)
@@ -1231,7 +1231,7 @@
 				QRect apr2(docItem->getRedrawBounding(1.0));
 				if ((m_doc->masterPageMode()) && (docItem->OnMasterPage != m_doc->currentPage()->pageName()))
 					continue;
-				if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerNr == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerNr)))
+				if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerID)))
 				{
 					bool redrawSelection=false;
 					m_view->SelectItemNr(a, redrawSelection);
Index: scribus/canvas.cpp
===================================================================
--- scribus/canvas.cpp	(revision 13874)
+++ scribus/canvas.cpp	(revision 13875)
@@ -375,7 +375,7 @@
 		{
 			currItem = m_doc->currentPage()->FromMaster.at(currNr);
 			QMatrix itemPos;
-			if ((currItem->LayerNr == m_doc->activeLayer()) && (!m_doc->layerLocked(currItem->LayerNr)))
+			if ((currItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(currItem->LayerID)))
 			{
 				if (!currItem->ChangedMasterItem)
 				{
@@ -432,7 +432,7 @@
 			--currNr;
 			continue;
 		}
-		if ((currItem->LayerNr == m_doc->activeLayer()) && (!m_doc->layerLocked(currItem->LayerNr)))
+		if ((currItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(currItem->LayerID)))
 		{
 			QMatrix itemPos = currItem->getTransform();
 			QPainterPath currPath(itemPos.map(QPointF(0,0)));
@@ -479,14 +479,14 @@
 		return NULL;
 	
 	QRectF baseRect(item->getBoundingRect());
-	int itemLevel = m_doc->layerLevelFromNumber(item->LayerNr);
+	int itemLevel = m_doc->layerLevelFromID(item->LayerID);
 	if (itemLevel < 0)
 		return NULL;
 
 	for(index = indice - 1; index >= 0; --index)
 	{
 		PageItem* item1 = m_doc->Items->at(index);
-		int level = m_doc->layerLevelFromNumber(item1->LayerNr);
+		int level = m_doc->layerLevelFromID(item1->LayerID);
 		if ((item != item1) && (level >= 0) && (level <= itemLevel))
 		{
 			if ((level == itemLevel) && (item1->ItemNr > item->ItemNr))
@@ -898,7 +898,7 @@
 
 	ScLayer layer;
 	layer.isViewable = false;
-	layer.LNr = 0;
+	layer.ID = 0;
 	
 //	Tsetup = tim.elapsed();
 	if (!m_doc->masterPageMode())
@@ -1289,7 +1289,7 @@
 	for (uint a = 0; a < pageFromMasterCount; ++a)
 	{
 		currItem = page->FromMaster.at(a);
-		if (currItem->LayerNr != layer.LNr)
+		if (currItem->LayerID != layer.ID)
 			continue;
 		if ((currItem->OwnPage != -1) && (currItem->OwnPage != static_cast<int>(Mp->pageNr())))
 			continue;
@@ -1393,7 +1393,7 @@
 	for (uint a = 0; a < pageFromMasterCount; ++a)
 	{
 		currItem = page->FromMaster.at(a);
-		if (currItem->LayerNr != layer.LNr)
+		if (currItem->LayerID != layer.ID)
 			continue;
 		if (!currItem->isTableItem)
 			continue;
@@ -1482,7 +1482,7 @@
 	for (int it = 0; it < m_doc->Items->count(); ++it)
 	{
 		currItem = m_doc->Items->at(it);
-		if (currItem->LayerNr != layer.LNr)
+		if (currItem->LayerID != layer.ID)
 			continue;
 		if ((m_viewMode.previewMode) && (!currItem->printEnabled()))
 			continue;
@@ -1571,7 +1571,7 @@
 	for (int it = 0; it < m_doc->Items->count(); ++it)
 	{
 		currItem = m_doc->Items->at(it);
-		if (currItem->LayerNr != layer.LNr)
+		if (currItem->LayerID != layer.ID)
 			continue;
 		if (!currItem->isTableItem)
 			continue;
Index: scribus/pageitem_pathtext.cpp
===================================================================
--- scribus/pageitem_pathtext.cpp	(revision 13874)
+++ scribus/pageitem_pathtext.cpp	(revision 13875)
@@ -98,7 +98,7 @@
 	double actStrokeShade = -1;
 	QColor cachedFillQ;
 	QColor cachedStrokeQ;
-	if (!m_Doc->layerOutline(LayerNr))
+	if (!m_Doc->layerOutline(LayerID))
 	{
 		if (PoShow)
 		{
Index: scribus/pageitem.h
===================================================================
--- scribus/pageitem.h	(revision 13874)
+++ scribus/pageitem.h	(revision 13875)
@@ -76,6 +76,10 @@
   *@author Franz Schmid
   */
 
+#if defined(_MSC_VER)
+#define _unlink unlink
+#endif
+
 class SCRIBUS_API PageItem : public QObject, public UndoObject, public SaxIO, public SingleObservable<PageItem>
 {
 	Q_OBJECT
@@ -480,7 +484,7 @@
 	double OldH2;
 	bool Sizing;
 	bool toPixmap;
-	int LayerNr;
+	int  LayerID;
 	bool ScaleType;
 	bool AspectRatio;
 	QStack<int> Groups;
Index: scribus/sclayer.cpp
===================================================================
--- scribus/sclayer.cpp	(revision 13874)
+++ scribus/sclayer.cpp	(revision 13875)
@@ -14,7 +14,7 @@
 ScLayer::ScLayer(void)
 {
 	Name         = QObject::tr("New Layer");
-	LNr          = 0;
+	ID          = 0;
 	Level        = 0;
 	isPrintable  = true;
 	isViewable   = true;
@@ -26,10 +26,10 @@
 	markerColor  = QColor(0, 0, 0);
 }
 
-ScLayer::ScLayer(const QString& name, int level, int nr)
+ScLayer::ScLayer(const QString& name, int level, int id)
 {
 	Name         = name;
-	LNr          = nr;
+	ID           = id;
 	Level        = level;
 	isPrintable  = true;
 	isViewable   = true;
@@ -39,7 +39,7 @@
 	transparency = 1.0;
 	blendMode    = 0;
 	markerColor  = QColor(0, 0, 0);
-	switch (LNr % 7)
+	switch (ID % 7)
 	{
 		case 0:
 			markerColor = Qt::black;
@@ -73,7 +73,7 @@
 bool ScLayer::operator== (const ScLayer& other) const
 {
 	// ignore markerColor?
-	if (Name == other.Name && LNr == other.LNr && Level == other.Level      &&
+	if (Name == other.Name && ID == other.ID && Level == other.Level      &&
 		isPrintable  == other.isPrintable  && isViewable  == other.isViewable  &&
 		flowControl  == other.flowControl  && outlineMode == other.outlineMode && 
 		transparency == other.transparency && isEditable == other.isEditable &&
@@ -84,12 +84,12 @@
 	return false;
 }
 
-int ScLayers::getMaxNumber(void)
+int ScLayers::getMaxID(void)
 {
 	int nr, maxNr = -1;
 	for (int i = 0; i < this->count(); ++i)
 	{
-		nr = this->at(i).LNr;;
+		nr = this->at(i).ID;
 		if (nr > maxNr)
 			maxNr = nr;
 	}
@@ -131,7 +131,7 @@
 			layer.isViewable   = ll.isViewable;
 			layer.isPrintable  = ll.isPrintable;
 			layer.isEditable   = ll.isEditable;
-			layer.LNr          = ll.LNr;
+			layer.ID          = ll.ID;
 			layer.Name         = ll.Name;
 			layer.flowControl  = ll.flowControl;
 			layer.transparency = ll.transparency;
@@ -152,12 +152,12 @@
 	return NULL;
 }
 
-ScLayer* ScLayers::byNumber(const int nr)
+ScLayer* ScLayers::byID(const int nr)
 {
 	ScLayers::Iterator itend = end();
 	for (ScLayers::Iterator it = 0; it != itend; ++it)
 	{
-		if( it->LNr == nr)
+		if( it->ID == nr)
 			return &(*it);
 	}
 	return NULL;
@@ -189,7 +189,7 @@
 
 ScLayer* ScLayers::above (int nr)
 {
-	ScLayer* lyr = byNumber(nr);
+	ScLayer* lyr = byID(nr);
 	if (lyr)
 	{
 		ScLayer *rlyr = top();
@@ -211,7 +211,7 @@
 
 ScLayer* ScLayers::below (int nr)
 {
-	ScLayer* lyr = byNumber(nr);
+	ScLayer* lyr = byID(nr);
 	if (lyr)
 	{
 		ScLayer *rlyr = bottom();
@@ -243,13 +243,13 @@
 	return NULL;
 }
 
-const ScLayer* ScLayers::layerByNumber (int nr) const
+const ScLayer* ScLayers::layerByID (int nr) const
 {
 	const ScLayer *layer = NULL;
 	for (int i = 0; i < this->count(); ++i)
 	{
 		layer = &this->at(i);
-		if( layer->LNr == nr)
+		if( layer->ID == nr)
 			return layer;
 	}
 	return NULL;
@@ -357,18 +357,18 @@
 {
 	ScLayer* nl = newLayer(layerName);
 	if (nl)
-		return nl->LNr;
+		return nl->ID;
 	return -1;
 }
 
 int ScLayers::addLayer(const ScLayer& layer)
 {
-	int   newID = layer.LNr;
-	const ScLayer* lid = layerByNumber(newID);
+	int   newID = layer.ID;
+	const ScLayer* lid = layerByID(newID);
 	if (lid)
 	{
 		ScLayer newLyr(layer);
-		newLyr.LNr = newID = getMaxNumber() + 1;
+		newLyr.ID = newID = getMaxID() + 1;
 		append(newLyr);
 	}
 	else
@@ -380,27 +380,27 @@
 ScLayer* ScLayers::newLayer(const QString& layerName)
 {
 	QString lname;
-	int     lnr    = getMaxNumber() + 1;
+	int     lId    = getMaxID() + 1;
 	int     llevel = count();
 	if (layerName.isEmpty())
 	{
 		QString tmp;
-		lname = QObject::tr("New Layer")+" "+tmp.setNum(lnr);
+		lname = QObject::tr("New Layer")+" "+tmp.setNum(lId);
 	}
 	else
 		lname = layerName;
-	ScLayer ll(lname, llevel, lnr);
+	ScLayer ll(lname, llevel, lId);
 	ScLayers::Iterator it = insert(end(), ll);
 	return &(*it);
 }
 
-bool ScLayers::removeLayerByNumber(int nr)
+bool ScLayers::removeLayerByID(int id)
 {
 	int index = -1;
 	int layerLevel = -1;
 	for (int i = 0; i < count(); ++i)
 	{
-		if (this->at(i).LNr == nr)
+		if (this->at(i).ID == id)
 		{
 			index      = i;
 			layerLevel = this->at(i).Level;
@@ -447,29 +447,29 @@
 
 bool ScLayers::raiseLayer(int nr)
 {
-	ScLayer* clyr = byNumber(nr);
+	ScLayer* clyr = byID(nr);
 	if (!clyr)
 		return false;
-	ScLayer* alyr = above(clyr->LNr);
+	ScLayer* alyr = above(clyr->ID);
 	if ((!alyr) || (clyr == alyr))
 		return false;
 	
-	clyr->LNr += 1;
-	alyr->LNr -= 1;
+	clyr->ID += 1;
+	alyr->ID -= 1;
 	return true;
 }
 
 bool ScLayers::lowerLayer(int nr)
 {
-	ScLayer* clyr = byNumber(nr);
+	ScLayer* clyr = byID(nr);
 	if (!clyr)
 		return false;
-	ScLayer* blyr = below(clyr->LNr);
+	ScLayer* blyr = below(clyr->ID);
 	if (!blyr || (clyr == blyr))
 		return false;
 
-	clyr->LNr -= 1;
-	blyr->LNr += 1;
+	clyr->ID -= 1;
+	blyr->ID += 1;
 	return true;
 }
 
@@ -482,17 +482,17 @@
 		it->Level = level;
 }
 
-bool ScLayers::layerPrintable(const int layerNumber) const
+bool ScLayers::layerPrintable(const int layerID) const
 {
-	const ScLayer* layer = layerByNumber(layerNumber);
+	const ScLayer* layer = layerByID(layerID);
 	if (layer)
 		return layer->isPrintable;
 	return false;
 }
 
-bool ScLayers::setLayerPrintable(const int layerNumber, const bool isPrintable)
+bool ScLayers::setLayerPrintable(const int layerID, const bool isPrintable)
 {
-	ScLayer* layer = byNumber(layerNumber);
+	ScLayer* layer = byID(layerID);
 	if (layer)
 	{
 		layer->isPrintable = isPrintable;
@@ -501,17 +501,17 @@
 	return false;
 }
 
-bool ScLayers::layerVisible(const int layerNumber) const
+bool ScLayers::layerVisible(const int layerID) const
 {
-	const ScLayer* layer = layerByNumber(layerNumber);
+	const ScLayer* layer = layerByID(layerID);
 	if (layer)
 		return layer->isViewable;
 	return false;
 }
 
-bool ScLayers::setLayerVisible(const int layerNumber, const bool isViewable)
+bool ScLayers::setLayerVisible(const int layerID, const bool isViewable)
 {
-	ScLayer* layer = byNumber(layerNumber);
+	ScLayer* layer = byID(layerID);
 	if (layer)
 	{
 		layer->isViewable = isViewable;
@@ -520,17 +520,17 @@
 	return false;
 }
 
-bool ScLayers::layerLocked(const int layerNumber) const
+bool ScLayers::layerLocked(const int layerID) const
 {
-	const ScLayer* layer = layerByNumber(layerNumber);
+	const ScLayer* layer = layerByID(layerID);
 	if (layer)
 		return !(layer->isEditable);
 	return false;
 }
 
-bool ScLayers::setLayerLocked(const int layerNumber, const bool isLocked)
+bool ScLayers::setLayerLocked(const int layerID, const bool isLocked)
 {
-	ScLayer* layer = byNumber(layerNumber);
+	ScLayer* layer = byID(layerID);
 	if (layer)
 	{
 		layer->isEditable = !isLocked;
@@ -539,17 +539,17 @@
 	return false;
 }
 
-bool ScLayers::layerFlow(const int layerNumber) const
+bool ScLayers::layerFlow(const int layerID) const
 {
-	const ScLayer* layer = layerByNumber(layerNumber);
+	const ScLayer* layer = layerByID(layerID);
 	if (layer)
 		return layer->flowControl;
 	return false;
 }
 
-bool ScLayers::setLayerFlow(const int layerNumber, const bool flow)
+bool ScLayers::setLayerFlow(const int layerID, const bool flow)
 {
-	ScLayer* layer = byNumber(layerNumber);
+	ScLayer* layer = byID(layerID);
 	if (layer)
 	{
 		layer->flowControl = flow;
@@ -558,17 +558,17 @@
 	return false;
 }
 
-bool ScLayers::layerOutline(const int layerNumber) const
+bool ScLayers::layerOutline(const int layerID) const
 {
-	const ScLayer* layer = layerByNumber(layerNumber);
+	const ScLayer* layer = layerByID(layerID);
 	if (layer)
 		return layer->outlineMode;
 	return false;
 }
 
-bool ScLayers::setLayerOutline(const int layerNumber, const bool outline)
+bool ScLayers::setLayerOutline(const int layerID, const bool outline)
 {
-	ScLayer* layer = byNumber(layerNumber);
+	ScLayer* layer = byID(layerID);
 	if (layer)
 	{
 		layer->outlineMode = outline;
@@ -577,17 +577,17 @@
 	return false;
 }
 
-double ScLayers::layerTransparency(const int layerNumber) const
+double ScLayers::layerTransparency(const int layerID) const
 {
-	const ScLayer* layer = layerByNumber(layerNumber);
+	const ScLayer* layer = layerByID(layerID);
 	if (layer)
 		return layer->transparency;
 	return 1.0;
 }
 
-bool ScLayers::setLayerTransparency(const int layerNumber, double trans)
+bool ScLayers::setLayerTransparency(const int layerID, double trans)
 {
-	ScLayer* layer = byNumber(layerNumber);
+	ScLayer* layer = byID(layerID);
 	if (layer)
 	{
 		layer->transparency = trans;
@@ -596,17 +596,17 @@
 	return false;
 }
 
-int ScLayers::layerBlendMode(const int layerNumber) const
+int ScLayers::layerBlendMode(const int layerID) const
 {
-	const ScLayer* layer = layerByNumber(layerNumber);
+	const ScLayer* layer = layerByID(layerID);
 	if (layer)
 		return layer->blendMode;
 	return 0;
 }
 
-bool ScLayers::setLayerBlendMode(const int layerNumber, int blend)
+bool ScLayers::setLayerBlendMode(const int layerID, int blend)
 {
-	ScLayer* layer = byNumber(layerNumber);
+	ScLayer* layer = byID(layerID);
 	if (layer)
 	{
 		layer->blendMode = blend;
@@ -615,17 +615,17 @@
 	return false;
 }
 
-QColor ScLayers::layerMarker(const int layerNumber) const
+QColor ScLayers::layerMarker(const int layerID) const
 {
-	const ScLayer* layer = layerByNumber(layerNumber);
+	const ScLayer* layer = layerByID(layerID);
 	if (layer)
 		return layer->markerColor;
 	return Qt::black;
 }
 
-bool ScLayers::setLayerMarker(const int layerNumber, QColor color)
+bool ScLayers::setLayerMarker(const int layerID, QColor color)
 {
-	ScLayer* layer = byNumber(layerNumber);
+	ScLayer* layer = byID(layerID);
 	if (layer)
 	{
 		layer->markerColor = color;
Index: scribus/scribusstructs.h
===================================================================
--- scribus/scribusstructs.h	(revision 13874)
+++ scribus/scribusstructs.h	(revision 13875)
@@ -143,7 +143,7 @@
 	QString IFont;
 	int ISize;
 	QStack<int> Groups;
-	int LayerNr;
+	int  LayerID;
 	bool ScaleType;
 	bool AspectRatio;
 	bool Locked;
Index: scribus/scpageoutput.cpp
===================================================================
--- scribus/scpageoutput.cpp	(revision 13874)
+++ scribus/scpageoutput.cpp	(revision 13875)
@@ -117,7 +117,7 @@
 	for (uint a = 0; a < pageFromMasterCount; ++a)
 	{
 		currItem = page->FromMaster.at(a);
-		if (currItem->LayerNr != layer.LNr)
+		if (currItem->LayerID != layer.ID)
 			continue;
 		if ((currItem->OwnPage != -1) && (currItem->OwnPage != static_cast<int>(Mp->pageNr())))
 			continue;
@@ -181,7 +181,7 @@
 	for (uint a = 0; a < pageFromMasterCount; ++a)
 	{
 		currItem = page->FromMaster.at(a);
-		if (currItem->LayerNr != layer.LNr)
+		if (currItem->LayerID != layer.ID)
 			continue;
 		if (!currItem->isTableItem)
 			continue;
@@ -245,7 +245,7 @@
 	for (int it = 0; it < m_doc->Items->count(); ++it)
 	{
 		currItem = m_doc->Items->at(it);
-		if (currItem->LayerNr != layer.LNr)
+		if (currItem->LayerID != layer.ID)
 			continue;
 		if (!currItem->printEnabled())
 			continue;
@@ -301,7 +301,7 @@
 	for (int it = 0; it < m_doc->Items->count(); ++it)
 	{
 		currItem = m_doc->Items->at(it);
-		if (currItem->LayerNr != layer.LNr)
+		if (currItem->LayerID != layer.ID)
 			continue;
 		if (!currItem->isTableItem)
 			continue;
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp	(revision 13874)
+++ scribus/pageitem.cpp	(revision 13875)
@@ -146,7 +146,7 @@
 	OldH2(other.OldH2),
 	Sizing(other.Sizing),
 	toPixmap(other.toPixmap),
-	LayerNr(other.LayerNr),
+	LayerID(other.LayerID),
 	ScaleType(other.ScaleType),
 	AspectRatio(other.AspectRatio),
 	Groups(other.Groups),
@@ -431,7 +431,7 @@
 	IRender = 1;
 	EmProfile = "";
 	Groups.clear();
-	LayerNr = m_Doc->activeLayer();
+	LayerID = m_Doc->activeLayer();
 	ScaleType = true;
 	AspectRatio = true;
 	Reverse = false;
@@ -978,7 +978,7 @@
 	}
 	
 	DrawObj_Pre(p, sc);
-	if (m_Doc->layerOutline(LayerNr))
+	if (m_Doc->layerOutline(LayerID))
 	{
 		if ((itemType()==TextFrame || itemType()==ImageFrame || itemType()==PathText || itemType()==Line || itemType()==PolyLine) && (!isGroupControl))
 			DrawObj_Item(p, cullingArea, sc);
@@ -999,9 +999,9 @@
 	if (!isEmbedded)
 		p->translate(Xpos, Ypos);
 	p->rotate(Rot);
-	if (m_Doc->layerOutline(LayerNr))
+	if (m_Doc->layerOutline(LayerID))
 	{
-		p->setPen(m_Doc->layerMarker(LayerNr), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+		p->setPen(m_Doc->layerMarker(LayerID), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 		p->setFillMode(ScPainter::None);
 		p->setBrushOpacity(1.0);
 		p->setPenOpacity(1.0);
@@ -1116,11 +1116,11 @@
 	ScribusView* view = m_Doc->view();
 	if (!isGroupControl)
 	{
-		if (m_Doc->layerOutline(LayerNr))
+		if (m_Doc->layerOutline(LayerID))
 		{
 			if (itemType()!=Line)
 			{
-				p->setPen(m_Doc->layerMarker(LayerNr), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+				p->setPen(m_Doc->layerMarker(LayerID), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 				p->setFillMode(ScPainter::None);
 				p->setBrushOpacity(1.0);
 				p->setPenOpacity(1.0);
@@ -1265,11 +1265,11 @@
 #endif
 			p->strokePath();
 		}
-		if ((m_Doc->guidesSettings.layerMarkersShown) && (m_Doc->layerCount() > 1) && (!m_Doc->layerOutline(LayerNr)) && ((isGroupControl) || (Groups.count() == 0)) && (!view->m_canvas->isPreviewMode()))
+		if ((m_Doc->guidesSettings.layerMarkersShown) && (m_Doc->layerCount() > 1) && (!m_Doc->layerOutline(LayerID)) && ((isGroupControl) || (Groups.count() == 0)) && (!view->m_canvas->isPreviewMode()))
 		{
 			p->setPen(Qt::black, 0.5/ m_Doc->view()->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 			p->setPenOpacity(1.0);
-			p->setBrush(m_Doc->layerMarker(LayerNr));
+			p->setBrush(m_Doc->layerMarker(LayerID));
 			p->setBrushOpacity(1.0);
 			p->setFillMode(ScPainter::Solid);
 			double ofwh = 10;
@@ -2017,10 +2017,10 @@
 //				   .arg(gly.size()).arg(a).arg(b).arg(c).arg(d)
 //				   .arg(p->worldMatrix().m11()).arg(p->worldMatrix().m22()).arg(p->worldMatrix().dx()).arg(p->worldMatrix().dy());
 			p->setupPolygon(&gly, true);
-			if (m_Doc->layerOutline(LayerNr))
+			if (m_Doc->layerOutline(LayerID))
 			{
 				p->save();
-				p->setPen(m_Doc->layerMarker(LayerNr), 0.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+				p->setPen(m_Doc->layerMarker(LayerID), 0.5, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 				p->setFillMode(ScPainter::None);
 				p->setBrushOpacity(1.0);
 				p->setPenOpacity(1.0);
@@ -2894,21 +2894,21 @@
 	emit frameType(m_ItemType);
 }
 
-void PageItem::setLayer(int layerId)
+void PageItem::setLayer(int newLayerID)
 {
-	if (LayerNr == layerId)
+	if (LayerID == newLayerID)
 		return;
 	if (UndoManager::undoEnabled())
 	{
 		SimpleState *ss = new SimpleState(Um::SendToLayer,
-										  QString(Um::FromTo).arg(LayerNr).arg(layerId),
+										  QString(Um::FromTo).arg(LayerID).arg(newLayerID),
 										  Um::ILayerAction);
 		ss->set("SEND_TO_LAYER", "send_to_layer");
-		ss->set("OLD_LAYER", LayerNr);
-		ss->set("NEW_LAYER", layerId);
+		ss->set("OLD_LAYER", LayerID);
+		ss->set("NEW_LAYER", newLayerID);
 		undoManager->action(this, ss);
 	}
-	LayerNr = layerId;
+	LayerID = newLayerID;
 }
 
 void PageItem::checkChanges(bool force)
@@ -4096,7 +4096,7 @@
 	Buffer->IRender = IRender;
 	Buffer->UseEmbedded = UseEmbedded;
 	Buffer->EmProfile = EmProfile;
-	Buffer->LayerNr = LayerNr;
+	Buffer->LayerID = LayerID;
 	Buffer->ScaleType = ScaleType;
 	Buffer->AspectRatio = AspectRatio;
 	Buffer->Locked = locked();
@@ -4948,7 +4948,7 @@
 	}
 	arrow.map(arrowTrans);
 	p->setupPolygon(&arrow);
-	if (m_Doc->layerOutline(LayerNr))
+	if (m_Doc->layerOutline(LayerID))
 		p->strokePath();
 	else
 	{
Index: scribus/scribusdoc.h
===================================================================
--- scribus/scribusdoc.h	(revision 13874)
+++ scribus/scribusdoc.h	(revision 13875)
@@ -202,18 +202,18 @@
 	int addLayer(const QString& layerName=QString::null, const bool activate=false);
 	/**
 	 * @brief Copies a layer from the current document
-	 * @param layerNumberToCopy source layer
+	 * @param layerIDToCopy source layer
 	 * @param whereToInsert target layer
 	 * @return Success or failure
 	 */
-	void copyLayer(int layerNumberToCopy, int whereToInsert);
+	void copyLayer(int layerIDToCopy, int whereToInsert);
 	/**
 	 * @brief Delete a layer from the current document
-	 * @param layerNumber of layer
+	 * @param layerID of layer
 	 * @param deleteItems the items on the layer too?
 	 * @return Success or failure
 	 */
-	bool deleteLayer(const int layerNumber, const bool deleteItems);
+	bool deleteLayer(const int layerID, const bool deleteItems);
 	/**
 	 * @brief Return the number of the current layer
 	 * @return Active layer number
@@ -239,120 +239,120 @@
 	bool setActiveLayer(const QString & layerNameToActivate);
 	/**
 	 * @brief Set the layer printable via the layer number
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @param isPrintable bool true = layer is prantable
 	 * @return Success or failure
 	 */
-	bool setLayerPrintable(const int layerNumber, const bool isPrintable);
+	bool setLayerPrintable(const int layerID, const bool isPrintable);
 	/**
 	 * @brief Is the layer printable
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return Printable or not
 	 */
-	bool layerPrintable(const int layerNumber);
+	bool layerPrintable(const int layerID);
 	/**
 	 * @brief Set the layer visible via the layer number
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @param isViewable true = layer is visible
 	 * @return Success or failure
 	 */
-	bool setLayerVisible(const int layerNumber, const bool isViewable);
+	bool setLayerVisible(const int layerID, const bool isViewable);
 	/**
 	 * @brief Is the layer visible
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return Visible or not
 	 */
-	bool layerVisible(const int layerNumber);
+	bool layerVisible(const int layerID);
 	/**
 	 * @brief Set the layer locked via the layer number
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @param isLocked true = layer is locked
 	 * @return Success or failure
 	 */
-	bool setLayerLocked(const int layerNumber, const bool isLocked);
+	bool setLayerLocked(const int layerID, const bool isLocked);
 	/**
 	 * @brief Is the layer locked
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return Locked or not
 	 */
-	bool layerLocked(const int layerNumber);
+	bool layerLocked(const int layerID);
 	/**
 	 * @brief Set the layer flow via the layer number
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @param flow true = Text flows around objects on this layer
 	 * @return Success or failure
 	 */
-	bool setLayerFlow(const int layerNumber, const bool flow);
+	bool setLayerFlow(const int layerID, const bool flow);
 	/**
 	 * @brief does text flow around objects on this layer
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return flow or not
 	 */
-	bool layerFlow(const int layerNumber);
+	bool layerFlow(const int layerID);
 	/**
 	 * @brief Set the layer transparency via the layer number
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @param trans transparency value 0.0 - 1.0
 	 * @return Success or failure
 	 */
-	bool setLayerTransparency(const int layerNumber, double trans);
+	bool setLayerTransparency(const int layerID, double trans);
 	/**
 	 * @brief returns the layer transparency
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return transparency value 0.0 - 1.0
 	 */
-	double layerTransparency(const int layerNumber);
+	double layerTransparency(const int layerID);
 	/**
 	 * @brief Set the layer layerBlendMode via the layer number
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @param blend layerBlendMode
 	 * @return Success or failure
 	 */
-	bool setLayerBlendMode(const int layerNumber, int blend);
+	bool setLayerBlendMode(const int ID, int blend);
 	/**
 	 * @brief returns the layer BlendMode
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return layerBlendMode
 	 */
-	int layerBlendMode(const int layerNumber);
+	int layerBlendMode(const int ID);
 	/**
 	 * @brief Return the level of the requested layer
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return Level of the layer
 	 */
-	int layerLevelFromNumber(const int layerNumber);
+	int layerLevelFromID(const int layerID);
 	/**
 	 * @brief Set the layer marker color
-	 * @param layerNumber Number of the layer
+	 * @param ID Number of the layer
 	 * @param color color of the marker
 	 * @return Success or failure
 	 */
-	bool setLayerMarker(const int layerNumber, QColor color);
+	bool setLayerMarker(const int layerID, QColor color);
 	/**
 	 * @brief returns the layer marker color
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return marker color
 	 */
-	QColor layerMarker(const int layerNumber);
+	QColor layerMarker(const int layerID);
 	/**
 	 * @brief Set the layer outline mode via the layer number
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @param outline true = layer is displayed in outlines only
 	 * @return Success or failure
 	 */
-	bool setLayerOutline(const int layerNumber, const bool outline);
+	bool setLayerOutline(const int layerID, const bool outline);
 	/**
 	 * @brief is this layer in outline mode
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return outline or not
 	 */
-	bool layerOutline(const int layerNumber);
+	bool layerOutline(const int layerID);
 	/**
 	 * @brief Return the number of the layer at a certain level
 	 * @param layerLevel Layer level
-	 * @return Layer number
+	 * @return Layer ID
 	 */
-	int layerNumberFromLevel(const int layerLevel);
+	int layerIDFromLevel(const int layerLevel);
 	/**
 	 * @brief Return the layer count
 	 * @return Number of layers in doc
@@ -360,10 +360,10 @@
 	int layerCount() const;
 	/**
 	 * @brief Lower a layer
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return Success or failure
 	 */
-	bool lowerLayer(const int layerNumber);
+	bool lowerLayer(const int layerID);
 	/**
 	 * @brief Lower a layer using the level
 	 * @param layerLevel Level of the layer
@@ -372,10 +372,10 @@
 	bool lowerLayerByLevel(const int layerLevel);
 	/**
 	 * @brief Raise a layer
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return Success or failure
 	 */
-	bool raiseLayer(const int layerNumber);
+	bool raiseLayer(const int layerID);
 	/**
 	 * @brief Raise a layer using the level
 	 * @param layerLevel Level of the layer
@@ -384,30 +384,30 @@
 	bool raiseLayerByLevel(const int layerLevel);
 	/**
 	 * @brief Return the layer name
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return Name of the layer
 	 */
-	QString layerName(const int layerNumber) const;
+	QString layerName(const int layerID) const;
 	/**
 	 * @brief Change the name of a layer
-	 * @param layerNumber number of the layer
+	 * @param layerID ID of the layer
 	 * @param newName new name of the layer
 	 * @return Success or failure
 	 */
-	bool changeLayerName(const int layerNumber, const QString& newName);
+	bool changeLayerName(const int layerID, const QString& newName);
 	/**
 	 * @brief Does the layer have items on it?
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return Layer contains items bool
 	 */
-	bool layerContainsItems(const int layerNumber);
+	bool layerContainsItems(const int layerID);
 	/**
 	 * @brief Renumber a layer. Used in particular for reinsertion for undo/redo
-	 * @param layerNumber old layer number
-	 * @param newLayerNumber New layer number
+	 * @param layerID old layer ID
+	 * @param newLayerID New layer ID
 	 * @return Success or failure
 	 */
-	bool renumberLayer(const int layerNumber, const int newLayerNumber);
+	bool renumberLayer(const int layerID, const int newLayerID);
 	/**
 	 * @brief Return a list of the layers in their order
 	 * @param list QStringList to insert the layer names into
@@ -1166,7 +1166,7 @@
 	void itemSelection_FlipV();
 	void itemSelection_DoHyphenate();
 	void itemSelection_DoDeHyphenate();
-	void itemSelection_SendToLayer(int layerNumber);
+	void itemSelection_SendToLayer(int layerID);
 	void itemSelection_SetImageOffset(double x, double y, Selection* customSelection=0);
 	void itemSelection_SetImageScale(double x, double y, Selection* customSelection=0);
 	void itemSelection_SetImageScaleAndOffset(double ox, double oy, double sx, double sy, Selection* customSelection=0);
Index: scribus/scribusview.cpp
===================================================================
--- scribus/scribusview.cpp	(revision 13874)
+++ scribus/scribusview.cpp	(revision 13875)
@@ -933,7 +933,7 @@
 		//Should make a nice function for this.
 		for (int i=0; i<Doc->Items->count(); ++i)
 		{
-			if (Doc->Items->at(i)->LayerNr==Doc->activeLayer())
+			if (Doc->Items->at(i)->LayerID==Doc->activeLayer())
 			{
 				Doc->m_Selection->delaySignalsOn();
 				if (m_canvas->frameHitTest(dropPosDocQ, Doc->Items->at(i)) >= Canvas::INSIDE)
@@ -973,7 +973,7 @@
 		{
 			int z = Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, dropPosDoc.x(), dropPosDoc.y(), 1, 1, Doc->toolSettings.dWidth, Doc->toolSettings.dBrushPict, CommonStrings::None, true);
 			PageItem *b = Doc->Items->at(z);
-			b->LayerNr = Doc->activeLayer();
+			b->LayerID = Doc->activeLayer();
 			Doc->LoadPict(url.toLocalFile(), b->ItemNr);
 			b->setWidth(static_cast<double>(b->OrigW * 72.0 / b->pixm.imgInfo.xres));
 			b->setHeight(static_cast<double>(b->OrigH * 72.0 / b->pixm.imgInfo.yres));
@@ -1240,7 +1240,7 @@
 				for (int a = 0; a < Doc->m_Selection->count(); ++a)
 				{
 					PageItem *currItem = Doc->m_Selection->itemAt(a);
-					currItem->LayerNr = Doc->activeLayer();
+					currItem->LayerID = Doc->activeLayer();
 					currItem->gXpos = currItem->xPos() - gx;
 					currItem->gYpos = currItem->yPos() - gy;
 					currItem->gWidth = gw;
@@ -1256,7 +1256,7 @@
 			{
 				Doc->m_Selection->connectItemToGUI();
 				currItem = Doc->m_Selection->itemAt(0);
-				currItem->LayerNr = Doc->activeLayer();
+				currItem->LayerID = Doc->activeLayer();
 				if (Doc->useRaster)
 				{
 					double nx = currItem->xPos();
@@ -2253,7 +2253,7 @@
 		if (currItem->isBookmark)
 			emit AddBM(currItem);
 		newObjects.addItem(currItem);
-		currItem->LayerNr = Doc->activeLayer();
+		currItem->LayerID = Doc->activeLayer();
 	}
 	if (newObjects.count() > 1)
 	{
@@ -2849,13 +2849,13 @@
 void ScribusView::GotoLa(int l)
 {
 	int level = Doc->layerCount()-l-1;
-	int layerNumber=Doc->layerNumberFromLevel(level);
-	if (layerNumber==-1)
+	int layerID=Doc->layerIDFromLevel(level);
+	if (layerID==-1)
 		return;
-	Doc->setActiveLayer(layerNumber);
+	Doc->setActiveLayer(layerID);
 	//CB TODO fix this to use view calls after 1.3.2 release
 	m_ScMW->changeLayer(Doc->activeLayer());
-	emit changeLA(layerNumber);
+	emit changeLA(layerID);
 }
 
 void ScribusView::ChgUnit(int art)
@@ -3755,8 +3755,8 @@
 	currItem->Cols = Buffer->Cols;
 	currItem->ColGap = Buffer->ColGap;
 	currItem->setFirstLineOffset(Buffer->firstLineOffsetP);
-	if (Buffer->LayerNr != -1)
-		currItem->LayerNr = Buffer->LayerNr;
+	if (Buffer->LayerID != -1)
+		currItem->LayerID = Buffer->LayerID;
 	currItem->PoLine = Buffer->PoLine.copy();
 	//currItem->setTextFlowUsesContourLine(Buffer->UseContour);
 	currItem->setTextFlowMode((PageItem::TextFlowMode) Buffer->TextflowMode);
Index: scribus/sclayer.h
===================================================================
--- scribus/sclayer.h	(revision 13874)
+++ scribus/sclayer.h	(revision 13875)
@@ -18,9 +18,9 @@
 {
 public:
 	ScLayer(void);
-	ScLayer(const QString& name, int level, int nr);
+	ScLayer(const QString& name, int level, int id);
 	QString Name;
-	int     LNr;
+	int     ID;
 	int     Level;
 	bool    isPrintable;
 	bool    isViewable;
@@ -42,7 +42,7 @@
 	 * @brief  Get layer max identifier
 	 * @return Layer max identifier or -1 is list is empty
 	 */
-	int getMaxNumber(void);
+	int getMaxID(void);
 
 	/**
 	 * @brief  Get bottom layer
@@ -88,7 +88,7 @@
 	 * @param  nr the layer number
 	 * @return layer with the specified number or NULL if not found
 	 */
-	ScLayer* byNumber(const int nr);
+	ScLayer* byID(const int nr);
 
 	/**
 	 * @brief  Get layer above the layer with the specified ID
@@ -116,7 +116,7 @@
 	 * @param  nr the layer number
 	 * @return layer with the specified number or NULL if not found
 	 */
-	const ScLayer* layerByNumber (int nr) const;
+	const ScLayer* layerByID (int nr) const;
 
 	/**
 	 * @brief  Get layer with a specific name
@@ -178,7 +178,7 @@
 	 * @brief  Remove a layer from the layer list
 	 * @param  the layer number to remove
 	 */
-	bool removeLayerByNumber(int nr);
+	bool removeLayerByID(int id);
 
 	/**
 	 * @brief  Remove a layer from the layer list
@@ -205,123 +205,123 @@
 
 	/**
 	 * @brief Is the layer printable
-	 * @param layerNumber ID of the layer
+	 * @param layerID ID of the layer
 	 * @return Printable or not
 	 */
-	bool layerPrintable(const int layerNumber) const;
+	bool layerPrintable(const int layerID) const;
 
 	/**
-	 * @brief Set the layer printable via the layer number
-	 * @param layerNumber ID of the layer
+	 * @brief Set the layer printable via the layer ID
+	 * @param layerID ID of the layer
 	 * @param isPrintable bool true = layer is prantable
 	 * @return Success or failure
 	 */
-	bool setLayerPrintable(const int layerNumber, const bool isPrintable);
+	bool setLayerPrintable(const int layerID, const bool isPrintable);
 
 	/**
 	 * @brief Is the layer visible
-	 * @param layerNumber ID of the layer
+	 * @param layerID ID of the layer
 	 * @return Visible or not
 	 */
-	bool layerVisible(const int layerNumber) const;
+	bool layerVisible(const int layerID) const;
 
 	/**
-	 * @brief Set the layer visible via the layer number
-	 * @param layerNumber ID of the layer
+	 * @brief Set the layer visible via the layer ID
+	 * @param layerID ID of the layer
 	 * @param isViewable true = layer is visible
 	 * @return Success or failure
 	 */
-	bool setLayerVisible(const int layerNumber, const bool isViewable);
+	bool setLayerVisible(const int layerID, const bool isViewable);
 
 	/**
 	 * @brief Is the layer locked
-	 * @param layerNumber ID of the layer
+	 * @param layerID ID of the layer
 	 * @return Locked or not
 	 */
-	bool layerLocked(const int layerNumber) const;
+	bool layerLocked(const int layerID) const;
 
 	/**
-	 * @brief Set the layer locked via the layer number
-	 * @param layerNumber ID of the layer
+	 * @brief Set the layer locked via the layer ID
+	 * @param layerID ID of the layer
 	 * @param isViewable true = layer is locked
 	 * @return bool Success or failure
 	 */
-	bool setLayerLocked(const int layerNumber, const bool isViewable);
+	bool setLayerLocked(const int layerID, const bool isViewable);
 
 	/**
 	 * @brief does text flow around objects on this layer
-	 * @param layerNumber ID of the layer
+	 * @param layerID ID of the layer
 	 * @return flow or not
 	 */
-	bool layerFlow(const int layerNumber) const;
+	bool layerFlow(const int layerID) const;
 
 	/**
-	 * @brief Set the layer flow via the layer number
-	 * @param layerNumber ID of the layer
+	 * @brief Set the layer flow via the layer ID
+	 * @param layerID ID of the layer
 	 * @param flow true = Text flows around objects on this layer
 	 * @return Success or failure
 	 */
-	bool setLayerFlow(const int layerNumber, const bool flow);
+	bool setLayerFlow(const int layerID, const bool flow);
 
 	/**
 	 * @brief is this layer in outline mode
-	 * @param layerNumber ID of the layer
+	 * @param layerID ID of the layer
 	 * @return outline or not
 	 */
-	bool layerOutline(const int layerNumber) const;
+	bool layerOutline(const int layerID) const;
 
 	/**
-	 * @brief Set the layer outline mode via the layer number
-	 * @param layerNumber ID of the layer
+	 * @brief Set the layer outline mode via the layer ID
+	 * @param layerID ID of the layer
 	 * @param outline true = layer is displayed in outlines only
 	 * @return Success or failure
 	 */
-	bool setLayerOutline(const int layerNumber, const bool outline);
+	bool setLayerOutline(const int layerID, const bool outline);
 
 	/**
 	 * @brief returns the layer transparency
-	 * @param layerNumber ID of the layer
+	 * @param layerID ID of the layer
 	 * @return transparency value 0.0 - 1.0
 	 */
-	double layerTransparency(const int layerNumber) const;
+	double layerTransparency(const int layerID) const;
 
 	/**
-	 * @brief Set the layer transparency via the layer number
-	 * @param layerNumber ID of the layer
+	 * @brief Set the layer transparency via the layer ID
+	 * @param layerID ID of the layer
 	 * @param trans transparency value 0.0 - 1.0
 	 * @return Success or failure
 	 */
-	bool setLayerTransparency(const int layerNumber, double trans);
+	bool setLayerTransparency(const int layerID, double trans);
 
 	/**
 	 * @brief returns the layer BlendMode
-	 * @param layerNumber ID of the layer
+	 * @param layerID ID of the layer
 	 * @return layerBlendMode
 	 */
-	int layerBlendMode(const int layerNumber) const;
+	int layerBlendMode(const int layerID) const;
 
 	/**
-	 * @brief Set the layer layerBlendMode via the layer number
-	 * @param layerNumber ID of the layer
+	 * @brief Set the layer layerBlendMode via the layer ID
+	 * @param layerID ID of the layer
 	 * @param trans layerBlendMode
 	 * @return Success or failure
 	 */
-	bool setLayerBlendMode(const int layerNumber, int blend);
+	bool setLayerBlendMode(const int layerID, int blend);
 
 	/**
 	 * @brief returns the layer marker color
-	 * @param layerNumber Number of the layer
+	 * @param layerID ID of the layer
 	 * @return marker color
 	 */
-	QColor layerMarker(const int layerNumber) const;
+	QColor layerMarker(const int layerID) const;
 
 	/**
 	 * @brief Set the layer marker color
-	 * @param layerNumber ID of the layer
+	 * @param layerID ID of the layer
 	 * @param color color of the marker
 	 * @return Success or failure
 	 */
-	 bool setLayerMarker(const int layerNumber, QColor color);
+	 bool setLayerMarker(const int layerID, QColor color);
 };
 
 uint qHash(const ScLayer& layer);
Index: scribus/pageitem_textframe.cpp
===================================================================
--- scribus/pageitem_textframe.cpp	(revision 13874)
+++ scribus/pageitem_textframe.cpp	(revision 13875)
@@ -126,7 +126,7 @@
 	QRegion result(clip);
 	if (!isEmbedded)
 	{
-		int LayerLev = m_Doc->layerLevelFromNumber(LayerNr);
+		int LayerLev = m_Doc->layerLevelFromID(LayerID);
 		uint docItemsCount=m_Doc->Items->count();
 		Page* Mp=0;
 		Page* Dp=0;
@@ -142,8 +142,8 @@
 			for (int a = 0; a < m_Doc->MasterItems.count(); ++a)
 			{
 				docItem = m_Doc->MasterItems.at(a);
-				LayerLevItem = m_Doc->layerLevelFromNumber(docItem->LayerNr);
-				if (((docItem->ItemNr > ItemNr) && (docItem->LayerNr == LayerNr)) || (LayerLevItem > LayerLev && m_Doc->layerFlow(docItem->LayerNr)))
+				LayerLevItem = m_Doc->layerLevelFromID(docItem->LayerID);
+				if (((docItem->ItemNr > ItemNr) && (docItem->LayerID == LayerID)) || (LayerLevItem > LayerLev && m_Doc->layerFlow(docItem->LayerID)))
 				{
 					if (docItem->Groups.count() == 0)
 						currentGroup = -1;
@@ -179,8 +179,8 @@
 			for (uint a = 0; a < docItemsCount; ++a)
 			{
 				docItem = m_Doc->Items->at(a);
-				LayerLevItem = m_Doc->layerLevelFromNumber(docItem->LayerNr);
-				if (((docItem->ItemNr > ItemNr) && (docItem->LayerNr == LayerNr)) || (LayerLevItem > LayerLev && m_Doc->layerFlow(docItem->LayerNr)))
+				LayerLevItem = m_Doc->layerLevelFromID(docItem->LayerID);
+				if (((docItem->ItemNr > ItemNr) && (docItem->LayerID == LayerID)) || (LayerLevItem > LayerLev && m_Doc->layerFlow(docItem->LayerID)))
 				{
 					if (docItem->Groups.count() == 0)
 						currentGroup = -1;
@@ -2353,7 +2353,7 @@
 	}
 	
 	pf2.rotate(Rot);
-	if (!m_Doc->layerOutline(LayerNr))
+	if (!m_Doc->layerOutline(LayerID))
 	{
 		if ((fillColor() != CommonStrings::None) || (GrType != 0))
 		{
@@ -2601,9 +2601,9 @@
 void PageItem_TextFrame::DrawObj_Post(ScPainter *p)
 {
 	ScribusView* view = m_Doc->view();
-	if (m_Doc->layerOutline(LayerNr))
+	if (m_Doc->layerOutline(LayerID))
 	{
-		p->setPen(m_Doc->layerMarker(LayerNr), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
+		p->setPen(m_Doc->layerMarker(LayerID), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 		p->setFillMode(ScPainter::None);
 		p->setBrushOpacity(1.0);
 		p->setPenOpacity(1.0);
@@ -2702,11 +2702,11 @@
 		}
 		if ((m_Doc->guidesSettings.colBordersShown) && (!view->m_canvas->isPreviewMode()))
 			drawColumnBorders(p);
-		if ((m_Doc->guidesSettings.layerMarkersShown) && (m_Doc->layerCount() > 1) && (!m_Doc->layerOutline(LayerNr)) && (!view->m_canvas->isPreviewMode()))
+		if ((m_Doc->guidesSettings.layerMarkersShown) && (m_Doc->layerCount() > 1) && (!m_Doc->layerOutline(LayerID)) && (!view->m_canvas->isPreviewMode()))
 		{
 			p->setPen(Qt::black, 0.5/ m_Doc->view()->scale(), Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 			p->setPenOpacity(1.0);
-			p->setBrush(m_Doc->layerMarker(LayerNr));
+			p->setBrush(m_Doc->layerMarker(LayerID));
 			p->setBrushOpacity(1.0);
 			p->setFillMode(ScPainter::Solid);
 			double ofwh = 10;
Index: scribus/ui/checkDocument.cpp
===================================================================
--- scribus/ui/checkDocument.cpp	(revision 13874)
+++ scribus/ui/checkDocument.cpp	(revision 13875)
@@ -334,7 +334,7 @@
 			break;
 	};
 	// additional informations
-	const ScLayer* layer = m_Doc->Layers.layerByNumber(pageItem->LayerNr);
+	const ScLayer* layer = m_Doc->Layers.layerByID(pageItem->LayerID);
 	if (layer)
 	{
 		item->setText(COLUMN_LAYER, layer->Name);
Index: scribus/ui/layers.cpp
===================================================================
--- scribus/ui/layers.cpp	(revision 13874)
+++ scribus/ui/layers.cpp	(revision 13875)
@@ -205,9 +205,9 @@
 	Table->setRowCount(layerCount);
 	for (it = layers->begin(); it != layers->end(); ++it)
 	{
-		int layerNumber=(*it).LNr;
+		int layerID=(*it).ID;
 		//TODO once "layers" is not set anymore, need to get layer number differently
-		int layerLevel = m_Doc->layerLevelFromNumber(layerNumber);
+		int layerLevel = m_Doc->layerLevelFromID(layerID);
 		tmp = tmp.setNum(layerLevel);
 		int row = layerCount-layerLevel-1;
 		QToolButton *pb = new QToolButton(this);
@@ -215,7 +215,7 @@
 		pb->setAutoRaise(true);
 		pb->setText( "" );
 		QPixmap pm(20,15);
-		pm.fill(m_Doc->layerMarker(layerNumber));
+		pm.fill(m_Doc->layerMarker(layerID));
 		pb->setIcon(pm);
 		Table->setCellWidget(row, 0, pb);
 		connect(pb, SIGNAL(clicked()), this, SLOT(markLayer()));
@@ -223,28 +223,28 @@
 		cp2->setObjectName(tmp);
 		connect(cp2, SIGNAL(clicked()), this, SLOT(visibleLayer()));
 		Table->setCellWidget(row, 1, cp2);
-		cp2->setChecked(m_Doc->layerVisible(layerNumber));
+		cp2->setChecked(m_Doc->layerVisible(layerID));
 		QCheckBox *cp = new QCheckBox(this);
 		cp->setObjectName(tmp);
 		Table->setCellWidget(row, 2, cp);
-		cp->setChecked(m_Doc->layerPrintable(layerNumber));
+		cp->setChecked(m_Doc->layerPrintable(layerID));
 		connect(cp, SIGNAL(clicked()), this, SLOT(printLayer()));
 		QCheckBox *cp3 = new QCheckBox(this);
 		cp3->setObjectName(tmp);
 		connect(cp3, SIGNAL(clicked()), this, SLOT(lockLayer()));
 		Table->setCellWidget(row, 3, cp3);
-		cp3->setChecked(m_Doc->layerLocked(layerNumber));
+		cp3->setChecked(m_Doc->layerLocked(layerID));
 		QCheckBox *cp4 = new QCheckBox(this);
 		cp4->setObjectName(tmp);
 		connect(cp4, SIGNAL(clicked()), this, SLOT(flowToggleLayer()));
 		Table->setCellWidget(row, 4, cp4);
-		cp4->setChecked(m_Doc->layerFlow(layerNumber));
+		cp4->setChecked(m_Doc->layerFlow(layerID));
 		QCheckBox *cp5 = new QCheckBox(this);
 		cp5->setObjectName(tmp);
 		connect(cp5, SIGNAL(clicked()), this, SLOT(outlineToggleLayer()));
 		Table->setCellWidget(row, 5, cp5);
-		cp5->setChecked(m_Doc->layerOutline(layerNumber));
-		Table->setItem(row, 6, new QTableWidgetItem(m_Doc->layerName(layerNumber)));
+		cp5->setChecked(m_Doc->layerOutline(layerID));
+		Table->setItem(row, 6, new QTableWidgetItem(m_Doc->layerName(layerID)));
 	}
 	connect(Table, SIGNAL(cellChanged(int, int)), this, SLOT(changeName(int, int)));
 	connect(Table, SIGNAL(cellClicked(int, int)), this, SLOT(setActiveLayer(int, int)));
@@ -283,9 +283,9 @@
 	if (layerCount < 2)
 		return;
 	int level = layerCount-1-Table->currentRow();
-	int layerNumber=m_Doc->layerNumberFromLevel(level);
+	int layerID=m_Doc->layerIDFromLevel(level);
 	bool delToo = false;
-	if (m_Doc->layerContainsItems(layerNumber))
+	if (m_Doc->layerContainsItems(layerID))
 	{
 		int scmReturn = QMessageBox::warning(this, tr("Delete Layer"),
 									tr("Do you want to delete all objects on this layer too?"),
@@ -295,7 +295,7 @@
 		delToo = (scmReturn != QMessageBox::No);
 	}
 
-	if (!m_Doc->deleteLayer(layerNumber, delToo))
+	if (!m_Doc->deleteLayer(layerID, delToo))
 		return;
 
 	rebuildList();
@@ -337,9 +337,9 @@
 	if (col == 6)
 	{
 		int layerLevel = m_Doc->layerCount()-1-row;
-		int layerNumber=m_Doc->layerNumberFromLevel(layerLevel);
-		if (layerNumber!=-1)
-			m_Doc->changeLayerName(layerNumber, Table->item(row, col)->text());
+		int layerID=m_Doc->layerIDFromLevel(layerLevel);
+		if (layerID!=-1)
+			m_Doc->changeLayerName(layerID, Table->item(row, col)->text());
 	}
 	m_Doc->scMW()->changeLayer(m_Doc->activeLayer());
 }
@@ -347,13 +347,13 @@
 void LayerPalette::visibleLayer()
 {
 	int level = QString(sender()->objectName()).toInt();
-	int layerNumber=m_Doc->layerNumberFromLevel(level);
-	if (layerNumber==-1)
+	int layerID=m_Doc->layerIDFromLevel(level);
+	if (layerID==-1)
 		return;
 	const QObject* senderBox=sender();
 	if (strcmp(senderBox->metaObject()->className(), "QCheckBox") == 0)
 	{
-		m_Doc->setLayerVisible(layerNumber,((QCheckBox*)(senderBox))->isChecked());
+		m_Doc->setLayerVisible(layerID,((QCheckBox*)(senderBox))->isChecked());
 		setActiveLayer(Table->currentRow(), -1);
 		emit LayerChanged();
 	}
@@ -362,13 +362,13 @@
 void LayerPalette::printLayer()
 {
 	int level = QString(sender()->objectName()).toInt();
-	int layerNumber=m_Doc->layerNumberFromLevel(level);
-	if (layerNumber==-1)
+	int layerID=m_Doc->layerIDFromLevel(level);
+	if (layerID==-1)
 		return;
 	const QObject* senderBox=sender();
 	if (strcmp(senderBox->metaObject()->className(), "QCheckBox") == 0)
 	{
-		m_Doc->setLayerPrintable(layerNumber,((QCheckBox*)(senderBox))->isChecked());
+		m_Doc->setLayerPrintable(layerID,((QCheckBox*)(senderBox))->isChecked());
 		setActiveLayer(Table->currentRow(), -1);
 	}
 }
@@ -376,13 +376,13 @@
 void LayerPalette::lockLayer()
 {
 	int level = QString(sender()->objectName()).toInt();
-	int layerNumber=m_Doc->layerNumberFromLevel(level);
-	if (layerNumber==-1)
+	int layerID=m_Doc->layerIDFromLevel(level);
+	if (layerID==-1)
 		return;
 	const QObject* senderBox=sender();
 	if (strcmp(senderBox->metaObject()->className(), "QCheckBox") == 0)
 	{
-		m_Doc->setLayerLocked(layerNumber,((QCheckBox*)(senderBox))->isChecked());
+		m_Doc->setLayerLocked(layerID,((QCheckBox*)(senderBox))->isChecked());
 		deleteLayerButton->setEnabled(!((QCheckBox*)(senderBox))->isChecked());
 		setActiveLayer(Table->currentRow(), -1);
 	}
@@ -392,13 +392,13 @@
 void LayerPalette::flowToggleLayer()
 {
 	int level = QString(sender()->objectName()).toInt();
-	int layerNumber=m_Doc->layerNumberFromLevel(level);
-	if (layerNumber==-1)
+	int layerID=m_Doc->layerIDFromLevel(level);
+	if (layerID==-1)
 		return;
 	const QObject* senderBox=sender();
 	if (strcmp(senderBox->metaObject()->className(), "QCheckBox") == 0)
 	{
-		m_Doc->setLayerFlow(layerNumber,((QCheckBox*)(senderBox))->isChecked());
+		m_Doc->setLayerFlow(layerID,((QCheckBox*)(senderBox))->isChecked());
 		setActiveLayer(Table->currentRow(), -1);
 	}
 }
@@ -406,13 +406,13 @@
 void LayerPalette::outlineToggleLayer()
 {
 	int level = QString(sender()->objectName()).toInt();
-	int layerNumber=m_Doc->layerNumberFromLevel(level);
-	if (layerNumber==-1)
+	int layerID=m_Doc->layerIDFromLevel(level);
+	if (layerID==-1)
 		return;
 	const QObject* senderBox=sender();
 	if (strcmp(senderBox->metaObject()->className(), "QCheckBox") == 0)
 	{
-		m_Doc->setLayerOutline(layerNumber,((QCheckBox*)(senderBox))->isChecked());
+		m_Doc->setLayerOutline(layerID,((QCheckBox*)(senderBox))->isChecked());
 		emit LayerChanged();
 		setActiveLayer(Table->currentRow(), -1);
 	}
@@ -426,7 +426,7 @@
 		int layerCount = m_Doc->layerCount();
 		for (it = layers->begin(); it != layers->end(); ++it)
 		{
-			int row = layerCount - m_Doc->layerLevelFromNumber((*it).LNr) - 1;
+			int row = layerCount - m_Doc->layerLevelFromID((*it).ID) - 1;
 			if (index == 1)
 			{
 				((QCheckBox*)(Table->cellWidget(row, 1)))->toggle();
@@ -460,20 +460,20 @@
 void LayerPalette::markLayer()
 {
 	int level = QString(sender()->objectName()).toInt();
-	int layerNumber=m_Doc->layerNumberFromLevel(level);
-	if (layerNumber==-1)
+	int layerID=m_Doc->layerIDFromLevel(level);
+	if (layerID==-1)
 		return;
 	const QObject* senderBox=sender();
 	if (strcmp(senderBox->metaObject()->className(), "QToolButton") == 0)
 	{
 		QColor neu = QColor();
-		neu = QColorDialog::getColor(m_Doc->layerMarker(layerNumber), this);
+		neu = QColorDialog::getColor(m_Doc->layerMarker(layerID), this);
 		if (neu.isValid())
 		{
 			QPixmap pm(20,15);
 			pm.fill(neu);
 			((QToolButton*)(senderBox))->setIcon(pm);
-			m_Doc->setLayerMarker(layerNumber,neu);
+			m_Doc->setLayerMarker(layerID,neu);
 			emit LayerChanged();
 		}
 		setActiveLayer(Table->currentRow(), -1);
@@ -492,15 +492,15 @@
 	emit LayerChanged();
 }
 
-void LayerPalette::markActiveLayer(int layerNumber)
+void LayerPalette::markActiveLayer(int layerID)
 {
 	disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(changeBlendMode(int)));
 	disconnect(opacitySpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeOpacity()));
 	disconnect(Table, SIGNAL(cellClicked(int, int)), this, SLOT(setActiveLayer(int, int)));
-	int layerToMark=layerNumber;
-	if (layerNumber==-1)
+	int layerToMark=layerID;
+	if (layerID==-1)
 		layerToMark=m_Doc->activeLayer();
-	Table->setCurrentCell(m_Doc->layerCount()-1-m_Doc->layerLevelFromNumber(layerToMark), 6);
+	Table->setCurrentCell(m_Doc->layerCount()-1-m_Doc->layerLevelFromID(layerToMark), 6);
 	opacitySpinBox->setValue(qRound(m_Doc->layerTransparency(layerToMark) * 100));
 	blendMode->setCurrentIndex(m_Doc->layerBlendMode(layerToMark));
 	deleteLayerButton->setEnabled(m_Doc->layerCount()>1 && !m_Doc->layerLocked( m_Doc->activeLayer() ));
@@ -529,8 +529,8 @@
 	}
 	disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(changeBlendMode(int)));
 	disconnect(opacitySpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeOpacity()));
-	int layerNumber=m_Doc->layerNumberFromLevel(m_Doc->layerCount()-1-row);
-	bool found=m_Doc->setActiveLayer(layerNumber);
+	int layerID=m_Doc->layerIDFromLevel(m_Doc->layerCount()-1-row);
+	bool found=m_Doc->setActiveLayer(layerID);
 	if (found)
 	{
 		m_Doc->scMW()->changeLayer(m_Doc->activeLayer());
Index: scribus/ui/masterpagepalette.cpp
===================================================================
--- scribus/ui/masterpagepalette.cpp	(revision 13874)
+++ scribus/ui/masterpagepalette.cpp	(revision 13875)
@@ -264,14 +264,14 @@
 				for (uint ite = 0; ite < oldItems; ++ite)
 				{
 					PageItem *itemToCopy = currentDoc->Items->at(ite);
-					if (itemToCopy->OwnPage == inde && (it->LNr == itemToCopy->LayerNr))
+					if (itemToCopy->OwnPage == inde && (it->ID == itemToCopy->LayerID))
 						currentDoc->m_Selection->addItem(itemToCopy, true);
 				}
 				if (currentDoc->m_Selection->count() != 0)
 				{
 					ScriXmlDoc *ss = new ScriXmlDoc();
 					QString buffer = ss->WriteElem(currentDoc, currentView, currentDoc->m_Selection);
-					ss->ReadElemToLayer(buffer, prefsManager->appPrefs.AvailFonts, currentDoc, destination->xOffset(), destination->yOffset(), false, true, prefsManager->appPrefs.GFontSub, currentView, it->LNr);
+					ss->ReadElemToLayer(buffer, prefsManager->appPrefs.AvailFonts, currentDoc, destination->xOffset(), destination->yOffset(), false, true, prefsManager->appPrefs.GFontSub, currentView, it->ID);
 					currentDoc->m_Selection->clear();
 					delete ss;
 				}
Index: scribus/ui/layers.h
===================================================================
--- scribus/ui/layers.h	(revision 13874)
+++ scribus/ui/layers.h	(revision 13875)
@@ -62,7 +62,7 @@
 	void changeBlendMode(int blend);
 	void setActiveLayer(int row, int col);
 	void ClearInhalt();
-	void markActiveLayer(int layerNumber=-1);
+	void markActiveLayer(int layerID=-1);
 	void languageChange();
 
 signals:
Index: scribus/ui/contextmenu.cpp
===================================================================
--- scribus/ui/contextmenu.cpp	(revision 13874)
+++ scribus/ui/contextmenu.cpp	(revision 13875)
@@ -283,7 +283,7 @@
 		{
 			QMap<int,int> layerMap;
 			for (ScLayers::iterator it = m_doc->Layers.begin(); it != m_doc->Layers.end(); ++it)
-				layerMap.insert((*it).Level, (*it).LNr);
+				layerMap.insert((*it).Level, (*it).ID);
 			int i=layerMap.count()-1;
 			while (i>=0)
 			{
Index: scribus/pageitem_imageframe.cpp
===================================================================
--- scribus/pageitem_imageframe.cpp	(revision 13874)
+++ scribus/pageitem_imageframe.cpp	(revision 13875)
@@ -57,7 +57,7 @@
 {
 	if(!m_Doc->RePos)
 	{
-		if (!m_Doc->layerOutline(LayerNr))
+		if (!m_Doc->layerOutline(LayerID))
 		{
 			p->setFillRule(true);
 			if ((fillColor() != CommonStrings::None) || (GrType != 0))
Index: scribus/plugins/xfigimplugin/importxfig.cpp
===================================================================
--- scribus/plugins/xfigimplugin/importxfig.cpp	(revision 13874)
+++ scribus/plugins/xfigimplugin/importxfig.cpp	(revision 13875)
@@ -1510,7 +1510,7 @@
 			m_Doc->Items->append(ite);
 			ite->ItemNr = m_Doc->Items->count()-1;
 			if ((importerFlags & LoadSavePlugin::lfCreateDoc) && (it > 0))
-				ite->LayerNr = currentLayer;
+				ite->LayerID = currentLayer;
 		}
 	}
 }
Index: scribus/plugins/fileloader/scribus12format/scribus12format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus12format/scribus12format.cpp	(revision 13874)
+++ scribus/plugins/fileloader/scribus12format/scribus12format.cpp	(revision 13875)
@@ -387,9 +387,9 @@
 				m_Doc->JavaScripts[pg.attribute("NAME")] = pg.attribute("SCRIPT");
 			if(pg.tagName()=="LAYERS")
 			{
-				int lnr   = pg.attribute("NUMMER").toInt();
+				int lId   = pg.attribute("NUMMER").toInt();
 				int level = pg.attribute("LEVEL").toInt();
-				ScLayer la( pg.attribute("NAME"), level, lnr);
+				ScLayer la( pg.attribute("NAME"), level, lId);
 				la.isViewable = pg.attribute("SICHTBAR").toInt();
 				la.isPrintable = pg.attribute("DRUCKEN").toInt();
 				m_Doc->Layers.append(la);
@@ -495,7 +495,7 @@
 					tmpf = obj.attribute("IFONT", m_Doc->toolSettings.defFont);
 					m_AvailableFonts->findFont(tmpf, m_Doc);
 					OB.IFont = tmpf;
-					OB.LayerNr = obj.attribute("LAYER", "0").toInt();
+					OB.LayerID = obj.attribute("LAYER", "0").toInt();
 					OB.Language = obj.attribute("LANGUAGE", m_Doc->Language);
 					tmp = "";
 					if ((obj.hasAttribute("GROUPS")) && (obj.attribute("NUMGROUP", "0").toInt() != 0))
@@ -724,7 +724,7 @@
 	{
 		ScLayer* nl = m_Doc->Layers.newLayer( QObject::tr("Background") );
 		nl->flowControl = false;
-		activeLayer = nl->LNr;
+		activeLayer = nl->ID;
 	}
 	m_Doc->setActiveLayer(activeLayer);
 	
@@ -1163,7 +1163,7 @@
 	uint layerCount=m_Doc->layerCount();
 	for (uint la2 = 0; la2 < layerCount; ++la2)
 	{
-		maxLayer = qMax(m_Doc->Layers[la2].LNr, maxLayer);
+		maxLayer = qMax(m_Doc->Layers[la2].ID, maxLayer);
 		maxLevel = qMax(m_Doc->Layers[la2].Level, maxLevel);
 	}
 	DoVorl.clear();
@@ -1217,21 +1217,21 @@
 				m_Doc->JavaScripts[pg.attribute("NAME")] = pg.attribute("SCRIPT");
 			if(pg.tagName()=="LAYERS")
 			{
-				int lnr   = pg.attribute("NUMMER").toInt();
+				int lId   = pg.attribute("NUMMER").toInt();
 				int level = pg.attribute("LEVEL").toInt();
-				ScLayer la( pg.attribute("NAME"), level, lnr );
+				ScLayer la( pg.attribute("NAME"), level, lId );
 				la.isViewable = pg.attribute("SICHTBAR").toInt();
 				la.isPrintable = pg.attribute("DRUCKEN").toInt();
 				la.flowControl = true;
 				const ScLayer* la2 = m_Doc->Layers.layerByName(la.Name);
 				if (la2)
-					layerTrans.insert(la.LNr, la2->LNr);
+					layerTrans.insert(la.ID, la2->ID);
 				else
 				{
 					maxLayer++;
 					maxLevel++;
-					layerTrans.insert(la.LNr, maxLayer);
-					la.LNr = maxLayer;
+					layerTrans.insert(la.ID, maxLayer);
+					la.ID = maxLayer;
 					la.Level = maxLevel;
 					m_Doc->Layers.append(la);
 				}
@@ -1348,7 +1348,7 @@
 						tmpf = m_Doc->toolSettings.defFont;
 					m_AvailableFonts->findFont(tmpf, m_Doc);
 					OB.IFont = tmpf;
-					OB.LayerNr = layerTrans[obj.attribute("LAYER", "0").toInt()];
+					OB.LayerID = layerTrans[obj.attribute("LAYER", "0").toInt()];
 					OB.Language = obj.attribute("LANGUAGE", m_Doc->Language);
 					tmp = "";
 					if ((obj.hasAttribute("GROUPS")) && (obj.attribute("NUMGROUP", "0").toInt() != 0))
Index: scribus/plugins/fileloader/scribus13format/scribus13format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(revision 13874)
+++ scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(revision 13875)
@@ -525,9 +525,9 @@
 				m_Doc->JavaScripts[pg.attribute("NAME")] = pg.attribute("SCRIPT");
 			if(pg.tagName()=="LAYERS")
 			{
-				int lnr   = pg.attribute("NUMMER").toInt();
+				int lId   = pg.attribute("NUMMER").toInt();
 				int level = pg.attribute("LEVEL").toInt();
-				ScLayer la( pg.attribute("NAME"), level, lnr);
+				ScLayer la( pg.attribute("NAME"), level, lId);
 				la.isViewable   = pg.attribute("SICHTBAR").toInt();
 				la.isPrintable  = pg.attribute("DRUCKEN").toInt();
 				la.isEditable   = pg.attribute("EDIT", "1").toInt();
@@ -1115,7 +1115,7 @@
 	{
 		ScLayer* nl = m_Doc->Layers.newLayer( QObject::tr("Background") );
 		nl->flowControl  = false;
-		layerToSetActive = nl->LNr;
+		layerToSetActive = nl->ID;
 	}
 	m_Doc->setActiveLayer(layerToSetActive);
 	
@@ -1473,7 +1473,7 @@
 	for (uint lay = 0; lay < layerCount; ++lay)
 	{
 		QDomElement la = docu.createElement("LAYERS");
-		la.setAttribute("NUMMER",m_Doc->Layers[lay].LNr);
+		la.setAttribute("NUMMER",m_Doc->Layers[lay].ID);
 		la.setAttribute("LEVEL",m_Doc->Layers[lay].Level);
 		la.setAttribute("NAME",m_Doc->Layers[lay].Name);
 		la.setAttribute("SICHTBAR", static_cast<int>(m_Doc->Layers[lay].isViewable));
@@ -2407,7 +2407,7 @@
 	currItem->Cols   = obj->attribute("COLUMNS", "1").toInt();
 	currItem->ColGap = ScCLocale::toDoubleC(obj->attribute("COLGAP"), 0.0);
 	if (obj->attribute("LAYER", "0").toInt() != -1)
-		currItem->LayerNr = obj->attribute("LAYER", "0").toInt();
+		currItem->LayerID = obj->attribute("LAYER", "0").toInt();
 	tmp = "";
 	if ((obj->hasAttribute("GROUPS")) && (obj->attribute("NUMGROUP", "0").toInt() != 0))
 	{
@@ -2585,7 +2585,7 @@
 	uint layerCount=m_Doc->layerCount();
 	for (uint la2 = 0; la2 < layerCount; ++la2)
 	{
-		maxLayer = qMax(m_Doc->Layers[la2].LNr, maxLayer);
+		maxLayer = qMax(m_Doc->Layers[la2].ID, maxLayer);
 		maxLevel = qMax(m_Doc->Layers[la2].Level, maxLevel);
 	}
 	DoVorl.clear();
@@ -2644,9 +2644,9 @@
 				m_Doc->JavaScripts[pg.attribute("NAME")] = pg.attribute("SCRIPT");
 			if(pg.tagName()=="LAYERS")
 			{
-				int lnr   = pg.attribute("NUMMER").toInt();
+				int lId   = pg.attribute("NUMMER").toInt();
 				int level = pg.attribute("LEVEL").toInt();
-				ScLayer la( pg.attribute("NAME"), level, lnr );
+				ScLayer la( pg.attribute("NAME"), level, lId );
 				la.isViewable   = pg.attribute("SICHTBAR").toInt();
 				la.isPrintable  = pg.attribute("DRUCKEN").toInt();
 				la.isEditable   = pg.attribute("EDIT", "1").toInt();
@@ -2658,13 +2658,13 @@
 					la.markerColor =  QColor(pg.attribute("LAYERC","#000000"));
 				const ScLayer* la2 = m_Doc->Layers.layerByName(la.Name);
 				if (la2)
-					layerTrans.insert(la.LNr, la2->LNr);
+					layerTrans.insert(la.ID, la2->ID);
 				else
 				{
 					maxLayer++;
 					maxLevel++;
-					layerTrans.insert(la.LNr, maxLayer);
-					la.LNr = maxLayer;
+					layerTrans.insert(la.ID, maxLayer);
+					la.ID = maxLayer;
 					la.Level = maxLevel;
 					m_Doc->Layers.append(la);
 				}
@@ -3590,7 +3590,7 @@
 			ob.setAttribute("NEXTITEM", item->nextInChain()->ItemNr);
 		else
 			ob.setAttribute("NEXTITEM", -1);
-		ob.setAttribute("LAYER", item->LayerNr);
+		ob.setAttribute("LAYER", item->LayerID);
 
 		//CB PageItemAttributes
 		QDomElement docItemAttrs = docu->createElement("PageItemAttributes");
Index: scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(revision 13874)
+++ scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(revision 13875)
@@ -595,7 +595,7 @@
 	for (uint lay = 0; lay < layerCount; ++lay)
 	{
 		docu.writeEmptyElement("LAYERS");
-		docu.writeAttribute("NUMMER",m_Doc->Layers[lay].LNr);
+		docu.writeAttribute("NUMMER",m_Doc->Layers[lay].ID);
 		docu.writeAttribute("LEVEL",m_Doc->Layers[lay].Level);
 		docu.writeAttribute("NAME",m_Doc->Layers[lay].Name);
 		docu.writeAttribute("SICHTBAR", static_cast<int>(m_Doc->Layers[lay].isViewable));
@@ -1164,7 +1164,7 @@
 		if (! item->itemText.defaultStyle().isInhAlignment())
 			docu.writeAttribute("ALIGN", item->itemText.defaultStyle().alignment());
 		
-		docu.writeAttribute("LAYER", item->LayerNr);
+		docu.writeAttribute("LAYER", item->LayerID);
 		docu.writeAttribute("BOOKMARK", item->isBookmark ? 1 : 0);
 
 		if (item->nextInChain() != 0)
Index: scribus/plugins/fileloader/scribus150format/scribus150format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(revision 13874)
+++ scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(revision 13875)
@@ -1235,9 +1235,9 @@
 
 void Scribus150Format::readLayers(ScLayer& layer, ScXmlStreamAttributes& attrs)
 {
-	int lnr   = attrs.valueAsInt("NUMMER");
+	int lId   = attrs.valueAsInt("NUMMER");
 	int level = attrs.valueAsInt("LEVEL");
-	layer = ScLayer( attrs.valueAsString("NAME"), level, lnr);
+	layer = ScLayer( attrs.valueAsString("NAME"), level, lId);
 	layer.isViewable   = attrs.valueAsInt("SICHTBAR");
 	layer.isPrintable  = attrs.valueAsInt("DRUCKEN");
 	layer.isEditable   = attrs.valueAsInt("EDIT", 1);
@@ -2579,7 +2579,7 @@
 	currItem->Cols   = attrs.valueAsInt("COLUMNS", 1);
 	currItem->ColGap = attrs.valueAsDouble("COLGAP", 0.0);
 	if (attrs.valueAsInt("LAYER", 0) != -1)
-		currItem->LayerNr = attrs.valueAsInt("LAYER", 0);
+		currItem->LayerID = attrs.valueAsInt("LAYER", 0);
 	tmp = "";
 
 	if (attrs.hasAttribute("GROUPS") && (attrs.valueAsInt("NUMGROUP", 0) != 0))
@@ -2801,7 +2801,7 @@
 	uint layerCount=m_Doc->layerCount();
 	for (uint la2 = 0; la2 < layerCount; ++la2)
 	{
-		maxLayer = qMax(m_Doc->Layers[la2].LNr, maxLayer);
+		maxLayer = qMax(m_Doc->Layers[la2].ID, maxLayer);
 		maxLevel = qMax(m_Doc->Layers[la2].Level, maxLevel);
 	}
 
@@ -2863,13 +2863,13 @@
 			readLayers(newLayer, attrs);
 			const ScLayer* la2 = m_Doc->Layers.layerByName(newLayer.Name);
 			if (la2)
-				layerTrans.insert(newLayer.LNr, la2->LNr);
+				layerTrans.insert(newLayer.ID, la2->ID);
 			else
 			{
 				maxLayer++;
 				maxLevel++;
-				layerTrans.insert(newLayer.LNr, maxLayer);
-				newLayer.LNr = maxLayer;
+				layerTrans.insert(newLayer.ID, maxLayer);
+				newLayer.ID = maxLayer;
 				newLayer.Level = maxLevel;
 				m_Doc->Layers.append(newLayer);
 			}
Index: scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp	(revision 13874)
+++ scribus/plugins/fileloader/scribus134format/scribus134format_save.cpp	(revision 13875)
@@ -592,7 +592,7 @@
 	for (uint lay = 0; lay < layerCount; ++lay)
 	{
 		docu.writeEmptyElement("LAYERS");
-		docu.writeAttribute("NUMMER",m_Doc->Layers[lay].LNr);
+		docu.writeAttribute("NUMMER",m_Doc->Layers[lay].ID);
 		docu.writeAttribute("LEVEL",m_Doc->Layers[lay].Level);
 		docu.writeAttribute("NAME",m_Doc->Layers[lay].Name);
 		docu.writeAttribute("SICHTBAR", static_cast<int>(m_Doc->Layers[lay].isViewable));
@@ -1161,7 +1161,7 @@
 		if (! item->itemText.defaultStyle().isInhAlignment())
 			docu.writeAttribute("ALIGN", item->itemText.defaultStyle().alignment());
 		
-		docu.writeAttribute("LAYER", item->LayerNr);
+		docu.writeAttribute("LAYER", item->LayerID);
 		docu.writeAttribute("BOOKMARK", item->isBookmark ? 1 : 0);
 
 		if (item->nextInChain() != 0)
Index: scribus/plugins/fileloader/scribus134format/scribus134format.cpp
===================================================================
--- scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 13874)
+++ scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(revision 13875)
@@ -566,7 +566,7 @@
 	{
 		ScLayer* nl = m_Doc->Layers.newLayer( QObject::tr("Background") );
 		nl->flowControl  = false;
-		layerToSetActive = nl->LNr;
+		layerToSetActive = nl->ID;
 	}
 	m_Doc->setActiveLayer(layerToSetActive);
 
@@ -1264,9 +1264,9 @@
 
 void Scribus134Format::readLayers(ScLayer& layer, ScXmlStreamAttributes& attrs)
 {
-	int lnr   = attrs.valueAsInt("NUMMER");
+	int lId   = attrs.valueAsInt("NUMMER");
 	int level = attrs.valueAsInt("LEVEL");
-	layer = ScLayer( attrs.valueAsString("NAME"), level, lnr);
+	layer = ScLayer( attrs.valueAsString("NAME"), level, lId);
 	layer.isViewable   = attrs.valueAsInt("SICHTBAR");
 	layer.isPrintable  = attrs.valueAsInt("DRUCKEN");
 	layer.isEditable   = attrs.valueAsInt("EDIT", 1);
@@ -2634,7 +2634,7 @@
 	currItem->Cols   = attrs.valueAsInt("COLUMNS", 1);
 	currItem->ColGap = attrs.valueAsDouble("COLGAP", 0.0);
 	if (attrs.valueAsInt("LAYER", 0) != -1)
-		currItem->LayerNr = attrs.valueAsInt("LAYER", 0);
+		currItem->LayerID = attrs.valueAsInt("LAYER", 0);
 	tmp = "";
 
 	if (attrs.hasAttribute("GROUPS") && (attrs.valueAsInt("NUMGROUP", 0) != 0))
@@ -2881,7 +2881,7 @@
 	uint layerCount=m_Doc->layerCount();
 	for (uint la2 = 0; la2 < layerCount; ++la2)
 	{
-		maxLayer = qMax(m_Doc->Layers[la2].LNr, maxLayer);
+		maxLayer = qMax(m_Doc->Layers[la2].ID, maxLayer);
 		maxLevel = qMax(m_Doc->Layers[la2].Level, maxLevel);
 	}
 
@@ -2951,13 +2951,13 @@
 			readLayers(newLayer, attrs);
 			const ScLayer* la2 = m_Doc->Layers.layerByName(newLayer.Name);
 			if (la2)
-				layerTrans.insert(newLayer.LNr, la2->LNr);
+				layerTrans.insert(newLayer.ID, la2->ID);
 			else
 			{
 				maxLayer++;
 				maxLevel++;
-				layerTrans.insert(newLayer.LNr, maxLayer);
-				newLayer.LNr = maxLayer;
+				layerTrans.insert(newLayer.ID, maxLayer);
+				newLayer.ID = maxLayer;
 				newLayer.Level = maxLevel;
 				m_Doc->Layers.append(newLayer);
 			}
Index: scribus/plugins/svgexplugin/svgexplugin.cpp
===================================================================
--- scribus/plugins/svgexplugin/svgexplugin.cpp	(revision 13874)
+++ scribus/plugins/svgexplugin/svgexplugin.cpp	(revision 13875)
@@ -299,7 +299,7 @@
 	for(int j = 0; j < Items.count(); ++j)
 	{
 		Item = Items.at(j);
-		if (Item->LayerNr != layer.LNr)
+		if (Item->LayerID != layer.ID)
 			continue;
 		if (!Item->printEnabled())
 			continue;
@@ -352,7 +352,7 @@
 	for(int j = 0; j < Items.count(); ++j)
 	{
 		Item = Items.at(j);
-		if (Item->LayerNr != layer.LNr)
+		if (Item->LayerID != layer.ID)
 			continue;
 		if (!Item->printEnabled())
 			continue;
Index: scribus/scpreview.cpp
===================================================================
--- scribus/scpreview.cpp	(revision 13874)
+++ scribus/scpreview.cpp	(revision 13875)
@@ -468,7 +468,7 @@
 				OB.Height = 0;
 				OB.Clip.setPoints(4, -1,-1, static_cast<int>(OB.Width+1),-1, static_cast<int>(OB.Width+1), static_cast<int>(OB.Height+1), -1, static_cast<int>(OB.Height+1));
 			}
-			OB.LayerNr = -1;
+			OB.LayerID = -1;
 			OB.startArrowIndex =  arrowID[pg.attribute("startArrowIndex", "0").toInt()];
 			OB.endArrowIndex =  arrowID[pg.attribute("endArrowIndex", "0").toInt()];
 			if(static_cast<bool>(pg.attribute("isGroupControl", "0").toInt()))
Index: scribus/pslib.cpp
===================================================================
--- scribus/pslib.cpp	(revision 13874)
+++ scribus/pslib.cpp	(revision 13875)
@@ -1888,7 +1888,7 @@
 			int Lnr = 0;
 			ScLayer ll;
 			ll.isPrintable = false;
-			ll.LNr = 0;
+			ll.ID = 0;
 			for (int lam = 0; lam < Doc->Layers.count() && !abortExport && !errorOccured; ++lam)
 			{
 				Doc->Layers.levelToLayer(ll, Lnr);
@@ -1900,7 +1900,7 @@
 						PageItem *it = Doc->MasterItems.at(api);
 						if (usingGUI)
 							ScQApp->processEvents();
-						if ((it->LayerNr != ll.LNr) || (!it->printEnabled()))
+						if ((it->LayerID != ll.ID) || (!it->printEnabled()))
 							continue;
 						double bLeft, bRight, bBottom, bTop;
 						GetBleeds(Doc->MasterPages.at(ap), bLeft, bRight, bBottom, bTop);
@@ -2909,7 +2909,7 @@
 	int Lnr = 0;
 	ScLayer ll;
 	ll.isPrintable = false;
-	ll.LNr = 0;
+	ll.ID = 0;
 	PItems = (a->pageName().isEmpty()) ? Doc->DocItems : Doc->MasterItems;
 	for (int la = 0; la < Doc->Layers.count(); ++la)
 	{
@@ -2921,7 +2921,7 @@
 				c = PItems.at(b);
 				if (usingGUI)
 					ScQApp->processEvents();
-				if (c->LayerNr != ll.LNr)
+				if (c->LayerID != ll.ID)
 					continue;
 				if ((!a->pageName().isEmpty()) && (c->asTextFrame()))
 					continue;
@@ -2979,7 +2979,7 @@
 			c = PItems.at(b);
 			if (usingGUI)
 				ScQApp->processEvents();
-			if (c->LayerNr != ll.LNr)
+			if (c->LayerID != ll.ID)
 				continue;
 			if ((!a->pageName().isEmpty()) && (c->asTextFrame()))
 				continue;
@@ -3071,7 +3071,7 @@
 			PageItem *ite = page->FromMaster.at(am);
 			if (usingGUI)
 				ScQApp->processEvents();
-			if ((ite->LayerNr != layer.LNr) || (!ite->printEnabled()))
+			if ((ite->LayerID != layer.ID) || (!ite->printEnabled()))
 				continue;
 			if (ite->isGroupControl)
 			{
@@ -3252,7 +3252,7 @@
 			PageItem *item = items.at(b);
 			if (usingGUI)
 				ScQApp->processEvents();
-			if (item->LayerNr != layer.LNr)
+			if (item->LayerID != layer.ID)
 				continue;
 			if ((!page->pageName().isEmpty()) && (item->asTextFrame()))
 				continue;
@@ -3313,7 +3313,7 @@
 		PageItem* item = items.at(b);
 		if (usingGUI)
 			ScQApp->processEvents();
-		if (item->LayerNr != layer.LNr)
+		if (item->LayerID != layer.ID)
 			continue;
 		if ((!page->pageName().isEmpty()) && (item->asTextFrame()))
 			continue;
Index: scribus/util_layer.cpp
===================================================================
--- scribus/util_layer.cpp	(revision 13874)
+++ scribus/util_layer.cpp	(revision 13875)
@@ -64,9 +64,9 @@
 		{
 			// Create new layer for master elements
 			ScLayer masterElemLayer(*layer);
-			int oldId = masterElemLayer.LNr;
-			int newId = newLayers.getMaxNumber() + 1;
-			masterElemLayer.LNr  = newId;
+			int oldId = masterElemLayer.ID;
+			int newId = newLayers.getMaxID() + 1;
+			masterElemLayer.ID  = newId;
 			masterElemLayer.Name = layer->Name + QObject::tr(" (mp items)");
 			newLayers.append(masterElemLayer);
 			layerMap.insert(oldId, newId);
@@ -82,8 +82,8 @@
 	for (int i = 0; i < mpCount; ++i)
 	{
 		item = doc->MasterItems.at(i);
-		idIt = layerMap.find(item->LayerNr);
+		idIt = layerMap.find(item->LayerID);
 		if (idIt != layerMap.end())
-			item->LayerNr = idIt.value();
+			item->LayerID = idIt.value();
 	}
 }
Index: scribus/pageitem_desaxe.cpp
===================================================================
--- scribus/pageitem_desaxe.cpp	(revision 13874)
+++ scribus/pageitem_desaxe.cpp	(revision 13875)
@@ -49,7 +49,7 @@
 	const PageItem* nxt = item->nextInChain(); 
 	if (nxt)
 		result.insert("nextframe", "obj" + toXMLString(nxt->getUId())); 
-	result.insert("layer", toXMLString(item->LayerNr));
+	result.insert("layer", toXMLString(item->LayerID));
 	result.insert("level", toXMLString(item->ItemNr));
 	result.insert("itemtype", toXMLString(item->realItemType()));
 	
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 13874)
+++ scribus/scribus.cpp	(revision 13875)
@@ -3608,25 +3608,25 @@
 		{
 			for (it = doc->Layers.begin(); it != doc->Layers.end(); ++it)
 			{
-				scrLayersActions.insert(QString("%1").arg((*it).LNr), new ScrAction( ScrAction::Layer, QPixmap(), QPixmap(), (*it).Name, QKeySequence(), this, (*it).LNr));
-				scrLayersActions[QString("%1").arg((*it).LNr)]->setToggleAction(true);
+				scrLayersActions.insert(QString("%1").arg((*it).ID), new ScrAction( ScrAction::Layer, QPixmap(), QPixmap(), (*it).Name, QKeySequence(), this, (*it).ID));
+				scrLayersActions[QString("%1").arg((*it).ID)]->setToggleAction(true);
 				QPixmap pm(20,15);
 				pm.fill((*it).markerColor);
-				scrLayersActions[QString("%1").arg((*it).LNr)]->setIcon(pm);
+				scrLayersActions[QString("%1").arg((*it).ID)]->setIcon(pm);
 			}
 		}
 		int currActiveLayer=doc->activeLayer();
 		bool found=false;
 		for (it = doc->Layers.begin(); it != doc->Layers.end(); ++it)
 		{
-			if ((*it).LNr == currActiveLayer)
+			if ((*it).ID == currActiveLayer)
 			{
 				found=true;
 				break;
 			}
 		}
 		Q_ASSERT(found);
-		scrLayersActions[QString("%1").arg((*it).LNr)]->setChecked(true);
+		scrLayersActions[QString("%1").arg((*it).ID)]->setChecked(true);
 
 		for( QMap<QString, QPointer<ScrAction> >::Iterator it = scrLayersActions.begin(); it!=scrLayersActions.end(); ++it )
 		{
@@ -3647,7 +3647,7 @@
 			(*it)->setChecked(false);
 		}
 		if (doc->m_Selection->count()>0 && doc->m_Selection->itemAt(0))
-			scrLayersActions[QString("%1").arg(doc->m_Selection->itemAt(0)->LayerNr)]->setChecked(true);
+			scrLayersActions[QString("%1").arg(doc->m_Selection->itemAt(0)->LayerID)]->setChecked(true);
 		for( QMap<QString, QPointer<ScrAction> >::Iterator it = scrLayersActions.begin(); it!=itend; ++it )
 			connect( (*it), SIGNAL(triggeredData(int)), doc, SLOT(itemSelection_SendToLayer(int)) );
 	}
@@ -5221,7 +5221,7 @@
 					QByteArray fragment = ScMimeData::clipboardScribusFragment();
 					Selection pastedObjects = doc->serializer()->deserializeObjects(fragment);
 					for (int i=0; i < pastedObjects.count(); ++i)
-						pastedObjects.itemAt(i)->LayerNr = doc->activeLayer();
+						pastedObjects.itemAt(i)->LayerID = doc->activeLayer();
 
 					/*double x = doc->currentPage()->xOffset();
 					double y = doc->currentPage()->yOffset();
@@ -5297,7 +5297,7 @@
 		for (uint a = 0; a < docItemsCount; ++a)
 		{
 			currItem = doc->Items->at(a);
-			if ((currItem->LayerNr == doc->activeLayer()) && (!doc->layerLocked(currItem->LayerNr)))
+			if ((currItem->LayerID == doc->activeLayer()) && (!doc->layerLocked(currItem->LayerID)))
 			{
 				if ((range == 0) && (currItem->OwnPage != docCurrentPage))
 					continue;
@@ -5393,7 +5393,7 @@
 		for (uint a = 0; a < docItemsCount; ++a)
 		{
 			currItem = doc->Items->at(a);
-			if ((currItem->LayerNr == doc->activeLayer()) && (!doc->layerLocked(currItem->LayerNr)))
+			if ((currItem->LayerID == doc->activeLayer()) && (!doc->layerLocked(currItem->LayerID)))
 			{
 				if (docWideSelect)
 					doc->m_Selection->addItem(currItem);
Index: scribus/plugins/scriptplugin/scripter2/scripter2_scribus_pageitem.cpp
===================================================================
--- scribus/plugins/scriptplugin/scripter2/scripter2_scribus_pageitem.cpp	(revision 13874)
+++ scribus/plugins/scriptplugin/scripter2/scripter2_scribus_pageitem.cpp	(revision 13875)
@@ -141,7 +141,7 @@
 			.def_readwrite("FrameType", &PageItem::FrameType)
 			.def_readwrite("GrType", &PageItem::GrType)
 			.def_readwrite("IRender", &PageItem::IRender)
-			.def_readwrite("LayerNr", &PageItem::LayerNr)
+			.def_readwrite("LayerID", &PageItem::LayerID)
 			.def_readwrite("LeftLinkID", &PageItem::LeftLinkID)
 			.def_readwrite("LineSpMode", &PageItem::LineSpMode)
 			.def_readwrite("NextIt", &PageItem::NextIt)
Index: scribus/plugins/scriptplugin/cmdmisc.cpp
===================================================================
--- scribus/plugins/scriptplugin/cmdmisc.cpp	(revision 13874)
+++ scribus/plugins/scriptplugin/cmdmisc.cpp	(revision 13875)
@@ -214,7 +214,7 @@
 		for (int lam=0; lam < ScCore->primaryMainWindow()->doc->Layers.count(); ++lam)
 			if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Layer))
 			{
-				i->LayerNr = static_cast<int>(lam);
+				i->LayerID = static_cast<int>(lam);
 				found = true;
 				break;
 			}
@@ -702,7 +702,7 @@
 		if (ScCore->primaryMainWindow()->doc->Layers[lam].Name == QString::fromUtf8(Name))
 		{
 			ScLayer it2 = ScCore->primaryMainWindow()->doc->Layers.at(lam);
-			int num2 = it2.LNr;
+			int num2 = it2.ID;
 			if (!num2)
 			{
 				// FIXME: WTF DOES THIS DO?
Index: scribus/plugins/imposition/imposition.cpp
===================================================================
--- scribus/plugins/imposition/imposition.cpp	(revision 13874)
+++ scribus/plugins/imposition/imposition.cpp	(revision 13875)
@@ -516,7 +516,7 @@
 				
 				for (int k = 0; k < pastedObjects.count(); k++)
 				{
-					if (pastedObjects.itemAt(k)->LayerNr == j) gs->addItem(pastedObjects.itemAt(k));
+					if (pastedObjects.itemAt(k)->LayerID == j) gs->addItem(pastedObjects.itemAt(k));
 				}
 				
 				if (gs->count() > 0)
@@ -704,7 +704,7 @@
 				
 				for (int k = 0; k < pastedObjects.count(); k++)
 				{
-					if (pastedObjects.itemAt(k)->LayerNr == j) gs->addItem(pastedObjects.itemAt(k));
+					if (pastedObjects.itemAt(k)->LayerID == j) gs->addItem(pastedObjects.itemAt(k));
 				}
 				
 				if (gs->count() > 0)
@@ -867,7 +867,7 @@
 				
 				for (int k = 0; k < pastedObjects.count(); k++)
 				{
-					if (pastedObjects.itemAt(k)->LayerNr == j) gs->addItem(pastedObjects.itemAt(k));
+					if (pastedObjects.itemAt(k)->LayerID == j) gs->addItem(pastedObjects.itemAt(k));
 				}
 				
 				if (gs->count() > 0)
@@ -1021,7 +1021,7 @@
 				
 				for (int k = 0; k < pastedObjects.count(); k++)
 				{
-					if (pastedObjects.itemAt(k)->LayerNr == j) gs->addItem(pastedObjects.itemAt(k));
+					if (pastedObjects.itemAt(k)->LayerID == j) gs->addItem(pastedObjects.itemAt(k));
 				}
 				
 				if (gs->count() > 0)
Index: scribus/canvasmode_normal.cpp
===================================================================
--- scribus/canvasmode_normal.cpp	(revision 13874)
+++ scribus/canvasmode_normal.cpp	(revision 13875)
@@ -933,8 +933,8 @@
 				m_canvas->Transform(docItem, p);
 			//	QRegion apr = QRegion(docItem->Clip * p);
 				QRect apr2(docItem->getRedrawBounding(m_canvas->scale()));
-			//	if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerNr == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerNr)))
-				if ((Sele.contains(apr2)) && (docItem->LayerNr == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerNr)))
+			//	if (((Sele.contains(apr.boundingRect())) || (Sele.contains(apr2))) && (docItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerID)))
+				if ((Sele.contains(apr2)) && (docItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerID)))
 				{
 					bool redrawSelection=false;
 					m_view->SelectItemNr(a, redrawSelection);
@@ -1425,7 +1425,7 @@
 		for (int a = 0; a < m_doc->m_Selection->count(); ++a)
 		{
 			PageItem *currItem = m_doc->m_Selection->itemAt(a);
-			currItem->LayerNr = m_doc->activeLayer();
+			currItem->LayerID = m_doc->activeLayer();
 		}
 		m_doc->useRaster = savedAlignGrid;
 		m_doc->SnapGuides = savedAlignGuides;




More information about the scribus-commit mailing list