summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-18 12:46:20 +0200
committerNoel Grandin <noel@peralex.com>2016-03-18 12:46:35 +0200
commitc91b103930f4f441ab333d6f3026d6c19d4b4d0f (patch)
treeb3bb0edd19ebf20bdca3c9b3605cec986d2e650f /dbaccess
parent1c73135493e844c04446f58e7001920381787317 (diff)
convert SvButtonState to scoped enum
Change-Id: I601f9e2fe33e85cf3f7dc52ee20d68202bd2b09d
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/control/marktree.cxx18
-rw-r--r--dbaccess/source/ui/control/tabletree.cxx6
-rw-r--r--dbaccess/source/ui/dlg/tablespage.cxx6
-rw-r--r--dbaccess/source/ui/misc/WNameMatch.cxx6
4 files changed, 18 insertions, 18 deletions
diff --git a/dbaccess/source/ui/control/marktree.cxx b/dbaccess/source/ui/control/marktree.cxx
index 9484b29a5bb9..9bcd358b30a9 100644
--- a/dbaccess/source/ui/control/marktree.cxx
+++ b/dbaccess/source/ui/control/marktree.cxx
@@ -79,10 +79,10 @@ void OMarkableTreeListBox::KeyInput( const KeyEvent& rKEvt )
if(pCurrentHandlerEntry)
{
SvButtonState eState = GetCheckButtonState( pCurrentHandlerEntry);
- if(eState == SV_BUTTON_CHECKED)
- SetCheckButtonState( pCurrentHandlerEntry, SV_BUTTON_UNCHECKED);
+ if(eState == SvButtonState::Checked)
+ SetCheckButtonState( pCurrentHandlerEntry, SvButtonState::Unchecked);
else
- SetCheckButtonState( pCurrentHandlerEntry, SV_BUTTON_CHECKED);
+ SetCheckButtonState( pCurrentHandlerEntry, SvButtonState::Checked);
CheckButtonHdl();
}
@@ -108,10 +108,10 @@ SvButtonState OMarkableTreeListBox::implDetermineState(SvTreeListEntry* _pEntry)
while (pChildLoop)
{
SvButtonState eChildState = implDetermineState(pChildLoop);
- if (SV_BUTTON_TRISTATE == eChildState)
+ if (SvButtonState::Tristate == eChildState)
break;
- if (SV_BUTTON_CHECKED == eChildState)
+ if (SvButtonState::Checked == eChildState)
++nCheckedChildren;
++nChildrenOverall;
@@ -121,7 +121,7 @@ SvButtonState OMarkableTreeListBox::implDetermineState(SvTreeListEntry* _pEntry)
if (pChildLoop)
{
// we did not finish the loop because at least one of the children is in tristate
- eState = SV_BUTTON_TRISTATE;
+ eState = SvButtonState::Tristate;
// but this means that we did not finish all the siblings of pChildLoop,
// so their checking may be incorrect at the moment
@@ -138,13 +138,13 @@ SvButtonState OMarkableTreeListBox::implDetermineState(SvTreeListEntry* _pEntry)
// we have at least one child checked
if (nCheckedChildren != nChildrenOverall)
// not all children are checked
- eState = SV_BUTTON_TRISTATE;
+ eState = SvButtonState::Tristate;
else
// all children are checked
- eState = SV_BUTTON_CHECKED;
+ eState = SvButtonState::Checked;
else
// no children are checked
- eState = SV_BUTTON_UNCHECKED;
+ eState = SvButtonState::Unchecked;
// finally set the entry to the state we just determined
SetCheckButtonState(_pEntry, eState);
diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx
index 18887ded2c26..10dde93ce558 100644
--- a/dbaccess/source/ui/control/tabletree.cxx
+++ b/dbaccess/source/ui/control/tabletree.cxx
@@ -339,7 +339,7 @@ bool OTableTreeListBox::isWildcardChecked(SvTreeListEntry* _pEntry)
void OTableTreeListBox::checkWildcard(SvTreeListEntry* _pEntry)
{
- SetCheckButtonState(_pEntry, SV_BUTTON_CHECKED);
+ SetCheckButtonState(_pEntry, SvButtonState::Checked);
checkedButton_noBroadcast(_pEntry);
}
@@ -357,8 +357,8 @@ void OTableTreeListBox::checkedButton_noBroadcast(SvTreeListEntry* _pEntry)
// So we track explicit (un)checking
SvButtonState eState = GetCheckButtonState(_pEntry);
- OSL_ENSURE(SV_BUTTON_TRISTATE != eState, "OTableTreeListBox::CheckButtonHdl: user action which lead to TRISTATE?");
- implEmphasize(_pEntry, SV_BUTTON_CHECKED == eState);
+ OSL_ENSURE(SvButtonState::Tristate != eState, "OTableTreeListBox::CheckButtonHdl: user action which lead to TRISTATE?");
+ implEmphasize(_pEntry, SvButtonState::Checked == eState);
}
void OTableTreeListBox::implEmphasize(SvTreeListEntry* _pEntry, bool _bChecked, bool _bUpdateDescendants, bool _bUpdateAncestors)
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index eae9b041da15..7c1686c62450 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -197,7 +197,7 @@ namespace dbaui
SvTreeListEntry* pEntry = m_pTablesList->GetEntryPosByName(sName, pSchema ? pSchema : (pCatalog ? pCatalog : pRootEntry) );
if (pEntry)
- m_pTablesList->SetCheckButtonState(pEntry, SV_BUTTON_CHECKED);
+ m_pTablesList->SetCheckButtonState(pEntry, SvButtonState::Checked);
}
m_pTablesList->CheckButtons();
}
@@ -372,7 +372,7 @@ namespace dbaui
void OTableSubscriptionPage::CheckAll( bool _bCheck )
{
- SvButtonState eState = _bCheck ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED;
+ SvButtonState eState = _bCheck ? SvButtonState::Checked : SvButtonState::Unchecked;
SvTreeListEntry* pEntry = m_pTablesList->First();
while (pEntry)
{
@@ -455,7 +455,7 @@ namespace dbaui
SvTreeListEntry* pSchema = nullptr;
SvTreeListEntry* pCatalog = nullptr;
- if (m_pTablesList->GetCheckButtonState(pEntry) == SV_BUTTON_CHECKED && !m_pTablesList->GetModel()->HasChildren(pEntry))
+ if (m_pTablesList->GetCheckButtonState(pEntry) == SvButtonState::Checked && !m_pTablesList->GetModel()->HasChildren(pEntry))
{ // checked and a leaf, which means it's no catalog, no schema, but a real table
OUString sCatalog;
if(m_pTablesList->GetModel()->HasParent(pEntry))
diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx
index a8c5fea0f2f3..5d8fe30baf78 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -160,7 +160,7 @@ bool OWizNameMatching::LeavePage()
;
const sal_Int32 nPos = ::std::distance(rSrcColumns.begin(),aSrcIter);
- if(m_pCTRL_LEFT->GetCheckButtonState(pLeftEntry) == SV_BUTTON_CHECKED)
+ if(m_pCTRL_LEFT->GetCheckButtonState(pLeftEntry) == SvButtonState::Checked)
{
OFieldDescription* pDestField = static_cast<OFieldDescription*>(pRightEntry->GetUserData());
OSL_ENSURE(pDestField,"OWizNameMatching: OColumn can not be null!");
@@ -324,7 +324,7 @@ IMPL_LINK_TYPED( OWizNameMatching, AllNoneClickHdl, Button *, pButton, void )
SvTreeListEntry* pEntry = m_pCTRL_LEFT->First();
while(pEntry)
{
- m_pCTRL_LEFT->SetCheckButtonState( pEntry, bAll ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED);
+ m_pCTRL_LEFT->SetCheckButtonState( pEntry, bAll ? SvButtonState::Checked : SvButtonState::Unchecked);
pEntry = m_pCTRL_LEFT->Next(pEntry);
}
}
@@ -397,7 +397,7 @@ void OColumnTreeBox::FillListBox( const ODatabaseExport::TColumnVector& _rList)
for(;aIter != aEnd;++aIter)
{
SvTreeListEntry* pEntry = InsertEntry((*aIter)->first, nullptr, false, TREELIST_APPEND, (*aIter)->second);
- SvButtonState eState = !(m_bReadOnly && (*aIter)->second->IsAutoIncrement()) ? SV_BUTTON_CHECKED : SV_BUTTON_UNCHECKED;
+ SvButtonState eState = !(m_bReadOnly && (*aIter)->second->IsAutoIncrement()) ? SvButtonState::Checked : SvButtonState::Unchecked;
SetCheckButtonState( pEntry, eState );
}
}