diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-07-12 23:13:10 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-07-16 10:03:35 +0000 |
commit | bf352cd0ed5a94859f9163fcaa2089a93c9e938e (patch) | |
tree | 7b42131d4db1e140ace1fbf7902fca91831c57a7 | |
parent | 2ab2d6b6f8930459e992aa4d856ce8cb59f2b87b (diff) |
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 9e310cc32923ceb4b18d97ce68d54a339b935f01)
Change-Id: I1603e62cf18f353f3d7de322b9111a173dc6b225
(cherry picked from commit 82f742f65d35896c69be38fa3b1c78a22226f71c)
Reviewed-on: https://gerrit.libreoffice.org/4875
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 6089121ebd075bb6422d33d6bff69dff2e88efb2)
Reviewed-on: https://gerrit.libreoffice.org/4932
Reviewed-by: David Tardon <dtardon@redhat.com>
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Tested-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r-- | vcl/inc/win/saldata.hxx | 2 | ||||
-rw-r--r-- | vcl/win/source/app/saldata.cxx | 5 | ||||
-rw-r--r-- | vcl/win/source/gdi/salprn.cxx | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx index 436144833edb..fdf2fafc0351 100644 --- a/vcl/inc/win/saldata.hxx +++ b/vcl/inc/win/saldata.hxx @@ -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 ) diff --git a/vcl/win/source/app/saldata.cxx b/vcl/win/source/app/saldata.cxx index 2a3ea0994f80..fc9967459dda 100644 --- a/vcl/win/source/app/saldata.cxx +++ b/vcl/win/source/app/saldata.cxx @@ -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 ); diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx index 113fb1887d46..94af77c514dc 100644 --- a/vcl/win/source/gdi/salprn.cxx +++ b/vcl/win/source/gdi/salprn.cxx @@ -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(); |