[Libreoffice-commits] core.git: 31 commits - basctl/source basic/source chart2/source cui/source dbaccess/source extensions/source filter/source include/o3tl include/sfx2 include/svtools include/svx include/toolkit include/unotools reportdesign/source sc/source sd/source sfx2/source starmath/source svtools/source svx/source sw/inc sw/source toolkit/source unotools/source vbahelper/source

Noel Grandin noel at peralex.com
Wed Apr 29 01:42:39 PDT 2015


 basctl/source/dlged/dlgedview.cxx                           |    2 
 basctl/source/dlged/managelang.cxx                          |    2 
 basctl/source/inc/dlgedview.hxx                             |    2 
 basic/source/classes/sbxmod.cxx                             |    2 
 chart2/source/controller/dialogs/dlg_CreationWizard.cxx     |   12 
 chart2/source/controller/drawinglayer/DrawViewWrapper.cxx   |    2 
 chart2/source/controller/main/ChartController_Window.cxx    |    2 
 cui/source/dialogs/SpellDialog.cxx                          |    2 
 cui/source/dialogs/zoom.cxx                                 |   27 -
 cui/source/factory/dlgfact.cxx                              |    2 
 cui/source/factory/dlgfact.hxx                              |    3 
 cui/source/inc/border.hxx                                   |    2 
 cui/source/inc/cuitabarea.hxx                               |    6 
 cui/source/inc/cuitabline.hxx                               |    1 
 cui/source/inc/zoom.hxx                                     |    5 
 cui/source/options/optasian.cxx                             |    2 
 cui/source/options/optdict.cxx                              |    4 
 cui/source/options/optgdlg.cxx                              |    8 
 cui/source/options/optgenrl.cxx                             |   57 +-
 cui/source/tabpages/autocdlg.cxx                            |    4 
 cui/source/tabpages/backgrnd.cxx                            |   10 
 cui/source/tabpages/border.cxx                              |   18 
 cui/source/tabpages/chardlg.cxx                             |    6 
 cui/source/tabpages/measure.cxx                             |   12 
 cui/source/tabpages/numfmt.cxx                              |    2 
 cui/source/tabpages/tabarea.cxx                             |   16 
 cui/source/tabpages/tabline.cxx                             |   12 
 cui/source/tabpages/textattr.cxx                            |    2 
 cui/source/tabpages/tparea.cxx                              |   26 
 cui/source/tabpages/tpbitmap.cxx                            |   24 
 cui/source/tabpages/tpcolor.cxx                             |   16 
 cui/source/tabpages/tpgradnt.cxx                            |   22 
 cui/source/tabpages/tphatch.cxx                             |   22 
 cui/source/tabpages/tpline.cxx                              |   18 
 cui/source/tabpages/tplnedef.cxx                            |   16 
 cui/source/tabpages/tplneend.cxx                            |   16 
 cui/source/tabpages/tpshadow.cxx                            |    6 
 dbaccess/source/ext/macromigration/macromigrationdialog.cxx |   16 
 dbaccess/source/ui/browser/sbagrid.cxx                      |    2 
 dbaccess/source/ui/dlg/dbwiz.cxx                            |   16 
 dbaccess/source/ui/dlg/dbwizsetup.cxx                       |   32 -
 extensions/source/abpilot/abpfinalpage.cxx                  |    8 
 extensions/source/abpilot/abspage.cxx                       |    2 
 extensions/source/abpilot/abspilot.cxx                      |    6 
 extensions/source/abpilot/typeselectionpage.cxx             |    4 
 extensions/source/dbpilots/controlwizard.cxx                |    6 
 extensions/source/dbpilots/gridwizard.cxx                   |   12 
 extensions/source/dbpilots/groupboxwiz.cxx                  |   12 
 extensions/source/dbpilots/listcombowizard.cxx              |   14 
 filter/source/msfilter/escherex.cxx                         |    2 
 filter/source/msfilter/msdffimp.cxx                         |   63 +-
 include/o3tl/enumarray.hxx                                  |    7 
 include/sfx2/event.hxx                                      |    2 
 include/svtools/roadmapwizard.hxx                           |    4 
 include/svtools/wizardmachine.hxx                           |   73 +-
 include/svx/EnhancedCustomShape2d.hxx                       |   46 -
 include/svx/EnhancedCustomShapeGeometry.hxx                 |   37 -
 include/svx/ctredlin.hxx                                    |   18 
 include/svx/dbaexchange.hxx                                 |   31 -
 include/svx/dlgctl3d.hxx                                    |   11 
 include/svx/dlgctrl.hxx                                     |   14 
 include/svx/flagsdef.hxx                                    |   32 -
 include/svx/galmisc.hxx                                     |   47 -
 include/svx/langbox.hxx                                     |   46 +
 include/svx/optgenrl.hxx                                    |   35 -
 include/svx/ruler.hxx                                       |   64 +-
 include/svx/svddrgmt.hxx                                    |    2 
 include/svx/svdedtv.hxx                                     |   23 
 include/svx/svdglev.hxx                                     |   26 
 include/svx/svdglue.hxx                                     |   93 +--
 include/svx/svdmodel.hxx                                    |   34 -
 include/svx/svdmrkv.hxx                                     |   90 +--
 include/svx/svdoashp.hxx                                    |   23 
 include/svx/svdoedge.hxx                                    |    2 
 include/svx/svdograf.hxx                                    |   21 
 include/svx/svdsnpv.hxx                                     |   23 
 include/svx/svdview.hxx                                     |   18 
 include/svx/svdxcgv.hxx                                     |    8 
 include/svx/svxdlg.hxx                                      |    3 
 include/svx/tabarea.hxx                                     |   21 
 include/svx/tabline.hxx                                     |   10 
 include/svx/view3d.hxx                                      |    2 
 include/svx/zoom_def.hxx                                    |   10 
 include/toolkit/awt/vclxgraphics.hxx                        |   19 
 include/unotools/eventcfg.hxx                               |   90 +--
 reportdesign/source/ui/misc/UITools.cxx                     |    2 
 reportdesign/source/ui/report/ReportSection.cxx             |    4 
 reportdesign/source/ui/report/dlgedfunc.cxx                 |   14 
 sc/source/ui/app/drwtrans.cxx                               |    6 
 sc/source/ui/dbgui/scuiasciiopt.cxx                         |    2 
 sc/source/ui/dbgui/textimportoptions.cxx                    |    2 
 sc/source/ui/dbgui/tpsort.cxx                               |    2 
 sc/source/ui/drawfunc/drawsh.cxx                            |    2 
 sc/source/ui/drawfunc/fuconpol.cxx                          |    4 
 sc/source/ui/drawfunc/fudraw.cxx                            |    8 
 sc/source/ui/drawfunc/fuins1.cxx                            |    4 
 sc/source/ui/drawfunc/fusel.cxx                             |   12 
 sc/source/ui/drawfunc/futext.cxx                            |    4 
 sc/source/ui/inc/drawview.hxx                               |    2 
 sc/source/ui/styleui/styledlg.cxx                           |    2 
 sc/source/ui/vba/vbaeventshelper.cxx                        |   24 
 sc/source/ui/view/drawview.cxx                              |    4 
 sc/source/ui/view/gridwin5.cxx                              |    6 
 sc/source/ui/view/prevwsh.cxx                               |    2 
 sc/source/ui/view/viewfun5.cxx                              |    2 
 sc/source/ui/view/viewfun7.cxx                              |    4 
 sd/source/core/drawdoc3.cxx                                 |    2 
 sd/source/filter/sdpptwrp.cxx                               |    2 
 sd/source/ui/app/sdxfer.cxx                                 |   10 
 sd/source/ui/dlg/animobjs.cxx                               |    2 
 sd/source/ui/dlg/dlgfield.cxx                               |    2 
 sd/source/ui/dlg/gluectrl.cxx                               |   25 
 sd/source/ui/dlg/headerfooterdlg.cxx                        |    2 
 sd/source/ui/dlg/prltempl.cxx                               |    8 
 sd/source/ui/dlg/tabtempl.cxx                               |    8 
 sd/source/ui/docshell/docshel3.cxx                          |    4 
 sd/source/ui/docshell/docshel4.cxx                          |    4 
 sd/source/ui/func/fuconarc.cxx                              |    2 
 sd/source/ui/func/fuconbez.cxx                              |    4 
 sd/source/ui/func/fuconrec.cxx                              |    4 
 sd/source/ui/func/fudraw.cxx                                |   10 
 sd/source/ui/func/fuediglu.cxx                              |   32 -
 sd/source/ui/func/fuformatpaintbrush.cxx                    |    6 
 sd/source/ui/func/fuinsert.cxx                              |    4 
 sd/source/ui/func/fumorph.cxx                               |    2 
 sd/source/ui/func/fusel.cxx                                 |   16 
 sd/source/ui/func/futext.cxx                                |   18 
 sd/source/ui/inc/Ruler.hxx                                  |    2 
 sd/source/ui/inc/View.hxx                                   |    4 
 sd/source/ui/inc/dlgpage.hxx                                |    3 
 sd/source/ui/inc/gluectrl.hxx                               |    4 
 sd/source/ui/table/tablefunction.cxx                        |    2 
 sd/source/ui/view/drviews1.cxx                              |   10 
 sd/source/ui/view/drviews7.cxx                              |   24 
 sd/source/ui/view/drviews8.cxx                              |    2 
 sd/source/ui/view/drviews9.cxx                              |    2 
 sd/source/ui/view/drviewse.cxx                              |    4 
 sd/source/ui/view/sdruler.cxx                               |    2 
 sd/source/ui/view/sdview2.cxx                               |    2 
 sd/source/ui/view/sdview3.cxx                               |   16 
 sd/source/ui/view/sdview4.cxx                               |   10 
 sfx2/source/appl/app.cxx                                    |    4 
 sfx2/source/doc/objembed.cxx                                |    2 
 sfx2/source/doc/objmisc.cxx                                 |    6 
 sfx2/source/doc/objstor.cxx                                 |    4 
 sfx2/source/doc/objxtor.cxx                                 |    6 
 sfx2/source/doc/sfxbasemodel.cxx                            |   18 
 sfx2/source/view/frame.cxx                                  |    2 
 sfx2/source/view/sfxbasecontroller.cxx                      |    6 
 sfx2/source/view/viewfrm.cxx                                |    2 
 sfx2/source/view/viewprn.cxx                                |    2 
 starmath/source/document.cxx                                |    2 
 svtools/source/dialogs/roadmapwizard.cxx                    |    6 
 svtools/source/dialogs/wizardmachine.cxx                    |   48 -
 svtools/source/uno/wizard/unowizard.cxx                     |   16 
 svx/source/customshapes/EnhancedCustomShape2d.cxx           |   69 +-
 svx/source/customshapes/EnhancedCustomShapeGeometry.cxx     |  316 ++++++------
 svx/source/dialog/ctredlin.cxx                              |   38 -
 svx/source/dialog/dlgctl3d.cxx                              |   24 
 svx/source/dialog/dlgctrl.cxx                               |   26 
 svx/source/dialog/graphctl.cxx                              |    2 
 svx/source/dialog/langbox.cxx                               |   52 -
 svx/source/dialog/svxruler.cxx                              |  114 ++--
 svx/source/engine3d/view3d.cxx                              |    4 
 svx/source/fmcomp/dbaexchange.cxx                           |   32 -
 svx/source/fmcomp/fmgridcl.cxx                              |    6 
 svx/source/form/fmpage.cxx                                  |    2 
 svx/source/form/fmview.cxx                                  |    2 
 svx/source/form/tabwin.cxx                                  |    2 
 svx/source/gallery2/galbrws1.cxx                            |    8 
 svx/source/gallery2/galbrws2.cxx                            |    2 
 svx/source/gallery2/gallery1.cxx                            |    8 
 svx/source/gallery2/galmisc.cxx                             |    6 
 svx/source/gallery2/galobj.cxx                              |    2 
 svx/source/gallery2/galtheme.cxx                            |   28 -
 svx/source/svdraw/svddrgmt.cxx                              |   12 
 svx/source/svdraw/svddrgv.cxx                               |    2 
 svx/source/svdraw/svdedtv.cxx                               |   12 
 svx/source/svdraw/svdedtv2.cxx                              |    2 
 svx/source/svdraw/svdglev.cxx                               |   34 -
 svx/source/svdraw/svdglue.cxx                               |  122 ++--
 svx/source/svdraw/svdmodel.cxx                              |    2 
 svx/source/svdraw/svdmrkv.cxx                               |   90 +--
 svx/source/svdraw/svdmrkv1.cxx                              |    6 
 svx/source/svdraw/svdoashp.cxx                              |   87 +--
 svx/source/svdraw/svdoedge.cxx                              |   44 -
 svx/source/svdraw/svdograf.cxx                              |   16 
 svx/source/svdraw/svdsnpv.cxx                               |   18 
 svx/source/svdraw/svdview.cxx                               |   26 
 svx/source/svdraw/svdxcgv.cxx                               |   18 
 svx/source/table/tablecontroller.cxx                        |    4 
 svx/source/unodraw/gluepts.cxx                              |   79 +--
 svx/source/unogallery/unogaltheme.cxx                       |    4 
 sw/inc/swabstdlg.hxx                                        |    3 
 sw/source/core/draw/dpage.cxx                               |    2 
 sw/source/core/draw/dview.cxx                               |    2 
 sw/source/core/frmedt/fecopy.cxx                            |    2 
 sw/source/core/frmedt/fefly1.cxx                            |    6 
 sw/source/core/frmedt/feshview.cxx                          |   10 
 sw/source/core/inc/dview.hxx                                |    2 
 sw/source/filter/html/htmlgrin.cxx                          |    8 
 sw/source/ui/chrdlg/pardlg.cxx                              |    2 
 sw/source/ui/dbui/mailmergewizard.cxx                       |   10 
 sw/source/ui/dbui/mmaddressblockpage.cxx                    |   10 
 sw/source/ui/dbui/mmdocselectpage.cxx                       |    4 
 sw/source/ui/dbui/mmgreetingspage.cxx                       |    8 
 sw/source/ui/dbui/mmoutputpage.cxx                          |   16 
 sw/source/ui/dialog/ascfldlg.cxx                            |    2 
 sw/source/ui/dialog/swdlgfact.cxx                           |    2 
 sw/source/ui/dialog/swdlgfact.hxx                           |    2 
 sw/source/ui/dialog/uiregionsw.cxx                          |    4 
 sw/source/ui/fldui/fldedt.cxx                               |   38 -
 sw/source/ui/fmtui/tmpdlg.cxx                               |   14 
 sw/source/ui/frmdlg/frmdlg.cxx                              |    2 
 sw/source/ui/frmdlg/uiborder.cxx                            |    6 
 sw/source/ui/index/cnttab.cxx                               |    4 
 sw/source/ui/misc/srtdlg.cxx                                |    2 
 sw/source/ui/table/tabledlg.cxx                             |    6 
 sw/source/uibase/app/docsh2.cxx                             |    8 
 sw/source/uibase/dbui/dbtree.cxx                            |    2 
 sw/source/uibase/dochdl/swdtflvr.cxx                        |    2 
 sw/source/uibase/docvw/edtwin.cxx                           |   10 
 sw/source/uibase/inc/swruler.hxx                            |    2 
 sw/source/uibase/inc/uiborder.hxx                           |    2 
 sw/source/uibase/misc/swruler.cxx                           |    2 
 sw/source/uibase/ribbar/conform.cxx                         |    2 
 sw/source/uibase/ribbar/drawbase.cxx                        |    2 
 sw/source/uibase/shells/basesh.cxx                          |    6 
 sw/source/uibase/uiview/view.cxx                            |   14 
 sw/source/uibase/uiview/viewdraw.cxx                        |    2 
 sw/source/uibase/utlui/condedit.cxx                         |    4 
 toolkit/source/awt/vclxgraphics.cxx                         |   44 -
 unotools/source/config/eventcfg.cxx                         |   80 +--
 vbahelper/source/vbahelper/vbaeventshelperbase.cxx          |    2 
 234 files changed, 1928 insertions(+), 1805 deletions(-)

New commits:
commit 6bb742b9cbbdabbbd53dd9cdf6cb165e4b30bf86
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Apr 28 15:01:43 2015 +0200

    convert STR_EVENT constants to scoped enum
    
    - also add needed infrastructure to o3tl::enumarray so we can use
    std::find on it
    - move the Impl inside the .cxx file, no need to expose it in the header
    
    Change-Id: I7758a6175849f46723d97b1e657f846524c3b7cd

diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 9990a04..0d4395c 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -2426,7 +2426,7 @@ public:
     virtual void SAL_CALL documentEventOccured( const document::DocumentEvent& rEvent ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
     {
         // early dosposing on document event "OnUnload", to be sure Basic still exists when calling VBA "UserForm_Terminate"
-        if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ) )
+        if( rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ) )
         {
             removeListener();
             mbDisposed = true;
diff --git a/include/o3tl/enumarray.hxx b/include/o3tl/enumarray.hxx
index 777e205..355e674 100644
--- a/include/o3tl/enumarray.hxx
+++ b/include/o3tl/enumarray.hxx
@@ -70,6 +70,8 @@ public:
     iterator  begin()      { return iterator(*this, 0); }
     iterator  end()        { return iterator(*this, size()); }
 
+    V*        data()       { return detail_values; }
+
 //private:
     V detail_values[max_index + 1];
 };
@@ -83,6 +85,10 @@ public:
     typedef enumarray_iterator<EA>  self_type;
     typedef typename EA::value_type value_type;
     typedef typename EA::key_type   key_type;
+    typedef std::bidirectional_iterator_tag iterator_category; //should be random access, but that would require define subtraction operators on the enums
+    typedef typename EA::key_type   difference_type;
+    typedef typename EA::value_type*   pointer;
+    typedef typename EA::value_type&   reference;
 
     enumarray_iterator(EA& b, size_t start_pos)
          : m_buf(b), m_pos(start_pos) {}
@@ -90,6 +96,7 @@ public:
     value_type *operator->() { return &(operator*()); }
     self_type  &operator++() { ++m_pos; return *this; }
     bool        operator!=(const self_type& other) { return &m_buf != &other.m_buf || m_pos != other.m_pos; }
+    bool        operator==(const self_type& other) { return &m_buf == &other.m_buf && m_pos == other.m_pos; }
 };
 
 }; // namespace o3tl
diff --git a/include/sfx2/event.hxx b/include/sfx2/event.hxx
index 5b4970d..dbb0fa7 100644
--- a/include/sfx2/event.hxx
+++ b/include/sfx2/event.hxx
@@ -121,7 +121,7 @@ public:
                 const css::uno::Reference< css::frame::XController2 >& xController )
         : SfxViewEventHint(
             SFX_EVENT_PRINTDOC,
-            GlobalEventConfig::GetEventName( STR_EVENT_PRINTDOC ),
+            GlobalEventConfig::GetEventName( GlobalEventId::PRINTDOC ),
             pObj,
             xController )
         , mnPrintableState( nEvent )
diff --git a/include/unotools/eventcfg.hxx b/include/unotools/eventcfg.hxx
index d1cc6fe..ff11795 100644
--- a/include/unotools/eventcfg.hxx
+++ b/include/unotools/eventcfg.hxx
@@ -29,65 +29,41 @@
 #include <unordered_map>
 #include <vector>
 
-#define STR_EVENT_STARTAPP                   0
-#define STR_EVENT_CLOSEAPP                   1
-#define STR_EVENT_DOCCREATED                 2
-#define STR_EVENT_CREATEDOC                  3
-#define STR_EVENT_LOADFINISHED               4
-#define STR_EVENT_OPENDOC                    5
-#define STR_EVENT_PREPARECLOSEDOC            6
-#define STR_EVENT_CLOSEDOC                   7
-#define STR_EVENT_SAVEDOC                    8
-#define STR_EVENT_SAVEDOCDONE                9
-#define STR_EVENT_SAVEDOCFAILED             10
-#define STR_EVENT_SAVEASDOC                 11
-#define STR_EVENT_SAVEASDOCDONE             12
-#define STR_EVENT_SAVEASDOCFAILED           13
-#define STR_EVENT_SAVETODOC                 14
-#define STR_EVENT_SAVETODOCDONE             15
-#define STR_EVENT_SAVETODOCFAILED           16
-#define STR_EVENT_ACTIVATEDOC               17
-#define STR_EVENT_DEACTIVATEDOC             18
-#define STR_EVENT_PRINTDOC                  19
-#define STR_EVENT_VIEWCREATED               20
-#define STR_EVENT_PREPARECLOSEVIEW          21
-#define STR_EVENT_CLOSEVIEW                 22
-#define STR_EVENT_MODIFYCHANGED             23
-#define STR_EVENT_TITLECHANGED              24
-#define STR_EVENT_VISAREACHANGED            25
-#define STR_EVENT_MODECHANGED               26
-#define STR_EVENT_STORAGECHANGED            27
-
-typedef std::unordered_map< OUString, OUString, OUStringHash, std::equal_to< OUString > > EventBindingHash;
-typedef std::vector< css::uno::WeakReference< css::frame::XFrame > > FrameVector;
-typedef std::vector< OUString > SupportedEventsVector;
-
-class GlobalEventConfig_Impl : public utl::ConfigItem
+enum class GlobalEventId
 {
-private:
-    EventBindingHash m_eventBindingHash;
-    FrameVector m_lFrames;
-    SupportedEventsVector m_supportedEvents;
-
-    void initBindingInfo();
-
-    virtual void ImplCommit() SAL_OVERRIDE;
-
-public:
-    GlobalEventConfig_Impl( );
-    virtual ~GlobalEventConfig_Impl( );
-
-    void            Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames) SAL_OVERRIDE;
-
-    void SAL_CALL replaceByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-    ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
-    ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames(  ) throw (::com::sun::star::uno::RuntimeException);
-    bool SAL_CALL hasByName( const OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
-    ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw (::com::sun::star::uno::RuntimeException);
-    bool SAL_CALL hasElements(  ) throw (::com::sun::star::uno::RuntimeException);
-    OUString GetEventName( sal_Int32 nID );
+    STARTAPP,
+    CLOSEAPP,
+    DOCCREATED,
+    CREATEDOC,
+    LOADFINISHED,
+    OPENDOC,
+    PREPARECLOSEDOC,
+    CLOSEDOC,
+    SAVEDOC,
+    SAVEDOCDONE,
+    SAVEDOCFAILED,
+    SAVEASDOC,
+    SAVEASDOCDONE,
+    SAVEASDOCFAILED,
+    SAVETODOC,
+    SAVETODOCDONE,
+    SAVETODOCFAILED,
+    ACTIVATEDOC,
+    DEACTIVATEDOC,
+    PRINTDOC,
+    VIEWCREATED,
+    PREPARECLOSEVIEW,
+    CLOSEVIEW,
+    MODIFYCHANGED,
+    TITLECHANGED,
+    VISAREACHANGED,
+    MODECHANGED,
+    STORAGECHANGED,
+    LAST = STORAGECHANGED
 };
 
+class GlobalEventConfig_Impl;
+
 class UNOTOOLS_DLLPUBLIC GlobalEventConfig:
         public ::cppu::WeakImplHelper2 < ::com::sun::star::document::XEventsSupplier, ::com::sun::star::container::XNameReplace >
 {
@@ -103,7 +79,7 @@ class UNOTOOLS_DLLPUBLIC GlobalEventConfig:
         sal_Bool SAL_CALL hasByName( const OUString& aName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
         ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
         sal_Bool SAL_CALL hasElements(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
-        static OUString GetEventName( sal_Int32 nID );
+        static OUString GetEventName( GlobalEventId nID );
 
     private:
         static GlobalEventConfig_Impl* m_pImpl;
diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx
index 078060d..d0415ab 100644
--- a/sc/source/ui/vba/vbaeventshelper.cxx
+++ b/sc/source/ui/vba/vbaeventshelper.cxx
@@ -564,36 +564,36 @@ ScVbaEventsHelper::~ScVbaEventsHelper()
 void SAL_CALL ScVbaEventsHelper::notifyEvent( const css::document::EventObject& rEvent ) throw (css::uno::RuntimeException, std::exception)
 {
     static const uno::Sequence< uno::Any > saEmptyArgs;
-    if( (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_OPENDOC )) ||
-        (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_CREATEDOC )) )  // CREATEDOC triggered e.g. during VBA Workbooks.Add
+    if( (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::OPENDOC )) ||
+        (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::CREATEDOC )) )  // CREATEDOC triggered e.g. during VBA Workbooks.Add
     {
         processVbaEventNoThrow( WORKBOOK_OPEN, saEmptyArgs );
     }
-    else if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC ) )
+    else if( rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::ACTIVATEDOC ) )
     {
         processVbaEventNoThrow( WORKBOOK_ACTIVATE, saEmptyArgs );
     }
-    else if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_DEACTIVATEDOC ) )
+    else if( rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::DEACTIVATEDOC ) )
     {
         processVbaEventNoThrow( WORKBOOK_DEACTIVATE, saEmptyArgs );
     }
-    else if( (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_SAVEDOCDONE )) ||
-             (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_SAVEASDOCDONE )) ||
-             (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_SAVETODOCDONE )) )
+    else if( (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::SAVEDOCDONE )) ||
+             (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::SAVEASDOCDONE )) ||
+             (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::SAVETODOCDONE )) )
     {
         uno::Sequence< uno::Any > aArgs( 1 );
         aArgs[ 0 ] <<= true;
         processVbaEventNoThrow( WORKBOOK_AFTERSAVE, aArgs );
     }
-    else if( (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_SAVEDOCFAILED )) ||
-             (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_SAVEASDOCFAILED )) ||
-             (rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_SAVETODOCFAILED )) )
+    else if( (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::SAVEDOCFAILED )) ||
+             (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::SAVEASDOCFAILED )) ||
+             (rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::SAVETODOCFAILED )) )
     {
         uno::Sequence< uno::Any > aArgs( 1 );
         aArgs[ 0 ] <<= false;
         processVbaEventNoThrow( WORKBOOK_AFTERSAVE, aArgs );
     }
-    else if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ) )
+    else if( rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ) )
     {
         /*  Trigger the WORKBOOK_WINDOWDEACTIVATE and WORKBOOK_DEACTIVATE
             events and stop listening to the model (done in base class). */
@@ -606,7 +606,7 @@ void SAL_CALL ScVbaEventsHelper::notifyEvent( const css::document::EventObject&
         }
         processVbaEventNoThrow( WORKBOOK_DEACTIVATE, saEmptyArgs );
     }
