Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
f61b5c36
Kaydet (Commit)
f61b5c36
authored
Nis 03, 2013
tarafından
Thomas Arnhold
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#62525: use cow_wrapper for Sdr3DLightAttribute
Change-Id: I9639746d072642d46c3f0766c473425221b1706a
üst
f5cf7f36
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
61 deletions
+24
-61
sdrlightattribute3d.hxx
...glayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx
+5
-1
sdrlightattribute3d.cxx
drawinglayer/source/attribute/sdrlightattribute3d.cxx
+19
-60
No files found.
drawinglayer/inc/drawinglayer/attribute/sdrlightattribute3d.hxx
Dosyayı görüntüle @
f61b5c36
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX
#define INCLUDED_DRAWINGLAYER_ATTRIBUTE_SDRLIGHTATTRIBUTE3D_HXX
#include <drawinglayer/drawinglayerdllapi.h>
#include <drawinglayer/drawinglayerdllapi.h>
#include <o3tl/cow_wrapper.hxx>
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// predefines
// predefines
...
@@ -42,8 +43,11 @@ namespace drawinglayer
...
@@ -42,8 +43,11 @@ namespace drawinglayer
{
{
class
DRAWINGLAYER_DLLPUBLIC
Sdr3DLightAttribute
class
DRAWINGLAYER_DLLPUBLIC
Sdr3DLightAttribute
{
{
public
:
typedef
o3tl
::
cow_wrapper
<
ImpSdr3DLightAttribute
>
ImplType
;
private
:
private
:
Imp
Sdr3DLightAttribute
*
mpSdr3DLightAttribute
;
Imp
lType
mpSdr3DLightAttribute
;
public
:
public
:
// constructors/destructor
// constructors/destructor
...
...
drawinglayer/source/attribute/sdrlightattribute3d.cxx
Dosyayı görüntüle @
f61b5c36
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
#include <drawinglayer/attribute/sdrlightattribute3d.hxx>
#include <basegfx/color/bcolor.hxx>
#include <basegfx/color/bcolor.hxx>
#include <basegfx/vector/b3dvector.hxx>
#include <basegfx/vector/b3dvector.hxx>
#include <rtl/instance.hxx>
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
...
@@ -30,9 +31,6 @@ namespace drawinglayer
...
@@ -30,9 +31,6 @@ namespace drawinglayer
class
ImpSdr3DLightAttribute
class
ImpSdr3DLightAttribute
{
{
public
:
public
:
// refcounter
sal_uInt32
mnRefCount
;
// 3D light attribute definitions
// 3D light attribute definitions
basegfx
::
BColor
maColor
;
basegfx
::
BColor
maColor
;
basegfx
::
B3DVector
maDirection
;
basegfx
::
B3DVector
maDirection
;
...
@@ -44,13 +42,19 @@ namespace drawinglayer
...
@@ -44,13 +42,19 @@ namespace drawinglayer
const
basegfx
::
BColor
&
rColor
,
const
basegfx
::
BColor
&
rColor
,
const
basegfx
::
B3DVector
&
rDirection
,
const
basegfx
::
B3DVector
&
rDirection
,
bool
bSpecular
)
bool
bSpecular
)
:
mnRefCount
(
0
),
:
maColor
(
rColor
),
maColor
(
rColor
),
maDirection
(
rDirection
),
maDirection
(
rDirection
),
mbSpecular
(
bSpecular
)
mbSpecular
(
bSpecular
)
{
{
}
}
ImpSdr3DLightAttribute
()
:
maColor
(
basegfx
::
BColor
()),
maDirection
(
basegfx
::
B3DVector
()),
mbSpecular
(
false
)
{
}
// data read access
// data read access
const
basegfx
::
BColor
&
getColor
()
const
{
return
maColor
;
}
const
basegfx
::
BColor
&
getColor
()
const
{
return
maColor
;
}
const
basegfx
::
B3DVector
&
getDirection
()
const
{
return
maDirection
;
}
const
basegfx
::
B3DVector
&
getDirection
()
const
{
return
maDirection
;
}
...
@@ -62,31 +66,19 @@ namespace drawinglayer
...
@@ -62,31 +66,19 @@ namespace drawinglayer
&&
getDirection
()
==
rCandidate
.
getDirection
()
&&
getDirection
()
==
rCandidate
.
getDirection
()
&&
getSpecular
()
==
rCandidate
.
getSpecular
());
&&
getSpecular
()
==
rCandidate
.
getSpecular
());
}
}
static
ImpSdr3DLightAttribute
*
get_global_default
()
{
static
ImpSdr3DLightAttribute
*
pDefault
=
0
;
if
(
!
pDefault
)
{
pDefault
=
new
ImpSdr3DLightAttribute
(
basegfx
::
BColor
(),
basegfx
::
B3DVector
(),
false
);
// never delete; start with RefCount 1, not 0
pDefault
->
mnRefCount
++
;
}
return
pDefault
;
}
};
};
namespace
{
struct
theGlobalDefault
:
public
rtl
::
Static
<
Sdr3DLightAttribute
::
ImplType
,
theGlobalDefault
>
{};
}
Sdr3DLightAttribute
::
Sdr3DLightAttribute
(
Sdr3DLightAttribute
::
Sdr3DLightAttribute
(
const
basegfx
::
BColor
&
rColor
,
const
basegfx
::
BColor
&
rColor
,
const
basegfx
::
B3DVector
&
rDirection
,
const
basegfx
::
B3DVector
&
rDirection
,
bool
bSpecular
)
bool
bSpecular
)
:
mpSdr3DLightAttribute
(
new
ImpSdr3DLightAttribute
(
:
mpSdr3DLightAttribute
(
ImpSdr3DLightAttribute
(
rColor
,
rDirection
,
bSpecular
))
rColor
,
rDirection
,
bSpecular
))
{
{
}
}
...
@@ -94,59 +86,26 @@ namespace drawinglayer
...
@@ -94,59 +86,26 @@ namespace drawinglayer
Sdr3DLightAttribute
::
Sdr3DLightAttribute
(
const
Sdr3DLightAttribute
&
rCandidate
)
Sdr3DLightAttribute
::
Sdr3DLightAttribute
(
const
Sdr3DLightAttribute
&
rCandidate
)
:
mpSdr3DLightAttribute
(
rCandidate
.
mpSdr3DLightAttribute
)
:
mpSdr3DLightAttribute
(
rCandidate
.
mpSdr3DLightAttribute
)
{
{
mpSdr3DLightAttribute
->
mnRefCount
++
;
}
}
Sdr3DLightAttribute
::~
Sdr3DLightAttribute
()
Sdr3DLightAttribute
::~
Sdr3DLightAttribute
()
{
{
if
(
mpSdr3DLightAttribute
->
mnRefCount
)
{
mpSdr3DLightAttribute
->
mnRefCount
--
;
}
else
{
delete
mpSdr3DLightAttribute
;
}
}
}
bool
Sdr3DLightAttribute
::
isDefault
()
const
bool
Sdr3DLightAttribute
::
isDefault
()
const
{
{
return
mpSdr3DLightAttribute
==
ImpSdr3DLightAttribute
::
get_global_default
(
);
return
mpSdr3DLightAttribute
.
same_object
(
theGlobalDefault
::
get
()
);
}
}
Sdr3DLightAttribute
&
Sdr3DLightAttribute
::
operator
=
(
const
Sdr3DLightAttribute
&
rCandidate
)
Sdr3DLightAttribute
&
Sdr3DLightAttribute
::
operator
=
(
const
Sdr3DLightAttribute
&
rCandidate
)
{
{
if
(
rCandidate
.
mpSdr3DLightAttribute
!=
mpSdr3DLightAttribute
)
mpSdr3DLightAttribute
=
rCandidate
.
mpSdr3DLightAttribute
;
{
if
(
mpSdr3DLightAttribute
->
mnRefCount
)
{
mpSdr3DLightAttribute
->
mnRefCount
--
;
}
else
{
delete
mpSdr3DLightAttribute
;
}
mpSdr3DLightAttribute
=
rCandidate
.
mpSdr3DLightAttribute
;
mpSdr3DLightAttribute
->
mnRefCount
++
;
}
return
*
this
;
return
*
this
;
}
}
bool
Sdr3DLightAttribute
::
operator
==
(
const
Sdr3DLightAttribute
&
rCandidate
)
const
bool
Sdr3DLightAttribute
::
operator
==
(
const
Sdr3DLightAttribute
&
rCandidate
)
const
{
{
if
(
rCandidate
.
mpSdr3DLightAttribute
==
mpSdr3DLightAttribute
)
return
rCandidate
.
mpSdr3DLightAttribute
==
mpSdr3DLightAttribute
;
{
return
true
;
}
if
(
rCandidate
.
isDefault
()
!=
isDefault
())
{
return
false
;
}
return
(
*
rCandidate
.
mpSdr3DLightAttribute
==
*
mpSdr3DLightAttribute
);
}
}
const
basegfx
::
BColor
&
Sdr3DLightAttribute
::
getColor
()
const
const
basegfx
::
BColor
&
Sdr3DLightAttribute
::
getColor
()
const
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment