New blank document after closing last window doesn't set current layer from template
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Fix Released
|
Medium
|
su_v |
Bug Description
Follow-up report to
Bug #170550 (sf1106380) “open blank document on 'close'”
With current trunk (>= r11632) a blank document based on the default template is opened when closing the last window. Unlike with 'File > New', this blank document window does not set the current layer according to the setting stored in <namedview> of the default template. The current drawing level (as indicated in the layer selector widget in the status bar) instead is set outside the layer structure ('root').
Steps to reproduce:
1) mv ~/.config/
2) launch inkscape (empty)
3) verify that current drawing level is "Layer 1" (as defined in the default template)
4) close window (Ctrl+W)
(-> a new blank document is opened, reusing the current window)
Expected result:
In the new blank document, the current drawing level is also "Layer 1", as defined in the default template.
Actual result:
In the new blank document, the current drawing level is 'root' (top-level of the <svg> node).
Not reproduced with <= r11630, reproduced with r11632 and later revisions on OS X 10.7.4 (tested with GTK+/X11 2.24.10 and GTK+/Quartz 2.24.11 as well as with experimental GTK3 build. Locale ($LANG) is "en_US.UTF-8").
Works as expected (or at least as I expect it - 'root' as initial current layer IMHO is a major usability problem) with e.g. such a change:
$ bzr diff src/interface.cpp :createNewDoc( templateUri.c_str() , TRUE, true );
dt->change_ document( doc);
sp_namedview_ window_ from_document( dt); update_ layers_ from_document( dt);
=== modified file 'src/interface.cpp'
--- src/interface.cpp 2012-09-02 04:24:45 +0000
+++ src/interface.cpp 2012-09-19 20:06:40 +0000
@@ -322,6 +322,7 @@
SPDocument *doc = SPDocument:
+ sp_namedview_
return;
}