diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-17 12:22:22 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-10-20 13:33:57 +0200 |
commit | b0509439d9fa664be8f94b557d83ea3a2891c31f (patch) | |
tree | e801f2a265b11a8abfb665f78683fc4a83ef1616 /svx/source/table | |
parent | 8c8d6f08491479c23998cbfb96201f12acbd873a (diff) |
loplugin: cstylecast
Change-Id: I2cb764db97469654f977de63e273874d43745bf8
Diffstat (limited to 'svx/source/table')
-rw-r--r-- | svx/source/table/cell.cxx | 22 | ||||
-rw-r--r-- | svx/source/table/svdotable.cxx | 6 | ||||
-rw-r--r-- | svx/source/table/tablecontroller.cxx | 18 | ||||
-rw-r--r-- | svx/source/table/tablelayouter.cxx | 2 | ||||
-rw-r--r-- | svx/source/table/viewcontactoftableobj.cxx | 4 | ||||
-rw-r--r-- | svx/source/table/viewcontactoftableobj.hxx | 10 |
6 files changed, 29 insertions, 33 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 5fd38f9d77ae..78dfb9c16305 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -233,7 +233,7 @@ namespace sdr void CellProperties::ItemSetChanged(const SfxItemSet& rSet ) { - SdrTextObj& rObj = (SdrTextObj&)GetSdrObject(); + SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject()); if( mxCell.is() ) { @@ -303,9 +303,9 @@ namespace sdr { 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()); - sdr::table::SdrTableObj& rObj = (sdr::table::SdrTableObj&)GetSdrObject(); + sdr::table::SdrTableObj& rObj = static_cast<sdr::table::SdrTableObj&>(GetSdrObject()); if( rObj.IsVerticalWriting() != bVertical ) rObj.SetVerticalWriting(bVertical); @@ -740,42 +740,42 @@ sal_Int32 Cell::getMinimumHeight() long Cell::GetTextLeftDistance() const { - return ((SdrMetricItem&)(GetItemSet().Get(SDRATTR_TEXT_LEFTDIST))).GetValue(); + return static_cast<const SdrMetricItem&>(GetItemSet().Get(SDRATTR_TEXT_LEFTDIST)).GetValue(); } long Cell::GetTextRightDistance() const { - return ((SdrMetricItem&)(GetItemSet().Get(SDRATTR_TEXT_RIGHTDIST))).GetValue(); + return static_cast<const SdrMetricItem&>(GetItemSet().Get(SDRATTR_TEXT_RIGHTDIST)).GetValue(); } long Cell::GetTextUpperDistance() const { - return ((SdrMetricItem&)(GetItemSet().Get(SDRATTR_TEXT_UPPERDIST))).GetValue(); + return static_cast<const SdrMetricItem&>(GetItemSet().Get(SDRATTR_TEXT_UPPERDIST)).GetValue(); } long Cell::GetTextLowerDistance() const { - return ((SdrMetricItem&)(GetItemSet().Get(SDRATTR_TEXT_LOWERDIST))).GetValue(); + return static_cast<const SdrMetricItem&>(GetItemSet().Get(SDRATTR_TEXT_LOWERDIST)).GetValue(); } SdrTextVertAdjust Cell::GetTextVerticalAdjust() const { - return ((SdrTextVertAdjustItem&)(GetItemSet().Get(SDRATTR_TEXT_VERTADJUST))).GetValue(); + return static_cast<const SdrTextVertAdjustItem&>(GetItemSet().Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); } SdrTextHorzAdjust Cell::GetTextHorizontalAdjust() const { - return ((SdrTextHorzAdjustItem&)(GetItemSet().Get(SDRATTR_TEXT_HORZADJUST))).GetValue(); + return static_cast<const SdrTextHorzAdjustItem&>(GetItemSet().Get(SDRATTR_TEXT_HORZADJUST)).GetValue(); } @@ -1423,7 +1423,7 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) th case XATTR_FILLHATCH: case XATTR_LINEDASH: { - NameOrIndex* pItem = (NameOrIndex*)rSet.GetItem((sal_uInt16)pMap->nWID); + const NameOrIndex* pItem = static_cast<const NameOrIndex*>(rSet.GetItem((sal_uInt16)pMap->nWID)); if( ( pItem == NULL ) || pItem->GetName().isEmpty() ) eState = PropertyState_DEFAULT_VALUE; } @@ -1438,7 +1438,7 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) th case XATTR_LINESTART: case XATTR_FILLFLOATTRANSPARENCE: { - NameOrIndex* pItem = (NameOrIndex*)rSet.GetItem((sal_uInt16)pMap->nWID); + const NameOrIndex* pItem = static_cast<const NameOrIndex*>(rSet.GetItem((sal_uInt16)pMap->nWID)); if( pItem == NULL ) eState = PropertyState_DEFAULT_VALUE; } diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 7260c0aaab42..ac5a02dd7fe6 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1361,7 +1361,7 @@ void SdrTableObj::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 =false; rInfo.bEdgeRadiusAllowed=false; @@ -2467,7 +2467,7 @@ void SdrTableObj::SaveGeoData(SdrObjGeoData& rGeo) const DBG_ASSERT( dynamic_cast< TableObjectGeoData* >( &rGeo ), "svx::SdrTableObj::SaveGeoData(), illegal geo data!" ); SdrTextObj::SaveGeoData (rGeo); - ((TableObjectGeoData &) rGeo).maLogicRect = maLogicRect; + static_cast<TableObjectGeoData &>(rGeo).maLogicRect = maLogicRect; } @@ -2476,7 +2476,7 @@ void SdrTableObj::RestGeoData(const SdrObjGeoData& rGeo) { DBG_ASSERT( dynamic_cast< const TableObjectGeoData* >( &rGeo ), "svx::SdrTableObj::SaveGeoData(), illegal geo data!" ); - maLogicRect = ((TableObjectGeoData &) rGeo).maLogicRect; + maLogicRect = static_cast<const TableObjectGeoData &>(rGeo).maLogicRect; SdrTextObj::RestGeoData (rGeo); diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 980b72874a57..3cd25b4505b0 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -423,7 +423,7 @@ void SvxTableController::GetState( SfxItemSet& rSet ) SdrTextVertAdjust eAdj = SDRTEXTVERTADJUST_BLOCK; if( pSet->GetItemState( SDRATTR_TEXT_VERTADJUST ) != SfxItemState::DONTCARE ) - eAdj = ((SdrTextVertAdjustItem&)(pSet->Get(SDRATTR_TEXT_VERTADJUST))).GetValue(); + eAdj = static_cast<const SdrTextVertAdjustItem&>(pSet->Get(SDRATTR_TEXT_VERTADJUST)).GetValue(); rSet.Put(SfxBoolItem(SID_TABLE_VERT_BOTTOM, eAdj == SDRTEXTVERTADJUST_BOTTOM)); rSet.Put(SfxBoolItem(SID_TABLE_VERT_CENTER, eAdj == SDRTEXTVERTADJUST_CENTER)); @@ -504,9 +504,9 @@ void SvxTableController::onInsert( sal_uInt16 nSId, const SfxItemSet* pArgs ) pArgs->GetItemState(nSId, false, &pItem); if (pItem) { - nCount = ((const SfxInt16Item* )pItem)->GetValue(); + nCount = static_cast<const SfxInt16Item*>(pItem)->GetValue(); if(SfxItemState::SET == pArgs->GetItemState(SID_TABLE_PARAM_INSERT_AFTER, true, &pItem)) - bInsertAfter = ((const SfxBoolItem* )pItem)->GetValue(); + bInsertAfter = static_cast<const SfxBoolItem*>(pItem)->GetValue(); } } @@ -868,10 +868,10 @@ void SvxTableController::onFormatTable( SfxRequest& rReq ) // merge drawing layer text distance items into SvxBoxItem used by the dialog SvxBoxItem aBoxItem( static_cast< const SvxBoxItem& >( aNewAttr.Get( SDRATTR_TABLE_BORDER ) ) ); - aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( ((SdrMetricItem&)(aNewAttr.Get(SDRATTR_TEXT_LEFTDIST))).GetValue()), BOX_LINE_LEFT ); - aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( ((SdrMetricItem&)(aNewAttr.Get(SDRATTR_TEXT_RIGHTDIST))).GetValue()), BOX_LINE_RIGHT ); - aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( ((SdrMetricItem&)(aNewAttr.Get(SDRATTR_TEXT_UPPERDIST))).GetValue()), BOX_LINE_TOP ); - aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( ((SdrMetricItem&)(aNewAttr.Get(SDRATTR_TEXT_LOWERDIST))).GetValue()), BOX_LINE_BOTTOM ); + aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(aNewAttr.Get(SDRATTR_TEXT_LEFTDIST)).GetValue()), BOX_LINE_LEFT ); + aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(aNewAttr.Get(SDRATTR_TEXT_RIGHTDIST)).GetValue()), BOX_LINE_RIGHT ); + aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(aNewAttr.Get(SDRATTR_TEXT_UPPERDIST)).GetValue()), BOX_LINE_TOP ); + aBoxItem.SetDistance( sal::static_int_cast< sal_uInt16 >( static_cast<const SdrMetricItem&>(aNewAttr.Get(SDRATTR_TEXT_LOWERDIST)).GetValue()), BOX_LINE_BOTTOM ); SvxBoxInfoItem aBoxInfoItem( static_cast< const SvxBoxInfoItem& >( aNewAttr.Get( SDRATTR_TABLE_BORDER_INNER ) ) ); @@ -2346,7 +2346,7 @@ void SvxTableController::ApplyBorderAttr( const SfxItemSet& rAttr ) const SvxBorderLine* pBorderLineItem = 0; if(SfxItemState::SET == rAttr.GetItemState(SID_FRAME_LINESTYLE, false) ) - pBorderLineItem = ((const SvxLineItem&)rAttr.Get( SID_FRAME_LINESTYLE )).GetLine(); + pBorderLineItem = static_cast<const SvxLineItem&>(rAttr.Get( SID_FRAME_LINESTYLE )).GetLine(); if( pBoxInfoItem && !pBoxItem ) { @@ -2380,7 +2380,7 @@ void SvxTableController::ApplyBorderAttr( const SfxItemSet& rAttr ) continue; const SfxItemSet& rSet = xCell->GetItemSet(); - const SvxBoxItem* pOldOuter = (const SvxBoxItem*) &rSet.Get( SDRATTR_TABLE_BORDER ); + const SvxBoxItem* pOldOuter = static_cast<const SvxBoxItem*>(&rSet.Get( SDRATTR_TABLE_BORDER )); SvxBoxItem aNewFrame( *pOldOuter ); diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index b3743ebda907..0c5368486386 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -1025,7 +1025,7 @@ void TableLayouter::UpdateBorderLayout() if( !xCell.is() ) continue; - const SvxBoxItem* pThisAttr = (const SvxBoxItem*)xCell->GetItemSet().GetItem( SDRATTR_TABLE_BORDER ); + const SvxBoxItem* pThisAttr = static_cast<const SvxBoxItem*>(xCell->GetItemSet().GetItem( SDRATTR_TABLE_BORDER )); OSL_ENSURE(pThisAttr,"sdr::table::TableLayouter::UpdateBorderLayout(), no border attribute?"); if( !pThisAttr ) diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx index 1468b293ff1b..48b30df42f42 100644 --- a/svx/source/table/viewcontactoftableobj.cxx +++ b/svx/source/table/viewcontactoftableobj.cxx @@ -132,7 +132,7 @@ namespace drawinglayer { if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { - const SdrCellPrimitive2D& rCompare = (SdrCellPrimitive2D&)rPrimitive; + const SdrCellPrimitive2D& rCompare = static_cast<const SdrCellPrimitive2D&>(rPrimitive); return (getTransform() == rCompare.getTransform() && getSdrFTAttribute() == rCompare.getSdrFTAttribute()); @@ -439,7 +439,7 @@ namespace drawinglayer { if(BufferedDecompositionPrimitive2D::operator==(rPrimitive)) { - const SdrBorderlinePrimitive2D& rCompare = (SdrBorderlinePrimitive2D&)rPrimitive; + const SdrBorderlinePrimitive2D& rCompare = static_cast<const SdrBorderlinePrimitive2D&>(rPrimitive); return (getTransform() == rCompare.getTransform() && getLeftLine() == rCompare.getLeftLine() diff --git a/svx/source/table/viewcontactoftableobj.hxx b/svx/source/table/viewcontactoftableobj.hxx index 2a78206ad7b1..849400ea3f75 100644 --- a/svx/source/table/viewcontactoftableobj.hxx +++ b/svx/source/table/viewcontactoftableobj.hxx @@ -21,6 +21,7 @@ #define INCLUDED_SVX_SOURCE_TABLE_VIEWCONTACTOFTABLEOBJ_HXX #include <svx/sdr/contact/viewcontactofsdrobj.hxx> +#include <svx/svdotable.hxx> // predeclarations @@ -29,20 +30,15 @@ namespace sdr { - namespace table - { - class SdrTableObj; - } - namespace contact { class ViewContactOfTableObj : public ViewContactOfSdrObj { protected: // internal access to SdrTextObj - ::sdr::table::SdrTableObj& GetTableObj() const + const ::sdr::table::SdrTableObj& GetTableObj() const { - return (::sdr::table::SdrTableObj&)GetSdrObject(); + return static_cast<const ::sdr::table::SdrTableObj&>(GetSdrObject()); } // This method is responsible for creating the graphical visualisation data derived ONLY from |