summaryrefslogtreecommitdiff
path: root/sc/inc/address.hxx
AgeCommit message (Collapse)Author
2024-07-18make ScRange single-arg constructor explicitNoel Grandin
Change-Id: Ie24e1e601b639dd62dbb8a201378a970699b20ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170686 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-23Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]StringStephan Bergmann
...in include files. This is a mix of automatic rewriting in include files and manual fixups (mostly addressing loplugin:redundantfcast) in source files that include those. Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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-05-20bump up Calc MAXTILEDROW to MAXROWLuboš Luňák
I.e. no restriction on number of rows for LOK. Change-Id: I248a70bafe18c68e59f604e33b9456474ab785c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134620 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-04-28reduce Calc's INITIALCOLCOUNT to 1Luboš Luňák
Columns should be dynamically allocated on demand, so there should be theoretically no good reason to allocate 64 initially. In practice doing so hides all places that do not allocate columns as needed. Change-Id: I8b46ecc97852ed23369e720f50f3266c48440435 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133311 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-09change default Calc number of columns to 16384 (tdf#50916)Luboš Luňák
All tests pass now, and I've also handled all significant bugreports from tdf#133764. This commit is mainly meant to test this more in practice and collect feedback. Depending on how this turns out, there may be a backwards compatibility option or something similar, but so far I see no significant need for it. Change-Id: I1a946f4e0b51be5acf4e25dc773e7694c2b17b48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131180 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-04provide MAXCOL/MAXROW also as stringsLuboš Luňák
Primarily for use in tests. Change-Id: Icb962cbdfa63a3b50115314e9afd46f3fa1a928a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130939 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-25convert more MAXCOLCOUNT/MAXROWCOUNTLuboš Luňák
And add GetMax{Col|Row}Count() directly to ScDocument, and also add MAX{COL|ROW}COUNT_JUMBO. Change-Id: Ib92cfbf65dd7cbe87230b02b8916e7cc50fcdbc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130529 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-19remove MAXCOL/MAXROW from ScAddress/ScRange (tdf#147509)Luboš Luňák
Change-Id: I4e80bba8b866f9915a6600ce67774380e619c2e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130188 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-14remove use of MAXCOL/MAXROW from address.hxxLuboš Luňák
Change-Id: Icfc00584b0190ee90e506f80c73231e12f155cc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129853 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-10Deduplicate PutInOrder'sMike Kaganski
Change-Id: I76db8dd5398628e544fdd76179046b98f76d80a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129773 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-02-08make the large-sheet maxrow value pow2-based and not pow10-basedLuboš Luňák
All the other limits are powers of 2, I see no good reason why this one should be 16000000 and not 16777216. Also at least ScBroadcastAreaSlotMachine actually requires the values to be powers of 2, otherwise the logarithmic algorithm in its ctor will miss some rows at the end. Change-Id: Iee30a271e9e67d092c34d2e4175cb672e6f737a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129588 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-12-06slightly simpler Intersects() checkLuboš Luňák
For two ranges to intersect, both start points must not be larger than the end points. Change-Id: I69d1c548ff1bac90baea0767e92ca86458808c9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126393 Tested-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-12-06rename In() to Contains()Luboš Luňák
Similarly to b22d4785310eac35696d, 'A.In(B)' makes it unclear whether the check is for A in B or B in A, as it's actually the latter. Change-Id: Iaccc41d40f4bb105a44c1bb8d9211c06d1a3c127 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126392 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-11-24Rename o3tl::underlyingEnumValue to o3tl::to_underlying to match C++23Mike Kaganski
Change-Id: I1597a8e77199445bf377dbe54adc3134bb04fd51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125748 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-10-11add coverity[uninit_member] to explanationCaolán McNamara
Change-Id: I3aefd74b9fb940b9c7485a1c1b989a43912fdb60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123368 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-05XLSX import: fix handling of named ranges referring to PathMissing sheetsMiklos Vajna
In case xl/externalLinks/externalLink1.xml refers to a sheet where type is PathMissing, then both <sheetName> and <sheetData> gets ignored on import. Make sure to also ignore named ranges referring to such external documents. The resulting named range was just a string anyway, and exporting this back to XLSX results in Excel marking the whole file as corrupted. Change-Id: Ifde07b5e59fba371f1f8ab3e82861c6997c6dbf0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118401 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-03-26add some nodiscard to address/range validatorsCaolán McNamara
Change-Id: I2a66ebc2517c1470585be630fd0ed70d82e140d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113106 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
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>
2020-09-23ScRefAddress::GetRefString never passed a null ScDocument*Caolán McNamara
so the nullptr check can be removed and some more along that vein Change-Id: Ic0c1f98564b6bd457edd0d3ba2a4382b7945e806 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103217 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-23some places where ScDocument* is never passed a nullptrCaolán McNamara
allow some never-hit null checks to be dropped Change-Id: I27a3979af19b556bc9a8e4f893bf0e65cdc439a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103215 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-18cid#1466690 ScDocument* arg is never nullCaolán McNamara
So the various fallback null checks are shown to be redundant and can be removed. Change-Id: I93b3c3a9b124b7de48acebcb348a1261c1b0037c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102978 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-18ScAddress::Parse never passed a null ScDocument*Caolán McNamara
Change-Id: I8832f2cc4311b30b9a15883e831260a19d089a57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102974 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-17ScRange::Parse never passed a null ScDocument*Caolán McNamara
Change-Id: I2c504f051f77c89f7e2e6d54990d030351824121 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102956 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-17provide a ScDocument arg for ScRange::ParseCaolán McNamara
been like this since the initial import. It seems reasonable to pass the available ScDocument to ScRange::Parse to bring this use of ScRange into line with all the other cases. Change-Id: I1c9c4813b3bd2b09acc123e8814edbacddbd5f25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102680 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-15ConvertSingleRef never passed a null ScDocument*Caolán McNamara
Change-Id: I1ce4f369d8078e1950204b3046457582d9d67397 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102736 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-15ConvertDoubleRef never passed a null ScDocument*Caolán McNamara
Change-Id: I37702a7070fdafc3c9db962a9746ac9e97adf7de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102719 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-15ScRangeList::ParseAny ScDocument* argument dereferenced on all used pathsCaolán McNamara
Change-Id: Ie41a1b58f8bec0e8197aa49aa92522f11de40a28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102667 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-13ParseCols never passed a null ScDocument*Caolán McNamara
Change-Id: I2276af9d49226bd3ef6514910ead9a7f4c263fe8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102583 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-13ParseRows never passed a null ScDocument*Caolán McNamara
Change-Id: Id9eb2c87ebe583f2024d5b8d8d6fd496dc90c7c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102582 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-15tdf#133853 Large spreadsheets have 16385 columns instead of 16384Aron Budea
MAXROW_JUMBO/MAXCOL_JUMBO should be max - 1, similarly to MAXROW/MAXCOL. Since f6064b13586aa8681907b69e4f43643251f9b803. Change-Id: I3d300e916b9584a2231f39bec5a044bd82c81752 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100777 Tested-by: Jenkins Reviewed-by: Aron Budea <aron.budea@collabora.com>
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-01-03cid#1456608 Dereference after null checkCaolán McNamara
Change-Id: I47f41b1eae327a0140f4e59184db7a0d7f5b0f67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86196 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-12-14sc: rowcol: convert mark dataNoel Grandin
with this patch I can finally load a 3201 column document Change-Id: I880d485b3f628836e7aed92c276e660466a3b19c Reviewed-on: https://gerrit.libreoffice.org/85139 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-14sc: rowcol: tdf#50916 convert Valid* methodsNoel Grandin
which means we end up passing around ScDocument* __everywhere__ Change-Id: I44d235ca5e9d57519f068b6880ee7d66f3ceb529 Reviewed-on: https://gerrit.libreoffice.org/83548 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-13sc: rowcol: tdf#50916 create ScSheetLimits to hold by rtl::ReferenceNoel Grandin
ScTokenArray sometimes outlives the ScDocument that created it, which means it accesses dead data when it tries to validate columns and rows. So create the ScSheetLimits class, which ScTokenArray can hold by reference counted pointer. Change-Id: Ic5771734fe4962d12f024fc1b29232124c14208a Reviewed-on: https://gerrit.libreoffice.org/85117 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2019-12-11sc: rowcol: tdf#50916 initial conversion of Valid* methodsNoel Grandin
just default the params for now Change-Id: I13ee78aeaa1133a167d57520b334d5e644e28ece Reviewed-on: https://gerrit.libreoffice.org/84926 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-14cid#1455325 establish that pDoc cannot be null thereCaolán McNamara
Change-Id: Ia7bca1e74a8ede90e29ec6cbd63c7fdcaf25b072 Reviewed-on: https://gerrit.libreoffice.org/82696 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-14Details always dereferences ScDocument argumentCaolán McNamara
Change-Id: If56c03af49606ffe6b5d4d782bd4a848aa79d8c2 Reviewed-on: https://gerrit.libreoffice.org/82695 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-12Resolves: tdf#122232 Move TabStartCol logic to ScTable::GetNextPos()Eike Rathke
... instead of blindly applying it to every move if set. Change-Id: Ief2efb4eb2288cd479852d5a250c2523715de38b Reviewed-on: https://gerrit.libreoffice.org/82513 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-11-11cid#1455326 MoveSticky always has a non-nullptr pDocCaolán McNamara
Change-Id: I84d9a81e9e8a544dbc50b9d6b40a7b9030f2a987 Reviewed-on: https://gerrit.libreoffice.org/82425 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-10-29sc: rowcol: tdf#50916 convert core/toolNoel Grandin
Change-Id: I0fe5a7ef4a79d0832802945ce1b9da4752f1d5fc Reviewed-on: https://gerrit.libreoffice.org/81598 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-26size some stringbuffer to prevent re-allocNoel Grandin
I started with 32 and kept doubling the size until the site did not need re-alloc, but clamped it at 512 (e.g. in emfio/). Change-Id: Ib7caf35a1b7e42b0e4ed8aa812493449e3eefc8f Reviewed-on: https://gerrit.libreoffice.org/81540 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-30reduce number of calc column constants slightlyNoel Grandin
and add some comments Change-Id: If71a3dff151fea249337668cf25b9c91d200d401 Reviewed-on: https://gerrit.libreoffice.org/79829 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-25cid#1242793 Untrusted value as argumentCaolán McNamara
help coverity know this is sanitizing its argument Change-Id: I54eb64bae73ef55e7431f6764536304c298a28c9 Reviewed-on: https://gerrit.libreoffice.org/78070 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-18tdf#125254 Performance: A spreadsheet opens too slow, part2Noel Grandin
Optimise bulk construction of ScMarkArray. This takes the opening time from 46s to 40.5s for me. Change-Id: I3955fe9b2c3113dac2ae3cda97d692de1975e762 Reviewed-on: https://gerrit.libreoffice.org/72418 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-05sc hash functions, use 64-bit range when availableNoel Grandin
Change-Id: If4d5b302343991122290ae64ec62b6f0bcfa97a3 Reviewed-on: https://gerrit.libreoffice.org/70305 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2019-04-05tdf#50916 Makes numbers of columns dynamic.Noel Grandin
With this commit we are making numbers of columns dynamic, but the number of maximum supported columns will be the same (1024). Such approach will allow us to check issues (eg. performance, LO format etc.), and improve it. Increasing number of maximum columns, will be done in separate commit. Change-Id: Ibac4101e9ffc05e3548eca1c198f6319ac7ff9aa Reviewed-on: https://gerrit.libreoffice.org/44802 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-03-05Introduce o3tl::underlyingEnumValueStephan Bergmann
Change-Id: I6554eb86326159b0da707539f45c411f61c0f3de Reviewed-on: https://gerrit.libreoffice.org/68761 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-12-08Clean up LIBO_INTERNAL_ONLY uses of SAL_WARN_UNUSED_RESULTStephan Bergmann
Change-Id: I98b2d90c8345f07010f6defd82557188d5cd35c7 Reviewed-on: https://gerrit.libreoffice.org/64808 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>