desktop/source/deployment/gui/dp_gui_dialog2.cxx | 6 +++--- include/sfx2/templatelocalview.hxx | 2 +- include/svx/SvxPresetListBox.hxx | 2 +- include/vcl/customweld.hxx | 4 ++-- include/vcl/layout.hxx | 8 ++++---- include/vcl/weld.hxx | 7 ++----- sfx2/source/control/templatelocalview.cxx | 5 ++++- sfx2/source/control/templatesearchview.cxx | 5 ++++- sfx2/source/inc/templatesearchview.hxx | 2 +- svx/source/dialog/imapwnd.cxx | 5 ++--- svx/source/dialog/imapwnd.hxx | 2 +- svx/source/tbxctrls/SvxPresetListBox.cxx | 4 +++- sw/source/uibase/inc/unotools.hxx | 2 +- sw/source/uibase/utlui/unotools.cxx | 4 ++-- vcl/source/app/customweld.cxx | 6 +++--- vcl/source/app/salvtables.cxx | 10 +++++----- vcl/unx/gtk3/gtk3gtkinst.cxx | 2 +- 17 files changed, 40 insertions(+), 36 deletions(-)
New commits: commit 947150821e985c255f6c802322e696eff4257a5d Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Oct 2 09:16:39 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Oct 2 14:20:57 2019 +0200 extend popup handler to cover all CommandEvents Change-Id: I26360ce5c696d0e571385d83a15876eb2286e12f Reviewed-on: https://gerrit.libreoffice.org/80021 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index f73d1ffe2a28..247f4c431f51 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -117,7 +117,7 @@ public: void InitFromDialog(ExtMgrDialog *pParentDialog); virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override; - virtual bool ContextMenu( const CommandEvent& rCEvt ) override; + virtual bool Command( const CommandEvent& rCEvt ) override; virtual void RecalcAll() override; virtual void selectEntry( const long nPos ) override; @@ -214,10 +214,10 @@ void ExtBoxWithBtns_Impl::SetButtonStatus(const TEntry_Impl& rEntry) } } -bool ExtBoxWithBtns_Impl::ContextMenu(const CommandEvent& rCEvt) +bool ExtBoxWithBtns_Impl::Command(const CommandEvent& rCEvt) { if (rCEvt.GetCommand() != CommandEventId::ContextMenu) - return false; + return ExtensionBox_Impl::Command(rCEvt); const Point aMousePos(rCEvt.GetMousePosPixel()); const auto nPos = PointToPos(aMousePos); diff --git a/include/sfx2/templatelocalview.hxx b/include/sfx2/templatelocalview.hxx index 1ecd60926839..51ef5032a7da 100644 --- a/include/sfx2/templatelocalview.hxx +++ b/include/sfx2/templatelocalview.hxx @@ -201,7 +201,7 @@ public: virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override; - virtual bool ContextMenu(const CommandEvent& rPos) override; + virtual bool Command(const CommandEvent& rPos) override; virtual bool KeyInput( const KeyEvent& rKEvt ) override; diff --git a/include/svx/SvxPresetListBox.hxx b/include/svx/SvxPresetListBox.hxx index 4f6f251f48df..9ba47b655853 100644 --- a/include/svx/SvxPresetListBox.hxx +++ b/include/svx/SvxPresetListBox.hxx @@ -41,7 +41,7 @@ public: SvxPresetListBox(std::unique_ptr<weld::ScrolledWindow> pWindow); virtual void Resize() override; - virtual bool ContextMenu(const CommandEvent& rEvent) override; + virtual bool Command(const CommandEvent& rEvent) override; static sal_uInt32 getColumnCount() { return nColCount; } Size const & GetIconSize() const { return aIconSize; } diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx index 47fdc99164f5..dc8fd57afd41 100644 --- a/include/vcl/customweld.hxx +++ b/include/vcl/customweld.hxx @@ -33,7 +33,7 @@ public: virtual void GetFocus() {} virtual void LoseFocus() {} virtual void StyleUpdated() { Invalidate(); } - virtual bool ContextMenu(const CommandEvent&) { return false; } + virtual bool Command(const CommandEvent&) { return false; } virtual bool KeyInput(const KeyEvent&) { return false; } virtual tools::Rectangle GetFocusRect() { return tools::Rectangle(); } virtual FactoryFunction GetUITestFactory() const { return nullptr; } @@ -104,7 +104,7 @@ private: DECL_LINK(DoLoseFocus, weld::Widget&, void); DECL_LINK(DoKeyPress, const KeyEvent&, bool); DECL_LINK(DoFocusRect, weld::Widget&, tools::Rectangle); - DECL_LINK(DoPopupMenu, const CommandEvent&, bool); + DECL_LINK(DoCommand, const CommandEvent&, bool); DECL_LINK(DoStyleUpdated, weld::Widget&, void); DECL_LINK(DoRequestHelp, tools::Rectangle&, OUString); diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx index ec40707c6306..0164b2b09df0 100644 --- a/include/vcl/layout.hxx +++ b/include/vcl/layout.hxx @@ -623,7 +623,7 @@ private: Link<const KeyEvent&, bool> m_aKeyPressHdl; Link<const KeyEvent&, bool> m_aKeyReleaseHdl; Link<VclDrawingArea&, void> m_aStyleUpdatedHdl; - Link<const CommandEvent&, bool> m_aPopupMenuHdl; + Link<const CommandEvent&, bool> m_aCommandHdl; Link<tools::Rectangle&, OUString> m_aQueryTooltipHdl; virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override @@ -680,7 +680,7 @@ private: } virtual void Command(const CommandEvent& rEvent) override { - if (rEvent.GetCommand() == CommandEventId::ContextMenu && m_aPopupMenuHdl.Call(rEvent)) + if (m_aCommandHdl.Call(rEvent)) return; Control::Command(rEvent); } @@ -760,9 +760,9 @@ public: { m_aStyleUpdatedHdl = rLink; } - void SetPopupMenuHdl(const Link<const CommandEvent&, bool>& rLink) + void SetCommandHdl(const Link<const CommandEvent&, bool>& rLink) { - m_aPopupMenuHdl = rLink; + m_aCommandHdl = rLink; } void SetQueryTooltipHdl(const Link<tools::Rectangle&, OUString>& rLink) { diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 5338ce410a62..afd6266c377e 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1708,7 +1708,7 @@ public: protected: Link<draw_args, void> m_aDrawHdl; Link<Widget&, void> m_aStyleUpdatedHdl; - Link<const CommandEvent&, bool> m_aPopupMenuHdl; + Link<const CommandEvent&, bool> m_aCommandHdl; Link<Widget&, tools::Rectangle> m_aGetFocusRectHdl; Link<tools::Rectangle&, OUString> m_aQueryTooltipHdl; @@ -1720,10 +1720,7 @@ protected: public: void connect_draw(const Link<draw_args, void>& rLink) { m_aDrawHdl = rLink; } void connect_style_updated(const Link<Widget&, void>& rLink) { m_aStyleUpdatedHdl = rLink; } - void connect_popup_menu(const Link<const CommandEvent&, bool>& rLink) - { - m_aPopupMenuHdl = rLink; - } + void connect_command(const Link<const CommandEvent&, bool>& rLink) { m_aCommandHdl = rLink; } void connect_focus_rect(const Link<Widget&, tools::Rectangle>& rLink) { m_aGetFocusRectHdl = rLink; diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index 4ba55dead866..6eb22537e004 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -1157,8 +1157,11 @@ bool SfxTemplateLocalView::MouseButtonDown( const MouseEvent& rMEvt ) return SfxThumbnailView::MouseButtonDown(rMEvt); } -bool SfxTemplateLocalView::ContextMenu(const CommandEvent& rCEvt) +bool SfxTemplateLocalView::Command(const CommandEvent& rCEvt) { + if (rCEvt.GetCommand() != CommandEventId::ContextMenu) + return CustomWidgetController::Command(rCEvt); + if (rCEvt.IsMouseEvent()) { deselectItems(); diff --git a/sfx2/source/control/templatesearchview.cxx b/sfx2/source/control/templatesearchview.cxx index 0203352a0040..759c888ce8d7 100644 --- a/sfx2/source/control/templatesearchview.cxx +++ b/sfx2/source/control/templatesearchview.cxx @@ -83,8 +83,11 @@ bool TemplateSearchView::KeyInput( const KeyEvent& rKEvt ) return SfxThumbnailView::KeyInput(rKEvt); } -bool TemplateSearchView::ContextMenu(const CommandEvent& rCEvt) +bool TemplateSearchView::Command(const CommandEvent& rCEvt) { + if (rCEvt.GetCommand() != CommandEventId::ContextMenu) + return CustomWidgetController::Command(rCEvt); + if (rCEvt.IsMouseEvent()) { deselectItems(); diff --git a/sfx2/source/inc/templatesearchview.hxx b/sfx2/source/inc/templatesearchview.hxx index ae7658f3ae44..69073653be2a 100644 --- a/sfx2/source/inc/templatesearchview.hxx +++ b/sfx2/source/inc/templatesearchview.hxx @@ -48,7 +48,7 @@ private: virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override; - virtual bool ContextMenu(const CommandEvent& rPos) override; + virtual bool Command(const CommandEvent& rPos) override; virtual bool KeyInput( const KeyEvent& rKEvt ) override; diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 55ebd74a2d32..32862c2e5be2 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -482,7 +482,7 @@ IMapObject* IMapWindow::GetIMapObj( const SdrObject* pSdrObj ) return pIMapObj; } -bool IMapWindow::ContextMenu(const CommandEvent& rCEvt) +bool IMapWindow::Command(const CommandEvent& rCEvt) { vcl::Region aRegion; @@ -525,8 +525,7 @@ bool IMapWindow::ContextMenu(const CommandEvent& rCEvt) return true; } - else - return CustomWidgetController::ContextMenu(rCEvt); + return CustomWidgetController::Command(rCEvt); } IMapDropTargetHelper::IMapDropTargetHelper(IMapWindow& rImapWindow) diff --git a/svx/source/dialog/imapwnd.hxx b/svx/source/dialog/imapwnd.hxx index 464a6e6d3894..62242c9ffd1b 100644 --- a/svx/source/dialog/imapwnd.hxx +++ b/svx/source/dialog/imapwnd.hxx @@ -95,7 +95,7 @@ class IMapWindow final : public GraphCtrl // GraphCtrl virtual bool MouseButtonUp(const MouseEvent& rMEvt) override; virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; - virtual bool ContextMenu(const CommandEvent& rCEvt) override; + virtual bool Command(const CommandEvent& rCEvt) override; virtual OUString RequestHelp(tools::Rectangle& rHelpArea) override; virtual void SdrObjCreated( const SdrObject& rObj ) override; virtual void SdrObjChanged( const SdrObject& rObj ) override; diff --git a/svx/source/tbxctrls/SvxPresetListBox.cxx b/svx/source/tbxctrls/SvxPresetListBox.cxx index 87c554c1bd75..effc9fce5fd5 100644 --- a/svx/source/tbxctrls/SvxPresetListBox.cxx +++ b/svx/source/tbxctrls/SvxPresetListBox.cxx @@ -43,8 +43,10 @@ void SvxPresetListBox::Resize() SvtValueSet::Resize(); } -bool SvxPresetListBox::ContextMenu(const CommandEvent& rEvent) +bool SvxPresetListBox::Command(const CommandEvent& rEvent) { + if (rEvent.GetCommand() != CommandEventId::ContextMenu) + return CustomWidgetController::Command(rEvent); const sal_uInt16 nIndex = GetSelectedItemId(); if(nIndex > 0) { diff --git a/sw/source/uibase/inc/unotools.hxx b/sw/source/uibase/inc/unotools.hxx index 429f6a0e96c4..830e39085a52 100644 --- a/sw/source/uibase/inc/unotools.hxx +++ b/sw/source/uibase/inc/unotools.hxx @@ -65,7 +65,7 @@ public: const OUString* pURL = nullptr); virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; - virtual bool ContextMenu(const CommandEvent& rCEvt) override; + virtual bool Command(const CommandEvent& rCEvt) override; virtual ~SwOneExampleFrame() override; css::uno::Reference< css::frame::XModel > & GetModel() {return m_xModel;} diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx index 4023a4bb1847..24c7069b95c3 100644 --- a/sw/source/uibase/utlui/unotools.cxx +++ b/sw/source/uibase/utlui/unotools.cxx @@ -127,7 +127,7 @@ void SwOneExampleFrame::SetDrawingArea(weld::DrawingArea* pDrawingArea) CreateControl(); } -bool SwOneExampleFrame::ContextMenu(const CommandEvent& rCEvt) +bool SwOneExampleFrame::Command(const CommandEvent& rCEvt) { switch (rCEvt.GetCommand()) { @@ -141,7 +141,7 @@ bool SwOneExampleFrame::ContextMenu(const CommandEvent& rCEvt) default:; break; } - return false; + return CustomWidgetController::Command(rCEvt); } void SwOneExampleFrame::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) diff --git a/vcl/source/app/customweld.cxx b/vcl/source/app/customweld.cxx index 4299bcffd27b..d6465ff289f5 100644 --- a/vcl/source/app/customweld.cxx +++ b/vcl/source/app/customweld.cxx @@ -30,7 +30,7 @@ CustomWeld::CustomWeld(weld::Builder& rBuilder, const OString& rDrawingId, m_xDrawingArea->connect_key_press(LINK(this, CustomWeld, DoKeyPress)); m_xDrawingArea->connect_focus_rect(LINK(this, CustomWeld, DoFocusRect)); m_xDrawingArea->connect_style_updated(LINK(this, CustomWeld, DoStyleUpdated)); - m_xDrawingArea->connect_popup_menu(LINK(this, CustomWeld, DoPopupMenu)); + m_xDrawingArea->connect_command(LINK(this, CustomWeld, DoCommand)); m_xDrawingArea->connect_query_tooltip(LINK(this, CustomWeld, DoRequestHelp)); m_rWidgetController.SetDrawingArea(m_xDrawingArea.get()); } @@ -80,9 +80,9 @@ IMPL_LINK_NOARG(CustomWeld, DoStyleUpdated, weld::Widget&, void) m_rWidgetController.StyleUpdated(); } -IMPL_LINK(CustomWeld, DoPopupMenu, const CommandEvent&, rPos, bool) +IMPL_LINK(CustomWeld, DoCommand, const CommandEvent&, rPos, bool) { - return m_rWidgetController.ContextMenu(rPos); + return m_rWidgetController.Command(rPos); } IMPL_LINK(CustomWeld, DoRequestHelp, tools::Rectangle&, rHelpArea, OUString) diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index de80c738c59b..0dabf4b94858 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -4895,7 +4895,7 @@ private: DECL_LINK(KeyPressHdl, const KeyEvent&, bool); DECL_LINK(KeyReleaseHdl, const KeyEvent&, bool); DECL_LINK(StyleUpdatedHdl, VclDrawingArea&, void); - DECL_LINK(PopupMenuHdl, const CommandEvent&, bool); + DECL_LINK(CommandHdl, const CommandEvent&, bool); DECL_LINK(QueryTooltipHdl, tools::Rectangle&, OUString); // SalInstanceWidget has a generic listener for all these @@ -4941,7 +4941,7 @@ public: m_xDrawingArea->SetKeyPressHdl(LINK(this, SalInstanceDrawingArea, KeyPressHdl)); m_xDrawingArea->SetKeyReleaseHdl(LINK(this, SalInstanceDrawingArea, KeyReleaseHdl)); m_xDrawingArea->SetStyleUpdatedHdl(LINK(this, SalInstanceDrawingArea, StyleUpdatedHdl)); - m_xDrawingArea->SetPopupMenuHdl(LINK(this, SalInstanceDrawingArea, PopupMenuHdl)); + m_xDrawingArea->SetCommandHdl(LINK(this, SalInstanceDrawingArea, CommandHdl)); m_xDrawingArea->SetQueryTooltipHdl(LINK(this, SalInstanceDrawingArea, QueryTooltipHdl)); } @@ -5019,7 +5019,7 @@ public: virtual ~SalInstanceDrawingArea() override { m_xDrawingArea->SetQueryTooltipHdl(Link<tools::Rectangle&, OUString>()); - m_xDrawingArea->SetPopupMenuHdl(Link<const CommandEvent&, bool>()); + m_xDrawingArea->SetCommandHdl(Link<const CommandEvent&, bool>()); m_xDrawingArea->SetStyleUpdatedHdl(Link<VclDrawingArea&, void>()); m_xDrawingArea->SetMousePressHdl(Link<const MouseEvent&, bool>()); m_xDrawingArea->SetMouseMoveHdl(Link<const MouseEvent&, bool>()); @@ -5079,9 +5079,9 @@ IMPL_LINK_NOARG(SalInstanceDrawingArea, StyleUpdatedHdl, VclDrawingArea&, void) m_aStyleUpdatedHdl.Call(*this); } -IMPL_LINK(SalInstanceDrawingArea, PopupMenuHdl, const CommandEvent&, rEvent, bool) +IMPL_LINK(SalInstanceDrawingArea, CommandHdl, const CommandEvent&, rEvent, bool) { - return m_aPopupMenuHdl.Call(rEvent); + return m_aCommandHdl.Call(rEvent); } IMPL_LINK(SalInstanceDrawingArea, QueryTooltipHdl, tools::Rectangle&, rHelpArea, OUString) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 5359f9106b52..70d743541ede 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -9820,7 +9820,7 @@ private: } virtual bool signal_popup_menu(const CommandEvent& rCEvt) override { - return m_aPopupMenuHdl.Call(rCEvt); + return m_aCommandHdl.Call(rCEvt); } public: GtkInstanceDrawingArea(GtkDrawingArea* pDrawingArea, GtkInstanceBuilder* pBuilder, const a11yref& rA11y, bool bTakeOwnership) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits