View Issue Details

IDProjectCategoryView StatusLast Update
0015889ScribusScripterpublic2019-11-09 10:30
Reporterale Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Product Version1.5.6.svn 
Target VersionFixed in Version 
Summary0015889: Scripter: allow insertText, loadImage & co to act on items in a group
Descriptionfrom the gui we can act on item that are part of a group... this should also be possible from a scripter.
TagsNo tags attached.
PatchNo

Activities

ale

2019-11-09 10:30

manager   ~0047043

i had a look at it but had stop...

attached a partial patch for later use.

scriter-group-items-partial.diff (1,082 bytes)
diff --git a/scribus/plugins/scriptplugin/cmdutil.cpp b/scribus/plugins/scriptplugin/cmdutil.cpp
index a78521a56..984110f8e 100644
--- a/scribus/plugins/scriptplugin/cmdutil.cpp
+++ b/scribus/plugins/scriptplugin/cmdutil.cpp
@@ -120,13 +120,23 @@ PageItem* getPageItemByName(const QString& name)
 	}
 	for (int i = 0; i<ScCore->primaryMainWindow()->doc->Items->count(); i++)
 	{
-		if (name==ScCore->primaryMainWindow()->doc->Items->at(i)->itemName())
-			return ScCore->primaryMainWindow()->doc->Items->at(i);
+		auto item = ScCore->primaryMainWindow()->doc->Items->at(i)
+		if (name == item->itemName())
+			return item;
+		else if (item->isGroup())
+			return getPageItemInGroupByName(static_cast<PageItem_Group*>(item), name)
 	} // for items
 	PyErr_SetString(NoValidObjectError, QString("Object not found").toLocal8Bit().constData());
 	return nullptr;
 }
 
+// private
+PageItem* getPageItemInGroupByName(PageItem_Group* item, const QString& name)
+{
+	// TODO: implement this
+	return nullptr;
+}
+
 
 /*!
  * Checks to see if a pageItem named 'name' exists and return true

Issue History

Date Modified Username Field Change
2019-10-30 13:35 ale New Issue
2019-11-09 10:30 ale File Added: scriter-group-items-partial.diff
2019-11-09 10:30 ale Note Added: 0047043