From 1e67e94f1a308ca60d4934e9fe9d5c048225ebe8 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 21 Sep 2015 08:03:25 +0200 Subject: convert Link<> to typed Change-Id: If3e2b00092440ebd42ae5b73ae2b0e44c3702683 --- svx/source/sidebar/insert/InsertPropertyPanel.cxx | 33 +++++++++-------------- svx/source/sidebar/insert/InsertPropertyPanel.hxx | 2 +- 2 files changed, 14 insertions(+), 21 deletions(-) (limited to 'svx') diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.cxx b/svx/source/sidebar/insert/InsertPropertyPanel.cxx index df89146cf949..ff120dcae83d 100644 --- a/svx/source/sidebar/insert/InsertPropertyPanel.cxx +++ b/svx/source/sidebar/insert/InsertPropertyPanel.cxx @@ -91,59 +91,52 @@ void InsertPropertyPanel::dispose() -IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent) +IMPL_LINK_TYPED(InsertPropertyPanel, WindowEventListener, VclWindowEvent&, rEvent, void) { // We will be getting a lot of window events (well, basically all // of them), so reject early everything that is not connected to // toolbox selection. - if (pEvent == NULL) - return 1; - if ( ! pEvent->ISA(VclWindowEvent)) - return 1; - if (pEvent->GetId() != VCLEVENT_TOOLBOX_SELECT) - return 1; - - VclWindowEvent* pWindowEvent = dynamic_cast(pEvent); - vcl::Window* pWindow = pWindowEvent ? pWindowEvent->GetWindow() : NULL; + if (rEvent.GetId() != VCLEVENT_TOOLBOX_SELECT) + return; + + vcl::Window* pWindow = rEvent.GetWindow(); ToolBox* pToolBox = dynamic_cast(pWindow); if (pToolBox == NULL) - return 1; + return; // Extract name of (sub)toolbar from help id. OUString sToolbarName (rtl::OStringToOUString(pToolBox->GetHelpId(), RTL_TEXTENCODING_UTF8)); if (sToolbarName.getLength() == 0) - return 1; + return; const util::URL aURL (sfx2::sidebar::Tools::GetURL(sToolbarName)); if (aURL.Path.getLength() == 0) - return 1; + return; // Get item id. sal_uInt16 nId = pToolBox->GetCurItemId(); if (nId == 0) - return 1; + return; SidebarToolBox* pSidebarToolBox = dynamic_cast(mpStandardShapesToolBox.get()); if (pSidebarToolBox == NULL) - return 1; + return; sal_uInt16 nItemId (pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path)); if (nItemId == 0) { pSidebarToolBox = dynamic_cast(mpCustomShapesToolBox.get()); if (pSidebarToolBox == NULL) - return 1; + return; nItemId = pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path); if (nItemId == 0) - return 1; + return; } Reference xController (pSidebarToolBox->GetControllerForItemId(nItemId), UNO_QUERY); if ( ! xController.is() ) - return 1; + return; const OUString sCommand (pToolBox->GetItemCommand(nId)); xController->functionSelected(sCommand); - - return 1; } diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.hxx b/svx/source/sidebar/insert/InsertPropertyPanel.hxx index 01ce363d5e02..f8feaf74f43c 100644 --- a/svx/source/sidebar/insert/InsertPropertyPanel.hxx +++ b/svx/source/sidebar/insert/InsertPropertyPanel.hxx @@ -49,7 +49,7 @@ private: VclPtr mpCustomShapesToolBox; const css::uno::Reference mxFrame; - DECL_LINK(WindowEventListener, VclSimpleEvent*); + DECL_LINK_TYPED(WindowEventListener, VclWindowEvent&, void); }; -- cgit