oox/source/drawingml/textcharacterpropertiescontext.cxx            |    8 
+++++-
 sw/qa/extras/ooxmlexport/data/tdf131775_SpacingGroupShapeText.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx                          |   12 
++++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 9b7a2d33e9dcb5e4131e4901969d5853efdaf6e8
Author:     Tibor Nagy <nagy.tib...@nisz.hu>
AuthorDate: Wed Apr 1 15:04:22 2020 +0200
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Tue Apr 21 09:51:35 2020 +0200

    tdf#131775 DOCX DrawingML shape import: fix missing spacing
    
    Character spacing of grouped shapes wasn't imported.
    
    Co-Author: Balazs Regenyi, Szabolcs Toth
    
    Change-Id: I9c4f204a5ab7c7e55e26968a71b315d84e5d8515
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91490
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>

diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx 
b/oox/source/drawingml/textcharacterpropertiescontext.cxx
old mode 100644
new mode 100755
index 7658d41031f0..5198b65b61ab
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -165,7 +165,7 @@ ContextHandlerRef 
TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl
         case W_TOKEN( u ):
         {
             // If you add here, check if it is in drawingmltypes.cxx 113.
-            auto attrib = rAttribs.getString(W_TOKEN( val ), OUString());
+            auto attrib = rAttribs.getString(W_TOKEN(val), OUString());
             if (attrib == "single" || attrib == "words") // TODO: implement 
words properly. Now it is a single line.
                 mrTextCharacterProperties.moUnderline = XML_sng;
             else if (attrib == "wavyHeavy")
@@ -202,6 +202,12 @@ ContextHandlerRef 
TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl
                 mrTextCharacterProperties.moUnderline = XML_none;
             break;
         }
+        case W_TOKEN( spacing ):
+        {
+            auto attrib = rAttribs.getInteger(W_TOKEN( val ), 0);
+            mrTextCharacterProperties.moSpacing = attrib;
+            break;
+        }
         case W_TOKEN( b ):
             mrTextCharacterProperties.moBold = rAttribs.getBool(W_TOKEN( val 
), true);
             break;
diff --git a/sw/qa/extras/ooxmlexport/data/tdf131775_SpacingGroupShapeText.docx 
b/sw/qa/extras/ooxmlexport/data/tdf131775_SpacingGroupShapeText.docx
new file mode 100644
index 000000000000..a7d34d6f24c6
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf131775_SpacingGroupShapeText.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index ee4b35698533..8f800ef1a17d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -1243,6 +1243,18 @@ DECLARE_OOXMLEXPORT_TEST(testNonBMPChar, 
"nonbmpchar.docx")
     CPPUNIT_ASSERT_EQUAL(aExpected, xTextRange1->getString());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testSpaceingGroupShapeText, 
"tdf131775_SpacingGroupShapeText.docx")
+{
+    // tdf#131775: Check if correct spaceing.
+
+    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/wpg:wgp/wps:wsp[1]/wps:txbx/w:txbxContent/w:p/w:r/w:rPr/w:spacing",
 "val", "71");
+}
+
 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