summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-14 13:59:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-14 14:43:43 +0200
commit5685ee25aad4a4debb47fb5896082be48f521d17 (patch)
treeba2d8f9341fc1124097e70cae64e1f07cc920712 /cui/source
parent44bfe8fad4f7c263dc713a65fb2ab0e2f9afcf99 (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 'cui/source')
-rw-r--r--cui/source/tabpages/chardlg.cxx4
-rw-r--r--cui/source/tabpages/labdlg.cxx2
-rw-r--r--cui/source/tabpages/textattr.cxx12
3 files changed, 8 insertions, 10 deletions
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 8c67cf48f2e3..0703d70ea751 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1968,7 +1968,7 @@ void SvxCharEffectsPage::Reset( const SfxItemSet* rSet )
case SfxItemState::SET:
{
const SvxCaseMapItem& rItem = static_cast<const SvxCaseMapItem&>(rSet->Get( nWhich ));
- eCaseMap = (SvxCaseMap)rItem.GetValue();
+ eCaseMap = rItem.GetValue();
break;
}
}
@@ -2333,7 +2333,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
SfxItemState::DEFAULT > rOldSet.GetItemState( nWhich );
const SvxCaseMapItem& rItem = *static_cast<const SvxCaseMapItem*>(pOld);
- if ( (SvxCaseMap)rItem.GetValue() == eCaseMap && !bAllowChg )
+ if ( rItem.GetValue() == eCaseMap && !bAllowChg )
bChanged = false;
}
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index 3634ac82c565..b2cd972394b1 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -285,7 +285,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
SetMetricValue( *m_pMF_ABSTAND, nGap, eUnit );
nGap = static_cast<long>(m_pMF_ABSTAND->GetValue());
- nCaptionType = (SdrCaptionType)static_cast<const SdrCaptionTypeItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue();
+ nCaptionType = static_cast<const SdrCaptionTypeItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue();
bFitLineLen = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue();
nEscDir = static_cast<const SdrCaptionEscDirItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue();
bEscRel = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCISREL ) ) ).GetValue();
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx
index b7cf03f7b81b..a56710534587 100644
--- a/cui/source/tabpages/textattr.cxx
+++ b/cui/source/tabpages/textattr.cxx
@@ -235,8 +235,8 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
if(SfxItemState::DONTCARE != eVState && SfxItemState::DONTCARE != eHState)
{
// VertAdjust and HorAdjust are unequivocal, thus
- SdrTextVertAdjust eTVA = (SdrTextVertAdjust)static_cast<const SdrTextVertAdjustItem&>(rAttrs->Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
- SdrTextHorzAdjust eTHA = (SdrTextHorzAdjust)static_cast<const SdrTextHorzAdjustItem&>(rAttrs->Get(SDRATTR_TEXT_HORZADJUST)).GetValue();
+ SdrTextVertAdjust eTVA = static_cast<const SdrTextVertAdjustItem&>(rAttrs->Get(SDRATTR_TEXT_VERTADJUST)).GetValue();
+ SdrTextHorzAdjust eTHA = static_cast<const SdrTextHorzAdjustItem&>(rAttrs->Get(SDRATTR_TEXT_HORZADJUST)).GetValue();
RectPoint eRP = RectPoint::LB;
m_pTsbFullWidth->EnableTriState( false );
@@ -309,7 +309,7 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs )
// adjust to border
if ( rAttrs->GetItemState( SDRATTR_TEXT_FITTOSIZE ) != SfxItemState::DONTCARE )
{
- SdrFitToSizeType eFTS = (SdrFitToSizeType)
+ SdrFitToSizeType eFTS =
static_cast<const SdrTextFitToSizeTypeItem&>( rAttrs->Get( SDRATTR_TEXT_FITTOSIZE ) ).GetValue();
if( eFTS == SdrFitToSizeType::Autofit || eFTS == SdrFitToSizeType::NONE )
m_pTsbFitToSize->SetState( TRISTATE_FALSE );
@@ -462,8 +462,7 @@ bool SvxTextAttrPage::FillItemSet( SfxItemSet* rAttrs)
if ( rOutAttrs.GetItemState( SDRATTR_TEXT_VERTADJUST ) != SfxItemState::DONTCARE )
{
- eOldTVA = (SdrTextVertAdjust)
- static_cast<const SdrTextVertAdjustItem&>( rOutAttrs.Get( SDRATTR_TEXT_VERTADJUST ) ).GetValue();
+ eOldTVA = static_cast<const SdrTextVertAdjustItem&>( rOutAttrs.Get( SDRATTR_TEXT_VERTADJUST ) ).GetValue();
if( eOldTVA != eTVA )
rAttrs->Put( SdrTextVertAdjustItem( eTVA ) );
}
@@ -472,8 +471,7 @@ bool SvxTextAttrPage::FillItemSet( SfxItemSet* rAttrs)
if ( rOutAttrs.GetItemState( SDRATTR_TEXT_HORZADJUST ) != SfxItemState::DONTCARE )
{
- eOldTHA = (SdrTextHorzAdjust)
- static_cast<const SdrTextHorzAdjustItem&>( rOutAttrs.Get( SDRATTR_TEXT_HORZADJUST ) ).GetValue();
+ eOldTHA = static_cast<const SdrTextHorzAdjustItem&>( rOutAttrs.Get( SDRATTR_TEXT_HORZADJUST ) ).GetValue();
if( eOldTHA != eTHA )
rAttrs->Put( SdrTextHorzAdjustItem( eTHA ) );
}