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 | |
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>
79 files changed, 171 insertions, 171 deletions
diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx index a1838a4c370d..30bd2c76c822 100644 --- a/accessibility/source/extended/accessiblelistbox.cxx +++ b/accessibility/source/extended/accessiblelistbox.cxx @@ -582,7 +582,7 @@ namespace accessibility { rStateSet.AddState( AccessibleStateType::FOCUSABLE ); rStateSet.AddState( AccessibleStateType::MANAGES_DESCENDANTS ); - if ( getListBox()->GetSelectionMode() == MULTIPLE_SELECTION ) + if ( getListBox()->GetSelectionMode() == SelectionMode::Multiple ) rStateSet.AddState( AccessibleStateType::MULTI_SELECTABLE ); } } diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index c8bc435a4c6f..e9f9ace3992e 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1851,7 +1851,7 @@ StackWindow::StackWindow (Layout* pParent) : aTreeListBox->SetAccessibleName(IDEResId(RID_STR_STACKNAME).toString()); aTreeListBox->SetPosPixel( Point( DWBORDER, nVirtToolBoxHeight ) ); aTreeListBox->SetHighlightRange(); - aTreeListBox->SetSelectionMode( NO_SELECTION ); + aTreeListBox->SetSelectionMode( SelectionMode::NONE ); aTreeListBox->InsertEntry( OUString() ); aTreeListBox->Show(); @@ -1906,7 +1906,7 @@ void StackWindow::UpdateCalls() if (StarBASIC::IsRunning()) { SbxError eOld = SbxBase::GetError(); - aTreeListBox->SetSelectionMode( SINGLE_SELECTION ); + aTreeListBox->SetSelectionMode( SelectionMode::Single ); sal_Int32 nScope = 0; SbMethod* pMethod = StarBASIC::GetActiveMethod( nScope ); @@ -1966,7 +1966,7 @@ void StackWindow::UpdateCalls() } else { - aTreeListBox->SetSelectionMode( NO_SELECTION ); + aTreeListBox->SetSelectionMode( SelectionMode::NONE ); aTreeListBox->InsertEntry( OUString() ); } diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index 20a4ecc2dd9e..3fcaae459233 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -180,7 +180,7 @@ TreeListBox::TreeListBox (vcl::Window* pParent, WinBits nStyle) void TreeListBox::Init() { SetNodeDefaultImages(); - SetSelectionMode( SINGLE_SELECTION ); + SetSelectionMode( SelectionMode::Single ); nMode = 0xFF; // everything } diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index 505192801b07..2d583f74698c 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -70,7 +70,7 @@ MacroChooser::MacroChooser( vcl::Window* pParnt, bool bCreateEntries ) get(m_pNewLibButton, "newlibrary"); get(m_pNewModButton, "newmodule"); - m_pMacroBox->SetSelectionMode( SINGLE_SELECTION ); + m_pMacroBox->SetSelectionMode( SelectionMode::Single ); m_pMacroBox->SetHighlightRange(); // select over the whole width m_pRunButton->SetClickHdl( LINK( this, MacroChooser, ButtonHdl ) ); diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index b12b59c71bbb..588965ae201a 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -795,7 +795,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( vcl::Window* pParent, const // initialize Entriesbox m_pEntriesBox->SetStyle(m_pEntriesBox->GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN); - m_pEntriesBox->SetSelectionMode(SINGLE_SELECTION); + m_pEntriesBox->SetSelectionMode(SelectionMode::Single); m_pEntriesBox->SetTabs(&AccCfgTabs[0]); m_pEntriesBox->Resize(); // OS: Hack for right selection m_pEntriesBox->SetSpaceBetweenEntries(0); diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 7b0178b8dc55..eec86095bc06 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1622,7 +1622,7 @@ SvxMenuEntriesListBox::SvxMenuEntriesListBox(vcl::Window* pParent, SvxConfigPage SetEntryHeight( ENTRY_HEIGHT ); SetHighlightRange(); - SetSelectionMode(SINGLE_SELECTION); + SetSelectionMode(SelectionMode::Single); SetDragDropMode( DragDropMode::CTRL_MOVE | DragDropMode::APP_COPY | diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 444788920a98..0c32d0b977d0 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -727,7 +727,7 @@ void SvxMacroTabPage_::InitAndSetHandler( const Reference< container::XNameRepla rListBox.SetSelectHdl( LINK( this, SvxMacroTabPage_, SelectEvent_Impl )); - rListBox.SetSelectionMode( SINGLE_SELECTION ); + rListBox.SetSelectionMode( SelectionMode::Single ); rListBox.SetTabs( &nTabs[0] ); Size aSize( nTabs[ 2 ], 0 ); rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() ); diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 80c4be1b2c2c..5586c0f89142 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -1117,7 +1117,7 @@ namespace svx m_pDictsLB->set_height_request(m_pDictsLB->GetTextHeight() * 5); m_pDictsLB->set_width_request(m_pDictsLB->approximate_char_width() * 32); m_pDictsLB->SetStyle( m_pDictsLB->GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE ); - m_pDictsLB->SetSelectionMode( SINGLE_SELECTION ); + m_pDictsLB->SetSelectionMode( SelectionMode::Single ); m_pDictsLB->SetHighlightRange(); m_pDictsLB->SetSelectHdl( LINK( this, HangulHanjaOptionsDialog, DictsLB_SelectHdl ) ); m_pDictsLB->SetDeselectHdl( LINK( this, HangulHanjaOptionsDialog, DictsLB_SelectHdl ) ); diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx index 6a22c2689221..666d825ec866 100644 --- a/cui/source/dialogs/iconcdlg.cxx +++ b/cui/source/dialogs/iconcdlg.cxx @@ -182,7 +182,7 @@ IconChoiceDialog::IconChoiceDialog ( vcl::Window* pParent, const OUString& rID, m_pIconCtrl->SetClickHdl ( LINK ( this, IconChoiceDialog , ChosePageHdl_Impl ) ); m_pIconCtrl->Show(); m_pIconCtrl->SetChoiceWithCursor(); - m_pIconCtrl->SetSelectionMode( SINGLE_SELECTION ); + m_pIconCtrl->SetSelectionMode( SelectionMode::Single ); m_pIconCtrl->SetHelpId( HID_ICCDIALOG_CHOICECTRL ); // ItemSet diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index 1d4e1fbc379f..75a9cda891b8 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -112,7 +112,7 @@ SvBaseLinksDlg::SvBaseLinksDlg( vcl::Window * pParent, LinkManager* pMgr, bool b get(m_pPbChangeSource, "CHANGE_SOURCE"); get(m_pPbBreakLink, "BREAK_LINK"); - m_pTbLinks->SetSelectionMode( MULTIPLE_SELECTION ); + m_pTbLinks->SetSelectionMode( SelectionMode::Multiple ); m_pTbLinks->SetTabs( &nTabs[0] ); FixedText *pFtFiles = get<FixedText>("FILES"); pFtFiles->set_width_request(LogicToPixel(Size(nTabs[2] - nTabs[1] - 2, 0), MAP_APPFONT).Width()); diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index ec995eeffaf3..2dabd1cad03a 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -84,7 +84,7 @@ SFTreeListBox::SFTreeListBox(vcl::Window* pParent) , m_sMyMacros(CUI_RESSTR(RID_SVXSTR_MYMACROS)) , m_sProdMacros(CUI_RESSTR(RID_SVXSTR_PRODMACROS)) { - SetSelectionMode( SINGLE_SELECTION ); + SetSelectionMode( SelectionMode::Single ); SetStyle( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HIDESELECTION | diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index c3a422c0d6fe..46034fb9e1b9 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -147,7 +147,7 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( vcl::Window* pParent, cons m_pPathBox->SetStyle( m_pPathBox->GetStyle()|nBits ); m_pPathBox->SetDoubleClickHdl( LINK( this, DbRegistrationOptionsPage, PathBoxDoubleClickHdl ) ); m_pPathBox->SetSelectHdl( LINK( this, DbRegistrationOptionsPage, PathSelect_Impl ) ); - m_pPathBox->SetSelectionMode( SINGLE_SELECTION ); + m_pPathBox->SetSelectionMode( SelectionMode::Single ); m_pPathBox->SetPosSizePixel( Point( 0, aHeadSize.Height() ), Size( aBoxSize.Width(), aBoxSize.Height() - aHeadSize.Height() ) ); m_pPathBox->SvSimpleTable::SetTabs( aTabs ); diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 64235681c64f..30e9d5e21ae7 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -67,7 +67,7 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( vcl::Window* pParent, m_pCheckLB->SetHelpId(HID_OFA_FONT_SUBST_CLB); m_pCheckLB->SetStyle(m_pCheckLB->GetStyle()|WB_HSCROLL|WB_VSCROLL); - m_pCheckLB->SetSelectionMode(MULTIPLE_SELECTION); + m_pCheckLB->SetSelectionMode(SelectionMode::Multiple); m_pCheckLB->SortByCol(2); long aStaticTabs[] = { 4, 0, 0, 0, 0 }; m_pCheckLB->SvSimpleTable::SetTabs(&aStaticTabs[0]); diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index 2a52540dae83..14fa4782f099 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -231,7 +231,7 @@ SvxPathTabPage::SvxPathTabPage(vcl::Window* pParent, const SfxItemSet& rSet) pPathBox->SetDoubleClickHdl( LINK( this, SvxPathTabPage, DoubleClickPathHdl_Impl ) ); pPathBox->SetSelectHdl( LINK( this, SvxPathTabPage, PathSelect_Impl ) ); - pPathBox->SetSelectionMode( MULTIPLE_SELECTION ); + pPathBox->SetSelectionMode( SelectionMode::Multiple ); pPathBox->SetHighlightRange(); xDialogListener->SetDialogClosedLink( LINK( this, SvxPathTabPage, DialogClosedHdl ) ); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 6cf6e03deea8..a2d47e0741d8 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -785,7 +785,7 @@ void OfaTreeOptionsDialog::InitTreeAndHandler() WB_HASLINES | WB_HASLINESATROOT | WB_CLIPCHILDREN | WB_HSCROLL | WB_FORCE_MAKEVISIBLE | WB_QUICK_SEARCH ); pTreeLB->SetSpaceBetweenEntries( 0 ); - pTreeLB->SetSelectionMode( SINGLE_SELECTION ); + pTreeLB->SetSelectionMode( SelectionMode::Single ); pTreeLB->SetSublistOpenWithLeftRight(); pTreeLB->SetExpandedHdl( LINK( this, OfaTreeOptionsDialog, ExpandedHdl_Impl ) ); pTreeLB->SetSelectHdl( LINK( this, OfaTreeOptionsDialog, ShowPageHdl_Impl ) ); diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx index 0b2a038ef98c..0842da41c9ea 100644 --- a/cui/source/tabpages/macroass.cxx +++ b/cui/source/tabpages/macroass.cxx @@ -383,7 +383,7 @@ void SfxMacroTabPage_::InitAndSetHandler() mpImpl->pGroupLB->SetSelectHdl( LINK( this, SfxMacroTabPage_, SelectGroup_Impl )); mpImpl->pMacroLB->SetSelectHdl( LINK( this, SfxMacroTabPage_, SelectMacro_Impl )); - rListBox.SetSelectionMode( SINGLE_SELECTION ); + rListBox.SetSelectionMode( SelectionMode::Single ); rListBox.SetTabs( &nTabs[0] ); Size aSize( nTabs[ 2 ], 0 ); rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MAP_APPFONT ) ).Width() ); diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 836059f28935..4c1a541f9e84 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -738,7 +738,7 @@ DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, cons _pTreeView->SetStyle(_pTreeView->GetStyle() | WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP); _pTreeView->GetModel()->SetSortMode(SortAscending); _pTreeView->EnableCheckButton( nullptr ); // do not show any buttons - _pTreeView->SetSelectionMode(MULTIPLE_SELECTION); + _pTreeView->SetSelectionMode(SelectionMode::Multiple); _pTreeView->SetDefaultCollapsedEntryBmp( _rImage ); _pTreeView->SetDefaultExpandedEntryBmp( _rImage ); diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index 6a481b3b56a0..4e26e022164f 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -79,7 +79,7 @@ OCreationList::OCreationList( OTasksWindow& _rParent ) { sal_uInt16 nSize = SPACEBETWEENENTRIES; SetSpaceBetweenEntries(nSize); - SetSelectionMode( NO_SELECTION ); + SetSelectionMode( SelectionMode::NONE ); SetExtendedWinBits( EWB_NO_AUTO_CURENTRY ); SetNodeDefaultImages( ); EnableEntryMnemonics(); diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx index 078b2245bce3..1298cc987893 100644 --- a/dbaccess/source/ui/app/AppIconControl.cxx +++ b/dbaccess/source/ui/app/AppIconControl.cxx @@ -57,7 +57,7 @@ OApplicationIconControl::OApplicationIconControl(vcl::Window* _pParent) } SetChoiceWithCursor(); - SetSelectionMode(SINGLE_SELECTION); + SetSelectionMode(SelectionMode::Single); } OApplicationIconControl::~OApplicationIconControl() diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index 1cb57daca2da..91e96fa15522 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -344,12 +344,12 @@ OAddTableDlg::OAddTableDlg( vcl::Window* pParent, IAddTableDialogContext& _rCont m_pTableList->EnableInplaceEditing( false ); m_pTableList->SetStyle(m_pTableList->GetStyle() | WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_SORT | WB_HSCROLL ); m_pTableList->EnableCheckButton( nullptr ); // do not show any buttons - m_pTableList->SetSelectionMode( SINGLE_SELECTION ); + m_pTableList->SetSelectionMode( SelectionMode::Single ); m_pTableList->notifyHiContrastChanged(); m_pTableList->suppressEmptyFolders(); m_pQueryList->EnableInplaceEditing( false ); - m_pQueryList->SetSelectionMode( SINGLE_SELECTION ); + m_pQueryList->SetSelectionMode( SelectionMode::Single ); if ( !m_rContext.allowQueries() ) { diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index 56a63f7977af..5613a5fe9b2e 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -211,7 +211,7 @@ namespace dbaui m_pIndexList->SetSelectHdl(LINK(this, DbaIndexDialog, OnIndexSelected)); m_pIndexList->SetEndEditHdl(LINK(this, DbaIndexDialog, OnEntryEdited)); - m_pIndexList->SetSelectionMode(SINGLE_SELECTION); + m_pIndexList->SetSelectionMode(SelectionMode::Single); m_pIndexList->SetHighlightRange(); m_pIndexList->setConnection(m_xConnection); diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 5408b2f12220..4de77cc3e180 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -314,7 +314,7 @@ OExceptionChainDialog::OExceptionChainDialog(vcl::Window* pParent, const Excepti m_sStatusLabel = ModuleRes( STR_EXCEPTION_STATUS ); m_sErrorCodeLabel = ModuleRes( STR_EXCEPTION_ERRORCODE ); - m_pExceptionList->SetSelectionMode(SINGLE_SELECTION); + m_pExceptionList->SetSelectionMode(SelectionMode::Single); m_pExceptionList->SetDragDropMode(DragDropMode::NONE); m_pExceptionList->EnableInplaceEditing(false); m_pExceptionList->SetStyle(m_pExceptionList->GetStyle() | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL); diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index e8051d859d75..127ea3a42460 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -86,7 +86,7 @@ namespace dbaui m_pTablesList->SetCheckHandler(LINK(this,OGenericAdministrationPage,OnControlModified)); // initialize the TabListBox - m_pTablesList->SetSelectionMode( MULTIPLE_SELECTION ); + m_pTablesList->SetSelectionMode( SelectionMode::Multiple ); m_pTablesList->SetDragDropMode( DragDropMode::NONE ); m_pTablesList->EnableInplaceEditing( false ); m_pTablesList->SetStyle(m_pTablesList->GetStyle() | WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT); diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 68c91aa29aee..e5a5e962313f 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -365,7 +365,7 @@ OColumnTreeBox::OColumnTreeBox( vcl::Window* pParent, WinBits nBits ) SetDragDropMode( DragDropMode::NONE ); EnableInplaceEditing( false ); SetStyle(GetStyle() | WB_BORDER | WB_HASBUTTONS | WB_HSCROLL | nBits); - SetSelectionMode( SINGLE_SELECTION ); + SetSelectionMode( SelectionMode::Single ); } VCL_BUILDER_FACTORY(OColumnTreeBox) diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx index d7dbc5eef76c..10d3fd4e05bc 100644 --- a/dbaccess/source/ui/querydesign/TableWindow.cxx +++ b/dbaccess/source/ui/querydesign/TableWindow.cxx @@ -303,7 +303,7 @@ bool OTableWindow::Init() { m_xListBox = CreateListBox(); OSL_ENSURE( m_xListBox != nullptr, "OTableWindow::Init() : CreateListBox returned NULL !" ); - m_xListBox->SetSelectionMode( MULTIPLE_SELECTION ); + m_xListBox->SetSelectionMode( SelectionMode::Multiple ); } // Set the title diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index ab38fcc18069..6e5ba0670e71 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -51,7 +51,7 @@ OTableWindowListBox::OTableWindowListBox( OTableWindow* pParent ) m_aScrollTimer.SetTimeout( SCROLLING_TIMESPAN ); SetDoubleClickHdl( LINK(this, OTableWindowListBox, OnDoubleClick) ); - SetSelectionMode(SINGLE_SELECTION); + SetSelectionMode(SelectionMode::Single); SetHighlightRange( ); } diff --git a/editeng/source/editeng/editsel.cxx b/editeng/source/editeng/editsel.cxx index b852af73b985..46d01401a925 100644 --- a/editeng/source/editeng/editsel.cxx +++ b/editeng/source/editeng/editsel.cxx @@ -84,7 +84,7 @@ void EditSelFunctionSet::DeselectAll() EditSelectionEngine::EditSelectionEngine() : SelectionEngine( nullptr ) { - SetSelectionMode( RANGE_SELECTION ); + SetSelectionMode( SelectionMode::Range ); EnableDrag( true ); } diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx index c6934084f9c4..b8193a309783 100644 --- a/extensions/source/propctrlr/selectlabeldialog.cxx +++ b/extensions/source/propctrlr/selectlabeldialog.cxx @@ -60,7 +60,7 @@ namespace pcr get(m_pNoAssignment, "noassignment"); // initialize the TreeListBox - m_pControlTree->SetSelectionMode( SINGLE_SELECTION ); + m_pControlTree->SetSelectionMode( SelectionMode::Single ); m_pControlTree->SetDragDropMode( DragDropMode::NONE ); m_pControlTree->EnableInplaceEditing( false ); m_pControlTree->SetStyle(m_pControlTree->GetStyle() | WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL); diff --git a/extensions/source/propctrlr/taborder.cxx b/extensions/source/propctrlr/taborder.cxx index 6528ba3c7a11..4d7ce611b304 100644 --- a/extensions/source/propctrlr/taborder.cxx +++ b/extensions/source/propctrlr/taborder.cxx @@ -297,7 +297,7 @@ namespace pcr SetDragDropMode(DragDropMode::ALL/*DragDropMode::CTRL_MOVE*/); // Hmm. The flag alone is not enough, so to be on the safe side ... - SetSelectionMode( MULTIPLE_SELECTION ); + SetSelectionMode( SelectionMode::Multiple ); } VCL_BUILDER_DECL_FACTORY(TabOrderListBox) diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 506f76ef2126..6216673e7adf 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -1413,7 +1413,7 @@ XMLFilterListBox::XMLFilterListBox(Window* pParent, SvxPathControl* pPathControl static long nTabs[] = {2, 0, nTabSize }; - SetSelectionMode( MULTIPLE_SELECTION ); + SetSelectionMode( SelectionMode::Multiple ); SetTabs( &nTabs[0], MAP_PIXEL ); SetScrolledHdl( LINK( this, XMLFilterListBox, TabBoxScrollHdl_Impl ) ); SetHighlightRange(); diff --git a/include/vcl/seleng.hxx b/include/vcl/seleng.hxx index 2f3ee27f0ce7..32625a74aaaf 100644 --- a/include/vcl/seleng.hxx +++ b/include/vcl/seleng.hxx @@ -34,7 +34,7 @@ class CommandEvent; #define SELENG_AUTOREPEAT_INTERVAL_MIN 25 #define SELENG_AUTOREPEAT_INTERVAL_MAX 300 -enum SelectionMode { NO_SELECTION, SINGLE_SELECTION, RANGE_SELECTION, MULTIPLE_SELECTION }; +enum class SelectionMode { NONE, Single, Range, Multiple }; class VCL_DLLPUBLIC FunctionSet diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx index 5cfeb7565e80..3d7ee4f7f7c0 100644 --- a/reportdesign/source/ui/dlg/AddField.cxx +++ b/reportdesign/source/ui/dlg/AddField.cxx @@ -105,7 +105,7 @@ OAddFieldWindowListBox::OAddFieldWindowListBox( OAddFieldWindow* _pParent ) ,m_pTabWin( _pParent ) { SetHelpId( HID_RPT_FIELD_SEL ); - SetSelectionMode(MULTIPLE_SELECTION); + SetSelectionMode(SelectionMode::Multiple); SetDragDropMode( DragDropMode::ALL ); SetHighlightRange( ); } diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index f8e636493ea0..04138843284b 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -244,7 +244,7 @@ NavigatorTree::NavigatorTree( vcl::Window* pParent,OReportController& _rControll SetDragDropMode(DragDropMode::ALL); EnableInplaceEditing( false ); - SetSelectionMode(MULTIPLE_SELECTION); + SetSelectionMode(SelectionMode::Multiple); Clear(); m_aDropActionTimer.SetTimeoutHdl(LINK(this, NavigatorTree, OnDropActionTimer)); diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index 69ad5a2d3601..a8c0ecc69bbc 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -30,7 +30,7 @@ ScCondFormatManagerWindow::ScCondFormatManagerWindow(SvSimpleTableContainer& rPa Init(); Show(); - SetSelectionMode(MULTIPLE_SELECTION); + SetSelectionMode(SelectionMode::Multiple); } OUString ScCondFormatManagerWindow::createEntryString(const ScConditionalFormat& rFormat) diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index 82e142216481..c483f460630f 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -58,7 +58,7 @@ ScTpSubTotalGroup::ScTpSubTotalGroup( vcl::Window* pParent, mpLbFunctions->set_height_request(nHeight); // Font is correctly initialized by SvTreeListBox ctor - mpLbColumns->SetSelectionMode( SINGLE_SELECTION ); + mpLbColumns->SetSelectionMode( SelectionMode::Single ); mpLbColumns->SetDragDropMode( DragDropMode::NONE ); mpLbColumns->SetSpaceBetweenEntries( 0 ); diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 696b01cc9c26..407bd39e4003 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -133,7 +133,7 @@ ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, vcl::Window pTheView->SetDeselectHdl( LINK(this, ScAcceptChgDlg, SelectHandle)); pTheView->SetCommandHdl( LINK(this, ScAcceptChgDlg, CommandHdl)); pTheView->SetColCompareHdl( LINK(this, ScAcceptChgDlg,ColCompareHdl)); - pTheView->SetSelectionMode(MULTIPLE_SELECTION); + pTheView->SetSelectionMode(SelectionMode::Multiple); pTheView->SetHighlightRange(1); Init(); diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index 7b17d7693ae6..2d4e8cfd5438 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -418,7 +418,7 @@ ScConflictsDlg::ScConflictsDlg( vcl::Window* pParent, ScViewData* pViewData, ScD m_pLbConflicts->InsertHeaderEntry( aHeader, HEADERBAR_APPEND, HeaderBarItemBits::LEFT | HeaderBarItemBits::LEFTIMAGE | HeaderBarItemBits::VCENTER ); m_pLbConflicts->SetStyle( m_pLbConflicts->GetStyle() | WB_HASLINES | WB_CLIPCHILDREN | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL ); - m_pLbConflicts->SetSelectionMode( MULTIPLE_SELECTION ); + m_pLbConflicts->SetSelectionMode( SelectionMode::Multiple ); m_pLbConflicts->SetHighlightRange(); maSelectionIdle.SetPriority( SchedulerPriority::LOW ); diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx index 213b93a4cdf4..9ac5a5c049eb 100644 --- a/sc/source/ui/miscdlgs/sharedocdlg.cxx +++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx @@ -101,7 +101,7 @@ ScShareDocumentDlg::ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewD aHeader += "\t"; aHeader += get<FixedText>("accessed")->GetText(); m_pLbUsers->InsertHeaderEntry( aHeader, HEADERBAR_APPEND, HeaderBarItemBits::LEFT | HeaderBarItemBits::LEFTIMAGE | HeaderBarItemBits::VCENTER ); - m_pLbUsers->SetSelectionMode( NO_SELECTION ); + m_pLbUsers->SetSelectionMode( SelectionMode::NONE ); UpdateView(); } diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx index 6abb349a338f..eedf33cca60d 100644 --- a/sc/source/ui/namedlg/namemgrtable.cxx +++ b/sc/source/ui/namedlg/namemgrtable.cxx @@ -60,7 +60,7 @@ ScRangeManagerTable::ScRangeManagerTable(SvSimpleTableContainer& rParent, UpdateViewSize(); Init(); ShowTable(); - SetSelectionMode(MULTIPLE_SELECTION); + SetSelectionMode(SelectionMode::Multiple); SetScrolledHdl( LINK( this, ScRangeManagerTable, ScrollHdl ) ); HeaderEndDragHdl(nullptr); } diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index ce339ccb5ef7..862b985f4039 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -631,7 +631,7 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl aLbEntries->InitWindowBits(true); aLbEntries->SetSpaceBetweenEntries(0); - aLbEntries->SetSelectionMode( SINGLE_SELECTION ); + aLbEntries->SetSelectionMode( SelectionMode::Single ); aLbEntries->SetDragDropMode( DragDropMode::CTRL_MOVE | DragDropMode::CTRL_COPY | DragDropMode::ENABLE_TOP ); diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx index acc8e8bd9636..bcceb4a5a4d0 100644 --- a/sc/source/ui/view/select.cxx +++ b/sc/source/ui/view/select.cxx @@ -751,7 +751,7 @@ ScViewSelectionEngine::ScViewSelectionEngine( vcl::Window* pWindow, ScTabView* p SelectionEngine( pWindow, &pView->GetFunctionSet() ), eWhich( eSplitPos ) { - SetSelectionMode( MULTIPLE_SELECTION ); + SetSelectionMode( SelectionMode::Multiple ); EnableDrag( true ); } @@ -945,7 +945,7 @@ void ScHeaderFunctionSet::DeselectAll() ScHeaderSelectionEngine::ScHeaderSelectionEngine( vcl::Window* pWindow, ScHeaderFunctionSet* pFuncSet ) : SelectionEngine( pWindow, pFuncSet ) { - SetSelectionMode( MULTIPLE_SELECTION ); + SetSelectionMode( SelectionMode::Multiple ); EnableDrag( false ); } diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index ddb14db39d0d..e6a63faf53a8 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -463,7 +463,7 @@ CustomAnimationList::CustomAnimationList( vcl::Window* pParent ) { EnableContextMenuHandling(); - SetSelectionMode( MULTIPLE_SELECTION ); + SetSelectionMode( SelectionMode::Multiple ); SetOptimalImageIndent(); SetNodeDefaultImages(); } diff --git a/sd/source/ui/dlg/inspagob.cxx b/sd/source/ui/dlg/inspagob.cxx index b0f8bad8e629..5e9ca9680b20 100644 --- a/sd/source/ui/dlg/inspagob.cxx +++ b/sd/source/ui/dlg/inspagob.cxx @@ -74,7 +74,7 @@ void SdInsertPagesObjsDlg::Reset() { if( pMedium ) { - m_pLbTree->SetSelectionMode( MULTIPLE_SELECTION ); + m_pLbTree->SetSelectionMode( SelectionMode::Multiple ); // transfer ownership of Medium m_pLbTree->Fill( mpDoc, pMedium, rName ); diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index b761777e6702..e6b5e52f677c 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -103,7 +103,7 @@ SdNavigatorWin::SdNavigatorWin( long nListboxYPos = maToolbox->GetPosPixel().Y() + maToolbox->GetSizePixel().Height() + 4; maTlbObjects->setPosSizePixel( 0, nListboxYPos, 0, 0, PosSizeFlags::Y ); maTlbObjects->SetDoubleClickHdl( LINK( this, SdNavigatorWin, ClickObjectHdl ) ); - maTlbObjects->SetSelectionMode( SINGLE_SELECTION ); + maTlbObjects->SetSelectionMode( SelectionMode::Single ); // set focus to listbox, otherwise it is in the toolbox which is only useful // for keyboard navigation maTlbObjects->GrabFocus(); @@ -465,10 +465,10 @@ IMPL_LINK_TYPED( SdNavigatorWin, MenuSelectHdl, Menu *, pMenu, bool ) if( maTlbObjects->GetSelectionCount() > 1 ) maTlbObjects->SelectAll( false ); - maTlbObjects->SetSelectionMode( SINGLE_SELECTION ); + maTlbObjects->SetSelectionMode( SelectionMode::Single ); } else - maTlbObjects->SetSelectionMode( MULTIPLE_SELECTION ); + maTlbObjects->SetSelectionMode( SelectionMode::Multiple ); } } return false; @@ -601,7 +601,7 @@ bool SdNavigatorWin::InsertFile(const OUString& rFileName) if (xMedium->IsStorage()) { // Now depending on mode: - // maTlbObjects->SetSelectionMode(MULTIPLE_SELECTION); + // maTlbObjects->SetSelectionMode(SelectionMode::Multiple); // handover of ownership of xMedium; SdDrawDocument* pDropDoc = maTlbObjects->GetBookmarkDoc(xMedium.release()); @@ -917,7 +917,7 @@ void SdPageNameControllerItem::StateChanged( sal_uInt16 nSId, if( !pNavigatorWin->maTlbObjects->HasSelectedChildren( aPageName ) ) { - if( pNavigatorWin->maTlbObjects->GetSelectionMode() == MULTIPLE_SELECTION ) + if( pNavigatorWin->maTlbObjects->GetSelectionMode() == SelectionMode::Multiple ) { // because otherwise it is always additional select pNavigatorWin->maTlbObjects->SelectAll( false ); diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 0e0babdc0ab2..ba371adeb783 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -1143,7 +1143,7 @@ void SdPageObjsTLB::StartDrag( sal_Int8 nAction, const Point& rPosPixel) // targets. This prevents moving shapes from one page to another. // Select all entries and disable them as drop targets. - SetSelectionMode(MULTIPLE_SELECTION); + SetSelectionMode(SelectionMode::Multiple); SetCursor(static_cast<SvTreeListEntry*>(nullptr)); SelectAll(true, false); EnableSelectionAsDropTarget(false); @@ -1162,7 +1162,7 @@ void SdPageObjsTLB::StartDrag( sal_Int8 nAction, const Point& rPosPixel) // Set selection back to the entry under the mouse. SelectAll(false, false); - SetSelectionMode(SINGLE_SELECTION); + SetSelectionMode(SelectionMode::Single); Select(pEntry); // We can delete the Navigator from ExecuteDrag (when switching to diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 94b707395a64..39babcdc32f4 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -276,7 +276,7 @@ ContentListBox_Impl::ContentListBox_Impl(vcl::Window* pParent, WinBits nStyle) SetStyle( GetStyle() | WB_HIDESELECTION | WB_HSCROLL ); SetEntryHeight( 16 ); - SetSelectionMode( SINGLE_SELECTION ); + SetSelectionMode( SelectionMode::Single ); SetSpaceBetweenEntries( 2 ); SetNodeBitmaps( aClosedBookImage, aOpenBookImage ); diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 9e437500eb21..a6bf7d5adf43 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -854,7 +854,7 @@ void SfxCommonTemplateDialog_Impl::Initialize() aFilterLb->SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, FilterSelectHdl ) ); aFmtLb->SetDoubleClickHdl( LINK( this, SfxCommonTemplateDialog_Impl, TreeListApplyHdl ) ); aFmtLb->SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, FmtSelectHdl ) ); - aFmtLb->SetSelectionMode(MULTIPLE_SELECTION); + aFmtLb->SetSelectionMode(SelectionMode::Multiple); aFilterLb->Show(); diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 0d98e7d6ff5a..985dd1de93e6 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -227,7 +227,7 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersion m_pVersionBox->GrabFocus(); m_pVersionBox->SetStyle( m_pVersionBox->GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN ); - m_pVersionBox->SetSelectionMode( SINGLE_SELECTION ); + m_pVersionBox->SetSelectionMode( SelectionMode::Single ); long nTabs_Impl[] = { 3, 0, 0, 0 }; @@ -548,7 +548,7 @@ SfxCmisVersionsDialog::SfxCmisVersionsDialog ( SfxViewFrame* pVwFrame ) m_pVersionBox->GrabFocus(); m_pVersionBox->SetStyle( m_pVersionBox->GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN ); - m_pVersionBox->SetSelectionMode( SINGLE_SELECTION ); + m_pVersionBox->SetSelectionMode( SelectionMode::Single ); long nTabs_Impl[] = { 3, 0, 0, 0 }; 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 ); diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 29d62bc89d33..d6f9d201f665 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1111,7 +1111,7 @@ FmFilterNavigator::FmFilterNavigator( vcl::Window* pParent ) StartListening( *m_pModel ); EnableInplaceEditing( true ); - SetSelectionMode(MULTIPLE_SELECTION); + SetSelectionMode(SelectionMode::Multiple); SetDragDropMode(DragDropMode::ALL); diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index c32b4344ce3c..21c95d94f02e 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -143,7 +143,7 @@ namespace svxform SetDragDropMode(DragDropMode::ALL); EnableInplaceEditing( true ); - SetSelectionMode(MULTIPLE_SELECTION); + SetSelectionMode(SelectionMode::Multiple); m_pNavModel = new NavigatorTreeModel( m_aNavigatorImages ); Clear(); diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index 2f5ce4752af2..94d0b0cec0a9 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -385,7 +385,7 @@ void DictionaryList::init(const Reference< linguistic2::XConversionDictionary>& vcl::Window *pFT_Term, vcl::Window *pFT_Mapping, vcl::Window *pFT_Property) { SetStyle( WB_VSCROLL | WB_TABSTOP ); - SetSelectionMode( SINGLE_SELECTION ); + SetSelectionMode( SelectionMode::Single ); SetBorderStyle( WindowBorderStyle::MONO ); SetHighlightRange(); diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index 271e8ee2436b..a3d24473ad8b 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -91,7 +91,7 @@ SwCondCollPage::SwCondCollPage(vcl::Window *pParent, const SfxItemSet &rSet) m_pFilterLB->SetSelectHdl( LINK(this, SwCondCollPage, SelectListBoxHdl)); m_pTbLinks->SetStyle(m_pTbLinks->GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN); - m_pTbLinks->SetSelectionMode( SINGLE_SELECTION ); + m_pTbLinks->SetSelectionMode( SelectionMode::Single ); m_pTbLinks->SetTabs( &nTabs[0] ); m_pTbLinks->Resize(); // OS: Hack for the right selection m_pTbLinks->SetSpaceBetweenEntries( 0 ); diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index bef855f4010e..ccb8673accd6 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -204,7 +204,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) m_pListLB->setColSizes(); m_pListLB->SetStyle( m_pListLB->GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ); - m_pListLB->SetSelectionMode( SINGLE_SELECTION ); + m_pListLB->SetSelectionMode( SelectionMode::Single ); m_pOK->SetClickHdl( LINK( this, SwAddressListDialog, OKHdl_Impl)); uno::Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index f40210598488..dcec0a444d56 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -1248,7 +1248,7 @@ DDListBox::DDListBox(vcl::Window* pParent, WinBits nStyle) { SetStyle( GetStyle() | /*WB_HASBUTTONS|WB_HASBUTTONSATROOT|*/ WB_CLIPCHILDREN ); - SetSelectionMode( SINGLE_SELECTION ); + SetSelectionMode( SelectionMode::Single ); SetDragDropMode( DragDropMode::CTRL_COPY ); EnableAsyncDrag(true); // expand selection to the complete width of the ListBox diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index 5b7a4a77190b..b4414563b6eb 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -293,7 +293,7 @@ SwSendMailDialog::SwSendMailDialog(vcl::Window *pParent, SwMailMergeConfigItem& static long nTabs[] = {2, 0, nPos1}; m_pStatus->SetStyle( m_pStatus->GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ); - m_pStatus->SetSelectionMode( SINGLE_SELECTION ); + m_pStatus->SetSelectionMode( SelectionMode::Single ); m_pStatus->SetTabs(&nTabs[0], MAP_PIXEL); m_pStatus->SetSpaceBetweenEntries(3); diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx index 4d28d76a711e..e9472ce6f1d2 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.cxx +++ b/sw/source/ui/dbui/selectdbtabledialog.cxx @@ -55,7 +55,7 @@ SwAddressTable::SwAddressTable(SvSimpleTableContainer& rParent) : SvSimpleTable(rParent, 0) { SetSpaceBetweenEntries(3); - SetSelectionMode(SINGLE_SELECTION); + SetSelectionMode(SelectionMode::Single); SetDragDropMode(DragDropMode::NONE); EnableAsyncDrag(false); } diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 3db1ed3cde6d..3c3e65ff06f8 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -362,7 +362,7 @@ SwEditRegionDlg::SwEditRegionDlg( vcl::Window* pParent, SwWrtShell& rWrtSh ) m_pSubRegionED->AddEventListener(LINK(this, SwEditRegionDlg, SubRegionEventHdl)); m_pSubRegionED->EnableAutocomplete(true, true); - m_pTree->SetSelectionMode( MULTIPLE_SELECTION ); + m_pTree->SetSelectionMode( SelectionMode::Multiple ); m_pTree->SetStyle(m_pTree->GetStyle()|WB_HASBUTTONSATROOT|WB_CLIPCHILDREN|WB_HSCROLL); m_pTree->SetSpaceBetweenEntries(0); m_pTree->SetAllEntriesAccessibleRoleType(SvTreeAccRoleType::TREE); diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index 60eaf5c04fdf..66bf387b26f3 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -593,7 +593,7 @@ SwVisitingCardPage::SwVisitingCardPage(vcl::Window* pParent, const SfxItemSet& r m_pAutoTextLB->SetStyle( m_pAutoTextLB->GetStyle() | WB_HSCROLL ); m_pAutoTextLB->SetSpaceBetweenEntries(0); - m_pAutoTextLB->SetSelectionMode( SINGLE_SELECTION ); + m_pAutoTextLB->SetSelectionMode( SelectionMode::Single ); SetExchangeSupport(); m_pAutoTextLB->SetSelectHdl(LINK(this, SwVisitingCardPage, AutoTextSelectTreeListBoxHdl)); diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx index ba47d61eada5..ab3fd3565a5b 100644 --- a/sw/source/ui/fldui/changedb.cxx +++ b/sw/source/ui/fldui/changedb.cxx @@ -69,7 +69,7 @@ SwChangeDBDlg::SwChangeDBDlg(SwView& rVw) m_pDefineBT->SetClickHdl(LINK(this, SwChangeDBDlg, ButtonHdl)); m_pAddDBPB->SetClickHdl(LINK(this, SwChangeDBDlg, AddDBHdl)); - m_pUsedDBTLB->SetSelectionMode(MULTIPLE_SELECTION); + m_pUsedDBTLB->SetSelectionMode(SelectionMode::Multiple); m_pUsedDBTLB->SetStyle(m_pUsedDBTLB->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); m_pUsedDBTLB->SetSpaceBetweenEntries(0); m_pUsedDBTLB->SetNodeBitmaps( aImageList.GetImage(IMG_COLLAPSE), aImageList.GetImage(IMG_EXPAND)); diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index a270ce6135de..b09d6d7a8426 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -71,7 +71,7 @@ SwFieldDokInfPage::SwFieldDokInfPage(vcl::Window* pParent, const SfxItemSet *con m_pFormatLB->set_width_request(nWidth); m_pSelectionLB->set_width_request(nWidth); - m_pTypeTLB->SetSelectionMode(SINGLE_SELECTION); + m_pTypeTLB->SetSelectionMode(SelectionMode::Single); m_pTypeTLB->SetStyle(m_pTypeTLB->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); m_pTypeTLB->SetOptimalImageIndent(); // Don't set font, so that the control's font is adopted! diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 94a222f2bed5..95e6a97b53d0 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1879,7 +1879,7 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(vcl::Window* pParent, const SfxItemSet& rAt sLevelStr = m_pLevelFT->GetText(); m_pLevelLB->SetStyle( m_pLevelLB->GetStyle() | WB_HSCROLL ); m_pLevelLB->SetSpaceBetweenEntries(0); - m_pLevelLB->SetSelectionMode( SINGLE_SELECTION ); + m_pLevelLB->SetSelectionMode( SelectionMode::Single ); m_pLevelLB->SetHighlightRange(); // select full width m_pLevelLB->Show(); diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 03b7f6269ea4..a50e74fc415a 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -340,7 +340,7 @@ BookmarkTable::BookmarkTable(SvSimpleTableContainer& rParent) : static long nTabs[] = {3, 0, 40, 150}; SetTabs(nTabs, MAP_PIXEL); - SetSelectionMode(MULTIPLE_SELECTION); + SetSelectionMode(SelectionMode::Multiple); InsertHeaderEntry(OUString(SW_RES(STR_PAGE))); InsertHeaderEntry(OUString(SW_RES(STR_BOOKMARK_NAME))); InsertHeaderEntry(OUString(SW_RES(STR_BOOKMARK_TEXT))); diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx index 5e00af7fff22..3086204a7a37 100644 --- a/sw/source/uibase/dbui/dbtree.cxx +++ b/sw/source/uibase/dbui/dbtree.cxx @@ -183,7 +183,7 @@ void SwDBTreeList::InitTreeList() { if(!pImpl->HasContext() && pImpl->GetWrtShell()) return; - SetSelectionMode(SINGLE_SELECTION); + SetSelectionMode(SelectionMode::Single); SetStyle(GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); // don't set font, so that the Control's font is being applied! SetSpaceBetweenEntries(0); diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 6928993639ef..48e342364fc0 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -206,7 +206,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(vcl::Window *pParent, VclBuilderContainer m_pTable->SetStyle(m_pTable->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL); m_pTable->SetNodeDefaultImages(); - m_pTable->SetSelectionMode(MULTIPLE_SELECTION); + m_pTable->SetSelectionMode(SelectionMode::Multiple); m_pTable->SetHighlightRange(1); m_pTable->SortByCol(nSortMode, bSortDir); diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 5c70544e3121..a90970c13787 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -773,7 +773,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, m_aContentTree->SetStyle( m_aContentTree->GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT| WB_CLIPCHILDREN|WB_HSCROLL|WB_FORCE_MAKEVISIBLE ); m_aContentTree->SetSpaceBetweenEntries(3); - m_aContentTree->SetSelectionMode( SINGLE_SELECTION ); + m_aContentTree->SetSelectionMode( SelectionMode::Single ); m_aContentTree->SetDragDropMode( DragDropMode::CTRL_MOVE | DragDropMode::CTRL_COPY | DragDropMode::ENABLE_TOP ); @@ -783,7 +783,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, // TreeListBox for global document m_aGlobalTree->setPosSizePixel( 0, nListboxYPos, 0, 0, PosSizeFlags::Y ); - m_aGlobalTree->SetSelectionMode( MULTIPLE_SELECTION ); + m_aGlobalTree->SetSelectionMode( SelectionMode::Multiple ); m_aGlobalTree->SetStyle( m_aGlobalTree->GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT| WB_CLIPCHILDREN|WB_HSCROLL ); Size aGlblSize(m_aGlobalToolBox->CalcWindowSizePixel()); diff --git a/toolkit/test/accessibility/SelectionDialog.java b/toolkit/test/accessibility/SelectionDialog.java index 2f0c6d543446..64ce7fb9158c 100644 --- a/toolkit/test/accessibility/SelectionDialog.java +++ b/toolkit/test/accessibility/SelectionDialog.java @@ -68,7 +68,7 @@ class SelectionDialog extends JDialog maChildrenSelector = new JList (GetChildrenList()); maChildrenSelector.setPreferredSize (new Dimension (500,300)); aContent.add (maChildrenSelector, BorderLayout.CENTER); - maChildrenSelector.setSelectionMode (ListSelectionModel.SINGLE_SELECTION); + maChildrenSelector.setSelectionMode (ListSelectionModel.SelectionMode::Single); JPanel aButtons = new JPanel(); aButtons.setLayout( new FlowLayout() ); diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index 288b9814a8de..f62306fd960b 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -202,7 +202,7 @@ TextView::TextView( TextEngine* pEng, vcl::Window* pWindow ) : mpImpl->mpSelFuncSet = new TextSelFunctionSet( this ); mpImpl->mpSelEngine = new SelectionEngine( mpImpl->mpWindow, mpImpl->mpSelFuncSet ); - mpImpl->mpSelEngine->SetSelectionMode( RANGE_SELECTION ); + mpImpl->mpSelEngine->SetSelectionMode( SelectionMode::Range ); mpImpl->mpSelEngine->EnableDrag( true ); mpImpl->mpCursor = new vcl::Cursor; diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx index 6aefea13e56d..952dc8b1f777 100644 --- a/vcl/source/window/seleng.cxx +++ b/vcl/source/window/seleng.cxx @@ -28,7 +28,7 @@ FunctionSet::~FunctionSet() inline bool SelectionEngine::ShouldDeselect( bool bModifierKey1 ) const { - return eSelMode != MULTIPLE_SELECTION || !bModifierKey1; + return eSelMode != SelectionMode::Multiple || !bModifierKey1; } // TODO: throw out FunctionSet::SelectAtPoint @@ -38,7 +38,7 @@ SelectionEngine::SelectionEngine( vcl::Window* pWindow, FunctionSet* pFuncSet, pWin( pWindow ), nUpdateInterval( nAutoRepeatInterval ) { - eSelMode = SINGLE_SELECTION; + eSelMode = SelectionMode::Single; pFunctionSet = pFuncSet; nFlags = SelectionEngineFlags::EXPANDONMOVE; nLockedMods = 0; @@ -68,7 +68,7 @@ void SelectionEngine::CursorPosChanging( bool bShift, bool bMod1 ) if ( !pFunctionSet ) return; - if ( bShift && eSelMode != SINGLE_SELECTION ) + if ( bShift && eSelMode != SelectionMode::Single ) { if ( IsAddMode() ) { @@ -122,7 +122,7 @@ bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) return false; // in SingleSelection: filter Control-Key, // so that a D&D can be also started with a Ctrl-Click - if ( nModifier == KEY_MOD1 && eSelMode == SINGLE_SELECTION ) + if ( nModifier == KEY_MOD1 && eSelMode == SelectionMode::Single ) nModifier = 0; Point aPos = rMEvt.GetPosPixel(); @@ -151,7 +151,7 @@ bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) pWin->ReleaseMouse(); return true; // wait for STARTDRAG-Command-Event } - if ( eSelMode != SINGLE_SELECTION ) + if ( eSelMode != SelectionMode::Single ) { if( !IsAddMode() ) pFunctionSet->DeselectAll(); @@ -161,13 +161,13 @@ bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) } pFunctionSet->SetCursorAtPoint( aPos ); // special case Single-Selection, to enable simple Select+Drag - if (eSelMode == SINGLE_SELECTION && (nFlags & SelectionEngineFlags::DRG_ENAB)) + if (eSelMode == SelectionMode::Single && (nFlags & SelectionEngineFlags::DRG_ENAB)) nFlags |= SelectionEngineFlags::WAIT_UPEVT; return true; } case KEY_SHIFT: - if ( eSelMode == SINGLE_SELECTION ) + if ( eSelMode == SelectionMode::Single ) { pWin->ReleaseMouse(); nFlags &= (~SelectionEngineFlags::IN_SEL); @@ -190,7 +190,7 @@ bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) case KEY_MOD1: // allow Control only for Multi-Select - if ( eSelMode != MULTIPLE_SELECTION ) + if ( eSelMode != SelectionMode::Multiple ) { nFlags &= (~SelectionEngineFlags::IN_SEL); pWin->ReleaseMouse(); @@ -214,7 +214,7 @@ bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) return true; case KEY_SHIFT + KEY_MOD1: - if ( eSelMode != MULTIPLE_SELECTION ) + if ( eSelMode != SelectionMode::Multiple ) { pWin->ReleaseMouse(); nFlags &= (~SelectionEngineFlags::IN_SEL); @@ -249,7 +249,7 @@ bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt ) } if( (nFlags & SelectionEngineFlags::WAIT_UPEVT) && !(nFlags & SelectionEngineFlags::CMDEVT) && - eSelMode != SINGLE_SELECTION) + eSelMode != SelectionMode::Single) { // MouseButtonDown in Sel but no CommandEvent yet // ==> deselektieren @@ -305,7 +305,7 @@ bool SelectionEngine::SelMouseMove( const MouseEvent& rMEvt ) if (!comphelper::LibreOfficeKit::isActive()) // Generating fake mouse moves does not work with LOK. aWTimer.Start(); - if ( eSelMode != SINGLE_SELECTION ) + if ( eSelMode != SelectionMode::Single ) { if ( !(nFlags & SelectionEngineFlags::HAS_ANCH) ) { |