svtools/source/contnr/iconviewimpl.cxx | 31 +++---- svtools/source/contnr/imivctl.hxx | 35 +++----- svtools/source/contnr/imivctl1.cxx | 89 +++++++++----------- svtools/source/contnr/imivctl2.cxx | 4 svtools/source/contnr/svimpbox.cxx | 141 +++++++++++++++------------------ svtools/source/inc/svimpbox.hxx | 35 ++++---- 6 files changed, 156 insertions(+), 179 deletions(-)
New commits: commit c6ca2fac56afd8179a5ff16253ef4cbe9fa42d2c Author: Noel Grandin <n...@peralex.com> Date: Fri May 13 15:04:06 2016 +0200 convert IconChoice flags to scoped enum and removed unused entries Change-Id: Ibe7ebb7723d9418893a2e2768e2a84eb16d1a046 Reviewed-on: https://gerrit.libreoffice.org/24970 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index 9094b0e..22d5470 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -48,18 +48,20 @@ class IcnGridMap_Impl; #define PAINTFLAG_HOR_CENTERED 0x0001 #define PAINTFLAG_VER_CENTERED 0x0002 -#define F_VER_SBARSIZE_WITH_HBAR 0x0001 -#define F_HOR_SBARSIZE_WITH_VBAR 0x0002 -#define F_PAINTED 0x0004 // true after first paint -#define F_ADD_MODE 0x0008 -#define F_SELECTING_RECT 0x0020 -#define F_DOWN_CTRL 0x0080 -#define F_DOWN_DESELECT 0x0100 -#define F_START_EDITTIMER_IN_MOUSEUP 0x0400 -#define F_MOVED_ENTRIES 0x0800 -#define F_ENTRYLISTPOS_VALID 0x1000 -#define F_CLEARING_SELECTION 0x2000 -#define F_ARRANGING 0x4000 +enum class IconChoiceFlags { + NONE = 0x0000, + AddMode = 0x0001, + SelectingRect = 0x0002, + DownCtrl = 0x0004, + DownDeselect = 0x0008, + StartEditTimerInMouseUp = 0x0010, + EntryListPosValid = 0x0020, + ClearingSelection = 0x0040, + Arranging = 0x0080 +}; +namespace o3tl { + template<> struct typed_flags<IconChoiceFlags> : is_typed_flags<IconChoiceFlags, 0x00ff> {}; +} // unit = pixels // distances from window borders @@ -180,7 +182,7 @@ class SvxIconChoiceCtrl_Impl VclPtr<IcnViewEdit_Impl> pEdit; WinBits nWinBits; long nMaxBoundHeight; // height of highest BoundRects - sal_uInt16 nFlags; + IconChoiceFlags nFlags; DrawTextFlags nCurTextDrawFlags; ImplSVEvent * nUserEventAdjustScrBars; ImplSVEvent * nUserEventShowCursor; @@ -464,13 +466,6 @@ public: SvxIconChoiceCtrlEntry* GetFirstSelectedEntry() const; SvxIconChoiceCtrlTextMode GetEntryTextModeSmart( const SvxIconChoiceCtrlEntry* pEntry ) const; void SetSelectionMode( SelectionMode eMode ) { eSelectionMode=eMode; } - void SetEntriesMoved( bool bMoved ) - { - if( bMoved ) - nFlags |= F_MOVED_ENTRIES; - else - nFlags &= ~(F_MOVED_ENTRIES); - } sal_Int32 GetEntryListPos( SvxIconChoiceCtrlEntry* ) const; void InitSettings(); Rectangle GetOutputRect() const; diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index 3784433..77f358d 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -120,7 +120,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( pZOrderList = new SvxIconChoiceCtrlEntryList_impl(); ePositionMode = IcnViewPositionModeFree; SetStyle( nWinStyle ); - nFlags = 0; + nFlags = IconChoiceFlags::NONE; nUserEventAdjustScrBars = nullptr; nUserEventShowCursor = nullptr; nMaxVirtWidth = DEFAULT_MAX_VIRT_WIDTH; @@ -192,7 +192,6 @@ void SvxIconChoiceCtrl_Impl::Clear( bool bInCtor ) bBoundRectsDirty = false; nMaxBoundHeight = 0; - nFlags &= ~(F_PAINTED | F_MOVED_ENTRIES); pCursor = nullptr; if( !bInCtor ) { @@ -273,10 +272,10 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( SvxIconChoiceCtrlEntry* pEntry, size_t { StopEditTimer(); aEntries.insert( nPos, pEntry ); - if( (nFlags & F_ENTRYLISTPOS_VALID) && nPos >= aEntries.size() - 1 ) + if( (nFlags & IconChoiceFlags::EntryListPosValid) && nPos >= aEntries.size() - 1 ) pEntry->nPos = aEntries.size() - 1; else - nFlags &= ~F_ENTRYLISTPOS_VALID; + nFlags &= ~IconChoiceFlags::EntryListPosValid; pZOrderList->push_back( pEntry ); pImpCursor->Clear(); @@ -339,7 +338,7 @@ Rectangle SvxIconChoiceCtrl_Impl::GetOutputRect() const void SvxIconChoiceCtrl_Impl::SetListPositions() { - if( nFlags & F_ENTRYLISTPOS_VALID ) + if( nFlags & IconChoiceFlags::EntryListPosValid ) return; size_t nCount = aEntries.size(); @@ -348,7 +347,7 @@ void SvxIconChoiceCtrl_Impl::SetListPositions() SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ]; pEntry->nPos = nCur; } - nFlags |= F_ENTRYLISTPOS_VALID; + nFlags |= IconChoiceFlags::EntryListPosValid; } void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, bool bSelect, @@ -359,11 +358,11 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, bool b if( !bAdd ) { - if ( 0 == ( nFlags & F_CLEARING_SELECTION ) ) + if ( !( nFlags & IconChoiceFlags::ClearingSelection ) ) { - nFlags |= F_CLEARING_SELECTION; + nFlags |= IconChoiceFlags::ClearingSelection; DeselectAllBut( pEntry, true ); - nFlags &= ~F_CLEARING_SELECTION; + nFlags &= ~IconChoiceFlags::ClearingSelection; } } if( pEntry->IsSelected() != bSelect ) @@ -401,7 +400,7 @@ void SvxIconChoiceCtrl_Impl::EntrySelected(SvxIconChoiceCtrlEntry* pEntry, bool // Not when dragging though, else the loop in SelectRect doesn't work // correctly! - if (!(nFlags & F_SELECTING_RECT)) + if (!(nFlags & IconChoiceFlags::SelectingRect)) ToTop(pEntry); if (bUpdateMode) { @@ -518,7 +517,6 @@ void SvxIconChoiceCtrl_Impl::InitPredecessors() } else pHead = nullptr; - nFlags &= ~F_MOVED_ENTRIES; } void SvxIconChoiceCtrl_Impl::ClearPredecessors() @@ -561,8 +559,7 @@ void SvxIconChoiceCtrl_Impl::ImpArrange( bool bKeepPredecessors ) if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint ) bUpdateMode = false; aAutoArrangeIdle.Stop(); - nFlags &= ~F_MOVED_ENTRIES; - nFlags |= F_ARRANGING; + nFlags |= IconChoiceFlags::Arranging; StopEditTimer(); ShowCursor( false ); ResetVirtSize(); @@ -575,7 +572,7 @@ void SvxIconChoiceCtrl_Impl::ImpArrange( bool bKeepPredecessors ) // TODO: the invalidation in the detail view should be more intelligent //if( !(nWinBits & WB_DETAILS )) pView->Invalidate( InvalidateFlags::NoChildren ); - nFlags &= ~F_ARRANGING; + nFlags &= ~IconChoiceFlags::Arranging; if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint ) { MakeVisible( aCurOutputArea ); @@ -627,7 +624,6 @@ void SvxIconChoiceCtrl_Impl::Paint(vcl::RenderContext& rRenderContext, const Rec } rRenderContext.SetLineColor(aOldColor); #endif - nFlags |= F_PAINTED; if (!aEntries.size()) return; @@ -743,7 +739,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) { DBG_ASSERT(eSelectionMode != SINGLE_SELECTION,"Invalid selection mode"); if( rMEvt.IsMod1() ) - nFlags |= F_ADD_MODE; + nFlags |= IconChoiceFlags::AddMode; if( rMEvt.IsShift() ) { @@ -756,7 +752,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) aRect.Union( aTempRect ); } aCurSelectionRect = aRect; - SelectRect( aRect, (nFlags & F_ADD_MODE)!=0, &aSelectedRectList ); + SelectRect( aRect, bool(nFlags & IconChoiceFlags::AddMode), &aSelectedRectList ); } else if( rMEvt.IsMod1() ) { @@ -784,7 +780,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) } } else - nFlags |= F_ADD_MODE; + nFlags |= IconChoiceFlags::AddMode; aCurSelectionRect.SetPos( aDocPos ); pView->StartTracking( StartTrackingFlags::ScrollRepeat ); } @@ -821,7 +817,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) if( bEditingEnabled && bSelected && !rMEvt.GetModifier() && rMEvt.IsLeft() && IsTextHit( pEntry, aDocPos ) ) { - nFlags |= F_START_EDITTIMER_IN_MOUSEUP; + nFlags |= IconChoiceFlags::StartEditTimerInMouseUp; } } else if( eSelectionMode == NO_SELECTION ) @@ -846,16 +842,16 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) else { // deselect only in the Up, if the Move happened via D&D! - nFlags |= F_DOWN_DESELECT; + nFlags |= IconChoiceFlags::DownDeselect; if( bEditingEnabled && IsTextHit( pEntry, aDocPos ) && rMEvt.IsLeft()) { - nFlags |= F_START_EDITTIMER_IN_MOUSEUP; + nFlags |= IconChoiceFlags::StartEditTimerInMouseUp; } } } else if( rMEvt.IsMod1() ) - nFlags |= F_DOWN_CTRL; + nFlags |= IconChoiceFlags::DownCtrl; } } return bHandled; @@ -864,9 +860,9 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) { bool bHandled = false; - if( rMEvt.IsRight() && (nFlags & (F_DOWN_CTRL | F_DOWN_DESELECT) )) + if( rMEvt.IsRight() && (nFlags & (IconChoiceFlags::DownCtrl | IconChoiceFlags::DownDeselect) )) { - nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); + nFlags &= ~IconChoiceFlags(IconChoiceFlags::DownCtrl | IconChoiceFlags::DownDeselect); bHandled = true; } @@ -875,14 +871,14 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) SvxIconChoiceCtrlEntry* pDocEntry = GetEntry( aDocPos ); if( pDocEntry ) { - if( nFlags & F_DOWN_CTRL ) + if( nFlags & IconChoiceFlags::DownCtrl ) { // Ctrl & MultiSelection ToggleSelection( pDocEntry ); SetCursor( pDocEntry ); bHandled = true; } - else if( nFlags & F_DOWN_DESELECT ) + else if( nFlags & IconChoiceFlags::DownDeselect ) { DeselectAllBut( pDocEntry ); SetCursor( pDocEntry ); @@ -891,12 +887,12 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) } } - nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT); - if( nFlags & F_START_EDITTIMER_IN_MOUSEUP ) + nFlags &= ~IconChoiceFlags(IconChoiceFlags::DownCtrl | IconChoiceFlags::DownDeselect); + if( nFlags & IconChoiceFlags::StartEditTimerInMouseUp ) { bHandled = true; StartEditTimer(); - nFlags &= ~F_START_EDITTIMER_IN_MOUSEUP; + nFlags &= ~IconChoiceFlags::StartEditTimerInMouseUp; } if((nWinBits & WB_HIGHLIGHTFRAME) && bHighlightFramePressed && pCurHighlightFrame) @@ -970,9 +966,9 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, if( !pAnchor ) pAnchor = pOldCursor; if ( nWinBits & WB_ALIGN_LEFT ) - SelectRange( pAnchor, pNewCursor, (nFlags & F_ADD_MODE)!=0 ); + SelectRange( pAnchor, pNewCursor, bool(nFlags & IconChoiceFlags::AddMode) ); else - SelectRect(pAnchor,pNewCursor,(nFlags & F_ADD_MODE)!=0,&aSelectedRectList); + SelectRect(pAnchor,pNewCursor, bool(nFlags & IconChoiceFlags::AddMode), &aSelectedRectList); } else { @@ -1015,7 +1011,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) } if( bMod1 ) - nFlags |= F_ADD_MODE; + nFlags |= IconChoiceFlags::AddMode; SvxIconChoiceCtrlEntry* pNewCursor; SvxIconChoiceCtrlEntry* pOldCursor = pCursor; @@ -1111,10 +1107,10 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) case KEY_F8: if( rKEvt.GetKeyCode().IsShift() ) { - if( nFlags & F_ADD_MODE ) - nFlags &= (~F_ADD_MODE); + if( nFlags & IconChoiceFlags::AddMode ) + nFlags &= (~IconChoiceFlags::AddMode); else - nFlags |= F_ADD_MODE; + nFlags |= IconChoiceFlags::AddMode; } else bKeyUsed = false; @@ -1269,8 +1265,6 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars() nVisibleWidth = nVirtWidth + aOrigin.X(); else nVisibleWidth = nRealWidth; - - nFlags |= F_HOR_SBARSIZE_WITH_VBAR; } // activate horizontal scrollbar? if( !bNoHorSBar && (bHorSBar || (nVirtWidth > nVisibleWidth)) ) @@ -1294,8 +1288,6 @@ void SvxIconChoiceCtrl_Impl::AdjustScrollBars() nVisibleWidth = nVirtWidth + aOrigin.X(); else nVisibleWidth = nRealWidth; - - nFlags |= F_VER_SBARSIZE_WITH_HBAR; } } } @@ -1718,11 +1710,11 @@ void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const void SvxIconChoiceCtrl_Impl::SetNoSelection() { // block recursive calls via SelectEntry - if( !(nFlags & F_CLEARING_SELECTION )) + if( !(nFlags & IconChoiceFlags::ClearingSelection )) { - nFlags |= F_CLEARING_SELECTION; + nFlags |= IconChoiceFlags::ClearingSelection; DeselectAllBut( nullptr, true ); - nFlags &= ~F_CLEARING_SELECTION; + nFlags &= ~IconChoiceFlags::ClearingSelection; } } @@ -2306,7 +2298,7 @@ void SvxIconChoiceCtrl_Impl::DeselectAllBut( SvxIconChoiceCtrlEntry* pThisEntryN SelectEntry( pEntry, false, true, bPaintSync ); } pAnchor = nullptr; - nFlags &= (~F_ADD_MODE); + nFlags &= (~IconChoiceFlags::AddMode); } Size SvxIconChoiceCtrl_Impl::GetMinGrid() const @@ -2504,8 +2496,8 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, bool bAdd, return; // set flag, so ToTop won't be called in Select - bool bAlreadySelectingRect = (nFlags & F_SELECTING_RECT) != 0; - nFlags |= F_SELECTING_RECT; + bool bAlreadySelectingRect(nFlags & IconChoiceFlags::SelectingRect); + nFlags |= IconChoiceFlags::SelectingRect; CheckBoundingRects(); pView->Update(); @@ -2586,7 +2578,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const Rectangle& rRect, bool bAdd, } if( !bAlreadySelectingRect ) - nFlags &= ~F_SELECTING_RECT; + nFlags &= ~IconChoiceFlags::SelectingRect; pView->Update(); if( bResetClipRegion ) @@ -2764,7 +2756,6 @@ void SvxIconChoiceCtrl_Impl::AdjustAtGrid( const SvxIconChoiceCtrlEntryPtrVec& r { SetEntryPos( pCur, aNewPos ); pCur->SetFlags( SvxIconViewFlags::POS_MOVED ); - nFlags |= F_MOVED_ENTRIES; } nCurRight = aNewPos.X() + nWidth; } @@ -3052,7 +3043,7 @@ void SvxIconChoiceCtrl_Impl::SelectAll() SvxIconChoiceCtrlEntry* pEntry = aEntries[ nCur ]; SelectEntry( pEntry, true/*bSelect*/, true, bPaint ); } - nFlags &= (~F_ADD_MODE); + nFlags &= (~IconChoiceFlags::AddMode); pAnchor = nullptr; } @@ -3184,7 +3175,7 @@ void IcnViewEdit_Impl::StopEditing() sal_Int32 SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry* pEntry ) const { - if( !(nFlags & F_ENTRYLISTPOS_VALID )) + if( !(nFlags & IconChoiceFlags::EntryListPosValid )) const_cast<SvxIconChoiceCtrl_Impl*>(this)->SetListPositions(); return pEntry->nPos; } diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx index 1765b48..f785b0e 100644 --- a/svtools/source/contnr/imivctl2.cxx +++ b/svtools/source/contnr/imivctl2.cxx @@ -596,7 +596,7 @@ void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const nX = _pView->nMaxVirtWidth; if( !nX ) nX = _pView->pView->GetOutputSizePixel().Width(); - if( !(_pView->nFlags & F_ARRANGING) ) + if( !(_pView->nFlags & IconChoiceFlags::Arranging) ) nX -= _pView->nVerSBarWidth; nY = _pView->aVirtOutputSize.Height(); @@ -607,7 +607,7 @@ void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const nY = _pView->nMaxVirtHeight; if( !nY ) nY = _pView->pView->GetOutputSizePixel().Height(); - if( !(_pView->nFlags & F_ARRANGING) ) + if( !(_pView->nFlags & IconChoiceFlags::Arranging) ) nY -= _pView->nHorSBarHeight; nX = _pView->aVirtOutputSize.Width(); } commit 1e557229881d1bee299ab2a422e6eaa3337759ec Author: Noel Grandin <n...@peralex.com> Date: Fri May 13 14:49:38 2016 +0200 convert SvImpLBox flags to scoped enum and remove the dead ones Change-Id: Iac72c4a4e16290936a9965afb8c637d181bccb2d Reviewed-on: https://gerrit.libreoffice.org/24965 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/svtools/source/contnr/iconviewimpl.cxx b/svtools/source/contnr/iconviewimpl.cxx index bfef914..55242a3 100644 --- a/svtools/source/contnr/iconviewimpl.cxx +++ b/svtools/source/contnr/iconviewimpl.cxx @@ -38,7 +38,7 @@ void IconViewImpl::CursorUp() if( pPrevFirstToDraw ) { - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); long nEntryHeight = pView->GetEntryHeight(); ShowCursor( false ); pView->Update(); @@ -64,7 +64,7 @@ void IconViewImpl::CursorDown() if( pNextFirstToDraw ) { - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); ShowCursor( false ); pView->Update(); pStartEntry = pNextFirstToDraw; @@ -92,7 +92,7 @@ void IconViewImpl::PageDown( sal_uInt16 nDelta ) ShowCursor( false ); - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); pView->Update(); pStartEntry = pNext; @@ -128,7 +128,7 @@ void IconViewImpl::PageUp( sal_uInt16 nDelta ) if( pPrev == pStartEntry ) return; - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); ShowCursor( false ); pView->Update(); @@ -167,7 +167,7 @@ void IconViewImpl::KeyDown( bool bPageDown ) if( nDelta <= 0 ) return; - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); BeginScroll(); aVerSBar->SetThumbPos( nThumbPos+nDelta ); @@ -198,7 +198,7 @@ void IconViewImpl::KeyUp( bool bPageUp ) if( nDelta < 0 ) return; - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); BeginScroll(); aVerSBar->SetThumbPos( nThumbPos - nDelta ); @@ -293,7 +293,6 @@ void IconViewImpl::AdjustScrollBars( Size& rSize ) if( bVerSBar || nTotalCount > nVisibleCount ) { nResult = 1; - nFlags |= F_HOR_SBARSIZE_WITH_VBAR; } PositionScrollBars( aOSize, nResult ); @@ -313,7 +312,7 @@ void IconViewImpl::AdjustScrollBars( Size& rSize ) } else { - nFlags |= F_ENDSCROLL_SET_VIS_SIZE; + nFlags |= LBoxFlags::EndScrollSetVisSize; } if( nResult & 0x0001 ) @@ -373,9 +372,9 @@ void IconViewImpl::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rR if (!pView->GetVisibleCount()) return; - nFlags |= F_IN_PAINT; + nFlags |= LBoxFlags::InPaint; - if (nFlags & F_FILLING) + if (nFlags & LBoxFlags::Filling) { SvTreeListEntry* pFirst = pView->First(); if (pFirst != pStartEntry) @@ -437,18 +436,14 @@ void IconViewImpl::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rR pEntry = pView->NextVisible(pEntry); } - nFlags &= (~F_DESEL_ALL); + nFlags &= (~LBoxFlags::DeselectAll); rRenderContext.SetClipRegion(); - if (!(nFlags & F_PAINTED)) - { - nFlags |= F_PAINTED; - } - nFlags &= (~F_IN_PAINT); + nFlags &= (~LBoxFlags::InPaint); } void IconViewImpl::InvalidateEntry( long nId ) const { - if( !(nFlags & F_IN_PAINT )) + if( !(nFlags & LBoxFlags::InPaint )) { Rectangle aRect( GetVisibleArea() ); long nMaxBottom = aRect.Bottom(); @@ -470,7 +465,7 @@ bool IconViewImpl::KeyInput( const KeyEvent& rKEvt ) if( rKeyCode.IsMod2() ) return false; // don't evaluate Alt key - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); if( !pCursor ) pCursor = pStartEntry; diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index c562355..d380870 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -96,7 +96,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* pLBTree, WinBits nWinS pActiveEntry = nullptr; pActiveTab = nullptr; - nFlags = 0; + nFlags = LBoxFlags::NONE; nCurTabPos = FIRST_ENTRY_TAB; aEditIdle.SetPriority( SchedulerPriority::LOWEST ); @@ -108,7 +108,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* pLBTree, WinBits nWinS bUpdateMode = true; bInVScrollHdl = false; - nFlags |= F_FILLING; + nFlags |= LBoxFlags::Filling; bSubLstOpRet = bSubLstOpLR = bContextMenuHandling = bIsCellFocusEnabled = false; } @@ -212,9 +212,9 @@ void SvImpLBox::UpdateContextBmpWidthMax( SvTreeListEntry* pEntry ) short nWidth = aContextBmpWidthVector[ nDepth ]; if( nWidth != pView->nContextBmpWidthMax ) { pView->nContextBmpWidthMax = nWidth; - nFlags |= F_IGNORE_CHANGED_TABS; + nFlags |= LBoxFlags::IgnoreChangedTabs; pView->SetTabs(); - nFlags &= ~F_IGNORE_CHANGED_TABS; + nFlags &= ~LBoxFlags::IgnoreChangedTabs; } } @@ -275,7 +275,6 @@ void SvImpLBox::Clear() Range aRange( 0, 0 ); aVerSBar->SetRange( aRange ); aOutputSize = pView->Control::GetOutputSizePixel(); - nFlags &= ~(F_VER_SBARSIZE_WITH_HBAR | F_HOR_SBARSIZE_WITH_VBAR ); aHorSBar->Hide(); aHorSBar->SetThumbPos( 0 ); MapMode aMapMode( pView->GetMapMode()); @@ -286,7 +285,7 @@ void SvImpLBox::Clear() pView->SetClipRegion(); if( GetUpdateMode() ) pView->Invalidate( GetVisibleArea() ); - nFlags |= F_FILLING; + nFlags |= LBoxFlags::Filling; if( !aHorSBar->IsVisible() && !aVerSBar->IsVisible() ) aScrBarBox->Hide(); @@ -301,10 +300,10 @@ void SvImpLBox::Clear() IMPL_LINK_NOARG_TYPED(SvImpLBox, EndScrollHdl, ScrollBar*, void) { - if( nFlags & F_ENDSCROLL_SET_VIS_SIZE ) + if( nFlags & LBoxFlags::EndScrollSetVisSize ) { aVerSBar->SetVisibleSize( nNextVerVisSize ); - nFlags &= ~F_ENDSCROLL_SET_VIS_SIZE; + nFlags &= ~LBoxFlags::EndScrollSetVisSize; } EndScroll(); } @@ -318,7 +317,7 @@ IMPL_LINK_TYPED( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar, void ) if( !nDelta ) return; - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); bInVScrollHdl = true; @@ -356,7 +355,7 @@ void SvImpLBox::CursorDown() SvTreeListEntry* pNextFirstToDraw = pView->NextVisible(pStartEntry); if( pNextFirstToDraw ) { - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); ShowCursor( false ); pView->Update(); pStartEntry = pNextFirstToDraw; @@ -376,7 +375,7 @@ void SvImpLBox::CursorUp() SvTreeListEntry* pPrevFirstToDraw = pView->PrevVisible(pStartEntry); if( pPrevFirstToDraw ) { - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); long nEntryHeight = pView->GetEntryHeight(); ShowCursor( false ); pView->Update(); @@ -406,7 +405,7 @@ void SvImpLBox::PageDown( sal_uInt16 nDelta ) ShowCursor( false ); - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); pView->Update(); pStartEntry = pNext; @@ -442,7 +441,7 @@ void SvImpLBox::PageUp( sal_uInt16 nDelta ) if( pPrev == pStartEntry ) return; - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); ShowCursor( false ); pView->Update(); @@ -484,7 +483,7 @@ void SvImpLBox::KeyUp( bool bPageUp ) if( nDelta <= 0 ) return; - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); BeginScroll(); aVerSBar->SetThumbPos( nThumbPos - nDelta ); @@ -519,7 +518,7 @@ void SvImpLBox::KeyDown( bool bPageDown ) if( nDelta <= 0 ) return; - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); BeginScroll(); aVerSBar->SetThumbPos( nThumbPos+nDelta ); @@ -534,7 +533,7 @@ void SvImpLBox::KeyDown( bool bPageDown ) void SvImpLBox::InvalidateEntriesFrom( long nY ) const { - if( !(nFlags & F_IN_PAINT )) + if( !(nFlags & LBoxFlags::InPaint )) { Rectangle aRect( GetVisibleArea() ); aRect.Top() = nY; @@ -544,7 +543,7 @@ void SvImpLBox::InvalidateEntriesFrom( long nY ) const void SvImpLBox::InvalidateEntry( long nY ) const { - if( !(nFlags & F_IN_PAINT )) + if( !(nFlags & LBoxFlags::InPaint )) { Rectangle aRect( GetVisibleArea() ); long nMaxBottom = aRect.Bottom(); @@ -567,7 +566,7 @@ void SvImpLBox::InvalidateEntry( SvTreeListEntry* pEntry ) if( nPrev < nMostRight ) ShowVerSBar(); } - if( !(nFlags & F_IN_PAINT )) + if( !(nFlags & LBoxFlags::InPaint )) { bool bHasFocusRect = false; if( pEntry==pCursor && pView->HasFocus() ) @@ -636,7 +635,7 @@ void SvImpLBox::SetCursor( SvTreeListEntry* pEntry, bool bForceNoSelect ) { if (pViewDataNewCur) pViewDataNewCur->SetFocus( true ); - if(!bForceNoSelect && bSimpleTravel && !(nFlags & F_DESEL_ALL) && GetUpdateMode()) + if(!bForceNoSelect && bSimpleTravel && !(nFlags & LBoxFlags::DeselectAll) && GetUpdateMode()) { pView->Select( pCursor ); CallEventListeners( VCLEVENT_LISTBOX_TREEFOCUS, pCursor ); @@ -645,7 +644,7 @@ void SvImpLBox::SetCursor( SvTreeListEntry* pEntry, bool bForceNoSelect ) // Add mode (Ctrl-F8) else if( GetUpdateMode() && pView->GetSelectionMode() == MULTIPLE_SELECTION && - !(nFlags & F_DESEL_ALL) && !aSelEng.IsAddMode() && + !(nFlags & LBoxFlags::DeselectAll) && !aSelEng.IsAddMode() && !bForceNoSelect ) { pView->Select( pCursor ); @@ -666,7 +665,7 @@ void SvImpLBox::SetCursor( SvTreeListEntry* pEntry, bool bForceNoSelect ) SetAnchorSelection( pOldCursor, pCursor ); } } - nFlags &= (~F_DESEL_ALL); + nFlags &= (~LBoxFlags::DeselectAll); pView->OnCurrentEntryChanged(); } @@ -728,10 +727,10 @@ IMPL_LINK_TYPED( SvImpLBox, ScrollLeftRightHdl, ScrollBar *, pScrollBar, void ) void SvImpLBox::KeyLeftRight( long nDelta ) { - if( !(nFlags & F_IN_RESIZE) ) + if( !(nFlags & LBoxFlags::InResize) ) pView->Update(); BeginScroll(); - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); ShowCursor( false ); // neuen Origin berechnen @@ -742,7 +741,7 @@ void SvImpLBox::KeyLeftRight( long nDelta ) aMapMode.SetOrigin( aOrigin ); pView->SetMapMode( aMapMode ); - if( !(nFlags & F_IN_RESIZE) ) + if( !(nFlags & LBoxFlags::InResize) ) { Rectangle aRect( GetVisibleArea() ); pView->Scroll( -nDelta, 0, aRect, ScrollFlags::NoChildren ); @@ -877,9 +876,9 @@ void SvImpLBox::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect if (!pView->GetVisibleCount()) return; - nFlags |= F_IN_PAINT; + nFlags |= LBoxFlags::InPaint; - if (nFlags & F_FILLING) + if (nFlags & LBoxFlags::Filling) { SvTreeListEntry* pFirst = pView->First(); if (pFirst != pStartEntry) @@ -943,13 +942,9 @@ void SvImpLBox::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect pEntry = pView->NextVisible(pEntry); } - nFlags &= (~F_DESEL_ALL); + nFlags &= (~LBoxFlags::DeselectAll); rRenderContext.SetClipRegion(); - if (!(nFlags & F_PAINTED)) - { - nFlags |= F_PAINTED; - } - nFlags &= (~F_IN_PAINT); + nFlags &= (~LBoxFlags::InPaint); } void SvImpLBox::MakeVisible( SvTreeListEntry* pEntry, bool bMoveToTop ) @@ -963,7 +958,7 @@ void SvImpLBox::MakeVisible( SvTreeListEntry* pEntry, bool bMoveToTop ) return; // is already visible if( pStartEntry || (m_nStyle & WB_FORCE_MAKEVISIBLE) ) - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); if( !bInView ) { if( !pView->IsEntryVisible(pEntry) ) // Parent(s) collapsed? @@ -1008,7 +1003,7 @@ void SvImpLBox::ScrollToAbsPos( long nPos ) return; if( pStartEntry || (m_nStyle & WB_FORCE_MAKEVISIBLE) ) - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); if( pView->IsEntryVisible(pEntry) ) { @@ -1206,7 +1201,6 @@ void SvImpLBox::AdjustScrollBars( Size& rSize ) if( bVerSBar || nTotalCount > nVisibleCount ) { nResult = 1; - nFlags |= F_HOR_SBARSIZE_WITH_VBAR; nMaxRight -= nVerSBarWidth; if( !bHorBar ) { @@ -1228,7 +1222,6 @@ void SvImpLBox::AdjustScrollBars( Size& rSize ) ((nTotalCount > nVisibleCount) || bVerSBar) ) { nResult = 3; - nFlags |= F_VER_SBARSIZE_WITH_HBAR; } } @@ -1253,7 +1246,7 @@ void SvImpLBox::AdjustScrollBars( Size& rSize ) } else { - nFlags |= F_ENDSCROLL_SET_VIS_SIZE; + nFlags |= LBoxFlags::EndScrollSetVisSize; nNextVerVisSize = nTemp; } } @@ -1307,7 +1300,7 @@ void SvImpLBox::Resize() aOutputSize = pView->Control::GetOutputSizePixel(); if( aOutputSize.Width() <= 0 || aOutputSize.Height() <= 0 ) return; - nFlags |= F_IN_RESIZE; + nFlags |= LBoxFlags::InResize; InitScrollBarBox(); if( pView->GetEntryHeight()) @@ -1321,7 +1314,7 @@ void SvImpLBox::Resize() aHorSBar->Invalidate(); if( aVerSBar->IsVisible()) aVerSBar->Invalidate(); - nFlags &= (~(F_IN_RESIZE | F_PAINTED)); + nFlags &= ~LBoxFlags::InResize; } void SvImpLBox::FillView() @@ -1602,10 +1595,10 @@ void SvImpLBox::SetNodeBmpTabDistance() void SvImpLBox::EntrySelected( SvTreeListEntry* pEntry, bool bSelect ) { - if( nFlags & F_IGNORE_SELECT ) + if( nFlags & LBoxFlags::IgnoreSelect ) return; - nFlags &= (~F_DESEL_ALL); + nFlags &= (~LBoxFlags::DeselectAll); if( bSelect && aSelEng.GetSelectionMode() == SINGLE_SELECTION && pEntry != pCursor ) @@ -1636,7 +1629,7 @@ void SvImpLBox::RemovingEntry( SvTreeListEntry* pEntry ) if( !pView->IsEntryVisible( pEntry ) ) { // if parent is collapsed => bye! - nFlags |= F_REMOVED_ENTRY_INVISIBLE; + nFlags |= LBoxFlags::RemovedEntryInvisible; return; } @@ -1644,7 +1637,7 @@ void SvImpLBox::RemovingEntry( SvTreeListEntry* pEntry ) pEntry->HasChildren() && pView->IsExpanded(pEntry) && pTree->IsChild(pEntry, pMostRightEntry))) { - nFlags |= F_REMOVED_RECALC_MOST_RIGHT; + nFlags |= LBoxFlags::RemovedRecalcMostRight; } SvTreeListEntry* pOldStartEntry = pStartEntry; @@ -1699,9 +1692,9 @@ void SvImpLBox::RemovingEntry( SvTreeListEntry* pEntry ) void SvImpLBox::EntryRemoved() { - if( nFlags & F_REMOVED_ENTRY_INVISIBLE ) + if( nFlags & LBoxFlags::RemovedEntryInvisible ) { - nFlags &= (~F_REMOVED_ENTRY_INVISIBLE); + nFlags &= (~LBoxFlags::RemovedEntryInvisible); return; } if( !pStartEntry ) @@ -1714,7 +1707,7 @@ void SvImpLBox::EntryRemoved() if( GetUpdateMode()) { - if( nFlags & F_REMOVED_RECALC_MOST_RIGHT ) + if( nFlags & LBoxFlags::RemovedRecalcMostRight ) FindMostRight(nullptr); aVerSBar->SetRange( Range(0, pView->GetVisibleCount()-1 ) ); FillView(); @@ -1742,16 +1735,16 @@ void SvImpLBox::EntryRemoved() } ShowCursor( true ); } - nFlags &= (~F_REMOVED_RECALC_MOST_RIGHT); + nFlags &= (~LBoxFlags::RemovedRecalcMostRight); } void SvImpLBox::MovingEntry( SvTreeListEntry* pEntry ) { - int bDeselAll = nFlags & F_DESEL_ALL; + bool bDeselAll(nFlags & LBoxFlags::DeselectAll); SelAllDestrAnch( false ); // DeselectAll(); if( !bDeselAll ) - nFlags &= (~F_DESEL_ALL); + nFlags &= (~LBoxFlags::DeselectAll); if( pEntry == pCursor ) ShowCursor( false ); @@ -1822,12 +1815,12 @@ void SvImpLBox::EntryInserted( SvTreeListEntry* pEntry ) if( !pView->IsEntryVisible( pEntry ) ) return; - int bDeselAll = nFlags & F_DESEL_ALL; + bool bDeselAll(nFlags & LBoxFlags::DeselectAll); if( bDeselAll ) SelAllDestrAnch( false ); else DestroyAnchor(); - // nFlags &= (~F_DESEL_ALL); + // nFlags &= (~LBoxFlags::DeselectAll); // ShowCursor( false ); // if cursor is moved lower long nY = GetEntryLine( pEntry ); bool bEntryVisible = IsLineVisible( nY ); @@ -1860,7 +1853,7 @@ void SvImpLBox::EntryInserted( SvTreeListEntry* pEntry ) SyncVerThumb(); // if something was inserted before the thumb ShowVerSBar(); ShowCursor( true ); - if( pStartEntry != pView->First() && (nFlags & F_FILLING) ) + if( pStartEntry != pView->First() && (nFlags & LBoxFlags::Filling) ) pView->Update(); } } @@ -2008,7 +2001,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) if ( pEntry != pCursor ) // new entry selected -> reset current tab position to first tab nCurTabPos = FIRST_ENTRY_TAB; - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); pView->GrabFocus(); //fdo#82270 Grabbing focus can invalidate the entries, re-fetch pEntry = GetEntry(aPos); @@ -2031,15 +2024,15 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) if ( !rMEvt.IsMod1() && !rMEvt.IsMod2() && rMEvt.IsLeft() && pXTab->IsEditable() && pEntry == pView->FirstSelected() && nullptr == pView->NextSelected( pEntry ) ) // #i8234# FirstSelected() and NextSelected() ensures, that inplace editing is only triggered, when only one entry is selected - nFlags |= F_START_EDITTIMER; + nFlags |= LBoxFlags::StartEditTimer; if ( !pView->IsSelected( pEntry ) ) - nFlags &= ~F_START_EDITTIMER; + nFlags &= ~LBoxFlags::StartEditTimer; } if( (rMEvt.GetClicks() % 2) == 0 ) { - nFlags &= (~F_START_EDITTIMER); + nFlags &= (~LBoxFlags::StartEditTimer); pView->pHdlEntry = pEntry; if( pView->DoubleClickHdl() ) { @@ -2085,9 +2078,9 @@ void SvImpLBox::MouseButtonUp( const MouseEvent& rMEvt) if ( !ButtonUpCheckCtrl( rMEvt ) && ( aSelEng.GetSelectionMode() != NO_SELECTION ) ) aSelEng.SelMouseButtonUp( rMEvt ); EndScroll(); - if( nFlags & F_START_EDITTIMER ) + if( nFlags & LBoxFlags::StartEditTimer ) { - nFlags &= (~F_START_EDITTIMER); + nFlags &= (~LBoxFlags::StartEditTimer); aEditClickPos = rMEvt.GetPosPixel(); aEditIdle.Start(); } @@ -2111,7 +2104,7 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) if( rKeyCode.IsMod2() ) return false; // don't evaluate Alt key - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); if( !pCursor ) pCursor = pStartEntry; @@ -2670,7 +2663,7 @@ void ImpLBSelEng::DeselectAtPoint( const Point& rPoint ) void ImpLBSelEng::DeselectAll() { pImp->SelAllDestrAnch( false, false ); // don't reset SelectionEngine! - pImp->nFlags &= (~F_DESEL_ALL); + pImp->nFlags &= (~LBoxFlags::DeselectAll); } // *********************************************************************** @@ -2789,7 +2782,7 @@ void SvImpLBox::SelAllDestrAnch( bool bSelect, bool bDestroyAnchor, bool bSingleSelToo ) { SvTreeListEntry* pEntry; - nFlags &= (~F_DESEL_ALL); + nFlags &= (~LBoxFlags::DeselectAll); if( bSelect && bSimpleTravel ) { if( pCursor && !pView->IsSelected( pCursor )) @@ -2801,7 +2794,7 @@ void SvImpLBox::SelAllDestrAnch( if( !bSelect && pView->GetSelectionCount() == 0 ) { if( bSimpleTravel && ( !GetUpdateMode() || !pCursor) ) - nFlags |= F_DESEL_ALL; + nFlags |= LBoxFlags::DeselectAll; return; } if( bSelect && pView->GetSelectionCount() == pView->GetEntryCount()) @@ -2821,12 +2814,12 @@ void SvImpLBox::SelAllDestrAnch( } if( bSimpleTravel && !pCursor && !GetUpdateMode() ) - nFlags |= F_DESEL_ALL; + nFlags |= LBoxFlags::DeselectAll; ShowCursor( false ); bool bUpdate = GetUpdateMode(); - nFlags |= F_IGNORE_SELECT; // EntryInserted should not do anything + nFlags |= LBoxFlags::IgnoreSelect; // EntryInserted should not do anything pEntry = pTree->First(); while( pEntry ) { @@ -2841,7 +2834,7 @@ void SvImpLBox::SelAllDestrAnch( } pEntry = pTree->Next( pEntry ); } - nFlags &= ~F_IGNORE_SELECT; + nFlags &= ~LBoxFlags::IgnoreSelect; if( bDestroyAnchor ) DestroyAnchor(); // delete anchor & reset SelectionEngine @@ -2881,7 +2874,7 @@ void SvImpLBox::SetDragDropMode( DragDropMode eDDMode ) void SvImpLBox::BeginDrag() { - nFlags &= (~F_FILLING); + nFlags &= (~LBoxFlags::Filling); if( !bAsyncBeginDrag ) { BeginScroll(); @@ -3066,18 +3059,18 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) void SvImpLBox::BeginScroll() { - if( !(nFlags & F_IN_SCROLLING)) + if( !(nFlags & LBoxFlags::InScrolling)) { - nFlags |= F_IN_SCROLLING; + nFlags |= LBoxFlags::InScrolling; } } void SvImpLBox::EndScroll() { - if( nFlags & F_IN_SCROLLING) + if( nFlags & LBoxFlags::InScrolling) { pView->NotifyEndScroll(); - nFlags &= (~F_IN_SCROLLING); + nFlags &= (~LBoxFlags::InScrolling); } } @@ -3204,7 +3197,7 @@ SvLBoxTab* SvImpLBox::NextTab( SvLBoxTab* pTab ) void SvImpLBox::EndSelection() { DestroyAnchor(); - nFlags &= ~F_START_EDITTIMER; + nFlags &= ~LBoxFlags::StartEditTimer; } void SvImpLBox::SetUpdateMode( bool bMode ) @@ -3221,9 +3214,9 @@ bool SvImpLBox::SetMostRight( SvTreeListEntry* pEntry ) { if( pView->nTreeFlags & SvTreeFlags::RECALCTABS ) { - nFlags |= F_IGNORE_CHANGED_TABS; + nFlags |= LBoxFlags::IgnoreChangedTabs; pView->SetTabs(); - nFlags &= ~F_IGNORE_CHANGED_TABS; + nFlags &= ~LBoxFlags::IgnoreChangedTabs; } sal_uInt16 nLastTab = pView->aTabs.size() - 1; @@ -3302,7 +3295,7 @@ void SvImpLBox::FindMostRight_Impl( SvTreeListEntry* pParent, SvTreeListEntry* p void SvImpLBox::NotifyTabsChanged() { - if( GetUpdateMode() && !(nFlags & F_IGNORE_CHANGED_TABS ) && + if( GetUpdateMode() && !(nFlags & LBoxFlags::IgnoreChangedTabs ) && nCurUserEvent == nullptr ) { nCurUserEvent = Application::PostUserEvent(LINK(this,SvImpLBox,MyUserEvent)); diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx index 521a306..7d32014 100644 --- a/svtools/source/inc/svimpbox.hxx +++ b/svtools/source/inc/svimpbox.hxx @@ -62,21 +62,24 @@ public: }; // Flags fuer nFlag -#define F_VER_SBARSIZE_WITH_HBAR 0x0001 -#define F_HOR_SBARSIZE_WITH_VBAR 0x0002 -#define F_IGNORE_NEXT_MOUSEMOVE 0x0004 // OS/2 only -#define F_IN_SCROLLING 0x0008 -#define F_DESEL_ALL 0x0010 -#define F_START_EDITTIMER 0x0020 // MAC only -#define F_IGNORE_SELECT 0x0040 -#define F_IN_RESIZE 0x0080 -#define F_REMOVED_ENTRY_INVISIBLE 0x0100 -#define F_REMOVED_RECALC_MOST_RIGHT 0x0200 -#define F_IGNORE_CHANGED_TABS 0x0400 -#define F_PAINTED 0x0800 -#define F_IN_PAINT 0x1000 -#define F_ENDSCROLL_SET_VIS_SIZE 0x2000 -#define F_FILLING 0x4000 +enum class LBoxFlags { + NONE = 0x0000, + InScrolling = 0x0001, + DeselectAll = 0x0002, + StartEditTimer = 0x0004, // MAC only + IgnoreSelect = 0x0008, + InResize = 0x0010, + RemovedEntryInvisible = 0x0020, + RemovedRecalcMostRight = 0x0040, + IgnoreChangedTabs = 0x0080, + InPaint = 0x0100, + EndScrollSetVisSize = 0x0200, + Filling = 0x0400, +}; +namespace o3tl +{ + template<> struct typed_flags<LBoxFlags> : is_typed_flags<LBoxFlags, 0x07ff> {}; +} #define NODE_BMP_TABDIST_NOTVALID -2000000 #define FIRST_ENTRY_TAB 1 @@ -209,7 +212,7 @@ protected: SvTreeListEntry* pStartEntry; ImplSVEvent* nCurUserEvent; Size aOutputSize; - sal_uInt16 nFlags; + LBoxFlags nFlags; WinBits m_nStyle; ExtendedWinBits nExtendedWinBits; SelectionEngine aSelEng; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits