summaryrefslogtreecommitdiff
path: root/sc
AgeCommit message (Collapse)Author
2022-02-18Revert tdf#64345: EDITING: Selected area looses selection when switching sheetAhmet Hakan Çelik
This reverts commit c82634d5a222120b3a95cff1b950a7f7a1f5ded1 Change-Id: I627b46f710da723ad58295d4fa0821df17eebd9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130108 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2022-02-17Resolves: tdf#147496 No line feed for one single cell in clipboard Doc2Text()Eike Rathke
Change-Id: If6326bf414e1da43d846f952d88ceae37b2b9cd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130109 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-02-17fix range checking in calls like ScDocument::GetNote()Luboš Luňák
Change-Id: I5612e765b3484b0515f4a16030ee19133ae3126a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130076 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-17fix range checking when parsing Calc cell address (tdf#147451)Luboš Luňák
The document contains 'Sheet1', which Calc first tried to parse as a normal address, since it matches the format of e.g. 'XFD1'. The code parsed column into SCCOL (sal_Int16), which with 16k column limit overflowed and the code failed to detect the problem. Change-Id: I470db1b670dbff7bdc8013bede0a0b011e88c372 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130073 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-17Revert "Resolves: tdf#147421 Do not use OUString::replaceAll() to strip ↵Mike Kaganski
null-bytes" This reverts commit 4b0c17609c2cca326bbcc9e8488a327a4a9ea952. Reason for revert: it's possible now to revert to previous simpler code after commit 4e4a01302a140d75a49055821b3197a2eda81db5 Related: tdf#147421: optimize O(U)String's replaceAll* Change-Id: Iaefac917afbc9c587e75c38457dd9ea87e4f5861 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130017 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2022-02-17tdf#147398: sc_ucalc_formula: Add unittestXisco Fauli
Change-Id: I28c8a4614edf577e1f8f101ba55327fd9f358973 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130068 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-17optimize blank cell Excel export (tdf#133749)Luboš Luňák
The code in XclExpRow::Finalize() apparently creates an array of indexes for blank cells, and then uses it to efficiently write many blank cells (or whatever it's all exactly). But especially with huge sheets all this processing is basically repeatedly checking for all the blank cells at the end of the rows. Optimize this by calculating where the all the remaining blank cells start and process those more efficiently or sometimes even just plain ignore them. Possibly this could be optimized even more if I understood the code better, but this seems to be good enough. I've also changed some of the loops to use indexing instead of iterators, as libstdc++ debug iterators are horribly slow here (which possibly may even make a difference for Jenkins builds). Change-Id: Iafe36ccd2795a85b10b98cf84c041a7427aabc29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130046 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-17std::map -> std::unordered_mapLuboš Luňák
Change-Id: I70a039af151b7dd398d2665e6fc9bb825f719e39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130006 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-17Handle the possible case of broadcasted row block, tdf#119083 follow-upEike Rathke
Though unlikely and apparently not happening, the changed ScHint may theoretically notify for a block of rows, not just one address. Do not join out-of-band rows to the dirty header columns. Change-Id: I524bcbedf063fe6b5ff5b99bc984fcb9dc02b6ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130054 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-02-17tdf#147086 OOXML export: don't save the empty editing passwordTünde Tóth
Saving with opening password, but without editing password resulted read-only documents (only on their original path: saving, i.e. copying the file in a different path was a workaround for the lost permission). Regression from commit 1b53c1dfc76f08ca7df40a0673aa50eca700d072 (tdf#144374 DOCX: export the password for editing). Change-Id: I2759dc876ee7668d00eee0aa81490c9d1e0c272b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129593 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-02-17fix maxrow/maxcol mixupLuboš Luňák
In 5e402bac39dc4245844efbde442bdb3bd993a157 I accidentally converted a couple of MAXCOLCOUNT to GetMaxRowCount(). Change-Id: I2f22e614fb79b8e651308bd4dbddcd7e04651903 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130057 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-17tdf#132057: sc_uicalc: Add unittestXisco Fauli
Change-Id: I56c385e0458e2096e0c1e4fd0c85d47c40fe207b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129987 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-17remove MAXCOL/MAXROW from ScExternalRefCacheLuboš Luňák
The range is used just for filtering out, and since this is about references to other documents, I wasn't sure which document to use as the limits, so I did a copy that of the functions that returns all. Change-Id: I9711534004796496558848adef03d38ddb115441 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129988 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-16lok: sc: handle all local mouse tracking for CalcHenry Castro
Change-Id: I11f3477c0f966d403e076fc73b7e5507ad6597f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118877 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117779 Tested-by: Jenkins Reviewed-by: Henry Castro <hcastro@collabora.com>
2022-02-16Extend loplugin:stringview to OUStringBuffer::copyStephan Bergmann
(Somewhat oddly, there is no OStringBuffer::copy counterpart.) This required some modification to StringView::VisitCXXConstructExpr to avoid > In file included from odk/qa/checkapi/checkapi.cxx:29: > In file included from workdir/CustomTarget/odk/allheaders/allheaders.hxx:351: > In file included from instdir/sdk/include/rtl/math.hxx:31: > instdir/sdk/include/rtl/ustrbuf.hxx:1687:16: error: rather than copy, pass with a view using subView() [loplugin:stringview] > return copy( beginIndex, getLength() - beginIndex ); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ while building CppunitTest_odk_checkapi as external C++03 code, where the returned value is wrapped in a CXXConstructExpr. And testing for that case required a new CompilerTest_compilerplugins_clang-c++03 that uses gb_CXX03FLAGS and needs to not set LIBO_INTERNAL_ONLY (via gb_CompilerTest_set_external_code), as compiling as C++03 would otherwise generate lots of errors like unknown char16_t at include/sal/types.h:118. (There was a choice whether to name the new test "-c++03" or "-external", but the issue it tests is caused more by the code being compiled with C++03 than by this being external code, see above.) Change-Id: I873a9c5a70d3ea949cf13a169d46920b71282712 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130036 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-16do not allocate columns in ScTable::GetPattern()Luboš Luňák
Otherwise e.g. going to the last column allocates all columns. Change-Id: I9cbdb18545bb200379616484c46c85ca31833563 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129995 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-16for unallocated columns check default column attributes (tdf#132057)Luboš Luňák
The problem was that this was returning false for the protected attribute just because a column was not allocated, but the default attributes had the flag set (so if the column had been allocated first it would have the flag set too). Change-Id: I2ef1ef40cafb7e8fc6f7b561c0a376af63f2ad26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129984 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-16move simple checks out of DEBUG_COLUMN_STORAGELuboš Luňák
These few look like useful assertions and they should be cheap, so keep only the extensive checks inside the #if block. Change-Id: I9e6851d25d8b4d637041c1efe1d9712d410262e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130003 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-16reenable fuzzing for InsertMatrixFormulaCaolán McNamara
Change-Id: I9a665df74882eb4edac9a1787afe83af5e5e144e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129990 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-16clamp ColumnSpanSet::executeAction() to allocated columnsLuboš Luňák
It's already done by executeColumnAction() and currently existing actions do not need unallocated columns. This prevents allocating all columns e.g. when selecting a full row just because ScDocument::GetRangeScriptType() gets called. Change-Id: I517ce14a756be83a385968549b32d430274b8002 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129993 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-16do not allocate columns in ScTable::GetNumberFormat()Luboš Luňák
Change-Id: I9347f1d638473f9bcca9b96640a71ae1ef09e415 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129997 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-16Resolves: tdf#147398 Test Intersects() instead of Contains(), tdf#119083Eike Rathke
Regression from commit 8406139062d9ffe1daed32aefe4e261c6c55d63e CommitDate: Mon Dec 6 15:45:35 2021 +0100 process broadcasts for adjacent cells together (tdf#119083) that changed single cell broadcasts to blocks of rows broadcasts and - if (rAreaRange.Contains( rAddress)) + if (rAreaRange.Contains( rRange)) but a block of rows may be distributed over several broadcast areas so rRange is not contained within one rAreaRange and thus was not broadcasted. Testing for intersection instead fixes this. Change-Id: I10700296ebc897e4b7b7752e0e6bcb480085b487 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130027 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-02-16tdf#127113: sc: Add UItestXisco Fauli
Change-Id: I3e40d775d95083d96776f3bcd36f92c11110a8a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129986 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-16non-const ScTable::GetFormulaCell() doesn't need to allocate columnsLuboš Luňák
A newly allocated column would contain no formula anyway. Change-Id: I7a9f65e5048c9fb6793caafdd4c60892659a1a57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129998 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-16Fix typosAndrea Gelmini
Change-Id: I3e1e3d214b465f071e57b2e9d349c38aa15657af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126639 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2022-02-16lok: sc: apply local mouse tracking only for CalcHenry Castro
Change-Id: I6c3d4c3c59652f20596e32d3f31c5357b7ed61eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118873 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117778 Tested-by: Jenkins Reviewed-by: Henry Castro <hcastro@collabora.com>
2022-02-16avoid debug build failing on an assert for tdf#144537Luboš Luňák
It really should be an assert, and something is clearly wrong, as the chart shows one row twice after the operation, but I have no idea how to fix this, and it's not that critical, so reduce to just a warning until somebody fixes the problem. Change-Id: Idf0a3496a6f0472301ecb3c0e53ead43312c2f84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129980 Tested-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-16simplify codeLuboš Luňák
Change-Id: I5e5c419f2888d0f305f6b83445c66c187f3e0e8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129979 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-15make ScBigAddress use 64bitLuboš Luňák
It may points outside of the document, so with huge sheets 32bit may not be enough. Change-Id: I7aee1d8e90d6c59b91ec07584aa9f36d9352b55c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129972 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-15move nInt32Min/nInt32Max to ScBigRange and rename to nRangeMin/MaxLuboš Luňák
Change-Id: I4537d6ebcd8293bc7a62651345a517ebfe901638 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129965 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-15remove harcoded MAXCOL/MAXROW from ScBigAddressLuboš Luňák
Change-Id: I670bb5d6e7a1eb20d2bfd48b853d1d2ebf87fe70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129964 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-15Resolves: tdf#147421 Do not use OUString::replaceAll() to strip null-bytesEike Rathke
It reallocates and concatenates for each replacement so for massive amounts takes ages. Change-Id: Ibe1673fd4775c5b95833000669c1a24e718fd77c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129971 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2022-02-15cid#1498147 silence Improper use of negative valueCaolán McNamara
and cid#1498148 Improper use of negative value Change-Id: I651ea2673c740b5563c894290dd4c130b5f2ee7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129957 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-02-15fix SfxItemPool::GetWhich changeNoel Grandin
In commit 339fde9d905135e24b2f4e204009ee289d678b0c Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Tue Feb 15 08:56:13 2022 +0200 add typed GetWhich operations I got the parameter type wrong Change-Id: I7b1d86bc06da7feb3238f5033bbffbd166cd4fdd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129959 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-15lok: sc: introduce LocalStartDrag methodHenry Castro
Update the mouse mode to start drag, otherwise it will conflict with normal cell selection. Change-Id: I6d4939b704114e7de1c9c051459fd02100a7536c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118874 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118203 Tested-by: Jenkins Reviewed-by: Henry Castro <hcastro@collabora.com>
2022-02-15tdf#145745 Create uno:DuplicateSheet commandrafaelhlima
Change-Id: Ic8d37f02d45c6f958bf6133c27997adea9bc8c7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129541 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2022-02-15tdf#134553: sc_jumbosheets: Add unittestXisco Fauli
Change-Id: I43a401376b5ef8215fafb117d90535772440ebad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129960 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-15Clean up some global sal_Unicode[] varsStephan Bergmann
Change-Id: I40823a88ffc6808b45790b212617e31937c0861e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129952 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-15test for jumbosheet named ranges export/importLuboš Luňák
Change-Id: I17df36688187f68be6c3ed564e8b4da42522e489 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129921 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-15don't export a document twice in a test when not neededLuboš Luňák
XPathHelper::parseExport2() exports the document, which duplicates what saveAndReload() does, it's enough to use the first export. Change-Id: I36d740765d9267a45e37bd72c7b68e8dbd1a405c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129855 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-15"&(*xShell)" -> "*xShell"Luboš Luňák
Change-Id: I259ff2b545491591ca5918380208ec96e223e2af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129854 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-15tests for import/export of full-row/column ranges in huge sheetsLuboš Luňák
Check that =SUM(2:2) or =SUM(C:C) are read and written properly. Change-Id: Idf77d4ff5e8d1ee7434f0017289c60ec9d938dcb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129850 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-15finally write entire row/column references as such to ODSLuboš Luňák
The comment from eeea41e2e726dd5d69cd323909e1666efb9de472 saying that we may want to enable this in the future is from June 2015, so I think we may now want to enable this. Change-Id: I4151784dcf46f75e1ca786428c24c7039a713986 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129848 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-15Fix CppunitTest_sc_jumbosheets_test for ASanStephan Bergmann
...cf. test::BootstrapFixture::validate (test/source/bootstrapfixture.cxx), which it uses Change-Id: I77ebb83634ca8a4ae33a370222ac327a9b391874 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129914 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-15tdf#104902 - Handle embedded newline in Calc's .uno:EnterStringAndreas Heinisch
Change-Id: I6377aebb06b6e6873ce61984a887d9e16eecd361 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127766 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2022-02-14tdf#147394: sc: Add UItestXisco Fauli
Change-Id: I0fa20d777247501593ac80ab394407d0570763bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129910 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-14make sanitizers happyLuboš Luňák
See https://gerrit.libreoffice.org/c/core/+/129892 . Change-Id: I28eb22332bff3fca2a204e9fa170eb228f371c30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129902 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-14remove hardcoded MAXCOL/MAXROW from datatableview.cxx (tdf#135332)Luboš Luňák
Also remove the pointless separate Init() functions. Change-Id: I6235047ea472899c0885d86a84a603d7641c3191 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129913 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-14don't gradually move columns to a large distance (tdf#144380)Luboš Luňák
The old code was trying to move the changed columns, each one in a loop, which is O(N^2). Since the changed columns are those that are inserted/deleted (and thus the content shouldn't matter), instead move all the columns after them to the right place, which is O(N). Change-Id: Iad29b945fe9b3525ece43523ba04ecf306797c6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129911 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-02-14cid#1472568 silence Integer handling issues DIVIDE_BY_ZEROCaolán McNamara
Change-Id: I196e3910804902c9251b46497b1626f3470b6171 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129905 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>