[Libreoffice-commits] core.git: dbaccess/source include/svx svx/source

2023-02-21 Thread Noel Grandin (via logerrit)
 dbaccess/source/ui/browser/sbagrid.cxx |   37 ++---
 dbaccess/source/ui/inc/sbagrid.hxx |6 +-
 include/svx/fmgridif.hxx   |   14 +++---
 svx/source/fmcomp/fmgridif.cxx |   69 +++--
 4 files changed, 72 insertions(+), 54 deletions(-)

New commits:
commit c2c22a8ca6e04779c4daada73003b03c963b4cfd
Author: Noel Grandin 
AuthorDate: Tue Feb 21 10:02:50 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 21 10:39:38 2023 +

osl::Mutex->std::mutex in FmXGridPeer

Change-Id: Ib0796a86f864ab0a1a1b99183668f486a8a8f198
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147381
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/dbaccess/source/ui/browser/sbagrid.cxx 
b/dbaccess/source/ui/browser/sbagrid.cxx
index 03b81526a372..99ee5c30eb73 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -237,7 +237,6 @@ void SAL_CALL SbaXGridControl::dispose()
 // SbaXGridPeer
 SbaXGridPeer::SbaXGridPeer(const Reference< XComponentContext >& _rM)
 : FmXGridPeer(_rM)
-,m_aStatusListeners(m_aMutex)
 {
 }
 
@@ -247,10 +246,11 @@ SbaXGridPeer::~SbaXGridPeer()
 
 void SAL_CALL SbaXGridPeer::dispose()
 {
-EventObject aEvt(*this);
-
-m_aStatusListeners.disposeAndClear(aEvt);
-
+{
+std::unique_lock g(m_aMutex);
+EventObject aEvt(*this);
+m_aStatusListeners.disposeAndClear(g, aEvt);
+}
 FmXGridPeer::dispose();
 }
 
@@ -275,12 +275,13 @@ void SbaXGridPeer::NotifyStatusChanged(const 
css::util::URL& _rUrl, const Refere
 xControl->statusChanged(aEvt);
 else
 {
-::comphelper::OInterfaceContainerHelper3 
* pIter
-= m_aStatusListeners.getContainer(_rUrl);
+std::unique_lock g(m_aMutex);
+::comphelper::OInterfaceContainerHelper4 
* pIter
+= m_aStatusListeners.getContainer(g, _rUrl);
 
 if (pIter)
 {
-pIter->notifyEach( ::statusChanged, aEvt );
+pIter->notifyEach( g, ::statusChanged, aEvt );
 }
 }
 }
@@ -439,20 +440,24 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, 
const Sequence< PropertyVa
 
 void SAL_CALL SbaXGridPeer::addStatusListener(const Reference< 
css::frame::XStatusListener > & xControl, const css::util::URL& aURL)
 {
-::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener >* 
pCont
-= m_aStatusListeners.getContainer(aURL);
-if (!pCont)
-m_aStatusListeners.addInterface(aURL,xControl);
-else
-pCont->addInterface(xControl);
+{
+std::unique_lock g(m_aMutex);
+::comphelper::OInterfaceContainerHelper4< css::frame::XStatusListener 
>* pCont
+= m_aStatusListeners.getContainer(g, aURL);
+if (!pCont)
+m_aStatusListeners.addInterface(g, aURL,xControl);
+else
+pCont->addInterface(g, xControl);
+}
 NotifyStatusChanged(aURL, xControl);
 }
 
 void SAL_CALL SbaXGridPeer::removeStatusListener(const Reference< 
css::frame::XStatusListener > & xControl, const css::util::URL& aURL)
 {
-::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener >* 
pCont = m_aStatusListeners.getContainer(aURL);
+std::unique_lock g(m_aMutex);
+::comphelper::OInterfaceContainerHelper4< css::frame::XStatusListener >* 
pCont = m_aStatusListeners.getContainer(g, aURL);
 if ( pCont )
-pCont->removeInterface(xControl);
+pCont->removeInterface(g, xControl);
 }
 
 Sequence< Type > SAL_CALL SbaXGridPeer::getTypes()
