summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-27 20:55:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-10-28 09:08:50 +0000
commit117fc49c979d65e5479635eab3ce10d74d076679 (patch)
tree9dbfee8cc04b2bf6f5eab0522ed9270de0d14a5c /sc
parent8f0f5e0c709d01555a4069f8665889924ed181c7 (diff)
ScopedVclPtr vs std::unique_ptr for VclAbstractDialog derivatives
Change-Id: I5e43312b6f42ce0c63946f366eaf1e6dcb9629b2 Reviewed-on: https://gerrit.libreoffice.org/30344 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/scabstdlg.hxx69
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeList.cxx2
-rw-r--r--sc/source/ui/dbgui/PivotLayoutTreeListData.cxx2
-rw-r--r--sc/source/ui/docshell/docsh4.cxx10
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx12
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx4
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx4
-rw-r--r--sc/source/ui/drawfunc/drtxtob1.cxx6
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx2
-rw-r--r--sc/source/ui/pagedlg/tphf.cxx2
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx2
-rw-r--r--sc/source/ui/unoobj/filtuno.cxx6
-rw-r--r--sc/source/ui/view/cellsh1.cxx36
-rw-r--r--sc/source/ui/view/cellsh2.cxx10
-rw-r--r--sc/source/ui/view/cellsh3.cxx12
-rw-r--r--sc/source/ui/view/editsh.cxx10
-rw-r--r--sc/source/ui/view/formatsh.cxx4
-rw-r--r--sc/source/ui/view/gridwin2.cxx5
-rw-r--r--sc/source/ui/view/pivotsh.cxx2
-rw-r--r--sc/source/ui/view/prevwsh.cxx2
-rw-r--r--sc/source/ui/view/tabvwsh3.cxx8
-rw-r--r--sc/source/ui/view/tabvwsha.cxx4
-rw-r--r--sc/source/ui/view/tabvwshf.cxx10
-rw-r--r--sc/source/ui/view/viewfun5.cxx4
-rw-r--r--sc/source/ui/view/viewutil.cxx2
25 files changed, 148 insertions, 82 deletions
diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx
index bf939b9c2956..bd5f5d954224 100644
--- a/sc/inc/scabstdlg.hxx
+++ b/sc/inc/scabstdlg.hxx
@@ -55,6 +55,8 @@ namespace com { namespace sun { namespace star { namespace sheet {
class AbstractScImportAsciiDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScImportAsciiDlg() override = default;
public:
virtual void GetOptions( ScAsciiOptions& rOpt ) = 0;
virtual void SaveParameters() = 0;
@@ -62,6 +64,8 @@ public:
class AbstractScAutoFormatDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScAutoFormatDlg() override = default;
public:
virtual sal_uInt16 GetIndex() const = 0 ;
virtual OUString GetCurrFormatName() = 0;
@@ -69,6 +73,8 @@ public:
class AbstractScColRowLabelDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScColRowLabelDlg() override = default;
public:
virtual bool IsCol() = 0;
virtual bool IsRow() = 0;
@@ -76,6 +82,8 @@ public:
class AbstractScCondFormatManagerDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScCondFormatManagerDlg() override = default;
public:
virtual ScConditionalFormatList* GetConditionalFormatList() = 0;
@@ -88,12 +96,16 @@ public:
class AbstractScDataPilotDatabaseDlg :public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScDataPilotDatabaseDlg() override = default;
public:
virtual void GetValues( ScImportSourceDesc& rDesc ) = 0;
};
class AbstractScDataPilotSourceTypeDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScDataPilotSourceTypeDlg() override = default;
public:
virtual bool IsDatabase() const = 0;
virtual bool IsExternal() const = 0;
@@ -104,6 +116,8 @@ public:
class AbstractScDataPilotServiceDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScDataPilotServiceDlg() override = default;
public:
virtual OUString GetServiceName() const = 0;
virtual OUString GetParSource() const = 0 ;
@@ -114,6 +128,8 @@ public:
class AbstractScDeleteCellDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScDeleteCellDlg() override = default;
public:
virtual DelCellCmd GetDelCellCmd() const = 0;
};
@@ -121,11 +137,14 @@ public:
//for dataform
class AbstractScDataFormDlg : public VclAbstractDialog
{
-
+protected:
+ virtual ~AbstractScDataFormDlg() override = default;
};
class AbstractScDeleteContentsDlg: public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScDeleteContentsDlg() override = default;
public:
virtual void DisableObjects() = 0 ;
virtual InsertDeleteFlags GetDelContentsCmdBits() const = 0;
@@ -133,6 +152,8 @@ public:
class AbstractScFillSeriesDlg: public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScFillSeriesDlg() override = default;
public:
virtual FillDir GetFillDir() const = 0;
virtual FillCmd GetFillCmd() const = 0;
@@ -146,18 +167,24 @@ public:
class AbstractScGroupDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScGroupDlg() override = default;
public:
virtual bool GetColsChecked() const = 0;
};
class AbstractScInsertCellDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScInsertCellDlg() override = default;
public:
virtual InsCellCmd GetInsCellCmd() const = 0;
};
class AbstractScInsertContentsDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScInsertContentsDlg() override = default;
public:
virtual InsertDeleteFlags GetInsContentsCmdBits() const = 0;
virtual ScPasteFunc GetFormulaCmdBits() const = 0 ;
@@ -173,6 +200,8 @@ public:
class AbstractScInsertTableDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScInsertTableDlg() override = default;
public:
virtual bool GetTablesFromFile() = 0;
virtual bool GetTablesAsLink() = 0;
@@ -186,12 +215,16 @@ public:
class AbstractScSelEntryDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScSelEntryDlg() override = default;
public:
virtual OUString GetSelectEntry() const = 0;
};
class AbstractScLinkedAreaDlg : public VclAbstractDialog2
{
+protected:
+ virtual ~AbstractScLinkedAreaDlg() override = default;
public:
virtual void InitFromOldLink( const OUString& rFile, const OUString& rFilter,
const OUString& rOptions, const OUString& rSource,
@@ -205,12 +238,16 @@ public:
class AbstractScMetricInputDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScMetricInputDlg() override = default;
public:
virtual long GetInputValue() const = 0;
};
class AbstractScMoveTableDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScMoveTableDlg() override = default;
public:
virtual sal_uInt16 GetSelectedDocument () const = 0;
virtual sal_uInt16 GetSelectedTable () const = 0;
@@ -223,24 +260,32 @@ public:
class AbstractScNameCreateDlg : public VclAbstractDialog // Manage Name Dialog
{
+protected:
+ virtual ~AbstractScNameCreateDlg() override = default;
public:
virtual sal_uInt16 GetFlags() const = 0;
};
class AbstractScNamePasteDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScNamePasteDlg() override = default;
public:
virtual std::vector<OUString> GetSelectedNames() const = 0;
};
class AbstractScPivotFilterDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScPivotFilterDlg() override = default;
public:
virtual const ScQueryItem& GetOutputItem() = 0;
};
class AbstractScDPFunctionDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScDPFunctionDlg() override = default;
public:
virtual PivotFunc GetFuncMask() const = 0;
virtual css::sheet::DataPilotFieldReference GetFieldRef() const = 0;
@@ -248,6 +293,8 @@ public:
class AbstractScDPSubtotalDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScDPSubtotalDlg() override = default;
public:
virtual PivotFunc GetFuncMask() const = 0;
virtual void FillLabelData( ScDPLabelData& rLabelData ) const = 0;
@@ -255,12 +302,16 @@ public:
class AbstractScDPNumGroupDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScDPNumGroupDlg() override = default;
public:
virtual ScDPNumGroupInfo GetGroupInfo() const = 0;
};
class AbstractScDPDateGroupDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScDPDateGroupDlg() override = default;
public:
virtual ScDPNumGroupInfo GetGroupInfo() const = 0;
virtual sal_Int32 GetDatePart() const = 0;
@@ -268,12 +319,16 @@ public:
class AbstractScDPShowDetailDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScDPShowDetailDlg() override = default;
public:
virtual OUString GetDimensionName() const = 0;
};
class AbstractScNewScenarioDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScNewScenarioDlg() override = default;
public:
virtual void SetScenarioData( const OUString& rName, const OUString& rComment,
@@ -285,6 +340,8 @@ public:
class AbstractScShowTabDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScShowTabDlg() override = default;
public:
virtual void Insert( const OUString& rString, bool bSelected ) = 0;
virtual sal_Int32 GetSelectEntryCount() const = 0;
@@ -295,28 +352,38 @@ public:
class AbstractScSortWarningDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScSortWarningDlg() override = default;
};
class AbstractScStringInputDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScStringInputDlg() override = default;
public:
virtual OUString GetInputString() const = 0;
};
class AbstractScTabBgColorDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScTabBgColorDlg() override = default;
public:
virtual void GetSelectedColor( Color& rColor ) const = 0;
};
class AbstractScImportOptionsDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScImportOptionsDlg() override = default;
public:
virtual void GetImportOptions( ScImportOptions& rOptions ) const = 0;
};
class AbstractScTextImportOptionsDlg : public VclAbstractDialog
{
+protected:
+ virtual ~AbstractScTextImportOptionsDlg() override = default;
public:
virtual LanguageType GetLanguageType() const = 0;
virtual bool IsDateConversionSet() const = 0;
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx
index c53590d73db2..98fd3db01b9c 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeList.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeList.cxx
@@ -56,7 +56,7 @@ bool ScPivotLayoutTreeList::DoubleClickHdl()
vector<ScDPName> aDataFieldNames;
mpParent->PushDataFieldNames(aDataFieldNames);
- std::unique_ptr<AbstractScDPSubtotalDlg> pDialog(
+ ScopedVclPtr<AbstractScDPSubtotalDlg> pDialog(
pFactory->CreateScDPSubtotalDlg(this, mpParent->maPivotTableObject, rCurrentLabelData, rCurrentFunctionData, aDataFieldNames));
if (pDialog->Execute() == RET_OK)
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
index dc24b8079b1b..85f04c531d1d 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListData.cxx
@@ -76,7 +76,7 @@ bool ScPivotLayoutTreeListData::DoubleClickHdl()
ScAbstractDialogFactory* pFactory = ScAbstractDialogFactory::Create();
- std::unique_ptr<AbstractScDPFunctionDlg> pDialog(
+ ScopedVclPtr<AbstractScDPFunctionDlg> pDialog(
pFactory->CreateScDPFunctionDlg(this, mpParent->GetLabelDataVector(), rCurrentLabelData, rCurrentFunctionData));
if (pDialog->Execute() == RET_OK)
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 977f03e70f02..63a2db5e8f32 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -323,7 +323,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScColRowLabelDlg> pDlg(pFact->CreateScColRowLabelDlg(pParent, bRowHeaders, bColHeaders));
+ ScopedVclPtr<AbstractScColRowLabelDlg> pDlg(pFact->CreateScColRowLabelDlg(pParent, bRowHeaders, bColHeaders));
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
@@ -872,7 +872,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScNewScenarioDlg> pNewDlg(pFact->CreateScNewScenarioDlg(GetActiveDialogParent(), aName, true, bSheetProtected));
+ ScopedVclPtr<AbstractScNewScenarioDlg> pNewDlg(pFact->CreateScNewScenarioDlg(GetActiveDialogParent(), aName, true, bSheetProtected));
OSL_ENSURE(pNewDlg, "Dialog create fail!");
pNewDlg->SetScenarioData( aName, aComment, aColor, nFlags );
if ( pNewDlg->Execute() == RET_OK )
@@ -1565,7 +1565,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScStyleDlg( GetActiveDialogParent(), *pStyleSheet, RID_SCDLG_STYLES_PAGE, RID_SCDLG_STYLES_PAGE ));
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScStyleDlg( GetActiveDialogParent(), *pStyleSheet, RID_SCDLG_STYLES_PAGE, RID_SCDLG_STYLES_PAGE ));
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
@@ -1605,7 +1605,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
PageStyleModified( aNewName, false );
rReq.Done();
}
- pDlg.reset();
+ pDlg.disposeAndClear();
rStyleSet.ClearItem( ATTR_PAGE_PAPERTRAY );
}
@@ -1727,7 +1727,7 @@ void ScDocShell::ExecutePageStyle( SfxViewShell& rCaller,
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg(
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg(
GetActiveDialogParent(),
rStyleSet,
aStr,
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 35a063941a35..756ed34a4584 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -262,7 +262,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if ( pFact )
{
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateCaptionDialog( pWin, pView ));
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateCaptionDialog( pWin, pView ));
const sal_uInt16* pRange = pDlg->GetInputRanges( *aNewAttr.GetPool() );
SfxItemSet aCombSet( *aNewAttr.GetPool(), pRange );
@@ -284,7 +284,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxTransformTabDialog( pWin, &aNewAttr,pView ));
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxTransformTabDialog( pWin, &aNewAttr,pView ));
OSL_ENSURE(pDlg, "Dialog creation failed!");
if (pDlg->Execute() == RET_OK)
{
@@ -345,7 +345,7 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, vcl::Window* pWin )
xFrame = GetViewShell()->GetViewFrame()->GetFrame().GetFrameInterface();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- std::unique_ptr<SfxAbstractDialog> pMacroDlg(pFact->CreateSfxDialog( pWin, *pItemSet, xFrame, SID_EVENTCONFIG ));
+ ScopedVclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateSfxDialog( pWin, *pItemSet, xFrame, SID_EVENTCONFIG ));
if ( pMacroDlg && pMacroDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
@@ -390,7 +390,7 @@ void ScDrawShell::ExecuteLineDlg( SfxRequest& rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialog creation failed!");
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( pViewData->GetDialogParent(),
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSvxLineTabDialog( pViewData->GetDialogParent(),
&aNewAttr,
pViewData->GetDocument()->GetDrawLayer(),
pObj,
@@ -419,7 +419,7 @@ void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq )
pView->MergeAttrFromMarked( aNewAttr, false );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- std::unique_ptr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(
+ ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(
pViewData->GetDialogParent(), &aNewAttr,
pViewData->GetDocument()->GetDrawLayer(), true));
@@ -445,7 +445,7 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq )
pView->MergeAttrFromMarked( aNewAttr, false );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aNewAttr, pView ));
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aNewAttr, pView ));
sal_uInt16 nResult = pDlg->Execute();
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index cf4f4542e892..989fc898657e 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -482,7 +482,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialog creation failed!");
- std::unique_ptr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(aName));
+ ScopedVclPtr<AbstractSvxObjectNameDialog> pDlg(pFact->CreateSvxObjectNameDialog(aName));
OSL_ENSURE(pDlg, "Dialog creation failed!");
pDlg->SetCheckNameHdl(LINK(this, ScDrawShell, NameObjectHdl));
@@ -551,7 +551,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialog creation failed!");
- std::unique_ptr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(aTitle, aDescription));
+ ScopedVclPtr<AbstractSvxObjectTitleDescDialog> pDlg(pFact->CreateSvxObjectTitleDescDialog(aTitle, aDescription));
OSL_ENSURE(pDlg, "Dialog creation failed!");
if(RET_OK == pDlg->Execute())
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 7f74fb4c1239..7521afb942f7 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -872,14 +872,14 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
case SID_DRAWTEXT_ATTR_DLG:
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aEditAttr, pView ));
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( pViewData->GetDialogParent(), &aEditAttr, pView ));
bDone = ( RET_OK == pDlg->Execute() );
if ( bDone )
aNewAttr.Put( *pDlg->GetOutputItemSet() );
- pDlg.reset();
+ pDlg.disposeAndClear();
SfxBindings& rBindings = pViewData->GetBindings();
rBindings.Invalidate( SID_TABLE_VERT_NONE );
diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx
index aae2f0548bdc..a4a23f969cca 100644
--- a/sc/source/ui/drawfunc/drtxtob1.cxx
+++ b/sc/source/ui/drawfunc/drtxtob1.cxx
@@ -47,7 +47,7 @@ bool ScDrawTextObjectBar::ExecuteCharDlg( const SfxItemSet& rArgs,
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
assert(pFact && "ScAbstractFactory create fail!");
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg(
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg(
pViewData->GetDialogParent(), &rArgs,
pViewData->GetSfxDocShell()));
assert(pDlg && "Dialog create fail!");
@@ -94,7 +94,7 @@ bool ScDrawTextObjectBar::ExecuteParaDlg( const SfxItemSet& rArgs,
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScParagraphDlg(
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScParagraphDlg(
pViewData->GetDialogParent(), &aNewAttr));
OSL_ENSURE(pDlg, "Dialog create fail!");
bool bRet = ( pDlg->Execute() == RET_OK );
@@ -114,7 +114,7 @@ void ScDrawTextObjectBar::ExecutePasteContents( SfxRequest & /* rReq */ )
SdrView* pView = pViewData->GetScDrawView();
OutlinerView* pOutView = pView->GetTextEditOutlinerView();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- std::unique_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pViewData->GetDialogParent() ));
+ ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pViewData->GetDialogParent() ));
pDlg->Insert( SotClipboardFormatId::STRING, EMPTY_OUSTRING );
pDlg->Insert( SotClipboardFormatId::RTF, EMPTY_OUSTRING );
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 975f9b169c0c..41610a0ea11a 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -241,7 +241,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView*
case SID_INSERT_FLOATINGFRAME :
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- std::unique_ptr<SfxAbstractInsertObjectDialog> pDlg(
+ ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg(
pFact->CreateInsertObjectDialog( pViewShell->GetWindow(), SC_MOD()->GetSlotPool()->GetSlot(nSlot)->GetCommandString(),
xStorage, &aServerLst ));
if ( pDlg )
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index c67cebb028cb..2a4e385c851c 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -186,7 +186,7 @@ IMPL_LINK_NOARG(ScHFPage, HFEditHdl, void*, void)
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg(
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScHFEditDlg(
this, aDataSet, aStrPageStyle, nResId));
OSL_ENSURE(pDlg, "Dialog create fail!");
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index 4face4a60e86..2fd8ff02a245 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -201,7 +201,7 @@ void ScEditWindow::SetCharAttributes()
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg(
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg(
GetParent(), &aSet, pDocSh));
OSL_ENSURE(pDlg, "Dialog create fail!");
pDlg->SetText( ScGlobal::GetRscString( STR_TEXTATTRS ) );
diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index 96f74ce7b949..f11fc1ee18d5 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -176,7 +176,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException, st
if ( xInputStream.is() )
pInStream.reset(utl::UcbStreamHelper::CreateStream( xInputStream ));
- std::unique_ptr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg( aPrivDatName, pInStream.get(), SC_IMPORTFILE));
+ ScopedVclPtr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg( aPrivDatName, pInStream.get(), SC_IMPORTFILE));
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
{
@@ -194,7 +194,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException, st
else
{
// HTML import.
- std::unique_ptr<AbstractScTextImportOptionsDlg> pDlg(
+ ScopedVclPtr<AbstractScTextImportOptionsDlg> pDlg(
pFact->CreateScTextImportOptionsDlg());
if (pDlg->Execute() == RET_OK)
@@ -277,7 +277,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException, st
ScImportOptions aOptions( cAsciiDel, cStrDel, eEncoding);
- std::unique_ptr<AbstractScImportOptionsDlg> pDlg(pFact->CreateScImportOptionsDlg(
+ ScopedVclPtr<AbstractScImportOptionsDlg> pDlg(pFact->CreateScImportOptionsDlg(
bAscii, &aOptions, &aTitle, bMultiByte, bDBEnc,
!bExport));
OSL_ENSURE(pDlg, "Dialog create fail!");
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 165b5ef3d0cb..12f1f3184ea3 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -221,7 +221,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScInsertCellDlg> pDlg(pFact->CreateScInsertCellDlg( pTabViewShell->GetDialogParent(), bTheFlag));
+ ScopedVclPtr<AbstractScInsertCellDlg> pDlg(pFact->CreateScInsertCellDlg( pTabViewShell->GetDialogParent(), bTheFlag));
OSL_ENSURE(pDlg, "Dialog create fail!");
if (pDlg->Execute() == RET_OK)
eCmd = pDlg->GetInsCellCmd();
@@ -293,7 +293,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScDeleteCellDlg> pDlg(pFact->CreateScDeleteCellDlg( pTabViewShell->GetDialogParent(), bTheFlag ));
+ ScopedVclPtr<AbstractScDeleteCellDlg> pDlg(pFact->CreateScDeleteCellDlg( pTabViewShell->GetDialogParent(), bTheFlag ));
OSL_ENSURE(pDlg, "Dialog create fail!");
if (pDlg->Execute() == RET_OK)
@@ -375,7 +375,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScDeleteContentsDlg> pDlg(pFact->CreateScDeleteContentsDlg(pTabViewShell->GetDialogParent()));
+ ScopedVclPtr<AbstractScDeleteContentsDlg> pDlg(pFact->CreateScDeleteContentsDlg(pTabViewShell->GetDialogParent()));
OSL_ENSURE(pDlg, "Dialog create fail!");
ScDocument* pDoc = GetViewData()->GetDocument();
SCTAB nTab = GetViewData()->GetTabNo();
@@ -482,7 +482,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScInsertContentsDlg> pDlg(pFact->CreateScInsertContentsDlg( pTabViewShell->GetDialogParent(),
+ ScopedVclPtr<AbstractScInsertContentsDlg> pDlg(pFact->CreateScInsertContentsDlg( pTabViewShell->GetDialogParent(),
&ScGlobal::GetRscString(STR_FILL_TAB)));
OSL_ENSURE(pDlg, "Dialog create fail!");
pDlg->SetFillMode(true);
@@ -715,7 +715,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScFillSeriesDlg> pDlg(pFact->CreateScFillSeriesDlg( pTabViewShell->GetDialogParent(),
+ ScopedVclPtr<AbstractScFillSeriesDlg> pDlg(pFact->CreateScFillSeriesDlg( pTabViewShell->GetDialogParent(),
*pDoc,
eFillDir, eFillCmd, eFillDateCmd,
aStartStr, fIncVal, fMaxVal,
@@ -1173,7 +1173,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetDialogParent()));
+ ScopedVclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetDialogParent()));
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
bColumns = pDlg->GetColsChecked();
@@ -1232,7 +1232,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetDialogParent(), true));
+ ScopedVclPtr<AbstractScGroupDlg> pDlg(pFact->CreateAbstractScGroupDlg(pTabViewShell->GetDialogParent(), true));
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
bColumns = pDlg->GetColsChecked();
@@ -1396,7 +1396,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScInsertContentsDlg> pDlg(pFact->CreateScInsertContentsDlg(pTabViewShell->GetDialogParent()));
+ ScopedVclPtr<AbstractScInsertContentsDlg> pDlg(pFact->CreateScInsertContentsDlg(pTabViewShell->GetDialogParent()));
OSL_ENSURE(pDlg, "Dialog create fail!");
pDlg->SetOtherDoc( bOtherDoc );
// if ChangeTrack MoveMode disable
@@ -1596,7 +1596,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if ( nFormatCount )
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- std::unique_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pTabViewShell->GetDialogParent() ));
+ ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pTabViewShell->GetDialogParent() ));
if ( pDlg )
{
for (sal_uInt16 i=0; i<nFormatCount; i++)
@@ -1831,7 +1831,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScNameCreateDlg> pDlg(pFact->CreateScNameCreateDlg(pTabViewShell->GetDialogParent(), nFlags));
+ ScopedVclPtr<AbstractScNameCreateDlg> pDlg(pFact->CreateScNameCreateDlg(pTabViewShell->GetDialogParent(), nFlags));
OSL_ENSURE(pDlg, "Dialog create fail!");
if( pDlg->Execute() )
@@ -2148,7 +2148,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScNamePasteDlg> pDlg(pFact->CreateScNamePasteDlg( pTabViewShell->GetDialogParent(), GetViewData()->GetDocShell() ));
+ ScopedVclPtr<AbstractScNamePasteDlg> pDlg(pFact->CreateScNamePasteDlg( pTabViewShell->GetDialogParent(), GetViewData()->GetDocShell() ));
OSL_ENSURE(pDlg, "Dialog create fail!");
switch( pDlg->Execute() )
{
@@ -2360,7 +2360,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
aSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
aSet.Put( SvxFontItem( aCurFont.GetFamilyType(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), GetPool().GetWhich(SID_ATTR_CHAR_FONT) ) );
- std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( pTabViewShell->GetDialogParent(), aSet,
+ ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( pTabViewShell->GetDialogParent(), aSet,
pTabViewShell->GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP ));
if ( pDlg->Execute() == RET_OK )
@@ -2460,7 +2460,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if (!pList)
pList = pDoc->GetCondFormList( aPos.Tab() );
- std::unique_ptr<AbstractScCondFormatManagerDlg> pDlg(pFact->CreateScCondFormatMgrDlg(
+ ScopedVclPtr<AbstractScCondFormatManagerDlg> pDlg(pFact->CreateScCondFormatMgrDlg(
pTabViewShell->GetDialogParent(), pDoc, pList));
if (pDlgItem)
@@ -2699,7 +2699,7 @@ void ScCellShell::ExecuteDataPilotDialog()
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScDataPilotSourceTypeDlg> pTypeDlg(
+ ScopedVclPtr<AbstractScDataPilotSourceTypeDlg> pTypeDlg(
pFact->CreateScDataPilotSourceTypeDlg(
pTabViewShell->GetDialogParent(), bEnableExt));
@@ -2718,7 +2718,7 @@ void ScCellShell::ExecuteDataPilotDialog()
if ( pTypeDlg->IsExternal() )
{
std::vector<OUString> aSources = ScDPObject::GetRegisteredSources();
- std::unique_ptr<AbstractScDataPilotServiceDlg> pServDlg(
+ ScopedVclPtr<AbstractScDataPilotServiceDlg> pServDlg(
pFact->CreateScDataPilotServiceDlg(
pTabViewShell->GetDialogParent(), aSources));
@@ -2739,7 +2739,7 @@ void ScCellShell::ExecuteDataPilotDialog()
{
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScDataPilotDatabaseDlg> pDataDlg(
+ ScopedVclPtr<AbstractScDataPilotDatabaseDlg> pDataDlg(
pFact->CreateScDataPilotDatabaseDlg(
pTabViewShell->GetDialogParent()));
@@ -2870,7 +2870,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
return;
}
- std::unique_ptr<SfxAbstractTabDialog> pDlg;
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg;
ScSubTotalParam aSubTotalParam;
SfxItemSet aArgSet( GetPool(), SCITEM_SUBTDATA, SCITEM_SUBTDATA );
@@ -2893,7 +2893,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
assert(pFact); //"ScAbstractFactory create fail
- pDlg.reset(pFact->CreateScSubTotalDlg(pTabViewShell->GetDialogParent(), &aArgSet));
+ pDlg.disposeAndReset(pFact->CreateScSubTotalDlg(pTabViewShell->GetDialogParent(), &aArgSet));
assert(pDlg); // "Dialog create fail
pDlg->SetCurPageId(1);
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 9f653391060d..c3073f36c173 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -181,7 +181,7 @@ static bool lcl_GetSortParam( const ScViewData* pData, ScSortParam& rSortParam )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScSortWarningDlg> pWarningDlg(pFact->CreateScSortWarningDlg( pTabViewShell->GetDialogParent(), aExtendStr, aCurrentStr ));
+ ScopedVclPtr<AbstractScSortWarningDlg> pWarningDlg(pFact->CreateScSortWarningDlg( pTabViewShell->GetDialogParent(), aExtendStr, aCurrentStr ));
OSL_ENSURE(pWarningDlg, "Dialog create fail!");
short bResult = pWarningDlg->Execute();
if( bResult == BTN_EXTEND_RANGE || bResult == BTN_CURRENT_SELECTION )
@@ -335,7 +335,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScDataFormDlg> pDlg(pFact->CreateScDataFormDlg(
+ ScopedVclPtr<AbstractScDataFormDlg> pDlg(pFact->CreateScDataFormDlg(
pTabViewShell->GetDialogParent(), pTabViewShell));
OSL_ENSURE(pDlg, "Dialog create fail!");
@@ -495,7 +495,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
assert(pFact); //ScAbstractFactory create fail!
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScSortDlg(pTabViewShell->GetDialogParent(), &aArgSet));
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScSortDlg(pTabViewShell->GetDialogParent(), &aArgSet));
assert(pDlg); //Dialog create fail!
pDlg->SetCurPageId("criteria"); // 1=sort field tab 2=sort options tab
@@ -738,7 +738,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScSelEntryDlg> pDlg(pFact->CreateScSelEntryDlg( pTabViewShell->GetDialogParent(),
+ ScopedVclPtr<AbstractScSelEntryDlg> pDlg(pFact->CreateScSelEntryDlg( pTabViewShell->GetDialogParent(),
aList ));
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
@@ -982,7 +982,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE( pFact, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pFact is null!" );
- std::unique_ptr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg(
+ ScopedVclPtr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg(
OUString(), &aStream, SC_TEXTTOCOLUMNS));
OSL_ENSURE( pDlg, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pDlg is null!" );
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 1c2a91998812..a9f4c2abab38 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -509,7 +509,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScNewScenarioDlg> pNewDlg(pFact->CreateScNewScenarioDlg(pTabViewShell->GetDialogParent(), aName, false, bSheetProtected));
+ ScopedVclPtr<AbstractScNewScenarioDlg> pNewDlg(pFact->CreateScNewScenarioDlg(pTabViewShell->GetDialogParent(), aName, false, bSheetProtected));
OSL_ENSURE(pNewDlg, "Dialog create fail!");
if ( pNewDlg->Execute() == RET_OK )
{
@@ -581,7 +581,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
assert(pFact); //ScAbstractFactory create fail!
- std::unique_ptr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
+ ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
pTabViewShell->GetDialogParent(), "RowHeightDialog",
nCurHeight, ScGlobal::nStdRowHeight,
eMetric, 2, MAX_ROW_HEIGHT));
@@ -622,7 +622,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
assert(pFact); //ScAbstractFactory create fail!
- std::unique_ptr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
+ ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
pTabViewShell->GetDialogParent(), "OptimalRowHeightDialog",
ScGlobal::nLastRowHeightExtra, 0, eMetric, 1, MAX_EXTRA_HEIGHT));
assert(pDlg); //Dialog create fail!
@@ -686,7 +686,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
assert(pFact); //ScAbstractFactory create fail!
- std::unique_ptr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
+ ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
pTabViewShell->GetDialogParent(), "ColWidthDialog", nCurHeight,
STD_COL_WIDTH, eMetric, 2, MAX_COL_WIDTH));
assert(pDlg); //Dialog create fail!
@@ -726,7 +726,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
assert(pFact); //ScAbstractFactory create fail!
- std::unique_ptr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
+ ScopedVclPtr<AbstractScMetricInputDlg> pDlg(pFact->CreateScMetricInputDlg(
pTabViewShell->GetDialogParent(), "OptimalColWidthDialog",
ScGlobal::nLastColWidthExtra, STD_EXTRA_WIDTH, eMetric, 1, MAX_EXTRA_WIDTH));
assert(pDlg); //Dialog create fail!
@@ -875,7 +875,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScAutoFormatDlg> pDlg(pFact->CreateScAutoFormatDlg(pDlgParent, ScGlobal::GetOrCreateAutoFormat(), pNewEntry.get(), GetViewData()));
+ ScopedVclPtr<AbstractScAutoFormatDlg> pDlg(pFact->CreateScAutoFormatDlg(pDlgParent, ScGlobal::GetOrCreateAutoFormat(), pNewEntry.get(), GetViewData()));
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( pDlg->Execute() == RET_OK )
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index fc0c29bd10e4..1e1aae092de0 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -273,7 +273,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
case SID_PASTE_SPECIAL:
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- std::unique_ptr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pViewData->GetDialogParent() ));
+ ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( pViewData->GetDialogParent() ));
SotClipboardFormatId nFormat = SotClipboardFormatId::NONE;
if ( pDlg )
{
@@ -285,7 +285,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
nFormat = pDlg->GetFormat( aDataHelper.GetTransferable() );
}
- pDlg.reset();
+ pDlg.disposeAndClear();
// while the dialog was open, edit mode may have been stopped
if (!SC_MOD()->IsInputMode())
@@ -453,7 +453,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScNamePasteDlg> pDlg(pFact->CreateScNamePasteDlg( pViewData->GetDialogParent(), pViewData->GetDocShell(), false ));
+ ScopedVclPtr<AbstractScNamePasteDlg> pDlg(pFact->CreateScNamePasteDlg( pViewData->GetDialogParent(), pViewData->GetDocShell(), false ));
OSL_ENSURE(pDlg, "Dialog create fail!");
short nRet = pDlg->Execute();
// pDlg is needed below
@@ -478,7 +478,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
pTopView->InsertText(aBuffer.makeStringAndClear());
}
}
- pDlg.reset();
+ pDlg.disposeAndClear();
if (pTopView)
pTopView->GetWindow()->GrabFocus();
@@ -495,7 +495,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg(
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg(
pViewData->GetDialogParent(), &aAttrs, pObjSh));
OSL_ENSURE(pDlg, "Dialog create fail!");
if (nSlot == SID_CHAR_DLG_EFFECT)
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 8794ba12b2a0..28f3fd6e46c0 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -777,7 +777,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
if ( pStyleSheet )
{
SfxStyleFamily eFam = pStyleSheet->GetFamily();
- std::unique_ptr<SfxAbstractTabDialog> pDlg;
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg;
sal_uInt16 nRsc = 0;
// Store old Items from the style
@@ -860,7 +860,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- pDlg.reset(pFact->CreateScStyleDlg( pParent, *pStyleSheet, nRsc, nRsc ));
+ pDlg.disposeAndReset(pFact->CreateScStyleDlg( pParent, *pStyleSheet, nRsc, nRsc ));
OSL_ENSURE(pDlg, "Dialog create fail!");
short nResult = pDlg->Execute();
pTabViewShell->SetInFormatDialog(false);
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index e81f1ece6a92..c2e34db084ea 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -54,7 +54,6 @@ using namespace css;
using namespace css::sheet;
using css::sheet::DataPilotFieldOrientation;
using std::vector;
-using std::unique_ptr;
DataPilotFieldOrientation ScGridWindow::GetDPFieldOrientation( SCCOL nCol, SCROW nRow ) const
{
@@ -207,7 +206,7 @@ void ScGridWindow::DoPushPivotButton( SCCOL nCol, SCROW nRow, const MouseEvent&
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- const std::unique_ptr<AbstractScPivotFilterDlg> pDlg(
+ ScopedVclPtr<AbstractScPivotFilterDlg> pDlg(
pFact->CreateScPivotFilterDlg(
pViewData->GetViewShell()->GetDialogParent(), aArgSet, nSrcTab));
OSL_ENSURE(pDlg, "Dialog create fail!");
@@ -435,7 +434,7 @@ private:
void ScGridWindow::DPLaunchFieldPopupMenu(
const Point& rScrPos, const Size& rScrSize, const ScAddress& rPos, ScDPObject* pDPObj)
{
- unique_ptr<DPFieldPopupData> pDPData(new DPFieldPopupData);
+ std::unique_ptr<DPFieldPopupData> pDPData(new DPFieldPopupData);
sal_uInt16 nOrient;
pDPData->mnDim = pDPObj->GetHeaderDim(rPos, nOrient);
diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx
index 13899b25eaaf..b86a21876bd6 100644
--- a/sc/source/ui/view/pivotsh.cxx
+++ b/sc/source/ui/view/pivotsh.cxx
@@ -107,7 +107,7 @@ void ScPivotShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScPivotFilterDlg> pDlg(pFact->CreateScPivotFilterDlg(
+ ScopedVclPtr<AbstractScPivotFilterDlg> pDlg(pFact->CreateScPivotFilterDlg(
pViewShell->GetDialogParent(), aArgSet, nSrcTab));
OSL_ENSURE(pDlg, "Dialog create fail!");
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index b1c0089ff11c..b27d5355ba45 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -640,7 +640,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- std::unique_ptr<AbstractSvxZoomDialog> pDlg(pFact->CreateSvxZoomDialog(nullptr, aSet));
+ ScopedVclPtr<AbstractSvxZoomDialog> pDlg(pFact->CreateSvxZoomDialog(nullptr, aSet));
OSL_ENSURE(pDlg, "Dialog creation failed!");
pDlg->SetLimits( 20, 400 );
pDlg->HideButton( ZoomButtonId::OPTIMAL );
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 38a8364e9826..eb154dd01253 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -708,7 +708,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
{
SfxItemSet aSet ( GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
SvxZoomItem aZoomItem( eOldZoomType, nOldZoom, SID_ATTR_ZOOM );
- std::unique_ptr<AbstractSvxZoomDialog> pDlg;
+ ScopedVclPtr<AbstractSvxZoomDialog> pDlg;
ScMarkData& rMark = GetViewData().GetMarkData();
SvxZoomEnableFlags nBtnFlags = SvxZoomEnableFlags::N50
| SvxZoomEnableFlags::N75
@@ -726,7 +726,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
if(pFact)
{
- pDlg.reset(pFact->CreateSvxZoomDialog(GetDialogParent(), aSet ));
+ pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(GetDialogParent(), aSet));
OSL_ENSURE(pDlg, "Dialog creation failed!");
}
if (pDlg)
@@ -851,7 +851,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScShowTabDlg> pDlg(pFact->CreateScShowTabDlg(GetDialogParent()));
+ ScopedVclPtr<AbstractScShowTabDlg> pDlg(pFact->CreateScShowTabDlg(GetDialogParent()));
OSL_ENSURE(pDlg, "Dialog create fail!");
pDlg->SetDescription(
OUString( ScResId( STR_DLG_SELECTTABLES_TITLE ) ),
@@ -871,7 +871,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
const sal_Int32 nSelCount = pDlg->GetSelectEntryCount();
for( sal_Int32 nSelIx = 0; nSelIx < nSelCount; ++nSelIx )
aIndexList.insert( aIndexList.begin()+nSelIx, pDlg->GetSelectEntryPos( nSelIx ) );
- pDlg.reset();
+ pDlg.disposeAndClear();
rReq.AppendItem( SfxIntegerListItem( SID_SELECT_TABLES, aIndexList ) );
}
else
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 149b31098760..b3e19e12afd1 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -478,7 +478,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
const ScPatternAttr* pOldAttrs = GetSelectionPattern();
- std::unique_ptr<SfxAbstractTabDialog> pDlg;
+ ScopedVclPtr<SfxAbstractTabDialog> pDlg;
std::unique_ptr<SfxItemSet> pOldSet(new SfxItemSet(pOldAttrs->GetItemSet()));
std::unique_ptr<SvxNumberInfoItem> pNumberInfoItem;
@@ -538,7 +538,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- pDlg.reset(pFact->CreateScAttrDlg(GetDialogParent(), pOldSet.get()));
+ pDlg.disposeAndReset(pFact->CreateScAttrDlg(GetDialogParent(), pOldSet.get()));
if (!rName.isEmpty())
pDlg->SetCurPageId(rName);
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index b8b1d3f18e10..a62c76e2d6e3 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -131,7 +131,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScShowTabDlg> pDlg(pFact->CreateScShowTabDlg(GetDialogParent()));
+ ScopedVclPtr<AbstractScShowTabDlg> pDlg(pFact->CreateScShowTabDlg(GetDialogParent()));
OSL_ENSURE(pDlg, "Dialog create fail!");
OUString aTabName;
@@ -207,7 +207,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScInsertTableDlg> pDlg(pFact->CreateScInsertTableDlg(GetDialogParent(), rViewData,
+ ScopedVclPtr<AbstractScInsertTableDlg> pDlg(pFact->CreateScInsertTableDlg(GetDialogParent(), rViewData,
nTabSelCount, nSlot == FID_INS_TABLE_EXT));
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( RET_OK == pDlg->Execute() )
@@ -385,7 +385,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScStringInputDlg> pDlg(pFact->CreateScStringInputDlg(
+ ScopedVclPtr<AbstractScStringInputDlg> pDlg(pFact->CreateScStringInputDlg(
GetDialogParent(), aDlgTitle, OUString(ScResId(SCSTR_NAME)),
aName, GetStaticInterface()->GetSlot(nSlot)->GetCommand(),
pHelpId));
@@ -510,7 +510,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScMoveTableDlg> pDlg(pFact->CreateScMoveTableDlg(GetDialogParent(),
+ ScopedVclPtr<AbstractScMoveTableDlg> pDlg(pFact->CreateScMoveTableDlg(GetDialogParent(),
aDefaultName));
OSL_ENSURE(pDlg, "Dialog create fail!");
@@ -736,7 +736,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
aTabBgColor = pDoc->GetTabBgColor( nCurrentTab );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- std::unique_ptr<AbstractScTabBgColorDlg> pDlg(pFact->CreateScTabBgColorDlg(
+ ScopedVclPtr<AbstractScTabBgColorDlg> pDlg(pFact->CreateScTabBgColorDlg(
GetDialogParent(),
OUString(ScResId(SCSTR_SET_TAB_BG_COLOR)),
OUString(ScResId(SCSTR_NO_TAB_BG_COLOR)),
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 6903e9ae3a24..9a3ae1b14f04 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -306,7 +306,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
// this for html pasting only, but in the future it may
// make sense to do it for other data types too.
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
- std::unique_ptr<AbstractScTextImportOptionsDlg> pDlg(
+ ScopedVclPtr<AbstractScTextImportOptionsDlg> pDlg(
pFact->CreateScTextImportOptionsDlg());
if (pDlg->Execute() == RET_OK)
@@ -335,7 +335,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
ScImportStringStream aStrm( aStr);
ScAbstractDialogFactory* pFact =
ScAbstractDialogFactory::Create();
- std::unique_ptr<AbstractScImportAsciiDlg> pDlg(
+ ScopedVclPtr<AbstractScImportAsciiDlg> pDlg(
pFact->CreateScImportAsciiDlg( OUString(), &aStrm, SC_PASTETEXT));
if (pDlg->Execute() == RET_OK)
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index 958a0424f339..fcd0e5c621a3 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -353,7 +353,7 @@ bool ScViewUtil::ExecuteCharMap( const SvxFontItem& rOldFont,
SfxAllItemSet aSet( rFrame.GetObjectShell()->GetPool() );
aSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
aSet.Put( SvxFontItem( rOldFont.GetFamily(), rOldFont.GetFamilyName(), rOldFont.GetStyleName(), rOldFont.GetPitch(), rOldFont.GetCharSet(), aSet.GetPool()->GetWhich( SID_ATTR_CHAR_FONT ) ) );
- std::unique_ptr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( &rFrame.GetWindow(), aSet, rFrame.GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP ));
+ ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog( &rFrame.GetWindow(), aSet, rFrame.GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP ));
if ( pDlg->Execute() == RET_OK )
{
const SfxStringItem* pItem = SfxItemSet::GetItem<SfxStringItem>(pDlg->GetOutputItemSet(), SID_CHARMAP, false);