From 58b0e69b7336a8a06c447cf786f73df903120e53 Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Sun, 11 Mar 2007 19:57:07 +0000 Subject: Switch selection bounds and center to use NR::Maybe, addressing most of the recent bbox regressions. (bzr r2604) --- src/file.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/file.cpp') diff --git a/src/file.cpp b/src/file.cpp index f4630719b..c1d035545 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -834,8 +834,11 @@ file_import(SPDocument *in_doc, const Glib::ustring &uri, int const saved_pref = prefs_get_int_attribute("options.transform", "pattern", 1); prefs_set_int_attribute("options.transform", "pattern", 1); sp_document_ensure_up_to_date(sp_desktop_document(desktop)); - NR::Point m( desktop->point() - selection->bounds().midpoint() ); - sp_selection_move_relative(selection, m); + NR::Maybe sel_bbox = selection->bounds(); + if (sel_bbox) { + NR::Point m( desktop->point() - sel_bbox->midpoint() ); + sp_selection_move_relative(selection, m); + } prefs_set_int_attribute("options.transform", "pattern", saved_pref); } } -- cgit v1.2.3