[Libreoffice-commits] core.git: sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 7 18:25:20 UTC 2020


 sw/source/filter/ww8/ww8graf.cxx |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit ce8a9ce6a1890b28c12ff0826d6808aad0bbccb2
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Oct 7 16:05:49 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Oct 7 20:24:31 2020 +0200

    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 at redhat.com>

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);
 }


More information about the Libreoffice-commits mailing list