diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-07-17 04:48:43 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-07-17 04:48:43 +0000 |
| commit | c99f5b02fce8b98463d7868c61bc77f8bf675665 (patch) | |
| tree | 9bd139839f3451596dd0f4ad3fe85c21a889cea3 /src | |
| parent | Added copyright header and name to AUTHORS. (diff) | |
| download | inkscape-c99f5b02fce8b98463d7868c61bc77f8bf675665.tar.gz inkscape-c99f5b02fce8b98463d7868c61bc77f8bf675665.zip | |
Fixed memory corruption introduced in a previous commit.
(bzr r12380.1.14)
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp-namedview.cpp | 6 | ||||
| -rw-r--r-- | src/widgets/desktop-widget.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index c7301f9bd..0833d93bf 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -552,11 +552,11 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va * doc_units. */ static Inkscape::Util::Unit px = unit_table.getUnit("px"); - Inkscape::Util::Unit const *new_unit = &px; + Inkscape::Util::Unit const *new_unit = new Inkscape::Util::Unit(px); if (value) { Inkscape::Util::Unit u = unit_table.getUnit(value); - Inkscape::Util::Unit const *const req_unit = &u; + Inkscape::Util::Unit const *const req_unit = new Inkscape::Util::Unit(u); if ( !unit_table.hasUnit(value) ) { g_warning("Unrecognized unit `%s'", value); /* fixme: Document errors should be reported in the status bar or @@ -580,7 +580,7 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va if (value) { Inkscape::Util::Unit u = unit_table.getUnit(value); - Inkscape::Util::Unit const *const req_unit = &u; + Inkscape::Util::Unit const *const req_unit = new Inkscape::Util::Unit(u); if ( !unit_table.hasUnit(value) ) { g_warning("Unrecognized unit `%s'", value); /* fixme: Document errors should be reported in the status bar or diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 57f655033..f1e4458ff 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -1672,7 +1672,7 @@ SPDesktopWidget* SPDesktopWidget::createInstance(SPNamedView *namedview) { SPDesktopWidget *dtw = static_cast<SPDesktopWidget*>(g_object_new(SP_TYPE_DESKTOP_WIDGET, NULL)); - dtw->dt2r = namedview->doc_units.factor; + dtw->dt2r = namedview->doc_units->factor; dtw->ruler_origin = Geom::Point(0,0); //namedview->gridorigin; Why was the grid origin used here? @@ -1744,7 +1744,7 @@ void SPDesktopWidget::namedviewModified(SPObject *obj, guint flags) SPNamedView *nv=SP_NAMEDVIEW(obj); if (flags & SP_OBJECT_MODIFIED_FLAG) { - this->dt2r = nv->doc_units.factor; + this->dt2r = nv->doc_units->factor; this->ruler_origin = Geom::Point(0,0); //nv->gridorigin; Why was the grid origin used here? sp_ruler_set_unit(SP_RULER (this->vruler), nv->getDefaultMetric()); |
