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