View Issue Details

IDProjectCategoryView StatusLast Update
0000991ScribusUser Interfacepublic2004-08-24 22:31
Reporterjo-hannes Assigned Tofschmid  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformAMD Athlon 1000MHzOSSuse LinuxOS Version9.1
Summary0000991: layer selector doesnt reflect the order of the layers
Descriptionadd some layers, change their level. layer selector should change them too, but doesnt.
TagsNo tags attached.
Patch

Relationships

has duplicate 0000994 closedcbradney some order of layers in selector as in dialog 
child of 0003838 acknowledged Metabug: Scribus layers 

Activities

cbradney

2004-08-24 12:36

administrator   ~0002202

Layers are in reverse order in the list. Makes sense to have them in the order they exist on the page.

2004-08-24 16:57

 

scribusview.cpp.diff (1,550 bytes)   
--- scribusview.cpp.orig	2004-08-24 01:45:47.000000000 +0200
+++ scribusview.cpp	2004-08-24 01:45:09.000000000 +0200
@@ -562,33 +562,43 @@
 void ScribusView::LaMenu()
 {
 	uint a;
-	int Lnr;
-	struct Layer ll;
-	ll.LNr = 0;
+	QValueList<Layer>::iterator it;
 	Laymen->clear();
 	if (Doc->Layers.count() != 0)
 	{
-		Lnr = 0;
-		for (a=0; a < Doc->Layers.count(); a++)
+        for (a=0; a < Doc->Layers.count(); a++)
 		{
-			Level2Layer(Doc, &ll, Lnr);
-			Laymen->insertItem(Doc->Layers[ll.LNr].Name);
-			if (Doc->ActiveLayer == static_cast<int>(ll.LNr))
-				Laymen->setItemChecked(Laymen->idAt(a), true);
-			Lnr++;
+			int curr,n=0;
+			for (it = Doc->Layers.begin(); it != Doc->Layers.end(); ++it,n++)
+			{
+				if (Doc->Layers.count()-(*it).Level-1 == a)
+				{
+					Laymen->insertItem((*it).Name);
+					if (Doc->ActiveLayer == n){
+						curr=Doc->Layers.count()-(*it).Level-1;
+					}
+				}
+			}
+			Laymen->setItemChecked(Laymen->idAt(curr), true);
 		}
 	}
 }
 
 void ScribusView::GotoLa(int l)
 {
-	int d = Laymen->indexOf(l);
-	struct Layer ll;
-	ll.LNr = 0;
-	Level2Layer(Doc, &ll, d);
-	Doc->ActiveLayer = ll.LNr;
-	LY->setText(Doc->Layers[ll.LNr].Name);
-	emit changeLA(ll.LNr);
+	int a=0;
+	int d = Doc->Layers.count()-Laymen->indexOf(l)-1;
+	QValueList<Layer>::iterator it;
+	for (it = Doc->Layers.begin(); it != Doc->Layers.end(); ++it,a++)
+	{
+		if ( d == (*it).Level )
+		{
+			Doc->ActiveLayer = a;
+			LY->setText(Doc->Layers[a].Name);
+			emit changeLA(a);
+			break;
+		}
+	}
 }
 
 void ScribusView::GotoPa(int Seite)
scribusview.cpp.diff (1,550 bytes)   

fredd

2004-08-24 17:00

reporter   ~0002213

here is my patch, which has correct layer order.
Please note I started it before the patch for this bug appeared, so it does not use Level2Layer.
However, here it works.

cbradney

2004-08-24 22:31

administrator   ~0002220

Tested. Fixed.

Issue History

Date Modified Username Field Change
2004-08-23 19:16 jo-hannes New Issue
2004-08-23 21:46 fschmid Status new => resolved
2004-08-23 21:46 fschmid Resolution open => fixed
2004-08-23 21:46 fschmid Assigned To => fschmid
2004-08-24 12:36 cbradney Status resolved => feedback
2004-08-24 12:36 cbradney Resolution fixed => reopened
2004-08-24 12:36 cbradney Note Added: 0002202
2004-08-24 12:36 cbradney Relationship added has duplicate 0000994
2004-08-24 16:57 fredd File Added: scribusview.cpp.diff
2004-08-24 17:00 fredd Note Added: 0002213
2004-08-24 21:40 fschmid Status feedback => resolved
2004-08-24 21:40 fschmid Resolution reopened => fixed
2004-08-24 22:31 cbradney Status resolved => closed
2004-08-24 22:31 cbradney Note Added: 0002220
2006-05-18 23:10 christoph_s Relationship added child of 0003838