[Libreoffice-commits] core.git: sw/source
Michael Weghorn (via logerrit)
logerrit at kemper.freedesktop.org
Tue Oct 22 06:32:09 UTC 2019
sw/source/core/doc/docnew.cxx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 5b9b855c19fd8b8fb61f49e9d3d8bbf47521caee
Author: Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Mon Oct 21 20:03:43 2019 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Oct 22 08:31:31 2019 +0200
Revert OUString -> OUString& changes
Revert the OUString -> OUString& related part
of commit b13421c6560e4f189265c96a3145aa11568b4437
("Use const references to avoid copying")
as suggested by Stephan in [1] to avoid
"ongoing maintenance effort to guarantee
that the references are not dangling, and
future maintainers might draw wrong assumptions
from the atypical behavior of holding OUString
instances by reference."
[1] https://gerrit.libreoffice.org/#/c/81029/
Change-Id: I50a81a170ba7c40cd3257e250e17f107d4a9f015
Reviewed-on: https://gerrit.libreoffice.org/81273
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 8235b05d09c9..828913313a52 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();
- const OUString& sFollowPageDesc = pFollowPageDesc->GetName();
+ OUString sFollowPageDesc = pFollowPageDesc->GetName();
if (sFollowPageDesc == pCurSourcePageDesc->GetName())
{
break;
@@ -1054,7 +1054,7 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNu
const SwWrtShell *pSourceShell = rSource.GetDocShell()->GetWrtShell();
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 );
- const OUString& name = pTargetPageDesc->GetName();
+ const OUString name = pTargetPageDesc->GetName();
pTargetShell->InsertPageBreak( &name, nStartPageNumber );
if ( !bIsTextNode )
{
More information about the Libreoffice-commits
mailing list