diff options
57 files changed, 610 insertions, 583 deletions
diff --git a/include/svx/sdasitm.hxx b/include/svx/sdasitm.hxx index 42c092074106..5255bcd19ed9 100644 --- a/include/svx/sdasitm.hxx +++ b/include/svx/sdasitm.hxx @@ -97,6 +97,7 @@ private: com::sun::star::uno::Any* GetPropertyValueByName( const OUString& rPropName ); const com::sun::star::uno::Any* GetPropertyValueByName( const OUString& rPropName ) const; com::sun::star::uno::Any* GetPropertyValueByName( const OUString& rPropName, const OUString& rPropName2 ); + const com::sun::star::uno::Any* GetPropertyValueByName( const OUString& rPropName, const OUString& rPropName2 ) const; void SetPropertyValue( const com::sun::star::beans::PropertyValue& rPropVal ); void SetPropertyValue( const OUString& rSequenceName, const com::sun::star::beans::PropertyValue& rPropVal ); diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx index 751f13fad30e..eae790d0cd5f 100644 --- a/svx/source/items/customshapeitem.cxx +++ b/svx/source/items/customshapeitem.cxx @@ -97,6 +97,26 @@ com::sun::star::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( co return pRet; } +const com::sun::star::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( const OUString& rSequenceName, const OUString& rPropName ) const +{ + const com::sun::star::uno::Any* pRet = NULL; + const com::sun::star::uno::Any* pSeqAny = GetPropertyValueByName( rSequenceName ); + if ( pSeqAny ) + { + if ( pSeqAny->getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < beans::PropertyValue >*)0) ) + { + PropertyPairHashMap::const_iterator aHashIter( aPropPairHashMap.find( PropertyPair( rSequenceName, rPropName ) ) ); + if ( aHashIter != aPropPairHashMap.end() ) + { + ::com::sun::star::uno::Sequence < beans::PropertyValue >& rSecSequence = + *((::com::sun::star::uno::Sequence < beans::PropertyValue >*)pSeqAny->getValue()); + pRet = &rSecSequence[ (*aHashIter).second ].Value; + } + } + } + return pRet; +} + void SdrCustomShapeGeometryItem::SetPropertyValue( const com::sun::star::beans::PropertyValue& rPropVal ) { com::sun::star::uno::Any* pAny = GetPropertyValueByName( rPropVal.Name ); diff --git a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx index d73f5c044990..54b335b7a013 100644 --- a/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx +++ b/svx/source/sdr/primitive3d/sdrattributecreator3d.cxx @@ -38,7 +38,7 @@ namespace drawinglayer { // get NormalsKind ::com::sun::star::drawing::NormalsKind aNormalsKind(::com::sun::star::drawing::NormalsKind_SPECIFIC); - const sal_uInt16 nNormalsValue(((const Svx3DNormalsKindItem&)rSet.Get(SDRATTR_3DOBJ_NORMALS_KIND)).GetValue()); + const sal_uInt16 nNormalsValue(static_cast<const Svx3DNormalsKindItem&>(rSet.Get(SDRATTR_3DOBJ_NORMALS_KIND)).GetValue()); if(1L == nNormalsValue) { @@ -50,11 +50,11 @@ namespace drawinglayer } // get NoermalsInvert flag - const bool bInvertNormals(((const SfxBoolItem&)rSet.Get(SDRATTR_3DOBJ_NORMALS_INVERT)).GetValue()); + const bool bInvertNormals(static_cast<const SfxBoolItem&>(rSet.Get(SDRATTR_3DOBJ_NORMALS_INVERT)).GetValue()); // get TextureProjectionX ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionX(::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC); - const sal_uInt16 nTextureValueX(((const Svx3DTextureProjectionXItem&)rSet.Get(SDRATTR_3DOBJ_TEXTURE_PROJ_X)).GetValue()); + const sal_uInt16 nTextureValueX(static_cast<const Svx3DTextureProjectionXItem&>(rSet.Get(SDRATTR_3DOBJ_TEXTURE_PROJ_X)).GetValue()); if(1L == nTextureValueX) { @@ -67,7 +67,7 @@ namespace drawinglayer // get TextureProjectionY ::com::sun::star::drawing::TextureProjectionMode aTextureProjectionY(::com::sun::star::drawing::TextureProjectionMode_OBJECTSPECIFIC); - const sal_uInt16 nTextureValueY(((const Svx3DTextureProjectionYItem&)rSet.Get(SDRATTR_3DOBJ_TEXTURE_PROJ_Y)).GetValue()); + const sal_uInt16 nTextureValueY(static_cast<const Svx3DTextureProjectionYItem&>(rSet.Get(SDRATTR_3DOBJ_TEXTURE_PROJ_Y)).GetValue()); if(1L == nTextureValueY) { @@ -79,18 +79,18 @@ namespace drawinglayer } // get DoubleSided flag - const bool bDoubleSided(((const SfxBoolItem&)rSet.Get(SDRATTR_3DOBJ_DOUBLE_SIDED)).GetValue()); + const bool bDoubleSided(static_cast<const SfxBoolItem&>(rSet.Get(SDRATTR_3DOBJ_DOUBLE_SIDED)).GetValue()); // get Shadow3D flag - const bool bShadow3D(((const SfxBoolItem&)rSet.Get(SDRATTR_3DOBJ_SHADOW_3D)).GetValue()); + const bool bShadow3D(static_cast<const SfxBoolItem&>(rSet.Get(SDRATTR_3DOBJ_SHADOW_3D)).GetValue()); // get TextureFilter flag - const bool bTextureFilter(((const SfxBoolItem&)rSet.Get(SDRATTR_3DOBJ_TEXTURE_FILTER)).GetValue()); + const bool bTextureFilter(static_cast<const SfxBoolItem&>(rSet.Get(SDRATTR_3DOBJ_TEXTURE_FILTER)).GetValue()); // get texture kind // TextureKind: 1 == Base3DTextureLuminance, 2 == Base3DTextureIntensity, 3 == Base3DTextureColor ::com::sun::star::drawing::TextureKind2 aTextureKind(::com::sun::star::drawing::TextureKind2_LUMINANCE); - const sal_uInt16 nTextureKind(((const Svx3DTextureKindItem&)rSet.Get(SDRATTR_3DOBJ_TEXTURE_KIND)).GetValue()); + const sal_uInt16 nTextureKind(static_cast<const Svx3DTextureKindItem&>(rSet.Get(SDRATTR_3DOBJ_TEXTURE_KIND)).GetValue()); if(2 == nTextureKind) { @@ -104,7 +104,7 @@ namespace drawinglayer // get texture mode // TextureMode: 1 == Base3DTextureReplace, 2 == Base3DTextureModulate, 3 == Base3DTextureBlend ::com::sun::star::drawing::TextureMode aTextureMode(::com::sun::star::drawing::TextureMode_REPLACE); - const sal_uInt16 nTextureMode(((const Svx3DTextureModeItem&)rSet.Get(SDRATTR_3DOBJ_TEXTURE_MODE)).GetValue()); + const sal_uInt16 nTextureMode(static_cast<const Svx3DTextureModeItem&>(rSet.Get(SDRATTR_3DOBJ_TEXTURE_MODE)).GetValue()); if(2 == nTextureMode) { @@ -116,16 +116,16 @@ namespace drawinglayer } // get object color - const ::basegfx::BColor aObjectColor(((const XFillColorItem&)rSet.Get(XATTR_FILLCOLOR)).GetColorValue().getBColor()); + const ::basegfx::BColor aObjectColor(static_cast<const XFillColorItem&>(rSet.Get(XATTR_FILLCOLOR)).GetColorValue().getBColor()); // get specular color - const ::basegfx::BColor aSpecular(((const SvxColorItem&)rSet.Get(SDRATTR_3DOBJ_MAT_SPECULAR)).GetValue().getBColor()); + const ::basegfx::BColor aSpecular(static_cast<const SvxColorItem&>(rSet.Get(SDRATTR_3DOBJ_MAT_SPECULAR)).GetValue().getBColor()); // get emissive color - const ::basegfx::BColor aEmission(((const SvxColorItem&)rSet.Get(SDRATTR_3DOBJ_MAT_EMISSION)).GetValue().getBColor()); + const ::basegfx::BColor aEmission(static_cast<const SvxColorItem&>(rSet.Get(SDRATTR_3DOBJ_MAT_EMISSION)).GetValue().getBColor()); // get specular intensity - sal_uInt16 nSpecularIntensity(((const SfxUInt16Item&)rSet.Get(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY)).GetValue()); + sal_uInt16 nSpecularIntensity(static_cast<const SfxUInt16Item&>(rSet.Get(SDRATTR_3DOBJ_MAT_SPECULAR_INTENSITY)).GetValue()); if(nSpecularIntensity > 128) { @@ -133,7 +133,7 @@ namespace drawinglayer } // get reduced line geometry - const bool bReducedLineGeometry(((const Svx3DReducedLineGeometryItem&)rSet.Get(SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY)).GetValue()); + const bool bReducedLineGeometry(static_cast<const Svx3DReducedLineGeometryItem&>(rSet.Get(SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY)).GetValue()); // prepare material attribute::MaterialAttribute3D aMaterial(aObjectColor, aSpecular, aEmission, nSpecularIntensity); diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx index c2a113553f1c..bd5a824cf2a1 100644 --- a/svx/source/sdr/properties/attributeproperties.cxx +++ b/svx/source/sdr/properties/attributeproperties.cxx @@ -172,38 +172,38 @@ namespace sdr { case XATTR_FILLBITMAP: { - pResultItem = ((XFillBitmapItem*)pNewItem)->checkForUniqueItem( pModel ); + pResultItem = static_cast<const XFillBitmapItem*>(pNewItem)->checkForUniqueItem( pModel ); break; } case XATTR_LINEDASH: { - pResultItem = ((XLineDashItem*)pNewItem)->checkForUniqueItem( pModel ); + pResultItem = static_cast<const XLineDashItem*>(pNewItem)->checkForUniqueItem( pModel ); break; } case XATTR_LINESTART: { - pResultItem = ((XLineStartItem*)pNewItem)->checkForUniqueItem( pModel ); + pResultItem = static_cast<const XLineStartItem*>(pNewItem)->checkForUniqueItem( pModel ); break; } case XATTR_LINEEND: { - pResultItem = ((XLineEndItem*)pNewItem)->checkForUniqueItem( pModel ); + pResultItem = static_cast<const XLineEndItem*>(pNewItem)->checkForUniqueItem( pModel ); break; } case XATTR_FILLGRADIENT: { - pResultItem = ((XFillGradientItem*)pNewItem)->checkForUniqueItem( pModel ); + pResultItem = static_cast<const XFillGradientItem*>(pNewItem)->checkForUniqueItem( pModel ); break; } case XATTR_FILLFLOATTRANSPARENCE: { // #85953# allow all kinds of XFillFloatTransparenceItem to be set - pResultItem = ((XFillFloatTransparenceItem*)pNewItem)->checkForUniqueItem( pModel ); + pResultItem = static_cast<const XFillFloatTransparenceItem*>(pNewItem)->checkForUniqueItem( pModel ); break; } case XATTR_FILLHATCH: { - pResultItem = ((XFillHatchItem*)pNewItem)->checkForUniqueItem( pModel ); + pResultItem = static_cast<const XFillHatchItem*>(pNewItem)->checkForUniqueItem( pModel ); break; } } @@ -405,7 +405,7 @@ namespace sdr if(GetStyleSheet() != pForThisObject) { ImpRemoveStyleSheet(); - ImpAddStyleSheet((SfxStyleSheet*)pForThisObject, true); + ImpAddStyleSheet(static_cast<SfxStyleSheet*>(pForThisObject), true); } } else @@ -557,8 +557,8 @@ namespace sdr { if(HAS_BASE(SfxStyleSheet, GetStyleSheet())) { - pNewStSh = (SfxStyleSheet*)pModel->GetStyleSheetPool()->Find( - GetStyleSheet()->GetParent(), GetStyleSheet()->GetFamily()); + pNewStSh = static_cast<SfxStyleSheet*>(pModel->GetStyleSheetPool()->Find( + GetStyleSheet()->GetParent(), GetStyleSheet()->GetFamily())); } if(!pNewStSh) diff --git a/svx/source/sdr/properties/captionproperties.cxx b/svx/source/sdr/properties/captionproperties.cxx index b0900afa35a3..288069e8f186 100644 --- a/svx/source/sdr/properties/captionproperties.cxx +++ b/svx/source/sdr/properties/captionproperties.cxx @@ -71,7 +71,7 @@ namespace sdr void CaptionProperties::ItemSetChanged(const SfxItemSet& rSet) { - SdrCaptionObj& rObj = (SdrCaptionObj&)GetSdrObject(); + SdrCaptionObj& rObj = static_cast<SdrCaptionObj&>(GetSdrObject()); // local changes rObj.ImpRecalcTail(); @@ -82,7 +82,7 @@ namespace sdr void CaptionProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) { - SdrCaptionObj& rObj = (SdrCaptionObj&)GetSdrObject(); + SdrCaptionObj& rObj = static_cast<SdrCaptionObj&>(GetSdrObject()); // call parent RectangleProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr); diff --git a/svx/source/sdr/properties/circleproperties.cxx b/svx/source/sdr/properties/circleproperties.cxx index eb9329177e5c..a2a1bfe4d867 100644 --- a/svx/source/sdr/properties/circleproperties.cxx +++ b/svx/source/sdr/properties/circleproperties.cxx @@ -73,7 +73,7 @@ namespace sdr void CircleProperties::ItemSetChanged(const SfxItemSet& rSet) { - SdrCircObj& rObj = (SdrCircObj&)GetSdrObject(); + SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject()); // call parent RectangleProperties::ItemSetChanged(rSet); @@ -84,7 +84,7 @@ namespace sdr void CircleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) { - SdrCircObj& rObj = (SdrCircObj&)GetSdrObject(); + SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject()); // local changes rObj.SetXPolyDirty(); @@ -98,7 +98,7 @@ namespace sdr void CircleProperties::ForceDefaultAttributes() { - SdrCircObj& rObj = (SdrCircObj&)GetSdrObject(); + SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject()); SdrCircKind eKindA = SDRCIRC_FULL; SdrObjKind eKind = rObj.GetCircleKind(); diff --git a/svx/source/sdr/properties/connectorproperties.cxx b/svx/source/sdr/properties/connectorproperties.cxx index a65c245ea01e..5797a4830b44 100644 --- a/svx/source/sdr/properties/connectorproperties.cxx +++ b/svx/source/sdr/properties/connectorproperties.cxx @@ -71,7 +71,7 @@ namespace sdr void ConnectorProperties::ItemSetChanged(const SfxItemSet& rSet) { - SdrEdgeObj& rObj = (SdrEdgeObj&)GetSdrObject(); + SdrEdgeObj& rObj = static_cast<SdrEdgeObj&>(GetSdrObject()); // call parent TextProperties::ItemSetChanged(rSet); @@ -82,7 +82,7 @@ namespace sdr void ConnectorProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) { - SdrEdgeObj& rObj = (SdrEdgeObj&)GetSdrObject(); + SdrEdgeObj& rObj = static_cast<SdrEdgeObj&>(GetSdrObject()); // call parent TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr); diff --git a/svx/source/sdr/properties/e3dcompoundproperties.cxx b/svx/source/sdr/properties/e3dcompoundproperties.cxx index 1089613e5ff2..59657988eb2a 100644 --- a/svx/source/sdr/properties/e3dcompoundproperties.cxx +++ b/svx/source/sdr/properties/e3dcompoundproperties.cxx @@ -56,7 +56,7 @@ namespace sdr const SfxItemSet& E3dCompoundProperties::GetMergedItemSet() const { // include Items of scene this object belongs to - E3dCompoundObject& rObj = (E3dCompoundObject&)GetSdrObject(); + E3dCompoundObject& rObj = static_cast<E3dCompoundObject&>(GetSdrObject()); E3dScene* pScene = rObj.GetScene(); if(pScene) @@ -77,7 +77,7 @@ namespace sdr void E3dCompoundProperties::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems) { // Set scene specific items at scene - E3dCompoundObject& rObj = (E3dCompoundObject&)GetSdrObject(); + E3dCompoundObject& rObj = static_cast<E3dCompoundObject&>(GetSdrObject()); E3dScene* pScene = rObj.GetScene(); if(pScene) @@ -110,7 +110,7 @@ namespace sdr E3dProperties::PostItemChange(nWhich); // handle value change - E3dCompoundObject& rObj = (E3dCompoundObject&)GetSdrObject(); + E3dCompoundObject& rObj = static_cast<E3dCompoundObject&>(GetSdrObject()); switch(nWhich) { diff --git a/svx/source/sdr/properties/e3dextrudeproperties.cxx b/svx/source/sdr/properties/e3dextrudeproperties.cxx index 596fabf97390..f17414c99d1a 100644 --- a/svx/source/sdr/properties/e3dextrudeproperties.cxx +++ b/svx/source/sdr/properties/e3dextrudeproperties.cxx @@ -52,7 +52,7 @@ namespace sdr E3dCompoundProperties::PostItemChange(nWhich); // handle value change - E3dExtrudeObj& rObj = (E3dExtrudeObj&)GetSdrObject(); + E3dExtrudeObj& rObj = static_cast<E3dExtrudeObj&>(GetSdrObject()); switch(nWhich) { diff --git a/svx/source/sdr/properties/e3dlatheproperties.cxx b/svx/source/sdr/properties/e3dlatheproperties.cxx index cf3cb9bfdff3..83f3f0190efa 100644 --- a/svx/source/sdr/properties/e3dlatheproperties.cxx +++ b/svx/source/sdr/properties/e3dlatheproperties.cxx @@ -52,7 +52,7 @@ namespace sdr E3dCompoundProperties::PostItemChange(nWhich); // handle value change - E3dLatheObj& rObj = (E3dLatheObj&)GetSdrObject(); + E3dLatheObj& rObj = static_cast<E3dLatheObj&>(GetSdrObject()); switch(nWhich) { diff --git a/svx/source/sdr/properties/e3dproperties.cxx b/svx/source/sdr/properties/e3dproperties.cxx index 0dc7f00cee9f..922e2c749612 100644 --- a/svx/source/sdr/properties/e3dproperties.cxx +++ b/svx/source/sdr/properties/e3dproperties.cxx @@ -66,7 +66,7 @@ namespace sdr void E3dProperties::ItemSetChanged(const SfxItemSet& rSet) { - E3dObject& rObj = (E3dObject&)GetSdrObject(); + E3dObject& rObj = static_cast<E3dObject&>(GetSdrObject()); // call parent AttributeProperties::ItemSetChanged(rSet); @@ -81,7 +81,7 @@ namespace sdr AttributeProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr); // propagate call to contained objects - const SdrObjList* pSub = ((const E3dObject&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const E3dObject&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) diff --git a/svx/source/sdr/properties/e3dsceneproperties.cxx b/svx/source/sdr/properties/e3dsceneproperties.cxx index cb4799927d8f..f8c292865837 100644 --- a/svx/source/sdr/properties/e3dsceneproperties.cxx +++ b/svx/source/sdr/properties/e3dsceneproperties.cxx @@ -73,7 +73,7 @@ namespace sdr } // collect all ItemSets of contained 3d objects - const SdrObjList* pSub = ((const E3dScene&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const E3dScene&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) @@ -114,7 +114,7 @@ namespace sdr void E3dSceneProperties::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems) { // Set SDRATTR_3DOBJ_ range at contained objects. - const SdrObjList* pSub = ((const E3dScene&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const E3dScene&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); if(nCount) @@ -150,7 +150,7 @@ namespace sdr void E3dSceneProperties::SetMergedItem(const SfxPoolItem& rItem) { - const SdrObjList* pSub = ((const E3dScene&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const E3dScene&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) @@ -164,7 +164,7 @@ namespace sdr void E3dSceneProperties::ClearMergedItem(const sal_uInt16 nWhich) { - const SdrObjList* pSub = ((const E3dScene&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const E3dScene&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) @@ -182,7 +182,7 @@ namespace sdr E3dProperties::PostItemChange(nWhich); // local changes - E3dScene& rObj = (E3dScene&)GetSdrObject(); + E3dScene& rObj = static_cast<E3dScene&>(GetSdrObject()); rObj.StructureChanged(); switch(nWhich) @@ -236,7 +236,7 @@ namespace sdr void E3dSceneProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) { - const SdrObjList* pSub = ((const E3dScene&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const E3dScene&>(GetSdrObject()).GetSubList(); const sal_uInt32 nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) @@ -249,7 +249,7 @@ namespace sdr { SfxStyleSheet* pRetval = 0L; - const SdrObjList* pSub = ((const E3dScene&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const E3dScene&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) @@ -281,7 +281,7 @@ namespace sdr E3dProperties::MoveToItemPool(pSrcPool, pDestPool, pNewModel); // own reaction, but only with outmost scene - E3dScene& rObj = (E3dScene&)GetSdrObject(); + E3dScene& rObj = static_cast<E3dScene&>(GetSdrObject()); const SdrObjList* pSubList = rObj.GetSubList(); if(pSubList && rObj.GetScene() == &rObj) @@ -290,7 +290,7 @@ namespace sdr while(a3DIterator.IsMore()) { - E3dObject* pObj = (E3dObject*)a3DIterator.Next(); + E3dObject* pObj = static_cast<E3dObject*>(a3DIterator.Next()); DBG_ASSERT(pObj->ISA(E3dObject), "In scenes there are only 3D objects allowed (!)"); pObj->GetProperties().MoveToItemPool(pSrcPool, pDestPool, pNewModel); } @@ -303,7 +303,7 @@ namespace sdr // force ItemSet GetObjectItemSet(); - E3dScene& rObj = (E3dScene&)GetSdrObject(); + E3dScene& rObj = static_cast<E3dScene&>(GetSdrObject()); Camera3D aSceneCam(rObj.GetCamera()); // ProjectionType diff --git a/svx/source/sdr/properties/e3dsphereproperties.cxx b/svx/source/sdr/properties/e3dsphereproperties.cxx index fa5cfdcf67b3..f4f30c0aca1f 100644 --- a/svx/source/sdr/properties/e3dsphereproperties.cxx +++ b/svx/source/sdr/properties/e3dsphereproperties.cxx @@ -52,7 +52,7 @@ namespace sdr E3dCompoundProperties::PostItemChange(nWhich); // handle value change - E3dSphereObj& rObj = (E3dSphereObj&)GetSdrObject(); + E3dSphereObj& rObj = static_cast<E3dSphereObj&>(GetSdrObject()); switch(nWhich) { diff --git a/svx/source/sdr/properties/graphicproperties.cxx b/svx/source/sdr/properties/graphicproperties.cxx index 6300f5f95e47..b327a403c646 100644 --- a/svx/source/sdr/properties/graphicproperties.cxx +++ b/svx/source/sdr/properties/graphicproperties.cxx @@ -72,7 +72,7 @@ namespace sdr void GraphicProperties::ItemSetChanged(const SfxItemSet& rSet) { - SdrGrafObj& rObj = (SdrGrafObj&)GetSdrObject(); + SdrGrafObj& rObj = static_cast<SdrGrafObj&>(GetSdrObject()); // local changes rObj.SetXPolyDirty(); @@ -91,7 +91,7 @@ namespace sdr void GraphicProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) { - SdrGrafObj& rObj = (SdrGrafObj&)GetSdrObject(); + SdrGrafObj& rObj = static_cast<SdrGrafObj&>(GetSdrObject()); // local changes rObj.SetXPolyDirty(); diff --git a/svx/source/sdr/properties/groupproperties.cxx b/svx/source/sdr/properties/groupproperties.cxx index f49eb5fb408f..90133ad52f01 100644 --- a/svx/source/sdr/properties/groupproperties.cxx +++ b/svx/source/sdr/properties/groupproperties.cxx @@ -81,7 +81,7 @@ namespace sdr } // collect all ItemSets in mpItemSet - const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const SdrObjGroup&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) @@ -113,7 +113,7 @@ namespace sdr void GroupProperties::SetMergedItemSet(const SfxItemSet& rSet, bool bClearAllItems) { // iterate over contained SdrObjects - const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const SdrObjGroup&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) @@ -154,7 +154,7 @@ namespace sdr void GroupProperties::SetMergedItem(const SfxPoolItem& rItem) { - const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const SdrObjGroup&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) @@ -165,7 +165,7 @@ namespace sdr void GroupProperties::ClearMergedItem(const sal_uInt16 nWhich) { - const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const SdrObjGroup&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) @@ -204,7 +204,7 @@ namespace sdr { SfxStyleSheet* pRetval = 0L; - const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const SdrObjGroup&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) @@ -230,7 +230,7 @@ namespace sdr void GroupProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) { - const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const SdrObjGroup&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) @@ -248,7 +248,7 @@ namespace sdr { if(pSrcPool && pDestPool && (pSrcPool != pDestPool)) { - const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const SdrObjGroup&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) @@ -273,7 +273,7 @@ namespace sdr void GroupProperties::ForceStyleToHardAttributes() { - const SdrObjList* pSub = ((const SdrObjGroup&)GetSdrObject()).GetSubList(); + const SdrObjList* pSub = static_cast<const SdrObjGroup&>(GetSdrObject()).GetSubList(); const size_t nCount(pSub->GetObjCount()); for(size_t a = 0; a < nCount; ++a) diff --git a/svx/source/sdr/properties/itemsettools.cxx b/svx/source/sdr/properties/itemsettools.cxx index 29306d6c0d65..99a60c795b8c 100644 --- a/svx/source/sdr/properties/itemsettools.cxx +++ b/svx/source/sdr/properties/itemsettools.cxx @@ -36,7 +36,7 @@ namespace sdr { if(rObj.ISA(SdrObjGroup)) { - SdrObjListIter aIter((const SdrObjGroup&)rObj, IM_DEEPNOGROUPS); + SdrObjListIter aIter(static_cast<const SdrObjGroup&>(rObj), IM_DEEPNOGROUPS); mpData = new RectangleVector; DBG_ASSERT(mpData, "ItemChangeBroadcaster: No memory (!)"); ((RectangleVector*)mpData)->reserve(aIter.Count()); diff --git a/svx/source/sdr/properties/measureproperties.cxx b/svx/source/sdr/properties/measureproperties.cxx index 033464b2d9f5..7082ff5bc6e4 100644 --- a/svx/source/sdr/properties/measureproperties.cxx +++ b/svx/source/sdr/properties/measureproperties.cxx @@ -78,7 +78,7 @@ namespace sdr void MeasureProperties::ItemSetChanged(const SfxItemSet& rSet) { - SdrMeasureObj& rObj = (SdrMeasureObj&)GetSdrObject(); + SdrMeasureObj& rObj = static_cast<SdrMeasureObj&>(GetSdrObject()); // call parent TextProperties::ItemSetChanged(rSet); @@ -89,7 +89,7 @@ namespace sdr void MeasureProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) { - SdrMeasureObj& rObj = (SdrMeasureObj&)GetSdrObject(); + SdrMeasureObj& rObj = static_cast<SdrMeasureObj&>(GetSdrObject()); // local changes rObj.SetTextDirty(); diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx index af59a4e1f3da..aecc64691bed 100644 --- a/svx/source/sdr/properties/properties.cxx +++ b/svx/source/sdr/properties/properties.cxx @@ -131,7 +131,7 @@ namespace sdr // invalidate all new rectangles if(GetSdrObject().ISA(SdrObjGroup)) { - SdrObjListIter aIter((SdrObjGroup&)GetSdrObject(), IM_DEEPNOGROUPS); + SdrObjListIter aIter(static_cast<SdrObjGroup&>(GetSdrObject()), IM_DEEPNOGROUPS); while(aIter.IsMore()) { diff --git a/svx/source/sdr/properties/rectangleproperties.cxx b/svx/source/sdr/properties/rectangleproperties.cxx index 7794a3d1daa6..52babb767dd9 100644 --- a/svx/source/sdr/properties/rectangleproperties.cxx +++ b/svx/source/sdr/properties/rectangleproperties.cxx @@ -47,7 +47,7 @@ namespace sdr void RectangleProperties::ItemSetChanged(const SfxItemSet& rSet) { - SdrRectObj& rObj = (SdrRectObj&)GetSdrObject(); + SdrRectObj& rObj = static_cast<SdrRectObj&>(GetSdrObject()); // call parent TextProperties::ItemSetChanged(rSet); @@ -59,7 +59,7 @@ namespace sdr // set a new StyleSheet and broadcast void RectangleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) { - SdrRectObj& rObj = (SdrRectObj&)GetSdrObject(); + SdrRectObj& rObj = static_cast<SdrRectObj&>(GetSdrObject()); // call parent TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr); diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx index bd857b6ff19f..eeb799185444 100644 --- a/svx/source/sdr/properties/textproperties.cxx +++ b/svx/source/sdr/properties/textproperties.cxx @@ -81,7 +81,7 @@ namespace sdr void TextProperties::ItemSetChanged(const SfxItemSet& rSet) { - SdrTextObj& rObj = (SdrTextObj&)GetSdrObject(); + SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject()); const svx::ITextProvider& rTextProvider(getTextProvider()); sal_Int32 nText = rTextProvider.getTextCount(); @@ -150,19 +150,19 @@ namespace sdr void TextProperties::ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem) { - SdrTextObj& rObj = (SdrTextObj&)GetSdrObject(); + SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject()); // #i25616# sal_Int32 nOldLineWidth(0L); if(XATTR_LINEWIDTH == nWhich && rObj.DoesSupportTextIndentingOnLineWidthChange()) { - nOldLineWidth = ((const XLineWidthItem&)GetItem(XATTR_LINEWIDTH)).GetValue(); + nOldLineWidth = static_cast<const XLineWidthItem&>(GetItem(XATTR_LINEWIDTH)).GetValue(); } if(pNewItem && (SDRATTR_TEXTDIRECTION == nWhich)) { - bool bVertical(com::sun::star::text::WritingMode_TB_RL == ((SvxWritingModeItem*)pNewItem)->GetValue()); + bool bVertical(com::sun::star::text::WritingMode_TB_RL == static_cast<const SvxWritingModeItem*>(pNewItem)->GetValue()); rObj.SetVerticalWriting(bVertical); } @@ -202,19 +202,19 @@ namespace sdr // #i25616# if(XATTR_LINEWIDTH == nWhich && rObj.DoesSupportTextIndentingOnLineWidthChange()) { - const sal_Int32 nNewLineWidth(((const XLineWidthItem&)GetItem(XATTR_LINEWIDTH)).GetValue()); + const sal_Int32 nNewLineWidth(static_cast<const XLineWidthItem&>(GetItem(XATTR_LINEWIDTH)).GetValue()); const sal_Int32 nDifference((nNewLineWidth - nOldLineWidth) / 2); if(nDifference) { - const bool bLineVisible(XLINE_NONE != ((const XLineStyleItem&)(GetItem(XATTR_LINESTYLE))).GetValue()); + const bool bLineVisible(XLINE_NONE != static_cast<const XLineStyleItem&>(GetItem(XATTR_LINESTYLE)).GetValue()); if(bLineVisible) { - const sal_Int32 nLeftDist(((const SdrMetricItem&)GetItem(SDRATTR_TEXT_LEFTDIST)).GetValue()); - const sal_Int32 nRightDist(((const SdrMetricItem&)GetItem(SDRATTR_TEXT_RIGHTDIST)).GetValue()); - const sal_Int32 nUpperDist(((const SdrMetricItem&)GetItem(SDRATTR_TEXT_UPPERDIST)).GetValue()); - const sal_Int32 nLowerDist(((const SdrMetricItem&)GetItem(SDRATTR_TEXT_LOWERDIST)).GetValue()); + const sal_Int32 nLeftDist(static_cast<const SdrMetricItem&>(GetItem(SDRATTR_TEXT_LEFTDIST)).GetValue()); + const sal_Int32 nRightDist(static_cast<const SdrMetricItem&>(GetItem(SDRATTR_TEXT_RIGHTDIST)).GetValue()); + const sal_Int32 nUpperDist(static_cast<const SdrMetricItem&>(GetItem(SDRATTR_TEXT_UPPERDIST)).GetValue()); + const sal_Int32 nLowerDist(static_cast<const SdrMetricItem&>(GetItem(SDRATTR_TEXT_LOWERDIST)).GetValue()); SetObjectItemDirect(makeSdrTextLeftDistItem(nLeftDist + nDifference)); SetObjectItemDirect(makeSdrTextRightDistItem(nRightDist + nDifference)); @@ -232,7 +232,7 @@ namespace sdr void TextProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) { - SdrTextObj& rObj = (SdrTextObj&)GetSdrObject(); + SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject()); // call parent AttributeProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr); @@ -283,7 +283,9 @@ namespace sdr SdrModel* pModel = rObj.GetModel(); SfxStyleSheetBasePool* pStylePool = (pModel != NULL) ? pModel->GetStyleSheetPool() : 0L; - SfxStyleSheet* pNewStyle = pStylePool ? (SfxStyleSheet*)pStylePool->Find(aNewStyleSheetName, GetStyleSheet()->GetFamily()) : NULL; + SfxStyleSheet* pNewStyle = NULL; + if(pStylePool) + pNewStyle = static_cast<SfxStyleSheet*>(pStylePool->Find(aNewStyleSheetName, GetStyleSheet()->GetFamily())); DBG_ASSERT( pNewStyle, "AutoStyleSheetName - Style not found!" ); if(pNewStyle) @@ -357,7 +359,7 @@ namespace sdr void TextProperties::ForceDefaultAttributes() { - SdrTextObj& rObj = (SdrTextObj&)GetSdrObject(); + SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject()); if( rObj.GetObjInventor() == SdrInventor ) { @@ -397,7 +399,7 @@ namespace sdr ItemSetChanged(*mpItemSet); // now the standard TextProperties stuff - SdrTextObj& rObj = (SdrTextObj&)GetSdrObject(); + SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject()); if(rObj.GetModel() && !rObj.IsTextEditActive() @@ -465,7 +467,7 @@ namespace sdr { if(i->pAttr) { - SvxFieldItem* pFieldItem = (SvxFieldItem*)(i->pAttr); + const SvxFieldItem* pFieldItem = static_cast<const SvxFieldItem*>(i->pAttr); if(pFieldItem) { @@ -548,7 +550,7 @@ namespace sdr // call parent AttributeProperties::Notify(rBC, rHint); - SdrTextObj& rObj = (SdrTextObj&)GetSdrObject(); + SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject()); if(rObj.HasText()) { const svx::ITextProvider& rTextProvider(getTextProvider()); diff --git a/svx/source/svdraw/sdrmasterpagedescriptor.cxx b/svx/source/svdraw/sdrmasterpagedescriptor.cxx index 598388375dc6..6ef787d53dd5 100644 --- a/svx/source/svdraw/sdrmasterpagedescriptor.cxx +++ b/svx/source/svdraw/sdrmasterpagedescriptor.cxx @@ -107,7 +107,7 @@ namespace sdr const SdrPage* pCorrectPage = &GetOwnerPage(); const SdrPageProperties* pCorrectProperties = &pCorrectPage->getSdrPageProperties(); - if(drawing::FillStyle_NONE == ((const XFillStyleItem&)pCorrectProperties->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue()) + if(drawing::FillStyle_NONE == static_cast<const XFillStyleItem&>(pCorrectProperties->GetItemSet().Get(XATTR_FILLSTYLE)).GetValue()) { pCorrectPage = &GetUsedPage(); pCorrectProperties = &pCorrectPage->getSdrPageProperties(); diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 3b5a83a438c4..38a3ebc15476 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -636,7 +636,7 @@ SdrFractionItem::SdrFractionItem(sal_uInt16 nId, SvStream& rIn): bool SdrFractionItem::operator==(const SfxPoolItem& rCmp) const { return SfxPoolItem::operator==(rCmp) && - ((SdrFractionItem&)rCmp).GetValue()==nValue; + static_cast<const SdrFractionItem&>(rCmp).GetValue()==nValue; } bool SdrFractionItem::GetPresentation( @@ -1450,12 +1450,12 @@ bool SdrCustomShapeAdjustmentItem::operator==( const SfxPoolItem& rCmp ) const bool bRet = SfxPoolItem::operator==( rCmp ); if ( bRet ) { - bRet = GetCount() == ((SdrCustomShapeAdjustmentItem&)rCmp).GetCount(); + bRet = GetCount() == static_cast<const SdrCustomShapeAdjustmentItem&>(rCmp).GetCount(); if (bRet) { for (sal_uInt32 i = 0; i < GetCount(); ++i) - if (aAdjustmentValueList[i].nValue != ((SdrCustomShapeAdjustmentItem&)rCmp).aAdjustmentValueList[i].nValue) + if (aAdjustmentValueList[i].nValue != static_cast<const SdrCustomShapeAdjustmentItem&>(rCmp).aAdjustmentValueList[i].nValue) return false; } } diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 3102b6bc6018..2f3022f532d4 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -502,7 +502,7 @@ bool SdrCreateView::ImpBegCreateObj(sal_uInt32 nInvent, sal_uInt16 nIdent, const } aDragStat.Reset(aPnt); - aDragStat.SetView((SdrView*)this); + aDragStat.SetView(static_cast<SdrView*>(this)); aDragStat.SetPageView(pCreatePV); aDragStat.SetMinMove(ImpGetMinMovLogic(nMinMov,pOut)); pDragWin=pOut; @@ -653,8 +653,8 @@ bool SdrCreateView::EndCreateObj(SdrCreateCmd eCmd) && pCreatePV->GetAktGroup() && pCreatePV->GetAktGroup()->ISA(E3dScene)) { - bool bDidInsert = ((E3dView*)this)->ImpCloneAll3DObjectsToDestScene( - (E3dScene*)pObjMerk, (E3dScene*)pCreatePV->GetAktGroup(), Point(0, 0)); + bool bDidInsert = static_cast<E3dView*>(this)->ImpCloneAll3DObjectsToDestScene( + static_cast<E3dScene*>(pObjMerk), static_cast<E3dScene*>(pCreatePV->GetAktGroup()), Point(0, 0)); if(bDidInsert) { @@ -767,8 +767,8 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/) if(bUseSolidDragging) { const SfxItemSet& rSet = pAktCreate->GetMergedItemSet(); - const drawing::FillStyle eFill(((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue()); - const XLineStyle eLine(((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue()); + const drawing::FillStyle eFill(static_cast<const XFillStyleItem&>(rSet.Get(XATTR_FILLSTYLE)).GetValue()); + const XLineStyle eLine(static_cast<const XLineStyleItem&>(rSet.Get(XATTR_LINESTYLE)).GetValue()); if(XLINE_NONE == eLine && drawing::FillStyle_NONE == eFill) { @@ -821,7 +821,7 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, sal_Bool bFull*/) { // The up-to-now created path needs to be set at the object to have something // that can be visualized - SdrPathObj& rPathObj((SdrPathObj&)(*pAktCreate)); + SdrPathObj& rPathObj(static_cast<SdrPathObj&>(*pAktCreate)); const basegfx::B2DPolyPolygon aCurrentPolyPolygon(rPathObj.getObjectPolyPolygon(aDragStat)); if(aCurrentPolyPolygon.count()) diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index b2d5ccfba657..155a535fd736 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -1357,8 +1357,8 @@ void SdrDragObjOwn::MoveSdrDrag(const Point& rNoSnapPnt) // also this (pretty indirect) property change is possible. If it gets // changed, it needs to be copied to the original since nothing will // happen when it only changes in the drag clone - const bool bOldAutoGrowWidth(((SdrOnOffItem&)pObj->GetMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue()); - const bool bNewAutoGrowWidth(((SdrOnOffItem&)mpClone->GetMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue()); + const bool bOldAutoGrowWidth(static_cast<const SdrOnOffItem&>(pObj->GetMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue()); + const bool bNewAutoGrowWidth(static_cast<const SdrOnOffItem&>(mpClone->GetMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue()); if (bOldAutoGrowWidth != bNewAutoGrowWidth) { @@ -2675,7 +2675,7 @@ bool SdrDragGradient::BeginSdrDrag() { bool bRetval(false); - pIAOHandle = (SdrHdlGradient*)GetHdlList().GetHdl(IsGradient() ? HDL_GRAD : HDL_TRNS); + pIAOHandle = static_cast<SdrHdlGradient*>(GetHdlList().GetHdl(IsGradient() ? HDL_GRAD : HDL_TRNS)); if(pIAOHandle) { @@ -3675,7 +3675,7 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/) if( aGraphicSize.A() == 0 || aGraphicSize.B() == 0 ) return false; - const SdrGrafCropItem& rOldCrop = (const SdrGrafCropItem&)pObj->GetMergedItem(SDRATTR_GRAFCROP); + const SdrGrafCropItem& rOldCrop = static_cast<const SdrGrafCropItem&>(pObj->GetMergedItem(SDRATTR_GRAFCROP)); const bool bUndo = getSdrDragView().IsUndoEnabled(); diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index 4830f0325c2a..1bf74e506749 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -168,7 +168,7 @@ bool SdrDragView::TakeDragObjAnchorPos(Point& rPos, bool bTR ) const SdrObject* pObj=GetMarkedObjectByIndex(0); if (pObj->ISA(SdrCaptionObj)) { - Point aPt(((SdrCaptionObj*)pObj)->GetTailPos()); + Point aPt(static_cast<SdrCaptionObj*>(pObj)->GetTailPos()); bool bTail=eDragHdl==HDL_POLY; // drag tail bool bOwn=mpCurrentSdrDragMethod->ISA(SdrDragObjOwn); // specific to object if (!bTail) @@ -634,7 +634,7 @@ bool SdrDragView::ImpBegInsObjPoint(bool bIdxZwang, sal_uInt32 nIdx, const Point if(pMarkedObj && pMarkedObj->ISA(SdrPathObj)) { - SdrPathObj* pMarkedPath = (SdrPathObj*)pMarkedObj; + SdrPathObj* pMarkedPath = static_cast<SdrPathObj*>(pMarkedObj); BrkAction(); pInsPointUndo = dynamic_cast< SdrUndoGeoObj* >( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pMarkedObj) ); DBG_ASSERT( pInsPointUndo, "svx::SdrDragView::BegInsObjPoint(), could not create correct undo object!" ); diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index fdca37d26875..8c6ca5d58ece 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -522,7 +522,7 @@ void SdrEditView::CheckPossibilities() if(SfxItemState::DONTCARE != eState) { // If state is not DONTCARE, test the item - drawing::FillStyle eFillStyle = ((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue(); + drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(rSet.Get(XATTR_FILLSTYLE)).GetValue(); if(eFillStyle != drawing::FillStyle_GRADIENT) { @@ -623,7 +623,7 @@ void SdrEditView::CheckPossibilities() bGrpEnterPossible=bUnGroupPossible; } ImpCheckToTopBtmPossible(); - ((SdrPolyEditView*)this)->ImpCheckPolyPossibilities(); + static_cast<SdrPolyEditView*>(this)->ImpCheckPolyPossibilities(); bPossibilitiesDirty=false; if (bReadOnly) { diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 340a96946ba4..5a62d1366e8e 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -710,19 +710,19 @@ void SdrEditView::SetNotPersistAttrToMarked(const SfxItemSet& rAttr, bool /*bRep Rectangle aAllSnapRect(GetMarkedObjRect()); const SfxPoolItem *pPoolItem=NULL; if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1X,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrTransformRef1XItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrTransformRef1XItem*>(pPoolItem)->GetValue(); SetRef1(Point(n,GetRef1().Y())); } if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1Y,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrTransformRef1YItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrTransformRef1YItem*>(pPoolItem)->GetValue(); SetRef1(Point(GetRef1().X(),n)); } if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2X,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrTransformRef2XItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrTransformRef2XItem*>(pPoolItem)->GetValue(); SetRef2(Point(n,GetRef2().Y())); } if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2Y,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrTransformRef2YItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrTransformRef2YItem*>(pPoolItem)->GetValue(); SetRef2(Point(GetRef2().X(),n)); } long nAllPosX=0; bool bAllPosX=false; @@ -731,19 +731,19 @@ void SdrEditView::SetNotPersistAttrToMarked(const SfxItemSet& rAttr, bool /*bRep long nAllHgt=0; bool bAllHgt=false; bool bDoIt=false; if (rAttr.GetItemState(SDRATTR_ALLPOSITIONX,true,&pPoolItem)==SfxItemState::SET) { - nAllPosX=((const SdrAllPositionXItem*)pPoolItem)->GetValue(); + nAllPosX=static_cast<const SdrAllPositionXItem*>(pPoolItem)->GetValue(); bAllPosX=true; bDoIt=true; } if (rAttr.GetItemState(SDRATTR_ALLPOSITIONY,true,&pPoolItem)==SfxItemState::SET) { - nAllPosY=((const SdrAllPositionYItem*)pPoolItem)->GetValue(); + nAllPosY=static_cast<const SdrAllPositionYItem*>(pPoolItem)->GetValue(); bAllPosY=true; bDoIt=true; } if (rAttr.GetItemState(SDRATTR_ALLSIZEWIDTH,true,&pPoolItem)==SfxItemState::SET) { - nAllWdt=((const SdrAllSizeWidthItem*)pPoolItem)->GetValue(); + nAllWdt=static_cast<const SdrAllSizeWidthItem*>(pPoolItem)->GetValue(); bAllWdt=true; bDoIt=true; } if (rAttr.GetItemState(SDRATTR_ALLSIZEHEIGHT,true,&pPoolItem)==SfxItemState::SET) { - nAllHgt=((const SdrAllSizeHeightItem*)pPoolItem)->GetValue(); + nAllHgt=static_cast<const SdrAllSizeHeightItem*>(pPoolItem)->GetValue(); bAllHgt=true; bDoIt=true; } if (bDoIt) { @@ -755,23 +755,23 @@ void SdrEditView::SetNotPersistAttrToMarked(const SfxItemSet& rAttr, bool /*bRep SetMarkedObjRect(aRect); } if (rAttr.GetItemState(SDRATTR_RESIZEXALL,true,&pPoolItem)==SfxItemState::SET) { - boost::rational<sal_Int64> aXFact=((const SdrResizeXAllItem*)pPoolItem)->GetValue(); + boost::rational<sal_Int64> aXFact=static_cast<const SdrResizeXAllItem*>(pPoolItem)->GetValue(); ResizeMarkedObj(aAllSnapRect.TopLeft(),aXFact,boost::rational<sal_Int64>(1,1)); } if (rAttr.GetItemState(SDRATTR_RESIZEYALL,true,&pPoolItem)==SfxItemState::SET) { - boost::rational<sal_Int64> aYFact=((const SdrResizeYAllItem*)pPoolItem)->GetValue(); + boost::rational<sal_Int64> aYFact=static_cast<const SdrResizeYAllItem*>(pPoolItem)->GetValue(); ResizeMarkedObj(aAllSnapRect.TopLeft(),boost::rational<sal_Int64>(1,1),aYFact); } if (rAttr.GetItemState(SDRATTR_ROTATEALL,true,&pPoolItem)==SfxItemState::SET) { - long nAngle=((const SdrRotateAllItem*)pPoolItem)->GetValue(); + long nAngle=static_cast<const SdrRotateAllItem*>(pPoolItem)->GetValue(); RotateMarkedObj(aAllSnapRect.Center(),nAngle); } if (rAttr.GetItemState(SDRATTR_HORZSHEARALL,true,&pPoolItem)==SfxItemState::SET) { - long nAngle=((const SdrHorzShearAllItem*)pPoolItem)->GetValue(); + long nAngle=static_cast<const SdrHorzShearAllItem*>(pPoolItem)->GetValue(); ShearMarkedObj(aAllSnapRect.Center(),nAngle,false); } if (rAttr.GetItemState(SDRATTR_VERTSHEARALL,true,&pPoolItem)==SfxItemState::SET) { - long nAngle=((const SdrVertShearAllItem*)pPoolItem)->GetValue(); + long nAngle=static_cast<const SdrVertShearAllItem*>(pPoolItem)->GetValue(); ShearMarkedObj(aAllSnapRect.Center(),nAngle,true); } @@ -1050,7 +1050,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll) if(bLineWidthChange) { - nNewLineWidth = ((const XLineWidthItem&)aAttr.Get(XATTR_LINEWIDTH)).GetValue(); + nNewLineWidth = static_cast<const XLineWidthItem&>(aAttr.Get(XATTR_LINEWIDTH)).GetValue(); } for (size_t nm=0; nm<nMarkAnz; ++nm) @@ -1099,7 +1099,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll) if(bLineWidthChange) { - nOldLineWidth = ((const XLineWidthItem&)pObj->GetMergedItem(XATTR_LINEWIDTH)).GetValue(); + nOldLineWidth = static_cast<const XLineWidthItem&>(pObj->GetMergedItem(XATTR_LINEWIDTH)).GetValue(); } // set attributes at object @@ -1113,7 +1113,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll) { if(SfxItemState::DONTCARE != rSet.GetItemState(XATTR_LINESTARTWIDTH)) { - const sal_Int32 nValAct(((const XLineStartWidthItem&)rSet.Get(XATTR_LINESTARTWIDTH)).GetValue()); + const sal_Int32 nValAct(static_cast<const XLineStartWidthItem&>(rSet.Get(XATTR_LINESTARTWIDTH)).GetValue()); const sal_Int32 nValNewStart(std::max((sal_Int32)0, nValAct + (((nNewLineWidth - nOldLineWidth) * 15) / 10))); pObj->SetMergedItem(XLineStartWidthItem(nValNewStart)); @@ -1121,7 +1121,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll) if(SfxItemState::DONTCARE != rSet.GetItemState(XATTR_LINEENDWIDTH)) { - const sal_Int32 nValAct(((const XLineEndWidthItem&)rSet.Get(XATTR_LINEENDWIDTH)).GetValue()); + const sal_Int32 nValAct(static_cast<const XLineEndWidthItem&>(rSet.Get(XATTR_LINEENDWIDTH)).GetValue()); const sal_Int32 nValNewEnd(std::max((sal_Int32)0, nValAct + (((nNewLineWidth - nOldLineWidth) * 15) / 10))); pObj->SetMergedItem(XLineEndWidthItem(nValNewEnd)); @@ -1131,7 +1131,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll) if(pObj->ISA(SdrTextObj)) { - SdrTextObj* pTextObj = ((SdrTextObj*)pObj); + SdrTextObj* pTextObj = static_cast<SdrTextObj*>(pObj); if(!aCharWhichIds.empty()) { @@ -1370,7 +1370,7 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const } SfxItemState eState=aMarkAttr.GetItemState(SDRATTR_TEXT_AUTOGROWWIDTH); - bool bAutoGrow=((SdrOnOffItem&)(aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWWIDTH))).GetValue(); + bool bAutoGrow=static_cast<const SdrOnOffItem&>(aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue(); if (eState==SfxItemState::DONTCARE) { aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_AUTOWIDTH); } else if (eState==SfxItemState::SET) { @@ -1378,7 +1378,7 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const } eState=aMarkAttr.GetItemState(SDRATTR_TEXT_AUTOGROWHEIGHT); - bAutoGrow=((SdrOnOffItem&)(aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue(); + bAutoGrow=static_cast<const SdrOnOffItem&>(aMarkAttr.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); if (eState==SfxItemState::DONTCARE) { aRetSet.InvalidateItem(SID_ATTR_TRANSFORM_AUTOHEIGHT); } else if (eState==SfxItemState::SET) { @@ -1386,7 +1386,7 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const } eState=aMarkAttr.GetItemState(SDRATTR_ECKENRADIUS); - long nRadius=((SdrMetricItem&)(aMarkAttr.Get(SDRATTR_ECKENRADIUS))).GetValue(); + long nRadius=static_cast<const SdrMetricItem&>(aMarkAttr.Get(SDRATTR_ECKENRADIUS)).GetValue(); if (eState==SfxItemState::DONTCARE) { aRetSet.InvalidateItem(SDRATTR_ECKENRADIUS); } else if (eState==SfxItemState::SET) { @@ -1513,49 +1513,49 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) // position if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_X,true,&pPoolItem)) { - nPosDX=((const SfxInt32Item*)pPoolItem)->GetValue()-aRect.Left(); + nPosDX=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue()-aRect.Left(); bChgPos=true; } if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_POS_Y,true,&pPoolItem)){ - nPosDY=((const SfxInt32Item*)pPoolItem)->GetValue()-aRect.Top(); + nPosDY=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue()-aRect.Top(); bChgPos=true; } // size if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_WIDTH,true,&pPoolItem)) { - nSizX=((const SfxUInt32Item*)pPoolItem)->GetValue(); + nSizX=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue(); bChgSiz=true; bChgWdh=true; } if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_HEIGHT,true,&pPoolItem)) { - nSizY=((const SfxUInt32Item*)pPoolItem)->GetValue(); + nSizY=static_cast<const SfxUInt32Item*>(pPoolItem)->GetValue(); bChgSiz=true; bChgHgt=true; } if (bChgSiz) { - eSizePoint=(RECT_POINT)((const SfxAllEnumItem&)rAttr.Get(SID_ATTR_TRANSFORM_SIZE_POINT)).GetValue(); + eSizePoint=(RECT_POINT)static_cast<const SfxAllEnumItem&>(rAttr.Get(SID_ATTR_TRANSFORM_SIZE_POINT)).GetValue(); } // rotation if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ANGLE,true,&pPoolItem)) { - nRotateAngle=((const SfxInt32Item*)pPoolItem)->GetValue()-nOldRotateAngle; + nRotateAngle=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue()-nOldRotateAngle; bRotate = (nRotateAngle != 0); } // position rotation point x if(bRotate || SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ROT_X, true ,&pPoolItem)) - nRotateX = ((const SfxInt32Item&)rAttr.Get(SID_ATTR_TRANSFORM_ROT_X)).GetValue(); + nRotateX = static_cast<const SfxInt32Item&>(rAttr.Get(SID_ATTR_TRANSFORM_ROT_X)).GetValue(); // position rotation point y if(bRotate || SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_ROT_Y, true ,&pPoolItem)) - nRotateY = ((const SfxInt32Item&)rAttr.Get(SID_ATTR_TRANSFORM_ROT_Y)).GetValue(); + nRotateY = static_cast<const SfxInt32Item&>(rAttr.Get(SID_ATTR_TRANSFORM_ROT_Y)).GetValue(); // shearing if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_SHEAR,true,&pPoolItem)) { - long nNewShearAngle=((const SfxInt32Item*)pPoolItem)->GetValue(); + long nNewShearAngle=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue(); if (nNewShearAngle>SDRMAXSHEAR) nNewShearAngle=SDRMAXSHEAR; if (nNewShearAngle<-SDRMAXSHEAR) nNewShearAngle=-SDRMAXSHEAR; if (nNewShearAngle!=nOldShearAngle) { - bShearVert=((const SfxBoolItem&)rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_VERTICAL)).GetValue(); + bShearVert=static_cast<const SfxBoolItem&>(rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_VERTICAL)).GetValue(); if (bShearVert) { nShearAngle=nNewShearAngle; } else { @@ -1572,28 +1572,28 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) } bShear=nShearAngle!=0; if (bShear) { - nShearX=((const SfxInt32Item&)rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_X)).GetValue(); - nShearY=((const SfxInt32Item&)rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_Y)).GetValue(); + nShearX=static_cast<const SfxInt32Item&>(rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_X)).GetValue(); + nShearY=static_cast<const SfxInt32Item&>(rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_Y)).GetValue(); } } } // AutoGrow if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_AUTOWIDTH,true,&pPoolItem)) { - bool bAutoGrow=((const SfxBoolItem*)pPoolItem)->GetValue(); + bool bAutoGrow=static_cast<const SfxBoolItem*>(pPoolItem)->GetValue(); aSetAttr.Put(makeSdrTextAutoGrowWidthItem(bAutoGrow)); bSetAttr=true; } if (SfxItemState::SET==rAttr.GetItemState(SID_ATTR_TRANSFORM_AUTOHEIGHT,true,&pPoolItem)) { - bool bAutoGrow=((const SfxBoolItem*)pPoolItem)->GetValue(); + bool bAutoGrow=static_cast<const SfxBoolItem*>(pPoolItem)->GetValue(); aSetAttr.Put(makeSdrTextAutoGrowHeightItem(bAutoGrow)); bSetAttr=true; } // corner radius if (bEdgeRadiusAllowed && SfxItemState::SET==rAttr.GetItemState(SDRATTR_ECKENRADIUS,true,&pPoolItem)) { - long nRadius=((SdrMetricItem*)pPoolItem)->GetValue(); + long nRadius=static_cast<const SdrMetricItem*>(pPoolItem)->GetValue(); aSetAttr.Put(makeSdrEckenradiusItem(nRadius)); bSetAttr=true; } @@ -1672,7 +1672,7 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) // protect position if(SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_POS, true, &pPoolItem)) { - const bool bProtPos(((const SfxBoolItem*)pPoolItem)->GetValue()); + const bool bProtPos(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue()); bool bChanged(false); for(size_t i = 0; i < nMarkCount; ++i) @@ -1713,7 +1713,7 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) // protect size if(SfxItemState::SET == rAttr.GetItemState(SID_ATTR_TRANSFORM_PROTECT_SIZE, true, &pPoolItem)) { - const bool bProtSize(((const SfxBoolItem*)pPoolItem)->GetValue()); + const bool bProtSize(static_cast<const SfxBoolItem*>(pPoolItem)->GetValue()); bool bChanged(false); for(size_t i = 0; i < nMarkCount; ++i) diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index ae29e958c7bf..32d23c84aa89 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -1309,11 +1309,11 @@ void SdrEditView::CombineMarkedObjects(bool bNoPolyPoly) ImpCopyAttributes(pAttrObj, pPath); // If LineStyle of pAttrObj is XLINE_NONE force to XLINE_SOLID to make visible. - const XLineStyle eLineStyle = ((const XLineStyleItem&)pAttrObj->GetMergedItem(XATTR_LINESTYLE)).GetValue(); - const drawing::FillStyle eFillStyle = ((const XFillStyleItem&)pAttrObj->GetMergedItem(XATTR_FILLSTYLE)).GetValue(); + const XLineStyle eLineStyle = static_cast<const XLineStyleItem&>(pAttrObj->GetMergedItem(XATTR_LINESTYLE)).GetValue(); + const drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(pAttrObj->GetMergedItem(XATTR_FILLSTYLE)).GetValue(); // Take fill style/closed state of pAttrObj in account when deciding to change the line style - bool bIsClosedPathObj(pAttrObj->ISA(SdrPathObj) && ((SdrPathObj*)pAttrObj)->IsClosed()); + bool bIsClosedPathObj(pAttrObj->ISA(SdrPathObj) && static_cast<const SdrPathObj*>(pAttrObj)->IsClosed()); if(XLINE_NONE == eLineStyle && (drawing::FillStyle_NONE == eFillStyle || !bIsClosedPathObj)) { @@ -1537,7 +1537,7 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, DBG_ASSERT(pCandidate, "SdrEditView::ImpDismantleOneObject: Could not clone SdrObject (!)"); pCandidate->SetModel(pCustomShape->GetModel()); - if(((SdrOnOffItem&)pCustomShape->GetMergedItem(SDRATTR_SHADOW)).GetValue()) + if(static_cast<const SdrOnOffItem&>(pCustomShape->GetMergedItem(SDRATTR_SHADOW)).GetValue()) { if(pReplacement->ISA(SdrObjGroup)) { diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 56028fb6672f..00e51b058b44 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -449,7 +449,7 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, bool /*bNoP if (pText!=NULL) { pOutlView->SetAnchorMode((EVAnchorMode)(pText->GetOutlinerViewAnchorMode())); - pTextEditOutliner->SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)pText->GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + pTextEditOutliner->SetFixedCellHeight(static_cast<const SdrTextFixedCellHeightItem&>(pText->GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); } // do update before setting output area so that aTextEditArea can be recalculated pTextEditOutliner->SetUpdateMode(true); @@ -557,7 +557,7 @@ bool SdrObjEditView::SdrBeginTextEdit( if(OUTDEV_WINDOW == pPaintWindow->GetOutputDevice().GetOutDevType()) { - pWin = (vcl::Window*)(&pPaintWindow->GetOutputDevice()); + pWin = static_cast<vcl::Window*>(&pPaintWindow->GetOutputDevice()); } } @@ -703,7 +703,7 @@ bool SdrObjEditView::SdrBeginTextEdit( if(&rOutDev != pWin && OUTDEV_WINDOW == rOutDev.GetOutDevType()) { - OutlinerView* pOutlView = ImpMakeOutlinerView((vcl::Window*)(&rOutDev), !bEmpty, 0L); + OutlinerView* pOutlView = ImpMakeOutlinerView(static_cast<vcl::Window*>(&rOutDev), !bEmpty, 0L); pTextEditOutliner->InsertView(pOutlView, (sal_uInt16)i); } } @@ -1667,7 +1667,7 @@ void SdrObjEditView::AddWindowToPaintView(OutputDevice* pNewWin) if(mxTextEditObj.is() && !bTextEditOnlyOneView && pNewWin->GetOutDevType()==OUTDEV_WINDOW) { - OutlinerView* pOutlView=ImpMakeOutlinerView((vcl::Window*)pNewWin,false,NULL); + OutlinerView* pOutlView=ImpMakeOutlinerView(static_cast<vcl::Window*>(pNewWin),false,NULL); pTextEditOutliner->InsertView(pOutlView); } } @@ -1681,7 +1681,7 @@ void SdrObjEditView::DeleteWindowFromPaintView(OutputDevice* pOldWin) for (sal_uIntPtr i=pTextEditOutliner->GetViewCount(); i>0;) { i--; OutlinerView* pOLV=pTextEditOutliner->GetView(i); - if (pOLV && pOLV->GetWindow()==(vcl::Window*)pOldWin) { + if (pOLV && pOLV->GetWindow()==static_cast<vcl::Window*>(pOldWin)) { delete pTextEditOutliner->RemoveView(i); } } diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index 4911c00aacd9..b9bdbf07e6b3 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -293,28 +293,28 @@ void SdrLinkList::RemoveLink(const Link& rLink) bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol) { - drawing::FillStyle eFill=((XFillStyleItem&)rSet.Get(XATTR_FILLSTYLE)).GetValue(); + drawing::FillStyle eFill=static_cast<const XFillStyleItem&>(rSet.Get(XATTR_FILLSTYLE)).GetValue(); bool bRetval = false; switch(eFill) { case drawing::FillStyle_SOLID: { - rCol = ((XFillColorItem&)rSet.Get(XATTR_FILLCOLOR)).GetColorValue(); + rCol = static_cast<const XFillColorItem&>(rSet.Get(XATTR_FILLCOLOR)).GetColorValue(); bRetval = true; break; } case drawing::FillStyle_HATCH: { - Color aCol1(((XFillHatchItem&)rSet.Get(XATTR_FILLHATCH)).GetHatchValue().GetColor()); + Color aCol1(static_cast<const XFillHatchItem&>(rSet.Get(XATTR_FILLHATCH)).GetHatchValue().GetColor()); Color aCol2(COL_WHITE); // when hatched background is activated, use object fill color as hatch color - bool bFillHatchBackground = ((const XFillBackgroundItem&)(rSet.Get(XATTR_FILLBACKGROUND))).GetValue(); + bool bFillHatchBackground = static_cast<const XFillBackgroundItem&>(rSet.Get(XATTR_FILLBACKGROUND)).GetValue(); if(bFillHatchBackground) { - aCol2 = ((const XFillColorItem&)(rSet.Get(XATTR_FILLCOLOR))).GetColorValue(); + aCol2 = static_cast<const XFillColorItem&>(rSet.Get(XATTR_FILLCOLOR)).GetColorValue(); } const basegfx::BColor aAverageColor(basegfx::average(aCol1.getBColor(), aCol2.getBColor())); @@ -324,7 +324,7 @@ bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol) break; } case drawing::FillStyle_GRADIENT: { - const XGradient& rGrad=((XFillGradientItem&)rSet.Get(XATTR_FILLGRADIENT)).GetGradientValue(); + const XGradient& rGrad=static_cast<const XFillGradientItem&>(rSet.Get(XATTR_FILLGRADIENT)).GetGradientValue(); Color aCol1(rGrad.GetStartColor()); Color aCol2(rGrad.GetEndColor()); const basegfx::BColor aAverageColor(basegfx::average(aCol1.getBColor(), aCol2.getBColor())); @@ -335,7 +335,7 @@ bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol) } case drawing::FillStyle_BITMAP: { - Bitmap aBitmap(((XFillBitmapItem&)rSet.Get(XATTR_FILLBITMAP)).GetGraphicObject().GetGraphic().GetBitmapEx().GetBitmap()); + Bitmap aBitmap(static_cast<const XFillBitmapItem&>(rSet.Get(XATTR_FILLBITMAP)).GetGraphicObject().GetGraphic().GetBitmapEx().GetBitmap()); const Size aSize(aBitmap.GetSizePixel()); const sal_uInt32 nWidth = aSize.Width(); const sal_uInt32 nHeight = aSize.Height(); @@ -414,7 +414,7 @@ SdrOutliner* SdrMakeOutliner( sal_uInt16 nOutlinerMode, SdrModel* pModel ) SfxItemPool* pPool = &pModel->GetItemPool(); SdrOutliner* pOutl = new SdrOutliner( pPool, nOutlinerMode ); pOutl->SetEditTextObjectPool( pPool ); - pOutl->SetStyleSheetPool( (SfxStyleSheetPool*) pModel->GetStyleSheetPool() ); + pOutl->SetStyleSheetPool( static_cast<SfxStyleSheetPool*>( pModel->GetStyleSheetPool() ) ); pOutl->SetDefTab( pModel->GetDefaultTabulator() ); pOutl->SetForbiddenCharsTable( pModel->GetForbiddenCharsTable() ); pOutl->SetAsianCompressionMode( pModel->GetCharCompressType() ); diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index ca4996af510f..74eff38adbc4 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -138,64 +138,64 @@ void ImpSdrGDIMetaFileImport::DoLoopActions(GDIMetaFile& rMtf, SvdProgressInfo* switch (pAct->GetType()) { - case META_PIXEL_ACTION : DoAction((MetaPixelAction &)*pAct); break; - case META_POINT_ACTION : DoAction((MetaPointAction &)*pAct); break; - case META_LINE_ACTION : DoAction((MetaLineAction &)*pAct); break; - case META_RECT_ACTION : DoAction((MetaRectAction &)*pAct); break; - case META_ROUNDRECT_ACTION : DoAction((MetaRoundRectAction &)*pAct); break; - case META_ELLIPSE_ACTION : DoAction((MetaEllipseAction &)*pAct); break; - case META_ARC_ACTION : DoAction((MetaArcAction &)*pAct); break; - case META_PIE_ACTION : DoAction((MetaPieAction &)*pAct); break; - case META_CHORD_ACTION : DoAction((MetaChordAction &)*pAct); break; - case META_POLYLINE_ACTION : DoAction((MetaPolyLineAction &)*pAct); break; - case META_POLYGON_ACTION : DoAction((MetaPolygonAction &)*pAct); break; - case META_POLYPOLYGON_ACTION : DoAction((MetaPolyPolygonAction &)*pAct); break; - case META_TEXT_ACTION : DoAction((MetaTextAction &)*pAct); break; - case META_TEXTARRAY_ACTION : DoAction((MetaTextArrayAction &)*pAct); break; - case META_STRETCHTEXT_ACTION : DoAction((MetaStretchTextAction &)*pAct); break; - case META_BMP_ACTION : DoAction((MetaBmpAction &)*pAct); break; - case META_BMPSCALE_ACTION : DoAction((MetaBmpScaleAction &)*pAct); break; - case META_BMPEX_ACTION : DoAction((MetaBmpExAction &)*pAct); break; - case META_BMPEXSCALE_ACTION : DoAction((MetaBmpExScaleAction &)*pAct); break; - case META_LINECOLOR_ACTION : DoAction((MetaLineColorAction &)*pAct); break; - case META_FILLCOLOR_ACTION : DoAction((MetaFillColorAction &)*pAct); break; - case META_TEXTCOLOR_ACTION : DoAction((MetaTextColorAction &)*pAct); break; - case META_TEXTFILLCOLOR_ACTION : DoAction((MetaTextFillColorAction &)*pAct); break; - case META_FONT_ACTION : DoAction((MetaFontAction &)*pAct); break; - case META_TEXTALIGN_ACTION : DoAction((MetaTextAlignAction &)*pAct); break; - case META_MAPMODE_ACTION : DoAction((MetaMapModeAction &)*pAct); break; - case META_CLIPREGION_ACTION : DoAction((MetaClipRegionAction &)*pAct); break; - case META_MOVECLIPREGION_ACTION : DoAction((MetaMoveClipRegionAction &)*pAct); break; - case META_ISECTRECTCLIPREGION_ACTION: DoAction((MetaISectRectClipRegionAction&)*pAct); break; - case META_ISECTREGIONCLIPREGION_ACTION: DoAction((MetaISectRegionClipRegionAction&)*pAct); break; - case META_RASTEROP_ACTION : DoAction((MetaRasterOpAction &)*pAct); break; - case META_PUSH_ACTION : DoAction((MetaPushAction &)*pAct); break; - case META_POP_ACTION : DoAction((MetaPopAction &)*pAct); break; - case META_HATCH_ACTION : DoAction((MetaHatchAction &)*pAct); break; + case META_PIXEL_ACTION : DoAction(static_cast<MetaPixelAction &>(*pAct)); break; + case META_POINT_ACTION : DoAction(static_cast<MetaPointAction &>(*pAct)); break; + case META_LINE_ACTION : DoAction(static_cast<MetaLineAction &>(*pAct)); break; + case META_RECT_ACTION : DoAction(static_cast<MetaRectAction &>(*pAct)); break; + case META_ROUNDRECT_ACTION : DoAction(static_cast<MetaRoundRectAction &>(*pAct)); break; + case META_ELLIPSE_ACTION : DoAction(static_cast<MetaEllipseAction &>(*pAct)); break; + case META_ARC_ACTION : DoAction(static_cast<MetaArcAction &>(*pAct)); break; + case META_PIE_ACTION : DoAction(static_cast<MetaPieAction &>(*pAct)); break; + case META_CHORD_ACTION : DoAction(static_cast<MetaChordAction &>(*pAct)); break; + case META_POLYLINE_ACTION : DoAction(static_cast<MetaPolyLineAction &>(*pAct)); break; + case META_POLYGON_ACTION : DoAction(static_cast<MetaPolygonAction &>(*pAct)); break; + case META_POLYPOLYGON_ACTION : DoAction(static_cast<MetaPolyPolygonAction &>(*pAct)); break; + case META_TEXT_ACTION : DoAction(static_cast<MetaTextAction &>(*pAct)); break; + case META_TEXTARRAY_ACTION : DoAction(static_cast<MetaTextArrayAction &>(*pAct)); break; + case META_STRETCHTEXT_ACTION : DoAction(static_cast<MetaStretchTextAction &>(*pAct)); break; + case META_BMP_ACTION : DoAction(static_cast<MetaBmpAction &>(*pAct)); break; + case META_BMPSCALE_ACTION : DoAction(static_cast<MetaBmpScaleAction &>(*pAct)); break; + case META_BMPEX_ACTION : DoAction(static_cast<MetaBmpExAction &>(*pAct)); break; + case META_BMPEXSCALE_ACTION : DoAction(static_cast<MetaBmpExScaleAction &>(*pAct)); break; + case META_LINECOLOR_ACTION : DoAction(static_cast<MetaLineColorAction &>(*pAct)); break; + case META_FILLCOLOR_ACTION : DoAction(static_cast<MetaFillColorAction &>(*pAct)); break; + case META_TEXTCOLOR_ACTION : DoAction(static_cast<MetaTextColorAction &>(*pAct)); break; + case META_TEXTFILLCOLOR_ACTION : DoAction(static_cast<MetaTextFillColorAction &>(*pAct)); break; + case META_FONT_ACTION : DoAction(static_cast<MetaFontAction &>(*pAct)); break; + case META_TEXTALIGN_ACTION : DoAction(static_cast<MetaTextAlignAction &>(*pAct)); break; + case META_MAPMODE_ACTION : DoAction(static_cast<MetaMapModeAction &>(*pAct)); break; + case META_CLIPREGION_ACTION : DoAction(static_cast<MetaClipRegionAction &>(*pAct)); break; + case META_MOVECLIPREGION_ACTION : DoAction(static_cast<MetaMoveClipRegionAction &>(*pAct)); break; + case META_ISECTRECTCLIPREGION_ACTION: DoAction(static_cast<MetaISectRectClipRegionAction&>(*pAct)); break; + case META_ISECTREGIONCLIPREGION_ACTION: DoAction(static_cast<MetaISectRegionClipRegionAction&>(*pAct)); break; + case META_RASTEROP_ACTION : DoAction(static_cast<MetaRasterOpAction &>(*pAct)); break; + case META_PUSH_ACTION : DoAction(static_cast<MetaPushAction &>(*pAct)); break; + case META_POP_ACTION : DoAction(static_cast<MetaPopAction &>(*pAct)); break; + case META_HATCH_ACTION : DoAction(static_cast<MetaHatchAction &>(*pAct)); break; // #i125211# MetaCommentAction may change index, thus hand it over - case META_COMMENT_ACTION : DoAction((MetaCommentAction&)*pAct, rMtf, a); + case META_COMMENT_ACTION : DoAction(static_cast<MetaCommentAction&>(*pAct), rMtf, a); break; // missing actions added - case META_TEXTRECT_ACTION : DoAction((MetaTextRectAction&)*pAct); break; - case META_BMPSCALEPART_ACTION : DoAction((MetaBmpScalePartAction&)*pAct); break; - case META_BMPEXSCALEPART_ACTION : DoAction((MetaBmpExScalePartAction&)*pAct); break; - case META_MASK_ACTION : DoAction((MetaMaskAction&)*pAct); break; - case META_MASKSCALE_ACTION : DoAction((MetaMaskScaleAction&)*pAct); break; - case META_MASKSCALEPART_ACTION : DoAction((MetaMaskScalePartAction&)*pAct); break; - case META_GRADIENT_ACTION : DoAction((MetaGradientAction&)*pAct); break; - case META_WALLPAPER_ACTION : DoAction((MetaWallpaperAction&)*pAct); break; - case META_TRANSPARENT_ACTION : DoAction((MetaTransparentAction&)*pAct); break; - case META_EPS_ACTION : DoAction((MetaEPSAction&)*pAct); break; - case META_REFPOINT_ACTION : DoAction((MetaRefPointAction&)*pAct); break; - case META_TEXTLINECOLOR_ACTION : DoAction((MetaTextLineColorAction&)*pAct); break; - case META_TEXTLINE_ACTION : DoAction((MetaTextLineAction&)*pAct); break; - case META_FLOATTRANSPARENT_ACTION : DoAction((MetaFloatTransparentAction&)*pAct); break; - case META_GRADIENTEX_ACTION : DoAction((MetaGradientExAction&)*pAct); break; - case META_LAYOUTMODE_ACTION : DoAction((MetaLayoutModeAction&)*pAct); break; - case META_TEXTLANGUAGE_ACTION : DoAction((MetaTextLanguageAction&)*pAct); break; - case META_OVERLINECOLOR_ACTION : DoAction((MetaOverlineColorAction&)*pAct); break; + case META_TEXTRECT_ACTION : DoAction(static_cast<MetaTextRectAction&>(*pAct)); break; + case META_BMPSCALEPART_ACTION : DoAction(static_cast<MetaBmpScalePartAction&>(*pAct)); break; + case META_BMPEXSCALEPART_ACTION : DoAction(static_cast<MetaBmpExScalePartAction&>(*pAct)); break; + case META_MASK_ACTION : DoAction(static_cast<MetaMaskAction&>(*pAct)); break; + case META_MASKSCALE_ACTION : DoAction(static_cast<MetaMaskScaleAction&>(*pAct)); break; + case META_MASKSCALEPART_ACTION : DoAction(static_cast<MetaMaskScalePartAction&>(*pAct)); break; + case META_GRADIENT_ACTION : DoAction(static_cast<MetaGradientAction&>(*pAct)); break; + case META_WALLPAPER_ACTION : DoAction(static_cast<MetaWallpaperAction&>(*pAct)); break; + case META_TRANSPARENT_ACTION : DoAction(static_cast<MetaTransparentAction&>(*pAct)); break; + case META_EPS_ACTION : DoAction(static_cast<MetaEPSAction&>(*pAct)); break; + case META_REFPOINT_ACTION : DoAction(static_cast<MetaRefPointAction&>(*pAct)); break; + case META_TEXTLINECOLOR_ACTION : DoAction(static_cast<MetaTextLineColorAction&>(*pAct)); break; + case META_TEXTLINE_ACTION : DoAction(static_cast<MetaTextLineAction&>(*pAct)); break; + case META_FLOATTRANSPARENT_ACTION : DoAction(static_cast<MetaFloatTransparentAction&>(*pAct)); break; + case META_GRADIENTEX_ACTION : DoAction(static_cast<MetaGradientExAction&>(*pAct)); break; + case META_LAYOUTMODE_ACTION : DoAction(static_cast<MetaLayoutModeAction&>(*pAct)); break; + case META_TEXTLANGUAGE_ACTION : DoAction(static_cast<MetaTextLanguageAction&>(*pAct)); break; + case META_OVERLINECOLOR_ACTION : DoAction(static_cast<MetaOverlineColorAction&>(*pAct)); break; } if(pProgrInfo && pActionsToReport) @@ -1273,7 +1273,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction& rAct, GDIMetaFile& rM while( pSkipAct && ((pSkipAct->GetType() != META_COMMENT_ACTION ) - || !(((MetaCommentAction*)pSkipAct)->GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_END")))) + || !(static_cast<MetaCommentAction*>(pSkipAct)->GetComment().equalsIgnoreAsciiCase("XGRAD_SEQ_END")))) { pSkipAct = rMtf.GetAction(++a); } diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index ac6b72748126..caa76d8f7340 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -1201,9 +1201,9 @@ void SdrHdlGradient::FromIAOToItem(SdrObject* _pObj, bool bSetItemOnObject, bool aGradTransVector.aCol2 = pColHdl2->GetColor(); if(IsGradient()) - aOldGradTransGradient.aGradient = ((XFillGradientItem&)rSet.Get(XATTR_FILLGRADIENT)).GetGradientValue(); + aOldGradTransGradient.aGradient = static_cast<const XFillGradientItem&>(rSet.Get(XATTR_FILLGRADIENT)).GetGradientValue(); else - aOldGradTransGradient.aGradient = ((XFillFloatTransparenceItem&)rSet.Get(XATTR_FILLFLOATTRANSPARENCE)).GetGradientValue(); + aOldGradTransGradient.aGradient = static_cast<const XFillFloatTransparenceItem&>(rSet.Get(XATTR_FILLFLOATTRANSPARENCE)).GetGradientValue(); // transform vector data to gradient aGradTransformer.VecToGrad(aGradTransVector, aGradTransGradient, aOldGradTransGradient, _pObj, bMoveSingleHandle, bMoveFirstHandle); @@ -1447,7 +1447,7 @@ void ImpEdgeHdl::CreateB2dIAObject() if(pView && !pView->areMarkHandlesHidden()) { - const SdrEdgeObj* pEdge = (SdrEdgeObj*)pObj; + const SdrEdgeObj* pEdge = static_cast<SdrEdgeObj*>(pObj); if(pEdge->GetConnectedNode(nObjHdlNum == 0) != NULL) eColIndex = LightRed; @@ -1531,7 +1531,7 @@ bool ImpEdgeHdl::IsHorzDrag() const if (nObjHdlNum<=1) return false; - SdrEdgeKind eEdgeKind = ((SdrEdgeKindItem&)(pEdge->GetObjectItem(SDRATTR_EDGEKIND))).GetValue(); + SdrEdgeKind eEdgeKind = static_cast<const SdrEdgeKindItem&>(pEdge->GetObjectItem(SDRATTR_EDGEKIND)).GetValue(); const SdrEdgeInfoRec& rInfo=pEdge->aEdgeInfo; if (eEdgeKind==SDREDGE_ORTHOLINES || eEdgeKind==SDREDGE_BEZIER) @@ -1727,7 +1727,7 @@ static bool ImpSdrHdlListSorter(SdrHdl* const& lhs, SdrHdl* const& rhs) if (nNum1==nNum2) { if (eKind1==eKind2) - return (sal_IntPtr)lhs<(sal_IntPtr)rhs; // Hack, to always get to the same sorting + return lhs<rhs; // Hack, to always get to the same sorting return (sal_uInt16)eKind1<(sal_uInt16)eKind2; } else @@ -1735,12 +1735,12 @@ static bool ImpSdrHdlListSorter(SdrHdl* const& lhs, SdrHdl* const& rhs) } else { - return (sal_IntPtr)pObj1<(sal_IntPtr)pObj2; + return pObj1<pObj2; } } else { - return (sal_IntPtr)pPV1<(sal_IntPtr)pPV2; + return pPV1<pPV2; } } else diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index 3a54e6458e03..97e9bcf989b8 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -614,21 +614,21 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI case XATTR_LINETRANSPARENCE : { rIndent=1; if (ImpGetItem(*pSet,XATTR_LINESTYLE,pItem)) { - XLineStyle eLineStyle=((const XLineStyleItem*)pItem)->GetValue(); + XLineStyle eLineStyle=static_cast<const XLineStyleItem*>(pItem)->GetValue(); if (eLineStyle==XLINE_NONE) return true; if (eLineStyle!=XLINE_DASH && nWhich==XATTR_LINEDASH) return true; } if (nWhich==XATTR_LINESTART || nWhich==XATTR_LINESTARTCENTER) { rIndent=2; if (ImpGetItem(*pSet,XATTR_LINESTARTWIDTH,pItem)) { - sal_Int32 nWdt=((const XLineStartWidthItem*)pItem)->GetValue(); + sal_Int32 nWdt=static_cast<const XLineStartWidthItem*>(pItem)->GetValue(); if (nWdt==0) return true; } } if (nWhich==XATTR_LINEEND || nWhich==XATTR_LINEENDCENTER) { rIndent=2; if (ImpGetItem(*pSet,XATTR_LINEENDWIDTH,pItem)) { - sal_Int32 nWdt=((const XLineEndWidthItem*)pItem)->GetValue(); + sal_Int32 nWdt=static_cast<const XLineEndWidthItem*>(pItem)->GetValue(); if (nWdt==0) return true; } } @@ -642,7 +642,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI { rIndent=1; if (ImpGetItem(*pSet,XATTR_FILLSTYLE,pItem)) { - drawing::FillStyle eFillStyle=((const XFillStyleItem*)pItem)->GetValue(); + drawing::FillStyle eFillStyle=static_cast<const XFillStyleItem*>(pItem)->GetValue(); if (eFillStyle==drawing::FillStyle_NONE) return true; // transparency currently only for SolidFill if (eFillStyle!=drawing::FillStyle_SOLID && (nWhich==XATTR_FILLCOLOR || nWhich==XATTR_FILLTRANSPARENCE)) return true; @@ -663,7 +663,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI case XATTR_FILLBMP_POSOFFSETY : { /* only if TILE=sal_True*/ rIndent=1; if (ImpGetItem(*pSet,XATTR_FILLSTYLE,pItem)) { - drawing::FillStyle eFillStyle=((const XFillStyleItem*)pItem)->GetValue(); + drawing::FillStyle eFillStyle=static_cast<const XFillStyleItem*>(pItem)->GetValue(); if (eFillStyle!=drawing::FillStyle_BITMAP) return true; } if (nWhich==XATTR_FILLBITMAP || nWhich==XATTR_FILLBMP_TILE) { @@ -673,11 +673,11 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI bool bTileFALSE = false; bool bStretchTRUE = false; if (ImpGetItem(*pSet,XATTR_FILLBMP_TILE,pItem)) { - bTileTRUE=((const XFillBmpTileItem*)pItem)->GetValue(); + bTileTRUE=static_cast<const XFillBmpTileItem*>(pItem)->GetValue(); bTileFALSE=!bTileTRUE; } if (ImpGetItem(*pSet,XATTR_FILLBMP_STRETCH,pItem)) { - bStretchTRUE=((const XFillBmpStretchItem*)pItem)->GetValue(); + bStretchTRUE=static_cast<const XFillBmpStretchItem*>(pItem)->GetValue(); } // Stretch not selectable if Tile=TRUE if (nWhich==XATTR_FILLBMP_STRETCH) return bTileTRUE; @@ -699,11 +699,11 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI sal_uInt16 nX=0,nY=0; bool bX = false,bY = false; if (ImpGetItem(*pSet,XATTR_FILLBMP_TILEOFFSETX,pItem)) { - nX=((const XFillBmpTileOffsetXItem*)pItem)->GetValue(); + nX=static_cast<const XFillBmpTileOffsetXItem*>(pItem)->GetValue(); bX = true; } if (ImpGetItem(*pSet,XATTR_FILLBMP_TILEOFFSETY,pItem)) { - nY=((const XFillBmpTileOffsetYItem*)pItem)->GetValue(); + nY=static_cast<const XFillBmpTileOffsetYItem*>(pItem)->GetValue(); bY = true; } if (nWhich==XATTR_FILLBMP_TILEOFFSETX) { @@ -736,13 +736,13 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI case XATTR_FORMTXTSHDWTRANSP: { rIndent=1; if (ImpGetItem(*pSet,XATTR_FORMTXTSTYLE,pItem)) { - XFormTextStyle eStyle=((const XFormTextStyleItem*)pItem)->GetValue(); + XFormTextStyle eStyle=static_cast<const XFormTextStyleItem*>(pItem)->GetValue(); if (eStyle==XFT_NONE) return true; } if ((nWhich>=XATTR_FORMTXTSHDWCOLOR && nWhich<=XATTR_FORMTXTSHDWYVAL) || nWhich>=XATTR_FORMTXTSHDWTRANSP) { rIndent=2; if (ImpGetItem(*pSet,XATTR_FORMTXTSHADOW,pItem)) { - XFormTextShadow eShadow=((const XFormTextShadowItem*)pItem)->GetValue(); + XFormTextShadow eShadow=static_cast<const XFormTextShadowItem*>(pItem)->GetValue(); if (eShadow==XFTSHADOW_NONE) return true; } } @@ -756,7 +756,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI case SDRATTR_SHADOWPERSP : { rIndent=1; if (ImpGetItem(*pSet,SDRATTR_SHADOW,pItem)) { - bool bShadow=((const SdrOnOffItem*)pItem)->GetValue(); + bool bShadow=static_cast<const SdrOnOffItem*>(pItem)->GetValue(); if (!bShadow) return true; } } break; @@ -764,7 +764,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI case SDRATTR_CAPTIONANGLE: { rIndent=1; if (ImpGetItem(*pSet,SDRATTR_CAPTIONFIXEDANGLE,pItem)) { - bool bFixed=((const SdrOnOffItem*)pItem)->GetValue(); + bool bFixed=static_cast<const SdrOnOffItem*>(pItem)->GetValue(); if (!bFixed) return true; } } break; @@ -772,7 +772,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI case SDRATTR_CAPTIONESCABS: { rIndent=1; if (ImpGetItem(*pSet,SDRATTR_CAPTIONESCISREL,pItem)) { - bool bRel=((const SdrCaptionEscIsRelItem*)pItem)->GetValue(); + bool bRel=static_cast<const SdrCaptionEscIsRelItem*>(pItem)->GetValue(); if (bRel && nWhich==SDRATTR_CAPTIONESCABS) return true; if (!bRel && nWhich==SDRATTR_CAPTIONESCREL) return true; } @@ -780,7 +780,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI case SDRATTR_CAPTIONLINELEN: { rIndent=1; if (ImpGetItem(*pSet,SDRATTR_CAPTIONFITLINELEN,pItem)) { - bool bFit=((const SdrCaptionFitLineLenItem*)pItem)->GetValue(); + bool bFit=static_cast<const SdrCaptionFitLineLenItem*>(pItem)->GetValue(); if (bFit) return true; } } break; @@ -789,7 +789,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI case SDRATTR_TEXT_MAXFRAMEHEIGHT: { rIndent=1; if (ImpGetItem(*pSet,SDRATTR_TEXT_AUTOGROWHEIGHT,pItem)) { - bool bAutoGrow=((const SdrOnOffItem*)pItem)->GetValue(); + bool bAutoGrow=static_cast<const SdrOnOffItem*>(pItem)->GetValue(); if (!bAutoGrow) return true; } } break; @@ -797,14 +797,14 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI case SDRATTR_TEXT_MAXFRAMEWIDTH: { rIndent=1; if (ImpGetItem(*pSet,SDRATTR_TEXT_AUTOGROWWIDTH,pItem)) { - bool bAutoGrow=((const SdrOnOffItem*)pItem)->GetValue(); + bool bAutoGrow=static_cast<const SdrOnOffItem*>(pItem)->GetValue(); if (!bAutoGrow) return true; } } break; case SDRATTR_TEXT_VERTADJUST: case SDRATTR_TEXT_HORZADJUST: { if (ImpGetItem(*pSet,SDRATTR_TEXT_FITTOSIZE,pItem)) { - SdrFitToSizeType eFit=((const SdrTextFitToSizeTypeItem*)pItem)->GetValue(); + SdrFitToSizeType eFit=static_cast<const SdrTextFitToSizeTypeItem*>(pItem)->GetValue(); if (eFit!=SDRTEXTFIT_NONE) return true; } } break; @@ -817,7 +817,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI case SDRATTR_TEXT_ANIAMOUNT : { rIndent=1; if (ImpGetItem(*pSet,SDRATTR_TEXT_ANIKIND,pItem)) { - SdrTextAniKind eAniKind=((const SdrTextAniKindItem*)pItem)->GetValue(); + SdrTextAniKind eAniKind=static_cast<const SdrTextAniKindItem*>(pItem)->GetValue(); if (eAniKind==SDRTEXTANI_NONE) return true; if (eAniKind==SDRTEXTANI_BLINK && (nWhich==SDRATTR_TEXT_ANIDIRECTION || nWhich==SDRATTR_TEXT_ANIAMOUNT)) return true; if (eAniKind==SDRTEXTANI_SLIDE && (nWhich==SDRATTR_TEXT_ANISTARTINSIDE || nWhich==SDRATTR_TEXT_ANISTOPINSIDE)) return true; @@ -829,7 +829,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI case SDRATTR_EDGELINE2DELTA: case SDRATTR_EDGELINE3DELTA: { if (ImpGetItem(*pSet,SDRATTR_EDGEKIND,pItem)) { - SdrEdgeKind eKind=((const SdrEdgeKindItem*)pItem)->GetValue(); + SdrEdgeKind eKind=static_cast<const SdrEdgeKindItem*>(pItem)->GetValue(); if (eKind==SDREDGE_THREELINES) { if (nWhich>SDRATTR_EDGELINE2DELTA) return true; else return false; @@ -837,7 +837,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI if (eKind!=SDREDGE_ORTHOLINES && eKind!=SDREDGE_BEZIER) return true; } if (ImpGetItem(*pSet,SDRATTR_EDGELINEDELTAANZ,pItem)) { - sal_uInt16 nAnz=((const SdrEdgeLineDeltaAnzItem*)pItem)->GetValue(); + sal_uInt16 nAnz=static_cast<const SdrEdgeLineDeltaAnzItem*>(pItem)->GetValue(); if (nAnz==0) return true; if (nAnz==1 && nWhich>SDRATTR_EDGELINE1DELTA) return true; if (nAnz==2 && nWhich>SDRATTR_EDGELINE2DELTA) return true; @@ -848,7 +848,7 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI case SDRATTR_CIRCENDANGLE : { rIndent=1; if (ImpGetItem(*pSet,SDRATTR_CIRCKIND,pItem)) { - SdrCircKind eKind=((const SdrCircKindItem*)pItem)->GetValue(); + SdrCircKind eKind=static_cast<const SdrCircKindItem*>(pItem)->GetValue(); if (eKind==SDRCIRC_FULL) return true; } } break; @@ -994,16 +994,16 @@ void _SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItem else if (HAS_BASE(SvxCharScaleWidthItem,&rItem)) aEntry.eItemType=ITEM_FONTWIDTH; else if (HAS_BASE(SvxFieldItem ,&rItem)) aEntry.eItemType=ITEM_FIELD; switch (aEntry.eItemType) { - case ITEM_BYTE : aEntry.bIsNum = true; aEntry.nVal=((SfxByteItem &)rItem).GetValue(); aEntry.nMin=0; aEntry.nMax=255; break; - case ITEM_INT16 : aEntry.bIsNum = true; aEntry.nVal=((SfxInt16Item &)rItem).GetValue(); aEntry.nMin=-32767; aEntry.nMax=32767; break; - case ITEM_UINT16 : aEntry.bIsNum = true; aEntry.nVal=((SfxUInt16Item&)rItem).GetValue(); aEntry.nMin=0; aEntry.nMax=65535; break; - case ITEM_INT32 : aEntry.bIsNum = true; aEntry.nVal=((SfxInt32Item &)rItem).GetValue(); break; - case ITEM_UINT32 : aEntry.bIsNum = true; aEntry.nVal=((SfxUInt32Item&)rItem).GetValue(); aEntry.nMin=0; /*aEntry.nMax=0xFF...*/;break; - case ITEM_ENUM : aEntry.bCanNum = true; aEntry.nVal=((SfxEnumItemInterface&)rItem).GetEnumValue(); aEntry.nMin=0; aEntry.nMax=((SfxEnumItemInterface&)rItem).GetValueCount()-1; break; - case ITEM_BOOL : aEntry.bCanNum = true; aEntry.nVal=sal_Int32(((SfxBoolItem &)rItem).GetValue()); aEntry.nMin=0; aEntry.nMax=1; break; - case ITEM_FLAG : aEntry.bCanNum = true; aEntry.nVal=((SfxFlagItem &)rItem).GetValue(); aEntry.nMin=0; aEntry.nMax=0xFFFF; break; - case ITEM_FONTHEIGHT: aEntry.bCanNum = true; aEntry.nVal=((SvxFontHeightItem&)rItem).GetHeight(); aEntry.nMin=0; break; - case ITEM_FONTWIDTH : aEntry.bCanNum = true; aEntry.nVal=((SvxCharScaleWidthItem&)rItem).GetValue(); aEntry.nMin=0; aEntry.nMax=0xFFFF;break; + case ITEM_BYTE : aEntry.bIsNum = true; aEntry.nVal=static_cast<const SfxByteItem &>(rItem).GetValue(); aEntry.nMin=0; aEntry.nMax=255; break; + case ITEM_INT16 : aEntry.bIsNum = true; aEntry.nVal=static_cast<const SfxInt16Item &>(rItem).GetValue(); aEntry.nMin=-32767; aEntry.nMax=32767; break; + case ITEM_UINT16 : aEntry.bIsNum = true; aEntry.nVal=static_cast<const SfxUInt16Item&>(rItem).GetValue(); aEntry.nMin=0; aEntry.nMax=65535; break; + case ITEM_INT32 : aEntry.bIsNum = true; aEntry.nVal=static_cast<const SfxInt32Item &>(rItem).GetValue(); break; + case ITEM_UINT32 : aEntry.bIsNum = true; aEntry.nVal=static_cast<const SfxUInt32Item&>(rItem).GetValue(); aEntry.nMin=0; /*aEntry.nMax=0xFF...*/;break; + case ITEM_ENUM : aEntry.bCanNum = true; aEntry.nVal=static_cast<const SfxEnumItemInterface&>(rItem).GetEnumValue(); aEntry.nMin=0; aEntry.nMax=static_cast<const SfxEnumItemInterface&>(rItem).GetValueCount()-1; break; + case ITEM_BOOL : aEntry.bCanNum = true; aEntry.nVal=sal_Int32(static_cast<const SfxBoolItem &>(rItem).GetValue()); aEntry.nMin=0; aEntry.nMax=1; break; + case ITEM_FLAG : aEntry.bCanNum = true; aEntry.nVal=static_cast<const SfxFlagItem &>(rItem).GetValue(); aEntry.nMin=0; aEntry.nMax=0xFFFF; break; + case ITEM_FONTHEIGHT: aEntry.bCanNum = true; aEntry.nVal=static_cast<const SvxFontHeightItem&>(rItem).GetHeight(); aEntry.nMin=0; break; + case ITEM_FONTWIDTH : aEntry.bCanNum = true; aEntry.nVal=static_cast<const SvxCharScaleWidthItem&>(rItem).GetValue(); aEntry.nMin=0; aEntry.nMax=0xFFFF;break; default: break; } // switch if (aEntry.bIsNum) aEntry.bCanNum = true; @@ -1090,7 +1090,7 @@ vcl::Window* SdrItemBrowser::ImpGetViewWin(SdrView& rView) if(OUTDEV_WINDOW == pCandidate->GetOutputDevice().GetOutDevType()) { - return (vcl::Window*)(&pCandidate->GetOutputDevice()); + return static_cast<vcl::Window*>(&pCandidate->GetOutputDevice()); } } @@ -1180,9 +1180,9 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse) nLongY = s.toInt32(); } switch (pEntry->eItemType) { - case ITEM_BYTE : ((SfxByteItem *)pNewItem)->SetValue((sal_uInt8 )nLongVal); break; - case ITEM_INT16 : ((SfxInt16Item *)pNewItem)->SetValue((sal_Int16 )nLongVal); break; - case ITEM_UINT16: ((SfxUInt16Item*)pNewItem)->SetValue((sal_uInt16)nLongVal); break; + case ITEM_BYTE : static_cast<SfxByteItem *>(pNewItem)->SetValue((sal_uInt8 )nLongVal); break; + case ITEM_INT16 : static_cast<SfxInt16Item *>(pNewItem)->SetValue((sal_Int16 )nLongVal); break; + case ITEM_UINT16: static_cast<SfxUInt16Item*>(pNewItem)->SetValue((sal_uInt16)nLongVal); break; case ITEM_INT32: { if(HAS_BASE(SdrAngleItem, pNewItem)) { @@ -1190,10 +1190,10 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse) double nVal = aNewText.toFloat(); nLongVal = (long)(nVal * 100 + 0.5); } - ((SfxInt32Item *)pNewItem)->SetValue((sal_Int32)nLongVal); + static_cast<SfxInt32Item *>(pNewItem)->SetValue((sal_Int32)nLongVal); } break; - case ITEM_UINT32: ((SfxUInt32Item*)pNewItem)->SetValue(aNewText.toInt32()); break; - case ITEM_ENUM : ((SfxEnumItemInterface*)pNewItem)->SetEnumValue((sal_uInt16)nLongVal); break; + case ITEM_UINT32: static_cast<SfxUInt32Item*>(pNewItem)->SetValue(aNewText.toInt32()); break; + case ITEM_ENUM : static_cast<SfxEnumItemInterface*>(pNewItem)->SetEnumValue((sal_uInt16)nLongVal); break; case ITEM_BOOL: { aNewText = aNewText.toAsciiUpperCase(); if (aNewText == "TRUE") nLongVal=1; @@ -1202,29 +1202,29 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse) if (aNewText == "EIN") nLongVal=1; if (aNewText == "ON") nLongVal=1; if (aNewText == "YES") nLongVal=1; - ((SfxBoolItem*)pNewItem)->SetValue(nLongVal == 1); + static_cast<SfxBoolItem*>(pNewItem)->SetValue(nLongVal == 1); } break; - case ITEM_FLAG : ((SfxFlagItem *)pNewItem)->SetValue((sal_uInt16)nLongVal); break; - case ITEM_STRING: ((SfxStringItem*)pNewItem)->SetValue(aNewText); break; - case ITEM_POINT : ((SfxPointItem*)pNewItem)->SetValue(Point(nLongX,nLongY)); break; + case ITEM_FLAG : static_cast<SfxFlagItem *>(pNewItem)->SetValue((sal_uInt16)nLongVal); break; + case ITEM_STRING: static_cast<SfxStringItem*>(pNewItem)->SetValue(aNewText); break; + case ITEM_POINT : static_cast<SfxPointItem*>(pNewItem)->SetValue(Point(nLongX,nLongY)); break; case ITEM_RECT : break; case ITEM_RANGE : { - ((SfxRangeItem*)pNewItem)->From()=(sal_uInt16)nLongX; - ((SfxRangeItem*)pNewItem)->From()=(sal_uInt16)nLongY; + static_cast<SfxRangeItem*>(pNewItem)->From()=(sal_uInt16)nLongX; + static_cast<SfxRangeItem*>(pNewItem)->From()=(sal_uInt16)nLongY; } break; case ITEM_LRANGE : { } break; case ITEM_FRACTION: { if (!bPairX) nLongX=1; if (!bPairY) nLongY=1; - ((SdrFractionItem*)pNewItem)->SetValue(boost::rational<sal_Int64>(nLongX,nLongY)); + static_cast<SdrFractionItem*>(pNewItem)->SetValue(boost::rational<sal_Int64>(nLongX,nLongY)); } break; case ITEM_XCOLOR: break; case ITEM_COLOR: break; case ITEM_FONT: { - ((SvxFontItem*)pNewItem)->SetFamily( FAMILY_DONTKNOW ); - ((SvxFontItem*)pNewItem)->SetFamilyName(aNewText); - ((SvxFontItem*)pNewItem)->SetStyleName(OUString()); + static_cast<SvxFontItem*>(pNewItem)->SetFamily( FAMILY_DONTKNOW ); + static_cast<SvxFontItem*>(pNewItem)->SetFamilyName(aNewText); + static_cast<SvxFontItem*>(pNewItem)->SetStyleName(OUString()); } break; case ITEM_FONTHEIGHT: { sal_uIntPtr nHgt=0; @@ -1234,14 +1234,14 @@ IMPL_LINK(SdrItemBrowser,ChangedHdl,_SdrItemBrowserControl*,pBrowse) } else { nHgt=nLongVal; } - ((SvxFontHeightItem*)pNewItem)->SetHeight(nHgt,nProp); + static_cast<SvxFontHeightItem*>(pNewItem)->SetHeight(nHgt,nProp); } break; case ITEM_FONTWIDTH: { sal_uInt16 nProp=100; if (aNewText.indexOf('%') != -1) { nProp=(sal_uInt16)nLongVal; } - ((SvxCharScaleWidthItem*)pNewItem)->SetValue(nProp); + static_cast<SvxCharScaleWidthItem*>(pNewItem)->SetValue(nProp); } break; case ITEM_FIELD: break; default: break; diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx index 391afa307f07..3897d2f3d757 100644 --- a/svx/source/svdraw/svdmark.cxx +++ b/svx/source/svdraw/svdmark.cxx @@ -235,7 +235,7 @@ static bool ImpSdrMarkListSorter(SdrMark* const& lhs, SdrMark* const& rhs) } else { - return (sal_IntPtr)pOL1 < (sal_IntPtr)pOL2; + return pOL1 < pOL2; } } diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 409f5c9bc14d..7760611f76d9 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -195,7 +195,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe // using static SdrEngineDefaults only if default SvxFontHeight item is not available const SfxPoolItem* pPoolItem = pItemPool->GetPoolDefaultItem( EE_CHAR_FONTHEIGHT ); if ( pPoolItem ) - nDefTextHgt = ((SvxFontHeightItem*)pPoolItem)->GetHeight(); + nDefTextHgt = static_cast<const SvxFontHeightItem*>(pPoolItem)->GetHeight(); else nDefTextHgt = SdrEngineDefaults::GetFontHeight(); @@ -1821,26 +1821,26 @@ void SdrModel::MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSe switch( nWhich ) { case XATTR_FILLBITMAP: - pResultItem = ((XFillBitmapItem*)pPoolItem)->checkForUniqueItem( pNewModel ); + pResultItem = static_cast<const XFillBitmapItem*>(pPoolItem)->checkForUniqueItem( pNewModel ); break; case XATTR_LINEDASH: - pResultItem = ((XLineDashItem*)pPoolItem)->checkForUniqueItem( pNewModel ); + pResultItem = static_cast<const XLineDashItem*>(pPoolItem)->checkForUniqueItem( pNewModel ); break; case XATTR_LINESTART: - pResultItem = ((XLineStartItem*)pPoolItem)->checkForUniqueItem( pNewModel ); + pResultItem = static_cast<const XLineStartItem*>(pPoolItem)->checkForUniqueItem( pNewModel ); break; case XATTR_LINEEND: - pResultItem = ((XLineEndItem*)pPoolItem)->checkForUniqueItem( pNewModel ); + pResultItem = static_cast<const XLineEndItem*>(pPoolItem)->checkForUniqueItem( pNewModel ); break; case XATTR_FILLGRADIENT: - pResultItem = ((XFillGradientItem*)pPoolItem)->checkForUniqueItem( pNewModel ); + pResultItem = static_cast<const XFillGradientItem*>(pPoolItem)->checkForUniqueItem( pNewModel ); break; case XATTR_FILLFLOATTRANSPARENCE: // allow all kinds of XFillFloatTransparenceItem to be set - pResultItem = ((XFillFloatTransparenceItem*)pPoolItem)->checkForUniqueItem( pNewModel ); + pResultItem = static_cast<const XFillFloatTransparenceItem*>(pPoolItem)->checkForUniqueItem( pNewModel ); break; case XATTR_FILLHATCH: - pResultItem = ((XFillHatchItem*)pPoolItem)->checkForUniqueItem( pNewModel ); + pResultItem = static_cast<const XFillHatchItem*>(pPoolItem)->checkForUniqueItem( pNewModel ); break; } diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 3a41d0b7fd5b..66adc70e5167 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -109,7 +109,7 @@ void ImplMarkingOverlay::SetSecondPosition(const basegfx::B2DPoint& rNewPosition // apply to OverlayObjects for(sal_uInt32 a(0L); a < maObjects.count(); a++) { - ::sdr::overlay::OverlayRollingRectangleStriped& rCandidate = (::sdr::overlay::OverlayRollingRectangleStriped&)maObjects.getOverlayObject(a); + ::sdr::overlay::OverlayRollingRectangleStriped& rCandidate = static_cast< ::sdr::overlay::OverlayRollingRectangleStriped&>(maObjects.getOverlayObject(a)); rCandidate.setSecondPosition(rNewPosition); } @@ -202,7 +202,7 @@ void SdrMarkView::ModelHasChanged() SortMarkedObjects(); bMrkPntDirty=true; UndirtyMrkPnt(); - SdrView* pV=(SdrView*)this; + SdrView* pV=static_cast<SdrView*>(this); if (pV!=NULL && !pV->IsDragObj() && !pV->IsInsObjPoint()) { AdjustMarkHdl(); } @@ -679,7 +679,7 @@ void SdrMarkView::SetMarkHandles() // SdrObjEditView::ImpPaintOutlinerView in this case. This needs to be reworked // in the future // Also formally #122142#: Pretty much the same for SdrCaptionObj's in calc. - if(((SdrView*)this)->IsTextEdit()) + if(static_cast<SdrView*>(this)->IsTextEdit()) { const SdrTextObj* pSdrTextObj = dynamic_cast< const SdrTextObj* >(pMarkedObj); @@ -932,7 +932,7 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) { // add this item, it's not yet there XFillFloatTransparenceItem aNewItem( - (const XFillFloatTransparenceItem&)rSet.Get(XATTR_FILLFLOATTRANSPARENCE)); + static_cast<const XFillFloatTransparenceItem&>(rSet.Get(XATTR_FILLFLOATTRANSPARENCE))); XGradient aGrad = aNewItem.GetGradientValue(); aNewItem.SetEnabled(true); @@ -958,7 +958,7 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) GradTransVector aGradTransVector; GradTransGradient aGradTransGradient; - aGradTransGradient.aGradient = ((XFillFloatTransparenceItem&)rSet.Get(XATTR_FILLFLOATTRANSPARENCE)).GetGradientValue(); + aGradTransGradient.aGradient = static_cast<const XFillFloatTransparenceItem&>(rSet.Get(XATTR_FILLFLOATTRANSPARENCE)).GetGradientValue(); aGradTransformer.GradToVec(aGradTransGradient, aGradTransVector, pObj); // build handles @@ -990,7 +990,7 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) { SdrObject* pObj = GetMarkedObjectByIndex(0); const SfxItemSet& rSet = pObj->GetMergedItemSet(); - drawing::FillStyle eFillStyle = ((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue(); + drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(rSet.Get(XATTR_FILLSTYLE)).GetValue(); if(eFillStyle == drawing::FillStyle_GRADIENT) { @@ -1000,7 +1000,7 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) GradTransGradient aGradTransGradient; Size aHdlSize(15, 15); - aGradTransGradient.aGradient = ((XFillGradientItem&)rSet.Get(XATTR_FILLGRADIENT)).GetGradientValue(); + aGradTransGradient.aGradient = static_cast<const XFillGradientItem&>(rSet.Get(XATTR_FILLGRADIENT)).GetGradientValue(); aGradTransformer.GradToVec(aGradTransGradient, aGradTransVector, pObj); // build handles @@ -1262,11 +1262,11 @@ void SdrMarkView::SetEditMode(SdrViewEditMode eMode) { if (eMode!=eEditMode) { bool bGlue0=eEditMode==SDREDITMODE_GLUEPOINTEDIT; - bool bEdge0=((SdrCreateView*)this)->IsEdgeTool(); + bool bEdge0=static_cast<SdrCreateView*>(this)->IsEdgeTool(); eEditMode0=eEditMode; eEditMode=eMode; bool bGlue1=eEditMode==SDREDITMODE_GLUEPOINTEDIT; - bool bEdge1=((SdrCreateView*)this)->IsEdgeTool(); + bool bEdge1=static_cast<SdrCreateView*>(this)->IsEdgeTool(); // avoid flickering when switching between GlueEdit and EdgeTool if (bGlue1 && !bGlue0) ImpSetGlueVisible2(bGlue1); if (bEdge1!=bEdge0) ImpSetGlueVisible3(bEdge1); @@ -1430,7 +1430,7 @@ bool SdrMarkView::MarkNextObj(const Point& rPnt, short nTol, bool bPrev) E3dScene* pScene = NULL; SdrObject* pObjHit = (bPrev) ? pBtmObjHit : pTopObjHit; bool bRemap = pObjHit->ISA(E3dCompoundObject) - ? ((E3dCompoundObject*)pObjHit)->IsAOrdNumRemapCandidate(pScene) + ? static_cast<E3dCompoundObject*>(pObjHit)->IsAOrdNumRemapCandidate(pScene) : false; if(bPrev) @@ -1587,7 +1587,7 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT const bool bCheckIfMarkable(nOptions & SDRSEARCH_TESTMARKABLE); const bool bDeep(nOptions & SDRSEARCH_DEEP); const bool bOLE(pObj->ISA(SdrOle2Obj)); - const bool bTXT(pObj->ISA(SdrTextObj) && ((SdrTextObj*)pObj)->IsTextFrame()); + const bool bTXT(pObj->ISA(SdrTextObj) && static_cast<SdrTextObj*>(pObj)->IsTextFrame()); SdrObject* pRet=NULL; Rectangle aRect(pObj->GetCurrentBoundRect()); // hack for calc grid sync @@ -1596,7 +1596,7 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT // double tolerance for OLE, text frames and objects in // active text edit - if(bOLE || bTXT || pObj==((SdrObjEditView*)this)->GetTextEditObject()) + if(bOLE || bTXT || pObj==static_cast<const SdrObjEditView*>(this)->GetTextEditObject()) { nTol2*=2; } @@ -1657,7 +1657,7 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT if (pOL!=NULL) { bool bRemap(pOL->GetOwnerObj() && pOL->GetOwnerObj()->ISA(E3dScene)); - E3dScene* pRemapScene = (bRemap ? (E3dScene*)pOL->GetOwnerObj() : 0L); + E3dScene* pRemapScene = (bRemap ? static_cast<E3dScene*>(pOL->GetOwnerObj()) : 0L); const size_t nObjAnz=pOL->GetObjCount(); size_t nObjNum=bBack ? 0 : nObjAnz; @@ -1717,10 +1717,10 @@ bool SdrMarkView::PickObj(const Point& rPnt, short nTol, SdrObject*& rpObj, SdrP SdrObject* pObj=NULL; SdrObject* pHitObj=NULL; SdrPageView* pPV=NULL; - if (!bBack && ((SdrObjEditView*)this)->IsTextEditFrameHit(rPnt)) { - pObj=((SdrObjEditView*)this)->GetTextEditObject(); + if (!bBack && static_cast<const SdrObjEditView*>(this)->IsTextEditFrameHit(rPnt)) { + pObj=static_cast<const SdrObjEditView*>(this)->GetTextEditObject(); pHitObj=pObj; - pPV=((SdrObjEditView*)this)->GetTextEditPageView(); + pPV=static_cast<const SdrObjEditView*>(this)->GetTextEditPageView(); } if (bMarked) { const size_t nMrkAnz=GetMarkedObjectCount(); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 3f8b1fddad59..2d01c001d4ce 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -170,13 +170,13 @@ static MSO_SPT ImpGetCustomShapeType( const SdrObjCustomShape& rCustoShape ) { MSO_SPT eRetValue = mso_sptNil; - OUString aEngine( ( (SdrCustomShapeEngineItem&)rCustoShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE ) ).GetValue() ); + OUString aEngine( static_cast<const SdrCustomShapeEngineItem&>( rCustoShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE ) ).GetValue() ); if ( aEngine.isEmpty() || aEngine == "com.sun.star.drawing.EnhancedCustomShapeEngine" ) { OUString sShapeType; const OUString sType( "Type" ); - SdrCustomShapeGeometryItem& rGeometryItem( (SdrCustomShapeGeometryItem&)rCustoShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); - Any* pAny = rGeometryItem.GetPropertyValueByName( sType ); + const SdrCustomShapeGeometryItem& rGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(rCustoShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )) ); + const Any* pAny = rGeometryItem.GetPropertyValueByName( sType ); if ( pAny && ( *pAny >>= sShapeType ) ) eRetValue = EnhancedCustomShapeTypeNames::Get( sShapeType ); } @@ -206,15 +206,15 @@ static bool ImpVerticalSwitch( const SdrObjCustomShape& rCustoShape ) SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemSet& rOriginalSet) { SdrObject* pRetval = 0L; - const bool bShadow(((SdrOnOffItem&)rOriginalSet.Get(SDRATTR_SHADOW)).GetValue()); + const bool bShadow(static_cast<const SdrOnOffItem&>(rOriginalSet.Get(SDRATTR_SHADOW)).GetValue()); if(bShadow) { // create a shadow representing object - const sal_Int32 nXDist(((SdrMetricItem&)(rOriginalSet.Get(SDRATTR_SHADOWXDIST))).GetValue()); - const sal_Int32 nYDist(((SdrMetricItem&)(rOriginalSet.Get(SDRATTR_SHADOWYDIST))).GetValue()); - const ::Color aShadowColor(((XColorItem&)(rOriginalSet.Get(SDRATTR_SHADOWCOLOR))).GetColorValue()); - const sal_uInt16 nShadowTransparence(((SdrPercentItem&)(rOriginalSet.Get(SDRATTR_SHADOWTRANSPARENCE))).GetValue()); + const sal_Int32 nXDist(static_cast<const SdrMetricItem&>(rOriginalSet.Get(SDRATTR_SHADOWXDIST)).GetValue()); + const sal_Int32 nYDist(static_cast<const SdrMetricItem&>(rOriginalSet.Get(SDRATTR_SHADOWYDIST)).GetValue()); + const ::Color aShadowColor(static_cast<const XColorItem&>(rOriginalSet.Get(SDRATTR_SHADOWCOLOR)).GetColorValue()); + const sal_uInt16 nShadowTransparence(static_cast<const SdrPercentItem&>(rOriginalSet.Get(SDRATTR_SHADOWTRANSPARENCE)).GetValue()); pRetval = rOriginal.Clone(); DBG_ASSERT(pRetval, "ImpCreateShadowObjectClone: Could not clone object (!)"); @@ -230,11 +230,11 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS while(aIterator.IsMore()) { SdrObject* pObj = aIterator.Next(); - drawing::FillStyle eFillStyle = ((XFillStyleItem&)(pObj->GetMergedItem(XATTR_FILLSTYLE))).GetValue(); + drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(pObj->GetMergedItem(XATTR_FILLSTYLE)).GetValue(); if(!bLineUsed) { - XLineStyle eLineStyle = ((XLineStyleItem&)(pObj->GetMergedItem(XATTR_LINESTYLE))).GetValue(); + XLineStyle eLineStyle = static_cast<const XLineStyleItem&>(pObj->GetMergedItem(XATTR_LINESTYLE)).GetValue(); if(XLINE_NONE != eLineStyle) { @@ -301,7 +301,7 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS // gradient and transparency like shadow if(bGradientFillUsed) { - XGradient aGradient(((XFillGradientItem&)(rOriginalSet.Get(XATTR_FILLGRADIENT))).GetGradientValue()); + XGradient aGradient(static_cast<const XFillGradientItem&>(rOriginalSet.Get(XATTR_FILLGRADIENT)).GetGradientValue()); sal_uInt8 nStartLuminance(aGradient.GetStartColor().GetLuminance()); sal_uInt8 nEndLuminance(aGradient.GetEndColor().GetLuminance()); @@ -334,7 +334,7 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS // hatch and transparency like shadow if(bHatchFillUsed) { - XHatch aHatch(((XFillHatchItem&)(rOriginalSet.Get(XATTR_FILLHATCH))).GetHatchValue()); + XHatch aHatch(static_cast<const XFillHatchItem&>(rOriginalSet.Get(XATTR_FILLHATCH)).GetHatchValue()); aHatch.SetColor(aShadowColor); aTempSet.Put(XFillHatchItem(aTempSet.GetPool(), aHatch)); aTempSet.Put(XFillTransparenceItem(nShadowTransparence)); @@ -343,7 +343,7 @@ SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const SfxItemS // bitmap and transparency like shadow if(bBitmapFillUsed) { - GraphicObject aGraphicObject(((XFillBitmapItem&)(rOriginalSet.Get(XATTR_FILLBITMAP))).GetGraphicObject()); + GraphicObject aGraphicObject(static_cast<const XFillBitmapItem&>(rOriginalSet.Get(XATTR_FILLBITMAP)).GetGraphicObject()); const BitmapEx aBitmapEx(aGraphicObject.GetGraphic().GetBitmapEx()); Bitmap aBitmap(aBitmapEx.GetBitmap()); @@ -411,7 +411,7 @@ Reference< XCustomShapeEngine > SdrObjCustomShape::GetCustomShapeEngine() const if (mxCustomShapeEngine.is()) return mxCustomShapeEngine; - OUString aEngine(((SdrCustomShapeEngineItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE )).GetValue()); + OUString aEngine(static_cast<const SdrCustomShapeEngineItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE )).GetValue()); if ( aEngine.isEmpty() ) aEngine = "com.sun.star.drawing.EnhancedCustomShapeEngine"; @@ -456,7 +456,7 @@ const SdrObject* SdrObjCustomShape::GetSdrObjectShadowFromCustomShape() const if(pSdrObject) { const SfxItemSet& rOriginalSet = GetObjectItemSet(); - const bool bShadow(((SdrOnOffItem&)rOriginalSet.Get( SDRATTR_SHADOW )).GetValue()); + const bool bShadow(static_cast<const SdrOnOffItem&>(rOriginalSet.Get( SDRATTR_SHADOW )).GetValue()); if(bShadow) { @@ -475,8 +475,8 @@ bool SdrObjCustomShape::IsTextPath() const { const OUString sTextPath( "TextPath" ); bool bTextPathOn = false; - SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); - Any* pAny = rGeometryItem.GetPropertyValueByName( sTextPath, sTextPath ); + const SdrCustomShapeGeometryItem& rGeometryItem = static_cast<const SdrCustomShapeGeometryItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); + const Any* pAny = rGeometryItem.GetPropertyValueByName( sTextPath, sTextPath ); if ( pAny ) *pAny >>= bTextPathOn; return bTextPathOn; @@ -487,8 +487,8 @@ bool SdrObjCustomShape::UseNoFillStyle() const bool bRet = false; OUString sShapeType; const OUString sType( "Type" ); - SdrCustomShapeGeometryItem& rGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); - Any* pAny = rGeometryItem.GetPropertyValueByName( sType ); + const SdrCustomShapeGeometryItem& rGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ) ); + const Any* pAny = rGeometryItem.GetPropertyValueByName( sType ); if ( pAny ) *pAny >>= sShapeType; bRet = IsCustomShapeFilledByDefault( EnhancedCustomShapeTypeNames::Get( sType ) ) == false; @@ -499,7 +499,7 @@ bool SdrObjCustomShape::UseNoFillStyle() const bool SdrObjCustomShape::IsMirroredX() const { bool bMirroredX = false; - SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); + SdrCustomShapeGeometryItem aGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ) ); const OUString sMirroredX( "MirroredX" ); com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredX ); if ( pAny ) @@ -509,7 +509,7 @@ bool SdrObjCustomShape::IsMirroredX() const bool SdrObjCustomShape::IsMirroredY() const { bool bMirroredY = false; - SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); + SdrCustomShapeGeometryItem aGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ) ); const OUString sMirroredY( "MirroredY" ); com::sun::star::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( sMirroredY ); if ( pAny ) @@ -518,7 +518,7 @@ bool SdrObjCustomShape::IsMirroredY() const } void SdrObjCustomShape::SetMirroredX( const bool bMirrorX ) { - SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); + SdrCustomShapeGeometryItem aGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ) ); const OUString sMirroredX( "MirroredX" ); PropertyValue aPropVal; aPropVal.Name = sMirroredX; @@ -528,7 +528,7 @@ void SdrObjCustomShape::SetMirroredX( const bool bMirrorX ) } void SdrObjCustomShape::SetMirroredY( const bool bMirrorY ) { - SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); + SdrCustomShapeGeometryItem aGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ) ); const OUString sMirroredY( "MirroredY" ); PropertyValue aPropVal; aPropVal.Name = sMirroredY; @@ -542,7 +542,7 @@ bool SdrObjCustomShape::IsPostRotate() const { const com::sun::star::uno::Any* pAny; bool bPostRotate = false; - SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); + const SdrCustomShapeGeometryItem& rGeometryItem = static_cast<const SdrCustomShapeGeometryItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); pAny = rGeometryItem.GetPropertyValueByName( "IsPostRotateAngle" ); if ( pAny ) *pAny >>= bPostRotate; @@ -552,7 +552,7 @@ bool SdrObjCustomShape::IsPostRotate() const double SdrObjCustomShape::GetExtraTextRotation( const bool bPreRotation ) const { const com::sun::star::uno::Any* pAny; - SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); + const SdrCustomShapeGeometryItem& rGeometryItem = static_cast<const SdrCustomShapeGeometryItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); const OUString sTextRotateAngle( "TextRotateAngle" ); const OUString sTextPreRotateAngle( "TextPreRotateAngle" ); pAny = rGeometryItem.GetPropertyValueByName( bPreRotation ? sTextPreRotateAngle : sTextRotateAngle ); @@ -864,7 +864,7 @@ void SdrObjCustomShape::MergeDefaultAttributes( const OUString* pType ) PropertyValue aPropVal; OUString sShapeType; const OUString sType( "Type" ); - SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); + SdrCustomShapeGeometryItem aGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )) ); if ( pType && !pType->isEmpty() ) { sal_Int32 nType = pType->toInt32(); @@ -1108,9 +1108,9 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons PropertyValue aPropVal; OUString sShapeType; const OUString sType( "Type" ); - SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); + const SdrCustomShapeGeometryItem aGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )) ); - Any *pAny = aGeometryItem.GetPropertyValueByName( sType ); + const Any *pAny = aGeometryItem.GetPropertyValueByName( sType ); if ( pAny ) *pAny >>= sShapeType; @@ -2237,17 +2237,17 @@ basegfx::B2DPolyPolygon SdrObjCustomShape::TakeCreatePoly(const SdrDragStat& /*r bool SdrObjCustomShape::IsAutoGrowHeight() const { const SfxItemSet& rSet = GetMergedItemSet(); - bool bIsAutoGrowHeight = ((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue(); + bool bIsAutoGrowHeight = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); if ( bIsAutoGrowHeight && IsVerticalWriting() ) - bIsAutoGrowHeight = !((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_WORDWRAP))).GetValue(); + bIsAutoGrowHeight = !static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_WORDWRAP)).GetValue(); return bIsAutoGrowHeight; } bool SdrObjCustomShape::IsAutoGrowWidth() const { const SfxItemSet& rSet = GetMergedItemSet(); - bool bIsAutoGrowWidth = ((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue(); + bool bIsAutoGrowWidth = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); if ( bIsAutoGrowWidth && !IsVerticalWriting() ) - bIsAutoGrowWidth = !((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_WORDWRAP))).GetValue(); + bIsAutoGrowWidth = !static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_WORDWRAP)).GetValue(); return bIsAutoGrowWidth; } @@ -2271,8 +2271,8 @@ void SdrObjCustomShape::SetVerticalWriting( bool bVertical ) const SfxItemSet& rSet = GetObjectItemSet(); // Also exchange horizontal and vertical adjust items - SdrTextHorzAdjust eHorz = ((SdrTextHorzAdjustItem&)(rSet.Get(SDRATTR_TEXT_HORZADJUST))).GetValue(); - SdrTextVertAdjust eVert = ((SdrTextVertAdjustItem&)(rSet.Get(SDRATTR_TEXT_VERTADJUST))).GetValue(); + SdrTextHorzAdjust eHorz = static_cast<const SdrTextHorzAdjustItem&>(rSet.Get(SDRATTR_TEXT_HORZADJUST)).GetValue(); + SdrTextVertAdjust eVert = static_cast<const SdrTextVertAdjustItem&>(rSet.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); // rescue object size Rectangle aObjectRect = GetSnapRect(); @@ -2387,7 +2387,7 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(Rectangle& rR, bool bHgt, if( pOutlinerParaObject != NULL ) { rOutliner.SetText(*pOutlinerParaObject); - rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutliner.SetFixedCellHeight(static_cast<const SdrTextFixedCellHeightItem&>(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); } if ( bWdtGrow ) { @@ -2608,7 +2608,7 @@ void SdrObjCustomShape::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Recta if ( nMaxHgt == 0 || nMaxHgt > aMaxSiz.Height() ) nMaxHgt=aMaxSiz.Height(); - if (((SdrOnOffItem&)(GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue()) + if (static_cast<const SdrOnOffItem&>(GetMergedItem(SDRATTR_TEXT_WORDWRAP)).GetValue()) { if ( IsVerticalWriting() ) { @@ -2710,7 +2710,7 @@ void SdrObjCustomShape::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRe long nAnkWdt=aAnkRect.GetWidth(); long nAnkHgt=aAnkRect.GetHeight(); - if (((SdrOnOffItem&)(GetMergedItem(SDRATTR_TEXT_WORDWRAP))).GetValue()) + if (static_cast<const SdrOnOffItem&>(GetMergedItem(SDRATTR_TEXT_WORDWRAP)).GetValue()) { if ( IsVerticalWriting() ) nMaxAutoPaperHeight = nAnkHgt; @@ -2905,7 +2905,7 @@ SdrObject* SdrObjCustomShape::DoConvertToPolyObj(bool bBezier, bool bAddText) co if(pRetval) { - const bool bShadow(((SdrOnOffItem&)GetMergedItem(SDRATTR_SHADOW)).GetValue()); + const bool bShadow(static_cast<const SdrOnOffItem&>(GetMergedItem(SDRATTR_SHADOW)).GetValue()); if(bShadow) { pRetval->SetMergedItem(makeSdrShadowItem(true)); @@ -2950,13 +2950,13 @@ SdrObjGeoData* SdrObjCustomShape::NewGeoData() const void SdrObjCustomShape::SaveGeoData(SdrObjGeoData& rGeo) const { SdrTextObj::SaveGeoData( rGeo ); - SdrAShapeObjGeoData& rAGeo=(SdrAShapeObjGeoData&)rGeo; + SdrAShapeObjGeoData& rAGeo=static_cast<SdrAShapeObjGeoData&>(rGeo); rAGeo.fObjectRotation = fObjectRotation; rAGeo.bMirroredX = IsMirroredX(); rAGeo.bMirroredY = IsMirroredY(); const OUString sAdjustmentValues( "AdjustmentValues" ); - Any* pAny( ( (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ).GetPropertyValueByName( sAdjustmentValues ) ); + const Any* pAny = static_cast<const SdrCustomShapeGeometryItem&>( GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ).GetPropertyValueByName( sAdjustmentValues ); if ( pAny ) *pAny >>= rAGeo.aAdjustmentSeq; } @@ -2964,12 +2964,12 @@ void SdrObjCustomShape::SaveGeoData(SdrObjGeoData& rGeo) const void SdrObjCustomShape::RestGeoData(const SdrObjGeoData& rGeo) { SdrTextObj::RestGeoData( rGeo ); - SdrAShapeObjGeoData& rAGeo=(SdrAShapeObjGeoData&)rGeo; + const SdrAShapeObjGeoData& rAGeo=static_cast<const SdrAShapeObjGeoData&>(rGeo); fObjectRotation = rAGeo.fObjectRotation; SetMirroredX( rAGeo.bMirroredX ); SetMirroredY( rAGeo.bMirroredY ); - SdrCustomShapeGeometryItem rGeometryItem = (SdrCustomShapeGeometryItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); + SdrCustomShapeGeometryItem rGeometryItem = static_cast<const SdrCustomShapeGeometryItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); const OUString sAdjustmentValues( "AdjustmentValues" ); PropertyValue aPropVal; aPropVal.Name = sAdjustmentValues; @@ -3249,13 +3249,13 @@ void SdrObjCustomShape::impl_setUnoShape(const uno::Reference<uno::XInterface>& OUString SdrObjCustomShape::GetCustomShapeName() { OUString sShapeName; - OUString aEngine( ( (SdrCustomShapeEngineItem&)( *this ).GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE ) ).GetValue() ); + OUString aEngine( static_cast<const SdrCustomShapeEngineItem&>(GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE )).GetValue() ); if ( aEngine.isEmpty() || aEngine.equalsAscii( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) ) { OUString sShapeType; const OUString sType("Type"); - SdrCustomShapeGeometryItem& rGeometryItem( (SdrCustomShapeGeometryItem&)( *this ).GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); - Any* pAny = rGeometryItem.GetPropertyValueByName( sType ); + const SdrCustomShapeGeometryItem& rGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>( GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ) ); + const Any* pAny = rGeometryItem.GetPropertyValueByName( sType ); if ( pAny && ( *pAny >>= sShapeType ) ) sShapeName = EnhancedCustomShapeTypeNames::GetAccName( sShapeType ); } diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx index 727c06122a71..40473726b783 100644 --- a/svx/source/svdraw/svdoattr.cxx +++ b/svx/source/svdraw/svdoattr.cxx @@ -144,9 +144,9 @@ sal_Int32 SdrAttrObj::ImpGetLineWdt() const { sal_Int32 nRetval(0); - if(XLINE_NONE != ((XLineStyleItem&)(GetObjectItem(XATTR_LINESTYLE))).GetValue()) + if(XLINE_NONE != static_cast<const XLineStyleItem&>(GetObjectItem(XATTR_LINESTYLE)).GetValue()) { - nRetval = ((XLineWidthItem&)(GetObjectItem(XATTR_LINEWIDTH))).GetValue(); + nRetval = static_cast<const XLineWidthItem&>(GetObjectItem(XATTR_LINEWIDTH)).GetValue(); } return nRetval; @@ -154,12 +154,12 @@ sal_Int32 SdrAttrObj::ImpGetLineWdt() const bool SdrAttrObj::HasFill() const { - return bClosedObj && ((XFillStyleItem&)(GetProperties().GetObjectItemSet().Get(XATTR_FILLSTYLE))).GetValue()!=drawing::FillStyle_NONE; + return bClosedObj && static_cast<const XFillStyleItem&>(GetProperties().GetObjectItemSet().Get(XATTR_FILLSTYLE)).GetValue() != drawing::FillStyle_NONE; } bool SdrAttrObj::HasLine() const { - return ((XLineStyleItem&)(GetProperties().GetObjectItemSet().Get(XATTR_LINESTYLE))).GetValue()!=XLINE_NONE; + return static_cast<const XLineStyleItem&>(GetProperties().GetObjectItemSet().Get(XATTR_LINESTYLE)).GetValue() != XLINE_NONE; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 1c1281d9d934..17c9b24c3a68 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1035,7 +1035,7 @@ bool SdrObject::SingleObjectPainter(OutputDevice& rOut) const bool SdrObject::LineGeometryUsageIsNecessary() const { - XLineStyle eXLS = (XLineStyle)((const XLineStyleItem&)GetMergedItem(XATTR_LINESTYLE)).GetValue(); + XLineStyle eXLS = (XLineStyle)static_cast<const XLineStyleItem&>(GetMergedItem(XATTR_LINESTYLE)).GetValue(); return (eXLS != XLINE_NONE); } @@ -2125,41 +2125,41 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) Point aRef2(aRef1); aRef2.Y()++; const SfxPoolItem *pPoolItem=NULL; if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1X,true,&pPoolItem)==SfxItemState::SET) { - aRef1.X()=((const SdrTransformRef1XItem*)pPoolItem)->GetValue(); + aRef1.X()=static_cast<const SdrTransformRef1XItem*>(pPoolItem)->GetValue(); } if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1Y,true,&pPoolItem)==SfxItemState::SET) { - aRef1.Y()=((const SdrTransformRef1YItem*)pPoolItem)->GetValue(); + aRef1.Y()=static_cast<const SdrTransformRef1YItem*>(pPoolItem)->GetValue(); } if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2X,true,&pPoolItem)==SfxItemState::SET) { - aRef2.X()=((const SdrTransformRef2XItem*)pPoolItem)->GetValue(); + aRef2.X()=static_cast<const SdrTransformRef2XItem*>(pPoolItem)->GetValue(); } if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2Y,true,&pPoolItem)==SfxItemState::SET) { - aRef2.Y()=((const SdrTransformRef2YItem*)pPoolItem)->GetValue(); + aRef2.Y()=static_cast<const SdrTransformRef2YItem*>(pPoolItem)->GetValue(); } Rectangle aNewSnap(rSnap); if (rAttr.GetItemState(SDRATTR_MOVEX,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrMoveXItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrMoveXItem*>(pPoolItem)->GetValue(); aNewSnap.Move(n,0); } if (rAttr.GetItemState(SDRATTR_MOVEY,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrMoveYItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrMoveYItem*>(pPoolItem)->GetValue(); aNewSnap.Move(0,n); } if (rAttr.GetItemState(SDRATTR_ONEPOSITIONX,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrOnePositionXItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrOnePositionXItem*>(pPoolItem)->GetValue(); aNewSnap.Move(n-aNewSnap.Left(),0); } if (rAttr.GetItemState(SDRATTR_ONEPOSITIONY,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrOnePositionYItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrOnePositionYItem*>(pPoolItem)->GetValue(); aNewSnap.Move(0,n-aNewSnap.Top()); } if (rAttr.GetItemState(SDRATTR_ONESIZEWIDTH,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrOneSizeWidthItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrOneSizeWidthItem*>(pPoolItem)->GetValue(); aNewSnap.Right()=aNewSnap.Left()+n; } if (rAttr.GetItemState(SDRATTR_ONESIZEHEIGHT,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrOneSizeHeightItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrOneSizeHeightItem*>(pPoolItem)->GetValue(); aNewSnap.Bottom()=aNewSnap.Top()+n; } if (aNewSnap!=rSnap) { @@ -2171,7 +2171,7 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) } if (rAttr.GetItemState(SDRATTR_SHEARANGLE,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrShearAngleItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrShearAngleItem*>(pPoolItem)->GetValue(); n-=GetShearAngle(); if (n!=0) { double nTan=tan(n*nPi180); @@ -2179,7 +2179,7 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) } } if (rAttr.GetItemState(SDRATTR_ROTATEANGLE,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrAngleItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrAngleItem*>(pPoolItem)->GetValue(); n-=GetRotateAngle(); if (n!=0) { double nSin=sin(n*nPi180); @@ -2188,28 +2188,28 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) } } if (rAttr.GetItemState(SDRATTR_ROTATEONE,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrRotateOneItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrRotateOneItem*>(pPoolItem)->GetValue(); double nSin=sin(n*nPi180); double nCos=cos(n*nPi180); NbcRotate(aRef1,n,nSin,nCos); } if (rAttr.GetItemState(SDRATTR_HORZSHEARONE,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrHorzShearOneItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrHorzShearOneItem*>(pPoolItem)->GetValue(); double nTan=tan(n*nPi180); NbcShear(aRef1,n,nTan,false); } if (rAttr.GetItemState(SDRATTR_VERTSHEARONE,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrVertShearOneItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrVertShearOneItem*>(pPoolItem)->GetValue(); double nTan=tan(n*nPi180); NbcShear(aRef1,n,nTan,true); } if (rAttr.GetItemState(SDRATTR_OBJMOVEPROTECT,true,&pPoolItem)==SfxItemState::SET) { - bool b=((const SdrYesNoItem*)pPoolItem)->GetValue(); + bool b=static_cast<const SdrYesNoItem*>(pPoolItem)->GetValue(); SetMoveProtect(b); } if (rAttr.GetItemState(SDRATTR_OBJSIZEPROTECT,true,&pPoolItem)==SfxItemState::SET) { - bool b=((const SdrYesNoItem*)pPoolItem)->GetValue(); + bool b=static_cast<const SdrYesNoItem*>(pPoolItem)->GetValue(); SetResizeProtect(b); } @@ -2218,21 +2218,21 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) SetResizeProtect( true ); if (rAttr.GetItemState(SDRATTR_OBJPRINTABLE,true,&pPoolItem)==SfxItemState::SET) { - bool b=((const SdrObjPrintableItem*)pPoolItem)->GetValue(); + bool b=static_cast<const SdrObjPrintableItem*>(pPoolItem)->GetValue(); SetPrintable(b); } if (rAttr.GetItemState(SDRATTR_OBJVISIBLE,true,&pPoolItem)==SfxItemState::SET) { - bool b=((const SdrObjVisibleItem*)pPoolItem)->GetValue(); + bool b=static_cast<const SdrObjVisibleItem*>(pPoolItem)->GetValue(); SetVisible(b); } SdrLayerID nLayer=SDRLAYER_NOTFOUND; if (rAttr.GetItemState(SDRATTR_LAYERID,true,&pPoolItem)==SfxItemState::SET) { - nLayer=((const SdrLayerIdItem*)pPoolItem)->GetValue(); + nLayer=static_cast<const SdrLayerIdItem*>(pPoolItem)->GetValue(); } if (rAttr.GetItemState(SDRATTR_LAYERNAME,true,&pPoolItem)==SfxItemState::SET && pModel!=NULL) { - OUString aLayerName=((const SdrLayerNameItem*)pPoolItem)->GetValue(); + OUString aLayerName=static_cast<const SdrLayerNameItem*>(pPoolItem)->GetValue(); const SdrLayerAdmin* pLayAd=pPage!=NULL ? &pPage->GetLayerAdmin() : pModel!=NULL ? &pModel->GetLayerAdmin() : NULL; if (pLayAd!=NULL) { const SdrLayer* pLayer=pLayAd->GetLayer(aLayerName, true); @@ -2247,16 +2247,16 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) } if (rAttr.GetItemState(SDRATTR_OBJECTNAME,true,&pPoolItem)==SfxItemState::SET) { - OUString aName=((const SfxStringItem*)pPoolItem)->GetValue(); + OUString aName=static_cast<const SfxStringItem*>(pPoolItem)->GetValue(); SetName(aName); } Rectangle aNewLogic(rLogic); if (rAttr.GetItemState(SDRATTR_LOGICSIZEWIDTH,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrLogicSizeWidthItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrLogicSizeWidthItem*>(pPoolItem)->GetValue(); aNewLogic.Right()=aNewLogic.Left()+n; } if (rAttr.GetItemState(SDRATTR_LOGICSIZEHEIGHT,true,&pPoolItem)==SfxItemState::SET) { - long n=((const SdrLogicSizeHeightItem*)pPoolItem)->GetValue(); + long n=static_cast<const SdrLogicSizeHeightItem*>(pPoolItem)->GetValue(); aNewLogic.Bottom()=aNewLogic.Top()+n; } if (aNewLogic!=rLogic) { @@ -2265,10 +2265,10 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr) boost::rational<sal_Int64> aResizeX(1,1); boost::rational<sal_Int64> aResizeY(1,1); if (rAttr.GetItemState(SDRATTR_RESIZEXONE,true,&pPoolItem)==SfxItemState::SET) { - aResizeX*=((const SdrResizeXOneItem*)pPoolItem)->GetValue(); + aResizeX*=static_cast<const SdrResizeXOneItem*>(pPoolItem)->GetValue(); } if (rAttr.GetItemState(SDRATTR_RESIZEYONE,true,&pPoolItem)==SfxItemState::SET) { - aResizeY*=((const SdrResizeYOneItem*)pPoolItem)->GetValue(); + aResizeY*=static_cast<const SdrResizeYOneItem*>(pPoolItem)->GetValue(); } if (aResizeX!=boost::rational<sal_Int64>(1,1) || aResizeY!=boost::rational<sal_Int64>(1,1)) { NbcResize(aRef1,aResizeX,aResizeY); @@ -2536,7 +2536,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDas if(aMergedLineFillPolyPolygon.count() || (bForceLineDash && aMergedHairlinePolyPolygon.count())) { SfxItemSet aSet(pRet->GetMergedItemSet()); - drawing::FillStyle eOldFillStyle = ((const XFillStyleItem&)(aSet.Get(XATTR_FILLSTYLE))).GetValue(); + drawing::FillStyle eOldFillStyle = static_cast<const XFillStyleItem&>(aSet.Get(XATTR_FILLSTYLE)).GetValue(); SdrPathObj* aLinePolygonPart = NULL; SdrPathObj* aLineHairlinePart = NULL; bool bBuildGroup(false); @@ -2550,8 +2550,8 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDas // correct item properties aSet.Put(XLineWidthItem(0L)); aSet.Put(XLineStyleItem(XLINE_NONE)); - Color aColorLine = ((const XLineColorItem&)(aSet.Get(XATTR_LINECOLOR))).GetColorValue(); - sal_uInt16 nTransLine = ((const XLineTransparenceItem&)(aSet.Get(XATTR_LINETRANSPARENCE))).GetValue(); + Color aColorLine = static_cast<const XLineColorItem&>(aSet.Get(XATTR_LINECOLOR)).GetColorValue(); + sal_uInt16 nTransLine = static_cast<const XLineTransparenceItem&>(aSet.Get(XATTR_LINETRANSPARENCE)).GetValue(); aSet.Put(XFillColorItem(OUString(), aColorLine)); aSet.Put(XFillStyleItem(drawing::FillStyle_SOLID)); aSet.Put(XFillTransparenceItem(nTransLine)); @@ -2713,7 +2713,7 @@ SdrObject* SdrObject::ConvertToContourObj(SdrObject* pRet, bool bForceLineDash) { if(pRet && pRet->ISA(SdrPathObj)) { - SdrPathObj* pPathObj = (SdrPathObj*)pRet; + SdrPathObj* pPathObj = static_cast<SdrPathObj*>(pRet); // bezier geometry got created, even for straight edges since the given // object is a result of DoConvertToPolyObj. For conversion to contour @@ -3208,12 +3208,12 @@ bool SdrObject::IsInDestruction() const // return if fill is != drawing::FillStyle_NONE bool SdrObject::HasFillStyle() const { - return (((const XFillStyleItem&)GetObjectItem(XATTR_FILLSTYLE)).GetValue() != drawing::FillStyle_NONE); + return static_cast<const XFillStyleItem&>(GetObjectItem(XATTR_FILLSTYLE)).GetValue() != drawing::FillStyle_NONE; } bool SdrObject::HasLineStyle() const { - return (((const XLineStyleItem&)GetObjectItem(XATTR_LINESTYLE)).GetValue() != XLINE_NONE); + return static_cast<const XLineStyleItem&>(GetObjectItem(XATTR_LINESTYLE)).GetValue() != XLINE_NONE; } diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index cd0fba56b32f..86d4aaeb9c7a 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -420,16 +420,16 @@ OUString SdrCaptionObj::getSpecialDragComment(const SdrDragStat& rDrag) const void SdrCaptionObj::ImpGetCaptParams(ImpCaptParams& rPara) const { const SfxItemSet& rSet = GetObjectItemSet(); - rPara.eType =((SdrCaptionTypeItem&) (rSet.Get(SDRATTR_CAPTIONTYPE ))).GetValue(); - rPara.bFixedAngle=((SdrOnOffItem&)(rSet.Get(SDRATTR_CAPTIONFIXEDANGLE))).GetValue(); - rPara.nAngle =((SdrCaptionAngleItem&) (rSet.Get(SDRATTR_CAPTIONANGLE ))).GetValue(); - rPara.nGap =((SdrCaptionGapItem&) (rSet.Get(SDRATTR_CAPTIONGAP ))).GetValue(); - rPara.eEscDir =((SdrCaptionEscDirItem&) (rSet.Get(SDRATTR_CAPTIONESCDIR ))).GetValue(); - rPara.bEscRel =((SdrCaptionEscIsRelItem&) (rSet.Get(SDRATTR_CAPTIONESCISREL ))).GetValue(); - rPara.nEscRel =((SdrCaptionEscRelItem&) (rSet.Get(SDRATTR_CAPTIONESCREL ))).GetValue(); - rPara.nEscAbs =((SdrCaptionEscAbsItem&) (rSet.Get(SDRATTR_CAPTIONESCABS ))).GetValue(); - rPara.nLineLen =((SdrCaptionLineLenItem&) (rSet.Get(SDRATTR_CAPTIONLINELEN ))).GetValue(); - rPara.bFitLineLen=((SdrCaptionFitLineLenItem&)(rSet.Get(SDRATTR_CAPTIONFITLINELEN))).GetValue(); + rPara.eType =static_cast<const SdrCaptionTypeItem&> (rSet.Get(SDRATTR_CAPTIONTYPE )).GetValue(); + rPara.bFixedAngle=static_cast<const SdrOnOffItem&> (rSet.Get(SDRATTR_CAPTIONFIXEDANGLE)).GetValue(); + rPara.nAngle =static_cast<const SdrCaptionAngleItem&> (rSet.Get(SDRATTR_CAPTIONANGLE )).GetValue(); + rPara.nGap =static_cast<const SdrCaptionGapItem&> (rSet.Get(SDRATTR_CAPTIONGAP )).GetValue(); + rPara.eEscDir =static_cast<const SdrCaptionEscDirItem&> (rSet.Get(SDRATTR_CAPTIONESCDIR )).GetValue(); + rPara.bEscRel =static_cast<const SdrCaptionEscIsRelItem&> (rSet.Get(SDRATTR_CAPTIONESCISREL )).GetValue(); + rPara.nEscRel =static_cast<const SdrCaptionEscRelItem&> (rSet.Get(SDRATTR_CAPTIONESCREL )).GetValue(); + rPara.nEscAbs =static_cast<const SdrCaptionEscAbsItem&> (rSet.Get(SDRATTR_CAPTIONESCABS )).GetValue(); + rPara.nLineLen =static_cast<const SdrCaptionLineLenItem&> (rSet.Get(SDRATTR_CAPTIONLINELEN )).GetValue(); + rPara.bFitLineLen=static_cast<const SdrCaptionFitLineLenItem&>(rSet.Get(SDRATTR_CAPTIONFITLINELEN)).GetValue(); } void SdrCaptionObj::ImpRecalcTail() @@ -727,14 +727,14 @@ SdrObjGeoData* SdrCaptionObj::NewGeoData() const void SdrCaptionObj::SaveGeoData(SdrObjGeoData& rGeo) const { SdrRectObj::SaveGeoData(rGeo); - SdrCaptObjGeoData& rCGeo=(SdrCaptObjGeoData&)rGeo; + SdrCaptObjGeoData& rCGeo=static_cast<SdrCaptObjGeoData&>(rGeo); rCGeo.aTailPoly=aTailPoly; } void SdrCaptionObj::RestGeoData(const SdrObjGeoData& rGeo) { SdrRectObj::RestGeoData(rGeo); - SdrCaptObjGeoData& rCGeo=(SdrCaptObjGeoData&)rGeo; + const SdrCaptObjGeoData& rCGeo=static_cast<const SdrCaptObjGeoData&>(rGeo); aTailPoly=rCGeo.aTailPoly; } diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 19b379282ee9..1a4d79fdce7b 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -168,25 +168,25 @@ bool SdrCircObj::PaintNeedsXPolyCirc() const if(!bNeed) { // XPoly is necessary for everything that isn't LineSolid or LineNone - XLineStyle eLine = ((XLineStyleItem&)(rSet.Get(XATTR_LINESTYLE))).GetValue(); + XLineStyle eLine = static_cast<const XLineStyleItem&>(rSet.Get(XATTR_LINESTYLE)).GetValue(); bNeed = eLine != XLINE_NONE && eLine != XLINE_SOLID; // XPoly is necessary for thick lines if(!bNeed && eLine != XLINE_NONE) - bNeed = ((XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue() != 0; + bNeed = static_cast<const XLineWidthItem&>(rSet.Get(XATTR_LINEWIDTH)).GetValue() != 0; // XPoly is necessary for circle arcs with line ends if(!bNeed && meCircleKind == OBJ_CARC) { // start of the line is here if StartPolygon, StartWidth!=0 - bNeed=((XLineStartItem&)(rSet.Get(XATTR_LINESTART))).GetLineStartValue().count() != 0L && - ((XLineStartWidthItem&)(rSet.Get(XATTR_LINESTARTWIDTH))).GetValue() != 0; + bNeed=static_cast<const XLineStartItem&>(rSet.Get(XATTR_LINESTART)).GetLineStartValue().count() != 0L && + static_cast<const XLineStartWidthItem&>(rSet.Get(XATTR_LINESTARTWIDTH)).GetValue() != 0; if(!bNeed) { // end of the line is here if EndPolygon, EndWidth!=0 - bNeed = ((XLineEndItem&)(rSet.Get(XATTR_LINEEND))).GetLineEndValue().count() != 0L && - ((XLineEndWidthItem&)(rSet.Get(XATTR_LINEENDWIDTH))).GetValue() != 0; + bNeed = static_cast<const XLineEndItem&>(rSet.Get(XATTR_LINEEND)).GetLineEndValue().count() != 0L && + static_cast<const XLineEndWidthItem&>(rSet.Get(XATTR_LINEENDWIDTH)).GetValue() != 0; } } } @@ -194,7 +194,7 @@ bool SdrCircObj::PaintNeedsXPolyCirc() const // XPoly is necessary if Fill !=None and !=Solid if(!bNeed && meCircleKind != OBJ_CARC) { - drawing::FillStyle eFill=((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue(); + drawing::FillStyle eFill=static_cast<const XFillStyleItem&>(rSet.Get(XATTR_FILLSTYLE)).GetValue(); bNeed = eFill != drawing::FillStyle_NONE && eFill != drawing::FillStyle_SOLID; } @@ -571,7 +571,7 @@ OUString SdrCircObj::getSpecialDragComment(const SdrDragStat& rDrag) const if(OBJ_CIRC != meCircleKind && nPntAnz > 2) { - ImpCircUser* pU = (ImpCircUser*)rDrag.GetUser(); + const ImpCircUser* pU = static_cast<const ImpCircUser*>(rDrag.GetUser()); sal_Int32 nWink; aBuf.appendAscii(" ("); @@ -673,7 +673,7 @@ void ImpCircUser::SetCreateParams(SdrDragStat& rStat) void SdrCircObj::ImpSetCreateParams(SdrDragStat& rStat) const { - ImpCircUser* pU=(ImpCircUser*)rStat.GetUser(); + ImpCircUser* pU=static_cast<ImpCircUser*>(rStat.GetUser()); if (pU==NULL) { pU=new ImpCircUser; rStat.SetUser(pU); @@ -695,7 +695,7 @@ bool SdrCircObj::BegCreate(SdrDragStat& rStat) bool SdrCircObj::MovCreate(SdrDragStat& rStat) { ImpSetCreateParams(rStat); - ImpCircUser* pU=(ImpCircUser*)rStat.GetUser(); + ImpCircUser* pU=static_cast<ImpCircUser*>(rStat.GetUser()); rStat.SetActionRect(pU->aR); aRect=pU->aR; // for ObjName ImpJustifyRect(aRect); @@ -718,7 +718,7 @@ bool SdrCircObj::MovCreate(SdrDragStat& rStat) bool SdrCircObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) { ImpSetCreateParams(rStat); - ImpCircUser* pU=(ImpCircUser*)rStat.GetUser(); + ImpCircUser* pU=static_cast<ImpCircUser*>(rStat.GetUser()); bool bRet = false; if (eCmd==SDRCREATE_FORCEEND && rStat.GetPointAnz()<4) meCircleKind=OBJ_CIRC; if (meCircleKind==OBJ_CIRC) { @@ -751,7 +751,7 @@ bool SdrCircObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) void SdrCircObj::BrkCreate(SdrDragStat& rStat) { - ImpCircUser* pU=(ImpCircUser*)rStat.GetUser(); + ImpCircUser* pU=static_cast<ImpCircUser*>(rStat.GetUser()); delete pU; rStat.SetUser(NULL); } @@ -765,7 +765,7 @@ bool SdrCircObj::BckCreate(SdrDragStat& rStat) basegfx::B2DPolyPolygon SdrCircObj::TakeCreatePoly(const SdrDragStat& rDrag) const { - ImpCircUser* pU = (ImpCircUser*)rDrag.GetUser(); + const ImpCircUser* pU = static_cast<const ImpCircUser*>(rDrag.GetUser()); if(rDrag.GetPointAnz() < 4L) { @@ -938,7 +938,7 @@ SdrObjGeoData* SdrCircObj::NewGeoData() const void SdrCircObj::SaveGeoData(SdrObjGeoData& rGeo) const { SdrRectObj::SaveGeoData(rGeo); - SdrCircObjGeoData& rCGeo=(SdrCircObjGeoData&)rGeo; + SdrCircObjGeoData& rCGeo=static_cast<SdrCircObjGeoData&>(rGeo); rCGeo.nStartWink=nStartWink; rCGeo.nEndWink =nEndWink; } @@ -946,7 +946,7 @@ void SdrCircObj::SaveGeoData(SdrObjGeoData& rGeo) const void SdrCircObj::RestGeoData(const SdrObjGeoData& rGeo) { SdrRectObj::RestGeoData(rGeo); - SdrCircObjGeoData& rCGeo=(SdrCircObjGeoData&)rGeo; + const SdrCircObjGeoData& rCGeo=static_cast<const SdrCircObjGeoData&>(rGeo); nStartWink=rCGeo.nStartWink; nEndWink =rCGeo.nEndWink; SetXPolyDirty(); @@ -1072,7 +1072,7 @@ void SdrCircObj::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) void SdrCircObj::ImpSetAttrToCircInfo() { const SfxItemSet& rSet = GetObjectItemSet(); - SdrCircKind eNewKindA = ((SdrCircKindItem&)rSet.Get(SDRATTR_CIRCKIND)).GetValue(); + SdrCircKind eNewKindA = static_cast<const SdrCircKindItem&>(rSet.Get(SDRATTR_CIRCKIND)).GetValue(); SdrObjKind eNewKind = meCircleKind; if(eNewKindA == SDRCIRC_FULL) @@ -1084,8 +1084,8 @@ void SdrCircObj::ImpSetAttrToCircInfo() else if(eNewKindA == SDRCIRC_CUT) eNewKind = OBJ_CCUT; - sal_Int32 nNewStart = ((SdrAngleItem&)rSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue(); - sal_Int32 nNewEnd = ((SdrAngleItem&)rSet.Get(SDRATTR_CIRCENDANGLE)).GetValue(); + sal_Int32 nNewStart = static_cast<const SdrAngleItem&>(rSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue(); + sal_Int32 nNewEnd = static_cast<const SdrAngleItem&>(rSet.Get(SDRATTR_CIRCENDANGLE)).GetValue(); bool bKindChg = meCircleKind != eNewKind; bool bWinkChg = nNewStart != nStartWink || nNewEnd != nEndWink; @@ -1116,9 +1116,9 @@ void SdrCircObj::ImpSetCircInfoToAttr() else if(meCircleKind == OBJ_CCUT) eNewKindA = SDRCIRC_CUT; - SdrCircKind eOldKindA = ((SdrCircKindItem&)rSet.Get(SDRATTR_CIRCKIND)).GetValue(); - sal_Int32 nOldStartWink = ((SdrAngleItem&)rSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue(); - sal_Int32 nOldEndWink = ((SdrAngleItem&)rSet.Get(SDRATTR_CIRCENDANGLE)).GetValue(); + SdrCircKind eOldKindA = static_cast<const SdrCircKindItem&>(rSet.Get(SDRATTR_CIRCKIND)).GetValue(); + sal_Int32 nOldStartWink = static_cast<const SdrAngleItem&>(rSet.Get(SDRATTR_CIRCSTARTANGLE)).GetValue(); + sal_Int32 nOldEndWink = static_cast<const SdrAngleItem&>(rSet.Get(SDRATTR_CIRCENDANGLE)).GetValue(); if(eNewKindA != eOldKindA || nStartWink != nOldStartWink || nEndWink != nOldEndWink) { diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index d1794116b332..6051b7b60944 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -192,10 +192,10 @@ SdrEdgeObj::~SdrEdgeObj() void SdrEdgeObj::ImpSetAttrToEdgeInfo() { const SfxItemSet& rSet = GetObjectItemSet(); - SdrEdgeKind eKind = ((SdrEdgeKindItem&)(rSet.Get(SDRATTR_EDGEKIND))).GetValue(); - sal_Int32 nVal1 = ((SdrMetricItem&)rSet.Get(SDRATTR_EDGELINE1DELTA)).GetValue(); - sal_Int32 nVal2 = ((SdrMetricItem&)rSet.Get(SDRATTR_EDGELINE2DELTA)).GetValue(); - sal_Int32 nVal3 = ((SdrMetricItem&)rSet.Get(SDRATTR_EDGELINE3DELTA)).GetValue(); + SdrEdgeKind eKind = static_cast<const SdrEdgeKindItem&>(rSet.Get(SDRATTR_EDGEKIND)).GetValue(); + sal_Int32 nVal1 = static_cast<const SdrMetricItem&>(rSet.Get(SDRATTR_EDGELINE1DELTA)).GetValue(); + sal_Int32 nVal2 = static_cast<const SdrMetricItem&>(rSet.Get(SDRATTR_EDGELINE2DELTA)).GetValue(); + sal_Int32 nVal3 = static_cast<const SdrMetricItem&>(rSet.Get(SDRATTR_EDGELINE3DELTA)).GetValue(); if(eKind == SDREDGE_ORTHOLINES || eKind == SDREDGE_BEZIER) { @@ -262,11 +262,11 @@ void SdrEdgeObj::ImpSetAttrToEdgeInfo() void SdrEdgeObj::ImpSetEdgeInfoToAttr() { const SfxItemSet& rSet = GetObjectItemSet(); - SdrEdgeKind eKind = ((SdrEdgeKindItem&)(rSet.Get(SDRATTR_EDGEKIND))).GetValue(); - sal_Int32 nValAnz = ((SdrEdgeLineDeltaAnzItem&)rSet.Get(SDRATTR_EDGELINEDELTAANZ)).GetValue(); - sal_Int32 nVal1 = ((SdrMetricItem&)rSet.Get(SDRATTR_EDGELINE1DELTA)).GetValue(); - sal_Int32 nVal2 = ((SdrMetricItem&)rSet.Get(SDRATTR_EDGELINE2DELTA)).GetValue(); - sal_Int32 nVal3 = ((SdrMetricItem&)rSet.Get(SDRATTR_EDGELINE3DELTA)).GetValue(); + SdrEdgeKind eKind = static_cast<const SdrEdgeKindItem&>(rSet.Get(SDRATTR_EDGEKIND)).GetValue(); + sal_Int32 nValAnz = static_cast<const SdrEdgeLineDeltaAnzItem&>(rSet.Get(SDRATTR_EDGELINEDELTAANZ)).GetValue(); + sal_Int32 nVal1 = static_cast<const SdrMetricItem&>(rSet.Get(SDRATTR_EDGELINE1DELTA)).GetValue(); + sal_Int32 nVal2 = static_cast<const SdrMetricItem&>(rSet.Get(SDRATTR_EDGELINE2DELTA)).GetValue(); + sal_Int32 nVal3 = static_cast<const SdrMetricItem&>(rSet.Get(SDRATTR_EDGELINE3DELTA)).GetValue(); sal_Int32 nVals[3] = { nVal1, nVal2, nVal3 }; sal_uInt16 n = 0; @@ -737,8 +737,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& aBoundRect1.Move(rCon1.aObjOfs.X(),rCon1.aObjOfs.Y()); aBewareRect1=aBoundRect1; - sal_Int32 nH = ((SdrEdgeNode1HorzDistItem&)rSet.Get(SDRATTR_EDGENODE1HORZDIST)).GetValue(); - sal_Int32 nV = ((SdrEdgeNode1VertDistItem&)rSet.Get(SDRATTR_EDGENODE1VERTDIST)).GetValue(); + sal_Int32 nH = static_cast<const SdrEdgeNode1HorzDistItem&>(rSet.Get(SDRATTR_EDGENODE1HORZDIST)).GetValue(); + sal_Int32 nV = static_cast<const SdrEdgeNode1VertDistItem&>(rSet.Get(SDRATTR_EDGENODE1VERTDIST)).GetValue(); aBewareRect1.Left()-=nH; aBewareRect1.Right()+=nH; @@ -760,8 +760,8 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const XPolygon& rTrack0, SdrObjConnection& aBoundRect2.Move(rCon2.aObjOfs.X(),rCon2.aObjOfs.Y()); aBewareRect2=aBoundRect2; - sal_Int32 nH = ((SdrEdgeNode2HorzDistItem&)rSet.Get(SDRATTR_EDGENODE2HORZDIST)).GetValue(); - sal_Int32 nV = ((SdrEdgeNode2VertDistItem&)rSet.Get(SDRATTR_EDGENODE2VERTDIST)).GetValue(); + sal_Int32 nH = static_cast<const SdrEdgeNode2HorzDistItem&>(rSet.Get(SDRATTR_EDGENODE2HORZDIST)).GetValue(); + sal_Int32 nV = static_cast<const SdrEdgeNode2VertDistItem&>(rSet.Get(SDRATTR_EDGENODE2VERTDIST)).GetValue(); aBewareRect2.Left()-=nH; aBewareRect2.Right()+=nH; @@ -828,7 +828,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec const Point& rPt2, long nAngle2, const Rectangle& rBoundRect2, const Rectangle& rBewareRect2, sal_uIntPtr* pnQuality, SdrEdgeInfoRec* pInfo) const { - SdrEdgeKind eKind=((SdrEdgeKindItem&)(GetObjectItem(SDRATTR_EDGEKIND))).GetValue(); + SdrEdgeKind eKind=static_cast<const SdrEdgeKindItem&>(GetObjectItem(SDRATTR_EDGEKIND)).GetValue(); bool bRts1=nAngle1==0; bool bObn1=nAngle1==9000; bool bLks1=nAngle1==18000; @@ -1717,7 +1717,7 @@ basegfx::B2DPolyPolygon SdrEdgeObj::GetEdgeTrackPath() const sal_uInt32 SdrEdgeObj::GetHdlCount() const { - SdrEdgeKind eKind=((SdrEdgeKindItem&)(GetObjectItem(SDRATTR_EDGEKIND))).GetValue(); + SdrEdgeKind eKind=static_cast<const SdrEdgeKindItem&>(GetObjectItem(SDRATTR_EDGEKIND)).GetValue(); sal_uInt32 nHdlAnz(0L); sal_uInt32 nPntAnz(pEdgeTrack->GetPointCount()); @@ -1757,7 +1757,7 @@ SdrHdl* SdrEdgeObj::GetHdl(sal_uInt32 nHdlNum) const pHdl=new ImpEdgeHdl((*pEdgeTrack)[sal_uInt16(nPntAnz-1)],HDL_POLY); if (aCon2.pObj!=NULL && aCon2.bBestVertex) pHdl->Set1PixMore(true); } else { - SdrEdgeKind eKind=((SdrEdgeKindItem&)(GetObjectItem(SDRATTR_EDGEKIND))).GetValue(); + SdrEdgeKind eKind=static_cast<const SdrEdgeKindItem&>(GetObjectItem(SDRATTR_EDGEKIND)).GetValue(); if (eKind==SDREDGE_ORTHOLINES || eKind==SDREDGE_BEZIER) { sal_uInt32 nO1(aEdgeInfo.nObj1Lines > 0L ? aEdgeInfo.nObj1Lines - 1L : 0L); sal_uInt32 nO2(aEdgeInfo.nObj2Lines > 0L ? aEdgeInfo.nObj2Lines - 1L : 0L); @@ -1767,19 +1767,19 @@ SdrHdl* SdrEdgeObj::GetHdl(sal_uInt32 nHdlNum) const pHdl=new ImpEdgeHdl(Point(),HDL_POLY); if (nNum<nO1) { nPt=nNum+1L; - if (nNum==0) ((ImpEdgeHdl*)pHdl)->SetLineCode(OBJ1LINE2); - if (nNum==1) ((ImpEdgeHdl*)pHdl)->SetLineCode(OBJ1LINE3); + if (nNum==0) static_cast<ImpEdgeHdl*>(pHdl)->SetLineCode(OBJ1LINE2); + if (nNum==1) static_cast<ImpEdgeHdl*>(pHdl)->SetLineCode(OBJ1LINE3); } else { nNum=nNum-nO1; if (nNum<nO2) { nPt=nPntAnz-3-nNum; - if (nNum==0) ((ImpEdgeHdl*)pHdl)->SetLineCode(OBJ2LINE2); - if (nNum==1) ((ImpEdgeHdl*)pHdl)->SetLineCode(OBJ2LINE3); + if (nNum==0) static_cast<ImpEdgeHdl*>(pHdl)->SetLineCode(OBJ2LINE2); + if (nNum==1) static_cast<ImpEdgeHdl*>(pHdl)->SetLineCode(OBJ2LINE3); } else { nNum=nNum-nO2; if (nNum<nM) { nPt=aEdgeInfo.nMiddleLine; - ((ImpEdgeHdl*)pHdl)->SetLineCode(MIDDLELINE); + static_cast<ImpEdgeHdl*>(pHdl)->SetLineCode(MIDDLELINE); } } } @@ -1798,8 +1798,8 @@ SdrHdl* SdrEdgeObj::GetHdl(sal_uInt32 nHdlNum) const if (GetConnectedNode(true)==NULL) nNum++; Point aPos((*pEdgeTrack)[(sal_uInt16)nNum-1]); pHdl=new ImpEdgeHdl(aPos,HDL_POLY); - if (nNum==2) ((ImpEdgeHdl*)pHdl)->SetLineCode(OBJ1LINE2); - if (nNum==3) ((ImpEdgeHdl*)pHdl)->SetLineCode(OBJ2LINE2); + if (nNum==2) static_cast<ImpEdgeHdl*>(pHdl)->SetLineCode(OBJ1LINE2); + if (nNum==3) static_cast<ImpEdgeHdl*>(pHdl)->SetLineCode(OBJ2LINE2); } } if (pHdl!=NULL) { @@ -1914,7 +1914,7 @@ bool SdrEdgeObj::applySpecialDrag(SdrDragStat& rDragStat) else { // control point connector drag - const ImpEdgeHdl* pEdgeHdl = (ImpEdgeHdl*)rDragStat.GetHdl(); + const ImpEdgeHdl* pEdgeHdl = static_cast<const ImpEdgeHdl*>(rDragStat.GetHdl()); const SdrEdgeLineCode eLineCode = pEdgeHdl->GetLineCode(); const Point aDist(rDragStat.GetNow() - rDragStat.GetStart()); sal_Int32 nDist(pEdgeHdl->IsHorzDrag() ? aDist.X() : aDist.Y()); @@ -2447,7 +2447,7 @@ SdrObjGeoData* SdrEdgeObj::NewGeoData() const void SdrEdgeObj::SaveGeoData(SdrObjGeoData& rGeo) const { SdrTextObj::SaveGeoData(rGeo); - SdrEdgeObjGeoData& rEGeo=(SdrEdgeObjGeoData&)rGeo; + SdrEdgeObjGeoData& rEGeo=static_cast<SdrEdgeObjGeoData&>(rGeo); rEGeo.aCon1 =aCon1; rEGeo.aCon2 =aCon2; *rEGeo.pEdgeTrack =*pEdgeTrack; @@ -2459,7 +2459,7 @@ void SdrEdgeObj::SaveGeoData(SdrObjGeoData& rGeo) const void SdrEdgeObj::RestGeoData(const SdrObjGeoData& rGeo) { SdrTextObj::RestGeoData(rGeo); - SdrEdgeObjGeoData& rEGeo=(SdrEdgeObjGeoData&)rGeo; + const SdrEdgeObjGeoData& rEGeo=static_cast<const SdrEdgeObjGeoData&>(rGeo); if (aCon1.pObj!=rEGeo.aCon1.pObj) { if (aCon1.pObj!=NULL) aCon1.pObj->RemoveListener(*this); aCon1=rEGeo.aCon1; diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 09fe52409a20..d40679fcb19f 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -732,7 +732,7 @@ OUString SdrGrafObj::TakeObjNameSingul() const { case GRAPHIC_BITMAP: { - const sal_uInt16 nId = ( ( pGraphic->IsTransparent() || ( (const SdrGrafTransparenceItem&) GetObjectItem( SDRATTR_GRAFTRANSPARENCE ) ).GetValue() ) ? + const sal_uInt16 nId = ( ( pGraphic->IsTransparent() || static_cast<const SdrGrafTransparenceItem&>( GetObjectItem( SDRATTR_GRAFTRANSPARENCE ) ).GetValue() ) ? ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPTRANSLNK : STR_ObjNameSingulGRAFBMPTRANS ) : ( IsLinkedGraphic() ? STR_ObjNameSingulGRAFBMPLNK : STR_ObjNameSingulGRAFBMP ) ); @@ -785,7 +785,7 @@ OUString SdrGrafObj::TakeObjNamePlural() const { case GRAPHIC_BITMAP: { - const sal_uInt16 nId = ( ( pGraphic->IsTransparent() || ( (const SdrGrafTransparenceItem&) GetObjectItem( SDRATTR_GRAFTRANSPARENCE ) ).GetValue() ) ? + const sal_uInt16 nId = ( ( pGraphic->IsTransparent() || static_cast<const SdrGrafTransparenceItem&>( GetObjectItem( SDRATTR_GRAFTRANSPARENCE ) ).GetValue() ) ? ( IsLinkedGraphic() ? STR_ObjNamePluralGRAFBMPTRANSLNK : STR_ObjNamePluralGRAFBMPTRANS ) : ( IsLinkedGraphic() ? STR_ObjNamePluralGRAFBMPLNK : STR_ObjNamePluralGRAFBMP ) ); @@ -943,14 +943,14 @@ SdrObjGeoData* SdrGrafObj::NewGeoData() const void SdrGrafObj::SaveGeoData(SdrObjGeoData& rGeo) const { SdrRectObj::SaveGeoData(rGeo); - SdrGrafObjGeoData& rGGeo=(SdrGrafObjGeoData&)rGeo; + SdrGrafObjGeoData& rGGeo=static_cast<SdrGrafObjGeoData&>(rGeo); rGGeo.bMirrored=bMirrored; } void SdrGrafObj::RestGeoData(const SdrObjGeoData& rGeo) { SdrRectObj::RestGeoData(rGeo); - SdrGrafObjGeoData& rGGeo=(SdrGrafObjGeoData&)rGeo; + const SdrGrafObjGeoData& rGGeo=static_cast<const SdrGrafObjGeoData&>(rGeo); bMirrored=rGGeo.bMirrored; } @@ -1213,18 +1213,18 @@ void SdrGrafObj::SetMirrored( bool _bMirrored ) void SdrGrafObj::ImpSetAttrToGrafInfo() { const SfxItemSet& rSet = GetObjectItemSet(); - const sal_uInt16 nTrans = ( (SdrGrafTransparenceItem&) rSet.Get( SDRATTR_GRAFTRANSPARENCE ) ).GetValue(); - const SdrGrafCropItem& rCrop = (const SdrGrafCropItem&) rSet.Get( SDRATTR_GRAFCROP ); - - aGrafInfo.SetLuminance( ( (SdrGrafLuminanceItem&) rSet.Get( SDRATTR_GRAFLUMINANCE ) ).GetValue() ); - aGrafInfo.SetContrast( ( (SdrGrafContrastItem&) rSet.Get( SDRATTR_GRAFCONTRAST ) ).GetValue() ); - aGrafInfo.SetChannelR( ( (SdrGrafRedItem&) rSet.Get( SDRATTR_GRAFRED ) ).GetValue() ); - aGrafInfo.SetChannelG( ( (SdrGrafGreenItem&) rSet.Get( SDRATTR_GRAFGREEN ) ).GetValue() ); - aGrafInfo.SetChannelB( ( (SdrGrafBlueItem&) rSet.Get( SDRATTR_GRAFBLUE ) ).GetValue() ); - aGrafInfo.SetGamma( ( (SdrGrafGamma100Item&) rSet.Get( SDRATTR_GRAFGAMMA ) ).GetValue() * 0.01 ); + const sal_uInt16 nTrans = static_cast<const SdrGrafTransparenceItem&>( rSet.Get( SDRATTR_GRAFTRANSPARENCE ) ).GetValue(); + const SdrGrafCropItem& rCrop = static_cast<const SdrGrafCropItem&>( rSet.Get( SDRATTR_GRAFCROP ) ); + + aGrafInfo.SetLuminance( static_cast<const SdrGrafLuminanceItem&>( rSet.Get( SDRATTR_GRAFLUMINANCE ) ).GetValue() ); + aGrafInfo.SetContrast( static_cast<const SdrGrafContrastItem&>( rSet.Get( SDRATTR_GRAFCONTRAST ) ).GetValue() ); + aGrafInfo.SetChannelR( static_cast<const SdrGrafRedItem&>( rSet.Get( SDRATTR_GRAFRED ) ).GetValue() ); + aGrafInfo.SetChannelG( static_cast<const SdrGrafGreenItem&>( rSet.Get( SDRATTR_GRAFGREEN ) ).GetValue() ); + aGrafInfo.SetChannelB( static_cast<const SdrGrafBlueItem&>( rSet.Get( SDRATTR_GRAFBLUE ) ).GetValue() ); + aGrafInfo.SetGamma( static_cast<const SdrGrafGamma100Item&>( rSet.Get( SDRATTR_GRAFGAMMA ) ).GetValue() * 0.01 ); aGrafInfo.SetTransparency( (sal_uInt8) FRound( std::min( nTrans, (sal_uInt16) 100 ) * 2.55 ) ); - aGrafInfo.SetInvert( ( (SdrGrafInvertItem&) rSet.Get( SDRATTR_GRAFINVERT ) ).GetValue() ); - aGrafInfo.SetDrawMode( ( (SdrGrafModeItem&) rSet.Get( SDRATTR_GRAFMODE ) ).GetValue() ); + aGrafInfo.SetInvert( static_cast<const SdrGrafInvertItem&>( rSet.Get( SDRATTR_GRAFINVERT ) ).GetValue() ); + aGrafInfo.SetDrawMode( static_cast<const SdrGrafModeItem&>( rSet.Get( SDRATTR_GRAFMODE ) ).GetValue() ); aGrafInfo.SetCrop( rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom() ); SetXPolyDirty(); @@ -1387,7 +1387,7 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO ) pRet = GRFMGR_AUTOSWAPSTREAM_TEMP; } - return (sal_IntPtr)(void*) pRet; + return reinterpret_cast<sal_IntPtr>(pRet); } void SdrGrafObj::SetGrafAnimationAllowed(bool bNew) diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index 09d664b7647f..92821ec83292 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -87,11 +87,11 @@ OUString SdrMeasureObj::TakeRepresentation(SdrMeasureFieldKind eMeasureFieldKind FieldUnit eModUIUnit(FUNIT_NONE); const SfxItemSet& rSet = GetMergedItemSet(); - bTextRota90 = ((SdrMeasureTextRota90Item&)rSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue(); - eMeasureUnit = ((SdrMeasureUnitItem&)rSet.Get(SDRATTR_MEASUREUNIT)).GetValue(); - aMeasureScale = ((SdrMeasureScaleItem&)rSet.Get(SDRATTR_MEASURESCALE)).GetValue(); - bShowUnit = ((SdrYesNoItem&)rSet.Get(SDRATTR_MEASURESHOWUNIT)).GetValue(); - sal_Int16 nNumDigits = ((SdrMeasureDecimalPlacesItem&)rSet.Get(SDRATTR_MEASUREDECIMALPLACES)).GetValue(); + bTextRota90 = static_cast<const SdrMeasureTextRota90Item&>(rSet.Get(SDRATTR_MEASURETEXTROTA90)).GetValue(); + eMeasureUnit = static_cast<const SdrMeasureUnitItem&>(rSet.Get(SDRATTR_MEASUREUNIT)).GetValue(); + aMeasureScale = static_cast<const SdrMeasureScaleItem&>(rSet.Get(SDRATTR_MEASURESCALE)).GetValue(); + bShowUnit = static_cast<const SdrYesNoItem&>(rSet.Get(SDRATTR_MEASURESHOWUNIT)).GetValue(); + sal_Int16 nNumDigits = static_cast<const SdrMeasureDecimalPlacesItem&>(rSet.Get(SDRATTR_MEASUREDECIMALPLACES)).GetValue(); switch(eMeasureFieldKind) { @@ -329,26 +329,26 @@ void SdrMeasureObj::ImpTakeAttr(ImpMeasureRec& rRec) const rRec.aPt2 = aPt2; const SfxItemSet& rSet = GetObjectItemSet(); - rRec.eKind =((SdrMeasureKindItem& )rSet.Get(SDRATTR_MEASUREKIND )).GetValue(); - rRec.eWantTextHPos =((SdrMeasureTextHPosItem& )rSet.Get(SDRATTR_MEASURETEXTHPOS )).GetValue(); - rRec.eWantTextVPos =((SdrMeasureTextVPosItem& )rSet.Get(SDRATTR_MEASURETEXTVPOS )).GetValue(); - rRec.nLineDist =((SdrMetricItem& )rSet.Get(SDRATTR_MEASURELINEDIST )).GetValue(); - rRec.nHelplineOverhang=((SdrMetricItem&)rSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue(); - rRec.nHelplineDist =((SdrMetricItem& )rSet.Get(SDRATTR_MEASUREHELPLINEDIST )).GetValue(); - rRec.nHelpline1Len =((SdrMetricItem& )rSet.Get(SDRATTR_MEASUREHELPLINE1LEN )).GetValue(); - rRec.nHelpline2Len =((SdrMetricItem& )rSet.Get(SDRATTR_MEASUREHELPLINE2LEN )).GetValue(); - rRec.bBelowRefEdge =((SdrMeasureBelowRefEdgeItem& )rSet.Get(SDRATTR_MEASUREBELOWREFEDGE )).GetValue(); - rRec.bTextRota90 =((SdrMeasureTextRota90Item& )rSet.Get(SDRATTR_MEASURETEXTROTA90 )).GetValue(); - rRec.bTextUpsideDown =((SdrMeasureTextUpsideDownItem& )rSet.Get(SDRATTR_MEASURETEXTUPSIDEDOWN )).GetValue(); - rRec.nMeasureOverhang =((SdrMeasureOverhangItem& )rSet.Get(SDRATTR_MEASUREOVERHANG )).GetValue(); - rRec.eMeasureUnit =((SdrMeasureUnitItem& )rSet.Get(SDRATTR_MEASUREUNIT )).GetValue(); - rRec.aMeasureScale =((SdrMeasureScaleItem& )rSet.Get(SDRATTR_MEASURESCALE )).GetValue(); - rRec.bShowUnit =((SdrYesNoItem& )rSet.Get(SDRATTR_MEASURESHOWUNIT )).GetValue(); - rRec.aFormatString =((SdrMeasureFormatStringItem& )rSet.Get(SDRATTR_MEASUREFORMATSTRING )).GetValue(); - rRec.bTextAutoAngle =((SdrMeasureTextAutoAngleItem& )rSet.Get(SDRATTR_MEASURETEXTAUTOANGLE )).GetValue(); - rRec.nTextAutoAngleView=((SdrMeasureTextAutoAngleViewItem&)rSet.Get(SDRATTR_MEASURETEXTAUTOANGLEVIEW)).GetValue(); - rRec.bTextIsFixedAngle =((SdrMeasureTextIsFixedAngleItem& )rSet.Get(SDRATTR_MEASURETEXTISFIXEDANGLE )).GetValue(); - rRec.nTextFixedAngle =((SdrMeasureTextFixedAngleItem& )rSet.Get(SDRATTR_MEASURETEXTFIXEDANGLE )).GetValue(); + rRec.eKind =static_cast<const SdrMeasureKindItem& >(rSet.Get(SDRATTR_MEASUREKIND )).GetValue(); + rRec.eWantTextHPos =static_cast<const SdrMeasureTextHPosItem& >(rSet.Get(SDRATTR_MEASURETEXTHPOS )).GetValue(); + rRec.eWantTextVPos =static_cast<const SdrMeasureTextVPosItem& >(rSet.Get(SDRATTR_MEASURETEXTVPOS )).GetValue(); + rRec.nLineDist =static_cast<const SdrMetricItem& >(rSet.Get(SDRATTR_MEASURELINEDIST )).GetValue(); + rRec.nHelplineOverhang =static_cast<const SdrMetricItem& >(rSet.Get(SDRATTR_MEASUREHELPLINEOVERHANG)).GetValue(); + rRec.nHelplineDist =static_cast<const SdrMetricItem& >(rSet.Get(SDRATTR_MEASUREHELPLINEDIST )).GetValue(); + rRec.nHelpline1Len =static_cast<const SdrMetricItem& >(rSet.Get(SDRATTR_MEASUREHELPLINE1LEN )).GetValue(); + rRec.nHelpline2Len =static_cast<const SdrMetricItem& >(rSet.Get(SDRATTR_MEASUREHELPLINE2LEN )).GetValue(); + rRec.bBelowRefEdge =static_cast<const SdrMeasureBelowRefEdgeItem& >(rSet.Get(SDRATTR_MEASUREBELOWREFEDGE )).GetValue(); + rRec.bTextRota90 =static_cast<const SdrMeasureTextRota90Item& >(rSet.Get(SDRATTR_MEASURETEXTROTA90 )).GetValue(); + rRec.bTextUpsideDown =static_cast<const SdrMeasureTextUpsideDownItem& >(rSet.Get(SDRATTR_MEASURETEXTUPSIDEDOWN )).GetValue(); + rRec.nMeasureOverhang =static_cast<const SdrMeasureOverhangItem& >(rSet.Get(SDRATTR_MEASUREOVERHANG )).GetValue(); + rRec.eMeasureUnit =static_cast<const SdrMeasureUnitItem& >(rSet.Get(SDRATTR_MEASUREUNIT )).GetValue(); + rRec.aMeasureScale =static_cast<const SdrMeasureScaleItem& >(rSet.Get(SDRATTR_MEASURESCALE )).GetValue(); + rRec.bShowUnit =static_cast<const SdrYesNoItem& >(rSet.Get(SDRATTR_MEASURESHOWUNIT )).GetValue(); + rRec.aFormatString =static_cast<const SdrMeasureFormatStringItem& >(rSet.Get(SDRATTR_MEASUREFORMATSTRING )).GetValue(); + rRec.bTextAutoAngle =static_cast<const SdrMeasureTextAutoAngleItem& >(rSet.Get(SDRATTR_MEASURETEXTAUTOANGLE )).GetValue(); + rRec.nTextAutoAngleView=static_cast<const SdrMeasureTextAutoAngleViewItem&>(rSet.Get(SDRATTR_MEASURETEXTAUTOANGLEVIEW)).GetValue(); + rRec.bTextIsFixedAngle =static_cast<const SdrMeasureTextIsFixedAngleItem& >(rSet.Get(SDRATTR_MEASURETEXTISFIXEDANGLE )).GetValue(); + rRec.nTextFixedAngle =static_cast<const SdrMeasureTextFixedAngleItem& >(rSet.Get(SDRATTR_MEASURETEXTFIXEDANGLE )).GetValue(); } long impGetLineStartEndDistance(const basegfx::B2DPolyPolygon& rPolyPolygon, long nNewWidth, bool bCenter) @@ -387,21 +387,21 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly& bool bPfeileAussen = false; const SfxItemSet& rSet = GetObjectItemSet(); - sal_Int32 nLineWdt = ((XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue(); // line width + sal_Int32 nLineWdt = static_cast<const XLineWidthItem&>(rSet.Get(XATTR_LINEWIDTH)).GetValue(); // line width rPol.nLineWdt2 = (nLineWdt + 1) / 2; - nArrow1Wdt = ((const XLineStartWidthItem&)(rSet.Get(XATTR_LINESTARTWIDTH))).GetValue(); + nArrow1Wdt = static_cast<const XLineStartWidthItem&>(rSet.Get(XATTR_LINESTARTWIDTH)).GetValue(); if(nArrow1Wdt < 0) nArrow1Wdt = -nLineWdt * nArrow1Wdt / 100; // <0 = relativ - nArrow2Wdt = ((const XLineEndWidthItem&)(rSet.Get(XATTR_LINEENDWIDTH))).GetValue(); + nArrow2Wdt = static_cast<const XLineEndWidthItem&>(rSet.Get(XATTR_LINEENDWIDTH)).GetValue(); if(nArrow2Wdt < 0) nArrow2Wdt = -nLineWdt * nArrow2Wdt / 100; // <0 = relativ - basegfx::B2DPolyPolygon aPol1(((const XLineStartItem&)(rSet.Get(XATTR_LINESTART))).GetLineStartValue()); - basegfx::B2DPolyPolygon aPol2(((const XLineEndItem&)(rSet.Get(XATTR_LINEEND))).GetLineEndValue()); - bArrow1Center = ((const XLineStartCenterItem&)(rSet.Get(XATTR_LINESTARTCENTER))).GetValue(); - bArrow2Center = ((const XLineEndCenterItem&)(rSet.Get(XATTR_LINEENDCENTER))).GetValue(); + basegfx::B2DPolyPolygon aPol1(static_cast<const XLineStartItem&>(rSet.Get(XATTR_LINESTART)).GetLineStartValue()); + basegfx::B2DPolyPolygon aPol2(static_cast<const XLineEndItem&>(rSet.Get(XATTR_LINEEND)).GetLineEndValue()); + bArrow1Center = static_cast<const XLineStartCenterItem&>(rSet.Get(XATTR_LINESTARTCENTER)).GetValue(); + bArrow2Center = static_cast<const XLineEndCenterItem&>(rSet.Get(XATTR_LINEENDCENTER)).GetValue(); nArrow1Len = impGetLineStartEndDistance(aPol1, nArrow1Wdt, bArrow1Center) - 1; nArrow2Len = impGetLineStartEndDistance(aPol2, nArrow2Wdt, bArrow2Center) - 1; @@ -1138,7 +1138,7 @@ SdrObjGeoData* SdrMeasureObj::NewGeoData() const void SdrMeasureObj::SaveGeoData(SdrObjGeoData& rGeo) const { SdrTextObj::SaveGeoData(rGeo); - SdrMeasureObjGeoData& rMGeo=(SdrMeasureObjGeoData&)rGeo; + SdrMeasureObjGeoData& rMGeo=static_cast<SdrMeasureObjGeoData&>(rGeo); rMGeo.aPt1=aPt1; rMGeo.aPt2=aPt2; } @@ -1146,7 +1146,7 @@ void SdrMeasureObj::SaveGeoData(SdrObjGeoData& rGeo) const void SdrMeasureObj::RestGeoData(const SdrObjGeoData& rGeo) { SdrTextObj::RestGeoData(rGeo); - SdrMeasureObjGeoData& rMGeo=(SdrMeasureObjGeoData&)rGeo; + const SdrMeasureObjGeoData& rMGeo=static_cast<const SdrMeasureObjGeoData&>(rGeo); aPt1=rMGeo.aPt1; aPt2=rMGeo.aPt2; SetTextDirty(); @@ -1190,7 +1190,7 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const { // four lines, middle line with gap, so there are two lines used // which have one arrow each - sal_Int32 nEndWidth = ((const XLineEndWidthItem&)(aSet.Get(XATTR_LINEENDWIDTH))).GetValue(); + sal_Int32 nEndWidth = static_cast<const XLineEndWidthItem&>(aSet.Get(XATTR_LINEENDWIDTH)).GetValue(); aSet.Put(XLineEndWidthItem(0L)); aPolyPoly.clear(); @@ -1220,7 +1220,7 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const else if(nCount == 5) { // five lines, first two are the outer ones - sal_Int32 nEndWidth = ((const XLineEndWidthItem&)(aSet.Get(XATTR_LINEENDWIDTH))).GetValue(); + sal_Int32 nEndWidth = static_cast<const XLineEndWidthItem&>(aSet.Get(XATTR_LINEENDWIDTH)).GetValue(); aSet.Put(XLineEndWidthItem(0L)); diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index fc58d2b3a419..f2493818682f 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -936,7 +936,7 @@ OUString ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag if(bCreateComment && rDrag.GetUser()) { // #i103058# re-add old creation comment mode - ImpPathCreateUser* pU = (ImpPathCreateUser*)rDrag.GetUser(); + const ImpPathCreateUser* pU = static_cast<const ImpPathCreateUser*>(rDrag.GetUser()); const SdrObjKind eKindMerk(meObjectKind); mrSdrPathObject.meKind = pU->eAktKind; OUString aTmp; @@ -1004,7 +1004,7 @@ OUString ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag { // getSpecialDragComment is also used from create, so fallback to GetUser() // when mpSdrPathDragData is not set - pDragData = (ImpSdrPathDragData*)rDrag.GetUser(); + pDragData = static_cast<ImpSdrPathDragData*>(rDrag.GetUser()); } if(!pDragData) @@ -1294,7 +1294,7 @@ bool ImpPathForDragAndCreate::BegCreate(SdrDragStat& rStat) bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat) { - ImpPathCreateUser* pU=(ImpPathCreateUser*)rStat.GetUser(); + ImpPathCreateUser* pU=static_cast<ImpPathCreateUser*>(rStat.GetUser()); SdrView* pView=rStat.GetView(); XPolygon& rXPoly=aPathPolygon[aPathPolygon.Count()-1]; if (pView!=NULL && pView->IsCreateMode()) { @@ -1401,7 +1401,7 @@ bool ImpPathForDragAndCreate::MovCreate(SdrDragStat& rStat) bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) { - ImpPathCreateUser* pU=(ImpPathCreateUser*)rStat.GetUser(); + ImpPathCreateUser* pU=static_cast<ImpPathCreateUser*>(rStat.GetUser()); bool bRet = false; SdrView* pView=rStat.GetView(); bool bIncomp=pView!=NULL && pView->IsUseIncompatiblePathCreateInterface(); @@ -1516,7 +1516,7 @@ bool ImpPathForDragAndCreate::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) bool ImpPathForDragAndCreate::BckCreate(SdrDragStat& rStat) { - ImpPathCreateUser* pU=(ImpPathCreateUser*)rStat.GetUser(); + ImpPathCreateUser* pU=static_cast<ImpPathCreateUser*>(rStat.GetUser()); if (aPathPolygon.Count()>0) { XPolygon& rXPoly=aPathPolygon[aPathPolygon.Count()-1]; sal_uInt16 nActPoint=rXPoly.GetPointCount(); @@ -1556,7 +1556,7 @@ bool ImpPathForDragAndCreate::BckCreate(SdrDragStat& rStat) void ImpPathForDragAndCreate::BrkCreate(SdrDragStat& rStat) { - ImpPathCreateUser* pU=(ImpPathCreateUser*)rStat.GetUser(); + ImpPathCreateUser* pU=static_cast<ImpPathCreateUser*>(rStat.GetUser()); aPathPolygon.Clear(); mbCreating=false; delete pU; @@ -1571,7 +1571,7 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::TakeObjectPolyPolygon(const Sdr if(pView && pView->IsUseIncompatiblePathCreateInterface()) return aRetval; - ImpPathCreateUser* pU = (ImpPathCreateUser*)rDrag.GetUser(); + ImpPathCreateUser* pU = static_cast<ImpPathCreateUser*>(rDrag.GetUser()); basegfx::B2DPolygon aNewPolygon(aRetval.count() ? aRetval.getB2DPolygon(aRetval.count() - 1L) : basegfx::B2DPolygon()); if(pU->IsFormFlag() && aNewPolygon.count() > 1L) @@ -1613,7 +1613,7 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::TakeDragPolyPolygon(const SdrDr if(pView && pView->IsUseIncompatiblePathCreateInterface()) return aRetval; - ImpPathCreateUser* pU = (ImpPathCreateUser*)rDrag.GetUser(); + const ImpPathCreateUser* pU = static_cast<const ImpPathCreateUser*>(rDrag.GetUser()); if(pU && pU->bBezier && rDrag.IsMouseDown()) { @@ -2780,7 +2780,7 @@ SdrObjGeoData* SdrPathObj::NewGeoData() const void SdrPathObj::SaveGeoData(SdrObjGeoData& rGeo) const { SdrTextObj::SaveGeoData(rGeo); - SdrPathObjGeoData& rPGeo = (SdrPathObjGeoData&) rGeo; + SdrPathObjGeoData& rPGeo = static_cast<SdrPathObjGeoData&>( rGeo ); rPGeo.maPathPolygon=GetPathPoly(); rPGeo.meKind=meKind; } @@ -2788,7 +2788,7 @@ void SdrPathObj::SaveGeoData(SdrObjGeoData& rGeo) const void SdrPathObj::RestGeoData(const SdrObjGeoData& rGeo) { SdrTextObj::RestGeoData(rGeo); - SdrPathObjGeoData& rPGeo=(SdrPathObjGeoData&)rGeo; + const SdrPathObjGeoData& rPGeo=static_cast<const SdrPathObjGeoData&>(rGeo); maPathPolygon=rPGeo.maPathPolygon; meKind=rPGeo.meKind; ImpForceKind(); // to set bClosed (among other things) diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index 774286e0e457..dbc37aaf5cc2 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -181,7 +181,7 @@ void SdrRectObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bTransparenceAllowed = true; // gradient depends on fillstyle - drawing::FillStyle eFillStyle = ((XFillStyleItem&)(GetObjectItem(XATTR_FILLSTYLE))).GetValue(); + drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(GetObjectItem(XATTR_FILLSTYLE)).GetValue(); rInfo.bGradientAllowed = (eFillStyle == drawing::FillStyle_GRADIENT); rInfo.bShearAllowed =bNoTextFrame; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 5f6cc3d7ed1a..3259330504cd 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -301,15 +301,15 @@ bool SdrTextObj::IsAutoGrowHeight() const return false; // AutoGrow only together with TextFrames const SfxItemSet& rSet = GetObjectItemSet(); - bool bRet = ((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT))).GetValue(); + bool bRet = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); if(bRet) { - SdrTextAniKind eAniKind = ((SdrTextAniKindItem&)(rSet.Get(SDRATTR_TEXT_ANIKIND))).GetValue(); + SdrTextAniKind eAniKind = static_cast<const SdrTextAniKindItem&>(rSet.Get(SDRATTR_TEXT_ANIKIND)).GetValue(); if(eAniKind == SDRTEXTANI_SCROLL || eAniKind == SDRTEXTANI_ALTERNATE || eAniKind == SDRTEXTANI_SLIDE) { - SdrTextAniDirection eDirection = ((SdrTextAniDirectionItem&)(rSet.Get(SDRATTR_TEXT_ANIDIRECTION))).GetValue(); + SdrTextAniDirection eDirection = static_cast<const SdrTextAniDirectionItem&>(rSet.Get(SDRATTR_TEXT_ANIDIRECTION)).GetValue(); if(eDirection == SDRTEXTANI_UP || eDirection == SDRTEXTANI_DOWN) { @@ -326,17 +326,17 @@ bool SdrTextObj::IsAutoGrowWidth() const return false; // AutoGrow only together with TextFrames const SfxItemSet& rSet = GetObjectItemSet(); - bool bRet = ((SdrOnOffItem&)(rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH))).GetValue(); + bool bRet = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue(); bool bInEditMOde = IsInEditMode(); if(!bInEditMOde && bRet) { - SdrTextAniKind eAniKind = ((SdrTextAniKindItem&)(rSet.Get(SDRATTR_TEXT_ANIKIND))).GetValue(); + SdrTextAniKind eAniKind = static_cast<const SdrTextAniKindItem&>(rSet.Get(SDRATTR_TEXT_ANIKIND)).GetValue(); if(eAniKind == SDRTEXTANI_SCROLL || eAniKind == SDRTEXTANI_ALTERNATE || eAniKind == SDRTEXTANI_SLIDE) { - SdrTextAniDirection eDirection = ((SdrTextAniDirectionItem&)(rSet.Get(SDRATTR_TEXT_ANIDIRECTION))).GetValue(); + SdrTextAniDirection eDirection = static_cast<const SdrTextAniDirectionItem&>(rSet.Get(SDRATTR_TEXT_ANIDIRECTION)).GetValue(); if(eDirection == SDRTEXTANI_LEFT || eDirection == SDRTEXTANI_RIGHT) { @@ -357,17 +357,17 @@ SdrTextHorzAdjust SdrTextObj::GetTextHorizontalAdjust(const SfxItemSet& rSet) co if(IsContourTextFrame()) return SDRTEXTHORZADJUST_BLOCK; - SdrTextHorzAdjust eRet = ((SdrTextHorzAdjustItem&)(rSet.Get(SDRATTR_TEXT_HORZADJUST))).GetValue(); + SdrTextHorzAdjust eRet = static_cast<const SdrTextHorzAdjustItem&>(rSet.Get(SDRATTR_TEXT_HORZADJUST)).GetValue(); bool bInEditMode = IsInEditMode(); if(!bInEditMode && eRet == SDRTEXTHORZADJUST_BLOCK) { - SdrTextAniKind eAniKind = ((SdrTextAniKindItem&)(rSet.Get(SDRATTR_TEXT_ANIKIND))).GetValue(); + SdrTextAniKind eAniKind = static_cast<const SdrTextAniKindItem&>(rSet.Get(SDRATTR_TEXT_ANIKIND)).GetValue(); if(eAniKind == SDRTEXTANI_SCROLL || eAniKind == SDRTEXTANI_ALTERNATE || eAniKind == SDRTEXTANI_SLIDE) { - SdrTextAniDirection eDirection = ((SdrTextAniDirectionItem&)(rSet.Get(SDRATTR_TEXT_ANIDIRECTION))).GetValue(); + SdrTextAniDirection eDirection = static_cast<const SdrTextAniDirectionItem&>(rSet.Get(SDRATTR_TEXT_ANIDIRECTION)).GetValue(); if(eDirection == SDRTEXTANI_LEFT || eDirection == SDRTEXTANI_RIGHT) { @@ -390,17 +390,17 @@ SdrTextVertAdjust SdrTextObj::GetTextVerticalAdjust(const SfxItemSet& rSet) cons return SDRTEXTVERTADJUST_TOP; // Take care for vertical text animation here - SdrTextVertAdjust eRet = ((SdrTextVertAdjustItem&)(rSet.Get(SDRATTR_TEXT_VERTADJUST))).GetValue(); + SdrTextVertAdjust eRet = static_cast<const SdrTextVertAdjustItem&>(rSet.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); bool bInEditMode = IsInEditMode(); // Take care for vertical text animation here if(!bInEditMode && eRet == SDRTEXTVERTADJUST_BLOCK) { - SdrTextAniKind eAniKind = ((SdrTextAniKindItem&)(rSet.Get(SDRATTR_TEXT_ANIKIND))).GetValue(); + SdrTextAniKind eAniKind = static_cast<const SdrTextAniKindItem&>(rSet.Get(SDRATTR_TEXT_ANIKIND)).GetValue(); if(eAniKind == SDRTEXTANI_SCROLL || eAniKind == SDRTEXTANI_ALTERNATE || eAniKind == SDRTEXTANI_SLIDE) { - SdrTextAniDirection eDirection = ((SdrTextAniDirectionItem&)(rSet.Get(SDRATTR_TEXT_ANIDIRECTION))).GetValue(); + SdrTextAniDirection eDirection = static_cast<const SdrTextAniDirectionItem&>(rSet.Get(SDRATTR_TEXT_ANIDIRECTION)).GetValue(); if(eDirection == SDRTEXTANI_LEFT || eDirection == SDRTEXTANI_RIGHT) { @@ -444,7 +444,7 @@ void SdrTextObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const rInfo.bTransparenceAllowed = true; // gradient depends on fillstyle - drawing::FillStyle eFillStyle = ((XFillStyleItem&)(GetObjectItem(XATTR_FILLSTYLE))).GetValue(); + drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(GetObjectItem(XATTR_FILLSTYLE)).GetValue(); rInfo.bGradientAllowed = (eFillStyle == drawing::FillStyle_GRADIENT); rInfo.bShearAllowed =bNoTextFrame; rInfo.bEdgeRadiusAllowed=true; @@ -618,7 +618,7 @@ void SdrTextObj::ImpSetContourPolygon( SdrOutliner& rOutliner, Rectangle& rAncho // test if shadow needs to be avoided for TakeContour() const SfxItemSet& rSet = GetObjectItemSet(); - bool bShadowOn = ((SdrOnOffItem&)(rSet.Get(SDRATTR_SHADOW))).GetValue(); + bool bShadowOn = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_SHADOW)).GetValue(); // #i33696# // Remember TextObject currently set at the DrawOutliner, it WILL be @@ -782,7 +782,7 @@ void SdrTextObj::TakeTextRect( SdrOutliner& rOutliner, Rectangle& rTextRect, boo if( bHitTest ) // #i33696# take back fix #i27510# { rOutliner.SetTextObj( this ); - rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutliner.SetFixedCellHeight(static_cast<const SdrTextFixedCellHeightItem&>(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); } rOutliner.SetUpdateMode(true); @@ -1257,7 +1257,7 @@ void SdrTextObj::ImpSetupDrawOutlinerForPaint( bool bContourFrame, rOutliner.SetControlWord(nStat); } } - rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutliner.SetFixedCellHeight(static_cast<const SdrTextFixedCellHeightItem&>(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); TakeTextRect(rOutliner, rTextRect, false, &rAnchorRect); rPaintRect = rTextRect; @@ -1463,7 +1463,7 @@ SdrObjGeoData* SdrTextObj::NewGeoData() const void SdrTextObj::SaveGeoData(SdrObjGeoData& rGeo) const { SdrAttrObj::SaveGeoData(rGeo); - SdrTextObjGeoData& rTGeo=(SdrTextObjGeoData&)rGeo; + SdrTextObjGeoData& rTGeo=static_cast<SdrTextObjGeoData&>(rGeo); rTGeo.aRect =aRect; rTGeo.aGeo =aGeo; } @@ -1471,7 +1471,7 @@ void SdrTextObj::SaveGeoData(SdrObjGeoData& rGeo) const void SdrTextObj::RestGeoData(const SdrObjGeoData& rGeo) { // RectsDirty is called by SdrObject SdrAttrObj::RestGeoData(rGeo); - SdrTextObjGeoData& rTGeo=(SdrTextObjGeoData&)rGeo; + const SdrTextObjGeoData& rTGeo=static_cast<const SdrTextObjGeoData&>(rGeo); NbcSetLogicRect(rTGeo.aRect); aGeo =rTGeo.aGeo; SetTextSizeDirty(); @@ -1482,7 +1482,7 @@ SdrFitToSizeType SdrTextObj::GetFitToSize() const SdrFitToSizeType eType = SDRTEXTFIT_NONE; if(!IsAutoGrowWidth()) - eType = ((SdrTextFitToSizeTypeItem&)(GetObjectItem(SDRATTR_TEXT_FITTOSIZE))).GetValue(); + eType = static_cast<const SdrTextFitToSizeTypeItem&>(GetObjectItem(SDRATTR_TEXT_FITTOSIZE)).GetValue(); return eType; } @@ -1531,12 +1531,12 @@ void SdrTextObj::SetVerticalWriting(bool bVertical) { // get item settings const SfxItemSet& rSet = GetObjectItemSet(); - bool bAutoGrowWidth = ((SdrOnOffItem&)rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue(); - bool bAutoGrowHeight = ((SdrOnOffItem&)rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); + bool bAutoGrowWidth = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWWIDTH)).GetValue(); + bool bAutoGrowHeight = static_cast<const SdrOnOffItem&>(rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT)).GetValue(); // Also exchange hor/ver adjust items - SdrTextHorzAdjust eHorz = ((SdrTextHorzAdjustItem&)(rSet.Get(SDRATTR_TEXT_HORZADJUST))).GetValue(); - SdrTextVertAdjust eVert = ((SdrTextVertAdjustItem&)(rSet.Get(SDRATTR_TEXT_VERTADJUST))).GetValue(); + SdrTextHorzAdjust eHorz = static_cast<const SdrTextHorzAdjustItem&>(rSet.Get(SDRATTR_TEXT_HORZADJUST)).GetValue(); + SdrTextVertAdjust eVert = static_cast<const SdrTextVertAdjustItem&>(rSet.Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); // rescue object size Rectangle aObjectRect = GetSnapRect(); @@ -1756,75 +1756,75 @@ bool SdrTextObj::IsRealyEdited() const long SdrTextObj::GetEckenradius() const { - return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_ECKENRADIUS))).GetValue(); + return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_ECKENRADIUS)).GetValue(); } long SdrTextObj::GetMinTextFrameHeight() const { - return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEHEIGHT))).GetValue(); + return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEHEIGHT)).GetValue(); } long SdrTextObj::GetMaxTextFrameHeight() const { - return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEHEIGHT))).GetValue(); + return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEHEIGHT)).GetValue(); } long SdrTextObj::GetMinTextFrameWidth() const { - return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEWIDTH))).GetValue(); + return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_MINFRAMEWIDTH)).GetValue(); } long SdrTextObj::GetMaxTextFrameWidth() const { - return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEWIDTH))).GetValue(); + return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_MAXFRAMEWIDTH)).GetValue(); } bool SdrTextObj::IsFontwork() const { return (bTextFrame) ? false // Default is FALSE - : ((XFormTextStyleItem&)(GetObjectItemSet().Get(XATTR_FORMTXTSTYLE))).GetValue()!=XFT_NONE; + : static_cast<const XFormTextStyleItem&>(GetObjectItemSet().Get(XATTR_FORMTXTSTYLE)).GetValue() != XFT_NONE; } bool SdrTextObj::IsHideContour() const { return (bTextFrame) ? false // Default is: no, don't HideContour; HideContour not together with TextFrames - : ((XFormTextHideFormItem&)(GetObjectItemSet().Get(XATTR_FORMTXTHIDEFORM))).GetValue(); + : static_cast<const XFormTextHideFormItem&>(GetObjectItemSet().Get(XATTR_FORMTXTHIDEFORM)).GetValue(); } bool SdrTextObj::IsContourTextFrame() const { return (bTextFrame) ? false // ContourFrame not together with normal TextFrames - : ((SdrOnOffItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_CONTOURFRAME))).GetValue(); + : static_cast<const SdrOnOffItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(); } long SdrTextObj::GetTextLeftDistance() const { - return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_LEFTDIST))).GetValue(); + return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_LEFTDIST)).GetValue(); } long SdrTextObj::GetTextRightDistance() const { - return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_RIGHTDIST))).GetValue(); + return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_RIGHTDIST)).GetValue(); } long SdrTextObj::GetTextUpperDistance() const { - return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_UPPERDIST))).GetValue(); + return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_UPPERDIST)).GetValue(); } long SdrTextObj::GetTextLowerDistance() const { - return ((SdrMetricItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_LOWERDIST))).GetValue(); + return static_cast<const SdrMetricItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_LOWERDIST)).GetValue(); } SdrTextAniKind SdrTextObj::GetTextAniKind() const { - return ((SdrTextAniKindItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_ANIKIND))).GetValue(); + return static_cast<const SdrTextAniKindItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_ANIKIND)).GetValue(); } SdrTextAniDirection SdrTextObj::GetTextAniDirection() const { - return ((SdrTextAniDirectionItem&)(GetObjectItemSet().Get(SDRATTR_TEXT_ANIDIRECTION))).GetValue(); + return static_cast<const SdrTextAniDirectionItem&>(GetObjectItemSet().Get(SDRATTR_TEXT_ANIDIRECTION)).GetValue(); } // Get necessary data for text scroll animation. ATM base it on a Text-Metafile and a @@ -1849,7 +1849,7 @@ GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRectangle( Rectangle aScrollFrameRect(aPaintRect); const SfxItemSet& rSet = GetObjectItemSet(); - SdrTextAniDirection eDirection = ((SdrTextAniDirectionItem&)(rSet.Get(SDRATTR_TEXT_ANIDIRECTION))).GetValue(); + SdrTextAniDirection eDirection = static_cast<const SdrTextAniDirectionItem&>(rSet.Get(SDRATTR_TEXT_ANIDIRECTION)).GetValue(); if(SDRTEXTANI_LEFT == eDirection || SDRTEXTANI_RIGHT == eDirection) { diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index aefba0c905fc..fa2dc701d8e8 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -896,14 +896,14 @@ void SdrTextObj::impDecomposeBlockTextPrimitive( Color aOriginalBackColor(rOutliner.GetBackgroundColor()); const SfxItemSet* pBackgroundFillSet = &GetObjectItemSet(); - if (drawing::FillStyle_NONE == ((const XFillStyleItem&)pBackgroundFillSet->Get(XATTR_FILLSTYLE)).GetValue()) + if (drawing::FillStyle_NONE == static_cast<const XFillStyleItem&>(pBackgroundFillSet->Get(XATTR_FILLSTYLE)).GetValue()) { SdrPage *pOwnerPage = GetPage(); if (pOwnerPage) { pBackgroundFillSet = &pOwnerPage->getSdrPageProperties().GetItemSet(); - if (drawing::FillStyle_NONE == ((const XFillStyleItem&)pBackgroundFillSet->Get(XATTR_FILLSTYLE)).GetValue()) + if (drawing::FillStyle_NONE == static_cast<const XFillStyleItem&>(pBackgroundFillSet->Get(XATTR_FILLSTYLE)).GetValue()) { if (!pOwnerPage->IsMasterPage() && pOwnerPage->TRG_HasMasterPage()) { @@ -913,7 +913,7 @@ void SdrTextObj::impDecomposeBlockTextPrimitive( } } - if (drawing::FillStyle_NONE != ((const XFillStyleItem&)pBackgroundFillSet->Get(XATTR_FILLSTYLE)).GetValue()) + if (drawing::FillStyle_NONE != static_cast<const XFillStyleItem&>(pBackgroundFillSet->Get(XATTR_FILLSTYLE)).GetValue()) { Color aColor(rOutliner.GetBackgroundColor()); GetDraftFillColor(*pBackgroundFillSet, aColor); @@ -1193,9 +1193,9 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi { // get values const SfxItemSet& rSet = GetObjectItemSet(); - const sal_uInt32 nRepeat((sal_uInt32)((SdrTextAniCountItem&)rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); - bool bVisisbleWhenStopped(((SdrTextAniStopInsideItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); - double fDelay((double)((SdrTextAniDelayItem&)rSet.Get(SDRATTR_TEXT_ANIDELAY)).GetValue()); + const sal_uInt32 nRepeat((sal_uInt32)static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); + bool bVisisbleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); + double fDelay((double)static_cast<const SdrTextAniDelayItem&>(rSet.Get(SDRATTR_TEXT_ANIDELAY)).GetValue()); if(0.0 == fDelay) { @@ -1222,9 +1222,9 @@ void SdrTextObj::impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryLi void impCreateScrollTiming(const SfxItemSet& rSet, drawinglayer::animation::AnimationEntryList& rAnimList, bool bForward, double fTimeFullPath, double fFrequency) { - bool bVisisbleWhenStopped(((SdrTextAniStopInsideItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); - bool bVisisbleWhenStarted(((SdrTextAniStartInsideItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE )).GetValue()); - const sal_uInt32 nRepeat(((SdrTextAniCountItem&)rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); + bool bVisisbleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); + bool bVisisbleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE )).GetValue()); + const sal_uInt32 nRepeat(static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); if(bVisisbleWhenStarted) { @@ -1262,9 +1262,9 @@ void impCreateAlternateTiming(const SfxItemSet& rSet, drawinglayer::animation::A const double fStartPosition(bForward ? fRelativeTextLength : 1.0 - fRelativeTextLength); const double fEndPosition(bForward ? 1.0 - fRelativeTextLength : fRelativeTextLength); - bool bVisisbleWhenStopped(((SdrTextAniStopInsideItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); - bool bVisisbleWhenStarted(((SdrTextAniStartInsideItem&)rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE )).GetValue()); - const sal_uInt32 nRepeat(((SdrTextAniCountItem&)rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); + bool bVisisbleWhenStopped(static_cast<const SdrTextAniStopInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE)).GetValue()); + bool bVisisbleWhenStarted(static_cast<const SdrTextAniStartInsideItem&>(rSet.Get(SDRATTR_TEXT_ANISTOPINSIDE )).GetValue()); + const sal_uInt32 nRepeat(static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); if(!bVisisbleWhenStarted) { @@ -1323,7 +1323,7 @@ void impCreateSlideTiming(const SfxItemSet& rSet, drawinglayer::animation::Anima { // move in from outside, start outside const double fStartPosition(bForward ? 0.0 : 1.0); - const sal_uInt32 nRepeat(((SdrTextAniCountItem&)rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); + const sal_uInt32 nRepeat(static_cast<const SdrTextAniCountItem&>(rSet.Get(SDRATTR_TEXT_ANICOUNT)).GetValue()); // move from outside to center drawinglayer::animation::AnimationEntryLinear aOutIn(fTimeFullPath * 0.5, fFrequency, fStartPosition, 0.5); @@ -1357,8 +1357,8 @@ void SdrTextObj::impGetScrollTextTiming(drawinglayer::animation::AnimationEntryL // get data. Goal is to calculate fTimeFullPath which is the time needed to // move animation from (0.0) to (1.0) state const SfxItemSet& rSet = GetObjectItemSet(); - double fAnimationDelay((double)((SdrTextAniDelayItem&)rSet.Get(SDRATTR_TEXT_ANIDELAY)).GetValue()); - double fSingleStepWidth((double)((SdrTextAniAmountItem&)rSet.Get(SDRATTR_TEXT_ANIAMOUNT)).GetValue()); + double fAnimationDelay((double)static_cast<const SdrTextAniDelayItem&>(rSet.Get(SDRATTR_TEXT_ANIDELAY)).GetValue()); + double fSingleStepWidth((double)static_cast<const SdrTextAniAmountItem&>(rSet.Get(SDRATTR_TEXT_ANIAMOUNT)).GetValue()); const SdrTextAniDirection eDirection(GetTextAniDirection()); const bool bForward(SDRTEXTANI_RIGHT == eDirection || SDRTEXTANI_DOWN == eDirection); diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx index 258db63ce102..6ede596aa301 100644 --- a/svx/source/svdraw/svdotxat.cxx +++ b/svx/source/svdraw/svdotxat.cxx @@ -129,7 +129,7 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight(Rectangle& rR, bool bHgt, bool bW if ( pOutlinerParaObject != NULL ) { rOutliner.SetText(*pOutlinerParaObject); - rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutliner.SetFixedCellHeight(static_cast<const SdrTextFixedCellHeightItem&>(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); } if (bWdtGrow) { @@ -195,10 +195,10 @@ bool SdrTextObj::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt) if (bRet) { SetRectsDirty(); if (HAS_BASE(SdrRectObj,this)) { // this is a hack - ((SdrRectObj*)this)->SetXPolyDirty(); + static_cast<SdrRectObj*>(this)->SetXPolyDirty(); } if (HAS_BASE(SdrCaptionObj,this)) { // this is a hack - ((SdrCaptionObj*)this)->ImpRecalcTail(); + static_cast<SdrCaptionObj*>(this)->ImpRecalcTail(); } } return bRet; @@ -213,10 +213,10 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt) aRect=aNeuRect; SetRectsDirty(); if (HAS_BASE(SdrRectObj,this)) { // this is a hack - ((SdrRectObj*)this)->SetXPolyDirty(); + static_cast<SdrRectObj*>(this)->SetXPolyDirty(); } if (HAS_BASE(SdrCaptionObj,this)) { // this is a hack - ((SdrCaptionObj*)this)->ImpRecalcTail(); + static_cast<SdrCaptionObj*>(this)->ImpRecalcTail(); } SetChanged(); BroadcastObjectChange(); diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx index 05bdb03c860a..d85bf2757ed3 100644 --- a/svx/source/svdraw/svdotxdr.cxx +++ b/svx/source/svdraw/svdotxdr.cxx @@ -201,7 +201,7 @@ bool SdrTextObj::MovCreate(SdrDragStat& rStat) SetBoundRectDirty(); bSnapRectDirty=true; if (HAS_BASE(SdrRectObj,this)) { - ((SdrRectObj*)this)->SetXPolyDirty(); + static_cast<SdrRectObj*>(this)->SetXPolyDirty(); } return true; } @@ -216,7 +216,7 @@ bool SdrTextObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SetRectsDirty(); if (HAS_BASE(SdrRectObj,this)) { - ((SdrRectObj*)this)->SetXPolyDirty(); + static_cast<SdrRectObj*>(this)->SetXPolyDirty(); } return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2); } diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index 94f1aef13e12..7d3d1d5e8db4 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -66,7 +66,7 @@ bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl) if(pOutlinerParaObject!=NULL) { rOutl.SetText(*GetOutlinerParaObject()); - rOutl.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); + rOutl.SetFixedCellHeight(static_cast<const SdrTextFixedCellHeightItem&>(GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue()); } // if necessary, set frame attributes for the first (new) paragraph of the diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx index 8fad6e3b27dc..cec33f02a496 100644 --- a/svx/source/svdraw/svdotxln.cxx +++ b/svx/source/svdraw/svdotxln.cxx @@ -118,7 +118,7 @@ ImpSdrObjTextLinkUserData::~ImpSdrObjTextLinkUserData() SdrObjUserData* ImpSdrObjTextLinkUserData::Clone(SdrObject* pObj1) const { - ImpSdrObjTextLinkUserData* pData=new ImpSdrObjTextLinkUserData((SdrTextObj*)pObj1); + ImpSdrObjTextLinkUserData* pData=new ImpSdrObjTextLinkUserData(static_cast<SdrTextObj*>(pObj1)); pData->aFileName =aFileName; pData->aFilterName=aFilterName; pData->aFileDate0 =aFileDate0; diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 966ca3402057..1653fab13218 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1755,9 +1755,9 @@ void SdrPage::SetInserted( bool bIns ) if ( pObj->ISA(SdrOle2Obj) ) { if( mbInserted ) - ( (SdrOle2Obj*) pObj)->Connect(); + static_cast<SdrOle2Obj*>(pObj)->Connect(); else - ( (SdrOle2Obj*) pObj)->Disconnect(); + static_cast<SdrOle2Obj*>(pObj)->Disconnect(); } } } @@ -1811,7 +1811,7 @@ Color SdrPage::GetPageBackgroundColor( SdrPageView* pView, bool bScreenDisplay ) if(!IsMasterPage() && TRG_HasMasterPage()) { - if(drawing::FillStyle_NONE == ((const XFillStyleItem&)pBackgroundFill->Get(XATTR_FILLSTYLE)).GetValue()) + if(drawing::FillStyle_NONE == static_cast<const XFillStyleItem&>(pBackgroundFill->Get(XATTR_FILLSTYLE)).GetValue()) { pBackgroundFill = &TRG_GetMasterPage().getSdrPageProperties().GetItemSet(); } diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index f8ae2586fec4..513fa617d838 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -668,7 +668,7 @@ bool SdrPageView::IsObjMarkable(SdrObject* pObj) const { // If object is a Group object, visibility may depend on // multiple layers. If one object is markable, Group is markable. - SdrObjList* pObjList = ((SdrObjGroup*)pObj)->GetSubList(); + SdrObjList* pObjList = static_cast<SdrObjGroup*>(pObj)->GetSubList(); if(pObjList && pObjList->GetObjCount()) { @@ -733,7 +733,7 @@ void SdrPageView::ImpInvalidateHelpLineArea(sal_uInt16 nNum) const aR.Right() += aSiz.Width(); aR.Top() -= aSiz.Height(); aR.Bottom() += aSiz.Height(); - ((SdrView&)GetView()).InvalidateOneWin((vcl::Window&)rOutDev, aR); + ((SdrView&)GetView()).InvalidateOneWin(static_cast<vcl::Window&>(rOutDev), aR); } } } diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index 14fc0d43c53b..18203625023a 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -445,7 +445,7 @@ SdrPageView* SdrPaintView::ShowSdrPage(SdrPage* pPage) delete mpPageView; } - mpPageView = new SdrPageView(pPage, *((SdrView*)this)); + mpPageView = new SdrPageView(pPage, *static_cast<SdrView*>(this)); mpPageView->Show(); } @@ -597,7 +597,7 @@ void SdrPaintView::CompleteRedraw(OutputDevice* pOut, const vcl::Region& rReg, s if(pOut && OUTDEV_WINDOW == pOut->GetOutDevType()) { - vcl::Window* pWindow = (vcl::Window*)pOut; + vcl::Window* pWindow = static_cast<vcl::Window*>(pOut); if(pWindow->IsInPaint()) { @@ -836,7 +836,7 @@ vcl::Region SdrPaintView::OptimizeDrawLayersRegion(OutputDevice* pOut, const vcl // would be set. if(pOut && OUTDEV_WINDOW == pOut->GetOutDevType() && !bDisableIntersect) { - vcl::Window* pWindow = (vcl::Window*)pOut; + vcl::Window* pWindow = static_cast<vcl::Window*>(pOut); if(pWindow->IsInPaint()) { @@ -899,7 +899,7 @@ void SdrPaintView::GlueInvalidate() const const SdrObject* pObj=pOL->GetObj(nObjNum); const SdrGluePointList* pGPL=pObj->GetGluePointList(); if (pGPL!=NULL && pGPL->GetCount()!=0) { - pGPL->Invalidate((vcl::Window&)rOutDev, pObj); + pGPL->Invalidate(static_cast<vcl::Window&>(rOutDev), pObj); } } } @@ -917,7 +917,7 @@ void SdrPaintView::InvalidateAllWin() if(pPaintWindow->OutputToWindow()) { - InvalidateOneWin((vcl::Window&)pPaintWindow->GetOutputDevice()); + InvalidateOneWin(static_cast<vcl::Window&>(pPaintWindow->GetOutputDevice())); } } } @@ -951,7 +951,7 @@ void SdrPaintView::InvalidateAllWin(const Rectangle& rRect, bool bPlus1Pix) if (aRect.IsOver(aOutRect)) { - InvalidateOneWin((vcl::Window&)rOutDev, aRect); + InvalidateOneWin(static_cast<vcl::Window&>(rOutDev), aRect); } } } @@ -998,10 +998,10 @@ bool SdrPaintView::IsGroupEntered() const void SdrPaintView::SetNotPersistDefaultAttr(const SfxItemSet& rAttr, bool /*bReplaceAll*/) { // bReplaceAll has no effect here at all. - bool bMeasure=ISA(SdrView) && ((SdrView*)this)->IsMeasureTool(); + bool bMeasure=ISA(SdrView) && static_cast<SdrView*>(this)->IsMeasureTool(); const SfxPoolItem *pPoolItem=NULL; if (rAttr.GetItemState(SDRATTR_LAYERID,true,&pPoolItem)==SfxItemState::SET) { - SdrLayerID nLayerId=((const SdrLayerIdItem*)pPoolItem)->GetValue(); + SdrLayerID nLayerId=static_cast<const SdrLayerIdItem*>(pPoolItem)->GetValue(); const SdrLayer* pLayer=pMod->GetLayerAdmin().GetLayerPerID(nLayerId); if (pLayer!=NULL) { if (bMeasure) aMeasureLayer=pLayer->GetName(); @@ -1009,15 +1009,15 @@ void SdrPaintView::SetNotPersistDefaultAttr(const SfxItemSet& rAttr, bool /*bRep } } if (rAttr.GetItemState(SDRATTR_LAYERNAME,true,&pPoolItem)==SfxItemState::SET) { - if (bMeasure) aMeasureLayer=((const SdrLayerNameItem*)pPoolItem)->GetValue(); - else aAktLayer=((const SdrLayerNameItem*)pPoolItem)->GetValue(); + if (bMeasure) aMeasureLayer=static_cast<const SdrLayerNameItem*>(pPoolItem)->GetValue(); + else aAktLayer=static_cast<const SdrLayerNameItem*>(pPoolItem)->GetValue(); } } void SdrPaintView::MergeNotPersistDefaultAttr(SfxItemSet& rAttr, bool /*bOnlyHardAttr*/) const { // bOnlyHardAttr has no effect here at all. - bool bMeasure=ISA(SdrView) && ((SdrView*)this)->IsMeasureTool(); + bool bMeasure=ISA(SdrView) && static_cast<const SdrView*>(this)->IsMeasureTool(); const OUString& aNam = bMeasure ? aMeasureLayer : aAktLayer; rAttr.Put(SdrLayerNameItem(aNam)); SdrLayerID nLayer=pMod->GetLayerAdmin().GetLayerID(aNam,true); @@ -1119,7 +1119,7 @@ void SdrPaintView::ShowItemBrowser(bool bShow) { if (bShow) { if (pItemBrowser==NULL) { - pItemBrowser=new SdrItemBrowser(*(SdrView*)this); + pItemBrowser=new SdrItemBrowser(*static_cast<SdrView*>(this)); pItemBrowser->SetFloatingMode(true); } pItemBrowser->Show(); diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index b70743cdd726..39554883f3f7 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -490,7 +490,7 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co // we currently don't account for ticker text if(pActualOutDev && pActualOutDev->GetOutDevType() == OUTDEV_WINDOW) { - OutlinerView aOLV(pOutliner, (vcl::Window*)pActualOutDev); + OutlinerView aOLV(pOutliner, const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev))); const EditView& aEV=aOLV.GetEditView(); const SvxFieldItem* pItem=aEV.GetField(aTemporaryTextRelativePosition); if (pItem!=NULL) { @@ -514,7 +514,7 @@ SdrHitKind SdrView::PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) co Rectangle aBoundRect(pHitObj->GetCurrentBoundRect()); // Force to SnapRect when Fontwork - if(pHitObj->ISA(SdrTextObj) && ((SdrTextObj*)pHitObj)->IsFontwork()) + if(pHitObj->ISA(SdrTextObj) && static_cast<SdrTextObj*>(pHitObj)->IsFontwork()) { aBoundRect = pHitObj->GetSnapRect(); } @@ -824,7 +824,7 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) if (eHit==SDRHIT_TEXTEDIT) { bool bRet2(pActualOutDev && OUTDEV_WINDOW == pActualOutDev->GetOutDevType() && - SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, (vcl::Window*)pActualOutDev, false, (SdrOutliner*)0L)); + SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev)), false, (SdrOutliner*)0L)); if(bRet2) { @@ -907,7 +907,9 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) bRet=BegCreateCaptionObj(aLogicPos,Size(5*nHgt,2*nHgt)); } else bRet=BegCreateObj(aLogicPos); } break; - case SDREVENT_BEGMACROOBJ: bRet=BegMacroObj(aLogicPos,nHitTolLog,rVEvt.pObj,rVEvt.pPV,(vcl::Window*)pActualOutDev); break; + case SDREVENT_BEGMACROOBJ: { + bRet=BegMacroObj(aLogicPos,nHitTolLog,rVEvt.pObj,rVEvt.pPV,const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev))); + } break; case SDREVENT_BEGTEXTEDIT: { if (!IsObjMarked(rVEvt.pObj)) { UnmarkAllObj(); @@ -915,7 +917,7 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) } bRet = pActualOutDev && OUTDEV_WINDOW == pActualOutDev->GetOutDevType()&& - SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, (vcl::Window*)pActualOutDev, false, (SdrOutliner*)0L); + SdrBeginTextEdit(rVEvt.pObj, rVEvt.pPV, const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev)), false, (SdrOutliner*)0L); if(bRet) { @@ -928,7 +930,7 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) default: break; } // switch if (bRet && pActualOutDev!=NULL && pActualOutDev->GetOutDevType()==OUTDEV_WINDOW) { - vcl::Window* pWin=(vcl::Window*)pActualOutDev; + vcl::Window* pWin=const_cast<vcl::Window*>(static_cast<const vcl::Window*>(pActualOutDev)); // left mouse button pressed? bool bLeftDown=(rVEvt.nMouseCode&MOUSE_LEFT)!=0 && rVEvt.bMouseDown; // left mouse button released? @@ -938,8 +940,10 @@ bool SdrView::DoMouseEvent(const SdrViewEvent& rVEvt) pWin->SetPointer(GetPreferredPointer(rVEvt.aLogicPos,pWin, rVEvt.nMouseCode & (KEY_SHIFT|KEY_MOD1|KEY_MOD2),bLeftDown1)); bool bAction=IsAction(); - if (bLeftDown && bAction) pWin->CaptureMouse(); - else if (bLeftUp || (rVEvt.bIsAction && !bAction)) pWin->ReleaseMouse(); + if (bLeftDown && bAction) + pWin->CaptureMouse(); + else if (bLeftUp || (rVEvt.bIsAction && !bAction)) + pWin->ReleaseMouse(); } return bRet; } diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 31f96c5e4a4a..b7c20141163f 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -622,7 +622,7 @@ Databases::getCollator( const OUString& Language, osl::MutexGuard aGuard( m_aMutex ); CollatorTable::iterator it = - m_aCollatorTable.insert( CollatorTable::value_type( key,(Reference< XCollator >)0 ) ).first; + m_aCollatorTable.insert( CollatorTable::value_type( key, Reference< XCollator >() ) ).first; if( ! it->second.is() ) { |