[Libreoffice-commits] core.git: 24 commits - accessibility/source basctl/source chart2/source cui/source dbaccess/source editeng/source extensions/source filter/source fpicker/source include/sfx2 include/svl include/svtools include/svx reportdesign/source sc/source sd/source sfx2/source svl/source svtools/source svx/source svx/workben sw/inc sw/source

Noel Grandin noel at peralex.com
Wed Apr 22 01:36:17 PDT 2015


 accessibility/source/extended/accessiblelistbox.cxx                   |   10 
 accessibility/source/extended/accessiblelistboxentry.cxx              |   28 -
 basctl/source/basicide/baside2b.cxx                                   |   12 
 basctl/source/basicide/moduldlg.cxx                                   |    8 
 chart2/source/controller/dialogs/DataBrowser.cxx                      |   16 
 cui/source/customize/acccfg.cxx                                       |    2 
 cui/source/customize/cfg.cxx                                          |    8 
 cui/source/customize/selector.cxx                                     |    2 
 cui/source/dialogs/multipat.cxx                                       |    2 
 cui/source/options/certpath.cxx                                       |    2 
 cui/source/options/connpooloptions.cxx                                |    3 
 cui/source/options/dbregister.cxx                                     |   24 -
 cui/source/options/fontsubs.cxx                                       |   10 
 cui/source/options/optcolor.cxx                                       |   10 
 cui/source/options/optfltr.cxx                                        |    8 
 cui/source/options/optjava.cxx                                        |    2 
 cui/source/options/optopencl.cxx                                      |    2 
 cui/source/options/optpath.cxx                                        |   24 -
 cui/source/options/webconninfo.cxx                                    |   14 
 cui/source/tabpages/autocdlg.cxx                                      |   10 
 dbaccess/source/ui/browser/dbtreeview.cxx                             |    2 
 dbaccess/source/ui/control/RelationControl.cxx                        |   19 
 dbaccess/source/ui/control/TableGrantCtrl.cxx                         |    6 
 dbaccess/source/ui/control/dbtreelistbox.cxx                          |    2 
 dbaccess/source/ui/dlg/indexfieldscontrol.cxx                         |   10 
 dbaccess/source/ui/dlg/sqlmessage.cxx                                 |    2 
 dbaccess/source/ui/dlg/tablespage.cxx                                 |    2 
 dbaccess/source/ui/misc/WNameMatch.cxx                                |    2 
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx                 |   38 -
 dbaccess/source/ui/tabledesign/TEditControl.cxx                       |    6 
 dbaccess/source/ui/tabledesign/TableDesignControl.cxx                 |   12 
 editeng/source/editeng/impedit5.cxx                                   |    6 
 editeng/source/items/borderline.cxx                                   |   28 -
 extensions/source/propctrlr/selectlabeldialog.cxx                     |    2 
 extensions/source/propctrlr/taborder.cxx                              |    2 
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx                  |    4 
 fpicker/source/office/PlacesListBox.cxx                               |    2 
 include/sfx2/imgmgr.hxx                                               |   20 
 include/svl/srchitem.hxx                                              |   15 
 include/svl/style.hxx                                                 |   40 -
 include/svtools/brwbox.hxx                                            |   70 +--
 include/svtools/ctrlbox.hxx                                           |   22 -
 include/svtools/ctrltool.hxx                                          |    3 
 include/svtools/editbrowsebox.hxx                                     |   33 -
 include/svtools/filectrl.hxx                                          |   26 -
 include/svtools/fileview.hxx                                          |    6 
 include/svtools/fmtfield.hxx                                          |   18 
 include/svtools/grfmgr.hxx                                            |   72 ++-
 include/svtools/headbar.hxx                                           |   87 ++--
 include/svtools/imgdef.hxx                                            |    3 
 include/svtools/ivctrl.hxx                                            |   59 +-
 include/svtools/ruler.hxx                                             |   21 
 include/svtools/scrwin.hxx                                            |   21 
 include/svtools/simptabl.hxx                                          |    2 
 include/svtools/svtabbx.hxx                                           |    8 
 include/svtools/table/tablemodel.hxx                                  |   29 -
 include/svtools/treelistbox.hxx                                       |  161 ++++---
 include/svtools/treelistentry.hxx                                     |   32 -
 include/svx/svdpntv.hxx                                               |    7 
 reportdesign/source/ui/dlg/AddField.cxx                               |    2 
 reportdesign/source/ui/dlg/GroupsSorting.cxx                          |   11 
 reportdesign/source/ui/dlg/Navigator.cxx                              |    2 
 sc/source/core/data/table6.cxx                                        |    6 
 sc/source/ui/condformat/condformatdlgentry.cxx                        |    4 
 sc/source/ui/condformat/condformatmgr.cxx                             |    2 
 sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx                        |    2 
 sc/source/ui/dbgui/tpsubt.cxx                                         |    2 
 sc/source/ui/docshell/docsh4.cxx                                      |    4 
 sc/source/ui/miscdlgs/conflictsdlg.cxx                                |    2 
 sc/source/ui/miscdlgs/sharedocdlg.cxx                                 |    2 
 sc/source/ui/namedlg/namemgrtable.cxx                                 |    6 
 sc/source/ui/navipi/navipi.cxx                                        |    6 
 sc/source/ui/undo/undoblk3.cxx                                        |    2 
 sc/source/ui/unoobj/srchuno.cxx                                       |    4 
 sc/source/ui/vba/vbarange.cxx                                         |   10 
 sc/source/ui/view/printfun.cxx                                        |    2 
 sd/source/ui/dlg/custsdlg.cxx                                         |    2 
 sd/source/ui/dlg/sdtreelb.cxx                                         |   14 
 sd/source/ui/view/drawview.cxx                                        |    2 
 sfx2/source/dialog/dinfdlg.cxx                                        |    2 
 sfx2/source/dialog/templdlg.cxx                                       |    8 
 sfx2/source/dialog/versdlg.cxx                                        |    8 
 sfx2/source/toolbox/imgmgr.cxx                                        |    8 
 svl/source/items/srchitem.cxx                                         |   12 
 svl/source/items/style.cxx                                            |   24 -
 svtools/source/brwbox/brwbox1.cxx                                     |   44 --
 svtools/source/brwbox/datwin.hxx                                      |    2 
 svtools/source/brwbox/editbrowsebox.cxx                               |   30 -
 svtools/source/brwbox/editbrowsebox2.cxx                              |    2 
 svtools/source/contnr/fileview.cxx                                    |   62 +-
 svtools/source/contnr/imivctl.hxx                                     |    2 
 svtools/source/contnr/imivctl1.cxx                                    |   36 -
 svtools/source/contnr/ivctrl.cxx                                      |    4 
 svtools/source/contnr/simptabl.cxx                                    |   10 
 svtools/source/contnr/svimpbox.cxx                                    |   28 -
 svtools/source/contnr/svlbitm.cxx                                     |    2 
 svtools/source/contnr/svtabbx.cxx                                     |   16 
 svtools/source/contnr/treelistbox.cxx                                 |  212 ++++------
 svtools/source/contnr/treelistentry.cxx                               |   12 
 svtools/source/control/ctrlbox.cxx                                    |   26 -
 svtools/source/control/ctrltool.cxx                                   |   30 -
 svtools/source/control/filectrl.cxx                                   |   14 
 svtools/source/control/fmtfield.cxx                                   |   23 -
 svtools/source/control/headbar.cxx                                    |   88 ++--
 svtools/source/control/ruler.cxx                                      |    6 
 svtools/source/control/scrwin.cxx                                     |    6 
 svtools/source/graphic/grfmgr.cxx                                     |   20 
 svtools/source/graphic/grfmgr2.cxx                                    |   62 +-
 svtools/source/table/tablecontrol_impl.cxx                            |   10 
 svtools/source/uno/unogridcolumnfacade.cxx                            |    8 
 svx/source/dialog/ctredlin.cxx                                        |    2 
 svx/source/dialog/fontlb.cxx                                          |    2 
 svx/source/dialog/srchdlg.cxx                                         |   23 -
 svx/source/fmcomp/fmgridcl.cxx                                        |    4 
 svx/source/fmcomp/fmgridif.cxx                                        |    4 
 svx/source/fmcomp/gridctrl.cxx                                        |   64 +--
 svx/source/form/datanavi.cxx                                          |    4 
 svx/source/form/filtnav.cxx                                           |    2 
 svx/source/form/navigatortree.cxx                                     |    6 
 svx/source/gallery2/galctrl.cxx                                       |    2 
 svx/source/sdr/properties/attributeproperties.cxx                     |   10 
 svx/source/sdr/properties/customshapeproperties.cxx                   |    4 
 svx/source/sdr/properties/textproperties.cxx                          |    2 
 svx/source/svdraw/svdibrow.cxx                                        |    6 
 svx/source/svdraw/svdpntv.cxx                                         |    2 
 svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx |   16 
 svx/workben/msview/msview.cxx                                         |    6 
 sw/inc/ndgrf.hxx                                                      |    2 
 sw/source/core/doc/docdesc.cxx                                        |    4 
 sw/source/core/doc/docfmt.cxx                                         |   16 
 sw/source/core/doc/docnum.cxx                                         |    6 
 sw/source/core/doc/notxtfrm.cxx                                       |    2 
 sw/source/core/layout/paintfrm.cxx                                    |    2 
 sw/source/core/unocore/unostyle.cxx                                   |    4 
 sw/source/ui/dbui/mmaddressblockpage.cxx                              |   10 
 sw/source/ui/dbui/mmoutputtypepage.cxx                                |    4 
 sw/source/ui/dbui/selectdbtabledialog.cxx                             |    6 
 sw/source/ui/dialog/uiregionsw.cxx                                    |    2 
 sw/source/ui/index/cnttab.cxx                                         |   20 
 sw/source/ui/misc/glossary.cxx                                        |    8 
 sw/source/uibase/app/docst.cxx                                        |    4 
 sw/source/uibase/app/docstyle.cxx                                     |   14 
 sw/source/uibase/dbui/dbtree.cxx                                      |    2 
 sw/source/uibase/utlui/content.cxx                                    |    4 
 sw/source/uibase/utlui/glbltree.cxx                                   |    8 
 sw/source/uibase/utlui/navipi.cxx                                     |   10 
 146 files changed, 1199 insertions(+), 1089 deletions(-)

New commits:
commit dd7778a76915685d9b334e1f0718f556f6309687
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Apr 21 16:18:23 2015 +0200

    convert SV_ENTRYFLAG constants to scoped enum
    
    Change-Id: I457b32ed5ee5d74e6f8361e7de79cbd406122651

diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 117a4f4..4679621 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -2415,14 +2415,12 @@ void implEnableChildren( SvTreeListEntry* pEntry, bool bEnable )
     if( bEnable )
     {
         pEntry->SetFlags(
-            (pEntry->GetFlags() &
-            ~(SV_ENTRYFLAG_NO_NODEBMP | SV_ENTRYFLAG_HAD_CHILDREN))
-            | SV_ENTRYFLAG_CHILDREN_ON_DEMAND );
+            (pEntry->GetFlags() & ~SvTLEntryFlags(SvTLEntryFlags::NO_NODEBMP | SvTLEntryFlags::HAD_CHILDREN))
+            | SvTLEntryFlags::CHILDREN_ON_DEMAND );
     }
     else
     {
-        pEntry->SetFlags(
-            (pEntry->GetFlags() & ~(SV_ENTRYFLAG_CHILDREN_ON_DEMAND)) );
+        pEntry->SetFlags( pEntry->GetFlags() & ~SvTLEntryFlags::CHILDREN_ON_DEMAND );
     }
 }
 
diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx
index e0cb02c..2d4e0ce 100644
--- a/dbaccess/source/ui/control/dbtreelistbox.cxx
+++ b/dbaccess/source/ui/control/dbtreelistbox.cxx
@@ -178,7 +178,7 @@ void DBTreeListBox::MouseButtonDown( const MouseEvent& rMEvt )
 IMPL_LINK(DBTreeListBox, OnResetEntry, SvTreeListEntry*, pEntry)
 {
     // set the flag which allows if the entry can be expanded
-    pEntry->SetFlags( (pEntry->GetFlags() & ~(SV_ENTRYFLAG_NO_NODEBMP | SV_ENTRYFLAG_HAD_CHILDREN)) | SV_ENTRYFLAG_CHILDREN_ON_DEMAND );
+    pEntry->SetFlags( (pEntry->GetFlags() & ~SvTLEntryFlags(SvTLEntryFlags::NO_NODEBMP | SvTLEntryFlags::HAD_CHILDREN)) | SvTLEntryFlags::CHILDREN_ON_DEMAND );
     // redraw the entry
     GetModel()->InvalidateEntry( pEntry );
     return 0L;
diff --git a/include/svtools/treelistentry.hxx b/include/svtools/treelistentry.hxx
index f7e633f..1147817 100644
--- a/include/svtools/treelistentry.hxx
+++ b/include/svtools/treelistentry.hxx
@@ -24,19 +24,27 @@
 #include <tools/solar.h>
 #include <svtools/treelistbox.hxx>
 #include <svtools/treelistentries.hxx>
+#include <o3tl/typed_flags_set.hxx>
 
 #include <boost/ptr_container/ptr_vector.hpp>
 
 // flags related to the model
-#define SV_ENTRYFLAG_CHILDREN_ON_DEMAND   0x0001
-#define SV_ENTRYFLAG_DISABLE_DROP       0x0002
-#define SV_ENTRYFLAG_IN_USE             0x0004
-// is set if RequestingChildren has not set any children
-#define SV_ENTRYFLAG_NO_NODEBMP         0x0008
-// entry had or has children
-#define SV_ENTRYFLAG_HAD_CHILDREN       0x0010
-
-#define SV_ENTRYFLAG_SEMITRANSPARENT    0x8000      // draw semi-transparent entry bitmaps
+enum class SvTLEntryFlags
+{
+    NONE                = 0x0000,
+    CHILDREN_ON_DEMAND  = 0x0001,
+    DISABLE_DROP        = 0x0002,
+    IN_USE              = 0x0004,
+    // is set if RequestingChildren has not set any children
+    NO_NODEBMP          = 0x0008,
+    // entry had or has children
+    HAD_CHILDREN        = 0x0010,
+    SEMITRANSPARENT     = 0x8000,      // draw semi-transparent entry bitmaps
+};
+namespace o3tl
+{
+    template<> struct typed_flags<SvTLEntryFlags> : is_typed_flags<SvTLEntryFlags, 0x801f> {};
+}
 
 
 class SVT_DLLPUBLIC SvTreeListEntry
@@ -54,7 +62,7 @@ class SVT_DLLPUBLIC SvTreeListEntry
     ItemsType           maItems;
     bool                bIsMarked;
     void*               pUserData;
-    sal_uInt16          nEntryFlags;
+    SvTLEntryFlags      nEntryFlags;
     Color               maBackColor;
 
 private:
@@ -96,8 +104,8 @@ public:
     bool        HasChildrenOnDemand() const;
     bool        HasInUseEmphasis() const;
 
-    sal_uInt16 GetFlags() const { return nEntryFlags;}
-    void SetFlags( sal_uInt16 nFlags );
+    SvTLEntryFlags GetFlags() const { return nEntryFlags;}
+    void SetFlags( SvTLEntryFlags nFlags );
 
     bool GetIsMarked() const { return bIsMarked; }
     void SetMarked( bool IsMarked ) { bIsMarked = IsMarked; }
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 1e43cc0..0a96dd7 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1492,7 +1492,7 @@ bool SdPageObjsTLB::IsDropAllowed (SvTreeListEntry* pEntry)
     if ( ! IsDropFormatSupported(SdPageObjsTransferable::GetListBoxDropFormatId()))
         return false;
 
-    if ((pEntry->GetFlags() & SV_ENTRYFLAG_DISABLE_DROP) != 0)
+    if (pEntry->GetFlags() & SvTLEntryFlags::DISABLE_DROP)
         return false;
 
     return true;
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 1978956..f1aa6fa 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -1673,7 +1673,7 @@ void SvImpLBox::RemovingEntry( SvTreeListEntry* pEntry )
     if (pParent && pView->GetModel()->GetChildList(pParent).size() == 1)
     {
         DBG_ASSERT( pView->IsExpanded( pParent ), "Parent not expanded");
-        pParent->SetFlags( pParent->GetFlags() | SV_ENTRYFLAG_NO_NODEBMP);
+        pParent->SetFlags( pParent->GetFlags() | SvTLEntryFlags::NO_NODEBMP);
         InvalidateEntry( pParent );
     }
 
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 5da446e..9aa97f0 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -515,7 +515,7 @@ void SvLBoxContextBmp::Paint(
     // get the image.
     const Image& rImage = implGetImageStore(pView->IsExpanded() != m_pImpl->m_bExpanded);
 
-    bool _bSemiTransparent = pEntry && ( 0 != ( SV_ENTRYFLAG_SEMITRANSPARENT  & pEntry->GetFlags( ) ) );
+    bool _bSemiTransparent = pEntry && bool( SvTLEntryFlags::SEMITRANSPARENT  & pEntry->GetFlags( ) );
     // draw
     sal_uInt16 nStyle = _rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
     if ( _bSemiTransparent )
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 8a8b879..3f7ab3f 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -971,28 +971,28 @@ void SvTreeListBox::EnableSelectionAsDropTarget( bool bEnable, bool bWithChildre
     {
         if ( !bEnable )
         {
-            pSelEntry->nEntryFlags |= SV_ENTRYFLAG_DISABLE_DROP;
+            pSelEntry->nEntryFlags |= SvTLEntryFlags::DISABLE_DROP;
             if ( bWithChildren )
             {
                 nRefDepth = pModel->GetDepth( pSelEntry );
                 pTemp = Next( pSelEntry );
                 while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth )
                 {
-                    pTemp->nEntryFlags |= SV_ENTRYFLAG_DISABLE_DROP;
+                    pTemp->nEntryFlags |= SvTLEntryFlags::DISABLE_DROP;
                     pTemp = Next( pTemp );
                 }
             }
         }
         else
         {
-            pSelEntry->nEntryFlags &= (~SV_ENTRYFLAG_DISABLE_DROP);
+            pSelEntry->nEntryFlags &= (~SvTLEntryFlags::DISABLE_DROP);
             if ( bWithChildren )
             {
                 nRefDepth = pModel->GetDepth( pSelEntry );
                 pTemp = Next( pSelEntry );
                 while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth )
                 {
-                    pTemp->nEntryFlags &= (~SV_ENTRYFLAG_DISABLE_DROP);
+                    pTemp->nEntryFlags &= (~SvTLEntryFlags::DISABLE_DROP);
                     pTemp = Next( pTemp );
                 }
             }
@@ -1213,7 +1213,7 @@ sal_Int8 SvTreeListBox::AcceptDrop( const AcceptDropEvent& rEvt )
             DBG_ASSERT( pDDSource, "SvTreeListBox::QueryDrop(): SourceBox == 0" );
             if( !( pEntry && pDDSource->GetModel() == this->GetModel()
                     && DND_ACTION_MOVE == rEvt.mnAction
-                    && ( pEntry->nEntryFlags & SV_ENTRYFLAG_DISABLE_DROP ) ))
+                    && ( pEntry->nEntryFlags & SvTLEntryFlags::DISABLE_DROP ) ))
             {
                 if( NotifyAcceptDrop( pEntry ))
                     nRet = rEvt.mnAction;
@@ -1918,8 +1918,8 @@ void SvTreeListBox::ImpEntryInserted( SvTreeListEntry* pEntry )
     SvTreeListEntry* pParent = (SvTreeListEntry*)pModel->GetParent( pEntry );
     if( pParent )
     {
-        sal_uInt16 nFlags = pParent->GetFlags();
-        nFlags &= ~SV_ENTRYFLAG_NO_NODEBMP;
+        SvTLEntryFlags nFlags = pParent->GetFlags();
+        nFlags &= ~SvTLEntryFlags::NO_NODEBMP;
         pParent->SetFlags( nFlags );
     }
 
@@ -2359,7 +2359,7 @@ bool SvTreeListBox::Expand( SvTreeListEntry* pParent )
 {
     pHdlEntry = pParent;
     bool bExpanded = false;
-    sal_uInt16 nFlags;
+    SvTLEntryFlags nFlags;
 
     if( pParent->HasChildrenOnDemand() )
         RequestingChildren( pParent );
@@ -2375,14 +2375,14 @@ bool SvTreeListBox::Expand( SvTreeListEntry* pParent )
             ExpandedHdl();
         }
         nFlags = pParent->GetFlags();
-        nFlags &= ~SV_ENTRYFLAG_NO_NODEBMP;
-        nFlags |= SV_ENTRYFLAG_HAD_CHILDREN;
+        nFlags &= ~SvTLEntryFlags::NO_NODEBMP;
+        nFlags |= SvTLEntryFlags::HAD_CHILDREN;
         pParent->SetFlags( nFlags );
     }
     else
     {
         nFlags = pParent->GetFlags();
-        nFlags |= SV_ENTRYFLAG_NO_NODEBMP;
+        nFlags |= SvTLEntryFlags::NO_NODEBMP;
         pParent->SetFlags( nFlags );
         GetModel()->InvalidateEntry( pParent ); // repaint
     }
@@ -3089,7 +3089,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, SvLBoxTabFl
     nDynTabPos += 4; // 4 pixels of buffer, so the node bitmap is not too close
                      // to the next tab
 
-    if( (!(pEntry->GetFlags() & SV_ENTRYFLAG_NO_NODEBMP)) &&
+    if( (!(pEntry->GetFlags() & SvTLEntryFlags::NO_NODEBMP)) &&
         (nWindowStyle & WB_HASBUTTONS) && pFirstDynamicTab &&
         ( pEntry->HasChildren() || pEntry->HasChildrenOnDemand() ) )
     {
@@ -3116,7 +3116,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, SvLBoxTabFl
                 else
                 {
                     if( (!pEntry->HasChildren()) && pEntry->HasChildrenOnDemand() &&
-                        (!(pEntry->GetFlags() & SV_ENTRYFLAG_HAD_CHILDREN)) &&
+                        (!(pEntry->GetFlags() & SvTLEntryFlags::HAD_CHILDREN)) &&
                         pImp->GetDontKnowNodeBmp().GetSizePixel().Width() )
                         pImg = &pImp->GetDontKnowNodeBmp( );
                     else
@@ -3144,7 +3144,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, SvLBoxTabFl
                     {
                         if( (!pEntry->HasChildren() )                              &&
                               pEntry->HasChildrenOnDemand()                        &&
-                             (!(pEntry->GetFlags() & SV_ENTRYFLAG_HAD_CHILDREN)) &&
+                             (!(pEntry->GetFlags() & SvTLEntryFlags::HAD_CHILDREN)) &&
                             pImp->GetDontKnowNodeBmp().GetSizePixel().Width()
                         )
                             aControlValue.setTristateVal( BUTTONVALUE_DONTKNOW ); //dont know
diff --git a/svtools/source/contnr/treelistentry.cxx b/svtools/source/contnr/treelistentry.cxx
index c56d4d9..3b33cf7 100644
--- a/svtools/source/contnr/treelistentry.cxx
+++ b/svtools/source/contnr/treelistentry.cxx
@@ -56,7 +56,7 @@ SvTreeListEntry::SvTreeListEntry()
     , nListPos(0)
     , bIsMarked(false)
     , pUserData(NULL)
-    , nEntryFlags(0)
+    , nEntryFlags(SvTLEntryFlags::NONE)
     , maBackColor(Application::GetSettings().GetStyleSettings().GetWindowColor())
 {
 }
@@ -139,9 +139,9 @@ void SvTreeListEntry::AddItem( SvLBoxItem* pItem )
 void SvTreeListEntry::EnableChildrenOnDemand( bool bEnable )
 {
     if ( bEnable )
-        nEntryFlags |= SV_ENTRYFLAG_CHILDREN_ON_DEMAND;
+        nEntryFlags |= SvTLEntryFlags::CHILDREN_ON_DEMAND;
     else
-        nEntryFlags &= (~SV_ENTRYFLAG_CHILDREN_ON_DEMAND);
+        nEntryFlags &= (~SvTLEntryFlags::CHILDREN_ON_DEMAND);
 }
 
 void SvTreeListEntry::ReplaceItem( SvLBoxItem* pNewItem, size_t nPos )
@@ -220,16 +220,16 @@ void SvTreeListEntry::SetUserData( void* pPtr )
 
 bool SvTreeListEntry::HasChildrenOnDemand() const
 {
-    return (bool)((nEntryFlags & SV_ENTRYFLAG_CHILDREN_ON_DEMAND)!=0);
+    return (bool)(nEntryFlags & SvTLEntryFlags::CHILDREN_ON_DEMAND);
 }
 
 bool SvTreeListEntry::HasInUseEmphasis() const
 {
-    return (bool)((nEntryFlags & SV_ENTRYFLAG_IN_USE)!=0);
+    return (bool)(nEntryFlags & SvTLEntryFlags::IN_USE);
 }
 
 
-void SvTreeListEntry::SetFlags( sal_uInt16 nFlags )
+void SvTreeListEntry::SetFlags( SvTLEntryFlags nFlags )
 {
     nEntryFlags = nFlags;
 }
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index e2b9247..4b4a797 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -1260,7 +1260,7 @@ namespace svxform
                 if ( pEntry )
                 {
                     m_aCutEntries.insert( pEntry );
-                    pEntry->SetFlags( pEntry->GetFlags() | SV_ENTRYFLAG_SEMITRANSPARENT );
+                    pEntry->SetFlags( pEntry->GetFlags() | SvTLEntryFlags::SEMITRANSPARENT );
                     InvalidateEntry( pEntry );
                 }
             }
@@ -1564,7 +1564,7 @@ namespace svxform
                     if ( !pEntry )
                         continue;
 
-                    pEntry->SetFlags( pEntry->GetFlags() & ~SV_ENTRYFLAG_SEMITRANSPARENT );
+                    pEntry->SetFlags( pEntry->GetFlags() & ~SvTLEntryFlags::SEMITRANSPARENT );
                     InvalidateEntry( pEntry );
                 }
                 ListBoxEntrySet aEmpty;
commit 2884e9be256207d0876e6d67300a85462801778b
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Apr 21 15:53:44 2015 +0200

    convert SVLBOX_ constants to scoped enum
    
    Change-Id: Ibe384ffae00e045ccfa7d3f7f080f8eb6b3149a9

diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index cd0ab60..3f74b4c 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -216,12 +216,20 @@ namespace o3tl
 }
 
 
-#define SVLBOX_IN_EDT           0x0001
-#define SVLBOX_EDT_ENABLED      0x0002
-#define SVLBOX_IS_EXPANDING     0x0004
-#define SVLBOX_IS_TRAVELSELECT  0x0008
-#define SVLBOX_TARGEMPH_VIS     0x0010
-#define SVLBOX_EDTEND_CALLED    0x0020
+enum class SvTreeListBoxFlags
+{
+    NONE             = 0x0000,
+    IN_EDT           = 0x0001,
+    EDT_ENABLED      = 0x0002,
+    IS_EXPANDING     = 0x0004,
+    IS_TRAVELSELECT  = 0x0008,
+    TARGEMPH_VIS     = 0x0010,
+    EDTEND_CALLED    = 0x0020,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<SvTreeListBoxFlags> : is_typed_flags<SvTreeListBoxFlags, 0x003f> {};
+}
 
 struct SvTreeListBoxImpl;
 
@@ -273,17 +281,17 @@ class SVT_DLLPUBLIC SvTreeListBox
     sal_Int32       nMinWidthInChars;
 
     SvTreeListEntry*        pEdEntry;
-    SvLBoxItem*         pEdItem;
+    SvLBoxItem*             pEdItem;
 
 protected:
-    Link            aDoubleClickHdl;
-    SvTreeListEntry*    pTargetEntry;
-    SvLBoxButtonData*   pCheckButtonData;
+    Link                    aDoubleClickHdl;
+    SvTreeListEntry*        pTargetEntry;
+    SvLBoxButtonData*       pCheckButtonData;
     std::vector<SvLBoxTab*> aTabs;
-    SvTreeFlags     nTreeFlags;
-    sal_uInt16      nImpFlags;
+    SvTreeFlags             nTreeFlags;
+    SvTreeListBoxFlags      nImpFlags;
     // Move/CopySelection: Position of the current Entry in SelectionList
-    sal_uInt16      nCurEntrySelPos;
+    sal_uInt16              nCurEntrySelPos;
 
 private:
     void SetBaseModel(SvTreeList* pNewModel);
@@ -428,8 +436,8 @@ public:
     SvViewDataItem*  GetViewDataItem(SvTreeListEntry*, SvLBoxItem*);
     const SvViewDataItem*  GetViewDataItem(const SvTreeListEntry*, const SvLBoxItem*) const;
 
-    bool IsInplaceEditingEnabled() const { return ((nImpFlags & SVLBOX_EDT_ENABLED) != 0); }
-    bool IsEditingActive() const { return ((nImpFlags & SVLBOX_IN_EDT) != 0); }
+    bool IsInplaceEditingEnabled() const { return bool(nImpFlags & SvTreeListBoxFlags::EDT_ENABLED); }
+    bool IsEditingActive() const { return bool(nImpFlags & SvTreeListBoxFlags::IN_EDT); }
     void EndEditing( bool bCancel = false );
     void ForbidEmptyText();
 
@@ -484,7 +492,7 @@ public:
     virtual void    SelectHdl();
     virtual void    DeselectHdl();
     virtual bool    DoubleClickHdl();
-    bool            IsTravelSelect() const { return ((nImpFlags&SVLBOX_IS_TRAVELSELECT)!=0);}
+    bool            IsTravelSelect() const { return bool(nImpFlags&SvTreeListBoxFlags::IS_TRAVELSELECT);}
     SvTreeListEntry*    GetHdlEntry() const { return pHdlEntry; }
     SvLBoxItem*     GetHdlItem() const;
 
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 6ea85b4..1e43cc0 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1301,7 +1301,7 @@ sal_Int8 SdPageObjsTLB::AcceptDrop (const AcceptDropEvent& rEvent)
             nResult = DND_ACTION_MOVE;
 
             // Draw emphasis.
-            if (pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS))
+            if (pEntry != pTargetEntry || !(nImpFlags & SvTreeListBoxFlags::TARGEMPH_VIS))
             {
                 ImplShowTargetEmphasis( pTargetEntry, false );
                 pTargetEntry = pEntry;
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index e9cc937..8a8b879 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -385,7 +385,7 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, WinBits nWinStyle) :
     nMinWidthInChars(0)
 {
     nDragOptions =  DND_ACTION_COPYMOVE | DND_ACTION_LINK;
-    nImpFlags = 0;
+    nImpFlags = SvTreeListBoxFlags::NONE;
     pTargetEntry = 0;
     nDragDropMode = DragDropMode::NONE;
     SvTreeList* pTempModel = new SvTreeList;
@@ -415,7 +415,7 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, const ResId& rResId) :
     nMinWidthInChars(0)
 {
     pTargetEntry = 0;
-    nImpFlags = 0;
+    nImpFlags = SvTreeListBoxFlags::NONE;
     nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
     nDragDropMode = DragDropMode::NONE;
     SvTreeList* pTempModel = new SvTreeList;
@@ -810,15 +810,15 @@ void SvTreeListBox::RecalcViewData()
 
 void SvTreeListBox::ImplShowTargetEmphasis( SvTreeListEntry* pEntry, bool bShow)
 {
-    if ( bShow && (nImpFlags & SVLBOX_TARGEMPH_VIS) )
+    if ( bShow && (nImpFlags & SvTreeListBoxFlags::TARGEMPH_VIS) )
         return;
-    if ( !bShow && !(nImpFlags & SVLBOX_TARGEMPH_VIS) )
+    if ( !bShow && !(nImpFlags & SvTreeListBoxFlags::TARGEMPH_VIS) )
         return;
     ShowTargetEmphasis( pEntry, bShow );
     if( bShow )
-        nImpFlags |= SVLBOX_TARGEMPH_VIS;
+        nImpFlags |= SvTreeListBoxFlags::TARGEMPH_VIS;
     else
-        nImpFlags &= ~SVLBOX_TARGEMPH_VIS;
+        nImpFlags &= ~SvTreeListBoxFlags::TARGEMPH_VIS;
 }
 
 void SvTreeListBox::OnCurrentEntryChanged()
@@ -1016,8 +1016,8 @@ void SvTreeListBox::EditText( const OUString& rStr, const Rectangle& rRect,
 {
     if( pEdCtrl )
         delete pEdCtrl;
-    nImpFlags |= SVLBOX_IN_EDT;
-    nImpFlags &= ~SVLBOX_EDTEND_CALLED;
+    nImpFlags |= SvTreeListBoxFlags::IN_EDT;
+    nImpFlags &= ~SvTreeListBoxFlags::EDTEND_CALLED;
     HideFocus();
     pEdCtrl = new SvInplaceEdit2(
         this, rRect.TopLeft(), rRect.GetSize(), rStr,
@@ -1027,9 +1027,9 @@ void SvTreeListBox::EditText( const OUString& rStr, const Rectangle& rRect,
 
 IMPL_LINK_NOARG(SvTreeListBox, TextEditEndedHdl_Impl)
 {
-    if ( nImpFlags & SVLBOX_EDTEND_CALLED ) // avoid nesting
+    if ( nImpFlags & SvTreeListBoxFlags::EDTEND_CALLED ) // avoid nesting
         return 0;
-    nImpFlags |= SVLBOX_EDTEND_CALLED;
+    nImpFlags |= SvTreeListBoxFlags::EDTEND_CALLED;
     OUString aStr;
     if ( !pEdCtrl->EditingCanceled() )
         aStr = pEdCtrl->GetText();
@@ -1043,7 +1043,7 @@ IMPL_LINK_NOARG(SvTreeListBox, TextEditEndedHdl_Impl)
     pEdCtrl->Hide();
     // delete pEdCtrl;
     // pEdCtrl = 0;
-    nImpFlags &= (~SVLBOX_IN_EDT);
+    nImpFlags &= (~SvTreeListBoxFlags::IN_EDT);
     GrabFocus();
     return 0;
 }
@@ -1052,14 +1052,14 @@ void SvTreeListBox::CancelTextEditing()
 {
     if ( pEdCtrl )
         pEdCtrl->StopEditing( true );
-    nImpFlags &= (~SVLBOX_IN_EDT);
+    nImpFlags &= (~SvTreeListBoxFlags::IN_EDT);
 }
 
 void SvTreeListBox::EndEditing( bool bCancel )
 {
     if( pEdCtrl )
         pEdCtrl->StopEditing( bCancel );
-    nImpFlags &= (~SVLBOX_IN_EDT);
+    nImpFlags &= (~SvTreeListBoxFlags::IN_EDT);
 }
 
 
@@ -1223,7 +1223,7 @@ sal_Int8 SvTreeListBox::AcceptDrop( const AcceptDropEvent& rEvt )
         // **** draw emphasis ****
         if( DND_ACTION_NONE == nRet )
                ImplShowTargetEmphasis( pTargetEntry, false );
-        else if( pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS) )
+        else if( pEntry != pTargetEntry || !(nImpFlags & SvTreeListBoxFlags::TARGEMPH_VIS) )
         {
             ImplShowTargetEmphasis( pTargetEntry, false );
             pTargetEntry = pEntry;
@@ -2141,9 +2141,9 @@ bool SvTreeListBox::EditedEntry( SvTreeListEntry* /*pEntry*/,const OUString& /*r
 void SvTreeListBox::EnableInplaceEditing( bool bOn )
 {
     if (bOn)
-        nImpFlags |= SVLBOX_EDT_ENABLED;
+        nImpFlags |= SvTreeListBoxFlags::EDT_ENABLED;
     else
-        nImpFlags &= ~SVLBOX_EDT_ENABLED;
+        nImpFlags &= ~SvTreeListBoxFlags::EDT_ENABLED;
 }
 
 void SvTreeListBox::KeyInput( const KeyEvent& rKEvt )
@@ -2152,7 +2152,7 @@ void SvTreeListBox::KeyInput( const KeyEvent& rKEvt )
     if( IsEditingActive() )
         return;
 
-    nImpFlags |= SVLBOX_IS_TRAVELSELECT;
+    nImpFlags |= SvTreeListBoxFlags::IS_TRAVELSELECT;
 
     if( !pImp->KeyInput( rKEvt ) )
     {
@@ -2161,7 +2161,7 @@ void SvTreeListBox::KeyInput( const KeyEvent& rKEvt )
             Control::KeyInput( rKEvt );
     }
 
-    nImpFlags &= ~SVLBOX_IS_TRAVELSELECT;
+    nImpFlags &= ~SvTreeListBoxFlags::IS_TRAVELSELECT;
 }
 
 void SvTreeListBox::RequestingChildren( SvTreeListEntry* pParent )
@@ -2365,7 +2365,7 @@ bool SvTreeListBox::Expand( SvTreeListEntry* pParent )
         RequestingChildren( pParent );
     if( pParent->HasChildren() )
     {
-        nImpFlags |= SVLBOX_IS_EXPANDING;
+        nImpFlags |= SvTreeListBoxFlags::IS_EXPANDING;
         if( ExpandingHdl() )
         {
             bExpanded = true;
@@ -2398,7 +2398,7 @@ bool SvTreeListBox::Expand( SvTreeListEntry* pParent )
 
 bool SvTreeListBox::Collapse( SvTreeListEntry* pParent )
 {
-    nImpFlags &= ~SVLBOX_IS_EXPANDING;
+    nImpFlags &= ~SvTreeListBoxFlags::IS_EXPANDING;
     pHdlEntry = pParent;
     bool bCollapsed = false;
 
commit 1b5f6935a498c1d9eea35ba0aa2edd25ee11ca47
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Apr 21 15:33:43 2015 +0200

    convert SV_DRAGDOP_ constants to scoped enum
    
    Change-Id: If953610ed24a2b6d5f33f2ba014fba2ca5308d7d

diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index dd39719..5929511 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -141,14 +141,14 @@ bool ExtTreeListBox::EditedEntry( SvTreeListEntry* pEntry, const OUString& rNewT
 
 DragDropMode ExtTreeListBox::NotifyStartDrag( TransferDataContainer&, SvTreeListEntry* pEntry )
 {
-    DragDropMode nMode_ = SV_DRAGDROP_NONE;
+    DragDropMode nMode_ = DragDropMode::NONE;
 
     if ( pEntry )
     {
         sal_uInt16 nDepth = GetModel()->GetDepth( pEntry );
         if ( nDepth >= 2 )
         {
-            nMode_ = SV_DRAGDROP_CTRL_COPY;
+            nMode_ = DragDropMode::CTRL_COPY;
             EntryDescriptor aDesc = GetEntryDescriptor(pEntry);
             ScriptDocument aDocument( aDesc.GetDocument() );
             OUString aLibName( aDesc.GetLibName() );
@@ -170,7 +170,7 @@ DragDropMode ExtTreeListBox::NotifyStartDrag( TransferDataContainer&, SvTreeList
                         bAllowMove = ( xSourceMgr->getLocales().getLength() == 0 );
                 }
                 if( bAllowMove )
-                    nMode_ |= SV_DRAGDROP_CTRL_MOVE;
+                    nMode_ |= DragDropMode::CTRL_MOVE;
             }
         }
     }
@@ -577,7 +577,7 @@ ObjectPage::ObjectPage(vcl::Window *pParent, const OString &rName, sal_uInt16 nM
         m_pNewModButton->Hide();
     }
 
-    m_pBasicBox->SetDragDropMode( SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY );
+    m_pBasicBox->SetDragDropMode( DragDropMode::CTRL_MOVE | DragDropMode::CTRL_COPY );
     m_pBasicBox->EnableInplaceEditing(true);
     m_pBasicBox->SetMode( nMode );
     m_pBasicBox->SetStyle( WB_BORDER | WB_TABSTOP |
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index f26e00c..05aa134 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -776,7 +776,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( vcl::Window* pParent, const
     m_pEntriesBox->SetTabs(&AccCfgTabs[0], MAP_APPFONT);
     m_pEntriesBox->Resize(); // OS: Hack for right selection
     m_pEntriesBox->SetSpaceBetweenEntries(0);
-    m_pEntriesBox->SetDragDropMode(0);
+    m_pEntriesBox->SetDragDropMode(DragDropMode::NONE);
 
     // detect max keyname width
     long nMaxWidth  = 0;
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 5d6b74a..aa1cd01 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1389,10 +1389,10 @@ SvxMenuEntriesListBox::SvxMenuEntriesListBox(vcl::Window* pParent, SvxConfigPage
     SetHighlightRange();
     SetSelectionMode(SINGLE_SELECTION);
 
-    SetDragDropMode( SV_DRAGDROP_CTRL_MOVE  |
-                     SV_DRAGDROP_APP_COPY   |
-                     SV_DRAGDROP_ENABLE_TOP |
-                     SV_DRAGDROP_APP_DROP);
+    SetDragDropMode( DragDropMode::CTRL_MOVE  |
+                     DragDropMode::APP_COPY   |
+                     DragDropMode::ENABLE_TOP |
+                     DragDropMode::APP_DROP);
 }
 
 SvxMenuEntriesListBox::~SvxMenuEntriesListBox()
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index 761cd4f..5a5723d 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -873,7 +873,7 @@ SvxScriptSelectorDialog::SvxScriptSelectorDialog(
         // If we are showing Slot API commands update labels in the UI, and
         // enable drag'n'drop
         SetText(CUI_RESSTR(RID_SVXSTR_SELECTOR_ADD_COMMANDS));
-        m_pCommands->SetDragDropMode( SV_DRAGDROP_APP_COPY );
+        m_pCommands->SetDragDropMode( DragDropMode::APP_COPY );
 
         get(m_pCancelButton, "close");
         get(m_pDialogDescription, "helptoolbar");
diff --git a/dbaccess/source/ui/browser/dbtreeview.cxx b/dbaccess/source/ui/browser/dbtreeview.cxx
index 2d140c3..9dba9af 100644
--- a/dbaccess/source/ui/browser/dbtreeview.cxx
+++ b/dbaccess/source/ui/browser/dbtreeview.cxx
@@ -38,7 +38,7 @@ DBTreeView::DBTreeView( vcl::Window* pParent, WinBits nBits)
 
     m_pTreeListBox = new DBTreeListBox(this, WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT);
     m_pTreeListBox->EnableCheckButton(NULL);
-    m_pTreeListBox->SetDragDropMode( 0 );
+    m_pTreeListBox->SetDragDropMode( DragDropMode::NONE );
     m_pTreeListBox->EnableInplaceEditing( true );
     m_pTreeListBox->SetHelpId(HID_TLB_TREELISTBOX);
     m_pTreeListBox->Show();
diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx
index 9d7cacc..70ba973 100644
--- a/dbaccess/source/ui/dlg/sqlmessage.cxx
+++ b/dbaccess/source/ui/dlg/sqlmessage.cxx
@@ -324,7 +324,7 @@ OExceptionChainDialog::OExceptionChainDialog(vcl::Window* pParent, const Excepti
     m_sErrorCodeLabel = ModuleRes( STR_EXCEPTION_ERRORCODE );
 
     m_pExceptionList->SetSelectionMode(SINGLE_SELECTION);
-    m_pExceptionList->SetDragDropMode(0);
+    m_pExceptionList->SetDragDropMode(DragDropMode::NONE);
     m_pExceptionList->EnableInplaceEditing(false);
     m_pExceptionList->SetStyle(m_pExceptionList->GetStyle() | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL);
 
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index ee89c63..3a1ef5d 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -87,7 +87,7 @@ namespace dbaui
 
         // initialize the TabListBox
         m_pTablesList->SetSelectionMode( MULTIPLE_SELECTION );
-        m_pTablesList->SetDragDropMode( 0 );
+        m_pTablesList->SetDragDropMode( DragDropMode::NONE );
         m_pTablesList->EnableInplaceEditing( false );
         m_pTablesList->SetStyle(m_pTablesList->GetStyle() | WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT);
 
diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx
index 52af008..aa35ed9 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -350,7 +350,7 @@ OColumnTreeBox::OColumnTreeBox( vcl::Window* pParent, WinBits nBits )
     : OMarkableTreeListBox(pParent, nBits)
     , m_bReadOnly(false)
 {
-    SetDragDropMode( 0 );
+    SetDragDropMode( DragDropMode::NONE );
     EnableInplaceEditing( false );
     SetStyle(GetStyle() | WB_BORDER | WB_HASBUTTONS | WB_HSCROLL | nBits);
     SetSelectionMode( SINGLE_SELECTION );
diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx
index 79f37b5..27ed6d5 100644
--- a/extensions/source/propctrlr/selectlabeldialog.cxx
+++ b/extensions/source/propctrlr/selectlabeldialog.cxx
@@ -61,7 +61,7 @@ namespace pcr
 
         // initialize the TreeListBox
         m_pControlTree->SetSelectionMode( SINGLE_SELECTION );
-        m_pControlTree->SetDragDropMode( 0 );
+        m_pControlTree->SetDragDropMode( DragDropMode::NONE );
         m_pControlTree->EnableInplaceEditing( false );
         m_pControlTree->SetStyle(m_pControlTree->GetStyle() | WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL);
 
diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx
index 2036f08..80a10be 100644
--- a/extensions/source/propctrlr/taborder.cxx
+++ b/extensions/source/propctrlr/taborder.cxx
@@ -292,7 +292,7 @@ namespace pcr
     TabOrderListBox::TabOrderListBox( vcl::Window* pParent, WinBits nBits  )
         :SvTreeListBox( pParent, nBits  )
     {
-        SetDragDropMode(0xFFFF/*SV_DRAGDROP_CTRL_MOVE*/);
+        SetDragDropMode(DragDropMode::ALL/*DragDropMode::CTRL_MOVE*/);
             // Hmm. The flag alone is not enough, so to be on the safe side ...
 
         SetSelectionMode( MULTIPLE_SELECTION );
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index f06c3c6..cd0ab60 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -197,16 +197,23 @@ inline void delete_clone(const SvLBoxItem* p)
 
 #define WB_FORCE_SELECTION          ((WinBits)0x8000)
 
-#define DragDropMode sal_uInt16
-#define SV_DRAGDROP_NONE            (DragDropMode)0x0000
-#define SV_DRAGDROP_CTRL_MOVE       (DragDropMode)0x0001
-#define SV_DRAGDROP_CTRL_COPY       (DragDropMode)0x0002
-#define SV_DRAGDROP_APP_MOVE        (DragDropMode)0x0004
-#define SV_DRAGDROP_APP_COPY        (DragDropMode)0x0008
-#define SV_DRAGDROP_APP_DROP        (DragDropMode)0x0010
-// Entries may be dropped via the uppermost Entry
-// The DropTarget is 0 in that case
-#define SV_DRAGDROP_ENABLE_TOP      (DragDropMode)0x0020
+enum class DragDropMode
+{
+    NONE            = 0x0000,
+    CTRL_MOVE       = 0x0001,
+    CTRL_COPY       = 0x0002,
+    APP_MOVE        = 0x0004,
+    APP_COPY        = 0x0008,
+    APP_DROP        = 0x0010,
+    // Entries may be dropped via the uppermost Entry
+    // The DropTarget is 0 in that case
+    ENABLE_TOP      = 0x0020,
+    ALL             = 0x003f,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<DragDropMode> : is_typed_flags<DragDropMode, 0x003f> {};
+}
 
 
 #define SVLBOX_IN_EDT           0x0001
diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx
index d1e6460..d9c6e05 100644
--- a/reportdesign/source/ui/dlg/AddField.cxx
+++ b/reportdesign/source/ui/dlg/AddField.cxx
@@ -106,7 +106,7 @@ OAddFieldWindowListBox::OAddFieldWindowListBox( OAddFieldWindow* _pParent )
 {
     SetHelpId( HID_RPT_FIELD_SEL );
     SetSelectionMode(MULTIPLE_SELECTION);
-    SetDragDropMode( 0xFFFF );
+    SetDragDropMode( DragDropMode::ALL );
     SetHighlightRange( );
 }
 
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx
index d36b761..a85071e 100644
--- a/reportdesign/source/ui/dlg/Navigator.cxx
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -243,7 +243,7 @@ NavigatorTree::NavigatorTree( vcl::Window* pParent,OReportController& _rControll
         m_aNavigatorImages.GetImage( RID_SVXIMG_EXPANDEDNODE )
     );
 
-    SetDragDropMode(0xFFFF);
+    SetDragDropMode(DragDropMode::ALL);
     EnableInplaceEditing( false );
     SetSelectionMode(MULTIPLE_SELECTION);
     Clear();
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
index 0a54325..e042362 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
@@ -24,7 +24,7 @@ ScPivotLayoutTreeListBase::ScPivotLayoutTreeListBase(vcl::Window* pParent, WinBi
     , mpParent(NULL)
 {
     SetHighlightRange();
-    SetDragDropMode(SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_APP_MOVE  | SV_DRAGDROP_APP_DROP);
+    SetDragDropMode(DragDropMode::CTRL_MOVE | DragDropMode::APP_MOVE  | DragDropMode::APP_DROP);
 }
 
 ScPivotLayoutTreeListBase::~ScPivotLayoutTreeListBase()
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 12643fc..f76265d 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -59,7 +59,7 @@ ScTpSubTotalGroup::ScTpSubTotalGroup( vcl::Window* pParent,
 
     // Font is correctly initialized by SvTreeListBox ctor
     mpLbColumns->SetSelectionMode( SINGLE_SELECTION );
-    mpLbColumns->SetDragDropMode( SV_DRAGDROP_NONE );
+    mpLbColumns->SetDragDropMode( DragDropMode::NONE );
     mpLbColumns->SetSpaceBetweenEntries( 0 );
 
     Init ();
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 1a61783..d3c47cc 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -635,9 +635,9 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl
 
     aLbEntries.SetSpaceBetweenEntries(0);
     aLbEntries.SetSelectionMode( SINGLE_SELECTION );
-    aLbEntries.SetDragDropMode(     SV_DRAGDROP_CTRL_MOVE |
-                                    SV_DRAGDROP_CTRL_COPY |
-                                    SV_DRAGDROP_ENABLE_TOP );
+    aLbEntries.SetDragDropMode(     DragDropMode::CTRL_MOVE |
+                                    DragDropMode::CTRL_COPY |
+                                    DragDropMode::ENABLE_TOP );
 
     //  was a category chosen as root?
     sal_uInt16 nLastRoot = rCfg.GetRootType();
diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx
index d1c023e..45355fe 100644
--- a/sd/source/ui/dlg/custsdlg.cxx
+++ b/sd/source/ui/dlg/custsdlg.cxx
@@ -327,7 +327,7 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg( vcl::Window* pWindow,
         rpCustomShow->SetName( m_pEdtName->GetText() );
     }
 
-    m_pLbCustomPages->SetDragDropMode( SV_DRAGDROP_CTRL_MOVE );
+    m_pLbCustomPages->SetDragDropMode( DragDropMode::CTRL_MOVE );
     m_pLbCustomPages->SetHighlightRange();
 
     m_pBtnOK->Enable( false );
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 2599f3b..6ea85b4 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -218,8 +218,8 @@ SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, const SdResId& rSdResId )
                     Image(Bitmap( SdResId(BMP_COLLAPSE) )));
 
     SetDragDropMode(
-         SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY |
-            SV_DRAGDROP_APP_MOVE  | SV_DRAGDROP_APP_COPY  | SV_DRAGDROP_APP_DROP );
+         DragDropMode::CTRL_MOVE | DragDropMode::CTRL_COPY |
+            DragDropMode::APP_MOVE  | DragDropMode::APP_COPY  | DragDropMode::APP_DROP );
 }
 
 SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, WinBits nStyle )
@@ -249,8 +249,8 @@ SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, WinBits nStyle )
                     Image(Bitmap( SdResId(BMP_COLLAPSE) )));
 
     SetDragDropMode(
-         SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY |
-            SV_DRAGDROP_APP_MOVE  | SV_DRAGDROP_APP_COPY  | SV_DRAGDROP_APP_DROP );
+         DragDropMode::CTRL_MOVE | DragDropMode::CTRL_COPY |
+            DragDropMode::APP_MOVE  | DragDropMode::APP_COPY  | DragDropMode::APP_DROP );
 }
 
 SdPageObjsTLB::~SdPageObjsTLB()
@@ -1292,7 +1292,7 @@ sal_Int8 SdPageObjsTLB::AcceptDrop (const AcceptDropEvent& rEvent)
         {
             ImplShowTargetEmphasis( pTargetEntry, false );
         }
-        else if( !GetDragDropMode() )
+        else if( GetDragDropMode() == DragDropMode::NONE )
         {
             SAL_WARN( "sc.ui", "SdPageObjsTLB::AcceptDrop(): no target" );
         }
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 819af47..c0c98b8 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -1033,9 +1033,9 @@ void SfxCommonTemplateDialog_Impl::EnableTreeDrag( bool bEnable )
         if ( pTreeBox )
         {
             if ( pStyle && pStyle->HasParentSupport() && bEnable )
-                pTreeBox->SetDragDropMode(SV_DRAGDROP_CTRL_MOVE);
+                pTreeBox->SetDragDropMode(DragDropMode::CTRL_MOVE);
             else
-                pTreeBox->SetDragDropMode(SV_DRAGDROP_NONE);
+                pTreeBox->SetDragDropMode(DragDropMode::NONE);
         }
     }
     bTreeDrag = bEnable;
@@ -1054,9 +1054,9 @@ void SfxCommonTemplateDialog_Impl::FillTreeBox()
         SfxStyleSheetBase* pStyle = pStyleSheetPool->First();
 
         if(pStyle && pStyle->HasParentSupport() && bTreeDrag )