-    else if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ) )
+    else if( rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::VIEWCREATED ) )
     {
         uno::Reference< frame::XController > xController( mxModel->getCurrentController() );
         if( mxListener.get() && xController.is() )
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index ad88d77..290ded1 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -333,7 +333,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
         if ( pOldContainerFrame )
         {
             if ( bTaskActivate )
-                NotifyEvent( SfxViewEventHint( SFX_EVENT_DEACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_DEACTIVATEDOC), pOldContainerFrame->GetObjectShell(), pOldContainerFrame->GetFrame().GetController() ) );
+                NotifyEvent( SfxViewEventHint( SFX_EVENT_DEACTIVATEDOC, GlobalEventConfig::GetEventName(GlobalEventId::DEACTIVATEDOC), pOldContainerFrame->GetObjectShell(), pOldContainerFrame->GetFrame().GetController() ) );
             pOldContainerFrame->DoDeactivate( bTaskActivate, pFrame );
 
             if( pOldContainerFrame->GetProgress() )
@@ -348,7 +348,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
             if ( bTaskActivate && pNewContainerFrame->GetObjectShell() )
             {
                 pNewContainerFrame->GetObjectShell()->PostActivateEvent_Impl( pNewContainerFrame );
-                NotifyEvent(SfxViewEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_ACTIVATEDOC), pNewContainerFrame->GetObjectShell(), pNewContainerFrame->GetFrame().GetController() ) );
+                NotifyEvent(SfxViewEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName(GlobalEventId::ACTIVATEDOC), pNewContainerFrame->GetObjectShell(), pNewContainerFrame->GetFrame().GetController() ) );
             }
 
             SfxProgress *pProgress = pNewContainerFrame->GetProgress();
diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx
index a5f9070..1a04f97 100644
--- a/sfx2/source/doc/objembed.cxx
+++ b/sfx2/source/doc/objembed.cxx
@@ -124,7 +124,7 @@ void SfxObjectShell::SetVisArea( const Rectangle & rVisArea )
             if ( IsEnableSetModified() )
                 SetModified( true );
 
-               SfxGetpApp()->NotifyEvent(SfxEventHint( SFX_EVENT_VISAREACHANGED, GlobalEventConfig::GetEventName(STR_EVENT_VISAREACHANGED), this));
+               SfxGetpApp()->NotifyEvent(SfxEventHint( SFX_EVENT_VISAREACHANGED, GlobalEventConfig::GetEventName(GlobalEventId::VISAREACHANGED), this));
         }
     }
 }
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 98dbc7f..3aa6521 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -369,7 +369,7 @@ void SfxObjectShell::ModifyChanged()
     Invalidate( SID_MACRO_SIGNATURE );
     Broadcast( SfxSimpleHint( SFX_HINT_TITLECHANGED ) );    // xmlsec05, signed state might change in title...
 
-    SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_MODIFYCHANGED, GlobalEventConfig::GetEventName(STR_EVENT_MODIFYCHANGED), this ) );
+    SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_MODIFYCHANGED, GlobalEventConfig::GetEventName(GlobalEventId::MODIFYCHANGED), this ) );
 }
 
 
@@ -1030,9 +1030,9 @@ void SfxObjectShell::PostActivateEvent_Impl( SfxViewFrame* pFrame )
             sal_uInt16 nId = pImp->nEventId;
             pImp->nEventId = 0;
             if ( nId == SFX_EVENT_OPENDOC )
-                pSfxApp->NotifyEvent(SfxViewEventHint( nId, GlobalEventConfig::GetEventName(STR_EVENT_OPENDOC), this, pFrame->GetFrame().GetController() ), false);
+                pSfxApp->NotifyEvent(SfxViewEventHint( nId, GlobalEventConfig::GetEventName(GlobalEventId::OPENDOC), this, pFrame->GetFrame().GetController() ), false);
             else if (nId == SFX_EVENT_CREATEDOC )
-                pSfxApp->NotifyEvent(SfxViewEventHint( nId, GlobalEventConfig::GetEventName(STR_EVENT_CREATEDOC), this, pFrame->GetFrame().GetController() ), false);
+                pSfxApp->NotifyEvent(SfxViewEventHint( nId, GlobalEventConfig::GetEventName(GlobalEventId::CREATEDOC), this, pFrame->GetFrame().GetController() ), false);
         }
     }
 }
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index d181c62..afd3de2 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3115,7 +3115,7 @@ uno::Reference< embed::XStorage > SfxObjectShell::GetStorage()
 
             SetupStorage( pImp->m_xDocStorage, SOFFICE_FILEFORMAT_CURRENT, false, false );
             pImp->m_bCreateTempStor = false;
-            SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(STR_EVENT_STORAGECHANGED), this ) );
+            SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(GlobalEventId::STORAGECHANGED), this ) );
         }
         catch( uno::Exception& )
         {
@@ -3266,7 +3266,7 @@ bool SfxObjectShell::SaveCompleted( const uno::Reference< embed::XStorage >& xSt
 
     if ( bSendNotification )
     {
-        SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(STR_EVENT_STORAGECHANGED), this ) );
+        SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(GlobalEventId::STORAGECHANGED), this ) );
     }
 
     return bResult;
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 4e562e5..bfbe5d3 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -607,7 +607,7 @@ bool SfxObjectShell::PrepareClose
     }
 
     SfxApplication *pSfxApp = SfxGetpApp();
-    pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, GlobalEventConfig::GetEventName(STR_EVENT_PREPARECLOSEDOC), this) );
+    pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, GlobalEventConfig::GetEventName(GlobalEventId::PREPARECLOSEDOC), this) );
 
     if( GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
     {
@@ -1155,11 +1155,11 @@ void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew )
     if ( i_fromInitNew )
     {
         SetActivateEvent_Impl( SFX_EVENT_CREATEDOC );
-        SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(STR_EVENT_DOCCREATED), this ) );
+        SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(GlobalEventId::DOCCREATED), this ) );
     }
     else
     {
-        SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) );
+        SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(GlobalEventId::LOADFINISHED), this ) );
     }
 }
 
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index bc1f5e4..20f15ee 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1576,7 +1576,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const    Sequence< beans::PropertyValue >
         SfxAllItemSet *pParams = new SfxAllItemSet( SfxGetpApp()->GetPool() );
         TransformParameters( nSlotId, aArgs, *pParams );
 
-        SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOC, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOC), m_pData->m_pObjectShell ) );
+        SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOC, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOC), m_pData->m_pObjectShell ) );
 
         bool bRet = false;
 
@@ -1617,7 +1617,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const    Sequence< beans::PropertyValue >
             m_pData->m_pObjectShell->AddLog( OUString( OSL_LOG_PREFIX "successful saving."  ) );
             m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
 
-            SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOCDONE), m_pData->m_pObjectShell ) );
+            SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCDONE), m_pData->m_pObjectShell ) );
         }
         else
         {
@@ -1625,7 +1625,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const    Sequence< beans::PropertyValue >
             m_pData->m_pObjectShell->StoreLog();
 
             // write the contents of the logger to the file
-            SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCFAILED, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOCFAILED), m_pData->m_pObjectShell ) );
+            SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCFAILED, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCFAILED), m_pData->m_pObjectShell ) );
 
             throw task::ErrorCodeIOException(
                 "SfxBaseModel::storeSelf: 0x" + OUString::number(nErrCode, 16),
@@ -2831,11 +2831,11 @@ void SfxBaseModel::Notify(          SfxBroadcaster& rBC     ,
             {
                 OUString aTitle = m_pData->m_pObjectShell->GetTitle();
                 addTitle_Impl( m_pData->m_seqArguments, aTitle );
-                postEvent_Impl( GlobalEventConfig::GetEventName( STR_EVENT_TITLECHANGED ) );
+                postEvent_Impl( GlobalEventConfig::GetEventName( GlobalEventId::TITLECHANGED ) );
             }
             if ( pSimpleHint->GetId() == SFX_HINT_MODECHANGED )
             {
-                postEvent_Impl( GlobalEventConfig::GetEventName( STR_EVENT_MODECHANGED ) );
+                postEvent_Impl( GlobalEventConfig::GetEventName( GlobalEventId::MODECHANGED ) );
             }
         }
     }
@@ -3008,7 +3008,7 @@ void SfxBaseModel::impl_store(  const   OUString&                   sURL
 
     if ( !bSaved && m_pData->m_pObjectShell )
     {
-        SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOC : SFX_EVENT_SAVEASDOC, GlobalEventConfig::GetEventName( bSaveTo ? STR_EVENT_SAVETODOC : STR_EVENT_SAVEASDOC ),
+        SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOC : SFX_EVENT_SAVEASDOC, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOC : GlobalEventId::SAVEASDOC ),
                                                 m_pData->m_pObjectShell ) );
 
         SfxAllItemSet *aParams = new SfxAllItemSet( SfxGetpApp()->GetPool() );
@@ -3108,14 +3108,14 @@ void SfxBaseModel::impl_store(  const   OUString&                   sURL
                 m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
                 m_pData->m_pObjectShell->SetModifyPasswordEntered();
 
-                SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEASDOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVEASDOCDONE), m_pData->m_pObjectShell ) );
+                SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEASDOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVEASDOCDONE), m_pData->m_pObjectShell ) );
             }
             else
             {
                 m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
                 m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );
 
-                SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVETODOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVETODOCDONE), m_pData->m_pObjectShell ) );
+                SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVETODOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVETODOCDONE), m_pData->m_pObjectShell ) );
             }
         }
         else
@@ -3128,7 +3128,7 @@ void SfxBaseModel::impl_store(  const   OUString&                   sURL
             m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );
 
 
-            SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOCFAILED : SFX_EVENT_SAVEASDOCFAILED, GlobalEventConfig::GetEventName( bSaveTo ? STR_EVENT_SAVETODOCFAILED : STR_EVENT_SAVEASDOCFAILED),
+            SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOCFAILED : SFX_EVENT_SAVEASDOCFAILED, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOCFAILED : GlobalEventId::SAVEASDOCFAILED),
                                                     m_pData->m_pObjectShell ) );
 
             throw task::ErrorCodeIOException(
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index c830ff5..29fbf42 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -207,7 +207,7 @@ bool SfxFrame::PrepareClose_Impl( bool bUI )
                 bOther = ( &pFrame->GetFrame() != this );
             }
 
-            SfxGetpApp()->NotifyEvent( SfxViewEventHint(SFX_EVENT_PREPARECLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEVIEW ), pCur, GetController() ) );
+            SfxGetpApp()->NotifyEvent( SfxViewEventHint(SFX_EVENT_PREPARECLOSEVIEW, GlobalEventConfig::GetEventName( GlobalEventId::PREPARECLOSEVIEW ), pCur, GetController() ) );
 
             if ( bOther )
                 // if there are other views only the current view of this frame must be asked
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 22d283b..2bcac22 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -571,7 +571,7 @@ void SAL_CALL SfxBaseController::attachFrame( const Reference< frame::XFrame >&
             ShowInfoBars( );
 
             // attaching the frame to the controller is the last step in the creation of a new view, so notify this
-            SfxViewEventHint aHint( SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), m_pData->m_pViewShell->GetObjectShell(), Reference< frame::XController2 >( this ) );
+            SfxViewEventHint aHint( SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( GlobalEventId::VIEWCREATED ), m_pData->m_pViewShell->GetObjectShell(), Reference< frame::XController2 >( this ) );
             SfxGetpApp()->NotifyEvent( aHint );
         }
     }
@@ -1000,9 +1000,9 @@ void SAL_CALL SfxBaseController::dispose() throw( RuntimeException, std::excepti
                 pView = SfxViewFrame::GetNext( *pView, pDoc );
             }
 
-            SfxGetpApp()->NotifyEvent( SfxViewEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEVIEW ), pDoc, Reference< frame::XController2 >( this ) ) );
+            SfxGetpApp()->NotifyEvent( SfxViewEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEVIEW ), pDoc, Reference< frame::XController2 >( this ) ) );
             if ( !pView )
-                SfxGetpApp()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), pDoc) );
+                SfxGetpApp()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ), pDoc) );
 
             Reference< frame::XModel > xModel = pDoc->GetModel();
             Reference < util::XCloseable > xCloseable( xModel, uno::UNO_QUERY );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index cfae5c1..124a1f6 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -822,7 +822,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
                     }
 
                     // Propagate document closure.
-                    SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), xOldObj ) );
+                    SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ), xOldObj ) );
                 }
 
                 // Record as done
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index d478a4a..1ffc411 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -316,7 +316,7 @@ void SfxPrinterController::jobStarted()
 
         xDocProps->setPrintDate( now.GetUNODateTime() );
 
-        SfxGetpApp()->NotifyEvent( SfxEventHint(SFX_EVENT_PRINTDOC, GlobalEventConfig::GetEventName( STR_EVENT_PRINTDOC ), mpObjectShell ) );
+        SfxGetpApp()->NotifyEvent( SfxEventHint(SFX_EVENT_PRINTDOC, GlobalEventConfig::GetEventName( GlobalEventId::PRINTDOC ), mpObjectShell ) );
         uno::Sequence < beans::PropertyValue > aOpts;
         aOpts = getJobProperties( aOpts );
 
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index c96cd46..1e41db8 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -171,7 +171,7 @@ void SmDocShell::SetText(const OUString& rBuffer)
                 // have SwOleClient::FormatChanged() to align the modified formula properly
                 // even if the vis area does not change (e.g. when formula text changes from
                 // "{a over b + c} over d" to "d over {a over b + c}"
-                SfxGetpApp()->NotifyEvent(SfxEventHint( SFX_EVENT_VISAREACHANGED, GlobalEventConfig::GetEventName(STR_EVENT_VISAREACHANGED), this));
+                SfxGetpApp()->NotifyEvent(SfxEventHint( SFX_EVENT_VISAREACHANGED, GlobalEventConfig::GetEventName(GlobalEventId::VISAREACHANGED), this));
 
                 Repaint();
             }
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 9eebbfa..84e90e5 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -882,7 +882,7 @@ void SwHTMLParser::InsertBodyOptions()
                 eScriptType2 = STARBASIC;
                 //fallthrough
             case HTML_O_ONLOAD:
