Kaydet (Commit) 8556cd88 authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst 686677d2
This diff was suppressed by a .gitattributes entry.
......@@ -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();
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment