summaryrefslogtreecommitdiff
path: root/sc
AgeCommit message (Collapse)Author
2022-03-08sc: support reading sparklines from OOXML documentTomaž Vajngerl
Read sparklines and sparkline groups from the OOXML document and add store it into a (temporary local) doc. model. Change-Id: Id2d34db70300957735571875d6defb3d560fbb26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131161 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-03-08remove pAttrArray nullptr checksLuboš Luňák
I missed these in 2e2e30d7ae445509e39ba47c1b248079f28c8d95. Change-Id: Ib0f75a2a0f018521e2468e83bdf41196f4b66c3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131152 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-07cid#1500534 silence bogus Using invalid iteratorCaolán McNamara
Change-Id: I4885335832baaafd4468ae55bcafa2b541e26913 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131105 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-07do not pass XComponentContext to officecfg::...::get() callsLuboš Luňák
It's used only for the ConfigurationWrapper singleton, so it's used only the first time and then ignored. It also causes calls to comphelper::getProcessComponentContext() for every single invocation despite the value not being needed, and the calls may not be cheap (it's ~5% CPU during ODS save because relatively frequent calls to officecfg::Office::Common::Save::ODF::DefaultVersion::get()). Change-Id: I02c17a1a9cb498aeef220ddd5a0bde5523cb0ffb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131056 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-07optimize repeated std::vector removal (tdf#126326)Luboš Luňák
Also it's enough to use just pointers to the elements, no need to refcount. Change-Id: I2e6a2f981d75e3dd57aefb41ba1fdbf800fed813 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131107 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-07faster check whether attributes have changed (tdf#117366)Luboš Luňák
If the two item sets are equal, then trivially nothing has changed between them. Change-Id: Ib4c5922959603a0a28e11967a17ba4607e6a010f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131080 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-07faster bulk insert into o3tl::sorted_vector (tdf#117366)Luboš Luňák
Repeated insert() into o3tl::sorted_vector can turn out to be pathological, repeatedly moving most items aside for each element inserted. Make it possible to insert a normal vector that's been pre-sorted and made unique. 31s->9s for loading tdf#117366. Change-Id: If3a0366dd240ad46c23f5f3dc04e781b8c4b2aa2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131085 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-06don't try to spellcheck after last data cell (tdf#122827)Luboš Luňák
Change-Id: I728e7f19a521f5f3583b4963d84c7d36527c8842 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131076 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-06make CellTextAttr half the sizeLuboš Luňák
It's set for every cell with value. Change-Id: Ie46617a621e6eb16b5f67d92e85bf2155e650fb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131072 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-06don't destroy and recreate broadcasters on large changes (tdf#131894)Luboš Luňák
Change-Id: If5377687e7bcfab00af37887d3aaf302fa615690 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131070 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-06do not destroy broadcasters and then recreate again (tdf#134268)Luboš Luňák
Sorting ends tells all listeners on all the sorted cells to end listening to stop updates, then sorts the cells and starts listening again. This will cause all broadcasters for the sorted cells to temporarily stop having any listeners, so they'll be deleted and removed from the mdds vector (which may additionally cause moving large parts of the mdds vector repeatedly). And since all listeners will want to listen again after the sort, this will all need to be reconstructed. To avoid this, temporarily block this removal and then later just checks and remove any possibly left-over broadcasters that ended up with no listeners. Change-Id: Ie2d41d9acd7b657cf31a445870ce7f18d28d5ebb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131069 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-05compress RowHidden()/GetRowHeight() use in excel export (tdf#126326)Luboš Luňák
Change-Id: Idc6a704cfc820bbbb2b51eff8db8159c251ea9ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131062 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-05don't bother tracking changes if both cells are empty (tdf#141174)Luboš Luňák
AppendContent() does something only if the cells differ, which can't be the case if they're both empty, so skip unallocated cells. Change-Id: I367801bac30a8ee641b4ce608392124bac6ef47a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131060 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-05don't bother scanning nonexistent data (tdf#141182)Luboš Luňák
There's no point scanning for non-empty cells after the last data cell, and this avoids processing mdds structures (such as repeated creating of flat_segment_tree). Change-Id: Ibec324aa2de457e8439c38a561f55ced9f478899 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131059 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-05make sc_namedrangesobj test work with 16k columnsLuboš Luňák
'row1' is not a valid named range with 16k columns, it's a cell address. Since the named range is constructed by the test, not even 582fc887f1faafe8ff5f16a13a0208483a93353f can take care of it, so rename such ranges. Change-Id: I6643953d41e391c8c3cfc55768b06d61d9fcb0a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131046 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-05remove more hardcoded sheet sizes from Calc testsLuboš Luňák
E.g. sctablesheetobj test had the limits hardcoded, even as actual numbers. Apparently some tests cannot easily access global settings, but this at least makes it easy to check all tests after modifying ScSheetLimits::CreateDefault(). Change-Id: I6cff577fb01b1ea262dcd1f9fde24e114e19abdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131040 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-05remove more hardcoded MAXROWLuboš Luňák
Change-Id: Ica57f18d3fd1bf9ec06f05869f4a956d7d1097b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131036 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-05remove pAttrArray nullptr checksLuboš Luňák
I don't see how it possibly could be nullptr in a correct situation, ScColumn::Init() is called right after creating ScColumn. Also make a bunch of trivial forwarding functions inline. Change-Id: I710d3cd86a660a8b4dcfbb9966a685b657b93c18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131035 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-05introduce ScColumnData for ScColumn/ScTable code sharingLuboš Luňák
Since columns are allocated dynamically on demand, up until this commit ScTable had ScPatternAttr member for unallocated columns that it was using in place of those unallocated columns. But that meant either copy&pasting pieces of code from ScColumn, or having extra slightly more cumbersome shared function in ScColumn, or even nothing. Improve this by creating ScColumnData, which will be used as ScColumn base class to keep things working as before, but ScTable now also contains one ScColumnData instance and so it can also call its functions. Change-Id: If1d842c4a5aec32e2a7729358006d79cd831349f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131034 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-04cid#1500566 Uninitialized scalar fieldCaolán McNamara
Change-Id: I63e81377227ab35a0697a1d90fb3c9302a12a2b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130999 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-04Advanced Diagram support: Allow reLayout without keeping oox::ShapeArmin Le Grand (Allotropia)
Goal is to minimize dependencies on oox classes. For that pupose I redesigned the Diagram class to work without remembering an oox::Shape at all. For reLayout, a new temporary one is created and used. That was a bit tricky, I needed to find out what data at the oox::Shape is needed to sucessfully do that with the not-originally-imported one. Another necessary change was to move the DiagramFontHeights adapting mechanism away from oox::Shape, too. It fits better to Diagram class. That way it can also be used for reLayout and the oox::Shape gets a little bit smaller, too. This opens the path to move needed Mode-Data Diagam core claasses to other libs where changing/im/exPorting them will be possible. Change-Id: I40bc4b190d2abc797f5c56f9e476d22155d21422 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131004 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-03-04keep conflicting named ranges working with 16k columnsLuboš Luňák
Named ranges named e.g. 'num1' are actually valid cell addresses when using 16k columns. We prevent naming ranges in a way that would make them conflict, but it's possible to read them from a saved file that was created with fewer columns, and in such cases formulas using them would silently refer to those cells instead of to the named range. I don't see anything in the ODF spec, but OOXML in 18.2.5 recommends this in case there are conflicts (only outside of the normal Excel range of A1-XFD1048576, inside they are always meant to be references, but our normal range currently is only 1k columns, and it's simpler and probably harmless to always resolve a conflict this way). I can optimize performance of this in another commit if needed. Change-Id: I46aef54b069700e7bf268b50fdc1a88989f3ee29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130891 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-04tdf#45904: Remove ScHeaderFieldObj Java testJens Carl
The ScHeaderFieldObj Java tests are implemented in ScEditFieldObj_Header. Change-Id: I45d3b17bd244090c491c85475f20bc06eb92908f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130953 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2022-03-04set properly attributes for cells in unallocated Calc columnsLuboš Luňák
ScTable::ApplySelectionCache() was setting attributes only for allocated columns, so e.g. selecting a whole column and making it bold didn't actually set all of it bold. Make sure it set it for all columns, and make use of the default attribute for unallocated columns to avoid allocating columns just to set them the same attribute. Change-Id: Ie9886317d7a91c6a43951af69b717f9ba32a1c9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130984 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-04provide MAXCOL/MAXROW also as stringsLuboš Luňák
Primarily for use in tests. Change-Id: Icb962cbdfa63a3b50115314e9afd46f3fa1a928a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130939 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-03make ScMarkData::IsAllMarked() work also for simple marksLuboš Luňák
Change-Id: I41009c83827619605b4cfc4909f1d9922cde68a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130923 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-03improve ScMark* classes a bitLuboš Luňák
Bin pointless empty destructors, make trivial functions inline, return value by simply returning it. Change-Id: Ia71e73262802bbe6b022ca4bafb2b958ffdf39f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130915 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-03Check for cached formula block count to make sure it's correct.Kohei Yoshida
Change-Id: I16237d26bb9e55ba5c3e65087be98ba8f8086d56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130899 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
2022-03-02function that modifies data should not be called IsXXX()Luboš Luňák
IsXXX() is for const functions that check something. Using it for functions that modify data is confusing. Some of them even are in fact const, and the problem got "fixed" by making data mutable *sigh*. Change-Id: Ic385c96d6c32c818a8a6baa77ab025aab2c45a03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130890 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-02fix incorrect search startLuboš Luňák
A mistake from 05259e880db187f6698d6d545504775459d6e96a, the second if branch doesn't guarantee anything about where EXC_XF_NOTFOUND elements start. Change-Id: I942f87a7320c13a8f87ab3c9f1683a75d7a1e135 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130876 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-02Advanced Diagram support: Extend UI to all applicationsArmin Le Grand (Allotropia)
As a preparation make the currently available minimal UI to interact with Diagrams available to all LO apps Change-Id: Idd0a4c187a295cd264ebd09be2b574a3d2a93e44 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130837 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-03-02Bump Glade version to 3.38Heiko Tietze
Change-Id: Ibd8ffc90efaed9f8a5ced558f22ec53da7f31cb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130822 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2022-03-02reuse a vector instead of repeatedly creating it (tdf#95346)Luboš Luňák
With some documents this actually is a noticeable cost. Change-Id: Ibaf2157eeba83e0c8f78c7ba058771f92bb44e24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130795 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-02try to avoid using map when searching most used item (tdf#95346)Luboš Luňák
The last item is usually going to be the most common, so first check that. Change-Id: Ibad8b6bb9a829a96691c10b780b8e52610475126 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130794 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-02tdf#118117 sc pivottable: STR_PIVOT_DATA is an existing name tooJustin Luth
This fixes a LO 6.0 regression from commit a078328e91ab9cbd78a92608c1abdc2c57ff9ac5 I looked for existing unit test examples using assert (rLabel != ScResId(STR_PIVOT_DATA)); but found nothing. I don't see the need for a unit test here. The whole pivot table is messed up if you duplicate a label, so why bother testing. It just is not as bad now as it was before. Change-Id: I59cc73becf91f766a29d2007c2d67685ffa2a65c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130751 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-03-01Fix typosAndrea Gelmini
Change-Id: I9a98bac7c570f25ff7d77df98e93aaeed2665038 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130720 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-03-01use SfxItemSet::GetItemIfSet in sc/source/ui/Noel Grandin
Change-Id: Ia360a0bbc57f2d50dc26ae670d6e953d3f2d8a8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130745 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-01gtk4: media dimensions are only reliably available asyncCaolán McNamara
this is also the case for the direct gstreamer use in gtk3 but more egregious when abstracted away from it in gtk4 Change-Id: If90069308d67929585722c079c482cd4ad196e1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130468 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-03-01compress calls to AdjustRowHeight() to just one call (tdf#94677)Luboš Luňák
This function imports only text, so I think doing one big call at the end should be fine. Change-Id: I267f5857ac11cfb95245434333f2ca5fa7e662cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130789 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-01fix data race in ImportFinishedNoel Grandin
touching these fields here leads to a race with the access in ::Import. Rather just leave them to be cleared when the object is destructed. Change-Id: I0016917455d4e252e360cc49e3d1ca56f4eabb30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130749 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-01tdf#45904 Move XComponent Java test to C++Jens Carl
Move XComponent Jave tests to C++ for ScCellFieldObj_Cell and ScCellFieldObj_Header (formerly ScCellFieldObj). Change-Id: Ibf293a72801720fee49acdda5a3a463e9202bb58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130742 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2022-03-01Add asserts to make sure the calculation is correctHossein
On Linux/gcc (Ubuntu 10.3.0-1ubuntu1~20.04), I was getting this warning: sc/source/core/data/bcaslot.cxx:647:25: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits] 647 | assert(slot >= 0 && slot < mnBcaSlots); | ~~~~~^~~~ slot variable is of type SCSIZE, which is defined as size_t in sc/inc/address.hxx. This is fixed in 405a7a09558ad17642808cc3739ab202f86bea0c. To make sure the calculation of slot is OK, I have added these 2 asserts: assert(nRow >= rSD.nStartRow); assert(nCol >= rSD.nStartCol); Change-Id: I731c1b6e913febde51fc16042d32c35950e707db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129805 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-03-01use SfxItemSet::GetItemIfSet in sc/source/ui/view/Noel Grandin
Change-Id: I6c1c3ee4fbb6b105ad67c051ce1fa2dae258df85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130746 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-01use SfxItemSet::GetItemIfSet in sc/source/filterNoel Grandin
Change-Id: I8ba941cea8f3b8ed0f37d2dc6b2520ae89652afe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130744 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-01make Calc jumbo sheets an explicit build featureLuboš Luňák
On 32bit platforms tools::Long is 32bit, which is not enough for pixel coordinates with 1m+ Calc rows+. So do not allow jumbo sheets for such platforms. Change-Id: I2ebd56a051470d33fca967918af3e7d2b0172dc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130713 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-01use SfxItemSet::GetItemIfSet in sc/source/core/dataNoel Grandin
Change-Id: I60552d79f484848eef5b0c43de377a1eed5e76b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130737 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-03-01followup tdf#122098 xlsx export: avoid corrupt format if not bool valueJustin Luth
Although I can't find any documents that cause a "b" when the value is not 1 or 0, if such should ever happen, then Excel complains about an invalid format and fails to load. (The formatting looks a bit weird, but that is what clang-format produces. How nice.) Change-Id: I090a27829596260cdd6379b6a6daa75ce250b7e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130734 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-02-28remove obsolete TODO.performanceLuboš Luňák
None of the issues listed is valid anymore. Change-Id: I3e28753b111b9a8fd0f280684555dff214c158f3
2022-02-28uitest: simplify tests even moreXisco Fauli
- No need to open the dialog to click the cancel button - Avoid repeated calls to document.DrawPage.getByIndex(0). Similar to 26298f29e9d36313be527b785a9bb96089582037 this might fix the different failures these tests sometimes have Change-Id: I4e175b6c5d48c4651e5877ec2a72c4858b590321 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130727 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-28make named ranges in tests work with 16k columnsLuboš Luňák
References like 'day1' are valid cell addresses with 16k columns, since they go up to XFD1. Since addresses currently take precedence over names, rename ranges to not conflict. Change-Id: Iab63947565ed176c98bc541de6189d7ee9e8d255 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130728 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>