[Libreoffice-commits] core.git: sw/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 24 09:54:17 UTC 2020


 sw/source/core/inc/rowfrm.hxx    |    2 +-
 sw/source/core/layout/tabfrm.cxx |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a3638ec207b6aa2ee8e5b4255c3b73e15c479852
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon Nov 23 23:27:13 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Nov 24 10:53:33 2020 +0100

    Avoid unnecessary, wrong downcast from SwFormatRowSplit to SwFormatFrameSize
    
    ...after b28e514d5e0ea45490b3cab30e1d97dd3da2c794 "callnk: Replace needless
    SwClientNotifyCall with CallSwClientNotify", as seen during e.g.
    CppunitTest_sw_ooxmlexport3
    CPPUNIT_TEST_NAME=testDontSplitTable::Load_Verify_Reload_Verify (see
    <https://ci.libreoffice.org/job/lo_ubsan/1834/>):
    
    > /sw/source/core/layout/tabfrm.cxx:3900:30: runtime error: downcast of address 0x6020001b9990 which does not point to an object of type 'const SwFormatFrameSize'
    > 0x6020001b9990: note: object is of type 'SwFormatRowSplit'
    >  bd 0e 00 2f  70 4c 61 a4 c2 2a 00 00  02 00 00 00 7a 00 00 00  00 00 00 00 00 00 00 04  10 00 00 00
    >               ^~~~~~~~~~~~~~~~~~~~~~~
    >               vptr for 'SwFormatRowSplit'
    >     #0 0x2ac29baf508b in SwRowFrame::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/layout/tabfrm.cxx:3900:30
    >     #1 0x2ac2988d9b4d in SwModify::CallSwClientNotify(SfxHint const&) const /sw/source/core/attr/calbck.cxx:367:18
    >     #2 0x2ac2988d9e45 in sw::BroadcastingModify::CallSwClientNotify(SfxHint const&) const /sw/source/core/attr/calbck.cxx:372:15
    >     #3 0x2ac2988d7025 in SwModify::NotifyClients(SfxPoolItem const*, SfxPoolItem const*) /sw/source/core/attr/calbck.cxx:184:5
    >     #4 0x2ac2989205c8 in SwFormat::Modify(SfxPoolItem const*, SfxPoolItem const*) /sw/source/core/attr/format.cxx:325:9
    >     #5 0x2ac29b2746d9 in SwFrameFormat::Modify(SfxPoolItem const*, SfxPoolItem const*) /sw/source/core/layout/atrfrm.cxx:2619:15
    >     #6 0x2ac2988d5208 in SwClient::SwClientNotify(SwModify const&, SfxHint const&) /sw/source/core/attr/calbck.cxx:115:9
    >     #7 0x2ac2988df973 in SwClient::SwClientNotifyCall(SwModify const&, SfxHint const&) /sw/inc/calbck.hxx:161:80
    >     #8 0x2ac2988da413 in sw::ClientNotifyAttrChg(SwModify&, SwAttrSet const&, SwAttrSet&, SwAttrSet&) /sw/source/core/attr/calbck.cxx:381:13
    >     #9 0x2ac298927a44 in SwFormat::SetFormatAttr(SfxPoolItem const&) /sw/source/core/attr/format.cxx:536:13
    >     #10 0x2ac2f953e607 in MSWordExportBase::OutputTextNode(SwTextNode&) /sw/source/filter/ww8/wrtw8nds.cxx:2257:54
    >     #11 0x2ac2f9571ace in MSWordExportBase::OutputContentNode(SwContentNode&) /sw/source/filter/ww8/wrtw8nds.cxx:3505:13
    >     #12 0x2ac2f98681dc in MSWordExportBase::WriteText() /sw/source/filter/ww8/wrtww8.cxx:2804:13
    >     #13 0x2ac2f8e8e01b in DocxExport::WriteMainText() /sw/source/filter/ww8/docxexport.cxx:1670:5
    >     #14 0x2ac2f8e8abf4 in DocxExport::ExportDocument_Impl() /sw/source/filter/ww8/docxexport.cxx:520:5
    >     #15 0x2ac2f98b52f3 in MSWordExportBase::ExportDocument(bool) /sw/source/filter/ww8/wrtww8.cxx:3360:19
    >     #16 0x2ac2f8f106a1 in DocxExportFilter::exportDocument() /sw/source/filter/ww8/docxexportfilter.cxx:86:17
    >     #17 0x2ac2dc707424 in oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /oox/source/core/filterbase.cxx:492:49
    >     #18 0x2ac2eddb9010 in (anonymous namespace)::WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /writerfilter/source/filter/WriterFilter.cxx:155:23
    >     #19 0x2ac28d79c39b in SfxObjectShell::ExportTo(SfxMedium&) /sfx2/source/doc/objstor.cxx:2451:25
    >     #20 0x2ac28d78b3ac in SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) /sfx2/source/doc/objstor.cxx:1539:19
    >     #21 0x2ac28d7be9f7 in SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objstor.cxx:2926:39
    >     #22 0x2ac28d7b6d1c in SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objstor.cxx:2717:9
    >     #23 0x2ac28d724080 in SfxObjectShell::APISaveAs_Impl(rtl::OUString const&, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objserv.cxx:315:19
    >     #24 0x2ac28d93df20 in SfxBaseModel::impl_store(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, bool) /sfx2/source/doc/sfxbasemodel.cxx:3086:42
    >     #25 0x2ac28d944909 in SfxBaseModel::storeToURL(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1728:13
    >     #26 0x2ac2a93a73b7 in SwModelTestBase::reload(char const*, char const*, char const*) /sw/qa/unit/swmodeltestbase.cxx:554:16
    >     #27 0x2ac2a93a56e3 in SwModelTestBase::executeLoadVerifyReloadVerify(char const*, char const*) /sw/qa/unit/swmodeltestbase.cxx:110:5
    >     #28 0x2ac286939928 in testDontSplitTable::Load_Verify_Reload_Verify() /sw/qa/extras/ooxmlexport/ooxmlexport3.cxx:936:1
    >     #29 0x2ac28693d184 in void std::__invoke_impl<void, void (testDontSplitTable::*&)(), testDontSplitTable*&>(std::__invoke_memfun_deref, void (testDontSplitTable::*&)(), testDontSplitTable*&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:73:14
    >     #30 0x2ac28693cd5e in std::__invoke_result<void (testDontSplitTable::*&)(), testDontSplitTable*&>::type std::__invoke<void (testDontSplitTable::*&)(), testDontSplitTable*&>(void (testDontSplitTable::*&)(), testDontSplitTable*&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/invoke.h:95:14
    >     #31 0x2ac28693cbb2 in void std::_Bind<void (testDontSplitTable::* (testDontSplitTable*))()>::__call<void, 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/functional:467:11
    >     #32 0x2ac28693c812 in void std::_Bind<void (testDontSplitTable::* (testDontSplitTable*))()>::operator()<void>() /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/functional:549:17
    >     #33 0x2ac28693b8a1 in std::_Function_handler<void (), std::_Bind<void (testDontSplitTable::* (testDontSplitTable*))()> >::_M_invoke(std::_Any_data const&) /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/std_function.h:316:2
    >     #34 0x2ac2868427b1 in std::function<void ()>::operator()() const /home/tdf/lode/opt_private/gcc-7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/bits/std_function.h:706:14
    >     #35 0x2ac28693ab84 in CppUnit::TestCaller<testDontSplitTable>::runTest() /workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:175:7
    >     #36 0x2ac23bbb05ba in CppUnit::TestCaseMethodFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5
    >     #37 0x2ac25698b937 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /test/source/vclbootstrapprotector.cxx:46:14
    >     #38 0x2ac23bb81c47 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
    >     #39 0x2ac24aff3fd7 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:78:12
    >     #40 0x2ac23bb81c47 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
    >     #41 0x2ac247b490a8 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:61:16
    >     #42 0x2ac23bb81c47 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
    >     #43 0x2ac23bb18f84 in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15:12
    >     #44 0x2ac23bb81c47 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
    >     #45 0x2ac23bb7b697 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) /workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:86:18
    >     #46 0x2ac23bc1aa79 in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:182:28
    >     #47 0x2ac23bbaec21 in CppUnit::TestCase::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91:13
    >     #48 0x2ac23bbb2a52 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30
    >     #49 0x2ac23bbb1c4a in CppUnit::TestComposite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
    >     #50 0x2ac23bbb2a52 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30
    >     #51 0x2ac23bbb1c4a in CppUnit::TestComposite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
    >     #52 0x2ac23bc4860e in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47:27
    >     #53 0x2ac23bc194de in CppUnit::TestResult::runTest(CppUnit::Test*) /workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:149:9
    >     #54 0x2ac23bc4956b in CppUnit::TestRunner::run(CppUnit::TestResult&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:96:14
    >     #55 0x4fedce in (anonymous namespace)::ProtectedFixtureFunctor::run() const /sal/cppunittester/cppunittester.cxx:323:20
    >     #56 0x4fb4c0 in sal_main() /sal/cppunittester/cppunittester.cxx:473:20
    >     #57 0x4fa4ae in main /sal/cppunittester/cppunittester.cxx:380:1
    >     #58 0x2ac23d859554 in __libc_start_main (/lib64/libc.so.6+0x22554)
    >     #59 0x425ea4 in _start (/workdir/LinkTarget/Executable/cppunittester+0x425ea4)
    
    Change-Id: Icd1fdd2a7b11106761d17cd22b1f9a4fe9f8896d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106472
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/sw/source/core/inc/rowfrm.hxx b/sw/source/core/inc/rowfrm.hxx
index cde10cf8b305..a37b72255be6 100644
--- a/sw/source/core/inc/rowfrm.hxx
+++ b/sw/source/core/inc/rowfrm.hxx
@@ -121,7 +121,7 @@ public:
     // height to fit the rest of space.
     bool IsInSplit() const { return m_bIsInSplit; }
     void SetInSplit(bool bNew = true) { m_bIsInSplit = bNew; }
-    void OnFrameSize(const SwFormatFrameSize&);
+    void OnFrameSize(const SfxPoolItem&);
 };
 
 #endif
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 13ba152f12fe..953e2a9be87b 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3849,7 +3849,7 @@ void SwRowFrame::RegistFlys( SwPageFrame *pPage )
     ::RegistFlys( pPage ? pPage : FindPageFrame(), this );
 }
 
-void SwRowFrame::OnFrameSize(const SwFormatFrameSize& rSize)
+void SwRowFrame::OnFrameSize(const SfxPoolItem& rSize)
 {
     SwTabFrame* pTab = FindTabFrame();
     if(pTab)
@@ -3897,7 +3897,7 @@ void SwRowFrame::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
             if(!pItem)
                 pChgSet->GetItemState(RES_ROW_SPLIT, false, &pItem);
             if(pItem)
-                OnFrameSize(*static_cast<const SwFormatFrameSize*>(pItem));
+                OnFrameSize(*pItem);
             else
                 SwLayoutFrame::SwClientNotify(rModify, rHint); // possibly not needed?
             return;


More information about the Libreoffice-commits mailing list