[Libreoffice-commits] core.git: chart2/source cui/source editeng/source filter/source forms/source include/editeng include/svx sc/source sd/source svx/source sw/inc sw/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Mar 15 08:35:51 UTC 2017


 chart2/source/controller/dialogs/TextDirectionListBox.cxx |    6 +-
 cui/source/tabpages/align.cxx                             |    6 +-
 cui/source/tabpages/page.cxx                              |   16 +++---
 cui/source/tabpages/paragrph.cxx                          |   12 ++---
 editeng/source/editeng/editeng.cxx                        |    6 +-
 editeng/source/editeng/eerdll.cxx                         |    2 
 editeng/source/editeng/impedit2.cxx                       |    4 -
 editeng/source/editeng/impedit4.cxx                       |    2 
 editeng/source/items/frmitems.cxx                         |   21 ++++----
 editeng/source/rtf/rtfitem.cxx                            |    4 -
 filter/source/msfilter/msdffimp.cxx                       |    4 -
 filter/source/msfilter/svdfppt.cxx                        |    6 +-
 forms/source/richtext/rtattributehandler.cxx              |    8 +--
 include/editeng/frmdir.hxx                                |   21 +++++---
 include/editeng/frmdiritem.hxx                            |   15 ++----
 include/svx/pagectrl.hxx                                  |    6 +-
 sc/source/core/data/docpool.cxx                           |    4 -
 sc/source/core/data/documen8.cxx                          |    4 -
 sc/source/core/data/drwlayer.cxx                          |    2 
 sc/source/core/data/stlsheet.cxx                          |    4 -
 sc/source/filter/excel/xestyle.cxx                        |    2 
 sc/source/filter/excel/xlstyle.cxx                        |   14 ++---
 sc/source/filter/oox/stylesbuffer.cxx                     |   10 ++--
 sc/source/ui/app/inputwin.cxx                             |    2 
 sc/source/ui/drawfunc/drtxtob.cxx                         |   10 ++--
 sc/source/ui/drawfunc/drtxtob2.cxx                        |    2 
 sc/source/ui/view/formatsh.cxx                            |    6 +-
 sc/source/ui/view/output2.cxx                             |    4 -
 sc/source/ui/view/printfun.cxx                            |    2 
 sd/source/core/drawdoc4.cxx                               |   12 ++---
 sd/source/filter/eppt/pptx-text.cxx                       |    4 -
 sd/source/filter/html/htmlex.cxx                          |    2 
 sd/source/ui/func/fupage.cxx                              |    6 +-
 sd/source/ui/func/futext.cxx                              |    4 -
 sd/source/ui/view/drtxtob.cxx                             |   11 ++--
 sd/source/ui/view/drtxtob1.cxx                            |    4 -
 sd/source/ui/view/drviews3.cxx                            |    2 
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx   |   10 ++--
 svx/source/dialog/frmdirlbox.cxx                          |    2 
 svx/source/dialog/pagectrl.cxx                            |   13 ++---
 svx/source/table/svdotable.cxx                            |    2 
 sw/inc/crsrsh.hxx                                         |    2 
 sw/inc/doc.hxx                                            |    2 
 sw/inc/node.hxx                                           |    2 
 sw/source/core/bastyp/init.cxx                            |    2 
 sw/source/core/crsr/crsrsh.cxx                            |   12 ++---
 sw/source/core/doc/DocumentStylePoolManager.cxx           |    2 
 sw/source/core/doc/docdesc.cxx                            |    2 
 sw/source/core/doc/docdraw.cxx                            |   17 +++----
 sw/source/core/doc/doclay.cxx                             |   12 ++---
 sw/source/core/doc/poolfmt.cxx                            |    4 -
 sw/source/core/doc/tblafmt.cxx                            |    2 
 sw/source/core/docnode/node.cxx                           |   12 ++---
 sw/source/core/frmedt/fetab.cxx                           |   13 ++---
 sw/source/core/inc/frame.hxx                              |    3 -
 sw/source/core/layout/fly.cxx                             |   10 ++--
 sw/source/core/layout/pagechg.cxx                         |   10 ++--
 sw/source/core/layout/pagedesc.cxx                        |    4 -
 sw/source/core/layout/wsfrm.cxx                           |   14 ++---
 sw/source/core/unocore/unoframe.cxx                       |    2 
 sw/source/core/unocore/unosect.cxx                        |    4 -
 sw/source/core/unocore/unotbl.cxx                         |    4 -
 sw/source/filter/html/css1atr.cxx                         |   13 ++---
 sw/source/filter/html/htmlatr.cxx                         |    2 
 sw/source/filter/html/htmlcss1.cxx                        |   10 ++--
 sw/source/filter/html/htmlflywriter.cxx                   |    4 -
 sw/source/filter/html/htmltabw.cxx                        |    2 
 sw/source/filter/html/svxcss1.cxx                         |    6 +-
 sw/source/filter/html/wrthtml.cxx                         |   33 +++++++-------
 sw/source/filter/html/wrthtml.hxx                         |   14 ++---
 sw/source/filter/ww8/docxattributeoutput.cxx              |   24 +++++-----
 sw/source/filter/ww8/rtfattributeoutput.cxx               |    4 -
 sw/source/filter/ww8/writerwordglue.cxx                   |    2 
 sw/source/filter/ww8/wrtw8esh.cxx                         |   12 ++---
 sw/source/filter/ww8/wrtw8nds.cxx                         |   32 ++++++-------
 sw/source/filter/ww8/wrtw8sty.cxx                         |    2 
 sw/source/filter/ww8/wrtww8.cxx                           |    4 -
 sw/source/filter/ww8/wrtww8.hxx                           |   12 ++---
 sw/source/filter/ww8/ww8atr.cxx                           |   26 +++++------
 sw/source/filter/ww8/ww8graf.cxx                          |    2 
 sw/source/filter/ww8/ww8par2.cxx                          |   20 ++++----
 sw/source/filter/ww8/ww8par6.cxx                          |   28 +++++------
 sw/source/ui/dialog/uiregionsw.cxx                        |    2 
 sw/source/ui/frmdlg/column.cxx                            |    6 +-
 sw/source/ui/frmdlg/frmpage.cxx                           |    6 +-
 sw/source/ui/misc/pggrid.cxx                              |    4 -
 sw/source/uibase/app/docshini.cxx                         |    2 
 sw/source/uibase/frmdlg/colex.cxx                         |    4 -
 sw/source/uibase/shells/annotsh.cxx                       |    8 +--
 sw/source/uibase/shells/drwtxtex.cxx                      |    8 +--
 sw/source/uibase/shells/tabsh.cxx                         |    4 -
 sw/source/uibase/shells/txtattr.cxx                       |   10 ++--
 sw/source/uibase/uiview/formatclipboard.cxx               |    4 -
 sw/source/uibase/uiview/viewtab.cxx                       |    2 
 94 files changed, 367 insertions(+), 357 deletions(-)

New commits:
commit 8ccbc16b5e3f94b8db105232d7085a8553e6bc03
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Mar 14 08:39:55 2017 +0200

    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 at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/chart2/source/controller/dialogs/TextDirectionListBox.cxx b/chart2/source/controller/dialogs/TextDirectionListBox.cxx
index 767d6fb..0de05f9 100644
--- a/chart2/source/controller/dialogs/TextDirectionListBox.cxx
+++ b/chart2/source/controller/dialogs/TextDirectionListBox.cxx
@@ -30,9 +30,9 @@ namespace chart
 TextDirectionListBox::TextDirectionListBox( vcl::Window* pParent ) :
     svx::FrameDirectionListBox( pParent, WB_BORDER | WB_TABSTOP | WB_DROPDOWN)
 {
-    InsertEntryValue( SCH_RESSTR( STR_TEXT_DIRECTION_LTR ), FRMDIR_HORI_LEFT_TOP );
-    InsertEntryValue( SCH_RESSTR( STR_TEXT_DIRECTION_RTL ), FRMDIR_HORI_RIGHT_TOP );
-    InsertEntryValue( SCH_RESSTR( STR_TEXT_DIRECTION_SUPER ), FRMDIR_ENVIRONMENT );
+    InsertEntryValue( SCH_RESSTR( STR_TEXT_DIRECTION_LTR ), SvxFrameDirection::Horizontal_LR_TB );
+    InsertEntryValue( SCH_RESSTR( STR_TEXT_DIRECTION_RTL ), SvxFrameDirection::Horizontal_RL_TB );
+    InsertEntryValue( SCH_RESSTR( STR_TEXT_DIRECTION_SUPER ), SvxFrameDirection::Environment );
 
     if( !SvtLanguageOptions().IsCTLFontEnabled() )
     {
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index cae1c68..49baf4c 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -211,9 +211,9 @@ AlignmentTabPage::AlignmentTabPage( vcl::Window* pParent, const SfxItemSet& rCor
     // Asian vertical mode
     m_pCbAsianMode->Show( SvtCJKOptions().IsVerticalTextEnabled() );
 
-    m_pLbFrameDir->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), FRMDIR_HORI_LEFT_TOP );
-    m_pLbFrameDir->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), FRMDIR_HORI_RIGHT_TOP );
-    m_pLbFrameDir->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), FRMDIR_ENVIRONMENT );
+    m_pLbFrameDir->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), SvxFrameDirection::Horizontal_LR_TB );
+    m_pLbFrameDir->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), SvxFrameDirection::Horizontal_RL_TB );
+    m_pLbFrameDir->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), SvxFrameDirection::Environment );
 
     // This page needs ExchangeSupport.
     SetExchangeSupport();
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 0b0f750..2f109db 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -217,11 +217,11 @@ SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr
 
     //  fill text flow listbox with valid entries
 
-    m_pTextFlowBox->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_LTR_HORI ), FRMDIR_HORI_LEFT_TOP );
+    m_pTextFlowBox->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_LTR_HORI ), SvxFrameDirection::Horizontal_LR_TB );
 
 
     if( bCTL )
-        m_pTextFlowBox->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_RTL_HORI ), FRMDIR_HORI_RIGHT_TOP );
+        m_pTextFlowBox->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_RTL_HORI ), SvxFrameDirection::Horizontal_RL_TB );
 
 
     // #109989# do not show vertical directions in Writer/Web
@@ -229,8 +229,8 @@ SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr
     {
         if( bCJK )
         {
-            m_pTextFlowBox->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_RTL_VERT ), FRMDIR_VERT_TOP_RIGHT );
-            m_pTextFlowBox->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_LTR_VERT ), FRMDIR_VERT_TOP_LEFT );
+            m_pTextFlowBox->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_RTL_VERT ), SvxFrameDirection::Vertical_RL_TB );
+            m_pTextFlowBox->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_PAGEDIR_LTR_VERT ), SvxFrameDirection::Vertical_LR_TB );
         }
     }
 
