diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-14 13:59:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-14 14:43:43 +0200 |
commit | 5685ee25aad4a4debb47fb5896082be48f521d17 (patch) | |
tree | ba2d8f9341fc1124097e70cae64e1f07cc920712 /sc/source/ui/view | |
parent | 44bfe8fad4f7c263dc713a65fb2ab0e2f9afcf99 (diff) |
improve redundantcast loplugin
to find c-style casts where the expression is a templated method
Change-Id: Ifbd1e2cdc72d906fc95a7ec0f9408c3f6d2a836b
Reviewed-on: https://gerrit.libreoffice.org/42275
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 4 |
5 files changed, 16 insertions, 16 deletions
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index e845a5798b44..885f0ed1f50a 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -1347,14 +1347,14 @@ void ScFormatShell::ExecuteAlignment( SfxRequest& rReq ) case SID_H_ALIGNCELL: { - SvxCellHorJustify eJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem*>(pItem)->GetValue(); + SvxCellHorJustify eJust = static_cast<const SvxHorJustifyItem*>(pItem)->GetValue(); // #i78476# update alignment of text in cell edit mode pTabViewShell->UpdateInputHandlerCellAdjust( eJust ); pTabViewShell->ApplyAttr( SvxHorJustifyItem( eJust, ATTR_HOR_JUSTIFY ) ); } break; case SID_V_ALIGNCELL: - pTabViewShell->ApplyAttr( SvxVerJustifyItem( (SvxCellVerJustify)static_cast<const SvxVerJustifyItem*>(pItem)->GetValue(), ATTR_VER_JUSTIFY ) ); + pTabViewShell->ApplyAttr( SvxVerJustifyItem( static_cast<const SvxVerJustifyItem*>(pItem)->GetValue(), ATTR_VER_JUSTIFY ) ); break; default: OSL_FAIL( "ExecuteAlignment: invalid slot" ); @@ -2443,12 +2443,12 @@ void ScFormatShell::GetAlignState( SfxItemSet& rSet ) SvxCellHorJustify eHAlign = SvxCellHorJustify::Standard; bool bHasHAlign = rAttrSet.GetItemState( ATTR_HOR_JUSTIFY ) != SfxItemState::DONTCARE; if( bHasHAlign ) - eHAlign = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(rAttrSet.Get( ATTR_HOR_JUSTIFY )).GetValue(); + eHAlign = static_cast<const SvxHorJustifyItem&>(rAttrSet.Get( ATTR_HOR_JUSTIFY )).GetValue(); SvxCellVerJustify eVAlign = SVX_VER_JUSTIFY_STANDARD; bool bHasVAlign = rAttrSet.GetItemState( ATTR_VER_JUSTIFY ) != SfxItemState::DONTCARE; if( bHasVAlign ) - eVAlign = (SvxCellVerJustify)static_cast<const SvxVerJustifyItem&>(rAttrSet.Get( ATTR_VER_JUSTIFY )).GetValue(); + eVAlign = static_cast<const SvxVerJustifyItem&>(rAttrSet.Get( ATTR_VER_JUSTIFY )).GetValue(); while ( nWhich ) { diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index be4d38060249..b8ce47a144b2 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5078,9 +5078,9 @@ bool ScGridWindow::GetEditUrl( const Point& rPos, return false; bool bBreak = static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK)).GetValue() || - ((SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(pPattern-> + (static_cast<const SvxHorJustifyItem&>(pPattern-> GetItem( ATTR_HOR_JUSTIFY )).GetValue() == SvxCellHorJustify::Block); - SvxCellHorJustify eHorJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(pPattern-> + SvxCellHorJustify eHorJust = static_cast<const SvxHorJustifyItem&>(pPattern-> GetItem(ATTR_HOR_JUSTIFY)).GetValue(); // EditEngine diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 94e3f55d7b5c..98f8822a338b 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -656,7 +656,7 @@ void ScOutputData::SetCellRotations() // add rotation info to Array information const long nAttrRotate(pPattern->GetRotateVal(pCondSet)); - const SvxRotateMode eRotMode((SvxRotateMode)static_cast<const SvxRotateModeItem&>(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue()); + const SvxRotateMode eRotMode(static_cast<const SvxRotateModeItem&>(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue()); const double fOrient((bLayoutRTL ? -1.0 : 1.0) * nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI] svx::frame::Array& rArray = mrTabInfo.maArray; @@ -678,7 +678,7 @@ static ScRotateDir lcl_GetRotateDir( const ScDocument* pDoc, SCCOL nCol, SCROW n long nAttrRotate = pPattern->GetRotateVal( pCondSet ); if ( nAttrRotate ) { - SvxRotateMode eRotMode = (SvxRotateMode)static_cast<const SvxRotateModeItem&>( + SvxRotateMode eRotMode = static_cast<const SvxRotateModeItem&>( pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue(); if ( eRotMode == SVX_ROTATE_MODE_STANDARD ) @@ -1548,7 +1548,7 @@ void ScOutputData::DrawRotatedFrame(vcl::RenderContext& rRenderContext) //! LastPattern etc. long nAttrRotate = pPattern->GetRotateVal( pCondSet ); - SvxRotateMode eRotMode = (SvxRotateMode)static_cast<const SvxRotateModeItem&>( + SvxRotateMode eRotMode = static_cast<const SvxRotateModeItem&>( pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue(); if (nAttrRotate) diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index a4aab11ba9bf..b324d40f872f 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -323,9 +323,9 @@ void ScDrawStringsVars::SetPattern( // alignment - eAttrHorJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>(pPattern->GetItem( ATTR_HOR_JUSTIFY, pCondSet )).GetValue(); + eAttrHorJust = static_cast<const SvxHorJustifyItem&>(pPattern->GetItem( ATTR_HOR_JUSTIFY, pCondSet )).GetValue(); - eAttrVerJust = (SvxCellVerJustify)static_cast<const SvxVerJustifyItem&>(pPattern->GetItem( ATTR_VER_JUSTIFY, pCondSet )).GetValue(); + eAttrVerJust = static_cast<const SvxVerJustifyItem&>(pPattern->GetItem( ATTR_VER_JUSTIFY, pCondSet )).GetValue(); if ( eAttrVerJust == SVX_VER_JUSTIFY_STANDARD ) eAttrVerJust = SVX_VER_JUSTIFY_BOTTOM; @@ -4721,7 +4721,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) long nCellWidth = (long) pRowInfo[0].pCellInfo[nX+1].nWidth; - SvxCellHorJustify eHorJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>( + SvxCellHorJustify eHorJust = static_cast<const SvxHorJustifyItem&>( pPattern->GetItem(ATTR_HOR_JUSTIFY, pCondSet)).GetValue(); bool bBreak = ( eHorJust == SvxCellHorJustify::Block ) || static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK, pCondSet)).GetValue(); @@ -4769,7 +4769,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) nOutHeight += (long) mpDoc->GetScaledRowHeight( nY+1, nY+nCountY-1, nTab, mnPPTY); } - SvxCellVerJustify eVerJust = (SvxCellVerJustify)static_cast<const SvxVerJustifyItem&>( + SvxCellVerJustify eVerJust = static_cast<const SvxVerJustifyItem&>( pPattern->GetItem(ATTR_VER_JUSTIFY, pCondSet)).GetValue(); // syntax mode is ignored here... @@ -4848,7 +4848,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) GetItem(ATTR_ROTATE_VALUE, pCondSet)).GetValue(); if ( nAttrRotate ) { - eRotMode = (SvxRotateMode)static_cast<const SvxRotateModeItem&>( + eRotMode = static_cast<const SvxRotateModeItem&>( pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet)).GetValue(); if ( nAttrRotate == 18000 ) diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 2f3a8f19e052..d978ef826292 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1050,7 +1050,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich, bEditActive[eWhich] = true; const ScPatternAttr* pPattern = pDoc->GetPattern( nNewX, nNewY, nTabNo ); - SvxCellHorJustify eJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>( + SvxCellHorJustify eJust = static_cast<const SvxHorJustifyItem&>( pPattern->GetItem( ATTR_HOR_JUSTIFY )).GetValue(); bool bBreak = ( eJust == SvxCellHorJustify::Block ) || @@ -1256,7 +1256,7 @@ void ScViewData::EditGrowX() // get bGrow... variables the same way as in SetEditEngine const ScPatternAttr* pPattern = pLocalDoc->GetPattern( nEditCol, nEditRow, nTabNo ); - SvxCellHorJustify eJust = (SvxCellHorJustify)static_cast<const SvxHorJustifyItem&>( + SvxCellHorJustify eJust = static_cast<const SvxHorJustifyItem&>( pPattern->GetItem( ATTR_HOR_JUSTIFY )).GetValue(); bool bGrowCentered = ( eJust == SvxCellHorJustify::Center ); bool bGrowToLeft = ( eJust == SvxCellHorJustify::Right ); // visual left |