sw/qa/core/frmedt/frmedt.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9b90463351919d05c6ce602e7788c4583c5f5534
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Mon May 15 16:46:16 2023 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon May 15 20:49:35 2023 +0200

    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 <sberg...@redhat.com>

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);

Reply via email to