[Libreoffice-commits] core.git: 9 commits - compilerplugins/clang sdext/source sd/inc sd/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Feb 15 08:01:12 UTC 2017


 compilerplugins/clang/unusedenumconstants.py                  |    4 
 sd/inc/CustomAnimationEffect.hxx                              |    2 
 sd/inc/pres.hxx                                               |    1 
 sd/source/core/CustomAnimationEffect.cxx                      |   79 +---------
 sd/source/core/sdpage.cxx                                     |    1 
 sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx    |    2 
 sd/source/ui/animations/CustomAnimationPane.cxx               |   36 ++--
 sd/source/ui/func/fucon3d.cxx                                 |    2 
 sd/source/ui/func/fuconarc.cxx                                |    2 
 sd/source/ui/func/fuconcs.cxx                                 |    2 
 sd/source/ui/func/fuconrec.cxx                                |    2 
 sd/source/ui/func/fuconuno.cxx                                |    2 
 sd/source/ui/func/fuediglu.cxx                                |    2 
 sd/source/ui/func/futext.cxx                                  |    4 
 sd/source/ui/inc/EventMultiplexer.hxx                         |    4 
 sd/source/ui/inc/ToolBarManager.hxx                           |   17 --
 sd/source/ui/sidebar/AllMasterPagesSelector.cxx               |    5 
 sd/source/ui/sidebar/MasterPageContainer.cxx                  |   12 -
 sd/source/ui/sidebar/MasterPageContainer.hxx                  |    4 
 sd/source/ui/sidebar/MasterPageDescriptor.cxx                 |    6 
 sd/source/ui/sidebar/MasterPagesSelector.cxx                  |    8 -
 sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx              |    7 
 sd/source/ui/slidesorter/controller/SlideSorterController.cxx |    4 
 sd/source/ui/slidesorter/controller/SlsFocusManager.cxx       |   12 -
 sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx  |    8 -
 sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx   |   16 --
 sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx   |    6 
 sd/source/ui/slidesorter/inc/view/SlsTheme.hxx                |    5 
 sd/source/ui/slidesorter/view/SlsLayouter.cxx                 |    4 
 sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx       |   21 +-
 sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx        |   26 +--
 sd/source/ui/slidesorter/view/SlsTheme.cxx                    |   10 -
 sd/source/ui/slidesorter/view/SlsToolTip.cxx                  |    2 
 sd/source/ui/unoidl/unopage.cxx                               |    1 
 sd/source/ui/view/ToolBarManager.cxx                          |   64 +++-----
 sd/source/ui/view/drawview.cxx                                |    1 
 sd/source/ui/view/drviews1.cxx                                |    8 -
 sd/source/ui/view/sdview5.cxx                                 |    1 
 sdext/source/presenter/PresenterToolBar.cxx                   |    1 
 sdext/source/presenter/PresenterToolBar.hxx                   |    2 
 40 files changed, 149 insertions(+), 247 deletions(-)

New commits:
commit 60542769488cbf31339e86dc2688a064c6e07917
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 15 09:45:57 2017 +0200

    convert EValue to scoped enum
    
    and drop unused enumerators
    
    Change-Id: I22629ee4a514053030d7120ee8a8fb8145163fad

diff --git a/sd/inc/CustomAnimationEffect.hxx b/sd/inc/CustomAnimationEffect.hxx
index deda3a4..187437f 100644
--- a/sd/inc/CustomAnimationEffect.hxx
+++ b/sd/inc/CustomAnimationEffect.hxx
@@ -38,7 +38,7 @@ class SdrPathObj;
 
 namespace sd {
 
-enum EValue { VALUE_FROM, VALUE_TO, VALUE_BY, VALUE_FIRST, VALUE_LAST };
+enum class EValue { To, By };
 
 class CustomAnimationEffect;
 
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx
index 886700a..230900a 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -1151,17 +1151,8 @@ Any CustomAnimationEffect::getProperty( sal_Int32 nNodeType, const OUString& rAt
                         {
                             switch( eValue )
                             {
-                            case VALUE_FROM: aProperty = xAnimate->getFrom(); break;
-                            case VALUE_TO:   aProperty = xAnimate->getTo(); break;
-                            case VALUE_BY:   aProperty = xAnimate->getBy(); break;
-                            case VALUE_FIRST:
-                            case VALUE_LAST:
-                                {
-                                    Sequence<Any> aValues( xAnimate->getValues() );
-                                    if( aValues.hasElements() )
-                                        aProperty =  aValues[ eValue == VALUE_FIRST ? 0 : aValues.getLength() - 1 ];
-                                }
-                                break;
+                            case EValue::To:   aProperty = xAnimate->getTo(); break;
+                            case EValue::By:   aProperty = xAnimate->getBy(); break;
                             }
                         }
                     }
@@ -1200,43 +1191,20 @@ bool CustomAnimationEffect::setProperty( sal_Int32 nNodeType, const OUString& rA
                         {
                             switch( eValue )
                             {
-                            case VALUE_FROM:
-                                if( xAnimate->getFrom() != rValue )
-                                {
-                                    xAnimate->setFrom( rValue );
-                                    bChanged = true;
-                                }
-                                break;
-                            case VALUE_TO:
+                            case EValue::To:
                                 if( xAnimate->getTo() != rValue )
                                 {
                                     xAnimate->setTo( rValue );
                                     bChanged = true;
                                 }
                                 break;
-                            case VALUE_BY:
+                            case EValue::By:
                                 if( xAnimate->getTo() != rValue )
                                 {
                                     xAnimate->setBy( rValue );
                                     bChanged = true;
                                 }
                                 break;
-                            case VALUE_FIRST:
-                            case VALUE_LAST:
-                                {
-                                    Sequence<Any> aValues( xAnimate->getValues() );
-                                    if( !aValues.hasElements() )
-                                        aValues.realloc(1);
-
-                                    sal_Int32 nIndex = eValue == VALUE_FIRST ? 0 : aValues.getLength() - 1;
-
-                                    if( aValues[ nIndex ] != rValue )
-                                    {
-                                        aValues[ nIndex ] = rValue;
-                                        xAnimate->setValues( aValues );
-                                        bChanged = true;
-                                    }
-                                }
                             }
                         }
                     }
@@ -1378,17 +1346,8 @@ Any CustomAnimationEffect::getTransformationProperty( sal_Int32 nTransformType,
                     {
                         switch( eValue )
                         {
-                        case VALUE_FROM: aProperty = xTransform->getFrom(); break;
-                        case VALUE_TO:   aProperty = xTransform->getTo(); break;
-                        case VALUE_BY:   aProperty = xTransform->getBy(); break;
-                        case VALUE_FIRST:
-                        case VALUE_LAST:
-                            {
-                                Sequence<Any> aValues( xTransform->getValues() );
-                                if( aValues.hasElements() )
-                                    aProperty =  aValues[ eValue == VALUE_FIRST ? 0 : aValues.getLength() - 1 ];
-                            }
-                            break;
+                        case EValue::To:   aProperty = xTransform->getTo(); break;
+                        case EValue::By:   aProperty = xTransform->getBy(); break;
                         }
                     }
                 }
@@ -1424,42 +1383,20 @@ bool CustomAnimationEffect::setTransformationProperty( sal_Int32 nTransformType,
                     {
                         switch( eValue )
                         {
-                        case VALUE_FROM:
-                            if( xTransform->getFrom() != rValue )
-                            {
-                                xTransform->setFrom( rValue );
-                                bChanged = true;
-                            }
-                            break;
-                        case VALUE_TO:
+                        case EValue::To:
                             if( xTransform->getTo() != rValue )
                             {
                                 xTransform->setTo( rValue );
                                 bChanged = true;
                             }
                             break;
-                        case VALUE_BY:
+                        case EValue::By:
                             if( xTransform->getBy() != rValue )
                             {
                                 xTransform->setBy( rValue );
                                 bChanged = true;
                             }
                             break;
-                        case VALUE_FIRST:
-                        case VALUE_LAST:
-                            {
-                                Sequence<Any> aValues( xTransform->getValues() );
-                                if( !aValues.hasElements() )
-                                    aValues.realloc(1);
-
-                                sal_Int32 nIndex = eValue == VALUE_FIRST ? 0 : aValues.getLength() - 1;
-                                if( aValues[nIndex] != rValue )
-                                {
-                                    aValues[nIndex] = rValue;
-                                    xTransform->setValues( aValues );
-                                    bChanged = true;
-                                }
-                            }
                         }
                     }
                 }
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 093b0df..1803799 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -1001,32 +1001,32 @@ Any CustomAnimationPane::getProperty1Value( sal_Int32 nType, const CustomAnimati
         }
 
     case nPropertyTypeFont:
-        return pEffect->getProperty( AnimationNodeType::SET, "CharFontName" , VALUE_TO );
+        return pEffect->getProperty( AnimationNodeType::SET, "CharFontName" , EValue::To );
 
     case nPropertyTypeCharHeight:
         {
             const OUString aAttributeName( "CharHeight" );
-            Any aValue( pEffect->getProperty( AnimationNodeType::SET, aAttributeName, VALUE_TO ) );
+            Any aValue( pEffect->getProperty( AnimationNodeType::SET, aAttributeName, EValue::To ) );
             if( !aValue.hasValue() )
-                aValue = pEffect->getProperty( AnimationNodeType::ANIMATE, aAttributeName, VALUE_TO );
+                aValue = pEffect->getProperty( AnimationNodeType::ANIMATE, aAttributeName, EValue::To );
             return aValue;
         }
 
     case nPropertyTypeRotate:
-        return pEffect->getTransformationProperty( AnimationTransformType::ROTATE, VALUE_BY);
+        return pEffect->getTransformationProperty( AnimationTransformType::ROTATE, EValue::By);
 
     case nPropertyTypeTransparency:
-        return pEffect->getProperty( AnimationNodeType::SET, "Opacity" , VALUE_TO );
+        return pEffect->getProperty( AnimationNodeType::SET, "Opacity" , EValue::To );
 
     case nPropertyTypeScale:
-        return pEffect->getTransformationProperty( AnimationTransformType::SCALE, VALUE_BY );
+        return pEffect->getTransformationProperty( AnimationTransformType::SCALE, EValue::By );
 
     case nPropertyTypeCharDecoration:
         {
             Sequence< Any > aValues(3);
-            aValues[0] = pEffect->getProperty( AnimationNodeType::SET, "CharWeight" , VALUE_TO );
-            aValues[1] = pEffect->getProperty( AnimationNodeType::SET, "CharPosture" , VALUE_TO );
-            aValues[2] = pEffect->getProperty( AnimationNodeType::SET, "CharUnderline" , VALUE_TO );
+            aValues[0] = pEffect->getProperty( AnimationNodeType::SET, "CharWeight" , EValue::To );
+            aValues[1] = pEffect->getProperty( AnimationNodeType::SET, "CharPosture" , EValue::To );
+            aValues[2] = pEffect->getProperty( AnimationNodeType::SET, "CharUnderline" , EValue::To );
             return makeAny( aValues );
         }
     }
