summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-02-11 14:42:23 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-04-09 22:17:00 +0100
commit00f2787a4a68633206635743298926bf2e65a8fa (patch)
treeefc3a4f02b3d8acd69d25071499be5a475cb0338 /sc
parentb3dcb2996b70caabda1939c9e85545c97d78404a (diff)
vclwidgets: wrap all vcl::Window subclasses allocated on stack in VclPtr
Change-Id: Ia8b0d84bbf69f9d8f85505d019acdded14e25133 Conflicts: sw/qa/tiledrendering/tiledrendering.cxx
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen8.cxx4
-rw-r--r--sc/source/core/data/dpobject.cxx6
-rw-r--r--sc/source/core/data/validat.cxx12
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx10
-rw-r--r--sc/source/ui/condformat/colorformat.cxx4
-rw-r--r--sc/source/ui/dbgui/dbnamdlg.cxx4
-rw-r--r--sc/source/ui/docshell/arealink.cxx6
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx24
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx4
-rw-r--r--sc/source/ui/docshell/docfunc.cxx8
-rw-r--r--sc/source/ui/docshell/docsh.cxx36
-rw-r--r--sc/source/ui/docshell/docsh3.cxx14
-rw-r--r--sc/source/ui/docshell/docsh4.cxx68
-rw-r--r--sc/source/ui/docshell/docsh5.cxx22
-rw-r--r--sc/source/ui/docshell/docsh6.cxx4
-rw-r--r--sc/source/ui/docshell/documentlinkmgr.cxx4
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx6
-rw-r--r--sc/source/ui/docshell/impex.cxx10
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx4
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx6
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx22
-rw-r--r--sc/source/ui/miscdlgs/retypepassdlg.cxx8
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx20
-rw-r--r--sc/source/ui/optdlg/tpformula.cxx6
-rw-r--r--sc/source/ui/view/cellsh1.cxx16
-rw-r--r--sc/source/ui/view/cellsh2.cxx8
-rw-r--r--sc/source/ui/view/cellsh3.cxx6
-rw-r--r--sc/source/ui/view/dbfunc.cxx6
-rw-r--r--sc/source/ui/view/spelleng.cxx6
-rw-r--r--sc/source/ui/view/tabview2.cxx4
-rw-r--r--sc/source/ui/view/viewfun2.cxx12
-rw-r--r--sc/source/ui/view/viewfun3.cxx10
-rw-r--r--sc/source/ui/view/viewfun4.cxx8
33 files changed, 194 insertions, 194 deletions
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 74756f598f79..74b233ef84cc 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -844,8 +844,8 @@ void ScDocument::UpdateExternalRefLinks(vcl::Window* pWin)
aBuf.append(OUString(ScResId(SCSTR_EXTDOC_NOT_LOADED)));
aBuf.appendAscii("\n\n");
aBuf.append(aFile);
- MessageDialog aBox(pWin, aBuf.makeStringAndClear());
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog(pWin, aBuf.makeStringAndClear()));
+ aBox->Execute();
}
pExternalRefMgr->enableDocTimer(true);
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 532090d238d1..3e8f153b97c3 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -3204,9 +3204,9 @@ uno::Reference<sdbc::XRowSet> ScDPCollection::DBCaches::createRowSet(
}
catch ( const sdbc::SQLException& rError )
{
- //TODO: store error message
- InfoBox aInfoBox( 0, OUString(rError.Message) );
- aInfoBox.Execute();
+ //! store error message
+ VclPtr<InfoBox> aInfoBox(new InfoBox( 0, OUString(rError.Message) ) );
+ aInfoBox->Execute();
}
catch ( uno::Exception& )
{
diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx
index 1d95c3f4c529..397fa9097d6c 100644
--- a/sc/source/core/data/validat.cxx
+++ b/sc/source/core/data/validat.cxx
@@ -253,8 +253,8 @@ bool ScValidationData::DoScript( const ScAddress& rPos, const OUString& rInput,
{
//TODO: different error message, if found, but not bAllowed ??
- MessageDialog aBox( pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND));
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog( pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND)));
+ aBox->Execute();
}
return bScriptReturnedFalse;
@@ -359,8 +359,8 @@ bool ScValidationData::DoMacro( const ScAddress& rPos, const OUString& rInput,
{
//TODO: different error message, if found, but not bAllowed ??
- MessageDialog aBox(pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND));
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog(pParent, ScGlobal::GetRscString(STR_VALID_MACRONOTFOUND)));
+ aBox->Execute();
}
return bRet;
@@ -410,8 +410,8 @@ bool ScValidationData::DoError( vcl::Window* pParent, const OUString& rInput,
}
}
- MessBox aBox( pParent, WinBits(nStyle), aTitle, aMessage );
- sal_uInt16 nRet = aBox.Execute();
+ VclPtr<MessBox> aBox(new MessBox( pParent, WinBits(nStyle), aTitle, aMessage ) );
+ sal_uInt16 nRet = aBox->Execute();
return ( eErrorStyle == SC_VALERR_STOP || nRet == RET_CANCEL );
}
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 05a409c4359c..190a72ad2421 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -662,15 +662,15 @@ void WorkbookGlobals::recalcFormulaCells()
if (rDoc.IsUserInteractionEnabled())
{
// Ask the user if full re-calculation is desired.
- QueryBox aBox(
+ VclPtr<QueryBox> aBox(new QueryBox(
rDocSh.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
- ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
- aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
+ ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS)));
+ aBox->SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
- sal_Int32 nRet = aBox.Execute();
+ sal_Int32 nRet = aBox->Execute();
bHardRecalc = nRet == RET_YES;
- if (aBox.GetCheckBoxState())
+ if (aBox->GetCheckBoxState())
{
// Always perform selected action in the future.
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx
index 26c204030610..f3ee36aaa9e8 100644
--- a/sc/source/ui/condformat/colorformat.cxx
+++ b/sc/source/ui/condformat/colorformat.cxx
@@ -264,8 +264,8 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl )
if(bWarn)
{
//show warning message and don't close
- WarningBox aWarn(this, WB_OK, maStrWarnSameValue );
- aWarn.Execute();
+ VclPtr<WarningBox> aWarn(new WarningBox(this, WB_OK, maStrWarnSameValue ));
+ aWarn->Execute();
}
else
{
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 8313dfaa2ac4..dca70c5c17f0 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -504,9 +504,9 @@ IMPL_LINK_NOARG(ScDbNameDlg, RemoveBtnHdl)
aBuf.append(aStrDelMsg.getToken(0, '#'));
aBuf.append(aStrEntry);
aBuf.append(aStrDelMsg.getToken(1, '#'));
- QueryBox aBox(this, WinBits(WB_YES_NO|WB_DEF_YES), aBuf.makeStringAndClear());
+ VclPtr<QueryBox> aBox(new QueryBox(this, WinBits(WB_YES_NO|WB_DEF_YES), aBuf.makeStringAndClear()));
- if (RET_YES == aBox.Execute())
+ if (RET_YES == aBox->Execute())
{
SCTAB nTab;
SCCOL nColStart, nColEnd;
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index d1d550078b8e..0cad636090e4 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -459,9 +459,9 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
//! Link-Dialog muss Default-Parent setzen
// "kann keine Zeilen einfuegen"
- InfoBox aBox( Application::GetDefDialogParent(),
- ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_2 ) );
- aBox.Execute();
+ VclPtr<InfoBox> aBox(new InfoBox( Application::GetDefDialogParent(),
+ ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_2 ) ) );
+ aBox->Execute();
}
// aufraeumen
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx
index bb974630a333..7de3f6ad5d9a 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1269,9 +1269,9 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb
// OutRange of pOldObj (pDestObj) is still old area
if (!lcl_EmptyExcept(&rDoc, aNewOut, pOldObj->GetOutRange()))
{
- QueryBox aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
- ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) );
- if (aBox.Execute() == RET_NO)
+ VclPtr<QueryBox> aBox(new QueryBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
+ ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) ) );
+ if (aBox->Execute() == RET_NO)
{
//! like above (not editable)
*pOldObj = aUndoDPObj;
@@ -1421,11 +1421,11 @@ bool ScDBDocFunc::CreatePivotTable(const ScDPObject& rDPObj, bool bRecord, bool
if (!bEmpty)
{
- QueryBox aBox(
+ VclPtr<QueryBox> aBox(new QueryBox(
rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
- ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY));
+ ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY)));
- if (aBox.Execute() == RET_NO)
+ if (aBox->Execute() == RET_NO)
{
//! like above (not editable)
return false;
@@ -1495,9 +1495,9 @@ bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi)
{
if (!lcl_EmptyExcept(&rDoc, aNewOut, rDPObj.GetOutRange()))
{
- QueryBox aBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
- ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) );
- if (aBox.Execute() == RET_NO)
+ VclPtr<QueryBox> aBox(new QueryBox( rDocShell.GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
+ ScGlobal::GetRscString(STR_PIVOT_NOTEMPTY) ) );
+ if (aBox->Execute() == RET_NO)
{
rDPObj = aUndoDPObj;
return false;
@@ -1593,9 +1593,9 @@ void ScDBDocFunc::UpdateImport( const OUString& rTarget, const svx::ODataAccessD
const ScDBData* pData = rDBColl.getNamedDBs().findByUpperName(ScGlobal::pCharClass->uppercase(rTarget));
if (!pData)
{
- InfoBox aInfoBox(rDocShell.GetActiveDialogParent(),
- ScGlobal::GetRscString( STR_TARGETNOTFOUND ) );
- aInfoBox.Execute();
+ VclPtr<InfoBox> aInfoBox(new InfoBox(rDocShell.GetActiveDialogParent(),
+ ScGlobal::GetRscString( STR_TARGETNOTFOUND ) ));
+ aInfoBox->Execute();
return;
}
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx
index 6c0b23772d5a..ffd71397d509 100644
--- a/sc/source/ui/docshell/dbdocimp.cxx
+++ b/sc/source/ui/docshell/dbdocimp.cxx
@@ -635,8 +635,8 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
nErrStringId = STR_MSSG_IMPORTDATA_0;
aErrorMessage = ScGlobal::GetRscString( nErrStringId );
}
- InfoBox aInfoBox( rDocShell.GetActiveDialogParent(), aErrorMessage );
- aInfoBox.Execute();
+ VclPtr<InfoBox> aInfoBox(new InfoBox( rDocShell.GetActiveDialogParent(), aErrorMessage ) );
+ aInfoBox->Execute();
}
delete pImportDoc;
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 753fd6de8735..f7b09073af4b 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3757,8 +3757,8 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi )
{
if (!bApi)
{
- InfoBox aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
- aBox.Execute();
+ VclPtr<InfoBox> aBox(new InfoBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ) );
+ aBox->Execute();
}
return false;
}
@@ -3787,8 +3787,8 @@ bool ScDocFunc::Unprotect( SCTAB nTab, const OUString& rPassword, bool bApi )
{
if (!bApi)
{
- InfoBox aBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
- aBox.Execute();
+ VclPtr<InfoBox> aBox(new InfoBox( rDocShell.GetActiveDialogParent(), OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ) );
+ aBox->Execute();
}
return false;
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 959837b6dc76..f5a44e4ff6a6 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -472,14 +472,14 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::uno::R
{
// Generator is not LibreOffice. Ask if the user wants to perform
// full re-calculation.
- QueryBox aBox(
+ VclPtr<QueryBox> aBox(new QueryBox(
GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
- ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS));
- aBox.SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
+ ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_ODS)));
+ aBox->SetCheckBoxText(ScGlobal::GetRscString(STR_ALWAYS_PERFORM_SELECTED));
- bHardRecalc = aBox.Execute() == RET_YES;
+ bHardRecalc = aBox->Execute() == RET_YES;
- if (aBox.GetCheckBoxState())
+ if (aBox->GetCheckBoxState())
{
// Always perform selected action in the future.
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
@@ -689,11 +689,11 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
ScAppOptions aAppOptions = SC_MOD()->GetAppOptions();
if ( aAppOptions.GetShowSharedDocumentWarning() )
{
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ),
- ScGlobal::GetRscString( STR_SHARED_DOC_WARNING ) );
- aBox.SetDefaultCheckBoxText();
- aBox.Execute();
- bool bChecked = aBox.GetCheckBoxState();
+ VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ),
+ ScGlobal::GetRscString( STR_SHARED_DOC_WARNING ) ) );
+ aBox->SetDefaultCheckBoxText();
+ aBox->Execute();
+ bool bChecked = aBox->GetCheckBoxState();
if ( bChecked )
{
aAppOptions.SetShowSharedDocumentWarning( !bChecked );
@@ -821,8 +821,8 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_SAVE_LATER ) );
aMessage = aMessage.replaceFirst( "%1", aUserName );
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage );
- if ( aBox.Execute() == RET_RETRY )
+ VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_RETRY_CANCEL | WB_DEF_RETRY ), aMessage ) );
+ if ( aBox->Execute() == RET_RETRY )
{
bRetry = true;
}
@@ -896,9 +896,9 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
else
{
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ),
- ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) );
- aBox.Execute();
+ VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ),
+ ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) ) );
+ aBox->Execute();
SfxBindings* pBindings = GetViewBindings();
if ( pBindings )
@@ -937,10 +937,10 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
if ( GetDocument().GetExternalRefManager()->containsUnsavedReferences() )
{
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO ),
- ScGlobal::GetRscString( STR_UNSAVED_EXT_REF ) );
+ VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_YES_NO ),
+ ScGlobal::GetRscString( STR_UNSAVED_EXT_REF ) ) );
- if( RET_NO == aBox.Execute())
+ if( RET_NO == aBox->Execute())
{
SetError( ERRCODE_IO_ABORT, OUString( OSL_LOG_PREFIX ) ); // this error code will produce no error message, but will break the further saving process
}
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 66c3a8608338..2ee72312c5dd 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -1202,12 +1202,12 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
while ( bLoop )
{
bLoop = false;
- ScConflictsDlg aDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList );
- if ( aDlg.Execute() == RET_CANCEL )
+ VclPtr<ScConflictsDlg> aDlg(new ScConflictsDlg( GetActiveDialogParent(), GetViewData(), &rSharedDoc, aConflictsList ) );
+ if ( aDlg->Execute() == RET_CANCEL )
{
- QueryBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
- ScGlobal::GetRscString( STR_DOC_WILLNOTBESAVED ) );
- if ( aBox.Execute() == RET_YES )
+ VclPtr<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
+ ScGlobal::GetRscString( STR_DOC_WILLNOTBESAVED ) ) );
+ if ( aBox->Execute() == RET_YES )
{
return false;
}
@@ -1320,8 +1320,8 @@ bool ScDocShell::MergeSharedDocument( ScDocShell* pSharedDocShell )
PostPaintExtras();
PostPaintGridAll();
- InfoBox aInfoBox( GetActiveDialogParent(), ScGlobal::GetRscString( STR_DOC_UPDATED ) );
- aInfoBox.Execute();
+ VclPtr<InfoBox> aInfoBox(new InfoBox( GetActiveDialogParent(), ScGlobal::GetRscString( STR_DOC_UPDATED ) ) );
+ aInfoBox->Execute();
}
return ( pThisAction != NULL );
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index c2077f7eb6d1..8a4d958a3320 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -222,8 +222,8 @@ void ScDocShell::Execute( SfxRequest& rReq )
aMessage += sTarget;
aMessage += aTemplate.getToken( 1, '#' );
- QueryBox aBox( 0, WinBits(WB_YES_NO | WB_DEF_YES), aMessage );
- bDo = ( aBox.Execute() == RET_YES );
+ VclPtr<QueryBox> aBox(new QueryBox( 0, WinBits(WB_YES_NO | WB_DEF_YES), aMessage ));
+ bDo = ( aBox->Execute() == RET_YES );
}
if (bDo)
@@ -427,10 +427,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
if(nSet==LM_ON_DEMAND)
{
- QueryBox aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
- ScGlobal::GetRscString(STR_RELOAD_TABLES) );
+ VclPtr<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
+ ScGlobal::GetRscString(STR_RELOAD_TABLES) ) );
- nDlgRet=aBox.Execute();
+ nDlgRet=aBox->Execute();
}
if (nDlgRet == RET_YES || nSet==LM_ALWAYS)
@@ -476,9 +476,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
OSL_ENSURE(pViewSh,"SID_REIMPORT_AFTER_LOAD: keine View");
if (pViewSh && pDBColl)
{
- QueryBox aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
- ScGlobal::GetRscString(STR_REIMPORT_AFTER_LOAD) );
- if (aBox.Execute() == RET_YES)
+ VclPtr<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
+ ScGlobal::GetRscString(STR_REIMPORT_AFTER_LOAD) ) );
+ if (aBox->Execute() == RET_YES)
{
ScDBCollection::NamedDBs& rDBs = pDBColl->getNamedDBs();
ScDBCollection::NamedDBs::iterator itr = rDBs.begin(), itrEnd = rDBs.end();
@@ -575,10 +575,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
if ( !pItem )
{
// no dialog on playing the macro
- WarningBox aBox( pParent ? pParent : GetActiveDialogParent(),
+ VclPtr<WarningBox> aBox(new WarningBox( pParent ? pParent : GetActiveDialogParent(),
WinBits(WB_YES_NO | WB_DEF_NO),
- ScGlobal::GetRscString( STR_END_REDLINING ) );
- bDo = ( aBox.Execute() == RET_YES );
+ ScGlobal::GetRscString( STR_END_REDLINING ) ) );
+ bDo = ( aBox->Execute() == RET_YES );
}
if ( bDo )
@@ -644,10 +644,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
{
if ( nSlot == SID_DOCUMENT_COMPARE )
{ //! old changes trace will be lost
- WarningBox aBox( GetActiveDialogParent(),
+ VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(),
WinBits(WB_YES_NO | WB_DEF_NO),
- ScGlobal::GetRscString( STR_END_REDLINING ) );
- if( aBox.Execute() == RET_YES )
+ ScGlobal::GetRscString( STR_END_REDLINING ) ) );
+ if( aBox->Execute() == RET_YES )
bDo = ExecuteChangeProtectionDialog( NULL, true );
else
bDo = false;
@@ -913,10 +913,10 @@ void ScDocShell::Execute( SfxRequest& rReq )
break;
}
- ScShareDocumentDlg aDlg( GetActiveDialogParent(), pViewData );
- if ( aDlg.Execute() == RET_OK )
+ VclPtr<ScShareDocumentDlg> aDlg(new ScShareDocumentDlg( GetActiveDialogParent(), pViewData ) );
+ if ( aDlg->Execute() == RET_OK )
{
- bool bSetShared = aDlg.IsShareDocumentChecked();
+ bool bSetShared = aDlg->IsShareDocumentChecked();
if ( bSetShared != static_cast< bool >( IsDocShared() ) )
{
if ( bSetShared )
@@ -924,9 +924,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
bool bContinue = true;
if ( HasName() )
{
- QueryBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
- ScGlobal::GetRscString( STR_DOC_WILLBESAVED ) );
- if ( aBox.Execute() == RET_NO )
+ VclPtr<QueryBox> aBox(new QueryBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
+ ScGlobal::GetRscString( STR_DOC_WILLBESAVED ) ) );
+ if ( aBox->Execute() == RET_NO )
{
bContinue = false;
}
@@ -1016,14 +1016,14 @@ void ScDocShell::Execute( SfxRequest& rReq )
OUString aMessage( ScGlobal::GetRscString( STR_FILE_LOCKED_TRY_LATER ) );
aMessage = aMessage.replaceFirst( "%1", aUserName );
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage );
- aBox.Execute();
+ VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ), aMessage ) );
+ aBox->Execute();
}
else
{
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
- ScGlobal::GetRscString( STR_DOC_DISABLESHARED ) );
- if ( aBox.Execute() == RET_YES )
+ VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
+ ScGlobal::GetRscString( STR_DOC_DISABLESHARED ) ) );
+ if ( aBox->Execute() == RET_YES )
{
xCloseable->close( sal_True );
@@ -1055,9 +1055,9 @@ void ScDocShell::Execute( SfxRequest& rReq )
else
{
xCloseable->close( sal_True );
- WarningBox aBox( GetActiveDialogParent(), WinBits( WB_OK ),
- ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) );
- aBox.Execute();
+ VclPtr<WarningBox> aBox(new WarningBox( GetActiveDialogParent(), WinBits( WB_OK ),
+ ScGlobal::GetRscString( STR_DOC_NOLONGERSHARED ) ) );
+ aBox->Execute();
}
}
catch ( uno::Exception& )
@@ -1156,9 +1156,9 @@ bool ScDocShell::ExecuteChangeProtectionDialog( vcl::Window* _pParent, bool bJus
}
else
{
- InfoBox aBox( GetActiveDialogParent(),
- OUString( ScResId( SCSTR_WRONGPASSWORD ) ) );
- aBox.Execute();
+ VclPtr<InfoBox> aBox(new InfoBox( GetActiveDialogParent(),
+ OUString( ScResId( SCSTR_WRONGPASSWORD ) ) ) );
+ aBox->Execute();
}
}
else
@@ -1486,9 +1486,9 @@ void ScDocShell::PageStyleModified( const OUString& rStyleName, bool bApi )
if (bWarn && !bApi)
{
ScWaitCursorOff aWaitOff( GetActiveDialogParent() );
- InfoBox aInfoBox(GetActiveDialogParent(),
- ScGlobal::GetRscString(STR_PRINT_INVALID_AREA));
- aInfoBox.Execute();
+ VclPtr<InfoBox> aInfoBox(new InfoBox(GetActiveDialogParent(),
+ ScGlobal::GetRscString(STR_PRINT_INVALID_AREA)));
+ aInfoBox->Execute();
}
}
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 79167bcaa71d..20aa6e4f1435 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -81,8 +81,8 @@ void ScDocShell::ErrorMessage( sal_uInt16 nGlobStrId )
}
}
- InfoBox aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) );
- aBox.Execute();
+ VclPtr<InfoBox> aBox(new InfoBox( pParent, ScGlobal::GetRscString( nGlobStrId ) ) );
+ aBox->Execute();
if (bFocus)
pParent->GrabFocus();
}
@@ -487,9 +487,9 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, bool bRecord )
if (bErr)
{
- InfoBox aBox( GetActiveDialogParent(),
- ScGlobal::GetRscString( STR_CONSOLIDATE_ERR1 ) );
- aBox.Execute();
+ VclPtr<InfoBox> aBox(new InfoBox( GetActiveDialogParent(),
+ ScGlobal::GetRscString( STR_CONSOLIDATE_ERR1 ) ) );
+ aBox->Execute();
return;
}
@@ -697,16 +697,16 @@ void ScDocShell::UseScenario( SCTAB nTab, const OUString& rName, bool bRecord )
}
else
{
- InfoBox aBox(GetActiveDialogParent(),
- ScGlobal::GetRscString( STR_PROTECTIONERR ) );
- aBox.Execute();
+ VclPtr<InfoBox> aBox(new InfoBox( GetActiveDialogParent(),
+ ScGlobal::GetRscString( STR_PROTECTIONERR ) ) );
+ aBox->Execute();
}
}
else
{
- InfoBox aBox(GetActiveDialogParent(),
- ScGlobal::GetRscString( STR_SCENARIO_NOTFOUND ) );
- aBox.Execute();
+ VclPtr<InfoBox> aBox(new InfoBox(GetActiveDialogParent(),
+ ScGlobal::GetRscString( STR_SCENARIO_NOTFOUND ) ) );
+ aBox->Execute();
}
}
else
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index 92b6e2a5dc8e..b308e74d2491 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -531,8 +531,8 @@ void ScDocShell::CheckConfigOptions()
if (pViewShell)
{
vcl::Window* pParent = pViewShell->GetFrameWin();
- InfoBox aBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS));
- aBox.Execute();
+ VclPtr<InfoBox> aBox(new InfoBox(pParent, ScGlobal::GetRscString(STR_OPTIONS_WARN_SEPARATORS)));
+ aBox->Execute();
}
// For now, this is the only option setting that could launch info
diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx b/sc/source/ui/docshell/documentlinkmgr.cxx
index 7da7c3855d8c..69b5f7950d22 100644
--- a/sc/source/ui/docshell/documentlinkmgr.cxx
+++ b/sc/source/ui/docshell/documentlinkmgr.cxx
@@ -165,8 +165,8 @@ bool DocumentLinkManager::updateDdeLinks( vcl::Window* pWin )
aBuf.append(aElem);
aBuf.appendAscii("\nType : ");
aBuf.append(aType);
- MessageDialog aBox(pWin, aBuf.makeStringAndClear());
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog(pWin, aBuf.makeStringAndClear()));
+ aBox->Execute();
}
}
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index ff22d8d44b12..9c5bcc661066 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -3020,9 +3020,9 @@ void ScExternalRefManager::Notify( SfxBroadcaster&, const SfxHint& rHint )
{
SfxObjectShell* pObjShell = static_cast<const SfxEventHint&>( rHint ).GetObjShell();
ScDocShell* pDocShell = static_cast< ScDocShell* >( pObjShell );
- WarningBox aBox( pDocShell->GetActiveDialogParent(), WinBits( WB_OK ),
- ScGlobal::GetRscString( STR_CLOSE_WITH_UNSAVED_REFS ) );
- aBox.Execute();
+ VclPtr<WarningBox> aBox(new WarningBox( pDocShell->GetActiveDialogParent(), WinBits( WB_OK ),
+ ScGlobal::GetRscString( STR_CLOSE_WITH_UNSAVED_REFS ) ) );
+ aBox->Execute();
}
break;
case SFX_EVENT_SAVEDOCDONE:
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 806c1b4d7c01..dd830e25c66c 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -210,9 +210,9 @@ bool ScImportExport::StartPaste()
ScEditableTester aTester( pDoc, aRange );
if ( !aTester.IsEditable() )
{
- InfoBox aInfoBox(Application::GetDefDialogParent(),
- ScGlobal::GetRscString( aTester.GetMessageId() ) );
- aInfoBox.Execute();
+ VclPtr<InfoBox> aInfoBox(new InfoBox(Application::GetDefDialogParent(),
+ ScGlobal::GetRscString( aTester.GetMessageId() ) ) );
+ aInfoBox->Execute();
return false;
}
}
@@ -1452,8 +1452,8 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
if ( !mbApi && nStartCol != nEndCol &&
!pDoc->IsBlockEmpty( nTab, nStartCol + 1, nStartRow, nEndCol, nRow ) )
{
- ScReplaceWarnBox aBox( pDocSh->GetActiveDialogParent() );
- if ( aBox.Execute() != RET_YES )
+ VclPtr<ScReplaceWarnBox> aBox(new ScReplaceWarnBox( pDocSh->GetActiveDialogParent() ));
+ if ( aBox->Execute() != RET_YES )
{
return false;
}
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index d53741d617e9..ebdd0c991625 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -271,8 +271,8 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh,
// really store as link only?
if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
{
- SvxLinkWarningDialog aWarnDlg(pWin,aFileName);
- if( aWarnDlg.Execute() != RET_OK )
+ VclPtr<SvxLinkWarningDialog> aWarnDlg(new SvxLinkWarningDialog(pWin,aFileName));
+ if( aWarnDlg->Execute() != RET_OK )
bAsLink = false; // don't store as link
}
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index b98f92be1f57..85793b131008 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -200,10 +200,10 @@ void ScGraphicShell::ExecuteCompressGraphic( SfxRequest& )
if( pObj && pObj->ISA( SdrGrafObj ) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP )
{
SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
- CompressGraphicsDialog dialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() );
- if ( dialog.Execute() == RET_OK )
+ VclPtr<CompressGraphicsDialog> dialog(new CompressGraphicsDialog( GetViewData()->GetDialogParent(), pGraphicObj, GetViewData()->GetBindings() ) );
+ if ( dialog->Execute() == RET_OK )
{
- SdrGrafObj* pNewObject = dialog.GetCompressedSdrGrafObj();
+ SdrGrafObj* pNewObject = dialog->GetCompressedSdrGrafObj();
SdrPageView* pPageView = pView->GetSdrPageView();
OUString aUndoString = pView->GetDescriptionOfMarkedObjects() + " Compress";
pView->BegUndo( aUndoString );
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index e65e0cbae03b..f55c8674950b 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -768,15 +768,15 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
{
// show progress dialog
- ScSolverProgressDialog aProgress( this );
+ VclPtr<ScSolverProgressDialog> aProgress(new ScSolverProgressDialog( this ) );
sal_Int32 nTimeout = 0;
if ( FindTimeout( nTimeout ) )
- aProgress.SetTimeLimit( nTimeout );
+ aProgress->SetTimeLimit( nTimeout );
else
- aProgress.HideTimeLimit();
- aProgress.Show();
- aProgress.Update();
- aProgress.Sync();
+ aProgress->HideTimeLimit();
+ aProgress->Show();
+ aProgress->Update();
+ aProgress->Sync();
// try to make sure the progress dialog is painted before continuing
Application::Reschedule(true);
@@ -967,7 +967,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
xSolver->solve();
bool bSuccess = xSolver->getSuccess();
- aProgress.Hide();
+ aProgress->Hide();
bool bClose = false;
bool bRestore = true; // restore old values unless a solution is accepted
if ( bSuccess )
@@ -993,8 +993,8 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
static_cast<SCCOL>(aObjective.Column), static_cast<SCROW>(aObjective.Row),
static_cast<SCTAB>(aObjective.Sheet));
- ScSolverSuccessDialog aDialog( this, aResultStr );
- if ( aDialog.Execute() == RET_OK )
+ VclPtr<ScSolverSuccessDialog> aDialog(new ScSolverSuccessDialog( this, aResultStr ) );
+ if ( aDialog->Execute() == RET_OK )
{
// keep results and close dialog
bRestore = false;
@@ -1007,8 +1007,8 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
uno::Reference<sheet::XSolverDescription> xDesc( xSolver, uno::UNO_QUERY );
if ( xDesc.is() )
aError = xDesc->getStatusDescription(); // error description from component
- ScSolverNoSolutionDialog aDialog( this, aError );
- aDialog.Execute();
+ VclPtr<ScSolverNoSolutionDialog> aDialog(new ScSolverNoSolutionDialog( this, aError ) );
+ aDialog->Execute();
}
if ( bRestore ) // restore old values
diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx
index d804ea16a353..df764de6436c 100644
--- a/sc/source/ui/miscdlgs/retypepassdlg.cxx
+++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx
@@ -283,11 +283,11 @@ IMPL_LINK( ScRetypePassDlg, RetypeBtnHdl, PushButton*, pBtn )
// What the ... !?
return 0;
- ScRetypePassInputDlg aDlg(this, pProtected);
- if (aDlg.Execute() == RET_OK)
+ VclPtr<ScRetypePassInputDlg> aDlg(new ScRetypePassInputDlg(this, pProtected));
+ if (aDlg->Execute() == RET_OK)
{
// OK is pressed. Update the protected item.
- if (aDlg.IsRemovePassword())
+ if (aDlg->IsRemovePassword())
{
// Remove password from this item.
pProtected->setPassword(OUString());
@@ -295,7 +295,7 @@ IMPL_LINK( ScRetypePassDlg, RetypeBtnHdl, PushButton*, pBtn )
else
{
// Set a new password.
- OUString aNewPass = aDlg.GetNewPassword();
+ OUString aNewPass = aDlg->GetNewPassword();
pProtected->setPassword(aNewPass);
}
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index b23c275b7c81..6e5660c4c0f5 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -314,23 +314,23 @@ void ScSolverOptionsDialog::EditOption()
{
if ( pStringItem->IsDouble() )
{
- ScSolverValueDialog aValDialog( this );
- aValDialog.SetOptionName( pStringItem->GetText() );
- aValDialog.SetValue( pStringItem->GetDoubleValue() );
- if ( aValDialog.Execute() == RET_OK )
+ VclPtr<ScSolverValueDialog> aValDialog(new ScSolverValueDialog( this ));
+ aValDialog->SetOptionName( pStringItem->GetText() );
+ aValDialog->SetValue( pStringItem->GetDoubleValue() );
+ if ( aValDialog->Execute() == RET_OK )
{
- pStringItem->SetDoubleValue( aValDialog.GetValue() );
+ pStringItem->SetDoubleValue( aValDialog->GetValue() );
m_pLbSettings->InvalidateEntry( pEntry );
}
}
else
{
- ScSolverIntegerDialog aIntDialog( this );
- aIntDialog.SetOptionName( pStringItem->GetText() );
- aIntDialog.SetValue( pStringItem->GetIntValue() );
- if ( aIntDialog.Execute() == RET_OK )
+ VclPtr<ScSolverIntegerDialog> aIntDialog(new ScSolverIntegerDialog( this ));
+ aIntDialog->SetOptionName( pStringItem->GetText() );
+ aIntDialog->SetValue( pStringItem->GetIntValue() );
+ if ( aIntDialog->Execute() == RET_OK )
{
- pStringItem->SetIntValue( aIntDialog.GetValue() );
+ pStringItem->SetIntValue( aIntDialog->GetValue() );
m_pLbSettings->InvalidateEntry( pEntry );
}
}
diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx
index a1c40ce1107f..325cad6b50a5 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -122,10 +122,10 @@ void ScTpFormulaOptions::UpdateCustomCalcRadioButtons(bool bDefault)
void ScTpFormulaOptions::LaunchCustomCalcSettings()
{
- ScCalcOptionsDialog aDlg(this, maCurrentConfig);
- if (aDlg.Execute() == RET_OK)
+ VclPtr<ScCalcOptionsDialog> aDlg(new ScCalcOptionsDialog(this, maCurrentConfig));
+ if (aDlg->Execute() == RET_OK)
{
- maCurrentConfig = aDlg.GetConfig();
+ maCurrentConfig = aDlg->GetConfig();
}
}
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 2fb91e4df0d8..9f6486dded5e 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -1960,9 +1960,9 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if(!pCondFormatDlg && bContainsExistingCondFormat)
{
- QueryBox aBox( pTabViewShell->GetDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
- ScGlobal::GetRscString(STR_EDIT_EXISTING_COND_FORMATS) );
- bool bEditExisting = aBox.Execute() == RET_YES;
+ VclPtr<QueryBox> aBox(new QueryBox( pTabViewShell->GetDialogParent(), WinBits( WB_YES_NO | WB_DEF_YES ),
+ ScGlobal::GetRscString(STR_EDIT_EXISTING_COND_FORMATS) ) );
+ bool bEditExisting = aBox->Execute() == RET_YES;
if(bEditExisting)
{
// differentiate between ranges where one conditional format is defined
@@ -2652,10 +2652,10 @@ void ScCellShell::ExecuteDataPilotDialog()
{
// confirm selection if it contains SubTotal cells
- QueryBox aBox( pTabViewShell->GetDialogParent(),
+ VclPtr<QueryBox> aBox(new QueryBox( pTabViewShell->GetDialogParent(),
WinBits(WB_YES_NO | WB_DEF_YES),
- ScGlobal::GetRscString(STR_DATAPILOT_SUBTOTAL) );
- if (aBox.Execute() == RET_NO)
+ ScGlobal::GetRscString(STR_DATAPILOT_SUBTOTAL) ) );
+ if (aBox->Execute() == RET_NO)
bOK = false;
}
if (bOK)
@@ -2682,8 +2682,8 @@ void ScCellShell::ExecuteDataPilotDialog()
if (nSrcErrorId)
{
// Error occurred during data creation. Launch an error and bail out.
- InfoBox aBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(nSrcErrorId));
- aBox.Execute();
+ VclPtr<InfoBox> aBox(new InfoBox(pTabViewShell->GetDialogParent(), ScGlobal::GetRscString(nSrcErrorId)));
+ aBox->Execute();
return;
}
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 6e5bf8889827..89a92c84ff18 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -740,15 +740,15 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
break;
case SID_DATA_STREAMS:
{
- sc::DataStreamDlg aDialog( GetViewData()->GetDocShell(), pTabViewShell->GetDialogParent() );
+ VclPtr<sc::DataStreamDlg> aDialog(new sc::DataStreamDlg( GetViewData()->GetDocShell(), pTabViewShell->GetDialogParent() ) );
ScDocument *pDoc = GetViewData()->GetDocument();
sc::DocumentLinkManager& rMgr = pDoc->GetDocLinkManager();
sc::DataStream* pStrm = rMgr.getDataStream();
if (pStrm)
- aDialog.Init(*pStrm);
+ aDialog->Init(*pStrm);
- if (aDialog.Execute() == RET_OK)
- aDialog.StartStream();
+ if (aDialog->Execute() == RET_OK)
+ aDialog->StartStream();
}
break;
case SID_DATA_STREAMS_PLAY:
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index a30253474e15..30176f887f8d 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -422,9 +422,9 @@ void ScCellShell::Execute( SfxRequest& rReq )
}
else if( ! rReq.IsAPI() )
{
- MessageDialog aErrorBox(pTabViewShell->GetDialogParent(),
- ScGlobal::GetRscString(STR_NOAREASELECTED));
- aErrorBox.Execute();
+ VclPtr<MessageDialog> aErrorBox(new MessageDialog(pTabViewShell->GetDialogParent(),
+ ScGlobal::GetRscString(STR_NOAREASELECTED)));
+ aErrorBox->Execute();
}
}
else
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index b2099de5cb7b..bf5fd6495c8d 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -383,9 +383,9 @@ void ScDBFunc::ToggleAutoFilter()
}
else
{
- MessageDialog aErrorBox(GetViewData().GetDialogParent(),
- ScGlobal::GetRscString(STR_ERR_AUTOFILTER));
- aErrorBox.Execute();
+ VclPtr<MessageDialog> aErrorBox(new MessageDialog(GetViewData().GetDialogParent(),
+ ScGlobal::GetRscString(STR_ERR_AUTOFILTER)));
+ aErrorBox->Execute();
}
}
diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx
index ad7e6bc54b1e..2d39db2468b5 100644
--- a/sc/source/ui/view/spelleng.cxx
+++ b/sc/source/ui/view/spelleng.cxx
@@ -305,10 +305,10 @@ bool ScSpellingEngine::ShowTableWrapDialog()
{
vcl::Window* pParent = GetDialogParent();
ScWaitCursorOff aWaitOff( pParent );
- MessBox aMsgBox( pParent, WinBits( WB_YES_NO | WB_DEF_YES ),
+ VclPtr<MessBox> aMsgBox(new MessBox( pParent, WinBits( WB_YES_NO | WB_DEF_YES ),
ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ),
- ScGlobal::GetRscString( STR_SPELLING_BEGIN_TAB) );
- return aMsgBox.Execute() == RET_YES;
+ ScGlobal::GetRscString( STR_SPELLING_BEGIN_TAB) ) );
+ return aMsgBox->Execute() == RET_YES;
}
void ScSpellingEngine::ShowFinishDialog()
diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index fc9b1a892abd..9f10ad20c4d0 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -1422,8 +1422,8 @@ void ScTabView::ErrorMessage( sal_uInt16 nGlobStrId )
}
}
- InfoBox aBox( pParent, ScGlobal::GetRscString( nGlobStrId ) );
- aBox.Execute();
+ VclPtr<InfoBox> aBox(new InfoBox( pParent, ScGlobal::GetRscString( nGlobStrId ) ) );
+ aBox->Execute();
if (bFocus)
pParent->GrabFocus();
}
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 4b21f410f989..8b0ce278d5b9 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1074,11 +1074,11 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bRecord, bool bC
{
if (!bApi)
{
- MessBox aBox( GetViewData().GetDialogParent(),
+ VclPtr<MessBox> aBox(new MessBox( GetViewData().GetDialogParent(),
WinBits(WB_YES_NO_CANCEL | WB_DEF_NO),
ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ),
- ScGlobal::GetRscString( STR_MERGE_NOTEMPTY ) );
- sal_uInt16 nRetVal = aBox.Execute();
+ ScGlobal::GetRscString( STR_MERGE_NOTEMPTY ) ) );
+ sal_uInt16 nRetVal = aBox->Execute();
if ( nRetVal == RET_YES )
rDoContents = true;
@@ -1771,10 +1771,10 @@ void ScViewFunc::Solve( const ScSolveParam& rParam )
aMsgStr += ScGlobal::GetRscString( STR_MSSG_SOLVE_4 );
}
- MessBox aBox( GetViewData().GetDialogParent(),
+ VclPtr<MessBox> aBox(new MessBox( GetViewData().GetDialogParent(),
WinBits(WB_YES_NO | WB_DEF_NO),
- ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), aMsgStr );
- sal_uInt16 nRetVal = aBox.Execute();
+ ScGlobal::GetRscString( STR_MSSG_DOSUBTOTALS_0 ), aMsgStr ) );
+ sal_uInt16 nRetVal = aBox->Execute();
if ( RET_YES == nRetVal )
EnterValue( nDestCol, nDestRow, nDestTab, nSolveResult );
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 992e480dd22e..0fa755d073b2 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -832,8 +832,8 @@ bool checkDestRangeForOverwrite(const ScRangeList& rDestRanges, const ScDocument
if (!bIsEmpty)
{
- ScReplaceWarnBox aBox(pParentWnd);
- if (aBox.Execute() != RET_YES)
+ VclPtr<ScReplaceWarnBox> aBox(new ScReplaceWarnBox(pParentWnd));
+ if (aBox->Execute() != RET_YES)
{
// changing the configuration is within the ScReplaceWarnBox
return false;
@@ -1041,9 +1041,9 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
{
ScWaitCursorOff aWaitOff( GetFrameWin() );
OUString aMessage = ScGlobal::GetRscString( STR_PASTE_BIGGER );
- QueryBox aBox( GetViewData().GetDialogParent(),
- WinBits(WB_YES_NO | WB_DEF_NO), aMessage );
- if ( aBox.Execute() != RET_YES )
+ VclPtr<QueryBox> aBox(new QueryBox( GetViewData().GetDialogParent(),
+ WinBits(WB_YES_NO | WB_DEF_NO), aMessage ) );
+ if ( aBox->Execute() != RET_YES )
{
return false;
}
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 0317fa4d7201..9d6660137206 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -99,8 +99,8 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
if (pActWin)
{
pEngine->SetPaperSize(Size(100000,100000));
- vcl::Window aWin( pActWin );
- EditView aEditView( pEngine.get(), &aWin );
+ VclPtr<vcl::Window> aWin(new vcl::Window( pActWin ));
+ EditView aEditView( pEngine.get(), aWin.get() );
aEditView.SetOutputArea(Rectangle(0,0,100000,100000));
// same method now for clipboard or drag&drop
@@ -387,8 +387,8 @@ void ScViewFunc::DoThesaurus( bool bRecord )
LanguageType eLnge = ScViewUtil::GetEffLanguage( &rDoc, ScAddress( nCol, nRow, nTab ) );
OUString aErr = SvtLanguageTable::GetLanguageString(eLnge);
aErr += ScGlobal::GetRscString( STR_SPELLING_NO_LANG );
- InfoBox aBox( GetViewData().GetDialogParent(), aErr );
- aBox.Execute();
+ VclPtr<InfoBox> aBox(new InfoBox( GetViewData().GetDialogParent(), aErr ) );
+ aBox->Execute();
}
if (pThesaurusEngine->IsModified())
{