diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-14 13:24:56 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-15 10:05:02 +0200 |
commit | 24181bfb0b49a011e201ecc111bac3b48ad5a1ff (patch) | |
tree | e16fcead2274fd42453df019a0994bdb830d8894 /vcl | |
parent | 08a2c8516bc47db322e7449fc841f3fcc5487d7e (diff) |
convert LISTBOX_ENTRY_FLAG constants to scoped enum
Change-Id: Id7ca4853094c214b464e2dee53b10558f1f5a3ba
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/ilstbox.hxx | 18 | ||||
-rw-r--r-- | vcl/source/control/ilstbox.cxx | 28 | ||||
-rw-r--r-- | vcl/source/control/lstbox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 2 |
4 files changed, 26 insertions, 26 deletions
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx index 155e03f17000..da69ac82f425 100644 --- a/vcl/inc/ilstbox.hxx +++ b/vcl/inc/ilstbox.hxx @@ -52,13 +52,13 @@ struct ImplEntryType Image maImage; void* mpUserData; bool mbIsSelected; - long mnFlags; + ListBoxEntryFlags mnFlags; long mnHeight; ImplEntryType( const OUString& rStr, const Image& rImage ) : maStr( rStr ), maImage( rImage ), - mnFlags( 0 ), + mnFlags( ListBoxEntryFlags::NONE ), mnHeight( 0 ) { mbIsSelected = false; @@ -67,7 +67,7 @@ struct ImplEntryType ImplEntryType( const OUString& rStr ) : maStr( rStr ), - mnFlags( 0 ), + mnFlags( ListBoxEntryFlags::NONE ), mnHeight( 0 ) { mbIsSelected = false; @@ -76,7 +76,7 @@ struct ImplEntryType ImplEntryType( const Image& rImage ) : maImage( rImage ), - mnFlags( 0 ), + mnFlags( ListBoxEntryFlags::NONE ), mnHeight( 0 ) { mbIsSelected = false; @@ -138,8 +138,8 @@ public: void SetEntryData( sal_Int32 nPos, void* pNewData ); void* GetEntryData( sal_Int32 nPos ) const; - void SetEntryFlags( sal_Int32 nPos, long nFlags ); - long GetEntryFlags( sal_Int32 nPos ) const; + void SetEntryFlags( sal_Int32 nPos, ListBoxEntryFlags nFlags ); + ListBoxEntryFlags GetEntryFlags( sal_Int32 nPos ) const; void SelectEntry( sal_Int32 nPos, bool bSelect ); @@ -164,7 +164,7 @@ public: sal_Int32 GetMaxMRUCount() const { return mnMaxMRUCount; } /** An Entry is selectable if its mnFlags does not have the - LISTBOX_ENTRY_FLAG_DISABLE_SELECTION flag set. */ + ListBoxEntryFlags::DisableSelection flag set. */ bool IsEntrySelectable( sal_Int32 nPos ) const; /** @return the first entry found from the given position nPos that is selectable @@ -277,7 +277,7 @@ public: void ResetCurrentPos() { mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; } sal_Int32 GetCurrentPos() const { return mnCurrentPos; } sal_uInt16 GetDisplayLineCount() const; - void SetEntryFlags( sal_Int32 nPos, long nFlags ); + void SetEntryFlags( sal_Int32 nPos, ListBoxEntryFlags nFlags ); void DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 nPos, bool bDrawImage, bool bDrawText, bool bDrawTextAtImagePos = false, bool bLayout = false); @@ -428,7 +428,7 @@ public: void SetEntryData( sal_Int32 nPos, void* pNewData ) { maLBWindow->GetEntryList()->SetEntryData( nPos, pNewData ); } void Clear(); - void SetEntryFlags( sal_Int32 nPos, long nFlags ); + void SetEntryFlags( sal_Int32 nPos, ListBoxEntryFlags nFlags ); void SelectEntry( sal_Int32 nPos, bool bSelect ); void SetNoSelection(); diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index f44583cc5496..296e923671ca 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -118,7 +118,7 @@ void ImplEntryList::SelectEntry( sal_Int32 nPos, bool bSelect ) boost::ptr_vector<ImplEntryType>::iterator iter = maEntries.begin()+nPos; if ( ( iter->mbIsSelected != bSelect ) && - ( (iter->mnFlags & LISTBOX_ENTRY_FLAG_DISABLE_SELECTION) == 0 ) ) + ( (iter->mnFlags & ListBoxEntryFlags::DisableSelection) == ListBoxEntryFlags::NONE ) ) { iter->mbIsSelected = bSelect; if ( mbCallSelectionChangedHdl ) @@ -398,17 +398,17 @@ void* ImplEntryList::GetEntryData( sal_Int32 nPos ) const return pImplEntry ? pImplEntry->mpUserData : NULL; } -void ImplEntryList::SetEntryFlags( sal_Int32 nPos, long nFlags ) +void ImplEntryList::SetEntryFlags( sal_Int32 nPos, ListBoxEntryFlags nFlags ) { ImplEntryType* pImplEntry = GetEntry( nPos ); if ( pImplEntry ) pImplEntry->mnFlags = nFlags; } -long ImplEntryList::GetEntryFlags( sal_Int32 nPos ) const +ListBoxEntryFlags ImplEntryList::GetEntryFlags( sal_Int32 nPos ) const { ImplEntryType* pImplEntry = GetEntry( nPos ); - return pImplEntry ? pImplEntry->mnFlags : 0; + return pImplEntry ? pImplEntry->mnFlags : ListBoxEntryFlags::NONE; } sal_Int32 ImplEntryList::GetSelectEntryCount() const @@ -460,7 +460,7 @@ bool ImplEntryList::IsEntryPosSelected( sal_Int32 nIndex ) const bool ImplEntryList::IsEntrySelectable( sal_Int32 nPos ) const { ImplEntryType* pImplEntry = GetEntry( nPos ); - return pImplEntry == nullptr || ((pImplEntry->mnFlags & LISTBOX_ENTRY_FLAG_DISABLE_SELECTION) == 0); + return pImplEntry == nullptr || ((pImplEntry->mnFlags & ListBoxEntryFlags::DisableSelection) == ListBoxEntryFlags::NONE); } sal_Int32 ImplEntryList::FindFirstSelectable( sal_Int32 nPos, bool bForward /* = true */ ) @@ -638,7 +638,7 @@ void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry ) if ( aMetrics.bText ) { - if( (rEntry.mnFlags & LISTBOX_ENTRY_FLAG_MULTILINE) ) + if( (rEntry.mnFlags & ListBoxEntryFlags::MultiLine) ) { // multiline case Size aCurSize( PixelToLogic( GetSizePixel() ) ); @@ -757,7 +757,7 @@ sal_Int32 ImplListBoxWindow::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEnt sal_Int32 nNewPos = mpEntryList->InsertEntry( nPos, pNewEntry, mbSort ); if( (GetStyle() & WB_WORDBREAK) ) - pNewEntry->mnFlags |= LISTBOX_ENTRY_FLAG_MULTILINE; + pNewEntry->mnFlags |= ListBoxEntryFlags::MultiLine; ImplUpdateEntryMetrics( *pNewEntry ); return nNewPos; @@ -772,7 +772,7 @@ void ImplListBoxWindow::RemoveEntry( sal_Int32 nPos ) ImplCalcMetrics(); } -void ImplListBoxWindow::SetEntryFlags( sal_Int32 nPos, long nFlags ) +void ImplListBoxWindow::SetEntryFlags( sal_Int32 nPos, ListBoxEntryFlags nFlags ) { mpEntryList->SetEntryFlags( nPos, nFlags ); ImplEntryType* pEntry = mpEntryList->GetMutableEntryPtr( nPos ); @@ -1825,7 +1825,7 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 { long nMaxWidth = std::max(static_cast< long >(mnMaxWidth), rRenderContext.GetOutputSizePixel().Width() - 2 * mnBorder); // a multiline entry should only be as wide a the window - if ((pEntry->mnFlags & LISTBOX_ENTRY_FLAG_MULTILINE)) + if ((pEntry->mnFlags & ListBoxEntryFlags::MultiLine)) nMaxWidth = rRenderContext.GetOutputSizePixel().Width() - 2 * mnBorder; Rectangle aTextRect(Point(mnBorder - mnLeft, nY), @@ -1850,9 +1850,9 @@ void ImplListBoxWindow::DrawEntry(vcl::RenderContext& rRenderContext, sal_Int32 } sal_uInt16 nDrawStyle = ImplGetTextStyle(); - if ((pEntry->mnFlags & LISTBOX_ENTRY_FLAG_MULTILINE)) + if ((pEntry->mnFlags & ListBoxEntryFlags::MultiLine)) nDrawStyle |= MULTILINE_ENTRY_DRAW_FLAGS; - if ((pEntry->mnFlags & LISTBOX_ENTRY_FLAG_DRAW_DISABLED)) + if ((pEntry->mnFlags & ListBoxEntryFlags::DrawDisabled)) nDrawStyle |= TEXT_DRAW_DISABLE; rRenderContext.DrawText(aTextRect, aStr, nDrawStyle, pVector, pDisplayText); @@ -1920,7 +1920,7 @@ void ImplListBoxWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl sal_uInt16 ImplListBoxWindow::GetDisplayLineCount() const { - // FIXME: LISTBOX_ENTRY_FLAG_MULTILINE + // FIXME: ListBoxEntryFlags::MultiLine sal_Int32 nCount = mpEntryList->GetEntryCount(); long nHeight = GetOutputSizePixel().Height();// - mnMaxHeight + mnBorder; @@ -2050,7 +2050,7 @@ void ImplListBoxWindow::ScrollHorz( long n ) Size ImplListBoxWindow::CalcSize(sal_Int32 nMaxLines) const { - // FIXME: LISTBOX_ENTRY_FLAG_MULTILINE + // FIXME: ListBoxEntryFlags::MultiLine Size aSz; aSz.Height() = nMaxLines * mnMaxHeight; @@ -2225,7 +2225,7 @@ void ImplListBox::RemoveEntry( sal_Int32 nPos ) StateChanged( StateChangedType::Data ); } -void ImplListBox::SetEntryFlags( sal_Int32 nPos, long nFlags ) +void ImplListBox::SetEntryFlags( sal_Int32 nPos, ListBoxEntryFlags nFlags ) { maLBWindow->SetEntryFlags( nPos, nFlags ); } diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index 8db825e8880d..2c3566b89ade 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -1130,12 +1130,12 @@ void* ListBox::GetEntryData( sal_Int32 nPos ) const return mpImplLB->GetEntryList()->GetEntryData( nPos + mpImplLB->GetEntryList()->GetMRUCount() ); } -void ListBox::SetEntryFlags( sal_Int32 nPos, long nFlags ) +void ListBox::SetEntryFlags( sal_Int32 nPos, ListBoxEntryFlags nFlags ) { mpImplLB->SetEntryFlags( nPos + mpImplLB->GetEntryList()->GetMRUCount(), nFlags ); } -long ListBox::GetEntryFlags( sal_Int32 nPos ) const +ListBoxEntryFlags ListBox::GetEntryFlags( sal_Int32 nPos ) const { return mpImplLB->GetEntryList()->GetEntryFlags( nPos + mpImplLB->GetEntryList()->GetMRUCount() ); } diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index e121896f2d16..419f63675e28 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -1775,7 +1775,7 @@ void TabControl::EnablePage( sal_uInt16 i_nPageId, bool i_bEnable ) mbFormat = true; if( mpTabCtrlData->mpListBox ) mpTabCtrlData->mpListBox->SetEntryFlags( GetPagePos( i_nPageId ), - i_bEnable ? 0 : (LISTBOX_ENTRY_FLAG_DISABLE_SELECTION | LISTBOX_ENTRY_FLAG_DRAW_DISABLED) ); + i_bEnable ? ListBoxEntryFlags::NONE : (ListBoxEntryFlags::DisableSelection | ListBoxEntryFlags::DrawDisabled) ); if( pItem->mnId == mnCurPageId ) { // SetCurPageId will change to an enabled page |