From f6e256c4825a6d7c9d7125a4100c10f8c4de750a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 12 Jan 2018 20:26:08 +0100 Subject: More loplugin:cstylecast: cui auto-rewrite with "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I04b0e0c0268cbcc1c7e7ff2174c5125785e09a07 --- cui/source/tabpages/transfrm.cxx | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'cui/source/tabpages/transfrm.cxx') diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index d9a3ff38ac85..b7c154ab2842 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -289,7 +289,7 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs) const SfxPoolItem* pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ROT_X ); if(pItem) { - const double fTmp(((double)static_cast(pItem)->GetValue() - maAnchor.getX()) / fUIScale); + const double fTmp((static_cast(static_cast(pItem)->GetValue()) - maAnchor.getX()) / fUIScale); SetMetricValue(*m_pMtrPosX, basegfx::fround(fTmp), ePoolUnit); } else @@ -300,7 +300,7 @@ void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs) pItem = GetItem(*rAttrs, SID_ATTR_TRANSFORM_ROT_Y); if(pItem) { - const double fTmp(((double)static_cast(pItem)->GetValue() - maAnchor.getY()) / fUIScale); + const double fTmp((static_cast(static_cast(pItem)->GetValue()) - maAnchor.getY()) / fUIScale); SetMetricValue(*m_pMtrPosY, basegfx::fround(fTmp), ePoolUnit); } else @@ -583,7 +583,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs) if( pItem ) { const double fUIScale(double(pView->GetModel()->GetUIScale())); - const double fTmp((double)static_cast(pItem)->GetValue() / fUIScale); + const double fTmp(static_cast(static_cast(pItem)->GetValue()) / fUIScale); SetMetricValue(*m_pMtrRadius, basegfx::fround(fTmp), ePoolUnit); } else @@ -966,20 +966,20 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) // get Width double nWidth = static_cast(m_pMtrWidth->GetValue( meDlgUnit )); nWidth = MetricField::ConvertDoubleValue( nWidth, m_pMtrWidth->GetBaseValue(), m_pMtrWidth->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM ); - long lWidth = long(nWidth * (double)aUIScale); + long lWidth = long(nWidth * static_cast(aUIScale)); lWidth = OutputDevice::LogicToLogic( lWidth, MapUnit::Map100thMM, mePoolUnit ); lWidth = static_cast(m_pMtrWidth->Denormalize( lWidth )); // get Height double nHeight = static_cast(m_pMtrHeight->GetValue( meDlgUnit )); nHeight = MetricField::ConvertDoubleValue( nHeight, m_pMtrHeight->GetBaseValue(), m_pMtrHeight->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM ); - long lHeight = long(nHeight * (double)aUIScale); + long lHeight = long(nHeight * static_cast(aUIScale)); lHeight = OutputDevice::LogicToLogic( lHeight, MapUnit::Map100thMM, mePoolUnit ); lHeight = static_cast(m_pMtrHeight->Denormalize( lHeight )); // put Width & Height to itemset - rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), (sal_uInt32) lWidth ) ); - rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), (sal_uInt32) lHeight ) ); + rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), static_cast(lWidth) ) ); + rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), static_cast(lHeight) ) ); rOutAttrs->Put( SfxAllEnumItem( GetWhich( SID_ATTR_TRANSFORM_SIZE_POINT ), sal::static_int_cast< sal_uInt16 >( meRP ) ) ); bModified = true; } @@ -1070,7 +1070,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* ) { // #i75273# set width pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_WIDTH ); - mfOldWidth = std::max( pItem ? (double)static_cast(pItem)->GetValue() : 0.0, 1.0 ); + mfOldWidth = std::max( pItem ? static_cast(static_cast(pItem)->GetValue()) : 0.0, 1.0 ); double fTmpWidth((OutputDevice::LogicToLogic(static_cast(mfOldWidth), mePoolUnit, MapUnit::Map100thMM)) / fUIScale); if(m_pMtrWidth->GetDecimalDigits()) @@ -1082,7 +1082,7 @@ void SvxPositionSizeTabPage::Reset( const SfxItemSet* ) { // #i75273# set height pItem = GetItem( mrOutAttrs, SID_ATTR_TRANSFORM_HEIGHT ); - mfOldHeight = std::max( pItem ? (double)static_cast(pItem)->GetValue() : 0.0, 1.0 ); + mfOldHeight = std::max( pItem ? static_cast(static_cast(pItem)->GetValue()) : 0.0, 1.0 ); double fTmpHeight((OutputDevice::LogicToLogic(static_cast(mfOldHeight), mePoolUnit, MapUnit::Map100thMM)) / fUIScale); if(m_pMtrHeight->GetDecimalDigits()) @@ -1160,8 +1160,8 @@ DeactivateRC SvxPositionSizeTabPage::DeactivatePage( SfxItemSet* _pSet ) { if( _pSet ) { - double fX((double)m_pMtrPosX->GetValue()); - double fY((double)m_pMtrPosY->GetValue()); + double fX(static_cast(m_pMtrPosX->GetValue())); + double fY(static_cast(m_pMtrPosY->GetValue())); GetTopLeftPosition(fX, fY, maRange); const ::tools::Rectangle aOutRectangle( @@ -1308,7 +1308,7 @@ void SvxPositionSizeTabPage::SetMinMaxPosition() } } - const double fMaxLong((double)(MetricField::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1)); + const double fMaxLong(static_cast(MetricField::ConvertValue( LONG_MAX, 0, MapUnit::Map100thMM, meDlgUnit ) - 1)); fLeft = basegfx::clamp(fLeft, -fMaxLong, fMaxLong); fRight = basegfx::clamp(fRight, -fMaxLong, fMaxLong); fTop = basegfx::clamp(fTop, - fMaxLong, fMaxLong); @@ -1549,7 +1549,7 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeWidthHdl, Edit&, void) { if( m_pCbxScale->IsChecked() && m_pCbxScale->IsEnabled() ) { - sal_Int64 nHeight(basegfx::fround64((mfOldHeight * (double)m_pMtrWidth->GetValue()) / mfOldWidth)); + sal_Int64 nHeight(basegfx::fround64((mfOldHeight * static_cast(m_pMtrWidth->GetValue())) / mfOldWidth)); if(nHeight <= m_pMtrHeight->GetMax(FUNIT_NONE)) { @@ -1560,7 +1560,7 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeWidthHdl, Edit&, void) nHeight = m_pMtrHeight->GetMax(FUNIT_NONE); m_pMtrHeight->SetUserValue(nHeight); - const sal_Int64 nWidth(basegfx::fround64((mfOldWidth * (double)nHeight) / mfOldHeight)); + const sal_Int64 nWidth(basegfx::fround64((mfOldWidth * static_cast(nHeight)) / mfOldHeight)); m_pMtrWidth->SetUserValue(nWidth, FUNIT_NONE); } } @@ -1571,7 +1571,7 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeHeightHdl, Edit&, void) { if( m_pCbxScale->IsChecked() && m_pCbxScale->IsEnabled() ) { - sal_Int64 nWidth(basegfx::fround64((mfOldWidth * (double)m_pMtrHeight->GetValue()) / mfOldHeight)); + sal_Int64 nWidth(basegfx::fround64((mfOldWidth * static_cast(m_pMtrHeight->GetValue())) / mfOldHeight)); if(nWidth <= m_pMtrWidth->GetMax(FUNIT_NONE)) { @@ -1582,7 +1582,7 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ChangeHeightHdl, Edit&, void) nWidth = m_pMtrWidth->GetMax(FUNIT_NONE); m_pMtrWidth->SetUserValue(nWidth); - const sal_Int64 nHeight(basegfx::fround64((mfOldHeight * (double)nWidth) / mfOldWidth)); + const sal_Int64 nHeight(basegfx::fround64((mfOldHeight * static_cast(nWidth)) / mfOldWidth)); m_pMtrHeight->SetUserValue(nHeight, FUNIT_NONE); } } @@ -1599,8 +1599,8 @@ IMPL_LINK_NOARG(SvxPositionSizeTabPage, ClickAutoHdl, Button*, void) { if( m_pCbxScale->IsChecked() ) { - mfOldWidth = std::max( (double)GetCoreValue( *m_pMtrWidth, mePoolUnit ), 1.0 ); - mfOldHeight = std::max( (double)GetCoreValue( *m_pMtrHeight, mePoolUnit ), 1.0 ); + mfOldWidth = std::max( static_cast(GetCoreValue( *m_pMtrWidth, mePoolUnit )), 1.0 ); + mfOldHeight = std::max( static_cast(GetCoreValue( *m_pMtrHeight, mePoolUnit )), 1.0 ); } } -- cgit v1.2.1