[Libreoffice-commits] core.git: 3 commits - basctl/source basic/source include/basic include/sfx2 sc/source sd/source sfx2/source starmath/source svx/source sw/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Nov 24 06:06:27 UTC 2016


 basctl/source/basicide/baside2.cxx    |   16 ++++----
 basctl/source/basicide/baside2.hxx    |    2 -
 basctl/source/basicide/basides1.cxx   |    4 +-
 basctl/source/basicide/iderdll.cxx    |    6 +--
 basctl/source/basicide/iderdll2.hxx   |    2 -
 basctl/source/inc/basidesh.hxx        |    2 -
 basctl/source/inc/bastypes.hxx        |    5 +-
 basic/source/classes/sb.cxx           |   10 ++---
 basic/source/classes/sbxmod.cxx       |   20 +++++-----
 basic/source/inc/runtime.hxx          |   68 +++++++++++++++++-----------------
 basic/source/inc/sbintern.hxx         |    4 +-
 basic/source/runtime/runtime.cxx      |   30 ++++++---------
 include/basic/sbdef.hxx               |   17 ++++++--
 include/basic/sbmeth.hxx              |    8 ++--
 include/basic/sbstar.hxx              |   14 +++----
 include/sfx2/new.hxx                  |    7 ++-
 include/sfx2/objface.hxx              |    5 +-
 include/sfx2/shell.hxx                |   23 ++++++-----
 sc/source/ui/app/scmod.cxx            |    3 +
 sc/source/ui/drawfunc/chartsh.cxx     |    3 +
 sc/source/ui/drawfunc/drawsh.cxx      |    3 +
 sc/source/ui/drawfunc/drformsh.cxx    |    3 +
 sc/source/ui/drawfunc/drtxtob.cxx     |    3 +
 sc/source/ui/drawfunc/graphsh.cxx     |    3 +
 sc/source/ui/drawfunc/mediash.cxx     |    2 -
 sc/source/ui/drawfunc/oleobjsh.cxx    |    3 +
 sc/source/ui/view/cellsh.cxx          |    3 +
 sc/source/ui/view/formatsh.cxx        |    3 +
 sc/source/ui/view/prevwsh.cxx         |    3 +
 sc/source/ui/view/tabvwsh.cxx         |    3 +
 sd/source/ui/dlg/sdpreslt.cxx         |    2 -
 sd/source/ui/view/outlnvsh.cxx        |    4 +-
 sd/source/ui/view/presvish.cxx        |    8 ++--
 sfx2/source/appl/workwin.cxx          |   61 ++++++++++++++----------------
 sfx2/source/control/dispatch.cxx      |   35 +++++++++--------
 sfx2/source/control/objface.cxx       |   51 ++++++++++++++++++-------
 sfx2/source/doc/new.cxx               |   16 ++++----
 sfx2/source/inc/workwin.hxx           |   26 ++++++-------
 sfx2/source/view/viewfrm.cxx          |    4 +-
 starmath/source/view.cxx              |    3 +
 svx/source/form/fmshell.cxx           |   12 +++---
 svx/source/toolbars/extrusionbar.cxx  |    2 -
 svx/source/toolbars/fontworkbar.cxx   |    2 -
 sw/source/ui/dbui/mmdocselectpage.cxx |    2 -
 sw/source/uibase/app/apphdl.cxx       |    3 +
 sw/source/uibase/app/docsh2.cxx       |    2 -
 sw/source/uibase/shells/annotsh.cxx   |    2 -
 sw/source/uibase/shells/beziersh.cxx  |    2 -
 sw/source/uibase/shells/drawsh.cxx    |    2 -
 sw/source/uibase/shells/drformsh.cxx  |    2 -
 sw/source/uibase/shells/drwtxtsh.cxx  |    2 -
 sw/source/uibase/shells/frmsh.cxx     |    2 -
 sw/source/uibase/shells/grfsh.cxx     |    2 -
 sw/source/uibase/shells/listsh.cxx    |    2 -
 sw/source/uibase/shells/mediash.cxx   |    2 -
 sw/source/uibase/shells/olesh.cxx     |    2 -
 sw/source/uibase/shells/tabsh.cxx     |    2 -
 sw/source/uibase/shells/textsh.cxx    |    2 -
 sw/source/uibase/uiview/pview.cxx     |    3 +
 sw/source/uibase/uiview/srcview.cxx   |    3 +
 sw/source/uibase/uiview/view0.cxx     |    2 -
 sw/source/uibase/web/wformsh.cxx      |    2 -
 sw/source/uibase/web/wfrmsh.cxx       |    2 -
 sw/source/uibase/web/wgrfsh.cxx       |    2 -
 sw/source/uibase/web/wlistsh.cxx      |    2 -
 sw/source/uibase/web/wolesh.cxx       |    2 -
 sw/source/uibase/web/wtabsh.cxx       |    2 -
 sw/source/uibase/web/wtextsh.cxx      |    2 -
 sw/source/uibase/web/wview.cxx        |    2 -
 69 files changed, 299 insertions(+), 260 deletions(-)

New commits:
commit 5af0071d42e5962ed849261134ef0630c7ec3b45
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Nov 23 15:42:47 2016 +0200

    convert SFX_VISIBILITY constants to scoped enum
    
    * split the position and the flags information
    * remove unused DESKTOP constant
    
    Change-Id: Ibfccb44c7567e89d4527bfd36b3915a73682e6e2

diff --git a/include/sfx2/objface.hxx b/include/sfx2/objface.hxx
index ac93da6..3805d2f 100644
--- a/include/sfx2/objface.hxx
+++ b/include/sfx2/objface.hxx
@@ -64,13 +64,14 @@ public:
 
     const SfxInterface*     GetGenoType() const { return pGenoType; }
 
-    void                    RegisterObjectBar(sal_uInt16, sal_uInt32 nResId);
-    void                    RegisterObjectBar(sal_uInt16, sal_uInt32 nResId, SfxShellFeature nFeature);
+    void                    RegisterObjectBar(sal_uInt16, SfxVisibilityFlags nFlags, sal_uInt32 nResId);
+    void                    RegisterObjectBar(sal_uInt16, SfxVisibilityFlags nFlags, sal_uInt32 nResId, SfxShellFeature nFeature);
     void                    RegisterChildWindow(sal_uInt16, bool bContext = false);
     void                    RegisterChildWindow(sal_uInt16, bool bContext, SfxShellFeature nFeature);
     void                    RegisterStatusBar(sal_uInt32 nResId);
     sal_uInt32              GetObjectBarId(sal_uInt16 nNo) const;
     sal_uInt16              GetObjectBarPos( sal_uInt16 nNo ) const;
+    SfxVisibilityFlags      GetObjectBarFlags( sal_uInt16 nNo ) const;
     SfxShellFeature         GetObjectBarFeature(sal_uInt16 nNo) const;
     sal_uInt16              GetObjectBarCount() const;
     bool                    IsObjectBarVisible( sal_uInt16 nNo) const;
diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx
index a337aed..4c7d12f 100644
--- a/include/sfx2/shell.hxx
+++ b/include/sfx2/shell.hxx
@@ -581,17 +581,18 @@ SFX_TMPL_INTERFACE(Class,SuperClass,false)                                  \
 #define SFX_IMPL_SUPERCLASS_INTERFACE(Class,SuperClass)                     \
 SFX_TMPL_INTERFACE(Class,SuperClass,true)                                   \
 
-#define SFX_POSITION_MASK               0x000F
-#define SFX_VISIBILITY_MASK             0xFFF0
-#define SFX_VISIBILITY_UNVISIBLE        0x0000  // Never visible
-#define SFX_VISIBILITY_VIEWER           0x0040
-#define SFX_VISIBILITY_READONLYDOC      0x0400
-#define SFX_VISIBILITY_DESKTOP          0x0800
-#define SFX_VISIBILITY_STANDARD         0x1000
-#define SFX_VISIBILITY_FULLSCREEN       0x2000
-#define SFX_VISIBILITY_CLIENT           0x4000
-#define SFX_VISIBILITY_SERVER           0x8000
-
+enum class SfxVisibilityFlags {
+    Invisible        = 0x0000, // Never visible
+    Viewer           = 0x0040,
+    ReadonlyDoc      = 0x0400,
+    Standard         = 0x1000,
+    FullScreen       = 0x2000,
+    Client           = 0x4000,
+    Server           = 0x8000,
+};
+namespace o3tl {
+    template<> struct typed_flags<SfxVisibilityFlags> : is_typed_flags<SfxVisibilityFlags, 0xf440> {};
+}
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index bfbe59d..435a00b 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -125,7 +125,8 @@ SFX_IMPL_INTERFACE(ScModule, SfxShell)
 
 void ScModule::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION | SFX_VISIBILITY_DESKTOP | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_CLIENT | SFX_VISIBILITY_VIEWER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION,
+                                            SfxVisibilityFlags::Standard | SfxVisibilityFlags::Client | SfxVisibilityFlags::Viewer,
                                             RID_OBJECTBAR_APP);
 
     GetStaticInterface()->RegisterStatusBar(SCCFG_STATUSBAR);
diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx
index b07f8b9..5f7e494 100644
--- a/sc/source/ui/drawfunc/chartsh.cxx
+++ b/sc/source/ui/drawfunc/chartsh.cxx
@@ -49,7 +49,8 @@ SFX_IMPL_INTERFACE(ScChartShell, ScDrawShell)
 
 void ScChartShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT,
+                                            SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
                                             RID_DRAW_OBJECTBAR);
 
     GetStaticInterface()->RegisterPopupMenu("chart");
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 3b38a26..b172abe 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -65,7 +65,8 @@ SFX_IMPL_INTERFACE(ScDrawShell, SfxShell)
 
 void ScDrawShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT,
+                                            SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
                                             RID_DRAW_OBJECTBAR);
 
     GetStaticInterface()->RegisterPopupMenu("draw");
diff --git a/sc/source/ui/drawfunc/drformsh.cxx b/sc/source/ui/drawfunc/drformsh.cxx
index 28b5e4f..cbfc149 100644
--- a/sc/source/ui/drawfunc/drformsh.cxx
+++ b/sc/source/ui/drawfunc/drformsh.cxx
@@ -44,7 +44,8 @@ SFX_IMPL_INTERFACE(ScDrawFormShell, ScDrawShell)
 
 void ScDrawFormShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT,
+                                            SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
                                             RID_OBJECTBAR_FORMAT);
 
     GetStaticInterface()->RegisterPopupMenu("form");
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 7521afb..a8c8b34 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -87,7 +87,8 @@ SFX_IMPL_INTERFACE(ScDrawTextObjectBar, SfxShell)
 
 void ScDrawTextObjectBar::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT,
+                                            SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
                                             RID_TEXT_TOOLBOX);
 
     GetStaticInterface()->RegisterPopupMenu("drawtext");
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index 254cb06..d1875e7 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -46,7 +46,8 @@ SFX_IMPL_INTERFACE(ScGraphicShell, ScDrawShell)
 
 void ScGraphicShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT,
+                                            SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
                                             RID_GRAPHIC_OBJECTBAR);
 
     GetStaticInterface()->RegisterPopupMenu("graphic");