@@ -626,7 +626,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet )
     {
         SvxFrameDirection nVal  = SfxItemState::SET == eState
                                 ? static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue()
-                                : FRMDIR_HORI_LEFT_TOP;
+                                : SvxFrameDirection::Horizontal_LR_TB;
         m_pTextFlowBox->SelectEntryValue(nVal);
 
         m_pTextFlowBox->SaveValue();
@@ -1592,8 +1592,8 @@ IMPL_LINK( SvxPageDescPage, RegisterModify, Button*, pBox, void )
 
 void SvxPageDescPage::DisableVerticalPageDir()
 {
-    m_pTextFlowBox->RemoveEntryValue( FRMDIR_VERT_TOP_RIGHT );
-    m_pTextFlowBox->RemoveEntryValue( FRMDIR_VERT_TOP_LEFT );
+    m_pTextFlowBox->RemoveEntryValue( SvxFrameDirection::Vertical_RL_TB );
+    m_pTextFlowBox->RemoveEntryValue( SvxFrameDirection::Vertical_LR_TB );
     if( m_pTextFlowBox->GetEntryCount() < 2 )
     {
         m_pTextFlowLbl->Hide();
@@ -1604,7 +1604,7 @@ void SvxPageDescPage::DisableVerticalPageDir()
 
 IMPL_LINK_NOARG( SvxPageDescPage, FrameDirectionModify_Impl, ListBox&, void)
 {
-    m_pBspWin->SetFrameDirection( (sal_uInt32) m_pTextFlowBox->GetSelectEntryValue() );
+    m_pBspWin->SetFrameDirection( m_pTextFlowBox->GetSelectEntryValue() );
     m_pBspWin->Invalidate();
 }
 
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index e92a056..e888485 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -1044,9 +1044,9 @@ SvxParaAlignTabPage::SvxParaAlignTabPage( vcl::Window* pParent, const SfxItemSet
     m_pLastLineLB->SetSelectHdl( LINK( this, SvxParaAlignTabPage, LastLineHdl_Impl ) );
     m_pTextDirectionLB->SetSelectHdl( LINK( this, SvxParaAlignTabPage, TextDirectionHdl_Impl ) );
 
-    m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), FRMDIR_ENVIRONMENT );
-    m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), FRMDIR_HORI_LEFT_TOP );
-    m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), FRMDIR_HORI_RIGHT_TOP );
+    m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), SvxFrameDirection::Environment );
+    m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), SvxFrameDirection::Horizontal_LR_TB );
+    m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), SvxFrameDirection::Horizontal_RL_TB );
 
     setPreviewsToSamePlace(pParent, this);
 }
@@ -1311,9 +1311,9 @@ IMPL_LINK_NOARG(SvxParaAlignTabPage, TextDirectionHdl_Impl, ListBox&, void)
     switch ( eDir )
     {
         // check the default alignment for this text direction
-        case FRMDIR_HORI_LEFT_TOP :     m_pLeft->Check(); break;
-        case FRMDIR_HORI_RIGHT_TOP :    m_pRight->Check(); break;
-        case FRMDIR_ENVIRONMENT :       /* do nothing */ break;
+        case SvxFrameDirection::Horizontal_LR_TB :     m_pLeft->Check(); break;
+        case SvxFrameDirection::Horizontal_RL_TB :    m_pRight->Check(); break;
+        case SvxFrameDirection::Environment :       /* do nothing */ break;
         default:
         {
             SAL_WARN( "cui.tabpages", "SvxParaAlignTabPage::TextDirectionHdl_Impl(): other directions not supported" );
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index d8a1341..ff0a5a4 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 a73d7eb..1cb7387 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 506477f..d016813 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 2a5f702..d7cb3c4 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 7e01d0c..88d3190 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 bc3298b..f0d9f32 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;
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index d170540..e32a7cc 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -1530,7 +1530,7 @@ void DffPropertyReader::ApplyCustomShapeTextAttributes( SfxItemSet& rSet ) const
             break;
         }
     }
-    rSet.Put( SvxFrameDirectionItem( bVerticalText ? FRMDIR_VERT_TOP_RIGHT : FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
+    rSet.Put( SvxFrameDirectionItem( bVerticalText ? SvxFrameDirection::Vertical_RL_TB : SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) );
 
     rSet.Put( SdrTextVertAdjustItem( eTVA ) );
     rSet.Put( SdrTextHorzAdjustItem( eTHA ) );
@@ -4435,7 +4435,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
                                     if ( bIsRTL )
                                     {
                                         SfxItemSet aSet2( rOutliner.GetParaAttribs( i ) );
-                                        aSet2.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
+                                        aSet2.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR ) );
                                         rOutliner.SetParaAttribs( i, aSet2 );
                                         bCreateNewParaObject = true;
                                     }
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 45730ab..143ace6 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -1091,7 +1091,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
                         bAutoGrowHeight = bFitShapeToText;
                     }
                 }
