diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-20 11:27:10 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 12:37:44 +0100 |
commit | 61b224f392eb856bf4cfa0c04c68202a463cbdbf (patch) | |
tree | 77a28e38763bc5f9d95e2c278601d31dc6fbf65d /dbaccess/source | |
parent | f1d9eef4163e88a3cb6360178b52ce441e65d8ae (diff) |
vclwidget: fixup locally allocated vcl::Window objects
They need to be wrapped in ScopedVclPtr in order to be disposed properly.
Change-Id: Ib64dba353774f54711e4de7f5d15d859c6a4dc7e
Diffstat (limited to 'dbaccess/source')
28 files changed, 77 insertions, 78 deletions
diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx index dd1aa10eebb0..c6041a033a70 100644 --- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx @@ -406,7 +406,7 @@ namespace dbmm // check that the backup location isn't the same as the document itself if ( lcl_equalURLs_nothrow( m_pData->aContext, sBackupLocation, m_pData->xDocumentModel->getURL() ) ) { - VclPtr<MessageDialog> aErrorBox(new MessageDialog( const_cast< MacroMigrationDialog* >( this ), MacroMigrationResId( STR_INVALID_BACKUP_LOCATION ) )); + ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog( const_cast< MacroMigrationDialog* >( this ), MacroMigrationResId( STR_INVALID_BACKUP_LOCATION ) )); aErrorBox->Execute(); rBackupPage.grabLocationFocus(); return false; diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index ec583e17860d..a4dff8c95b42 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -175,7 +175,7 @@ void OApplicationController::deleteTables(const ::std::vector< OUString>& _rList else { OUString sMessage(ModuleRes(STR_MISSING_TABLES_XDROP)); - VclPtr<MessageDialog> aError(new MessageDialog(getView(), sMessage)); + ScopedVclPtr<MessageDialog> aError(new MessageDialog(getView(), sMessage)); aError->Execute(); } } @@ -210,7 +210,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec if ( eResult != svtools::QUERYDELETE_ALL ) { - VclPtr<svtools::QueryDeleteDlg_Impl> aDlg( new svtools::QueryDeleteDlg_Impl(getView(), *aThisRound) ); + ScopedVclPtr<svtools::QueryDeleteDlg_Impl> aDlg( new svtools::QueryDeleteDlg_Impl(getView(), *aThisRound) ); if ( !sDialogPosition.isEmpty() ) aDlg->SetWindowState( sDialogPosition ); @@ -686,7 +686,7 @@ bool OApplicationController::paste( ElementType _eType, const ::svx::ODataAccess has a /table/ with that name) */ if ( bNeedAskForName ) { - VclPtr<OSaveAsDlg> aAskForName(new OSaveAsDlg( getView(), + ScopedVclPtr<OSaveAsDlg> aAskForName(new OSaveAsDlg( getView(), CommandType::QUERY, getORB(), getConnection(), diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index df90c32fd9dc..237a31f1033d 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -111,7 +111,7 @@ void OApplicationController::convertToView(const OUString& _sName) OUString aDefaultName = ::dbaui::createDefaultName(xMeta,xTables,aName); DynamicTableOrQueryNameCheck aNameChecker( xConnection, CommandType::TABLE ); - VclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( getView(), CommandType::TABLE, getORB(), xConnection, aDefaultName, aNameChecker ) ); + ScopedVclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( getView(), CommandType::TABLE, getORB(), xConnection, aDefaultName, aNameChecker ) ); if ( aDlg->Execute() == RET_OK ) { OUString sName = aDlg->getName(); @@ -534,7 +534,7 @@ void OApplicationController::askToReconnect() bool bClear = true; if ( !m_pSubComponentManager->empty() ) { - VclPtr<MessageDialog> aQry(new MessageDialog(getView(), ModuleRes(STR_QUERY_CLOSEDOCUMENTS), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtr<MessageDialog> aQry(new MessageDialog(getView(), ModuleRes(STR_QUERY_CLOSEDOCUMENTS), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); switch (aQry->Execute()) { case RET_YES: diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 32a261f40d5e..4c857cf2f3d4 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1271,7 +1271,7 @@ IMPL_LINK( SbaXDataBrowserController, OnAsyncDisplayError, void*, /* _pNotIntere { if ( m_aCurrentError.isValid() ) { - VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( getBrowserView(), m_aCurrentError )); + ScopedVclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( getBrowserView(), m_aCurrentError )); aDlg->Execute(); } return 0L; @@ -1764,14 +1764,14 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(bool bFilter) Reference< XConnection> xCon(xFormSet->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),UNO_QUERY); if(bFilter) { - VclPtr<DlgFilterCrit> aDlg(new DlgFilterCrit( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() ) ); + ScopedVclPtr<DlgFilterCrit> aDlg(new DlgFilterCrit( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() ) ); if ( !aDlg->Execute() ) return; // if so we don't need to update the grid aDlg->BuildWherePart(); } else { - VclPtr<DlgOrderCrit> aDlg(new DlgOrderCrit( getBrowserView(),xCon,xParser,xSup->getColumns() ) ); + ScopedVclPtr<DlgOrderCrit> aDlg(new DlgOrderCrit( getBrowserView(),xCon,xParser,xSup->getColumns() ) ); if(!aDlg->Execute()) { return; // if so we don't need to actualize the grid @@ -2172,7 +2172,7 @@ bool SbaXDataBrowserController::SaveModified(bool bAskFor) { getBrowserView()->getVclControl()->GrabFocus(); - VclPtr<MessageDialog> aQry(new MessageDialog(getBrowserView()->getVclControl(), + ScopedVclPtr<MessageDialog> aQry(new MessageDialog(getBrowserView()->getVclControl(), "SaveModifiedDialog", "dbaccess/ui/savemodifieddialog.ui")); diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 030d38e3947b..c581844cfa8d 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -792,7 +792,7 @@ void SbaGridControl::SetColWidth(sal_uInt16 nColId) Any aWidth = xAffectedCol->getPropertyValue(PROPERTY_WIDTH); sal_Int32 nCurWidth = aWidth.hasValue() ? ::comphelper::getINT32(aWidth) : -1; - VclPtr<DlgSize> aDlgColWidth(new DlgSize(this, nCurWidth, false)); + ScopedVclPtr<DlgSize> aDlgColWidth(new DlgSize(this, nCurWidth, false)); if (aDlgColWidth->Execute()) { sal_Int32 nValue = aDlgColWidth->GetValue(); @@ -821,7 +821,7 @@ void SbaGridControl::SetRowHeight() Any aHeight = xCols->getPropertyValue(PROPERTY_ROW_HEIGHT); sal_Int32 nCurHeight = aHeight.hasValue() ? ::comphelper::getINT32(aHeight) : -1; - VclPtr<DlgSize> aDlgRowHeight(new DlgSize(this, nCurHeight, true)); + ScopedVclPtr<DlgSize> aDlgRowHeight(new DlgSize(this, nCurHeight, true)); if (aDlgRowHeight->Execute()) { sal_Int32 nValue = aDlgRowHeight->GetValue(); diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index d174133cb1ae..a7e9e8b5ca07 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -180,7 +180,7 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click) Reference< XContent> xContent; if ( xNameContainer->hasByName(sName) ) { - VclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) ) ); + ScopedVclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) ) ); if ( aBox->Execute() != RET_YES ) return 0; } diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 4c65ae511e2a..d07c04e8e0f7 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -309,7 +309,7 @@ namespace dbaui aProfiles.insert(pArray[index]); // execute the select dialog - VclPtr<ODatasourceSelectDialog> aSelector(new ODatasourceSelectDialog(GetParent(), aProfiles)); + ScopedVclPtr<ODatasourceSelectDialog> aSelector(new ODatasourceSelectDialog(GetParent(), aProfiles)); OUString sOldProfile=getURLNoPrefix(); if (!sOldProfile.isEmpty()) @@ -479,7 +479,7 @@ namespace dbaui sQuery = sQuery.replaceFirst("$path$", aTransformer.get(OFileNotation::N_SYSTEM)); m_bUserGrabFocus = false; - VclPtr<QueryBox> aQuery(new QueryBox(GetParent(), WB_YES_NO | WB_DEF_YES, sQuery)); + ScopedVclPtr<QueryBox> aQuery(new QueryBox(GetParent(), WB_YES_NO | WB_DEF_YES, sQuery)); sal_Int32 nQueryResult = aQuery->Execute(); m_bUserGrabFocus = true; @@ -496,7 +496,7 @@ namespace dbaui sQuery = sQuery.replaceFirst("$name$", aTransformer.get(OFileNotation::N_SYSTEM)); m_bUserGrabFocus = false; - VclPtr<QueryBox> aWhatToDo(new QueryBox(GetParent(), WB_RETRY_CANCEL | WB_DEF_RETRY, sQuery)); + ScopedVclPtr<QueryBox> aWhatToDo(new QueryBox(GetParent(), WB_RETRY_CANCEL | WB_DEF_RETRY, sQuery)); nQueryResult = aWhatToDo->Execute(); m_bUserGrabFocus = true; diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index d9aafa2ef3f6..dde891761a3b 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -308,7 +308,7 @@ namespace dbaui const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error; - VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) ); + ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) ); aMsg->Execute(); return 0L; } diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index ab31641d718f..f202e90f708a 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -563,7 +563,7 @@ using namespace ::com::sun::star; #endif const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error; - VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) ); + ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) ); aMsg->Execute(); return 0L; } @@ -685,7 +685,7 @@ using namespace ::com::sun::star; } #endif sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; - VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString() ) ); + ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString() ) ); aMsg->Execute(); return 0L; } diff --git a/dbaccess/source/ui/dlg/UserAdmin.cxx b/dbaccess/source/ui/dlg/UserAdmin.cxx index bd282d763e41..032d337c3c79 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -102,7 +102,7 @@ IMPL_LINK_NOARG(OPasswordDialog, OKHdl_Impl) else { OUString aErrorMsg( ModuleRes( STR_ERROR_PASSWORDS_NOT_IDENTICAL)); - VclPtr<MessageDialog> aErrorBox(new MessageDialog(this, aErrorMsg)); + ScopedVclPtr<MessageDialog> aErrorBox(new MessageDialog(this, aErrorMsg)); aErrorBox->Execute(); m_pEDPassword->SetText( OUString() ); m_pEDPasswordRepeat->SetText( OUString() ); @@ -213,7 +213,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) { if(pButton == m_pNEWUSER) { - VclPtr<SfxPasswordDialog> aPwdDlg(new SfxPasswordDialog(this)); + ScopedVclPtr<SfxPasswordDialog> aPwdDlg(new SfxPasswordDialog(this)); aPwdDlg->ShowExtras(SHOWEXTRAS_ALL); if(aPwdDlg->Execute()) { @@ -240,7 +240,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) if(xUser.is()) { OUString sNewPassword,sOldPassword; - VclPtr<OPasswordDialog> aDlg(new OPasswordDialog(this,sName)); + ScopedVclPtr<OPasswordDialog> aDlg(new OPasswordDialog(this,sName)); if(aDlg->Execute() == RET_OK) { sNewPassword = aDlg->GetNewPassword(); @@ -259,7 +259,7 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) Reference<XDrop> xDrop(m_xUsers,UNO_QUERY); if(xDrop.is()) { - VclPtr<MessageDialog> aQry(new MessageDialog(this, ModuleRes(STR_QUERY_USERADMIN_DELETE_USER), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtr<MessageDialog> aQry(new MessageDialog(this, ModuleRes(STR_QUERY_USERADMIN_DELETE_USER), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); if(aQry->Execute() == RET_YES) xDrop->dropByName(GetUser()); } diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index 61744a511719..b83788833c74 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -117,7 +117,7 @@ namespace dbaui // show an error message OUString sError( ModuleRes( STR_COULD_NOT_LOAD_ODBC_LIB ) ); sError = sError.replaceFirst("#lib#", aEnumeration.getLibraryName()); - VclPtr<MessageDialog> aDialog(new MessageDialog(this, sError)); + ScopedVclPtr<MessageDialog> aDialog(new MessageDialog(this, sError)); aDialog->Execute(); return false; } @@ -125,7 +125,7 @@ namespace dbaui { aEnumeration.getDatasourceNames(aOdbcDatasources); // execute the select dialog - VclPtr<ODatasourceSelectDialog> aSelector(new ODatasourceSelectDialog(GetParent(), aOdbcDatasources)); + ScopedVclPtr<ODatasourceSelectDialog> aSelector(new ODatasourceSelectDialog(GetParent(), aOdbcDatasources)); if (!_sCurr.isEmpty()) aSelector->Select(_sCurr); if ( RET_OK == aSelector->Execute() ) @@ -242,7 +242,7 @@ namespace dbaui eImage = OSQLMessageBox::Error; aMessage = ModuleRes(STR_CONNECTION_NO_SUCCESS); } - VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, sTitle, aMessage, WB_OK, eImage ) ); + ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, sTitle, aMessage, WB_OK, eImage ) ); aMsg->Execute(); } if ( !bSuccess ) diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 206a1cdfa06a..ecf9537a6dfc 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -248,7 +248,7 @@ namespace dbaui { if (m_pIndexes == pButton) { - VclPtr<ODbaseIndexDialog> aIndexDialog(new ODbaseIndexDialog(this, m_sDsn)); + ScopedVclPtr<ODbaseIndexDialog> aIndexDialog(new ODbaseIndexDialog(this, m_sDsn)); aIndexDialog->Execute(); } else @@ -541,7 +541,7 @@ namespace dbaui #endif const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error; - VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) ); + ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) ); aMsg->Execute(); return 0L; } diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index 32c9270e248b..c7d1634a2087 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -106,7 +106,7 @@ namespace dbaui { OUString sMessage(ModuleRes(STR_DIRECTSQL_CONNECTIONLOST)); - VclPtr<MessageDialog> aError(new MessageDialog(this, sMessage)); + ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, sMessage)); aError->Execute(); } diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 2451eac37c32..5e58d86d8f7b 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -738,7 +738,7 @@ namespace dbaui if ( aFileDlg.GetCurrentFilter() != pFilter->GetUIName() || !pFilter->GetWildcard().Matches(sPath) ) { OUString sMessage(ModuleRes(STR_ERR_USE_CONNECT_TO)); - VclPtr<InfoBox> aError(new InfoBox(this, sMessage)); + ScopedVclPtr<InfoBox> aError(new InfoBox(this, sMessage)); aError->Execute(); m_pRB_ConnectDatabase->Check(); OnSetupModeSelected( m_pRB_ConnectDatabase ); diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index dc2c7dd93ce0..7b71e75093a2 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -422,7 +422,7 @@ namespace dbaui { OUString sConfirm(ModuleRes(STR_CONFIRM_DROP_INDEX)); sConfirm = sConfirm.replaceFirst("$name$", m_pIndexList->GetEntryText(pSelected)); - VclPtr<MessageDialog> aConfirm(new MessageDialog(this, sConfirm, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtr<MessageDialog> aConfirm(new MessageDialog(this, sConfirm, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); if (RET_YES != aConfirm->Execute()) return; } @@ -586,7 +586,7 @@ namespace dbaui if (aSelected->isModified() || aSelected->isNew()) { - VclPtr<MessageDialog> aQuestion(new MessageDialog(this, "SaveIndexDialog", + ScopedVclPtr<MessageDialog> aQuestion(new MessageDialog(this, "SaveIndexDialog", "dbaccess/ui/saveindexdialog.ui")); nResponse = aQuestion->Execute(); } @@ -630,7 +630,7 @@ namespace dbaui { OUString sError(ModuleRes(STR_INDEX_NAME_ALREADY_USED)); sError = sError.replaceFirst("$name$", sNewName); - VclPtr<MessageDialog> aError(new MessageDialog(this, sError)); + ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, sError)); aError->Execute(); updateToolbox(); @@ -691,7 +691,7 @@ namespace dbaui // need at least one field if (0 == _rPos->aFields.size()) { - VclPtr<MessageDialog> aError(new MessageDialog(this, ModuleRes(STR_NEED_INDEX_FIELDS))); + ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, ModuleRes(STR_NEED_INDEX_FIELDS))); aError->Execute(); m_pFields->GrabFocus(); return false; @@ -709,7 +709,7 @@ namespace dbaui // a column is specified twice ... won't work anyway, so prevent this here and now OUString sMessage(ModuleRes(STR_INDEXDESIGN_DOUBLE_COLUMN_NAME)); sMessage = sMessage.replaceFirst("$name$", aFieldCheck->sFieldName); - VclPtr<MessageDialog> aError(new MessageDialog(this, sMessage)); + ScopedVclPtr<MessageDialog> aError(new MessageDialog(this, sMessage)); aError->Execute(); m_pFields->GrabFocus(); return false; diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 49377e7a1019..1c63cb0fdf22 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -712,7 +712,7 @@ void OSQLMessageBox::dispose() IMPL_LINK( OSQLMessageBox, ButtonClickHdl, Button *, /*pButton*/ ) { - VclPtr<OExceptionChainDialog> aDlg(new OExceptionChainDialog( this, m_pImpl->aDisplayInfo ) ); + ScopedVclPtr<OExceptionChainDialog> aDlg(new OExceptionChainDialog( this, m_pImpl->aDisplayInfo ) ); aDlg->Execute(); return 0; } diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index 7ee4607f3d7b..eb14533397ff 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -327,7 +327,7 @@ namespace dbaui if (aErrorInfo.isValid()) { // establishing the connection failed. Show an error window and exit. - VclPtr<OSQLMessageBox> aMessageBox(new OSQLMessageBox( GetParentDialog(), aErrorInfo )); + ScopedVclPtr<OSQLMessageBox> aMessageBox(new OSQLMessageBox( GetParentDialog(), aErrorInfo )); aMessageBox->Execute(); m_pTables->Enable(false); m_pTablesList->Clear(); diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index 088beb689cc1..ba1352b3c5ae 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -687,7 +687,7 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe { bool bHaveDefaultTable = !m_sDefaultTableName.isEmpty(); OUString sTableName( bHaveDefaultTable ? m_sDefaultTableName : _rTableName ); - VclPtr<OCopyTableWizard> aWizard(new OCopyTableWizard( + ScopedVclPtr<OCopyTableWizard> aWizard(new OCopyTableWizard( NULL, sTableName, bHaveDefaultTable ? CopyTableOperation::AppendData : CopyTableOperation::CopyDefinitionAndData, @@ -754,7 +754,7 @@ void ODatabaseExport::showErrorDialog(const ::com::sun::star::sdbc::SQLException OUString aMsg(e.Message); aMsg += "\n"; aMsg += ModuleRes( STR_QRY_CONTINUE ); - VclPtr<OSQLWarningBox> aBox(new OSQLWarningBox( NULL, aMsg, WB_YES_NO | WB_DEF_NO ) ); + ScopedVclPtr<OSQLWarningBox> aBox(new OSQLWarningBox( NULL, aMsg, WB_YES_NO | WB_DEF_NO ) ); if (aBox->Execute() == RET_YES) m_bDontAskAgain = true; diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index 8a74d80ea268..a107c94e8a5a 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -241,7 +241,7 @@ bool ORowSetImportExport::insertNewRow() if(!m_bAlreadyAsked) { OUString sAskIfContinue = ModuleRes(STR_ERROR_OCCURRED_WHILE_COPYING); - VclPtr<OSQLWarningBox> aDlg(new OSQLWarningBox( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES ) ); + ScopedVclPtr<OSQLWarningBox> aDlg(new OSQLWarningBox( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES ) ); if(aDlg->Execute() == RET_YES) m_bAlreadyAsked = true; else diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index ef31134a06dd..ff9d94a27642 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -852,7 +852,7 @@ bool callColumnFormatDialog(vcl::Window* _pParent, } { // want the dialog to be destroyed before our set - VclPtr<SbaSbAttrDlg> aDlg(new SbaSbAttrDlg(_pParent, pFormatDescriptor, _pFormatter, _bHasFormat)); + ScopedVclPtr<SbaSbAttrDlg> aDlg(new SbaSbAttrDlg(_pParent, pFormatDescriptor, _pFormatter, _bHasFormat)); if (RET_OK == aDlg->Execute()) { // ItemSet->UNO @@ -997,7 +997,7 @@ void adjustBrowseBoxColumnWidth( ::svt::EditBrowseBox* _pBox, sal_uInt16 _nColId Size aDefaultMM = _pBox->PixelToLogic( Size( nDefaultWidth, 0 ), MapMode( MAP_MM ) ); - VclPtr<DlgSize> aColumnSizeDlg(new DlgSize( _pBox, nColSize, false, aDefaultMM.Width() * 10 ) ); + ScopedVclPtr<DlgSize> aColumnSizeDlg(new DlgSize( _pBox, nColSize, false, aDefaultMM.Width() * 10 ) ); if ( aColumnSizeDlg->Execute() ) { sal_Int32 nValue = aColumnSizeDlg->GetValue(); @@ -1286,7 +1286,7 @@ sal_Int32 askForUserAction(vcl::Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _ SolarMutexGuard aGuard; OUString aMsg = ModuleRes(_nText); aMsg = aMsg.replaceFirst("%1", _sName); - VclPtr<OSQLMessageBox> aAsk(new OSQLMessageBox(_pParent, ModuleRes(_nTitle ), aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query)); + ScopedVclPtr<OSQLMessageBox> aAsk(new OSQLMessageBox(_pParent, ModuleRes(_nTitle ), aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query)); if ( _bAll ) { aAsk->AddButton(ModuleRes(STR_BUTTON_TEXT_ALL), RET_ALL, 0); @@ -1431,7 +1431,7 @@ bool insertHierachyElement( vcl::Window* _pParent, const Reference< XComponentCo // here we have everything needed to create a new query object ... HierarchicalNameCheck aNameChecker( _xNames.get(), sName ); // ... ehm, except a new name - VclPtr<OSaveAsDlg> aAskForName(new OSaveAsDlg( _pParent, + ScopedVclPtr<OSaveAsDlg> aAskForName(new OSaveAsDlg( _pParent, _rxContext, sTargetName, sLabel, diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx index ce98528c4fc5..e9fed42eee82 100644 --- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -308,7 +308,7 @@ namespace dbaui bool bReConnect = true; if ( _bUI ) { - VclPtr<MessageDialog> aQuery(new MessageDialog(getView(), ModuleRes(STR_QUERY_CONNECTION_LOST), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtr<MessageDialog> aQuery(new MessageDialog(getView(), ModuleRes(STR_QUERY_CONNECTION_LOST), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); bReConnect = ( RET_YES == aQuery->Execute() ); } diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index eb0016249e3d..68cf1a76aba7 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -158,7 +158,7 @@ namespace } } - VclPtr<OQueryTableConnection> aInfo(new OQueryTableConnection(pTableView, aInfoData)); + ScopedVclPtr<OQueryTableConnection> aInfo(new OQueryTableConnection(pTableView, aInfoData)); // Because OQueryTableConnection never takes ownership of the data passed to it, but only remembers the pointer, // this pointer to a local variable is not critical, as aInfoData and aInfo have the same lifetime pTableView->NotifyTabConnection( *aInfo.get() ); diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index 66c6e4dc978c..23563fd70980 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -118,7 +118,7 @@ namespace { OQueryTableConnectionData* pData = static_cast< OQueryTableConnectionData*>(_pConnectionData.get()); - VclPtr<DlgQryJoin> aDlg(new DlgQryJoin(_pView,_pConnectionData,&_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables)); + ScopedVclPtr<DlgQryJoin> aDlg(new DlgQryJoin(_pView,_pConnectionData,&_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables)); bool bOk = aDlg->Execute() == RET_OK; if( bOk ) { @@ -208,7 +208,7 @@ namespace pNewConnData->AppendConnLine(*pIter,sRelatedColumn); // now add the Conn itself - VclPtr<OQueryTableConnection> aNewConn(new OQueryTableConnection(_pView, aNewConnData)); + ScopedVclPtr<OQueryTableConnection> aNewConn(new OQueryTableConnection(_pView, aNewConnData)); // referring to the local variable is not important, as NotifyQueryTabConn creates a new copy // to add me (if not existent) _pView->NotifyTabConnection(*aNewConn.get(), false); @@ -621,7 +621,7 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ pNewConnectionData->AppendConnLine( aSourceFieldName,aDestFieldName ); - VclPtr<OQueryTableConnection> aNewConnection(new OQueryTableConnection(this, aNewConnectionData)); + ScopedVclPtr<OQueryTableConnection> aNewConnection(new OQueryTableConnection(this, aNewConnectionData)); NotifyTabConnection(*aNewConnection.get()); // As usual with NotifyTabConnection, using a local variable is fine because a copy is made } diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 67b478944a6a..f5aabbb95d44 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -987,7 +987,7 @@ void OQueryController::impl_initialize() OUString aTitle( ModuleRes( STR_QUERYDESIGN_NO_VIEW_SUPPORT ) ); OUString aMessage( ModuleRes( STR_QUERYDESIGN_NO_VIEW_ASK ) ); ODataView* pWindow = getView(); - VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query )); + ScopedVclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query )); bClose = aDlg->Execute() == RET_NO; } if ( bClose ) @@ -1238,7 +1238,7 @@ void OQueryController::loadViewSettings( const ::comphelper::NamedValueCollectio void OQueryController::execute_QueryPropDlg() { - VclPtr<QueryPropertiesDialog> aQueryPropDlg(new QueryPropertiesDialog( + ScopedVclPtr<QueryPropertiesDialog> aQueryPropDlg(new QueryPropertiesDialog( getContainer(), m_bDistinct, m_nLimit )); if( aQueryPropDlg->Execute() == RET_OK ) @@ -1398,7 +1398,7 @@ bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElements, b } DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::QUERY ); - VclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( + ScopedVclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( getView(), m_nCommandType, getORB(), @@ -1802,7 +1802,7 @@ short OQueryController::saveModified() ) { OUString sMessageText( lcl_getObjectResourceString( STR_QUERY_SAVEMODIFIED, m_nCommandType ) ); - VclPtr<QueryBox> aQry(new QueryBox( getView(), WB_YES_NO_CANCEL | WB_DEF_YES, sMessageText ) ); + ScopedVclPtr<QueryBox> aQry(new QueryBox( getView(), WB_YES_NO_CANCEL | WB_DEF_YES, sMessageText ) ); nRet = aQry->Execute(); if ( ( nRet == RET_YES ) @@ -1914,7 +1914,7 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings if ( !i_bForceCurrentControllerSettings && !editingView() ) { OUString aTitle(ModuleRes(STR_SVT_SQL_SYNTAX_ERROR)); - VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox(getView(),aTitle,aErrorMsg)); + ScopedVclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox(getView(),aTitle,aErrorMsg)); aDlg->Execute(); } bError = true; diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index 6982b38a7888..8415437ce6ba 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -205,7 +205,7 @@ void ORelationController::impl_initialize() { OUString sTitle(ModuleRes(STR_RELATIONDESIGN)); sTitle = sTitle.copy(3); - VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox(NULL,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE))); + ScopedVclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox(NULL,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE))); aDlg->Execute(); } disconnect(); @@ -255,7 +255,7 @@ short ORelationController::saveModified() short nSaved = RET_YES; if(haveDataSource() && isModified()) { - VclPtr<MessageDialog> aQry(new MessageDialog(getView(), "DesignSaveModifiedDialog", + ScopedVclPtr<MessageDialog> aQry(new MessageDialog(getView(), "DesignSaveModifiedDialog", "dbaccess/ui/designsavemodifieddialog.ui")); nSaved = aQry->Execute(); if(nSaved == RET_YES) diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index 615a760349de..051f03fbf2e9 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -223,7 +223,7 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const void ORelationTableView::ConnDoubleClicked( OTableConnection* pConnection ) { - VclPtr<ORelationDialog> aRelDlg(new ORelationDialog( this, pConnection->GetData() )); + ScopedVclPtr<ORelationDialog> aRelDlg(new ORelationDialog( this, pConnection->GetData() )); switch (aRelDlg->Execute()) { case RET_OK: @@ -251,7 +251,7 @@ void ORelationTableView::AddNewRelation() { TTableConnectionData::value_type pNewConnData( new ORelationTableConnectionData() ); - VclPtr<ORelationDialog> aRelDlg(new ORelationDialog(this, pNewConnData, true)); + ScopedVclPtr<ORelationDialog> aRelDlg(new ORelationDialog(this, pNewConnData, true)); bool bSuccess = (aRelDlg->Execute() == RET_OK); if (bSuccess) @@ -326,7 +326,7 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin ) { - VclPtr<OSQLWarningBox> aDlg(new OSQLWarningBox( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES )); + ScopedVclPtr<OSQLWarningBox> aDlg(new OSQLWarningBox( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES )); if ( m_bInRemove || aDlg->Execute() == RET_YES ) { m_pView->getController().ClearUndoManager(); @@ -344,8 +344,7 @@ void ORelationTableView::lookForUiActivities() { OUString sTitle(ModuleRes(STR_RELATIONDESIGN)); sTitle = sTitle.copy(3); - - VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),OUString(),0)); + ScopedVclPtrInstance<OSQLMessageBox> aDlg(this,ModuleRes(STR_QUERY_REL_EDIT_RELATION),OUString(),0); aDlg->SetText(sTitle); aDlg->RemoveButton(aDlg->GetButtonId(0)); aDlg->AddButton( ModuleRes(STR_QUERY_REL_EDIT), RET_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON); @@ -365,7 +364,7 @@ void ORelationTableView::lookForUiActivities() } if(m_pCurrentlyTabConnData) { - VclPtr<ORelationDialog> aRelDlg(new ORelationDialog( this, m_pCurrentlyTabConnData ) ); + ScopedVclPtr<ORelationDialog> aRelDlg(new ORelationDialog( this, m_pCurrentlyTabConnData ) ); if (aRelDlg->Execute() == RET_OK) { // already updated by the dialog diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index b9d21bf18c8b..0adce50dce79 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -285,7 +285,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs) if (!xTablesSup.is()) { OUString aMessage(ModuleRes(STR_TABLEDESIGN_CONNECTION_MISSING)); - VclPtr<OSQLWarningBox>(new OSQLWarningBox( getView(), aMessage ) )->Execute(); + ScopedVclPtr<OSQLWarningBox>(new OSQLWarningBox( getView(), aMessage ) )->Execute(); return false; } @@ -318,7 +318,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs) } DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::TABLE ); - VclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker ) ); + ScopedVclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker ) ); if ( aDlg->Execute() != RET_OK ) return false; @@ -415,7 +415,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs) { OUString sText( ModuleRes( STR_NAME_ALREADY_EXISTS ) ); sText = sText.replaceFirst( "#" , m_sName); - VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error ) ); + ScopedVclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error ) ); aDlg->Execute(); bError = true; @@ -447,7 +447,7 @@ void OTableController::doEditIndexes() // table needs to be saved before editing indexes if (m_bNew || isModified()) { - VclPtr<MessageDialog> aAsk(new MessageDialog(getView(), ModuleRes(STR_QUERY_SAVE_TABLE_EDIT_INDEXES), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtr<MessageDialog> aAsk(new MessageDialog(getView(), ModuleRes(STR_QUERY_SAVE_TABLE_EDIT_INDEXES), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); if (RET_YES != aAsk->Execute()) return; @@ -490,7 +490,7 @@ void OTableController::doEditIndexes() if (!xIndexes.is()) return; - VclPtr<DbaIndexDialog> aDialog(new DbaIndexDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() && getConnection()->getMetaData().is() ? getConnection()->getMetaData()->getMaxColumnsInIndex() : 0)); + ScopedVclPtr<DbaIndexDialog> aDialog(new DbaIndexDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() && getConnection()->getMetaData().is() ? getConnection()->getMetaData()->getMaxColumnsInIndex() : 0)); if (RET_OK != aDialog->Execute()) return; @@ -522,7 +522,7 @@ void OTableController::impl_initialize() } catch(const SQLException&) { - VclPtr<OSQLWarningBox>(new OSQLWarningBox( getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ) ) )->Execute(); + ScopedVclPtr<OSQLWarningBox>(new OSQLWarningBox( getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ) ) )->Execute(); throw; } try @@ -563,7 +563,7 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti ::boost::mem_fn(&OTableRow::isValid)); if ( aIter != m_vRowList.end() ) { - VclPtr<MessageDialog> aQry(new MessageDialog(getView(), "TableDesignSaveModifiedDialog", + ScopedVclPtr<MessageDialog> aQry(new MessageDialog(getView(), "TableDesignSaveModifiedDialog", "dbaccess/ui/tabledesignsavemodifieddialog.ui")); switch (aQry->Execute()) { @@ -580,7 +580,7 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti } else if ( !m_bNew ) { - VclPtr<MessageDialog> aQry(new MessageDialog(getView(), "DeleteAllRowsDialog", + ScopedVclPtr<MessageDialog> aQry(new MessageDialog(getView(), "DeleteAllRowsDialog", "dbaccess/ui/deleteallrowsdialog.ui")); switch (aQry->Execute()) { @@ -936,7 +936,7 @@ bool OTableController::checkColumns(bool _bNew) { OUString strMessage = ModuleRes(STR_TABLEDESIGN_DUPLICATE_NAME); strMessage = strMessage.replaceFirst("$column$", pFieldDesc->GetName()); - VclPtr<OSQLWarningBox>(new OSQLWarningBox( getView(), strMessage ) )->Execute(); + ScopedVclPtr<OSQLWarningBox>(new OSQLWarningBox( getView(), strMessage ) )->Execute(); return false; } } @@ -946,7 +946,7 @@ bool OTableController::checkColumns(bool _bNew) { OUString sTitle(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD)); OUString sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY)); - VclPtr<OSQLMessageBox> aBox(new OSQLMessageBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES)); + ScopedVclPtr<OSQLMessageBox> aBox(new OSQLMessageBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES)); switch ( aBox->Execute() ) { @@ -1075,7 +1075,7 @@ void OTableController::alterColumns() aMessage = aMessage.replaceFirst( "$column$", pField->GetName() ); SQLExceptionInfo aError( ::cppu::getCaughtException() ); - VclPtr<OSQLWarningBox> aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError ) ); + ScopedVclPtr<OSQLWarningBox> aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError ) ); bNotOk = aMsg->Execute() == RET_YES; } else @@ -1131,7 +1131,7 @@ void OTableController::alterColumns() { OUString aMessage(ModuleRes(STR_TABLEDESIGN_ALTER_ERROR)); aMessage = aMessage.replaceFirst("$column$",pField->GetName()); - VclPtr<OSQLWarningBox> aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES ) ); + ScopedVclPtr<OSQLWarningBox> aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES ) ); if ( aMsg->Execute() != RET_YES ) { Reference<XPropertySet> xNewColumn(xIdxColumns->getByIndex(nPos),UNO_QUERY_THROW); @@ -1198,7 +1198,7 @@ void OTableController::alterColumns() OUString aMsgT(ModuleRes(STR_TBL_COLUMN_IS_KEYCOLUMN)); aMsgT = aMsgT.replaceFirst("$column$",*pIter); OUString aTitle(ModuleRes(STR_TBL_COLUMN_IS_KEYCOLUMN_TITLE)); - VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES)); + ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES)); if(aMsg->Execute() == RET_YES) { xKeyColumns = NULL; diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx index d0f5a99a1041..db0a40e7c970 100644 --- a/dbaccess/source/ui/uno/dbinteraction.cxx +++ b/dbaccess/source/ui/uno/dbinteraction.cxx @@ -127,7 +127,7 @@ namespace dbaui xParamCallback = Reference< XInteractionSupplyParameters >(_rContinuations[nParamPos], UNO_QUERY); OSL_ENSURE(xParamCallback.is(), "BasicInteractionHandler::implHandle(ParametersRequest): can't set the parameters without an appropriate interaction handler!s"); - VclPtr<OParameterDialog> aDlg(new OParameterDialog(NULL, _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext)); + ScopedVclPtr<OParameterDialog> aDlg(new OParameterDialog(NULL, _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext)); sal_Int16 nResult = aDlg->Execute(); try { @@ -182,7 +182,7 @@ namespace dbaui } // execute the dialog - VclPtr<OSQLMessageBox> aDialog(new OSQLMessageBox(NULL, _rSqlInfo, nDialogStyle)); + ScopedVclPtr<OSQLMessageBox> aDialog(new OSQLMessageBox(NULL, _rSqlInfo, nDialogStyle)); // TODO: need a way to specify the parent window sal_Int16 nResult = aDialog->Execute(); try @@ -256,7 +256,7 @@ namespace dbaui Reference< XInteractionDocumentSave > xCallback(_rContinuations[nDocuPos], UNO_QUERY); OSL_ENSURE(xCallback.is(), "BasicInteractionHandler::implHandle(DocumentSaveRequest): can't save document without an appropriate interaction handler!s"); - VclPtr<OCollectionView> aDlg(new OCollectionView(NULL, _rDocuRequest.Content, _rDocuRequest.Name, m_xContext)); + ScopedVclPtr<OCollectionView> aDlg(new OCollectionView(NULL, _rDocuRequest.Content, _rDocuRequest.Name, m_xContext)); sal_Int16 nResult = aDlg->Execute(); try { |