[Libreoffice-commits] core.git: sc/inc sc/source

Noel Grandin noelgrandin at gmail.com
Mon Sep 21 01:15:08 PDT 2015


 sc/inc/global.hxx              |    6 ++---
 sc/inc/scmod.hxx               |   44 ++++++++++++++++++++---------------------
 sc/source/ui/app/inputhdl.cxx  |   14 ++++++-------
 sc/source/ui/app/scmod.cxx     |    4 +--
 sc/source/ui/inc/inputhdl.hxx  |    2 -
 sc/source/ui/view/tabvwsh4.cxx |    8 +++----
 6 files changed, 39 insertions(+), 39 deletions(-)

New commits:
commit 588e1f97577b53a0131fa24c3cdfdf158b27efa7
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Sun Sep 20 16:27:05 2015 +0200

    convert SC_ENTER constants to scoped enum
    
    Change-Id: Idd77e2dbbcb1d1c7238ed9b5998730f0e0a9bf50
    Reviewed-on: https://gerrit.libreoffice.org/18732
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index a030e38..2af2c8d6 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -239,9 +239,9 @@ enum class ScLinkMode {
     NONE, NORMAL, VALUE
 };
                                         //  input
-#define SC_ENTER_NORMAL     0
-#define SC_ENTER_BLOCK      1
-#define SC_ENTER_MATRIX     2
+enum class ScEnterMode {
+    NORMAL, BLOCK, MATRIX
+};
 
                                         //  step = 10pt, max. indention = 100 steps
 #define SC_INDENT_STEP      200
diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index 482a6e6..3d70b9f 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -104,7 +104,7 @@ class ScModule: public SfxModule, public SfxListener, utl::ConfigurationListener
     SvtUserOptions*     pUserOptions;
     SfxErrorHandler*    pErrorHdl;
     ScFormEditData*     pFormEditData;
-    sal_uInt16              nCurRefDlgId;
+    sal_uInt16          nCurRefDlgId;
     bool                bIsWaterCan:1;
     bool                bIsInEditCommand:1;
     bool                bIsInExecuteDrop:1;
@@ -120,8 +120,8 @@ private:
     static void InitInterface_Impl();
 
 public:
-                    ScModule( SfxObjectFactory* pFact );
-    virtual         ~ScModule();
+                        ScModule( SfxObjectFactory* pFact );
+    virtual            ~ScModule();
 
     virtual void        Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
     virtual void        ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ) SAL_OVERRIDE;
@@ -168,28 +168,28 @@ public:
 
     // Options:
     const ScViewOptions&    GetViewOptions  ();
-SC_DLLPUBLIC    const ScDocOptions&     GetDocOptions   ();
-SC_DLLPUBLIC    const ScAppOptions&     GetAppOptions   ();
-SC_DLLPUBLIC    const ScDefaultsOptions&   GetDefaultsOptions ();
-    SC_DLLPUBLIC const ScFormulaOptions&   GetFormulaOptions ();
-    SC_DLLPUBLIC const ScInputOptions& GetInputOptions ();
-SC_DLLPUBLIC    const ScPrintOptions&   GetPrintOptions ();
-    void                    SetViewOptions  ( const ScViewOptions& rOpt );
-SC_DLLPUBLIC    void                    SetDocOptions   ( const ScDocOptions& rOpt );
-SC_DLLPUBLIC    void                    SetAppOptions   ( const ScAppOptions& rOpt );
-    void                    SetDefaultsOptions ( const ScDefaultsOptions& rOpt );
-    SC_DLLPUBLIC void                    SetFormulaOptions ( const ScFormulaOptions& rOpt );
+    SC_DLLPUBLIC const ScDocOptions&        GetDocOptions   ();
+    SC_DLLPUBLIC const ScAppOptions&        GetAppOptions   ();
+    SC_DLLPUBLIC const ScDefaultsOptions&   GetDefaultsOptions ();
+    SC_DLLPUBLIC const ScFormulaOptions&    GetFormulaOptions ();
+    SC_DLLPUBLIC const ScInputOptions&      GetInputOptions ();
+    SC_DLLPUBLIC const ScPrintOptions&      GetPrintOptions ();
+    void                SetViewOptions  ( const ScViewOptions& rOpt );
+    SC_DLLPUBLIC void   SetDocOptions   ( const ScDocOptions& rOpt );
+    SC_DLLPUBLIC void   SetAppOptions   ( const ScAppOptions& rOpt );
+    void                SetDefaultsOptions ( const ScDefaultsOptions& rOpt );
+    SC_DLLPUBLIC void   SetFormulaOptions ( const ScFormulaOptions& rOpt );
     SC_DLLPUBLIC void   SetInputOptions ( const ScInputOptions& rOpt );
