Kaydet (Commit) 82f742f6 authored tarafından Michael Stahl's avatar Michael Stahl

fdo#66811: vcl: fix broken OUString with length STRING_LEN

ImplSalGetUniString was wrongly converted and constructs OUString with
invalid length in WinSalGraphics::CreateFontSubset; this is then
implicitly converted to an empty UniString so the font names are
missing in the PDF files generated on Windows.

(regression from 9e310cc3)

Change-Id: I1603e62cf18f353f3d7de322b9111a173dc6b225
üst d7d37d21
......@@ -196,7 +196,7 @@ void ImplSalPostDispatchMsg( MSG* pMsg, LRESULT nDispatchResult );
void ImplSalLogFontToFontW( HDC hDC, const LOGFONTW& rLogFont, Font& rFont );
rtl_TextEncoding ImplSalGetSystemEncoding();
OUString ImplSalGetUniString( const sal_Char* pStr, xub_StrLen nLen = STRING_LEN );
OUString ImplSalGetUniString(const sal_Char* pStr, sal_Int32 nLen = -1);
int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 );
#define SAL_FRAME_WNDEXTRA sizeof( DWORD )
......
......@@ -44,9 +44,10 @@ rtl_TextEncoding ImplSalGetSystemEncoding()
// -----------------------------------------------------------------------
OUString ImplSalGetUniString( const sal_Char* pStr, xub_StrLen nLen )
OUString ImplSalGetUniString(const sal_Char* pStr, sal_Int32 const nLen)
{
return OUString( pStr, nLen, ImplSalGetSystemEncoding(),
return OUString( pStr, (-1 == nLen) ? strlen(pStr) : nLen,
ImplSalGetSystemEncoding(),
RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_DEFAULT |
RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |
RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT );
......
......@@ -266,7 +266,7 @@ OUString WinSalInstance::GetDefaultPrinter()
char* pTmp = pBuf;
while ( *pTmp && (*pTmp != ',') )
pTmp++;
return ImplSalGetUniString( pBuf, (xub_StrLen)(pTmp-pBuf) );
return ImplSalGetUniString( pBuf, static_cast<sal_Int32>(pTmp-pBuf) );
}
else
return OUString();
......
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