summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-25 11:26:01 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-25 13:11:50 +0000
commit102196f06400864ef49af961352b5c285ee1f3ab (patch)
tree9c9fd222e06847ce239eaa0c8993b5700b578084
parent-Werror,-Wunused-macros (diff)
downloadcore-102196f06400864ef49af961352b5c285ee1f3ab.tar.gz
core-102196f06400864ef49af961352b5c285ee1f3ab.zip
Convert AUTOCOMPLETE to scoped enum
Change-Id: I201c8f8b41855b2777f0e7131aeaf33cafb82804 Reviewed-on: https://gerrit.libreoffice.org/25438 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--include/vcl/edit.hxx2
-rw-r--r--svtools/source/control/autocmpledit.cxx2
-rw-r--r--svtools/source/control/inettbc.cxx2
-rw-r--r--vcl/source/control/combobox.cxx6
-rw-r--r--vcl/source/control/edit.cxx12
5 files changed, 12 insertions, 12 deletions
diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index ce686d4cbc52..d203bf731f11 100644
--- a/include/vcl/edit.hxx
+++ b/include/vcl/edit.hxx
@@ -62,7 +62,7 @@ public:
virtual ~TextFilter();
};
-enum AutocompleteAction{ AUTOCOMPLETE_KEYINPUT, AUTOCOMPLETE_TABFORWARD, AUTOCOMPLETE_TABBACKWARD };
+enum class AutocompleteAction { KeyInput, TabForward, TabBackward };
class Timer;
diff --git a/svtools/source/control/autocmpledit.cxx b/svtools/source/control/autocmpledit.cxx
index 9443aebde78c..af03e270bf44 100644
--- a/svtools/source/control/autocmpledit.cxx
+++ b/svtools/source/control/autocmpledit.cxx
@@ -30,7 +30,7 @@ void AutocompleteEdit::ClearEntries()
IMPL_LINK_NOARG_TYPED(AutocompleteEdit, AutoCompleteHdl_Impl, Edit&, void)
{
- if( GetAutocompleteAction() != AUTOCOMPLETE_KEYINPUT )
+ if( GetAutocompleteAction() != AutocompleteAction::KeyInput )
return;
if( Application::AnyInput( VclInputFlags::KEYBOARD ) )
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index a3a0d1ec9d11..fbbfcab83a3d 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -1101,7 +1101,7 @@ bool SvtURLBox::PreNotify( NotifyEvent& rNEvt )
IMPL_LINK_NOARG_TYPED(SvtURLBox, AutoCompleteHdl_Impl, Edit&, void)
{
- if ( GetSubEdit()->GetAutocompleteAction() == AUTOCOMPLETE_KEYINPUT )
+ if ( GetSubEdit()->GetAutocompleteAction() == AutocompleteAction::KeyInput )
TryAutoComplete();
}
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 2f72aa92110e..3bd8197d13e0 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -347,7 +347,7 @@ IMPL_LINK_TYPED(ComboBox::Impl, ImplAutocompleteHdl, Edit&, rEdit, void)
Tab/Shift-Tab since then we would not cycle to the next field.
*/
if ( aSel.Len() ||
- ((eAction != AUTOCOMPLETE_TABFORWARD) && (eAction != AUTOCOMPLETE_TABBACKWARD)) )
+ ((eAction != AutocompleteAction::TabForward) && (eAction != AutocompleteAction::TabBackward)) )
{
OUString aFullText = rEdit.GetText();
OUString aStartText = aFullText.copy( 0, (sal_Int32)aSel.Max() );
@@ -357,9 +357,9 @@ IMPL_LINK_TYPED(ComboBox::Impl, ImplAutocompleteHdl, Edit&, rEdit, void)
nStart = 0;
bool bForward = true;
- if ( eAction == AUTOCOMPLETE_TABFORWARD )
+ if ( eAction == AutocompleteAction::TabForward )
nStart++;
- else if ( eAction == AUTOCOMPLETE_TABBACKWARD )
+ else if ( eAction == AutocompleteAction::TabBackward )
{
bForward = false;
if (nStart)
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 733193825573..aab72e8a3af2 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -295,7 +295,7 @@ void Edit::ImplInitEditData()
mnMaxTextLen = EDIT_NOLIMIT;
mnWidthInChars = -1;
mnMaxWidthChars = -1;
- meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
+ meAutocompleteAction = AutocompleteAction::KeyInput;
mbModified = false;
mbInternModified = false;
mbReadOnly = false;
@@ -1641,7 +1641,7 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.getLength()) )
{
- meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
+ meAutocompleteAction = AutocompleteAction::KeyInput;
maAutocompleteHdl.Call(*this);
}
}
@@ -1715,9 +1715,9 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
// Kein Autocomplete wenn alles Selektiert oder Edit leer, weil dann
// keine vernuenftige Tab-Steuerung!
if ( rKEvt.GetKeyCode().IsShift() )
- meAutocompleteAction = AUTOCOMPLETE_TABBACKWARD;
+ meAutocompleteAction = AutocompleteAction::TabBackward;
else
- meAutocompleteAction = AUTOCOMPLETE_TABFORWARD;
+ meAutocompleteAction = AutocompleteAction::TabForward;
autocompleteSignal( this );
@@ -1741,7 +1741,7 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.getLength()) )
{
- meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
+ meAutocompleteAction = AutocompleteAction::KeyInput;
maAutocompleteHdl.Call(*this);
}
}
@@ -2099,7 +2099,7 @@ void Edit::Command( const CommandEvent& rCEvt )
{
if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.getLength()) )
{
- meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
+ meAutocompleteAction = AutocompleteAction::KeyInput;
maAutocompleteHdl.Call(*this);
}
}