-                pTObj->SetMergedItem( SvxFrameDirectionItem( bVerticalText ? FRMDIR_VERT_TOP_RIGHT : FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
+                pTObj->SetMergedItem( SvxFrameDirectionItem( bVerticalText ? SvxFrameDirection::Vertical_RL_TB : SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) );
 
                 //Autofit text only if there is no auto grow height and width
                 //See fdo#41245
@@ -6246,7 +6246,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet,  boost::optional< sal_Int16 >&
         rSet.Put(SvxHangingPunctuationItem(nVal != 0, EE_PARA_HANGINGPUNCTUATION));
 
     if ( GetAttrib( PPT_ParaAttr_BiDi, nVal, nDestinationInstance ) )
-        rSet.Put( SvxFrameDirectionItem( nVal == 1 ? FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
+        rSet.Put( SvxFrameDirectionItem( nVal == 1 ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) );
 
     // LineSpacing
     PPTPortionObj* pPortion = First();
@@ -7415,7 +7415,7 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell )
         const sal_Int32 eHA(static_cast<const SdrTextHorzAdjustItem&>(pObj->GetMergedItem(SDRATTR_TEXT_HORZADJUST)).GetValue());
         const SvxFrameDirection eDirection = (const SvxFrameDirection)(static_cast<const SvxFrameDirectionItem&>(pObj->GetMergedItem(EE_PARA_WRITINGDIR)).GetValue());
         xPropSet->setPropertyValue(  "TextHorizontalAdjust" , Any( eHA ) );
-        if ( eDirection == FRMDIR_VERT_TOP_RIGHT )
+        if ( eDirection == SvxFrameDirection::Vertical_RL_TB )
         {//vertical writing
             xPropSet->setPropertyValue(  "TextWritingMode" , Any( css::text::WritingMode_TB_RL ) );
         }
diff --git a/forms/source/richtext/rtattributehandler.cxx b/forms/source/richtext/rtattributehandler.cxx
index baedb90..39f2948 100644
--- a/forms/source/richtext/rtattributehandler.cxx
+++ b/forms/source/richtext/rtattributehandler.cxx
@@ -375,14 +375,14 @@ namespace frm
 
     ParagraphDirectionHandler::ParagraphDirectionHandler( AttributeId _nAttributeId )
         :AttributeHandler( _nAttributeId, EE_PARA_WRITINGDIR )
-        ,m_eParagraphDirection( FRMDIR_HORI_LEFT_TOP )
+        ,m_eParagraphDirection( SvxFrameDirection::Horizontal_LR_TB )
         ,m_eDefaultAdjustment( SvxAdjust::Right )
         ,m_eOppositeDefaultAdjustment( SvxAdjust::Left )
     {
         switch ( getAttributeId() )
         {
-            case SID_ATTR_PARA_LEFT_TO_RIGHT: m_eParagraphDirection = FRMDIR_HORI_LEFT_TOP; m_eDefaultAdjustment = SvxAdjust::Left; break;
-            case SID_ATTR_PARA_RIGHT_TO_LEFT: m_eParagraphDirection = FRMDIR_HORI_RIGHT_TOP; m_eDefaultAdjustment = SvxAdjust::Right; break;
+            case SID_ATTR_PARA_LEFT_TO_RIGHT: m_eParagraphDirection = SvxFrameDirection::Horizontal_LR_TB; m_eDefaultAdjustment = SvxAdjust::Left; break;
+            case SID_ATTR_PARA_RIGHT_TO_LEFT: m_eParagraphDirection = SvxFrameDirection::Horizontal_RL_TB; m_eDefaultAdjustment = SvxAdjust::Right; break;
             default:
                 OSL_FAIL( "ParagraphDirectionHandler::ParagraphDirectionHandler: invalid attribute id!" );
         }
@@ -397,7 +397,7 @@ namespace frm
     AttributeCheckState ParagraphDirectionHandler::implGetCheckState( const SfxPoolItem& _rItem ) const
     {
         OSL_ENSURE( dynamic_cast<const SvxFrameDirectionItem*>( &_rItem) !=  nullptr, "ParagraphDirectionHandler::implGetCheckState: invalid pool item!" );
-        SvxFrameDirection eDirection = static_cast< SvxFrameDirection >( static_cast< const SvxFrameDirectionItem& >( _rItem ).GetValue() );
+        SvxFrameDirection eDirection = static_cast< const SvxFrameDirectionItem& >( _rItem ).GetValue();
         return ( eDirection == m_eParagraphDirection ) ? eChecked : eUnchecked;
     }
 
diff --git a/include/editeng/frmdir.hxx b/include/editeng/frmdir.hxx
index 4af2a07..85f60b3 100644
--- a/include/editeng/frmdir.hxx
+++ b/include/editeng/frmdir.hxx
@@ -20,28 +20,35 @@
 #ifndef INCLUDED_EDITENG_FRMDIR_HXX
 #define INCLUDED_EDITENG_FRMDIR_HXX
 
+#include <com/sun/star/text/WritingMode2.hpp>
 
-/** Defines possible text directions in frames. */
-enum SvxFrameDirection
+/**
+ * Defines possible text directions in frames.
+ * A scoped enum over the constants in css::text:WritingMode2.
+ */
+enum class SvxFrameDirection
 {
+    /** used as an error return value in SW */
+    Unknown = -1,
+
     /** Horizontal, from left to right, from top to bottom
         (typical for western languages). */
-    FRMDIR_HORI_LEFT_TOP,
+    Horizontal_LR_TB = css::text::WritingMode2::LR_TB,
 
     /** Horizontal, from right to left, from top to bottom
         (typical for arabic/hebrew languages). */
-    FRMDIR_HORI_RIGHT_TOP,
+    Horizontal_RL_TB = css::text::WritingMode2::RL_TB,
 
     /** Vertical, from top to bottom, from right to left
         (typical for asian languages). */
-    FRMDIR_VERT_TOP_RIGHT,
+    Vertical_RL_TB = css::text::WritingMode2::TB_RL,
 
     /** Vertical, from top to bottom, from left to right
         (typical for mongol language). */
-    FRMDIR_VERT_TOP_LEFT,
+    Vertical_LR_TB = css::text::WritingMode2::TB_LR,
 
     /** Use the value from the environment, can only be used in frames. */
-    FRMDIR_ENVIRONMENT
+    Environment = css::text::WritingMode2::CONTEXT
 };
 
 
diff --git a/include/editeng/frmdiritem.hxx b/include/editeng/frmdiritem.hxx
index 949b151..4e30188 100644
--- a/include/editeng/frmdiritem.hxx
+++ b/include/editeng/frmdiritem.hxx
@@ -23,11 +23,7 @@
 #include <editeng/frmdir.hxx>
 #include <editeng/editengdllapi.h>
 
-// class SvxFrameDirectionItem ----------------------------------------------
-
-/* [Description]
-
-    This item defines a frame direction, which place the content inside
+/*  This item defines a frame direction, which place the content inside
     a frame. It exist different kind of directions which are used to the
     layout text for Western, CJK and CTL languages.
 */
@@ -35,16 +31,15 @@
 class EDITENG_DLLPUBLIC SvxFrameDirectionItem : public SfxEnumItem<SvxFrameDirection>
 {
 public:
-    SvxFrameDirectionItem( SvxFrameDirection nValue /*= FRMDIR_HORI_LEFT_TOP*/,
-                            sal_uInt16 nWhich  );
+    SvxFrameDirectionItem( SvxFrameDirection nValue, sal_uInt16 nWhich  );
     virtual ~SvxFrameDirectionItem() override;
 
     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = nullptr ) const override;
     virtual SfxPoolItem*    Create(SvStream &, sal_uInt16) const override;
-    virtual sal_uInt16          GetVersion( sal_uInt16 nFileVersion ) const override;
+    virtual sal_uInt16      GetVersion( sal_uInt16 nFileVersion ) const override;
     virtual bool            operator==( const SfxPoolItem& ) const override;
 
-    virtual bool GetPresentation( SfxItemPresentation ePres,
+    virtual bool            GetPresentation( SfxItemPresentation ePres,
                                   MapUnit eCoreMetric,
                                   MapUnit ePresMetric,
                                   OUString &rText,
@@ -55,7 +50,7 @@ public:
 
     virtual sal_uInt16      GetValueCount() const override
     {
-        return FRMDIR_ENVIRONMENT + 1;
+        return (sal_uInt16)SvxFrameDirection::Environment + 1;
     }
     SvxFrameDirectionItem& operator=( const SvxFrameDirectionItem& rItem )
     {
diff --git a/include/svx/pagectrl.hxx b/include/svx/pagectrl.hxx
index 25b6bb5..64123cf 100644
--- a/include/svx/pagectrl.hxx
+++ b/include/svx/pagectrl.hxx
@@ -25,6 +25,7 @@
 
 class SvxBoxItem;
 enum class SvxPageUsage;
+enum class SvxFrameDirection;
 
 class SVX_DLLPUBLIC SvxPageWindow : public vcl::Window
 {
@@ -42,7 +43,7 @@ private:
     SvxBoxItem* pBorder;
     bool bResetBackground;
     bool bFrameDirection;
-    sal_Int32 nFrameDirection;
+    SvxFrameDirection nFrameDirection;
 
     long nHdLeft;
     long nHdRight;
@@ -151,8 +152,7 @@ public:
     void SetVert( bool bNew ) { bVert = bNew; }
 
     void EnableFrameDirection(bool bEnable);
-    //uses enum SvxFrameDirection
-    void SetFrameDirection(sal_Int32 nDirection);
+    void SetFrameDirection(SvxFrameDirection nDirection);
 
     void ResetBackground();
 
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index daabc72..df7470f 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -262,10 +262,10 @@ ScDocumentPool::ScDocumentPool()
     rPoolDefaults[ ATTR_ROTATE_VALUE    - ATTR_STARTINDEX ] = new SfxInt32Item( ATTR_ROTATE_VALUE, 0 );
     rPoolDefaults[ ATTR_ROTATE_MODE     - ATTR_STARTINDEX ] = new SvxRotateModeItem( SVX_ROTATE_MODE_BOTTOM, ATTR_ROTATE_MODE );
     rPoolDefaults[ ATTR_VERTICAL_ASIAN  - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_VERTICAL_ASIAN );
-    //  The default for the ATTR_WRITINGDIR cell attribute must by FRMDIR_ENVIRONMENT,
+    //  The default for the ATTR_WRITINGDIR cell attribute must by SvxFrameDirection::Environment,
     //  so that value is returned when asking for a default cell's attributes.
     //  The value from the page style is set as DefaultHorizontalTextDirection for the EditEngine.
-    rPoolDefaults[ ATTR_WRITINGDIR      - ATTR_STARTINDEX ] = new SvxFrameDirectionItem( FRMDIR_ENVIRONMENT, ATTR_WRITINGDIR );
+    rPoolDefaults[ ATTR_WRITINGDIR      - ATTR_STARTINDEX ] = new SvxFrameDirectionItem( SvxFrameDirection::Environment, ATTR_WRITINGDIR );
     rPoolDefaults[ ATTR_LINEBREAK       - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_LINEBREAK );
     rPoolDefaults[ ATTR_SHRINKTOFIT     - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_SHRINKTOFIT );
     rPoolDefaults[ ATTR_BORDER_TLBR     - ATTR_STARTINDEX ] = new SvxLineItem( ATTR_BORDER_TLBR );
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 2472f4a..de5d06c0 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -372,9 +372,9 @@ sal_uInt8 ScDocument::GetEditTextDirection(SCTAB nTab) const
         SvxFrameDirection eDirection = (SvxFrameDirection)
             static_cast<const SvxFrameDirectionItem&>(rStyleSet.Get( ATTR_WRITINGDIR )).GetValue();
 
-        if ( eDirection == FRMDIR_HORI_LEFT_TOP )
+        if ( eDirection == SvxFrameDirection::Horizontal_LR_TB )
             eRet = EE_HTEXTDIR_L2R;
-        else if ( eDirection == FRMDIR_HORI_RIGHT_TOP )
+        else if ( eDirection == SvxFrameDirection::Horizontal_RL_TB )
             eRet = EE_HTEXTDIR_R2L;
         // else (invalid for EditEngine): keep "default"
     }
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 8618c55..c18c869 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -265,7 +265,7 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const OUString& rName ) :
     SetScaleUnit(MapUnit::Map100thMM);
     SfxItemPool& rPool = GetItemPool();
     rPool.SetDefaultMetric(MapUnit::Map100thMM);
-    SvxFrameDirectionItem aModeItem( FRMDIR_ENVIRONMENT, EE_PARA_WRITINGDIR );
+    SvxFrameDirectionItem aModeItem( SvxFrameDirection::Environment, EE_PARA_WRITINGDIR );
     rPool.SetPoolDefaultItem( aModeItem );
 
     // #i33700#
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index a9ee535..ae7aed2 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -201,11 +201,11 @@ SfxItemSet& ScStyleSheet::GetItemSet()
 
 
                         //  Writing direction: not as pool default because the default for cells
-                        //  must remain FRMDIR_ENVIRONMENT, and each page style's setting is
+                        //  must remain SvxFrameDirection::Environment, and each page style's setting is
                         //  supposed to be saved in the file format.
                         //  The page default depends on the system language.
                         SvxFrameDirection eDirection = ScGlobal::IsSystemRTL() ?
-                                        FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP;
+                                        SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB;
                         pSet->Put( SvxFrameDirectionItem( eDirection, ATTR_WRITINGDIR ) );
 
                         rItemPool.SetPoolDefaultItem( aPageItem );
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index f2a8673..d1c50ea 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1488,7 +1488,7 @@ bool XclExpCellAlign::FillFromItemSet(
             bUsed |= ScfTools::CheckItem( rItemSet, ATTR_SHRINKTOFIT, bStyle );
 
             // CTL text direction
-            SetScFrameDir(GETITEM( rItemSet, SvxFrameDirectionItem, ATTR_WRITINGDIR ).GetValue());
+            SetScFrameDir( GETITEM( rItemSet, SvxFrameDirectionItem, ATTR_WRITINGDIR ).GetValue() );
             bUsed |= ScfTools::CheckItem( rItemSet, ATTR_WRITINGDIR, bStyle );
 
             SAL_FALLTHROUGH;
diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx
index ca53689..1df8cba 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -1596,12 +1596,12 @@ SvxCellJustifyMethod XclCellAlign::GetScVerJustifyMethod() const
 
 SvxFrameDirection XclCellAlign::GetScFrameDir() const
 {
-    SvxFrameDirection eFrameDir = FRMDIR_ENVIRONMENT;
+    SvxFrameDirection eFrameDir = SvxFrameDirection::Environment;
     switch( mnTextDir )
     {
-        case EXC_XF_TEXTDIR_CONTEXT:    eFrameDir = FRMDIR_ENVIRONMENT;     break;
-        case EXC_XF_TEXTDIR_LTR:        eFrameDir = FRMDIR_HORI_LEFT_TOP;   break;
-        case EXC_XF_TEXTDIR_RTL:        eFrameDir = FRMDIR_HORI_RIGHT_TOP;  break;
+        case EXC_XF_TEXTDIR_CONTEXT:    eFrameDir = SvxFrameDirection::Environment;     break;
+        case EXC_XF_TEXTDIR_LTR:        eFrameDir = SvxFrameDirection::Horizontal_LR_TB;   break;
+        case EXC_XF_TEXTDIR_RTL:        eFrameDir = SvxFrameDirection::Horizontal_RL_TB;  break;
         default:    OSL_FAIL( "XclCellAlign::GetScFrameDir - unknown CTL text direction" );
     }
     return eFrameDir;
@@ -1639,9 +1639,9 @@ void XclCellAlign::SetScFrameDir( SvxFrameDirection eFrameDir )
 {
     switch( eFrameDir )
     {
-        case FRMDIR_ENVIRONMENT:    mnTextDir = EXC_XF_TEXTDIR_CONTEXT; break;
-        case FRMDIR_HORI_LEFT_TOP:  mnTextDir = EXC_XF_TEXTDIR_LTR;     break;
-        case FRMDIR_HORI_RIGHT_TOP: mnTextDir = EXC_XF_TEXTDIR_RTL;     break;
+        case SvxFrameDirection::Environment:      mnTextDir = EXC_XF_TEXTDIR_CONTEXT; break;
+        case SvxFrameDirection::Horizontal_LR_TB: mnTextDir = EXC_XF_TEXTDIR_LTR;     break;
+        case SvxFrameDirection::Horizontal_RL_TB: mnTextDir = EXC_XF_TEXTDIR_RTL;     break;
         default:                    mnTextDir = EXC_XF_TEXTDIR_CONTEXT;
             OSL_FAIL( "XclCellAlign::SetScFrameDir - unknown CTL text direction" );
     }
diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx
index 4099327..eccdd45 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -1243,19 +1243,19 @@ void Alignment::finalizeImport()
     return nHori;
 }
 
-::SvxFrameDirection Alignment::GetScFrameDir() const
+SvxFrameDirection Alignment::GetScFrameDir() const
 {
-    ::SvxFrameDirection eFrameDir = ::FRMDIR_ENVIRONMENT;
+    SvxFrameDirection eFrameDir = SvxFrameDirection::Environment;
     switch( maApiData.mnWritingMode )
     {
         case css::text::WritingMode2::PAGE:
-            eFrameDir = ::FRMDIR_ENVIRONMENT;
+            eFrameDir = SvxFrameDirection::Environment;
             break;
         case css::text::WritingMode2::LR_TB:
-            eFrameDir = ::FRMDIR_HORI_LEFT_TOP;
+            eFrameDir = SvxFrameDirection::Horizontal_LR_TB;
             break;
         case css::text::WritingMode2::RL_TB:
-            eFrameDir = ::FRMDIR_HORI_RIGHT_TOP;
+            eFrameDir = SvxFrameDirection::Horizontal_RL_TB;
             break;
         default:
             OSL_FAIL( "GetScFrameDir - unknown CTL text direction" );
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index b320ba7..433f5f6 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1138,7 +1138,7 @@ static void lcl_ModifyRTLDefaults( SfxItemSet& rSet )
     rSet.Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) );
 
     // always using rtl writing direction would break formulas
-    //rSet.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
+    //rSet.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR ) );
 
     // PaperSize width is limited to USHRT_MAX in RTL mode (because of EditEngine's
     // sal_uInt16 values in EditLine), so the text may be wrapped and line spacing must be
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 5e08e62..3887ac2 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -1173,16 +1173,16 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
     {
         SvxFrameDirection eAttrDir = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(
                                         aAttrSet.Get( EE_PARA_WRITINGDIR )).GetValue();
-        if ( eAttrDir == FRMDIR_ENVIRONMENT )
+        if ( eAttrDir == SvxFrameDirection::Environment )
         {
             //  get "environment" direction from page style
             if ( pViewData->GetDocument()->GetEditTextDirection( pViewData->GetTabNo() ) == EE_HTEXTDIR_R2L )
-                eAttrDir = FRMDIR_HORI_RIGHT_TOP;
+                eAttrDir = SvxFrameDirection::Horizontal_RL_TB;
             else
-                eAttrDir = FRMDIR_HORI_LEFT_TOP;
+                eAttrDir = SvxFrameDirection::Horizontal_LR_TB;
         }
-        rDestSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, ( eAttrDir == FRMDIR_HORI_LEFT_TOP ) ) );
-        rDestSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, ( eAttrDir == FRMDIR_HORI_RIGHT_TOP ) ) );
+        rDestSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, ( eAttrDir == SvxFrameDirection::Horizontal_LR_TB ) ) );
+        rDestSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, ( eAttrDir == SvxFrameDirection::Horizontal_RL_TB ) ) );
     }
 }
 
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index 9cf130a..d31bc6a 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -168,7 +168,7 @@ void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
                                     0 );
                 bool bLeft = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT );
                 aAttr.Put( SvxFrameDirectionItem(
-                                bLeft ? FRMDIR_HORI_LEFT_TOP : FRMDIR_HORI_RIGHT_TOP,
+                                bLeft ? SvxFrameDirection::Horizontal_LR_TB : SvxFrameDirection::Horizontal_RL_TB,
                                 EE_PARA_WRITINGDIR ) );
                 aAttr.Put( SvxAdjustItem(
                                 bLeft ? SvxAdjust::Left : SvxAdjust::Right,
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 9102ee6..3c2635c 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2634,7 +2634,7 @@ void ScFormatShell::ExecuteTextDirection( SfxRequest& rReq )
         case SID_ATTR_PARA_RIGHT_TO_LEFT:
         {
             SvxFrameDirection eDirection = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ) ?
-                                                FRMDIR_HORI_LEFT_TOP : FRMDIR_HORI_RIGHT_TOP;
+                                                SvxFrameDirection::Horizontal_LR_TB : SvxFrameDirection::Horizontal_RL_TB;
             pTabViewShell->ApplyAttr( SvxFrameDirectionItem( eDirection, ATTR_WRITINGDIR ) );
         }
         break;
@@ -2662,10 +2662,10 @@ void ScFormatShell::GetTextDirectionState( SfxItemSet& rSet )
     {
         SvxFrameDirection eCellDir = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(
                                         rAttrSet.Get( ATTR_WRITINGDIR )).GetValue();
-        if ( eCellDir == FRMDIR_ENVIRONMENT )
+        if ( eCellDir == SvxFrameDirection::Environment )
             eBidiDir = (EEHorizontalTextDirection)GetViewData()->GetDocument()->
                                 GetEditTextDirection( GetViewData()->GetTabNo() );
-        else if ( eCellDir == FRMDIR_HORI_RIGHT_TOP )
+        else if ( eCellDir == SvxFrameDirection::Horizontal_RL_TB )
             eBidiDir = EE_HTEXTDIR_R2L;
         else
             eBidiDir = EE_HTEXTDIR_L2R;
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index b45756b..d193658 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1421,9 +1421,9 @@ static SvxCellHorJustify getAlignmentFromContext( SvxCellHorJustify eInHorJust,
             eInHorJust == SvxCellHorJustify::Block || eInHorJust == SvxCellHorJustify::Repeat)
     {
         SvxFrameDirection nDirection = lcl_GetValue<SvxFrameDirectionItem, SvxFrameDirection>(rPattern, ATTR_WRITINGDIR, pCondSet);
-        if (nDirection == FRMDIR_HORI_LEFT_TOP || nDirection == FRMDIR_VERT_TOP_LEFT)
+        if (nDirection == SvxFrameDirection::Horizontal_LR_TB || nDirection == SvxFrameDirection::Vertical_LR_TB)
             eHorJustContext = SvxCellHorJustify::Left;
-        else if (nDirection == FRMDIR_ENVIRONMENT)
+        else if (nDirection == SvxFrameDirection::Environment)
         {
             SAL_WARN_IF( !pDoc, "sc.ui", "getAlignmentFromContext - pDoc==NULL");
             // fdo#73588: The content of the cell must also
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index a423db3..e3dd216 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1704,7 +1704,7 @@ void ScPrintFunc::MakeEditEngine()
         //! there's no way to set the background for note pages
         pEditDefaults->ClearItem( EE_CHAR_COLOR );
         if (ScGlobal::IsSystemRTL())
-            pEditDefaults->Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
+            pEditDefaults->Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR ) );
     }
 
     pEditEngine->SetData( aFieldData );     // Set page count etc.
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 52a0dbe..e7aea5c 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 58fb320..5ce1714 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 323a3c3..0356a6c 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 cd9c99b..5a9acaf 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 bdef5e9..3b67570 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 17015f8..c46dc8a 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 801664d..e1b797d 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 c417a1e..f3b6e8b 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));
                 }
             }
         }
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index a999791..318844a 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -60,15 +60,15 @@ using namespace com::sun::star::uno;
 
 struct FWCharacterData                  // representing a single character
 {
-    std::vector< tools::PolyPolygon >          vOutlines;
+    std::vector< tools::PolyPolygon >   vOutlines;
     Rectangle                           aBoundRect;
 };
 struct FWParagraphData                  // representing a single paragraph
 {
-    OUString                       aString;
+    OUString                            aString;
     std::vector< FWCharacterData >      vCharacters;
     Rectangle                           aBoundRect;
-    sal_Int16                           nFrameDirection;
+    SvxFrameDirection                   nFrameDirection;
 };
 struct FWTextArea                       // representing multiple concluding paragraphs
 {
@@ -81,7 +81,7 @@ struct FWData                           // representing the whole text
     double                              fHorizontalTextScaling;
     sal_uInt32                          nMaxParagraphsPerTextArea;
     sal_Int32                           nSingleLineHeight;
-    bool                            bSingleLineMode;
+    bool                                bSingleLineMode;
 };
 
 
