[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sw/qa xmloff/source

Tamás Zolnai tamas.zolnai at collabora.com
Tue Aug 1 13:42:55 UTC 2017


 sw/qa/extras/odfimport/data/tdf109228.odt  |binary
 sw/qa/extras/odfimport/odfimport.cxx       |    7 +++++++
 xmloff/source/text/XMLTextFrameContext.cxx |    1 +
 3 files changed, 8 insertions(+)

New commits:
commit de5afba4c116792d795339f7e773e302259d8bf0
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Thu Jul 20 16:39:07 2017 +0200

    tdf#109228: FILESAVE: ODT: Anchor changed to 'to character' after RT
    
    Ignore frames without names, becuase the code does not handle
    them well. It does not affect those use case for which the
    deduplication code was added.
    
    Reviewed-on: https://gerrit.libreoffice.org/40222
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit 615c2a2c54d3e7aefb4986ae7d8de81a42022988)
    
    Change-Id: I08ad062b8b11cc06323467329d8c4e97bc4932dd
    Reviewed-on: https://gerrit.libreoffice.org/40236
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/odfimport/data/tdf109228.odt b/sw/qa/extras/odfimport/data/tdf109228.odt
new file mode 100755
index 000000000000..0f3368e1b201
Binary files /dev/null and b/sw/qa/extras/odfimport/data/tdf109228.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 8911e8067107..af20b422505e 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -20,6 +20,7 @@
 #include <com/sun/star/text/XTextSection.hpp>
 #include <com/sun/star/text/XTextTable.hpp>
 #include <com/sun/star/text/PageNumberType.hpp>
+#include <com/sun/star/text/TextContentAnchorType.hpp>
 
 #include <wrtsh.hxx>
 #include <ndtxt.hxx>
@@ -808,5 +809,11 @@ DECLARE_ODFIMPORT_TEST(testTdf109080_style_ns, "tdf109080_style_ns.odt")
         parseDump("/root/page[2]/footer/txt/text()"));
 }
 
+DECLARE_ODFIMPORT_TEST(testTdf109228, "tdf109228.odt")
+{
+    //  Embedded object with no frame name was imported incorrectly, it was achored 'to character' instead of 'as character'
+    CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index 136ed2db8998..ed75d6cafca9 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -569,6 +569,7 @@ void XMLTextFrameContext_Impl::Create( bool /*bHRefOrBase64*/ )
 
     // Skip duplicated frames
     if(!mbMultipleContent && // It's allowed to have multiple image for the same frame
+       !sName.isEmpty() &&
        xTextImportHelper->IsDuplicateFrame(sName, nX, nY, nWidth, nHeight))
     {
         bCreateFailed = true;


More information about the Libreoffice-commits mailing list