summaryrefslogtreecommitdiff
path: root/sc
AgeCommit message (Collapse)Author
2024-02-16sc: pivot table not correct when data and PT cache is not in syncTomaž Vajngerl
It can happen that the pivot table is not updated and the sheet data is changed so much that it doesn't match the pivot table cached definitions. This is a perfectly valid scenario and nothing should be wrong (the pivot table can just be updated once loaded). At XLSX import we should always check the cached definitions, because the pivot table description is made using the cached data, not the actual data. The issue can occur when looking up the name of a PT field we however didn't check the cached definition but checked the sheet data, so because the indices changed so much (many columns were removed in the sheet data) we can not find the actual field name. The solution is simple - get the field name from the cached pivot table definition. Change-Id: I3b5b33f33f3c484f0b66b97ac97200d9913edcfe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163197 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 9af4b5254cbe6a6770ebe78ba14074266b05471e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163178 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-02-16for caching if a font has glyphs, strikethrough and underline don't matterCaolán McNamara
Those aren't part of the font. Likewise it's safe to assume these days that if the glyph appears at one size it will exist at any size. The same isn't through for Bold/Italic. A font like Freesans has, or had at least, glyphs in one variant not in another. So don't treat those properties the same. Change-Id: Iccc291642dfe7e9d2cb06a241a575fd1e4a4bb9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163508 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-02-16kit: editing text in shapes outside the topleft tile has misplaced textCaolán McNamara
keep into account the zoom factor as we do elsewhere Change-Id: I024ba16c2ef47c01f05ffb8630ec0ae3b2d2e5a3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163515 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-16clarify that "twipFactor" converts from pixels to 100mmCaolán McNamara
Change-Id: I7ce9a797b2a2132f0858dafc98bc3a105b8d0098 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163480 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-16calc: sheet protection dialog is asyncHubert Figuière
Change-Id: I33930ae212a8b35a4430df3180f4ffcca86ff870 Signed-off-by: Hubert Figuière <hub@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163495 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-15kit: cell in editing mode shown with dark view bg in light viewCaolán McNamara
open a calc doc in light mode (view 1) and again in another view (view 2) and toggle the second view to dark mode. Now edit a cell in the dark mode view and in the light move view the edited cell background is drawn as dark. bisected this to: commit f0adebce7a64b6c7dd57e10811cbe45767c6a540 Date: Wed Dec 13 17:50:44 2023 +0100 lok: calc: fix for rendering issues on in place editing Change-Id: I5bdd0c1afaf5fa942c1b1f8bc1009b9057656840 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163400 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-15tdf#159483 sc HTML copy: handle data-sheets-value attribute for the bool caseMiklos Vajna
Similar to commit f8c95cf93ce9ab8b9b78f3af03411d0cc2e195ba (tdf#159483 sc HTML import: handle data-sheets-value attribute for the bool case, 2024-02-08). (cherry picked from commit 411158832462b1077a8f5dc6379f2056f2338249) Change-Id: I25ce8c81bd906ac0fb912e125e061516a604e786 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163439 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-02-14tdf#159483 sc HTML export: handle data-sheets-value attribute for the text caseMiklos Vajna
HTML pasting "'01" from google sheets to Calc worked already, but HTML copying from Calc still converted 01 to 1. What's required is to emit a general marker in the HTML output and then the correct data-sheets-value attribute on the relevant <td> element. Add a way to inject a marker in ScHTMLExport::WriteBody() (so data-sheets-* is considered at all) and extend ScHTMLExport::WriteCell() to write the data-sheets-value attribute for the text case as a start. Other types like booleans are not yet handled at export time. (cherry picked from commit 4e2a4fbeb7c44cc47b3cf803cbcc6cba63b3d481) Change-Id: Ib66e92c84235797cb4731e73d0a5b6286b6f3ab3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163365 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-02-14calc: getPartInfo() returns the sheet protected stateHubert Figuière
Change-Id: I67e2a26680895b5c76977109f4c3f9e1638a9f9e Signed-off-by: Hubert Figuière <hub@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163336 Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-02-13sc: add back protect cell tab from cell format dialogHubert Figuière
Also enable the tab in jsdialogs Signed-off-by: Hubert Figuière <hub@collabora.com> Change-Id: I2c4eac029568cc0de4be5ebb6b0f4ae47f2da1a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163263 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit 6cda8155c66bfcd3ebda49ac8254d529629a300e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163287 Tested-by: Michael Meeks <michael.meeks@collabora.com>
2024-02-13pass width hint around as twips and convert to pixel at the endCaolán McNamara
reuse the device setup and twip calculation that GetOptimalColWidth uses and convert to pixel at the end with ViewData::toPixel Change-Id: Ie24a66dda2e642c23ae63ff915829dd910ee44dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163259 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 85db2b8338392525bb138f41a3175203c703bf73) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163285 Tested-by: Miklos Vajna <vmiklos@collabora.com>
2024-02-13tdf#159483 sc HTML paste: handle data-sheets- attributes on a spanMiklos Vajna
Copy multiple cells, including a formula from google sheets to Calc, the formula is handled as a formula by the HTML paste. Do the same for a single cell, then only the result is pasted. The trouble is that the data-sheets-* attributes appear on <td> elements for multiple cells, but they appear on a <span> for a single cell. Fix the problem by extending ScHTMLLayoutParser::ProcToken() to handle the HtmlTokenId::SPAN_ON token and share the code between the <td> and <span> handler, so this markup works in both cases. Note that this is the paste handler, the no changes to the normal HTML import are made for now. (cherry picked from commit c0da56cb3e9f9678cae7142dee03fb706a2aebd9) Change-Id: Id749df9062d8fcb9a2f0acd928585a304efaae28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163296 Tested-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2024-02-13don't invalidate when switching tabsCaolán McNamara
we support 'parts' now with each sheet as a different part so we don't need to force an invalidate on switching tabs Change-Id: If013bb2a2d4de32da21ef6a86cc2237c6e75c0e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163258 Tested-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2024-02-12tdf#159483 sc HTML paste: handle data-sheets-formula attributeMiklos Vajna
When a formula cell gets copied from google docs, the value of the <td> element only contains the formula result. This means once value cells and formula cells gets copied together, the pasted formula cell won't updated anymore when the input values change. Turns out there is a data-sheets-formula attribute on <td> that contains the formula, it seems it uses the R1C1 format. Fix the problem by extending ScHTMLLayoutParser::TableDataOn() to parse this attribute and set a formula on the target cell (rather than a value) if the formula is available. This required also extending ScEEImport a bit, since the HTML paste builds on top of the RTF one in Calc. (cherry picked from commit 7812adb2ed11a3e08be24d3f2f94d14bfd740c55) Change-Id: I720df96ce74a5e865b7329d06f3b719551f31b96
2024-02-09tdf#159595: Data validation without error check allows to enter wrong dataJulien Nabet
Change-Id: If5660f462a07ca571e05a44abcb0e378b6de613e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163064 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit 9925937bb6b9be70befb8886ccc5665eff4ef227) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163020 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-02-09tdf#158326 - Auto Filter: separate sorting and removing of duplicatesAndreas Heinisch
Change-Id: Ide74895508af280f4b0c129689d852635e62dbff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160052 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> (cherry picked from commit 6d0fddb697fd619d11da3469f4dd72782334f3bb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162891 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-02-09tdf#159581 sc: fix multi-sheet ScDocRowHeightUpdaterJustin Luth
Apparently it was caching the first sheet's row height, and applying it to every other sheet. AFAICS, the only time this ever ran against multiple sheets was during import time, so that is why it wasn't easily noticed before 24.2 when XLSX started using it on import. make CppunitTest_sc_subsequent_filters_test2 \ CPPUNIT_TEST_NAME=testTdf159581_optimalRowHeight Change-Id: Ic4e4dd335fa48d02acbc85cfad35feb8eca7597b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163066 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com> (cherry picked from commit 9778d499df3d081314295ae099463870146b7a9c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163027
2024-02-09fix various loplugin warningsCaolán McNamara
Change-Id: I84c6487b025738f7e4fb8b38d731e19a91ce4451 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163168 Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2024-02-09tdf#159483 sc HTML import: handle data-sheets-value attribute for the num caseMiklos Vajna
E.g. have "1,000.00" and "2,000.00" in two cells, paste that into calc, and try to do a SUM() on them, which will fail because the cell content is text. Just data-sheets-value itself would not be good solution, because then we would lose the number format, so the paste result would be like 1000, which is bad for readability if you don't want further operations on the value. Fix the problem by also parsing the data-sheets-numberformat attribute, so far what's clear is that the "2" JSON key there provides a number format string which matches the syntax of Excel/Calc. This gives the best of the two worlds: the output looks like the original, but SUM() works on the cells as well. (cherry picked from commit 789964785a61daab5f8065f006dd7aaf843c7236) Change-Id: Ic7c09ba55a51852f285ad0c05ed42c6771b0f500
2024-02-09calc null-derefCaolán McNamara
probably seen after a sheet was deleted /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f259a642520] /opt/collaboraoffice/program/../program/libsclo.so(+0x5b3db8)[0x7f25873b3db8] /opt/collaboraoffice/program/../program/libsclo.so(+0x4964a1)[0x7f25872964a1] this looks most likely: 00000000005b3db0 ScTable::ContainsNotesInRange(ScRange const&) const 0000000000496440 ScDocument::ContainsNotesInRange(ScRangeList const&) const Change-Id: Ib019fe8abc18538eee7096e1fe5589e83e4849da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163135 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-08tdf#159483 sc HTML import: handle data-sheets-value attribute for the bool caseMiklos Vajna
Copy a cell with boolean TRUE and FALSE from google docs to Calc, the paste result is a TRUE and a FALSE string. The problem is that boolean is meant to be a float 0 or 1 with custom cell format, but we don't build this doc model. Fix the problem by ParseDataSheetsValue() to write the properties of the cell similar to what the normal HTML import would extract from our own markup, like: <td height="17" align="right" sdval="1" sdnum="1033;0;BOOLEAN">TRUE</td> This requires passing around both the value and the numbering properties, since the cell format just decides it's a boolean, but the cell value will decide if it's TRUE or FALSE. (cherry picked from commit f8c95cf93ce9ab8b9b78f3af03411d0cc2e195ba) Change-Id: Id558ced56e02bbe24330d82c3998b047dc8febdb
2024-02-08tdf#159483 sc HTML paste: handle data-sheets-value here, tooMiklos Vajna
HTML import into Calc could already create text cells, but HTML paste with the same content remained auto-converted to numbers unconditionally. Turns out HTML paste goes via ScHTMLLayoutParser instead of the HTML import's ScHTMLQueryParser, so the data-sheets-value was ignored for paste. Fix the problem by extracting the old data-sheets-value handler from ScHTMLQueryParser to a separate ParseDataSheetsValue(), and use it also in ScHTMLLayoutParser. For the actual handling, still only text is handled, no other formats yet. (cherry picked from commit 543e52481e764b8e0eea6cf0123a77cf492bdf8e) Change-Id: I0b2bf4665af331d07624ed42e30a24e31bfca331
2024-02-07ofz: Use-of-uninitialized-valueCaolán McNamara
keep a high water mark of the highest initialized level Change-Id: Ib799331c523209c4f165dc4c40317e25b6b0cc7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162624 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-07check that rtl_random_getBytes() was successfulMichael Stahl
... everywhere it is used to generate material for encryption. Change-Id: Id3390376bb2f3a5fa1bbfd735850fce886ef7db2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162873 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit b85c2459ced6a41915dbaf567613fb5e244a0ada) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162890 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-07tdf#158440: do not extend transparent colorHenry Castro
Avoid to extend the area of transparent colors. Signed-off-by: Henry Castro <hcastro@collabora.com> Change-Id: Ie492e6fea2c3d8b785cfbb96fe7cfc31d87b9996 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163022 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-06perf: limit to max 1024 rows in cases where we originally allocated 1024 rowsCaolán McNamara
so everywhere before: commit a86c00414a43c5d87981ffae1018cb242c5e5e1d Date: Fri Jan 19 14:27:10 2024 +0200 cool#6893 reduce allocation in ScGridWindow::PaintTile where ScTableInfo was used with no args, pass true to indicate this is just a hint, and where it was originally passed an explicit number, pass false for "hint" (which was just one case, the case that now passes TopLeftTileRow, nBottomRightTileRow. When hint is true limit to max of 1024 rows, and the apparent case is visible in ScGridWindow::UpdateFormulaRange at https://github.com/CollaboraOnline/online/issues/6893#issuecomment-1921141048 Change-Id: Iebe890c3ac967800b60150aaa71f7e845a021f60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162875 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit e4410bd37fc018c851b5ebf9cf011d59af6a2ad9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163016
2024-02-06tdf#159131 Calc is laggy when moving a line (row)Noel Grandin
revert 69910b540ae5140123fd2d4d67a9d338f980db53 and add a couple of pre-emptive reserve calls, to prevent repeated resizing. I'm not sure why the above commit causes trouble on Windows, but not Linux, something in the std::vector::reserve implementation no doubt. Change-Id: I858303a0a1e12d204fd3bbccc6c6c7ce57564e5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162746 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 21dd07f95d7dcb95f243753306108c18d9ba115a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162726 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-02-06tdf#159412: make sure to keep the value while changing the typeMike Kaganski
SbxValue::SetType clears the original value. We need to use the Get/Put cycle, asking for a specific type in Get, and then making sure that the variable is not fixed on Put. Change-Id: I0a6c106d511e8491c89a5a2153f47a708f83ee1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162664 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 4541614e5f88604b4b1e17b0223d11c2e330d451) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162622 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-02-05lok: calc: missing invalidation of position on undo a drag and dropMarco Cecchetti
When undo/redo a drag and drop of a block of cells cached position was not invalidated. Change-Id: I538815bba46f6759db3b09a583eca9481148cdbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162915 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162991 Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2024-02-05lok: calc: missing update of sheet geometry data on undo a drag and dropMarco Cecchetti
When undo/redo a drag and drop of a block of cells sheet geometry data was not invalidated. Change-Id: I0579de814ed61357c70a64d0e4ebf862525d3c79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162776 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162990 Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2024-02-05lok: calc: missing invalidation of cached positionsMarco Cecchetti
When executing an external paste position cached by ScPositionHelper where not invalidated causing misplaced tile rendering Change-Id: Ia707e8de5a870f42a6dd303d87694f7ec8f0a105 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162775 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162989 Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2024-02-05lok: calc: rtl - misplaced caretMarco Cecchetti
This is a workaround since text cursor is horizontally a few pixels misplaced wrt text in the RTL case. This issue is a regression from https://gerrit.libreoffice.org/c/core/+/162196 Change-Id: Ia06ee223d01a7df8841bfaca3cad32af896871d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162563 Reviewed-by: Henry Castro <hcastro@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162988
2024-02-05lok: calc: GridWindow size not updated for some viewMarco Cecchetti
The grid window size was updated for the view used for painting and not for other views with the same zoom level. In fact the grid window size was updated in ScModelObj::paintTile only. Now the required updating is performed in lcl_ExtendTiledDimension and ScTabView::SetCursor, too. In order to get this working it has been neede to revert changes in `ScModelObj::setClientVisibleArea` introduced by https://gerrit.libreoffice.org/c/core/+/161907 Change-Id: Ie8f585b861b0c916624d8e2f9d828cf23b799672 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162406 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162987 Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2024-02-05lok: calc: fix for rendering issues on in place editingMarco Cecchetti
Our main problem is how to compute the correct output area for the requested tile zoom level. The old solution was using a fine-tuned edit rectangle as output area. An edit rectangle is the rectangle computed according to the range of rows and columns involved in the text editing. Unfortunately in some cases the edit rectangle can be enough larger than the output area. For instance that occurs with centered text. The new proposed solution is able to scale the output area to the requested tile zoom level by a few pixels (0 up to 3) offset/size error. The hope is to reduce the error in some follow-up patch. The new solution is also able to perform painting of text edited by different views in the correct order. The last painted text is the one belonging to the last view where editing occurred. SfxViewShell::maEditViewHistory keeps track of the last 10 editing events per document. Change-Id: I8f1035a730cb2b94b0990f3c8eb6445511b94223 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162196 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162986 Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2024-02-01tdf#159483 sc HTML import: handle data-sheets-value attribute for the text caseMiklos Vajna
The A2 cell in the bugdoc has 01 in it, which was auto-converted to 1 (float) value on import, even if it was text originally. This is hard to solve for HTML in general, which is not typed, but this input is coming from google sheets, which has an additional data-sheets-value attribute on <td> that does tell us about the type of the cell. Fix the problem by handling that attribute, and in case it explicitly says it's text, then apply the matching number format. Other types are not yet handled. (cherry picked from commit e6e5660b726ecf3b0c39b277568568973b43c9f0) Change-Id: I2986ef864e97d9c46d191aba25ca5740a1151a71
2024-01-30Implement Async AutoCorrectQuery Dialogs for Formula Check in calccodewithvk
Key changes include: 1. Decomposition into Four Methods: The core logic of formula processing `ScViewFunc::EnterData` has been divided into four distinct methods: `parseAndCorrectFormula`, `runAutoCorrectQueryAsync`, `finalizeFormulaProcessing`, and `performAutoFormatAndUpdate`. This modular approach improves code readability and maintainability. 2. Introduction of `FormulaProcessingContext` Struct: To manage the complexities of asynchronous behavior and parameter passing, a new struct `FormulaProcessingContext` has been introduced. It acts as a central state holder, ensuring parameter persistence throughout the asynchronous operations and avoiding scope-related errors. 3. Recursive Dependency and Loop Replacement: The methods `parseAndCorrectFormula` and `runAutoCorrectQueryAsync` are interdependent and recursively call each other. This recursive strategy effectively replaces the previous `do while` loop in the code, streamlining the process of formula correction. 4. Asynchronous Dialog Invocation: The `runAutoCorrectQueryAsync` method now handles the asynchronous triggering of AutoCorrectQuery dialogs. This change significantly improves the user experience by preventing UI freezes during formula processing. Overall, this commit achieves the goal of making AutoCorrectQuery dialogs asynchronous while refactoring `ScViewFunc::EnterData` for better code structure and performance. Signed-off-by: codewithvk <vivek.javiya@collabora.com> Change-Id: If159b98d54c0eaed41789eca7913a929b1e19c1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161906 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162741
2024-01-29lok: notebookbar: fix number format fieldSzymon Kłos
- number format filed is inside different container in online - make it working again by putting into standalone sfxlo-NotebookbarToolBox Change-Id: Iecf85aad598cc5a68b5128e32f27818f2b372d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162683 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2024-01-29lok: notebookbar: enable currency dropdownSzymon Kłos
Add .uno:NumberFormatCurrency item to .ui Use weld:: way of widgets creation so we can inject jsdialog code and popup will be correctly registered. Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: Ib57e1cad617ca5c7198d67e107441ba062580f06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161829 (cherry picked from commit 91df0cafa87692b5c924c44b9c7adf4a8d6f3e34) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162623
2024-01-29tdf#159329 Fix AutoFilter arrow color in dark modeRafael Lima
When using dark mode, the arrow is black over a dark background. This patch makes it use the dialog text color for better contrast. Change-Id: Icf07d50599191417dee294e1f4c925fe1a8a7655 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162460 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> (cherry picked from commit b0f678ca59a65a3c302c3c3a499230fbc52ed5bd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162615 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-01-29tdf#158652 notify navigator on insert/edit/delete commentOliver Specht
links changes of the drawing engine to comments as it was done before with pictures, shapes and OLE objects ui unit test included Change-Id: I4fde3a82b80e73758fb3da94ed2553453d09e9ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160624 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> (cherry picked from commit 0097f8595791f4bbf499ebd423f4f80ec8e38dbe) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162381 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-29Use correct type when getting document colorsSzymon Kłos
After commit 0460be8848b0ce02c07183e41dd7137ac3b94164 Send document colors with lok callback There was issue detected by CI: /sc/source/core/data/document10.cxx:198:46: runtime error: downcast of address 0x6100000efa40 which does not point to an object of type 'const SvxColorItem' 0x6100000efa40: note: object is of type 'SvxBrushItem' 00 00 00 00 b0 79 19 48 ce 7f 00 00 01 00 00 00 94 00 be be 4c 17 00 00 a0 be be be cc cc ff 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'SvxBrushItem' #0 0x7fce1fbed369 in ScDocument::GetDocColors() /sc/source/core/data/document10.cxx:198:46 Change-Id: I41f28b6bb54d7720d58c16d75b9d116a53f106cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162076 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2024-01-25CppunitTest_sc_tiledrendering2: extract one test from the old, large suiteMiklos Vajna
Not a split, to avoid too many conflicts while cherry-picking, but at least create a new suite where next tests can be added without too much build time after source code edits. (cherry picked from commit a2763fe7b6f22e3e65d7e0db62b6ada967ccdd61) Change-Id: I494df6e23941845a433aab6ec5ecef040feab30e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162473 Tested-by: Jenkins
2024-01-23produce non-overlapping invalidation rects on extending calc tiled areaCaolán McNamara
the intent is to create two rects, one for the area extended to the right and another for the area extended to the bottom, but they overlap so they end up merged and a single rect of the entire sheet is created which is defeats the original intention. Change-Id: Ie5b46ee1a36780d9f7a90ed11ebfd1264c17477a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162412 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162448 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit ac1cafad398b13a831de913e11143760fd6b822b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162484 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-23don't always invalidate the entire width of the calc windowCaolán McNamara
If know the max width affected we can avoid redrawing much of the row LTR cell edits, deletes, single line paste Change-Id: Ib7e3d8bfa3a5ce7df97f28bcf7858b3abcb752a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162408 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162483 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-23calc doc with saved zoom in settings causes disjoint invalidations...Caolán McNamara
in multiple views, while the invalidations rectangles should be reported at the same place from each view. on load, ScTabView::SetZoom gets called with the zoom stored in the document settings, which both calls sets Zoom on the ViewData, and then calls ZoomChanged, which syncs the GridWindows MapMode from the ViewData derived GetDrawMapMode(). Later lok sets zoom via setClientArea which leaves the GridWindows MapMode untouched and out of sync with the newly changed ViewData MapMode. Typically then, on e.g. on deleting text in one view then ScViewFunc::DeleteContents or similar is called which calls ScTabView::UpdateCopySourceOverlay which calls ScGridWindow::UpdateCopySourceOverlay and that sets the GridWindow MapMode to the DrawMapMode but then *for lokit* returns early (among a few other unlikely early return cases) while every other similar func restores the orig GridWindow mode before returning. So the view which is used to make the change ends up with GridWindows synced to the ViewData MapMode, which looks like accident. While the other view remains with GridWindows with MapModes unsynced with that views ViewData MapMode. So on invalidate, the view that was used to make the change has GridWindows with MapModes that report the correct rectangle, while the other unsynced view will report an incorrect rectangle, until something happens in that view to get it to exec UpdateCopySourceOverlay and get synced. Here add the sync to ScModelObj::setClientZoom so the two MapModes remain synced once that is called. Change-Id: I2da59f50ae2b0e3ea6b7ef8b54debdab1ee98266 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162312 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162322 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 7edfb1b85cef5e5435cd2bf46e1b91b68f1e6427) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162482
2024-01-23cool#7769 Reduce unnecessary invalidations on calc saveCaolán McNamara
https://github.com/CollaboraOnline/online/issues/7769 Reduce unnecessary invalidations. Don't invalidate windows if layer visibility didn't really change. Change-Id: Ic2abd78d60aea2e8676c8e56608cf51e941f5918 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162481 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-23complete filename isn't meaningful in this modeCaolán McNamara
Change-Id: Icc5bdac688ca6b328dcf097c9638b4e6df211332
2024-01-23sc: make inactive sheets movable and copyableBayram Çiçek
- move and copy use the same ScViewFunc::MoveTable function - added 3 new parameters to "SfxVoidItem Move FID_TAB_MOVE" - SfxBoolItem FromContextMenu FN_PARAM_4, - SfxUInt16Item ContextMenuIndex FN_PARAM_5, - SfxBoolItem MoveOrCopySheetDialog FN_PARAM_6 - moveLeft and moveRight of inactive tabs are implemented - move and copy of inactive tabs from the Move/Copy Sheet dialog are implemented - made Move/Copy Sheet dialog async Change-Id: I97461780a6c46f601bce9490315cd5cbea9505d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158078 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com> (cherry picked from commit 4d5f8b43b04734805f48b921b98a74fd9ab67d0f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162387 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-01-23use a ScopeGuard to restore the original map modeCaolán McNamara
in these cases the original map mode was *not* always restored, but the intent seems to be like the others that the mapmode should be the same on exit as on enter. Change-Id: Id7b668a9977c4c84df5234288baca8bd6f4232e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162276 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
2024-01-23use a ScopeGuard to restore the original map modeCaolán McNamara
in all these cases the original map mode was always restored so there is no change for these examples. Change-Id: Iec24b2cd269b9408dac6404e054b3bb989ec7744 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162306 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 30ed30b1117a41f016aa5b09ce21d2cb3004fdc3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162275 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>