Commit Graph

239 Commits

Author SHA1 Message Date
bf3dd18cf8 no need to allocate that vector on the heap
This seems to give about 10% performance improvements in some calc cell
calculations.

Change-Id: Ibd91558b3c107e4c8e1401345c9332f97645453e
2015-10-03 10:01:51 +02:00
f565867dfd TableRef: activate structured references export to OOXML
Change-Id: I737b0c28a9b337af62e1a33bbce15049a0d854a4
2015-09-01 15:41:58 +02:00
c42d216520 loplugin:stringconstant: OUStringBuffer: appendAscii -> append
Change-Id: I324dd37d063ea01fd15152caf2f7565ac4b6fb4e
2015-08-31 08:03:25 +02:00
fceee9237c loplugin: defaultparams
Change-Id: I4080aece6fec2778a2a8646ddedd280337303591
2015-08-14 11:09:40 +02:00
5b2f823194 add a SAL_RAND_REPEATABLE for repeatable random nums
merge the formula and comphelper ones together

Change-Id: I2e7e2cdb176afc6982e384fa1e007da5b914e6f0
2015-07-10 08:58:20 +01:00
ec97496525 Subformula evaluation in formula wizard tree
Change-Id: If4f6a608f261621e2e1ba40b36d71d39a137a453
2015-06-29 07:48:16 +02:00
80aafaf793 in OOXML save references of named expressions with col,row=0,0 base position
Saving relative references of named expressions to OOXML never worked,
upon reload they pointed to a different position offset by the value of
the original base position. This at least saves positive relative
references correctly, while generating #REF! for negative offsets which
is slightly better than having them point to a wrong location and
silently calculate different values..

Also, this is a prerequisite for TableRef ThisRow references in named
expressions to be saved correctly in A1 notation, which results in a
relative row 0 value.

Change-Id: I3734f910794ceab4b9224b214ad11c64d1d18e67
2015-06-23 13:19:25 +02:00
f243e27a37 TableRef: include ocTableRef in FormulaToken::IsRef() for HasReferences()
let FormulaTokenArray::HasReferences() also check RPN

Change-Id: Ic97332265c50485691f76b81d8396705d7728ab0
2015-06-21 21:53:07 +02:00
0980095619 Replace boost::scoped_array<T> with std::unique_ptr<T[]>
This may reduce some degree of dependency on boost.
Done by running a script like:

git grep -l '#include  *.boost/scoped_array.hpp.' \
 | xargs sed -i -e 's@#include  *.boost/scoped_array.hpp.@#include <memory>@'
git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \
 | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/'

... and then killing duplicate or unnecessary includes,
while changing manually
m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx,
extensions/source/ole/unoconversionutilities.hxx, and
extensions/source/ole/oleobjw.cxx.

Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd
Reviewed-on: https://gerrit.libreoffice.org/16289
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-17 15:50:45 +00:00
1d463600f4 prepare ReplaceToken() to replace also in RPN
Change-Id: I98fbcb9849f2c2b1f26109a54ecbf5347cdd8b4e
2015-06-15 17:52:16 +02:00
cb13c46da1 tdf#69552 [part 2] support all ODFF1.2 and Excel2013 variations
of CEILING and FLOOR

Change-Id: I9537d9bd8dbca2eac769e74e9d3d5b298b76f594
Reviewed-on: https://gerrit.libreoffice.org/16016
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2015-06-11 11:17:58 +00:00
b37fa7fc97 loplugin:cstylecast: deal with those that are (technically) const_cast
Change-Id: Iaefaeebcccade616329e4d8e29f3c4f53cb739c1
2015-06-02 11:26:38 +02:00
3aebc670e1 Remove include stdio (part2)
Change-Id: Iae58d107d8df1c543a165086fb2b7c288e7121dd
Reviewed-on: https://gerrit.libreoffice.org/15775
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2015-05-18 05:33:52 +00:00
f304a7a14a loplugin:staticmethods
Change-Id: I384a5e60f4b7b2f479c89ef97630519059ab720f
2015-05-05 09:30:39 +02:00
e80f1f1987 coverity#1296214 Dereference null return value
Change-Id: Ifc82f42ff8d82cfe094701ace57ff7cadabc59d9
2015-04-30 09:37:31 +01:00
010b2d2d9b fdo#69552 [part 1] make calc functions CEILING comply with ODF1.2
Also, add support for CEILING.MATH and fix small
deficiencies with CEILING functions, as most are interwoven.

