summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 28b2b17)
raw | patch | inline | side by side (parent: 28b2b17)
author | ishmal <ishmal@users.sourceforge.net> | |
Thu, 1 Jun 2006 05:01:23 +0000 (05:01 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Thu, 1 Jun 2006 05:01:23 +0000 (05:01 +0000) |
src/dialogs/export.cpp | patch | blob | history |
diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp
index 47f2b351d11e6bd5a5ca6b47b14c07ea33590d7f..7cbeee41f4fd07dbdb4433dd1681f2402cfe0d53 100644 (file)
--- a/src/dialogs/export.cpp
+++ b/src/dialogs/export.cpp
case SELECTION_DRAWING:
if ( SP_ACTIVE_DESKTOP ) {
SPDocument *doc;
- NRRect bbox;
doc = sp_desktop_document (SP_ACTIVE_DESKTOP);
- sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)), &bbox);
+ NR::Rect bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)));
- if (!(bbox.x0 > bbox.x1 && bbox.y0 > bbox.y1)) {
- sp_export_set_area (base, bbox.x0, bbox.y0, bbox.x1, bbox.y1);
+ if (!(bbox.min()[NR::X] > bbox.max()[NR::X] &&
+ bbox.min()[NR::Y] > bbox.max()[NR::Y])) {
+ sp_export_set_area (base, bbox.min()[NR::X],
+ bbox.min()[NR::Y],
+ bbox.max()[NR::X],
+ bbox.max()[NR::Y]);
}
}
break;
if ( SP_ACTIVE_DESKTOP )
{
SPDocument *doc;
- NRRect bbox;
+ NR::Rect bbox;
doc = sp_desktop_document (SP_ACTIVE_DESKTOP);
/* Notice how the switch is used to 'fall through' here to get
case SELECTION_SELECTION:
if ((sp_desktop_selection(SP_ACTIVE_DESKTOP))->isEmpty() == false)
{
- (sp_desktop_selection (SP_ACTIVE_DESKTOP))->bounds(&bbox);
+ bbox = (sp_desktop_selection (SP_ACTIVE_DESKTOP))->bounds();
/* Only if there is a selection that we can set
do we break, otherwise we fall through to the
drawing */
/** \todo
* This returns wrong values if the document has a viewBox.
*/
- sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)), &bbox);
+ bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc)));
/* If the drawing is valid, then we'll use it and break
otherwise we drop through to the page settings */
- if (!(bbox.x0 > bbox.x1 && bbox.y0 > bbox.y1)) {
+ if (!(bbox.min()[NR::X] > bbox.max()[NR::X] &&
+ bbox.min()[NR::Y] > bbox.max()[NR::Y])) {
// std::cout << "Using selection: DRAWING" << std::endl;
key = SELECTION_DRAWING;
break;
}
case SELECTION_PAGE:
- bbox.x0 = 0.0;
- bbox.y0 = 0.0;
- bbox.x1 = sp_document_width (doc);
- bbox.y1 = sp_document_height (doc);
+ bbox = NR::Rect(NR::Point(0.0, 0.0),
+ NR::Point(sp_document_width(doc)),
+ sp_document_height(doc));
+
// std::cout << "Using selection: PAGE" << std::endl;
key = SELECTION_PAGE;
break;
"value", selection_names[key]);
if (key != SELECTION_CUSTOM) {
- sp_export_set_area (base, bbox.x0, bbox.y0, bbox.x1, bbox.y1);
+ sp_export_set_area (base, bbox.min()[NR::X],
+ bbox.min()[NR::Y],
+ bbox.max()[NR::X],
+ bbox.max()[NR::Y]);
}
} // end of if ( SP_ACTIVE_DESKTOP )