summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-03-14 08:39:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-15 08:35:10 +0000
commit8ccbc16b5e3f94b8db105232d7085a8553e6bc03 (patch)
tree85b8affc4e3916a21c6b303c90dc0f080d464bbf /editeng
parent7fafd1aea08ad036ef48f415db5df93df218bf6e (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 'editeng')
-rw-r--r--editeng/source/editeng/editeng.cxx6
-rw-r--r--editeng/source/editeng/eerdll.cxx2
-rw-r--r--editeng/source/editeng/impedit2.cxx4
-rw-r--r--editeng/source/editeng/impedit4.cxx2
-rw-r--r--editeng/source/items/frmitems.cxx21
-rw-r--r--editeng/source/rtf/rtfitem.cxx4
6 files changed, 19 insertions, 20 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index d8a1341f3aa6..ff0a5a46d841 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1252,9 +1252,9 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v
{
SfxItemSet aAttribs = pEditView->GetAttribs();
const SvxFrameDirectionItem& rCurrentWritingMode = (const SvxFrameDirectionItem&)aAttribs.Get( EE_PARA_WRITINGDIR );
- SvxFrameDirectionItem aNewItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR );
- if ( rCurrentWritingMode.GetValue() != FRMDIR_HORI_RIGHT_TOP )
- aNewItem.SetValue( FRMDIR_HORI_RIGHT_TOP );
+ SvxFrameDirectionItem aNewItem( SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR );
+ if ( rCurrentWritingMode.GetValue() != SvxFrameDirection::Horizontal_RL_TB )
+ aNewItem.SetValue( SvxFrameDirection::Horizontal_RL_TB );
aAttribs.Put( aNewItem );
pEditView->SetAttribs( aAttribs );
}
diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx
index a73d7eb3d7b0..1cb7387c563f 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -106,7 +106,7 @@ std::vector<SfxPoolItem*>* GlobalEditData::GetDefItems()
// Paragraph attributes:
SvxNumRule aDefaultNumRule( SvxNumRuleFlags::NONE, 0, false );
- rDefItems[0] = new SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR );
+ rDefItems[0] = new SvxFrameDirectionItem( SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR );
rDefItems[1] = new SvXMLAttrContainerItem( EE_PARA_XMLATTRIBS );
rDefItems[2] = new SvxHangingPunctuationItem(false, EE_PARA_HANGINGPUNCTUATION);
rDefItems[3] = new SvxForbiddenRuleItem(true, EE_PARA_FORBIDDENRULES);
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 506477fdb611..d016813ec853 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -1934,7 +1934,7 @@ bool ImpEditEngine::IsRightToLeft( sal_Int32 nPara ) const
{
bR2L = GetDefaultHorizontalTextDirection() == EE_HTEXTDIR_R2L;
pFrameDirItem = &static_cast<const SvxFrameDirectionItem&>(GetParaAttrib( nPara, EE_PARA_WRITINGDIR ));
- if ( pFrameDirItem->GetValue() == FRMDIR_ENVIRONMENT )
+ if ( pFrameDirItem->GetValue() == SvxFrameDirection::Environment )
{
// #103045# if DefaultHorizontalTextDirection is set, use that value, otherwise pool default.
if ( GetDefaultHorizontalTextDirection() != EE_HTEXTDIR_DEFAULT )
@@ -1950,7 +1950,7 @@ bool ImpEditEngine::IsRightToLeft( sal_Int32 nPara ) const
}
if ( pFrameDirItem )
- bR2L = pFrameDirItem->GetValue() == FRMDIR_HORI_RIGHT_TOP;
+ bR2L = pFrameDirItem->GetValue() == SvxFrameDirection::Horizontal_RL_TB;
return bR2L;
}
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 2a5f702b8732..d7cb3c4a654f 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -701,7 +701,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
case EE_PARA_WRITINGDIR:
{
const SvxFrameDirectionItem& rWritingMode = static_cast<const SvxFrameDirectionItem&>(rItem);
- if ( rWritingMode.GetValue() == FRMDIR_HORI_RIGHT_TOP )
+ if ( rWritingMode.GetValue() == SvxFrameDirection::Horizontal_RL_TB )
rOutput.WriteCharPtr( "\\rtlpar" );
else
rOutput.WriteCharPtr( "\\ltrpar" );
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 7e01d0c42418..88d319099f65 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -4072,7 +4072,6 @@ SfxPoolItem* SvxFrameDirectionItem::Create( SvStream & rStrm, sal_uInt16 /*nVer*
return new SvxFrameDirectionItem( static_cast<SvxFrameDirection>(nValue), Which() );
}
-
sal_uInt16 SvxFrameDirectionItem::GetVersion( sal_uInt16 nFVer ) const
{
return SOFFICE_FILEFORMAT_50 > nFVer ? USHRT_MAX : 0;
@@ -4101,19 +4100,19 @@ bool SvxFrameDirectionItem::PutValue( const css::uno::Any& rVal,
switch( nVal )
{
case text::WritingMode2::LR_TB:
- SetValue( FRMDIR_HORI_LEFT_TOP );
+ SetValue( SvxFrameDirection::Horizontal_LR_TB );
break;
case text::WritingMode2::RL_TB:
- SetValue( FRMDIR_HORI_RIGHT_TOP );
+ SetValue( SvxFrameDirection::Horizontal_RL_TB );
break;
case text::WritingMode2::TB_RL:
- SetValue( FRMDIR_VERT_TOP_RIGHT );
+ SetValue( SvxFrameDirection::Vertical_RL_TB );
break;
case text::WritingMode2::TB_LR:
- SetValue( FRMDIR_VERT_TOP_LEFT );
+ SetValue( SvxFrameDirection::Vertical_LR_TB );
break;
case text::WritingMode2::PAGE:
- SetValue( FRMDIR_ENVIRONMENT );
+ SetValue( SvxFrameDirection::Environment );
break;
default:
bRet = false;
@@ -4133,19 +4132,19 @@ bool SvxFrameDirectionItem::QueryValue( css::uno::Any& rVal,
bool bRet = true;
switch( GetValue() )
{
- case FRMDIR_HORI_LEFT_TOP:
+ case SvxFrameDirection::Horizontal_LR_TB:
nVal = text::WritingMode2::LR_TB;
break;
- case FRMDIR_HORI_RIGHT_TOP:
+ case SvxFrameDirection::Horizontal_RL_TB:
nVal = text::WritingMode2::RL_TB;
break;
- case FRMDIR_VERT_TOP_RIGHT:
+ case SvxFrameDirection::Vertical_RL_TB:
nVal = text::WritingMode2::TB_RL;
break;
- case FRMDIR_VERT_TOP_LEFT:
+ case SvxFrameDirection::Vertical_LR_TB:
nVal = text::WritingMode2::TB_LR;
break;
- case FRMDIR_ENVIRONMENT:
+ case SvxFrameDirection::Environment:
nVal = text::WritingMode2::PAGE;
break;
default:
diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx
index bc3298b26943..f0d9f32ced68 100644
--- a/editeng/source/rtf/rtfitem.cxx
+++ b/editeng/source/rtf/rtfitem.cxx
@@ -988,14 +988,14 @@ ATTR_SETOVERLINE:
case RTF_RTLPAR:
if (aPardMap.nDirection)
{
- pSet->Put(SvxFrameDirectionItem(FRMDIR_HORI_RIGHT_TOP,
+ pSet->Put(SvxFrameDirectionItem(SvxFrameDirection::Horizontal_RL_TB,
aPardMap.nDirection));
}
break;
case RTF_LTRPAR:
if (aPardMap.nDirection)
{
- pSet->Put(SvxFrameDirectionItem(FRMDIR_HORI_LEFT_TOP,
+ pSet->Put(SvxFrameDirectionItem(SvxFrameDirection::Horizontal_LR_TB,
aPardMap.nDirection));
}
break;