summaryrefslogtreecommitdiff
path: root/svtools/inc
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2011-09-12 16:37:50 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2011-09-12 16:40:51 +0200
commitf7ed67f2cf79fd067c1634e8f7c3f8a17792f2e5 (patch)
treed6eee550bdaed7ce0f3f137dadf0dbbbb484c976 /svtools/inc
parentfea84e0041f0dc6c87fc5e2d9c7ff2e70a7dada2 (diff)
cleanup BrowseBox, DbGridControl & friends handle & invalid column handling
- BrowseBox: Check Handle column-related invariants when adding a column: # only one handle column # it is the first - BrowseBox: Check column id-related invariants when adding a column: # Id is not the special "handle column" value # Id is not the special "invalid ID" value # unicity of the ID among columns - GetColumnId: return BROWSER_INVALIDID, not 0 (== id of handle column) for an invalid column; adapt code calling GetColumnId to this change. - Use the correct const or #define'd symbol instead of magic constants; introduce such a symbol if needed - General other miscellaneous cleanups: # Translation of comments # typo/spelling in comments, error messages and the like # parenthesise #define'd value # use SAL_MAX_UINT16 instead of USHRT_MAX where a sal_uInt16 is expected # BrowseBox::SetColumnTitle: nItemId is checked to be non-zero, so don't test if for zeroness again.
Diffstat (limited to 'svtools/inc')
-rw-r--r--svtools/inc/svtools/brwbox.hxx24
1 files changed, 14 insertions, 10 deletions
diff --git a/svtools/inc/svtools/brwbox.hxx b/svtools/inc/svtools/brwbox.hxx
index 42bf18ff62db..326d660a18d0 100644
--- a/svtools/inc/svtools/brwbox.hxx
+++ b/svtools/inc/svtools/brwbox.hxx
@@ -67,8 +67,8 @@ namespace utl {
// - BrowseBox-Types -
// -------------------
-#define BROWSER_INVALIDID USHRT_MAX
-#define BROWSER_ENDOFSELECTION (long)(SFX_ENDOFSELECTION)
+#define BROWSER_INVALIDID SAL_MAX_UINT16
+#define BROWSER_ENDOFSELECTION (static_cast<long>(SFX_ENDOFSELECTION))
typedef sal_uLong BrowserMode;
@@ -76,15 +76,15 @@ typedef sal_uLong BrowserMode;
#define BROWSER_MULTISELECTION 0x0002
#define BROWSER_THUMBDRAGGING 0x0004
#define BROWSER_KEEPHIGHLIGHT 0x0008
-#define BROWSER_KEEPSELECTION BROWSER_KEEPHIGHLIGHT // old, dont use!
+#define BROWSER_KEEPSELECTION BROWSER_KEEPHIGHLIGHT // old, don't use!
#define BROWSER_HLINES 0x0010
#define BROWSER_VLINES 0x0020
-#define BROWSER_HLINESFULL BROWSER_HLINES // old, dont use!
-#define BROWSER_VLINESFULL BROWSER_VLINES // old, dont use!
-#define BROWSER_HLINESDOTS 0x0000 // old => dont use!
-#define BROWSER_VLINESDOTS 0x0000 // old => dont use!
+#define BROWSER_HLINESFULL BROWSER_HLINES // old, don't use!
+#define BROWSER_VLINESFULL BROWSER_VLINES // old, don't use!
+#define BROWSER_HLINESDOTS 0x0000 // old => don't use!
+#define BROWSER_VLINESDOTS 0x0000 // old => don't use!
-#define BROWSER_HIDESELECT 0x0100 // old => dont use!
+#define BROWSER_HIDESELECT 0x0100 // old => don't use!
#define BROWSER_HIDECURSOR 0x0200
#define BROWSER_NO_HSCROLL 0x0400
@@ -98,7 +98,7 @@ typedef sal_uLong BrowserMode;
#define BROWSER_NO_VSCROLL 0x8000
#define BROWSER_HIGHLIGHT_NONE 0x0100 // == BROWSER_HIDESELECT
-#define BROWSER_HIGHLIGHT_TOGGLE 0x00000000 // old default => NULL, dont use!
+#define BROWSER_HIGHLIGHT_TOGGLE 0x00000000 // old default => NULL, don't use!
#define BROWSER_HEADERBAR_NEW 0x00040000
#define BROWSER_AUTOSIZE_LASTCOL 0x00080000
@@ -246,6 +246,10 @@ class SVT_DLLPUBLIC BrowseBox
friend const char* BrowseBoxCheckInvariants( const void * pVoid );
#endif
+public:
+ static const sal_uInt16 HandleColumnId = 0;
+
+private:
Window* pDataWin; // window to display data rows
ScrollBar* pVScroll; // vertical scrollbar
ScrollBar aHScroll; // horizontal scrollbar
@@ -569,7 +573,7 @@ public:
// invalidations
void Clear();
void RowRemoved( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True );
- void RowModified( long nRow, sal_uInt16 nColId = USHRT_MAX );
+ void RowModified( long nRow, sal_uInt16 nColId = BROWSER_INVALIDID );
void RowInserted( long nRow, long nNumRows = 1, sal_Bool bDoPaint = sal_True, sal_Bool bKeepSelection = sal_False );
// miscellanous