summaryrefslogtreecommitdiff
path: root/formula
AgeCommit message (Collapse)AuthorFilesLines
2016-04-30Fix typosAndrea Gelmini1-1/+1
Change-Id: Id81b16ff26283611f0b84929d831c827f847ab73 Reviewed-on: https://gerrit.libreoffice.org/24317 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2016-04-28tdf#97087 Give comprehensible, unique names to idlesMuhammet Kara1-0/+2
Timers and idles should have programmer comprehensible, unique names Change-Id: Id0f2c0a77cd28c3ec5473e8432569739b58d2101 Reviewed-on: https://gerrit.libreoffice.org/24388 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
2016-04-27clang-tidy modernize-loop-convert in f*Noel Grandin1-3/+3
Change-Id: Id866aa244378758e3bdb9e99d02cdd2ae6104e16
2016-04-26tdf#97831 [part] Add Excel 2016-Office 365 functions to CalcWinfried Donkers1-0/+14
Functions CONCAT and TEXTJOIN. Change-Id: I38092f77df719d11f6746ac10fe14dc53b7e93e7 Reviewed-on: https://gerrit.libreoffice.org/23601 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-04-26update loplugin stylepolice to check local pointers varsNoel Grandin1-2/+2
are actually pointer vars. Also convert from regex to normal code, so we can enable this plugin all the time. Change-Id: Ie36a25ecba61c18f99c77c77646d6459a443cbd1 Reviewed-on: https://gerrit.libreoffice.org/24391 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-24first range can be anywhere before second at RPN end, tdf#96426 follow-upEike Rathke1-1/+11
... not just adjacent to the one at the end. So we actually can handle INDIRECT("A2:C2") INDIRECT("B1:B3") Change-Id: Ie8030ebc13bb1ae2246611f5722da97970b8c544
2016-04-23more differentiated significant whitespace recognition, tdf#96426 follow-upEike Rathke1-7/+30
Change-Id: I081409a82a9ff64f163115bf4597afbb9b2f5fa6
2016-04-23narrow down where a space could be an intersection, tdf#96426 follow-upEike Rathke1-73/+72
Change-Id: Ic53a4a0d19a11298895efb28e2786e48a071e72b
2016-04-23fully check for adjacent RPN end, tdf#96426 follow-upEike Rathke1-5/+13
Change-Id: I886e559c6f6041bf4889fdd6d89c12a10be70e5f
2016-04-23use FormulaToken::DeleteIfZeroRef() instead of Delete() at some placesEike Rathke1-2/+2
The array overflow detecting places that unconditionally deleted the token in case of overflow should do so only if no reference is held, i.e. the token was allocated with new and passed immediately without being assigned to a FormulaTokenRef. Just to be on the safe side. Change-Id: If2ccabec3725ac73fe82c23f51a291246847cfdb
2016-04-23Resolves: tdf#96426 significant whitespace as intersection in Excel syntaxEike Rathke2-4/+124
Also when reading/writing OOXML, so change SC_OPCODE_INTERSECT of RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML accordingly to " ", where previously "!" was expected and written, which was plain wrong. Change-Id: Ic0cfd7afc657f07bfd8e37de61b3621cc68685ff
2016-04-23simplify the ReplaceToken() offset logic to absolute offsetsEike Rathke1-4/+1
Change-Id: I8d02fb63bc0c5cb48aabaf7a8800f5f9ac95cbf5
2016-04-23newline shortageEike Rathke1-0/+1
Change-Id: Id2487480270bb2be765495bb6d5982c85ae2117f
2016-04-23change multiple ifs to switch caseEike Rathke1-17/+19
... obtaining mpToken->GetOpCode() only once. Change-Id: I909fef97540998a7f09115738fb76a1e963480bf
2016-04-23join two lines that cause an annoying debugger step over experienceEike Rathke1-4/+2
Change-Id: I50bf6710f7319f5c2ea18d8a3aa02f5c613de063
2016-04-18clang-tidy performance-unnecessary-copy-initializationNoel Grandin2-5/+2
probably not much performance benefit, but it sure is good at identifying leftover intermediate variables from previous refactorings. Change-Id: I3ce16fe496ac2733c1cb0a35f74c0fc9193cc657 Reviewed-on: https://gerrit.libreoffice.org/24026 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-04-12Avoid reserved identifierStephan Bergmann1-3/+3
Change-Id: Ie86787cdcf96453c94e6859e66b158d9188f3491
2016-04-11clang-tidy performance-unnecessary-value-param in formulaNoel Grandin1-5/+5
Change-Id: I9f90c55f74216c2f3452e5b30d85b304668330b3
2016-04-04get rid of a TODO commentWinfried Donkers1-1/+1
Checked if the < is correct. It is. Calc function Choose has 1 index argument plus up to 30 value-arguments, so the maximum argument count is 31. FORMULA_MAXJUMPCOUNT is 32. Change-Id: I0bc8cc122902848dadfc92d56b6f06fbec43e4be Reviewed-on: https://gerrit.libreoffice.org/23794 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-03-31use SAL_N_ELEMENTS more widelyNoel Grandin1-4/+4
found using git grep -n 'sizeof.*/.*sizeof.*[0]' Change-Id: Icd4a6cc1ca8ec8ebd68e1701a02789c74cf0eb2a
2016-03-23missing nullptr check, tdf#98427Markus Mohrhard1-1/+1
Change-Id: I657dc0c84eab6ff5b31976fac3317adc0a99dd51
2016-03-18Resolves: tdf#96915 implement other-sheet-local named expressionsEike Rathke1-8/+8
Change-Id: I0d62536caa6eb455473a755067abc585662cd9a5
2016-03-18loplugin:constantparam in formulaNoel Grandin2-17/+10
Change-Id: I3adeed435b62ae60b5d0d4b763dceced5675cd85 Reviewed-on: https://gerrit.libreoffice.org/23330 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-14prefix domain namespace to FORECAST.* functions for ODFF, tdf#94635 follow-upEike Rathke1-8/+8
Change-Id: If875b538f2143eb572371dfcc086145c2f6e80f5
2016-03-10loplugin:constantparam in formulaNoel Grandin3-10/+10
Change-Id: I18246d34d27f1b12dfd107166b31ef16d9632462
2016-03-03tdf#94635 Add FORECAST.ETS functions to CalcWinfried Donkers1-0/+56
Change-Id: Ifbfff1c27fb3960a06f467630da0fa39665f0ce4 Reviewed-on: https://gerrit.libreoffice.org/20073 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-03-03loplugin:unuseddefaultparams in formulaNoel Grandin1-3/+2
Change-Id: I7f0baa2709db24e8299f0e1c19c0703aee1cbf4f
2016-02-23new loplugin: commaoperatorNoel Grandin2-2/+6
Change-Id: I03f24e61f696b7619855e3c7010aa0d874e5a4ff
2016-02-18tdf#43157 Cleanup DBG_ASSERT for formula module.aybuke2-2/+5
Change-Id: I1be9332b4408b3c28aacfa872d63fce67adcb1fe Reviewed-on: https://gerrit.libreoffice.org/21958 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-02-09Remove excess newlinesChris Sherlock9-22/+0
A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-04vcl: take into account the font width is the average font widthChris Sherlock1-2/+2
I'm changing the Font class function names: - SetSize -> SetFontSize - GetSize -> GetFontSize - SetHeight -> SetFontHeight - GetHeight -> GetFontHeight - SetWidth -> SetAverageFontWidth - GetWidth -> GetAverageFontWidth That's because it really makes no sense to say that there is a single constant font width because obviously proportional fonts don't have one - the best we can do is an average font width, which is what folks like Microsoft sort of do already. On a fixed font, the average is still accurate, for obvious reasons :-) I'm also not a fan of GetSize/SetSize as I find it a might too generic. Change-Id: Ib80a604ba62d6883fd6cbc7994da763976be5c70 Reviewed-on: https://gerrit.libreoffice.org/22069 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-20loplugin:unusedmethodsNoel Grandin1-54/+0
Change-Id: Ib2dc804f55d1a96ae01f2cf31b7d55956040a72e Reviewed-on: https://gerrit.libreoffice.org/21603 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-12loplugin:unusedmethods unused return value in include/formulaNoel Grandin2-8/+5
Change-Id: Ic5d6c11d955ef5ef53dea0bb4e5bec8167874a91
2016-01-10Fix typosAndrea Gelmini2-2/+2
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86 Reviewed-on: https://gerrit.libreoffice.org/21209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-09Function Wizard: exclude functions with hidden flag from listsEike Rathke1-2/+3
Change-Id: Ia209bb44cef5969e5c9cd360aa5725708d6bdec5
2016-01-09Function Wizard: don't overwrite an unlisted functionEike Rathke2-4/+18
* in a spreadsheet cell enter =LOG(foobar(SIN(1))) * invoke Function Wizard on that cell (Ctrl+F2) LOG(foobar(SIN(1))) is marked in Formula edit field * activate Functions page LOG(foobar(SIN(1))) is marked in Formula edit field Function LOG is selected * click Next button foobar(SIN(1)) is marked in Formula edit field Function ABS is selected * click Next button foobar(SIN(1)) is overwritten with ABS( ) * only Cancel solves the problem foobar() could be any user defined or macro function that have no function description in the Formula Wizard. Change-Id: I1cb69a9e38c0b8f251d783bd0f67b4b24ade50d0
2016-01-09prepare for hidden flag in function description for Function WizardEike Rathke1-0/+1
Change-Id: Ic018ea5b962a66b6543e57d9cc1d44711e51de6e
2016-01-07tdf#96198 postpone conversion from WEEKNUM to ISOWEEKNUM, tdf#50950 follow-upEike Rathke1-0/+11
Have two releases be able to read ISOWEEKNUM first. Change-Id: I7ea8141043d18076a65396374dec40a806c8ab6a
2016-01-05use new'ed FormulaToken and FormulaTokenArray::Add()Eike Rathke1-4/+4
... instead of a temporary instance and AddToken() that just clones it again. Add function comment describing the difference. Change-Id: I3f089965d394b33d7bbbb9a1c3f69dc1c4182fd2
2016-01-05for new'ed FormulaToken use FormulaTokenArray::Add()Eike Rathke1-2/+2
... instead of AddToken() that just clones it again. Change-Id: I99b02b0924d0a0c070435501f8ecd45f030e9c2c
2016-01-05tdf#96198 add WEEKNUM_OOO compatibility function, tdf#50950 follow-upEike Rathke3-6/+30
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
2016-01-05formula: add missing algorithm include for std::min.Michael Meeks1-0/+1
Change-Id: Ica344a8f1351826e53c109ef49f80e4b022a0364
2016-01-05tdf#96198 detect old ISO/WEEKNUM usage with two arguments, tdf#50950 follow-upEike Rathke2-1/+82
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
2015-12-18Formula Wizard: evaluating expressions always in matrix context is wrongEike Rathke1-12/+20
Change-Id: I276f7bbf2bd6fa7c67d8691634ad9d79e4a08b1c
2015-12-18Resolves: tdf#96366 replace Edit...() calls with actually working codeEike Rathke1-17/+38
... and way less overhead, geez.. Change-Id: Id9277301fbe69bc9a83ca39a907032b0b86b1c81
2015-12-18tdf#96366 disable treeview results until fix availableEike Rathke1-0/+3
Since f82d89f35207fc1cfc00ad5cd914b74c55c3e3d2 EditThisFunc() and EditNextFunc() are used to iterate through the formula to obtain expression results to display in the treeview. Calling the Edit...() functions spoils about everything as it messes around with the edit state. As the name suggests.. Change-Id: I8b35d85b7bbf8821b5a995e84f9dd88a0f6f00b9
2015-12-18Function Wizard shoots itself in the footEike Rathke2-3/+21
Currently the Function Wizard is broken in that editing a function call as argument within another function's parameter leads to selections being reset and mismatching argument/function information being evaluated. Not sure yet what's going on there, but at least don't access vectors out-of-bounds or crash. Change-Id: I633c775556a0b90278d22d0f74d2975c20a08a5d
2015-12-17out-of-bounds arg mapping access, this was always wrong but never hit it seemsEike Rathke1-1/+1
Change-Id: I15843b320ac8ddcefce8094da7aa7c6b81b42e4f
2015-12-17handle varargs with first required and subsequent optional, tdf#71459 relatedEike Rathke2-8/+13
Change-Id: I56c66f516ba2a2e12cab4848c8c352315f27b3bb
2015-12-17add RAWSUBTRACT spreadsheet function, tdf#71459Eike Rathke1-0/+7
Change-Id: I2ae13771c85044b771e253a8189a30cb4aecb30f