[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source
sc/qa/unit/data/xls/opencl/financial/ISPMT.xls |binary sc/qa/unit/opencl-test.cxx | 24 + sc/source/core/opencl/formulagroupcl.cxx |3 + sc/source/core/opencl/op_financial.cxx | 45 + sc/source/core/opencl/op_financial.hxx | 11 ++ sc/source/core/tool/token.cxx |1 6 files changed, 84 insertions(+) New commits: commit 1c239f51064e30713ac87abd3697d73bc5e5bcc1 Author: xinjiang xinji...@multicorewareinc.com Date: Mon Nov 4 10:40:51 2013 +0800 GPU Calc: implemented ISPMT in GPU calc AMLOEXT-99 FIX Change-Id: I8cd9f130c190e6925873a00579cb7c334201f418 Signed-off-by: haochen haoc...@multicorewareinc.com Signed-off-by: I-Jui (Ray) Sung r...@multicorewareinc.com diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index d4dada6..9610a4a 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -1013,6 +1013,9 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments( case ocCosecant: mvSubArguments.push_back(SoPHelper(ts, ft-Children[i], new OpCsc)); break; +case ocISPMT: +mvSubArguments.push_back(SoPHelper(ts, ft-Children[i], new OpISPMT)); +break; case ocExternal: if ( !(pChild-GetExternal().compareTo(OUString( com.sun.star.sheet.addin.Analysis.getEffect diff --git a/sc/source/core/opencl/op_financial.cxx b/sc/source/core/opencl/op_financial.cxx index 329dd77..503087b 100644 --- a/sc/source/core/opencl/op_financial.cxx +++ b/sc/source/core/opencl/op_financial.cxx @@ -487,6 +487,51 @@ void OpINTRATE::GenSlidingWindowFunction( ss }; } +void OpISPMT::GenSlidingWindowFunction(std::stringstream ss, +const std::string sSymName, SubArguments vSubArguments) +{ +ss \ndouble sSymName; +ss _ BinFuncName() (; +for (unsigned i = 0; i vSubArguments.size(); i++) +{ +if (i) +ss ,; +vSubArguments[i]-GenSlidingWindowDecl(ss); +} +ss ) {\n; +ss double tmp = GetBottom() ;\n; +ss int gid0 = get_global_id(0);\n; +ss double arg0 = GetBottom() ;\n; +ss double arg1 = GetBottom() ;\n; +ss double arg2 = GetBottom() ;\n; +ss double arg3 = GetBottom() ;\n; +unsigned i = vSubArguments.size(); +while (i--) +{ +FormulaToken* pCur = vSubArguments[i]-GetFormulaToken(); +assert(pCur); +if(pCur-GetType() == formula::svSingleVectorRef) +{ +#ifdef ISNAN +const formula::SingleVectorRefToken* pSVR = +dynamic_cast const formula::SingleVectorRefToken* (pCur); +ss if(gid0 = pSVR-GetArrayLength() || isNan(; +ss vSubArguments[i]-GenSlidingWindowDeclRef(); +ss ))\n; +ss arg i = GetBottom() ;\n; +ss else\n; +#endif +ss arg i = ; +ss vSubArguments[i]-GenSlidingWindowDeclRef(); +ss ;\n; +} +} +ss tmp = arg3 * arg0 * ( arg1 / arg2 - 1.0);\n; +ss return tmp;\n; +ss }; +} + + void Fvschedule::GenSlidingWindowFunction( std::stringstream ss, const std::string sSymName, SubArguments vSubArguments) { diff --git a/sc/source/core/opencl/op_financial.hxx b/sc/source/core/opencl/op_financial.hxx index 7a79dde..6add67f 100644 --- a/sc/source/core/opencl/op_financial.hxx +++ b/sc/source/core/opencl/op_financial.hxx @@ -86,6 +86,17 @@ public: virtual std::string BinFuncName(void) const { return INTRATE; } }; +class OpISPMT: public Normal +{ +public: +virtual std::string GetBottom(void) { return 0; } + +virtual void GenSlidingWindowFunction(std::stringstream ss, +const std::string sSymName, SubArguments vSubArguments); + +virtual std::string BinFuncName(void) const { return ISPMT; } +}; + class Fvschedule: public Normal { public: commit 12a86d12e9be04b5ce3df946e6c7b5a065533cbd Author: xinjiang xinji...@multicorewareinc.com Date: Mon Nov 4 10:36:28 2013 +0800 GPU Calc: unit test cases for ISPMT in GPU calc AMLOEXT-99 BUG Change-Id: I4388b184b23cf616dacfb20c61d2295765925ede Signed-off-by: haochen haoc...@multicorewareinc.com Signed-off-by: I-Jui (Ray) Sung r...@multicorewareinc.com diff --git a/sc/qa/unit/data/xls/opencl/financial/ISPMT.xls b/sc/qa/unit/data/xls/opencl/financial/ISPMT.xls new file mode 100644 index 000..8759e7e Binary files /dev/null and b/sc/qa/unit/data/xls/opencl/financial/ISPMT.xls differ diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index c8cf326..dd626cd 100644 ---
[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source
sc/qa/unit/data/ods/opencl/financial/Duration.ods |binary sc/qa/unit/opencl-test.cxx| 24 sc/source/core/opencl/formulagroupcl.cxx |4 ++ sc/source/core/opencl/op_financial.cxx| 42 ++ sc/source/core/opencl/op_financial.hxx| 12 ++ sc/source/core/tool/token.cxx |1 6 files changed, 83 insertions(+) New commits: commit 0644c59f1e2822c687ef0366f6c02b3b21a3f01a Author: xinjiang xinji...@multicorewareinc.com Date: Mon Nov 4 11:18:04 2013 +0800 GPU Calc: implemented DURATION AMLOEXT-111 FIX Change-Id: I114e5b20326657f7fd3e0de7162a8ae190059b2a Signed-off-by: haochen haoc...@multicorewareinc.com Signed-off-by: I-Jui (Ray) Sung r...@multicorewareinc.com diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index ce3223e..24647bf 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -1016,6 +1016,10 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments( case ocISPMT: mvSubArguments.push_back(SoPHelper(ts, ft-Children[i], new OpISPMT)); break; +case ocLaufz: +mvSubArguments.push_back(SoPHelper(ts, + ft-Children[i], new OpDuration)); +break; case ocExternal: if ( !(pChild-GetExternal().compareTo(OUString( com.sun.star.sheet.addin.Analysis.getEffect diff --git a/sc/source/core/opencl/op_financial.cxx b/sc/source/core/opencl/op_financial.cxx index f9f1fa6..a40a113 100644 --- a/sc/source/core/opencl/op_financial.cxx +++ b/sc/source/core/opencl/op_financial.cxx @@ -531,6 +531,48 @@ void OpISPMT::GenSlidingWindowFunction(std::stringstream ss, ss }; } +void OpDuration::GenSlidingWindowFunction(std::stringstream ss, +const std::string sSymName, SubArguments vSubArguments) +{ +ss \ndouble sSymName; +ss _ BinFuncName() (; +for (unsigned i = 0; i vSubArguments.size(); i++) +{ +if (i) +ss ,; +vSubArguments[i]-GenSlidingWindowDecl(ss); +} +ss ) {\n; +ss double tmp = GetBottom() ;\n; +ss int gid0 = get_global_id(0);\n; +ss double arg0 = GetBottom() ;\n; +ss double arg1 = GetBottom() ;\n; +ss double arg2 = GetBottom() ;\n; +unsigned i = vSubArguments.size(); +while (i--) +{ +FormulaToken* pCur = vSubArguments[i]-GetFormulaToken(); +assert(pCur); +if(pCur-GetType() == formula::svSingleVectorRef) +{ +#ifdef ISNAN +const formula::SingleVectorRefToken* pSVR = +dynamic_cast const formula::SingleVectorRefToken* (pCur); +ss if(gid0 = pSVR-GetArrayLength() || isNan(; +ss vSubArguments[i]-GenSlidingWindowDeclRef(); +ss ))\n; +ss arg i = GetBottom() ;\n; +ss else\n; +#endif +ss arg i = ; +ss vSubArguments[i]-GenSlidingWindowDeclRef(); +ss ;\n; +} +} +ss tmp = log(arg2 / arg1) / log(arg0 + 1.0);\n; +ss return tmp;\n; +ss }; +} void Fvschedule::GenSlidingWindowFunction( std::stringstream ss, const std::string sSymName, SubArguments vSubArguments) diff --git a/sc/source/core/opencl/op_financial.hxx b/sc/source/core/opencl/op_financial.hxx index cd62f82..fc73076 100644 --- a/sc/source/core/opencl/op_financial.hxx +++ b/sc/source/core/opencl/op_financial.hxx @@ -97,6 +97,18 @@ public: virtual std::string BinFuncName(void) const { return ISPMT; } }; +class OpDuration: public Normal +{ +public: +virtual std::string GetBottom(void) { return 0; } + +virtual void GenSlidingWindowFunction(std::stringstream ss, +const std::string sSymName, SubArguments vSubArguments); + +virtual std::string BinFuncName(void) const { return Duration; } +}; + + class Fvschedule: public Normal { public: commit d454a57acd6bada1cd6913a7c42f8bf3f0a39a70 Author: xinjiang xinji...@multicorewareinc.com Date: Mon Nov 4 11:12:17 2013 +0800 GPU Calc: unit test cases for DURATION AMLOEXT-111 BUG Change-Id: I1d206b0eda0dca8254f0491399d0a4679eb39ef8 Signed-off-by: haochen haoc...@multicorewareinc.com Signed-off-by: I-Jui (Ray) Sung r...@multicorewareinc.com diff --git a/sc/qa/unit/data/ods/opencl/financial/Duration.ods b/sc/qa/unit/data/ods/opencl/financial/Duration.ods new file mode 100644 index 000..d884dfe Binary files /dev/null and b/sc/qa/unit/data/ods/opencl/financial/Duration.ods differ diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 7264c7e..0d228d5 100644
[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source
sc/qa/unit/data/xls/opencl/financial/Coupnum.xls |binary sc/qa/unit/opencl-test.cxx | 25 + sc/source/core/opencl/formulagroupcl.cxx |6 + sc/source/core/opencl/op_financial.cxx | 97 ++- sc/source/core/opencl/op_financial.hxx |9 ++ 5 files changed, 136 insertions(+), 1 deletion(-) New commits: commit 457b349edbaf6d9dc747f3a631fee70e0c035bae Author: minwang m...@multicorewareinc.com Date: Mon Nov 4 11:32:43 2013 +0800 GPU Calc: implemented COUPNUM AMLOEXT-74 FIX Change-Id: Ic7f274f089f7f6cc6b767c4a07844014eeded61d Signed-off-by: haochen haoc...@multicorewareinc.com Signed-off-by: I-Jui (Ray) Sung r...@multicorewareinc.com diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 24647bf..1cc0b9f 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -1137,6 +1137,12 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments( mvSubArguments.push_back(SoPHelper(ts, ft-Children[i], new OpPrice)); } +else if ( !(pChild-GetExternal().compareTo(OUString( + com.sun.star.sheet.addin.Analysis.getCoupnum +{ +mvSubArguments.push_back(SoPHelper(ts, ft-Children[i], +new OpCoupnum)); +} break; default: throw UnhandledToken(pChild, unhandled opcode); diff --git a/sc/source/core/opencl/op_financial.cxx b/sc/source/core/opencl/op_financial.cxx index a40a113..b5b9a5c 100644 --- a/sc/source/core/opencl/op_financial.cxx +++ b/sc/source/core/opencl/op_financial.cxx @@ -2740,7 +2740,102 @@ void OpCoupdaysnc::GenSlidingWindowFunction( ss }; } - void OpReceived::BinInlineFun(std::setstd::string decls, +void OpCoupnum::BinInlineFun(std::setstd::string decls, +std::setstd::string funs) +{ +decls.insert(IsLeapYearDecl);decls.insert(DaysInMonthDecl); +decls.insert(DaysToDateDecl);decls.insert(DateToDaysDecl); +decls.insert(GetNullDateDecl);decls.insert(lcl_GetcoupnumDecl); +decls.insert(coupnumDecl); +funs.insert(IsLeapYear);funs.insert(DaysInMonth); +funs.insert(DaysToDate);funs.insert(DateToDays); +funs.insert(GetNullDate); +funs.insert(lcl_Getcoupnum); +funs.insert(coupnum); +} +void OpCoupnum::GenSlidingWindowFunction(std::stringstream ss, +const std::string sSymName, SubArguments vSubArguments) +{ +ss \ndouble sSymName; +ss _ BinFuncName() (; +for (unsigned i = 0; i vSubArguments.size(); i++) +{ + if (i) + ss ,; + vSubArguments[i]-GenSlidingWindowDecl(ss); +} +ss ) {\n; +ss double tmp = GetBottom() ;\n; +ss int gid0 = get_global_id(0);\n; +ss int nSettle,nMat,nFreq,nBase;\n; +#ifdef ISNAN +FormulaToken* tmpCur0 = vSubArguments[0]-GetFormulaToken(); +const formula::SingleVectorRefToken*tmpCurDVR0= dynamic_castconst +formula::SingleVectorRefToken *(tmpCur0); +FormulaToken* tmpCur1 = vSubArguments[1]-GetFormulaToken(); +const formula::SingleVectorRefToken*tmpCurDVR1= dynamic_castconst +formula::SingleVectorRefToken *(tmpCur1); +FormulaToken* tmpCur2 = vSubArguments[2]-GetFormulaToken(); +const formula::SingleVectorRefToken*tmpCurDVR2= dynamic_castconst +formula::SingleVectorRefToken *(tmpCur2); +FormulaToken* tmpCur3 = vSubArguments[3]-GetFormulaToken(); +const formula::SingleVectorRefToken*tmpCurDVR3= dynamic_castconst +formula::SingleVectorRefToken *(tmpCur3); +ss int buffer_nSettle_len = ; +ss tmpCurDVR0-GetArrayLength(); +ss ;\n; +ss int buffer_nMat_len = ; +ss tmpCurDVR1-GetArrayLength(); +ss ;\n; +ss int buffer_nFreq_len = ; +ss tmpCurDVR2-GetArrayLength(); +ss ;\n; +ss int buffer_nBase_len = ; +ss tmpCurDVR3-GetArrayLength(); +ss ;\n; +#endif +#ifdef ISNAN +ss if(gid0 = buffer_nSettle_len || isNan(; +ss vSubArguments[0]-GenSlidingWindowDeclRef(); +ss ))\n; +ss nSettle = 0;\nelse\n; +#endif +ss nSettle=(int); +ss vSubArguments[0]-GenSlidingWindowDeclRef(); +ss ;\n; +#ifdef ISNAN +ss if(gid0 = buffer_nMat_len || isNan(; +ss vSubArguments[1]-GenSlidingWindowDeclRef(); +ss ))\n; +ss nMat = 0;\nelse\n; +#endif +ss nMat=(int); +ss vSubArguments[1]-GenSlidingWindowDeclRef(); +ss ;\n; +#ifdef ISNAN +ss if(gid0 = buffer_nFreq_len || isNan(; +ss vSubArguments[2]-GenSlidingWindowDeclRef(); +ss ))\n; +ss nFreq = 0;\nelse\n; +#endif +ss nFreq=(int); +ss vSubArguments[2]-GenSlidingWindowDeclRef(); +ss ;\n; +#ifdef ISNAN +ss if(gid0 = buffer_nBase_len || isNan(; +ss
[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source
sc/qa/unit/data/xls/opencl/financial/PMT.xls |binary sc/qa/unit/opencl-test.cxx | 25 + sc/source/core/opencl/op_financial.cxx | 130 +-- 3 files changed, 127 insertions(+), 28 deletions(-) New commits: commit 35f8d734dd54cafd1e9d07a1e67b63c366b93a9d Author: mulei mu...@multicorewareinc.com Date: Fri Nov 1 12:02:35 2013 -0500 GPU Calc: implement NAN argument handling in PMT Change-Id: I1288a20652b4ceb66d90314f7acddb73506dfb43 Signed-off-by: I-Jui (Ray) Sung r...@multicorewareinc.com Signed-off-by: haochen haoc...@multicorewareinc.com diff --git a/sc/source/core/opencl/op_financial.cxx b/sc/source/core/opencl/op_financial.cxx index da4845c..69f7d02 100644 --- a/sc/source/core/opencl/op_financial.cxx +++ b/sc/source/core/opencl/op_financial.cxx @@ -1837,44 +1837,118 @@ void OpYieldmat::GenSlidingWindowFunction( ss }; } -void OpPMT::GenSlidingWindowFunction( -std::stringstream ss, const std::string sSymName, SubArguments vSubArguments) +void OpPMT::GenSlidingWindowFunction(std::stringstream ss, +const std::string sSymName, SubArguments vSubArguments) { ss \ndouble sSymName; ss _ BinFuncName() (; for (unsigned i = 0; i vSubArguments.size(); i++) { if (i) -ss ,; +ss , ; vSubArguments[i]-GenSlidingWindowDecl(ss); } -ss ) {\n\t; -ss double tmp = 0;\n\t; -ssdouble tFv=0,tType=0;\n\t; -ss int gid0 = get_global_id(0);\n\t; - if(vSubArguments.size()==4) -sstFv=vSubArguments[3]-GenSlidingWindowDeclRef();\n\t; -else if(vSubArguments.size()==5) +ss ) {\n; +ss double tmp = 0;\n; +ss int gid0 = get_global_id(0);\n; +ssdouble tmp0,tmp1,tmp2;\n; +ssdouble tmp3=0,tmp4=0;\n; +unsigned i = vSubArguments.size(); +size_t nItems = 0; +ss \n; +//while (i-- 1) +for (size_t i = 0; i vSubArguments.size(); i++) { -sstType=vSubArguments[4]-GenSlidingWindowDeclRef(); -ss;\n\t; -sstFv=vSubArguments[3]-GenSlidingWindowDeclRef(); -ss;\n\t; +FormulaToken *pCur = vSubArguments[i]-GetFormulaToken(); +assert(pCur); +if (pCur-GetType() == formula::svDoubleVectorRef) +{ +const formula::DoubleVectorRefToken* pDVR = +dynamic_castconst formula::DoubleVectorRefToken *(pCur); +size_t nCurWindowSize = pDVR-GetRefRowSize(); +ss for (int i = ; +if (!pDVR-IsStartFixed() pDVR-IsEndFixed()) { +#ifdef ISNAN +ss gid0; ipDVR-GetArrayLength(); +ssinCurWindowSize ; i++){\n; +#else +ss gid0; i nCurWindowSize ; i++)\n; +#endif +} else if (pDVR-IsStartFixed() !pDVR-IsEndFixed()) { +#ifdef ISNAN +ss 0; ipDVR-GetArrayLength(); +ssi gid0+ nCurWindowSize ; i++){\n; +#else +ss 0; i gid0+ nCurWindowSize ; i++)\n; +#endif +} else if (!pDVR-IsStartFixed() !pDVR-IsEndFixed()){ +#ifdef ISNAN +ss 0; i + gid0pDVR-GetArrayLength(); +ss i nCurWindowSize ; i++){\n; +#else +ss 0; i nCurWindowSize ; i++)\n; +#endif +} +else { +#ifdef ISNAN +ss 0; i nCurWindowSize ; i++){\n; +#else +ss 0; i nCurWindowSize ; i++)\n; +#endif +} +nItems += nCurWindowSize; +} +else if (pCur-GetType() == formula::svSingleVectorRef) +{ +#ifdef ISNAN +const formula::SingleVectorRefToken* pSVR = +dynamic_cast const formula::SingleVectorRefToken* (pCur); +ss if (gid0pSVR-GetArrayLength() ){\n; +#else +nItems += 1; +#endif +} +else if (pCur-GetType() == formula::svDouble) +{ +#ifdef ISNAN +ss {\n; +#endif +nItems += 1; +} +else +{ +#ifdef ISNAN +#endif +nItems += 1; +} +#ifdef ISNAN +if(ocPush==vSubArguments[i]-GetFormulaToken()-GetOpCode()) +{ +ss if (isNan(; +ss vSubArguments[i]-GenSlidingWindowDeclRef(); +ss ))\n; +ss tmpi= 0;\n; +ss else\n; +ss tmpi=vSubArguments[i]-GenSlidingWindowDeclRef(); +ss ;\n}\n; +} +else +{ +ss tmpi=vSubArguments[i]-GenSlidingWindowDeclRef(); +ss ;\n; +} +#else +ss tmpi=vSubArguments[i]-GenSlidingWindowDeclRef(); +ss ;\n; + +#endif } -ssif(vSubArguments[0]-GenSlidingWindowDeclRef()==0.0)\n\t; -ss\treturn (vSubArguments[2]-GenSlidingWindowDeclRef(); -ss+tFv)/; -
[Libreoffice-commits] core.git: 2 commits - sc/qa
dev/null|binary sc/qa/unit/data/ods/opencl/compiler/ineq.ods|binary sc/qa/unit/data/ods/opencl/compiler/nested.ods |binary sc/qa/unit/data/ods/opencl/compiler/string.ods |binary sc/qa/unit/data/ods/opencl/math/csc.ods |binary sc/qa/unit/data/ods/opencl/statistical/Correl.ods |binary sc/qa/unit/data/xls/opencl/financial/Accrintm.xls |binary sc/qa/unit/data/xls/opencl/financial/Coupdaybs.xls |binary sc/qa/unit/data/xls/opencl/financial/Coupdays.xls |binary sc/qa/unit/data/xls/opencl/financial/Coupdaysnc.xls |binary sc/qa/unit/data/xls/opencl/financial/Cumipmt.xls|binary sc/qa/unit/data/xls/opencl/financial/Cumprinc.xls |binary sc/qa/unit/data/xls/opencl/financial/DISC.xls |binary sc/qa/unit/data/xls/opencl/financial/Dollarde.xls |binary sc/qa/unit/data/xls/opencl/financial/Dollarfr.xls |binary sc/qa/unit/data/xls/opencl/financial/EFFECT_ADD.xls |binary sc/qa/unit/data/xls/opencl/financial/Fvschedule.xls |binary sc/qa/unit/data/xls/opencl/financial/INTRATE.xls|binary sc/qa/unit/data/xls/opencl/financial/IRR.xls|binary sc/qa/unit/data/xls/opencl/financial/MIRR.xls |binary sc/qa/unit/data/xls/opencl/financial/Nominal.xls|binary sc/qa/unit/data/xls/opencl/financial/PriceMat.xls |binary sc/qa/unit/data/xls/opencl/financial/RATE.xls |binary sc/qa/unit/data/xls/opencl/financial/RRI.xls|binary sc/qa/unit/data/xls/opencl/financial/Received.xls |binary sc/qa/unit/data/xls/opencl/financial/SLN.xls|binary sc/qa/unit/data/xls/opencl/financial/SYD.xls|binary sc/qa/unit/data/xls/opencl/financial/TBILLEQ.xls|binary sc/qa/unit/data/xls/opencl/financial/TBILLPRICE.xls |binary sc/qa/unit/data/xls/opencl/financial/TBILLYIELD.xls |binary sc/qa/unit/data/xls/opencl/financial/XNPV.xls |binary sc/qa/unit/data/xls/opencl/financial/YIELD.xls |binary sc/qa/unit/data/xls/opencl/financial/YIELDDISC.xls |binary sc/qa/unit/data/xls/opencl/financial/YIELDMAT.xls |binary sc/qa/unit/data/xls/opencl/financial/general.xls|binary sc/qa/unit/data/xls/opencl/math/cos.xls |binary sc/qa/unit/data/xls/opencl/statistical/Fisher.xls |binary sc/qa/unit/data/xls/opencl/statistical/FisherInv.xls|binary sc/qa/unit/data/xls/opencl/statistical/Gamma.xls|binary sc/qa/unit/data/xls/opencl/statistical/GammaLn.xls |binary sc/qa/unit/data/xls/opencl/statistical/Gauss.xls|binary sc/qa/unit/data/xls/opencl/statistical/GeoMean.xls |binary sc/qa/unit/data/xls/opencl/statistical/HarMean.xls |binary sc/qa/unit/data/xls/opencl/statistical/Negbinomdist.xls |binary sc/qa/unit/data/xls/opencl/statistical/Pearson.xls |binary sc/qa/unit/data/xls/opencl/statistical/Rsq.xls |binary sc/qa/unit/opencl-test.cxx | 188 47 files changed, 97 insertions(+), 91 deletions(-) New commits: commit 5655b8ede2a5386b9d24d266ae08172a60b04618 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Wed Oct 30 09:12:09 2013 -0400 Lower-case directory names, and rename to just 'opencl'. Change-Id: I412298c73586c347d88f08bad0357a8142df3f63 diff --git a/sc/qa/unit/data/ods/OpenCLTests/Compiler/ineq.ods b/sc/qa/unit/data/ods/opencl/compiler/ineq.ods similarity index 100% rename from sc/qa/unit/data/ods/OpenCLTests/Compiler/ineq.ods rename to sc/qa/unit/data/ods/opencl/compiler/ineq.ods diff --git a/sc/qa/unit/data/ods/OpenCLTests/Compiler/nested.ods b/sc/qa/unit/data/ods/opencl/compiler/nested.ods similarity index 100% rename from sc/qa/unit/data/ods/OpenCLTests/Compiler/nested.ods rename to sc/qa/unit/data/ods/opencl/compiler/nested.ods diff --git a/sc/qa/unit/data/ods/OpenCLTests/Compiler/string.ods b/sc/qa/unit/data/ods/opencl/compiler/string.ods similarity index 100% rename from sc/qa/unit/data/ods/OpenCLTests/Compiler/string.ods rename to sc/qa/unit/data/ods/opencl/compiler/string.ods diff --git a/sc/qa/unit/data/ods/OpenCLTests/math/csc.ods b/sc/qa/unit/data/ods/opencl/math/csc.ods similarity index 100% rename from sc/qa/unit/data/ods/OpenCLTests/math/csc.ods rename to sc/qa/unit/data/ods/opencl/math/csc.ods diff --git a/sc/qa/unit/data/ods/OpenCLTests/statistical/Correl.ods b/sc/qa/unit/data/ods/opencl/statistical/Correl.ods similarity index 100% rename from sc/qa/unit/data/ods/OpenCLTests/statistical/Correl.ods rename to sc/qa/unit/data/ods/opencl/statistical/Correl.ods diff --git a/sc/qa/unit/data/xls/OpenclCase/financial/Accrintm.xls b/sc/qa/unit/data/xls/opencl/financial/Accrintm.xls similarity index 100% rename from sc/qa/unit/data/xls/OpenclCase/financial/Accrintm.xls rename to sc/qa/unit/data/xls/opencl/financial/Accrintm.xls diff --git
[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source
sc/qa/unit/subsequent_export-test.cxx | 183 -- sc/source/filter/xml/xmlcelli.cxx | 16 +- sc/source/filter/xml/xmlcelli.hxx |2 3 files changed, 183 insertions(+), 18 deletions(-) New commits: commit 969d5a3b97903fe32b3a7da0c3de8bf86f323c17 Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Mon Aug 26 15:28:46 2013 -0400 fdo#68581: The first paragraph text can be legitimately empty. Change-Id: I2309a0c6aebc8a111e67e2e3d591cbabfbbadfb4 diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 69f5a73..1f17009 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -600,10 +600,10 @@ void ScXMLTableRowCellContext::PushFormat(sal_Int32 nBegin, sal_Int32 nEnd, cons OUString ScXMLTableRowCellContext::GetFirstParagraph() const { -if (maFirstParagraph.isEmpty()) +if (!maFirstParagraph) return mpEditEngine-GetText(0); -return maFirstParagraph; +return *maFirstParagraph; } void ScXMLTableRowCellContext::PushParagraphFieldDate(const OUString rStyleName) @@ -635,12 +635,12 @@ void ScXMLTableRowCellContext::PushParagraphEnd() if (mbEditEngineHasText) { -if (!maFirstParagraph.isEmpty()) +if (maFirstParagraph) { // Flush the cached first paragraph first. mpEditEngine-Clear(); -mpEditEngine-SetText(maFirstParagraph); -maFirstParagraph = OUString(); +mpEditEngine-SetText(*maFirstParagraph); +maFirstParagraph.reset(); } mpEditEngine-InsertParagraph(mpEditEngine-GetParagraphCount(), maParagraph.makeStringAndClear()); } @@ -652,7 +652,7 @@ void ScXMLTableRowCellContext::PushParagraphEnd() } else if (mnCurParagraph == 0) { -maFirstParagraph = maParagraph.makeStringAndClear(); +maFirstParagraph.reset(maParagraph.makeStringAndClear()); mbEditEngineHasText = true; } @@ -1089,10 +1089,10 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress rCurrentPos, } else if (mbEditEngineHasText) { -if (!maFirstParagraph.isEmpty()) +if (maFirstParagraph) { // This is a normal text without format runs. -rDoc.setStringCell(rCurrentPos, maFirstParagraph); +rDoc.setStringCell(rCurrentPos, *maFirstParagraph); } else { diff --git a/sc/source/filter/xml/xmlcelli.hxx b/sc/source/filter/xml/xmlcelli.hxx index e49e3a3..15c95fb 100644 --- a/sc/source/filter/xml/xmlcelli.hxx +++ b/sc/source/filter/xml/xmlcelli.hxx @@ -63,9 +63,9 @@ class ScXMLTableRowCellContext : public ScXMLImportContext boost::optionalFormulaWithNamespace maFormula; /// table:formula attribute boost::optionalOUString maStringValue; /// office:string-value attribute boost::optionalOUString maContentValidationName; +boost::optionalOUString maFirstParagraph; /// unformatted first paragraph, for better performance. ScEditEngineDefaulter* mpEditEngine; -OUString maFirstParagraph; /// unformatted first paragraph, for better performance. OUStringBuffer maParagraph; sal_Int32 mnCurParagraph; commit 70e582c8cd3f5f0eedfead6c9da8c771db34e49b Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Mon Aug 26 15:11:33 2013 -0400 Add more test cases for rich text cell export to ODS. This currently fails due to a real bug. Change-Id: Ia8a91f0794837cae2b6c3beab656f3377f3d0f6a diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 6ec6550..b805e4f 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -36,6 +36,8 @@ #include editeng/postitem.hxx #include editeng/editdata.hxx #include editeng/eeitem.hxx +#include editeng/editobj.hxx +#include editeng/sectionattribute.hxx using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -343,10 +345,140 @@ void ScExportTest::testNamedRangeBugfdo62729() void ScExportTest::testRichTextExportODS() { +struct +{ +static bool isBold(const editeng::SectionAttribute rAttr) +{ +if (rAttr.maAttributes.empty()) +return false; + +std::vectorconst SfxPoolItem*::const_iterator it = rAttr.maAttributes.begin(), itEnd = rAttr.maAttributes.end(); +for (; it != itEnd; ++it) +{ +const SfxPoolItem* p = *it; +if (p-Which() != EE_CHAR_WEIGHT) +continue; + +return static_castconst SvxWeightItem*(p)-GetWeight() == WEIGHT_BOLD; +} +return false; +} + +static bool isItalic(const editeng::SectionAttribute rAttr) +{ +if (rAttr.maAttributes.empty()) +return false;
[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source
sc/qa/extras/macros-test.cxx |2 -- sc/qa/unit/ucalc_formula.cxx | 18 ++ sc/source/core/tool/token.cxx | 38 ++ 3 files changed, 52 insertions(+), 6 deletions(-) New commits: commit 3bade6b47973a228723b240b9410f15891487812 Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Wed Jul 31 21:10:50 2013 -0400 Fix reference update on range references in named expressions. This fixes the macro test failure. Change-Id: I8dd49d1faf36cc37212895c21023a4ab6135 diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index 9bc3a0f..023f627 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -198,12 +198,10 @@ void ScMacrosTest::testVba() OUString(Shapes.), OUString(vnd.sun.Star.script:VBAProject.testMacros.test?language=Basiclocation=document) }, -#if 0 // TODO : fix this { OUString(Ranges.), OUString(vnd.sun.Star.script:VBAProject.testMacros.test?language=Basiclocation=document) }, -#endif { OUString(CheckOptionToggleValue.), OUString(vnd.sun.Star.script:VBAProject.testMacros.test?language=Basiclocation=document) diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 83094d2..4703cde 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -2598,6 +2598,20 @@ bool adjustSingleRefInName( return bChanged; } +bool adjustDoubleRefInName( +ScComplexRefData rRef, const sc::RefUpdateContext rCxt, const ScAddress rPos ) +{ +bool bRefChanged = false; + +if (adjustSingleRefInName(rRef.Ref1, rCxt, rPos)) +bRefChanged = true; + +if (adjustSingleRefInName(rRef.Ref2, rCxt, rPos)) +bRefChanged = true; + +return bRefChanged; +} + } sc::RefUpdateResult ScTokenArray::AdjustReferenceInName( @@ -2623,10 +2637,26 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName( { ScToken* pToken = static_castScToken*(*p); ScComplexRefData rRef = pToken-GetDoubleRef(); -if (adjustSingleRefInName(rRef.Ref1, rCxt, rPos)) -aRes.mbReferenceModified = true; -if (adjustSingleRefInName(rRef.Ref2, rCxt, rPos)) -aRes.mbReferenceModified = true; +ScRange aAbs = rRef.toAbs(rPos); +if (rCxt.maRange.In(aAbs)) +{ +// This range is entirely within the shifted region. +if (adjustDoubleRefInName(rRef, rCxt, rPos)) +aRes.mbReferenceModified = true; +} +else if (rCxt.maRange.Intersects(aAbs)) +{ +if (rCxt.mnColDelta rCxt.maRange.aStart.Row() = aAbs.aStart.Row() aAbs.aEnd.Row() = rCxt.maRange.aEnd.Row()) +{ +if (adjustDoubleRefInName(rRef, rCxt, rPos)) +aRes.mbReferenceModified = true; +} +if (rCxt.mnRowDelta rCxt.maRange.aStart.Col() = aAbs.aStart.Col() aAbs.aEnd.Col() = rCxt.maRange.aEnd.Col()) +{ +if (adjustDoubleRefInName(rRef, rCxt, rPos)) +aRes.mbReferenceModified = true; +} +} } break; default: commit 10dfaebc6cc2191745d4d7323596bb8e22c9d029 Author: Kohei Yoshida kohei.yosh...@gmail.com Date: Wed Jul 31 19:19:41 2013 -0400 Add test on updating references in named range. This currently fails. Change-Id: Ibb2b9e4430c97479d068d94d233f04f60b255966 diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index f731f2a..e85c01c55 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -1064,6 +1064,24 @@ void Test::testFormulaRefUpdateNamedExpression() CPPUNIT_ASSERT_EQUAL(34.0, m_pDoc-GetValue(ScAddress(2,7,0))); #endif +// Clear all and start over. +clearRange(m_pDoc, ScRange(0,0,0,100,100,0)); +pGlobalNames-clear(); + +pName = new ScRangeData( +m_pDoc, MyRange, $B$1:$C$6, ScAddress(0,0,0), RT_NAME, formula::FormulaGrammar::GRAM_NATIVE); +bInserted = pGlobalNames-insert(pName); +CPPUNIT_ASSERT_MESSAGE(Failed to insert a new name., bInserted); +pName-GetSymbol(aExpr); +CPPUNIT_ASSERT_EQUAL(OUString($B$1:$C$6), aExpr); + +// Insert range of cells to shift right. The range partially overlaps the named range. +m_pDoc-InsertCol(ScRange(2,4,0,3,8,0)); + +// This should not alter the range. +pName-GetSymbol(aExpr); +CPPUNIT_ASSERT_EQUAL(OUString($B$1:$C$6), aExpr); + m_pDoc-DeleteTab(0); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org
[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source
sc/qa/unit/data/ods/fdo62729.ods |binary sc/qa/unit/subsequent_export-test.cxx | 30 ++ sc/source/filter/xml/xmlexprt.cxx |1 + 3 files changed, 31 insertions(+) New commits: commit 7b3d8e0a7dcf6ae05e1de5c33ed382822cf52cce Author: Noel Power noel.po...@suse.com Date: Fri Jul 26 13:13:37 2013 +0100 unit test for fdo#62729 Change-Id: Ib9be75459aa49b8bab968dedae9e0760ccef9a26 diff --git a/sc/qa/unit/data/ods/fdo62729.ods b/sc/qa/unit/data/ods/fdo62729.ods new file mode 100644 index 000..00b5079 Binary files /dev/null and b/sc/qa/unit/data/ods/fdo62729.ods differ diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index 05b0c35..600bc5a 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -49,6 +49,7 @@ public: void testDataBarExportODS(); void testDataBarExportXLSX(); void testMiscRowHeightExport(); +void testNamedRangeBugfdo62729(); CPPUNIT_TEST_SUITE(ScExportTest); CPPUNIT_TEST(test); @@ -60,6 +61,7 @@ public: CPPUNIT_TEST(testColorScaleExportODS); CPPUNIT_TEST(testColorScaleExportXLSX); CPPUNIT_TEST(testMiscRowHeightExport); +CPPUNIT_TEST(testNamedRangeBugfdo62729); CPPUNIT_TEST_SUITE_END(); private: @@ -289,6 +291,34 @@ void ScExportTest::testMiscRowHeightExport() miscRowHeightsTest( aTestValues, SAL_N_ELEMENTS(aTestValues) ); } + +void ScExportTest::testNamedRangeBugfdo62729() +{ +ScDocShellRef xShell = loadDoc(fdo62729., ODS); +CPPUNIT_ASSERT(xShell.Is()); +ScDocument* pDoc = xShell-GetDocument(); +CPPUNIT_ASSERT(pDoc); + +ScRangeName* pNames = pDoc-GetRangeName(); +//should be just a single named range +CPPUNIT_ASSERT(pNames-size() == 1 ); +pDoc-DeleteTab(0); +//should be still a single named range +CPPUNIT_ASSERT(pNames-size() == 1 ); +ScDocShellRef xDocSh = saveAndReload(xShell, ODS); +xShell-DoClose(); + +CPPUNIT_ASSERT(xDocSh.Is()); +pDoc = xDocSh-GetDocument(); +CPPUNIT_ASSERT(pDoc); + +pNames = pDoc-GetRangeName(); +//after reload should still have a named range +CPPUNIT_ASSERT(pNames-size() == 1 ); + +xDocSh-DoClose(); +} + ScExportTest::ScExportTest() : ScBootstrapFixture(/sc/qa/unit/data) { commit b5fffdb8d0438a2fe933a5742d41fe50a14b71f3 Author: Noel Power noel.po...@suse.com Date: Fri Jul 26 11:25:51 2013 +0100 fix for fdo#62729 reference pos can point to non existing table there is an existing function ( called at least from uno names api also ) that updates the tab pos, calling that seems to fix this problem Change-Id: I6f6f31895eda9c338eeabd3f3285bf2c9eb23b7e diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 1943238..23fd580 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3727,6 +3727,7 @@ void ScXMLExport::WriteNamedRange(ScRangeName* pRangeName) AddAttribute(sAttrName, it-second-GetName()); OUString sBaseCellAddress; +it-second-ValidateTabRefs(); ScRangeStringConverter::GetStringFromAddress( sBaseCellAddress, it-second-GetPos(), pDoc, FormulaGrammar::CONV_OOO, ' ', false, SCA_ABS_3D); AddAttribute(XML_NAMESPACE_TABLE, XML_BASE_CELL_ADDRESS, sBaseCellAddress); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits