Kaydet (Commit) 3b397cb6 authored tarafından Caolán McNamara's avatar Caolán McNamara

kill SwNodeIndex before dispose to fix uiwriter failures

Change-Id: Ifbca76f10fadc96dc90e48a7222c40baae9b85c1
üst a8f0a18f
......@@ -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));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment