summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b6bc15a)
raw | patch | inline | side by side (parent: b6bc15a)
author | joncruz <joncruz@users.sourceforge.net> | |
Sun, 14 Sep 2008 04:59:18 +0000 (04:59 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Sun, 14 Sep 2008 04:59:18 +0000 (04:59 +0000) |
src/main.cpp | patch | blob | history |
diff --git a/src/main.cpp b/src/main.cpp
index da1d812c3876f6193cca5a4af2b9306e6ee4a07d..ba9ffde6a1baa3fce5caff539290c123fa0e4911 100644 (file)
--- a/src/main.cpp
+++ b/src/main.cpp
// write object bbox to area
sp_document_ensure_up_to_date (doc);
- sp_item_invoke_bbox((SPItem *) o_area, &area, sp_item_i2r_affine((SPItem *) o_area), TRUE);
+ boost::optional<NR::Rect> areaMaybe;
+ sp_item_invoke_bbox((SPItem *) o_area, areaMaybe, sp_item_i2r_affine((SPItem *) o_area), TRUE);
+ if (areaMaybe) {
+ area = NRRect(areaMaybe);
+ } else {
+ g_warning("Unable to determine a valid bounding box. Nothing exported.");
+ return;
+ }
} else {
g_warning("Object with id=\"%s\" was not found in the document. Nothing exported.", sp_export_id);
return;
}
// default dpi
- if (dpi == 0.0)
+ if (dpi == 0.0) {
dpi = PX_PER_IN;
+ }
unsigned long int width = 0;
unsigned long int height = 0;