summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-26 10:21:41 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-08-03 09:47:42 +0000
commit0b21f434b45c350cd9cc5b820226245d6824bf86 (patch)
tree2db24f59783e6a91bee55fb2cd75421836f6dd60 /dbaccess/source
parentc4c30cfac570aeb0f8ac91b36b986e438e2811bc (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 (cherry picked from commit a860df25dd7bf62ecb6b3d3ed38803b981f56d52) Change-Id: Ifacc8d5e742820701307c3c37b9b86487667d84f Reviewed-on: https://gerrit.libreoffice.org/27537 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx2
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx2
-rw-r--r--dbaccess/source/ui/dlg/TextConnectionHelper.cxx2
-rw-r--r--dbaccess/source/ui/dlg/paramdialog.cxx2
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx2
-rw-r--r--dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx12
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx4
-rw-r--r--dbaccess/source/ui/relationdesign/RelationController.cxx2
10 files changed, 17 insertions, 17 deletions
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index 2d0b1ff0cadd..4453ea11ddad 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1383,7 +1383,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), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO)->Execute() != RET_YES)
+ if (ScopedVclPtrInstance<MessageDialog>(getBrowserView(), ModuleRes(STR_QUERY_BRW_DELETE_ROWS), VCL_MESSAGE_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 26fce195d51d..0614726f75bf 100644
--- a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
+++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
@@ -455,7 +455,7 @@ namespace dbaui
if ( !pWin )
pWin = getView()->Window::GetParent();
- ScopedVclPtrInstance<MessageDialog>::Create(pWin, aMessage, VCL_MESSAGE_INFO)->Execute();
+ ScopedVclPtrInstance<MessageDialog>(pWin, aMessage, VCL_MESSAGE_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 160dca9945f8..eac2869f6d58 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 cff9469c682b..fb900b9d530b 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 8a96808a58db..dfa1db928d8d 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -1052,7 +1052,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;
}
@@ -1404,7 +1404,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
{