[Libreoffice-commits] .: writerperfect/source

Fridrich Strba fridrich at kemper.freedesktop.org
Tue Dec 6 07:16:33 PST 2011


 writerperfect/source/filter/OdgGenerator.cxx |   10 ++++++++--
 writerperfect/source/filter/OdtGenerator.cxx |   13 ++++++++-----
 2 files changed, 16 insertions(+), 7 deletions(-)

New commits:
commit fa22c33794245d64056ed0f7b6260ddd60f9dc70
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Tue Dec 6 16:14:12 2011 +0100

    Allow inserting of ole objects into draw documents

diff --git a/writerperfect/source/filter/OdgGenerator.cxx b/writerperfect/source/filter/OdgGenerator.cxx
index f4d68dc..4d70f8d 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -964,7 +964,10 @@ void OdgGenerator::drawGraphicObject(const ::WPXPropertyList &propList, const ::
         pDrawFrameElement->addAttribute("svg:width", propList["svg:width"]->getStr());
     mpImpl->mBodyElements.push_back(pDrawFrameElement);
 
-    mpImpl->mBodyElements.push_back(new TagOpenElement("draw:image"));
+    if (propList["libwpg:mime-type"]->getStr() == "object/ole")
+        mpImpl->mBodyElements.push_back(new TagOpenElement("draw:object-ole"));
+    else
+        mpImpl->mBodyElements.push_back(new TagOpenElement("draw:image"));
 
     mpImpl->mBodyElements.push_back(new TagOpenElement("office:binary-data"));
 
@@ -973,7 +976,10 @@ void OdgGenerator::drawGraphicObject(const ::WPXPropertyList &propList, const ::
 
     mpImpl->mBodyElements.push_back(new TagCloseElement("office:binary-data"));
 
-    mpImpl->mBodyElements.push_back(new TagCloseElement("draw:image"));
+    if (propList["libwpg:mime-type"]->getStr() == "object/ole")
+        mpImpl->mBodyElements.push_back(new TagCloseElement("draw:object-ole"));
+    else
+        mpImpl->mBodyElements.push_back(new TagCloseElement("draw:image"));
 
     mpImpl->mBodyElements.push_back(new TagCloseElement("draw:frame"));
 }
diff --git a/writerperfect/source/filter/OdtGenerator.cxx b/writerperfect/source/filter/OdtGenerator.cxx
index b609678..94e46c9 100644
--- a/writerperfect/source/filter/OdtGenerator.cxx
+++ b/writerperfect/source/filter/OdtGenerator.cxx
@@ -1264,10 +1264,10 @@ void OdtGenerator::insertBinaryObject(const WPXPropertyList &propList, const WPX
     else
         // assuming we have a binary image or a object_ole that we can just insert as it is
     {
-        std::string dataType = "draw:image";
-        if (propList["libwpd:mimetype"]->getStr() == "object/ole")
-            dataType = "draw:object-ole";
-        mpImpl->mpCurrentContentElements->push_back(new TagOpenElement(dataType.c_str()));
+        if (propList["libwpg:mime-type"]->getStr() == "object/ole")
+            mpImpl->mpCurrentContentElements->push_back(new TagOpenElement("draw:object-ole"));
+        else
+            mpImpl->mpCurrentContentElements->push_back(new TagOpenElement("draw:image"));
 
         mpImpl->mpCurrentContentElements->push_back(new TagOpenElement("office:binary-data"));
 
@@ -1277,7 +1277,10 @@ void OdtGenerator::insertBinaryObject(const WPXPropertyList &propList, const WPX
 
         mpImpl->mpCurrentContentElements->push_back(new TagCloseElement("office:binary-data"));
 
-        mpImpl->mpCurrentContentElements->push_back(new TagCloseElement(dataType.c_str()));
+        if (propList["libwpg:mime-type"]->getStr() == "object/ole")
+            mpImpl->mpCurrentContentElements->push_back(new TagCloseElement("draw:object-ole"));
+        else
+            mpImpl->mpCurrentContentElements->push_back(new TagCloseElement("draw:image"));
     }
 }
 


More information about the Libreoffice-commits mailing list