Code

New tab in Fill&Stroke dialog for swatch fills.
[inkscape.git] / src / extension / internal / odf.cpp
index 2e0082832fa0274075a06cf95dde3f8c5006c144..3537be4504646f29236e8d0f7578112a798a0273 100644 (file)
@@ -795,8 +795,8 @@ void SingularValueDecomposition::calculate()
          }
       }
 
-    delete e;
-    delete work;
+    delete [] e;
+    delete [] work;
 
 }
 
@@ -962,10 +962,10 @@ static Geom::Matrix getODFTransform(const SPItem *item)
  * Get the bounding box of an item, as mapped onto
  * an ODF document, in cm.
  */
-static boost::optional<Geom::Rect> getODFBoundingBox(const SPItem *item)
+static Geom::OptRect getODFBoundingBox(const SPItem *item)
 {
-    boost::optional<Geom::Rect> bbox_temp = sp_item_bbox_desktop((SPItem *)item);
-    boost::optional<Geom::Rect> bbox;
+    Geom::OptRect bbox_temp = sp_item_bbox_desktop((SPItem *)item);
+    Geom::OptRect bbox;
     if (bbox_temp) {
         bbox = *bbox_temp;
         double doc_height    = sp_document_height(SP_ACTIVE_DOCUMENT);
@@ -1660,7 +1660,7 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item,
     GradientInfo gi;
 
     SPGradient *grvec = sp_gradient_get_vector(gradient, FALSE);
-    for (SPStop *stop = sp_first_stop(grvec) ;
+    for (SPStop *stop = grvec->getFirstStop() ;
           stop ; stop = sp_next_stop(stop))
         {
         unsigned long rgba = sp_stop_get_rgba32(stop);
@@ -1866,7 +1866,7 @@ bool OdfOutput::writeTree(Writer &couts, Writer &souts,
     Geom::Matrix tf        = getODFTransform(item);
 
     //### Get ODF bounding box params for item
-    boost::optional<Geom::Rect> bbox = getODFBoundingBox(item);
+    Geom::OptRect bbox = getODFBoundingBox(item);
     if (!bbox) {
         return true;
     }
@@ -2367,12 +2367,14 @@ OdfOutput::reset()
  * Descends into the SVG tree, mapping things to ODF when appropriate
  */
 void
-OdfOutput::save(Inkscape::Extension::Output */*mod*/, SPDocument *doc, gchar const *uri)
+OdfOutput::save(Inkscape::Extension::Output */*mod*/, SPDocument *doc, gchar const *filename)
 {
     reset();
 
-    //g_message("native file:%s\n", uri);
-    documentUri = URI(uri);
+    //g_message("native file:%s\n", filename);
+    documentUri = URI(filename);
+    /* fixme: It looks like we really are using documentUri as a URI, so we ought to call
+     * g_filename_to_uri for the URI constructor. */
 
     ZipFile zf;
     preprocess(zf, doc->rroot);
@@ -2395,7 +2397,7 @@ OdfOutput::save(Inkscape::Extension::Output */*mod*/, SPDocument *doc, gchar con
         return;
         }
 
-    if (!zf.writeFile(uri))
+    if (!zf.writeFile(filename))
         {
         return;
         }