From: buliabyak Date: Sun, 25 Oct 2009 02:48:06 +0000 (+0000) Subject: remove registerEditWidget, move this to SPDesktop::init instead; a noop change but... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=905fbb5efba993402ccbb533733255e6466fa86d;p=inkscape.git remove registerEditWidget, move this to SPDesktop::init instead; a noop change but fixes a weird crash on Windows --- diff --git a/src/desktop.cpp b/src/desktop.cpp index f7ef1a8cd..319a0d407 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -164,8 +164,10 @@ SPDesktop::SPDesktop() : } void -SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas) +SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas, Inkscape::UI::View::EditWidgetInterface *widget) { + _widget = widget; + // Temporary workaround for link order issues: Inkscape::DeviceManager::getManager().getDevices(); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); diff --git a/src/desktop.h b/src/desktop.h index 4438c90e5..cfb977425 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -180,7 +180,7 @@ struct SPDesktop : public Inkscape::UI::View::View #endif SPDesktop(); - void init (SPNamedView* nv, SPCanvas* canvas); + void init (SPNamedView* nv, SPCanvas* canvas, Inkscape::UI::View::EditWidgetInterface *widget); virtual ~SPDesktop(); void destroy(); @@ -303,9 +303,6 @@ struct SPDesktop : public Inkscape::UI::View::View void fullscreen(); void focusMode(bool mode = true); - void registerEditWidget (Inkscape::UI::View::EditWidgetInterface *widget) - { _widget = widget; } - Geom::Matrix w2d() const; //transformation from window to desktop coordinates (used for zooming) Geom::Point w2d(Geom::Point const &p) const; Geom::Point d2w(Geom::Point const &p) const; diff --git a/src/ui/view/edit-widget.cpp b/src/ui/view/edit-widget.cpp index 1d319f97f..770a9bf87 100644 --- a/src/ui/view/edit-widget.cpp +++ b/src/ui/view/edit-widget.cpp @@ -1551,11 +1551,10 @@ void EditWidget::initEdit (SPDocument *doc) { _desktop = new SPDesktop(); - _desktop->registerEditWidget (this); _namedview = sp_document_namedview (doc, 0); _svg_canvas.init (_desktop); - _desktop->init (_namedview, _svg_canvas.spobj()); + _desktop->init (_namedview, _svg_canvas.spobj(), this); sp_namedview_window_from_document (_desktop); sp_namedview_update_layers_from_document (_desktop); _dt2r = 1.0 / _namedview->doc_units->unittobase; diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 5fd32487f..e3bf1ae9c 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -1339,8 +1339,7 @@ sp_desktop_widget_new (SPNamedView *namedview) dtw->desktop = new SPDesktop(); dtw->stub = new SPDesktopWidget::WidgetStub (dtw); - dtw->desktop->registerEditWidget (dtw->stub); - dtw->desktop->init (namedview, dtw->canvas); + dtw->desktop->init (namedview, dtw->canvas, dtw->stub); inkscape_add_desktop (dtw->desktop); // Add the shape geometry to libavoid for autorouting connectors.