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

Noel Grandin noel at peralex.com
Mon Apr 29 23:29:56 PDT 2013


 drawinglayer/source/geometry/viewinformation2d.cxx         |    7 -------
 drawinglayer/source/geometry/viewinformation3d.cxx         |    3 ---
 drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx |    3 ++-
 drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx  |    2 --
 drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx    |    2 --
 svx/source/sdr/primitive2d/sdrprimitivetools.cxx           |    4 +++-
 6 files changed, 5 insertions(+), 16 deletions(-)

New commits:
commit 3872be543252a30d020e35233415c5fccc0ea806
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Apr 26 13:41:29 2013 +0200

    Clang cleanup, unused mutex variables
    
    Some of these were doing nothing useful at all. I removed those.
    A couple were protecting static data, and I fixed those to use Mutex
    and MutexGuard properly.
    
    Change-Id: I444d13f8b6c50e526cce8d69d09aeaf240e5c6ca
    Reviewed-on: https://gerrit.libreoffice.org/3678
    Reviewed-by: Tor Lillqvist <tml at iki.fi>
    Tested-by: Tor Lillqvist <tml at iki.fi>

diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
index f7d0de8..8d7bc4c 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -20,7 +20,6 @@
 #include <drawinglayer/geometry/viewinformation2d.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
 #include <basegfx/range/b2drange.hxx>
-#include <osl/mutex.hxx>
 #include <basegfx/tools/canvastools.hxx>
 #include <com/sun/star/geometry/AffineMatrix2D.hpp>
 #include <com/sun/star/geometry/RealRectangle2D.hpp>
@@ -322,8 +321,6 @@ namespace drawinglayer
 
             const basegfx::B2DRange& getDiscreteViewport() const
             {
-                ::osl::Mutex m_mutex;
-
                 if(maDiscreteViewport.isEmpty() && !maViewport.isEmpty())
                 {
                     basegfx::B2DRange aDiscreteViewport(maViewport);
@@ -336,8 +333,6 @@ namespace drawinglayer
 
             const basegfx::B2DHomMatrix& getObjectToViewTransformation() const
             {
-                ::osl::Mutex m_mutex;
-
                 if(maObjectToViewTransformation.isIdentity() &&
                     (!maObjectTransformation.isIdentity() || !maViewTransformation.isIdentity()))
                 {
@@ -350,8 +345,6 @@ namespace drawinglayer
 
             const basegfx::B2DHomMatrix& getInverseObjectToViewTransformation() const
             {
-                ::osl::Mutex m_mutex;
-
                 if(maInverseObjectToViewTransformation.isIdentity() &&
                     (!maObjectTransformation.isIdentity() || !maViewTransformation.isIdentity()))
                 {
diff --git a/drawinglayer/source/geometry/viewinformation3d.cxx b/drawinglayer/source/geometry/viewinformation3d.cxx
index 7593dc0..4707be1 100644
--- a/drawinglayer/source/geometry/viewinformation3d.cxx
+++ b/drawinglayer/source/geometry/viewinformation3d.cxx
@@ -392,7 +392,6 @@ namespace drawinglayer
             const basegfx::B3DHomMatrix& getObjectToView() const
             {
                 // on demand WorldToView creation
-                ::osl::Mutex m_mutex;
 
                 if(maObjectToView.isIdentity())
                 {
@@ -404,8 +403,6 @@ namespace drawinglayer
 
             const uno::Sequence< beans::PropertyValue >& getViewInformationSequence() const
             {
-                ::osl::Mutex m_mutex;
-
                 if(!mxViewInformation.hasElements())
                 {
                     const_cast< ImpViewInformation3D* >(this)->impFillViewInformationFromContent();
diff --git a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
index 77487db..495c06f 100644
--- a/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/polygontubeprimitive3d.cxx
@@ -42,9 +42,10 @@ namespace drawinglayer
                 static Primitive3DSequence aLineTubeList;
                 static sal_uInt32 nLineTubeSegments(0L);
                 static attribute::MaterialAttribute3D aLineMaterial;
+                static ::osl::Mutex aMutex;
 
                 // may exclusively change static data, use mutex
-                ::osl::Mutex m_mutex;
+                ::osl::MutexGuard aGuard(aMutex);
 
                 if(nSegments != nLineTubeSegments || !(rMaterial == aLineMaterial))
                 {
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index a488ad0..1987102 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -377,7 +377,6 @@ namespace drawinglayer
             // again when no longer geometry is needed for non-visible 3D objects as it is now for chart
             if(getPolyPolygon().count() && !maSlices.size())
             {
-                ::osl::Mutex m_mutex;
                 const_cast< SdrExtrudePrimitive3D& >(*this).impCreateSlices();
             }
 
@@ -493,7 +492,6 @@ namespace drawinglayer
                 {
                     // conditions of last local decomposition with reduced lines have changed. Remember
                     // new one and clear current decompositiopn
-                    ::osl::Mutex m_mutex;
                     SdrExtrudePrimitive3D* pThat = const_cast< SdrExtrudePrimitive3D* >(this);
                     pThat->setBuffered3DDecomposition(Primitive3DSequence());
                     delete pThat->mpLastRLGViewInformation;
diff --git a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
index 78825bd..33e39b1 100644
--- a/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrlatheprimitive3d.cxx
@@ -233,7 +233,6 @@ namespace drawinglayer
             // again when no longer geometry is needed for non-visible 3D objects as it is now for chart
             if(getPolyPolygon().count() && !maSlices.size())
             {
-                ::osl::Mutex m_mutex;
                 const_cast< SdrLathePrimitive3D& >(*this).impCreateSlices();
             }
 
@@ -355,7 +354,6 @@ namespace drawinglayer
                 {
                     // conditions of last local decomposition with reduced lines have changed. Remember
                     // new one and clear current decompositiopn
-                    ::osl::Mutex m_mutex;
                     SdrLathePrimitive3D* pThat = const_cast< SdrLathePrimitive3D* >(this);
                     pThat->setBuffered3DDecomposition(Primitive3DSequence());
                     delete pThat->mpLastRLGViewInformation;
diff --git a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
index 3b9ea25..bc4296f 100644
--- a/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
+++ b/svx/source/sdr/primitive2d/sdrprimitivetools.cxx
@@ -33,7 +33,9 @@ namespace drawinglayer
         {
             static vcl::DeleteOnDeinit< BitmapEx > aRetVal(0);
             static basegfx::BColor aColor;
-            ::osl::Mutex m_mutex;
+            static ::osl::Mutex aMutex;
+
+            ::osl::MutexGuard aGuard(aMutex);
 
             if(!aRetVal.get() || rBColor != aColor)
             {


More information about the Libreoffice-commits mailing list