diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-04-13 11:43:33 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-04-13 11:43:33 +0200 |
commit | 4f282bba62b772286bb61931cd87eb05af832d65 (patch) | |
tree | 332b63edec6f94f0e5ddd42f242c578556368bf4 /sd/source/ui/sidebar | |
parent | f17489f80020dfd7a9de66c0d580dcf23f7d3c09 (diff) |
Avoid unnecessary, wrong downcast causing UBSan failure
...in CppunitTest_sd_svg_export_tests:
> sd/source/ui/sidebar/SlideBackground.cxx:168:45: runtime error: downcast of address 0x6130001f4300 which does not point to an object of type 'sd::DrawViewShell'
> 0x6130001f4300: note: object is of type 'sd::slidesorter::SlideSorterViewShell'
> 47 02 00 72 70 f0 5b e6 d5 2a 00 00 b0 07 1c 00 b0 60 00 00 c0 de 64 00 10 61 00 00 10 5c 84 00
> ^~~~~~~~~~~~~~~~~~~~~~~
> vptr for 'sd::slidesorter::SlideSorterViewShell'
> #0 0x2ad5e3397b34 in sd::sidebar::SlideBackground::Initialize() sd/source/ui/sidebar/SlideBackground.cxx:168:45
> #1 0x2ad5e339edb9 in sd::sidebar::SlideBackground::SlideBackground(vcl::Window*, sd::ViewShellBase&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, SfxBindings*) sd/source/ui/sidebar/SlideBackground.cxx:132:5
> #2 0x2ad5e331b220 in VclPtr<sd::sidebar::SlideBackground> VclPtr<sd::sidebar::SlideBackground>::Create<VclPtr<vcl::Window>&, sd::ViewShellBase&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame>&, SfxBindings*&>(VclPtr<vcl::Window>&, sd::ViewShellBase&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame>&, SfxBindings*&) include/vcl/vclptr.hxx:165:46
> #3 0x2ad5e3311855 in sd::sidebar::PanelFactory::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) sd/source/ui/sidebar/PanelFactory.cxx:129:20
> #4 0x2ad5e331209a in non-virtual thunk to sd::sidebar::PanelFactory::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) sd/source/ui/sidebar/PanelFactory.cxx
> #5 0x2ad6367c1547 in (anonymous namespace)::UIElementFactoryManager::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) framework/source/uifactory/uielementfactorymanager.cxx:445:39
> #6 0x2ad6367c7e0a in non-virtual thunk to (anonymous namespace)::UIElementFactoryManager::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) framework/source/uifactory/uielementfactorymanager.cxx
> #7 0x2ad5ecce51d6 in sfx2::sidebar::SidebarController::CreateUIElement(com::sun::star::uno::Reference<com::sun::star::awt::XWindowPeer> const&, rtl::OUString const&, bool, sfx2::sidebar::Context const&) sfx2/source/sidebar/SidebarController.cxx:853:32
> #8 0x2ad5eccdd678 in sfx2::sidebar::SidebarController::CreatePanel(rtl::OUString const&, vcl::Window*, bool, sfx2::sidebar::Context const&, VclPtr<sfx2::sidebar::Deck> const&) sfx2/source/sidebar/SidebarController.cxx:794:43
> #9 0x2ad5eccdb394 in sfx2::sidebar::SidebarController::CreatePanels(rtl::OUString const&, sfx2::sidebar::Context const&) sfx2/source/sidebar/SidebarController.cxx:626:41
> #10 0x2ad5eccd8b60 in sfx2::sidebar::SidebarController::CreateDeck(rtl::OUString const&, sfx2::sidebar::Context const&, bool) sfx2/source/sidebar/SidebarController.cxx:579:9
> #11 0x2ad5eccd1ddb in sfx2::sidebar::SidebarController::SwitchToDeck(sfx2::sidebar::DeckDescriptor const&, sfx2::sidebar::Context const&) sfx2/source/sidebar/SidebarController.cxx:709:5
> #12 0x2ad5eccc085a in sfx2::sidebar::SidebarController::UpdateConfigurations() sfx2/source/sidebar/SidebarController.cxx:497:13
> #13 0x2ad5eccbd19c in sfx2::sidebar::SidebarController::notifyContextChangeEvent(com::sun::star::ui::ContextChangeEventObject const&) sfx2/source/sidebar/SidebarController.cxx:283:9
> #14 0x2ad635ccddb9 in (anonymous namespace)::ContextChangeEventMultiplexer::BroadcastEventToSingleContainer(com::sun::star::ui::ContextChangeEventObject const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) framework/source/services/ContextChangeEventMultiplexer.cxx:269:27
> #15 0x2ad635cbf240 in (anonymous namespace)::ContextChangeEventMultiplexer::broadcastContextChangeEvent(com::sun::star::ui::ContextChangeEventObject const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) framework/source/services/ContextChangeEventMultiplexer.cxx:248:5
> #16 0x2ad5f8402a60 in ContextChangeEventMultiplexer::NotifyContextChange(com::sun::star::uno::Reference<com::sun::star::frame::XController> const&, vcl::EnumContext::Context) svx/source/sidebar/ContextChangeEventMultiplexer.cxx:49:27
> #17 0x2ad5f840365f in ContextChangeEventMultiplexer::NotifyContextChange(SfxViewShell*, vcl::EnumContext::Context) svx/source/sidebar/ContextChangeEventMultiplexer.cxx:59:9
> #18 0x2ad5e39cf523 in sd::slidesorter::SlideSorterViewShell::Activate(bool) sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx:491:5
> #19 0x2ad5eb47a74d in SfxShell::DoActivate_Impl(SfxViewFrame*, bool) sfx2/source/control/shell.cxx:313:5
> #20 0x2ad5eb23872e in SfxDispatcher::DoActivate_Impl(bool) sfx2/source/control/dispatch.cxx:743:42
> #21 0x2ad5ed40c884 in SfxViewFrame::DoActivate(bool) sfx2/source/view/viewfrm.cxx:1038:20
> #22 0x2ad5ea87d3a7 in SfxApplication::SetViewFrame_Impl(SfxViewFrame*) sfx2/source/appl/app.cxx:319:21
> #23 0x2ad5ed40c66e in SfxViewFrame::SetViewFrame(SfxViewFrame*) sfx2/source/view/viewfrm.cxx:3026:19
> #24 0x2ad5ed42b2ca in SfxViewFrame::MakeActive_Impl(bool) sfx2/source/view/viewfrm.cxx:1648:21
> #25 0x2ad5ed35e8ac in SfxBaseController::ConnectSfxFrame_Impl(SfxBaseController::ConnectSfxFrame) sfx2/source/view/sfxbasecontroller.cxx:1303:33
> #26 0x2ad5ed356d7d in SfxBaseController::attachFrame(com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) sfx2/source/view/sfxbasecontroller.cxx:568:13
> #27 0x2ad5ed2cf594 in (anonymous namespace)::SfxFrameLoader_Impl::impl_createDocumentView(com::sun::star::uno::Reference<com::sun::star::frame::XModel2> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, comphelper::NamedValueCollection const&, rtl::OUString const&) sfx2/source/view/frmload.cxx:601:18
> #28 0x2ad5ed2c3f76 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) sfx2/source/view/frmload.cxx:718:13
> #29 0x2ad635c30b85 in framework::LoadEnv::impl_loadContent() framework/source/loadenv/loadenv.cxx:1081:37
> #30 0x2ad635c183d2 in framework::LoadEnv::startLoading() framework/source/loadenv/loadenv.cxx:370:20
> #31 0x2ad635c11742 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) framework/source/loadenv/loadenv.cxx:156:14
> #32 0x2ad635e0eb3e in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) framework/source/services/desktop.cxx:619:12
> #33 0x2ad635e0ed2a in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) framework/source/services/desktop.cxx
> #34 0x2ad608cfb20d in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) unotest/source/cpp/macros_test.cxx:50:60
> #35 0x2ad5d04f8d4b in SdSVGFilterTest::loadURL(rtl::OUString const&, char const*) sd/qa/unit/SVGExportTests.cxx:52:23
> #36 0x2ad5d04f7343 in SdSVGFilterTest::load(char const*, char const*) sd/qa/unit/SVGExportTests.cxx:42:16
> #37 0x2ad5d04f4b70 in SdSVGFilterTest::executeExport(char const*) sd/qa/unit/SVGExportTests.cxx:88:9
> #38 0x2ad5d04e9cbf in SdSVGFilterTest::testSVGExportTextDecorations() sd/qa/unit/SVGExportTests.cxx:94:9
> #39 0x2ad5d050f35b in CppUnit::TestCaller<SdSVGFilterTest>::runTest() workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:166:6
> #40 0x2ad58b98fd8b in CppUnit::TestCaseMethodFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5
> #41 0x2ad5a4be5b0f in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) test/source/vclbootstrapprotector.cxx:39:14
> #42 0x2ad58b94e3ce in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
> #43 0x2ad59b56214f in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89:12
> #44 0x2ad58b94e3ce in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
> #45 0x2ad5977fc351 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:63:16
> #46 0x2ad58b94e3ce in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
> #47 0x2ad58b8cc350 in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15:12
> #48 0x2ad58b94e3ce in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
> #49 0x2ad58b94ae70 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:77:18
> #50 0x2ad58ba0a0f5 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:181:28
> #51 0x2ad58b98dfa4 in CppUnit::TestCase::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91:13
> #52 0x2ad58b9927a7 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30
> #53 0x2ad58b991819 in CppUnit::TestComposite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
> #54 0x2ad58b9927a7 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30
> #55 0x2ad58b991819 in CppUnit::TestComposite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
> #56 0x2ad58ba485c9 in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47:27
> #57 0x2ad58ba0840d in CppUnit::TestResult::runTest(CppUnit::Test*) workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:148:9
> #58 0x2ad58ba4989b 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
> #59 0x532fb4 in (anonymous namespace)::ProtectedFixtureFunctor::run() const sal/cppunittester/cppunittester.cxx:306:20
> #60 0x52e7c3 in sal_main() sal/cppunittester/cppunittester.cxx:456:20
> #61 0x52cb6f in main sal/cppunittester/cppunittester.cxx:363:1
> #62 0x2ad58d5fa400 in __libc_start_main /usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:289
> #63 0x438019 in _start (workdir/LinkTarget/Executable/cppunittester+0x438019)
Change-Id: I254114df2a8698cb0496dd243efdd8e3536729fd
Diffstat (limited to 'sd/source/ui/sidebar')
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index a1684a4ee4c1..cd71372756e7 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -165,8 +165,7 @@ void SlideBackground::Initialize() if ( pFrameView->GetViewShEditMode() == EditMode::Page ) { - DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell); - SdPage* mpPage = pDrawViewShell->getCurrentPage(); + SdPage* mpPage = pMainViewShell->getCurrentPage(); populateMasterSlideDropdown(); OUString aLayoutName( mpPage->GetLayoutName() ); |