diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-03 09:18:24 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-06 09:21:36 +0200 |
commit | 3b34655cc5ba586a616533e2efe3426d7c4e5aef (patch) | |
tree | e5f8428cd121c4543e74ff6524c27c9399e1d101 /svx | |
parent | fd7a21d7ea6dd36d4d9b86ecf38ad798af3fb1df (diff) |
loplugin: cstylecast
Change-Id: Id2b5b2510fb13f77592d7a0455f34ccd8a20c2d7
Diffstat (limited to 'svx')
27 files changed, 120 insertions, 219 deletions
diff --git a/svx/inc/dragmt3d.hxx b/svx/inc/dragmt3d.hxx index eb428c6cf3c3..65a0ee889f3c 100644 --- a/svx/inc/dragmt3d.hxx +++ b/svx/inc/dragmt3d.hxx @@ -76,7 +76,7 @@ public: virtual void CancelSdrDrag() SAL_OVERRIDE; virtual bool EndSdrDrag(bool bCopy) SAL_OVERRIDE; - E3dView& Get3DView() { return (E3dView&)getSdrDragView(); } + E3dView& Get3DView() { return static_cast<E3dView&>(getSdrDragView()); } // for migration from XOR to overlay virtual void CreateOverlayGeometry(::sdr::overlay::OverlayManager& rOverlayManager) SAL_OVERRIDE; diff --git a/svx/inc/polygn3d.hxx b/svx/inc/polygn3d.hxx deleted file mode 100644 index 87a0db46068e..000000000000 --- a/svx/inc/polygn3d.hxx +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVX_INC_POLYGN3D_HXX -#define INCLUDED_SVX_INC_POLYGN3D_HXX - -#include <svx/obj3d.hxx> -#include <svx/svxdllapi.h> - -class SVX_DLLPUBLIC E3dPolygonObj : public E3dCompoundObject -{ -private: - // parameters - basegfx::B3DPolyPolygon aPolyPoly3D; - basegfx::B3DPolyPolygon aPolyNormals3D; - basegfx::B2DPolyPolygon aPolyTexture2D; - bool bLineOnly; - - SVX_DLLPRIVATE void CreateDefaultNormals(); - SVX_DLLPRIVATE void CreateDefaultTexture(); - -protected: - virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() SAL_OVERRIDE; - -public: - void SetPolyPolygon3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D); - void SetPolyNormals3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D); - void SetPolyTexture2D(const basegfx::B2DPolyPolygon& rNewPolyPoly2D); - - TYPEINFO_OVERRIDE(); - - E3dPolygonObj( - E3dDefaultAttributes& rDefault, - const basegfx::B3DPolyPolygon& rPolyPoly3D, - bool bLinOnly=false); - - E3dPolygonObj(); - virtual ~E3dPolygonObj(); - - const basegfx::B3DPolyPolygon& GetPolyPolygon3D() const { return aPolyPoly3D; } - const basegfx::B3DPolyPolygon& GetPolyNormals3D() const { return aPolyNormals3D; } - const basegfx::B2DPolyPolygon& GetPolyTexture2D() const { return aPolyTexture2D; } - - virtual sal_uInt16 GetObjIdentifier() const SAL_OVERRIDE; - virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const SAL_OVERRIDE; - - virtual E3dPolygonObj* Clone() const SAL_OVERRIDE; - - // LineOnly? - bool GetLineOnly() { return bLineOnly; } - void SetLineOnly(bool bNew); -}; - -#endif // INCLUDED_SVX_INC_POLYGN3D_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofe3dcube.hxx b/svx/inc/sdr/contact/viewcontactofe3dcube.hxx index b375bc36e9f8..531b926939b6 100644 --- a/svx/inc/sdr/contact/viewcontactofe3dcube.hxx +++ b/svx/inc/sdr/contact/viewcontactofe3dcube.hxx @@ -21,13 +21,7 @@ #define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DCUBE_HXX #include <svx/sdr/contact/viewcontactofe3d.hxx> - - -// predeclarations - -class E3dCubeObj; - - +#include <svx/cube3d.hxx> namespace sdr { @@ -41,9 +35,9 @@ namespace sdr virtual ~ViewContactOfE3dCube(); // access to SdrObject - E3dCubeObj& GetE3dCubeObj() const + const E3dCubeObj& GetE3dCubeObj() const { - return (E3dCubeObj&)GetE3dObject(); + return static_cast<const E3dCubeObj&>(GetE3dObject()); } protected: diff --git a/svx/inc/sdr/contact/viewcontactofe3dextrude.hxx b/svx/inc/sdr/contact/viewcontactofe3dextrude.hxx index 32ac676d43ba..e91b46994ee7 100644 --- a/svx/inc/sdr/contact/viewcontactofe3dextrude.hxx +++ b/svx/inc/sdr/contact/viewcontactofe3dextrude.hxx @@ -21,12 +21,7 @@ #define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DEXTRUDE_HXX #include <svx/sdr/contact/viewcontactofe3d.hxx> - - -// predeclarations - -class E3dExtrudeObj; - +#include <svx/extrud3d.hxx> namespace sdr @@ -41,9 +36,9 @@ namespace sdr virtual ~ViewContactOfE3dExtrude(); // access to SdrObject - E3dExtrudeObj& GetE3dExtrudeObj() const + const E3dExtrudeObj& GetE3dExtrudeObj() const { - return (E3dExtrudeObj&)GetE3dObject(); + return static_cast<const E3dExtrudeObj&>(GetE3dObject()); } protected: diff --git a/svx/inc/sdr/contact/viewcontactofe3dlathe.hxx b/svx/inc/sdr/contact/viewcontactofe3dlathe.hxx index 5d50ba58aead..cf13907d313d 100644 --- a/svx/inc/sdr/contact/viewcontactofe3dlathe.hxx +++ b/svx/inc/sdr/contact/viewcontactofe3dlathe.hxx @@ -21,12 +21,7 @@ #define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DLATHE_HXX #include <svx/sdr/contact/viewcontactofe3d.hxx> - - -// predeclarations - -class E3dLatheObj; - +#include <svx/lathe3d.hxx> namespace sdr @@ -41,9 +36,9 @@ namespace sdr virtual ~ViewContactOfE3dLathe(); // access to SdrObject - E3dLatheObj& GetE3dLatheObj() const + const E3dLatheObj& GetE3dLatheObj() const { - return (E3dLatheObj&)GetE3dObject(); + return static_cast<const E3dLatheObj&>(GetE3dObject()); } protected: diff --git a/svx/inc/sdr/contact/viewcontactofe3dpolygon.hxx b/svx/inc/sdr/contact/viewcontactofe3dpolygon.hxx index 18601e81f64e..77043792f52b 100644 --- a/svx/inc/sdr/contact/viewcontactofe3dpolygon.hxx +++ b/svx/inc/sdr/contact/viewcontactofe3dpolygon.hxx @@ -21,13 +21,7 @@ #define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DPOLYGON_HXX #include <svx/sdr/contact/viewcontactofe3d.hxx> - - -// predeclarations - -class E3dPolygonObj; - - +#include <svx/polygn3d.hxx> namespace sdr { @@ -41,9 +35,9 @@ namespace sdr virtual ~ViewContactOfE3dPolygon(); // access to SdrObject - E3dPolygonObj& GetE3dPolygonObj() const + const E3dPolygonObj& GetE3dPolygonObj() const { - return (E3dPolygonObj&)GetE3dObject(); + return static_cast<const E3dPolygonObj&>(GetE3dObject()); } protected: diff --git a/svx/inc/sdr/contact/viewcontactofe3dsphere.hxx b/svx/inc/sdr/contact/viewcontactofe3dsphere.hxx index 186251a03a49..eadc02b3fd94 100644 --- a/svx/inc/sdr/contact/viewcontactofe3dsphere.hxx +++ b/svx/inc/sdr/contact/viewcontactofe3dsphere.hxx @@ -21,12 +21,7 @@ #define INCLUDED_SVX_INC_SDR_CONTACT_VIEWCONTACTOFE3DSPHERE_HXX #include <svx/sdr/contact/viewcontactofe3d.hxx> - - -// predeclarations - -class E3dSphereObj; - +#include <svx/sphere3d.hxx> namespace sdr @@ -41,9 +36,9 @@ namespace sdr virtual ~ViewContactOfE3dSphere(); // access to SdrObject - E3dSphereObj& GetE3dSphereObj() const + const E3dSphereObj& GetE3dSphereObj() const { - return (E3dSphereObj&)GetE3dObject(); + return static_cast<const E3dSphereObj&>(GetE3dObject()); } protected: diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index df29afce2a0e..a3810f05c31c 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -694,8 +694,8 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) : nFlags ( 0 ), nColorData ( 0 ), bTextFlow ( false ), - bFilled ( ((const XFillStyleItem&)pAObj->GetMergedItem( XATTR_FILLSTYLE )).GetValue() != drawing::FillStyle_NONE ), - bStroked ( ((const XLineStyleItem&)pAObj->GetMergedItem( XATTR_LINESTYLE )).GetValue() != XLINE_NONE ), + bFilled ( static_cast<const XFillStyleItem&>(pAObj->GetMergedItem( XATTR_FILLSTYLE )).GetValue() != drawing::FillStyle_NONE ), + bStroked ( static_cast<const XLineStyleItem&>(pAObj->GetMergedItem( XATTR_LINESTYLE )).GetValue() != XLINE_NONE ), bFlipH ( false ), bFlipV ( false ) { @@ -722,8 +722,8 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) : aLogicRect = Rectangle( aP, aS ); OUString sShapeType; - SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)(const SdrCustomShapeGeometryItem&)pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); - Any* pAny = rGeometryItem.GetPropertyValueByName( "Type" ); + const SdrCustomShapeGeometryItem& rGeometryItem = static_cast<const SdrCustomShapeGeometryItem&>(pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); + const Any* pAny = rGeometryItem.GetPropertyValueByName( "Type" ); if ( pAny ) { *pAny >>= sShapeType; bOOXMLShape = ( sShapeType.startsWith("ooxml-") ); @@ -739,7 +739,7 @@ EnhancedCustomShape2d::EnhancedCustomShape2d( SdrObject* pAObj ) : *pAny >>= bFlipV; if ( pCustomShapeObj->ISA( SdrObjCustomShape ) ) // should always be a SdrObjCustomShape, but you don't know - nRotateAngle = (sal_Int32)(((SdrObjCustomShape*)pCustomShapeObj)->GetObjectRotation() * 100.0); + nRotateAngle = (sal_Int32)(static_cast<SdrObjCustomShape*>(pCustomShapeObj)->GetObjectRotation() * 100.0); else nRotateAngle = pCustomShapeObj->GetRotateAngle(); @@ -1176,7 +1176,7 @@ bool EnhancedCustomShape2d::GetHandlePosition( const sal_uInt32 nIndex, Point& r } rReturnPosition = GetPoint( aHandle.aPosition, true, false ); } - const GeoStat aGeoStat( ((SdrObjCustomShape*)pCustomShapeObj)->GetGeoStat() ); + const GeoStat aGeoStat( static_cast<SdrObjCustomShape*>(pCustomShapeObj)->GetGeoStat() ); if ( aGeoStat.nShearWink ) { double nTan = aGeoStat.nTan; @@ -1221,7 +1221,7 @@ bool EnhancedCustomShape2d::SetHandleControllerPosition( const sal_uInt32 nIndex double a = -nRotateAngle * F_PI18000; RotatePoint( aP, Point( aLogicRect.GetWidth() / 2, aLogicRect.GetHeight() / 2 ), sin( a ), cos( a ) ); } - const GeoStat aGeoStat( ((SdrObjCustomShape*)pCustomShapeObj)->GetGeoStat() ); + const GeoStat aGeoStat( static_cast<SdrObjCustomShape*>(pCustomShapeObj)->GetGeoStat() ); if ( aGeoStat.nShearWink ) { double nTan = -aGeoStat.nTan; @@ -1334,8 +1334,8 @@ bool EnhancedCustomShape2d::SetHandleControllerPosition( const sal_uInt32 nIndex } } // and writing them back into the GeometryItem - SdrCustomShapeGeometryItem aGeometryItem((SdrCustomShapeGeometryItem&) - (const SdrCustomShapeGeometryItem&)pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); + SdrCustomShapeGeometryItem aGeometryItem( + static_cast<const SdrCustomShapeGeometryItem&>(pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ))); com::sun::star::beans::PropertyValue aPropVal; aPropVal.Name = "AdjustmentValues"; aPropVal.Value <<= seqAdjustmentValues; @@ -1350,14 +1350,14 @@ bool EnhancedCustomShape2d::SetHandleControllerPosition( const sal_uInt32 nIndex void EnhancedCustomShape2d::SwapStartAndEndArrow( SdrObject* pObj ) //#108274 { XLineStartItem aLineStart; - aLineStart.SetLineStartValue(((XLineStartItem&)pObj->GetMergedItem( XATTR_LINEEND )).GetLineStartValue()); - XLineStartWidthItem aLineStartWidth(((XLineStartWidthItem&)pObj->GetMergedItem( XATTR_LINEENDWIDTH )).GetValue()); - XLineStartCenterItem aLineStartCenter(((XLineStartCenterItem&)pObj->GetMergedItem( XATTR_LINEENDCENTER )).GetValue()); + aLineStart.SetLineStartValue(static_cast<const XLineStartItem&>(pObj->GetMergedItem( XATTR_LINEEND )).GetLineStartValue()); + XLineStartWidthItem aLineStartWidth(static_cast<const XLineStartWidthItem&>(pObj->GetMergedItem( XATTR_LINEENDWIDTH )).GetValue()); + XLineStartCenterItem aLineStartCenter(static_cast<const XLineStartCenterItem&>(pObj->GetMergedItem( XATTR_LINEENDCENTER )).GetValue()); XLineEndItem aLineEnd; - aLineEnd.SetLineEndValue(((XLineEndItem&)pObj->GetMergedItem( XATTR_LINESTART )).GetLineEndValue()); - XLineEndWidthItem aLineEndWidth(((XLineEndWidthItem&)pObj->GetMergedItem( XATTR_LINESTARTWIDTH )).GetValue()); - XLineEndCenterItem aLineEndCenter(((XLineEndCenterItem&)pObj->GetMergedItem( XATTR_LINESTARTCENTER )).GetValue()); + aLineEnd.SetLineEndValue(static_cast<const XLineEndItem&>(pObj->GetMergedItem( XATTR_LINESTART )).GetLineEndValue()); + XLineEndWidthItem aLineEndWidth(static_cast<const XLineEndWidthItem&>(pObj->GetMergedItem( XATTR_LINESTARTWIDTH )).GetValue()); + XLineEndCenterItem aLineEndCenter(static_cast<const XLineEndCenterItem&>(pObj->GetMergedItem( XATTR_LINESTARTCENTER )).GetValue()); pObj->SetMergedItem( aLineStart ); pObj->SetMergedItem( aLineStartWidth ); @@ -1565,7 +1565,7 @@ void EnhancedCustomShape2d::CreateSubPath( sal_uInt16& rSrcPt, sal_uInt16& rSegm bIsDefaultPath = true; OUString sShpType; - SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)(const SdrCustomShapeGeometryItem&)pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); + SdrCustomShapeGeometryItem& rGeometryItem = const_cast<SdrCustomShapeGeometryItem&>(static_cast<const SdrCustomShapeGeometryItem&>(pCustomShapeObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ))); Any* pAny = rGeometryItem.GetPropertyValueByName( "Type" ); if ( pAny ) *pAny >>= sShpType; @@ -2094,7 +2094,7 @@ void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rC { if ( !rObj.IsLine() ) { - const drawing::FillStyle eFillStyle = ((const XFillStyleItem&)rObj.GetMergedItem(XATTR_FILLSTYLE)).GetValue(); + const drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(rObj.GetMergedItem(XATTR_FILLSTYLE)).GetValue(); switch( eFillStyle ) { default: @@ -2104,7 +2104,7 @@ void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rC if ( nColorCount || rObj.GetBrightness() != 1.0 ) { aFillColor = GetColorData( - ((XFillColorItem&)rCustomShapeSet.Get( XATTR_FILLCOLOR )).GetColorValue(), + static_cast<const XFillColorItem&>(rCustomShapeSet.Get( XATTR_FILLCOLOR )).GetColorValue(), std::min(nColorIndex, nColorCount-1), rObj.GetBrightness() ); rObj.SetMergedItem( XFillColorItem( "", aFillColor ) ); } @@ -2112,7 +2112,7 @@ void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rC } case drawing::FillStyle_GRADIENT: { - XGradient aXGradient(((const XFillGradientItem&)rObj.GetMergedItem(XATTR_FILLGRADIENT)).GetGradientValue()); + XGradient aXGradient(static_cast<const XFillGradientItem&>(rObj.GetMergedItem(XATTR_FILLGRADIENT)).GetGradientValue()); if ( nColorCount || rObj.GetBrightness() != 1.0 ) { aXGradient.SetStartColor( @@ -2130,7 +2130,7 @@ void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rC } case drawing::FillStyle_HATCH: { - XHatch aXHatch(((const XFillHatchItem&)rObj.GetMergedItem(XATTR_FILLHATCH)).GetHatchValue()); + XHatch aXHatch(static_cast<const XFillHatchItem&>(rObj.GetMergedItem(XATTR_FILLHATCH)).GetHatchValue()); if ( nColorCount || rObj.GetBrightness() != 1.0 ) { aXHatch.SetColor( @@ -2146,7 +2146,7 @@ void EnhancedCustomShape2d::AdaptObjColor(SdrPathObj& rObj, const SfxItemSet& rC { if ( nColorCount || rObj.GetBrightness() != 1.0 ) { - Bitmap aBitmap(((const XFillBitmapItem&)rObj.GetMergedItem(XATTR_FILLBITMAP)).GetGraphicObject().GetGraphic().GetBitmapEx().GetBitmap()); + Bitmap aBitmap(static_cast<const XFillBitmapItem&>(rObj.GetMergedItem(XATTR_FILLBITMAP)).GetGraphicObject().GetGraphic().GetBitmapEx().GetBitmap()); aBitmap.Adjust( static_cast< short > ( GetLuminanceChange( @@ -2200,8 +2200,8 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( bool bLineGeometryNeededOnly ) for(size_t i = 0; i < vObjectList.size(); ++i) { SdrPathObj* pObj(vObjectList[i]); - const XLineStyle eLineStyle = ((const XLineStyleItem&)pObj->GetMergedItem(XATTR_LINESTYLE)).GetValue(); - const drawing::FillStyle eFillStyle = ((const XFillStyleItem&)pObj->GetMergedItem(XATTR_FILLSTYLE)).GetValue(); + const XLineStyle eLineStyle =static_cast<const XLineStyleItem&>(pObj->GetMergedItem(XATTR_LINESTYLE)).GetValue(); + const drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(pObj->GetMergedItem(XATTR_FILLSTYLE)).GetValue(); //SJ: #i40600# if bLineGeometryNeededOnly is set linystyle does not matter if( !bLineGeometryNeededOnly && ( XLINE_NONE == eLineStyle ) && ( drawing::FillStyle_NONE == eFillStyle ) ) @@ -2343,7 +2343,7 @@ void EnhancedCustomShape2d::ApplyGluePoints( SdrObject* pObj ) bool EnhancedCustomShape2d::IsPostRotate() const { - return pCustomShapeObj->ISA( SdrObjCustomShape ) && ((SdrObjCustomShape*)pCustomShapeObj)->IsPostRotate(); + return pCustomShapeObj->ISA( SdrObjCustomShape ) && static_cast<SdrObjCustomShape*>(pCustomShapeObj)->IsPostRotate(); } SdrObject* EnhancedCustomShape2d::CreateLineGeometry() diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx index e62086d9191b..4f546e1b1c0c 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx @@ -629,14 +629,14 @@ public: else if ( mpSecondArg->isConstant() && (*mpSecondArg)() == 1 ) aRet = mpFirstArg->fillNode( rEquations, NULL, nFlags ); else if ( ( mpFirstArg->getType() == BINARY_FUNC_DIV ) // don't care of (pi/180) - && ( ((BinaryFunctionExpression*)mpFirstArg.get())->mpFirstArg.get()->getType() == ENUM_FUNC_PI ) - && ( ((BinaryFunctionExpression*)mpFirstArg.get())->mpSecondArg.get()->getType() == FUNC_CONST ) ) + && ( static_cast<BinaryFunctionExpression*>(mpFirstArg.get())->mpFirstArg.get()->getType() == ENUM_FUNC_PI ) + && ( static_cast<BinaryFunctionExpression*>(mpFirstArg.get())->mpSecondArg.get()->getType() == FUNC_CONST ) ) { aRet = mpSecondArg->fillNode( rEquations, NULL, nFlags ); } else if ( ( mpSecondArg->getType() == BINARY_FUNC_DIV ) // don't care of (pi/180) - && ( ((BinaryFunctionExpression*)mpSecondArg.get())->mpFirstArg.get()->getType() == ENUM_FUNC_PI ) - && ( ((BinaryFunctionExpression*)mpSecondArg.get())->mpSecondArg.get()->getType() == FUNC_CONST ) ) + && ( static_cast<BinaryFunctionExpression*>(mpSecondArg.get())->mpFirstArg.get()->getType() == ENUM_FUNC_PI ) + && ( static_cast<BinaryFunctionExpression*>(mpSecondArg.get())->mpSecondArg.get()->getType() == FUNC_CONST ) ) { aRet = mpFirstArg->fillNode( rEquations, NULL, nFlags ); } diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 32b37bc67ef5..7371223a4fb2 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -31,7 +31,7 @@ #include <vcl/builder.hxx> #include <svx/helperhittest3d.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> -#include <polygn3d.hxx> +#include <svx/polygn3d.hxx> #include <svx/xlnclit.hxx> #include <svx/xlnwtit.hxx> #include "helpid.hrc" diff --git a/svx/source/dialog/dlgutil.cxx b/svx/source/dialog/dlgutil.cxx index 0bf0012f7bdf..a159d80a22c5 100644 --- a/svx/source/dialog/dlgutil.cxx +++ b/svx/source/dialog/dlgutil.cxx @@ -33,7 +33,7 @@ FieldUnit GetModuleFieldUnit( const SfxItemSet& rSet ) FieldUnit eUnit = FUNIT_INCH; const SfxPoolItem* pItem = NULL; if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_METRIC, false, &pItem ) ) - eUnit = (FieldUnit)( (const SfxUInt16Item*)pItem )->GetValue(); + eUnit = (FieldUnit) static_cast<const SfxUInt16Item*>(pItem)->GetValue(); else { return SfxModule::GetCurrentFieldUnit(); @@ -47,7 +47,7 @@ bool GetApplyCharUnit( const SfxItemSet& rSet ) bool bUseCharUnit = false; const SfxPoolItem* pItem = NULL; if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_APPLYCHARUNIT, false, &pItem ) ) - bUseCharUnit = ((const SfxBoolItem*)pItem )->GetValue(); + bUseCharUnit = static_cast<const SfxBoolItem*>(pItem)->GetValue(); else { // FIXME - this might be wrong, cf. the DEV300 changes in GetModuleFieldUnit() @@ -62,7 +62,7 @@ bool GetApplyCharUnit( const SfxItemSet& rSet ) { pItem = pModule->GetItem( SID_ATTR_APPLYCHARUNIT ); if ( pItem ) - bUseCharUnit = ((SfxBoolItem*)pItem )->GetValue(); + bUseCharUnit = static_cast<const SfxBoolItem*>(pItem)->GetValue(); } else { diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index eec98dee33a4..e8a0128c86db 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -358,7 +358,7 @@ sal_Int32 SvxLanguageBoxBase::ImplInsertLanguage( const LanguageType nLangType, else nAt = ImplInsertEntry( aStrEntry, nPos ); - ImplSetEntryData( nAt, (void*)(sal_uIntPtr)nLangType ); + ImplSetEntryData( nAt, reinterpret_cast<void*>(nLangType) ); return nAt; } @@ -394,7 +394,7 @@ sal_Int32 SvxLanguageBoxBase::InsertLanguage( const LanguageType nLangType, aStrEntry = m_aAllString; sal_Int32 nAt = ImplInsertImgEntry( aStrEntry, nPos, bCheckEntry ); - ImplSetEntryData( nAt, (void*)(sal_uIntPtr)nLang ); + ImplSetEntryData( nAt, reinterpret_cast<void*>(nLang) ); return nAt; } @@ -414,7 +414,7 @@ LanguageType SvxLanguageBoxBase::GetSelectLanguage() const sal_Int32 nPos = ImplGetSelectEntryPos(); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) - return LanguageType( (sal_uIntPtr)ImplGetEntryData(nPos) ); + return LanguageType( reinterpret_cast<sal_uIntPtr>(ImplGetEntryData(nPos)) ); else return LanguageType( LANGUAGE_DONTKNOW ); } @@ -452,7 +452,7 @@ bool SvxLanguageBoxBase::IsLanguageSelected( const LanguageType eLangType ) cons sal_Int32 SvxLanguageBoxBase::ImplTypeToPos( LanguageType eType ) const { - return ImplGetEntryPos( (void*)(sal_uIntPtr)eType); + return ImplGetEntryPos( reinterpret_cast<void*>(eType) ); } diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx index b7b0b47730f8..ba4b9b6a2802 100644 --- a/svx/source/engine3d/dragmt3d.cxx +++ b/svx/source/engine3d/dragmt3d.cxx @@ -322,7 +322,7 @@ void E3dDragRotate::MoveSdrDrag(const Point& rPnt) sal_uInt16 nModifier = 0; if(getSdrDragView().ISA(E3dView)) { - const MouseEvent& rLastMouse = ((E3dView&)getSdrDragView()).GetMouseEvent(); + const MouseEvent& rLastMouse = static_cast<E3dView&>(getSdrDragView()).GetMouseEvent(); nModifier = rLastMouse.GetModifier(); } @@ -498,7 +498,7 @@ void E3dDragMove::MoveSdrDrag(const Point& rPnt) if(getSdrDragView().ISA(E3dView)) { - const MouseEvent& rLastMouse = ((E3dView&)getSdrDragView()).GetMouseEvent(); + const MouseEvent& rLastMouse = static_cast<E3dView&>(getSdrDragView()).GetMouseEvent(); nModifier = rLastMouse.GetModifier(); } diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx index 1a9fad3c44b4..06eac9c647d7 100644 --- a/svx/source/engine3d/obj3d.cxx +++ b/svx/source/engine3d/obj3d.cxx @@ -125,7 +125,7 @@ void E3dObjList::InsertObject(SdrObject* pObj, size_t nPos, const SdrInsertReaso // call parent SdrObjList::InsertObject(pObj, nPos, pReason); - E3dScene* pScene = ((E3dObject*)GetOwnerObj())->GetScene(); + E3dScene* pScene = static_cast<E3dObject*>(GetOwnerObj())->GetScene(); if(pScene) { pScene->Cleanup3DDepthMapper(); @@ -139,7 +139,7 @@ SdrObject* E3dObjList::NbcRemoveObject(size_t nObjNum) // call parent SdrObject* pRetval = SdrObjList::NbcRemoveObject(nObjNum); - E3dScene* pScene = ((E3dObject*)GetOwnerObj())->GetScene(); + E3dScene* pScene = static_cast<E3dObject*>(GetOwnerObj())->GetScene(); if(pScene) { pScene->Cleanup3DDepthMapper(); @@ -155,7 +155,7 @@ SdrObject* E3dObjList::RemoveObject(size_t nObjNum) // call parent SdrObject* pRetval = SdrObjList::RemoveObject(nObjNum); - E3dScene* pScene = ((E3dObject*)GetOwnerObj())->GetScene(); + E3dScene* pScene = static_cast<E3dObject*>(GetOwnerObj())->GetScene(); if(pScene) { pScene->Cleanup3DDepthMapper(); @@ -271,7 +271,7 @@ void E3dObject::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const // gradient depends on fillstyle // BM *** check if SetItem is NULL *** - drawing::FillStyle eFillStyle = ((XFillStyleItem&)(GetMergedItem(XATTR_FILLSTYLE))).GetValue(); + drawing::FillStyle eFillStyle = static_cast<const XFillStyleItem&>(GetMergedItem(XATTR_FILLSTYLE)).GetValue(); rInfo.bGradientAllowed = (eFillStyle == drawing::FillStyle_GRADIENT); // Convert 3D objects in a group of polygons: @@ -497,7 +497,7 @@ E3dObject* E3dObject::GetParentObj() const if(GetObjList() && GetObjList()->GetOwnerObj() && GetObjList()->GetOwnerObj()->ISA(E3dObject)) - pRetval = ((E3dObject*)GetObjList()->GetOwnerObj()); + pRetval = static_cast<E3dObject*>(GetObjList()->GetOwnerObj()); return pRetval; } @@ -721,15 +721,15 @@ void E3dObject::SaveGeoData(SdrObjGeoData& rGeo) const { SdrAttrObj::SaveGeoData (rGeo); - ((E3DObjGeoData &) rGeo).maLocalBoundVol = maLocalBoundVol; - ((E3DObjGeoData &) rGeo).maTransformation = maTransformation; + static_cast<E3DObjGeoData &>(rGeo).maLocalBoundVol = maLocalBoundVol; + static_cast<E3DObjGeoData &>(rGeo).maTransformation = maTransformation; } void E3dObject::RestGeoData(const SdrObjGeoData& rGeo) { - maLocalBoundVol = ((E3DObjGeoData &) rGeo).maLocalBoundVol; + maLocalBoundVol = static_cast<const E3DObjGeoData &>(rGeo).maLocalBoundVol; E3DModifySceneSnapRectUpdater aUpdater(this); - NbcSetTransform(((E3DObjGeoData &) rGeo).maTransformation); + NbcSetTransform(static_cast<const E3DObjGeoData &>(rGeo).maTransformation); SdrAttrObj::RestGeoData (rGeo); } @@ -959,7 +959,7 @@ bool E3dCompoundObject::IsAOrdNumRemapCandidate(E3dScene*& prScene) const && GetObjList()->GetOwnerObj() && GetObjList()->GetOwnerObj()->ISA(E3dScene)) { - prScene = (E3dScene*)GetObjList()->GetOwnerObj(); + prScene = static_cast<E3dScene*>(GetObjList()->GetOwnerObj()); return true; } diff --git a/svx/source/engine3d/objfac3d.cxx b/svx/source/engine3d/objfac3d.cxx index 9e8d498c7216..4eb26d7f7d8c 100644 --- a/svx/source/engine3d/objfac3d.cxx +++ b/svx/source/engine3d/objfac3d.cxx @@ -24,7 +24,7 @@ #include <svx/sphere3d.hxx> #include <svx/extrud3d.hxx> #include <svx/lathe3d.hxx> -#include <polygn3d.hxx> +#include <svx/polygn3d.hxx> #include "svx/objfac3d.hxx" #include <svx/svdobj.hxx> diff --git a/svx/source/engine3d/polygn3d.cxx b/svx/source/engine3d/polygn3d.cxx index b8d960b0949d..44ea9816c706 100644 --- a/svx/source/engine3d/polygn3d.cxx +++ b/svx/source/engine3d/polygn3d.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <polygn3d.hxx> +#include <svx/polygn3d.hxx> #include <svx/svdpage.hxx> #include "svx/globl3d.hxx" #include <basegfx/point/b3dpoint.hxx> diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index 580610f765ac..9d5336f02c8c 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -338,7 +338,7 @@ void E3dScene::SetCamera(const Camera3D& rNewCamera) { // Set old camera aCamera = rNewCamera; - ((sdr::properties::E3dSceneProperties&)GetProperties()).SetSceneItemsFromCamera(); + static_cast<sdr::properties::E3dSceneProperties&>(GetProperties()).SetSceneItemsFromCamera(); SetRectsDirty(); @@ -416,7 +416,7 @@ void E3dScene::removeAllNonSelectedObjects() if(pObj->ISA(E3dScene)) { - E3dScene* pScene = (E3dScene*)pObj; + E3dScene* pScene = static_cast<E3dScene*>(pObj); // iterate over this sub-scene pScene->removeAllNonSelectedObjects(); @@ -432,7 +432,7 @@ void E3dScene::removeAllNonSelectedObjects() } else if(pObj->ISA(E3dCompoundObject)) { - E3dCompoundObject* pCompound = (E3dCompoundObject*)pObj; + E3dCompoundObject* pCompound = static_cast<E3dCompoundObject*>(pObj); if(!pCompound->GetSelected()) { @@ -465,7 +465,7 @@ E3dScene& E3dScene::operator=(const E3dScene& rObj) aCamera = r3DObj.aCamera; aCameraSet = r3DObj.aCameraSet; - ((sdr::properties::E3dSceneProperties&)GetProperties()).SetSceneItemsFromCamera(); + static_cast<sdr::properties::E3dSceneProperties&>(GetProperties()).SetSceneItemsFromCamera(); InvalidateBoundVolume(); RebuildLists(); @@ -500,7 +500,7 @@ void E3dScene::RebuildLists() // then examine all the objects in the scene while ( a3DIterator.IsMore() ) { - E3dObject* p3DObj = (E3dObject*) a3DIterator.Next(); + E3dObject* p3DObj = static_cast<E3dObject*>(a3DIterator.Next()); p3DObj->NbcSetLayer(nCurrLayerID); NewObjectInserted(p3DObj); } @@ -515,7 +515,7 @@ void E3dScene::SaveGeoData(SdrObjGeoData& rGeo) const { E3dObject::SaveGeoData (rGeo); - ((E3DSceneGeoData &) rGeo).aCamera = aCamera; + static_cast<E3DSceneGeoData &>(rGeo).aCamera = aCamera; } void E3dScene::RestGeoData(const SdrObjGeoData& rGeo) @@ -523,7 +523,7 @@ void E3dScene::RestGeoData(const SdrObjGeoData& rGeo) // #i94832# removed E3DModifySceneSnapRectUpdater here. // It should not be needed, is already part of E3dObject::RestGeoData E3dObject::RestGeoData (rGeo); - SetCamera (((E3DSceneGeoData &) rGeo).aCamera); + SetCamera (static_cast<const E3DSceneGeoData &>(rGeo).aCamera); } // Something was changed in the style sheet, so change scene @@ -677,7 +677,7 @@ bool E3dScene::IsBreakObjPossible() while ( a3DIterator.IsMore() ) { - E3dObject* pObj = (E3dObject*) a3DIterator.Next(); + E3dObject* pObj = static_cast<E3dObject*>(a3DIterator.Next()); DBG_ASSERT(pObj->ISA(E3dObject), "only 3D objects are allowed in scenes!"); if(!pObj->IsBreakObjPossible()) return false; diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 41779f3f286a..7107f6208f9b 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -68,7 +68,7 @@ using namespace com::sun::star; -#define ITEMVALUE(ItemSet,Id,Cast) ((const Cast&)(ItemSet).Get(Id)).GetValue() +#define ITEMVALUE(ItemSet,Id,Cast) (static_cast<const Cast&>((ItemSet).Get(Id))).GetValue() TYPEINIT1(E3dView, SdrView); @@ -246,14 +246,14 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const if(pObj && pObj->ISA(E3dCompoundObject)) { // related scene - pScene = ((E3dCompoundObject*)pObj)->GetScene(); + pScene = static_cast<E3dCompoundObject*>(pObj)->GetScene(); if(pScene && !IsObjMarked(pScene)) bSpecialHandling = true; } // Reset all selection flags if(pObj && pObj->ISA(E3dObject)) { - pScene = ((E3dObject*)pObj)->GetScene(); + pScene = static_cast<E3dObject*>(pObj)->GetScene(); if(pScene) pScene->SetSelected(false); } @@ -269,7 +269,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const if(pObj && pObj->ISA(E3dCompoundObject)) { // relatated scene - pScene = ((E3dCompoundObject*)pObj)->GetScene(); + pScene = static_cast<E3dCompoundObject*>(pObj)->GetScene(); if(pScene) pScene->SetSelected(false); } @@ -281,7 +281,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const if(pObj && pObj->ISA(E3dObject)) { // Select object - E3dObject* p3DObj = (E3dObject*)pObj; + E3dObject* p3DObj = static_cast<E3dObject*>(pObj); p3DObj->SetSelected(true); pScene = p3DObj->GetScene(); } @@ -304,7 +304,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const if(pObj && pObj->ISA(E3dCompoundObject)) { // releated scene - pScene = ((E3dCompoundObject*)pObj)->GetScene(); + pScene = static_cast<E3dCompoundObject*>(pObj)->GetScene(); if(pScene) pScene->SetSelected(false); } @@ -335,7 +335,7 @@ SdrModel* E3dView::GetMarkedObjModel() const { // if the object is selected, but it's scene not, // we need special handling - pScene = ((E3dCompoundObject*)pObj)->GetScene(); + pScene = static_cast<const E3dCompoundObject*>(pObj)->GetScene(); if(pScene && !IsObjMarked(pScene)) { @@ -346,7 +346,7 @@ SdrModel* E3dView::GetMarkedObjModel() const if(pObj && pObj->ISA(E3dObject)) { // reset all selection flags at 3D objects - pScene = ((E3dObject*)pObj)->GetScene(); + pScene = static_cast<const E3dObject*>(pObj)->GetScene(); if(pScene) { @@ -373,7 +373,7 @@ SdrModel* E3dView::GetMarkedObjModel() const if(pObj && pObj->ISA(E3dCompoundObject)) { // mark object, but not scenes - E3dCompoundObject* p3DObj = (E3dCompoundObject*)pObj; + E3dCompoundObject* p3DObj = static_cast<E3dCompoundObject*>(pObj); p3DObj->SetSelected(true); aSelectedSnapRect.Union(p3DObj->GetSnapRect()); } @@ -392,7 +392,7 @@ SdrModel* E3dView::GetMarkedObjModel() const if(pObj && pObj->ISA(E3dObject)) { - pScene = ((E3dObject*)pObj)->GetScene(); + pScene = static_cast<E3dObject*>(pObj)->GetScene(); if(pScene && !IsObjMarked(pScene) && GetSdrPageView()) { @@ -418,7 +418,7 @@ SdrModel* E3dView::GetMarkedObjModel() const if(pSrcOb->ISA(E3dScene)) { - pScene = (E3dScene*)pSrcOb; + pScene = const_cast<E3dScene*>(static_cast<const E3dScene*>(pSrcOb)); // delete all not intentionally cloned 3d objects pScene->removeAllNonSelectedObjects(); @@ -458,7 +458,7 @@ bool E3dView::Paste( SdrObject* pOwner = pDstList->GetOwnerObj(); if(pOwner && pOwner->ISA(E3dScene)) { - E3dScene* pDstScene = (E3dScene*)pOwner; + E3dScene* pDstScene = static_cast<E3dScene*>(pOwner); BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_EXCHANGE_PASTE)); // Copy all objects from E3dScenes and insert them directly @@ -477,7 +477,7 @@ bool E3dView::Paste( const SdrObject* pSrcOb = pSrcPg->GetObj(nOb); if(pSrcOb->ISA(E3dScene)) { - E3dScene* pSrcScene = (E3dScene*)pSrcOb; + E3dScene* pSrcScene = const_cast<E3dScene*>(static_cast<const E3dScene*>(pSrcOb)); ImpCloneAll3DObjectsToDestScene(pSrcScene, pDstScene, aDist); } } @@ -658,7 +658,7 @@ void E3dView::ImpChangeSomeAttributesFor3DConversion(SdrObject* pObj) if(pObj->ISA(SdrTextObj)) { const SfxItemSet& rSet = pObj->GetMergedItemSet(); - const SvxColorItem& rTextColorItem = (const SvxColorItem&)rSet.Get(EE_CHAR_COLOR); + const SvxColorItem& rTextColorItem = static_cast<const SvxColorItem&>(rSet.Get(EE_CHAR_COLOR)); if(rTextColorItem.GetValue() == RGB_Color(COL_BLACK)) { //For black text objects, the color set to gray @@ -683,11 +683,11 @@ void E3dView::ImpChangeSomeAttributesFor3DConversion2(SdrObject* pObj) if(pObj->ISA(SdrPathObj)) { const SfxItemSet& rSet = pObj->GetMergedItemSet(); - sal_Int32 nLineWidth = ((const XLineWidthItem&)(rSet.Get(XATTR_LINEWIDTH))).GetValue(); - XLineStyle eLineStyle = (XLineStyle)((const XLineStyleItem&)rSet.Get(XATTR_LINESTYLE)).GetValue(); + sal_Int32 nLineWidth = static_cast<const XLineWidthItem&>(rSet.Get(XATTR_LINEWIDTH)).GetValue(); + XLineStyle eLineStyle = (XLineStyle)static_cast<const XLineStyleItem&>(rSet.Get(XATTR_LINESTYLE)).GetValue(); drawing::FillStyle eFillStyle = ITEMVALUE(rSet, XATTR_FILLSTYLE, XFillStyleItem); - if(((SdrPathObj*)pObj)->IsClosed() + if(static_cast<SdrPathObj*>(pObj)->IsClosed() && eLineStyle == XLINE_SOLID && !nLineWidth && eFillStyle != drawing::FillStyle_NONE) @@ -736,7 +736,7 @@ void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, boo // Fill color must be the color line, because the object was // previously just a line - Color aColorLine = ((const XLineColorItem&)(aSet.Get(XATTR_LINECOLOR))).GetColorValue(); + Color aColorLine = static_cast<const XLineColorItem&>(aSet.Get(XATTR_LINECOLOR)).GetColorValue(); aSet.Put(XFillColorItem(OUString(), aColorLine)); } @@ -1064,7 +1064,7 @@ void E3dView::DoDepthArrange(E3dScene* pScene, double fDepth) basegfx::tools::prepareForPolygonOperation(pExtrudeObj->GetExtrudePolygon())); const SfxItemSet& rLocalSet = pExtrudeObj->GetMergedItemSet(); const drawing::FillStyle eLocalFillStyle = ITEMVALUE(rLocalSet, XATTR_FILLSTYLE, XFillStyleItem); - const Color aLocalColor = ((const XFillColorItem&)(rLocalSet.Get(XATTR_FILLCOLOR))).GetColorValue(); + const Color aLocalColor = static_cast<const XFillColorItem&>(rLocalSet.Get(XATTR_FILLCOLOR)).GetColorValue(); // sort in ExtrudeObj if(pLayer) @@ -1095,7 +1095,7 @@ void E3dView::DoDepthArrange(E3dScene* pScene, double fDepth) { if(eLocalFillStyle == drawing::FillStyle_SOLID) { - Color aCompareColor = ((const XFillColorItem&)(rCompareSet.Get(XATTR_FILLCOLOR))).GetColorValue(); + Color aCompareColor = static_cast<const XFillColorItem&>(rCompareSet.Get(XATTR_FILLCOLOR)).GetColorValue(); if(aCompareColor == aLocalColor) { @@ -1221,7 +1221,7 @@ bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrObject *pObj = GetMarkedObjectByIndex(nObjs); if(pObj) { - if(pObj->ISA(E3dScene) && ((E3dScene*)pObj)->GetScene() == pObj) + if(pObj->ISA(E3dScene) && static_cast<E3dScene*>(pObj)->GetScene() == pObj) bThereAreRootScenes = true; if(pObj->ISA(E3dObject)) bThereAre3DObjects = true; @@ -1551,7 +1551,7 @@ bool E3dView::IsBreak3DObjPossible() const if (pObj && pObj->ISA(E3dObject)) { - if(!(((E3dObject*)pObj)->IsBreakObjPossible())) + if(!(static_cast<E3dObject*>(pObj)->IsBreakObjPossible())) return false; } else @@ -1578,7 +1578,7 @@ void E3dView::Break3DObj() BegUndo(SVX_RESSTR(RID_SVX_3D_UNDO_BREAK_LATHE)); for(size_t a=0; a<nCount; ++a) { - E3dObject* pObj = (E3dObject*)GetMarkedObjectByIndex(a); + E3dObject* pObj = static_cast<E3dObject*>(GetMarkedObjectByIndex(a)); BreakSingle3DObj(pObj); } DeleteMarked(); @@ -1595,7 +1595,7 @@ void E3dView::BreakSingle3DObj(E3dObject* pObj) while(aIter.IsMore()) { - E3dObject* pSubObj = (E3dObject*)aIter.Next(); + E3dObject* pSubObj = static_cast<E3dObject*>(aIter.Next()); BreakSingle3DObj(pSubObj); } } diff --git a/svx/source/engine3d/view3d1.cxx b/svx/source/engine3d/view3d1.cxx index 6dd827d34e08..6a392d8b07cc 100644 --- a/svx/source/engine3d/view3d1.cxx +++ b/svx/source/engine3d/view3d1.cxx @@ -52,7 +52,7 @@ void E3dView::ConvertMarkedToPolyObj(bool bLineToArea) if (pObj && pObj->ISA(E3dPolyScene)) { bool bBezier = false; - pNewObj = ((E3dPolyScene*) pObj)->ConvertToPolyObj(bBezier, bLineToArea); + pNewObj = static_cast<E3dPolyScene*>(pObj)->ConvertToPolyObj(bBezier, bLineToArea); if (pNewObj) { @@ -190,12 +190,12 @@ void E3dView::Set3DAttributes( const SfxItemSet& rAttr, E3dScene* pInScene, bool double E3dView::GetDefaultCamPosZ() { - return (double)((const SfxUInt32Item&)pMod->GetItemPool().GetDefaultItem(SDRATTR_3DSCENE_DISTANCE)).GetValue(); + return (double) static_cast<const SfxUInt32Item&>(pMod->GetItemPool().GetDefaultItem(SDRATTR_3DSCENE_DISTANCE)).GetValue(); } double E3dView::GetDefaultCamFocal() { - return (double)((const SfxUInt32Item&)pMod->GetItemPool().GetDefaultItem(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue(); + return (double) static_cast<const SfxUInt32Item&>(pMod->GetItemPool().GetDefaultItem(SDRATTR_3DSCENE_FOCAL_LENGTH)).GetValue(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index ba2aa7220803..5846b9c902ea 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -457,7 +457,7 @@ void GalleryBrowser1::GetFocus() void GalleryBrowser1::Notify( SfxBroadcaster&, const SfxHint& rHint ) { - const GalleryHint& rGalleryHint = (const GalleryHint&) rHint; + const GalleryHint& rGalleryHint = static_cast<const GalleryHint&>(rHint); switch( rGalleryHint.GetType() ) { diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 0e305bb12479..d4c50a4091fb 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -548,7 +548,7 @@ void GalleryBrowser2::Resize() void GalleryBrowser2::Notify( SfxBroadcaster&, const SfxHint& rHint ) { - const GalleryHint& rGalleryHint = (const GalleryHint&) rHint; + const GalleryHint& rGalleryHint = static_cast<const GalleryHint&>(rHint); switch( rGalleryHint.GetType() ) { diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 88f328beaf75..59941c470ea1 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -150,7 +150,7 @@ void GalleryPreview::Paint( const Rectangle& rRect ) void GalleryPreview::MouseButtonDown( const MouseEvent& rMEvt ) { if( mpTheme && ( rMEvt.GetClicks() == 2 ) ) - ( (GalleryBrowser2*) GetParent() )->TogglePreview( this ); + static_cast<GalleryBrowser2*>( GetParent() )->TogglePreview( this ); } void GalleryPreview::Command(const CommandEvent& rCEvt ) @@ -158,7 +158,7 @@ void GalleryPreview::Command(const CommandEvent& rCEvt ) Window::Command( rCEvt ); if( mpTheme && ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) ) - ( (GalleryBrowser2*) GetParent() )->ShowContextMenu( this, + static_cast<GalleryBrowser2*>( GetParent() )->ShowContextMenu( this, ( rCEvt.IsMouseEvent() ? &rCEvt.GetMousePosPixel() : NULL ) ); } @@ -209,7 +209,7 @@ sal_Int8 GalleryPreview::AcceptDrop( const AcceptDropEvent& rEvt ) sal_Int8 nRet; if( mpTheme ) - nRet = ( (GalleryBrowser2*) GetParent() )->AcceptDrop( *this, rEvt ); + nRet = static_cast<GalleryBrowser2*>( GetParent() )->AcceptDrop( *this, rEvt ); else nRet = DND_ACTION_NONE; @@ -221,7 +221,7 @@ sal_Int8 GalleryPreview::ExecuteDrop( const ExecuteDropEvent& rEvt ) sal_Int8 nRet; if( mpTheme ) - nRet = ( (GalleryBrowser2*) GetParent() )->ExecuteDrop( *this, rEvt ); + nRet = static_cast<GalleryBrowser2*>( GetParent() )->ExecuteDrop( *this, rEvt ); else nRet = DND_ACTION_NONE; @@ -231,7 +231,7 @@ sal_Int8 GalleryPreview::ExecuteDrop( const ExecuteDropEvent& rEvt ) void GalleryPreview::StartDrag( sal_Int8, const Point& ) { if( mpTheme ) - ( (GalleryBrowser2*) GetParent() )->StartDrag( this ); + static_cast<GalleryBrowser2*>( GetParent() )->StartDrag( this ); } void GalleryPreview::PreviewMedia( const INetURLObject& rURL ) @@ -376,7 +376,7 @@ void GalleryIconView::MouseButtonDown( const MouseEvent& rMEvt ) ValueSet::MouseButtonDown( rMEvt ); if( rMEvt.GetClicks() == 2 ) - ( (GalleryBrowser2*) GetParent() )->TogglePreview( this, &rMEvt.GetPosPixel() ); + static_cast<GalleryBrowser2*>( GetParent() )->TogglePreview( this, &rMEvt.GetPosPixel() ); } void GalleryIconView::Command( const CommandEvent& rCEvt ) @@ -385,7 +385,7 @@ void GalleryIconView::Command( const CommandEvent& rCEvt ) if( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) { - ( (GalleryBrowser2*) GetParent() )->ShowContextMenu( this, + static_cast<GalleryBrowser2*>( GetParent() )->ShowContextMenu( this, ( rCEvt.IsMouseEvent() ? &rCEvt.GetMousePosPixel() : NULL ) ); } } @@ -574,7 +574,7 @@ void GalleryListView::Command( const CommandEvent& rCEvt ) if( rCEvt.IsMouseEvent() && ( GetRowAtYPosPixel( rCEvt.GetMousePosPixel().Y() ) != BROWSER_ENDOFSELECTION ) ) pPos = &rCEvt.GetMousePosPixel(); - ( (GalleryBrowser2*) GetParent() )->ShowContextMenu( this, pPos ); + static_cast<GalleryBrowser2*>( GetParent() )->ShowContextMenu( this, pPos ); } } @@ -589,7 +589,7 @@ void GalleryListView::DoubleClick( const BrowserMouseEvent& rEvt ) BrowseBox::DoubleClick( rEvt ); if( rEvt.GetRow() != BROWSER_ENDOFSELECTION ) - ( (GalleryBrowser2*) GetParent() )->TogglePreview( this, &rEvt.GetPosPixel() ); + static_cast<GalleryBrowser2*>( GetParent() )->TogglePreview( this, &rEvt.GetPosPixel() ); } void GalleryListView::Select() @@ -614,12 +614,12 @@ sal_Int8 GalleryListView::ExecuteDrop( const BrowserExecuteDropEvent& rEvt ) aEvt.maPosPixel.Y() += GetTitleHeight(); - return( ( (GalleryBrowser2*) GetParent() )->ExecuteDrop( *this, aEvt ) ); + return( static_cast<GalleryBrowser2*>( GetParent() )->ExecuteDrop( *this, aEvt ) ); } void GalleryListView::StartDrag( sal_Int8, const Point& rPosPixel ) { - ( (GalleryBrowser2*) GetParent() )->StartDrag( this, &rPosPixel ); + static_cast<GalleryBrowser2*>( GetParent() )->StartDrag( this, &rPosPixel ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index bad9fefaeb8b..9ab7278ff6da 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -173,8 +173,8 @@ bool CreateIMapGraphic( const FmFormModel& rModel, Graphic& rGraphic, ImageMap& if ( ( pUserData->GetInventor() == IV_IMAPINFO ) && ( pUserData->GetId() == ID_IMAPINFO ) ) { - rGraphic = ( (SdrGrafObj*) pObj )->GetGraphic(); - rImageMap = ( (SgaIMapInfo*) pUserData )->GetImageMap(); + rGraphic = static_cast<const SdrGrafObj*>( pObj )->GetGraphic(); + rImageMap = static_cast<const SgaIMapInfo*>( pUserData )->GetImageMap(); bRet = true; break; } diff --git a/svx/source/items/chrtitem.cxx b/svx/source/items/chrtitem.cxx index 01aceb34554d..bd74e54cf351 100644 --- a/svx/source/items/chrtitem.cxx +++ b/svx/source/items/chrtitem.cxx @@ -236,7 +236,7 @@ bool SvxDoubleItem::GetPresentation bool SvxDoubleItem::operator == (const SfxPoolItem& rItem) const { - return (((SvxDoubleItem&)rItem).fVal == fVal); + return static_cast<const SvxDoubleItem&>(rItem).fVal == fVal; } diff --git a/svx/source/items/clipfmtitem.cxx b/svx/source/items/clipfmtitem.cxx index 39a856008fb3..f7ae1207de0c 100644 --- a/svx/source/items/clipfmtitem.cxx +++ b/svx/source/items/clipfmtitem.cxx @@ -94,7 +94,7 @@ bool SvxClipboardFmtItem::PutValue( const ::com::sun::star::uno::Any& rVal, sal_ bool SvxClipboardFmtItem::operator==( const SfxPoolItem& rComp ) const { - const SvxClipboardFmtItem& rCmp = (SvxClipboardFmtItem&)rComp; + const SvxClipboardFmtItem& rCmp = static_cast<const SvxClipboardFmtItem&>(rComp); if(rCmp.pImpl->aFmtNms.size() != pImpl->aFmtNms.size()) return false; diff --git a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx index 9a281921aa23..88fd9a64c35d 100644 --- a/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dpolygon.cxx @@ -19,7 +19,7 @@ #include <sdr/contact/viewcontactofe3dpolygon.hxx> -#include <polygn3d.hxx> +#include <svx/polygn3d.hxx> #include <drawinglayer/primitive3d/sdrpolypolygonprimitive3d.hxx> #include <svx/sdr/primitive2d/sdrattributecreator.hxx> #include <sdr/primitive3d/sdrattributecreator3d.hxx> diff --git a/svx/source/unodraw/unoshap3.cxx b/svx/source/unodraw/unoshap3.cxx index 3891eb8f006b..3161c3d3fbdf 100644 --- a/svx/source/unodraw/unoshap3.cxx +++ b/svx/source/unodraw/unoshap3.cxx @@ -37,7 +37,7 @@ #include <svx/sphere3d.hxx> #include <svx/lathe3d.hxx> #include <svx/extrud3d.hxx> -#include <polygn3d.hxx> +#include <svx/polygn3d.hxx> #include "svx/unoshprp.hxx" #include "svx/svdmodel.hxx" #include <basegfx/polygon/b3dpolygon.hxx> |