View Issue Details

IDProjectCategoryView StatusLast Update
0012307ScribusUndo/Redopublic2026-09-01 11:19
ReporterFirasH Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Platformx86_64OSopenSUSEOS Version13.1
Product Version1.5.0svn 
Target Version1.5.5 
Summary0012307: Undo/Redo records useless entries for Marks
DescriptionUndo/Redo records useless changes to Marks even if the user simply clicks "OK".
Steps To Reproduce0) Create a new document and make sure Windows > Action History is opened
1) Insert a Text Frame + some Sample Text
2) Double-click on the Text Frame so that you can edit it
3) Go to Insert > Marks > Anchor Mark/Reference to Mark/Reference to Item/Variable Text, add a Label and click "OK"
4) Open: Edit > Marks...
5) Select one of the Marks added in step 3 and click "Edit"
6) Do not apply any changes, just click "OK"

A new entry is added to "Action History"
Additional InformationScribus 1.5.0 SVN (19120)
Tags#please_test
Patch

Relationships

child of 0012496 acknowledged Metabug: Marks & Footnotes & Weld (1.5.0.svn) 
child of 0012500 acknowledged Metabug: Undo/Redo (1.5.x.svn) 

Activities

qirat

2026-09-01 11:12

reporter   ~0054392

#Cause:
`ScribusMainWindow::editMarkDlg()` submits an undo state after an accepted dialog without first verifying that mark data changed. The Reference-to-Mark path also compares the target against a fresh `MarkData` object instead of the original captured state.

#Fix:
The patch only submits the undo state when a real mark change is detected, and corrects Reference-to-Mark comparison to use `oldData`. This also avoids the false document-changed/update path for unchanged edits.
marks-edit-noop-undo-v1.0.patch (1,227 bytes)   
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 27810)
+++ scribus/scribus.cpp	(working copy)
@@ -9971,7 +9971,7 @@
 						label = tr("Mark to %1 mark").arg(markPtr->label);
 					QString destLabel = markPtr->label;
 					MarkType destType = markPtr->getType();
-					if (markData.destMarkName != destLabel || markData.destMarkType != destType)
+					if (oldData.destMarkName != destLabel || oldData.destMarkType != destType)
 					{
 						mrk->setDestMark(markPtr);
 						mrk->setString(doc->getSectionPageNumberForPageIndex(markPtr->OwnPage));
@@ -10001,7 +10001,14 @@
 			default:
 				break;
 		}
-		if (UndoManager::undoEnabled())
+
+		bool markChanged = newMark || replaceMark || mrk->label != oldLabel || mrk->getString() != oldData.text;
+		if (mrk->isType(MARK2MarkType))
+			markChanged = markChanged || mrk->getDestMarkName() != oldData.destMarkName || mrk->getDestMarkType() != oldData.destMarkType;
+		else if (mrk->isType(MARK2ItemType))
+			markChanged = markChanged || mrk->getItemPtr() != oldData.itemPtr;
+
+		if (UndoManager::undoEnabled() && markChanged)
 		{
 			ScItemsState* is = nullptr;
 			if (newMark || replaceMark)

Issue History

Date Modified Username Field Change
2014-05-14 13:44 FirasH New Issue
2014-07-08 18:14 FirasH Relationship added child of 0012496
2014-07-09 01:20 FirasH Relationship added child of 0012500
2014-08-08 04:28 Kunda Target Version => 1.5.1
2014-08-31 21:35 Kunda Status new => confirmed
2015-11-29 13:55 Kunda Target Version 1.5.1 => 1.5.2
2016-01-23 17:14 cbradney Target Version 1.5.2 => 1.5.3
2016-01-23 17:15 cbradney Target Version 1.5.3 => 1.5.4.svn
2016-05-15 23:09 Kunda Target Version 1.5.4.svn => 1.5.5
2026-09-01 11:12 qirat Note Added: 0054392
2026-09-01 11:12 qirat File Added: marks-edit-noop-undo-v1.0.patch
2026-09-01 11:19 qirat Tag Attached: #please_test