-            pTreeBox->SetDragDropMode(SV_DRAGDROP_CTRL_MOVE);
+            pTreeBox->SetDragDropMode(DragDropMode::CTRL_MOVE);
         else
-            pTreeBox->SetDragDropMode(SV_DRAGDROP_NONE);
+            pTreeBox->SetDragDropMode(DragDropMode::NONE);
 
         while (pStyle)
         {
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index c1789f3..1978956 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -65,7 +65,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* pLBTree, WinBits nWinS
     aSelEng.ExpandSelectionOnMouseMove( false );
     SetStyle( nWinStyle );
     SetSelectionMode( SINGLE_SELECTION );
-    SetDragDropMode( 0 );
+    SetDragDropMode( DragDropMode::NONE );
 
     aVerSBar.SetScrollHdl( LINK( this, SvImpLBox, ScrollUpDownHdl ) );
     aHorSBar.SetScrollHdl( LINK( this, SvImpLBox, ScrollLeftRightHdl ) );
@@ -2903,7 +2903,7 @@ void SvImpLBox::SetSelectionMode( SelectionMode eSelMode  )
 
 void SvImpLBox::SetDragDropMode( DragDropMode eDDMode )
 {
-    if( eDDMode && eDDMode != SV_DRAGDROP_APP_DROP )
+    if( eDDMode != DragDropMode::NONE && eDDMode != DragDropMode::APP_DROP )
     {
         aSelEng.ExpandSelectionOnMouseMove( false );
         aSelEng.EnableDrag( true );
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index e08f751..e9cc937 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -387,7 +387,7 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, WinBits nWinStyle) :
     nDragOptions =  DND_ACTION_COPYMOVE | DND_ACTION_LINK;
     nImpFlags = 0;
     pTargetEntry = 0;
-    nDragDropMode = 0;
+    nDragDropMode = DragDropMode::NONE;
     SvTreeList* pTempModel = new SvTreeList;
     pTempModel->SetRefCount( 0 );
     SetBaseModel(pTempModel);
@@ -396,7 +396,7 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, WinBits nWinStyle) :
     pHdlEntry = 0;
     pEdCtrl = 0;
     eSelMode = SINGLE_SELECTION;
-    nDragDropMode = SV_DRAGDROP_NONE;
+    nDragDropMode = DragDropMode::NONE;
     SetType(WINDOW_TREELISTBOX);
 
     InitTreeView();
@@ -417,7 +417,7 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, const ResId& rResId) :
     pTargetEntry = 0;
     nImpFlags = 0;
     nDragOptions = DND_ACTION_COPYMOVE | DND_ACTION_LINK;
-    nDragDropMode = 0;
+    nDragDropMode = DragDropMode::NONE;
     SvTreeList* pTempModel = new SvTreeList;
     pTempModel->SetRefCount( 0 );
     SetBaseModel(pTempModel);
