[Libreoffice-commits] core.git: 13 commits - cui/source filter/source include/svx lotuswordpro/source reportdesign/source sc/source sd/source svx/source sw/source xmloff/source

Noel Grandin noel at peralex.com
Thu Aug 18 06:49:38 UTC 2016


 cui/source/dialogs/sdrcelldlg.cxx                     |    2 
 cui/source/inc/cuitabarea.hxx                         |   53 +++++--
 cui/source/inc/cuitabline.hxx                         |   16 +-
 cui/source/inc/labdlg.hxx                             |   14 +-
 cui/source/tabpages/labdlg.cxx                        |   60 ++++----
 cui/source/tabpages/measure.cxx                       |  124 +++++++++---------
 cui/source/tabpages/tabarea.cxx                       |    2 
 cui/source/tabpages/tabline.cxx                       |    2 
 cui/source/tabpages/tparea.cxx                        |   27 ++-
 cui/source/tabpages/tpbitmap.cxx                      |    6 
 cui/source/tabpages/tpcolor.cxx                       |   52 +++----
 cui/source/tabpages/tpgradnt.cxx                      |    6 
 cui/source/tabpages/tphatch.cxx                       |    6 
 cui/source/tabpages/tpline.cxx                        |   21 +--
 cui/source/tabpages/tplnedef.cxx                      |   15 +-
 cui/source/tabpages/tplneend.cxx                      |   11 -
 cui/source/tabpages/tppattern.cxx                     |    6 
 cui/source/tabpages/tpshadow.cxx                      |   10 -
 cui/source/tabpages/tptrans.cxx                       |   10 -
 filter/source/msfilter/msdffimp.cxx                   |    8 -
 include/svx/scene3d.hxx                               |    2 
 include/svx/svx3ditems.hxx                            |    2 
 include/svx/sxcecitm.hxx                              |    4 
 include/svx/sxctitm.hxx                               |    4 
 include/svx/sxekitm.hxx                               |   11 -
 include/svx/sxmtpitm.hxx                              |    8 -
 include/svx/tabarea.hxx                               |   17 --
 include/svx/viewpt3d.hxx                              |    2 
 include/svx/xenum.hxx                                 |    9 -
 include/svx/xftadit.hxx                               |    2 
 include/svx/xftshit.hxx                               |    2 
 include/svx/xmleohlp.hxx                              |    5 
 include/svx/xtextit0.hxx                              |    2 
 lotuswordpro/source/filter/lwpbackgroundstuff.cxx     |    2 
 reportdesign/source/core/api/ReportDefinition.cxx     |    8 -
 sc/source/core/data/postit.cxx                        |    2 
 sc/source/core/tool/detfunc.cxx                       |    2 
 sc/source/filter/excel/xiescher.cxx                   |    2 
 sc/source/filter/xml/xmlwrap.cxx                      |    4 
 sc/source/ui/unoobj/servuno.cxx                       |    4 
 sd/source/filter/xml/sdxmlwrp.cxx                     |    4 
 sd/source/ui/func/fuconrec.cxx                        |    6 
 sd/source/ui/unoidl/unomodel.cxx                      |    4 
 svx/source/customshapes/EnhancedCustomShape3d.cxx     |    4 
 svx/source/dialog/fontwork.cxx                        |   44 +++---
 svx/source/engine3d/float3d.cxx                       |   14 +-
 svx/source/engine3d/scene3d.cxx                       |    2 
 svx/source/engine3d/svx3ditems.cxx                    |    4 
 svx/source/engine3d/viewpt3d2.cxx                     |    2 
 svx/source/sdr/attribute/sdrformtextattribute.cxx     |   10 -
 svx/source/sdr/attribute/sdrtextattribute.cxx         |    2 
 svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx |   18 +-
 svx/source/sdr/properties/e3dsceneproperties.cxx      |    2 
 svx/source/svdraw/svdattr.cxx                         |   20 +-
 svx/source/svdraw/svdhdl.cxx                          |    4 
 svx/source/svdraw/svdibrow.cxx                        |    8 -
 svx/source/svdraw/svdocapt.cxx                        |   34 ++--
 svx/source/svdraw/svdoedge.cxx                        |   22 +--
 svx/source/svdraw/svdomeas.cxx                        |   66 ++++-----
 svx/source/svdraw/svdotext.cxx                        |    2 
 svx/source/svdraw/svdotextpathdecomposition.cxx       |   32 ++--
 svx/source/xml/xmleohlp.cxx                           |   20 +-
 svx/source/xml/xmlexport.cxx                          |    4 
 svx/source/xoutdev/xattrbmp.cxx                       |   12 -
 sw/source/filter/ww8/ww8graf.cxx                      |    4 
 sw/source/filter/xml/swxml.cxx                        |    2 
 sw/source/filter/xml/wrtxml.cxx                       |    2 
 sw/source/filter/xml/xmlexp.cxx                       |    2 
 sw/source/filter/xml/xmlimp.cxx                       |    2 
 sw/source/uibase/uno/unotxdoc.cxx                     |    2 
 xmloff/source/draw/sdpropls.cxx                       |   38 ++---
 71 files changed, 474 insertions(+), 463 deletions(-)

New commits:
commit 6fdfa13a096c55f5038c4a850cfb108d30143d4b
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Aug 18 08:47:59 2016 +0200

    convert SdrCaptionEscDir to scoped enum
    
    Change-Id: Iec6dfbdc65efde86ff24ddc51c48eb697bf4ead1

diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx
index a7e77a7..a7b1064 100644
--- a/cui/source/inc/labdlg.hxx
+++ b/cui/source/inc/labdlg.hxx
@@ -25,6 +25,7 @@
 #include <svtools/valueset.hxx>
 #include <sfx2/tabdlg.hxx>
 #include <svx/sxctitm.hxx>
+#include <svx/sxcecitm.hxx>
 
 
 class SdrView;
@@ -56,12 +57,12 @@ private:
 
     SdrCaptionType      nCaptionType;
     sal_Int32           nGap;
-    short               nEscDir;
-    bool            bEscRel;
+    SdrCaptionEscDir    nEscDir;
+    bool                bEscRel;
     sal_Int32           nEscAbs;
     sal_Int32           nEscRel;
     sal_Int32           nLineLen;
-    bool            bFitLineLen;
+    bool                bFitLineLen;
 
     sal_uInt16          nAnsatzRelPos;
     sal_uInt16          nAnsatzTypePos;
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index 7bd9a2a..1b18c5b 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -74,7 +74,7 @@ SvxCaptionTabPage::SvxCaptionTabPage(vcl::Window* pParent, const SfxItemSet& rIn
     : SfxTabPage(pParent, "CalloutPage", "cui/ui/calloutpage.ui", &rInAttrs)
     , nCaptionType(SdrCaptionType::Type1)
     , nGap(0)
-    , nEscDir(0)
+    , nEscDir(SdrCaptionEscDir::Horizontal)
     , bEscRel(false)
     , nEscAbs(0)
     , nEscRel(0)
@@ -187,12 +187,13 @@ bool SvxCaptionTabPage::FillItemSet( SfxItemSet*  _rOutAttrs)
     {
         switch( nEscDir )
         {
-            case SDRCAPT_ESCHORIZONTAL:     nEscDir=SDRCAPT_ESCVERTICAL;break;
-            case SDRCAPT_ESCVERTICAL:       nEscDir=SDRCAPT_ESCHORIZONTAL;break;
+            case SdrCaptionEscDir::Horizontal:     nEscDir=SdrCaptionEscDir::Vertical;break;
+            case SdrCaptionEscDir::Vertical:       nEscDir=SdrCaptionEscDir::Horizontal;break;
+            default: break;
         }
     }
 
-    _rOutAttrs->Put( SdrCaptionEscDirItem( (SdrCaptionEscDir)nEscDir ) );
+    _rOutAttrs->Put( SdrCaptionEscDirItem( nEscDir ) );
 
     bEscRel = m_pLB_ANSATZ_REL->IsVisible();
     _rOutAttrs->Put( SdrCaptionEscIsRelItem( bEscRel ) );
@@ -287,7 +288,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet*  )
 
     nCaptionType = (SdrCaptionType)static_cast<const SdrCaptionTypeItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue();
     bFitLineLen = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue();
-    nEscDir = (short)static_cast<const SdrCaptionEscDirItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue();
+    nEscDir = static_cast<const SdrCaptionEscDirItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue();
     bEscRel = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCISREL ) ) ).GetValue();
 
     // special treatment!!! XXX
@@ -295,8 +296,9 @@ void SvxCaptionTabPage::Reset( const SfxItemSet*  )
     {
         switch( nEscDir )
         {
-            case SDRCAPT_ESCHORIZONTAL:     nEscDir=SDRCAPT_ESCVERTICAL;break;
-            case SDRCAPT_ESCVERTICAL:       nEscDir=SDRCAPT_ESCHORIZONTAL;break;
+            case SdrCaptionEscDir::Horizontal:     nEscDir=SdrCaptionEscDir::Vertical;break;
+            case SdrCaptionEscDir::Vertical:       nEscDir=SdrCaptionEscDir::Horizontal;break;
+            default: break;
         }
     }
 
@@ -305,7 +307,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet*  )
 
     m_pMF_ABSTAND->SetValue( nGap );
 
-    if( nEscDir == SDRCAPT_ESCHORIZONTAL )
+    if( nEscDir == SdrCaptionEscDir::Horizontal )
     {
         if( bEscRel )
         {
@@ -321,7 +323,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet*  )
             m_pMF_ANSATZ->SetValue( nEscAbs );
         }
     }
-    else if( nEscDir == SDRCAPT_ESCVERTICAL )
+    else if( nEscDir == SdrCaptionEscDir::Vertical )
     {
         if( bEscRel )
         {
@@ -337,7 +339,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet*  )
             m_pMF_ANSATZ->SetValue( nEscAbs );
         }
     }
-    else if( nEscDir == SDRCAPT_ESCBESTFIT )
+    else if( nEscDir == SdrCaptionEscDir::BestFit )
     {
         nAnsatzTypePos = AZ_OPTIMAL;
     }
@@ -369,7 +371,7 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
         m_pFT_UM->Show();
         m_pFT_ANSATZ_REL->Hide();
         m_pLB_ANSATZ_REL->Hide();
-        nEscDir = SDRCAPT_ESCBESTFIT;
+        nEscDir = SdrCaptionEscDir::BestFit;
         break;
 
         case AZ_VON_OBEN:
@@ -377,7 +379,7 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
         m_pFT_UM->Show();
         m_pFT_ANSATZ_REL->Hide();
         m_pLB_ANSATZ_REL->Hide();
-        nEscDir = SDRCAPT_ESCHORIZONTAL;
+        nEscDir = SdrCaptionEscDir::Horizontal;
         break;
 
         case AZ_VON_LINKS:
@@ -385,7 +387,7 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
         m_pFT_UM->Show();
         m_pFT_ANSATZ_REL->Hide();
         m_pLB_ANSATZ_REL->Hide();
-        nEscDir = SDRCAPT_ESCVERTICAL;
+        nEscDir = SdrCaptionEscDir::Vertical;
         break;
 
         case AZ_HORIZONTAL:
@@ -398,7 +400,7 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
         m_pFT_UM->Hide();
         m_pFT_ANSATZ_REL->Show();
         m_pLB_ANSATZ_REL->Show();
-        nEscDir = SDRCAPT_ESCHORIZONTAL;
+        nEscDir = SdrCaptionEscDir::Horizontal;
         break;
 
         case AZ_VERTIKAL:
@@ -411,7 +413,7 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
         m_pFT_UM->Hide();
         m_pFT_ANSATZ_REL->Show();
         m_pLB_ANSATZ_REL->Show();
-        nEscDir = SDRCAPT_ESCVERTICAL;
+        nEscDir = SdrCaptionEscDir::Vertical;
         break;
     }
 }
diff --git a/include/svx/sxcecitm.hxx b/include/svx/sxcecitm.hxx
index 22e6024..ba11540 100644
--- a/include/svx/sxcecitm.hxx
+++ b/include/svx/sxcecitm.hxx
@@ -25,14 +25,14 @@
 #include <svx/sdmetitm.hxx>
 #include <svx/svxdllapi.h>
 
