summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-12-25 17:35:22 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-12-25 18:21:11 +0100
commit1577d93102ab87952309eafefa497aa88e97de21 (patch)
tree608f8e3e8b814344aef225a34a67fe96c4380035
parent257ff5bea3a40646e7dae88f708c136be93ed1b2 (diff)
Optimize consecutive token accesses in OUStrings
Change-Id: I988d80665bc61d1a0a96614790735d83bd9e5dde
-rw-r--r--sw/source/core/fields/ddetbl.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx
index 1f963fe8c6c9..a13560386e2a 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -109,10 +109,12 @@ void SwDDETable::ChangeContent()
SwDDEFieldType* pDDEType = static_cast<SwDDEFieldType*>(aDepend.GetRegisteredIn());
OUString aExpand = comphelper::string::remove(pDDEType->GetExpansion(), '\r');
+ sal_Int32 nExpandTokenPos = 0;
for( sal_uInt16 n = 0; n < aLines.size(); ++n )
{
- OUString aLine = aExpand.getToken( n, '\n' );
+ OUString aLine = aExpand.getToken( 0, '\n', nExpandTokenPos );
+ sal_Int32 nLineTokenPos = 0;
SwTableLine* pLine = aLines[ n ];
for( sal_uInt16 i = 0; i < pLine->GetTabBoxes().size(); ++i )
{
@@ -123,7 +125,7 @@ void SwDDETable::ChangeContent()
OSL_ENSURE( pTxtNode, "No Node" );
SwIndex aCntIdx( pTxtNode, 0 );
pTxtNode->EraseText( aCntIdx );
- pTxtNode->InsertText( aLine.getToken( i, '\t' ), aCntIdx );
+ pTxtNode->InsertText( aLine.getToken( 0, '\t', nLineTokenPos ), aCntIdx );
SwTableBoxFmt* pBoxFmt = static_cast<SwTableBoxFmt*>(pBox->GetFrmFmt());
pBoxFmt->LockModify();