[Libreoffice-commits] core.git: sw/qa
Caolán McNamara
caolanm at redhat.com
Tue Jun 9 08:42:20 PDT 2015
sw/qa/extras/uiwriter/uiwriter.cxx | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 3b397cb6cf7f673571205a91834c9b5622968df2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Jun 9 16:32:27 2015 +0100
kill SwNodeIndex before dispose to fix uiwriter failures
Change-Id: Ifbca76f10fadc96dc90e48a7222c40baae9b85c1
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 2677f09..216965b 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -1035,11 +1035,12 @@ void SwUiWriterTest::testUnoCursorPointer()
dynamic_cast<SwXTextDocument *>(xDocComponent.get()));
CPPUNIT_ASSERT(pxDocDocument);
SwDoc* const pDoc(pxDocDocument->GetDocShell()->GetDoc());
- SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1);
- std::unique_ptr<SwPosition> pPos(new SwPosition(aIdx));
- sw::UnoCursorPointer pCursor(pDoc->CreateUnoCrsr(*pPos));
+ std::unique_ptr<SwNodeIndex> xIdx(new SwNodeIndex(pDoc->GetNodes().GetEndOfContent(), -1));
+ std::unique_ptr<SwPosition> xPos(new SwPosition(*xIdx));
+ sw::UnoCursorPointer pCursor(pDoc->CreateUnoCrsr(*xPos));
CPPUNIT_ASSERT(static_cast<bool>(pCursor));
- pPos.reset(nullptr); // we need to kill the SwPosition before disposing
+ xPos.reset(); // we need to kill the SwPosition before disposing
+ xIdx.reset(); // we need to kill the SwNodeIndex before disposing
xDocComponent->dispose();
CPPUNIT_ASSERT(!static_cast<bool>(pCursor));
}
More information about the Libreoffice-commits
mailing list