@@ -1072,36 +1072,36 @@ bool CustomAnimationPane::setProperty1Value( sal_Int32 nType, const CustomAnimat
         break;
 
     case nPropertyTypeFont:
-        bEffectChanged = pEffect->setProperty( AnimationNodeType::SET, "CharFontName" , VALUE_TO, rValue );
+        bEffectChanged = pEffect->setProperty( AnimationNodeType::SET, "CharFontName" , EValue::To, rValue );
         break;
 
     case nPropertyTypeCharHeight:
         {
             const OUString aAttributeName( "CharHeight" );
-            bEffectChanged = pEffect->setProperty( AnimationNodeType::SET, aAttributeName, VALUE_TO, rValue );
+            bEffectChanged = pEffect->setProperty( AnimationNodeType::SET, aAttributeName, EValue::To, rValue );
             if( !bEffectChanged )
-                bEffectChanged = pEffect->setProperty( AnimationNodeType::ANIMATE, aAttributeName, VALUE_TO, rValue );
+                bEffectChanged = pEffect->setProperty( AnimationNodeType::ANIMATE, aAttributeName, EValue::To, rValue );
         }
         break;
     case nPropertyTypeRotate:
-        bEffectChanged = pEffect->setTransformationProperty( AnimationTransformType::ROTATE, VALUE_BY , rValue );
+        bEffectChanged = pEffect->setTransformationProperty( AnimationTransformType::ROTATE, EValue::By , rValue );
         break;
 
     case nPropertyTypeTransparency:
-        bEffectChanged = pEffect->setProperty( AnimationNodeType::SET, "Opacity" , VALUE_TO, rValue );
+        bEffectChanged = pEffect->setProperty( AnimationNodeType::SET, "Opacity" , EValue::To, rValue );
         break;
 
     case nPropertyTypeScale:
-        bEffectChanged = pEffect->setTransformationProperty( AnimationTransformType::SCALE, VALUE_BY, rValue );
+        bEffectChanged = pEffect->setTransformationProperty( AnimationTransformType::SCALE, EValue::By, rValue );
         break;
 
     case nPropertyTypeCharDecoration:
         {
             Sequence< Any > aValues(3);
             rValue >>= aValues;
-            bEffectChanged = pEffect->setProperty( AnimationNodeType::SET, "CharWeight" , VALUE_TO, aValues[0] );
-            bEffectChanged |= pEffect->setProperty( AnimationNodeType::SET, "CharPosture" , VALUE_TO, aValues[1] );
-            bEffectChanged |= pEffect->setProperty( AnimationNodeType::SET, "CharUnderline" , VALUE_TO, aValues[2] );
+            bEffectChanged = pEffect->setProperty( AnimationNodeType::SET, "CharWeight" , EValue::To, aValues[0] );
+            bEffectChanged |= pEffect->setProperty( AnimationNodeType::SET, "CharPosture" , EValue::To, aValues[1] );
+            bEffectChanged |= pEffect->setProperty( AnimationNodeType::SET, "CharUnderline" , EValue::To, aValues[2] );
         }
         break;
 
commit 12b2803f196b897ffb901b0eebe271c5ee43d03e
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 15 09:36:42 2017 +0200

    drop unused PRESOBJ_IMAGE
    
    Change-Id: I8fa011bea423e961a3ebe7cd8687e4bce7c4cd77

diff --git a/compilerplugins/clang/unusedenumconstants.py b/compilerplugins/clang/unusedenumconstants.py
index e86bc13..4d45a42 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -111,6 +111,7 @@ for d in definitionSet:
          "include/svx/msdffdef.hxx",
          "include/svtools/rtftoken.h", # RTF_TOKEN_IDS
          "starmath/source/mathtype.hxx", # MathType::MTOKENS
+         "sd/source/filter/eppt/epptbase.hxx", # PPTExTextAttr
         # unit test code
          "cppu/source/uno/check.cxx",
         # general weird nonsense going on
@@ -150,6 +151,9 @@ for d in definitionSet:
          "include/svx/sxekitm.hxx", # SdrEdgeKind (from UI)
          "include/svx/paraprev.hxx", # SvxPrevLineSpace (from UI)
          "include/svx/ctredlin.hxx", # SvxRedlinDateMode (from UI)
+         "sd/source/ui/inc/animobjs.hxx", # BitmapAdjustment (from UI)
+         "sd/source/ui/dlg/PhotoAlbumDialog.hxx", # SlideImageLayout (from UI)
+         "sd/inc/pres.hxx", # AutoLayout (from UI)
         # represents constants from an external API
          "opencl/inc/opencl_device_selection.h",
          "vcl/inc/sft.hxx",
diff --git a/sd/inc/pres.hxx b/sd/inc/pres.hxx
index 793440c..c43eb8f 100644
--- a/sd/inc/pres.hxx
+++ b/sd/inc/pres.hxx
@@ -30,7 +30,6 @@ enum PresObjKind
     PRESOBJ_CHART,
     PRESOBJ_ORGCHART,
     PRESOBJ_TABLE,
-    PRESOBJ_IMAGE,
     PRESOBJ_PAGE,
     PRESOBJ_HANDOUT,
     PRESOBJ_NOTES,
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 6fb1ae9..e21b6fd 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -189,7 +189,6 @@ SdrObject* SdPage::GetPresObj(PresObjKind eObjKind, int nIndex, bool bFuzzySearc
                 case PRESOBJ_ORGCHART:
                 case PRESOBJ_TABLE:
                 case PRESOBJ_CALC:
-                case PRESOBJ_IMAGE:
                 case PRESOBJ_MEDIA:
                     bFound = true;
                     break;
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 8f0c039..3b7eb5c 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -1490,7 +1490,6 @@ Reference< drawing::XShape >  SdGenericDrawPage::CreateShape(SdrObject *pObj) co
                 break;
             // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
             case PRESOBJ_NONE:
-            case PRESOBJ_IMAGE:
             case PRESOBJ_MAX:
                 break;
             }
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index 0688cef..a5e2a3b 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -550,7 +550,6 @@ void DrawView::DeleteMarked()
                     case PRESOBJ_ORGCHART:
                     case PRESOBJ_TABLE:
                     case PRESOBJ_CALC:
-                    case PRESOBJ_IMAGE:
                     case PRESOBJ_MEDIA:
                         ePresObjKind = PRESOBJ_OUTLINE;
                         break;
diff --git a/sd/source/ui/view/sdview5.cxx b/sd/source/ui/view/sdview5.cxx
index d05f64c..4e0a340 100644
--- a/sd/source/ui/view/sdview5.cxx
+++ b/sd/source/ui/view/sdview5.cxx
@@ -33,7 +33,6 @@ static bool implIsMultiPresObj( PresObjKind eKind )
     case PRESOBJ_CHART:
     case PRESOBJ_ORGCHART:
     case PRESOBJ_TABLE:
-    case PRESOBJ_IMAGE:
     case PRESOBJ_MEDIA:
         return true;
     default:
commit 87f3fd05eb2e8ca3a0cdf449d3e2c66cfd3a57bf
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 15 09:20:41 2017 +0200

    drop unused PaneManagerDying enumerator
    
    Change-Id: I4b17d19b5f1f84df38cbb5372ca2d0b425f22698

diff --git a/sd/source/ui/inc/EventMultiplexer.hxx b/sd/source/ui/inc/EventMultiplexer.hxx
index 45e8e8f..0878c16 100644
--- a/sd/source/ui/inc/EventMultiplexer.hxx
+++ b/sd/source/ui/inc/EventMultiplexer.hxx
@@ -71,10 +71,6 @@ enum class EventMultiplexerEventId
     */
     ViewAdded,
 
-    /** The PaneManager is being destroyed.
-    */
-    PaneManagerDying,
-
     /** Edit mode was (or is being) switched to normal mode.  Find
         EventId::EditModeMaster below.
     */
diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx
index a03b83d..030bf6b 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -870,10 +870,6 @@ IMPL_LINK(ToolBarManager::Implementation,EventMultiplexerCallback,
             SetValid(false);
             break;
 
-        case EventMultiplexerEventId::PaneManagerDying:
-            SetValid(false);
-            break;
-
         default: break;
     }
 }