Change-Id: I0d9a46fb17e982ccf1e9d9e403b58926172c1a7a
Reviewed-on: https://gerrit.libreoffice.org/7088
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2015-04-29 23:39:09 +00:00
13b9e62d66 TableRef: centralized FormulaCompiler::NeedsTableRefTransformation()
... and include OOXML until we actually write Table.

Change-Id: I95fa65bd593c72af409728cea1ec599481beaaab
2015-04-24 17:04:47 +02:00
97539f5eb1 TableRef: let t always point to the current token
Change-Id: Ic7f8dedd8967f1f1fc0025cb2bc3e6c3fda022fd
2015-04-23 15:18:00 +02:00
18cfc7c2d2 PeekNext() might be NULL
Change-Id: I2b63e99d25e00b0021986a89dce75f3f678ecb85
2015-04-23 15:17:59 +02:00
8c2173d95c TableRef: transform to reference if not supported, i.e. for ODFF
Change-Id: I64f751455fbba901bb41f91daaf64ee4878a19b4
2015-04-18 00:46:08 +02:00
6f25c21eb5 const all CreateString... FormulaToken*
Change-Id: I0e0f064357543e5dc86b178ce30ee005e5483e04
2015-04-18 00:46:08 +02:00
95f62a57ef ocTableRef is not in RPN
Change-Id: If91d6724a07a40c28c0ebe64e94fa3166138072b
2015-04-17 01:11:37 +02:00
216fdcbdb4 convert RECALCMODE_ constants to scoped enum
Change-Id: Ice2e45a3db59adc34a160b4b410cc51c750835f2
2015-04-08 09:07:08 +02:00
f1f4167bac tdf#40835 add ODFF function FDIST
and clean up F-Distribution function names.

Change-Id: I8666659269121b3ea32e8179b42e3497aa86754f
Reviewed-on: https://gerrit.libreoffice.org/14657
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2015-03-24 22:04:50 +00:00
c6312364b6 init and compare opcode hashmap with uppercase symbols
This is necessary now there are TableRef items like #All that need to be
matched case insensitive but displayed preserving the case as coded /
translated.

As a side effect, OOXML functions with _xlfn. prefix are now matched in
case that prefix was uppercase.

Change-Id: Ie14700d13c40c3e39e6d6aff560bcdfe23707196
2015-03-12 02:47:15 +01:00
40c9a46b78 add FormulaTokenArray::ReplaceToken()
Change-Id: I42c893677c1b8a35ee502a9ae438d4c0f19867d3
2015-03-07 00:24:45 +01:00
abbd86925d Add a few SAL_INFOs
Change-Id: I252987d6c5e5da56a83742c96b4e86abbb7108c6
2015-03-06 11:40:00 +02:00
c7a98ea861 translate comments while at it
Change-Id: I62cce7321dfe038d1723c73ba9deb0450a03f0e5
2015-03-05 22:04:13 +01:00
1b5a62e9da add ocTableRef to lcl_IsReference()
Change-Id: I63b41ea4619098390824f335859d62b4fa8fcc66
2015-03-05 22:04:12 +01:00
a1b956d03e error for css::sheet::FormulaToken with ocTableRef not implemented
Change-Id: I1d95b0168e880029e1fe319f025e586944f636ab
2015-03-05 11:44:59 +01:00
eaf5a24b1e add HandleTableRef()
Change-Id: I95e80bfa11177e1a52f3215d27448f4642091bad
2015-03-05 11:44:59 +01:00
40a3cec85f handle ocTableRef same as ocDBArea
Change-Id: Id64556850ef0d44db1ff4dedb41e0e1cb9735b76
2015-03-05 11:44:57 +01:00
8d78888a0c rename confusing HandleSingleRef() to more appropriate HandleColRowName()
Change-Id: Ib2e6d5cd9863ac1f9b0ba9b192f5d17d489ed19f
2015-03-05 11:44:52 +01:00
2f928b2d09 remove NUMBERFORMAT_ constants
.. in favour of just using the underlying constants from
css::util::NumberFormat

Change-Id: I0c6b128b66c91b268f5ae300f9c17c7792df5e99
2015-02-25 10:34:27 +02:00
fc4ba6d31a formula: include algorithm for std::min
Change-Id: I3237eb3b6ada8949cb489676e83e46cc3c92aa81
2015-02-17 16:51:39 +01:00
944886f6d9 fdo#87534 fix HYPERLINK behaviour when used in names
When using HYPERLINK() in names, the hyperlink was set to disabled
on copying token. After fix, behaviour is consistent.

Note: reducing the fix to 1 line does not work, a set hyperlink
is only to be copied when applicable.

Change-Id: I27ad24ed8912afa548f08d249ad51d18a792c275
Reviewed-on: https://gerrit.libreoffice.org/13920
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2015-02-12 19:04:48 +00:00
5d3f89c026 this FDIST has 3 parameters also in Excel, revert tdf#40835
The UI FDIST is LEGACY.FDIST in ODFF and is the same in Excel. Only the
"real" FDIST has 4 parameters, which is F.DIST in Excel.

Change-Id: I0b926b51a3cc7282a54cce448e46fed6be3c61fa
2015-02-09 20:59:23 +01:00
cead54b6e5 Use vector::data
...in some places where it is obvious that it does not hurt that for an empty
vector the obtained pointer is not necessarily a nullptr.

Change-Id: Id5d66b1559ca8b8955d379bcdbfae6986ef46a51
2015-01-28 17:56:18 +01:00
bff635be1d Make the RAND() and RANDBETWEEN() Calc functions non-random when requested
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-20 18:12:38 +02:00
e613c9fba4 fdo#85818: rename RGP to Linest
Change-Id: I4bdf934730a54a76f5762fd079dc6270fa135840
Reviewed-on: https://gerrit.libreoffice.org/13893
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2015-01-14 19:53:39 +00:00
be2e6ea58b fdo#85818: rename RKP to Logest
Change-Id: I35e4d80e3d7744c4c9c74b12856a603db8363dbc
Reviewed-on: https://gerrit.libreoffice.org/13892
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2015-01-14 19:53:18 +00:00
1f56cbf8cc sc: rename ocChose et al. to ocChoose et al.
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-14 19:52:07 +00:00
b08f87b62d fdo#85818: rename ZW to FV
Change-Id: I464cba72153ef70bbb14bf43a448a28d02095728
Reviewed-on: https://gerrit.libreoffice.org/13868
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2015-01-14 19:50:22 +00:00
92cef7eb34 fdo#85818: rename ZGZ to RRI
Change-Id: Ifeb513eba762f881dd4ea7cd7fc531fe5028106d
Reviewed-on: https://gerrit.libreoffice.org/13831
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-01-12 06:55:37 +00:00
c6d3405d9c fdo#85818: rename RMZ to PMT
Change-Id: I952d4cee42c9a6256589a32f4acb6a6fc70ef443
Reviewed-on: https://gerrit.libreoffice.org/13830
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-01-12 06:55:28 +00:00
294b1e93f4 fdo#85818: rename LIA to SLN
Change-Id: Ifbf9be5fae60a6460596b90ce87e9ace45b2098f
Reviewed-on: https://gerrit.libreoffice.org/13829
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-01-12 06:55:20 +00:00
fd66d3749e fdo#85818: rename GDA to DDB
Change-Id: Ic73225a34ca3339216c11bd72116e55d6a098257
Reviewed-on: https://gerrit.libreoffice.org/13827
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-01-12 06:53:54 +00:00
4a2fded150 fdo#85818: rename GDA2 to DB
Change-Id: I2449645b47918325474109fc090ef34b009f26a8
Reviewed-on: https://gerrit.libreoffice.org/13826
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-01-12 06:52:46 +00:00
b2fcd4f7c7 fdo#85818: rename DIA to SYD
Change-Id: I3510403521668c00f44d462b288716f5f7b60115
Reviewed-on: https://gerrit.libreoffice.org/13825
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-01-12 06:52:04 +00:00
8416ac2b53 fdo#85818: rename BW to PV
Change-Id: I3b319a4074c549daaa1d6befaca79dab93e61df6
Reviewed-on: https://gerrit.libreoffice.org/13824
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-01-12 06:51:35 +00:00