From 75d9f7a4332f8dec141159c88fe70a9f18a5daae Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Fri, 29 Apr 2016 17:10:18 +0200 Subject: 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 Reviewed-by: Armin Le Grand --- .../source/attribute/fillgraphicattribute.cxx | 5 +++++ drawinglayer/source/attribute/fontattribute.cxx | 5 +++++ .../source/attribute/materialattribute3d.cxx | 5 +++++ .../source/attribute/sdrlightattribute3d.cxx | 17 +++++++++++++++ .../source/attribute/sdrobjectattribute3d.cxx | 25 ++++++++++++++++++++++ 5 files changed, 57 insertions(+) (limited to 'drawinglayer') 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; -- cgit