"Clean up document" counts as a 'modification' even when nothing happens under special case
Migrated from: https://bugs.launchpad.net/inkscape/+bug/1405935
Steps to reproduce:
- Start with a fresh preferences file.
- Start Inkscape.
- Load ANY saved SVG file on your hard drive that you know for sure has no unused 'defs'. Take drawing.svg as an example
- File > Clean up document
- Notice status bar says 'No unused definitions in < defs >' and undo history shows no change
- Now 'File > Save As' and save the file (to another location, or overwrite the same file, or to another name)
- Repeat Step 4
What happened?
On the second Clean up Document, the Clean Up Document is added to the undo history.
Going back in the undo history and resaving shows no difference in a diff.
Comparing the documents from saving after each Clean Up Document call shows no difference in a diff.
Comparing any of those documents to the original shows that every tag has its attributes in reverse order in 1.0beta2. This is not the case in 0.92.3 so is irrelevant to the issue.
Terminal output from undoing (note: no text objects in file):
** (inkscape:12683): WARNING **: 18:26:24.013: Incomplete undo transaction:
** (inkscape:12683): WARNING **: 18:26:24.014: Event: Set content of #<Text:0x0x559cc1024fd8> to ""
Note, if possible this reversal should not occur. However, even though it does, it'd be rather surprising that it affects the undo history.
What should have happened?
Clean up document only gets added if it changes the document.
Inkscape Version and Operating System:
- Inkscape 1.1-dev (8f6677a404, 2020-01-09) Linux Mint 19.1
- Inkscape 0.92.3 ppa Linux Mint 19.1
- Windows XP, Inkscape trunk rev. 13828. (2014)
- Inkscape 0.91pre3 r13670 (win64) Windows 7
- Inkscape 0.48.5 r10040 (win32) Windows 7 x64 Windows 7 x64 SP1