diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-14 08:39:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-15 08:35:10 +0000 |
commit | 8ccbc16b5e3f94b8db105232d7085a8553e6bc03 (patch) | |
tree | 85b8affc4e3916a21c6b303c90dc0f080d464bbf /sd/source | |
parent | 7fafd1aea08ad036ef48f415db5df93df218bf6e (diff) |
convert SvxFrameDirection to scoped enum
Based on the casts in chart2/source/view/main/ChartView.cxx
and the similarity of naming of values, I conclude that this
enum was intended to abstract over css::text::WritingMode2.
Added a comment to that effect.
Change-Id: I3af8bbe8b6ac8c4a9375f6ccde145b98b9c69a57
Reviewed-on: https://gerrit.libreoffice.org/35164
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/core/drawdoc4.cxx | 12 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-text.cxx | 4 | ||||
-rw-r--r-- | sd/source/filter/html/htmlex.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fupage.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/func/futext.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drtxtob.cxx | 11 | ||||
-rw-r--r-- | sd/source/ui/view/drtxtob1.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews3.cxx | 2 |
8 files changed, 23 insertions, 22 deletions
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 52a0dbe2631d..e7aea5c78439 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -1239,9 +1239,9 @@ css::text::WritingMode SdDrawDocument::GetDefaultWritingMode() const { switch( static_cast<const SvxFrameDirectionItem&>( *pItem ).GetValue() ) { - case FRMDIR_HORI_LEFT_TOP: eRet = css::text::WritingMode_LR_TB; break; - case FRMDIR_HORI_RIGHT_TOP: eRet = css::text::WritingMode_RL_TB; break; - case FRMDIR_VERT_TOP_RIGHT: eRet = css::text::WritingMode_TB_RL; break; + case SvxFrameDirection::Horizontal_LR_TB: eRet = css::text::WritingMode_LR_TB; break; + case SvxFrameDirection::Horizontal_RL_TB: eRet = css::text::WritingMode_RL_TB; break; + case SvxFrameDirection::Vertical_RL_TB: eRet = css::text::WritingMode_TB_RL; break; default: OSL_FAIL( "Frame direction not supported yet" ); @@ -1259,9 +1259,9 @@ void SdDrawDocument::SetDefaultWritingMode(css::text::WritingMode eMode ) SvxFrameDirection nVal; switch( eMode ) { - case css::text::WritingMode_LR_TB: nVal = FRMDIR_HORI_LEFT_TOP; break; - case css::text::WritingMode_RL_TB: nVal = FRMDIR_HORI_RIGHT_TOP; break; - case css::text::WritingMode_TB_RL: nVal = FRMDIR_VERT_TOP_RIGHT; break; + case css::text::WritingMode_LR_TB: nVal = SvxFrameDirection::Horizontal_LR_TB; break; + case css::text::WritingMode_RL_TB: nVal = SvxFrameDirection::Horizontal_RL_TB; break; + case css::text::WritingMode_TB_RL: nVal = SvxFrameDirection::Vertical_RL_TB; break; default: OSL_FAIL( "Frame direction not supported yet" ); return; diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index 58fb320207ef..5ce1714f8d7d 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -1196,8 +1196,8 @@ void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider* pBuProv, bool bG mAny >>= nWritingMode; SvxFrameDirection eWritingMode( (SvxFrameDirection)nWritingMode ); - if ( ( eWritingMode == FRMDIR_HORI_RIGHT_TOP ) - || ( eWritingMode == FRMDIR_VERT_TOP_RIGHT ) ) + if ( ( eWritingMode == SvxFrameDirection::Horizontal_RL_TB ) + || ( eWritingMode == SvxFrameDirection::Vertical_RL_TB ) ) { mnBiDi = 1; } diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 323a3c3e1f35..0356a6c8937e 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -316,7 +316,7 @@ OUString getParagraphStyle( SdrOutliner* pOutliner, sal_Int32 nPara ) OUString sStyle; - if( aParaSet.GetItem<SvxFrameDirectionItem>( EE_PARA_WRITINGDIR )->GetValue() == FRMDIR_HORI_RIGHT_TOP ) + if( aParaSet.GetItem<SvxFrameDirectionItem>( EE_PARA_WRITINGDIR )->GetValue() == SvxFrameDirection::Horizontal_RL_TB ) { sStyle = "direction: rtl;"; diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index cd9c99b36eb8..5a9acafd6f11 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -230,7 +230,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) aNewAttr.Put( aBoxItem ); aNewAttr.Put( SvxFrameDirectionItem( - mpDoc->GetDefaultWritingMode() == css::text::WritingMode_RL_TB ? FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP, + mpDoc->GetDefaultWritingMode() == css::text::WritingMode_RL_TB ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) ); // Retrieve page-data for dialog @@ -476,8 +476,8 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) const SfxPoolItem *pItem; if( SfxItemState::SET == pTempSet->GetItemState( EE_PARA_WRITINGDIR, false, &pItem ) ) { - sal_uInt32 nVal = static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue(); - mpDoc->SetDefaultWritingMode( nVal == FRMDIR_HORI_RIGHT_TOP ? css::text::WritingMode_RL_TB : css::text::WritingMode_LR_TB ); + SvxFrameDirection nVal = static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue(); + mpDoc->SetDefaultWritingMode( nVal == SvxFrameDirection::Horizontal_RL_TB ? css::text::WritingMode_RL_TB : css::text::WritingMode_LR_TB ); } mpDoc->SetChanged(); diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index bdef5e956e79..3b6757000e77 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -835,7 +835,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) const SfxItemSet& rSet = mpView->GetDefaultAttr(); SvxFrameDirection eDirection = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(rSet.Get(EE_PARA_WRITINGDIR)).GetValue(); - if(FRMDIR_HORI_RIGHT_TOP == eDirection || FRMDIR_VERT_TOP_RIGHT == eDirection) + if(SvxFrameDirection::Horizontal_RL_TB == eDirection || SvxFrameDirection::Vertical_RL_TB == eDirection) { aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_BOTTOM)); } @@ -855,7 +855,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) const SfxItemSet& rSet = mpView->GetDefaultAttr(); SvxFrameDirection eDirection = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(rSet.Get(EE_PARA_WRITINGDIR)).GetValue(); - if(FRMDIR_HORI_RIGHT_TOP == eDirection) + if(SvxFrameDirection::Horizontal_RL_TB == eDirection) { aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT)); } diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 17015f8b35ee..c46dc8aa174b 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -514,26 +514,26 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) { switch( static_cast<const SvxFrameDirectionItem&>( aAttrSet.Get( EE_PARA_WRITINGDIR ) ).GetValue() ) { - case FRMDIR_VERT_TOP_LEFT: - case FRMDIR_VERT_TOP_RIGHT: + case SvxFrameDirection::Vertical_LR_TB: + case SvxFrameDirection::Vertical_RL_TB: { rSet.DisableItem( SID_ATTR_PARA_LEFT_TO_RIGHT ); rSet.DisableItem( SID_ATTR_PARA_RIGHT_TO_LEFT ); } break; - case FRMDIR_HORI_LEFT_TOP: + case SvxFrameDirection::Horizontal_LR_TB: rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, true ) ); rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, false ) ); break; - case FRMDIR_HORI_RIGHT_TOP: + case SvxFrameDirection::Horizontal_RL_TB: rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, false ) ); rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, true ) ); break; // The case for the superordinate object is missing. - case FRMDIR_ENVIRONMENT: + case SvxFrameDirection::Environment: { SdDrawDocument& rDoc = mpView->GetDoc(); css::text::WritingMode eMode = rDoc.GetDefaultWritingMode(); @@ -549,6 +549,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, !bIsLeftToRight ) ); } break; + default: break; } } diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 801664d60671..e1b797dcdc53 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -585,13 +585,13 @@ void TextObjectBar::Execute( SfxRequest &rReq ) if( bLeftToRight ) { - aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) ); + aNewAttr.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) ); if( nAdjust == SvxAdjust::Right ) aNewAttr.Put( SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST ) ); } else { - aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) ); + aNewAttr.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR ) ); if( nAdjust == SvxAdjust::Left ) aNewAttr.Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) ); } diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index c417a1ec567d..f3b6e8be4ff3 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -966,7 +966,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) if( aEditAttr.GetItemState( EE_PARA_WRITINGDIR ) >= SfxItemState::DEFAULT ) { const SvxFrameDirectionItem& rItem = static_cast<const SvxFrameDirectionItem&>( aEditAttr.Get( EE_PARA_WRITINGDIR ) ); - rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, rItem.GetValue() == FRMDIR_HORI_RIGHT_TOP)); + rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, rItem.GetValue() == SvxFrameDirection::Horizontal_LR_TB)); } } } |