diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-06-09 16:32:27 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-06-09 16:41:55 +0100 |
commit | 3b397cb6cf7f673571205a91834c9b5622968df2 (patch) | |
tree | 49332756dbca0c434dbfe03a31b8590b2ee91a4f /sw | |
parent | a8f0a18fb992f554485b42cb4d594a20f06d4035 (diff) |
kill SwNodeIndex before dispose to fix uiwriter failures
Change-Id: Ifbca76f10fadc96dc90e48a7222c40baae9b85c1
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 2677f0938952..216965b58cdd 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)); } |