summaryrefslogtreecommitdiff
path: root/vcl/source/edit/textdoc.cxx
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-08-15 17:26:28 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-08-16 09:10:21 +0200
commitcaa828da96b120f5a3c979237081c29f8c2f3848 (patch)
treed0c0b4c2207f93e71d156ad6fad9c13a15859a5f /vcl/source/edit/textdoc.cxx
parent6917ebc39fb1c4f412ae9fea4e2d858a1b351c47 (diff)
Avoid unnecessary OUString copies
Change-Id: Ic76c9b75bcc72d8ae6a54d6ebba49acb77073bea
Diffstat (limited to 'vcl/source/edit/textdoc.cxx')
-rw-r--r--vcl/source/edit/textdoc.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx
index d13c5f91a12d..10315efe00e3 100644
--- a/vcl/source/edit/textdoc.cxx
+++ b/vcl/source/edit/textdoc.cxx
@@ -436,8 +436,7 @@ OUString TextDoc::GetText( const sal_Unicode* pSep ) const
for ( sal_uInt32 nNode = 0; nNode < nNodes; ++nNode )
{
TextNode* pNode = maTextNodes[ nNode ];
- OUString aTmp( pNode->GetText() );
- aASCIIText += aTmp;
+ aASCIIText += pNode->GetText();
if ( pSep && ( nNode != nLastNode ) )
aASCIIText += pSep;
}
@@ -447,13 +446,11 @@ OUString TextDoc::GetText( const sal_Unicode* pSep ) const
OUString TextDoc::GetText( sal_uInt32 nPara ) const
{
- OUString aText;
-
TextNode* pNode = ( nPara < maTextNodes.size() ) ? maTextNodes[ nPara ] : 0;
if ( pNode )
- aText = pNode->GetText();
+ return pNode->GetText();
- return aText;
+ return OUString();
}
sal_uLong TextDoc::GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel ) const