diff options
94 files changed, 367 insertions, 357 deletions
diff --git a/chart2/source/controller/dialogs/TextDirectionListBox.cxx b/chart2/source/controller/dialogs/TextDirectionListBox.cxx index 767d6fba8bb4..0de05f95bb3f 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 cae1c68abd6d..49baf4c509c9 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 0b0f750afad9..2f109db89c06 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 e92a056b512f..e8884854bdee 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 d8a1341f3aa6..ff0a5a46d841 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1252,9 +1252,9 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v { SfxItemSet aAttribs = pEditView->GetAttribs(); const SvxFrameDirectionItem& rCurrentWritingMode = (const SvxFrameDirectionItem&)aAttribs.Get( EE_PARA_WRITINGDIR ); - SvxFrameDirectionItem aNewItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ); - if ( rCurrentWritingMode.GetValue() != FRMDIR_HORI_RIGHT_TOP ) - aNewItem.SetValue( FRMDIR_HORI_RIGHT_TOP ); + SvxFrameDirectionItem aNewItem( SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ); + if ( rCurrentWritingMode.GetValue() != SvxFrameDirection::Horizontal_RL_TB ) + aNewItem.SetValue( SvxFrameDirection::Horizontal_RL_TB ); aAttribs.Put( aNewItem ); pEditView->SetAttribs( aAttribs ); } diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index a73d7eb3d7b0..1cb7387c563f 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -106,7 +106,7 @@ std::vector<SfxPoolItem*>* GlobalEditData::GetDefItems() // Paragraph attributes: SvxNumRule aDefaultNumRule( SvxNumRuleFlags::NONE, 0, false ); - rDefItems[0] = new SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ); + rDefItems[0] = new SvxFrameDirectionItem( SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ); rDefItems[1] = new SvXMLAttrContainerItem( EE_PARA_XMLATTRIBS ); rDefItems[2] = new SvxHangingPunctuationItem(false, EE_PARA_HANGINGPUNCTUATION); rDefItems[3] = new SvxForbiddenRuleItem(true, EE_PARA_FORBIDDENRULES); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 506477fdb611..d016813ec853 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1934,7 +1934,7 @@ bool ImpEditEngine::IsRightToLeft( sal_Int32 nPara ) const { bR2L = GetDefaultHorizontalTextDirection() == EE_HTEXTDIR_R2L; pFrameDirItem = &static_cast<const SvxFrameDirectionItem&>(GetParaAttrib( nPara, EE_PARA_WRITINGDIR )); - if ( pFrameDirItem->GetValue() == FRMDIR_ENVIRONMENT ) + if ( pFrameDirItem->GetValue() == SvxFrameDirection::Environment ) { // #103045# if DefaultHorizontalTextDirection is set, use that value, otherwise pool default. if ( GetDefaultHorizontalTextDirection() != EE_HTEXTDIR_DEFAULT ) @@ -1950,7 +1950,7 @@ bool ImpEditEngine::IsRightToLeft( sal_Int32 nPara ) const } if ( pFrameDirItem ) - bR2L = pFrameDirItem->GetValue() == FRMDIR_HORI_RIGHT_TOP; + bR2L = pFrameDirItem->GetValue() == SvxFrameDirection::Horizontal_RL_TB; return bR2L; } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 2a5f702b8732..d7cb3c4a654f 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -701,7 +701,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, case EE_PARA_WRITINGDIR: { const SvxFrameDirectionItem& rWritingMode = static_cast<const SvxFrameDirectionItem&>(rItem); - if ( rWritingMode.GetValue() == FRMDIR_HORI_RIGHT_TOP ) + if ( rWritingMode.GetValue() == SvxFrameDirection::Horizontal_RL_TB ) rOutput.WriteCharPtr( "\\rtlpar" ); else rOutput.WriteCharPtr( "\\ltrpar" ); diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 7e01d0c42418..88d319099f65 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -4072,7 +4072,6 @@ SfxPoolItem* SvxFrameDirectionItem::Create( SvStream & rStrm, sal_uInt16 /*nVer* return new SvxFrameDirectionItem( static_cast<SvxFrameDirection>(nValue), Which() ); } - sal_uInt16 SvxFrameDirectionItem::GetVersion( sal_uInt16 nFVer ) const { return SOFFICE_FILEFORMAT_50 > nFVer ? USHRT_MAX : 0; @@ -4101,19 +4100,19 @@ bool SvxFrameDirectionItem::PutValue( const css::uno::Any& rVal, switch( nVal ) { case text::WritingMode2::LR_TB: - SetValue( FRMDIR_HORI_LEFT_TOP ); + SetValue( SvxFrameDirection::Horizontal_LR_TB ); break; case text::WritingMode2::RL_TB: - SetValue( FRMDIR_HORI_RIGHT_TOP ); + SetValue( SvxFrameDirection::Horizontal_RL_TB ); break; case text::WritingMode2::TB_RL: - SetValue( FRMDIR_VERT_TOP_RIGHT ); + SetValue( SvxFrameDirection::Vertical_RL_TB ); break; case text::WritingMode2::TB_LR: - SetValue( FRMDIR_VERT_TOP_LEFT ); + SetValue( SvxFrameDirection::Vertical_LR_TB ); break; case text::WritingMode2::PAGE: - SetValue( FRMDIR_ENVIRONMENT ); + SetValue( SvxFrameDirection::Environment ); break; default: bRet = false; @@ -4133,19 +4132,19 @@ bool SvxFrameDirectionItem::QueryValue( css::uno::Any& rVal, bool bRet = true; switch( GetValue() ) { - case FRMDIR_HORI_LEFT_TOP: + case SvxFrameDirection::Horizontal_LR_TB: nVal = text::WritingMode2::LR_TB; break; - case FRMDIR_HORI_RIGHT_TOP: + case SvxFrameDirection::Horizontal_RL_TB: nVal = text::WritingMode2::RL_TB; break; - case FRMDIR_VERT_TOP_RIGHT: + case SvxFrameDirection::Vertical_RL_TB: nVal = text::WritingMode2::TB_RL; break; - case FRMDIR_VERT_TOP_LEFT: + case SvxFrameDirection::Vertical_LR_TB: nVal = text::WritingMode2::TB_LR; break; - case FRMDIR_ENVIRONMENT: + case SvxFrameDirection::Environment: nVal = text::WritingMode2::PAGE; break; default: diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index bc3298b26943..f0d9f32ced68 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -988,14 +988,14 @@ ATTR_SETOVERLINE: case RTF_RTLPAR: if (aPardMap.nDirection) { - pSet->Put(SvxFrameDirectionItem(FRMDIR_HORI_RIGHT_TOP, + pSet->Put(SvxFrameDirectionItem(SvxFrameDirection::Horizontal_RL_TB, aPardMap.nDirection)); } break; case RTF_LTRPAR: if (aPardMap.nDirection) { - pSet->Put(SvxFrameDirectionItem(FRMDIR_HORI_LEFT_TOP, + pSet->Put(SvxFrameDirectionItem(SvxFrameDirection::Horizontal_LR_TB, aPardMap.nDirection)); } break; diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index d170540f7178..e32a7cc48600 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 45730aba4e81..143ace6da787 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 baedb907cf65..39f2948d48bf 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 4af2a077ee1a..85f60b30da2a 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 949b151d5a62..4e3018848722 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 25b6bb54fe29..64123cf0be8a 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 daabc72fc5b1..df7470f2cea7 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 2472f4a76ee2..de5d06c09ff4 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 8618c55e5769..c18c869a84cb 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 a9ee5354c768..ae7aed25f171 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 f2a86739145b..d1c50ea852b0 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 ca53689ac4ba..1df8cbab8a19 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 40993276a934..eccdd456f900 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 b320ba7f9f8c..433f5f61c01d 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 5e08e624f769..3887ac22669b 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 9cf130add9dd..d31bc6a11857 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 9102ee662008..3c2635c9599f 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 b45756b7b03a..d19365816222 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 a423db307ec5..e3dd216bd699 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 52a0dbe2631d..e7aea5c78439 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -1239,9 +1239,9 @@ css::text::WritingMode SdDrawDocument::GetDefaultWritingMode() const { switch( static_cast<const SvxFrameDirectionItem&>( *pItem ).GetValue() ) { - case FRMDIR_HORI_LEFT_TOP: eRet = css::text::WritingMode_LR_TB; break; - case FRMDIR_HORI_RIGHT_TOP: eRet = css::text::WritingMode_RL_TB; break; - case FRMDIR_VERT_TOP_RIGHT: eRet = css::text::WritingMode_TB_RL; break; + case SvxFrameDirection::Horizontal_LR_TB: eRet = css::text::WritingMode_LR_TB; break; + case SvxFrameDirection::Horizontal_RL_TB: eRet = css::text::WritingMode_RL_TB; break; + case SvxFrameDirection::Vertical_RL_TB: eRet = css::text::WritingMode_TB_RL; break; default: OSL_FAIL( "Frame direction not supported yet" ); @@ -1259,9 +1259,9 @@ void SdDrawDocument::SetDefaultWritingMode(css::text::WritingMode eMode ) SvxFrameDirection nVal; switch( eMode ) { - case css::text::WritingMode_LR_TB: nVal = FRMDIR_HORI_LEFT_TOP; break; - case css::text::WritingMode_RL_TB: nVal = FRMDIR_HORI_RIGHT_TOP; break; - case css::text::WritingMode_TB_RL: nVal = FRMDIR_VERT_TOP_RIGHT; break; + case css::text::WritingMode_LR_TB: nVal = SvxFrameDirection::Horizontal_LR_TB; break; + case css::text::WritingMode_RL_TB: nVal = SvxFrameDirection::Horizontal_RL_TB; break; + case css::text::WritingMode_TB_RL: nVal = SvxFrameDirection::Vertical_RL_TB; break; default: OSL_FAIL( "Frame direction not supported yet" ); return; diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index 58fb320207ef..5ce1714f8d7d 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -1196,8 +1196,8 @@ void ParagraphObj::ImplGetParagraphValues( PPTExBulletProvider* pBuProv, bool bG mAny >>= nWritingMode; SvxFrameDirection eWritingMode( (SvxFrameDirection)nWritingMode ); - if ( ( eWritingMode == FRMDIR_HORI_RIGHT_TOP ) - || ( eWritingMode == FRMDIR_VERT_TOP_RIGHT ) ) + if ( ( eWritingMode == SvxFrameDirection::Horizontal_RL_TB ) + || ( eWritingMode == SvxFrameDirection::Vertical_RL_TB ) ) { mnBiDi = 1; } diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 323a3c3e1f35..0356a6c8937e 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -316,7 +316,7 @@ OUString getParagraphStyle( SdrOutliner* pOutliner, sal_Int32 nPara ) OUString sStyle; - if( aParaSet.GetItem<SvxFrameDirectionItem>( EE_PARA_WRITINGDIR )->GetValue() == FRMDIR_HORI_RIGHT_TOP ) + if( aParaSet.GetItem<SvxFrameDirectionItem>( EE_PARA_WRITINGDIR )->GetValue() == SvxFrameDirection::Horizontal_RL_TB ) { sStyle = "direction: rtl;"; diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index cd9c99b36eb8..5a9acafd6f11 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -230,7 +230,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) aNewAttr.Put( aBoxItem ); aNewAttr.Put( SvxFrameDirectionItem( - mpDoc->GetDefaultWritingMode() == css::text::WritingMode_RL_TB ? FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP, + mpDoc->GetDefaultWritingMode() == css::text::WritingMode_RL_TB ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) ); // Retrieve page-data for dialog @@ -476,8 +476,8 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) const SfxPoolItem *pItem; if( SfxItemState::SET == pTempSet->GetItemState( EE_PARA_WRITINGDIR, false, &pItem ) ) { - sal_uInt32 nVal = static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue(); - mpDoc->SetDefaultWritingMode( nVal == FRMDIR_HORI_RIGHT_TOP ? css::text::WritingMode_RL_TB : css::text::WritingMode_LR_TB ); + SvxFrameDirection nVal = static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue(); + mpDoc->SetDefaultWritingMode( nVal == SvxFrameDirection::Horizontal_RL_TB ? css::text::WritingMode_RL_TB : css::text::WritingMode_LR_TB ); } mpDoc->SetChanged(); diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index bdef5e956e79..3b6757000e77 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -835,7 +835,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) const SfxItemSet& rSet = mpView->GetDefaultAttr(); SvxFrameDirection eDirection = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(rSet.Get(EE_PARA_WRITINGDIR)).GetValue(); - if(FRMDIR_HORI_RIGHT_TOP == eDirection || FRMDIR_VERT_TOP_RIGHT == eDirection) + if(SvxFrameDirection::Horizontal_RL_TB == eDirection || SvxFrameDirection::Vertical_RL_TB == eDirection) { aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_BOTTOM)); } @@ -855,7 +855,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) const SfxItemSet& rSet = mpView->GetDefaultAttr(); SvxFrameDirection eDirection = (SvxFrameDirection)static_cast<const SvxFrameDirectionItem&>(rSet.Get(EE_PARA_WRITINGDIR)).GetValue(); - if(FRMDIR_HORI_RIGHT_TOP == eDirection) + if(SvxFrameDirection::Horizontal_RL_TB == eDirection) { aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT)); } diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx index 17015f8b35ee..c46dc8aa174b 100644 --- a/sd/source/ui/view/drtxtob.cxx +++ b/sd/source/ui/view/drtxtob.cxx @@ -514,26 +514,26 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) { switch( static_cast<const SvxFrameDirectionItem&>( aAttrSet.Get( EE_PARA_WRITINGDIR ) ).GetValue() ) { - case FRMDIR_VERT_TOP_LEFT: - case FRMDIR_VERT_TOP_RIGHT: + case SvxFrameDirection::Vertical_LR_TB: + case SvxFrameDirection::Vertical_RL_TB: { rSet.DisableItem( SID_ATTR_PARA_LEFT_TO_RIGHT ); rSet.DisableItem( SID_ATTR_PARA_RIGHT_TO_LEFT ); } break; - case FRMDIR_HORI_LEFT_TOP: + case SvxFrameDirection::Horizontal_LR_TB: rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, true ) ); rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, false ) ); break; - case FRMDIR_HORI_RIGHT_TOP: + case SvxFrameDirection::Horizontal_RL_TB: rSet.Put( SfxBoolItem( SID_ATTR_PARA_LEFT_TO_RIGHT, false ) ); rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, true ) ); break; // The case for the superordinate object is missing. - case FRMDIR_ENVIRONMENT: + case SvxFrameDirection::Environment: { SdDrawDocument& rDoc = mpView->GetDoc(); css::text::WritingMode eMode = rDoc.GetDefaultWritingMode(); @@ -549,6 +549,7 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet ) rSet.Put( SfxBoolItem( SID_ATTR_PARA_RIGHT_TO_LEFT, !bIsLeftToRight ) ); } break; + default: break; } } diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 801664d60671..e1b797dcdc53 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -585,13 +585,13 @@ void TextObjectBar::Execute( SfxRequest &rReq ) if( bLeftToRight ) { - aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) ); + aNewAttr.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) ); if( nAdjust == SvxAdjust::Right ) aNewAttr.Put( SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST ) ); } else { - aNewAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) ); + aNewAttr.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR ) ); if( nAdjust == SvxAdjust::Left ) aNewAttr.Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) ); } diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index c417a1ec567d..f3b6e8be4ff3 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -966,7 +966,7 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) if( aEditAttr.GetItemState( EE_PARA_WRITINGDIR ) >= SfxItemState::DEFAULT ) { const SvxFrameDirectionItem& rItem = static_cast<const SvxFrameDirectionItem&>( aEditAttr.Get( EE_PARA_WRITINGDIR ) ); - rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, rItem.GetValue() == FRMDIR_HORI_RIGHT_TOP)); + rSet.Put(SfxBoolItem(SID_RULER_TEXT_RIGHT_TO_LEFT, rItem.GetValue() == SvxFrameDirection::Horizontal_LR_TB)); } } } diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index a999791a5c5a..318844aa5c70 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 5d259f42d70c..83ecb4bb0ac1 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 38a1169e1cd2..f59900ac4332 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 0436d57e0106..3ccbc3e744cd 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 064990b927c0..37a14b7b2eb5 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 1a6545898c8e..bc20780a04de 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 a9a52227b7e9..83fbbd2da269 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 7b85287a72e0..862e46aade0c 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 fb14f5a7ed26..dc6898b8e3c5 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 11f83a206e30..d495d85698ad 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 6c108ed9f166..bbc3897392c6 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 97ae882fb448..df94f1bab31c 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 260adbaf8c71..0aecf911b2e7 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 ee3a57981848..e302ee6c0f6d 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 c8be04e922b3..57cacf03a8c0 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 611a8d212bd2..f985634ed09d 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 094a8fe55861..8380afb0eab2 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 e9f121bdf059..25d733db62a2 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 97e17fc38dd7..4f235b2ebe1b 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 170428358634..44ca0dd07756 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 14a09148f234..0644928619a9 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 6f71f423d440..79ba414c06cf 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 5c7a4afbfd05..128bc48e0318 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 55e636f58ca2..a8ea565c43ef 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 27d3af746b38..86f8e0919859 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 09ec5740028c..7ffb743014b8 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 a6801dcf3816..a8e3ac1df19a 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 e3167264ed0f..fca9779e273a 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 a1d77f525996..7356d697bf0b 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 12e71f94848e..dc2cbe168c21 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 e74a629157f7..f2c33fef1bed 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 6560e5fea912..ef319e744969 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 1f31d9769e6e..0fd82ff92a9b 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 011a9b1df464..24ccdb069299 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 6d790ce9dee6..59452abc62c3 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 b9fbd570fac0..4cea33ce6ed0 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 63cf2d698f52..d122ffbd1243 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 cdfde537b037..92a4c358bd16 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(); - OSL_ENSURE( nRet != FRMDIR_ENVIRONMENT, "leaving with environment direction" ); + OSL_ENSURE( nRet != SvxFrameDirection::Environment, "leaving with environment direction" ); return nRet; } @@ -2601,21 +2601,21 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) } /* - If a given para is using the FRMDIR_ENVIRONMENT direction we + If a given para is using the SvxFrameDirection::Environment direction we cannot export that, its its ltr then that's ok as thats word's default. Otherwise we must add a RTL attribute to our export list */ const SvxFrameDirectionItem* pItem = static_cast<const SvxFrameDirectionItem*>( rNode.GetSwAttrSet().GetItem(RES_FRAMEDIR)); if ( - (!pItem || pItem->GetValue() == FRMDIR_ENVIRONMENT) && + (!pItem || pItem->GetValue() == SvxFrameDirection::Environment) && aAttrIter.IsParaRTL() ) { if ( !pTmpSet ) pTmpSet = new SfxItemSet(rNode.GetSwAttrSet()); - pTmpSet->Put(SvxFrameDirectionItem(FRMDIR_HORI_RIGHT_TOP, RES_FRAMEDIR)); + pTmpSet->Put(SvxFrameDirectionItem(SvxFrameDirection::Horizontal_RL_TB, RES_FRAMEDIR)); } // move code for handling of numbered, // but not counted paragraphs to this place. Otherwise, the paragraph diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index dfca863a8cf9..f79de76257a1 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1592,7 +1592,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt //Cannot export as normal page framedir, as continuous sections //cannot contain any grid settings like proper sections - AttrOutput().SectionBiDi( FRMDIR_HORI_RIGHT_TOP == TrueFrameDirection( *rSepInfo.pSectionFormat ) ); + AttrOutput().SectionBiDi( SvxFrameDirection::Horizontal_RL_TB == TrueFrameDirection( *rSepInfo.pSectionFormat ) ); m_pISet = pOldI; } diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 108421820af0..90aa97886cde 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2119,7 +2119,7 @@ void WW8AttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_ const SwTableBox * pTabBox1 = rTableBoxes[n]; const SwFrameFormat * pFrameFormat = pTabBox1->GetFrameFormat(); - if ( FRMDIR_VERT_TOP_RIGHT == m_rWW8Export.TrueFrameDirection( *pFrameFormat ) ) + if ( SvxFrameDirection::Vertical_RL_TB == m_rWW8Export.TrueFrameDirection( *pFrameFormat ) ) { m_rWW8Export.InsUInt16( NS_sprm::sprmTTextFlow ); m_rWW8Export.pO->push_back( sal_uInt8(n) ); //start range @@ -2154,7 +2154,7 @@ void WW8AttributeOutput::TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTable const SwTable * pTable = pTableTextNodeInfoInner->getTable(); const SwFrameFormat * pFrameFormat = pTable->GetFrameFormat(); - if ( m_rWW8Export.TrueFrameDirection(*pFrameFormat) == FRMDIR_HORI_RIGHT_TOP ) + if ( m_rWW8Export.TrueFrameDirection(*pFrameFormat) == SvxFrameDirection::Horizontal_RL_TB ) { m_rWW8Export.InsUInt16( NS_sprm::sprmTFBiDi ); m_rWW8Export.InsUInt16( 1 ); diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index d4e58c5fc2da..063b556e58f5 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -337,14 +337,14 @@ class DrawObj public: WW8_CP mnCp; // CP-Pos of references sal_uInt32 mnShapeId; // ShapeId for the SwFrameFormats - ww8::Frame maContent; // the frame itself + ww8::Frame maContent; // the frame itself Point maParentPos; // Points sal_Int32 mnThick; // Border Thicknesses - short mnDirection; // If BiDi or not + SvxFrameDirection mnDirection; // If BiDi or not unsigned int mnHdFtIndex; // 0 for main text, +1 for each subsequent // msword hd/ft - DrawObj(const ww8::Frame &rContent, WW8_CP nCp, Point aParentPos, short nDir, + DrawObj(const ww8::Frame &rContent, WW8_CP nCp, Point aParentPos, SvxFrameDirection nDir, unsigned int nHdFtIndex) : mnCp(nCp), mnShapeId(0), maContent(rContent), maParentPos(aParentPos), mnThick(0), mnDirection(nDir), mnHdFtIndex(nHdFtIndex) {} @@ -622,13 +622,13 @@ public: /// Use OutputItem() on an item set according to the parameters. void OutputItemSet( const SfxItemSet& rSet, bool bPapFormat, bool bChpFormat, sal_uInt16 nScript, bool bExportParentItemSet ); - short GetDefaultFrameDirection( ) const; + SvxFrameDirection GetDefaultFrameDirection( ) const; /// Right to left? - short TrueFrameDirection( const SwFrameFormat& rFlyFormat ) const; + SvxFrameDirection TrueFrameDirection( const SwFrameFormat& rFlyFormat ) const; /// Right to left? - short GetCurrentPageDirection() const; + SvxFrameDirection GetCurrentPageDirection() const; /// In case of numbering restart. diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index e463164a4077..1f4c3e255edc 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -4196,7 +4196,7 @@ void AttributeOutputBase::FormatColumns( const SwFormatCol& rCol ) const SwFrameFormat* pFormat = GetExport( ).m_pAktPageDesc ? &GetExport( ).m_pAktPageDesc->GetMaster() : &const_cast<const SwDoc *>(GetExport( ).m_pDoc)->GetPageDesc(0).GetMaster(); const SvxFrameDirectionItem &frameDirection = pFormat->GetFrameDir(); SwTwips nPageSize; - if ( frameDirection.GetValue() == FRMDIR_VERT_TOP_RIGHT || frameDirection.GetValue() == FRMDIR_VERT_TOP_LEFT ) + if ( frameDirection.GetValue() == SvxFrameDirection::Vertical_RL_TB || frameDirection.GetValue() == SvxFrameDirection::Vertical_LR_TB ) { const SvxULSpaceItem &rUL = pFormat->GetULSpace(); nPageSize = pFormat->GetFrameSize().GetHeight(); @@ -4381,7 +4381,7 @@ void WW8AttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust ) bool bBiDiSwap = false; if ( m_rWW8Export.m_pOutFormatNode ) { - short nDirection = FRMDIR_HORI_LEFT_TOP; + SvxFrameDirection nDirection = SvxFrameDirection::Horizontal_LR_TB; if ( dynamic_cast< const SwTextNode *>( m_rWW8Export.m_pOutFormatNode ) != nullptr ) { SwPosition aPos(*static_cast<const SwContentNode*>(m_rWW8Export.m_pOutFormatNode)); @@ -4395,8 +4395,8 @@ void WW8AttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust ) ItemGet<SvxFrameDirectionItem>(*pC, RES_FRAMEDIR); nDirection = rItem.GetValue(); } - if ( ( nDirection == FRMDIR_HORI_RIGHT_TOP ) || - ( nDirection == FRMDIR_ENVIRONMENT && AllSettings::GetLayoutRTL() ) ) + if ( ( nDirection == SvxFrameDirection::Horizontal_RL_TB ) || + ( nDirection == SvxFrameDirection::Environment && AllSettings::GetLayoutRTL() ) ) { bBiDiSwap = true; } @@ -4413,9 +4413,9 @@ void WW8AttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& rDir { sal_uInt16 nTextFlow=0; bool bBiDi = false; - short nDir = rDirection.GetValue(); + SvxFrameDirection nDir = rDirection.GetValue(); - if ( nDir == FRMDIR_ENVIRONMENT ) + if ( nDir == SvxFrameDirection::Environment ) { if ( m_rWW8Export.m_bOutPageDescs ) nDir = m_rWW8Export.GetCurrentPageDirection(); @@ -4434,11 +4434,11 @@ void WW8AttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& rDir nDir = m_rWW8Export.m_pDoc->GetTextDirection( aPos ); } else if ( dynamic_cast< const SwTextFormatColl *>( m_rWW8Export.m_pOutFormatNode ) != nullptr ) - nDir = FRMDIR_HORI_LEFT_TOP; //what else can we do :-( + nDir = SvxFrameDirection::Horizontal_LR_TB; //what else can we do :-( } - if ( nDir == FRMDIR_ENVIRONMENT ) - nDir = FRMDIR_HORI_LEFT_TOP; //Set something + if ( nDir == SvxFrameDirection::Environment ) + nDir = SvxFrameDirection::Horizontal_LR_TB; //Set something } switch ( nDir ) @@ -4447,15 +4447,15 @@ void WW8AttributeOutput::FormatFrameDirection( const SvxFrameDirectionItem& rDir //Can't get an unknown type here OSL_FAIL("Unknown frame direction"); SAL_FALLTHROUGH; - case FRMDIR_HORI_LEFT_TOP: + case SvxFrameDirection::Horizontal_LR_TB: nTextFlow = 0; break; - case FRMDIR_HORI_RIGHT_TOP: + case SvxFrameDirection::Horizontal_RL_TB: nTextFlow = 0; bBiDi = true; break; - case FRMDIR_VERT_TOP_LEFT: //word doesn't have this - case FRMDIR_VERT_TOP_RIGHT: + case SvxFrameDirection::Vertical_LR_TB: //word doesn't have this + case SvxFrameDirection::Vertical_RL_TB: nTextFlow = 1; break; } diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index af5918404a3c..f88d91c87219 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2885,7 +2885,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject, SdrTextObj *pSdrTextObj = dynamic_cast<SdrTextObj*>(rpObject); if (pSdrTextObj && pSdrTextObj->IsVerticalWriting()) - rFlySet.Put(SvxFrameDirectionItem(FRMDIR_VERT_TOP_RIGHT, RES_FRAMEDIR)); + rFlySet.Put(SvxFrameDirectionItem(SvxFrameDirection::Vertical_RL_TB, RES_FRAMEDIR)); pRetFrameFormat = m_rDoc.MakeFlySection(eAnchor, m_pPaM->GetPoint(), &rFlySet); OSL_ENSURE(pRetFrameFormat->GetAnchor().GetAnchorId() == eAnchor, diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 7d50bddad22a..ec889ea5ce07 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -2479,7 +2479,7 @@ void WW8TabDesc::CreateSwTable() } SvxFrameDirectionItem aDirection( - m_bIsBiDi ? FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR ); + m_bIsBiDi ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR ); m_pTable->GetFrameFormat()->SetFormatAttr(aDirection); if (text::HoriOrientation::LEFT_AND_WIDTH == m_eOri) @@ -3108,7 +3108,7 @@ void WW8TabDesc::SetTabShades( SwTableBox* pBox, short nWwIdx ) SvxFrameDirection MakeDirection(sal_uInt16 nCode, bool bIsBiDi) { - SvxFrameDirection eDir = FRMDIR_ENVIRONMENT; + SvxFrameDirection eDir = SvxFrameDirection::Environment; // 1: Asian layout with rotated CJK characters // 5: Asian layout // 3: Western layout rotated by 90 degrees @@ -3116,19 +3116,19 @@ SvxFrameDirection MakeDirection(sal_uInt16 nCode, bool bIsBiDi) switch (nCode) { default: - OSL_ENSURE(eDir == 4, "unknown direction code, maybe it's a bitfield"); + OSL_ENSURE(eDir == SvxFrameDirection::Environment, "unknown direction code, maybe it's a bitfield"); SAL_FALLTHROUGH; case 3: - eDir = bIsBiDi ? FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP; // #i38158# - Consider RTL tables + eDir = bIsBiDi ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB; // #i38158# - Consider RTL tables break; case 5: - eDir = FRMDIR_VERT_TOP_RIGHT; + eDir = SvxFrameDirection::Vertical_RL_TB; break; case 1: - eDir = FRMDIR_VERT_TOP_RIGHT; + eDir = SvxFrameDirection::Vertical_RL_TB; break; case 4: - eDir = bIsBiDi ? FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP; // #i38158# - Consider RTL tables + eDir = bIsBiDi ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB; // #i38158# - Consider RTL tables break; } return eDir; @@ -4576,7 +4576,7 @@ void WW8RStyle::Import() false)) { pIo->m_pStandardFormatColl->SetFormatAttr( - SvxFrameDirectionItem(FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR)); + SvxFrameDirectionItem(SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR)); } } @@ -4586,14 +4586,14 @@ void WW8RStyle::Import() rtl_TextEncoding SwWW8StyInf::GetCharSet() const { - if ((m_pFormat) && (m_pFormat->GetFrameDir().GetValue() == FRMDIR_HORI_RIGHT_TOP)) + if ((m_pFormat) && (m_pFormat->GetFrameDir().GetValue() == SvxFrameDirection::Horizontal_RL_TB)) return m_eRTLFontSrcCharSet; return m_eLTRFontSrcCharSet; } rtl_TextEncoding SwWW8StyInf::GetCJKCharSet() const { - if ((m_pFormat) && (m_pFormat->GetFrameDir().GetValue() == FRMDIR_HORI_RIGHT_TOP)) + if ((m_pFormat) && (m_pFormat->GetFrameDir().GetValue() == SvxFrameDirection::Horizontal_RL_TB)) return m_eRTLFontSrcCharSet; return m_eCJKFontSrcCharSet; } diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 57ac9b2c7ed3..82368638ed1b 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -167,36 +167,36 @@ void wwSection::SetDirection() OSL_ENSURE(false, "Unknown layout type"); SAL_FALLTHROUGH; case 0: - meDir=FRMDIR_HORI_LEFT_TOP; + meDir=SvxFrameDirection::Horizontal_LR_TB; break; case 1: - meDir=FRMDIR_VERT_TOP_RIGHT; + meDir=SvxFrameDirection::Vertical_RL_TB; break; case 2: //asian letters are not rotated, western are. We can't import //bottom to top going left to right, we can't do this in //pages, (in drawboxes we could partly hack it with a rotated //drawing box, though not frame) - meDir=FRMDIR_VERT_TOP_RIGHT; + meDir=SvxFrameDirection::Vertical_RL_TB; break; case 3: //asian letters are not rotated, western are. We can't import - meDir=FRMDIR_VERT_TOP_RIGHT; + meDir=SvxFrameDirection::Vertical_RL_TB; break; case 4: //asian letters are rotated, western not. We can't import - meDir=FRMDIR_HORI_LEFT_TOP; + meDir=SvxFrameDirection::Horizontal_LR_TB; break; } sal_uInt8 bRTLPgn = maSep.fBiDi; - if ((meDir == FRMDIR_HORI_LEFT_TOP) && bRTLPgn) - meDir = FRMDIR_HORI_RIGHT_TOP; + if ((meDir == SvxFrameDirection::Horizontal_LR_TB) && bRTLPgn) + meDir = SvxFrameDirection::Horizontal_RL_TB; } bool wwSection::IsVertical() const { - if (meDir == FRMDIR_VERT_TOP_RIGHT || meDir == FRMDIR_VERT_TOP_LEFT) + if (meDir == SvxFrameDirection::Vertical_RL_TB || meDir == SvxFrameDirection::Vertical_LR_TB) return true; return false; } @@ -316,7 +316,7 @@ void SwWW8ImplReader::Read_ParaBiDi(sal_uInt16, const sal_uInt8* pData, short nL else { SvxFrameDirection eDir = - *pData ? FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP; + *pData ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB; NewAttr(SvxFrameDirectionItem(eDir, RES_FRAMEDIR)); } } @@ -651,7 +651,7 @@ SwSectionFormat *wwSectionManager::InsertSection( bool bRTLPgn = !maSegments.empty() && maSegments.back().IsBiDi(); aSet.Put(SvxFrameDirectionItem( - bRTLPgn ? FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR)); + bRTLPgn ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR)); if (2 == mrReader.m_pWDop->fpc) aSet.Put( SwFormatFootnoteAtTextEnd(FTNEND_ATTXTEND)); @@ -757,7 +757,7 @@ void SwWW8ImplReader::HandleLineNumbering(const wwSection &rSection) wwSection::wwSection(const SwPosition &rPos) : maStart(rPos.nNode) , mpSection(nullptr) , mpPage(nullptr) - , meDir(FRMDIR_HORI_LEFT_TOP) + , meDir(SvxFrameDirection::Horizontal_LR_TB) , nPgWidth(SvxPaperInfo::GetPaperSize(PAPER_A4).Width()) , nPgLeft(MM_250) , nPgRight(MM_250) @@ -2018,7 +2018,7 @@ WW8FlySet::WW8FlySet(SwWW8ImplReader& rReader, const WW8FlyPara* pFW, if (!rReader.m_bNewDoc) Reader::ResetFrameFormatAttrs(*this); // remove distance/border // position - Put(SvxFrameDirectionItem(FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR)); + Put(SvxFrameDirectionItem(SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR)); /*Below can all go when we have from left in rtl mode*/ SwTwips nXPos = pFS->nXPos; @@ -2073,7 +2073,7 @@ WW8FlySet::WW8FlySet( SwWW8ImplReader& rReader, const SwPaM* pPaM, { Init(rReader, pPaM); - Put(SvxFrameDirectionItem(FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR)); + Put(SvxFrameDirectionItem(SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR)); short aSizeArray[5]={0}; /* @@ -4378,7 +4378,7 @@ bool SwWW8ImplReader::IsRightToLeft() { const SvxFrameDirectionItem* pItem= static_cast<const SvxFrameDirectionItem*>(GetFormatAttr(RES_FRAMEDIR)); - if (pItem && (pItem->GetValue() == FRMDIR_HORI_RIGHT_TOP)) + if (pItem && (pItem->GetValue() == SvxFrameDirection::Horizontal_RL_TB)) bRTL = true; } return bRTL; diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 6fda9ca1ef36..54afd020a52a 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -193,7 +193,7 @@ public: SectRepr::SectRepr( size_t nPos, SwSection& rSect ) : m_SectionData( rSect ) , m_Brush( RES_BACKGROUND ) - , m_FrameDirItem( FRMDIR_ENVIRONMENT, RES_FRAMEDIR ) + , m_FrameDirItem( SvxFrameDirection::Environment, RES_FRAMEDIR ) , m_LRSpaceItem( RES_LR_SPACE ) , m_nArrPos(nPos) , m_bContent(m_SectionData.GetLinkFileName().isEmpty()) diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 9954623cce85..5b5f3c855672 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -616,7 +616,7 @@ void SwColumnPage::Reset(const SfxItemSet *rSet) if( SfxItemState::DEFAULT <= rSet->GetItemState( RES_FRAMEDIR ) ) { const SvxFrameDirectionItem& rItem = static_cast<const SvxFrameDirectionItem&>(rSet->Get(RES_FRAMEDIR)); - sal_uIntPtr nVal = rItem.GetValue(); + SvxFrameDirection nVal = rItem.GetValue(); const sal_Int32 nPos = m_pTextDirectionLB->GetEntryPos( reinterpret_cast<void*>(nVal) ); m_pTextDirectionLB->SelectEntryPos( nPos ); m_pTextDirectionLB->SaveValue(); @@ -1204,8 +1204,8 @@ void SwColumnPage::ActivatePage(const SfxItemSet& rSet) { const SvxFrameDirectionItem& rDirItem = static_cast<const SvxFrameDirectionItem&>(rSet.Get(RES_FRAMEDIR)); - bVertical = rDirItem.GetValue() == FRMDIR_VERT_TOP_RIGHT|| - rDirItem.GetValue() == FRMDIR_VERT_TOP_LEFT; + bVertical = rDirItem.GetValue() == SvxFrameDirection::Vertical_RL_TB|| + rDirItem.GetValue() == SvxFrameDirection::Vertical_LR_TB; } if (!m_bFrame) diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index bfcf5c6a1fce..a5eb7386a6d7 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -3079,13 +3079,13 @@ void SwFrameAddPage::Reset(const SfxItemSet *rSet ) //vertical text flow is not possible in HTML if(m_bHtmlMode) { - sal_uLong nData = FRMDIR_VERT_TOP_RIGHT; + SvxFrameDirection nData = SvxFrameDirection::Vertical_RL_TB; m_pTextFlowLB->RemoveEntry(m_pTextFlowLB->GetEntryPos(reinterpret_cast<void*>(nData))); } - sal_uInt16 nVal = static_cast<const SvxFrameDirectionItem&>(rSet->Get(RES_FRAMEDIR)).GetValue(); + SvxFrameDirection nVal = static_cast<const SvxFrameDirectionItem&>(rSet->Get(RES_FRAMEDIR)).GetValue(); sal_Int32 nPos; for( nPos = m_pTextFlowLB->GetEntryCount(); nPos; ) - if( (sal_uInt16)reinterpret_cast<sal_IntPtr>(m_pTextFlowLB->GetEntryData( --nPos )) == nVal ) + if( (SvxFrameDirection)reinterpret_cast<sal_IntPtr>(m_pTextFlowLB->GetEntryData( --nPos )) == nVal ) break; m_pTextFlowLB->SelectEntryPos( nPos ); m_pTextFlowLB->SaveValue(); diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx index e622569496ca..c9b37dbeefb4 100644 --- a/sw/source/ui/misc/pggrid.cxx +++ b/sw/source/ui/misc/pggrid.cxx @@ -300,8 +300,8 @@ void SwTextGridPage::UpdatePageSize(const SfxItemSet& rSet) { const SvxFrameDirectionItem& rDirItem = static_cast<const SvxFrameDirectionItem&>(rSet.Get(RES_FRAMEDIR)); - m_bVertical = rDirItem.GetValue() == FRMDIR_VERT_TOP_RIGHT|| - rDirItem.GetValue() == FRMDIR_VERT_TOP_LEFT; + m_bVertical = rDirItem.GetValue() == SvxFrameDirection::Vertical_RL_TB|| + rDirItem.GetValue() == SvxFrameDirection::Vertical_LR_TB; } if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PAGE_SIZE )) diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx index d2c3e85b4d7f..9c6663518d99 100644 --- a/sw/source/uibase/app/docshini.cxx +++ b/sw/source/uibase/app/docshini.cxx @@ -309,7 +309,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) /* #106748# If the default frame direction of a document is RTL the default adjustment is to the right. */ if( !bHTMLTemplSet && - FRMDIR_HORI_RIGHT_TOP == GetDefaultFrameDirection(GetAppLanguage()) ) + SvxFrameDirection::Horizontal_RL_TB == GetDefaultFrameDirection(GetAppLanguage()) ) { m_pDoc->SetDefault( SvxAdjustItem(SvxAdjust::Right, RES_PARATR_ADJUST ) ); } diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx index 01ae1d42056f..412c0cd9b32d 100644 --- a/sw/source/uibase/frmdlg/colex.cxx +++ b/sw/source/uibase/frmdlg/colex.cxx @@ -46,8 +46,8 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) { const SvxFrameDirectionItem& rDirItem = static_cast<const SvxFrameDirectionItem&>(rSet.Get(RES_FRAMEDIR)); - m_bVertical = rDirItem.GetValue() == FRMDIR_VERT_TOP_RIGHT|| - rDirItem.GetValue() == FRMDIR_VERT_TOP_LEFT; + m_bVertical = rDirItem.GetValue() == SvxFrameDirection::Vertical_RL_TB|| + rDirItem.GetValue() == SvxFrameDirection::Vertical_LR_TB; } SfxItemPool* pPool = rSet.GetPool(); diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 4bf14b35c692..499cc63a85ea 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -587,13 +587,13 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) if( bLeftToRight ) { - aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) ); + aAttr.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) ); if( nAdjust == SvxAdjust::Right ) aAttr.Put( SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST ) ); } else { - aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) ); + aAttr.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR ) ); if( nAdjust == SvxAdjust::Left ) aAttr.Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) ); } @@ -821,13 +821,13 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) bool bFlag = false; switch( static_cast<const SvxFrameDirectionItem&>( aEditAttr.Get( EE_PARA_WRITINGDIR ) ).GetValue() ) { - case FRMDIR_HORI_LEFT_TOP: + case SvxFrameDirection::Horizontal_LR_TB: { bFlag = nWhich == SID_ATTR_PARA_LEFT_TO_RIGHT; rSet.Put( SfxBoolItem( nWhich, bFlag )); break; } - case FRMDIR_HORI_RIGHT_TOP: + case SvxFrameDirection::Horizontal_RL_TB: { bFlag = nWhich != SID_ATTR_PARA_LEFT_TO_RIGHT; rSet.Put( SfxBoolItem( nWhich, bFlag )); diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index cade0dfd07bc..59d12c4fcb97 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -532,13 +532,13 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) if( bLeftToRight ) { - aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) ); + aAttr.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_LR_TB, EE_PARA_WRITINGDIR ) ); if( nAdjust == SvxAdjust::Right ) aAttr.Put( SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST ) ); } else { - aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) ); + aAttr.Put( SvxFrameDirectionItem( SvxFrameDirection::Horizontal_RL_TB, EE_PARA_WRITINGDIR ) ); if( nAdjust == SvxAdjust::Left ) aAttr.Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) ); } @@ -815,11 +815,11 @@ ASK_ESCAPE: { switch( static_cast<const SvxFrameDirectionItem&>( aEditAttr.Get( EE_PARA_WRITINGDIR ) ).GetValue() ) { - case FRMDIR_HORI_LEFT_TOP: + case SvxFrameDirection::Horizontal_LR_TB: bFlag = nWhich == SID_ATTR_PARA_LEFT_TO_RIGHT; break; - case FRMDIR_HORI_RIGHT_TOP: + case SvxFrameDirection::Horizontal_RL_TB: bFlag = nWhich != SID_ATTR_PARA_LEFT_TO_RIGHT; break; default: diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 01083d12c01a..585222a38f59 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -171,7 +171,7 @@ static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh ) rSet.Put( aBrush ); // text direction in boxes - SvxFrameDirectionItem aBoxDirection( FRMDIR_ENVIRONMENT, RES_FRAMEDIR ); + SvxFrameDirectionItem aBoxDirection( SvxFrameDirection::Environment, RES_FRAMEDIR ); if(rSh.GetBoxDirection( aBoxDirection )) { aBoxDirection.SetWhich(FN_TABLE_BOX_TEXTORIENTATION); @@ -328,7 +328,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet, if(bBoxDirection) { - SvxFrameDirectionItem aDirection( FRMDIR_ENVIRONMENT, RES_FRAMEDIR ); + SvxFrameDirectionItem aDirection( SvxFrameDirection::Environment, RES_FRAMEDIR ); aDirection.SetValue(static_cast< const SvxFrameDirectionItem* >(pBoxDirection)->GetValue()); rSh.SetBoxDirection(aDirection); } diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index b0f753760721..efc78b4d727e 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -391,7 +391,7 @@ SET_LINESPACE: SvxFrameDirection eFrameDirection = (SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot) ? - FRMDIR_HORI_LEFT_TOP : FRMDIR_HORI_RIGHT_TOP; + SvxFrameDirection::Horizontal_LR_TB : SvxFrameDirection::Horizontal_RL_TB; aSet.Put( SvxFrameDirectionItem( eFrameDirection, RES_FRAMEDIR ) ); if (bChgAdjust) @@ -749,15 +749,15 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) { SvxFrameDirection eFrameDir = static_cast<const SvxFrameDirectionItem& >(aCoreSet.Get(RES_FRAMEDIR)).GetValue(); - if (FRMDIR_ENVIRONMENT == eFrameDir) + if (SvxFrameDirection::Environment == eFrameDir) { eFrameDir = rSh.IsInRightToLeftText() ? - FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP; + SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB; } bFlag = (SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot && - FRMDIR_HORI_LEFT_TOP == eFrameDir) || + SvxFrameDirection::Horizontal_LR_TB == eFrameDir) || (SID_ATTR_PARA_RIGHT_TO_LEFT == nSlot && - FRMDIR_HORI_RIGHT_TOP == eFrameDir); + SvxFrameDirection::Horizontal_RL_TB == eFrameDir); } else { diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx index cab5e7bbee24..99e49c2ce089 100644 --- a/sw/source/uibase/uiview/formatclipboard.cxx +++ b/sw/source/uibase/uiview/formatclipboard.cxx @@ -106,7 +106,7 @@ void lcl_getTableAttributes( SfxItemSet& rSet, SwWrtShell &rSh ) rSet.Put(aBoxInfo); rSh.GetTabBorders( rSet ); - SvxFrameDirectionItem aBoxDirection( FRMDIR_ENVIRONMENT, RES_FRAMEDIR ); + SvxFrameDirectionItem aBoxDirection( SvxFrameDirection::Environment, RES_FRAMEDIR ); if(rSh.GetBoxDirection( aBoxDirection )) { aBoxDirection.SetWhich(FN_TABLE_BOX_TEXTORIENTATION); @@ -209,7 +209,7 @@ void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh ) if( SfxItemState::SET == rSet.GetItemState( FN_TABLE_BOX_TEXTORIENTATION, false, &pItem) ) { - SvxFrameDirectionItem aDirection( FRMDIR_ENVIRONMENT, RES_FRAMEDIR ); + SvxFrameDirectionItem aDirection( SvxFrameDirection::Environment, RES_FRAMEDIR ); aDirection.SetValue(static_cast< const SvxFrameDirectionItem* >(pItem)->GetValue()); rSh.SetBoxDirection(aDirection); } diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index c656c404047b..98bf19dcfca2 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -1812,7 +1812,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) { // Columns on the page const SwFrameFormat& rMaster = rDesc.GetMaster(); SwFormatCol aCol(rMaster.GetCol()); - if(rFrameDir.GetValue() == FRMDIR_HORI_RIGHT_TOP) + if(rFrameDir.GetValue() == SvxFrameDirection::Horizontal_RL_TB) nNum = aCol.GetColumns().size() - nNum; else nNum--; |