From 00f2787a4a68633206635743298926bf2e65a8fa Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 11 Feb 2015 14:42:23 +0200 Subject: vclwidgets: wrap all vcl::Window subclasses allocated on stack in VclPtr Change-Id: Ia8b0d84bbf69f9d8f85505d019acdded14e25133 Conflicts: sw/qa/tiledrendering/tiledrendering.cxx --- dbaccess/source/ui/tabledesign/TableController.cxx | 56 +++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'dbaccess/source/ui/tabledesign/TableController.cxx') diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index b21d9c88fe07..b9d21bf18c8b 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)); - OSQLWarningBox( getView(), aMessage ).Execute(); + VclPtr(new OSQLWarningBox( getView(), aMessage ) )->Execute(); return false; } @@ -318,13 +318,13 @@ bool OTableController::doSaveDoc(bool _bSaveAs) } DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::TABLE ); - OSaveAsDlg aDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker ); - if ( aDlg.Execute() != RET_OK ) + VclPtr aDlg(new OSaveAsDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker ) ); + if ( aDlg->Execute() != RET_OK ) return false; - m_sName = aDlg.getName(); - sCatalog = aDlg.getCatalog(); - sSchema = aDlg.getSchema(); + m_sName = aDlg->getName(); + sCatalog = aDlg->getCatalog(); + sSchema = aDlg->getSchema(); } // did we get a name @@ -415,9 +415,9 @@ bool OTableController::doSaveDoc(bool _bSaveAs) { OUString sText( ModuleRes( STR_NAME_ALREADY_EXISTS ) ); sText = sText.replaceFirst( "#" , m_sName); - OSQLMessageBox aDlg( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error ); + VclPtr aDlg(new OSQLMessageBox( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error ) ); - aDlg.Execute(); + aDlg->Execute(); bError = true; } catch( const Exception& ) @@ -447,8 +447,8 @@ void OTableController::doEditIndexes() // table needs to be saved before editing indexes if (m_bNew || isModified()) { - MessageDialog aAsk(getView(), ModuleRes(STR_QUERY_SAVE_TABLE_EDIT_INDEXES), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); - if (RET_YES != aAsk.Execute()) + VclPtr aAsk(new MessageDialog(getView(), ModuleRes(STR_QUERY_SAVE_TABLE_EDIT_INDEXES), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + if (RET_YES != aAsk->Execute()) return; if (!doSaveDoc(false)) @@ -490,8 +490,8 @@ void OTableController::doEditIndexes() if (!xIndexes.is()) return; - DbaIndexDialog aDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() && getConnection()->getMetaData().is() ? getConnection()->getMetaData()->getMaxColumnsInIndex() : 0); - if (RET_OK != aDialog.Execute()) + VclPtr 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&) { - OSQLWarningBox( getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ) ).Execute(); + VclPtr(new OSQLWarningBox( getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ) ) )->Execute(); throw; } try @@ -563,9 +563,9 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti ::boost::mem_fn(&OTableRow::isValid)); if ( aIter != m_vRowList.end() ) { - MessageDialog aQry(getView(), "TableDesignSaveModifiedDialog", - "dbaccess/ui/tabledesignsavemodifieddialog.ui"); - switch (aQry.Execute()) + VclPtr aQry(new MessageDialog(getView(), "TableDesignSaveModifiedDialog", + "dbaccess/ui/tabledesignsavemodifieddialog.ui")); + switch (aQry->Execute()) { case RET_YES: Execute(ID_BROWSER_SAVEDOC,Sequence()); @@ -580,9 +580,9 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti } else if ( !m_bNew ) { - MessageDialog aQry(getView(), "DeleteAllRowsDialog", - "dbaccess/ui/deleteallrowsdialog.ui"); - switch (aQry.Execute()) + VclPtr aQry(new MessageDialog(getView(), "DeleteAllRowsDialog", + "dbaccess/ui/deleteallrowsdialog.ui")); + switch (aQry->Execute()) { case RET_YES: { @@ -936,7 +936,7 @@ bool OTableController::checkColumns(bool _bNew) { OUString strMessage = ModuleRes(STR_TABLEDESIGN_DUPLICATE_NAME); strMessage = strMessage.replaceFirst("$column$", pFieldDesc->GetName()); - OSQLWarningBox( getView(), strMessage ).Execute(); + VclPtr(new OSQLWarningBox( getView(), strMessage ) )->Execute(); return false; } } @@ -946,9 +946,9 @@ bool OTableController::checkColumns(bool _bNew) { OUString sTitle(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD)); OUString sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY)); - OSQLMessageBox aBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES); + VclPtr aBox(new OSQLMessageBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES)); - switch ( aBox.Execute() ) + switch ( aBox->Execute() ) { case RET_YES: { @@ -1075,8 +1075,8 @@ void OTableController::alterColumns() aMessage = aMessage.replaceFirst( "$column$", pField->GetName() ); SQLExceptionInfo aError( ::cppu::getCaughtException() ); - OSQLWarningBox aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError ); - bNotOk = aMsg.Execute() == RET_YES; + VclPtr aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError ) ); + bNotOk = aMsg->Execute() == RET_YES; } else throw; @@ -1131,8 +1131,8 @@ void OTableController::alterColumns() { OUString aMessage(ModuleRes(STR_TABLEDESIGN_ALTER_ERROR)); aMessage = aMessage.replaceFirst("$column$",pField->GetName()); - OSQLWarningBox aMsg( getView(), aMessage, WB_YES_NO | WB_DEF_YES ); - if ( aMsg.Execute() != RET_YES ) + VclPtr aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES ) ); + if ( aMsg->Execute() != RET_YES ) { Reference xNewColumn(xIdxColumns->getByIndex(nPos),UNO_QUERY_THROW); OUString sName; @@ -1198,8 +1198,8 @@ 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)); - OSQLMessageBox aMsg(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES); - if(aMsg.Execute() == RET_YES) + VclPtr aMsg(new OSQLMessageBox(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES)); + if(aMsg->Execute() == RET_YES) { xKeyColumns = NULL; dropPrimaryKey(); -- cgit 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 --- dbaccess/source/ui/tabledesign/TableController.cxx | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'dbaccess/source/ui/tabledesign/TableController.cxx') 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(new OSQLWarningBox( getView(), aMessage ) )->Execute(); + ScopedVclPtr(new OSQLWarningBox( getView(), aMessage ) )->Execute(); return false; } @@ -318,7 +318,7 @@ bool OTableController::doSaveDoc(bool _bSaveAs) } DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::TABLE ); - VclPtr aDlg(new OSaveAsDlg( getView(), CommandType::TABLE, getORB(), getConnection(), aDefaultName, aNameChecker ) ); + ScopedVclPtr 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 aDlg(new OSQLMessageBox( getView(), OUString( ModuleRes( STR_ERROR_DURING_CREATION ) ), sText, WB_OK, OSQLMessageBox::Error ) ); + ScopedVclPtr 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 aAsk(new MessageDialog(getView(), ModuleRes(STR_QUERY_SAVE_TABLE_EDIT_INDEXES), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + ScopedVclPtr 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 aDialog(new DbaIndexDialog(getView(), aFieldNames, xIndexes, getConnection(), getORB(), isConnected() && getConnection()->getMetaData().is() ? getConnection()->getMetaData()->getMaxColumnsInIndex() : 0)); + ScopedVclPtr 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(new OSQLWarningBox( getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ) ) )->Execute(); + ScopedVclPtr(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 aQry(new MessageDialog(getView(), "TableDesignSaveModifiedDialog", + ScopedVclPtr 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 aQry(new MessageDialog(getView(), "DeleteAllRowsDialog", + ScopedVclPtr 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(new OSQLWarningBox( getView(), strMessage ) )->Execute(); + ScopedVclPtr(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 aBox(new OSQLMessageBox(getView(), sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES)); + ScopedVclPtr 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 aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES , &aError ) ); + ScopedVclPtr 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 aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES ) ); + ScopedVclPtr aMsg(new OSQLWarningBox( getView(), aMessage, WB_YES_NO | WB_DEF_YES ) ); if ( aMsg->Execute() != RET_YES ) { Reference 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 aMsg(new OSQLMessageBox(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES)); + ScopedVclPtr aMsg(new OSQLMessageBox(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES)); if(aMsg->Execute() == RET_YES) { xKeyColumns = NULL; -- cgit From 5d133eb62187ae910772ff5dfeb8f2c3276e8481 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 31 Mar 2015 20:57:16 +0100 Subject: first half of non-scriptable, Instance constructor conversion. Change-Id: If73bb41bfa805e22609748f25971724b4778edb3 --- dbaccess/source/ui/tabledesign/TableController.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'dbaccess/source/ui/tabledesign/TableController.cxx') diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 0adce50dce79..81c8e5970ab2 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)); - ScopedVclPtr(new OSQLWarningBox( getView(), aMessage ) )->Execute(); + ScopedVclPtrInstance(getView(), aMessage )->Execute(); return false; } @@ -522,7 +522,7 @@ void OTableController::impl_initialize() } catch(const SQLException&) { - ScopedVclPtr(new OSQLWarningBox( getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ) ) )->Execute(); + ScopedVclPtrInstance(getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ))->Execute(); throw; } try @@ -563,8 +563,8 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti ::boost::mem_fn(&OTableRow::isValid)); if ( aIter != m_vRowList.end() ) { - ScopedVclPtr aQry(new MessageDialog(getView(), "TableDesignSaveModifiedDialog", - "dbaccess/ui/tabledesignsavemodifieddialog.ui")); + ScopedVclPtrInstance aQry(getView(), "TableDesignSaveModifiedDialog", + "dbaccess/ui/tabledesignsavemodifieddialog.ui"); switch (aQry->Execute()) { case RET_YES: @@ -580,8 +580,8 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti } else if ( !m_bNew ) { - ScopedVclPtr aQry(new MessageDialog(getView(), "DeleteAllRowsDialog", - "dbaccess/ui/deleteallrowsdialog.ui")); + ScopedVclPtrInstance aQry(getView(), "DeleteAllRowsDialog", + "dbaccess/ui/deleteallrowsdialog.ui"); switch (aQry->Execute()) { case RET_YES: @@ -936,7 +936,7 @@ bool OTableController::checkColumns(bool _bNew) { OUString strMessage = ModuleRes(STR_TABLEDESIGN_DUPLICATE_NAME); strMessage = strMessage.replaceFirst("$column$", pFieldDesc->GetName()); - ScopedVclPtr(new OSQLWarningBox( getView(), strMessage ) )->Execute(); + ScopedVclPtrInstance(getView(), strMessage)->Execute(); return false; } } -- cgit From 8a65284fe31e6c0a927cb88b75df7845cd248572 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 31 Mar 2015 23:04:14 +0100 Subject: Automated conversion of VclPtr construction to use Instance template. Change-Id: I8be9141b9653e73ebd23a5a3d810f240c376f97e --- dbaccess/source/ui/tabledesign/TableController.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'dbaccess/source/ui/tabledesign/TableController.cxx') 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 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 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 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 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 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 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 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 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 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; -- cgit From f12488405cdfd8555078d15807aafc5ffd1b037b Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 20 Apr 2015 14:00:04 +0100 Subject: dbaccess: convert new to ::Create. Also convert svtools' WizardShell::createPage. Change-Id: I09bd40ef4748aa2de7b49eeefc95be06b545ea05 --- dbaccess/source/ui/tabledesign/TableController.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dbaccess/source/ui/tabledesign/TableController.cxx') diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 59e0e8a51395..a3f9ee98787a 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -540,7 +540,7 @@ void OTableController::impl_initialize() bool OTableController::Construct(vcl::Window* pParent) { - setView( * new OTableDesignView( pParent, getORB(), *this ) ); + setView( VclPtr::Create( pParent, getORB(), *this ) ); OTableController_BASE::Construct(pParent); return true; } -- cgit