summaryrefslogtreecommitdiff
path: root/sc/source/core/data/column3.cxx
AgeCommit message (Collapse)AuthorFilesLines
2019-06-27Resolves: tdf#126116 keep original date format if detected type is identicalEike Rathke1-5/+17
Regression from commit 478e051f4ea13b15120fdf74faf94a6c2cfcb50c CommitDate: Tue May 21 15:35:07 2019 +0200 Resolves: tdf#125109 prefer edit format's acceptance patterns and YMD order Change-Id: If1240f75ca7c4d46c156966a72b6a98c83448770 Reviewed-on: https://gerrit.libreoffice.org/74803 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit e6a1bbe6690474e752416c81e1ca8c82b2843539) Reviewed-on: https://gerrit.libreoffice.org/74806
2019-05-21Resolves: tdf#125109 prefer edit format's acceptance patterns and YMD orderEike Rathke1-3/+49
Change-Id: I4036061b9e8f01d99f04f20dfbbd2cf23d3a9b59 Reviewed-on: https://gerrit.libreoffice.org/72632 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-05-20cache mdds positions also in CopyTextAttrsFromClipHandler (tdf#112000)Luboš Luňák1-6/+25
This is basically just a copy&paste from CopyCellsFromClipHandler. Change-Id: I4abd39923cb933e73d73938a8d38913b5e5382a0 Reviewed-on: https://gerrit.libreoffice.org/72423 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-14cache cell positions when searching in calc (tdf#108347)Luboš Luňák1-5/+2
The document has a large number of rows, and mdds normally always searches from the first item when looking up the container position, which leads to a quadratic cost when searching the entire sheet. GetCellValue() already has a variant that caches the last position, so just use it (and make sure to invalidate if it's search&replace and something changes). Change-Id: I26da60cebf641e10ed92e548fe5f9016900d3cf0 Reviewed-on: https://gerrit.libreoffice.org/72290 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-04-21tdf#81765 slow loading of .ods with >1000 of conditional formats, part 3Noel Grandin1-1/+1
This takes the loading time from 14s to 13s Use a o3tl::sorted_vector to reduce searching time Change-Id: I947a3e5001fe1058cf9bffc9509d026af4122ef4 Reviewed-on: https://gerrit.libreoffice.org/71035 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-28tdf#120660: Populate rNewSharedRows even if no FC...Dennis Francis1-14/+52
at specified position. At least in case of ScUndoPaste, during undo operation, the content from changed area in main-document is removed before actual undo-paste, so when cloned formula-cell from undo-doc is inserted to main-doc, there is no "old" cell to detach, so "rNewSharedRows" is not populated which is needed for proper re-establishment of listeners if there are formula/ formula-groups adjacent to insertion position. Change-Id: Id2bfb65a2a7a5abb03effbdcc4405015fddc401c Next: fix the vector version of this case and write unit tests. Reviewed-on: https://gerrit.libreoffice.org/69737 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2019-03-27return unique_ptr from CreateAttrIteratorNoel Grandin1-2/+2
Change-Id: Ib990282abcd3a75bfb6bdd42b5e16d6e673f71b1 Reviewed-on: https://gerrit.libreoffice.org/69783 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-18Listening when grouping in ScColumn::AttachNewFormulaCells(), (tdf#123736)Eike Rathke1-8/+41
Not directly related to tdf#123736 but similar approach. Setting a vector with ScColumn::SetFormulaCells() is currently only done for Undo documents, but implementation provided listening as only single cell listening for not-undo/clip documents, which wouldn't work if actually used in grouping context. The upcoming unit tests will use SetFormulaCells() for checks. Change-Id: I990e6a5d6e1efcf70a2661b3a9a39c37d9e4c2e6 Reviewed-on: https://gerrit.libreoffice.org/69371 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-03-17Reget position_type as the block or type may have changed, tdf#123736 relatedEike Rathke1-0/+3
Change-Id: I2faf3e74d95cb1f3088f20cbb7de7ba965a6de21 Reviewed-on: https://gerrit.libreoffice.org/69358 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-03-16Related: tdf#123736 re-establish listeners also for vector unsharingEike Rathke1-9/+102
... via DetachFormulaCells() Change-Id: Ia57308495a06e0df612eb1610b5f387d6b60ce08 Reviewed-on: https://gerrit.libreoffice.org/69320 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-03-15In case of sc::NoListening only SetNeedsListeningGroup(), tdf#123736 follow-upEike Rathke1-5/+19
Change-Id: I3e5a5334dfe11002b526f942463626b62efbc340 Reviewed-on: https://gerrit.libreoffice.org/69303 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-03-13Resolves: tdf#123736 re-establish listeners for unshared formula groupsEike Rathke1-27/+124
... when replacing one of their formula cells, with another formula cell or any other cell, passing through DetachFormulaCell() Change-Id: Id527307ef5278d87345c6dbfab9d05cb490dfe6c Reviewed-on: https://gerrit.libreoffice.org/69221 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2019-03-13const correctnessLuboš Luňák1-2/+2
Change-Id: Ifcc5cfb8d66ae77bdf54b1a5457590c92a3fe093 Reviewed-on: https://gerrit.libreoffice.org/69088 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2019-02-23loplugin:unusedfields in scNoel Grandin1-1/+0
Change-Id: I5e9842970821d0ae61e06e3ad35c9f571b43632c Reviewed-on: https://gerrit.libreoffice.org/68224 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-25/+20
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/+1
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-10-16coverity#1440303 use emplace_back instead of push_backCaolán McNamara1-2/+2
Change-Id: I51457423fdd8d39b5c11d02b450d31fa59127952 Reviewed-on: https://gerrit.libreoffice.org/61840 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-15loplugin:constfields in scNoel Grandin1-22/+22
Change-Id: If326175d571d15752efd1b63df45b2bc785f7541 Reviewed-on: https://gerrit.libreoffice.org/61653 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-14loplugin:returnconstant in ScColumnNoel Grandin1-2/+1
Change-Id: I105d07da6e1a9259a7b833a1259c0e992e35a03d Reviewed-on: https://gerrit.libreoffice.org/58954 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-01forcepoint#55 invalid iterator incrementCaolán McNamara1-0/+2
Change-Id: I151602f645a48404d93e0ae64a9e1d2a6ba2bc4b Reviewed-on: https://gerrit.libreoffice.org/58384 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-06-30Removed duplicated includeAndrea Gelmini1-1/+0
Change-Id: I0585ba137dbd3a27ccf88d75974dc79c34e4ef85 Reviewed-on: https://gerrit.libreoffice.org/56582 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-06-28tdf#42949 Fix IWYU warnings in include/osl/*hGabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ib2301526d7aa6982af6c8c79ed7e9a4c34b7bbf7 Reviewed-on: https://gerrit.libreoffice.org/56491 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-27use optional ScInterpreterContext in ScColumn::GetString()Luboš Luňák1-3/+4
Otherwise calc's threading asserts with fdo#37765-1. Change-Id: Ic2500f2218bf62c4d05f1c5284e62a53c0598b53 Reviewed-on: https://gerrit.libreoffice.org/56484 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-06-26tdf#42949 Fix more IWYU warnings in sc/inc/d*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes These were quite a bit entangled with each other thus a lot of fallout management was necessary. Also try harder to use fw declarations in files already checked Change-Id: Ia69c3a0d66ec2763ac03094aaa1b646a290d3cfa Reviewed-on: https://gerrit.libreoffice.org/56361 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-06-11tdf#114710 : Fixes crash when pasting as GDI metafileDennis Francis1-5/+9
The bug document has a formula cell (at O7) that depends on cells with non-default number formats, but this cell's number format was force set by the user to the default. So the mbNeedsNumberFormat for this ScFormulaCell object is now false. But when a copy to clip and paste as GDI metafile is made, this subtle information about the "user forced default number format" is lost. ScColumn::SetFormulaCell() is used while making the copies of the original formula cell to clipdoc and then to another document, where it sets the field mbNeedsNumberFormat of the formulacell to true if the number-format of the target cell is default. Note that the number-formats along with all attributes of the target cells are copied from the source before copying the actual cell contents. As a result, after copy pasting, the formulacell at O7 of the new document will have mbNeedsNumberFormat = true. This causes the attribute modification (in ScAttrArray of corresponding column) while Interpret()'ing the cell. Unfortunately this Interpret() happens while in a call to ScRefCellValue::hasNumeric() while in the middle of rendering the cell of the new document (in ScOutputData::LayoutStrings()), and naturally this messes up the ScPatternAttr references the view has been caching, hence the crash. The steps involved in the fix are :- 1. Carry around the state of mbNeedsNumberFormat in the copy-constructor of ScFormulaCell, in case the src formula-cell is not yet Interpret()'ed. Note that after Interpret() is done, the mbNeedsNumberFormat is set back to false and inherited numfmt is applied to attributes data structure. 2. In ScColumn::SetFormulaCell(), allow an optional param bInheritNumFormatIfNeeded (default = true). In that method, the mbNeedNumberFormat is set to true only if this flag is true and the cell format is default. So when the copy/paste operation is going on, we pass the mbNeedNumberFormat of the source formula-cell for the new parameter to SetFormulaCell(). Change-Id: I535e413d4bde4c33a5f6ad3ce01536d0e94e7074 Reviewed-on: https://gerrit.libreoffice.org/55555 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2018-05-22tdf#42949 Fix IWYU warnings in sc/inc/formularesult.hxxGabor Kelemen1-0/+1
Found with bin/find-unneeded-includes This one caused lots of fallout, manage it separately Change-Id: Idf153caa07b1edd85352609806f5b8b74fc6ead8 Reviewed-on: https://gerrit.libreoffice.org/54410 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-11pass EditTextObject around using std::unique_ptrNoel Grandin1-6/+6
Change-Id: I71f4529c2e02fd0ac2561191e4cb35e18e206037 Reviewed-on: https://gerrit.libreoffice.org/52682 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-27tdf#106667 Hang when trying to open a dialog and the whole sheet is selectedNoel Grandin1-3/+3
regression from commit 8d54796bf152499ecbe61788be64c9035f725dfa (patch) enhance pass-by-ref plugin to detect large arguments which converted this peice of code into an O(n^2) loop Change-Id: I0473a084518c0d10411615e1b3901b9b90144bc9 Reviewed-on: https://gerrit.libreoffice.org/51956 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
2018-03-27forcepoint #31 check validity of another group rangeCaolán McNamara1-0/+2
Change-Id: I82ff3e47a033c91581b108e1685b1ff4d5865895 Reviewed-on: https://gerrit.libreoffice.org/51881 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-26forcepoint #30 check validity of group rangeCaolán McNamara1-0/+2
Change-Id: Ie0611f36809b051ce46030e44c137b4e1f8d2fe0 Reviewed-on: https://gerrit.libreoffice.org/51856 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-03-22loplugin:useuniqueptr in ScColumnNoel Grandin1-2/+2
Change-Id: If2f8e1f730fabaf124e515dbe58ec5d755d1e57b Reviewed-on: https://gerrit.libreoffice.org/51667 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-13Handle ScSetStringParam::mbCheckLinkFormula in ScColumn::ParseString()Eike Rathke1-3/+7
Change-Id: Id6b0705140baacdb872560f7031efaf0c03f0e00
2018-02-03TypedWhichId in scNoel Grandin1-5/+5
Change-Id: I43558191f65bfb07abfbc92970629d5dd561a04e Reviewed-on: https://gerrit.libreoffice.org/49141 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12More loplugin:cstylecast: scStephan Bergmann1-1/+1
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-12-24sc: compact ScColumnAshod Nakashian1-60/+65
Remove ScDocument* member from ScColumn and re-use the one in ScAttrArray. This saves 8 bytes and makes the code more homogenious by using GetDoc() member everywhere. (cherry picked from commit 1168a11278ed3c2a00058e1f802f6e44cb925318) Reviewed-on: https://gerrit.libreoffice.org/46680 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit dc3f0bde0bdef2a1e94055be146b433cb9fc54ba) Change-Id: I16a94b7ef7c45ef3af14e812b45f255f39939a6e Reviewed-on: https://gerrit.libreoffice.org/46990 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2017-12-19wrap scoped enum around css::util::NumberFormatNoel Grandin1-11/+11
Change-Id: Icab5ded8bccdb95f79b3fa35ea164f47919c68fa Reviewed-on: https://gerrit.libreoffice.org/46339 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-12-07loplugin:constparamsNoel Grandin1-1/+1
Change-Id: Ia322ecf8f80b28c58ec33d17ca9607401a92534b Reviewed-on: https://gerrit.libreoffice.org/45959 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-24consistently use sal_uInt32 for number formats in scNoel Grandin1-4/+4
instead of a mix of short/sal_uLong/sal_uInt32 Change-Id: Ie5bd26e1a6f716c0c4e174a6d560827084b3f421 Reviewed-on: https://gerrit.libreoffice.org/45159 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-23TypedWhichId create custom get methods in ScPatternAttrNoel Grandin1-2/+2
Change-Id: Iaa326332f5806477dd81463e6b6004a962bac934 Reviewed-on: https://gerrit.libreoffice.org/45128 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-21Invert logic of ScSetStringParam::* enum value checks, tdf#103234 follow-upEike Rathke1-2/+10
In preparation for adding a new enum value to keep existing formatting in any case. Change-Id: Ic15a900adba0281d1267d95f821e1e898f80f566
2017-11-21Introduce ScInterpreterContextTor Lillqvist1-9/+9
Possibly later things that need to be thread-local can be handled through the ScInterpreterContext. Why handle some thread-local things through the ScDocument::maNonThreaded and ScDocument::maThreadSpecific mechanism, and others through this ScInterpreterContext? Good question. Share SvNumberFormatter across worker threads and use mutex to protect SvNumberFormatter::IsNumberFormat() Change-Id: I372e5fbd9a19785f55f0faf4a4bedc5fc1ef3e03
2017-10-27Handle decimalSeparatorAlternative in ScColumn::ParseString(), tdf#81671Eike Rathke1-2/+4
Change-Id: I9f708b28ee5fdb23217e75386a64ab86dacfd3c4
2017-10-27Let LocaleDataWrapper::getLocaleItem() return LocaleDataItem2&, tdf#81671Eike Rathke1-3/+3
Change-Id: I16cfe81dd3ce0c8c2e905d55bea13df134c7a398
2017-10-23loplugin:includeform: scStephan Bergmann1-28/+28
Change-Id: I2ed763e0584a188032c80fde60890de3c6985cbd
2017-09-08sc-perf: do not add a million empty filter entries just to sort and discardEike Rathke1-15/+17
Which can happen if an (anonymous) database range as filter range was selected to span an entire column of which most (the tail) is empty cells. The entries are processed to be unique anyway. This significantly shortens the time to display the filter dialog. Happened with attachment http://bugs.documentfoundation.org/attachment.cgi?id=136074 of bug https://bugs.documentfoundation.org/show_bug.cgi?id=112258 Change-Id: Ia169911d6f23611a3b3ecbf291757465f1998210 Reviewed-on: https://gerrit.libreoffice.org/42118 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-08-22loplugin:constparam in sc part1Noel Grandin1-1/+1
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-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-26loplugin:oncevar in scNoel Grandin1-2/+1
Change-Id: Ice59e286debb6bd0eb692f2b2b0c2c5087c069c0 Reviewed-on: https://gerrit.libreoffice.org/39239 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-13Use FormulaTokenArray::FirstToken() in one more placeTor Lillqvist1-1/+1
Change-Id: I5b8e8997586255004820df97f1ea10494b536d3b
2017-06-07Take new FormulaTokenArrayPlainIterator into use in one more placeTor Lillqvist1-2/+3
Change-Id: Idd92333d6c07748a2ae25f0124465d56b2302fbf