summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/document-properties.cpp
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-11-24 03:07:36 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-11-24 03:07:36 +0000
commitf12a73dd77175bd6126319f3a698eb16193e7b68 (patch)
treeb5a59803e5bd212f0e355faa029295aa79d47a0e /src/ui/dialog/document-properties.cpp
parentUpdate to trunk r13690 (diff)
parentExtensions: try to calculate the SVG unit (diff)
downloadinkscape-f12a73dd77175bd6126319f3a698eb16193e7b68.tar.gz
inkscape-f12a73dd77175bd6126319f3a698eb16193e7b68.zip
Update to trunk r13750
(bzr r13341.5.23)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
-rw-r--r--src/ui/dialog/document-properties.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 93e5eb51b..084a1e98d 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -114,7 +114,7 @@ DocumentProperties::DocumentProperties()
_rcb_shad(_("_Show border shadow"), _("If set, page border shows a shadow on its right and lower side"), "inkscape:showpageshadow", _wr, false),
_rcp_bg(_("Back_ground color:"), _("Background color"), _("Color of the page background. Note: transparency setting ignored while editing but used when exporting to bitmap."), "pagecolor", "inkscape:pageopacity", _wr),
_rcp_bord(_("Border _color:"), _("Page border color"), _("Color of the page border"), "bordercolor", "borderopacity", _wr),
- _rum_deflt(_("Default _units:"), "inkscape:document-units", _wr),
+ _rum_deflt(_("Display _units:"), "inkscape:document-units", _wr),
_page_sizer(_wr),
//---------------------------------------------------------------
//General snap options
@@ -1205,10 +1205,10 @@ void DocumentProperties::removeExternalScript(){
const GSList *current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
while ( current ) {
- if (current->data && SP_IS_OBJECT(current->data)) {
- SPObject* obj = SP_OBJECT(current->data);
- SPScript* script = SP_SCRIPT(obj);
- if (name == script->xlinkhref){
+ SPObject* obj = reinterpret_cast<SPObject *>(current->data);
+ if (obj) {
+ SPScript* script = dynamic_cast<SPScript *>(obj);
+ if (script && (name == script->xlinkhref)) {
//XML Tree being used directly here while it shouldn't be.
Inkscape::XML::Node *repr = obj->getRepr();
@@ -1354,10 +1354,15 @@ void DocumentProperties::populate_script_lists(){
_ExternalScriptsListStore->clear();
_EmbeddedScriptsListStore->clear();
const GSList *current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
- if (current) _scripts_observer.set(SP_OBJECT(current->data)->parent);
+ if (current) {
+ SPObject *obj = reinterpret_cast<SPObject *>(current->data);
+ g_assert(obj != NULL);
+ _scripts_observer.set(obj->parent);
+ }
while ( current ) {
- SPObject* obj = SP_OBJECT(current->data);
- SPScript* script = SP_SCRIPT(obj);
+ SPObject* obj = reinterpret_cast<SPObject *>(current->data);
+ SPScript* script = dynamic_cast<SPScript *>(obj);
+ g_assert(script != NULL);
if (script->xlinkhref)
{
Gtk::TreeModel::Row row = *(_ExternalScriptsListStore->append());
@@ -1703,7 +1708,10 @@ void DocumentProperties::onDocUnitChange()
Inkscape::SVGOStringStream os;
os << doc_unit->abbr;
repr->setAttribute("inkscape:document-units", os.str().c_str());
-
+
+ // Disable changing of SVG Units. The intent here is to change the units in the UI, not the units in SVG.
+ // This code should be moved (and fixed) once we have an "SVG Units" setting that sets what units are used in SVG data.
+#if 0
// Set viewBox
if (doc->getRoot()->viewBox_set) {
gdouble scale = Inkscape::Util::Quantity::convert(1, old_doc_unit, doc_unit);
@@ -1755,10 +1763,11 @@ void DocumentProperties::onDocUnitChange()
prefs->setBool("/options/transform/rectcorners", transform_rectcorners);
prefs->setBool("/options/transform/pattern", transform_pattern);
prefs->setBool("/options/transform/gradient", transform_gradient);
+#endif
doc->setModifiedSinceSave();
- DocumentUndo::done(doc, SP_VERB_NONE, _("Changed document unit"));
+ DocumentUndo::done(doc, SP_VERB_NONE, _("Changed default display unit"));
}
} // namespace Dialog