diff options
author | Noel Grandin <noel@peralex.com> | 2015-02-11 14:42:23 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 22:17:00 +0100 |
commit | 00f2787a4a68633206635743298926bf2e65a8fa (patch) | |
tree | efc3a4f02b3d8acd69d25071499be5a475cb0338 /sw/source/uibase/uiview | |
parent | b3dcb2996b70caabda1939c9e85545c97d78404a (diff) |
vclwidgets: wrap all vcl::Window subclasses allocated on stack in VclPtr
Change-Id: Ia8b0d84bbf69f9d8f85505d019acdded14e25133
Conflicts:
sw/qa/tiledrendering/tiledrendering.cxx
Diffstat (limited to 'sw/source/uibase/uiview')
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 50 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewdraw.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewling.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewprt.cxx | 12 |
4 files changed, 36 insertions, 36 deletions
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 19530171d8fd..14698d8593c2 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -240,8 +240,8 @@ int SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter, const sal_uInt16 aRotation = aMetadata.getRotation(); if (aRotation != 0) { - MessageDialog aQueryBox( GetWindow(),"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui"); - if (aQueryBox.Execute() == RET_YES) + VclPtr<MessageDialog> aQueryBox(new MessageDialog( GetWindow(),"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui") ); + if (aQueryBox->Execute() == RET_YES) { GraphicNativeTransform aTransform( aGraphic ); aTransform.rotate( aRotation ); @@ -439,8 +439,8 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq ) // really store as link only? if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() ) { - SvxLinkWarningDialog aWarnDlg(GetWindow(),pFileDlg->GetPath()); - if( aWarnDlg.Execute() != RET_OK ) + VclPtr<SvxLinkWarningDialog> aWarnDlg(new SvxLinkWarningDialog(GetWindow(),pFileDlg->GetPath())); + if( aWarnDlg->Execute() != RET_OK ) bAsLink=false; // don't store as link } } @@ -504,8 +504,8 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq ) { if( bShowError ) { - MessageDialog aInfoBox( GetWindow(), SW_RESSTR( nResId ), VCL_MESSAGE_INFO); - aInfoBox.Execute(); + VclPtr<MessageDialog> aInfoBox(new MessageDialog( GetWindow(), SW_RESSTR( nResId ), VCL_MESSAGE_INFO) ); + aInfoBox->Execute(); } rReq.Ignore(); } @@ -585,11 +585,11 @@ void SwView::Execute(SfxRequest &rReq) pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr(); else pParent = &GetViewFrame()->GetWindow(); - SfxPasswordDialog aPasswdDlg( pParent ); - aPasswdDlg.SetMinLen( 1 ); + VclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog( pParent )); + aPasswdDlg->SetMinLen( 1 ); //#i69751# the result of Execute() can be ignored - (void)aPasswdDlg.Execute(); - OUString sNewPasswd( aPasswdDlg.GetPassword() ); + (void)aPasswdDlg->Execute(); + OUString sNewPasswd( aPasswdDlg->GetPassword() ); Sequence <sal_Int8> aNewPasswd = pIDRA->GetRedlinePassword(); SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd ); if(SvPasswordHelper::CompareHashPassword(aPasswd, sNewPasswd)) @@ -623,14 +623,14 @@ void SwView::Execute(SfxRequest &rReq) pParent = static_cast<const XWindowItem*>( pParentItem )->GetWindowPtr(); else pParent = &GetViewFrame()->GetWindow(); - SfxPasswordDialog aPasswdDlg( pParent ); - aPasswdDlg.SetMinLen( 1 ); + VclPtr<SfxPasswordDialog> aPasswdDlg(new SfxPasswordDialog( pParent )); + aPasswdDlg->SetMinLen( 1 ); if(!aPasswd.getLength()) - aPasswdDlg.ShowExtras(SHOWEXTRAS_CONFIRM); - if (aPasswdDlg.Execute()) + aPasswdDlg->ShowExtras(SHOWEXTRAS_CONFIRM); + if (aPasswdDlg->Execute()) { sal_uInt16 nOn = nsRedlineMode_t::REDLINE_ON; - OUString sNewPasswd( aPasswdDlg.GetPassword() ); + OUString sNewPasswd( aPasswdDlg->GetPassword() ); Sequence <sal_Int8> aNewPasswd = pIDRA->GetRedlinePassword(); SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd ); @@ -2287,11 +2287,11 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument) if ( lcl_NeedAdditionalDataSource( xDBContext ) ) { // no data sources are available - create a new one - MessageDialog aQuery(&GetViewFrame()->GetWindow(), + VclPtr<MessageDialog> aQuery(new MessageDialog(&GetViewFrame()->GetWindow(), "DataSourcesUnavailableDialog", - "modules/swriter/ui/datasourcesunavailabledialog.ui"); + "modules/swriter/ui/datasourcesunavailabledialog.ui")); // no cancel allowed - if (RET_OK != aQuery.Execute()) + if (RET_OK != aQuery->Execute()) return; bCallAddressPilot = true; } @@ -2336,12 +2336,12 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument) OUString sSource; if(!GetWrtShell().IsFieldDataSourceAvailable(sSource)) { - MessageDialog aWarning(&GetViewFrame()->GetWindow(), + VclPtr<MessageDialog> aWarning(new MessageDialog(&GetViewFrame()->GetWindow(), "WarnDataSourceDialog", - "modules/swriter/ui/warndatasourcedialog.ui"); - OUString sTmp(aWarning.get_primary_text()); - aWarning.set_primary_text(sTmp.replaceFirst("%1", sSource)); - if (RET_OK == aWarning.Execute()) + "modules/swriter/ui/warndatasourcedialog.ui")); + OUString sTmp(aWarning->get_primary_text()); + aWarning->set_primary_text(sTmp.replaceFirst("%1", sSource)); + if (RET_OK == aWarning->Execute()) { SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); if ( pFact ) @@ -2390,8 +2390,8 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument) SfxApplication* pSfxApp = SfxGetpApp(); vcl::Window* pTopWin = pSfxApp->GetTopWindow(); - SfxTemplateManagerDlg aDocTemplDlg; - int nRet = aDocTemplDlg.Execute(); + VclPtr<SfxTemplateManagerDlg> aDocTemplDlg(new SfxTemplateManagerDlg); + int nRet = aDocTemplDlg->Execute(); bool bNewWin = false; if ( nRet == RET_OK ) { diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index ccc39a4aca63..1319bd75ee8a 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -177,9 +177,9 @@ void SwView::ExecDraw(SfxRequest& rReq) if ( pSdrView ) { SdrObject* pObj = NULL; - svx::FontWorkGalleryDialog aDlg( pSdrView, pWin, nSlotId ); - aDlg.SetSdrObjectRef( &pObj, pSdrView->GetModel() ); - aDlg.Execute(); + VclPtr<svx::FontWorkGalleryDialog> aDlg(new svx::FontWorkGalleryDialog( pSdrView, pWin, nSlotId )); + aDlg->SetSdrObjectRef( &pObj, pSdrView->GetModel() ); + aDlg->Execute(); if ( pObj ) { Size aDocSize( m_pWrtShell->GetDocSize() ); diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index 7b3c95d25f2d..001f48dad3ce 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -459,8 +459,8 @@ void SwView::HyphenateDocument() // turned on no special area { // I want also in special areas hyphenation - MessageDialog aBox(&GetEditWin(), SW_RES(STR_QUERY_SPECIAL_FORCED), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); - if( aBox.Execute() == RET_YES ) + VclPtr<MessageDialog> aBox(new MessageDialog(&GetEditWin(), SW_RES(STR_QUERY_SPECIAL_FORCED), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + if( aBox->Execute() == RET_YES ) { bOther = true; if (xProp.is()) diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx index a9e63c363856..0a3a4cf363e0 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -175,10 +175,10 @@ void SwView::ExecutePrint(SfxRequest& rReq) } else { - MessageDialog aInfoBox(&GetEditWin(), SW_RES(STR_ERR_NO_FAX), VCL_MESSAGE_INFO); + VclPtr<MessageDialog> aInfoBox(new MessageDialog(&GetEditWin(), SW_RES(STR_ERR_NO_FAX), VCL_MESSAGE_INFO)); sal_uInt16 nResNo = bWeb ? STR_WEBOPTIONS : STR_TEXTOPTIONS; - aInfoBox.set_primary_text(aInfoBox.get_primary_text().replaceFirst("%1", OUString(SW_RES(nResNo)))); - aInfoBox.Execute(); + aInfoBox->set_primary_text(aInfoBox->get_primary_text().replaceFirst("%1", OUString(SW_RES(nResNo)))); + aInfoBox->Execute(); SfxUInt16Item aDefPage(SID_SW_EDITOPTIONS, TP_OPTPRINT_PAGE); GetViewFrame()->GetDispatcher()->Execute(SID_SW_EDITOPTIONS, SfxCallMode::SYNCHRON|SfxCallMode::RECORD, @@ -201,9 +201,9 @@ void SwView::ExecutePrint(SfxRequest& rReq) if(!bSilent && !bFromMerge && SW_MOD()->GetModuleConfig()->IsAskForMailMerge() && pSh->IsAnyDatabaseFieldInDoc()) { - MessageDialog aBox(&GetEditWin(), "PrintMergeDialog", - "modules/swriter/ui/printmergedialog.ui"); - short nRet = aBox.Execute(); + VclPtr<MessageDialog> aBox(new MessageDialog(&GetEditWin(), "PrintMergeDialog", + "modules/swriter/ui/printmergedialog.ui")); + short nRet = aBox->Execute(); if(RET_YES == nRet) { SfxBoolItem aBool(FN_QRY_MERGE, true); |