diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-07 11:19:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-08 06:30:49 +0000 |
commit | 9cb57a50d7eeaa1dda19d18bcb3cde7e4a7984e5 (patch) | |
tree | 790282bdd3d41f9ceda28267cb72dd119ac15230 /sw | |
parent | bb4cf1da125344d5ef4fe51b0f1549718a11affa (diff) |
convert SvxAdjust to scoped enum
Change-Id: I0df7a5313d6d62d0c657e62ef6014a3ddbab4639
Reviewed-on: https://gerrit.libreoffice.org/34941
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
50 files changed, 288 insertions, 276 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index a48caad2e67d..562bfd13d027 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -359,6 +359,12 @@ private: SwDoc* createDoc(const char* pName = nullptr); }; +std::ostream& operator<<(std::ostream& s, SvxAdjust n) +{ + s << (int)n; + return s; +} + SwDoc* SwUiWriterTest::createDoc(const char* pName) { if (!pName) @@ -1567,12 +1573,12 @@ void SwUiWriterTest::testTdf79236() SvxAdjustItem AdjustItem = rAttrSet.GetAdjust(); SvxAdjust initialAdjust = AdjustItem.GetAdjust(); //By default the adjust is LEFT - CPPUNIT_ASSERT_EQUAL(SVX_ADJUST_LEFT, initialAdjust); + CPPUNIT_ASSERT_EQUAL(SvxAdjust::Left, initialAdjust); //Changing the adjust to RIGHT - AdjustItem.SetAdjust(SVX_ADJUST_RIGHT); + AdjustItem.SetAdjust(SvxAdjust::Right); //Checking whether the change is made or not SvxAdjust modifiedAdjust = AdjustItem.GetAdjust(); - CPPUNIT_ASSERT_EQUAL(SVX_ADJUST_RIGHT, modifiedAdjust); + CPPUNIT_ASSERT_EQUAL(SvxAdjust::Right, modifiedAdjust); //Modifying the itemset, putting *one* item pNewSet->Put(AdjustItem); //The count should increment by 1 @@ -1586,7 +1592,7 @@ void SwUiWriterTest::testTdf79236() const SvxAdjustItem& rAdjustItem2 = rAttrSet2.GetAdjust(); SvxAdjust Adjust2 = rAdjustItem2.GetAdjust(); //The adjust should be RIGHT as per the modifications made - CPPUNIT_ASSERT_EQUAL(SVX_ADJUST_RIGHT, Adjust2); + CPPUNIT_ASSERT_EQUAL(SvxAdjust::Right, Adjust2); //Undo the changes rUndoManager.Undo(); SwTextFormatColl* pTextFormat3 = pDoc->FindTextFormatCollByName("Text Body"); @@ -1594,7 +1600,7 @@ void SwUiWriterTest::testTdf79236() const SvxAdjustItem& rAdjustItem3 = rAttrSet3.GetAdjust(); SvxAdjust Adjust3 = rAdjustItem3.GetAdjust(); //The adjust should be back to default, LEFT - CPPUNIT_ASSERT_EQUAL(SVX_ADJUST_LEFT, Adjust3); + CPPUNIT_ASSERT_EQUAL(SvxAdjust::Left, Adjust3); //Redo the changes rUndoManager.Redo(); SwTextFormatColl* pTextFormat4 = pDoc->FindTextFormatCollByName("Text Body"); @@ -1602,7 +1608,7 @@ void SwUiWriterTest::testTdf79236() const SvxAdjustItem& rAdjustItem4 = rAttrSet4.GetAdjust(); SvxAdjust Adjust4 = rAdjustItem4.GetAdjust(); //The adjust should be RIGHT as per the modifications made - CPPUNIT_ASSERT_EQUAL(SVX_ADJUST_RIGHT, Adjust4); + CPPUNIT_ASSERT_EQUAL(SvxAdjust::Right, Adjust4); //Undo the changes rUndoManager.Undo(); SwTextFormatColl* pTextFormat5 = pDoc->FindTextFormatCollByName("Text Body"); @@ -1610,7 +1616,7 @@ void SwUiWriterTest::testTdf79236() const SvxAdjustItem& rAdjustItem5 = rAttrSet5.GetAdjust(); SvxAdjust Adjust5 = rAdjustItem5.GetAdjust(); //The adjust should be back to default, LEFT - CPPUNIT_ASSERT_EQUAL(SVX_ADJUST_LEFT, Adjust5); + CPPUNIT_ASSERT_EQUAL(SvxAdjust::Left, Adjust5); } void SwUiWriterTest::testTextSearch() diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 45500bfc5f16..59764a4c93c3 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -536,7 +536,7 @@ void InitCore() aAttrTab[ RES_TXTATR_DUMMY3 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_TXTATR_DUMMY3 ); aAttrTab[ RES_PARATR_LINESPACING- POOLATTR_BEGIN ] = new SvxLineSpacingItem( LINE_SPACE_DEFAULT_HEIGHT, RES_PARATR_LINESPACING ); - aAttrTab[ RES_PARATR_ADJUST- POOLATTR_BEGIN ] = new SvxAdjustItem( SVX_ADJUST_LEFT, RES_PARATR_ADJUST ); + aAttrTab[ RES_PARATR_ADJUST- POOLATTR_BEGIN ] = new SvxAdjustItem( SvxAdjust::Left, RES_PARATR_ADJUST ); 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 ); diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index ea71014b361a..d756d994a6d4 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1922,8 +1922,8 @@ bool SwCursorShell::SetShadowCursorPos( const Point& rPt, SwFillMode eFillMode ) const SvxAdjustItem& rAdj = static_cast<const SvxAdjustItem&>(pCNd-> GetAttr( RES_PARATR_ADJUST )); - if( SVX_ADJUST_LEFT != rAdj.GetAdjust() ) - aSet.Put( SvxAdjustItem( SVX_ADJUST_LEFT, RES_PARATR_ADJUST ) ); + if( SvxAdjust::Left != rAdj.GetAdjust() ) + aSet.Put( SvxAdjustItem( SvxAdjust::Left, RES_PARATR_ADJUST ) ); GetDoc()->getIDocumentContentOperations().InsertItemSet( *m_pCurrentCursor, aSet ); } @@ -1947,14 +1947,14 @@ bool SwCursorShell::SetShadowCursorPos( const Point& rPt, SwFillMode eFillMode ) case FILL_MARGIN: if( text::HoriOrientation::NONE != aFPos.eOrient ) { - SvxAdjustItem aAdj( SVX_ADJUST_LEFT, RES_PARATR_ADJUST ); + SvxAdjustItem aAdj( SvxAdjust::Left, RES_PARATR_ADJUST ); switch( aFPos.eOrient ) { case text::HoriOrientation::CENTER: - aAdj.SetAdjust( SVX_ADJUST_CENTER ); + aAdj.SetAdjust( SvxAdjust::Center ); break; case text::HoriOrientation::RIGHT: - aAdj.SetAdjust( SVX_ADJUST_RIGHT ); + aAdj.SetAdjust( SvxAdjust::Right ); break; default: break; diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index c5d8fa09388a..7da1a12a2553 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -358,7 +358,7 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId, if (GetDefaultFrameDirection(nAppLanguage) == FRMDIR_HORI_RIGHT_TOP) { - SvxAdjustItem aAdjust(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST ); + SvxAdjustItem aAdjust(SvxAdjust::Right, RES_PARATR_ADJUST ); aSet.Put(aAdjust); } if (nAppLanguage == LANGUAGE_KOREAN) @@ -592,7 +592,7 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId, case RES_POOLCOLL_TABLE_HDLN: { SetAllScriptItem( aSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) ); - aSet.Put( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST ) ); + aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) ); SwFormatLineNumber aLN; aLN.SetCountLines( false ); aSet.Put( aLN ); @@ -977,7 +977,7 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId, SetAllScriptItem( aSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) ); SetAllScriptItem( aSet, SvxFontHeightItem( PT_28, 100, RES_CHRATR_FONTSIZE ) ); - aSet.Put( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST ) ); + aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) ); pNewColl->SetNextTextFormatColl( *GetTextCollFromPool( RES_POOLCOLL_TEXT )); } @@ -989,7 +989,7 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId, aSet.Put( aUL ); SetAllScriptItem( aSet, SvxFontHeightItem( PT_18, 100, RES_CHRATR_FONTSIZE )); - aSet.Put( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST )); + aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST )); pNewColl->SetNextTextFormatColl( *GetTextCollFromPool( RES_POOLCOLL_TEXT )); } diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 3cd3468ec796..3009976b54ca 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -1497,12 +1497,12 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv // Calculate the size and position of the additional cells. switch( m_eTableAdjust ) { - case SVX_ADJUST_RIGHT: + case SvxAdjust::Right: nAbsLeftFill = nAbsLeftFill + nAbsDist; m_nRelLeftFill = m_nRelLeftFill + nRelDist; nParentInhAbsLeftSpace = nParentInhAbsSpace; break; - case SVX_ADJUST_CENTER: + case SvxAdjust::Center: { sal_uInt16 nAbsLeftDist = nAbsDist / 2; nAbsLeftFill = nAbsLeftFill + nAbsLeftDist; @@ -1515,7 +1515,7 @@ void SwHTMLTableLayout::AutoLayoutPass2( sal_uInt16 nAbsAvail, sal_uInt16 nRelAv nParentInhAbsLeftSpace; } break; - case SVX_ADJUST_LEFT: + case SvxAdjust::Left: default: nAbsRightFill = nAbsRightFill + nAbsDist; m_nRelRightFill = m_nRelRightFill + nRelDist; diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index 4ca88ca80b1d..08bf146b14d3 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -288,7 +288,7 @@ SwBoxAutoFormat::SwBoxAutoFormat() m_aTLBR( 0 ), m_aBLTR( 0 ), m_aBackground( RES_BACKGROUND ), - m_aAdjust( SVX_ADJUST_LEFT, RES_PARATR_ADJUST ), + m_aAdjust( SvxAdjust::Left, RES_PARATR_ADJUST ), m_aTextOrientation(FRMDIR_ENVIRONMENT, RES_FRAMEDIR), m_aVerticalAlignment(0, css::text::VertOrientation::NONE, css::text::RelOrientation::FRAME), m_aHorJustify( SVX_HOR_JUSTIFY_STANDARD, 0), diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 168a0834fd57..59982f7a3c3c 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -645,8 +645,8 @@ bool SwAutoFormat::DoTable() sal_Int16 eHori; switch( m_pCurTextNd->GetSwAttrSet().GetAdjust().GetAdjust() ) { - case SVX_ADJUST_CENTER: eHori = text::HoriOrientation::CENTER; break; - case SVX_ADJUST_RIGHT: eHori = text::HoriOrientation::RIGHT; break; + case SvxAdjust::Center: eHori = text::HoriOrientation::CENTER; break; + case SvxAdjust::Right: eHori = text::HoriOrientation::RIGHT; break; default: if( nSttPos ) @@ -1010,9 +1010,9 @@ void SwAutoFormat::SetColl( sal_uInt16 nId, bool bHdLineOrText ) false, reinterpret_cast<const SfxPoolItem**>(&pAdj) )) { SvxAdjust eAdj = pAdj->GetAdjust(); - if( bHdLineOrText ? (SVX_ADJUST_RIGHT != eAdj && - SVX_ADJUST_CENTER != eAdj) - : SVX_ADJUST_BLOCK != eAdj ) + if( bHdLineOrText ? (SvxAdjust::Right != eAdj && + SvxAdjust::Center != eAdj) + : SvxAdjust::Block != eAdj ) aSet.ClearItem( RES_PARATR_ADJUST ); } } @@ -1474,7 +1474,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) if( !aFormat.GetCharFormat() ) aFormat.SetCharFormat( pCFormat ); if( bRTL ) - aFormat.SetNumAdjust( SVX_ADJUST_RIGHT ); + aFormat.SetNumAdjust( SvxAdjust::Right ); aRule.Set( n, aFormat ); @@ -1535,7 +1535,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) aFormat.SetNumberingType((SvxNumType)(aNumTypes[ 0 ] - '0')); if( bRTL ) - aFormat.SetNumAdjust( SVX_ADJUST_RIGHT ); + aFormat.SetNumAdjust( SvxAdjust::Right ); aRule.Set( nLvl, aFormat ); } else @@ -1561,7 +1561,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) if( !aFormat.GetCharFormat() ) aFormat.SetCharFormat( pCFormat ); if( bRTL ) - aFormat.SetNumAdjust( SVX_ADJUST_RIGHT ); + aFormat.SetNumAdjust( SvxAdjust::Right ); aRule.Set( n, aFormat ); } diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 4f48f916f24c..dc8d917b8a62 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -1970,10 +1970,10 @@ void ChgTextToNum( SwTableBox& rBox, const OUString& rText, const Color* pCol, { pItem = &pTNd->SwContentNode::GetAttr( RES_PARATR_ADJUST ); SvxAdjust eAdjust = static_cast<const SvxAdjustItem*>(pItem)->GetAdjust(); - if( SVX_ADJUST_LEFT == eAdjust || SVX_ADJUST_BLOCK == eAdjust ) + if( SvxAdjust::Left == eAdjust || SvxAdjust::Block == eAdjust ) { SvxAdjustItem aAdjust( *static_cast<const SvxAdjustItem*>(pItem) ); - aAdjust.SetAdjust( SVX_ADJUST_RIGHT ); + aAdjust.SetAdjust( SvxAdjust::Right ); pTNd->SetAttr( aAdjust ); } } @@ -2097,9 +2097,9 @@ void ChgNumToText( SwTableBox& rBox, sal_uLong nFormat ) // assign adjustment if( bChgAlign && pAttrSet && SfxItemState::SET == pAttrSet->GetItemState( RES_PARATR_ADJUST, false, &pItem ) && - SVX_ADJUST_RIGHT == static_cast<const SvxAdjustItem*>(pItem)->GetAdjust() ) + SvxAdjust::Right == static_cast<const SvxAdjustItem*>(pItem)->GetAdjust() ) { - pTNd->SetAttr( SvxAdjustItem( SVX_ADJUST_LEFT, RES_PARATR_ADJUST ) ); + pTNd->SetAttr( SvxAdjustItem( SvxAdjust::Left, RES_PARATR_ADJUST ) ); } // assign color or save "user color" diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 6b2b5d7528cf..24adab070a1c 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -631,13 +631,13 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) OSL_ENSURE( pFrame->IsTextFrame(), "Frame type <-> tag attribute mismatch" ); const SwAttrSet& aSet = static_cast<const SwTextFrame*>(pFrame)->GetTextNode()->GetSwAttrSet(); const SvxAdjust nAdjust = aSet.GetAdjust().GetAdjust(); - if ( SVX_ADJUST_BLOCK == nAdjust || SVX_ADJUST_CENTER == nAdjust || - ( (pFrame->IsRightToLeft() && SVX_ADJUST_LEFT == nAdjust) || - (!pFrame->IsRightToLeft() && SVX_ADJUST_RIGHT == nAdjust) ) ) + if ( SvxAdjust::Block == nAdjust || SvxAdjust::Center == nAdjust || + ( (pFrame->IsRightToLeft() && SvxAdjust::Left == nAdjust) || + (!pFrame->IsRightToLeft() && SvxAdjust::Right == nAdjust) ) ) { - eVal = SVX_ADJUST_BLOCK == nAdjust ? + eVal = SvxAdjust::Block == nAdjust ? vcl::PDFWriter::Justify : - SVX_ADJUST_CENTER == nAdjust ? + SvxAdjust::Center == nAdjust ? vcl::PDFWriter::Center : vcl::PDFWriter::End; diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index c30e6a231395..ee4844c48f4d 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -1663,8 +1663,8 @@ void SwTextFrame::Format_( vcl::RenderContext* pRenderContext, SwParaPortion *pP if( 1 < aLine.GetDropLines() ) { - if( SVX_ADJUST_LEFT != aLine.GetAdjust() && - SVX_ADJUST_BLOCK != aLine.GetAdjust() ) + if( SvxAdjust::Left != aLine.GetAdjust() && + SvxAdjust::Block != aLine.GetAdjust() ) { aLine.CalcDropAdjust(); aLine.SetPaintDrop( true ); diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx index b3dfd58a253f..49301f7a3dc4 100644 --- a/sw/source/core/text/guess.cxx +++ b/sw/source/core/text/guess.cxx @@ -81,7 +81,7 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf, { if ( rInf.GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get( DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS ) ) { - if ( rAdjust == SVX_ADJUST_RIGHT || rAdjust == SVX_ADJUST_CENTER ) + if ( rAdjust == SvxAdjust::Right || rAdjust == SvxAdjust::Center ) { sal_Int32 nSpaceCnt = 0; for ( int i = (rInf.GetText().getLength() - 1); i >= rInf.GetIdx(); --i ) @@ -241,7 +241,7 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf, nBreakPos = nCutPos; sal_Int32 nX = nBreakPos; - if ( rAdjust == SVX_ADJUST_LEFT ) + if ( rAdjust == SvxAdjust::Left ) { // we step back until a non blank character has been found // or there is only one more character left @@ -451,7 +451,7 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf, CHAR_SOFTHYPHEN == rInf.GetText()[ nBreakPos - 1 ] ) nBreakPos = rInf.GetIdx() - 1; - if( rAdjust != SVX_ADJUST_LEFT ) + if( rAdjust != SvxAdjust::Left ) { // Delete any blanks at the end of a line, but be careful: // If a field has been expanded, we do not want to delete any diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx index 512d9d8e8f76..08c6938028b3 100644 --- a/sw/source/core/text/itradj.cxx +++ b/sw/source/core/text/itradj.cxx @@ -246,7 +246,7 @@ static bool lcl_CheckKashidaWidth ( SwScriptInfo& rSI, SwTextSizeInfo& rInf, SwT void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent, const SwLinePortion *pStopAt, SwTwips nReal, bool bSkipKashida ) { - OSL_ENSURE( GetInfo().IsMulti() || SVX_ADJUST_BLOCK == GetAdjust(), + OSL_ENSURE( GetInfo().IsMulti() || SvxAdjust::Block == GetAdjust(), "CalcNewBlock: Why?" ); OSL_ENSURE( pCurrent->Height(), "SwTextAdjuster::CalcBlockAdjust: missing CalcLine()" ); @@ -602,7 +602,7 @@ void SwTextAdjuster::CalcFlyAdjust( SwLineLayout *pCurrent ) // in tab compat mode we do not want to change tab portions // in non tab compat mode we do not want to change margins if we // found a multi portion with tabs - if( SVX_ADJUST_RIGHT == GetAdjust() ) + if( SvxAdjust::Right == GetAdjust() ) static_cast<SwGluePortion*>(pPos)->MoveAllGlue( pGlue ); else { @@ -644,7 +644,7 @@ void SwTextAdjuster::CalcFlyAdjust( SwLineLayout *pCurrent ) pPos = pPos->GetPortion(); } - if( ! bTabCompat && ! bMultiTab && SVX_ADJUST_RIGHT == GetAdjust() ) + if( ! bTabCompat && ! bMultiTab && SvxAdjust::Right == GetAdjust() ) // portions are moved to the right if possible pLeft->AdjustRight( pCurrent ); } @@ -659,14 +659,14 @@ void SwTextAdjuster::CalcAdjLine( SwLineLayout *pCurrent ) switch( GetAdjust() ) { - case SVX_ADJUST_RIGHT: - case SVX_ADJUST_CENTER: + case SvxAdjust::Right: + case SvxAdjust::Center: { CalcFlyAdjust( pCurrent ); pPara->GetRepaint().SetOfst( 0 ); break; } - case SVX_ADJUST_BLOCK: + case SvxAdjust::Block: { FormatBlock(); break; @@ -726,7 +726,7 @@ SwFlyPortion *SwTextAdjuster::CalcFlyPortion( const long nRealWidth, // CalcDropAdjust is called at the end by Format() if needed void SwTextAdjuster::CalcDropAdjust() { - OSL_ENSURE( 1<GetDropLines() && SVX_ADJUST_LEFT!=GetAdjust() && SVX_ADJUST_BLOCK!=GetAdjust(), + OSL_ENSURE( 1<GetDropLines() && SvxAdjust::Left!=GetAdjust() && SvxAdjust::Block!=GetAdjust(), "CalcDropAdjust: No reason for DropAdjustment." ); const sal_uInt16 nLineNumber = GetLineNr(); diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index 50976db46f36..63bd04455597 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -326,20 +326,20 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame *pNewFrame, SwTextSizeInfo *p nFirst = nRight - 1; } const SvxAdjustItem& rAdjust = m_pFrame->GetTextNode()->GetSwAttrSet().GetAdjust(); - nAdjust = static_cast<sal_uInt16>(rAdjust.GetAdjust()); + nAdjust = rAdjust.GetAdjust(); // left is left and right is right if ( m_pFrame->IsRightToLeft() ) { - if ( SVX_ADJUST_LEFT == nAdjust ) - nAdjust = SVX_ADJUST_RIGHT; - else if ( SVX_ADJUST_RIGHT == nAdjust ) - nAdjust = SVX_ADJUST_LEFT; + if ( SvxAdjust::Left == nAdjust ) + nAdjust = SvxAdjust::Right; + else if ( SvxAdjust::Right == nAdjust ) + nAdjust = SvxAdjust::Left; } - m_bOneBlock = rAdjust.GetOneWord() == SVX_ADJUST_BLOCK; - m_bLastBlock = rAdjust.GetLastBlock() == SVX_ADJUST_BLOCK; - m_bLastCenter = rAdjust.GetLastBlock() == SVX_ADJUST_CENTER; + m_bOneBlock = rAdjust.GetOneWord() == SvxAdjust::Block; + m_bLastBlock = rAdjust.GetLastBlock() == SvxAdjust::Block; + m_bLastCenter = rAdjust.GetLastBlock() == SvxAdjust::Center; // #i91133# mnTabLeft = pNode->GetLeftMarginForTabCalculation(); @@ -368,14 +368,14 @@ void SwTextMargin::DropInit() SwTwips SwTextMargin::GetLineStart() const { SwTwips nRet = GetLeftMargin(); - if( GetAdjust() != SVX_ADJUST_LEFT && + if( GetAdjust() != SvxAdjust::Left && !m_pCurr->GetFirstPortion()->IsMarginPortion() ) { // If the first portion is a Margin, then the // adjustment is expressed by the portions. - if( GetAdjust() == SVX_ADJUST_RIGHT ) + if( GetAdjust() == SvxAdjust::Right ) nRet = Right() - CurrWidth(); - else if( GetAdjust() == SVX_ADJUST_CENTER ) + else if( GetAdjust() == SvxAdjust::Center ) nRet += (GetLineWidth() - CurrWidth()) / 2; } return nRet; diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 3f820673e357..22604422d285 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -714,7 +714,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf ) void SwTextFormatter::CalcAdjustLine( SwLineLayout *pCurrent ) { - if( SVX_ADJUST_LEFT != GetAdjust() && !pMulti) + if( SvxAdjust::Left != GetAdjust() && !pMulti) { pCurrent->SetFormatAdj(true); if( IsFlyInCntBase() ) @@ -1960,7 +1960,7 @@ bool SwTextFormatter::AllowRepaintOpt() const { switch( GetAdjust() ) { - case SVX_ADJUST_BLOCK: + case SvxAdjust::Block: { if( IsLastBlock() || IsLastCenter() ) bOptimizeRepaint = false; @@ -1978,8 +1978,8 @@ bool SwTextFormatter::AllowRepaintOpt() const } break; } - case SVX_ADJUST_CENTER: - case SVX_ADJUST_RIGHT: + case SvxAdjust::Center: + case SvxAdjust::Right: bOptimizeRepaint = false; break; default: ; diff --git a/sw/source/core/text/itrtxt.hxx b/sw/source/core/text/itrtxt.hxx index 3501ffdb8b3a..da394e1fbbdb 100644 --- a/sw/source/core/text/itrtxt.hxx +++ b/sw/source/core/text/itrtxt.hxx @@ -149,7 +149,7 @@ private: sal_uInt16 nDropHeight; sal_uInt16 nDropDescent; sal_uInt16 nDropLines; - sal_uInt16 nAdjust; + SvxAdjust nAdjust; // #i91133# SwTwips mnTabLeft; @@ -167,7 +167,7 @@ protected: , nDropHeight(0) , nDropDescent(0) , nDropLines(0) - , nAdjust(0) + , nAdjust(SvxAdjust::Left) , mnTabLeft(0) { } @@ -188,7 +188,7 @@ public: bool IsOneBlock() const { return m_bOneBlock; } bool IsLastBlock() const { return m_bLastBlock; } bool IsLastCenter() const { return m_bLastCenter; } - sal_uInt16 GetAdjust() const { return nAdjust; } + SvxAdjust GetAdjust() const { return nAdjust; } sal_uInt16 GetLineWidth() const { return sal_uInt16( Right() - GetLeftMargin() + 1 ); } SwTwips GetLeftMin() const { return nFirst < nLeft ? nFirst : nLeft; } diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 779e6f0096bf..5762965b182d 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -743,7 +743,7 @@ void SwScriptInfo::InitScriptInfo( const SwTextNode& rNode, bool bRTL ) const CharCompressType aCompEnum = rNode.getIDocumentSettingAccess()->getCharacterCompressionType(); // justification type - const bool bAdjustBlock = SVX_ADJUST_BLOCK == + const bool bAdjustBlock = SvxAdjust::Block == rNode.GetSwAttrSet().GetAdjust().GetAdjust(); // FIND INVALID RANGES IN SCRIPT INFO ARRAYS: diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index 94458d90b05e..3734f5a07e34 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -1924,8 +1924,8 @@ bool SwTextFormatter::BuildMultiPortion( SwTextFormatInfo &rInf, // kashida justification is accomplished by elongating characters at certain chosen points. // Kashida justification can be combined with white-space justification to various extents. // The default value of bSkipKashida (the 4th parameter passed to 'CalcNewBlock') is false. - // Only when Adjust is SVX_ADJUST_BLOCK ( alignment is justify ), multiportion will be showed in justification in new code. - CalcNewBlock( pLine, nullptr, rMulti.Width(), GetAdjust() != SVX_ADJUST_BLOCK ); + // Only when Adjust is SvxAdjust::Block ( alignment is justify ), multiportion will be showed in justification in new code. + CalcNewBlock( pLine, nullptr, rMulti.Width(), GetAdjust() != SvxAdjust::Block ); GetInfo().SetMulti( false ); } diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 21866544c57f..92d16a4b0eb6 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -291,8 +291,8 @@ bool SwTextFrame::FormatEmpty() return false; const SwAttrSet& aSet = GetTextNode()->GetSwAttrSet(); const SvxAdjust nAdjust = aSet.GetAdjust().GetAdjust(); - if( !bCollapse && ( ( ( ! IsRightToLeft() && ( SVX_ADJUST_LEFT != nAdjust ) ) || - ( IsRightToLeft() && ( SVX_ADJUST_RIGHT != nAdjust ) ) ) || + if( !bCollapse && ( ( ( ! IsRightToLeft() && ( SvxAdjust::Left != nAdjust ) ) || + ( IsRightToLeft() && ( SvxAdjust::Right != nAdjust ) ) ) || aSet.GetRegister().GetValue() ) ) return false; const SvxLineSpacingItem &rSpacing = aSet.GetLineSpacing(); diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index 028eb23b7c2f..15be6de18b68 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -469,8 +469,8 @@ SwNumberPortion *SwTextFormatter::NewNumberPortion( SwTextFormatInfo &rInf ) con nLevel = MAXLEVEL - 1; const SwNumFormat &rNumFormat = pNumRule->Get( nLevel ); - const bool bLeft = SVX_ADJUST_LEFT == rNumFormat.GetNumAdjust(); - const bool bCenter = SVX_ADJUST_CENTER == rNumFormat.GetNumAdjust(); + const bool bLeft = SvxAdjust::Left == rNumFormat.GetNumAdjust(); + const bool bCenter = SvxAdjust::Center == rNumFormat.GetNumAdjust(); const bool bLabelAlignmentPosAndSpaceModeActive( rNumFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ); const sal_uInt16 nMinDist = bLabelAlignmentPosAndSpaceModeActive diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index ee613621febe..25cef9fc8347 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -2208,13 +2208,13 @@ void SwTextFrame::CalcAdditionalFirstLineOffset() } if ( ( IsRightToLeft() && - rNumFormat.GetNumAdjust() == SVX_ADJUST_LEFT ) || + rNumFormat.GetNumAdjust() == SvxAdjust::Left ) || ( !IsRightToLeft() && - rNumFormat.GetNumAdjust() == SVX_ADJUST_RIGHT ) ) + rNumFormat.GetNumAdjust() == SvxAdjust::Right ) ) { mnAdditionalFirstLineOffset = -nNumberPortionWidth; } - else if ( rNumFormat.GetNumAdjust() == SVX_ADJUST_CENTER ) + else if ( rNumFormat.GetNumAdjust() == SvxAdjust::Center ) { mnAdditionalFirstLineOffset = -(nNumberPortionWidth/2); } diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 595bf5fe0feb..3c5b7ccc8595 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -1139,7 +1139,7 @@ sal_Int32 SwTextFormatter::FormatQuoVadis( const sal_Int32 nOffset ) { switch( GetAdjust() ) { - case SVX_ADJUST_BLOCK: + case SvxAdjust::Block: { if( !m_pCurr->GetLen() || CH_BREAK != GetInfo().GetChar(m_nStart+m_pCurr->GetLen()-1)) @@ -1147,13 +1147,13 @@ sal_Int32 SwTextFormatter::FormatQuoVadis( const sal_Int32 nOffset ) nQuoWidth = nQuoWidth + nLastLeft; break; } - case SVX_ADJUST_RIGHT: + case SvxAdjust::Right: { nLastLeft = pQuo->GetAscent(); nQuoWidth = nQuoWidth + nLastLeft; break; } - case SVX_ADJUST_CENTER: + case SvxAdjust::Center: { nQuoWidth = nQuoWidth + pQuo->GetAscent(); long nDiff = nLastLeft - nQuoWidth; diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index b7892a0c05d5..ab4e5a5a6926 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -53,6 +53,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/style/VerticalAlignment.hpp> #include <o3tl/any.hxx> +#include <o3tl/enumarray.hxx> #include <vcl/font.hxx> #include <editeng/flstitem.hxx> #include <vcl/metric.hxx> @@ -239,7 +240,7 @@ static SwPageDesc* lcl_GetPageDesc(SwDoc* pDoc, const uno::Any& aValue) } // Numbering -const unsigned short aSvxToUnoAdjust[] = +const o3tl::enumarray<SvxAdjust, unsigned short> aSvxToUnoAdjust { text::HoriOrientation::LEFT, //3 text::HoriOrientation::RIGHT, //1 @@ -252,9 +253,9 @@ const unsigned short aSvxToUnoAdjust[] = const unsigned short aUnoToSvxAdjust[] = { USHRT_MAX, - SVX_ADJUST_RIGHT, // 1 - SVX_ADJUST_CENTER, // 3 - SVX_ADJUST_LEFT, // 0 + (unsigned short)SvxAdjust::Right, // 1 + (unsigned short)SvxAdjust::Center, // 3 + (unsigned short)SvxAdjust::Left, // 0 USHRT_MAX, USHRT_MAX }; diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 8ea04cccf67b..a430ce238964 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -2725,10 +2725,10 @@ static Writer& OutCSS1_SvxAdjust( Writer& rWrt, const SfxPoolItem& rHt ) const sal_Char* pStr = nullptr; switch( static_cast<const SvxAdjustItem&>(rHt).GetAdjust() ) { - case SVX_ADJUST_LEFT: pStr = sCSS1_PV_left; break; - case SVX_ADJUST_RIGHT: pStr = sCSS1_PV_right; break; - case SVX_ADJUST_BLOCK: pStr = sCSS1_PV_justify; break; - case SVX_ADJUST_CENTER: pStr = sCSS1_PV_center; break; + case SvxAdjust::Left: pStr = sCSS1_PV_left; break; + case SvxAdjust::Right: pStr = sCSS1_PV_right; break; + case SvxAdjust::Block: pStr = sCSS1_PV_justify; break; + case SvxAdjust::Center: pStr = sCSS1_PV_center; break; default: ; } diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 6d9830e5c3cd..a6801dcf3816 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -665,7 +665,7 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, else if( !nNewDefListLvl && !rHWrt.m_bCfgOutStyles && bPara && rULSpace.GetLower()==0 && ((bUseParSpace && bIsNextTextNode) || rHWrt.m_nDefListLvl==1) && - (!pAdjItem || SVX_ADJUST_LEFT== + (!pAdjItem || SvxAdjust::Left== static_cast<const SvxAdjustItem *>(pAdjItem)->GetAdjust()) ) { // Export paragraphs without a lower spacing as DT @@ -3110,10 +3110,10 @@ static Writer& OutHTML_SvxAdjust( Writer& rWrt, const SfxPoolItem& rHt ) const sal_Char* pStr = nullptr; switch( rAdjust.GetAdjust() ) { - case SVX_ADJUST_CENTER: pStr = OOO_STRING_SVTOOLS_HTML_AL_center; break; - case SVX_ADJUST_LEFT: pStr = OOO_STRING_SVTOOLS_HTML_AL_left; break; - case SVX_ADJUST_RIGHT: pStr = OOO_STRING_SVTOOLS_HTML_AL_right; break; - case SVX_ADJUST_BLOCK: pStr = OOO_STRING_SVTOOLS_HTML_AL_justify; break; + case SvxAdjust::Center: pStr = OOO_STRING_SVTOOLS_HTML_AL_center; break; + case SvxAdjust::Left: pStr = OOO_STRING_SVTOOLS_HTML_AL_left; break; + case SvxAdjust::Right: pStr = OOO_STRING_SVTOOLS_HTML_AL_right; break; + case SvxAdjust::Block: pStr = OOO_STRING_SVTOOLS_HTML_AL_justify; break; default: ; } diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index 522d922ef935..e3167264ed0f 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -979,7 +979,7 @@ void SwCSS1Parser::StyleParsed( const CSS1Selector *pSelector, if( !pNext || (CSS1_SELTYPE_PSEUDO==eNextType && pNext->GetString().equalsIgnoreAsciiCase( "first-letter" ) && - SVX_ADJUST_LEFT == rPropInfo.m_eFloat) ) + SvxAdjust::Left == rPropInfo.m_eFloat) ) { // Entweder kein zusammengesetzter Selektor oder // ein X:first-line { float: left; ... } @@ -1063,7 +1063,7 @@ void SwCSS1Parser::StyleParsed( const CSS1Selector *pSelector, // ggf. angelegte Zeichen-Vorlage spaeter ueber den Namen // gesucht und gesetzt. if( aDrop.GetLines() > 1 && - (SVX_ADJUST_LEFT == rPropInfo.m_eFloat || + (SvxAdjust::Left == rPropInfo.m_eFloat || Css1ScriptFlags::AllMask == nScript) ) { pColl->SetFormatAttr( aDrop ); @@ -1446,7 +1446,7 @@ bool SwCSS1Parser::MayBePositioned( const SvxCSS1PropertyInfo& rPropInfo, SVX_CSS1_LTYPE_PERCENTAGE != rPropInfo.m_eTopType && (SVX_CSS1_LTYPE_TWIP == rPropInfo.m_eLeftType || SVX_CSS1_LTYPE_TWIP != rPropInfo.m_eTopType) ) || - ( SVX_ADJUST_END != rPropInfo.m_eFloat ) ) && + ( SvxAdjust::End != rPropInfo.m_eFloat ) ) && ( bAutoWidth || SVX_CSS1_LTYPE_TWIP == rPropInfo.m_eWidthType || SVX_CSS1_LTYPE_PERCENTAGE == rPropInfo.m_eWidthType ); @@ -2021,7 +2021,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( const SfxItemSet & /*rItemSet*/, short nIndent = 0; GetMarginsFromContextWithNumBul( nLeftSpace, nRightSpace, nIndent ); - if( SVX_ADJUST_RIGHT==rPropInfo.m_eFloat ) + if( SvxAdjust::Right==rPropInfo.m_eFloat ) { eHoriOri = text::HoriOrientation::RIGHT; eHoriRel = nRightSpace ? text::RelOrientation::PRINT_AREA : text::RelOrientation::FRAME; diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index f2de2fac4868..ac1ebbdc9920 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -468,7 +468,7 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet, { // Put together a DropCap attribute, if a "float:left" is before the first character if( bCharLvl && !m_pPam->GetPoint()->nContent.GetIndex() && - SVX_ADJUST_LEFT == rPropInfo.m_eFloat ) + SvxAdjust::Left == rPropInfo.m_eFloat ) { SwFormatDrop aDrop; aDrop.GetChars() = 1; diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx index e7f46822f183..c1391339854e 100644 --- a/sw/source/filter/html/htmldrawreader.cxx +++ b/sw/source/filter/html/htmldrawreader.cxx @@ -175,7 +175,7 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, rCSS1PropInfo.m_nTop + nUpperSpace) ); aFrameSet.Put( SwFormatSurround(css::text::WrapTextMode_THROUGHT) ); } - else if( SVX_ADJUST_LEFT == rCSS1PropInfo.m_eFloat || + else if( SvxAdjust::Left == rCSS1PropInfo.m_eFloat || text::HoriOrientation::LEFT == eHoriOri ) { aAnchor.SetType( FLY_AT_PARA ); diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 3a6db55ae35c..110a67c201e6 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -1094,7 +1094,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( nSurround = text::WrapTextMode_THROUGHT; bSetSurround = true; } - else if( SVX_ADJUST_LEFT == rCSS1PropInfo.m_eFloat || + else if( SvxAdjust::Left == rCSS1PropInfo.m_eFloat || text::HoriOrientation::LEFT == eHoriOri ) { nAnchorType = text::TextContentAnchorType_AT_PARAGRAPH; diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 4b6f88d7a925..a4f98febe1a9 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -60,8 +60,8 @@ void SwHTMLParser::NewDivision( int nToken ) OUString aId, aHRef; OUString aStyle, aLang, aDir; OUString aClass; - SvxAdjust eAdjust = HTML_CENTER_ON==nToken ? SVX_ADJUST_CENTER - : SVX_ADJUST_END; + SvxAdjust eAdjust = HTML_CENTER_ON==nToken ? SvxAdjust::Center + : SvxAdjust::End; bool bHeader=false, bFooter=false; const HTMLOptions& rHTMLOptions = GetOptions(); @@ -366,7 +366,7 @@ void SwHTMLParser::NewDivision( int nToken ) pCntxt->SetAppendMode( AM_NOSPACE ); } - if( SVX_ADJUST_END != eAdjust ) + if( SvxAdjust::End != eAdjust ) { InsertAttr( &m_aAttrTab.pAdjust, SvxAdjustItem(eAdjust, RES_PARATR_ADJUST), pCntxt ); } diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 225901c57612..b473fe361c9d 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -534,7 +534,7 @@ public: SvxAdjust GetTableAdjust( bool bAny ) const { - return (m_bTableAdjustOfTag || bAny) ? m_eTableAdjust : SVX_ADJUST_END; + return (m_bTableAdjustOfTag || bAny) ? m_eTableAdjust : SvxAdjust::End; } sal_uInt16 GetHSpace() const { return m_nHSpace; } @@ -771,7 +771,7 @@ HTMLTableRow::HTMLTableRow(sal_uInt16 const nCells) bIsEndOfGroup(false), nHeight(0), nEmptyRows(0), - eAdjust(SVX_ADJUST_END), + eAdjust(SvxAdjust::End), eVertOri(text::VertOrientation::TOP), pBGBrush(nullptr), bBottomBorder(false) @@ -866,7 +866,7 @@ void HTMLTableRow::Shrink( sal_uInt16 nCells ) HTMLTableColumn::HTMLTableColumn(): bIsEndOfGroup(false), nWidth(0), bRelWidth(false), - eAdjust(SVX_ADJUST_END), eVertOri(text::VertOrientation::TOP), + eAdjust(SvxAdjust::End), eVertOri(text::VertOrientation::TOP), bLeftBorder(false) { for(SwFrameFormat* & rp : aFrameFormats) @@ -1436,7 +1436,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox, ->IsTextFormat( nNumFormat ); SfxItemSet aItemSet( *pFrameFormat->GetAttrSet().GetPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); - SvxAdjust eAdjust = SVX_ADJUST_END; + SvxAdjust eAdjust = SvxAdjust::End; SwContentNode *pCNd = nullptr; if( !bLock ) { @@ -1461,7 +1461,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox, pFrameFormat->SetFormatAttr( aItemSet ); if( bLock ) pFrameFormat->UnlockModify(); - else if( pCNd && SVX_ADJUST_END != eAdjust ) + else if( pCNd && SvxAdjust::End != eAdjust ) { SvxAdjustItem aAdjItem( eAdjust, RES_PARATR_ADJUST ); pCNd->SetAttr( aAdjItem ); @@ -1966,8 +1966,8 @@ inline HTMLTableCell *HTMLTable::GetCell( sal_uInt16 nRow, SvxAdjust HTMLTable::GetInheritedAdjust() const { SvxAdjust eAdjust = (m_nCurrentColumn<m_nCols ? ((*m_pColumns)[m_nCurrentColumn])->GetAdjust() - : SVX_ADJUST_END ); - if( SVX_ADJUST_END==eAdjust ) + : SvxAdjust::End ); + if( SvxAdjust::End==eAdjust ) eAdjust = (*m_pRows)[m_nCurrentRow]->GetAdjust(); return eAdjust; @@ -2392,15 +2392,15 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail, // The table either fits the page but shouldn't get a text frame, // or it's wider than the page so it doesn't need a text frame - case SVX_ADJUST_RIGHT: + case SvxAdjust::Right: // Don't be considerate of the right margin in right-adjusted tables eHoriOri = text::HoriOrientation::RIGHT; break; - case SVX_ADJUST_CENTER: + case SvxAdjust::Center: // Centred tables are not considerate of margins eHoriOri = text::HoriOrientation::CENTER; break; - case SVX_ADJUST_LEFT: + case SvxAdjust::Left: default: // left-adjusted tables are only considerate of the left margin eHoriOri = m_nLeftMargin ? text::HoriOrientation::LEFT_AND_WIDTH : text::HoriOrientation::LEFT; @@ -2548,8 +2548,8 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail, if( bIsInFlyFrame && !m_nWidth ) { SvxAdjust eAdjust = GetTableAdjust(false); - if (eAdjust != SVX_ADJUST_LEFT && - eAdjust != SVX_ADJUST_RIGHT) + if (eAdjust != SvxAdjust::Left && + eAdjust != SvxAdjust::Right) { // If a table with a width attribute isn't flowed around left or right // we'll stack it with a border of 100% width, so its size will @@ -3123,7 +3123,7 @@ CellSaveStruct::CellSaveStruct( SwHTMLParser& rParser, HTMLTable *pCurTable, nColl = RES_POOLCOLL_TABLE; } HTMLAttrContext *pCntxt = new HTMLAttrContext( nToken, nColl, aEmptyOUStr, true ); - if( SVX_ADJUST_END != m_eAdjust ) + if( SvxAdjust::End != m_eAdjust ) rParser.InsertAttr( &rParser.m_aAttrTab.pAdjust, SvxAdjustItem(m_eAdjust, RES_PARATR_ADJUST), pCntxt ); @@ -3401,8 +3401,8 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, // If the table is left or right adjusted or should be in a text frame, // it'll get one - bForceFrame = eTableAdjust == SVX_ADJUST_LEFT || - eTableAdjust == SVX_ADJUST_RIGHT || + bForceFrame = eTableAdjust == SvxAdjust::Left || + eTableAdjust == SvxAdjust::Right || pCurTable->HasToFly(); // The table either shouldn't get in a text frame and isn't in one @@ -3541,14 +3541,14 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, switch( pCurTable->GetTableAdjust(true) ) { - case SVX_ADJUST_RIGHT: + case SvxAdjust::Right: eHori = text::HoriOrientation::RIGHT; eSurround = css::text::WrapTextMode_LEFT; break; - case SVX_ADJUST_CENTER: + case SvxAdjust::Center: eHori = text::HoriOrientation::CENTER; break; - case SVX_ADJUST_LEFT: + case SvxAdjust::Left: eSurround = css::text::WrapTextMode_RIGHT; SAL_FALLTHROUGH; default: @@ -3741,7 +3741,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, case HTML_TABLE_ON: { bool bHasToFly = false; - SvxAdjust eTabAdjust = SVX_ADJUST_END; + SvxAdjust eTabAdjust = SvxAdjust::End; if( !m_pPendStack ) { // only if we create a new table, but not if we're still @@ -3759,9 +3759,9 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, { if( HTML_O_ALIGN==rOption.GetToken() ) { - SvxAdjust eAdjust = rOption.GetEnum( aHTMLPAlignTable, SVX_ADJUST_END ); - bNeedsSection = SVX_ADJUST_LEFT == eAdjust || - SVX_ADJUST_RIGHT == eAdjust; + SvxAdjust eAdjust = rOption.GetEnum( aHTMLPAlignTable, SvxAdjust::End ); + bNeedsSection = SvxAdjust::Left == eAdjust || + SvxAdjust::Right == eAdjust; break; } } @@ -3782,7 +3782,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, eTabAdjust = m_aAttrTab.pAdjust ? static_cast<const SvxAdjustItem&>(m_aAttrTab.pAdjust->GetItem()). GetAdjust() - : SVX_ADJUST_END; + : SvxAdjust::End; } HTMLTable *pSubTable = BuildTable( eTabAdjust, @@ -3794,8 +3794,8 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, // Only if the table is really complete if( pSubTable ) { - OSL_ENSURE( pSubTable->GetTableAdjust(false)!= SVX_ADJUST_LEFT && - pSubTable->GetTableAdjust(false)!= SVX_ADJUST_RIGHT, + OSL_ENSURE( pSubTable->GetTableAdjust(false)!= SvxAdjust::Left && + pSubTable->GetTableAdjust(false)!= SvxAdjust::Right, "links oder rechts ausgerichtete Tabellen gehoehren in Rahmen" ); HTMLTableCnts *pParentContents = @@ -3996,7 +3996,7 @@ public: bool bHasCells; RowSaveStruct() : - eAdjust( SVX_ADJUST_END ), eVertOri( text::VertOrientation::TOP ), bHasCells( false ) + eAdjust( SvxAdjust::End ), eVertOri( text::VertOrientation::TOP ), bHasCells( false ) {} }; @@ -4376,7 +4376,7 @@ struct TableColGrpSaveStruct : public SwPendingStackData inline TableColGrpSaveStruct::TableColGrpSaveStruct() : nColGrpSpan( 1 ), nColGrpWidth( 0 ), - bRelColGrpWidth( false ), eColGrpAdjust( SVX_ADJUST_END ), + bRelColGrpWidth( false ), eColGrpAdjust( SvxAdjust::End ), eColGrpVertOri( text::VertOrientation::TOP ) {} @@ -4661,7 +4661,7 @@ void SwHTMLParser::BuildTableCaption( HTMLTable *pCurTable ) HTMLAttrContext *pCntxt = new HTMLAttrContext( HTML_CAPTION_ON ); // Table headers are always centered - NewAttr( &m_aAttrTab.pAdjust, SvxAdjustItem(SVX_ADJUST_CENTER, RES_PARATR_ADJUST) ); + NewAttr( &m_aAttrTab.pAdjust, SvxAdjustItem(SvxAdjust::Center, RES_PARATR_ADJUST) ); HTMLAttrs &rAttrs = pCntxt->GetAttrs(); rAttrs.push_back( m_aAttrTab.pAdjust ); @@ -4698,7 +4698,7 @@ void SwHTMLParser::BuildTableCaption( HTMLTable *pCurTable ) } else { - BuildTable( SVX_ADJUST_END ); + BuildTable( SvxAdjust::End ); } if( SvParserState::Pending != GetStatus() ) { diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index 9d2d62573991..1ba6d9e71d8e 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -150,10 +150,10 @@ static CSS1PropertyEnum const aBGVertPosTable[] = static CSS1PropertyEnum const aTextAlignTable[] = { - { "left", SVX_ADJUST_LEFT }, - { "center", SVX_ADJUST_CENTER }, - { "right", SVX_ADJUST_RIGHT }, - { "justify", SVX_ADJUST_BLOCK }, + { "left", (sal_uInt16)SvxAdjust::Left }, + { "center", (sal_uInt16)SvxAdjust::Center }, + { "right", (sal_uInt16)SvxAdjust::Right }, + { "justify", (sal_uInt16)SvxAdjust::Block }, { nullptr, 0 } }; @@ -183,9 +183,9 @@ static CSS1PropertyEnum const aBorderStyleTable[] = static CSS1PropertyEnum const aFloatTable[] = { - { "left", SVX_ADJUST_LEFT }, - { "right", SVX_ADJUST_RIGHT }, - { "none", SVX_ADJUST_END }, + { "left", (sal_uInt16)SvxAdjust::Left }, + { "right", (sal_uInt16)SvxAdjust::Right }, + { "none", (sal_uInt16)SvxAdjust::End }, { nullptr, 0 } }; @@ -427,7 +427,7 @@ void SvxCSS1PropertyInfo::Clear() m_bLeftMargin = m_bRightMargin = m_bTextIndent = false; m_bNumbering = m_bBullet = false; m_nLeftMargin = m_nRightMargin = 0; - m_eFloat = SVX_ADJUST_END; + m_eFloat = SvxAdjust::End; m_ePosition = SVX_CSS1_POS_NONE; m_nTopBorderDistance = m_nBottomBorderDistance = @@ -491,7 +491,7 @@ void SvxCSS1PropertyInfo::Merge( const SvxCSS1PropertyInfo& rProp ) m_nColumnCount = rProp.m_nColumnCount; - if( rProp.m_eFloat != SVX_ADJUST_END ) + if( rProp.m_eFloat != SvxAdjust::End ) m_eFloat = rProp.m_eFloat; if( rProp.m_ePosition != SVX_CSS1_POS_NONE ) diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index d8d3620e14b5..e4f63e2d5b52 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -128,12 +128,12 @@ using namespace ::com::sun::star; // <P ALIGN=xxx>, <Hn ALIGN=xxx>, <TD ALIGN=xxx> usw. HTMLOptionEnum<SvxAdjust> aHTMLPAlignTable[] = { - { OOO_STRING_SVTOOLS_HTML_AL_left, SVX_ADJUST_LEFT }, - { OOO_STRING_SVTOOLS_HTML_AL_center, SVX_ADJUST_CENTER }, - { OOO_STRING_SVTOOLS_HTML_AL_middle, SVX_ADJUST_CENTER }, // Netscape - { OOO_STRING_SVTOOLS_HTML_AL_right, SVX_ADJUST_RIGHT }, - { OOO_STRING_SVTOOLS_HTML_AL_justify, SVX_ADJUST_BLOCK }, - { OOO_STRING_SVTOOLS_HTML_AL_char, SVX_ADJUST_LEFT }, + { OOO_STRING_SVTOOLS_HTML_AL_left, SvxAdjust::Left }, + { OOO_STRING_SVTOOLS_HTML_AL_center, SvxAdjust::Center }, + { OOO_STRING_SVTOOLS_HTML_AL_middle, SvxAdjust::Center }, // Netscape + { OOO_STRING_SVTOOLS_HTML_AL_right, SvxAdjust::Right }, + { OOO_STRING_SVTOOLS_HTML_AL_justify, SvxAdjust::Block }, + { OOO_STRING_SVTOOLS_HTML_AL_char, SvxAdjust::Left }, { nullptr, (SvxAdjust)0 } }; @@ -274,7 +274,7 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCursor, SvStream& rIn, #ifdef DBG_UTIL m_nContinue( 0 ), #endif - m_eParaAdjust( SVX_ADJUST_END ), + m_eParaAdjust( SvxAdjust::End ), m_bDocInitalized( false ), m_bSetModEnabled( false ), m_bInFloatingFrame( false ), @@ -1669,7 +1669,7 @@ void SwHTMLParser::NextToken( int nToken ) case HTML_TABLE_ON: if( m_pPendStack ) - BuildTable( SVX_ADJUST_END ); + BuildTable( SvxAdjust::End ); else { if( m_nOpenParaToken ) @@ -1686,7 +1686,7 @@ void SwHTMLParser::NextToken( int nToken ) SvxAdjust eAdjust = m_aAttrTab.pAdjust ? static_cast<const SvxAdjustItem&>(m_aAttrTab.pAdjust->GetItem()). GetAdjust() - : SVX_ADJUST_END; + : SvxAdjust::End; BuildTable( eAdjust ); } else @@ -3853,7 +3853,7 @@ void SwHTMLParser::NewPara() else AddParSpace(); - m_eParaAdjust = SVX_ADJUST_END; + m_eParaAdjust = SvxAdjust::End; OUString aId, aStyle, aClass, aLang, aDir; const HTMLOptions& rHTMLOptions = GetOptions(); @@ -3905,7 +3905,7 @@ void SwHTMLParser::NewPara() } } - if( SVX_ADJUST_END != m_eParaAdjust ) + if( SvxAdjust::End != m_eParaAdjust ) InsertAttr( &m_aAttrTab.pAdjust, SvxAdjustItem(m_eParaAdjust, RES_PARATR_ADJUST), pCntxt ); // und auf den Stack packen @@ -3971,7 +3971,7 @@ void SwHTMLParser::EndPara( bool bReal ) void SwHTMLParser::NewHeading( int nToken ) { - m_eParaAdjust = SVX_ADJUST_END; + m_eParaAdjust = SvxAdjust::End; OUString aId, aStyle, aClass, aLang, aDir; @@ -4039,7 +4039,7 @@ void SwHTMLParser::NewHeading( int nToken ) } } - if( SVX_ADJUST_END != m_eParaAdjust ) + if( SvxAdjust::End != m_eParaAdjust ) InsertAttr( &m_aAttrTab.pAdjust, SvxAdjustItem(m_eParaAdjust, RES_PARATR_ADJUST), pCntxt ); // udn auf den Stack packen @@ -5181,7 +5181,7 @@ void SwHTMLParser::InsertHorzRule() sal_uInt16 nSize = 0; sal_uInt16 nWidth = 0; - SvxAdjust eAdjust = SVX_ADJUST_END; + SvxAdjust eAdjust = SvxAdjust::End; bool bPrcWidth = false; bool bNoShade = false; @@ -5303,13 +5303,13 @@ void SwHTMLParser::InsertHorzRule() switch( eAdjust ) { - case SVX_ADJUST_RIGHT: + case SvxAdjust::Right: aLRItem.SetTextLeft( (sal_uInt16)nDist ); break; - case SVX_ADJUST_LEFT: + case SvxAdjust::Left: aLRItem.SetRight( (sal_uInt16)nDist ); break; - case SVX_ADJUST_CENTER: + case SvxAdjust::Center: default: nDist /= 2; aLRItem.SetTextLeft( (sal_uInt16)nDist ); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 875caf9d1a4e..ec873a5a351d 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4046,7 +4046,7 @@ void DocxAttributeOutput::OutputDefaultItem(const SfxPoolItem& rHt) bMustWrite = static_cast< const SvxLineSpacingItem& >(rHt).GetInterLineSpaceRule() != SvxInterLineSpaceRule::Off; break; case RES_PARATR_ADJUST: - bMustWrite = static_cast< const SvxAdjustItem& >(rHt).GetAdjust() != SVX_ADJUST_LEFT; + bMustWrite = static_cast< const SvxAdjustItem& >(rHt).GetAdjust() != SvxAdjust::Left; break; case RES_PARATR_SPLIT: bMustWrite = !static_cast< const SvxFormatSplitItem& >(rHt).GetValue(); @@ -6164,8 +6164,8 @@ void DocxAttributeOutput::NumberingLevel( sal_uInt8 nLevel, bool ecmaDialect = ( m_rExport.GetFilter().getVersion() == oox::core::ECMA_DIALECT ); switch ( eAdjust ) { - case SVX_ADJUST_CENTER: pJc = "center"; break; - case SVX_ADJUST_RIGHT: pJc = !ecmaDialect ? "end" : "right"; break; + case SvxAdjust::Center: pJc = "center"; break; + case SvxAdjust::Right: pJc = !ecmaDialect ? "end" : "right"; break; default: pJc = !ecmaDialect ? "start" : "left"; break; } m_pSerializer->singleElementNS( XML_w, XML_lvlJc, @@ -7085,7 +7085,7 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust ) switch ( rAdjust.GetAdjust() ) { - case SVX_ADJUST_LEFT: + case SvxAdjust::Left: if ( bEcma ) { if ( bRtl ) @@ -7098,7 +7098,7 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust ) else pAdjustString = "start"; break; - case SVX_ADJUST_RIGHT: + case SvxAdjust::Right: if ( bEcma ) { if ( bRtl ) @@ -7111,11 +7111,11 @@ void DocxAttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust ) else pAdjustString = "end"; break; - case SVX_ADJUST_BLOCKLINE: - case SVX_ADJUST_BLOCK: + case SvxAdjust::BlockLine: + case SvxAdjust::Block: pAdjustString = "both"; break; - case SVX_ADJUST_CENTER: + case SvxAdjust::Center: pAdjustString = "center"; break; default: diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 5bb6d50e6110..b7aa4193a351 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1483,10 +1483,10 @@ void RtfAttributeOutput::NumberingLevel(sal_uInt8 nLevel, switch (eAdjust) { - case SVX_ADJUST_CENTER: + case SvxAdjust::Center: nVal = 1; break; - case SVX_ADJUST_RIGHT: + case SvxAdjust::Right: nVal = 2; break; default: @@ -2706,17 +2706,17 @@ void RtfAttributeOutput::ParaAdjust(const SvxAdjustItem& rAdjust) { switch (rAdjust.GetAdjust()) { - case SVX_ADJUST_LEFT: + case SvxAdjust::Left: m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QL); break; - case SVX_ADJUST_RIGHT: + case SvxAdjust::Right: m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QR); break; - case SVX_ADJUST_BLOCKLINE: - case SVX_ADJUST_BLOCK: + case SvxAdjust::BlockLine: + case SvxAdjust::Block: m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QJ); break; - case SVX_ADJUST_CENTER: + case SvxAdjust::Center: m_aStyles.append(OOO_STRING_SVTOOLS_RTF_QC); break; default: diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index d4d1843a623f..c9cc17982472 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -124,7 +124,7 @@ sal_Int16 GetWordFirstLineOffset(const SwNumFormat &rFormat) "<GetWordFirstLineOffset> - misusage: position-and-space-mode does not equal LABEL_WIDTH_AND_POSITION" ); short nFirstLineOffset; - if (rFormat.GetNumAdjust() == SVX_ADJUST_RIGHT) + if (rFormat.GetNumAdjust() == SvxAdjust::Right) nFirstLineOffset = -rFormat.GetCharTextDistance(); else nFirstLineOffset = rFormat.GetFirstLineOffset(); @@ -257,10 +257,10 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/, sal_uInt8 nAlign; switch ( eAdjust ) { - case SVX_ADJUST_CENTER: + case SvxAdjust::Center: nAlign = 1; break; - case SVX_ADJUST_RIGHT: + case SvxAdjust::Right: nAlign = 2; break; default: diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index d3941a2ef10e..5793aca424cb 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -4348,19 +4348,19 @@ void WW8AttributeOutput::ParaAdjust( const SvxAdjustItem& rAdjust ) sal_uInt8 nAdjBiDi = 255; switch ( rAdjust.GetAdjust() ) { - case SVX_ADJUST_LEFT: + case SvxAdjust::Left: nAdj = 0; nAdjBiDi = 2; break; - case SVX_ADJUST_RIGHT: + case SvxAdjust::Right: nAdj = 2; nAdjBiDi = 0; break; - case SVX_ADJUST_BLOCKLINE: - case SVX_ADJUST_BLOCK: + case SvxAdjust::BlockLine: + case SvxAdjust::Block: nAdj = nAdjBiDi = 3; break; - case SVX_ADJUST_CENTER: + case SvxAdjust::Center: nAdj = nAdjBiDi = 1; break; default: diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 55379a6afae6..1fb45725c4b4 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1264,9 +1264,9 @@ long GetListFirstLineIndent(const SwNumFormat &rFormat) SvxAdjust eAdj = rFormat.GetNumAdjust(); long nReverseListIndented; - if (eAdj == SVX_ADJUST_RIGHT) + if (eAdj == SvxAdjust::Right) nReverseListIndented = -rFormat.GetCharTextDistance(); - else if (eAdj == SVX_ADJUST_CENTER) + else if (eAdj == SvxAdjust::Center) nReverseListIndented = rFormat.GetFirstLineOffset()/2; else nReverseListIndented = rFormat.GetFirstLineOffset(); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 6257201ba308..7d50bddad22a 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -618,8 +618,8 @@ static void SetBaseAnlv(SwNumFormat &rNum, WW8_ANLV const &rAV, sal_uInt8 nSwLev SVX_NUM_CHARS_UPPER_LETTER_N, SVX_NUM_CHARS_LOWER_LETTER_N, SVX_NUM_ARABIC, SVX_NUM_ARABIC, SVX_NUM_ARABIC }; - static const SvxAdjust eAdjA[4] = { SVX_ADJUST_LEFT, - SVX_ADJUST_RIGHT, SVX_ADJUST_LEFT, SVX_ADJUST_LEFT }; + static const SvxAdjust eAdjA[4] = { SvxAdjust::Left, + SvxAdjust::Right, SvxAdjust::Left, SvxAdjust::Left }; if (rAV.nfc < 8) { rNum.SetNumberingType( eNumA[ rAV.nfc ] ); } else { diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index dbe6c0c35d8b..0c7235248b9a 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -889,23 +889,23 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, SfxItemSet*& rpItemSet, switch( aLVL.nAlign ) { case 0: - eAdj = SVX_ADJUST_LEFT; + eAdj = SvxAdjust::Left; break; case 1: - eAdj = SVX_ADJUST_CENTER; + eAdj = SvxAdjust::Center; break; case 2: - eAdj = SVX_ADJUST_RIGHT; + eAdj = SvxAdjust::Right; break; case 3: // Writer here cannot do block justification - eAdj = SVX_ADJUST_LEFT; + eAdj = SvxAdjust::Left; break; default: // undefined value OSL_ENSURE( false, "Value of aLVL.nAlign is not supported" ); // take default - eAdj = SVX_ADJUST_LEFT; + eAdj = SvxAdjust::Left; break; } @@ -941,7 +941,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, SfxItemSet*& rpItemSet, if ( rNumFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) { - if (eAdj == SVX_ADJUST_RIGHT) + if (eAdj == SvxAdjust::Right) { rNumFormat.SetAbsLSpace(aLVL.nDxaLeft); rNumFormat.SetFirstLineOffset(-aLVL.nDxaLeft); @@ -1561,10 +1561,10 @@ SwNumRule* WW8ListManager::GetNumRuleForActivation(sal_uInt16 nLFOPosition, SwNumFormat aFormat(rLFOInfo.pNumRule->Get(nLevel)); if (rReader.IsRightToLeft() && nLastLFOPosition != nLFOPosition) { - if ( aFormat.GetNumAdjust() == SVX_ADJUST_RIGHT) - aFormat.SetNumAdjust(SVX_ADJUST_LEFT); - else if ( aFormat.GetNumAdjust() == SVX_ADJUST_LEFT) - aFormat.SetNumAdjust(SVX_ADJUST_RIGHT); + if ( aFormat.GetNumAdjust() == SvxAdjust::Right) + aFormat.SetNumAdjust(SvxAdjust::Left); + else if ( aFormat.GetNumAdjust() == SvxAdjust::Left) + aFormat.SetNumAdjust(SvxAdjust::Right); rLFOInfo.pNumRule->Set(nLevel, aFormat); } nLastLFOPosition = nLFOPosition; diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 5a59b80e16af..e29362b396e5 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -4339,7 +4339,7 @@ void SwWW8ImplReader::Read_Justify( sal_uInt16, const sal_uInt8* pData, short nL return; } - SvxAdjust eAdjust(SVX_ADJUST_LEFT); + SvxAdjust eAdjust(SvxAdjust::Left); bool bDistributed = false; switch (*pData) { @@ -4347,22 +4347,22 @@ void SwWW8ImplReader::Read_Justify( sal_uInt16, const sal_uInt8* pData, short nL case 0: break; case 1: - eAdjust = SVX_ADJUST_CENTER; + eAdjust = SvxAdjust::Center; break; case 2: - eAdjust = SVX_ADJUST_RIGHT; + eAdjust = SvxAdjust::Right; break; case 3: - eAdjust = SVX_ADJUST_BLOCK; + eAdjust = SvxAdjust::Block; break; case 4: - eAdjust = SVX_ADJUST_BLOCK; + eAdjust = SvxAdjust::Block; bDistributed = true; break; } SvxAdjustItem aAdjust(eAdjust, RES_PARATR_ADJUST); if (bDistributed) - aAdjust.SetLastBlock(SVX_ADJUST_BLOCK); + aAdjust.SetLastBlock(SvxAdjust::Block); NewAttr(aAdjust); } @@ -4398,7 +4398,7 @@ void SwWW8ImplReader::Read_RTLJustify( sal_uInt16, const sal_uInt8* pData, short Read_Justify(0x2403 /*dummy*/, pData, nLen); else { - SvxAdjust eAdjust(SVX_ADJUST_RIGHT); + SvxAdjust eAdjust(SvxAdjust::Right); bool bDistributed = false; switch (*pData) { @@ -4406,22 +4406,22 @@ void SwWW8ImplReader::Read_RTLJustify( sal_uInt16, const sal_uInt8* pData, short case 0: break; case 1: - eAdjust = SVX_ADJUST_CENTER; + eAdjust = SvxAdjust::Center; break; case 2: - eAdjust = SVX_ADJUST_LEFT; + eAdjust = SvxAdjust::Left; break; case 3: - eAdjust = SVX_ADJUST_BLOCK; + eAdjust = SvxAdjust::Block; break; case 4: - eAdjust = SVX_ADJUST_BLOCK; + eAdjust = SvxAdjust::Block; bDistributed = true; break; } SvxAdjustItem aAdjust(eAdjust, RES_PARATR_ADJUST); if (bDistributed) - aAdjust.SetLastBlock(SVX_ADJUST_BLOCK); + aAdjust.SetLastBlock(SvxAdjust::Block); NewAttr(aAdjust); } diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 456bf1a488b7..6fda9ca1ef36 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -2191,8 +2191,8 @@ VclPtr<SfxTabPage> SwSectionIndentTabPage::Create( vcl::Window* pParent, const S void SwSectionIndentTabPage::SetWrtShell(SwWrtShell& rSh) { //set sensible values at the preview - m_pPreviewWin->SetAdjust(SVX_ADJUST_BLOCK); - m_pPreviewWin->SetLastLine(SVX_ADJUST_BLOCK); + m_pPreviewWin->SetAdjust(SvxAdjust::Block); + m_pPreviewWin->SetLastLine(SvxAdjust::Block); const SwRect& rPageRect = rSh.GetAnyCurRect( CurRectType::Page ); Size aPageSize(rPageRect.Width(), rPageRect.Height()); m_pPreviewWin->SetSize(aPageSize); diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx index 757b2d78c15b..f8e699ab0f2a 100644 --- a/sw/source/ui/misc/num.cxx +++ b/sw/source/ui/misc/num.cxx @@ -311,9 +311,9 @@ void SwNumPositionTabPage::InitControls() if(bSameAdjust) { sal_Int32 nPos = 1; // centered - if(aNumFormatArr[nLvl]->GetNumAdjust() == SVX_ADJUST_LEFT) + if(aNumFormatArr[nLvl]->GetNumAdjust() == SvxAdjust::Left) nPos = 0; - else if(aNumFormatArr[nLvl]->GetNumAdjust() == SVX_ADJUST_RIGHT) + else if(aNumFormatArr[nLvl]->GetNumAdjust() == SvxAdjust::Right) nPos = 2; m_pAlignLB->SelectEntryPos(nPos); m_pAlign2LB->SelectEntryPos( nPos ); @@ -600,11 +600,11 @@ IMPL_LINK_NOARG(SwNumPositionTabPage, EditModifyHdl, ListBox&, void) const sal_Int32 nPos = m_pAlignLB->IsVisible() ? m_pAlignLB->GetSelectEntryPos() : m_pAlign2LB->GetSelectEntryPos(); - SvxAdjust eAdjust = SVX_ADJUST_CENTER; + SvxAdjust eAdjust = SvxAdjust::Center; if(nPos == 0) - eAdjust = SVX_ADJUST_LEFT; + eAdjust = SvxAdjust::Left; else if(nPos == 2) - eAdjust = SVX_ADJUST_RIGHT; + eAdjust = SvxAdjust::Right; aNumFormat.SetNumAdjust( eAdjust ); pActNum->Set(i, aNumFormat); } diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 190b4a372b87..c905b772f774 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -755,10 +755,10 @@ MAKENUMSTR: const SvxAdjustItem& rAdj = aCurData.GetBoxFormat(nFormatIndex).GetAdjust(); switch (rAdj.GetAdjust()) { - case SVX_ADJUST_LEFT: + case SvxAdjust::Left: aPos.X() += FRAME_OFFSET; break; - case SVX_ADJUST_RIGHT: + case SvxAdjust::Right: aPos.X() += nRightX; break; default: diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx index 5f3913e52488..d2c3e85b4d7f 100644 --- a/sw/source/uibase/app/docshini.cxx +++ b/sw/source/uibase/app/docshini.cxx @@ -311,7 +311,7 @@ bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) if( !bHTMLTemplSet && FRMDIR_HORI_RIGHT_TOP == GetDefaultFrameDirection(GetAppLanguage()) ) { - m_pDoc->SetDefault( SvxAdjustItem(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST ) ); + m_pDoc->SetDefault( SvxAdjustItem(SvxAdjust::Right, RES_PARATR_ADJUST ) ); } // #i29550# diff --git a/sw/source/uibase/ribbar/concustomshape.cxx b/sw/source/uibase/ribbar/concustomshape.cxx index aa158975f3fa..42e31d9c0361 100644 --- a/sw/source/uibase/ribbar/concustomshape.cxx +++ b/sw/source/uibase/ribbar/concustomshape.cxx @@ -160,7 +160,7 @@ void ConstCustomShape::SetAttributes( SdrObject* pObj ) } if ( !bAttributesAppliedFromGallery ) { - pObj->SetMergedItem( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST ) ); + pObj->SetMergedItem( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) ); pObj->SetMergedItem( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) ); pObj->SetMergedItem( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) ); pObj->SetMergedItem( makeSdrTextAutoGrowHeightItem( false ) ); diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 3477a7ea3621..df7ce705bf7e 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -306,16 +306,16 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) case SID_ATTR_CHAR_AUTOKERN : nEEWhich = EE_CHAR_PAIRKERNING; break; case SID_ATTR_CHAR_ESCAPEMENT: nEEWhich = EE_CHAR_ESCAPEMENT; break; case SID_ATTR_PARA_ADJUST_LEFT: - aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_LEFT, EE_PARA_JUST)); + aNewAttr.Put(SvxAdjustItem(SvxAdjust::Left, EE_PARA_JUST)); break; case SID_ATTR_PARA_ADJUST_CENTER: - aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST)); + aNewAttr.Put(SvxAdjustItem(SvxAdjust::Center, EE_PARA_JUST)); break; case SID_ATTR_PARA_ADJUST_RIGHT: - aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_RIGHT, EE_PARA_JUST)); + aNewAttr.Put(SvxAdjustItem(SvxAdjust::Right, EE_PARA_JUST)); break; case SID_ATTR_PARA_ADJUST_BLOCK: - aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_BLOCK, EE_PARA_JUST)); + aNewAttr.Put(SvxAdjustItem(SvxAdjust::Block, EE_PARA_JUST)); break; case SID_ATTR_PARA_LINESPACE_10: @@ -581,21 +581,21 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR, 0 ); - sal_uInt16 nAdjust = SVX_ADJUST_LEFT; + SvxAdjust nAdjust = SvxAdjust::Left; if( SfxItemState::SET == aEditAttr.GetItemState(EE_PARA_JUST, true, &pPoolItem ) ) - nAdjust = static_cast<const SvxAdjustItem*>(pPoolItem)->GetEnumValue(); + nAdjust = static_cast<const SvxAdjustItem*>(pPoolItem)->GetAdjust(); if( bLeftToRight ) { aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) ); - if( nAdjust == SVX_ADJUST_RIGHT ) - aAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) ); + if( nAdjust == SvxAdjust::Right ) + aAttr.Put( SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST ) ); } else { aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) ); - if( nAdjust == SVX_ADJUST_LEFT ) - aAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) ); + if( nAdjust == SvxAdjust::Left ) + aAttr.Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) ); } pOLV->SetAttribs(aAttr); break; @@ -744,15 +744,15 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) case SID_ATTR_PARA_ADJUST_CENTER: case SID_ATTR_PARA_ADJUST_BLOCK: { - int eAdjust = 0; + SvxAdjust eAdjust = SvxAdjust::Left; if (nWhich==SID_ATTR_PARA_ADJUST_LEFT) - eAdjust = SVX_ADJUST_LEFT; + eAdjust = SvxAdjust::Left; else if (nWhich==SID_ATTR_PARA_ADJUST_RIGHT) - eAdjust = SVX_ADJUST_RIGHT; + eAdjust = SvxAdjust::Right; else if (nWhich==SID_ATTR_PARA_ADJUST_CENTER) - eAdjust = SVX_ADJUST_CENTER; + eAdjust = SvxAdjust::Center; else if (nWhich==SID_ATTR_PARA_ADJUST_BLOCK) - eAdjust = SVX_ADJUST_BLOCK; + eAdjust = SvxAdjust::Block; const SfxPoolItem *pAdjust = nullptr; aEditAttr.GetItemState( EE_PARA_JUST, false, &pAdjust); diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index b520468764e5..8cdfebd4bea8 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -201,16 +201,16 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) case SID_ATTR_CHAR_AUTOKERN : nEEWhich = EE_CHAR_PAIRKERNING; break; case SID_ATTR_CHAR_ESCAPEMENT: nEEWhich = EE_CHAR_ESCAPEMENT; break; case SID_ATTR_PARA_ADJUST_LEFT: - aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_LEFT, EE_PARA_JUST)); + aNewAttr.Put(SvxAdjustItem(SvxAdjust::Left, EE_PARA_JUST)); break; case SID_ATTR_PARA_ADJUST_CENTER: - aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST)); + aNewAttr.Put(SvxAdjustItem(SvxAdjust::Center, EE_PARA_JUST)); break; case SID_ATTR_PARA_ADJUST_RIGHT: - aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_RIGHT, EE_PARA_JUST)); + aNewAttr.Put(SvxAdjustItem(SvxAdjust::Right, EE_PARA_JUST)); break; case SID_ATTR_PARA_ADJUST_BLOCK: - aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_BLOCK, EE_PARA_JUST)); + aNewAttr.Put(SvxAdjustItem(SvxAdjust::Block, EE_PARA_JUST)); break; case SID_ATTR_PARA_LRSPACE: { @@ -526,21 +526,21 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR, 0 ); - sal_uInt16 nAdjust = SVX_ADJUST_LEFT; + SvxAdjust nAdjust = SvxAdjust::Left; if( SfxItemState::SET == aEditAttr.GetItemState(EE_PARA_JUST, true, &pPoolItem ) ) - nAdjust = static_cast<const SvxAdjustItem*>(pPoolItem)->GetEnumValue(); + nAdjust = static_cast<const SvxAdjustItem*>(pPoolItem)->GetAdjust(); if( bLeftToRight ) { aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) ); - if( nAdjust == SVX_ADJUST_RIGHT ) - aAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) ); + if( nAdjust == SvxAdjust::Right ) + aAttr.Put( SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST ) ); } else { aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) ); - if( nAdjust == SVX_ADJUST_LEFT ) - aAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) ); + if( nAdjust == SvxAdjust::Left ) + aAttr.Put( SvxAdjustItem( SvxAdjust::Right, EE_PARA_JUST ) ); } pTmpView->SetAttributes( aAttr ); rSh.GetView().BeginTextEdit( pTmpObj, pTmpPV, &rSh.GetView().GetEditWin() ); @@ -593,7 +593,8 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet) SfxItemSet aEditAttr( pOLV->GetAttribs() ); const SfxPoolItem *pAdjust = nullptr, *pLSpace = nullptr, *pEscItem = nullptr; - int eAdjust, nLSpace; + SvxAdjust eAdjust; + int nLSpace; SvxEscapement nEsc; while(nWhich) @@ -626,10 +627,10 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet) break; } - case SID_ATTR_PARA_ADJUST_LEFT: eAdjust = SVX_ADJUST_LEFT; goto ASK_ADJUST; - case SID_ATTR_PARA_ADJUST_RIGHT: eAdjust = SVX_ADJUST_RIGHT; goto ASK_ADJUST; - case SID_ATTR_PARA_ADJUST_CENTER: eAdjust = SVX_ADJUST_CENTER; goto ASK_ADJUST; - case SID_ATTR_PARA_ADJUST_BLOCK: eAdjust = SVX_ADJUST_BLOCK; goto ASK_ADJUST; + case SID_ATTR_PARA_ADJUST_LEFT: eAdjust = SvxAdjust::Left; goto ASK_ADJUST; + case SID_ATTR_PARA_ADJUST_RIGHT: eAdjust = SvxAdjust::Right; goto ASK_ADJUST; + case SID_ATTR_PARA_ADJUST_CENTER: eAdjust = SvxAdjust::Center; goto ASK_ADJUST; + case SID_ATTR_PARA_ADJUST_BLOCK: eAdjust = SvxAdjust::Block; goto ASK_ADJUST; ASK_ADJUST: { if( !pAdjust ) diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index 0358c575001c..8ac5b0f90841 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -325,7 +325,7 @@ void SwTextShell::ExecParaAttr(SfxRequest &rReq) { const SvxAdjustItem& rAdj = static_cast<const SvxAdjustItem&>( pArgs->Get(RES_PARATR_ADJUST) ); SvxAdjustItem aAdj( rAdj.GetAdjust(), RES_PARATR_ADJUST ); - if ( rAdj.GetAdjust() == SVX_ADJUST_BLOCK ) + if ( rAdj.GetAdjust() == SvxAdjust::Block ) { aAdj.SetLastBlock( rAdj.GetLastBlock() ); aAdj.SetOneWord( rAdj.GetOneWord() ); @@ -335,10 +335,10 @@ void SwTextShell::ExecParaAttr(SfxRequest &rReq) } } break; - case SID_ATTR_PARA_ADJUST_LEFT: eAdjst = SVX_ADJUST_LEFT; goto SET_ADJUST; - case SID_ATTR_PARA_ADJUST_RIGHT: eAdjst = SVX_ADJUST_RIGHT; goto SET_ADJUST; - case SID_ATTR_PARA_ADJUST_CENTER: eAdjst = SVX_ADJUST_CENTER; goto SET_ADJUST; - case SID_ATTR_PARA_ADJUST_BLOCK: eAdjst = SVX_ADJUST_BLOCK; goto SET_ADJUST; + case SID_ATTR_PARA_ADJUST_LEFT: eAdjst = SvxAdjust::Left; goto SET_ADJUST; + case SID_ATTR_PARA_ADJUST_RIGHT: eAdjst = SvxAdjust::Right; goto SET_ADJUST; + case SID_ATTR_PARA_ADJUST_CENTER: eAdjst = SvxAdjust::Center; goto SET_ADJUST; + case SID_ATTR_PARA_ADJUST_BLOCK: eAdjst = SvxAdjust::Block; goto SET_ADJUST; SET_ADJUST: { aSet.Put(SvxAdjustItem(eAdjst,RES_PARATR_ADJUST)); @@ -381,10 +381,10 @@ SET_LINESPACE: SfxItemState eAdjustState = aAdjustSet.GetItemState(RES_PARATR_ADJUST, false); if(eAdjustState >= SfxItemState::DEFAULT) { - int eAdjust = (int)static_cast<const SvxAdjustItem& >( + SvxAdjust eAdjust = static_cast<const SvxAdjustItem& >( aAdjustSet.Get(RES_PARATR_ADJUST)).GetAdjust(); - bChgAdjust = (SVX_ADJUST_LEFT == eAdjust && SID_ATTR_PARA_RIGHT_TO_LEFT == nSlot) || - (SVX_ADJUST_RIGHT == eAdjust && SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot); + bChgAdjust = (SvxAdjust::Left == eAdjust && SID_ATTR_PARA_RIGHT_TO_LEFT == nSlot) || + (SvxAdjust::Right == eAdjust && SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot); } else bChgAdjust = true; @@ -397,7 +397,7 @@ SET_LINESPACE: if (bChgAdjust) { SvxAdjust eAdjust = (SID_ATTR_PARA_LEFT_TO_RIGHT == nSlot) ? - SVX_ADJUST_LEFT : SVX_ADJUST_RIGHT; + SvxAdjust::Left : SvxAdjust::Right; SvxAdjustItem aAdjust( eAdjust, RES_PARATR_ADJUST ); aSet.Put( aAdjust ); aAdjust.SetWhich(SID_ATTR_PARA_ADJUST); @@ -411,11 +411,11 @@ SET_LINESPACE: for(sal_uInt16 i = 0; i < aRule.GetLevelCount(); i++) { SvxNumberFormat aFormat(aRule.GetLevel(i)); - if(SVX_ADJUST_LEFT == aFormat.GetNumAdjust()) - aFormat.SetNumAdjust( SVX_ADJUST_RIGHT ); + if(SvxAdjust::Left == aFormat.GetNumAdjust()) + aFormat.SetNumAdjust( SvxAdjust::Right ); - else if(SVX_ADJUST_RIGHT == aFormat.GetNumAdjust()) - aFormat.SetNumAdjust( SVX_ADJUST_LEFT ); + else if(SvxAdjust::Right == aFormat.GetNumAdjust()) + aFormat.SetNumAdjust( SvxAdjust::Left ); aRule.SetLevel(i, aFormat, aRule.Get(i) != nullptr); } @@ -548,13 +548,17 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) bool bFlag = false; SfxBoolItem aFlagItem; const SfxPoolItem* pItem = nullptr; - int eAdjust = -1; // Illegal value to recognize DONTCARE. + SvxAdjust eAdjust = SvxAdjust::Left; + bool bAdjustGood = false; SfxItemState eState = aCoreSet.GetItemState(RES_PARATR_ADJUST, false, &pItem); if( SfxItemState::DEFAULT == eState ) pItem = &rPool.GetDefaultItem(RES_PARATR_ADJUST); if( SfxItemState::DEFAULT <= eState ) - eAdjust = (int)static_cast<const SvxAdjustItem* >( pItem)->GetAdjust(); + { + eAdjust = static_cast<const SvxAdjustItem* >( pItem)->GetAdjust(); + bAdjustGood = true; + } short nEsc = 0; eState = aCoreSet.GetItemState(RES_CHRATR_ESCAPEMENT, false, &pItem); @@ -598,42 +602,42 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) bFlag = eCaseMap == SVX_CASEMAP_KAPITAELCHEN; break; case SID_ATTR_PARA_ADJUST_LEFT: - if (eAdjust == -1) + if (!bAdjustGood) { rSet.InvalidateItem( nSlot ); nSlot = 0; } else - bFlag = SVX_ADJUST_LEFT == eAdjust; + bFlag = SvxAdjust::Left == eAdjust; break; case SID_ATTR_PARA_ADJUST_RIGHT: - if (eAdjust == -1) + if (!bAdjustGood) { rSet.InvalidateItem( nSlot ); nSlot = 0; } else - bFlag = SVX_ADJUST_RIGHT == eAdjust; + bFlag = SvxAdjust::Right == eAdjust; break; case SID_ATTR_PARA_ADJUST_CENTER: - if (eAdjust == -1) + if (!bAdjustGood) { rSet.InvalidateItem( nSlot ); nSlot = 0; } else - bFlag = SVX_ADJUST_CENTER == eAdjust; + bFlag = SvxAdjust::Center == eAdjust; break; case SID_ATTR_PARA_ADJUST_BLOCK: { - if (eAdjust == -1) + if (!bAdjustGood) { rSet.InvalidateItem( nSlot ); nSlot = 0; } else { - bFlag = SVX_ADJUST_BLOCK == eAdjust; + bFlag = SvxAdjust::Block == eAdjust; sal_uInt16 nHtmlMode = GetHtmlMode(rSh.GetView().GetDocShell()); if((nHtmlMode & HTMLMODE_ON) && !(nHtmlMode & HTMLMODE_FULL_STYLES )) { @@ -707,10 +711,10 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) } break; case SID_ATTR_PARA_ADJUST: - if (eAdjust == -1) + if (!bAdjustGood) rSet.InvalidateItem( nSlot ); else - rSet.Put(SvxAdjustItem((SvxAdjust)eAdjust, SID_ATTR_PARA_ADJUST )); + rSet.Put(SvxAdjustItem(eAdjust, SID_ATTR_PARA_ADJUST )); nSlot = 0; break; case SID_ATTR_PARA_LRSPACE: diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx index c8add14f68e5..2ba5ff26dfd3 100644 --- a/sw/source/uibase/shells/txtnum.cxx +++ b/sw/source/uibase/shells/txtnum.cxx @@ -167,7 +167,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) // numbering/bullet should be rtl in rtl paragraph: if ( bRightToLeft ) { - aFormat.SetNumAdjust( SVX_ADJUST_RIGHT ); + aFormat.SetNumAdjust( SvxAdjust::Right ); } aSvxRule.SetLevel( n, aFormat, false ); } diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 9bf3403b7ec5..93b74386aed3 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -1247,7 +1247,7 @@ void SwWrtShell::NumOrBulletOn(bool bNum) // numbering/bullet should be rtl in rtl paragraph: if ( bRightToLeft ) { - aFormat.SetNumAdjust( SVX_ADJUST_RIGHT ); + aFormat.SetNumAdjust( SvxAdjust::Right ); } aNumRule.Set( nLvl, aFormat ); |