summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-03-06 09:48:54 +0100
committerAndras Timar <andras.timar@collabora.com>2014-03-10 09:23:58 -0500
commit487b0b2829b94213eed83350a4a3825871de6387 (patch)
tree58867ebdabc0b0b5354b5f30b92a69297f50f2bd
parente26f0c815cbb3ca2c912b9ed85470d7666564027 (diff)
cp#1000039 DOC import: ignore symbol charset of the symbol font
Otherwise characters unhandled by our OpenSymbol font (like Arabic 0-9 numbers) won't be rendered using an other font, as no other font provides the symbol charset. Do this in SwWW8ImplReader::GetFontParams(), where we already have font name -> font family mappings for a few well-known fonts. The DOCX filter does the same for quite some time, and that's how Arabic numbers in text using the Symbol font were rendered, instead of little rectangles. Change-Id: Ib794cac19ad7b073e39f3cbd7d4bad3994151c14 (cherry picked from commit 8556cd881270823865662e9a7700da58d11c2785) Reviewed-on: https://gerrit.libreoffice.org/8474 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
-rwxr-xr-xsw/qa/extras/ww8import/data/cp1000039.docbin0 -> 22016 bytes
-rw-r--r--sw/qa/extras/ww8import/ww8import.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx5
3 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8import/data/cp1000039.doc b/sw/qa/extras/ww8import/data/cp1000039.doc
new file mode 100755
index 000000000000..70cad3c244b9
--- /dev/null
+++ b/sw/qa/extras/ww8import/data/cp1000039.doc
Binary files differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index cc107e041ead..875c039bb15f 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -243,6 +243,12 @@ DECLARE_WW8IMPORT_TEST(testBnc821208, "bnc821208.doc")
CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE, ePropertyState);
}
+DECLARE_WW8IMPORT_TEST(testCp1000039, "cp1000039.doc")
+{
+ // This was RTL_TEXTENCODING_SYMBOL, causing "1" rendered as a placeholder rectangle.
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(RTL_TEXTENCODING_DONTKNOW), getProperty<sal_Int16>(getRun(getParagraph(1), 1), "CharFontCharSet"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 728384055919..685feae02244 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3396,6 +3396,11 @@ bool SwWW8ImplReader::GetFontParams( sal_uInt16 nFCode, FontFamily& reFamily,
reCharSet = rtl_getTextEncodingFromWindowsCharset( pF->chs );
}
+ // Make sure charset is not set in case of Symbol, otherwise in case a
+ // character is missing in our OpenSymbol, the character won't be replaced.
+ if (reCharSet == RTL_TEXTENCODING_SYMBOL && rName == "Symbol")
+ reCharSet = RTL_TEXTENCODING_DONTKNOW;
+
// make sure Font Family Code is set correctly
// at least for the most important fonts
// ( might be set wrong when Doc was not created by