summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-09-01 16:46:59 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-09-01 16:46:59 +0200
commit148aea32a34fe816c7f1870bfb4cf361a5e81bf0 (patch)
tree7f452968a1d4cf26b062a099b99e6c726ceeb331 /svx/source
parente5d6ae0c2efcf8edb224faa294be6b0baa636137 (diff)
Consistency around SvxB3DVectorItem in svx/svx3ditems.hxx
...similar to what has been done for svx/sdtmfitm.hxx in 68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem." Change-Id: I7f2348d82c76f6f231e34f0dfc4b6ee6fddffe55
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.cxx6
-rw-r--r--svx/source/dialog/dlgctl3d.cxx32
-rw-r--r--svx/source/engine3d/svx3ditems.cxx32
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx16
-rw-r--r--svx/source/svdraw/svdattr.cxx16
5 files changed, 35 insertions, 67 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index eac5e63211a2..92967399c1da 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -687,7 +687,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
pScene->GetProperties().SetObjectItem( makeSvx3DLightOnOff1Item( true ) );
Color aAmbientSpot1Color( nSpotLight1, nSpotLight1, nSpotLight1 );
pScene->GetProperties().SetObjectItem( makeSvx3DLightcolor1Item( aAmbientSpot1Color ) );
- pScene->GetProperties().SetObjectItem( Svx3DLightDirection1Item( aSpotLight1 ) );
+ pScene->GetProperties().SetObjectItem( makeSvx3DLightDirection1Item( aSpotLight1 ) );
sal_uInt8 nSpotLight2 = (sal_uInt8)( fLight2Intensity * 255.0 );
basegfx::B3DVector aSpotLight2( aSecondLightDirection.DirectionX, -aSecondLightDirection.DirectionY, -aSecondLightDirection.DirectionZ );
@@ -695,14 +695,14 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
pScene->GetProperties().SetObjectItem( makeSvx3DLightOnOff2Item( true ) );
Color aAmbientSpot2Color( nSpotLight2, nSpotLight2, nSpotLight2 );
pScene->GetProperties().SetObjectItem( makeSvx3DLightcolor2Item( aAmbientSpot2Color ) );
- pScene->GetProperties().SetObjectItem( Svx3DLightDirection2Item( aSpotLight2 ) );
+ pScene->GetProperties().SetObjectItem( makeSvx3DLightDirection2Item( aSpotLight2 ) );
sal_uInt8 nSpotLight3 = 70;
basegfx::B3DVector aSpotLight3( 0.0, 0.0, 1.0 );
pScene->GetProperties().SetObjectItem( makeSvx3DLightOnOff3Item( true ) );
Color aAmbientSpot3Color( nSpotLight3, nSpotLight3, nSpotLight3 );
pScene->GetProperties().SetObjectItem( makeSvx3DLightcolor3Item( aAmbientSpot3Color ) );
- pScene->GetProperties().SetObjectItem( Svx3DLightDirection3Item( aSpotLight3 ) );
+ pScene->GetProperties().SetObjectItem( makeSvx3DLightDirection3Item( aSpotLight3 ) );
double fSpecular = GetDouble( rGeometryItem, "Specularity", 0, NULL ) / 100;
bool bMetal = GetBool( rGeometryItem, "Metal", false );
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index 053fbb0794f4..ca9526734cd3 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -778,15 +778,15 @@ void Svx3DLightControl::SetPosition(double fHor, double fVer)
switch(maSelectedLight)
{
- case 0: aSet.Put(Svx3DLightDirection1Item(aDirection)); break;
- case 1: aSet.Put(Svx3DLightDirection2Item(aDirection)); break;
- case 2: aSet.Put(Svx3DLightDirection3Item(aDirection)); break;
- case 3: aSet.Put(Svx3DLightDirection4Item(aDirection)); break;
- case 4: aSet.Put(Svx3DLightDirection5Item(aDirection)); break;
- case 5: aSet.Put(Svx3DLightDirection6Item(aDirection)); break;
- case 6: aSet.Put(Svx3DLightDirection7Item(aDirection)); break;
+ case 0: aSet.Put(makeSvx3DLightDirection1Item(aDirection)); break;
+ case 1: aSet.Put(makeSvx3DLightDirection2Item(aDirection)); break;
+ case 2: aSet.Put(makeSvx3DLightDirection3Item(aDirection)); break;
+ case 3: aSet.Put(makeSvx3DLightDirection4Item(aDirection)); break;
+ case 4: aSet.Put(makeSvx3DLightDirection5Item(aDirection)); break;
+ case 5: aSet.Put(makeSvx3DLightDirection6Item(aDirection)); break;
+ case 6: aSet.Put(makeSvx3DLightDirection7Item(aDirection)); break;
default:
- case 7: aSet.Put(Svx3DLightDirection8Item(aDirection)); break;
+ case 7: aSet.Put(makeSvx3DLightDirection8Item(aDirection)); break;
}
mpScene->SetMergedItemSet(aSet);
@@ -938,14 +938,14 @@ basegfx::B3DVector Svx3DLightControl::GetLightDirection(sal_uInt32 nNum) const
switch(nNum)
{
- case 0 : return ((const Svx3DLightDirection1Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue();
- case 1 : return ((const Svx3DLightDirection2Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue();
- case 2 : return ((const Svx3DLightDirection3Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue();
- case 3 : return ((const Svx3DLightDirection4Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue();
- case 4 : return ((const Svx3DLightDirection5Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue();
- case 5 : return ((const Svx3DLightDirection6Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue();
- case 6 : return ((const Svx3DLightDirection7Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue();
- case 7 : return ((const Svx3DLightDirection8Item&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue();
+ case 0 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue();
+ case 1 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue();
+ case 2 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue();
+ case 3 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue();
+ case 4 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue();
+ case 5 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue();
+ case 6 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue();
+ case 7 : return ((const SvxB3DVectorItem&)aLightItemSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue();
}
}
diff --git a/svx/source/engine3d/svx3ditems.cxx b/svx/source/engine3d/svx3ditems.cxx
index 35fa12823c46..82042652c3bf 100644
--- a/svx/source/engine3d/svx3ditems.cxx
+++ b/svx/source/engine3d/svx3ditems.cxx
@@ -85,38 +85,6 @@ Svx3DPerspectiveItem::Svx3DPerspectiveItem(sal_uInt16 nVal)
: SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE, nVal)
{}
-Svx3DLightDirection1Item::Svx3DLightDirection1Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_1, rVec)
-{}
-
-Svx3DLightDirection2Item::Svx3DLightDirection2Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_2, rVec)
-{}
-
-Svx3DLightDirection3Item::Svx3DLightDirection3Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_3, rVec)
-{}
-
-Svx3DLightDirection4Item::Svx3DLightDirection4Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_4, rVec)
-{}
-
-Svx3DLightDirection5Item::Svx3DLightDirection5Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_5, rVec)
-{}
-
-Svx3DLightDirection6Item::Svx3DLightDirection6Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_6, rVec)
-{}
-
-Svx3DLightDirection7Item::Svx3DLightDirection7Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_7, rVec)
-{}
-
-Svx3DLightDirection8Item::Svx3DLightDirection8Item(const basegfx::B3DVector& rVec)
-: SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_8, rVec)
-{}
-
Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal)
: SfxUInt16Item(SDRATTR_3DSCENE_SHADE_MODE, nVal)
{}
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 650b6d0c49a8..116b7e8cec4d 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -924,56 +924,56 @@ namespace drawinglayer
if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_1)).GetValue())
{
const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_1)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection1Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_1)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, true));
}
if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_2)).GetValue())
{
const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_2)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection2Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_2)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_3)).GetValue())
{
const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_3)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection3Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_3)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_4)).GetValue())
{
const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_4)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection4Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_4)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_5)).GetValue())
{
const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_5)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection5Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_5)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_6)).GetValue())
{
const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_6)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection6Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_6)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_7)).GetValue())
{
const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_7)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection7Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_7)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
if(((const SfxBoolItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTON_8)).GetValue())
{
const basegfx::BColor aColor(((const SvxColorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTCOLOR_8)).GetValue().getBColor());
- const basegfx::B3DVector aDirection(((const Svx3DLightDirection8Item&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue());
+ const basegfx::B3DVector aDirection(((const SvxB3DVectorItem&)rSet.Get(SDRATTR_3DSCENE_LIGHTDIRECTION_8)).GetValue());
aLightVector.push_back(attribute::Sdr3DLightAttribute(aColor, aDirection, false));
}
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index fd64fb05702d..bd78be8d33d4 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -293,14 +293,14 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_6 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_6, false);
mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_7 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_7, false);
mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTON_8 - SDRATTR_START ] = new SfxBoolItem(SDRATTR_3DSCENE_LIGHTON_8, false);
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_1 - SDRATTR_START ] = new Svx3DLightDirection1Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_2 - SDRATTR_START ] = new Svx3DLightDirection2Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_3 - SDRATTR_START ] = new Svx3DLightDirection3Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_4 - SDRATTR_START ] = new Svx3DLightDirection4Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_5 - SDRATTR_START ] = new Svx3DLightDirection5Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_6 - SDRATTR_START ] = new Svx3DLightDirection6Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_7 - SDRATTR_START ] = new Svx3DLightDirection7Item;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_8 - SDRATTR_START ] = new Svx3DLightDirection8Item;
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_1 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_1, basegfx::B3DVector(0.57735026918963, 0.57735026918963, 0.57735026918963));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_2 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_2, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_3 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_3, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_4 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_4, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_5 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_5, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_6 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_6, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_7 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_7, basegfx::B3DVector(0.0,0.0,1.0));
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTDIRECTION_8 - SDRATTR_START ] = new SvxB3DVectorItem(SDRATTR_3DSCENE_LIGHTDIRECTION_8, basegfx::B3DVector(0.0,0.0,1.0));
mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADOW_SLANT - SDRATTR_START ] = new SfxUInt16Item(SDRATTR_3DSCENE_SHADOW_SLANT, 0);
mppLocalPoolDefaults[ SDRATTR_3DSCENE_SHADE_MODE - SDRATTR_START ] = new Svx3DShadeModeItem;
mppLocalPoolDefaults[ SDRATTR_CUSTOMSHAPE_ENGINE - SDRATTR_START ] = new SdrCustomShapeEngineItem;