[Libreoffice-commits] core.git: sw/qa sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Thu Mar 6 01:03:18 PST 2014
sw/qa/extras/ww8import/data/cp1000039.doc |binary
sw/qa/extras/ww8import/ww8import.cxx | 6 ++++++
sw/source/filter/ww8/ww8par6.cxx | 5 +++++
3 files changed, 11 insertions(+)
New commits:
commit 8556cd881270823865662e9a7700da58d11c2785
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Mar 6 09:48:54 2014 +0100
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
diff --git a/sw/qa/extras/ww8import/data/cp1000039.doc b/sw/qa/extras/ww8import/data/cp1000039.doc
new file mode 100755
index 0000000..70cad3c
Binary files /dev/null and b/sw/qa/extras/ww8import/data/cp1000039.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index cc107e0..875c039 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 7815f36..0aa98a4 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3397,6 +3397,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
More information about the Libreoffice-commits
mailing list