-                aEvent = GlobalEventConfig::GetEventName( STR_EVENT_OPENDOC );
+                aEvent = GlobalEventConfig::GetEventName( GlobalEventId::OPENDOC );
                 bSetEvent = true;
                 break;
 
@@ -890,7 +890,7 @@ void SwHTMLParser::InsertBodyOptions()
                 eScriptType2 = STARBASIC;
                 //fallthrough
             case HTML_O_ONUNLOAD:
-                aEvent = GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEDOC );
+                aEvent = GlobalEventConfig::GetEventName( GlobalEventId::PREPARECLOSEDOC );
                 bSetEvent = true;
                 break;
 
@@ -898,7 +898,7 @@ void SwHTMLParser::InsertBodyOptions()
                 eScriptType2 = STARBASIC;
                 //fallthrough
             case HTML_O_ONFOCUS:
-                aEvent = GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC );
+                aEvent = GlobalEventConfig::GetEventName( GlobalEventId::ACTIVATEDOC );
                 bSetEvent = true;
                 break;
 
@@ -906,7 +906,7 @@ void SwHTMLParser::InsertBodyOptions()
                 eScriptType2 = STARBASIC;
                 //fallthrough
             case HTML_O_ONBLUR:
-                aEvent = GlobalEventConfig::GetEventName( STR_EVENT_DEACTIVATEDOC );
+                aEvent = GlobalEventConfig::GetEventName( GlobalEventId::DEACTIVATEDOC );
                 bSetEvent = true;
                 break;
 
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 706015d..880ed86 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -657,10 +657,10 @@ void SwDocShell::Execute(SfxRequest& rReq)
                         pSrcView->SaveContent(aTempFile.GetURL());
                         bDone = true;
                         SvxMacro aMac(aEmptyOUStr, aEmptyOUStr, STARBASIC);
-                        SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_OPENDOC ), aMac, this);
-                        SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEDOC ), aMac, this);
-                        SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_ACTIVATEDOC ),     aMac, this);
-                        SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( STR_EVENT_DEACTIVATEDOC ), aMac, this);
+                        SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( GlobalEventId::OPENDOC ), aMac, this);
+                        SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( GlobalEventId::PREPARECLOSEDOC ), aMac, this);
+                        SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( GlobalEventId::ACTIVATEDOC ),     aMac, this);
+                        SfxEventConfiguration::ConfigureEvent(GlobalEventConfig::GetEventName( GlobalEventId::DEACTIVATEDOC ), aMac, this);
                         ReloadFromHtml(aTempFile.GetURL(), pSrcView);
                         nSlot = 0;
                     }
diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx
index e5b0d4d..313542c 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -24,6 +24,8 @@
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <cppuhelper/weakref.hxx>
+#include <o3tl/enumarray.hxx>
+#include <o3tl/enumrange.hxx>
 
 #include <rtl/ustrbuf.hxx>
 #include <osl/diagnose.h>
@@ -43,7 +45,7 @@ static const char ROOTNODE_EVENTS[] = "Office.Events/ApplicationEvents";
 #define SETNODE_BINDINGS "Bindings"
 #define PROPERTYNAME_BINDINGURL "BindingURL"
 
-const char* pEventAsciiNames[] =
+static o3tl::enumarray<GlobalEventId, const char*> pEventAsciiNames =
 {
 "OnStartApp",
 "OnCloseApp",
@@ -75,38 +77,43 @@ const char* pEventAsciiNames[] =
 "OnStorageChanged"
 };
 
+typedef std::unordered_map< OUString, OUString, OUStringHash, std::equal_to< OUString > > EventBindingHash;
+typedef std::vector< css::uno::WeakReference< css::frame::XFrame > > FrameVector;
+typedef o3tl::enumarray< GlobalEventId, OUString > SupportedEventsVector;
+
+class GlobalEventConfig_Impl : public utl::ConfigItem
+{
+private:
+    EventBindingHash m_eventBindingHash;
+    FrameVector m_lFrames;
+    SupportedEventsVector m_supportedEvents;
+
+    void initBindingInfo();
+
+    virtual void ImplCommit() SAL_OVERRIDE;
+
+public:
+    GlobalEventConfig_Impl( );
+    virtual ~GlobalEventConfig_Impl( );
+
+    void            Notify( const com::sun::star::uno::Sequence<OUString>& aPropertyNames) SAL_OVERRIDE;
+
+    void SAL_CALL replaceByName( const OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+    ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+    ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames(  ) throw (::com::sun::star::uno::RuntimeException);
+    bool SAL_CALL hasByName( const OUString& aName ) throw (::com::sun::star::uno::RuntimeException);
+    ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw (::com::sun::star::uno::RuntimeException);
+    bool SAL_CALL hasElements(  ) throw (::com::sun::star::uno::RuntimeException);
+    OUString GetEventName( GlobalEventId nID );
+};
+
+
 GlobalEventConfig_Impl::GlobalEventConfig_Impl()
     :   ConfigItem( ROOTNODE_EVENTS, CONFIG_MODE_IMMEDIATE_UPDATE )
 {
     // the supported event names
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_STARTAPP] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_CLOSEAPP] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_DOCCREATED] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_CREATEDOC] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_LOADFINISHED] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_OPENDOC] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_PREPARECLOSEDOC] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_CLOSEDOC] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEDOC] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEDOCDONE] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEDOCFAILED] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEASDOC] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEASDOCDONE] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVEASDOCFAILED] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVETODOC] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVETODOCDONE] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_SAVETODOCFAILED] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_ACTIVATEDOC] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_DEACTIVATEDOC] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_PRINTDOC] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_VIEWCREATED] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_PREPARECLOSEVIEW] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_CLOSEVIEW] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_MODIFYCHANGED] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_TITLECHANGED] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_VISAREACHANGED] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_MODECHANGED] ) );
-    m_supportedEvents.push_back(OUString::createFromAscii( pEventAsciiNames[STR_EVENT_STORAGECHANGED] ) );
+    for (GlobalEventId id : o3tl::enumrange<GlobalEventId>())
+        m_supportedEvents[id] = OUString::createFromAscii( pEventAsciiNames[id] );
 
     initBindingInfo();
 
@@ -125,12 +132,9 @@ GlobalEventConfig_Impl::~GlobalEventConfig_Impl()
     assert(!IsModified()); // should have been committed
 }
 
-OUString GlobalEventConfig_Impl::GetEventName( sal_Int32 nIndex )
+OUString GlobalEventConfig_Impl::GetEventName( GlobalEventId nIndex )
 {
-    if ( nIndex < (sal_Int32) m_supportedEvents.size() )
-        return m_supportedEvents[nIndex];
-    else
-        return OUString();
+    return m_supportedEvents[nIndex];
 }
 
 //  public method
@@ -257,7 +261,7 @@ Any SAL_CALL GlobalEventConfig_Impl::getByName( const OUString& aName ) throw (c
     else
     {
         // not yet accessed - is it a supported name?
-        SupportedEventsVector::const_iterator pos = ::std::find(
+        SupportedEventsVector::iterator pos = ::std::find(
             m_supportedEvents.begin(), m_supportedEvents.end(), aName );
         if ( pos == m_supportedEvents.end() )
             throw container::NoSuchElementException( aName );
@@ -270,7 +274,7 @@ Any SAL_CALL GlobalEventConfig_Impl::getByName( const OUString& aName ) throw (c
 
 Sequence< OUString > SAL_CALL GlobalEventConfig_Impl::getElementNames(  ) throw (RuntimeException)
 {
-    return uno::Sequence< OUString >(m_supportedEvents.data(), m_supportedEvents.size());
+    return uno::Sequence< OUString >(m_supportedEvents.data(), SupportedEventsVector::size());
 }
 
 bool SAL_CALL GlobalEventConfig_Impl::hasByName( const OUString& aName ) throw (RuntimeException)
@@ -279,7 +283,7 @@ bool SAL_CALL GlobalEventConfig_Impl::hasByName( const OUString& aName ) throw (
         return true;
 
     // never accessed before - is it supported in general?
-    SupportedEventsVector::const_iterator pos = ::std::find(
+    SupportedEventsVector::iterator pos = ::std::find(
         m_supportedEvents.begin(), m_supportedEvents.end(), aName );
     if ( pos != m_supportedEvents.end() )
         return true;
@@ -381,7 +385,7 @@ Mutex& GlobalEventConfig::GetOwnStaticMutex()
     return theGlobalEventConfigMutex::get();
 }
 
-OUString GlobalEventConfig::GetEventName( sal_Int32 nIndex )
+OUString GlobalEventConfig::GetEventName( GlobalEventId nIndex )
 {
     return GlobalEventConfig().m_pImpl->GetEventName( nIndex );
 }
diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
index c7a1e08..e681058 100644
--- a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
+++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx
@@ -132,7 +132,7 @@ sal_Bool SAL_CALL VbaEventsHelperBase::processVbaEvent( sal_Int32 nEventId, cons
 void SAL_CALL VbaEventsHelperBase::notifyEvent( const document::EventObject& rEvent ) throw (uno::RuntimeException, std::exception)
 {
     SAL_INFO("vbahelper", "VbaEventsHelperBase::notifyEvent( \"" << rEvent.EventName << "\" )");
-    if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ) )
+    if( rEvent.EventName == GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ) )
         stopListening();
 }
 
commit a9bfa6547ae2a4721363289f3816568e6a7e6a2d
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Apr 28 14:14:05 2015 +0200

    convert INITOUTDEV constants to scoped enum
    
    Change-Id: Ic2443b557620bd269851d64f42107b304f6b4082

diff --git a/include/toolkit/awt/vclxgraphics.hxx b/include/toolkit/awt/vclxgraphics.hxx
index 89a568f..fdd3d40 100644
--- a/include/toolkit/awt/vclxgraphics.hxx
+++ b/include/toolkit/awt/vclxgraphics.hxx
@@ -32,16 +32,23 @@
 #include <tools/color.hxx>
 #include <vcl/vclenum.hxx>
 #include <vcl/vclptr.hxx>
+#include <o3tl/typed_flags_set.hxx>
 
 class OutputDevice;
 namespace vcl { class Region; }
 
 
-#define INITOUTDEV_FONT         0x0001
-#define INITOUTDEV_COLORS       0x0002
-#define INITOUTDEV_RASTEROP     0x0004
-#define INITOUTDEV_CLIPREGION   0x0008
-
+enum class InitOutDevFlags
+{
+    FONT         = 0x0001,
+    COLORS       = 0x0002,
+    RASTEROP     = 0x0004,
+    CLIPREGION   = 0x0008,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<InitOutDevFlags> : is_typed_flags<InitOutDevFlags, 0x0f> {};
+}
 
 
 //  class VCLXGraphics
@@ -72,7 +79,7 @@ public:
                     virtual ~VCLXGraphics();
 
     void            Init( OutputDevice* pOutDev );
-    void            InitOutputDevice( sal_uInt16 nFlags );
+    void            InitOutputDevice( InitOutDevFlags nFlags );
 
     void            SetOutputDevice( OutputDevice* pOutDev );
     OutputDevice*   GetOutputDevice() const { return mpOutputDevice; }
diff --git a/toolkit/source/awt/vclxgraphics.cxx b/toolkit/source/awt/vclxgraphics.cxx
index ee009e8..f4155b1 100644
--- a/toolkit/source/awt/vclxgraphics.cxx
+++ b/toolkit/source/awt/vclxgraphics.cxx
@@ -117,31 +117,31 @@ void VCLXGraphics::initAttrs()
     meRasterOp      = mpOutputDevice->GetRasterOp(); /* ROP_OVERPAINT */
 }
 
-void VCLXGraphics::InitOutputDevice( sal_uInt16 nFlags )
+void VCLXGraphics::InitOutputDevice( InitOutDevFlags nFlags )
 {
     if(mpOutputDevice)
     {
         SolarMutexGuard aVclGuard;
 
-        if ( nFlags & INITOUTDEV_FONT )
+        if ( nFlags & InitOutDevFlags::FONT )
         {
             mpOutputDevice->SetFont( maFont );
             mpOutputDevice->SetTextColor( maTextColor );
             mpOutputDevice->SetTextFillColor( maTextFillColor );
         }
 
-        if ( nFlags & INITOUTDEV_COLORS )
+        if ( nFlags & InitOutDevFlags::COLORS )
         {
             mpOutputDevice->SetLineColor( maLineColor );
             mpOutputDevice->SetFillColor( maFillColor );
         }
 
-        if ( nFlags & INITOUTDEV_RASTEROP )
+        if ( nFlags & InitOutDevFlags::RASTEROP )
         {
             mpOutputDevice->SetRasterOp( meRasterOp );
         }
 
-        if ( nFlags & INITOUTDEV_CLIPREGION )
+        if ( nFlags & InitOutDevFlags::CLIPREGION )
         {
             if( mpClipRegion )
                 mpOutputDevice->SetClipRegion( *mpClipRegion );
@@ -292,7 +292,7 @@ void VCLXGraphics::copy( const uno::Reference< awt::XDevice >& rxSource, sal_Int
         DBG_ASSERT( pFromDev, "VCLXGraphics::copy - invalid device" );
         if ( pFromDev )
         {
-            InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP );
+            InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP );
             mpOutputDevice->DrawOutDev( Point( nDestX, nDestY ), Size( nDestWidth, nDestHeight ),
                                     Point( nSourceX, nSourceY ), Size( nSourceWidth, nSourceHeight ), *pFromDev->GetOutputDevice() );
         }
@@ -305,7 +305,7 @@ void VCLXGraphics::draw( const uno::Reference< awt::XDisplayBitmap >& rxBitmapHa
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP);
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP);
         uno::Reference< awt::XBitmap > xBitmap( rxBitmapHandle, uno::UNO_QUERY );
         BitmapEx aBmpEx = VCLUnoHelper::GetBitmap( xBitmap );
 
@@ -337,7 +337,7 @@ void VCLXGraphics::drawPixel( sal_Int32 x, sal_Int32 y ) throw(uno::RuntimeExcep
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
         mpOutputDevice->DrawPixel( Point( x, y ) );
     }
 }
@@ -348,7 +348,7 @@ void VCLXGraphics::drawLine( sal_Int32 x1, sal_Int32 y1, sal_Int32 x2, sal_Int32
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
         mpOutputDevice->DrawLine( Point( x1, y1 ), Point( x2, y2 ) );
     }
 }
@@ -359,7 +359,7 @@ void VCLXGraphics::drawRect( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int3
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
         mpOutputDevice->DrawRect( Rectangle( Point( x, y ), Size( width, height ) ) );
     }
 }
