drawinglayer/source/attribute/fillgraphicattribute.cxx | 5 +++ drawinglayer/source/attribute/fontattribute.cxx | 5 +++ drawinglayer/source/attribute/materialattribute3d.cxx | 5 +++ drawinglayer/source/attribute/sdrlightattribute3d.cxx | 17 ++++++++++ drawinglayer/source/attribute/sdrobjectattribute3d.cxx | 25 ++++++++++++++++ include/drawinglayer/attribute/fontattribute.hxx | 3 + include/drawinglayer/attribute/materialattribute3d.hxx | 3 + include/drawinglayer/attribute/sdrlightattribute3d.hxx | 4 ++ include/drawinglayer/attribute/sdrobjectattribute3d.hxx | 4 ++ 9 files changed, 71 insertions(+)
New commits: commit 75d9f7a4332f8dec141159c88fe70a9f18a5daae Author: Armin Le Grand <armin.le.gr...@cib.de> Date: Fri Apr 29 17:10:18 2016 +0200 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 <c...@libreoffice.org> Reviewed-by: Armin Le Grand <armin.le.gr...@cib.de> diff --git a/drawinglayer/source/attribute/fillgraphicattribute.cxx b/drawinglayer/source/attribute/fillgraphicattribute.cxx index 89422be..6d70e46 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 20d743d..110404e 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 59d39a0..72fce36 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 e249a88..868bc9c 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 d513c39..8f7f93b 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 1b35189..82c183f 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 db144b7..e5d3f68 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 3b98b46..49b9685 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 b4ea75b..85019ef 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits