Kaydet (Commit) 0f3ccde7 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:stringconstant: OUStringBuffer: appendAscii -> append

Change-Id: I83f45260158f5282b857458046d2e324be85a7b5
üst 33068078
...@@ -119,7 +119,7 @@ void psp::getPrinterPathList( std::list< OUString >& rPathList, const char* pSub ...@@ -119,7 +119,7 @@ void psp::getPrinterPathList( std::list< OUString >& rPathList, const char* pSub
aPathBuffer.append( getOfficePath( psp::InstallationRootPath ) ); aPathBuffer.append( getOfficePath( psp::InstallationRootPath ) );
if( !aPathBuffer.isEmpty() ) if( !aPathBuffer.isEmpty() )
{ {
aPathBuffer.appendAscii( "/" LIBO_SHARE_FOLDER "/psprint" ); aPathBuffer.append( "/" LIBO_SHARE_FOLDER "/psprint" );
if( pSubDir ) if( pSubDir )
{ {
aPathBuffer.append( '/' ); aPathBuffer.append( '/' );
...@@ -131,7 +131,7 @@ void psp::getPrinterPathList( std::list< OUString >& rPathList, const char* pSub ...@@ -131,7 +131,7 @@ void psp::getPrinterPathList( std::list< OUString >& rPathList, const char* pSub
aPathBuffer.append( getOfficePath( psp::UserPath ) ); aPathBuffer.append( getOfficePath( psp::UserPath ) );
if( !aPathBuffer.isEmpty() ) if( !aPathBuffer.isEmpty() )
{ {
aPathBuffer.appendAscii( "/user/psprint" ); aPathBuffer.append( "/user/psprint" );
if( pSubDir ) if( pSubDir )
{ {
aPathBuffer.append( '/' ); aPathBuffer.append( '/' );
...@@ -201,7 +201,7 @@ OUString psp::getFontPath() ...@@ -201,7 +201,7 @@ OUString psp::getFontPath()
// #i53530# Path from CustomDataUrl will completely // #i53530# Path from CustomDataUrl will completely
// replace net and user paths if the path exists // replace net and user paths if the path exists
aPathBuffer.append(aConfigPath); aPathBuffer.append(aConfigPath);
aPathBuffer.appendAscii("/" LIBO_SHARE_FOLDER "/fonts"); aPathBuffer.append("/" LIBO_SHARE_FOLDER "/fonts");
// check existence of config path // check existence of config path
struct stat aStat; struct stat aStat;
if( 0 != stat( OUStringToOString( aPathBuffer.makeStringAndClear(), osl_getThreadTextEncoding() ).getStr(), &aStat ) if( 0 != stat( OUStringToOString( aPathBuffer.makeStringAndClear(), osl_getThreadTextEncoding() ).getStr(), &aStat )
...@@ -210,7 +210,7 @@ OUString psp::getFontPath() ...@@ -210,7 +210,7 @@ OUString psp::getFontPath()
else else
{ {
aPathBuffer.append(aConfigPath); aPathBuffer.append(aConfigPath);
aPathBuffer.appendAscii("/" LIBO_SHARE_FOLDER "/fonts"); aPathBuffer.append("/" LIBO_SHARE_FOLDER "/fonts");
} }
} }
if( aConfigPath.isEmpty() ) if( aConfigPath.isEmpty() )
...@@ -218,14 +218,14 @@ OUString psp::getFontPath() ...@@ -218,14 +218,14 @@ OUString psp::getFontPath()
if( !aInstallationRootPath.isEmpty() ) if( !aInstallationRootPath.isEmpty() )
{ {
aPathBuffer.append( aInstallationRootPath ); aPathBuffer.append( aInstallationRootPath );
aPathBuffer.appendAscii( "/" LIBO_SHARE_FOLDER "/fonts/truetype;"); aPathBuffer.append( "/" LIBO_SHARE_FOLDER "/fonts/truetype;");
aPathBuffer.append( aInstallationRootPath ); aPathBuffer.append( aInstallationRootPath );
aPathBuffer.appendAscii( "/" LIBO_SHARE_FOLDER "/fonts/type1;" ); aPathBuffer.append( "/" LIBO_SHARE_FOLDER "/fonts/type1;" );
} }
if( !aUserPath.isEmpty() ) if( !aUserPath.isEmpty() )
{ {
aPathBuffer.append( aUserPath ); aPathBuffer.append( aUserPath );
aPathBuffer.appendAscii( "/user/fonts" ); aPathBuffer.append( "/user/fonts" );
} }
} }
......
...@@ -919,7 +919,7 @@ bool PspSalPrinter::StartJob( ...@@ -919,7 +919,7 @@ bool PspSalPrinter::StartJob(
OUStringBuffer aFileName( getPdfDir( rInfo ) ); OUStringBuffer aFileName( getPdfDir( rInfo ) );
aFileName.append( '/' ); aFileName.append( '/' );
aFileName.append( rJobName ); aFileName.append( rJobName );
aFileName.appendAscii( ".pdf" ); aFileName.append( ".pdf" );
m_aFileName = aFileName.makeStringAndClear(); m_aFileName = aFileName.makeStringAndClear();
} }
break; break;
......
...@@ -238,7 +238,7 @@ createSpoolDir () ...@@ -238,7 +238,7 @@ createSpoolDir ()
{ {
OUStringBuffer aDir( aTmpDir.getLength() + 16 ); OUStringBuffer aDir( aTmpDir.getLength() + 16 );
aDir.append( aTmpDir ); aDir.append( aTmpDir );
aDir.appendAscii( "/psp" ); aDir.append( "/psp" );
aDir.append(nRand); aDir.append(nRand);
OUString aResult = aDir.makeStringAndClear(); OUString aResult = aDir.makeStringAndClear();
if( osl::Directory::create( aResult ) == osl::FileBase::E_None ) if( osl::Directory::create( aResult ) == osl::FileBase::E_None )
......
...@@ -324,7 +324,7 @@ void CUPSManager::initialize() ...@@ -324,7 +324,7 @@ void CUPSManager::initialize()
} }
OUStringBuffer aBuf( 256 ); OUStringBuffer aBuf( 256 );
aBuf.appendAscii( "CUPS:" ); aBuf.append( "CUPS:" );
aBuf.append( aPrinterName ); aBuf.append( aPrinterName );
// note: the parser that goes with the PrinterInfo // note: the parser that goes with the PrinterInfo
// is created implicitly by the JobData::operator=() // is created implicitly by the JobData::operator=()
......
...@@ -48,7 +48,7 @@ namespace { ...@@ -48,7 +48,7 @@ namespace {
if ( pUnicode != pEnd ) if ( pUnicode != pEnd )
{ {
if ( *pUnicode == 'n' ) if ( *pUnicode == 'n' )
aBuffer.appendAscii( "\n", 1 ); aBuffer.append( "\n" );
else else
aBuffer.append( *pUnicode ); aBuffer.append( *pUnicode );
} }
......
...@@ -82,21 +82,21 @@ void appendEscaped( OUStringBuffer &rBuffer, const OUString &rString ) ...@@ -82,21 +82,21 @@ void appendEscaped( OUStringBuffer &rBuffer, const OUString &rString )
const sal_Unicode *pUnicode = rString.getStr(); const sal_Unicode *pUnicode = rString.getStr();
const sal_Unicode *pEnd = pUnicode + rString.getLength(); const sal_Unicode *pEnd = pUnicode + rString.getLength();
rBuffer.appendAscii( "\"" , 1 ); rBuffer.append( "\"" );
for ( ; pUnicode != pEnd; ++pUnicode ) for ( ; pUnicode != pEnd; ++pUnicode )
{ {
if ( *pUnicode == '\\' ) if ( *pUnicode == '\\' )
rBuffer.appendAscii( "\\\\", 2 ); rBuffer.append( "\\\\" );
else if ( *pUnicode == '"' ) else if ( *pUnicode == '"' )
rBuffer.appendAscii( "\\\"", 2 ); rBuffer.append( "\\\"" );
else if ( *pUnicode == '\n' ) else if ( *pUnicode == '\n' )
rBuffer.appendAscii( "\\n", 2 ); rBuffer.append( "\\n" );
else else
rBuffer.append( *pUnicode ); rBuffer.append( *pUnicode );
} }
rBuffer.appendAscii( "\"", 1 ); rBuffer.append( "\"" );
} }
bool controlIdInfo( sal_Int16 nControlId, OUString &rType, sal_Int32 &rTitleId ) bool controlIdInfo( sal_Int16 nControlId, OUString &rType, sal_Int32 &rTitleId )
...@@ -258,7 +258,7 @@ void SAL_CALL UnxFilePicker::setTitle( const OUString &rTitle ) ...@@ -258,7 +258,7 @@ void SAL_CALL UnxFilePicker::setTitle( const OUString &rTitle )
OUStringBuffer aBuffer( 1024 ); OUStringBuffer aBuffer( 1024 );
aBuffer.appendAscii( "setTitle " ); aBuffer.append( "setTitle " );
appendEscaped( aBuffer, rTitle ); appendEscaped( aBuffer, rTitle );
sendCommand( aBuffer.makeStringAndClear() ); sendCommand( aBuffer.makeStringAndClear() );
...@@ -302,7 +302,7 @@ void SAL_CALL UnxFilePicker::setDefaultName( const OUString &rName ) ...@@ -302,7 +302,7 @@ void SAL_CALL UnxFilePicker::setDefaultName( const OUString &rName )
OUStringBuffer aBuffer( 1024 ); OUStringBuffer aBuffer( 1024 );
aBuffer.appendAscii( "setDefaultName " ); aBuffer.append( "setDefaultName " );
appendEscaped( aBuffer, rName ); appendEscaped( aBuffer, rName );
sendCommand( aBuffer.makeStringAndClear() ); sendCommand( aBuffer.makeStringAndClear() );
...@@ -316,7 +316,7 @@ void SAL_CALL UnxFilePicker::setDisplayDirectory( const OUString &rDirectory ) ...@@ -316,7 +316,7 @@ void SAL_CALL UnxFilePicker::setDisplayDirectory( const OUString &rDirectory )
OUStringBuffer aBuffer( 1024 ); OUStringBuffer aBuffer( 1024 );
aBuffer.appendAscii( "setDirectory " ); aBuffer.append( "setDirectory " );
appendEscaped( aBuffer, rDirectory ); appendEscaped( aBuffer, rDirectory );
sendCommand( aBuffer.makeStringAndClear() ); sendCommand( aBuffer.makeStringAndClear() );
...@@ -354,9 +354,9 @@ void SAL_CALL UnxFilePicker::appendFilter( const OUString &rTitle, const OUStrin ...@@ -354,9 +354,9 @@ void SAL_CALL UnxFilePicker::appendFilter( const OUString &rTitle, const OUStrin
OUStringBuffer aBuffer( 1024 ); OUStringBuffer aBuffer( 1024 );
aBuffer.appendAscii( "appendFilter " ); aBuffer.append( "appendFilter " );
appendEscaped( aBuffer, rTitle ); appendEscaped( aBuffer, rTitle );
aBuffer.appendAscii( " ", 1 ); aBuffer.append( " " );
appendEscaped( aBuffer, rFilter ); appendEscaped( aBuffer, rFilter );
sendCommand( aBuffer.makeStringAndClear() ); sendCommand( aBuffer.makeStringAndClear() );
...@@ -370,7 +370,7 @@ void SAL_CALL UnxFilePicker::setCurrentFilter( const OUString &rTitle ) ...@@ -370,7 +370,7 @@ void SAL_CALL UnxFilePicker::setCurrentFilter( const OUString &rTitle )
OUStringBuffer aBuffer( 1024 ); OUStringBuffer aBuffer( 1024 );
aBuffer.appendAscii( "setCurrentFilter " ); aBuffer.append( "setCurrentFilter " );
appendEscaped( aBuffer, rTitle ); appendEscaped( aBuffer, rTitle );
sendCommand( aBuffer.makeStringAndClear() ); sendCommand( aBuffer.makeStringAndClear() );
...@@ -396,16 +396,16 @@ void SAL_CALL UnxFilePicker::appendFilterGroup( const OUString &rGroupTitle, con ...@@ -396,16 +396,16 @@ void SAL_CALL UnxFilePicker::appendFilterGroup( const OUString &rGroupTitle, con
OUStringBuffer aBuffer( 1024 ); OUStringBuffer aBuffer( 1024 );
aBuffer.appendAscii( "appendFilterGroup " ); aBuffer.append( "appendFilterGroup " );
appendEscaped( aBuffer, rGroupTitle ); appendEscaped( aBuffer, rGroupTitle );
for ( sal_Int32 i = 0; i < rFilters.getLength(); ++i ) for ( sal_Int32 i = 0; i < rFilters.getLength(); ++i )
{ {
beans::StringPair aPair = rFilters[i]; beans::StringPair aPair = rFilters[i];
aBuffer.appendAscii( " ", 1 ); aBuffer.append( " " );
appendEscaped( aBuffer, aPair.First ); appendEscaped( aBuffer, aPair.First );
aBuffer.appendAscii( " ", 1 ); aBuffer.append( " " );
appendEscaped( aBuffer, aPair.Second ); appendEscaped( aBuffer, aPair.Second );
} }
...@@ -426,18 +426,18 @@ void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlA ...@@ -426,18 +426,18 @@ void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlA
{ {
OUStringBuffer aBuffer( 1024 ); OUStringBuffer aBuffer( 1024 );
aBuffer.appendAscii( "setValue " ); aBuffer.append( "setValue " );
aBuffer.append( static_cast< sal_Int32 >( nControlId ) ); aBuffer.append( static_cast< sal_Int32 >( nControlId ) );
aBuffer.appendAscii( " ", 1 ); aBuffer.append( " " );
aBuffer.append( aAction ); aBuffer.append( aAction );
if ( aType == "checkbox" ) if ( aType == "checkbox" )
{ {
bool bControlValue; bool bControlValue;
if ( ( rValue >>= bControlValue ) && bControlValue ) if ( ( rValue >>= bControlValue ) && bControlValue )
aBuffer.appendAscii( " true" ); aBuffer.append( " true" );
else else
aBuffer.appendAscii( " false" ); aBuffer.append( " false" );
} }
else if ( aType == "listbox" ) else if ( aType == "listbox" )
{ {
...@@ -449,7 +449,7 @@ void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlA ...@@ -449,7 +449,7 @@ void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlA
OUString aString; OUString aString;
if ( rValue >>= aString ) if ( rValue >>= aString )
{ {
aBuffer.appendAscii( " ", 1 ); aBuffer.append( " " );
appendEscaped( aBuffer, aString ); appendEscaped( aBuffer, aString );
} }
} }
...@@ -462,7 +462,7 @@ void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlA ...@@ -462,7 +462,7 @@ void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlA
{ {
for ( sal_Int32 nIdx = 0; nIdx < aSequence.getLength(); ++nIdx ) for ( sal_Int32 nIdx = 0; nIdx < aSequence.getLength(); ++nIdx )
{ {
aBuffer.appendAscii( " ", 1 ); aBuffer.append( " " );
appendEscaped( aBuffer, aSequence[nIdx] ); appendEscaped( aBuffer, aSequence[nIdx] );
} }
...@@ -476,7 +476,7 @@ void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlA ...@@ -476,7 +476,7 @@ void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlA
sal_Int32 nInt; sal_Int32 nInt;
if ( rValue >>= nInt ) if ( rValue >>= nInt )
{ {
aBuffer.appendAscii( " ", 1 ); aBuffer.append( " " );
aBuffer.append( nInt ); aBuffer.append( nInt );
} }
} }
...@@ -505,9 +505,9 @@ uno::Any SAL_CALL UnxFilePicker::getValue( sal_Int16 nControlId, sal_Int16 nCont ...@@ -505,9 +505,9 @@ uno::Any SAL_CALL UnxFilePicker::getValue( sal_Int16 nControlId, sal_Int16 nCont
{ {
OUStringBuffer aBuffer( 1024 ); OUStringBuffer aBuffer( 1024 );
aBuffer.appendAscii( "getValue " ); aBuffer.append( "getValue " );
aBuffer.append( static_cast< sal_Int32 >( nControlId ) ); aBuffer.append( static_cast< sal_Int32 >( nControlId ) );
aBuffer.appendAscii( " ", 1 ); aBuffer.append( " " );
aBuffer.append( aAction ); aBuffer.append( aAction );
sendCommand( aBuffer.makeStringAndClear(), sendCommand( aBuffer.makeStringAndClear(),
...@@ -527,7 +527,7 @@ void SAL_CALL UnxFilePicker::enableControl( sal_Int16 nControlId, sal_Bool bEnab ...@@ -527,7 +527,7 @@ void SAL_CALL UnxFilePicker::enableControl( sal_Int16 nControlId, sal_Bool bEnab
OUStringBuffer aBuffer( 1024 ); OUStringBuffer aBuffer( 1024 );
aBuffer.appendAscii( "enableControl " ); aBuffer.append( "enableControl " );
aBuffer.append( static_cast< sal_Int32 >( nControlId ) ); aBuffer.append( static_cast< sal_Int32 >( nControlId ) );
aBuffer.appendAscii( bEnable? " true": " false" ); aBuffer.appendAscii( bEnable? " true": " false" );
...@@ -542,9 +542,9 @@ void SAL_CALL UnxFilePicker::setLabel( sal_Int16 nControlId, const OUString &rLa ...@@ -542,9 +542,9 @@ void SAL_CALL UnxFilePicker::setLabel( sal_Int16 nControlId, const OUString &rLa
OUStringBuffer aBuffer( 1024 ); OUStringBuffer aBuffer( 1024 );
aBuffer.appendAscii( "setLabel " ); aBuffer.append( "setLabel " );
aBuffer.append( static_cast< sal_Int32 >( nControlId ) ); aBuffer.append( static_cast< sal_Int32 >( nControlId ) );
aBuffer.appendAscii( " ", 1 ); aBuffer.append( " " );
appendEscaped( aBuffer, rLabel ); appendEscaped( aBuffer, rLabel );
sendCommand( aBuffer.makeStringAndClear() ); sendCommand( aBuffer.makeStringAndClear() );
...@@ -902,11 +902,11 @@ void UnxFilePicker::sendAppendControlCommand( sal_Int16 nControlId ) ...@@ -902,11 +902,11 @@ void UnxFilePicker::sendAppendControlCommand( sal_Int16 nControlId )
{ {
OUStringBuffer aBuffer( 1024 ); OUStringBuffer aBuffer( 1024 );
aBuffer.appendAscii( "appendControl " ); aBuffer.append( "appendControl " );
aBuffer.append( static_cast< sal_Int32 >( nControlId ) ); aBuffer.append( static_cast< sal_Int32 >( nControlId ) );
aBuffer.appendAscii( " ", 1 ); aBuffer.append( " " );
appendEscaped( aBuffer, aType ); appendEscaped( aBuffer, aType );
aBuffer.appendAscii( " ", 1 ); aBuffer.append( " " );
appendEscaped( aBuffer, m_pResMgr? ResId(nTitleId, *m_pResMgr).toString(): OUString() ); appendEscaped( aBuffer, m_pResMgr? ResId(nTitleId, *m_pResMgr).toString(): OUString() );
sendCommand( aBuffer.makeStringAndClear() ); sendCommand( aBuffer.makeStringAndClear() );
......
...@@ -96,7 +96,7 @@ OUString X11SalSystem::GetDisplayScreenName( unsigned int nScreen ) ...@@ -96,7 +96,7 @@ OUString X11SalSystem::GetDisplayScreenName( unsigned int nScreen )
nScreen = 0; nScreen = 0;
OUStringBuffer aBuf( 256 ); OUStringBuffer aBuf( 256 );
aBuf.append( OStringToOUString( OString( DisplayString( pSalDisp->GetDisplay() ) ), osl_getThreadTextEncoding() ) ); aBuf.append( OStringToOUString( OString( DisplayString( pSalDisp->GetDisplay() ) ), osl_getThreadTextEncoding() ) );
aBuf.appendAscii( " [" ); aBuf.append( " [" );
aBuf.append( static_cast<sal_Int32>(nScreen) ); aBuf.append( static_cast<sal_Int32>(nScreen) );
aBuf.append( ']' ); aBuf.append( ']' );
aScreenName = aBuf.makeStringAndClear(); aScreenName = aBuf.makeStringAndClear();
......
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