diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2015-12-07 20:18:04 +0000 |
|---|---|---|
| committer | Kris De Gussem <Kris.De.Gussem@hotmail.com> | 2015-12-07 20:18:04 +0000 |
| commit | ddc6177836028eca89fb701ad2e5e923cb94ae87 (patch) | |
| tree | 8afb813154662cbe687e0396ae3483abfed6dc29 /src/widgets/toolbox.cpp | |
| parent | Set minimum line height to "strut" height per CSS. Prevent possible infinite ... (diff) | |
| download | inkscape-ddc6177836028eca89fb701ad2e5e923cb94ae87.tar.gz inkscape-ddc6177836028eca89fb701ad2e5e923cb94ae87.zip | |
static code analysis
(bzr r14508)
Diffstat (limited to 'src/widgets/toolbox.cpp')
| -rw-r--r-- | src/widgets/toolbox.cpp | 18 |
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) { |
