filter/source/msfilter/escherex.cxx                      |    5 +++++
 sw/qa/extras/ooxmlexport/data/tdf123346_ArrowMarker.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx                |   12 ++++++++++++
 3 files changed, 17 insertions(+)

New commits:
commit a01bcc88af9d1ac47af64abab95f9048b4870740
Author:     Szabolcs <szabolcs...@gmail.com>
AuthorDate: Mon Mar 30 17:12:05 2020 +0200
Commit:     Xisco Faulí <xiscofa...@libreoffice.org>
CommitDate: Tue Apr 21 18:44:25 2020 +0200

    tdf#123346 DOCX VML shape export: fix arrow marker
    
    In some cases at import there are extra space separated
    numbers at the end of the names of arrow objects.
    Remove these extra numbers before they could interfere
    with the choice of markers.
    
    See commit 2d3b7a07c02c90d2d64a630ab84886ef3096edfc
    (tdf#100491 fix DOCX import shape line with arrow marker).
    
    Co_Author: Balázs Regényi
    
    Change-Id: I2156502b0ce5cd755a731359398a40edabb603a6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91375
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 68531e459e7a922319e6bfe8b7a5282ba0320182)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92535
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org>

diff --git a/filter/source/msfilter/escherex.cxx 
b/filter/source/msfilter/escherex.cxx
index 0279bc6684e7..f04043e9156a 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -894,6 +894,11 @@ bool EscherPropertyContainer::GetLineArrow( const bool 
bLineStart,
                 OUString        aArrowStartName = 
*o3tl::doAccess<OUString>(aAny);
                 sal_uInt16      nWhich = bLineStart ? 
sal_uInt16(XATTR_LINESTART) : sal_uInt16(XATTR_LINEEND);
 
+                // remove extra space separated number
+                sal_Int32 nPos = aArrowStartName.lastIndexOf(' ');
+                if (nPos > -1 && aArrowStartName.lastIndexOf(' ', nPos) > -1)
+                    aArrowStartName = aArrowStartName.copy(0, nPos);
+
                 OUString aApiName = SvxUnogetApiNameForItem(nWhich, 
aArrowStartName);
                 bool bIsMapped = true;
                 if ( !aApiName.isEmpty() )
diff --git a/sw/qa/extras/ooxmlexport/data/tdf123346_ArrowMarker.docx 
b/sw/qa/extras/ooxmlexport/data/tdf123346_ArrowMarker.docx
new file mode 100644
index 000000000000..770bab263d7b
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf123346_ArrowMarker.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index 8e79024c90f0..7e9bcb639012 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -1106,6 +1106,18 @@ DECLARE_OOXMLEXPORT_TEST(testArrowPosition, 
"tdf104565_ArrowPosition.docx")
         "/wp:positionV/wp:posOffset", "516255");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testArrowMarker, "tdf123346_ArrowMarker.docx")
+{
+    // tdf#123346: Check arrow marker.
+
+    xmlDocPtr pXmlDocument = parseExport("word/document.xml");
+    if (!pXmlDocument)
+        return;
+
+    assertXPath(pXmlDocument, 
"/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor"
+        "/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:ln/a:tailEnd", "type", 
"arrow");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to