summaryrefslogtreecommitdiffstats
path: root/src/widgets/toolbox.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2015-12-07 23:45:01 +0000
committerMarc Jeanmougin <marcjeanmougin@free.fr>2015-12-07 23:45:01 +0000
commita0bef55aef1f82f56535cfadf30247657ccc3f90 (patch)
treea5523d84140303998f86072c6263e16af6d5d15e /src/widgets/toolbox.cpp
parentcppification : GHashMaps replaced by stl maps. getResouceList now gives a std... (diff)
parentstatic code analysis (diff)
downloadinkscape-a0bef55aef1f82f56535cfadf30247657ccc3f90.tar.gz
inkscape-a0bef55aef1f82f56535cfadf30247657ccc3f90.zip
update to trunk
(bzr r14504.1.7)
Diffstat (limited to 'src/widgets/toolbox.cpp')
-rw-r--r--src/widgets/toolbox.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index c3f301c52..b75cdb4be 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -943,8 +943,12 @@ static Glib::RefPtr<Gtk::ActionGroup> create_or_fetch_actions( SPDesktop* deskto
};
Inkscape::IconSize toolboxSize = ToolboxFactory::prefToSize("/toolbox/small");
-
Glib::RefPtr<Gtk::ActionGroup> mainActions;
+ if (desktop == NULL)
+ {
+ return mainActions;
+ }
+
if ( groups.find(desktop) != groups.end() ) {
mainActions = groups[desktop];
}
@@ -952,10 +956,7 @@ static Glib::RefPtr<Gtk::ActionGroup> create_or_fetch_actions( SPDesktop* deskto
if ( !mainActions ) {
mainActions = Gtk::ActionGroup::create("main");
groups[desktop] = mainActions;
- if (desktop)
- {
- desktop->connectDestroy(&desktopDestructHandler);
- }
+ desktop->connectDestroy(&desktopDestructHandler);
}
for ( guint i = 0; i < G_N_ELEMENTS(verbsToUse); i++ ) {
@@ -1558,13 +1559,12 @@ static void toggle_snap_callback(GtkToggleAction *act, gpointer data) //data poi
SPDesktop *dt = reinterpret_cast<SPDesktop*>(ptr);
SPNamedView *nv = dt->getNamedView();
- SPDocument *doc = nv->document;
-
- if (dt == NULL || nv == NULL) {
- g_warning("No desktop or namedview specified (in toggle_snap_callback)!");
+ if (nv == NULL) {
+ g_warning("No namedview specified (in toggle_snap_callback)!");
return;
}
+ SPDocument *doc = nv->document;
Inkscape::XML::Node *repr = nv->getRepr();
if (repr == NULL) {