diff --git a/sc/source/ui/drawfunc/mediash.cxx b/sc/source/ui/drawfunc/mediash.cxx
index 4ddeec4..546afd9 100644
--- a/sc/source/ui/drawfunc/mediash.cxx
+++ b/sc/source/ui/drawfunc/mediash.cxx
@@ -39,7 +39,7 @@ SFX_IMPL_INTERFACE(ScMediaShell, ScDrawShell)
 
 void ScMediaShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_MEDIA_OBJECTBAR);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_MEDIA_OBJECTBAR);
 
     GetStaticInterface()->RegisterPopupMenu("media");
 }
diff --git a/sc/source/ui/drawfunc/oleobjsh.cxx b/sc/source/ui/drawfunc/oleobjsh.cxx
index e3096eb..a108cdc 100644
--- a/sc/source/ui/drawfunc/oleobjsh.cxx
+++ b/sc/source/ui/drawfunc/oleobjsh.cxx
@@ -44,7 +44,8 @@ SFX_IMPL_INTERFACE(ScOleObjectShell, ScDrawShell)
 
 void ScOleObjectShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT,
+                                            SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
                                             RID_DRAW_OBJECTBAR);
 
     GetStaticInterface()->RegisterPopupMenu("oleobject");
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index cb2f799..50628ca 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -67,7 +67,8 @@ SFX_IMPL_INTERFACE(ScCellShell, ScFormatShell)
 
 void ScCellShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT,
+                                            SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
                                             RID_OBJECTBAR_FORMAT);
 
     GetStaticInterface()->RegisterPopupMenu("cell");
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 28f3fd6..1d81306 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -125,7 +125,8 @@ SFX_IMPL_INTERFACE(ScFormatShell, SfxShell)
 
 void ScFormatShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT,
+                                            SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
                                             RID_OBJECTBAR_FORMAT);
 }
 
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index b27d535..7311751 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -88,7 +88,8 @@ SFX_IMPL_INTERFACE(ScPreviewShell, SfxViewShell)
 
 void ScPreviewShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER|SFX_VISIBILITY_READONLYDOC,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT,
+                                            SfxVisibilityFlags::Standard|SfxVisibilityFlags::Server|SfxVisibilityFlags::ReadonlyDoc,
                                             RID_OBJECTBAR_PREVIEW);
 
     GetStaticInterface()->RegisterPopupMenu("preview");
diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx
index ccf681b..bb18b4b 100644
--- a/sc/source/ui/view/tabvwsh.cxx
+++ b/sc/source/ui/view/tabvwsh.cxx
@@ -53,7 +53,8 @@ SFX_IMPL_INTERFACE(ScTabViewShell, SfxViewShell)
 
 void ScTabViewShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_FULLSCREEN | SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS,
+                                            SfxVisibilityFlags::Standard | SfxVisibilityFlags::FullScreen | SfxVisibilityFlags::Server,
                                             RID_OBJECTBAR_TOOLS);
 
     GetStaticInterface()->RegisterChildWindow(FID_INPUTLINE_STATUS);
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index e9ab3e5..6794791 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -112,9 +112,9 @@ void OutlineViewShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("outline");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_FULLSCREEN | SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS, SfxVisibilityFlags::Standard | SfxVisibilityFlags::FullScreen | SfxVisibilityFlags::Server,
                                             RID_OUTLINE_TOOLBOX);
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION | SFX_VISIBILITY_DESKTOP | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_CLIENT | SFX_VISIBILITY_VIEWER | SFX_VISIBILITY_READONLYDOC,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION, SfxVisibilityFlags::Standard | SfxVisibilityFlags::Client | SfxVisibilityFlags::Viewer | SfxVisibilityFlags::ReadonlyDoc,
                                             RID_DRAW_VIEWER_TOOLBOX);
 
     GetStaticInterface()->RegisterChildWindow(SfxInfoBarContainerChild::GetChildWindowId());
diff --git a/sd/source/ui/view/presvish.cxx b/sd/source/ui/view/presvish.cxx
index cf83969..fd1c5c2 100644
--- a/sd/source/ui/view/presvish.cxx
+++ b/sd/source/ui/view/presvish.cxx
@@ -64,13 +64,13 @@ SFX_IMPL_INTERFACE(PresentationViewShell, DrawViewShell)
 
 void PresentationViewShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_FULLSCREEN | SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS, SfxVisibilityFlags::Standard | SfxVisibilityFlags::FullScreen | SfxVisibilityFlags::Server,
                                             RID_DRAW_TOOLBOX);
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION | SFX_VISIBILITY_DESKTOP | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_CLIENT | SFX_VISIBILITY_VIEWER | SFX_VISIBILITY_READONLYDOC,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION, SfxVisibilityFlags::Standard | SfxVisibilityFlags::Client | SfxVisibilityFlags::Viewer | SfxVisibilityFlags::ReadonlyDoc,
                                             RID_DRAW_VIEWER_TOOLBOX);
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OPTIONS | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OPTIONS, SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
                                             RID_DRAW_OPTIONS_TOOLBOX);
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_COMMONTASK | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_COMMONTASK, SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
                                             RID_DRAW_COMMONTASK_TOOLBOX);
 }
 
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 61a688c..a8ad4db 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -467,9 +467,9 @@ SfxWorkWindow::SfxWorkWindow( vcl::Window *pWin, SfxFrame *pFrm, SfxFrame* pMast
     pWorkWin (pWin),
     pConfigShell( nullptr ),
     pActiveChild( nullptr ),
-    nUpdateMode(SFX_VISIBILITY_STANDARD),
+    nUpdateMode(SfxVisibilityFlags::Standard),
     nChildren( 0 ),
-    nOrigMode( 0 ),
+    nOrigMode( SfxVisibilityFlags::Invisible ),
     bSorted( true ),
     bDockingAllowed(true),
     bInternalDockingAllowed(true),
@@ -527,8 +527,8 @@ SfxWorkWindow::SfxWorkWindow( vcl::Window *pWin, SfxFrame *pFrm, SfxFrame* pMast
         pSplit[n] = pSplitWin;
     }
 
-    nOrigMode = SFX_VISIBILITY_STANDARD;
-    nUpdateMode = SFX_VISIBILITY_STANDARD;
+    nOrigMode = SfxVisibilityFlags::Standard;
+    nUpdateMode = SfxVisibilityFlags::Standard;
 }
 
 
@@ -993,24 +993,22 @@ void SfxWorkWindow::ResetObjectBars_Impl()
         aChildWins[n]->nId = 0;
 }
 