commit f360ff06973b1503029923df25b691a4c6c6a320
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 15 09:18:05 2017 +0200

    convert ToolBarGroup to scoped enum
    
    Change-Id: I5d22dacca911211b1ebe20d86eb332db9de0cdba

diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx
index 22480c2..3695009 100644
--- a/sd/source/ui/func/fucon3d.cxx
+++ b/sd/source/ui/func/fucon3d.cxx
@@ -76,7 +76,7 @@ void FuConstruct3dObject::DoExecute( SfxRequest& rReq )
 {
     FuConstruct::DoExecute( rReq );
     mpViewShell->GetViewShellBase().GetToolBarManager()->SetToolBar(
-        ToolBarManager::TBG_FUNCTION,
+        ToolBarManager::ToolBarGroup::Function,
         ToolBarManager::msDrawingObjectToolBar);
 }
 
diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx
index 547bcf3..c71454d 100644
--- a/sd/source/ui/func/fuconarc.cxx
+++ b/sd/source/ui/func/fuconarc.cxx
@@ -70,7 +70,7 @@ void FuConstructArc::DoExecute( SfxRequest& rReq )
     FuConstruct::DoExecute( rReq );
 
     mpViewShell->GetViewShellBase().GetToolBarManager()->SetToolBar(
-        ToolBarManager::TBG_FUNCTION,
+        ToolBarManager::ToolBarGroup::Function,
         ToolBarManager::msDrawingObjectToolBar);
 
     const SfxItemSet *pArgs = rReq.GetArgs ();
diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx
index 782ade0..95eaad9 100644
--- a/sd/source/ui/func/fuconcs.cxx
+++ b/sd/source/ui/func/fuconcs.cxx
@@ -99,7 +99,7 @@ void FuConstructCustomShape::DoExecute( SfxRequest& rReq )
     }
 
     mpViewShell->GetViewShellBase().GetToolBarManager()->SetToolBar(
-        ToolBarManager::TBG_FUNCTION,
+        ToolBarManager::ToolBarGroup::Function,
         ToolBarManager::msDrawingObjectToolBar);
 }
 
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index 5555593..4551bc7 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -89,7 +89,7 @@ void FuConstructRectangle::DoExecute( SfxRequest& rReq )
     FuConstruct::DoExecute( rReq );
 
     mpViewShell->GetViewShellBase().GetToolBarManager()->SetToolBar(
-        ToolBarManager::TBG_FUNCTION,
+        ToolBarManager::ToolBarGroup::Function,
         ToolBarManager::msDrawingObjectToolBar);
 
     const SfxItemSet *pArgs = rReq.GetArgs ();
diff --git a/sd/source/ui/func/fuconuno.cxx b/sd/source/ui/func/fuconuno.cxx
index 2632a7a..75dfd78 100644
--- a/sd/source/ui/func/fuconuno.cxx
+++ b/sd/source/ui/func/fuconuno.cxx
@@ -75,7 +75,7 @@ void FuConstructUnoControl::DoExecute( SfxRequest& rReq )
         nIdentifier = pIdentifierItem->GetValue();
 
     mpViewShell->GetViewShellBase().GetToolBarManager()->SetToolBar(
-        ToolBarManager::TBG_FUNCTION,
+        ToolBarManager::ToolBarGroup::Function,
         ToolBarManager::msDrawingObjectToolBar);
 }
 
diff --git a/sd/source/ui/func/fuediglu.cxx b/sd/source/ui/func/fuediglu.cxx
index 472779d..f757691 100644
--- a/sd/source/ui/func/fuediglu.cxx
+++ b/sd/source/ui/func/fuediglu.cxx
@@ -65,7 +65,7 @@ void FuEditGluePoints::DoExecute( SfxRequest& rReq )
     FuDraw::DoExecute( rReq );
     mpView->SetInsGluePointMode(false);
     mpViewShell->GetViewShellBase().GetToolBarManager()->AddToolBar(
-        ToolBarManager::TBG_FUNCTION,
+        ToolBarManager::ToolBarGroup::Function,
         ToolBarManager::msGluePointsToolBar);
 }
 
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index fa74577..af010ca 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -186,7 +186,7 @@ void FuText::disposing()
 void FuText::DoExecute( SfxRequest& )
 {
     mpViewShell->GetViewShellBase().GetToolBarManager()->SetToolBarShell(
-        ToolBarManager::TBG_FUNCTION,
+        ToolBarManager::ToolBarGroup::Function,
         RID_DRAW_TEXT_TOOLBOX);
 
     mpView->SetCurrentObj(OBJ_TEXT);
@@ -225,7 +225,7 @@ void FuText::DoExecute( SfxRequest& )
             SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
             if( pObj && (pObj->GetObjInventor() == SdrInventor::Default ) && (pObj->GetObjIdentifier() == OBJ_TABLE) )
             {
-                mpViewShell->GetViewShellBase().GetToolBarManager()->AddToolBarShell( ToolBarManager::TBG_FUNCTION, RID_DRAW_TABLE_TOOLBOX );
+                mpViewShell->GetViewShellBase().GetToolBarManager()->AddToolBarShell( ToolBarManager::ToolBarGroup::Function, RID_DRAW_TABLE_TOOLBOX );
             }
         }
     }
diff --git a/sd/source/ui/inc/ToolBarManager.hxx b/sd/source/ui/inc/ToolBarManager.hxx
index d9bf41b..4ec1928 100644
--- a/sd/source/ui/inc/ToolBarManager.hxx
+++ b/sd/source/ui/inc/ToolBarManager.hxx
@@ -93,7 +93,7 @@ public:
     void MainViewShellChanged (const ViewShell& rMainViewShell);
 
     /** Call this method when the selection has changed to update the more
-        temporary tool bars (those in the TBG_FUNCTION group.)
+        temporary tool bars (those in the ToolBarGroup::Function group.)
     */
     void SelectionHasChanged (
         const ViewShell& rViewShell,
@@ -119,15 +119,12 @@ public:
 
     /** The set of tool bar groups.
     */
-    enum ToolBarGroup {
-        TBG_FIRST,
-
-        TBG_PERMANENT = TBG_FIRST,
-        TBG_FUNCTION,
-        TBG_COMMON_TASK,
-        TBG_MASTER_MODE,
-
-        TBG_LAST = TBG_MASTER_MODE
+    enum class ToolBarGroup {
+        Permanent,
+        Function,
+        CommonTask,
+        MasterMode,
+        LAST = MasterMode
     };
 
     /** Reset the set of visible object bars in the specified group.  Tool
diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx
index ec89188..a03b83d 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -28,6 +28,7 @@
 #include <com/sun/star/ui/UIElementType.hpp>
 
 #include <osl/mutex.hxx>
+#include <o3tl/enumrange.hxx>
 #include <rtl/ref.hxx>
 #include <sfx2/app.hxx>
 #include <sfx2/docfile.hxx>
@@ -193,16 +194,16 @@ public:
     void Update (ViewShellBase& rBase);
 
     /** Reset all tool bars in all groups and add tool bars and tool bar
-        shells to the TBG_PERMANENT group for the specified ViewShell type.
+        shells to the ToolBarGroup::Permanent group for the specified ViewShell type.
     */
     void MainViewShellChanged (ViewShell::ShellType nShellType);
 
     /** Reset all tool bars in all groups and add tool bars and tool bar
-        shells to the TBG_PERMANENT group for the specified ViewShell.
+        shells to the ToolBarGroup::Permanent group for the specified ViewShell.
     */
     void MainViewShellChanged (const ViewShell& rMainViewShell);
 
-    /** Reset all tool bars in the TBG_FUNCTION group and add tool bars and tool bar
+    /** Reset all tool bars in the ToolBarGroup::Function group and add tool bars and tool bar
         shells to this group for the current selection.
     */
     void SelectionHasChanged (
@@ -604,8 +605,8 @@ void ToolBarManager::Implementation::ResetToolBars (ToolBarGroup eGroup)
 void ToolBarManager::Implementation::ResetAllToolBars()
 {
     SAL_INFO("sd.view", OSL_THIS_FUNC << ": resetting all tool bars");
-    for (int i=TBG_FIRST; i<=TBG_LAST; ++i)
-        ResetToolBars((ToolBarGroup)i);
+    for (auto i : o3tl::enumrange<ToolBarGroup>())
+        ResetToolBars(i);
 }
 
 void ToolBarManager::Implementation::AddToolBar (
@@ -980,48 +981,48 @@ void ToolBarRules::MainViewShellChanged (ViewShell::ShellType nShellType)
         case ::sd::ViewShell::ST_NOTES:
         case ::sd::ViewShell::ST_HANDOUT:
             mpToolBarManager->AddToolBar(
-                ToolBarManager::TBG_PERMANENT,
+                ToolBarManager::ToolBarGroup::Permanent,
                 ToolBarManager::msToolBar);
             mpToolBarManager->AddToolBar(
-                ToolBarManager::TBG_PERMANENT,
+                ToolBarManager::ToolBarGroup::Permanent,
                 ToolBarManager::msOptionsToolBar);
             mpToolBarManager->AddToolBar(
-                ToolBarManager::TBG_PERMANENT,
+                ToolBarManager::ToolBarGroup::Permanent,
                 ToolBarManager::msViewerToolBar);
             break;
 
         case ::sd::ViewShell::ST_DRAW:
             mpToolBarManager->AddToolBar(
-                ToolBarManager::TBG_PERMANENT,
+                ToolBarManager::ToolBarGroup::Permanent,
                 ToolBarManager::msToolBar);
             mpToolBarManager->AddToolBar(
-                ToolBarManager::TBG_PERMANENT,
+                ToolBarManager::ToolBarGroup::Permanent,
                 ToolBarManager::msOptionsToolBar);
             mpToolBarManager->AddToolBar(
-                ToolBarManager::TBG_PERMANENT,
+                ToolBarManager::ToolBarGroup::Permanent,
                 ToolBarManager::msViewerToolBar);
             break;
 
         case ViewShell::ST_OUTLINE:
             mpToolBarManager->AddToolBar(
-                ToolBarManager::TBG_PERMANENT,
+                ToolBarManager::ToolBarGroup::Permanent,
                 ToolBarManager::msOutlineToolBar);
             mpToolBarManager->AddToolBar(
-                ToolBarManager::TBG_PERMANENT,
+                ToolBarManager::ToolBarGroup::Permanent,
                 ToolBarManager::msViewerToolBar);
             mpToolBarManager->AddToolBarShell(
-                ToolBarManager::TBG_PERMANENT, RID_DRAW_TEXT_TOOLBOX);
+                ToolBarManager::ToolBarGroup::Permanent, RID_DRAW_TEXT_TOOLBOX);
             break;
 
         case ViewShell::ST_SLIDE_SORTER:
             mpToolBarManager->AddToolBar(
-                ToolBarManager::TBG_PERMANENT,
+                ToolBarManager::ToolBarGroup::Permanent,
                 ToolBarManager::msViewerToolBar);
             mpToolBarManager->AddToolBar(
-                ToolBarManager::TBG_PERMANENT,
+                ToolBarManager::ToolBarGroup::Permanent,
                 ToolBarManager::msSlideSorterToolBar);
             mpToolBarManager->AddToolBar(
-                ToolBarManager::TBG_PERMANENT,
+                ToolBarManager::ToolBarGroup::Permanent,
                 ToolBarManager::msSlideSorterObjectBar);
             break;
 
@@ -1051,11 +1052,11 @@ void ToolBarRules::MainViewShellChanged (const ViewShell& rMainViewShell)
             {
                 if (pDrawViewShell->GetEditMode() == EditMode::MasterPage)
                     mpToolBarManager->AddToolBar(
-                        ToolBarManager::TBG_MASTER_MODE,
+                        ToolBarManager::ToolBarGroup::MasterMode,
                         ToolBarManager::msMasterViewToolBar);
                 else if ( rMainViewShell.GetShellType() != ::sd::ViewShell::ST_DRAW )
                     mpToolBarManager->AddToolBar(
-                        ToolBarManager::TBG_COMMON_TASK,
+                        ToolBarManager::ToolBarGroup::CommonTask,
                         ToolBarManager::msCommonTaskToolBar);
             }
             break;
@@ -1074,22 +1075,22 @@ void ToolBarRules::SelectionHasChanged (
     mpToolBarManager->LockViewShellManager();
     bool bTextEdit = rView.IsTextEdit();
 
-    mpToolBarManager->ResetToolBars(ToolBarManager::TBG_FUNCTION);
+    mpToolBarManager->ResetToolBars(ToolBarManager::ToolBarGroup::Function);
 
     switch (rView.GetContext())
     {
         case SdrViewContext::Graphic:
             if( !bTextEdit )
-                mpToolBarManager->SetToolBarShell(ToolBarManager::TBG_FUNCTION, RID_DRAW_GRAF_TOOLBOX);
+                mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function, RID_DRAW_GRAF_TOOLBOX);
             break;
 
         case SdrViewContext::Media:
             if( !bTextEdit )
-                mpToolBarManager->SetToolBarShell(ToolBarManager::TBG_FUNCTION, RID_DRAW_MEDIA_TOOLBOX);
+                mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function, RID_DRAW_MEDIA_TOOLBOX);
             break;
 
         case SdrViewContext::Table:
-            mpToolBarManager->SetToolBarShell(ToolBarManager::TBG_FUNCTION, RID_DRAW_TABLE_TOOLBOX);
+            mpToolBarManager->SetToolBarShell(ToolBarManager::ToolBarGroup::Function, RID_DRAW_TABLE_TOOLBOX);
             bTextEdit = true;
             break;
 
@@ -1104,7 +1105,7 @@ void ToolBarRules::SelectionHasChanged (
                     case ::sd::ViewShell::ST_NOTES:
                     case ::sd::ViewShell::ST_HANDOUT:
                         mpToolBarManager->SetToolBar(
-                            ToolBarManager::TBG_FUNCTION,
+                            ToolBarManager::ToolBarGroup::Function,
                             ToolBarManager::msDrawingObjectToolBar);
                         break;
                     default:
@@ -1115,20 +1116,20 @@ void ToolBarRules::SelectionHasChanged (
     }
 
     if( bTextEdit )
-        mpToolBarManager->AddToolBarShell(ToolBarManager::TBG_FUNCTION, RID_DRAW_TEXT_TOOLBOX);
+        mpToolBarManager->AddToolBarShell(ToolBarManager::ToolBarGroup::Function, RID_DRAW_TEXT_TOOLBOX);
 
     SdrView* pView = &const_cast<SdrView&>(rView);
     // Check if the extrusion tool bar and the fontwork tool bar have to
     // be activated.
     if (svx::checkForSelectedCustomShapes(pView, true /* bOnlyExtruded */ ))
-        mpToolBarManager->AddToolBarShell(ToolBarManager::TBG_FUNCTION, RID_SVX_EXTRUSION_BAR);
+        mpToolBarManager->AddToolBarShell(ToolBarManager::ToolBarGroup::Function, RID_SVX_EXTRUSION_BAR);
     sal_uInt32 nCheckStatus = 0;
     if (svx::checkForSelectedFontWork(pView, nCheckStatus))
-        mpToolBarManager->AddToolBarShell(ToolBarManager::TBG_FUNCTION, RID_SVX_FONTWORK_BAR);
+        mpToolBarManager->AddToolBarShell(ToolBarManager::ToolBarGroup::Function, RID_SVX_FONTWORK_BAR);
 
     // Switch on additional context-sensitive tool bars.
     if (rView.GetContext() == SdrViewContext::PointEdit)
-        mpToolBarManager->AddToolBarShell(ToolBarManager::TBG_FUNCTION, RID_BEZIER_TOOLBOX);
+        mpToolBarManager->AddToolBarShell(ToolBarManager::ToolBarGroup::Function, RID_BEZIER_TOOLBOX);
 }
 
 void ToolBarRules::SubShellAdded (
@@ -1250,9 +1251,8 @@ bool ToolBarList::RemoveToolBar (
 
 void ToolBarList::MakeRequestedToolBarList (NameList& rRequestedToolBars) const
 {
-    for (int i=sd::ToolBarManager::TBG_FIRST; i<=sd::ToolBarManager::TBG_LAST; ++i)
+    for (auto eGroup : o3tl::enumrange<sd::ToolBarManager::ToolBarGroup>())
     {
-        ::sd::ToolBarManager::ToolBarGroup eGroup = (::sd::ToolBarManager::ToolBarGroup)i;
         Groups::const_iterator iGroup (maGroups.find(eGroup));
         if (iGroup != maGroups.end())
             ::std::copy(
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index f17f1c1..830953a 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -375,9 +375,9 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
             && IsMainViewShell())
         {
             if ( !bShowMasterViewToolbar )
-                GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_MASTER_MODE);
+                GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::ToolBarGroup::MasterMode);
             if ( !bShowPresentationToolbar )
-                GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::TBG_COMMON_TASK);
+                GetViewShellBase().GetToolBarManager()->ResetToolBars(ToolBarManager::ToolBarGroup::CommonTask);
         }
 
         ConfigureAppBackgroundColor();
@@ -463,11 +463,11 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive)
         {
             if (bShowMasterViewToolbar)
                 GetViewShellBase().GetToolBarManager()->SetToolBar(
-                    ToolBarManager::TBG_MASTER_MODE,
+                    ToolBarManager::ToolBarGroup::MasterMode,
                     ToolBarManager::msMasterViewToolBar);
             if (bShowPresentationToolbar)
                 GetViewShellBase().GetToolBarManager()->SetToolBar(
-                    ToolBarManager::TBG_COMMON_TASK,
+                    ToolBarManager::ToolBarGroup::CommonTask,
                     ToolBarManager::msCommonTaskToolBar);
         }
 
commit 96285ce13fc6ea5889b53530a522ec28089d9f0b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 15 09:11:32 2017 +0200

    convert EventType to scoped enum
    
    and drop unused INDEXES_CHANGED enumerator
    
    Change-Id: I25790a012c53509b8af082dac4a250193ca19bde

diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
index 596d1870..5d630dd 100644
--- a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
@@ -128,13 +128,12 @@ void AllMasterPagesSelector::NotifyContainerChangeEvent (
 {
     switch (rEvent.meEventType)
     {
-        case MasterPageContainerChangeEvent::CHILD_ADDED:
+        case MasterPageContainerChangeEvent::EventType::CHILD_ADDED:
             AddItem(rEvent.maChildToken);
             MasterPagesSelector::Fill();
             break;
 
-        case MasterPageContainerChangeEvent::INDEX_CHANGED:
-        case MasterPageContainerChangeEvent::INDEXES_CHANGED:
+        case MasterPageContainerChangeEvent::EventType::INDEX_CHANGED:
             mpSortedMasterPages->clear();
             MasterPagesSelector::Fill();
             break;
diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx
index d276a72..0204464 100644
--- a/sd/source/ui/sidebar/MasterPageContainer.cxx
+++ b/sd/source/ui/sidebar/MasterPageContainer.cxx
@@ -236,7 +236,7 @@ void MasterPageContainer::SetPreviewSize (PreviewSize eSize)
 {
     mePreviewSize = eSize;
     mpImpl->FireContainerChange(
-        MasterPageContainerChangeEvent::SIZE_CHANGED,
+        MasterPageContainerChangeEvent::EventType::SIZE_CHANGED,
         NIL_TOKEN);
 }
 
@@ -597,7 +597,7 @@ void MasterPageContainer::Implementation::UpdatePreviewSizePixel()
         maSmallPreviewSizePixel.Height() = nNewSmallHeight;
         maLargePreviewSizePixel.Height() = nNewLargeHeight;
         FireContainerChange(
-            MasterPageContainerChangeEvent::SIZE_CHANGED,
+            MasterPageContainerChangeEvent::EventType::SIZE_CHANGED,
             NIL_TOKEN);
     }
 }
@@ -657,7 +657,7 @@ MasterPageContainer::Token MasterPageContainer::Implementation::PutMasterPage (
             maContainer.push_back(rpDescriptor);
             aEntry = maContainer.end()-1;
 
-            FireContainerChange(MasterPageContainerChangeEvent::CHILD_ADDED,aResult);
+            FireContainerChange(MasterPageContainerChangeEvent::EventType::CHILD_ADDED,aResult);
         }
     }
     else
@@ -963,11 +963,11 @@ bool MasterPageContainer::Implementation::UpdateDescriptor (
         mpDocument));
     if (nPageObjectModified == 1 && bSendEvents)
         FireContainerChange(
-            MasterPageContainerChangeEvent::DATA_CHANGED,
+            MasterPageContainerChangeEvent::EventType::DATA_CHANGED,
             rpDescriptor->maToken);
     if (nPageObjectModified == -1 && bSendEvents)
         FireContainerChange(
-            MasterPageContainerChangeEvent::CHILD_REMOVED,
+            MasterPageContainerChangeEvent::EventType::CHILD_REMOVED,
             rpDescriptor->maToken);
     if (nPageObjectModified && ! mbFirstPageObjectSeen)
         UpdatePreviewSizePixel();
@@ -981,7 +981,7 @@ bool MasterPageContainer::Implementation::UpdateDescriptor (
 
     if (bPreviewModified && bSendEvents)
         FireContainerChange(
-            MasterPageContainerChangeEvent::PREVIEW_CHANGED,
+            MasterPageContainerChangeEvent::EventType::PREVIEW_CHANGED,
             rpDescriptor->maToken);
 
     return nPageObjectModified || bPreviewModified;
diff --git a/sd/source/ui/sidebar/MasterPageContainer.hxx b/sd/source/ui/sidebar/MasterPageContainer.hxx
index b0c8ac7..8fef14a 100644
--- a/sd/source/ui/sidebar/MasterPageContainer.hxx
+++ b/sd/source/ui/sidebar/MasterPageContainer.hxx
@@ -170,7 +170,7 @@ private:
 class MasterPageContainerChangeEvent
 {
 public:
-    enum EventType {
+    enum class EventType {
         // A master page was added to the container.
         CHILD_ADDED,
         // A master page was removed from the container.
@@ -183,8 +183,6 @@ public:
         DATA_CHANGED,
         // The TemplateIndex of a master page has changed.
         INDEX_CHANGED,
-        // More than one entries changed their TemplateIndex
-        INDEXES_CHANGED
     } meEventType;
 
     // Token of the container entry whose data changed or which was added or
diff --git a/sd/source/ui/sidebar/MasterPageDescriptor.cxx b/sd/source/ui/sidebar/MasterPageDescriptor.cxx
index 60e7931..ce2f275 100644
--- a/sd/source/ui/sidebar/MasterPageDescriptor.cxx
+++ b/sd/source/ui/sidebar/MasterPageDescriptor.cxx
@@ -147,11 +147,11 @@ const Image& MasterPageDescriptor::GetPreview (MasterPageContainer::PreviewSize
      {
          pResult.reset(new std::vector<MasterPageContainerChangeEvent::EventType>());
          if (bDataChanged)
-             pResult->push_back(MasterPageContainerChangeEvent::DATA_CHANGED);
+             pResult->push_back(MasterPageContainerChangeEvent::EventType::DATA_CHANGED);
          if (bIndexChanged)
-             pResult->push_back(MasterPageContainerChangeEvent::INDEX_CHANGED);
+             pResult->push_back(MasterPageContainerChangeEvent::EventType::INDEX_CHANGED);
          if (bPreviewChanged)
-             pResult->push_back(MasterPageContainerChangeEvent::PREVIEW_CHANGED);
+             pResult->push_back(MasterPageContainerChangeEvent::EventType::PREVIEW_CHANGED);
      }
 
      return pResult;
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index 9ef3276..42bc546 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -418,12 +418,12 @@ void MasterPagesSelector::NotifyContainerChangeEvent (const MasterPageContainerC
 
     switch (rEvent.meEventType)
     {
-        case MasterPageContainerChangeEvent::SIZE_CHANGED:
+        case MasterPageContainerChangeEvent::EventType::SIZE_CHANGED:
             PreviewValueSet::SetPreviewSize(mpContainer->GetPreviewSizePixel());
             UpdateAllPreviews();
             break;
 
-        case MasterPageContainerChangeEvent::PREVIEW_CHANGED:
+        case MasterPageContainerChangeEvent::EventType::PREVIEW_CHANGED:
         {
             int nIndex (GetIndexForToken(rEvent.maChildToken));
             if (nIndex >= 0)
@@ -436,14 +436,14 @@ void MasterPagesSelector::NotifyContainerChangeEvent (const MasterPageContainerC
         }
         break;
 
-        case MasterPageContainerChangeEvent::DATA_CHANGED:
+        case MasterPageContainerChangeEvent::EventType::DATA_CHANGED:
         {
             InvalidateItem(rEvent.maChildToken);
             Fill();
         }
         break;
 
-        case MasterPageContainerChangeEvent::CHILD_REMOVED:
+        case MasterPageContainerChangeEvent::EventType::CHILD_REMOVED:
         {
             int nIndex (GetIndexForToken(rEvent.maChildToken));
             SetItem(nIndex, MasterPageContainer::NIL_TOKEN);
diff --git a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
index 1622353..a25c35d 100644
--- a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
+++ b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx
@@ -303,10 +303,9 @@ IMPL_LINK(RecentlyUsedMasterPages, MasterPageContainerChangeListener,
 {
     switch (rEvent.meEventType)
     {
-        case MasterPageContainerChangeEvent::CHILD_ADDED:
-        case MasterPageContainerChangeEvent::CHILD_REMOVED:
-        case MasterPageContainerChangeEvent::INDEX_CHANGED:
-        case MasterPageContainerChangeEvent::INDEXES_CHANGED:
+        case MasterPageContainerChangeEvent::EventType::CHILD_ADDED:
+        case MasterPageContainerChangeEvent::EventType::CHILD_REMOVED:
+        case MasterPageContainerChangeEvent::EventType::INDEX_CHANGED:
             ResolveList();
             break;
 
commit fdc970ef3aeae9e0b86d32c8a131e14995ca188c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 15 09:07:36 2017 +0200

    convert FocusMoveDirection to scoped enum
    
    and drop unused NONE enumerator
    
    Change-Id: I793acf12ad25517a4d5fa6f886225b589d87176d

diff --git a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
index 3852462..3ee0bb0 100644
--- a/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsFocusManager.cxx
@@ -58,21 +58,17 @@ void FocusManager::MoveFocus (FocusMoveDirection eDirection)
         const sal_Int32 nPageCount (mrSlideSorter.GetModel().GetPageCount());
         switch (eDirection)
         {
-            case FMD_NONE:
-                // Nothing to be done.
-                break;
-
-            case FMD_LEFT:
+            case FocusMoveDirection::Left:
                 if (mnPageIndex > 0)
                     mnPageIndex -= 1;
                 break;
 
-            case FMD_RIGHT:
+            case FocusMoveDirection::Right:
                 if (mnPageIndex < nPageCount-1)
                     mnPageIndex += 1;
                 break;
 
-            case FMD_UP:
+            case FocusMoveDirection::Up:
             {
                 const sal_Int32 nCandidate (mnPageIndex - nColumnCount);
                 if (nCandidate >= 0)
@@ -83,7 +79,7 @@ void FocusManager::MoveFocus (FocusMoveDirection eDirection)
             }
             break;
 
-            case FMD_DOWN:
+            case FocusMoveDirection::Down:
             {
                 const sal_Int32 nCandidate (mnPageIndex + nColumnCount);
                 if (nCandidate < nPageCount)
diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
index fa63b44..8d17378 100644
--- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx
@@ -445,25 +445,25 @@ bool SelectionFunction::KeyInput (const KeyEvent& rEvent)
 
         // Move the focus indicator left.
         case KEY_LEFT:
-            MoveFocus(FocusManager::FMD_LEFT, rCode.IsShift(), rCode.IsMod1());
+            MoveFocus(FocusManager::FocusMoveDirection::Left, rCode.IsShift(), rCode.IsMod1());
             bResult = true;
             break;
 
         // Move the focus indicator right.
         case KEY_RIGHT:
-            MoveFocus(FocusManager::FMD_RIGHT, rCode.IsShift(), rCode.IsMod1());
+            MoveFocus(FocusManager::FocusMoveDirection::Right, rCode.IsShift(), rCode.IsMod1());
             bResult = true;
             break;
 
         // Move the focus indicator up.
         case KEY_UP:
-            MoveFocus(FocusManager::FMD_UP, rCode.IsShift(), rCode.IsMod1());
+            MoveFocus(FocusManager::FocusMoveDirection::Up, rCode.IsShift(), rCode.IsMod1());
             bResult = true;
             break;
 
         // Move the focus indicator down.
         case KEY_DOWN:
-            MoveFocus(FocusManager::FMD_DOWN, rCode.IsShift(), rCode.IsMod1());
+            MoveFocus(FocusManager::FocusMoveDirection::Down, rCode.IsShift(), rCode.IsMod1());
             bResult = true;
             break;
 
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx
index 5572ca2..18a1b2e 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsFocusManager.hxx
@@ -49,13 +49,12 @@ public:
 
     ~FocusManager();
 
-    enum FocusMoveDirection
+    enum class FocusMoveDirection
     {
-        FMD_NONE,
-        FMD_LEFT,
-        FMD_RIGHT,
-        FMD_UP,
-        FMD_DOWN
+        Left,
+        Right,
+        Up,
+        Down
     };
 
     /** Move the focus from the currently focused page to one that is
@@ -66,10 +65,9 @@ public:
             wrap around takes place in the same column, i.e. when you are
             in the top row and move up you come out in the bottom row in the
             same column.  Horizontal wrap around moves to the next
-            (FMD_RIGHT) or previous (FMD_LEFT) page.  Moving to the right
+            (FocusMoveDirection::Right) or previous (FocusMoveDirection::Left) page.  Moving to the right
             from the last page goes to the first page and vice versa.
-            When FMD_NONE is given, the current page index is checked for
-            being valid.  If it is not, then it is set to the nearest valid
+            The current page index is set to the nearest valid
             page index.
     */
     void MoveFocus (FocusMoveDirection eDirection);
commit 0ce9363dae0c1e326942b8df63e2b1cc30b04603
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 15 09:05:05 2017 +0200

    convert PageObjectLayouter to scoped enum
    
    and drop unused MouseOverIndicator and Name enumerators
    
    Change-Id: I7041d0b3792939709d73fed75ee858f0e649b840

diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx
index 9daf8e9..72f67ba 100644
--- a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx
+++ b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx
@@ -301,7 +301,7 @@ awt::Rectangle SAL_CALL AccessibleSlideSorterObject::getBounds()
     Rectangle aBBox (
         mrSlideSorter.GetView().GetLayouter().GetPageObjectLayouter()->GetBoundingBox(
             mrSlideSorter.GetModel().GetPageDescriptor(mnPageNumber),
-            ::sd::slidesorter::view::PageObjectLayouter::PageObject,
+            ::sd::slidesorter::view::PageObjectLayouter::Part::PageObject,
             ::sd::slidesorter::view::PageObjectLayouter::WindowCoordinateSystem));
 
     if (mxParent.is())
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index a6486df..d804ee8 100644
--- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -204,7 +204,7 @@ model::SharedPageDescriptor SlideSorterController::GetPageAt (
             // Make sure that the mouse is over the preview area.
             if ( ! mrView.GetLayouter().GetPageObjectLayouter()->GetBoundingBox(
                 pDescriptorAtPoint,
-                view::PageObjectLayouter::Preview,
+                view::PageObjectLayouter::Part::Preview,
                 view::PageObjectLayouter::WindowCoordinateSystem).IsInside(aWindowPosition))
             {
                 pDescriptorAtPoint.reset();
@@ -374,7 +374,7 @@ bool SlideSorterController::Command (
                     Rectangle aBBox (
                         mrView.GetLayouter().GetPageObjectLayouter()->GetBoundingBox (
                             pDescriptor,
-                            PageObjectLayouter::PageObject,
+                            PageObjectLayouter::Part::PageObject,
                             PageObjectLayouter::ModelCoordinateSystem));
                     aMenuLocation = aBBox.Center();
                 }
diff --git a/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx b/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx
index 0b2eb12..15ff687 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsPageObjectLayouter.hxx
@@ -52,7 +52,7 @@ public:
         const sal_Int32 nPageCount);
     ~PageObjectLayouter();
 
-    enum Part {
+    enum class Part {
         // The focus indicator is painted outside the actual page object.
         FocusIndicator,
         // This is the outer bounding box that includes the preview, page
@@ -60,12 +60,8 @@ public:
         PageObject,
         // Bounding box of the actual preview.
         Preview,
-        // Bounding box of the mouse indicator indicator frame.
-        MouseOverIndicator,
         // Bounding box of the page number.
         PageNumber,
-        // Bounding box of the pane name.
-        Name,
         // Indicator whether or not there is a slide transition associated
         // with this slide.
         TransitionEffectIndicator,
diff --git a/sd/source/ui/slidesorter/view/SlsLayouter.cxx b/sd/source/ui/slidesorter/view/SlsLayouter.cxx
index 05ca714..e2d321d 100644
--- a/sd/source/ui/slidesorter/view/SlsLayouter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsLayouter.cxx
@@ -794,10 +794,10 @@ Rectangle Layouter::Implementation::GetInnerBoundingBox (
     if ( ! pDescriptor)
         return Rectangle();
 
-    PageObjectLayouter::Part ePart = PageObjectLayouter::Preview;
+    PageObjectLayouter::Part ePart = PageObjectLayouter::Part::Preview;
 
     if (pDescriptor->HasState(model::PageDescriptor::ST_Selected))
-        ePart = PageObjectLayouter::PageObject;
+        ePart = PageObjectLayouter::Part::PageObject;
 
     return mpPageObjectLayouter->GetBoundingBox(
             pDescriptor, ePart,
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx
index 4724ff8..119a8cc 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectLayouter.cxx
@@ -179,31 +179,26 @@ Rectangle PageObjectLayouter::GetBoundingBox (
     Rectangle aBoundingBox;
     switch (ePart)
     {
-        case FocusIndicator:
+        case Part::FocusIndicator:
             aBoundingBox = maFocusIndicatorBoundingBox;
             break;
 
-        case PageObject:
-        case MouseOverIndicator:
+        case Part::PageObject:
             aBoundingBox = maPageObjectBoundingBox;
             break;
 
-        case Preview:
+        case Part::Preview:
             aBoundingBox = maPreviewBoundingBox;
             break;
 
-        case PageNumber:
+        case Part::PageNumber:
             aBoundingBox = maPageNumberAreaBoundingBox;
             break;
 
-        case Name:
-            aBoundingBox = maPageNumberAreaBoundingBox;
-            break;
-
-        case TransitionEffectIndicator:
+        case Part::TransitionEffectIndicator:
             aBoundingBox = maTransitionEffectBoundingBox;
             break;
-        case CustomAnimationEffectIndicator:
+        case Part::CustomAnimationEffectIndicator:
             aBoundingBox = maCustomAnimationEffectBoundingBox;
             break;
     }
@@ -220,13 +215,13 @@ Rectangle PageObjectLayouter::GetBoundingBox (
 
 Size PageObjectLayouter::GetPreviewSize ()
 {
-    return GetBoundingBox(Point(0,0), PageObjectLayouter::Preview,
+    return GetBoundingBox(Point(0,0), PageObjectLayouter::Part::Preview,
                           WindowCoordinateSystem).GetSize();
 }
 
 Size PageObjectLayouter::GetGridMaxSize()
 {
-    return GetBoundingBox(Point(0,0), PageObjectLayouter::FocusIndicator,
+    return GetBoundingBox(Point(0,0), PageObjectLayouter::Part::FocusIndicator,
                           WindowCoordinateSystem).GetSize();
 }
 
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index f179b9bf..ea5fc5b 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -121,7 +121,7 @@ void PageObjectPainter::PaintBackground (
         rDevice.SetLineColor(pPage->GetPageBackgroundColor(nullptr));
         const Rectangle aPreviewBox (pPageObjectLayouter->GetBoundingBox(
             rpDescriptor,
-            PageObjectLayouter::Preview,
+            PageObjectLayouter::Part::Preview,
             PageObjectLayouter::ModelCoordinateSystem));
         rDevice.DrawRect(aPreviewBox);
     }
@@ -134,7 +134,7 @@ void PageObjectPainter::PaintPreview (
 {
     const Rectangle aBox (pPageObjectLayouter->GetBoundingBox(
         rpDescriptor,
-        PageObjectLayouter::Preview,
+        PageObjectLayouter::Part::Preview,
         PageObjectLayouter::ModelCoordinateSystem));
 
     if (mpCache != nullptr)
@@ -194,7 +194,7 @@ Bitmap PageObjectPainter::GetPreviewBitmap (
         Bitmap aMarkedPreview (mpCache->GetMarkedPreviewBitmap(pPage));
         const Rectangle aPreviewBox (pPageObjectLayouter->GetBoundingBox(
             rpDescriptor,
-            PageObjectLayouter::Preview,
+            PageObjectLayouter::Part::Preview,
             PageObjectLayouter::ModelCoordinateSystem));
         if (aMarkedPreview.IsEmpty() || aMarkedPreview.GetSizePixel()!=aPreviewBox.GetSize())
         {
@@ -220,7 +220,7 @@ void PageObjectPainter::PaintPageNumber (
 {
     const Rectangle aBox (pPageObjectLayouter->GetBoundingBox(
         rpDescriptor,
-        PageObjectLayouter::PageNumber,
+        PageObjectLayouter::Part::PageNumber,
         PageObjectLayouter::ModelCoordinateSystem));
 
     // Determine the color of the page number.
@@ -276,7 +276,7 @@ void PageObjectPainter::PaintTransitionEffect (
     {
         const Rectangle aBox (pPageObjectLayouter->GetBoundingBox(
             rpDescriptor,
-            PageObjectLayouter::TransitionEffectIndicator,
+            PageObjectLayouter::Part::TransitionEffectIndicator,
             PageObjectLayouter::ModelCoordinateSystem));
 
         rDevice.DrawBitmapEx(
@@ -298,7 +298,7 @@ void PageObjectPainter::PaintCustomAnimationEffect (
     {
         const Rectangle aBox (pPageObjectLayouter->GetBoundingBox(
             rpDescriptor,
-            PageObjectLayouter::CustomAnimationEffectIndicator,
+            PageObjectLayouter::Part::CustomAnimationEffectIndicator,
             PageObjectLayouter::ModelCoordinateSystem));
         rDevice.DrawBitmapEx(
             aBox.TopCenter(),
@@ -366,12 +366,12 @@ void PageObjectPainter::PaintBackgroundDetail (
 
     const Rectangle aFocusSize (pPageObjectLayouter->GetBoundingBox(
                                         rpDescriptor,
-                                        PageObjectLayouter::FocusIndicator,
+                                        PageObjectLayouter::Part::FocusIndicator,
                                         PageObjectLayouter::ModelCoordinateSystem));
 
     const Rectangle aPageObjectBox (pPageObjectLayouter->GetBoundingBox(
                                         rpDescriptor,
-                                        PageObjectLayouter::PageObject,
+                                        PageObjectLayouter::Part::PageObject,
                                         PageObjectLayouter::ModelCoordinateSystem));
 
     // Fill the background with the background color of the slide sorter.
@@ -430,7 +430,7 @@ void PageObjectPainter::PaintBackgroundDetail (
     // Compensate for the border around the preview.
     const Rectangle aBox (pPageObjectLayouter->GetBoundingBox(
                                 rpDescriptor,
-                                PageObjectLayouter::Preview,
+                                PageObjectLayouter::Part::Preview,
                                 PageObjectLayouter::ModelCoordinateSystem));
     Rectangle aFrameBox (aBox.Left()-1,aBox.Top()-1,aBox.Right()+1,aBox.Bottom()+1);
     mpShadowPainter->PaintFrame(rDevice, aFrameBox);
diff --git a/sd/source/ui/slidesorter/view/SlsToolTip.cxx b/sd/source/ui/slidesorter/view/SlsToolTip.cxx
index 9dc2225..cd312e4 100644
--- a/sd/source/ui/slidesorter/view/SlsToolTip.cxx
+++ b/sd/source/ui/slidesorter/view/SlsToolTip.cxx
@@ -110,7 +110,7 @@ void ToolTip::DoShow()
         Rectangle aBox (
             mrSlideSorter.GetView().GetLayouter().GetPageObjectLayouter()->GetBoundingBox(
                 mpDescriptor,
-                PageObjectLayouter::Preview,
+                PageObjectLayouter::Part::Preview,
                 PageObjectLayouter::WindowCoordinateSystem));
 
         // Do not show the help text when the (lower edge of the ) preview
commit eadd95068552fbba2221cbb6b73af7d893b04ec5
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 15 08:59:47 2017 +0200

    convert GradientColorClass to scoped enum
    
    and drop unused Base enumerator
    
    Change-Id: I48585ca945c4633f436643222697688661ef68c6

diff --git a/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx b/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx
index 14d3568..f86a452 100644
--- a/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlsTheme.hxx
@@ -85,12 +85,11 @@ public:
         Gradient_FocusedPage,
         GradientColorType_Size_
     };
-    enum GradientColorClass {
+    enum class GradientColorClass {
         Border1,
         Border2,
         Fill1,
-        Fill2,
-        Base
+        Fill2
     };
     ColorData GetGradientColor (
         const GradientColorType eType,
diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
index e9d3f6e..f179b9bf 100644
--- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
+++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx
@@ -382,8 +382,8 @@ void PageObjectPainter::PaintBackgroundDetail (
 
     // Paint the slide area with a linear gradient that starts some pixels
     // below the top and ends some pixels above the bottom.
-    const Color aTopColor(mpTheme->GetGradientColor(eColorType, Theme::Fill1));
-    const Color aBottomColor(mpTheme->GetGradientColor(eColorType, Theme::Fill2));
+    const Color aTopColor(mpTheme->GetGradientColor(eColorType, Theme::GradientColorClass::Fill1));
+    const Color aBottomColor(mpTheme->GetGradientColor(eColorType, Theme::GradientColorClass::Fill2));
     if (aTopColor != aBottomColor)
     {
         const sal_Int32 nHeight (aPageObjectBox.GetHeight());
@@ -446,7 +446,7 @@ void PageObjectPainter::PaintBorder (
     for (int nIndex=0; nIndex<nBorderWidth; ++nIndex)
     {
         const int nDelta (nIndex);
-        rDevice.SetLineColor(mpTheme->GetGradientColor(eColorType, Theme::Border2));
+        rDevice.SetLineColor(mpTheme->GetGradientColor(eColorType, Theme::GradientColorClass::Border2));
         rDevice.DrawLine(
             Point(rBox.Left()-nDelta, rBox.Top()-nDelta),
             Point(rBox.Left()-nDelta, rBox.Bottom()+nDelta));
@@ -457,7 +457,7 @@ void PageObjectPainter::PaintBorder (
             Point(rBox.Right()+nDelta, rBox.Bottom()+nDelta),
             Point(rBox.Right()+nDelta, rBox.Top()-nDelta));
 
-        rDevice.SetLineColor(mpTheme->GetGradientColor(eColorType, Theme::Border1));
+        rDevice.SetLineColor(mpTheme->GetGradientColor(eColorType, Theme::GradientColorClass::Border1));
         rDevice.DrawLine(
             Point(rBox.Left()-nDelta, rBox.Top()-nDelta),
             Point(rBox.Right()+nDelta, rBox.Top()-nDelta));
diff --git a/sd/source/ui/slidesorter/view/SlsTheme.cxx b/sd/source/ui/slidesorter/view/SlsTheme.cxx
index 1ebc54c..1715406 100644
--- a/sd/source/ui/slidesorter/view/SlsTheme.cxx
+++ b/sd/source/ui/slidesorter/view/SlsTheme.cxx
@@ -177,12 +177,10 @@ ColorData Theme::GetGradientColor (
 
     switch (eClass)
     {
-        case Border1: return rDescriptor.maBorderColor1;
-        case Border2: return rDescriptor.maBorderColor2;
-        case Fill1: return rDescriptor.maFillColor1;
-        case Fill2: return rDescriptor.maFillColor2;
-        default: OSL_ASSERT(false); SAL_FALLTHROUGH;
-        case Base: return rDescriptor.maBaseColor;
+        case GradientColorClass::Border1: return rDescriptor.maBorderColor1;
+        case GradientColorClass::Border2: return rDescriptor.maBorderColor2;
+        case GradientColorClass::Fill1: return rDescriptor.maFillColor1;
+        case GradientColorClass::Fill2: return rDescriptor.maFillColor2;
     }
 }
 
commit 7a350ce156a8cf8e6ec1271d1823edd787656808
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Feb 15 08:42:18 2017 +0200

    remove unused Right from Anchor enum
    
    Change-Id: I7943a37407481305d28e526840caf320e7ff6bf2

diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx
index bbddbc7..9889e35 100644
--- a/sdext/source/presenter/PresenterToolBar.cxx
+++ b/sdext/source/presenter/PresenterToolBar.cxx
@@ -758,7 +758,6 @@ void PresenterToolBar::Layout (
     {
         case Left : nX = 0; break;
         case Center: nX = (aWindowBox.Width - aTotalSize.Width - nTotalHorizontalGap) / 2; break;
-        case Right: nX = aWindowBox.Width - aTotalSize.Width - nTotalHorizontalGap; break;
     }
 
     // Place the parts.
diff --git a/sdext/source/presenter/PresenterToolBar.hxx b/sdext/source/presenter/PresenterToolBar.hxx
index 3bd2cbc..f54e92fa 100644
--- a/sdext/source/presenter/PresenterToolBar.hxx
+++ b/sdext/source/presenter/PresenterToolBar.hxx
@@ -74,7 +74,7 @@ class PresenterToolBar
 public:
     typedef ::std::function<void ()> Action;
 
-    enum Anchor { Left, Center, Right };
+    enum Anchor { Left, Center };
 
     PresenterToolBar (
         const css::uno::Reference<css::uno::XComponentContext>& rxContext,


More information about the Libreoffice-commits mailing list