diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-07 16:05:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-10-07 20:24:31 +0200 |
commit | ce8a9ce6a1890b28c12ff0826d6808aad0bbccb2 (patch) | |
tree | d838ed98171617bd4473c15a0b9f488fac8b8686 /sw/source | |
parent | b03708252bb50dd2fbca0f82fa170e6d90816b82 (diff) |
tdf#137295 missing frames on roundtrip through docx
because they had the same name because GetUniqueDrawObjectName returned the
same name twice because the drawing objects were replaced by flys so there was
no actual drawing objects inserted
Change-Id: Icbe1848b7115c441f8205b8f566ec5ae4b0c55a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104063
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 3b24423abce6..74a7e880829e 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2750,6 +2750,9 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) OUString aObjName = pObject->GetName(); + bool bDrawObj = false; + bool bFrame = false; + SwFrameFormat* pRetFrameFormat = nullptr; if (bReplaceable) { @@ -2759,6 +2762,8 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) } else { + bDrawObj = true; + // Drawing objects, (e.g. ovals or drawing groups) if (pF->bRcaSimple) { @@ -2774,7 +2779,11 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) pRetFrameFormat = ConvertDrawTextToFly(pObject, pOurNewObject, pRecord, eAnchor, pF, aFlySet); if (pRetFrameFormat) + { bDone = true; + bDrawObj = false; + bFrame = true; + } } if (!bDone) @@ -2830,7 +2839,12 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) if (!aObjName.isEmpty()) pRetFrameFormat->SetName( aObjName ); if (pRetFrameFormat->GetName().isEmpty()) - pRetFrameFormat->SetName(m_rDoc.GetUniqueDrawObjectName()); + { + if (bDrawObj) + pRetFrameFormat->SetName(m_rDoc.GetUniqueDrawObjectName()); + else if (bFrame) + pRetFrameFormat->SetName(m_rDoc.GetUniqueFrameName()); + } } return AddAutoAnchor(pRetFrameFormat); } |