-void SfxWorkWindow::SetObjectBar_Impl(sal_uInt16 nPos, sal_uInt32 nResId,
+void SfxWorkWindow::SetObjectBar_Impl(sal_uInt16 nPos, SfxVisibilityFlags nFlags, sal_uInt32 nResId,
             SfxInterface* pIFace)
 {
-    DBG_ASSERT( (nPos & SFX_POSITION_MASK) < SFX_OBJECTBAR_MAX,
-                "object bar position overflow" );
+    DBG_ASSERT( nPos < SFX_OBJECTBAR_MAX, "object bar position overflow" );
 
-    sal_uInt16 nRealPos = nPos & SFX_POSITION_MASK;
-    if ( pParent && IsAppWorkWinToolbox_Impl( nRealPos ) )
+    if ( pParent && IsAppWorkWinToolbox_Impl( nPos ) )
     {
-        pParent->SetObjectBar_Impl(nPos, nResId, pIFace);
+        pParent->SetObjectBar_Impl(nPos, nFlags, nResId, pIFace);
         return;
     }
 
     SfxObjectBar_Impl aObjBar;
     aObjBar.pIFace = pIFace;
     aObjBar.nId = sal::static_int_cast<sal_uInt16>(nResId);
-    aObjBar.nPos = nRealPos;
-    aObjBar.nMode = (nPos & SFX_VISIBILITY_MASK);
+    aObjBar.nPos = nPos;
+    aObjBar.nMode = nFlags;
 
     for (SfxObjectBar_Impl & rBar : aObjBarList)
     {
@@ -1033,13 +1031,12 @@ bool SfxWorkWindow::KnowsObjectBar_Impl( sal_uInt16 nPos ) const
 */
 
 {
-    sal_uInt16 nRealPos = nPos & SFX_POSITION_MASK;
-    if ( pParent && IsAppWorkWinToolbox_Impl( nRealPos ) )
+    if ( pParent && IsAppWorkWinToolbox_Impl( nPos ) )
         return pParent->KnowsObjectBar_Impl( nPos );
 
     for (const SfxObjectBar_Impl& rBar : aObjBarList)
     {
-        if ( rBar.nPos == nRealPos )
+        if ( rBar.nPos == nPos )
             return true;
     }
 
@@ -1047,20 +1044,20 @@ bool SfxWorkWindow::KnowsObjectBar_Impl( sal_uInt16 nPos ) const
 }
 
 
-bool SfxWorkWindow::IsVisible_Impl( sal_uInt16 nMode ) const
+bool SfxWorkWindow::IsVisible_Impl( SfxVisibilityFlags nMode ) const
 {
     switch( nUpdateMode )
     {
-        case SFX_VISIBILITY_STANDARD:
+        case SfxVisibilityFlags::Standard:
             return true;
-        case SFX_VISIBILITY_UNVISIBLE:
+        case SfxVisibilityFlags::Invisible:
             return false;
-        case SFX_VISIBILITY_CLIENT:
-        case SFX_VISIBILITY_SERVER:
+        case SfxVisibilityFlags::Client:
+        case SfxVisibilityFlags::Server:
             return !!(nMode & nUpdateMode);
         default:
             return !!(nMode & nOrigMode ) ||
-                nOrigMode == SFX_VISIBILITY_STANDARD;
+                nOrigMode == SfxVisibilityFlags::Standard;
     }
 }
 
@@ -1203,14 +1200,13 @@ void SfxWorkWindow::UpdateObjectBars_Impl2()
         bool    bDestroy = aObjBarList[n].bDestroy;
 
         // Determine the valid mode for the ToolBox
-        sal_uInt16 nTbxMode = aObjBarList[n].nMode;
-        bool bFullScreenTbx = SFX_VISIBILITY_FULLSCREEN ==
-                                  ( nTbxMode & SFX_VISIBILITY_FULLSCREEN );
-        nTbxMode &= ~SFX_VISIBILITY_FULLSCREEN;
-        nTbxMode &= ~SFX_VISIBILITY_VIEWER;
+        SfxVisibilityFlags nTbxMode = aObjBarList[n].nMode;
+        bool bFullScreenTbx( nTbxMode & SfxVisibilityFlags::FullScreen );
+        nTbxMode &= ~SfxVisibilityFlags::FullScreen;
+        nTbxMode &= ~SfxVisibilityFlags::Viewer;
 
         // Is a ToolBox required in this context ?
-        bool bModesMatching = ( nUpdateMode && ( nTbxMode & nUpdateMode) == nUpdateMode );
+        bool bModesMatching = (nUpdateMode != SfxVisibilityFlags::Invisible) && ((nTbxMode & nUpdateMode) == nUpdateMode);
         if ( bDestroy )
         {
             OUString aTbxId( m_aTbxTypeName );
@@ -1483,9 +1479,9 @@ void SfxWorkWindow::UpdateStatusBar_Impl()
 void SfxWorkWindow::MakeVisible_Impl( bool bVis )
 {
     if ( bVis )
-        nOrigMode = SFX_VISIBILITY_STANDARD;
+        nOrigMode = SfxVisibilityFlags::Standard;
     else
-        nOrigMode = SFX_VISIBILITY_UNVISIBLE;
+        nOrigMode = SfxVisibilityFlags::Invisible;
 
     if ( nOrigMode != nUpdateMode)
         nUpdateMode = nOrigMode;
@@ -1493,7 +1489,7 @@ void SfxWorkWindow::MakeVisible_Impl( bool bVis )
 
 bool SfxWorkWindow::IsVisible_Impl()
 {
-    return nOrigMode != SFX_VISIBILITY_UNVISIBLE;
+    return nOrigMode != SfxVisibilityFlags::Invisible;
 }
 
 
@@ -1755,7 +1751,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild,
 }
 
 
-void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, bool bEnabled, sal_uInt16 nMode )
+void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, bool bEnabled, SfxVisibilityFlags nMode )
 {
     sal_uInt16 nInter = (sal_uInt16) ( lId >> 16 );
     sal_uInt16 nId = (sal_uInt16) ( lId & 0xFFFF );
@@ -1810,7 +1806,6 @@ void SfxWorkWindow::SetChildWindowVisible_Impl( sal_uInt32 lId, bool bEnabled, s
         pCW->nInterfaceId = nInter;
     pCW->nVisibility = nMode;
     pCW->bEnable = bEnabled;
-    pCW->nVisibility = nMode;
 }
 
 
@@ -1978,7 +1973,7 @@ bool SfxWorkWindow::IsFloating( sal_uInt16 nId )
         pCW = new SfxChildWin_Impl( nId );
         pCW->bEnable = false;
         pCW->nId = 0;
-        pCW->nVisibility = 0;
+        pCW->nVisibility = SfxVisibilityFlags::Invisible;
         InitializeChild_Impl( pCW );
         if ( pWork && !( pCW->aInfo.nFlags & SfxChildWindowFlags::TASK ) )
             pWork->aChildWins.push_back( pCW );
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 71cd48b..96ae44a 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -95,11 +95,12 @@ struct SfxToDo_Impl
 
 struct SfxObjectBars_Impl
 {
-    sal_uInt32     nResId;  // Resource - and ConfigId of the Toolbox
-    sal_uInt16     nMode;   // special visibility flags
-    SfxInterface*  pIFace;
+    sal_uInt32         nResId;  // Resource - and ConfigId of the Toolbox
+    sal_uInt16         nPos;
+    SfxVisibilityFlags nFlags;   // special visibility flags
+    SfxInterface*      pIFace;
 
-    SfxObjectBars_Impl() : nResId(0), nMode(0), pIFace(nullptr) {}
+    SfxObjectBars_Impl() : nResId(0), nPos(0), nFlags(SfxVisibilityFlags::Invisible), pIFace(nullptr) {}
 };
 
 struct SfxDispatcher_Impl
@@ -1377,7 +1378,8 @@ void SfxDispatcher::Update_Impl_( bool bUIActive, bool bIsMDIApp, bool bIsIPOwne
         for ( nNo = 0; pIFace && nNo<pIFace->GetObjectBarCount(); ++nNo )
         {
             sal_uInt16 nPos = pIFace->GetObjectBarPos(nNo);
-            if ( bReadOnlyShell && !( nPos & SFX_VISIBILITY_READONLYDOC ) )
+            SfxVisibilityFlags nFlags = pIFace->GetObjectBarFlags(nNo);
+            if ( bReadOnlyShell && !( nFlags & SfxVisibilityFlags::ReadonlyDoc ) )
                 continue;
 
             // check whether toolbar needs activation of a special feature
@@ -1388,7 +1390,7 @@ void SfxDispatcher::Update_Impl_( bool bUIActive, bool bIsMDIApp, bool bIsIPOwne
             // check for toolboxes that are exclusively for a viewer
             if ( xImp->pFrame)
             {
-                bool bViewerTbx = SFX_VISIBILITY_VIEWER == ( nPos & SFX_VISIBILITY_VIEWER );
+                bool bViewerTbx( nFlags & SfxVisibilityFlags::Viewer );
                 SfxObjectShell* pSh = xImp->pFrame->GetObjectShell();
                 const SfxBoolItem* pItem = SfxItemSet::GetItem<SfxBoolItem>(pSh->GetMedium()->GetItemSet(), SID_VIEWONLY, false);
                 bool bIsViewer = pItem && pItem->GetValue();
@@ -1399,16 +1401,17 @@ void SfxDispatcher::Update_Impl_( bool bUIActive, bool bIsMDIApp, bool bIsIPOwne
             // always register toolbars, allows to switch them on
             bool bVisible = pIFace->IsObjectBarVisible(nNo);
             if ( !bVisible )
-                nPos &= SFX_POSITION_MASK;
+                nFlags = SfxVisibilityFlags::Invisible;
 
-            SfxObjectBars_Impl& rBar = xImp->aObjBars[nPos & SFX_POSITION_MASK];
-            rBar.nMode = nPos;
+            SfxObjectBars_Impl& rBar = xImp->aObjBars[nPos];
+            rBar.nPos = nPos;
+            rBar.nFlags = nFlags;
             rBar.nResId = pIFace->GetObjectBarId(nNo);
             rBar.pIFace = pIFace;
 
             if ( bUIActive || bIsActive )
             {
-                pWorkWin->SetObjectBar_Impl(nPos, rBar.nResId, rBar.pIFace);
+                pWorkWin->SetObjectBar_Impl(nPos, nFlags, rBar.nResId, rBar.pIFace);
             }
 
             if ( !bVisible )
@@ -1432,18 +1435,18 @@ void SfxDispatcher::Update_Impl_( bool bUIActive, bool bIsMDIApp, bool bIsIPOwne
                 continue;
 
             // slot decides whether a ChildWindow is shown when document is OLE server or OLE client
-            sal_uInt16 nMode = SFX_VISIBILITY_STANDARD;
+            SfxVisibilityFlags nMode = SfxVisibilityFlags::Standard;
             if( pSlot )
             {
                 if ( pSlot->IsMode(SfxSlotMode::CONTAINER) )
                 {
-                    if ( pWorkWin->IsVisible_Impl( SFX_VISIBILITY_CLIENT ) )
-                        nMode |= SFX_VISIBILITY_CLIENT;
+                    if ( pWorkWin->IsVisible_Impl( SfxVisibilityFlags::Client ) )
+                        nMode |= SfxVisibilityFlags::Client;
                 }
                 else
                 {
-                    if ( pWorkWin->IsVisible_Impl( SFX_VISIBILITY_SERVER ) )
-                        nMode |= SFX_VISIBILITY_SERVER;
+                    if ( pWorkWin->IsVisible_Impl( SfxVisibilityFlags::Server ) )
+                        nMode |= SfxVisibilityFlags::Server;
                 }
             }
 
@@ -1471,7 +1474,7 @@ void SfxDispatcher::Update_Impl_( bool bUIActive, bool bIsMDIApp, bool bIsIPOwne
         {
             SfxObjectBars_Impl& rBar = xImp->aObjBars[nPos];
             rBar = rFixed;
-            pWorkWin->SetObjectBar_Impl(rFixed.nMode,
+            pWorkWin->SetObjectBar_Impl(rFixed.nPos, rFixed.nFlags,
                 rFixed.nResId, rFixed.pIFace);
         }
     }
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
index 495374b..68d229d 100644
--- a/sfx2/source/control/objface.cxx
+++ b/sfx2/source/control/objface.cxx
@@ -53,13 +53,15 @@ SfxCompareSlots_bsearch( const void* pSmaller, const void* pBigger )
 
 struct SfxObjectUI_Impl
 {
-    sal_uInt16  nPos;
-    sal_uInt32  nResId;
-    bool        bContext;
-    SfxShellFeature nFeature;
+    sal_uInt16         nPos;
+    SfxVisibilityFlags nFlags;
+    sal_uInt32         nResId;
+    bool               bContext;
+    SfxShellFeature    nFeature;
 
-    SfxObjectUI_Impl(sal_uInt16 n, sal_uInt32 nId, SfxShellFeature nFeat) :
+    SfxObjectUI_Impl(sal_uInt16 n, SfxVisibilityFlags f, sal_uInt32 nId, SfxShellFeature nFeat) :
         nPos(n),
+        nFlags(f),
         nResId(nId),
         bContext(false),
         nFeature(nFeat)
@@ -95,7 +97,7 @@ struct SfxInterface_Impl
     }
 };
 
-static SfxObjectUI_Impl* CreateObjectBarUI_Impl(sal_uInt16 nPos, sal_uInt32 nResId, SfxShellFeature nFeature);
+static SfxObjectUI_Impl* CreateObjectBarUI_Impl(sal_uInt16 nPos, SfxVisibilityFlags nFlags, sal_uInt32 nResId, SfxShellFeature nFeature);
 
 // constuctor, registeres a new unit
 SfxInterface::SfxInterface( const char *pClassName,
@@ -360,24 +362,24 @@ void SfxInterface::RegisterPopupMenu( const OUString& rResourceName )
     pImplData->aPopupName = rResourceName;
 }
 
-void SfxInterface::RegisterObjectBar(sal_uInt16 nPos, sal_uInt32 nResId)
+void SfxInterface::RegisterObjectBar(sal_uInt16 nPos, SfxVisibilityFlags nFlags, sal_uInt32 nResId)
 {
-    RegisterObjectBar(nPos, nResId, SfxShellFeature::NONE);
+    RegisterObjectBar(nPos, nFlags, nResId, SfxShellFeature::NONE);
 }
 
-void SfxInterface::RegisterObjectBar(sal_uInt16 nPos, sal_uInt32 nResId, SfxShellFeature nFeature)
+void SfxInterface::RegisterObjectBar(sal_uInt16 nPos, SfxVisibilityFlags nFlags, sal_uInt32 nResId, SfxShellFeature nFeature)
 {
-    SfxObjectUI_Impl* pUI = CreateObjectBarUI_Impl(nPos, nResId, nFeature);
+    SfxObjectUI_Impl* pUI = CreateObjectBarUI_Impl(nPos, nFlags, nResId, nFeature);
     if ( pUI )
         pImplData->aObjectBars.push_back(pUI);
 }
 
-SfxObjectUI_Impl* CreateObjectBarUI_Impl(sal_uInt16 nPos, sal_uInt32 nResId, SfxShellFeature nFeature)
+SfxObjectUI_Impl* CreateObjectBarUI_Impl(sal_uInt16 nPos, SfxVisibilityFlags nFlags, sal_uInt32 nResId, SfxShellFeature nFeature)
 {
-    if ((nPos & SFX_VISIBILITY_MASK) == 0)
-        nPos |= SFX_VISIBILITY_STANDARD;
+    if (nFlags == SfxVisibilityFlags::Invisible)
+        nFlags |= SfxVisibilityFlags::Standard;
 
-    return new SfxObjectUI_Impl(nPos, nResId, nFeature);
+    return new SfxObjectUI_Impl(nPos, nFlags, nResId, nFeature);
 }
 
 sal_uInt32 SfxInterface::GetObjectBarId(sal_uInt16 nNo) const
@@ -418,6 +420,25 @@ sal_uInt16 SfxInterface::GetObjectBarPos( sal_uInt16 nNo ) const
     return pImplData->aObjectBars[nNo]->nPos;
 }
 
+SfxVisibilityFlags SfxInterface::GetObjectBarFlags( sal_uInt16 nNo ) const
+{
+    bool bGenoType = (pGenoType != nullptr && pGenoType->UseAsSuperClass());
+    if ( bGenoType )
+    {
+        // Are there toolbars in the super class?
+        sal_uInt16 nBaseCount = pGenoType->GetObjectBarCount();
+        if ( nNo < nBaseCount )
+            // The Super class comes first
+            return pGenoType->GetObjectBarFlags( nNo );
+        else
+            nNo = nNo - nBaseCount;
+    }
+
+    assert( nNo<pImplData->aObjectBars.size() );
+
+    return pImplData->aObjectBars[nNo]->nFlags;
+}
+
 sal_uInt16 SfxInterface::GetObjectBarCount() const
 {
     if (pGenoType && pGenoType->UseAsSuperClass())
@@ -433,7 +454,7 @@ void SfxInterface::RegisterChildWindow(sal_uInt16 nId, bool bContext)
 
 void SfxInterface::RegisterChildWindow(sal_uInt16 nId, bool bContext, SfxShellFeature nFeature)
 {
-    SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(0, nId, nFeature);
+    SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(0, SfxVisibilityFlags::Invisible, nId, nFeature);
     pUI->bContext = bContext;
     pImplData->aChildWindows.push_back(pUI);
 }
diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx
index bf2cabb..a612b82 100644
--- a/sfx2/source/inc/workwin.hxx
+++ b/sfx2/source/inc/workwin.hxx
@@ -46,15 +46,15 @@ class SfxWorkWindow;
 // This struct makes all relevant Information available of Toolboxes
 struct SfxObjectBar_Impl
 {
-    sal_uInt16        nId;   // Resource - and ConfigId of Toolbox
-    sal_uInt16        nMode; // special visibility flags
-    sal_uInt16        nPos;
-    bool              bDestroy;
-    SfxInterface*     pIFace;
+    sal_uInt16         nId;   // Resource - and ConfigId of Toolbox
+    SfxVisibilityFlags nMode; // special visibility flags
+    sal_uInt16         nPos;
+    bool               bDestroy;
+    SfxInterface*      pIFace;
 
     SfxObjectBar_Impl() :
         nId(0),
-        nMode(0),
+        nMode(SfxVisibilityFlags::Invisible),
         nPos(0),
         bDestroy(false),
         pIFace(nullptr)
@@ -116,7 +116,7 @@ struct SfxChildWin_Impl
     bool                            bCreate;
     SfxChildWinInfo                 aInfo;
     SfxChild_Impl*                  pCli;          // != 0 at direct Children
-    sal_uInt16                      nVisibility;
+    SfxVisibilityFlags              nVisibility;
     bool                            bEnable;
 
     SfxChildWin_Impl( sal_uInt32 nID ) :
@@ -126,7 +126,7 @@ struct SfxChildWin_Impl
         pWin(nullptr),
         bCreate(false),
         pCli(nullptr),
-        nVisibility( SFX_VISIBILITY_UNVISIBLE ),
+        nVisibility( SfxVisibilityFlags::Invisible ),
         bEnable( true )
     {}
 };
@@ -206,9 +206,9 @@ class SfxWorkWindow final
     VclPtr<vcl::Window>     pWorkWin;
     SfxShell*               pConfigShell;
     VclPtr<vcl::Window>     pActiveChild;
-    sal_uInt16              nUpdateMode;
+    SfxVisibilityFlags      nUpdateMode;
     sal_uInt16              nChildren;
-    sal_uInt16              nOrigMode;
+    SfxVisibilityFlags      nOrigMode;
     bool                    bSorted : 1;
     bool                    bDockingAllowed : 1;
     bool                    bInternalDockingAllowed : 1;
@@ -275,7 +275,7 @@ public:
     void                    UpdateObjectBars_Impl();
     void                    UpdateObjectBars_Impl2();
     void                    ResetObjectBars_Impl();
-    void                    SetObjectBar_Impl(sal_uInt16 nPos, sal_uInt32 nResId,
+    void                    SetObjectBar_Impl(sal_uInt16 nPos, SfxVisibilityFlags nFlags, sal_uInt32 nResId,
                                     SfxInterface *pIFace);
     bool                    KnowsObjectBar_Impl( sal_uInt16 nPos ) const;
     bool                    IsVisible_Impl();
@@ -285,7 +285,7 @@ public:
     // Methods for ChildWindows
     void                    UpdateChildWindows_Impl();
     void                    ResetChildWindows_Impl();
-    void                    SetChildWindowVisible_Impl( sal_uInt32, bool, sal_uInt16 );
+    void                    SetChildWindowVisible_Impl( sal_uInt32, bool, SfxVisibilityFlags );
     void                    ToggleChildWindow_Impl(sal_uInt16,bool);
     bool                    HasChildWindow_Impl(sal_uInt16);
     bool                    KnowsChildWindow_Impl(sal_uInt16);
@@ -295,7 +295,7 @@ public:
     void                    InitializeChild_Impl(SfxChildWin_Impl*);
     SfxSplitWindow*         GetSplitWindow_Impl(SfxChildAlignment);
 
-    bool                    IsVisible_Impl( sal_uInt16 nMode ) const;
+    bool                    IsVisible_Impl( SfxVisibilityFlags nMode ) const;
     bool                    IsFloating( sal_uInt16 nId );
     void                    SetActiveChild_Impl( vcl::Window *pChild );
     const VclPtr<vcl::Window>& GetActiveChild_Impl() const { return pActiveChild; }
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 3586a9a..c9585d4 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -149,8 +149,8 @@ void SfxViewFrame::InitInterface_Impl()
     GetStaticInterface()->RegisterChildWindow(SID_BROWSER);
     GetStaticInterface()->RegisterChildWindow(SID_RECORDING_FLOATWINDOW);
 #if HAVE_FEATURE_DESKTOP
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_FULLSCREEN | SFX_VISIBILITY_FULLSCREEN, RID_FULLSCREENTOOLBOX);
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION | SFX_VISIBILITY_STANDARD, RID_ENVTOOLBOX );
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_FULLSCREEN, SfxVisibilityFlags::FullScreen, RID_FULLSCREENTOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION, SfxVisibilityFlags::Standard, RID_ENVTOOLBOX );
 #endif
 }
 
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 61895fb..2456fb2 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -873,7 +873,8 @@ SFX_IMPL_SUPERCLASS_INTERFACE(SmViewShell, SfxViewShell)
 
 void SmViewShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_FULLSCREEN | SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS,
+                                            SfxVisibilityFlags::Standard | SfxVisibilityFlags::FullScreen | SfxVisibilityFlags::Server,
                                             RID_MATH_TOOLBOX);
     //Dummy-Objectbar, to avoid quiver while activating
 
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index e44a926..2b21ee7 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -158,15 +158,15 @@ SFX_IMPL_INTERFACE(FmFormShell, SfxShell)
 
 void FmFormShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_NAVIGATION|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_READONLYDOC,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_NAVIGATION, SfxVisibilityFlags::Standard|SfxVisibilityFlags::ReadonlyDoc,
                                             RID_SVXTBX_FORM_NAVIGATION,
                                             SfxShellFeature::FormShowDatabaseBar);
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_NAVIGATION|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_READONLYDOC,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_NAVIGATION, SfxVisibilityFlags::Standard|SfxVisibilityFlags::ReadonlyDoc,
                                             RID_SVXTBX_FORM_FILTER,
                                             SfxShellFeature::FormShowFilterBar);
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_READONLYDOC,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Standard | SfxVisibilityFlags::ReadonlyDoc,
                                             RID_SVXTBX_TEXT_CONTROL_ATTRIBUTES,
                                             SfxShellFeature::FormShowTextControlBar);
 
@@ -176,15 +176,15 @@ void FmFormShell::InitInterface_Impl()
     GetStaticInterface()->RegisterChildWindow(SID_FM_FILTER_NAVIGATOR, false, SfxShellFeature::FormShowFilterNavigator);
     GetStaticInterface()->RegisterChildWindow(SID_FM_SHOW_DATANAVIGATOR, false, SfxShellFeature::FormShowDataNavigator);
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT | SFX_VISIBILITY_STANDARD,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Standard,
                                             RID_SVXTBX_CONTROLS,
                                             SfxShellFeature::FormTBControls);
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT | SFX_VISIBILITY_STANDARD,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Standard,
                                             RID_SVXTBX_MORECONTROLS,
                                             SfxShellFeature::FormTBMoreControls);
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT | SFX_VISIBILITY_STANDARD,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Standard,
                                             RID_SVXTBX_FORMDESIGN,
                                             SfxShellFeature::FormTBDesign);
 }
diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx
index 4f25576..2d41d8f 100644
--- a/svx/source/toolbars/extrusionbar.cxx
+++ b/svx/source/toolbars/extrusionbar.cxx
@@ -58,7 +58,7 @@ SFX_IMPL_INTERFACE(ExtrusionBar, SfxShell)
 
 void ExtrusionBar::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_SVX_EXTRUSION_BAR);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_SVX_EXTRUSION_BAR);
 }
 
 
diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx
index a148de3..f863205 100644
--- a/svx/source/toolbars/fontworkbar.cxx
+++ b/svx/source/toolbars/fontworkbar.cxx
@@ -179,7 +179,7 @@ SFX_IMPL_INTERFACE(FontworkBar, SfxShell)
 
 void FontworkBar::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_SVX_FONTWORK_BAR);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_SVX_FONTWORK_BAR);
 }
 
 
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 270711f..9de3332 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -138,7 +138,8 @@ void SwModule::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterStatusBar(CFG_STATUSBAR);
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION | SFX_VISIBILITY_DESKTOP | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_CLIENT | SFX_VISIBILITY_VIEWER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION,
+                                            SfxVisibilityFlags::Standard | SfxVisibilityFlags::Client | SfxVisibilityFlags::Viewer,
                                             RID_MODULE_TOOLBOX);
 }
 
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index c5f01de..dde917c 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -140,7 +140,7 @@ SFX_IMPL_INTERFACE(SwAnnotationShell, SfxShell)
 
 void SwAnnotationShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_TEXT_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_TEXT_TOOLBOX);
 
     GetStaticInterface()->RegisterPopupMenu("annotation");
 }
diff --git a/sw/source/uibase/shells/beziersh.cxx b/sw/source/uibase/shells/beziersh.cxx
index b05c393..0881972 100644
--- a/sw/source/uibase/shells/beziersh.cxx
+++ b/sw/source/uibase/shells/beziersh.cxx
@@ -49,7 +49,7 @@ void SwBezierShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("draw");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_BEZIER_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_BEZIER_TOOLBOX);
 }
 
 
diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx
index d9aad7f..fc424d7 100644
--- a/sw/source/uibase/shells/drawsh.cxx
+++ b/sw/source/uibase/shells/drawsh.cxx
@@ -75,7 +75,7 @@ void SwDrawShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("draw");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_DRAW_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_DRAW_TOOLBOX);
 
     GetStaticInterface()->RegisterChildWindow(SvxFontWorkChildWindow::GetChildWindowId());
 }
diff --git a/sw/source/uibase/shells/drformsh.cxx b/sw/source/uibase/shells/drformsh.cxx
index 634f37a..8d4c678 100644
--- a/sw/source/uibase/shells/drformsh.cxx
+++ b/sw/source/uibase/shells/drformsh.cxx
@@ -63,7 +63,7 @@ void SwDrawFormShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("form");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_TEXT_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_TEXT_TOOLBOX);
 }
 
 
diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx
index 2dde260..b2520f5 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -88,7 +88,7 @@ void SwDrawTextShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("drawtext");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_DRAW_TEXT_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_DRAW_TEXT_TOOLBOX);
 
     GetStaticInterface()->RegisterChildWindow(SvxFontWorkChildWindow::GetChildWindowId());
 }
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 2a6ad96..1fe81f86 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -112,7 +112,7 @@ void SwFrameShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("frame");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_FRAME_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_FRAME_TOOLBOX);
 }
 
 void SwFrameShell::Execute(SfxRequest &rReq)
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 8553c3e..6d9b706 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -114,7 +114,7 @@ void SwGrfShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("graphic");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_GRAFIK_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_GRAFIK_TOOLBOX);
 }
 
 void SwGrfShell::Execute(SfxRequest &rReq)
diff --git a/sw/source/uibase/shells/listsh.cxx b/sw/source/uibase/shells/listsh.cxx
index 38d26fb..995dac2 100644
--- a/sw/source/uibase/shells/listsh.cxx
+++ b/sw/source/uibase/shells/listsh.cxx
@@ -55,7 +55,7 @@ SFX_IMPL_INTERFACE(SwListShell, SwBaseShell)
 
 void SwListShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_NUM_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_NUM_TOOLBOX);
 }
 
 
diff --git a/sw/source/uibase/shells/mediash.cxx b/sw/source/uibase/shells/mediash.cxx
index ccf4e5a..51f1865 100644
--- a/sw/source/uibase/shells/mediash.cxx
+++ b/sw/source/uibase/shells/mediash.cxx
@@ -75,7 +75,7 @@ void SwMediaShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("media");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_MEDIA_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_MEDIA_TOOLBOX);
 }
 
 void SwMediaShell::ExecMedia(SfxRequest &rReq)
diff --git a/sw/source/uibase/shells/olesh.cxx b/sw/source/uibase/shells/olesh.cxx
index 160c34a..ae67572 100644
--- a/sw/source/uibase/shells/olesh.cxx
+++ b/sw/source/uibase/shells/olesh.cxx
@@ -43,7 +43,7 @@ void SwOleShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("oleobject");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_OLE_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_OLE_TOOLBOX);
 }
 
 SwOleShell::SwOleShell(SwView &_rView) :
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 3a43c67..b2286fa 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -97,7 +97,7 @@ SFX_IMPL_INTERFACE(SwTableShell, SwBaseShell)
 void SwTableShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("table");
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_TABLE_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_TABLE_TOOLBOX);
 }
 
 
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index e8c5107..ca6dc13 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -121,7 +121,7 @@ void SwTextShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("text");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_TEXT_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_TEXT_TOOLBOX);
 
     GetStaticInterface()->RegisterChildWindow(FN_EDIT_FORMULA);
     GetStaticInterface()->RegisterChildWindow(FN_INSERT_FIELD);
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 9b89c39..72dc393 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -94,7 +94,8 @@ SFX_IMPL_INTERFACE(SwPagePreview, SfxViewShell)
 void SwPagePreview::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("preview");
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_CLIENT|SFX_VISIBILITY_FULLSCREEN|SFX_VISIBILITY_READONLYDOC,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT,
+                                            SfxVisibilityFlags::Standard|SfxVisibilityFlags::Client|SfxVisibilityFlags::FullScreen|SfxVisibilityFlags::ReadonlyDoc,
                                             RID_PVIEW_TOOLBOX);
 }
 
diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx
index 44ef7fb..4903d09 100644
--- a/sw/source/uibase/uiview/srcview.cxx
+++ b/sw/source/uibase/uiview/srcview.cxx
@@ -118,7 +118,8 @@ void SwSrcView::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("source");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS,
+                                            SfxVisibilityFlags::Standard|SfxVisibilityFlags::Server,
                                             RID_WEBTOOLS_TOOLBOX);
 
     GetStaticInterface()->RegisterChildWindow(SvxSearchDialogWrapper::GetChildWindowId());
diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx
index 419fbea..a61baec 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -112,7 +112,7 @@ void SwView::InitInterface_Impl()
 
     GetStaticInterface()->RegisterChildWindow(FN_SYNC_LABELS, false, SfxShellFeature::SwChildWindowLabel);
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS, SfxVisibilityFlags::Standard|SfxVisibilityFlags::Server,
                                             RID_TOOLS_TOOLBOX);
 #endif
 }
diff --git a/sw/source/uibase/web/wformsh.cxx b/sw/source/uibase/web/wformsh.cxx
index 225c033..7b11b3a 100644
--- a/sw/source/uibase/web/wformsh.cxx
+++ b/sw/source/uibase/web/wformsh.cxx
@@ -45,7 +45,7 @@ void SwWebDrawFormShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("form");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_TEXT_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_TEXT_TOOLBOX);
 }
 
 
diff --git a/sw/source/uibase/web/wfrmsh.cxx b/sw/source/uibase/web/wfrmsh.cxx
index befc4f6..cfb71bd 100644
--- a/sw/source/uibase/web/wfrmsh.cxx
+++ b/sw/source/uibase/web/wfrmsh.cxx
@@ -43,7 +43,7 @@ void SwWebFrameShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("frame");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_WEBFRAME_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_WEBFRAME_TOOLBOX);
 }
 
 
diff --git a/sw/source/uibase/web/wgrfsh.cxx b/sw/source/uibase/web/wgrfsh.cxx
index 717a3d6e0..527e443 100644
--- a/sw/source/uibase/web/wgrfsh.cxx
+++ b/sw/source/uibase/web/wgrfsh.cxx
@@ -47,7 +47,7 @@ void SwWebGrfShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("graphic");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_WEBGRAPHIC_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_WEBGRAPHIC_TOOLBOX);
 }
 
 
diff --git a/sw/source/uibase/web/wlistsh.cxx b/sw/source/uibase/web/wlistsh.cxx
index b58861a..088e25f 100644
--- a/sw/source/uibase/web/wlistsh.cxx
+++ b/sw/source/uibase/web/wlistsh.cxx
@@ -41,7 +41,7 @@ SFX_IMPL_INTERFACE(SwWebListShell, SwListShell)
 
 void SwWebListShell::InitInterface_Impl()
 {
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_NUM_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_NUM_TOOLBOX);
 }
 
 
diff --git a/sw/source/uibase/web/wolesh.cxx b/sw/source/uibase/web/wolesh.cxx
index 5c384af..37c8bd2 100644
--- a/sw/source/uibase/web/wolesh.cxx
+++ b/sw/source/uibase/web/wolesh.cxx
@@ -41,7 +41,7 @@ void SwWebOleShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("oleobject");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_WEBOLE_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_WEBOLE_TOOLBOX);
 }
 
 SwWebOleShell::SwWebOleShell(SwView &_rView) :
diff --git a/sw/source/uibase/web/wtabsh.cxx b/sw/source/uibase/web/wtabsh.cxx
index ef0b704..eedc6c3 100644
--- a/sw/source/uibase/web/wtabsh.cxx
+++ b/sw/source/uibase/web/wtabsh.cxx
@@ -46,7 +46,7 @@ SFX_IMPL_INTERFACE(SwWebTableShell, SwTableShell)
 void SwWebTableShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("table");
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_TABLE_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_TABLE_TOOLBOX);
 }
 
 
diff --git a/sw/source/uibase/web/wtextsh.cxx b/sw/source/uibase/web/wtextsh.cxx
index 319b9e8..dc2131b 100644
--- a/sw/source/uibase/web/wtextsh.cxx
+++ b/sw/source/uibase/web/wtextsh.cxx
@@ -49,7 +49,7 @@ void SwWebTextShell::InitInterface_Impl()
 {
     GetStaticInterface()->RegisterPopupMenu("text");
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_TEXT_TOOLBOX);
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, RID_TEXT_TOOLBOX);
 
     GetStaticInterface()->RegisterChildWindow(FN_EDIT_FORMULA);
     GetStaticInterface()->RegisterChildWindow(FN_INSERT_FIELD);
diff --git a/sw/source/uibase/web/wview.cxx b/sw/source/uibase/web/wview.cxx
index 8d298b7..9b0cb5c 100644
--- a/sw/source/uibase/web/wview.cxx
+++ b/sw/source/uibase/web/wview.cxx
@@ -82,7 +82,7 @@ void SwWebView::InitInterface_Impl()
     GetStaticInterface()->RegisterChildWindow(SvxSearchDialogWrapper::GetChildWindowId());
     GetStaticInterface()->RegisterChildWindow(SfxInfoBarContainerChild::GetChildWindowId());
 
-    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS|SFX_VISIBILITY_STANDARD|SFX_VISIBILITY_SERVER,
+    GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_TOOLS, SfxVisibilityFlags::Standard|SfxVisibilityFlags::Server,
                                             RID_WEBTOOLS_TOOLBOX);
 }
 
commit 0e04b531448d7915b40c59dccef7a9313bd28c11
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Nov 23 13:34:31 2016 +0200

    convert SFXWB_ constants to scoped enum
    
    Change-Id: I63d442e51b7e22093da1c232e1b575bc961c0e69

diff --git a/include/sfx2/new.hxx b/include/sfx2/new.hxx
index 7ce3c82..6113215 100644
--- a/include/sfx2/new.hxx
+++ b/include/sfx2/new.hxx
@@ -34,8 +34,9 @@ class SfxObjectShellLock;
 class SfxObjectShell;
 
 
