loplugin:stringconstant: OUStringBuffer: appendAscii -> append

Change-Id: I21969536cec33a18be3f47a310789568a480ec2f
This commit is contained in:
Stephan Bergmann
2015-08-31 08:02:50 +02:00
parent f5eeaaac7c
commit 6e31a794fa
9 changed files with 31 additions and 31 deletions

View File

@@ -41,9 +41,9 @@ OUString lclGetRelationsPath( const OUString& rFragmentPath )
sal_Int32 nPathLen = ::std::max< sal_Int32 >( rFragmentPath.lastIndexOf( '/' ) + 1, 0 );
return
OUStringBuffer( rFragmentPath.copy( 0, nPathLen ) ). // file path including slash
appendAscii( "_rels/" ). // additional '_rels/' path
append( "_rels/" ). // additional '_rels/' path
append( rFragmentPath.copy( nPathLen ) ). // file name after path
appendAscii( ".rels" ). // '.rels' suffix
append( ".rels" ). // '.rels' suffix
makeStringAndClear();
}

View File

@@ -493,7 +493,7 @@ namespace {
OUString lclAddRelation( const Reference< XRelationshipAccess >& rRelations, sal_Int32 nId, const OUString& rType, const OUString& rTarget, bool bExternal )
{
OUString sId = OUStringBuffer().appendAscii( "rId" ).append( nId ).makeStringAndClear();
OUString sId = OUStringBuffer().append( "rId" ).append( nId ).makeStringAndClear();
Sequence< StringPair > aEntry( bExternal ? 3 : 2 );
aEntry[0].First = "Type";
@@ -588,7 +588,7 @@ writeElement( FSHelperPtr pDoc, sal_Int32 nXmlElement, const Sequence< OUString
for( sal_Int32 i = 1, end = aItems.getLength(); i < end; ++i )
{
sRep.appendAscii( " " ).append( aItems[ i ] );
sRep.append( " " ).append( aItems[ i ] );
}
writeElement( pDoc, nXmlElement, sRep.makeStringAndClear() );

View File

@@ -77,7 +77,7 @@ static OUString lclGenerateApiArray( const Matrix< Any >& rMatrix )
else if( *aIt >>= aString )
aBuffer.append( lclGenerateApiString( aString ) );
else
aBuffer.appendAscii( "\"\"" );
aBuffer.append( "\"\"" );
}
}
aBuffer.append( API_TOKEN_ARRAY_CLOSE );

View File

@@ -265,7 +265,7 @@ void StringHelper::appendHex( OUStringBuffer& rStr, sal_uInt8 nData, bool bPrefi
{
static const sal_Unicode spcHexDigits[] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' };
if( bPrefix )
rStr.appendAscii( "0x" );
rStr.append( "0x" );
rStr.append( spcHexDigits[ (nData >> 4) & 0x0F ] ).append( spcHexDigits[ nData & 0x0F ] );
}
@@ -454,13 +454,13 @@ void StringHelper::appendCChar( OUStringBuffer& rStr, sal_Unicode cChar, bool bP
if( cChar > 0x00FF )
{
if( bPrefix )
rStr.appendAscii( "\\u" );
rStr.append( "\\u" );
appendHex( rStr, static_cast< sal_uInt16 >( cChar ), false );
}
else
{
if( bPrefix )
rStr.appendAscii( "\\x" );
rStr.append( "\\x" );
appendHex( rStr, static_cast< sal_uInt8 >( cChar ), false );
}
}

View File

@@ -590,12 +590,12 @@ ChartExport& ChartExport::WriteChartObj( const Reference< XShape >& xShape, sal_
OUString sFullStream = OUStringBuffer()
.appendAscii(sFullPath)
.append(nChartCount)
.appendAscii( ".xml" )
.append( ".xml" )
.makeStringAndClear();
OUString sRelativeStream = OUStringBuffer()
.appendAscii(sRelativePath)
.append(nChartCount)
.appendAscii( ".xml" )
.append( ".xml" )
.makeStringAndClear();
FSHelperPtr pChart = CreateOutputStream(
sFullStream,

View File

@@ -908,7 +908,7 @@ OUString DrawingML::WriteImage( const Graphic& rGraphic , bool bRelPathToMedia )
Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer()
.appendAscii( GetComponentDir() )
.appendAscii( "/media/image" )
.append( "/media/image" )
.append( (sal_Int32) mnImageCounter )
.appendAscii( pExtension )
.makeStringAndClear(),

View File

@@ -1382,9 +1382,9 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape )
{
xOutStream = mpFB->openFragmentStream( OUStringBuffer()
.appendAscii( GetComponentDir() )
.appendAscii( "/embeddings/spreadsheet" )
.append( "/embeddings/spreadsheet" )
.append( static_cast<sal_Int32>(mnEmbeddeDocumentCounter) )
.appendAscii( ".xlsx" )
.append( ".xlsx" )
.makeStringAndClear(),
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" );
}
@@ -1392,9 +1392,9 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape )
{
xOutStream = mpFB->openFragmentStream( OUStringBuffer()
.appendAscii( GetComponentDir() )
.appendAscii( "/embeddings/textdocument" )
.append( "/embeddings/textdocument" )
.append( static_cast<sal_Int32>(mnEmbeddeDocumentCounter) )
.appendAscii( ".docx" )
.append( ".docx" )
.makeStringAndClear(),
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" );
}
@@ -1438,9 +1438,9 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape )
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",
OUStringBuffer()
.appendAscii( GetRelationCompPrefix() )
.appendAscii( "embeddings/spreadsheet" )
.append( "embeddings/spreadsheet" )
.append( static_cast<sal_Int32>(mnEmbeddeDocumentCounter++) )
.appendAscii( ".xlsx" )
.append( ".xlsx" )
.makeStringAndClear() );
}
else
@@ -1449,9 +1449,9 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape )
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",
OUStringBuffer()
.appendAscii( GetRelationCompPrefix() )
.appendAscii( "embeddings/textdocument" )
.append( "embeddings/textdocument" )
.append( static_cast<sal_Int32>(mnEmbeddeDocumentCounter++) )
.appendAscii( ".docx" )
.append( ".docx" )
.makeStringAndClear() );
}

