diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-08-06 16:31:29 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-08-08 14:30:55 +0000 |
commit | 88fec7695f5f3c9574bc305e31120758004493cf (patch) | |
tree | 248dce1a6452093fc9cc6d0bf9931c91b382bef1 /writerfilter/source/rtftok/rtfdocumentimpl.cxx | |
parent | 01ad0524859ae9566fc063179c80fc6a67f7bb0c (diff) |
fdo#47440 import RTF_SHPBX/YPAGE for Writer pictures, too
Previously this was only handled for drawinglayer shapes.
(cherry picked from commit b755df14a431543f1b70246a5e58830a0a480602)
Change-Id: I7ce440a27ebe44fc867b8a7f4ee62217076677f0
Reviewed-on: https://gerrit.libreoffice.org/5303
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Tested-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'writerfilter/source/rtftok/rtfdocumentimpl.cxx')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 5ff313230ace..5895057e2e00 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -840,17 +840,20 @@ int RTFDocumentImpl::resolvePict(bool bInline) if (aAnchorWrapAttributes.size()) aAnchorSprms.set(NS_ooxml::LN_EG_WrapType_wrapSquare, pAnchorWrapValue); - // See OOXMLFastContextHandler::positionOffset(), we can't just put values in an RTFValue. + // See OOXMLFastContextHandler::positionOffset(), we can't just put offset values in an RTFValue. + RTFSprms aPoshSprms; + if (m_aStates.top().aShape.nHoriOrientRelationToken > 0) + aPoshSprms.set(NS_ooxml::LN_CT_PosH_relativeFrom, RTFValue::Pointer_t(new RTFValue(m_aStates.top().aShape.nHoriOrientRelationToken))); if (m_aStates.top().aShape.nLeft > 0) - { writerfilter::dmapper::PositionHandler::setPositionOffset(OUString::number(MM100_TO_EMU(m_aStates.top().aShape.nLeft)), false); - aAnchorSprms.set(NS_ooxml::LN_CT_Anchor_positionH, RTFValue::Pointer_t(new RTFValue(RTFSprms()))); - } + aAnchorSprms.set(NS_ooxml::LN_CT_Anchor_positionH, RTFValue::Pointer_t(new RTFValue(aPoshSprms))); + + RTFSprms aPosvSprms; + if (m_aStates.top().aShape.nVertOrientRelationToken > 0) + aPosvSprms.set(NS_ooxml::LN_CT_PosV_relativeFrom, RTFValue::Pointer_t(new RTFValue(m_aStates.top().aShape.nVertOrientRelationToken))); if (m_aStates.top().aShape.nTop > 0) - { writerfilter::dmapper::PositionHandler::setPositionOffset(OUString::number(MM100_TO_EMU(m_aStates.top().aShape.nTop)), true); - aAnchorSprms.set(NS_ooxml::LN_CT_Anchor_positionV, RTFValue::Pointer_t(new RTFValue(RTFSprms()))); - } + aAnchorSprms.set(NS_ooxml::LN_CT_Anchor_positionV, RTFValue::Pointer_t(new RTFValue(aPosvSprms))); aAnchorSprms.set(NS_ooxml::LN_CT_Anchor_docPr, pDocprValue); aAnchorSprms.set(NS_ooxml::LN_graphic_graphic, pGraphicValue); @@ -2660,9 +2663,11 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) break; case RTF_SHPBXPAGE: m_aStates.top().aShape.nHoriOrientRelation = text::RelOrientation::PAGE_FRAME; + m_aStates.top().aShape.nHoriOrientRelationToken = NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromH_page; break; case RTF_SHPBYPAGE: m_aStates.top().aShape.nVertOrientRelation = text::RelOrientation::PAGE_FRAME; + m_aStates.top().aShape.nVertOrientRelationToken = NS_ooxml::LN_Value_wordprocessingDrawing_ST_RelFromV_page; break; case RTF_DPLINEHOLLOW: m_aStates.top().aDrawingObject.nFLine = 0; @@ -4785,6 +4790,8 @@ RTFShape::RTFShape() nBottom(0), nHoriOrientRelation(0), nVertOrientRelation(0), + nHoriOrientRelationToken(0), + nVertOrientRelationToken(0), nWrap(-1) { } |