-#define SFXWB_PREVIEW 0x0003
-#define SFXWB_LOAD_TEMPLATE 0x0004
+enum class SfxNewFileDialogMode {
+    NONE, Preview, LoadTemplate
+};
 
 enum class SfxTemplateFlags
 {
@@ -63,7 +64,7 @@ private:
 
 public:
 
-    SfxNewFileDialog(vcl::Window *pParent, sal_uInt16 nFlags);
+    SfxNewFileDialog(vcl::Window *pParent, SfxNewFileDialogMode nFlags);
     virtual ~SfxNewFileDialog() override;
     virtual void dispose() override;
 
diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx
index 6ee9b9a..e406177 100644
--- a/sd/source/ui/dlg/sdpreslt.cxx
+++ b/sd/source/ui/dlg/sdpreslt.cxx
@@ -178,7 +178,7 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLayoutHdl, ValueSet*, void)
  */
 IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl, Button*, void)
 {
-    VclPtrInstance< SfxNewFileDialog > pDlg(this, SFXWB_PREVIEW);
+    VclPtrInstance< SfxNewFileDialog > pDlg(this, SfxNewFileDialogMode::Preview);
     pDlg->SetText(SD_RESSTR(STR_LOAD_PRESENTATION_LAYOUT));
 
     if(!IsReallyVisible())
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index 0a7f60b..5d55b9c 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -140,7 +140,7 @@ class SfxNewFileDialog_Impl
     OUString aNone;
     OUString sLoadTemplate;
 
-    sal_uInt16 nFlags;
+    SfxNewFileDialogMode nFlags;
     SfxDocumentTemplates aTemplates;
     SfxObjectShellLock xDocShell;
     VclPtr<SfxNewFileDialog> pAntiImpl;
@@ -156,7 +156,7 @@ class SfxNewFileDialog_Impl
 
 public:
 
-    SfxNewFileDialog_Impl(SfxNewFileDialog* pAntiImplP, sal_uInt16 nFlags);
+    SfxNewFileDialog_Impl(SfxNewFileDialog* pAntiImplP, SfxNewFileDialogMode nFlags);
     ~SfxNewFileDialog_Impl();
 
     // Returns sal_False if '- No -' is set as a template
@@ -186,7 +186,7 @@ IMPL_LINK_NOARG(SfxNewFileDialog_Impl, Update, Idle*, void)
         return;
     }
 
-    if (m_pMoreBt->get_expanded() && (nFlags & SFXWB_PREVIEW) == SFXWB_PREVIEW)
+    if (m_pMoreBt->get_expanded() && (nFlags == SfxNewFileDialogMode::Preview))
     {
 
         OUString aFileName = aTemplates.GetPath(m_pRegionLb->GetSelectEntryPos(), nEntry - 1);
@@ -342,7 +342,7 @@ void    SfxNewFileDialog_Impl::SetTemplateFlags(SfxTemplateFlags nSet)
 
 
 SfxNewFileDialog_Impl::SfxNewFileDialog_Impl(
-    SfxNewFileDialog* pAntiImplP, sal_uInt16 nFl)
+    SfxNewFileDialog* pAntiImplP, SfxNewFileDialogMode nFl)
     : aNone(SfxResId(STR_NONE).toString())
     , nFlags(nFl)
     , pAntiImpl(pAntiImplP)
@@ -366,9 +366,9 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl(
     pAntiImplP->get(m_pLoadFilePB, "fromfile");
     sLoadTemplate = pAntiImplP->get<FixedText>("alttitle")->GetText();
 
-    if (!nFlags)
+    if (nFlags == SfxNewFileDialogMode::NONE)
         m_pMoreBt->Hide();
-    else if(SFXWB_LOAD_TEMPLATE == nFlags)
+    else if(SfxNewFileDialogMode::LoadTemplate == nFlags)
     {
         m_pLoadFilePB->SetClickHdl(LINK(this, SfxNewFileDialog_Impl, LoadFile));
         m_pLoadFilePB->Show();
@@ -389,7 +389,7 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl(
 
     OUString &rExtra = pAntiImplP->GetExtraData();
     bool bExpand = !rExtra.isEmpty() && rExtra[0] == 'Y';
-    m_pMoreBt->set_expanded(bExpand && nFlags);
+    m_pMoreBt->set_expanded(bExpand && (nFlags != SfxNewFileDialogMode::NONE));
 
     m_pTemplateLb->SetSelectHdl(LINK(this, SfxNewFileDialog_Impl, TemplateSelect));
     m_pTemplateLb->SetDoubleClickHdl(LINK(this, SfxNewFileDialog_Impl, DoubleClick));
@@ -421,7 +421,7 @@ SfxNewFileDialog_Impl::~SfxNewFileDialog_Impl()
     rExtra = m_pMoreBt->get_expanded() ? OUString("Y") : OUString("N");
 }
 
-SfxNewFileDialog::SfxNewFileDialog(vcl::Window *pParent, sal_uInt16 nFlags)
+SfxNewFileDialog::SfxNewFileDialog(vcl::Window *pParent, SfxNewFileDialogMode nFlags)
     : SfxModalDialog(pParent, "LoadTemplateDialog",
         "sfx/ui/loadtemplatedialog.ui"),
       pImpl( new SfxNewFileDialog_Impl(this, nFlags) )
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index 4a6ed92..195e7ea 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -123,7 +123,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, Button*, pButton, void)
     if(bTemplate)
     {
         m_pLoadTemplateRB->Check();
-        VclPtrInstance< SfxNewFileDialog > pNewFileDlg(this, 0);
+        VclPtrInstance< SfxNewFileDialog > pNewFileDlg(this, SfxNewFileDialogMode::NONE);
         sal_uInt16 nRet = pNewFileDlg->Execute();
         if(RET_TEMPLATE_LOAD == nRet)
             bTemplate = false;
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index c1f8a65..eff2461 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -497,7 +497,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
                 {
                     SvtPathOptions aPathOpt;
                     ScopedVclPtr<SfxNewFileDialog> pNewFileDlg(
-                        VclPtr<SfxNewFileDialog>::Create(&GetView()->GetViewFrame()->GetWindow(), SFXWB_LOAD_TEMPLATE));
+                        VclPtr<SfxNewFileDialog>::Create(&GetView()->GetViewFrame()->GetWindow(), SfxNewFileDialogMode::LoadTemplate));
                     pNewFileDlg->SetTemplateFlags(nFlags);
 
                     nRet = pNewFileDlg->Execute();
commit 06dd5b9c9e34ad932b0a111c0ecb9f1e99008a19
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Nov 23 12:31:54 2016 +0200

    convert SbDEBUG constants to o3tl::typed_flags
    
    Change-Id: Ifcada5684bacae46ec90c5ce3e58980860fee29f

diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index fdd837e..dbfe9ca 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -314,7 +314,7 @@ void ModulWindow::BasicExecute()
     if ( XModule().Is() && m_xModule->IsCompiled() && !m_aStatus.bError )
     {
         if ( GetBreakPoints().size() )
-            m_aStatus.nBasicFlags = m_aStatus.nBasicFlags | SbDEBUG_BREAK;
+            m_aStatus.nBasicFlags = m_aStatus.nBasicFlags | BasicDebugFlags::Break;
 
         if ( !m_aStatus.bIsRunning )
         {
@@ -369,26 +369,26 @@ void ModulWindow::CompileBasic()
 
 void ModulWindow::BasicRun()
 {
-    m_aStatus.nBasicFlags = 0;
+    m_aStatus.nBasicFlags = BasicDebugFlags::NONE;
     BasicExecute();
 }
 
 void ModulWindow::BasicStepOver()
 {
-    m_aStatus.nBasicFlags = SbDEBUG_STEPINTO | SbDEBUG_STEPOVER;
+    m_aStatus.nBasicFlags = BasicDebugFlags::StepInto | BasicDebugFlags::StepOver;
     BasicExecute();
 }
 
 
 void ModulWindow::BasicStepInto()
 {
-    m_aStatus.nBasicFlags = SbDEBUG_STEPINTO;
+    m_aStatus.nBasicFlags = BasicDebugFlags::StepInto;
     BasicExecute();
 }
 
 void ModulWindow::BasicStepOut()
 {
-    m_aStatus.nBasicFlags = SbDEBUG_STEPOUT;
+    m_aStatus.nBasicFlags = BasicDebugFlags::StepOut;
     BasicExecute();
 }
 
@@ -515,7 +515,7 @@ void ModulWindow::ToggleBreakPoint( sal_uLong nLine )
                     {
                         SbMethod* pMethod = static_cast<SbMethod*>(m_xModule->GetMethods()->Get( nMethod ));
                         assert(pMethod && "Methode nicht gefunden! (NULL)");
-                        pMethod->SetDebugFlags( pMethod->GetDebugFlags() | SbDEBUG_BREAK );
+                        pMethod->SetDebugFlags( pMethod->GetDebugFlags() | BasicDebugFlags::Break );
                     }
                 }
             }
@@ -626,7 +626,7 @@ bool ModulWindow::BasicErrorHdl( StarBASIC * pBasic )
     return false;
 }
 
-long ModulWindow::BasicBreakHdl( StarBASIC* pBasic )
+BasicDebugFlags ModulWindow::BasicBreakHdl( StarBASIC* pBasic )
 {
     // #i69280 Required in Window despite normal usage in next command!
     (void)pBasic;
@@ -1280,7 +1280,7 @@ void ModulWindow::BasicStarted()
             {
                 SbMethod* pMethod = static_cast<SbMethod*>(m_xModule->GetMethods()->Get( nMethod ));
                 assert(pMethod && "Methode nicht gefunden! (NULL)");
-                pMethod->SetDebugFlags( pMethod->GetDebugFlags() | SbDEBUG_BREAK );
+                pMethod->SetDebugFlags( pMethod->GetDebugFlags() | BasicDebugFlags::Break );
             }
         }
     }
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index e631d8e..3463fbb 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -360,7 +360,7 @@ public:
     void            BasicAddWatch();
 
     bool            BasicErrorHdl( StarBASIC* pBasic );
-    long            BasicBreakHdl( StarBASIC* pBasic );
+    BasicDebugFlags BasicBreakHdl( StarBASIC* pBasic );
     void            AssertValidEditEngine();
 
     void            LoadBasic();
diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 3f8f34c..251c916 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -1109,9 +1109,9 @@ bool Shell::CallBasicErrorHdl( StarBASIC* pBasic )
     return bRet;
 }
 
-long Shell::CallBasicBreakHdl( StarBASIC* pBasic )
+BasicDebugFlags Shell::CallBasicBreakHdl( StarBASIC* pBasic )
 {
-    long nRet = 0;
+    BasicDebugFlags nRet = BasicDebugFlags::NONE;
     VclPtr<ModulWindow> pModWin = ShowActiveModuleWindow( pBasic );
     if ( pModWin )
     {
diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx
index eb0e6dd..b301ef7 100644
--- a/basctl/source/basicide/iderdll.cxx
+++ b/basctl/source/basicide/iderdll.cxx
@@ -170,9 +170,9 @@ void ExtraData::SetSearchItem (const SvxSearchItem& rItem)
     pSearchItem.reset(static_cast<SvxSearchItem*>(rItem.Clone()));
 }
 
-IMPL_STATIC_LINK(ExtraData, GlobalBasicBreakHdl, StarBASIC *, pBasic, sal_uInt16)
+IMPL_STATIC_LINK(ExtraData, GlobalBasicBreakHdl, StarBASIC *, pBasic, BasicDebugFlags)
 {
-    sal_uInt16 nRet = 0;
+    BasicDebugFlags nRet = BasicDebugFlags::NONE;
     if (Shell* pShell = GetShell())
     {
         if (BasicManager* pBasMgr = FindBasicManager(pBasic))
@@ -193,7 +193,7 @@ IMPL_STATIC_LINK(ExtraData, GlobalBasicBreakHdl, StarBASIC *, pBasic, sal_uInt16
                     if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) )
                     {
                            // a step-out should get me out of the protected area...
-                        nRet = SbDEBUG_STEPOUT;
+                        nRet = BasicDebugFlags::StepOut;
                     }
                     else
                     {
diff --git a/basctl/source/basicide/iderdll2.hxx b/basctl/source/basicide/iderdll2.hxx
index 1409dc4..cd24840 100644
--- a/basctl/source/basicide/iderdll2.hxx
+++ b/basctl/source/basicide/iderdll2.hxx
@@ -48,7 +48,7 @@ private:
     bool            bShellInCriticalSection;
 
 protected:
-    DECL_STATIC_LINK( ExtraData, GlobalBasicBreakHdl, StarBASIC *, sal_uInt16 );
+    DECL_STATIC_LINK( ExtraData, GlobalBasicBreakHdl, StarBASIC *, BasicDebugFlags );
 
 public:
     ExtraData();
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index aa41e8b..d6f02ea 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -178,7 +178,7 @@ public:
     virtual bool        HasUIFeature(SfxShellFeature nFeature) const override;
 
     bool                CallBasicErrorHdl( StarBASIC* pBasic );
-    long                CallBasicBreakHdl( StarBASIC* pBasic );
+    BasicDebugFlags     CallBasicBreakHdl( StarBASIC* pBasic );
 
     VclPtr<BaseWindow>   FindWindow( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rName, ItemType nType, bool bFindSuspended = false );
     VclPtr<DialogWindow> FindDlgWin( const ScriptDocument& rDocument, const OUString& rLibName, const OUString& rName, bool bCreateIfNotExist = false, bool bFindSuspended = false );
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index 20f9f8f..b487d40 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -25,6 +25,7 @@
 #include <iderid.hxx>
 #include <svtools/tabbar.hxx>
 #include <vcl/toolbox.hxx>
+#include <basic/sbdef.hxx>
 
 #include <unordered_map>
 
@@ -63,13 +64,13 @@ struct BasicStatus
     bool bIsRunning : 1;
     bool bError : 1;
     bool bIsInReschedule : 1;
-    sal_uInt16 nBasicFlags;
+    BasicDebugFlags nBasicFlags;
 
     BasicStatus():
         bIsRunning(false),
         bError(false),
         bIsInReschedule(false),
-        nBasicFlags(0) { }
+        nBasicFlags(BasicDebugFlags::NONE) { }
 };
 
 
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index b4e21a4..d03eaa3 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1430,7 +1430,7 @@ SbModule* StarBASIC::GetActiveModule()
     }
 }
 
-sal_uInt16 StarBASIC::BreakPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
+BasicDebugFlags StarBASIC::BreakPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
 {
     SetErrorData( 0, l, c1, c2 );
     bBreak = true;
@@ -1444,7 +1444,7 @@ sal_uInt16 StarBASIC::BreakPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
     }
 }
 
-sal_uInt16 StarBASIC::StepPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
+BasicDebugFlags StarBASIC::StepPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
 {
     SetErrorData( 0, l, c1, c2 );
     bBreak = false;
@@ -1458,9 +1458,9 @@ sal_uInt16 StarBASIC::StepPoint( sal_Int32 l, sal_Int32 c1, sal_Int32 c2 )
     }
 }
 
-sal_uInt16 StarBASIC::BreakHdl()
+BasicDebugFlags StarBASIC::BreakHdl()
 {
-    return aBreakHdl.IsSet() ? aBreakHdl.Call( this ) : SbDEBUG_CONTINUE;
+    return aBreakHdl.IsSet() ? aBreakHdl.Call( this ) : BasicDebugFlags::Continue;
 }
 
 // Calls for error handler and break handler
@@ -1802,7 +1802,7 @@ void StarBASIC::SetGlobalErrorHdl( const Link<StarBASIC*,bool>& rLink )
     GetSbData()->aErrHdl = rLink;
 }
 
-void StarBASIC::SetGlobalBreakHdl( const Link<StarBASIC*,sal_uInt16>& rLink )
+void StarBASIC::SetGlobalBreakHdl( const Link<StarBASIC*,BasicDebugFlags>& rLink )
 {
     GetSbData()->aBreakHdl = rLink;
 }
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index fef1220..8b5b97e 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1181,10 +1181,10 @@ void SbModule::Run( SbMethod* pMeth )
             GetSbData()->pInst->nCallLvl--;          // Call-Level down again
 
             // Exist an higher-ranking runtime instance?
-            // Then take over SbDEBUG_BREAK, if set
+            // Then take over BasicDebugFlags::Break, if set
             SbiRuntime* pRtNext = pRt->pNext;
-            if( pRtNext && (pRt->GetDebugFlags() & SbDEBUG_BREAK) )
-                pRtNext->SetDebugFlags( SbDEBUG_BREAK );
+            if( pRtNext && (pRt->GetDebugFlags() & BasicDebugFlags::Break) )
+                pRtNext->SetDebugFlags( BasicDebugFlags::Break );
 
             delete pRt;
             GetSbData()->pMod = pOldMod;
@@ -1558,9 +1558,9 @@ bool SbModule::SetBP( sal_uInt16 nLine )
     }
     pBreaks->insert( pBreaks->begin() + i, nLine );
 
-    // #38568: Set during runtime as well here SbDEBUG_BREAK
+    // #38568: Set during runtime as well here BasicDebugFlags::Break
     if( GetSbData()->pInst && GetSbData()->pInst->pRun )
-        GetSbData()->pInst->pRun->SetDebugFlags( SbDEBUG_BREAK );
+        GetSbData()->pInst->pRun->SetDebugFlags( BasicDebugFlags::Break );
 
     return IsBreakable( nLine );
 }
@@ -1975,12 +1975,12 @@ SbMethod::SbMethod( const OUString& r, SbxDataType t, SbModule* p )
         : SbxMethod( r, t ), pMod( p )
 {
     bInvalid     = true;
-    nStart       =
-    nDebugFlags  =
-    nLine1       =
+    nStart       = 0;
+    nDebugFlags  = BasicDebugFlags::NONE;
+    nLine1       = 0;
     nLine2       = 0;
-    refStatics = new SbxArray;
-    mCaller          = nullptr;
+    refStatics   = new SbxArray;
+    mCaller      = nullptr;
     // HACK due to 'Referenz could not be saved'
     SetFlag( SbxFlagBits::NoModify );
 }
diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx
index 5a1e8c2..cf6d32a 100644
--- a/basic/source/inc/runtime.hxx
+++ b/basic/source/inc/runtime.hxx
@@ -159,7 +159,7 @@ public:
     // explanation see runtime.cxx at SbiInstance::CalcBreakCallLevel()
     sal_uInt16  nCallLvl;
     sal_uInt16  nBreakCallLvl;
-    void    CalcBreakCallLevel( sal_uInt16 nFlags );
+    void    CalcBreakCallLevel( BasicDebugFlags nFlags );
 
     SbiInstance( StarBASIC* );
    ~SbiInstance();
@@ -217,46 +217,46 @@ class SbiRuntime
     static pStep1 aStep1[];
     static pStep2 aStep2[];
 
-    StarBASIC&    rBasic;           // StarBASIC instance
-    SbiInstance*   pInst;           // current thread
-    SbModule*     pMod;             // current module
-    SbMethod*     pMeth;            // method instance
-    SbiIoSystem*   pIosys;          // I/O-System
-    const SbiImage* pImg;           // Code-Image
-    SbxArrayRef   refExprStk;       // expression stack
-    SbxArrayRef   refCaseStk;       // CASE expression stack
-    SbxArrayRef   refRedimpArray;   // Array saved to use for REDIM PRESERVE
-    SbxVariableRef   refRedim;   // Array saved to use for REDIM
-    SbxVariableRef xDummyVar;       // substitute for variables that weren't found
-    SbxVariable* mpExtCaller;       // Caller ( external - e.g. button name, shape, range object etc. - only in vba mode )
-    SbiForStack*   pForStk;         // FOR/NEXT-Stack
-    sal_uInt16        nExprLvl;         // depth of the expr-stack
-    sal_uInt16        nForLvl;          // #118235: Maintain for level
+    StarBASIC&         rBasic;           // StarBASIC instance
+    SbiInstance*       pInst;            // current thread
+    SbModule*          pMod;             // current module
+    SbMethod*          pMeth;            // method instance
+    SbiIoSystem*       pIosys;           // I/O-System
+    const SbiImage*    pImg;             // Code-Image
+    SbxArrayRef        refExprStk;       // expression stack
+    SbxArrayRef        refCaseStk;       // CASE expression stack
+    SbxArrayRef        refRedimpArray;   // Array saved to use for REDIM PRESERVE
+    SbxVariableRef     refRedim;         // Array saved to use for REDIM
+    SbxVariableRef     xDummyVar;        // substitute for variables that weren't found
+    SbxVariable*       mpExtCaller;      // Caller ( external - e.g. button name, shape, range object etc. - only in vba mode )
+    SbiForStack*       pForStk;          // FOR/NEXT-Stack
+    sal_uInt16         nExprLvl;         // depth of the expr-stack
+    sal_uInt16         nForLvl;          // #118235: Maintain for level
     const sal_uInt8*   pCode;            // current Code-Pointer
     const sal_uInt8*   pStmnt;           // beginning of the last statement
     const sal_uInt8*   pError;           // address of the current error handler
     const sal_uInt8*   pRestart;         // restart-address
     const sal_uInt8*   pErrCode;         // restart-adresse RESUME NEXT
     const sal_uInt8*   pErrStmnt;        // Restart-Adresse RESUME 0
-    OUString        aLibName;         // Lib-name for declare-call
-    SbxArrayRef   refParams;        // current procedure parameters
-    SbxArrayRef   refLocals;        // local variable
-    SbxArrayRef   refArgv;
+    OUString           aLibName;         // Lib-name for declare-call
+    SbxArrayRef        refParams;        // current procedure parameters
+    SbxArrayRef        refLocals;        // local variable
+    SbxArrayRef        refArgv;
     // #74254, one refSaveObj is not enough! new: pRefSaveList (see above)
-    short         nArgc;
-    bool          bRun;
-    bool          bError;           // true: handle errors
-    bool          bInError;         // true: in an error handler
-    bool          bBlocked;         // true: blocked by next call level, #i48868
-    bool          bVBAEnabled;
-    sal_uInt16        nFlags;           // Debugging-Flags
-    SbError       nError;
-    sal_uInt16        nOps;             // opcode counter
-    sal_uInt32    m_nLastTime;
+    short              nArgc;
+    bool               bRun;
+    bool               bError;           // true: handle errors
+    bool               bInError;         // true: in an error handler
+    bool               bBlocked;         // true: blocked by next call level, #i48868
+    bool               bVBAEnabled;
+    BasicDebugFlags    nFlags;           // Debugging-Flags
+    SbError            nError;
+    sal_uInt16         nOps;             // opcode counter
+    sal_uInt32         m_nLastTime;
 
     std::vector<SbxVariableRef>  aRefSaved; // #74254 save temporary references
-    std::vector<SbiGosub>   pGosubStk; // GOSUB stack
-    std::vector<SbiArgv>    pArgvStk;  // ARGV-Stack
+    std::vector<SbiGosub>   pGosubStk;      // GOSUB stack
+    std::vector<SbiArgv>    pArgvStk;       // ARGV-Stack
 
 
     SbxVariable* FindElement
