[Libreoffice-commits] core.git: include/editeng include/svx sc/source svx/source sw/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Sep 14 11:06:23 UTC 2017


 include/editeng/svxenum.hxx         |   10 +--
 include/svx/algitem.hxx             |    4 -
 sc/source/core/data/attarray.cxx    |    2 
 sc/source/core/data/column2.cxx     |   18 +++---
 sc/source/core/data/patattr.cxx     |   10 +--
 sc/source/core/tool/autoform.cxx    |    4 -
 sc/source/filter/qpro/qprostyle.cxx |    4 -
 sc/source/ui/inc/output.hxx         |    2 
 sc/source/ui/view/gridwin.cxx       |    2 
 sc/source/ui/view/output2.cxx       |  106 ++++++++++++++++++------------------
 svx/source/items/algitem.cxx        |   44 +++++++-------
 sw/source/core/doc/tblafmt.cxx      |    4 -
 12 files changed, 105 insertions(+), 105 deletions(-)

New commits:
commit 01062f27774a5c0adec8ba6e3bb10994538c8a82
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Sep 14 10:47:47 2017 +0200

    convert SvxCellOrientation to scoped enum
    
    Change-Id: Ia4c75c6394b47805f24a7daca593e0074a8ddf0b
    Reviewed-on: https://gerrit.libreoffice.org/42268
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/editeng/svxenum.hxx b/include/editeng/svxenum.hxx
index 626383329990..a6d00920a2b5 100644
--- a/include/editeng/svxenum.hxx
+++ b/include/editeng/svxenum.hxx
@@ -121,12 +121,12 @@ enum SvxCellVerJustify
     SVX_VER_JUSTIFY_BLOCK
 };
 
-enum SvxCellOrientation
+enum class SvxCellOrientation
 {
-    SVX_ORIENTATION_STANDARD,
-    SVX_ORIENTATION_TOPBOTTOM,
-    SVX_ORIENTATION_BOTTOMTOP,
-    SVX_ORIENTATION_STACKED
+    Standard,
+    TopBottom,
+    BottomUp,
+    Stacked
 };
 
 enum class SvxSpellArea
