diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2011-12-06 16:14:12 +0100 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2011-12-06 16:34:36 +0100 |
commit | 68d2f0e77953349e4ff518b490eb4422bcd7def8 (patch) | |
tree | ca0643814f727bd140ba1cac33d9993a2b19b277 /writerperfect | |
parent | afbfec0ee3e58e36437f0b36f2d1df13c60e1968 (diff) |
Allow inserting of ole objects into draw documents
Diffstat (limited to 'writerperfect')
-rw-r--r-- | writerperfect/source/filter/OdgGenerator.cxx | 10 | ||||
-rw-r--r-- | writerperfect/source/filter/OdtGenerator.cxx | 13 |
2 files changed, 16 insertions, 7 deletions
diff --git a/writerperfect/source/filter/OdgGenerator.cxx b/writerperfect/source/filter/OdgGenerator.cxx index f4d68dce7913..4d70f8d41ea5 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 b6096786115b..94e46c98447f 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")); } } |