@@ -532,31 +532,31 @@ bool SvTreeListBox::CheckDragAndDropMode( SvTreeListBox* pSource, sal_Int8 nActi
 {
     if ( pSource == this )
     {
-        if ( !(nDragDropMode & (SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY) ) )
+        if ( !(nDragDropMode & (DragDropMode::CTRL_MOVE | DragDropMode::CTRL_COPY) ) )
             return false; // D&D locked within list
         if( DND_ACTION_MOVE == nAction )
         {
-            if ( !(nDragDropMode & SV_DRAGDROP_CTRL_MOVE) )
+            if ( !(nDragDropMode & DragDropMode::CTRL_MOVE) )
                  return false; // no local move
         }
         else
         {
-            if ( !(nDragDropMode & SV_DRAGDROP_CTRL_COPY))
+            if ( !(nDragDropMode & DragDropMode::CTRL_COPY))
                 return false; // no local copy
         }
     }
     else
     {
-        if ( !(nDragDropMode & SV_DRAGDROP_APP_DROP ) )
+        if ( !(nDragDropMode & DragDropMode::APP_DROP ) )
             return false; // no drop
         if ( DND_ACTION_MOVE == nAction )
         {
-            if ( !(nDragDropMode & SV_DRAGDROP_APP_MOVE) )
+            if ( !(nDragDropMode & DragDropMode::APP_MOVE) )
                 return false; // no global move
         }
         else
         {
-            if ( !(nDragDropMode & SV_DRAGDROP_APP_COPY))
+            if ( !(nDragDropMode & DragDropMode::APP_COPY))
                 return false; // no global copy
         }
     }
@@ -1197,7 +1197,7 @@ sal_Int8 SvTreeListBox::AcceptDrop( const AcceptDropEvent& rEvt )
     {
         ImplShowTargetEmphasis( pTargetEntry, false );
     }
-    else if( !nDragDropMode )
+    else if( nDragDropMode == DragDropMode::NONE )
     {
         SAL_WARN( "svtools.contnr", "SvTreeListBox::QueryDrop(): no target" );
     }
@@ -1296,7 +1296,7 @@ void SvTreeListBox::StartDrag( sal_Int8, const Point& rPosPixel )
     MouseButtonUp( aMouseEvt );
 
     nOldDragMode = GetDragDropMode();
-    if ( !nOldDragMode )
+    if ( nOldDragMode == DragDropMode::NONE )
         return;
 
     ReleaseMouse();
@@ -1313,7 +1313,7 @@ void SvTreeListBox::StartDrag( sal_Int8, const Point& rPosPixel )
         ::com::sun::star::datatransfer::XTransferable > xRef( pContainer );
 
     nDragDropMode = NotifyStartDrag( *pContainer, pEntry );
-    if( !nDragDropMode || 0 == GetSelectionCount() )
+    if( nDragDropMode == DragDropMode::NONE || 0 == GetSelectionCount() )
     {
         nDragDropMode = nOldDragMode;
         DragFinished( DND_ACTION_NONE );
@@ -2797,7 +2797,7 @@ SvTreeListEntry* SvTreeListBox::GetDropTarget( const Point& rPos )
     // when dropping in a vacant space, use the last entry
     if( !pTarget )
         return (SvTreeListEntry*)LastVisible();
-    else if( (GetDragDropMode() & SV_DRAGDROP_ENABLE_TOP) &&
+    else if( (GetDragDropMode() & DragDropMode::ENABLE_TOP) &&
              pTarget == First() && rPos.Y() < 6 )
         return 0;
 
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 3e77a89..0956934 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -137,7 +137,7 @@ namespace svxform
         EnableContextMenuHandling();
 
         if ( DGTInstance == m_eGroup )
-            SetDragDropMode( SV_DRAGDROP_CTRL_MOVE |SV_DRAGDROP_CTRL_COPY | SV_DRAGDROP_APP_COPY );
+            SetDragDropMode( DragDropMode::CTRL_MOVE |DragDropMode::CTRL_COPY | DragDropMode::APP_COPY );
     }
 
     DataTreeListBox::~DataTreeListBox()
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 9774460..bc19f37 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -1141,7 +1141,7 @@ FmFilterNavigator::FmFilterNavigator( vcl::Window* pParent )
     EnableInplaceEditing( true );
     SetSelectionMode(MULTIPLE_SELECTION);
 
-    SetDragDropMode(0xFFFF);
+    SetDragDropMode(DragDropMode::ALL);
 
     m_aDropActionTimer.SetTimeoutHdl(LINK(this, FmFilterNavigator, OnDropActionTimer));
 }
diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx
index 46a444d..e2b9247 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -143,7 +143,7 @@ namespace svxform
             m_aNavigatorImages.GetImage( RID_SVXIMG_EXPANDEDNODE )
         );
 
-        SetDragDropMode(0xFFFF);
+        SetDragDropMode(DragDropMode::ALL);
         EnableInplaceEditing( true );
         SetSelectionMode(MULTIPLE_SELECTION);
 
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 58d0fc4..44d7ff5 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1194,7 +1194,7 @@ DDListBox::DDListBox(vcl::Window* pParent, WinBits nStyle)
     SetStyle( GetStyle() | /*WB_HASBUTTONS|WB_HASBUTTONSATROOT|*/
                             WB_CLIPCHILDREN );
     SetSelectionMode( SINGLE_SELECTION );
-    SetDragDropMode( SV_DRAGDROP_CTRL_COPY );
+    SetDragDropMode( DragDropMode::CTRL_COPY );
     EnableAsyncDrag(true);
     // expand selection to the complete width of the ListBox
     SetHighlightRange();
diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx
index e701558..f780d35 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.cxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.cxx
@@ -57,7 +57,7 @@ SwAddressTable::SwAddressTable(SvSimpleTableContainer& rParent, WinBits nBits)
 {
     SetSpaceBetweenEntries(3);
     SetSelectionMode(SINGLE_SELECTION);
-    SetDragDropMode(0);
+    SetDragDropMode(DragDropMode::NONE);
     EnableAsyncDrag(false);
 }
 
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 0c29603..858fd69 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -812,7 +812,7 @@ SwGlTreeListBox::SwGlTreeListBox(vcl::Window* pParent, WinBits nBits)
     , sReadonly(SW_RESSTR(SW_STR_READONLY)),
     pDragEntry(0)
 {
-    SetDragDropMode( SV_DRAGDROP_CTRL_MOVE|SV_DRAGDROP_CTRL_COPY );
+    SetDragDropMode( DragDropMode::CTRL_MOVE|DragDropMode::CTRL_COPY );
 }
 
 Size SwGlTreeListBox::GetOptimalSize() const
@@ -892,7 +892,7 @@ DragDropMode SwGlTreeListBox::NotifyStartDrag(
     DragDropMode  eRet;
     pDragEntry = pEntry;
     if(!GetParent(pEntry))
-        eRet = SV_DRAGDROP_NONE;
+        eRet = DragDropMode::NONE;
     else
     {
         SwGlossaryDlg* pDlg = static_cast<SwGlossaryDlg*>(GetParentDialog());
@@ -903,10 +903,10 @@ DragDropMode SwGlTreeListBox::NotifyStartDrag(
             + OUStringLiteral1<GLOS_DELIM>()
             + OUString::number(pGroupData->nPathIdx);
         sal_Int8 nDragOption = DND_ACTION_COPY;
-        eRet = SV_DRAGDROP_CTRL_COPY;
+        eRet = DragDropMode::CTRL_COPY;
         if(!pDlg->pGlossaryHdl->IsReadOnly(&sEntry))
         {
-            eRet |= SV_DRAGDROP_CTRL_MOVE;
+            eRet |= DragDropMode::CTRL_MOVE;
             nDragOption |= DND_ACTION_MOVE;
         }
         SetDragOptions( nDragOption );
diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx
index 2ad207c..64bcf9c 100644
--- a/sw/source/uibase/dbui/dbtree.cxx
+++ b/sw/source/uibase/dbui/dbtree.cxx
@@ -210,7 +210,7 @@ void SwDBTreeList::InitTreeList()
     SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE),
                     aImageList.GetImage(IMG_EXPAND  ) );
 
-    SetDragDropMode(SV_DRAGDROP_APP_COPY);
+    SetDragDropMode(DragDropMode::APP_COPY);
 
     GetModel()->SetCompareHdl(LINK(this, SwDBTreeList, DBCompare));
 
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index b41cbf5..282a727 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -816,7 +816,7 @@ SwContentTree::SwContentTree(vcl::Window* pParent, const ResId& rResId)
 
     SetNodeDefaultImages();
     SetDoubleClickHdl(LINK(this, SwContentTree, ContentDoubleClickHdl));
-    SetDragDropMode(SV_DRAGDROP_APP_COPY);
+    SetDragDropMode(DragDropMode::APP_COPY);
     for (sal_uInt16 i = 0; i < CONTENT_TYPE_MAX; i++)
     {
         aActiveContentArr[i]    = 0;
@@ -2492,7 +2492,7 @@ DragDropMode SwContentTree::NotifyStartDrag(
         && !GetWrtShell()->GetView().GetDocShell()->IsReadOnly())
         eMode = GetDragDropMode();
     else if(!bIsActive && GetWrtShell()->GetView().GetDocShell()->HasName())
-        eMode = SV_DRAGDROP_APP_COPY;
+        eMode = DragDropMode::APP_COPY;
 
     sal_Int8 nDragMode;
     FillTransferData( rContainer, nDragMode );
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index e794c98..2f4b0a5 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -161,9 +161,9 @@ SwGlobalTree::SwGlobalTree(vcl::Window* pParent, const ResId& rResId) :
     bIsImageListInitialized ( false )
 
 {
-    SetDragDropMode(SV_DRAGDROP_APP_COPY  |
-                    SV_DRAGDROP_CTRL_MOVE |
-                    SV_DRAGDROP_ENABLE_TOP );
+    SetDragDropMode(DragDropMode::APP_COPY  |
+                    DragDropMode::CTRL_MOVE |
+                    DragDropMode::ENABLE_TOP );
 
     aUpdateTimer.SetTimeout(GLOBAL_UPDATE_TIMEOUT);
     aUpdateTimer.SetTimeoutHdl(LINK(this, SwGlobalTree, Timeout));
@@ -525,7 +525,7 @@ DragDropMode SwGlobalTree::NotifyStartDrag( TransferDataContainer& ,
 {
     bIsInternalDrag = true;
     pDDSource = pEntry;
-    return SV_DRAGDROP_CTRL_MOVE;
+    return DragDropMode::CTRL_MOVE;
 }
 
 sal_IntPtr SwGlobalTree::GetTabPos( SvTreeListEntry*, SvLBoxTab* pTab)
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 2d7c6c7..946d409 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -763,9 +763,9 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
                             WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE );
     aContentTree.SetSpaceBetweenEntries(3);
     aContentTree.SetSelectionMode( SINGLE_SELECTION );
-    aContentTree.SetDragDropMode(   SV_DRAGDROP_CTRL_MOVE |
-                                    SV_DRAGDROP_CTRL_COPY |
-                                    SV_DRAGDROP_ENABLE_TOP );
+    aContentTree.SetDragDropMode(   DragDropMode::CTRL_MOVE |
+                                    DragDropMode::CTRL_COPY |
+                                    DragDropMode::ENABLE_TOP );
     aContentTree.EnableAsyncDrag(true);
     aContentTree.ShowTree();
     aContentToolBox.CheckItem(FN_SHOW_CONTENT_BOX, true);
commit 38143e4599e4ec759a11ea96a4b852bb00a42ab6
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Apr 21 14:38:41 2015 +0200

    convert TREEBOX_ALLITEM constants to scoped enum
    
    Change-Id: I46f792fce6ff09f2b00144f401ee396101d8460d

diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx
index c031bcf..2c33734 100644
--- a/accessibility/source/extended/accessiblelistbox.cxx
+++ b/accessibility/source/extended/accessiblelistbox.cxx
@@ -436,10 +436,10 @@ namespace accessibility
 
         if(getListBox())
         {
-            short nType = getListBox()->GetAllEntriesAccessibleRoleType();
-            if( nType == TREEBOX_ALLITEM_ACCROLE_TYPE_TREE)
+            SvTreeAccRoleType nType = getListBox()->GetAllEntriesAccessibleRoleType();
+            if( nType == SvTreeAccRoleType::TREE)
                     return AccessibleRole::TREE;
-            else if( nType == TREEBOX_ALLITEM_ACCROLE_TYPE_LIST)
+            else if( nType == SvTreeAccRoleType::LIST)
                     return AccessibleRole::LIST;
         }
 
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 39e4cf2..7f68e11 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -416,10 +416,10 @@ namespace accessibility
         SvTreeListBox* pBox = getListBox();
         if(pBox)
         {
-            short nType = pBox->GetAllEntriesAccessibleRoleType();
-            if( nType == TREEBOX_ALLITEM_ACCROLE_TYPE_TREE)
+            SvTreeAccRoleType nType = pBox->GetAllEntriesAccessibleRoleType();
+            if( nType == SvTreeAccRoleType::TREE)
                     return AccessibleRole::TREE_ITEM;
-            else if( nType == TREEBOX_ALLITEM_ACCROLE_TYPE_LIST)
+            else if( nType == SvTreeAccRoleType::LIST)
                     return AccessibleRole::LIST_ITEM;
 
             SvTreeFlags treeFlag = pBox->GetTreeFlags();
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index b687c2c..f06c3c6 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -113,8 +113,12 @@ namespace o3tl
     template<> struct typed_flags<SvTreeFlags> : is_typed_flags<SvTreeFlags, 0x1f> {};
 }
 
-#define TREEBOX_ALLITEM_ACCROLE_TYPE_LIST   0x01
-#define TREEBOX_ALLITEM_ACCROLE_TYPE_TREE   0x02
+enum class SvTreeAccRoleType
+{
+    NONE   = 0x00,
+    LIST   = 0x01,
+    TREE   = 0x02
+};
 
 typedef sal_Int64   ExtendedWinBits;
 
@@ -245,7 +249,7 @@ class SVT_DLLPUBLIC SvTreeListBox
     short           nEntryHeightOffs;
     short           nIndent;
     short           nFocusWidth;
-    short           nAllItemAccRoleType;
+    SvTreeAccRoleType nAllItemAccRoleType;
     sal_uInt16      nFirstSelTab;
     sal_uInt16      nLastSelTab;
     long mnCheckboxItemWidth;
@@ -532,8 +536,8 @@ public:
     void EnableCellFocus();
 
                         // For overwriting accessible role for all entries - normally 0, so each entry can be different
-    void                SetAllEntriesAccessibleRoleType( short n ) { nAllItemAccRoleType = n; }
-    short               GetAllEntriesAccessibleRoleType() const { return nAllItemAccRoleType; }
+    void                SetAllEntriesAccessibleRoleType( SvTreeAccRoleType n ) { nAllItemAccRoleType = n; }
+    SvTreeAccRoleType   GetAllEntriesAccessibleRoleType() const { return nAllItemAccRoleType; }
 
     SvTreeFlags         GetTreeFlags() const {return nTreeFlags;}
 
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index ba2e017..e08f751 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1441,7 +1441,7 @@ void SvTreeListBox::InitTreeView()
     nFirstSelTab = 0;
     nLastSelTab = 0;
     nFocusWidth = -1;
-    nAllItemAccRoleType = 0;
+    nAllItemAccRoleType = SvTreeAccRoleType::NONE;
     mnCheckboxItemWidth = 0;
 
     Link* pLink = new Link( LINK(this,SvTreeListBox, DefaultCompare) );
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 305dc1b..a0b3ac5 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -371,7 +371,7 @@ SwEditRegionDlg::SwEditRegionDlg( vcl::Window* pParent, SwWrtShell& rWrtSh )
     m_pTree->SetSelectionMode( MULTIPLE_SELECTION );
     m_pTree->SetStyle(m_pTree->GetStyle()|WB_HASBUTTONSATROOT|WB_CLIPCHILDREN|WB_HSCROLL);
     m_pTree->SetSpaceBetweenEntries(0);
-    m_pTree->SetAllEntriesAccessibleRoleType(TREEBOX_ALLITEM_ACCROLE_TYPE_TREE);
+    m_pTree->SetAllEntriesAccessibleRoleType(SvTreeAccRoleType::TREE);
 
     if(bWeb)
     {
commit 8d3eefd3b2b6dad051247fbd4a8097bb154617e1
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Apr 20 15:50:47 2015 +0200

    convert TREEFLAG_ constants to scoped enum
    
    Change-Id: Ibf9eab757fbe94dbff3fd09472f3ca74fffd5094

diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx
index b7af42d..c031bcf 100644
--- a/accessibility/source/extended/accessiblelistbox.cxx
+++ b/accessibility/source/extended/accessiblelistbox.cxx
@@ -414,7 +414,7 @@ namespace accessibility
         }
 
         bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
-        if( !(getListBox()->GetTreeFlags() & TREEFLAG_CHKBTN) )
+        if( !(getListBox()->GetTreeFlags() & SvTreeFlags::CHKBTN) )
         {
             if( bHasButtons )
                 nCase = 1;
@@ -445,7 +445,7 @@ namespace accessibility
 
         //o is: return AccessibleRole::TREE;
         bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
-        if(!bHasButtons && (getListBox()->GetTreeFlags() & TREEFLAG_CHKBTN))
+        if(!bHasButtons && (getListBox()->GetTreeFlags() & SvTreeFlags::CHKBTN))
             return AccessibleRole::LIST;
         else
             if (GetRoleType() == 0)
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 991b165..39e4cf2 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -393,7 +393,7 @@ namespace accessibility
         }
 
         bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
-        if( !(getListBox()->GetTreeFlags() & TREEFLAG_CHKBTN) )
+        if( !(getListBox()->GetTreeFlags() & SvTreeFlags::CHKBTN) )
         {
             if( bHasButtons )
                 nCase = 1;
@@ -422,8 +422,8 @@ namespace accessibility
             else if( nType == TREEBOX_ALLITEM_ACCROLE_TYPE_LIST)
                     return AccessibleRole::LIST_ITEM;
 
-            sal_uInt16 treeFlag = pBox->GetTreeFlags();
-            if(treeFlag & TREEFLAG_CHKBTN )
+            SvTreeFlags treeFlag = pBox->GetTreeFlags();
+            if(treeFlag & SvTreeFlags::CHKBTN )
             {
                 SvTreeListEntry* pEntry = pBox->GetEntryFromPath( m_aEntryPath );
                 SvButtonState eState = pBox->GetCheckButtonState( pEntry );
@@ -757,9 +757,9 @@ namespace accessibility
 
         // three actions supported
         SvTreeListBox* pBox = getListBox();
-        sal_uInt16 treeFlag = pBox->GetTreeFlags();
+        SvTreeFlags treeFlag = pBox->GetTreeFlags();
         bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
-        if( (treeFlag & TREEFLAG_CHKBTN) && !bHasButtons)
+        if( (treeFlag & SvTreeFlags::CHKBTN) && !bHasButtons)
         {
             sal_Int16 role = getAccessibleRole();
             if ( role == AccessibleRole::CHECK_BOX )
@@ -781,8 +781,8 @@ namespace accessibility
         checkActionIndex_Impl( nIndex );
         EnsureIsAlive();
 
-        sal_uInt16 treeFlag = getListBox()->GetTreeFlags();
-        if( nIndex == 0 && (treeFlag & TREEFLAG_CHKBTN) )
+        SvTreeFlags treeFlag = getListBox()->GetTreeFlags();
+        if( nIndex == 0 && (treeFlag & SvTreeFlags::CHKBTN) )
         {
             if(getAccessibleRole() == AccessibleRole::CHECK_BOX)
             {
@@ -794,7 +794,7 @@ namespace accessibility
                     getListBox()->SetCheckButtonState(pEntry, SV_BUTTON_CHECKED);
             }
         }
-        else if( (nIndex == 1 && (treeFlag & TREEFLAG_CHKBTN) ) || (nIndex == 0) )
+        else if( (nIndex == 1 && (treeFlag & SvTreeFlags::CHKBTN) ) || (nIndex == 0) )
         {
             SvTreeListEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
             if ( pEntry )
@@ -823,8 +823,8 @@ namespace accessibility
         // sal_Bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
         SvTreeListEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
         SvButtonState state = getListBox()->GetCheckButtonState( pEntry );
-        sal_uInt16 treeFlag = getListBox()->GetTreeFlags();
-        if(nIndex == 0 && (treeFlag & TREEFLAG_CHKBTN))
+        SvTreeFlags treeFlag = getListBox()->GetTreeFlags();
+        if(nIndex == 0 && (treeFlag & SvTreeFlags::CHKBTN))
         {
             if(getAccessibleRole() == AccessibleRole::CHECK_BOX)
             {
@@ -838,7 +838,7 @@ namespace accessibility
                 //Sometimes, a List or Tree may have both checkbox and label at the same time
                 return OUString();
             }
-        }else if( (nIndex == 1 && (treeFlag & TREEFLAG_CHKBTN)) || nIndex == 0 )
+        }else if( (nIndex == 1 && (treeFlag & SvTreeFlags::CHKBTN)) || nIndex == 0 )
         {
             if( pEntry->HasChildren() || pEntry->HasChildrenOnDemand() )
                 return getListBox()->IsExpanded( pEntry ) ? \
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index be7b8b7..b687c2c 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -100,10 +100,18 @@ namespace o3tl
 
 #define SV_ENTRYHEIGHTOFFS_PIXEL 2
 
-#define TREEFLAG_CHKBTN         0x0001
-#define TREEFLAG_USESEL         0x0002
-#define TREEFLAG_MANINS         0x0004
-#define TREEFLAG_RECALCTABS     0x0008
+enum class SvTreeFlags
+{
+    CHKBTN         = 0x01,
+    USESEL         = 0x02,
+    MANINS         = 0x04,
+    RECALCTABS     = 0x08,
+    FIXEDHEIGHT    = 0x10,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<SvTreeFlags> : is_typed_flags<SvTreeFlags, 0x1f> {};
+}
 
 #define TREEBOX_ALLITEM_ACCROLE_TYPE_LIST   0x01
 #define TREEBOX_ALLITEM_ACCROLE_TYPE_TREE   0x02
@@ -261,7 +269,7 @@ protected:
     SvTreeListEntry*    pTargetEntry;
     SvLBoxButtonData*   pCheckButtonData;
     std::vector<SvLBoxTab*> aTabs;
-    sal_uInt16      nTreeFlags;
+    SvTreeFlags     nTreeFlags;
     sal_uInt16      nImpFlags;
     // Move/CopySelection: Position of the current Entry in SelectionList
     sal_uInt16      nCurEntrySelPos;
@@ -527,7 +535,7 @@ public:
     void                SetAllEntriesAccessibleRoleType( short n ) { nAllItemAccRoleType = n; }
     short               GetAllEntriesAccessibleRoleType() const { return nAllItemAccRoleType; }
 
-    sal_uInt16          GetTreeFlags() const {return nTreeFlags;}
+    SvTreeFlags         GetTreeFlags() const {return nTreeFlags;}
 
     OUString            headString;
     OUString            SearchEntryTextWithHeadTitle(SvTreeListEntry* pEntry);
diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx
index 511a700..36e0bb5 100644
--- a/svtools/source/contnr/simptabl.cxx
+++ b/svtools/source/contnr/simptabl.cxx
@@ -435,7 +435,7 @@ SvLBoxItem* SvSimpleTable::GetEntryAtPos( SvTreeListEntry* pEntry, sal_uInt16 nP
 
         nPos++;
 
-        if( nTreeFlags & TREEFLAG_CHKBTN ) nPos++;
+        if( nTreeFlags & SvTreeFlags::CHKBTN ) nPos++;
 
         if( nPos < nCount )
         {
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 0a26a91..c1789f3 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -3257,7 +3257,7 @@ void SvImpLBox::SetUpdateMode( bool bMode )
 
 bool SvImpLBox::SetMostRight( SvTreeListEntry* pEntry )
 {
-    if( pView->nTreeFlags & TREEFLAG_RECALCTABS )
+    if( pView->nTreeFlags & SvTreeFlags::RECALCTABS )
     {
         nFlags |= F_IGNORE_CHANGED_TABS;
         pView->SetTabs();
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index 691f894..67f18c2 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -141,7 +141,7 @@ void SvTabListBox::SetTabs(const long* pTabs, MapUnit eMapUnit)
         pTabList[nIdx].SetPos( nNewTab );
         pTabList[nIdx].nFlags=(SvLBoxTabFlags::ADJUST_LEFT| SvLBoxTabFlags::INV_ALWAYS);
     }
-    SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS;
+    SvTreeListBox::nTreeFlags |= SvTreeFlags::RECALCTABS;
     if( IsUpdateMode() )
         Invalidate();
 }
@@ -158,7 +158,7 @@ void SvTabListBox::SetTab( sal_uInt16 nTab,long nValue,MapUnit eMapUnit )
         aSize = LogicToLogic( aSize, &aMMSource, &aMMDest );
         nValue = aSize.Width();
         pTabList[ nTab ].SetPos( nValue );
-        SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS;
+        SvTreeListBox::nTreeFlags |= SvTreeFlags::RECALCTABS;
         if( IsUpdateMode() )
             Invalidate();
     }
@@ -477,14 +477,14 @@ void SvTabListBox::SetTabJustify( sal_uInt16 nTab, SvTabJustify eJustify)
     nFlags &= (~MYTABMASK);
     nFlags |= static_cast<SvLBoxTabFlags>(eJustify);
     pTab->nFlags = nFlags;
-    SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS;
+    SvTreeListBox::nTreeFlags |= SvTreeFlags::RECALCTABS;
     if( IsUpdateMode() )
         Invalidate();
 }
 
 long SvTabListBox::GetLogicTab( sal_uInt16 nTab )
 {
-    if( SvTreeListBox::nTreeFlags & TREEFLAG_RECALCTABS )
+    if( SvTreeListBox::nTreeFlags & SvTreeFlags::RECALCTABS )
         ((SvTabListBox*)this)->SetTabs();
 
     DBG_ASSERT(nTab<nTabCount,"GetTabPos:Invalid Tab");
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 7685334..ba2e017 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1429,8 +1429,6 @@ Link SvTreeListBox::GetDragFinishedHdl() const
     - SetSpaceBetweenEntries: offset is not taken into account in SetEntryHeight
 */
 
-#define TREEFLAG_FIXEDHEIGHT        0x0010
-
 #define SV_LBOX_DEFAULT_INDENT_PIXEL 20
 
 void SvTreeListBox::InitTreeView()
@@ -1449,7 +1447,7 @@ void SvTreeListBox::InitTreeView()
     Link* pLink = new Link( LINK(this,SvTreeListBox, DefaultCompare) );
     mpImpl->m_pLink = pLink;
 
-    nTreeFlags = TREEFLAG_RECALCTABS;
+    nTreeFlags = SvTreeFlags::RECALCTABS;
     nIndent = SV_LBOX_DEFAULT_INDENT_PIXEL;
     nEntryHeightOffs = SV_ENTRYHEIGHTOFFS_PIXEL;
     pImp = new SvImpLBox( this, GetModel(), GetStyle() );
@@ -1659,7 +1657,7 @@ void SvTreeListBox::SetTabs()
 {
     if( IsEditingActive() )
         EndEditing( true );
-    nTreeFlags &= (~TREEFLAG_RECALCTABS);
+    nTreeFlags &= (~SvTreeFlags::RECALCTABS);
     nFocusWidth = -1;
     const WinBits nStyle( GetStyle() );
     bool bHasButtons = (nStyle & WB_HASBUTTONS)!=0;
@@ -1671,7 +1669,7 @@ void SvTreeListBox::SetTabs()
     // pCheckButtonData->Width() knows nothing about the native checkbox width,
     // so we have mnCheckboxItemWidth which becomes valid when something is added.
     long nCheckWidth = 0;
-    if( nTreeFlags & TREEFLAG_CHKBTN )
+    if( nTreeFlags & SvTreeFlags::CHKBTN )
         nCheckWidth = mnCheckboxItemWidth;
     long nCheckWidthDIV2 = nCheckWidth / 2;
 
@@ -1681,7 +1679,7 @@ void SvTreeListBox::SetTabs()
     ClearTabList();
 
     int nCase = NO_BUTTONS;
-    if( !(nTreeFlags & TREEFLAG_CHKBTN) )
+    if( !(nTreeFlags & SvTreeFlags::CHKBTN) )
     {
         if( bHasButtons )
             nCase = NODE_BUTTONS;
@@ -1760,7 +1758,7 @@ void SvTreeListBox::InitEntry(SvTreeListEntry* pEntry,
     SvLBoxString* pString;
     SvLBoxContextBmp* pContextBmp;
 
-    if( nTreeFlags & TREEFLAG_CHKBTN )
+    if( nTreeFlags & SvTreeFlags::CHKBTN )
     {
         SvLBoxButton* pButton= new SvLBoxButton( pEntry,eButtonKind,0,pCheckButtonData );
         pEntry->AddItem( pButton );
@@ -1814,7 +1812,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry(
     SvLBoxButtonKind eButtonKind
 )
 {
-    nTreeFlags |= TREEFLAG_MANINS;
+    nTreeFlags |= SvTreeFlags::MANINS;
 
     const Image& rDefExpBmp = pImp->GetDefaultEntryExpBmp( );
     const Image& rDefColBmp = pImp->GetDefaultEntryColBmp( );
@@ -1835,7 +1833,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry(
     aPrevInsertedExpBmp = rDefExpBmp;
     aPrevInsertedColBmp = rDefColBmp;
 
-    nTreeFlags &= (~TREEFLAG_MANINS);
+    nTreeFlags &= (~SvTreeFlags::MANINS);
 
     return pEntry;
 }
@@ -1845,7 +1843,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry( const OUString& rText,
     SvTreeListEntry* pParent, bool bChildrenOnDemand, sal_uLong nPos, void* pUser,
     SvLBoxButtonKind eButtonKind )
 {
-    nTreeFlags |= TREEFLAG_MANINS;
+    nTreeFlags |= SvTreeFlags::MANINS;
 
     aCurInsertedExpBmp = aExpEntryBmp;
     aCurInsertedColBmp = aCollEntryBmp;
@@ -1864,7 +1862,7 @@ SvTreeListEntry* SvTreeListBox::InsertEntry( const OUString& rText,
     aPrevInsertedExpBmp = aExpEntryBmp;
     aPrevInsertedColBmp = aCollEntryBmp;
 
-    nTreeFlags &= (~TREEFLAG_MANINS);
+    nTreeFlags &= (~SvTreeFlags::MANINS);
 
     return pEntry;
 }
@@ -1925,7 +1923,7 @@ void SvTreeListBox::ImpEntryInserted( SvTreeListEntry* pEntry )
         pParent->SetFlags( nFlags );
     }
 
-    if(!((nTreeFlags & TREEFLAG_MANINS) &&
+    if(!((nTreeFlags & SvTreeFlags::MANINS) &&
          (aPrevInsertedExpBmp == aCurInsertedExpBmp)  &&
          (aPrevInsertedColBmp == aCurInsertedColBmp) ))
     {
@@ -1933,18 +1931,18 @@ void SvTreeListBox::ImpEntryInserted( SvTreeListEntry* pEntry )
         if( aSize.Width() > nContextBmpWidthMax )
         {
             nContextBmpWidthMax = (short)aSize.Width();
-            nTreeFlags |= TREEFLAG_RECALCTABS;
+            nTreeFlags |= SvTreeFlags::RECALCTABS;
         }
         aSize = GetExpandedEntryBmp( pEntry ).GetSizePixel();
         if( aSize.Width() > nContextBmpWidthMax )
         {
             nContextBmpWidthMax = (short)aSize.Width();
-            nTreeFlags |= TREEFLAG_RECALCTABS;
+            nTreeFlags |= SvTreeFlags::RECALCTABS;
         }
     }
     SetEntryHeight( (SvTreeListEntry*)pEntry );
 
-    if( nTreeFlags & TREEFLAG_CHKBTN )
+    if( nTreeFlags & SvTreeFlags::CHKBTN )
     {
         SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
         if( pItem )
@@ -1953,7 +1951,7 @@ void SvTreeListBox::ImpEntryInserted( SvTreeListEntry* pEntry )
             if( mnCheckboxItemWidth < nWidth )
             {
                 mnCheckboxItemWidth = nWidth;
-                nTreeFlags |= TREEFLAG_RECALCTABS;
+                nTreeFlags |= SvTreeFlags::RECALCTABS;
             }
         }
     }
@@ -1963,7 +1961,7 @@ void SvTreeListBox::ImpEntryInserted( SvTreeListEntry* pEntry )
 
 void SvTreeListBox::SetCheckButtonState( SvTreeListEntry* pEntry, SvButtonState eState)
 {
-    if( nTreeFlags & TREEFLAG_CHKBTN )
+    if( nTreeFlags & SvTreeFlags::CHKBTN )
     {
         SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
         if(!(pItem && pItem->CheckModification()))
@@ -1988,7 +1986,7 @@ void SvTreeListBox::SetCheckButtonState( SvTreeListEntry* pEntry, SvButtonState
 
 void SvTreeListBox::SetCheckButtonInvisible( SvTreeListEntry* pEntry)
 {
-    if( nTreeFlags & TREEFLAG_CHKBTN )
+    if( nTreeFlags & SvTreeFlags::CHKBTN )
     {
         SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
         pItem->SetStateInvisible();
@@ -1999,7 +1997,7 @@ void SvTreeListBox::SetCheckButtonInvisible( SvTreeListEntry* pEntry)
 SvButtonState SvTreeListBox::GetCheckButtonState( SvTreeListEntry* pEntry ) const
 {
     SvButtonState eState = SV_BUTTON_UNCHECKED;
-    if( nTreeFlags & TREEFLAG_CHKBTN )
+    if( nTreeFlags & SvTreeFlags::CHKBTN )
     {
         SvLBoxButton* pItem = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
         if(!pItem)
@@ -2094,11 +2092,11 @@ void SvTreeListBox::EnableCheckButton( SvLBoxButtonData* pData )
 {
     DBG_ASSERT(!GetEntryCount(),"EnableCheckButton: Entry count != 0");
     if( !pData )
-        nTreeFlags &= (~TREEFLAG_CHKBTN);
+        nTreeFlags &= (~SvTreeFlags::CHKBTN);
     else
     {
         SetCheckButtonData( pData );
-        nTreeFlags |= TREEFLAG_CHKBTN;
+        nTreeFlags |= SvTreeFlags::CHKBTN;
         pData->SetLink( LINK(this, SvTreeListBox, CheckButtonClick));
     }
 
@@ -2220,7 +2218,7 @@ void SvTreeListBox::ModelHasCleared()
     SetDefaultExpandedEntryBmp( GetDefaultExpandedEntryBmp() );
     SetDefaultCollapsedEntryBmp( GetDefaultCollapsedEntryBmp() );
 
-    if( !(nTreeFlags & TREEFLAG_FIXEDHEIGHT ))
+    if( !(nTreeFlags & SvTreeFlags::FIXEDHEIGHT ))
         nEntryHeight = 0;
     AdjustEntryHeight( GetFont() );
     AdjustEntryHeight( GetDefaultExpandedEntryBmp() );
@@ -2326,9 +2324,9 @@ void SvTreeListBox::SetEntryHeight( short nHeight, bool bAlways )
     {
         nEntryHeight = nHeight;
         if( nEntryHeight )
-            nTreeFlags |= TREEFLAG_FIXEDHEIGHT;
+            nTreeFlags |= SvTreeFlags::FIXEDHEIGHT;
         else
-            nTreeFlags &= ~TREEFLAG_FIXEDHEIGHT;
+            nTreeFlags &= ~SvTreeFlags::FIXEDHEIGHT;
         Control::SetFont( GetFont() );
         pImp->SetEntryHeight( nHeight );
     }
@@ -2554,7 +2552,7 @@ void SvTreeListBox::AdjustEntryHeightAndRecalc( const vcl::Font& rFont )
 void SvTreeListBox::Paint( const Rectangle& rRect )
 {
     Control::Paint( rRect );
-    if( nTreeFlags & TREEFLAG_RECALCTABS )
+    if( nTreeFlags & SvTreeFlags::RECALCTABS )
         SetTabs();
     pImp->Paint( rRect );
     //Add visual focus draw
@@ -2829,7 +2827,7 @@ void SvTreeListBox::ImplInitStyle()
 
     const WinBits nWindowStyle = GetStyle();
 
-    nTreeFlags |= TREEFLAG_RECALCTABS;
+    nTreeFlags |= SvTreeFlags::RECALCTABS;
     if( nWindowStyle & WB_SORT )
     {
         GetModel()->SetSortMode( SortAscending );
@@ -2877,7 +2875,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, SvLBoxTabFl
 
     pImp->UpdateContextBmpWidthMax( pEntry );
 
-    if( nTreeFlags & TREEFLAG_RECALCTABS )
+    if( nTreeFlags & SvTreeFlags::RECALCTABS )
         SetTabs();
 
     short nTempEntryHeight = GetEntryHeight();
@@ -3003,7 +3001,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, SvLBoxTabFl
             }
 
             // draw background
-            if( !(nTreeFlags & TREEFLAG_USESEL))
+            if( !(nTreeFlags & SvTreeFlags::USESEL))
             {
                 // only draw the area that is used by the item
                 aRectSize.Width() = aSize.Width();
@@ -3035,7 +3033,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, SvLBoxTabFl
             // A custom selection that starts at a tab position > 0, do not fill
             // the background of the 0th item, else e.g. we might not be able to
             // realize tab listboxes with lines.
-            if( !(nCurTab==0 && (nTreeFlags & TREEFLAG_USESEL) && nFirstSelTab) )
+            if( !(nCurTab==0 && (nTreeFlags & SvTreeFlags::USESEL) && nFirstSelTab) )
             {
                 SetFillColor( aWallpaper.GetColor() );
                 // this case may occur for smaller horizontal resizes
@@ -3203,7 +3201,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvTreeListEntry* pEntry, long nLine )
             nNextTabPos += 50;
     }
 
-    bool bUserSelection = ( nTreeFlags & TREEFLAG_USESEL ) != 0;
+    bool bUserSelection = bool( nTreeFlags & SvTreeFlags::USESEL );
     if( !bUserSelection )
     {
         if( pTab && nCurTab < pEntry->ItemCount() )
@@ -3424,7 +3422,7 @@ void SvTreeListBox::AddTab(long nTabPos, SvLBoxTabFlags nFlags, void* pUserData
     SvLBoxTab* pTab = new SvLBoxTab( nTabPos, nFlags );
     pTab->SetUserData( pUserData );
     aTabs.push_back( pTab );
-    if( nTreeFlags & TREEFLAG_USESEL )
+    if( nTreeFlags & SvTreeFlags::USESEL )
     {
         sal_uInt16 nPos = aTabs.size() - 1;
         if( nPos >= nFirstSelTab && nPos <= nLastSelTab )
@@ -3519,7 +3517,7 @@ void SvTreeListBox::SetHighlightRange( sal_uInt16 nStart, sal_uInt16 nEnd)
 {
 
     sal_uInt16 nTemp;
-    nTreeFlags |= TREEFLAG_USESEL;
+    nTreeFlags |= SvTreeFlags::USESEL;
     if( nStart > nEnd )
     {
         nTemp = nStart;
@@ -3527,7 +3525,7 @@ void SvTreeListBox::SetHighlightRange( sal_uInt16 nStart, sal_uInt16 nEnd)
         nEnd = nTemp;
     }
     // select all tabs that lie within the area
-    nTreeFlags |= TREEFLAG_RECALCTABS;
+    nTreeFlags |= SvTreeFlags::RECALCTABS;
     nFirstSelTab = nStart;
     nLastSelTab = nEnd;
     pImp->RecalcFocusRect();
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 3cd2d26..5406ba1 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -334,7 +334,7 @@ SvTreeListEntry* SvxRedlinTable::CreateEntry() const
 void SvxRedlinTable::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr,
         const Image& rColl, const Image& rExp, SvLBoxButtonKind eButtonKind)
 {
-    if (nTreeFlags & TREEFLAG_CHKBTN)
+    if (nTreeFlags & SvTreeFlags::CHKBTN)
     {
         pEntry->AddItem(new SvLBoxButton(pEntry, eButtonKind, 0, pCheckButtonData));
     }
diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx
index 5ae4c21..d36bc42 100644
--- a/svx/source/dialog/fontlb.cxx
+++ b/svx/source/dialog/fontlb.cxx
@@ -136,7 +136,7 @@ void SvxFontListBox::InitEntry(
 {
     if( mbUseFont )
     {
-        if( nTreeFlags & TREEFLAG_CHKBTN )
+        if( nTreeFlags & SvTreeFlags::CHKBTN )
             pEntry->AddItem( new SvLBoxButton( pEntry, eButtonKind, 0,
                                                pCheckButtonData ) );
         pEntry->AddItem( new SvLBoxContextBmp(pEntry, 0, rCollImg, rExpImg, true) );
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index 9d8b6e6..bfb4240 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -318,7 +318,7 @@ SvLBoxItem* DictionaryList::getItemAtColumn( SvTreeListEntry* pEntry, sal_uInt16
     {
         sal_uInt16 nCount = pEntry->ItemCount();
         nColumn++;
-        if( nTreeFlags & TREEFLAG_CHKBTN )
+        if( nTreeFlags & SvTreeFlags::CHKBTN )
             nColumn++;
            if( nColumn < nCount )
             pItem = pEntry->GetItem( nColumn );
commit 923de833be3131c36cd2b5952f3311f810aac01b
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Apr 20 15:06:55 2015 +0200

    convert SV_LBOXTAB_ constants to scoped enum
    
    Change-Id: Ic7d91ca51106288fb0e14f6f243d74be77cb2c0d

diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index f81a931..117a4f4 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -2152,9 +2152,9 @@ void WatchTreeListBox::SetTabs()
     {
         SvLBoxTab* pTab = aTabs[i];
         if( i == 2 )
-            pTab->nFlags |= SV_LBOXTAB_EDITABLE;
+            pTab->nFlags |= SvLBoxTabFlags::EDITABLE;
         else
-            pTab->nFlags &= ~SV_LBOXTAB_EDITABLE;
+            pTab->nFlags &= ~SvLBoxTabFlags::EDITABLE;
     }
 }
 
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index a71e0be..955cac7 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -415,15 +415,15 @@ void SvxFontSubstCheckListBox::Resize()
 void SvxFontSubstCheckListBox::SetTabs()
 {
     SvSimpleTable::SetTabs();
-    sal_uInt16 nAdjust = SV_LBOXTAB_ADJUST_RIGHT|SV_LBOXTAB_ADJUST_LEFT|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_ADJUST_NUMERIC|SV_LBOXTAB_FORCE;
+    SvLBoxTabFlags nAdjust = SvLBoxTabFlags::ADJUST_RIGHT|SvLBoxTabFlags::ADJUST_LEFT|SvLBoxTabFlags::ADJUST_CENTER|SvLBoxTabFlags::ADJUST_NUMERIC|SvLBoxTabFlags::FORCE;
 
     SvLBoxTab* pTab = aTabs[1];
     pTab->nFlags &= ~nAdjust;
-    pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
+    pTab->nFlags |= SvLBoxTabFlags::PUSHABLE|SvLBoxTabFlags::ADJUST_CENTER|SvLBoxTabFlags::FORCE;
 
     pTab = aTabs[2];
     pTab->nFlags &= ~nAdjust;
-    pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
+    pTab->nFlags |= SvLBoxTabFlags::PUSHABLE|SvLBoxTabFlags::ADJUST_CENTER|SvLBoxTabFlags::FORCE;
 }
 
 void    SvxFontSubstCheckListBox::KeyInput( const KeyEvent& rKEvt )
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index ab49d9d..f3f1df5 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -341,19 +341,19 @@ SvTreeListEntry* OfaMSFilterTabPage2::GetEntry4Type( sal_IntPtr _nType ) const
 void OfaMSFilterTabPage2::MSFltrSimpleTable::SetTabs()
 {
     SvSimpleTable::SetTabs();
-    sal_uInt16 nAdjust = SV_LBOXTAB_ADJUST_RIGHT|SV_LBOXTAB_ADJUST_LEFT|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_ADJUST_NUMERIC|SV_LBOXTAB_FORCE;
+    SvLBoxTabFlags nAdjust = SvLBoxTabFlags::ADJUST_RIGHT|SvLBoxTabFlags::ADJUST_LEFT|SvLBoxTabFlags::ADJUST_CENTER|SvLBoxTabFlags::ADJUST_NUMERIC|SvLBoxTabFlags::FORCE;
 
     if( aTabs.size() > 1 )
     {
         SvLBoxTab* pTab = aTabs[1];
         pTab->nFlags &= ~nAdjust;
-        pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
+        pTab->nFlags |= SvLBoxTabFlags::PUSHABLE|SvLBoxTabFlags::ADJUST_CENTER|SvLBoxTabFlags::FORCE;
     }
     if( aTabs.size() > 2 )
     {
         SvLBoxTab* pTab = aTabs[2];
         pTab->nFlags &= ~nAdjust;
-        pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
+        pTab->nFlags |= SvLBoxTabFlags::PUSHABLE|SvLBoxTabFlags::ADJUST_CENTER|SvLBoxTabFlags::FORCE;
     }
 }
 
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 09f5808..6a7d690 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -727,19 +727,19 @@ IMPL_LINK_NOARG(OfaSwAutoFmtOptionsPage, EditHdl)
 void OfaACorrCheckListBox::SetTabs()
 {
     SvSimpleTable::SetTabs();
-    sal_uInt16 nAdjust = SV_LBOXTAB_ADJUST_RIGHT|SV_LBOXTAB_ADJUST_LEFT|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_ADJUST_NUMERIC|SV_LBOXTAB_FORCE;
+    SvLBoxTabFlags nAdjust = SvLBoxTabFlags::ADJUST_RIGHT|SvLBoxTabFlags::ADJUST_LEFT|SvLBoxTabFlags::ADJUST_CENTER|SvLBoxTabFlags::ADJUST_NUMERIC|SvLBoxTabFlags::FORCE;
 
     if( aTabs.size() > 1 )
     {
         SvLBoxTab* pTab = aTabs[1];
         pTab->nFlags &= ~nAdjust;
-        pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
+        pTab->nFlags |= SvLBoxTabFlags::PUSHABLE|SvLBoxTabFlags::ADJUST_CENTER|SvLBoxTabFlags::FORCE;
     }
     if( aTabs.size() > 2 )
     {
         SvLBoxTab* pTab = aTabs[2];
         pTab->nFlags &= ~nAdjust;
-        pTab->nFlags |= SV_LBOXTAB_PUSHABLE|SV_LBOXTAB_ADJUST_CENTER|SV_LBOXTAB_FORCE;
+        pTab->nFlags |= SvLBoxTabFlags::PUSHABLE|SvLBoxTabFlags::ADJUST_CENTER|SvLBoxTabFlags::FORCE;
     }
 }
 
diff --git a/include/svtools/svtabbx.hxx b/include/svtools/svtabbx.hxx
index 92c04fc..dcded33 100644
--- a/include/svtools/svtabbx.hxx
+++ b/include/svtools/svtabbx.hxx
@@ -27,10 +27,10 @@
 
 enum SvTabJustify
 {
-    AdjustRight = SV_LBOXTAB_ADJUST_RIGHT,
-    AdjustLeft = SV_LBOXTAB_ADJUST_LEFT,
-    AdjustCenter = SV_LBOXTAB_ADJUST_CENTER,
-    AdjustNumeric = SV_LBOXTAB_ADJUST_NUMERIC
+    AdjustRight = static_cast<int>(SvLBoxTabFlags::ADJUST_RIGHT),
+    AdjustLeft = static_cast<int>(SvLBoxTabFlags::ADJUST_LEFT),
+    AdjustCenter = static_cast<int>(SvLBoxTabFlags::ADJUST_CENTER),
+    AdjustNumeric = static_cast<int>(SvLBoxTabFlags::ADJUST_NUMERIC)
 };
 
 struct TabListBoxEventData
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index 0af36c9..be7b8b7 100644
--- a/include/svtools/treelistbox.hxx
+++ b/include/svtools/treelistbox.hxx
@@ -38,6 +38,7 @@
 #include <svtools/treelist.hxx>
 #include <svtools/transfer.hxx>
 #include <vcl/idle.hxx>
+#include <o3tl/typed_flags_set.hxx>
 
 class Application;
 class SvTreeListBox;
@@ -70,21 +71,30 @@ enum SvButtonState { SV_BUTTON_UNCHECKED, SV_BUTTON_CHECKED, SV_BUTTON_TRISTATE
 // *************************** Tabulators ******************************
 // *********************************************************************
 
-#define SV_LBOXTAB_DYNAMIC          0x0001 // Item's output column changes according to the Child Depth
-#define SV_LBOXTAB_ADJUST_RIGHT     0x0002 // Item's right margin at the tabulator
-#define SV_LBOXTAB_ADJUST_LEFT      0x0004 // Left margin
-#define SV_LBOXTAB_ADJUST_CENTER    0x0008 // Center the item at the tabulator
-#define SV_LBOXTAB_ADJUST_NUMERIC   0x0010 // Decimal point at the tabulator (strings)
-
-#define SV_LBOXTAB_SHOW_SELECTION   0x0040 // Visualize selection state
+enum class SvLBoxTabFlags
+{
+    NONE             = 0x0000,
+    DYNAMIC          = 0x0001, // Item's output column changes according to the Child Depth
+    ADJUST_RIGHT     = 0x0002, // Item's right margin at the tabulator
+    ADJUST_LEFT      = 0x0004, // Left margin
+    ADJUST_CENTER    = 0x0008, // Center the item at the tabulator
+    ADJUST_NUMERIC   = 0x0010, // Decimal point at the tabulator (strings)
+
+    SHOW_SELECTION   = 0x0040, // Visualize selection state
                                            // Item needs to be able to return the surrounding polygon (D'n'D cursor)
-#define SV_LBOXTAB_EDITABLE         0x0100 // Item editable at the tabulator
-#define SV_LBOXTAB_PUSHABLE         0x0200 // Item acts like a Button
-#define SV_LBOXTAB_INV_ALWAYS       0x0400 // Always delete the background
-#define SV_LBOXTAB_FORCE            0x0800 // Switch off the default calculation of the first tabulator
-                                           // (on which Abo Tabpage/Extras/Option/Customize, etc. rely on)
-                                           // The first tab's position corresponds precisely to the Flags set
-                                           // and column widths
+    EDITABLE         = 0x0100, // Item editable at the tabulator
+    PUSHABLE         = 0x0200, // Item acts like a Button
+    INV_ALWAYS       = 0x0400, // Always delete the background
+    FORCE            = 0x0800, // Switch off the default calculation of the first tabulator
+                               // (on which Abo Tabpage/Extras/Option/Customize, etc. rely on)
+                               // The first tab's position corresponds precisely to the Flags set
+                               // and column widths
+    ALL              = 0x0f5f,
+};
+namespace o3tl
+{
+    template<> struct typed_flags<SvLBoxTabFlags> : is_typed_flags<SvLBoxTabFlags, 0x0f5f> {};
+}
 
 #define SV_TAB_BORDER 8
 
@@ -115,20 +125,20 @@ class SvLBoxTab
     void*   pUserData;
 public:
             SvLBoxTab();
-            SvLBoxTab( long nPos, sal_uInt16 nFlags=SV_LBOXTAB_ADJUST_LEFT );
+            SvLBoxTab( long nPos, SvLBoxTabFlags nFlags = SvLBoxTabFlags::ADJUST_LEFT );
             SvLBoxTab( const SvLBoxTab& );
             ~SvLBoxTab();
 
-    sal_uInt16  nFlags;
+    SvLBoxTabFlags nFlags;
 
     void    SetUserData( void* pPtr ) { pUserData = pPtr; }
     void*   GetUserData() const { return pUserData; }
-    bool    IsDynamic() const { return ((nFlags & SV_LBOXTAB_DYNAMIC)!=0); }
+    bool    IsDynamic() const { return bool(nFlags & SvLBoxTabFlags::DYNAMIC); }
     void    SetPos( long nNewPos) { nPos = nNewPos; }
     long    GetPos() const { return nPos; }
     long    CalcOffset( long nItemLength, long nTabWidth );
-    bool    IsEditable() const { return ((nFlags & SV_LBOXTAB_EDITABLE)!=0); }
-    bool    IsPushable() const { return ((nFlags & SV_LBOXTAB_PUSHABLE)!=0); }
+    bool    IsEditable() const { return bool(nFlags & SvLBoxTabFlags::EDITABLE); }
+    bool    IsPushable() const { return bool(nFlags & SvLBoxTabFlags::PUSHABLE); }
 };
 
 // *********************************************************************
@@ -540,7 +550,7 @@ protected:
 
     SVT_DLLPRIVATE void         ImpEntryInserted( SvTreeListEntry* pEntry );
     SVT_DLLPRIVATE long         PaintEntry1( SvTreeListEntry*, long nLine,
-                                             sal_uInt16 nTabFlagMask=0xffff,
+                                             SvLBoxTabFlags nTabFlagMask = SvLBoxTabFlags::ALL,
                                              bool bHasClipRegion=false );
 
     SVT_DLLPRIVATE void         InitTreeView();
@@ -558,13 +568,13 @@ protected:
     // Is called automatically when inserting/changing Bitmaps, changing the Model etc.
     virtual void    SetTabs();
     void            SetTabs_Impl();
-    void            AddTab( long nPos,sal_uInt16 nFlags=SV_LBOXTAB_ADJUST_LEFT,
+    void            AddTab( long nPos, SvLBoxTabFlags nFlags=SvLBoxTabFlags::ADJUST_LEFT,
                         void* pUserData = 0 );
     sal_uInt16      TabCount() const { return aTabs.size(); }
     SvLBoxTab*      GetFirstDynamicTab() const;
     SvLBoxTab*      GetFirstDynamicTab( sal_uInt16& rTabPos ) const;
-    SvLBoxTab*      GetFirstTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
-    SvLBoxTab*      GetLastTab( sal_uInt16 nFlagMask, sal_uInt16& rTabPos );
+    SvLBoxTab*      GetFirstTab( SvLBoxTabFlags nFlagMask, sal_uInt16& rTabPos );
+    SvLBoxTab*      GetLastTab( SvLBoxTabFlags nFlagMask, sal_uInt16& rTabPos );
     SvLBoxTab*      GetTab( SvTreeListEntry*, SvLBoxItem* ) const;
     void            ClearTabList();
 
@@ -718,7 +728,7 @@ public:
 
     void            PaintEntry( SvTreeListEntry* );
     long            PaintEntry( SvTreeListEntry*, long nLine,
-                                sal_uInt16 nTabFlagMask=0xffff );
+                                SvLBoxTabFlags nTabFlagMask=SvLBoxTabFlags::ALL );
     virtual Rectangle GetFocusRect( SvTreeListEntry*, long nLine );
     // Respects indentation
     virtual sal_IntPtr GetTabPos( SvTreeListEntry*, SvLBoxTab* );
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 39eb1dc..0a26a91 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -943,7 +943,7 @@ void SvImpLBox::Paint( const Rectangle& rRect )
     for( sal_uInt16 n=0; n< nCount && pEntry; n++ )
     {
         /*long nMaxRight=*/
-        pView->PaintEntry1( pEntry, nY, 0xffff, true );
+        pView->PaintEntry1( pEntry, nY, SvLBoxTabFlags::ALL, true );
         nY += nEntryHeight;
         pEntry = pView->NextVisible(pEntry);
     }
@@ -1639,7 +1639,7 @@ void SvImpLBox::EntrySelected( SvTreeListEntry* pEntry, bool bSelect )
         if( IsLineVisible( nY ) )
         {
             ShowCursor( false );
-            pView->PaintEntry1( pEntry, nY, 0xffff ); // because of ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION );
+            pView->PaintEntry1( pEntry, nY, SvLBoxTabFlags::ALL ); // because of ItemsetBrowser SvLBoxTabFlags::SHOW_SELECTION );
             ShowCursor( true );
         }
     }
@@ -1907,8 +1907,8 @@ bool SvImpLBox::ButtonDownCheckCtrl(
         pView->CaptureMouse();
         pActiveButton->SetStateHilighted( true );
         pView->PaintEntry1( pActiveEntry, nY,
-                    SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER |
-                    SV_LBOXTAB_ADJUST_RIGHT );
+                    SvLBoxTabFlags::PUSHABLE | SvLBoxTabFlags::ADJUST_CENTER |
+                    SvLBoxTabFlags::ADJUST_RIGHT );
         return true;
     }
     else
@@ -1930,8 +1930,8 @@ bool SvImpLBox::MouseMoveCheckCtrl(const MouseEvent& rMEvt, SvTreeListEntry* pEn
                 pActiveButton->SetStateHilighted(true );
                 nY = GetEntryLine( pActiveEntry );
                 pView->PaintEntry1( pActiveEntry, nY,
-                    SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER |
-                    SV_LBOXTAB_ADJUST_RIGHT );
+                    SvLBoxTabFlags::PUSHABLE | SvLBoxTabFlags::ADJUST_CENTER |
+                    SvLBoxTabFlags::ADJUST_RIGHT );
             }
         }
         else
@@ -1940,7 +1940,7 @@ bool SvImpLBox::MouseMoveCheckCtrl(const MouseEvent& rMEvt, SvTreeListEntry* pEn
             {
                 pActiveButton->SetStateHilighted(false );
                 nY = GetEntryLine( pActiveEntry );
-                pView->PaintEntry1( pActiveEntry, nY, SV_LBOXTAB_PUSHABLE );
+                pView->PaintEntry1( pActiveEntry, nY, SvLBoxTabFlags::PUSHABLE );
             }
         }
         return true;
@@ -1961,8 +1961,8 @@ bool SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt )
              pView->GetItem( pActiveEntry, nMouseX ) == pActiveButton )
             pActiveButton->ClickHdl( pView, pActiveEntry );
         pView->PaintEntry1( pActiveEntry, nY,
-                    SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER |
-                    SV_LBOXTAB_ADJUST_RIGHT );
+                    SvLBoxTabFlags::PUSHABLE | SvLBoxTabFlags::ADJUST_CENTER |
+                    SvLBoxTabFlags::ADJUST_RIGHT );
         if( pCursor == pActiveEntry )
             ShowCursor( true );
         pActiveButton = 0;
@@ -2872,7 +2872,7 @@ void SvImpLBox::SelAllDestrAnch(
             {
                 long nY = GetEntryLine( pEntry );
                 if( IsLineVisible( nY ) )
-                    pView->PaintEntry1( pEntry, nY, 0xffff ); // because of ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION );
+                    pView->PaintEntry1( pEntry, nY ); // because of ItemsetBrowser SvLBoxTabFlags::SHOW_SELECTION );
             }
         }
         pEntry = pTree->Next( pEntry );
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index b078a9c..691f894 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -32,7 +32,7 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::accessibility;
 
 #define MYTABMASK \
-    ( SV_LBOXTAB_ADJUST_RIGHT | SV_LBOXTAB_ADJUST_LEFT | SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_ADJUST_NUMERIC )
+    SvLBoxTabFlags( SvLBoxTabFlags::ADJUST_RIGHT | SvLBoxTabFlags::ADJUST_LEFT | SvLBoxTabFlags::ADJUST_CENTER | SvLBoxTabFlags::ADJUST_NUMERIC )
 
 // SvTreeListBox callback
 
@@ -139,7 +139,7 @@ void SvTabListBox::SetTabs(const long* pTabs, MapUnit eMapUnit)
         aSize = LogicToLogic( aSize, &aMMSource, &aMMDest );
         long nNewTab = aSize.Width();
         pTabList[nIdx].SetPos( nNewTab );
-        pTabList[nIdx].nFlags=(SV_LBOXTAB_ADJUST_LEFT| SV_LBOXTAB_INV_ALWAYS);
+        pTabList[nIdx].nFlags=(SvLBoxTabFlags::ADJUST_LEFT| SvLBoxTabFlags::INV_ALWAYS);
     }
     SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS;
     if( IsUpdateMode() )
@@ -473,9 +473,9 @@ void SvTabListBox::SetTabJustify( sal_uInt16 nTab, SvTabJustify eJustify)
     if( nTab >= nTabCount )
         return;
     SvLBoxTab* pTab = &(pTabList[ nTab ]);
-    sal_uInt16 nFlags = pTab->nFlags;
+    SvLBoxTabFlags nFlags = pTab->nFlags;
     nFlags &= (~MYTABMASK);
-    nFlags |= (sal_uInt16)eJustify;
+    nFlags |= static_cast<SvLBoxTabFlags>(eJustify);
     pTab->nFlags = nFlags;
     SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS;
     if( IsUpdateMode() )
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index b30be93..7685334 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -273,10 +273,10 @@ SvLBoxTab::SvLBoxTab()
 {
     nPos = 0;
     pUserData = 0;
-    nFlags = 0;
+    nFlags = SvLBoxTabFlags::NONE;
 }
 
-SvLBoxTab::SvLBoxTab( long nPosition, sal_uInt16 nTabFlags )
+SvLBoxTab::SvLBoxTab( long nPosition, SvLBoxTabFlags nTabFlags )
 {
     nPos = nPosition;
     pUserData = 0;
@@ -298,15 +298,15 @@ SvLBoxTab::~SvLBoxTab()
 long SvLBoxTab::CalcOffset( long nItemWidth, long nTabWidth )
 {
     long nOffset = 0;
-    if ( nFlags & SV_LBOXTAB_ADJUST_RIGHT )
+    if ( nFlags & SvLBoxTabFlags::ADJUST_RIGHT )
     {
         nOffset = nTabWidth - nItemWidth;
         if( nOffset < 0 )
             nOffset = 0;
     }
-    else if ( nFlags & SV_LBOXTAB_ADJUST_CENTER )
+    else if ( nFlags & SvLBoxTabFlags::ADJUST_CENTER )
     {
-        if( nFlags & SV_LBOXTAB_FORCE )
+        if( nFlags & SvLBoxTabFlags::FORCE )
         {
             // correct implementation of centering
             nOffset = ( nTabWidth - nItemWidth ) / 2;
@@ -1641,16 +1641,16 @@ void SvTreeListBox::Resize()
 #define NODE_AND_CHECK_BUTTONS  2
 #define CHECK_BUTTONS           3
 
-#define TABFLAGS_TEXT (SV_LBOXTAB_DYNAMIC |        \
-                       SV_LBOXTAB_ADJUST_LEFT |    \
-                       SV_LBOXTAB_EDITABLE |       \
-                       SV_LBOXTAB_SHOW_SELECTION)
+#define TABFLAGS_TEXT (SvLBoxTabFlags::DYNAMIC |        \
+                       SvLBoxTabFlags::ADJUST_LEFT |    \
+                       SvLBoxTabFlags::EDITABLE |       \
+                       SvLBoxTabFlags::SHOW_SELECTION)
 
-#define TABFLAGS_CONTEXTBMP (SV_LBOXTAB_DYNAMIC | SV_LBOXTAB_ADJUST_CENTER)
+#define TABFLAGS_CONTEXTBMP (SvLBoxTabFlags::DYNAMIC | SvLBoxTabFlags::ADJUST_CENTER)
 
-#define TABFLAGS_CHECKBTN (SV_LBOXTAB_DYNAMIC |        \
-                           SV_LBOXTAB_ADJUST_CENTER |  \
-                           SV_LBOXTAB_PUSHABLE)
+#define TABFLAGS_CHECKBTN (SvLBoxTabFlags::DYNAMIC |        \
+                           SvLBoxTabFlags::ADJUST_CENTER |  \
+                           SvLBoxTabFlags::PUSHABLE)
 
 #define TAB_STARTPOS    2
 
@@ -2861,12 +2861,12 @@ void SvTreeListBox::InvalidateEntry( SvTreeListEntry* pEntry )
     }
 }
 
-long SvTreeListBox::PaintEntry(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nTabFlags)
+long SvTreeListBox::PaintEntry(SvTreeListEntry* pEntry, long nLine, SvLBoxTabFlags nTabFlags)
 {
     return PaintEntry1(pEntry,nLine,nTabFlags);
 }
 
-long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nTabFlags,
+long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, SvLBoxTabFlags nTabFlags,
     bool bHasClipRegion )
 {
 
@@ -2930,7 +2930,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nT
         SvLBoxTab* pNextTab = nNextTab < nTabCount ? aTabs[nNextTab] : 0;
         SvLBoxItem* pItem = nCurItem < nItemCount ? pEntry->GetItem(nCurItem) : 0;
 
-        sal_uInt16 nFlags = pTab->nFlags;
+        SvLBoxTabFlags nFlags = pTab->nFlags;
         Size aSize( SvLBoxItem::GetSize( pViewDataEntry, nCurItem ));
         long nTabPos = GetTabPos( pEntry, pTab );
 
@@ -2945,7 +2945,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nT
         }
 
         long nX;
-        if( pTab->nFlags & SV_LBOXTAB_ADJUST_RIGHT )
+        if( pTab->nFlags & SvLBoxTabFlags::ADJUST_RIGHT )
             // avoid cutting the right edge off the tab separation
             nX = nTabPos + pTab->CalcOffset(aSize.Width(), (nNextTabPos-SV_TAB_BORDER-1) -nTabPos);
         else
@@ -2965,7 +2965,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nT
 
             Wallpaper aWallpaper = GetBackground();
 
-            int bSelTab = nFlags & SV_LBOXTAB_SHOW_SELECTION;
+            bool bSelTab = bool(nFlags & SvLBoxTabFlags::SHOW_SELECTION);
             sal_uInt16 nItemType = pItem->GetType();
 
             if (pViewDataEntry->IsHighlighted() && bSelTab && !pViewDataEntry->IsCursored())
@@ -3186,7 +3186,7 @@ Rectangle SvTreeListBox::GetFocusRect( SvTreeListEntry* pEntry, long nLine )
     nRealWidth -= GetMapMode().GetOrigin().X();
 
     sal_uInt16 nCurTab;
-    SvLBoxTab* pTab = GetFirstTab( SV_LBOXTAB_SHOW_SELECTION, nCurTab );
+    SvLBoxTab* pTab = GetFirstTab( SvLBoxTabFlags::SHOW_SELECTION, nCurTab );
     long nTabPos = 0;
     if( pTab )
         nTabPos = GetTabPos( pEntry, pTab );

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list