diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-04-23 15:47:27 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-04-23 15:47:27 +0000 |
| commit | ca593f6435ef88a2b3f2b13c6520b20802b79204 (patch) | |
| tree | dce13dc0929529e2f2a910f63be41add67322a07 /src/ui/dialog/export.cpp | |
| parent | Correct GTK+ 3 box syntax in toolbox (diff) | |
| download | inkscape-ca593f6435ef88a2b3f2b13c6520b20802b79204.tar.gz inkscape-ca593f6435ef88a2b3f2b13c6520b20802b79204.zip | |
Export: fix crash when removing last character in a selection (Bug #960980)
(bzr r11288)
Diffstat (limited to 'src/ui/dialog/export.cpp')
| -rw-r--r-- | src/ui/dialog/export.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index b2d71ef74..af5788ac6 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -456,8 +456,8 @@ Gtk::Adjustment * Export::createSpinbutton( gchar const * /*key*/, float val, fl } // end of createSpinbutton() -Glib::ustring Export::create_filepath_from_id (Glib::ustring id, const Glib::ustring &file_entry_text) { - +Glib::ustring Export::create_filepath_from_id (Glib::ustring id, const Glib::ustring &file_entry_text) +{ if (id.empty()) { /* This should never happen */ id = "bitmap"; @@ -573,6 +573,7 @@ void Export::onSelectionChanged() void Export::onSelectionModified ( guint /*flags*/ ) { + Inkscape::Selection * Sel; switch (current_key) { case SELECTION_DRAWING: if ( SP_ACTIVE_DESKTOP ) { @@ -588,12 +589,16 @@ void Export::onSelectionModified ( guint /*flags*/ ) } break; case SELECTION_SELECTION: - if ((sp_desktop_selection(SP_ACTIVE_DESKTOP))->isEmpty() == false) { - Geom::OptRect bbox = (sp_desktop_selection (SP_ACTIVE_DESKTOP))->visualBounds(); - setArea ( bbox->left(), + Sel = sp_desktop_selection(SP_ACTIVE_DESKTOP); + if (Sel->isEmpty() == false) { + Geom::OptRect bbox = Sel->visualBounds(); + if (bbox) + { + setArea ( bbox->left(), bbox->top(), bbox->right(), bbox->bottom()); + } } break; default: @@ -787,8 +792,11 @@ Gtk::Dialog * Export::create_progress_dialog (Glib::ustring progress_text) { prg->set_text(progress_text); prg->set_orientation(Gtk::PROGRESS_LEFT_TO_RIGHT); dlg->set_data ("progress", prg); +#if GTK_CHECK_VERSION(3,0,0) + Gtk::Box* CA = dlg->get_content_area(); +#else Gtk::Box* CA = dlg->get_vbox(); - //Gtk::Box* CA = dlg->get_content_area(); // hmmm, compile error when using the preferred function get_content_area +#endif CA->pack_start(*prg, FALSE, FALSE, 4); Gtk::Button* btn = dlg->add_button (Gtk::Stock::CANCEL,Gtk::RESPONSE_CANCEL ); |