-    void                    SetPrintOptions ( const ScPrintOptions& rOpt );
-    void                    InsertEntryToLRUList(sal_uInt16 nFIndex);
+    void                SetPrintOptions ( const ScPrintOptions& rOpt );
+    void                InsertEntryToLRUList(sal_uInt16 nFIndex);
     static void         RecentFunctionsChanged();
 
     static void         GetSpellSettings( sal_uInt16& rDefLang, sal_uInt16& rCjkLang, sal_uInt16& rCtlLang,
-                                        bool& rAutoSpell );
+                                          bool& rAutoSpell );
     static void         SetAutoSpellProperty( bool bSet );
     static bool         HasThesaurusLanguage( sal_uInt16 nLang );
 
-    sal_uInt16              GetOptDigitLanguage();      // from CTL options
+    sal_uInt16           GetOptDigitLanguage();      // from CTL options
 
     ScNavipiCfg&        GetNavipiCfg();
     ScAddInCfg&         GetAddInCfg();
@@ -203,9 +203,9 @@ SC_DLLPUBLIC    void                    SetAppOptions   ( const ScAppOptions& rO
     // InputHandler:
     bool                IsEditMode();   // not for SC_INPUT_TYPE
     bool                IsInputMode();  // also for SC_INPUT_TYPE
-    void SetInputMode( ScInputMode eMode, const OUString* pInitText = NULL );
+    void                SetInputMode( ScInputMode eMode, const OUString* pInitText = NULL );
     bool                InputKeyEvent( const KeyEvent& rKEvt, bool bStartEdit = false );
-    SC_DLLPUBLIC void                InputEnterHandler( sal_uInt8 nBlockMode = 0 );
+    SC_DLLPUBLIC void   InputEnterHandler( ScEnterMode nBlockMode = ScEnterMode::NORMAL );
     void                InputCancelHandler();
     void                InputSelection( EditView* pView );
     void                InputChanged( EditView* pView );
@@ -230,7 +230,7 @@ SC_DLLPUBLIC    void                    SetAppOptions   ( const ScAppOptions& rO
     ScFormEditData*     GetFormEditData()       { return pFormEditData; }
 
     // input of reference:
-    SC_DLLPUBLIC void               SetRefDialog( sal_uInt16 nId, bool bVis, SfxViewFrame* pViewFrm = NULL );
+    SC_DLLPUBLIC void   SetRefDialog( sal_uInt16 nId, bool bVis, SfxViewFrame* pViewFrm = NULL );
     bool                IsModalMode(SfxObjectShell* pDocSh = NULL);
     bool                IsFormulaMode();
     bool                IsRefDialogOpen();
@@ -239,7 +239,7 @@ SC_DLLPUBLIC    void                    SetAppOptions   ( const ScAppOptions& rO
                                         const ScMarkData* pMarkData = NULL );
     void                AddRefEntry();
     void                EndReference();
-    sal_uInt16              GetCurRefDlgId() const                  { return nCurRefDlgId; }
+    sal_uInt16          GetCurRefDlgId() const                  { return nCurRefDlgId; }
 
     // virtual methods for the options dialog
     virtual SfxItemSet*  CreateItemSet( sal_uInt16 nId ) SAL_OVERRIDE;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 1abcbf3..7b157bf 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2409,7 +2409,7 @@ static void lcl_SelectionToEnd( EditView* pView )
     }
 }
 
