diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-10-14 11:07:09 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-14 11:07:09 +0200 |
commit | 7c7958ef455d09a0c02683519fb766696904a103 (patch) | |
tree | cbd28e9f8741209b7eb3dc774a539b38f79597b9 /sw/qa | |
parent | 58a96d3ccedbade4f1a8bfbbc4b7d8f1615cfc69 (diff) |
Wrong unnecessarily deep downcasts
...to SwDrawContact instead of SwContact, ingoring that some objects involved
in e.g. CppunitTest_sw_uiwriter are of type SwFlyDrawContact.
Change-Id: Ie3b7726b3d47106db00b8aa11b702d505c369e00
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 6f99e9be665f..3165de755314 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -313,7 +313,7 @@ void SwUiWriterTest::testShapeTextboxSelect() SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); SdrObject* pObject = pPage->GetObj(1); - SwDrawContact* pTextBox = static_cast<SwDrawContact*>(pObject->GetUserCall()); + SwContact* pTextBox = static_cast<SwContact*>(pObject->GetUserCall()); // First, make sure that pTextBox is a fly frame (textbox of a shape). CPPUNIT_ASSERT_EQUAL(RES_FLYFRMFMT, static_cast<RES_FMT>(pTextBox->GetFmt()->Which())); @@ -386,7 +386,7 @@ void SwUiWriterTest::testShapeTextboxVertadjust() SwDoc* pDoc = createDoc("shape-textbox-vertadjust.odt"); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); SdrObject* pObject = pPage->GetObj(1); - SwFrmFmt* pFmt = static_cast<SwDrawContact*>(pObject->GetUserCall())->GetFmt(); + SwFrmFmt* pFmt = static_cast<SwContact*>(pObject->GetUserCall())->GetFmt(); // This was SDRTEXTVERTADJUST_TOP. CPPUNIT_ASSERT_EQUAL(SDRTEXTVERTADJUST_CENTER, pFmt->GetTextVertAdjust().GetValue()); } |