[Libreoffice-commits] core.git: sd/source
Stephan Bergmann
sbergman at redhat.com
Tue Oct 27 09:22:59 PDT 2015
sd/source/ui/slidesorter/controller/SlideSorterController.cxx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 125f0c95b7f5613d71bcf107b73a0ba422d54643
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Oct 27 17:18:48 2015 +0100
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
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index da8a3ec..04cf538 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)
{
More information about the Libreoffice-commits
mailing list