summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2019-10-18 11:10:31 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2019-10-18 16:36:57 +0200
commitb13421c6560e4f189265c96a3145aa11568b4437 (patch)
tree26c23e0c8c9c069e84e14e5cef519aaee4844b15 /sw
parenta27039f912fac32261cc6225f21823231eb10745 (diff)
Use const references to avoid copying
Change-Id: Iff6d15e3fc44eea24846fca40fb5ce81afde8c5f Reviewed-on: https://gerrit.libreoffice.org/81029 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/docnew.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 01ae7cc6ed45..8235b05d09c9 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -969,7 +969,7 @@ static void lcl_CopyFollowPageDesc(
do
{
const SwPageDesc* pFollowPageDesc = pCurSourcePageDesc->GetFollow();
- OUString sFollowPageDesc = pFollowPageDesc->GetName();
+ const OUString& sFollowPageDesc = pFollowPageDesc->GetName();
if (sFollowPageDesc == pCurSourcePageDesc->GetName())
{
break;
@@ -1052,9 +1052,9 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNu
// if the source uses headers or footers the target document
// needs inidividual page styles
const SwWrtShell *pSourceShell = rSource.GetDocShell()->GetWrtShell();
- const SwPageDesc rSourcePageDesc = pSourceShell->GetPageDesc(
+ const SwPageDesc& rSourcePageDesc = pSourceShell->GetPageDesc(
pSourceShell->GetCurPageDesc());
- const OUString sStartingPageDesc = rSourcePageDesc.GetName();
+ const OUString& sStartingPageDesc = rSourcePageDesc.GetName();
const bool bPageStylesWithHeaderFooter = lcl_PageDescOrFollowContainsHeaderFooter(rSourcePageDesc);
if( bPageStylesWithHeaderFooter )
{
@@ -1083,7 +1083,7 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNu
bool bIsTextNode = aBreakIdx.GetNode().IsTextNode();
if ( !bIsTextNode )
getIDocumentContentOperations().AppendTextNode( aBreakPos );
- OUString name = pTargetPageDesc->GetName();
+ const OUString& name = pTargetPageDesc->GetName();
pTargetShell->InsertPageBreak( &name, nStartPageNumber );
if ( !bIsTextNode )
{