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

Noel Grandin noel at peralex.com
Fri Mar 18 06:02:00 UTC 2016


 formula/source/core/api/FormulaCompiler.cxx |   11 +++++------
 formula/source/ui/dlg/formula.cxx           |   16 +++++-----------
 include/formula/FormulaCompiler.hxx         |   11 +++++------
 include/formula/formula.hxx                 |    6 ------
 reportdesign/source/ui/dlg/Formula.cxx      |    2 +-
 sc/inc/compiler.hxx                         |    2 +-
 sc/source/core/tool/compiler.cxx            |    4 ++--
 sc/source/ui/formdlg/formula.cxx            |    2 +-
 8 files changed, 20 insertions(+), 34 deletions(-)

New commits:
commit 9704207c386867d1859b06dd25232e06022965d9
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Mar 17 12:43:20 2016 +0200

    loplugin:constantparam in formula
    
    Change-Id: I3adeed435b62ae60b5d0d4b763dceced5675cd85
    Reviewed-on: https://gerrit.libreoffice.org/23330
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 4813cfc..ba0e03e 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -900,7 +900,7 @@ void FormulaCompiler::OpCodeMap::putCopyOpCode( const OUString& rSymbol, OpCode
     }
 }
 
-void FormulaCompiler::OpCodeMap::copyFrom( const OpCodeMap& r, bool bOverrideKnownBad )
+void FormulaCompiler::OpCodeMap::copyFrom( const OpCodeMap& r )
 {
     delete mpHashMap;
     mpHashMap = new OpCodeHashMap( mnSymbols);
@@ -919,7 +919,7 @@ void FormulaCompiler::OpCodeMap::copyFrom( const OpCodeMap& r, bool bOverrideKno
     // For bOverrideKnownBad when copying from the English core map (ODF 1.1
     // and API) to the native map (UI "use English function names") replace the
     // known bad legacy function names with correct ones.
-    if (bOverrideKnownBad && r.mbCore &&
+    if (r.mbCore &&
             FormulaGrammar::extractFormulaLanguage( meGrammar) == sheet::FormulaLanguage::NATIVE &&
             FormulaGrammar::extractFormulaLanguage( r.meGrammar) == sheet::FormulaLanguage::ENGLISH)
     {
@@ -1710,8 +1710,7 @@ void FormulaCompiler::SetError( sal_uInt16 /*nError*/ )
 {
 }
 
-FormulaTokenRef FormulaCompiler::ExtendRangeReference( FormulaToken & /*rTok1*/, FormulaToken & /*rTok2*/,
-        bool /*bReuseDoubleRef*/ )
+FormulaTokenRef FormulaCompiler::ExtendRangeReference( FormulaToken & /*rTok1*/, FormulaToken & /*rTok2*/ )
 {
     return FormulaTokenRef();
 }
@@ -1724,7 +1723,7 @@ bool FormulaCompiler::MergeRangeReference( FormulaToken * * const pCode1, Formul
             ((p1 = *pCode1) == nullptr) || ((p2 = *pCode2) == nullptr) )
         return false;
 
-    FormulaTokenRef p = ExtendRangeReference( *p1, *p2, true);
+    FormulaTokenRef p = ExtendRangeReference( *p1, *p2);
     if (!p)
         return false;
 
@@ -2115,7 +2114,7 @@ void FormulaCompiler::SetNativeSymbols( const OpCodeMapPtr& xMap )
 {
     NonConstOpCodeMapPtr xSymbolsNative;
     lcl_fillNativeSymbols( xSymbolsNative);
-    xSymbolsNative->copyFrom( *xMap, true);
+    xSymbolsNative->copyFrom( *xMap );
 }
 
 
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index c60aca7..c9fd5b8 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -1706,14 +1706,11 @@ void FormulaDlg_Impl::SetEdSelection()
 }
 
 FormulaModalDialog::FormulaModalDialog(   vcl::Window* pParent
-                                        , bool _bSupportFunctionResult
-                                        , bool _bSupportResult
-                                        , bool _bSupportMatrix
                                         , IFunctionManager* _pFunctionMgr
                                         , IControlReferenceHandler* _pDlg )
     : ModalDialog(pParent, "FormulaDialog", "formula/ui/formuladialog.ui")
-    , m_pImpl(new FormulaDlg_Impl(this,_bSupportFunctionResult,
-                                  _bSupportResult, _bSupportMatrix,
+    , m_pImpl(new FormulaDlg_Impl(this, false/*_bSupportFunctionResult*/,
+                                  false/*_bSupportResult*/, false/*_bSupportMatrix*/,
                                   this, _pFunctionMgr, _pDlg))
 {
     SetText(m_pImpl->aTitle1);
@@ -1797,14 +1794,11 @@ void FormulaModalDialog::StoreFormEditData(FormEditData* pData)
 
 FormulaDlg::FormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
                              vcl::Window* pParent
-                            , bool _bSupportFunctionResult
-                            , bool _bSupportResult
-                            , bool _bSupportMatrix
                             , IFunctionManager* _pFunctionMgr, IControlReferenceHandler* _pDlg ) :
         SfxModelessDialog( pB, pCW, pParent, "FormulaDialog", "formula/ui/formuladialog.ui" ),
-        m_pImpl( new FormulaDlg_Impl(this, _bSupportFunctionResult
-                                            , _bSupportResult
-                                            , _bSupportMatrix
+        m_pImpl( new FormulaDlg_Impl(this, true/*_bSupportFunctionResult*/
+                                            , true/*_bSupportResult*/
+                                            , true/*_bSupportMatrix*/
                                             , this, _pFunctionMgr, _pDlg))
 {
     //undo SfxModelessDialog HelpId clear hack
diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx
index 24956d6..516d7f0 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -105,12 +105,11 @@ public:
 
         /** Copy mappings from r into this map, effectively replacing this map.
 
-            @param  bOverrideKnownBad
-                    If TRUE, override known legacy bad function names with
-                    correct ones if the conditions can be derived from the
-                    current maps.
+            Override known legacy bad function names with
+            correct ones if the conditions can be derived from the
+            current maps.
          */
-        void copyFrom( const OpCodeMap& r, bool bOverrideKnownBad );
+        void copyFrom( const OpCodeMap& r );
 
         /// Get the symbol String -> OpCode hash map for finds.
         inline const OpCodeHashMap* getHashMap() const { return mpHashMap; }
@@ -278,7 +277,7 @@ protected:
     virtual void fillAddInToken(::std::vector< css::sheet::FormulaOpCodeMapEntry >& _rVec, bool _bIsEnglish) const;
 
     virtual void SetError(sal_uInt16 nError);
-    virtual FormulaTokenRef ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2, bool bReuseDoubleRef );
+    virtual FormulaTokenRef ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2 );
     virtual bool HandleExternalReference(const FormulaToken& _aToken);
     virtual bool HandleRange();
     virtual bool HandleColRowName();
diff --git a/include/formula/formula.hxx b/include/formula/formula.hxx
index db744b2..2456cb0 100644
--- a/include/formula/formula.hxx
+++ b/include/formula/formula.hxx
@@ -50,9 +50,6 @@ class FORMULA_DLLPUBLIC FormulaModalDialog :   public ModalDialog, public formul
     friend class FormulaDlg_Impl;
 public:
                     FormulaModalDialog( vcl::Window* pParent
-                                            , bool _bSupportFunctionResult
-                                            , bool _bSupportResult
-                                            , bool _bSupportMatrix
                                             ,IFunctionManager* _pFunctionMgr
                                             ,IControlReferenceHandler* _pDlg = nullptr );
     virtual ~FormulaModalDialog();
@@ -90,9 +87,6 @@ public:
                     FormulaDlg( SfxBindings* pB
                                     , SfxChildWindow* pCW
                                     , vcl::Window* pParent
-                                    , bool _bSupportFunctionResult
-                                    , bool _bSupportResult
-                                    , bool _bSupportMatrix
                                     , IFunctionManager* _pFunctionMgr
                                     , IControlReferenceHandler* _pDlg = nullptr );
     virtual ~FormulaDlg();
diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx
index ad3264c..16900c4 100644
--- a/reportdesign/source/ui/dlg/Formula.cxx
+++ b/reportdesign/source/ui/dlg/Formula.cxx
@@ -49,7 +49,7 @@ FormulaDialog::FormulaDialog(vcl::Window* pParent
                              , const OUString& _sFormula
                              , const css::uno::Reference < css::beans::XPropertySet >& _xRowSet
                              , svl::SharedStringPool& rStrPool )
-    : FormulaModalDialog( pParent, false,false,false,_pFunctionMgr.get(),this)
+    : FormulaModalDialog( pParent, _pFunctionMgr.get(),this)
     ,m_aFunctionManager(_pFunctionMgr)
     ,m_pFormulaData(new FormEditData())
     ,m_pAddField(nullptr)
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index d18d3b5..2af43e4 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -452,7 +452,7 @@ private:
     virtual bool HandleDbData() override;
     virtual bool HandleTableRef() override;
 
-    virtual formula::FormulaTokenRef ExtendRangeReference( formula::FormulaToken & rTok1, formula::FormulaToken & rTok2, bool bReuseDoubleRef ) override;
+    virtual formula::FormulaTokenRef ExtendRangeReference( formula::FormulaToken & rTok1, formula::FormulaToken & rTok2 ) override;
     virtual void CreateStringFromExternal( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
     virtual void CreateStringFromSingleRef( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
     virtual void CreateStringFromDoubleRef( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 2ea8034..2f88dd9 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4847,9 +4847,9 @@ sal_Unicode ScCompiler::GetNativeAddressSymbol( Convention::SpecialSymbolType eT
     return pConv->getSpecialSymbol(eType);
 }
 
-FormulaTokenRef ScCompiler::ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2, bool bReuseDoubleRef )
+FormulaTokenRef ScCompiler::ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2 )
 {
-    return extendRangeReference( rTok1, rTok2, aPos,bReuseDoubleRef );
+    return extendRangeReference( rTok1, rTok2, aPos, true/*bReuseDoubleRef*/ );
 }
 
 void ScCompiler::fillAddInToken(::std::vector< css::sheet::FormulaOpCodeMapEntry >& _rVec,bool _bIsEnglish) const
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 085c717..4f2aff5 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -62,7 +62,7 @@ using namespace com::sun::star;
 
 ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
                                     vcl::Window* pParent, ScViewData* pViewData,formula::IFunctionManager* _pFunctionMgr )
-    : formula::FormulaDlg( pB, pCW, pParent, true,true,true, _pFunctionMgr,this)
+    : formula::FormulaDlg( pB, pCW, pParent, _pFunctionMgr,this)
     , m_aHelper(this,pB)
 {
     m_aHelper.SetWindow(this);


More information about the Libreoffice-commits mailing list