You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2023/01/30 22:54:27 UTC
[openoffice] branch AOO41X updated (6ba668b9ce -> 535b2a065d)
This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a change to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
from 6ba668b9ce Add EURO as default currency in Croatian locale data
new 5ab069a05e OpenOffice Calc offers functions for converting from old national currencies to EURO.
new 535b2a065d OpenOffice Calc offers functions for converting from old national currencies to EURO.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../registry/data/org/openoffice/Office/Calc.xcu | 56 +++++++++++++++++++---
main/sc/source/core/tool/interpr2.cxx | 33 +++++++------
2 files changed, 68 insertions(+), 21 deletions(-)
[openoffice] 02/02: OpenOffice Calc offers functions for converting from old national currencies to EURO.
Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 535b2a065d2d7970b82ff409ce46f57ad17a813d
Author: mseidel <ms...@apache.org>
AuthorDate: Mon Jan 30 23:46:11 2023 +0100
OpenOffice Calc offers functions for converting from old national currencies to EURO.
Croatia joined the euro area in 2023, see:
https://www.ecb.europa.eu/euro/changeover/croatia/html/index.en.html
(cherry picked from commit a658d2c3a558c3c19f1f11cd0c149f02935bb073)
---
.../registry/data/org/openoffice/Office/Calc.xcu | 11 +++++++++++
main/sc/source/core/tool/interpr2.cxx | 22 +++++++++++-----------
2 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/main/officecfg/registry/data/org/openoffice/Office/Calc.xcu b/main/officecfg/registry/data/org/openoffice/Office/Calc.xcu
index 51260af9e2..ee857f4b37 100644
--- a/main/officecfg/registry/data/org/openoffice/Office/Calc.xcu
+++ b/main/officecfg/registry/data/org/openoffice/Office/Calc.xcu
@@ -233,6 +233,17 @@
<value>3.45280</value>
</prop>
</node>
+ <node oor:name="CR20" oor:op="replace">
+ <prop oor:name="FromUnit">
+ <value>EUR</value>
+ </prop>
+ <prop oor:name="ToUnit">
+ <value>HRK</value>
+ </prop>
+ <prop oor:name="Factor">
+ <value>7.53450</value>
+ </prop>
+ </node>
</node>
<node oor:name="Calculate">
<node oor:name="Other">
diff --git a/main/sc/source/core/tool/interpr2.cxx b/main/sc/source/core/tool/interpr2.cxx
index 426af5d330..3146d04f5b 100644
--- a/main/sc/source/core/tool/interpr2.cxx
+++ b/main/sc/source/core/tool/interpr2.cxx
@@ -70,7 +70,7 @@ double ScInterpreter::GetDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int1
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::GetDateSerial" );
if ( nYear < 100 && !bStrict )
nYear = pFormatter->ExpandTwoDigitYear( nYear );
- // Do not use a default Date ctor here because it asks system time with a
+ // Do not use a default Date ctor here because it asks system time with a
// performance penalty.
sal_Int16 nY, nM, nD;
if (bStrict)
@@ -1138,10 +1138,10 @@ double ScInterpreter::ScGetRmz(double fRate, double fNper, double fPv,
else
{
if (fPaytype > 0.0) // payment in advance
- fPayment = (fFv + fPv * exp( fNper * ::boost::math::log1p(fRate) ) ) * fRate /
+ fPayment = (fFv + fPv * exp( fNper * ::boost::math::log1p(fRate) ) ) * fRate /
(::boost::math::expm1( (fNper + 1) * ::boost::math::log1p(fRate) ) - fRate);
else // payment in arrear
- fPayment = (fFv + fPv * exp(fNper * ::boost::math::log1p(fRate) ) ) * fRate /
+ fPayment = (fFv + fPv * exp(fNper * ::boost::math::log1p(fRate) ) ) * fRate /
::boost::math::expm1( fNper * ::boost::math::log1p(fRate) );
}
return -fPayment;
@@ -1803,7 +1803,7 @@ void ScInterpreter::ScIntersect()
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScIntersect" );
formula::FormulaTokenRef p2nd = PopToken();
formula::FormulaTokenRef p1st = PopToken();
-
+
if (nGlobalError || !p2nd || !p1st)
{
PushIllegalArgument();
@@ -1951,7 +1951,7 @@ void ScInterpreter::ScRangeFunc()
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScRangeFunc" );
formula::FormulaTokenRef x2 = PopToken();
formula::FormulaTokenRef x1 = PopToken();
-
+
if (nGlobalError || !x2 || !x1)
{
PushIllegalArgument();
@@ -1970,7 +1970,7 @@ void ScInterpreter::ScUnionFunc()
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScUnionFunc" );
formula::FormulaTokenRef p2nd = PopToken();
formula::FormulaTokenRef p1st = PopToken();
-
+
if (nGlobalError || !p2nd || !p1st)
{
PushIllegalArgument();
@@ -1989,7 +1989,7 @@ void ScInterpreter::ScUnionFunc()
ScToken* x1 = static_cast<ScToken*>(p1st.get());
ScToken* x2 = static_cast<ScToken*>(p2nd.get());
-
+
ScTokenRef xRes;
// Append to an existing RefList if there is one.
if (sv1 == svRefList)
@@ -2671,7 +2671,8 @@ sal_Bool lclConvertMoney( const String& aSearchUnit, double& rfRate, int& rnDec
{ "SKK", 30.1260, 2 },
{ "EEK", 15.6466, 2 },
{ "LVL", 0.702804, 2 },
- { "LTL", 3.45280, 2 }
+ { "LTL", 3.45280, 2 },
+ { "HRK", 7.53450, 2 }
};
const size_t nConversionCount = sizeof( aConvertTable ) / sizeof( aConvertTable[0] );
@@ -2976,7 +2977,7 @@ void ScInterpreter::ScGetPivotData()
//! should allow numeric constraint values
aFilters[i].mbValIsStr = sal_True;
aFilters[i].maValStr = GetString();
-
+
aFilters[i].maFieldName = GetString();
}
}
@@ -3014,7 +3015,7 @@ void ScInterpreter::ScGetPivotData()
goto failed;
}
else
- aTarget.maFieldName = GetString(); // new syntax: first parameter is data field name
+ aTarget.maFieldName = GetString(); // new syntax: first parameter is data field name
if( pDPObj->GetPivotData( aTarget, aFilters ) )
{
@@ -3029,4 +3030,3 @@ void ScInterpreter::ScGetPivotData()
failed :
PushError( errNoRef );
}
-
[openoffice] 01/02: OpenOffice Calc offers functions for converting from old national currencies to EURO.
Posted by ms...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 5ab069a05e4bde5ca4b6655593819e6a83fdd8e3
Author: Matthias Seidel <ms...@apache.org>
AuthorDate: Sun May 12 14:17:46 2019 +0000
OpenOffice Calc offers functions for converting from old national currencies to EURO.
Additional countries joined the euro area: Estonia (2011), Latvia (2014) and Lithuania (2015), see:
https://www.ecb.europa.eu/euro/changeover/estonia/html/index.en.html
https://www.ecb.europa.eu/euro/changeover/latvia/html/index.en.html
https://www.ecb.europa.eu/euro/changeover/lithuania/html/index.en.html
This patch adds those currencies and conversion rates for CONVERT (Calc.xcu) and EUROCONVERT (interpr2.cxx).
git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1859148 13f79535-47bb-0310-9956-ffa450edef68
(cherry picked from commit b87f12bb81d7d34bb81a54b5c5528c145f92cca6)
---
.../registry/data/org/openoffice/Office/Calc.xcu | 45 +++++++++++++++++++---
main/sc/source/core/tool/interpr2.cxx | 13 ++++---
2 files changed, 47 insertions(+), 11 deletions(-)
diff --git a/main/officecfg/registry/data/org/openoffice/Office/Calc.xcu b/main/officecfg/registry/data/org/openoffice/Office/Calc.xcu
index 7dcc0d9f07..51260af9e2 100644
--- a/main/officecfg/registry/data/org/openoffice/Office/Calc.xcu
+++ b/main/officecfg/registry/data/org/openoffice/Office/Calc.xcu
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -8,16 +8,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
***********************************************************-->
@@ -175,7 +175,7 @@
<value>MTL</value>
</prop>
<prop oor:name="Factor">
- <value>.429300</value>
+ <value>.429300</value>
</prop>
</node>
<node oor:name="CR15" oor:op="replace">
@@ -186,7 +186,7 @@
<value>CYP</value>
</prop>
<prop oor:name="Factor">
- <value>.585274</value>
+ <value>.585274</value>
</prop>
</node>
<node oor:name="CR16" oor:op="replace">
@@ -200,6 +200,39 @@
<value>30.1260</value>
</prop>
</node>
+ <node oor:name="CR17" oor:op="replace">
+ <prop oor:name="FromUnit">
+ <value>EUR</value>
+ </prop>
+ <prop oor:name="ToUnit">
+ <value>EEK</value>
+ </prop>
+ <prop oor:name="Factor">
+ <value>15.6466</value>
+ </prop>
+ </node>
+ <node oor:name="CR18" oor:op="replace">
+ <prop oor:name="FromUnit">
+ <value>EUR</value>
+ </prop>
+ <prop oor:name="ToUnit">
+ <value>LVL</value>
+ </prop>
+ <prop oor:name="Factor">
+ <value>0.702804</value>
+ </prop>
+ </node>
+ <node oor:name="CR19" oor:op="replace">
+ <prop oor:name="FromUnit">
+ <value>EUR</value>
+ </prop>
+ <prop oor:name="ToUnit">
+ <value>LTL</value>
+ </prop>
+ <prop oor:name="Factor">
+ <value>3.45280</value>
+ </prop>
+ </node>
</node>
<node oor:name="Calculate">
<node oor:name="Other">
diff --git a/main/sc/source/core/tool/interpr2.cxx b/main/sc/source/core/tool/interpr2.cxx
index 92b4d1323f..426af5d330 100644
--- a/main/sc/source/core/tool/interpr2.cxx
+++ b/main/sc/source/core/tool/interpr2.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -2668,7 +2668,10 @@ sal_Bool lclConvertMoney( const String& aSearchUnit, double& rfRate, int& rnDec
{ "SIT", 239.640, 2 },
{ "MTL", 0.429300, 2 },
{ "CYP", 0.585274, 2 },
- { "SKK", 30.1260, 2 }
+ { "SKK", 30.1260, 2 },
+ { "EEK", 15.6466, 2 },
+ { "LVL", 0.702804, 2 },
+ { "LTL", 3.45280, 2 }
};
const size_t nConversionCount = sizeof( aConvertTable ) / sizeof( aConvertTable[0] );