@@ -370,7 +370,7 @@ void VCLXGraphics::drawRoundedRect( sal_Int32 x, sal_Int32 y, sal_Int32 width, s
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
         mpOutputDevice->DrawRect( Rectangle( Point( x, y ), Size( width, height ) ), nHorzRound, nVertRound );
     }
 }
@@ -381,7 +381,7 @@ void VCLXGraphics::drawPolyLine( const uno::Sequence< sal_Int32 >& DataX, const
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
         mpOutputDevice->DrawPolyLine( VCLUnoHelper::CreatePolygon( DataX, DataY ) );
     }
 }
@@ -392,7 +392,7 @@ void VCLXGraphics::drawPolygon( const uno::Sequence< sal_Int32 >& DataX, const u
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
         mpOutputDevice->DrawPolygon( VCLUnoHelper::CreatePolygon( DataX, DataY ) );
     }
 }
@@ -403,7 +403,7 @@ void VCLXGraphics::drawPolyPolygon( const uno::Sequence< uno::Sequence< sal_Int3
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
         sal_uInt16 nPolys = (sal_uInt16) DataX.getLength();
         tools::PolyPolygon aPolyPoly( nPolys );
         for ( sal_uInt16 n = 0; n < nPolys; n++ )
@@ -419,7 +419,7 @@ void VCLXGraphics::drawEllipse( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_I
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
         mpOutputDevice->DrawEllipse( Rectangle( Point( x, y ), Size( width, height ) ) );
     }
 }
@@ -430,7 +430,7 @@ void VCLXGraphics::drawArc( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
         mpOutputDevice->DrawArc( Rectangle( Point( x, y ), Size( width, height ) ), Point( x1, y1 ), Point( x2, y2 ) );
     }
 }
@@ -441,7 +441,7 @@ void VCLXGraphics::drawPie( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int32
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
         mpOutputDevice->DrawPie( Rectangle( Point( x, y ), Size( width, height ) ), Point( x1, y1 ), Point( x2, y2 ) );
     }
 }
@@ -452,7 +452,7 @@ void VCLXGraphics::drawChord( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
         mpOutputDevice->DrawChord( Rectangle( Point( x, y ), Size( width, height ) ), Point( x1, y1 ), Point( x2, y2 ) );
     }
 }
@@ -463,7 +463,7 @@ void VCLXGraphics::drawGradient( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
         Gradient aGradient((GradientStyle)rGradient.Style, rGradient.StartColor, rGradient.EndColor);
         aGradient.SetAngle(rGradient.Angle);
         aGradient.SetBorder(rGradient.Border);
@@ -482,7 +482,7 @@ void VCLXGraphics::drawText( sal_Int32 x, sal_Int32 y, const OUString& rText ) t
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS |INITOUTDEV_FONT);
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS |InitOutDevFlags::FONT);
         mpOutputDevice->DrawText( Point( x, y ), rText );
     }
 }
@@ -493,7 +493,7 @@ void VCLXGraphics::drawTextArray( sal_Int32 x, sal_Int32 y, const OUString& rTex
 
     if( mpOutputDevice )
     {
-        InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS|INITOUTDEV_FONT );
+        InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS|InitOutDevFlags::FONT );
         long* pDXA = static_cast<long*>(alloca(rText.getLength() * sizeof(long)));
         for(int i = 0; i < rText.getLength(); i++)
         {
@@ -513,7 +513,7 @@ void VCLXGraphics::drawImage( sal_Int32 x, sal_Int32 y, sal_Int32 width, sal_Int
         Image aImage( xGraphic );
         if ( !!aImage )
         {
-            InitOutputDevice( INITOUTDEV_CLIPREGION|INITOUTDEV_RASTEROP|INITOUTDEV_COLORS );
+            InitOutputDevice( InitOutDevFlags::CLIPREGION|InitOutDevFlags::RASTEROP|InitOutDevFlags::COLORS );
             mpOutputDevice->DrawImage( Point( x, y ), Size( width, height ), aImage, nStyle );
         }
     }
commit 5d96ccd0ab9d315aea85b4630f85feb29d2aa14a
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Apr 28 14:09:59 2015 +0200

    convert ZOOMBTN constants to scoped enum
    
    Change-Id: Ia7641f736fa4f84dce0b5ea8bf68339c1309e74b

diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx
index 5b2dff9..2465369 100644
--- a/cui/source/dialogs/zoom.cxx
+++ b/cui/source/dialogs/zoom.cxx
@@ -49,11 +49,11 @@ sal_uInt16 SvxZoomDialog::GetFactor() const
         return SPECIAL_FACTOR;
 }
 
