Skip to content

Commit

Permalink
updateModel must remove the SelectionChangeListener from the old cont…
Browse files Browse the repository at this point in the history
…roller

...and not just add it to the new controller.  It caused

> $ SAL_USE_VCLPLUGIN=gen make UITest_chart UITEST_TEST_NAME=chartLegend.chartLegend.test_chart_display_legend_dialog

to fail with

> ==346284==ERROR: AddressSanitizer: heap-use-after-free on address 0x61a00049cca8 at pc 0x7f8496747751 bp 0x7fff7c483f10 sp 0x7fff7c483f08
> READ of size 8 at 0x61a00049cca8 thread T0
>  #0 in chart::sidebar::ChartSidebarSelectionListener::selectionChanged(com::sun::star::lang::EventObject const&) at chart2/source/controller/sidebar/ChartSidebarSelectionListener.cxx:66:15
>  #1 in chart::ChartController::impl_notifySelectionChangeListeners() at chart2/source/controller/main/ChartController_Window.cxx:1740:28
>  #2 in chart::ChartController::impl_selectObjectAndNotiy() at chart2/source/controller/main/ChartController_Window.cxx:1756:5
>  #3 in chart::ChartController::modeChanged(com::sun::star::util::ModeChangeEvent const&) at chart2/source/controller/main/ChartController.cxx:538:31
>  #4 in chart::ChartView::impl_notifyModeChangeListener(rtl::OUString const&) at chart2/source/view/main/ChartView.cxx:2653:32
>  #5 in chart::ChartView::impl_updateView(bool) at chart2/source/view/main/ChartView.cxx:2561:9
>  #6 in chart::ChartView::update() at chart2/source/view/main/ChartView.cxx:2687:5
>  #7 in chart::ChartController::execute_Paint(OutputDevice&, tools::Rectangle const&) at chart2/source/controller/main/ChartController_Window.cxx:485:25
>  #8 in chart::ChartWindow::Paint(OutputDevice&, tools::Rectangle const&) at chart2/source/controller/main/ChartWindow.cxx:99:30
>  #9 in PaintHelper::DoPaint(vcl::Region const*) at vcl/source/window/paint.cxx:309:24
>  #10 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:613:17
>  #11 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #12 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #13 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #14 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #15 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #16 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #17 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #18 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #19 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #20 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #21 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #22 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #23 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #24 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #25 in PaintHelper::~PaintHelper() at vcl/source/window/paint.cxx:549:30
>  #26 in vcl::Window::ImplCallPaint(vcl::Region const*, ImplPaintFlags) at vcl/source/window/paint.cxx:619:1
>  #27 in vcl::Window::ImplCallOverlapPaint() at vcl/source/window/paint.cxx:637:9
>  #28 in vcl::Window::ImplHandlePaintHdl(Timer*) at vcl/source/window/paint.cxx:660:9
>  #29 in vcl::Window::LinkStubImplHandlePaintHdl(void*, Timer*) at vcl/source/window/paint.cxx:641:1
>  #30 in Link<Timer*, void>::Call(Timer*) const at include/tools/link.hxx:111:45
>  #31 in Timer::Invoke() at vcl/source/app/timer.cxx:75:21
>  #32 in Scheduler::ProcessTaskScheduling() at vcl/source/app/scheduler.cxx:478:20
>  #33 in Scheduler::CallbackTaskScheduling() at vcl/source/app/scheduler.cxx:287:5
>  #34 in SalTimer::CallCallback() at vcl/inc/saltimer.hxx:54:13
>  #35 in X11SalData::Timeout() at vcl/unx/generic/app/saldata.cxx:551:41
>  #36 in SalXLib::CheckTimeout(bool) at vcl/unx/generic/app/saldata.cxx:635:17
>  #37 in SalXLib::Yield(bool, bool) at vcl/unx/generic/app/saldata.cxx:716:25
>  #38 in X11SalInstance::DoYield(bool, bool) at vcl/unx/generic/app/salinst.cxx:182:20
>  #39 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:454:48
>  #40 in Application::Yield() at vcl/source/app/svapp.cxx:518:5
>  #41 in Application::Execute() at vcl/source/app/svapp.cxx:433:9
>  #42 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1602:17
>  #43 in ImplSVMain() at vcl/source/app/svmain.cxx:196:35
>  #44 in SVMain() at vcl/source/app/svmain.cxx:228:12
>  #45 in soffice_main at desktop/source/app/sofficemain.cxx:107:12
>  #46 in sal_main at desktop/source/app/main.c:48:15
>  #47 in main at desktop/source/app/main.c:47:1
> 0x61a00049cca8 is located 1064 bytes inside of 1160-byte region [0x61a00049c880,0x61a00049cd08)
> freed by thread T0 here:
>  #0 in operator delete(void*, unsigned long) at compiler-rt/lib/asan/asan_new_delete.cpp:172:3
>  #1 in chart::sidebar::ChartLinePanel::~ChartLinePanel() at chart2/source/controller/sidebar/ChartLinePanel.cxx:143:1
>  #2 in VclReferenceBase::release() const at include/vcl/vclreferencebase.hxx:40:13
>  #3 in rtl::Reference<vcl::Window>::~Reference() at include/rtl/ref.hxx:92:22
>  #4 in VclPtr<vcl::Window>::disposeAndClear() at include/vcl/vclptr.hxx:208:5
>  #5 in sfx2::sidebar::SidebarPanelBase::disposing() at sfx2/source/sidebar/SidebarPanelBase.cxx:81:15
>  #6 in cppu::WeakComponentImplHelperBase::dispose() at cppuhelper/source/implbase.cxx:102:17
>  #7 in cppu::PartialWeakComponentImplHelper<com::sun::star::ui::XContextChangeEventListener, com::sun::star::ui::XUIElement, com::sun::star::ui::XToolPanel, com::sun::star::ui::XSidebarPanel, com::sun::star::ui::XUpdateModel>::dispose() at include/cppuhelper/compbase.hxx:90:36
>  #8 in sfx2::sidebar::Panel::dispose() at sfx2/source/sidebar/Panel.cxx:106:25
>  #9 in VclReferenceBase::disposeOnce() at vcl/source/outdev/vclreferencebase.cxx:38:5
>  #10 in VclPtr<sfx2::sidebar::Panel>::disposeAndClear() at include/vcl/vclptr.hxx:206:19
>  #11 in sfx2::sidebar::Deck::dispose() at sfx2/source/sidebar/Deck.cxx:92:17
>  #12 in VclReferenceBase::disposeOnce() at vcl/source/outdev/vclreferencebase.cxx:38:5
>  #13 in VclPtr<sfx2::sidebar::Deck>::disposeAndClear() at include/vcl/vclptr.hxx:206:19
>  #14 in sfx2::sidebar::SidebarController::CreateDeck(rtl::OUString const&, sfx2::sidebar::Context const&, bool) at sfx2/source/sidebar/SidebarController.cxx:664:19
>  #15 in sfx2::sidebar::SidebarController::SwitchToDeck(sfx2::sidebar::DeckDescriptor const&, sfx2::sidebar::Context const&) at sfx2/source/sidebar/SidebarController.cxx:822:5
>  #16 in sfx2::sidebar::SidebarController::UpdateConfigurations() at sfx2/source/sidebar/SidebarController.cxx:569:9
>  #17 in sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3::operator()() const at sfx2/source/sidebar/SidebarController.cxx:140:52
>  #18 in void std::__invoke_impl<void, sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3&>(std::__invoke_other, sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3&) at include/c++/10.0.1/bits/invoke.h:60:14
>  #19 in std::enable_if<is_invocable_r_v<void, sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3&>, void>::type std::__invoke_r<void, sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3&>(sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3&) at include/c++/10.0.1/bits/invoke.h:110:2
>  #20 in std::_Function_handler<void (), sfx2::sidebar::SidebarController::SidebarController(sfx2::sidebar::SidebarDockingWindow*, SfxViewFrame const*)::$_3>::_M_invoke(std::_Any_data const&) at include/c++/10.0.1/bits/std_function.h:291:9
>  #21 in std::function<void ()>::operator()() const at include/c++/10.0.1/bits/std_function.h:622:14
>  #22 in sfx2::sidebar::AsynchronousCall::HandleUserCall(void*) at sfx2/source/sidebar/AsynchronousCall.cxx:66:9
>  #23 in sfx2::sidebar::AsynchronousCall::LinkStubHandleUserCall(void*, void*) at sfx2/source/sidebar/AsynchronousCall.cxx:62:1
>  #24 in Link<void*, void>::Call(void*) const at include/tools/link.hxx:111:45
>  #25 in ImplHandleUserEvent(ImplSVEvent*) at vcl/source/window/winproc.cxx:2009:30
>  #26 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at vcl/source/window/winproc.cxx:2562:13
>  #27 in SalFrame::CallCallback(SalEvent, void const*) const at vcl/inc/salframe.hxx:306:29
>  #28 in SalGenericDisplay::ProcessEvent(SalUserEventList::SalUserEvent) at vcl/unx/generic/app/gendisp.cxx:66:22
>  #29 in SalUserEventList::DispatchUserEvents(bool) at vcl/source/app/salusereventlist.cxx:108:17
>  #30 in SalGenericDisplay::DispatchInternalEvent(bool) at vcl/unx/generic/app/gendisp.cxx:51:12
>  #31 in SalX11Display::Yield() at vcl/unx/generic/app/saldisp.cxx:1918:9
>  #32 in DisplayYield(int, void*) at vcl/unx/generic/app/saldisp.cxx:414:13
>  #33 in (anonymous namespace)::YieldEntry::HandleNextEvent() const at vcl/unx/generic/app/saldata.cxx:566:38
>  #34 in SalXLib::Yield(bool, bool) at vcl/unx/generic/app/saldata.cxx:662:25
>  #35 in X11SalInstance::DoYield(bool, bool) at vcl/unx/generic/app/salinst.cxx:182:20
>  #36 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:454:48
>  #37 in Application::Yield() at vcl/source/app/svapp.cxx:518:5
>  #38 in Dialog::Execute() at vcl/source/window/dialog.cxx:1032:9
>  #39 in SalInstanceDialog::run() at vcl/source/app/salvtables.cxx:1480:23
>  #40 in weld::DialogController::run() at include/vcl/weld.hxx:2196:47
>  #41 in chart::ChartController::executeDispatch_OpenLegendDialog() at chart2/source/controller/main/ChartController_Insert.cxx:227:18
>  #42 in chart::ChartController::dispatch(com::sun::star::util::URL const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at chart2/source/controller/main/ChartController.cxx:1130:15
>  #43 in ChartUIObject::PostCommand(void*) at chart2/source/controller/uitest/uiobject.cxx:76:41
>  #44 in ChartUIObject::LinkStubPostCommand(void*, void*) at chart2/source/controller/uitest/uiobject.cxx:72:1
>  #45 in Link<void*, void>::Call(void*) const at include/tools/link.hxx:111:45
>  #46 in ImplHandleUserEvent(ImplSVEvent*) at vcl/source/window/winproc.cxx:2009:30
>  #47 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at vcl/source/window/winproc.cxx:2562:13
>  #48 in SalFrame::CallCallback(SalEvent, void const*) const at vcl/inc/salframe.hxx:306:29
>  #49 in SalGenericDisplay::ProcessEvent(SalUserEventList::SalUserEvent) at vcl/unx/generic/app/gendisp.cxx:66:22
>  #50 in SalUserEventList::DispatchUserEvents(bool) at vcl/source/app/salusereventlist.cxx:108:17
>  #51 in SalGenericDisplay::DispatchInternalEvent(bool) at vcl/unx/generic/app/gendisp.cxx:51:12
>  #52 in SalX11Display::Yield() at vcl/unx/generic/app/saldisp.cxx:1918:9
>  #53 in DisplayYield(int, void*) at vcl/unx/generic/app/saldisp.cxx:414:13
>  #54 in (anonymous namespace)::YieldEntry::HandleNextEvent() const at vcl/unx/generic/app/saldata.cxx:566:38
>  #55 in SalXLib::Yield(bool, bool) at vcl/unx/generic/app/saldata.cxx:662:25
>  #56 in X11SalInstance::DoYield(bool, bool) at vcl/unx/generic/app/salinst.cxx:182:20
>  #57 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:454:48
>  #58 in Application::Reschedule(bool) at vcl/source/app/svapp.cxx:467:12
>  #59 in (anonymous namespace)::ExecuteWrapper::ExecuteActionHdl(Timer*) at vcl/source/uitest/uno/uiobject_uno.cxx:91:13
>  #60 in (anonymous namespace)::ExecuteWrapper::LinkStubExecuteActionHdl(void*, Timer*) at vcl/source/uitest/uno/uiobject_uno.cxx:78:1
>  #61 in Link<Timer*, void>::Call(Timer*) const at include/tools/link.hxx:111:45
>  #62 in Timer::Invoke() at vcl/source/app/timer.cxx:75:21
>  #63 in Scheduler::ProcessTaskScheduling() at vcl/source/app/scheduler.cxx:478:20
>  #64 in Scheduler::CallbackTaskScheduling() at vcl/source/app/scheduler.cxx:287:5
>  #65 in SalTimer::CallCallback() at vcl/inc/saltimer.hxx:54:13
>  #66 in X11SalData::Timeout() at vcl/unx/generic/app/saldata.cxx:551:41
>  #67 in SalXLib::CheckTimeout(bool) at vcl/unx/generic/app/saldata.cxx:635:17
>  #68 in SalXLib::Yield(bool, bool) at vcl/unx/generic/app/saldata.cxx:716:25
>  #69 in X11SalInstance::DoYield(bool, bool) at vcl/unx/generic/app/salinst.cxx:182:20
>  #70 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:454:48
>  #71 in Application::Yield() at vcl/source/app/svapp.cxx:518:5
>  #72 in Application::Execute() at vcl/source/app/svapp.cxx:433:9
>  #73 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1602:17
>  #74 in ImplSVMain() at vcl/source/app/svmain.cxx:196:35
>  #75 in SVMain() at vcl/source/app/svmain.cxx:228:12
>  #76 in soffice_main at desktop/source/app/sofficemain.cxx:107:12
>  #77 in sal_main at desktop/source/app/main.c:48:15
>  #78 in main at desktop/source/app/main.c:47:1
> previously allocated by thread T0 here:
>  #0 in operator new(unsigned long) at compiler-rt/lib/asan/asan_new_delete.cpp:99:3
>  #1 in VclPtr<chart::sidebar::ChartLinePanel> VclPtr<chart::sidebar::ChartLinePanel>::Create<vcl::Window*&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, chart::ChartController*&>(vcl::Window*&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, chart::ChartController*&) at include/vcl/vclptr.hxx:129:42
>  #2 in chart::sidebar::ChartLinePanel::Create(vcl::Window*, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, chart::ChartController*) at chart2/source/controller/sidebar/ChartLinePanel.cxx:117:12
>  #3 in chart::sidebar::ChartPanelFactory::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at chart2/source/controller/sidebar/Chart2PanelFactory.cxx:107:22
>  #4 in non-virtual thunk to chart::sidebar::ChartPanelFactory::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at chart2/source/controller/sidebar/Chart2PanelFactory.cxx
>  #5 in (anonymous namespace)::UIElementFactoryManager::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/uifactory/uielementfactorymanager.cxx:437:39
>  #6 in non-virtual thunk to (anonymous namespace)::UIElementFactoryManager::createUIElement(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/uifactory/uielementfactorymanager.cxx
>  #7 in sfx2::sidebar::SidebarController::CreateUIElement(com::sun::star::uno::Reference<com::sun::star::awt::XWindowPeer> const&, rtl::OUString const&, bool, sfx2::sidebar::Context const&) at sfx2/source/sidebar/SidebarController.cxx:967:32
>  #8 in sfx2::sidebar::SidebarController::CreatePanel(rtl::OUString const&, vcl::Window*, bool, sfx2::sidebar::Context const&, VclPtr<sfx2::sidebar::Deck> const&) at sfx2/source/sidebar/SidebarController.cxx:908:43
>  #9 in sfx2::sidebar::SidebarController::CreatePanels(rtl::OUString const&, sfx2::sidebar::Context const&) at sfx2/source/sidebar/SidebarController.cxx:720:41
>  #10 in sfx2::sidebar::SidebarController::CreateDeck(rtl::OUString const&, sfx2::sidebar::Context const&, bool) at sfx2/source/sidebar/SidebarController.cxx:672:5
>  #11 in sfx2::sidebar::SidebarController::SwitchToDeck(sfx2::sidebar::DeckDescriptor const&, sfx2::sidebar::Context const&) at sfx2/source/sidebar/SidebarController.cxx:822:5
>  #12 in sfx2::sidebar::SidebarController::UpdateConfigurations() at sfx2/source/sidebar/SidebarController.cxx:569:9
>  #13 in sfx2::sidebar::SidebarController::notifyContextChangeEvent(com::sun::star::ui::ContextChangeEventObject const&) at sfx2/source/sidebar/SidebarController.cxx:323:9
>  #14 in (anonymous namespace)::ContextChangeEventMultiplexer::addContextChangeEventListener(com::sun::star::uno::Reference<com::sun::star::ui::XContextChangeEventListener> const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) at framework/source/services/ContextChangeEventMultiplexer.cxx:176:29
>  #15 in sfx2::sidebar::SidebarController::registerSidebarForFrame(sfx2::sidebar::SidebarController*, com::sun::star::uno::Reference<com::sun::star::frame::XController> const&) at sfx2/source/sidebar/SidebarController.cxx:213:19
>  #16 in chart::ChartController::attachFrame(com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at chart2/source/controller/main/ChartController.cxx:400:9
>  #17 in chart::ChartFrameLoader::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at chart2/source/controller/main/ChartFrameloader.cxx:133:22
>  #18 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1157:37
>  #19 in framework::LoadEnv::start() at framework/source/loadenv/loadenv.cxx:395:20
>  #20 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) at framework/source/loadenv/loadenv.cxx:300:5
>  #21 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&) at framework/source/loadenv/loadenv.cxx:169:14
>  #22 in (anonymous namespace)::XFrameImpl::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/frame.cxx:590:16
>  #23 in non-virtual thunk to (anonymous namespace)::XFrameImpl::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/frame.cxx
>  #24 in DocumentHolder::LoadDocToFrame(bool) at embeddedobj/source/general/docholder.cxx:984:31
>  #25 in DocumentHolder::ShowInplace(com::sun::star::uno::Reference<com::sun::star::awt::XWindowPeer> const&, com::sun::star::awt::Rectangle const&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&) at embeddedobj/source/general/docholder.cxx:477:15
>  #26 in OCommonEmbeddedObject::SwitchStateTo_Impl(int) at embeddedobj/source/commonembedding/embedobj.cxx:252:42
>  #27 in OCommonEmbeddedObject::changeState(int) at embeddedobj/source/commonembedding/embedobj.cxx:451:17
>  #28 in OCommonEmbeddedObject::doVerb(int) at embeddedobj/source/commonembedding/embedobj.cxx:537:9
>  #29 in SfxInPlaceClient::DoVerb(long) at sfx2/source/view/ipclient.cxx:950:40
>  #30 in ScTabViewShell::ActivateObject(SdrOle2Obj*, long) at sc/source/ui/view/tabvwshb.cxx:205:29
>  #31 in ScGridWinUIObject::execute(rtl::OUString const&, std::__debug::map<rtl::OUString const, rtl::OUString, std::less<rtl::OUString const>, std::allocator<std::pair<rtl::OUString const, rtl::OUString> > > const&) at sc/source/ui/uitest/uiobject.cxx:175:29
>  #32 in UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0::operator()() const at vcl/source/uitest/uno/uiobject_uno.cxx:124:16
>  #33 in void std::__invoke_impl<void, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&>(std::__invoke_other, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&) at include/c++/10.0.1/bits/invoke.h:60:14
>  #34 in std::enable_if<is_invocable_r_v<void, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&>, void>::type std::__invoke_r<void, UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&>(UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0&) at include/c++/10.0.1/bits/invoke.h:110:2
>  #35 in std::_Function_handler<void (), UIObjectUnoObj::executeAction(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)::$_0>::_M_invoke(std::_Any_data const&) at include/c++/10.0.1/bits/std_function.h:291:9
>  #36 in std::function<void ()>::operator()() const at include/c++/10.0.1/bits/std_function.h:622:14
>  #37 in (anonymous namespace)::ExecuteWrapper::ExecuteActionHdl(Timer*) at vcl/source/uitest/uno/uiobject_uno.cxx:83:13
>  #38 in (anonymous namespace)::ExecuteWrapper::LinkStubExecuteActionHdl(void*, Timer*) at vcl/source/uitest/uno/uiobject_uno.cxx:78:1
>  #39 in Link<Timer*, void>::Call(Timer*) const at include/tools/link.hxx:111:45
>  #40 in Timer::Invoke() at vcl/source/app/timer.cxx:75:21
>  #41 in Scheduler::ProcessTaskScheduling() at vcl/source/app/scheduler.cxx:478:20
>  #42 in Scheduler::CallbackTaskScheduling() at vcl/source/app/scheduler.cxx:287:5
>  #43 in SalTimer::CallCallback() at vcl/inc/saltimer.hxx:54:13
>  #44 in X11SalData::Timeout() at vcl/unx/generic/app/saldata.cxx:551:41
>  #45 in SalXLib::CheckTimeout(bool) at vcl/unx/generic/app/saldata.cxx:635:17
>  #46 in SalXLib::Yield(bool, bool) at vcl/unx/generic/app/saldata.cxx:716:25
>  #47 in X11SalInstance::DoYield(bool, bool) at vcl/unx/generic/app/salinst.cxx:182:20
>  #48 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:454:48
>  #49 in Application::Yield() at vcl/source/app/svapp.cxx:518:5
>  #50 in Application::Execute() at vcl/source/app/svapp.cxx:433:9
>  #51 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1602:17
>  #52 in ImplSVMain() at vcl/source/app/svmain.cxx:196:35
>  #53 in SVMain() at vcl/source/app/svmain.cxx:228:12
>  #54 in soffice_main at desktop/source/app/sofficemain.cxx:107:12
>  #55 in sal_main at desktop/source/app/main.c:48:15
>  #56 in main at desktop/source/app/main.c:47:1

