summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-10-15 21:11:24 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-10-19 16:31:41 +0200
commit1c6bea8e677861d201e9b21b5f0e356f77dabaaf (patch)
treea3bb339064639b603b7cc6a17e7f5b7244a29828 /sw/source
parentac39aba9b2d08b061b0eef651f5ebc7a84391171 (diff)
tdf#112520 RTF export: write ZOrder only for toplevel shapes
RTF export at the moment exports children of group shapes as a flat shape list. This means that the order inside the group shape is not relevant for the toplevel ZOrder, so just don't write it. (cherry picked from commit 2b920bdc12f3bf3a196ec0d6d59043a68e663e33) Change-Id: I870707cb28c2f177c0e5d9cf5328260e76b661f3 Reviewed-on: https://gerrit.libreoffice.org/61904 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx12
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.hxx2
2 files changed, 11 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index 209e3a9d993c..c1b835194784 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -89,10 +89,11 @@ void RtfSdrExport::CloseContainer()
sal_uInt32 RtfSdrExport::EnterGroup(const OUString& /*rShapeName*/,
const tools::Rectangle* /*pRect*/)
{
+ m_bInGroup = true;
return GenerateShapeId();
}
-void RtfSdrExport::LeaveGroup() { /* noop */}
+void RtfSdrExport::LeaveGroup() { m_bInGroup = false; }
void RtfSdrExport::AddShape(sal_uInt32 nShapeType, ShapeFlag nShapeFlags, sal_uInt32 /*nShapeId*/)
{
@@ -562,8 +563,13 @@ sal_Int32 RtfSdrExport::StartShape()
m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE);
// Write ZOrder.
- m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_SHPZ);
- m_rAttrOutput.RunText().append(OString::number(m_pSdrObject->GetOrdNum()));
+ if (!m_bInGroup)
+ {
+ // Order inside the group shape is not relevant for the flat shape list
+ // we write.
+ m_rAttrOutput.RunText().append(OOO_STRING_SVTOOLS_RTF_SHPZ);
+ m_rAttrOutput.RunText().append(OString::number(m_pSdrObject->GetOrdNum()));
+ }
for (auto it = m_aShapeProps.rbegin(); it != m_aShapeProps.rend(); ++it)
lcl_AppendSP(m_rAttrOutput.RunText(), (*it).first.getStr(), (*it).second);
diff --git a/sw/source/filter/ww8/rtfsdrexport.hxx b/sw/source/filter/ww8/rtfsdrexport.hxx
index c2c33de4aca2..b0c9f151e790 100644
--- a/sw/source/filter/ww8/rtfsdrexport.hxx
+++ b/sw/source/filter/ww8/rtfsdrexport.hxx
@@ -56,6 +56,8 @@ class RtfSdrExport final : public EscherEx
/// Remember which shape types we had already written.
std::unique_ptr<bool[]> m_pShapeTypeWritten;
+ bool m_bInGroup = false;
+
public:
explicit RtfSdrExport(RtfExport& rExport);
~RtfSdrExport() override;