View Issue Details

IDProjectCategoryView StatusLast Update
0011285ScribusScripterpublic2019-12-08 21:24
Reportervasco Assigned Toale  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version1.4.1 
Target Version1.5.4 
Summary0011285: [PATCH] duplicateObject does not return name of new create object
DescriptionduplicateObject does not return name of the new object. Retrieving this name requires some guessing. It would be nice if the name of the new object could be choosen.

Ideas:
duplicateObject('Old object', newName='New object name')

Or
newname = duplicateObject('Old object')
TagsNo tags attached.
PatchYes

Activities

ale

2019-11-22 16:04

manager   ~0047115

the docstring was already hinting at a string being returned...
scripter-duplicate-object.diff (557 bytes)   
diff --git a/scribus/plugins/scriptplugin/cmdobj.cpp b/scribus/plugins/scriptplugin/cmdobj.cpp
index 61c14baa9..d3cf9952e 100644
--- a/scribus/plugins/scriptplugin/cmdobj.cpp
+++ b/scribus/plugins/scriptplugin/cmdobj.cpp
@@ -849,7 +849,7 @@ PyObject *scribus_duplicateobject(PyObject * /* self */, PyObject *args)
 	currentWin->slotEditCopy();
 	currentWin->slotEditPaste();
 
-	Py_RETURN_NONE;
+	return PyUnicode_FromString(currentDoc->m_Selection->itemAt(0)->itemName().toUtf8());
 }
 
 PyObject *scribus_copyobject(PyObject * /* self */, PyObject *args)

Issue History

Date Modified Username Field Change
2012-12-23 09:15 vasco New Issue
2012-12-24 05:47 christoph_s Assigned To => jainbasil
2012-12-24 05:47 christoph_s Status new => assigned
2012-12-24 05:47 christoph_s Target Version => 1.5.1
2016-01-23 17:17 cbradney Target Version 1.5.1 => 1.5.3
2016-12-08 22:04 Kunda Target Version 1.5.3 => 1.5.4
2019-11-22 16:04 ale File Added: scripter-duplicate-object.diff
2019-11-22 16:04 ale Note Added: 0047115
2019-11-22 16:04 ale Summary duplicateObject does not return name of new create object => [PATCH] duplicateObject does not return name of new create object
2019-11-22 16:04 ale Patch => Yes
2019-11-23 22:11 cbradney Assigned To jainbasil => ale
2019-11-23 22:11 cbradney Status assigned => resolved
2019-11-23 22:11 cbradney Resolution open => fixed
2019-12-08 21:24 cbradney Status resolved => closed