diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-08-14 15:37:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-15 08:56:52 +0200 |
commit | 8ee4530b90ca7c7967fad00f059236a2b0b57607 (patch) | |
tree | 5335981632ba7a871c5f9f8cc41ed46414fba248 | |
parent | b50d6a593dbd4e17cf2caee0e6765a0d22f49e76 (diff) |
remove redundant SvxFrameDirection casts
and replace remaining C-style casts
Change-Id: Ie83e2706391c05946ab46dfd7d26059101579153
Reviewed-on: https://gerrit.libreoffice.org/41143
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | chart2/source/controller/dialogs/res_DataLabel.cxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_AxisLabel.cxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_LegendPosition.cxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/dialogs/tp_TitleRotation.cxx | 2 | ||||
-rw-r--r-- | filter/source/msfilter/svdfppt.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documen8.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 2 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-text.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/futext.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/column.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/frmpage.cxx | 8 |
12 files changed, 20 insertions, 17 deletions
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx index ea48698aadb1..74c4e786c1b0 100644 --- a/chart2/source/controller/dialogs/res_DataLabel.cxx +++ b/chart2/source/controller/dialogs/res_DataLabel.cxx @@ -357,7 +357,7 @@ void DataLabelResources::Reset(const SfxItemSet& rInAttrs) m_pLB_LabelPlacement->SetNoSelection(); if( rInAttrs.GetItemState(EE_PARA_WRITINGDIR, true, &pPoolItem ) == SfxItemState::SET ) - m_pLB_TextDirection->SelectEntryValue( SvxFrameDirection(static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue()) ); + m_pLB_TextDirection->SelectEntryValue( static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue() ); if( rInAttrs.GetItemState( SCHATTR_TEXT_DEGREES, true, &pPoolItem ) == SfxItemState::SET ) { diff --git a/chart2/source/controller/dialogs/tp_AxisLabel.cxx b/chart2/source/controller/dialogs/tp_AxisLabel.cxx index 56b8f28c4d89..0527e080c184 100644 --- a/chart2/source/controller/dialogs/tp_AxisLabel.cxx +++ b/chart2/source/controller/dialogs/tp_AxisLabel.cxx @@ -204,7 +204,7 @@ void SchAxisLabelTabPage::Reset( const SfxItemSet* rInAttrs ) m_pOrientHlp->SetStackedState( TRISTATE_INDET ); if( rInAttrs->GetItemState( EE_PARA_WRITINGDIR, true, &pPoolItem ) == SfxItemState::SET ) - m_pLbTextDirection->SelectEntryValue( SvxFrameDirection(static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue()) ); + m_pLbTextDirection->SelectEntryValue( static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue() ); // Text overlap ---------- aState = rInAttrs->GetItemState( SCHATTR_AXIS_LABEL_OVERLAP, false, &pPoolItem ); diff --git a/chart2/source/controller/dialogs/tp_LegendPosition.cxx b/chart2/source/controller/dialogs/tp_LegendPosition.cxx index 659ffcb645af..b36163dfda7c 100644 --- a/chart2/source/controller/dialogs/tp_LegendPosition.cxx +++ b/chart2/source/controller/dialogs/tp_LegendPosition.cxx @@ -74,7 +74,7 @@ void SchLegendPosTabPage::Reset(const SfxItemSet* rInAttrs) const SfxPoolItem* pPoolItem = nullptr; if( rInAttrs->GetItemState( EE_PARA_WRITINGDIR, true, &pPoolItem ) == SfxItemState::SET ) - m_pLbTextDirection->SelectEntryValue( SvxFrameDirection(static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue()) ); + m_pLbTextDirection->SelectEntryValue( static_cast<const SvxFrameDirectionItem*>(pPoolItem)->GetValue() ); } } //namespace chart diff --git a/chart2/source/controller/dialogs/tp_TitleRotation.cxx b/chart2/source/controller/dialogs/tp_TitleRotation.cxx index 9e966778871c..4ae20c5b07f6 100644 --- a/chart2/source/controller/dialogs/tp_TitleRotation.cxx +++ b/chart2/source/controller/dialogs/tp_TitleRotation.cxx @@ -113,7 +113,7 @@ void SchAlignmentTabPage::Reset(const SfxItemSet* rInAttrs) m_pOrientHlp->SetStackedState( bStacked ? TRISTATE_TRUE : TRISTATE_FALSE ); if( rInAttrs->GetItemState(EE_PARA_WRITINGDIR, true, &pItem) == SfxItemState::SET) - m_pLbTextDirection->SelectEntryValue( SvxFrameDirection(static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue()) ); + m_pLbTextDirection->SelectEntryValue( static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue() ); } } //namespace chart diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 889e44eefe3d..87b5b1284bdb 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -7403,7 +7403,7 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell > const & xCel //set textHorizontalAdjust and TextWritingMode attr const sal_Int32 eHA(static_cast<const SdrTextHorzAdjustItem&>(pObj->GetMergedItem(SDRATTR_TEXT_HORZADJUST)).GetValue()); - const SvxFrameDirection eDirection = (SvxFrameDirection)(static_cast<const SvxFrameDirectionItem&>(pObj->GetMergedItem(EE_PARA_WRITINGDIR)).GetValue()); + const SvxFrameDirection eDirection = static_cast<const SvxFrameDirectionItem&>(pObj->GetMergedItem(EE_PARA_WRITINGDIR)).GetValue(); xPropSet->setPropertyValue( "TextHorizontalAdjust" , Any( eHA ) ); if ( eDirection == SvxFrameDirection::Vertical_RL_TB ) {//vertical writing diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 24fcdc64084e..4fe960637044 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -370,7 +370,7 @@ sal_uInt8 ScDocument::GetEditTextDirection(SCTAB nTab) const if ( pStyle ) { SfxItemSet& rStyleSet = pStyle->GetItemSet(); - SvxFrameDirection eDirection = (SvxFrameDirection) + SvxFrameDirection eDirection = static_cast<const SvxFrameDirectionItem&>(rStyleSet.Get( ATTR_WRITINGDIR )).GetValue(); if ( eDirection == SvxFrameDirection::Horizontal_LR_TB ) diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 8206cb2efa25..20e47e079b18 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -1168,7 +1168,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) } else { - SvxFrameDirection eAttrDir = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>( + SvxFrameDirection eAttrDir = static_cast<const SvxFrameDirectionItem&>( aAttrSet.Get( EE_PARA_WRITINGDIR )).GetValue(); if ( eAttrDir == SvxFrameDirection::Environment ) { diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 01007fc205d3..3dc53df16d36 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -2697,7 +2697,7 @@ void ScFormatShell::GetTextDirectionState( SfxItemSet& rSet ) EEHorizontalTextDirection eBidiDir = EE_HTEXTDIR_DEFAULT; if ( !bBidiDontCare ) { - SvxFrameDirection eCellDir = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>( + SvxFrameDirection eCellDir = static_cast<const SvxFrameDirectionItem&>( rAttrSet.Get( ATTR_WRITINGDIR )).GetValue(); if ( eCellDir == SvxFrameDirection::Environment ) eBidiDir = (EEHorizontalTextDirection)GetViewData()->GetDocument()-> diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index 76adf02d3842..bd898407e880 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -1196,7 +1196,7 @@ void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider* pBuProv, bool bG sal_Int16 nWritingMode = 0; mAny >>= nWritingMode; - SvxFrameDirection eWritingMode( (SvxFrameDirection)nWritingMode ); + SvxFrameDirection eWritingMode = static_cast<SvxFrameDirection>(nWritingMode); if ( ( eWritingMode == SvxFrameDirection::Horizontal_RL_TB ) || ( eWritingMode == SvxFrameDirection::Vertical_RL_TB ) ) { diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 1d65dd5d8fca..d6db3f7bb22d 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -829,7 +829,8 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) // one of the default set items from ImpSetAttributesForNewTextObject // needs to be adapted to non-block mode. const SfxItemSet& rSet = mpView->GetDefaultAttr(); - SvxFrameDirection eDirection = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(rSet.Get(EE_PARA_WRITINGDIR)).GetValue(); + SvxFrameDirection eDirection = static_cast<const SvxFrameDirectionItem&>( + rSet.Get(EE_PARA_WRITINGDIR)).GetValue(); if(SvxFrameDirection::Horizontal_RL_TB == eDirection || SvxFrameDirection::Vertical_RL_TB == eDirection) { @@ -849,7 +850,8 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) // Look in the object defaults if left-to-right is wanted. If // yes, set text anchoring to right to let the box grow to left. const SfxItemSet& rSet = mpView->GetDefaultAttr(); - SvxFrameDirection eDirection = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(rSet.Get(EE_PARA_WRITINGDIR)).GetValue(); + SvxFrameDirection eDirection = + static_cast<const SvxFrameDirectionItem&>(rSet.Get(EE_PARA_WRITINGDIR)).GetValue(); if(SvxFrameDirection::Horizontal_RL_TB == eDirection) { diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 54d33a4fbbb0..f7995e5ce6be 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -653,8 +653,9 @@ bool SwColumnPage::FillItemSet(SfxItemSet *rSet) const sal_Int32 nPos = m_pTextDirectionLB->GetSelectEntryPos(); if ( m_pTextDirectionLB->IsValueChangedFromSaved() ) { - sal_uInt32 nDirection = (sal_uInt32)reinterpret_cast<sal_IntPtr>(m_pTextDirectionLB->GetEntryData( nPos )); - rSet->Put( SvxFrameDirectionItem( (SvxFrameDirection)nDirection, RES_FRAMEDIR)); + SvxFrameDirection eDirection = static_cast<SvxFrameDirection>( + reinterpret_cast<sal_IntPtr>(m_pTextDirectionLB->GetEntryData( nPos ))); + rSet->Put( SvxFrameDirectionItem(eDirection, RES_FRAMEDIR) ); } } return true; diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index eb2dcd2c7540..48617f50e596 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -3090,7 +3090,7 @@ void SwFrameAddPage::Reset(const SfxItemSet *rSet ) SvxFrameDirection nVal = static_cast<const SvxFrameDirectionItem&>(rSet->Get(RES_FRAMEDIR)).GetValue(); sal_Int32 nPos; for( nPos = m_pTextFlowLB->GetEntryCount(); nPos; ) - if( (SvxFrameDirection)reinterpret_cast<sal_IntPtr>(m_pTextFlowLB->GetEntryData( --nPos )) == nVal ) + if( static_cast<SvxFrameDirection>(reinterpret_cast<sal_IntPtr>(m_pTextFlowLB->GetEntryData( --nPos ))) == nVal ) break; m_pTextFlowLB->SelectEntryPos( nPos ); m_pTextFlowLB->SaveValue(); @@ -3149,9 +3149,9 @@ bool SwFrameAddPage::FillItemSet(SfxItemSet *rSet) sal_Int32 nPos = m_pTextFlowLB->GetSelectEntryPos(); if( m_pTextFlowLB->IsValueChangedFromSaved() ) { - sal_uInt16 nData = (sal_uInt16)reinterpret_cast<sal_IntPtr>(m_pTextFlowLB->GetEntryData( nPos )); - bRet |= nullptr != rSet->Put( SvxFrameDirectionItem( - (SvxFrameDirection)nData, RES_FRAMEDIR )); + SvxFrameDirection eDirection = static_cast<SvxFrameDirection>( + reinterpret_cast<sal_IntPtr>(m_pTextFlowLB->GetEntryData( nPos ))); + bRet |= nullptr != rSet->Put( SvxFrameDirectionItem(eDirection, RES_FRAMEDIR )); } } if(m_pWrtSh) |