diff --git a/include/svx/algitem.hxx b/include/svx/algitem.hxx
index 4438d9148553..00ab5145fec7 100644
--- a/include/svx/algitem.hxx
+++ b/include/svx/algitem.hxx
@@ -35,7 +35,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxOrientationItem: public SfxEnumItem<SvxCe
 {
 public:
     SvxOrientationItem(
-        const SvxCellOrientation eOrientation /*= SVX_ORIENTATION_STANDARD*/,
+        const SvxCellOrientation eOrientation,
         const sal_uInt16 nId );
 
     SvxOrientationItem(
@@ -51,7 +51,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( SvxCellOrientation nVal );
     virtual SfxPoolItem*    Clone( SfxItemPool *pPool = nullptr ) const override;
     virtual SfxPoolItem*    Create( SvStream& rStream, sal_uInt16 nVer ) const override;
 
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 9109336115ca..c3023fed67a2 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1354,7 +1354,7 @@ bool ScAttrArray::HasAttrib_Impl(const ScPatternAttr* pPattern, HasAttrFlags nMa
     }
     if ( nMask & HasAttrFlags::NeedHeight )
     {
-        if (pPattern->GetCellOrientation() != SVX_ORIENTATION_STANDARD)
+        if (pPattern->GetCellOrientation() != SvxCellOrientation::Standard)
             bFound = true;
         else if (static_cast<const SfxBoolItem&>(pPattern->GetItem( ATTR_LINEBREAK )).GetValue())
             bFound = true;
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index b6432a735132..4f8183938a3c 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -191,7 +191,7 @@ long ScColumn::GetNeededSize(
     //  get other attributes from pattern and conditional formatting
 
     SvxCellOrientation eOrient = pPattern->GetCellOrientation( pCondSet );
-    bool bAsianVertical = ( eOrient == SVX_ORIENTATION_STACKED &&
+    bool bAsianVertical = ( eOrient == SvxCellOrientation::Stacked &&
             static_cast<const SfxBoolItem&>(pPattern->GetItem( ATTR_VERTICAL_ASIAN, pCondSet )).GetValue() );
     if ( bAsianVertical )
         bBreak = false;
@@ -201,7 +201,7 @@ long ScColumn::GetNeededSize(
 
     long nRotate = 0;
     SvxRotateMode eRotMode = SVX_ROTATE_MODE_STANDARD;
-    if ( eOrient == SVX_ORIENTATION_STANDARD )
+    if ( eOrient == SvxCellOrientation::Standard )
     {
         if (pCondSet &&
                 pCondSet->GetItemState(ATTR_ROTATE_VALUE, true, &pCondItem) == SfxItemState::SET)
@@ -225,7 +225,7 @@ long ScColumn::GetNeededSize(
     if ( eHorJust == SvxCellHorJustify::Repeat )
     {
         // ignore orientation/rotation if "repeat" is active
-        eOrient = SVX_ORIENTATION_STANDARD;
+        eOrient = SvxCellOrientation::Standard;
         nRotate = 0;
         bAsianVertical = false;
     }
@@ -253,7 +253,7 @@ long ScColumn::GetNeededSize(
     //  bGetFont is set also if script type changes
     if (rOptions.bGetFont)
     {
-        Fraction aFontZoom = ( eOrient == SVX_ORIENTATION_STANDARD ) ? rZoomX : rZoomY;
+        Fraction aFontZoom = ( eOrient == SvxCellOrientation::Standard ) ? rZoomX : rZoomY;
         vcl::Font aFont;
         // font color doesn't matter here
         pPattern->GetFont( aFont, SC_AUTOCOL_BLACK, pDev, &aFontZoom, pCondSet, nScript );
@@ -264,7 +264,7 @@ long ScColumn::GetNeededSize(
     CellType eCellType = aCell.meType;
 
     bool bEditEngine = (eCellType == CELLTYPE_EDIT ||
-                        eOrient == SVX_ORIENTATION_STACKED ||
+                        eOrient == SvxCellOrientation::Stacked ||
                         IsAmbiguousScript(nScript) ||
                         ((eCellType == CELLTYPE_FORMULA) && aCell.mpFormula->IsMultilineResult()));
 
@@ -280,7 +280,7 @@ long ScColumn::GetNeededSize(
             //  SetFont is moved up
 
             Size aSize( pDev->GetTextWidth( aValStr ), pDev->GetTextHeight() );
-            if ( eOrient != SVX_ORIENTATION_STANDARD )
+            if ( eOrient != SvxCellOrientation::Standard )
             {
                 long nTemp = aSize.Width();
                 aSize.Width() = aSize.Height();
@@ -398,7 +398,7 @@ long ScColumn::GetNeededSize(
         }
 
         Size aPaper = Size( 1000000, 1000000 );
-        if ( eOrient==SVX_ORIENTATION_STACKED && !bAsianVertical )
+        if ( eOrient==SvxCellOrientation::Stacked && !bAsianVertical )
             aPaper.Width() = 1;
         else if (bBreak)
         {
@@ -458,7 +458,7 @@ long ScColumn::GetNeededSize(
         pEngine->SetUpdateMode( true );
 
         bool bEdWidth = bWidth;
-        if ( eOrient != SVX_ORIENTATION_STANDARD && eOrient != SVX_ORIENTATION_STACKED )
+        if ( eOrient != SvxCellOrientation::Standard && eOrient != SvxCellOrientation::Stacked )
             bEdWidth = !bEdWidth;
         if ( nRotate )
         {
@@ -809,7 +809,7 @@ void ScColumn::GetOptimalHeight(
         }
         else
         {
-            bool bStdAllowed = (pPattern->GetCellOrientation() == SVX_ORIENTATION_STANDARD);
+            bool bStdAllowed = (pPattern->GetCellOrientation() == SvxCellOrientation::Standard);
             bool bStdOnly = false;
             if (bStdAllowed)
             {
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 11cb935f89a1..e61a217a353a 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -145,19 +145,19 @@ bool ScPatternAttr::operator==( const SfxPoolItem& rCmp ) const
 
 SvxCellOrientation ScPatternAttr::GetCellOrientation( const SfxItemSet& rItemSet, const SfxItemSet* pCondSet )
 {
-    SvxCellOrientation eOrient = SVX_ORIENTATION_STANDARD;
+    SvxCellOrientation eOrient = SvxCellOrientation::Standard;
 
     if( static_cast<const SfxBoolItem&>(GetItem( ATTR_STACKED, rItemSet, pCondSet )).GetValue() )
     {
-        eOrient = SVX_ORIENTATION_STACKED;
+        eOrient = SvxCellOrientation::Stacked;
     }
     else
     {
         sal_Int32 nAngle = static_cast<const SfxInt32Item&>(GetItem( ATTR_ROTATE_VALUE, rItemSet, pCondSet )).GetValue();
         if( nAngle == 9000 )
-            eOrient = SVX_ORIENTATION_BOTTOMTOP;
+            eOrient = SvxCellOrientation::BottomUp;
         else if( nAngle == 27000 )
-            eOrient = SVX_ORIENTATION_TOPBOTTOM;
+            eOrient = SvxCellOrientation::TopBottom;
     }
 
     return eOrient;
@@ -1326,7 +1326,7 @@ const SfxPoolItem& ScPatternAttr::GetItem( sal_uInt16 nSubWhich, const SfxItemSe
 long ScPatternAttr::GetRotateVal( const SfxItemSet* pCondSet ) const
 {
     long nAttrRotate = 0;
-    if ( GetCellOrientation() == SVX_ORIENTATION_STANDARD )
+    if ( GetCellOrientation() == SvxCellOrientation::Standard )
     {
         bool bRepeat = ( static_cast<const SvxHorJustifyItem&>(GetItem(ATTR_HOR_JUSTIFY, pCondSet)).
                             GetValue() == SvxCellHorJustify::Repeat );
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index 0a83470057a8..5a82dad4130d 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -196,7 +196,7 @@ void ScAfVersions::Write(SvStream& rStream, sal_uInt16 fileVersion)
 
     rStream.WriteUInt16( SvxHorJustifyItem(SvxCellHorJustify::Standard, ATTR_HOR_JUSTIFY).GetVersion(fileVersion) );
     rStream.WriteUInt16( SvxVerJustifyItem(SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY).GetVersion(fileVersion) );
-    rStream.WriteUInt16( SvxOrientationItem(SVX_ORIENTATION_STANDARD, 0).GetVersion(fileVersion) );
+    rStream.WriteUInt16( SvxOrientationItem(SvxCellOrientation::Standard, 0).GetVersion(fileVersion) );
     rStream.WriteUInt16( SvxMarginItem(ATTR_MARGIN).GetVersion(fileVersion) );
     rStream.WriteUInt16( SfxBoolItem(ATTR_LINEBREAK).GetVersion(fileVersion) );
     rStream.WriteUInt16( SfxInt32Item(ATTR_ROTATE_VALUE).GetVersion(fileVersion) );
@@ -295,7 +295,7 @@ void ScAutoFormatDataField::SetAdjust( const SvxAdjustItem& rAdjust )
 bool ScAutoFormatDataField::Load( SvStream& rStream, const ScAfVersions& rVersions, sal_uInt16 nVer )
 {
     SfxPoolItem* pNew;
-    SvxOrientationItem aOrientation( SVX_ORIENTATION_STANDARD, 0 );
+    SvxOrientationItem aOrientation( SvxCellOrientation::Standard, 0 );
 
     READ( aFont,        SvxFontItem,        rVersions.nFontVersion)
     READ( aHeight,      SvxFontHeightItem,  rVersions.nFontHeightVersion)
diff --git a/sc/source/filter/qpro/qprostyle.cxx b/sc/source/filter/qpro/qprostyle.cxx
index 6a3c56d49220..f4e45c73a67e 100644
--- a/sc/source/filter/qpro/qprostyle.cxx
+++ b/sc/source/filter/qpro/qprostyle.cxx
@@ -110,11 +110,11 @@ void ScQProStyle::SetFormat( ScDocument *pDoc, sal_uInt8 nCol, sal_uInt16 nRow,
     rItemSet.Put(SvxVerJustifyItem( eVerJustify, ATTR_VER_JUSTIFY ) );
 
     // Orientation
-    SvxCellOrientation eOrient = SVX_ORIENTATION_STANDARD;
+    SvxCellOrientation eOrient = SvxCellOrientation::Standard;
     switch( nOrient )
     {
         case 0x20:
-            eOrient = SVX_ORIENTATION_TOPBOTTOM;
+            eOrient = SvxCellOrientation::TopBottom;
             break;
 
     }
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index 3215f1dbf1e9..e1555de9f7c3 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -222,7 +222,7 @@ private:
 
     void            ShrinkEditEngine( EditEngine& rEngine, const tools::Rectangle& rAlignRect,
                                     long nLeftM, long nTopM, long nRightM, long nBottomM,
-                                    bool bWidth, sal_uInt16 nOrient, long nAttrRotate, bool bPixelToLogic,
+                                    bool bWidth, SvxCellOrientation nOrient, long nAttrRotate, bool bPixelToLogic,
                                     long& rEngineWidth, long& rEngineHeight, long& rNeededPixel,
                                     bool& rLeftClip, bool& rRightClip );
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index c885935b69ec..be4d38060249 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5074,7 +5074,7 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
 
         // vertical can not (yet) be clicked:
 
-    if (pPattern->GetCellOrientation() != SVX_ORIENTATION_STANDARD)
+    if (pPattern->GetCellOrientation() != SvxCellOrientation::Standard)
         return false;
 
     bool bBreak = static_cast<const SfxBoolItem&>(pPattern->GetItem(ATTR_LINEBREAK)).GetValue() ||
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 8ac4e24845c6..a4aab11ba9bf 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -183,7 +183,7 @@ ScDrawStringsVars::ScDrawStringsVars(ScOutputData* pData, bool bPTL) :
     pPattern    ( nullptr ),
     pCondSet    ( nullptr ),
     nAscentPixel(0),
-    eAttrOrient ( SVX_ORIENTATION_STANDARD ),
+    eAttrOrient ( SvxCellOrientation::Standard ),
     eAttrHorJust( SvxCellHorJustify::Standard ),
     eAttrVerJust( SVX_VER_JUSTIFY_BOTTOM ),
     eAttrHorJustMethod( SvxCellJustifyMethod::Auto ),
@@ -343,7 +343,7 @@ void ScDrawStringsVars::SetPattern(
     if ( bRepeat )
     {
         // "repeat" disables rotation (before constructing the font)
-        eAttrOrient = SVX_ORIENTATION_STANDARD;
+        eAttrOrient = SvxCellOrientation::Standard;
 
         // #i31843# "repeat" with "line breaks" is treated as default alignment (but rotation is still disabled)
         if ( bLineBreak )
@@ -353,20 +353,20 @@ void ScDrawStringsVars::SetPattern(
     short nRot;
     switch (eAttrOrient)
     {
-        case SVX_ORIENTATION_STANDARD:
+        case SvxCellOrientation::Standard:
             nRot = 0;
             bRotated = static_cast<const SfxInt32Item&>(pPattern->GetItem( ATTR_ROTATE_VALUE, pCondSet )).GetValue() != 0 &&
                        !bRepeat;
             break;
-        case SVX_ORIENTATION_STACKED:
+        case SvxCellOrientation::Stacked:
             nRot = 0;
             bRotated = false;
             break;
-        case SVX_ORIENTATION_TOPBOTTOM:
+        case SvxCellOrientation::TopBottom:
             nRot = 2700;
             bRotated = false;
             break;
-        case SVX_ORIENTATION_BOTTOMTOP:
+        case SvxCellOrientation::BottomUp:
             nRot = 900;
             bRotated = false;
             break;
@@ -695,7 +695,7 @@ void ScDrawStringsVars::SetAutoText( const OUString& rAutoText )
     }
 
     aTextSize.Height() = aMetric.GetAscent() + aMetric.GetDescent();
-    if ( GetOrient() != SVX_ORIENTATION_STANDARD )
+    if ( GetOrient() != SvxCellOrientation::Standard )
     {
         long nTemp = aTextSize.Height();
         aTextSize.Height() = aTextSize.Width();
@@ -765,7 +765,7 @@ void ScDrawStringsVars::TextChanged()
     }
 
     aTextSize.Height() = aMetric.GetAscent() + aMetric.GetDescent();
-    if ( GetOrient() != SVX_ORIENTATION_STANDARD )
+    if ( GetOrient() != SvxCellOrientation::Standard )
     {
         long nTemp = aTextSize.Height();
         aTextSize.Height() = aTextSize.Width();
@@ -1669,7 +1669,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
                     }
 
                     //  use edit engine for rotated, stacked or mixed-script text
-                    if ( aVars.GetOrient() == SVX_ORIENTATION_STACKED ||
+                    if ( aVars.GetOrient() == SvxCellOrientation::Stacked ||
                          aVars.IsRotated() || IsAmbiguousScript(nScript) )
                         bNeedEdit = true;
                 }
@@ -1721,7 +1721,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
                     aVars.RepeatToFill( aAreaParam.mnColWidth - nTotalMargin );
                     if ( bShrink )
                     {
-                        if ( aVars.GetOrient() != SVX_ORIENTATION_STANDARD )
+                        if ( aVars.GetOrient() != SvxCellOrientation::Standard )
                         {
                             // Only horizontal scaling is handled here.
                             // DrawEdit is used to vertically scale 90 deg rotated text.
@@ -1789,7 +1789,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
                     //  use edit engine if automatic line breaks are needed
                     if ( bBreak )
                     {
-                        if ( aVars.GetOrient() == SVX_ORIENTATION_STANDARD )
+                        if ( aVars.GetOrient() == SvxCellOrientation::Standard )
                             bNeedEdit = ( aAreaParam.mbLeftClip || aAreaParam.mbRightClip );
                         else
                         {
@@ -1974,13 +1974,13 @@ tools::Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, co
 
                         switch (aVars.GetOrient())
                         {
-                            case SVX_ORIENTATION_STANDARD:
+                            case SvxCellOrientation::Standard:
                                 nJustPosY += aVars.GetAscent();
                                 break;
-                            case SVX_ORIENTATION_TOPBOTTOM:
+                            case SvxCellOrientation::TopBottom:
                                 nJustPosX += aVars.GetTextSize().Width() - aVars.GetAscent();
                                 break;
-                            case SVX_ORIENTATION_BOTTOMTOP:
+                            case SvxCellOrientation::BottomUp:
                                 nJustPosY += aVars.GetTextSize().Height();
                                 nJustPosX += aVars.GetAscent();
                                 break;
@@ -2242,7 +2242,7 @@ static long lcl_GetEditSize( EditEngine& rEngine, bool bWidth, bool bSwap, long
 
 void ScOutputData::ShrinkEditEngine( EditEngine& rEngine, const tools::Rectangle& rAlignRect,
             long nLeftM, long nTopM, long nRightM, long nBottomM,
-            bool bWidth, sal_uInt16 nOrient, long nAttrRotate, bool bPixelToLogic,
+            bool bWidth, SvxCellOrientation nOrient, long nAttrRotate, bool bPixelToLogic,
             long& rEngineWidth, long& rEngineHeight, long& rNeededPixel, bool& rLeftClip, bool& rRightClip )
 {
     if ( !bWidth )
@@ -2257,7 +2257,7 @@ void ScOutputData::ShrinkEditEngine( EditEngine& rEngine, const tools::Rectangle
         if ( nScaleSize <= rAlignRect.GetHeight() )
             return;
 
-        bool bSwap = ( nOrient == SVX_ORIENTATION_TOPBOTTOM || nOrient == SVX_ORIENTATION_BOTTOMTOP );
+        bool bSwap = ( nOrient == SvxCellOrientation::TopBottom || nOrient == SvxCellOrientation::BottomUp );
         long nAvailable = rAlignRect.GetHeight() - nTopM - nBottomM;
         long nScale = ( nAvailable * 100 ) / nScaleSize;
 
@@ -2436,7 +2436,7 @@ void ScOutputData::DrawEditParam::setPatternToEngine(bool bUseStyleColor)
     mpOldPreviewFontSet = mpPreviewFontSet;
 
     EEControlBits nControl = mpEngine->GetControlWord();
-    if (meOrient == SVX_ORIENTATION_STACKED)
+    if (meOrient == SvxCellOrientation::Stacked)
         nControl |= EEControlBits::ONECHARPERLINE;
     else
         nControl &= ~EEControlBits::ONECHARPERLINE;
@@ -2506,7 +2506,7 @@ void ScOutputData::DrawEditParam::calcPaperSize(
 void ScOutputData::DrawEditParam::getEngineSize(ScFieldEditEngine* pEngine, long& rWidth, long& rHeight) const
 {
     long nEngineWidth = 0;
-    if (!mbBreak || meOrient == SVX_ORIENTATION_STACKED || mbAsianVertical)
+    if (!mbBreak || meOrient == SvxCellOrientation::Stacked || mbAsianVertical)
         nEngineWidth = static_cast<long>(pEngine->CalcTextWidth());
 
     long nEngineHeight = pEngine->GetTextHeight();
@@ -2518,7 +2518,7 @@ void ScOutputData::DrawEditParam::getEngineSize(ScFieldEditEngine* pEngine, long
         nEngineHeight = nTemp;
     }
 
-    if (meOrient == SVX_ORIENTATION_STACKED)
+    if (meOrient == SvxCellOrientation::Stacked)
         nEngineWidth = nEngineWidth * 11 / 10;
 
     rWidth = nEngineWidth;
@@ -2527,7 +2527,7 @@ void ScOutputData::DrawEditParam::getEngineSize(ScFieldEditEngine* pEngine, long
 
 bool ScOutputData::DrawEditParam::hasLineBreak() const
 {
-    return (mbBreak || (meOrient == SVX_ORIENTATION_STACKED) || mbAsianVertical);
+    return (mbBreak || (meOrient == SvxCellOrientation::Stacked) || mbAsianVertical);
 }
 
 bool ScOutputData::DrawEditParam::isHyperlinkCell() const
@@ -2540,7 +2540,7 @@ bool ScOutputData::DrawEditParam::isHyperlinkCell() const
 
 bool ScOutputData::DrawEditParam::isVerticallyOriented() const
 {
-    return (meOrient == SVX_ORIENTATION_TOPBOTTOM || meOrient == SVX_ORIENTATION_BOTTOMTOP);
+    return (meOrient == SvxCellOrientation::TopBottom || meOrient == SvxCellOrientation::BottomUp);
 }
 
 void ScOutputData::DrawEditParam::calcStartPosForVertical(
@@ -2581,7 +2581,7 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine()
         switch (meVerJust)
         {
             case SVX_VER_JUSTIFY_TOP:
-                eSvxAdjust = (meOrient == SVX_ORIENTATION_TOPBOTTOM || mbAsianVertical) ?
+                eSvxAdjust = (meOrient == SvxCellOrientation::TopBottom || mbAsianVertical) ?
                             SvxAdjust::Left : SvxAdjust::Right;
                 break;
             case SVX_VER_JUSTIFY_CENTER:
@@ -2589,7 +2589,7 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine()
                 break;
             case SVX_VER_JUSTIFY_BOTTOM:
             case SVX_VER_JUSTIFY_STANDARD:
-                eSvxAdjust = (meOrient == SVX_ORIENTATION_TOPBOTTOM || mbAsianVertical) ?
+                eSvxAdjust = (meOrient == SvxCellOrientation::TopBottom || mbAsianVertical) ?
                             SvxAdjust::Right : SvxAdjust::Left;
                 break;
             case SVX_VER_JUSTIFY_BLOCK:
@@ -2610,11 +2610,11 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine()
         //  -> always set adjustment
 
         SvxAdjust eSvxAdjust = SvxAdjust::Left;
-        if (meOrient == SVX_ORIENTATION_STACKED)
+        if (meOrient == SvxCellOrientation::Stacked)
             eSvxAdjust = SvxAdjust::Center;
         else if (mbBreak)
         {
-            if (meOrient == SVX_ORIENTATION_STANDARD)
+            if (meOrient == SvxCellOrientation::Standard)
                 switch (meHorJustResult)
                 {
                     case SvxCellHorJustify::Repeat:            // repeat is not yet implemented
@@ -2742,7 +2742,7 @@ void ScOutputData::DrawEditParam::adjustForHyperlinkInPDF(Point aURLStart, const
 
 void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
 {
-    OSL_ASSERT(rParam.meOrient == SVX_ORIENTATION_STANDARD);
+    OSL_ASSERT(rParam.meOrient == SvxCellOrientation::Standard);
     OSL_ASSERT(!rParam.mbAsianVertical);
 
     Size aRefOne = mpRefDevice->PixelToLogic(Size(1,1));
@@ -2755,7 +2755,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
     if ( rParam.meHorJustAttr == SvxCellHorJustify::Repeat )
     {
         // ignore orientation/rotation if "repeat" is active
-        rParam.meOrient = SVX_ORIENTATION_STANDARD;
+        rParam.meOrient = SvxCellOrientation::Standard;
         nAttrRotate = 0;
 
         // #i31843# "repeat" with "line breaks" is treated as default alignment
@@ -2875,7 +2875,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
         {
             ShrinkEditEngine( *rParam.mpEngine, aAreaParam.maAlignRect,
                 nLeftM, nTopM, nRightM, nBottomM, true,
-                sal::static_int_cast<sal_uInt16>(rParam.meOrient), 0, rParam.mbPixelToLogic,
+                rParam.meOrient, 0, rParam.mbPixelToLogic,
                 nEngineWidth, nEngineHeight, nNeededPixel,
                 aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
         }
@@ -3356,7 +3356,7 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam)
         {
             ShrinkEditEngine( *rParam.mpEngine, aAreaParam.maAlignRect,
                 nLeftM, nTopM, nRightM, nBottomM, false,
-                sal::static_int_cast<sal_uInt16>(rParam.meOrient), 0, rParam.mbPixelToLogic,
+                (rParam.meOrient), 0, rParam.mbPixelToLogic,
                 nEngineWidth, nEngineHeight, nNeededPixel,
                 aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
         }
@@ -3617,7 +3617,7 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam)
         {
             ShrinkEditEngine( *rParam.mpEngine, aAreaParam.maAlignRect,
                 nLeftM, nTopM, nRightM, nBottomM, false,
-                sal::static_int_cast<sal_uInt16>(rParam.meOrient), 0, rParam.mbPixelToLogic,
+                rParam.meOrient, 0, rParam.mbPixelToLogic,
                 nEngineWidth, nEngineHeight, nNeededPixel,
                 aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
         }
@@ -3794,7 +3794,7 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam)
     if ( rParam.mbAsianVertical )
     {
         // in asian mode, use EditEngine::SetVertical instead of EEControlBits::ONECHARPERLINE
-        rParam.meOrient = SVX_ORIENTATION_STANDARD;
+        rParam.meOrient = SvxCellOrientation::Standard;
         DrawEditAsianVertical(rParam);
         return;
     }
@@ -3890,7 +3890,7 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam)
 
         ShrinkEditEngine( *rParam.mpEngine, aAreaParam.maAlignRect,
             nLeftM, nTopM, nRightM, nBottomM, true,
-            sal::static_int_cast<sal_uInt16>(rParam.meOrient), 0, rParam.mbPixelToLogic,
+            rParam.meOrient, 0, rParam.mbPixelToLogic,
             nEngineWidth, nEngineHeight, nNeededPixel,
             aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
 
@@ -4126,7 +4126,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
 {
     // When in asian vertical orientation, the orientation value is STANDARD,
     // and the asian vertical boolean is true.
-    OSL_ASSERT(rParam.meOrient == SVX_ORIENTATION_STANDARD);
+    OSL_ASSERT(rParam.meOrient == SvxCellOrientation::Standard);
     OSL_ASSERT(rParam.mbAsianVertical);
     OSL_ASSERT(rParam.meHorJustAttr != SvxCellHorJustify::Repeat);
 
@@ -4248,7 +4248,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
     {
         ShrinkEditEngine( *rParam.mpEngine, aAreaParam.maAlignRect,
             nLeftM, nTopM, nRightM, nBottomM, false,
-            sal::static_int_cast<sal_uInt16>(rParam.meOrient), 0, rParam.mbPixelToLogic,
+            rParam.meOrient, 0, rParam.mbPixelToLogic,
             nEngineWidth, nEngineHeight, nNeededPixel,
             aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
     }
@@ -4352,7 +4352,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
         //  Only with automatic line breaks, to avoid having to find
         //  the cells with the horizontal end of the text again.
         if ( nEngineHeight - aCellSize.Height() > 100 &&
-             ( rParam.mbBreak || rParam.meOrient == SVX_ORIENTATION_STACKED ) &&
+             ( rParam.mbBreak || rParam.meOrient == SvxCellOrientation::Stacked ) &&
              !rParam.mbAsianVertical && bMarkClipped &&
              ( rParam.mpEngine->GetParagraphCount() > 1 || rParam.mpEngine->GetLineCount(0) > 1 ) )
         {
@@ -4599,17 +4599,17 @@ void ScOutputData::DrawEdit(bool bPixelToLogic)
                         if (aParam.meHorJustAttr == SvxCellHorJustify::Repeat)
                         {
                             // ignore orientation/rotation if "repeat" is active
-                            aParam.meOrient = SVX_ORIENTATION_STANDARD;
+                            aParam.meOrient = SvxCellOrientation::Standard;
                         }
                         switch (aParam.meOrient)
                         {
-                            case SVX_ORIENTATION_BOTTOMTOP:
+                            case SvxCellOrientation::BottomUp:
                                 DrawEditBottomTop(aParam);
                             break;
-                            case SVX_ORIENTATION_TOPBOTTOM:
+                            case SvxCellOrientation::TopBottom:
                                 DrawEditTopBottom(aParam);
                             break;
-                            case SVX_ORIENTATION_STACKED:
+                            case SvxCellOrientation::Stacked:
                                 // this can be vertically stacked or asian vertical.
                                 DrawEditStacked(aParam);
                             break;
@@ -4738,7 +4738,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
                         long nStartY = nPosY;
                         if (nX<nX1)
                         {
-                            if ((bBreak || eOrient!=SVX_ORIENTATION_STANDARD) && !bMerged)
+                            if ((bBreak || eOrient!=SvxCellOrientation::Standard) && !bMerged)
                                 bHidden = true;
                             else
                             {
@@ -4782,7 +4782,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
 
                                                                     // adjustment for EditEngine
                                 SvxAdjust eSvxAdjust = SvxAdjust::Left;
-                                if (eOrient==SVX_ORIENTATION_STACKED)
+                                if (eOrient==SvxCellOrientation::Stacked)
                                     eSvxAdjust = SvxAdjust::Center;
                                 // adjustment for bBreak is omitted here
                                 pSet->Put( SvxAdjustItem( eSvxAdjust, EE_PARA_JUST ) );
@@ -4792,7 +4792,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
                                 pOldCondSet = pCondSet;
 
                                 EEControlBits nControl = pEngine->GetControlWord();
-                                if (eOrient==SVX_ORIENTATION_STACKED)
+                                if (eOrient==SvxCellOrientation::Stacked)
                                     nControl |= EEControlBits::ONECHARPERLINE;
                                 else
                                     nControl &= ~EEControlBits::ONECHARPERLINE;
@@ -4842,7 +4842,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
                             double nSin = 0.0;
                             double nCos = 1.0;
                             SvxRotateMode eRotMode = SVX_ROTATE_MODE_STANDARD;
-                            if ( eOrient == SVX_ORIENTATION_STANDARD )
+                            if ( eOrient == SvxCellOrientation::Standard )
                             {
                                 nAttrRotate = static_cast<const SfxInt32Item&>(pPattern->
                                                     GetItem(ATTR_ROTATE_VALUE, pCondSet)).GetValue();
@@ -4864,7 +4864,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
                             }
 
                             Size aPaperSize( 1000000, 1000000 );
-                            if (eOrient==SVX_ORIENTATION_STACKED)
+                            if (eOrient==SvxCellOrientation::Stacked)
                                 aPaperSize.Width() = nOutWidth;             // to center
                             else if (bBreak)
                             {
@@ -4876,7 +4876,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
                                     //! With offset rows the following would be correct:
                                     aPaperSize.Width() = (long)(nOutHeight / fabs(nSin));
                                 }
-                                else if (eOrient == SVX_ORIENTATION_STANDARD)
+                                else if (eOrient == SvxCellOrientation::Standard)
                                     aPaperSize.Width() = nOutWidth;
                                 else
                                     aPaperSize.Width() = nOutHeight - 1;
@@ -5045,14 +5045,14 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
 
                                     // always do height
                                     ShrinkEditEngine( *pEngine, aAreaParam.maAlignRect, nLeftM, nTopM, nRightM, nBottomM,
-                                        false, sal::static_int_cast<sal_uInt16>(eOrient), nAttrRotate, bPixelToLogic,
+                                        false, eOrient, nAttrRotate, bPixelToLogic,
                                         nEngineWidth, nEngineHeight, nNeededPixel, aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
 
                                     if ( eRotMode == SVX_ROTATE_MODE_STANDARD )
                                     {
                                         // do width only if rotating within the cell (standard mode)
                                         ShrinkEditEngine( *pEngine, aAreaParam.maAlignRect, nLeftM, nTopM, nRightM, nBottomM,
-                                            true, sal::static_int_cast<sal_uInt16>(eOrient), nAttrRotate, bPixelToLogic,
+                                            true, eOrient, nAttrRotate, bPixelToLogic,
                                             nEngineWidth, nEngineHeight, nNeededPixel, aAreaParam.mbLeftClip, aAreaParam.mbRightClip );
                                     }
 
@@ -5116,11 +5116,11 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
                                     aLogicStart = mpRefDevice->PixelToLogic( Point(nStartX,nStartY) );
                                 else
                                     aLogicStart = Point(nStartX, nStartY);
-                                if ( eOrient!=SVX_ORIENTATION_STANDARD || !bBreak )
+                                if ( eOrient!=SvxCellOrientation::Standard || !bBreak )
                                 {
                                     long nAvailWidth = aCellSize.Width();
                                     if (eType==OUTTYPE_WINDOW &&
-                                            eOrient!=SVX_ORIENTATION_STACKED &&
+                                            eOrient!=SvxCellOrientation::Stacked &&
                                             pInfo->bAutoFilter)
                                     {
                                         // filter drop-down width is now independent from row height
@@ -5134,7 +5134,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
 
                                     // horizontal orientation
 
-                                    if (eOrient==SVX_ORIENTATION_STANDARD && !nAttrRotate)
+                                    if (eOrient==SvxCellOrientation::Standard && !nAttrRotate)
                                     {
                                         if (eHorJust==SvxCellHorJustify::Right ||
                                             eHorJust==SvxCellHorJustify::Center)
@@ -5176,8 +5176,8 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
                                         aLogicStart.X() -= nCellWidth;
                                 }
 
-                                if ( eOrient==SVX_ORIENTATION_STANDARD ||
-                                     eOrient==SVX_ORIENTATION_STACKED || !bBreak )
+                                if ( eOrient==SvxCellOrientation::Standard ||
+                                     eOrient==SvxCellOrientation::Stacked || !bBreak )
                                 {
                                     if (eVerJust==SVX_VER_JUSTIFY_BOTTOM ||
                                         eVerJust==SVX_VER_JUSTIFY_STANDARD)
@@ -5204,7 +5204,7 @@ void ScOutputData::DrawRotated(bool bPixelToLogic)
                                 }
 
                                 // TOPBOTTON and BOTTOMTOP are handled in DrawStrings/DrawEdit
-                                OSL_ENSURE( eOrient == SVX_ORIENTATION_STANDARD && nAttrRotate,
+                                OSL_ENSURE( eOrient == SvxCellOrientation::Standard && nAttrRotate,
                                             "DrawRotated: no rotation" );
 
                                 long nOriVal = 0;
diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx
index ca821835452a..dee345f04569 100644
--- a/svx/source/items/algitem.cxx
+++ b/svx/source/items/algitem.cxx
@@ -51,17 +51,17 @@ SvxOrientationItem::SvxOrientationItem( const SvxCellOrientation eOrientation,
 }
 
 SvxOrientationItem::SvxOrientationItem( sal_Int32 nRotation, bool bStacked, const sal_uInt16 nId ) :
-    SfxEnumItem( nId, SvxCellOrientation::SVX_ORIENTATION_STANDARD )
+    SfxEnumItem( nId, SvxCellOrientation::Standard )
 {
     if( bStacked )
     {
-        SetValue( SVX_ORIENTATION_STACKED );
+        SetValue( SvxCellOrientation::Stacked );
     }
     else switch( nRotation )
     {
-        case 9000:  SetValue( SVX_ORIENTATION_BOTTOMTOP );  break;
-        case 27000: SetValue( SVX_ORIENTATION_TOPBOTTOM );  break;
-        default:    SetValue( SVX_ORIENTATION_STANDARD );
+        case 9000:  SetValue( SvxCellOrientation::BottomUp );  break;
+        case 27000: SetValue( SvxCellOrientation::TopBottom );  break;
+        default:    SetValue( SvxCellOrientation::Standard );
     }
 }
 
@@ -71,7 +71,8 @@ bool SvxOrientationItem::GetPresentation
     SfxItemPresentation /*ePres*/,
     MapUnit             /*eCoreUnit*/,
     MapUnit             /*ePresUnit*/,
-    OUString&           rText, const IntlWrapper& ) const
+    OUString&           rText,
+    const IntlWrapper& ) const
 {
     rText = GetValueText( GetValue() );
     return true;
@@ -83,10 +84,10 @@ bool SvxOrientationItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) c
     table::CellOrientation eUno = table::CellOrientation_STANDARD;
     switch ( (SvxCellOrientation)GetValue() )
     {
-    case SVX_ORIENTATION_STANDARD:  eUno = table::CellOrientation_STANDARD;  break;
-    case SVX_ORIENTATION_TOPBOTTOM: eUno = table::CellOrientation_TOPBOTTOM; break;
-    case SVX_ORIENTATION_BOTTOMTOP: eUno = table::CellOrientation_BOTTOMTOP; break;
-    case SVX_ORIENTATION_STACKED:   eUno = table::CellOrientation_STACKED;    break;
+        case SvxCellOrientation::Standard:  eUno = table::CellOrientation_STANDARD;  break;
+        case SvxCellOrientation::TopBottom: eUno = table::CellOrientation_TOPBOTTOM; break;
+        case SvxCellOrientation::BottomUp:  eUno = table::CellOrientation_BOTTOMTOP; break;
+        case SvxCellOrientation::Stacked:   eUno = table::CellOrientation_STACKED;   break;
     }
     rVal <<= eUno;
     return true;
@@ -102,13 +103,13 @@ bool SvxOrientationItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/
             return false;
         eOrient = (table::CellOrientation)nValue;
     }
-    SvxCellOrientation eSvx = SVX_ORIENTATION_STANDARD;
+    SvxCellOrientation eSvx = SvxCellOrientation::Standard;
     switch (eOrient)
     {
-        case table::CellOrientation_STANDARD:   eSvx = SVX_ORIENTATION_STANDARD;  break;
-        case table::CellOrientation_TOPBOTTOM:  eSvx = SVX_ORIENTATION_TOPBOTTOM; break;
-        case table::CellOrientation_BOTTOMTOP:  eSvx = SVX_ORIENTATION_BOTTOMTOP; break;
-        case table::CellOrientation_STACKED:    eSvx = SVX_ORIENTATION_STACKED;   break;
+        case table::CellOrientation_STANDARD:   eSvx = SvxCellOrientation::Standard;  break;
+        case table::CellOrientation_TOPBOTTOM:  eSvx = SvxCellOrientation::TopBottom; break;
+        case table::CellOrientation_BOTTOMTOP:  eSvx = SvxCellOrientation::BottomUp; break;
+        case table::CellOrientation_STACKED:    eSvx = SvxCellOrientation::Stacked;   break;
         default: ; //prevent warning
     }
     SetValue( eSvx );
@@ -116,10 +117,9 @@ bool SvxOrientationItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/
 }
 
 
-OUString SvxOrientationItem::GetValueText( sal_uInt16 nVal )
+OUString SvxOrientationItem::GetValueText( SvxCellOrientation nVal )
 {
-    DBG_ASSERT( nVal <= SVX_ORIENTATION_STACKED, "enum overflow!" );
-    return SvxResId(RID_SVXITEMS_ORI_STANDARD + nVal);
+    return SvxResId(RID_SVXITEMS_ORI_STANDARD + static_cast<int>(nVal));
 }
 
 
@@ -139,13 +139,13 @@ SfxPoolItem* SvxOrientationItem::Create( SvStream& rStream, sal_uInt16 ) const
 
 sal_uInt16 SvxOrientationItem::GetValueCount() const
 {
-    return SVX_ORIENTATION_STACKED + 1; // last enum value + 1
+    return static_cast<sal_uInt16>(SvxCellOrientation::Stacked) + 1; // last enum value + 1
 }
 
 
 bool SvxOrientationItem::IsStacked() const
 {
-    return GetValue() == SVX_ORIENTATION_STACKED;
+    return GetValue() == SvxCellOrientation::Stacked;
 }
 
 sal_Int32 SvxOrientationItem::GetRotation( sal_Int32 nStdAngle ) const
@@ -153,8 +153,8 @@ sal_Int32 SvxOrientationItem::GetRotation( sal_Int32 nStdAngle ) const
     sal_Int32 nAngle = nStdAngle;
     switch( GetValue() )
     {
-        case SVX_ORIENTATION_BOTTOMTOP: nAngle = 9000;break;
-        case SVX_ORIENTATION_TOPBOTTOM: nAngle = 27000;break;
+        case SvxCellOrientation::BottomUp: nAngle = 9000;break;
+        case SvxCellOrientation::TopBottom: nAngle = 27000;break;
         default: ; //prevent warning
     }
     return nAngle;
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index d479b1ea6b1e..a0a8a1ee25bc 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -405,7 +405,7 @@ bool SwBoxAutoFormat::operator==(const SwBoxAutoFormat& rRight)
 bool SwBoxAutoFormat::Load( SvStream& rStream, const SwAfVersions& rVersions, sal_uInt16 nVer )
 {
     SfxPoolItem* pNew;
-    SvxOrientationItem aOrientation( SVX_ORIENTATION_STANDARD, 0);
+    SvxOrientationItem aOrientation( SvxCellOrientation::Standard, 0);
 
     READ( m_aFont,        SvxFontItem            , rVersions.nFontVersion)
 
@@ -578,7 +578,7 @@ bool SwBoxAutoFormat::SaveVersionNo( SvStream& rStream, sal_uInt16 fileVersion )
 
     rStream.WriteUInt16( m_aHorJustify.GetVersion( fileVersion ) );
     rStream.WriteUInt16( m_aVerJustify.GetVersion( fileVersion ) );
-    rStream.WriteUInt16( SvxOrientationItem(SVX_ORIENTATION_STANDARD, 0).GetVersion( fileVersion ) );
+    rStream.WriteUInt16( SvxOrientationItem(SvxCellOrientation::Standard, 0).GetVersion( fileVersion ) );
     rStream.WriteUInt16( m_aMargin.GetVersion( fileVersion ) );
     rStream.WriteUInt16( m_aLinebreak.GetVersion( fileVersion ) );
     rStream.WriteUInt16( m_aRotateAngle.GetVersion( fileVersion ) );


More information about the Libreoffice-commits mailing list