summaryrefslogtreecommitdiff
path: root/sc/source
AgeCommit message (Collapse)Author
2018-09-06clang-tidy performance-unnecessary-value-paramNoel Grandin
Change-Id: I69247498e13331f6ef84afeb242479f8fb1178a8 Reviewed-on: https://gerrit.libreoffice.org/60068 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-06tdf#116453: One less argument to pass to ScOrcusStyles.Kohei Yoshida
You can access ScDocument via ScOrcusFactory. There should be no functionality change. Change-Id: Ia679b6b006cc60bf24ca11432909682fa527b034 Reviewed-on: https://gerrit.libreoffice.org/60063 Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> Tested-by: Kohei Yoshida <libreoffice@kohei.us>
2018-09-05Added Replace Null Transformation in data provider dlgManuj Vashist
Change-Id: I5e1541e87f1eabd1bf564c7a8c6721377b51cffe Reviewed-on: https://gerrit.libreoffice.org/58911 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2018-09-05Resolves: tdf#118850 disentangle the twisted wrong cell type vs format typeEike Rathke
Change-Id: Idb5267c9bc50e8844654c2f2cd0d123fcbb7aa12 Reviewed-on: https://gerrit.libreoffice.org/60026 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-09-05tdf#117287 When saving as Xlsx, export visible flag if comment is visbleIlhan Yesil
The visible flag will be exported now, when a comment is visible and the file is saved as Xlsx. Change-Id: Id05ab5f94ea85f48db123d1043ecdc4813a64382 Reviewed-on: https://gerrit.libreoffice.org/59934 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2018-09-05clang-tidy performance-inefficient-vector-operationNoel Grandin
Change-Id: Iebcaea7b08c5284946d83b6b6b9ed26b218025d4 Reviewed-on: https://gerrit.libreoffice.org/59992 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-05tdf#116453: Pick up non-UTF8 encoding and use it for string values.Kohei Yoshida
Change-Id: Ibb0455359ad41871e86a8858f6fe0c5b834bcb13 Reviewed-on: https://gerrit.libreoffice.org/60013 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
2018-09-04tdf#42949 Fix IWYU warnings in sc/source/filter/inc/[a-l]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I92cfd8d09ca8229764db4200568b96a62e2ab21e Reviewed-on: https://gerrit.libreoffice.org/59742 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-09-03tdf#37268: use also sheet local range in PivotJulien Nabet
There are 2 types of range names: - those global to the document - those specific to a sheet Before this patch, Pivot could only see global range names There are 2 parts on the patch: 1) ScCellShell::ExecuteDataPilotDialog() Retrieve all the range names and use: - for sheets range names: <scope>.<range name> - for global range names: <range name> 2) ScSheetSourceDesc::GetSourceRange() Search about the presence of . to know if it's a global or sheet name range Change-Id: I92ac321e1475516cce7ee42b6e6038c231d0514b Reviewed-on: https://gerrit.libreoffice.org/58070 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-09-03loplugin:useuniqueptr in various in scNoel Grandin
Change-Id: I47eb6ea14495a3f21fd008f8b8716c30effde985 Reviewed-on: https://gerrit.libreoffice.org/59924 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-03ofz#10189 check container sizeCaolán McNamara
Change-Id: Ie99e3b082795989290799d057a99b1bcff94b161 Reviewed-on: https://gerrit.libreoffice.org/59911 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-09-03tdf#99296 - Disable headers/footers by defaultheiko tietze
Change-Id: I9232c879cebdcb92236322e4d4a12048d9fec00f Reviewed-on: https://gerrit.libreoffice.org/59696 Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
2018-09-03cppcheck: knownConditionTrueFalseJochen Nitschke
Change-Id: I6ee2dd049b2482d93b5d05754c11b34bf535e377 Reviewed-on: https://gerrit.libreoffice.org/59907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-03pass SdrUndoAction around by std::unique_ptrNoel Grandin
convert the LINK we use here to std::function, since LINK does not currently handle std::unique_ptr Change-Id: I9df80352e612445e5f5ca513d7d4196d65589778 Reviewed-on: https://gerrit.libreoffice.org/59804 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-01Fix typosAndrea Gelmini
Change-Id: I886178782ebfaaa90b7b14be529210dcbee4dd7a Reviewed-on: https://gerrit.libreoffice.org/59883 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-09-01Update orcus to 0.14.0.Kohei Yoshida
And make all necessary adjustments for the new version of orcus. Change-Id: I0dc207162a3ddfaad6da198a3d13b65f530757d5 Reviewed-on: https://gerrit.libreoffice.org/59884 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
2018-08-31tdf#42949 Fix IWYU warnings in sc/source/core/opencl/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I95f5ba3a4b6f72262e2fa39cb02c9d8e8f1efdd9 Reviewed-on: https://gerrit.libreoffice.org/59743 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-31tdf#117781: don't remove already applied conditional format dataMike Kaganski
... when deduplicating; only add new range. Check not to add the same conditional format to a range more than once. Change-Id: I0702b8e1462784cc71666ddfa6442a2827f00af5 Reviewed-on: https://gerrit.libreoffice.org/57725 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-08-31use std::unique_ptr in various sc undo codeNoel Grandin
Change-Id: I7906f4e78336d3b738ea3409838ce3404e7f5c30 Reviewed-on: https://gerrit.libreoffice.org/59796 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-31properly reset nSeenInIteration when iterating cell cyclesLuboš Luňák
ooo#956-3 has a somewhat complex cell cycle structure. Calc detects cycle G40, H40, H47, H37, D40 -> G40, marks these cells as bIsIterCell, adds them to the list of cells in RecursionHelper and starts iterating. However, there are more cells involved, e.g. there's another cycle D41, G41, H41, H47, H37 -> D41, which Calc doesn't detect (probably because it partially overlaps with the detected cycle). This means that InterpretTail() was setting nSeenInIteration for every involved cell, but it wasn't unset, because some of the cells weren't know to be part of the iteration. And so on the next recalc, these cells weren't interpreted, because Interpret() aborted early because of the stale nSeenInIteration value. And in threaded calculation, this eventually led to hitting an assert in MaybeInterpret(). And obvious fix for this is to set nSeenInIteration only for cells that Calc treats as being part of the iteration. Which is what this commit does. That's however not a complete fix. Doing a recalc with ooo#956-3 now at least gives somewhat sensible values, but it needs repeated hard recalcs to actually reach the correct values that converge, or the delta change in the iteration settings need to be (needlessly) small, 1E-6, while Excel manages with just 1E-2. So what also should be done is probably detecting all cells involved in the cycle and treating them as such. Change-Id: I05fd149b453363c335f1f5d5d3748354ae624613 Reviewed-on: https://gerrit.libreoffice.org/59495 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-08-31tdf#112454 Also consider last SCTAB in loopMichael Weghorn
Since 'rRange.aEnd.Tab()' is valid, it needs to be included in the loop to get a valid result. Change-Id: I7b2447e059dc03444c56e7fc0b113e1b618dd510 Reviewed-on: https://gerrit.libreoffice.org/59798 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2018-08-31tdf#73078 Let 'Type()' return '1' for empty cellsMichael Weghorn
Quote from tdf#73078: > The function TYPE is specified with the Syntax: > TYPE( Any value ) and the rule "If a Reference > is provided, the reference is first dereferenced, > and any formulas are evaluated." > [ODF1.2 part2 section 6.13.33 TYP] > > Because of argument type "Any" the function cannot result > in an error. Gnumeric, Apache OpenOffice, and Excel return > the number 1 in this case. Therefore, have LibreOffice return 1 as well, rather than having an "Err:502" ("Error: Invalid argument"). Change-Id: I1e679645e7b2e70e185574f805cd410b0508cbd8 Reviewed-on: https://gerrit.libreoffice.org/59826 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-08-31pass ScDBData by std::unique_ptrNoel Grandin
Change-Id: Ia16bde5b428be6a39ff7e3f6052258652ea0f07a Reviewed-on: https://gerrit.libreoffice.org/59789 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-31pass ScDocument by ScDocumentUniquePtrNoel Grandin
Change-Id: I6ce82c6f061c7f01a5584230c26e9bf20c7f07ca Reviewed-on: https://gerrit.libreoffice.org/59788 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-30Translate German commentsJohnny_M
Change-Id: I8e3b98e1ddc3f4f9826aa14383908d6b77f4827a Reviewed-on: https://gerrit.libreoffice.org/59592 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2018-08-30pass ScRefUndoData around by std::unique_ptrNoel Grandin
Change-Id: I317a0c7665f4c146fc34bcffdae8835cf674ff61 Reviewed-on: https://gerrit.libreoffice.org/59787 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-30tdf#114441 Convert sal_uLong to other types in ./sc/source/ui/appBijan Tabatabai
Change-Id: I9648d54f75d7ed5cb68ec7d678bc61c46df18acf Signed-off-by: Bijan Tabatabai <bijan311@yahoo.com> Reviewed-on: https://gerrit.libreoffice.org/59602 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-08-30rename GetMarkedObjModel to CreateMarkedObjModelNoel Grandin
and return std::unique_ptr Not that it helps much, the ownership quickly becomes complex once it hits the TransferableHelper. Change-Id: I3c6bd72072e092b71b32e4105fe859fdcea956af Reviewed-on: https://gerrit.libreoffice.org/59777 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29loplugin:useuniqueptr in the sc dialog classesNoel Grandin
Change-Id: I61c9812e1779e0342160f0762afe79d3302304e6 Reviewed-on: https://gerrit.libreoffice.org/59759 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29loplugin:useuniqueptr in XclExpDxfNoel Grandin
Change-Id: I32c9ef89b387e6f5700100174700668d9412916b Reviewed-on: https://gerrit.libreoffice.org/59758 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29loplugin:useuniqueptr in ScDrawTransferObjNoel Grandin
Change-Id: I7a895a88576eabf010caa13353ad5698b4daf4d6 Reviewed-on: https://gerrit.libreoffice.org/59756 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29More -Werror=redundant-moveStephan Bergmann
...similar to dc06c8f4989fc28d0c31ebd333e53dfe0e0f5f66 "-Werror=redundant-move (GCC 9), take two" Change-Id: Idb6b29d6959ff707bab820d150133a954221a29e Reviewed-on: https://gerrit.libreoffice.org/59749 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-29Replace find_if with proper quantifier algorithmsArkadiy Illarionov
Change-Id: Icc820a47ac891c358883f9c01224f676c58fdd11 Reviewed-on: https://gerrit.libreoffice.org/59744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-29loplugin:constantparam (2)Noel Grandin
Change-Id: I528f22876497f87159e3b9453362ebbfb55b7092
2018-08-29new loplugin:oustringbufferNoel Grandin
look for places where we are appending the temporary result of adding strings together, to an OUStringBuffer, where we could rather call append repeatedly and avoid the temporary creation Change-Id: I481435124291ac7fb54b91a78344a9fe5b379a82 Reviewed-on: https://gerrit.libreoffice.org/59708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-28Use tools::Time::GetClock() to obtain hour,minute,secondEike Rathke
... instead of rtl::math::approxFloor(fValue*DATE_TIME_FACTOR+0.5) seconds that most times works but sometimes not. Change-Id: Iaca69630461f2067622898fab35cda61d20172a9 Reviewed-on: https://gerrit.libreoffice.org/59719 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-08-28tdf#42949 Fix IWYU warnings in sc/source/core/inc/*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I5af85ef9ed3e6d15f7e98e9d669c59a66fc70833 Reviewed-on: https://gerrit.libreoffice.org/59478 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-08-28Move lcl_getHourMinuteSecond() to tools::Time::GetClock()Eike Rathke
Also add fFractionOfSecond and nFractionDecimals to obtain the remaining fraction of second. In preparation to use this in the number formatter and other places that obtain the wall clock time particles, which likely so far use bad rounding as well. Change-Id: I4fbea4165c560646438b06c340756c97dafa7c78 Reviewed-on: https://gerrit.libreoffice.org/59700 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-08-28Shortcut small negative values to 0:0:0, tdf#119533 tdf#118800 follow-upEike Rathke
... instead of letting them end up as 24:0:0 Change-Id: I0212a2b422a931a24fd2748aa2826a5b60d2a397 Reviewed-on: https://gerrit.libreoffice.org/59699 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2018-08-28return ScMemChart by std::unique_ptrNoel Grandin
Change-Id: I5a5b54872ce6ae351c6550a1ec0b2f7c52c35e13 Reviewed-on: https://gerrit.libreoffice.org/59683 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-28loplugin:useuniqueptr pass ScDocument by unique_ptr in undo codeNoel Grandin
Change-Id: Ib05638865a42ad37c3382714e1790c7035ed8ebf Reviewed-on: https://gerrit.libreoffice.org/59638 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-28return by std::unique_ptr from CreateSortInfoArrayNoel Grandin
Change-Id: I4be97a5e93bd4cb08a9c25dc663883c2c5e8dd5e Reviewed-on: https://gerrit.libreoffice.org/59682 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-28Resolves: tdf#119533 reintroduce time rounding but cut, tdf#118800 follow-upEike Rathke
Regression from commit c69e7266916ac1b8917477fb4eccdb9098da5792 CommitDate: Thu Jul 19 14:01:30 2018 +0200 tdf#118800 fix rounding error in Calc function HOUR, MINUTE, SECOND. Rounding was only an error if it produced a value of a full day in seconds, or if it otherwise led to an inappropriately rounded-up individual value, but in general some rounding is necessary. Instead of omitting rounding completely, basically round to nanoseconds and then do not round individual hour,minute,second values but instead truncate to the next magnitude so 23:59:59.9999 gives 23h59m59s instead of 24h0m0s Change-Id: I93df1aa54212c1b8816237c9467f270ed28a3f1f Reviewed-on: https://gerrit.libreoffice.org/59677 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2018-08-27Increase arbitrary sort elements limit from 100000 to two full columnsEike Rathke
The value 100000 already was in the year 2000 initial commit, probably some memory and performance constraints back then. At least one full column should be sortable, make it two so we don't bail out that early for functions like MODE() that can take multiple ranges. In fact maybe ScMatrix::IsSizeAllocatable() should be taken into account, which is much larger though and QuickSort() might not play well with it. Change-Id: I061abfd0f061c8df62c31468df744eb5dc7152be Reviewed-on: https://gerrit.libreoffice.org/59637 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2018-08-26Update mdds to 1.4.1.Kohei Yoshida
The largest change in 1.4.x relevant to the calc code is that the multi_type_matrix::walk() methods now take a copy of the function object rather than a reference, to allow for it to take an inline lambda function. Instead, it does return a instance of the input function object, similar to how std::for_each() behaves. In case the function object contains a large data member, try to make it a moveable so that it will get moved rather than copied when going through one of the walk() methods. Change-Id: Ifd08fc4a2ed75039e5292a35ff08726e0126c77f Reviewed-on: https://gerrit.libreoffice.org/59584 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
2018-08-26get rid of aEndItr entirelyCaolán McNamara
Change-Id: Ib95ca628457d7330ac1e1001ab13a00a764c9bad Reviewed-on: https://gerrit.libreoffice.org/59598 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-25crashtesting: cached deque::end invalidatedCaolán McNamara
e.g. import of ooo101471-3.odf Change-Id: Ie1d83077cf91f2291c74390c24b7f36808e32562 Reviewed-on: https://gerrit.libreoffice.org/59597 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-25loplugin:useuniqueptr in ScMoveUndoNoel Grandin
Change-Id: I622a0f37866c5ea1f4ec5f4475d784682a0179c2 Reviewed-on: https://gerrit.libreoffice.org/59560 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-24loplugin:useuniqueptr pass ScDocument by unique_ptr in the undo codeNoel Grandin
Change-Id: I85188a4b3da4bc7f1a8a83870c8888be18bc1053 Reviewed-on: https://gerrit.libreoffice.org/59559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-24loplugin:useuniqueptr for ScOutlineTable in the undo codeNoel Grandin
fixing what looks like a couple of leaks on some paths Change-Id: Idc851b8ffca8e5ed1bd54c9195442709ed310d40 Reviewed-on: https://gerrit.libreoffice.org/59558 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>