summaryrefslogtreecommitdiff
path: root/sc/source/core/data/documen7.cxx
AgeCommit message (Collapse)AuthorFilesLines
2021-04-09Recheck include/ with IWYUGabor Kelemen1-0/+1
See tdf#42949 for motivation Change-Id: Ifc253bf800bb1468b5774663a93f4fb30bec81d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113657 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-27tdf#42949 Fix new IWYU warnings in directory sc/Gabor Kelemen1-1/+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-16replace std::max(std::min()) with std::clampNoel1-2/+2
Change-Id: I890d19f5e2177294dc1175c90c98b964347f9e85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105751 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-23some places where ScDocument* is never passed a nullptrCaolán McNamara1-3/+3
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-07-30loplugin:flatten in sc/core/dataNoel Grandin1-24/+24
Change-Id: I9ffe58d68172c6fe9c76000c01c0c67a03967146 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99699 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-01Fix '..'Andrea Gelmini1-3/+3
To complete this: https://gerrit.libreoffice.org/#/c/78312/ This is a massive replace for lines ending with ".." instead of "..." It passed "make check" on Linux. Change-Id: I07fa7b2e30ba9ea17a1f9a5e21c57216ba958efe Reviewed-on: https://gerrit.libreoffice.org/78356 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2019-08-20loplugin:constvars in package..scNoel Grandin1-1/+1
Change-Id: Ibaa9ebd6440d9229ba313f4c130f5752d432b338 Reviewed-on: https://gerrit.libreoffice.org/77792 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-12loplugin:unusedmethodsNoel Grandin1-89/+0
Change-Id: Ie90e53583484ee4f378ec92634adf3be7cd9ecbb Reviewed-on: https://gerrit.libreoffice.org/70650 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-09Simplify containers iterations in sc/source/core/data/[b-d].cxxArkadiy Illarionov1-14/+10
Use range-based loop or replace with STL functions Change-Id: Ifb3c6a2fdcd32122a6fd371191b058117015c3ed Reviewed-on: https://gerrit.libreoffice.org/67588 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-08tdf#42949 Fix IWYU warnings in sc/source/core/data/*cxxGabor Kelemen1-8/+0
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I3e3bf3160fe3627cd105d8b69ff165c0577d8c9b Reviewed-on: https://gerrit.libreoffice.org/62807 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-01Add missing sal/log.hxx headersGabor Kelemen1-0/+1
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directory sc Change-Id: I988d7d3abaedfb32516a9db88815663bf54da46e Reviewed-on: https://gerrit.libreoffice.org/58266 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-16tdf#42949 Remove unnecessary localization headers from scGabor Kelemen1-2/+0
Found by searching for the header names and the localization function: git grep -l -e \<scresid.hxx\> -e \<strings.hrc\> sc | xargs grep -c ScResId | grep :0$ | grep -v /pch and git grep -l -e \<globstr.hrc\> sc | xargs grep -c GetRscString | grep :0$ | grep -v /pch since global.hxx contains so much more, it's omitted from this round. This also gives some false positives used in ErrorMessage() calls or just untranslated strings. Also translate some stray German comments Change-Id: Icfea2b2942d12c3c134d419cb7c9a84534c04a86 Reviewed-on: https://gerrit.libreoffice.org/52932 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-03-22loplugin:useuniqueptr in ScDocumentNoel Grandin1-3/+3
and fix bug where we were deleting a pointer to an object we did not own via pFormatExchangeList Change-Id: I488c679734c48bd21bc6be04837e037e97550647 Reviewed-on: https://gerrit.libreoffice.org/51668 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-21Add "mutation guard" API for ScDocumentTor Lillqvist1-0/+3
USe by adding a ScMutationGuard object to a section of code that shouldn't be run during threaded calculation of a formula group in any of the calculation threads. There are currently several "classes" of mutation as bits of ScMutationGuardFlags, althouh I am not sure whether that will be useful, so far I use just the one same (CORE) in all cases. Currently implemented using mutexes. Possibly a simple bool field in ScDocument would be enough, the multiple flags and mutexes might be over-complicating it? Maybe I misunderstood what I want. Add such mutation guards for some fields of ScDocument. Change-Id: If2a8223c49d36143f2984e0449798271f2b6440d
2017-11-07LimitRangeToAvailableSheets: check ValidTab() firstEike Rathke1-3/+5
That already includes BCA_LISTEN_ALWAYS which only needs to be checked if the ordinary tab check failed in case the definition changed. Change-Id: Ic31daf67f600b48b76406f07ba039462c5944170
2017-11-06ofz#4052 limit listener range to actually available sheetsEike Rathke1-2/+69
... instead of an arbitrary reference range read from a binary file format, here 4k sheets resulting in >3GB allocated listener memory. Change-Id: I629297f4249fdf16a0ede098b63d9648fda69ac3
2017-10-23loplugin:includeform: scStephan Bergmann1-18/+18
Change-Id: I2ed763e0584a188032c80fde60890de3c6985cbd
2017-09-14simplify calls to IsStreamValid/SetStreamValidNoel Grandin1-1/+1
just add a short-circuit check inside SetStreamValid, and we can simplify all of the call sites Change-Id: Ib3d19455c60fe9569faf548b1fefbc274d03574c Reviewed-on: https://gerrit.libreoffice.org/42267 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-24Resolves: tdf#93171 follow-up, notify dependents of subtotal formula cellsEike Rathke1-1/+2
Track ScHiddenRowsChanged collected cells and broadcast with ScDataChanged. Change-Id: Id41d2731585f6749533319bf42ad655a845ecf30
2017-08-22loplugin:constparam in sc part1Noel Grandin1-2/+2
Change-Id: I82fba7ebb3b4f018721642c96bbfa615c6a382c3 Reviewed-on: https://gerrit.libreoffice.org/41419 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-15Change HardRecalcState to enum classTor Lillqvist1-4/+4
Change-Id: I8b20ce6b58915c37e6d4caa11d2f4c724864a257
2017-07-03C++11 remove std::unary_function bases from functorsJochen Nitschke1-1/+1
std::unary_function is deprecated since C++11 and removed in C++17 90% done with regexp magic. removed obsolete <functional> includes. The std::unary_function base class was used in 3 places: * chart2/source/tools/DataSeriesHelper.cxx: lcl_MatchesRole is used in a std::not1 function helper who uses the members return_type and argument_type. - replace deprecated std::not1 with a lambda * chart2/source/tools/ModifyListenerHelper.cxx: lcl_weakReferenceToSame used the argument_type member in the operator() parameter. - inline the parameter type. * xmloff/source/chart/SchXMLExport.cxx: lcl_SequenceToMapElement used result_type and argument_type in operator(). - inline the types Also fix compile error with gcc about finding std::for_each. Change-Id: I073673beb01410c3108e7d0346d9e7d6b9ad2e2f Reviewed-on: https://gerrit.libreoffice.org/39358 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-06-30pBASM can be nullptr in copy docs, e.g. during insert sheet from docMarkus Mohrhard1-0/+3
Found through http://crashreport.libreoffice.org/stats/crash_details/3bd264ba-ec12-476a-9bb4-e832caca3445 Change-Id: I0a4e6dddca61a2538c0fe6bbc51770a9886c464d Reviewed-on: https://gerrit.libreoffice.org/39411 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-05-23drop the SCsROW/SCsCOL/SCsTAB typedefsNoel Grandin1-1/+1
which are exactly the same as the regular SCROW/etc typedefs, and have been this way since commit 43a21999a92c99867bc3417291719996776b0647 Author: Oliver Bolte <obo@openoffice.org> Date: Fri Jun 4 09:00:39 2004 +0000 INTEGRATION: CWS rowlimit (1.1.2); FILE ADDED Change-Id: Ia7f75d71227ca3167b5fd56019bb9bdf0697d1b0 Reviewed-on: https://gerrit.libreoffice.org/37911 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-01-09New loplugin:externvar: scStephan Bergmann1-2/+0
Change-Id: I6f9df997a957a1fa49161add2adafe228d036a30
2016-12-08convert SFX_HINT to scoped enumNoel Grandin1-5/+5
Notes (*) In SC, BULK_DATACHANGED was or'ed into the hint id. Replaced with a dynamic_cast check. (*) In SC, removed the hint id field from ScIndexHint, no point in storing the hint id twice (*) Fold the SfxStyleSheetHintId enum into the new SfxHintId enum, no point in storing two different hint ids (*) In some cases, multiple #define's used to map to the same SFX_HINT value (notably the SFX_HINT_USER* values). I made all of those separate values. Change-Id: I990e2fb587335ebc51c9005588c6a44f768d9de5 Reviewed-on: https://gerrit.libreoffice.org/31751 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-08Resolves: tdf#103701 bulk-broadcast the correct hint ID for formula groupsEike Rathke1-7/+7
BulkBroadcastGroupAreas() and BulkDataHint and thus FormulaGroupAreaListener::Notify() omitted to transport the actual hint and assumed SC_HINT_DATACHANGED, but SC_HINT_TABLEOPDIRTY needs to be handled as well. Change-Id: I765f7c95f7aeab295f35dcf6949a3b1926cbe248
2016-10-24Rename ClearFormulaContext() to make it more representative.Kohei Yoshida1-1/+1
In the future we might put more prep code in here, in addition to clearing the context data. Change-Id: I44256a0dfbe1301e2c1443b291f4635ca0ba80f5
2016-09-27sc-perf: avoid repeated TrackFormulas() during bulk broadcast, tdf#87101 rel.Eike Rathke1-0/+20
Multiple callers involved. Most significantly ScDocument::Broadcast() calls ScDocument::TrackFormulas() individually. Track/collect pending formula cells at the end of the bulk broadcast instead, which gives an instructions read speedup by factor 6 for the broadcast, and an overall speedup in the scenario for inserting the rows by factor ~2 wall clock time. ScDocument::InsertRows() Before, Ir Incl: 282,227,033,656 After, Ir Incl: 66,307,994,805 With cycle detection: ScDocument::TrackFormulas() Before: Ir Incl Ir Self 66,981,644,959 11,913,444,899 After: Ir Incl Ir Self 10,819,556,073 1,973,232,494 Change-Id: I85fe8b03ecb52cffaa6fa14354b3cc3467ecc111
2016-09-23perf: eliminate SfxSimpleHint and move to SfxHint, tdf#87101 relatedEike Rathke1-1/+1
There were over 150 places in *::Notify() functions that did some dynamic_cast<SfxSimpleHint*> of which ~98% were unnecessary because the base class SfxHint passed was an SfxSimpleHint anyway. dynamic_cast operations come with quite some cost, so avoid if possible. Specifically for ScFormulaCell::Notify() that created a bottleneck in scenarios where cells were notified that already handled a previous notification. In mass operations doing the dynamic_cast before it could be decided whether having to act on it or not this made 2/3 of all time spent in the Notify() call. To get rid of that rename/move SfxSimpleHint to SfxHint and let classes derive from SfxHint instead of SfxSimpleHint. This comes only with a slight cost that an additional sal_uInt32 is transported in such hints, initialized to 0, but this is neglectable compared to the huge gain. For the rare cases where a Notify() actually expects both, an SfxHint (formerly SfxSimpleHint) and a derived hint, this changed order of the dynamic_cast involved so the simple SfxHint::GetId() is handled last. Modules using such combinations can further optimize by treating the simple SfxHint::GetId() first once verified that none of the other derived hints use an ID not equal to zero respectively none of the ID values the simple hint uses. Change-Id: I9fcf723e3a4487ceb92336189d23a62c344cf0ce Reviewed-on: https://gerrit.libreoffice.org/29205 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-07-04Resolves: tdf#90285 during sheet copying the old sheets retain their old indexCaolán McNamara1-2/+2
at the point that ScDocument::CopyTab calls StartListeners so when void ScColumn::StartListening(sc::StartListeningContext& rCxt... calls rCxt.getBlockPosition(nTab) it calls it with the old nTab index in ScDocument::maTabs, so the return block position is not correct. Here I bubble down the requested ScAddress and use its Tab/Col/Row members rather than trust the members of the indexed-into elements Change-Id: I291e8c1146c2caa4d0976780b1ee6bcc41994e3c Reviewed-on: https://gerrit.libreoffice.org/26552 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2016-06-27SfxProgress::SetState always returns trueStephan Bergmann1-2/+0
Change-Id: Ib606b0391f814ea9ff4383397a40a8a692563fa3
2016-03-26switch to a listener based cond format update, tdf#95437Markus Mohrhard1-58/+0
Change-Id: Iaee665a37a9637c40cd02a89a19240ade6e5af37
2016-01-11loplugin:privatebase: Publicly derive from binary_/unary_functionStephan Bergmann1-1/+1
Somewhat arbitrarily prefer public over private derivation; ultimately, derivation from those deprecated (C++11)/removed (C++17) classes should be removed, anyway. Change-Id: I5ed24427d37586e72f8c16509cf5002a54af73f1
2015-12-27sal_uLong to sal_uInt32, ScHint relatedMatteo Casalin1-2/+2
Change-Id: I84402bf4b8d69ae350f6449cf4d1fd7c5c325f3c
2015-12-15Bin silly 'STATIC DATA' commentsTor Lillqvist1-2/+0
Change-Id: I50e3772b7b479d2cf1eb644c7334d0f987874ccb
2015-12-11geez, how about actually checking the Move() error return? tdf#92779 relatedEike Rathke1-1/+5
Handle failure condition where we know how to treat it, i.e. when updating references, assert in all other places that so far silently ignored it and implicitly assumed the failing Move() truncating at bounds would be alright. In case we'll encounter an assertion we'll have to inspect those places and decide what to do about it. Noticed this error with a reference like B1048575 and inserting two rows above, it became B1048576 instead of B#REF! Change-Id: I00757f3ed2e305b591178047933ed60f1533317e
2015-11-13cppcheck: noExplicitConstructorCaolán McNamara1-1/+1
Change-Id: Ife26f55c28c4631aec4ba4105225bfca72da8bff
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann1-10/+10
Change-Id: I765d2a600f9c57da50c85354688e3ae796750d94
2015-10-30tdf#95419 fix performance fall-out, tdf#92749 follow-upEike Rathke1-1/+1
Commit 1bea8310747b65516f40f6457ab1d174ef7ddce4 erroneously introduced a hard recalc of all formula cells if ScDocument::CalcFormulaTree() was called only for forced RecalcModeForced formula cells during load when HardRecalcState is HARDRECALCSTATE_TEMPORARY through ScDocShell::AfterXMLLoading() -> ScDocShell::SetDocumentModified() if aDocument.IsForcedFormulaPending() Change-Id: Ib6b9ac07fa183adf26fdb56dcee029ee2b9cc5da
2015-10-02Revert "Make fewer calls to officecfg::...::UseOpenCL::get()"Tor Lillqvist1-4/+2
Was not liked. This reverts commit e4ddba2b5f8ff32dd35e8c8f66f145597407be42. This reverts commit ab092bdc0f8c45e174cad403de9d2342adc01fb6. Change-Id: If2e9e032a135530da92b5bd166f5b559b10b0b91
2015-10-02Add missing includeTor Lillqvist1-0/+1
Change-Id: I5e9d5b63bf18caa89565270c1630e1c8431c8630
2015-10-02Make fewer calls to officecfg::...::UseOpenCL::get()Tor Lillqvist1-2/+3
Change-Id: I5f7f52b6f2fb92c46e2b24e0edf95b4ccd17671d
2015-09-22convert SC_SHEETEVENT to scoped enumNoel Grandin1-1/+1
Change-Id: I472e3f0a78f979bcf8333076f7560ebb7dd859d6 Reviewed-on: https://gerrit.libreoffice.org/18767 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-08-18introduce temporary hard-recalc state, tdf#92749 follow-upEike Rathke1-4/+4
This allows listeners to be setup and initial lookup caches to be kept, which were thrown away after the initial calculation as an interim fix for tdf#92749. Change-Id: I34068b3f6b833a46f3c526579efbdc342a2e71df
2015-08-14loplugin: defaultparamsNoel Grandin1-1/+1
Change-Id: I807ce811f5988d6134b4c6f73408cd034f25a7f7
2015-07-09execute the terrible bottle neck loop only if there are conditional formatsEike Rathke1-1/+4
Change-Id: Ic8bd65a728289c9fa1a0721b0ecbd9b4a48672ca
2015-07-09simplify the logic a littleEike Rathke1-16/+12
Change-Id: I8ff2bc971fd1ab7acf6c416ae85a03152ca2a3d9
2015-07-09Resolves: tdf#84762 collect all recalc-always cells before setting any dirtyEike Rathke1-6/+14
Change-Id: I38f69bcbb9eb550fb97b0f84bc0cb486863060b4
2015-04-08convert RECALCMODE_ constants to scoped enumNoel Grandin1-1/+1
Change-Id: Ice2e45a3db59adc34a160b4b410cc51c750835f2