summaryrefslogtreecommitdiff
path: root/svtools/source/table/tablecontrol_impl.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-05-29 17:12:52 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-30 06:41:28 +0000
commitc47b170c71ecdcaacf2e12e5ce28e7d411bb52e6 (patch)
treed9cfdc4f6be613f7b2523a64978686f85cc5ed68 /svtools/source/table/tablecontrol_impl.cxx
parent8ac4240efe975e9689e8dfc23dc3c1b88eee6dcf (diff)
Convert SelectionMode to scoped enum
Change-Id: I86c435de3918540cb54a0cb24568e58456c2f9d1 Reviewed-on: https://gerrit.libreoffice.org/25611 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools/source/table/tablecontrol_impl.cxx')
-rw-r--r--svtools/source/table/tablecontrol_impl.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index b8eb95c5bf7b..f87c0f168413 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -248,7 +248,7 @@ namespace svt { namespace table
,m_pAccessibleTable ( nullptr )
{
m_pSelEngine = new SelectionEngine( m_pDataWindow.get(), m_pTableFunctionSet );
- m_pSelEngine->SetSelectionMode(SINGLE_SELECTION);
+ m_pSelEngine->SetSelectionMode(SelectionMode::Single);
m_pDataWindow->SetPosPixel( Point( 0, 0 ) );
m_pDataWindow->Show();
}
@@ -1308,7 +1308,7 @@ namespace svt { namespace table
switch ( _eAction )
{
case cursorDown:
- if ( m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION )
+ if ( m_pSelEngine->GetSelectionMode() == SelectionMode::Single )
{
//if other rows already selected, deselect them
if(!m_aSelectedRows.empty())
@@ -1336,7 +1336,7 @@ namespace svt { namespace table
break;
case cursorUp:
- if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ if(m_pSelEngine->GetSelectionMode() == SelectionMode::Single)
{
if(!m_aSelectedRows.empty())
{
@@ -1420,7 +1420,7 @@ namespace svt { namespace table
case cursorSelectRow:
{
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE)
return bSuccess = false;
//pos is the position of the current row in the vector of selected rows, if current row is selected
int pos = getRowSelectedNumber(m_aSelectedRows, m_nCurRow);
@@ -1441,9 +1441,9 @@ namespace svt { namespace table
break;
case cursorSelectRowUp:
{
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE)
return bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ else if(m_pSelEngine->GetSelectionMode() == SelectionMode::Single)
{
//if there are other selected rows, deselect them
return false;
@@ -1526,9 +1526,9 @@ namespace svt { namespace table
break;
case cursorSelectRowDown:
{
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE)
bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ else if(m_pSelEngine->GetSelectionMode() == SelectionMode::Single)
{
bSuccess = false;
}
@@ -1608,9 +1608,9 @@ namespace svt { namespace table
case cursorSelectRowAreaTop:
{
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE)
bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ else if(m_pSelEngine->GetSelectionMode() == SelectionMode::Single)
bSuccess = false;
else
{
@@ -1636,9 +1636,9 @@ namespace svt { namespace table
case cursorSelectRowAreaBottom:
{
- if(m_pSelEngine->GetSelectionMode() == NO_SELECTION)
+ if(m_pSelEngine->GetSelectionMode() == SelectionMode::NONE)
return bSuccess = false;
- else if(m_pSelEngine->GetSelectionMode() == SINGLE_SELECTION)
+ else if(m_pSelEngine->GetSelectionMode() == SelectionMode::Single)
return bSuccess = false;
//select the region between the current and the last row
RowPos iter = m_nCurRow;
@@ -2265,7 +2265,7 @@ namespace svt { namespace table
SelectionMode const eSelMode = getSelEngine()->GetSelectionMode();
switch ( eSelMode )
{
- case SINGLE_SELECTION:
+ case SelectionMode::Single:
if ( !m_aSelectedRows.empty() )
{
OSL_ENSURE( m_aSelectedRows.size() == 1, "TableControl::markRowAsSelected: SingleSelection with more than one selected element?" );
@@ -2274,7 +2274,7 @@ namespace svt { namespace table
}
SAL_FALLTHROUGH;
- case MULTIPLE_SELECTION:
+ case SelectionMode::Multiple:
m_aSelectedRows.push_back( i_rowIndex );
break;
@@ -2300,7 +2300,7 @@ namespace svt { namespace table
bool TableControl_Impl::markAllRowsAsSelected()
{
SelectionMode const eSelMode = getSelEngine()->GetSelectionMode();
- ENSURE_OR_RETURN_FALSE( eSelMode == MULTIPLE_SELECTION, "TableControl_Impl::markAllRowsAsSelected: unsupported selection mode!" );
+ ENSURE_OR_RETURN_FALSE( eSelMode == SelectionMode::Multiple, "TableControl_Impl::markAllRowsAsSelected: unsupported selection mode!" );
if ( m_aSelectedRows.size() == size_t( m_pModel->getRowCount() ) )
{
@@ -2528,7 +2528,7 @@ namespace svt { namespace table
m_pTableControl->markRowAsSelected( newRow );
else
{
- if ( m_pTableControl->getSelEngine()->GetSelectionMode() == SINGLE_SELECTION )
+ if ( m_pTableControl->getSelEngine()->GetSelectionMode() == SelectionMode::Single )
{
DeselectAll();
m_pTableControl->markRowAsSelected( newRow );
@@ -2538,7 +2538,7 @@ namespace svt { namespace table
m_pTableControl->markRowAsSelected( newRow );
}
}
- if ( m_pTableControl->getSelectedRowCount() > 1 && m_pTableControl->getSelEngine()->GetSelectionMode() != SINGLE_SELECTION )
+ if ( m_pTableControl->getSelectedRowCount() > 1 && m_pTableControl->getSelEngine()->GetSelectionMode() != SelectionMode::Single )
m_pTableControl->getSelEngine()->AddAlways(true);
m_pTableControl->invalidateRow( newRow );