summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/cellsuno.cxx
AgeCommit message (Collapse)AuthorFilesLines
2021-10-09Typo *ropertie -> *ropertyJulien Nabet1-1/+1
Change-Id: Id5ae03140ac4fd67bf4940569ac5cd2f15716749 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123306 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-09-24no need to allocate this SfxItemSet on the heapNoel Grandin1-9/+17
Change-Id: I4982d075f21f74b3d0db1c61a499dceb92e50c87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122575 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-15Use <comphelper/servicehelper.hxx> implementing XUnoTunnel part 1Mike Kaganski1-18/+18
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-09-01clang-tidy:readability-redundant-member-initNoel Grandin1-2/+1
Change-Id: I8553b1e2b1c3461fa55eb19593b1a97ed9e7ab1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121433 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-13split SvNumberFormatter into it's own headerNoel Grandin1-0/+1
so I can make changes without running into cyclic dependencies between header files Change-Id: I98a91c7cc66002ba745cdb8239e5cc267922a45c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120412 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-12tdf#95549 speed up xls openNoel Grandin1-87/+58
Remove the m_wThis field, and instead just check the ref count to know if we are being called from our own destructor. Also re-order ScCellRangesBase::Notify so we do the cheap checks first. This shaves 2% off the load time Change-Id: Ie95a4ff46bacba583ec4b3a934f98a9aac3551b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120385 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-11Drop convertMm100ToTwip in favor of the new o3tl::toTwipsMike Kaganski1-6/+6
Step by step, duplicates from <tools/UnitConversion.hxx> may go Change-Id: Id4c03ff8adc120ae06dbfdbdfb4f5ff0bb51f489 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120315 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-08-02convert #defines to OUStringLiteralNoel Grandin1-9/+9
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-07-19no need for pimpl in ScCellRangesObjNoel Grandin1-43/+18
Change-Id: If5f32a3d0eebf739187f3ce2efb69198e8baf8a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119203 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-11Simplify Sequences initializations (sc)Julien Nabet1-7/+7
Change-Id: I0c581b3a900a6b89c0f4e203310d65600545987f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116929 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-05-13inline some typedefsNoel Grandin1-3/+1
Change-Id: I1608e03ff9f6fbc55987010e88897e034b690b3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115552 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-02throw() -> noexcept, part 2/3: Automatic loplugin:noexcept rewriteStephan Bergmann1-10/+10
Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114949 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-04-27loplugin:moveoptNoel Grandin1-2/+1
An attempt that did not find anything convincing enough to finish it up and make it permanently active. So just leave it in /store for now. Change-Id: I1750e177655a4a510da100f880ba81bf762be277 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114742 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-04-15store ptr to the original entries in SfxItemPropertyMapNoel Grandin1-30/+30
instead of copying them to a new data structure that is practically identical. Helps startup time since we build a ton of these when loading documents. And use o3tl::sorted_vector as a dense map data structure to reduce allocations and improve cache friendliness, since this is a build-once thing. Change-Id: I950be03b1a21c0c81c40f2677d4215f5e8e256cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114015 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-03loplugin:refcounting in scNoel1-1/+1
Change-Id: I0b808785e54bf1dfc9387a649aacf731b2f34d12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111801 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-21loplugin:refcounting in scNoel1-9/+8
Change-Id: Id0ba24985aab36b931fa74b266dc5bf0bef62bb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111273 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-15loplugin:referencecasting in scNoel1-1/+1
Change-Id: I908c0d5a2a3360bb9c9c9edf925a485411515ea2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110816 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-11loplugin:refcounting generalise type checkingNoel1-2/+2
Change-Id: Ia013878ac9c2918d8eaf9aab16b291d8211e708f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110700 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-05Make sanitiseMm100ToTwip simpler and more correctMike Kaganski1-9/+9
The result's absolute value is always smaller than n. Returning an uncorrected value taken from reversing multiplication and division order when intermediate value would overflow is better than arbitrary constant. Also further deduplicate Twips <-> 100th-mm conversion, and make sure they all are in a single header. Using conversion implementation that handles negatives correctly improves accuracy, as seen in unit tests; e.g. in testPictureEffectPreservation (the original doc had "dir" equal to "8100000", while we tested that it was "8076614" after roundtrip). Change-Id: Icd027af6238a9f45f916f53f8684506cc959e696 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110433 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-04have one set of twips<->mm conversionsNoel1-3/+1
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-01-16make the Color constructors explicitly specify transparencyNoel1-6/+4
to reduce the churn, we leave the existing constructor in place, and add a clang plugin to detect when the value passed to the existing constructor may contain transparency/alpha data. i.e. we leave expressions like Color(0xffffff) alone, but warn about any non-constant expression, and any expression like Color(0xff000000) Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-02introduce Degree100 strong_int typeNoel1-4/+4
Change-Id: I78f837a1340be0ca5c49097f543a481b7b43a632 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108367 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann1-1/+1
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-12-01OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTIONNoel1-2/+3
Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-27tdf#42949 Fix new IWYU warnings in directory sc/Gabor Kelemen1-2/+0
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-24loplugin:stringviewparam extend to comparison operatorsNoel1-2/+2
which means that some call sites have to change to use unicode string literals i.e. u"foo" instead of "foo" Change-Id: Ie51c3adf56d343dd1d1710777f9d2a43ee66221c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-06tdf#134161: Revert "tdf#132137 Rename Default Style in Calc."Xisco Fauli1-2/+2
This reverts 4111ed76906bf6be05b704bf52fa91353dfef183 the document would also hang if define STR_STYLENAME_STANDARD NC_("STR_STYLENAME_STANDARD", "Default"); is replaced by define STR_STYLENAME_STANDARD NC_("STR_STYLENAME_STANDARD", "DefaultTest"); meaning somewhere in the code 'Default' is harcoded as git grep "\"Default\"" sc/source/ shows Reverting for now so we can backport it to libreoffice-7-0 while a better solution is provided for tdf#132137 Some other problems of the reverted commit are mentioned in comment 4 and comment 5 of tdf#134161 I'm adding a unittest in another commit so this one can be easily reverted in the future Change-Id: Ib7c4a99ff4957eba7ec0b644e989c7a08b46f2a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105381 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-10-30convert some tools::Long->sal_Int32Noel1-15/+15
in places where it is obvious we only need a sal_Int32, because we are dealing with rows and columns, and not even calc needs more than 32 bits for that. Change-Id: I114417e639c224d45bfd9fc6838122ab195eefa3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104584 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-20use tools::Long in scNoel1-18/+18
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-10-13static_cast after dynamic_castNoel1-16/+11
Change-Id: I53e10fbebfd07c471ddd9b264562317251700500 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104225 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-30loplugin:reducevarscope in scNoel1-2/+1
Change-Id: If88c71351fb157b8eab242fceb65422f05eec3d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103645 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-25change pointers to references where never possible to be nullptrsCaolán McNamara1-4/+4
and drop some null checks then shown not to be needed Change-Id: I2806eeb64f43072a34aecd46424dbd063a119b7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103356 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-24some places where ScDocument* is never passed a nullptrCaolán McNamara1-8/+8
Change-Id: Ie06fef80990b539d5b6cc87c80d9bbd3e851766c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103299 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-24ScCellFormat::GetString never called with a null ScDocument*Caolán McNamara1-14/+14
and similar, allowing a few redundant null checks to be dropped Change-Id: Ice0d6d57df112a09d3e1af3d34126b3519529daf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103278 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-23some places where ScDocument* is never passed a nullptrCaolán McNamara1-1/+1
and so some nullptr checks can be removed Change-Id: I7dedc2c6d054d9749db9766eaa3a5681842b2b69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103239 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-18ScCellValue::getString never called with a null ScDocument*Caolán McNamara1-1/+1
Change-Id: Idff982e715b012e35e0abd0b904f4b83d7f6f51a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103007 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-18ScCellIterator never passed a null ScDocument*Caolán McNamara1-10/+10
Change-Id: I5d8ea1533fe861cf969c2999343da217c82d54e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103006 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-16ScFormulaCell ctor variants never called with null ScDocument*Caolán McNamara1-1/+1
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 McNamara1-1/+1
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-15ScRangeList::ParseAny ScDocument* argument dereferenced on all used pathsCaolán McNamara1-2/+2
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-15ScRangeList::Parse ScDocument* argument dereferenced on all used pathsCaolán McNamara1-1/+1
so nDefaultTab is always used (in ScAcceptChgDlg::FilterHandle pDoc might possibly be null, but that doesn't seem possible in practice) Change-Id: I39ec7f7f96fa2421f492c9e73659abdfba21c3f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102666 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-14CreateValidationData never called with a null ScDocument*Caolán McNamara1-1/+1
Change-Id: I4681e7ede552575913e06311b7cd23fad4c56be6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102610 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-14FillFormat never called with a nullptrCaolán McNamara1-1/+1
Change-Id: Ibcadbe7b4d5caf6542f87c800ec92c61225e55de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102606 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-13ScFormulaCell ctor variant always dereferences its ScDocument argCaolán McNamara1-1/+1
Change-Id: Ibf626d52cc7a5968c60a3ec1ea2b34e0331b7ef2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102589 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-13ScTokenArray ctor always dereferences its ScDocument* argCaolán McNamara1-3/+3
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-09-13MakeRangeFromName never passed a null ScDocument*Caolán McNamara1-2/+2
Change-Id: Ie9de24e4be10efb071139f02576058cee512bc7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102579 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-28Change OUStringLiteral from char[] to char16_t[]Stephan Bergmann1-628/+628
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-14loplugin:simplifybool moreNoel Grandin1-2/+2
look for expressions like !(a && !b) which can be expanded out Change-Id: I72515a9638762b050f9a258c08da39ebfa2ef8e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-13use OUStringLiteral in SfxItemPropertyMapEntryNoel Grandin1-628/+628
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-1600/+1600
Change-Id: I9b03672387aa555eb11149763a1113e0768f3f37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100398 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>