diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-07-26 10:21:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-07-26 11:26:52 +0100 |
commit | a860df25dd7bf62ecb6b3d3ed38803b981f56d52 (patch) | |
tree | 591e39d4fc9b3da4d3b84882e69baf88baa05507 /dbaccess | |
parent | 87e2b0142a1724b9075f31acfc44011082ce8e12 (diff) |
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<X>::Create or
ScopedVclPtrInstance<X>::Create just
VclPtr<X>::Create and a raw VclPtr<X>::Create()->foo
doesn't call dispose on the owned X
Change-Id: Ifacc8d5e742820701307c3c37b9b86487667d84f
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/browser/brwctrlr.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionHelper.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/TextConnectionHelper.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/paramdialog.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/UITools.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/QueryDesignView.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 12 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/querycontroller.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/relationdesign/RelationController.cxx | 2 |
10 files changed, 17 insertions, 17 deletions
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<MessageDialog>::Create(getBrowserView(), ModuleRes(STR_QUERY_BRW_DELETE_ROWS), VclMessageType::Question, VCL_BUTTONS_YES_NO)->Execute() != RET_YES) + if (ScopedVclPtrInstance<MessageDialog>(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<OSQLWarningBox>::Create( this, sFile )->Execute(); + ScopedVclPtrInstance<OSQLWarningBox>(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<MessageDialog>::Create(nullptr, MnemonicGenerator::EraseAllMnemonicChars(aErrorText))->Execute(); + ScopedVclPtrInstance<MessageDialog>(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<MessageDialog>::Create(nullptr, sMessage)->Execute(); + ScopedVclPtrInstance<MessageDialog>(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>& _xConnection, if(! ::dbaui::checkDataSourceAvailable(::comphelper::getString(xProp->getPropertyValue(PROPERTY_NAME)),_rxContext)) { OUString aMessage(ModuleRes(STR_TABLEDESIGN_DATASOURCE_DELETED)); - ScopedVclPtr<OSQLWarningBox>::Create( _pParent, aMessage )->Execute(); + ScopedVclPtrInstance<OSQLWarningBox>(_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<MessageDialog>::Create(pWin, aMessage, VclMessageType::Info)->Execute(); + ScopedVclPtrInstance<MessageDialog>(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<MessageDialog>::Create(_pView, ModuleRes( STR_QRY_CRITERIA_ON_ASTERISK))->Execute(); + ScopedVclPtrInstance<MessageDialog>(_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<MessageDialog>::Create(_pView, ModuleRes( STR_QRY_ORDERBY_ON_ASTERISK))->Execute(); + ScopedVclPtrInstance<MessageDialog>(_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<InfoBox>::Create(paDView, aMessage)->Execute(); + ScopedVclPtrInstance<InfoBox>(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<OSQLErrorBox>::Create( this, sErrorMsg )->Execute(); + ScopedVclPtrInstance<OSQLErrorBox>(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<OSQLErrorBox>::Create( this, sErrorMessage )->Execute(); + ScopedVclPtrInstance<OSQLErrorBox>(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<OSQLErrorBox>::Create( this, sErrorMessage )->Execute(); + ScopedVclPtrInstance<OSQLErrorBox>(this, sErrorMessage)->Execute(); bError = true; } } @@ -1141,7 +1141,7 @@ bool OSelectionBrowseBox::SaveModified() { if ( !m_bDisableErrorBox ) { - ScopedVclPtr<OSQLWarningBox>::Create( this, aErrorMsg )->Execute(); + ScopedVclPtrInstance<OSQLWarningBox>(this, aErrorMsg)->Execute(); } bError = true; } @@ -1150,7 +1150,7 @@ bool OSelectionBrowseBox::SaveModified() { if ( !m_bDisableErrorBox ) { - ScopedVclPtr<OSQLWarningBox>::Create( this, aErrorMsg )->Execute(); + ScopedVclPtrInstance<OSQLWarningBox>(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<OSQLMessageBox>::Create(pWindow,e)->Execute(); + ScopedVclPtrInstance<OSQLMessageBox>(pWindow,e)->Execute(); } throw; } @@ -1398,7 +1398,7 @@ bool OQueryController::doSaveAsDoc(bool _bSaveAs) if ( !editingCommand() && !haveDataSource() ) { OUString aMessage(ModuleRes(STR_DATASOURCE_DELETED)); - ScopedVclPtr<OSQLWarningBox>::Create( getView(), aMessage )->Execute(); + ScopedVclPtrInstance<OSQLWarningBox>(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<OSQLWarningBox>::Create( getView(), aMessage )->Execute(); + ScopedVclPtrInstance<OSQLWarningBox>(getView(), aMessage)->Execute(); } else { |