diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-16 15:41:10 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-22 10:28:39 +0200 |
commit | 0578aa4de27cc960cd3709eb2e15f40e02e1272d (patch) | |
tree | 295966c066e2760f4322273d970fa02fe5e0c84a | |
parent | f87e0957cdcbf9ee12e0615b55a1bb1de1d70efb (diff) |
convert BROWSER_ constants to scoped enum
and fix a couple of places where it was mixing these flags up with the
WinBits flags and calling the wrong constructor.
Change-Id: I65c66bdd5a263e2f1db179c853f3f00e9ac7659e
-rw-r--r-- | chart2/source/controller/dialogs/DataBrowser.cxx | 14 | ||||
-rw-r--r-- | cui/source/options/connpooloptions.cxx | 3 | ||||
-rw-r--r-- | dbaccess/source/ui/control/RelationControl.cxx | 17 | ||||
-rw-r--r-- | dbaccess/source/ui/control/TableGrantCtrl.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/indexfieldscontrol.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx | 34 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TEditControl.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/tabledesign/TableDesignControl.cxx | 10 | ||||
-rw-r--r-- | include/svtools/brwbox.hxx | 68 | ||||
-rw-r--r-- | include/svtools/editbrowsebox.hxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/GroupsSorting.cxx | 11 | ||||
-rw-r--r-- | svtools/source/brwbox/brwbox1.cxx | 44 | ||||
-rw-r--r-- | svtools/source/brwbox/datwin.hxx | 2 | ||||
-rw-r--r-- | svtools/source/brwbox/editbrowsebox.cxx | 2 | ||||
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 60 | ||||
-rw-r--r-- | svx/source/gallery2/galctrl.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdibrow.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 16 |
18 files changed, 153 insertions, 154 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index f430d3723fce..7fae410c9c4e 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -52,23 +52,23 @@ #include <algorithm> #include <functional> -/* BROWSER_COLUMNSELECTION : single cells may be selected rather than only +/* BrowserMode::COLUMNSELECTION : single cells may be selected rather than only entire rows BROWSER_(H|V)LINES : show horizontal or vertical grid-lines BROWSER_AUTO_(H|V)SCROLL : scroll automated horizontally or vertically when cursor is moved beyond the edge of the dialog - BROWSER_HIGHLIGHT_NONE : Do not mark the current row with selection color + BrowserMode::HIDESELECT : Do not mark the current row with selection color (usually blue) */ #define BROWSER_STANDARD_FLAGS \ - BROWSER_COLUMNSELECTION | \ - BROWSER_HLINES | BROWSER_VLINES | \ - BROWSER_AUTO_HSCROLL | BROWSER_AUTO_VSCROLL | \ - BROWSER_HIGHLIGHT_NONE + BrowserMode::COLUMNSELECTION | \ + BrowserMode::HLINES | BrowserMode::VLINES | \ + BrowserMode::AUTO_HSCROLL | BrowserMode::AUTO_VSCROLL | \ + BrowserMode::HIDESELECT -// BROWSER_HIDECURSOR would prevent flickering in edit fields, but navigating +// BrowserMode::HIDECURSOR would prevent flickering in edit fields, but navigating // with shift up/down, and entering non-editable cells would be problematic, // e.g. the first cell, or when being in read-only mode diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx index 3d432698e0fc..bd71f71c08ab 100644 --- a/cui/source/options/connpooloptions.cxx +++ b/cui/source/options/connpooloptions.cxx @@ -88,7 +88,8 @@ namespace offapp DriverListControl::DriverListControl(vcl::Window* _pParent) - :EditBrowseBox(_pParent, EBBF_NOROWPICTURE, BROWSER_AUTO_VSCROLL | BROWSER_AUTO_HSCROLL | BROWSER_HIDECURSOR | BROWSER_AUTOSIZE_LASTCOL | WB_BORDER) + :EditBrowseBox(_pParent, EBBF_NOROWPICTURE, WB_BORDER, + BrowserMode::AUTO_VSCROLL | BrowserMode::AUTO_HSCROLL | BrowserMode::HIDECURSOR | BrowserMode::AUTOSIZE_LASTCOL | BrowserMode::KEEPHIGHLIGHT) ,m_aSeekRow(m_aSettings.end()) ,m_sYes(CUI_RES(RID_SVXSTR_YES)) ,m_sNo(CUI_RES(RID_SVXSTR_NO)) diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index 9621b71ba04a..0ae9329e2f65 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -130,7 +130,8 @@ namespace dbaui ORelationControl::ORelationControl(vcl::Window *pParent) : EditBrowseBox(pParent, EBBF_SMART_TAB_TRAVEL | EBBF_NOROWPICTURE, - WB_TABSTOP | WB_BORDER | BROWSER_AUTOSIZE_LASTCOL) + WB_TABSTOP | WB_BORDER, + BrowserMode::AUTOSIZE_LASTCOL) , m_pBoxControl(NULL) , m_nDataPos(0) , m_xSourceDef(NULL) @@ -172,13 +173,13 @@ namespace dbaui m_pListCell.reset( new ListBoxControl( &GetDataWindow() ) ); // set browse mode - SetMode( BROWSER_COLUMNSELECTION | - BROWSER_HLINESFULL | - BROWSER_VLINESFULL | - BROWSER_HIDECURSOR | - BROWSER_HIDESELECT | - BROWSER_AUTO_HSCROLL | - BROWSER_AUTO_VSCROLL); + SetMode( BrowserMode::COLUMNSELECTION | + BrowserMode::HLINES | + BrowserMode::VLINES | + BrowserMode::HIDECURSOR | + BrowserMode::HIDESELECT | + BrowserMode::AUTO_HSCROLL | + BrowserMode::AUTO_VSCROLL); } else // not the first call diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx index ce73d137ac7a..d32c49e2a264 100644 --- a/dbaccess/source/ui/control/TableGrantCtrl.cxx +++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx @@ -132,8 +132,8 @@ void OTableGrantControl::Init() UpdateTables(); // Browser Mode setzen - BrowserMode nMode = BROWSER_COLUMNSELECTION | BROWSER_HLINESFULL | BROWSER_VLINESFULL | - BROWSER_HIDECURSOR | BROWSER_HIDESELECT; + BrowserMode nMode = BrowserMode::COLUMNSELECTION | BrowserMode::HLINES | BrowserMode::VLINES | + BrowserMode::HIDECURSOR | BrowserMode::HIDESELECT; SetMode(nMode); } diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index b4c8800fce7b..bd9e978265ff 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -27,8 +27,8 @@ namespace dbaui { -#define BROWSER_STANDARD_FLAGS BROWSER_COLUMNSELECTION | BROWSER_HLINESFULL | BROWSER_VLINESFULL | \ - BROWSER_HIDECURSOR | BROWSER_HIDESELECT | BROWSER_AUTO_HSCROLL | BROWSER_AUTO_VSCROLL +#define BROWSER_STANDARD_FLAGS BrowserMode::COLUMNSELECTION | BrowserMode::HLINES | BrowserMode::VLINES | \ + BrowserMode::HIDECURSOR | BrowserMode::HIDESELECT | BrowserMode::AUTO_HSCROLL | BrowserMode::AUTO_VSCROLL #define COLUMN_ID_FIELDNAME 1 #define COLUMN_ID_ORDER 2 diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index c454e2d6b44a..dfbbae2d4812 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -96,8 +96,8 @@ namespace } OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent ) - :EditBrowseBox( pParent,EBBF_NOROWPICTURE, WB_3DLOOK, BROWSER_COLUMNSELECTION | BROWSER_KEEPSELECTION | BROWSER_HIDESELECT | - BROWSER_HIDECURSOR | BROWSER_HLINESFULL | BROWSER_VLINESFULL ) + :EditBrowseBox( pParent,EBBF_NOROWPICTURE, WB_3DLOOK, BrowserMode::COLUMNSELECTION | BrowserMode::KEEPHIGHLIGHT | BrowserMode::HIDESELECT | + BrowserMode::HIDECURSOR | BrowserMode::HLINES | BrowserMode::VLINES ) ,m_nSeekRow(0) ,m_nMaxColumns(0) ,m_aFunctionStrings(ModuleRes(STR_QUERY_FUNCTIONS)) @@ -112,10 +112,10 @@ OSelectionBrowseBox::OSelectionBrowseBox( vcl::Window* pParent ) { SetHelpId(HID_CTL_QRYDGNCRIT); - m_nMode = BROWSER_COLUMNSELECTION | BROWSER_HIDESELECT - | BROWSER_KEEPSELECTION | BROWSER_HIDECURSOR - | BROWSER_HLINESFULL | BROWSER_VLINESFULL - | BROWSER_HEADERBAR_NEW ; + m_nMode = BrowserMode::COLUMNSELECTION | BrowserMode::HIDESELECT + | BrowserMode::KEEPHIGHLIGHT | BrowserMode::HIDECURSOR + | BrowserMode::HLINES | BrowserMode::VLINES + | BrowserMode::HEADERBAR_NEW ; m_pTextCell = new Edit(&GetDataWindow(), 0); m_pVisibleCell = new CheckBoxControl(&GetDataWindow()); @@ -263,10 +263,10 @@ namespace { m_pBrowseBox->DeactivateCell(); // we are in the right mode if a row hase been selected row - if ( BROWSER_HIDESELECT == ( nMode & BROWSER_HIDESELECT ) ) + if ( BrowserMode::HIDESELECT == ( nMode & BrowserMode::HIDESELECT ) ) { - nMode &= ~BROWSER_HIDESELECT; - nMode |= BROWSER_MULTISELECTION; + nMode &= ~BrowserMode::HIDESELECT; + nMode |= BrowserMode::MULTISELECTION; m_pBrowseBox->SetMode( nMode ); } } @@ -407,12 +407,12 @@ void OSelectionBrowseBox::SetReadOnly(bool bRO) if (bRO) { DeactivateCell(); - m_nMode &= ~BROWSER_HIDECURSOR; + m_nMode &= ~BrowserMode::HIDECURSOR; SetMode(m_nMode); } else { - m_nMode |= BROWSER_HIDECURSOR; + m_nMode |= BrowserMode::HIDECURSOR; SetMode(m_nMode); ActivateCell(); } @@ -1300,22 +1300,22 @@ void OSelectionBrowseBox::adjustSelectionMode( bool _bClickedOntoHeader, bool _b { if (0 == GetSelectColumnCount() ) // I am in the correct mode if a selected column exists - if ( BROWSER_HIDESELECT == ( m_nMode & BROWSER_HIDESELECT ) ) + if ( BrowserMode::HIDESELECT == ( m_nMode & BrowserMode::HIDESELECT ) ) { - m_nMode &= ~BROWSER_HIDESELECT; - m_nMode |= BROWSER_MULTISELECTION; + m_nMode &= ~BrowserMode::HIDESELECT; + m_nMode |= BrowserMode::MULTISELECTION; SetMode( m_nMode ); } } - else if ( BROWSER_HIDESELECT != ( m_nMode & BROWSER_HIDESELECT ) ) + else if ( BrowserMode::HIDESELECT != ( m_nMode & BrowserMode::HIDESELECT ) ) { if ( GetSelectColumnCount() != 0 ) SetNoSelection(); if ( _bClickedOntoHandleCol ) { - m_nMode |= BROWSER_HIDESELECT; - m_nMode &= ~BROWSER_MULTISELECTION; + m_nMode |= BrowserMode::HIDESELECT; + m_nMode &= ~BrowserMode::MULTISELECTION; SetMode( m_nMode ); } } diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index d8b907d4183e..fa78833bfb2a 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -177,10 +177,10 @@ void OTableEditorCtrl::SetReadOnly( bool bRead ) DeactivateCell(); // Select the correct Browsers cursor - BrowserMode nMode(BROWSER_COLUMNSELECTION | BROWSER_MULTISELECTION | BROWSER_KEEPSELECTION | - BROWSER_HLINESFULL | BROWSER_VLINESFULL|BROWSER_AUTOSIZE_LASTCOL); + BrowserMode nMode(BrowserMode::COLUMNSELECTION | BrowserMode::MULTISELECTION | BrowserMode::KEEPHIGHLIGHT | + BrowserMode::HLINES | BrowserMode::VLINES|BrowserMode::AUTOSIZE_LASTCOL); if( !bReadOnly ) - nMode |= BROWSER_HIDECURSOR; + nMode |= BrowserMode::HIDECURSOR; SetMode(nMode); if( !bReadOnly ) diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx index f4348d5ebdfb..1bda40e23fd2 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx @@ -36,8 +36,8 @@ using namespace ::com::sun::star::util; OTableRowView::OTableRowView(vcl::Window* pParent) :EditBrowseBox(pParent, ModuleRes(RID_DB_TAB_EDITOR),EBBF_NONE, - BROWSER_COLUMNSELECTION | BROWSER_MULTISELECTION | BROWSER_AUTOSIZE_LASTCOL | - BROWSER_KEEPSELECTION | BROWSER_HLINESFULL | BROWSER_VLINESFULL) + BrowserMode::COLUMNSELECTION | BrowserMode::MULTISELECTION | BrowserMode::AUTOSIZE_LASTCOL | + BrowserMode::KEEPHIGHLIGHT | BrowserMode::HLINES | BrowserMode::VLINES) ,m_nDataPos(-1) ,m_nCurrentPos(-1) ,m_nCurUndoActId(0) @@ -69,10 +69,10 @@ void OTableRowView::Init() // set up HandleColumn for at maximum 5 digits InsertHandleColumn(static_cast<sal_uInt16>(GetTextWidth(OUString('0')) * 4)/*, sal_True */); - BrowserMode nMode = BROWSER_COLUMNSELECTION | BROWSER_MULTISELECTION | BROWSER_KEEPSELECTION | - BROWSER_HLINESFULL | BROWSER_VLINESFULL | BROWSER_AUTOSIZE_LASTCOL; + BrowserMode nMode = BrowserMode::COLUMNSELECTION | BrowserMode::MULTISELECTION | BrowserMode::KEEPHIGHLIGHT | + BrowserMode::HLINES | BrowserMode::VLINES | BrowserMode::AUTOSIZE_LASTCOL; if (IsUpdatable()) - nMode |= BROWSER_HIDECURSOR; + nMode |= BrowserMode::HIDECURSOR; SetMode(nMode); } diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx index 9248d6134667..6c29a0cd3c66 100644 --- a/include/svtools/brwbox.hxx +++ b/include/svtools/brwbox.hxx @@ -32,6 +32,7 @@ #include <limits.h> #include <memory> +#include <o3tl/typed_flags_set.hxx> class BrowserColumn; class BrowserDataWin; @@ -55,48 +56,47 @@ namespace utl { #define BROWSER_INVALIDID SAL_MAX_UINT16 #define BROWSER_ENDOFSELECTION (static_cast<long>(SFX_ENDOFSELECTION)) -typedef sal_uLong BrowserMode; - -#define BROWSER_COLUMNSELECTION 0x0001 -#define BROWSER_MULTISELECTION 0x0002 -#define BROWSER_THUMBDRAGGING 0x0004 -#define BROWSER_KEEPHIGHLIGHT 0x0008 -#define BROWSER_KEEPSELECTION BROWSER_KEEPHIGHLIGHT // old, don't use! -#define BROWSER_HLINES 0x0010 -#define BROWSER_VLINES 0x0020 -#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 => don't use! -#define BROWSER_HIDECURSOR 0x0200 +enum class BrowserMode +{ + NONE = 0x000000, + COLUMNSELECTION = 0x000001, + MULTISELECTION = 0x000002, + THUMBDRAGGING = 0x000004, + KEEPHIGHLIGHT = 0x000008, + HLINES = 0x000010, + VLINES = 0x000020, -#define BROWSER_NO_HSCROLL 0x0400 -#define BROWSER_NO_SCROLLBACK 0x0800 + HIDESELECT = 0x000100, // old => don't use! + HIDECURSOR = 0x000200, -#define BROWSER_AUTO_VSCROLL 0x1000 -#define BROWSER_AUTO_HSCROLL 0x2000 + NO_HSCROLL = 0x000400, + NO_SCROLLBACK = 0x000800, -#define BROWSER_TRACKING_TIPS 0x4000 + AUTO_VSCROLL = 0x001000, + AUTO_HSCROLL = 0x002000, -#define BROWSER_NO_VSCROLL 0x8000 + TRACKING_TIPS = 0x004000, -#define BROWSER_HIGHLIGHT_NONE 0x0100 // == BROWSER_HIDESELECT + NO_VSCROLL = 0x008000, -#define BROWSER_HEADERBAR_NEW 0x00040000 -#define BROWSER_AUTOSIZE_LASTCOL 0x00080000 -#define BROWSER_OWN_DATACHANGED 0x00100000 + HEADERBAR_NEW = 0x040000, + AUTOSIZE_LASTCOL = 0x080000, + OWN_DATACHANGED = 0x100000, -#define BROWSER_CURSOR_WO_FOCUS 0x00200000 + CURSOR_WO_FOCUS = 0x200000, // Allows a cursor which is shown even if the control does not have the focus. This does not affect other // situations which require to temporarily hide the cursor (such as scrolling). -#define BROWSER_SMART_HIDECURSOR 0x00400000 - // is an enhanced version of BROWSER_HIDECURSOR. - // When set, BROWSER_HIDECURSOR is overruled, and the cursor is hidden as long as no selection exists, + SMART_HIDECURSOR = 0x400000, + // is an enhanced version of BrowserMode::HIDECURSOR. + // When set, BrowserMode::HIDECURSOR is overruled, and the cursor is hidden as long as no selection exists, // but shown otherwise. This does not affect other situations which require to temporarily hide the // cursor (such as scrolling). +}; +namespace o3tl +{ + template<> struct typed_flags<BrowserMode> : is_typed_flags<BrowserMode, 0x7aff3f> {}; +} #define BROWSER_NONE 0 #define BROWSER_SELECT 720 @@ -232,8 +232,6 @@ private: bool bHLines; // draw lines between rows bool bVLines; // draw lines between columns - bool bHDots; // draw lines between rows dotted - bool bVDots; // draw lines between columns dotted Color aGridLineColor; // color for lines, default dark grey bool bBootstrapped; // child windows resized etc. long nTopRow; // no. of first visible row (0...) @@ -422,9 +420,9 @@ protected: public: BrowseBox( vcl::Window* pParent, WinBits nBits = 0, - BrowserMode nMode = 0 ); + BrowserMode nMode = BrowserMode::NONE ); BrowseBox( vcl::Window* pParent, const ResId& rId, - BrowserMode nMode = 0 ); + BrowserMode nMode = BrowserMode::NONE ); virtual ~BrowseBox(); // override inherited handler @@ -566,7 +564,7 @@ public: Rectangle GetControlArea() const; bool ProcessKey( const KeyEvent& rEvt ); void Dispatch( sal_uInt16 nId ); - void SetMode( BrowserMode nMode = 0 ); + void SetMode( BrowserMode nMode = BrowserMode::NONE ); BrowserMode GetMode( ) const { return m_nCurrentMode; } void SetCursorColor(const Color& _rCol); diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx index 30789c325c56..bc534d72453a 100644 --- a/include/svtools/editbrowsebox.hxx +++ b/include/svtools/editbrowsebox.hxx @@ -590,8 +590,8 @@ namespace svt // secure starting of StartEditHdl public: - EditBrowseBox(vcl::Window* pParent, sal_Int32 nBrowserFlags = EBBF_NONE, WinBits nBits = WB_TABSTOP, BrowserMode nMode = 0 ); - EditBrowseBox(vcl::Window* pParent, const ResId& rId, sal_Int32 nBrowserFlags = EBBF_NONE, BrowserMode nMode = 0 ); + EditBrowseBox(vcl::Window* pParent, sal_Int32 nBrowserFlags = EBBF_NONE, WinBits nBits = WB_TABSTOP, BrowserMode nMode = BrowserMode::NONE ); + EditBrowseBox(vcl::Window* pParent, const ResId& rId, sal_Int32 nBrowserFlags = EBBF_NONE, BrowserMode nMode = BrowserMode::NONE ); virtual ~EditBrowseBox(); bool IsEditing() const {return aController.Is();} diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index b6e687dc7c55..6b20efa6c1da 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -165,8 +165,9 @@ public: // class OFieldExpressionControl OFieldExpressionControl::OFieldExpressionControl(OGroupsSortingDialog* _pParentDialog, vcl::Window *_pParent) - :EditBrowseBox( _pParent, EBBF_NONE, WB_TABSTOP | BROWSER_COLUMNSELECTION | BROWSER_MULTISELECTION | BROWSER_AUTOSIZE_LASTCOL | - BROWSER_KEEPSELECTION | BROWSER_HLINESFULL | BROWSER_VLINESFULL) + :EditBrowseBox( _pParent, EBBF_NONE, WB_TABSTOP, + BrowserMode::COLUMNSELECTION | BrowserMode::MULTISELECTION | BrowserMode::AUTOSIZE_LASTCOL | + BrowserMode::KEEPHIGHLIGHT | BrowserMode::HLINES | BrowserMode::VLINES) ,m_aGroupPositions(GROUPS_START_LEN,-1) ,m_pComboCell(NULL) ,m_nDataPos(-1) @@ -364,10 +365,10 @@ void OFieldExpressionControl::lateInit() // set browse mode - BrowserMode nMode(BROWSER_COLUMNSELECTION | BROWSER_MULTISELECTION | BROWSER_KEEPSELECTION | - BROWSER_HLINESFULL | BROWSER_VLINESFULL | BROWSER_AUTOSIZE_LASTCOL | BROWSER_AUTO_VSCROLL | BROWSER_AUTO_HSCROLL); + BrowserMode nMode(BrowserMode::COLUMNSELECTION | BrowserMode::MULTISELECTION | BrowserMode::KEEPHIGHLIGHT | + BrowserMode::HLINES | BrowserMode::VLINES | BrowserMode::AUTOSIZE_LASTCOL | BrowserMode::AUTO_VSCROLL | BrowserMode::AUTO_HSCROLL); if( m_pParent->isReadOnly() ) - nMode |= BROWSER_HIDECURSOR; + nMode |= BrowserMode::HIDECURSOR; SetMode(nMode); xGroups->addContainerListener(this); } diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 67353f473e22..4f87dfd563d5 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -97,7 +97,7 @@ void BrowseBox::ConstructImpl( BrowserMode nMode ) nRowCount = 0; m_bFocusOnlyCursor = true; m_aCursorColor = COL_TRANSPARENT; - m_nCurrentMode = 0; + m_nCurrentMode = BrowserMode::NONE; nControlAreaWidth = USHRT_MAX; uRow.nSel = BROWSER_ENDOFSELECTION; @@ -2223,10 +2223,10 @@ Rectangle BrowseBox::GetControlArea() const void BrowseBox::SetMode( BrowserMode nMode ) { - getDataWindow()->bAutoHScroll = BROWSER_AUTO_HSCROLL == ( nMode & BROWSER_AUTO_HSCROLL ); - getDataWindow()->bAutoVScroll = BROWSER_AUTO_VSCROLL == ( nMode & BROWSER_AUTO_VSCROLL ); - getDataWindow()->bNoHScroll = BROWSER_NO_HSCROLL == ( nMode & BROWSER_NO_HSCROLL ); - getDataWindow()->bNoVScroll = BROWSER_NO_VSCROLL == ( nMode & BROWSER_NO_VSCROLL ); + getDataWindow()->bAutoHScroll = BrowserMode::AUTO_HSCROLL == ( nMode & BrowserMode::AUTO_HSCROLL ); + getDataWindow()->bAutoVScroll = BrowserMode::AUTO_VSCROLL == ( nMode & BrowserMode::AUTO_VSCROLL ); + getDataWindow()->bNoHScroll = BrowserMode::NO_HSCROLL == ( nMode & BrowserMode::NO_HSCROLL ); + getDataWindow()->bNoVScroll = BrowserMode::NO_VSCROLL == ( nMode & BrowserMode::NO_VSCROLL ); DBG_ASSERT( !( getDataWindow()->bAutoHScroll && getDataWindow()->bNoHScroll ), "BrowseBox::SetMode: AutoHScroll *and* NoHScroll?" ); @@ -2243,7 +2243,7 @@ void BrowseBox::SetMode( BrowserMode nMode ) nControlAreaWidth = USHRT_MAX; getDataWindow()->bNoScrollBack = - BROWSER_NO_SCROLLBACK == ( nMode & BROWSER_NO_SCROLLBACK); + BrowserMode::NO_SCROLLBACK == ( nMode & BrowserMode::NO_SCROLLBACK); long nOldRowSel = bMultiSelection ? uRow.pSel->FirstSelected() : uRow.nSel; MultiSelection *pOldRowSel = bMultiSelection ? uRow.pSel : 0; @@ -2251,34 +2251,32 @@ void BrowseBox::SetMode( BrowserMode nMode ) delete pVScroll; - bThumbDragging = ( nMode & BROWSER_THUMBDRAGGING ) == BROWSER_THUMBDRAGGING; - bMultiSelection = ( nMode & BROWSER_MULTISELECTION ) == BROWSER_MULTISELECTION; - bColumnCursor = ( nMode & BROWSER_COLUMNSELECTION ) == BROWSER_COLUMNSELECTION; - bKeepHighlight = ( nMode & BROWSER_KEEPSELECTION ) == BROWSER_KEEPSELECTION; + bThumbDragging = ( nMode & BrowserMode::THUMBDRAGGING ) == BrowserMode::THUMBDRAGGING; + bMultiSelection = ( nMode & BrowserMode::MULTISELECTION ) == BrowserMode::MULTISELECTION; + bColumnCursor = ( nMode & BrowserMode::COLUMNSELECTION ) == BrowserMode::COLUMNSELECTION; + bKeepHighlight = ( nMode & BrowserMode::KEEPHIGHLIGHT ) == BrowserMode::KEEPHIGHLIGHT; - bHideSelect = ((nMode & BROWSER_HIDESELECT) == BROWSER_HIDESELECT); + bHideSelect = ((nMode & BrowserMode::HIDESELECT) == BrowserMode::HIDESELECT); // default: do not hide the cursor at all (untaken scrolling and such) bHideCursor = TRISTATE_FALSE; - if ( BROWSER_SMART_HIDECURSOR == ( nMode & BROWSER_SMART_HIDECURSOR ) ) + if ( BrowserMode::SMART_HIDECURSOR == ( nMode & BrowserMode::SMART_HIDECURSOR ) ) { // smart cursor hide overrules hard cursor hide bHideCursor = TRISTATE_INDET; } - else if ( BROWSER_HIDECURSOR == ( nMode & BROWSER_HIDECURSOR ) ) + else if ( BrowserMode::HIDECURSOR == ( nMode & BrowserMode::HIDECURSOR ) ) { bHideCursor = TRISTATE_TRUE; } - m_bFocusOnlyCursor = ((nMode & BROWSER_CURSOR_WO_FOCUS) == 0); + m_bFocusOnlyCursor = ((nMode & BrowserMode::CURSOR_WO_FOCUS) == BrowserMode::NONE); - bHLines = ( nMode & BROWSER_HLINESFULL ) == BROWSER_HLINESFULL; - bVLines = ( nMode & BROWSER_VLINESFULL ) == BROWSER_VLINESFULL; - bHDots = ( nMode & BROWSER_HLINESDOTS ) == BROWSER_HLINESDOTS; - bVDots = ( nMode & BROWSER_VLINESDOTS ) == BROWSER_VLINESDOTS; + bHLines = ( nMode & BrowserMode::HLINES ) == BrowserMode::HLINES; + bVLines = ( nMode & BrowserMode::VLINES ) == BrowserMode::VLINES; WinBits nVScrollWinBits = - WB_VSCROLL | ( ( nMode & BROWSER_THUMBDRAGGING ) ? WB_DRAG : 0 ); - pVScroll = ( nMode & BROWSER_TRACKING_TIPS ) == BROWSER_TRACKING_TIPS + WB_VSCROLL | ( ( nMode & BrowserMode::THUMBDRAGGING ) ? WB_DRAG : 0 ); + pVScroll = ( nMode & BrowserMode::TRACKING_TIPS ) == BrowserMode::TRACKING_TIPS ? new BrowserScrollBar( this, nVScrollWinBits, static_cast<BrowserDataWin*>( pDataWin ) ) : new ScrollBar( this, nVScrollWinBits ); @@ -2288,13 +2286,13 @@ void BrowseBox::SetMode( BrowserMode nMode ) pVScroll->SetEndScrollHdl( LINK( this, BrowseBox, EndScrollHdl ) ); getDataWindow()->bAutoSizeLastCol = - BROWSER_AUTOSIZE_LASTCOL == ( nMode & BROWSER_AUTOSIZE_LASTCOL ); + BrowserMode::AUTOSIZE_LASTCOL == ( nMode & BrowserMode::AUTOSIZE_LASTCOL ); getDataWindow()->bOwnDataChangedHdl = - BROWSER_OWN_DATACHANGED == ( nMode & BROWSER_OWN_DATACHANGED ); + BrowserMode::OWN_DATACHANGED == ( nMode & BrowserMode::OWN_DATACHANGED ); // create a headerbar. what happens, if a headerbar has to be created and // there already are columns? - if ( BROWSER_HEADERBAR_NEW == ( nMode & BROWSER_HEADERBAR_NEW ) ) + if ( BrowserMode::HEADERBAR_NEW == ( nMode & BrowserMode::HEADERBAR_NEW ) ) { if (!getDataWindow()->pHeaderBar) getDataWindow()->pHeaderBar = CreateHeaderBar( this ); diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx index ef9cca2a51f8..4195d0a2ccf6 100644 --- a/svtools/source/brwbox/datwin.hxx +++ b/svtools/source/brwbox/datwin.hxx @@ -103,7 +103,7 @@ class BrowserDataWin ,public DropTargetHelper { public: - BrowserHeader* pHeaderBar; // only for BROWSER_HEADERBAR_NEW + BrowserHeader* pHeaderBar; // only for BrowserMode::HEADERBAR_NEW vcl::Window* pEventWin; // Window of forwarded events ScrollBarBox* pCornerWin; // Window in the corner btw the ScrollBars bool bInDtor; diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index c48a0a924943..cf045780561c 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -1092,7 +1092,7 @@ namespace svt Rectangle EditBrowseBox::GetCellRect(long nRow, sal_uInt16 nColId, bool bRel) const { Rectangle aRect( GetFieldRectPixel(nRow, nColId, bRel)); - if ((GetMode() & BROWSER_CURSOR_WO_FOCUS) == BROWSER_CURSOR_WO_FOCUS) + if ((GetMode() & BrowserMode::CURSOR_WO_FOCUS) == BrowserMode::CURSOR_WO_FOCUS) { aRect.Top() += 1; aRect.Bottom() -= 1; diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 0960111ef01a..d44ca658801f 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -77,13 +77,13 @@ using namespace com::sun::star::accessibility; #define ROWSTATUS(row) (!row.Is() ? "NULL" : row->GetStatus() == GRS_CLEAN ? "CLEAN" : row->GetStatus() == GRS_MODIFIED ? "MODIFIED" : row->GetStatus() == GRS_DELETED ? "DELETED" : "INVALID") #define DEFAULT_BROWSE_MODE \ - BROWSER_COLUMNSELECTION \ - | BROWSER_MULTISELECTION \ - | BROWSER_KEEPSELECTION \ - | BROWSER_TRACKING_TIPS \ - | BROWSER_HLINESFULL \ - | BROWSER_VLINESFULL \ - | BROWSER_HEADERBAR_NEW \ + BrowserMode::COLUMNSELECTION \ + | BrowserMode::MULTISELECTION \ + | BrowserMode::KEEPHIGHLIGHT \ + | BrowserMode::TRACKING_TIPS \ + | BrowserMode::HLINES \ + | BrowserMode::VLINES \ + | BrowserMode::HEADERBAR_NEW \ class RowSetEventListener : public ::cppu::WeakImplHelper1<XRowsChangeListener> { @@ -1141,26 +1141,26 @@ namespace if ( !_bNavigationBar ) { - _rMode &= ~BROWSER_AUTO_HSCROLL; + _rMode &= ~BrowserMode::AUTO_HSCROLL; } if ( _bHideScrollbars ) { - _rMode |= ( BROWSER_NO_HSCROLL | BROWSER_NO_VSCROLL ); - _rMode &= ~( BROWSER_AUTO_HSCROLL | BROWSER_AUTO_VSCROLL ); + _rMode |= ( BrowserMode::NO_HSCROLL | BrowserMode::NO_VSCROLL ); + _rMode &= ~BrowserMode( BrowserMode::AUTO_HSCROLL | BrowserMode::AUTO_VSCROLL ); } else { - _rMode |= ( BROWSER_AUTO_HSCROLL | BROWSER_AUTO_VSCROLL ); - _rMode &= ~( BROWSER_NO_HSCROLL | BROWSER_NO_VSCROLL ); + _rMode |= ( BrowserMode::AUTO_HSCROLL | BrowserMode::AUTO_VSCROLL ); + _rMode &= ~BrowserMode( BrowserMode::NO_HSCROLL | BrowserMode::NO_VSCROLL ); } // note: if we have a navigation bar, we always have a AUTO_HSCROLL. In particular, // _bHideScrollbars is ignored then if ( _bNavigationBar ) { - _rMode |= BROWSER_AUTO_HSCROLL; - _rMode &= ~BROWSER_NO_HSCROLL; + _rMode |= BrowserMode::AUTO_HSCROLL; + _rMode &= ~BrowserMode::NO_HSCROLL; } return nOldMode != _rMode; @@ -1233,15 +1233,15 @@ sal_uInt16 DbGridControl::SetOptions(sal_uInt16 nOpt) // the 'update' option only affects our BrowserMode (with or w/o focus rect) BrowserMode nNewMode = m_nMode; - if ((m_nMode & BROWSER_CURSOR_WO_FOCUS) == 0) + if (!(m_nMode & BrowserMode::CURSOR_WO_FOCUS)) { if (nOpt & OPT_UPDATE) - nNewMode |= BROWSER_HIDECURSOR; + nNewMode |= BrowserMode::HIDECURSOR; else - nNewMode &= ~BROWSER_HIDECURSOR; + nNewMode &= ~BrowserMode::HIDECURSOR; } else - nNewMode &= ~BROWSER_HIDECURSOR; + nNewMode &= ~BrowserMode::HIDECURSOR; // should not be necessary if EnablePermanentCursor is used to change the cursor behaviour, but to be sure ... if (nNewMode != m_nMode) @@ -1299,17 +1299,17 @@ void DbGridControl::EnablePermanentCursor(bool bEnable) if (bEnable) { - m_nMode &= ~BROWSER_HIDECURSOR; // without this BROWSER_CURSOR_WO_FOCUS won't have any affect - m_nMode |= BROWSER_CURSOR_WO_FOCUS; + m_nMode &= ~BrowserMode::HIDECURSOR; // without this BrowserMode::CURSOR_WO_FOCUS won't have any affect + m_nMode |= BrowserMode::CURSOR_WO_FOCUS; } else { if (m_nOptions & OPT_UPDATE) - m_nMode |= BROWSER_HIDECURSOR; // no cursor at all + m_nMode |= BrowserMode::HIDECURSOR; // no cursor at all else - m_nMode &= ~BROWSER_HIDECURSOR; // at least the "non-permanent" cursor + m_nMode &= ~BrowserMode::HIDECURSOR; // at least the "non-permanent" cursor - m_nMode &= ~BROWSER_CURSOR_WO_FOCUS; + m_nMode &= ~BrowserMode::CURSOR_WO_FOCUS; } SetMode(m_nMode); @@ -1321,7 +1321,7 @@ void DbGridControl::EnablePermanentCursor(bool bEnable) bool DbGridControl::IsPermanentCursorEnabled() const { - return ((m_nMode & BROWSER_CURSOR_WO_FOCUS) != 0) && ((m_nMode & BROWSER_HIDECURSOR) == 0); + return (m_nMode & BrowserMode::CURSOR_WO_FOCUS) && !(m_nMode & BrowserMode::HIDECURSOR); } void DbGridControl::refreshController(sal_uInt16 _nColId, GrantControlAccess /*_aAccess*/) @@ -1464,20 +1464,20 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt if ( bPermanentCursor ) { - m_nMode |= BROWSER_CURSOR_WO_FOCUS; - m_nMode &= ~BROWSER_HIDECURSOR; + m_nMode |= BrowserMode::CURSOR_WO_FOCUS; + m_nMode &= ~BrowserMode::HIDECURSOR; } else { // updates are allowed -> no focus rectangle if ( m_nOptions & OPT_UPDATE ) - m_nMode |= BROWSER_HIDECURSOR; + m_nMode |= BrowserMode::HIDECURSOR; } if ( m_bMultiSelection ) - m_nMode |= BROWSER_MULTISELECTION; + m_nMode |= BrowserMode::MULTISELECTION; else - m_nMode &= ~BROWSER_MULTISELECTION; + m_nMode &= ~BrowserMode::MULTISELECTION; adjustModeForScrollbars( m_nMode, m_bNavigationBar, m_bHideScrollbars ); @@ -1970,7 +1970,7 @@ void DbGridControl::PaintCell(OutputDevice& rDev, const Rectangle& rRect, sal_uI if (pColumn) { Rectangle aArea(rRect); - if ((GetMode() & BROWSER_CURSOR_WO_FOCUS) == BROWSER_CURSOR_WO_FOCUS) + if ((GetMode() & BrowserMode::CURSOR_WO_FOCUS) == BrowserMode::CURSOR_WO_FOCUS) { aArea.Top() += 1; aArea.Bottom() -= 1; diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 605f933fc50a..e0517d50f7a7 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -426,7 +426,7 @@ GalleryListView::GalleryListView( GalleryBrowser2* pParent, GalleryTheme* pTheme InitSettings(); - SetMode( BROWSER_AUTO_VSCROLL | BROWSER_AUTOSIZE_LASTCOL | BROWSER_AUTO_HSCROLL ); + SetMode( BrowserMode::AUTO_VSCROLL | BrowserMode::AUTOSIZE_LASTCOL | BrowserMode::AUTO_HSCROLL ); SetDataRowHeight( 28 ); InsertDataColumn( GALLERY_BRWBOX_TITLE, GAL_RESSTR(RID_SVXSTR_GALLERY_TITLE), 256 ); } diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index 581fc860206a..d816c0ede1c6 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -206,7 +206,7 @@ void ImpItemEdit::KeyInput(const KeyEvent& rKEvt) // - _SdrItemBrowserControl - -#define MYBROWSEMODE (BROWSER_THUMBDRAGGING|BROWSER_KEEPHIGHLIGHT|BROWSER_NO_HSCROLL|BROWSER_HIDECURSOR) +#define MYBROWSEMODE (BrowserMode::THUMBDRAGGING|BrowserMode::KEEPHIGHLIGHT|BrowserMode::NO_HSCROLL|BrowserMode::HIDECURSOR) _SdrItemBrowserControl::_SdrItemBrowserControl(vcl::Window* pParent, WinBits nBits): BrowseBox(pParent,nBits,MYBROWSEMODE), @@ -492,7 +492,7 @@ bool _SdrItemBrowserControl::BegChangeEntry(sal_uIntPtr nPos) bool bRet = false; ImpItemListRow* pEntry=ImpGetEntry(nPos); if (pEntry!=NULL && !pEntry->bComment) { - SetMode(MYBROWSEMODE & ~BROWSER_KEEPHIGHLIGHT); + SetMode(MYBROWSEMODE & BrowserMode(~BrowserMode::KEEPHIGHLIGHT)); pEditControl=new ImpItemEdit(&GetDataWindow(),this,0); Rectangle aRect(GetFieldRectPixel(nPos, ITEMBROWSER_VALUECOL_ID, false)); aRect.Left()+=2; // little offset for the Edit, so it's exact to the pixel @@ -907,7 +907,7 @@ sal_uInt16 ImpSortWhich(sal_uInt16 nWhich) void _SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItemSet* p2ndSet) { - SetMode(MYBROWSEMODE & ~BROWSER_KEEPHIGHLIGHT); + SetMode(MYBROWSEMODE & BrowserMode(~BrowserMode::KEEPHIGHLIGHT)); if (pSet!=NULL) { sal_uInt16 nEntryNum=0; SfxWhichIter aIter(*pSet); diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 6f99aa25cebd..2e7a0195d3f6 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -3697,14 +3697,14 @@ void SwTOXStylesTabPage::Modify() SwEntryBrowseBox::SwEntryBrowseBox(vcl::Window* pParent, VclBuilderContainer* pBuilder) : SwEntryBrowseBox_Base( pParent, EBBF_NONE, WB_TABSTOP | WB_BORDER, - BROWSER_KEEPSELECTION | - BROWSER_COLUMNSELECTION | - BROWSER_MULTISELECTION | - BROWSER_TRACKING_TIPS | - BROWSER_HLINESFULL | - BROWSER_VLINESFULL | - BROWSER_AUTO_VSCROLL| - BROWSER_HIDECURSOR ) + BrowserMode::KEEPHIGHLIGHT | + BrowserMode::COLUMNSELECTION | + BrowserMode::MULTISELECTION | + BrowserMode::TRACKING_TIPS | + BrowserMode::HLINES | + BrowserMode::VLINES | + BrowserMode::AUTO_VSCROLL| + BrowserMode::HIDECURSOR ) , aCellEdit(&GetDataWindow(), 0) , aCellCheckBox(&GetDataWindow()) , nCurrentRow(0) |