-void SvxZoomDialog::SetFactor(sal_uInt16 nNewFactor, sal_uInt16 nButtonId)
+void SvxZoomDialog::SetFactor(sal_uInt16 nNewFactor, ZoomButtonId nButtonId)
 {
     m_pUserEdit->Disable();
 
-    if (!nButtonId)
+    if (nButtonId == ZoomButtonId::NONE)
     {
         if ( nNewFactor == 100 )
         {
@@ -73,41 +73,42 @@ void SvxZoomDialog::SetFactor(sal_uInt16 nNewFactor, sal_uInt16 nButtonId)
         m_pUserEdit->SetValue(static_cast<long>(nNewFactor));
         switch(nButtonId)
         {
-            case ZOOMBTN_OPTIMAL:
+            case ZoomButtonId::OPTIMAL:
             {
                 m_pOptimalBtn->Check();
                 m_pOptimalBtn->GrabFocus();
                 break;
             }
-            case ZOOMBTN_PAGEWIDTH:
+            case ZoomButtonId::PAGEWIDTH:
             {
                 m_pPageWidthBtn->Check();
                 m_pPageWidthBtn->GrabFocus();
                 break;
             }
-            case ZOOMBTN_WHOLEPAGE:
+            case ZoomButtonId::WHOLEPAGE:
             {
                 m_pWholePageBtn->Check();
                 m_pWholePageBtn->GrabFocus();
                 break;
             }
+            default: break;
         }
     }
 }
 
-void SvxZoomDialog::HideButton(sal_uInt16 nButtonId)
+void SvxZoomDialog::HideButton(ZoomButtonId nButtonId)
 {
     switch (nButtonId)
     {
-        case ZOOMBTN_OPTIMAL:
+        case ZoomButtonId::OPTIMAL:
             m_pOptimalBtn->Hide();
             break;
 
-        case ZOOMBTN_PAGEWIDTH:
+        case ZoomButtonId::PAGEWIDTH:
             m_pPageWidthBtn->Hide();
             break;
 
-        case ZOOMBTN_WHOLEPAGE:
+        case ZoomButtonId::WHOLEPAGE:
             m_pWholePageBtn->Hide();
             break;
 
@@ -208,18 +209,18 @@ SvxZoomDialog::SvxZoomDialog( vcl::Window* pParent, const SfxItemSet& rCoreSet )
         const sal_uInt16 nZoom = rZoomItem.GetValue();
         const SvxZoomType eType = rZoomItem.GetType();
         const SvxZoomEnableFlags nValSet = rZoomItem.GetValueSet();
-        sal_uInt16 nButtonId = 0;
+        ZoomButtonId nButtonId = ZoomButtonId::NONE;
 
         switch (eType)
         {
             case SvxZoomType::OPTIMAL:
-                nButtonId = ZOOMBTN_OPTIMAL;
+                nButtonId = ZoomButtonId::OPTIMAL;
                 break;
             case SvxZoomType::PAGEWIDTH:
-                nButtonId = ZOOMBTN_PAGEWIDTH;
+                nButtonId = ZoomButtonId::PAGEWIDTH;
                 break;
             case SvxZoomType::WHOLEPAGE:
-                nButtonId = ZOOMBTN_WHOLEPAGE;
+                nButtonId = ZoomButtonId::WHOLEPAGE;
                 break;
             case SvxZoomType::PERCENT:
                 break;
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 6158d9a..9b682d5 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -419,7 +419,7 @@ void AbstractSvxZoomDialog_Impl::SetLimits( sal_uInt16 nMin, sal_uInt16 nMax )
     pDlg->SetLimits( nMin, nMax );
 }
 
-void AbstractSvxZoomDialog_Impl::HideButton( sal_uInt16 nBtnId )
+void AbstractSvxZoomDialog_Impl::HideButton( ZoomButtonId nBtnId )
 {
     pDlg->HideButton( nBtnId );
 }
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 808a80c..69ecf5f 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_CUI_SOURCE_FACTORY_DLGFACT_HXX
 
 #include <svx/svxdlg.hxx>
+#include <svx/zoom_def.hxx>
 #include <com/sun/star/container/XNameReplace.hpp>
 
 #include "tools/link.hxx"
@@ -195,7 +196,7 @@ class AbstractSvxZoomDialog_Impl : public AbstractSvxZoomDialog
 {
     DECL_ABSTDLG_BASE(AbstractSvxZoomDialog_Impl,SvxZoomDialog)
     virtual void    SetLimits( sal_uInt16 nMin, sal_uInt16 nMax ) SAL_OVERRIDE;
-    virtual void    HideButton( sal_uInt16 nBtnId ) SAL_OVERRIDE;
+    virtual void    HideButton( ZoomButtonId nBtnId ) SAL_OVERRIDE;
     virtual const SfxItemSet*   GetOutputItemSet() const SAL_OVERRIDE ;
 
 };
diff --git a/cui/source/inc/zoom.hxx b/cui/source/inc/zoom.hxx
index 882be46..55bb1dc 100644
--- a/cui/source/inc/zoom.hxx
+++ b/cui/source/inc/zoom.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_CUI_SOURCE_INC_ZOOM_HXX
 
 #include <sfx2/basedlgs.hxx>
+#include <svx/zoom_def.hxx>
 #include <vcl/button.hxx>
 #include <vcl/field.hxx>
 #include <vcl/fixed.hxx>
@@ -62,9 +63,9 @@ public:
     const SfxItemSet* GetOutputItemSet() const;
 
     sal_uInt16 GetFactor() const;
-    void       SetFactor(sal_uInt16 nNewFactor, sal_uInt16 nButtonId = 0);
+    void       SetFactor(sal_uInt16 nNewFactor, ZoomButtonId nButtonId = ZoomButtonId::NONE);
 
-    void HideButton(sal_uInt16 nButtonId);
+    void HideButton(ZoomButtonId nButtonId);
     void SetLimits(sal_uInt16 nMin, sal_uInt16 nMax);
 };
 
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 87ada7a..1854f02 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_SVX_SVXDLG_HXX
 
 #include <sfx2/sfxdlg.hxx>
+#include <svx/zoom_def.hxx>
 #include <editeng/edtdlg.hxx>
 
 class SdrModel;
@@ -76,7 +77,7 @@ class AbstractSvxZoomDialog : public VclAbstractDialog
 {
  public:
     virtual void    SetLimits( sal_uInt16 nMin, sal_uInt16 nMax ) = 0;
-    virtual void    HideButton( sal_uInt16 nBtnId )= 0;
+    virtual void    HideButton( ZoomButtonId nBtnId )= 0;
     virtual const SfxItemSet*   GetOutputItemSet() const = 0 ;
 };
 
diff --git a/include/svx/zoom_def.hxx b/include/svx/zoom_def.hxx
index d618b77..0289805 100644
--- a/include/svx/zoom_def.hxx
+++ b/include/svx/zoom_def.hxx
@@ -20,9 +20,13 @@
 #ifndef INCLUDED_SVX_ZOOM_DEF_HXX
 #define INCLUDED_SVX_ZOOM_DEF_HXX
 
-#define ZOOMBTN_OPTIMAL     ((sal_uInt16)0x0001)
-#define ZOOMBTN_PAGEWIDTH   ((sal_uInt16)0x0002)
-#define ZOOMBTN_WHOLEPAGE   ((sal_uInt16)0x0004)
+enum class ZoomButtonId
+{
+    NONE        = 0x0000,
+    OPTIMAL     = 0x0001,
+    PAGEWIDTH   = 0x0002,
+    WHOLEPAGE   = 0x0004,
+};
 
 #endif
 
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index ef3ef07..dc8bd2d 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -652,7 +652,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
                         boost::scoped_ptr<AbstractSvxZoomDialog> pDlg(pFact->CreateSvxZoomDialog(NULL, aSet));
                         OSL_ENSURE(pDlg, "Dialog creation failed!");
                         pDlg->SetLimits( 20, 400 );
-                        pDlg->HideButton( ZOOMBTN_OPTIMAL );
+                        pDlg->HideButton( ZoomButtonId::OPTIMAL );
                         bCancel = ( RET_CANCEL == pDlg->Execute() );
 
                         if ( !bCancel )
commit 468446b7fd4c547ee3f090366e886c212657bcd1
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Apr 24 16:13:01 2015 +0200

    convert CT_ constants to scoped enum
    
    Change-Id: Icd1f009e879965feb936c6268688cdcd1edbd231

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index baa67bc..956ddb8 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -771,14 +771,14 @@ public:
 
     bool IsModified()
     {
-        return *pnColorListState & CT_MODIFIED;
+        return bool(*pnColorListState & ChangeType::MODIFIED);
     }
     void SetModified(bool bIsModified)
     {
         if (bIsModified)
-            *pnColorListState |= CT_MODIFIED;
+            *pnColorListState |= ChangeType::MODIFIED;
         else
-            *pnColorListState &= ~CT_MODIFIED;
+            *pnColorListState &= ~ChangeType::MODIFIED;
     }
     void AddState(ChangeType nState)
     {
diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index 3bb1f2b..a55dd13 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -22,6 +22,7 @@
 
 #include <vector>
 #include <svx/tabline.hxx>
+#include <svx/tabarea.hxx>
 
 class SvxLineTabDialog : public SfxTabDialog
 {
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index 56e54c8..53835ac 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -65,10 +65,10 @@ SvxAreaTabDialog::SvxAreaTabDialog
     mpNewBitmapList      ( pModel->GetBitmapList() ),
     mrOutAttrs           ( *pAttr ),
 
-    mnColorListState ( CT_NONE ),
-    mnBitmapListState ( CT_NONE ),
-    mnGradientListState ( CT_NONE ),
-    mnHatchingListState ( CT_NONE ),
+    mnColorListState ( ChangeType::NONE ),
+    mnBitmapListState ( ChangeType::NONE ),
+    mnGradientListState ( ChangeType::NONE ),
+    mnHatchingListState ( ChangeType::NONE ),
     mnPageType( PT_AREA ),
     mnPos( 0 ),
     mbAreaTP( false )
@@ -144,7 +144,7 @@ void SvxAreaTabDialog::SavePalettes()
 
     const OUString aPath( SvtPathOptions().GetPalettePath() );
 
-    if( mnHatchingListState & CT_MODIFIED )
+    if( mnHatchingListState & ChangeType::MODIFIED )
     {
         mpHatchingList->SetPath( aPath );
         mpHatchingList->Save();
@@ -157,7 +157,7 @@ void SvxAreaTabDialog::SavePalettes()
             mpDrawModel->GetItemPool().Put(aItem);
     }
 
-    if( mnBitmapListState & CT_MODIFIED )
+    if( mnBitmapListState & ChangeType::MODIFIED )
     {
         mpBitmapList->SetPath( aPath );
         mpBitmapList->Save();
@@ -172,7 +172,7 @@ void SvxAreaTabDialog::SavePalettes()
         }
     }
 
-    if( mnGradientListState & CT_MODIFIED )
+    if( mnGradientListState & ChangeType::MODIFIED )
     {
         mpGradientList->SetPath( aPath );
         mpGradientList->Save();
@@ -187,7 +187,7 @@ void SvxAreaTabDialog::SavePalettes()
         }
     }
 
-    if (mnColorListState & CT_MODIFIED && mpColorList.is())
+    if (mnColorListState & ChangeType::MODIFIED && mpColorList.is())
     {
         mpColorList->SetPath( aPath );
         mpColorList->Save();
diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx
index f9ee914..71a7a56 100644
--- a/cui/source/tabpages/tabline.cxx
+++ b/cui/source/tabpages/tabline.cxx
@@ -60,9 +60,9 @@ SvxLineTabDialog::SvxLineTabDialog
     pLineEndList    ( pModel->GetLineEndList() ),
     pNewLineEndList ( pModel->GetLineEndList() ),
     bObjSelected    ( bHasObj ),
-    nLineEndListState( CT_NONE ),
-    nDashListState( CT_NONE ),
-    mnColorListState( CT_NONE ),
+    nLineEndListState( ChangeType::NONE ),
+    nDashListState( ChangeType::NONE ),
+    mnColorListState( ChangeType::NONE ),
     nPageType( 0 ), // We use it here primarily to get the right attributes with FillItemSet
     nPosDashLb( 0 ),
     nPosLineEndLb( 0 ),
@@ -133,7 +133,7 @@ void SvxLineTabDialog::SavePalettes()
 
     const OUString aPath( SvtPathOptions().GetPalettePath() );
 
-    if( nDashListState & CT_MODIFIED )
+    if( nDashListState & ChangeType::MODIFIED )
     {
         pDashList->SetPath( aPath );
         pDashList->Save();
@@ -143,7 +143,7 @@ void SvxLineTabDialog::SavePalettes()
             pShell->PutItem( SvxDashListItem( pDashList, SID_DASH_LIST ) );
     }
 
-    if( nLineEndListState & CT_MODIFIED )
+    if( nLineEndListState & ChangeType::MODIFIED )
     {
         pLineEndList->SetPath( aPath );
         pLineEndList->Save();
@@ -153,7 +153,7 @@ void SvxLineTabDialog::SavePalettes()
             pShell->PutItem( SvxLineEndListItem( pLineEndList, SID_LINEEND_LIST ) );
     }
 
-    if( mnColorListState & CT_MODIFIED )
+    if( mnColorListState & ChangeType::MODIFIED )
     {
         pColorList->SetPath( aPath );
         pColorList->Save();
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 7cd0685..1b73f2c 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -614,7 +614,7 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
     pBitmapList( NULL ),
 
     // local fixed not o be changed values for local pointers
-    maFixed_ChangeType(CT_NONE),
+    maFixed_ChangeType(ChangeType::NONE),
     maFixed_sal_Bool(false),
 
     // init with pointers to fixed ChangeType
@@ -874,9 +874,9 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
             // switching TabPages in dialogs using this TabPage
             sal_Int32 _nPos(nPos);
 
-            if( *pnBitmapListState )
+            if( *pnBitmapListState != ChangeType::NONE )
             {
-                if( *pnBitmapListState & CT_CHANGED )
+                if( *pnBitmapListState & ChangeType::CHANGED )
                     pBitmapList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewBitmapList();
 
                 _nPos = m_pLbBitmap->GetSelectEntryPos();
@@ -893,9 +893,9 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
                 ModifyBitmapHdl_Impl( this );
             }
 
-            if( *pnHatchingListState )
+            if( *pnHatchingListState != ChangeType::NONE )
             {
-                if( *pnHatchingListState & CT_CHANGED )
+                if( *pnHatchingListState & ChangeType::CHANGED )
                     pHatchingList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewHatchingList();
 
                 _nPos = m_pLbHatching->GetSelectEntryPos();
@@ -914,9 +914,9 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
                 ModifyHatchBckgrdColorHdl_Impl( this );
             }
 
-            if( *pnGradientListState )
+            if( *pnGradientListState != ChangeType::NONE )
             {
-                if( *pnGradientListState & CT_CHANGED )
+                if( *pnGradientListState & ChangeType::CHANGED )
                     pGradientList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewGradientList();
 
                 _nPos = m_pLbGradient->GetSelectEntryPos();
@@ -933,9 +933,9 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
                 ModifyGradientHdl_Impl( this );
             }
 
-            if( *pnColorListState )
+            if( *pnColorListState != ChangeType::NONE )
             {
-                if( *pnColorListState & CT_CHANGED )
+                if( *pnColorListState & ChangeType::CHANGED )
                     pColorList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewColorList();
                 // aLbColor
                 _nPos = m_pLbColor->GetSelectEntryPos();
@@ -1017,7 +1017,7 @@ SfxTabPage::sfxpg SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
                         nPageType = PT_GRADIENT;
                         nPos = m_pLbGradient->GetSelectEntryPos();
                         if( nPosOrig != nPos )
-                            *pnGradientListState |= CT_MODIFIED;
+                            *pnGradientListState |= ChangeType::MODIFIED;
             }
             break;
             case drawing::FillStyle_HATCH:
@@ -1025,7 +1025,7 @@ SfxTabPage::sfxpg SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
                 nPageType = PT_HATCH;
                 nPos = m_pLbHatching->GetSelectEntryPos();
                 if( nPosOrig != nPos )
-                    *pnHatchingListState |= CT_MODIFIED;
+                    *pnHatchingListState |= ChangeType::MODIFIED;
             }
             break;
             case drawing::FillStyle_BITMAP:
@@ -1033,7 +1033,7 @@ SfxTabPage::sfxpg SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
                 nPageType = PT_BITMAP;
                 nPos = m_pLbBitmap->GetSelectEntryPos();
                 if( nPosOrig != nPos )
-                    *pnBitmapListState |= CT_MODIFIED;
+                    *pnBitmapListState |= ChangeType::MODIFIED;
             }
             break;
             case drawing::FillStyle_SOLID:
@@ -1041,7 +1041,7 @@ SfxTabPage::sfxpg SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
                 nPageType = PT_COLOR;
                 nPos = m_pLbColor->GetSelectEntryPos();
                 if( nPosOrig != nPos )
-                    *pnColorListState |= CT_MODIFIED;
+                    *pnColorListState |= ChangeType::MODIFIED;
             }
             break;
             default: ;//prevent warning
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index e75afb7..77f2c62 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -167,10 +167,10 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet&  )
         if( pColorList.is() )
         {
             // ColorList
-            if( *pnColorListState & CT_CHANGED ||
-                *pnColorListState & CT_MODIFIED )
+            if( *pnColorListState & ChangeType::CHANGED ||
+                *pnColorListState & ChangeType::MODIFIED )
             {
-                if( *pnColorListState & CT_CHANGED )
+                if( *pnColorListState & ChangeType::CHANGED )
                     pColorList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewColorList();
 
                 // LbColor
@@ -570,7 +570,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickAddHdl_Impl)
             m_pLbBitmaps->Append(rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry );
             m_pLbBitmaps->SelectEntryPos( m_pLbBitmaps->GetEntryCount() - 1 );
 
-            *pnBitmapListState |= CT_MODIFIED;
+            *pnBitmapListState |= ChangeType::MODIFIED;
 
             ChangeBitmapHdl_Impl( this );
         }
@@ -660,7 +660,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl_Impl)
                 m_pLbBitmaps->Append(rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry );
                 m_pLbBitmaps->SelectEntryPos( m_pLbBitmaps->GetEntryCount() - 1 );
 
-                *pnBitmapListState |= CT_MODIFIED;
+                *pnBitmapListState |= ChangeType::MODIFIED;
 
                 ChangeBitmapHdl_Impl( this );
             }
@@ -722,7 +722,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickModifyHdl_Impl)
                 m_pLbBitmaps->Modify( rStyleSettings.GetListBoxPreviewDefaultPixelSize(), *pEntry, nPos );
                 m_pLbBitmaps->SelectEntryPos( nPos );
 
-                *pnBitmapListState |= CT_MODIFIED;
+                *pnBitmapListState |= ChangeType::MODIFIED;
 
                 bBmpChanged = false;
             }
@@ -760,7 +760,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl_Impl)
 
             ChangeBitmapHdl_Impl( this );
 
-            *pnBitmapListState |= CT_MODIFIED;
+            *pnBitmapListState |= ChangeType::MODIFIED;
         }
     }
     // determine button state
@@ -780,7 +780,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickLoadHdl_Impl)
     sal_uInt16 nReturn = RET_YES;
     ResMgr& rMgr = CUI_MGR();
 
-    if ( *pnBitmapListState & CT_MODIFIED )
+    if ( *pnBitmapListState & ChangeType::MODIFIED )
     {
         nReturn = MessageDialog( GetParentDialog()
                                 ,"AskSaveList"
@@ -837,8 +837,8 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickLoadHdl_Impl)
                 else
                     aString += aURL.getBase();
 
-                *pnBitmapListState |= CT_CHANGED;
-                *pnBitmapListState &= ~CT_MODIFIED;
+                *pnBitmapListState |= ChangeType::CHANGED;
+                *pnBitmapListState &= ~ChangeType::MODIFIED;
                 LeaveWait();
             }
             else
@@ -913,8 +913,8 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickSaveHdl_Impl)
             else
                 aString += aURL.getBase();
 
-            *pnBitmapListState |= CT_SAVED;
-            *pnBitmapListState &= ~CT_MODIFIED;
+            *pnBitmapListState |= ChangeType::SAVED;
+            *pnBitmapListState &= ~ChangeType::MODIFIED;
         }
         else
         {
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index b96b0d6..4347ab3 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -174,7 +174,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickLoadHdl_Impl)
                 bLoaded = true;
                 UpdateTableName();
 
-                AddState( CT_CHANGED );
+                AddState( ChangeType::CHANGED );
                 SetModified( false );
                 SetEmbed( true );
             }
@@ -237,7 +237,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickSaveHdl_Impl)
         if( pList->Save() )
         {
             UpdateTableName();
-            AddState( CT_SAVED );
+            AddState( ChangeType::SAVED );
             SetModified( false );
         }
         else
@@ -288,12 +288,12 @@ struct SvxColorTabPageShadow
     sal_uInt16 nUnknownType;
     sal_Int32  nUnknownPos;
     bool   bIsAreaTP;
