summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/document-properties.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-10-26 12:33:17 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-10-26 12:33:17 +0000
commit7caf32d2b22680c603e4e88c76739c758630412c (patch)
treedaaf4e77d712bd802076980d7a077dc6562f3df7 /src/ui/dialog/document-properties.cpp
parentRemoved BSpline from tell by su_v (diff)
parentFix memleak in reference counting introduced in r12532. (diff)
downloadinkscape-7caf32d2b22680c603e4e88c76739c758630412c.tar.gz
inkscape-7caf32d2b22680c603e4e88c76739c758630412c.zip
Update to trunk
(bzr r12588.1.24)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
-rw-r--r--src/ui/dialog/document-properties.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index a6019c55c..79fb953ac 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -173,7 +173,7 @@ DocumentProperties::DocumentProperties()
signalDocumentReplaced().connect(sigc::mem_fun(*this, &DocumentProperties::_handleDocumentReplaced));
signalActivateDesktop().connect(sigc::mem_fun(*this, &DocumentProperties::_handleActivateDesktop));
signalDeactiveDesktop().connect(sigc::mem_fun(*this, &DocumentProperties::_handleDeactivateDesktop));
-
+
_rum_deflt._changed_connection.block();
_rum_deflt.getUnitMenu()->signal_changed().connect(sigc::mem_fun(*this, &DocumentProperties::onDocUnitChange));
}
@@ -1437,8 +1437,9 @@ void DocumentProperties::update()
_rcp_bord.setRgba32 (nv->bordercolor);
_rcb_shad.setActive (nv->showpageshadow);
- if (nv->doc_units)
+ if (nv->doc_units) {
_rum_deflt.setUnit (nv->doc_units->abbr);
+ }
double doc_w = sp_desktop_document(dt)->getRoot()->width.value;
Glib::ustring doc_w_unit = unit_table.getUnit(sp_desktop_document(dt)->getRoot()->width.unit)->abbr;
@@ -1643,18 +1644,23 @@ void DocumentProperties::onRemoveGrid()
void DocumentProperties::onDocUnitChange()
{
SPDocument *doc = SP_ACTIVE_DOCUMENT;
+ // Don't execute when change is being undone
+ if (!DocumentUndo::getUndoSensitive(doc)) {
+ return;
+ }
+ // Don't execute when initializing widgets
+ if (_wr.isUpdating()) {
+ return;
+ }
+
+
Inkscape::XML::Node *repr = sp_desktop_namedview(getDesktop())->getRepr();
Inkscape::Util::Unit const *old_doc_unit = unit_table.getUnit("px");
if(repr->attribute("inkscape:document-units")) {
old_doc_unit = unit_table.getUnit(repr->attribute("inkscape:document-units"));
}
Inkscape::Util::Unit const *doc_unit = _rum_deflt.getUnit();
-
- // Don't execute when change is being undone
- if (!DocumentUndo::getUndoSensitive(doc)) {
- return;
- }
-
+
// Set document unit
Inkscape::SVGOStringStream os;
os << doc_unit->abbr;