diff options
author | Noel Grandin <noel@peralex.com> | 2015-02-11 14:42:23 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-09 22:17:00 +0100 |
commit | 00f2787a4a68633206635743298926bf2e65a8fa (patch) | |
tree | efc3a4f02b3d8acd69d25071499be5a475cb0338 /dbaccess | |
parent | vcl: some VclPtr fixes found by the new plugin code (diff) | |
download | core-00f2787a4a68633206635743298926bf2e65a8fa.tar.gz core-00f2787a4a68633206635743298926bf2e65a8fa.zip |
vclwidgets: wrap all vcl::Window subclasses allocated on stack in VclPtr
Change-Id: Ia8b0d84bbf69f9d8f85505d019acdded14e25133
Conflicts:
sw/qa/tiledrendering/tiledrendering.cxx
Diffstat (limited to 'dbaccess')
28 files changed, 212 insertions, 211 deletions
diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx index c643e8042942..dd1aa10eebb0 100644 --- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx @@ -406,8 +406,8 @@ 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() ) ) { - MessageDialog aErrorBox( const_cast< MacroMigrationDialog* >( this ), MacroMigrationResId( STR_INVALID_BACKUP_LOCATION ) ); - aErrorBox.Execute(); + VclPtr<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 39e4ecf1d85b..ec583e17860d 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -175,8 +175,8 @@ void OApplicationController::deleteTables(const ::std::vector< OUString>& _rList else { OUString sMessage(ModuleRes(STR_MISSING_TABLES_XDROP)); - MessageDialog aError(getView(), sMessage); - aError.Execute(); + VclPtr<MessageDialog> aError(new MessageDialog(getView(), sMessage)); + aError->Execute(); } } } @@ -210,19 +210,19 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec if ( eResult != svtools::QUERYDELETE_ALL ) { - svtools::QueryDeleteDlg_Impl aDlg( getView(), *aThisRound ); + VclPtr<svtools::QueryDeleteDlg_Impl> aDlg( new svtools::QueryDeleteDlg_Impl(getView(), *aThisRound) ); if ( !sDialogPosition.isEmpty() ) - aDlg.SetWindowState( sDialogPosition ); + aDlg->SetWindowState( sDialogPosition ); if ( nObjectsLeft > 1 ) - aDlg.EnableAllButton(); + aDlg->EnableAllButton(); - eResult = aDlg.Execute(); + eResult = aDlg->Execute(); if (eResult == svtools::QUERYDELETE_CANCEL) return; - sDialogPosition = aDlg.GetWindowState( ); + sDialogPosition = aDlg->GetWindowState( ); } bool bSuccess = false; @@ -686,17 +686,17 @@ bool OApplicationController::paste( ElementType _eType, const ::svx::ODataAccess has a /table/ with that name) */ if ( bNeedAskForName ) { - OSaveAsDlg aAskForName( getView(), + VclPtr<OSaveAsDlg> aAskForName(new OSaveAsDlg( getView(), CommandType::QUERY, getORB(), getConnection(), sTargetName, aNameChecker, - SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS); - if ( RET_OK != aAskForName.Execute() ) + SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS)); + if ( RET_OK != aAskForName->Execute() ) // cancelled by the user return false; - sTargetName = aAskForName.getName(); + sTargetName = aAskForName->getName(); } // create a new object diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 3eda31592a78..df90c32fd9dc 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -111,12 +111,12 @@ void OApplicationController::convertToView(const OUString& _sName) OUString aDefaultName = ::dbaui::createDefaultName(xMeta,xTables,aName); DynamicTableOrQueryNameCheck aNameChecker( xConnection, CommandType::TABLE ); - OSaveAsDlg aDlg( getView(), CommandType::TABLE, getORB(), xConnection, aDefaultName, aNameChecker ); - if ( aDlg.Execute() == RET_OK ) + VclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( getView(), CommandType::TABLE, getORB(), xConnection, aDefaultName, aNameChecker ) ); + if ( aDlg->Execute() == RET_OK ) { - OUString sName = aDlg.getName(); - OUString sCatalog = aDlg.getCatalog(); - OUString sSchema = aDlg.getSchema(); + OUString sName = aDlg->getName(); + OUString sCatalog = aDlg->getCatalog(); + OUString sSchema = aDlg->getSchema(); OUString sNewName( ::dbtools::composeTableName( xMeta, sCatalog, sSchema, sName, false, ::dbtools::eInTableDefinitions ) ); Reference<XPropertySet> xView = ::dbaui::createView(sNewName,xConnection,xSourceObject); @@ -534,8 +534,8 @@ void OApplicationController::askToReconnect() bool bClear = true; if ( !m_pSubComponentManager->empty() ) { - MessageDialog aQry(getView(), ModuleRes(STR_QUERY_CLOSEDOCUMENTS), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); - switch (aQry.Execute()) + VclPtr<MessageDialog> aQry(new MessageDialog(getView(), ModuleRes(STR_QUERY_CLOSEDOCUMENTS), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + switch (aQry->Execute()) { case RET_YES: closeSubComponents(); diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index e8cd789f223c..32a261f40d5e 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1271,8 +1271,8 @@ IMPL_LINK( SbaXDataBrowserController, OnAsyncDisplayError, void*, /* _pNotIntere { if ( m_aCurrentError.isValid() ) { - OSQLMessageBox aDlg( getBrowserView(), m_aCurrentError ); - aDlg.Execute(); + VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( getBrowserView(), m_aCurrentError )); + aDlg->Execute(); } return 0L; } @@ -1764,19 +1764,19 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(bool bFilter) Reference< XConnection> xCon(xFormSet->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),UNO_QUERY); if(bFilter) { - DlgFilterCrit aDlg( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() ); - if ( !aDlg.Execute() ) + VclPtr<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(); + aDlg->BuildWherePart(); } else { - DlgOrderCrit aDlg( getBrowserView(),xCon,xParser,xSup->getColumns() ); - if(!aDlg.Execute()) + VclPtr<DlgOrderCrit> aDlg(new DlgOrderCrit( getBrowserView(),xCon,xParser,xSup->getColumns() ) ); + if(!aDlg->Execute()) { return; // if so we don't need to actualize the grid } - aDlg.BuildOrderPart(); + aDlg->BuildOrderPart(); } } catch(const SQLException& ) @@ -2172,11 +2172,11 @@ bool SbaXDataBrowserController::SaveModified(bool bAskFor) { getBrowserView()->getVclControl()->GrabFocus(); - MessageDialog aQry(getBrowserView()->getVclControl(), + VclPtr<MessageDialog> aQry(new MessageDialog(getBrowserView()->getVclControl(), "SaveModifiedDialog", - "dbaccess/ui/savemodifieddialog.ui"); + "dbaccess/ui/savemodifieddialog.ui")); - switch (aQry.Execute()) + switch (aQry->Execute()) { case RET_NO: Execute(ID_BROWSER_UNDORECORD,Sequence<PropertyValue>()); diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 3eb8ac6819ef..77492e6ee3f7 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -792,10 +792,10 @@ void SbaGridControl::SetColWidth(sal_uInt16 nColId) Any aWidth = xAffectedCol->getPropertyValue(PROPERTY_WIDTH); sal_Int32 nCurWidth = aWidth.hasValue() ? ::comphelper::getINT32(aWidth) : -1; - DlgSize aDlgColWidth(this, nCurWidth, false); - if (aDlgColWidth.Execute()) + VclPtr<DlgSize> aDlgColWidth(new DlgSize(this, nCurWidth, false)); + if (aDlgColWidth->Execute()) { - sal_Int32 nValue = aDlgColWidth.GetValue(); + sal_Int32 nValue = aDlgColWidth->GetValue(); Any aNewWidth; if (-1 == nValue) { // set to default @@ -821,10 +821,10 @@ void SbaGridControl::SetRowHeight() Any aHeight = xCols->getPropertyValue(PROPERTY_ROW_HEIGHT); sal_Int32 nCurHeight = aHeight.hasValue() ? ::comphelper::getINT32(aHeight) : -1; - DlgSize aDlgRowHeight(this, nCurHeight, true); - if (aDlgRowHeight.Execute()) + VclPtr<DlgSize> aDlgRowHeight(new DlgSize(this, nCurHeight, true)); + if (aDlgRowHeight->Execute()) { - sal_Int32 nValue = aDlgRowHeight.GetValue(); + sal_Int32 nValue = aDlgRowHeight->GetValue(); Any aNewHeight; if ((sal_Int16)-1 == nValue) { // set to default diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index 02410b96681f..c3ba08fd0ee1 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -164,8 +164,8 @@ IMPL_LINK_NOARG(OCollectionView, Save_Click) Reference< XContent> xContent; if ( xNameContainer->hasByName(sName) ) { - QueryBox aBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) ); - if ( aBox.Execute() != RET_YES ) + VclPtr<QueryBox> aBox(new QueryBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) ) ); + if ( aBox->Execute() != RET_YES ) return 0; } m_pName->SetText(sName); diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 96e158fde04f..d0d0043b0cac 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -312,16 +312,16 @@ namespace dbaui aProfiles.insert(pArray[index]); // execute the select dialog - ODatasourceSelectDialog aSelector(GetParent(), aProfiles); + VclPtr<ODatasourceSelectDialog> aSelector(new ODatasourceSelectDialog(GetParent(), aProfiles)); OUString sOldProfile=getURLNoPrefix(); if (!sOldProfile.isEmpty()) - aSelector.Select(sOldProfile); + aSelector->Select(sOldProfile); else - aSelector.Select(xMozillaBootstrap->getDefaultProfile(profileType)); + aSelector->Select(xMozillaBootstrap->getDefaultProfile(profileType)); - if ( RET_OK == aSelector.Execute() ) - setURLNoPrefix(aSelector.GetSelected()); + if ( RET_OK == aSelector->Execute() ) + setURLNoPrefix(aSelector->GetSelected()); break; } case ::dbaccess::DST_FIREBIRD: @@ -482,8 +482,8 @@ namespace dbaui sQuery = sQuery.replaceFirst("$path$", aTransformer.get(OFileNotation::N_SYSTEM)); m_bUserGrabFocus = false; - QueryBox aQuery(GetParent(), WB_YES_NO | WB_DEF_YES, sQuery); - sal_Int32 nQueryResult = aQuery.Execute(); + VclPtr<QueryBox> aQuery(new QueryBox(GetParent(), WB_YES_NO | WB_DEF_YES, sQuery)); + sal_Int32 nQueryResult = aQuery->Execute(); m_bUserGrabFocus = true; switch (nQueryResult) @@ -499,8 +499,8 @@ namespace dbaui sQuery = sQuery.replaceFirst("$name$", aTransformer.get(OFileNotation::N_SYSTEM)); m_bUserGrabFocus = false; - QueryBox aWhatToDo(GetParent(), WB_RETRY_CANCEL | WB_DEF_RETRY, sQuery); - nQueryResult = aWhatToDo.Execute(); + VclPtr<QueryBox> aWhatToDo(new QueryBox(GetParent(), WB_RETRY_CANCEL | WB_DEF_RETRY, sQuery)); + nQueryResult = aWhatToDo->Execute(); m_bUserGrabFocus = true; if (RET_RETRY == nQueryResult) diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index f33b1e44b4fe..a8884ac397f1 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -289,8 +289,8 @@ namespace dbaui const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error; - OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ); - aMsg.Execute(); + VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) ); + aMsg->Execute(); return 0L; } bool OConnectionTabPage::checkTestConnection() diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index 394073e7472f..850a91ad4e52 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -508,8 +508,8 @@ 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; - OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ); - aMsg.Execute(); + VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) ); + aMsg->Execute(); return 0L; } @@ -617,8 +617,8 @@ using namespace ::com::sun::star; } #endif sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; - OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString() ); - aMsg.Execute(); + VclPtr<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 f776e80e4040..219440b0d496 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.cxx +++ b/dbaccess/source/ui/dlg/UserAdmin.cxx @@ -92,8 +92,8 @@ IMPL_LINK_NOARG(OPasswordDialog, OKHdl_Impl) else { OUString aErrorMsg( ModuleRes( STR_ERROR_PASSWORDS_NOT_IDENTICAL)); - MessageDialog aErrorBox(this, aErrorMsg); - aErrorBox.Execute(); + VclPtr<MessageDialog> aErrorBox(new MessageDialog(this, aErrorMsg)); + aErrorBox->Execute(); m_pEDPassword->SetText( OUString() ); m_pEDPasswordRepeat->SetText( OUString() ); m_pEDPassword->GrabFocus(); @@ -199,16 +199,16 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) { if(pButton == m_pNEWUSER) { - SfxPasswordDialog aPwdDlg(this); - aPwdDlg.ShowExtras(SHOWEXTRAS_ALL); - if(aPwdDlg.Execute()) + VclPtr<SfxPasswordDialog> aPwdDlg(new SfxPasswordDialog(this)); + aPwdDlg->ShowExtras(SHOWEXTRAS_ALL); + if(aPwdDlg->Execute()) { Reference<XDataDescriptorFactory> xUserFactory(m_xUsers,UNO_QUERY); Reference<XPropertySet> xNewUser = xUserFactory->createDataDescriptor(); if(xNewUser.is()) { - xNewUser->setPropertyValue(PROPERTY_NAME,makeAny(OUString(aPwdDlg.GetUser()))); - xNewUser->setPropertyValue(PROPERTY_PASSWORD,makeAny(OUString(aPwdDlg.GetPassword()))); + xNewUser->setPropertyValue(PROPERTY_NAME,makeAny(OUString(aPwdDlg->GetUser()))); + xNewUser->setPropertyValue(PROPERTY_PASSWORD,makeAny(OUString(aPwdDlg->GetPassword()))); Reference<XAppend> xAppend(m_xUsers,UNO_QUERY); if(xAppend.is()) xAppend->appendByDescriptor(xNewUser); @@ -226,11 +226,11 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) if(xUser.is()) { OUString sNewPassword,sOldPassword; - OPasswordDialog aDlg(this,sName); - if(aDlg.Execute() == RET_OK) + VclPtr<OPasswordDialog> aDlg(new OPasswordDialog(this,sName)); + if(aDlg->Execute() == RET_OK) { - sNewPassword = aDlg.GetNewPassword(); - sOldPassword = aDlg.GetOldPassword(); + sNewPassword = aDlg->GetNewPassword(); + sOldPassword = aDlg->GetOldPassword(); if(!sNewPassword.isEmpty()) xUser->changePassword(sOldPassword,sNewPassword); @@ -245,8 +245,8 @@ IMPL_LINK( OUserAdmin, UserHdl, PushButton *, pButton ) Reference<XDrop> xDrop(m_xUsers,UNO_QUERY); if(xDrop.is()) { - MessageDialog aQry(this, ModuleRes(STR_QUERY_USERADMIN_DELETE_USER), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); - if(aQry.Execute() == RET_YES) + VclPtr<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 0d1510998831..61744a511719 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -117,19 +117,19 @@ namespace dbaui // show an error message OUString sError( ModuleRes( STR_COULD_NOT_LOAD_ODBC_LIB ) ); sError = sError.replaceFirst("#lib#", aEnumeration.getLibraryName()); - MessageDialog aDialog(this, sError); - aDialog.Execute(); + VclPtr<MessageDialog> aDialog(new MessageDialog(this, sError)); + aDialog->Execute(); return false; } else { aEnumeration.getDatasourceNames(aOdbcDatasources); // execute the select dialog - ODatasourceSelectDialog aSelector(GetParent(), aOdbcDatasources); + VclPtr<ODatasourceSelectDialog> aSelector(new ODatasourceSelectDialog(GetParent(), aOdbcDatasources)); if (!_sCurr.isEmpty()) - aSelector.Select(_sCurr); - if ( RET_OK == aSelector.Execute() ) - _sReturn = aSelector.GetSelected(); + aSelector->Select(_sCurr); + if ( RET_OK == aSelector->Execute() ) + _sReturn = aSelector->GetSelected(); } return true; } @@ -242,8 +242,8 @@ namespace dbaui eImage = OSQLMessageBox::Error; aMessage = ModuleRes(STR_CONNECTION_NO_SUCCESS); } - OSQLMessageBox aMsg( this, sTitle, aMessage, WB_OK, eImage ); - aMsg.Execute(); + VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, sTitle, aMessage, WB_OK, eImage ) ); + aMsg->Execute(); } if ( !bSuccess ) m_pAdminDialog->clearPassword(); diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index 21ecc09d73fe..a4e5d5c7b221 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -241,8 +241,8 @@ namespace dbaui { if (m_pIndexes == pButton) { - ODbaseIndexDialog aIndexDialog(this, m_sDsn); - aIndexDialog.Execute(); + VclPtr<ODbaseIndexDialog> aIndexDialog(new ODbaseIndexDialog(this, m_sDsn)); + aIndexDialog->Execute(); } else { @@ -490,8 +490,8 @@ namespace dbaui #endif const sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; const OSQLMessageBox::MessageType mt = bSuccess ? OSQLMessageBox::Info : OSQLMessageBox::Error; - OSQLMessageBox aMsg( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ); - aMsg.Execute(); + VclPtr<OSQLMessageBox> aMsg(new OSQLMessageBox( this, OUString( ModuleRes( nMessage ) ), OUString(), WB_OK | WB_DEF_OK, mt ) ); + aMsg->Execute(); return 0L; } IMPL_LINK(OGeneralSpecialJDBCDetailsPage, OnEditModified, Edit*, _pEdit) diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index 139cd2441fd0..a4995a2af317 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -99,8 +99,8 @@ namespace dbaui { OUString sMessage(ModuleRes(STR_DIRECTSQL_CONNECTIONLOST)); - MessageDialog aError(this, sMessage); - aError.Execute(); + VclPtr<MessageDialog> aError(new MessageDialog(this, sMessage)); + aError->Execute(); } PostUserEvent(LINK(this, DirectSQLDialog, OnClose)); diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 1e8bd033e50d..a11b42f956dd 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -708,8 +708,8 @@ namespace dbaui if ( aFileDlg.GetCurrentFilter() != pFilter->GetUIName() || !pFilter->GetWildcard().Matches(sPath) ) { OUString sMessage(ModuleRes(STR_ERR_USE_CONNECT_TO)); - InfoBox aError(this, sMessage); - aError.Execute(); + VclPtr<InfoBox> aError(new InfoBox(this, sMessage)); + aError->Execute(); m_pRB_ConnectDatabase->Check(); OnSetupModeSelected( m_pRB_ConnectDatabase ); return 0L; diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index bdf95194ec94..7377ac692a2e 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -413,8 +413,8 @@ namespace dbaui { OUString sConfirm(ModuleRes(STR_CONFIRM_DROP_INDEX)); sConfirm = sConfirm.replaceFirst("$name$", m_pIndexList->GetEntryText(pSelected)); - MessageDialog aConfirm(this, sConfirm, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); - if (RET_YES != aConfirm.Execute()) + VclPtr<MessageDialog> aConfirm(new MessageDialog(this, sConfirm, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + if (RET_YES != aConfirm->Execute()) return; } @@ -577,9 +577,9 @@ namespace dbaui if (aSelected->isModified() || aSelected->isNew()) { - MessageDialog aQuestion(this, "SaveIndexDialog", - "dbaccess/ui/saveindexdialog.ui"); - nResponse = aQuestion.Execute(); + VclPtr<MessageDialog> aQuestion(new MessageDialog(this, "SaveIndexDialog", + "dbaccess/ui/saveindexdialog.ui")); + nResponse = aQuestion->Execute(); } } @@ -621,8 +621,8 @@ namespace dbaui { OUString sError(ModuleRes(STR_INDEX_NAME_ALREADY_USED)); sError = sError.replaceFirst("$name$", sNewName); - MessageDialog aError(this, sError); - aError.Execute(); + VclPtr<MessageDialog> aError(new MessageDialog(this, sError)); + aError->Execute(); updateToolbox(); m_bEditAgain = true; @@ -682,8 +682,8 @@ namespace dbaui // need at least one field if (0 == _rPos->aFields.size()) { - MessageDialog aError(this, ModuleRes(STR_NEED_INDEX_FIELDS)); - aError.Execute(); + VclPtr<MessageDialog> aError(new MessageDialog(this, ModuleRes(STR_NEED_INDEX_FIELDS))); + aError->Execute(); m_pFields->GrabFocus(); return false; } @@ -700,8 +700,8 @@ 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); - MessageDialog aError(this, sMessage); - aError.Execute(); + VclPtr<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 771c20477d42..5bbd80b23bca 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -705,8 +705,8 @@ void OSQLMessageBox::dispose() IMPL_LINK( OSQLMessageBox, ButtonClickHdl, Button *, /*pButton*/ ) { - OExceptionChainDialog aDlg( this, m_pImpl->aDisplayInfo ); - aDlg.Execute(); + VclPtr<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 e6284d230b64..9b27593e09b4 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -324,8 +324,8 @@ namespace dbaui if (aErrorInfo.isValid()) { // establishing the connection failed. Show an error window and exit. - OSQLMessageBox aMessageBox( GetParentDialog(), aErrorInfo ); - aMessageBox.Execute(); + VclPtr<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 0f16a402c1f1..088beb689cc1 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 ); - OCopyTableWizard aWizard( + VclPtr<OCopyTableWizard> aWizard(new OCopyTableWizard( NULL, sTableName, bHaveDefaultTable ? CopyTableOperation::AppendData : CopyTableOperation::CopyDefinitionAndData, @@ -698,19 +698,19 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe getTypeSelectionPageFactory(), m_rInputStream, m_xContext - ); + )); bool bError = false; try { - if (aWizard.Execute()) + if (aWizard->Execute()) { - switch(aWizard.getOperation()) + switch(aWizard->getOperation()) { case CopyTableOperation::CopyDefinitionAndData: case CopyTableOperation::AppendData: { - m_xTable = aWizard.createTable(); + m_xTable = aWizard->createTable(); bError = !m_xTable.is(); if(m_xTable.is()) { @@ -718,10 +718,10 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe if(_aTextColor.hasValue()) m_xTable->setPropertyValue(PROPERTY_TEXTCOLOR,_aTextColor); } - m_bIsAutoIncrement = aWizard.shouldCreatePrimaryKey(); - m_vColumns = aWizard.GetColumnPositions(); - m_vColumnTypes = aWizard.GetColumnTypes(); - m_bAppendFirstLine = !aWizard.UseHeaderLine(); + m_bIsAutoIncrement = aWizard->shouldCreatePrimaryKey(); + m_vColumns = aWizard->GetColumnPositions(); + m_vColumnTypes = aWizard->GetColumnTypes(); + m_bAppendFirstLine = !aWizard->UseHeaderLine(); } break; default: @@ -736,7 +736,7 @@ bool ODatabaseExport::executeWizard(const OUString& _rTableName, const Any& _aTe } catch( const SQLException&) { - ::dbaui::showError( ::dbtools::SQLExceptionInfo( ::cppu::getCaughtException() ), &aWizard, m_xContext ); + ::dbaui::showError( ::dbtools::SQLExceptionInfo( ::cppu::getCaughtException() ), aWizard.get(), m_xContext ); bError = true; } catch( const Exception& ) @@ -754,9 +754,9 @@ void ODatabaseExport::showErrorDialog(const ::com::sun::star::sdbc::SQLException OUString aMsg(e.Message); aMsg += "\n"; aMsg += ModuleRes( STR_QRY_CONTINUE ); - OSQLWarningBox aBox( NULL, aMsg, WB_YES_NO | WB_DEF_NO ); + VclPtr<OSQLWarningBox> aBox(new OSQLWarningBox( NULL, aMsg, WB_YES_NO | WB_DEF_NO ) ); - if (aBox.Execute() == RET_YES) + if (aBox->Execute() == RET_YES) m_bDontAskAgain = true; else m_bError = true; diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index 5a061ea0c448..8a74d80ea268 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -241,8 +241,8 @@ bool ORowSetImportExport::insertNewRow() if(!m_bAlreadyAsked) { OUString sAskIfContinue = ModuleRes(STR_ERROR_OCCURRED_WHILE_COPYING); - OSQLWarningBox aDlg( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES ); - if(aDlg.Execute() == RET_YES) + VclPtr<OSQLWarningBox> aDlg(new OSQLWarningBox( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES ) ); + if(aDlg->Execute() == RET_YES) m_bAlreadyAsked = true; else return false; diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 5c661d5d8191..ef31134a06dd 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -852,12 +852,12 @@ bool callColumnFormatDialog(vcl::Window* _pParent, } { // want the dialog to be destroyed before our set - SbaSbAttrDlg aDlg(_pParent, pFormatDescriptor, _pFormatter, _bHasFormat); - if (RET_OK == aDlg.Execute()) + VclPtr<SbaSbAttrDlg> aDlg(new SbaSbAttrDlg(_pParent, pFormatDescriptor, _pFormatter, _bHasFormat)); + if (RET_OK == aDlg->Execute()) { // ItemSet->UNO // UNO-properties - const SfxItemSet* pSet = aDlg.GetExampleSet(); + const SfxItemSet* pSet = aDlg->GetExampleSet(); // (of course we could put the modified items directly into the column, but then the UNO-model // won't reflect these changes, and why do we have a model, then ?) @@ -875,7 +875,7 @@ bool callColumnFormatDialog(vcl::Window* _pParent, bRet = true; } // deleted formats - const SfxItemSet* pResult = aDlg.GetOutputItemSet(); + const SfxItemSet* pResult = aDlg->GetOutputItemSet(); if (pResult) { const SfxPoolItem* pItem = pResult->GetItem( SID_ATTR_NUMBERFORMAT_INFO ); @@ -997,10 +997,10 @@ void adjustBrowseBoxColumnWidth( ::svt::EditBrowseBox* _pBox, sal_uInt16 _nColId Size aDefaultMM = _pBox->PixelToLogic( Size( nDefaultWidth, 0 ), MapMode( MAP_MM ) ); - DlgSize aColumnSizeDlg( _pBox, nColSize, false, aDefaultMM.Width() * 10 ); - if ( aColumnSizeDlg.Execute() ) + VclPtr<DlgSize> aColumnSizeDlg(new DlgSize( _pBox, nColSize, false, aDefaultMM.Width() * 10 ) ); + if ( aColumnSizeDlg->Execute() ) { - sal_Int32 nValue = aColumnSizeDlg.GetValue(); + sal_Int32 nValue = aColumnSizeDlg->GetValue(); if ( -1 == nValue ) { // default width nValue = _pBox->GetDefaultColumnWidth( _pBox->GetColumnTitle( _nColId ) ); @@ -1286,13 +1286,13 @@ sal_Int32 askForUserAction(vcl::Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _ SolarMutexGuard aGuard; OUString aMsg = ModuleRes(_nText); aMsg = aMsg.replaceFirst("%1", _sName); - OSQLMessageBox aAsk(_pParent, ModuleRes(_nTitle ), aMsg,WB_YES_NO | WB_DEF_YES,OSQLMessageBox::Query); + VclPtr<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); - aAsk.GetPushButton(RET_ALL)->SetHelpId(HID_CONFIRM_DROP_BUTTON_ALL); + aAsk->AddButton(ModuleRes(STR_BUTTON_TEXT_ALL), RET_ALL, 0); + aAsk->GetPushButton(RET_ALL)->SetHelpId(HID_CONFIRM_DROP_BUTTON_ALL); } - return aAsk.Execute(); + return aAsk->Execute(); } namespace @@ -1431,17 +1431,17 @@ 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 - OSaveAsDlg aAskForName( _pParent, + VclPtr<OSaveAsDlg> aAskForName(new OSaveAsDlg( _pParent, _rxContext, sTargetName, sLabel, aNameChecker, - SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS); - if ( RET_OK != aAskForName.Execute() ) + SAD_ADDITIONAL_DESCRIPTION | SAD_TITLE_PASTE_AS)); + if ( RET_OK != aAskForName->Execute() ) // cancelled by the user return false; - sNewName = aAskForName.getName(); + sNewName = aAskForName->getName(); } } else if ( xNameAccess->hasByName(sNewName) ) diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx index d9e44161f2e8..ce98528c4fc5 100644 --- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -308,8 +308,8 @@ namespace dbaui bool bReConnect = true; if ( _bUI ) { - MessageDialog aQuery(getView(), ModuleRes(STR_QUERY_CONNECTION_LOST), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); - bReConnect = ( RET_YES == aQuery.Execute() ); + VclPtr<MessageDialog> aQuery(new MessageDialog(getView(), ModuleRes(STR_QUERY_CONNECTION_LOST), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)); + bReConnect = ( RET_YES == aQuery->Execute() ); } // now really reconnect ... diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 2c6ddebf9037..e3c3ea24c014 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -158,10 +158,10 @@ namespace } } - OQueryTableConnection aInfo(pTableView, aInfoData); + VclPtr<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 ); + pTableView->NotifyTabConnection( *aInfo.get() ); } else { diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index b4b313be212c..573eba4608a4 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -118,11 +118,11 @@ namespace { OQueryTableConnectionData* pData = static_cast< OQueryTableConnectionData*>(_pConnectionData.get()); - DlgQryJoin aDlg(_pView,_pConnectionData,&_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables); - bool bOk = aDlg.Execute() == RET_OK; + VclPtr<DlgQryJoin> aDlg(new DlgQryJoin(_pView,_pConnectionData,&_pView->GetTabWinMap(),_pView->getDesignView()->getController().getConnection(),_bSelectableTables)); + bool bOk = aDlg->Execute() == RET_OK; if( bOk ) { - pData->SetJoinType(aDlg.GetJoinType()); + pData->SetJoinType(aDlg->GetJoinType()); _pView->getDesignView()->getController().setModified(sal_True); } @@ -208,10 +208,10 @@ namespace pNewConnData->AppendConnLine(*pIter,sRelatedColumn); // now add the Conn itself - OQueryTableConnection aNewConn(_pView, aNewConnData); + VclPtr<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, false); + _pView->NotifyTabConnection(*aNewConn.get(), false); // don't create an Undo-Action for the new connection : the connection is // covered by the Undo-Action for the tabwin, as the "Undo the insert" will // automatically remove all connections adjacent to the win. @@ -621,8 +621,8 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ pNewConnectionData->AppendConnLine( aSourceFieldName,aDestFieldName ); - OQueryTableConnection aNewConnection(this, aNewConnectionData); - NotifyTabConnection(aNewConnection); + VclPtr<OQueryTableConnection> aNewConnection(new OQueryTableConnection(this, aNewConnectionData)); + NotifyTabConnection(*aNewConnection.get()); // As usual with NotifyTabConnection, using a local variable is fine because a copy is made } else diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 74aeeda682ea..67b478944a6a 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -987,8 +987,8 @@ void OQueryController::impl_initialize() OUString aTitle( ModuleRes( STR_QUERYDESIGN_NO_VIEW_SUPPORT ) ); OUString aMessage( ModuleRes( STR_QUERYDESIGN_NO_VIEW_ASK ) ); ODataView* pWindow = getView(); - OSQLMessageBox aDlg( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query ); - bClose = aDlg.Execute() == RET_NO; + VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox( pWindow, aTitle, aMessage, WB_YES_NO | WB_DEF_YES, OSQLMessageBox::Query )); + bClose = aDlg->Execute() == RET_NO; } if ( bClose ) throw VetoException(); @@ -1238,13 +1238,13 @@ void OQueryController::loadViewSettings( const ::comphelper::NamedValueCollectio void OQueryController::execute_QueryPropDlg() { - QueryPropertiesDialog aQueryPropDlg( - getContainer(), m_bDistinct, m_nLimit ); + VclPtr<QueryPropertiesDialog> aQueryPropDlg(new QueryPropertiesDialog( + getContainer(), m_bDistinct, m_nLimit )); - if( aQueryPropDlg.Execute() == RET_OK ) + if( aQueryPropDlg->Execute() == RET_OK ) { - m_bDistinct = aQueryPropDlg.getDistinct(); - m_nLimit = aQueryPropDlg.getLimit(); + m_bDistinct = aQueryPropDlg->getDistinct(); + m_nLimit = aQueryPropDlg->getLimit(); InvalidateFeature( SID_QUERY_DISTINCT_VALUES ); InvalidateFeature( SID_QUERY_LIMIT, 0, true ); } @@ -1398,23 +1398,23 @@ bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElements, b } DynamicTableOrQueryNameCheck aNameChecker( getConnection(), CommandType::QUERY ); - OSaveAsDlg aDlg( + VclPtr<OSaveAsDlg> aDlg(new OSaveAsDlg( getView(), m_nCommandType, getORB(), getConnection(), aDefaultName, aNameChecker, - SAD_DEFAULT ); + SAD_DEFAULT )); - bRet = ( aDlg.Execute() == RET_OK ); + bRet = ( aDlg->Execute() == RET_OK ); if ( bRet ) { - m_sName = aDlg.getName(); + m_sName = aDlg->getName(); if ( editingView() ) { - m_sUpdateCatalogName = aDlg.getCatalog(); - m_sUpdateSchemaName = aDlg.getSchema(); + m_sUpdateCatalogName = aDlg->getCatalog(); + m_sUpdateSchemaName = aDlg->getSchema(); } } } @@ -1802,9 +1802,9 @@ short OQueryController::saveModified() ) { OUString sMessageText( lcl_getObjectResourceString( STR_QUERY_SAVEMODIFIED, m_nCommandType ) ); - QueryBox aQry( getView(), WB_YES_NO_CANCEL | WB_DEF_YES, sMessageText ); + VclPtr<QueryBox> aQry(new QueryBox( getView(), WB_YES_NO_CANCEL | WB_DEF_YES, sMessageText ) ); - nRet = aQry.Execute(); + nRet = aQry->Execute(); if ( ( nRet == RET_YES ) && !doSaveAsDoc( false ) ) @@ -1914,8 +1914,8 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings if ( !i_bForceCurrentControllerSettings && !editingView() ) { OUString aTitle(ModuleRes(STR_SVT_SQL_SYNTAX_ERROR)); - OSQLMessageBox aDlg(getView(),aTitle,aErrorMsg); - aDlg.Execute(); + VclPtr<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 184a20e27f0e..6982b38a7888 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -205,8 +205,8 @@ void ORelationController::impl_initialize() { OUString sTitle(ModuleRes(STR_RELATIONDESIGN)); sTitle = sTitle.copy(3); - OSQLMessageBox aDlg(NULL,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE)); - aDlg.Execute(); + VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox(NULL,sTitle,ModuleRes(STR_RELATIONDESIGN_NOT_AVAILABLE))); + aDlg->Execute(); } disconnect(); throw SQLException(); @@ -255,9 +255,9 @@ short ORelationController::saveModified() short nSaved = RET_YES; if(haveDataSource() && isModified()) { - MessageDialog aQry(getView(), "DesignSaveModifiedDialog", - "dbaccess/ui/designsavemodifieddialog.ui"); - nSaved = aQry.Execute(); + VclPtr<MessageDialog> aQry(new MessageDialog(getView(), "DesignSaveModifiedDialog", + "dbaccess/ui/designsavemodifieddialog.ui")); + nSaved = aQry->Execute(); if(nSaved == RET_YES) Execute(ID_BROWSER_SAVEDOC,Sequence<PropertyValue>()); } diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index bf39293e01a2..8f1ed9ff6dcc 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -222,8 +222,8 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const void ORelationTableView::ConnDoubleClicked( OTableConnection* pConnection ) { - ORelationDialog aRelDlg( this, pConnection->GetData() ); - switch (aRelDlg.Execute()) + VclPtr<ORelationDialog> aRelDlg(new ORelationDialog( this, pConnection->GetData() )); + switch (aRelDlg->Execute()) { case RET_OK: // successfully updated @@ -250,9 +250,9 @@ void ORelationTableView::AddNewRelation() { TTableConnectionData::value_type pNewConnData( new ORelationTableConnectionData() ); - ORelationDialog aRelDlg(this, pNewConnData, true); + VclPtr<ORelationDialog> aRelDlg(new ORelationDialog(this, pNewConnData, true)); - bool bSuccess = (aRelDlg.Execute() == RET_OK); + bool bSuccess = (aRelDlg->Execute() == RET_OK); if (bSuccess) { // already updated by the dialog @@ -325,8 +325,8 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin ) { - OSQLWarningBox aDlg( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES ); - if ( m_bInRemove || aDlg.Execute() == RET_YES ) + VclPtr<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(); OJoinTableView::RemoveTabWin( pTabWin ); @@ -343,13 +343,14 @@ void ORelationTableView::lookForUiActivities() { OUString sTitle(ModuleRes(STR_RELATIONDESIGN)); sTitle = sTitle.copy(3); - 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); - aDlg.AddButton( ModuleRes(STR_QUERY_REL_CREATE), RET_YES, 0); - aDlg.AddButton( StandardButtonType::Cancel,RET_CANCEL,0); - sal_uInt16 nRet = aDlg.Execute(); + + VclPtr<OSQLMessageBox> aDlg(new OSQLMessageBox(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); + aDlg->AddButton( ModuleRes(STR_QUERY_REL_CREATE), RET_YES, 0); + aDlg->AddButton( StandardButtonType::Cancel,RET_CANCEL,0); + sal_uInt16 nRet = aDlg->Execute(); if( nRet == RET_CANCEL) { m_pCurrentlyTabConnData.reset(); @@ -363,8 +364,8 @@ void ORelationTableView::lookForUiActivities() } if(m_pCurrentlyTabConnData) { - ORelationDialog aRelDlg( this, m_pCurrentlyTabConnData ); - if (aRelDlg.Execute() == RET_OK) + VclPtr<ORelationDialog> aRelDlg(new ORelationDialog( this, m_pCurrentlyTabConnData ) ); + if (aRelDlg->Execute() == RET_OK) { // already updated by the dialog addConnection( new ORelationTableConnection( this, m_pCurrentlyTabConnData ) ); 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<OSQLWarningBox>(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<OSaveAsDlg> 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<OSQLMessageBox> 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<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; 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<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&) { - OSQLWarningBox( getView(), ModuleRes( STR_NO_TYPE_INFO_AVAILABLE ) ).Execute(); + VclPtr<OSQLWarningBox>(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<MessageDialog> aQry(new MessageDialog(getView(), "TableDesignSaveModifiedDialog", + "dbaccess/ui/tabledesignsavemodifieddialog.ui")); + switch (aQry->Execute()) { case RET_YES: Execute(ID_BROWSER_SAVEDOC,Sequence<PropertyValue>()); @@ -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<MessageDialog> 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<OSQLWarningBox>(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<OSQLMessageBox> 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<OSQLWarningBox> 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<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); 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<OSQLMessageBox> aMsg(new OSQLMessageBox(getView(),aTitle,aMsgT,WB_YES_NO| WB_DEF_YES)); + if(aMsg->Execute() == RET_YES) { xKeyColumns = NULL; dropPrimaryKey(); diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx index 7087c3b04d13..d0f5a99a1041 100644 --- a/dbaccess/source/ui/uno/dbinteraction.cxx +++ b/dbaccess/source/ui/uno/dbinteraction.cxx @@ -127,8 +127,8 @@ 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"); - OParameterDialog aDlg(NULL, _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext); - sal_Int16 nResult = aDlg.Execute(); + VclPtr<OParameterDialog> aDlg(new OParameterDialog(NULL, _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext)); + sal_Int16 nResult = aDlg->Execute(); try { switch (nResult) @@ -136,7 +136,7 @@ namespace dbaui case RET_OK: if (xParamCallback.is()) { - xParamCallback->setParameters(aDlg.getValues()); + xParamCallback->setParameters(aDlg->getValues()); xParamCallback->select(); } break; @@ -182,9 +182,9 @@ namespace dbaui } // execute the dialog - OSQLMessageBox aDialog(NULL, _rSqlInfo, nDialogStyle); + VclPtr<OSQLMessageBox> aDialog(new OSQLMessageBox(NULL, _rSqlInfo, nDialogStyle)); // TODO: need a way to specify the parent window - sal_Int16 nResult = aDialog.Execute(); + sal_Int16 nResult = aDialog->Execute(); try { switch (nResult) @@ -256,8 +256,8 @@ 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"); - OCollectionView aDlg(NULL, _rDocuRequest.Content, _rDocuRequest.Name, m_xContext); - sal_Int16 nResult = aDlg.Execute(); + VclPtr<OCollectionView> aDlg(new OCollectionView(NULL, _rDocuRequest.Content, _rDocuRequest.Name, m_xContext)); + sal_Int16 nResult = aDlg->Execute(); try { switch (nResult) @@ -265,7 +265,7 @@ namespace dbaui case RET_OK: if (xCallback.is()) { - xCallback->setName(aDlg.getName(),aDlg.getSelectedFolder()); + xCallback->setName(aDlg->getName(), aDlg->getSelectedFolder()); xCallback->select(); } break; |