diff --git a/dbaccess/source/ui/inc/sbagrid.hxx 
b/dbaccess/source/ui/inc/sbagrid.hxx
index 22af70834425..4c0f37654647 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -25,7 +25,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include "sbamultiplex.hxx"
@@ -93,8 +93,8 @@ namespace dbaui
 :public FmXGridPeer
 ,public css::frame::XDispatch
 {
-comphelper::OMultiTypeInterfaceContainerHelperVar3< 
css::frame::XStatusListener,
-css::util::URL, SbaURLCompare>  m_aStatusListeners;
+comphelper::OMultiTypeInterfaceContainerHelperVar4< css::util::URL, 
css::frame::XStatusListener,
+SbaURLCompare>  m_aStatusListeners;
 
 public:
 SbaXGridPeer(const css::uno::Reference< css::uno::XComponentContext 
>&);
diff --git a/include/svx/fmgridif.hxx b/include/svx/fmgridif.hxx
index e3cce3952b3a..f978b70b546e 100644
--- a/include/svx/fmgridif.hxx
+++ b/include/svx/fmgridif.hxx
@@ -44,7 +44,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -342,16 +342,16 @@ class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FmXGridPeer:
 {
 protected:
 css::uno::Reference< css::uno::XComponentContext >m_xContext;
-::osl::Mutex  m_aMutex;
+std::mutex 

[Libreoffice-commits] core.git: dbaccess/source include/svx svx/source

2021-02-19 Thread Caolán McNamara (via logerrit)
 dbaccess/source/ui/browser/sbagrid.cxx |8 
 dbaccess/source/ui/inc/sbagrid.hxx |4 ++--
 include/svx/gridctrl.hxx   |6 +++---
 svx/source/fmcomp/gridctrl.cxx |   14 +++---
 4 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 84a3b4d7635d0a5819e8b376efa4d47e74612739
Author: Caolán McNamara 
AuthorDate: Fri Feb 19 12:35:48 2021 +
Commit: Caolán McNamara 
CommitDate: Fri Feb 19 15:56:56 2021 +0100

nRow argument is unused

Change-Id: I9401d5af8e537423e7198435457107e12817fc09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111217
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/dbaccess/source/ui/browser/sbagrid.cxx 
b/dbaccess/source/ui/browser/sbagrid.cxx
index 1d7a657b453e..a78921935f6c 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -666,9 +666,9 @@ CellController* SbaGridControl::GetController(sal_Int32 
nRow, sal_uInt16 nCol)
 return FmGridControl::GetController(nRow, nCol);
 }
 
-void SbaGridControl::PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& 
rMenu)
+void SbaGridControl::PreExecuteRowContextMenu(PopupMenu& rMenu)
 {
-FmGridControl::PreExecuteRowContextMenu(nRow, rMenu);
+FmGridControl::PreExecuteRowContextMenu(rMenu);
 
 sal_uInt16 nPos = 0;
 
@@ -821,7 +821,7 @@ void SbaGridControl::SetBrowserAttrs()
 }
 }
 
-void SbaGridControl::PostExecuteRowContextMenu(sal_uInt16 nRow, const 
PopupMenu& rMenu, sal_uInt16 nExecutionResult)
+void SbaGridControl::PostExecuteRowContextMenu(const PopupMenu& rMenu, 
sal_uInt16 nExecutionResult)
 {
 switch (nExecutionResult)
 {
@@ -836,7 +836,7 @@ void SbaGridControl::PostExecuteRowContextMenu(sal_uInt16 
nRow, const PopupMenu&
 break;
 
 default:
-FmGridControl::PostExecuteRowContextMenu(nRow, rMenu, 
nExecutionResult);
+FmGridControl::PostExecuteRowContextMenu(rMenu, nExecutionResult);
 break;
 }
 }
diff --git a/dbaccess/source/ui/inc/sbagrid.hxx 
b/dbaccess/source/ui/inc/sbagrid.hxx
index 9f9e6fc5fc4b..76759de963d7 100644
--- a/dbaccess/source/ui/inc/sbagrid.hxx
+++ b/dbaccess/source/ui/inc/sbagrid.hxx
@@ -252,8 +252,8 @@ namespace dbaui
 virtual ::svt::CellController* GetController(sal_Int32 nRow, 
sal_uInt16 nCol) override;
 
 // DbGridControl overridables
-virtual void PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& 
rMenu) override;
-virtual void PostExecuteRowContextMenu(sal_uInt16 nRow, const 
PopupMenu& rMenu, sal_uInt16 nExecutionResult) override;
+virtual void PreExecuteRowContextMenu(PopupMenu& rMenu) override;
+virtual void PostExecuteRowContextMenu(const PopupMenu& rMenu, 
sal_uInt16 nExecutionResult) override;
 
 // DbGridControl overridables
 virtual void onRowChange() override;
diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx
index 7667d456bd00..5b13b328ae12 100644
--- a/include/svx/gridctrl.hxx
+++ b/include/svx/gridctrl.hxx
@@ -345,10 +345,10 @@ protected:
 All disabled entries will be removed before executing the menu, so be 
careful with separators
 near entries you probably wish to disable ...
 */
-virtual void PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu);
+virtual void PreExecuteRowContextMenu(PopupMenu& rMenu);
 /** After executing the context menu for a row this method is called.
 */
-virtual void PostExecuteRowContextMenu(sal_uInt16 nRow, const PopupMenu& 
rMenu, sal_uInt16 nExecutionResult);
+virtual void PostExecuteRowContextMenu(const PopupMenu& rMenu, sal_uInt16 
nExecutionResult);
 
 /// @throws css::uno::RuntimeException
 void DataSourcePropertyChanged(const css::beans::PropertyChangeEvent& evt);
@@ -367,7 +367,7 @@ protected:
 // DragSourceHelper overridables
 virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) 
override;
 
-voidexecuteRowContextMenu( sal_Int32 _nRow, const Point& 
_rPreferredPos );
+voidexecuteRowContextMenu(const Point& _rPreferredPos);
 
 public:
 DbGridControl(
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 509aa733a373..3bdec10d7145 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -2408,7 +2408,7 @@ sal_uInt32 DbGridControl::GetTotalCellWidth(sal_Int32 
nRow, sal_uInt16 nColId)
 return 30;  // FIXME magic number for default cell width
 }
 
-void DbGridControl::PreExecuteRowContextMenu(sal_uInt16 /*nRow*/, PopupMenu& 
rMenu)
+void DbGridControl::PreExecuteRowContextMenu(PopupMenu& rMenu)
 {
 bool bDelete = (m_nOptions & DbGridControlOptions::Delete) && 
GetSelectRowCount() && !IsCurrentAppending();
 // if only a blank row is selected then do not delete
@@ -2427,7 +2427,7 @@ void DbGridControl::PreExecuteRowContextMenu(sal_uInt16 
/*nRow*/, PopupMenu& rMe