View File

@@ -245,7 +245,7 @@ OUString VbaModule::readSourceCode( StorageBase& rVbaStrg ) const
}
// normal source code line
if( !mbExecutable )
aSourceCode.appendAscii( "Rem " );
aSourceCode.append( "Rem " );
aSourceCode.append( aCodeLine ).append( '\n' );
}
}
@@ -265,22 +265,22 @@ void VbaModule::createModule( const OUString& rVBASourceCode,
script::ModuleInfo aModuleInfo;
aModuleInfo.ModuleType = mnType;
OUStringBuffer aSourceCode;
aSourceCode.appendAscii( "Rem Attribute VBA_ModuleType=" );
aSourceCode.append( "Rem Attribute VBA_ModuleType=" );
switch( mnType )
{
case script::ModuleType::NORMAL:
aSourceCode.appendAscii( "VBAModule" );
aSourceCode.append( "VBAModule" );
break;
case script::ModuleType::CLASS:
aSourceCode.appendAscii( "VBAClassModule" );
aSourceCode.append( "VBAClassModule" );
break;
case script::ModuleType::FORM:
aSourceCode.appendAscii( "VBAFormModule" );
aSourceCode.append( "VBAFormModule" );
// hack from old filter, document Basic should know the XModel, but it doesn't
aModuleInfo.ModuleObject.set( mxDocModel, UNO_QUERY );
break;
case script::ModuleType::DOCUMENT:
aSourceCode.appendAscii( "VBADocumentModule" );
aSourceCode.append( "VBADocumentModule" );
// get the VBA implementation object associated to the document module
if( rxDocObjectNA.is() ) try
{
@@ -291,19 +291,19 @@ void VbaModule::createModule( const OUString& rVBASourceCode,
}
break;
default:
aSourceCode.appendAscii( "VBAUnknown" );
aSourceCode.append( "VBAUnknown" );
}
aSourceCode.append( '\n' );
if( mbExecutable )
{
aSourceCode.appendAscii( "Option VBASupport 1\n" );
aSourceCode.append( "Option VBASupport 1\n" );
if( mnType == script::ModuleType::CLASS )
aSourceCode.appendAscii( "Option ClassModule\n" );
aSourceCode.append( "Option ClassModule\n" );
}
else
{
// add a subroutine named after the module itself
aSourceCode.appendAscii( "Sub " ).
aSourceCode.append( "Sub " ).
append( maName.replace( ' ', '_' ) ).append( '\n' );
}
@@ -312,7 +312,7 @@ void VbaModule::createModule( const OUString& rVBASourceCode,
// close the subroutine named after the module
if( !mbExecutable )
aSourceCode.appendAscii( "End Sub\n" );
aSourceCode.append( "End Sub\n" );
// insert extended module info
try

View File

@@ -68,7 +68,7 @@ namespace oox { namespace ppt {
{
if( !sAttributes.isEmpty() )
{
sAttributes.appendAscii( ";" );
sAttributes.append( ";" );
}
sAttributes.append( iter->name );
}