diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-15 21:04:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-16 13:24:05 +0000 |
commit | 25b119a02143e2e5b321ef16272c276d17414bad (patch) | |
tree | 8ff71278be115edf5481f4a95fbd36f032e3b410 /sw | |
parent | e1aff9edc8ffa4a9fbced86247abd2d2313578ed (diff) |
add RTL_CONSTASCII_STRINGPARAM to appendAscii on string literals
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/bookmrk.cxx | 50 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/vba/vbacolumn.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/vba/vbarow.cxx | 4 |
5 files changed, 45 insertions, 31 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 733fb9115915..af114b62e838 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -138,10 +138,12 @@ namespace sw { namespace mark rtl::OUString MarkBase::ToString( ) const { rtl::OUStringBuffer buf; - buf.appendAscii( "Mark: ( Name, [ Node1, Index1 ] ): ( " ); - buf.append( m_aName ).appendAscii( ", [ " ); - buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " ); - buf.append( sal_Int32( GetMarkPos().nContent.GetIndex( ) ) ).appendAscii( " ] )" ); + buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("Mark: ( Name, [ Node1, Index1 ] ): ( ")); + buf.append( m_aName ).appendAscii(RTL_CONSTASCII_STRINGPARAM(", [ ")); + buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ) + .appendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); + buf.append( sal_Int32( GetMarkPos().nContent.GetIndex( ) ) ) + .appendAscii(RTL_CONSTASCII_STRINGPARAM(" ] )") ); return buf.makeStringAndClear( ); } @@ -160,7 +162,7 @@ namespace sw { namespace mark sal_Int32 nRandom; ::rtl::OUStringBuffer sUniquePostfixBuffer; rtl_random_getBytes(aPool, &nRandom, sizeof(nRandom)); - sUniquePostfix = ::rtl::OUStringBuffer(13).appendAscii("_").append(static_cast<sal_Int32>(abs(nRandom))).makeStringAndClear(); + sUniquePostfix = ::rtl::OUStringBuffer(13).append('_').append(static_cast<sal_Int32>(abs(nRandom))).makeStringAndClear(); nCount = 0; } // putting the counter in front of the random parts will speed up string comparisons @@ -291,13 +293,18 @@ namespace sw { namespace mark rtl::OUString Fieldmark::ToString( ) const { rtl::OUStringBuffer buf; - buf.appendAscii( "Fieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( " ); - buf.append( m_aName ).appendAscii( ", " ); - buf.append( m_aFieldname ).appendAscii( ", [ " ); - buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " ); - buf.append( sal_Int32( GetMarkPos( ).nContent.GetIndex( ) ) ).appendAscii( " ], [" ); - buf.append( sal_Int32( GetOtherMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " ); - buf.append( sal_Int32( GetOtherMarkPos( ).nContent.GetIndex( ) ) ).appendAscii( " ] ) " ); + buf.appendAscii(RTL_CONSTASCII_STRINGPARAM( + "Fieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( ")); + buf.append( m_aName ).appendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); + buf.append( m_aFieldname ).appendAscii(RTL_CONSTASCII_STRINGPARAM(", [ ")); + buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ) + .appendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); + buf.append( sal_Int32( GetMarkPos( ).nContent.GetIndex( ) ) ) + .appendAscii(RTL_CONSTASCII_STRINGPARAM(" ], [")); + buf.append( sal_Int32( GetOtherMarkPos().nNode.GetIndex( ) ) ) + .appendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); + buf.append( sal_Int32( GetOtherMarkPos( ).nContent.GetIndex( ) ) ) + .appendAscii(RTL_CONSTASCII_STRINGPARAM(" ] ) ")); return buf.makeStringAndClear( ); } @@ -357,13 +364,18 @@ namespace sw { namespace mark rtl::OUString CheckboxFieldmark::toString( ) const { rtl::OUStringBuffer buf; - buf.appendAscii( "CheckboxFieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( " ); - buf.append( m_aName ).appendAscii( ", " ); - buf.append( GetFieldname() ).appendAscii( ", [ " ); - buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " ); - buf.append( sal_Int32( GetMarkPos( ).nContent.GetIndex( ) ) ).appendAscii( " ], [" ); - buf.append( sal_Int32( GetOtherMarkPos().nNode.GetIndex( ) ) ).appendAscii( ", " ); - buf.append( sal_Int32( GetOtherMarkPos( ).nContent.GetIndex( ) ) ).appendAscii( " ] ) " ); + buf.appendAscii(RTL_CONSTASCII_STRINGPARAM( + "CheckboxFieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( ")); + buf.append( m_aName ).appendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); + buf.append( GetFieldname() ).appendAscii(RTL_CONSTASCII_STRINGPARAM(", [ ")); + buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) ) + .appendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); + buf.append( sal_Int32( GetMarkPos( ).nContent.GetIndex( ) ) ) + .appendAscii(RTL_CONSTASCII_STRINGPARAM(" ], [")); + buf.append( sal_Int32( GetOtherMarkPos().nNode.GetIndex( ) ) ) + .appendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); + buf.append( sal_Int32( GetOtherMarkPos( ).nContent.GetIndex( ) ) ) + .appendAscii(RTL_CONSTASCII_STRINGPARAM(" ] ) ")); return buf.makeStringAndClear( ); } diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 0181c6167a54..36e286011a19 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2879,7 +2879,7 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, if ( *pIt < sal_Unicode( WW8ListManager::nMaxLevel ) ) { aBuffer.append( pPrev, pIt - pPrev ); - aBuffer.appendAscii( "%" ); + aBuffer.append( '%' ); aBuffer.append( OUString::valueOf( sal_Int32( *pIt ) + 1 ) ); pPrev = pIt + 1; diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 90cf55580787..98049c6fc4ea 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -307,9 +307,9 @@ void DocxExport::DoFormText(const SwInputField* /*pFld*/) rtl::OString DocxExport::OutputChart( uno::Reference< frame::XModel >& xModel, sal_Int32 nCount ) { rtl::OUString aFileName = rtl::OUStringBuffer() - .appendAscii("charts/chart") + .appendAscii(RTL_CONSTASCII_STRINGPARAM("charts/chart")) .append(nCount) - .appendAscii( ".xml" ) + .appendAscii(RTL_CONSTASCII_STRINGPARAM(".xml")) .makeStringAndClear(); OUString sId = m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), @@ -317,9 +317,9 @@ rtl::OString DocxExport::OutputChart( uno::Reference< frame::XModel >& xModel, s aFileName ); aFileName = rtl::OUStringBuffer() - .appendAscii("word/charts/chart") + .appendAscii(RTL_CONSTASCII_STRINGPARAM("word/charts/chart")) .append(nCount) - .appendAscii( ".xml" ) + .appendAscii(RTL_CONSTASCII_STRINGPARAM(".xml")) .makeStringAndClear(); ::sax_fastparser::FSHelperPtr pChartFS = @@ -577,26 +577,28 @@ void DocxExport::WriteHeaderFooter( const SwFmt& rFmt, bool bHeader, const char* ::sax_fastparser::FSHelperPtr pFS; if ( bHeader ) { - OUString aName( OUStringBuffer().appendAscii( "header" ).append( ++m_nHeaders ).appendAscii( ".xml" ).makeStringAndClear() ); + OUString aName( OUStringBuffer().appendAscii(RTL_CONSTASCII_STRINGPARAM("header")) + .append( ++m_nHeaders ).appendAscii(RTL_CONSTASCII_STRINGPARAM(".xml")) + .makeStringAndClear() ); aRelId = m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header" ), aName ); - pFS = m_pFilter->openFragmentStreamWithSerializer( OUStringBuffer().appendAscii( "word/" ).append( aName ).makeStringAndClear(), + pFS = m_pFilter->openFragmentStreamWithSerializer( OUStringBuffer().appendAscii(RTL_CONSTASCII_STRINGPARAM("word/")).append( aName ).makeStringAndClear(), S( "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml" ) ); pFS->startElementNS( XML_w, XML_hdr, MainXmlNamespaces( pFS )); } else { - OUString aName( OUStringBuffer().appendAscii( "footer" ).append( ++m_nFooters ).appendAscii( ".xml" ).makeStringAndClear() ); + OUString aName( OUStringBuffer().appendAscii(RTL_CONSTASCII_STRINGPARAM("footer")).append( ++m_nFooters ).appendAscii(RTL_CONSTASCII_STRINGPARAM(".xml")).makeStringAndClear() ); aRelId = m_pFilter->addRelation( m_pDocumentFS->getOutputStream(), S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer" ), aName ); - pFS = m_pFilter->openFragmentStreamWithSerializer( OUStringBuffer().appendAscii( "word/" ).append( aName ).makeStringAndClear(), + pFS = m_pFilter->openFragmentStreamWithSerializer( OUStringBuffer().appendAscii(RTL_CONSTASCII_STRINGPARAM("word/")).append( aName ).makeStringAndClear(), S( "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml" ) ); pFS->startElementNS( XML_w, XML_ftr, MainXmlNamespaces( pFS )); diff --git a/sw/source/ui/vba/vbacolumn.cxx b/sw/source/ui/vba/vbacolumn.cxx index 86b2f27daed5..0e1718c3fd3d 100644 --- a/sw/source/ui/vba/vbacolumn.cxx +++ b/sw/source/ui/vba/vbacolumn.cxx @@ -133,7 +133,7 @@ void SwVbaColumn::SelectColumn( const uno::Reference< frame::XModel >& xModel, c aRangeName.append(sStartCol).append(sal_Int32( 1 ) ); rtl::OUString sEndCol = SwVbaTableHelper::getColumnStr( nEndColumn ); sal_Int32 nRowCount = xTextTable->getRows()->getCount(); - aRangeName.appendAscii(":").append( sEndCol ).append( sal_Int32( nRowCount ) ); + aRangeName.append(':').append( sEndCol ).append( sal_Int32( nRowCount ) ); uno::Reference< table::XCellRange > xCellRange( xTextTable, uno::UNO_QUERY_THROW ); rtl::OUString sSelRange = aRangeName.makeStringAndClear(); diff --git a/sw/source/ui/vba/vbarow.cxx b/sw/source/ui/vba/vbarow.cxx index 7199b99f4ba7..2ec5d4ff9e52 100644 --- a/sw/source/ui/vba/vbarow.cxx +++ b/sw/source/ui/vba/vbarow.cxx @@ -91,13 +91,13 @@ SwVbaRow::Select( ) throw ( uno::RuntimeException ) void SwVbaRow::SelectRow( const uno::Reference< frame::XModel >& xModel, const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nStartRow, sal_Int32 nEndRow ) throw ( uno::RuntimeException ) { rtl::OUStringBuffer aRangeName; - aRangeName.appendAscii("A").append(sal_Int32( nStartRow + 1 ) ); + aRangeName.append('A').append(sal_Int32( nStartRow + 1 ) ); SwVbaTableHelper aTableHelper( xTextTable ); sal_Int32 nColCount = aTableHelper.getTabColumnsCount( nEndRow ); // FIXME: the column count > 26 //sal_Char cCol = 'A' + nColCount - 1; rtl::OUString sCol = aTableHelper.getColumnStr( nColCount - 1); - aRangeName.appendAscii(":").append( sCol ).append( sal_Int32( nEndRow + 1 ) ); + aRangeName.append(':').append( sCol ).append( sal_Int32( nEndRow + 1 ) ); uno::Reference< table::XCellRange > xCellRange( xTextTable, uno::UNO_QUERY_THROW ); rtl::OUString sSelRange = aRangeName.makeStringAndClear(); |