diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-10-27 17:18:48 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-10-27 17:22:38 +0100 |
commit | 125f0c95b7f5613d71bcf107b73a0ba422d54643 (patch) | |
tree | 4eeba04221acd62488460d83c47820d5db1352a6 /sd | |
parent | b147a77f2e179f474051a4e50fa7ea300cdec8ee (diff) |
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
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlideSorterController.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx index da8a3ecc9b5a..04cf53820e43 100644 --- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx +++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx @@ -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) { |