Code

fix copyright year
[inkscape.git] / src / main.cpp
index c6892a5aa11343e1f09927a1c0a0c9482d42ff07..dff671c638650b8f42ff98cfb9bd7a271df39d85 100644 (file)
@@ -789,15 +789,20 @@ do_query_dimension (SPDocument *doc, bool extent, NR::Dim2 const axis, const gch
     if (o) {
         sp_document_ensure_up_to_date (doc);
         SPItem *item = ((SPItem *) o);
-        NR::Rect area = item->invokeBbox(sp_item_i2doc_affine(item)); // "true" SVG bbox for scripting
 
-        Inkscape::SVGOStringStream os;
-        if (extent) {
-            os << area.extent(axis);
+        // "true" SVG bbox for scripting
+        NR::Maybe<NR::Rect> area = item->getBounds(sp_item_i2doc_affine(item));
+        if (area) {
+            Inkscape::SVGOStringStream os;
+            if (extent) {
+                os << area->extent(axis);
+            } else {
+                os << area->min()[axis];
+            }
+            g_print ("%s", os.str().c_str());
         } else {
-            os << area.min()[axis];
+            g_print("0");
         }
-        g_print ("%s", os.str().c_str());
     }
 }
 
@@ -1407,7 +1412,7 @@ sp_process_args(poptContext ctx)
                 gchar const *arg = poptGetOptArg(ctx);
                 if (arg != NULL) {
                     // printf("Adding in: %s\n", arg);
-                    new Inkscape::CmdLineAction(a, arg);
+                    new Inkscape::CmdLineAction((a == SP_ARG_VERB), arg);
                 }
                 break;
             }