@@ -264,7 +264,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F
             pVirDev->SetMapMode( MapUnit::Map100thMM );
             pVirDev->SetFont( aFont );
             pVirDev->EnableRTL();
-            if ( aParagraphIter->nFrameDirection == FRMDIR_HORI_RIGHT_TOP )
+            if ( aParagraphIter->nFrameDirection == SvxFrameDirection::Horizontal_RL_TB )
                 pVirDev->SetLayoutMode( ComplexTextLayoutFlags::BiDiRtl );
 
             const SvxCharScaleWidthItem& rCharScaleWidthItem = static_cast<const SvxCharScaleWidthItem&>(pCustomShape->GetMergedItem( EE_CHAR_FONTWIDTH ));
diff --git a/svx/source/dialog/frmdirlbox.cxx b/svx/source/dialog/frmdirlbox.cxx
index 5d259f4..83ecb4b 100644
--- a/svx/source/dialog/frmdirlbox.cxx
+++ b/svx/source/dialog/frmdirlbox.cxx
@@ -38,7 +38,7 @@ inline SvxFrameDirection lclVoidToEnum( void* pDirection )
 
 FrameDirectionListBox::FrameDirectionListBox( vcl::Window* pParent, WinBits nBits )
     : ListBox(pParent, nBits)
-    , meSaveValue(FRMDIR_HORI_LEFT_TOP)
+    , meSaveValue(SvxFrameDirection::Horizontal_LR_TB)
 {
 }
 
diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx
index 38a1169..f59900a 100644
--- a/svx/source/dialog/pagectrl.cxx
+++ b/svx/source/dialog/pagectrl.cxx
@@ -48,7 +48,7 @@ SvxPageWindow::SvxPageWindow(vcl::Window* pParent)
     pBorder(nullptr),
     bResetBackground(false),
     bFrameDirection(false),
-    nFrameDirection(0),
+    nFrameDirection(SvxFrameDirection::Horizontal_LR_TB),
 
     nHdLeft(0),
     nHdRight(0),
@@ -262,29 +262,30 @@ void SvxPageWindow::DrawPage(vcl::RenderContext& rRenderContext, const Point& rO
         long nAWidth = rRenderContext.GetTextWidth(sText.copy(0,1));
         switch (nFrameDirection)
         {
-        case FRMDIR_HORI_LEFT_TOP:
+        case SvxFrameDirection::Horizontal_LR_TB:
             aPos = aRect.TopLeft();
             aPos.X() += PixelToLogic(Point(1,1)).X();
             aMove.Y() = 0;
             cArrow = 0x2192;
             break;
-        case FRMDIR_HORI_RIGHT_TOP:
+        case SvxFrameDirection::Horizontal_RL_TB:
             aPos = aRect.TopRight();
             aPos.X() -= nAWidth;
             aMove.Y() = 0;
             aMove.X() *= -1;
             cArrow = 0x2190;
             break;
-        case FRMDIR_VERT_TOP_LEFT:
+        case SvxFrameDirection::Vertical_LR_TB:
             aPos = aRect.TopLeft();
             aPos.X() += rRenderContext.PixelToLogic(Point(1,1)).X();
             aMove.X() = 0;
             break;
-        case FRMDIR_VERT_TOP_RIGHT:
+        case SvxFrameDirection::Vertical_RL_TB:
             aPos = aRect.TopRight();
             aPos.X() -= nAWidth;
             aMove.X() = 0;
             break;
+        default: break;
         }
         sText += OUStringLiteral1(cArrow);
         for (sal_Int32 i = 0; i < sText.getLength(); i++)
@@ -427,7 +428,7 @@ void SvxPageWindow::EnableFrameDirection(bool bEnable)
     bFrameDirection = bEnable;
 }
 
