From a860df25dd7bf62ecb6b3d3ed38803b981f56d52 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 26 Jul 2016 10:21:41 +0100 Subject: masses of MessBoxes not being disposed promptly since... commit ba81e5c6bd420b41a84ade6ccd774011a8089f7f Date: Thu May 28 21:35:43 2015 +0100 tdf#91702 - fix stack-based MessBox allocation. There is no special ScopedVclPtr::Create or ScopedVclPtrInstance::Create just VclPtr::Create and a raw VclPtr::Create()->foo doesn't call dispose on the owned X Change-Id: Ifacc8d5e742820701307c3c37b9b86487667d84f --- dbaccess/source/ui/browser/brwctrlr.cxx | 2 +- dbaccess/source/ui/dlg/ConnectionHelper.cxx | 2 +- dbaccess/source/ui/dlg/TextConnectionHelper.cxx | 2 +- dbaccess/source/ui/dlg/paramdialog.cxx | 2 +- dbaccess/source/ui/misc/UITools.cxx | 2 +- dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx | 2 +- dbaccess/source/ui/querydesign/QueryDesignView.cxx | 4 ++-- dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 12 ++++++------ dbaccess/source/ui/querydesign/querycontroller.cxx | 4 ++-- dbaccess/source/ui/relationdesign/RelationController.cxx | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 38077829752c..af2612671873 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -1380,7 +1380,7 @@ void SbaXDataBrowserController::resetted(const css::lang::EventObject& rEvent) t sal_Bool SbaXDataBrowserController::confirmDelete(const css::sdb::RowChangeEvent& /*aEvent*/) throw( RuntimeException, std::exception ) { - if (ScopedVclPtrInstance::Create(getBrowserView(), ModuleRes(STR_QUERY_BRW_DELETE_ROWS), VclMessageType::Question, VCL_BUTTONS_YES_NO)->Execute() != RET_YES) + if (ScopedVclPtrInstance(getBrowserView(), ModuleRes(STR_QUERY_BRW_DELETE_ROWS), VclMessageType::Question, VCL_BUTTONS_YES_NO)->Execute() != RET_YES) return false; return true; diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 49be4caf4bd5..7efded163552 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -674,7 +674,7 @@ namespace dbaui { OUString sFile = ModuleRes( STR_FILE_DOES_NOT_EXIST ); sFile = sFile.replaceFirst("$file$", aTransformer.get(OFileNotation::N_SYSTEM)); - ScopedVclPtr::Create( this, sFile )->Execute(); + ScopedVclPtrInstance(this, sFile)->Execute(); setURLNoPrefix(sOldPath); SetRoadmapStateValue(false); callModifiedHdl(); diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index ac71da227f04..00c5be330508 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -309,7 +309,7 @@ namespace dbaui } else return true; - ScopedVclPtrInstance::Create(nullptr, MnemonicGenerator::EraseAllMnemonicChars(aErrorText))->Execute(); + ScopedVclPtrInstance(nullptr, MnemonicGenerator::EraseAllMnemonicChars(aErrorText))->Execute(); pErrorWin->GrabFocus(); return false; } diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index c1c0e77453c8..ee659136ebbb 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -203,7 +203,7 @@ namespace dbaui OUString sMessage(ModuleRes(STR_COULD_NOT_CONVERT_PARAM)); sMessage = sMessage.replaceAll( "$name$", sName ); - ScopedVclPtrInstance::Create(nullptr, sMessage)->Execute(); + ScopedVclPtrInstance(nullptr, sMessage)->Execute(); m_pParam->GrabFocus(); return true; } diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 086d1282b77b..8027c7aed2b1 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -940,7 +940,7 @@ bool appendToFilter(const Reference& _xConnection, if(! ::dbaui::checkDataSourceAvailable(::comphelper::getString(xProp->getPropertyValue(PROPERTY_NAME)),_rxContext)) { OUString aMessage(ModuleRes(STR_TABLEDESIGN_DATASOURCE_DELETED)); - ScopedVclPtr::Create( _pParent, aMessage )->Execute(); + ScopedVclPtrInstance(_pParent, aMessage)->Execute(); bRet = false; } else diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx index 5e030f2ac8fe..7d520a44d2a7 100644 --- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -456,7 +456,7 @@ namespace dbaui if ( !pWin ) pWin = getView()->Window::GetParent(); - ScopedVclPtrInstance::Create(pWin, aMessage, VclMessageType::Info)->Execute(); + ScopedVclPtrInstance(pWin, aMessage, VclMessageType::Info)->Execute(); } const Reference< XConnection >& DBSubComponentController::getConnection() const { diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index b7d4fac51ec0..8f8748c5312e 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -755,7 +755,7 @@ namespace { // only show the messagebox the first time if (!bCritsOnAsterikWarning) - ScopedVclPtrInstance::Create(_pView, ModuleRes( STR_QRY_CRITERIA_ON_ASTERISK))->Execute(); + ScopedVclPtrInstance(_pView, ModuleRes( STR_QRY_CRITERIA_ON_ASTERISK))->Execute(); bCritsOnAsterikWarning = true; continue; } @@ -912,7 +912,7 @@ namespace { // only show the MessageBox the first time if (!bCritsOnAsterikWarning) - ScopedVclPtrInstance::Create(_pView, ModuleRes( STR_QRY_ORDERBY_ON_ASTERISK))->Execute(); + ScopedVclPtrInstance(_pView, ModuleRes( STR_QRY_ORDERBY_ON_ASTERISK))->Execute(); bCritsOnAsterikWarning = true; continue; } diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index e9d14ebfd121..8a823a0b61c3 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -523,7 +523,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon m_pVisibleCell->GetBox().EnableInput(false); OUString aMessage(ModuleRes(STR_QRY_ORDERBY_UNRELATED)); OQueryDesignView* paDView = getDesignView(); - ScopedVclPtr::Create(paDView, aMessage)->Execute(); + ScopedVclPtrInstance(paDView, aMessage)->Execute(); } } break; case BROW_ORDER_ROW: @@ -613,7 +613,7 @@ bool OSelectionBrowseBox::fillColumnRef(const OUString& _sColumnName, const OUSt { OUString sErrorMsg(ModuleRes(RID_STR_FIELD_DOESNT_EXIST)); sErrorMsg = sErrorMsg.replaceFirst("$name$",_sColumnName); - ScopedVclPtr::Create( this, sErrorMsg )->Execute(); + ScopedVclPtrInstance(this, sErrorMsg)->Execute(); bError = true; } else @@ -718,7 +718,7 @@ bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef& _ // something different which we have to check OUString sErrorMessage( ModuleRes( STR_QRY_COLUMN_NOT_FOUND ) ); sErrorMessage = sErrorMessage.replaceFirst("$name$",_sFieldName); - ScopedVclPtr::Create( this, sErrorMessage )->Execute(); + ScopedVclPtrInstance(this, sErrorMessage)->Execute(); return true; } @@ -874,7 +874,7 @@ bool OSelectionBrowseBox::saveField(OUString& _sFieldName ,OTableFieldDescRef& _ { // the field could not be inserted OUString sErrorMessage( ModuleRes( RID_STR_FIELD_DOESNT_EXIST ) ); sErrorMessage = sErrorMessage.replaceFirst("$name$",aSelEntry->GetField()); - ScopedVclPtr::Create( this, sErrorMessage )->Execute(); + ScopedVclPtrInstance(this, sErrorMessage)->Execute(); bError = true; } } @@ -1141,7 +1141,7 @@ bool OSelectionBrowseBox::SaveModified() { if ( !m_bDisableErrorBox ) { - ScopedVclPtr::Create( this, aErrorMsg )->Execute(); + ScopedVclPtrInstance(this, aErrorMsg)->Execute(); } bError = true; } @@ -1150,7 +1150,7 @@ bool OSelectionBrowseBox::SaveModified() { if ( !m_bDisableErrorBox ) { - ScopedVclPtr::Create( this, aErrorMsg )->Execute(); + ScopedVclPtrInstance(this, aErrorMsg)->Execute(); } bError = true; } diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 66a203b18314..f56bcab8c05e 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -1046,7 +1046,7 @@ void OQueryController::impl_initialize() m_bGraphicalDesign = false; getContainer()->initialize(); ODataView* pWindow = getView(); - ScopedVclPtr::Create(pWindow,e)->Execute(); + ScopedVclPtrInstance(pWindow,e)->Execute(); } throw; } @@ -1398,7 +1398,7 @@ bool OQueryController::doSaveAsDoc(bool _bSaveAs) if ( !editingCommand() && !haveDataSource() ) { OUString aMessage(ModuleRes(STR_DATASOURCE_DELETED)); - ScopedVclPtr::Create( getView(), aMessage )->Execute(); + ScopedVclPtrInstance(getView(), aMessage)->Execute(); return false; } diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index 49dc65001157..8f51f9a4babd 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -160,7 +160,7 @@ void ORelationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue if(!::dbaui::checkDataSourceAvailable(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_NAME)), getORB())) { OUString aMessage(ModuleRes(STR_DATASOURCE_DELETED)); - ScopedVclPtr::Create( getView(), aMessage )->Execute(); + ScopedVclPtrInstance(getView(), aMessage)->Execute(); } else { -- cgit