[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - sw/qa writerfilter/source

Tamás Zolnai tamas.zolnai at collabora.com
Sat Nov 5 12:30:33 UTC 2016


 sw/qa/extras/ooxmlimport/data/tdf103664.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx     |   20 ++++++++++++++++++++
 writerfilter/source/dmapper/DomainMapper.cxx |    2 ++
 3 files changed, 22 insertions(+)

New commits:
commit 630f06d222c339e86ca3133123931b9262264e3a
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Sat Nov 5 12:30:20 2016 +0000

    tdf#103664: FILEOPEN: DOCX: Wingdings symbols are imported as rectangles
    
    Reviewed-on: https://gerrit.libreoffice.org/30575
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit 5ef66db91e87ef84724be22977acf4c9c472ad6b)
    
    Conflicts:
    	sw/qa/extras/ooxmlimport/ooxmlimport.cxx
    
    Change-Id: Ifd9ff26f2460e5570ec1b736308d48acdb3e56a8

diff --git a/sw/qa/extras/ooxmlimport/data/tdf103664.docx b/sw/qa/extras/ooxmlimport/data/tdf103664.docx
new file mode 100644
index 0000000..4d299a6
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf103664.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index c3c4728..b70f270 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -81,6 +81,7 @@
 #include <comphelper/propertysequence.hxx>
 #include <svx/svdpage.hxx>
 #include <com/sun/star/drawing/HomogenMatrix3.hpp>
+#include <com/sun/star/awt/CharSet.hpp>
 
 #include <bordertest.hxx>
 
@@ -3246,6 +3247,25 @@ DECLARE_OOXMLIMPORT_TEST(testTdf99074, "tdf99074.docx")
     CPPUNIT_ASSERT(getProperty<bool>(xSettings, "InBrowseMode"));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf103664, "tdf103664.docx")
+{
+    // Wingdings symbols was displayed as rectangles
+    uno::Reference<text::XTextRange> xPara(getParagraph(1));
+    CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xf020), xPara->getString()[0] );
+    CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xf0fc), xPara->getString()[1] );
+    CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xf0dc), xPara->getString()[2] );
+    CPPUNIT_ASSERT_EQUAL(sal_Unicode(0xf081), xPara->getString()[3] );
+
+    uno::Reference<beans::XPropertySet> xRun(getRun(xPara,1), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty<OUString>(xRun, "CharFontName"));
+    CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty<OUString>(xRun, "CharFontNameAsian"));
+    CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty<OUString>(xRun, "CharFontNameComplex"));
+
+    // Make sure these special characters imported as symbols
+    CPPUNIT_ASSERT_EQUAL(awt::CharSet::SYMBOL, getProperty<sal_Int16>(xRun, "CharFontCharSet"));
+}
+
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index ae201aa..ab8948fd 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -62,6 +62,7 @@
 #include <com/sun/star/text/XTextColumns.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/text/FontEmphasis.hpp>
+#include <com/sun/star/awt/CharSet.hpp>
 #include <comphelper/types.hxx>
 #include <comphelper/storagehelper.hxx>
 #include <comphelper/sequence.hxx>
@@ -2635,6 +2636,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext )
             rContext->Insert(PROP_CHAR_FONT_NAME, aVal);
             rContext->Insert(PROP_CHAR_FONT_NAME_ASIAN, aVal);
             rContext->Insert(PROP_CHAR_FONT_NAME_COMPLEX, aVal);
+            rContext->Insert(PROP_CHAR_FONT_CHAR_SET, uno::makeAny(awt::CharSet::SYMBOL));
             utext( reinterpret_cast < const sal_uInt8 * >( &(aSymbolData.cSymbol) ), 1 );
         }
     }


More information about the Libreoffice-commits mailing list