summaryrefslogtreecommitdiff
path: root/sc/inc/column.hxx
AgeCommit message (Collapse)Author
2019-01-16pass ScPostIt around by unique_ptrNoel Grandin
Change-Id: I99c1f0a5d5c760663f5150b477a936d2f45b874c Reviewed-on: https://gerrit.libreoffice.org/66322 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-14Encapsulate ScFunctionData members and abuse WelfordRunner membersEike Rathke
... to squeeze some memory and later use this as a mass object during consolidation. Change-Id: I3f0aa03ec0bbbb4c64a4854b55a451dd3cacfa90 Reviewed-on: https://gerrit.libreoffice.org/65124 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-12-07Find actual data area inside the main-range...Dennis Francis
and trim all ranges to match this actual data area. Don't do this optimization for COUNTIFS where there is no main-range. This optimization is also turned off if any of the parameter ranges are not double-refs. Benefits in cases like - =SUMIFS(A:A, B:B, ">=20", C:C, "<=10") and the is data only in say A1:A10000 and rest are empty. Range trimming in this case saves lot of execution time and memory (for vConditions and vRefArrayConditions). Change-Id: I6b4ad91e23f89dc48603b98000bcef4dbdb03112 Reviewed-on: https://gerrit.libreoffice.org/64657 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2018-12-03make sure FetchVectorRefArray() never triggers Interpret()Luboš Luňák
Test::testFormulaRefUpdateRange could trigger this, leading to recursion that wasn't handled properly by the code, since it wasn't expected to happen at late time (ScDependantsCalculator should have already caught it). This is all caused by the fact that FetchVectorRefArray() fetches also all rows before the given rows (to make the caching simpler I suppose). But that fetching could lead to Interpret() calls. Therefore, make ScDependantsCalculator in OpenCL mode check also all rows above. Change-Id: Iaecc105663df21b01443759287cec605470d34a5 Reviewed-on: https://gerrit.libreoffice.org/64236 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2018-10-31tdf#42949 Fix IWYU warnings in sc/inc; sc/source/filter/inc/Gabor Kelemen
Found with bin/find-unneeded-includes after recent improvements - remove UNO headers from blacklist - remove newly found unneeded fw declarations - fix up some not self contained headers Change-Id: I605656bc98a64640a78d2ff4de9c7c37326033cf Reviewed-on: https://gerrit.libreoffice.org/62264 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-10-29sc: fix: range/step calculation for progress barSerge Krot
Change-Id: I733e4003b65b410d44d9a1132be4e9e10ac24c3e Reviewed-on: https://gerrit.libreoffice.org/62305 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-10-15loplugin:constfields in scNoel Grandin
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 Grandin
Change-Id: I105d07da6e1a9259a7b833a1259c0e992e35a03d Reviewed-on: https://gerrit.libreoffice.org/58954 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-11loplugin:unusedmethodsNoel Grandin
mostly this seems to be fallout from commit 089a4f245325a5be5cd5951d85305d791b4d9cb6 Date: Mon Aug 6 14:55:04 2018 +0200 remove Calc's software interpreter Change-Id: Ib48696e724969a28a7d41155ba1573fd9cd58be6 Reviewed-on: https://gerrit.libreoffice.org/58869 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-27use optional ScInterpreterContext in ScColumn::GetString()Luboš Luňák
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-21Do dependency computation checks for OpenCL and...Dennis Francis
software interpreter like in CPU threading. This patch also reworks the cycle detection to make it more robust. Since the dependency computation also does cycle detection, there is no need to disable group-calc(threaded/OpenCL/SW Interpreter) for non-leaf nodes in recursive interpret. The rework of cycle detection ensures that it fixes tdf#95748 correctly. Change-Id: I460addb768eedc0914491a3d24ae7220c3afbb20 Reviewed-on: https://gerrit.libreoffice.org/55665 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins
2018-06-11tdf#114710 : Fixes crash when pasting as GDI metafileDennis Francis
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-08tdf#42949 Fix IWYU warnings in sc/inc/[bc]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ie63df2185e0586d1fc7db4ed2825a7aa8d8dde73 Reviewed-on: https://gerrit.libreoffice.org/53950 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-11pass EditTextObject around using std::unique_ptrNoel Grandin
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 Grandin
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-22loplugin:useuniqueptr in ScColumnNoel Grandin
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-03-15tdf#50916 Refactor of the table7.cxx to allow dynamic column sizeBartosz Kosiorek
Change-Id: I60ea249ca621e25b3585e1d2f75bdf15d96f6dcc Reviewed-on: https://gerrit.libreoffice.org/48205 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Eike Rathke <erack@redhat.com>
2018-02-03TypedWhichId in scNoel Grandin
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-23tdf#98931 Consider cell-anchored images when sortingSamuel Mehrbrodt
This makes images/draw objects anchored to cells move as any other content when sorting cells. Works for sorting rows and columns. Also fixes a bug where notes attached to cells were not sorted when sorting columns. Change-Id: Id9a56a15f776d5adbe382a9bca167bff48b69a0c Reviewed-on: https://gerrit.libreoffice.org/46838 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-12-24sc: compact ScColumnAshod Nakashian
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 Grandin
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 Grandin
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-29loplugin:countusersofdefaultparams in scNoel Grandin
Change-Id: I8e790f9253279c9135ea1a4bcdd663ae7df44015 Reviewed-on: https://gerrit.libreoffice.org/45464 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-21Move token-cache for doubles to ScInterpreterContext...Dennis Francis
...from ScInterpreter and in the s/w interpreter, create a ScInterpreterContext for each thread for passing into per thread ScInterpreter constructor. Change-Id: I4e0abce043c7e1e70859efb2e5001fc284f416a9
2017-11-21Introduce ScInterpreterContextTor Lillqvist
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-11-21Move formula tree manipulation out of multi-threaded parts of codeTor Lillqvist
Change-Id: I2f7e6fb747b6a74172a81f9db9bc210ef6a27342
2017-11-21First steps for Calc parallelismTor Lillqvist
For now, formula group calculations are done in parallel threads when 1) OpenCL is not used, and 2) the environment variable CPU_THREADED_CALCULATION is set. This commit is a surely broken first step and does not actually work that well at all. Change-Id: Ia7e5019703ba89bff0695faef0f7504765061149
2017-09-08sc-perf: do not add a million empty filter entries just to sort and discardEike Rathke
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 Grandin
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-16add a way to restore from our new cache formatMarkus Mohrhard
Change-Id: I6eeaaf9ca05bed2a908143ae5f4daab6e098799c Reviewed-on: https://gerrit.libreoffice.org/41199 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-08-16introduce a way to write a simple data representation to a streamMarkus Mohrhard
The format used is column orientated and allows quick import and export of the table content. This will be used for the external data to cache the results of each transformation step in the UI. Change-Id: I6e1bfd3b3384cbfadeb98fb995dfd0b03d5e6eb6 Reviewed-on: https://gerrit.libreoffice.org/41198 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2017-07-22avoid unnecessary calls of AdjustRowHeightTamas Bunth
Change-Id: I2d164f69a7313d69f3fe5cabe1e3cc39aeba4d32 Reviewed-on: https://gerrit.libreoffice.org/40272 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com>
2017-07-20Avoid unnecessary calls of AdjustRowHeightTamas Bunth
Check if attribute changed during ApplyAttributes. If it did not change, it is unnecessary to recalculate cell size, repaint etc. Change-Id: Ic3a3fa24efa9ad3619b8979a67e972a7635311cc Reviewed-on: https://gerrit.libreoffice.org/40198 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2017-06-20Remove unused ScColumn::mbDirtyGroupsEike Rathke
Change-Id: If8ed724ccec136653db5fcf43f9e74a82826add7
2017-06-12tdf#95883 Select Unprotected Cells in CalcGulsah Kose
Change-Id: I20a71f66154675de9c2c47ff32e859c899fe9103 Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/37424 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
2017-06-06first arg of ApplyBlockFrame is never nullCaolán McNamara
Change-Id: Ie65fce6041278c6758df266c4ef097a5758f75dd Reviewed-on: https://gerrit.libreoffice.org/38448 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-06-06add COVERITY_NOEXCEPT_FALSECaolán McNamara
to markup dtors that coverity warns might throw exceptions which won't throw in practice, or where std::terminate is an acceptable response if they do Change-Id: I32b94814e8245372e1d1dc36be0d81e3564042f4 Reviewed-on: https://gerrit.libreoffice.org/38318 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-24tdf#107945: properly iterate over mtv during pivot cache loading.Kohei Yoshida
This reduces the total time required for populating the pivot cache by ~60%. Change-Id: I6a8511959c20231a8a5dbd0b0a9a3d0930a1fa0c Reviewed-on: https://gerrit.libreoffice.org/37971 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
2017-05-23drop the SCsROW/SCsCOL/SCsTAB typedefsNoel Grandin
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-05-18New HintId and unit test for hidden rows and SUBTOTAL, tdf#93171 follow-upArul Michael
Adding new Hintid for HideRows so that we notify only formulas with subtotal and aggregate function for recalculation. Added unit testing. Change-Id: I44f2e45acaf697f91744bc8202f27b218faa5b43
2017-05-12tdf#93171 Subtotal function with function indexes don't updateArul Michael
Calling InerpretTail during Hide rows by SfxHintId::ScDataChanged broadcast Change-Id: Ie78170bb6d49933a49d828a18637cb410796dc06 Reviewed-on: https://gerrit.libreoffice.org/37509 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2017-05-03tdf#107255: detect whether the range has only one data cell.Kohei Yoshida
Change-Id: I030961d9d38b092ffdc966baa10decae0c2d070d Reviewed-on: https://gerrit.libreoffice.org/37178 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
2017-04-05lok: notify cell note removes before erasing storageHenry Castro
Change-Id: I6181b27b6a969d94789c42ea0914b17328c5c8d5 Reviewed-on: https://gerrit.libreoffice.org/36109 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com> (cherry picked from commit f27f4dd900b50f15427f44f6d448e8e8e49ec2d5) Reviewed-on: https://gerrit.libreoffice.org/36143 Tested-by: Jenkins <ci@libreoffice.org>
2017-01-18tdf#104967 preserve isolated notes data in clipboard when closing documentEike Rathke
Change-Id: I0e263583e27c5103c0bb90e8fe00562e46a52d98
2016-12-08convert SFX_HINT to scoped enumNoel Grandin
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-12Renaming due to the fact that it now dumps non-formula blocks too.Kohei Yoshida
Change-Id: I9d06786a93bab2f0ed0d179df8edf9b5d8128bf6
2016-11-12Ctrl-Shift-F8 to dump the column storage where the cursor is.Kohei Yoshida
Enabled only in dbgutil build. Change-Id: I0cd095fb56893122a26b2da6882fca15e516d193
2016-11-11loplugin:countusersofdefaultparams in sc(part2)Noel Grandin
Change-Id: I1e2a0969ca7e9e0f75079a171150269dfed26507 Reviewed-on: https://gerrit.libreoffice.org/30755 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-11-10Refactor ScAttrArray for tdf#50916Dennis Francis
For a default column, now ScAttrArray does not store the default format. So the case of default pattern from 0 to MAXROW is represented as nCount = 0 and pData = nullptr in ScAttrArray. A new ScAttrArray object (aNextColAttrArray) is introduced as a member of ScTable. This is used to store the formatting of *unallocated* columns (whose indices are from aCol.size() to MAXCOL). In next patches for this bug, I plan to refactor table*.cxx functions related to formatting such that : 1) In formatting setter functions, if colspan of the input range spans the colrange(aCol.size() to MAXCOL) then instead of allocating columns, apply that formatting to aNextColAttrArray. 2) In formatting getter (const) functions, if requested colspan has some intersection with the colrange(aCol.size() to MAXCOL) then use the formatting info stored in aNextColAttrArray to calculate the formatting of the input range. 3) In general setter (non-const) functions if we really need to allocate new columns (example, when data is entered), use the formatting info stored in aNextColAttrArray to create pAttrArray of the new column. Change-Id: Ieb56f853209b396d92fdb2c27e39361703576423 Reviewed-on: https://gerrit.libreoffice.org/27828 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
2016-11-07loplugin:expandablemethods in scNoel Grandin
Change-Id: Ib417c5e978fca563f8c0ef0dbe6b9d50fead9828 Reviewed-on: https://gerrit.libreoffice.org/30566 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>