From 9a42c5939485732c031f6e6d30394b5414f6ad61 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 20 Aug 2014 17:02:33 +0200 Subject: Bad hack to enforce weakly emitted RTTI for ScValidationDlg ...(by inlining all its virtual functions), as otherwise -fsanitize=undefined makes sc require ScValidationDlg RTTI (to verify the cast to ScValidationDlg in the ScValidityRefChildWin ctor in sc/source/ui/view/reffact.cxx) but which would only be emitted in scui (against which sc cannot link). Change-Id: Id9e2bf0719ba3bba35e5ae1f0e58190d9fdb6dd4 --- sc/source/ui/dbgui/validate.cxx | 17 ----------------- sc/source/ui/inc/validate.hxx | 19 +++++++++++++++++-- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 6cfaafa88fbd..c4b9514ddc98 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -156,23 +156,6 @@ void ScTPValidationValue::RefInputDonePostHdl() } -bool ScValidationDlg::Close() -{ - if( m_bOwnRefHdlr ) - { - if (SfxTabPage* pPage = GetTabPage(m_nValuePageId)) - static_cast(pPage)->RemoveRefDlg(); - } - - return ScValidationDlgBase::Close(); -} - -ScValidationDlg::~ScValidationDlg() -{ - if( m_bOwnRefHdlr ) - RemoveRefDlg( false ); -} - namespace { /** Converts the passed ScValidationMode to the position in the list box. */ diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx index edda7dc26bad..12db0e7736c1 100644 --- a/sc/source/ui/inc/validate.hxx +++ b/sc/source/ui/inc/validate.hxx @@ -97,7 +97,11 @@ class ScValidationDlg public: explicit ScValidationDlg( Window* pParent, const SfxItemSet* pArgSet, ScTabViewShell * pTabViewSh, SfxBindings *pB = NULL ); - virtual ~ScValidationDlg(); + virtual ~ScValidationDlg() + { + if( m_bOwnRefHdlr ) + RemoveRefDlg( false ); + } static ScValidationDlg * Find1AliveObject( Window *pAncestor ) { return static_cast( SC_MOD()->Find1RefWindow( SLOTID, pAncestor ) ); @@ -169,7 +173,7 @@ public: enum { SLOTID = SID_VALIDITY_REFERENCE }; - bool Close() SAL_OVERRIDE; + inline bool Close() SAL_OVERRIDE; }; /** The tab page "Criteria" from the Validation dialog. */ @@ -257,6 +261,17 @@ public: void RemoveRefDlg(); }; +bool ScValidationDlg::Close() +{ + if( m_bOwnRefHdlr ) + { + if (SfxTabPage* pPage = GetTabPage(m_nValuePageId)) + static_cast(pPage)->RemoveRefDlg(); + } + + return ScValidationDlgBase::Close(); +} + class ScTPValidationHelp : public SfxTabPage { private: -- cgit