-enum SdrCaptionEscDir {SDRCAPT_ESCHORIZONTAL,SDRCAPT_ESCVERTICAL,SDRCAPT_ESCBESTFIT};
+enum class SdrCaptionEscDir { Horizontal, Vertical, BestFit };
 
 
 // class SdrCaptionEscDirItem
 
 class SVX_DLLPUBLIC SdrCaptionEscDirItem: public SfxEnumItem {
 public:
-    SdrCaptionEscDirItem(SdrCaptionEscDir eDir=SDRCAPT_ESCHORIZONTAL): SfxEnumItem(SDRATTR_CAPTIONESCDIR,sal::static_int_cast< sal_uInt16 >(eDir)) {}
+    SdrCaptionEscDirItem(SdrCaptionEscDir eDir=SdrCaptionEscDir::Horizontal): SfxEnumItem(SDRATTR_CAPTIONESCDIR,sal::static_int_cast< sal_uInt16 >(eDir)) {}
     SdrCaptionEscDirItem(SvStream& rIn)                              : SfxEnumItem(SDRATTR_CAPTIONESCDIR,rIn)  {}
     virtual SfxPoolItem*     Clone(SfxItemPool* pPool=nullptr) const override;
     virtual SfxPoolItem*     Create(SvStream& rIn, sal_uInt16 nVer) const override;
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index d872877..18da0ce 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -118,7 +118,7 @@ void ScCaptionUtil::SetDefaultItems( SdrCaptionObj& rCaption, ScDocument& rDoc )
     aItemSet.Put( XLineStartCenterItem( false ) );
     aItemSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
     aItemSet.Put( XFillColorItem( OUString(), ScDetectiveFunc::GetCommentColor() ) );
-    aItemSet.Put( SdrCaptionEscDirItem( SDRCAPT_ESCBESTFIT ) );
+    aItemSet.Put( SdrCaptionEscDirItem( SdrCaptionEscDir::BestFit ) );
 
     // shadow
     /*  SdrShadowItem has sal_False, instead the shadow is set for the
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 740174e..b4d05d0 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -234,7 +234,7 @@ ScCommentData::ScCommentData( ScDocument& rDoc, SdrModel* pModel ) :
 
     // support the best position for the tail connector now that
     // that notes can be resized and repositioned.
-    aCaptionSet.Put( SdrCaptionEscDirItem( SDRCAPT_ESCBESTFIT) );
+    aCaptionSet.Put( SdrCaptionEscDirItem( SdrCaptionEscDir::BestFit) );
 }
 
 void ScCommentData::UpdateCaptionSet( const SfxItemSet& rItemSet )
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 4ab3e82..4bcb20d 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -84,7 +84,7 @@ public:
         bFixedAngle=false;
         nAngle     =4500;
         nGap       =0;
-        eEscDir    =SDRCAPT_ESCHORIZONTAL;
+        eEscDir    =SdrCaptionEscDir::Horizontal;
         bEscRel    =true;
         nEscRel    =5000;
         nEscAbs    =0;
@@ -111,20 +111,20 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi
     nY+=rRect.Top();
     Point  aBestPt;
     EscDir eBestDir=LKS;
-    bool bTryH=eEscDir==SDRCAPT_ESCBESTFIT;
+    bool bTryH=eEscDir==SdrCaptionEscDir::BestFit;
     if (!bTryH) {
         if (eType!=SdrCaptionType::Type1) {
-            bTryH=eEscDir==SDRCAPT_ESCHORIZONTAL;
+            bTryH=eEscDir==SdrCaptionEscDir::Horizontal;
         } else {
-            bTryH=eEscDir==SDRCAPT_ESCVERTICAL;
+            bTryH=eEscDir==SdrCaptionEscDir::Vertical;
         }
     }
-    bool bTryV=eEscDir==SDRCAPT_ESCBESTFIT;
+    bool bTryV=eEscDir==SdrCaptionEscDir::BestFit;
     if (!bTryV) {
         if (eType!=SdrCaptionType::Type1) {
-            bTryV=eEscDir==SDRCAPT_ESCVERTICAL;
+            bTryV=eEscDir==SdrCaptionEscDir::Vertical;
         } else {
-            bTryV=eEscDir==SDRCAPT_ESCHORIZONTAL;
+            bTryV=eEscDir==SdrCaptionEscDir::Horizontal;
         }
     }
 
@@ -153,7 +153,7 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi
             eBest2=UNT;
             aBest2=aBtm;
         }
-        bool bTakeIt=eEscDir!=SDRCAPT_ESCBESTFIT;
+        bool bTakeIt=eEscDir!=SdrCaptionEscDir::BestFit;
         if (!bTakeIt) {
             BigInt aHorX(aBestPt.X()-aTl.X()); aHorX*=aHorX;
             BigInt aHorY(aBestPt.Y()-aTl.Y()); aHorY*=aHorY;
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 7b6be23..19fcd42 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -714,9 +714,9 @@ static SvXMLEnumMapEntry const pXML_Fontwork_Form_Enum[] =
 
 static SvXMLEnumMapEntry const pXML_Caption_Esc_Dir_Enum[] =
 {
-    { XML_HORIZONTAL,       0 }, //SDRCAPT_ESCHORIZONTAL,
-    { XML_VERTICAL,         1 }, //SDRCAPT_ESCVERTICAL,
-    { XML_AUTO,             2 }, //SDRCAPT_ESCBESTFIT,
+    { XML_HORIZONTAL,       0 }, //SdrCaptionEscDir::Horizontal,
+    { XML_VERTICAL,         1 }, //SdrCaptionEscDir::Vertical,
+    { XML_AUTO,             2 }, //SdrCaptionEscDir::BestFit,
     { XML_TOKEN_INVALID,0 }
 };
 
commit 55b74b454f4fceccfc05406b44919a5276e0b3ae
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Aug 17 16:14:05 2016 +0200

    convert SdrCaptionType to scoped enum
    
    Change-Id: I5c1a2300ec6b3d9dc3085affa08cc544f46b27d6

diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx
index bf9876b..a7e77a7 100644
--- a/cui/source/inc/labdlg.hxx
+++ b/cui/source/inc/labdlg.hxx
@@ -24,6 +24,9 @@
 #include <vcl/fixed.hxx>
 #include <svtools/valueset.hxx>
 #include <sfx2/tabdlg.hxx>
+#include <svx/sxctitm.hxx>
+
+
 class SdrView;
 
 // class SvxCaptionTabPage -----------------------------------------------
@@ -51,7 +54,7 @@ private:
     std::vector<OUString> m_aStrVertList;
     std::vector<OUString> m_aLineTypes;
 
-    short               nCaptionType;
+    SdrCaptionType      nCaptionType;
     sal_Int32           nGap;
     short               nEscDir;
     bool            bEscRel;
@@ -64,7 +67,7 @@ private:
     sal_uInt16          nAnsatzTypePos;
 
     void            SetupAnsatz_Impl( sal_uInt16 nType );
-    void            SetupType_Impl( sal_uInt16 nType );
+    void            SetupType_Impl( SdrCaptionType nType );
     DECL_LINK_TYPED( AnsatzSelectHdl_Impl, ListBox&, void );
     DECL_LINK_TYPED( AnsatzRelSelectHdl_Impl, ListBox&, void );
     DECL_LINK_TYPED( LineOptHdl_Impl, Button *, void );
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index e99c26b..7bd9a2a 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -72,7 +72,7 @@ const sal_uInt16 SvxCaptionTabPage::pCaptionRanges[] =
 
 SvxCaptionTabPage::SvxCaptionTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs)
     : SfxTabPage(pParent, "CalloutPage", "cui/ui/calloutpage.ui", &rInAttrs)
-    , nCaptionType(0)
+    , nCaptionType(SdrCaptionType::Type1)
     , nGap(0)
     , nEscDir(0)
     , bEscRel(false)
@@ -172,7 +172,7 @@ bool SvxCaptionTabPage::FillItemSet( SfxItemSet*  _rOutAttrs)
 
     SfxMapUnit      eUnit;
 
-    nCaptionType = m_pCT_CAPTTYPE->GetSelectItemId()-1;
+    nCaptionType = (SdrCaptionType) (m_pCT_CAPTTYPE->GetSelectItemId()-1);
 
     _rOutAttrs->Put( SdrCaptionTypeItem( (SdrCaptionType) nCaptionType ) );
 
@@ -183,7 +183,7 @@ bool SvxCaptionTabPage::FillItemSet( SfxItemSet*  _rOutAttrs)
     }
 
     // special treatment!!! XXX
-    if( nCaptionType==SDRCAPT_TYPE1 )
+    if( nCaptionType==SdrCaptionType::Type1 )
     {
         switch( nEscDir )
         {
@@ -285,13 +285,13 @@ void SvxCaptionTabPage::Reset( const SfxItemSet*  )
     SetMetricValue( *m_pMF_ABSTAND, nGap, eUnit );
     nGap = static_cast<long>(m_pMF_ABSTAND->GetValue());
 
-    nCaptionType = (short)static_cast<const SdrCaptionTypeItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue();
+    nCaptionType = (SdrCaptionType)static_cast<const SdrCaptionTypeItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue();
     bFitLineLen = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue();
     nEscDir = (short)static_cast<const SdrCaptionEscDirItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue();
     bEscRel = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCISREL ) ) ).GetValue();
 
     // special treatment!!! XXX
-    if( nCaptionType==SDRCAPT_TYPE1 )
+    if( nCaptionType==SdrCaptionType::Type1 )
     {
         switch( nEscDir )
         {
@@ -348,8 +348,8 @@ void SvxCaptionTabPage::Reset( const SfxItemSet*  )
     m_pLB_ANSATZ->SelectEntryPos( nAnsatzTypePos );
 
     SetupAnsatz_Impl( nAnsatzTypePos );
-    m_pCT_CAPTTYPE->SelectItem( nCaptionType+1 ); // Enum starts at 0!
-    SetupType_Impl( nCaptionType+1 );
+    m_pCT_CAPTTYPE->SelectItem( (int)nCaptionType+1 ); // Enum starts at 0!
+    SetupType_Impl( nCaptionType );
 }
 
 
@@ -453,32 +453,32 @@ IMPL_LINK_TYPED( SvxCaptionTabPage, LineOptHdl_Impl, Button *, pButton, void )
 
 IMPL_LINK_NOARG_TYPED(SvxCaptionTabPage, SelectCaptTypeHdl_Impl, ValueSet*, void)
 {
-    SetupType_Impl( m_pCT_CAPTTYPE->GetSelectItemId() );
+    SetupType_Impl( (SdrCaptionType) m_pCT_CAPTTYPE->GetSelectItemId() );
 }
 
-void SvxCaptionTabPage::SetupType_Impl( sal_uInt16 nType )
+void SvxCaptionTabPage::SetupType_Impl( SdrCaptionType nType )
 {
-    switch( nType-1 )
+    switch( nType )
     {
-        case SDRCAPT_TYPE1:
+        case SdrCaptionType::Type1:
         m_pFT_LAENGE->Disable();
         m_pCB_LAENGE->Disable();
         LineOptHdl_Impl( m_pCB_LAENGE );
         break;
 
-        case SDRCAPT_TYPE2:
+        case SdrCaptionType::Type2:
         m_pFT_LAENGE->Disable();
         m_pCB_LAENGE->Disable();
         LineOptHdl_Impl( m_pCB_LAENGE );
         break;
 
-        case SDRCAPT_TYPE3:
+        case SdrCaptionType::Type3:
         m_pFT_LAENGE->Enable();
         m_pCB_LAENGE->Enable();
         LineOptHdl_Impl( m_pCB_LAENGE );
         break;
 
-        case SDRCAPT_TYPE4:
+        case SdrCaptionType::Type4:
         m_pFT_LAENGE->Enable();
         m_pCB_LAENGE->Enable();
         LineOptHdl_Impl( m_pCB_LAENGE );
diff --git a/include/svx/sxctitm.hxx b/include/svx/sxctitm.hxx
index 223ac93..13cf407 100644
--- a/include/svx/sxctitm.hxx
+++ b/include/svx/sxctitm.hxx
@@ -23,14 +23,14 @@
 #include <svx/svddef.hxx>
 #include <svx/svxdllapi.h>
 
-enum SdrCaptionType   {SDRCAPT_TYPE1,SDRCAPT_TYPE2,SDRCAPT_TYPE3,SDRCAPT_TYPE4};
+enum class SdrCaptionType { Type1, Type2, Type3, Type4 };
 
 
 // class SdrCaptionTypeItem
 
 class SVX_DLLPUBLIC SdrCaptionTypeItem: public SfxEnumItem {
 public:
-    SdrCaptionTypeItem(SdrCaptionType eStyle=SDRCAPT_TYPE3): SfxEnumItem(SDRATTR_CAPTIONTYPE,sal::static_int_cast< sal_uInt16 >(eStyle)) {}
+    SdrCaptionTypeItem(SdrCaptionType eStyle=SdrCaptionType::Type3): SfxEnumItem(SDRATTR_CAPTIONTYPE,sal::static_int_cast< sal_uInt16 >(eStyle)) {}
     SdrCaptionTypeItem(SvStream& rIn)                      : SfxEnumItem(SDRATTR_CAPTIONTYPE,rIn)    {}
     virtual SfxPoolItem*    Clone(SfxItemPool* pPool=nullptr) const override;
     virtual SfxPoolItem*    Create(SvStream& rIn, sal_uInt16 nVer) const override;
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index c47647b..4ab3e82 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -80,7 +80,7 @@ public:
 public:
     ImpCaptParams()
     {
-        eType      =SDRCAPT_TYPE3;
+        eType      =SdrCaptionType::Type3;
         bFixedAngle=false;
         nAngle     =4500;
         nGap       =0;
@@ -113,7 +113,7 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi
     EscDir eBestDir=LKS;
     bool bTryH=eEscDir==SDRCAPT_ESCBESTFIT;
     if (!bTryH) {
-        if (eType!=SDRCAPT_TYPE1) {
+        if (eType!=SdrCaptionType::Type1) {
             bTryH=eEscDir==SDRCAPT_ESCHORIZONTAL;
         } else {
             bTryH=eEscDir==SDRCAPT_ESCVERTICAL;
@@ -121,7 +121,7 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi
     }
     bool bTryV=eEscDir==SDRCAPT_ESCBESTFIT;
     if (!bTryV) {
-        if (eType!=SDRCAPT_TYPE1) {
+        if (eType!=SdrCaptionType::Type1) {
             bTryV=eEscDir==SDRCAPT_ESCVERTICAL;
         } else {
             bTryV=eEscDir==SDRCAPT_ESCHORIZONTAL;
@@ -159,7 +159,7 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi
             BigInt aHorY(aBestPt.Y()-aTl.Y()); aHorY*=aHorY;
             BigInt aVerX(aBest2.X()-aTl.X());  aVerX*=aVerX;
             BigInt aVerY(aBest2.Y()-aTl.Y());  aVerY*=aVerY;
-            if (eType!=SDRCAPT_TYPE1) {
+            if (eType!=SdrCaptionType::Type1) {
                 bTakeIt=aVerX+aVerY<aHorX+aHorY;
             } else {
                 bTakeIt=aVerX+aVerY>=aHorX+aHorY;
@@ -446,7 +446,7 @@ void SdrCaptionObj::ImpRecalcTail()
 // twice or SetSnapRect after it again just to work around this.
 // Changed this method to not do that.
 // Also found why this has been done: For interactive dragging of the
-// tail end pos for SDRCAPT_TYPE1. This sure was the simplest method
+// tail end pos for SdrCaptionType::Type1. This sure was the simplest method
 // to achieve this, at the cost of making a whole group of const methods
 // of this object implicitly change the object's position.
 void SdrCaptionObj::ImpCalcTail1(const ImpCaptParams& rPara, tools::Polygon& rPoly, Rectangle& rRect) const
@@ -533,10 +533,10 @@ void SdrCaptionObj::ImpCalcTail4(const ImpCaptParams& rPara, tools::Polygon& rPo
 void SdrCaptionObj::ImpCalcTail(const ImpCaptParams& rPara, tools::Polygon& rPoly, Rectangle& rRect) const
 {
     switch (rPara.eType) {
-        case SDRCAPT_TYPE1: ImpCalcTail1(rPara,rPoly,rRect); break;
-        case SDRCAPT_TYPE2: ImpCalcTail2(rPara,rPoly,rRect); break;
-        case SDRCAPT_TYPE3: ImpCalcTail3(rPara,rPoly,rRect); break;
-        case SDRCAPT_TYPE4: ImpCalcTail4(rPara,rPoly,rRect); break;
+        case SdrCaptionType::Type1: ImpCalcTail1(rPara,rPoly,rRect); break;
+        case SdrCaptionType::Type2: ImpCalcTail2(rPara,rPoly,rRect); break;
+        case SdrCaptionType::Type3: ImpCalcTail3(rPara,rPoly,rRect); break;
+        case SdrCaptionType::Type4: ImpCalcTail4(rPara,rPoly,rRect); break;
     }
 }
 
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index d40b34b..eeee97d 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1237,8 +1237,8 @@ SdrObject* SwWW8ImplReader::ReadTextBox(WW8_DPHEAD* pHd, SfxAllItemSet &rSet)
 
 SdrObject* SwWW8ImplReader::ReadCaptionBox(WW8_DPHEAD* pHd, SfxAllItemSet &rSet)
 {
-    static const SdrCaptionType aCaptA[] = { SDRCAPT_TYPE1, SDRCAPT_TYPE2,
-                                       SDRCAPT_TYPE3, SDRCAPT_TYPE4 };
+    static const SdrCaptionType aCaptA[] = { SdrCaptionType::Type1, SdrCaptionType::Type2,
+                                       SdrCaptionType::Type3, SdrCaptionType::Type4 };
 
     WW8_DP_CALLOUT_TXTBOX aCallB;
 
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index adc4e42..7b6be23 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -722,9 +722,9 @@ static SvXMLEnumMapEntry const pXML_Caption_Esc_Dir_Enum[] =
 
 static SvXMLEnumMapEntry const pXML_Caption_Type_Enum[] =
 {
-    { XML_STRAIGHT_LINE,            0 }, //SDRCAPT_TYPE1,
-    { XML_ANGLED_LINE,              1 }, //SDRCAPT_TYPE2,
-    { XML_ANGLED_CONNECTOR_LINE,    2 }, //SDRCAPT_TYPE3,
+    { XML_STRAIGHT_LINE,            0 }, //SdrCaptionType::Type1,
+    { XML_ANGLED_LINE,              1 }, //SdrCaptionType::Type2,
+    { XML_ANGLED_CONNECTOR_LINE,    2 }, //SdrCaptionType::Type3,
     { XML_TOKEN_INVALID,0 }
 };
 
commit 1cd85a60e3e24aa37015e57581bc2f1e20950f30
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Aug 17 15:49:11 2016 +0200

    convert SdrEdgeKind to scoped enum
    
    Change-Id: Icadffb10750f8792ebd88c4f33f272fe565a3c7a

diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index d4596a0..cc75a92 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4741,15 +4741,15 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
                         {
                             case mso_cxstyleBent:
                             {
-                                aSet.Put( SdrEdgeKindItem( SDREDGE_ORTHOLINES ) );
+                                aSet.Put( SdrEdgeKindItem( SdrEdgeKind::OrthoLines ) );
                                 n1HorzDist = n1VertDist = n2HorzDist = n2VertDist = 630;
                             }
                             break;
                             case mso_cxstyleCurved:
-                                aSet.Put( SdrEdgeKindItem( SDREDGE_BEZIER ) );
+                                aSet.Put( SdrEdgeKindItem( SdrEdgeKind::Bezier ) );
                             break;
                             default: // mso_cxstyleStraight || mso_cxstyleNone
-                                aSet.Put( SdrEdgeKindItem( SDREDGE_ONELINE ) );
+                                aSet.Put( SdrEdgeKindItem( SdrEdgeKind::OneLine ) );
                             break;
                         }
                         aSet.Put( SdrEdgeNode1HorzDistItem( n1HorzDist ) );
diff --git a/include/svx/sxekitm.hxx b/include/svx/sxekitm.hxx
index a87ee4d..feeaffc 100644
--- a/include/svx/sxekitm.hxx
+++ b/include/svx/sxekitm.hxx
@@ -23,18 +23,17 @@
 #include <svx/svddef.hxx>
 #include <svx/svxdllapi.h>
 
-enum SdrEdgeKind {SDREDGE_ORTHOLINES,
-                  SDREDGE_THREELINES,
-                  SDREDGE_ONELINE,
-                  SDREDGE_BEZIER,
-                  SDREDGE_ARC};
+enum class SdrEdgeKind
+{
+    OrthoLines, ThreeLines, OneLine, Bezier, Arc
+};
 
 
 // class SdrEdgeKindItem
 
 class SVX_DLLPUBLIC SdrEdgeKindItem: public SfxEnumItem {
 public:
-    SdrEdgeKindItem(SdrEdgeKind eStyle=SDREDGE_ORTHOLINES): SfxEnumItem(SDRATTR_EDGEKIND,sal::static_int_cast< sal_uInt16 >(eStyle)) {}
+    SdrEdgeKindItem(SdrEdgeKind eStyle=SdrEdgeKind::OrthoLines): SfxEnumItem(SDRATTR_EDGEKIND,sal::static_int_cast< sal_uInt16 >(eStyle)) {}
     SdrEdgeKindItem(SvStream& rIn)                        : SfxEnumItem(SDRATTR_EDGEKIND,rIn)    {}
     virtual SfxPoolItem* Clone(SfxItemPool* pPool=nullptr) const override;
     virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const override;
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index 74be18f..8fd4ddf 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -427,7 +427,7 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj)
              nSlotId == SID_CONNECTOR_LINE_CIRCLES)
     {
         // direct connector
-        rAttr.Put(SdrEdgeKindItem(SDREDGE_ONELINE));
+        rAttr.Put(SdrEdgeKindItem(SdrEdgeKind::OneLine));
     }
     else if (nSlotId == SID_CONNECTOR_LINES              ||
              nSlotId == SID_CONNECTOR_LINES_ARROW_START  ||
@@ -438,7 +438,7 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj)
              nSlotId == SID_CONNECTOR_LINES_CIRCLES)
     {
         // line connector
-        rAttr.Put(SdrEdgeKindItem(SDREDGE_THREELINES));
+        rAttr.Put(SdrEdgeKindItem(SdrEdgeKind::ThreeLines));
     }
     else if (nSlotId == SID_CONNECTOR_CURVE              ||
              nSlotId == SID_CONNECTOR_CURVE_ARROW_START  ||
@@ -449,7 +449,7 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj)
              nSlotId == SID_CONNECTOR_CURVE_CIRCLES)
     {
         // curve connector
-        rAttr.Put(SdrEdgeKindItem(SDREDGE_BEZIER));
+        rAttr.Put(SdrEdgeKindItem(SdrEdgeKind::Bezier));
     }
     else if ( nSlotId == SID_DRAW_CAPTION || nSlotId == SID_DRAW_CAPTION_VERTICAL )
     {
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 31d09dd..56b9408 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -1587,11 +1587,11 @@ bool SdrEdgeKindItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/) const
 
     switch( GetValue() )
     {
-        case SDREDGE_ORTHOLINES :   eCT = drawing::ConnectorType_STANDARD; break;
-        case SDREDGE_THREELINES :   eCT = drawing::ConnectorType_LINES; break;
-        case SDREDGE_ONELINE :      eCT = drawing::ConnectorType_LINE;  break;
-        case SDREDGE_BEZIER :       eCT = drawing::ConnectorType_CURVE; break;
-        case SDREDGE_ARC :          eCT = drawing::ConnectorType_CURVE; break;
+        case SdrEdgeKind::OrthoLines :   eCT = drawing::ConnectorType_STANDARD; break;
+        case SdrEdgeKind::ThreeLines :   eCT = drawing::ConnectorType_LINES; break;
+        case SdrEdgeKind::OneLine :      eCT = drawing::ConnectorType_LINE;  break;
+        case SdrEdgeKind::Bezier :       eCT = drawing::ConnectorType_CURVE; break;
+        case SdrEdgeKind::Arc :          eCT = drawing::ConnectorType_CURVE; break;
         default:
             OSL_FAIL( "SdrEdgeKindItem::QueryValue : unknown enum" );
     }
@@ -1613,13 +1613,13 @@ bool SdrEdgeKindItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/)
         eCT = (drawing::ConnectorType)nEnum;
     }
 
-    SdrEdgeKind eEK = SDREDGE_ORTHOLINES;
+    SdrEdgeKind eEK = SdrEdgeKind::OrthoLines;
     switch( eCT )
     {
-        case drawing::ConnectorType_STANDARD :  eEK = SDREDGE_ORTHOLINES;   break;
-        case drawing::ConnectorType_CURVE :     eEK = SDREDGE_BEZIER;       break;
-        case drawing::ConnectorType_LINE :       eEK = SDREDGE_ONELINE;     break;
-        case drawing::ConnectorType_LINES :      eEK = SDREDGE_THREELINES;   break;
+        case drawing::ConnectorType_STANDARD :  eEK = SdrEdgeKind::OrthoLines;   break;
+        case drawing::ConnectorType_CURVE :     eEK = SdrEdgeKind::Bezier;       break;
+        case drawing::ConnectorType_LINE :       eEK = SdrEdgeKind::OneLine;     break;
+        case drawing::ConnectorType_LINES :      eEK = SdrEdgeKind::ThreeLines;   break;
         default:
             OSL_FAIL( "SdrEdgeKindItem::PuValue : unknown enum" );
     }
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index ba06645..8ae34b4 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1571,11 +1571,11 @@ bool ImpEdgeHdl::IsHorzDrag() const
     SdrEdgeKind eEdgeKind = static_cast<const SdrEdgeKindItem&>(pEdge->GetObjectItem(SDRATTR_EDGEKIND)).GetValue();
 
     const SdrEdgeInfoRec& rInfo=pEdge->aEdgeInfo;
-    if (eEdgeKind==SDREDGE_ORTHOLINES || eEdgeKind==SDREDGE_BEZIER)
+    if (eEdgeKind==SdrEdgeKind::OrthoLines || eEdgeKind==SdrEdgeKind::Bezier)
     {
         return !rInfo.ImpIsHorzLine(eLineCode,*pEdge->pEdgeTrack);
     }
-    else if (eEdgeKind==SDREDGE_THREELINES)
+    else if (eEdgeKind==SdrEdgeKind::ThreeLines)
     {
         long nAngle=nObjHdlNum==2 ? rInfo.nAngle1 : rInfo.nAngle2;
         if (nAngle==0 || nAngle==18000)
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx
index 37d8fe1..679b40d 100644
--- a/svx/source/svdraw/svdibrow.cxx
+++ b/svx/source/svdraw/svdibrow.cxx
@@ -824,11 +824,11 @@ bool IsItemIneffective(sal_uInt16 nWhich, const SfxItemSet* pSet, sal_uInt16& rI
         case SDRATTR_EDGELINE3DELTA: {
             if (ImpGetItem(*pSet,SDRATTR_EDGEKIND,pItem)) {
                 SdrEdgeKind eKind=static_cast<const SdrEdgeKindItem*>(pItem)->GetValue();
-                if (eKind==SDREDGE_THREELINES) {
+                if (eKind==SdrEdgeKind::ThreeLines) {
                     if (nWhich>SDRATTR_EDGELINE2DELTA) return true;
                     else return false;
                 }
-                if (eKind!=SDREDGE_ORTHOLINES && eKind!=SDREDGE_BEZIER) return true;
+                if (eKind!=SdrEdgeKind::OrthoLines && eKind!=SdrEdgeKind::Bezier) return true;
             }
             if (ImpGetItem(*pSet,SDRATTR_EDGELINEDELTAANZ,pItem)) {
                 sal_uInt16 nCount=static_cast<const SdrEdgeLineDeltaCountItem*>(pItem)->GetValue();
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index f71180c..14b57e3 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -190,7 +190,7 @@ void SdrEdgeObj::ImpSetAttrToEdgeInfo()
     sal_Int32 nVal2 = static_cast<const SdrMetricItem&>(rSet.Get(SDRATTR_EDGELINE2DELTA)).GetValue();
     sal_Int32 nVal3 = static_cast<const SdrMetricItem&>(rSet.Get(SDRATTR_EDGELINE3DELTA)).GetValue();
 
-    if(eKind == SDREDGE_ORTHOLINES || eKind == SDREDGE_BEZIER)
+    if(eKind == SdrEdgeKind::OrthoLines || eKind == SdrEdgeKind::Bezier)
     {
         sal_Int32 nVals[3] = { nVal1, nVal2, nVal3 };
         sal_uInt16 n = 0;
@@ -225,7 +225,7 @@ void SdrEdgeObj::ImpSetAttrToEdgeInfo()
             n++;
         }
     }
-    else if(eKind == SDREDGE_THREELINES)
+    else if(eKind == SdrEdgeKind::ThreeLines)
     {
         bool bHor1 = aEdgeInfo.nAngle1 == 0 || aEdgeInfo.nAngle1 == 18000;
         bool bHor2 = aEdgeInfo.nAngle2 == 0 || aEdgeInfo.nAngle2 == 18000;
@@ -263,7 +263,7 @@ void SdrEdgeObj::ImpSetEdgeInfoToAttr()
     sal_Int32 nVals[3] = { nVal1, nVal2, nVal3 };
     sal_uInt16 n = 0;
 
-    if(eKind == SDREDGE_ORTHOLINES || eKind == SDREDGE_BEZIER)
+    if(eKind == SdrEdgeKind::OrthoLines || eKind == SdrEdgeKind::Bezier)
     {
         if(aEdgeInfo.nObj1Lines >= 2 && n < 3)
         {
@@ -295,7 +295,7 @@ void SdrEdgeObj::ImpSetEdgeInfoToAttr()
             n++;
         }
     }
-    else if(eKind == SDREDGE_THREELINES)
+    else if(eKind == SdrEdgeKind::ThreeLines)
     {
         bool bHor1 = aEdgeInfo.nAngle1 == 0 || aEdgeInfo.nAngle1 == 18000;
         bool bHor2 = aEdgeInfo.nAngle2 == 0 || aEdgeInfo.nAngle2 == 18000;
@@ -845,7 +845,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
     Rectangle aBewareRect1(rBewareRect1);
     Rectangle aBewareRect2(rBewareRect2);
     Point aMeeting((aPt1.X()+aPt2.X()+1)/2,(aPt1.Y()+aPt2.Y()+1)/2);
-    if (eKind==SDREDGE_ONELINE) {
+    if (eKind==SdrEdgeKind::OneLine) {
         XPolygon aXP(2);
         aXP[0]=rPt1;
         aXP[1]=rPt2;
@@ -853,7 +853,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
             *pnQuality=std::abs(rPt1.X()-rPt2.X())+std::abs(rPt1.Y()-rPt2.Y());
         }
         return aXP;
-    } else if (eKind==SDREDGE_THREELINES) {
+    } else if (eKind==SdrEdgeKind::ThreeLines) {
         XPolygon aXP(4);
         aXP[0]=rPt1;
         aXP[1]=rPt1;
@@ -1448,7 +1448,7 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec
         }
     }
     // make the connector a bezier curve, if appropriate
-    if (eKind==SDREDGE_BEZIER && nPointCount>2) {
+    if (eKind==SdrEdgeKind::Bezier && nPointCount>2) {
         Point* pPt1=&aXP1[0];
         Point* pPt2=&aXP1[1];
         Point* pPt3=&aXP1[nPointCount-2];
@@ -1718,14 +1718,14 @@ sal_uInt32 SdrEdgeObj::GetHdlCount() const
     {
         nHdlAnz = 2;
 
-        if ((eKind==SDREDGE_ORTHOLINES || eKind==SDREDGE_BEZIER) && nPointCount >= 4)
+        if ((eKind==SdrEdgeKind::OrthoLines || eKind==SdrEdgeKind::Bezier) && nPointCount >= 4)
         {
             sal_uInt32 nO1(aEdgeInfo.nObj1Lines > 0 ? aEdgeInfo.nObj1Lines - 1 : 0);
             sal_uInt32 nO2(aEdgeInfo.nObj2Lines > 0 ? aEdgeInfo.nObj2Lines - 1 : 0);
             sal_uInt32 nM(aEdgeInfo.nMiddleLine != 0xFFFF ? 1 : 0);
             nHdlAnz += nO1 + nO2 + nM;
         }
-        else if (eKind==SDREDGE_THREELINES && nPointCount == 4)
+        else if (eKind==SdrEdgeKind::ThreeLines && nPointCount == 4)
         {
             if(GetConnectedNode(true))
                 nHdlAnz++;
@@ -1751,7 +1751,7 @@ SdrHdl* SdrEdgeObj::GetHdl(sal_uInt32 nHdlNum) const
             if (aCon2.pObj!=nullptr && aCon2.bBestVertex) pHdl->Set1PixMore();
         } else {
             SdrEdgeKind eKind=static_cast<const SdrEdgeKindItem&>(GetObjectItem(SDRATTR_EDGEKIND)).GetValue();
-            if (eKind==SDREDGE_ORTHOLINES || eKind==SDREDGE_BEZIER) {
+            if (eKind==SdrEdgeKind::OrthoLines || eKind==SdrEdgeKind::Bezier) {
                 sal_uInt32 nO1(aEdgeInfo.nObj1Lines > 0 ? aEdgeInfo.nObj1Lines - 1 : 0);
                 sal_uInt32 nO2(aEdgeInfo.nObj2Lines > 0 ? aEdgeInfo.nObj2Lines - 1 : 0);
                 sal_uInt32 nM(aEdgeInfo.nMiddleLine != 0xFFFF ? 1 : 0);
@@ -1786,7 +1786,7 @@ SdrHdl* SdrEdgeObj::GetHdl(sal_uInt32 nHdlNum) const
                     delete pHdl;
                     pHdl=nullptr;
                 }
-            } else if (eKind==SDREDGE_THREELINES) {
+            } else if (eKind==SdrEdgeKind::ThreeLines) {
                 sal_uInt32 nNum(nHdlNum);
                 if (GetConnectedNode(true)==nullptr) nNum++;
                 Point aPos((*pEdgeTrack)[(sal_uInt16)nNum-1]);
commit b6471fa5150fca08db9f770aaa7a32c0ae5a5c46
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Aug 17 15:39:18 2016 +0200

    convert SdrMeasureTextHPos to scoped enum
    
    Change-Id: I27dccc90565b9e3fb14e88581a181c421caee56b

diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index 4585938..4cfe577 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -355,37 +355,37 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                 case SdrMeasureTextVPos::Above:
                     switch( eHPos )
                     {
-                    case SDRMEASURE_TEXTLEFTOUTSIDE:    eRP = RP_LT; break;
-                    case SDRMEASURE_TEXTINSIDE:         eRP = RP_MT; break;
-                    case SDRMEASURE_TEXTRIGHTOUTSIDE:   eRP = RP_RT; break;
-                    case SDRMEASURE_TEXTHAUTO:          eRP = RP_MT; break;
+                    case SdrMeasureTextHPos::LeftOutside:    eRP = RP_LT; break;
+                    case SdrMeasureTextHPos::Inside:         eRP = RP_MT; break;
+                    case SdrMeasureTextHPos::RightOutside:   eRP = RP_RT; break;
+                    case SdrMeasureTextHPos::Auto:          eRP = RP_MT; break;
                     }
                     break;
                 case SdrMeasureTextVPos::VerticalCentered:
                     switch( eHPos )
                     {
-                    case SDRMEASURE_TEXTLEFTOUTSIDE:    eRP = RP_LM; break;
-                    case SDRMEASURE_TEXTINSIDE:         eRP = RP_MM; break;
-                    case SDRMEASURE_TEXTRIGHTOUTSIDE:   eRP = RP_RM; break;
-                    case SDRMEASURE_TEXTHAUTO:          eRP = RP_MM; break;
+                    case SdrMeasureTextHPos::LeftOutside:    eRP = RP_LM; break;
+                    case SdrMeasureTextHPos::Inside:         eRP = RP_MM; break;
+                    case SdrMeasureTextHPos::RightOutside:   eRP = RP_RM; break;
+                    case SdrMeasureTextHPos::Auto:          eRP = RP_MM; break;
                     }
                     break;
                 case SdrMeasureTextVPos::Below:
                     switch( eHPos )
                     {
-                    case SDRMEASURE_TEXTLEFTOUTSIDE:    eRP = RP_LB; break;
-                    case SDRMEASURE_TEXTINSIDE:         eRP = RP_MB; break;
-                    case SDRMEASURE_TEXTRIGHTOUTSIDE:   eRP = RP_RB; break;
-                    case SDRMEASURE_TEXTHAUTO:          eRP = RP_MB; break;
+                    case SdrMeasureTextHPos::LeftOutside:    eRP = RP_LB; break;
+                    case SdrMeasureTextHPos::Inside:         eRP = RP_MB; break;
+                    case SdrMeasureTextHPos::RightOutside:   eRP = RP_RB; break;
+                    case SdrMeasureTextHPos::Auto:          eRP = RP_MB; break;
                     }
                     break;
                 case SdrMeasureTextVPos::Auto:
                     switch( eHPos )
                     {
-                    case SDRMEASURE_TEXTLEFTOUTSIDE:    eRP = RP_LM; break;
-                    case SDRMEASURE_TEXTINSIDE:         eRP = RP_MM; break;
-                    case SDRMEASURE_TEXTRIGHTOUTSIDE:   eRP = RP_RM; break;
-                    case SDRMEASURE_TEXTHAUTO:          eRP = RP_MM; break;
+                    case SdrMeasureTextHPos::LeftOutside:    eRP = RP_LM; break;
+                    case SdrMeasureTextHPos::Inside:         eRP = RP_MM; break;
+                    case SdrMeasureTextHPos::RightOutside:   eRP = RP_RM; break;
+                    case SdrMeasureTextHPos::Auto:          eRP = RP_MM; break;
                     }
                     break;
                  default: ;//prevent warning
@@ -393,7 +393,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
 
                 CTL_STATE nState = CTL_STATE::NONE;
 
-                if( eHPos == SDRMEASURE_TEXTHAUTO )
+                if( eHPos == SdrMeasureTextHPos::Auto )
                 {
                     m_pTsbAutoPosH->SetState( TRISTATE_TRUE );
                     nState = CTL_STATE::NOHORZ;
@@ -526,26 +526,26 @@ bool SvxMeasurePage::FillItemSet( SfxItemSet* rAttrs)
         {
             default:
             case RP_LT: eVPos = SdrMeasureTextVPos::Above;
-                        eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
+                        eHPos = SdrMeasureTextHPos::LeftOutside; break;
             case RP_LM: eVPos = SdrMeasureTextVPos::VerticalCentered;
-                        eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
+                        eHPos = SdrMeasureTextHPos::LeftOutside; break;
             case RP_LB: eVPos = SdrMeasureTextVPos::Below;
-                        eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
+                        eHPos = SdrMeasureTextHPos::LeftOutside; break;
             case RP_MT: eVPos = SdrMeasureTextVPos::Above;
-                        eHPos = SDRMEASURE_TEXTINSIDE; break;
+                        eHPos = SdrMeasureTextHPos::Inside; break;
             case RP_MM: eVPos = SdrMeasureTextVPos::VerticalCentered;
-                        eHPos = SDRMEASURE_TEXTINSIDE; break;
+                        eHPos = SdrMeasureTextHPos::Inside; break;
             case RP_MB: eVPos = SdrMeasureTextVPos::Below;
-                        eHPos = SDRMEASURE_TEXTINSIDE; break;
+                        eHPos = SdrMeasureTextHPos::Inside; break;
             case RP_RT: eVPos = SdrMeasureTextVPos::Above;
-                        eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
+                        eHPos = SdrMeasureTextHPos::RightOutside; break;
             case RP_RM: eVPos = SdrMeasureTextVPos::VerticalCentered;
-                        eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
+                        eHPos = SdrMeasureTextHPos::RightOutside; break;
             case RP_RB: eVPos = SdrMeasureTextVPos::Below;
-                        eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
+                        eHPos = SdrMeasureTextHPos::RightOutside; break;
         }
         if( m_pTsbAutoPosH->GetState() == TRISTATE_TRUE )
-            eHPos = SDRMEASURE_TEXTHAUTO;
+            eHPos = SdrMeasureTextHPos::Auto;
 
         if( m_pTsbAutoPosV->GetState() == TRISTATE_TRUE )
             eVPos = SdrMeasureTextVPos::Auto;
@@ -755,30 +755,30 @@ void SvxMeasurePage::ChangeAttrHdl_Impl( void* p )
         {
             default:
             case RP_LT: eVPos = SdrMeasureTextVPos::Above;
-                        eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
+                        eHPos = SdrMeasureTextHPos::LeftOutside; break;
             case RP_LM: eVPos = SdrMeasureTextVPos::VerticalCentered;
-                        eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
+                        eHPos = SdrMeasureTextHPos::LeftOutside; break;
             case RP_LB: eVPos = SdrMeasureTextVPos::Below;
-                        eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
+                        eHPos = SdrMeasureTextHPos::LeftOutside; break;
             case RP_MT: eVPos = SdrMeasureTextVPos::Above;
-                        eHPos = SDRMEASURE_TEXTINSIDE; break;
+                        eHPos = SdrMeasureTextHPos::Inside; break;
             case RP_MM: eVPos = SdrMeasureTextVPos::VerticalCentered;
-                        eHPos = SDRMEASURE_TEXTINSIDE; break;
+                        eHPos = SdrMeasureTextHPos::Inside; break;
             case RP_MB: eVPos = SdrMeasureTextVPos::Below;
-                        eHPos = SDRMEASURE_TEXTINSIDE; break;
+                        eHPos = SdrMeasureTextHPos::Inside; break;
             case RP_RT: eVPos = SdrMeasureTextVPos::Above;
-                        eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
+                        eHPos = SdrMeasureTextHPos::RightOutside; break;
             case RP_RM: eVPos = SdrMeasureTextVPos::VerticalCentered;
-                        eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
+                        eHPos = SdrMeasureTextHPos::RightOutside; break;
             case RP_RB: eVPos = SdrMeasureTextVPos::Below;
-                        eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
+                        eHPos = SdrMeasureTextHPos::RightOutside; break;
         }
 
         CTL_STATE nState = CTL_STATE::NONE;
 
         if( m_pTsbAutoPosH->GetState() == TRISTATE_TRUE )
         {
-            eHPos = SDRMEASURE_TEXTHAUTO;
+            eHPos = SdrMeasureTextHPos::Auto;
             nState = CTL_STATE::NOHORZ;
         }
 
diff --git a/include/svx/sxmtpitm.hxx b/include/svx/sxmtpitm.hxx
index 8ae3006..b36a706 100644
--- a/include/svx/sxmtpitm.hxx
+++ b/include/svx/sxmtpitm.hxx
@@ -23,7 +23,7 @@
 #include <svl/eitem.hxx>
 #include <svx/svxdllapi.h>
 
-enum SdrMeasureTextHPos {SDRMEASURE_TEXTHAUTO,SDRMEASURE_TEXTLEFTOUTSIDE,SDRMEASURE_TEXTINSIDE,SDRMEASURE_TEXTRIGHTOUTSIDE};
+enum class SdrMeasureTextHPos { Auto, LeftOutside, Inside, RightOutside };
 enum class SdrMeasureTextVPos { Auto, Above, BreakedLine, Below, VerticalCentered };
 
 
@@ -31,7 +31,7 @@ enum class SdrMeasureTextVPos { Auto, Above, BreakedLine, Below, VerticalCentere
 
 class SVX_DLLPUBLIC SdrMeasureTextHPosItem: public SfxEnumItem {
 public:
-    SdrMeasureTextHPosItem(SdrMeasureTextHPos ePos=SDRMEASURE_TEXTHAUTO): SfxEnumItem(SDRATTR_MEASURETEXTHPOS,sal::static_int_cast< sal_uInt16 >(ePos)) {}
+    SdrMeasureTextHPosItem(SdrMeasureTextHPos ePos=SdrMeasureTextHPos::Auto): SfxEnumItem(SDRATTR_MEASURETEXTHPOS,sal::static_int_cast< sal_uInt16 >(ePos)) {}
     SdrMeasureTextHPosItem(SvStream& rIn)                               : SfxEnumItem(SDRATTR_MEASURETEXTHPOS,rIn)    {}
     virtual SfxPoolItem*   Clone(SfxItemPool* pPool=nullptr) const override;
     virtual SfxPoolItem*   Create(SvStream& rIn, sal_uInt16 nVer) const override;
diff --git a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
index 7713c86..d80227e 100644
--- a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
@@ -67,22 +67,22 @@ namespace sdr
 
             switch(static_cast<const SdrMeasureTextHPosItem&>(rItemSet.Get(SDRATTR_MEASURETEXTHPOS)).GetValue())
             {
-                case SDRMEASURE_TEXTLEFTOUTSIDE :
+                case SdrMeasureTextHPos::LeftOutside :
                 {
                     aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
                     break;
                 }
-                case SDRMEASURE_TEXTINSIDE :
+                case SdrMeasureTextHPos::Inside :
                 {
                     aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
                     break;
                 }
-                case SDRMEASURE_TEXTRIGHTOUTSIDE :
+                case SdrMeasureTextHPos::RightOutside :
                 {
                     aMTPHor = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
                     break;
                 }
-                default : // SDRMEASURE_TEXTHAUTO
+                default : // SdrMeasureTextHPos::Auto
                 {
                     break;
                 }
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index ec82869..6fc7985 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -423,7 +423,7 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly&
         }
     }
     rPol.bBreakedLine=bBrkLine;
-    if (rPol.eUsedTextHPos==SDRMEASURE_TEXTHAUTO) { // if text is too wide, push it outside
+    if (rPol.eUsedTextHPos==SdrMeasureTextHPos::Auto) { // if text is too wide, push it outside
         bool bOutside = false;
         long nNeedSiz=!rRec.bTextRota90 ? rPol.aTextSize.Width() : rPol.aTextSize.Height();
         if (nNeedSiz>rPol.nLineLen) bOutside = true; // text doesn't fit in between
@@ -433,9 +433,9 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly&
             long nSmallNeed=nArrow1Len+nArrow2Len+(nArrow1Wdt+nArrow2Wdt)/2/4;
             if (nNeedSiz+nSmallNeed>rPol.nLineLen) bPfeileAussen = true; // text fits in between, if arrowheads are on the outside
         }
-        rPol.eUsedTextHPos=bOutside ? SDRMEASURE_TEXTLEFTOUTSIDE : SDRMEASURE_TEXTINSIDE;
+        rPol.eUsedTextHPos=bOutside ? SdrMeasureTextHPos::LeftOutside : SdrMeasureTextHPos::Inside;
     }
-    if (rPol.eUsedTextHPos!=SDRMEASURE_TEXTINSIDE) bPfeileAussen = true;
+    if (rPol.eUsedTextHPos!=SdrMeasureTextHPos::Inside) bPfeileAussen = true;
     rPol.nArrow1Wdt=nArrow1Wdt;
     rPol.nArrow2Wdt=nArrow2Wdt;
     rPol.nShortLineLen=nShortLen;
@@ -524,8 +524,8 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly&
         long nLen2=nShortLen;
         long nTextWdt=rRec.bTextRota90 ? rPol.aTextSize.Height() : rPol.aTextSize.Width();
         if (!bBrkLine) {
-            if (rPol.eUsedTextHPos==SDRMEASURE_TEXTLEFTOUTSIDE) nLen1=nArrow1Len+nTextWdt;
-            if (rPol.eUsedTextHPos==SDRMEASURE_TEXTRIGHTOUTSIDE) nLen2=nArrow2Len+nTextWdt;
+            if (rPol.eUsedTextHPos==SdrMeasureTextHPos::LeftOutside) nLen1=nArrow1Len+nTextWdt;
+            if (rPol.eUsedTextHPos==SdrMeasureTextHPos::RightOutside) nLen2=nArrow2Len+nTextWdt;
         }
         rPol.aMainline1.aP1=aMainlinePt1;
         rPol.aMainline1.aP2=aMainlinePt1; rPol.aMainline1.aP2.X()-=nLen1; RotatePoint(rPol.aMainline1.aP2,aMainlinePt1,nLineSin,nLineCos);
@@ -534,7 +534,7 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly&
         rPol.aMainline3.aP1=aMainlinePt1;
         rPol.aMainline3.aP2=aMainlinePt2;
         rPol.nMainlineAnz=3;
-        if (bBrkLine && rPol.eUsedTextHPos==SDRMEASURE_TEXTINSIDE) rPol.nMainlineAnz=2;
+        if (bBrkLine && rPol.eUsedTextHPos==SdrMeasureTextHPos::Inside) rPol.nMainlineAnz=2;
     }
 }
 
@@ -670,8 +670,8 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
     SdrMeasureTextVPos eMV=aMPol.eUsedTextVPos;
     if (!bRota90) {
         switch (eMH) {
-            case SDRMEASURE_TEXTLEFTOUTSIDE: aTextPos.X()=aPt1b.X()-aTextSize2.Width()-nArr1Len-nLWdt; break;
-            case SDRMEASURE_TEXTRIGHTOUTSIDE: aTextPos.X()=aPt1b.X()+nLen+nArr2Len+nLWdt; break;
+            case SdrMeasureTextHPos::LeftOutside: aTextPos.X()=aPt1b.X()-aTextSize2.Width()-nArr1Len-nLWdt; break;
+            case SdrMeasureTextHPos::RightOutside: aTextPos.X()=aPt1b.X()+nLen+nArr2Len+nLWdt; break;
             default: aTextPos.X()=aPt1b.X(); aTextSize2.Width()=nLen;
         }
         switch (eMV) {
@@ -692,8 +692,8 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
         }
     } else { // also if bTextRota90==TRUE
         switch (eMH) {
-            case SDRMEASURE_TEXTLEFTOUTSIDE: aTextPos.X()=aPt1b.X()-aTextSize2.Height()-nArr1Len; break;
-            case SDRMEASURE_TEXTRIGHTOUTSIDE: aTextPos.X()=aPt1b.X()+nLen+nArr2Len; break;
+            case SdrMeasureTextHPos::LeftOutside: aTextPos.X()=aPt1b.X()-aTextSize2.Height()-nArr1Len; break;
+            case SdrMeasureTextHPos::RightOutside: aTextPos.X()=aPt1b.X()+nLen+nArr2Len; break;
             default: aTextPos.X()=aPt1b.X(); aTextSize2.Height()=nLen;
         }
         switch (eMV) {
@@ -1330,16 +1330,16 @@ sal_uInt16 SdrMeasureObj::GetOutlinerViewAnchorMode() const
 
     // TODO: bTextUpsideDown should be interpreted here!
     if (!bTextRota90) {
-        if (eMH==SDRMEASURE_TEXTLEFTOUTSIDE) eTH=SDRTEXTHORZADJUST_RIGHT;
-        if (eMH==SDRMEASURE_TEXTRIGHTOUTSIDE) eTH=SDRTEXTHORZADJUST_LEFT;
-        // at eMH==SDRMEASURE_TEXTINSIDE we can anchor horizontally
+        if (eMH==SdrMeasureTextHPos::LeftOutside) eTH=SDRTEXTHORZADJUST_RIGHT;
+        if (eMH==SdrMeasureTextHPos::RightOutside) eTH=SDRTEXTHORZADJUST_LEFT;
+        // at eMH==SdrMeasureTextHPos::Inside we can anchor horizontally
         if (eMV==SdrMeasureTextVPos::Above) eTV=SDRTEXTVERTADJUST_BOTTOM;
         if (eMV==SdrMeasureTextVPos::Below) eTV=SDRTEXTVERTADJUST_TOP;
         if (eMV==SdrMeasureTextVPos::BreakedLine || eMV==SdrMeasureTextVPos::VerticalCentered) eTV=SDRTEXTVERTADJUST_CENTER;
     } else {
-        if (eMH==SDRMEASURE_TEXTLEFTOUTSIDE) eTV=SDRTEXTVERTADJUST_BOTTOM;
-        if (eMH==SDRMEASURE_TEXTRIGHTOUTSIDE) eTV=SDRTEXTVERTADJUST_TOP;
-        // at eMH==SDRMEASURE_TEXTINSIDE we can anchor vertically
+        if (eMH==SdrMeasureTextHPos::LeftOutside) eTV=SDRTEXTVERTADJUST_BOTTOM;
+        if (eMH==SdrMeasureTextHPos::RightOutside) eTV=SDRTEXTVERTADJUST_TOP;
+        // at eMH==SdrMeasureTextHPos::Inside we can anchor vertically
         if (!bBelowRefEdge) {
             if (eMV==SdrMeasureTextVPos::Above) eTH=SDRTEXTHORZADJUST_LEFT;
             if (eMV==SdrMeasureTextVPos::Below) eTH=SDRTEXTHORZADJUST_RIGHT;
commit d4ec2ed0c598273479eb658b8cd10e043fe0bc73
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Aug 17 15:37:31 2016 +0200

    convert SdrMeasureTextVPos to scoped enum
    
    Change-Id: I89cc8bc2cfdd3fe059bb38216a10d36dcfea3953

diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index 3c8d08d..4585938 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -352,7 +352,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                 RECT_POINT eRP = RP_MM;
                 switch( eVPos )
                 {
-                case SDRMEASURE_ABOVE:
+                case SdrMeasureTextVPos::Above:
                     switch( eHPos )
                     {
                     case SDRMEASURE_TEXTLEFTOUTSIDE:    eRP = RP_LT; break;
@@ -361,7 +361,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                     case SDRMEASURE_TEXTHAUTO:          eRP = RP_MT; break;
                     }
                     break;
-                case SDRMEASURETEXT_VERTICALCENTERED:
+                case SdrMeasureTextVPos::VerticalCentered:
                     switch( eHPos )
                     {
                     case SDRMEASURE_TEXTLEFTOUTSIDE:    eRP = RP_LM; break;
@@ -370,7 +370,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                     case SDRMEASURE_TEXTHAUTO:          eRP = RP_MM; break;
                     }
                     break;
-                case SDRMEASURE_BELOW:
+                case SdrMeasureTextVPos::Below:
                     switch( eHPos )
                     {
                     case SDRMEASURE_TEXTLEFTOUTSIDE:    eRP = RP_LB; break;
@@ -379,7 +379,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                     case SDRMEASURE_TEXTHAUTO:          eRP = RP_MB; break;
                     }
                     break;
-                case SDRMEASURE_TEXTVAUTO:
+                case SdrMeasureTextVPos::Auto:
                     switch( eHPos )
                     {
                     case SDRMEASURE_TEXTLEFTOUTSIDE:    eRP = RP_LM; break;
@@ -399,7 +399,7 @@ void SvxMeasurePage::Reset( const SfxItemSet* rAttrs )
                     nState = CTL_STATE::NOHORZ;
                 }
 
-                if( eVPos == SDRMEASURE_TEXTVAUTO )
+                if( eVPos == SdrMeasureTextVPos::Auto )
                 {
                     m_pTsbAutoPosV->SetState( TRISTATE_TRUE );
                     nState |= CTL_STATE::NOVERT;
@@ -525,30 +525,30 @@ bool SvxMeasurePage::FillItemSet( SfxItemSet* rAttrs)
         switch( eRP )
         {
             default:
-            case RP_LT: eVPos = SDRMEASURE_ABOVE;
+            case RP_LT: eVPos = SdrMeasureTextVPos::Above;
                         eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
-            case RP_LM: eVPos = SDRMEASURETEXT_VERTICALCENTERED;
+            case RP_LM: eVPos = SdrMeasureTextVPos::VerticalCentered;
                         eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
-            case RP_LB: eVPos = SDRMEASURE_BELOW;
+            case RP_LB: eVPos = SdrMeasureTextVPos::Below;
                         eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
-            case RP_MT: eVPos = SDRMEASURE_ABOVE;
+            case RP_MT: eVPos = SdrMeasureTextVPos::Above;
                         eHPos = SDRMEASURE_TEXTINSIDE; break;
-            case RP_MM: eVPos = SDRMEASURETEXT_VERTICALCENTERED;
+            case RP_MM: eVPos = SdrMeasureTextVPos::VerticalCentered;
                         eHPos = SDRMEASURE_TEXTINSIDE; break;
-            case RP_MB: eVPos = SDRMEASURE_BELOW;
+            case RP_MB: eVPos = SdrMeasureTextVPos::Below;
                         eHPos = SDRMEASURE_TEXTINSIDE; break;
-            case RP_RT: eVPos = SDRMEASURE_ABOVE;
+            case RP_RT: eVPos = SdrMeasureTextVPos::Above;
                         eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
-            case RP_RM: eVPos = SDRMEASURETEXT_VERTICALCENTERED;
+            case RP_RM: eVPos = SdrMeasureTextVPos::VerticalCentered;
                         eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
-            case RP_RB: eVPos = SDRMEASURE_BELOW;
+            case RP_RB: eVPos = SdrMeasureTextVPos::Below;
                         eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
         }
         if( m_pTsbAutoPosH->GetState() == TRISTATE_TRUE )
             eHPos = SDRMEASURE_TEXTHAUTO;
 
         if( m_pTsbAutoPosV->GetState() == TRISTATE_TRUE )
-            eVPos = SDRMEASURE_TEXTVAUTO;
+            eVPos = SdrMeasureTextVPos::Auto;
 
         if ( rAttrs->GetItemState( SDRATTR_MEASURETEXTVPOS ) != SfxItemState::DONTCARE )
         {
@@ -754,23 +754,23 @@ void SvxMeasurePage::ChangeAttrHdl_Impl( void* p )
         switch( eRP )
         {
             default:
-            case RP_LT: eVPos = SDRMEASURE_ABOVE;
+            case RP_LT: eVPos = SdrMeasureTextVPos::Above;
                         eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
-            case RP_LM: eVPos = SDRMEASURETEXT_VERTICALCENTERED;
+            case RP_LM: eVPos = SdrMeasureTextVPos::VerticalCentered;
                         eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
-            case RP_LB: eVPos = SDRMEASURE_BELOW;
+            case RP_LB: eVPos = SdrMeasureTextVPos::Below;
                         eHPos = SDRMEASURE_TEXTLEFTOUTSIDE; break;
-            case RP_MT: eVPos = SDRMEASURE_ABOVE;
+            case RP_MT: eVPos = SdrMeasureTextVPos::Above;
                         eHPos = SDRMEASURE_TEXTINSIDE; break;
-            case RP_MM: eVPos = SDRMEASURETEXT_VERTICALCENTERED;
+            case RP_MM: eVPos = SdrMeasureTextVPos::VerticalCentered;
                         eHPos = SDRMEASURE_TEXTINSIDE; break;
-            case RP_MB: eVPos = SDRMEASURE_BELOW;
+            case RP_MB: eVPos = SdrMeasureTextVPos::Below;
                         eHPos = SDRMEASURE_TEXTINSIDE; break;
-            case RP_RT: eVPos = SDRMEASURE_ABOVE;
+            case RP_RT: eVPos = SdrMeasureTextVPos::Above;
                         eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
-            case RP_RM: eVPos = SDRMEASURETEXT_VERTICALCENTERED;
+            case RP_RM: eVPos = SdrMeasureTextVPos::VerticalCentered;
                         eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
-            case RP_RB: eVPos = SDRMEASURE_BELOW;
+            case RP_RB: eVPos = SdrMeasureTextVPos::Below;
                         eHPos = SDRMEASURE_TEXTRIGHTOUTSIDE; break;
         }
 
@@ -784,7 +784,7 @@ void SvxMeasurePage::ChangeAttrHdl_Impl( void* p )
 
         if( m_pTsbAutoPosV->GetState() == TRISTATE_TRUE )
         {
-            eVPos = SDRMEASURE_TEXTVAUTO;
+            eVPos = SdrMeasureTextVPos::Auto;
             nState |= CTL_STATE::NOVERT;
         }
 
diff --git a/include/svx/sxmtpitm.hxx b/include/svx/sxmtpitm.hxx
index 1df4cbc..8ae3006 100644
--- a/include/svx/sxmtpitm.hxx
+++ b/include/svx/sxmtpitm.hxx
@@ -24,7 +24,7 @@
 #include <svx/svxdllapi.h>
 
 enum SdrMeasureTextHPos {SDRMEASURE_TEXTHAUTO,SDRMEASURE_TEXTLEFTOUTSIDE,SDRMEASURE_TEXTINSIDE,SDRMEASURE_TEXTRIGHTOUTSIDE};
-enum SdrMeasureTextVPos {SDRMEASURE_TEXTVAUTO,SDRMEASURE_ABOVE,SDRMEASURETEXT_BREAKEDLINE,SDRMEASURE_BELOW,SDRMEASURETEXT_VERTICALCENTERED};
+enum class SdrMeasureTextVPos { Auto, Above, BreakedLine, Below, VerticalCentered };
 
 
 // class SdrMeasureTextHPosItem
@@ -50,7 +50,7 @@ public:
 
 class SVX_DLLPUBLIC SdrMeasureTextVPosItem: public SfxEnumItem {
 public:
-    SdrMeasureTextVPosItem(SdrMeasureTextVPos ePos=SDRMEASURE_TEXTVAUTO): SfxEnumItem(SDRATTR_MEASURETEXTVPOS,sal::static_int_cast< sal_uInt16 >(ePos)) {}
+    SdrMeasureTextVPosItem(SdrMeasureTextVPos ePos=SdrMeasureTextVPos::Auto): SfxEnumItem(SDRATTR_MEASURETEXTVPOS,sal::static_int_cast< sal_uInt16 >(ePos)) {}
     SdrMeasureTextVPosItem(SvStream& rIn)                               : SfxEnumItem(SDRATTR_MEASURETEXTVPOS,rIn)    {}
     virtual SfxPoolItem*   Clone(SfxItemPool* pPool=nullptr) const override;
     virtual SfxPoolItem*   Create(SvStream& rIn, sal_uInt16 nVer) const override;
diff --git a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
index 3cccfca..7713c86 100644
--- a/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrmeasureobj.cxx
@@ -90,23 +90,23 @@ namespace sdr
 
             switch(static_cast<const SdrMeasureTextVPosItem&>(rItemSet.Get(SDRATTR_MEASURETEXTVPOS)).GetValue())
             {
-                case SDRMEASURE_ABOVE :
+                case SdrMeasureTextVPos::Above :
                 {
                     aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_NEGATIVE;
                     break;
                 }
-                case SDRMEASURETEXT_BREAKEDLINE :
-                case SDRMEASURETEXT_VERTICALCENTERED :
+                case SdrMeasureTextVPos::BreakedLine :
+                case SdrMeasureTextVPos::VerticalCentered :
                 {
                     aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_CENTERED;
                     break;
                 }
-                case SDRMEASURE_BELOW :
+                case SdrMeasureTextVPos::Below :
                 {
                     aMTPVer = drawinglayer::primitive2d::MEASURETEXTPOSITION_POSITIVE;
                     break;
                 }
-                default : // SDRMEASURE_TEXTVAUTO
+                default : // SdrMeasureTextVPos::Auto
                 {
                     break;
                 }
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index 8e69c8d..ec82869 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -412,9 +412,9 @@ void SdrMeasureObj::ImpCalcGeometrics(const ImpMeasureRec& rRec, ImpMeasurePoly&
 
     rPol.eUsedTextHPos=rRec.eWantTextHPos;
     rPol.eUsedTextVPos=rRec.eWantTextVPos;
-    if (rPol.eUsedTextVPos==SDRMEASURE_TEXTVAUTO) rPol.eUsedTextVPos=SDRMEASURE_ABOVE;
-    bool bBrkLine=rPol.eUsedTextVPos==SDRMEASURETEXT_BREAKEDLINE;
-    if (rPol.eUsedTextVPos==SDRMEASURETEXT_VERTICALCENTERED)
+    if (rPol.eUsedTextVPos==SdrMeasureTextVPos::Auto) rPol.eUsedTextVPos=SdrMeasureTextVPos::Above;
+    bool bBrkLine=rPol.eUsedTextVPos==SdrMeasureTextVPos::BreakedLine;
+    if (rPol.eUsedTextVPos==SdrMeasureTextVPos::VerticalCentered)
     {
         OutlinerParaObject* pOutlinerParaObject = SdrTextObj::GetOutlinerParaObject();
         if (pOutlinerParaObject!=nullptr && pOutlinerParaObject->GetTextObject().GetParagraphCount()==1)
@@ -675,9 +675,9 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
             default: aTextPos.X()=aPt1b.X(); aTextSize2.Width()=nLen;
         }
         switch (eMV) {
-            case SDRMEASURETEXT_VERTICALCENTERED:
-            case SDRMEASURETEXT_BREAKEDLINE: aTextPos.Y()=aPt1b.Y()-aTextSize2.Height()/2; break;
-            case SDRMEASURE_BELOW: {
+            case SdrMeasureTextVPos::VerticalCentered:
+            case SdrMeasureTextVPos::BreakedLine: aTextPos.Y()=aPt1b.Y()-aTextSize2.Height()/2; break;
+            case SdrMeasureTextVPos::Below: {
                 if (!bUpsideDown) aTextPos.Y()=aPt1b.Y()+nLWdt;
                 else aTextPos.Y()=aPt1b.Y()-aTextSize2.Height()-nLWdt;
             } break;
@@ -697,9 +697,9 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const
             default: aTextPos.X()=aPt1b.X(); aTextSize2.Height()=nLen;
         }
         switch (eMV) {
-            case SDRMEASURETEXT_VERTICALCENTERED:
-            case SDRMEASURETEXT_BREAKEDLINE: aTextPos.Y()=aPt1b.Y()+aTextSize2.Width()/2; break;
-            case SDRMEASURE_BELOW: {
+            case SdrMeasureTextVPos::VerticalCentered:
+            case SdrMeasureTextVPos::BreakedLine: aTextPos.Y()=aPt1b.Y()+aTextSize2.Width()/2; break;
+            case SdrMeasureTextVPos::Below: {
                 if (!bBelowRefEdge) aTextPos.Y()=aPt1b.Y()+aTextSize2.Width()+nLWdt;
                 else aTextPos.Y()=aPt1b.Y()-nLWdt;
             } break;
@@ -1333,21 +1333,21 @@ sal_uInt16 SdrMeasureObj::GetOutlinerViewAnchorMode() const
         if (eMH==SDRMEASURE_TEXTLEFTOUTSIDE) eTH=SDRTEXTHORZADJUST_RIGHT;
         if (eMH==SDRMEASURE_TEXTRIGHTOUTSIDE) eTH=SDRTEXTHORZADJUST_LEFT;
         // at eMH==SDRMEASURE_TEXTINSIDE we can anchor horizontally
-        if (eMV==SDRMEASURE_ABOVE) eTV=SDRTEXTVERTADJUST_BOTTOM;
-        if (eMV==SDRMEASURE_BELOW) eTV=SDRTEXTVERTADJUST_TOP;
-        if (eMV==SDRMEASURETEXT_BREAKEDLINE || eMV==SDRMEASURETEXT_VERTICALCENTERED) eTV=SDRTEXTVERTADJUST_CENTER;
+        if (eMV==SdrMeasureTextVPos::Above) eTV=SDRTEXTVERTADJUST_BOTTOM;
+        if (eMV==SdrMeasureTextVPos::Below) eTV=SDRTEXTVERTADJUST_TOP;
+        if (eMV==SdrMeasureTextVPos::BreakedLine || eMV==SdrMeasureTextVPos::VerticalCentered) eTV=SDRTEXTVERTADJUST_CENTER;
     } else {
         if (eMH==SDRMEASURE_TEXTLEFTOUTSIDE) eTV=SDRTEXTVERTADJUST_BOTTOM;
         if (eMH==SDRMEASURE_TEXTRIGHTOUTSIDE) eTV=SDRTEXTVERTADJUST_TOP;
         // at eMH==SDRMEASURE_TEXTINSIDE we can anchor vertically
         if (!bBelowRefEdge) {
-            if (eMV==SDRMEASURE_ABOVE) eTH=SDRTEXTHORZADJUST_LEFT;
-            if (eMV==SDRMEASURE_BELOW) eTH=SDRTEXTHORZADJUST_RIGHT;
+            if (eMV==SdrMeasureTextVPos::Above) eTH=SDRTEXTHORZADJUST_LEFT;
+            if (eMV==SdrMeasureTextVPos::Below) eTH=SDRTEXTHORZADJUST_RIGHT;
         } else {
-            if (eMV==SDRMEASURE_ABOVE) eTH=SDRTEXTHORZADJUST_RIGHT;
-            if (eMV==SDRMEASURE_BELOW) eTH=SDRTEXTHORZADJUST_LEFT;
+            if (eMV==SdrMeasureTextVPos::Above) eTH=SDRTEXTHORZADJUST_RIGHT;
+            if (eMV==SdrMeasureTextVPos::Below) eTH=SDRTEXTHORZADJUST_LEFT;
         }
-        if (eMV==SDRMEASURETEXT_BREAKEDLINE || eMV==SDRMEASURETEXT_VERTICALCENTERED) eTH=SDRTEXTHORZADJUST_CENTER;
+        if (eMV==SdrMeasureTextVPos::BreakedLine || eMV==SdrMeasureTextVPos::VerticalCentered) eTH=SDRTEXTHORZADJUST_CENTER;
     }
 
     EVAnchorMode eRet=ANCHOR_BOTTOM_HCENTER;
commit d643cad3f067764ad0d7d7d8f238c590e6e509b5
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Aug 17 15:34:33 2016 +0200

    convert ColorModel to scoped enum
    
    and move it into CUI, since it is only used there
    
    Change-Id: I6f8dcfc8d705aa2de2a05eec16f087f17c488872

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 23d3937..415055b 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -711,6 +711,12 @@ public:
 
 /************************************************************************/
 
+enum class ColorModel
+{
+    RGB,
+    CMYK // can be extend with more models, e.g. HSV
+};
+
 struct SvxColorTabPageShadow;
 class SvxColorTabPage : public SfxTabPage
 {
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index b78f6ea..77b62f9 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -89,7 +89,7 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr
     , aXFillColorItem( OUString(), Color( COL_BLACK ) )
     , aXFillAttr( static_cast<XOutdevItemPool*>( rInAttrs.GetPool() ))
     , rXFSet( aXFillAttr.GetItemSet() )
-    , eCM( CM_RGB )
+    , eCM( ColorModel::RGB )
     , m_context(comphelper::getProcessComponentContext())
 {
     get(m_pSelectPalette, "paletteselector");
@@ -280,7 +280,7 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
                 const SfxPoolItem* pPoolItem = nullptr;
                 if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), true, &pPoolItem ) )
                 {
-                    SetColorModel( CM_RGB );
+                    SetColorModel( ColorModel::RGB );
                     ChangeColorModel();
 
                     aPreviousColor = static_cast<const XFillColorItem*>(pPoolItem)->GetColorValue();
@@ -406,7 +406,7 @@ VclPtr<SfxTabPage> SvxColorTabPage::Create( vcl::Window* pWindow,
 // is called when the content of the MtrFields is changed for color values
 IMPL_LINK_TYPED(SvxColorTabPage, ModifiedHdl_Impl, Edit&, rEdit, void)
 {
-    if (eCM == CM_RGB)
+    if (eCM == ColorModel::RGB)
     {
         // read current MtrFields, if cmyk, then k-value as transparency
         if(&rEdit == m_pHexcustom)
@@ -427,7 +427,7 @@ IMPL_LINK_TYPED(SvxColorTabPage, ModifiedHdl_Impl, Edit&, rEdit, void)
                                         (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pCcustom->GetValue() ),
                                         (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pYcustom->GetValue() ),
                                         (sal_uInt8)PercentToColor_Impl( (sal_uInt16) m_pMcustom->GetValue() ) ).GetColor() );
-        ConvertColorValues (aCurrentColor, CM_RGB);
+        ConvertColorValues (aCurrentColor, ColorModel::RGB);
     }
 
     rXFSet.Put( XFillColorItem( OUString(), aCurrentColor ) );
@@ -626,14 +626,14 @@ void SvxColorTabPage::ConvertColorValues (Color& rColor, ColorModel eModell)
 {
     switch (eModell)
     {
-        case CM_RGB:
+        case ColorModel::RGB:
         {
             CmykToRgb_Impl (rColor, (sal_uInt16)rColor.GetTransparency() );
             rColor.SetTransparency ((sal_uInt8) 0);
         }
         break;
 
-        case CM_CMYK:
+        case ColorModel::CMYK:
         {
             sal_uInt16 nK;
             RgbToCmyk_Impl (rColor, nK );
@@ -645,9 +645,9 @@ void SvxColorTabPage::ConvertColorValues (Color& rColor, ColorModel eModell)
 IMPL_LINK_TYPED(SvxColorTabPage, SelectColorModeHdl_Impl, RadioButton&, rRadioButton, void)
 {
     if( &rRadioButton == m_pRbRGB )
-        eCM = CM_RGB;
+        eCM = ColorModel::RGB;
     if( &rRadioButton == m_pRbCMYK )
-        eCM = CM_CMYK;
+        eCM = ColorModel::CMYK;
     ChangeColorModel();
     UpdateColorValues();
 }
@@ -667,9 +667,9 @@ void SvxColorTabPage::SetColorModel( ColorModel eModel )
 {
     m_pRbRGB->SetState(false);
     m_pRbCMYK->SetState(false);
-    if(eModel == CM_RGB)
+    if(eModel == ColorModel::RGB)
         m_pRbRGB->SetState(true);
-    if(eModel == CM_CMYK)
+    if(eModel == ColorModel::CMYK)
         m_pRbCMYK->SetState(true);
 }
 
@@ -677,7 +677,7 @@ void SvxColorTabPage::ChangeColorModel()
 {
     switch( eCM )
     {
-        case CM_RGB:
+        case ColorModel::RGB:
         {
             m_pRGBcustom->Show();
             m_pRGBpreset->Show();
@@ -686,7 +686,7 @@ void SvxColorTabPage::ChangeColorModel()
         }
         break;
 
-        case CM_CMYK:
+        case ColorModel::CMYK:
         {
             m_pCMYKcustom->Show();
             m_pCMYKpreset->Show();
@@ -699,7 +699,7 @@ void SvxColorTabPage::ChangeColorModel()
 
 void SvxColorTabPage::UpdateColorValues()
 {
-    if (eCM != CM_RGB)
+    if (eCM != ColorModel::RGB)
     {
         ConvertColorValues (aPreviousColor, eCM );
         ConvertColorValues (aCurrentColor, eCM);
@@ -713,8 +713,8 @@ void SvxColorTabPage::UpdateColorValues()
         m_pKcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetTransparency() ) );
         m_pKpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetTransparency() ) );
 
-        ConvertColorValues (aPreviousColor, CM_RGB);
-        ConvertColorValues (aCurrentColor, CM_RGB);
+        ConvertColorValues (aPreviousColor, ColorModel::RGB);
+        ConvertColorValues (aCurrentColor, ColorModel::RGB);
     }
     else
     {
@@ -798,11 +798,11 @@ sal_uInt16 SvxColorTabPage::ColorToPercent_Impl( sal_uInt16 nColor )
 
     switch (eCM)
     {
-        case CM_RGB :
+        case ColorModel::RGB :
             nWert = nColor;
             break;
 
-        case CM_CMYK:
+        case ColorModel::CMYK:
             nWert = (sal_uInt16) ( (double) nColor * 100.0 / 255.0 + 0.5 );
             break;
     }
@@ -817,11 +817,11 @@ sal_uInt16 SvxColorTabPage::PercentToColor_Impl( sal_uInt16 nPercent )
 
     switch (eCM)
     {
-        case CM_RGB :
+        case ColorModel::RGB :
             nWert = nPercent;
             break;
 
-        case CM_CMYK:
+        case ColorModel::CMYK:
             nWert = (sal_uInt16) ( (double) nPercent * 255.0 / 100.0 + 0.5 );
             break;
     }
@@ -833,7 +833,7 @@ sal_uInt16 SvxColorTabPage::PercentToColor_Impl( sal_uInt16 nPercent )
 void SvxColorTabPage::FillUserData()
 {
     // the color model is saved in the Ini-file
-    SetUserData( OUString::number( eCM ) );
+    SetUserData( OUString::number( (int)eCM ) );
 }
 
 
diff --git a/include/svx/tabarea.hxx b/include/svx/tabarea.hxx
index f678213..d4d3c69 100644
--- a/include/svx/tabarea.hxx
+++ b/include/svx/tabarea.hxx
@@ -21,12 +21,6 @@
 
 #include <o3tl/typed_flags_set.hxx>
 
-enum ColorModel
-{
-    CM_RGB,
-    CM_CMYK // can be extend with more models, e.g. HSV
-};
-
 enum class ChangeType
 {
     NONE                 = 0x00,
commit fde3facbc8bdeb820d828183948eceaec66e525a
Author: Noel Grandin <noel at peralex.com>
Date:   Wed Aug 17 15:30:15 2016 +0200

    convert PageType to scoped enum
    
    and move it inside CUI, since it's only used there
    
    Change-Id: I83ac1afaa60da9fb34480363a351608b133154cb

diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx
index 392d9fb..3fd53db 100644
--- a/cui/source/dialogs/sdrcelldlg.cxx
+++ b/cui/source/dialogs/sdrcelldlg.cxx
@@ -51,7 +51,7 @@ void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
         rAreaPage.SetGradientList( mpGradientList );
         rAreaPage.SetHatchingList( mpHatchingList );
         rAreaPage.SetBitmapList( mpBitmapList );
-        rAreaPage.SetPageType( PT_AREA );
+        rAreaPage.SetPageType( PageType::Area );
         rAreaPage.SetDlgType( 1 );
         rAreaPage.SetPos( 0 );
         rAreaPage.Construct();
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index db9a99c..23d3937 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -38,6 +38,19 @@
 class SdrModel;
 class SvxBitmapCtl;
 
+enum class PageType
+{
+    Area,
+    Gradient,
+    Hatch,
+    Bitmap,
+    Color,
+    Shadow,
+    Transparence,
+    Unknown = 0xFFFF
+};
+
+
 /************************************************************************/
 
 class SvxAreaTabDialog : public SfxTabDialog
@@ -73,7 +86,7 @@ private:
     ChangeType          mnGradientListState;
     ChangeType          mnHatchingListState;
 
-    sal_uInt16          mnPageType;
+    PageType            mnPageType;
     sal_Int32           mnPos;
     bool                mbAreaTP;
 
@@ -122,7 +135,7 @@ class SvxTransparenceTabPage : public SvxTabPage
     const SfxItemSet&   rOutAttrs;
     RECT_POINT          eRP;
 
-    sal_uInt16             nPageType;
+    PageType               nPageType;
     sal_uInt16             nDlgType;
 
     // main selection
@@ -184,7 +197,7 @@ public:
     virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
     virtual void PointChanged(vcl::Window* pWindow, RECT_POINT eRP) override;
 
-    void SetPageType(sal_uInt16 nInType) { nPageType = nInType; }
+    void SetPageType(PageType nInType) { nPageType = nInType; }
     void SetDlgType(sal_uInt16 nInType) { nDlgType = nInType; }
     virtual void PageCreated(const SfxAllItemSet& aSet) override;
 };
@@ -227,7 +240,7 @@ private:
     ChangeType*         m_pnGradientListState;
     ChangeType*         m_pnHatchingListState;
 
-    sal_uInt16 m_nPageType;
+    PageType   m_nPageType;
     sal_uInt16 m_nDlgType;
     sal_Int32  m_nPos;
 
@@ -288,7 +301,7 @@ public:
                 { m_pHatchingList = pHtchLst; }
     void    SetBitmapList( XBitmapListRef const & pBmpLst) { m_pBitmapList = pBmpLst; }
 
-    void    SetPageType( sal_uInt16 nInType ) { m_nPageType = nInType; }
+    void    SetPageType( PageType nInType ) { m_nPageType = nInType; }
     void    SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
     void    SetPos( sal_uInt16 nInPos ) { m_nPos = nInPos; }
     void    SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
@@ -320,7 +333,7 @@ private:
 
     XColorListRef       m_pColorList;
     ChangeType*         m_pnColorListState;
-    sal_uInt16          m_nPageType;
+    PageType            m_nPageType;
     sal_uInt16          m_nDlgType;
     bool*               m_pbAreaTP;
 
@@ -348,7 +361,7 @@ public:
     virtual void PointChanged( vcl::Window* pWindow, RECT_POINT eRP ) override;
 
     void    SetColorList( XColorListRef const & pColorList ) { m_pColorList = pColorList; }
-    void    SetPageType( sal_uInt16 nInType ) { m_nPageType = nInType; }
+    void    SetPageType( PageType nInType ) { m_nPageType = nInType; }
     void    SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
     void    SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
     void    SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; }
@@ -389,7 +402,7 @@ private:
 
     ChangeType*         m_pnGradientListState;
     ChangeType*         m_pnColorListState;
-    sal_uInt16*         m_pPageType;
+    PageType*           m_pPageType;
     sal_uInt16          m_nDlgType;
     sal_Int32*          m_pPos;
     bool*               m_pbAreaTP;
@@ -433,7 +446,7 @@ public:
     void    SetGradientList( XGradientListRef const & pGrdLst)
                 { m_pGradientList = pGrdLst; }
 
-    void    SetPageType( sal_uInt16* pInType ) { m_pPageType = pInType; }
+    void    SetPageType( PageType* pInType ) { m_pPageType = pInType; }
     void    SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
     void    SetPos( sal_Int32* pInPos ) { m_pPos = pInPos; }
     void    SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
@@ -469,7 +482,7 @@ private:
 
     ChangeType*         m_pnHatchingListState;
     ChangeType*         m_pnColorListState;
-    sal_uInt16*         m_pPageType;
+    PageType*           m_pPageType;
     sal_uInt16          m_nDlgType;
     sal_Int32*          m_pPos;
     bool*               m_pbAreaTP;
@@ -517,7 +530,7 @@ public:
     void    SetHatchingList( XHatchListRef const & pHtchLst)
                 { m_pHatchingList = pHtchLst; }
 
-    void    SetPageType( sal_uInt16* pInType ) { m_pPageType = pInType; }
+    void    SetPageType( PageType* pInType ) { m_pPageType = pInType; }
     void    SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
     void    SetPos( sal_Int32* pInPos ) { m_pPos = pInPos; }
     void    SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
@@ -563,7 +576,7 @@ private:
 
     double                     m_fObjectWidth;
     double                     m_fObjectHeight;
-    sal_uInt16*                m_nPageType;
+    PageType*                  m_nPageType;
     sal_uInt16                 m_nDlgType;
     sal_Int32*                 m_nPos;
 
@@ -612,7 +625,7 @@ public:
 
     void    SetBitmapList( const XBitmapListRef& pBmpLst) { m_pBitmapList = pBmpLst; }
 
-    void    SetPageType( sal_uInt16* pInType ) { m_nPageType = pInType; }
+    void    SetPageType( PageType* pInType ) { m_nPageType = pInType; }
     void    SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
     void    SetPos( sal_Int32* pInPos ) { m_nPos = pInPos; }
     void    SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
@@ -646,7 +659,7 @@ private:
 
     ChangeType*         m_pnPatternListState;
     ChangeType*         m_pnColorListState;
-    sal_uInt16*         m_pPageType;
+    PageType*           m_pPageType;
     sal_uInt16          m_nDlgType;
     sal_Int32*          m_pPos;
     bool*               m_pbAreaTP;
@@ -686,7 +699,7 @@ public:
     void    SetColorList( XColorListRef const & pColorList ) { m_pColorList = pColorList; }
     void    SetPatternList( XPatternListRef const & pPatternList) { m_pPatternList = pPatternList; }
 
-    void    SetPageType( sal_uInt16* pInType ) { m_pPageType = pInType; }
+    void    SetPageType( PageType* pInType ) { m_pPageType = pInType; }
     void    SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
     void    SetPos( sal_Int32* pInPos ) { m_pPos = pInPos; }
     void    SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
@@ -753,7 +766,7 @@ private:
     XColorListRef         pColorList;
 
     ChangeType*         pnColorListState;
-    sal_uInt16*         pPageType;
+    PageType*           pPageType;
     sal_uInt16          nDlgType;
     sal_Int32*          pPos;
     bool*               pbAreaTP;
@@ -816,7 +829,7 @@ public:
     void    SaveToViewFrame( SfxViewFrame *pViewFrame );
     void    SetupForViewFrame( SfxViewFrame *pViewFrame );
 
-    void    SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
+    void    SetPageType( PageType* pInType ) { pPageType = pInType; }
     void    SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
     void    SetPos( sal_Int32* pInPos ) { pPos = pInPos; }
     void    SetAreaTP( bool* pIn ) { pbAreaTP = pIn; }
diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index a3df4fb..f2398ad 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -24,6 +24,8 @@
 #include <svx/tabline.hxx>
 #include <svx/tabarea.hxx>
 
+enum class PageType;
+
 class SvxLineTabDialog : public SfxTabDialog
 {
     sal_uInt16            m_nLineTabPage;
@@ -49,7 +51,7 @@ private:
     ChangeType          nDashListState;
     ChangeType          mnColorListState;
 
-    sal_uInt16          nPageType;
+    PageType            nPageType;
     sal_Int32           nPosDashLb;
     sal_Int32           nPosLineEndLb;
     bool            mbAreaTP;
@@ -157,7 +159,7 @@ private:
     ChangeType*         m_pnLineEndListState;
     ChangeType*         m_pnDashListState;
     ChangeType*         m_pnColorListState;
-    sal_uInt16          m_nPageType;
+    PageType            m_nPageType;
     sal_uInt16          m_nDlgType;
     sal_Int32*          m_pPosDashLb;
     sal_Int32*          m_pPosLineEndLb;
@@ -224,7 +226,7 @@ public:
     void    SetLineEndList( XLineEndListRef const & pLneEndLst) { m_pLineEndList = pLneEndLst; }
     void    SetObjSelected( bool bHasObj ) { m_bObjSelected = bHasObj; }
 
-    void    SetPageType( sal_uInt16 nInType ) { m_nPageType = nInType; }
+    void    SetPageType( PageType nInType ) { m_nPageType = nInType; }
     void    SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
     void    SetPosDashLb( sal_Int32* pInPos ) { m_pPosDashLb = pInPos; }
     void    SetPosLineEndLb( sal_Int32* pInPos ) { m_pPosLineEndLb = pInPos; }
@@ -274,7 +276,7 @@ private:
     XDashListRef          pDashList;
 
     ChangeType*         pnDashListState;
-    sal_uInt16*         pPageType;
+    PageType*           pPageType;
     sal_uInt16          nDlgType;
     sal_Int32*          pPosDashLb;
 
@@ -317,7 +319,7 @@ public:
     void    SetDashList( XDashListRef const & pDshLst ) { pDashList = pDshLst; }
     void    SetObjSelected( bool bHasObj ) { bObjSelected = bHasObj; }
 
-    void    SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
+    void    SetPageType( PageType* pInType ) { pPageType = pInType; }
     void    SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
     void    SetPosDashLb( sal_Int32* pInPos ) { pPosDashLb = pInPos; }
 
@@ -356,7 +358,7 @@ private:
     XLineEndListRef       pLineEndList;
 
     ChangeType*         pnLineEndListState;
-    sal_uInt16*         pPageType;
+    PageType*           pPageType;
     sal_uInt16          nDlgType;
     sal_Int32*          pPosLineEndLb;
 
@@ -388,7 +390,7 @@ public:
     void    SetPolyObj( const SdrObject* pObj ) { pPolyObj = pObj; }
     void    SetObjSelected( bool bHasObj ) { bObjSelected = bHasObj; }
 
-    void    SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
+    void    SetPageType( PageType* pInType ) { pPageType = pInType; }
     void    SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
     void    SetPosLineEndLb( sal_Int32* pInPos ) { pPosLineEndLb = pInPos; }
 
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index e403d45..a3813ae 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -73,7 +73,7 @@ SvxAreaTabDialog::SvxAreaTabDialog
     mnPatternListState ( ChangeType::NONE ),
     mnGradientListState ( ChangeType::NONE ),
     mnHatchingListState ( ChangeType::NONE ),
-    mnPageType( PT_AREA ),
+    mnPageType( PageType::Area ),
     mnPos( 0 ),
     mbAreaTP( false )
 {
diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx
index 65a2e52..6441aad 100644
--- a/cui/source/tabpages/tabline.cxx
+++ b/cui/source/tabpages/tabline.cxx
@@ -63,7 +63,7 @@ SvxLineTabDialog::SvxLineTabDialog
     nLineEndListState( ChangeType::NONE ),
     nDashListState( ChangeType::NONE ),
     mnColorListState( ChangeType::NONE ),
-    nPageType( 0 ), // We use it here primarily to get the right attributes with FillItemSet
+    nPageType( PageType::Area ), // We use it here primarily to get the right attributes with FillItemSet
     nPosDashLb( 0 ),
     nPosLineEndLb( 0 ),
     mbAreaTP( false )
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 1673ae3..3dd275b 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -89,7 +89,7 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
     m_pnGradientListState(&maFixed_ChangeType),
     m_pnHatchingListState(&maFixed_ChangeType),
 
-    m_nPageType(0),
+    m_nPageType(PageType::Area),
     m_nDlgType(0),
     m_nPos(0),
 
@@ -195,7 +195,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
     const SfxUInt16Item* pPageTypeItem = rSet.GetItem<SfxUInt16Item>(SID_PAGE_TYPE, false);
     const SfxUInt16Item* pPosItem = rSet.GetItem<SfxUInt16Item>(SID_TABPAGE_POS, false);
     if (pPageTypeItem)
-        SetPageType(pPageTypeItem->GetValue());
+        SetPageType((PageType) pPageTypeItem->GetValue());
     if (pPosItem)
         SetPos(pPosItem->GetValue());
     if( m_nDlgType == 0 ) // area dialog
@@ -288,32 +288,33 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
             {
                 switch( m_nPageType )
                 {
-                    case PT_GRADIENT:
+                    case PageType::Gradient:
                         m_pTypeLB->SelectEntryPos( drawing::FillStyle_GRADIENT );
                         m_pLbGradient->SelectEntryPos( _nPos );
                         ClickGradientHdl_Impl();
                     break;
 
-                    case PT_HATCH:
+                    case PageType::Hatch:
                         m_pTypeLB->SelectEntryPos( drawing::FillStyle_HATCH );
                         m_pLbHatching->SelectEntryPos( _nPos );
                         ClickHatchingHdl_Impl();
                     break;
 
-                    case PT_BITMAP:
+                    case PageType::Bitmap:
                         m_pTypeLB->SelectEntryPos( drawing::FillStyle_BITMAP );
                         m_pLbBitmap->SelectEntryPos( _nPos );
                         ClickBitmapHdl_Impl();
                     break;
 
-                    case PT_COLOR:
+                    case PageType::Color:
                         m_pTypeLB->SelectEntryPos( drawing::FillStyle_SOLID );
                         m_pLbColor->SelectEntryPos( _nPos );
                         ClickColorHdl_Impl();
                     break;
+                    default: break;
                 }
             }
-            m_nPageType = PT_AREA;
+            m_nPageType = PageType::Area;
         }
     }
 }
@@ -329,7 +330,7 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
         {
             case drawing::FillStyle_GRADIENT:
             {
-                        m_nPageType = PT_GRADIENT;
+                        m_nPageType = PageType::Gradient;
                         m_nPos = m_pLbGradient->GetSelectEntryPos();
                         if( nPosOrig != m_nPos )
                             *m_pnGradientListState |= ChangeType::MODIFIED;
@@ -337,7 +338,7 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
             break;
             case drawing::FillStyle_HATCH:
             {
-                m_nPageType = PT_HATCH;
+                m_nPageType = PageType::Hatch;
                 m_nPos = m_pLbHatching->GetSelectEntryPos();
                 if( nPosOrig != m_nPos )
                     *m_pnHatchingListState |= ChangeType::MODIFIED;
@@ -345,7 +346,7 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
             break;
             case drawing::FillStyle_BITMAP:
             {
-                m_nPageType = PT_BITMAP;
+                m_nPageType = PageType::Bitmap;
                 m_nPos = m_pLbBitmap->GetSelectEntryPos();
                 if( nPosOrig != m_nPos )
                     *m_pnBitmapListState |= ChangeType::MODIFIED;
@@ -353,7 +354,7 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
             break;
             case drawing::FillStyle_SOLID:
             {
-                m_nPageType = PT_COLOR;
+                m_nPageType = PageType::Color;
                 m_nPos = m_pLbColor->GetSelectEntryPos();
                 if( nPosOrig != m_nPos )
                     *m_pnColorListState |= ChangeType::MODIFIED;
@@ -532,7 +533,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
            }
            break;
         }
-        rAttrs->Put (SfxUInt16Item(SID_PAGE_TYPE,m_nPageType));
+        rAttrs->Put (SfxUInt16Item(SID_PAGE_TYPE, (sal_uInt16)m_nPageType));
         rAttrs->Put (SfxUInt16Item(SID_TABPAGE_POS,m_nPos));
     }
 
@@ -914,7 +915,7 @@ void SvxAreaTabPage::PageCreated(const SfxAllItemSet& aSet)
     if (pBitmapListItem)
         SetBitmapList(pBitmapListItem->GetBitmapList());
     if (pPageTypeItem)
-        SetPageType(pPageTypeItem->GetValue());
+        SetPageType((PageType) pPageTypeItem->GetValue());
     if (pDlgTypeItem)
         SetDlgType(pDlgTypeItem->GetValue());
     if (pPosItem)
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 5646ad1..b173550 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -183,12 +183,12 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& )
     {
         *m_pbAreaTP = false;
 
-        if( *m_nPageType == PT_BITMAP && *m_nPos != LISTBOX_ENTRY_NOTFOUND )
+        if( *m_nPageType == PageType::Bitmap && *m_nPos != LISTBOX_ENTRY_NOTFOUND )
         {
             sal_uInt16 nId = m_pBitmapLB->GetItemId( static_cast<size_t>( *m_nPos ) );
             m_pBitmapLB->SelectItem(nId);
         }
-        *m_nPageType = PT_BITMAP;
+        *m_nPageType = PageType::Bitmap;
         *m_nPos = LISTBOX_ENTRY_NOTFOUND;
     }
 }
@@ -207,7 +207,7 @@ bool SvxBitmapTabPage::FillItemSet( SfxItemSet* rAttrs )
 {
     if( m_nDlgType == 0 && !*m_pbAreaTP )
     {
-        if(PT_BITMAP == *m_nPageType)
+        if(PageType::Bitmap == *m_nPageType)
         {
             rAttrs->Put(XFillStyleItem(drawing::FillStyle_BITMAP));
             size_t nPos = m_pBitmapLB->GetSelectItemPos();
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 912d338..b78f6ea 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -59,12 +59,12 @@ using namespace com::sun::star;
 
 struct SvxColorTabPageShadow
 {
-    sal_uInt16 nUnknownType;
+    PageType nUnknownType;
     sal_Int32  nUnknownPos;
     bool   bIsAreaTP;
     ChangeType nChangeType;
     SvxColorTabPageShadow()
-        : nUnknownType( COLORPAGE_UNKNOWN )
+        : nUnknownType( PageType::Unknown )
         , nUnknownPos( LISTBOX_ENTRY_NOTFOUND )
         , bIsAreaTP( false )
         , nChangeType( ChangeType::NONE )
@@ -268,14 +268,14 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
 
         if( pColorList.is() )
         {
-            if( *pPageType == PT_COLOR && *pPos != LISTBOX_ENTRY_NOTFOUND )
+            if( *pPageType == PageType::Color && *pPos != LISTBOX_ENTRY_NOTFOUND )
             {
                 m_pValSetColorList->SelectItem( m_pValSetColorList->GetItemId( static_cast<size_t>(*pPos) ) );
                 const XColorEntry* pEntry = pColorList->GetColor(*pPos);
                 aPreviousColor = pEntry->GetColor();
                 ChangeColor(pEntry->GetColor());
             }
-            else if( *pPageType == PT_COLOR && *pPos == LISTBOX_ENTRY_NOTFOUND )
+            else if( *pPageType == PageType::Color && *pPos == LISTBOX_ENTRY_NOTFOUND )
             {
                 const SfxPoolItem* pPoolItem = nullptr;
                 if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), true, &pPoolItem ) )
@@ -300,7 +300,7 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
 
             SelectValSetHdl_Impl( m_pValSetColorList );
 
-            *pPageType = PT_COLOR;
+            *pPageType = PageType::Color;
             *pPos = LISTBOX_ENTRY_NOTFOUND;
         }
     }
@@ -357,7 +357,7 @@ long SvxColorTabPage::CheckChanges_Impl()
 bool SvxColorTabPage::FillItemSet( SfxItemSet* rSet )
 {
     if( ( nDlgType != 0 ) ||
-        ( *pPageType == PT_COLOR && !*pbAreaTP ) )
+        ( *pPageType == PageType::Color && !*pbAreaTP ) )
     {
         maPaletteManager.AddRecentColor( aCurrentColor );
         rSet->Put( XFillColorItem( OUString(), aCurrentColor ) );
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 7f34359..f63877b 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -235,7 +235,7 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet&  )
             else
                 aString += aURL.getBase();
 
-            if ( *m_pPageType == PT_GRADIENT && *m_pPos != LISTBOX_ENTRY_NOTFOUND )
+            if ( *m_pPageType == PageType::Gradient && *m_pPos != LISTBOX_ENTRY_NOTFOUND )
             {
                 sal_uInt16 nId = m_pGradientLB->GetItemId( static_cast<size_t>( *m_pPos ) );
                 m_pGradientLB->SelectItem( nId );
@@ -243,7 +243,7 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet&  )
             // colors could have been deleted
             ChangeGradientHdl_Impl();
 
-            *m_pPageType = PT_GRADIENT;
+            *m_pPageType = PageType::Gradient;
             *m_pPos = LISTBOX_ENTRY_NOTFOUND;
         }
     }
@@ -326,7 +326,7 @@ long SvxGradientTabPage::CheckChanges_Impl()
 
 bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet )
 {
-    if( m_nDlgType == 0 && *m_pPageType == PT_GRADIENT && !*m_pbAreaTP )
+    if( m_nDlgType == 0 && *m_pPageType == PageType::Gradient && !*m_pbAreaTP )
     {
         // CheckChanges(); <-- duplicate inquiry ?
 
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 2c59788..7c8a6f7 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -209,7 +209,7 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
             else
                 aString += aURL.getBase();
 
-            if( *m_pPageType == PT_HATCH && *m_pPos != LISTBOX_ENTRY_NOTFOUND )
+            if( *m_pPageType == PageType::Hatch && *m_pPos != LISTBOX_ENTRY_NOTFOUND )
             {
                 sal_uInt16 nId = m_pHatchLB->GetItemId( static_cast<size_t>( *m_pPos ) );
                 m_pHatchLB->SelectItem( nId );
@@ -217,7 +217,7 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
             // colors could have been deleted
             ChangeHatchHdl_Impl();
 
-            *m_pPageType = PT_HATCH;
+            *m_pPageType = PageType::Hatch;
             *m_pPos = LISTBOX_ENTRY_NOTFOUND;
         }
     }
@@ -331,7 +331,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet )
 {
     if( m_nDlgType == 0 && !*m_pbAreaTP ) // area dialog
     {
-        if( *m_pPageType == PT_HATCH )
+        if( *m_pPageType == PageType::Hatch )
         {
             // CheckChanges(); <-- duplicate inquiry ?
 
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index f3cfa03..85d02b3 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -51,6 +51,7 @@
 #include <svx/dialmgr.hxx>
 #include <svx/dialogs.hrc>
 #include <vcl/settings.hxx>
+#include <cuitabarea.hxx>
 
 #define MAX_BMP_WIDTH   16
 #define MAX_BMP_HEIGHT  16
@@ -103,7 +104,7 @@ SvxLineTabPage::SvxLineTabPage
      m_pnLineEndListState( nullptr ),
     m_pnDashListState( nullptr ),
     m_pnColorListState( nullptr ),
-    m_nPageType           ( 0 ),
+    m_nPageType( PageType::Area ),
 
     m_nDlgType(0),
     m_pPosDashLb(nullptr),
@@ -555,7 +556,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
 {
     const CntUInt16Item* pPageTypeItem = rSet.GetItem<CntUInt16Item>(SID_PAGE_TYPE, false);
     if (pPageTypeItem)
-        SetPageType(pPageTypeItem->GetValue());
+        SetPageType((PageType) pPageTypeItem->GetValue());
     if( m_nDlgType == 0 && m_pDashList.is() )
     {
         sal_Int32 nPos;
@@ -634,12 +635,12 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
         // Evaluate if another TabPage set another fill type
         if( m_pLbLineStyle->GetSelectEntryPos() != 0 )
         {
-            if( m_nPageType == 2 ) // 1
+            if( m_nPageType == PageType::Hatch ) // 1
             {
                 m_pLbLineStyle->SelectEntryPos( *m_pPosDashLb + 2 ); // +2 due to SOLID and INVISIBLE
                 ChangePreviewHdl_Impl( nullptr );
             }
-            if( m_nPageType == 3 )
+            if( m_nPageType == PageType::Bitmap )
             {
                 m_pLbStartStyle->SelectEntryPos( *m_pPosLineEndLb + 1 );// +1 due to SOLID
                 m_pLbEndStyle->SelectEntryPos( *m_pPosLineEndLb + 1 );// +1 due to SOLID
@@ -667,7 +668,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
                 ChangePreviewHdl_Impl( nullptr );
             }
 
-        m_nPageType = 0;
+        m_nPageType = PageType::Area;
     }
     // Page does not yet exist in the ctor, that's why we do it here!
 
@@ -684,7 +685,7 @@ DeactivateRC SvxLineTabPage::DeactivatePage( SfxItemSet* _pSet )
 {
     if( m_nDlgType == 0 ) // Line dialog
     {
-        m_nPageType = 1; // possibly for extensions
+        m_nPageType = PageType::Gradient; // possibly for extensions
         *m_pPosDashLb = m_pLbLineStyle->GetSelectEntryPos() - 2;// First entry SOLID!!!
         sal_Int32 nPos = m_pLbStartStyle->GetSelectEntryPos();
         if( nPos != LISTBOX_ENTRY_NOTFOUND )
@@ -706,7 +707,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
     bool    bModified = false;
 
     // To prevent modifications to the list, we do not set other page's items.
-    if( m_nDlgType != 0 || m_nPageType != 2 )
+    if( m_nDlgType != 0 || m_nPageType != PageType::Hatch )
     {
         nPos = m_pLbLineStyle->GetSelectEntryPos();
         if( nPos != LISTBOX_ENTRY_NOTFOUND &&
@@ -790,7 +791,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
         }
     }
 
-    if( m_nDlgType != 0 || m_nPageType != 3 )
+    if( m_nDlgType != 0 || m_nPageType != PageType::Bitmap )
     {
         // Line start
         nPos = m_pLbStartStyle->GetSelectEntryPos();
@@ -978,7 +979,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
             }
         }
     }
-    rAttrs->Put (CntUInt16Item(SID_PAGE_TYPE,m_nPageType));
+    rAttrs->Put (CntUInt16Item(SID_PAGE_TYPE, (sal_uInt16)m_nPageType));
     return bModified;
 }
 
@@ -1811,7 +1812,7 @@ void SvxLineTabPage::PageCreated(const SfxAllItemSet& aSet)
     if (pLineEndListItem)
         SetLineEndList(pLineEndListItem->GetLineEndList());
     if (pPageTypeItem)
-        SetPageType(pPageTypeItem->GetValue());
+        SetPageType((PageType) pPageTypeItem->GetValue());
     if (pDlgTypeItem)
         SetDlgType(pDlgTypeItem->GetValue());
     Construct();
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index b4282df..0620d44 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -43,6 +43,7 @@

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list