summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-06-20 16:03:18 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2019-06-24 11:38:20 +0200
commite7e3ceaae97688aa1894db0d2368237cf32e0346 (patch)
tree1567bda1f04a88b556937288ff5662e7df786ada
parent7e092051d563a8454d13b6a6ecc05b93e0f0135d (diff)
tdf#125983 CRASH: Updating link to external files
Revert "loplugin:useuniqueptr in lcl_UpdateLinksInSect" This reverts commit 9abbe6746cb4d36e3ccb384f96ccafb9e0612cd6. No point in use std::unique_ptr, sometimes pPam points to something we want to delete, sometimes it does not. Change-Id: I37e9871b8d5d836b7e52b5b8a5a7c572d92487f5 Reviewed-on: https://gerrit.libreoffice.org/74449 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 8729c98bbe6843e875be3903c2e5a7783984ae48) Reviewed-on: https://gerrit.libreoffice.org/74485 (cherry picked from commit fa121a50d23cc4154741059a6916d45cdcbc0c59) Reviewed-on: https://gerrit.libreoffice.org/74488 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit 5beee8974b0682602ad0bbe12ac1e33f7644958a) Reviewed-on: https://gerrit.libreoffice.org/74534 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Tested-by: Michael Stahl <Michael.Stahl@cib.de>
-rw-r--r--sw/source/core/docnode/section.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index b77e0f99859d..a8919d10073e 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -1192,7 +1192,7 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
bool bWasVisibleLinks = pDoc->getIDocumentLinksAdministration().IsVisibleLinks();
pDoc->getIDocumentLinksAdministration().SetVisibleLinks( false );
- std::unique_ptr<SwPaM> pPam;
+ SwPaM* pPam;
SwViewShell* pVSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
SwEditShell* pESh = pDoc->GetEditShell();
pDoc->getIDocumentFieldsAccess().LockExpFields();
@@ -1212,7 +1212,7 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
--aPos.nNode;
SwDoc::CorrAbs( aIdx, aEndIdx, aPos, true );
- pPam.reset(new SwPaM( aPos ));
+ pPam = new SwPaM( aPos );
// Delete everything succeeding it
--aIdx;
@@ -1396,7 +1396,8 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
pESh->Push();
SwPaM* pCursor = pESh->GetCursor();
*pCursor->GetPoint() = *pPam->GetPoint();
- pPam.reset(pCursor);
+ delete pPam;
+ pPam = pCursor;
}
SvMemoryStream aStrm( const_cast<sal_Int8 *>(aSeq.getConstArray()), aSeq.getLength(),
@@ -1431,6 +1432,7 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd )
pESh->EndAllAction();
else if( pVSh )
pVSh->EndAction();
+ delete pPam; // Was created at the start
return SUCCESS;
}