summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/nameuno.cxx
AgeCommit message (Collapse)AuthorFilesLines
4 daysloplugin:ostr in sc/../unoobjNoel Grandin1-8/+8
Change-Id: I182a5f28c872eb4dd96b930b86b9aef42459f191 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168145 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-20Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: scStephan Bergmann1-1/+1
Change-Id: Ieed908bfa2cb6370ead922dfc00dbdb4f905f3cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158216 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-11Drop o3tl::span, can use C++20 std::span directly nowStephan Bergmann1-2/+2
Change-Id: Ic21ff7bf48f07f7277979d52e99d2c5c268de83f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157825 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-01tdf#154449 Add support for hidden named rangesRafael Lima1-1/+5
This patch adds the possibility of having "hidden" named ranges in Calc, in a way similar to what MS Excel has (i.e. they're not visible in the UI and can only be hidden/shown via scripting). This is done by creating a new HIDDEN flag in com.sun.star.sheet.NamedRangeFlag. Hence thia patch makes it so that named ranges can be made hidden/visible via scripting. For instance, consider a Calc document with a named range "NamedRange1". The following scripts hides "NamedRange1" from the UI (i.e. it's no longer visible in the Manage Names dialog): Sub SetHidden Dim eFlags : eFlags = com.sun.star.sheet.NamedRangeFlag aNamedRange = ThisComponent.NamedRanges.getByName("NamedRange1") nType = aNamedRange.getType() Or eFlags.HIDDEN aNamedRange.setType(nType) End Sub To make the named range visible again: Sub RemoveHidden Dim eFlags : eFlags = com.sun.star.sheet.NamedRangeFlag aNamedRange = ThisComponent.NamedRanges.getByName("NamedRange1") nType = aNamedRange.getType() nType = nType - (aNamedRange.getType() And eFlags.HIDDEN) aNamedRange.setType(nType) End Sub This patch also implements ODS and OOX import/export, as well as QA tests. Change-Id: I10efe46938fe772b87dc17fc597cb83648b5efb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155599 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-09-10using decls should come after #includeNoel Grandin1-4/+4
Change-Id: I058551e87bca42adede860f6f299b0f7ae2af3b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156798 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-18Use getXWeak in scMike Kaganski1-2/+2
Change-Id: I6a120265be4e4f2ec859a17459d9d92ea23f00d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150863 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-17XUnoTunnel->dynamic_cast in ScNamedRangeObjNoel Grandin1-14/+0
Change-Id: Ib298d8ba676f5a6ddf3fe9b7a49dc45c46d7adbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145636 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-07clang-tidy modernize-pass-by-value in scNoel Grandin1-5/+6
Change-Id: Ia7ff651d1cbc119b36a9f8052594d03650988f59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137848 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-25use more o3tl::spanNoel Grandin1-4/+2
which means we can reserve precisely the right number of entries when building maps Change-Id: I580414699289369de4730caae09829bbd8759e82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137292 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-24Use o3tl::make_unsigned in some placesStephan Bergmann1-1/+2
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I20600d61a5d59d739bc1bee838c0038e4611aec2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134875 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-20new loplugin:unnecessary lockingNoel Grandin1-2/+0
off by default, since each warning needs careful inspection Change-Id: I805c1d1cdde531a1afdc76e87b22f879fc3c9753 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134641 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-18no need to take a lock when returning static dataNoel Grandin1-3/+0
Change-Id: I8d836c4a919056e8b600549f82b0d5dee9ab1a47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134536 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04Just use Any ctor instead of makeAny in scStephan Bergmann1-3/+3
Change-Id: I5c2363ff03ae02274f3c334cc262977c834950d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133788 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-12-04loplugin:stringliteraldefine in scNoel Grandin1-5/+5
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-08make a number of Calc functions return value by actually returning itLuboš Luňák1-3/+3
All these returned their value using a reference argument, for apprently no good reason. Change-Id: I6a33417e7df2aac67427c16e5003dfaaa1a814d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124872 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-09-17rather return ref from getCharClassPtrNoel Grandin1-5/+5
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-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 4Mike Kaganski1-5/+1
- Change implementations of getSomething to use getSomethingImpl Or where that's impossible, use getSomething_cast to unify this and reduce number of places where we reinterpret_cast. All static methods getting tunnel ids were renamed to getUnoTunnelId, to comply with the convention used in <comphelper/servicehelper.hxx>. TODO (in separate commits): - Revise uses of getSomething to use getFromUnoTunnel Change-Id: Ifde9e214b52e5df678de71fcc32d2199c82e85cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122100 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 1Mike Kaganski1-2/+2
The header got some changes: 1. Move UnoTunnelIdInit and isUnoTunnelId into 'comphelper' namespace 2. Rename UnoTunnelIdInit to UnoIdInit, as a precondition to replace of uses of OImplementationId with it, including in XTypeProvider 3. Introduce convenience functions 'getSomething_cast' to cast between sal_Int64 and object pointers uniformly. 4. Rename getUnoTunnelImplementation to getFromUnoTunnel, both to make it a bit shorter, and to reflect its function better. Templatize it to take also css::uno::Any for convenience. 5. Introduce getSomethingImpl, inspired by sw::UnoTunnelImpl; allow it handle cases both with and without fallback to parent. 6. Adjust UNO3_GETIMPLEMENTATION_* macros TODO (in separate commits): - Drop sw::UnoTunnelImpl and sw::UnoTunnelGetImplementation - Replace all uses of OImplementationId in core with UnoIdInit - Deprecate OImplementationId in <cppuhelper/typeprovider.hxx> - Change implementations of getSomething to use getSomethingImpl - Revise uses of getSomething to use getFromUnoTunnel Change-Id: If4a3cb024130f1f552f988f0479589da1cd066e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122022 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-02convert #defines to OUStringLiteralNoel Grandin1-1/+1
mostly by doing $ git grep -l '#define.*\"' -- *.cxx | xargs perl -pi -e 's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 = u\2;/g' Change-Id: I7467f9067085ac89b98a0398811396c448339b4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119840 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-11Simplify Sequences initializations (sc)Julien Nabet1-1/+1
Change-Id: I0c581b3a900a6b89c0f4e203310d65600545987f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116929 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-04-09tdf#119457 - check for a valid range name and cell referenceAndreas Heinisch1-15/+31
Change-Id: If23eda52142ba5e59cfd354f2177b1ac1727efaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113341 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2021-04-07rtl::Static -> function local staticNoel Grandin1-6/+2
Change-Id: I2071c27bdf074403ec24e67f9278ac27f9491303 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113698 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-03loplugin:refcounting in scNoel1-5/+5
Change-Id: I0b808785e54bf1dfc9387a649aacf731b2f34d12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111801 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-20use tools::Long in scNoel1-2/+2
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-14ScRangeData ctor variant never passed a null ScDocument*Caolán McNamara1-1/+1
Change-Id: Ia5622fc4c00a49003c232fc3947e14d71a7089f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102631 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-14both branches dereference ScDocument* argCaolán McNamara1-2/+2
Change-Id: I63a2b7908fe332c177ea0385c3ea9b9cd136f824 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102622 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-13ScTokenArray ctor always dereferences its ScDocument* argCaolán McNamara1-1/+1
Change-Id: Ie65ca182fd00600670c1e916343fef511d6cdcc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102588 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-28Change OUStringLiteral from char[] to char16_t[]Stephan Bergmann1-7/+7
This is a prerequisite for making conversion from OUStringLiteral to OUString more efficient at least for C++20 (by replacing its internals with a constexpr- generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount, conditionally for C++20 for now). For a configure-wise bare-bones build on Linux, size reported by `du -bs instdir` grew by 118792 bytes from 1155636636 to 1155755428. In most places just a u"..." string literal prefix had to be added. In some places char const a[] = "..."; variables have been changed to char16_t, and a few places required even further changes to code (which prompted the addition of include/o3tl/string_view.hxx helper function o3tl::equalsIgnoreAsciiCase and the additional OUString::createFromAscii overload). For all uses of macros expanding to string literals, the relevant uses have been rewritten as u"" MACRO instead of changing the macro definitions. It should be possible to change at least some of those macro definitions (and drop the u"" from their call sites) in follow-up commits. Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-08-13use OUStringLiteral in SfxItemPropertyMapEntryNoel Grandin1-7/+7
Change-Id: I4f05b6a35010e661ea77f3e4b83302d2ec74d227 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100405 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-09loplugin:flatten in sc/ui/unoobjNoel Grandin1-62/+62
Change-Id: I9b03672387aa555eb11149763a1113e0768f3f37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100398 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ž Vajngerl1-5/+5
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-12-12sc: rowcol: tdf#50916 pass ScDocument to the token classesNoel Grandin1-1/+1
needed to create a fake ScDocument for the external ref manager, since it has no ScDocument at all Change-Id: Ia786ac291133e3c438694e81ecfb2590729a853d Reviewed-on: https://gerrit.libreoffice.org/85050 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-23sc: rowcol: tdf#50916 convert unoobjNoel Grandin1-3/+3
Change-Id: Iec648767c7f09f9655dcd6bceff9df5fc66026de Reviewed-on: https://gerrit.libreoffice.org/81332 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-23tdf#39593 extract UnoTunnelId comparison to template functionArkadiy Illarionov1-3/+1
Change-Id: Ia2b5dea273c8de7b8c54e74780193a8d4cba7b45 Reviewed-on: https://gerrit.libreoffice.org/73874 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): scStephan Bergmann1-1/+1
Change-Id: I1bfd2bb623aac5ac457a0b719da64ab393ccd0ba Reviewed-on: https://gerrit.libreoffice.org/76654 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-04tdf#42949 Fix IWYU warnings in sc/source/ui/unoobj/*Gabor Kelemen1-1/+0
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I9b4111f2b4ccea71a491f2412f0d02ce5a7f64f7 Reviewed-on: https://gerrit.libreoffice.org/74570 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-08tdf#42949 Fix IWYU warnings in include/sfx2/[t-z]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib3252828385d1dc8faf48a428b1593199647a679 Reviewed-on: https://gerrit.libreoffice.org/70383 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-07Simplify containers iterations in sc/source/ui/{unoobj,vba}Arkadiy Illarionov1-15/+11
Use range-based loop or replace with STL functions Change-Id: Ia8a8cfb71047e5612aa62c817c76ae0dfb7b3fa2 Reviewed-on: https://gerrit.libreoffice.org/65903 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-26tdf#42949 Fix IWYU warnings in include/unotools/*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I444c43b9d549977039f25bec2b5bf666c3e15e0e Reviewed-on: https://gerrit.libreoffice.org/62041 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-16loplugin:returnconstant in ScTokenConversionNoel Grandin1-1/+1
Change-Id: I17d8d188cb4a51978af41788ee3adf9d221c8bdb Reviewed-on: https://gerrit.libreoffice.org/59126 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-28loplugin:useuniqueptr in ScColumnNoel Grandin1-8/+6
Change-Id: Iff6c68a29b9e7660132cbe4e556802b0f63706f0 Reviewed-on: https://gerrit.libreoffice.org/51904 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-15don't use heap for elements in ScRangePairListNoel Grandin1-17/+12
no need to store small objects like this out of line. And use std::array for ScRangePair, so we get range checking in debug mode. Change-Id: Ie4690edbb4c3fdc4e08206cb016b8167a399d95a Reviewed-on: https://gerrit.libreoffice.org/51268 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12More loplugin:cstylecast: scStephan Bergmann1-6/+6
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I987ac3a6d062600a5e21c3462c70595dfaa51796
2017-10-23loplugin:includeform: scStephan Bergmann1-13/+13
Change-Id: I2ed763e0584a188032c80fde60890de3c6985cbd
2017-09-26loplugin:flatten in scNoel Grandin1-9/+9
Change-Id: I40653af2d90ef123cf77d7223c520cba0e5a3aca Reviewed-on: https://gerrit.libreoffice.org/42661 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-11remove some unnecessary temporary OUStringsNoel Grandin1-1/+1
found with: git grep -nP 'OUString\(\s*\w+\s*\)' | grep -v new | grep -v return Change-Id: I923109b4339210aed2639e423fbc4d5f19233f02 Reviewed-on: https://gerrit.libreoffice.org/37463 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-23convert NAME constants to CreateNameFlags o3tl::typed_flags enumNoel Grandin1-6/+6
Change-Id: I6265c76067402808454184f1318feeb78a140617 Reviewed-on: https://gerrit.libreoffice.org/35555 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-06Add missing #includesStephan Bergmann1-1/+1
...and remove some unncessary using directives/declarations, in preparation of removing now-unnecessary #includes from cppumaker-generated files, post e57ca02849c3d87142ff5ff9099a212e72b8139c "Remove dynamic exception specifications". Change-Id: Iaf1f268871e2ee1d1c76cf90f03557527ebc9067
2017-01-31teach lolugin:stringconstant about calling constructorsNoel Grandin1-2/+2
so we can remove unnecessary calls to the OUString(literal) constructor when calling constructors like this: Foo(OUString("xxx"), 1) Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36 Reviewed-on: https://gerrit.libreoffice.org/33698 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-26Remove dynamic exception specificationsStephan Bergmann1-58/+17
...(for now, from LIBO_INTERNAL_CODE only). See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. Most changes have been done automatically by the rewriting loplugin:dynexcspec (after enabling the rewriting mode, to be committed shortly). The way it only removes exception specs from declarations if it also sees a definition, it identified some dead declarations-w/o-definitions (that have been removed manually) and some cases where a definition appeared in multiple include files (which have also been cleaned up manually). There's also been cases of macro paramters (that were used to abstract over exception specs) that have become unused now (and been removed). Furthermore, some code needed to be cleaned up manually (avmedia/source/quicktime/ and connectivity/source/drivers/kab/), as I had no configurations available that would actually build that code. Missing @throws documentation has not been applied in such manual clean-up. Change-Id: I3408691256c9b0c12bc5332de976743626e13960 Reviewed-on: https://gerrit.libreoffice.org/33574 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>