Kaydet (Commit) 1c2f5d73 authored tarafından David Tardon's avatar David Tardon

more conversion to rtl::OUString

üst 3a88a060
...@@ -59,9 +59,9 @@ class WinSalInfoPrinter : public SalInfoPrinter ...@@ -59,9 +59,9 @@ class WinSalInfoPrinter : public SalInfoPrinter
{ {
public: public:
WinSalGraphics* mpGraphics; // current Printer graphics WinSalGraphics* mpGraphics; // current Printer graphics
XubString maDriverName; // printer driver name rtl::OUString maDriverName; // printer driver name
XubString maDeviceName; // printer device name rtl::OUString maDeviceName; // printer device name
XubString maPortName; // printer port name rtl::OUString maPortName; // printer port name
HDC mhDC; // printer hdc HDC mhDC; // printer hdc
sal_Bool mbGraphics; // is Graphics used sal_Bool mbGraphics; // is Graphics used
public: public:
......
...@@ -194,7 +194,7 @@ void WinSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) ...@@ -194,7 +194,7 @@ void WinSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
for ( i = 0; i < nInfoPrn4; i++ ) for ( i = 0; i < nInfoPrn4; i++ )
{ {
SalPrinterQueueInfo* pInfo = new SalPrinterQueueInfo; SalPrinterQueueInfo* pInfo = new SalPrinterQueueInfo;
pInfo->maPrinterName = UniString( reinterpret_cast< const sal_Unicode* >(pWinInfo4[i].pPrinterName) ); pInfo->maPrinterName = rtl::OUString( reinterpret_cast< const sal_Unicode* >(pWinInfo4[i].pPrinterName) );
pInfo->mnStatus = 0; pInfo->mnStatus = 0;
pInfo->mnJobs = 0; pInfo->mnJobs = 0;
pInfo->mpSysData = NULL; pInfo->mpSysData = NULL;
...@@ -297,8 +297,8 @@ static DWORD ImplDeviceCaps( WinSalInfoPrinter* pPrinter, WORD nCaps, ...@@ -297,8 +297,8 @@ static DWORD ImplDeviceCaps( WinSalInfoPrinter* pPrinter, WORD nCaps,
else else
pDevMode = SAL_DEVMODE_W( pSetupData ); pDevMode = SAL_DEVMODE_W( pSetupData );
return DeviceCapabilitiesW( reinterpret_cast<LPCWSTR>(pPrinter->maDeviceName.GetBuffer()), return DeviceCapabilitiesW( reinterpret_cast<LPCWSTR>(pPrinter->maDeviceName.getStr()),
reinterpret_cast<LPCWSTR>(pPrinter->maPortName.GetBuffer()), reinterpret_cast<LPCWSTR>(pPrinter->maPortName.getStr()),
nCaps, (LPWSTR)pOutput, pDevMode ); nCaps, (LPWSTR)pOutput, pDevMode );
} }
...@@ -330,7 +330,7 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter, ...@@ -330,7 +330,7 @@ static sal_Bool ImplTestSalJobSetup( WinSalInfoPrinter* pPrinter,
// #110800#, #111151#, #112381#, #i16580#, #i14173# and perhaps #112375# // #110800#, #111151#, #112381#, #i16580#, #i14173# and perhaps #112375#
ByteString aPrinterNameA= ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ); ByteString aPrinterNameA= ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE );
HANDLE hPrn; HANDLE hPrn;
LPWSTR pPrinterNameW = reinterpret_cast<LPWSTR>(const_cast<sal_Unicode*>(pPrinter->maDeviceName.GetBuffer())); LPWSTR pPrinterNameW = reinterpret_cast<LPWSTR>(const_cast<sal_Unicode*>(pPrinter->maDeviceName.getStr()));
if ( !OpenPrinterW( pPrinterNameW, &hPrn, NULL ) ) if ( !OpenPrinterW( pPrinterNameW, &hPrn, NULL ) )
return FALSE; return FALSE;
...@@ -396,7 +396,7 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup ...@@ -396,7 +396,7 @@ static sal_Bool ImplUpdateSalJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup
{ {
ByteString aPrinterNameA = ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE ); ByteString aPrinterNameA = ImplSalGetWinAnsiString( pPrinter->maDeviceName, TRUE );
HANDLE hPrn; HANDLE hPrn;
LPWSTR pPrinterNameW = reinterpret_cast<LPWSTR>(const_cast<sal_Unicode*>(pPrinter->maDeviceName.GetBuffer())); LPWSTR pPrinterNameW = reinterpret_cast<LPWSTR>(const_cast<sal_Unicode*>(pPrinter->maDeviceName.getStr()));
if ( !OpenPrinterW( pPrinterNameW, &hPrn, NULL ) ) if ( !OpenPrinterW( pPrinterNameW, &hPrn, NULL ) )
return FALSE; return FALSE;
// #131642# hPrn==HGDI_ERROR even though OpenPrinter() succeeded! // #131642# hPrn==HGDI_ERROR even though OpenPrinter() succeeded!
...@@ -1072,14 +1072,14 @@ static HDC ImplCreateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetup ...@@ -1072,14 +1072,14 @@ static HDC ImplCreateSalPrnIC( WinSalInfoPrinter* pPrinter, ImplJobSetup* pSetup
pDevMode = NULL; pDevMode = NULL;
// #95347 some buggy drivers (eg, OKI) write to those buffers in CreateIC, although declared const - so provide some space // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateIC, although declared const - so provide some space
// pl: does this hold true for Unicode functions ? // pl: does this hold true for Unicode functions ?
if( pPrinter->maDriverName.Len() > 2048 || pPrinter->maDeviceName.Len() > 2048 ) if( pPrinter->maDriverName.getLength() > 2048 || pPrinter->maDeviceName.getLength() > 2048 )
return 0; return 0;
sal_Unicode pDriverName[ 4096 ]; sal_Unicode pDriverName[ 4096 ];
sal_Unicode pDeviceName[ 4096 ]; sal_Unicode pDeviceName[ 4096 ];
rtl_copyMemory( pDriverName, pPrinter->maDriverName.GetBuffer(), pPrinter->maDriverName.Len()*sizeof(sal_Unicode)); rtl_copyMemory( pDriverName, pPrinter->maDriverName.getStr(), pPrinter->maDriverName.getLength()*sizeof(sal_Unicode));
memset( pDriverName+pPrinter->maDriverName.Len(), 0, 32 ); memset( pDriverName+pPrinter->maDriverName.getLength(), 0, 32 );
rtl_copyMemory( pDeviceName, pPrinter->maDeviceName.GetBuffer(), pPrinter->maDeviceName.Len()*sizeof(sal_Unicode)); rtl_copyMemory( pDeviceName, pPrinter->maDeviceName.getStr(), pPrinter->maDeviceName.getLength()*sizeof(sal_Unicode));
memset( pDeviceName+pPrinter->maDeviceName.Len(), 0, 32 ); memset( pDeviceName+pPrinter->maDeviceName.getLength(), 0, 32 );
hDC = ImplCreateICW_WithCatch( reinterpret_cast< LPWSTR >(pDriverName), hDC = ImplCreateICW_WithCatch( reinterpret_cast< LPWSTR >(pDriverName),
reinterpret_cast< LPCWSTR >(pDeviceName), reinterpret_cast< LPCWSTR >(pDeviceName),
pDevMode ); pDevMode );
...@@ -1134,8 +1134,8 @@ SalInfoPrinter* WinSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueIn ...@@ -1134,8 +1134,8 @@ SalInfoPrinter* WinSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueIn
pPrinter->maDriverName = pQueueInfo->maDriver; pPrinter->maDriverName = pQueueInfo->maDriver;
pPrinter->maDeviceName = pQueueInfo->maPrinterName; pPrinter->maDeviceName = pQueueInfo->maPrinterName;
pPrinter->maPortName = pQueueInfo->mpSysData ? pPrinter->maPortName = pQueueInfo->mpSysData ?
*(String*)(pQueueInfo->mpSysData) *pQueueInfo->mpSysData
: String(); : rtl::OUString();
// check if the provided setup data match the actual printer // check if the provided setup data match the actual printer
ImplTestSalJobSetup( pPrinter, pSetupData, TRUE ); ImplTestSalJobSetup( pPrinter, pSetupData, TRUE );
...@@ -1563,8 +1563,8 @@ sal_Bool WinSalPrinter::StartJob( const rtl::OUString* pFileName, ...@@ -1563,8 +1563,8 @@ sal_Bool WinSalPrinter::StartJob( const rtl::OUString* pFileName,
// #95347 some buggy drivers (eg, OKI) write to those buffers in CreateDC, although declared const - so provide some space // #95347 some buggy drivers (eg, OKI) write to those buffers in CreateDC, although declared const - so provide some space
sal_Unicode aDrvBuf[4096]; sal_Unicode aDrvBuf[4096];
sal_Unicode aDevBuf[4096]; sal_Unicode aDevBuf[4096];
rtl_copyMemory( aDrvBuf, mpInfoPrinter->maDriverName.GetBuffer(), (mpInfoPrinter->maDriverName.Len()+1)*sizeof(sal_Unicode)); rtl_copyMemory( aDrvBuf, mpInfoPrinter->maDriverName.getStr(), (mpInfoPrinter->maDriverName.getLength()+1)*sizeof(sal_Unicode));
rtl_copyMemory( aDevBuf, mpInfoPrinter->maDeviceName.GetBuffer(), (mpInfoPrinter->maDeviceName.Len()+1)*sizeof(sal_Unicode)); rtl_copyMemory( aDevBuf, mpInfoPrinter->maDeviceName.getStr(), (mpInfoPrinter->maDeviceName.getLength()+1)*sizeof(sal_Unicode));
hDC = CreateDCW( reinterpret_cast<LPCWSTR>(aDrvBuf), hDC = CreateDCW( reinterpret_cast<LPCWSTR>(aDrvBuf),
reinterpret_cast<LPCWSTR>(aDevBuf), reinterpret_cast<LPCWSTR>(aDevBuf),
NULL, NULL,
...@@ -1619,7 +1619,7 @@ sal_Bool WinSalPrinter::StartJob( const rtl::OUString* pFileName, ...@@ -1619,7 +1619,7 @@ sal_Bool WinSalPrinter::StartJob( const rtl::OUString* pFileName,
// bring up a file choser if printing to file port but no file name given // bring up a file choser if printing to file port but no file name given
OUString aOutFileName; OUString aOutFileName;
if( mpInfoPrinter->maPortName.EqualsIgnoreCaseAscii( "FILE:" ) && !(pFileName && !pFileName->isEmpty()) ) if( mpInfoPrinter->maPortName.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "FILE:" ) ) && !(pFileName && !pFileName->isEmpty()) )
{ {
uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
......
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