[Libreoffice-commits] core.git: include/vcl svtools/source vcl/source

Noel Grandin noel at peralex.com
Wed May 25 13:12:15 UTC 2016


 include/vcl/edit.hxx                    |    2 +-
 svtools/source/control/autocmpledit.cxx |    2 +-
 svtools/source/control/inettbc.cxx      |    2 +-
 vcl/source/control/combobox.cxx         |    6 +++---
 vcl/source/control/edit.cxx             |   12 ++++++------
 5 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 102196f06400864ef49af961352b5c285ee1f3ab
Author: Noel Grandin <noel at peralex.com>
Date:   Wed May 25 11:26:01 2016 +0200

    Convert AUTOCOMPLETE to scoped enum
    
    Change-Id: I201c8f8b41855b2777f0e7131aeaf33cafb82804
    Reviewed-on: https://gerrit.libreoffice.org/25438
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx
index ce686d4..d203bf7 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 9443aeb..af03e27 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 a3a0d1e..fbbfcab 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 2f72aa9..3bd8197 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 7331938..aab72e8 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);
             }
         }


More information about the Libreoffice-commits mailing list