summaryrefslogtreecommitdiff
path: root/sw/inc/calc.hxx
AgeCommit message (Collapse)Author
2024-10-25tdf#143148 Use #pragma once instead of include guardsJaxkDev
Few more files converted to #pragma once convention, plenty more in sw/inc (~150) Change-Id: I5f5a2604f0fe879a6318e5d174653057a53f9af2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175511 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2024-05-04replace createFromAscii with OUString literals in SwCalcNoel Grandin
Change-Id: I9da38ff8897eeeebdb7d5ff2766414d3d406d53f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167091 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-25Convert SwHashTable to std::unordered_mapNoel Grandin
Change-Id: I88b082dc61c05761fd162ea4cf1d30940c2dfccd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159941 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-02Resolves: tdf#154218 Use the proper document's SwCalc locale for formula fieldEike Rathke
... instead of the format's locale to generate the expanded value string to be reinterpreted again. i.e. inherited by SwSetExpField used with Set variable. Change-Id: I0bb545282a50032f2d8d2965020a36e3c5c8914e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149911 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-10-11use more string_view in swNoel Grandin
Change-Id: Ibefb8549834ba5011286e3221f1ae276e2c0c0bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141153 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-28sal_uLong->sal_uInt32 in SwHashTableNoel Grandin
Also (*) increase the number of items this table supports from SAL_MAX_UINT16 to SAL_MAX_UINT32 (*) add some asserts to document and verify the above limit Change-Id: I53f83303af04a9ac4f3786b221e338a7684fa1ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140700 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-18cid#1485150 Uncaught exceptionCaolán McNamara
Change-Id: I793683bfb59ff6b8751baa14a999b699cc28fdc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138467 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-04clang-tidy modernize-pass-by-value in swNoel Grandin
Change-Id: Ie5c250c64f95e649d33d3f3da7b54e81a4b81d0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137781 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-22tdf#123381: sw: add table formula INTXisco Fauli
for DOCX interoperability. Change-Id: I4e63e213ef0a6f3a775bdf3bedfb7aca8853b479 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133091 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-04-16use more string_view in swNoel Grandin
Change-Id: Iaf4db41d913dde13ea1ceb3fbbb3dafc21f90d24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133098 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-17speedup toUpperCase when called in parallelNoel Grandin
by removing locking from CharClass, which means we need to make it an immutable class Since SharedStringPool in sc/ stores a pointer to the CharClass in use, we have to tweak SvtSysLocale so that the object does not change location. Change-Id: I2c62d354fa542ebc04e755ce5b9b9e2ddff76a64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122185 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-21sw: replace most static_cast<sal_uInt16>() calls with o3tl::narrowing()Miklos Vajna
o3tl::narrowing() is a better way to handle this, as that way the integer conversion is still implicit, which allows detecting integer truncation at runtime (with suitable compiler flags). Change-Id: I499abda3be6943e8c111c56df390e72939586221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115948 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-05-18loplugin:unusedfieldsNoel Grandin
Change-Id: Ib574403a7f7f8b11c6263c9c19ec6b65c8374ddd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115753 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-02tdf#79049 speed up OOXML workbook load (4)Noel Grandin
Optimise LocaleDataWrapper for reads by initialising the data we in the constructor, so we don't need any kind of locking Reduces load time from 34s to 28s. Change-Id: I4bd3bddb30b70ba015fe5b1372534f9507762b74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114960 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-20use tools::Long in swNoel
Change-Id: I44be72b3a9b14823ec37a3c799cffb4fb4d6e1de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-04tdf#136404 DOCX import: ignore NaN cells in table formulaLászló Németh
Ignore empty cells or cells with text content in data range of AVERAGE, COUNT and PRODUCT (the new interoperability functions in Writer), like MSO does, instead of using NaN data as zeroes here. Add AVERAGE, as a new function instead of alias of MEAN to return error message instead of zero for NaN-only arguments, like Calc does (Note: also MSO gives empty result instead of zero). Change-Id: I5e18f3e2b16cb0621dad2bba141ae63fb5edd241 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102012 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-08-27tdf#123354 sw: add table formula ABSLászló Németh
for DOCX interoperability. See also commit e1aea22f3f4fbf0cc412a8867165a85a3c55f49c (tdf#123354 DOCX import: fix ABS formula). Change-Id: I8633ff4d4727a1e7a596312cdd62e87c07cbe730 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101402 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-08-27tdf#123390 sw: add table formula SIGNLászló Németh
for DOCX interoperability. See also commit 4d9b72d1c3929eca04c7a2e363ab6214676b0f64 (tdf#123390 DOCX import: fix SIGN formula). Change-Id: I60896e2bf8fb96b8a71d426d50fdea3d212854b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101398 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-08-27tdf#123356 sw: add table formula COUNTLászló Németh
for DOCX interoperability. See also commit f1f27b2487ccfb7a03190ff68eadbfb611dd9749 (tdf#123356 DOCX import: fix COUNT formula). Change-Id: I951944ed92bcbed3388f5d7e364e7ff104f37d1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101395 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-08-26tdf#123401 DOCX: fix table formula AVERAGELászló Németh
by adding AVERAGE as an alternative name of MEAN, and by converting MEAN to AVERAGE during DOCX export. Change-Id: I691618141a67f19f5823d8a214169c15f2ac6cce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101336 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-08-25tdf#123388 sw: add PRODUCT table formulaLászló Németh
for DOCX interoperability. Change-Id: Icd19d1e0025e76bc3ff00a347fa2743ed7c8ee06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101306 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-08-18new loplugin:unusedvarsglobalNoel Grandin
I copied and modified the unusedfields plugin to find unused variables. Change-Id: I18ed6daa202da70a2e564e4fe4760aed7ce070ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100891 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-13Revert "loplugin:constfields in sw"Noel Grandin
This reverts commit 4969f4c0d3e2581aaa8a5b5a5769840fa6b6f8ea. Change-Id: I527e9366b05e8a20633720e334395b285991c524 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90473 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-23sal_Char->char in swNoel Grandin
Change-Id: I63fb87a8e8eaf9c9da7bf7b8b6f5706222ffcc07 Reviewed-on: https://gerrit.libreoffice.org/85730 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-04loplugin:finalclasses in sw/incNoel Grandin
Change-Id: I084502d8c5607f103ef987b54252ef95341f0bef Reviewed-on: https://gerrit.libreoffice.org/81981 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-28loplugin:constmethod in swNoel Grandin
Change-Id: I73c3c6d2165287d2d581a04b23b1d3b48166a488 Reviewed-on: https://gerrit.libreoffice.org/79780 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-02sw: prefix members of SwHashTable, SwSbxValue and SwServerObjectMiklos Vajna
Change-Id: Ibd99ef57d1e80b14e8b2e3ed73dbbab7755a2ea8 Reviewed-on: https://gerrit.libreoffice.org/65802 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2018-11-21tdf#42949 Fix IWYU warnings in include/vcl/[B-E]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Iabe571aa8f00492902c499094bea8365a3e17fca Reviewed-on: https://gerrit.libreoffice.org/63623 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-10-03loplugin:constfields in swNoel Grandin
Change-Id: I1eb6583bb9ec815bc0564b0d7c676f5b1fb9045f Reviewed-on: https://gerrit.libreoffice.org/61177 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-21coverity#1401334 Uncaught exceptionCaolán McNamara
Change-Id: I2a74e0bcba46b730067b5baca5e934f95ba265ce Reviewed-on: https://gerrit.libreoffice.org/60854 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-02sw user field type: fix locale of string -> float conversionMiklos Vajna
The key part is the SwUserFieldType::GetValue() hunk, the field type has to always use the same locale, which means if we get an SwCalc reference that works with the document or field locale that has to be switched temporarily. Change-Id: I26ff18e74f477729a66b066c4baf6d215a7685bc Reviewed-on: https://gerrit.libreoffice.org/58492 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
2018-07-30loplugin:stringloop in swNoel Grandin
Change-Id: Ie316aee8d1e4f772dc25725b46e130c6717458c2 Reviewed-on: https://gerrit.libreoffice.org/58331 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-20loplugin:useuniqueptr in SwCalcNoel Grandin
update the table to use a template, which gets rid of lots of casting Change-Id: Ic9ed3901a33e1cd1a1d4335a704d0dd91a5c2f8a Reviewed-on: https://gerrit.libreoffice.org/51414 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-03loplugin:constparams in sw part1Noel Grandin
Change-Id: Id8d8afe268a82585ec2d3699411073dfb905d6ba Reviewed-on: https://gerrit.libreoffice.org/40734 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-05tdf#108873 fix merge data handling in fieldsJan-Marek Glogowski
This is a regression from tdf#70346 / commit 4851cde7b98226b0f82ae2b191c290173e9b06c6 It added the whole DB row as variables to the SwCalc hash set. This works correct for conditionals when hiding sections, but not for conditionals used in fields - actually they break. Previously the field would do a fallback to query the DB again, if no variable was in the dict and the only possible variables in the dict could have been user-defined fields. This handles the added variables correctly for fields. Also fixes a bug to store the DB number values as number variables and adds the record number, as SwCalc::VarLook does. Change-Id: Ib0dbeda68234e671768ede55b2012235a3680276 Reviewed-on: https://gerrit.libreoffice.org/39509 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-05-08loplugin:checkunusedparams in sw(part1)Noel Grandin
Change-Id: I4847b0f96033016e020212fb8d7331309db25b55 Reviewed-on: https://gerrit.libreoffice.org/37287 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-25tools: svstream.hxx needs only errcode.hxx & not errinf.hxxChris Sherlock
Change-Id: Ia28e35ae5af4f601e9a586a3deffbcd61702b0ca Reviewed-on: https://gerrit.libreoffice.org/36896 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-04-10tdf#39468 Translate German comments in swJens Carl
Translate German comments and terms in sw/inc/ and sw/source Change-Id: I1330a358db2c6cdc0512009befeafa0582ac4877 Reviewed-on: https://gerrit.libreoffice.org/36288 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2017-02-13convert SwCalcError to scoped enumNoel Grandin
and drop unused CALC_VARNFND and CALC_WRONGTIME enumerators Change-Id: I415960180b074ee4c54c47e69962fe2ca1be42e0 Reviewed-on: https://gerrit.libreoffice.org/34195 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-13new loplugin: useuniqueptr: sw part 1Noel Grandin
Change-Id: I2bc55634e80976951ede768c97fbc4b7c4eda46c Reviewed-on: https://gerrit.libreoffice.org/32963 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-11default dtor is sufficientCaolán McNamara
Change-Id: Ia32b31489eb67f24987852dbadbcc2d3a81a0312
2016-11-11default copy ctor is sufficientCaolán McNamara
Change-Id: I908848590add00d96001e1fdaafedc85ae3d6765
2016-10-04loplugin:countusersofdefaultparams in swNoel Grandin
Change-Id: I65beb17816641cff6a07379b7ba234afe26806b3 Reviewed-on: https://gerrit.libreoffice.org/29488 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-01rearrange SwCalc some moreCaolán McNamara
Change-Id: Ib1ffc112ddd006102b29536f7433a3f16bf63a3f
2016-10-01rearrange SwCalc a littleCaolán McNamara
Change-Id: I42278cf63f3cf2a1c3362fcb8c4eeacab2a9de48
2016-09-13loplugin:override: No more need for the "MSVC dtor override" workaroundStephan Bergmann
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark overriding destructors as 'virtual'" appears to no longer be a problem with MSVC 2013. (The little change in the rewriting code of compilerplugins/clang/override.cxx was necessary to prevent an endless loop when adding "override" to OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager(); in chart2/source/inc/LifeTime.hxx, getting stuck in the leading OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.) Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
2016-08-17loplugin:unusedenumvalues in swNoel Grandin
Change-Id: Ia5faa65cd7824183cead2634edab96b5d23a6c02 Reviewed-on: https://gerrit.libreoffice.org/28072 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-08-09sw: prefix members of SwCalcMiklos Vajna
Change-Id: I8603ce669c09419919ba9fb93788666f45783caa Reviewed-on: https://gerrit.libreoffice.org/27998 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2016-04-22Avoid reserved identifiersStephan Bergmann
Change-Id: I27ff0f4f0eb395d7e0a60dd604758c220a3134c4
2016-02-29loplugin:unuseddefaultparam in sw (part3)Noel Grandin
Change-Id: Ibff7ac9718929349ee7daa3febb0f8fe4a9fa4db