diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-08-11 13:14:54 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-08-11 17:16:17 +0200 |
commit | e24f8bb11ac1894556ddefb2dd8854939c4190eb (patch) | |
tree | 34cdcf5831c58a79bb59aae5134f4b83ab388881 | |
parent | 628a0f313ed05db0149db680837c99267a77ea3c (diff) |
DOCX drawingML import: handle lack of ContourPolyPolygon shape property
Change-Id: I9dce645670f17115960b3648db24f769cd4a2635
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 423ed62c0da0..dc9eb62b207f 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -46,6 +46,7 @@ #include <rtl/math.hxx> #include <rtl/ustrbuf.hxx> #include <comphelper/string.hxx> +#include <comphelper/sequenceashashmap.hxx> #include <oox/drawingml/drawingmltypes.hxx> @@ -253,6 +254,7 @@ public: OUString title; std::queue<OUString>& m_rPositivePercentages; OUString sAnchorId; + comphelper::SequenceAsHashMap m_aInteropGrabBag; GraphicImport_Impl(GraphicImportType eImportType, DomainMapper& rDMapper, std::queue<OUString>& rPositivePercentages) : nXSize(0) @@ -790,6 +792,11 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue) xShapeProps->setPropertyValue("Surround", uno::makeAny(m_pImpl->nWrap)); m_pImpl->applyZOrder(xShapeProps); m_pImpl->applyName(xShapeProps); + + // Get the grab-bag set by oox, merge with our one and then put it back. + comphelper::SequenceAsHashMap aInteropGrabBag(xShapeProps->getPropertyValue("InteropGrabBag")); + aInteropGrabBag.update(m_pImpl->m_aInteropGrabBag); + xShapeProps->setPropertyValue("InteropGrabBag", uno::makeAny(aInteropGrabBag.getAsConstPropertyValueList())); } } } @@ -953,6 +960,12 @@ void GraphicImport::lcl_sprm(Sprm& rSprm) { pProperties->resolve(*this); } + + // We'll map these to PARALLEL, save the original wrap type. + if (nSprmId == NS_ooxml::LN_EG_WrapType_wrapTight) + m_pImpl->m_aInteropGrabBag["EG_WrapType"] <<= OUString("wrapTight"); + else if (nSprmId == NS_ooxml::LN_EG_WrapType_wrapThrough) + m_pImpl->m_aInteropGrabBag["EG_WrapType"] <<= OUString("wrapThrough"); } break; case NS_ooxml::LN_CT_WrapTight_wrapPolygon: @@ -963,6 +976,9 @@ void GraphicImport::lcl_sprm(Sprm& rSprm) resolveSprmProps(aHandler, rSprm); m_pImpl->mpWrapPolygon = aHandler.getPolygon(); + + // Save the wrap path in case we can't handle it natively: drawinglayer shapes, TextFrames. + m_pImpl->m_aInteropGrabBag["CT_WrapPath"] <<= m_pImpl->mpWrapPolygon->getPointSequenceSequence(); } break; case NS_ooxml::LN_CT_Anchor_positionH: // 90976; |