View Issue Details

IDProjectCategoryView StatusLast Update
0015132ScribusInternalpublic2018-02-06 08:05
Reporteru ltd. Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
Platformamd64OSalike debianOS Version9
Product Version1.5.4.svn 
Summary0015132: Ensure unique name when instantiating PageItem
DescriptionEnsure unique name when instantiating PageItem object.
Steps To ReproduceYou can create objects with duplicate name by following procedure
- Create an object, e. g. TextFrame -> Name is set to Text1 automatically
- Rename this object to Text2
- Create an same-type object -> New objects' name is set to Text2 automatically
Additional InformationPatch in plaintext:



Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp (Revision 22369)
+++ scribus/pageitem.cpp (Arbeitskopie)
@@ -612,8 +612,9 @@
         AnName = "Item";
         break;
     }
+ AnName = generateUniqueCopyName(AnName, false);
     m_Doc->TotalItems++;
- AnName += tmp.setNum(m_Doc->TotalItems); // +" "+QDateTime::currentDateTime().toString();
+ //AnName += tmp.setNum(m_Doc->TotalItems); // +" "+QDateTime::currentDateTime().toString();
     uniqueNr = m_Doc->TotalItems;
     AutoName = true;
     setUName(AnName);
TagsNo tags attached.
PatchYes

Relationships

duplicate of 0011926 closedjghali It’s possible to create various objects with the same name 

Activities

u ltd.

2018-02-06 07:41

reporter  

scribus-20180205-095552-jonas-uniquename.patch (562 bytes)   
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp	(Revision 22369)
+++ scribus/pageitem.cpp	(Arbeitskopie)
@@ -612,8 +612,9 @@
 		AnName = "Item";
 		break;
 	}
+	AnName = generateUniqueCopyName(AnName, false);
 	m_Doc->TotalItems++;
-	AnName += tmp.setNum(m_Doc->TotalItems); // +" "+QDateTime::currentDateTime().toString();
+	//AnName += tmp.setNum(m_Doc->TotalItems); // +" "+QDateTime::currentDateTime().toString();
 	uniqueNr = m_Doc->TotalItems;
 	AutoName = true;
 	setUName(AnName);

jghali

2018-02-06 08:05

administrator   ~0044926

Duplicate of 0011926. 0011926 patch is simpler and hence has my preference.

Issue History

Date Modified Username Field Change
2018-02-06 07:41 u ltd. New Issue
2018-02-06 07:41 u ltd. File Added: scribus-20180205-095552-jonas-uniquename.patch
2018-02-06 08:05 jghali Assigned To => jghali
2018-02-06 08:05 jghali Status new => resolved
2018-02-06 08:05 jghali Resolution open => duplicate
2018-02-06 08:05 jghali Note Added: 0044926
2018-02-06 08:05 jghali Relationship added duplicate of 0011926
2018-02-06 08:05 jghali Status resolved => closed