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 /sc/source | |
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>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/data/docpool.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/autoform.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/editutil.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xlstyle.cxx | 18 | ||||
-rw-r--r-- | sc/source/filter/html/htmlexp.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 18 | ||||
-rw-r--r-- | sc/source/filter/lotus/op.cxx | 10 | ||||
-rw-r--r-- | sc/source/filter/oox/stylesbuffer.cxx | 12 | ||||
-rw-r--r-- | sc/source/filter/orcus/interface.cxx | 10 | ||||
-rw-r--r-- | sc/source/filter/qpro/qprostyle.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/rtf/rtfexp.cxx | 10 | ||||
-rw-r--r-- | sc/source/filter/starcalc/scflt.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleText.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/undo/undoblk3.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 36 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 92 |
18 files changed, 129 insertions, 129 deletions
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; |