[Libreoffice-commits] core.git: sw/qa sw/source
Jelle van der Waa
jelle at vdwaa.nl
Sun Aug 25 09:54:54 PDT 2013
sw/qa/core/uwriter.cxx | 14 +-------
sw/source/core/crsr/bookmrk.cxx | 54 +++++++++-------------------------
sw/source/filter/ww8/rtfsdrexport.cxx | 5 ---
3 files changed, 18 insertions(+), 55 deletions(-)
New commits:
commit 88011f4cdf050c2df0b7488e273332d4e7048012
Author: Jelle van der Waa <jelle at vdwaa.nl>
Date: Sat Aug 24 12:50:01 2013 +0200
fdo#57950: Remove some chained appends in sw
Change-Id: Ib63fe1cf689d8f3cab4ca3571dd71f712e3fd7a5
Reviewed-on: https://gerrit.libreoffice.org/5602
Reviewed-by: Andrzej J.R. Hunt <andrzej at ahunt.org>
Tested-by: Andrzej J.R. Hunt <andrzej at ahunt.org>
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 20f974f..0cbad14 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -275,23 +275,13 @@ void SwDocTest::testModelToViewHelper()
{
ModelToViewHelper aModelToViewHelper(*pTxtNode, HIDEINVISIBLE);
OUString sViewText = aModelToViewHelper.getViewText();
- OUStringBuffer aBuffer;
- aBuffer.append("AAAAA CCCCC ");
- aBuffer.append(CH_TXTATR_BREAKWORD);
- aBuffer.append(" DDDDD");
- CPPUNIT_ASSERT(sViewText == aBuffer.makeStringAndClear());
+ CPPUNIT_ASSERT(sViewText == "AAAAA CCCCC " + OUString(CH_TXTATR_BREAKWORD) + " DDDDD");
}
{
ModelToViewHelper aModelToViewHelper(*pTxtNode, HIDEREDLINED);
OUString sViewText = aModelToViewHelper.getViewText();
- OUStringBuffer aBuffer;
- aBuffer.append("AAAABB ");
- aBuffer.append(CH_TXTATR_BREAKWORD);
- aBuffer.append(" CCCCC ");
- aBuffer.append(CH_TXTATR_BREAKWORD);
- aBuffer.append(" DDDDD");
- CPPUNIT_ASSERT(sViewText == aBuffer.makeStringAndClear());
+ CPPUNIT_ASSERT(sViewText == "AAAABB " + OUString(CH_TXTATR_BREAKWORD) + " CCCCC " + OUString(CH_TXTATR_BREAKWORD) + " DDDDD");
}
{
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 09f3438..8c8f450 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -161,15 +161,9 @@ namespace sw { namespace mark
OUString MarkBase::ToString( ) const
{
- OUStringBuffer buf;
- buf.append("Mark: ( Name, [ Node1, Index1 ] ): ( ");
- buf.append( m_aName ).append(", [ ");
- buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) )
- .append(", ");
- buf.append( sal_Int32( GetMarkPos().nContent.GetIndex( ) ) )
- .append(" ] )");
-
- return buf.makeStringAndClear( );
+ return "Mark: ( Name, [ Node1, Index1 ] ): ( " + m_aName + ", [ "
+ + OUString::number( GetMarkPos().nNode.GetIndex( ) ) + ", "
+ + OUString::number( GetMarkPos().nContent.GetIndex( ) ) + " ] )";
}
MarkBase::~MarkBase()
@@ -306,21 +300,11 @@ namespace sw { namespace mark
OUString Fieldmark::ToString( ) const
{
- OUStringBuffer buf;
- buf.append(
- "Fieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( ");
- buf.append( m_aName ).append(", ");
- buf.append( m_aFieldname ).append(", [ ");
- buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) )
- .append(", ");
- buf.append( sal_Int32( GetMarkPos( ).nContent.GetIndex( ) ) )
- .append(" ], [");
- buf.append( sal_Int32( GetOtherMarkPos().nNode.GetIndex( ) ) )
- .append(", ");
- buf.append( sal_Int32( GetOtherMarkPos( ).nContent.GetIndex( ) ) )
- .append(" ] ) ");
-
- return buf.makeStringAndClear( );
+ return "Fieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( " + m_aName + ", "
+ + m_aFieldname + ", [ " + OUString::number( GetMarkPos().nNode.GetIndex( ) )
+ + ", " + OUString::number( GetMarkPos( ).nContent.GetIndex( ) ) + " ], ["
+ + OUString::number( GetOtherMarkPos().nNode.GetIndex( ) ) + ", "
+ + OUString::number( GetOtherMarkPos( ).nContent.GetIndex( ) ) + " ] ) ";
}
void Fieldmark::Invalidate( )
@@ -387,21 +371,13 @@ namespace sw { namespace mark
OUString CheckboxFieldmark::toString( ) const
{
- OUStringBuffer buf;
- buf.append(
- "CheckboxFieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( ");
- buf.append( m_aName ).append(", ");
- buf.append( GetFieldname() ).append(", [ ");
- buf.append( sal_Int32( GetMarkPos().nNode.GetIndex( ) ) )
- .append(", ");
- buf.append( sal_Int32( GetMarkPos( ).nContent.GetIndex( ) ) )
- .append(" ], [");
- buf.append( sal_Int32( GetOtherMarkPos().nNode.GetIndex( ) ) )
- .append(", ");
- buf.append( sal_Int32( GetOtherMarkPos( ).nContent.GetIndex( ) ) )
- .append(" ] ) ");
-
- return buf.makeStringAndClear( );
+
+ return "CheckboxFieldmark: ( Name, Type, [ Nd1, Id1 ], [ Nd2, Id2 ] ): ( "
+ + m_aName + ", " + GetFieldname() + ", [ "
+ + OUString::number(GetMarkPos().nNode.GetIndex( ) ) + ", "
+ + OUString::number( GetMarkPos( ).nContent.GetIndex( ) ) + " ], ["
+ + OUString::number( GetOtherMarkPos().nNode.GetIndex( ) ) + ", "
+ + OUString::number( GetOtherMarkPos( ).nContent.GetIndex( ) ) + " ] ) ";
}
}}
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index 21a8b32..d3e3035 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -321,10 +321,7 @@ void RtfSdrExport::Commit( EscherPropertyContainer& rProps, const Rectangle& rRe
if (!aVerticies.isEmpty() )
{
// We know the number of vertices at the end only, so we have to prepend them here.
- OStringBuffer aBuf;
- aBuf.append("8;").append((sal_Int32)nVertices);
- aBuf.append(aVerticies.makeStringAndClear());
- m_aShapeProps.insert(std::pair<OString,OString>("pVerticies", aBuf.makeStringAndClear()));
+ m_aShapeProps.insert(std::pair<OString,OString>("pVerticies", "8;" + OString::number(nVertices) + aVerticies.makeStringAndClear()));
}
if ( !aSegmentInfo.isEmpty() )
m_aShapeProps.insert(std::pair<OString,OString>("pSegmentInfo", aSegmentInfo.makeStringAndClear()));
More information about the Libreoffice-commits
mailing list