implemented IcuFontFromServerFont::getFontTable(LETag,size_t&)

so that ICU versions trying to call
LEFontInstance::getFontTable(LETag,size_t&) actually call it instead of
IcuFontFromServerFont::getFontTable(LETag)

See http://site.icu-project.org/download/51#TOC-Known-Issues
"NOTE: Applications must implement LEFontInstance::getFontTable(LETag,
size_t &length)  in their LEFontInstance subclasses, so that ICU can
properly bounds-check font tables."

See also https://ssl.icu-project.org/trac/ticket/10107

Change-Id: Ic20b7e8dda4e84734eb6de0ccba82b0dea481d55
This commit is contained in:
Eike Rathke 2013-05-02 21:54:52 +02:00
parent 7de7267f4c
commit 428bde3591

View file

@ -556,6 +556,7 @@ public:
{}
using LEFontInstance::getFontTable;
virtual const void* getFontTable(LETag tableTag, size_t &length) const;
virtual const void* getFontTable(LETag tableTag) const;
virtual le_int32 getUnitsPerEM() const;
virtual float getXPixelsPerEm() const;
@ -577,7 +578,7 @@ public:
// -----------------------------------------------------------------------
const void* IcuFontFromServerFont::getFontTable( LETag nICUTableTag ) const
const void* IcuFontFromServerFont::getFontTable( LETag nICUTableTag, size_t & rLength ) const
{
char pTagName[5];
pTagName[0] = (char)(nICUTableTag >> 24);
@ -586,9 +587,10 @@ const void* IcuFontFromServerFont::getFontTable( LETag nICUTableTag ) const
pTagName[3] = (char)(nICUTableTag);
pTagName[4] = 0;
sal_uLong nLength;
sal_uLong nLength = 0;
const unsigned char* pBuffer = mrServerFont.GetTable( pTagName, &nLength );
SAL_INFO("vcl", "IcuGetTable(\"" << pTagName << "\") => " << pBuffer);
rLength = static_cast<size_t>(nLength);
SAL_INFO("vcl", "IcuGetTable(\"" << pTagName << "\") => " << pBuffer << ", len=" << rLength);
SAL_INFO(
"vcl",
"font( h=" << mrServerFont.GetFontSelData().mnHeight << ", \""
@ -596,6 +598,12 @@ const void* IcuFontFromServerFont::getFontTable( LETag nICUTableTag ) const
return pBuffer;
}
const void* IcuFontFromServerFont::getFontTable( LETag nICUTableTag ) const
{
size_t nLength = 0;
return getFontTable( nICUTableTag, nLength);
}
// -----------------------------------------------------------------------
le_int32 IcuFontFromServerFont::getUnitsPerEM() const