-void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
+void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
 {
     // Macro calls for validity can cause a lot of problems, so inhibit
     // nested calls of EnterHandler().
@@ -2419,7 +2419,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
 
     ImplCreateEditEngine();
 
-    bool bMatrix = ( nBlockMode == SC_ENTER_MATRIX );
+    bool bMatrix = ( nBlockMode == ScEnterMode::MATRIX );
 
     SfxApplication* pSfxApp     = SfxGetpApp();
     EditTextObject* pObject     = NULL;
@@ -2705,9 +2705,9 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode )
             SfxBindings& rBindings = pExecuteSh->GetViewFrame()->GetBindings();
 
             sal_uInt16 nId = FID_INPUTLINE_ENTER;
-            if ( nBlockMode == SC_ENTER_BLOCK )
+            if ( nBlockMode == ScEnterMode::BLOCK )
                 nId = FID_INPUTLINE_BLOCK;
-            else if ( nBlockMode == SC_ENTER_MATRIX )
+            else if ( nBlockMode == ScEnterMode::MATRIX )
                 nId = FID_INPUTLINE_MATRIX;
 
             ScInputStatusItem aItem( FID_INPUTLINE_STATUS,
@@ -3055,11 +3055,11 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false
             }
             else
             {
-                sal_uInt8 nMode = SC_ENTER_NORMAL;
+                ScEnterMode nMode = ScEnterMode::NORMAL;
                 if ( bShift && bControl )
-                    nMode = SC_ENTER_MATRIX;
+                    nMode = ScEnterMode::MATRIX;
                 else if ( bAlt )
-                    nMode = SC_ENTER_BLOCK;
+                    nMode = ScEnterMode::BLOCK;
                 EnterHandler( nMode );
 
                 if (pActiveViewSh)
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 6a8a342..1265653 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1415,7 +1415,7 @@ bool ScModule::InputKeyEvent( const KeyEvent& rKEvt, bool bStartEdit )
     return pHdl && pHdl->KeyInput( rKEvt, bStartEdit );
 }
 
-void ScModule::InputEnterHandler( sal_uInt8 nBlockMode )
+void ScModule::InputEnterHandler( ScEnterMode nBlockMode )
 {
     if ( !SfxGetpApp()->IsDowning() ) // Not when quitting the program
     {
@@ -1509,7 +1509,7 @@ void ScModule::ActivateInputWindow( const OUString* pStrFormula, bool bMatrix )
                 pWin->SetFuncString( *pStrFormula, false );
                 // SetSumAssignMode due to sal_False not necessary
             }
-            sal_uInt8 nMode = bMatrix ? SC_ENTER_MATRIX : SC_ENTER_NORMAL;
+            ScEnterMode nMode = bMatrix ? ScEnterMode::MATRIX : ScEnterMode::NORMAL;
             pHdl->EnterHandler( nMode );
 
             // Without Invalidate the selection remains active, if the formula has not changed
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx
index effbc4c..63f5fd2 100644
--- a/sc/source/ui/inc/inputhdl.hxx
+++ b/sc/source/ui/inc/inputhdl.hxx
@@ -180,7 +180,7 @@ public:
     bool            GetTextAndFields( ScEditEngineDefaulter& rDestEngine );
 
     bool            KeyInput( const KeyEvent& rKEvt, bool bStartEdit = false );
-    void            EnterHandler( sal_uInt8 nBlockMode = 0 );
+    void            EnterHandler( ScEnterMode nBlockMode = ScEnterMode::NORMAL );
     void            CancelHandler();
     void            SetReference( const ScRange& rRef, ScDocument* pDoc );
     void            AddRefEntry();
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 996f7c7..33a556a 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1310,14 +1310,14 @@ bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt)
                         if ( bOnRefSheet )
                             HideAllCursors();
 
-                        sal_uInt8 nMode = SC_ENTER_NORMAL;
+                        ScEnterMode nMode = ScEnterMode::NORMAL;
                         if ( bShift && bControl )
-                            nMode = SC_ENTER_MATRIX;
+                            nMode = ScEnterMode::MATRIX;
                         else if ( bAlt )
-                            nMode = SC_ENTER_BLOCK;
+                            nMode = ScEnterMode::BLOCK;
                         pScMod->InputEnterHandler(nMode);
 
-                        if (nMode == SC_ENTER_NORMAL)
+                        if (nMode == ScEnterMode::NORMAL)
                         {
                             if( bShift )
                                 GetViewData().GetDispatcher().Execute( SID_CURSORENTERUP,


More information about the Libreoffice-commits mailing list