Closing unchanged SVG asks for saving

Bug #510618 reported by jazzynico on 2010-01-21
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Low
theAdib

Bug Description

Steps to reproduce:
1. Open a tutorial with Help>Tutorials.
2. Don't modify it ;)
3. Close it.

Inkscape asks "Save changes to document <tutorial name> before closing?".

Reproduced on Windows XP and Ubuntu 9.10, Inkscape bzr revision 9000.
Not reproduced on the same OS, Inkscape 0.47 and 0.47pre4.

The tutorial SVG files are exactly the same in r9000 as in 0.47.

Related branches

jazzynico (jazzynico) on 2010-01-21
tags: added: documentation tutorials
~suv (suv-lp) wrote :

confirmed on OS X 10.5.8:
not reproduced with Inkscape 0.47 r22583
reproduced with Inkscape 0.47+devel r9009

Changed in inkscape:
status: New → Confirmed
~suv (suv-lp) wrote :

Inkscape 0.47+devel r9009: After opening a tutorial SVG file from the menu the 'Undo History…' dialog shows these entries:

 [Unchanged]
 Change connector curvature

One has to use 'Edit > Undo' or the 'Undo' button on the commands bar to close the file without being ask to save the changes. I can't recall having seen this when opening other local (older) files or a new document from template.

~suv (suv-lp) wrote :

This issue is not related to the tutorials but most likely to the new connector tool:

Steps to reproduce:
1) start Inkscape 0.47+devel (empty)
2) open the attached SVG file via 'File > Open…' dialog
result: no entries in the undo history
3) quit Inkscape, launch it again (empty)
4) open the file from the 'File > Open Recent' list
result: no entries in the undo history
5) keep '510618-connectors.svg' opened and
6) open it a second time from the 'Open Recent' list
result: now you see the same entry in the undo list: 'Change connector curvature'

not reproduced with 0.47+devel r8853
reproduced with 0.47+devel r8865

It seems that a file using connectors gets an entry in the undo history if Inkscape 0.47+devel opens it in a new window. If Inkscape can re-use a current window (i.e. the window of a new unchanged file from template) no change is registered in the document undo history.

~suv (suv-lp) wrote :

oops, forgot to attach the file (created in Inkscape 0.46: three squares with connector lines)

jazzynico (jazzynico) on 2010-01-22
summary: - Closing tutorial asks for saving
+ Closing unchanged SVG asks for saving
tags: removed: documentation tutorials
jazzynico (jazzynico) wrote :

I confirm it is not related to tutos. (Now I don't know how to tag this report :))

But when using tutorials, I can reproduce the same bug when opening it with File>Open, even when it's the first opened document.

I've also scanned the affected files, and they have no connector related code.

The error message ("Change connector curvature") comes from connector_curvature_changed() in src/widgets/toolbox.cpp, line 7333.

jazzynico (jazzynico) on 2010-01-22
tags: added: regression
~suv (suv-lp) on 2010-03-31
tags: added: connectors undo
~suv (suv-lp) on 2010-05-13
tags: added: ui
removed: connectors
~suv (suv-lp) wrote :

in recent builds the entry in the 'Undo' history when opening a document in second (new) window is no longer related to the connector code but now (r9410) says

> Text: Change line-height

This bug seems to be triggered when the controls bars for the individual tools are created or packed for a new document window (src/widgets/toolbox.cpp) because I never see it when the opened document reuses the current window (of a new from template, unchanged document).

~suv (suv-lp) wrote :

The 'Undo' history entry comes from sp_text_lineheight_value_changed() in 'src/widgets/toolbox.cpp', line 6776 (r4912)
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/annotate/9412/src/widgets/toolbox.cpp#L6755>

The code was added in r9365
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/9365>

jazzynico (jazzynico) on 2010-08-19
Changed in inkscape:
milestone: 0.48 → 0.48.1
~suv (suv-lp) wrote :

Coincidence or consequence?

Opening the file 'TypicalASV.svg' [1] from bug #552289 as second file from within Inkscape renders all connector lines displaced and also shows the same entry in the Undo-history ("Text: Change line-height"). Using 'Undo' (Ctr+z, or commands bar button) once apparently triggers a recalculation of the connector lines and renders them correctly (as in 0.47).

[1] <https://bugs.launchpad.net/inkscape/+bug/552289/+attachment/1256201/+files/TypicalASV.svg>

~suv (suv-lp) wrote :

r9988 in trunk fixed bug #552289 mentioned in my previous comment - the 'Undo' entry issue (this bug #510618) however is not affected by that commit.

(tested with Inkscape 0.48+devel r9989 on OS X 10.5.8)

theAdib (theadib) wrote :

the toolbox functions are triggered on creation of the toolbox when creating a new window.

we have to check if the functions really change something and if there are elements selected.

the attached diff is against trunk. now revision 9991

Adib

Changed in inkscape:
assignee: nobody → theAdib (theadib)
status: Confirmed → Fix Committed
jazzynico (jazzynico) wrote :

Fix confirmed on Ubuntu 10.04. Many thanks!

~suv (suv-lp) wrote :

Fix confirmed with Inkscape 0.48+devel r9991 on OS X 10.5.8.
No regression noticed so far.

theAdib (theadib) wrote :

for the 0.48 as there is no c++-ification done the old undo syntax is used. So the first patch does not work on 0.48 line.
The attached patch works for an lp:inkscape/0.48.x checkout. bug510618-0.48.diff

Adib.

jazzynico (jazzynico) on 2011-03-05
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers