View Issue Details

IDProjectCategoryView StatusLast Update
0017794ScribusText Frames / Story Editorpublic2026-04-12 14:31
Reporterale Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version1.7.3.svn 
Summary0017794: "Multiple duplicate and chain text" processes "invisible" text
Description- Create a 20 pages document
- Load a big text file into a new full page text frame on the first page
- Multiple duplicate the text frame 10 times on the next pages, while creating a text chain.
- Wait for a long time.

Scribus theoretically has not much work to do, but it seems to do lot of processing work to process text that is not been shown (it takes several minutes on Frankestein from the Project Gutenberg)
TagsNo tags attached.
PatchNo

Relationships

related to 0017793 new "Unlink text and cut text" processes "invisible" text 

Activities

ale

2026-04-11 13:45

manager   ~0053604

"Manually" creating new chained text frames of the same size in the same document on the same pages is snappy.

cbradney

2026-04-11 17:02

administrator   ~0053607

17794.diff (2,875 bytes)   
Index: scribus/scribusdoc.cpp
===================================================================
--- scribus/scribusdoc.cpp	(revision 27510)
+++ scribus/scribusdoc.cpp	(working copy)
@@ -14159,7 +14159,6 @@
 	int currPageNumber = currentPageNumber();
 	std::vector<int> pages;
 	QString pageRange;
-
 	if (!m_Selection->itemsAreOnSamePage())
 	{
 		int firstPage = Pages->count();
@@ -14207,7 +14206,8 @@
 	}
 	parsePagesString(pageRange, &pages, Pages->count());
 
-	if (dialogData.copyCount > 0 && dialogData.copyCount < pages.size()) {
+	if (dialogData.copyCount > 0 && dialogData.copyCount < pages.size())
+	{
 		pages.resize(dialogData.copyCount);
 		pages.shrink_to_fit();
 	}
@@ -14229,8 +14229,11 @@
 	}
 
 	ScPage* oldCurrentPage = currentPage();
+	ScPage* ocp = oldCurrentPage;
 	ScriXmlDoc xmlStream;
-	QString buffer = ScriXmlDoc::writeElem(this, &selection);
+	QString buffer;
+	if (!dialogData.pageLinkText)
+		buffer = ScriXmlDoc::writeElem(this, &selection);
 	for (const auto page: pages)
 	{
 		if (currPageNumber == page - 1)
@@ -14238,27 +14241,39 @@
 		ScPage* targetPage = Pages->at(page - 1);
 		setCurrentPage(targetPage);
 		int countBeforeInsert = Items->count();
-		xmlStream.readElem(buffer, this, currentPage()->xOffset(), currentPage()->yOffset(), false, true);
-		if (!lastInChain)
-			continue;
-		for (int i = countBeforeInsert; i < Items->count(); ++i)
+		if (!dialogData.pageLinkText)
 		{
-			PageItem* item = Items->at(i);
-			if (item->itemType() != PageItem::TextFrame)
+			xmlStream.readElem(buffer, this, currentPage()->xOffset(), currentPage()->yOffset(), false, true);
+			if (!lastInChain)
 				continue;
-			item->clearContents();
-			if (item->isInChain())
+			for (int i = countBeforeInsert; i < Items->count(); ++i)
 			{
-				lastInChain->link(item->firstInChain());
-				lastInChain = item->lastInChain();
+				PageItem* item = Items->at(i);
+				if (item->itemType() != PageItem::TextFrame)
+					continue;
+				item->clearContents();
+				if (item->isInChain())
+				{
+					lastInChain->link(item->firstInChain());
+					lastInChain = item->lastInChain();
+				}
+				else
+				{
+					lastInChain->link(item);
+					lastInChain = item;
+				}
+				break;
 			}
-			else
-			{
-				lastInChain->link(item);
-				lastInChain = item;
-			}
-			break;
 		}
+		else
+		{
+			int z = itemAdd(lastInChain->itemType(), PageItem::Unspecified, targetPage->xOffset() - ocp->xOffset() + lastInChain->xPos(), targetPage->yOffset() - ocp->yOffset() + lastInChain->yPos(), lastInChain->width(), lastInChain->height(), lastInChain->lineWidth(), CommonStrings::None, lastInChain->fillColor(), PageItem::StandardItem);
+			PageItem* currItem = Items->at(z);
+			currItem->setOwnerPage(currentPage()->pageNr());
+			lastInChain->link(currItem);
+			lastInChain = currItem;
+		}
+		ocp = targetPage;
 	}
 
 	setCurrentPage(oldCurrentPage);
17794.diff (2,875 bytes)   

cbradney

2026-04-11 17:26

administrator   ~0053608

Patch attached does not copy all properties, which would need to be done, however it is fast because it does no to/from XML conversion like the current code does

ale

2026-04-12 14:31

manager   ~0053610

I wonder if the best solution would be to use the current code add a function with a custom "pre-processing" for the case with the chaining:

- convert the string to xml
- remove the content from the xml
- convert back to a QString

It could be an additional function in ScriXmlDoc or in ScribusDoc.

Issue History

Date Modified Username Field Change
2026-04-11 13:09 ale New Issue
2026-04-11 13:10 ale Relationship added related to 0017793
2026-04-11 13:45 ale Note Added: 0053604
2026-04-11 17:02 cbradney File Deleted: 17794.diff
2026-04-11 17:02 cbradney Note Added: 0053607
2026-04-11 17:02 cbradney File Added: 17794.diff
2026-04-11 17:26 cbradney Note Added: 0053608
2026-04-12 14:31 ale Note Added: 0053610