diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-01-22 08:23:38 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-01-22 08:37:26 +0100 |
commit | 60db0ded330f800306b9a829922bf389e1c0aa07 (patch) | |
tree | e11dc31f724045e05336e11bf1b12455fa5919b1 /sc | |
parent | ee27dae3b5df1e3fc63ecb2ee2c2d123fd4c8cff (diff) |
Move sc/source/ui/dbgui/validate.cxx from scui to sc
8d1a24dae03690b576310e3539369916f31ac475 "Make virtual ~ScValidationDlg
non-inline" caused the RTTI for ScValidationDlg to only be emitted in library
scui instead of (weakly) wherever needed. That causes UBSan to fail when it
uses the RTTI in ScValidityRefChildWin::ScValidityRefChildWin
(sc/source/ui/view/reffact.cxx, in library sc, to check that operations on
VclPtr<ScValidationDlg> pDlg indeed operate on an ScValidationDlg object).
The cleanest fix appears to be to move ScValidationDlg from scui to sc. As
Moggi put it on IRC, "that dialog should be in sc as it is a modeless dialog; no
idea why it works for that dialog but all other modeless calc dialogs have to be
in sc to avoid linker problems."
One remaining question is whether it is save nowadays in ScCellShell::ExecuteDB
(sc/source/ui/view/cellsh2.cxx) to clean up the ScValidationDlg pointed to by
pDlg when that VclPtr<ScValidationDlg> variable goes out of scope, instead of
doing the PostUserEvent(... DelayDeleteAbstractDialog) dance that was there
before because "after end execute from !IsModalInputMode, it is safer to delay
deleting." Lets see.
Change-Id: I3ecfd4fafc7b37b2f30e75974ece9b0a23311ef4
Diffstat (limited to 'sc')
-rw-r--r-- | sc/Library_sc.mk | 1 | ||||
-rw-r--r-- | sc/Library_scui.mk | 1 | ||||
-rw-r--r-- | sc/inc/scabstdlg.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.cxx | 13 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.hxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh2.cxx | 22 |
6 files changed, 4 insertions, 41 deletions
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index 8304a9adf44d..d082a6bd62df 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -403,6 +403,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ sc/source/ui/dbgui/PivotLayoutTreeListLabel \ sc/source/ui/dbgui/PivotLayoutTreeList \ sc/source/ui/dbgui/sfiltdlg \ + sc/source/ui/dbgui/validate \ sc/source/ui/dialogs/searchresults \ sc/source/ui/docshell/arealink \ sc/source/ui/docshell/autostyl \ diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk index 75d6966d64b6..fa9d6ea6796e 100644 --- a/sc/Library_scui.mk +++ b/sc/Library_scui.mk @@ -74,7 +74,6 @@ $(eval $(call gb_Library_add_exception_objects,scui,\ sc/source/ui/dbgui/textimportoptions \ sc/source/ui/dbgui/tpsort \ sc/source/ui/dbgui/tpsubt \ - sc/source/ui/dbgui/validate \ sc/source/ui/docshell/tpstat \ sc/source/ui/miscdlgs/crdlg \ sc/source/ui/miscdlgs/datafdlg \ diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index d994763a3a20..52d8a62380e5 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -485,13 +485,10 @@ public: virtual SfxAbstractTabDialog * CreateScParagraphDlg(vcl::Window* pParent, const SfxItemSet* pAttr) = 0; - virtual SfxAbstractTabDialog * CreateScValidationDlg(vcl::Window* pParent, - const SfxItemSet* pArgSet, ScTabViewShell *pTabVwSh) = 0; virtual SfxAbstractTabDialog * CreateScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet) = 0; // for tabpage virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) = 0; - virtual GetTabPageRanges GetTabPageRangesFunc() = 0; protected: ~ScAbstractDialogFactory() {} diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index a7a2540006f1..5078aed30061 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -55,7 +55,6 @@ #include "styledlg.hxx" #include "subtdlg.hxx" #include "textdlgs.hxx" -#include "validate.hxx" #include "sortdlg.hxx" #include "textimportoptions.hxx" #include "opredlin.hxx" @@ -998,13 +997,6 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScParagraphDlg( return new ScAbstractTabDialog_Impl(pDlg); } -SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScValidationDlg(vcl::Window* pParent, - const SfxItemSet* pArgSet, ScTabViewShell *pTabVwSh) -{ - VclPtr<SfxTabDialog> pDlg = VclPtr<ScValidationDlg>::Create(pParent, pArgSet, pTabVwSh); - return new ScAbstractTabDialog_Impl(pDlg); -} - SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet) { VclPtr<SfxTabDialog> pDlg = VclPtr<ScSortDlg>::Create( pParent, pArgSet ); @@ -1043,9 +1035,4 @@ CreateTabPage ScAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nI return nullptr; } -GetTabPageRanges ScAbstractDialogFactory_Impl::GetTabPageRangesFunc() -{ - return ScTPValidationValue::GetRanges; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index 014057e5d3d3..356f519ad01a 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -549,16 +549,11 @@ public: virtual SfxAbstractTabDialog * CreateScParagraphDlg(vcl::Window* pParent, const SfxItemSet* pAttr) override; - virtual SfxAbstractTabDialog * CreateScValidationDlg(vcl::Window* pParent, - const SfxItemSet* pArgSet, ScTabViewShell *pTabVwSh) override; - virtual SfxAbstractTabDialog * CreateScSortDlg(vcl::Window* pParent, const SfxItemSet* pArgSet) override; // For TabPage virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) override; - virtual GetTabPageRanges GetTabPageRangesFunc() override; - }; #endif diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 354ae1f02c11..240248fdc6e8 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -52,6 +52,7 @@ #include "dbnamdlg.hxx" #include "reffact.hxx" #include "validat.hxx" +#include "validate.hxx" #include "scresid.hxx" #include "scui_def.hxx" @@ -201,15 +202,6 @@ static bool lcl_GetSortParam( const ScViewData* pData, ScSortParam& rSortParam ) return bSort; } -//after end execute from !IsModalInputMode, it is safer to delay deleting -namespace -{ - void DelayDeleteAbstractDialog( void *pAbstractDialog, void * /*pArg*/ ) - { - delete static_cast<SfxAbstractTabDialog*>( pAbstractDialog ); - } -} - void ScCellShell::ExecuteDB( SfxRequest& rReq ) { ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell(); @@ -798,11 +790,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) } else { - ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - ::GetTabPageRanges ScTPValidationValueGetRanges = pFact->GetTabPageRangesFunc(); - OSL_ENSURE(ScTPValidationValueGetRanges, "TabPage create fail!"); - SfxItemSet aArgSet( GetPool(), (*ScTPValidationValueGetRanges)() ); + SfxItemSet aArgSet( GetPool(), ScTPValidationValue::GetRanges() ); ScValidationMode eMode = SC_VALID_ANY; ScConditionMode eOper = SC_COND_EQUAL; OUString aExpr1, aExpr2; @@ -861,8 +849,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) } // cell range picker - SfxAbstractTabDialog* pDlg = pFact->CreateScValidationDlg(nullptr, &aArgSet, pTabViewShell); - assert(pDlg); //Dialog create fail! + auto pDlg = VclPtr<ScValidationDlg>::Create(nullptr, &aArgSet, pTabViewShell); short nResult = pDlg->Execute(); if ( nResult == RET_OK ) @@ -961,9 +948,6 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) pTabViewShell->TestHintWindow(); rReq.Done( *pOutSet ); } - //after end execute from !IsModalInputMode, it is safer to delay deleting - //delete pDlg; - Application::PostUserEvent( Link<void*,void>( pDlg, &DelayDeleteAbstractDialog ) ); } } break; |