summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx114
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.cxx77
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeEngine.cxx3
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx4
4 files changed, 62 insertions, 136 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 8fee03473b8e..9f542539913b 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -442,28 +442,12 @@ bool EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle(
{
const com::sun::star::beans::PropertyValue& rPropVal = rHandleProperties[ i ];
- const OUString sPosition ( "Position" );
- const OUString sMirroredX ( "MirroredX" );
- const OUString sMirroredY ( "MirroredY" );
- const OUString sSwitched ( "Switched" );
- const OUString sPolar ( "Polar" );
- const OUString sRefX ( "RefX" );
- const OUString sRefY ( "RefY" );
- const OUString sRefAngle ( "RefAngle" );
- const OUString sRefR ( "RefR" );
- const OUString sRadiusRangeMinimum ( "RadiusRangeMinimum" );
- const OUString sRadiusRangeMaximum ( "RadiusRangeMaximum" );
- const OUString sRangeXMinimum ( "RangeXMinimum" );
- const OUString sRangeXMaximum ( "RangeXMaximum" );
- const OUString sRangeYMinimum ( "RangeYMinimum" );
- const OUString sRangeYMaximum ( "RangeYMaximum" );
-
- if ( rPropVal.Name == sPosition )
+ if ( rPropVal.Name == "Position" )
{
if ( rPropVal.Value >>= rDestinationHandle.aPosition )
bRetValue = true;
}
- else if ( rPropVal.Name == sMirroredX )
+ else if ( rPropVal.Name == "MirroredX" )
{
bool bMirroredX;
if ( rPropVal.Value >>= bMirroredX )
@@ -472,7 +456,7 @@ bool EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle(
rDestinationHandle.nFlags |= HANDLE_FLAGS_MIRRORED_X;
}
}
- else if ( rPropVal.Name == sMirroredY )
+ else if ( rPropVal.Name == "MirroredY" )
{
bool bMirroredY;
if ( rPropVal.Value >>= bMirroredY )
@@ -481,7 +465,7 @@ bool EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle(
rDestinationHandle.nFlags |= HANDLE_FLAGS_MIRRORED_Y;
}
}
- else if ( rPropVal.Name == sSwitched )
+ else if ( rPropVal.Name == "Switched" )
{
bool bSwitched;
if ( rPropVal.Value >>= bSwitched )
@@ -490,57 +474,57 @@ bool EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle(
rDestinationHandle.nFlags |= HANDLE_FLAGS_SWITCHED;
}
}
- else if ( rPropVal.Name == sPolar )
+ else if ( rPropVal.Name == "Polar" )
{
if ( rPropVal.Value >>= rDestinationHandle.aPolar )
rDestinationHandle.nFlags |= HANDLE_FLAGS_POLAR;
}
- else if ( rPropVal.Name == sRefX )
+ else if ( rPropVal.Name == "RefX" )
{
if ( rPropVal.Value >>= rDestinationHandle.nRefX )
rDestinationHandle.nFlags |= HANDLE_FLAGS_REFX;
}
- else if ( rPropVal.Name == sRefY )
+ else if ( rPropVal.Name == "RefY" )
{
if ( rPropVal.Value >>= rDestinationHandle.nRefY )
rDestinationHandle.nFlags |= HANDLE_FLAGS_REFY;
}
- else if ( rPropVal.Name == sRefAngle )
+ else if ( rPropVal.Name == "RefAngle" )
{
if ( rPropVal.Value >>= rDestinationHandle.nRefAngle )
rDestinationHandle.nFlags |= HANDLE_FLAGS_REFANGLE;
}
- else if ( rPropVal.Name == sRefR )
+ else if ( rPropVal.Name == "RefR" )
{
if ( rPropVal.Value >>= rDestinationHandle.nRefR )
rDestinationHandle.nFlags |= HANDLE_FLAGS_REFR;
}
- else if ( rPropVal.Name == sRadiusRangeMinimum )
+ else if ( rPropVal.Name == "RadiusRangeMinimum" )
{
if ( rPropVal.Value >>= rDestinationHandle.aRadiusRangeMinimum )
rDestinationHandle.nFlags |= HANDLE_FLAGS_RADIUS_RANGE_MINIMUM;
}
- else if ( rPropVal.Name == sRadiusRangeMaximum )
+ else if ( rPropVal.Name == "RadiusRangeMaximum" )
{
if ( rPropVal.Value >>= rDestinationHandle.aRadiusRangeMaximum )
rDestinationHandle.nFlags |= HANDLE_FLAGS_RADIUS_RANGE_MAXIMUM;
}
- else if ( rPropVal.Name == sRangeXMinimum )
+ else if ( rPropVal.Name == "RangeXMinimum" )
{
if ( rPropVal.Value >>= rDestinationHandle.aXRangeMinimum )
rDestinationHandle.nFlags |= HANDLE_FLAGS_RANGE_X_MINIMUM;
}
- else if ( rPropVal.Name == sRangeXMaximum )
+ else if ( rPropVal.Name == "RangeXMaximum" )
{
if ( rPropVal.Value >>= rDestinationHandle.aXRangeMaximum )
rDestinationHandle.nFlags |= HANDLE_FLAGS_RANGE_X_MAXIMUM;
}
- else if ( rPropVal.Name == sRangeYMinimum )
+ else if ( rPropVal.Name == "RangeYMinimum" )
{
if ( rPropVal.Value >>= rDestinationHandle.aYRangeMinimum )
rDestinationHandle.nFlags |= HANDLE_FLAGS_RANGE_Y_MINIMUM;
}
- else if ( rPropVal.Name == sRangeYMaximum )
+ else if ( rPropVal.Name == "RangeYMaximum" )
{
if ( rPropVal.Value >>= rDestinationHandle.aYRangeMaximum )
rDestinationHandle.nFlags |= HANDLE_FLAGS_RANGE_Y_MAXIMUM;
@@ -559,17 +543,13 @@ const sal_Int32* EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomSha
// AdjustmentValues
-
- const OUString sAdjustmentValues( "AdjustmentValues" );
- const Any* pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sAdjustmentValues );
+ const Any* pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "AdjustmentValues" );
if ( pAny )
*pAny >>= seqAdjustmentValues;
// Coordsize
-
- const OUString sViewBox( "ViewBox" );
- const Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sViewBox );
+ const Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "ViewBox" );
com::sun::star::awt::Rectangle aViewBox;
if ( pViewBox && (*pViewBox >>= aViewBox ) )
{
@@ -582,41 +562,31 @@ const sal_Int32* EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomSha
// Path/Coordinates
-
- const OUString sCoordinates( "Coordinates" );
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, sCoordinates );
+ pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "Coordinates" );
if ( pAny )
*pAny >>= seqCoordinates;
// Path/GluePoints
-
- const OUString sGluePoints( "GluePoints" );
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, sGluePoints );
+ pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "GluePoints" );
if ( pAny )
*pAny >>= seqGluePoints;
// Path/Segments
-
- const OUString sSegments( "Segments" );
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, sSegments );
+ pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "Segments" );
if ( pAny )
*pAny >>= seqSegments;
// Path/SubViewSize
-
- const OUString sSubViewSize( "SubViewSize" );
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, sSubViewSize );
+ pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "SubViewSize" );
if ( pAny )
*pAny >>= seqSubViewSize;
// Path/StretchX
-
- const OUString sStretchX( "StretchX" );
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, sStretchX );
+ pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "StretchX" );
if ( pAny )
{
sal_Int32 nStretchX = 0;
@@ -626,9 +596,7 @@ const sal_Int32* EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomSha
// Path/StretchY
-
- const OUString sStretchY( "StretchY" );
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, sStretchY );
+ pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "StretchY" );
if ( pAny )
{
sal_Int32 nStretchY = 0;
@@ -638,25 +606,19 @@ const sal_Int32* EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomSha
// Path/TextFrames
-
- const OUString sTextFrames( "TextFrames" );
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, sTextFrames );
+ pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sPath, "TextFrames" );
if ( pAny )
*pAny >>= seqTextFrames;
// Equations
-
- const OUString sEquations( "Equations" );
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sEquations );
+ pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "Equations" );
if ( pAny )
*pAny >>= seqEquations;
// Handles
-
- const OUString sHandles( "Handles" );
- pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sHandles );
+ pAny = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "Handles" );
if ( pAny )
*pAny >>= seqHandles;
@@ -759,13 +721,9 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
aP.Y() -= aS.Height() / 2;
aLogicRect = Rectangle( aP, aS );
- const OUString sType( "Type" );
- const OUString sMirroredX( "MirroredX" );
- const OUString sMirroredY( "MirroredY" );
-
OUString sShapeType;
SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)(const SdrCustomShapeGeometryItem&)pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
- Any* pAny = rGeometryItem.GetPropertyValueByName( sType );
+ Any* pAny = rGeometryItem.GetPropertyValueByName( "Type" );
if ( pAny ) {
*pAny >>= sShapeType;
bOOXMLShape = ( sShapeType.startsWith("ooxml-") );
@@ -773,10 +731,10 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) :
}
eSpType = EnhancedCustomShapeTypeNames::Get( sShapeType );
- pAny = rGeometryItem.GetPropertyValueByName( sMirroredX );
+ pAny = rGeometryItem.GetPropertyValueByName( "MirroredX" );
if ( pAny )
*pAny >>= bFlipH;
- pAny = rGeometryItem.GetPropertyValueByName( sMirroredY );
+ pAny = rGeometryItem.GetPropertyValueByName( "MirroredY" );
if ( pAny )
*pAny >>= bFlipV;
@@ -1378,9 +1336,8 @@ bool EnhancedCustomShape2d::SetHandleControllerPosition( const sal_uInt32 nIndex
// and writing them back into the GeometryItem
SdrCustomShapeGeometryItem aGeometryItem((SdrCustomShapeGeometryItem&)
(const SdrCustomShapeGeometryItem&)pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ));
- const OUString sAdjustmentValues( "AdjustmentValues" );
com::sun::star::beans::PropertyValue aPropVal;
- aPropVal.Name = sAdjustmentValues;
+ aPropVal.Name = "AdjustmentValues";
aPropVal.Value <<= seqAdjustmentValues;
aGeometryItem.SetPropertyValue( aPropVal );
pCustomShapeObj->SetMergedItem( aGeometryItem );
@@ -1607,10 +1564,9 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
if(seqCoordinates1 == seqCoordinates2)
bIsDefaultPath = true;
- const rtl::OUString sType( "Type" );
- rtl::OUString sShpType;
+ OUString sShpType;
SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)(const SdrCustomShapeGeometryItem&)pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
- Any* pAny = rGeometryItem.GetPropertyValueByName( sType );
+ Any* pAny = rGeometryItem.GetPropertyValueByName( "Type" );
if ( pAny )
*pAny >>= sShpType;
if( sShpType.getLength() > 3 &&
@@ -1630,9 +1586,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
_aCenter.Y() = nCoordHeight/2 * fYScale;
fWidth = nCoordWidth/2;
fHeight = nCoordHeight/2;
-
- const rtl::OUString sViewBox( "ViewBox" );
- const Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( sViewBox );
+ const Any* pViewBox = ((SdrCustomShapeGeometryItem&)rGeometryItem).GetPropertyValueByName( "ViewBox" );
com::sun::star::awt::Rectangle aViewBox;
if ( pViewBox && (*pViewBox >>= aViewBox ) )
{
@@ -1640,7 +1594,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm
aViewBox.Height = pDefCustomShape->nCoordHeight;
}
com::sun::star::beans::PropertyValue aPropVal;
- aPropVal.Name = sViewBox;
+ aPropVal.Name = "ViewBox";
aPropVal.Value <<= aViewBox;
rGeometryItem.SetPropertyValue( aPropVal );
pCustomShapeObj->SetMergedItem( rGeometryItem );
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 7608137a2546..779c9df0cd07 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -61,15 +61,12 @@
using namespace com::sun::star;
using namespace com::sun::star::uno;
-const char aExtrusion[] = "Extrusion";
-
namespace {
void GetOrigin( SdrCustomShapeGeometryItem& rItem, double& rOriginX, double& rOriginY )
{
::com::sun::star::drawing::EnhancedCustomShapeParameterPair aOriginParaPair;
- const OUString sOrigin( "Origin" );
- Any* pAny = rItem.GetPropertyValueByName( OUString(aExtrusion), sOrigin );
+ Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "Origin" );
if ( ! ( pAny && ( *pAny >>= aOriginParaPair ) && ( aOriginParaPair.First.Value >>= rOriginX ) && ( aOriginParaPair.Second.Value >>= rOriginY ) ) )
{
rOriginX = 0.50;
@@ -80,8 +77,7 @@ void GetOrigin( SdrCustomShapeGeometryItem& rItem, double& rOriginX, double& rOr
void GetRotateAngle( SdrCustomShapeGeometryItem& rItem, double& rAngleX, double& rAngleY )
{
::com::sun::star::drawing::EnhancedCustomShapeParameterPair aRotateAngleParaPair;
- const OUString sRotateAngle( "RotateAngle" );
- Any* pAny = rItem.GetPropertyValueByName( OUString(aExtrusion), sRotateAngle );
+ Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "RotateAngle" );
if ( ! ( pAny && ( *pAny >>= aRotateAngleParaPair ) && ( aRotateAngleParaPair.First.Value >>= rAngleX ) && ( aRotateAngleParaPair.Second.Value >>= rAngleY ) ) )
{
rAngleX = 0.0;
@@ -94,8 +90,7 @@ void GetRotateAngle( SdrCustomShapeGeometryItem& rItem, double& rAngleX, double&
void GetSkew( SdrCustomShapeGeometryItem& rItem, double& rSkewAmount, double& rSkewAngle )
{
::com::sun::star::drawing::EnhancedCustomShapeParameterPair aSkewParaPair;
- const OUString sSkew( "Skew" );
- Any* pAny = rItem.GetPropertyValueByName( OUString(aExtrusion), sSkew );
+ Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "Skew" );
if ( ! ( pAny && ( *pAny >>= aSkewParaPair ) && ( aSkewParaPair.First.Value >>= rSkewAmount ) && ( aSkewParaPair.Second.Value >>= rSkewAngle ) ) )
{
rSkewAmount = 50;
@@ -108,8 +103,7 @@ void GetExtrusionDepth( SdrCustomShapeGeometryItem& rItem, const double* pMap, d
{
::com::sun::star::drawing::EnhancedCustomShapeParameterPair aDepthParaPair;
double fDepth = 0, fFraction = 0;
- const OUString sDepth( "Depth" );
- Any* pAny = rItem.GetPropertyValueByName( OUString(aExtrusion), sDepth );
+ Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "Depth" );
if ( pAny && ( *pAny >>= aDepthParaPair ) && ( aDepthParaPair.First.Value >>= fDepth ) && ( aDepthParaPair.Second.Value >>= fFraction ) )
{
rForwardDepth = fDepth * fFraction;
@@ -131,7 +125,7 @@ void GetExtrusionDepth( SdrCustomShapeGeometryItem& rItem, const double* pMap, d
double GetDouble( SdrCustomShapeGeometryItem& rItem, const OUString& rPropertyName, double fDefault, const double* pMap )
{
double fRetValue = fDefault;
- Any* pAny = rItem.GetPropertyValueByName( OUString(aExtrusion), rPropertyName );
+ Any* pAny = rItem.GetPropertyValueByName( "Extrusion", rPropertyName );
if ( pAny )
*pAny >>= fRetValue;
if ( pMap )
@@ -142,8 +136,7 @@ double GetDouble( SdrCustomShapeGeometryItem& rItem, const OUString& rPropertyNa
drawing::ShadeMode GetShadeMode( SdrCustomShapeGeometryItem& rItem, const drawing::ShadeMode eDefault )
{
drawing::ShadeMode eRet( eDefault );
- const OUString sShadeMode( "ShadeMode" );
- Any* pAny = rItem.GetPropertyValueByName( OUString(aExtrusion), sShadeMode );
+ Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "ShadeMode" );
if ( pAny )
*pAny >>= eRet;
return eRet;
@@ -152,7 +145,7 @@ drawing::ShadeMode GetShadeMode( SdrCustomShapeGeometryItem& rItem, const drawin
bool GetBool( SdrCustomShapeGeometryItem& rItem, const OUString& rPropertyName, const bool bDefault )
{
bool bRetValue = bDefault;
- const Any* pAny = rItem.GetPropertyValueByName( OUString(aExtrusion), rPropertyName );
+ const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", rPropertyName );
if ( pAny )
*pAny >>= bRetValue;
return bRetValue;
@@ -162,7 +155,7 @@ drawing::Position3D GetPosition3D( SdrCustomShapeGeometryItem& rItem, const OUSt
const drawing::Position3D& rDefault, const double* pMap )
{
drawing::Position3D aRetValue( rDefault );
- const Any* pAny = rItem.GetPropertyValueByName( OUString(aExtrusion), rPropertyName );
+ const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", rPropertyName );
if ( pAny )
*pAny >>= aRetValue;
if ( pMap )
@@ -177,7 +170,7 @@ drawing::Position3D GetPosition3D( SdrCustomShapeGeometryItem& rItem, const OUSt
drawing::Direction3D GetDirection3D( SdrCustomShapeGeometryItem& rItem, const OUString& rPropertyName, const drawing::Direction3D& rDefault )
{
drawing::Direction3D aRetValue( rDefault );
- const Any* pAny = rItem.GetPropertyValueByName( OUString(aExtrusion), rPropertyName );
+ const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", rPropertyName );
if ( pAny )
*pAny >>= aRetValue;
return aRetValue;
@@ -196,8 +189,7 @@ EnhancedCustomShape3d::Transformation2D::Transformation2D( const SdrObject* pCus
, pMap( pM )
{
SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
- const OUString sProjectionMode( "ProjectionMode" );
- Any* pAny = rGeometryItem.GetPropertyValueByName( OUString(aExtrusion), sProjectionMode );
+ Any* pAny = rGeometryItem.GetPropertyValueByName( "Extrusion", "ProjectionMode" );
if ( pAny )
*pAny >>= eProjectionMode;
@@ -209,9 +201,8 @@ EnhancedCustomShape3d::Transformation2D::Transformation2D( const SdrObject* pCus
fOriginX = fOriginX * pCustomShape->GetLogicRect().GetWidth();
fOriginY = fOriginY * pCustomShape->GetLogicRect().GetHeight();
- const OUString sViewPoint( "ViewPoint" );
drawing::Position3D aViewPointDefault( 3472, -3472, 25000 );
- drawing::Position3D aViewPoint( GetPosition3D( rGeometryItem, sViewPoint, aViewPointDefault, pMap ) );
+ drawing::Position3D aViewPoint( GetPosition3D( rGeometryItem, "ViewPoint", aViewPointDefault, pMap ) );
fViewPoint.setX(aViewPoint.PositionX);
fViewPoint.setY(aViewPoint.PositionY);
fViewPoint.setZ(-aViewPoint.PositionZ);
@@ -285,7 +276,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
pMap = &fMap;
}
}
- if ( GetBool( rGeometryItem, aExtrusion, false ) )
+ if ( GetBool( rGeometryItem, "Extrusion", false ) )
{
bool bIsMirroredX = ((SdrObjCustomShape*)pCustomShape)->IsMirroredX();
bool bIsMirroredY = ((SdrObjCustomShape*)pCustomShape)->IsMirroredY();
@@ -326,8 +317,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
fDepth = 1.0;
drawing::ProjectionMode eProjectionMode( drawing::ProjectionMode_PARALLEL );
- const OUString sProjectionMode( "ProjectionMode" );
- Any* pAny = rGeometryItem.GetPropertyValueByName( aExtrusion, sProjectionMode );
+ Any* pAny = rGeometryItem.GetPropertyValueByName( "Extrusion", "ProjectionMode" );
if ( pAny )
*pAny >>= eProjectionMode;
ProjectionType eProjectionType( eProjectionMode == drawing::ProjectionMode_PARALLEL ? PR_PARALLEL : PR_PERSPECTIVE );
@@ -342,8 +332,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
bool bUseTwoFillStyles( false );
drawing::ShadeMode eShadeMode( GetShadeMode( rGeometryItem, drawing::ShadeMode_FLAT ) );
- const OUString aExtrusionColor( "Color" );
- bool bUseExtrusionColor = GetBool( rGeometryItem, aExtrusionColor, false );
+ bool bUseExtrusionColor = GetBool( rGeometryItem, "Color", false );
drawing::FillStyle eFillStyle( ITEMVALUE( aSet, XATTR_FILLSTYLE, XFillStyleItem ) );
pScene->GetProperties().SetObjectItem( Svx3DShadeModeItem( 0 ) );
@@ -649,9 +638,8 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
{
aNewTransform.translate( -fOriginX, fOriginY, 0.0 );
// now set correct camera position
- const OUString sViewPoint( "ViewPoint" );
drawing::Position3D aViewPointDefault( 3472, -3472, 25000 );
- drawing::Position3D aViewPoint( GetPosition3D( rGeometryItem, sViewPoint, aViewPointDefault, pMap ) );
+ drawing::Position3D aViewPoint( GetPosition3D( rGeometryItem, "ViewPoint", aViewPointDefault, pMap ) );
double fViewPointX = aViewPoint.PositionX;
double fViewPointY = aViewPoint.PositionY;
double fViewPointZ = aViewPoint.PositionZ;
@@ -666,36 +654,26 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
// light
+ double fAmbientIntensity = GetDouble( rGeometryItem, "Brightness", 22178.0 / 655.36, NULL ) / 100.0;
- const OUString sBrightness( "Brightness" );
- double fAmbientIntensity = GetDouble( rGeometryItem, sBrightness, 22178.0 / 655.36, NULL ) / 100.0;
-
-
- const OUString sFirstLightDirection( "FirstLightDirection" );
drawing::Direction3D aFirstLightDirectionDefault( 50000, 0, 10000 );
- drawing::Direction3D aFirstLightDirection( GetDirection3D( rGeometryItem, sFirstLightDirection, aFirstLightDirectionDefault ) );
+ drawing::Direction3D aFirstLightDirection( GetDirection3D( rGeometryItem, "FirstLightDirection", aFirstLightDirectionDefault ) );
if ( aFirstLightDirection.DirectionZ == 0.0 )
aFirstLightDirection.DirectionZ = 1.0;
- const OUString sFirstLightLevel( "FirstLightLevel" );
- double fLightIntensity = GetDouble( rGeometryItem, sFirstLightLevel, 43712.0 / 655.36, NULL ) / 100.0;
+ double fLightIntensity = GetDouble( rGeometryItem, "FirstLightLevel", 43712.0 / 655.36, NULL ) / 100.0;
- const OUString sFirstLightHarsh( "FirstLightHarsh" );
- /* sal_Bool bFirstLightHarsh = */ GetBool( rGeometryItem, sFirstLightHarsh, false );
+ /* sal_Bool bFirstLightHarsh = */ GetBool( rGeometryItem, "FirstLightHarsh", false );
- const OUString sSecondLightDirection( "SecondLightDirection" );
drawing::Direction3D aSecondLightDirectionDefault( -50000, 0, 10000 );
- drawing::Direction3D aSecondLightDirection( GetDirection3D( rGeometryItem, sSecondLightDirection, aSecondLightDirectionDefault ) );
+ drawing::Direction3D aSecondLightDirection( GetDirection3D( rGeometryItem, "SecondLightDirection", aSecondLightDirectionDefault ) );
if ( aSecondLightDirection.DirectionZ == 0.0 )
aSecondLightDirection.DirectionZ = -1;
- const OUString sSecondLightLevel( "SecondLightLevel" );
- double fLight2Intensity = GetDouble( rGeometryItem, sSecondLightLevel, 43712.0 / 655.36, NULL ) / 100.0;
+ double fLight2Intensity = GetDouble( rGeometryItem, "SecondLightLevel", 43712.0 / 655.36, NULL ) / 100.0;
- const OUString sSecondLightHarsh( "SecondLightHarsh" );
- const OUString sLightFace( "LightFace" );
- /* sal_Bool bLight2Harsh = */ GetBool( rGeometryItem, sSecondLightHarsh, false );
- /* sal_Bool bLightFace = */ GetBool( rGeometryItem, sLightFace, false );
+ /* sal_Bool bLight2Harsh = */ GetBool( rGeometryItem, "SecondLightHarsh", false );
+ /* sal_Bool bLightFace = */ GetBool( rGeometryItem, "LightFace", false );
sal_uInt16 nAmbientColor = (sal_uInt16)( fAmbientIntensity * 255.0 );
if ( nAmbientColor > 255 )
@@ -726,10 +704,8 @@ SdrObject* EnhancedCustomShape3d::Create3DObject( const SdrObject* pShape2d, con
pScene->GetProperties().SetObjectItem( Svx3DLightcolor3Item( aAmbientSpot3Color ) );
pScene->GetProperties().SetObjectItem( Svx3DLightDirection3Item( aSpotLight3 ) );
- const OUString sSpecularity( "Specularity" );
- const OUString sMetal( "Metal" );
- double fSpecular = GetDouble( rGeometryItem, sSpecularity, 0, NULL ) / 100;
- bool bMetal = GetBool( rGeometryItem, sMetal, false );
+ double fSpecular = GetDouble( rGeometryItem, "Specularity", 0, NULL ) / 100;
+ bool bMetal = GetBool( rGeometryItem, "Metal", false );
Color aSpecularCol( 225,225,225 );
if ( bMetal )
@@ -784,9 +760,8 @@ Rectangle EnhancedCustomShape3d::CalculateNewSnapRect( const SdrObject* pCustomS
aBoundVolume.append(basegfx::B3DPoint(aPolygon[ (sal_uInt16)i ].X() - aCenter.X(), aPolygon[ (sal_uInt16)i ].Y() - aCenter.Y(), fExtrusionBackward));
}
- const OUString sRotationCenter( "RotationCenter" );
drawing::Direction3D aRotationCenterDefault( 0, 0, 0 ); // default seems to be wrong, a fractional size of shape has to be used!!
- drawing::Direction3D aRotationCenter( GetDirection3D( rGeometryItem, sRotationCenter, aRotationCenterDefault ) );
+ drawing::Direction3D aRotationCenter( GetDirection3D( rGeometryItem, "RotationCenter", aRotationCenterDefault ) );
double fXRotate, fYRotate;
GetRotateAngle( rGeometryItem, fXRotate, fYRotate );
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index 33399569c2b2..6175f6e405b1 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -282,8 +282,7 @@ Reference< drawing::XShape > SAL_CALL EnhancedCustomShapeEngine::render()
SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)
pSdrObjCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
bool bTextPathOn = false;
- const OUString sTextPath( "TextPath" );
- uno::Any* pAny = rGeometryItem.GetPropertyValueByName( sTextPath, sTextPath );
+ uno::Any* pAny = rGeometryItem.GetPropertyValueByName( "TextPath", "TextPath" );
if ( pAny )
*pAny >>= bTextPathOn;
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index f46a514946af..3b8a988cf0d0 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -425,9 +425,7 @@ void GetFontWorkOutline( FWData& rFWData, const SdrObject* pCustomShape )
bool bSameLetterHeights = false;
SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
- const OUString sTextPath( "TextPath" );
- const OUString sSameLetterHeights( "SameLetterHeights" );
- com::sun::star::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( sTextPath, sSameLetterHeights );
+ com::sun::star::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( "TextPath", "SameLetterHeights" );
if ( pAny )
*pAny >>= bSameLetterHeights;