diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-09-26 12:21:59 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-09-26 12:43:32 +0200 |
commit | 8738ded7bb1bb6262fe1038e310b5110407f4cfa (patch) | |
tree | 3d87aa158d05b18450e6bd5fc057dc93bb71d4a2 /writerfilter | |
parent | 634f1d11d2a027887807494b3ca67f33825d5d23 (diff) |
fdo#69636 VML import: handle mso-layout-flow-alt shape prop for sw frames
Writer core doesn't support this, and this has been a problem for table
cells as well. There the workaround we're using for quite a while is to
do the rotation at a text portion level instead, which results in
reasonable layout for simple cases. Do the same here.
One additional complexity is that the API between oox and writerfilter
is a single UNO shape, we get this property in oox, and we have to
handle it in writerfilter, when the text frame is already attached to
some text. Kill this problem by adding a FrameInteropGrabBag for sw text
frames: it's useful anyway, and then we can pass around this property
inside the grab bag.
Change-Id: Idb5ec83b5cbdde8f29d15b2cebfad24226bb6507
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 3 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 17 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.hxx | 1 |
3 files changed, 20 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 4652a40d3636..031993fd8839 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3649,6 +3649,9 @@ void DomainMapper::PopListProperties() void DomainMapper::lcl_startCharacterGroup() { m_pImpl->PushProperties(CONTEXT_CHARACTER); + if (m_pImpl->m_bFrameBtLr) + // No support for this in core, work around by char rotation, as we do so for table cells already. + m_pImpl->GetTopContext()->Insert(PROP_CHAR_ROTATION, uno::makeAny(sal_Int16(900))); } void DomainMapper::lcl_endCharacterGroup() diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 5a5ab662fe35..b81d4efc5b71 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -177,7 +177,8 @@ DomainMapper_Impl::DomainMapper_Impl( m_pSdtHelper(0), m_nTableDepth(0), m_bHasFtnSep(false), - m_bIgnoreNextPara(false) + m_bIgnoreNextPara(false), + m_bFrameBtLr(false) { appendTableManager( ); @@ -1778,6 +1779,19 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape uno::makeAny( true ) ); if (xSInfo->supportsService("com.sun.star.text.TextFrame")) { + // Extract the special "btLr text frame" mode, requested by oox, if needed. + uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aGrabBag; + xPropertySet->getPropertyValue("FrameInteropGrabBag") >>= aGrabBag; + for (int i = 0; i < aGrabBag.getLength(); ++i) + { + if (aGrabBag[i].Name == "mso-layout-flow-alt") + { + m_bFrameBtLr = aGrabBag[i].Value.get<OUString>() == "bottom-to-top"; + break; + } + } + uno::Reference<text::XTextContent> xTextContent(xShape, uno::UNO_QUERY_THROW); uno::Reference<text::XTextRange> xTextRange(xTextAppend->createTextCursorByRange(xTextAppend->getEnd()), uno::UNO_QUERY_THROW); xTextAppend->insertTextContent(xTextRange, xTextContent, sal_False); @@ -1858,6 +1872,7 @@ void DomainMapper_Impl::PopShapeContext() } m_aAnchoredStack.pop(); } + m_bFrameBtLr = false; } sal_Int16 lcl_ParseNumberingType( const OUString& rCommand ) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index f61c9ad0c838..9210184b47c2 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -709,6 +709,7 @@ public: /// If the next newline should be ignored, used by the special footnote separator paragraph. bool m_bIgnoreNextPara; + bool m_bFrameBtLr; ///< Bottom to top, left to right text frame direction is requested for the current text frame. }; } //namespace dmapper } //namespace writerfilter |