Kaydet (Commit) 3872be54 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Tor Lillqvist

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/3678Reviewed-by: 's avatarTor Lillqvist <tml@iki.fi>
Tested-by: 's avatarTor Lillqvist <tml@iki.fi>
üst d6d896a1
......@@ -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()))
{
......
......@@ -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();
......
......@@ -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))
{
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment