diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-03-31 23:04:14 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 13:40:25 +0100 |
commit | 8a65284fe31e6c0a927cb88b75df7845cd248572 (patch) | |
tree | 0427685579288f412d1890619e8bc224339bb228 /dbaccess/source/ui/tabledesign/TableController.cxx | |
parent | d46e0d9656670dcd7dcca2f32062606400ff6246 (diff) |
Automated conversion of VclPtr construction to use Instance template.
Change-Id: I8be9141b9653e73ebd23a5a3d810f240c376f97e
Diffstat (limited to 'dbaccess/source/ui/tabledesign/TableController.cxx')
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableController.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 81c8e5970ab2..59e0e8a51395 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -318,7 +318,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs) } DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::TABLE ); - ScopedVclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker ) ); + ScopedVclPtrInstance< OSaveAsDlg > aDlg( 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); - ScopedVclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error ) ); + ScopedVclPtrInstance< OSQLMessageBox > aDlg( 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()) { - ScopedVclPtr<MessageDialog> aAsk(new MessageDialog(getView(), ModuleRes(STR_QUERY_SAVE_TABLE_EDIT_INDEXES), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtrInstance< MessageDialog > aAsk(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; - ScopedVclPtr<DbaIndexDialog> aDialog(new DbaIndexDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() && getConnection()->getMetaData().is() ? getConnection()->getMetaData()->getMaxColumnsInIndex() : 0)); + ScopedVclPtrInstance< DbaIndexDialog > aDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() && getConnection()->getMetaData().is() ? getConnection()->getMetaData()->getMaxColumnsInIndex() : 0); if (RET_OK != aDialog->Execute()) return; @@ -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)); - ScopedVclPtr<OSQLMessageBox> aBox(new OSQLMessageBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES)); + ScopedVclPtrInstance< OSQLMessageBox > aBox(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() ); - ScopedVclPtr<OSQLWarningBox> aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError ) ); + ScopedVclPtrInstance< OSQLWarningBox > aMsg( 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()); - ScopedVclPtr<OSQLWarningBox> aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES ) ); + ScopedVclPtrInstance< OSQLWarningBox > aMsg( 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)); - ScopedVclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES)); + ScopedVclPtrInstance< OSQLMessageBox > aMsg(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES); if(aMsg->Execute() == RET_YES) { xKeyColumns = NULL; |