diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2016-05-29 17:12:52 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-30 06:41:28 +0000 |
commit | c47b170c71ecdcaacf2e12e5ce28e7d411bb52e6 (patch) | |
tree | d9cfdc4f6be613f7b2523a64978686f85cc5ed68 /svtools | |
parent | 8ac4240efe975e9689e8dfc23dc3c1b88eee6dcf (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')
-rw-r--r-- | svtools/source/contnr/fileview.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/iconviewimpl.cxx | 2 | ||||
-rw-r--r-- | svtools/source/contnr/imivctl1.cxx | 40 | ||||
-rw-r--r-- | svtools/source/contnr/svimpbox.cxx | 38 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 10 | ||||
-rw-r--r-- | svtools/source/inc/svimpbox.hxx | 2 | ||||
-rw-r--r-- | svtools/source/table/mousefunction.cxx | 4 | ||||
-rw-r--r-- | svtools/source/table/tablecontrol.cxx | 2 | ||||
-rw-r--r-- | svtools/source/table/tablecontrol_impl.cxx | 34 | ||||
-rw-r--r-- | svtools/source/uno/svtxgridcontrol.cxx | 14 | ||||
-rw-r--r-- | svtools/source/uno/treecontrolpeer.cxx | 16 |
11 files changed, 82 insertions, 82 deletions
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 7ccefa53ef48..d287cea38b41 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -523,7 +523,7 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( vcl::Window* pParentWin, SetHighlightRange(); SetEntryHeight( ROW_HEIGHT ); if (nFlags & FileViewFlags::MULTISELECTION) - SetSelectionMode( MULTIPLE_SELECTION ); + SetSelectionMode( SelectionMode::Multiple ); Show(); if( mbShowHeader ) diff --git a/svtools/source/contnr/iconviewimpl.cxx b/svtools/source/contnr/iconviewimpl.cxx index 55242a393219..5328d50156cc 100644 --- a/svtools/source/contnr/iconviewimpl.cxx +++ b/svtools/source/contnr/iconviewimpl.cxx @@ -419,7 +419,7 @@ void IconViewImpl::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rR if (!pCursor && ((nExtendedWinBits & EWB_NO_AUTO_CURENTRY) == 0)) { // do not select if multiselection or explicit set - bool bNotSelect = (aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) || ((m_nStyle & WB_NOINITIALSELECTION) == WB_NOINITIALSELECTION); + bool bNotSelect = (aSelEng.GetSelectionMode() == SelectionMode::Multiple ) || ((m_nStyle & WB_NOINITIALSELECTION) == WB_NOINITIALSELECTION); SetCursor(pStartEntry, bNotSelect); } diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index 77f358d299f8..75c79f3a5b90 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -115,7 +115,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( bUpdateMode = true; bEntryEditingEnabled = false; bHighlightFramePressed = false; - eSelectionMode = MULTIPLE_SELECTION; + eSelectionMode = SelectionMode::Multiple; pView = pCurView; pZOrderList = new SvxIconChoiceCtrlEntryList_impl(); ePositionMode = IcnViewPositionModeFree; @@ -230,7 +230,7 @@ void SvxIconChoiceCtrl_Impl::SetStyle( WinBits nWinStyle ) if( nWinBits & (WB_SMALLICON | WB_DETAILS) ) nCurTextDrawFlags = DRAWTEXT_FLAGS_SMALLICON; if( nWinBits & WB_NOSELECTION ) - eSelectionMode = NO_SELECTION; + eSelectionMode = SelectionMode::NONE; if( !(nWinStyle & (WB_ALIGN_TOP | WB_ALIGN_LEFT))) nWinBits |= WB_ALIGN_LEFT; if( (nWinStyle & WB_DETAILS)) @@ -353,7 +353,7 @@ void SvxIconChoiceCtrl_Impl::SetListPositions() void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, bool bSelect, bool bAdd, bool bSyncPaint ) { - if( eSelectionMode == NO_SELECTION ) + if( eSelectionMode == SelectionMode::NONE ) return; if( !bAdd ) @@ -392,7 +392,7 @@ void SvxIconChoiceCtrl_Impl::EntrySelected(SvxIconChoiceCtrlEntry* pEntry, bool // When using SingleSelection, make sure that the cursor is always placed // over the (only) selected entry. (But only if a cursor exists.) if (bSelect && pCursor && - eSelectionMode == SINGLE_SELECTION && + eSelectionMode == SelectionMode::Single && pEntry != pCursor) { SetCursor(pEntry); @@ -728,7 +728,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) if( pEntry ) MakeEntryVisible( pEntry, false ); - if( rMEvt.IsShift() && eSelectionMode != SINGLE_SELECTION ) + if( rMEvt.IsShift() && eSelectionMode != SelectionMode::Single ) { if( pEntry ) SetCursor_Impl( pCursor, pEntry, rMEvt.IsMod1(), rMEvt.IsShift(), true); @@ -737,7 +737,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) if( pAnchor && (rMEvt.IsShift() || rMEvt.IsMod1())) // keyboard selection? { - DBG_ASSERT(eSelectionMode != SINGLE_SELECTION,"Invalid selection mode"); + DBG_ASSERT(eSelectionMode != SelectionMode::Single,"Invalid selection mode"); if( rMEvt.IsMod1() ) nFlags |= IconChoiceFlags::AddMode; @@ -769,7 +769,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) { if( !pEntry ) { - if( eSelectionMode == MULTIPLE_SELECTION ) + if( eSelectionMode == SelectionMode::Multiple ) { if( !rMEvt.IsMod1() ) // Ctrl { @@ -810,7 +810,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) EditEntry( pEntry ); } } - else if( eSelectionMode == SINGLE_SELECTION ) + else if( eSelectionMode == SelectionMode::Single ) { DeselectAllBut( pEntry ); SetCursor( pEntry ); @@ -820,7 +820,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) nFlags |= IconChoiceFlags::StartEditTimerInMouseUp; } } - else if( eSelectionMode == NO_SELECTION ) + else if( eSelectionMode == SelectionMode::NONE ) { if( rMEvt.IsLeft() && (nWinBits & WB_HIGHLIGHTFRAME) ) { @@ -938,7 +938,7 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, { SvxIconChoiceCtrlEntry* pFilterEntry = nullptr; bool bDeselectAll = false; - if( eSelectionMode != SINGLE_SELECTION ) + if( eSelectionMode != SelectionMode::Single ) { if( !bMod1 && !bShift ) bDeselectAll = true; @@ -1004,7 +1004,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) bool bMod1 = rKEvt.GetKeyCode().IsMod1(); bool bShift = rKEvt.GetKeyCode().IsShift(); - if( eSelectionMode == SINGLE_SELECTION || eSelectionMode == NO_SELECTION) + if( eSelectionMode == SelectionMode::Single || eSelectionMode == SelectionMode::NONE) { bShift = false; bMod1 = false; @@ -1117,7 +1117,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) break; case KEY_SPACE: - if( pCursor && eSelectionMode != SINGLE_SELECTION ) + if( pCursor && eSelectionMode != SelectionMode::Single ) { if( !bMod1 ) { @@ -1154,7 +1154,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) case KEY_ADD: case KEY_DIVIDE : case KEY_A: - if( bMod1 && (eSelectionMode != SINGLE_SELECTION)) + if( bMod1 && (eSelectionMode != SelectionMode::Single)) SelectAll(); else bKeyUsed = false; @@ -1510,7 +1510,7 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis(const Rectangle& rTextRect, bool bSel bool bSolidTextRect = false; - if(bDropTarget && (eSelectionMode != NO_SELECTION)) + if(bDropTarget && (eSelectionMode != SelectionMode::NONE)) { rRenderContext.SetFillColor(rSettings.GetHighlightColor()); bSolidTextRect = true; @@ -1592,7 +1592,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po { bool bSelected = false; - if (eSelectionMode != NO_SELECTION) + if (eSelectionMode != SelectionMode::NONE) bSelected = pEntry->IsSelected(); bool bCursored = pEntry->IsCursored(); @@ -1605,7 +1605,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po Rectangle aTextRect(CalcTextRect(pEntry, &rPos, false, &aEntryText)); Rectangle aBmpRect(CalcBmpRect(pEntry, &rPos)); - bool bShowSelection = ((bSelected && !bCursored) && !bNoEmphasis && (eSelectionMode != NO_SELECTION)); + bool bShowSelection = ((bSelected && !bCursored) && !bNoEmphasis && (eSelectionMode != SelectionMode::NONE)); bool bActiveSelection = (0 != (nWinBits & WB_NOHIDESELECTION)) || pView->HasFocus(); @@ -1992,7 +1992,7 @@ void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry ) { if( pEntry == pCursor ) { - if( pCursor && eSelectionMode == SINGLE_SELECTION && + if( pCursor && eSelectionMode == SelectionMode::Single && !pCursor->IsSelected() ) SelectEntry( pCursor, true ); return; @@ -2003,14 +2003,14 @@ void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry ) if( pOldCursor ) { pOldCursor->ClearFlags( SvxIconViewFlags::FOCUSED ); - if( eSelectionMode == SINGLE_SELECTION ) + if( eSelectionMode == SelectionMode::Single ) SelectEntry( pOldCursor, false ); // deselect old cursor } if( pCursor ) { ToTop( pCursor ); pCursor->SetFlags( SvxIconViewFlags::FOCUSED ); - if( eSelectionMode == SINGLE_SELECTION ) + if( eSelectionMode == SelectionMode::Single ) SelectEntry( pCursor, true ); ShowCursor( true ); } @@ -2996,7 +2996,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry() const if( !GetSelectionCount() ) return nullptr; - if( (nWinBits & WB_HIGHLIGHTFRAME) && (eSelectionMode == NO_SELECTION) ) + if( (nWinBits & WB_HIGHLIGHTFRAME) && (eSelectionMode == SelectionMode::NONE) ) { return pCurHighlightFrame; } diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index d38087030acf..fd412c930640 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -64,7 +64,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* pLBTree, WinBits nWinS aSelEng.SetFunctionSet( static_cast<FunctionSet*>(&aFctSet) ); aSelEng.ExpandSelectionOnMouseMove( false ); SetStyle( nWinStyle ); - SetSelectionMode( SINGLE_SELECTION ); + SetSelectionMode( SelectionMode::Single ); SetDragDropMode( DragDropMode::NONE ); aVerSBar->SetScrollHdl( LINK( this, SvImpLBox, ScrollUpDownHdl ) ); @@ -240,7 +240,7 @@ void SvImpLBox::CalcCellFocusRect( SvTreeListEntry* pEntry, Rectangle& rRect ) void SvImpLBox::SetStyle( WinBits i_nWinStyle ) { m_nStyle = i_nWinStyle; - if ( ( m_nStyle & WB_SIMPLEMODE) && ( aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) ) + if ( ( m_nStyle & WB_SIMPLEMODE) && ( aSelEng.GetSelectionMode() == SelectionMode::Multiple ) ) aSelEng.AddAlways( true ); } @@ -643,7 +643,7 @@ void SvImpLBox::SetCursor( SvTreeListEntry* pEntry, bool bForceNoSelect ) // multiple selection: select in cursor move if we're not in // Add mode (Ctrl-F8) else if( GetUpdateMode() && - pView->GetSelectionMode() == MULTIPLE_SELECTION && + pView->GetSelectionMode() == SelectionMode::Multiple && !(nFlags & LBoxFlags::DeselectAll) && !aSelEng.IsAddMode() && !bForceNoSelect ) { @@ -661,7 +661,7 @@ void SvImpLBox::SetCursor( SvTreeListEntry* pEntry, bool bForceNoSelect ) if( pAnchor ) { - DBG_ASSERT(aSelEng.GetSelectionMode() != SINGLE_SELECTION,"Mode?"); + DBG_ASSERT(aSelEng.GetSelectionMode() != SelectionMode::Single,"Mode?"); SetAnchorSelection( pOldCursor, pCursor ); } } @@ -853,7 +853,7 @@ SvTreeListEntry* SvImpLBox::MakePointVisible(const Point& rPoint) if( pEntry ) { if( pEntry != pCursor && - aSelEng.GetSelectionMode() == SINGLE_SELECTION + aSelEng.GetSelectionMode() == SelectionMode::Single ) pView->Select( pCursor, false ); } @@ -930,7 +930,7 @@ void SvImpLBox::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect if (!pCursor && ((nExtendedWinBits & EWB_NO_AUTO_CURENTRY) == 0)) { // do not select if multiselection or explicit set - bool bNotSelect = (aSelEng.GetSelectionMode() == MULTIPLE_SELECTION ) || ((m_nStyle & WB_NOINITIALSELECTION) == WB_NOINITIALSELECTION); + bool bNotSelect = (aSelEng.GetSelectionMode() == SelectionMode::Multiple ) || ((m_nStyle & WB_NOINITIALSELECTION) == WB_NOINITIALSELECTION); SetCursor(pStartEntry, bNotSelect); } @@ -1600,7 +1600,7 @@ void SvImpLBox::EntrySelected( SvTreeListEntry* pEntry, bool bSelect ) nFlags &= (~LBoxFlags::DeselectAll); if( bSelect && - aSelEng.GetSelectionMode() == SINGLE_SELECTION && + aSelEng.GetSelectionMode() == SelectionMode::Single && pEntry != pCursor ) { SetCursor( pEntry ); @@ -2069,13 +2069,13 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt ) return; // Inplace-Editing? } - if ( aSelEng.GetSelectionMode() != NO_SELECTION ) + if ( aSelEng.GetSelectionMode() != SelectionMode::NONE ) aSelEng.SelMouseButtonDown( rMEvt ); } void SvImpLBox::MouseButtonUp( const MouseEvent& rMEvt) { - if ( !ButtonUpCheckCtrl( rMEvt ) && ( aSelEng.GetSelectionMode() != NO_SELECTION ) ) + if ( !ButtonUpCheckCtrl( rMEvt ) && ( aSelEng.GetSelectionMode() != SelectionMode::NONE ) ) aSelEng.SelMouseButtonUp( rMEvt ); EndScroll(); if( nFlags & LBoxFlags::StartEditTimer ) @@ -2091,7 +2091,7 @@ void SvImpLBox::MouseButtonUp( const MouseEvent& rMEvt) void SvImpLBox::MouseMove( const MouseEvent& rMEvt) { SvTreeListEntry* pEntry = GetClickedEntry( rMEvt.GetPosPixel() ); - if ( !MouseMoveCheckCtrl( rMEvt, pEntry ) && ( aSelEng.GetSelectionMode() != NO_SELECTION ) ) + if ( !MouseMoveCheckCtrl( rMEvt, pEntry ) && ( aSelEng.GetSelectionMode() != SelectionMode::NONE ) ) aSelEng.SelMouseMove( rMEvt ); return; } @@ -2337,11 +2337,11 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) break; case KEY_SPACE: - if ( pView->GetSelectionMode() != NO_SELECTION ) + if ( pView->GetSelectionMode() != SelectionMode::NONE ) { if ( bMod1 ) { - if ( pView->GetSelectionMode() == MULTIPLE_SELECTION && !bShift ) + if ( pView->GetSelectionMode() == SelectionMode::Multiple && !bShift ) // toggle selection pView->Select( pCursor, !pView->IsSelected( pCursor ) ); } @@ -2390,7 +2390,7 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) break; case KEY_F8: - if( bShift && pView->GetSelectionMode()==MULTIPLE_SELECTION && + if( bShift && pView->GetSelectionMode()==SelectionMode::Multiple && !(m_nStyle & WB_SIMPLEMODE)) { if( aSelEng.IsAlwaysAdding() ) @@ -2846,11 +2846,11 @@ void SvImpLBox::SelAllDestrAnch( void SvImpLBox::SetSelectionMode( SelectionMode eSelMode ) { aSelEng.SetSelectionMode( eSelMode); - if( eSelMode == SINGLE_SELECTION ) + if( eSelMode == SelectionMode::Single ) bSimpleTravel = true; else bSimpleTravel = false; - if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) ) + if( (m_nStyle & WB_SIMPLEMODE) && (eSelMode == SelectionMode::Multiple) ) aSelEng.AddAlways( true ); } @@ -2969,7 +2969,7 @@ void SvImpLBox::Command( const CommandEvent& rCEvt ) pView->SetCursor( pClickedEntry ); } } - else if( aSelEng.GetSelectionMode() == SINGLE_SELECTION ) + else if( aSelEng.GetSelectionMode() == SelectionMode::Single ) { bClickedIsFreePlace = true; sal_Int32 nSelectedEntries = pView->GetSelectionCount(); @@ -3090,14 +3090,14 @@ void SvImpLBox::Invalidate() void SvImpLBox::SetCurEntry( SvTreeListEntry* pEntry ) { - if ( ( aSelEng.GetSelectionMode() != SINGLE_SELECTION ) - && ( aSelEng.GetSelectionMode() != NO_SELECTION ) + if ( ( aSelEng.GetSelectionMode() != SelectionMode::Single ) + && ( aSelEng.GetSelectionMode() != SelectionMode::NONE ) ) SelAllDestrAnch( false ); if ( pEntry ) MakeVisible( pEntry ); SetCursor( pEntry ); - if ( pEntry && ( aSelEng.GetSelectionMode() != NO_SELECTION ) ) + if ( pEntry && ( aSelEng.GetSelectionMode() != SelectionMode::NONE ) ) pView->Select( pEntry ); } diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index dd742aec7ede..fc7225292953 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -338,7 +338,7 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, WinBits nWinStyle) : mbContextBmpExpanded(false), mbAlternatingRowColors(false), mbUpdateAlternatingRows(false), - eSelMode(NO_SELECTION), + eSelMode(SelectionMode::NONE), nMinWidthInChars(0), mbCenterAndClipText(false) { @@ -353,7 +353,7 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, WinBits nWinStyle) : pModel->InsertView( this ); pHdlEntry = nullptr; pEdCtrl = nullptr; - eSelMode = SINGLE_SELECTION; + eSelMode = SelectionMode::Single; nDragDropMode = DragDropMode::NONE; SetType(WINDOW_TREELISTBOX); @@ -370,7 +370,7 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, const ResId& rResId) : mbContextBmpExpanded(false), mbAlternatingRowColors(false), mbUpdateAlternatingRows(false), - eSelMode(NO_SELECTION), + eSelMode(SelectionMode::NONE), nMinWidthInChars(0), mbCenterAndClipText(false) { @@ -2372,7 +2372,7 @@ void SvTreeListBox::SelectAll( bool bSelect, bool ) pImpl->SelAllDestrAnch( bSelect, true, // delete anchor, - true ); // even when using SINGLE_SELECTION, deselect the cursor + true ); // even when using SelectionMode::Single, deselect the cursor } void SvTreeListBox::ModelHasInsertedTree( SvTreeListEntry* pEntry ) @@ -2682,7 +2682,7 @@ void SvTreeListBox::EditedText( const OUString& rStr ) } if( GetSelectionCount() == 0 ) Select( pEdEntry ); - if( GetSelectionMode() == MULTIPLE_SELECTION && !GetCurEntry() ) + if( GetSelectionMode() == SelectionMode::Multiple && !GetCurEntry() ) SetCurEntry( pEdEntry ); } } diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx index 7d320149c861..cca5fc977971 100644 --- a/svtools/source/inc/svimpbox.hxx +++ b/svtools/source/inc/svimpbox.hxx @@ -218,7 +218,7 @@ protected: SelectionEngine aSelEng; sal_uLong nVisibleCount; // Number of lines in control bool bInVScrollHdl : 1; - bool bSimpleTravel : 1; // ist true bei SINGLE_SELECTION + bool bSimpleTravel : 1; // ist true bei SelectionMode::Single long nNextVerVisSize; long nNodeBmpTabDistance; // typical smaller than 0 diff --git a/svtools/source/table/mousefunction.cxx b/svtools/source/table/mousefunction.cxx index 676b9791dab6..bb0126872ae0 100644 --- a/svtools/source/table/mousefunction.cxx +++ b/svtools/source/table/mousefunction.cxx @@ -175,7 +175,7 @@ namespace svt { namespace table TableCell const tableCell( i_tableControl.hitTest( i_event.GetPosPixel() ) ); if ( tableCell.nRow >= 0 ) { - if ( i_tableControl.getSelEngine()->GetSelectionMode() == NO_SELECTION ) + if ( i_tableControl.getSelEngine()->GetSelectionMode() == SelectionMode::NONE ) { i_tableControl.activateCell( tableCell.nColumn, tableCell.nRow ); handled = true; @@ -197,7 +197,7 @@ namespace svt { namespace table TableCell const tableCell = i_tableControl.hitTest( i_event.GetPosPixel() ); if ( tableCell.nRow >= 0 ) { - if ( i_tableControl.getSelEngine()->GetSelectionMode() != NO_SELECTION ) + if ( i_tableControl.getSelEngine()->GetSelectionMode() != SelectionMode::NONE ) { i_tableControl.getSelEngine()->SelMouseButtonUp( i_event ); } diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index 9689d9ec87eb..643778c44f48 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -424,7 +424,7 @@ namespace svt { namespace table rStateSet.AddState( AccessibleStateType::FOCUSABLE ); - if ( m_pImpl->getSelEngine()->GetSelectionMode() == MULTIPLE_SELECTION ) + if ( m_pImpl->getSelEngine()->GetSelectionMode() == SelectionMode::Multiple ) rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE); if ( HasChildPathFocus() ) 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 ); diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index 5dd477924e9c..9bdbafa1aa20 100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -290,10 +290,10 @@ void SVTXGridControl::setProperty( const OUString& PropertyName, const Any& aVal SelectionMode eSelMode; switch( eSelectionType ) { - case SelectionType_SINGLE: eSelMode = SINGLE_SELECTION; break; - case SelectionType_RANGE: eSelMode = RANGE_SELECTION; break; - case SelectionType_MULTI: eSelMode = MULTIPLE_SELECTION; break; - default: eSelMode = NO_SELECTION; break; + case SelectionType_SINGLE: eSelMode = SelectionMode::Single; break; + case SelectionType_RANGE: eSelMode = SelectionMode::Range; break; + case SelectionType_MULTI: eSelMode = SelectionMode::Multiple; break; + default: eSelMode = SelectionMode::NONE; break; } if( pTable->getSelEngine()->GetSelectionMode() != eSelMode ) pTable->getSelEngine()->SetSelectionMode( eSelMode ); @@ -485,9 +485,9 @@ Any SVTXGridControl::getProperty( const OUString& PropertyName ) throw(RuntimeEx SelectionMode eSelMode = pTable->getSelEngine()->GetSelectionMode(); switch( eSelMode ) { - case SINGLE_SELECTION: eSelectionType = SelectionType_SINGLE; break; - case RANGE_SELECTION: eSelectionType = SelectionType_RANGE; break; - case MULTIPLE_SELECTION:eSelectionType = SelectionType_MULTI; break; + case SelectionMode::Single: eSelectionType = SelectionType_SINGLE; break; + case SelectionMode::Range: eSelectionType = SelectionType_RANGE; break; + case SelectionMode::Multiple:eSelectionType = SelectionType_MULTI; break; default: eSelectionType = SelectionType_NONE; break; } aPropertyValue <<= eSelectionType; diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index 8bd3af16f8df..0df10e9b966a 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -1247,11 +1247,11 @@ void TreeControlPeer::setProperty( const OUString& PropertyName, const Any& aVal SelectionMode eSelMode; switch( eSelectionType ) { - case SelectionType_SINGLE: eSelMode = SINGLE_SELECTION; break; - case SelectionType_RANGE: eSelMode = RANGE_SELECTION; break; - case SelectionType_MULTI: eSelMode = MULTIPLE_SELECTION; break; + case SelectionType_SINGLE: eSelMode = SelectionMode::Single; break; + case SelectionType_RANGE: eSelMode = SelectionMode::Range; break; + case SelectionType_MULTI: eSelMode = SelectionMode::Multiple; break; // case SelectionType_NONE: - default: eSelMode = NO_SELECTION; break; + default: eSelMode = SelectionMode::NONE; break; } if( rTree.GetSelectionMode() != eSelMode ) rTree.SetSelectionMode( eSelMode ); @@ -1336,10 +1336,10 @@ Any TreeControlPeer::getProperty( const OUString& PropertyName ) throw(RuntimeEx SelectionMode eSelMode = rTree.GetSelectionMode(); switch( eSelMode ) { - case SINGLE_SELECTION: eSelectionType = SelectionType_SINGLE; break; - case RANGE_SELECTION: eSelectionType = SelectionType_RANGE; break; - case MULTIPLE_SELECTION:eSelectionType = SelectionType_MULTI; break; -// case NO_SELECTION: + case SelectionMode::Single: eSelectionType = SelectionType_SINGLE; break; + case SelectionMode::Range: eSelectionType = SelectionType_RANGE; break; + case SelectionMode::Multiple:eSelectionType = SelectionType_MULTI; break; +// case SelectionMode::NONE: default: eSelectionType = SelectionType_NONE; break; } return Any( eSelectionType ); |