View Issue Details

IDProjectCategoryView StatusLast Update
0015960ScribusGeneralpublic2020-09-03 19:35
Reporterale Assigned To 
Status newResolutionopen 
Product Version1.5.6.svn 
Target VersionFixed in Version 
Summary0015960: keep the name of items when importing pages
Descriptionwhen importing pages from other documents, scirbus should try to keep the same item names..
TagsNo tags attached.



2019-11-25 16:31

manager   ~0047133

following the path between the point where the command is given to import a page and the point where the new item is created (with a new name...) gives little chances that the behavior can be changed...

- bool ScribusMainWindow::slotPageImport()
  - loadPage(dia->getFromDoc(), pageNs[0] - 1, false);
- bool ScribusMainWindow::loadPage(const QString& fileName, int Nr, bool Mpa, const QString& renamedPageName)
  - if (!fl->loadPage(doc, Nr, Mpa, renamedPageName))
- bool FileFormat::loadPage(const QString & fileName, int pageNumber, bool Mpage, const QString& renamedPageName) const
  - bool success = plug->loadPage(fileName, pageNumber, Mpage, renamedPageName);
- Scribus150Format::loadPage()
  - success = readObject(m_Doc, reader, itemInfo, fileDir, true, masterPageName);
- bool Scribus150Format::readObject(ScribusDoc* doc, ScXmlStreamReader& reader, ItemInfo& info, const QString& baseDir, bool loadPage, const QString& renamedPageName)
  - PageItem* newItem = pasteItem(doc, attrs, baseDir, itemKind, pagenr);
- PageItem* Scribus150Format::pasteItem(ScribusDoc *doc, ScXmlStreamAttributes& attrs, const QString& baseDir, PageItem::ItemKind itemKind, int pagenr)
  - z = doc->itemAdd(pt, PageItem::Unspecified, x, y, w, h, 1, doc->itemToolPrefs().imageFillColor, doc->itemToolPrefs().imageStrokeColor, itemKind);
- int ScribusDoc::itemAdd(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, double x, double y, double b, double h, double w, const QString& fill, const QString& outline, PageItem::ItemKind itemKind)
  - newItem = createPageItem(itemType, frameType, x, y, b, h, w, fill, outline);
- PageItem* ScribusDoc::createPageItem(const PageItem::ItemType itemType, const PageItem::ItemFrameType frameType, double x, double y, double b, double h, double w, const QString& fill, const QString& outline)
  - newItem = new PageItem_TextFrame(this, x, y, b, h, w, CommonStrings::None, outline);
- PageItem::PageItem(ScribusDoc *pa, ItemType newType, double x, double y, double w, double h, double w2, const QString& fill, const QString& outline)
  - int nameNum = m_Doc->TotalItems;
    m_itemName += tmp.setNum(m_Doc->TotalItems);


2019-11-25 16:45

manager   ~0047134

the main question: when duplicating / copy pasting an item, do we want to get a new number or the "current item (2)"?

for scripting, the question is only partially relevant (we can always find out what the name of the current / created item.

so, the main use case is when you import a page from a different document and you want the items to have a specific name (that you can use in your script)... or when you duplicate a page...
in such cases, with the current way of simply increasing the number, i don't see a way to know how the single items have been renamed...


2020-08-23 05:57

manager   ~0047993

the alternative is to build a list of (old names -> new names)...


2020-08-31 21:10

administrator   ~0048002

Where do we lose the name to begin with?


2020-09-03 19:35

manager   ~0048027

here are my notes

but it's been a long time and i don't know the details anymore.

if i recall correctly, it's about being able to collect all frames that contain fields to be merged and then use that list for each set of pages.

iirc, the main aim of this request is that if the name of the item does not clash with the new document, the original name should be used.

Issue History

Date Modified Username Field Change
2019-11-22 22:48 ale New Issue
2019-11-25 16:31 ale Note Added: 0047133
2019-11-25 16:45 ale Note Added: 0047134
2020-08-23 05:57 ale Note Added: 0047993
2020-08-31 21:10 cbradney Note Added: 0048002
2020-09-03 19:35 ale Note Added: 0048027