The changes that were necessary to fix that scenario are those in
ChartAreaPanel.cxx and ChartLinePanel.cxx, but the other updateModel
implementations look equally broken.

Change-Id: I064fb701dc10e7cb7ef7ea5839f7dd1ae8d0ebba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91467
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <[email protected]>
  • Loading branch information
stbergmann committed Apr 2, 2020
1 parent 54df1aa commit aafea2f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chart2/source/controller/sidebar/ChartAreaPanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,12 @@ void ChartAreaPanel::updateModel(
xBroadcaster->removeModifyListener(mxListener);
}

css::uno::Reference<css::view::XSelectionSupplier> oldSelectionSupplier(
mxModel->getCurrentController(), css::uno::UNO_QUERY);
if (oldSelectionSupplier.is()) {
oldSelectionSupplier->removeSelectionChangeListener(mxSelectionListener.get());
}

mxModel = xModel;
mbModelValid = true;

Expand Down
6 changes: 6 additions & 0 deletions chart2/source/controller/sidebar/ChartAxisPanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ void ChartAxisPanel::updateModel(
xBroadcaster->removeModifyListener(mxModifyListener);
}

css::uno::Reference<css::view::XSelectionSupplier> oldSelectionSupplier(
mxModel->getCurrentController(), css::uno::UNO_QUERY);
if (oldSelectionSupplier.is()) {
oldSelectionSupplier->removeSelectionChangeListener(mxSelectionListener.get());
}

mxModel = xModel;
mbModelValid = true;

Expand Down
6 changes: 6 additions & 0 deletions chart2/source/controller/sidebar/ChartLinePanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ void ChartLinePanel::updateModel(
xBroadcaster->removeModifyListener(mxListener);
}

css::uno::Reference<css::view::XSelectionSupplier> oldSelectionSupplier(
mxModel->getCurrentController(), css::uno::UNO_QUERY);
if (oldSelectionSupplier.is()) {
oldSelectionSupplier->removeSelectionChangeListener(mxSelectionListener.get());
}

mxModel = xModel;
mbModelValid = true;

Expand Down
6 changes: 6 additions & 0 deletions chart2/source/controller/sidebar/ChartSeriesPanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ void ChartSeriesPanel::updateModel(
xBroadcaster->removeModifyListener(mxListener);
}

css::uno::Reference<css::view::XSelectionSupplier> oldSelectionSupplier(
mxModel->getCurrentController(), css::uno::UNO_QUERY);
if (oldSelectionSupplier.is()) {
oldSelectionSupplier->removeSelectionChangeListener(mxSelectionListener.get());
}

mxModel = xModel;
mbModelValid = true;

Expand Down

0 comments on commit aafea2f

Please sign in to comment.