summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-05-21 15:23:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-21 20:43:15 +0200
commit318c48205cf598ee6c2312e5b4d0ae7fc1ee6c36 (patch)
treed51392de360d2a6c10f6d31e9bf840ae0b2e3092
parent70f3327e4ad0267c8e5e711e2b55e30a71ef5452 (diff)
fix SwDoc leaks in CppunitTest_sw_macros_test
Change-Id: I488c722fcba553f8784a1b14d841128cbda77934 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115924 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/qa/core/macros-test.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index 66f2dd9b2794..91c7a928a46a 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -132,7 +132,7 @@ void SwMacrosTest::testVba()
void SwMacrosTest::testBookmarkDeleteAndJoin()
{
- SwDoc *const pDoc = new SwDoc;
+ rtl::Reference<SwDoc> const pDoc(new SwDoc);
pDoc->GetIDocumentUndoRedo().DoUndo(true); // bug is in SwUndoDelete
SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1);
SwPaM aPaM(aIdx);
@@ -172,7 +172,7 @@ void SwMacrosTest::testBookmarkDeleteAndJoin()
void SwMacrosTest::testBookmarkDeleteTdf90816()
{
- SwDoc *const pDoc = new SwDoc;
+ rtl::Reference<SwDoc> const pDoc(new SwDoc);
pDoc->GetIDocumentUndoRedo().DoUndo(true); // bug is in SwUndoDelete
SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1);
SwPaM aPaM(aIdx);
@@ -309,7 +309,7 @@ void SwMacrosTest::testControlShapeGrouping()
void SwMacrosTest::testFdo55289()
{
- SwDoc *const pDoc = new SwDoc;
+ SwDoc* const pDoc = new SwDoc;
SwDocShellRef pDocShell = new SwDocShell(*pDoc, SfxObjectCreateMode::EMBEDDED);
// this needs to run with no layout to tickle the bugs in the special
// cases in SwXShape re-anchoring
@@ -337,6 +337,7 @@ void SwMacrosTest::testFdo55289()
uno::Reference<text::XTextDocument>(xModel, UNO_QUERY_THROW)->getText()->getEnd();
uno::Reference<text::XTextContent> const xShapeContent(xShape, UNO_QUERY);
xShapeContent->attach(xEnd);
+ pDocShell->DoClose();
}
void SwMacrosTest::testFdo68983()