diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-05-15 16:46:16 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-05-15 20:49:35 +0200 |
commit | 9b90463351919d05c6ce602e7788c4583c5f5534 (patch) | |
tree | 2f673119abdeb6878e2dbf8bf12d360d4b61f615 /sw/qa | |
parent | a4d011fb8ae24f90375744af5e98ba81716a22cb (diff) |
Avoid unnecessary, wrong downcast
...in test code added with 61f3c796702f725f2c65b53b79ab7e190d39b6b8 "sw
floattable: fix UI / property dialog for shape containing table", causing
CppunitTest_sw_core_frmedt
CPPUNIT_TEST_NAME=testTextBoxSelectCursorPos::TestBody to fail with
> sw/qa/core/frmedt/frmedt.cxx:152:34: runtime error: downcast of address 0x506000892f40 which does not point to an object of type 'SwDrawContact'
> 0x506000892f40: note: object is of type 'SwFlyDrawContact'
> 00 00 00 00 90 6c 59 73 ce 7f 00 00 00 6d 59 73 ce 7f 00 00 00 00 00 00 00 00 00 00 50 2b 06 00
> ^~~~~~~~~~~~~~~~~~~~~~~
> vptr for 'SwFlyDrawContact'
> #0 in testTextBoxSelectCursorPos::TestBody() at sw/qa/core/frmedt/frmedt.cxx:152:34
Change-Id: I1c669d0ed3e2a4055db28c9fc4676b6e7c8520b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151795
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/core/frmedt/frmedt.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/qa/core/frmedt/frmedt.cxx b/sw/qa/core/frmedt/frmedt.cxx index 18474ad33bf0..26c64c0833f8 100644 --- a/sw/qa/core/frmedt/frmedt.cxx +++ b/sw/qa/core/frmedt/frmedt.cxx @@ -149,7 +149,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreFrmedtTest, testTextBoxSelectCursorPos) SwDoc* pDoc = getSwDoc(); SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); SdrObject* pFlyObject = pPage->GetObj(1); - SwDrawContact* pFlyContact = static_cast<SwDrawContact*>(pFlyObject->GetUserCall()); + SwContact* pFlyContact = static_cast<SwContact*>(pFlyObject->GetUserCall()); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(RES_FLYFRMFMT), pFlyContact->GetFormat()->Which()); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); pWrtShell->SelectObj(Point(), 0, pFlyObject); |