From 61b224f392eb856bf4cfa0c04c68202a463cbdbf Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 20 Mar 2015 11:27:10 +0200 Subject: vclwidget: fixup locally allocated vcl::Window objects They need to be wrapped in ScopedVclPtr in order to be disposed properly. Change-Id: Ib64dba353774f54711e4de7f5d15d859c6a4dc7e --- sw/qa/tiledrendering/tiledrendering.cxx | 2 +- sw/source/core/doc/DocumentRedlineManager.cxx | 2 +- sw/source/ui/config/mailconfigpage.cxx | 2 +- sw/source/ui/config/optcomp.cxx | 2 +- sw/source/ui/dbui/mmoutputpage.cxx | 14 +++++++------- sw/source/ui/dialog/uiregionsw.cxx | 8 ++++---- sw/source/ui/envelp/label1.cxx | 2 +- sw/source/ui/envelp/labfmt.cxx | 4 ++-- sw/source/ui/fmtui/tmpdlg.cxx | 2 +- sw/source/ui/frmdlg/cption.cxx | 4 ++-- sw/source/ui/index/cnttab.cxx | 2 +- sw/source/ui/index/swuiidxmrk.cxx | 6 +++--- sw/source/ui/misc/glosbib.cxx | 2 +- sw/source/ui/misc/glossary.cxx | 8 ++++---- sw/source/ui/misc/num.cxx | 2 +- sw/source/uibase/app/docsh2.cxx | 4 ++-- sw/source/uibase/dochdl/swdtflvr.cxx | 2 +- sw/source/uibase/lingu/olmenu.cxx | 2 +- sw/source/uibase/shells/grfsh.cxx | 2 +- sw/source/uibase/shells/tabsh.cxx | 2 +- sw/source/uibase/shells/textsh1.cxx | 2 +- sw/source/uibase/uiview/view2.cxx | 16 ++++++++-------- sw/source/uibase/uiview/viewdraw.cxx | 2 +- sw/source/uibase/uiview/viewling.cxx | 2 +- sw/source/uibase/uiview/viewprt.cxx | 4 ++-- sw/source/uibase/utlui/gloslst.cxx | 2 +- 26 files changed, 51 insertions(+), 51 deletions(-) (limited to 'sw') diff --git a/sw/qa/tiledrendering/tiledrendering.cxx b/sw/qa/tiledrendering/tiledrendering.cxx index 8f9a51aee6dc..6ba5ae3a1c6c 100644 --- a/sw/qa/tiledrendering/tiledrendering.cxx +++ b/sw/qa/tiledrendering/tiledrendering.cxx @@ -197,7 +197,7 @@ int TiledRenderingApp::Main() Help::EnableQuickHelp(); try { - VclPtr pDialog(new TiledRenderingDialog(this)); + ScopedVclPtr pDialog(new TiledRenderingDialog(this)); pDialog->Execute(); } catch (const uno::Exception &e) diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index b5c28bad182a..360b45e1ab74 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -2665,7 +2665,7 @@ void DocumentRedlineManager::checkRedlining(RedlineMode_t& _rReadlineMode) if ( pParent && !mbReadlineChecked && rRedlineTbl.size() > MAX_REDLINE_COUNT && !((_rReadlineMode & nsRedlineMode_t::REDLINE_SHOW_DELETE) == nsRedlineMode_t::REDLINE_SHOW_DELETE) ) { - VclPtr aQuery(new MessageDialog(pParent, "QueryShowChangesDialog", "modules/swriter/ui/queryshowchangesdialog.ui")); + ScopedVclPtr aQuery(new MessageDialog(pParent, "QueryShowChangesDialog", "modules/swriter/ui/queryshowchangesdialog.ui")); sal_uInt16 nResult = aQuery->Execute(); mbReadlineChecked = true; if ( nResult == RET_YES ) diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx index 86f0a4d61d7a..6ce1b194f628 100644 --- a/sw/source/ui/config/mailconfigpage.cxx +++ b/sw/source/ui/config/mailconfigpage.cxx @@ -217,7 +217,7 @@ IMPL_LINK(SwMailConfigPage, ReplyToHdl, CheckBox*, pBox) IMPL_LINK_NOARG(SwMailConfigPage, AuthenticationHdl) { - VclPtr aDlg(new SwAuthenticationSettingsDialog(this, *m_pConfigItem)); + ScopedVclPtr aDlg(new SwAuthenticationSettingsDialog(this, *m_pConfigItem)); aDlg->Execute(); return 0; } diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index 1342d5859389..d187795f43a6 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -319,7 +319,7 @@ IMPL_LINK_NOARG(SwCompatibilityOptPage, SelectHdl) IMPL_LINK_NOARG(SwCompatibilityOptPage, UseAsDefaultHdl) { - VclPtr aQuery(new MessageDialog(this, "QueryDefaultCompatDialog", + ScopedVclPtr aQuery(new MessageDialog(this, "QueryDefaultCompatDialog", "modules/swriter/ui/querydefaultcompatdialog.ui")); if (aQuery->Execute() == RET_YES) { diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx index 7d62a1b7f782..7a95d497a707 100644 --- a/sw/source/ui/dbui/mmoutputpage.cxx +++ b/sw/source/ui/dbui/mmoutputpage.cxx @@ -540,7 +540,7 @@ IMPL_LINK(SwMailMergeOutputPage, DocumentSelectionHdl_Impl, RadioButton*, pButto IMPL_LINK(SwMailMergeOutputPage, CopyToHdl_Impl, PushButton*, pButton) { - VclPtr pDlg(new SwCopyToDialog(pButton)); + ScopedVclPtr pDlg(new SwCopyToDialog(pButton)); pDlg->SetCC(m_sCC ); pDlg->SetBCC(m_sBCC); if(RET_OK == pDlg->Execute()) @@ -733,7 +733,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) } SwView* pSourceView = rConfigItem.GetSourceView(); - VclPtr aSaveMonitor(this, false, PrintMonitor::MONITOR_TYPE_SAVE); + ScopedVclPtrInstance aSaveMonitor(this, false, PrintMonitor::MONITOR_TYPE_SAVE); aSaveMonitor->m_pDocName->SetText(pSourceView->GetDocShell()->GetTitle(22)); aSaveMonitor->SetCancelHdl(LINK(this, SwMailMergeOutputPage, SaveCancelHdl_Impl)); aSaveMonitor->m_pPrinter->SetText( INetURLObject( sPath ).getFSysPath( INetURLObject::FSYS_DETECT ) ); @@ -799,7 +799,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton) if(bFailed) { - VclPtr aWarning(new SwSaveWarningBox_Impl( pButton, sOutPath )); + ScopedVclPtr aWarning(new SwSaveWarningBox_Impl( pButton, sOutPath )); if(RET_OK == aWarning->Execute()) sOutPath = aWarning->GetFileName(); else @@ -983,12 +983,12 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) if(rConfigItem.GetMailServer().isEmpty() || !SwMailMergeHelper::CheckMailAddress(rConfigItem.GetMailAddress()) ) { - VclPtr aQuery(new QueryBox(pButton, WB_YES_NO_CANCEL, m_sConfigureMail)); + ScopedVclPtr aQuery(new QueryBox(pButton, WB_YES_NO_CANCEL, m_sConfigureMail)); sal_uInt16 nRet = aQuery->Execute(); if(RET_YES == nRet ) { SfxAllItemSet aSet(pTargetView->GetPool()); - VclPtr pDlg(new SwMailConfigDlg(pButton, aSet)); + ScopedVclPtr pDlg(new SwMailConfigDlg(pButton, aSet)); nRet = pDlg->Execute(); } @@ -1077,7 +1077,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) if(m_pSubjectED->GetText().isEmpty()) { - VclPtr aQuery(new SwSendQueryBox_Impl(pButton, "SubjectDialog", + ScopedVclPtr aQuery(new SwSendQueryBox_Impl(pButton, "SubjectDialog", "modules/swriter/ui/subjectdialog.ui")); aQuery->SetIsEmptyTextAllowed(true); aQuery->SetValue(m_sNoSubjectST); @@ -1091,7 +1091,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton) } if(!bAsBody && m_pAttachmentED->GetText().isEmpty()) { - VclPtr aQuery(new SwSendQueryBox_Impl(pButton, "AttachNameDialog", + ScopedVclPtr aQuery(new SwSendQueryBox_Impl(pButton, "AttachNameDialog", "modules/swriter/ui/attachnamedialog.ui")); aQuery->SetIsEmptyTextAllowed(false); if(RET_OK == aQuery->Execute()) diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 8d97a7acd0c5..f0e6e9bc39dd 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -404,7 +404,7 @@ bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox) if (!pRepr->GetTempPasswd().getLength() && pRepr->GetSectionData().GetPassword().getLength()) { - VclPtr aPasswdDlg(new SfxPasswordDialog(this)); + ScopedVclPtr aPasswdDlg(new SfxPasswordDialog(this)); bRet = false; if (aPasswdDlg->Execute()) { @@ -1081,7 +1081,7 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl) aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); - VclPtr aTabDlg(new SwSectionPropertyTabDialog(this, aSet, rSh)); + ScopedVclPtr aTabDlg(new SwSectionPropertyTabDialog(this, aSet, rSh)); if(RET_OK == aTabDlg->Execute()) { const SfxItemSet* pOutSet = aTabDlg->GetOutputItemSet(); @@ -1260,7 +1260,7 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox ) { if(!pRepr->GetTempPasswd().getLength() || bChange) { - VclPtr aPasswdDlg(new SfxPasswordDialog(this)); + ScopedVclPtr aPasswdDlg(new SfxPasswordDialog(this)); aPasswdDlg->ShowExtras(SHOWEXTRAS_CONFIRM); if(RET_OK == aPasswdDlg->Execute()) { @@ -1721,7 +1721,7 @@ IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton ) { if(!m_aNewPasswd.getLength() || bChange) { - VclPtr aPasswdDlg(new SfxPasswordDialog(this)); + ScopedVclPtr aPasswdDlg(new SfxPasswordDialog(this)); aPasswdDlg->ShowExtras(SHOWEXTRAS_CONFIRM); if(RET_OK == aPasswdDlg->Execute()) { diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index 9883e9a99b14..7c1ca59c064c 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -436,7 +436,7 @@ IMPL_LINK_NOARG_INLINE_END(SwLabPage, TypeHdl) void SwLabPage::DisplayFormat() { - VclPtr aField(new MetricField(this, WinBits(0))); + ScopedVclPtr aField(new MetricField(this, WinBits(0))); FieldUnit aMetric = ::GetDfltMetric(false); SetMetric(*aField.get(), aMetric); aField->SetDecimalDigits(2); diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index e333e9bb1ed9..3a4b9fdfb40b 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -579,7 +579,7 @@ IMPL_LINK_NOARG(SwLabFmtPage, SaveHdl) aRec.lPWidth = static_cast< long >(GETFLDVAL(*m_pPWidthField )); aRec.lPHeight = static_cast< long >(GETFLDVAL(*m_pPHeightField)); aRec.bCont = aItem.bCont; - VclPtr pSaveDlg(new SwSaveLabelDlg(this, aRec)); + ScopedVclPtr pSaveDlg(new SwSaveLabelDlg(this, aRec)); pSaveDlg->SetLabel(aItem.aLstMake, aItem.aLstType); pSaveDlg->Execute(); if(pSaveDlg->GetLabel(aItem)) @@ -649,7 +649,7 @@ IMPL_LINK_NOARG(SwSaveLabelDlg, OkHdl) return 0; } - VclPtr aQuery(new MessageDialog(this, "QuerySaveLabelDialog", + ScopedVclPtr aQuery(new MessageDialog(this, "QuerySaveLabelDialog", "modules/swriter/ui/querysavelabeldialog.ui")); aQuery->set_primary_text(aQuery->get_primary_text(). diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index 553dcf9ff5e8..b08a6af3ecb9 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -540,7 +540,7 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt)); aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); // collect character styles - VclPtr rCharFmtLB(new ListBox(this)); + ScopedVclPtr rCharFmtLB(new ListBox(this)); rCharFmtLB->Clear(); rCharFmtLB->InsertEntry( SwViewShell::GetShellRes()->aStrNone ); SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell(); diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx index e3c3f9eeb4ff..d66cf500b440 100644 --- a/sw/source/ui/frmdlg/cption.cxx +++ b/sw/source/ui/frmdlg/cption.cxx @@ -285,7 +285,7 @@ IMPL_LINK_INLINE_START( SwCaptionDialog, OptionHdl, Button*, pButton ) OUString sFldTypeName = m_pCategoryBox->GetText(); if(sFldTypeName == m_sNone) sFldTypeName = OUString(); - VclPtr aDlg( pButton, rView, sFldTypeName ); + ScopedVclPtrInstance aDlg( pButton, rView, sFldTypeName ); aDlg->SetApplyBorderAndShadow(bCopyAttributes); aDlg->SetCharacterStyle( sCharacterStyle ); aDlg->SetOrderNumberingFirst( bOrderNumberingFirst ); @@ -339,7 +339,7 @@ IMPL_LINK_NOARG(SwCaptionDialog, ModifyHdl) IMPL_LINK_NOARG(SwCaptionDialog, CaptionHdl) { SfxItemSet aSet( rView.GetDocShell()->GetDoc()->GetAttrPool() ); - VclPtr aDlg(new SwCaptionOptDlg( this, aSet ) ); + ScopedVclPtr aDlg(new SwCaptionOptDlg( this, aSet ) ); aDlg->Execute(); return 0; diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 073fc004ff7f..e0fd48353790 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -490,7 +490,7 @@ IMPL_LINK_NOARG( SwMultiTOXTabDialog, ShowPreviewHdl ) OUString sInfo(SW_RESSTR(STR_FILE_NOT_FOUND)); sInfo = sInfo.replaceFirst( "%1", sTemplate ); sInfo = sInfo.replaceFirst( "%2", aOpt.GetTemplatePath() ); - VclPtr aInfo(new InfoBox(GetParent(), sInfo)); + ScopedVclPtr aInfo(new InfoBox(GetParent(), sInfo)); aInfo->Execute(); } else diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index bd7bfda19a07..159d3310830f 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -584,7 +584,7 @@ IMPL_LINK( SwNewUserIdxDlg, ModifyHdl, Edit*, pEdit) IMPL_LINK_NOARG(SwIndexMarkPane, NewUserIdxHdl) { - VclPtr pDlg(new SwNewUserIdxDlg(this)); + ScopedVclPtr pDlg(new SwNewUserIdxDlg(this)); if(RET_OK == pDlg->Execute()) { OUString sNewName(pDlg->GetName()); @@ -1208,7 +1208,7 @@ IMPL_LINK_NOARG(SwAuthorMarkPane, InsertHdl) bDifferent |= m_sFields[i] != pEntry->GetAuthorField((ToxAuthorityField)i); if(bDifferent) { - VclPtr aQuery(new MessageDialog(&m_rDialog, SW_RES(STR_QUERY_CHANGE_AUTH_ENTRY), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtr aQuery(new MessageDialog(&m_rDialog, SW_RES(STR_QUERY_CHANGE_AUTH_ENTRY), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); if(RET_YES != aQuery->Execute()) return 0; } @@ -1248,7 +1248,7 @@ IMPL_LINK(SwAuthorMarkPane, CreateEntryHdl, PushButton*, pButton) OUString sOldId = m_sCreatedEntry[0]; for(int i = 0; i < AUTH_FIELD_END; i++) m_sCreatedEntry[i] = bCreate ? OUString() : m_sFields[i]; - VclPtr aDlg(new SwCreateAuthEntryDlg_Impl(pButton, + ScopedVclPtr aDlg(new SwCreateAuthEntryDlg_Impl(pButton, bCreate ? m_sCreatedEntry : m_sFields, *pSh, bNewEntry, bCreate)); if(bNewEntry) diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index d5baec16a62d..458c6aca348a 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -151,7 +151,7 @@ void SwGlossaryGroupDlg::Apply() const OUString sMsg(SW_RESSTR(STR_QUERY_DELETE_GROUP1) + sTitle + SW_RESSTR(STR_QUERY_DELETE_GROUP2)); - VclPtr aQuery(new QueryBox(this->GetParent(), WB_YES_NO|WB_DEF_NO, sMsg )); + ScopedVclPtr aQuery(new QueryBox(this->GetParent(), WB_YES_NO|WB_DEF_NO, sMsg )); if(RET_YES == aQuery->Execute()) pGlosHdl->DelGroup( sDelGroup ); } diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 65a5da2cb8a0..985641c52f17 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -503,7 +503,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) else if (sItemIdent == "rename") { m_pShortNameEdit->SetText(pGlossaryHdl->GetGlossaryShortName(m_pNameED->GetText())); - VclPtr pNewNameDlg(new SwNewGlosNameDlg(this, m_pNameED->GetText(), + ScopedVclPtr pNewNameDlg(new SwNewGlosNameDlg(this, m_pNameED->GetText(), m_pShortNameEdit->GetText() )); if( RET_OK == pNewNameDlg->Execute() && pGlossaryHdl->Rename( m_pShortNameEdit->GetText(), @@ -523,7 +523,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) } else if (sItemIdent == "delete") { - VclPtr aQuery(new MessageDialog(this, SW_RES(STR_QUERY_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtr aQuery(new MessageDialog(this, SW_RES(STR_QUERY_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); if (RET_YES == aQuery->Execute()) { const OUString aShortName(m_pShortNameEdit->GetText()); @@ -651,7 +651,7 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl) if(bIsWritable) { - VclPtr pDlg(new SwGlossaryGroupDlg( this, pGloss->GetPathArray(), pGlossaryHdl )); + ScopedVclPtr pDlg(new SwGlossaryGroupDlg( this, pGloss->GetPathArray(), pGlossaryHdl )); if ( RET_OK == pDlg->Execute() ) { Init(); @@ -681,7 +681,7 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl) } else { - VclPtr aBox(new MessageDialog(this, sReadonlyPath, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtr aBox(new MessageDialog(this, sReadonlyPath, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); if(RET_YES == aBox->Execute()) PathHdl(m_pPathBtn); diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index 5fd96981c7b8..276e76ea572c 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -990,7 +990,7 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage) aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt)); aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); // collect char styles - VclPtr rCharFmtLB(new ListBox(this)); + ScopedVclPtr rCharFmtLB(new ListBox(this)); rCharFmtLB->Clear(); rCharFmtLB->InsertEntry( SwViewShell::GetShellRes()->aStrNone ); SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell(); diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index cbd1cc96f80c..c42759275ea4 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -500,7 +500,7 @@ void SwDocShell::Execute(SfxRequest& rReq) if ( aFileName.isEmpty() ) { SvtPathOptions aPathOpt; - VclPtr pNewFileDlg( + ScopedVclPtr pNewFileDlg( new SfxNewFileDialog(&GetView()->GetViewFrame()->GetWindow(), SFXWB_LOAD_TEMPLATE)); pNewFileDlg->SetTemplateFlags(nFlags); @@ -608,7 +608,7 @@ void SwDocShell::Execute(SfxRequest& rReq) const SfxFilter* pFlt = GetMedium()->GetFilter(); if(!pFlt || pFlt->GetUserData() != pHtmlFlt->GetUserData()) { - VclPtr aQuery(new MessageDialog(&pViewFrm->GetWindow(), + ScopedVclPtr aQuery(new MessageDialog(&pViewFrm->GetWindow(), "SaveAsHTMLDialog", "modules/swriter/ui/saveashtmldialog.ui")); if(RET_YES == aQuery->Execute()) diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 03545308ca2d..b4c9881803c3 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -388,7 +388,7 @@ namespace sal_uInt16 aRotation = aMetadata.getRotation(); if (aRotation != 0) { - VclPtr aQueryBox(new MessageDialog( 0,"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui") ); + ScopedVclPtr aQueryBox(new MessageDialog( 0,"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui") ); if (aQueryBox->Execute() == RET_YES) { GraphicNativeTransform aTransform( aGraphic ); diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx index a1cdc385a2e3..641739755dc2 100644 --- a/sw/source/uibase/lingu/olmenu.cxx +++ b/sw/source/uibase/lingu/olmenu.cxx @@ -803,7 +803,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) uno::Any exc( ::cppu::getCaughtException() ); OUString msg( ::comphelper::anyToString( exc ) ); const SolarMutexGuard guard; - VclPtr aErrorBox(new MessageDialog(NULL, msg)); + ScopedVclPtr aErrorBox(new MessageDialog(NULL, msg)); aErrorBox->SetText( "Explanations" ); aErrorBox->Execute(); } diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index be54e67b88ae..5014223d5e6f 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -163,7 +163,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) Graphic aGraphic = Graphic( *pGraphic ); - VclPtr aDialog(new CompressGraphicsDialog( GetView().GetWindow(), aGraphic, aSize, aCropRectangle, GetView().GetViewFrame()->GetBindings() ) ); + ScopedVclPtr aDialog(new CompressGraphicsDialog( GetView().GetWindow(), aGraphic, aSize, aCropRectangle, GetView().GetViewFrame()->GetBindings() ) ); if( aDialog->Execute() == RET_OK ) { rSh.StartAllAction(); diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 3a282dfa5258..2f1180061991 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -735,7 +735,7 @@ void SwTableShell::Execute(SfxRequest &rReq) break; case TBLMERGE_TOOCOMPLEX: { - VclPtr aInfoBox(new MessageDialog( GetView().GetWindow(), + ScopedVclPtr aInfoBox(new MessageDialog( GetView().GetWindow(), SW_RES( STR_ERR_TABLE_MERGE ), VCL_MESSAGE_INFO ) ); aInfoBox->Execute(); break; diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index cbaf14a9bc8c..b1dcea637cab 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -257,7 +257,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const static short lcl_AskRedlineMode(vcl::Window *pWin) { - VclPtr aQBox(new MessBox( pWin, 0, + ScopedVclPtr aQBox(new MessBox( pWin, 0, OUString( SW_RES( STR_REDLINE_TITLE ) ), OUString( SW_RES( STR_REDLINE_MSG ) ) ) ); aQBox->SetImage( QueryBox::GetStandardImage() ); diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 14698d8593c2..e408b3e81756 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -240,7 +240,7 @@ int SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter, const sal_uInt16 aRotation = aMetadata.getRotation(); if (aRotation != 0) { - VclPtr aQueryBox(new MessageDialog( GetWindow(),"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui") ); + ScopedVclPtr aQueryBox(new MessageDialog( GetWindow(),"QueryRotateIntoStandardOrientationDialog","modules/swriter/ui/queryrotateintostandarddialog.ui") ); if (aQueryBox->Execute() == RET_YES) { GraphicNativeTransform aTransform( aGraphic ); @@ -439,7 +439,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq ) // really store as link only? if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() ) { - VclPtr aWarnDlg(new SvxLinkWarningDialog(GetWindow(),pFileDlg->GetPath())); + ScopedVclPtr aWarnDlg(new SvxLinkWarningDialog(GetWindow(),pFileDlg->GetPath())); if( aWarnDlg->Execute() != RET_OK ) bAsLink=false; // don't store as link } @@ -504,7 +504,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq ) { if( bShowError ) { - VclPtr aInfoBox(new MessageDialog( GetWindow(), SW_RESSTR( nResId ), VCL_MESSAGE_INFO) ); + ScopedVclPtr aInfoBox(new MessageDialog( GetWindow(), SW_RESSTR( nResId ), VCL_MESSAGE_INFO) ); aInfoBox->Execute(); } rReq.Ignore(); @@ -585,7 +585,7 @@ void SwView::Execute(SfxRequest &rReq) pParent = static_cast( pParentItem )->GetWindowPtr(); else pParent = &GetViewFrame()->GetWindow(); - VclPtr aPasswdDlg(new SfxPasswordDialog( pParent )); + ScopedVclPtr aPasswdDlg(new SfxPasswordDialog( pParent )); aPasswdDlg->SetMinLen( 1 ); //#i69751# the result of Execute() can be ignored (void)aPasswdDlg->Execute(); @@ -623,7 +623,7 @@ void SwView::Execute(SfxRequest &rReq) pParent = static_cast( pParentItem )->GetWindowPtr(); else pParent = &GetViewFrame()->GetWindow(); - VclPtr aPasswdDlg(new SfxPasswordDialog( pParent )); + ScopedVclPtr aPasswdDlg(new SfxPasswordDialog( pParent )); aPasswdDlg->SetMinLen( 1 ); if(!aPasswd.getLength()) aPasswdDlg->ShowExtras(SHOWEXTRAS_CONFIRM); @@ -2287,7 +2287,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument) if ( lcl_NeedAdditionalDataSource( xDBContext ) ) { // no data sources are available - create a new one - VclPtr aQuery(new MessageDialog(&GetViewFrame()->GetWindow(), + ScopedVclPtr aQuery(new MessageDialog(&GetViewFrame()->GetWindow(), "DataSourcesUnavailableDialog", "modules/swriter/ui/datasourcesunavailabledialog.ui")); // no cancel allowed @@ -2336,7 +2336,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument) OUString sSource; if(!GetWrtShell().IsFieldDataSourceAvailable(sSource)) { - VclPtr aWarning(new MessageDialog(&GetViewFrame()->GetWindow(), + ScopedVclPtr aWarning(new MessageDialog(&GetViewFrame()->GetWindow(), "WarnDataSourceDialog", "modules/swriter/ui/warndatasourcedialog.ui")); OUString sTmp(aWarning->get_primary_text()); @@ -2390,7 +2390,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument) SfxApplication* pSfxApp = SfxGetpApp(); vcl::Window* pTopWin = pSfxApp->GetTopWindow(); - VclPtr aDocTemplDlg(new SfxTemplateManagerDlg); + ScopedVclPtr 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 1319bd75ee8a..0b75147b401a 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -177,7 +177,7 @@ void SwView::ExecDraw(SfxRequest& rReq) if ( pSdrView ) { SdrObject* pObj = NULL; - VclPtr aDlg(new svx::FontWorkGalleryDialog( pSdrView, pWin, nSlotId )); + ScopedVclPtr aDlg(new svx::FontWorkGalleryDialog( pSdrView, pWin, nSlotId )); aDlg->SetSdrObjectRef( &pObj, pSdrView->GetModel() ); aDlg->Execute(); if ( pObj ) diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index 6c8d9ad2a4f3..a68bd58e5ede 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -459,7 +459,7 @@ void SwView::HyphenateDocument() // turned on no special area { // I want also in special areas hyphenation - VclPtr aBox(new MessageDialog(&GetEditWin(), SW_RES(STR_QUERY_SPECIAL_FORCED), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtr aBox(new MessageDialog(&GetEditWin(), SW_RES(STR_QUERY_SPECIAL_FORCED), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); if( aBox->Execute() == RET_YES ) { bOther = true; diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx index 0a3a4cf363e0..af45b47ce266 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -175,7 +175,7 @@ void SwView::ExecutePrint(SfxRequest& rReq) } else { - VclPtr aInfoBox(new MessageDialog(&GetEditWin(), SW_RES(STR_ERR_NO_FAX), VCL_MESSAGE_INFO)); + ScopedVclPtr 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(); @@ -201,7 +201,7 @@ void SwView::ExecutePrint(SfxRequest& rReq) if(!bSilent && !bFromMerge && SW_MOD()->GetModuleConfig()->IsAskForMailMerge() && pSh->IsAnyDatabaseFieldInDoc()) { - VclPtr aBox(new MessageDialog(&GetEditWin(), "PrintMergeDialog", + ScopedVclPtr aBox(new MessageDialog(&GetEditWin(), "PrintMergeDialog", "modules/swriter/ui/printmergedialog.ui")); short nRet = aBox->Execute(); if(RET_YES == nRet) diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx index eb6be8eec322..cf9d634e5435 100644 --- a/sw/source/uibase/utlui/gloslst.cxx +++ b/sw/source/uibase/utlui/gloslst.cxx @@ -158,7 +158,7 @@ bool SwGlossaryList::GetShortName(const OUString& rLongName, } else if(1 < nCount) { - VclPtr aDlg(new SwGlossDecideDlg(0)); + ScopedVclPtr aDlg(new SwGlossDecideDlg(0)); OUString sTitle = aDlg->GetText() + " " + aTripleStrings.front().sBlock; aDlg->SetText(sTitle); -- cgit