summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de>2016-04-29 17:10:18 +0200
committerArmin Le Grand <Armin.Le.Grand@cib.de>2016-05-01 13:46:04 +0000
commit75d9f7a4332f8dec141159c88fe70a9f18a5daae (patch)
treec702d5a6b40ca6688f359f26fe2b79b3237df39c
parent0975b5e4bdcd564b38b244589a44f5dd6cbdc63d (diff)
Complete drawinglayer attributes
All DrawingLayer Atrributes used for ptimitives need a default constructor. Since the o3tl::cow_wrapper is used in combination with a static default incarnation of the impl class it is better to define that. Also needed is a working isDefault() implementation that compares the impl class to the static default. Added missing stuff for this. Change-Id: I98e9fee7343112cd979b972229423ac0ef3994a6 Reviewed-on: https://gerrit.libreoffice.org/24496 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
-rw-r--r--drawinglayer/source/attribute/fillgraphicattribute.cxx5
-rw-r--r--drawinglayer/source/attribute/fontattribute.cxx5
-rw-r--r--drawinglayer/source/attribute/materialattribute3d.cxx5
-rw-r--r--drawinglayer/source/attribute/sdrlightattribute3d.cxx17
-rw-r--r--drawinglayer/source/attribute/sdrobjectattribute3d.cxx25
-rw-r--r--include/drawinglayer/attribute/fontattribute.hxx3
-rw-r--r--include/drawinglayer/attribute/materialattribute3d.hxx3
-rw-r--r--include/drawinglayer/attribute/sdrlightattribute3d.hxx4
-rw-r--r--include/drawinglayer/attribute/sdrobjectattribute3d.hxx4
9 files changed, 71 insertions, 0 deletions
diff --git a/drawinglayer/source/attribute/fillgraphicattribute.cxx b/drawinglayer/source/attribute/fillgraphicattribute.cxx
index 89422befac87..6d70e46de699 100644
--- a/drawinglayer/source/attribute/fillgraphicattribute.cxx
+++ b/drawinglayer/source/attribute/fillgraphicattribute.cxx
@@ -98,6 +98,11 @@ namespace drawinglayer
{
}
+ FillGraphicAttribute::FillGraphicAttribute()
+ : mpFillGraphicAttribute(theGlobalDefault::get())
+ {
+ }
+
FillGraphicAttribute::FillGraphicAttribute(const FillGraphicAttribute& rCandidate)
: mpFillGraphicAttribute(rCandidate.mpFillGraphicAttribute)
{
diff --git a/drawinglayer/source/attribute/fontattribute.cxx b/drawinglayer/source/attribute/fontattribute.cxx
index 20d743d314ec..110404e26e66 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -144,6 +144,11 @@ namespace drawinglayer
{
}
+ bool FontAttribute::isDefault() const
+ {
+ return mpFontAttribute.same_object(theGlobalDefault::get());
+ }
+
FontAttribute& FontAttribute::operator=(const FontAttribute& rCandidate)
{
mpFontAttribute = rCandidate.mpFontAttribute;
diff --git a/drawinglayer/source/attribute/materialattribute3d.cxx b/drawinglayer/source/attribute/materialattribute3d.cxx
index 59d39a07265e..72fce36ac8b1 100644
--- a/drawinglayer/source/attribute/materialattribute3d.cxx
+++ b/drawinglayer/source/attribute/materialattribute3d.cxx
@@ -110,6 +110,11 @@ namespace drawinglayer
{
}
+ bool MaterialAttribute3D::isDefault() const
+ {
+ return mpMaterialAttribute3D.same_object(theGlobalDefault::get());
+ }
+
MaterialAttribute3D& MaterialAttribute3D::operator=(const MaterialAttribute3D& rCandidate)
{
mpMaterialAttribute3D = rCandidate.mpMaterialAttribute3D;
diff --git a/drawinglayer/source/attribute/sdrlightattribute3d.cxx b/drawinglayer/source/attribute/sdrlightattribute3d.cxx
index e249a88c2677..868bc9c4bf02 100644
--- a/drawinglayer/source/attribute/sdrlightattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrlightattribute3d.cxx
@@ -47,6 +47,13 @@ namespace drawinglayer
{
}
+ ImpSdr3DLightAttribute()
+ : maColor(),
+ maDirection(),
+ mbSpecular(false)
+ {
+ }
+
// data read access
const basegfx::BColor& getColor() const { return maColor; }
const basegfx::B3DVector& getDirection() const { return maDirection; }
@@ -75,6 +82,11 @@ namespace drawinglayer
{
}
+ Sdr3DLightAttribute::Sdr3DLightAttribute()
+ : mpSdr3DLightAttribute(theGlobalDefault::get())
+ {
+ }
+
Sdr3DLightAttribute::Sdr3DLightAttribute(const Sdr3DLightAttribute& rCandidate)
: mpSdr3DLightAttribute(rCandidate.mpSdr3DLightAttribute)
{
@@ -84,6 +96,11 @@ namespace drawinglayer
{
}
+ bool Sdr3DLightAttribute::isDefault() const
+ {
+ return mpSdr3DLightAttribute.same_object(theGlobalDefault::get());
+ }
+
Sdr3DLightAttribute& Sdr3DLightAttribute::operator=(const Sdr3DLightAttribute& rCandidate)
{
mpSdr3DLightAttribute = rCandidate.mpSdr3DLightAttribute;
diff --git a/drawinglayer/source/attribute/sdrobjectattribute3d.cxx b/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
index d513c39eb4aa..8f7f93bef8b9 100644
--- a/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
+++ b/drawinglayer/source/attribute/sdrobjectattribute3d.cxx
@@ -70,6 +70,21 @@ namespace drawinglayer
{
}
+ ImpSdr3DObjectAttribute()
+ : maNormalsKind(css::drawing::NormalsKind_SPECIFIC),
+ maTextureProjectionX(css::drawing::TextureProjectionMode_OBJECTSPECIFIC),
+ maTextureProjectionY(css::drawing::TextureProjectionMode_OBJECTSPECIFIC),
+ maTextureKind(css::drawing::TextureKind2_LUMINANCE),
+ maTextureMode(css::drawing::TextureMode_REPLACE),
+ maMaterial(),
+ mbNormalsInvert(false),
+ mbDoubleSided(false),
+ mbShadow3D(false),
+ mbTextureFilter(false),
+ mbReducedLineGeometry(false)
+ {
+ }
+
// data read access
css::drawing::NormalsKind getNormalsKind() const { return maNormalsKind; }
css::drawing::TextureProjectionMode getTextureProjectionX() const { return maTextureProjectionX; }
@@ -128,10 +143,20 @@ namespace drawinglayer
{
}
+ Sdr3DObjectAttribute::Sdr3DObjectAttribute()
+ : mpSdr3DObjectAttribute(theGlobalDefault::get())
+ {
+ }
+
Sdr3DObjectAttribute::~Sdr3DObjectAttribute()
{
}
+ bool Sdr3DObjectAttribute::isDefault() const
+ {
+ return mpSdr3DObjectAttribute.same_object(theGlobalDefault::get());
+ }
+
Sdr3DObjectAttribute& Sdr3DObjectAttribute::operator=(const Sdr3DObjectAttribute& rCandidate)
{
mpSdr3DObjectAttribute = rCandidate.mpSdr3DObjectAttribute;
diff --git a/include/drawinglayer/attribute/fontattribute.hxx b/include/drawinglayer/attribute/fontattribute.hxx
index 1b35189a6993..82c183f6a486 100644
--- a/include/drawinglayer/attribute/fontattribute.hxx
+++ b/include/drawinglayer/attribute/fontattribute.hxx
@@ -71,6 +71,9 @@ namespace drawinglayer
FontAttribute& operator=(const FontAttribute& rCandidate);
~FontAttribute();
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
// compare operator
bool operator==(const FontAttribute& rCandidate) const;
diff --git a/include/drawinglayer/attribute/materialattribute3d.hxx b/include/drawinglayer/attribute/materialattribute3d.hxx
index db144b7a030a..e5d3f68bef55 100644
--- a/include/drawinglayer/attribute/materialattribute3d.hxx
+++ b/include/drawinglayer/attribute/materialattribute3d.hxx
@@ -59,6 +59,9 @@ namespace drawinglayer
MaterialAttribute3D(const MaterialAttribute3D& rCandidate);
~MaterialAttribute3D();
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
// assignment operator
MaterialAttribute3D& operator=(const MaterialAttribute3D& rCandidate);
diff --git a/include/drawinglayer/attribute/sdrlightattribute3d.hxx b/include/drawinglayer/attribute/sdrlightattribute3d.hxx
index 3b98b464ec76..49b9685b6177 100644
--- a/include/drawinglayer/attribute/sdrlightattribute3d.hxx
+++ b/include/drawinglayer/attribute/sdrlightattribute3d.hxx
@@ -56,11 +56,15 @@ namespace drawinglayer
bool bSpecular);
explicit Sdr3DLightAttribute(const basegfx::BColor& rColor);
Sdr3DLightAttribute(const Sdr3DLightAttribute& rCandidate);
+ Sdr3DLightAttribute();
~Sdr3DLightAttribute();
// assignment operator
Sdr3DLightAttribute& operator=(const Sdr3DLightAttribute& rCandidate);
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
// compare operator
bool operator==(const Sdr3DLightAttribute& rCandidate) const;
diff --git a/include/drawinglayer/attribute/sdrobjectattribute3d.hxx b/include/drawinglayer/attribute/sdrobjectattribute3d.hxx
index b4ea75bfbf87..85019eff89b5 100644
--- a/include/drawinglayer/attribute/sdrobjectattribute3d.hxx
+++ b/include/drawinglayer/attribute/sdrobjectattribute3d.hxx
@@ -64,11 +64,15 @@ namespace drawinglayer
bool bTextureFilter,
bool bReducedLineGeometry);
Sdr3DObjectAttribute(const Sdr3DObjectAttribute& rCandidate);
+ Sdr3DObjectAttribute();
~Sdr3DObjectAttribute();
// assignment operator
Sdr3DObjectAttribute& operator=(const Sdr3DObjectAttribute& rCandidate);
+ // checks if the incarnation is default constructed
+ bool isDefault() const;
+
// compare operator
bool operator==(const Sdr3DObjectAttribute& rCandidate) const;