@@ -364,8 +364,8 @@ public:
     void block()     { bBlocked = true; }
     void unblock()   { bBlocked = false; }
     SbModule* GetModule()  { return pMod;    }
-    sal_uInt16 GetDebugFlags() { return nFlags;  }
-    void SetDebugFlags( sal_uInt16 nFl ) { nFlags = nFl;  }
+    BasicDebugFlags GetDebugFlags() { return nFlags;  }
+    void SetDebugFlags( BasicDebugFlags nFl ) { nFlags = nFl;  }
     SbMethod* GetCaller() { return pMeth;}
     SbxVariable* GetExternalCaller(){ return mpExtCaller; }
 
diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx
index 03ce05a..900679f 100644
--- a/basic/source/inc/sbintern.hxx
+++ b/basic/source/inc/sbintern.hxx
@@ -89,8 +89,8 @@ struct SbiGlobals
     SbModule*       pMod;           // currently active module
     SbModule*       pCompMod;       // currently compiled module
     short           nInst;          // number of BASICs
-    Link<StarBASIC*,bool>        aErrHdl;        // global error handler
-    Link<StarBASIC*,sal_uInt16>  aBreakHdl;      // global break handler
+    Link<StarBASIC*,bool>            aErrHdl;        // global error handler
+    Link<StarBASIC*,BasicDebugFlags> aBreakHdl;      // global break handler
     SbError         nCode;
     sal_Int32       nLine;
     sal_Int32       nCol1,nCol2;    // from... to...
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 67108d8..030a75f 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -283,26 +283,20 @@ SbiRTLData::~SbiRTLData()
 // (also have a look at: step2.cxx, SbiRuntime::StepSTMNT() )
 
 
-void SbiInstance::CalcBreakCallLevel( sal_uInt16 nFlags )
+void SbiInstance::CalcBreakCallLevel( BasicDebugFlags nFlags )
 {
 
-    nFlags &= ~((sal_uInt16)SbDEBUG_BREAK);
+    nFlags &= ~BasicDebugFlags::Break;
 
     sal_uInt16 nRet;
-    switch( nFlags )
-    {
-    case SbDEBUG_STEPINTO:
+    if (nFlags  == BasicDebugFlags::StepInto) {
         nRet = nCallLvl + 1;    // CallLevel+1 is also stopped
-        break;
-    case SbDEBUG_STEPOVER | SbDEBUG_STEPINTO:
+    } else if (nFlags == (BasicDebugFlags::StepOver | BasicDebugFlags::StepInto)) {
         nRet = nCallLvl;        // current CallLevel is stopped
-        break;
-    case SbDEBUG_STEPOUT:
+    } else if (nFlags == BasicDebugFlags::StepOut) {
         nRet = nCallLvl - 1;    // smaller CallLevel is stopped
-        break;
-    case SbDEBUG_CONTINUE:
-        // Basic-IDE returns 0 instead of SbDEBUG_CONTINUE, so also default=continue
-    default:
+    } else {
+        // Basic-IDE returns 0 instead of BasicDebugFlags::Continue, so also default=continue
         nRet = 0;               // CallLevel is always > 0 -> no StepPoint
     }
     nBreakCallLvl = nRet;           // take result
@@ -448,7 +442,7 @@ SvNumberFormatter* SbiInstance::PrepareNumberFormatter( sal_uInt32 &rnStdDateIdx
 }
 
 
-// Let engine run. If Flags == SbDEBUG_CONTINUE, take Flags over
+// Let engine run. If Flags == BasicDebugFlags::Continue, take Flags over
 
 void SbiInstance::Stop()
 {
@@ -572,7 +566,7 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, sal_uInt32 nStart )
          : rBasic( *static_cast<StarBASIC*>(pm->pParent) ), pInst( GetSbData()->pInst ),
            pMod( pm ), pMeth( pe ), pImg( pMod->pImage ), mpExtCaller(nullptr), m_nLastTime(0)
 {
-    nFlags    = pe ? pe->GetDebugFlags() : 0;
+    nFlags    = pe ? pe->GetDebugFlags() : BasicDebugFlags::NONE;
     pIosys    = pInst->GetIoSystem();
     pForStk   = nullptr;
     pError    = nullptr;
@@ -4228,18 +4222,18 @@ void SbiRuntime::StepSTMNT( sal_uInt32 nOp1, sal_uInt32 nOp2 )
     if( pInst->nCallLvl <= pInst->nBreakCallLvl )
     {
         StarBASIC* pStepBasic = GetCurrentBasic( &rBasic );
-        sal_uInt16 nNewFlags = pStepBasic->StepPoint( nLine, nCol1, nCol2 );
+        BasicDebugFlags nNewFlags = pStepBasic->StepPoint( nLine, nCol1, nCol2 );
 
         pInst->CalcBreakCallLevel( nNewFlags );
     }
 
     // break points only at STMNT-commands in a new line!
     else if( ( nOp1 != nOld )
-        && ( nFlags & SbDEBUG_BREAK )
+        && ( nFlags & BasicDebugFlags::Break )
         && pMod->IsBP( static_cast<sal_uInt16>( nOp1 ) ) )
     {
         StarBASIC* pBreakBasic = GetCurrentBasic( &rBasic );
-        sal_uInt16 nNewFlags = pBreakBasic->BreakPoint( nLine, nCol1, nCol2 );
+        BasicDebugFlags nNewFlags = pBreakBasic->BreakPoint( nLine, nCol1, nCol2 );
 
         pInst->CalcBreakCallLevel( nNewFlags );
     }
diff --git a/include/basic/sbdef.hxx b/include/basic/sbdef.hxx
index fa20115..39576fb 100644
--- a/include/basic/sbdef.hxx
+++ b/include/basic/sbdef.hxx
@@ -23,6 +23,7 @@
 #include <basic/sbxdef.hxx>
 #include <rtl/ustring.hxx>
 #include <basic/basicdllapi.h>
+#include <o3tl/typed_flags_set.hxx>
 
 // Returns type name for Basic type, array flag is ignored
 // implementation: basic/source/runtime/methods.cxx
@@ -39,11 +40,17 @@ BASIC_DLLPUBLIC OUString getBasicObjectTypeName( SbxObject* pObj );
 BASIC_DLLPUBLIC void setBasicWatchMode( bool bOn );
 
 // Debug Flags:
-#define SbDEBUG_BREAK       0x0001          // Break-Callback
-#define SbDEBUG_STEPINTO    0x0002          // Single Step-Callback
-#define SbDEBUG_STEPOVER    0x0004          // Additional flag Step Over
-#define SbDEBUG_CONTINUE    0x0008          // Do not change flags
-#define SbDEBUG_STEPOUT     0x0010          // Leave Sub
+enum class BasicDebugFlags {
+    NONE        = 0x0000,
+    Break       = 0x0001,        // Break-Callback
+    StepInto    = 0x0002,        // Single Step-Callback
+    StepOver    = 0x0004,        // Additional flag Step Over
+    Continue    = 0x0008,        // Do not change flags
+    StepOut     = 0x0010,        // Leave Sub
+};
+namespace o3tl {
+    template<> struct typed_flags<BasicDebugFlags> : is_typed_flags<BasicDebugFlags, 0x001f> {};
+}
 
 #define SBXID_BASIC         0x6273          // sb: StarBASIC
 #define SBXID_BASICMOD      0x6d62          // bm: StarBASIC Module
diff --git a/include/basic/sbmeth.hxx b/include/basic/sbmeth.hxx
index 1eb6654..e0d57a69 100644
--- a/include/basic/sbmeth.hxx
+++ b/include/basic/sbmeth.hxx
@@ -39,7 +39,7 @@ class BASIC_DLLPUBLIC SbMethod : public SbxMethod
 
     SbxVariable*  mCaller;                   // caller
     SbModule*     pMod;
-    sal_uInt16    nDebugFlags;
+    BasicDebugFlags nDebugFlags;
     sal_uInt16    nLine1, nLine2;
     sal_uInt32    nStart;
     bool          bInvalid;
@@ -55,9 +55,9 @@ public:
     virtual SbxInfo* GetInfo() override;
     SbxArray*  GetStatics();
     void       ClearStatics();
-    SbModule*  GetModule()                { return pMod;        }
-    sal_uInt16 GetDebugFlags()            { return nDebugFlags; }
-    void       SetDebugFlags( sal_uInt16 n )  { nDebugFlags = n;    }
+    SbModule*  GetModule()                         { return pMod;        }
+    BasicDebugFlags GetDebugFlags()                { return nDebugFlags; }
+    void       SetDebugFlags( BasicDebugFlags n )  { nDebugFlags = n;    }
     void       GetLineRange( sal_uInt16&, sal_uInt16& );
 
     // Interface to execute a method from the applications
diff --git a/include/basic/sbstar.hxx b/include/basic/sbstar.hxx
index aeb7874..b483340 100644
--- a/include/basic/sbstar.hxx
+++ b/include/basic/sbstar.hxx
@@ -54,8 +54,8 @@ class BASIC_DLLPUBLIC StarBASIC : public SbxObject
     SbxArrayRef     xUnoListeners;          // Listener handled by CreateUnoListener
 
    // Handler-Support:
-    Link<StarBASIC*,bool>       aErrorHdl;              // Error handler
-    Link<StarBASIC*,sal_uInt16> aBreakHdl;              // Breakpoint handler
+    Link<StarBASIC*,bool>            aErrorHdl;              // Error handler
+    Link<StarBASIC*,BasicDebugFlags> aBreakHdl;              // Breakpoint handler
     bool            bNoRtl;                 // if true: do not search RTL
     bool            bBreak;                 // if true: Break, otherwise Step
     bool            bDocBasic;
@@ -72,14 +72,14 @@ protected:
     bool                                CError( SbError, const OUString&, sal_Int32, sal_Int32, sal_Int32 );
 private:
     BASIC_DLLPRIVATE bool               RTError( SbError, const OUString& rMsg, sal_Int32, sal_Int32, sal_Int32 );
-    BASIC_DLLPRIVATE sal_uInt16         BreakPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
-    BASIC_DLLPRIVATE sal_uInt16         StepPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
+    BASIC_DLLPRIVATE BasicDebugFlags    BreakPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
+    BASIC_DLLPRIVATE BasicDebugFlags    StepPoint( sal_Int32 nLine, sal_Int32 nCol1, sal_Int32 nCol2 );
     virtual bool LoadData( SvStream&, sal_uInt16 ) override;
     virtual bool StoreData( SvStream& ) const override;
 
 protected:
-    bool        ErrorHdl();
-    sal_uInt16  BreakHdl();
+    bool             ErrorHdl();
+    BasicDebugFlags  BreakHdl();
     virtual ~StarBASIC() override;
 
 public:
@@ -140,7 +140,7 @@ public:
     static Link<StarBASIC*,bool> GetGlobalErrorHdl();
     static void     SetGlobalErrorHdl( const Link<StarBASIC*,bool>& rNewHdl );
 
-    static void     SetGlobalBreakHdl( const Link<StarBASIC*,sal_uInt16>& rNewHdl );
+    static void     SetGlobalBreakHdl( const Link<StarBASIC*,BasicDebugFlags>& rNewHdl );
 
     SbxArrayRef const & getUnoListeners();
 


More information about the Libreoffice-commits mailing list