summaryrefslogtreecommitdiff
path: root/include/formula
AgeCommit message (Collapse)Author
2021-02-18move async focus-in/focus-out workaround to known client that needs itCaolán McNamara
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/+/111152 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-25tdf#92456 improve VLOOKUP perfNoel Grandin
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 <noel.grandin@collabora.co.uk>
2021-01-14tdf#133858 reduce the double-ref range to data contentDennis Francis
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 <l.lunak@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit 65167a9265acfea04733b5ff6ee3220a9da624f4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109118 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
2020-12-02tdf#138427 focus set to wrong input boxCaolán McNamara
Change-Id: I4c1d3aa720f280f0ec1a3764d55f1d95ebd3180d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106999 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-02move the callbacks to be privateCaolán McNamara
Change-Id: I75a786d379ce1ea80acef90b9574d2901e046f3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106993 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-11-21tdf#123936 Formatting files in module include with clang-formatPhilipp Hofer
Change-Id: I0507dd797cd5a35e0ae14f4b69ee4e172d08a71a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105681 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Jenkins
2020-10-14Derive FormulaExternalToken from FormulaByteToken, tdf#133260 follow-upEike Rathke
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 <erack@redhat.com> Tested-by: Jenkins
2020-07-13tdf#42949 Fix IWYU warnings in include/[a-r]*/*hxxGabor Kelemen
Recheck after 7-0 branchoff Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I7f5c35474b671facbda85a9538462dd4291add91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97655 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-07formula: create instances with uno constructorsNoel Grandin
See tdf#74608 for motivation Change-Id: I5983c837977e40b91df02605c1012640ffd5c650 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98291 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-29Related: tdf#131423 CHOOSE() supports only 30 jump targets, limit in dialogEike Rathke
Change-Id: Ic3506ee6194ac4e74e572a10db96f100bc9e6ac2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95149 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2020-05-29improve pahole script and pack a few classesNoel Grandin
(*) fix: I was substracting the padding space instead of adding it when calculating how much free space we had to improve. (*) sort input data, so we process structs located in the same DSO together, which reduces GDB's memory usage (*) handle another error condition, where gdbs output is sufficiently mixed up that we miss the end of commands terminator Change-Id: Ic4bb92b736f38a2b3d90e4a14485152b7f869b43 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95041 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-03use more compact namespace syntax in /includeNoel Grandin
excluding the UDK headers of course Change-Id: Iac7ab83d60265f7d362c860776f1de9d5e444ec0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93268 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-28Resolves: tdf#127831 implement RAND.NV() and RANDBETWEEN.NV() non-volatileEike Rathke
Same as RAND() and RANDBETWEEN() but not recalculating on every change, just the normal expression recalculation. Change-Id: I8ba7099125e487a78bd3d91db8b666c2f36b22fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92994 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2020-04-23Related tdf#131169: avoid magic numbersJulien Nabet
Change-Id: Ic82f214f22933e3c74b8b0fc4c6a25b19f103fa1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92735 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2020-03-31Resolves: tdf#131372 Write "error cell" formula to OOXMLEike Rathke
Change-Id: Iedbe0912ff28e6203bec0104c59b1102cf97daf9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91382 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2020-03-12tdf#130976 replace `rtl::math::isInf` with `std::inf`.Yukio Siraichi
Change-Id: Id0f0e07b324230d2d69cbf4ab07b0fff5b24474d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90377 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-03-12tdf#130977 replace `rtl::math::isFinite` with `std::isfinite`.Yukio Siraichi
- make all calls look like `std::isfinite`. - change the comments referring `rtl::math::isFinite`. Change-Id: I0cde9ceb9f20150467b454cddde5e62003cfde1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90234 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-11-20loplugin:unusedmethodsNoel Grandin
Remove a filtering step in the python script that was hiding some results Change-Id: Id94268f150902405ab197c077f18aaedf98845fc Reviewed-on: https://gerrit.libreoffice.org/83256 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-19up/down in ArgEdit doesn't do anythingCaolán McNamara
but it should cycle through the arguments Change-Id: Ifa398039e77d536a0df021b1a18e06d6df673980 Reviewed-on: https://gerrit.libreoffice.org/83192 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2019-10-29loplugin:finalclasses filter..frameworkNoel Grandin
Change-Id: Ic4d0a2946c925035d60defc4d25caea05535adbc Reviewed-on: https://gerrit.libreoffice.org/81654 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-17Pre-allocate an ScInterpreter object for each thread...Dennis Francis
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 <l.lunak@collabora.com>
2019-09-04loplugin:constmethod in formulaNoel Grandin
Change-Id: Iae40405e7805b7c7ce3ce7f4b3653094fd49f396 Reviewed-on: https://gerrit.libreoffice.org/78564 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-02drop some unneeded includesCaolán McNamara
Change-Id: I13019ae1b991b5910c50e760a8a825bcf50509d2 Reviewed-on: https://gerrit.libreoffice.org/73321 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-13drop some more unneeded includesCaolán McNamara
Change-Id: Iec71ca870db5f6aaf317e23db369dfc1fa04bcc1 Reviewed-on: https://gerrit.libreoffice.org/72205 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-11remove unused RefEdit/RefButtonCaolán McNamara
and rename WeldRefEdit/WeldRefButton back Change-Id: I3aab8585d4ba1017cc755bf21e827522e7ee6980 Reviewed-on: https://gerrit.libreoffice.org/71957 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-09loplugin:unusedmethodsNoel Grandin
Change-Id: I7b4d2e5e611935284e2902b0089950768dfb7717 Reviewed-on: https://gerrit.libreoffice.org/72036 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-07weld FormulaDialogCaolán McNamara
drop xFocusWin hack, I don't see what gain it gives Change-Id: I31952b5440797e6209ed1de6b546f1e4c0238d08 Reviewed-on: https://gerrit.libreoffice.org/71675 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-06tdf#42949 Fix IWYU warnings in include/formula/Gabor Kelemen
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 <vmiklos@collabora.com>
2019-04-18weld ScOptSolverDlgCaolán McNamara
Change-Id: Ie2b43377f950cb16e143f6e9ef7081bf92277088 Reviewed-on: https://gerrit.libreoffice.org/70903 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-17weld ScTPValidationValue and ScValidationDlgCaolán McNamara
Change-Id: I74b1569fe378f42c1cc78ca8d9b758c6e585c979 Reviewed-on: https://gerrit.libreoffice.org/70845 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-16weld ScFilterDlgCaolán McNamara
Change-Id: I8bb8860d398af2ee9d6dd434c50f914e78b8021b Reviewed-on: https://gerrit.libreoffice.org/70801 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-12weld ScColRowNameRangesDlgCaolán McNamara
Change-Id: I976fb892f8ac1dedb0c2c3110dce17c1211de238 Reviewed-on: https://gerrit.libreoffice.org/70652 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-12weld ScPrintAreasDlgCaolán McNamara
Change-Id: I1e1d31551b623453a1bade9c932ef1c9e1060f35 Reviewed-on: https://gerrit.libreoffice.org/70600 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-11weld ScSimpleRefDlgCaolán McNamara
Change-Id: I36fe5a0790b2f7a43b9e4d8def9ef3a224d4d546 Reviewed-on: https://gerrit.libreoffice.org/70549 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-10weld ScCorrelationDialogCaolán McNamara
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 <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-09zugeordnetes->associatedCaolán McNamara
Change-Id: I4ba1a3c467526b85f576e5549e7c47a1e0fb66a0 Reviewed-on: https://gerrit.libreoffice.org/70456 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-27loplugin:unusedfields look for classes where we can make all the..Noel Grandin
fields private Change-Id: Id3c6b123f06ab5dcf87628de4c347626110d2d27 Reviewed-on: https://gerrit.libreoffice.org/68302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-19tdf#74664 : Adds FOURIER() formulaDennis Francis
FOURIER(Array, GroupedByColumns, Inverse, Polar) is a matrix formula that computes discrete Fourier transform[DFT] of input array(first argument) via a radix-2, decimation-in-time fast Fourier transform algorithm. Unit test for this is coming up in a new commit. The data in input array(first argument) can be :- 1) grouped by columns (needs to be indicated by flag GroupedByColumns = TRUE) In this case the array can contain 1 or 2 columns, where the first column contains the real part of input series and second column if present contains the imaginary part of the input series. If there is only 1 column, the input series is treated as purely real. If the number of rows is not a power of 2, zeroes are appended to the input series internally to make the series length equal to the next nearest power of 2. 2) grouped by rows (needs to be indicated by flag GroupedByColumns = FALSE) In this case the array can contain 1 or 2 rows, where the first row contains the real part of input series and second row if present contains the imaginary part of the input series. If there is only 1 row, the input series is treated as purely real. If the number of columns is not a power of 2, zeroes are appended to the input series internally to make the series length equal to the next nearest power of 2. The third argument "Inverse" is a boolean flag to indicate whether an inverse DFT needs to be computed. This argument is optional and the default value is FALSE. The fourth argument Polar is a boolean flag to indicate whether the final output needs to be in polar coordinates. This argument is optional and the default value is FALSE. The result of DFT consists of two columns - first column contains the real parts (or the magnitudes if Polar=TRUE) and second column contains the imaginary parts (or the phases if Polar=TRUE). Implementation: A fairly straighforward non-recursive implementation of radix-2 FFT algorithm is written from scratch. Reference: Heckbert, P., 1995. Fourier transforms and the fast Fourier transform (FFT) algorithm. Computer Graphics, 2, pp.15-463. The normalization factor used in DFT / and inverse DFT in this implementation matches that of fft() and ifft() functions of Matlab/Octave. It also matches the one used in Wikipedia article on DFT: https://en.wikipedia.org/wiki/Discrete_Fourier_transform. Change-Id: If4a40a6ef62bce1f03c589ae5357b2049f66fe64 Reviewed-on: https://gerrit.libreoffice.org/67938 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2019-01-16Related: tdf#122301 FREQUENCY() with ForceArrayReturn on callerEike Rathke
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 <erack@redhat.com> Tested-by: Jenkins
2018-12-05loplugin:unnecessaryparen include more assignmentsNoel Grandin
Change-Id: I9fb8366634b31230b732dd38a98f800075529714 Reviewed-on: https://gerrit.libreoffice.org/64510 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-23convert FormulaDlgMode to scoped enumNoel Grandin
and drop unused ARGS value Change-Id: I9b9d0c9ea64a2174759dcf6406bdf6cd5be5862a Reviewed-on: https://gerrit.libreoffice.org/63892 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-09Resolves: tdf#120895 new ParamClass::ReferenceOrRefArray, tdf#58874 relatedEike Rathke
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 <erack@redhat.com> Tested-by: Jenkins
2018-10-25Resolves: tdf#113977 implement REGEX() spreadsheet functionEike Rathke
REGEX( Text ; Expression [ ; Replacement ] ) Using ICU regular expressions http://userguide.icu-project.org/strings/regexp Change-Id: I4cb9b8ba77cfb5b8faab93037aa0d947609383d7 Reviewed-on: https://gerrit.libreoffice.org/62332 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-10-10add ScTokenArray::Finalize() to explicitly reduce memory usageLuboš Luňák
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 <l.lunak@collabora.com>
2018-09-28Remove unused ocIndirectXL and ocAddressXLEike Rathke
Separated implementation is gone since long. Change-Id: I78279f631c9205202af92ad8e248f9a1226b7a19 Reviewed-on: https://gerrit.libreoffice.org/61075 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-08-16remove mempoolNoel Grandin
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 <noel.grandin@collabora.co.uk>
2018-08-13loplugin:returnconstant in forms..fpickerNoel Grandin
Change-Id: I3f0bead636632682488cbe677fd7fee60350f04d Reviewed-on: https://gerrit.libreoffice.org/58876 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-31try to detect that a formula does not contain any implicit intersectionLuboš Luňák
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 <l.lunak@collabora.com>
2018-07-19Related: tdf#118735 introduce FormulaError::LinkFormulaNeedingCheck (Err:540)Eike Rathke
To indicate why the result isn't available ("External content disabled") and in future maybe signal to the formula cell that it could keep the hybrid string result, see source code comment. Change-Id: Ic5d336b8489e8776f7b640b7e46815e71d0a82a4 Reviewed-on: https://gerrit.libreoffice.org/57738 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-07-18loplugin:mergeclasses merge IFormulaToken into FormulaTokenNoel Grandin
Change-Id: I5dbf870ff27f1039e24f4350787cf5bfc5f4ccaf Reviewed-on: https://gerrit.libreoffice.org/57487 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>