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

Regényi Balázs (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 17 11:51:29 UTC 2020


 oox/source/drawingml/textcharacterpropertiescontext.cxx           |    3 ++
 sw/qa/extras/ooxmlexport/data/tdf131922_LanguageInGroupShape.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport12.cxx                        |   13 ++++++++++
 3 files changed, 16 insertions(+)

New commits:
commit 01752af18d623676c4ebc7a8a4a47f69dfb79057
Author:     Regényi Balázs <regenyi.balazs+gerrit at gmail.com>
AuthorDate: Tue Apr 7 10:01:15 2020 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Fri Apr 17 13:50:54 2020 +0200

    tdf#131922 DOCX DrawingML shape import: fix lang-id
    
    The language identifier of text of grouped shapes wasn't imported.
    
    Co-Author: Szabolcs Tóth
    
    Change-Id: Ic71ea1bdf3aed27ad813cfa33659921060c0ec0b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91801
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index 4533a96e1cca..7658d41031f0 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -262,6 +262,9 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl
                 mrTextCharacterProperties.moBaseline = -25000;
             break;
         }
+        case W_TOKEN(lang):
+            mrTextCharacterProperties.moLang = rAttribs.getString(W_TOKEN(val), OUString());
+            break;
         case OOX_TOKEN(w14, glow):
         case OOX_TOKEN(w14, shadow):
         case OOX_TOKEN(w14, reflection):
diff --git a/sw/qa/extras/ooxmlexport/data/tdf131922_LanguageInGroupShape.docx b/sw/qa/extras/ooxmlexport/data/tdf131922_LanguageInGroupShape.docx
new file mode 100644
index 000000000000..afd5ec57aedc
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf131922_LanguageInGroupShape.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
index a8588a0ddf68..19582a7990eb 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx
@@ -989,6 +989,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf122594, "tdf122594.docx")
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3), nCheck);
 }
 
+DECLARE_OOXMLEXPORT_TEST(testLanguageInGroupShape, "tdf131922_LanguageInGroupShape.docx")
+{
+    // tdf#131922: Check if good language is used in shape group texts
+    xmlDocPtr pXml = parseExport("word/document.xml");
+    if (!pXml)
+        return;
+    assertXPath(pXml,
+                "/w:document/w:body/w:p[7]/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:lang",
+                "val", "de-DE");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list