summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/interpr1.cxx
AgeCommit message (Collapse)AuthorFilesLines
2016-07-08tdf#100753 propagate error with VAR and STDEV functions.Winfried Donkers1-0/+9
Change-Id: I1b3ece177f5586f5cd64a34d16193d01d4bd5bd9 Reviewed-on: https://gerrit.libreoffice.org/26979 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit b9c9bf666b4eb7ee4568fe155a2c8b50a02c4ad5) Reviewed-on: https://gerrit.libreoffice.org/27061
2016-05-23Resolves: tdf#93101 handle external references and propagate errorEike Rathke1-6/+81
Cherry-picked 5 commits from master: tdf#93101 propagate external reference error from refcache token (cherry picked from commit 7de92ad48d8c4fe7a1f9fb24ef8afc7d8907788e) tdf#93101 correctly resolve svExternalSingleRef token in GetMatrix() ... including error propagation, and use GetNewMat() instead of a plain ScFullMatrix so the interpreter error handling is set up. (cherry picked from commit 2f94ff566f7827792175daedb92f12a7e61ad95d) tdf#93101 handle svExternalSingleRef in ISERROR() (cherry picked from commit 824cf015683383b553c744a746ac8e8ea65495cf) handle svExternalSingleRef in all IS*() functions, tdf#93101 related (cherry picked from commit f053086fbc625fca8ba7b956738d33ba78a80f9b) handle svExternalDoubleRef in all IS*() functions, tdf#93101 related (cherry picked from commit 365c4d8c60e89fd57a91f51ca51a8796fe91edd7) 862c46f9afc2afd0bb2a23aa767158e0945583a5 9e2a4aeb16d6777153d2f47a1c1af68fe2e97780 14181dd2dbb5d412e3dd165dcbf7468cb8ea8b21 48813de703ea926b8828f4e262393f7643216989 Change-Id: I90491a7b18fddaddb3bbb4d7a3f8b9555b9b1198 Reviewed-on: https://gerrit.libreoffice.org/25207 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-05-20handle svExternalDoubleRef just the same as svMatrix in MATCHEike Rathke1-4/+0
Change-Id: Ibd2b6fcc2be85948a7e228494e4e388e79c1e9ab (cherry picked from commit 9512dd16c92231514b9a5df3891517861a882d73) Reviewed-on: https://gerrit.libreoffice.org/25220 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-05-20always use GetNewMat() in interpreter context instead of plain ScFullMatrix()Eike Rathke1-3/+3
... so error handling interpreter is set and im-/mutable flagged correctly. Change-Id: I3e2647b6e4a4f4bcfdf7264d6942844941ea6c6b (cherry picked from commit 981ff6dfd8627981462ec7c10a8a74d636d3d0d5) Reviewed-on: https://gerrit.libreoffice.org/25213 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Jenkins <ci@libreoffice.org>
2015-11-24sc: Introduce Abstract Base Class for ScMatrix, for a future rework.Jan Holesovsky1-3/+3
We want to introduce another type of ScMatrix that will directly contain DoubleVectorRefToken and operate on that. The idea is that it is pointless to construct a ScMatrix via lots of copying around, when we already have a nice array of doubles. Change-Id: I3e5d7b9e2e0f9b9bf350336a8582cfd852586b3f
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann1-29/+29
Change-Id: I765d2a600f9c57da50c85354688e3ae796750d94
2015-11-06loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)Stephan Bergmann1-2/+2
Change-Id: Ief66447f04245b8ab0a4acbf097eb7283529d45d
2015-11-02trash usage of ScRefCellValue default ctor followed by assign()Eike Rathke1-72/+36
... that only results in a performance penalty. Change-Id: Ia161ab7fb03f2d32cf966ce9da9d0319d919fc4c
2015-10-21Resolves: tdf#95226 fix broken IFERROR/IFNA array logicEike Rathke1-2/+3
Change-Id: I059248659f51746cfc1d06faeaadaf3d645c03d3
2015-10-20loplugin:defaultparamsStephan Bergmann1-1/+1
Change-Id: If189c1e4254ae00725ec76a5ca6354d24df2d351
2015-10-14Improve performance by using the ScCalcOptions for OpenCL.Michael Meeks1-1/+1
Use the new configurationlistener to track the relevant setting. Change-Id: I9decea55df25f7eb34cd2fef94743d1907360d16 Reviewed-on: https://gerrit.libreoffice.org/19377 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2015-10-09crashtesting: ooo95537-1.xls fails with a fAnz that is nanCaolán McNamara1-5/+5
so it happily passes the pre-cast string bounds check and blows up in the post-cast string access Change-Id: Ifd4d087b37e8a84d886e2f7833dfc773b8bf1343
2015-10-01tdf#93688: Set CalcA1|ExcelA1 syntax only for imported docsKatarina Behrens1-4/+3
those whose string ref syntax is unknown or can't be guessed i.e. don't use it for new documents (prefer user settings in that case) Change-Id: I1355031cdd63e2a5c50064531011be71ae7f7b8f Reviewed-on: https://gerrit.libreoffice.org/18923 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2015-09-29Renamed wrongly prefixed boolean variablesStefan Heinemann1-87/+87
Fixed tdf#94269 Change-Id: I63109cc4e095bad680d7637a065080ea368860ae Reviewed-on: https://gerrit.libreoffice.org/18851 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-09-28Return the std::unique_ptr itself here, not a raw pointerStephan Bergmann1-2/+2
Change-Id: I353d6ceb74347f09dad77116b52771dd5aa21dab
2015-09-21convert SC_LINK constants to scoped enumNoel Grandin1-1/+1
Change-Id: I20470070740fcc39bce85f90ff4e8c14cdd86862 Reviewed-on: https://gerrit.libreoffice.org/18731 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-09-18boost->stdCaolán McNamara1-1/+1
Change-Id: I7f3bb094f116103c1146a7d60e3af94c0b37d9ea Reviewed-on: https://gerrit.libreoffice.org/18677 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-17revert for mac and win unit case crashes after boost->stdCaolán McNamara1-1/+1
Change-Id: I82c7084f203a834c2d42f9527705288e6036019b
2015-09-17boost->stdCaolán McNamara1-1/+1
Change-Id: I1e6a7fd66f90e6acd803c6cd464f1d73252f7bcb
2015-08-31loplugin:stringconstant: OUStringBuffer: appendAscii -> appendStephan Bergmann1-2/+2
Change-Id: I4e350a0c6045d07677edae4f9921db0a42b4e0f5
2015-08-22tdf#39440 reduce scope of local variablesMichael Weghorn1-1/+2
This addresses some cppcheck warnings. Change-Id: Ie492fb9c106b37c3fe7b0105236ad6315f4f159e Reviewed-on: https://gerrit.libreoffice.org/17921 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2015-08-14loplugin: defaultparamsNoel Grandin1-5/+3
Change-Id: I0d4b901b6678f3344ed62018d871e1630195aef0
2015-07-24enable FORMULA() to be used in array contextEike Rathke1-0/+49
So {=FORMULA(B1:B3)} works instead of giving an array of #N/A. Change-Id: I044a7032b3f79987ab70c03d25baee26f05063f8
2015-07-24tdf#92256: Handle case when string ref syntax is unknownKatarina Behrens1-1/+6
i.e. the document doesn't have that property. Use CONV_A1_XL_A1 pseudoconvention for interpreting INDIRECT in such case Change-Id: If9bac9053029b4b8f79d3ac7ac0759adbb25803f Reviewed-on: https://gerrit.libreoffice.org/17311 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2015-07-21tdf#92256: Introducing CONV_A1_XL_A1 address pseudoconventionKatarina Behrens1-3/+11
a special case for INDIRECT function interpretation. Does what OOo used to do, interprets formula using CONV_OOO first, failing that, tries CONV_XL_A1 Change-Id: I4281ab2bb7164607206c0b8e51f7e63a1fc2db9a Reviewed-on: https://gerrit.libreoffice.org/17255 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2015-07-20Resolves: tdf#58838 do not use collation for Equal/NotEqual operatorsEike Rathke1-10/+10
Unicode collation ignores control characters and other specific characters, see http://www.unicode.org/charts/collation/chart_Ignored.html and thus is not suitable to be used for Equal/NotEqual operators. Change-Id: Ib84713e1da59d92e07bc974d93b6def8217bb067
2015-07-10add a SAL_RAND_REPEATABLE for repeatable random numsCaolán McNamara1-2/+1
merge the formula and comphelper ones together Change-Id: I2e7e2cdb176afc6982e384fa1e007da5b914e6f0
2015-06-29Resolves: tdf#31577 volatile lookup ranges must not be cachedEike Rathke1-1/+7
Change-Id: Iac8574329c8c8e0bc0ac956993ccdd085372a6cc
2015-06-29support plain database range (table) names in INDIRECTEike Rathke1-1/+34
Change-Id: I89c1249315059d6a04615de27e8b9b18dfd300ff
2015-06-29TableRef: can be used in INDIRECTEike Rathke1-0/+47
Change-Id: I8eed87f0e6c0816a7d315f6c5ed039b0b193c322
2015-06-18Resolves: tdf#83365 push proper references in INDIRECTEike Rathke1-3/+2
... that take relative/absolute addressing and sheet 3D flag into account to be fed to reference extension via range operator. Change-Id: Iabe13ae384577e2d71ca87af6482ddccbf7ad0ac
2015-04-13string access out of boundsEike Rathke1-9/+14
Another UniString to OUString conversion fallout. Change-Id: I5e62b049da3e7f8b5a892ea6aae7110a33564a46
2015-04-02use error value instead of string in array/matrix, tdf#89387 tdf#42481 relatedEike Rathke1-4/+2
Hopefully tdf#90391 will be solved, else we'll have to revert all MatOp work and do this change on the previous code. Change-Id: I4789ccf389558f3687d90c600a4f1a27c24a20d9
2015-04-01Resolves: tdf#88672 add missing return if error to not crashEike Rathke1-0/+1
Change-Id: Iae73c46d6ae5b141c3f5680b2623ee06205c22d2
2015-03-31use error value instead of string in array/matrix, tdf#42481 relatedEike Rathke1-1/+1
Change-Id: Ib97509609bd3e6629e3efd0c633535564f1c64d6
2015-03-31Resolves: tdf#35636 implement match on empty cellsEike Rathke1-15/+3
This implements search criteria "" and "=" to match empty cells in spreadsheet functions SUMIF, AVERAGEIF, COUNTIF, SUMIFS, AVERAGEIFS and COUNTIFS. Change-Id: I1b4a4c14bac7b974428bf64afb549707a0d75a90
2015-03-09tdf#89387 General functor and basic operationsŁukasz Hryniuk1-22/+4
Add a functor MatOp and ScMatrix methods for scalar-matrix operations, both unary and binary. It can be used for operations which modify each element for the matrix (in constrast to accumulating ones, like ScGCD or ScAmpersand). Split method for addition and substraction into two methods for consistency and simplicity. Change-Id: Ic040233429ee120ac325d7baf31a70bba232041d Reviewed-on: https://gerrit.libreoffice.org/14749 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2015-03-05rename ScInterpreter::ScTable/s() to ScSheet/s() to follow ocSheet/sEike Rathke1-2/+2
Change-Id: Ia0db62b27577c64d3d6f6603f2e2c72b56cf1a81
2015-02-25remove NUMBERFORMAT_ constantsNoel Grandin1-36/+36
.. in favour of just using the underlying constants from css::util::NumberFormat Change-Id: I0c6b128b66c91b268f5ae300f9c17c7792df5e99
2015-02-11tdf#88576 check that two parameters are given for IFERROR() and IFNA()Eike Rathke1-2/+4
Otherwise the functions failed only for the error case resulting in #NULL! error. Change-Id: Ieb987637698ab418fc0a60cd873e23878c9f497b
2015-02-04coverity#1266450 Explicit null dereferencedCaolán McNamara1-4/+7
Change-Id: Ie675dc47d6008aa3ce947f8969895f32eb20b8c4
2015-01-26coverity#1266450 Explicit null dereferencedCaolán McNamara1-0/+5
Change-Id: Ia9a2ef623eeeed1d31bf62a18086b540dc394810
2015-01-20Make the RAND() and RANDBETWEEN() Calc functions non-random when requestedTor Lillqvist1-1/+2
We don't want such a mode to affect other uses of randomness, though. Thus use a separate random number generator object for these two functions, and use a fixed seed for it if the SC_RAND_REPEATABLE environment variable is set. As RAND() is implemented in sc, and RANDBETWEEN() is implemented in scaddins, it was a bit hard to figure out where to add the new functions needed, without having to over-engineer things with UNO. (This functionality is totally Calc-specific, but neither sc nor scaddins has any public (non-UNO) API.) Caolan suggested the formula module, which seems like a good enough place to me. Change-Id: I4b0cb327392e51a18bce28478af91b0174d6b726
2015-01-14sc: rename ocChose et al. to ocChoose et al.Laurent Charrière1-1/+1
Change-Id: I1aa8ee6c827a6d6a6c6beb190bdc9c3c91d82b22 Reviewed-on: https://gerrit.libreoffice.org/13889 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2015-01-14sc: rename ocPropper et al. to ocProper et al.Laurent Charrière1-1/+1
Change-Id: I245ad8f7418bed707953ecf80c71de07e0cc00d1 Reviewed-on: https://gerrit.libreoffice.org/13888 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2015-01-14add ODF1.2 function ERROR.TYPE to CalcWinfried Donkers1-2/+64
Also, improve exchange between Calc and Excel2013. Change-Id: I491f9e2100a9a2c38e23cf55dd1eda4b5e96db96 Reviewed-on: https://gerrit.libreoffice.org/13101 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2015-01-14fdo#39468 Translate German Comments - replace '//!' with '//TODO:'Christian M. Heller1-3/+3
It seems that most comments starting with '//!' were intended as FIXMEs. This replaces gerrit 12241. Conflicts: sc/source/core/tool/token.cxx sc/source/filter/excel/xlpivot.cxx Change-Id: I6ed06b32c70cc854a896dbbc386565e6fbfa9b28 Reviewed-on: https://gerrit.libreoffice.org/12361 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-12-22fdo#85258 differentiate between empty cell and empty result in matrixEike Rathke1-2/+2
Change-Id: I79259224e411f9c1a6e852623d9d49cf89a03c27
2014-12-22comment on COUNTBLANK() why we do what we doEike Rathke1-3/+11
Change-Id: I67c00ad672d7509b52fd50e4b5b3e18e72dc22c2
2014-12-15sc: Use appropriate OUString functions on string constantsStephan Bergmann1-14/+14
Change-Id: Ib4c0df8d7637bff7d7a45d24482fff4342169fae