diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-01-31 15:37:13 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-01-31 19:13:34 +0100 |
commit | d8cf61f39181073da2d8748be74d9dadae79d647 (patch) | |
tree | 792859388a419f5363441aa172034cfa6eb9c341 /sw/source/filter/ww8/rtfattributeoutput.cxx | |
parent | 9cb5b06eea8f0067bb9ddee9f4f1c992eda34a64 (diff) |
Related: tdf#116371 RTF export: handle rotation of SwGrfNode
This is similar to commit b226383a83e41bbced9fc2a02dc09a449401ec97
(tdf#116371: export rotation of SwGrfNode, 2019-01-26), just this is for
RTF, not DOCX.
Make sure we don't test the ODT import result as it's done already in
CppunitTest_sw_ooxmlexport13.
Change-Id: Iaf2d3011c45f3459e920f679683b1a45de42efe7
Reviewed-on: https://gerrit.libreoffice.org/67218
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/filter/ww8/rtfattributeoutput.cxx')
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 995a43bd0a9b..52e826af9d9d 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -4010,6 +4010,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat a wmf already then we don't need any such wrapping */ bool bIsWMF = pBLIPType && std::strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE) == 0; + const SwAttrSet* pAttrSet = pGrfNode->GetpSwAttrSet(); if (!pFrame || pFrame->IsInline()) { if (!bIsWMF) @@ -4070,6 +4071,19 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat if (!pFlyFrameFormat->GetOpaque().GetValue()) aFlyProperties.push_back(std::make_pair<OString, OString>("fBehindDocument", "1")); + if (pAttrSet) + { + if (sal_Int32 nRot = pAttrSet->Get(RES_GRFATR_ROTATION).GetValue()) + { + // See writerfilter::rtftok::RTFSdrImport::applyProperty(), + // positive rotation angles are clockwise in RTF, we have them + // as counter-clockwise. + // Additionally, RTF type is 0..360*2^16, our is 0..360*10. + nRot = nRot * -1 * RTF_MULTIPLIER / 10; + aFlyProperties.emplace_back("rotation", OString::number(nRot)); + } + } + for (std::pair<OString, OString>& rPair : aFlyProperties) { m_rExport.Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_SP "{"); @@ -4085,7 +4099,6 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat } bool bWritePicProp = !pFrame || pFrame->IsInline(); - const SwAttrSet* pAttrSet = pGrfNode->GetpSwAttrSet(); if (pBLIPType) ExportPICT(pFlyFrameFormat, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport, &m_rExport.Strm(), bWritePicProp, pAttrSet); |