Kaydet (Commit) 47f218fc authored tarafından Luboš Luňák's avatar Luboš Luňák

hack for reading properly textencoding for opensymbol from old LO

Which did it because of bullet font not having it correctly
(fixed in 44c133ef).

Change-Id: I6992de03816661cf6970140eb35816e26cf0e612
üst 9e851b69
......@@ -97,6 +97,7 @@ UNOTOOLS_DLLPUBLIC void GetEnglishSearchFontName( OUString& rName );
@return true if this is Star|Open Symbol
*/
// FIXME It's quite possible that code using this should instead check for RTL_TEXTENCODING_SYMBOL.
UNOTOOLS_DLLPUBLIC bool IsStarSymbol(const OUString &rFontName);
#endif
......
......@@ -25,6 +25,7 @@
#include <stdio.h>
#include <rtl/tencinfo.h>
#include <vcl/embeddedfontshelper.hxx>
#include <unotools/fontdefs.hxx>
#include "dmapperLoggers.hxx"
......@@ -100,13 +101,20 @@ void FontTable::lcl_attribute(Id Name, Value & val)
case NS_ooxml::LN_CT_Charset_val:
// w:characterSet has higher priority, set only if that one is not set
if( m_pImpl->pCurrentEntry->nTextEncoding == RTL_TEXTENCODING_DONTKNOW )
{
m_pImpl->pCurrentEntry->nTextEncoding = rtl_getTextEncodingFromWindowsCharset( nIntValue );
if( IsStarSymbol( m_pImpl->pCurrentEntry->sFontName ))
m_pImpl->pCurrentEntry->nTextEncoding = RTL_TEXTENCODING_SYMBOL;
}
break;
case NS_ooxml::LN_CT_Charset_characterSet:
{
OString tmp;
sValue.convertToString( &tmp, RTL_TEXTENCODING_ASCII_US, OUSTRING_TO_OSTRING_CVTFLAGS );
m_pImpl->pCurrentEntry->nTextEncoding = rtl_getTextEncodingFromMimeCharset( tmp.getStr() );
// Older LO versions used to write incorrect character set for OpenSymbol, fix.
if( IsStarSymbol( m_pImpl->pCurrentEntry->sFontName ))
m_pImpl->pCurrentEntry->nTextEncoding = RTL_TEXTENCODING_SYMBOL;
break;
}
default:
......
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