diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-16 12:48:45 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-17 08:45:15 +0200 |
commit | 49561be0fd2041fc9d32c4ac1ab1063f620a4e08 (patch) | |
tree | 4345072ee14a3451e1b9b1bd0e646c146844665e | |
parent | 42ab2cfbd92bc30a62a2c126d4ad6d5726846d8b (diff) |
convert SvxTabAdjust to scoped enum
Change-Id: I29a33b8ea5daaa4b9059d024ffa4a99ca924f7ef
36 files changed, 154 insertions, 154 deletions
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index cf1de0fa319d..7bc84037e078 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -377,7 +377,7 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) const SvxTabStopItem& rTabItem = static_cast<const SvxTabStopItem&>(rInSet.Get( _nWhich )); SvxTabStopItem aNullTab( rTabItem ); - SvxTabStop aNull( 0, SVX_TAB_ADJUST_DEFAULT ); + SvxTabStop aNull( 0, SvxTabAdjust::Default ); aNullTab.Insert( aNull ); rOutSet->Put( aNullTab ); } diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index a560129f044f..6588e2a05679 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -74,7 +74,7 @@ void FillUpWithDefTabs_Impl( long nDefDist, SvxTabStopItem& rTabs ) if( rTabs.Count() ) return; { - SvxTabStop aSwTabStop( nDefDist, SVX_TAB_ADJUST_DEFAULT ); + SvxTabStop aSwTabStop( nDefDist, SvxTabAdjust::Default ); rTabs.Insert( aSwTabStop ); } } @@ -92,7 +92,7 @@ void TabWin_Impl::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) SvxTabulatorTabPage::SvxTabulatorTabPage(vcl::Window* pParent, const SfxItemSet& rAttr) : SfxTabPage(pParent, "ParagraphTabsPage","cui/ui/paratabspage.ui", &rAttr) , aAktTab(0) - , aNewTabs(0, 0, SVX_TAB_ADJUST_LEFT, GetWhich(SID_ATTR_TABSTOP)) + , aNewTabs(0, 0, SvxTabAdjust::Left, GetWhich(SID_ATTR_TABSTOP)) , nDefDist(0) , eDefUnit(FUNIT_100TH_MM) , bCheck(false) @@ -235,7 +235,7 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet) if (pLRSpace && static_cast<const SvxLRSpaceItem*>(pLRSpace)->GetTextFirstLineOfst() < 0) { - SvxTabStop aNull(0, SVX_TAB_ADJUST_DEFAULT); + SvxTabStop aNull(0, SvxTabAdjust::Default); aNewTabs.Insert(aNull); } @@ -379,7 +379,7 @@ void SvxTabulatorTabPage::InitTabPos_Impl( sal_uInt16 nTabPos ) // Correct current TabPos and default tabs for ( sal_uInt16 i = 0; i < aNewTabs.Count(); i++ ) { - if ( aNewTabs[i].GetAdjustment() != SVX_TAB_ADJUST_DEFAULT ) + if ( aNewTabs[i].GetAdjustment() != SvxTabAdjust::Default ) { m_pTabBox->InsertValue( m_pTabBox->Normalize( aNewTabs[i].GetTabPos() + nOffset ), eDefUnit ); @@ -424,18 +424,18 @@ void SvxTabulatorTabPage::SetFillAndTabType_Impl() m_pDezChar->Disable(); m_pDezCharLabel->Disable(); - if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_LEFT ) + if ( aAktTab.GetAdjustment() == SvxTabAdjust::Left ) pTypeBtn = m_pLeftTab; - else if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_RIGHT ) + else if ( aAktTab.GetAdjustment() == SvxTabAdjust::Right ) pTypeBtn = m_pRightTab; - else if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_DECIMAL ) + else if ( aAktTab.GetAdjustment() == SvxTabAdjust::Decimal ) { pTypeBtn = m_pDezTab; m_pDezChar->Enable(); m_pDezCharLabel->Enable(); m_pDezChar->SetText( OUString( (sal_Unicode)aAktTab.GetDecimal() ) ); } - else if ( aAktTab.GetAdjustment() == SVX_TAB_ADJUST_CENTER ) + else if ( aAktTab.GetAdjustment() == SvxTabAdjust::Center ) pTypeBtn = m_pCenterTab; if ( pTypeBtn ) @@ -494,14 +494,14 @@ IMPL_LINK_TYPED( SvxTabulatorTabPage, NewHdl_Impl, Button *, pBtn, void ) // Make ListBox entry m_pTabBox->InsertValue( m_pTabBox->Normalize( nVal ), eDefUnit, i ); aAktTab.GetTabPos() = nReal; - SvxTabAdjust eAdj = SVX_TAB_ADJUST_LEFT; + SvxTabAdjust eAdj = SvxTabAdjust::Left; if ( m_pRightTab->IsChecked() ) - eAdj = SVX_TAB_ADJUST_RIGHT; + eAdj = SvxTabAdjust::Right; else if ( m_pCenterTab->IsChecked() ) - eAdj = SVX_TAB_ADJUST_CENTER; + eAdj = SvxTabAdjust::Center; else if ( m_pDezTab->IsChecked() ) - eAdj = SVX_TAB_ADJUST_DECIMAL; + eAdj = SvxTabAdjust::Decimal; aAktTab.GetAdjustment() = eAdj; aNewTabs.Insert( aAktTab ); @@ -577,14 +577,14 @@ IMPL_LINK_TYPED( SvxTabulatorTabPage, TabTypeCheckHdl_Impl, Button *, pBox, void m_pDezChar->SetText( "" ); if ( pBox == m_pLeftTab ) - eAdj = SVX_TAB_ADJUST_LEFT; + eAdj = SvxTabAdjust::Left; else if ( pBox == m_pRightTab ) - eAdj = SVX_TAB_ADJUST_RIGHT; + eAdj = SvxTabAdjust::Right; else if ( pBox == m_pCenterTab ) - eAdj = SVX_TAB_ADJUST_CENTER; + eAdj = SvxTabAdjust::Center; else { - eAdj = SVX_TAB_ADJUST_DECIMAL; + eAdj = SvxTabAdjust::Decimal; m_pDezChar->Enable(); m_pDezCharLabel->Enable(); m_pDezChar->SetText( OUString( (sal_Unicode)aAktTab.GetDecimal() ) ); diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 1ae6ff31fabc..0f4a018696b9 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -1535,7 +1535,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) if ( rLRSpace.GetTextLeft() && ( rC.GetParaAttribs().GetItemState( EE_PARA_TABS ) == SfxItemState::SET ) ) { const SvxTabStopItem& rTabs = static_cast<const SvxTabStopItem&>(rC.GetParaAttribs().Get(EE_PARA_TABS)); - SvxTabStopItem aNewTabs( 0, 0, SVX_TAB_ADJUST_LEFT, EE_PARA_TABS ); + SvxTabStopItem aNewTabs( 0, 0, SvxTabAdjust::Left, EE_PARA_TABS ); for ( sal_uInt16 t = 0; t < rTabs.Count(); t++ ) { const SvxTabStop& rT = rTabs[ t ]; diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index a6e79f48ec97..f1bf58cd07c1 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -120,7 +120,7 @@ SfxPoolItem** GlobalEditData::GetDefItems() ppDefItems[12] = new SvxULSpaceItem( EE_PARA_ULSPACE ); ppDefItems[13] = new SvxLineSpacingItem( 0, EE_PARA_SBL ); ppDefItems[14] = new SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ); - ppDefItems[15] = new SvxTabStopItem( 0, 0, SVX_TAB_ADJUST_LEFT, EE_PARA_TABS ); + ppDefItems[15] = new SvxTabStopItem( 0, 0, SvxTabAdjust::Left, EE_PARA_TABS ); ppDefItems[16] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, EE_PARA_JUST_METHOD ); ppDefItems[17] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, EE_PARA_VER_JUST ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index ff612cb13d01..f8917685c583 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -945,15 +945,15 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) // Switch direction in R2L para... if ( bRightToLeftPara ) { - if ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_RIGHT ) - aCurrentTab.aTabStop.GetAdjustment() = SVX_TAB_ADJUST_LEFT; - else if ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_LEFT ) - aCurrentTab.aTabStop.GetAdjustment() = SVX_TAB_ADJUST_RIGHT; + if ( aCurrentTab.aTabStop.GetAdjustment() == SvxTabAdjust::Right ) + aCurrentTab.aTabStop.GetAdjustment() = SvxTabAdjust::Left; + else if ( aCurrentTab.aTabStop.GetAdjustment() == SvxTabAdjust::Left ) + aCurrentTab.aTabStop.GetAdjustment() = SvxTabAdjust::Right; } - if ( ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_RIGHT ) || - ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_CENTER ) || - ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_DECIMAL ) ) + if ( ( aCurrentTab.aTabStop.GetAdjustment() == SvxTabAdjust::Right ) || + ( aCurrentTab.aTabStop.GetAdjustment() == SvxTabAdjust::Center ) || + ( aCurrentTab.aTabStop.GetAdjustment() == SvxTabAdjust::Decimal ) ) { // For LEFT / DEFAULT this tab is not considered. aCurrentTab.bValid = true; @@ -1135,14 +1135,14 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) nWidthAfterTab += rTP.GetSize().Width(); } long nW = nWidthAfterTab; // Length before tab position - if ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_RIGHT ) + if ( aCurrentTab.aTabStop.GetAdjustment() == SvxTabAdjust::Right ) { } - else if ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_CENTER ) + else if ( aCurrentTab.aTabStop.GetAdjustment() == SvxTabAdjust::Center ) { nW = nWidthAfterTab/2; } - else if ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_DECIMAL ) + else if ( aCurrentTab.aTabStop.GetAdjustment() == SvxTabAdjust::Decimal ) { OUString aText = GetSelected( EditSelection( EditPaM( pParaPortion->GetNode(), nTmpPos ), EditPaM( pParaPortion->GetNode(), nTmpPos + pPortion->GetLen() ) ) ); diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index ab7f1c197f25..0f5decdeab10 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -785,7 +785,7 @@ SvStream& SvxHyphenZoneItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ SvxTabStop::SvxTabStop() { nTabPos = 0; - eAdjustment = SVX_TAB_ADJUST_LEFT; + eAdjustment = SvxTabAdjust::Left; m_cDecimal = cDfltDecimalChar; cFill = cDfltFillChar; } @@ -814,7 +814,7 @@ SvxTabStopItem::SvxTabStopItem( sal_uInt16 _nWhich ) : maTabStops() { const sal_uInt16 nTabs = SVX_TAB_DEFCOUNT, nDist = SVX_TAB_DEFDIST; - const SvxTabAdjust eAdjst= SVX_TAB_ADJUST_DEFAULT; + const SvxTabAdjust eAdjst= SvxTabAdjust::Default; for (sal_uInt16 i = 0; i < nTabs; ++i) { @@ -883,11 +883,11 @@ bool SvxTabStopItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const pArr[i].Position = bConvert ? convertTwipToMm100(rTab.GetTabPos()) : rTab.GetTabPos(); switch(rTab.GetAdjustment()) { - case SVX_TAB_ADJUST_LEFT : pArr[i].Alignment = style::TabAlign_LEFT; break; - case SVX_TAB_ADJUST_RIGHT : pArr[i].Alignment = style::TabAlign_RIGHT; break; - case SVX_TAB_ADJUST_DECIMAL: pArr[i].Alignment = style::TabAlign_DECIMAL; break; - case SVX_TAB_ADJUST_CENTER : pArr[i].Alignment = style::TabAlign_CENTER; break; - default: //SVX_TAB_ADJUST_DEFAULT + case SvxTabAdjust::Left : pArr[i].Alignment = style::TabAlign_LEFT; break; + case SvxTabAdjust::Right : pArr[i].Alignment = style::TabAlign_RIGHT; break; + case SvxTabAdjust::Decimal: pArr[i].Alignment = style::TabAlign_DECIMAL; break; + case SvxTabAdjust::Center : pArr[i].Alignment = style::TabAlign_CENTER; break; + default: //SvxTabAdjust::Default pArr[i].Alignment = style::TabAlign_DEFAULT; } @@ -964,13 +964,13 @@ bool SvxTabStopItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) const sal_uInt16 nCount = (sal_uInt16)aSeq.getLength(); for(sal_uInt16 i = 0; i < nCount ; i++) { - SvxTabAdjust eAdjust = SVX_TAB_ADJUST_DEFAULT; + SvxTabAdjust eAdjust = SvxTabAdjust::Default; switch(pArr[i].Alignment) { - case style::TabAlign_LEFT : eAdjust = SVX_TAB_ADJUST_LEFT; break; - case style::TabAlign_CENTER : eAdjust = SVX_TAB_ADJUST_CENTER; break; - case style::TabAlign_RIGHT : eAdjust = SVX_TAB_ADJUST_RIGHT; break; - case style::TabAlign_DECIMAL: eAdjust = SVX_TAB_ADJUST_DECIMAL; break; + case style::TabAlign_LEFT : eAdjust = SvxTabAdjust::Left; break; + case style::TabAlign_CENTER : eAdjust = SvxTabAdjust::Center; break; + case style::TabAlign_RIGHT : eAdjust = SvxTabAdjust::Right; break; + case style::TabAlign_DECIMAL: eAdjust = SvxTabAdjust::Decimal; break; default: ;//prevent warning } sal_Unicode cFill = pArr[i].FillChar; @@ -1039,7 +1039,7 @@ bool SvxTabStopItem::GetPresentation for ( sal_uInt16 i = 0; i < Count(); ++i ) { - if ( SVX_TAB_ADJUST_DEFAULT != ((*this)[i]).GetAdjustment() ) + if ( SvxTabAdjust::Default != ((*this)[i]).GetAdjustment() ) { if ( bComma ) rText += ","; @@ -1061,7 +1061,7 @@ SfxPoolItem* SvxTabStopItem::Create( SvStream& rStrm, sal_uInt16 ) const sal_Int8 nTabs; rStrm.ReadSChar( nTabs ); SvxTabStopItem* pAttr = - new SvxTabStopItem( 0, 0, SVX_TAB_ADJUST_DEFAULT, Which() ); + new SvxTabStopItem( 0, 0, SvxTabAdjust::Default, Which() ); for ( sal_Int8 i = 0; i < nTabs; i++ ) { @@ -1069,7 +1069,7 @@ SfxPoolItem* SvxTabStopItem::Create( SvStream& rStrm, sal_uInt16 ) const sal_Int8 eAdjust; unsigned char cDecimal, cFill; rStrm.ReadInt32( nPos ).ReadSChar( eAdjust ).ReadUChar( cDecimal ).ReadUChar( cFill ); - if( !i || SVX_TAB_ADJUST_DEFAULT != eAdjust ) + if( !i || SvxTabAdjust::Default != (SvxTabAdjust)eAdjust ) pAttr->Insert( SvxTabStop ( nPos, (SvxTabAdjust)eAdjust, sal_Unicode(cDecimal), sal_Unicode(cFill) ) ); } @@ -1113,7 +1113,7 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) { const SvxTabStop& rTab = (*this)[ i ]; rStrm.WriteInt32( rTab.GetTabPos() ) - .WriteSChar( rTab.GetAdjustment() ) + .WriteSChar( (char)rTab.GetAdjustment() ) .WriteUChar( rTab.GetDecimal() ) .WriteUChar( rTab.GetFill() ); } @@ -1121,9 +1121,9 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) if ( bStoreDefTabs ) for( ; nCount; --nCount ) { - SvxTabStop aSwTabStop(nNew, SVX_TAB_ADJUST_DEFAULT); + SvxTabStop aSwTabStop(nNew, SvxTabAdjust::Default); rStrm.WriteInt32( aSwTabStop.GetTabPos() ) - .WriteSChar( aSwTabStop.GetAdjustment() ) + .WriteSChar( (char)aSwTabStop.GetAdjustment() ) .WriteUChar( aSwTabStop.GetDecimal() ) .WriteUChar( aSwTabStop.GetFill() ); nNew += nDefDist; diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index ff4afc633ac0..fe6440979752 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -1282,7 +1282,7 @@ void SvxRTFParser::ReadTabAttr( int nToken, SfxItemSet& rSet ) bool bMethodOwnsToken = false; // #i52542# patch from cmc. // then read all the TabStops SvxTabStop aTabStop; - SvxTabStopItem aAttr( 0, 0, SVX_TAB_ADJUST_DEFAULT, aPardMap.nTabStop ); + SvxTabStopItem aAttr( 0, 0, SvxTabAdjust::Default, aPardMap.nTabStop ); bool bContinue = true; do { switch( nToken ) @@ -1299,16 +1299,16 @@ void SvxRTFParser::ReadTabAttr( int nToken, SfxItemSet& rSet ) break; case RTF_TQL: - aTabStop.GetAdjustment() = SVX_TAB_ADJUST_LEFT; + aTabStop.GetAdjustment() = SvxTabAdjust::Left; break; case RTF_TQR: - aTabStop.GetAdjustment() = SVX_TAB_ADJUST_RIGHT; + aTabStop.GetAdjustment() = SvxTabAdjust::Right; break; case RTF_TQC: - aTabStop.GetAdjustment() = SVX_TAB_ADJUST_CENTER; + aTabStop.GetAdjustment() = SvxTabAdjust::Center; break; case RTF_TQDEC: - aTabStop.GetAdjustment() = SVX_TAB_ADJUST_DECIMAL; + aTabStop.GetAdjustment() = SvxTabAdjust::Decimal; break; case RTF_TLDOT: aTabStop.GetFill() = '.'; break; @@ -1873,9 +1873,9 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) // we want Defaulttabs SvxTabStopItem aNewTab( nTabCount, sal_uInt16(nValue), - SVX_TAB_ADJUST_DEFAULT, aPardMap.nTabStop ); + SvxTabAdjust::Default, aPardMap.nTabStop ); while( nTabCount ) - ((SvxTabStop&)aNewTab[ --nTabCount ]).GetAdjustment() = SVX_TAB_ADJUST_DEFAULT; + ((SvxTabStop&)aNewTab[ --nTabCount ]).GetAdjustment() = SvxTabAdjust::Default; pAttrPool->SetPoolDefaultItem( aNewTab ); } diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 01ce1253db1b..1ab146ee08fe 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -6324,7 +6324,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& GetAttrib( PPT_ParaAttr_BulletOfs, nTab, nDestinationInstance ); GetAttrib( PPT_ParaAttr_BulletOn, i, nDestinationInstance ); GetAttrib( PPT_ParaAttr_DefaultTab, nDefaultTab, nDestinationInstance ); - SvxTabStopItem aTabItem( 0, 0, SVX_TAB_ADJUST_DEFAULT, EE_PARA_TABS ); + SvxTabStopItem aTabItem( 0, 0, SvxTabAdjust::Default, EE_PARA_TABS ); if ( GetTabCount() ) { //paragraph offset = MIN(first_line_offset, hanging_offset) @@ -6335,10 +6335,10 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >& nTab = GetTabOffsetByIndex( (sal_uInt16)i ); switch( GetTabStyleByIndex( (sal_uInt16)i ) ) { - case 1 : eTabAdjust = SVX_TAB_ADJUST_CENTER; break; - case 2 : eTabAdjust = SVX_TAB_ADJUST_RIGHT; break; - case 3 : eTabAdjust = SVX_TAB_ADJUST_DECIMAL; break; - default : eTabAdjust = SVX_TAB_ADJUST_LEFT; + case 1 : eTabAdjust = SvxTabAdjust::Center; break; + case 2 : eTabAdjust = SvxTabAdjust::Right; break; + case 3 : eTabAdjust = SvxTabAdjust::Decimal; break; + default : eTabAdjust = SvxTabAdjust::Left; } if ( nTab > nParaOffset )//If tab stop greater than paragraph offset aTabItem.Insert( SvxTabStop( ( ( (long( nTab - nTextOfs2 )) * 2540 ) / 576 ), eTabAdjust ) ); diff --git a/include/editeng/svxenum.hxx b/include/editeng/svxenum.hxx index 0ce5a69aeea2..e624f574100e 100644 --- a/include/editeng/svxenum.hxx +++ b/include/editeng/svxenum.hxx @@ -48,14 +48,14 @@ enum SvxShadowLocation SVX_SHADOW_END }; -enum SvxTabAdjust -{ - SVX_TAB_ADJUST_LEFT = 0, - SVX_TAB_ADJUST_RIGHT, - SVX_TAB_ADJUST_DECIMAL, - SVX_TAB_ADJUST_CENTER, - SVX_TAB_ADJUST_DEFAULT, - SVX_TAB_ADJUST_END +enum class SvxTabAdjust +{ + Left, + Right, + Decimal, + Center, + Default, + End }; enum class SvxLineSpaceRule diff --git a/include/editeng/tstpitem.hxx b/include/editeng/tstpitem.hxx index 516ae0bdcef8..ca8db68f3128 100644 --- a/include/editeng/tstpitem.hxx +++ b/include/editeng/tstpitem.hxx @@ -46,7 +46,7 @@ private: public: SvxTabStop(); explicit SvxTabStop( const sal_Int32 nPos, - const SvxTabAdjust eAdjst = SVX_TAB_ADJUST_LEFT, + const SvxTabAdjust eAdjst = SvxTabAdjust::Left, const sal_Unicode cDec = cDfltDecimalChar, const sal_Unicode cFil = cDfltFillChar ); @@ -104,7 +104,7 @@ public: explicit SvxTabStopItem( sal_uInt16 nWhich ); SvxTabStopItem( const sal_uInt16 nTabs, const sal_uInt16 nDist, - const SvxTabAdjust eAdjst /*= SVX_TAB_ADJUST_DEFAULT*/, + const SvxTabAdjust eAdjst /*= SvxTabAdjust::Default*/, sal_uInt16 nWhich ); SvxTabStopItem( const SvxTabStopItem& rTSI ); diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index 7504522b9c01..7d05af05d1ad 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -1039,11 +1039,11 @@ sal_uInt16 ToSvTab_Impl(SvxTabAdjust eAdj) { /* Internal conversion routine between SV-Tab.-Enum and Svx */ switch(eAdj) { - case SVX_TAB_ADJUST_LEFT: return RULER_TAB_LEFT; - case SVX_TAB_ADJUST_RIGHT: return RULER_TAB_RIGHT; - case SVX_TAB_ADJUST_DECIMAL: return RULER_TAB_DECIMAL; - case SVX_TAB_ADJUST_CENTER: return RULER_TAB_CENTER; - case SVX_TAB_ADJUST_DEFAULT: return RULER_TAB_DEFAULT; + case SvxTabAdjust::Left: return RULER_TAB_LEFT; + case SvxTabAdjust::Right: return RULER_TAB_RIGHT; + case SvxTabAdjust::Decimal: return RULER_TAB_DECIMAL; + case SvxTabAdjust::Center: return RULER_TAB_CENTER; + case SvxTabAdjust::Default: return RULER_TAB_DEFAULT; default: ; //prevent warning } return 0; @@ -1052,13 +1052,13 @@ sal_uInt16 ToSvTab_Impl(SvxTabAdjust eAdj) SvxTabAdjust ToAttrTab_Impl(sal_uInt16 eAdj) { switch(eAdj) { - case RULER_TAB_LEFT: return SVX_TAB_ADJUST_LEFT ; - case RULER_TAB_RIGHT: return SVX_TAB_ADJUST_RIGHT ; - case RULER_TAB_DECIMAL: return SVX_TAB_ADJUST_DECIMAL ; - case RULER_TAB_CENTER: return SVX_TAB_ADJUST_CENTER ; - case RULER_TAB_DEFAULT: return SVX_TAB_ADJUST_DEFAULT ; + case RULER_TAB_LEFT: return SvxTabAdjust::Left ; + case RULER_TAB_RIGHT: return SvxTabAdjust::Right ; + case RULER_TAB_DECIMAL: return SvxTabAdjust::Decimal ; + case RULER_TAB_CENTER: return SvxTabAdjust::Center ; + case RULER_TAB_DEFAULT: return SvxTabAdjust::Default ; } - return SVX_TAB_ADJUST_LEFT; + return SvxTabAdjust::Left; } void SvxRuler::UpdateTabs() @@ -2174,7 +2174,7 @@ void SvxRuler::ApplyTabs() //remove default tab stops for ( sal_uInt16 i = 0; i < pItem->Count(); ) { - if ( SVX_TAB_ADJUST_DEFAULT == (*pItem)[i].GetAdjustment() ) + if ( SvxTabAdjust::Default == (*pItem)[i].GetAdjustment() ) { pItem->Remove(i); continue; diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index 63cf28621892..e0656b6fda4f 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -224,7 +224,7 @@ struct SW_DLLPUBLIC SwFormToken nTabStopPosition(0), eTokenType(eType), nPoolId(USHRT_MAX), - eTabAlign( SVX_TAB_ADJUST_LEFT ), + eTabAlign( SvxTabAdjust::Left ), nChapterFormat(0 /*CF_NUMBER*/), nOutlineLevel(MAXLEVEL), //default to maximum outline level nAuthorityField(0 /*AUTH_FIELD_IDENTIFIER*/), diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 8456d1e660b1..6992630607f6 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -545,7 +545,7 @@ void InitCore() aAttrTab[ RES_PARATR_SPLIT- POOLATTR_BEGIN ] = new SvxFormatSplitItem( true, RES_PARATR_SPLIT ); aAttrTab[ RES_PARATR_WIDOWS- POOLATTR_BEGIN ] = new SvxWidowsItem( 0, RES_PARATR_WIDOWS ); aAttrTab[ RES_PARATR_ORPHANS- POOLATTR_BEGIN ] = new SvxOrphansItem( 0, RES_PARATR_ORPHANS ); - aAttrTab[ RES_PARATR_TABSTOP- POOLATTR_BEGIN ] = new SvxTabStopItem( 1, SVX_TAB_DEFDIST, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); + aAttrTab[ RES_PARATR_TABSTOP- POOLATTR_BEGIN ] = new SvxTabStopItem( 1, SVX_TAB_DEFDIST, SvxTabAdjust::Default, RES_PARATR_TABSTOP ); pItem = new SvxHyphenZoneItem( false, RES_PARATR_HYPHENZONE ); static_cast<SvxHyphenZoneItem*>(pItem)->GetMaxHyphens() = 0; // Default: 0 diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 8bda2586c9ac..cffded83b77e 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -230,9 +230,9 @@ namespace if( bTab ) { long nRightMargin = lcl_GetRightMargin( *pDoc ); - SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); + SvxTabStopItem aTStops( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP ); aTStops.Insert( SvxTabStop( nRightMargin - nLeft, - SVX_TAB_ADJUST_RIGHT, + SvxTabAdjust::Right, cDfltDecimalChar, '.' )); rSet.Put( aTStops ); } @@ -582,9 +582,9 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId, long nRightMargin = lcl_GetRightMargin( m_rDoc ); - SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); - aTStops.Insert( SvxTabStop( nRightMargin / 2, SVX_TAB_ADJUST_CENTER ) ); - aTStops.Insert( SvxTabStop( nRightMargin, SVX_TAB_ADJUST_RIGHT ) ); + SvxTabStopItem aTStops( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP ); + aTStops.Insert( SvxTabStop( nRightMargin / 2, SvxTabAdjust::Center ) ); + aTStops.Insert( SvxTabStop( nRightMargin, SvxTabAdjust::Right ) ); aSet.Put( aTStops ); } diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index a86172306490..134917c22692 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -529,7 +529,7 @@ static bool lcl_SetNewDefTabStops( SwTwips nOldWidth, SwTwips nNewWidth, // Find the default's beginning sal_uInt16 n; for( n = nOldCnt; n ; --n ) - if( SVX_TAB_ADJUST_DEFAULT != rChgTabStop[n - 1].GetAdjustment() ) + if( SvxTabAdjust::Default != rChgTabStop[n - 1].GetAdjustment() ) break; ++n; if( n < nOldCnt ) // delete the DefTabStops diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 6c544e75fbca..97b6e92ae13f 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -515,11 +515,11 @@ css::uno::Sequence< css::style::TabStop > SwTextFrame::GetTabStopInfo( SwTwips C ts.FillChar = pTS->GetFill(); switch( pTS->GetAdjustment() ) { - case SVX_TAB_ADJUST_LEFT : ts.Alignment = css::style::TabAlign_LEFT; break; - case SVX_TAB_ADJUST_CENTER : ts.Alignment = css::style::TabAlign_CENTER; break; - case SVX_TAB_ADJUST_RIGHT : ts.Alignment = css::style::TabAlign_RIGHT; break; - case SVX_TAB_ADJUST_DECIMAL: ts.Alignment = css::style::TabAlign_DECIMAL; break; - case SVX_TAB_ADJUST_DEFAULT: ts.Alignment = css::style::TabAlign_DEFAULT; break; + case SvxTabAdjust::Left : ts.Alignment = css::style::TabAlign_LEFT; break; + case SvxTabAdjust::Center : ts.Alignment = css::style::TabAlign_CENTER; break; + case SvxTabAdjust::Right : ts.Alignment = css::style::TabAlign_RIGHT; break; + case SvxTabAdjust::Decimal: ts.Alignment = css::style::TabAlign_DECIMAL; break; + case SvxTabAdjust::Default: ts.Alignment = css::style::TabAlign_DEFAULT; break; default: break; // prevent warning } diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index deff44ac2545..d98ed5dcfde0 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -110,14 +110,14 @@ void SwLineInfo::CtorInitLineInfo( const SwAttrSet& rAttrSet, // insert the list tab stop into SvxTabItem instance <pRuler> const SvxTabStop aListTabStop( nListTabStopPosition, - SVX_TAB_ADJUST_LEFT ); + SvxTabAdjust::Left ); pRuler->Insert( aListTabStop ); // remove default tab stops, which are before the inserted list tab stop for ( sal_uInt16 i = 0; i < pRuler->Count(); i++ ) { if ( (*pRuler)[i].GetTabPos() < nListTabStopPosition && - (*pRuler)[i].GetAdjustment() == SVX_TAB_ADJUST_DEFAULT ) + (*pRuler)[i].GetAdjustment() == SvxTabAdjust::Default ) { pRuler->Remove(i); continue; @@ -131,7 +131,7 @@ void SwLineInfo::CtorInitLineInfo( const SwAttrSet& rAttrSet, for ( sal_uInt16 i = 0; i < pRuler->Count(); i++ ) { if ( (*pRuler)[i].GetTabPos() == 0 && - (*pRuler)[i].GetAdjustment() == SVX_TAB_ADJUST_DEFAULT ) + (*pRuler)[i].GetAdjustment() == SvxTabAdjust::Default ) { pRuler->Remove(i); break; diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx index fe7dbcfdba5c..553376d18a0b 100644 --- a/sw/source/core/text/txttab.cxx +++ b/sw/source/core/text/txttab.cxx @@ -136,7 +136,7 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto cDec = pTabStop->GetDecimal(); eAdj = pTabStop->GetAdjustment(); nNextPos = pTabStop->GetTabPos(); - if(!bTabsRelativeToIndent && eAdj == SVX_TAB_ADJUST_DEFAULT && nSearchPos < 0) + if(!bTabsRelativeToIndent && eAdj == SvxTabAdjust::Default && nSearchPos < 0) { //calculate default tab position of default tabs in negative indent nNextPos = ( nSearchPos / nNextPos ) * nNextPos; @@ -176,7 +176,7 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto nNextPos += nDefTabDist; } cFill = 0; - eAdj = SVX_TAB_ADJUST_LEFT; + eAdj = SvxTabAdjust::Left; } // #i115705# - correction and refactoring: @@ -234,10 +234,10 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto get(DocumentSettingId::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST); if ( bTabAtLeftMarginAllowed ) { - if ( !pTabStop || eAdj == SVX_TAB_ADJUST_DEFAULT || + if ( !pTabStop || eAdj == SvxTabAdjust::Default || ( nNextPos > nLeftMarginTabPos ) ) { - eAdj = SVX_TAB_ADJUST_DEFAULT; + eAdj = SvxTabAdjust::Default; cFill = 0; nNextPos = nLeftMarginTabPos; } @@ -253,7 +253,7 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto SwTabPortion *pTabPor = nullptr; if ( bAuto ) { - if ( SVX_TAB_ADJUST_DECIMAL == eAdj && + if ( SvxTabAdjust::Decimal == eAdj && 1 == m_aLineInf.NumberOfTabStops() ) pTabPor = new SwAutoTabDecimalPortion( nNewTabPos, cDec, cFill ); } @@ -261,24 +261,24 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto { switch( eAdj ) { - case SVX_TAB_ADJUST_RIGHT : + case SvxTabAdjust::Right : { pTabPor = new SwTabRightPortion( nNewTabPos, cFill ); break; } - case SVX_TAB_ADJUST_CENTER : + case SvxTabAdjust::Center : { pTabPor = new SwTabCenterPortion( nNewTabPos, cFill ); break; } - case SVX_TAB_ADJUST_DECIMAL : + case SvxTabAdjust::Decimal : { pTabPor = new SwTabDecimalPortion( nNewTabPos, cDec, cFill ); break; } default: { - OSL_ENSURE( SVX_TAB_ADJUST_LEFT == eAdj || SVX_TAB_ADJUST_DEFAULT == eAdj, + OSL_ENSURE( SvxTabAdjust::Left == eAdj || SvxTabAdjust::Default == eAdj, "+SwTextFormatter::NewTabPortion: unknown adjustment" ); pTabPor = new SwTabLeftPortion( nNewTabPos, cFill, bAutoTabStop ); break; diff --git a/sw/source/core/tox/ToxTabStopTokenHandler.cxx b/sw/source/core/tox/ToxTabStopTokenHandler.cxx index 3b6ae4b060c4..f31e0456fcc3 100644 --- a/sw/source/core/tox/ToxTabStopTokenHandler.cxx +++ b/sw/source/core/tox/ToxTabStopTokenHandler.cxx @@ -47,7 +47,7 @@ DefaultToxTabStopTokenHandler::HandleTabStopToken( } // check whether a tab adjustment has been specified. - if (SVX_TAB_ADJUST_END > aToken.eTabAlign) { + if (SvxTabAdjust::End > aToken.eTabAlign) { const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>( targetNode.SwContentNode::GetAttr(RES_LR_SPACE) ); long nTabPosition = aToken.nTabStopPosition; @@ -76,7 +76,7 @@ DefaultToxTabStopTokenHandler::HandleTabStopToken( nRightMargin -= rLRSpace.GetTextFirstLineOfst(); } - result.tabStop = SvxTabStop(nRightMargin, SVX_TAB_ADJUST_RIGHT, cDfltDecimalChar, aToken.cTabFillChar); + result.tabStop = SvxTabStop(nRightMargin, SvxTabAdjust::Right, cDfltDecimalChar, aToken.cTabFillChar); return result; } diff --git a/sw/source/core/tox/ToxTextGenerator.cxx b/sw/source/core/tox/ToxTextGenerator.cxx index 7edfa8e4ad02..185cac4973ca 100644 --- a/sw/source/core/tox/ToxTextGenerator.cxx +++ b/sw/source/core/tox/ToxTextGenerator.cxx @@ -173,7 +173,7 @@ ToxTextGenerator::GenerateText(SwDoc* pDoc, const std::vector<SwTOXSortTabBase*> sal_uInt16 nLvl = rBase.GetLevel(); OSL_ENSURE( nLvl < mToxForm.GetFormMax(), "invalid FORM_LEVEL"); - SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); + SvxTabStopItem aTStops( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP ); // create an enumerator // #i21237# SwFormTokens aPattern = mToxForm.GetPattern(nLvl); diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index 1aa5501e68cf..70f58388125f 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -264,7 +264,7 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237# // #i36870# right aligned tab for all aToken.cTabFillChar = '.'; - aToken.eTabAlign = SVX_TAB_ADJUST_END; + aToken.eTabAlign = SvxTabAdjust::End; aTokens.push_back(aToken); aTokens.push_back(SwFormToken(TOKEN_PAGE_NUMS)); @@ -385,7 +385,7 @@ void SwForm::AdjustTabStops( SwDoc& rDoc ) // #i21237# { const SvxTabStop& rTab = rTabStops[nTab]; - if ( rTab.GetAdjustment() == SVX_TAB_ADJUST_DEFAULT ) + if ( rTab.GetAdjustment() == SvxTabAdjust::Default ) continue; // ignore the default tab stop aIt = find_if( aIt, aCurrentPattern.end(), SwFormTokenEqualToFormTokenType(TOKEN_TAB_STOP) ); @@ -395,8 +395,8 @@ void SwForm::AdjustTabStops( SwDoc& rDoc ) // #i21237# aIt->nTabStopPosition = rTab.GetTabPos(); aIt->eTabAlign = ( nTab == nTabCount - 1 - && rTab.GetAdjustment() == SVX_TAB_ADJUST_RIGHT ) - ? SVX_TAB_ADJUST_END + && rTab.GetAdjustment() == SvxTabAdjust::Right ) + ? SvxTabAdjust::End : rTab.GetAdjustment(); aIt->cTabFillChar = rTab.GetFill(); ++aIt; diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index fbf405961139..3886968cd67d 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -2871,7 +2871,7 @@ throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, { const bool bRight = lcl_AnyToBool(pProperties[j].Value); aToken.eTabAlign = bRight ? - SVX_TAB_ADJUST_END : SVX_TAB_ADJUST_LEFT; + SvxTabAdjust::End : SvxTabAdjust::Left; } else if ( pProperties[j].Name == "TabStopPosition" ) { @@ -3114,7 +3114,7 @@ throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, pArr[0].Name = "TokenType"; pArr[0].Value <<= OUString("TokenTabStop"); - if(SVX_TAB_ADJUST_END == aToken.eTabAlign) + if(SvxTabAdjust::End == aToken.eTabAlign) { pArr[1].Name = "TabStopRightAligned"; pArr[1].Value <<= true; diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 03a5b9db186b..397bead2b84c 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -7088,17 +7088,17 @@ static void impl_WriteTabElement( FSHelperPtr const & pSerializer, switch (rTab.GetAdjustment()) { - case SVX_TAB_ADJUST_RIGHT: + case SvxTabAdjust::Right: pTabElementAttrList->add( FSNS( XML_w, XML_val ), OString( "right" ) ); break; - case SVX_TAB_ADJUST_DECIMAL: + case SvxTabAdjust::Decimal: pTabElementAttrList->add( FSNS( XML_w, XML_val ), OString( "decimal" ) ); break; - case SVX_TAB_ADJUST_CENTER: + case SvxTabAdjust::Center: pTabElementAttrList->add( FSNS( XML_w, XML_val ), OString( "center" ) ); break; - case SVX_TAB_ADJUST_DEFAULT: - case SVX_TAB_ADJUST_LEFT: + case SvxTabAdjust::Default: + case SvxTabAdjust::Left: default: pTabElementAttrList->add( FSNS( XML_w, XML_val ), OString( "left" ) ); break; @@ -7134,7 +7134,7 @@ void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop ) // <w:tabs> must contain at least one <w:tab>, so don't write it empty if( nCount == 0 ) return; - if( nCount == 1 && rTabStop[ 0 ].GetAdjustment() == SVX_TAB_ADJUST_DEFAULT ) + if( nCount == 1 && rTabStop[ 0 ].GetAdjustment() == SvxTabAdjust::Default ) { GetExport().setDefaultTabStop( rTabStop[ 0 ].GetTabPos()); return; @@ -7144,7 +7144,7 @@ void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop ) for (sal_uInt16 i = 0; i < nCount; i++ ) { - if( rTabStop[i].GetAdjustment() != SVX_TAB_ADJUST_DEFAULT ) + if( rTabStop[i].GetAdjustment() != SvxTabAdjust::Default ) impl_WriteTabElement( m_pSerializer, rTabStop[i], nCurrentLeft ); else GetExport().setDefaultTabStop( rTabStop[i].GetTabPos()); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 4bff6f8ff2b4..f7cc478572a9 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -2750,7 +2750,7 @@ void RtfAttributeOutput::ParaTabStop(const SvxTabStopItem& rTabStop) for (sal_uInt16 n = 0; n < rTabStop.Count(); n++) { const SvxTabStop& rTS = rTabStop[ n ]; - if (SVX_TAB_ADJUST_DEFAULT != rTS.GetAdjustment()) + if (SvxTabAdjust::Default != rTS.GetAdjustment()) { const char* pFill = nullptr; switch (rTS.GetFill()) @@ -2779,13 +2779,13 @@ void RtfAttributeOutput::ParaTabStop(const SvxTabStopItem& rTabStop) const sal_Char* pAdjStr = nullptr; switch (rTS.GetAdjustment()) { - case SVX_TAB_ADJUST_RIGHT: + case SvxTabAdjust::Right: pAdjStr = OOO_STRING_SVTOOLS_RTF_TQR; break; - case SVX_TAB_ADJUST_DECIMAL: + case SvxTabAdjust::Decimal: pAdjStr = OOO_STRING_SVTOOLS_RTF_TQDEC; break; - case SVX_TAB_ADJUST_CENTER: + case SvxTabAdjust::Center: pAdjStr = OOO_STRING_SVTOOLS_RTF_TQC; break; default: diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index dfdb32175318..4eb59c56b6ee 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -630,7 +630,7 @@ void MSWordExportBase::CorrectTabStopInSet( SfxItemSet& rSet, sal_uInt16 nAbsLef for ( sal_uInt16 nCnt = 0; nCnt < aTStop.Count(); ++nCnt ) { SvxTabStop& rTab = (SvxTabStop&)aTStop[ nCnt ]; - if ( SVX_TAB_ADJUST_DEFAULT != rTab.GetAdjustment() && + if ( SvxTabAdjust::Default != rTab.GetAdjustment() && rTab.GetTabPos() >= nAbsLeft ) { rTab.GetTabPos() -= nAbsLeft; @@ -4547,13 +4547,13 @@ void SwWW8WrTabu::Add(const SvxTabStop & rTS, long nAdjustment) sal_uInt8 nPara = 0; switch (rTS.GetAdjustment()) { - case SVX_TAB_ADJUST_RIGHT: + case SvxTabAdjust::Right: nPara = 2; break; - case SVX_TAB_ADJUST_CENTER: + case SvxTabAdjust::Center: nPara = 1; break; - case SVX_TAB_ADJUST_DECIMAL: + case SvxTabAdjust::Decimal: /* Theres nothing we can do btw the decimal separator has been customized, but if you think different remember that different @@ -4634,7 +4634,7 @@ static void ParaTabStopAdd( WW8Export& rWrt, { const SvxTabStop& rTS = rTStops[n]; // Def-Tabs ignorieren - if (SVX_TAB_ADJUST_DEFAULT != rTS.GetAdjustment()) + if (SvxTabAdjust::Default != rTS.GetAdjustment()) aTab.Add(rTS, nLParaMgn); } aTab.PutAll( rWrt ); @@ -4669,7 +4669,7 @@ static void ParaTabStopDelAdd( WW8Export& rWrt, { pTO = &rTStyle[ nO ]; nOP = pTO->GetTabPos() + nLStypeMgn; - if( SVX_TAB_ADJUST_DEFAULT == pTO->GetAdjustment() ) + if( SvxTabAdjust::Default == pTO->GetAdjustment() ) { nO++; // Default-Tab ignorieren continue; @@ -4687,7 +4687,7 @@ static void ParaTabStopDelAdd( WW8Export& rWrt, { pTN = &rTNew[ nN ]; nNP = pTN->GetTabPos() + nLParaMgn; - if( SVX_TAB_ADJUST_DEFAULT == pTN->GetAdjustment() ) + if( SvxTabAdjust::Default == pTN->GetAdjustment() ) { nN++; // Default-Tab ignorieren continue; @@ -4747,7 +4747,7 @@ void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops ) m_rWW8Export.m_pCurrentStyle != nullptr && m_rWW8Export.m_pCurrentStyle->DerivedFrom() != nullptr ) { - SvxTabStopItem aParentTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); + SvxTabStopItem aParentTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP ); const SwFormat *pParentStyle = m_rWW8Export.m_pCurrentStyle->DerivedFrom(); { if (const SvxTabStopItem* pParentTabs = pParentStyle->GetAttrSet().GetItem<SvxTabStopItem>(RES_PARATR_TABSTOP)) diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index c05e81f8ac74..36debf018abd 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1721,7 +1721,7 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen) WW8_TBD const * pTyp = reinterpret_cast<WW8_TBD const *>(pData + 2*nDel + 2*nIns + 2); // Type Array - SvxTabStopItem aAttr(0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP); + SvxTabStopItem aAttr(0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP); const SwTextFormatColl* pSty = nullptr; sal_uInt16 nTabBase; @@ -1792,16 +1792,16 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen) switch( pTyp[i].aBits1 & 0x7 ) // pTyp[i].jc { case 0: - aTabStop.GetAdjustment() = SVX_TAB_ADJUST_LEFT; + aTabStop.GetAdjustment() = SvxTabAdjust::Left; break; case 1: - aTabStop.GetAdjustment() = SVX_TAB_ADJUST_CENTER; + aTabStop.GetAdjustment() = SvxTabAdjust::Center; break; case 2: - aTabStop.GetAdjustment() = SVX_TAB_ADJUST_RIGHT; + aTabStop.GetAdjustment() = SvxTabAdjust::Right; break; case 3: - aTabStop.GetAdjustment() = SVX_TAB_ADJUST_DECIMAL; + aTabStop.GetAdjustment() = SvxTabAdjust::Decimal; break; case 4: continue; // Ignore Bar @@ -1893,8 +1893,8 @@ void SwWW8ImplReader::ImportDop() nDefTabSiz = 709; // We want exactly one DefaultTab - SvxTabStopItem aNewTab( 1, sal_uInt16(nDefTabSiz), SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); - const_cast<SvxTabStop&>(aNewTab[0]).GetAdjustment() = SVX_TAB_ADJUST_DEFAULT; + SvxTabStopItem aNewTab( 1, sal_uInt16(nDefTabSiz), SvxTabAdjust::Default, RES_PARATR_TABSTOP ); + const_cast<SvxTabStop&>(aNewTab[0]).GetAdjustment() = SvxTabAdjust::Default; m_rDoc.GetAttrPool().SetPoolDefaultItem( aNewTab ); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index aa7cac7f479c..574b5641d765 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2983,7 +2983,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) --aIt; if(0x09 == sDelimiter[0]) - aIt->eTabAlign = SVX_TAB_ADJUST_END; + aIt->eTabAlign = SvxTabAdjust::End; else { SwFormToken aToken(TOKEN_TEXT); diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index 55e762c1dfbb..0162a20bbd41 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -334,7 +334,7 @@ IMPL_LINK_TYPED( SwEnvFormatPage, EditHdl, MenuButton *, pButton, void ) false, &pItem ) && nDefDist != (nNewDist = static_cast<const SfxUInt16Item*>(pItem)->GetValue()) ) { - SvxTabStopItem aDefTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); + SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP ); MakeDefTabs( nNewDist, aDefTabs ); pSh->SetDefault( aDefTabs ); pOutputSet->ClearItem( SID_ATTR_TABSTOP_DEFAULTS ); diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx index df833c066b8f..30fd38a1ea62 100644 --- a/sw/source/ui/index/cntex.cxx +++ b/sw/source/ui/index/cntex.cxx @@ -343,7 +343,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( if(TOKEN_TAB_STOP == aToken.eTokenType) { pPropValArr[2].Name = "TabStopRightAligned"; - pPropValArr[2].Value <<= SVX_TAB_ADJUST_END == aToken.eTabAlign; + pPropValArr[2].Value <<= SvxTabAdjust::End == aToken.eTabAlign; pPropValArr[3].Name = "TabStopFillCharacter"; pPropValArr[3].Value <<= OUString(aToken.cTabFillChar); pPropValArr[4].Name = "TabStopPosition"; diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index b3cb4d870e9f..214eb62e982e 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -2477,7 +2477,7 @@ IMPL_LINK_TYPED(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken&, rToken, void) if(bTabStop) { m_pTabPosMF->SetValue(m_pTabPosMF->Normalize(rToken.nTabStopPosition), FUNIT_TWIP); - m_pAutoRightCB->Check(SVX_TAB_ADJUST_END == rToken.eTabAlign); + m_pAutoRightCB->Check(SvxTabAdjust::End == rToken.eTabAlign); m_pFillCharCB->SetText(OUString(rToken.cTabFillChar)); m_pTabPosFT->Enable(!m_pAutoRightCB->IsChecked()); m_pTabPosMF->Enable(!m_pAutoRightCB->IsChecked()); @@ -2646,7 +2646,7 @@ IMPL_LINK_TYPED(SwTOXEntryTabPage, AutoRightHdl, Button*, pBox, void) bool bChecked = static_cast<CheckBox*>(pBox)->IsChecked(); if(rToken.eTokenType == TOKEN_TAB_STOP) static_cast<SwTOXButton*>(pCurCtrl)->SetTabAlign( - bChecked ? SVX_TAB_ADJUST_END : SVX_TAB_ADJUST_LEFT); + bChecked ? SvxTabAdjust::End : SvxTabAdjust::Left); m_pTabPosFT->Enable(!bChecked); m_pTabPosMF->Enable(!bChecked); ModifyHdl(nullptr); diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx index f1c01ee726a8..3740c55caf76 100644 --- a/sw/source/uibase/app/appopt.cxx +++ b/sw/source/uibase/app/appopt.cxx @@ -335,7 +335,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) pPref->SetDefTab(nTabDist); if(pAppView) { - SvxTabStopItem aDefTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); + SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP ); MakeDefTabs( nTabDist, aDefTabs ); pAppView->GetWrtShell().SetDefault( aDefTabs ); } diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx index 7d8bf172e332..5cb5c5c88dba 100644 --- a/sw/source/uibase/app/docshini.cxx +++ b/sw/source/uibase/app/docshini.cxx @@ -689,7 +689,7 @@ void SwDocShell::SubInitNew() sal_uInt16 nNewPos = static_cast< sal_uInt16 >(SW_MOD()->GetUsrPref(false)->GetDefTab()); if( nNewPos ) aDfltSet.Put( SvxTabStopItem( 1, nNewPos, - SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ) ); + SvxTabAdjust::Default, RES_PARATR_TABSTOP ) ); } aDfltSet.Put( SvxColorItem( Color( COL_AUTO ), RES_CHRATR_COLOR ) ); diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index a3df2571aa29..764c76eb5a12 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1029,7 +1029,7 @@ void SwTextShell::Execute(SfxRequest &rReq) if( SfxItemState::SET == pSet->GetItemState( SID_ATTR_TABSTOP_DEFAULTS, false, &pItem ) && nDefDist != (nNewDist = static_cast<const SfxUInt16Item*>(pItem)->GetValue()) ) { - SvxTabStopItem aDefTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); + SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP ); MakeDefTabs( nNewDist, aDefTabs ); rWrtSh.SetDefault( aDefTabs ); pSet->ClearItem( SID_ATTR_TABSTOP_DEFAULTS ); diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 80f943bd222b..060bf5a7b3b5 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -984,7 +984,7 @@ void SwView::Execute(SfxRequest &rReq) { if(pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_DEFTABSTOP, false, &pItem)) { - SvxTabStopItem aDefTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); + SvxTabStopItem aDefTabs( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP ); const sal_uInt16 nTab = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); MakeDefTabs( nTab, aDefTabs ); m_pWrtShell->SetDefault( aDefTabs ); diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 9eafba95cd2b..a030f90b496e 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -152,7 +152,7 @@ static void lcl_EraseDefTabs(SvxTabStopItem& rTabStops) for ( sal_uInt16 i = 0; i < rTabStops.Count(); ) { // Here also throw out the DefTab to zero - if ( SVX_TAB_ADJUST_DEFAULT == rTabStops[i].GetAdjustment() || + if ( SvxTabAdjust::Default == rTabStops[i].GetAdjustment() || rTabStops[i].GetTabPos() == 0 ) { rTabStops.Remove(i); @@ -635,7 +635,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if ( rLR.GetTextFirstLineOfst() < 0 ) { - SvxTabStop aSwTabStop( 0, SVX_TAB_ADJUST_DEFAULT ); + SvxTabStop aSwTabStop( 0, SvxTabAdjust::Default ); aTabStops.Insert( aSwTabStop ); } @@ -714,7 +714,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) ::lcl_EraseDefTabs(aTabStops); - SvxTabStop aSwTabStop( 0, SVX_TAB_ADJUST_DEFAULT ); + SvxTabStop aSwTabStop( 0, SvxTabAdjust::Default ); aTabStops.Insert(aSwTabStop); const SvxTabStopItem& rDefTabs = diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index f566769fe678..c04bd7bfd7b6 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -580,7 +580,7 @@ void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs) if( rTabs.Count() ) return; { - SvxTabStop aSwTabStop( nDefDist, SVX_TAB_ADJUST_DEFAULT ); + SvxTabStop aSwTabStop( nDefDist, SvxTabAdjust::Default ); rTabs.Insert( aSwTabStop ); } } |