summaryrefslogtreecommitdiff
path: root/sfx2
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 /sfx2
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 'sfx2')
-rw-r--r--sfx2/source/appl/appopen.cxx12
-rw-r--r--sfx2/source/appl/appserv.cxx12
-rw-r--r--sfx2/source/appl/impldde.cxx6
-rw-r--r--sfx2/source/appl/newhelp.cxx24
-rw-r--r--sfx2/source/appl/opengrf.cxx4
-rw-r--r--sfx2/source/appl/openuriexternally.cxx8
-rw-r--r--sfx2/source/appl/sfxhelp.cxx4
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx4
-rw-r--r--sfx2/source/dialog/mailmodel.cxx4
-rw-r--r--sfx2/source/dialog/mgetempl.cxx12
-rw-r--r--sfx2/source/dialog/passwd.cxx4
-rw-r--r--sfx2/source/dialog/recfloat.cxx6
-rw-r--r--sfx2/source/dialog/securitypage.cxx16
-rw-r--r--sfx2/source/dialog/templdlg.cxx10
-rw-r--r--sfx2/source/doc/QuerySaveDocument.cxx6
-rw-r--r--sfx2/source/doc/docinsert.cxx8
-rw-r--r--sfx2/source/doc/guisaveas.cxx10
-rw-r--r--sfx2/source/doc/objcont.cxx4
-rw-r--r--sfx2/source/doc/objserv.cxx16
-rw-r--r--sfx2/source/doc/objstor.cxx4
-rw-r--r--sfx2/source/doc/templatedlg.cxx62
-rw-r--r--sfx2/source/view/viewfrm.cxx18
-rw-r--r--sfx2/source/view/viewsh.cxx12
23 files changed, 133 insertions, 133 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 582a4b8e935d..a307e81cfe37 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -462,8 +462,8 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
bool bNewWin = false;
vcl::Window* pTopWin = GetTopWindow();
- SfxTemplateManagerDlg aTemplDlg;
- int nRet = aTemplDlg.Execute();
+ VclPtr<SfxTemplateManagerDlg> aTemplDlg(new SfxTemplateManagerDlg);
+ int nRet = aTemplDlg->Execute();
if ( nRet == RET_OK )
{
rReq.Done();
@@ -831,11 +831,11 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
SolarMutexGuard aGuard;
vcl::Window *pWindow = SfxGetpApp()->GetTopWindow();
- MessageDialog aSecurityWarningBox(pWindow,
+ VclPtr<MessageDialog> aSecurityWarningBox(new MessageDialog(pWindow,
SfxResId(STR_SECURITY_WARNING_NO_HYPERLINKS),
- VCL_MESSAGE_WARNING);
- aSecurityWarningBox.SetText( SfxResId(RID_SECURITY_WARNING_TITLE).toString() );
- aSecurityWarningBox.Execute();
+ VCL_MESSAGE_WARNING));
+ aSecurityWarningBox->SetText( SfxResId(RID_SECURITY_WARNING_TITLE).toString() );
+ aSecurityWarningBox->Execute();
return;
}
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index e9b32c56697a..6fece61c4f78 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -451,8 +451,8 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_SHOW_LICENSE:
{
- LicenseDialog aDialog;
- aDialog.Execute();
+ VclPtr<LicenseDialog> aDialog(new LicenseDialog);
+ aDialog->Execute();
break;
}
@@ -539,16 +539,16 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
case SID_TEMPLATE_MANAGER:
{
- SfxTemplateManagerDlg dlg;
- dlg.Execute();
+ VclPtr<SfxTemplateManagerDlg> dlg(new SfxTemplateManagerDlg);
+ dlg->Execute();
bDone = true;
break;
}
case SID_TEMPLATE_ADDRESSBOKSOURCE:
{
- svt::AddressBookSourceDialog aDialog(GetTopWindow(), ::comphelper::getProcessComponentContext());
- aDialog.Execute();
+ VclPtr<svt::AddressBookSourceDialog> aDialog(new svt::AddressBookSourceDialog(GetTopWindow(), ::comphelper::getProcessComponentContext()));
+ aDialog->Execute();
bDone = true;
break;
}
diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx
index 4a3c0be1e6b7..f66a2b0a3d6e 100644
--- a/sfx2/source/appl/impldde.cxx
+++ b/sfx2/source/appl/impldde.cxx
@@ -255,10 +255,10 @@ bool SvDDEObject::Connect( SvBaseLink * pSvLink )
void SvDDEObject::Edit( vcl::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link& rEndEditHdl )
{
- SvDDELinkEditDialog aDlg( pParent, pBaseLink );
- if ( RET_OK == aDlg.Execute() && rEndEditHdl.IsSet() )
+ VclPtr<SvDDELinkEditDialog> aDlg(new SvDDELinkEditDialog(pParent, pBaseLink) );
+ if ( RET_OK == aDlg->Execute() && rEndEditHdl.IsSet() )
{
- OUString sCommand = aDlg.GetCmd();
+ OUString sCommand = aDlg->GetCmd();
rEndEditHdl.Call( &sCommand );
}
}
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index eb800ba69e84..9a80a2e0df55 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1048,8 +1048,8 @@ IMPL_LINK_NOARG(SearchTabPage_Impl, SearchHdl)
if ( aFactories.empty() )
{
- MessageDialog aBox( this, SfxResId( STR_INFO_NOSEARCHRESULTS ), VCL_MESSAGE_INFO );
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_INFO_NOSEARCHRESULTS ), VCL_MESSAGE_INFO) );
+ aBox->Execute();
}
}
return 0;
@@ -1194,15 +1194,15 @@ void BookmarksBox_Impl::DoAction( sal_uInt16 nAction )
sal_Int32 nPos = GetSelectEntryPos();
if ( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- SfxAddHelpBookmarkDialog_Impl aDlg( this, true );
- aDlg.SetTitle( GetEntry( nPos ) );
- if ( aDlg.Execute() == RET_OK )
+ VclPtr<SfxAddHelpBookmarkDialog_Impl> aDlg(new SfxAddHelpBookmarkDialog_Impl(this, true));
+ aDlg->SetTitle( GetEntry( nPos ) );
+ if ( aDlg->Execute() == RET_OK )
{
OUString* pURL = static_cast<OUString*>(GetEntryData( nPos ));
RemoveEntry( nPos );
OUString aImageURL = IMAGE_URL;
aImageURL += INetURLObject( *pURL ).GetHost();
- nPos = InsertEntry( aDlg.GetTitle(), SvFileInformationManager::GetImage( INetURLObject(aImageURL), false ) );
+ nPos = InsertEntry( aDlg->GetTitle(), SvFileInformationManager::GetImage( INetURLObject(aImageURL), false ) );
SetEntryData( nPos, new OUString( *pURL ) );
SelectEntryPos( nPos );
delete pURL;
@@ -2288,8 +2288,8 @@ IMPL_LINK( SfxHelpTextWindow_Impl, FindHdl, sfx2::SearchDialog*, pDlg )
else
{
DBG_ASSERT( pSrchDlg, "no search dialog" );
- MessageDialog aBox( pSrchDlg, SfxResId( STR_INFO_NOSEARCHTEXTFOUND ), VCL_MESSAGE_INFO );
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog(pSrchDlg, SfxResId( STR_INFO_NOSEARCHTEXTFOUND ), VCL_MESSAGE_INFO) );
+ aBox->Execute();
pSrchDlg->SetFocusOnEdit();
}
}
@@ -3167,11 +3167,11 @@ void SfxHelpWindow_Impl::DoAction( sal_uInt16 nActionId )
if ( aAny >>= aValue )
{
OUString aTitle( aValue );
- SfxAddHelpBookmarkDialog_Impl aDlg( this, false );
- aDlg.SetTitle( aTitle );
- if ( aDlg.Execute() == RET_OK )
+ VclPtr<SfxAddHelpBookmarkDialog_Impl> aDlg(new SfxAddHelpBookmarkDialog_Impl(this, false));
+ aDlg->SetTitle( aTitle );
+ if ( aDlg->Execute() == RET_OK )
{
- aTitle = aDlg.GetTitle();
+ aTitle = aDlg->GetTitle();
pIndexWin->AddBookmarks( aTitle, aURL );
}
}
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index 2a533bb29ed8..10c4d705d734 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -158,8 +158,8 @@ short SvxOpenGraphicDialog::Execute()
// could not load?
if ( nFound == USHRT_MAX )
{
- WarningBox aWarningBox( NULL, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) ).toString() );
- bQuitLoop = aWarningBox.Execute()==RET_RETRY ? sal_False : sal_True;
+ VclPtr<WarningBox> aWarningBox(new WarningBox(NULL, WB_3DLOOK | WB_RETRY_CANCEL, SfxResId( SvxOpenGrfErr2ResId(nImpRet) ).toString()) );
+ bQuitLoop = aWarningBox->Execute() != RET_RETRY;
}
else
{
diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx
index ecc347eddd27..7394b8fb8d72 100644
--- a/sfx2/source/appl/openuriexternally.cxx
+++ b/sfx2/source/appl/openuriexternally.cxx
@@ -44,10 +44,10 @@ bool sfx2::openUriExternally(
"unexpected IllegalArgumentException: " + e.Message);
}
SolarMutexGuard g;
- MessageDialog eb(
- SfxGetpApp()->GetTopWindow(), SfxResId(STR_NO_ABS_URI_REF));
- eb.set_primary_text(eb.get_primary_text().replaceFirst("$(ARG1)", uri));
- eb.Execute();
+ VclPtr<MessageDialog> eb(new MessageDialog(
+ SfxGetpApp()->GetTopWindow(), SfxResId(STR_NO_ABS_URI_REF)));
+ eb->set_primary_text(eb->get_primary_text().replaceFirst("$(ARG1)", uri));
+ eb->Execute();
} catch (css::system::SystemShellExecuteException &) {
if (!handleSystemShellExecuteException) {
throw;
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 247e80e140af..ac82b98815f1 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -605,8 +605,8 @@ bool SfxHelp::Start_Impl(const OUString& rURL, const vcl::Window* pWindow, const
if ( impl_showOnlineHelp( aHelpURL ) )
return true;
- NoHelpErrorBox aErrBox( const_cast< vcl::Window* >( pWindow ) );
- aErrBox.Execute();
+ VclPtr<NoHelpErrorBox> aErrBox(new NoHelpErrorBox(const_cast< vcl::Window* >( pWindow )) );
+ aErrBox->Execute();
return false;
}
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 9e0f8de67342..02da90cb125e 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -534,8 +534,8 @@ bool SfxFilterMatcher::IsFilterInstalled_Impl( const SfxFilter* pFilter )
// Here could a re-installation be offered
OUString aText( SfxResId(STR_FILTER_NOT_INSTALLED).toString() );
aText = aText.replaceFirst( "$(FILTER)", pFilter->GetUIName() );
- QueryBox aQuery( NULL, WB_YES_NO | WB_DEF_YES, aText );
- short nRet = aQuery.Execute();
+ VclPtr<QueryBox> aQuery(new QueryBox(NULL, WB_YES_NO | WB_DEF_YES, aText) );
+ short nRet = aQuery->Execute();
if ( nRet == RET_YES )
{
#ifdef DBG_UTIL
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index ff9e9e56b862..4af32d2478e2 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -858,8 +858,8 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css:
SolarMutexGuard aGuard;
vcl::Window* pParentWindow = VCLUnoHelper::GetWindow( xParentWindow );
- MessageDialog aBox(pParentWindow, "ErrorFindEmailDialog", "sfx/ui/errorfindemaildialog.ui");
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog(pParentWindow, "ErrorFindEmailDialog", "sfx/ui/errorfindemaildialog.ui"));
+ aBox->Execute();
eResult = SEND_MAIL_CANCELLED;
}
else
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 91dbe4096b0d..c1a713d4f651 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -633,8 +633,8 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
if (!pStyle->SetName(comphelper::string::stripStart(m_pNameRw->GetText(), ' ')))
{
- MessageDialog aBox( this, SfxResId( STR_TABPAGE_INVALIDNAME ), VCL_MESSAGE_INFO );
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_TABPAGE_INVALIDNAME ), VCL_MESSAGE_INFO));
+ aBox->Execute();
m_pNameRw->GrabFocus();
m_pNameRw->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
return SfxTabPage::KEEP_PAGE;
@@ -650,8 +650,8 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
{
if ( !pStyle->SetFollow( aFollowEntry ) )
{
- MessageDialog aBox( this, SfxResId( STR_TABPAGE_INVALIDSTYLE ), VCL_MESSAGE_INFO );
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_TABPAGE_INVALIDSTYLE ), VCL_MESSAGE_INFO));
+ aBox->Execute();
m_pFollowLb->GrabFocus();
return SfxTabPage::KEEP_PAGE;
}
@@ -670,8 +670,8 @@ int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
{
if ( !pStyle->SetParent( aParentEntry ) )
{
- MessageDialog aBox( this, SfxResId( STR_TABPAGE_INVALIDPARENT ), VCL_MESSAGE_INFO );
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId( STR_TABPAGE_INVALIDPARENT ), VCL_MESSAGE_INFO));
+ aBox->Execute();
m_pBaseLb->GrabFocus();
return SfxTabPage::KEEP_PAGE;
}
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index ca6764967282..56ba1282f617 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -71,8 +71,8 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl)
bConfirmFailed = true;
if ( bConfirmFailed )
{
- MessageDialog aBox(this, SfxResId(STR_ERROR_WRONG_CONFIRM));
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog(this, SfxResId(STR_ERROR_WRONG_CONFIRM)));
+ aBox->Execute();
mpConfirm1ED->SetText( OUString() );
mpConfirm1ED->GrabFocus();
}
diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx
index 8760a0863d94..d63d1df4eff4 100644
--- a/sfx2/source/dialog/recfloat.cxx
+++ b/sfx2/source/dialog/recfloat.cxx
@@ -152,9 +152,9 @@ bool SfxRecordingFloatWrapper_Impl::QueryClose()
com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder = pBindings->GetRecorder();
if ( xRecorder.is() && !xRecorder->getRecordedMacro().isEmpty() )
{
- QueryBox aBox( GetWindow(), WB_YES_NO | WB_DEF_NO , SfxResId(STR_MACRO_LOSS).toString() );
- aBox.SetText( SfxResId(STR_CANCEL_RECORDING).toString() );
- bRet = ( aBox.Execute() == RET_YES );
+ VclPtr<QueryBox> aBox(new QueryBox(GetWindow(), WB_YES_NO | WB_DEF_NO , SfxResId(STR_MACRO_LOSS).toString()));
+ aBox->SetText( SfxResId(STR_CANCEL_RECORDING).toString() );
+ bRet = ( aBox->Execute() == RET_YES );
}
return bRet;
diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx
index 2ddf168ad892..b70ca3c4fab2 100644
--- a/sfx2/source/dialog/securitypage.cxx
+++ b/sfx2/source/dialog/securitypage.cxx
@@ -99,13 +99,13 @@ static bool lcl_GetPassword(
/*out*/OUString &rPassword )
{
bool bRes = false;
- SfxPasswordDialog aPasswdDlg( pParent );
- aPasswdDlg.SetMinLen( 1 );
+ VclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog(pParent));
+ aPasswdDlg->SetMinLen( 1 );
if (bProtect)
- aPasswdDlg.ShowExtras( SHOWEXTRAS_CONFIRM );
- if (RET_OK == aPasswdDlg.Execute() && !aPasswdDlg.GetPassword().isEmpty())
+ aPasswdDlg->ShowExtras( SHOWEXTRAS_CONFIRM );
+ if (RET_OK == aPasswdDlg->Execute() && !aPasswdDlg->GetPassword().isEmpty())
{
- rPassword = aPasswdDlg.GetPassword();
+ rPassword = aPasswdDlg->GetPassword();
bRes = true;
}
return bRes;
@@ -335,9 +335,9 @@ IMPL_LINK_NOARG(SfxSecurityPage_Impl, RecordChangesCBToggleHdl)
bool bAlreadyDone = false;
if (!m_bEndRedliningWarningDone)
{
- WarningBox aBox( m_rMyTabPage.GetParent(), WinBits(WB_YES_NO | WB_DEF_NO),
- m_aEndRedliningWarning );
- if (aBox.Execute() != RET_YES)
+ VclPtr<WarningBox> aBox(new WarningBox(m_rMyTabPage.GetParent(), WinBits(WB_YES_NO | WB_DEF_NO),
+ m_aEndRedliningWarning ));
+ if (aBox->Execute() != RET_YES)
bAlreadyDone = true;
else
m_bEndRedliningWarningDone = true;
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index c10a822af5e2..34097725d091 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1818,13 +1818,13 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl(void *)
if ( bUsedStyle )
{
#if defined UNX
- MessageDialog aBox(SfxGetpApp()->GetTopWindow(), aMsg,
- VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ VclPtr<MessageDialog> aBox(new MessageDialog(SfxGetpApp()->GetTopWindow(), aMsg,
+ VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
#else
- MessageDialog aBox(GetWindow(), aMsg,
- VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ VclPtr<MessageDialog> aBox(new MessageDialog(GetWindow(), aMsg,
+ VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
#endif
- aApproved = aBox.Execute() == RET_YES;
+ aApproved = aBox->Execute() == RET_YES;
}
// if there are no used styles selected or the user approved the changes
diff --git a/sfx2/source/doc/QuerySaveDocument.cxx b/sfx2/source/doc/QuerySaveDocument.cxx
index 63d458f1c955..9ab89a78c374 100644
--- a/sfx2/source/doc/QuerySaveDocument.cxx
+++ b/sfx2/source/doc/QuerySaveDocument.cxx
@@ -29,9 +29,9 @@ short ExecuteQuerySaveDocument(vcl::Window* _pParent, const OUString& _rTitle)
return RET_NO;
}
- MessageDialog aQBox(_pParent, "QuerySaveDialog", "sfx/ui/querysavedialog.ui");
- aQBox.set_primary_text(aQBox.get_primary_text().replaceFirst("$(DOC)", _rTitle));
- return aQBox.Execute();
+ VclPtr<MessageDialog> aQBox(new MessageDialog(_pParent, "QuerySaveDialog", "sfx/ui/querysavedialog.ui"));
+ aQBox->set_primary_text(aQBox->get_primary_text().replaceFirst("$(DOC)", _rTitle));
+ return aQBox->Execute();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx
index e51854ebe18e..f336c22a39e7 100644
--- a/sfx2/source/doc/docinsert.cxx
+++ b/sfx2/source/doc/docinsert.cxx
@@ -190,12 +190,12 @@ IMPL_LINK_NOARG(DocumentInserter, DialogClosedHdl)
if ( ( aValue >>= bPassWord ) && bPassWord )
{
// ask for the password
- SfxPasswordDialog aPasswordDlg( NULL );
- aPasswordDlg.ShowExtras( SHOWEXTRAS_CONFIRM );
- short nRet = aPasswordDlg.Execute();
+ VclPtr<SfxPasswordDialog> aPasswordDlg( new SfxPasswordDialog(NULL) );
+ aPasswordDlg->ShowExtras( SHOWEXTRAS_CONFIRM );
+ short nRet = aPasswordDlg->Execute();
if ( RET_OK == nRet )
{
- OUString aPasswd = aPasswordDlg.GetPassword();
+ OUString aPasswd = aPasswordDlg->GetPassword();
m_pItemSet->Put( SfxStringItem( SID_PASSWORD, aPasswd ) );
}
else
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index c75786910d38..8e36955ad454 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -666,9 +666,9 @@ sal_Int8 ModelData_Impl::CheckSaveAcceptable( sal_Int8 nCurStatus )
{
// notify the user that SaveAs is going to be done
vcl::Window* pWin = SfxStoringHelper::GetModelWindow( m_xModel );
- MessageDialog aMessageBox(pWin, SfxResId(STR_NEW_FILENAME_SAVE),
- VCL_MESSAGE_QUESTION, VCL_BUTTONS_OK_CANCEL);
- if ( aMessageBox.Execute() == RET_OK )
+ VclPtr<MessageDialog> aMessageBox(new MessageDialog(pWin, SfxResId(STR_NEW_FILENAME_SAVE),
+ VCL_MESSAGE_QUESTION, VCL_BUTTONS_OK_CANCEL));
+ if ( aMessageBox->Execute() == RET_OK )
nResult = STATUS_SAVEAS;
else
nResult = STATUS_NO_ACTION;
@@ -1856,9 +1856,9 @@ bool SfxStoringHelper::WarnUnacceptableFormat( const uno::Reference< frame::XMod
return true;
vcl::Window* pWin = SfxStoringHelper::GetModelWindow( xModel );
- SfxAlienWarningDialog aDlg( pWin, aOldUIName );
+ VclPtr<SfxAlienWarningDialog> aDlg(new SfxAlienWarningDialog(pWin, aOldUIName));
- return aDlg.Execute() == RET_OK;
+ return aDlg->Execute() == RET_OK;
}
vcl::Window* SfxStoringHelper::GetModelWindow( const uno::Reference< frame::XModel >& xModel )
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 3f54b39f640f..2f5b220ab701 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -464,8 +464,8 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
{
OUString sMessage( SfxResId(STR_QRYTEMPL_MESSAGE).toString() );
sMessage = sMessage.replaceAll( "$(ARG1)", aTemplName );
- sfx2::QueryTemplateBox aBox( GetDialogParent(), sMessage );
- if ( RET_YES == aBox.Execute() )
+ VclPtr<sfx2::QueryTemplateBox> aBox(new sfx2::QueryTemplateBox(GetDialogParent(), sMessage) );
+ if ( RET_YES == aBox->Execute() )
bLoad = true;
}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 03b4e3a10bc7..4ab26291c3b2 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -364,11 +364,11 @@ void SfxObjectShell::CheckIn( )
{
uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW );
// Pop up dialog to ask for comment and major
- SfxCheckinDialog checkinDlg( &GetFrame( )->GetWindow( ) );
- if ( checkinDlg.Execute( ) == RET_OK )
+ VclPtr<SfxCheckinDialog> checkinDlg(new SfxCheckinDialog(&GetFrame( )->GetWindow( )));
+ if ( checkinDlg->Execute( ) == RET_OK )
{
- OUString sComment = checkinDlg.GetComment( );
- bool bMajor = checkinDlg.IsMajor( );
+ OUString sComment = checkinDlg->GetComment( );
+ bool bMajor = checkinDlg->IsMajor( );
xCmisDoc->checkIn( bMajor, sComment );
uno::Reference< util::XModifiable > xModifiable( GetModel( ), uno::UNO_QUERY );
if ( xModifiable.is( ) )
@@ -857,10 +857,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
case SID_DOCTEMPLATE:
{
// save as document templates
- SfxTemplateManagerDlg aDlg;
- aDlg.setDocumentModel(GetModel());
- aDlg.setSaveMode();
- aDlg.Execute();
+ VclPtr<SfxTemplateManagerDlg> aDlg(new SfxTemplateManagerDlg);
+ aDlg->setDocumentModel(GetModel());
+ aDlg->setSaveMode();
+ aDlg->Execute();
break;
}
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 91c385548117..c68a4b94c034 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3019,8 +3019,8 @@ sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, vcl::
{
sMessage += "\n";
sMessage += SfxResId(nResId).toString();
- WarningBox aWBox( pParent, WB_YES_NO | WB_DEF_NO, sMessage );
- nRet = aWBox.Execute();
+ VclPtr<WarningBox> aWBox(new WarningBox(pParent, WB_YES_NO | WB_DEF_NO, sMessage));
+ nRet = aWBox->Execute();
}
}
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 3d40de2c836b..b1c416c2a507 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -614,9 +614,9 @@ IMPL_LINK(SfxTemplateManagerDlg, RepositoryMenuSelectHdl, Menu*, pMenu)
}
else if (nMenuId == MNI_REPOSITORY_NEW)
{
- PlaceEditDialog dlg(this);
+ VclPtr<PlaceEditDialog> dlg(new PlaceEditDialog(this));
- if (dlg.Execute())
+ if (dlg->Execute())
{
std::shared_ptr<Place> xPlace = dlg.GetPlace();
@@ -628,8 +628,8 @@ IMPL_LINK(SfxTemplateManagerDlg, RepositoryMenuSelectHdl, Menu*, pMenu)
else
{
OUString aMsg(SfxResId(STR_MSG_ERROR_REPOSITORY_NAME).toString());
- aMsg = aMsg.replaceFirst("$1", xPlace->GetName());
- MessageDialog(this, aMsg).Execute();
+ aMsg = aMsg.replaceFirst("$1",xPlace->GetName());
+ VclPtr<MessageDialog>(new MessageDialog(this, aMsg))->Execute();
}
}
}
@@ -1158,16 +1158,16 @@ void SfxTemplateManagerDlg::OnTemplateProperties ()
{
const TemplateViewItem *pItem = static_cast<const TemplateViewItem*>(*maSelTemplates.begin());
- SfxTemplateInfoDlg aDlg;
- aDlg.loadDocument(pItem->getPath());
- aDlg.Execute();
+ VclPtr<SfxTemplateInfoDlg> aDlg(new SfxTemplateInfoDlg);
+ aDlg->loadDocument(pItem->getPath());
+ aDlg->Execute();
}
void SfxTemplateManagerDlg::OnTemplateDelete ()
{
- MessageDialog aQueryDlg(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ VclPtr<MessageDialog> aQueryDlg(new MessageDialog(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
- if ( aQueryDlg.Execute() != RET_YES )
+ if ( aQueryDlg->Execute() != RET_YES )
return;
OUString aTemplateList;
@@ -1236,13 +1236,13 @@ void SfxTemplateManagerDlg::OnTemplateAsDefault ()
void SfxTemplateManagerDlg::OnFolderNew()
{
- InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
+ VclPtr<InputDialog> dlg(new InputDialog(SfxResId(STR_INPUT_NEW).toString(),this));
- int ret = dlg.Execute();
+ int ret = dlg->Execute();
if (ret)
{
- OUString aName = dlg.getEntryText();
+ OUString aName = dlg->getEntryText();
mpCurView->createRegion(aName);
}
@@ -1250,9 +1250,9 @@ void SfxTemplateManagerDlg::OnFolderNew()
void SfxTemplateManagerDlg::OnFolderDelete()
{
- MessageDialog aQueryDlg(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ VclPtr<MessageDialog> aQueryDlg(new MessageDialog(this, SfxResId(STR_QMSG_SEL_FOLDER_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
- if ( aQueryDlg.Execute() != RET_YES )
+ if ( aQueryDlg->Execute() != RET_YES )
return;
OUString aFolderList;
@@ -1303,17 +1303,17 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
return;
}
- InputDialog aDlg(SfxResId(STR_INPUT_TEMPLATE_NEW).toString(),this);
+ VclPtr<InputDialog> aDlg(new InputDialog(SfxResId(STR_INPUT_TEMPLATE_NEW).toString(),this));
- if (aDlg.Execute())
+ if (aDlg->Execute())
{
- OUString aName = aDlg.getEntryText();
+ OUString aName = aDlg->getEntryText();
if (!aName.isEmpty())
{
OUString aFolderList;
OUString aQMsg(SfxResId(STR_QMSG_TEMPLATE_OVERWRITE).toString());
- MessageDialog aQueryDlg(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
+ VclPtr<MessageDialog> aQueryDlg(new MessageDialog(this, OUString(), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
if (mpLocalView->isNonRootRegionVisible())
{
@@ -1322,9 +1322,9 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
if (!mpLocalView->isTemplateNameUnique(nRegionItemId,aName))
{
aQMsg = aQMsg.replaceFirst("$1",aName);
- aQueryDlg.set_primary_text(aQMsg.replaceFirst("$2",mpLocalView->getCurRegionName()));
+ aQueryDlg->set_primary_text(aQMsg.replaceFirst("$2",mpLocalView->getCurRegionName()));
- if (aQueryDlg.Execute() == RET_NO)
+ if (aQueryDlg->Execute() == RET_NO)
return;
}
@@ -1341,9 +1341,9 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
if (!mpLocalView->isTemplateNameUnique(pItem->mnId,aName))
{
OUString aDQMsg = aQMsg.replaceFirst("$1",aName);
- aQueryDlg.set_primary_text(aDQMsg.replaceFirst("$2",pItem->maTitle));
+ aQueryDlg->set_primary_text(aDQMsg.replaceFirst("$2",pItem->maTitle));
- if (aQueryDlg.Execute() == RET_NO)
+ if (aQueryDlg->Execute() == RET_NO)
continue;
}
@@ -1441,13 +1441,13 @@ void SfxTemplateManagerDlg::localMoveTo(sal_uInt16 nMenuId)
if (nMenuId == MNI_MOVE_NEW)
{
- InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
+ VclPtr<InputDialog> dlg(new InputDialog(SfxResId(STR_INPUT_NEW).toString(),this));
- int ret = dlg.Execute();
+ int ret = dlg->Execute();
if (ret)
{
- OUString aName = dlg.getEntryText();
+ OUString aName = dlg->getEntryText();
if (!aName.isEmpty())
nItemId = mpLocalView->createRegion(aName);
@@ -1489,13 +1489,13 @@ void SfxTemplateManagerDlg::remoteMoveTo(const sal_uInt16 nMenuId)
if (nMenuId == MNI_MOVE_NEW)
{
- InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
+ VclPtr<InputDialog> dlg(new InputDialog(SfxResId(STR_INPUT_NEW).toString(),this));
- int ret = dlg.Execute();
+ int ret = dlg->Execute();
if (ret)
{
- OUString aName = dlg.getEntryText();
+ OUString aName = dlg->getEntryText();
if (!aName.isEmpty())
nItemId = mpLocalView->createRegion(aName);
@@ -1543,13 +1543,13 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId)
if (nMenuId == MNI_MOVE_NEW)
{
- InputDialog dlg(SfxResId(STR_INPUT_NEW).toString(),this);
+ VclPtr<InputDialog> dlg(new InputDialog(SfxResId(STR_INPUT_NEW).toString(),this));
- int ret = dlg.Execute();
+ int ret = dlg->Execute();
if (ret)
{
- OUString aName = dlg.getEntryText();
+ OUString aName = dlg->getEntryText();
if (!aName.isEmpty())
nItemId = mpLocalView->createRegion(aName);
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 434b387dc50e..5d7685af9fbb 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -495,9 +495,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if ( nOpenMode == SFX_STREAM_READWRITE && !rReq.IsAPI() )
{
// ::com::sun::star::sdbcx::User offering to open it as a template
- MessageDialog aBox(&GetWindow(), SfxResId(STR_QUERY_OPENASTEMPLATE),
- VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( RET_YES == aBox.Execute() )
+ VclPtr<MessageDialog> aBox(new MessageDialog(&GetWindow(), SfxResId(STR_QUERY_OPENASTEMPLATE),
+ VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ if ( RET_YES == aBox->Execute() )
{
SfxApplication* pApp = SfxGetpApp();
SfxAllItemSet aSet( pApp->GetPool() );
@@ -579,9 +579,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if ( bDo && GetFrame().DocIsModified_Impl() &&
!rReq.IsAPI() && ( !pSilentItem || !pSilentItem->GetValue() ) )
{
- MessageDialog aBox(&GetWindow(), SfxResId(STR_QUERY_LASTVERSION),
- VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- bDo = ( RET_YES == aBox.Execute() );
+ VclPtr<MessageDialog> aBox(new MessageDialog(&GetWindow(), SfxResId(STR_QUERY_LASTVERSION),
+ VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ bDo = ( RET_YES == aBox->Execute() );
}
if ( bDo )
@@ -756,9 +756,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
if ( bForEdit && SID_EDITDOC == rReq.GetSlot() )
{
// ask user for opening as template
- MessageDialog aBox(&GetWindow(), SfxResId(STR_QUERY_OPENASTEMPLATE),
- VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
- if ( RET_YES == aBox.Execute() )
+ VclPtr<MessageDialog> aBox(new MessageDialog(&GetWindow(), SfxResId(STR_QUERY_OPENASTEMPLATE),
+ VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO));
+ if ( RET_YES == aBox->Execute() )
{
SfxAllItemSet aSet( pApp->GetPool() );
aSet.Put( SfxStringItem( SID_FILE_NAME, pMedium->GetName() ) );
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index abfbbbce1591..34b1690dc82b 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -595,8 +595,8 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
if ( eResult == SfxMailModel::SEND_MAIL_ERROR )
{
- MessageDialog aBox( SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VCL_MESSAGE_INFO);
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog(SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VCL_MESSAGE_INFO));
+ aBox->Execute();
rReq.Ignore();
}
else
@@ -615,8 +615,8 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq )
SfxMailModel::SendMailResult eResult = aModel.SaveAndSend( xFrame, OUString() );
if( eResult == SfxMailModel::SEND_MAIL_ERROR )
{
- MessageDialog aBox( SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VCL_MESSAGE_INFO);
- aBox.Execute();
+ VclPtr<MessageDialog> aBox(new MessageDialog(SfxGetpApp()->GetTopWindow(), SfxResId( STR_ERROR_SEND_MAIL ), VCL_MESSAGE_INFO));
+ aBox->Execute();
rReq.Ignore();
}
else
@@ -1311,8 +1311,8 @@ bool SfxViewShell::PrepareClose
{
if ( bUI )
{
- MessageDialog aInfoBox( &GetViewFrame()->GetWindow(), SfxResId( STR_CANT_CLOSE ), VCL_MESSAGE_INFO );
- aInfoBox.Execute();
+ VclPtr<MessageDialog> aInfoBox(new MessageDialog(&GetViewFrame()->GetWindow(), SfxResId( STR_CANT_CLOSE ), VCL_MESSAGE_INFO ));
+ aInfoBox->Execute();
}
return false;