From b6075c3afed5837a79a9c509f5b38f38eeacf6dc Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 17 Apr 2019 15:46:05 +0100 Subject: boil incomprehensible template spew down to its simpler reality MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6a428b6515bffb69b6890ddcf8990c2c773b506c Reviewed-on: https://gerrit.libreoffice.org/70889 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sc/source/ui/inc/anyrefdg.hxx | 41 ++++++++++------------------------------- sc/source/ui/inc/validate.hxx | 4 ++-- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx index 99c57edf5320..7fd1c4b19381 100644 --- a/sc/source/ui/inc/anyrefdg.hxx +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -241,49 +241,28 @@ struct ScAnyRefDlg : ::ScRefHdlrImpl< ScAnyRefDlg, SfxModelessDialog> } }; -template< class TWindow, bool bBindRef = true > -class ScRefHdlrControllerImplBase: public TWindow, public ScRefHandler -{ -private: - ScRefHdlrControllerImplBase(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent, const OUString& rUIXMLDescription, const OString& rID) - : TWindow(pB, pCW, pParent, rUIXMLDescription, rID) - , ScRefHandler(*static_cast(this), pB, bBindRef) - { - } - - ScRefHdlrControllerImplBase(weld::Window* pParent, const OUString& rUIXMLDescription, const OString& rID, const SfxItemSet* pArg, SfxBindings *pB) - : TWindow(pParent, rUIXMLDescription, rID, pArg) - , ScRefHandler(*static_cast(this), pB, bBindRef) - { - } - - virtual ~ScRefHdlrControllerImplBase() override - { - } - - template friend struct ScRefHdlrControllerImpl; -}; - -template -struct ScRefHdlrControllerImpl : ScRefHdlrControllerImplBase +template +struct ScRefHdlrControllerImpl : public TBase, public ScRefHandler { enum { UNKNOWN_SLOTID = 0U, SLOTID = UNKNOWN_SLOTID }; - ScRefHdlrControllerImpl(weld::Window* rt1, const OUString& rt2, const OString& rt3, const SfxItemSet* rt4, SfxBindings *rt5) - : ScRefHdlrControllerImplBase(rt1, rt2, rt3, rt4, rt5) + ScRefHdlrControllerImpl(weld::Window* pParent, const OUString& rUIXMLDescription, const OString& rID, const SfxItemSet* pArg, SfxBindings *pB) + : TBase(pParent, rUIXMLDescription, rID, pArg) + , ScRefHandler(*static_cast(this), pB, bBindRef) { } - ScRefHdlrControllerImpl(SfxBindings* rt1, SfxChildWindow* rt2, weld::Window* rt3, const OUString& rt4, const OString& rt5) - : ScRefHdlrControllerImplBase(rt1, rt2, rt3, rt4, rt5) + ScRefHdlrControllerImpl(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent, const OUString& rUIXMLDescription, const OString& rID) + : TBase(pB, pCW, pParent, rUIXMLDescription, rID) + , ScRefHandler(*static_cast(this), pB, bBindRef) { } }; -struct ScAnyRefDlgController : ScRefHdlrControllerImpl +struct ScAnyRefDlgController : ScRefHdlrControllerImpl { ScAnyRefDlgController(SfxBindings* rt1, SfxChildWindow* rt2, weld::Window* rt3, const OUString& rt4, const OString& rt5) - : ScRefHdlrControllerImpl(rt1, rt2, rt3, rt4, rt5) + : ScRefHdlrControllerImpl(rt1, rt2, rt3, rt4, rt5) { } }; diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx index d28ee58192cd..661b605387d9 100644 --- a/sc/source/ui/inc/validate.hxx +++ b/sc/source/ui/inc/validate.hxx @@ -146,10 +146,10 @@ public: /** The "Validity" tab dialog. */ class ScValidationDlg - : public ScRefHdlrControllerImpl + : public ScRefHdlrControllerImpl , public ScRefHandlerHelper { - typedef ScRefHdlrControllerImpl ScValidationDlgBase; + typedef ScRefHdlrControllerImpl ScValidationDlgBase; ScTabViewShell * const m_pTabVwSh; OString m_sValuePageId; -- cgit v1.2.3