summaryrefslogtreecommitdiff
path: root/sc
AgeCommit message (Collapse)Author
2020-09-18Fix typo in codeAndrea Gelmini
Change-Id: If7f65f0e42fb13bc40d7c77511406122fa50f458 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101200 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr> 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-18Online: Show input help on Online / Core part.gokaysatir
Change-Id: I9d10179f266a725b770fdae50045fdb5d77178ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102708 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit 110069adbba4d272450b30fa03c56efbd478e84c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102935 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-09-18only handle SID_CURRENTCELL if there is a ScViewData*Caolán McNamara
which I suspect is always Change-Id: Id02afb045b25472df793480823d6f17c0d1ac620 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102958 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-18Make Group dialog asyncSzymon Kłos
Change-Id: I37fd6c44d43b0f0b424bd023e13ffa07f601a08b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100119 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102876 Tested-by: Jenkins
2020-09-17GetAddressFromString never passed a null ScDocument*Caolán McNamara
for the xml case this isn't immediately obvious, but pDoc should only be null between Init and Destroy. Change-Id: I6f517be6c620a8a2e5eec0f5a2fabd176745bb8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102957 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-17GetRangeFromString, etc. never passed a null ScDocument*Caolán McNamara
for the xml case this isn't immediately obvious, but pDoc should only be null between Init and Destroy. Change-Id: I7def8df4a4144964e3ec10964819451eb8316836 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102915 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-17ScCompiler always has a ScDocument&Caolán McNamara
so various nullptr checks can go Change-Id: I3fdbc8e0f83855cd368b6ba8123881d266cf7f52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102908 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-17ScCompiler ctors never passed a null ScDocument*Caolán McNamara
add one assert to ScXMLConditionalFormatContext where this isn't immediately certain. Change-Id: I2103c5cd42288e0a5d2a1c2e2d2d031f806773bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102906 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-17Tokens2RangeStringXML ctor never called with null ScDocument*Caolán McNamara
and some more similar Change-Id: Ia92791f4d225352fdb0992e1f2fe4652fe8d3504 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102904 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-17base-class formula::FormulaCompiler is sufficient hereCaolán McNamara
Change-Id: Ic95bcc33fda1edb762009c4ca4fd3448640259bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102900 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-17TokenStringContext never called with a null ScDocument*Caolán McNamara
so we can drop the nullptr check Change-Id: I588619f3e6f701a003447c59f5c0530801b5e1ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102886 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-17ColumnStorageDumper ctor never called with null ScDocument*Caolán McNamara
Change-Id: I0d2e2c4b556bb6a3baba6a1fa663a48da8290cd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102885 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-17compileRangeRepresentation never called with null ScDocument*Caolán McNamara
Change-Id: I910731ecc1b7a36b9532841c7cc9c9288110bfe3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102880 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-17ScFormulaCell always has a ScDocument&Caolán McNamara
allowing us to drop some checks of it against null Change-Id: I60235414e05f8d9c618ddbbf9b01501ef13303d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102879 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16Turn OUStringLiteral into a consteval'ed, static-refcound rtl_uStringStephan Bergmann
...from which an OUString can cheaply be instantiated. This is the OUString equivalent of 4b9e440c51be3e40326bc90c33ae69885bfb51e4 "Turn OStringLiteral into a consteval'ed, static-refcound rtl_String". Most remarks about that commit apply here too (this commit is just substantially bigger and a bit more complicated because there were so much more uses of OUStringLiteral than of OStringLiteral): The one downside is that OUStringLiteral now needs to be a template abstracting over the string length. But any uses for which that is a problem (e.g., as the element type of a container that would no longer be homogeneous, or in the signature of a function that shall not be turned into a template for one reason or another) can be replaced with std::u16string_view, without loss of efficiency compared to the original OUStringLiteral, and without loss of expressivity. The new OUStringLiteral ctor code would probably not be very efficient if it were ever executed at runtime, but it is intended to be only executed at compile time. Where available, C++20 "consteval" is used to statically ensure that. The intended use of the new OUStringLiteral is in all cases where an object that shall itself not be an OUString (e.g., because it shall be a global static variable for which the OUString ctor/dtor would be detrimental at library load/unload) must be converted to an OUString instance in at least one place. Other string literal abstractions could use std::u16string_view (or just plain char16_t const[N]), but interestingly OUStringLiteral might be more efficient than constexpr std::u16string_view even for such cases, as it should not need any relocations at library load time. For now, no existing uses of OUStringLiteral have been changed to some other abstraction (unless technically necessary as discussed above), and no additional places that would benefit from OUStringLiteral have been changed to use it. Global constexpr OUStringLiteral variables defined in an included file would be somewhat suboptimal, as each translation unit that uses them would create its own, unshared instance. The envisioned solution is to turn them into static data members of some class (and there may be a loplugin coming to find and fix affected places). Another approach that has been taken here in a few cases where such variables were only used in one .cxx anyway is to move their definitions from the .hxx into that one .cxx (in turn causing some files to become empty and get removed completely)---which also silenced some GCC -Werror=unused-variable if a variable from a .hxx was not used in some .cxx including it. To keep individual commits reasonably manageable, some consumers of OUStringLiteral in rtl/ustrbuf.hxx and rtl/ustring.hxx are left in a somewhat odd state for now, where they don't take advantage of OUStringLiteral's equivalence to rtl_uString, but just keep extracting its contents and copy it elsewhere. In follow-up commits, those consumers should be changed appropriately, making them treat OUStringLiteral like an rtl_uString or dropping the OUStringLiteral overload in favor of an existing (and cheap to use now) OUString overload, etc. In a similar vein, comparison operators between OUString and std::u16string_view have been added to the existing plethora of comparison operator overloads. It would be nice to eventually consolidate them, esp. with the overloads taking OUStringLiteral and/or char16_t const[N] string literals, but that appears tricky to get right without introducing new ambiguities. Also, a handful of places across the code base use comparisons between OUString and OUStringNumber, which are now ambiguous (converting the OUStringNumber to either OUString or std::u16string_view). For simplicity, those few places have manually been fixed for now by adding explicit conversion to std::u16string_view. Also some compilerplugins code needed to be adapted, and some of the compilerplugins/test cases have become irrelevant (and have been removed), as the tested code would no longer compile in the first place. sal/qa/rtl/strings/test_oustring_concat.cxx documents a workaround for GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96878> "Failed class template argument deduction in unevaluated, parenthesized context". That place, as well as uses of OUStringLiteral in extensions/source/abpilot/fieldmappingimpl.cxx and i18npool/source/localedata/localedata.cxx, which have been replaced with OUString::Concat (and which is arguably a better choice, anyway), also caused failures with at least Clang 5.0.2 (but would not have caused failures with at least recent Clang 12 trunk, so appear to be bugs in Clang that have meanwhile been fixed). Change-Id: I34174462a28f2000cfeb2d219ffd533a767920b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102222 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-16ScFormulaCell ctor variants never called with null ScDocument*Caolán McNamara
Change-Id: Ie0814a8948e2a4bcf723f0418c496fbbe85495ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102878 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16ScFormulaCell ctor variant never called with null ScDocument*Caolán McNamara
can be shown by readjusting ScXMLChangeTrackingImportHelper members to explicitly pass the target ScDocument around and identify there is no null case path possible Change-Id: I15a4eadfe4bfadf97365f9a15c6ec5572d77d578 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102869 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16we already have the Document as pDocCaolán McNamara
Change-Id: I2b35bb2af4fd1b7a1b0e8da9b54d9f3eda7adfd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102868 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16ScAttrArray never has a null ScDocument* memberCaolán McNamara
Change-Id: I06e4190235799d6ff231179ae3bbc8f76d4a3342 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102867 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16Cleanup: apply Clang formattingSzabolcs Toth
Some formatting on a previous commit. Change-Id: Ib5de7170ca230486b6d8c85cc999fac1f736def6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102716 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-09-16ScColumn::ScColumn never called with a null ScDocument*Caolán McNamara
Change-Id: I125d0e7571e3c34fbaab0fd024a67cbb518fdf64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102845 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16IsNameValid never passed a null ScDocument*Caolán McNamara
Change-Id: I2bef21f5c6356823b3c0470e7640896740e2ee9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102844 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16ScTable ctor never called with a null ScDocument*Caolán McNamara
Change-Id: I183fd26df45ddd4e7432833c5c77b07b64e03609 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102842 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16ScEditableTester ctor never passed a null ScDocument*Caolán McNamara
Change-Id: I29338e400ba489e57571cb7711d92f611d5ce8d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102841 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16ScImportExport always dereferences it ScDocument* argCaolán McNamara
Change-Id: I0543c005fdabcf67ae2bfb0fc28dccf2c2a47a7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102840 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16The default implementation can be usedMike Kaganski
Change-Id: Iaae5e3f7eeb7bde3ef6763cd3b0d2992ef999712 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102758 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-09-16AdjustRangesOfChartsOnDestinationPage never passed null ScDocument*sCaolán McNamara
Change-Id: Ic31a6b19dc9701bb4e8be500050ca6f689352342 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102838 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16Remove more redundant checksMike Kaganski
... follow-up for bf3d1b8e8f89bfdb409c70cfea126f36474d4772. Changes pointer to ScDocument into reference; makes some unique_ptrs inlined; simplifies construction of ScViewData to remove the need in additional initialization after internal ctor. Change-Id: I54055ce8243628c3bf9a3e40c557e0098e5801ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102833 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-09-16Simplify initializationMike Kaganski
Change-Id: Ib12b3644bbf732bac57713980b1fec14ee7783d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102757 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-09-16TransferDrawPage always dereferences its ScDocument* argumentCaolán McNamara
Change-Id: Ie2639fc10f1bf6a5c046e4e075337b117a8f6144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102837 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16TransferTab always dereferences its ScDocument* argumentCaolán McNamara
Change-Id: I68b1fb4cda82a8a334e60b43216cfa74534e4a28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102836 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16lcl_GetHyperlinkCell never passed a null ScDocument*Caolán McNamara
Change-Id: I0a4e3453016f4f8ac84c0d501456ee9f52c79c5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102835 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16CalcScale never passed a null ScDocument*Caolán McNamara
Change-Id: Ie916a28a8c1be66db161531daad48ffd0d5d8554 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102834 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16CopyStaticToDocument never passed a null ScDocument*Caolán McNamara
Change-Id: I1cd3b0f6b17e7b8e3430cb2aaa5cd1c78c8abc46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102792 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16copyChartRefDataToClipDoc never passed a null ScDocument*Caolán McNamara
Change-Id: I3a647358263b0e328dc2238bbfdc6e4e2ecf4090 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102791 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16lcl_checkClassification never passed a null ScDocument* destination docCaolán McNamara
Change-Id: Ic0010d785e49c96a19e6e04e44fe6bc02cc44375 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102790 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16GetChartRanges never passed a null ScDocument*Caolán McNamara
Change-Id: I021544d0cdfb68f6e30a4bb229eb0e8b3ea695d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102789 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16AddRangesIfProtectedChart never passed a null ScDocument*Caolán McNamara
Change-Id: Ia73438defc9db3bff8aecd7a537170e9a86fd1a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102788 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16FillProtectedChartRangesVector never passed a null ScDocument*Caolán McNamara
Change-Id: If090786c7e5834ea3cf990b0b4e9dbd2ec2a56a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102786 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-15lcl_SeekAutoSumData never passed a null ScDocument*Caolán McNamara
Change-Id: I5c651a444f6878a0a71eaf4e1c48cdc8306742f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102785 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-15CreateProtectedChartListenersAndNotify never passed a null ScDocument*Caolán McNamara
Change-Id: I76efe00924938830f26e1901c22da04376c30ce9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102784 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-15CreateNameSortedArray never passed a null ScDocument*Caolán McNamara
Change-Id: Ib5501d3b3eef77224ffb091df0e30ecab9859c8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102777 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-15establish that ScViewData::GetDocument can always return ScDocument&Caolán McNamara
we can only be ctored with a ScDocShell& or ScDocument&, and ScDocShell provides a ScDocument& from its GetDocument() so we can always have a ScDocument& when a public ctor has completed some null checks can then be seen to be redundant and are removed Change-Id: Ifaf39cb06e8dbce363999c05ee0aeb3ec4f00428 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102775 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-15establish ScViewData always ctored from ScDocShell& or ScDocument&Caolán McNamara
Change-Id: Ie4d9520fe2ce69bbfc5fa755cce165f01947a535 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102752 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-15setDocument and InitData never called with a null ScDocument*Caolán McNamara
Change-Id: Ia0c6613daabcdcd61bd3efe1fe8a79ccbc7fa19c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102751 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-15ScAreaNameIterator always dereferences its ScDocument* argumentCaolán McNamara
Change-Id: Ibdeeb634561a4bdd437e04bece77315b392b020e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102746 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-15GetStringFromXMLRangeString never passed a null ScDocument*Caolán McNamara
Change-Id: I2855e212db08b6df0aa91f25b10b4605173b2095 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102745 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>