diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-14 11:48:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-15 07:58:45 +0200 |
commit | 54e608c6605ca2bcfd8dfdbe674d5110a18d2c5c (patch) | |
tree | 0ac2df642d3499930f90b7b073cfcb52f44e6eaf | |
parent | loplugin:redundantcast (diff) | |
download | core-54e608c6605ca2bcfd8dfdbe674d5110a18d2c5c.tar.gz core-54e608c6605ca2bcfd8dfdbe674d5110a18d2c5c.zip |
convert SvxCellVerJustify to scoped enum
Change-Id: I9d1cdb4ddfee43b7a0990624d7d16e06679343c4
Reviewed-on: https://gerrit.libreoffice.org/42276
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
27 files changed, 180 insertions, 181 deletions
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx index 34b33726acea..02c769659804 100644 --- a/cui/source/tabpages/align.cxx +++ b/cui/source/tabpages/align.cxx @@ -72,13 +72,13 @@ typedef sfx::ListBoxConnection< VerJustItemWrapper > VerJustConnection; static const VerJustConnection::MapEntryType s_pVerJustMap[] = { - { ALIGNDLG_VERALIGN_STD, SVX_VER_JUSTIFY_STANDARD }, - { ALIGNDLG_VERALIGN_TOP, SVX_VER_JUSTIFY_TOP }, - { ALIGNDLG_VERALIGN_MID, SVX_VER_JUSTIFY_CENTER }, - { ALIGNDLG_VERALIGN_BOTTOM, SVX_VER_JUSTIFY_BOTTOM }, - { ALIGNDLG_VERALIGN_BLOCK, SVX_VER_JUSTIFY_BLOCK }, - { ALIGNDLG_VERALIGN_DISTRIBUTED, SVX_VER_JUSTIFY_BLOCK }, - { WRAPPER_LISTBOX_ENTRY_NOTFOUND, SVX_VER_JUSTIFY_STANDARD } + { ALIGNDLG_VERALIGN_STD, SvxCellVerJustify::Standard }, + { ALIGNDLG_VERALIGN_TOP, SvxCellVerJustify::Top }, + { ALIGNDLG_VERALIGN_MID, SvxCellVerJustify::Center }, + { ALIGNDLG_VERALIGN_BOTTOM, SvxCellVerJustify::Bottom }, + { ALIGNDLG_VERALIGN_BLOCK, SvxCellVerJustify::Block }, + { ALIGNDLG_VERALIGN_DISTRIBUTED, SvxCellVerJustify::Block }, + { WRAPPER_LISTBOX_ENTRY_NOTFOUND, SvxCellVerJustify::Standard } }; // cell rotate mode ----------------------------------------------------------- @@ -315,7 +315,7 @@ void AlignmentTabPage::Reset( const SfxItemSet* rCoreAttrs ) lcl_MaybeResetAlignToDistro<SvxCellVerJustify, SvxCellVerJustify>( *m_pLbVerAlign, ALIGNDLG_VERALIGN_DISTRIBUTED, *rCoreAttrs, GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY), GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY_METHOD), - SVX_VER_JUSTIFY_BLOCK); + SvxCellVerJustify::Block); UpdateEnableControls(); } diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index 18605af099d9..005a0e4a218d 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -111,7 +111,7 @@ DefItems::DefItems() rDefItems[14] = new SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST ); rDefItems[15] = new SvxTabStopItem( 0, 0, SvxTabAdjust::Left, EE_PARA_TABS ); rDefItems[16] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, EE_PARA_JUST_METHOD ); - rDefItems[17] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, EE_PARA_VER_JUST ); + rDefItems[17] = new SvxVerJustifyItem( SvxCellVerJustify::Standard, EE_PARA_VER_JUST ); // Character attributes: rDefItems[18] = new SvxColorItem( Color( COL_AUTO ), EE_CHAR_COLOR ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 121428166c91..f68f2eff166a 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -4089,7 +4089,7 @@ long ImpEditEngine::CalcVertLineSpacing(Point& rStartPos) const for (sal_Int32 i = 0; i < nParaCount; ++i) { - if (GetVerJustification(i) != SVX_VER_JUSTIFY_BLOCK) + if (GetVerJustification(i) != SvxCellVerJustify::Block) // All paragraphs must have the block justification set. return 0; diff --git a/editeng/source/items/justifyitem.cxx b/editeng/source/items/justifyitem.cxx index 1d7d55c63700..378b986f00de 100644 --- a/editeng/source/items/justifyitem.cxx +++ b/editeng/source/items/justifyitem.cxx @@ -32,7 +32,7 @@ SfxPoolItem* SvxHorJustifyItem::CreateDefault() { return new SvxHorJustifyItem(SvxCellHorJustify::Standard, 0) ;} -SfxPoolItem* SvxVerJustifyItem::CreateDefault() { return new SvxVerJustifyItem(SVX_VER_JUSTIFY_STANDARD, 0) ;} +SfxPoolItem* SvxVerJustifyItem::CreateDefault() { return new SvxVerJustifyItem(SvxCellVerJustify::Standard, 0) ;} using namespace ::com::sun::star; @@ -186,7 +186,7 @@ sal_uInt16 SvxHorJustifyItem::GetValueCount() const SvxVerJustifyItem::SvxVerJustifyItem( const sal_uInt16 nId ) : - SfxEnumItem( nId, SVX_VER_JUSTIFY_STANDARD ) + SfxEnumItem( nId, SvxCellVerJustify::Standard ) { } @@ -220,9 +220,9 @@ bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const style::VerticalAlignment eUno = style::VerticalAlignment_TOP; switch ( GetValue() ) { - case SVX_VER_JUSTIFY_TOP: eUno = style::VerticalAlignment_TOP; break; - case SVX_VER_JUSTIFY_CENTER: eUno = style::VerticalAlignment_MIDDLE; break; - case SVX_VER_JUSTIFY_BOTTOM: eUno = style::VerticalAlignment_BOTTOM; break; + case SvxCellVerJustify::Top: eUno = style::VerticalAlignment_TOP; break; + case SvxCellVerJustify::Center: eUno = style::VerticalAlignment_MIDDLE; break; + case SvxCellVerJustify::Bottom: eUno = style::VerticalAlignment_BOTTOM; break; default: ; //prevent warning } rVal <<= eUno; @@ -233,11 +233,11 @@ bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const sal_Int32 nUno = table::CellVertJustify2::STANDARD; switch ( GetValue() ) { - case SVX_VER_JUSTIFY_STANDARD: nUno = table::CellVertJustify2::STANDARD; break; - case SVX_VER_JUSTIFY_TOP: nUno = table::CellVertJustify2::TOP; break; - case SVX_VER_JUSTIFY_CENTER: nUno = table::CellVertJustify2::CENTER; break; - case SVX_VER_JUSTIFY_BOTTOM: nUno = table::CellVertJustify2::BOTTOM; break; - case SVX_VER_JUSTIFY_BLOCK: nUno = table::CellVertJustify2::BLOCK; break; + case SvxCellVerJustify::Standard: nUno = table::CellVertJustify2::STANDARD; break; + case SvxCellVerJustify::Top: nUno = table::CellVertJustify2::TOP; break; + case SvxCellVerJustify::Center: nUno = table::CellVertJustify2::CENTER; break; + case SvxCellVerJustify::Bottom: nUno = table::CellVertJustify2::BOTTOM; break; + case SvxCellVerJustify::Block: nUno = table::CellVertJustify2::BLOCK; break; default: ; //prevent warning } rVal <<= nUno; @@ -259,12 +259,12 @@ bool SvxVerJustifyItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) if(!(rVal >>= nVal)) return false; - SvxCellVerJustify eSvx = SVX_VER_JUSTIFY_STANDARD; + SvxCellVerJustify eSvx = SvxCellVerJustify::Standard; switch (nVal) { - case style::VerticalAlignment_TOP: eSvx = SVX_VER_JUSTIFY_TOP; break; - case style::VerticalAlignment_MIDDLE: eSvx = SVX_VER_JUSTIFY_CENTER; break; - case style::VerticalAlignment_BOTTOM: eSvx = SVX_VER_JUSTIFY_BOTTOM; break; + case style::VerticalAlignment_TOP: eSvx = SvxCellVerJustify::Top; break; + case style::VerticalAlignment_MIDDLE: eSvx = SvxCellVerJustify::Center; break; + case style::VerticalAlignment_BOTTOM: eSvx = SvxCellVerJustify::Bottom; break; default:; } SetValue( eSvx ); @@ -275,14 +275,14 @@ bool SvxVerJustifyItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) sal_Int32 eUno = table::CellVertJustify2::STANDARD; rVal >>= eUno; - SvxCellVerJustify eSvx = SVX_VER_JUSTIFY_STANDARD; + SvxCellVerJustify eSvx = SvxCellVerJustify::Standard; switch (eUno) { - case table::CellVertJustify2::STANDARD: eSvx = SVX_VER_JUSTIFY_STANDARD; break; - case table::CellVertJustify2::TOP: eSvx = SVX_VER_JUSTIFY_TOP; break; - case table::CellVertJustify2::CENTER: eSvx = SVX_VER_JUSTIFY_CENTER; break; - case table::CellVertJustify2::BOTTOM: eSvx = SVX_VER_JUSTIFY_BOTTOM; break; - case table::CellVertJustify2::BLOCK: eSvx = SVX_VER_JUSTIFY_BLOCK; break; + case table::CellVertJustify2::STANDARD: eSvx = SvxCellVerJustify::Standard; break; + case table::CellVertJustify2::TOP: eSvx = SvxCellVerJustify::Top; break; + case table::CellVertJustify2::CENTER: eSvx = SvxCellVerJustify::Center; break; + case table::CellVertJustify2::BOTTOM: eSvx = SvxCellVerJustify::Bottom; break; + case table::CellVertJustify2::BLOCK: eSvx = SvxCellVerJustify::Block; break; default: ; //prevent warning } SetValue( eSvx ); @@ -294,10 +294,10 @@ bool SvxVerJustifyItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) } -OUString SvxVerJustifyItem::GetValueText( sal_uInt16 nVal ) +OUString SvxVerJustifyItem::GetValueText( SvxCellVerJustify nVal ) { - DBG_ASSERT( nVal <= SVX_VER_JUSTIFY_BOTTOM, "enum overflow!" ); - return EditResId(RID_SVXITEMS_VERJUST_STANDARD + nVal); + DBG_ASSERT( nVal <= SvxCellVerJustify::Bottom, "enum overflow!" ); + return EditResId(RID_SVXITEMS_VERJUST_STANDARD + static_cast<int>(nVal)); } @@ -317,7 +317,7 @@ SfxPoolItem* SvxVerJustifyItem::Create( SvStream& rStream, sal_uInt16 ) const sal_uInt16 SvxVerJustifyItem::GetValueCount() const { - return SVX_VER_JUSTIFY_BOTTOM + 1; // Last Enum value + 1 + return static_cast<sal_uInt16>(SvxCellVerJustify::Bottom) + 1; // Last Enum value + 1 } @@ -336,7 +336,7 @@ bool SvxJustifyMethodItem::GetPresentation OUString& rText, const IntlWrapper& ) const { - rText = GetValueText( GetEnumValue() ); + rText = GetValueText( GetValue() ); return true; } @@ -376,10 +376,9 @@ bool SvxJustifyMethodItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId } -OUString SvxJustifyMethodItem::GetValueText( sal_uInt16 nVal ) +OUString SvxJustifyMethodItem::GetValueText( SvxCellJustifyMethod nVal ) { - DBG_ASSERT( nVal <= SVX_VER_JUSTIFY_BOTTOM, "enum overflow!" ); - return EditResId(RID_SVXITEMS_JUSTMETHOD_AUTO + nVal); + return EditResId(RID_SVXITEMS_JUSTMETHOD_AUTO + static_cast<int>(nVal)); } @@ -391,7 +390,7 @@ SfxPoolItem* SvxJustifyMethodItem::Clone( SfxItemPool* ) const sal_uInt16 SvxJustifyMethodItem::GetValueCount() const { - return (sal_uInt16)SvxCellJustifyMethod::Distribute + 1; // Last Enum value + 1 + return static_cast<sal_uInt16>(SvxCellJustifyMethod::Distribute) + 1; // Last Enum value + 1 } SvxJustifyMethodItem& SvxJustifyMethodItem::operator=(const SvxJustifyMethodItem& r) diff --git a/include/editeng/justifyitem.hxx b/include/editeng/justifyitem.hxx index 3f51d0dde129..a4513a76e257 100644 --- a/include/editeng/justifyitem.hxx +++ b/include/editeng/justifyitem.hxx @@ -65,7 +65,7 @@ public: explicit SvxVerJustifyItem( const sal_uInt16 nId ); SvxVerJustifyItem( - const SvxCellVerJustify eJustify /*= SVX_VER_JUSTIFY_STANDARD*/, + const SvxCellVerJustify eJustify, const sal_uInt16 nId ); virtual bool GetPresentation( SfxItemPresentation ePres, @@ -77,7 +77,7 @@ public: virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; virtual sal_uInt16 GetValueCount() const override; - static OUString GetValueText( sal_uInt16 nVal ); + static OUString GetValueText( SvxCellVerJustify nVal ); virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual SfxPoolItem* Create( SvStream& rStream, sal_uInt16 nVer ) const override; @@ -105,7 +105,7 @@ public: virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; virtual sal_uInt16 GetValueCount() const override; - static OUString GetValueText( sal_uInt16 nVal ); + static OUString GetValueText( SvxCellJustifyMethod nVal ); virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; SvxJustifyMethodItem& operator=(const SvxJustifyMethodItem& r); diff --git a/include/editeng/svxenum.hxx b/include/editeng/svxenum.hxx index a6d00920a2b5..a2f844e9bdbe 100644 --- a/include/editeng/svxenum.hxx +++ b/include/editeng/svxenum.hxx @@ -112,13 +112,13 @@ enum class SvxCellJustifyMethod Distribute }; -enum SvxCellVerJustify +enum class SvxCellVerJustify { - SVX_VER_JUSTIFY_STANDARD, - SVX_VER_JUSTIFY_TOP, - SVX_VER_JUSTIFY_CENTER, - SVX_VER_JUSTIFY_BOTTOM, - SVX_VER_JUSTIFY_BLOCK + Standard, + Top, + Center, + Bottom, + Block }; enum class SvxCellOrientation diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index 34dbdf4024ca..b982c782eda9 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -2814,7 +2814,7 @@ void ScFiltersTest::testCondFormatParentXLSX() const ScPatternAttr* pPattern = rDoc.GetPattern(2, 5, 0); const SfxPoolItem& rPoolItem = pPattern->GetItem(ATTR_VER_JUSTIFY, pCondSet); const SvxVerJustifyItem& rVerJustify = static_cast<const SvxVerJustifyItem&>(rPoolItem); - CPPUNIT_ASSERT_EQUAL(SVX_VER_JUSTIFY_TOP, rVerJustify.GetValue()); + CPPUNIT_ASSERT_EQUAL(SvxCellVerJustify::Top, rVerJustify.GetValue()); xDocSh->DoClose(); } @@ -3061,7 +3061,7 @@ void ScFiltersTest::testOrcusODSStyleInterface() pStyleSheet->GetItemSet().HasItem(ATTR_VER_JUSTIFY, &pItem)); const SvxVerJustifyItem* pVerJustify = static_cast<const SvxVerJustifyItem*>(pItem); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Style Name10 :Error with ver justify", SVX_VER_JUSTIFY_CENTER, pVerJustify->GetValue()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Style Name10 :Error with ver justify", SvxCellVerJustify::Center, pVerJustify->GetValue()); } diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 461e16d2cd21..d3564d39d69d 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -245,7 +245,7 @@ ScDocumentPool::ScDocumentPool() rPoolDefaults[ ATTR_HOR_JUSTIFY - ATTR_STARTINDEX ] = new SvxHorJustifyItem( SvxCellHorJustify::Standard, ATTR_HOR_JUSTIFY); rPoolDefaults[ ATTR_HOR_JUSTIFY_METHOD - ATTR_STARTINDEX ] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, ATTR_HOR_JUSTIFY_METHOD); rPoolDefaults[ ATTR_INDENT - ATTR_STARTINDEX ] = new SfxUInt16Item( ATTR_INDENT, 0 ); - rPoolDefaults[ ATTR_VER_JUSTIFY - ATTR_STARTINDEX ] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY); + rPoolDefaults[ ATTR_VER_JUSTIFY - ATTR_STARTINDEX ] = new SvxVerJustifyItem( SvxCellVerJustify::Standard, ATTR_VER_JUSTIFY); rPoolDefaults[ ATTR_VER_JUSTIFY_METHOD - ATTR_STARTINDEX ] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, ATTR_VER_JUSTIFY_METHOD); rPoolDefaults[ ATTR_STACKED - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_STACKED, false ); rPoolDefaults[ ATTR_ROTATE_VALUE - ATTR_STARTINDEX ] = new SfxInt32Item( ATTR_ROTATE_VALUE, 0 ); diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index 5a82dad4130d..9ac6455a9ab0 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -195,7 +195,7 @@ void ScAfVersions::Write(SvStream& rStream, sal_uInt16 fileVersion) WriteAutoFormatSwBlob( rStream, swVersions ); rStream.WriteUInt16( SvxHorJustifyItem(SvxCellHorJustify::Standard, ATTR_HOR_JUSTIFY).GetVersion(fileVersion) ); - rStream.WriteUInt16( SvxVerJustifyItem(SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxVerJustifyItem(SvxCellVerJustify::Standard, ATTR_VER_JUSTIFY).GetVersion(fileVersion) ); rStream.WriteUInt16( SvxOrientationItem(SvxCellOrientation::Standard, 0).GetVersion(fileVersion) ); rStream.WriteUInt16( SvxMarginItem(ATTR_MARGIN).GetVersion(fileVersion) ); rStream.WriteUInt16( SfxBoolItem(ATTR_LINEBREAK).GetVersion(fileVersion) ); @@ -233,7 +233,7 @@ ScAutoFormatDataField::ScAutoFormatDataField() : aBackground( ATTR_BACKGROUND ), aAdjust( SvxAdjust::Left, 0 ), aHorJustify( SvxCellHorJustify::Standard, ATTR_HOR_JUSTIFY ), - aVerJustify( SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY ), + aVerJustify( SvxCellVerJustify::Standard, ATTR_VER_JUSTIFY ), aMargin( ATTR_MARGIN ), aLinebreak( ATTR_LINEBREAK ), aRotateAngle( ATTR_ROTATE_VALUE ), diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 5198a270509e..5d41664fc4e8 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -324,7 +324,7 @@ tools::Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, bool bF bool bAsianVertical = static_cast<const SfxBoolItem&>(pPattern->GetItem( ATTR_STACKED )).GetValue() && static_cast<const SfxBoolItem&>(pPattern->GetItem( ATTR_VERTICAL_ASIAN )).GetValue(); - if ( eJust == SVX_VER_JUSTIFY_TOP || + if ( eJust == SvxCellVerJustify::Top || ( bForceToTop && ( SC_MOD()->GetInputOptions().GetTextWysiwyg() || bAsianVertical ) ) ) nPixDifY = nTopMargin; else @@ -350,7 +350,7 @@ tools::Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, bool bF nPixDifY = 0; // too large -> begin at the top else { - if ( eJust == SVX_VER_JUSTIFY_CENTER ) + if ( eJust == SvxCellVerJustify::Center ) nPixDifY = nTopMargin + ( nCellY - nTextHeight ) / 2; else nPixDifY = nCellY - nTextHeight + nTopMargin; // JUSTIFY_BOTTOM diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 066c64ba651f..d907ccbcb29f 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1554,7 +1554,7 @@ bool XclExpCellAlign::FillFromItemSet( mnHorAlign = EXC_XF_HOR_DISTRIB; } - if (eVerAlign == SVX_VER_JUSTIFY_BLOCK) + if (eVerAlign == SvxCellVerJustify::Block) { SvxCellJustifyMethod eVerJustMethod = rItemSet.GetItem<SvxJustifyMethodItem>(ATTR_VER_JUSTIFY_METHOD)->GetValue(); diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx index 4ca798fe0f11..f2dbe60774d4 100644 --- a/sc/source/filter/excel/xlstyle.cxx +++ b/sc/source/filter/excel/xlstyle.cxx @@ -1576,14 +1576,14 @@ SvxCellJustifyMethod XclCellAlign::GetScHorJustifyMethod() const SvxCellVerJustify XclCellAlign::GetScVerAlign() const { - SvxCellVerJustify eVerJust = SVX_VER_JUSTIFY_STANDARD; + SvxCellVerJustify eVerJust = SvxCellVerJustify::Standard; switch( mnVerAlign ) { - case EXC_XF_VER_TOP: eVerJust = SVX_VER_JUSTIFY_TOP; break; - case EXC_XF_VER_CENTER: eVerJust = SVX_VER_JUSTIFY_CENTER; break; - case EXC_XF_VER_BOTTOM: eVerJust = SVX_VER_JUSTIFY_STANDARD; break; + case EXC_XF_VER_TOP: eVerJust = SvxCellVerJustify::Top; break; + case EXC_XF_VER_CENTER: eVerJust = SvxCellVerJustify::Center; break; + case EXC_XF_VER_BOTTOM: eVerJust = SvxCellVerJustify::Standard; break; case EXC_XF_VER_JUSTIFY: - case EXC_XF_VER_DISTRIB: eVerJust = SVX_VER_JUSTIFY_BLOCK; break; + case EXC_XF_VER_DISTRIB: eVerJust = SvxCellVerJustify::Block; break; default: OSL_FAIL( "XclCellAlign::GetScVerAlign - unknown vertical alignment" ); } return eVerJust; @@ -1626,10 +1626,10 @@ void XclCellAlign::SetScVerAlign( SvxCellVerJustify eVerJust ) { switch( eVerJust ) { - case SVX_VER_JUSTIFY_STANDARD: mnVerAlign = EXC_XF_VER_BOTTOM; break; - case SVX_VER_JUSTIFY_TOP: mnVerAlign = EXC_XF_VER_TOP; break; - case SVX_VER_JUSTIFY_CENTER: mnVerAlign = EXC_XF_VER_CENTER; break; - case SVX_VER_JUSTIFY_BOTTOM: mnVerAlign = EXC_XF_VER_BOTTOM; break; + case SvxCellVerJustify::Standard: mnVerAlign = EXC_XF_VER_BOTTOM; break; + case SvxCellVerJustify::Top: mnVerAlign = EXC_XF_VER_TOP; break; + case SvxCellVerJustify::Center: mnVerAlign = EXC_XF_VER_CENTER; break; + case SvxCellVerJustify::Bottom: mnVerAlign = EXC_XF_VER_BOTTOM; break; default: mnVerAlign = EXC_XF_VER_BOTTOM; OSL_FAIL( "XclCellAlign::SetScVerAlign - unknown vertical alignment" ); } diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx index e319a5c1a0c9..b1ef63c92c2b 100644 --- a/sc/source/filter/html/htmlexp.cxx +++ b/sc/source/filter/html/htmlexp.cxx @@ -1032,10 +1032,10 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) switch( rVerJustifyItem.GetValue() ) { - case SVX_VER_JUSTIFY_TOP: pChar = OOO_STRING_SVTOOLS_HTML_VA_top; break; - case SVX_VER_JUSTIFY_CENTER: pChar = OOO_STRING_SVTOOLS_HTML_VA_middle; break; - case SVX_VER_JUSTIFY_BOTTOM: pChar = OOO_STRING_SVTOOLS_HTML_VA_bottom; break; - case SVX_VER_JUSTIFY_STANDARD: + case SvxCellVerJustify::Top: pChar = OOO_STRING_SVTOOLS_HTML_VA_top; break; + case SvxCellVerJustify::Center: pChar = OOO_STRING_SVTOOLS_HTML_VA_middle; break; + case SvxCellVerJustify::Bottom: pChar = OOO_STRING_SVTOOLS_HTML_VA_bottom; break; + case SvxCellVerJustify::Standard: default: pChar = nullptr; } if ( pChar ) diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 2388da9a5376..42108f809269 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -987,13 +987,13 @@ void ScHTMLLayoutParser::TableDataOn( HtmlImportInfo* pInfo ) SvxCellVerJustify eVal; const OUString& rOptVal = rOption.GetString(); if ( rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_VA_top ) ) - eVal = SVX_VER_JUSTIFY_TOP; + eVal = SvxCellVerJustify::Top; else if ( rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_VA_middle ) ) - eVal = SVX_VER_JUSTIFY_CENTER; + eVal = SvxCellVerJustify::Center; else if ( rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_VA_bottom ) ) - eVal = SVX_VER_JUSTIFY_BOTTOM; + eVal = SvxCellVerJustify::Bottom; else - eVal = SVX_VER_JUSTIFY_STANDARD; + eVal = SvxCellVerJustify::Standard; pActEntry->aItemSet.Put( SvxVerJustifyItem( eVal, ATTR_VER_JUSTIFY) ); } break; @@ -2552,15 +2552,15 @@ void ScHTMLTable::ProcessFormatOptions( SfxItemSet& rItemSet, const HtmlImportIn case HtmlOptionId::VALIGN: { - SvxCellVerJustify eVal = SVX_VER_JUSTIFY_STANDARD; + SvxCellVerJustify eVal = SvxCellVerJustify::Standard; const OUString& rOptVal = itr->GetString(); if( rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_VA_top ) ) - eVal = SVX_VER_JUSTIFY_TOP; + eVal = SvxCellVerJustify::Top; else if( rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_VA_middle ) ) - eVal = SVX_VER_JUSTIFY_CENTER; + eVal = SvxCellVerJustify::Center; else if( rOptVal.equalsIgnoreAsciiCase( OOO_STRING_SVTOOLS_HTML_VA_bottom ) ) - eVal = SVX_VER_JUSTIFY_BOTTOM; - if( eVal != SVX_VER_JUSTIFY_STANDARD ) + eVal = SvxCellVerJustify::Bottom; + if( eVal != SvxCellVerJustify::Standard ) rItemSet.Put( SvxVerJustifyItem( eVal, ATTR_VER_JUSTIFY ) ); } break; diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx index 4ef6a37fcd78..627a581e0a2a 100644 --- a/sc/source/filter/lotus/op.cxx +++ b/sc/source/filter/lotus/op.cxx @@ -493,19 +493,19 @@ void OP_VerAlign123(LotusContext& /*rContext*/, sal_uInt8 nAlignPattern, SfxItem switch (nAlignPattern) { case 0: - rPatternItemSet.Put( SvxVerJustifyItem(SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY) ); + rPatternItemSet.Put( SvxVerJustifyItem(SvxCellVerJustify::Standard, ATTR_VER_JUSTIFY) ); break; case 1: - rPatternItemSet.Put( SvxVerJustifyItem(SVX_VER_JUSTIFY_TOP, ATTR_VER_JUSTIFY) ); + rPatternItemSet.Put( SvxVerJustifyItem(SvxCellVerJustify::Top, ATTR_VER_JUSTIFY) ); break; case 2: - rPatternItemSet.Put( SvxVerJustifyItem(SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY) ); + rPatternItemSet.Put( SvxVerJustifyItem(SvxCellVerJustify::Center, ATTR_VER_JUSTIFY) ); break; case 4: - rPatternItemSet.Put( SvxVerJustifyItem(SVX_VER_JUSTIFY_BOTTOM, ATTR_VER_JUSTIFY) ); + rPatternItemSet.Put( SvxVerJustifyItem(SvxCellVerJustify::Bottom, ATTR_VER_JUSTIFY) ); break; default: - rPatternItemSet.Put( SvxVerJustifyItem(SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY) ); + rPatternItemSet.Put( SvxVerJustifyItem(SvxCellVerJustify::Standard, ATTR_VER_JUSTIFY) ); break; } } diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 70a2519ff0bc..63554bc6499c 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -1192,24 +1192,24 @@ void Alignment::finalizeImport() ::SvxCellVerJustify Alignment::GetScVerAlign() const { - ::SvxCellVerJustify nVert = ::SVX_VER_JUSTIFY_STANDARD; + ::SvxCellVerJustify nVert = ::SvxCellVerJustify::Standard; switch ( maApiData.mnVerJustify ) { case css::table::CellVertJustify2::BOTTOM: - nVert = ::SVX_VER_JUSTIFY_BOTTOM; + nVert = ::SvxCellVerJustify::Bottom; break; case css::table::CellVertJustify2::CENTER: - nVert = ::SVX_VER_JUSTIFY_CENTER; + nVert = ::SvxCellVerJustify::Center; break; case css::table::CellVertJustify2::TOP: - nVert = ::SVX_VER_JUSTIFY_TOP; + nVert = ::SvxCellVerJustify::Top; break; case css::table::CellVertJustify2::BLOCK: - nVert = ::SVX_VER_JUSTIFY_BLOCK; + nVert = ::SvxCellVerJustify::Block; break; case css::table::CellVertJustify2::STANDARD: default: - nVert = ::SVX_VER_JUSTIFY_STANDARD; + nVert = ::SvxCellVerJustify::Standard; break; } return nVert; diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index c24e15742e29..f1aded0dbf87 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -941,7 +941,7 @@ ScOrcusStyles::xf::xf(): mnStyleXf(0), mbAlignment(false), meHor_alignment(SvxCellHorJustify::Right), - meVer_alignment(SVX_VER_JUSTIFY_BOTTOM) + meVer_alignment(SvxCellVerJustify::Bottom) { } @@ -1512,16 +1512,16 @@ void ScOrcusStyles::set_xf_vertical_alignment(orcus::spreadsheet::ver_alignment_ switch (align) { case os::ver_alignment_t::top: - maCurrentXF.meVer_alignment = SVX_VER_JUSTIFY_TOP; + maCurrentXF.meVer_alignment = SvxCellVerJustify::Top; break; case os::ver_alignment_t::bottom: - maCurrentXF.meVer_alignment = SVX_VER_JUSTIFY_BOTTOM; + maCurrentXF.meVer_alignment = SvxCellVerJustify::Bottom; break; case os::ver_alignment_t::middle: - maCurrentXF.meVer_alignment = SVX_VER_JUSTIFY_CENTER; + maCurrentXF.meVer_alignment = SvxCellVerJustify::Center; break; case os::ver_alignment_t::justified: - maCurrentXF.meVer_alignment = SVX_VER_JUSTIFY_STANDARD; + maCurrentXF.meVer_alignment = SvxCellVerJustify::Standard; break; default: ; diff --git a/sc/source/filter/qpro/qprostyle.cxx b/sc/source/filter/qpro/qprostyle.cxx index f4e45c73a67e..fa9ecbaef2a1 100644 --- a/sc/source/filter/qpro/qprostyle.cxx +++ b/sc/source/filter/qpro/qprostyle.cxx @@ -91,19 +91,19 @@ void ScQProStyle::SetFormat( ScDocument *pDoc, sal_uInt8 nCol, sal_uInt16 nRow, rItemSet.Put( SvxHorJustifyItem( eJustify, ATTR_HOR_JUSTIFY ) ); // Vertical Alignment - SvxCellVerJustify eVerJustify = SVX_VER_JUSTIFY_STANDARD; + SvxCellVerJustify eVerJustify = SvxCellVerJustify::Standard; switch( nVer ) { case 0x00: - eVerJustify = SVX_VER_JUSTIFY_BOTTOM; + eVerJustify = SvxCellVerJustify::Bottom; break; case 0x08: - eVerJustify = SVX_VER_JUSTIFY_CENTER; + eVerJustify = SvxCellVerJustify::Center; break; case 0x10: - eVerJustify = SVX_VER_JUSTIFY_TOP; + eVerJustify = SvxCellVerJustify::Top; break; } diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx index 44e8629f9110..04d55c3d9c9e 100644 --- a/sc/source/filter/rtf/rtfexp.cxx +++ b/sc/source/filter/rtf/rtfexp.cxx @@ -123,11 +123,11 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow ) switch( rVerJustifyItem.GetValue() ) { - case SVX_VER_JUSTIFY_TOP: pChar = OOO_STRING_SVTOOLS_RTF_CLVERTALT; break; - case SVX_VER_JUSTIFY_CENTER: pChar = OOO_STRING_SVTOOLS_RTF_CLVERTALC; break; - case SVX_VER_JUSTIFY_BOTTOM: pChar = OOO_STRING_SVTOOLS_RTF_CLVERTALB; break; - case SVX_VER_JUSTIFY_STANDARD: pChar = OOO_STRING_SVTOOLS_RTF_CLVERTALB; break; //! Bottom - default: pChar = nullptr; break; + case SvxCellVerJustify::Top: pChar = OOO_STRING_SVTOOLS_RTF_CLVERTALT; break; + case SvxCellVerJustify::Center: pChar = OOO_STRING_SVTOOLS_RTF_CLVERTALC; break; + case SvxCellVerJustify::Bottom: pChar = OOO_STRING_SVTOOLS_RTF_CLVERTALB; break; + case SvxCellVerJustify::Standard: pChar = OOO_STRING_SVTOOLS_RTF_CLVERTALB; break; //! Bottom + default: pChar = nullptr; break; } if ( pChar ) rStrm.WriteCharPtr( pChar ); diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx index 12210d2cf2f3..2b69571e9c2f 100644 --- a/sc/source/filter/starcalc/scflt.cxx +++ b/sc/source/filter/starcalc/scflt.cxx @@ -1185,13 +1185,13 @@ void Sc10Import::LoadPatternCollection() switch( VerJustify ) { case vjTop: - rItemSet.Put( SvxVerJustifyItem( SVX_VER_JUSTIFY_TOP, ATTR_VER_JUSTIFY ) ); + rItemSet.Put( SvxVerJustifyItem( SvxCellVerJustify::Top, ATTR_VER_JUSTIFY ) ); break; case vjCenter: - rItemSet.Put( SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) ); + rItemSet.Put( SvxVerJustifyItem( SvxCellVerJustify::Center, ATTR_VER_JUSTIFY ) ); break; case vjBottom: - rItemSet.Put( SvxVerJustifyItem( SVX_VER_JUSTIFY_BOTTOM, ATTR_VER_JUSTIFY ) ); + rItemSet.Put( SvxVerJustifyItem( SvxCellVerJustify::Bottom, ATTR_VER_JUSTIFY ) ); break; } @@ -1824,13 +1824,13 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab) switch (VerJustify) { case vjTop: - aScPattern.GetItemSet().Put(SvxVerJustifyItem(SVX_VER_JUSTIFY_TOP, ATTR_VER_JUSTIFY)); + aScPattern.GetItemSet().Put(SvxVerJustifyItem(SvxCellVerJustify::Top, ATTR_VER_JUSTIFY)); break; case vjCenter: - aScPattern.GetItemSet().Put(SvxVerJustifyItem(SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY)); + aScPattern.GetItemSet().Put(SvxVerJustifyItem(SvxCellVerJustify::Center, ATTR_VER_JUSTIFY)); break; case vjBottom: - aScPattern.GetItemSet().Put(SvxVerJustifyItem(SVX_VER_JUSTIFY_BOTTOM, ATTR_VER_JUSTIFY)); + aScPattern.GetItemSet().Put(SvxVerJustifyItem(SvxCellVerJustify::Bottom, ATTR_VER_JUSTIFY)); break; } diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index 7e80fd96571a..343a34d797da 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -814,16 +814,16 @@ SvxTextForwarder* ScAccessibleCellTextData::GetTextForwarder() long nOffsetY = 0; const SvxVerJustifyItem* pVerJustifyItem = static_cast< const SvxVerJustifyItem* >( rDoc.GetAttr( aCellPos.Col(), aCellPos.Row(), aCellPos.Tab(), ATTR_VER_JUSTIFY ) ); - SvxCellVerJustify eVerJust = ( pVerJustifyItem ? pVerJustifyItem->GetValue() : SVX_VER_JUSTIFY_STANDARD ); + SvxCellVerJustify eVerJust = ( pVerJustifyItem ? pVerJustifyItem->GetValue() : SvxCellVerJustify::Standard ); switch ( eVerJust ) { - case SVX_VER_JUSTIFY_STANDARD: - case SVX_VER_JUSTIFY_BOTTOM: + case SvxCellVerJustify::Standard: + case SvxCellVerJustify::Bottom: { nOffsetY = nSizeY - nBottomM - nTextHeight; } break; - case SVX_VER_JUSTIFY_CENTER: + case SvxCellVerJustify::Center: { nOffsetY = ( nSizeY - nTopM - nBottomM - nTextHeight ) / 2 + nTopM; } diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 210bd18e33a2..c9abf98d6147 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -4826,7 +4826,7 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo if (rOption.mbCenter) { rDoc.ApplyAttr( nStartCol, nStartRow, nTab, SvxHorJustifyItem( SvxCellHorJustify::Center, ATTR_HOR_JUSTIFY ) ); - rDoc.ApplyAttr( nStartCol, nStartRow, nTab, SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) ); + rDoc.ApplyAttr( nStartCol, nStartRow, nTab, SvxVerJustifyItem( SvxCellVerJustify::Center, ATTR_VER_JUSTIFY ) ); } if ( !AdjustRowHeight( ScRange( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab ) ) ) diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index a20832c5c550..604a662009c2 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -691,7 +691,7 @@ void ScUndoMerge::DoChange( bool bUndo ) const SvxHorJustifyItem( SvxCellHorJustify::Center, ATTR_HOR_JUSTIFY ) ); rDoc.ApplyAttr( aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Tab(), - SvxVerJustifyItem( SVX_VER_JUSTIFY_CENTER, ATTR_VER_JUSTIFY ) ); + SvxVerJustifyItem( SvxCellVerJustify::Center, ATTR_VER_JUSTIFY ) ); } } diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 885f0ed1f50a..6908c960281e 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -108,13 +108,13 @@ SvxCellHorJustify lclConvertSlotToHAlign( sal_uInt16 nSlot ) SvxCellVerJustify lclConvertSlotToVAlign( sal_uInt16 nSlot ) { - SvxCellVerJustify eVJustify = SVX_VER_JUSTIFY_STANDARD; + SvxCellVerJustify eVJustify = SvxCellVerJustify::Standard; switch( nSlot ) { - case SID_ALIGN_ANY_VDEFAULT: eVJustify = SVX_VER_JUSTIFY_STANDARD; break; - case SID_ALIGN_ANY_TOP: eVJustify = SVX_VER_JUSTIFY_TOP; break; - case SID_ALIGN_ANY_VCENTER: eVJustify = SVX_VER_JUSTIFY_CENTER; break; - case SID_ALIGN_ANY_BOTTOM: eVJustify = SVX_VER_JUSTIFY_BOTTOM; break; + case SID_ALIGN_ANY_VDEFAULT: eVJustify = SvxCellVerJustify::Standard; break; + case SID_ALIGN_ANY_TOP: eVJustify = SvxCellVerJustify::Top; break; + case SID_ALIGN_ANY_VCENTER: eVJustify = SvxCellVerJustify::Center; break; + case SID_ALIGN_ANY_BOTTOM: eVJustify = SvxCellVerJustify::Bottom; break; default: OSL_FAIL( "lclConvertSlotToVAlign - invalid slot" ); } return eVJustify; @@ -1551,7 +1551,7 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq ) const SvxHorJustifyItem* pHorJustify = nullptr; const SvxVerJustifyItem* pVerJustify = nullptr; SvxCellHorJustify eHorJustify = SvxCellHorJustify::Standard; - SvxCellVerJustify eVerJustify = SVX_VER_JUSTIFY_STANDARD; + SvxCellVerJustify eVerJustify = SvxCellVerJustify::Standard; if (rAttrSet.GetItemState(ATTR_HOR_JUSTIFY, true,&pItem ) == SfxItemState::SET) { @@ -1601,24 +1601,24 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq ) case SID_ALIGNTOP: rReq.SetSlot( SID_V_ALIGNCELL ); rReq.AppendItem( SvxVerJustifyItem( - !pVerJustify || (eVerJustify != SVX_VER_JUSTIFY_TOP) ? - SVX_VER_JUSTIFY_TOP : SVX_VER_JUSTIFY_STANDARD, SID_V_ALIGNCELL ) ); + !pVerJustify || (eVerJustify != SvxCellVerJustify::Top) ? + SvxCellVerJustify::Top : SvxCellVerJustify::Standard, SID_V_ALIGNCELL ) ); ExecuteSlot( rReq, GetInterface() ); return; case SID_ALIGNBOTTOM: rReq.SetSlot( SID_V_ALIGNCELL ); rReq.AppendItem( SvxVerJustifyItem( - !pVerJustify || (eVerJustify != SVX_VER_JUSTIFY_BOTTOM) ? - SVX_VER_JUSTIFY_BOTTOM : SVX_VER_JUSTIFY_STANDARD, SID_V_ALIGNCELL ) ); + !pVerJustify || (eVerJustify != SvxCellVerJustify::Bottom) ? + SvxCellVerJustify::Bottom : SvxCellVerJustify::Standard, SID_V_ALIGNCELL ) ); ExecuteSlot( rReq, GetInterface() ); return; case SID_ALIGNCENTERVER: rReq.SetSlot( SID_V_ALIGNCELL ); rReq.AppendItem( SvxVerJustifyItem( - !pVerJustify || (eVerJustify != SVX_VER_JUSTIFY_CENTER) ? - SVX_VER_JUSTIFY_CENTER : SVX_VER_JUSTIFY_STANDARD, SID_V_ALIGNCELL ) ); + !pVerJustify || (eVerJustify != SvxCellVerJustify::Center) ? + SvxCellVerJustify::Center : SvxCellVerJustify::Standard, SID_V_ALIGNCELL ) ); ExecuteSlot( rReq, GetInterface() ); return; @@ -2291,7 +2291,7 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet ) const SvxHorJustifyItem* pHorJustify = nullptr; const SvxVerJustifyItem* pVerJustify = nullptr; - SvxCellVerJustify eVerJustify = SVX_VER_JUSTIFY_STANDARD; + SvxCellVerJustify eVerJustify = SvxCellVerJustify::Standard; sal_uInt16 nWhich = 0; bool bJustifyStd = false; SfxBoolItem aBoolItem ( 0, true ); @@ -2374,19 +2374,19 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet ) switch ( eVerJustify ) { - case SVX_VER_JUSTIFY_TOP: + case SvxCellVerJustify::Top: nWhich = SID_ALIGNTOP; break; - case SVX_VER_JUSTIFY_BOTTOM: + case SvxCellVerJustify::Bottom: nWhich = SID_ALIGNBOTTOM; break; - case SVX_VER_JUSTIFY_CENTER: + case SvxCellVerJustify::Center: nWhich = SID_ALIGNCENTERVER; break; - case SVX_VER_JUSTIFY_STANDARD: + case SvxCellVerJustify::Standard: default: bJustifyStd = true; break; @@ -2445,7 +2445,7 @@ void ScFormatShell::GetAlignState( SfxItemSet& rSet ) if( bHasHAlign ) eHAlign = static_cast<const SvxHorJustifyItem&>(rAttrSet.Get( ATTR_HOR_JUSTIFY )).GetValue(); - SvxCellVerJustify eVAlign = SVX_VER_JUSTIFY_STANDARD; + SvxCellVerJustify eVAlign = SvxCellVerJustify::Standard; bool bHasVAlign = rAttrSet.GetItemState( ATTR_VER_JUSTIFY ) != SfxItemState::DONTCARE; if( bHasVAlign ) eVAlign = static_cast<const SvxVerJustifyItem&>(rAttrSet.Get( ATTR_VER_JUSTIFY )).GetValue(); diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index b324d40f872f..424862cc9693 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -185,7 +185,7 @@ ScDrawStringsVars::ScDrawStringsVars(ScOutputData* pData, bool bPTL) : nAscentPixel(0), eAttrOrient ( SvxCellOrientation::Standard ), eAttrHorJust( SvxCellHorJustify::Standard ), - eAttrVerJust( SVX_VER_JUSTIFY_BOTTOM ), + eAttrVerJust( SvxCellVerJustify::Bottom ), eAttrHorJustMethod( SvxCellJustifyMethod::Auto ), pMargin ( nullptr ), nIndent ( 0 ), @@ -326,8 +326,8 @@ void ScDrawStringsVars::SetPattern( eAttrHorJust = static_cast<const SvxHorJustifyItem&>(pPattern->GetItem( ATTR_HOR_JUSTIFY, pCondSet )).GetValue(); eAttrVerJust = static_cast<const SvxVerJustifyItem&>(pPattern->GetItem( ATTR_VER_JUSTIFY, pCondSet )).GetValue(); - if ( eAttrVerJust == SVX_VER_JUSTIFY_STANDARD ) - eAttrVerJust = SVX_VER_JUSTIFY_BOTTOM; + if ( eAttrVerJust == SvxCellVerJustify::Standard ) + eAttrVerJust = SvxCellVerJustify::Bottom; // justification method @@ -1901,22 +1901,22 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co long nTestClipHeight = aVars.GetTextSize().Height(); switch (aVars.GetVerJust()) { - case SVX_VER_JUSTIFY_TOP: - case SVX_VER_JUSTIFY_BLOCK: + case SvxCellVerJustify::Top: + case SvxCellVerJustify::Block: { long nTop = (long)( aVars.GetMargin()->GetTopMargin() * mnPPTY ); nJustPosY += nTop; nTestClipHeight += nTop; } break; - case SVX_VER_JUSTIFY_BOTTOM: + case SvxCellVerJustify::Bottom: { long nBot = (long)( aVars.GetMargin()->GetBottomMargin() * mnPPTY ); nJustPosY += nOutHeight - aVars.GetTextSize().Height() - nBot; nTestClipHeight += nBot; } break; - case SVX_VER_JUSTIFY_CENTER: + case SvxCellVerJustify::Center: { long nTop = (long)( aVars.GetMargin()->GetTopMargin() * mnPPTY ); long nBot = (long)( aVars.GetMargin()->GetBottomMargin() * mnPPTY ); @@ -2580,19 +2580,19 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine() SvxAdjust eSvxAdjust = SvxAdjust::Left; switch (meVerJust) { - case SVX_VER_JUSTIFY_TOP: + case SvxCellVerJustify::Top: eSvxAdjust = (meOrient == SvxCellOrientation::TopBottom || mbAsianVertical) ? SvxAdjust::Left : SvxAdjust::Right; break; - case SVX_VER_JUSTIFY_CENTER: + case SvxCellVerJustify::Center: eSvxAdjust = SvxAdjust::Center; break; - case SVX_VER_JUSTIFY_BOTTOM: - case SVX_VER_JUSTIFY_STANDARD: + case SvxCellVerJustify::Bottom: + case SvxCellVerJustify::Standard: eSvxAdjust = (meOrient == SvxCellOrientation::TopBottom || mbAsianVertical) ? SvxAdjust::Right : SvxAdjust::Left; break; - case SVX_VER_JUSTIFY_BLOCK: + case SvxCellVerJustify::Block: eSvxAdjust = SvxAdjust::Block; break; } @@ -2601,7 +2601,7 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine() mpEngine->SetDefaultItem( SvxJustifyMethodItem(meVerJustMethod, EE_PARA_JUST_METHOD) ); if (meHorJustResult == SvxCellHorJustify::Block) - mpEngine->SetDefaultItem( SvxVerJustifyItem(SVX_VER_JUSTIFY_BLOCK, EE_PARA_VER_JUST) ); + mpEngine->SetDefaultItem( SvxVerJustifyItem(SvxCellVerJustify::Block, EE_PARA_VER_JUST) ); } else { @@ -2637,17 +2637,17 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine() else switch (meVerJust) { - case SVX_VER_JUSTIFY_TOP: + case SvxCellVerJustify::Top: eSvxAdjust = SvxAdjust::Right; break; - case SVX_VER_JUSTIFY_CENTER: + case SvxCellVerJustify::Center: eSvxAdjust = SvxAdjust::Center; break; - case SVX_VER_JUSTIFY_BOTTOM: - case SVX_VER_JUSTIFY_STANDARD: + case SvxCellVerJustify::Bottom: + case SvxCellVerJustify::Standard: eSvxAdjust = SvxAdjust::Left; break; - case SVX_VER_JUSTIFY_BLOCK: + case SvxCellVerJustify::Block: eSvxAdjust = SvxAdjust::Block; break; } @@ -2659,13 +2659,13 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine() { mpEngine->SetDefaultItem( SvxJustifyMethodItem(meVerJustMethod, EE_PARA_JUST_METHOD) ); if (meHorJustResult == SvxCellHorJustify::Block) - mpEngine->SetDefaultItem( SvxVerJustifyItem(SVX_VER_JUSTIFY_BLOCK, EE_PARA_VER_JUST) ); + mpEngine->SetDefaultItem( SvxVerJustifyItem(SvxCellVerJustify::Block, EE_PARA_VER_JUST) ); } else { mpEngine->SetDefaultItem( SvxJustifyMethodItem(meHorJustMethod, EE_PARA_JUST_METHOD) ); - if (meVerJust == SVX_VER_JUSTIFY_BLOCK) - mpEngine->SetDefaultItem( SvxVerJustifyItem(SVX_VER_JUSTIFY_BLOCK, EE_PARA_VER_JUST) ); + if (meVerJust == SvxCellVerJustify::Block) + mpEngine->SetDefaultItem( SvxVerJustifyItem(SvxCellVerJustify::Block, EE_PARA_VER_JUST) ); } } @@ -2834,8 +2834,8 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam) // Fill the EditEngine (cell attributes and text) // default alignment for asian vertical mode is top-right - if ( rParam.mbAsianVertical && rParam.meVerJust == SVX_VER_JUSTIFY_STANDARD ) - rParam.meVerJust = SVX_VER_JUSTIFY_TOP; + if ( rParam.mbAsianVertical && rParam.meVerJust == SvxCellVerJustify::Standard ) + rParam.meVerJust = SvxCellVerJustify::Top; rParam.setPatternToEngine(mbUseStyleColor); rParam.setAlignmentToEngine(); @@ -3089,8 +3089,8 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam) rParam.mpOldPattern = nullptr; } - if (rParam.meVerJust==SVX_VER_JUSTIFY_BOTTOM || - rParam.meVerJust==SVX_VER_JUSTIFY_STANDARD) + if (rParam.meVerJust==SvxCellVerJustify::Bottom || + rParam.meVerJust==SvxCellVerJustify::Standard) { //! if pRefDevice != pFmtDevice, keep heights in logic units, //! only converting margin? @@ -3103,7 +3103,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam) else aLogicStart.Y() += nTopM + aCellSize.Height() - nEngineHeight; } - else if (rParam.meVerJust==SVX_VER_JUSTIFY_CENTER) + else if (rParam.meVerJust==SvxCellVerJustify::Center) { if (rParam.mbPixelToLogic) aLogicStart.Y() += mpRefDevice->PixelToLogic( Size(0, nTopM + ( @@ -3493,16 +3493,16 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam) switch (rParam.meVerJust) { - case SVX_VER_JUSTIFY_STANDARD: - case SVX_VER_JUSTIFY_BOTTOM: + case SvxCellVerJustify::Standard: + case SvxCellVerJustify::Bottom: // align to bottom (do nothing). break; - case SVX_VER_JUSTIFY_CENTER: + case SvxCellVerJustify::Center: // center it. aLogicStart.Y() -= nGap / 2; break; - case SVX_VER_JUSTIFY_BLOCK: - case SVX_VER_JUSTIFY_TOP: + case SvxCellVerJustify::Block: + case SvxCellVerJustify::Top: // align to top aLogicStart.Y() -= nGap; break; @@ -3744,17 +3744,17 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam) switch (rParam.meVerJust) { - case SVX_VER_JUSTIFY_STANDARD: - case SVX_VER_JUSTIFY_BOTTOM: + case SvxCellVerJustify::Standard: + case SvxCellVerJustify::Bottom: // align to bottom aLogicStart.Y() -= nGap; break; - case SVX_VER_JUSTIFY_CENTER: + case SvxCellVerJustify::Center: // center it. aLogicStart.Y() -= nGap / 2; break; - case SVX_VER_JUSTIFY_BLOCK: - case SVX_VER_JUSTIFY_TOP: + case SvxCellVerJustify::Block: + case SvxCellVerJustify::Top: // align to top (do nothing) default: ; @@ -4056,8 +4056,8 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam) else aLogicStart = Point(nStartX, nStartY); - if (rParam.meVerJust==SVX_VER_JUSTIFY_BOTTOM || - rParam.meVerJust==SVX_VER_JUSTIFY_STANDARD) + if (rParam.meVerJust==SvxCellVerJustify::Bottom || + rParam.meVerJust==SvxCellVerJustify::Standard) { //! if pRefDevice != pFmtDevice, keep heights in logic units, //! only converting margin? @@ -4070,7 +4070,7 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam) else aLogicStart.Y() += nTopM + aCellSize.Height() - nEngineHeight; } - else if (rParam.meVerJust==SVX_VER_JUSTIFY_CENTER) + else if (rParam.meVerJust==SvxCellVerJustify::Center) { if (rParam.mbPixelToLogic) aLogicStart.Y() += mpRefDevice->PixelToLogic( Size(0, nTopM + ( @@ -4209,8 +4209,8 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam) // Fill the EditEngine (cell attributes and text) // default alignment for asian vertical mode is top-right - if ( rParam.meVerJust == SVX_VER_JUSTIFY_STANDARD ) - rParam.meVerJust = SVX_VER_JUSTIFY_TOP; + if ( rParam.meVerJust == SvxCellVerJustify::Standard ) + rParam.meVerJust = SvxCellVerJustify::Top; rParam.setPatternToEngine(mbUseStyleColor); rParam.setAlignmentToEngine(); @@ -5179,8 +5179,8 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) if ( eOrient==SvxCellOrientation::Standard || eOrient==SvxCellOrientation::Stacked || !bBreak ) { - if (eVerJust==SVX_VER_JUSTIFY_BOTTOM || - eVerJust==SVX_VER_JUSTIFY_STANDARD) + if (eVerJust==SvxCellVerJustify::Bottom || + eVerJust==SvxCellVerJustify::Standard) { if (bPixelToLogic) aLogicStart.Y() += mpRefDevice->PixelToLogic( Size(0, @@ -5191,7 +5191,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) aLogicStart.Y() += aCellSize.Height() - nEngineHeight; } - else if (eVerJust==SVX_VER_JUSTIFY_CENTER) + else if (eVerJust==SvxCellVerJustify::Center) { if (bPixelToLogic) aLogicStart.Y() += mpRefDevice->PixelToLogic( Size(0,( @@ -5241,9 +5241,9 @@ void ScOutputData::DrawRotated(bool bPixelToLogic) nAddX -= nSkew; long nUp = 0; - if ( eVerJust == SVX_VER_JUSTIFY_CENTER ) + if ( eVerJust == SvxCellVerJustify::Center ) nUp = ( aCellSize.Height() - nEngineHeight ) / 2; - else if ( eVerJust == SVX_VER_JUSTIFY_TOP ) + else if ( eVerJust == SvxCellVerJustify::Top ) { if ( nSin > 0.0 ) nUp = aCellSize.Height() - nEngineHeight; diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index 76dbb783faf3..f2c0fa9e170d 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -1250,7 +1250,7 @@ void SwDocTest::testTableAutoFormats() SvxHorJustifyItem aHJustify( SvxCellHorJustify::Center, 0 ); aBoxAF.m_aHorJustify = aHJustify; //Set m_aVerJustify - SvxVerJustifyItem aVJustify( SVX_VER_JUSTIFY_CENTER , 0 ); + SvxVerJustifyItem aVJustify( SvxCellVerJustify::Center , 0 ); aBoxAF.m_aVerJustify = aVJustify; //Set m_aStacked aBoxAF.m_aStacked.SetValue( true ); diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index a0a8a1ee25bc..4c66817309de 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -291,7 +291,7 @@ SwBoxAutoFormat::SwBoxAutoFormat() m_aTextOrientation(SvxFrameDirection::Environment, RES_FRAMEDIR), m_aVerticalAlignment(0, css::text::VertOrientation::NONE, css::text::RelOrientation::FRAME), m_aHorJustify( SvxCellHorJustify::Standard, 0), - m_aVerJustify( SVX_VER_JUSTIFY_STANDARD, 0), + m_aVerJustify( SvxCellVerJustify::Standard, 0), m_aStacked( 0 ), m_aMargin( 0 ), m_aLinebreak( 0 ), |