summaryrefslogtreecommitdiff
path: root/include/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-21 15:53:44 +0200
committerNoel Grandin <noel@peralex.com>2015-04-22 10:28:41 +0200
commit2884e9be256207d0876e6d67300a85462801778b (patch)
tree074c75b539f905bbd91fb294e233d5038b19ce1c /include/svtools
parent1b5f6935a498c1d9eea35ba0aa2edd25ee11ca47 (diff)
convert SVLBOX_ constants to scoped enum
Change-Id: Ibe384ffae00e045ccfa7d3f7f080f8eb6b3149a9
Diffstat (limited to 'include/svtools')
-rw-r--r--include/svtools/treelistbox.hxx40
1 files changed, 24 insertions, 16 deletions
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx
index cd0ab60f1efa..3f74b4c7fa37 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;