-void SvxPageWindow::SetFrameDirection(sal_Int32 nDirection)
+void SvxPageWindow::SetFrameDirection(SvxFrameDirection nDirection)
 {
     nFrameDirection = nDirection;
 }
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index 0436d57..3ccbc3e 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -1969,7 +1969,7 @@ WritingMode SdrTableObj::GetWritingMode() const
     if ( ( eWritingMode != WritingMode_TB_RL ) &&
          ( rSet.GetItemState( EE_PARA_WRITINGDIR, false, &pItem ) == SfxItemState::SET ) )
     {
-        if ( static_cast< const SvxFrameDirectionItem * >( pItem )->GetValue() == FRMDIR_HORI_LEFT_TOP )
+        if ( static_cast< const SvxFrameDirectionItem * >( pItem )->GetValue() == SvxFrameDirection::Horizontal_LR_TB )
             eWritingMode = WritingMode_LR_TB;
         else
             eWritingMode = WritingMode_RL_TB;
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index 064990b..37a14b7 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -261,7 +261,7 @@ private:
     SAL_DLLPRIVATE bool LRMargin( bool, bool bAPI = false );
     SAL_DLLPRIVATE bool IsAtLRMargin( bool, bool bAPI = false ) const;
 
-    SAL_DLLPRIVATE short GetTextDirection( const Point* pPt = nullptr ) const;
+    SAL_DLLPRIVATE SvxFrameDirection GetTextDirection( const Point* pPt = nullptr ) const;
 
     SAL_DLLPRIVATE bool isInHiddenTextFrame(SwShellCursor* pShellCursor);
 
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 1a65458..bc20780 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -687,7 +687,7 @@ public:
     void ChangeAuthorityData(const SwAuthEntry* pNewData);
 
     bool IsInHeaderFooter( const SwNodeIndex& rIdx ) const;
-    short GetTextDirection( const SwPosition& rPos,
+    SvxFrameDirection GetTextDirection( const SwPosition& rPos,
                             const Point* pPt = nullptr ) const;
     bool IsInVerticalText( const SwPosition& rPos ) const;
 
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index a9a5222..83fbbd2 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -468,7 +468,7 @@ public:
 
     /** determines the text direction for a certain
        position. @return -1, if text direction could *not* be determined. */
-    short GetTextDirection( const SwPosition& rPos,
+    SvxFrameDirection GetTextDirection( const SwPosition& rPos,
                             const Point* pPt ) const;
 
     void SetModifyAtAttr( bool bSetModifyAtAttr ) const { mbSetModifyAtAttr = bSetModifyAtAttr; }
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 7b85287..862e46a 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -600,7 +600,7 @@ void InitCore()
     aAttrTab[ RES_FTN_AT_TXTEND - POOLATTR_BEGIN ] =        new SwFormatFootnoteAtTextEnd;
     aAttrTab[ RES_END_AT_TXTEND - POOLATTR_BEGIN ] =        new SwFormatEndAtTextEnd;
     aAttrTab[ RES_COLUMNBALANCE - POOLATTR_BEGIN ] =        new SwFormatNoBalancedColumns;
-    aAttrTab[ RES_FRAMEDIR - POOLATTR_BEGIN ] =             new SvxFrameDirectionItem( FRMDIR_ENVIRONMENT, RES_FRAMEDIR );
+    aAttrTab[ RES_FRAMEDIR - POOLATTR_BEGIN ] =             new SvxFrameDirectionItem( SvxFrameDirection::Environment, RES_FRAMEDIR );
     aAttrTab[ RES_ROW_SPLIT - POOLATTR_BEGIN ] =            new SwFormatRowSplit;
 
     // #i18732#
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index fb14f5a7..dc6898b 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -3109,7 +3109,7 @@ bool SwCursorShell::IsSelFullPara() const
     return bRet;
 }
 
-short SwCursorShell::GetTextDirection( const Point* pPt ) const
+SvxFrameDirection SwCursorShell::GetTextDirection( const Point* pPt ) const
 {
     SwPosition aPos( *m_pCurrentCursor->GetPoint() );
     Point aPt( pPt ? *pPt : m_pCurrentCursor->GetPtPos() );
@@ -3126,16 +3126,16 @@ short SwCursorShell::GetTextDirection( const Point* pPt ) const
 
 bool SwCursorShell::IsInVerticalText( const Point* pPt ) const
 {
-    const short nDir = GetTextDirection( pPt );
-    return FRMDIR_VERT_TOP_RIGHT == nDir || FRMDIR_VERT_TOP_LEFT == nDir;
+    const SvxFrameDirection nDir = GetTextDirection( pPt );
+    return SvxFrameDirection::Vertical_RL_TB == nDir || SvxFrameDirection::Vertical_LR_TB == nDir;
 }
 
 bool SwCursorShell::IsInRightToLeftText() const
 {
-    const short nDir = GetTextDirection();
-    // GetTextDirection uses FRMDIR_VERT_TOP_LEFT to indicate RTL in
+    const SvxFrameDirection nDir = GetTextDirection();
+    // GetTextDirection uses SvxFrameDirection::Vertical_LR_TB to indicate RTL in
     // vertical environment
-    return FRMDIR_VERT_TOP_LEFT == nDir || FRMDIR_HORI_RIGHT_TOP == nDir;
+    return SvxFrameDirection::Vertical_LR_TB == nDir || SvxFrameDirection::Horizontal_RL_TB == nDir;
 }
 
 /// If the current cursor position is inside a hidden range, the hidden range
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 11f83a2..d495d85 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -356,7 +356,7 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
             {
                 sal_uLong nAppLanguage = GetAppLanguage();
                 if (GetDefaultFrameDirection(nAppLanguage) ==
-                    FRMDIR_HORI_RIGHT_TOP)
+                    SvxFrameDirection::Horizontal_RL_TB)
                 {
                     SvxAdjustItem aAdjust(SvxAdjust::Right, RES_PARATR_ADJUST );
                     aSet.Put(aAdjust);
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 6c108ed..bbc3897 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -660,7 +660,7 @@ SwPageDesc* SwDoc::MakePageDesc(const OUString &rName, const SwPageDesc *pCpy,
 
         SvxFrameDirection aFrameDirection = bRegardLanguage ?
             GetDefaultFrameDirection(GetAppLanguage())
-            : FRMDIR_HORI_LEFT_TOP;
+            : SvxFrameDirection::Horizontal_LR_TB;
 
         pNew->GetMaster().SetFormatAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) );
         pNew->GetLeft().SetFormatAttr( SvxFrameDirectionItem(aFrameDirection, RES_FRAMEDIR) );
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 97ae882..df94f1b 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -113,7 +113,7 @@ static void lcl_AdjustPositioningAttr( SwDrawFrameFormat* _pFrameFormat,
                 static_cast<const SvxFrameDirectionItem&>(_pFrameFormat->GetAttrSet().GetPool()->GetDefaultItem( RES_FRAMEDIR ));
             switch ( rDirItem.GetValue() )
             {
-                case FRMDIR_VERT_TOP_LEFT:
+                case SvxFrameDirection::Vertical_LR_TB:
                 {
                     // vertical from left-to-right
                     bVert = true;
@@ -121,30 +121,31 @@ static void lcl_AdjustPositioningAttr( SwDrawFrameFormat* _pFrameFormat,
                     OSL_FAIL( "<lcl_AdjustPositioningAttr(..)> - vertical from left-to-right not supported." );
                 }
                 break;
-                case FRMDIR_VERT_TOP_RIGHT:
+                case SvxFrameDirection::Vertical_RL_TB:
                 {
                     // vertical from right-to-left
                     bVert = true;
                     bR2L = false;
                 }
                 break;
-                case FRMDIR_HORI_RIGHT_TOP:
+                case SvxFrameDirection::Horizontal_RL_TB:
                 {
                     // horizontal from right-to-left
                     bVert = false;
                     bR2L = true;
                 }
                 break;
-                case FRMDIR_HORI_LEFT_TOP:
+                case SvxFrameDirection::Horizontal_LR_TB:
                 {
                     // horizontal from left-to-right
                     bVert = false;
                     bR2L = false;
                 }
                 break;
-                case FRMDIR_ENVIRONMENT:
-                    SAL_WARN("sw.core", "lcl_AdjustPositioningAttr(..) FRMDIR_ENVIRONMENT not supported");
+                case SvxFrameDirection::Environment:
+                    SAL_WARN("sw.core", "lcl_AdjustPositioningAttr(..) SvxFrameDirection::Environment not supported");
                     break;
+                default: break;
             }
 
         }
@@ -154,11 +155,11 @@ static void lcl_AdjustPositioningAttr( SwDrawFrameFormat* _pFrameFormat,
         if ( bVert )
         {
             if ( bR2L ) {
-                  //FRMDIR_VERT_TOP_LEFT
+                  //SvxFrameDirection::Vertical_LR_TB
                   nHoriRelPos = aObjRect.Left() - aAnchorPos.getX();
                   nVertRelPos = aObjRect.Top() - aAnchorPos.getY();
             } else {
-                //FRMDIR_VERT_TOP_RIGHT
+                //SvxFrameDirection::Vertical_RL_TB
                 nHoriRelPos = aObjRect.Top() - aAnchorPos.getY();
                 nVertRelPos = aAnchorPos.getX() - aObjRect.Right();
             }
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 260adba..0aecf91 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1576,10 +1576,10 @@ bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const
             nullptr != pNd->FindFooterStartNode();
 }
 
-short SwDoc::GetTextDirection( const SwPosition& rPos,
+SvxFrameDirection SwDoc::GetTextDirection( const SwPosition& rPos,
                                const Point* pPt ) const
 {
-    short nRet = -1;
+    SvxFrameDirection nRet = SvxFrameDirection::Unknown;
 
     SwContentNode *pNd = rPos.nNode.GetNode().GetContentNode();
 
@@ -1588,7 +1588,7 @@ short SwDoc::GetTextDirection( const SwPosition& rPos,
     {
         nRet = pNd->GetTextDirection( rPos, pPt );
     }
-    if ( nRet == -1 )
+    if ( nRet == SvxFrameDirection::Unknown )
     {
         const SvxFrameDirectionItem* pItem = nullptr;
         if( pNd )
@@ -1598,7 +1598,7 @@ short SwDoc::GetTextDirection( const SwPosition& rPos,
             while( pFlyFormat )
             {
                 pItem = &pFlyFormat->GetFrameDir();
-                if( FRMDIR_ENVIRONMENT == pItem->GetValue() )
+                if( SvxFrameDirection::Environment == pItem->GetValue() )
                 {
                     pItem = nullptr;
                     const SwFormatAnchor* pAnchor = &pFlyFormat->GetAnchor();
@@ -1632,8 +1632,8 @@ short SwDoc::GetTextDirection( const SwPosition& rPos,
 
 bool SwDoc::IsInVerticalText( const SwPosition& rPos ) const
 {
-    const short nDir = GetTextDirection( rPos );
-    return FRMDIR_VERT_TOP_RIGHT == nDir || FRMDIR_VERT_TOP_LEFT == nDir;
+    const SvxFrameDirection nDir = GetTextDirection( rPos );
+    return SvxFrameDirection::Vertical_RL_TB == nDir || SvxFrameDirection::Vertical_LR_TB == nDir;
 }
 
 std::set<SwRootFrame*> SwDoc::GetAllLayouts()
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index ee3a579..e302ee6 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -120,7 +120,7 @@ void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem )
 SvxFrameDirection GetDefaultFrameDirection(sal_uLong nLanguage)
 {
     SvxFrameDirection eResult = (MsLangId::isRightToLeft( static_cast<LanguageType>(nLanguage)) ?
-            FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP);
+            SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB);
     return eResult;
 }
 
@@ -319,7 +319,7 @@ void SwDoc::RemoveAllFormatLanguageDependencies()
     /* koreans do not like SvxScriptItem(TRUE) */
     pTextFormatColl->ResetFormatAttr( RES_PARATR_SCRIPTSPACE );
 
-    SvxFrameDirectionItem aFrameDir( FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR );
+    SvxFrameDirectionItem aFrameDir( SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR );
 
     size_t nCount = GetPageDescCnt();
     for( size_t i=0; i<nCount; ++i )
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index c8be04e..57cacf0 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -289,7 +289,7 @@ SwBoxAutoFormat::SwBoxAutoFormat()
     m_aBLTR( 0 ),
     m_aBackground( RES_BACKGROUND ),
     m_aAdjust( SvxAdjust::Left, RES_PARATR_ADJUST ),
-    m_aTextOrientation(FRMDIR_ENVIRONMENT, RES_FRAMEDIR),
+    m_aTextOrientation(SvxFrameDirection::Environment, RES_FRAMEDIR),
     m_aVerticalAlignment(0, css::text::VertOrientation::NONE, css::text::RelOrientation::FRAME),
     m_aHorJustify( SvxCellHorJustify::Standard, 0),
     m_aVerJustify( SVX_VER_JUSTIFY_STANDARD, 0),
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 611a8d2..f985634 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1935,10 +1935,10 @@ void SwContentNode::ChkCondColl()
 }
 
 // #i42921#
-short SwContentNode::GetTextDirection( const SwPosition& rPos,
+SvxFrameDirection SwContentNode::GetTextDirection( const SwPosition& rPos,
                                      const Point* pPt ) const
 {
-    short nRet = -1;
+    SvxFrameDirection nRet = SvxFrameDirection::Unknown;
 
     Point aPt;
     if( pPt )
@@ -1952,16 +1952,16 @@ short SwContentNode::GetTextDirection( const SwPosition& rPos,
         if ( pFrame->IsVertical() )
         {
             if ( pFrame->IsRightToLeft() )
-                nRet = FRMDIR_VERT_TOP_LEFT;
+                nRet = SvxFrameDirection::Vertical_LR_TB;
             else
-                nRet = FRMDIR_VERT_TOP_RIGHT;
+                nRet = SvxFrameDirection::Vertical_RL_TB;
         }
         else
         {
             if ( pFrame->IsRightToLeft() )
-                nRet = FRMDIR_HORI_RIGHT_TOP;
+                nRet = SvxFrameDirection::Horizontal_RL_TB;
             else
-                nRet = FRMDIR_HORI_LEFT_TOP;
+                nRet = SvxFrameDirection::Horizontal_LR_TB;
         }
     }
 
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index 094a8fe..8380afb 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -2018,23 +2018,24 @@ bool SwFEShell::IsVerticalModeAtNdAndPos( const SwTextNode& _rTextNode,
 {
     bool bRet( false );
 
-    const short nTextDir =
+    const SvxFrameDirection nTextDir =
         _rTextNode.GetTextDirection( SwPosition(_rTextNode), &_rDocPos );
     switch ( nTextDir )
     {
-        case -1:
-        case FRMDIR_HORI_RIGHT_TOP:
-        case FRMDIR_HORI_LEFT_TOP:
+        case SvxFrameDirection::Unknown:
+        case SvxFrameDirection::Horizontal_RL_TB:
+        case SvxFrameDirection::Horizontal_LR_TB:
         {
             bRet = false;
         }
         break;
-        case FRMDIR_VERT_TOP_LEFT:
-        case FRMDIR_VERT_TOP_RIGHT:
+        case SvxFrameDirection::Vertical_LR_TB:
+        case SvxFrameDirection::Vertical_RL_TB:
         {
             bRet = true;
         }
         break;
+        default: break;
     }
 
     return bRet;
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index e9f121b..25d733d 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -57,6 +57,7 @@ class SwPrintData;
 class SwSortedObjs;
 class SwAnchoredObject;
 typedef struct _xmlTextWriter *xmlTextWriterPtr;
+enum class SvxFrameDirection;
 
 // Each FrameType is represented here as a bit.
 // The bits must be set in a way that it can be determined with masking of
@@ -295,7 +296,7 @@ protected:
 
     SwFrame( SwModify*, SwFrame* );
 
-    void CheckDir( sal_uInt16 nDir, bool bVert, bool bOnlyBiDi, bool bBrowse );
+    void CheckDir( SvxFrameDirection nDir, bool bVert, bool bOnlyBiDi, bool bBrowse );
 
     /** enumeration for the different invalidations
         #i28701#
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 97e17fc..4f235b2 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -86,9 +86,9 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch
 
     // Size setting: Fixed size is always the width
     const SwFormatFrameSize &rFrameSize = pFormat->GetFrameSize();
-    const sal_uInt16 nDir =
+    const SvxFrameDirection nDir =
         static_cast<const SvxFrameDirectionItem&>(pFormat->GetFormatAttr( RES_FRAMEDIR )).GetValue();
-    if( FRMDIR_ENVIRONMENT == nDir )
+    if( SvxFrameDirection::Environment == nDir )
     {
         mbDerivedVert = true;
         mbDerivedR2L = true;
@@ -98,7 +98,7 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch
         mbInvalidVert = false;
         mbDerivedVert = false;
         mbDerivedR2L = false;
-        if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir )
+        if( SvxFrameDirection::Horizontal_LR_TB == nDir || SvxFrameDirection::Horizontal_RL_TB == nDir )
         {
             mbVertLR = false;
             mbVertical = false;
@@ -115,7 +115,7 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch
             {
                 mbVertical = true;
 
-                if ( FRMDIR_VERT_TOP_LEFT == nDir )
+                if ( SvxFrameDirection::Vertical_LR_TB == nDir )
                     mbVertLR = true;
                 else
                     mbVertLR = false;
@@ -123,7 +123,7 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch
         }
 
         mbInvalidR2L = false;
-        if( FRMDIR_HORI_RIGHT_TOP == nDir )
+        if( SvxFrameDirection::Horizontal_RL_TB == nDir )
             mbRightToLeft = true;
         else
             mbRightToLeft = false;
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 1704283..44ca0dd 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -299,11 +299,11 @@ void SwPageFrame::CheckGrid( bool bInvalidate )
 
 void SwPageFrame::CheckDirection( bool bVert )
 {
-    sal_uInt16 nDir =
+    SvxFrameDirection nDir =
             static_cast<const SvxFrameDirectionItem&>(GetFormat()->GetFormatAttr( RES_FRAMEDIR )).GetValue();
     if( bVert )
     {
-        if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir )
+        if( SvxFrameDirection::Horizontal_LR_TB == nDir || SvxFrameDirection::Horizontal_RL_TB == nDir )
         {
             mbVertLR = false;
             mbVertical = false;
@@ -320,9 +320,9 @@ void SwPageFrame::CheckDirection( bool bVert )
             {
                 mbVertical = true;
 
-                if(FRMDIR_VERT_TOP_RIGHT == nDir)
+                if(SvxFrameDirection::Vertical_RL_TB == nDir)
                     mbVertLR = false;
-                    else if(FRMDIR_VERT_TOP_LEFT==nDir)
+                    else if(SvxFrameDirection::Vertical_LR_TB==nDir)
                        mbVertLR = true;
             }
         }
@@ -332,7 +332,7 @@ void SwPageFrame::CheckDirection( bool bVert )
     }
     else
     {
-        if( FRMDIR_HORI_RIGHT_TOP == nDir )
+        if( SvxFrameDirection::Horizontal_RL_TB == nDir )
             mbRightToLeft = true;
         else
             mbRightToLeft = false;
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index 14a0914..0644928 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -149,7 +149,7 @@ void SwPageDesc::ResetAllAttr()
 
     // #i73790# - method renamed
     rFormat.ResetAllFormatAttr();
-    rFormat.SetFormatAttr( SvxFrameDirectionItem(FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR) );
+    rFormat.SetFormatAttr( SvxFrameDirectionItem(SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR) );
 }
 
 // gets information from Modify
@@ -382,7 +382,7 @@ SwPageFootnoteInfo::SwPageFootnoteInfo()
     , m_nTopDist( 57 )         //1mm
     , m_nBottomDist( 57 )
 {
-    m_eAdjust = FRMDIR_HORI_RIGHT_TOP == GetDefaultFrameDirection(GetAppLanguage()) ?
+    m_eAdjust = SvxFrameDirection::Horizontal_RL_TB == GetDefaultFrameDirection(GetAppLanguage()) ?
            css::text::HorizontalAdjust_RIGHT :
            css::text::HorizontalAdjust_LEFT;
 }
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index 6f71f42..79ba414 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -96,19 +96,19 @@ void SwFrame::RegisterToFormat( SwFormat& rFormat )
     rFormat.Add( this );
 }
 
-void SwFrame::CheckDir( sal_uInt16 nDir, bool bVert, bool bOnlyBiDi, bool bBrowse )
+void SwFrame::CheckDir( SvxFrameDirection nDir, bool bVert, bool bOnlyBiDi, bool bBrowse )
 {
-    if( FRMDIR_ENVIRONMENT == nDir || ( bVert && bOnlyBiDi ) )
+    if( SvxFrameDirection::Environment == nDir || ( bVert && bOnlyBiDi ) )
     {
         mbDerivedVert = true;
-        if( FRMDIR_ENVIRONMENT == nDir )
+        if( SvxFrameDirection::Environment == nDir )
             mbDerivedR2L = true;
         SetDirFlags( bVert );
     }
     else if( bVert )
     {
         mbInvalidVert = false;
-        if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir
+        if( SvxFrameDirection::Horizontal_LR_TB == nDir || SvxFrameDirection::Horizontal_RL_TB == nDir
             || bBrowse )
         {
             mbVertical = false;
@@ -117,16 +117,16 @@ void SwFrame::CheckDir( sal_uInt16 nDir, bool bVert, bool bOnlyBiDi, bool bBrows
         else
            {
             mbVertical = true;
-            if(FRMDIR_VERT_TOP_RIGHT == nDir)
+            if(SvxFrameDirection::Vertical_RL_TB == nDir)
                 mbVertLR = false;
-               else if(FRMDIR_VERT_TOP_LEFT==nDir)
+               else if(SvxFrameDirection::Vertical_LR_TB==nDir)
                        mbVertLR = true;
         }
     }
     else
     {
         mbInvalidR2L = false;
-        if( FRMDIR_HORI_RIGHT_TOP == nDir )
+        if( SvxFrameDirection::Horizontal_RL_TB == nDir )
             mbRightToLeft = true;
         else
             mbRightToLeft = false;
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 5c7a4af..128bc48 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -905,7 +905,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
     GetProperty(RES_FRAMEDIR, 0, pFrameDirection);
     if(pFrameDirection)
     {
-        SvxFrameDirectionItem aAttr(FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR);
+        SvxFrameDirectionItem aAttr(SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR);
         aAttr.PutValue(*pFrameDirection, 0);
         rToSet.Put(aAttr);
     }
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 55e636f..a8ea565 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -876,7 +876,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
                         {
                             m_pProps->m_pFrameDirItem.reset(
                                 new SvxFrameDirectionItem(
-                                FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR));
+                                SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR));
                         }
                         pPutItem = m_pProps->m_pFrameDirItem.get();
                     }
@@ -1216,7 +1216,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
                         {
                             m_pProps->m_pFrameDirItem.reset(
                                 new SvxFrameDirectionItem(
-                                    FRMDIR_ENVIRONMENT, RES_FRAMEDIR));
+                                    SvxFrameDirection::Environment, RES_FRAMEDIR));
                         }
                         pQueryItem = m_pProps->m_pFrameDirItem.get();
                     }
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 27d3af7..86f8e09 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1017,10 +1017,10 @@ void SwXCell::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV
     // Hack to support hidden property to transfer textDirection
     if(rPropertyName == "FRMDirection")
     {
-        SvxFrameDirection eDir = FRMDIR_ENVIRONMENT;
+        SvxFrameDirection eDir = SvxFrameDirection::Environment;
         try
         {
-            const std::array<SvxFrameDirection, 3> vDirs = { FRMDIR_HORI_LEFT_TOP,  FRMDIR_HORI_RIGHT_TOP, FRMDIR_VERT_TOP_RIGHT };
+            const std::array<SvxFrameDirection, 3> vDirs = { SvxFrameDirection::Horizontal_LR_TB,  SvxFrameDirection::Horizontal_RL_TB, SvxFrameDirection::Vertical_RL_TB };
             eDir = vDirs.at(aValue.get<sal_Int32>());
         } catch(std::out_of_range) {
             SAL_WARN("sw.uno", "unknown direction code, maybe it's a bitfield");
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 09ec574..7ffb743 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -3455,22 +3455,23 @@ static Writer& OutCSS1_SvxFrameDirection( Writer& rWrt, const SfxPoolItem& rHt )
     if( !rHTMLWrt.IsCSS1Source( CSS1_OUTMODE_TEMPLATE ) )
         return rWrt;
 
-    sal_uInt16 nDir =
+    SvxFrameDirection nDir =
         static_cast< const SvxFrameDirectionItem& >( rHt ).GetValue();
     const sal_Char* pStr = nullptr;
     switch( nDir )
     {
-    case FRMDIR_HORI_LEFT_TOP:
-    case FRMDIR_VERT_TOP_LEFT:
+    case SvxFrameDirection::Horizontal_LR_TB:
+    case SvxFrameDirection::Vertical_LR_TB:
         pStr = sCSS1_PV_ltr;
         break;
-    case FRMDIR_HORI_RIGHT_TOP:
-    case FRMDIR_VERT_TOP_RIGHT:
+    case SvxFrameDirection::Horizontal_RL_TB:
+    case SvxFrameDirection::Vertical_RL_TB:
         pStr = sCSS1_PV_rtl;
         break;
-    case FRMDIR_ENVIRONMENT:
+    case SvxFrameDirection::Environment:
         pStr = sCSS1_PV_inherit;
         break;
+    default: break;
     }
 
     if( pStr )
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index a6801dc..a8e3ac1 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -822,7 +822,7 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat,
     }
 
     // and the text direction
-    sal_uInt16 nDir = rHWrt.GetHTMLDirection(
+    SvxFrameDirection nDir = rHWrt.GetHTMLDirection(
             (pNodeItemSet ? static_cast < const SvxFrameDirectionItem& >(
                                     pNodeItemSet->Get( RES_FRAMEDIR ) )
                           : rFormat.GetFrameDir() ).GetValue() );
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index e316726..fca9779 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -385,7 +385,7 @@ void SwCSS1Parser::SetPageDescAttrs( const SvxBrushItem *pBrush,
 {
     SvxBrushItem aBrushItem( RES_BACKGROUND );
     SvxBoxItem aBoxItem( RES_BOX );
-    SvxFrameDirectionItem aFrameDirItem(FRMDIR_ENVIRONMENT, RES_FRAMEDIR);
+    SvxFrameDirectionItem aFrameDirItem(SvxFrameDirection::Environment, RES_FRAMEDIR);
     bool bSetBrush = pBrush!=nullptr, bSetBox = false, bSetFrameDir = false;
     if( pBrush )
         aBrushItem = *pBrush;
@@ -1918,13 +1918,13 @@ bool SwHTMLParser::ParseStyleOptions( const OUString &rStyle,
     if( pDir && !pDir->isEmpty() )
     {
         OUString aValue( *pDir );
-        SvxFrameDirection eDir = FRMDIR_ENVIRONMENT;
+        SvxFrameDirection eDir = SvxFrameDirection::Environment;
         if (aValue.equalsIgnoreAsciiCase("LTR"))
-            eDir = FRMDIR_HORI_LEFT_TOP;
+            eDir = SvxFrameDirection::Horizontal_LR_TB;
         else if (aValue.equalsIgnoreAsciiCase("RTL"))
-            eDir = FRMDIR_HORI_RIGHT_TOP;
+            eDir = SvxFrameDirection::Horizontal_RL_TB;
 
-        if( FRMDIR_ENVIRONMENT != eDir )
+        if( SvxFrameDirection::Environment != eDir )
         {
             SvxFrameDirectionItem aDir( eDir, RES_FRAMEDIR );
             rItemSet.Put( aDir );
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx
index a1d77f52..7356d69 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -542,7 +542,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat,
     // Name
     if( nFrameOpts & HtmlFrmOpts::Dir )
     {
-        sal_uInt16 nDir = GetHTMLDirection( rItemSet );
+        SvxFrameDirection nDir = GetHTMLDirection( rItemSet );
         Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() );
         OutDirection( nDir );
     }
@@ -817,7 +817,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma
     // Name
     if (nFrameOptions & HtmlFrmOpts::Dir)
     {
-        sal_uInt16 nCurrentDirection = GetHTMLDirection(rItemSet);
+        SvxFrameDirection nCurrentDirection = GetHTMLDirection(rItemSet);
         OString sDirection = convertDirection(nCurrentDirection);
         aHtml.attribute(OOO_STRING_SVTOOLS_HTML_O_dir, sDirection);
     }
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index 12e71f9..dc2cbe1 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -608,7 +608,7 @@ void SwHTMLWrtTable::Write( SwHTMLWriter& rWrt, sal_Int16 eAlign,
     OStringBuffer sOut;
     sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_table);
 
-    const sal_uInt16 nOldDirection = rWrt.m_nDirection;
+    const SvxFrameDirection nOldDirection = rWrt.m_nDirection;
     if( pFrameFormat )
         rWrt.m_nDirection = rWrt.GetHTMLDirection( pFrameFormat->GetAttrSet() );
     if( rWrt.m_bOutFlyFrame || nOldDirection != rWrt.m_nDirection )
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index e74a629..f2c33fe 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -117,9 +117,9 @@ static CSS1PropertyEnum const aTextTransformTable[] =
 
 static CSS1PropertyEnum const aDirectionTable[] =
 {
-    { "ltr",         FRMDIR_HORI_LEFT_TOP        },
-    { "rtl",         FRMDIR_HORI_RIGHT_TOP       },
-    { "inherit",     FRMDIR_ENVIRONMENT          },
+    { "ltr",         (sal_uInt16)SvxFrameDirection::Horizontal_LR_TB  },
+    { "rtl",         (sal_uInt16)SvxFrameDirection::Horizontal_RL_TB  },
+    { "inherit",     (sal_uInt16)SvxFrameDirection::Environment       },
     { nullptr,                    0                   }
 };
 
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 6560e5f..ef319e7 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -119,7 +119,7 @@ SwHTMLWriter::SwHTMLWriter( const OUString& rBaseURL )
     , m_nExportMode(0)
     , m_nCSS1OutMode(0)
     , m_nCSS1Script(CSS1_OUTMODE_WESTERN)
-    , m_nDirection(FRMDIR_HORI_LEFT_TOP)
+    , m_nDirection(SvxFrameDirection::Horizontal_LR_TB)
     , m_eDestEnc(RTL_TEXTENCODING_MS_1252)
     , m_eLang(LANGUAGE_DONTKNOW)
     , m_bCfgOutStyles( false )
@@ -577,7 +577,7 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt,
         sOut.append('\"');
     }
 
-    sal_uInt16 nDir = rHTMLWrt.GetHTMLDirection( rFormat.GetAttrSet() );
+    SvxFrameDirection nDir = rHTMLWrt.GetHTMLDirection( rFormat.GetAttrSet() );
     rHTMLWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() );
     rHTMLWrt.OutDirection( nDir );
 
@@ -1293,31 +1293,33 @@ void SwHTMLWriter::OutLanguage( LanguageType nLang )
     }
 }
 
-sal_uInt16 SwHTMLWriter::GetHTMLDirection( const SfxItemSet& rItemSet ) const
+SvxFrameDirection SwHTMLWriter::GetHTMLDirection( const SfxItemSet& rItemSet ) const
 {
     return GetHTMLDirection(
         static_cast < const SvxFrameDirectionItem& >( rItemSet.Get( RES_FRAMEDIR ) )
             .GetValue() );
 }
 
-sal_uInt16 SwHTMLWriter::GetHTMLDirection( sal_uInt16 nDir ) const
+SvxFrameDirection SwHTMLWriter::GetHTMLDirection( SvxFrameDirection nDir ) const
 {
     switch( nDir )
     {
-    case FRMDIR_VERT_TOP_LEFT:
-        nDir = FRMDIR_HORI_LEFT_TOP;
+    case SvxFrameDirection::Vertical_LR_TB:
+        nDir = SvxFrameDirection::Horizontal_LR_TB;
         break;
-    case FRMDIR_VERT_TOP_RIGHT:
-        nDir = FRMDIR_HORI_RIGHT_TOP;
+    case SvxFrameDirection::Vertical_RL_TB:
+        nDir = SvxFrameDirection::Horizontal_RL_TB;
         break;
-    case FRMDIR_ENVIRONMENT:
+    case SvxFrameDirection::Environment:
         nDir = m_nDirection;
+        break;
+    default: break;
     }
 
     return nDir;
 }
 
-void SwHTMLWriter::OutDirection( sal_uInt16 nDir )
+void SwHTMLWriter::OutDirection( SvxFrameDirection nDir )
 {
     OString sConverted = convertDirection(nDir);
     if (!sConverted.isEmpty())
@@ -1329,19 +1331,20 @@ void SwHTMLWriter::OutDirection( sal_uInt16 nDir )
     }
 }
 
-OString SwHTMLWriter::convertDirection(sal_uInt16 nDir)
+OString SwHTMLWriter::convertDirection(SvxFrameDirection nDir)
 {
     OString sConverted;
     switch (nDir)
     {
-    case FRMDIR_HORI_LEFT_TOP:
-    case FRMDIR_VERT_TOP_LEFT:
+    case SvxFrameDirection::Horizontal_LR_TB:
+    case SvxFrameDirection::Vertical_LR_TB:
         sConverted = "ltr";
         break;
-    case FRMDIR_HORI_RIGHT_TOP:
-    case FRMDIR_VERT_TOP_RIGHT:
+    case SvxFrameDirection::Horizontal_RL_TB:
+    case SvxFrameDirection::Vertical_RL_TB:
         sConverted = "rtl";
         break;
+    default: break;
     }
     return sConverted;
 }
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index 1f31d97..0fd82ff 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -327,8 +327,8 @@ public:
     sal_uInt16 m_nExportMode;
     sal_uInt16 m_nCSS1OutMode;
     sal_uInt16 m_nCSS1Script;         // contains default script (that's the one
-                                    // that is not contained in class names)
-    sal_uInt16 m_nDirection;          // the current direction
+                                      // that is not contained in class names)
+    SvxFrameDirection   m_nDirection;     // the current direction
 
     rtl_TextEncoding    m_eDestEnc;
     LanguageType        m_eLang;
@@ -456,10 +456,10 @@ public:
     void OutBackground( const SfxItemSet& rItemSet, bool bGraphic );
 
     void OutLanguage( LanguageType eLang );
-    sal_uInt16 GetHTMLDirection( sal_uInt16 nDir ) const;
-    sal_uInt16 GetHTMLDirection( const SfxItemSet& rItemSet ) const;
-    void OutDirection( sal_uInt16 nDir );
-    static OString convertDirection(sal_uInt16 nDirection);
+    SvxFrameDirection GetHTMLDirection( SvxFrameDirection nDir ) const;
+    SvxFrameDirection GetHTMLDirection( const SfxItemSet& rItemSet ) const;
+    void OutDirection( SvxFrameDirection nDir );
+    static OString convertDirection(SvxFrameDirection nDirection);
 
     // ALT/ALIGN/WIDTH/HEIGHT/HSPACE/VSPACE-Optionen des aktuellen
     // Frame-Formats ausgeben und ggf. ein <BR CLEAR=...> vorne an
@@ -614,7 +614,7 @@ struct HTMLSaveData
     SwHTMLNumRuleInfo *pOldNumRuleInfo;     // Owner = this
     SwHTMLNumRuleInfo *pOldNextNumRuleInfo; // Owner = HTML-Writer
     sal_uInt16 nOldDefListLvl;
-    sal_uInt16 nOldDirection;
+    SvxFrameDirection nOldDirection;
     bool bOldWriteAll : 1;
     bool bOldOutHeader : 1;
     bool bOldOutFooter : 1;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 011a9b1..24ccdb0 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3704,7 +3704,7 @@ void DocxAttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTabl
     const SwTable * pTable = pTableTextNodeInfoInner->getTable();
     const SwFrameFormat * pFrameFormat = pTable->GetFrameFormat();
 
-    if ( m_rExport.TrueFrameDirection( *pFrameFormat ) == FRMDIR_HORI_RIGHT_TOP )
+    if ( m_rExport.TrueFrameDirection( *pFrameFormat ) == SvxFrameDirection::Horizontal_RL_TB )
     {
         m_pSerializer->singleElementNS( XML_w, XML_bidiVisual,
                 FSNS( XML_w, XML_val ), "true",
@@ -3717,11 +3717,11 @@ void DocxAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer
     const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
     const SwFrameFormat *pFrameFormat = pTabBox->GetFrameFormat( );
 
-    if ( FRMDIR_VERT_TOP_RIGHT == m_rExport.TrueFrameDirection( *pFrameFormat ) )
+    if ( SvxFrameDirection::Vertical_RL_TB == m_rExport.TrueFrameDirection( *pFrameFormat ) )
         m_pSerializer->singleElementNS( XML_w, XML_textDirection,
                FSNS( XML_w, XML_val ), "tbRl",
                FSEND );
-    else if ( FRMDIR_HORI_LEFT_TOP == m_rExport.TrueFrameDirection( *pFrameFormat ) )
+    else if ( SvxFrameDirection::Horizontal_LR_TB == m_rExport.TrueFrameDirection( *pFrameFormat ) )
     {
         // Undo the text direction mangling done by the btLr handler in writerfilter::dmapper::DomainMapperTableManager::sprm()
         const SwStartNode* pSttNd = pTabBox->GetSttNd();
@@ -7076,12 +7076,12 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust )
     const SvxFrameDirectionItem* rFrameDir = pItems?
         static_cast< const SvxFrameDirectionItem* >( pItems->GetItem( RES_FRAMEDIR ) ): nullptr;
 
-    short nDir = FRMDIR_ENVIRONMENT;
+    SvxFrameDirection nDir = SvxFrameDirection::Environment;
     if( rFrameDir != nullptr )
         nDir = rFrameDir->GetValue();
-    if ( nDir == FRMDIR_ENVIRONMENT )
+    if ( nDir == SvxFrameDirection::Environment )
         nDir = GetExport( ).GetDefaultFrameDirection( );
-    bool bRtl = ( nDir == FRMDIR_HORI_RIGHT_TOP );
+    bool bRtl = ( nDir == SvxFrameDirection::Horizontal_RL_TB );
 
     switch ( rAdjust.GetAdjust() )
     {
@@ -8082,23 +8082,23 @@ void DocxAttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& rDi
 {
     OString sTextFlow;
     bool bBiDi = false;
-    short nDir = rDirection.GetValue();
+    SvxFrameDirection nDir = rDirection.GetValue();
 
-    if ( nDir == FRMDIR_ENVIRONMENT )
+    if ( nDir == SvxFrameDirection::Environment )
         nDir = GetExport( ).GetDefaultFrameDirection( );
 
     switch ( nDir )
     {
         default:
-        case FRMDIR_HORI_LEFT_TOP:
+        case SvxFrameDirection::Horizontal_LR_TB:
             sTextFlow = OString( "lrTb" );
             break;
-        case FRMDIR_HORI_RIGHT_TOP:
+        case SvxFrameDirection::Horizontal_RL_TB:
             sTextFlow = OString( "lrTb" );
             bBiDi = true;
             break;
-        case FRMDIR_VERT_TOP_LEFT: // many things but not this one
-        case FRMDIR_VERT_TOP_RIGHT:
+        case SvxFrameDirection::Vertical_LR_TB: // many things but not this one
+        case SvxFrameDirection::Vertical_RL_TB:
             sTextFlow = OString( "tbRl" );
             break;
     }
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 6d790ce..59452ab 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -865,7 +865,7 @@ void RtfAttributeOutput::TableBidi(ww8::WW8TableNodeInfoInner::Pointer_t pTableT
     const SwTable* pTable = pTableTextNodeInfoInner->getTable();
     const SwFrameFormat* pFrameFormat = pTable->GetFrameFormat();
 
-    if (m_rExport.TrueFrameDirection(*pFrameFormat) != FRMDIR_HORI_RIGHT_TOP)
+    if (m_rExport.TrueFrameDirection(*pFrameFormat) != SvxFrameDirection::Horizontal_RL_TB)
         m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_LTRROW);
     else
         m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_RTLROW);
@@ -3377,7 +3377,7 @@ void RtfAttributeOutput::FormatFrameDirection(const SvxFrameDirectionItem& rDire
 {
     if (!m_rExport.m_bOutPageDescs)
     {
-        if (rDirection.GetValue() == FRMDIR_HORI_RIGHT_TOP)
+        if (rDirection.GetValue() == SvxFrameDirection::Horizontal_RL_TB)
             m_aStyles.append(OOO_STRING_SVTOOLS_RTF_RTLPAR);
         else
             m_aStyles.append(OOO_STRING_SVTOOLS_RTF_LTRPAR);
diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index b9fbd57..4cea33c 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -523,7 +523,7 @@ namespace sw
             OSL_ENSURE(rTextNd.GetDoc(), "No document for node?, suspicious");
             if (rTextNd.GetDoc())
             {
-                if (FRMDIR_HORI_RIGHT_TOP ==
+                if (SvxFrameDirection::Horizontal_RL_TB ==
                     rTextNd.GetDoc()->GetTextDirection(SwPosition(rTextNd)))
                 {
                     bParaIsRTL = true;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 63cf2d6..d122ffb 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -662,7 +662,7 @@ void WW8Export::MiserableRTLFrameFormatHack(SwTwips &rLeft, SwTwips &rRight,
     const ww8::Frame &rFrameFormat)
 {
     //Require nasty bidi swap
-    if (FRMDIR_HORI_RIGHT_TOP != m_pDoc->GetTextDirection(rFrameFormat.GetPosition()))
+    if (SvxFrameDirection::Horizontal_RL_TB != m_pDoc->GetTextDirection(rFrameFormat.GetPosition()))
         return;
 
     SwTwips nWidth = rRight - rLeft;
@@ -2954,7 +2954,7 @@ sal_Int32 SwEscherEx::WriteTextFlyFrame(const DrawObj &rObj, sal_uInt32 nShapeId
     sal_uInt32 nTextBox, DrawObjPointerVector &rPVec)
 {
     const SwFrameFormat &rFormat = rObj.maContent.GetFrameFormat();
-    short nDirection = rObj.mnDirection;
+    SvxFrameDirection nDirection = rObj.mnDirection;
 
     sal_Int32 nBorderThick=0;
     OpenContainer( ESCHER_SpContainer );
@@ -2977,14 +2977,14 @@ sal_Int32 SwEscherEx::WriteTextFlyFrame(const DrawObj &rObj, sal_uInt32 nShapeId
         default:
             OSL_ENSURE(false, "unknown direction type");
             SAL_FALLTHROUGH;
-        case FRMDIR_HORI_LEFT_TOP:
+        case SvxFrameDirection::Horizontal_LR_TB:
             nFlow=mso_txflHorzN;
         break;
-        case FRMDIR_HORI_RIGHT_TOP:
+        case SvxFrameDirection::Horizontal_RL_TB:
             nFlow=mso_txflHorzN;
         break;
-        case FRMDIR_VERT_TOP_LEFT: //not really possible in word
-        case FRMDIR_VERT_TOP_RIGHT:
+        case SvxFrameDirection::Vertical_LR_TB: //not really possible in word
+        case SvxFrameDirection::Vertical_RL_TB:
             nFlow=mso_txflTtoBA;
         break;
     }
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index cdfde53..92a4c35 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -187,7 +187,7 @@ SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTextNode& rTextNd) :
 {
 
     SwPosition aPos(rTextNd);
-    if (FRMDIR_HORI_RIGHT_TOP == rWr.m_pDoc->GetTextDirection(aPos))
+    if (SvxFrameDirection::Horizontal_RL_TB == rWr.m_pDoc->GetTextDirection(aPos))
         mbParaIsRTL = true;
     else
         mbParaIsRTL = false;
@@ -1488,7 +1488,7 @@ const SwRedlineData* SwWW8AttrIter::GetRunLevelRedline( sal_Int32 nPos )
     return nullptr;
 }
 
-short MSWordExportBase::GetCurrentPageDirection() const
+SvxFrameDirection MSWordExportBase::GetCurrentPageDirection() const
 {
     const SwFrameFormat &rFormat = m_pAktPageDesc
                     ? m_pAktPageDesc->GetMaster()
@@ -1496,9 +1496,9 @@ short MSWordExportBase::GetCurrentPageDirection() const
     return rFormat.GetFrameDir().GetValue();
 }
 
-short MSWordExportBase::GetDefaultFrameDirection( ) const
+SvxFrameDirection MSWordExportBase::GetDefaultFrameDirection( ) const
 {
-    short nDir = FRMDIR_ENVIRONMENT;
+    SvxFrameDirection nDir = SvxFrameDirection::Environment;
 
     if ( m_bOutPageDescs )
         nDir = GetCurrentPageDirection(  );
@@ -1517,32 +1517,32 @@ short MSWordExportBase::GetDefaultFrameDirection( ) const
         else if ( dynamic_cast< const SwTextFormatColl *>( m_pOutFormatNode ) !=  nullptr )
         {
             if ( MsLangId::isRightToLeft( static_cast<LanguageType>(GetAppLanguage())) )
-                nDir = FRMDIR_HORI_RIGHT_TOP;
+                nDir = SvxFrameDirection::Horizontal_RL_TB;
             else
-                nDir = FRMDIR_HORI_LEFT_TOP;    //what else can we do :-(
+                nDir = SvxFrameDirection::Horizontal_LR_TB;    //what else can we do :-(
         }
     }
 
-    if ( nDir == FRMDIR_ENVIRONMENT )
+    if ( nDir == SvxFrameDirection::Environment )
     {
         // fdo#44029 put direction right when the locale are RTL.
         if( MsLangId::isRightToLeft( static_cast<LanguageType>(GetAppLanguage())) )
-            nDir = FRMDIR_HORI_RIGHT_TOP;
+            nDir = SvxFrameDirection::Horizontal_RL_TB;
         else
-            nDir = FRMDIR_HORI_LEFT_TOP;        //Set something
+            nDir = SvxFrameDirection::Horizontal_LR_TB;        //Set something
     }
 
     return nDir;
 }
 
-short MSWordExportBase::TrueFrameDirection( const SwFrameFormat &rFlyFormat ) const
+SvxFrameDirection MSWordExportBase::TrueFrameDirection( const SwFrameFormat &rFlyFormat ) const
 {
     const SwFrameFormat *pFlyFormat = &rFlyFormat;
     const SvxFrameDirectionItem* pItem = nullptr;
     while ( pFlyFormat )
     {
         pItem = &pFlyFormat->GetFrameDir();
-        if ( FRMDIR_ENVIRONMENT == pItem->GetValue() )
+        if ( SvxFrameDirection::Environment == pItem->GetValue() )
         {
             pItem = nullptr;
             const SwFormatAnchor* pAnchor = &pFlyFormat->GetAnchor();
@@ -1558,13 +1558,13 @@ short MSWordExportBase::TrueFrameDirection( const SwFrameFormat &rFlyFormat ) co
             pFlyFormat = nullptr;
     }
 
-    short nRet;
+    SvxFrameDirection nRet;
     if ( pItem )
         nRet = pItem->GetValue();
     else
         nRet = GetCurrentPageDirection();
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list