Kaydet (Commit) 8d3eefd3 authored tarafından Noel Grandin's avatar Noel Grandin

convert TREEFLAG_ constants to scoped enum

Change-Id: Ibf9eab757fbe94dbff3fd09472f3ca74fffd5094
üst 923de833
...@@ -414,7 +414,7 @@ namespace accessibility ...@@ -414,7 +414,7 @@ namespace accessibility
} }
bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0; bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
if( !(getListBox()->GetTreeFlags() & TREEFLAG_CHKBTN) ) if( !(getListBox()->GetTreeFlags() & SvTreeFlags::CHKBTN) )
{ {
if( bHasButtons ) if( bHasButtons )
nCase = 1; nCase = 1;
...@@ -445,7 +445,7 @@ namespace accessibility ...@@ -445,7 +445,7 @@ namespace accessibility
//o is: return AccessibleRole::TREE; //o is: return AccessibleRole::TREE;
bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0; bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
if(!bHasButtons && (getListBox()->GetTreeFlags() & TREEFLAG_CHKBTN)) if(!bHasButtons && (getListBox()->GetTreeFlags() & SvTreeFlags::CHKBTN))
return AccessibleRole::LIST; return AccessibleRole::LIST;
else else
if (GetRoleType() == 0) if (GetRoleType() == 0)
......
...@@ -393,7 +393,7 @@ namespace accessibility ...@@ -393,7 +393,7 @@ namespace accessibility
} }
bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0; bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
if( !(getListBox()->GetTreeFlags() & TREEFLAG_CHKBTN) ) if( !(getListBox()->GetTreeFlags() & SvTreeFlags::CHKBTN) )
{ {
if( bHasButtons ) if( bHasButtons )
nCase = 1; nCase = 1;
...@@ -422,8 +422,8 @@ namespace accessibility ...@@ -422,8 +422,8 @@ namespace accessibility
else if( nType == TREEBOX_ALLITEM_ACCROLE_TYPE_LIST) else if( nType == TREEBOX_ALLITEM_ACCROLE_TYPE_LIST)
return AccessibleRole::LIST_ITEM; return AccessibleRole::LIST_ITEM;
sal_uInt16 treeFlag = pBox->GetTreeFlags(); SvTreeFlags treeFlag = pBox->GetTreeFlags();
if(treeFlag & TREEFLAG_CHKBTN ) if(treeFlag & SvTreeFlags::CHKBTN )
{ {
SvTreeListEntry* pEntry = pBox->GetEntryFromPath( m_aEntryPath ); SvTreeListEntry* pEntry = pBox->GetEntryFromPath( m_aEntryPath );
SvButtonState eState = pBox->GetCheckButtonState( pEntry ); SvButtonState eState = pBox->GetCheckButtonState( pEntry );
...@@ -757,9 +757,9 @@ namespace accessibility ...@@ -757,9 +757,9 @@ namespace accessibility
// three actions supported // three actions supported
SvTreeListBox* pBox = getListBox(); SvTreeListBox* pBox = getListBox();
sal_uInt16 treeFlag = pBox->GetTreeFlags(); SvTreeFlags treeFlag = pBox->GetTreeFlags();
bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0; bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
if( (treeFlag & TREEFLAG_CHKBTN) && !bHasButtons) if( (treeFlag & SvTreeFlags::CHKBTN) && !bHasButtons)
{ {
sal_Int16 role = getAccessibleRole(); sal_Int16 role = getAccessibleRole();
if ( role == AccessibleRole::CHECK_BOX ) if ( role == AccessibleRole::CHECK_BOX )
...@@ -781,8 +781,8 @@ namespace accessibility ...@@ -781,8 +781,8 @@ namespace accessibility
checkActionIndex_Impl( nIndex ); checkActionIndex_Impl( nIndex );
EnsureIsAlive(); EnsureIsAlive();
sal_uInt16 treeFlag = getListBox()->GetTreeFlags(); SvTreeFlags treeFlag = getListBox()->GetTreeFlags();
if( nIndex == 0 && (treeFlag & TREEFLAG_CHKBTN) ) if( nIndex == 0 && (treeFlag & SvTreeFlags::CHKBTN) )
{ {
if(getAccessibleRole() == AccessibleRole::CHECK_BOX) if(getAccessibleRole() == AccessibleRole::CHECK_BOX)
{ {
...@@ -794,7 +794,7 @@ namespace accessibility ...@@ -794,7 +794,7 @@ namespace accessibility
getListBox()->SetCheckButtonState(pEntry, SV_BUTTON_CHECKED); getListBox()->SetCheckButtonState(pEntry, SV_BUTTON_CHECKED);
} }
} }
else if( (nIndex == 1 && (treeFlag & TREEFLAG_CHKBTN) ) || (nIndex == 0) ) else if( (nIndex == 1 && (treeFlag & SvTreeFlags::CHKBTN) ) || (nIndex == 0) )
{ {
SvTreeListEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath ); SvTreeListEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
if ( pEntry ) if ( pEntry )
...@@ -823,8 +823,8 @@ namespace accessibility ...@@ -823,8 +823,8 @@ namespace accessibility
// sal_Bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0; // sal_Bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
SvTreeListEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath ); SvTreeListEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
SvButtonState state = getListBox()->GetCheckButtonState( pEntry ); SvButtonState state = getListBox()->GetCheckButtonState( pEntry );
sal_uInt16 treeFlag = getListBox()->GetTreeFlags(); SvTreeFlags treeFlag = getListBox()->GetTreeFlags();
if(nIndex == 0 && (treeFlag & TREEFLAG_CHKBTN)) if(nIndex == 0 && (treeFlag & SvTreeFlags::CHKBTN))
{ {
if(getAccessibleRole() == AccessibleRole::CHECK_BOX) if(getAccessibleRole() == AccessibleRole::CHECK_BOX)
{ {
...@@ -838,7 +838,7 @@ namespace accessibility ...@@ -838,7 +838,7 @@ namespace accessibility
//Sometimes, a List or Tree may have both checkbox and label at the same time //Sometimes, a List or Tree may have both checkbox and label at the same time
return OUString(); return OUString();
} }
}else if( (nIndex == 1 && (treeFlag & TREEFLAG_CHKBTN)) || nIndex == 0 ) }else if( (nIndex == 1 && (treeFlag & SvTreeFlags::CHKBTN)) || nIndex == 0 )
{ {
if( pEntry->HasChildren() || pEntry->HasChildrenOnDemand() ) if( pEntry->HasChildren() || pEntry->HasChildrenOnDemand() )
return getListBox()->IsExpanded( pEntry ) ? \ return getListBox()->IsExpanded( pEntry ) ? \
......
...@@ -100,10 +100,18 @@ namespace o3tl ...@@ -100,10 +100,18 @@ namespace o3tl
#define SV_ENTRYHEIGHTOFFS_PIXEL 2 #define SV_ENTRYHEIGHTOFFS_PIXEL 2
#define TREEFLAG_CHKBTN 0x0001 enum class SvTreeFlags
#define TREEFLAG_USESEL 0x0002 {
#define TREEFLAG_MANINS 0x0004 CHKBTN = 0x01,
#define TREEFLAG_RECALCTABS 0x0008 USESEL = 0x02,
MANINS = 0x04,
RECALCTABS = 0x08,
FIXEDHEIGHT = 0x10,
};
namespace o3tl
{
template<> struct typed_flags<SvTreeFlags> : is_typed_flags<SvTreeFlags, 0x1f> {};
}
#define TREEBOX_ALLITEM_ACCROLE_TYPE_LIST 0x01 #define TREEBOX_ALLITEM_ACCROLE_TYPE_LIST 0x01
#define TREEBOX_ALLITEM_ACCROLE_TYPE_TREE 0x02 #define TREEBOX_ALLITEM_ACCROLE_TYPE_TREE 0x02
...@@ -261,7 +269,7 @@ protected: ...@@ -261,7 +269,7 @@ protected:
SvTreeListEntry* pTargetEntry; SvTreeListEntry* pTargetEntry;
SvLBoxButtonData* pCheckButtonData; SvLBoxButtonData* pCheckButtonData;
std::vector<SvLBoxTab*> aTabs; std::vector<SvLBoxTab*> aTabs;
sal_uInt16 nTreeFlags; SvTreeFlags nTreeFlags;
sal_uInt16 nImpFlags; sal_uInt16 nImpFlags;
// Move/CopySelection: Position of the current Entry in SelectionList // Move/CopySelection: Position of the current Entry in SelectionList
sal_uInt16 nCurEntrySelPos; sal_uInt16 nCurEntrySelPos;
...@@ -527,7 +535,7 @@ public: ...@@ -527,7 +535,7 @@ public:
void SetAllEntriesAccessibleRoleType( short n ) { nAllItemAccRoleType = n; } void SetAllEntriesAccessibleRoleType( short n ) { nAllItemAccRoleType = n; }
short GetAllEntriesAccessibleRoleType() const { return nAllItemAccRoleType; } short GetAllEntriesAccessibleRoleType() const { return nAllItemAccRoleType; }
sal_uInt16 GetTreeFlags() const {return nTreeFlags;} SvTreeFlags GetTreeFlags() const {return nTreeFlags;}
OUString headString; OUString headString;
OUString SearchEntryTextWithHeadTitle(SvTreeListEntry* pEntry); OUString SearchEntryTextWithHeadTitle(SvTreeListEntry* pEntry);
......
...@@ -435,7 +435,7 @@ SvLBoxItem* SvSimpleTable::GetEntryAtPos( SvTreeListEntry* pEntry, sal_uInt16 nP ...@@ -435,7 +435,7 @@ SvLBoxItem* SvSimpleTable::GetEntryAtPos( SvTreeListEntry* pEntry, sal_uInt16 nP
nPos++; nPos++;
if( nTreeFlags & TREEFLAG_CHKBTN ) nPos++; if( nTreeFlags & SvTreeFlags::CHKBTN ) nPos++;
if( nPos < nCount ) if( nPos < nCount )
{ {
......
...@@ -3257,7 +3257,7 @@ void SvImpLBox::SetUpdateMode( bool bMode ) ...@@ -3257,7 +3257,7 @@ void SvImpLBox::SetUpdateMode( bool bMode )
bool SvImpLBox::SetMostRight( SvTreeListEntry* pEntry ) bool SvImpLBox::SetMostRight( SvTreeListEntry* pEntry )
{ {
if( pView->nTreeFlags & TREEFLAG_RECALCTABS ) if( pView->nTreeFlags & SvTreeFlags::RECALCTABS )
{ {
nFlags |= F_IGNORE_CHANGED_TABS; nFlags |= F_IGNORE_CHANGED_TABS;
pView->SetTabs(); pView->SetTabs();
......
...@@ -141,7 +141,7 @@ void SvTabListBox::SetTabs(const long* pTabs, MapUnit eMapUnit) ...@@ -141,7 +141,7 @@ void SvTabListBox::SetTabs(const long* pTabs, MapUnit eMapUnit)
pTabList[nIdx].SetPos( nNewTab ); pTabList[nIdx].SetPos( nNewTab );
pTabList[nIdx].nFlags=(SvLBoxTabFlags::ADJUST_LEFT| SvLBoxTabFlags::INV_ALWAYS); pTabList[nIdx].nFlags=(SvLBoxTabFlags::ADJUST_LEFT| SvLBoxTabFlags::INV_ALWAYS);
} }
SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS; SvTreeListBox::nTreeFlags |= SvTreeFlags::RECALCTABS;
if( IsUpdateMode() ) if( IsUpdateMode() )
Invalidate(); Invalidate();
} }
...@@ -158,7 +158,7 @@ void SvTabListBox::SetTab( sal_uInt16 nTab,long nValue,MapUnit eMapUnit ) ...@@ -158,7 +158,7 @@ void SvTabListBox::SetTab( sal_uInt16 nTab,long nValue,MapUnit eMapUnit )
aSize = LogicToLogic( aSize, &aMMSource, &aMMDest ); aSize = LogicToLogic( aSize, &aMMSource, &aMMDest );
nValue = aSize.Width(); nValue = aSize.Width();
pTabList[ nTab ].SetPos( nValue ); pTabList[ nTab ].SetPos( nValue );
SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS; SvTreeListBox::nTreeFlags |= SvTreeFlags::RECALCTABS;
if( IsUpdateMode() ) if( IsUpdateMode() )
Invalidate(); Invalidate();
} }
...@@ -477,14 +477,14 @@ void SvTabListBox::SetTabJustify( sal_uInt16 nTab, SvTabJustify eJustify) ...@@ -477,14 +477,14 @@ void SvTabListBox::SetTabJustify( sal_uInt16 nTab, SvTabJustify eJustify)
nFlags &= (~MYTABMASK); nFlags &= (~MYTABMASK);
nFlags |= static_cast<SvLBoxTabFlags>(eJustify); nFlags |= static_cast<SvLBoxTabFlags>(eJustify);
pTab->nFlags = nFlags; pTab->nFlags = nFlags;
SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS; SvTreeListBox::nTreeFlags |= SvTreeFlags::RECALCTABS;
if( IsUpdateMode() ) if( IsUpdateMode() )
Invalidate(); Invalidate();
} }
long SvTabListBox::GetLogicTab( sal_uInt16 nTab ) long SvTabListBox::GetLogicTab( sal_uInt16 nTab )
{ {
if( SvTreeListBox::nTreeFlags & TREEFLAG_RECALCTABS ) if( SvTreeListBox::nTreeFlags & SvTreeFlags::RECALCTABS )
((SvTabListBox*)this)->SetTabs(); ((SvTabListBox*)this)->SetTabs();
DBG_ASSERT(nTab<nTabCount,"GetTabPos:Invalid Tab"); DBG_ASSERT(nTab<nTabCount,"GetTabPos:Invalid Tab");
......
...@@ -334,7 +334,7 @@ SvTreeListEntry* SvxRedlinTable::CreateEntry() const ...@@ -334,7 +334,7 @@ SvTreeListEntry* SvxRedlinTable::CreateEntry() const
void SvxRedlinTable::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, void SvxRedlinTable::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr,
const Image& rColl, const Image& rExp, SvLBoxButtonKind eButtonKind) const Image& rColl, const Image& rExp, SvLBoxButtonKind eButtonKind)
{ {
if (nTreeFlags & TREEFLAG_CHKBTN) if (nTreeFlags & SvTreeFlags::CHKBTN)
{ {
pEntry->AddItem(new SvLBoxButton(pEntry, eButtonKind, 0, pCheckButtonData)); pEntry->AddItem(new SvLBoxButton(pEntry, eButtonKind, 0, pCheckButtonData));
} }
......
...@@ -136,7 +136,7 @@ void SvxFontListBox::InitEntry( ...@@ -136,7 +136,7 @@ void SvxFontListBox::InitEntry(
{ {
if( mbUseFont ) if( mbUseFont )
{ {
if( nTreeFlags & TREEFLAG_CHKBTN ) if( nTreeFlags & SvTreeFlags::CHKBTN )
pEntry->AddItem( new SvLBoxButton( pEntry, eButtonKind, 0, pEntry->AddItem( new SvLBoxButton( pEntry, eButtonKind, 0,
pCheckButtonData ) ); pCheckButtonData ) );
pEntry->AddItem( new SvLBoxContextBmp(pEntry, 0, rCollImg, rExpImg, true) ); pEntry->AddItem( new SvLBoxContextBmp(pEntry, 0, rCollImg, rExpImg, true) );
......
...@@ -318,7 +318,7 @@ SvLBoxItem* DictionaryList::getItemAtColumn( SvTreeListEntry* pEntry, sal_uInt16 ...@@ -318,7 +318,7 @@ SvLBoxItem* DictionaryList::getItemAtColumn( SvTreeListEntry* pEntry, sal_uInt16
{ {
sal_uInt16 nCount = pEntry->ItemCount(); sal_uInt16 nCount = pEntry->ItemCount();
nColumn++; nColumn++;
if( nTreeFlags & TREEFLAG_CHKBTN ) if( nTreeFlags & SvTreeFlags::CHKBTN )
nColumn++; nColumn++;
if( nColumn < nCount ) if( nColumn < nCount )
pItem = pEntry->GetItem( nColumn ); pItem = pEntry->GetItem( nColumn );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment