Kaydet (Commit) 4bd28f79 authored tarafından Thomas Arnhold's avatar Thomas Arnhold

XubString to OUString

Change-Id: Ia7514abaa494a367d51db9d9990cd94cff6ed503
Reviewed-on: https://gerrit.libreoffice.org/5802Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarLibreOffice gerrit bot <gerrit@libreoffice.org>
üst 3f2774c7
...@@ -200,7 +200,7 @@ void WinSalInstance::GetPrinterQueueState( SalPrinterQueueInfo* pInfo ) ...@@ -200,7 +200,7 @@ void WinSalInstance::GetPrinterQueueState( SalPrinterQueueInfo* pInfo )
{ {
if( pWinInfo2->pDriverName ) if( pWinInfo2->pDriverName )
pInfo->maDriver = OUString( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pDriverName) ); pInfo->maDriver = OUString( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pDriverName) );
XubString aPortName; OUString aPortName;
if ( pWinInfo2->pPortName ) if ( pWinInfo2->pPortName )
aPortName = OUString( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pPortName) ); aPortName = OUString( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pPortName) );
// pLocation can be 0 (the Windows docu doesn't describe this) // pLocation can be 0 (the Windows docu doesn't describe this)
...@@ -235,13 +235,13 @@ OUString WinSalInstance::GetDefaultPrinter() ...@@ -235,13 +235,13 @@ OUString WinSalInstance::GetDefaultPrinter()
if( nChars ) if( nChars )
{ {
LPWSTR pStr = (LPWSTR)rtl_allocateMemory(nChars*sizeof(WCHAR)); LPWSTR pStr = (LPWSTR)rtl_allocateMemory(nChars*sizeof(WCHAR));
XubString aDefPrt; OUString aDefPrt;
if( GetDefaultPrinterW( pStr, &nChars ) ) if( GetDefaultPrinterW( pStr, &nChars ) )
{ {
aDefPrt = reinterpret_cast<sal_Unicode* >(pStr); aDefPrt = OUString(reinterpret_cast<sal_Unicode* >(pStr));
} }
rtl_freeMemory( pStr ); rtl_freeMemory( pStr );
if( aDefPrt.Len() ) if( !aDefPrt.isEmpty() )
return aDefPrt; return aDefPrt;
} }
...@@ -1231,7 +1231,7 @@ sal_uLong WinSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pSetupData ) ...@@ -1231,7 +1231,7 @@ sal_uLong WinSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pSetupData )
OUString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin ) OUString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, sal_uLong nPaperBin )
{ {
XubString aPaperBinName; OUString aPaperBinName;
DWORD nBins = ImplDeviceCaps( this, DC_BINNAMES, NULL, pSetupData ); DWORD nBins = ImplDeviceCaps( this, DC_BINNAMES, NULL, pSetupData );
if ( (nPaperBin < nBins) && (nBins != GDI_ERROR) ) if ( (nPaperBin < nBins) && (nBins != GDI_ERROR) )
...@@ -1239,7 +1239,7 @@ OUString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, sal ...@@ -1239,7 +1239,7 @@ OUString WinSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pSetupData, sal
sal_Unicode* pBuffer = new sal_Unicode[nBins*24]; sal_Unicode* pBuffer = new sal_Unicode[nBins*24];
DWORD nRet = ImplDeviceCaps( this, DC_BINNAMES, (BYTE*)pBuffer, pSetupData ); DWORD nRet = ImplDeviceCaps( this, DC_BINNAMES, (BYTE*)pBuffer, pSetupData );
if ( nRet && (nRet != GDI_ERROR) ) if ( nRet && (nRet != GDI_ERROR) )
aPaperBinName = pBuffer + (nPaperBin*24); aPaperBinName = OUString( pBuffer + (nPaperBin*24) );
delete [] pBuffer; delete [] pBuffer;
} }
......
...@@ -2904,11 +2904,11 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) ...@@ -2904,11 +2904,11 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
// is to wide for the dialogs // is to wide for the dialogs
if ( rSettings.GetLanguageTag().getLanguageType() == LANGUAGE_RUSSIAN ) if ( rSettings.GetLanguageTag().getLanguageType() == LANGUAGE_RUSSIAN )
{ {
XubString aFontName = aAppFont.GetName(); OUString aFontName = aAppFont.GetName();
XubString aFirstName = aFontName.GetToken( 0, ';' ); OUString aFirstName = aFontName.getToken( 0, ';' );
if ( aFirstName.EqualsIgnoreCaseAscii( "MS Sans Serif" ) ) if ( aFirstName.equalsIgnoreAsciiCase( "MS Sans Serif" ) )
{ {
aFontName.InsertAscii( "Arial;", 0 ); aFontName = "Arial;" + aFontName;
aAppFont.SetName( aFontName ); aAppFont.SetName( aFontName );
} }
} }
......
...@@ -328,14 +328,13 @@ void WinSalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const OU ...@@ -328,14 +328,13 @@ void WinSalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const OU
#endif #endif
// combine text and accelerator text // combine text and accelerator text
XubString aStr( pWItem->mText ); OUString aStr( pWItem->mText );
if( pWItem->mAccelText.getLength() ) if( pWItem->mAccelText.getLength() )
{ {
aStr.AppendAscii("\t"); aStr += "\t" + pWItem->mAccelText;
aStr.Append( pWItem->mAccelText );
} }
pWItem->mInfo.dwTypeData = (LPWSTR) aStr.GetBuffer(); pWItem->mInfo.dwTypeData = (LPWSTR) aStr.getStr();
pWItem->mInfo.cch = aStr.Len(); pWItem->mInfo.cch = aStr.getLength();
if(!::SetMenuItemInfoW( mhMenu, nPos, TRUE, &pWItem->mInfo )) if(!::SetMenuItemInfoW( mhMenu, nPos, TRUE, &pWItem->mInfo ))
myerr = GetLastError(); myerr = GetLastError();
...@@ -357,14 +356,13 @@ void WinSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const ...@@ -357,14 +356,13 @@ void WinSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const
pWItem->mInfo.fType |= MFT_OWNERDRAW; pWItem->mInfo.fType |= MFT_OWNERDRAW;
#endif #endif
// combine text and accelerator text // combine text and accelerator text
XubString aStr( pWItem->mText ); OUString aStr( pWItem->mText );
if( pWItem->mAccelText.getLength() ) if( pWItem->mAccelText.getLength() )
{ {
aStr.AppendAscii("\t"); aStr += "\t" + pWItem->mAccelText;
aStr.Append( pWItem->mAccelText );
} }
pWItem->mInfo.dwTypeData = (LPWSTR) aStr.GetBuffer(); pWItem->mInfo.dwTypeData = (LPWSTR) aStr.getStr();
pWItem->mInfo.cch = aStr.Len(); pWItem->mInfo.cch = aStr.getLength();
if(!::SetMenuItemInfoW( mhMenu, nPos, TRUE, &pWItem->mInfo )) if(!::SetMenuItemInfoW( mhMenu, nPos, TRUE, &pWItem->mInfo ))
myerr = GetLastError(); myerr = GetLastError();
......
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