-    sal_uInt16 nChangeType;
+    ChangeType nChangeType;
     SvxColorTabPageShadow()
         : nUnknownType( COLORPAGE_UNKNOWN )
         , nUnknownPos( LISTBOX_ENTRY_NOTFOUND )
         , bIsAreaTP( false )
-        , nChangeType( 0 )
+        , nChangeType( ChangeType::NONE )
     {
     }
 };
@@ -745,7 +745,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl)
 
         m_pLbColor->SelectEntryPos( m_pLbColor->GetEntryCount() - 1 );
 
-        *pnColorListState |= CT_MODIFIED;
+        *pnColorListState |= ChangeType::MODIFIED;
 
         SelectColorLBHdl_Impl( this );
     }
@@ -817,7 +817,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickModifyHdl_Impl)
 
             m_pCtlPreviewOld->Invalidate();
 
-            *pnColorListState |= CT_MODIFIED;
+            *pnColorListState |= ChangeType::MODIFIED;
         }
     }
     return 0;
@@ -893,7 +893,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickDeleteHdl_Impl)
 
             m_pCtlPreviewOld->Invalidate();
 
-            *pnColorListState |= CT_MODIFIED;
+            *pnColorListState |= ChangeType::MODIFIED;
         }
     }
     UpdateModified();
@@ -1160,7 +1160,7 @@ void SvxColorTabPage::SetupForViewFrame( SfxViewFrame *pViewFrame )
     SetDlgType( COLORPAGE_UNKNOWN );
     SetPos( &pShadow->nUnknownPos );
     SetAreaTP( &pShadow->bIsAreaTP );
-    SetColorChgd( (ChangeType*)&pShadow->nChangeType );
+    SetColorChgd( &pShadow->nChangeType );
     Construct();
 }
 
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 55c8129..6b832a2 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -191,10 +191,10 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet&  )
         if( pColorList.is() )
         {
             // ColorList
-            if( *pnColorListState & CT_CHANGED ||
-                *pnColorListState & CT_MODIFIED )
+            if( *pnColorListState & ChangeType::CHANGED ||
+                *pnColorListState & ChangeType::MODIFIED )
             {
-                if( *pnColorListState & CT_CHANGED )
+                if( *pnColorListState & ChangeType::CHANGED )
                     pColorList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewColorList();
 
                 // LbColorFrom
@@ -517,7 +517,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl)
         }
 #endif
 
-        *pnGradientListState |= CT_MODIFIED;
+        *pnGradientListState |= ChangeType::MODIFIED;
 
         ChangeGradientHdl_Impl( this );
     }
@@ -585,7 +585,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl)
 
                 m_pLbGradients->SelectEntryPos( nPos );
 
-                *pnGradientListState |= CT_MODIFIED;
+                *pnGradientListState |= ChangeType::MODIFIED;
             }
             else
             {
@@ -620,7 +620,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickDeleteHdl_Impl)
 
             ChangeGradientHdl_Impl( this );
 
-            *pnGradientListState |= CT_MODIFIED;
+            *pnGradientListState |= ChangeType::MODIFIED;
         }
     }
     // determine button state
@@ -640,7 +640,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickLoadHdl_Impl)
     ResMgr& rMgr = CUI_MGR();
     sal_uInt16 nReturn = RET_YES;
 
-    if ( *pnGradientListState & CT_MODIFIED )
+    if ( *pnGradientListState & ChangeType::MODIFIED )
     {
         nReturn = MessageDialog( GetParentDialog()
                                  ,"AskSaveList"
@@ -700,8 +700,8 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickLoadHdl_Impl)
                 else
                     aString += aURL.getBase();
 
-                *pnGradientListState |= CT_CHANGED;
-                *pnGradientListState &= ~CT_MODIFIED;
+                *pnGradientListState |= ChangeType::CHANGED;
+                *pnGradientListState &= ~ChangeType::MODIFIED;
                 LeaveWait();
             }
             else
@@ -777,8 +777,8 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickSaveHdl_Impl)
             else
                 aString += aURL.getBase();
 
-            *pnGradientListState |= CT_SAVED;
-            *pnGradientListState &= ~CT_MODIFIED;
+            *pnGradientListState |= ChangeType::SAVED;
+            *pnGradientListState &= ~ChangeType::MODIFIED;
         }
         else
         {
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 3e83950..4e1200e 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -180,10 +180,10 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
         if( pColorList.is() )
         {
             // ColorList
-            if( *pnColorListState & CT_CHANGED ||
-                *pnColorListState & CT_MODIFIED )
+            if( *pnColorListState & ChangeType::CHANGED ||
+                *pnColorListState & ChangeType::MODIFIED )
             {
-                if( *pnColorListState & CT_CHANGED )
+                if( *pnColorListState & ChangeType::CHANGED )
                     pColorList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewColorList();
 
                 // LbLineColor
@@ -554,7 +554,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl)
         }
 #endif
 
-        *pnHatchingListState |= CT_MODIFIED;
+        *pnHatchingListState |= ChangeType::MODIFIED;
 
         ChangeHatchHdl_Impl( this );
     }
@@ -623,7 +623,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl)
                 m_pLbLineColor->SaveValue();
                 m_pLbHatchings->SaveValue();
 
-                *pnHatchingListState |= CT_MODIFIED;
+                *pnHatchingListState |= ChangeType::MODIFIED;
             }
             else
             {
@@ -657,7 +657,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickDeleteHdl_Impl)
 
             ChangeHatchHdl_Impl( this );
 
-            *pnHatchingListState |= CT_MODIFIED;
+            *pnHatchingListState |= ChangeType::MODIFIED;
         }
     }
     // determine button state
@@ -677,7 +677,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickLoadHdl_Impl)
     ResMgr& rMgr = CUI_MGR();
     sal_uInt16 nReturn = RET_YES;
 
-    if ( *pnHatchingListState & CT_MODIFIED )
+    if ( *pnHatchingListState & ChangeType::MODIFIED )
     {
         nReturn = MessageDialog( GetParentDialog()
                                 ,"AskSaveList"
@@ -731,8 +731,8 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickLoadHdl_Impl)
                 else
                     aString += aURL.getBase();
 
-                *pnHatchingListState |= CT_CHANGED;
-                *pnHatchingListState &= ~CT_MODIFIED;
+                *pnHatchingListState |= ChangeType::CHANGED;
+                *pnHatchingListState &= ~ChangeType::MODIFIED;
             }
             else
                 MessageDialog( GetParentDialog()
@@ -803,8 +803,8 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickSaveHdl_Impl)
             else
                 aString += aURL.getBase();
 
-            *pnHatchingListState |= CT_SAVED;
-            *pnHatchingListState &= ~CT_MODIFIED;
+            *pnHatchingListState |= ChangeType::SAVED;
+            *pnHatchingListState &= ~ChangeType::MODIFIED;
         }
         else
         {
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 300db74..f6a6b3f 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -574,13 +574,13 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
         sal_Int32 nCount;
 
         // Dash list
-        if( ( *pnDashListState & CT_MODIFIED ) ||
-            ( *pnDashListState & CT_CHANGED ) )
+        if( ( *pnDashListState & ChangeType::MODIFIED ) ||
+            ( *pnDashListState & ChangeType::CHANGED ) )
         {
-            if( *pnDashListState & CT_CHANGED )
+            if( *pnDashListState & ChangeType::CHANGED )
                 pDashList = static_cast<SvxLineTabDialog*>( GetParentDialog() )->GetNewDashList();
 
-            *pnDashListState = CT_NONE;
+            *pnDashListState = ChangeType::NONE;
 
             // Style list
             nPos = m_pLbLineStyle->GetSelectEntryPos();
@@ -605,12 +605,12 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
         aDashURL.Append( pDashList->GetName() );
         DBG_ASSERT( aDashURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
         // LineEnd list
-        if( ( *pnLineEndListState & CT_MODIFIED ) || ( *pnLineEndListState & CT_CHANGED ) )
+        if( ( *pnLineEndListState & ChangeType::MODIFIED ) || ( *pnLineEndListState & ChangeType::CHANGED ) )
         {
-            if( *pnLineEndListState & CT_CHANGED )
+            if( *pnLineEndListState & ChangeType::CHANGED )
                 pLineEndList = static_cast<SvxLineTabDialog*>( GetParentDialog() )->GetNewLineEndList();
 
-            *pnLineEndListState = CT_NONE;
+            *pnLineEndListState = ChangeType::NONE;
 
             nPos = m_pLbLineStyle->GetSelectEntryPos();
             OUString sNone( SVX_RES( RID_SVXSTR_NONE ) );
@@ -660,9 +660,9 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
         }
 
             // ColorList
-            if( *pnColorListState )
+            if( *pnColorListState != ChangeType::NONE )
             {
-                if( *pnColorListState & CT_CHANGED )
+                if( *pnColorListState & ChangeType::CHANGED )
                     pColorList = static_cast<SvxLineTabDialog*>( GetParentDialog() )->GetNewColorList();
                 // aLbColor
                 sal_Int32 nColorPos = m_pLbColor->GetSelectEntryPos();
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 0e68ad3..32309ac 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -603,7 +603,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickAddHdl_Impl)
 
             m_pLbLineStyles->SelectEntryPos( m_pLbLineStyles->GetEntryCount() - 1 );
 
-            *pnDashListState |= CT_MODIFIED;
+            *pnDashListState |= ChangeType::MODIFIED;
 
             *pPageType = 2;
 
@@ -681,7 +681,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickModifyHdl_Impl)
 
                 m_pLbLineStyles->SelectEntryPos( nPos );
 
-                *pnDashListState |= CT_MODIFIED;
+                *pnDashListState |= ChangeType::MODIFIED;
 
                 *pPageType = 2;
 
@@ -727,7 +727,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickDeleteHdl_Impl)
             SelectLinestyleHdl_Impl( this );
             *pPageType = 0; // style should not be taken
 
-            *pnDashListState |= CT_MODIFIED;
+            *pnDashListState |= ChangeType::MODIFIED;
 
             ChangePreviewHdl_Impl( this );
         }
@@ -749,7 +749,7 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickLoadHdl_Impl)
 {
     sal_uInt16 nReturn = RET_YES;
 
-    if ( *pnDashListState & CT_MODIFIED )
+    if ( *pnDashListState & ChangeType::MODIFIED )
     {
         nReturn = MessageDialog( GetParentDialog()
                                 ,"AskSaveList"
@@ -789,8 +789,8 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickLoadHdl_Impl)
 
                 pDashList->SetName( aURL.getName() );
 
-                *pnDashListState |= CT_CHANGED;
-                *pnDashListState &= ~CT_MODIFIED;
+                *pnDashListState |= ChangeType::CHANGED;
+                *pnDashListState &= ~ChangeType::MODIFIED;
             }
             else
                 //aIStream.Close();
@@ -849,8 +849,8 @@ IMPL_LINK_NOARG(SvxLineDefTabPage, ClickSaveHdl_Impl)
 
         if( pDashList->Save() )
         {
-            *pnDashListState |= CT_SAVED;
-            *pnDashListState &= ~CT_MODIFIED;
+            *pnDashListState |= ChangeType::SAVED;
+            *pnDashListState &= ~ChangeType::MODIFIED;
         }
         else
         {
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index e33cd05..21f946c 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -388,7 +388,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickModifyHdl_Impl)
                 m_pLbLineEnds->SelectEntryPos( nPos );
 
                 // Flag fuer modifiziert setzen
-                *pnLineEndListState |= CT_MODIFIED;
+                *pnLineEndListState |= ChangeType::MODIFIED;
 
                 *pPageType = 3;
             }
@@ -490,7 +490,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickAddHdl_Impl)
                 m_pLbLineEnds->Append( *pEntry, pLineEndList->GetUiBitmap( nLineEndCount ) );
                 m_pLbLineEnds->SelectEntryPos( m_pLbLineEnds->GetEntryCount() - 1 );
 
-                *pnLineEndListState |= CT_MODIFIED;
+                *pnLineEndListState |= ChangeType::MODIFIED;
 
                 SelectLineEndHdl_Impl( this );
             }
@@ -537,7 +537,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickDeleteHdl_Impl)
             SelectLineEndHdl_Impl( this );
             *pPageType = 0; // LineEnd shall not be taken over
 
-            *pnLineEndListState |= CT_MODIFIED;
+            *pnLineEndListState |= ChangeType::MODIFIED;
 
             ChangePreviewHdl_Impl( this );
         }
