Code

remove registerEditWidget, move this to SPDesktop::init instead; a noop change but...
authorbuliabyak <buliabyak@users.sourceforge.net>
Sun, 25 Oct 2009 02:48:06 +0000 (02:48 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sun, 25 Oct 2009 02:48:06 +0000 (02:48 +0000)
src/desktop.cpp
src/desktop.h
src/ui/view/edit-widget.cpp
src/widgets/desktop-widget.cpp

index f7ef1a8cdb79c6d9a02d6a6aef7be6aaf58c5906..319a0d407e35d252e31d96fc97f3c05e8f45ac62 100644 (file)
@@ -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();
index 4438c90e56afc830fc600aca1cfbec2a9b173baf..cfb977425318cdb4ccb371a265dd09055572eae6 100644 (file)
@@ -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;
index 1d319f97ff7e64c60971c875cf770ca287ffea42..770a9bf87c076472040c5f5c39a0400e106d4f12 100644 (file)
@@ -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;
index 5fd32487f2e375091aa2f85e203eb1e3ca65bc46..e3bf1ae9c5efecb60323a6052b7f4e1f4760d246 100644 (file)
@@ -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.