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

2023-02-27 Thread Caolán McNamara (via logerrit)
 formula/source/ui/dlg/FormulaHelper.cxx |   12 ++--
 formula/source/ui/dlg/formula.cxx   |2 +-
 include/formula/formulahelper.hxx   |4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 9a930ef9ea45277109c9acd6e7e1ccfe47fe136c
Author: Caolán McNamara 
AuthorDate: Sun Feb 26 20:44:33 2023 +
Commit: Caolán McNamara 
CommitDate: Mon Feb 27 08:59:58 2023 +

can use a reference instead of a pointer

Change-Id: I770983c2a46c2181db80243efa7c926e356d5e6c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147745
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/formula/source/ui/dlg/FormulaHelper.cxx 
b/formula/source/ui/dlg/FormulaHelper.cxx
index 58d474de8015..764cdba9d8f5 100644
--- a/formula/source/ui/dlg/FormulaHelper.cxx
+++ b/formula/source/ui/dlg/FormulaHelper.cxx
@@ -61,14 +61,14 @@ namespace formula
 #define FUNC_NOTFOUND -1
 
 FormulaHelper::FormulaHelper(const IFunctionManager* _pFunctionManager)
-:m_pFunctionManager(_pFunctionManager)
+:m_rCharClass(m_aSysLocale.GetCharClass())
+,m_pFunctionManager(_pFunctionManager)
 ,open(_pFunctionManager->getSingleToken(IFunctionManager::eOk))
 ,close(_pFunctionManager->getSingleToken(IFunctionManager::eClose))
 ,sep(_pFunctionManager->getSingleToken(IFunctionManager::eSep))
 ,arrayOpen(_pFunctionManager->getSingleToken(IFunctionManager::eArrayOpen))
 
,arrayClose(_pFunctionManager->getSingleToken(IFunctionManager::eArrayClose))
 {
-m_pCharClass = _aSysLocale.GetCharClass();
 }
 
 sal_Int32 FormulaHelper::GetCategoryCount() const
@@ -184,9 +184,9 @@ void FormulaHelper::GetArgStrings( ::std::vector< OUString 
>& _rArgs,
 }
 
 
-static bool IsFormulaText( const CharClass* _pCharClass,const OUString& rStr, 
sal_Int32 nPos )
+static bool IsFormulaText(const CharClass& rCharClass, const OUString& rStr, 
sal_Int32 nPos)
 {
-if( _pCharClass->isLetterNumeric( rStr, nPos ) )
+if( rCharClass.isLetterNumeric( rStr, nPos ) )
 return true;
 else
 {   // In internationalized versions function names may contain a dot
@@ -260,7 +260,7 @@ sal_Int32 FormulaHelper::GetFunctionStart( const OUString&  
 rFormula,
 {
 nFStart = nParPos-1;
 
-while ( (nFStart > 0) && IsFormulaText(m_pCharClass, rFormula, 
nFStart ))
+while ( (nFStart > 0) && IsFormulaText(m_rCharClass, rFormula, 
nFStart ))
 nFStart--;
 }
 
@@ -268,7 +268,7 @@ sal_Int32 FormulaHelper::GetFunctionStart( const OUString&  
 rFormula,
 
 if ( bFound )
 {
-if ( IsFormulaText( m_pCharClass,rFormula, nFStart ) )
+if ( IsFormulaText( m_rCharClass, rFormula, nFStart ) )
 {
 //  Function found
 if ( pFuncName )
diff --git a/formula/source/ui/dlg/formula.cxx 
b/formula/source/ui/dlg/formula.cxx
index c73543603158..139c9ab4795c 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -375,7 +375,7 @@ sal_Int32 FormulaDlg_Impl::GetFunctionPos(sal_Int32 nPos)
 const sal_Unicode sep = 
m_pHelper->getFunctionManager()->getSingleToken(IFunctionManager::eSep);
 
 sal_Int32 nFuncPos = SAL_MAX_INT32;
-OUString  aFormString = 
m_aFormulaHelper.GetCharClass()->uppercase(m_xMEdit->get_text());
+OUString  aFormString = 
m_aFormulaHelper.GetCharClass().uppercase(m_xMEdit->get_text());
 
 const uno::Reference< sheet::XFormulaParser > 
xParser(m_pHelper->getFormulaParser());
 const table::CellAddress aRefPos(m_pHelper->getReferencePosition());
diff --git a/include/formula/formulahelper.hxx 
b/include/formula/formulahelper.hxx
index e6173eb65e53..3b6cb88a67d3 100644
--- a/include/formula/formulahelper.hxx
+++ b/include/formula/formulahelper.hxx
@@ -38,7 +38,7 @@ namespace formula
 class FORMULA_DLLPUBLIC FormulaHelper
 {
 SvtSysLocalem_aSysLocale;
-const CharClass*m_pCharClass;
+const CharClass&m_rCharClass;
 const IFunctionManager* m_pFunctionManager;
 const sal_Unicode open;
 const sal_Unicode close;
@@ -48,7 +48,7 @@ namespace formula
 public:
 FormulaHelper(const IFunctionManager* _pFunctionManager);
 
-const CharClass* GetCharClass() const { return m_pCharClass; }
+const CharClass& GetCharClass() const { return m_rCharClass; }
 
 sal_Int32   GetCategoryCount() const;
 


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

2023-02-26 Thread Noel Grandin (via logerrit)
 formula/source/ui/dlg/FormulaHelper.cxx |5 ++---
 include/formula/formulahelper.hxx   |2 +-
 starmath/inc/smmod.hxx  |3 ++-
 starmath/source/smmod.cxx   |6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit bee4402c7ed97f3373f93eb7939940557bd59912
Author: Noel Grandin 
AuthorDate: Sun Feb 26 20:17:36 2023 +0200
Commit: Noel Grandin 
CommitDate: Sun Feb 26 19:50:19 2023 +

no need to hold SvtSysLocale by std::unique_ptr

allocate it inline, it is only one pointer in size

Change-Id: I736f3322784897054993fbddd423f36357f817c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147741
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/formula/source/ui/dlg/FormulaHelper.cxx 
b/formula/source/ui/dlg/FormulaHelper.cxx
index 85799c40ecc2..58d474de8015 100644
--- a/formula/source/ui/dlg/FormulaHelper.cxx
+++ b/formula/source/ui/dlg/FormulaHelper.cxx
@@ -61,15 +61,14 @@ namespace formula
 #define FUNC_NOTFOUND -1
 
 FormulaHelper::FormulaHelper(const IFunctionManager* _pFunctionManager)
-:m_pSysLocale(new SvtSysLocale)
-,m_pFunctionManager(_pFunctionManager)
+:m_pFunctionManager(_pFunctionManager)
 ,open(_pFunctionManager->getSingleToken(IFunctionManager::eOk))
 ,close(_pFunctionManager->getSingleToken(IFunctionManager::eClose))
 ,sep(_pFunctionManager->getSingleToken(IFunctionManager::eSep))
 ,arrayOpen(_pFunctionManager->getSingleToken(IFunctionManager::eArrayOpen))
 
,arrayClose(_pFunctionManager->getSingleToken(IFunctionManager::eArrayClose))
 {
-m_pCharClass = _pSysLocale->GetCharClass();
+m_pCharClass = _aSysLocale.GetCharClass();
 }
 
 sal_Int32 FormulaHelper::GetCategoryCount() const
diff --git a/include/formula/formulahelper.hxx 
b/include/formula/formulahelper.hxx
index f57a276fb178..e6173eb65e53 100644
--- a/include/formula/formulahelper.hxx
+++ b/include/formula/formulahelper.hxx
@@ -37,7 +37,7 @@ namespace formula
 
 class FORMULA_DLLPUBLIC FormulaHelper
 {
-::std::unique_ptr m_pSysLocale;
+SvtSysLocalem_aSysLocale;
 const CharClass*m_pCharClass;
 const IFunctionManager* m_pFunctionManager;
 const sal_Unicode open;
diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx
index f75643d0ffe8..9ab99c2420d7 100644
--- a/starmath/inc/smmod.hxx
+++ b/starmath/inc/smmod.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace svtools { class ColorConfig; }
 
@@ -65,7 +66,7 @@ class SmModule final : public SfxModule, public 
utl::ConfigurationListener
 std::unique_ptr mpColorConfig;
 std::unique_ptr mpConfig;
 std::unique_ptr mpLocSymbolData;
-std::unique_ptr mpSysLocale;
+std::optional moSysLocale;
 VclPtrmpVirtualDev;
 
 public:
diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx
index 783965844b38..934e6090eaf1 100644
--- a/starmath/source/smmod.cxx
+++ b/starmath/source/smmod.cxx
@@ -173,9 +173,9 @@ SmSymbolManager & SmModule::GetSymbolManager()
 
 const SvtSysLocale& SmModule::GetSysLocale()
 {
-if( !mpSysLocale )
-mpSysLocale.reset(new SvtSysLocale);
-return *mpSysLocale;
+if( !moSysLocale )
+moSysLocale.emplace();
+return *moSysLocale;
 }
 
 VirtualDevice ::GetDefaultVirtualDev()


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

2023-01-01 Thread Eike Rathke (via logerrit)
 formula/source/core/api/FormulaCompiler.cxx |   14 --
 include/formula/FormulaCompiler.hxx |   16 +++-
 sc/source/core/tool/compiler.cxx|8 
 3 files changed, 27 insertions(+), 11 deletions(-)

New commits:
commit cf8cfee9d4e64dba6a14dde16f08a7699fdff863
Author: Eike Rathke 
AuthorDate: Sun Jan 1 15:35:16 2023 +0100
Commit: Eike Rathke 
CommitDate: Sun Jan 1 20:26:05 2023 +

Resolves: tdf#151886 Use default locale with English function names again

Automatically switching to en-US locale when using English
function names caused too much confusion. There also might be the
possibility that the '.' dot decimal separator clashes with the
inline array column separator in some locales.

A proper solution would make this user-specified and if set also
adjust the separators to the common English ones. For now keep the
default locale again as it previously was the case.

Change-Id: Ic4712c6609c14f35cf0d1d842ac7443806a6e115
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144924
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index b0e21b250377..f7dcba3f9853 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1313,7 +1313,17 @@ void FormulaCompiler::OpCodeMap::copyFrom( const 
OpCodeMap& r )
 maExternalHashMap = r.maExternalHashMap;
 maReverseExternalHashMap = r.maReverseExternalHashMap;
 mbCore = r.mbCore;
-mbEnglish = r.mbEnglish;
+if (mbEnglish != r.mbEnglish)
+{
+// For now keep mbEnglishLocale setting, which is false for a
+// non-English native map we're copying to.
+/* TODO:
+if (!mbEnglish && r.mbEnglish)
+mbEnglishLocale = "getUseEnglishLocaleFromConfiguration()";
+or set from outside i.e. via ScCompiler.
+*/
+mbEnglish = r.mbEnglish;
+}
 }
 }
 
@@ -2658,7 +2668,7 @@ const FormulaToken* 
FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuf
 
 void FormulaCompiler::AppendDouble( OUStringBuffer& rBuffer, double fVal ) 
const
 {
-if ( mxSymbols->isEnglish() )
+if ( mxSymbols->isEnglishLocale() )
 {
 ::rtl::math::doubleToUStringBuffer( rBuffer, fVal,
 rtl_math_StringFormat_Automatic,
diff --git a/include/formula/FormulaCompiler.hxx 
b/include/formula/FormulaCompiler.hxx
index d94dbd40d399..08710f561b5a 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -83,12 +83,13 @@ public:
 {
 OpCodeHashMap   maHashMap;  /// Hash map of 
symbols, OUString -> OpCode
 std::unique_ptr mpTable;/// Array of 
symbols, OpCode -> OUString, offset==OpCode
-ExternalHashMap maExternalHashMap; /// Hash map of 
ocExternal, Filter String -> AddIn String
-ExternalHashMap maReverseExternalHashMap;  /// Hash map of 
ocExternal, AddIn String -> Filter String
+ExternalHashMap maExternalHashMap;  /// Hash map of 
ocExternal, Filter String -> AddIn String
+ExternalHashMap maReverseExternalHashMap;   /// Hash map of 
ocExternal, AddIn String -> Filter String
 FormulaGrammar::Grammar meGrammar;  /// Grammar, 
language and reference convention
 sal_uInt16  mnSymbols;  /// Count of 
OpCode symbols
-boolmbCore  : 1;/// If mapping was 
setup by core, not filters
-boolmbEnglish   : 1;/// If English 
symbols and external names
+boolmbCore  : 1;/// If mapping was 
setup by core, not filters
+boolmbEnglish   : 1;/// If English 
symbols and external names
+boolmbEnglishLocale : 1;/// If English 
locale for numbers
 
 OpCodeMap( const OpCodeMap& ) = delete;
 OpCodeMap& operator=( const OpCodeMap& ) = delete;
@@ -101,7 +102,8 @@ public:
 meGrammar( eGrammar),
 mnSymbols( nSymbols),
 mbCore( bCore),
-mbEnglish ( FormulaGrammar::isEnglish(eGrammar) )
+mbEnglish ( FormulaGrammar::isEnglish(eGrammar) ),
+mbEnglishLocale ( mbEnglish )
 {
 }
 
@@ -145,6 +147,10 @@ public:
 be English as well)? */
 bool isEnglish() const { return mbEnglish; }
 
+/** Are inline numbers parsed/formatted in en-US locale, as opposed
+to default locale? */
+bool isEnglishLocale() const { return mbEnglishLocale; }
+
 /// Is it an ODF 1.1 compatibility mapping?
 bool isPODF() const { return 

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

2022-09-01 Thread Eike Rathke (via logerrit)
 formula/source/core/api/FormulaCompiler.cxx |5 +
 include/formula/FormulaCompiler.hxx |   23 +++
 2 files changed, 28 insertions(+)

New commits:
commit 603f9ce4f39a59bd84b5c08e3d725e0ee664991f
Author: Eike Rathke 
AuthorDate: Thu Sep 1 13:27:46 2022 +0200
Commit: Eike Rathke 
CommitDate: Thu Sep 1 15:17:20 2022 +0200

Related: tdf#142293 Introduce a protected 
FormulaCompiler::GetFinalOpCodeMap()

... to prepare having GetOpCodeMap() return a temporary if a final
doesn't exist yet. Currently just an alias.

Change-Id: I6fc100ae6223010e149e4af01fc7c17630930de7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139162
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 55e65ae9fd7c..2f7128c0d8a6 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -816,6 +816,11 @@ FormulaCompiler::~FormulaCompiler()
 }
 
 FormulaCompiler::OpCodeMapPtr FormulaCompiler::GetOpCodeMap( const sal_Int32 
nLanguage ) const
+{
+return GetFinalOpCodeMap(nLanguage);
+}
+
+FormulaCompiler::OpCodeMapPtr FormulaCompiler::GetFinalOpCodeMap( const 
sal_Int32 nLanguage ) const
 {
 FormulaCompiler::OpCodeMapPtr xMap;
 using namespace sheet;
diff --git a/include/formula/FormulaCompiler.hxx 
b/include/formula/FormulaCompiler.hxx
index 36632035602e..d94dbd40d399 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -196,7 +196,30 @@ public:
 typedef std::shared_ptr< const OpCodeMap >  OpCodeMapPtr;
 typedef std::shared_ptr< OpCodeMap >NonConstOpCodeMapPtr;
 
+protected:
+/** Get finalized OpCodeMap for formula language.
+
+Creates/returns a singleton instance of an OpCodeMap that contains
+external AddIn mappings if the derived class supports them. Do not call
+at this base class as it results in a permanent mapping without AddIns
+even for derived classes (unless it is for the implementation of the
+temporary GetOpCodeMap()).
+
+@param nLanguage
+One of css::sheet::FormulaLanguage constants.
+@return Map for nLanguage. If nLanguage is unknown, a NULL map is 
returned.
+ */
+OpCodeMapPtr GetFinalOpCodeMap( const sal_Int32 nLanguage ) const;
+
+public:
 /** Get OpCodeMap for formula language.
+
+Returns either the finalized OpCodeMap (created by GetFinalOpCodeMap()
+of a derived class) for nLanguage if there is such, or if not then a
+temporary map of which its singleton is reset immediately and the
+temporary will get destroyed by the caller's scope. A temporary map
+created at this base class does *not* contain AddIn mappings.
+
 @param nLanguage
 One of css::sheet::FormulaLanguage constants.
 @return Map for nLanguage. If nLanguage is unknown, a NULL map is 
returned.


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

2022-08-06 Thread Eike Rathke (via logerrit)
 formula/source/core/api/FormulaCompiler.cxx |  143 +++-
 include/formula/FormulaCompiler.hxx |   42 ++--
 sc/source/core/tool/calcconfig.cxx  |   13 ++
 3 files changed, 167 insertions(+), 31 deletions(-)

New commits:
commit 28c4c72a4e81821d9e567757725937f74a6d114f
Author: Eike Rathke 
AuthorDate: Fri Aug 5 12:43:36 2022 +0200
Commit: Eike Rathke 
CommitDate: Sat Aug 6 11:19:01 2022 +0200

Related: tdf#135993 Destroy temporary OpCodeMap when reading config

Initialized at FormulaCompiler base class instance it lacks AddIn
mapping and a still existing OpCodeMap prevents necessary
reinitialization from derived ScCompiler instance later.

Change-Id: I0c2db41dd45829abfb8460730264f097ab76ab2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137881
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index be926e7d521a..2b0db73d1a39 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -823,37 +823,37 @@ FormulaCompiler::OpCodeMapPtr 
FormulaCompiler::GetOpCodeMap( const sal_Int32 nLa
 {
 case FormulaLanguage::ODFF :
 if (!mxSymbolsODFF)
-InitSymbolsODFF();
+InitSymbolsODFF( InitSymbols::INIT);
 xMap = mxSymbolsODFF;
 break;
 case FormulaLanguage::ODF_11 :
 if (!mxSymbolsPODF)
-InitSymbolsPODF();
+InitSymbolsPODF( InitSymbols::INIT);
 xMap = mxSymbolsPODF;
 break;
 case FormulaLanguage::ENGLISH :
 if (!mxSymbolsEnglish)
-InitSymbolsEnglish();
+InitSymbolsEnglish( InitSymbols::INIT);
 xMap = mxSymbolsEnglish;
 break;
 case FormulaLanguage::NATIVE :
 if (!mxSymbolsNative)
-InitSymbolsNative();
+InitSymbolsNative( InitSymbols::INIT);
 xMap = mxSymbolsNative;
 break;
 case FormulaLanguage::XL_ENGLISH:
 if (!mxSymbolsEnglishXL)
-InitSymbolsEnglishXL();
+InitSymbolsEnglishXL( InitSymbols::INIT);
 xMap = mxSymbolsEnglishXL;
 break;
 case FormulaLanguage::OOXML:
 if (!mxSymbolsOOXML)
-InitSymbolsOOXML();
+InitSymbolsOOXML( InitSymbols::INIT);
 xMap = mxSymbolsOOXML;
 break;
 case FormulaLanguage::API :
 if (!mxSymbolsAPI)
-InitSymbolsAPI();
+InitSymbolsAPI( InitSymbols::INIT);
 xMap = mxSymbolsAPI;
 break;
 default:
@@ -862,6 +862,62 @@ FormulaCompiler::OpCodeMapPtr 
FormulaCompiler::GetOpCodeMap( const sal_Int32 nLa
 return xMap;
 }
 
+void FormulaCompiler::DestroyOpCodeMap( const sal_Int32 nLanguage )
+{
+using namespace sheet;
+switch (nLanguage)
+{
+case FormulaLanguage::ODFF :
+InitSymbolsODFF( InitSymbols::DESTROY);
+break;
+case FormulaLanguage::ODF_11 :
+InitSymbolsPODF( InitSymbols::DESTROY);
+break;
+case FormulaLanguage::ENGLISH :
+InitSymbolsEnglish( InitSymbols::DESTROY);
+break;
+case FormulaLanguage::NATIVE :
+InitSymbolsNative( InitSymbols::DESTROY);
+break;
+case FormulaLanguage::XL_ENGLISH:
+InitSymbolsEnglishXL( InitSymbols::DESTROY);
+break;
+case FormulaLanguage::OOXML:
+InitSymbolsOOXML( InitSymbols::DESTROY);
+break;
+case FormulaLanguage::API :
+InitSymbolsAPI( InitSymbols::DESTROY);
+break;
+default:
+;   // nothing
+}
+}
+
+bool FormulaCompiler::HasOpCodeMap( const sal_Int32 nLanguage ) const
+{
+using namespace sheet;
+switch (nLanguage)
+{
+case FormulaLanguage::ODFF :
+return InitSymbolsODFF( InitSymbols::ASK);
+case FormulaLanguage::ODF_11 :
+return InitSymbolsPODF( InitSymbols::ASK);
+case FormulaLanguage::ENGLISH :
+return InitSymbolsEnglish( InitSymbols::ASK);
+case FormulaLanguage::NATIVE :
+return InitSymbolsNative( InitSymbols::ASK);
+case FormulaLanguage::XL_ENGLISH:
+return InitSymbolsEnglishXL( InitSymbols::ASK);
+case FormulaLanguage::OOXML:
+return InitSymbolsOOXML( InitSymbols::ASK);
+case FormulaLanguage::API :
+return InitSymbolsAPI( InitSymbols::ASK);
+default:
+;   // nothing
+}
+return false;
+}
+
 OUString FormulaCompiler::FindAddInFunction( const OUString& /*rUpperName*/, 
bool /*bLocalFirst*/ ) const
 {
 return OUString();
@@ -898,12 +954,16 @@ 

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

2022-06-23 Thread Noel Grandin (via logerrit)
 formula/source/core/api/token.cxx |9 +
 include/formula/token.hxx |   13 +++--
 2 files changed, 12 insertions(+), 10 deletions(-)

New commits:
commit 26fbf6eef19e2746c28d2f1584505d5e10a295cc
Author: Noel Grandin 
AuthorDate: Wed Jun 22 09:00:52 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Jun 23 09:58:23 2022 +0200

clang-tidy modernize-pass-by-value in formula

Change-Id: I275f96bb8b24838538ac88532508ad7dbd127eae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136271
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 9a22d9cd2205..04078302efa1 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace formula
 {
@@ -1933,8 +1934,8 @@ bool FormulaTypedDoubleToken::operator==( const 
FormulaToken& r ) const
 return FormulaDoubleToken::operator==( r ) && mnType == r.GetDoubleType();
 }
 
-FormulaStringToken::FormulaStringToken( const svl::SharedString& r ) :
-FormulaToken( svString ), maString( r )
+FormulaStringToken::FormulaStringToken( svl::SharedString r ) :
+FormulaToken( svString ), maString(std::move( r ))
 {
 }
 
@@ -1961,8 +1962,8 @@ bool FormulaStringToken::operator==( const FormulaToken& 
r ) const
 return FormulaToken::operator==( r ) && maString == r.GetString();
 }
 
-FormulaStringOpToken::FormulaStringOpToken( OpCode e, const svl::SharedString& 
r ) :
-FormulaByteToken( e, 0, svString, ParamClass::Unknown ), maString( r ) {}
+FormulaStringOpToken::FormulaStringOpToken( OpCode e, svl::SharedString r ) :
+FormulaByteToken( e, 0, svString, ParamClass::Unknown ), 
maString(std::move( r )) {}
 
 FormulaStringOpToken::FormulaStringOpToken( const FormulaStringOpToken& r ) :
 FormulaByteToken( r ), maString( r.maString ) {}
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index ebb08e6d7c17..f534b2c5c801 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -24,6 +24,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -336,7 +337,7 @@ class FORMULA_DLLPUBLIC FormulaStringToken final : public 
FormulaToken
 {
 svl::SharedString maString;
 public:
-FormulaStringToken( const svl::SharedString& r );
+FormulaStringToken( svl::SharedString r );
 FormulaStringToken( const FormulaStringToken& r );
 
 virtual FormulaToken* Clone() const override;
@@ -352,7 +353,7 @@ class FORMULA_DLLPUBLIC FormulaStringOpToken final : public 
FormulaByteToken
 {
 svl::SharedString maString;
 public:
-FormulaStringOpToken( OpCode e, const svl::SharedString& r );
+FormulaStringOpToken( OpCode e, svl::SharedString r );
 FormulaStringOpToken( const FormulaStringOpToken& r );
 
 virtual FormulaToken* Clone() const override;
@@ -386,12 +387,12 @@ class FORMULA_DLLPUBLIC FormulaExternalToken final : 
public FormulaByteToken
 private:
 OUStringaExternal;
 public:
-FormulaExternalToken( OpCode e, sal_uInt8 n, 
const OUString& r ) :
+FormulaExternalToken( OpCode e, sal_uInt8 n, 
OUString  r ) :
 FormulaByteToken( e, n, svExternal, 
ParamClass::Unknown ),
-aExternal( r ) {}
-FormulaExternalToken( OpCode e, const 
OUString& r ) :
+aExternal(std::move( r )) {}
+FormulaExternalToken( OpCode e, OUString  r ) :
 FormulaByteToken( e, 0, svExternal, 
ParamClass::Unknown ),
-aExternal( r ) {}
+aExternal(std::move( r )) {}
 FormulaExternalToken( const 
FormulaExternalToken& r ) :
 FormulaByteToken( r ), aExternal( 
r.aExternal ) {}
 


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

2022-06-18 Thread Eike Rathke (via logerrit)
 formula/source/core/api/FormulaCompiler.cxx |9 +++--
 include/formula/FormulaCompiler.hxx |3 ++-
 2 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 9aab475e221e1abee2108b21545f2bdaa48552e6
Author: Eike Rathke 
AuthorDate: Sat Jun 18 01:46:23 2022 +0200
Commit: Eike Rathke 
CommitDate: Sat Jun 18 13:49:59 2022 +0200

Related: tdf#142293 tdf#141495 Allow additional symbols in externals map

... to repair broken saved as Excel documents with saved Add-In
programmatic names, by adding them as upper-cased symbols. Previously,
adding such name was rejected if the Add-In already existed in the
reverse map. Now multiple one-way aliases are accepted. The upper-case
programmatic name was already attempted to be added for all Add-Ins of
the collection (for the non-UI case via
fillFromAddInCollectionUpperName()) but the pre-known Add-Ins are mapped
before so existed already and those names were rejected, as they
shouldn't be necessary. Except for broken documents..

Change-Id: I3cb6848779362de3446581528d2f6e6f19af9ec8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136072
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 4b6495826d48..1aa8d9f65855 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -451,9 +451,14 @@ void FormulaCompiler::OpCodeMap::putExternal( const 
OUString & rSymbol, const OU
 
 void FormulaCompiler::OpCodeMap::putExternalSoftly( const OUString & rSymbol, 
const OUString & rAddIn )
 {
-bool bOk = maReverseExternalHashMap.emplace(rAddIn, rSymbol).second;
+// Same as putExternal() but no warning, instead info whether inserted or 
not.
+bool bOk = maExternalHashMap.emplace(rSymbol, rAddIn).second;
+SAL_INFO( "formula.core", "OpCodeMap::putExternalSoftly: symbol " << (bOk 
? "" : "not ") << "inserted, " << rSymbol << " -> " << rAddIn);
 if (bOk)
-maExternalHashMap.emplace(rSymbol, rAddIn);
+{
+bOk = maReverseExternalHashMap.emplace(rAddIn, rSymbol).second;
+SAL_INFO_IF( !bOk, "formula.core", "OpCodeMap::putExternalSoftly: 
AddIn not inserted, " << rAddIn << " -> " << rSymbol);
+}
 }
 
 uno::Sequence< sheet::FormulaToken > 
FormulaCompiler::OpCodeMap::createSequenceOfFormulaTokens(
diff --git a/include/formula/FormulaCompiler.hxx 
b/include/formula/FormulaCompiler.hxx
index c455ca407d1d..5544ff8786c0 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -166,7 +166,8 @@ public:
 void putExternal( const OUString & rSymbol, const OUString & rAddIn );
 
 /** Put entry of symbol String and AddIn international String pair,
-failing silently if rAddIn name already exists. */
+not warning just info as used for AddIn collection and setting up
+alias names. */
 void putExternalSoftly( const OUString & rSymbol, const OUString & 
rAddIn );
 
 /// Core implementation of XFormulaOpCodeMapper::getMappings()


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

2022-06-01 Thread Eike Rathke (via logerrit)
 formula/source/core/api/token.cxx |7 +++
 include/formula/tokenarray.hxx|1 +
 sc/source/ui/inc/viewfunc.hxx |2 +-
 sc/source/ui/view/cellsh3.cxx |9 ++---
 sc/source/ui/view/viewfunc.cxx|   29 +++--
 5 files changed, 42 insertions(+), 6 deletions(-)

New commits:
commit dad1d7182eda5f0e155964d32ac03e5cd854eb96
Author: Eike Rathke 
AuthorDate: Wed Jun 1 20:52:32 2022 +0200
Commit: Eike Rathke 
CommitDate: Thu Jun 2 00:33:15 2022 +0200

Resolves: tdf#149378 Force array input if outer function returns 
array/matrix

So the result will actually display as full matrix, or in the cell
range marked prior to input, instead of just the top left element
in one cell, without having to close the input with
Shift+Ctrl+Enter to force array mode. The previous behaviour can
be forced by pre-selecting/marking one cell, which also worked
previously when closing as array input.

Change-Id: I81c079ce02e0c8d0536617ca6882fb470a352441
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135278
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index abda98f2f86d..87b0fb67ca98 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -512,6 +512,13 @@ FormulaToken* FormulaTokenArray::FirstRPNToken() const
 return pRPN[0];
 }
 
+FormulaToken* FormulaTokenArray::LastRPNToken() const
+{
+if (!pRPN || nRPN == 0)
+return nullptr;
+return pRPN[nRPN - 1];
+}
+
 bool FormulaTokenArray::HasReferences() const
 {
 for (auto i: Tokens())
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 6b373ff44e15..cbff6a3e469d 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -337,6 +337,7 @@ public:
 }
 
 FormulaToken* FirstRPNToken() const;
+FormulaToken* LastRPNToken() const;
 
 bool HasReferences() const;
 
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 8d012dd27050..0d8d7515441a 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -91,7 +91,7 @@ public:
 OUStringGetAutoSumFormula( const ScRangeList& rRangeList, bool 
bSubTotal, const ScAddress& rAddr, const OpCode eCode );
 
 voidEnterData( SCCOL nCol, SCROW nRow, SCTAB nTab, const 
OUString& rString,
-   const EditTextObject* pData = nullptr );
+   const EditTextObject* pData = nullptr, bool 
bMatrixExpand = false );
 voidEnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
const EditTextObject& rData, bool bTestSimple = 
false );
 voidEnterValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const 
double& rValue );
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 2734bc9b3027..a0d08a605058 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -289,7 +289,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
 pTabViewShell->EnterData( GetViewData().GetCurX(),
   GetViewData().GetCurY(),
   GetViewData().GetTabNo(),
-  aStr );
+  aStr, nullptr,
+  true /*bMatrixExpand*/);
 }
 else if (pHdl)
 {
@@ -357,7 +358,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
 }
 else if ( !aString.isEmpty() && ( aString[0] == '=' || 
aString[0] == '+' || aString[0] == '-' ) )
 {
-pTabViewShell->EnterData( aCursorPos.Col(), 
aCursorPos.Row(), aCursorPos.Tab(), aString, pData );
+pTabViewShell->EnterData( aCursorPos.Col(), 
aCursorPos.Row(), aCursorPos.Tab(),
+aString, pData, true /*bMatrixExpand*/);
 }
 else
 {
@@ -386,7 +388,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
 pTabViewShell->EnterData( aCursorPos.Col(),
 aCursorPos.Row(),
 aCursorPos.Tab(),
-aString );
+aString, nullptr,
+true /*bMatrixExpand*/);
 rReq.Done();
 }
 }
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 7f69f8b27b66..cd886c976c88 100644
--- 

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

2021-10-11 Thread Noel Grandin (via logerrit)
 formula/source/core/api/vectortoken.cxx |6 +++---
 include/formula/vectortoken.hxx |2 +-
 sc/source/core/data/grouptokenconverter.cxx |3 ++-
 3 files changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 6a3cb1545290d822455b7c3259702a1d1afc8ef9
Author: Noel Grandin 
AuthorDate: Sun Oct 10 20:36:27 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 11 12:19:03 2021 +0200

loplugin:moveparam in formula

Change-Id: I358f5e8031c235be76bb96591bf33f59a39b00ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123350
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/formula/source/core/api/vectortoken.cxx 
b/formula/source/core/api/vectortoken.cxx
index b4bc14370a7d..c1bd52157795 100644
--- a/formula/source/core/api/vectortoken.cxx
+++ b/formula/source/core/api/vectortoken.cxx
@@ -64,10 +64,10 @@ size_t SingleVectorRefToken::GetArrayLength() const
 }
 
 DoubleVectorRefToken::DoubleVectorRefToken(
-const std::vector& rArrays, size_t nArrayLength,
+std::vector&& rArrays, size_t nArrayLength,
 size_t nRefRowSize, bool bStartFixed, bool bEndFixed ) :
 FormulaToken(svDoubleVectorRef, ocPush),
-maArrays(rArrays), mnArrayLength(nArrayLength),
+maArrays(std::move(rArrays)), mnArrayLength(nArrayLength),
 mnRefRowSize(nRefRowSize), mbStartFixed(bStartFixed), mbEndFixed(bEndFixed)
 {
 SAL_INFO("formula.core", "Created DoubleVectorRefToken nArrayLength=" << 
nArrayLength);
@@ -76,7 +76,7 @@ DoubleVectorRefToken::DoubleVectorRefToken(
 FormulaToken* DoubleVectorRefToken::Clone() const
 {
 return new DoubleVectorRefToken(
-maArrays, mnArrayLength, mnRefRowSize, mbStartFixed, mbEndFixed);
+std::vector(maArrays), mnArrayLength, mnRefRowSize, mbStartFixed, 
mbEndFixed);
 }
 
 const std::vector& DoubleVectorRefToken::GetArrays() const
diff --git a/include/formula/vectortoken.hxx b/include/formula/vectortoken.hxx
index 26830bf6588c..046d71faf3ee 100644
--- a/include/formula/vectortoken.hxx
+++ b/include/formula/vectortoken.hxx
@@ -91,7 +91,7 @@ class FORMULA_DLLPUBLIC DoubleVectorRefToken final : public 
FormulaToken
 
 public:
 DoubleVectorRefToken(
-const std::vector& rArrays, size_t nArrayLength,
+std::vector&& rArrays, size_t nArrayLength,
 size_t nRefRowSize, bool bStartFixed, bool bEndFixed );
 
 virtual FormulaToken* Clone() const override;
diff --git a/sc/source/core/data/grouptokenconverter.cxx 
b/sc/source/core/data/grouptokenconverter.cxx
index 6b71284a9325..07fefbccbb55 100644
--- a/sc/source/core/data/grouptokenconverter.cxx
+++ b/sc/source/core/data/grouptokenconverter.cxx
@@ -257,7 +257,8 @@ bool ScGroupTokenConverter::convert( const ScTokenArray& 
rCode, sc::FormulaLogge
 aArrays.push_back(aArray);
 }
 
-formula::DoubleVectorRefToken aTok(aArrays, nArrayLength, 
nRefRowSize, bAbsFirst, bAbsLast);
+std::vector aArraysTmp = aArrays; 
+formula::DoubleVectorRefToken aTok( std::move(aArraysTmp), 
nArrayLength, nRefRowSize, bAbsFirst, bAbsLast );
 mrGroupTokens.AddToken(aTok);
 rScope.addRefMessage(mrPos, aAbs.aStart, nRequestedLength, 
aArrays);
 


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

2021-09-04 Thread Noel Grandin (via logerrit)
 formula/source/core/api/token.cxx   |   29 +++
 include/formula/tokenarray.hxx  |3 +
 sc/inc/tokenarray.hxx   |3 +
 sc/source/core/tool/token.cxx   |   69 
 sc/source/filter/excel/namebuff.cxx |8 ++--
 sc/source/filter/inc/namebuff.hxx   |5 +-
 6 files changed, 110 insertions(+), 7 deletions(-)

New commits:
commit 45b17d9d5bf98aefba392da6271c7077c1363238
Author: Noel Grandin 
AuthorDate: Sat Sep 4 09:02:15 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Sep 4 14:03:19 2021 +0200

store ScTokenArray by value in SharedFormulaBuffer

Change-Id: Ibff3c2fea3cadc234266953ab15ae5f25c4ac1e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121626
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index c5b69acf2c90..89ae03162778 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -598,6 +598,11 @@ FormulaTokenArray::FormulaTokenArray( const 
FormulaTokenArray& rArr )
 Assign( rArr );
 }
 
+FormulaTokenArray::FormulaTokenArray( FormulaTokenArray&& rArr )
+{
+Move( std::move(rArr) );
+}
+
 FormulaTokenArray::~FormulaTokenArray()
 {
 FormulaTokenArray::Clear();
@@ -646,6 +651,23 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r 
)
 }
 }
 
+void FormulaTokenArray::Move( FormulaTokenArray&& r )
+{
+pCode  = std::move(r.pCode);
+pRPN   = r.pRPN;
+r.pRPN = nullptr;
+nLen   = r.nLen;
+r.nLen = 0;
+nRPN   = r.nRPN;
+r.nRPN = 0;
+nError = r.nError;
+nMode  = r.nMode;
+bHyperLink = r.bHyperLink;
+mbFromRangeName = r.mbFromRangeName;
+mbShareable = r.mbShareable;
+mbFinalized = r.mbFinalized;
+}
+
 /// Optimisation for efficiently creating StringXML placeholders
 void FormulaTokenArray::Assign( sal_uInt16 nCode, FormulaToken **pTokens )
 {
@@ -675,6 +697,13 @@ FormulaTokenArray& FormulaTokenArray::operator=( const 
FormulaTokenArray& rArr )
 return *this;
 }
 
+FormulaTokenArray& FormulaTokenArray::operator=( FormulaTokenArray&& rArr )
+{
+Clear();
+Move( std::move(rArr) );
+return *this;
+}
+
 void FormulaTokenArray::Clear()
 {
 if( nRPN ) DelRPN();
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 87377cb228e0..6b373ff44e15 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -248,6 +248,7 @@ protected:
 protected:
 voidAssign( const FormulaTokenArray& );
 voidAssign( sal_uInt16 nCode, FormulaToken **pTokens );
+voidMove( FormulaTokenArray&& );
 
 /// Also used by the compiler. The token MUST had been allocated with new!
 FormulaToken*   Add( FormulaToken* );
@@ -289,6 +290,7 @@ public:
 /** Assignment with incrementing references of FormulaToken entries
 (not copied!) */
 FormulaTokenArray( const FormulaTokenArray& );
+FormulaTokenArray( FormulaTokenArray&& );
 virtual ~FormulaTokenArray();
 
 virtual void Clear();
@@ -485,6 +487,7 @@ public:
 /** Assignment with incrementing references of FormulaToken entries
 (not copied!) */
 FormulaTokenArray& operator=( const FormulaTokenArray& );
+FormulaTokenArray& operator=( FormulaTokenArray&& );
 
 /** Determines if this formula needs any changes to convert it to something
 previous versions of OOo could consume (Plain Old Formula, pre-ODFF, or
diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx
index 401ecb392239..0592521901b3 100644
--- a/sc/inc/tokenarray.hxx
+++ b/sc/inc/tokenarray.hxx
@@ -66,12 +66,14 @@ public:
 /** Assignment with incrementing references of FormulaToken entries
 (not copied!) */
 ScTokenArray( const ScTokenArray& ) = default;
+ScTokenArray( ScTokenArray&& ) = default;
 virtual ~ScTokenArray() override;
 
 bool EqualTokens( const ScTokenArray* pArr2 ) const;
 
 virtual void Clear() override;
 std::unique_ptr Clone() const;/// True copy!
+ScTokenArray CloneValue() const;/// True copy!
 
 void GenHash();
 size_t GetHash() const { return mnHashValue;}
@@ -130,6 +132,7 @@ public:
 /** Assignment with incrementing references of FormulaToken entries
 (not copied!) */
 ScTokenArray& operator=( const ScTokenArray& );
+ScTokenArray& operator=( ScTokenArray&& );
 
 /**
  * Make all absolute references external references pointing to the old 
document
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 6c4c80a8fb03..9fc32499731d 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1892,6 +1892,17 @@ ScTokenArray& ScTokenArray::operator=( const 
ScTokenArray& rArr )
 return *this;
 }
 
+ScTokenArray& ScTokenArray::operator=( ScTokenArray&& rArr )
+{
+mxSheetLimits = 

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

2021-07-28 Thread Eike Rathke (via logerrit)
 formula/source/core/api/FormulaCompiler.cxx|   29 +++-
 formula/source/core/api/token.cxx  |   39 +-
 formula/source/ui/dlg/formula.cxx  |8 -
 include/formula/compiler.hxx   |   41 +++---
 include/formula/opcode.hxx |2 
 include/formula/token.hxx  |   20 +++
 offapi/com/sun/star/sheet/FormulaMapGroupSpecialOffset.idl |   24 +++-
 sc/inc/compiler.hxx|   20 +++
 sc/source/core/tool/compiler.cxx   |   78 +
 sc/source/core/tool/parclass.cxx   |1 
 sc/source/core/tool/token.cxx  |   18 ++-
 sc/source/filter/excel/xeformula.cxx   |8 +
 sc/source/filter/excel/xlformula.cxx   |5 
 sc/source/ui/app/inputhdl.cxx  |2 
 sc/source/ui/unoobj/tokenuno.cxx   |   13 ++
 sc/source/ui/view/viewfunc.cxx |2 
 16 files changed, 240 insertions(+), 70 deletions(-)

New commits:
commit 516318113f0bd2b3c658aba9b285165e63a280e2
Author: Eike Rathke 
AuthorDate: Wed Jul 28 17:31:56 2021 +0200
Commit: Eike Rathke 
CommitDate: Wed Jul 28 18:56:29 2021 +0200

Resolves: tdf#76310 Preserve whitespace TAB, CR, LF in formula expressions

Allowed whitespace in ODFF and OOXML are
U+0020 SPACE
U+0009 CHARACTER TABULATION
U+000A LINE FEED
U+000D CARRIAGE RETURN

Line feed and carriage return look a bit funny in the Function Wizard if
part of a function's argument but work. Once a formula is edited, CR are
converted to LF though, probably already in EditEngine, didn't
investigate.

Change-Id: I6278f6be48872e0710a3d74212db391dda249ed2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119635
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index be5ce09d132f..f7174807f0f4 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -475,7 +475,8 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > 
FormulaCompiler::OpCodeMap::create
 { FormulaMapGroupSpecialOffset::DB_AREA   , ocDBArea } 
,
 /* TODO: { FormulaMapGroupSpecialOffset::TABLE_REF , 
ocTableRef }   , */
 { FormulaMapGroupSpecialOffset::MACRO , ocMacro }  
,
-{ FormulaMapGroupSpecialOffset::COL_ROW_NAME  , ocColRowName }
+{ FormulaMapGroupSpecialOffset::COL_ROW_NAME  , ocColRowName } 
,
+{ FormulaMapGroupSpecialOffset::WHITESPACE, ocWhitespace }
 };
 const size_t nCount = SAL_N_ELEMENTS(aMap);
 // Preallocate vector elements.
@@ -1267,14 +1268,18 @@ bool FormulaCompiler::GetToken()
  nWasColRowName = 1;
 else
  nWasColRowName = 0;
+OpCode eTmpOp;
 mpToken = maArrIterator.Next();
-while( mpToken && mpToken->GetOpCode() == ocSpaces )
+while (mpToken && ((eTmpOp = mpToken->GetOpCode()) == ocSpaces || 
eTmpOp == ocWhitespace))
 {
-// For significant whitespace remember last ocSpaces token. Usually
-// there's only one even for multiple spaces.
-pSpacesToken = mpToken;
-if ( nWasColRowName )
-nWasColRowName++;
+if (eTmpOp == ocSpaces)
+{
+// For significant whitespace remember last ocSpaces token.
+// Usually there's only one even for multiple spaces.
+pSpacesToken = mpToken;
+if ( nWasColRowName )
+nWasColRowName++;
+}
 if ( bAutoCorrect && !pStack )
 CreateStringFromToken( aCorrectedFormula, mpToken.get() );
 mpToken = maArrIterator.Next();
@@ -2272,10 +2277,10 @@ const FormulaToken* 
FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuf
 if( bSpaces )
 rBuffer.append( ' ');
 
-if( eOp == ocSpaces )
+if (eOp == ocSpaces || eOp == ocWhitespace)
 {
 bool bWriteSpaces = true;
-if (mxSymbols->isODFF())
+if (eOp == ocSpaces && mxSymbols->isODFF())
 {
 const FormulaToken* p = maArrIterator.PeekPrevNoSpaces();
 bool bIntersectionOp = (p && p->GetOpCode() == ocColRowName);
@@ -2316,7 +2321,10 @@ const FormulaToken* 
FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuf
 sal_uInt8 n = t->GetByte();
 for ( sal_uInt8 j=0; jGetChar());
+else
+rBuffer.append( ' ');
 }
 }
 }
@@ -2403,6 +2411,7 @@ const FormulaToken* 

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

2021-02-18 Thread Caolán McNamara (via logerrit)
 formula/source/ui/dlg/funcutl.cxx |   48 ++--
 include/formula/funcutl.hxx   |   13 +-
 vcl/unx/gtk3/gtk3gtkinst.cxx  |   73 --
 3 files changed, 70 insertions(+), 64 deletions(-)

New commits:
commit c56e0c791a79dc414108e1b2fbf0f7eb38657f10
Author: Caolán McNamara 
AuthorDate: Thu Feb 18 14:56:01 2021 +
Commit: Caolán McNamara 
CommitDate: Thu Feb 18 21:04:32 2021 +0100

move async focus-in/focus-out workaround to known client that needs it

and for the normal case process immediately. Use-case is the
bibliography editor, modified uncommitted entry, click in browser
column margin area to select a new row, the entry should commit its
old contents to the old row before filling from the new row

Change-Id: Ib41d96afcfa86bcd1075b9512d4cfab593afa66d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/52
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/formula/source/ui/dlg/funcutl.cxx 
b/formula/source/ui/dlg/funcutl.cxx
index f64b6aff9bd5..361ec4c9ebaa 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include "ControlHelper.hxx"
 #include "parawin.hxx"
 #include 
@@ -265,9 +266,11 @@ RefEdit::RefEdit(std::unique_ptr xControl)
 , aIdle("formula RefEdit Idle")
 , pAnyRefDlg(nullptr)
 , pLabelWidget(nullptr)
+, mpFocusInEvent(nullptr)
+, mpFocusOutEvent(nullptr)
 {
-xEntry->connect_focus_in(LINK(this, RefEdit, GetFocus));
-xEntry->connect_focus_out(LINK(this, RefEdit, LoseFocus));
+xEntry->connect_focus_in(LINK(this, RefEdit, GetFocusHdl));
+xEntry->connect_focus_out(LINK(this, RefEdit, LoseFocusHdl));
 xEntry->connect_key_press(LINK(this, RefEdit, KeyInputHdl));
 xEntry->connect_changed(LINK(this, RefEdit, Modify));
 aIdle.SetInvokeHandler( LINK( this, RefEdit, UpdateHdl ) );
@@ -275,6 +278,10 @@ RefEdit::RefEdit(std::unique_ptr xControl)
 
 RefEdit::~RefEdit()
 {
+if (mpFocusInEvent)
+Application::RemoveUserEvent(mpFocusInEvent);
+if (mpFocusOutEvent)
+Application::RemoveUserEvent(mpFocusOutEvent);
 aIdle.ClearInvokeHandler();
 aIdle.Stop();
 }
@@ -355,22 +362,53 @@ void RefEdit::GrabFocus()
 bool bHadFocus = xEntry->has_focus();
 xEntry->grab_focus();
 if (!bHadFocus && xEntry->has_focus())
-GetFocus(*xEntry);
+GetFocus();
 }
 
-IMPL_LINK_NOARG(RefEdit, GetFocus, weld::Widget&, void)
+void RefEdit::GetFocus()
 {
 maGetFocusHdl.Call(*this);
 StartUpdateData();
 }
 
-IMPL_LINK_NOARG(RefEdit, LoseFocus, weld::Widget&, void)
+void RefEdit::LoseFocus()
 {
 maLoseFocusHdl.Call(*this);
 if( pAnyRefDlg )
 pAnyRefDlg->HideReference();
 }
 
+IMPL_LINK_NOARG(RefEdit, GetFocusHdl, weld::Widget&, void)
+{
+// in e.g. function wizard RefEdits we want to select all when we get focus
+// but in the gtk case there are pending gtk handlers which change 
selection
+// after our handler, so post our focus in event to happen after those 
complete
+if (mpFocusInEvent)
+Application::RemoveUserEvent(mpFocusInEvent);
+mpFocusInEvent = Application::PostUserEvent(LINK(this, RefEdit, 
AsyncFocusInHdl));
+}
+
+IMPL_LINK_NOARG(RefEdit, LoseFocusHdl, weld::Widget&, void)
+{
+// tdf#127262 because focus in is async, focus out must not appear out
+// of sequence to focus in
+if (mpFocusOutEvent)
+Application::RemoveUserEvent(mpFocusOutEvent);
+mpFocusOutEvent = Application::PostUserEvent(LINK(this, RefEdit, 
AsyncFocusOutHdl));
+}
+
+IMPL_LINK_NOARG(RefEdit, AsyncFocusInHdl, void*, void)
+{
+mpFocusInEvent = nullptr;
+GetFocus();
+}
+
+IMPL_LINK_NOARG(RefEdit, AsyncFocusOutHdl, void*, void)
+{
+mpFocusOutEvent = nullptr;
+LoseFocus();
+}
+
 IMPL_LINK_NOARG(RefEdit, UpdateHdl, Timer *, void)
 {
 if( pAnyRefDlg )
diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx
index 915152466174..e94f29115068 100644
--- a/include/formula/funcutl.hxx
+++ b/include/formula/funcutl.hxx
@@ -27,6 +27,7 @@
 #include 
 
 class KeyEvent;
+struct ImplSVEvent;
 
 namespace formula {
 
@@ -41,6 +42,9 @@ private:
 Idle aIdle;
 IControlReferenceHandler* pAnyRefDlg; // parent dialog
 weld::Label* pLabelWidget;
+ImplSVEvent* mpFocusInEvent;
+ImplSVEvent* mpFocusOutEvent;
+
 Link maGetFocusHdl;
 Link maLoseFocusHdl;
 Link maModifyHdl;
@@ -49,10 +53,15 @@ private:
 DECL_LINK( UpdateHdl, Timer*, void );
 
 DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
-DECL_LINK(GetFocus, weld::Widget&, void);
-DECL_LINK(LoseFocus, weld::Widget&, void);
+DECL_LINK(GetFocusHdl, weld::Widget&, void);
+DECL_LINK(LoseFocusHdl, weld::Widget&, void);
+DECL_LINK(AsyncFocusInHdl, void*, void);
+DECL_LINK(AsyncFocusOutHdl, void*, void);
 DECL_LINK(Modify, weld::Entry&, void);
 
+  

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

2021-01-25 Thread Noel Grandin (via logerrit)
 formula/source/core/api/token.cxx |   12 +++-
 include/formula/token.hxx |8 
 include/svl/sharedstring.hxx  |2 +-
 sc/inc/formulacell.hxx|6 +++---
 sc/inc/formularesult.hxx  |2 +-
 sc/inc/token.hxx  |   12 ++--
 sc/source/core/data/formulacell.cxx   |6 +++---
 sc/source/core/inc/interpre.hxx   |2 +-
 sc/source/core/tool/formularesult.cxx |2 +-
 sc/source/core/tool/interpr4.cxx  |2 +-
 sc/source/core/tool/token.cxx |   12 ++--
 svl/source/misc/sharedstring.cxx  |   10 ++
 12 files changed, 40 insertions(+), 36 deletions(-)

New commits:
commit aa98ed61a7b1e50bcc4f64ceaea3bb0cda360bb4
Author: Noel Grandin 
AuthorDate: Mon Jan 25 14:43:05 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Jan 25 17:54:54 2021 +0100

tdf#92456 improve VLOOKUP perf

shave 5% of the time here - ref-counting triggered by copying
svl::SharedString is significant, so return by const&
instead of by value

Change-Id: Ic702632da45d75dddab33d6ce1e6f1097ff70de9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109900
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 37dd26979ced..6464f3d52b0f 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -209,10 +209,12 @@ void FormulaToken::SetDoubleType( sal_Int16 )
 assert( !"virtual dummy called" );
 }
 
-svl::SharedString FormulaToken::GetString() const
+const svl::SharedString INVALID_STRING;
+
+const svl::SharedString & FormulaToken::GetString() const
 {
 SAL_WARN( "formula.core", "FormulaToken::GetString: virtual dummy called" 
);
-return svl::SharedString(); // invalid string
+return INVALID_STRING; // invalid string
 }
 
 void FormulaToken::SetString( const svl::SharedString& )
@@ -1877,7 +1879,7 @@ FormulaToken* FormulaStringToken::Clone() const
 return new FormulaStringToken(*this);
 }
 
-svl::SharedString FormulaStringToken::GetString() const
+const svl::SharedString & FormulaStringToken::GetString() const
 {
 return maString;
 }
@@ -1903,7 +1905,7 @@ FormulaToken* FormulaStringOpToken::Clone() const
 return new FormulaStringOpToken(*this);
 }
 
-svl::SharedString FormulaStringOpToken::GetString() const
+const svl::SharedString & FormulaStringOpToken::GetString() const
 {
 return maString;
 }
@@ -1943,7 +1945,7 @@ bool FormulaErrorToken::operator==( const FormulaToken& r 
) const
 }
 double  FormulaMissingToken::GetDouble() const   { return 0.0; }
 
-svl::SharedString FormulaMissingToken::GetString() const
+const svl::SharedString & FormulaMissingToken::GetString() const
 {
 return svl::SharedString::getEmptyString();
 }
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index 4fc6b382d4cd..3fa00e89339f 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -181,7 +181,7 @@ public:
 virtual double& GetDoubleAsReference();
 virtual sal_Int16   GetDoubleType() const;
 virtual voidSetDoubleType( sal_Int16 nType );
-virtual svl::SharedString   GetString() const;
+virtual const svl::SharedString & GetString() const;
 virtual voidSetString( const svl::SharedString& rStr );
 virtual sal_uInt16  GetIndex() const;
 virtual voidSetIndex( sal_uInt16 n );
@@ -320,7 +320,7 @@ public:
 FormulaStringToken( const FormulaStringToken& r );
 
 virtual FormulaToken* Clone() const override;
-virtual svl::SharedString GetString() const override;
+virtual const svl::SharedString & GetString() const override;
 virtual void SetString( const svl::SharedString& rStr ) override;
 virtual bool operator==( const FormulaToken& rToken ) const override;
 };
@@ -336,7 +336,7 @@ public:
 FormulaStringOpToken( const FormulaStringOpToken& r );
 
 virtual FormulaToken* Clone() const override;
-virtual svl::SharedString GetString() const override;
+virtual const svl::SharedString & GetString() const override;
 virtual void SetString( const svl::SharedString& rStr ) override;
 virtual bool operator==( const FormulaToken& rToken ) const override;
 };
@@ -391,7 +391,7 @@ public:
 
 virtual FormulaToken*   Clone() const override { return new 
FormulaMissingToken(*this); }
 virtual double  GetDouble() const override;
-virtual svl::SharedString GetString() const override;
+virtual const svl::SharedString & GetString() const override;
 virtual booloperator==( const FormulaToken& rToken ) const 
override;
 };
 
diff --git a/include/svl/sharedstring.hxx b/include/svl/sharedstring.hxx
index 71aad67ba2c6..f74824adeec2 100644
--- a/include/svl/sharedstring.hxx
+++ b/include/svl/sharedstring.hxx
@@ -21,7 +21,7 @@ 

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

2021-01-14 Thread Dennis Francis (via logerrit)
 formula/source/core/api/FormulaCompiler.cxx |7 +
 include/formula/FormulaCompiler.hxx |2 
 sc/inc/compiler.hxx |2 
 sc/inc/refdata.hxx  |8 ++
 sc/qa/unit/ucalc.hxx|2 
 sc/qa/unit/ucalc_formula.cxx|  109 
 sc/source/core/tool/compiler.cxx|   98 +
 sc/source/core/tool/interpr5.cxx|   17 
 8 files changed, 245 insertions(+)

New commits:
commit b14107dd0eaf9bfc276544e1900873d36075425e
Author: Dennis Francis 
AuthorDate: Wed Jan 6 17:44:00 2021 +0530
Commit: Dennis Francis 
CommitDate: Thu Jan 14 10:47:19 2021 +0100

tdf#133858 reduce the double-ref range to data content

in certain matrix formulas like SUM(IF(A1=G:G, H:H)*B1/B2) where whole
columns are used for comparison in the condition of IF ultimately
followed by a reducer like SUM. In such cases we can safely reduce the
double-refs involved in the comparison to the sheet area where there is
data before converting the data to ScMatrix.

This is a more restricted version of Noel's fix in
37ffe509ef011357123642577c04ff296d59ce68

Change-Id: I1c2e8985adedb3f4c4648f541fb0e8e7d0fae033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109050
Reviewed-by: Luboš Luňák 
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 65167a9265acfea04733b5ff6ee3220a9da624f4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109118
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index bd1d1f082455..73669e84ff04 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1685,18 +1685,25 @@ void FormulaCompiler::Factor()
 HandleIIOpCode(pFacToken, pArgArray,
std::min(nSepCount, 
static_cast(FORMULA_MAXPARAMSII)));
 }
+bool bDone = false;
 if (bBadName)
 ;   // nothing, keep current token for return
 else if (eOp != ocClose)
 SetError( FormulaError::PairExpected);
 else
+{
 NextToken();
+bDone = true;
+}
 // Jumps are just normal functions for the FunctionAutoPilot tree 
view
 if (!mbJumpCommandReorder && pFacToken->GetType() == svJump)
 pFacToken = new FormulaFAPToken( pFacToken->GetOpCode(), 
nSepCount, pFacToken );
 else
 pFacToken->SetByte( nSepCount );
 PutCode( pFacToken );
+
+if (bDone)
+AnnotateOperands();
 }
 else if (IsOpCodeJumpCommand(eOp))
 {
diff --git a/include/formula/FormulaCompiler.hxx 
b/include/formula/FormulaCompiler.hxx
index 9fdd5a521087..c455ca407d1d 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -334,6 +334,8 @@ protected:
 // Called from CompileTokenArray() after RPN code generation is done.
 virtual void PostProcessCode() {}
 
+virtual void AnnotateOperands() {}
+
 OUStringaCorrectedFormula;  // autocorrected Formula
 OUStringaCorrectedSymbol;   // autocorrected Symbol
 
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 5299cf5774fe..b051f3ad4b4e 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -514,10 +514,12 @@ private:
 bool HandleIIOpCodeInternal(formula::FormulaToken* token, 
formula::FormulaToken*** pppToken, sal_uInt8 nNumParams);
 bool SkipImplicitIntersectionOptimization(const formula::FormulaToken* 
token) const;
 virtual void PostProcessCode() override;
+virtual void AnnotateOperands() override;
 static bool ParameterMayBeImplicitIntersection(const 
formula::FormulaToken* token, int parameter);
 void ReplaceDoubleRefII(formula::FormulaToken** ppDoubleRefTok);
 bool AdjustSumRangeShape(const ScComplexRefData& rBaseRange, 
ScComplexRefData& rSumRange);
 void CorrectSumRange(const ScComplexRefData& rBaseRange, ScComplexRefData& 
rSumRange, formula::FormulaToken** ppSumRangeToken);
+void AnnotateTrimOnDoubleRefs();
 };
 
 #endif
diff --git a/sc/inc/refdata.hxx b/sc/inc/refdata.hxx
index a2c9313b607e..9b57fe807536 100644
--- a/sc/inc/refdata.hxx
+++ b/sc/inc/refdata.hxx
@@ -124,6 +124,11 @@ struct ScComplexRefData
 {
 ScSingleRefData Ref1;
 ScSingleRefData Ref2;
+bool bTrimToData;
+
+ScComplexRefData() :
+bTrimToData(false)
+{}
 
 void InitFlags()
 { Ref1.InitFlags(); Ref2.InitFlags(); }
@@ -198,6 +203,9 @@ struct ScComplexRefData
 
 bool IsDeleted() const;
 
+bool IsTrimToData() const { return bTrimToData; }
+void SetTrimToData(bool bSet) { bTrimToData = bSet; }
+

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

2020-12-02 Thread Caolán McNamara (via logerrit)
 formula/source/ui/dlg/funcutl.cxx |8 
 include/formula/funcutl.hxx   |5 +
 2 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 0362d16527c2e33b9e0ab2d410b5f0a5b4cee91b
Author: Caolán McNamara 
AuthorDate: Tue Dec 1 15:52:31 2020 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 2 09:44:59 2020 +0100

tdf#138427 focus set to wrong input box

Change-Id: I4c1d3aa720f280f0ec1a3764d55f1d95ebd3180d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106999
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/formula/source/ui/dlg/funcutl.cxx 
b/formula/source/ui/dlg/funcutl.cxx
index 68d1ec3b4fc4..f64b6aff9bd5 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -350,6 +350,14 @@ bool RefEdit::KeyInput(const KeyEvent& rKEvt)
 return false;
 }
 
+void RefEdit::GrabFocus()
+{
+bool bHadFocus = xEntry->has_focus();
+xEntry->grab_focus();
+if (!bHadFocus && xEntry->has_focus())
+GetFocus(*xEntry);
+}
+
 IMPL_LINK_NOARG(RefEdit, GetFocus, weld::Widget&, void)
 {
 maGetFocusHdl.Call(*this);
diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx
index 5c729da03638..915152466174 100644
--- a/include/formula/funcutl.hxx
+++ b/include/formula/funcutl.hxx
@@ -84,10 +84,7 @@ public:
 Modify(*xEntry);
 }
 
-void GrabFocus()
-{
-xEntry->grab_focus();
-}
+void GrabFocus();
 
 void SelectAll()
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-10-13 Thread Eike Rathke (via logerrit)
 formula/source/core/api/token.cxx |5 +
 include/formula/token.hxx |   20 
 2 files changed, 9 insertions(+), 16 deletions(-)

New commits:
commit 5d9e33068e756b4e74aa2a5e8d9ed16dabe27f29
Author: Eike Rathke 
AuthorDate: Wed Oct 14 01:50:03 2020 +0200
Commit: Eike Rathke 
CommitDate: Wed Oct 14 03:52:15 2020 +0200

Derive FormulaExternalToken from FormulaByteToken, tdf#133260 follow-up

This should always have had a ParamClass member variable and
SetInForceArray()/GetInForceArray() functions but never did.

Now with

commit 3a33828b8de7554e497051738c722b1764960a86
CommitDate: Tue Oct 13 21:36:31 2020 +0200

Resolves: tdf#133260 Propagate ForceArrayReturn from inline arrays

it broke CppunitTest_sc_subsequent_filters_test with the virtual
dummy assert() in FormulaToken::SetInForceArray(). Unfortunately
not caught earlier but at least it did now.

Remove the duplicated FormulaToken overrides and simply derive
from FormulaByteToken instead that has all we need.

Change-Id: I7946602955970fb9d6f349efdacb41389e211b68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104262
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 68df38517f76..92f60254ec8f 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1929,12 +1929,9 @@ bool FormulaIndexToken::operator==( const FormulaToken& 
r ) const
 mnSheet == r.GetSheet();
 }
 const OUString& FormulaExternalToken::GetExternal() const   { return 
aExternal; }
-sal_uInt8   FormulaExternalToken::GetByte() const   { return 
nByte; }
-voidFormulaExternalToken::SetByte( sal_uInt8 n ){ nByte = n; }
 bool FormulaExternalToken::operator==( const FormulaToken& r ) const
 {
-return FormulaToken::operator==( r ) && nByte == r.GetByte() &&
-aExternal == r.GetExternal();
+return FormulaByteToken::operator==( r ) && aExternal == r.GetExternal();
 }
 
 
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index 02bffd6a0225..4fc6b382d4cd 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -361,26 +361,22 @@ public:
 };
 
 
-class FORMULA_DLLPUBLIC FormulaExternalToken final : public FormulaToken
+class FORMULA_DLLPUBLIC FormulaExternalToken final : public FormulaByteToken
 {
 private:
-OUString  aExternal;
-sal_uInt8   nByte;
+OUStringaExternal;
 public:
 FormulaExternalToken( OpCode e, sal_uInt8 n, 
const OUString& r ) :
-FormulaToken( svExternal, e ), aExternal( 
r ),
-nByte( n ) {}
+FormulaByteToken( e, n, svExternal, 
ParamClass::Unknown ),
+aExternal( r ) {}
 FormulaExternalToken( OpCode e, const 
OUString& r ) :
-FormulaToken(svExternal, e ), aExternal( r 
),
-nByte( 0 ) {}
+FormulaByteToken( e, 0, svExternal, 
ParamClass::Unknown ),
+aExternal( r ) {}
 FormulaExternalToken( const 
FormulaExternalToken& r ) :
-FormulaToken( r ), aExternal( r.aExternal 
),
-nByte( r.nByte ) {}
+FormulaByteToken( r ), aExternal( 
r.aExternal ) {}
 
 virtual FormulaToken*   Clone() const override { return new 
FormulaExternalToken(*this); }
-virtual const OUString&   GetExternal() const override;
-virtual sal_uInt8   GetByte() const override;
-virtual voidSetByte( sal_uInt8 n ) override;
+virtual const OUString& GetExternal() const override;
 virtual booloperator==( const FormulaToken& rToken ) const 
override;
 };
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-29 Thread Eike Rathke (via logerrit)
 formula/source/ui/dlg/FormulaHelper.cxx|1 
 formula/source/ui/dlg/parawin.cxx  |2 
 include/formula/IFunctionDescription.hxx   |1 
 reportdesign/source/ui/inc/FunctionHelper.hxx  |1 
 reportdesign/source/ui/misc/FunctionHelper.cxx |5 
 sc/inc/funcdesc.hxx|8 
 sc/source/core/data/funcdesc.cxx   |  803 -
 7 files changed, 426 insertions(+), 395 deletions(-)

New commits:
commit 92a87f9f128cf91f6af1fc7c61a85a10d659334d
Author: Eike Rathke 
AuthorDate: Fri May 29 15:45:12 2020 +0200
Commit: Eike Rathke 
CommitDate: Fri May 29 18:39:52 2020 +0200

Related: tdf#131423 CHOOSE() supports only 30 jump targets, limit in dialog

Change-Id: Ic3506ee6194ac4e74e572a10db96f100bc9e6ac2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95149
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/formula/source/ui/dlg/FormulaHelper.cxx 
b/formula/source/ui/dlg/FormulaHelper.cxx
index 5604c315b7f7..709a927e5040 100644
--- a/formula/source/ui/dlg/FormulaHelper.cxx
+++ b/formula/source/ui/dlg/FormulaHelper.cxx
@@ -48,6 +48,7 @@ namespace formula
 virtual bool isHidden() const override { return false; }
 virtual sal_uInt32 getParameterCount() const override { return 0; }
 virtual sal_uInt32 getVarArgsStart() const override { return 0; }
+virtual sal_uInt32 getVarArgsLimit() const override { return 0; }
 virtual OUString getParameterName(sal_uInt32 ) const override { 
return OUString(); }
 virtual OUString getParameterDescription(sal_uInt32 ) const 
override { return OUString(); }
 virtual bool isParameterOptional(sal_uInt32 ) const override { 
return false; }
diff --git a/formula/source/ui/dlg/parawin.cxx 
b/formula/source/ui/dlg/parawin.cxx
index 4a3b76838d7b..93b50777c20d 100644
--- a/formula/source/ui/dlg/parawin.cxx
+++ b/formula/source/ui/dlg/parawin.cxx
@@ -318,6 +318,8 @@ void ParaWin::SetFunctionDesc(const IFunctionDescription* 
pFDesc)
 }
 nArgs = pFuncDesc->getSuppressedArgumentCount();
 nMaxArgs = std::min( nArgs, kMaxArgCount);
+if (sal_uInt16 nVarArgsLimit = pFuncDesc->getVarArgsLimit())
+nMaxArgs = std::min( nVarArgsLimit, nMaxArgs);
 pFuncDesc->fillVisibleArgumentMapping(aVisibleArgMapping);
 m_xSlider->set_vpolicy(VclPolicyType::NEVER);
 m_xSlider->set_size_request(-1, -1);
diff --git a/include/formula/IFunctionDescription.hxx 
b/include/formula/IFunctionDescription.hxx
index 82fd50d9736c..b27907fedca5 100644
--- a/include/formula/IFunctionDescription.hxx
+++ b/include/formula/IFunctionDescription.hxx
@@ -101,6 +101,7 @@ namespace formula
 // parameter
 virtual sal_uInt32 getParameterCount() const = 0;
 virtual sal_uInt32 getVarArgsStart() const = 0;
+virtual sal_uInt32 getVarArgsLimit() const = 0;
 virtual OUString getParameterName(sal_uInt32 _nPos) const = 0;
 virtual OUString getParameterDescription(sal_uInt32 _nPos) const = 0;
 virtual bool isParameterOptional(sal_uInt32 _nPos) const = 0;
diff --git a/reportdesign/source/ui/inc/FunctionHelper.hxx 
b/reportdesign/source/ui/inc/FunctionHelper.hxx
index df18ed34cb36..8eea9632b65f 100644
--- a/reportdesign/source/ui/inc/FunctionHelper.hxx
+++ b/reportdesign/source/ui/inc/FunctionHelper.hxx
@@ -74,6 +74,7 @@ public:
 virtual bool isHidden() const override;
 virtual sal_uInt32 getParameterCount() const override ;
 virtual sal_uInt32 getVarArgsStart() const override;
+virtual sal_uInt32 getVarArgsLimit() const override;
 virtual OUString getParameterName(sal_uInt32 _nPos) const override ;
 virtual OUString getParameterDescription(sal_uInt32 _nPos) const override ;
 virtual bool isParameterOptional(sal_uInt32 _nPos) const override ;
diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx 
b/reportdesign/source/ui/misc/FunctionHelper.cxx
index 00043d4a94fd..c9cfbbd4ba72 100644
--- a/reportdesign/source/ui/misc/FunctionHelper.cxx
+++ b/reportdesign/source/ui/misc/FunctionHelper.cxx
@@ -235,6 +235,11 @@ sal_uInt32 FunctionDescription::getVarArgsStart() const
 return nLen ? nLen - 1 : 0;
 }
 
+sal_uInt32 FunctionDescription::getVarArgsLimit() const
+{
+return 0;
+}
+
 OUString FunctionDescription::getParameterName(sal_uInt32 _nPos) const
 {
 if ( _nPos < o3tl::make_unsigned(m_aParameter.getLength()) )
diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx
index fa7f7eab4a0e..b0dd1788c643 100644
--- a/sc/inc/funcdesc.hxx
+++ b/sc/inc/funcdesc.hxx
@@ -120,6 +120,13 @@ public:
 */
 virtual sal_uInt32 getVarArgsStart() const override ;
 
+/**
+  Returns maximum number of (variable) arguments
+
+  @return   maximum number of arguments, or 0 if there is no specific 
limit other than the general limit
+*/
+virtual sal_uInt32 getVarArgsLimit() const 

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

2020-04-23 Thread Julien Nabet (via logerrit)
 formula/source/ui/dlg/FormulaHelper.cxx |5 +
 formula/source/ui/dlg/formula.cxx   |9 +
 formula/source/ui/dlg/funcpage.cxx  |5 +
 formula/source/ui/dlg/funcpage.hxx  |1 +
 include/formula/formulahelper.hxx   |2 ++
 5 files changed, 18 insertions(+), 4 deletions(-)

New commits:
commit 2aab1c47df5648a3667c75efcdd1c1a4f08d6146
Author: Julien Nabet 
AuthorDate: Wed Apr 22 22:37:21 2020 +0200
Commit: Eike Rathke 
CommitDate: Thu Apr 23 16:40:38 2020 +0200

Related tdf#131169: avoid magic numbers

Change-Id: Ic82f214f22933e3c74b8b0fc4c6a25b19f103fa1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92735
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/formula/source/ui/dlg/FormulaHelper.cxx 
b/formula/source/ui/dlg/FormulaHelper.cxx
index b3c0b4a204bc..9dbc5d8f7b80 100644
--- a/formula/source/ui/dlg/FormulaHelper.cxx
+++ b/formula/source/ui/dlg/FormulaHelper.cxx
@@ -71,6 +71,11 @@ FormulaHelper::FormulaHelper(const IFunctionManager* 
_pFunctionManager)
 m_pCharClass = m_pSysLocale->GetCharClassPtr();
 }
 
+sal_Int32 FormulaHelper::GetCategoryCount() const
+{
+return m_pFunctionManager->getCount();
+}
+
 bool FormulaHelper::GetNextFunc( const OUString&  rFormula,
  bool bBack,
  sal_Int32&   rFStart,   // Input and 
output
diff --git a/formula/source/ui/dlg/formula.cxx 
b/formula/source/ui/dlg/formula.cxx
index 824df1bfe4c0..f43f95f7e0fb 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -819,10 +819,11 @@ void FormulaDlg_Impl::FillListboxes()
 if ( m_pFuncDesc && m_pFuncDesc->getCategory() )
 {
 // We'll never have more than int32 max categories so this is safe ...
-// m_xFuncPage->GetCategory() takes into account "Last Used" + "All" 
so 13 categories (0 -> 12)
-// whereas m_pFuncDesc->getCategory()->getNumber() doesn't take into 
account the 2 first (so only 0->10)
-if ( m_xFuncPage->GetCategory() != 
static_cast(m_pFuncDesc->getCategory()->getNumber() + 2) )
-m_xFuncPage->SetCategory(m_pFuncDesc->getCategory()->getNumber() + 
2);
+// Category listbox holds additional entries for Last Used and All, so
+// the offset should be two but hard coded numbers are ugly...
+const sal_Int32 nCategoryOffset = m_xFuncPage->GetCategoryEntryCount() 
- m_aFormulaHelper.GetCategoryCount();
+if ( m_xFuncPage->GetCategory() != 
static_cast(m_pFuncDesc->getCategory()->getNumber() + 
nCategoryOffset) )
+m_xFuncPage->SetCategory(m_pFuncDesc->getCategory()->getNumber() + 
nCategoryOffset);
 
 sal_Int32 nPos = m_xFuncPage->GetFuncPos(m_pFuncDesc);
 
diff --git a/formula/source/ui/dlg/funcpage.cxx 
b/formula/source/ui/dlg/funcpage.cxx
index 58279485d09b..56162a45a1d9 100644
--- a/formula/source/ui/dlg/funcpage.cxx
+++ b/formula/source/ui/dlg/funcpage.cxx
@@ -242,6 +242,11 @@ sal_Int32 FuncPage::GetCategory() const
 return m_xLbCategory->get_active();
 }
 
+sal_Int32 FuncPage::GetCategoryEntryCount() const
+{
+return m_xLbCategory->get_count();
+}
+
 sal_Int32 FuncPage::GetFunction() const
 {
 return m_xLbFunction->get_selected_index();
diff --git a/formula/source/ui/dlg/funcpage.hxx 
b/formula/source/ui/dlg/funcpage.hxx
index 95b9e1337b02..319ee7c8ad2c 100644
--- a/formula/source/ui/dlg/funcpage.hxx
+++ b/formula/source/ui/dlg/funcpage.hxx
@@ -68,6 +68,7 @@ public:
 voidSetFunction(sal_Int32  nFunc);
 voidSetFocus();
 sal_Int32   GetCategory() const;
+sal_Int32   GetCategoryEntryCount() const;
 sal_Int32   GetFunction() const;
 sal_Int32   GetFunctionEntryCount() const;
 
diff --git a/include/formula/formulahelper.hxx 
b/include/formula/formulahelper.hxx
index 8774bb332eb0..02f757dc3726 100644
--- a/include/formula/formulahelper.hxx
+++ b/include/formula/formulahelper.hxx
@@ -50,6 +50,8 @@ namespace formula
 
 const CharClass* GetCharClass() const { return m_pCharClass; }
 
+sal_Int32   GetCategoryCount() const;
+
 boolGetNextFunc( const OUString& rFormula,
bool  bBack,
sal_Int32&rFStart, // input 
and output
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-11-19 Thread Caolán McNamara (via logerrit)
 formula/source/ui/dlg/ControlHelper.hxx |2 +-
 formula/source/ui/dlg/funcutl.cxx   |   13 +
 include/formula/funcutl.hxx |6 --
 3 files changed, 14 insertions(+), 7 deletions(-)

New commits:
commit 7a73a586571a8242d9a49051adc62ef7c1c43e86
Author: Caolán McNamara 
AuthorDate: Tue Nov 19 11:38:40 2019 +
Commit: Eike Rathke 
CommitDate: Tue Nov 19 15:43:36 2019 +0100

up/down in ArgEdit doesn't do anything

but it should cycle through the arguments

Change-Id: Ifa398039e77d536a0df021b1a18e06d6df673980
Reviewed-on: https://gerrit.libreoffice.org/83192
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/formula/source/ui/dlg/ControlHelper.hxx 
b/formula/source/ui/dlg/ControlHelper.hxx
index 3fb82de8bac1..960935573acc 100644
--- a/formula/source/ui/dlg/ControlHelper.hxx
+++ b/formula/source/ui/dlg/ControlHelper.hxx
@@ -38,7 +38,7 @@ public:
  ParaWin& rParaWin, sal_uInt16 nArgCount);
 
 protected:
-DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
+virtual bool KeyInput(const KeyEvent& rKEvt);
 
 private:
 ArgEdit* pEdPrev;
diff --git a/formula/source/ui/dlg/funcutl.cxx 
b/formula/source/ui/dlg/funcutl.cxx
index 21ab45c0ee6b..491bab8c2769 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -55,7 +55,7 @@ void ArgEdit::Init(ArgEdit* pPrevEdit, ArgEdit* pNextEdit,
 }
 
 // Cursor control for Edit Fields in Argument Dialog
-IMPL_LINK(ArgEdit, KeyInputHdl, const KeyEvent&, rKEvt, bool)
+bool ArgEdit::KeyInput(const KeyEvent& rKEvt)
 {
 vcl::KeyCode aCode = rKEvt.GetKeyCode();
 bool bUp = (aCode.GetCode() == KEY_UP);
@@ -127,7 +127,7 @@ IMPL_LINK(ArgEdit, KeyInputHdl, const KeyEvent&, rKEvt, 
bool)
 }
 return true;
 }
-return false;
+return RefEdit::KeyInput(rKEvt);
 }
 
 // class ArgInput
@@ -272,7 +272,7 @@ RefEdit::RefEdit(std::unique_ptr xControl)
 {
 xEntry->connect_focus_in(LINK(this, RefEdit, GetFocus));
 xEntry->connect_focus_out(LINK(this, RefEdit, LoseFocus));
-xEntry->connect_key_press(LINK(this, RefEdit, KeyInput));
+xEntry->connect_key_press(LINK(this, RefEdit, KeyInputHdl));
 xEntry->connect_changed(LINK(this, RefEdit, Modify));
 aIdle.SetInvokeHandler( LINK( this, RefEdit, UpdateHdl ) );
 }
@@ -330,7 +330,12 @@ IMPL_LINK_NOARG(RefEdit, Modify, weld::Entry&, void)
 pAnyRefDlg->HideReference();
 }
 
-IMPL_LINK(RefEdit, KeyInput, const KeyEvent&, rKEvt, bool)
+IMPL_LINK(RefEdit, KeyInputHdl, const KeyEvent&, rKEvt, bool)
+{
+return KeyInput(rKEvt);
+}
+
+bool RefEdit::KeyInput(const KeyEvent& rKEvt)
 {
 const vcl::KeyCode& rKeyCode = rKEvt.GetKeyCode();
 if (pAnyRefDlg && !rKeyCode.GetModifier() && rKeyCode.GetCode() == KEY_F2)
diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx
index 5e4a037c607e..02cf585a771e 100644
--- a/include/formula/funcutl.hxx
+++ b/include/formula/funcutl.hxx
@@ -49,15 +49,17 @@ private:
 DECL_LINK( UpdateHdl, Timer*, void );
 
 protected:
-DECL_LINK(KeyInput, const KeyEvent&, bool);
+DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
 DECL_LINK(GetFocus, weld::Widget&, void);
 DECL_LINK(LoseFocus, weld::Widget&, void);
 DECL_LINK(Modify, weld::Entry&, void);
 
+virtual bool KeyInput(const KeyEvent& rKEvt);
+
 public:
 RefEdit(std::unique_ptr xControl);
 weld::Entry* GetWidget() const { return xEntry.get(); }
-~RefEdit();
+virtual ~RefEdit();
 
 void SetRefString( const OUString& rStr );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-17 Thread Dennis Francis (via logerrit)
 formula/source/core/api/token.cxx   |6 +
 include/formula/tokenarray.hxx  |4 +++
 sc/inc/interpretercontext.hxx   |3 ++
 sc/source/core/data/formulacell.cxx |   19 +-
 sc/source/core/inc/interpre.hxx |9 ++--
 sc/source/core/tool/interpr1.cxx|8 +++
 sc/source/core/tool/interpr2.cxx|2 -
 sc/source/core/tool/interpr4.cxx|   37 ++--
 sc/source/core/tool/interpr7.cxx|2 -
 9 files changed, 75 insertions(+), 15 deletions(-)

New commits:
commit 4ee424b3ddc6e483cac8bd76ddc0bcabe48241dc
Author: Dennis Francis 
AuthorDate: Tue Oct 15 06:57:56 2019 +0530
Commit: Dennis Francis 
CommitDate: Thu Oct 17 08:06:49 2019 +0200

Pre-allocate an ScInterpreter object for each thread...

and reuse them for interpret'ing all cells under the
respective threads. This gives a sizeable win in the execution
time especially for long formula-groups.

Change-Id: Ib340950f21e863b5b821d20c092214d8bc5012aa
Reviewed-on: https://gerrit.libreoffice.org/80845
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index bb08d4447e0d..17594207234f 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1634,6 +1634,12 @@ void FormulaTokenIterator::Jump( short nStart, short 
nNext, short nStop )
 }
 }
 
+void FormulaTokenIterator::ReInit( const FormulaTokenArray& rArr )
+{
+maStack.clear();
+Push(  );
+}
+
 const FormulaToken* FormulaTokenIterator::GetNonEndOfPathToken( short nIdx ) 
const
 {
 FormulaTokenIterator::Item cur = maStack.back();
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 635e5c1f3907..44122686c158 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -563,6 +563,10 @@ public:
 void Push( const FormulaTokenArray* );
 void Pop();
 
+/** Reconstruct the iterator afresh from a token array
+*/
+void ReInit( const FormulaTokenArray& );
+
 private:
 const FormulaToken* GetNonEndOfPathToken( short nIdx ) const;
 };
diff --git a/sc/inc/interpretercontext.hxx b/sc/inc/interpretercontext.hxx
index c7598fef8cdc..b46a23f4e6a0 100644
--- a/sc/inc/interpretercontext.hxx
+++ b/sc/inc/interpretercontext.hxx
@@ -24,6 +24,7 @@ class FormulaToken;
 class ScDocument;
 class SvNumberFormatter;
 struct ScLookupCacheMap;
+class ScInterpreter;
 
 // SetNumberFormat() is not thread-safe, so calls to it need to be delayed to 
the main thread.
 struct DelayedSetNumberFormat
@@ -45,12 +46,14 @@ struct ScInterpreterContext
 // Allocation cache for "aConditions" array in 
ScInterpreter::IterateParameterIfs()
 // This is populated/used only when formula-group threading is enabled.
 std::vector maConditions;
+ScInterpreter* pInterpreter;
 
 ScInterpreterContext(const ScDocument& rDoc, SvNumberFormatter* pFormatter)
 : mpDoc()
 , mnTokenCachePos(0)
 , maTokens(TOKEN_CACHE_SIZE, nullptr)
 , mScLookupCache(nullptr)
+, pInterpreter(nullptr)
 , mpFormatter(pFormatter)
 {
 }
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 572353c01bf7..d3dfbd18ea1a 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1886,7 +1886,19 @@ void ScFormulaCell::InterpretTail( ScInterpreterContext& 
rContext, ScInterpretTa
 
 if( pCode->GetCodeLen() && pDocument )
 {
-std::unique_ptr pInterpreter(new ScInterpreter( this, 
pDocument, rContext, aPos, *pCode ));
+std::unique_ptr pScopedInterpreter;
+ScInterpreter* pInterpreter;
+if (rContext.pInterpreter)
+{
+pInterpreter = rContext.pInterpreter;
+pInterpreter->Init(this, aPos, *pCode);
+}
+else
+{
+pScopedInterpreter.reset(new ScInterpreter( this, pDocument, 
rContext, aPos, *pCode ));
+pInterpreter = pScopedInterpreter.get();
+}
+
 FormulaError nOldErrCode = aResult.GetResultError();
 if ( nSeenInIteration == 0 )
 {   // Only the first time
@@ -4841,10 +4853,14 @@ bool 
ScFormulaCell::InterpretFormulaGroupThreading(sc::FormulaLogger::GroupScope
 std::shared_ptr aTag = 
comphelper::ThreadPool::createThreadTaskTag();
 ScThreadedInterpreterContextGetterGuard 
aContextGetterGuard(nThreadCount, *pDocument, pNonThreadedFormatter);
 ScInterpreterContext* context = nullptr;
+std::vector> 
aInterpreters(nThreadCount);
 
 for (int i = 0; i < nThreadCount; ++i)
 {
 context = 
aContextGetterGuard.GetInterpreterContextForThreadIdx(i);
+assert(!context->pInterpreter);
+aInterpreters[i].reset(new ScInterpreter(this, pDocument, 
*context, 

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

2019-05-11 Thread Caolán McNamara (via logerrit)
 formula/source/ui/dlg/ControlHelper.hxx|   10 
 formula/source/ui/dlg/formula.cxx  |   55 -
 formula/source/ui/dlg/funcutl.cxx  |  244 --
 formula/source/ui/dlg/parawin.cxx  |   12 
 formula/source/ui/dlg/parawin.hxx  |   12 
 include/formula/IControlReferenceHandler.hxx   |4 
 include/formula/formula.hxx|   10 
 include/formula/funcutl.hxx|  105 --
 reportdesign/source/ui/dlg/Formula.cxx |   15 
 reportdesign/source/ui/inc/Formula.hxx |4 
 sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx |   14 
 sc/source/ui/StatisticsDialogs/SamplingDialog.cxx  |   24 
 sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx |   24 
 sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx |   28 
 sc/source/ui/condformat/condformatdlg.cxx  |   10 
 sc/source/ui/condformat/condformatdlgentry.cxx |8 
 sc/source/ui/dbgui/PivotLayoutDialog.cxx   |   22 
 sc/source/ui/dbgui/consdlg.cxx |   16 
 sc/source/ui/dbgui/dbnamdlg.cxx|   10 
 sc/source/ui/dbgui/filtdlg.cxx |4 
 sc/source/ui/dbgui/foptmgr.cxx |6 
 sc/source/ui/dbgui/sfiltdlg.cxx|   18 
 sc/source/ui/dbgui/validate.cxx|   16 
 sc/source/ui/formdlg/formula.cxx   |   21 
 sc/source/ui/inc/IAnyRefDialog.hxx |1 
 sc/source/ui/inc/PivotLayoutDialog.hxx |   20 
 sc/source/ui/inc/RandomNumberGeneratorDialog.hxx   |   14 
 sc/source/ui/inc/SamplingDialog.hxx|   20 
 sc/source/ui/inc/StatisticsInputOutputDialog.hxx   |   20 
 sc/source/ui/inc/StatisticsTwoVariableDialog.hxx   |   24 
 sc/source/ui/inc/anyrefdg.hxx  |  131 ---
 sc/source/ui/inc/areasdlg.hxx  |   20 
 sc/source/ui/inc/condformatdlg.hxx |   10 
 sc/source/ui/inc/condformatdlgentry.hxx|8 
 sc/source/ui/inc/consdlg.hxx   |   16 
 sc/source/ui/inc/crnrdlg.hxx   |   22 
 sc/source/ui/inc/dbnamdlg.hxx  |6 
 sc/source/ui/inc/filtdlg.hxx   |   20 
 sc/source/ui/inc/foptmgr.hxx   |   14 
 sc/source/ui/inc/formula.hxx   |3 
 sc/source/ui/inc/highred.hxx   |4 
 sc/source/ui/inc/namedefdlg.hxx|6 
 sc/source/ui/inc/namedlg.hxx   |8 
 sc/source/ui/inc/optsolver.hxx |   50 -
 sc/source/ui/inc/simpref.hxx   |4 
 sc/source/ui/inc/solvrdlg.hxx  |   18 
 sc/source/ui/inc/tabopdlg.hxx  |   22 
 sc/source/ui/inc/validate.hxx  |   29 
 sc/source/ui/inc/xmlsourcedlg.hxx  |8 
 sc/source/ui/miscdlgs/anyrefdg.cxx |  374 
--
 sc/source/ui/miscdlgs/crnrdlg.cxx  |   24 
 sc/source/ui/miscdlgs/highred.cxx  |4 
 sc/source/ui/miscdlgs/optsolver.cxx|   60 -
 sc/source/ui/miscdlgs/simpref.cxx  |4 
 sc/source/ui/miscdlgs/solvrdlg.cxx |   20 
 sc/source/ui/miscdlgs/tabopdlg.cxx |   26 
 sc/source/ui/namedlg/namedefdlg.cxx|6 
 sc/source/ui/namedlg/namedlg.cxx   |8 
 sc/source/ui/pagedlg/areasdlg.cxx  |   22 
 sc/source/ui/xmlsource/xmlsourcedlg.cxx|8 
 60 files changed, 494 insertions(+), 1252 deletions(-)

New commits:
commit d56ee7339f1a2ca73167791a5b39b6da38b401d5
Author: Caolán McNamara 
AuthorDate: Wed May 8 11:14:52 2019 +0100
Commit: Caolán McNamara 
CommitDate: Sat May 11 20:31:04 2019 +0200

remove unused RefEdit/RefButton

and rename WeldRefEdit/WeldRefButton back

Change-Id: I3aab8585d4ba1017cc755bf21e827522e7ee6980
Reviewed-on: https://gerrit.libreoffice.org/71957
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/formula/source/ui/dlg/ControlHelper.hxx 
b/formula/source/ui/dlg/ControlHelper.hxx

[Libreoffice-commits] core.git: formula/source include/formula include/IwyuFilter_include.yaml sd/qa

2019-05-06 Thread Gabor Kelemen (via logerrit)
 formula/source/core/api/FormulaOpCodeMapperObj.cxx |1 +
 include/IwyuFilter_include.yaml|   13 +
 include/formula/FormulaCompiler.hxx|2 --
 include/formula/FormulaOpCodeMapperObj.hxx |3 ---
 include/formula/IFunctionDescription.hxx   |3 ++-
 include/formula/formula.hxx|1 -
 include/formula/funcutl.hxx|4 
 include/formula/token.hxx  |1 -
 include/formula/tokenarray.hxx |4 +++-
 include/formula/vectortoken.hxx|2 +-
 sd/qa/unit/dialogs-test.cxx|1 -
 11 files changed, 20 insertions(+), 15 deletions(-)

New commits:
commit 779a48f70ea8f7843ed3145c7efd522027e9183f
Author: Gabor Kelemen 
AuthorDate: Wed Apr 10 22:04:15 2019 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 6 12:18:13 2019 +0200

tdf#42949 Fix IWYU warnings in include/formula/

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

Change-Id: I564e3dd53e7718326fc1e8b98c9ae3367381703c
Reviewed-on: https://gerrit.libreoffice.org/70550
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/formula/source/core/api/FormulaOpCodeMapperObj.cxx 
b/formula/source/core/api/FormulaOpCodeMapperObj.cxx
index 73f085813d22..57ba594e13e8 100644
--- a/formula/source/core/api/FormulaOpCodeMapperObj.cxx
+++ b/formula/source/core/api/FormulaOpCodeMapperObj.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace formula
 {
diff --git a/include/IwyuFilter_include.yaml b/include/IwyuFilter_include.yaml
index 5ec1ba2b23de..04631f47ea27 100644
--- a/include/IwyuFilter_include.yaml
+++ b/include/IwyuFilter_include.yaml
@@ -920,6 +920,19 @@ blacklist:
 - com/sun/star/awt/FontDescriptor.hpp
 - com/sun/star/style/LineSpacing.hpp
 - com/sun/star/style/TabStop.hpp
+include/formula/FormulaOpCodeMapperObj.hxx:
+# base class has to be a complete type
+- com/sun/star/lang/XServiceInfo.hpp
+- com/sun/star/sheet/XFormulaOpCodeMapper.hpp
+include/formula/paramclass.hxx:
+# Needed for enum type
+- sal/types.h
+include/formula/opcode.hxx:
+# Needed for enum type
+- sal/types.h
+include/formula/tokenarray.hxx:
+# Needed to avoid linking errors on WIN
+- formula/ExternalReferenceHelper.hxx
 include/svx/AccessibleControlShape.hxx:
 # base class has to be a complete type
 - com/sun/star/beans/XPropertyChangeListener.hpp
diff --git a/include/formula/FormulaCompiler.hxx 
b/include/formula/FormulaCompiler.hxx
index fef6e82e39e1..a2c6f6f3d9c0 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -28,13 +28,11 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/include/formula/FormulaOpCodeMapperObj.hxx 
b/include/formula/FormulaOpCodeMapperObj.hxx
index af74100d2165..8804e2488d94 100644
--- a/include/formula/FormulaOpCodeMapperObj.hxx
+++ b/include/formula/FormulaOpCodeMapperObj.hxx
@@ -20,13 +20,10 @@
 #ifndef INCLUDED_FORMULA_FORMULAOPCODEMAPPEROBJ_HXX
 #define INCLUDED_FORMULA_FORMULAOPCODEMAPPEROBJ_HXX
 
-#include 
 #include 
 
-#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/include/formula/IFunctionDescription.hxx 
b/include/formula/IFunctionDescription.hxx
index 3d03d4e6c069..5d4616b9b9e5 100644
--- a/include/formula/IFunctionDescription.hxx
+++ b/include/formula/IFunctionDescription.hxx
@@ -25,7 +25,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -36,6 +35,8 @@ namespace com { namespace sun { namespace star {
 namespace sheet { class XFormulaParser; }
 } } }
 
+namespace com::sun::star::uno { template  class Sequence; }
+
 namespace formula
 {
 class IFunctionCategory;
diff --git a/include/formula/formula.hxx b/include/formula/formula.hxx
index defd1ecfd1a8..873ab04866d7 100644
--- a/include/formula/formula.hxx
+++ b/include/formula/formula.hxx
@@ -33,7 +33,6 @@
 #include 
 #include 
 
-class Idle;
 class NotifyEvent;
 class SfxBindings;
 class SfxChildWindow;
diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx
index 51e1b9dbae09..7ab1252e7c97 100644
--- a/include/formula/funcutl.hxx
+++ b/include/formula/funcutl.hxx
@@ -33,10 +33,6 @@
 
 class KeyEvent;
 
-namespace vcl {
-class Window;
-}
-
 namespace formula {
 
 class IControlReferenceHandler;
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index 26643fc08fcd..034b3aa78b6f 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -27,7 +27,6 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 9f93aa63a9b1..df82ceb1cb22 100644
--- 

[Libreoffice-commits] core.git: formula/source include/formula include/sfx2 include/vcl reportdesign/source sc/inc sc/source sc/uiconfig solenv/sanitizers vcl/source vcl/unx

2019-04-10 Thread Caolán McNamara (via logerrit)
 formula/source/ui/dlg/formula.cxx  |   21 
 formula/source/ui/dlg/funcutl.cxx  |  180 ++
 include/formula/IControlReferenceHandler.hxx   |4 
 include/formula/formula.hxx|4 
 include/formula/funcutl.hxx|  102 +++
 include/sfx2/basedlgs.hxx  |3 
 include/vcl/weld.hxx   |5 
 reportdesign/source/ui/dlg/Formula.cxx |9 
 reportdesign/source/ui/inc/Formula.hxx |2 
 sc/inc/scmod.hxx   |5 
 sc/source/ui/StatisticsDialogs/CorrelationDialog.cxx   |   10 
 sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx   |   71 ++
 sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx |  277 
++
 sc/source/ui/app/scmod.cxx |  112 +++-
 sc/source/ui/formdlg/formula.cxx   |   16 
 sc/source/ui/inc/ChildWindowWrapper.hxx|   61 ++
 sc/source/ui/inc/CorrelationDialog.hxx |6 
 sc/source/ui/inc/IAnyRefDialog.hxx |1 
 sc/source/ui/inc/MatrixComparisonGenerator.hxx |   18 
 sc/source/ui/inc/StatisticsInputOutputDialog.hxx   |   72 ++
 sc/source/ui/inc/anyrefdg.hxx  |   88 +++
 sc/source/ui/inc/formula.hxx   |3 
 sc/source/ui/inc/reffact.hxx   |2 
 sc/source/ui/inc/tabvwsh.hxx   |4 
 sc/source/ui/inc/validate.hxx  |5 
 sc/source/ui/miscdlgs/anyrefdg.cxx |  235 ++--
 sc/source/ui/view/tabvwshc.cxx |   45 +
 sc/uiconfig/scalc/ui/correlationdialog.ui  |   19 
 solenv/sanitizers/ui/modules/scalc.suppr   |2 
 vcl/source/app/salvtables.cxx  |   94 +++
 vcl/unx/gtk3/gtk3gtkinst.cxx   |  109 +++
 31 files changed, 1498 insertions(+), 87 deletions(-)

New commits:
commit 3d648f76ac90fe8e28691313d0d4e78a8278e511
Author: Caolán McNamara 
AuthorDate: Tue Apr 9 11:23:48 2019 +0100
Commit: Caolán McNamara 
CommitDate: Wed Apr 10 21:23:21 2019 +0200

weld ScCorrelationDialog

this is first of the calc dialogs with a range selector, so some temp
scaffolding is required during interim case of both welded/unwelded
in existence

Change-Id: I5480179092da7b56864cef066af781b35f735ebc
Reviewed-on: https://gerrit.libreoffice.org/70474
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/formula/source/ui/dlg/formula.cxx 
b/formula/source/ui/dlg/formula.cxx
index 68120f6bbd51..e7c5fede138d 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -77,6 +77,8 @@ class FormulaDlg_Impl
 public:
 ::std::pair
 RefInputStartBefore( RefEdit* pEdit, RefButton* pButton );
+static ::std::pair
+RefInputStartBefore( WeldRefEdit* pEdit, WeldRefButton* pButton );
 voidRefInputStartAfter();
 voidRefInputDoneAfter( bool bForced );
 boolCalcValue( const OUString& rStrExp, OUString& rStrResult, 
bool bForceMatrixFormula = false );
@@ -1522,6 +1524,15 @@ void FormulaDlg_Impl::UpdateSelection()
 return aPair;
 }
 
+::std::pair 
FormulaDlg_Impl::RefInputStartBefore( WeldRefEdit* pEdit, WeldRefButton* 
pButton )
+{
+assert(!pEdit && !pButton);
+::std::pair aPair;
+aPair.first = pButton;
+aPair.second = pEdit;
+return aPair;
+}
+
 void FormulaDlg_Impl::RefInputStartAfter()
 {
 m_pRefBtn->SetEndImage();
@@ -1779,6 +1790,11 @@ void FormulaModalDialog::Update()
 return m_pImpl->RefInputStartBefore( pEdit, pButton );
 }
 
+::std::pair 
FormulaModalDialog::RefInputStartBefore( WeldRefEdit* pEdit, WeldRefButton* 
pButton )
+{
+return formula::FormulaDlg_Impl::RefInputStartBefore(pEdit, pButton);
+}
+
 void FormulaModalDialog::RefInputStartAfter()
 {
 m_pImpl->RefInputStartAfter();
@@ -1868,6 +1884,11 @@ void FormulaDlg::DoEnter()
 return m_pImpl->RefInputStartBefore( pEdit, pButton );
 }
 
+::std::pair FormulaDlg::RefInputStartBefore( 
WeldRefEdit* pEdit, WeldRefButton* pButton )
+{
+return formula::FormulaDlg_Impl::RefInputStartBefore(pEdit, pButton);
+}
+
 void FormulaDlg::RefInputStartAfter()
 {
 m_pImpl->RefInputStartAfter();
diff --git a/formula/source/ui/dlg/funcutl.cxx 
b/formula/source/ui/dlg/funcutl.cxx
index 942b6b7e..47c3d408d63e 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -517,6 +517,112 @@ 

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

2019-01-16 Thread Libreoffice Gerrit user
 formula/source/core/api/FormulaCompiler.cxx |7 +++
 formula/source/core/api/token.cxx   |2 +-
 formula/source/ui/dlg/formula.cxx   |1 +
 include/formula/paramclass.hxx  |7 ++-
 sc/source/core/tool/parclass.cxx|2 +-
 5 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit d0ded163d8e93dc5b10d7a7c9bdab1d0a6a50bac
Author: Eike Rathke 
AuthorDate: Tue Jan 15 19:59:53 2019 +0100
Commit: Eike Rathke 
CommitDate: Wed Jan 16 11:17:14 2019 +0100

Related: tdf#122301 FREQUENCY() with ForceArrayReturn on caller

FREQUENCY() forces its direct caller into array mode, but only for
the immediate subexpression and not for further operators of the
same parameter.

This weird Excel behaviour is stated in

ECMA-376-1:2016 OOXML 18.17.7.127 FREQUENCY
"A call to FREQUENCY shall be an array formula."

somewhat unclear what it actually applies to, but it turned out
that "a call" is indeed *only* THE direct call, see
https://bugs.documentfoundation.org/show_bug.cgi?id=122301#c19

Change-Id: I145d8fe26d75d5af25b987e190bf35f2d2c03ec6
Reviewed-on: https://gerrit.libreoffice.org/66407
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index da1769d13b17..f243aab357f7 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -2746,6 +2746,13 @@ void FormulaCompiler::ForceArrayOperator( 
FormulaTokenRef const & rCurr )
 else
 rCurr->SetInForceArray( 
formula::ParamClass::SuppressedReferenceOrForceArray);
 }
+
+// Propagate a ForceArrayReturn to caller if the called function
+// returns one and the caller so far does not have a stronger array
+// mode set.
+if (pCurrentFactorToken->GetInForceArray() == ParamClass::Unknown
+&& GetForceArrayParameter( rCurr.get(), SAL_MAX_UINT16) == 
ParamClass::ForceArrayReturn)
+pCurrentFactorToken->SetInForceArray( 
ParamClass::ForceArrayReturn);
 }
 }
 
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index aa3dbec8c8ef..a80897c280fb 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -151,7 +151,7 @@ bool FormulaToken::IsInForceArray() const
 {
 ParamClass eParam = GetInForceArray();
 return eParam == ParamClass::ForceArray || eParam == 
ParamClass::ReferenceOrForceArray
-|| eParam == ParamClass::ReferenceOrRefArray;
+|| eParam == ParamClass::ReferenceOrRefArray || eParam == 
ParamClass::ForceArrayReturn;
 }
 
 bool FormulaToken::operator==( const FormulaToken& rToken ) const
diff --git a/formula/source/ui/dlg/formula.cxx 
b/formula/source/ui/dlg/formula.cxx
index adfe4e210f2d..d1052c3a4142 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -757,6 +757,7 @@ void FormulaDlg_Impl::MakeTree( StructPage* _pTree, 
SvTreeListEntry* pParent, co
 case ParamClass::ForceArray:
 case ParamClass::ReferenceOrForceArray:
 case ParamClass::SuppressedReferenceOrForceArray:
+case ParamClass::ForceArrayReturn:
 ;   // nothing, only as array/matrix
 // no default to get compiler warning
 }
diff --git a/include/formula/paramclass.hxx b/include/formula/paramclass.hxx
index a1e564819457..30773c35e016 100644
--- a/include/formula/paramclass.hxx
+++ b/include/formula/paramclass.hxx
@@ -67,7 +67,12 @@ namespace formula
 Reference in JumpMatrix context should use the result matrix
 instead of the array of references. Never used as initial parameter
 classification. */
-SuppressedReferenceOrForceArray
+SuppressedReferenceOrForceArray,
+
+/** A function return forces the caller into array mode for this one
+call, making it behave like it had ForceArray but not propagated to
+any further operators in the same parameter. */
+ForceArrayReturn
 };
 }
 
diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index 4d1672bbd079..ce6c9094cc71 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -146,7 +146,7 @@ const ScParameterClassification::RawData 
ScParameterClassification::pRawData[] =
 { ocForecast_ETS_STA, {{ ForceArray, ForceArray, ForceArray, Value, Value, 
Value}, 0, Value }},
 { ocForecast_ETS_STM, {{ ForceArray, ForceArray, ForceArray, Value, Value, 
Value}, 0, Value }},
 { ocFormula, {{ Reference  
  }, 0, Value }},
-{ ocFrequency,   {{ 

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

2018-11-09 Thread Libreoffice Gerrit user
 formula/source/core/api/FormulaCompiler.cxx |   33 
 formula/source/core/api/token.cxx   |3 +
 formula/source/ui/dlg/formula.cxx   |1 
 include/formula/paramclass.hxx  |8 
 sc/source/core/tool/compiler.cxx|3 +
 sc/source/core/tool/interpr1.cxx|6 ++-
 sc/source/core/tool/interpr4.cxx|2 +
 sc/source/core/tool/parclass.cxx|   56 
 8 files changed, 76 insertions(+), 36 deletions(-)

New commits:
commit 6ce84da750abcec3139bf12bc212fb2f03460add
Author: Eike Rathke 
AuthorDate: Fri Nov 9 12:39:40 2018 +0100
Commit: Eike Rathke 
CommitDate: Fri Nov 9 19:14:09 2018 +0100

Resolves: tdf#120895 new ParamClass::ReferenceOrRefArray, tdf#58874 related

Too many side conditions are possible with implicit array of
references in array mode. Propagate new ReferenceOrRefArray
parameter class to indicate the preferred return type for
arguments to functions whose parameters explicitly handle array of
references.

Change-Id: I1f01266495c2ef1941ffe0cb7c2e0a5ae0bb7e69
Reviewed-on: https://gerrit.libreoffice.org/63201
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index b0938aa630be..ccf4562fec9d 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -2693,6 +2693,13 @@ formula::ParamClass 
FormulaCompiler::GetForceArrayParameter( const FormulaToken*
 
 void FormulaCompiler::ForceArrayOperator( FormulaTokenRef const & rCurr )
 {
+if (rCurr->GetInForceArray() != ParamClass::Unknown)
+// Already set, unnecessary to evaluate again. This happens by calls to
+// CurrentFactor::operator=() while descending through Factor() and
+// then ascending back (and down and up, ...),
+// CheckSetForceArrayParameter() and later PutCode().
+return;
+
 if (!pCurrentFactorToken || (pCurrentFactorToken.get() == rCurr.get()))
 return;
 
@@ -2700,27 +2707,37 @@ void FormulaCompiler::ForceArrayOperator( 
FormulaTokenRef const & rCurr )
 return;
 
 // Inherited parameter class.
-formula::ParamClass eType = pCurrentFactorToken->GetInForceArray();
-if (eType == formula::ParamClass::ForceArray)
-{
-rCurr->SetInForceArray( eType);
+const formula::ParamClass eForceType = 
pCurrentFactorToken->GetInForceArray();
+if (eForceType == ParamClass::ForceArray || eForceType == 
ParamClass::ReferenceOrRefArray)
+{
+// ReferenceOrRefArray was set only if in ForceArray context already,
+// it is valid for the one function only to indicate the preferred
+// return type. Propagate as ForceArray if not another parameter
+// handling ReferenceOrRefArray.
+if (nCurrentFactorParam > 0
+&& (GetForceArrayParameter( pCurrentFactorToken.get(), 
static_cast(nCurrentFactorParam - 1))
+== ParamClass::ReferenceOrRefArray))
+rCurr->SetInForceArray( ParamClass::ReferenceOrRefArray);
+else
+rCurr->SetInForceArray( ParamClass::ForceArray);
 return;
 }
-else if (eType == formula::ParamClass::ReferenceOrForceArray)
+else if (eForceType == ParamClass::ReferenceOrForceArray)
 {
 // Inherit further only if the return class of the nested function is
 // not Reference. Else flag as suppressed.
 if (GetForceArrayParameter( rCurr.get(), SAL_MAX_UINT16) != 
ParamClass::Reference)
-rCurr->SetInForceArray( eType);
+rCurr->SetInForceArray( eForceType);
 else
-rCurr->SetInForceArray( 
formula::ParamClass::SuppressedReferenceOrForceArray);
+rCurr->SetInForceArray( 
ParamClass::SuppressedReferenceOrForceArray);
 return;
 }
 
 if (nCurrentFactorParam > 0)
 {
 // Actual current parameter's class.
-eType = GetForceArrayParameter( pCurrentFactorToken.get(), 
static_cast(nCurrentFactorParam - 1));
+const formula::ParamClass eType = GetForceArrayParameter(
+pCurrentFactorToken.get(), 
static_cast(nCurrentFactorParam - 1));
 if (eType == ParamClass::ForceArray)
 rCurr->SetInForceArray( eType);
 else if (eType == ParamClass::ReferenceOrForceArray)
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index cefab324fd53..aa3dbec8c8ef 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -150,7 +150,8 @@ bool FormulaToken::IsRef() const
 bool FormulaToken::IsInForceArray() const
 {
 ParamClass eParam = GetInForceArray();
-return eParam == ParamClass::ForceArray || eParam == 
ParamClass::ReferenceOrForceArray;
+return eParam == ParamClass::ForceArray || eParam == 

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

2018-10-10 Thread Libreoffice Gerrit user
 formula/source/core/api/token.cxx   |   15 ++-
 include/formula/tokenarray.hxx  |5 +
 sc/source/core/data/formulacell.cxx |5 -
 3 files changed, 23 insertions(+), 2 deletions(-)

New commits:
commit 16e417b8c211a919a921baeb65660185aac38393
Author: Luboš Luňák 
AuthorDate: Tue Sep 18 15:01:29 2018 +0200
Commit: Luboš Luňák 
CommitDate: Wed Oct 10 12:59:39 2018 +0200

add ScTokenArray::Finalize() to explicitly reduce memory usage

Since ScTokenArray::Add() overallocates memory, make sure we do not
keep such possibly large arrays. Since any copying of ScTokenArray
implicitly finalizes as well, this is not a big problem right now,
but then why needlessly do the copies? (next commit)

Change-Id: I55398bcd8fb31f1be5a4b8e3f5a71b26649a7594
Reviewed-on: https://gerrit.libreoffice.org/60862
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index aa3e576a9323..cefab324fd53 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -579,6 +579,18 @@ FormulaTokenArray::~FormulaTokenArray()
 Clear();
 }
 
+void FormulaTokenArray::Finalize()
+{
+if( nLen && !mbFinalized )
+{
+// Add() overallocates, so reallocate to the minimum needed size.
+std::unique_ptr newCode(new FormulaToken*[ nLen ]);
+std::copy([0], [nLen], newCode.get());
+pCode = std::move( newCode );
+mbFinalized = true;
+}
+}
+
 void FormulaTokenArray::Assign( const FormulaTokenArray& r )
 {
 nLen   = r.nLen;
@@ -779,7 +791,8 @@ FormulaToken* FormulaTokenArray::Add( FormulaToken* t )
 // Allocating an array of size FORMULA_MAXTOKENS is simple, but that results 
in relatively large
 // allocations that malloc() implementations usually do not handle as 
efficiently as smaller
 // sizes (not only in terms of memory usage but also speed). Since most token 
arrays are going
-// to be small, start with a small array and resize only if needed.
+// to be small, start with a small array and resize only if needed. Eventually 
Finalize() will
+// reallocate the memory to size exactly matching the requirements.
 const size_t MAX_FAST_TOKENS = 32;
 if( !pCode )
 pCode.reset(new FormulaToken*[ MAX_FAST_TOKENS ]);
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 2c422d94faf8..2891601b2626 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -291,6 +291,11 @@ public:
 
 virtual void Clear();
 
+/**
+ * The array has its final used size and no more token can be added.
+ */
+void Finalize();
+
 void SetFromRangeName( bool b ) { mbFromRangeName = b; }
 bool IsFromRangeName() const { return mbFromRangeName; }
 
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 1684c0023759..84d0ba952cda 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -548,6 +548,7 @@ void ScFormulaCellGroup::setCode( ScTokenArray* pCode )
 {
 delete mpCode;
 mpCode = pCode; // takes ownership of the token array.
+mpCode->Finalize(); // Reduce memory usage if needed.
 mbInvariant = mpCode->IsInvariant();
 mpCode->GenHash();
 }
@@ -699,6 +700,8 @@ ScFormulaCell::ScFormulaCell(
 {
 assert(pArray); // Never pass a NULL pointer here.
 
+pCode->Finalize(); // Reduce memory usage if needed.
+
 // Generate RPN token array.
 if (pCode->GetLen() && pCode->GetCodeError() == FormulaError::NONE && 
!pCode->GetCodeLen())
 {
@@ -722,7 +725,7 @@ ScFormulaCell::ScFormulaCell(
 ScDocument* pDoc, const ScAddress& rPos, const ScTokenArray& rArray,
 const FormulaGrammar::Grammar eGrammar, ScMatrixMode cMatInd ) :
 eTempGrammar( eGrammar),
-pCode(new ScTokenArray(rArray)),
+pCode(new ScTokenArray(rArray)), // also implicitly does Finalize() on the 
array
 pDocument( pDoc ),
 pPrevious(nullptr),
 pNext(nullptr),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-09-28 Thread Libreoffice Gerrit user
 formula/source/core/api/FormulaCompiler.cxx |3 +--
 include/formula/compiler.hxx|4 ++--
 include/formula/opcode.hxx  |4 
 3 files changed, 3 insertions(+), 8 deletions(-)

New commits:
commit 14729a8aadd41f4acd47046c2ed5b58a99c473c2
Author: Eike Rathke 
AuthorDate: Fri Sep 28 11:00:27 2018 +0200
Commit: Eike Rathke 
CommitDate: Fri Sep 28 15:20:34 2018 +0200

Remove unused ocIndirectXL and ocAddressXL

Separated implementation is gone since long.

Change-Id: I78279f631c9205202af92ad8e248f9a1226b7a19
Reviewed-on: https://gerrit.libreoffice.org/61075
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index c2a9466ebbb7..59b36b2d3914 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -988,11 +988,10 @@ bool FormulaCompiler::IsOpCodeVolatile( OpCode eOp )
 case ocFormula:
 case ocInfo:
 // more than one parameters:
-// ocIndirect/ocIndirectXL otherwise would have to do
+// ocIndirect otherwise would have to do
 // StopListening and StartListening on a reference for every
 // interpreted value.
 case ocIndirect:
-case ocIndirectXL:
 // ocOffset results in indirect references.
 case ocOffset:
 // ocDebugVar shows internal value that may change as the internal 
state changes.
diff --git a/include/formula/compiler.hxx b/include/formula/compiler.hxx
index 61b054c0d7cc..0d5b1cc8f632 100644
--- a/include/formula/compiler.hxx
+++ b/include/formula/compiler.hxx
@@ -396,8 +396,8 @@
 #define SC_OPCODE_CELL  385
 #define SC_OPCODE_ISPMT 386
 #define SC_OPCODE_HYPERLINK 387
-#define SC_OPCODE_INDIRECT_XL   388 /* See also INDIRECT for OOO 
variant */
-#define SC_OPCODE_ADDRESS_XL389 /* See also ADDRESS for OOO 
variant */
+// free: 388
+// free: 389
 #define SC_OPCODE_GET_PIVOT_DATA390
 #define SC_OPCODE_EUROCONVERT   391
 #define SC_OPCODE_NUMBERVALUE   392
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index acc52552c00d..437403d919b2 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -303,9 +303,7 @@ enum OpCode : sal_uInt16
 ocDBVarP= SC_OPCODE_DB_VAR_P,
 // Management functions
 ocIndirect  = SC_OPCODE_INDIRECT,
-ocIndirectXL= SC_OPCODE_INDIRECT_XL,
 ocAddress   = SC_OPCODE_ADDRESS,
-ocAddressXL = SC_OPCODE_ADDRESS_XL,
 ocMatch = SC_OPCODE_MATCH,
 ocCountEmptyCells   = SC_OPCODE_COUNT_EMPTY_CELLS,
 ocCountIf   = SC_OPCODE_COUNT_IF,
@@ -782,9 +780,7 @@ inline std::string OpCodeEnumToString(OpCode eCode)
 case ocDBVar: return "DBVar";
 case ocDBVarP: return "DBVarP";
 case ocIndirect: return "Indirect";
-case ocIndirectXL: return "IndirectXL";
 case ocAddress: return "Address";
-case ocAddressXL: return "AddressXL";
 case ocMatch: return "Match";
 case ocCountEmptyCells: return "CountEmptyCells";
 case ocCountIf: return "CountIf";
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: formula/source include/formula include/tools reportdesign/inc sc/inc sc/source solenv/clang-format sw/inc sw/source tools/Library_tl.mk tools/source

2018-08-16 Thread Libreoffice Gerrit user
 formula/source/core/api/token.cxx  |   11 ---
 include/formula/token.hxx  |9 --
 include/tools/mempool.hxx  |   93 -
 reportdesign/inc/pch/precompiled_rptui.hxx |1 
 sc/inc/chgtrack.hxx|8 --
 sc/inc/compiler.hxx|2 
 sc/inc/formulacell.hxx |2 
 sc/inc/token.hxx   |5 -
 sc/source/core/data/formulacell.cxx|2 
 sc/source/core/inc/interpre.hxx|3 
 sc/source/core/tool/chgtrack.cxx   |8 --
 sc/source/core/tool/interpr1.cxx   |3 
 sc/source/core/tool/token.cxx  |8 --
 sc/source/filter/excel/xestyle.cxx |4 -
 sc/source/filter/excel/xetable.cxx |   12 ---
 sc/source/filter/excel/xistyle.cxx |2 
 sc/source/filter/inc/xestyle.hxx   |1 
 sc/source/filter/inc/xetable.hxx   |   13 
 sc/source/filter/inc/xistyle.hxx   |3 
 solenv/clang-format/blacklist  |2 
 sw/inc/frmfmt.hxx  |4 -
 sw/inc/ndhints.hxx |3 
 sw/inc/ndtxt.hxx   |2 
 sw/inc/node.hxx|5 -
 sw/inc/pam.hxx |3 
 sw/inc/pch/precompiled_msword.hxx  |1 
 sw/inc/pch/precompiled_swui.hxx|1 
 sw/inc/pch/precompiled_vbaswobj.hxx|1 
 sw/inc/swatrset.hxx|4 -
 sw/inc/swcrsr.hxx  |2 
 sw/inc/swtable.hxx |3 
 sw/inc/swtblfmt.hxx|9 --
 sw/inc/unocrsr.hxx |2 
 sw/inc/viscrs.hxx  |2 
 sw/source/core/bastyp/swtypes.cxx  |   28 
 sw/source/core/inc/UndoDelete.hxx  |3 
 sw/source/core/inc/UndoInsert.hxx  |3 
 sw/source/core/inc/bodyfrm.hxx |3 
 sw/source/core/inc/cellfrm.hxx |2 
 sw/source/core/inc/colfrm.hxx  |3 
 sw/source/core/inc/fntcache.hxx|3 
 sw/source/core/inc/frmtool.hxx |2 
 sw/source/core/inc/hffrm.hxx   |5 -
 sw/source/core/inc/pagefrm.hxx |3 
 sw/source/core/inc/rowfrm.hxx  |4 -
 sw/source/core/inc/sectfrm.hxx |3 
 sw/source/core/inc/swfntcch.hxx|4 -
 sw/source/core/inc/tabfrm.hxx  |3 
 sw/source/core/inc/txtfrm.hxx  |4 -
 sw/source/core/layout/atrfrm.cxx   |   13 
 sw/source/core/text/porlay.hxx |4 -
 sw/source/core/text/portxt.hxx |6 -
 sw/source/core/text/txtcache.hxx   |3 
 sw/source/core/text/txtinit.cxx|6 -
 sw/source/core/unocore/unocrsr.cxx |2 
 tools/Library_tl.mk|1 
 tools/source/memtools/mempool.cxx  |   52 
 57 files changed, 1 insertion(+), 393 deletions(-)

New commits:
commit 346ba4bedaaa5fa6a7b76687b749959814685846
Author: Noel Grandin 
AuthorDate: Fri Aug 3 19:01:38 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 16 15:02:27 2018 +0200

remove mempool

we've been using the normal memory allocator instead of the sal slab
allocator ever since
commit bc6a5d8e79e7d0e7d75ac107aa8e6aa275e434e9
Date:   Wed Nov 15 16:52:44 2017 +0530
Disable custom allocator

Change-Id: I3383962cedb85d56fbec695398901f6ff7057651
Reviewed-on: https://gerrit.libreoffice.org/58577
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index aa98a4e56bdb..d66204590e67 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -40,17 +40,6 @@ namespace formula
 {
 using namespace com::sun::star;
 
-// Align MemPools on 4k boundaries - 64 bytes (4k is a MUST for OS/2)
-
-// Need a lot of FormulaDoubleToken
-IMPL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaDoubleToken )
-// Need quite some FormulaTypedDoubleToken
-IMPL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaTypedDoubleToken )
-// Need a lot of FormulaByteToken
-IMPL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaByteToken )
-// Need several FormulaStringToken
-IMPL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaStringToken )
-
 
 // --- helpers --
 
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index 6d2851e4edfe..bd33935cbf26 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -35,7 +35,6 @@
 #include 
 #include 
 #include 
-#include 
 
 class ScJumpMatrix;
 class ScMatrix;
@@ -258,8 +257,6 @@ public:
 virtual ParamClass  GetInForceArray() const override;
 virtual voidSetInForceArray( ParamClass c ) override;
 virtual bool 

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

2018-07-31 Thread Libreoffice Gerrit user
 formula/source/core/api/FormulaCompiler.cxx |   64 +-
 include/formula/FormulaCompiler.hxx |9 -
 sc/inc/compiler.hxx |   28 
 sc/source/core/data/formulacell.cxx |   22 +++
 sc/source/core/data/grouptokenconverter.cxx |   17 --
 sc/source/core/tool/compiler.cxx|  167 
 sc/source/core/tool/token.cxx   |3 
 7 files changed, 213 insertions(+), 97 deletions(-)

New commits:
commit 1bf7bc6f9929ceae0ea059b64ae0efa12228525f
Author: Luboš Luňák 
AuthorDate: Tue Jul 24 15:28:49 2018 +0200
Commit: Luboš Luňák 
CommitDate: Tue Jul 31 16:01:40 2018 +0200

try to detect that a formula does not contain any implicit intersection

Commit 67444cbe disabled svDoubleRef completely for OpenCL, which means
many formulas weren't handled by OpenCL even if the implicit intersection
problems are quite rare. This patch tries to detect formulas implicit
intersections in formulas and if it's certain that a formula does not
contain one, then it's ok to use OpenCL with svDoubleRef.

The detection is done by having ScCompiler analyze each opcode call
and its parameters, which should provide sufficient information to know
if implicit intersection can take place or not. The extra compilation
can be avoided by using OpenCL's compilation and doing the svDoubleRef
conversion later on the RPN code, to be done later.

This is opt-in, so if unsure don't do anything, if it turns out that some
opcode needs special handling, it can be simply added.

Change-Id: Iaa52fa7eb8b14dc8c2b92384a21e2ab8efe0ddd7
Reviewed-on: https://gerrit.libreoffice.org/57959
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index c22f9edbdbe1..3329db657812 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1349,6 +1349,10 @@ bool FormulaCompiler::GetToken()
 return HandleDbData();
 case ocTableRef:
 return HandleTableRef();
+case ocPush:
+if( mbComputeII )
+HandleIIOpCode(mpToken.get(), nullptr, 0);
+break;
 default:
 ;   // nothing
 }
@@ -1556,7 +1560,6 @@ void FormulaCompiler::Factor()
 else
 {
 // standard handling of 1-parameter opcodes
-OpCode eMyLastOp = eOp;
 pFacToken = mpToken;
 eOp = NextToken();
 if( nNumFmt == SvNumFormatType::UNDEFINED && eOp == ocNot )
@@ -1574,10 +1577,10 @@ void FormulaCompiler::Factor()
 else if ( pArr->GetCodeError() == FormulaError::NONE )
 {
 pFacToken->SetByte( 1 );
-if (mbComputeII && IsIIOpCode(eMyLastOp))
+if (mbComputeII)
 {
 FormulaToken** pArg = pCode - 1;
-HandleIIOpCode(eMyLastOp, 
pFacToken->GetInForceArray(), , 1);
+HandleIIOpCode(pFacToken, , 1);
 }
 }
 PutCode( pFacToken );
@@ -1621,7 +1624,7 @@ void FormulaCompiler::Factor()
 sal_uInt32 nSepCount = 0;
 if( !bNoParam )
 {
-bool bDoIICompute = mbComputeII && IsIIOpCode(eMyLastOp);
+bool bDoIICompute = mbComputeII;
 // Array of FormulaToken double pointers to collect the 
parameters of II opcodes.
 FormulaToken*** pArgArray = nullptr;
 if (bDoIICompute)
@@ -1648,7 +1651,7 @@ void FormulaCompiler::Factor()
 pArgArray[nSepCount - 1] = pCode - 1; // Add rest of 
the arguments
 }
 if (bDoIICompute)
-HandleIIOpCode(eMyLastOp, pFacToken->GetInForceArray(), 
pArgArray,
+HandleIIOpCode(pFacToken, pArgArray,
std::min(nSepCount, 
static_cast(FORMULA_MAXPARAMSII)));
 }
 if (bBadName)
@@ -1873,10 +1876,10 @@ void FormulaCompiler::UnaryLine()
 FormulaTokenRef p = mpToken;
 NextToken();
 UnaryLine();
-if (mbComputeII && IsIIOpCode(p->GetOpCode()))
+if (mbComputeII)
 {
 FormulaToken** pArg = pCode - 1;
-HandleIIOpCode(p->GetOpCode(), p->GetInForceArray(), , 1);
+HandleIIOpCode(p.get(), , 1);
 }
 PutCode( p );
 }
@@ -1889,10 +1892,10 @@ void FormulaCompiler::PostOpLine()
 UnaryLine();
 while ( mpToken->GetOpCode() == ocPercentSign )
 {   // this operator _follows_ its operand
-if (mbComputeII && IsIIOpCode(mpToken->GetOpCode()))
+if (mbComputeII)
 {

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

2018-07-18 Thread Libreoffice Gerrit user
 formula/source/core/api/FormulaCompiler.cxx |2 +-
 formula/source/core/api/token.cxx   |2 +-
 formula/source/ui/dlg/structpg.cxx  |   19 ++-
 formula/source/ui/dlg/structpg.hxx  |   10 +-
 include/formula/IFunctionDescription.hxx|   10 --
 include/formula/token.hxx   |   14 ++
 6 files changed, 19 insertions(+), 38 deletions(-)

New commits:
commit 346b900594a84581056ba56061ea513f4e6f101d
Author: Noel Grandin 
AuthorDate: Mon Jul 16 10:05:03 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Jul 18 08:37:57 2018 +0200

loplugin:mergeclasses merge IFormulaToken into FormulaToken

Change-Id: I5dbf870ff27f1039e24f4350787cf5bfc5f4ccaf
Reviewed-on: https://gerrit.libreoffice.org/57487
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index ac42bd3df588..5d4c3e76ec5b 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -2193,7 +2193,7 @@ const FormulaToken* 
FormulaCompiler::CreateStringFromToken( OUStringBuffer& rBuf
 // shall separate a function-name from the left parenthesis (()
 // that follows it." and Excel even chokes on it.
 const FormulaToken* p = maArrIterator.PeekPrevNoSpaces();
-if (p && p->isFunction())
+if (p && p->IsFunction())
 {
 p = maArrIterator.PeekNextNoSpaces();
 if (p && p->GetOpCode() == ocOpen)
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index a8fb0b42541d..37b19d3b21f3 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -71,7 +71,7 @@ FormulaToken::FormulaToken( StackVar eTypeP, OpCode e ) :
 }
 
 FormulaToken::FormulaToken( const FormulaToken& r ) :
-IFormulaToken(), eOp(r.eOp), eType( r.eType ), mnRefCnt(0)
+eOp(r.eOp), eType( r.eType ), mnRefCnt(0)
 {
 }
 
diff --git a/formula/source/ui/dlg/structpg.cxx 
b/formula/source/ui/dlg/structpg.cxx
index e63ed7420c46..56a94d40a8fb 100644
--- a/formula/source/ui/dlg/structpg.cxx
+++ b/formula/source/ui/dlg/structpg.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 namespace formula
@@ -45,10 +46,10 @@ StructListBox::StructListBox(vcl::Window* pParent, WinBits 
nBits ):
 SvTreeListEntry* StructListBox::InsertStaticEntry(
 const OUString& rText,
 const Image& rEntryImg,
-SvTreeListEntry* pParent, sal_uLong nPos, const IFormulaToken* pToken )
+SvTreeListEntry* pParent, sal_uLong nPos, const FormulaToken* pToken )
 {
 SvTreeListEntry* pEntry = InsertEntry( rText, rEntryImg, rEntryImg, 
pParent, false, nPos,
-const_cast(pToken) );
+const_cast(pToken) );
 return pEntry;
 }
 
@@ -117,7 +118,7 @@ void StructPage::ClearStruct()
 }
 
 SvTreeListEntry* StructPage::InsertEntry( const OUString& rText, 
SvTreeListEntry* pParent,
-   sal_uInt16 nFlag, sal_uLong nPos, const 
IFormulaToken* pIFormulaToken )
+   sal_uInt16 nFlag, sal_uLong nPos, const 
FormulaToken* pIFormulaToken )
 {
 m_pTlbStruct->SetActiveFlag( false );
 
@@ -126,7 +127,7 @@ SvTreeListEntry* StructPage::InsertEntry( const OUString& 
rText, SvTreeListEntry
 {
 case STRUCT_FOLDER:
 pEntry = m_pTlbStruct->InsertEntry( rText, pParent, false, nPos,
-const_cast(pIFormulaToken));
+const_cast(pIFormulaToken));
 break;
 case STRUCT_END:
 pEntry = m_pTlbStruct->InsertStaticEntry( rText, maImgEnd, 
pParent, nPos, pIFormulaToken );
@@ -149,14 +150,14 @@ OUString StructPage::GetEntryText(SvTreeListEntry* 
pEntry) const
 return  aString;
 }
 
-const IFormulaToken* StructPage::GetFunctionEntry(SvTreeListEntry* pEntry)
+const FormulaToken* StructPage::GetFunctionEntry(SvTreeListEntry* pEntry)
 {
 if (pEntry != nullptr)
 {
-const IFormulaToken * pToken = static_cast(pEntry->GetUserData());
+const FormulaToken * pToken = static_cast(pEntry->GetUserData());
 if (pToken != nullptr)
 {
-if ( !(pToken->isFunction() || pToken->getArgumentCount() > 1 ) )
+if ( !(pToken->IsFunction() || pToken->GetParamCount() > 1 ) )
 {
 return GetFunctionEntry(m_pTlbStruct->GetParent(pEntry));
 }
@@ -178,10 +179,10 @@ IMPL_LINK( StructPage, SelectHdl, SvTreeListBox*, pTlb, 
void )
 SvTreeListEntry*pCurEntry = m_pTlbStruct->GetCurEntry();
 if (pCurEntry != nullptr)
 {
-pSelectedToken = static_cast(pCurEntry->GetUserData());
+pSelectedToken = static_cast(pCurEntry->GetUserData());
 if (pSelectedToken != nullptr)
   

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

2018-07-13 Thread Libreoffice Gerrit user
 formula/source/core/api/FormulaCompiler.cxx |   17 +++
 formula/source/core/api/token.cxx   |   28 
 include/formula/tokenarray.hxx  |   64 +---
 sc/source/core/data/formulacell.cxx |3 -
 sc/source/core/tool/interpr2.cxx|6 --
 sc/source/core/tool/interpr4.cxx|8 ---
 sc/source/core/tool/interpr7.cxx|3 -
 7 files changed, 65 insertions(+), 64 deletions(-)

New commits:
commit a5803a66fd9d71b72521d712ba4391ddd570bffa
Author: Eike Rathke 
AuthorDate: Fri Jul 13 19:29:12 2018 +0200
Commit: Eike Rathke 
CommitDate: Fri Jul 13 21:05:37 2018 +0200

Rework FormulaTokenArray ScRecalcMode in preparation for tdf#94925

Strictly order the exclusive bits by priority, let AddRecalcMode()
handle all sets except forced ALWAYS or NORMAL.

Introduce ONLOAD_LENIENT and ONLOAD_MUST splitting ONLOAD to be
able to distinguish later during OOXML import.

Change-Id: I188de2d53a2d54df32d24eeeb148c4f9e87e7cfc
Reviewed-on: https://gerrit.libreoffice.org/57402
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 671d2c2b9f62..ac42bd3df588 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1428,14 +1428,15 @@ void FormulaCompiler::Factor()
 switch( eOp )
 {
 // Functions recalculated on every document load.
-// Don't use SetExclusiveRecalcModeOnLoad() which would
-// override ModeAlways, use
-// AddRecalcMode(ScRecalcMode::ONLOAD) instead.
+// ONLOAD_LENIENT here to be able to distinguish and not
+// force a recalc (if not in an ALWAYS or ONLOAD_MUST
+// context) but keep an imported result from for example
+// OOXML a DDE call. Will be recalculated for ODFF.
 case ocConvertOOo :
 case ocDde:
 case ocMacro:
 case ocExternal:
-pArr->AddRecalcMode( ScRecalcMode::ONLOAD );
+pArr->AddRecalcMode( ScRecalcMode::ONLOAD_LENIENT );
 break;
 // If the referred cell is moved the value changes.
 case ocColumn :
@@ -1443,15 +1444,15 @@ void FormulaCompiler::Factor()
 pArr->SetRecalcModeOnRefMove();
 break;
 // ocCell needs recalc on move for some possible type 
values.
-// and recalc mode on load, fdo#60646
+// And recalc mode on load, tdf#60645
 case ocCell :
 pArr->SetRecalcModeOnRefMove();
-pArr->AddRecalcMode( ScRecalcMode::ONLOAD );
+pArr->AddRecalcMode( ScRecalcMode::ONLOAD_MUST );
 break;
 case ocHyperLink :
-// cell with hyperlink needs to be calculated on load to
+// Cell with hyperlink needs to be calculated on load to
 // get its matrix result generated.
-pArr->AddRecalcMode( ScRecalcMode::ONLOAD );
+pArr->AddRecalcMode( ScRecalcMode::ONLOAD_MUST );
 pArr->SetHyperLink( true);
 break;
 default:
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 42b19f8543c0..a8fb0b42541d 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -845,15 +845,27 @@ FormulaToken* FormulaTokenArray::AddStringXML( const 
OUString& rStr )
 
 void FormulaTokenArray::AddRecalcMode( ScRecalcMode nBits )
 {
-//! Order is important.
-if ( nBits & ScRecalcMode::ALWAYS )
-SetExclusiveRecalcModeAlways();
-else if ( !IsRecalcModeAlways() )
+const unsigned nExclusive = static_cast(nBits & 
ScRecalcMode::EMask);
+if (nExclusive)
 {
-if ( nBits & ScRecalcMode::ONLOAD )
-SetExclusiveRecalcModeOnLoad();
-else if ( nBits & ScRecalcMode::ONLOAD_ONCE && !IsRecalcModeOnLoad() )
-SetExclusiveRecalcModeOnLoadOnce();
+unsigned nExBit;
+if (nExclusive & (nExclusive - 1))
+{
+// More than one bit set, use highest priority.
+for (nExBit = 1; (nExBit & 
static_cast(ScRecalcMode::EMask)) != 0; nExBit <<= 1)
+{
+if (nExclusive & nExBit)
+break;
+}
+}
+else
+{
+// Only one bit is set.
+nExBit = nExclusive;
+}
+// Set exclusive bit if priority is higher than existing.
+if (nExBit < static_cast(nMode & ScRecalcMode::EMask))
+

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

2018-06-26 Thread Dennis Francis
 formula/source/core/api/FormulaCompiler.cxx |   24 ++-
 formula/source/ui/dlg/formula.cxx   |2 
 include/formula/FormulaCompiler.hxx |   16 +-
 sc/inc/compiler.hxx |   16 +-
 sc/qa/unit/ucalc.hxx|   10 +
 sc/qa/unit/ucalc_formula.cxx|  197 +++-
 sc/source/core/data/column.cxx  |3 
 sc/source/core/data/column4.cxx |3 
 sc/source/core/data/formulacell.cxx |   60 ++--
 sc/source/core/data/simpleformulacalc.cxx   |2 
 sc/source/core/tool/compiler.cxx|  178 -
 sc/source/core/tool/interpr4.cxx|   53 ---
 sc/source/filter/oox/formulabuffer.cxx  |4 
 sc/source/ui/view/viewfunc.cxx  |2 
 14 files changed, 449 insertions(+), 121 deletions(-)

New commits:
commit 60c5ca1b874ead7251653d01b0d50fdd42482e09
Author: Dennis Francis 
Date:   Wed May 2 14:22:09 2018 +0530

More Implicit intersection computation

Do implicit intersection computation for
for single parameter functions while generating
RPN token array when the argument is a doubleref
with relative row references. This optimization
is not done when under forced array mode or
matrix formula mode.

The computation logic was already present in ScInterpreter,
so factored it out and reused.

This also adds unit tests to ensure correctness of
II computation for various cases.

Change-Id: I509c3f6f811aa036b1dc3296e8f68904b26c3c49
Reviewed-on: https://gerrit.libreoffice.org/53885
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index f5e06e77deba..671d2c2b9f62 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -697,7 +697,7 @@ void FormulaCompiler::OpCodeMap::putOpCode( const OUString 
& rStr, const OpCode
 
 // class FormulaCompiler
 
-FormulaCompiler::FormulaCompiler( FormulaTokenArray& rArr )
+FormulaCompiler::FormulaCompiler( FormulaTokenArray& rArr, bool bComputeII, 
bool bMatrixFlag )
 :
 nCurrentFactorParam(0),
 pArr(  ),
@@ -714,13 +714,15 @@ FormulaCompiler::FormulaCompiler( FormulaTokenArray& rArr 
)
 glSubTotal( false ),
 needsRPNTokenCheck( false ),
 mbJumpCommandReorder(true),
-mbStopOnError(true)
+mbStopOnError(true),
+mbComputeII(bComputeII),
+mbMatrixFlag(bMatrixFlag)
 {
 }
 
 FormulaTokenArray FormulaCompiler::smDummyTokenArray;
 
-FormulaCompiler::FormulaCompiler()
+FormulaCompiler::FormulaCompiler(bool bComputeII, bool bMatrixFlag)
 :
 nCurrentFactorParam(0),
 pArr( nullptr ),
@@ -737,7 +739,9 @@ FormulaCompiler::FormulaCompiler()
 glSubTotal( false ),
 needsRPNTokenCheck( false ),
 mbJumpCommandReorder(true),
-mbStopOnError(true)
+mbStopOnError(true),
+mbComputeII(bComputeII),
+mbMatrixFlag(bMatrixFlag)
 {
 }
 
@@ -1549,6 +1553,7 @@ void FormulaCompiler::Factor()
 else
 {
 // standard handling of 1-parameter opcodes
+OpCode eMyLastOp = eOp;
 pFacToken = mpToken;
 eOp = NextToken();
 if( nNumFmt == SvNumFormatType::UNDEFINED && eOp == ocNot )
@@ -1564,7 +1569,14 @@ void FormulaCompiler::Factor()
 if (eOp != ocClose)
 SetError( FormulaError::PairExpected);
 else if ( pArr->GetCodeError() == FormulaError::NONE )
+{
 pFacToken->SetByte( 1 );
+if (mbComputeII && IsIIOpCode(eMyLastOp))
+{
+FormulaToken** pArg = pCode - 1;
+HandleIIOpCode(eMyLastOp, 
pFacToken->GetInForceArray(), , 1);
+}
+}
 PutCode( pFacToken );
 NextToken();
 }
@@ -1606,7 +1618,7 @@ void FormulaCompiler::Factor()
 sal_uInt32 nSepCount = 0;
 if( !bNoParam )
 {
-bool bDoIICompute = IsIIOpCode(eMyLastOp);
+bool bDoIICompute = mbComputeII && IsIIOpCode(eMyLastOp);
 // Array of FormulaToken double pointers to collect the 
parameters of II opcodes.
 FormulaToken*** pArgArray = nullptr;
 if (bDoIICompute)
@@ -1633,7 +1645,7 @@ void FormulaCompiler::Factor()
 pArgArray[nSepCount - 1] = pCode - 1; // Add rest of 
the arguments
 }
 if (bDoIICompute)
-HandleIIOpCode(eMyLastOp, pArgArray,
+HandleIIOpCode(eMyLastOp, pFacToken->GetInForceArray(), 
pArgArray,
std::min(nSepCount, 

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

2018-05-17 Thread Luboš Luňák
 formula/source/core/api/FormulaCompiler.cxx |   16 +++-
 formula/source/core/api/token.cxx   |   12 
 include/formula/FormulaCompiler.hxx |1 +
 include/formula/tokenarray.hxx  |5 +
 sc/source/core/tool/token.cxx   |3 ++-
 5 files changed, 35 insertions(+), 2 deletions(-)

New commits:
commit 30cee1ae3e36c5b3bdae71550298abac5abc8788
Author: Luboš Luňák 
Date:   Mon May 14 16:23:52 2018 +0200

disable also ocStyle for Calc's threading

The ocStyle token is only in the RPN tokens, the raw tokens array contains
only ocName, so it's necessary to check also RPN tokens.

Prevents a crash with tdf#91220/1 because of ScInterpreter::ScStyle() 
causing
a SfxBroadcaster::Broadcast() call.

Change-Id: I7fa04114b698918569014322c721751ab3d8c62f
Reviewed-on: https://gerrit.libreoffice.org/54326
Reviewed-by: Michael Meeks 
Tested-by: Jenkins 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 96c2e166fe00..f5e06e77deba 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -712,6 +712,7 @@ FormulaCompiler::FormulaCompiler( FormulaTokenArray& rArr )
 bAutoCorrect( false ),
 bCorrected( false ),
 glSubTotal( false ),
+needsRPNTokenCheck( false ),
 mbJumpCommandReorder(true),
 mbStopOnError(true)
 {
@@ -734,6 +735,7 @@ FormulaCompiler::FormulaCompiler()
 bAutoCorrect( false ),
 bCorrected( false ),
 glSubTotal( false ),
+needsRPNTokenCheck( false ),
 mbJumpCommandReorder(true),
 mbStopOnError(true)
 {
@@ -1328,7 +1330,14 @@ bool FormulaCompiler::GetToken()
 glSubTotal = true;
 break;
 case ocName:
-return HandleRange();
+if( HandleRange())
+{
+// Expanding ocName might have introduced tokens such as 
ocStyle that prevent formula threading,
+// but those wouldn't be present in the raw tokens array, 
so ensure RPN tokens will be checked too.
+needsRPNTokenCheck = true;
+return true;
+}
+return false;
 case ocColRowName:
 return HandleColRowName();
 case ocDBArea:
@@ -1980,6 +1989,7 @@ bool FormulaCompiler::CompileTokenArray()
 {
 glSubTotal = false;
 bCorrected = false;
+needsRPNTokenCheck = false;
 if (pArr->GetCodeError() == FormulaError::NONE || !mbStopOnError)
 {
 if ( bAutoCorrect )
@@ -2013,7 +2023,11 @@ bool FormulaCompiler::CompileTokenArray()
 while( pStack )
 PopTokenArray();
 if( pc )
+{
 pArr->CreateNewRPNArrayFromData( pData, pc );
+if( needsRPNTokenCheck )
+pArr->CheckAllRPNTokens();
+}
 
 // once an error, always an error
 if( pArr->GetCodeError() == FormulaError::NONE && nErrorBeforePop != 
FormulaError::NONE )
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 649a8d36c443..42b19f8543c0 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -674,6 +674,18 @@ void FormulaTokenArray::CheckToken( const FormulaToken& 
/*r*/ )
 // Do nothing.
 }
 
+void FormulaTokenArray::CheckAllRPNTokens()
+{
+if( nRPN )
+{
+FormulaToken** p = pRPN;
+for( sal_uInt16 i = 0; i < nRPN; i++ )
+{
+CheckToken( *p[ i ] );
+}
+}
+}
+
 FormulaToken* FormulaTokenArray::AddToken( const FormulaToken& r )
 {
 return Add( r.Clone() );
diff --git a/include/formula/FormulaCompiler.hxx 
b/include/formula/FormulaCompiler.hxx
index e64bc867a447..321e288fcc55 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -354,6 +354,7 @@ protected:
 boolbAutoCorrect;   // whether to apply 
AutoCorrection
 boolbCorrected; // AutoCorrection was applied
 boolglSubTotal; // if code contains one or 
more subtotal functions
+boolneedsRPNTokenCheck; // whether to make 
FormulaTokenArray check all tokens at the end
 
 bool mbJumpCommandReorder; /// Whether or not to reorder RPN for jump 
commands.
 bool mbStopOnError;/// Whether to stop compilation on first 
encountered error.
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index c0376812a9fb..45669d1ad529 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -453,6 +453,11 @@ public:
  */
 virtual void CheckToken( const FormulaToken& t );
 
+/**
+ * Call CheckToken() 

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

2018-05-14 Thread Noel Grandin
 formula/source/core/api/token.cxx |   15 +-
 include/formula/tokenarray.hxx|6 ++--
 sc/source/core/tool/token.cxx |   55 +++---
 3 files changed, 39 insertions(+), 37 deletions(-)

New commits:
commit 7ebb57228f27a95eb1648500b5becb3febb9d316
Author: Noel Grandin 
Date:   Tue May 8 10:33:15 2018 +0200

loplugin:useuniqueptr in FormulaTokenArray

Change-Id: I5716295d2f0c88c6daf0570941d5dd4c5ff03a33
Reviewed-on: https://gerrit.libreoffice.org/54168
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 1d33b4d93571..649a8d36c443 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -605,8 +605,9 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r )
 FormulaToken** pp;
 if( nLen )
 {
-pp = pCode = new FormulaToken*[ nLen ];
-memcpy( pp, r.pCode, nLen * sizeof( FormulaToken* ) );
+pCode.reset(new FormulaToken*[ nLen ]);
+pp = pCode.get();
+memcpy( pp, r.pCode.get(), nLen * sizeof( FormulaToken* ) );
 for( sal_uInt16 i = 0; i < nLen; i++ )
 (*pp++)->IncRef();
 mbFinalized = true;
@@ -627,7 +628,7 @@ void FormulaTokenArray::Assign( sal_uInt16 nCode, 
FormulaToken **pTokens )
 assert( pCode == nullptr );
 
 nLen = nCode;
-pCode = new FormulaToken*[ nLen ];
+pCode.reset(new FormulaToken*[ nLen ]);
 mbFinalized = true;
 
 for( sal_uInt16 i = 0; i < nLen; i++ )
@@ -651,14 +652,14 @@ void FormulaTokenArray::Clear()
 if( nRPN ) DelRPN();
 if( pCode )
 {
-FormulaToken** p = pCode;
+FormulaToken** p = pCode.get();
 for( sal_uInt16 i = 0; i < nLen; i++ )
 {
 (*p++)->DecRef();
 }
-delete [] pCode;
+pCode.reset();
 }
-pCode = nullptr; pRPN = nullptr;
+pRPN = nullptr;
 nError = FormulaError::NONE;
 nLen = nRPN = 0;
 bHyperLink = false;
@@ -775,7 +776,7 @@ FormulaToken* FormulaTokenArray::Add( FormulaToken* t )
 }
 
 if( !pCode )
-pCode = new FormulaToken*[ FORMULA_MAXTOKENS ];
+pCode.reset(new FormulaToken*[ FORMULA_MAXTOKENS ]);
 if( nLen < FORMULA_MAXTOKENS - 1 )
 {
 CheckToken(*t);
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 087f7eacb83f..c0376812a9fb 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -230,7 +230,7 @@ public:
 class FORMULA_DLLPUBLIC FormulaTokenArray
 {
 protected:
-FormulaToken**  pCode;  // Token code array
+std::unique_ptr pCode; // Token code array
 FormulaToken**  pRPN;   // RPN array
 sal_uInt16  nLen;   // Length of token array
 sal_uInt16  nRPN;   // Length of RPN array
@@ -363,11 +363,11 @@ public:
 memcpy( pRPN, pData, nSize * sizeof( FormulaToken* ) );
 }
 
-FormulaToken** GetArray() const  { return pCode; }
+FormulaToken** GetArray() const  { return pCode.get(); }
 
 FormulaTokenArrayStandardRange Tokens() const
 {
-return FormulaTokenArrayStandardRange(pCode, nLen);
+return FormulaTokenArrayStandardRange(pCode.get(), nLen);
 }
 
 FormulaToken** GetCode()  const  { return pRPN; }
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 6548a82830d7..36b5e9f8e6e9 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1839,7 +1839,7 @@ bool ScTokenArray::IsFormulaVectorDisabled() const
 
 bool ScTokenArray::IsInvariant() const
 {
-FormulaToken** p = pCode;
+FormulaToken** p = pCode.get();
 FormulaToken** pEnd = p + static_cast(nLen);
 for (; p != pEnd; ++p)
 {
@@ -1949,8 +1949,9 @@ ScTokenArray* ScTokenArray::Clone() const
 FormulaToken** pp;
 if( nLen )
 {
-pp = p->pCode = new FormulaToken*[ nLen ];
-memcpy( pp, pCode, nLen * sizeof( formula::FormulaToken* ) );
+p->pCode.reset(new FormulaToken*[ nLen ]);
+pp = p->pCode.get();
+memcpy( pp, pCode.get(), nLen * sizeof( formula::FormulaToken* ) );
 for( sal_uInt16 i = 0; i < nLen; i++, pp++ )
 {
 *pp = (*pp)->Clone();
@@ -1966,7 +1967,7 @@ ScTokenArray* ScTokenArray::Clone() const
 FormulaToken* t = *pp;
 if( t->GetRef() > 1 )
 {
-FormulaToken** p2 = pCode;
+FormulaToken** p2 = pCode.get();
 sal_uInt16 nIdx = 0x;
 for( sal_uInt16 j = 0; j < nLen; j++, p2++ )
 {
@@ -2536,7 +2537,7 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const 
ScDocument* pOldDoc, ScDo
 void ScTokenArray::AdjustAbsoluteRefs( const ScDocument* 

[Libreoffice-commits] core.git: formula/source include/formula sc/CppunitTest_sc_parallelism.mk sc/inc sc/qa sc/source

2018-04-28 Thread Dennis Francis
 formula/source/core/api/FormulaCompiler.cxx |   20 
 include/formula/FormulaCompiler.hxx |8 +
 sc/CppunitTest_sc_parallelism.mk|4 
 sc/inc/compiler.hxx |5 +
 sc/qa/unit/parallelism.cxx  |   79 +
 sc/qa/unit/ucalc.hxx|2 
 sc/qa/unit/ucalc_formula.cxx|  126 
 sc/source/core/data/formulacell.cxx |2 
 sc/source/core/tool/compiler.cxx|  120 ++
 9 files changed, 364 insertions(+), 2 deletions(-)

New commits:
commit 67b1c26c27590678ece7bcef763433aedd0b164d
Author: Dennis Francis 
Date:   Wed Feb 7 12:00:47 2018 +0530

tdf#114479: compute implicit sum ranges for ocSumIf,ocAverageIf...

and update the sum-range token in RPN array while creation of
the RPN array itself.

+ Adds unit tests.
+ In ScParallelismTest unit test, enable threading in its setUp()
  method and restore the original setting in tearDown().

Change-Id: Iee9b7759210a82950181a418eb92766a6cf891fc
Reviewed-on: https://gerrit.libreoffice.org/49465
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index d16e08068b94..96c2e166fe00 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1596,7 +1597,21 @@ void FormulaCompiler::Factor()
 sal_uInt32 nSepCount = 0;
 if( !bNoParam )
 {
+bool bDoIICompute = IsIIOpCode(eMyLastOp);
+// Array of FormulaToken double pointers to collect the 
parameters of II opcodes.
+FormulaToken*** pArgArray = nullptr;
+if (bDoIICompute)
+{
+pArgArray = 
static_cast(alloca(sizeof(FormulaToken**)*FORMULA_MAXPARAMSII));
+if (!pArgArray)
+bDoIICompute = false;
+}
+
 nSepCount++;
+
+if (bDoIICompute)
+pArgArray[nSepCount-1] = pCode - 1; // Add first argument
+
 while ((eOp == ocSep) && (pArr->GetCodeError() == 
FormulaError::NONE || !mbStopOnError))
 {
 NextToken();
@@ -1605,7 +1620,12 @@ void FormulaCompiler::Factor()
 if (nSepCount > FORMULA_MAXPARAMS)
 SetError( FormulaError::CodeOverflow);
 eOp = Expression();
+if (bDoIICompute && nSepCount <= FORMULA_MAXPARAMSII)
+pArgArray[nSepCount - 1] = pCode - 1; // Add rest of 
the arguments
 }
+if (bDoIICompute)
+HandleIIOpCode(eMyLastOp, pArgArray,
+   std::min(nSepCount, 
static_cast(FORMULA_MAXPARAMSII)));
 }
 if (bBadName)
 ;   // nothing, keep current token for return
diff --git a/include/formula/FormulaCompiler.hxx 
b/include/formula/FormulaCompiler.hxx
index 8171b0a831f0..e64bc867a447 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -41,6 +41,7 @@
 #define FORMULA_MAXJUMPCOUNT32  /* maximum number of jumps (ocChoose) */
 #define FORMULA_MAXTOKENS 8192  /* maximum number of tokens in formula */
 #define FORMULA_MAXPARAMS  255  /* maximum number of parameters per 
function (byte) */
+#define FORMULA_MAXPARAMSII  8  /* maximum number of parameters for 
functions that have implicit intersection ranges */
 
 
 namespace com { namespace sun { namespace star {
@@ -66,7 +67,6 @@ struct FormulaArrayStack
 bool bTemp;
 };
 
-
 typedef std::unordered_map< OUString, OpCode > OpCodeHashMap;
 typedef std::unordered_map< OUString, OUString > ExternalHashMap;
 
@@ -323,6 +323,12 @@ protected:
 
 bool MergeRangeReference( FormulaToken * * const pCode1, FormulaToken * 
const * const pCode2 );
 
+// Returns whether the opcode has implicit intersection ranges as 
parameters.
+// This is no-op for this class.
+virtual bool IsIIOpCode(OpCode /*nOpCode*/) const { return false; }
+// Handles II opcode and passes the parameter array and number of 
parameters.
+virtual void HandleIIOpCode(OpCode /*nOpCode*/, FormulaToken*** 
/*pppToken*/, sal_uInt8 /*nNumParams*/) {}
+
 OUStringaCorrectedFormula;  // autocorrected Formula
 OUStringaCorrectedSymbol;   // autocorrected Symbol
 
diff --git a/sc/CppunitTest_sc_parallelism.mk b/sc/CppunitTest_sc_parallelism.mk
index bffa7b1bf8c2..247bd9adfeb2 100644
--- 

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

2018-03-06 Thread Eike Rathke
 formula/source/core/api/FormulaCompiler.cxx |6 +-
 formula/source/ui/dlg/formula.cxx   |1 +
 include/formula/paramclass.hxx  |   11 +--
 sc/source/core/tool/interpr1.cxx|9 -
 4 files changed, 23 insertions(+), 4 deletions(-)

New commits:
commit cfc6cf5177f8df23af35c4509c0276a19de56cce
Author: Eike Rathke 
Date:   Tue Mar 6 18:41:56 2018 +0100

Resolves: tdf#116215 fewer array of references cases, tdf#58874 related

In particular if in any ForceArray context use the matrix result
instead of the array of references list.

Change-Id: I72328a690760637f6d31fadba447641c64711a67

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index a83cc129a93c..537f8f74f074 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -2579,9 +2579,11 @@ void FormulaCompiler::ForceArrayOperator( 
FormulaTokenRef const & rCurr )
 else if (eType == formula::ParamClass::ReferenceOrForceArray)
 {
 // Inherit further only if the return class of the nested function is
-// not Reference.
+// not Reference. Else flag as suppressed.
 if (GetForceArrayParameter( rCurr.get(), SAL_MAX_UINT16) != 
ParamClass::Reference)
 rCurr->SetInForceArray( eType);
+else
+rCurr->SetInForceArray( 
formula::ParamClass::SuppressedReferenceOrForceArray);
 return;
 }
 
@@ -2595,6 +2597,8 @@ void FormulaCompiler::ForceArrayOperator( FormulaTokenRef 
const & rCurr )
 {
 if (GetForceArrayParameter( rCurr.get(), SAL_MAX_UINT16) != 
ParamClass::Reference)
 rCurr->SetInForceArray( eType);
+else
+rCurr->SetInForceArray( 
formula::ParamClass::SuppressedReferenceOrForceArray);
 }
 }
 }
diff --git a/formula/source/ui/dlg/formula.cxx 
b/formula/source/ui/dlg/formula.cxx
index 745554c5493e..2e5d3569b68d 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -762,6 +762,7 @@ void FormulaDlg_Impl::MakeTree( StructPage* _pTree, 
SvTreeListEntry* pParent, co
 case ParamClass::Array:
 case ParamClass::ForceArray:
 case ParamClass::ReferenceOrForceArray:
+case ParamClass::SuppressedReferenceOrForceArray:
 ;   // nothing, only as array/matrix
 // no default to get compiler warning
 }
diff --git a/include/formula/paramclass.hxx b/include/formula/paramclass.hxx
index e8d411088061..a22854fc890c 100644
--- a/include/formula/paramclass.hxx
+++ b/include/formula/paramclass.hxx
@@ -51,8 +51,15 @@ namespace formula
 propagated to subsequent operators and functions being part of a
 parameter of this function. Used with functions that treat
 references separately from arrays, but need the forced array
-calculation of parameters that are not references.*/
-ReferenceOrForceArray
+calculation of parameters that are not references. */
+ReferenceOrForceArray,
+
+/** Same as ReferenceOrForceArray but suppressed / not inherited in the
+compiler's ForceArray context to indicate that a result of
+Reference in JumpMatrix context should use the result matrix
+instead of the array of references. Never used as initial parameter
+classification. */
+SuppressedReferenceOrForceArray
 };
 }
 
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 546f72a15332..3123ba8fd54f 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -800,12 +800,19 @@ bool ScInterpreter::JumpMatrix( short nStackLevel )
 }
 if ( !bCont )
 {   // We're done with it, throw away jump matrix, keep result.
-// For an intermediate result of Reference use the array of references,
+// For an intermediate result of Reference use the array of references
+// if there are more than one reference and the current ForceArray
+// context is not ForceArray or related, suppressed, ...,
 // else (also for a final result of Reference) use the matrix.
 // Treat the result of a jump command as final and use the matrix (see
 // tdf#115493 for why).
+ParamClass eParamClass;
 if (!FormulaCompiler::IsOpCodeJumpCommand( pJumpMatrix->GetOpCode()) &&
+pJumpMatrix->GetRefList().size() > 1 &&
 ScParameterClassification::GetParameterType( pCur, 
SAL_MAX_UINT16) == ParamClass::Reference &&
+(eParamClass = pCur->GetInForceArray()) != 
ParamClass::ForceArray &&
+eParamClass != ParamClass::ReferenceOrForceArray &&
+ 

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

2018-02-20 Thread Eike Rathke
 formula/source/core/api/FormulaCompiler.cxx |   37 
 formula/source/core/api/token.cxx   |1 
 include/formula/FormulaCompiler.hxx |1 
 include/formula/compiler.hxx|   10 +++
 include/formula/opcode.hxx  |4 +--
 sc/source/core/data/funcdesc.cxx|2 -
 6 files changed, 14 insertions(+), 41 deletions(-)

New commits:
commit a8d4d4b9edca48b8fb94dbb06d7dd1e689b07b98
Author: Eike Rathke 
Date:   Tue Feb 20 17:42:03 2018 +0100

Resolves: tdf#115879 treat NOT as the 1-parameter function that it is

... instead of a low precedence unary operator with an odd
behaviour. This wasn't documented nor specified but maybe needed
for old(est) binary file format compatibility. Generate an error
for anything else than a context of a function with one argument.

There might be some corner cases of documents where some old usage
leads to error now, of which some may have worked by accident, but
some not as intended.

Related, the internal not exposed (but available) NEG was classified
similar as a unary operator but corectly handled as function at all
places. Classified as an ordinary 1-parameter function as well.

Change-Id: I3d84a6382243c8d64313e37346f81c857e71be95
Reviewed-on: https://gerrit.libreoffice.org/50055
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 1866fa53201b..a83cc129a93c 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -525,16 +525,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > 
FormulaCompiler::OpCodeMap::create
 // regular unary operators
 for (sal_uInt16 nOp = SC_OPCODE_START_UN_OP; nOp < 
SC_OPCODE_STOP_UN_OP && nOp < mnSymbols; ++nOp)
 {
-switch (nOp)
-{
-// NOT and NEG in fact are functions but for legacy reasons
-// are sorted into unary operators for compiler interna.
-case SC_OPCODE_NOT :
-case SC_OPCODE_NEG :
-break;   // nothing,
-default:
-lclPushOpCodeMapEntry( aVec, mpTable.get(), nOp );
-}
+lclPushOpCodeMapEntry( aVec, mpTable.get(), nOp );
 }
 }
 if ((nGroups & FormulaMapGroup::BINARY_OPERATORS) != 0)
@@ -568,9 +559,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > 
FormulaCompiler::OpCodeMap::create
 SC_OPCODE_IF_NA,
 SC_OPCODE_CHOOSE,
 SC_OPCODE_AND,
-SC_OPCODE_OR,
-SC_OPCODE_NOT,
-SC_OPCODE_NEG
+SC_OPCODE_OR
 };
 lclPushOpCodeMapEntries( aVec, mpTable.get(), aOpCodes, 
SAL_N_ELEMENTS(aOpCodes) );
 // functions with 2 or more parameters.
@@ -1473,9 +1462,7 @@ void FormulaCompiler::Factor()
 NextToken();
 }
 }
-// special cases NOT() and NEG()
-else if( eOp == ocNot || eOp == ocNeg
-  || (SC_OPCODE_START_1_PAR <= eOp && eOp < SC_OPCODE_STOP_1_PAR) )
+else if (SC_OPCODE_START_1_PAR <= eOp && eOp < SC_OPCODE_STOP_1_PAR)
 {
 if (eOp == ocIsoWeeknum && FormulaGrammar::isODFF( meGrammar ))
 {
@@ -1551,7 +1538,7 @@ void FormulaCompiler::Factor()
 }
 else
 {
-// standard handling of ocNot, ocNeg and 1-parameter opcodes
+// standard handling of 1-parameter opcodes
 pFacToken = mpToken;
 eOp = NextToken();
 if( nNumFmt == SvNumFormatType::UNDEFINED && eOp == ocNot )
@@ -1918,18 +1905,6 @@ void FormulaCompiler::CompareLine()
 }
 }
 
-void FormulaCompiler::NotLine()
-{
-CompareLine();
-while (mpToken->GetOpCode() == ocNot)
-{
-FormulaTokenRef p = mpToken;
-NextToken();
-CompareLine();
-PutCode(p);
-}
-}
-
 OpCode FormulaCompiler::Expression()
 {
 static const short nRecursionMax = 42;
@@ -1939,13 +1914,13 @@ OpCode FormulaCompiler::Expression()
 SetError( FormulaError::StackOverflow );
 return ocStop;  //! generate token instead?
 }
-NotLine();
+CompareLine();
 while (mpToken->GetOpCode() == ocAnd || mpToken->GetOpCode() == ocOr)
 {
 FormulaTokenRef p = mpToken;
 mpToken->SetByte( 2 );   // 2 parameters!
 NextToken();
-NotLine();
+CompareLine();
 PutCode(p);
 }
 return mpToken->GetOpCode();
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 13d6914392db..1d33b4d93571 

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

2017-07-10 Thread Winfried Donkers
 formula/source/core/resource/core_resource.src|6 
 include/formula/compiler.hrc  |3 
 include/formula/opcode.hxx|1 
 sc/inc/helpids.h  |1 
 sc/qa/unit/data/functions/text/fods/replaceb.fods | 2096 ++
 sc/qa/unit/ucalc.cxx  |1 
 sc/source/core/data/funcdesc.cxx  |3 
 sc/source/core/inc/interpre.hxx   |1 
 sc/source/core/tool/interpr1.cxx  |   23 
 sc/source/core/tool/interpr4.cxx  |1 
 sc/source/filter/excel/xlformula.cxx  |1 
 sc/source/filter/oox/formulabase.cxx  |2 
 sc/source/ui/src/scfuncs.src  |   15 
 13 files changed, 2151 insertions(+), 3 deletions(-)

New commits:
commit c9f6bd6a714b634c1f366a525cc3571116c3f9f5
Author: Winfried Donkers 
Date:   Wed Jul 5 17:07:08 2017 +0200

tdf#107135, add missing ODFF function REPLACEB.

Change-Id: I8d782b109eb390838b6c4f3a85e9b344ecef87ec
Reviewed-on: https://gerrit.libreoffice.org/39606
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 584aa1746faa..1c98ff43263e 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -289,6 +289,7 @@ StringArray RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 < "LENB" ; SC_OPCODE_LENB; >;
 < "RIGHTB" ; SC_OPCODE_RIGHTB; >;
 < "LEFTB" ; SC_OPCODE_LEFTB; >;
+< "REPLACEB" ; SC_OPCODE_REPLACEB; >;
 < "MIDB" ; SC_OPCODE_MIDB; >;
 < "TEXT" ; SC_OPCODE_TEXT; >;
 < "SUBSTITUTE" ; SC_OPCODE_SUBSTITUTE; >;
@@ -731,6 +732,7 @@ StringArray RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 < "LENB" ; SC_OPCODE_LENB; >;
 < "RIGHTB" ; SC_OPCODE_RIGHTB; >;
 < "LEFTB" ; SC_OPCODE_LEFTB; >;
+< "REPLACEB" ; SC_OPCODE_REPLACEB; >;
 < "MIDB" ; SC_OPCODE_MIDB; >;
 < "TEXT" ; SC_OPCODE_TEXT; >;
 < "SUBSTITUTE" ; SC_OPCODE_SUBSTITUTE; >;
@@ -1176,6 +1178,7 @@ StringArray RID_STRLIST_FUNCTION_NAMES_ENGLISH_PODF
 < "LENB" ; SC_OPCODE_LENB; >;
 < "RIGHTB" ; SC_OPCODE_RIGHTB; >;
 < "LEFTB" ; SC_OPCODE_LEFTB; >;
+< "REPLACEB" ; SC_OPCODE_REPLACEB; >;
 < "MIDB" ; SC_OPCODE_MIDB; >;
 < "TEXT" ; SC_OPCODE_TEXT; >;
 < "SUBSTITUTE" ; SC_OPCODE_SUBSTITUTE; >;
@@ -1622,6 +1625,7 @@ StringArray RID_STRLIST_FUNCTION_NAMES_ENGLISH_API
 < "LENB" ; SC_OPCODE_LENB; >;
 < "RIGHTB" ; SC_OPCODE_RIGHTB; >;
 < "LEFTB" ; SC_OPCODE_LEFTB; >;
+< "REPLACEB" ; SC_OPCODE_REPLACEB; >;
 < "MIDB" ; SC_OPCODE_MIDB; >;
 < "TEXT" ; SC_OPCODE_TEXT; >;
 < "SUBSTITUTE" ; SC_OPCODE_SUBSTITUTE; >;
@@ -2066,6 +2070,7 @@ StringArray RID_STRLIST_FUNCTION_NAMES_ENGLISH
 < "LENB" ; SC_OPCODE_LENB; >;
 < "RIGHTB" ; SC_OPCODE_RIGHTB; >;
 < "LEFTB" ; SC_OPCODE_LEFTB; >;
+< "REPLACEB" ; SC_OPCODE_REPLACEB; >;
 < "MIDB" ; SC_OPCODE_MIDB; >;
 < "TEXT" ; SC_OPCODE_TEXT; >;
 < "SUBSTITUTE" ; SC_OPCODE_SUBSTITUTE; >;
@@ -2486,6 +2491,7 @@ StringArray RID_STRLIST_FUNCTION_NAMES
 < "LENB" ; SC_OPCODE_LENB ; >;
 < "RIGHTB" ; SC_OPCODE_RIGHTB ; >;
 < "LEFTB" ; SC_OPCODE_LEFTB ; >;
+< "REPLACEB" ; SC_OPCODE_REPLACEB; >;
 < "MIDB" ; SC_OPCODE_MIDB ; >;
 < "TEXT" ; SC_OPCODE_TEXT ; >;
 < "SUBSTITUTE" ; SC_OPCODE_SUBSTITUTE ; >;
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 12fa1c482636..4f625f589cbc 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -502,7 +502,8 @@
 #define SC_OPCODE_MINIFS_MS 491
 #define SC_OPCODE_MAXIFS_MS 492
 #define SC_OPCODE_ROUNDSIG  493
-#define SC_OPCODE_STOP_2_PAR494 /* last function with two or more 
parameters' OpCode + 1 */
+#define SC_OPCODE_REPLACEB  494
+#define SC_OPCODE_STOP_2_PAR495 /* last function with two or more 
parameters' OpCode + 1 */
 
 #define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR/* last 
function's OpCode + 1 */
 #define SC_OPCODE_LAST_OPCODE_ID(SC_OPCODE_STOP_FUNCTION - 1)   /* last 
OpCode */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 9aa19d2f5d81..90223b141b7f 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -340,6 +340,7 @@ enum OpCode : sal_uInt16
 ocRightB= SC_OPCODE_RIGHTB,
 ocLeftB = SC_OPCODE_LEFTB,
 ocMidB  = SC_OPCODE_MIDB,
+ocReplaceB  = SC_OPCODE_REPLACEB,
 ocNumberValue   = SC_OPCODE_NUMBERVALUE,
 // 

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

2017-07-04 Thread Eike Rathke
 formula/source/core/api/FormulaCompiler.cxx |8 ++--
 include/formula/FormulaCompiler.hxx |1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 209cc5c211260a6c20cc6fb5ac02fd5a88100314
Author: Eike Rathke 
Date:   Tue Jul 4 15:22:23 2017 +0200

Set error on more than max params (255) per function

Parameter count is size byte, so.. SUM(1,1,1,...) with 256 arguments 
resulted
in 0 (uint8 wrapping around).

Change-Id: Ib9997ad0d0d13d4c5171f276148b6c5cad570d5b

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 2f82f3b022a6..389b2e719350 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1490,7 +1490,7 @@ void FormulaCompiler::Factor()
 }
 else
 SetError( FormulaError::PairExpected);
-sal_uInt8 nSepCount = 0;
+sal_uInt32 nSepCount = 0;
 const sal_uInt16 nSepPos = maArrIterator.GetIndex() - 1;// 
separator position, if any
 if( !bNoParam )
 {
@@ -1500,6 +1500,8 @@ void FormulaCompiler::Factor()
 NextToken();
 CheckSetForceArrayParameter( mpToken, nSepCount);
 nSepCount++;
+if (nSepCount > FORMULA_MAXPARAMS)
+SetError( FormulaError::CodeOverflow);
 eOp = Expression();
 }
 }
@@ -1597,7 +1599,7 @@ void FormulaCompiler::Factor()
 }
 else
 SetError( FormulaError::PairExpected);
-sal_uInt8 nSepCount = 0;
+sal_uInt32 nSepCount = 0;
 if( !bNoParam )
 {
 nSepCount++;
@@ -1606,6 +1608,8 @@ void FormulaCompiler::Factor()
 NextToken();
 CheckSetForceArrayParameter( mpToken, nSepCount);
 nSepCount++;
+if (nSepCount > FORMULA_MAXPARAMS)
+SetError( FormulaError::CodeOverflow);
 eOp = Expression();
 }
 }
diff --git a/include/formula/FormulaCompiler.hxx 
b/include/formula/FormulaCompiler.hxx
index 970909cd9f00..31a3cf5e5ee4 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -40,6 +40,7 @@
 
 #define FORMULA_MAXJUMPCOUNT32  /* maximum number of jumps (ocChoose) */
 #define FORMULA_MAXTOKENS 8192  /* maximum number of tokens in formula */
+#define FORMULA_MAXPARAMS  255  /* maximum number of parameters per 
function (byte) */
 
 
 namespace com { namespace sun { namespace star {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-04 Thread Eike Rathke
 formula/source/ui/dlg/parawin.cxx |3 --
 include/formula/funcvarargs.h |   46 ++
 sc/inc/sc.hrc |3 --
 sc/source/core/data/funcdesc.cxx  |1 
 sc/source/core/tool/addincol.cxx  |1 
 sc/source/core/tool/parclass.cxx  |2 -
 sc/source/ui/app/inputhdl.cxx |1 
 sc/source/ui/formdlg/dwfunctr.cxx |1 
 sc/source/ui/unoobj/appluno.cxx   |1 
 9 files changed, 53 insertions(+), 6 deletions(-)

New commits:
commit a5bff392177d2355a428d9d53a048500230e06c9
Author: Eike Rathke 
Date:   Tue Jul 4 13:04:38 2017 +0200

Move definition of VAR_ARGS and PAIRED_VAR_ARGS to formula/funcvarargs.h

... to have it at one central place instead of two. And add comments why
changing the value is not just easily done.

Change-Id: I266ea55c79c02a653a0704c33f9fa712bbcd104e

diff --git a/formula/source/ui/dlg/parawin.cxx 
b/formula/source/ui/dlg/parawin.cxx
index f10343a3a5d4..b5fe5d0059be 100644
--- a/formula/source/ui/dlg/parawin.cxx
+++ b/formula/source/ui/dlg/parawin.cxx
@@ -25,12 +25,11 @@
 #include "parawin.hxx"
 #include "formula/formdata.hxx"
 #include "formula/IFunctionDescription.hxx"
+#include 
 #include "ModuleHelper.hxx"
 #include "ForResId.hrc"
 #include "bitmaps.hlst"
 
-#define VAR_ARGS 30
-#define PAIRED_VAR_ARGS (VAR_ARGS + VAR_ARGS)
 namespace formula
 {
 
diff --git a/include/formula/funcvarargs.h b/include/formula/funcvarargs.h
new file mode 100644
index ..c0836a55a1e4
--- /dev/null
+++ b/include/formula/funcvarargs.h
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_FORMULA_FUNCVARARGS_H
+#define INCLUDED_FORMULA_FUNCVARARGS_H
+
+/** Used to indicate a variable number of parameters for the Function Wizard.
+
+VAR_ARGS if variable number of parameters, or VAR_ARGS+number if number of
+fixed parameters and variable arguments following.
+
+@see formula::ParaWin
+@see ScFuncDescCore
+
+@NOTE: the value can't be easily changed. If changed then
+reportdesign/source/ui/misc/FunctionHelper.cxx
+FunctionDescription::getVarArgsStart() has to provide some backward
+compatibility for implicit API stability.
+
+@NOTE: also
+
reportbuilder/java/org/libreoffice/report/pentaho/StarFunctionDescription.java
+uses a hard coded value in StarFunctionDescription::getArguments() for
+functionDescription.isInfiniteParameterCount() which though looks like it
+could be easily adapted.
+ */
+#define VAR_ARGS30
+
+/** Used to indicate a variable number of paired parameters for the Function 
Wizard.
+
+PAIRED_VAR_ARGS if variable number of paired parameters, or
+PAIRED_VAR_ARGS+number if number of fixed parameters and variable paired
+arguments following.
+
+@see VAR_ARGS
+ */
+#define PAIRED_VAR_ARGS (VAR_ARGS + VAR_ARGS)
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index a90facc28466..23e4094193ea 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -26,9 +26,6 @@
 #include "svx/svxcommands.h"
 #include "helpids.h"
 
-#define VAR_ARGS30 // variable Parameter in scfuncs.src
-#define PAIRED_VAR_ARGS (VAR_ARGS + VAR_ARGS)
-
 // areas
 
 #define SC_VIEW_START   (SID_SC_START)
diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx
index 012308cc99bc..916264fd9fd9 100644
--- a/sc/source/core/data/funcdesc.cxx
+++ b/sc/source/core/data/funcdesc.cxx
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index 82a464737af6..67252a1b22a0 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -44,6 +44,7 @@
 #include "scmatrix.hxx"
 #include "addinlis.hxx"
 #include 
+#include 
 #include "scfuncs.hrc"
 #include "optutil.hxx"
 #include "addincfg.hxx"
diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index 3835af788984..c0ee514fed9e 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -32,8 +32,8 @@
 // the documentation thingy
 #include 
 #include 
+#include 
 #include "compiler.hxx"
-#include "sc.hrc"
 #endif
 
 using namespace formula;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index a8982a130c75..4bf371ca1305 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -54,6 +54,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

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

2017-06-22 Thread Jochen Nitschke
 formula/source/core/api/FormulaCompiler.cxx |   57 
 include/formula/FormulaCompiler.hxx |   17 +++-
 sc/source/core/tool/calcconfig.cxx  |6 +-
 sc/source/core/tool/compiler.cxx|   16 +++
 sc/source/core/tool/token.cxx   |2 
 5 files changed, 45 insertions(+), 53 deletions(-)

New commits:
commit d9726a692024e202f0b28a8b6955463f1d90d1e4
Author: Jochen Nitschke 
Date:   Mon Mar 6 17:28:27 2017 +0100

formula: remove indirection and use unique_ptr

Change-Id: Ib0c083803024d223f62b91ec54850b84eb68a758
Reviewed-on: https://gerrit.libreoffice.org/39033
Tested-by: Jenkins 
Reviewed-by: Jochen Nitschke 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 24b7d15d723b..2f82f3b022a6 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -389,8 +389,8 @@ uno::Sequence< sheet::FormulaToken > 
FormulaCompiler::OpCodeMap::createSequenceO
 OUString const * const pStop = pName + nLen;
 for ( ; pName < pStop; ++pName, ++pToken)
 {
-OpCodeHashMap::const_iterator iLook( mpHashMap->find( *pName));
-if (iLook != mpHashMap->end())
+OpCodeHashMap::const_iterator iLook( maHashMap.find( *pName));
+if (iLook != maHashMap.end())
 pToken->OpCode = (*iLook).second;
 else
 {
@@ -491,7 +491,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > 
FormulaCompiler::OpCodeMap::create
 SC_OPCODE_CLOSE,
 SC_OPCODE_SEP,
 };
-lclPushOpCodeMapEntries( aVec, mpTable, aOpCodes, 
SAL_N_ELEMENTS(aOpCodes) );
+lclPushOpCodeMapEntries( aVec, mpTable.get(), aOpCodes, 
SAL_N_ELEMENTS(aOpCodes) );
 }
 if ((nGroups & FormulaMapGroup::ARRAY_SEPARATORS) != 0)
 {
@@ -501,16 +501,16 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > 
FormulaCompiler::OpCodeMap::create
 SC_OPCODE_ARRAY_ROW_SEP,
 SC_OPCODE_ARRAY_COL_SEP
 };
-lclPushOpCodeMapEntries( aVec, mpTable, aOpCodes, 
SAL_N_ELEMENTS(aOpCodes) );
+lclPushOpCodeMapEntries( aVec, mpTable.get(), aOpCodes, 
SAL_N_ELEMENTS(aOpCodes) );
 }
 if ((nGroups & FormulaMapGroup::UNARY_OPERATORS) != 0)
 {
 // Due to the nature of the percent operator following its operand
 // it isn't sorted into unary operators for compiler interna.
-lclPushOpCodeMapEntry( aVec, mpTable, ocPercentSign );
+lclPushOpCodeMapEntry( aVec, mpTable.get(), ocPercentSign );
 // "+" can be used as unary operator too, push only if binary 
group is not set
 if ((nGroups & FormulaMapGroup::BINARY_OPERATORS) == 0)
-lclPushOpCodeMapEntry( aVec, mpTable, ocAdd );
+lclPushOpCodeMapEntry( aVec, mpTable.get(), ocAdd );
 // regular unary operators
 for (sal_uInt16 nOp = SC_OPCODE_START_UN_OP; nOp < 
SC_OPCODE_STOP_UN_OP && nOp < mnSymbols; ++nOp)
 {
@@ -522,7 +522,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > 
FormulaCompiler::OpCodeMap::create
 case SC_OPCODE_NEG :
 break;   // nothing,
 default:
-lclPushOpCodeMapEntry( aVec, mpTable, nOp );
+lclPushOpCodeMapEntry( aVec, mpTable.get(), nOp );
 }
 }
 }
@@ -538,7 +538,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > 
FormulaCompiler::OpCodeMap::create
 case SC_OPCODE_OR :
 break;   // nothing,
 default:
-lclPushOpCodeMapEntry( aVec, mpTable, nOp );
+lclPushOpCodeMapEntry( aVec, mpTable.get(), nOp );
 }
 }
 }
@@ -546,9 +546,9 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > 
FormulaCompiler::OpCodeMap::create
 {
 // Function names are not consecutive, skip the gaps between
 // functions with no parameter, functions with 1 parameter
-lclPushOpCodeMapEntries( aVec, mpTable, SC_OPCODE_START_NO_PAR,
+lclPushOpCodeMapEntries( aVec, mpTable.get(), 
SC_OPCODE_START_NO_PAR,
 ::std::min< sal_uInt16 >( SC_OPCODE_STOP_NO_PAR, mnSymbols 
) );
-lclPushOpCodeMapEntries( aVec, mpTable, SC_OPCODE_START_1_PAR,
+lclPushOpCodeMapEntries( aVec, mpTable.get(), 
SC_OPCODE_START_1_PAR,
 ::std::min< sal_uInt16 >( SC_OPCODE_STOP_1_PAR, mnSymbols 
) );
 // Additional functions not within range of functions.
 static const sal_uInt16 aOpCodes[] = {
@@ -561,7 +561,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > 

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

2017-06-16 Thread Tor Lillqvist
 formula/source/core/api/FormulaCompiler.cxx |   58 ++--
 formula/source/core/api/token.cxx   |  181 
 include/formula/FormulaCompiler.hxx |6 
 include/formula/tokenarray.hxx  |   37 ++---
 sc/source/core/tool/compiler.cxx|   51 +++
 sc/source/core/tool/interpr4.cxx|5 
 6 files changed, 91 insertions(+), 247 deletions(-)

New commits:
commit 5c81adc51a05a016e754de7961d3a7bdb4494e01
Author: Tor Lillqvist 
Date:   Fri Jun 16 00:18:57 2017 +0300

Get rid of the index inside FormulaTokenArray

Instead, use FormulaTokenArrrayPlainIterator everywhere, especially in
the FormulaCompiler.

This is the final step of a long chain of commits. (Split up into many
"uncontroversial" bits, and then this, to make potential bisecting
easier.)

Also added a logging operator<< for FormulaTokenArray, for SAL_DEBUG,
SAL_INFO etc goodness.

Change-Id: I02fe29f3f1e0dc33e5cba69e594223b4178a12bc
Reviewed-on: https://gerrit.libreoffice.org/38851
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 7da75874ea04..310ddb2346f3 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -700,6 +700,7 @@ FormulaCompiler::FormulaCompiler( FormulaTokenArray& rArr )
 :
 nCurrentFactorParam(0),
 pArr(  ),
+maArrIterator( rArr ),
 pCode( nullptr ),
 pStack( nullptr ),
 eLastOp( ocPush ),
@@ -715,10 +716,13 @@ FormulaCompiler::FormulaCompiler( FormulaTokenArray& rArr 
)
 {
 }
 
+FormulaTokenArray FormulaCompiler::smDummyTokenArray;
+
 FormulaCompiler::FormulaCompiler()
 :
 nCurrentFactorParam(0),
 pArr( nullptr ),
+maArrIterator( smDummyTokenArray ),
 pCode( nullptr ),
 pStack( nullptr ),
 eLastOp( ocPush ),
@@ -1260,11 +1264,11 @@ bool FormulaCompiler::GetToken()
 {
 FormulaTokenRef pSpacesToken;
 short nWasColRowName;
-if ( pArr->nIndex > 0 && pArr->pCode[ pArr->nIndex-1 ]->GetOpCode() == 
ocColRowName )
+if ( maArrIterator.mnIndex > 0 && pArr->pCode[ maArrIterator.mnIndex-1 
]->GetOpCode() == ocColRowName )
  nWasColRowName = 1;
 else
  nWasColRowName = 0;
-mpToken = pArr->Next();
+mpToken = maArrIterator.Next();
 while( mpToken && mpToken->GetOpCode() == ocSpaces )
 {
 // For significant whitespace remember last ocSpaces token. Usually
@@ -1274,7 +1278,7 @@ bool FormulaCompiler::GetToken()
 nWasColRowName++;
 if ( bAutoCorrect && !pStack )
 CreateStringFromToken( aCorrectedFormula, mpToken.get() );
-mpToken = pArr->Next();
+mpToken = maArrIterator.Next();
 }
 if ( bAutoCorrect && !pStack && mpToken )
 CreateStringFromToken( aCorrectedSymbol, mpToken.get() );
@@ -1296,7 +1300,7 @@ bool FormulaCompiler::GetToken()
 if ( nWasColRowName >= 2 && mpToken->GetOpCode() == ocColRowName )
 {   // convert an ocSpaces to ocIntersect in RPN
 mpLastToken = mpToken = new FormulaByteToken( ocIntersect );
-pArr->nIndex--; // we advanced to the second ocColRowName, 
step back
+maArrIterator.mnIndex--; // we advanced to the second 
ocColRowName, step back
 }
 else if (pSpacesToken && FormulaGrammar::isExcelSyntax( meGrammar) 
&&
 mpLastToken && mpToken &&
@@ -1306,7 +1310,7 @@ bool FormulaCompiler::GetToken()
 // Let IntersectionLine() <- Factor() decide how to treat this,
 // once the actual arguments are determined in RPN.
 mpLastToken = mpToken = pSpacesToken;
-pArr->nIndex--; // step back from next non-spaces token
+maArrIterator.mnIndex--; // step back from next non-spaces 
token
 return true;
 }
 }
@@ -1494,7 +1498,7 @@ void FormulaCompiler::Factor()
 else
 SetError( FormulaError::PairExpected);
 sal_uInt8 nSepCount = 0;
-const sal_uInt16 nSepPos = pArr->nIndex - 1;// separator 
position, if any
+const sal_uInt16 nSepPos = maArrIterator.mnIndex - 1;// 
separator position, if any
 if( !bNoParam )
 {
 nSepCount++;
@@ -1521,12 +1525,13 @@ void FormulaCompiler::Factor()
 // Current index is nSepPos+3 if expression stops, or
 // nSepPos+4 if expression continues after the call because
 // we just called NextToken() to move away 

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

2017-06-14 Thread Tor Lillqvist
 formula/source/core/api/token.cxx |   66 +++---
 include/formula/tokenarray.hxx|6 +--
 2 files changed, 36 insertions(+), 36 deletions(-)

New commits:
commit b3dfd7988a07a0a60bd7b7282411101ef3546526
Author: Tor Lillqvist 
Date:   Wed Jun 14 18:22:21 2017 +0300

Use pointer instead of reference

Change-Id: I087f0fe99e6631d5b62ea773c83404e11d64d060

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index b43fd7fec80e..1e966f1a40f1 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1713,11 +1713,11 @@ void FormulaTokenIterator::Reset()
 
 FormulaToken* FormulaTokenArrayPlainIterator::GetNextName()
 {
-if( mrFTA.pCode )
+if( mpFTA->pCode )
 {
-while ( mnIndex < mrFTA.nLen )
+while ( mnIndex < mpFTA->nLen )
 {
-FormulaToken* t = mrFTA.pCode[ mnIndex++ ];
+FormulaToken* t = mpFTA->pCode[ mnIndex++ ];
 if( t->GetType() == svIndex )
 return t;
 }
@@ -1788,9 +1788,9 @@ bool FormulaTokenIterator::IsEndOfPath() const
 
 FormulaToken* FormulaTokenArrayPlainIterator::GetNextReference()
 {
-while( mnIndex < mrFTA.nLen )
+while( mnIndex < mpFTA->nLen )
 {
-FormulaToken* t = mrFTA.pCode[ mnIndex++ ];
+FormulaToken* t = mpFTA->pCode[ mnIndex++ ];
 switch( t->GetType() )
 {
 case svSingleRef:
@@ -1809,9 +1809,9 @@ FormulaToken* 
FormulaTokenArrayPlainIterator::GetNextReference()
 
 FormulaToken* FormulaTokenArrayPlainIterator::GetNextColRowName()
 {
-while( mnIndex < mrFTA.nLen )
+while( mnIndex < mpFTA->nLen )
 {
-FormulaToken* t = mrFTA.pCode[ mnIndex++ ];
+FormulaToken* t = mpFTA->pCode[ mnIndex++ ];
 if ( t->GetOpCode() == ocColRowName )
 return t;
 }
@@ -1820,9 +1820,9 @@ FormulaToken* 
FormulaTokenArrayPlainIterator::GetNextColRowName()
 
 FormulaToken* FormulaTokenArrayPlainIterator::GetNextReferenceRPN()
 {
-while( mnIndex < mrFTA.nRPN )
+while( mnIndex < mpFTA->nRPN )
 {
-FormulaToken* t = mrFTA.pRPN[ mnIndex++ ];
+FormulaToken* t = mpFTA->pRPN[ mnIndex++ ];
 switch( t->GetType() )
 {
 case svSingleRef:
@@ -1841,11 +1841,11 @@ FormulaToken* 
FormulaTokenArrayPlainIterator::GetNextReferenceRPN()
 
 FormulaToken* FormulaTokenArrayPlainIterator::GetNextReferenceOrName()
 {
-if( mrFTA.pCode )
+if( mpFTA->pCode )
 {
-while ( mnIndex < mrFTA.nLen )
+while ( mnIndex < mpFTA->nLen )
 {
-FormulaToken* t = mrFTA.pCode[ mnIndex++ ];
+FormulaToken* t = mpFTA->pCode[ mnIndex++ ];
 switch( t->GetType() )
 {
 case svSingleRef:
@@ -1867,57 +1867,57 @@ FormulaToken* 
FormulaTokenArrayPlainIterator::GetNextReferenceOrName()
 
 FormulaToken* FormulaTokenArrayPlainIterator::Next()
 {
-if( mrFTA.pCode && mnIndex < mrFTA.nLen )
-return mrFTA.pCode[ mnIndex++ ];
+if( mpFTA->pCode && mnIndex < mpFTA->nLen )
+return mpFTA->pCode[ mnIndex++ ];
 else
 return nullptr;
 }
 
 FormulaToken* FormulaTokenArrayPlainIterator::NextNoSpaces()
 {
-if( mrFTA.pCode )
+if( mpFTA->pCode )
 {
-while( (mnIndex < mrFTA.nLen) && (mrFTA.pCode[ mnIndex ]->GetOpCode() 
== ocSpaces) )
+while( (mnIndex < mpFTA->nLen) && (mpFTA->pCode[ mnIndex 
]->GetOpCode() == ocSpaces) )
 ++mnIndex;
-if( mnIndex < mrFTA.nLen )
-return mrFTA.pCode[ mnIndex++ ];
+if( mnIndex < mpFTA->nLen )
+return mpFTA->pCode[ mnIndex++ ];
 }
 return nullptr;
 }
 
 FormulaToken* FormulaTokenArrayPlainIterator::NextRPN()
 {
-if( mrFTA.pRPN && mnIndex < mrFTA.nRPN )
-return mrFTA.pRPN[ mnIndex++ ];
+if( mpFTA->pRPN && mnIndex < mpFTA->nRPN )
+return mpFTA->pRPN[ mnIndex++ ];
 else
 return nullptr;
 }
 
 FormulaToken* FormulaTokenArrayPlainIterator::PrevRPN()
 {
-if( mrFTA.pRPN && mnIndex )
-return mrFTA.pRPN[ --mnIndex ];
+if( mpFTA->pRPN && mnIndex )
+return mpFTA->pRPN[ --mnIndex ];
 else
 return nullptr;
 }
 
 FormulaToken* FormulaTokenArrayPlainIterator::PeekNext()
 {
-if( mrFTA.pCode && mnIndex < mrFTA.nLen )
-return mrFTA.pCode[ mnIndex ];
+if( mpFTA->pCode && mnIndex < mpFTA->nLen )
+return mpFTA->pCode[ mnIndex ];
 else
 return nullptr;
 }
 
 FormulaToken* FormulaTokenArrayPlainIterator::PeekNextNoSpaces() const
 {
-if( mrFTA.pCode && mnIndex < mrFTA.nLen )
+if( mpFTA->pCode && mnIndex < mpFTA->nLen )
 {
 sal_uInt16 j = mnIndex;
-while ( j < mrFTA.nLen && mrFTA.pCode[j]->GetOpCode() == ocSpaces )
+while ( j < mpFTA->nLen && mpFTA->pCode[j]->GetOpCode() == ocSpaces )
 j++;
-if ( j < mrFTA.nLen )
-

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

2017-06-13 Thread Tor Lillqvist
 formula/source/core/api/token.cxx |   14 ++
 include/formula/tokenarray.hxx|2 ++
 2 files changed, 16 insertions(+)

New commits:
commit 7b67e3fc5566f4172c69fa8460aea0c006e97a4d
Author: Tor Lillqvist 
Date:   Tue Jun 13 17:09:24 2017 +0300

Add FirstToken() and FirstRPNToken() functions that don't touch nIndex

... to FormulaTokenArray. Intermediate commit, these new functions
aren't used yet.

Change-Id: Ie505fe9dbd787087fa29f701d29ff9b4495c8699

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 978dc2e198b6..a451e2a6c107 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -600,6 +600,13 @@ void FormulaTokenArray::DelRPN()
 nRPN = nIndex = 0;
 }
 
+FormulaToken* FormulaTokenArray::FirstToken() const
+{
+if (!pCode || nLen == 0)
+return nullptr;
+return pCode[0];
+}
+
 FormulaToken* FormulaTokenArray::PeekPrev( sal_uInt16 & nIdx )
 {
 if (0 < nIdx && nIdx <= nLen)
@@ -647,6 +654,13 @@ FormulaToken* FormulaTokenArray::PeekPrevNoSpaces()
 return nullptr;
 }
 
+FormulaToken* FormulaTokenArray::FirstRPNToken() const
+{
+if (!pRPN || nRPN == 0)
+return nullptr;
+return pRPN[0];
+}
+
 bool FormulaTokenArray::HasReferences() const
 {
 for (sal_uInt16 i = 0; i < nLen; ++i)
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 575ead626286..109146c56b87 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -206,6 +206,7 @@ public:
 void Clear();
 void DelRPN();
 FormulaToken* First() { nIndex = 0; return Next(); }
+FormulaToken* FirstToken() const;
 FormulaToken* Next();
 FormulaToken* NextNoSpaces();
 FormulaToken* GetNextName();
@@ -219,6 +220,7 @@ public:
 FormulaToken* PeekPrevNoSpaces();/// Only after 
Reset/First/Next/Last/Prev!
 FormulaToken* PeekNextNoSpaces();/// Only after 
Reset/First/Next/Last/Prev!
 FormulaToken* FirstRPN() { nIndex = 0; return NextRPN(); }
+FormulaToken* FirstRPNToken() const;
 FormulaToken* NextRPN();
 FormulaToken* LastRPN() { nIndex = nRPN; return PrevRPN(); }
 FormulaToken* PrevRPN();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-06-06 Thread Tor Lillqvist
 formula/source/core/api/token.cxx |  167 ++
 include/formula/tokenarray.hxx|   69 +++
 2 files changed, 236 insertions(+)

New commits:
commit c2b256084b086b63a13d16f65d1be2966f4febb3
Author: Tor Lillqvist 
Date:   Tue Jun 6 19:37:16 2017 +0300

Partial start of separating the iterator out from FormulaTokenArray

The plan is to drop the iterator functionality from FormulaTokenArray
and instead use separate iterator objects. This will make
parallelising code that uses these data structures easier. I call the
new separate iterator class FormulaTokenArrayPlainIterator for now,
feel free to come up with a better name.

No change to what code actually gets run yet, so yeah, this adds
"unused" code.

Change-Id: Ie86f80529354174f0ce8bde1085a54bc6c5ac67b

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 63afd00cfc36..703c0eca5c29 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1757,6 +1757,173 @@ bool FormulaTokenIterator::IsEndOfPath() const
 return GetNonEndOfPathToken( maStack.back().nPC + 1) == nullptr;
 }
 
+FormulaToken* FormulaTokenArrayPlainIterator::GetNextReference()
+{
+while( mnIndex < mrFTA.nLen )
+{
+FormulaToken* t = mrFTA.pCode[ mnIndex++ ];
+switch( t->GetType() )
+{
+case svSingleRef:
+case svDoubleRef:
+case svExternalSingleRef:
+case svExternalDoubleRef:
+return t;
+default:
+{
+// added to avoid warnings
+}
+}
+}
+return nullptr;
+}
+
+FormulaToken* FormulaTokenArrayPlainIterator::GetNextColRowName()
+{
+while( mnIndex < mrFTA.nLen )
+{
+FormulaToken* t = mrFTA.pCode[ mnIndex++ ];
+if ( t->GetOpCode() == ocColRowName )
+return t;
+}
+return nullptr;
+}
+
+FormulaToken* FormulaTokenArrayPlainIterator::GetNextReferenceRPN()
+{
+while( mnIndex < mrFTA.nRPN )
+{
+FormulaToken* t = mrFTA.pRPN[ mnIndex++ ];
+switch( t->GetType() )
+{
+case svSingleRef:
+case svDoubleRef:
+case svExternalSingleRef:
+case svExternalDoubleRef:
+return t;
+default:
+{
+// added to avoid warnings
+}
+}
+}
+return nullptr;
+}
+
+FormulaToken* FormulaTokenArrayPlainIterator::GetNextReferenceOrName()
+{
+if( mrFTA.pCode )
+{
+while ( mnIndex < mrFTA.nLen )
+{
+FormulaToken* t = mrFTA.pCode[ mnIndex++ ];
+switch( t->GetType() )
+{
+case svSingleRef:
+case svDoubleRef:
+case svIndex:
+case svExternalSingleRef:
+case svExternalDoubleRef:
+case svExternalName:
+return t;
+default:
+{
+// added to avoid warnings
+}
+ }
+ }
+ }
+return nullptr;
+}
+
+FormulaToken* FormulaTokenArrayPlainIterator::Next()
+{
+if( mrFTA.pCode && mnIndex < mrFTA.nLen )
+return mrFTA.pCode[ mnIndex++ ];
+else
+return nullptr;
+}
+
+FormulaToken* FormulaTokenArrayPlainIterator::NextNoSpaces()
+{
+if( mrFTA.pCode )
+{
+while( (mnIndex < mrFTA.nLen) && (mrFTA.pCode[ mnIndex ]->GetOpCode() 
== ocSpaces) )
+++mnIndex;
+if( mnIndex < mrFTA.nLen )
+return mrFTA.pCode[ mnIndex++ ];
+}
+return nullptr;
+}
+
+FormulaToken* FormulaTokenArrayPlainIterator::NextRPN()
+{
+if( mrFTA.pRPN && mnIndex < mrFTA.nRPN )
+return mrFTA.pRPN[ mnIndex++ ];
+else
+return nullptr;
+}
+
+FormulaToken* FormulaTokenArrayPlainIterator::PrevRPN()
+{
+if( mrFTA.pRPN && mnIndex )
+return mrFTA.pRPN[ --mnIndex ];
+else
+return nullptr;
+}
+
+FormulaToken* FormulaTokenArrayPlainIterator::PeekNext()
+{
+if( mrFTA.pCode && mnIndex < mrFTA.nLen )
+return mrFTA.pCode[ mnIndex ];
+else
+return nullptr;
+}
+
+FormulaToken* FormulaTokenArrayPlainIterator::PeekNextNoSpaces() const
+{
+if( mrFTA.pCode && mnIndex < mrFTA.nLen )
+{
+sal_uInt16 j = mnIndex;
+while ( j < mrFTA.nLen && mrFTA.pCode[j]->GetOpCode() == ocSpaces )
+j++;
+if ( j < mrFTA.nLen )
+return mrFTA.pCode[ j ];
+else
+return nullptr;
+}
+else
+return nullptr;
+}
+
+FormulaToken* FormulaTokenArrayPlainIterator::PeekPrevNoSpaces() const
+{
+if( mrFTA.pCode && mnIndex > 1 )
+{
+sal_uInt16 j = mnIndex - 2;
+while ( mrFTA.pCode[j]->GetOpCode() == ocSpaces && j > 0 )
+j--;
+if ( j > 0 || mrFTA.pCode[j]->GetOpCode() != 

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

2017-05-17 Thread Eike Rathke
 formula/source/core/api/FormulaCompiler.cxx |   23 ---
 include/formula/FormulaCompiler.hxx |2 ++
 2 files changed, 18 insertions(+), 7 deletions(-)

New commits:
commit 70cb7757f971c4c16d1b0a5585d95816cd4382e6
Author: Eike Rathke 
Date:   Wed May 17 15:21:25 2017 +0200

Resolves: tdf#96426 more whitespace intersection operator in Excel syntax

Handle also stacked token arrays resulting from named expressions like
=range1 range2

Change-Id: I1838af155f17b5e4f941e46895303caed75b6075

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 7a28568ad590..b626039efed7 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1245,7 +1245,7 @@ bool FormulaCompiler::GetToken()
 if ( nRecursion > nRecursionMax )
 {
 SetError( FormulaError::StackOverflow );
-mpToken = new FormulaByteToken( ocStop );
+mpLastToken = mpToken = new FormulaByteToken( ocStop );
 return false;
 }
 if ( bAutoCorrect && !pStack )
@@ -1258,7 +1258,6 @@ bool FormulaCompiler::GetToken()
 bStop = true;
 else
 {
-FormulaTokenRef pCurrToken = mpToken;
 FormulaTokenRef pSpacesToken;
 short nWasColRowName;
 if ( pArr->nIndex > 0 && pArr->pCode[ pArr->nIndex-1 ]->GetOpCode() == 
ocColRowName )
@@ -1284,6 +1283,9 @@ bool FormulaCompiler::GetToken()
 if( pStack )
 {
 PopTokenArray();
+// mpLastToken was popped as well and corresponds to the
+// then current last token during PushTokenArray(), e.g. for
+// HandleRange().
 return GetToken();
 }
 else
@@ -1293,17 +1295,17 @@ bool FormulaCompiler::GetToken()
 {
 if ( nWasColRowName >= 2 && mpToken->GetOpCode() == ocColRowName )
 {   // convert an ocSpaces to ocIntersect in RPN
-mpToken = new FormulaByteToken( ocIntersect );
+mpLastToken = mpToken = new FormulaByteToken( ocIntersect );
 pArr->nIndex--; // we advanced to the second ocColRowName, 
step back
 }
 else if (pSpacesToken && FormulaGrammar::isExcelSyntax( meGrammar) 
&&
-pCurrToken && mpToken &&
-isPotentialRangeType( pCurrToken.get(), false, false) &&
+mpLastToken && mpToken &&
+isPotentialRangeType( mpLastToken.get(), false, false) &&
 isPotentialRangeType( mpToken.get(), false, true))
 {
 // Let IntersectionLine() <- Factor() decide how to treat this,
 // once the actual arguments are determined in RPN.
-mpToken = pSpacesToken;
+mpLastToken = mpToken = pSpacesToken;
 pArr->nIndex--; // step back from next non-spaces token
 return true;
 }
@@ -1311,9 +1313,14 @@ bool FormulaCompiler::GetToken()
 }
 if( bStop )
 {
-mpToken = new FormulaByteToken( ocStop );
+mpLastToken = mpToken = new FormulaByteToken( ocStop );
 return false;
 }
+
+// Remember token for next round and any PushTokenArray() calls that may
+// occur in handlers.
+mpLastToken = mpToken;
+
 if ( mpToken->IsExternalRef() )
 {
 return HandleExternalReference(*mpToken);
@@ -2042,6 +2049,7 @@ void FormulaCompiler::PopTokenArray()
 if( p->bTemp )
 delete pArr;
 pArr = p->pArr;
+mpLastToken = p->mpLastToken;
 delete p;
 }
 }
@@ -2602,6 +2610,7 @@ void FormulaCompiler::PushTokenArray( FormulaTokenArray* 
pa, bool bTemp )
 FormulaArrayStack* p = new FormulaArrayStack;
 p->pNext  = pStack;
 p->pArr   = pArr;
+p->mpLastToken = mpLastToken;
 p->bTemp  = bTemp;
 pStack= p;
 pArr  = pa;
diff --git a/include/formula/FormulaCompiler.hxx 
b/include/formula/FormulaCompiler.hxx
index 8e4999ffc999..f6650201bba1 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -59,6 +59,7 @@ struct FormulaArrayStack
 {
 FormulaArrayStack*  pNext;
 FormulaTokenArray*  pArr;
+FormulaTokenRef mpLastToken;
 bool bTemp;
 };
 
@@ -330,6 +331,7 @@ protected:
 FormulaTokenRef pCurrentFactorToken;// current factor token (of 
Factor() method)
 sal_uInt16  nCurrentFactorParam;// current factor token's 
parameter, 1-based
 FormulaTokenArray*  pArr;
+FormulaTokenRef mpLastToken;// last token
 
 FormulaToken**  pCode;
 FormulaArrayStack*  pStack;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

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

2017-05-12 Thread Eike Rathke
 formula/source/core/api/token.cxx |   14 +-
 include/formula/tokenarray.hxx|7 ---
 2 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit 534746c99e88270ec766aeb12970a282a0a16520
Author: Eike Rathke 
Date:   Fri May 12 17:48:53 2017 +0200

Introduce and check FormulaTokenArray::mbFinalized to not add further tokens

Obviously after FormulaTokenArray::Assign() or the copy-ctor for that 
matter,
new tokens can not be added anymore to the shrunk code array. We don't do 
it,
but ensure that it isn't done in future..

Change-Id: Ibc0115f9f38e9745028a7459c61408c188783d03

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index cc5a93573fe5..63afd00cfc36 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -728,7 +728,8 @@ FormulaTokenArray::FormulaTokenArray() :
 nMode(ScRecalcMode::NORMAL),
 bHyperLink(false),
 mbFromRangeName(false),
-mbShareable(true)
+mbShareable(true),
+mbFinalized(false)
 {
 }
 
@@ -752,6 +753,7 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r )
 bHyperLink = r.bHyperLink;
 mbFromRangeName = r.mbFromRangeName;
 mbShareable = r.mbShareable;
+mbFinalized = r.mbFinalized;
 pCode  = nullptr;
 pRPN   = nullptr;
 FormulaToken** pp;
@@ -761,6 +763,7 @@ void FormulaTokenArray::Assign( const FormulaTokenArray& r )
 memcpy( pp, r.pCode, nLen * sizeof( FormulaToken* ) );
 for( sal_uInt16 i = 0; i < nLen; i++ )
 (*pp++)->IncRef();
+mbFinalized = true;
 }
 if( nRPN )
 {
@@ -779,6 +782,7 @@ void FormulaTokenArray::Assign( sal_uInt16 nCode, 
FormulaToken **pTokens )
 
 nLen = nCode;
 pCode = new FormulaToken*[ nLen ];
+mbFinalized = true;
 
 for( sal_uInt16 i = 0; i < nLen; i++ )
 {
@@ -814,6 +818,7 @@ void FormulaTokenArray::Clear()
 bHyperLink = false;
 mbFromRangeName = false;
 mbShareable = true;
+mbFinalized = false;
 ClearRecalcMode();
 }
 
@@ -923,6 +928,13 @@ sal_uInt16 FormulaTokenArray::RemoveToken( sal_uInt16 
nOffset, sal_uInt16 nCount
 
 FormulaToken* FormulaTokenArray::Add( FormulaToken* t )
 {
+assert(!mbFinalized);
+if (mbFinalized)
+{
+t->DeleteIfZeroRef();
+return nullptr;
+}
+
 if( !pCode )
 pCode = new FormulaToken*[ FORMULA_MAXTOKENS ];
 if( nLen < FORMULA_MAXTOKENS - 1 )
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 39e326b63ade..f7a8228a0d0e 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -125,9 +125,10 @@ protected:
 sal_uInt16  nIndex; // Current step index
 FormulaErrornError; // Error code
 ScRecalcModenMode;  // Flags to indicate when to 
recalc this code
-boolbHyperLink; // If HYPERLINK() occurs in the 
formula.
-boolmbFromRangeName;// If this array originates from a 
named expression
-boolmbShareable;// Whether or not it can be shared 
with adjacent cells.
+boolbHyperLink  :1; // If HYPERLINK() occurs in the 
formula.
+boolmbFromRangeName :1; // If this array originates from a 
named expression
+boolmbShareable :1; // Whether or not it can be shared 
with adjacent cells.
+boolmbFinalized :1; // Whether code arrays have their 
final used size and no more tokens can be added.
 
 protected:
 voidAssign( const FormulaTokenArray& );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-04-10 Thread Noel Grandin
 formula/source/core/api/FormulaCompiler.cxx |   16 +++-
 include/formula/FormulaCompiler.hxx |   12 +---
 2 files changed, 12 insertions(+), 16 deletions(-)

New commits:
commit 51289601098449d985dbbddef316cf56acdafbc4
Author: Noel Grandin 
Date:   Fri Apr 7 15:21:22 2017 +0200

loplugin:inlinefields in formula::FormulaCompiler

Change-Id: I6dc6dfd064bf944db278b4663812d71b6cc49b3a
Reviewed-on: https://gerrit.libreoffice.org/36344
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 09e355302105..6568818c7038 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -362,11 +362,11 @@ void FormulaCompiler::OpCodeMap::putExternal( const 
OUString & rSymbol, const OU
 // map to different symbols, the first pair wins. Same symbol of course may
 // not map to different AddIns, again the first pair wins and also the
 // AddIn->symbol mapping is not inserted in other cases.
-bool bOk = mpExternalHashMap->insert( ExternalHashMap::value_type( 
rSymbol, rAddIn)).second;
+bool bOk = maExternalHashMap.insert( ExternalHashMap::value_type( rSymbol, 
rAddIn)).second;
 SAL_WARN_IF( !bOk, "formula.core", "OpCodeMap::putExternal: symbol not 
inserted, " << rSymbol << " -> " << rAddIn);
 if (bOk)
 {
-bOk = mpReverseExternalHashMap->insert( ExternalHashMap::value_type( 
rAddIn, rSymbol)).second;
+bOk = maReverseExternalHashMap.insert( ExternalHashMap::value_type( 
rAddIn, rSymbol)).second;
 // Failed insertion of the AddIn is ok for different symbols mapping to
 // the same AddIn. Make this INFO only.
 SAL_INFO_IF( !bOk, "formula.core", "OpCodeMap::putExternal: AddIn not 
inserted, " << rAddIn << " -> " << rSymbol);
@@ -375,9 +375,9 @@ void FormulaCompiler::OpCodeMap::putExternal( const 
OUString & rSymbol, const OU
 
 void FormulaCompiler::OpCodeMap::putExternalSoftly( const OUString & rSymbol, 
const OUString & rAddIn )
 {
-bool bOk = mpReverseExternalHashMap->insert( ExternalHashMap::value_type( 
rAddIn, rSymbol)).second;
+bool bOk = maReverseExternalHashMap.insert( ExternalHashMap::value_type( 
rAddIn, rSymbol)).second;
 if (bOk)
-mpExternalHashMap->insert( ExternalHashMap::value_type( rSymbol, 
rAddIn));
+maExternalHashMap.insert( ExternalHashMap::value_type( rSymbol, 
rAddIn));
 }
 
 uno::Sequence< sheet::FormulaToken > 
FormulaCompiler::OpCodeMap::createSequenceOfFormulaTokens(
@@ -398,8 +398,8 @@ uno::Sequence< sheet::FormulaToken > 
FormulaCompiler::OpCodeMap::createSequenceO
 OUString aIntName;
 if (hasExternals())
 {
-ExternalHashMap::const_iterator iExt( mpExternalHashMap->find( 
*pName));
-if (iExt != mpExternalHashMap->end())
+ExternalHashMap::const_iterator iExt( maExternalHashMap.find( 
*pName));
+if (iExt != maExternalHashMap.end())
 aIntName = (*iExt).second;
 // Check for existence not needed here, only name-mapping is of
 // interest.
@@ -578,7 +578,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > 
FormulaCompiler::OpCodeMap::create
 // If AddIn functions are present in this mapping, use them, and 
only those.
 if (hasExternals())
 {
-for (ExternalHashMap::const_iterator it( 
mpExternalHashMap->begin());it != mpExternalHashMap->end(); ++it)
+for (ExternalHashMap::const_iterator it( 
maExternalHashMap.begin());it != maExternalHashMap.end(); ++it)
 {
 FormulaOpCodeMapEntry aEntry;
 aEntry.Name = (*it).first;
@@ -1059,8 +1059,6 @@ bool FormulaCompiler::IsMatrixFunction( OpCode eOpCode )
 
 FormulaCompiler::OpCodeMap::~OpCodeMap()
 {
-delete mpReverseExternalHashMap;
-delete mpExternalHashMap;
 delete [] mpTable;
 delete mpHashMap;
 }
diff --git a/include/formula/FormulaCompiler.hxx 
b/include/formula/FormulaCompiler.hxx
index 3c65b94973f3..22bd699e7811 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -80,8 +80,8 @@ public:
 {
 OpCodeHashMap * mpHashMap; /// Hash map of 
symbols, OUString -> OpCode
 OUString  * mpTable;   /// Array of 
symbols, OpCode -> OUString, offset==OpCode
-ExternalHashMap   * mpExternalHashMap; /// Hash map of 
ocExternal, Filter String -> AddIn String
-ExternalHashMap   * mpReverseExternalHashMap;  /// Hash map of 
ocExternal, AddIn String -> Filter String
+ExternalHashMap maExternalHashMap; /// Hash map of 
ocExternal, Filter String -> AddIn 

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

2017-04-03 Thread Jochen Nitschke
 formula/source/core/api/FormulaCompiler.cxx |2 +-
 include/formula/token.hxx   |   10 +-
 sc/inc/token.hxx|2 +-
 sc/qa/unit/ucalc_formula.cxx|   10 +-
 sc/qa/unit/ucalc_sharedformula.cxx  |2 +-
 sc/source/core/tool/interpr4.cxx|5 ++---
 sc/source/filter/excel/xeformula.cxx|2 +-
 7 files changed, 12 insertions(+), 21 deletions(-)

New commits:
commit b7b2c95fbc376ecea60b91e3e04fd52428258137
Author: Jochen Nitschke 
Date:   Sat Apr 1 10:05:30 2017 +0200

remove hack for non DBG_UTIL builds

always use a 8bit enum for StackVar

correct StackVar types for opcode opSep and opClose in unit test
and test them.

Change-Id: I89fac97d791eb12667ce5218ff31e798c8711e10
Reviewed-on: https://gerrit.libreoffice.org/36000
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index b70af7dc3152..09e355302105 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -318,7 +318,7 @@ bool isPotentialRangeType( FormulaToken* pToken, bool bRPN, 
bool bRight )
 return true;
 default:
 // Separators are not part of RPN and right opcodes need to be
-// other StackVarEnum types or functions and thus svByte.
+// other StackVar types or functions and thus svByte.
 return !bRPN && !bRight && isPotentialRangeLeftOp( 
pToken->GetOpCode());
 }
 }
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index 2de988e551b6..19d1b1bb5bdf 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -44,7 +44,7 @@ enum class FormulaError : sal_uInt16;
 namespace formula
 {
 
-enum StackVarEnum
+enum StackVar : sal_uInt8
 {
 svByte,
 svDouble,
@@ -80,14 +80,6 @@ enum StackVarEnum
 svUnknown   // unknown StackType
 };
 
-#ifndef DBG_UTIL
-// save memory since compilers tend to int an enum
-typedef sal_uInt8 StackVar;
-#else
-// have enum names in debugger
-typedef StackVarEnum StackVar;
-#endif
-
 // Only to be used for debugging output. No guarantee of stability of the
 // return value.
 inline std::string StackVarEnumToString(StackVar const e)
diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx
index 147bba46730d..7c082010ea93 100644
--- a/sc/inc/token.hxx
+++ b/sc/inc/token.hxx
@@ -320,7 +320,7 @@ public:
 {
 return xUpperLeft ?
 xUpperLeft->GetType() :
-
static_cast(formula::svUnknown);
+formula::svUnknown;
 }
 const formula::FormulaConstTokenRef& GetUpperLeftToken() const { return 
xUpperLeft; }
 void Assign( const ScMatrixCellResultToken & r );
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index a10f552933e6..81e2f2121185 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -1068,11 +1068,11 @@ void Test::testFormulaCompilerJumpReordering()
 TokenCheck aCheckRPN[] =
 {
 { ocPush,  svSingleRef },
-{ ocIf,static_cast(0) },
+{ ocIf,svUnknown   }, // type is context dependent, don't test 
it
 { ocPush,  svDouble},
-{ ocSep,   static_cast(0) },
+{ ocSep,   svSep   },
 { ocPush,  svString},
-{ ocClose, static_cast(0) },
+{ ocClose, svSep   },
 };
 
 sal_uInt16 nLen = pCode->GetCodeLen();
@@ -1083,7 +1083,7 @@ void Test::testFormulaCompilerJumpReordering()
 {
 const FormulaToken* p = ppTokens[i];
 CPPUNIT_ASSERT_EQUAL(aCheckRPN[i].meOp, p->GetOpCode());
-if (aCheckRPN[i].meOp == ocPush)
+if (aCheckRPN[i].meOp != ocIf )
 CPPUNIT_ASSERT_EQUAL(static_cast(aCheckRPN[i].meType), 
static_cast(p->GetType()));
 }
 
@@ -1099,7 +1099,7 @@ void Test::testFormulaCompilerJumpReordering()
 { ocPush,  svSingleRef },
 { ocPush,  svDouble},
 { ocPush,  svString},
-{ ocIf,static_cast(0) },
+{ ocIf,svUnknown   }, // type is context dependent, don't test 
it
 };
 
 nLen = pCode->GetCodeLen();
diff --git a/sc/qa/unit/ucalc_sharedformula.cxx 
b/sc/qa/unit/ucalc_sharedformula.cxx
index ecd253d86b66..1659c8b46166 100644
--- a/sc/qa/unit/ucalc_sharedformula.cxx
+++ b/sc/qa/unit/ucalc_sharedformula.cxx
@@ -1005,7 +1005,7 @@ void Test::testSharedFormulasDeleteColumns()
 const ScTokenArray* pCode = pFC->GetCode();
 

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

2017-02-20 Thread Winfried Donkers
 formula/source/core/resource/core_resource.src|6 
 include/formula/compiler.hrc  |3 
 include/formula/opcode.hxx|1 
 sc/inc/helpids.h  |1 
 sc/qa/unit/data/functions/mathematical/fods/roundsig.fods | 6580 ++
 sc/qa/unit/ucalc.cxx  |1 
 sc/source/core/data/funcdesc.cxx  |3 
 sc/source/core/inc/interpre.hxx   |1 
 sc/source/core/tool/interpr2.cxx  |   29 
 sc/source/core/tool/interpr4.cxx  |1 
 sc/source/filter/excel/xlformula.cxx  |3 
 sc/source/filter/oox/formulabase.cxx  |4 
 sc/source/ui/src/scfuncs.src  |   12 
 13 files changed, 6641 insertions(+), 4 deletions(-)

New commits:
commit 3ee1c41ac72aaae9f364708b1c4df58d7643a341
Author: Winfried Donkers 
Date:   Sun Feb 19 10:46:11 2017 +0100

tdf#105931 Add function ROUNDSIG to Calc.

SIGDIGITS rounds a value to a determined number of significant digits.

Change-Id: I5dbfb638bf17ca109f9a14b3588d6d6c103edfa4
Reviewed-on: https://gerrit.libreoffice.org/34148
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index e0addf7..5347eb0 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -458,6 +458,7 @@ StringArray RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 < "COM.MICROSOFT.ERFC.PRECISE" ; SC_OPCODE_ERFC_MS; >;
 < "COM.MICROSOFT.ENCODEURL" ; SC_OPCODE_ENCODEURL; >;
 < "ORG.LIBREOFFICE.RAWSUBTRACT" ; SC_OPCODE_RAWSUBTRACT; >;
+< "ORG.LIBREOFFICE.ROUNDSIG" ; SC_OPCODE_ROUNDSIG; >;
 };
 };
 
@@ -898,6 +899,7 @@ StringArray RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 < "_xlfn.ERFC.PRECISE" ; SC_OPCODE_ERFC_MS; >;
 < "_xlfn.ENCODEURL" ; SC_OPCODE_ENCODEURL; >;
 < "_xlfn.ORG.LIBREOFFICE.RAWSUBTRACT" ; SC_OPCODE_RAWSUBTRACT; >;
+< "_xlfn.ORG.LIBREOFFICE.ROUNDSIG" ; SC_OPCODE_ROUNDSIG; >;
 };
 };
 
@@ -1343,6 +1345,7 @@ StringArray RID_STRLIST_FUNCTION_NAMES_ENGLISH_PODF
 < "ERFC.PRECISE" ; SC_OPCODE_ERFC_MS; >;
 < "ENCODEURL" ; SC_OPCODE_ENCODEURL; >;
 < "RAWSUBTRACT" ; SC_OPCODE_RAWSUBTRACT; >;
+< "ROUNDSIG" ; SC_OPCODE_ROUNDSIG; >;
 };
 };
 
@@ -1787,6 +1790,7 @@ StringArray RID_STRLIST_FUNCTION_NAMES_ENGLISH_API
 < "ERFC.PRECISE" ; SC_OPCODE_ERFC_MS; >;
 < "ENCODEURL" ; SC_OPCODE_ENCODEURL; >;
 < "RAWSUBTRACT" ; SC_OPCODE_RAWSUBTRACT; >;
+< "ROUNDSIG" ; SC_OPCODE_ROUNDSIG; >;
 };
 };
 
@@ -2230,6 +2234,7 @@ StringArray RID_STRLIST_FUNCTION_NAMES_ENGLISH
 < "ERFC.PRECISE" ; SC_OPCODE_ERFC_MS; >;
 < "ENCODEURL" ; SC_OPCODE_ENCODEURL; >;
 < "RAWSUBTRACT" ; SC_OPCODE_RAWSUBTRACT; >;
+< "ROUNDSIG" ; SC_OPCODE_ROUNDSIG; >;
 };
 };
 
@@ -2683,6 +2688,7 @@ StringArray RID_STRLIST_FUNCTION_NAMES
 < "ERFC.PRECISE" ; SC_OPCODE_ERFC_MS ; >;
 < "ENCODEURL" ; SC_OPCODE_ENCODEURL ; >;
 < "RAWSUBTRACT" ; SC_OPCODE_RAWSUBTRACT ; >;
+< "ROUNDSIG" ; SC_OPCODE_ROUNDSIG; >;
 };
 };
 
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 92627cd..12fa1c4 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -501,7 +501,8 @@
 #define SC_OPCODE_SWITCH_MS 490
 #define SC_OPCODE_MINIFS_MS 491
 #define SC_OPCODE_MAXIFS_MS 492
-#define SC_OPCODE_STOP_2_PAR493 /* last function with two or more 
parameters' OpCode + 1 */
+#define SC_OPCODE_ROUNDSIG  493
+#define SC_OPCODE_STOP_2_PAR494 /* last function with two or more 
parameters' OpCode + 1 */
 
 #define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR/* last 
function's OpCode + 1 */
 #define SC_OPCODE_LAST_OPCODE_ID(SC_OPCODE_STOP_FUNCTION - 1)   /* last 
OpCode */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 13c85fb..9aa19d2 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -286,6 +286,7 @@ enum OpCode : sal_uInt16
 ocSwitch_MS = SC_OPCODE_SWITCH_MS,
 ocMinIfs_MS = SC_OPCODE_MINIFS_MS,
 ocMaxIfs_MS = SC_OPCODE_MAXIFS_MS,
+ocRoundSig  = SC_OPCODE_ROUNDSIG,
 // Database functions
 ocDBSum = SC_OPCODE_DB_SUM,
 ocDBCount   = SC_OPCODE_DB_COUNT,
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 7dfa4a6..6298137 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -596,5 +596,6 @@

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

2016-09-23 Thread Noel Grandin
 formula/source/core/api/FormulaCompiler.cxx|  108 ++--
 formula/source/core/api/token.cxx  |   16 
 include/formula/FormulaCompiler.hxx|7 
 include/formula/errorcodes.hxx |  106 ++--
 include/formula/token.hxx  |   13 
 include/formula/tokenarray.hxx |   12 
 sc/inc/addincol.hxx|4 
 sc/inc/column.hxx  |6 
 sc/inc/compiler.hxx|6 
 sc/inc/dociter.hxx |   12 
 sc/inc/document.hxx|9 
 sc/inc/formulacell.hxx |   12 
 sc/inc/formularesult.hxx   |   14 
 sc/inc/global.hxx  |   11 
 sc/inc/math.hxx|2 
 sc/inc/rangenam.hxx|2 
 sc/inc/scmatrix.hxx|   19 
 sc/inc/simpleformulacalc.hxx   |2 
 sc/inc/table.hxx   |9 
 sc/qa/unit/helper/qahelper.cxx |4 
 sc/qa/unit/helper/shared_test_impl.hxx |5 
 sc/qa/unit/subsequent_filters-test.cxx |6 
 sc/qa/unit/ucalc.cxx   |   10 
 sc/qa/unit/ucalc_formula.cxx   |   48 -
 sc/qa/unit/ucalc_pivottable.cxx|6 
 sc/source/core/data/clipcontext.cxx|5 
 sc/source/core/data/column.cxx |   23 
 sc/source/core/data/column2.cxx|   24 
 sc/source/core/data/column3.cxx|   18 
 sc/source/core/data/conditio.cxx   |3 
 sc/source/core/data/dbdocutl.cxx   |2 
 sc/source/core/data/dociter.cxx|   32 -
 sc/source/core/data/documen2.cxx   |2 
 sc/source/core/data/documen4.cxx   |   10 
 sc/source/core/data/document.cxx   |   12 
 sc/source/core/data/dpcache.cxx|3 
 sc/source/core/data/dpoutput.cxx   |2 
 sc/source/core/data/formulacell.cxx|  117 ++--
 sc/source/core/data/global.cxx |  113 ++--
 sc/source/core/data/global2.cxx|   12 
 sc/source/core/data/simpleformulacalc.cxx  |   16 
 sc/source/core/data/table2.cxx |2 
 sc/source/core/data/table3.cxx |6 
 sc/source/core/data/table4.cxx |   10 
 sc/source/core/data/validat.cxx|8 
 sc/source/core/inc/doubleref.hxx   |7 
 sc/source/core/inc/interpre.hxx|   38 -
 sc/source/core/opencl/formulagroupcl.cxx   |   16 
 sc/source/core/opencl/op_statistical.cxx   |   12 
 sc/source/core/tool/addincol.cxx   |   26 -
 sc/source/core/tool/cellform.cxx   |8 
 sc/source/core/tool/chartarr.cxx   |3 
 sc/source/core/tool/compiler.cxx   |  134 ++---
 sc/source/core/tool/consoli.cxx|2 
 sc/source/core/tool/detfunc.cxx|7 
 sc/source/core/tool/doubleref.cxx  |8 
 sc/source/core/tool/formularesult.cxx  |   36 -
 sc/source/core/tool/interpr1.cxx   |  606 -
 sc/source/core/tool/interpr2.cxx   |  156 +++---
 sc/source/core/tool/interpr3.cxx   |  196 
 sc/source/core/tool/interpr4.cxx   |  386 +++
 sc/source/core/tool/interpr5.cxx   |  156 +++---
 sc/source/core/tool/interpr6.cxx   |   94 +--
 sc/source/core/tool/interpr7.cxx   |   28 -
 sc/source/core/tool/interpr8.cxx   |   80 +--
 sc/source/core/tool/jumpmatrix.cxx |6 
 sc/source/core/tool/rangenam.cxx   |   12 
 sc/source/core/tool/rangeseq.cxx   |8 
 sc/source/core/tool/scmatrix.cxx   |   92 +--
 sc/source/core/tool/token.cxx  |   22 
 sc/source/filter/dif/difexp.cxx|3 
 sc/source/filter/excel/excform.cxx |   38 -
 sc/source/filter/excel/xeformula.cxx   |7 
 sc/source/filter/excel/xehelper.cxx|3 
 sc/source/filter/excel/xelink.cxx  |2 
 sc/source/filter/excel/xestream.cxx|2 
 sc/source/filter/excel/xetable.cxx |5 
 sc/source/filter/excel/xihelper.cxx|4 
 sc/source/filter/excel/xltools.cxx |   55 +-
 sc/source/filter/inc/scflt.hxx |6 
 sc/source/filter/inc/xihelper.hxx  |2 
 sc/source/filter/inc/xltools.hxx   |5 
 sc/source/filter/oox/defnamesbuffer.cxx|2 
 sc/source/filter/starcalc/scflt.cxx|3 
 sc/source/filter/xml/xmlexprt.cxx  |3 
 sc/source/filter/xml/xmlimprt.cxx  |3 
 sc/source/ui/app/inputhdl.cxx  |5 
 sc/source/ui/app/scmod.cxx 

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

2016-08-03 Thread Eike Rathke
 formula/source/core/resource/core_resource.src |   12 ++--
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |4 ++--
 sc/source/core/opencl/op_financial.cxx |2 +-
 sc/source/core/opencl/op_financial.hxx |2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/qpro/qproform.cxx |2 +-
 sc/source/ui/src/scfuncs.src   |4 ++--
 13 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 3bc16f4a476f22935bd128cef797fb2d69758294
Author: Eike Rathke 
Date:   Wed Aug 3 16:38:24 2016 +0200

rename ocDuration to ocPDuration and related

... to clarify that these belong to PDURATION (currently DURATION in UI)
instead of DURATION (currently DURATION_ADD in UI). The confusing UI name
situation will be resolved separately.

Change-Id: I09a7bc8437be1c4c9e72f94e61c877111fb48806

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 1cb0f35..d8cd84f 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -226,7 +226,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_DDB { Text = "DDB" ; };
 String SC_OPCODE_DB { Text = "DB" ; };
 String SC_OPCODE_VBD { Text = "VDB" ; };
-String SC_OPCODE_DURATION { Text = "PDURATION" ; };
+String SC_OPCODE_PDURATION { Text = "PDURATION" ; };
 String SC_OPCODE_SLN { Text = "SLN" ; };
 String SC_OPCODE_PMT { Text = "PMT" ; };
 String SC_OPCODE_COLUMNS { Text = "COLUMNS" ; };
@@ -664,7 +664,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_DDB { Text = "DDB" ; };
 String SC_OPCODE_DB { Text = "DB" ; };
 String SC_OPCODE_VBD { Text = "VDB" ; };
-String SC_OPCODE_DURATION { Text = "_xlfn.PDURATION" ; };
+String SC_OPCODE_PDURATION { Text = "_xlfn.PDURATION" ; };
 String SC_OPCODE_SLN { Text = "SLN" ; };
 String SC_OPCODE_PMT { Text = "PMT" ; };
 String SC_OPCODE_COLUMNS { Text = "COLUMNS" ; };
@@ -1106,7 +1106,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_PODF
 String SC_OPCODE_DDB { Text = "DDB" ; };
 String SC_OPCODE_DB { Text = "DB" ; };
 String SC_OPCODE_VBD { Text = "VDB" ; };
-String SC_OPCODE_DURATION { Text = "DURATION" ; };
+String SC_OPCODE_PDURATION { Text = "DURATION" ; };
 String SC_OPCODE_SLN { Text = "SLN" ; };
 String SC_OPCODE_PMT { Text = "PMT" ; };
 String SC_OPCODE_COLUMNS { Text = "COLUMNS" ; };
@@ -1548,7 +1548,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_API
 String SC_OPCODE_DDB { Text = "DDB" ; };
 String SC_OPCODE_DB { Text = "DB" ; };
 String SC_OPCODE_VBD { Text = "VDB" ; };
-String SC_OPCODE_DURATION { Text = "DURATION" ; };
+String SC_OPCODE_PDURATION { Text = "DURATION" ; };
 String SC_OPCODE_SLN { Text = "SLN" ; };
 String SC_OPCODE_PMT { Text = "PMT" ; };
 String SC_OPCODE_COLUMNS { Text = "COLUMNS" ; };
@@ -1989,7 +1989,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_DDB { Text = "DDB" ; };
 String SC_OPCODE_DB { Text = "DB" ; };
 String SC_OPCODE_VBD { Text = "VDB" ; };
-String SC_OPCODE_DURATION { Text = "DURATION" ; };
+String SC_OPCODE_PDURATION { Text = "DURATION" ; };
 String SC_OPCODE_SLN { Text = "SLN" ; };
 String SC_OPCODE_PMT { Text = "PMT" ; };
 String SC_OPCODE_COLUMNS { Text = "COLUMNS" ; };
@@ -2967,7 +2967,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = "VDB" ;
 };
-String SC_OPCODE_DURATION
+String SC_OPCODE_PDURATION
 {
 Text [ en-US ] = "DURATION" ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index ccba5df..915cea4 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -257,7 +257,7 @@
 #define SC_OPCODE_DDB   246
 #define SC_OPCODE_DB247
 #define SC_OPCODE_VBD   248
-#define SC_OPCODE_DURATION  249
+#define SC_OPCODE_PDURATION 249
 #define SC_OPCODE_SLN   250
 #define SC_OPCODE_PMT   251
 #define SC_OPCODE_COLUMNS   252
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index c06a992..bfc7ac6 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -263,7 +263,7 @@ enum OpCode : sal_uInt16
 ocDDB   = SC_OPCODE_DDB,
 ocDB= SC_OPCODE_DB,
 ocVBD   = SC_OPCODE_VBD,
-ocDuration  = 

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

2016-06-27 Thread Eike Rathke
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/tool/compiler.cxx   |2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/ui/src/scfuncs.src   |4 ++--
 10 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit d480e5c7f68d61cf51c233f62c07293f212b9f4a
Author: Eike Rathke 
Date:   Mon Jun 27 15:59:40 2016 +0200

rename *effective to *effect, tdf#100641 related

... to unify naming.

Change-Id: I0964822d53eafd69ea4ed0656dfdfcb3f5bfd561

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 675da4b..1379cba 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -109,7 +109,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 case ocIRR:
 case ocMIRR:
 case ocRRI:
-case ocEffective:
+case ocEffect:
 case ocNominal:
 case ocPercentSign:
 return css::util::NumberFormat::PERCENT;
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index c781fa0..2124218a 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -238,7 +238,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_PPMT { Text = "PPMT" ; };
 String SC_OPCODE_CUM_IPMT { Text = "CUMIPMT" ; };
 String SC_OPCODE_CUM_PRINC { Text = "CUMPRINC" ; };
-String SC_OPCODE_EFFECTIVE { Text = "EFFECT" ; };
+String SC_OPCODE_EFFECT { Text = "EFFECT" ; };
 String SC_OPCODE_NOMINAL { Text = "NOMINAL" ; };
 String SC_OPCODE_SUB_TOTAL { Text = "SUBTOTAL" ; };
 String SC_OPCODE_DB_SUM { Text = "DSUM" ; };
@@ -678,7 +678,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_PPMT { Text = "PPMT" ; };
 String SC_OPCODE_CUM_IPMT { Text = "CUMIPMT" ; };
 String SC_OPCODE_CUM_PRINC { Text = "CUMPRINC" ; };
-String SC_OPCODE_EFFECTIVE { Text = "EFFECT" ; };
+String SC_OPCODE_EFFECT { Text = "EFFECT" ; };
 String SC_OPCODE_NOMINAL { Text = "NOMINAL" ; };
 String SC_OPCODE_SUB_TOTAL { Text = "SUBTOTAL" ; };
 String SC_OPCODE_DB_SUM { Text = "DSUM" ; };
@@ -1118,7 +1118,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_PPMT { Text = "PPMT" ; };
 String SC_OPCODE_CUM_IPMT { Text = "CUMIPMT" ; };
 String SC_OPCODE_CUM_PRINC { Text = "CUMPRINC" ; };
-String SC_OPCODE_EFFECTIVE { Text = "EFFECTIVE" ; };
+String SC_OPCODE_EFFECT { Text = "EFFECTIVE" ; };
 String SC_OPCODE_NOMINAL { Text = "NOMINAL" ; };
 String SC_OPCODE_SUB_TOTAL { Text = "SUBTOTAL" ; };
 String SC_OPCODE_DB_SUM { Text = "DSUM" ; };
@@ -2142,7 +2142,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = "CUMPRINC" ;
 };
-String SC_OPCODE_EFFECTIVE
+String SC_OPCODE_EFFECT
 {
 Text [ en-US ] = "EFFECT" ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 7a7bfe7..ccba5df 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -272,7 +272,7 @@
 #define SC_OPCODE_PPMT  261
 #define SC_OPCODE_CUM_IPMT  262
 #define SC_OPCODE_CUM_PRINC 263
-#define SC_OPCODE_EFFECTIVE 264
+#define SC_OPCODE_EFFECT264
 #define SC_OPCODE_NOMINAL   265
 #define SC_OPCODE_SUB_TOTAL 266
 #define SC_OPCODE_DB_SUM267 /* database functions */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 30dc94f..c06a992 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -278,7 +278,7 @@ enum OpCode : sal_uInt16
 ocPpmt  = SC_OPCODE_PPMT,
 ocCumIpmt   = SC_OPCODE_CUM_IPMT,
 ocCumPrinc  = SC_OPCODE_CUM_PRINC,
-ocEffective = SC_OPCODE_EFFECTIVE,
+ocEffect= SC_OPCODE_EFFECT,
 ocNominal   = SC_OPCODE_NOMINAL,
 ocSubTotal  = SC_OPCODE_SUB_TOTAL,
 ocRawSubtract   = SC_OPCODE_RAWSUBTRACT,
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 3ed275a..c0af821 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -760,7 +760,7 @@ void ScIpmt();
 void ScPpmt();
 void ScCumIpmt();
 void ScCumPrinc();
-void ScEffective();
+void ScEffect();
 void ScNominal();
 void ScMod();
 void ScIntercept();
diff --git a/sc/source/core/tool/compiler.cxx 

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

2016-06-21 Thread Jorenz Paragas
 formula/source/core/api/FormulaOpCodeMapperObj.cxx |1 
 formula/source/core/api/token.cxx  |1 
 formula/source/ui/dlg/FormulaHelper.cxx|1 
 formula/source/ui/dlg/formula.cxx  |2 +
 formula/source/ui/dlg/funcutl.cxx  |1 
 include/formula/ExternalReferenceHelper.hxx|5 +++-
 include/formula/FormulaCompiler.hxx|   21 
 include/formula/FormulaOpCodeMapperObj.hxx |   26 -
 include/formula/IControlReferenceHandler.hxx   |1 
 include/formula/IFunctionDescription.hxx   |   18 +-
 include/formula/errorcodes.hxx |2 +
 include/formula/formdata.hxx   |2 +
 include/formula/formula.hxx|   20 +---
 include/formula/formulahelper.hxx  |   12 ++---
 include/formula/funcutl.hxx|   15 ++--
 include/formula/grammar.hxx|1 
 include/formula/token.hxx  |   14 +--
 include/formula/tokenarray.hxx |   23 --
 include/formula/vectortoken.hxx|5 
 sc/source/core/tool/token.cxx  |1 
 20 files changed, 126 insertions(+), 46 deletions(-)

New commits:
commit 8a6bffd2fefcc81dc34951ba2e178d9938b59fb3
Author: Jorenz Paragas 
Date:   Thu Jun 16 18:59:35 2016 -0700

tdf#42949: clean up includes in include/formula with iwyu

Change-Id: Ieb601d98be80aeb2239d4f0a330d90e63f1abc43
Reviewed-on: https://gerrit.libreoffice.org/26398
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/formula/source/core/api/FormulaOpCodeMapperObj.cxx 
b/formula/source/core/api/FormulaOpCodeMapperObj.cxx
index 55bdc9e..c034b64 100644
--- a/formula/source/core/api/FormulaOpCodeMapperObj.cxx
+++ b/formula/source/core/api/FormulaOpCodeMapperObj.cxx
@@ -21,6 +21,7 @@
 
 #include 
 
+#include 
 #include "formula/FormulaOpCodeMapperObj.hxx"
 #include "formula/opcode.hxx"
 #include 
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 9c16870..3c3bdc5 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 
+#include 
 #include "formula/token.hxx"
 #include "formula/tokenarray.hxx"
 #include "formula/FormulaCompiler.hxx"
diff --git a/formula/source/ui/dlg/FormulaHelper.cxx 
b/formula/source/ui/dlg/FormulaHelper.cxx
index 2ffe25e..4e6c6c8 100644
--- a/formula/source/ui/dlg/FormulaHelper.cxx
+++ b/formula/source/ui/dlg/FormulaHelper.cxx
@@ -20,6 +20,7 @@
 #include 
 
 #include "formula/formulahelper.hxx"
+#include 
 #include 
 #include 
 
diff --git a/formula/source/ui/dlg/formula.cxx 
b/formula/source/ui/dlg/formula.cxx
index b0925fb..1174677 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -57,6 +57,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/formula/source/ui/dlg/funcutl.cxx 
b/formula/source/ui/dlg/funcutl.cxx
index 9052d7c..d67bb00 100644
--- a/formula/source/ui/dlg/funcutl.cxx
+++ b/formula/source/ui/dlg/funcutl.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "formula/funcutl.hxx"
 #include "formula/IControlReferenceHandler.hxx"
diff --git a/include/formula/ExternalReferenceHelper.hxx 
b/include/formula/ExternalReferenceHelper.hxx
index 6c93286..364307f 100644
--- a/include/formula/ExternalReferenceHelper.hxx
+++ b/include/formula/ExternalReferenceHelper.hxx
@@ -20,8 +20,11 @@
 #ifndef INCLUDED_FORMULA_EXTERNALREFERENCEHELPER_HXX
 #define INCLUDED_FORMULA_EXTERNALREFERENCEHELPER_HXX
 
-#include 
+#include 
+
 #include 
+#include 
+#include 
 
 namespace formula
 {
diff --git a/include/formula/FormulaCompiler.hxx 
b/include/formula/FormulaCompiler.hxx
index fc912fc..adad03f 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -20,20 +20,21 @@
 #ifndef INCLUDED_FORMULA_FORMULACOMPILER_HXX
 #define INCLUDED_FORMULA_FORMULACOMPILER_HXX
 
-#include 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 
 #include 
-
-#include 
+#include 
 #include 
+#include 
 #include 
-#include 
-
-#include 
-#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 #define FORMULA_MAXJUMPCOUNT32  /* maximum number of jumps (ocChoose) */
 #define FORMULA_MAXTOKENS 8192  /* maximum number of tokens in formula */
diff --git a/include/formula/FormulaOpCodeMapperObj.hxx 
b/include/formula/FormulaOpCodeMapperObj.hxx
index 1cfc40c..fdf28eb 100644
--- a/include/formula/FormulaOpCodeMapperObj.hxx
+++ b/include/formula/FormulaOpCodeMapperObj.hxx
@@ -20,18 +20,32 @@
 #ifndef INCLUDED_FORMULA_FORMULAOPCODEMAPPEROBJ_HXX
 #define 

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

2016-05-27 Thread Eike Rathke
 formula/source/core/api/token.cxx |   50 +-
 include/formula/tokenarray.hxx|2 +
 2 files changed, 46 insertions(+), 6 deletions(-)

New commits:
commit a88ee01b8683ded7d9da6dbcbf4d3e0c2ed4cadc
Author: Eike Rathke 
Date:   Fri May 27 18:05:01 2016 +0200

omit DCOUNT or DCOUNTA 2nd argument if 0 when writing ODFF or OOXML, 
tdf#70806

Change-Id: I2833a1005c6941e66a09172b337e23b0bf7f2002

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 2c61386..e79b526 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1005,6 +1005,9 @@ inline bool MissingConventionODF::isRewriteNeeded( OpCode 
eOp ) const
 case ocMissing:
 case ocLog:
 return isPODF();// rewrite only for PODF
+case ocDBCount:
+case ocDBCount2:
+return isODFF();// rewrite only for ODFF
 default:
 return false;
 }
@@ -1041,6 +1044,9 @@ inline bool MissingConventionOOXML::isRewriteNeeded( 
OpCode eOp )
 case ocPoissonDist:
 case ocNormDist:
 case ocLogNormDist:
+
+case ocDBCount:
+case ocDBCount2:
 return true;
 default:
 return false;
@@ -1328,15 +1334,26 @@ FormulaTokenArray * FormulaTokenArray::RewriteMissing( 
const MissingConvention &
 {
 const size_t nAlloc = 256;
 FormulaMissingContext aCtx[ nAlloc ];
+
+/* TODO: with some effort we might be able to merge the two almost
+ * identical function stacks into one and generalize things, otherwise
+ * adding yet another "omit argument" would be copypasta. */
+
 int aOpCodeAddressStack[ nAlloc ];  // use of ADDRESS() function
 const int nOmitAddressArg = 3;  // ADDRESS() 4th parameter A1/R1C1
+
+int aOpCodeDcountStack[ nAlloc ];   // use of DCOUNT()/DCOUNTA() function
+const int nOmitDcountArg = 1;   // DCOUNT() and DCOUNTA() 2nd 
parameter DatabaseField if 0
+
 sal_uInt16 nTokens = GetLen() + 1;
 FormulaMissingContext* pCtx = (nAlloc < nTokens ? new 
FormulaMissingContext[nTokens] : [0]);
 int* pOcas = (nAlloc < nTokens ? new int[nTokens] : 
[0]);
+int* pOcds = (nAlloc < nTokens ? new int[nTokens] : 
[0]);
 // Never go below 0, never use 0, mpFunc always NULL.
 pCtx[0].Clear();
 int nFn = 0;
 int nOcas = 0;
+int nOcds = 0;
 
 FormulaTokenArray *pNewArr = new FormulaTokenArray;
 // At least ScRecalcMode::ALWAYS needs to be set.
@@ -1361,20 +1378,39 @@ FormulaTokenArray * FormulaTokenArray::RewriteMissing( 
const MissingConvention &
 bAdd = false;
 }
 }
+// Strip the 2nd argument (leaving empty) of DCOUNT() and DCOUNTA() if
+// it is 0.
+for (int i = nOcds; i-- > 0 && bAdd; )
+{
+if (pCtx[ pOcds[ i ] ].mnCurArg == nOmitDcountArg)
+{
+// Omit only a literal 0 value, nothing else.
+if (pOcds[ i ] == nFn && pCur->GetOpCode() == ocPush && 
pCur->GetDouble() == 0.0)
+bAdd = false;
+}
+}
 switch ( pCur->GetOpCode() )
 {
 case ocOpen:
-++nFn;  // all following operations on _that_ function
-pCtx[ nFn ].mpFunc = PeekPrevNoSpaces();
-pCtx[ nFn ].mnCurArg = 0;
-if (rConv.isPODF() && pCtx[ nFn ].mpFunc && pCtx[ nFn 
].mpFunc->GetOpCode() == ocAddress)
-pOcas[ nOcas++ ] = nFn; // entering ADDRESS() if PODF
-break;
+{
+++nFn;  // all following operations on _that_ function
+pCtx[ nFn ].mpFunc = PeekPrevNoSpaces();
+pCtx[ nFn ].mnCurArg = 0;
+OpCode eOp;
+if (rConv.isPODF() && pCtx[ nFn ].mpFunc && pCtx[ nFn 
].mpFunc->GetOpCode() == ocAddress)
+pOcas[ nOcas++ ] = nFn; // entering ADDRESS() if 
PODF
+else if ((rConv.isODFF() || rConv.isOOXML()) && pCtx[ nFn 
].mpFunc &&
+((eOp = pCtx[ nFn ].mpFunc->GetOpCode()) == 
ocDBCount || eOp == ocDBCount2))
+pOcds[ nOcds++ ] = nFn; // entering DCOUNT() or 
DCOUNTA() if ODFF or OOXML
+}
+break;
 case ocClose:
 pCtx[ nFn ].AddMoreArgs( pNewArr, rConv );
 SAL_WARN_IF(nFn <= 0, "formula.core", 
"FormulaTokenArray::RewriteMissing: underflow");
 if (nOcas > 0 && pOcas[ nOcas-1 ] == nFn)
 --nOcas;// leaving ADDRESS()
+else if (nOcds > 0 && pOcds[ nOcds-1 ] == nFn)
+--nOcds;// leaving DCOUNT() or 
DCOUNTA()
 if (nFn > 0)
 --nFn;
 break;
@@ -1423,6 

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

2016-05-04 Thread Winfried Donkers
 formula/source/core/resource/core_resource.src |   14 
 include/formula/compiler.hrc   |4 -
 include/formula/opcode.hxx |2 
 sc/inc/helpids.h   |2 
 sc/qa/unit/ucalc.cxx   |2 
 sc/source/core/inc/interpre.hxx|6 +
 sc/source/core/tool/interpr1.cxx   |   14 
 sc/source/core/tool/interpr4.cxx   |2 
 sc/source/core/tool/interpr8.cxx   |   12 +++
 sc/source/filter/excel/xlformula.cxx   |4 -
 sc/source/filter/oox/formulabase.cxx   |4 -
 sc/source/ui/src/scfuncs.src   |   78 +
 12 files changed, 139 insertions(+), 5 deletions(-)

New commits:
commit c57dc741a6f221f53f3c8da2f521c6ece63246c2
Author: Winfried Donkers 
Date:   Tue May 3 21:19:19 2016 +0200

tdf#97831 [part] Add Excel 2016 functions to Calc

Functions MINIFS and MAXIFS

Change-Id: I4bd2e8b82f8377af81f4373d0c33ac286588b8df
Reviewed-on: https://gerrit.libreoffice.org/24619
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index acc6ba8..551de2f 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -291,6 +291,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_TEXTJOIN_MS { Text = "COM.MICROSOFT.TEXTJOIN" ; };
 String SC_OPCODE_IFS_MS { Text = "COM.MICROSOFT.IFS" ; };
 String SC_OPCODE_SWITCH_MS { Text = "COM.MICROSOFT.SWITCH" ; };
+String SC_OPCODE_MINIFS_MS { Text = "COM.MICROSOFT.MINIFS" ; };
+String SC_OPCODE_MAXIFS_MS { Text = "COM.MICROSOFT.MAXIFS" ; };
 String SC_OPCODE_MAT_VALUE { Text = "MVALUE" ; };
 String SC_OPCODE_MAT_DET { Text = "MDETERM" ; };
 String SC_OPCODE_MAT_INV { Text = "MINVERSE" ; };
@@ -729,6 +731,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_TEXTJOIN_MS { Text = "_xlfn.TEXTJOIN" ; };
 String SC_OPCODE_IFS_MS { Text = "_xlfn.IFS" ; };
 String SC_OPCODE_SWITCH_MS { Text = "_xlfn.SWITCH" ; };
+String SC_OPCODE_MINIFS_MS { Text = "_xlfn.MINIFS" ; };
+String SC_OPCODE_MAXIFS_MS { Text = "_xlfn.MAXIFS" ; };
 String SC_OPCODE_MAT_VALUE { Text = "MVALUE" ; };
 String SC_OPCODE_MAT_DET { Text = "MDETERM" ; };
 String SC_OPCODE_MAT_INV { Text = "MINVERSE" ; };
@@ -1167,6 +1171,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_TEXTJOIN_MS { Text = "TEXTJOIN" ; };
 String SC_OPCODE_IFS_MS { Text = "IFS" ; };
 String SC_OPCODE_SWITCH_MS { Text = "SWITCH" ; };
+String SC_OPCODE_MINIFS_MS { Text = "MINIFS" ; };
+String SC_OPCODE_MAXIFS_MS { Text = "MAXIFS" ; };
 String SC_OPCODE_MAT_VALUE { Text = "MVALUE" ; };
 String SC_OPCODE_MAT_DET { Text = "MDETERM" ; };
 String SC_OPCODE_MAT_INV { Text = "MINVERSE" ; };
@@ -2349,6 +2355,14 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = "SWITCH" ;
 };
+String SC_OPCODE_MINIFS_MS
+{
+Text [ en-US ] = "MINIFS" ;
+};
+String SC_OPCODE_MAXIFS_MS
+{
+Text [ en-US ] = "MAXIFS" ;
+};
 String SC_OPCODE_MAT_VALUE
 {
 Text [ en-US ] = "MVALUE" ;
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 0bb8360..7a7bfe7 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -499,7 +499,9 @@
 #define SC_OPCODE_TEXTJOIN_MS   488
 #define SC_OPCODE_IFS_MS489
 #define SC_OPCODE_SWITCH_MS 490
-#define SC_OPCODE_STOP_2_PAR491 /* last function with two or more 
parameters' OpCode + 1 */
+#define SC_OPCODE_MINIFS_MS 491
+#define SC_OPCODE_MAXIFS_MS 492
+#define SC_OPCODE_STOP_2_PAR493 /* last function with two or more 
parameters' OpCode + 1 */
 
 #define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR/* last 
function's OpCode + 1 */
 #define SC_OPCODE_LAST_OPCODE_ID(SC_OPCODE_STOP_FUNCTION - 1)   /* last 
OpCode */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index facaaab..30dc94f 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -284,6 +284,8 @@ enum OpCode : sal_uInt16
 ocRawSubtract   = SC_OPCODE_RAWSUBTRACT,
 ocIfs_MS= SC_OPCODE_IFS_MS,
 ocSwitch_MS = SC_OPCODE_SWITCH_MS,
+ocMinIfs_MS = SC_OPCODE_MINIFS_MS,
+ocMaxIfs_MS = SC_OPCODE_MAXIFS_MS,
 // Database functions
 ocDBSum = SC_OPCODE_DB_SUM,
 ocDBCount   = SC_OPCODE_DB_COUNT,
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index db24bed..9c15904 100644
--- a/sc/inc/helpids.h
+++ 

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

2016-05-03 Thread Winfried Donkers
 formula/source/core/resource/core_resource.src |   14 ++
 include/formula/compiler.hrc   |4 
 include/formula/opcode.hxx |2 
 sc/inc/helpids.h   |2 
 sc/qa/unit/ucalc.cxx   |2 
 sc/source/core/inc/interpre.hxx|4 
 sc/source/core/tool/interpr4.cxx   |   16 ++
 sc/source/core/tool/interpr8.cxx   |  162 +
 sc/source/filter/excel/xlformula.cxx   |4 
 sc/source/filter/oox/formulabase.cxx   |4 
 sc/source/ui/src/scfuncs.src   |   72 +++
 11 files changed, 283 insertions(+), 3 deletions(-)

New commits:
commit 29433c6496e8aa2d82ce56731d4bb734538a9f80
Author: Winfried Donkers 
Date:   Wed Apr 27 13:09:27 2016 +0200

tdf#97831 [part] Add Excel 2016 functions to Calc

Functions IFS and SWITCH.

Change-Id: Ic43d42a933bcac883e9aa2213dd4ddeddf45abf0
Reviewed-on: https://gerrit.libreoffice.org/24424
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index b966192..acc6ba8 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -289,6 +289,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_CONCAT { Text = "CONCATENATE" ; };
 String SC_OPCODE_CONCAT_MS { Text = "COM.MICROSOFT.CONCAT" ; };
 String SC_OPCODE_TEXTJOIN_MS { Text = "COM.MICROSOFT.TEXTJOIN" ; };
+String SC_OPCODE_IFS_MS { Text = "COM.MICROSOFT.IFS" ; };
+String SC_OPCODE_SWITCH_MS { Text = "COM.MICROSOFT.SWITCH" ; };
 String SC_OPCODE_MAT_VALUE { Text = "MVALUE" ; };
 String SC_OPCODE_MAT_DET { Text = "MDETERM" ; };
 String SC_OPCODE_MAT_INV { Text = "MINVERSE" ; };
@@ -725,6 +727,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_CONCAT { Text = "CONCATENATE" ; };
 String SC_OPCODE_CONCAT_MS { Text = "_xlfn.CONCAT" ; };
 String SC_OPCODE_TEXTJOIN_MS { Text = "_xlfn.TEXTJOIN" ; };
+String SC_OPCODE_IFS_MS { Text = "_xlfn.IFS" ; };
+String SC_OPCODE_SWITCH_MS { Text = "_xlfn.SWITCH" ; };
 String SC_OPCODE_MAT_VALUE { Text = "MVALUE" ; };
 String SC_OPCODE_MAT_DET { Text = "MDETERM" ; };
 String SC_OPCODE_MAT_INV { Text = "MINVERSE" ; };
@@ -1161,6 +1165,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_CONCAT { Text = "CONCATENATE" ; };
 String SC_OPCODE_CONCAT_MS { Text = "CONCAT" ; };
 String SC_OPCODE_TEXTJOIN_MS { Text = "TEXTJOIN" ; };
+String SC_OPCODE_IFS_MS { Text = "IFS" ; };
+String SC_OPCODE_SWITCH_MS { Text = "SWITCH" ; };
 String SC_OPCODE_MAT_VALUE { Text = "MVALUE" ; };
 String SC_OPCODE_MAT_DET { Text = "MDETERM" ; };
 String SC_OPCODE_MAT_INV { Text = "MINVERSE" ; };
@@ -2335,6 +2341,14 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = "TEXTJOIN" ;
 };
+String SC_OPCODE_IFS_MS
+{
+Text [ en-US ] = "IFS" ;
+};
+String SC_OPCODE_SWITCH_MS
+{
+Text [ en-US ] = "SWITCH" ;
+};
 String SC_OPCODE_MAT_VALUE
 {
 Text [ en-US ] = "MVALUE" ;
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 034b165..0bb8360 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -497,7 +497,9 @@
 #define SC_OPCODE_FORECAST_LIN  486
 #define SC_OPCODE_CONCAT_MS 487
 #define SC_OPCODE_TEXTJOIN_MS   488
-#define SC_OPCODE_STOP_2_PAR489 /* last function with two or more 
parameters' OpCode + 1 */
+#define SC_OPCODE_IFS_MS489
+#define SC_OPCODE_SWITCH_MS 490
+#define SC_OPCODE_STOP_2_PAR491 /* last function with two or more 
parameters' OpCode + 1 */
 
 #define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR/* last 
function's OpCode + 1 */
 #define SC_OPCODE_LAST_OPCODE_ID(SC_OPCODE_STOP_FUNCTION - 1)   /* last 
OpCode */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 1bf955f..facaaab 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -282,6 +282,8 @@ enum OpCode : sal_uInt16
 ocNominal   = SC_OPCODE_NOMINAL,
 ocSubTotal  = SC_OPCODE_SUB_TOTAL,
 ocRawSubtract   = SC_OPCODE_RAWSUBTRACT,
+ocIfs_MS= SC_OPCODE_IFS_MS,
+ocSwitch_MS = SC_OPCODE_SWITCH_MS,
 // Database functions
 ocDBSum = SC_OPCODE_DB_SUM,
 ocDBCount   = SC_OPCODE_DB_COUNT,
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 29b22bb..db24bed 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -638,5 +638,7 @@
 #define HID_FUNC_FORECAST_LIN

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

2016-04-26 Thread Winfried Donkers
 formula/source/core/resource/core_resource.src |   14 
 include/formula/compiler.hrc   |4 
 include/formula/opcode.hxx |2 
 sc/inc/helpids.h   |2 
 sc/qa/unit/ucalc.cxx   |2 
 sc/source/core/inc/interpre.hxx|2 
 sc/source/core/tool/interpr4.cxx   |2 
 sc/source/core/tool/interpr8.cxx   |  464 +
 sc/source/filter/excel/xlformula.cxx   |5 
 sc/source/filter/oox/formulabase.cxx   |5 
 sc/source/ui/src/scfuncs.src   |   64 +++
 11 files changed, 563 insertions(+), 3 deletions(-)

New commits:
commit a76c5e21378e5364f1f7554a32d89072feff8b0c
Author: Winfried Donkers 
Date:   Tue Mar 29 19:03:43 2016 +0200

tdf#97831 [part] Add Excel 2016-Office 365 functions to Calc

Functions CONCAT and TEXTJOIN.

Change-Id: I38092f77df719d11f6746ac10fe14dc53b7e93e7
Reviewed-on: https://gerrit.libreoffice.org/23601
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index bf49624..b966192 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -287,6 +287,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_SUBSTITUTE { Text = "SUBSTITUTE" ; };
 String SC_OPCODE_REPT { Text = "REPT" ; };
 String SC_OPCODE_CONCAT { Text = "CONCATENATE" ; };
+String SC_OPCODE_CONCAT_MS { Text = "COM.MICROSOFT.CONCAT" ; };
+String SC_OPCODE_TEXTJOIN_MS { Text = "COM.MICROSOFT.TEXTJOIN" ; };
 String SC_OPCODE_MAT_VALUE { Text = "MVALUE" ; };
 String SC_OPCODE_MAT_DET { Text = "MDETERM" ; };
 String SC_OPCODE_MAT_INV { Text = "MINVERSE" ; };
@@ -721,6 +723,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_SUBSTITUTE { Text = "SUBSTITUTE" ; };
 String SC_OPCODE_REPT { Text = "REPT" ; };
 String SC_OPCODE_CONCAT { Text = "CONCATENATE" ; };
+String SC_OPCODE_CONCAT_MS { Text = "_xlfn.CONCAT" ; };
+String SC_OPCODE_TEXTJOIN_MS { Text = "_xlfn.TEXTJOIN" ; };
 String SC_OPCODE_MAT_VALUE { Text = "MVALUE" ; };
 String SC_OPCODE_MAT_DET { Text = "MDETERM" ; };
 String SC_OPCODE_MAT_INV { Text = "MINVERSE" ; };
@@ -1155,6 +1159,8 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_SUBSTITUTE { Text = "SUBSTITUTE" ; };
 String SC_OPCODE_REPT { Text = "REPT" ; };
 String SC_OPCODE_CONCAT { Text = "CONCATENATE" ; };
+String SC_OPCODE_CONCAT_MS { Text = "CONCAT" ; };
+String SC_OPCODE_TEXTJOIN_MS { Text = "TEXTJOIN" ; };
 String SC_OPCODE_MAT_VALUE { Text = "MVALUE" ; };
 String SC_OPCODE_MAT_DET { Text = "MDETERM" ; };
 String SC_OPCODE_MAT_INV { Text = "MINVERSE" ; };
@@ -2321,6 +2327,14 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = "CONCATENATE" ;
 };
+String SC_OPCODE_CONCAT_MS
+{
+Text [ en-US ] = "CONCAT" ;
+};
+String SC_OPCODE_TEXTJOIN_MS
+{
+Text [ en-US ] = "TEXTJOIN" ;
+};
 String SC_OPCODE_MAT_VALUE
 {
 Text [ en-US ] = "MVALUE" ;
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 7eadfe5..034b165 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -495,7 +495,9 @@
 #define SC_OPCODE_FORECAST_ETS_STA  484
 #define SC_OPCODE_FORECAST_ETS_STM  485
 #define SC_OPCODE_FORECAST_LIN  486
-#define SC_OPCODE_STOP_2_PAR487 /* last function with two or more 
parameters' OpCode + 1 */
+#define SC_OPCODE_CONCAT_MS 487
+#define SC_OPCODE_TEXTJOIN_MS   488
+#define SC_OPCODE_STOP_2_PAR489 /* last function with two or more 
parameters' OpCode + 1 */
 
 #define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR/* last 
function's OpCode + 1 */
 #define SC_OPCODE_LAST_OPCODE_ID(SC_OPCODE_STOP_FUNCTION - 1)   /* last 
OpCode */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index d2ebdfc..1bf955f 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -329,6 +329,8 @@ enum OpCode : sal_uInt16
 ocSubstitute= SC_OPCODE_SUBSTITUTE,
 ocRept  = SC_OPCODE_REPT,
 ocConcat= SC_OPCODE_CONCAT,
+ocConcat_MS = SC_OPCODE_CONCAT_MS,
+ocTextJoin_MS   = SC_OPCODE_TEXTJOIN_MS,
 ocLenB  = SC_OPCODE_LENB,
 ocRightB= SC_OPCODE_RIGHTB,
 ocLeftB = SC_OPCODE_LEFTB,
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index e07f710..29b22bb 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -636,5 +636,7 @@
 #define HID_FUNC_FORECAST_ETS_STA   

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

2016-03-19 Thread Noel Grandin
 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 
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 
Reviewed-by: Noel Grandin 

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
-   

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

2016-03-19 Thread Eike Rathke
 formula/source/core/api/token.cxx|   16 ++--
 include/formula/token.hxx|   16 ++--
 sc/inc/address.hxx   |   10 ++
 sc/inc/compiler.hxx  |7 +
 sc/inc/document.hxx  |9 ++
 sc/inc/token.hxx |2 
 sc/inc/tokenarray.hxx|2 
 sc/source/core/data/conditio.cxx |2 
 sc/source/core/data/documen3.cxx |6 +
 sc/source/core/data/formulacell.cxx  |   48 +
 sc/source/core/data/validat.cxx  |2 
 sc/source/core/tool/address.cxx  |   91 +
 sc/source/core/tool/compiler.cxx |   79 +++--
 sc/source/core/tool/token.cxx|  127 ---
 sc/source/filter/excel/excform.cxx   |4 -
 sc/source/filter/excel/excform8.cxx  |4 -
 sc/source/filter/excel/tokstack.cxx  |8 +-
 sc/source/filter/excel/xeformula.cxx |6 -
 sc/source/filter/inc/tokstack.hxx|4 -
 sc/source/ui/unoobj/tokenuno.cxx |3 
 20 files changed, 321 insertions(+), 125 deletions(-)

New commits:
commit 64e542413851236c75e25185c137d6fd6ddfe3a1
Author: Eike Rathke 
Date:   Thu Mar 17 23:18:06 2016 +0100

Resolves: tdf#96915 implement other-sheet-local named expressions

Change-Id: I0d62536caa6eb455473a755067abc585662cd9a5

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 22d3c84..7009d94 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -221,15 +221,15 @@ void FormulaToken::SetIndex( sal_uInt16 )
 SAL_WARN( "formula.core", "FormulaToken::SetIndex: virtual dummy called" );
 }
 
-bool FormulaToken::IsGlobal() const
+sal_Int16 FormulaToken::GetSheet() const
 {
-SAL_WARN( "formula.core", "FormulaToken::IsGlobal: virtual dummy called" );
-return true;
+SAL_WARN( "formula.core", "FormulaToken::GetSheet: virtual dummy called" );
+return -1;
 }
 
-void FormulaToken::SetGlobal( bool )
+void FormulaToken::SetSheet( sal_Int16 )
 {
-SAL_WARN( "formula.core", "FormulaToken::SetGlobal: virtual dummy called" 
);
+SAL_WARN( "formula.core", "FormulaToken::SetSheet: virtual dummy called" );
 }
 
 short* FormulaToken::GetJump() const
@@ -1724,12 +1724,12 @@ bool FormulaStringOpToken::operator==( const 
FormulaToken& r ) const
 
 sal_uInt16  FormulaIndexToken::GetIndex() const { return nIndex; }
 voidFormulaIndexToken::SetIndex( sal_uInt16 n ) { nIndex = n; }
-boolFormulaIndexToken::IsGlobal() const { return mbGlobal; 
}
-voidFormulaIndexToken::SetGlobal( bool b )  { mbGlobal = b; }
+sal_Int16   FormulaIndexToken::GetSheet() const { return mnSheet; }
+voidFormulaIndexToken::SetSheet( sal_Int16 n )  { mnSheet = n; }
 bool FormulaIndexToken::operator==( const FormulaToken& r ) const
 {
 return FormulaToken::operator==( r ) && nIndex == r.GetIndex() &&
-mbGlobal == r.IsGlobal();
+mnSheet == r.GetSheet();
 }
 const OUString& FormulaExternalToken::GetExternal() const   { return 
aExternal; }
 sal_uInt8   FormulaExternalToken::GetByte() const   { return 
nByte; }
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index 618168e..e0cd6b7 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -154,8 +154,8 @@ public:
 virtual voidSetString( const svl::SharedString& rStr );
 virtual sal_uInt16  GetIndex() const;
 virtual voidSetIndex( sal_uInt16 n );
-virtual boolIsGlobal() const;
-virtual voidSetGlobal( bool b );
+virtual sal_Int16   GetSheet() const;
+virtual voidSetSheet( sal_Int16 n );
 virtual short*  GetJump() const;
 virtual const OUString& GetExternal() const;
 virtual FormulaToken*   GetFAPOrigToken() const;
@@ -310,18 +310,18 @@ class FORMULA_DLLPUBLIC FormulaIndexToken : public 
FormulaToken
 {
 private:
 sal_uInt16  nIndex;
-boolmbGlobal;
+sal_Int16   mnSheet;
 public:
-FormulaIndexToken( OpCode e, sal_uInt16 n, 
bool bGlobal = true ) :
-FormulaToken(  svIndex, e ), nIndex( n ), 
mbGlobal( bGlobal ) {}
+FormulaIndexToken( OpCode e, sal_uInt16 n, 
sal_Int16 nSheet = -1 ) :
+FormulaToken(  svIndex, e ), nIndex( n ), 
mnSheet( nSheet ) {}
 FormulaIndexToken( const FormulaIndexToken& r 
) :
-FormulaToken( r ), nIndex( r.nIndex ), 
mbGlobal( r.mbGlobal ) {}
+FormulaToken( r ), nIndex( r.nIndex ), 
mnSheet( r.mnSheet ) {}
 
 virtual FormulaToken*   Clone() const override { return new 

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

2016-01-12 Thread Noel Grandin
 formula/source/core/api/token.cxx |9 +++--
 formula/source/ui/dlg/formula.cxx |4 ++--
 include/formula/formula.hxx   |2 +-
 include/formula/tokenarray.hxx|6 ++
 4 files changed, 8 insertions(+), 13 deletions(-)

New commits:
commit 0078512edadbba9b8acefffce4c51220a3b00118
Author: Noel Grandin 
Date:   Tue Jan 12 10:25:21 2016 +0200

loplugin:unusedmethods unused return value in include/formula

Change-Id: Ic5d6c11d955ef5ef53dea0bb4e5bec8167874a91

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index ff166e1..e868bbf 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -901,7 +901,7 @@ FormulaToken* FormulaTokenArray::ReplaceToken( sal_uInt16 
nOffset, FormulaToken*
 }
 }
 
-sal_uInt16 FormulaTokenArray::RemoveToken( sal_uInt16 nOffset, sal_uInt16 
nCount )
+void FormulaTokenArray::RemoveToken( sal_uInt16 nOffset, sal_uInt16 nCount )
 {
 if (nOffset < nLen)
 {
@@ -948,13 +948,10 @@ sal_uInt16 FormulaTokenArray::RemoveToken( sal_uInt16 
nOffset, sal_uInt16 nCount
 else
 nIndex -= nStop - nOffset;
 }
-
-return nCount;
 }
 else
 {
 SAL_WARN("formula.core","FormulaTokenArray::RemoveToken - nOffset " << 
nOffset << " >= nLen " << nLen);
-return 0;
 }
 }
 
@@ -994,9 +991,9 @@ FormulaToken* FormulaTokenArray::AddDouble( double fVal )
 return Add( new FormulaDoubleToken( fVal ) );
 }
 
-FormulaToken* FormulaTokenArray::AddExternal( const sal_Unicode* pStr )
+void FormulaTokenArray::AddExternal( const sal_Unicode* pStr )
 {
-return AddExternal( OUString( pStr ) );
+AddExternal( OUString( pStr ) );
 }
 
 FormulaToken* FormulaTokenArray::AddExternal( const OUString& rStr,
diff --git a/formula/source/ui/dlg/formula.cxx 
b/formula/source/ui/dlg/formula.cxx
index 1cf839d..26fbf81 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -1742,9 +1742,9 @@ void FormulaModalDialog::SetMeText(const OUString& _sText)
 m_pImpl->SetMeText(_sText);
 }
 
-bool FormulaModalDialog::CheckMatrix(OUString& aFormula)
+void FormulaModalDialog::CheckMatrix(OUString& aFormula)
 {
-return m_pImpl->CheckMatrix(aFormula);
+m_pImpl->CheckMatrix(aFormula);
 }
 
 void FormulaModalDialog::Update()
diff --git a/include/formula/formula.hxx b/include/formula/formula.hxx
index 760f4b3..37e4743 100644
--- a/include/formula/formula.hxx
+++ b/include/formula/formula.hxx
@@ -72,7 +72,7 @@ protected:
 
 voidSetMeText(const OUString& _sText);
 voidUpdate();
-boolCheckMatrix(OUString& aFormula /*IN/OUT*/);
+voidCheckMatrix(OUString& aFormula /*IN/OUT*/);
 voidUpdate(const OUString& _sExp);
 
 voidStoreFormEditData(FormEditData* pData);
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index bf3056a..d88f884 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -159,10 +159,8 @@ protected:
 Start offset into pCode.
 @param  nCount
 Count of tokens to remove.
-
-@return The actual number of tokens removed from pCode array.
  */
-sal_uInt16  RemoveToken( sal_uInt16 nOffset, sal_uInt16 nCount 
);
+voidRemoveToken( sal_uInt16 nOffset, sal_uInt16 nCount 
);
 
 inline  voidSetCombinedBitsRecalcMode( ScRecalcMode nBits )
 { nMode |= (nBits & ~RECALCMODE_EMASK); }
@@ -304,7 +302,7 @@ public:
 
 FormulaToken* AddString( const svl::SharedString& rStr );
 FormulaToken* AddDouble( double fVal );
-FormulaToken* AddExternal( const sal_Unicode* pStr );
+void  AddExternal( const sal_Unicode* pStr );
 /** Xcl import may play dirty tricks with OpCode!=ocExternal.
 Others don't use! */
 FormulaToken* AddExternal( const OUString& rStr, OpCode eOp = ocExternal );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-01-05 Thread Eike Rathke
 formula/source/core/api/FormulaCompiler.cxx|   10 --
 formula/source/core/api/token.cxx  |   17 +
 formula/source/core/resource/core_resource.src |9 +
 include/formula/compiler.hrc   |3 ++-
 include/formula/opcode.hxx |1 +
 sc/inc/helpids.h   |1 +
 sc/qa/unit/data/contentCSV/date-time-functions.csv |2 +-
 sc/source/core/inc/interpre.hxx|1 +
 sc/source/core/tool/interpr2.cxx   |   12 
 sc/source/core/tool/interpr4.cxx   |1 +
 sc/source/filter/excel/xlformula.cxx   |3 ++-
 11 files changed, 51 insertions(+), 9 deletions(-)

New commits:
commit 902c593196741ffec2d096855369313f6bbe756e
Author: Eike Rathke 
Date:   Tue Jan 5 19:13:54 2016 +0100

tdf#96198 add WEEKNUM_OOO compatibility function, tdf#50950 follow-up

The remaining cases when loading old and wrong ISOWEEKNUM that can't be
mapped to either new WEEKNUM or ISOWEEKNUM now are mapped to
WEEKNUM_OOO(date,mode) with calculations identical to the old and wrong
OOo WEEKNUM.

These WEEKNUM_OOO cases are still wrongly saved as ISOWEEKNUM so can be
read by 5.0 or earlier versions as the old WEEKNUM, which should be
changed for 5.3 or later.

WEEKNUM_OOO is not offered in the Function Wizard to prevent deliberate
usage.

Also reverts the interim unit test change to
sc/qa/unit/data/contentCSV/date-time-functions.csv
that was necessary to catch the error generated by ISOWEEKNUM with two
arguments.

Change-Id: I874c4c7225900f03b879f2947512ae02270cbd4f

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 457beee..526f83f 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1294,8 +1294,7 @@ void FormulaCompiler::Factor()
 // literal double value and keep function. Anything else
 // can not be resolved, there exists no "like ISO but week
 // starts on Sunday" mode in WEEKNUM and for an expression
-// we can't determine, so let ISOWEEKNUM generate an error
-// for two arguments in these cases.
+// we can't determine.
 if (pc >= 2 && pArr->nIndex == nSepPos + 3 &&
 pArr->pCode[nSepPos+1]->GetType() == svDouble &&
 pArr->pCode[nSepPos+1]->GetDouble() != 1.0 &&
@@ -1309,10 +1308,9 @@ void FormulaCompiler::Factor()
 }
 else
 {
-/* FIXME: introduce (hidden?) compatibility function? 
*/
-#if 0
-pFacToken->NewOpCode( ocWeeknumCompat, 
FormulaToken::PrivateAccess());
-#endif
+// For the remaining two arguments cases use the
+// compatibility function.
+pFacToken->NewOpCode( ocWeeknumOOo, 
FormulaToken::PrivateAccess());
 }
 }
 PutCode( pFacToken );
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 53bc620..2cd8dec 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1113,6 +1113,7 @@ inline bool MissingConventionODF::isRewriteNeeded( OpCode 
eOp ) const
 case ocAddress:
 case ocLogNormDist:
 case ocNormDist:
+case ocWeeknumOOo:
 return true;
 case ocMissing:
 case ocLog:
@@ -1514,6 +1515,22 @@ FormulaTokenArray * FormulaTokenArray::RewriteMissing( 
const MissingConvention &
 ( pCur->GetOpCode() == ocCeil ? ocCeil_Math : 
ocFloor_Math ) );
 pNewArr->AddToken( *pToken );
 }
+else if (pCur->GetOpCode() == ocWeeknumOOo &&
+rConv.getConvention() == 
MissingConvention::FORMULA_MISSING_CONVENTION_ODFF)
+{
+/* XXX TODO FIXME: Remove this special handling (also
+ * ocWeeknumOOo in MissingConventionODF::isRewriteNeeded()
+ * above) in 5.3 or later, this still abuses the ODFF
+ * ISOWEEKNUM function to store the old WEEKNUM (now
+ * WEEKNUM_OOO) cases that can't be mapped to the new WEEKNUM
+ * or ISOWEEKNUM, as 5.0 and earlier always stored the old
+ * WEEKNUM as ISOWEEKNUM. Ugly nasty ...
+ * Later write ORG.LIBREOFFICE.WEEKNUM_OOO, see
+ * formula/source/core/resource/core_resource.src
+ * SC_OPCODE_WEEKNUM_OOO */
+FormulaToken *pToken = new FormulaByteToken( ocIsoWeeknum, 
pCur->GetByte(), 

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

2016-01-05 Thread Eike Rathke
 formula/source/core/api/FormulaCompiler.cxx |   26 
 formula/source/core/api/token.cxx   |   57 
 include/formula/tokenarray.hxx  |   16 +++
 3 files changed, 98 insertions(+), 1 deletion(-)

New commits:
commit 2f79244cb3fcc4cbfd2b818380ea9d62b49aaade
Author: Eike Rathke 
Date:   Tue Jan 5 11:54:32 2016 +0100

tdf#96198 detect old ISO/WEEKNUM usage with two arguments, tdf#50950 
follow-up

5.0 and earlier implemented WEEKNUM(date,mode) with mode!=1 such that
effectively an ISO 8601 week number was calculated. WEEKNUM was wrongly
saved as ISOWEEKNUM (even with two parameters though it is defined to
have only one) so that when reading it we can try to detect a literal
double argument for mode and if it is not 1 remove it to keep
ISOWEEKNUM(date) instead of calling WEEKNUM(date,mode) which wouldn't
match.

A further change to 5.0 to accept also only one parameter in
WEEKNUM(date) and for this default the mode to not 1 for ISO week will
yield forward compatibility.

Change-Id: I88de7dd809d69b6826a190505d2a1dd3fe79c90b

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index c4ca443..457beee 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1271,6 +1271,7 @@ void FormulaCompiler::Factor()
 else
 SetError( errPairExpected);
 sal_uInt8 nSepCount = 0;
+const sal_uInt16 nSepPos = pArr->nIndex - 1;// separator 
position, if any
 if( !bNoParam )
 {
 nSepCount++;
@@ -1289,7 +1290,30 @@ void FormulaCompiler::Factor()
 pFacToken->SetByte( nSepCount );
 if (nSepCount == 2)
 {
-pFacToken->NewOpCode( ocWeek, 
FormulaToken::PrivateAccess());
+// An old mode!=1 indicates ISO week, remove argument if
+// literal double value and keep function. Anything else
+// can not be resolved, there exists no "like ISO but week
+// starts on Sunday" mode in WEEKNUM and for an expression
+// we can't determine, so let ISOWEEKNUM generate an error
+// for two arguments in these cases.
+if (pc >= 2 && pArr->nIndex == nSepPos + 3 &&
+pArr->pCode[nSepPos+1]->GetType() == svDouble &&
+pArr->pCode[nSepPos+1]->GetDouble() != 1.0 &&
+pArr->RemoveToken( nSepPos, 2) == 2)
+{
+// Remove the ocPush/svDouble just removed also from
+// the compiler local RPN array.
+--pCode, --pc;
+(*pCode)->DecRef(); // may be dead now
+pFacToken->SetByte( nSepCount - 1 );
+}
+else
+{
+/* FIXME: introduce (hidden?) compatibility function? 
*/
+#if 0
+pFacToken->NewOpCode( ocWeeknumCompat, 
FormulaToken::PrivateAccess());
+#endif
+}
 }
 PutCode( pFacToken );
 }
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 339e927..65211f3 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -900,6 +900,63 @@ FormulaToken* FormulaTokenArray::ReplaceToken( sal_uInt16 
nOffset, FormulaToken*
 }
 }
 
+sal_uInt16 FormulaTokenArray::RemoveToken( sal_uInt16 nOffset, sal_uInt16 
nCount )
+{
+if (nOffset < nLen)
+{
+SAL_WARN_IF( nOffset + nCount > nLen, "formula.core",
+"FormulaTokenArray::RemoveToken - nOffset " << nOffset << " + 
nCount " << nCount << " > nLen " << nLen);
+const sal_uInt16 nStop = ::std::min( static_cast(nOffset + 
nCount), nLen);
+nCount = nStop - nOffset;
+for (sal_uInt16 j = nOffset; j < nStop; ++j)
+{
+FormulaToken* p = pCode[j];
+if (p->GetRef() > 1)
+{
+for (sal_uInt16 i=0; i < nRPN; ++i)
+{
+if (pRPN[i] == p)
+{
+// Shift remaining tokens in pRPN down.
+for (sal_uInt16 x=i+1; x < nRPN; ++x)
+{
+pRPN[x-1] = pRPN[x];
+}
+--nRPN;
+
+p->DecRef();
+if (p->GetRef() == 1)
+break;  // for
+}
+}
+}
+p->DecRef();// may be dead now
+}
+
+// Shift remaining 

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

2015-12-18 Thread Eike Rathke
 formula/source/ui/dlg/formula.cxx |   32 ++
 include/formula/IFunctionDescription.hxx  |2 -
 reportdesign/source/ui/dlg/Formula.cxx|2 -
 reportdesign/source/ui/inc/Formula.hxx|2 -
 sc/inc/simpleformulacalc.hxx  |6 +++--
 sc/qa/unit/ucalc.cxx  |4 +--
 sc/source/core/data/simpleformulacalc.cxx |   16 ---
 sc/source/ui/app/inputhdl.cxx |4 +--
 sc/source/ui/formdlg/formula.cxx  |8 ---
 sc/source/ui/inc/formula.hxx  |2 -
 10 files changed, 46 insertions(+), 32 deletions(-)

New commits:
commit dc89367a5622748dd7c37b89ac300a663b8b98e9
Author: Eike Rathke 
Date:   Fri Dec 18 23:22:24 2015 +0100

Formula Wizard: evaluating expressions always in matrix context is wrong

Change-Id: I276f7bbf2bd6fa7c67d8691634ad9d79e4a08b1c

diff --git a/formula/source/ui/dlg/formula.cxx 
b/formula/source/ui/dlg/formula.cxx
index bb4f46d..0d0a646 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -77,9 +77,9 @@ public:
 RefInputStartBefore( RefEdit* pEdit, RefButton* pButton );
 voidRefInputStartAfter( RefEdit* pEdit, RefButton* pButton );
 voidRefInputDoneAfter( bool bForced );
-boolCalcValue( const OUString& rStrExp, OUString& rStrResult );
-boolCalcStruct( const OUString& rStrExp);
-voidUpdateValues();
+boolCalcValue( const OUString& rStrExp, OUString& rStrResult, 
bool bForceMatrixFormula = false );
+boolCalcStruct( const OUString& rStrExp, bool 
bForceRecalcStruct = false );
+voidUpdateValues( bool bForceRecalcStruct = false );
 voidDeleteArgs();
 sal_Int32   GetFunctionPos(sal_Int32 nPos);
 voidClearAllParas();
@@ -568,7 +568,7 @@ sal_Int32 FormulaDlg_Impl::GetFunctionPos(sal_Int32 nPos)
 return nFuncPos;
 }
 
-bool FormulaDlg_Impl::CalcValue( const OUString& rStrExp, OUString& rStrResult 
)
+bool FormulaDlg_Impl::CalcValue( const OUString& rStrExp, OUString& 
rStrResult, bool bForceMatrixFormula )
 {
 bool bResult = true;
 
@@ -578,7 +578,7 @@ bool FormulaDlg_Impl::CalcValue( const OUString& rStrExp, 
OUString& rStrResult )
 
 if ( !Application::AnyInput( VclInputFlags::KEYBOARD ) )
 {
-bResult = m_pHelper->calculateValue(rStrExp,rStrResult);
+bResult = m_pHelper->calculateValue( rStrExp, rStrResult, 
bForceMatrixFormula || m_pBtnMatrix->IsChecked());
 }
 else
 bResult = false;
@@ -587,7 +587,7 @@ bool FormulaDlg_Impl::CalcValue( const OUString& rStrExp, 
OUString& rStrResult )
 return bResult;
 }
 
-void FormulaDlg_Impl::UpdateValues()
+void FormulaDlg_Impl::UpdateValues( bool bForceRecalcStruct )
 {
 OUString aStrResult;
 if ( CalcValue( pFuncDesc->getFormula( m_aArguments ), aStrResult ) )
@@ -603,15 +603,15 @@ void FormulaDlg_Impl::UpdateValues()
 aStrResult.clear();
 m_pWndFormResult->SetText( aStrResult );
 }
-CalcStruct(pMEdit->GetText());
+CalcStruct( pMEdit->GetText(), bForceRecalcStruct);
 }
 
-bool FormulaDlg_Impl::CalcStruct( const OUString& rStrExp)
+bool FormulaDlg_Impl::CalcStruct( const OUString& rStrExp, bool 
bForceRecalcStruct )
 {
 bool bResult = true;
 sal_Int32 nLength = rStrExp.getLength();
 
-if ( !rStrExp.isEmpty() && aOldFormula!=rStrExp && bStructUpdate)
+if ( !rStrExp.isEmpty() && (bForceRecalcStruct || aOldFormula != rStrExp) 
&& bStructUpdate)
 {
 // Only calculate the value when there isn't any more keyboard input:
 
@@ -733,10 +733,17 @@ void FormulaDlg_Impl::MakeTree(StructPage* 
_pTree,SvTreeListEntry* pParent,Formu
 }
 else if (eOp==ocPush)
 {
+// Interpret range reference in matrix context to resolve
+// as array elements.
+/* TODO: this should depend on parameter classification, if
+ * a scalar value is expected matrix should not be forced.
+ * */
+bool bForceMatrix = (!m_pBtnMatrix->IsChecked() &&
+(_pToken->GetType() == svDoubleRef || 
_pToken->GetType() == svExternalDoubleRef));
 OUString aCellResult;
-OUString aEquals(" = ");
-if (CalcValue( "=" + aResult, aCellResult) && aCellResult 
!= aResult) // cell is a formula, print subformula
-_pTree->InsertEntry(aResult + aEquals + 
aCellResult,pParent,STRUCT_END,0,_pToken);
+if (CalcValue( "=" + aResult, aCellResult, bForceMatrix) 
&& aCellResult != aResult)
+// Cell is a formula, print subformula.
+_pTree->InsertEntry(aResult + " = " + aCellResult, 

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

2015-12-15 Thread Eike Rathke
 formula/source/core/api/token.cxx   |   30 ++
 include/formula/token.hxx   |3 +++
 include/formula/tokenarray.hxx  |3 +++
 sc/source/core/data/formulacell.cxx |4 
 4 files changed, 40 insertions(+)

New commits:
commit dad412e07f805a53ad73ce2e80d187a70c77e8de
Author: Eike Rathke 
Date:   Tue Dec 15 17:44:30 2015 +0100

Resolves: tdf#95440 SharedString are interned per document, re-intern

... if literal strings are copied with formula expression tokens.

Change-Id: I13526907bb6c2c605c6ed9584fa6e3f2b18623b8

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index d46b02d..339e927 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -204,6 +204,11 @@ svl::SharedString FormulaToken::GetString() const
 return svl::SharedString(); // invalid string
 }
 
+void FormulaToken::SetString( const svl::SharedString& )
+{
+SAL_WARN( "formula.core", "FormulaToken::SetString: virtual dummy called" 
);
+}
+
 sal_uInt16 FormulaToken::GetIndex() const
 {
 SAL_WARN( "formula.core", "FormulaToken::GetIndex: virtual dummy called" );
@@ -1523,6 +1528,21 @@ FormulaToken* FormulaTokenArray::AddOpCode( OpCode eOp )
 return AddToken( *pRet );
 }
 
+void FormulaTokenArray::ReinternStrings( svl::SharedStringPool& rPool )
+{
+for (sal_uInt16 i=0; i < nLen; ++i)
+{
+switch (pCode[i]->GetType())
+{
+case svString:
+pCode[i]->SetString( rPool.intern( 
pCode[i]->GetString().getString()));
+break;
+default:
+;   // nothing
+}
+}
+}
+
 
 /*--*/
 
@@ -1651,6 +1671,11 @@ svl::SharedString FormulaStringToken::GetString() const
 return maString;
 }
 
+void FormulaStringToken::SetString( const svl::SharedString& rStr )
+{
+maString = rStr;
+}
+
 bool FormulaStringToken::operator==( const FormulaToken& r ) const
 {
 return FormulaToken::operator==( r ) && maString == r.GetString();
@@ -1672,6 +1697,11 @@ svl::SharedString FormulaStringOpToken::GetString() const
 return maString;
 }
 
+void FormulaStringOpToken::SetString( const svl::SharedString& rStr )
+{
+maString = rStr;
+}
+
 bool FormulaStringOpToken::operator==( const FormulaToken& r ) const
 {
 return FormulaByteToken::operator==( r ) && maString == r.GetString();
diff --git a/include/formula/token.hxx b/include/formula/token.hxx
index f2a93b6..618168e 100644
--- a/include/formula/token.hxx
+++ b/include/formula/token.hxx
@@ -151,6 +151,7 @@ public:
 virtual double  GetDouble() const;
 virtual double& GetDoubleAsReference();
 virtual svl::SharedString   GetString() const;
+virtual voidSetString( const svl::SharedString& rStr );
 virtual sal_uInt16  GetIndex() const;
 virtual voidSetIndex( sal_uInt16 n );
 virtual boolIsGlobal() const;
@@ -283,6 +284,7 @@ public:
 
 virtual FormulaToken* Clone() const override;
 virtual svl::SharedString GetString() const override;
+virtual void SetString( const svl::SharedString& rStr ) override;
 virtual bool operator==( const FormulaToken& rToken ) const override;
 
 DECL_FIXEDMEMPOOL_NEWDEL_DLL( FormulaStringToken )
@@ -300,6 +302,7 @@ public:
 
 virtual FormulaToken* Clone() const override;
 virtual svl::SharedString GetString() const override;
+virtual void SetString( const svl::SharedString& rStr ) override;
 virtual bool operator==( const FormulaToken& rToken ) const override;
 };
 
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 0f303ac..6dcbcfc 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -309,6 +309,9 @@ public:
 
 /** Determines if this formula may be followed by a reference. */
 boolMayReferenceFollow();
+
+/** Re-intern SharedString in case the SharedStringPool differs. */
+void ReinternStrings( svl::SharedStringPool& rPool );
 };
 
 inline OpCode FormulaTokenArray::GetOuterFuncOpCode()
diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 5c87b52..e574af7 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -916,7 +916,11 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell& rCell, 
ScDocument& rDoc, cons
 }
 
 if (!pDocument->IsClipOrUndo())
+{
+if (>GetSharedStringPool() != 
>GetSharedStringPool())
+pCode->ReinternStrings( pDocument->GetSharedStringPool());
 pCode->AdjustReferenceOnCopy( aPos);
+}
 
 if ( nCloneFlags & SC_CLONECELL_ADJUST3DREL )
 pCode->ReadjustRelative3DReferences( rCell.aPos, aPos );
___
Libreoffice-commits mailing list

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

2015-10-06 Thread Winfried Donkers
 formula/source/core/api/FormulaCompiler.cxx|   71 -
 formula/source/core/resource/core_resource.src |9 ++
 include/formula/compiler.hrc   |3 
 include/formula/opcode.hxx |1 
 sc/inc/helpids.h   |1 
 sc/qa/unit/data/contentCSV/date-time-functions.csv |4 -
 sc/qa/unit/data/ods/date-time-functions.ods|binary
 sc/qa/unit/ucalc.cxx   |1 
 sc/source/core/inc/interpre.hxx|1 
 sc/source/core/tool/interpr2.cxx   |   39 +++
 sc/source/core/tool/interpr4.cxx   |1 
 sc/source/filter/excel/xlformula.cxx   |3 
 sc/source/filter/oox/formulabase.cxx   |4 -
 sc/source/ui/src/scfuncs.src   |   26 +++
 14 files changed, 141 insertions(+), 23 deletions(-)

New commits:
commit f830600ece806ec365a4839e79afabe183c5e36d
Author: Winfried Donkers 
Date:   Tue Sep 22 10:40:25 2015 +0200

tdf#50950 Add ODFF1.2 Calc function ISOWEEKNUM,

make Calc function WEEKNUM compliant with ODFF1.2,
provide backward compatibility for Calc function WEEKNUM,
add unit tests for ISOWEEKNUM, WEEKNUM and backward compatibility.

Change-Id: I63af5543cea2f470d710462e55404ac754022c89
Reviewed-on: https://gerrit.libreoffice.org/18760
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 4ee0f72..9d613e9 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -1247,23 +1247,66 @@ void FormulaCompiler::Factor()
 else if( eOp == ocNot || eOp == ocNeg
   || (SC_OPCODE_START_1_PAR <= eOp && eOp < SC_OPCODE_STOP_1_PAR) )
 {
-pFacToken = mpToken;
-eOp = NextToken();
-if( nNumFmt == css::util::NumberFormat::UNDEFINED && eOp == ocNot )
-nNumFmt = css::util::NumberFormat::LOGICAL;
-if (eOp == ocOpen)
+if (eOp == ocIsoWeeknum && FormulaGrammar::isODFF( meGrammar ))
 {
-NextToken();
-eOp = Expression();
+// tdf#50950 ocIsoWeeknum can have 2 arguments when saved by 
older versions of Calc;
+// the opcode then has to be changed to ocWeek for backward 
compatibilty
+pFacToken = mpToken;
+eOp = NextToken();
+bool bNoParam = false;
+if (eOp == ocOpen)
+{
+eOp = NextToken();
+if (eOp == ocClose)
+bNoParam = true;
+else
+eOp = Expression();
+}
+else
+SetError( errPairExpected);
+sal_uInt8 nSepCount = 0;
+if( !bNoParam )
+{
+nSepCount++;
+while ((eOp == ocSep) && (!pArr->GetCodeError() || 
!mbStopOnError))
+{
+nSepCount++;
+NextToken();
+eOp = Expression();
+}
+}
+if (eOp != ocClose)
+SetError( errPairExpected);
+else
+eOp = NextToken();
+pFacToken->SetByte( nSepCount );
+if (nSepCount == 2)
+{
+pFacToken->NewOpCode( ocWeek, 
FormulaToken::PrivateAccess());
+}
+PutCode( pFacToken );
 }
 else
-SetError( errPairExpected);
-if (eOp != ocClose)
-SetError( errPairExpected);
-else if ( !pArr->GetCodeError() )
-pFacToken->SetByte( 1 );
-PutCode( pFacToken );
-eOp = NextToken();
+{
+// standard handling of ocNot, ocNeg and 1-parameter opcodes
+pFacToken = mpToken;
+eOp = NextToken();
+if( nNumFmt == css::util::NumberFormat::UNDEFINED && eOp == 
ocNot )
+nNumFmt = css::util::NumberFormat::LOGICAL;
+if (eOp == ocOpen)
+{
+NextToken();
+eOp = Expression();
+}
+else
+SetError( errPairExpected);
+if (eOp != ocClose)
+SetError( errPairExpected);
+else if ( !pArr->GetCodeError() )
+pFacToken->SetByte( 1 );
+PutCode( pFacToken );
+eOp = NextToken();
+}
 }
 else if 

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

2015-10-03 Thread Markus Mohrhard
 formula/source/core/api/token.cxx |   38 ++
 include/formula/tokenarray.hxx|6 +++---
 2 files changed, 21 insertions(+), 23 deletions(-)

New commits:
commit bf3dd18cf86fd45882b813d08c3df5d7cd097246
Author: Markus Mohrhard 
Date:   Sat Oct 3 10:01:01 2015 +0200

no need to allocate that vector on the heap

This seems to give about 10% performance improvements in some calc cell
calculations.

Change-Id: Ibd91558b3c107e4c8e1401345c9332f97645453e

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index ac95b8d..b0e84f3 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1533,39 +1533,37 @@ FormulaTokenIterator::Item::Item(const 
FormulaTokenArray* pArray, short pc, shor
 
 FormulaTokenIterator::FormulaTokenIterator( const FormulaTokenArray& rArr )
 {
-maStack = new std::vector ();
 Push(  );
 }
 
 FormulaTokenIterator::~FormulaTokenIterator()
 {
-delete maStack;
 }
 
 void FormulaTokenIterator::Push( const FormulaTokenArray* pArr )
 {
 FormulaTokenIterator::Item item(pArr, -1, SHRT_MAX);
 
-maStack->push_back(item);
+maStack.push_back(item);
 }
 
 void FormulaTokenIterator::Pop()
 {
-maStack->pop_back();
+maStack.pop_back();
 }
 
 void FormulaTokenIterator::Reset()
 {
-while( maStack->size() > 1 )
-maStack->pop_back();
+while( maStack.size() > 1 )
+maStack.pop_back();
 
-maStack->back().nPC = -1;
+maStack.back().nPC = -1;
 }
 
 const FormulaToken* FormulaTokenIterator::Next()
 {
-const FormulaToken* t = GetNonEndOfPathToken( ++maStack->back().nPC );
-if( !t && maStack->size() > 1 )
+const FormulaToken* t = GetNonEndOfPathToken( ++maStack.back().nPC );
+if( !t && maStack.size() > 1 )
 {
 Pop();
 t = Next();
@@ -1576,18 +1574,18 @@ const FormulaToken* FormulaTokenIterator::Next()
 const FormulaToken* FormulaTokenIterator::PeekNextOperator()
 {
 const FormulaToken* t = NULL;
-short nIdx = maStack->back().nPC;
+short nIdx = maStack.back().nPC;
 while (!t && ((t = GetNonEndOfPathToken( ++nIdx)) != NULL))
 {
 if (t->GetOpCode() == ocPush)
 t = NULL;   // ignore operands
 }
-if (!t && maStack->size() > 1)
+if (!t && maStack.size() > 1)
 {
-FormulaTokenIterator::Item pHere = maStack->back();
-maStack->pop_back();
+FormulaTokenIterator::Item pHere = maStack.back();
+maStack.pop_back();
 t = PeekNextOperator();
-maStack->push_back(pHere);
+maStack.push_back(pHere);
 }
 return t;
 }
@@ -1596,18 +1594,18 @@ const FormulaToken* 
FormulaTokenIterator::PeekNextOperator()
 
 void FormulaTokenIterator::Jump( short nStart, short nNext, short nStop )
 {
-maStack->back().nPC = nNext;
+maStack.back().nPC = nNext;
 if( nStart != nNext )
 {
-Push( maStack->back().pArr );
-maStack->back().nPC = nStart;
-maStack->back().nStop = nStop;
+Push( maStack.back().pArr );
+maStack.back().nPC = nStart;
+maStack.back().nStop = nStop;
 }
 }
 
 const FormulaToken* FormulaTokenIterator::GetNonEndOfPathToken( short nIdx ) 
const
 {
-FormulaTokenIterator::Item cur = maStack->back();
+FormulaTokenIterator::Item cur = maStack.back();
 
 if (nIdx < cur.pArr->nRPN && nIdx < cur.nStop)
 {
@@ -1620,7 +1618,7 @@ const FormulaToken* 
FormulaTokenIterator::GetNonEndOfPathToken( short nIdx ) con
 
 bool FormulaTokenIterator::IsEndOfPath() const
 {
-return GetNonEndOfPathToken( maStack->back().nPC + 1) == NULL;
+return GetNonEndOfPathToken( maStack.back().nPC + 1) == NULL;
 }
 
 
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 7a745b6..0f303ac 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -330,7 +330,7 @@ class FORMULA_DLLPUBLIC FormulaTokenIterator
 Item(const FormulaTokenArray* arr, short pc, short stop);
 };
 
-std::vector *maStack;
+std::vector maStack;
 
 public:
 FormulaTokenIterator( const FormulaTokenArray& );
@@ -339,8 +339,8 @@ public:
 const   FormulaToken* Next();
 const   FormulaToken* PeekNextOperator();
 boolIsEndOfPath() const;/// if a jump or subroutine path is done
-boolHasStacked() const { return maStack->size() > 1; }
-short   GetPC() const { return maStack->back().nPC; }
+boolHasStacked() const { return maStack.size() > 1; }
+short   GetPC() const { return maStack.back().nPC; }
 
 /** Jump or subroutine call.
 Program counter values will be incremented before code is executed =>
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-21 Thread Noel Grandin
 formula/source/ui/dlg/ControlHelper.hxx|   12 
 formula/source/ui/dlg/funcpage.hxx |2 --
 formula/source/ui/dlg/parawin.hxx  |6 --
 formula/source/ui/dlg/structpg.cxx |4 
 formula/source/ui/dlg/structpg.hxx |2 --
 include/formula/FormulaCompiler.hxx|3 ---
 include/formula/IFunctionDescription.hxx   |3 ---
 include/formula/formdata.hxx   |3 ---
 include/formula/formula.hxx|1 -
 include/formula/funcutl.hxx|5 -
 include/formula/token.hxx  |2 --
 include/formula/tokenarray.hxx |5 -
 reportdesign/source/ui/inc/FunctionHelper.hxx  |6 ++
 reportdesign/source/ui/misc/FunctionHelper.cxx |   18 --
 sc/inc/funcdesc.hxx|   11 ++-
 sc/source/core/data/funcdesc.cxx   |   12 +---
 16 files changed, 5 insertions(+), 90 deletions(-)

New commits:
commit 82b896f1f85b510eb72bb6d2f97d29defe1edf8b
Author: Noel Grandin n...@peralex.com
Date:   Mon Jul 20 12:51:08 2015 +0200

loplugin:unusedmethods formula

Change-Id: I62ff278679638dda7e10c86c49b1966641418e8b
Reviewed-on: https://gerrit.libreoffice.org/17223
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com

diff --git a/formula/source/ui/dlg/ControlHelper.hxx 
b/formula/source/ui/dlg/ControlHelper.hxx
index dea58d3..d6c1e79 100644
--- a/formula/source/ui/dlg/ControlHelper.hxx
+++ b/formula/source/ui/dlg/ControlHelper.hxx
@@ -53,7 +53,6 @@ public:
 MultiLineEdit*  GetEdit() {return pMEdit;}
 
 voidSetSelChangedHdl( const Link rLink ) { aSelChangedLink 
= rLink; }
-const Link   GetSelChangedHdl() const { return aSelChangedLink; }
 
 voidUpdateOldSel();
 };
@@ -136,28 +135,17 @@ public:
 OUStringGetArgVal();
 
 voidSetArgSelection (const Selection rSel);
-voidReplaceSelOfArg (const OUString rStr);
 
 ArgEdit*GetArgEdPtr() {return pEdArg;}
 
 
 voidSetFxClickHdl( const Link rLink ) { aFxClickLink = 
rLink; }
-const Link   GetFxClickHdl() const { return aFxClickLink; }
-
-voidSetRefClickHdl( const Link rLink ) { aRefClickLink = 
rLink; }
-const Link   GetRefClickHdl() const { return aRefClickLink; }
 
 voidSetFxFocusHdl( const Link rLink ) { aFxFocusLink = 
rLink; }
-const Link   GetFxFocusHdl() const { return aFxFocusLink; }
-
-voidSetRefFocusHdl( const Link rLink ) { aRefFocusLink = 
rLink; }
-const Link   GetRefFocusHdl() const { return aRefFocusLink; }
 
 voidSetEdFocusHdl( const Link rLink ) { aEdFocusLink = 
rLink; }
-const Link   GetEdFocusHdl() const { return aEdFocusLink; }
 
 voidSetEdModifyHdl( const Link rLink ) { aEdModifyLink = 
rLink; }
-const Link   GetEdModifyHdl() const { return aEdModifyLink; }
 
 void Hide();
 void Show();
diff --git a/formula/source/ui/dlg/funcpage.hxx 
b/formula/source/ui/dlg/funcpage.hxx
index f49a00d..6d76f54 100644
--- a/formula/source/ui/dlg/funcpage.hxx
+++ b/formula/source/ui/dlg/funcpage.hxx
@@ -101,10 +101,8 @@ public:
 OUStringGetSelFunctionName() const;
 
 voidSetDoubleClickHdl( const Link rLink ) { 
aDoubleClickLink = rLink; }
-const Link   GetDoubleClickHdl() const { return aDoubleClickLink; }
 
 voidSetSelectHdl( const Link rLink ) { aSelectionLink = 
rLink; }
-const Link   GetSelectHdl() const { return aSelectionLink; }
 
 };
 
diff --git a/formula/source/ui/dlg/parawin.hxx 
b/formula/source/ui/dlg/parawin.hxx
index 471efa0..b34d76e 100644
--- a/formula/source/ui/dlg/parawin.hxx
+++ b/formula/source/ui/dlg/parawin.hxx
@@ -133,7 +133,6 @@ public:
 voidUpdateParas();
 voidClearAll();
 
-boolIsRefMode() {return bRefMode;}
 voidSetRefMode(bool bFlag) {bRefMode=bFlag;}
 
 sal_uInt16  GetActiveLine() { return nActiveLine;}
@@ -149,14 +148,9 @@ public:
 sal_uInt16  GetSliderPos();
 voidSetSliderPos(sal_uInt16 nSliderPos);
 
-voidSetScrollHdl( const Link rLink ) { aScrollLink = 
rLink; }
-const Link   GetScrollHdl() const { return aScrollLink; }
-
 voidSetArgModifiedHdl( const Link rLink ) { 
aArgModifiedLink = rLink; }
-const Link   GetArgModifiedHdl() const { return aArgModifiedLink; }
 
 voidSetFxHdl( const Link rLink ) { aFxLink = rLink; }
-const Link   GetFxHdl() const { return aFxLink; }
 };
 
 
diff --git a/formula/source/ui/dlg/structpg.cxx 
b/formula/source/ui/dlg/structpg.cxx
index 6260c3e..ba573ca 100644
--- a/formula/source/ui/dlg/structpg.cxx
+++ b/formula/source/ui/dlg/structpg.cxx
@@ 

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

2015-06-23 Thread Eike Rathke
 formula/source/core/api/token.cxx |6 +++
 include/formula/tokenarray.hxx|4 ++
 sc/inc/compiler.hxx   |2 -
 sc/inc/tokenarray.hxx |4 --
 sc/source/core/tool/compiler.cxx  |   58 +-
 sc/source/core/tool/rangenam.cxx  |9 +
 sc/source/core/tool/token.cxx |   19 +---
 7 files changed, 72 insertions(+), 30 deletions(-)

New commits:
commit 80aafaf79306ea82cd24f10f200908addccaf34f
Author: Eike Rathke er...@redhat.com
Date:   Tue Jun 23 13:02:01 2015 +0200

in OOXML save references of named expressions with col,row=0,0 base position

Saving relative references of named expressions to OOXML never worked,
upon reload they pointed to a different position offset by the value of
the original base position. This at least saves positive relative
references correctly, while generating #REF! for negative offsets which
is slightly better than having them point to a wrong location and
silently calculate different values..

Also, this is a prerequisite for TableRef ThisRow references in named
expressions to be saved correctly in A1 notation, which results in a
relative row 0 value.

Change-Id: I3734f910794ceab4b9224b214ad11c64d1d18e67

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index e098a49..ac95b8d 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -706,7 +706,8 @@ FormulaTokenArray::FormulaTokenArray() :
 nIndex(0),
 nError(0),
 nMode(ScRecalcMode::NORMAL),
-bHyperLink(false)
+bHyperLink(false),
+mbFromRangeName(false)
 {
 }
 
@@ -728,6 +729,7 @@ void FormulaTokenArray::Assign( const FormulaTokenArray r )
 nError = r.nError;
 nMode  = r.nMode;
 bHyperLink = r.bHyperLink;
+mbFromRangeName = r.mbFromRangeName;
 pCode  = NULL;
 pRPN   = NULL;
 FormulaToken** pp;
@@ -780,6 +782,7 @@ FormulaTokenArray* FormulaTokenArray::Clone() const
 p-nMode = nMode;
 p-nError = nError;
 p-bHyperLink = bHyperLink;
+p-mbFromRangeName = mbFromRangeName;
 FormulaToken** pp;
 if( nLen )
 {
@@ -837,6 +840,7 @@ void FormulaTokenArray::Clear()
 pCode = NULL; pRPN = NULL;
 nError = nLen = nIndex = nRPN = 0;
 bHyperLink = false;
+mbFromRangeName = false;
 ClearRecalcMode();
 }
 
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index 1050047..58bb092 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -115,6 +115,7 @@ protected:
 sal_uInt16  nError; // Error code
 ScRecalcModenMode;  // Flags to indicate when to 
recalc this code
 boolbHyperLink; // If HYPERLINK() occurs in the 
formula.
+boolmbFromRangeName;// If this array originates from a 
named expression
 
 protected:
 voidAssign( const FormulaTokenArray );
@@ -164,6 +165,9 @@ public:
 virtual ~FormulaTokenArray();
 FormulaTokenArray* Clone() const;/// True copy!
 
+void SetFromRangeName( bool b ) { mbFromRangeName = b; }
+bool IsFromRangeName() const { return mbFromRangeName; }
+
 void Clear();
 void DelRPN();
 FormulaToken* First() { nIndex = 0; return Next(); }
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 8c6b373..2dfa2f7 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -218,7 +218,7 @@ public:
 formula::FormulaGrammar::Grammar eGram,
 const ScAddress rPos,
 const OUString rErrRef, const std::vectorOUString rTabNames,
-const ScComplexRefData rRef, bool bSingleRef ) const = 0;
+const ScComplexRefData rRef, bool bSingleRef, bool bFromRangeName 
) const = 0;
 
 virtual ::com::sun::star::i18n::ParseResult
 parseAnyToken( const OUString rFormula,
diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx
index b36936a..0d3fa02 100644
--- a/sc/inc/tokenarray.hxx
+++ b/sc/inc/tokenarray.hxx
@@ -52,7 +52,6 @@ class SC_DLLPUBLIC ScTokenArray : public 
formula::FormulaTokenArray
 
 size_t mnHashValue;
 ScFormulaVectorState meVectorState;
-bool mbFromRangeName;
 
 public:
 ScTokenArray();
@@ -70,9 +69,6 @@ public:
 
 ScFormulaVectorState GetVectorState() const { return meVectorState;}
 
-void SetFromRangeName( bool b ) { mbFromRangeName = b; }
-bool IsFromRangeName() const { return mbFromRangeName; }
-
 /**
  * If the array contains at least one relative row reference or named
  * expression, it's variant. Otherwise invariant.
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 30bd1e2..125abb4 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -800,12 +800,13 @@ struct ConventionOOO_A1 : public Convention_A1
 

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

2015-06-11 Thread Winfried Donkers
 formula/source/core/api/token.cxx  |6 +
 formula/source/core/resource/core_resource.src |   28 ++--
 include/formula/compiler.hrc   |4 -
 include/formula/opcode.hxx |4 -
 sc/inc/helpids.h   |2 
 sc/qa/unit/ucalc.cxx   |2 
 sc/source/core/inc/interpre.hxx|2 
 sc/source/core/tool/compiler.cxx   |   14 ++--
 sc/source/core/tool/interpr2.cxx   |   84 +++--
 sc/source/core/tool/interpr4.cxx   |4 -
 sc/source/filter/excel/xlformula.cxx   |8 --
 sc/source/filter/oox/formulabase.cxx   |9 +-
 sc/source/ui/src/scfuncs.src   |   84 +++--
 13 files changed, 198 insertions(+), 53 deletions(-)

New commits:
commit cb13c46da1cdd1e2b95fd473cc0ff54f776dfe9c
Author: Winfried Donkers winfrieddonk...@libreoffice.org
Date:   Mon Jun 1 13:47:07 2015 +0200

tdf#69552 [part 2] support all ODFF1.2 and Excel2013 variations

of CEILING and FLOOR

Change-Id: I9537d9bd8dbca2eac769e74e9d3d5b298b76f594
Reviewed-on: https://gerrit.libreoffice.org/16016
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index e1f97fb..a5e9392 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1054,6 +1054,7 @@ inline bool MissingConventionOOXML::isRewriteNeeded( 
OpCode eOp )
 case ocIndex:
 
 case ocCeil:
+case ocFloor:
 
 case ocGammaDist:
 case ocFDist_LT:
@@ -1414,10 +1415,11 @@ FormulaTokenArray * FormulaTokenArray::RewriteMissing( 
const MissingConvention 
 }
 if (bAdd)
 {
-if ( pCur-GetOpCode() == ocCeil 
+if ( ( pCur-GetOpCode() == ocCeil || pCur-GetOpCode() == ocFloor 
) 
  rConv.getConvention() == 
MissingConvention::FORMULA_MISSING_CONVENTION_OOXML )
 {
-FormulaToken *pToken = new FormulaToken( svByte, ocCeil_Math );
+FormulaToken *pToken = new FormulaToken( svByte,
+( pCur-GetOpCode() == ocCeil ? ocCeil_Math : 
ocFloor_Math ) );
 pNewArr-AddToken( *pToken );
 }
 else
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 298560c..534dafc 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -154,8 +154,10 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_CEIL_MS { Text = COM.MICROSOFT.CEILING ; };
 String SC_OPCODE_CEIL_PRECISE { Text = COM.MICROSOFT.CEILING.PRECISE ; };
 String SC_OPCODE_CEIL_ISO { Text = COM.MICROSOFT.ISO.CEILING ; };
-String SC_OPCODE_FLOOR_MS { Text = COM.MICROSOFT.FLOOR.PRECISE ; };
 String SC_OPCODE_FLOOR { Text = FLOOR ; };
+String SC_OPCODE_FLOOR_MS { Text = COM.MICROSOFT.FLOOR ; };
+String SC_OPCODE_FLOOR_MATH { Text = COM.MICROSOFT.FLOOR.MATH ; };
+String SC_OPCODE_FLOOR_PRECISE { Text = COM.MICROSOFT.FLOOR.PRECISE ; };
 String SC_OPCODE_ROUND { Text = ROUND ; };
 String SC_OPCODE_ROUND_UP { Text = ROUNDUP ; };
 String SC_OPCODE_ROUND_DOWN { Text = ROUNDDOWN ; };
@@ -573,8 +575,10 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_CEIL_MS { Text = CEILING ; };
 String SC_OPCODE_CEIL_PRECISE { Text = _xlfn.CEILING.PRECISE ; };
 String SC_OPCODE_CEIL_ISO { Text = ISO.CEILING ; };
-String SC_OPCODE_FLOOR_MS { Text = _xlfn.FLOOR.PRECISE ; };
-String SC_OPCODE_FLOOR { Text = FLOOR ; };
+String SC_OPCODE_FLOOR_MS { Text = FLOOR ; };
+String SC_OPCODE_FLOOR_MATH { Text = _xlfn.FLOOR.MATH ; };
+String SC_OPCODE_FLOOR { Text = _xlfn.FLOOR.MATH ; };
+String SC_OPCODE_FLOOR_PRECISE { Text = _xlfn.FLOOR.PRECISE ; };
 String SC_OPCODE_ROUND { Text = ROUND ; };
 String SC_OPCODE_ROUND_UP { Text = ROUNDUP ; };
 String SC_OPCODE_ROUND_DOWN { Text = ROUNDDOWN ; };
@@ -994,8 +998,10 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_CEIL_MS { Text = CEILING.XCL ; };
 String SC_OPCODE_CEIL_PRECISE { Text = CEILING.PRECISE ; };
 String SC_OPCODE_CEIL_ISO { Text = ISO.CEILING ; };
-String SC_OPCODE_FLOOR_MS { Text = FLOOR.PRECISE ; };
 String SC_OPCODE_FLOOR { Text = FLOOR ; };
+String SC_OPCODE_FLOOR_MS { Text = FLOOR.XCL ; };
+String SC_OPCODE_FLOOR_MATH { Text = FLOOR.MATH ; };
+String SC_OPCODE_FLOOR_PRECISE { Text = FLOOR.PRECISE ; };
 String SC_OPCODE_ROUND { Text = ROUND ; };
 String SC_OPCODE_ROUND_UP { Text = ROUNDUP ; };
 String SC_OPCODE_ROUND_DOWN { Text = ROUNDDOWN ; };
@@ -1747,13 +1753,21 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = 

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

2015-05-14 Thread Julien Nabet
 formula/source/ui/dlg/formula.cxx |   11 +--
 include/formula/formula.hxx   |1 +
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 844b7287a4ccd8e3d5e458bb1dc6c52e71322b01
Author: Julien Nabet serval2...@yahoo.fr
Date:   Thu May 14 01:36:33 2015 +0200

tdf#91273: Crash when closing formula wizard (cancel or ok)

warn:legacy.osl:3927:1:vcl/source/window/window.cxx:271: Window ( 7VclVBox 
()) with live children destroyed:  N7formula7ParaWinE ()
I took example from 
http://cgit.freedesktop.org/libreoffice/core/commit/?id=da49275807c8cf1dd7362a531f321f9f756e82d1
+ test existence of m_pImpl for FormulaDlg::PreNotify

Change-Id: I580aa7be79e1743fc528fd414a0ae581c0cb0c87
Reviewed-on: https://gerrit.libreoffice.org/15726
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/formula/source/ui/dlg/formula.cxx 
b/formula/source/ui/dlg/formula.cxx
index 89ec835..425593d 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -1749,7 +1749,13 @@ FormulaDlg::FormulaDlg( SfxBindings* pB, SfxChildWindow* 
pCW,
 SetText(m_pImpl-aTitle1);
 }
 
-FormulaDlg::~FormulaDlg() {}
+FormulaDlg::~FormulaDlg() {disposeOnce();}
+
+void FormulaDlg::dispose()
+{
+m_pImpl.reset();
+SfxModelessDialog::dispose();
+}
 
 void FormulaDlg::Update(const OUString _sExp)
 {
@@ -1823,7 +1829,8 @@ void FormulaDlg::SetFocusWin(vcl::Window *pWin,const 
OString nUniqueId)
 
 bool FormulaDlg::PreNotify( NotifyEvent rNEvt )
 {
-m_pImpl-PreNotify( rNEvt );
+if (m_pImpl)
+m_pImpl-PreNotify( rNEvt );
 return SfxModelessDialog::PreNotify(rNEvt);
 }
 
diff --git a/include/formula/formula.hxx b/include/formula/formula.hxx
index 07720d4..658e532 100644
--- a/include/formula/formula.hxx
+++ b/include/formula/formula.hxx
@@ -97,6 +97,7 @@ public:
 , IFunctionManager* _pFunctionMgr
 , IControlReferenceHandler* _pDlg = NULL );
 virtual ~FormulaDlg();
+virtual void dispose() SAL_OVERRIDE;
 private:
 ::std::unique_ptrFormulaDlg_Impl m_pImpl;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-05-07 Thread Michael Meeks
 formula/source/ui/dlg/formula.cxx |   21 ++---
 include/formula/formula.hxx   |1 +
 2 files changed, 15 insertions(+), 7 deletions(-)

New commits:
commit da49275807c8cf1dd7362a531f321f9f756e82d1
Author: Michael Meeks michael.me...@collabora.com
Date:   Thu May 7 16:24:23 2015 +0100

tdf#90935 - function wizard crash fix.

Change-Id: I1344e194f8fd5d2c04e8b075564df32706a8

diff --git a/formula/source/ui/dlg/formula.cxx 
b/formula/source/ui/dlg/formula.cxx
index a857c60..095be58 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -1643,21 +1643,28 @@ void FormulaDlg_Impl::SetEdSelection()
 } // if( pEd )
 }
 
-FormulaModalDialog::FormulaModalDialog( vcl::Window* pParent
-, bool _bSupportFunctionResult
-, bool _bSupportResult
-, bool _bSupportMatrix
-, IFunctionManager* _pFunctionMgr
-, IControlReferenceHandler* _pDlg )
+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, this, _pFunctionMgr, _pDlg))
+  _bSupportResult, _bSupportMatrix,
+  this, _pFunctionMgr, _pDlg))
 {
 SetText(m_pImpl-aTitle1);
 }
 
 FormulaModalDialog::~FormulaModalDialog() {}
 
+void FormulaModalDialog::dispose()
+{
+m_pImpl.reset();
+ModalDialog::dispose();
+}
+
 void FormulaModalDialog::Update(const OUString _sExp)
 {
 m_pImpl-Update(_sExp);
diff --git a/include/formula/formula.hxx b/include/formula/formula.hxx
index 1426404..07720d4 100644
--- a/include/formula/formula.hxx
+++ b/include/formula/formula.hxx
@@ -57,6 +57,7 @@ public:
 ,IFunctionManager* _pFunctionMgr
 ,IControlReferenceHandler* _pDlg = 
NULL );
 virtual ~FormulaModalDialog();
+virtual void dispose() SAL_OVERRIDE;
 
 private:
 ::std::unique_ptrFormulaDlg_Impl m_pImpl;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-05-05 Thread Winfried Donkers
 formula/source/core/resource/core_resource.src |7 ++
 include/formula/compiler.hrc   |3 
 include/formula/opcode.hxx |1 
 sc/inc/helpids.h   |1 
 sc/qa/unit/ucalc.cxx   |1 
 sc/source/core/inc/interpre.hxx|6 +
 sc/source/core/tool/interpr2.cxx   |   77 -
 sc/source/core/tool/interpr4.cxx   |3 
 sc/source/core/tool/odffmap.cxx|2 
 sc/source/core/tool/parclass.cxx   |1 
 sc/source/filter/excel/xlformula.cxx   |7 +-
 sc/source/filter/oox/formulabase.cxx   |2 
 sc/source/ui/src/scfuncs.src   |   48 +++
 scaddins/source/analysis/analysishelper.cxx|2 
 14 files changed, 136 insertions(+), 25 deletions(-)

New commits:
commit 111952dccc1bf9e28e61c0233816248c848cbf53
Author: Winfried Donkers winfrieddonk...@libreoffice.org
Date:   Mon May 12 12:02:11 2014 +0200

fdo#77985 make calc function NETWORKDAYS comply with ODFF1.2

Change-Id: I523b0c71bc0fed501a4d5fffd75c5a4704f6dd13
Reviewed-on: https://gerrit.libreoffice.org/9827
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 4462ee9..298560c 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -390,6 +390,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_WEEK { Text = ISOWEEKNUM ; };
 String SC_OPCODE_EASTERSUNDAY { Text = ORG.OPENOFFICE.EASTERSUNDAY ; };
 String SC_OPCODE_GET_DAY_OF_WEEK { Text = WEEKDAY ; };
+String SC_OPCODE_NETWORKDAYS { Text = NETWORKDAYS ; };
 String SC_OPCODE_NETWORKDAYS_MS { Text = COM.MICROSOFT.NETWORKDAYS.INTL 
; };
 String SC_OPCODE_WORKDAY_MS { Text = COM.MICROSOFT.WORKDAY.INTL ; };
 String SC_OPCODE_NO_NAME { Text = #NAME! ; };
@@ -808,6 +809,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_WEEK { Text = WEEKNUM ; };
 String SC_OPCODE_EASTERSUNDAY { Text = EASTERSUNDAY ; };
 String SC_OPCODE_GET_DAY_OF_WEEK { Text = WEEKDAY ; };
+String SC_OPCODE_NETWORKDAYS { Text = NETWORKDAYS ; };
 String SC_OPCODE_NETWORKDAYS_MS { Text = NETWORKDAYS.INTL ; };
 String SC_OPCODE_WORKDAY_MS { Text = WORKDAY.INTL ; };
 String SC_OPCODE_NO_NAME { Text = #NAME! ; };
@@ -1228,6 +1230,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_WEEK { Text = WEEKNUM ; };
 String SC_OPCODE_EASTERSUNDAY { Text = EASTERSUNDAY ; };
 String SC_OPCODE_GET_DAY_OF_WEEK { Text = WEEKDAY ; };
+String SC_OPCODE_NETWORKDAYS { Text = NETWORKDAYS ; };
 String SC_OPCODE_NETWORKDAYS_MS { Text = NETWORKDAYS.INTL ; };
 String SC_OPCODE_WORKDAY_MS { Text = WORKDAY.INTL ; };
 String SC_OPCODE_NO_NAME { Text = #NAME! ; };
@@ -2689,6 +2692,10 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = WEEKDAY ;
 };
+String SC_OPCODE_NETWORKDAYS
+{
+Text [ en-US ] = NETWORKDAYS ;
+};
 String SC_OPCODE_NETWORKDAYS_MS
 {
 Text [ en-US ] = NETWORKDAYS.INTL ;
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index f5bd316..4798c19 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -481,7 +481,8 @@
 #define SC_OPCODE_COLOR 471
 #define SC_OPCODE_CEIL  472
 #define SC_OPCODE_CEIL_PRECISE  473
-#define SC_OPCODE_STOP_2_PAR474 /* last function with two or more 
parameters' OpCode + 1 */
+#define SC_OPCODE_NETWORKDAYS   474
+#define SC_OPCODE_STOP_2_PAR475 /* last function with two or more 
parameters' OpCode + 1 */
 
 #define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR/* last 
function's OpCode + 1 */
 #define SC_OPCODE_LAST_OPCODE_ID(SC_OPCODE_STOP_FUNCTION - 1)   /* last 
OpCode */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 73b911a..9d4d676 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -448,6 +448,7 @@ enum OpCode : sal_uInt16
 // miscellaneous
 ocWeek  = SC_OPCODE_WEEK,
 ocGetDayOfWeek  = SC_OPCODE_GET_DAY_OF_WEEK,
+ocNetWorkdays   = SC_OPCODE_NETWORKDAYS,
 ocNetWorkdays_MS= SC_OPCODE_NETWORKDAYS_MS,
 ocWorkday_MS= SC_OPCODE_WORKDAY_MS,
 ocNoName= SC_OPCODE_NO_NAME,
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 0425fe5..367bb0d 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -621,6 +621,7 @@
 #define HID_FUNC_CEIL_PRECISE   
SC_HID_FUNC_CEIL_PRECISE
 #define HID_FUNC_CEIL_ISO   
SC_HID_FUNC_CEIL_ISO
 #define HID_FUNC_FLOOR_MS

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

2015-04-29 Thread Winfried Donkers
 formula/source/core/api/token.cxx  |   13 ++-
 formula/source/core/resource/core_resource.src |   22 -
 include/formula/compiler.hrc   |6 -
 include/formula/opcode.hxx |2 
 sc/inc/helpids.h   |2 
 sc/qa/unit/ucalc.cxx   |2 
 sc/source/core/inc/interpre.hxx|4 
 sc/source/core/tool/compiler.cxx   |   23 +++--
 sc/source/core/tool/interpr2.cxx   |   67 +---
 sc/source/core/tool/interpr4.cxx   |8 +
 sc/source/filter/excel/xlformula.cxx   |9 --
 sc/source/filter/oox/formulabase.cxx   |8 -
 sc/source/ui/src/scfuncs.src   |  102 +
 13 files changed, 211 insertions(+), 57 deletions(-)

New commits:
commit 010b2d2d9be846fb6b10848204e29e1bc00ef1ea
Author: Winfried Donkers winfrieddonk...@libreoffice.org
Date:   Tue Nov 11 17:33:48 2014 +0100

fdo#69552 [part 1] make calc functions CEILING comply with ODF1.2

Also, add support for CEILING.MATH and fix small
deficiencies with CEILING functions, as most are interwoven.

Change-Id: I0d9a46fb17e982ccf1e9d9e403b58926172c1a7a
Reviewed-on: https://gerrit.libreoffice.org/7088
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 5096421..a33ce70 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1053,6 +1053,8 @@ inline bool MissingConventionOOXML::isRewriteNeeded( 
OpCode eOp ) const
 
 case ocIndex:
 
+case ocCeil:
+
 case ocGammaDist:
 case ocFDist_LT:
 case ocPoissonDist:
@@ -1411,7 +1413,16 @@ FormulaTokenArray * FormulaTokenArray::RewriteMissing( 
const MissingConvention 
 break;
 }
 if (bAdd)
-pNewArr-AddToken( *pCur );
+{
+if ( pCur-GetOpCode() == ocCeil 
+ rConv.getConvention() == 
MissingConvention::FORMULA_MISSING_CONVENTION_OOXML )
+{
+FormulaToken *pToken = new FormulaToken( svByte, ocCeil_Math );
+pNewArr-AddToken( *pToken );
+}
+else
+pNewArr-AddToken( *pCur );
+}
 }
 
 if (pOcas != aOpCodeAddressStack[0])
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 31d5d94..4462ee9 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -149,8 +149,10 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_ERROR_TYPE_ODF { Text = ERROR.TYPE ; };
 String SC_OPCODE_FORMULA { Text = FORMULA; };
 String SC_OPCODE_ARC_TAN_2 { Text = ATAN2 ; };
+String SC_OPCODE_CEIL_MATH { Text = COM.MICROSOFT.CEILING.MATH ; };
 String SC_OPCODE_CEIL { Text = CEILING ; };
-String SC_OPCODE_CEIL_MS { Text = COM.MICROSOFT.CEILING.PRECISE ; };
+String SC_OPCODE_CEIL_MS { Text = COM.MICROSOFT.CEILING ; };
+String SC_OPCODE_CEIL_PRECISE { Text = COM.MICROSOFT.CEILING.PRECISE ; };
 String SC_OPCODE_CEIL_ISO { Text = COM.MICROSOFT.ISO.CEILING ; };
 String SC_OPCODE_FLOOR_MS { Text = COM.MICROSOFT.FLOOR.PRECISE ; };
 String SC_OPCODE_FLOOR { Text = FLOOR ; };
@@ -565,8 +567,10 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_ERROR_TYPE_ODF { Text = ERROR.TYPE ; };
 String SC_OPCODE_FORMULA { Text = _xlfn.FORMULATEXT; };
 String SC_OPCODE_ARC_TAN_2 { Text = ATAN2 ; };
-String SC_OPCODE_CEIL { Text = CEILING ; };
-String SC_OPCODE_CEIL_MS { Text = _xlfn.CEILING.PRECISE ; };
+String SC_OPCODE_CEIL_MATH { Text = _xlfn.CEILING.MATH ; };
+String SC_OPCODE_CEIL { Text = _xlfn.CEILING.MATH ; };
+String SC_OPCODE_CEIL_MS { Text = CEILING ; };
+String SC_OPCODE_CEIL_PRECISE { Text = _xlfn.CEILING.PRECISE ; };
 String SC_OPCODE_CEIL_ISO { Text = ISO.CEILING ; };
 String SC_OPCODE_FLOOR_MS { Text = _xlfn.FLOOR.PRECISE ; };
 String SC_OPCODE_FLOOR { Text = FLOOR ; };
@@ -983,8 +987,10 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_ERROR_TYPE_ODF { Text = ERROR.TYPE ; };
 String SC_OPCODE_FORMULA { Text = FORMULA; };
 String SC_OPCODE_ARC_TAN_2 { Text = ATAN2 ; };
+String SC_OPCODE_CEIL_MATH { Text = CEILING.MATH ; };
 String SC_OPCODE_CEIL { Text = CEILING ; };
-String SC_OPCODE_CEIL_MS { Text = CEILING.PRECISE ; };
+String SC_OPCODE_CEIL_MS { Text = CEILING.XCL ; };
+String SC_OPCODE_CEIL_PRECISE { Text = CEILING.PRECISE ; };
 String SC_OPCODE_CEIL_ISO { Text = ISO.CEILING ; };
 String SC_OPCODE_FLOOR_MS { Text = FLOOR.PRECISE ; };
 String SC_OPCODE_FLOOR { Text = FLOOR ; };
@@ -1718,12 +1724,20 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 

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

2015-01-26 Thread Winfried Donkers
 formula/source/core/resource/core_resource.src |7 
 include/formula/compiler.hrc   |3 +
 include/formula/opcode.hxx |1 
 sc/inc/helpids.h   |1 
 sc/qa/unit/ucalc.cxx   |1 
 sc/source/core/inc/interpre.hxx|1 
 sc/source/core/tool/interpr4.cxx   |1 
 sc/source/core/tool/interpr7.cxx   |   38 +
 sc/source/filter/excel/xlformula.cxx   |2 -
 sc/source/filter/oox/formulabase.cxx   |2 -
 sc/source/ui/src/scfuncs.src   |   23 +++
 11 files changed, 77 insertions(+), 3 deletions(-)

New commits:
commit 25434372bf56e0ebdb7e7d47ab3c14c68211509f
Author: Winfried Donkers winfrieddonk...@libreoffice.org
Date:   Mon Dec 15 09:45:26 2014 +0100

fdo#76870 Add support for Excel2013 function ENCODEURL

Change-Id: I369bcd58055364757b6a098fc3aa0c0065c79b67
Reviewed-on: https://gerrit.libreoffice.org/13478
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 1e9c312..2f3f2bc 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -427,6 +427,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_COLOR { Text = ORG.LIBREOFFICE.COLOR; };
 String SC_OPCODE_ERF_MS { Text = COM.MICROSOFT.ERF.PRECISE ; };
 String SC_OPCODE_ERFC_MS { Text = COM.MICROSOFT.ERFC.PRECISE ; };
+String SC_OPCODE_ENCODEURL { Text = COM.MICROSOFT.ENCODEURL; };
 };
 
 /** These function names are used only in the XLSX import. */
@@ -835,6 +836,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_COLOR { Text = _xlfn.ORG.LIBREOFFICE.COLOR; };
 String SC_OPCODE_ERF_MS { Text = _xlfn.ERF.PRECISE ; };
 String SC_OPCODE_ERFC_MS { Text = _xlfn.ERFC.PRECISE ; };
+String SC_OPCODE_ENCODEURL { Text = _xlfn.ENCODEURL; };
 };
 
 // DO NOT CHANGE NAMES! Only add functions.
@@ -1245,6 +1247,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_COLOR { Text = COLOR; };
 String SC_OPCODE_ERF_MS { Text = ERF.PRECISE ; };
 String SC_OPCODE_ERFC_MS { Text = ERFC.PRECISE ; };
+String SC_OPCODE_ENCODEURL { Text = ENCODEURL; };
 };
 
 Resource RID_STRLIST_FUNCTION_NAMES
@@ -2793,6 +2796,10 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [en-US ] = ERFC.PRECISE ;
 };
+String SC_OPCODE_ENCODEURL
+{
+Text [ en-US ] = ENCODEURL;
+};
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 2d2dd36..dbbea90 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -195,7 +195,8 @@
 #define SC_OPCODE_ERF_MS163
 #define SC_OPCODE_ERFC_MS   164
 #define SC_OPCODE_ERROR_TYPE_ODF165
-#define SC_OPCODE_STOP_1_PAR166
+#define SC_OPCODE_ENCODEURL 166
+#define SC_OPCODE_STOP_1_PAR167
 
 /*** Functions with more than one parameters ***/
 #define SC_OPCODE_START_2_PAR   201
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index a282dae..3a2af3a 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -465,6 +465,7 @@ enum OpCode : sal_uInt16
 ocColor = SC_OPCODE_COLOR,
 ocErf_MS= SC_OPCODE_ERF_MS,
 ocErfc_MS   = SC_OPCODE_ERFC_MS,
+ocEncodeURL = SC_OPCODE_ENCODEURL,
 // internal stuff
 ocInternalBegin = SC_OPCODE_INTERNAL_BEGIN,
 ocTTT   = SC_OPCODE_TTT,
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 9768806..574afb0 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -563,6 +563,7 @@
 #define HID_FUNC_BITRSHIFT  
SC_HID_FUNC_BITRSHIFT
 #define HID_FUNC_FILTERXML  
SC_HID_FUNC_FILTERXML
 #define HID_FUNC_WEBSERVICE 
SC_HID_FUNC_WEBSERVICE
+#define HID_FUNC_ENCODEURL  
SC_HID_FUNC_ENCODEURL
 #define HID_FUNC_COLOR  
SC_HID_FUNC_COLOR
 #define HID_FUNC_COVARIANCE_P   
SC_HID_FUNC_COVARIANCE_P
 #define HID_FUNC_COVARIANCE_S   
SC_HID_FUNC_COVARIANCE_S
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index eb4454f..b839816 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2669,6 +2669,7 @@ void Test::testFunctionLists()
 CONCATENATE,
 DECIMAL,
 DOLLAR,
+ENCODEURL,
 EXACT,
 FILTERXML,
 FIND,
diff --git a/sc/source/core/inc/interpre.hxx 

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

2015-01-14 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/api/token.cxx  |2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/lotus/lotform.cxx |4 ++--
 sc/source/filter/qpro/qproform.cxx |2 +-
 sc/source/ui/src/scfuncs.src   |4 ++--
 14 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit b08f87b62db81b498ea71e5e1049b96e3dc42da4
Author: Laurent Charrière lcharri...@gmail.com
Date:   Fri Jan 9 14:07:30 2015 +0100

fdo#85818: rename ZW to FV

Change-Id: I464cba72153ef70bbb14bf43a448a28d02095728
Reviewed-on: https://gerrit.libreoffice.org/13868
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index d1ef9a9..55a1063 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -99,7 +99,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 case ocVBD:
 case ocSLN:
 case ocPMT:
-case ocZW:
+case ocFV:
 case ocIpmt:
 case ocPpmt:
 case ocCumIpmt:
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 82cdcf2..0ae7059 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1260,7 +1260,7 @@ bool FormulaMissingContext::AddMissing( FormulaTokenArray 
*pNewArr, const Missin
 case ocPpmt:
 return AddDefaultArg( pNewArr, 4, 0.0 );
 case ocPV:
-case ocZW:  // FV
+case ocFV:
 bRet |= AddDefaultArg( pNewArr, 2, 0.0 );   // pmt
 bRet |= AddDefaultArg( pNewArr, 3, 0.0 );   // [fp]v
 break;
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 8a90a9c..ecdccb5 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -226,7 +226,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_ROW { Text = ROW ; };
 String SC_OPCODE_TABLE { Text = SHEET ; };
 String SC_OPCODE_RRI { Text = RRI ; };
-String SC_OPCODE_ZW { Text = FV ; };
+String SC_OPCODE_FV { Text = FV ; };
 String SC_OPCODE_ZZR { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_IPMT { Text = IPMT ; };
@@ -634,7 +634,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_ROW { Text = ROW ; };
 String SC_OPCODE_TABLE { Text = _xlfn.SHEET ; };
 String SC_OPCODE_RRI { Text = _xlfn.RRI ; };
-String SC_OPCODE_ZW { Text = FV ; };
+String SC_OPCODE_FV { Text = FV ; };
 String SC_OPCODE_ZZR { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_IPMT { Text = IPMT ; };
@@ -1044,7 +1044,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_ROW { Text = ROW ; };
 String SC_OPCODE_TABLE { Text = SHEET ; };
 String SC_OPCODE_RRI { Text = ZGZ ; };
-String SC_OPCODE_ZW { Text = FV ; };
+String SC_OPCODE_FV { Text = FV ; };
 String SC_OPCODE_ZZR { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_IPMT { Text = IPMT ; };
@@ -1990,7 +1990,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = RRI ;
 };
-String SC_OPCODE_ZW
+String SC_OPCODE_FV
 {
 Text [ en-US ] = FV ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 1d6b901..709fc1f 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -255,7 +255,7 @@
 #define SC_OPCODE_COLUMN254
 #define SC_OPCODE_ROW   255
 #define SC_OPCODE_RRI   256
-#define SC_OPCODE_ZW257
+#define SC_OPCODE_FV257
 #define SC_OPCODE_ZZR   258
 #define SC_OPCODE_RATE  259
 #define SC_OPCODE_IPMT  260
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 33cf54c..596d686 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -259,7 +259,7 @@ enum OpCode : sal_uInt16
 ocColumn= SC_OPCODE_COLUMN,
 ocRow   = SC_OPCODE_ROW,
 ocRRI  

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

2015-01-14 Thread Laurent Charrière
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/lotus/lotform.cxx |6 +++---
 sc/source/filter/qpro/qproform.cxx |2 +-
 sc/source/ui/src/scfuncs.src   |4 ++--
 12 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 7d7a16b9d3f9e45cb147e79d192ff9a20e59f0fe
Author: Laurent Charrière lcharri...@gmail.com
Date:   Fri Jan 9 14:38:54 2015 +0100

fdo#85818: translate ZZR to Nper

Change-Id: Ib118d92a026526483da87dfe04871de25caa8ac1
Reviewed-on: https://gerrit.libreoffice.org/13869
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index ecdccb5..2f79b48 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -227,7 +227,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_TABLE { Text = SHEET ; };
 String SC_OPCODE_RRI { Text = RRI ; };
 String SC_OPCODE_FV { Text = FV ; };
-String SC_OPCODE_ZZR { Text = NPER ; };
+String SC_OPCODE_NPER { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_IPMT { Text = IPMT ; };
 String SC_OPCODE_PPMT { Text = PPMT ; };
@@ -635,7 +635,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_TABLE { Text = _xlfn.SHEET ; };
 String SC_OPCODE_RRI { Text = _xlfn.RRI ; };
 String SC_OPCODE_FV { Text = FV ; };
-String SC_OPCODE_ZZR { Text = NPER ; };
+String SC_OPCODE_NPER { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_IPMT { Text = IPMT ; };
 String SC_OPCODE_PPMT { Text = PPMT ; };
@@ -1045,7 +1045,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_TABLE { Text = SHEET ; };
 String SC_OPCODE_RRI { Text = ZGZ ; };
 String SC_OPCODE_FV { Text = FV ; };
-String SC_OPCODE_ZZR { Text = NPER ; };
+String SC_OPCODE_NPER { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_IPMT { Text = IPMT ; };
 String SC_OPCODE_PPMT { Text = PPMT ; };
@@ -1994,7 +1994,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = FV ;
 };
-String SC_OPCODE_ZZR
+String SC_OPCODE_NPER
 {
 Text [ en-US ] = NPER ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 709fc1f..e645fcb 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -256,7 +256,7 @@
 #define SC_OPCODE_ROW   255
 #define SC_OPCODE_RRI   256
 #define SC_OPCODE_FV257
-#define SC_OPCODE_ZZR   258
+#define SC_OPCODE_NPER  258
 #define SC_OPCODE_RATE  259
 #define SC_OPCODE_IPMT  260
 #define SC_OPCODE_PPMT  261
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 596d686..57aa6a1 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -260,7 +260,7 @@ enum OpCode : sal_uInt16
 ocRow   = SC_OPCODE_ROW,
 ocRRI   = SC_OPCODE_RRI,
 ocFV= SC_OPCODE_FV,
-ocZZR   = SC_OPCODE_ZZR,
+ocNper  = SC_OPCODE_NPER,
 ocRate  = SC_OPCODE_RATE,
 ocIpmt  = SC_OPCODE_IPMT,
 ocPpmt  = SC_OPCODE_PPMT,
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 3ae3fb6..6c7cd09 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -680,7 +680,7 @@ void ScRRI();
 double ScGetZw(double fZins, double fZzr, double fRmz,
   double fBw, double fF);
 void ScFV();
-void ScZZR();
+void ScNper();
 bool RateIteration(double fNper, double fPayment, double fPv,
 double fFv, double fPayType, double fGuess);
 void ScRate();
diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 22a5986..94b0b28 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -2722,7 +2722,7 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
 mvSubArguments.push_back(SoPHelper(ts,
 ft-Children[i], new OpKurt, nResultSize));
 break;
-   

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

2015-01-14 Thread Laurent Charrière
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/ui/src/scfuncs.src   |2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit ed20e81a886a13125a551ce24b6f9408d61e8e61
Author: Laurent Charrière lcharri...@gmail.com
Date:   Tue Jan 13 10:54:02 2015 +0100

fd0#85818: rename SC_OPCODE_NBW to SC_OPCODE_NPV

Change-Id: I1f7b51094acf0baf79160f65fdec67c9934930aa
Reviewed-on: https://gerrit.libreoffice.org/13897
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 062b432..1e9c312 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -182,7 +182,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_AVERAGE_A { Text = AVERAGEA ; };
 String SC_OPCODE_COUNT { Text = COUNT ; };
 String SC_OPCODE_COUNT_2 { Text = COUNTA ; };
-String SC_OPCODE_NBW { Text = NPV ; };
+String SC_OPCODE_NPV { Text = NPV ; };
 String SC_OPCODE_IRR { Text = IRR ; };
 String SC_OPCODE_MIRR { Text = MIRR ; };
 String SC_OPCODE_ISPMT { Text = ISPMT ; };
@@ -590,7 +590,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_AVERAGE_A { Text = AVERAGEA ; };
 String SC_OPCODE_COUNT { Text = COUNT ; };
 String SC_OPCODE_COUNT_2 { Text = COUNTA ; };
-String SC_OPCODE_NBW { Text = NPV ; };
+String SC_OPCODE_NPV { Text = NPV ; };
 String SC_OPCODE_IRR { Text = IRR ; };
 String SC_OPCODE_MIRR { Text = MIRR ; };
 String SC_OPCODE_ISPMT { Text = ISPMT ; };
@@ -1000,7 +1000,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_AVERAGE_A { Text = AVERAGEA ; };
 String SC_OPCODE_COUNT { Text = COUNT ; };
 String SC_OPCODE_COUNT_2 { Text = COUNTA ; };
-String SC_OPCODE_NBW { Text = NPV ; };
+String SC_OPCODE_NPV { Text = NPV ; };
 String SC_OPCODE_IRR { Text = IRR ; };
 String SC_OPCODE_MIRR { Text = MIRR ; };
 String SC_OPCODE_ISPMT { Text = ISPMT ; };
@@ -1814,7 +1814,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = COUNTA ;
 };
-String SC_OPCODE_NBW
+String SC_OPCODE_NPV
 {
 Text [ en-US ] = NPV ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 7cd6653..2d2dd36 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -227,7 +227,7 @@
 #define SC_OPCODE_AVERAGE   226
 #define SC_OPCODE_COUNT 227
 #define SC_OPCODE_COUNT_2   228
-#define SC_OPCODE_NBW   229
+#define SC_OPCODE_NPV   229
 #define SC_OPCODE_IRR   230
 #define SC_OPCODE_VAR   231
 #define SC_OPCODE_VAR_P 232
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 43f2467..a282dae 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -220,7 +220,7 @@ enum OpCode : sal_uInt16
 ocAverage   = SC_OPCODE_AVERAGE,
 ocCount = SC_OPCODE_COUNT,
 ocCount2= SC_OPCODE_COUNT_2,
-ocNPV   = SC_OPCODE_NBW,
+ocNPV   = SC_OPCODE_NPV,
 ocIRR   = SC_OPCODE_IRR,
 ocMIRR  = SC_OPCODE_MIRR,
 ocISPMT = SC_OPCODE_ISPMT,
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index b0c2182..2e5e960 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -2045,7 +2045,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1
 };
 };
  // -=*# Resource for function NPV #*=-
-Resource SC_OPCODE_NBW
+Resource SC_OPCODE_NPV
 {
 String 1 // Description
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-01-14 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/interpr5.cxx   |2 +-
 sc/source/core/tool/parclass.cxx   |2 +-
 sc/source/filter/excel/xlformula.cxx   |4 ++--
 sc/source/ui/src/scfuncs.src   |2 +-
 10 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit e613c9fba449fda0db163de413eeda50f521db41
Author: Laurent Charrière lcharri...@gmail.com
Date:   Tue Jan 13 10:44:35 2015 +0100

fdo#85818: rename RGP to Linest

Change-Id: I4bdf934730a54a76f5762fd079dc6270fa135840
Reviewed-on: https://gerrit.libreoffice.org/13893
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index ebc5edd..0109587 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -849,7 +849,7 @@ bool FormulaCompiler::IsMatrixFunction( OpCode eOpCode )
 case ocGrowth :
 case ocTrend :
 case ocLogest :
-case ocRGP :
+case ocLinest :
 case ocFrequency :
 case ocMatTrans :
 case ocMatMult :
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index c92..9d22494 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -360,7 +360,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_INTERCEPT { Text = INTERCEPT ; };
 String SC_OPCODE_TREND { Text = TREND ; };
 String SC_OPCODE_GROWTH { Text = GROWTH ; };
-String SC_OPCODE_RGP { Text = LINEST ; };
+String SC_OPCODE_LINEST { Text = LINEST ; };
 String SC_OPCODE_LOGEST { Text = LOGEST ; };
 String SC_OPCODE_FORECAST { Text = FORECAST ; };
 String SC_OPCODE_CHI_INV { Text = LEGACY.CHIINV ; };
@@ -768,7 +768,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_INTERCEPT { Text = INTERCEPT ; };
 String SC_OPCODE_TREND { Text = TREND ; };
 String SC_OPCODE_GROWTH { Text = GROWTH ; };
-String SC_OPCODE_RGP { Text = LINEST ; };
+String SC_OPCODE_LINEST { Text = LINEST ; };
 String SC_OPCODE_LOGEST { Text = LOGEST ; };
 String SC_OPCODE_FORECAST { Text = FORECAST ; };
 String SC_OPCODE_CHI_INV { Text = CHIINV ; };
@@ -1178,7 +1178,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_INTERCEPT { Text = INTERCEPT ; };
 String SC_OPCODE_TREND { Text = TREND ; };
 String SC_OPCODE_GROWTH { Text = GROWTH ; };
-String SC_OPCODE_RGP { Text = LINEST ; };
+String SC_OPCODE_LINEST { Text = LINEST ; };
 String SC_OPCODE_LOGEST { Text = LOGEST ; };
 String SC_OPCODE_FORECAST { Text = FORECAST ; };
 String SC_OPCODE_CHI_INV { Text = CHIINV ; };
@@ -2527,7 +2527,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = GROWTH ;
 };
-String SC_OPCODE_RGP
+String SC_OPCODE_LINEST
 {
 Text [ en-US ] = LINEST ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index b09b756..6ace741 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -350,7 +350,7 @@
 #define SC_OPCODE_INTERCEPT 349
 #define SC_OPCODE_TREND 350
 #define SC_OPCODE_GROWTH351
-#define SC_OPCODE_RGP   352
+#define SC_OPCODE_LINEST352
 #define SC_OPCODE_LOGEST353
 #define SC_OPCODE_FORECAST  354
 #define SC_OPCODE_CHI_INV   355
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 94756b4d..039 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -405,7 +405,7 @@ enum OpCode : sal_uInt16
 ocIntercept = SC_OPCODE_INTERCEPT,
 ocTrend = SC_OPCODE_TREND,
 ocGrowth= SC_OPCODE_GROWTH,
-ocRGP   = SC_OPCODE_RGP,
+ocLinest= SC_OPCODE_LINEST,
 ocLogest= SC_OPCODE_LOGEST,
 ocForecast  = SC_OPCODE_FORECAST,
 ocChiInv= SC_OPCODE_CHI_INV,
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 222e7b9c..07e1cce 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -730,7 +730,7 @@ void CalculateRGPRKP(bool _bRKP);
 void CalculateSumX2MY2SumX2DY2(bool _bSumX2DY2);
 void CalculateMatrixValue(const ScMatrix* pMat,SCSIZE nC,SCSIZE nR);
 bool CheckMatrix(bool _bLOG,sal_uInt8 nCase,SCSIZE nCX,SCSIZE nCY,SCSIZE 

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

2015-01-14 Thread Laurent Charrière
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/ui/src/scfuncs.src   |2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 3fe6a6b3ca3bc0c7d46fabf66f11f1ef6b4cd4cc
Author: Laurent Charrière lcharri...@gmail.com
Date:   Tue Jan 13 10:46:38 2015 +0100

fdo#85818: rename SC_OPCODE_KGV to SC_OPCODE_LCM

Change-Id: I4a49a00a8cc74c7ff0752ef0bffbf855fecb232c
Reviewed-on: https://gerrit.libreoffice.org/13894
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 9d22494..2a548b3 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -160,7 +160,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_LOG { Text = LOG ; };
 String SC_OPCODE_POWER { Text = POWER ; };
 String SC_OPCODE_GGT { Text = GCD ; };
-String SC_OPCODE_KGV { Text = LCM ; };
+String SC_OPCODE_LCM { Text = LCM ; };
 String SC_OPCODE_MOD { Text = MOD ; };
 String SC_OPCODE_SUM_PRODUCT { Text = SUMPRODUCT ; };
 String SC_OPCODE_SUM_SQ { Text = SUMSQ ; };
@@ -568,7 +568,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_LOG { Text = LOG ; };
 String SC_OPCODE_POWER { Text = POWER ; };
 String SC_OPCODE_GGT { Text = GCD ; };
-String SC_OPCODE_KGV { Text = LCM ; };
+String SC_OPCODE_LCM { Text = LCM ; };
 String SC_OPCODE_MOD { Text = MOD ; };
 String SC_OPCODE_SUM_PRODUCT { Text = SUMPRODUCT ; };
 String SC_OPCODE_SUM_SQ { Text = SUMSQ ; };
@@ -978,7 +978,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_LOG { Text = LOG ; };
 String SC_OPCODE_POWER { Text = POWER ; };
 String SC_OPCODE_GGT { Text = GCD ; };
-String SC_OPCODE_KGV { Text = LCM ; };
+String SC_OPCODE_LCM { Text = LCM ; };
 String SC_OPCODE_MOD { Text = MOD ; };
 String SC_OPCODE_SUM_PRODUCT { Text = SUMPRODUCT ; };
 String SC_OPCODE_SUM_SQ { Text = SUMSQ ; };
@@ -1726,7 +1726,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = GCD ;
 };
-String SC_OPCODE_KGV
+String SC_OPCODE_LCM
 {
 Text [ en-US ] = LCM ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 6ace741..c69f4fa 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -209,7 +209,7 @@
 #define SC_OPCODE_LOG   208
 #define SC_OPCODE_POWER 209
 #define SC_OPCODE_GGT   210
-#define SC_OPCODE_KGV   211
+#define SC_OPCODE_LCM   211
 #define SC_OPCODE_MOD   212
 #define SC_OPCODE_SUM_PRODUCT   213
 #define SC_OPCODE_SUM_SQ214
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 039..9b7867e 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -201,7 +201,7 @@ enum OpCode : sal_uInt16
 ocLog   = SC_OPCODE_LOG,
 ocPower = SC_OPCODE_POWER,
 ocGCD   = SC_OPCODE_GGT,
-ocLCM   = SC_OPCODE_KGV,
+ocLCM   = SC_OPCODE_LCM,
 ocMod   = SC_OPCODE_MOD,
 ocSumProduct= SC_OPCODE_SUM_PRODUCT,
 ocSumSQ = SC_OPCODE_SUM_SQ,
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 64c4780..8c041d5 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -4660,7 +4660,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1
 };
 };
  // -=*# Resource for function LCM #*=-
-Resource SC_OPCODE_KGV
+Resource SC_OPCODE_LCM
 {
 String 1 // Description
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-01-14 Thread Laurent Charrière
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/ui/src/scfuncs.src   |2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit f7f8d82a25b0c55bcd2225ca0cac1d93c676f544
Author: Laurent Charrière lcharri...@gmail.com
Date:   Tue Jan 13 10:50:24 2015 +0100

fdo#85818: rename SC_OPCODE_GGT to SC_OPCODE_GCD

Change-Id: I65a79d4e88f82cb76d9b6ab39f06a11acd4f3e41
Reviewed-on: https://gerrit.libreoffice.org/13895
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 2a548b3..93d08f2 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -159,7 +159,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_TRUNC { Text = TRUNC ; };
 String SC_OPCODE_LOG { Text = LOG ; };
 String SC_OPCODE_POWER { Text = POWER ; };
-String SC_OPCODE_GGT { Text = GCD ; };
+String SC_OPCODE_GCD { Text = GCD ; };
 String SC_OPCODE_LCM { Text = LCM ; };
 String SC_OPCODE_MOD { Text = MOD ; };
 String SC_OPCODE_SUM_PRODUCT { Text = SUMPRODUCT ; };
@@ -567,7 +567,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_TRUNC { Text = TRUNC ; };
 String SC_OPCODE_LOG { Text = LOG ; };
 String SC_OPCODE_POWER { Text = POWER ; };
-String SC_OPCODE_GGT { Text = GCD ; };
+String SC_OPCODE_GCD { Text = GCD ; };
 String SC_OPCODE_LCM { Text = LCM ; };
 String SC_OPCODE_MOD { Text = MOD ; };
 String SC_OPCODE_SUM_PRODUCT { Text = SUMPRODUCT ; };
@@ -977,7 +977,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_TRUNC { Text = TRUNC ; };
 String SC_OPCODE_LOG { Text = LOG ; };
 String SC_OPCODE_POWER { Text = POWER ; };
-String SC_OPCODE_GGT { Text = GCD ; };
+String SC_OPCODE_GCD { Text = GCD ; };
 String SC_OPCODE_LCM { Text = LCM ; };
 String SC_OPCODE_MOD { Text = MOD ; };
 String SC_OPCODE_SUM_PRODUCT { Text = SUMPRODUCT ; };
@@ -1722,7 +1722,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = POWER ;
 };
-String SC_OPCODE_GGT
+String SC_OPCODE_GCD
 {
 Text [ en-US ] = GCD ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index c69f4fa..fc47ae8 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -208,7 +208,7 @@
 #define SC_OPCODE_TRUNC 207
 #define SC_OPCODE_LOG   208
 #define SC_OPCODE_POWER 209
-#define SC_OPCODE_GGT   210
+#define SC_OPCODE_GCD   210
 #define SC_OPCODE_LCM   211
 #define SC_OPCODE_MOD   212
 #define SC_OPCODE_SUM_PRODUCT   213
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 9b7867e..724667f 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -200,7 +200,7 @@ enum OpCode : sal_uInt16
 ocTrunc = SC_OPCODE_TRUNC,
 ocLog   = SC_OPCODE_LOG,
 ocPower = SC_OPCODE_POWER,
-ocGCD   = SC_OPCODE_GGT,
+ocGCD   = SC_OPCODE_GCD,
 ocLCM   = SC_OPCODE_LCM,
 ocMod   = SC_OPCODE_MOD,
 ocSumProduct= SC_OPCODE_SUM_PRODUCT,
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 8c041d5..0c0b310 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -4636,7 +4636,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1
 };
 };
  // -=*# Resource for function GCD #*=-
-Resource SC_OPCODE_GGT
+Resource SC_OPCODE_GCD
 {
 String 1 // Description
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-01-14 Thread Laurent Charrière
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/ui/src/scfuncs.src   |2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit ed6c797d07f6e7f1afdb272046f9a02b973f97de
Author: Laurent Charrière lcharri...@gmail.com
Date:   Tue Jan 13 10:52:23 2015 +0100

fdo#85818: rename SC_OPCODE_IKV to SC_OPCODE_IRR

Change-Id: I8148081e2f2d89bdd319b5dc7346af672a8cf310
Reviewed-on: https://gerrit.libreoffice.org/13896
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 93d08f2..062b432 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -183,7 +183,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_COUNT { Text = COUNT ; };
 String SC_OPCODE_COUNT_2 { Text = COUNTA ; };
 String SC_OPCODE_NBW { Text = NPV ; };
-String SC_OPCODE_IKV { Text = IRR ; };
+String SC_OPCODE_IRR { Text = IRR ; };
 String SC_OPCODE_MIRR { Text = MIRR ; };
 String SC_OPCODE_ISPMT { Text = ISPMT ; };
 String SC_OPCODE_VAR { Text = VAR ; };
@@ -591,7 +591,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_COUNT { Text = COUNT ; };
 String SC_OPCODE_COUNT_2 { Text = COUNTA ; };
 String SC_OPCODE_NBW { Text = NPV ; };
-String SC_OPCODE_IKV { Text = IRR ; };
+String SC_OPCODE_IRR { Text = IRR ; };
 String SC_OPCODE_MIRR { Text = MIRR ; };
 String SC_OPCODE_ISPMT { Text = ISPMT ; };
 String SC_OPCODE_VAR { Text = VAR ; };
@@ -1001,7 +1001,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_COUNT { Text = COUNT ; };
 String SC_OPCODE_COUNT_2 { Text = COUNTA ; };
 String SC_OPCODE_NBW { Text = NPV ; };
-String SC_OPCODE_IKV { Text = IRR ; };
+String SC_OPCODE_IRR { Text = IRR ; };
 String SC_OPCODE_MIRR { Text = MIRR ; };
 String SC_OPCODE_ISPMT { Text = ISPMT ; };
 String SC_OPCODE_VAR { Text = VAR ; };
@@ -1818,7 +1818,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = NPV ;
 };
-String SC_OPCODE_IKV
+String SC_OPCODE_IRR
 {
 Text [ en-US ] = IRR ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index fc47ae8..7cd6653 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -228,7 +228,7 @@
 #define SC_OPCODE_COUNT 227
 #define SC_OPCODE_COUNT_2   228
 #define SC_OPCODE_NBW   229
-#define SC_OPCODE_IKV   230
+#define SC_OPCODE_IRR   230
 #define SC_OPCODE_VAR   231
 #define SC_OPCODE_VAR_P 232
 #define SC_OPCODE_ST_DEV233
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 724667f..43f2467 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -221,7 +221,7 @@ enum OpCode : sal_uInt16
 ocCount = SC_OPCODE_COUNT,
 ocCount2= SC_OPCODE_COUNT_2,
 ocNPV   = SC_OPCODE_NBW,
-ocIRR   = SC_OPCODE_IKV,
+ocIRR   = SC_OPCODE_IRR,
 ocMIRR  = SC_OPCODE_MIRR,
 ocISPMT = SC_OPCODE_ISPMT,
 ocVar   = SC_OPCODE_VAR,
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 0c0b310..b0c2182 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -2077,7 +2077,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS1
 };
 };
  // -=*# Resource for function IRR #*=-
-Resource SC_OPCODE_IKV
+Resource SC_OPCODE_IRR
 {
 String 1 // Description
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-01-14 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/interpr5.cxx   |2 +-
 sc/source/core/tool/parclass.cxx   |2 +-
 sc/source/filter/excel/xlformula.cxx   |4 ++--
 sc/source/ui/src/scfuncs.src   |2 +-
 10 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit be2e6ea58b0025d1bcf7a901c89532737efcbe09
Author: Laurent Charrière lcharri...@gmail.com
Date:   Mon Jan 12 20:50:49 2015 +0100

fdo#85818: rename RKP to Logest

Change-Id: I35e4d80e3d7744c4c9c74b12856a603db8363dbc
Reviewed-on: https://gerrit.libreoffice.org/13892
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 3908378..ebc5edd 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -848,7 +848,7 @@ bool FormulaCompiler::IsMatrixFunction( OpCode eOpCode )
 case ocDde :
 case ocGrowth :
 case ocTrend :
-case ocRKP :
+case ocLogest :
 case ocRGP :
 case ocFrequency :
 case ocMatTrans :
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 88b6e28..c92 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -361,7 +361,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_TREND { Text = TREND ; };
 String SC_OPCODE_GROWTH { Text = GROWTH ; };
 String SC_OPCODE_RGP { Text = LINEST ; };
-String SC_OPCODE_RKP { Text = LOGEST ; };
+String SC_OPCODE_LOGEST { Text = LOGEST ; };
 String SC_OPCODE_FORECAST { Text = FORECAST ; };
 String SC_OPCODE_CHI_INV { Text = LEGACY.CHIINV ; };
 String SC_OPCODE_CHI_INV_MS { Text = COM.MICROSOFT.CHISQ.INV.RT ; };
@@ -769,7 +769,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_TREND { Text = TREND ; };
 String SC_OPCODE_GROWTH { Text = GROWTH ; };
 String SC_OPCODE_RGP { Text = LINEST ; };
-String SC_OPCODE_RKP { Text = LOGEST ; };
+String SC_OPCODE_LOGEST { Text = LOGEST ; };
 String SC_OPCODE_FORECAST { Text = FORECAST ; };
 String SC_OPCODE_CHI_INV { Text = CHIINV ; };
 String SC_OPCODE_CHI_INV_MS { Text = _xlfn.CHISQ.INV.RT ; };
@@ -1179,7 +1179,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_TREND { Text = TREND ; };
 String SC_OPCODE_GROWTH { Text = GROWTH ; };
 String SC_OPCODE_RGP { Text = LINEST ; };
-String SC_OPCODE_RKP { Text = LOGEST ; };
+String SC_OPCODE_LOGEST { Text = LOGEST ; };
 String SC_OPCODE_FORECAST { Text = FORECAST ; };
 String SC_OPCODE_CHI_INV { Text = CHIINV ; };
 String SC_OPCODE_CHI_INV_MS { Text = CHISQ.INV.RT ; };
@@ -2531,7 +2531,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = LINEST ;
 };
-String SC_OPCODE_RKP
+String SC_OPCODE_LOGEST
 {
 Text [ en-US ] = LOGEST ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 61ec34c..b09b756 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -351,7 +351,7 @@
 #define SC_OPCODE_TREND 350
 #define SC_OPCODE_GROWTH351
 #define SC_OPCODE_RGP   352
-#define SC_OPCODE_RKP   353
+#define SC_OPCODE_LOGEST353
 #define SC_OPCODE_FORECAST  354
 #define SC_OPCODE_CHI_INV   355
 #define SC_OPCODE_GAMMA_DIST356
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index c6b0a0a..94756b4d 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -406,7 +406,7 @@ enum OpCode : sal_uInt16
 ocTrend = SC_OPCODE_TREND,
 ocGrowth= SC_OPCODE_GROWTH,
 ocRGP   = SC_OPCODE_RGP,
-ocRKP   = SC_OPCODE_RKP,
+ocLogest= SC_OPCODE_LOGEST,
 ocForecast  = SC_OPCODE_FORECAST,
 ocChiInv= SC_OPCODE_CHI_INV,
 ocChiInv_MS = SC_OPCODE_CHI_INV_MS,
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 1a59d10..222e7b9c 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -731,7 +731,7 @@ void CalculateSumX2MY2SumX2DY2(bool _bSumX2DY2);
 void CalculateMatrixValue(const ScMatrix* pMat,SCSIZE nC,SCSIZE nR);
 bool CheckMatrix(bool _bLOG,sal_uInt8 nCase,SCSIZE nCX,SCSIZE nCY,SCSIZE 
nRX,SCSIZE nRY,SCSIZE 

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

2015-01-14 Thread Laurent Charrière
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/parclass.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/lotus/lotform.cxx |2 +-
 sc/source/ui/src/scfuncs.src   |2 +-
 10 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit d6be636b19aea636ea5ba1007fd27eee61fb0dab
Author: Laurent Charrière lcharri...@gmail.com
Date:   Mon Jan 12 20:23:29 2015 +0100

fdo#85818: rename Schiefe to Skew

Change-Id: Ie8da01e3062e380070672406e1dcd9227bf75f95
Reviewed-on: https://gerrit.libreoffice.org/13891
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index e11ec36..88b6e28 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -313,7 +313,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_GEO_MEAN { Text = GEOMEAN ; };
 String SC_OPCODE_STANDARD { Text = STANDARDIZE ; };
 String SC_OPCODE_AVE_DEV { Text = AVEDEV ; };
-String SC_OPCODE_SCHIEFE { Text = SKEW ; };
+String SC_OPCODE_SKEW { Text = SKEW ; };
 String SC_OPCODE_SKEWP   { Text = SKEWP ; };
 String SC_OPCODE_DEV_SQ { Text = DEVSQ ; };
 String SC_OPCODE_MEDIAN { Text = MEDIAN ; };
@@ -721,7 +721,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_GEO_MEAN { Text = GEOMEAN ; };
 String SC_OPCODE_STANDARD { Text = STANDARDIZE ; };
 String SC_OPCODE_AVE_DEV { Text = AVEDEV ; };
-String SC_OPCODE_SCHIEFE { Text = SKEW ; };
+String SC_OPCODE_SKEW { Text = SKEW ; };
 String SC_OPCODE_SKEWP   { Text = _xlfn.SKEW.P ; };
 String SC_OPCODE_DEV_SQ { Text = DEVSQ ; };
 String SC_OPCODE_MEDIAN { Text = MEDIAN ; };
@@ -1131,7 +1131,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_GEO_MEAN { Text = GEOMEAN ; };
 String SC_OPCODE_STANDARD { Text = STANDARDIZE ; };
 String SC_OPCODE_AVE_DEV { Text = AVEDEV ; };
-String SC_OPCODE_SCHIEFE { Text = SKEW ; };
+String SC_OPCODE_SKEW { Text = SKEW ; };
 String SC_OPCODE_SKEWP   { Text = SKEWP ; };
 String SC_OPCODE_DEV_SQ { Text = DEVSQ ; };
 String SC_OPCODE_MEDIAN { Text = MEDIAN ; };
@@ -2339,7 +2339,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = AVEDEV ;
 };
-String SC_OPCODE_SCHIEFE
+String SC_OPCODE_SKEW
 {
 Text [ en-US ] = SKEW ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index a7618f6..61ec34c 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -323,7 +323,7 @@
 #define SC_OPCODE_GEO_MEAN  322
 #define SC_OPCODE_STANDARD  323
 #define SC_OPCODE_AVE_DEV   324
-#define SC_OPCODE_SCHIEFE   325
+#define SC_OPCODE_SKEW  325
 #define SC_OPCODE_DEV_SQ326
 #define SC_OPCODE_MEDIAN327
 #define SC_OPCODE_MODAL_VALUE   328
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 454242d..c6b0a0a 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -358,7 +358,7 @@ enum OpCode : sal_uInt16
 ocGeoMean   = SC_OPCODE_GEO_MEAN,
 ocStandard  = SC_OPCODE_STANDARD,
 ocAveDev= SC_OPCODE_AVE_DEV,
-ocSchiefe   = SC_OPCODE_SCHIEFE,
+ocSkew  = SC_OPCODE_SKEW,
 ocSkewp = SC_OPCODE_SKEWP,
 ocDevSq = SC_OPCODE_DEV_SQ,
 ocMedian= SC_OPCODE_MEDIAN,
diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index dd844bd..06d3417 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -2951,7 +2951,7 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
 mvSubArguments.push_back(SoPHelper(ts,
 ft-Children[i], new OpTrunc, nResultSize));
 break;
-case ocSchiefe:
+case ocSkew:
 mvSubArguments.push_back(SoPHelper(ts,
 ft-Children[i], new OpSkew, nResultSize));
 break;
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index c2afa5b..d2fa09a 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -4133,7 +4133,7 @@ StackVar ScInterpreter::Interpret()
 case ocAveDev   : ScAveDev();  

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

2015-01-14 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|   10 +-
 formula/source/core/api/token.cxx  |   14 +++---
 formula/source/core/resource/core_resource.src |8 
 include/formula/FormulaCompiler.hxx|2 +-
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 include/formula/tokenarray.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/tool/interpr1.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |6 +++---
 sc/source/core/tool/parclass.cxx   |4 ++--
 sc/source/core/tool/token.cxx  |4 ++--
 sc/source/filter/excel/xeformula.cxx   |6 +++---
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/lotus/lotform.cxx |6 +++---
 sc/source/filter/qpro/qproform.cxx |2 +-
 sc/source/ui/src/scfuncs.src   |2 +-
 sc/source/ui/unoobj/tokenuno.cxx   |2 +-
 18 files changed, 39 insertions(+), 39 deletions(-)

New commits:
commit 1f56cbf8cc15f76131d1dc8801935bec92be05ea
Author: Laurent Charrière lcharri...@gmail.com
Date:   Mon Jan 12 19:56:39 2015 +0100

sc: rename ocChose et al. to ocChoose et al.

Change-Id: I1aa8ee6c827a6d6a6c6beb190bdc9c3c91d82b22
Reviewed-on: https://gerrit.libreoffice.org/13889
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 55a1063..3908378 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -465,7 +465,7 @@ uno::Sequence sheet::FormulaOpCodeMapEntry  
FormulaCompiler::OpCodeMap::create
 SC_OPCODE_IF,
 SC_OPCODE_IF_ERROR,
 SC_OPCODE_IF_NA,
-SC_OPCODE_CHOSE,
+SC_OPCODE_CHOOSE,
 SC_OPCODE_AND,
 SC_OPCODE_OR,
 SC_OPCODE_NOT,
@@ -814,7 +814,7 @@ bool FormulaCompiler::IsOpCodeJumpCommand( OpCode eOp )
 case ocIf:
 case ocIfError:
 case ocIfNA:
-case ocChose:
+case ocChoose:
 return true;
 default:
 ;
@@ -1318,7 +1318,7 @@ void FormulaCompiler::Factor()
 case ocIf:
 pFacToken-GetJump()[ 0 ] = 3;  // if, else, behind
 break;
-case ocChose:
+case ocChoose:
 pFacToken-GetJump()[ 0 ] = FORMULA_MAXJUMPCOUNT + 1;
 break;
 case ocIfError:
@@ -1348,7 +1348,7 @@ void FormulaCompiler::Factor()
 case ocIf:
 nJumpMax = 3;
 break;
-case ocChose:
+case ocChoose:
 nJumpMax = FORMULA_MAXJUMPCOUNT;
 break;
 case ocIfError:
@@ -1385,7 +1385,7 @@ void FormulaCompiler::Factor()
 case ocIf:
 bLimitOk = (nJumpCount = 3);
 break;
-case ocChose:
+case ocChoose:
 bLimitOk = (nJumpCount  FORMULA_MAXJUMPCOUNT); /* 
TODO: check, really , not =? */
 break;
 case ocIfError:
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 0ae7059..e033835 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -81,7 +81,7 @@ bool FormulaToken::IsFunction() const
 eOp != ocColRowNameAuto  eOp != ocName  eOp != ocDBArea 
(GetByte() != 0  // 
x parameters
 || (SC_OPCODE_START_NO_PAR = eOp  eOp  SC_OPCODE_STOP_NO_PAR)   // 
no parameter
-|| (ocIf == eOp || ocIfError == eOp || ocIfNA == eOp || ocChose == eOp 
) // @ jump commands
+|| (ocIf == eOp || ocIfError == eOp || ocIfNA == eOp || ocChoose == 
eOp ) // @ jump commands
 || (SC_OPCODE_START_1_PAR = eOp  eOp  SC_OPCODE_STOP_1_PAR) // 
one parameter
 || (SC_OPCODE_START_2_PAR = eOp  eOp  SC_OPCODE_STOP_2_PAR) // 
x parameters (cByte==0 in
 // 
FuncAutoPilot)
@@ -96,10 +96,10 @@ bool FormulaToken::IsFunction() const
 sal_uInt8 FormulaToken::GetParamCount() const
 {
 if ( eOp  SC_OPCODE_STOP_DIV  eOp != ocExternal  eOp != ocMacro 
- eOp != ocIf  eOp != ocIfError  eOp != ocIfNA  eOp != ocChose 
+ eOp != ocIf  eOp != ocIfError  eOp != ocIfNA  eOp != ocChoose 
  eOp != ocPercentSign )
 return 0;   // parameters and specials
-// ocIf, ocIfError, ocIfNA and ocChose not for FAP, 

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

2015-01-14 Thread Laurent Charrière
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/lotus/lotform.cxx |2 +-
 sc/source/ui/src/scfuncs.src   |2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 0302305dd47b679e889746459d32725bd06ea5b0
Author: Laurent Charrière lcharri...@gmail.com
Date:   Mon Jan 12 20:19:06 2015 +0100

fdo#85818: rename KritBinom to CritBinom

Change-Id: I2fa011eea4263f005c3a22072a6144972e9f0bb7
Reviewed-on: https://gerrit.libreoffice.org/13890
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 3d28399..e11ec36 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -306,7 +306,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_WEIBULL_MS { Text = COM.MICROSOFT.WEIBULL.DIST ; };
 String SC_OPCODE_NEG_BINOM_VERT { Text = NEGBINOMDIST ; };
 String SC_OPCODE_NEG_BINOM_DIST_MS { Text = COM.MICROSOFT.NEGBINOM.DIST 
; };
-String SC_OPCODE_KRIT_BINOM { Text = CRITBINOM ; };
+String SC_OPCODE_CRIT_BINOM { Text = CRITBINOM ; };
 String SC_OPCODE_BINOM_INV { Text = COM.MICROSOFT.BINOM.INV ; };
 String SC_OPCODE_KURT { Text = KURT ; };
 String SC_OPCODE_HAR_MEAN { Text = HARMEAN ; };
@@ -714,7 +714,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_WEIBULL_MS { Text = _xlfn.WEIBULL.DIST ; };
 String SC_OPCODE_NEG_BINOM_VERT { Text = NEGBINOMDIST ; };
 String SC_OPCODE_NEG_BINOM_DIST_MS { Text = _xlfn.NEGBINOM.DIST ; };
-String SC_OPCODE_KRIT_BINOM { Text = CRITBINOM ; };
+String SC_OPCODE_CRIT_BINOM { Text = CRITBINOM ; };
 String SC_OPCODE_BINOM_INV { Text = _xlfn.BINOM.INV ; };
 String SC_OPCODE_KURT { Text = KURT ; };
 String SC_OPCODE_HAR_MEAN { Text = HARMEAN ; };
@@ -1124,7 +1124,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_WEIBULL_MS { Text = WEIBULL.DIST ; };
 String SC_OPCODE_NEG_BINOM_VERT { Text = NEGBINOMDIST ; };
 String SC_OPCODE_NEG_BINOM_DIST_MS { Text = NEGBINOM.DIST ; };
-String SC_OPCODE_KRIT_BINOM { Text = CRITBINOM ; };
+String SC_OPCODE_CRIT_BINOM { Text = CRITBINOM ; };
 String SC_OPCODE_BINOM_INV { Text = BINOM.INV ; };
 String SC_OPCODE_KURT { Text = KURT ; };
 String SC_OPCODE_HAR_MEAN { Text = HARMEAN ; };
@@ -2311,7 +2311,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = NEGBINOM.DIST ;
 };
-String SC_OPCODE_KRIT_BINOM
+String SC_OPCODE_CRIT_BINOM
 {
 Text [ en-US ] = CRITBINOM ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index cc8b709..a7618f6 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -317,7 +317,7 @@
 #define SC_OPCODE_CHI_DIST  316
 #define SC_OPCODE_WEIBULL   317
 #define SC_OPCODE_NEG_BINOM_VERT318
-#define SC_OPCODE_KRIT_BINOM319
+#define SC_OPCODE_CRIT_BINOM319
 #define SC_OPCODE_KURT  320
 #define SC_OPCODE_HAR_MEAN  321
 #define SC_OPCODE_GEO_MEAN  322
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index b7cdba5..454242d 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -352,7 +352,7 @@ enum OpCode : sal_uInt16
 ocWeibull_MS= SC_OPCODE_WEIBULL_MS,
 ocNegBinomVert  = SC_OPCODE_NEG_BINOM_VERT,
 ocNegBinomDist_MS   = SC_OPCODE_NEG_BINOM_DIST_MS,
-ocKritBinom = SC_OPCODE_KRIT_BINOM,
+ocCritBinom = SC_OPCODE_CRIT_BINOM,
 ocKurt  = SC_OPCODE_KURT,
 ocHarMean   = SC_OPCODE_HAR_MEAN,
 ocGeoMean   = SC_OPCODE_GEO_MEAN,
diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 94b0b28..dd844bd 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -2798,7 +2798,7 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
 mvSubArguments.push_back(SoPHelper(ts,
 ft-Children[i], new OpCosh, nResultSize));
 break;
-case ocKritBinom:
+case ocCritBinom:
 mvSubArguments.push_back(SoPHelper(ts,
 ft-Children[i], new OpCritBinom, nResultSize));
 break;
diff --git a/sc/source/core/tool/interpr4.cxx 

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

2015-01-14 Thread Laurent Charrière
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/tool/interpr1.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/lotus/lotform.cxx |4 ++--
 sc/source/filter/qpro/qproform.cxx |2 +-
 sc/source/ui/src/scfuncs.src   |2 +-
 10 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 975832d885ca5d185e91a975b157bf06bf9a7a0e
Author: Laurent Charrière lcharri...@gmail.com
Date:   Mon Jan 12 17:58:29 2015 +0100

sc: rename ocPropper et al. to ocProper et al.

Change-Id: I245ad8f7418bed707953ecf80c71de07e0cc00d1
Reviewed-on: https://gerrit.libreoffice.org/13888
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 2f79b48..3dfec5c 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -122,7 +122,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_CODE { Text = CODE ; };
 String SC_OPCODE_TRIM { Text = TRIM ; };
 String SC_OPCODE_UPPER { Text = UPPER ; };
-String SC_OPCODE_PROPPER { Text = PROPER ; };
+String SC_OPCODE_PROPER { Text = PROPER ; };
 String SC_OPCODE_LOWER { Text = LOWER ; };
 String SC_OPCODE_LEN { Text = LEN ; };
 String SC_OPCODE_T { Text = T ; };
@@ -530,7 +530,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_CODE { Text = CODE ; };
 String SC_OPCODE_TRIM { Text = TRIM ; };
 String SC_OPCODE_UPPER { Text = UPPER ; };
-String SC_OPCODE_PROPPER { Text = PROPER ; };
+String SC_OPCODE_PROPER { Text = PROPER ; };
 String SC_OPCODE_LOWER { Text = LOWER ; };
 String SC_OPCODE_LEN { Text = LEN ; };
 String SC_OPCODE_T { Text = T ; };
@@ -940,7 +940,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_CODE { Text = CODE ; };
 String SC_OPCODE_TRIM { Text = TRIM ; };
 String SC_OPCODE_UPPER { Text = UPPER ; };
-String SC_OPCODE_PROPPER { Text = PROPER ; };
+String SC_OPCODE_PROPER { Text = PROPER ; };
 String SC_OPCODE_LOWER { Text = LOWER ; };
 String SC_OPCODE_LEN { Text = LEN ; };
 String SC_OPCODE_T { Text = T ; };
@@ -1570,7 +1570,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = UPPER ;
 };
-String SC_OPCODE_PROPPER
+String SC_OPCODE_PROPER
 {
 Text [ en-US ] = PROPER ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index e645fcb..9578a2a 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -166,7 +166,7 @@
 #define SC_OPCODE_CODE  133
 #define SC_OPCODE_TRIM  134
 #define SC_OPCODE_UPPER 135
-#define SC_OPCODE_PROPPER   136
+#define SC_OPCODE_PROPER136
 #define SC_OPCODE_LOWER 137
 #define SC_OPCODE_LEN   138
 #define SC_OPCODE_T 139 /* miscellaneous, part 21 */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 57aa6a1..25da573 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -158,7 +158,7 @@ enum OpCode : sal_uInt16
 ocCode  = SC_OPCODE_CODE,
 ocTrim  = SC_OPCODE_TRIM,
 ocUpper = SC_OPCODE_UPPER,
-ocPropper   = SC_OPCODE_PROPPER,
+ocProper= SC_OPCODE_PROPER,
 ocLower = SC_OPCODE_LOWER,
 ocLen   = SC_OPCODE_LEN,
 ocT = SC_OPCODE_T,
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 6c7cd09..e3b85a3 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -478,7 +478,7 @@ void ScN();
 void ScCode();
 void ScTrim();
 void ScUpper();
-void ScPropper();
+void ScProper();
 void ScLower();
 void ScLen();
 void ScT();
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 7d5975d..77dfcad 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2883,7 +2883,7 @@ void ScInterpreter::ScUpper()
 PushString(aString);
 }
 
-void ScInterpreter::ScPropper()
+void ScInterpreter::ScProper()
 {
 //2do: what to do with I18N-CJK ?!?
 OUStringBuffer aStr(GetString().getString());
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index d1620fe..311f86d 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3962,7 +3962,7 @@ StackVar ScInterpreter::Interpret()

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

2015-01-14 Thread Winfried Donkers
 formula/source/core/resource/core_resource.src |7 ++
 include/formula/compiler.hrc   |3 -
 include/formula/opcode.hxx |1 
 sc/inc/helpids.h   |1 
 sc/qa/unit/ucalc.cxx   |1 
 sc/source/core/inc/interpre.hxx|2 
 sc/source/core/tool/interpr1.cxx   |   66 -
 sc/source/core/tool/interpr4.cxx   |4 +
 sc/source/filter/excel/xlformula.cxx   |3 -
 sc/source/filter/oox/formulabase.cxx   |3 -
 sc/source/ui/src/scfuncs.src   |   24 +
 11 files changed, 109 insertions(+), 6 deletions(-)

New commits:
commit 7eec8e5c7146a231e9d67bd96eaff30018488c39
Author: Winfried Donkers winfrieddonk...@libreoffice.org
Date:   Mon Nov 24 13:52:48 2014 +0100

add ODF1.2 function ERROR.TYPE to Calc

Also, improve exchange between Calc and Excel2013.

Change-Id: I491f9e2100a9a2c38e23cf55dd1eda4b5e96db96
Reviewed-on: https://gerrit.libreoffice.org/13101
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 1e76de2..8a90a9c 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -145,6 +145,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_GAMMA_LN { Text = GAMMALN ; };
 String SC_OPCODE_GAMMA_LN_MS { Text = COM.MICROSOFT.GAMMALN.PRECISE ; };
 String SC_OPCODE_ERROR_TYPE { Text = ORG.OPENOFFICE.ERRORTYPE ; };
+String SC_OPCODE_ERROR_TYPE_ODF { Text = ERROR.TYPE ; };
 String SC_OPCODE_FORMULA { Text = FORMULA; };
 String SC_OPCODE_ARC_TAN_2 { Text = ATAN2 ; };
 String SC_OPCODE_CEIL { Text = CEILING ; };
@@ -552,6 +553,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_GAMMA_LN { Text = GAMMALN ; };
 String SC_OPCODE_GAMMA_LN_MS { Text = _xlfn.GAMMALN.PRECISE ; };
 String SC_OPCODE_ERROR_TYPE { Text = ERRORTYPE ; };
+String SC_OPCODE_ERROR_TYPE_ODF { Text = ERROR.TYPE ; };
 String SC_OPCODE_FORMULA { Text = _xlfn.FORMULATEXT; };
 String SC_OPCODE_ARC_TAN_2 { Text = ATAN2 ; };
 String SC_OPCODE_CEIL { Text = CEILING ; };
@@ -961,6 +963,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_GAMMA_LN { Text = GAMMALN ; };
 String SC_OPCODE_GAMMA_LN_MS { Text = GAMMALN.PRECISE ; };
 String SC_OPCODE_ERROR_TYPE { Text = ERRORTYPE ; };
+String SC_OPCODE_ERROR_TYPE_ODF { Text = ERROR.TYPE ; };
 String SC_OPCODE_FORMULA { Text = FORMULA; };
 String SC_OPCODE_ARC_TAN_2 { Text = ATAN2 ; };
 String SC_OPCODE_CEIL { Text = CEILING ; };
@@ -1659,6 +1662,10 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = ERRORTYPE ;
 };
+String SC_OPCODE_ERROR_TYPE_ODF
+{
+Text [ en-US ] = ERROR.TYPE ;
+};
 String SC_OPCODE_FORMULA
 {
 Text [ en-US ] = FORMULA ;
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 5686a8b..1d6b901 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -194,7 +194,8 @@
 #define SC_OPCODE_GAMMA_LN_MS   162
 #define SC_OPCODE_ERF_MS163
 #define SC_OPCODE_ERFC_MS   164
-#define SC_OPCODE_STOP_1_PAR165
+#define SC_OPCODE_ERROR_TYPE_ODF165
+#define SC_OPCODE_STOP_1_PAR166
 
 /*** Functions with more than one parameters ***/
 #define SC_OPCODE_START_2_PAR   201
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index c9e105d..33cf54c 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -178,6 +178,7 @@ enum OpCode : sal_uInt16
 ocGammaLn_MS= SC_OPCODE_GAMMA_LN_MS,
 ocGamma = SC_OPCODE_GAMMA,
 ocErrorType = SC_OPCODE_ERROR_TYPE,
+ocErrorType_ODF = SC_OPCODE_ERROR_TYPE_ODF,
 ocFormula   = SC_OPCODE_FORMULA,
 ocArabic= SC_OPCODE_ARABIC,
 ocInfo  = SC_OPCODE_INFO,
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 1e82021..9768806 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -624,5 +624,6 @@
 #define HID_FUNC_ERF_MS 
SC_HID_FUNC_ERF_MS
 #define HID_FUNC_ERFC_MS
SC_HID_FUNC_ERFC_MS
 #define HID_FUNC_AGGREGATE  
SC_HID_FUNC_AGGREGATE
+#define HID_FUNC_ERROR_TYPE_ODF 
SC_HID_FUNC_ERROR_TYPE_ODF
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index e5cb050..cb9dda9 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2638,6 +2638,7 @@ void Test::testFunctionLists()
 COLUMN,
 COLUMNS,
 

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

2015-01-11 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/lotus/lotform.cxx |4 ++--
 sc/source/filter/qpro/qproform.cxx |2 +-
 sc/source/ui/src/scfuncs.src   |4 ++--
 13 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit fd66d3749e286d8e1b40429ea04e33d7266c1132
Author: Laurent Charrière lcharri...@gmail.com
Date:   Fri Jan 9 12:12:59 2015 +0100

fdo#85818: rename GDA to DDB

Change-Id: Ic73225a34ca3339216c11bd72116e55d6a098257
Reviewed-on: https://gerrit.libreoffice.org/13827
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 6d324e2..ec53ee6 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -94,7 +94,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 case ocNPV:
 case ocPV:
 case ocSYD:
-case ocGDA:
+case ocDDB:
 case ocDB:
 case ocVBD:
 case ocLIA:
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 8a65301..6ed8e2d 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -212,7 +212,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_PERMUTATION_A { Text = PERMUTATIONA ; };
 String SC_OPCODE_PV { Text = PV ; };
 String SC_OPCODE_SYD { Text = SYD ; };
-String SC_OPCODE_GDA { Text = DDB ; };
+String SC_OPCODE_DDB { Text = DDB ; };
 String SC_OPCODE_DB { Text = DB ; };
 String SC_OPCODE_VBD { Text = VDB ; };
 String SC_OPCODE_DURATION { Text = PDURATION ; };
@@ -619,7 +619,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_PERMUTATION_A { Text = _xlfn.PERMUTATIONA ; };
 String SC_OPCODE_PV { Text = PV ; };
 String SC_OPCODE_SYD { Text = SYD ; };
-String SC_OPCODE_GDA { Text = DDB ; };
+String SC_OPCODE_DDB { Text = DDB ; };
 String SC_OPCODE_DB { Text = DB ; };
 String SC_OPCODE_VBD { Text = VDB ; };
 String SC_OPCODE_DURATION { Text = _xlfn.PDURATION ; };
@@ -1028,7 +1028,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_PERMUTATION_A { Text = PERMUTATIONA ; };
 String SC_OPCODE_PV { Text = PV ; };
 String SC_OPCODE_SYD { Text = SYD ; };
-String SC_OPCODE_GDA { Text = DDB ; };
+String SC_OPCODE_DDB { Text = DDB ; };
 String SC_OPCODE_DB { Text = DB ; };
 String SC_OPCODE_VBD { Text = VDB ; };
 String SC_OPCODE_DURATION { Text = DURATION ; };
@@ -1931,7 +1931,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = SYD ;
 };
-String SC_OPCODE_GDA
+String SC_OPCODE_DDB
 {
 Text [ en-US ] = DDB ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 86ff639..7e9facb 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -243,7 +243,7 @@
 #define SC_OPCODE_PERMUTATION_A 243
 #define SC_OPCODE_PV244
 #define SC_OPCODE_SYD   245
-#define SC_OPCODE_GDA   246
+#define SC_OPCODE_DDB   246
 #define SC_OPCODE_DB247
 #define SC_OPCODE_VBD   248
 #define SC_OPCODE_DURATION  249
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index f566507..2fed555 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -247,7 +247,7 @@ enum OpCode : sal_uInt16
 ocPermutationA  = SC_OPCODE_PERMUTATION_A,
 ocPV= SC_OPCODE_PV,
 ocSYD   = SC_OPCODE_SYD,
-ocGDA   = SC_OPCODE_GDA,
+ocDDB   = SC_OPCODE_DDB,
 ocDB= SC_OPCODE_DB,
 ocVBD   = SC_OPCODE_VBD,
 ocDuration  = SC_OPCODE_DURATION,
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 53615bd..2e7e325 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -664,7 +664,7 @@ void ScPV();
 void ScSYD();
 double ScGetGDA(double fWert, double fRest, double fDauer,
double fPeriode, double fFactor);
-void ScGDA();
+void ScDDB();
 void ScDB();
 double 

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

2015-01-11 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|4 ++--
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |2 +-
 sc/source/core/tool/compiler.cxx   |2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/parclass.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/qpro/qproform.cxx |4 ++--
 sc/source/ui/src/scfuncs.src   |4 ++--
 14 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 92cef7eb344c9c9c7a6aa1489845a1b0eb346ead
Author: Laurent Charrière lcharri...@gmail.com
Date:   Fri Jan 9 13:43:55 2015 +0100

fdo#85818: rename ZGZ to RRI

Change-Id: Ifeb513eba762f881dd4ea7cd7fc531fe5028106d
Reviewed-on: https://gerrit.libreoffice.org/13831
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Noel Grandin noelgran...@gmail.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 5d289fb..d1ef9a9 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -108,7 +108,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 case ocRate:
 case ocIRR:
 case ocMIRR:
-case ocZGZ:
+case ocRRI:
 case ocEffective:
 case ocNominal:
 case ocPercentSign:
@@ -917,7 +917,7 @@ void FormulaCompiler::OpCodeMap::copyFrom( const OpCodeMap 
r, bool bOverrideKno
 OpCode eOp = OpCode(i);
 switch (eOp)
 {
-case ocZGZ:
+case ocRRI:
 aSymbol = RRI;
 break;
 case ocTableOp:
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 81cafdf..1e76de2 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -224,7 +224,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_COLUMN { Text = COLUMN ; };
 String SC_OPCODE_ROW { Text = ROW ; };
 String SC_OPCODE_TABLE { Text = SHEET ; };
-String SC_OPCODE_ZGZ { Text = RRI ; };
+String SC_OPCODE_RRI { Text = RRI ; };
 String SC_OPCODE_ZW { Text = FV ; };
 String SC_OPCODE_ZZR { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
@@ -631,7 +631,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_COLUMN { Text = COLUMN ; };
 String SC_OPCODE_ROW { Text = ROW ; };
 String SC_OPCODE_TABLE { Text = _xlfn.SHEET ; };
-String SC_OPCODE_ZGZ { Text = _xlfn.RRI ; };
+String SC_OPCODE_RRI { Text = _xlfn.RRI ; };
 String SC_OPCODE_ZW { Text = FV ; };
 String SC_OPCODE_ZZR { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
@@ -1040,7 +1040,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_COLUMN { Text = COLUMN ; };
 String SC_OPCODE_ROW { Text = ROW ; };
 String SC_OPCODE_TABLE { Text = SHEET ; };
-String SC_OPCODE_ZGZ { Text = ZGZ ; };
+String SC_OPCODE_RRI { Text = ZGZ ; };
 String SC_OPCODE_ZW { Text = FV ; };
 String SC_OPCODE_ZZR { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
@@ -1979,7 +1979,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = SHEET ;
 };
-String SC_OPCODE_ZGZ
+String SC_OPCODE_RRI
 {
 Text [ en-US ] = RRI ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index a512e28..5686a8b 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -253,7 +253,7 @@
 #define SC_OPCODE_ROWS  253
 #define SC_OPCODE_COLUMN254
 #define SC_OPCODE_ROW   255
-#define SC_OPCODE_ZGZ   256
+#define SC_OPCODE_RRI   256
 #define SC_OPCODE_ZW257
 #define SC_OPCODE_ZZR   258
 #define SC_OPCODE_RATE  259
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 5349559..c9e105d 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -257,7 +257,7 @@ enum OpCode : sal_uInt16
 ocRows  = SC_OPCODE_ROWS,
 ocColumn= SC_OPCODE_COLUMN,
 ocRow   = SC_OPCODE_ROW,
-ocZGZ   = SC_OPCODE_ZGZ,
+ocRRI   = SC_OPCODE_RRI,
 ocZW= SC_OPCODE_ZW,
 ocZZR   = SC_OPCODE_ZZR,
 ocRate  = SC_OPCODE_RATE,
diff --git 

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

2015-01-11 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |4 ++--
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/ui/src/scfuncs.src   |4 ++--
 9 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 6dc1c9de5ddb5ab8789b691378bbcf7ee41cd988
Author: Laurent Charrière lcharri...@gmail.com
Date:   Fri Jan 9 05:41:25 2015 +0100

fdo#85818: rename KumKapZ to CumPrinc

Change-Id: I8e68a4a80418fe32e53123432257aec3c2fc28a4
Reviewed-on: https://gerrit.libreoffice.org/13822
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 5225742..c91a50a 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -103,7 +103,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 case ocIpmt:
 case ocPpmt:
 case ocCumIpmt:
-case ocKumKapZ:
+case ocCumPrinc:
 return NUMBERFORMAT_CURRENCY;
 case ocRate:
 case ocIRR:
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index a8d2a48..e2a3ed5 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -231,7 +231,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_IPMT { Text = IPMT ; };
 String SC_OPCODE_PPMT { Text = PPMT ; };
 String SC_OPCODE_CUM_IPMT { Text = CUMIPMT ; };
-String SC_OPCODE_KUM_KAP_Z { Text = CUMPRINC ; };
+String SC_OPCODE_CUM_PRINC { Text = CUMPRINC ; };
 String SC_OPCODE_EFFEKTIV { Text = EFFECT ; };
 String SC_OPCODE_NOMINAL { Text = NOMINAL ; };
 String SC_OPCODE_SUB_TOTAL { Text = SUBTOTAL ; };
@@ -638,7 +638,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_IPMT { Text = IPMT ; };
 String SC_OPCODE_PPMT { Text = PPMT ; };
 String SC_OPCODE_CUM_IPMT { Text = CUMIPMT ; };
-String SC_OPCODE_KUM_KAP_Z { Text = CUMPRINC ; };
+String SC_OPCODE_CUM_PRINC { Text = CUMPRINC ; };
 String SC_OPCODE_EFFEKTIV { Text = EFFECTIVE ; };
 String SC_OPCODE_NOMINAL { Text = NOMINAL ; };
 String SC_OPCODE_SUB_TOTAL { Text = SUBTOTAL ; };
@@ -1047,7 +1047,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_IPMT { Text = IPMT ; };
 String SC_OPCODE_PPMT { Text = PPMT ; };
 String SC_OPCODE_CUM_IPMT { Text = CUMIPMT ; };
-String SC_OPCODE_KUM_KAP_Z { Text = CUMPRINC ; };
+String SC_OPCODE_CUM_PRINC { Text = CUMPRINC ; };
 String SC_OPCODE_EFFEKTIV { Text = EFFECTIVE ; };
 String SC_OPCODE_NOMINAL { Text = NOMINAL ; };
 String SC_OPCODE_SUB_TOTAL { Text = SUBTOTAL ; };
@@ -2007,7 +2007,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = CUMIPMT ;
 };
-String SC_OPCODE_KUM_KAP_Z
+String SC_OPCODE_CUM_PRINC
 {
 Text [ en-US ] = CUMPRINC ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 7be2dba..d420fbd 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -260,7 +260,7 @@
 #define SC_OPCODE_IPMT  260
 #define SC_OPCODE_PPMT  261
 #define SC_OPCODE_CUM_IPMT  262
-#define SC_OPCODE_KUM_KAP_Z 263
+#define SC_OPCODE_CUM_PRINC 263
 #define SC_OPCODE_EFFEKTIV  264
 #define SC_OPCODE_NOMINAL   265
 #define SC_OPCODE_SUB_TOTAL 266
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 2196fd8..e6260ce 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -264,7 +264,7 @@ enum OpCode : sal_uInt16
 ocIpmt  = SC_OPCODE_IPMT,
 ocPpmt  = SC_OPCODE_PPMT,
 ocCumIpmt   = SC_OPCODE_CUM_IPMT,
-ocKumKapZ   = SC_OPCODE_KUM_KAP_Z,
+ocCumPrinc  = SC_OPCODE_CUM_PRINC,
 ocEffektiv  = SC_OPCODE_EFFEKTIV,
 ocNominal   = SC_OPCODE_NOMINAL,
 ocSubTotal  = SC_OPCODE_SUB_TOTAL,
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 1365229..60ef2a9 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -687,7 +687,7 @@ double ScGetCompoundInterest(double fZins, double fZr, 
double fZzr, double fBw,
 void ScIpmt();
 void ScPpmt();
 void ScCumIpmt();
-void ScKumKapZ();
+void ScCumPrinc();
 void ScEffektiv();
 void ScNominal();
 void ScMod();
diff --git 

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

2015-01-11 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/ui/src/scfuncs.src   |4 ++--
 9 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit c7d23291ea9ae7a3a2c055b09fce9c29bb7f58d3
Author: Laurent Charrière lcharri...@gmail.com
Date:   Fri Jan 9 07:01:11 2015 +0100

fdo#85818: rename Effektiv to Effective

Change-Id: I55a863f7d7068de9abc468676ecf2e54ecd3c06c
Reviewed-on: https://gerrit.libreoffice.org/13823
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Noel Grandin noelgran...@gmail.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index c91a50a..de527e4 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -109,7 +109,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 case ocIRR:
 case ocMIRR:
 case ocZGZ:
-case ocEffektiv:
+case ocEffective:
 case ocNominal:
 case ocPercentSign:
 return NUMBERFORMAT_PERCENT;
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index e2a3ed5..a5bf5d8 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -232,7 +232,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_PPMT { Text = PPMT ; };
 String SC_OPCODE_CUM_IPMT { Text = CUMIPMT ; };
 String SC_OPCODE_CUM_PRINC { Text = CUMPRINC ; };
-String SC_OPCODE_EFFEKTIV { Text = EFFECT ; };
+String SC_OPCODE_EFFECTIVE { Text = EFFECT ; };
 String SC_OPCODE_NOMINAL { Text = NOMINAL ; };
 String SC_OPCODE_SUB_TOTAL { Text = SUBTOTAL ; };
 String SC_OPCODE_DB_SUM { Text = DSUM ; };
@@ -639,7 +639,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_PPMT { Text = PPMT ; };
 String SC_OPCODE_CUM_IPMT { Text = CUMIPMT ; };
 String SC_OPCODE_CUM_PRINC { Text = CUMPRINC ; };
-String SC_OPCODE_EFFEKTIV { Text = EFFECTIVE ; };
+String SC_OPCODE_EFFECTIVE { Text = EFFECTIVE ; };
 String SC_OPCODE_NOMINAL { Text = NOMINAL ; };
 String SC_OPCODE_SUB_TOTAL { Text = SUBTOTAL ; };
 String SC_OPCODE_DB_SUM { Text = DSUM ; };
@@ -1048,7 +1048,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_PPMT { Text = PPMT ; };
 String SC_OPCODE_CUM_IPMT { Text = CUMIPMT ; };
 String SC_OPCODE_CUM_PRINC { Text = CUMPRINC ; };
-String SC_OPCODE_EFFEKTIV { Text = EFFECTIVE ; };
+String SC_OPCODE_EFFECTIVE { Text = EFFECTIVE ; };
 String SC_OPCODE_NOMINAL { Text = NOMINAL ; };
 String SC_OPCODE_SUB_TOTAL { Text = SUBTOTAL ; };
 String SC_OPCODE_DB_SUM { Text = DSUM ; };
@@ -2011,7 +2011,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = CUMPRINC ;
 };
-String SC_OPCODE_EFFEKTIV
+String SC_OPCODE_EFFECTIVE
 {
 Text [ en-US ] = EFFECTIVE ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index d420fbd..be61ed8 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -261,7 +261,7 @@
 #define SC_OPCODE_PPMT  261
 #define SC_OPCODE_CUM_IPMT  262
 #define SC_OPCODE_CUM_PRINC 263
-#define SC_OPCODE_EFFEKTIV  264
+#define SC_OPCODE_EFFECTIVE 264
 #define SC_OPCODE_NOMINAL   265
 #define SC_OPCODE_SUB_TOTAL 266
 #define SC_OPCODE_DB_SUM267 /* database functions */
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index e6260ce..f6de536 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -265,7 +265,7 @@ enum OpCode : sal_uInt16
 ocPpmt  = SC_OPCODE_PPMT,
 ocCumIpmt   = SC_OPCODE_CUM_IPMT,
 ocCumPrinc  = SC_OPCODE_CUM_PRINC,
-ocEffektiv  = SC_OPCODE_EFFEKTIV,
+ocEffective = SC_OPCODE_EFFECTIVE,
 ocNominal   = SC_OPCODE_NOMINAL,
 ocSubTotal  = SC_OPCODE_SUB_TOTAL,
 // Database functions
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 60ef2a9..bc57d19 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -688,7 +688,7 @@ void ScIpmt();
 void ScPpmt();
 void ScCumIpmt();
 void ScCumPrinc();
-void ScEffektiv();
+void ScEffective();
 void ScNominal();
 void ScMod();
 void ScIntercept();
diff --git a/sc/source/core/tool/interpr2.cxx 

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

2015-01-11 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/api/token.cxx  |2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/lotus/lotform.cxx |4 ++--
 sc/source/filter/qpro/qproform.cxx |2 +-
 sc/source/ui/src/scfuncs.src   |4 ++--
 14 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 8416ac2b532673f2b64be102d77c805fe5e81720
Author: Laurent Charrière lcharri...@gmail.com
Date:   Fri Jan 9 11:36:49 2015 +0100

fdo#85818: rename BW to PV

Change-Id: I3b319a4074c549daaa1d6befaca79dab93e61df6
Reviewed-on: https://gerrit.libreoffice.org/13824
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Noel Grandin noelgran...@gmail.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index de527e4..858fe06 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -92,7 +92,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 case ocGetTime:
 return NUMBERFORMAT_TIME;
 case ocNPV:
-case ocBW:
+case ocPV:
 case ocDIA:
 case ocGDA:
 case ocGDA2:
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 3b16cc3..c6f4a2f 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1259,7 +1259,7 @@ bool FormulaMissingContext::AddMissing( FormulaTokenArray 
*pNewArr, const Missin
 case ocIpmt:
 case ocPpmt:
 return AddDefaultArg( pNewArr, 4, 0.0 );
-case ocBW:  // PV
+case ocPV:
 case ocZW:  // FV
 bRet |= AddDefaultArg( pNewArr, 2, 0.0 );   // pmt
 bRet |= AddDefaultArg( pNewArr, 3, 0.0 );   // [fp]v
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index a5bf5d8..2434ead 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -210,7 +210,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_COMBIN_A { Text = COMBINA ; };
 String SC_OPCODE_PERMUT { Text = PERMUT ; };
 String SC_OPCODE_PERMUTATION_A { Text = PERMUTATIONA ; };
-String SC_OPCODE_BW { Text = PV ; };
+String SC_OPCODE_PV { Text = PV ; };
 String SC_OPCODE_DIA { Text = SYD ; };
 String SC_OPCODE_GDA { Text = DDB ; };
 String SC_OPCODE_GDA_2 { Text = DB ; };
@@ -617,7 +617,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_COMBIN_A { Text = _xlfn.COMBINA ; };
 String SC_OPCODE_PERMUT { Text = PERMUT ; };
 String SC_OPCODE_PERMUTATION_A { Text = _xlfn.PERMUTATIONA ; };
-String SC_OPCODE_BW { Text = PV ; };
+String SC_OPCODE_PV { Text = PV ; };
 String SC_OPCODE_DIA { Text = SYD ; };
 String SC_OPCODE_GDA { Text = DDB ; };
 String SC_OPCODE_GDA_2 { Text = DB ; };
@@ -1026,7 +1026,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_COMBIN_A { Text = COMBINA ; };
 String SC_OPCODE_PERMUT { Text = PERMUT ; };
 String SC_OPCODE_PERMUTATION_A { Text = PERMUTATIONA ; };
-String SC_OPCODE_BW { Text = PV ; };
+String SC_OPCODE_PV { Text = PV ; };
 String SC_OPCODE_DIA { Text = SYD ; };
 String SC_OPCODE_GDA { Text = DDB ; };
 String SC_OPCODE_GDA_2 { Text = DB ; };
@@ -1923,7 +1923,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = PERMUTATIONA ;
 };
-String SC_OPCODE_BW
+String SC_OPCODE_PV
 {
 Text [ en-US ] = PV ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index be61ed8..3ffd2ba 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -241,7 +241,7 @@
 #define SC_OPCODE_COMBIN_A  241
 #define SC_OPCODE_PERMUT242
 #define SC_OPCODE_PERMUTATION_A 243
-#define SC_OPCODE_BW244
+#define SC_OPCODE_PV244
 #define SC_OPCODE_DIA   245
 #define SC_OPCODE_GDA   246
 #define SC_OPCODE_GDA_2 247
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index f6de536..6a68339 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -245,7 +245,7 @@ enum OpCode : 

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

2015-01-11 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/lotus/lotform.cxx |4 ++--
 sc/source/filter/qpro/qproform.cxx |2 +-
 sc/source/ui/src/scfuncs.src   |4 ++--
 13 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit b2fcd4f7c7133f10bde8df3b7544023a3719d2b2
Author: Laurent Charrière lcharri...@gmail.com
Date:   Fri Jan 9 12:01:16 2015 +0100

fdo#85818: rename DIA to SYD

Change-Id: I3510403521668c00f44d462b288716f5f7b60115
Reviewed-on: https://gerrit.libreoffice.org/13825
Tested-by: Jenkins c...@libreoffice.org
Reviewed-by: Noel Grandin noelgran...@gmail.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 858fe06..4ece137 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -93,7 +93,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 return NUMBERFORMAT_TIME;
 case ocNPV:
 case ocPV:
-case ocDIA:
+case ocSYD:
 case ocGDA:
 case ocGDA2:
 case ocVBD:
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 2434ead..31ca6e1 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -211,7 +211,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_PERMUT { Text = PERMUT ; };
 String SC_OPCODE_PERMUTATION_A { Text = PERMUTATIONA ; };
 String SC_OPCODE_PV { Text = PV ; };
-String SC_OPCODE_DIA { Text = SYD ; };
+String SC_OPCODE_SYD { Text = SYD ; };
 String SC_OPCODE_GDA { Text = DDB ; };
 String SC_OPCODE_GDA_2 { Text = DB ; };
 String SC_OPCODE_VBD { Text = VDB ; };
@@ -618,7 +618,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_PERMUT { Text = PERMUT ; };
 String SC_OPCODE_PERMUTATION_A { Text = _xlfn.PERMUTATIONA ; };
 String SC_OPCODE_PV { Text = PV ; };
-String SC_OPCODE_DIA { Text = SYD ; };
+String SC_OPCODE_SYD { Text = SYD ; };
 String SC_OPCODE_GDA { Text = DDB ; };
 String SC_OPCODE_GDA_2 { Text = DB ; };
 String SC_OPCODE_VBD { Text = VDB ; };
@@ -1027,7 +1027,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_PERMUT { Text = PERMUT ; };
 String SC_OPCODE_PERMUTATION_A { Text = PERMUTATIONA ; };
 String SC_OPCODE_PV { Text = PV ; };
-String SC_OPCODE_DIA { Text = SYD ; };
+String SC_OPCODE_SYD { Text = SYD ; };
 String SC_OPCODE_GDA { Text = DDB ; };
 String SC_OPCODE_GDA_2 { Text = DB ; };
 String SC_OPCODE_VBD { Text = VDB ; };
@@ -1927,7 +1927,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = PV ;
 };
-String SC_OPCODE_DIA
+String SC_OPCODE_SYD
 {
 Text [ en-US ] = SYD ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 3ffd2ba..ea177ba 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -242,7 +242,7 @@
 #define SC_OPCODE_PERMUT242
 #define SC_OPCODE_PERMUTATION_A 243
 #define SC_OPCODE_PV244
-#define SC_OPCODE_DIA   245
+#define SC_OPCODE_SYD   245
 #define SC_OPCODE_GDA   246
 #define SC_OPCODE_GDA_2 247
 #define SC_OPCODE_VBD   248
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 6a68339..df2452b 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -246,7 +246,7 @@ enum OpCode : sal_uInt16
 ocPermut= SC_OPCODE_PERMUT,
 ocPermutationA  = SC_OPCODE_PERMUTATION_A,
 ocPV= SC_OPCODE_PV,
-ocDIA   = SC_OPCODE_DIA,
+ocSYD   = SC_OPCODE_SYD,
 ocGDA   = SC_OPCODE_GDA,
 ocGDA2  = SC_OPCODE_GDA_2,
 ocVBD   = SC_OPCODE_VBD,
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 2cf46e8..4ce3313 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -661,7 +661,7 @@ void ScISPMT();
 double ScGetBw(double fZins, double fZzr, double fRmz,
   double fZw, double fF);
 void ScPV();
-void ScDIA();
+void ScSYD();
 double ScGetGDA(double fWert, double 

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

2015-01-11 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/ui/src/scfuncs.src   |4 ++--
 11 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit 4a2fded15046f2c469c9c1723ccef4e517fc372a
Author: Laurent Charrière lcharri...@gmail.com
Date:   Fri Jan 9 12:07:44 2015 +0100

fdo#85818: rename GDA2 to DB

Change-Id: I2449645b47918325474109fc090ef34b009f26a8
Reviewed-on: https://gerrit.libreoffice.org/13826
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 4ece137..6d324e2 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -95,7 +95,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 case ocPV:
 case ocSYD:
 case ocGDA:
-case ocGDA2:
+case ocDB:
 case ocVBD:
 case ocLIA:
 case ocRMZ:
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 31ca6e1..ccaba7a 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -213,7 +213,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_PV { Text = PV ; };
 String SC_OPCODE_SYD { Text = SYD ; };
 String SC_OPCODE_GDA { Text = DDB ; };
-String SC_OPCODE_GDA_2 { Text = DB ; };
+String SC_OPCODE_DB { Text = DB ; };
 String SC_OPCODE_VBD { Text = VDB ; };
 String SC_OPCODE_LAUFZ { Text = PDURATION ; };
 String SC_OPCODE_LIA { Text = SLN ; };
@@ -620,7 +620,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_PV { Text = PV ; };
 String SC_OPCODE_SYD { Text = SYD ; };
 String SC_OPCODE_GDA { Text = DDB ; };
-String SC_OPCODE_GDA_2 { Text = DB ; };
+String SC_OPCODE_DB { Text = DB ; };
 String SC_OPCODE_VBD { Text = VDB ; };
 String SC_OPCODE_LAUFZ { Text = _xlfn.PDURATION ; };
 String SC_OPCODE_LIA { Text = SLN ; };
@@ -1029,7 +1029,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_PV { Text = PV ; };
 String SC_OPCODE_SYD { Text = SYD ; };
 String SC_OPCODE_GDA { Text = DDB ; };
-String SC_OPCODE_GDA_2 { Text = DB ; };
+String SC_OPCODE_DB { Text = DB ; };
 String SC_OPCODE_VBD { Text = VDB ; };
 String SC_OPCODE_LAUFZ { Text = DURATION ; };
 String SC_OPCODE_LIA { Text = SLN ; };
@@ -1935,7 +1935,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = DDB ;
 };
-String SC_OPCODE_GDA_2
+String SC_OPCODE_DB
 {
 Text [ en-US ] = DB ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index ea177ba..42bba26 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -244,7 +244,7 @@
 #define SC_OPCODE_PV244
 #define SC_OPCODE_SYD   245
 #define SC_OPCODE_GDA   246
-#define SC_OPCODE_GDA_2 247
+#define SC_OPCODE_DB247
 #define SC_OPCODE_VBD   248
 #define SC_OPCODE_LAUFZ 249
 #define SC_OPCODE_LIA   250
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index df2452b..8f891db 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -248,7 +248,7 @@ enum OpCode : sal_uInt16
 ocPV= SC_OPCODE_PV,
 ocSYD   = SC_OPCODE_SYD,
 ocGDA   = SC_OPCODE_GDA,
-ocGDA2  = SC_OPCODE_GDA_2,
+ocDB= SC_OPCODE_DB,
 ocVBD   = SC_OPCODE_VBD,
 ocLaufz = SC_OPCODE_LAUFZ,
 ocLIA   = SC_OPCODE_LIA,
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 4ce3313..7b0da5c 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -665,7 +665,7 @@ void ScSYD();
 double ScGetGDA(double fWert, double fRest, double fDauer,
double fPeriode, double fFactor);
 void ScGDA();
-void ScGDA2();
+void ScDB();
 double ScInterVDB(double fWert,double fRest,double fDauer,double fDauer1,
 double fPeriode,double fFactor);
 void ScVDB();
diff --git a/sc/source/core/opencl/formulagroupcl.cxx 

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

2015-01-09 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/api/token.cxx  |4 ++--
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/qpro/qproform.cxx |4 ++--
 sc/source/ui/src/scfuncs.src   |2 +-
 13 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 2963dbb5ce65a141051cb3e4e3ed06a6ed31574c
Author: Laurent Charrière lcharri...@gmail.com
Date:   Wed Jan 7 10:36:27 2015 +0100

fdo#85818: rename ZinsZ enum name, constant, function to Ipmt

Rename OcZinsZ to OcIpmt, SC_OPCODE_ZINS_Z to SC_OPCODE_IPMT,
ScInterpreter::ScZinsZ() to ScInterpreter::ScIpmt()

Change-Id: I6ed671aff85b7d2ec06dd66cd7ec9390776008b1
Reviewed-on: https://gerrit.libreoffice.org/13813
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 69afa63..b8380b8 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -100,7 +100,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 case ocLIA:
 case ocRMZ:
 case ocZW:
-case ocZinsZ:
+case ocIpmt:
 case ocKapz:
 case ocKumZinsZ:
 case ocKumKapZ:
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index ec9f4d3..1403dfa 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1256,7 +1256,7 @@ bool FormulaMissingContext::AddMissing( FormulaTokenArray 
*pNewArr, const Missin
 case ocBetaInv:
 case ocRMZ: // PMT
 return AddDefaultArg( pNewArr, 3, 0.0 );
-case ocZinsZ:   // IPMT
+case ocIpmt:
 case ocKapz:// PPMT
 return AddDefaultArg( pNewArr, 4, 0.0 );
 case ocBW:  // PV
@@ -1264,7 +1264,7 @@ bool FormulaMissingContext::AddMissing( FormulaTokenArray 
*pNewArr, const Missin
 bRet |= AddDefaultArg( pNewArr, 2, 0.0 );   // pmt
 bRet |= AddDefaultArg( pNewArr, 3, 0.0 );   // [fp]v
 break;
-case ocRate:// RATE
+case ocRate:
 bRet |= AddDefaultArg( pNewArr, 1, 0.0 );   // pmt
 bRet |= AddDefaultArg( pNewArr, 3, 0.0 );   // fv
 bRet |= AddDefaultArg( pNewArr, 4, 0.0 );   // type
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 408d083..af72798 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -228,7 +228,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_ZW { Text = FV ; };
 String SC_OPCODE_ZZR { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
-String SC_OPCODE_ZINS_Z { Text = IPMT ; };
+String SC_OPCODE_IPMT { Text = IPMT ; };
 String SC_OPCODE_KAPZ { Text = PPMT ; };
 String SC_OPCODE_KUM_ZINS_Z { Text = CUMIPMT ; };
 String SC_OPCODE_KUM_KAP_Z { Text = CUMPRINC ; };
@@ -635,7 +635,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_ZW { Text = FV ; };
 String SC_OPCODE_ZZR { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
-String SC_OPCODE_ZINS_Z { Text = IPMT ; };
+String SC_OPCODE_IPMT { Text = IPMT ; };
 String SC_OPCODE_KAPZ { Text = PPMT ; };
 String SC_OPCODE_KUM_ZINS_Z { Text = CUMIPMT ; };
 String SC_OPCODE_KUM_KAP_Z { Text = CUMPRINC ; };
@@ -1044,7 +1044,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_ZW { Text = FV ; };
 String SC_OPCODE_ZZR { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
-String SC_OPCODE_ZINS_Z { Text = IPMT ; };
+String SC_OPCODE_IPMT { Text = IPMT ; };
 String SC_OPCODE_KAPZ { Text = PPMT ; };
 String SC_OPCODE_KUM_ZINS_Z { Text = CUMIPMT ; };
 String SC_OPCODE_KUM_KAP_Z { Text = CUMPRINC ; };
@@ -1995,7 +1995,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = RATE ;
 };
-String SC_OPCODE_ZINS_Z
+String SC_OPCODE_IPMT
 {
 Text [ en-US ] = IPMT ;
 };
diff --git a/include/formula/compiler.hrc 

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

2015-01-09 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/api/token.cxx  |2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/qpro/qproform.cxx |2 +-
 sc/source/ui/src/scfuncs.src   |2 +-
 13 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit b8359780a25b4e645236dd0238e4ef39cd8413ce
Author: Laurent Charrière lcharri...@gmail.com
Date:   Thu Jan 8 09:42:50 2015 +0100

fdo#85818: rename Kapz to Ppmt

Rename OcKapz to OcPpmt, SC_OPCODE_KAPZ to SC_OPCODE_PPMT
ScInterpreter::ScKapz() to ScInterpreter::ScPpmt().

Change-Id: I5bc556e086970ea487e14b4663a9b3d2aaf9bb66
Reviewed-on: https://gerrit.libreoffice.org/13815
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index b8380b8..2649e34 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -101,7 +101,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 case ocRMZ:
 case ocZW:
 case ocIpmt:
-case ocKapz:
+case ocPpmt:
 case ocKumZinsZ:
 case ocKumKapZ:
 return NUMBERFORMAT_CURRENCY;
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 1403dfa..3b16cc3 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1257,7 +1257,7 @@ bool FormulaMissingContext::AddMissing( FormulaTokenArray 
*pNewArr, const Missin
 case ocRMZ: // PMT
 return AddDefaultArg( pNewArr, 3, 0.0 );
 case ocIpmt:
-case ocKapz:// PPMT
+case ocPpmt:
 return AddDefaultArg( pNewArr, 4, 0.0 );
 case ocBW:  // PV
 case ocZW:  // FV
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index f704d0c..1e540a2 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -229,7 +229,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_ZZR { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_IPMT { Text = IPMT ; };
-String SC_OPCODE_KAPZ { Text = PPMT ; };
+String SC_OPCODE_PPMT { Text = PPMT ; };
 String SC_OPCODE_KUM_ZINS_Z { Text = CUMIPMT ; };
 String SC_OPCODE_KUM_KAP_Z { Text = CUMPRINC ; };
 String SC_OPCODE_EFFEKTIV { Text = EFFECT ; };
@@ -636,7 +636,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_ZZR { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_IPMT { Text = IPMT ; };
-String SC_OPCODE_KAPZ { Text = PPMT ; };
+String SC_OPCODE_PPMT { Text = PPMT ; };
 String SC_OPCODE_KUM_ZINS_Z { Text = CUMIPMT ; };
 String SC_OPCODE_KUM_KAP_Z { Text = CUMPRINC ; };
 String SC_OPCODE_EFFEKTIV { Text = EFFECTIVE ; };
@@ -1045,7 +1045,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_ZZR { Text = NPER ; };
 String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_IPMT { Text = IPMT ; };
-String SC_OPCODE_KAPZ { Text = PPMT ; };
+String SC_OPCODE_PPMT { Text = PPMT ; };
 String SC_OPCODE_KUM_ZINS_Z { Text = CUMIPMT ; };
 String SC_OPCODE_KUM_KAP_Z { Text = CUMPRINC ; };
 String SC_OPCODE_EFFEKTIV { Text = EFFECTIVE ; };
@@ -1999,7 +1999,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = IPMT ;
 };
-String SC_OPCODE_KAPZ
+String SC_OPCODE_PPMT
 {
 Text [ en-US ] = PPMT ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index aca7b92..c760755 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -258,7 +258,7 @@
 #define SC_OPCODE_ZZR   258
 #define SC_OPCODE_RATE  259
 #define SC_OPCODE_IPMT  260
-#define SC_OPCODE_KAPZ  261
+#define SC_OPCODE_PPMT  261
 #define SC_OPCODE_KUM_ZINS_Z262
 #define SC_OPCODE_KUM_KAP_Z 263
 #define SC_OPCODE_EFFEKTIV  264
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index a122e2b..bd64dd5 100644
--- a/include/formula/opcode.hxx

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

2015-01-09 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/ui/src/scfuncs.src   |2 +-
 9 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit ee6c4df8d695384abefa57c27180cbe873046bd8
Author: Laurent Charrière lcharri...@gmail.com
Date:   Thu Jan 8 10:27:31 2015 +0100

fdo#85818: rename KumZinsZ to CumIpmt

Rename OcKumZinsZ to ocCumIpmt, SC_OPCODE_KUM_ZINS_Z to SC_OPCODE_IPMT,
ScInterpreter::ScKumZinsZ() to ScInterpreter::ScCumIpmt().

Change-Id: I7a062374fa0dad375c9277ca7e1c23f6d6855013
Reviewed-on: https://gerrit.libreoffice.org/13816
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index 2649e34..5225742 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -102,7 +102,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 case ocZW:
 case ocIpmt:
 case ocPpmt:
-case ocKumZinsZ:
+case ocCumIpmt:
 case ocKumKapZ:
 return NUMBERFORMAT_CURRENCY;
 case ocRate:
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 1e540a2..a8d2a48 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -230,7 +230,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_IPMT { Text = IPMT ; };
 String SC_OPCODE_PPMT { Text = PPMT ; };
-String SC_OPCODE_KUM_ZINS_Z { Text = CUMIPMT ; };
+String SC_OPCODE_CUM_IPMT { Text = CUMIPMT ; };
 String SC_OPCODE_KUM_KAP_Z { Text = CUMPRINC ; };
 String SC_OPCODE_EFFEKTIV { Text = EFFECT ; };
 String SC_OPCODE_NOMINAL { Text = NOMINAL ; };
@@ -637,7 +637,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_IPMT { Text = IPMT ; };
 String SC_OPCODE_PPMT { Text = PPMT ; };
-String SC_OPCODE_KUM_ZINS_Z { Text = CUMIPMT ; };
+String SC_OPCODE_CUM_IPMT { Text = CUMIPMT ; };
 String SC_OPCODE_KUM_KAP_Z { Text = CUMPRINC ; };
 String SC_OPCODE_EFFEKTIV { Text = EFFECTIVE ; };
 String SC_OPCODE_NOMINAL { Text = NOMINAL ; };
@@ -1046,7 +1046,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_IPMT { Text = IPMT ; };
 String SC_OPCODE_PPMT { Text = PPMT ; };
-String SC_OPCODE_KUM_ZINS_Z { Text = CUMIPMT ; };
+String SC_OPCODE_CUM_IPMT { Text = CUMIPMT ; };
 String SC_OPCODE_KUM_KAP_Z { Text = CUMPRINC ; };
 String SC_OPCODE_EFFEKTIV { Text = EFFECTIVE ; };
 String SC_OPCODE_NOMINAL { Text = NOMINAL ; };
@@ -2003,7 +2003,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = PPMT ;
 };
-String SC_OPCODE_KUM_ZINS_Z
+String SC_OPCODE_CUM_IPMT
 {
 Text [ en-US ] = CUMIPMT ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index c760755..7be2dba 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -259,7 +259,7 @@
 #define SC_OPCODE_RATE  259
 #define SC_OPCODE_IPMT  260
 #define SC_OPCODE_PPMT  261
-#define SC_OPCODE_KUM_ZINS_Z262
+#define SC_OPCODE_CUM_IPMT  262
 #define SC_OPCODE_KUM_KAP_Z 263
 #define SC_OPCODE_EFFEKTIV  264
 #define SC_OPCODE_NOMINAL   265
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index bd64dd5..2196fd8 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -263,7 +263,7 @@ enum OpCode : sal_uInt16
 ocRate  = SC_OPCODE_RATE,
 ocIpmt  = SC_OPCODE_IPMT,
 ocPpmt  = SC_OPCODE_PPMT,
-ocKumZinsZ  = SC_OPCODE_KUM_ZINS_Z,
+ocCumIpmt   = SC_OPCODE_CUM_IPMT,
 ocKumKapZ   = SC_OPCODE_KUM_KAP_Z,
 ocEffektiv  = SC_OPCODE_EFFEKTIV,
 ocNominal   = SC_OPCODE_NOMINAL,
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index b9513a3..1365229 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -686,7 +686,7 @@ double ScGetCompoundInterest(double fZins, double fZr, 
double fZzr, double fBw,
  double fZw, double fF, double 

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

2015-01-09 Thread Laurent Charrière
 formula/source/core/resource/core_resource.src |   32 -
 include/formula/compiler.hrc   |8 +++---
 include/formula/opcode.hxx |8 +++---
 sc/source/core/inc/interpre.hxx|8 +++---
 sc/source/core/opencl/formulagroupcl.cxx   |   16 ++--
 sc/source/core/opencl/op_math.cxx  |6 ++--
 sc/source/core/opencl/op_math.hxx  |6 ++--
 sc/source/core/opencl/op_statistical.cxx   |4 +--
 sc/source/core/opencl/op_statistical.hxx   |8 +++---
 sc/source/core/tool/interpr3.cxx   |8 +++---
 sc/source/core/tool/interpr4.cxx   |8 +++---
 sc/source/core/tool/token.cxx  |8 +++---
 sc/source/filter/excel/xlformula.cxx   |8 +++---
 sc/source/filter/lotus/lotform.cxx |2 -
 sc/source/ui/src/scfuncs.src   |8 +++---
 15 files changed, 69 insertions(+), 69 deletions(-)

New commits:
commit 5af576c2fcf8ebdc517b3919dd0ef808b09b04a1
Author: Laurent Charrière lcharri...@gmail.com
Date:   Wed Jan 7 15:58:44 2015 +0100

fdo#85818: rename Kombin, Kombin2, Variationen, Variationen2

Rename OcKombin to OcCombin, SC_OPCODE_KOMBIN to SC_OPCODE_COMBIN,
ScInterpreter::ScKombin() to ScInterpreter::ScCombin(), OpKombin to
OpCombin.

Rename OcKombin2 to OcCombinA, SC_OPCODE_KOMBIN_2 to
SC_OPCODE_COMBIN_A, ScInterpreter::ScKombin2() to
ScInterpreter::ScCombinA(), OpKombin2 to OpCombinA.

Rename OcVariationen to OcPermut, SC_OPCODE_VARIATIONEN to
SC_OPCODE_PERMUT, ScInterpreter::ScVariationen() to
ScInterpreter::ScPermut(), OpVariationen to OpPermut.

Rename OcVariationen2 to OcPermutationA, SC_OPCODE_VARIATIONEN_2 to
SC_OPCODE_PERMUTATION_A, ScInterpreter::ScVariationen2() to
ScInterpreter::ScPermutationA(), OpVariationen2 to OpPermutationA.

Change-Id: I2efa01e9b160e98058879d08e2e2313284a5ec91
Reviewed-on: https://gerrit.libreoffice.org/13814
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com

diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index af72798..f704d0c 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -206,10 +206,10 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_BINOM_DIST_MS { Text = COM.MICROSOFT.BINOM.DIST ; };
 String SC_OPCODE_POISSON_DIST { Text = POISSON ; };
 String SC_OPCODE_POISSON_DIST_MS { Text = COM.MICROSOFT.POISSON.DIST ; };
-String SC_OPCODE_KOMBIN { Text = COMBIN ; };
-String SC_OPCODE_KOMBIN_2 { Text = COMBINA ; };
-String SC_OPCODE_VARIATIONEN { Text = PERMUT ; };
-String SC_OPCODE_VARIATIONEN_2 { Text = PERMUTATIONA ; };
+String SC_OPCODE_COMBIN { Text = COMBIN ; };
+String SC_OPCODE_COMBIN_A { Text = COMBINA ; };
+String SC_OPCODE_PERMUT { Text = PERMUT ; };
+String SC_OPCODE_PERMUTATION_A { Text = PERMUTATIONA ; };
 String SC_OPCODE_BW { Text = PV ; };
 String SC_OPCODE_DIA { Text = SYD ; };
 String SC_OPCODE_GDA { Text = DDB ; };
@@ -613,10 +613,10 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_BINOM_DIST_MS { Text = _xlfn.BINOM.DIST ; };
 String SC_OPCODE_POISSON_DIST { Text = POISSON ; };
 String SC_OPCODE_POISSON_DIST_MS { Text = _xlfn.POISSON.DIST ; };
-String SC_OPCODE_KOMBIN { Text = COMBIN ; };
-String SC_OPCODE_KOMBIN_2 { Text = _xlfn.COMBINA ; };
-String SC_OPCODE_VARIATIONEN { Text = PERMUT ; };
-String SC_OPCODE_VARIATIONEN_2 { Text = _xlfn.PERMUTATIONA ; };
+String SC_OPCODE_COMBIN { Text = COMBIN ; };
+String SC_OPCODE_COMBIN_A { Text = _xlfn.COMBINA ; };
+String SC_OPCODE_PERMUT { Text = PERMUT ; };
+String SC_OPCODE_PERMUTATION_A { Text = _xlfn.PERMUTATIONA ; };
 String SC_OPCODE_BW { Text = PV ; };
 String SC_OPCODE_DIA { Text = SYD ; };
 String SC_OPCODE_GDA { Text = DDB ; };
@@ -1022,10 +1022,10 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_BINOM_DIST_MS { Text = BINOM.DIST ; };
 String SC_OPCODE_POISSON_DIST { Text = POISSON ; };
 String SC_OPCODE_POISSON_DIST_MS { Text = POISSON.DIST ; };
-String SC_OPCODE_KOMBIN { Text = COMBIN ; };
-String SC_OPCODE_KOMBIN_2 { Text = COMBINA ; };
-String SC_OPCODE_VARIATIONEN { Text = PERMUT ; };
-String SC_OPCODE_VARIATIONEN_2 { Text = PERMUTATIONA ; };
+String SC_OPCODE_COMBIN { Text = COMBIN ; };
+String SC_OPCODE_COMBIN_A { Text = COMBINA ; };
+String SC_OPCODE_PERMUT { Text = PERMUT ; };
+String SC_OPCODE_PERMUTATION_A { Text = PERMUTATIONA ; };
 String SC_OPCODE_BW { Text = PV ; };
 String SC_OPCODE_DIA { Text = SYD ; };
 String SC_OPCODE_GDA { Text = DDB ; };
@@ -1907,19 +1907,19 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {

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

2015-01-06 Thread Laurent Charrière
 formula/source/core/api/FormulaCompiler.cxx|2 +-
 formula/source/core/api/token.cxx  |2 +-
 formula/source/core/resource/core_resource.src |8 
 include/formula/compiler.hrc   |2 +-
 include/formula/opcode.hxx |2 +-
 sc/source/core/inc/interpre.hxx|2 +-
 sc/source/core/opencl/formulagroupcl.cxx   |2 +-
 sc/source/core/tool/interpr2.cxx   |2 +-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/token.cxx  |2 +-
 sc/source/filter/excel/xlformula.cxx   |2 +-
 sc/source/filter/lotus/lotform.cxx |6 +++---
 sc/source/filter/qpro/qproform.cxx |2 +-
 sc/source/ui/src/scfuncs.src   |2 +-
 14 files changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 1f4fd70495b3d0e732447e8e60e5faa9086471a8
Author: Laurent Charrière lcharri...@gmail.com
Date:   Tue Jan 6 21:10:31 2015 +0100

fdo#85818: rename 'Zins' enum name, constant, function to Rate

Rename OcZins to OcRate, SC_OPCODE_ZINS to SC_OPCODE_RATE,
ScInterpreter::ScZins() to ScInterpreter::ScRate()

(partial fix for fdo#85818, more constants remain to be renamed)

Change-Id: Icd5d0df14f2583da7ebd0308dc660abd07f326a4
Reviewed-on: https://gerrit.libreoffice.org/13777
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/formula/source/core/api/FormulaCompiler.cxx 
b/formula/source/core/api/FormulaCompiler.cxx
index f5b1b9a..69afa63 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -105,7 +105,7 @@ short lcl_GetRetFormat( OpCode eOpCode )
 case ocKumZinsZ:
 case ocKumKapZ:
 return NUMBERFORMAT_CURRENCY;
-case ocZins:
+case ocRate:
 case ocIRR:
 case ocMIRR:
 case ocZGZ:
diff --git a/formula/source/core/api/token.cxx 
b/formula/source/core/api/token.cxx
index 2f6ae97..ec9f4d3 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1264,7 +1264,7 @@ bool FormulaMissingContext::AddMissing( FormulaTokenArray 
*pNewArr, const Missin
 bRet |= AddDefaultArg( pNewArr, 2, 0.0 );   // pmt
 bRet |= AddDefaultArg( pNewArr, 3, 0.0 );   // [fp]v
 break;
-case ocZins:// RATE
+case ocRate:// RATE
 bRet |= AddDefaultArg( pNewArr, 1, 0.0 );   // pmt
 bRet |= AddDefaultArg( pNewArr, 3, 0.0 );   // fv
 bRet |= AddDefaultArg( pNewArr, 4, 0.0 );   // type
diff --git a/formula/source/core/resource/core_resource.src 
b/formula/source/core/resource/core_resource.src
index 99b387d..408d083 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -227,7 +227,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
 String SC_OPCODE_ZGZ { Text = RRI ; };
 String SC_OPCODE_ZW { Text = FV ; };
 String SC_OPCODE_ZZR { Text = NPER ; };
-String SC_OPCODE_ZINS { Text = RATE ; };
+String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_ZINS_Z { Text = IPMT ; };
 String SC_OPCODE_KAPZ { Text = PPMT ; };
 String SC_OPCODE_KUM_ZINS_Z { Text = CUMIPMT ; };
@@ -634,7 +634,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
 String SC_OPCODE_ZGZ { Text = _xlfn.RRI ; };
 String SC_OPCODE_ZW { Text = FV ; };
 String SC_OPCODE_ZZR { Text = NPER ; };
-String SC_OPCODE_ZINS { Text = RATE ; };
+String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_ZINS_Z { Text = IPMT ; };
 String SC_OPCODE_KAPZ { Text = PPMT ; };
 String SC_OPCODE_KUM_ZINS_Z { Text = CUMIPMT ; };
@@ -1043,7 +1043,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
 String SC_OPCODE_ZGZ { Text = ZGZ ; };
 String SC_OPCODE_ZW { Text = FV ; };
 String SC_OPCODE_ZZR { Text = NPER ; };
-String SC_OPCODE_ZINS { Text = RATE ; };
+String SC_OPCODE_RATE { Text = RATE ; };
 String SC_OPCODE_ZINS_Z { Text = IPMT ; };
 String SC_OPCODE_KAPZ { Text = PPMT ; };
 String SC_OPCODE_KUM_ZINS_Z { Text = CUMIPMT ; };
@@ -1991,7 +1991,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
 {
 Text [ en-US ] = NPER ;
 };
-String SC_OPCODE_ZINS
+String SC_OPCODE_RATE
 {
 Text [ en-US ] = RATE ;
 };
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index bd1ad39..8767082 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -256,7 +256,7 @@
 #define SC_OPCODE_ZGZ   256
 #define SC_OPCODE_ZW257
 #define SC_OPCODE_ZZR   258
-#define SC_OPCODE_ZINS  259
+#define SC_OPCODE_RATE  259
 #define SC_OPCODE_ZINS_Z 

  1   2   >