summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-09-01 13:37:27 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-09-01 13:37:27 +0200
commitbebe30e917ebd3bd0ce43efca737caa478fddaee (patch)
tree1e0f3f4573ccd4d65d0e0264e8675f1e51463d63 /svx
parent407d23baceaf7014d24d631ad308c9defd4d44d0 (diff)
Consistency around SfxUInt32Item in svx/svx3ditems.hxx
...similar to what has been done for svx/sdtmfitm.hxx in 68969cc61adecac481ae9656978ef952f435b310 "Consistency around SdrMetricItem." Change-Id: I3193eab34a34c051002adeedd8b368e26f55f7a3
Diffstat (limited to 'svx')
-rw-r--r--svx/source/engine3d/extrud3d.cxx2
-rw-r--r--svx/source/engine3d/float3d.cxx24
-rw-r--r--svx/source/engine3d/lathe3d.cxx4
-rw-r--r--svx/source/engine3d/svx3ditems.cxx24
-rw-r--r--svx/source/engine3d/view3d1.cxx4
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx2
-rw-r--r--svx/source/sdr/properties/e3dsceneproperties.cxx4
-rw-r--r--svx/source/svdraw/svdattr.cxx12
-rw-r--r--svx/source/unodraw/unoshap3.cxx2
9 files changed, 27 insertions, 51 deletions
diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx
index 9219be678c8d..fbab7730d9f0 100644
--- a/svx/source/engine3d/extrud3d.cxx
+++ b/svx/source/engine3d/extrud3d.cxx
@@ -72,7 +72,7 @@ E3dExtrudeObj::E3dExtrudeObj(E3dDefaultAttributes& rDefault, const basegfx::B2DP
SetDefaultAttributes(rDefault);
// set extrude depth
- GetProperties().SetObjectItemDirect(Svx3DDepthItem((sal_uInt32)(fDepth + 0.5)));
+ GetProperties().SetObjectItemDirect(makeSvx3DDepthItem((sal_uInt32)(fDepth + 0.5)));
}
E3dExtrudeObj::E3dExtrudeObj()
diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx
index d0c259ded1d8..e37855f50eb1 100644
--- a/svx/source/engine3d/float3d.cxx
+++ b/svx/source/engine3d/float3d.cxx
@@ -632,7 +632,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_HORZ_SEGS);
if(eState != SFX_ITEM_DONTCARE)
{
- sal_uInt32 nValue = ((const Svx3DHorizontalSegmentsItem&)rAttrs.Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue();
+ sal_uInt32 nValue = ((const SfxUInt32Item&)rAttrs.Get(SDRATTR_3DOBJ_HORZ_SEGS)).GetValue();
if(nValue != (sal_uInt32 )aNumHorizontal.GetValue())
{
aNumHorizontal.SetValue( nValue );
@@ -657,7 +657,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_VERT_SEGS);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_uInt32 nValue = ((const Svx3DVerticalSegmentsItem&)rAttrs.Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue();
+ sal_uInt32 nValue = ((const SfxUInt32Item&)rAttrs.Get(SDRATTR_3DOBJ_VERT_SEGS)).GetValue();
if( nValue != (sal_uInt32) aNumVertical.GetValue() )
{
aNumVertical.SetValue( nValue );
@@ -682,7 +682,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_DEPTH);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_uInt32 nValue = ((const Svx3DDepthItem&)rAttrs.Get(SDRATTR_3DOBJ_DEPTH)).GetValue();
+ sal_uInt32 nValue = ((const SfxUInt32Item&)rAttrs.Get(SDRATTR_3DOBJ_DEPTH)).GetValue();
sal_uInt32 nValue2 = GetCoreValue( aMtrDepth, ePoolUnit );
if( nValue != nValue2 )
{
@@ -783,7 +783,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DOBJ_END_ANGLE);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_Int32 nValue = ((const Svx3DEndAngleItem&)rAttrs.Get(SDRATTR_3DOBJ_END_ANGLE)).GetValue();
+ sal_Int32 nValue = ((const SfxUInt32Item&)rAttrs.Get(SDRATTR_3DOBJ_END_ANGLE)).GetValue();
if( nValue != aMtrEndAngle.GetValue() )
{
aMtrEndAngle.SetValue( nValue );
@@ -942,7 +942,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_DISTANCE);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_uInt32 nValue = ((const Svx3DDistanceItem&)rAttrs.Get(SDRATTR_3DSCENE_DISTANCE)).GetValue();
+ sal_uInt32 nValue = ((const SfxUInt32Item&)rAttrs.Get(SDRATTR_3DSCENE_DISTANCE)).GetValue();
sal_uInt32 nValue2 = GetCoreValue( aMtrDistance, ePoolUnit );
if( nValue != nValue2 )
{
@@ -966,7 +966,7 @@ void Svx3DWin::Update( SfxItemSet& rAttrs )
eState = rAttrs.GetItemState(SDRATTR_3DSCENE_FOCAL_LENGTH);
if( eState != SFX_ITEM_DONTCARE )
{
- sal_uInt32 nValue = ((const Svx3DFocalLengthItem&)rAttrs.Get(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue();
+ sal_uInt32 nValue = ((const SfxUInt32Item&)rAttrs.Get(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue();
sal_uInt32 nValue2 = GetCoreValue( aMtrFocalLength, ePoolUnit );
if( nValue != nValue2 )
{
@@ -1756,7 +1756,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( !aNumHorizontal.IsEmptyFieldValue() )
{
sal_uInt32 nValue = static_cast<sal_uInt32>(aNumHorizontal.GetValue());
- rAttrs.Put(Svx3DHorizontalSegmentsItem(nValue));
+ rAttrs.Put(makeSvx3DHorizontalSegmentsItem(nValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_HORZ_SEGS);
@@ -1765,7 +1765,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( !aNumVertical.IsEmptyFieldValue() )
{
sal_uInt32 nValue = static_cast<sal_uInt32>(aNumVertical.GetValue());
- rAttrs.Put(Svx3DVerticalSegmentsItem(nValue));
+ rAttrs.Put(makeSvx3DVerticalSegmentsItem(nValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_VERT_SEGS);
@@ -1774,7 +1774,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( !aMtrDepth.IsEmptyFieldValue() )
{
sal_uInt32 nValue = GetCoreValue( aMtrDepth, ePoolUnit );
- rAttrs.Put(Svx3DDepthItem(nValue));
+ rAttrs.Put(makeSvx3DDepthItem(nValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_DEPTH);
@@ -1811,7 +1811,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( !aMtrEndAngle.IsEmptyFieldValue() )
{
sal_uInt16 nValue = (sal_uInt16)aMtrEndAngle.GetValue();
- rAttrs.Put(Svx3DEndAngleItem(nValue));
+ rAttrs.Put(makeSvx3DEndAngleItem(nValue));
}
else
rAttrs.InvalidateItem(SDRATTR_3DOBJ_END_ANGLE);
@@ -1887,7 +1887,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( !aMtrDistance.IsEmptyFieldValue() )
{
sal_uInt32 nValue2 = GetCoreValue( aMtrDistance, ePoolUnit );
- rAttrs.Put(Svx3DDistanceItem(nValue2));
+ rAttrs.Put(makeSvx3DDistanceItem(nValue2));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_DISTANCE);
@@ -1896,7 +1896,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs )
if( !aMtrFocalLength.IsEmptyFieldValue() )
{
sal_uInt32 nValue2 = GetCoreValue( aMtrFocalLength, ePoolUnit );
- rAttrs.Put(Svx3DFocalLengthItem(nValue2));
+ rAttrs.Put(makeSvx3DFocalLengthItem(nValue2));
}
else
rAttrs.InvalidateItem(SDRATTR_3DSCENE_FOCAL_LENGTH);
diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx
index 939e947bd752..1950a7ec954b 100644
--- a/svx/source/engine3d/lathe3d.cxx
+++ b/svx/source/engine3d/lathe3d.cxx
@@ -82,7 +82,7 @@ E3dLatheObj::E3dLatheObj(E3dDefaultAttributes& rDefault, const basegfx::B2DPolyP
nSegCnt -= 1;
}
- GetProperties().SetObjectItemDirect(Svx3DVerticalSegmentsItem(nSegCnt));
+ GetProperties().SetObjectItemDirect(makeSvx3DVerticalSegmentsItem(nSegCnt));
}
}
@@ -139,7 +139,7 @@ void E3dLatheObj::SetPolyPoly2D(const basegfx::B2DPolyPolygon& rNew)
nSegCnt -= 1;
}
- GetProperties().SetObjectItemDirect(Svx3DVerticalSegmentsItem(nSegCnt));
+ GetProperties().SetObjectItemDirect(makeSvx3DVerticalSegmentsItem(nSegCnt));
}
ActionChanged();
diff --git a/svx/source/engine3d/svx3ditems.cxx b/svx/source/engine3d/svx3ditems.cxx
index 68ca6f81da01..ee743cfb1568 100644
--- a/svx/source/engine3d/svx3ditems.cxx
+++ b/svx/source/engine3d/svx3ditems.cxx
@@ -40,22 +40,6 @@ Svx3DBackscaleItem::Svx3DBackscaleItem(sal_uInt16 nVal)
: SfxUInt16Item(SDRATTR_3DOBJ_BACKSCALE, nVal)
{}
-Svx3DDepthItem::Svx3DDepthItem(sal_uInt32 nVal)
-: SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, nVal)
-{}
-
-Svx3DHorizontalSegmentsItem::Svx3DHorizontalSegmentsItem(sal_uInt32 nVal)
-: SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, nVal)
-{}
-
-Svx3DVerticalSegmentsItem::Svx3DVerticalSegmentsItem(sal_uInt32 nVal)
-: SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, nVal)
-{}
-
-Svx3DEndAngleItem::Svx3DEndAngleItem(sal_uInt32 nVal)
-: SfxUInt32Item(SDRATTR_3DOBJ_END_ANGLE, nVal)
-{}
-
Svx3DDoubleSidedItem::Svx3DDoubleSidedItem(bool bVal)
: SfxBoolItem(SDRATTR_3DOBJ_DOUBLE_SIDED, bVal)
{}
@@ -140,14 +124,6 @@ Svx3DPerspectiveItem::Svx3DPerspectiveItem(sal_uInt16 nVal)
: SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE, nVal)
{}
-Svx3DDistanceItem::Svx3DDistanceItem(sal_uInt32 nVal)
-: SfxUInt32Item(SDRATTR_3DSCENE_DISTANCE, nVal)
-{}
-
-Svx3DFocalLengthItem::Svx3DFocalLengthItem(sal_uInt32 nVal)
-: SfxUInt32Item(SDRATTR_3DSCENE_FOCAL_LENGTH, nVal)
-{}
-
Svx3DTwoSidedLightingItem::Svx3DTwoSidedLightingItem(bool bVal)
: SfxBoolItem(SDRATTR_3DSCENE_TWO_SIDED_LIGHTING, bVal)
{}
diff --git a/svx/source/engine3d/view3d1.cxx b/svx/source/engine3d/view3d1.cxx
index 414faa5f7e5d..6dd827d34e08 100644
--- a/svx/source/engine3d/view3d1.cxx
+++ b/svx/source/engine3d/view3d1.cxx
@@ -142,8 +142,8 @@ SfxItemSet E3dView::Get3DAttributes(E3dScene* pInScene, bool /*bOnly3DAttr*/) co
aSet.Put(XLineStyleItem (XLINE_NONE));
// new defaults for distance and focal length
- aSet.Put(Svx3DDistanceItem(100));
- aSet.Put(Svx3DFocalLengthItem(10000));
+ aSet.Put(makeSvx3DDistanceItem(100));
+ aSet.Put(makeSvx3DFocalLengthItem(10000));
}
// return ItemSet
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 47019b7caa3e..bcb6495270ae 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -888,7 +888,7 @@ namespace drawinglayer
}
// get distance
- const double fDistance(((const Svx3DDistanceItem&)rSet.Get(SDRATTR_3DSCENE_DISTANCE)).GetValue());
+ const double fDistance(((const SfxUInt32Item&)rSet.Get(SDRATTR_3DSCENE_DISTANCE)).GetValue());
// get shadow slant
const double fShadowSlant(F_PI180 * ((const Svx3DShadowSlantItem&)rSet.Get(SDRATTR_3DSCENE_SHADOW_SLANT)).GetValue());
diff --git a/svx/source/sdr/properties/e3dsceneproperties.cxx b/svx/source/sdr/properties/e3dsceneproperties.cxx
index 48dff578d838..9005d4842390 100644
--- a/svx/source/sdr/properties/e3dsceneproperties.cxx
+++ b/svx/source/sdr/properties/e3dsceneproperties.cxx
@@ -310,10 +310,10 @@ namespace sdr
mpItemSet->Put(Svx3DPerspectiveItem((sal_uInt16)aSceneCam.GetProjection()));
// CamPos
- mpItemSet->Put(Svx3DDistanceItem((sal_uInt32)(aSceneCam.GetPosition().getZ() + 0.5)));
+ mpItemSet->Put(makeSvx3DDistanceItem((sal_uInt32)(aSceneCam.GetPosition().getZ() + 0.5)));
// FocalLength
- mpItemSet->Put(Svx3DFocalLengthItem((sal_uInt32)((aSceneCam.GetFocalLength() * 100.0) + 0.5)));
+ mpItemSet->Put(makeSvx3DFocalLengthItem((sal_uInt32)((aSceneCam.GetFocalLength() * 100.0) + 0.5)));
}
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 4dd3f7799579..228398c20470 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -249,10 +249,10 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[ SDRATTR_GRAFCROP - SDRATTR_START] = new SdrGrafCropItem;
mppLocalPoolDefaults[ SDRATTR_3DOBJ_PERCENT_DIAGONAL - SDRATTR_START ] = new Svx3DPercentDiagonalItem;
mppLocalPoolDefaults[ SDRATTR_3DOBJ_BACKSCALE - SDRATTR_START ] = new Svx3DBackscaleItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_DEPTH - SDRATTR_START ] = new Svx3DDepthItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_HORZ_SEGS - SDRATTR_START ] = new Svx3DHorizontalSegmentsItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_VERT_SEGS - SDRATTR_START ] = new Svx3DVerticalSegmentsItem;
- mppLocalPoolDefaults[ SDRATTR_3DOBJ_END_ANGLE - SDRATTR_START ] = new Svx3DEndAngleItem;
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_DEPTH - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_DEPTH, 1000);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_HORZ_SEGS - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_HORZ_SEGS, 24);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_VERT_SEGS - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_VERT_SEGS, 24);
+ mppLocalPoolDefaults[ SDRATTR_3DOBJ_END_ANGLE - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DOBJ_END_ANGLE, 3600);
mppLocalPoolDefaults[ SDRATTR_3DOBJ_DOUBLE_SIDED - SDRATTR_START ] = new Svx3DDoubleSidedItem;
mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_KIND - SDRATTR_START ] = new Svx3DNormalsKindItem;
mppLocalPoolDefaults[ SDRATTR_3DOBJ_NORMALS_INVERT - SDRATTR_START ] = new Svx3DNormalsInvertItem;
@@ -273,8 +273,8 @@ SdrItemPool::SdrItemPool(
mppLocalPoolDefaults[ SDRATTR_3DOBJ_CLOSE_BACK - SDRATTR_START ] = new Svx3DCloseBackItem;
mppLocalPoolDefaults[ SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY - SDRATTR_START ] = new Svx3DReducedLineGeometryItem;
mppLocalPoolDefaults[ SDRATTR_3DSCENE_PERSPECTIVE - SDRATTR_START ] = new Svx3DPerspectiveItem;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_DISTANCE - SDRATTR_START ] = new Svx3DDistanceItem;
- mppLocalPoolDefaults[ SDRATTR_3DSCENE_FOCAL_LENGTH - SDRATTR_START ] = new Svx3DFocalLengthItem;
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_DISTANCE - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DSCENE_DISTANCE, 100);
+ mppLocalPoolDefaults[ SDRATTR_3DSCENE_FOCAL_LENGTH - SDRATTR_START ] = new SfxUInt32Item(SDRATTR_3DSCENE_FOCAL_LENGTH, 100);
mppLocalPoolDefaults[ SDRATTR_3DSCENE_TWO_SIDED_LIGHTING - SDRATTR_START ] = new Svx3DTwoSidedLightingItem;
mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_1 - SDRATTR_START ] = new Svx3DLightcolor1Item;
mppLocalPoolDefaults[ SDRATTR_3DSCENE_LIGHTCOLOR_2 - SDRATTR_START ] = new Svx3DLightcolor2Item;
diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx
index 309b98c9cedb..3891eb8f006b 100644
--- a/svx/source/unodraw/unoshap3.cxx
+++ b/svx/source/unodraw/unoshap3.cxx
@@ -840,7 +840,7 @@ bool Svx3DLatheObject::setPropertyValueImpl( const OUString& rName, const SfxIte
if(nPrevVerticalSegs != nPostVerticalSegs)
{
// restore the vertical segment count
- static_cast<E3dLatheObj*>(mpObj.get())->SetMergedItem(Svx3DVerticalSegmentsItem(nPrevVerticalSegs));
+ static_cast<E3dLatheObj*>(mpObj.get())->SetMergedItem(makeSvx3DVerticalSegmentsItem(nPrevVerticalSegs));
}
return true;
}