@@ -558,7 +558,7 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl)
 {
     sal_uInt16 nReturn = RET_YES;
 
-    if ( *pnLineEndListState & CT_MODIFIED )
+    if ( *pnLineEndListState & ChangeType::MODIFIED )
     {
         nReturn = MessageDialog( GetParentDialog()
                                 ,"AskSaveList"
@@ -599,8 +599,8 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickLoadHdl_Impl)
 
                 pLineEndList->SetName( aURL.getName() );
 
-                *pnLineEndListState |= CT_CHANGED;
-                *pnLineEndListState &= ~CT_MODIFIED;
+                *pnLineEndListState |= ChangeType::CHANGED;
+                *pnLineEndListState &= ~ChangeType::MODIFIED;
             }
             else
                 MessageDialog( GetParentDialog()
@@ -658,8 +658,8 @@ IMPL_LINK_NOARG(SvxLineEndDefTabPage, ClickSaveHdl_Impl)
 
         if( pLineEndList->Save() )
         {
-            *pnLineEndListState |= CT_SAVED;
-            *pnLineEndListState &= ~CT_MODIFIED;
+            *pnLineEndListState |= ChangeType::SAVED;
+            *pnLineEndListState &= ~ChangeType::MODIFIED;
         }
         else
         {
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index 9c18dc3..55d66b3 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -209,10 +209,10 @@ void SvxShadowTabPage::ActivatePage( const SfxItemSet& rSet )
         if( pColorList.is() )
         {
             // ColorList
-            if( *pnColorListState & CT_CHANGED ||
-                *pnColorListState & CT_MODIFIED )
+            if( *pnColorListState & ChangeType::CHANGED ||
+                *pnColorListState & ChangeType::MODIFIED )
             {
-                if( *pnColorListState & CT_CHANGED )
+                if( *pnColorListState & ChangeType::CHANGED )
                 {
                     SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( GetParentDialog() );
                     if( pArea )
diff --git a/include/svx/tabarea.hxx b/include/svx/tabarea.hxx
index 46130c2..0c6e091 100644
--- a/include/svx/tabarea.hxx
+++ b/include/svx/tabarea.hxx
@@ -19,7 +19,7 @@
 #ifndef INCLUDED_SVX_TABAREA_HXX
 #define INCLUDED_SVX_TABAREA_HXX
 
-// enum ------------------------------------------------------------------
+#include <o3tl/typed_flags_set.hxx>
 
 enum ColorModel
 {
@@ -38,14 +38,17 @@ enum PageType
     PT_TRANSPARENCE
 };
 
-// define ----------------------------------------------------------------
-
-typedef sal_uInt16 ChangeType; // also in tab_line.hxx (care for it !!!)
-
-#define CT_NONE                 ( (ChangeType) 0x0000 )
-#define CT_MODIFIED             ( (ChangeType) 0x0001 )
-#define CT_CHANGED              ( (ChangeType) 0x0002 )
-#define CT_SAVED                ( (ChangeType) 0x0004 )
+enum class ChangeType
+{
+    NONE                 = 0x00,
+    MODIFIED             = 0x01,
+    CHANGED              = 0x02,
+    SAVED                = 0x04,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<ChangeType> : is_typed_flags<ChangeType, 0x07> {};
+}
 
 #endif // INCLUDED_SVX_TABAREA_HXX
 
diff --git a/include/svx/tabline.hxx b/include/svx/tabline.hxx
index 7da26d1..9c71cc2 100644
--- a/include/svx/tabline.hxx
+++ b/include/svx/tabline.hxx
@@ -28,16 +28,8 @@
 #include <svx/xsetit.hxx>
 #include <svx/dlgctrl.hxx>
 #include <vcl/menubtn.hxx>
-class SvxBrushItem;
-// define ----------------------------------------------------------------
-
-typedef sal_uInt16 ChangeType; // auch in tab_area.hxx (mitpflegen !!!)
-
-#define CT_NONE                 ( (ChangeType) 0x0000 )
-#define CT_MODIFIED             ( (ChangeType) 0x0001 )
-#define CT_CHANGED              ( (ChangeType) 0x0002 )
-#define CT_SAVED                ( (ChangeType) 0x0004 )
 
+class SvxBrushItem;
 class SdrModel;
 class SdrObject;
 
diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx
index 42a02cc..74c010e 100644
--- a/sd/source/ui/dlg/prltempl.cxx
+++ b/sd/source/ui/dlg/prltempl.cxx
@@ -215,10 +215,10 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh,
     nPageType = 0;
     nPos = 0;
 
-    nColorTableState = CT_NONE;
-    nBitmapListState = CT_NONE;
-    nGradientListState = CT_NONE;
-    nHatchingListState = CT_NONE;
+    nColorTableState = ChangeType::NONE;
+    nBitmapListState = ChangeType::NONE;
+    nGradientListState = ChangeType::NONE;
+    nHatchingListState = ChangeType::NONE;
 }
 
 SdPresLayoutTemplateDlg::~SdPresLayoutTemplateDlg()
diff --git a/sd/source/ui/dlg/tabtempl.cxx b/sd/source/ui/dlg/tabtempl.cxx
index e2e7613..61514ee 100644
--- a/sd/source/ui/dlg/tabtempl.cxx
+++ b/sd/source/ui/dlg/tabtempl.cxx
@@ -101,10 +101,10 @@ SdTabTemplateDlg::SdTabTemplateDlg( vcl::Window* pParent,
     nPageType = 0;
     nPos = 0;
 
-    nColorTableState = CT_NONE;
-    nBitmapListState = CT_NONE;
-    nGradientListState = CT_NONE;
-    nHatchingListState = CT_NONE;
+    nColorTableState = ChangeType::NONE;
+    nBitmapListState = ChangeType::NONE;
+    nGradientListState = ChangeType::NONE;
+    nHatchingListState = ChangeType::NONE;
 }
 
 void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
diff --git a/sd/source/ui/inc/dlgpage.hxx b/sd/source/ui/inc/dlgpage.hxx
index 2cdf0c4..d80d776 100644
--- a/sd/source/ui/inc/dlgpage.hxx
+++ b/sd/source/ui/inc/dlgpage.hxx
@@ -23,8 +23,7 @@
 #include <sfx2/tabdlg.hxx>
 
 class SfxObjectShell;
-
-typedef sal_uInt16 ChangeType;
+enum class ChangeType;
 
 /**
  * Page configuration-tab-dialog
commit 0a9f331de48e63d7188f7e253770debd5e3c180e
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Apr 24 15:55:53 2015 +0200

    convert SDRMOUSE constants to scoped enum
    
    Change-Id: Ia5389095683a1c012a988ed71bf769a1f25d80fb

diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 76e80d2..6855605 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -587,7 +587,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
         SdrViewEvent aVEvt;
         if ( pDrawViewWrapper->IsTextEditHit( aMPos, HITPIX ) ||
              // #i12587# support for shapes in chart
-             ( rMEvt.IsRight() && pDrawViewWrapper->PickAnything( rMEvt, SDRMOUSEBUTTONDOWN, aVEvt ) == SDRHIT_MARKEDOBJECT ) )
+             ( rMEvt.IsRight() && pDrawViewWrapper->PickAnything( rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt ) == SDRHIT_MARKEDOBJECT ) )
         {
             pDrawViewWrapper->MouseButtonDown(rMEvt,m_pChartWindow);
             return;
diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx
index bb9db82..f583301 100644
--- a/include/svx/svdview.hxx
+++ b/include/svx/svdview.hxx
@@ -82,9 +82,13 @@ enum SdrEventKind  {SDREVENT_NONE,
                     SDREVENT_BRKMARK,
                     SDREVENT_EXECUTEURL};
 
-#define SDRMOUSEBUTTONDOWN 1
-#define SDRMOUSEMOVE       2
-#define SDRMOUSEBUTTONUP   3
+/* for PickAnything() */
+enum class SdrMouseEventKind
+{
+    BUTTONDOWN = 1,
+    MOVE       = 2,
+    BUTTONUP   = 3,
+};
 
 // helper class SdrViewEvent
 struct SVX_DLLPUBLIC SdrViewEvent
@@ -126,8 +130,8 @@ public:
     SdrViewEvent();
     ~SdrViewEvent();
 
-    // nEventKind is SDRMOUSEBUTTONDOWN, SDRMOUSEMOVE oder SDRMOUSEBUTTONUP
-    void SetMouseEvent(const MouseEvent& rMEvt, sal_uInt16 nEventKind);
+    // nEventKind is SdrMouseEventKind::BUTTONDOWN, SdrMouseEventKind::MOVE or SdrMouseEventKind::BUTTONUP
+    void SetMouseEvent(const MouseEvent& rMEvt, SdrMouseEventKind nEventKind);
 };
 
 // helper class for all D&D overlays
@@ -174,7 +178,7 @@ public:
     // deactivate the MouseDispatcher with the help of the methode below and you have
     // to implement it yourself. Example for MouseButtonDown:
     //      SdrViewEvent aVEvt;
-    //      SdrHitKind eHit=pSdrView->PickAnything(rMEvt,SDRMOUSEBUTTONDOWN,aVEvt);
+    //      SdrHitKind eHit=pSdrView->PickAnything(rMEvt,SdrMouseEventKind::BUTTONDOWN,aVEvt);
     //      ... hier Applikationsspezifischer Eingriff ...
     //      pSdrView->DoMouseEvent(aVEvt);
     //      SetPointer(GetPreferredPointer(...))
@@ -214,7 +218,7 @@ public:
     // OutputDevice is necessary to determine HandleSize.
     // If NULL the first signed on Win is used.
     Pointer GetPreferredPointer(const Point& rMousePos, const OutputDevice* pOut, sal_uInt16 nModifier=0, bool bLeftDown=false) const;
-    SdrHitKind PickAnything(const MouseEvent& rMEvt, sal_uInt16 nMouseDownOrMoveOrUp, SdrViewEvent& rVEvt) const;
+    SdrHitKind PickAnything(const MouseEvent& rMEvt, SdrMouseEventKind nMouseDownOrMoveOrUp, SdrViewEvent& rVEvt) const;
     SdrHitKind PickAnything(const Point& rLogicPos, SdrViewEvent& rVEvt) const;
     bool DoMouseEvent(const SdrViewEvent& rVEvt);
     virtual SdrViewContext GetContext() const;
diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx
index b9dff98..a1d2676 100644
--- a/reportdesign/source/ui/report/dlgedfunc.cxx
+++ b/reportdesign/source/ui/report/dlgedfunc.cxx
@@ -184,7 +184,7 @@ bool DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt )
                 m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView);
                 // TODO character in shapes
                 //    SdrViewEvent aVEvt;
-                // m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+                // m_rView.PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
                 //    if ( aVEvt.pRootObj && aVEvt.pRootObj->ISA(SdrTextObj) )
                 //        SetInEditMode(static_cast<SdrTextObj *>(aVEvt.pRootObj),rMEvt, sal_False);
                 bHandled = true;
@@ -207,7 +207,7 @@ bool DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt )
     {
         SdrPageView* pPV = m_rView.GetSdrPageView();
         SdrViewEvent aVEvt;
-        if ( m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt) != SDRHIT_MARKEDOBJECT && !rMEvt.IsShift() )
+        if ( m_rView.PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt) != SDRHIT_MARKEDOBJECT && !rMEvt.IsShift() )
             m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL);
         if ( aVEvt.pRootObj )
             m_rView.MarkObj(aVEvt.pRootObj, pPV);
@@ -500,7 +500,7 @@ void DlgEdFunc::unColorizeOverlappedObj()
 bool DlgEdFunc::isOverlapping(const MouseEvent& rMEvt)
 {
     SdrViewEvent aVEvt;
-    bool bOverlapping = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONUP, aVEvt) != SDRHIT_NONE;
+    bool bOverlapping = m_rView.PickAnything(rMEvt, SdrMouseEventKind::BUTTONUP, aVEvt) != SDRHIT_NONE;
     if (bOverlapping && aVEvt.pObj)
     {
         colorizeOverlappedObject(aVEvt.pObj);
@@ -579,7 +579,7 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt)
     }
 
     SdrViewEvent aVEvt;
-    const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SDRMOUSEMOVE, aVEvt);
+    const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SdrMouseEventKind::MOVE, aVEvt);
     bool bIsSetPoint = (eHit == SDRHIT_UNMARKEDOBJECT);
     if ( !bIsSetPoint )
     {
@@ -670,7 +670,7 @@ bool DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt )
     SdrViewEvent aVEvt;
     sal_Int16 nId = m_rView.GetCurrentObjIdentifier();
 
-    const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+    const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
 
     if (eHit == SDRHIT_UNMARKEDOBJECT && nId != OBJ_CUSTOMSHAPE)
     {
@@ -746,7 +746,7 @@ bool DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt )
     {
         SdrPageView* pPV = m_rView.GetSdrPageView();
         SdrViewEvent aVEvt;
-        m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+        m_rView.PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
         m_rView.MarkObj(aVEvt.pRootObj, pPV);
     }
     checkTwoCklicks(rMEvt);
@@ -812,7 +812,7 @@ bool DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt )
         return true;
 
     SdrViewEvent aVEvt;
-    const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+    const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
     if( eHit == SDRHIT_UNMARKEDOBJECT )
     {
         // if not multi selection, unmark all
diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx
index babcafd..33a456f 100644
--- a/sc/source/ui/drawfunc/fuconpol.cxx
+++ b/sc/source/ui/drawfunc/fuconpol.cxx
@@ -63,7 +63,7 @@ bool FuConstPolygon::MouseButtonDown(const MouseEvent& rMEvt)
     bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
 
     SdrViewEvent aVEvt;
-    (void)pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+    (void)pView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt);
     if (aVEvt.eEvent == SDREVENT_BEGTEXTEDIT)
     {
         // Texteingabe hier nicht zulassen
@@ -108,7 +108,7 @@ bool FuConstPolygon::MouseButtonUp(const MouseEvent& rMEvt)
     bool bSimple = false;
 
     SdrViewEvent aVEvt;
-    (void)pView->PickAnything(rMEvt, SDRMOUSEBUTTONUP, aVEvt);
+    (void)pView->PickAnything(rMEvt, SdrMouseEventKind::BUTTONUP, aVEvt);
 
     pView->MouseButtonUp(rMEvt, pWindow);
 
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index 5e4ceef..25bfd25 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -708,7 +708,7 @@ static bool lcl_UrlHit( SdrView* pView, const Point& rPosPixel, vcl::Window* pWi
 {
     SdrViewEvent aVEvt;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list