summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2016-11-04 21:53:56 +0000
committerTamás Zolnai <tamas.zolnai@collabora.com>2016-11-05 10:37:35 +0000
commit5ef66db91e87ef84724be22977acf4c9c472ad6b (patch)
treee7d946fee2b000fad94c017a74a38016edafdb76
parent385fa53636d3b12306217d0d884c6c4a2e0e7abb (diff)
tdf#103664: FILEOPEN: DOCX: Wingdings symbols are imported as rectangles
Change-Id: Ifd9ff26f2460e5570ec1b736308d48acdb3e56a8 Reviewed-on: https://gerrit.libreoffice.org/30575 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf103664.docxbin0 -> 11444 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx19
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx2
3 files changed, 21 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf103664.docx b/sw/qa/extras/ooxmlimport/data/tdf103664.docx
new file mode 100644
index 000000000000..4d299a66ea0a
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf103664.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 23d3aa35c05c..ffc225e2466f 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -56,6 +56,7 @@
#include <unotools/streamwrap.hxx>
#include <comphelper/propertysequence.hxx>
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
+#include <com/sun/star/awt/CharSet.hpp>
class Test : public SwModelTestBase
{
@@ -1247,6 +1248,24 @@ DECLARE_OOXMLIMPORT_TEST(testTdf100830, "tdf100830.docx")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(30), getProperty<sal_Int16>(getShape(1), "FillTransparence"));
}
+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"));
+}
+
// tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index d69cf50d7af7..0cb770f3a77b 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>
@@ -2665,6 +2666,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 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 );
}
}