Kaydet (Commit) 125f0c95 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Filter out non-VclWindowEvents

...to avoid bad casts like

> sd/source/ui/slidesorter/controller/SlideSorterController.cxx:545:24: runtime error: downcast of address 0x7f2d4d9b0c40 which does not point to an object of type 'VclWindowEvent'
> 0x7f2d4d9b0c40: note: object is of type 'VclMenuEvent'
>  00 00 00 00  f0 f9 03 80 2d 7f 00 00  b2 04 00 00 00 00 00 00  40 51 72 00 10 61 00 00  01 00 00 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'VclMenuEvent'
>  sd::slidesorter::controller::SlideSorterController::ApplicationEventHandler(VclSimpleEvent&) sd/source/ui/slidesorter/controller/SlideSorterController.cxx:545:24
>  sd::slidesorter::controller::SlideSorterController::LinkStubApplicationEventHandler(void*, VclSimpleEvent&) sd/source/ui/slidesorter/controller/SlideSorterController.cxx:543:1
>  Link<VclSimpleEvent&, void>::Call(VclSimpleEvent&) const include/tools/link.hxx:84:45
>  VclEventListeners::Call(VclSimpleEvent&) const vcl/source/app/vclevent.cxx:74:17
>  Application::ImplCallEventListeners(VclSimpleEvent&) vcl/source/app/svapp.cxx:820:9
>  Menu::ImplCallEventListeners(unsigned long, unsigned short) vcl/source/window/menu.cxx:339:9
>  [...]

(Even the VCLEVENT_APPLICATION_DATACHANGED handled in WindowEventHandler /is/ a
VclWindowEvent, see how these events are created via ImplCallEventListeners in
Application::SetSettings, vcl/source/app/svapp.cxx.)

Change-Id: I107cbbff83e4a41090aadee6a66e715ef35901d4
üst b147a77f
......@@ -542,7 +542,10 @@ void SlideSorterController::HandleModelChange()
IMPL_LINK_TYPED(SlideSorterController, ApplicationEventHandler, VclSimpleEvent&, rEvent, void)
{
WindowEventHandler(static_cast<VclWindowEvent&>(rEvent));
auto windowEvent = dynamic_cast<VclWindowEvent *>(&rEvent);
if (windowEvent != nullptr) {
WindowEventHandler(*windowEvent);
}
}
IMPL_LINK_TYPED(SlideSorterController, WindowEventHandler, VclWindowEvent&, rEvent, void)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment