summaryrefslogtreecommitdiff
path: root/sc/inc/global.hxx
AgeCommit message (Collapse)Author
2023-04-12tdf#116127 - Add EDITATTR to ALL flags to check for valid function inputsAndreas Heinisch
Otherwise, the function clearcontents does not accept the EDITATTR flag as a valid input. Change-Id: I8381014da7110d060167a814d9ea02e347d5a92b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150191 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-10-06use more string_view in scNoel Grandin
Change-Id: Ic7126ac57f8cc06b37f3098603f0710602f0ab28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140998 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-30Move input handler function names to ScGlobal staticEike Rathke
... as there is only one function list and InputHandlerFunctionNames can be shared instead of each ScInputHandler holding their own copy. Change-Id: Id82b2020f8846456ce7464daa83feb6915792aa2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139012 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-07-13basegfx: zoomIn() and zoomOut() should be sal_uInt16Chris Sherlock
All zoom functions use sal_uInt16 values. For some reason, basegfx used long when zoomIn and zoomOut were created in 2012 (see commit 315d2ddc16: "optimized zoom to use more common intervals"), this then got mass converted to tools::Long in commit 387a88fa25: "use tools::Long in basegfx..chart2". So fix is to change zoomIn/Out() to use sal_uInt16. Change-Id: I2a56d6f58e14f77aeb8741d332fe9bc282eb969f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135715 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-05-04use more string_view in unotoolsNoel Grandin
Change-Id: Id10d68f2eb016671be6842dfaa82909207b0708d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133754 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-03sc: support deleting a Sparkline with 'Clear Content' functionTomaž Vajngerl
Change-Id: Ida61b402170238fb0505c777e49954c15d376cf0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132467 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-03-06make CellTextAttr half the sizeLuboš Luňák
It's set for every cell with value. Change-Id: Ie46617a621e6eb16b5f67d92e85bf2155e650fb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131072 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-10do not call purge() on string pool too often (tdf#125428)Luboš Luňák
It turns out svl::SharedStringPool::purge() can be somewhat expensive with larger documents. Profiling suggests it's primarily the cost of the CPU trying to access the rtl_uString instances scattered all over the memory, so it can't be easily optimized. So instead delay and compress purge() calls if they come from temporary ScDocument instances from undo or clipboard. Change-Id: Ie26cce113025ff45ee2c473c6b06f684f453b27b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129713 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-12-04loplugin:stringliteraldefine in scNoel Grandin
Change-Id: I49159fa9b525ced9423c9a37d8a31b15cc8b1e98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126308 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-11-22Revert "cache FormulaError::NoRef error string (tdf#144249)"Luboš Luňák
A more generic fix coming. This reverts commit b4c1bb2f91e9ae47820c289e2c08f640a958cf05. Change-Id: Ia7821f1c8585506556708f1bf8526e7f509aafd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125659 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-12Use more o3tl::convert in scMike Kaganski
Change-Id: I624b6c570eff8b6cdc83ffcb2d0dbadf848715b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120330 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-11-11Drop ScGlobal::GetEmptyOUString() and EMPTY_OUSTRINGMike Kaganski
OUString default ctor already uses a static instance (through rtl_uString_new), no need to have another module-specific static. Commit d8037ae18a297229d1b79f8f76331abfd548350d had removed its sw counterpart some time ago. Change-Id: I140fe13bc1f6b0cbe188e83e602fdebe995e467a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125061 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-11In O[U]StringBuffer, make string_view params replacements for OUString onesStephan Bergmann
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads. That way, loplugin:bufferadd and loplugin:stringviewparam found many further opportunities for simplification (all addressed here). Some notes: * There is no longer an implicit conversion from O[U]String to O[U]StringBuffer (as that goes via user-defined conversions through string_view now), which was most noticeable in copy initializations like OStringBuffer buf = someStr; that had to be changed to direct initialization, OStringBuffer buf(someStr); But then again, it wasn't too many places that were affected and I think we can live with that. * I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to get them in line with their counterparts taking O[U]String. * I added an OUStringBuffer::lastIndexOf string_view overload that was missing (relative to OUStringBuffer::indexOf). * loplugin:stringconstant needed some addition to keep the compilerplugins/clang/test/stringconstant.cxx checks related to OStringBuffer::append and OStringBuffer::insert working. * loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related code that had been introduced in 1250aecd71fabde4dba990bfceb61bbe8e06b8ea "loplugin:stringviewparam extend to new.." Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-09-17rather return ref from GetLocaleNoel Grandin
since we never return a nullptr. Change-Id: I459acd6a25b133da5fc8516aa5e1a982df80ae8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122242 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-17rather return ref from GetTransliterationNoel Grandin
since we never return a nullptr. Also add a new utility method to simplify the call sites that need to pick the right collator Change-Id: I0ecf3ad32a0bf22d9e760620524f41bc18b54fff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-17rather return ref from GetCollatorNoel Grandin
since we never return a nullptr. Also add a new utility method to simplify the call sites that need to pick the right collator Change-Id: I5deb009cb5144fd182bbc6470ae30ea05e6979c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122237 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-17rather return ref from GetCalendarNoel Grandin
since we never return a nullptr Change-Id: I4cb4af99752818e323472a372330d1bc2a3df4f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122236 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-17rather return ref from getLocaleDataPtrNoel Grandin
since we never return a nullptr, and rename to reflect that Change-Id: I694b5198f663842d1362504d60e7191e450a08ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122224 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-17use optional for some fields in ScGlobalNoel Grandin
Change-Id: I715b771a9c09b7bcc536ce114080e27d75c2e91c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122230 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-17rather return ref from getCharClassPtrNoel Grandin
since we never return a nullptr, and rename to reflect that Change-Id: I5b8f0aba6ce387bb0fe1ce6088ba2685d2ade7f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122209 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-10cache FormulaError::NoRef error string (tdf#144249)Luboš Luňák
Those COUNTIF() may call it a huge number of times, and the translation of the string each time then actually is a noticeable impact. And ScGlobal already does one-time intialization of objects based on the locale, so one-time initializing a string there should be fine too. Change-Id: I0daeb50ccb43f780d99cf3838cfd1bf790c5f6cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121856 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-03-25tdf#58745 - Detect end of month when extending a date listAndreas Heinisch
Change-Id: Icaa64a493598dc4bb8f2d6d076ad4300e2e4dde6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112976 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-03-23tdf#124176 Use pragma once in s*Vincent LE GARREC
sc, scaddins, sccomp, scripting Change-Id: Ia99fec9e238033821cb784810edd4762c09bd5db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112049 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2021-03-08tdf#140796: Wrong English string for U+2060 characterJulien Nabet
Rename "No-width No ~Break" to "Word ~Joiner" + replace pattern "ZWNBSP" variable names by "WJ" Change-Id: I95a874a9d2d20a30d2c4c3add6041adbe72d872c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112055 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-02-04have one set of twips<->mm conversionsNoel
Change-Id: I510f4a0524a7c72eb124cba103cbf398024976d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110407 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-02Don't bother shrinking row height when changing just one row interactivelyTor Lillqvist
This reverts dca0374fb1edbd9bdeeaadda3f1866ce66b3a778 and instead tries to achieve the same without using a flag in ScGlobal. How reliable that is I don't know. See https://gerrit.libreoffice.org/c/core/+/110245 for discussion. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110245 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Change-Id: I2a7aa5bf3d29e5fd071e2f1cab628b923b5b6754 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110285 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com>
2021-02-01Don't bother shrinking row height when changing just one row interactivelyTor Lillqvist
I.e. when manually entering a new value. This used to happen at least for a sample document in .xlsx format for cells with automatic wrap turned on. After entering a value, the row height was annoyingly shrunk by a few pixels, which looked weird and pointless, and caused unnecessary invalidation thrash in the online collaborative editing context. Change-Id: I3c77f7fb4e575f02e1dd7cdc18f2919f5eb3426e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110243 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2021-01-29loplugin:stringviewparam extend to new..Noel
O[U]StringBuffer methods Change-Id: I0ffbc33d54ae7c98b5652434f3370ee4f819f6f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110090 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-11-27tdf#42949 Fix new IWYU warnings in directory sc/Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I217817e2e4a42b096f5a7fb6344568c10d69aab2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106078 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-17loplugin:stringviewparam check methods tooNoel
not just functions Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-31Reintroduce ScGlobal::FindUnquoted() nStart parameterEike Rathke
That got removed early as unused but will be needed. Change-Id: I71c028bb92f337b10366b3eac44d3eacbf1e1355 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105088 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2020-10-20use tools::Long in scNoel
Change-Id: I8f37a8d1174ed816df971b8cee036d4e88d4a7fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-09improve loplugin:unusedvarsglobalNoel Grandin
to find any global variable, was checking the wrong property of VarDecl Change-Id: I454b4e0c1701bb0771768a1ee10cd738c4ab0726 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102278 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-12use unique_ptr for ScGlobal::pFieldEditEngineNoel Grandin
Change-Id: Ic9894f9fb77ee270a3c09c0a3b5a008331016295 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100562 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-12use unique_ptr for ScGlobal::pEnglishFormatterNoel Grandin
Change-Id: Ic570f78fadaa42efc3a61a414dbdec4dd52d3aed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100561 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-12remove unused pScIntlWrapper field from ScGlobalNoel Grandin
Change-Id: I687f4d5bb485724ca93cd7402c7c05743705d633 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100560 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-12remove unused pRscString fieldNoel Grandin
Change-Id: Id2ae96138c32d98933cb47020da63bd9e23ba7d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-12use unique_ptr for ScAutoFormat in ScGlobalNoel Grandin
Change-Id: I6d19eac2f1accd97eef32ab47667476cae71ab7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100558 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-12use unique_ptr for SvxSearchItem in ScGlobalNoel Grandin
Change-Id: I45f5d2bb699ef8cc6f32995bf15c2bf9095704fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100557 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-12use unique_ptr for ScUserList in ScGlobalNoel Grandin
Change-Id: Ic7ecb6f67e2dc7ba77c73d0d0eccb758dfed8e33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100538 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-12use unique_ptr for ScFunctionListNoel Grandin
Change-Id: Ic198c36e1a39d8c56c9720d3d5a945d3415f06d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100536 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-12use unique_ptr for ScFunctionMgrNoel Grandin
Change-Id: Ida42bf61e7fe4e2775e7a95c4eca7d03947bf3a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100535 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-11use unique_ptr for CalendarWrapper in ScGlobalNoel Grandin
Change-Id: Id1a00798f9780006de28d3370e5bad1235fa2466 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100537 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-05remove unused pStrScDoc fieldNoel Grandin
Change-Id: Ie62d5cc2c0c29be14c85e618ddb65cc328fadcb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100083 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-04fix more leaks in CppunitTest_sc_cache_testNoel Grandin
To be honest, I don't know why this fixes the leak, but it's generally good practice anyway to use unique_ptr. Change-Id: Ic5aa2a0c6ab092450e9eae96616a998c08e2e723 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100045 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-03fix leak in ScCacheTestNoel Grandin
and put the init/destruct in constructor/destructor instead of setup(), we want this to run once, not for every test method. Change-Id: I7d5fcdd2974677f1509048c16fb40d03dff289c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100004 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-09compact namespace in scNoel Grandin
Change-Id: I05ffad6b92883d3eb6d337fe75f5fc7864485861 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93860 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-22ScGlobal - change direct access to a static ptr for a getterTomaž Vajngerl
pLocalData and pCharClass static veriables on ScGlobal are always set from SvtSysLocale on init, probably for "faster" access. This can just be made simpler with access through a getter, so this introduces a getter for ScGlobal::getCharClassPtr and ScGlobal::getLocaleDataPtr, where the access is made directly to SvtSysLocale instance. In addition all the usages needed to be fixed, which is all over the calc module. Change-Id: Ie047b158094e25bbaa2aba15074d7998d9541787 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89249 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-07-17tdf#121039 "Open hyperlink" from context menu does not workSamuel Mehrbrodt
Change-Id: I802a4a64d48befa9c41b7095416f165082a155f2 Reviewed-on: https://gerrit.libreoffice.org/75778 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>