summaryrefslogtreecommitdiff
path: root/sc
AgeCommit message (Collapse)AuthorFilesLines
2019-05-02Resolve deprecated implicit capture of *this by reference in C++20Stephan Bergmann1-1/+1
...as flagged with -Werror=deprecated by trunk GCC in -std=c++2a mode. But C++17 forbids "this" in combination with a capture-default of "=", so in such cases list any entities explicitly that shall be captured by value. Change-Id: Ic228cd20682277a0f93e3e75798356d0fbbb80d4 Reviewed-on: https://gerrit.libreoffice.org/65241 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit c56a8280bdd605f77f0075a7f2bfa474aa2a26e5) Reviewed-on: https://gerrit.libreoffice.org/71661 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-01tdf#124241 let dialog be resizableCaolán McNamara1-1/+0
so it can shrink to its optimal size Change-Id: Ia83b8b29a56e0e232956770a3a3374035db2c6ef Reviewed-on: https://gerrit.libreoffice.org/71577 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 1ae5ca077119982ae83833871326c86d9930ae11) Reviewed-on: https://gerrit.libreoffice.org/71615 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-04-30multiple concatted AcceptChgDat stored in configCaolán McNamara1-17/+28
FillInfo is called more often than Initialize, so we've ended up with multiple AcceptChgDat strings Change-Id: I99e9398757d63e2c6315ec9c3101910d5978b13b Reviewed-on: https://gerrit.libreoffice.org/71120 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-04-27Fix CppunitTest_chart2_xshape failing with Display Scaling on WindowsMike Kaganski1-0/+12
See thread starting at https://lists.freedesktop.org/archives/libreoffice/2018-December/081589.html Regression from commit 7263d223ddf42cc39d10a501159c7b04ef48df96. That change has made unit tests DPI-aware; and then some tests started failing on systems with resolutions other than 96 DPI. It has been suggested that the proper fix would be to do for Windows what commit ada20402efa81273e03e46cbedc21f25b9daeeac did for macOS. Another approach would be to fix all the tests to be DPI-aware. I cannot do the first mentioned fix; so I have fixed testFDO74215 test in sw_ooxmlexport4; and added DPI checks to the other failing tests in chart2_xshape and sc_subsequent_filters_test to skip testing when using non-default DPI. This is not ideal, of course, and conditionally skipped tests need to be re-enabled unconditionally once a proper fix arrives. Change-Id: I5c92cfe93ae65f53a8a180fcaec49231df377b8a Reviewed-on: https://gerrit.libreoffice.org/65595 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 9520378e37b97b0a44130c86be482060465b479e) Reviewed-on: https://gerrit.libreoffice.org/71356 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-04-26tdf67629 FILEOPEN Particular .xlsx hangs SpreadsheetNoel Grandin1-0/+3
Seems like this is a somewhat pathological document, has lots of duplicated ranges. Checking for duplicates makes it load in <10s on my machine Change-Id: I25da24e0f8b1d4ad99d00474be168c75586ea579 Reviewed-on: https://gerrit.libreoffice.org/71251 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit e1ebb5cb58edc325bb30bb5eb992665fb861960f) Reviewed-on: https://gerrit.libreoffice.org/71379
2019-04-24Skip clipboard queries while the document is still loadingKatarina Behrens1-1/+2
Use-case here is .ods document with 16k tracked changes. For every tracked change, Calc generates a formula cell. For every formula cell, clipboard content is queried (via ScDocument::IsClipboardSource, ScModule::GetClipDoc respectively). This is dog-slow on Windows Therefore don't query clipboard content while the document is in the process of being loaded. Instead return from ScDocument:: IsClipboardSource early and return 'false' because at this point of time it can't be reliably determined whether this doc is a clipboard source anyway Change-Id: If5aa62cbfb62fb326a3c73b4d9be839127d3c03b Reviewed-on: https://gerrit.libreoffice.org/71121 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 9c8aa1c217f016fae9a57c6a4feca43551e5068e) Reviewed-on: https://gerrit.libreoffice.org/71146 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2019-04-16tdf#124676 : use case-insensitive normalization of...Dennis Francis4-62/+60
ScDPCache field labels, else on export to xlsx, Excel will fail to load the pivot table due to case-insensitive duplicate field labels in the pivotCacheDefinition1.xml. This could be done just for xlsx export filter, but we do normalization in dpcache.cxx anyway and it would not hurt if we do a case-insensitive normalization here. The private member ScDPCache::AddLabel had code duplication and more importantly it is called in loop for every label in the database so results in O(n^2) time complexity where n is the number of labels, so removed it to reuse normalizeLabels() at the only call-site. Also added a unit test that checks case-insensitive normalization. Change-Id: Id563dee232a98a2aea9f4fc29254f6942e1c5ba7 Reviewed-on: https://gerrit.libreoffice.org/70498 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.francis@collabora.com> (cherry picked from commit 238cadd315901cbacfd9304bb1205e9f53f13eae) Reviewed-on: https://gerrit.libreoffice.org/70703
2019-04-16tdf#123421 : xlsx export : Don't write data field entry...Dennis Francis5-4/+65
under colFields tag if there is only one data-field. <colFields count=[*]> <field x="-2"/> <--- -2 indicates data field. </colFields> Excel 2013/2016 seems to crash at the presence of '<field x="-2"/>' in colFields when there is only one data-field. Additionally, call GetOutputRangeByType(sheet::DataPilotOutputRangeType::TABLE) on all ScDPObject's in non-const mode, so that the internal pOuput member of ScDPObject is populated. Otherwise the const GetOutputRangeByType(sheet::DataPilotOutputRangeType::TABLE) call always return an invalid range. This also adds 2 unit tests :- 1. To check the presence of <field x="-2"/> in colFields tag if there are more than one data-fields. 2. To ensure the absence of <field x="-2"/> in colFields tag if there is only one data-field. Change-Id: I8f470bd1ab883f73586f04a3fcc30e3fbf948c4a Reviewed-on: https://gerrit.libreoffice.org/70316 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit 97af58093978d8e6b9d90eedcc59141304e7200e) Reviewed-on: https://gerrit.libreoffice.org/70704 Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
2019-04-12Resolves: tdf#124613 stray .05 at end of GtkAdjustment lower valueCaolán McNamara1-2/+2
Change-Id: If42b676c3321d73455771b6ea62aefb806caccd2 Reviewed-on: https://gerrit.libreoffice.org/70674 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-04-11tdf#122767 sc opengl: fix rendering artifacts after hiding a cell commentMiklos Vajna1-4/+13
Actually this is not specific to opengl, affects e.g. the Linux gen backend as well, it just doesn't happen with the Windows gdi backend. The rendering of the caption itself was OK. Focusing on the arrow polygon at the end of the comment's "tail" (connector polyline): - What gets painted is determined by SdrCaptionObj -> ViewContactOfSdrCaptionObj::createViewIndependentPrimitive2DSequence(), which produces a PolyPolygonColorPrimitive2D, which is then processed by VclPixelProcessor2D::tryDrawPolyPolygonColorPrimitive2DDirect(). - The polygon passed to VCL there is within the bounds of the invalidation rectangle set in ScNoteMarker::TimeHdl(). So it seems the only reason sometimes these 1px rendering artifacts are left around is anti-aliasing. Fix those by simply extending the invalidation rectangle in each direction. (cherry picked from commit 37aa4f0d64e276c46821ef6122483fb6b4c04781) Change-Id: I37b8e666999d3ff5ee1328fca7ac017ee8c7e9e0 Reviewed-on: https://gerrit.libreoffice.org/70585 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-04-08tdf#124327 sc opengl: fix lack of AA text in chartsMiklos Vajna2-1/+6
Commit 708d1c5ab242b545ced598879233fc662d7e6cc0 (sc lok: emit RowColumnHeader info in twips, 2015-11-02) and later commits improved precision of the Pixel Per Twips (PPT) factor in Calc, but this caused offset problems in PDF export. So the LOK case uses double precision and otherwise we use limited precision since commit 616fd241838069e18c59064e33c4b24f5ae112c6 (tdf#115262 sc: fix cumulative placement error of images, 2018-10-01). It turns out this double precision was also useful in the opengl case: if UI scaling is set to 125% on Windows, then this helps producing AA text for charts. Given that unlimited precision is the direction we want to go, enable double precision for the GL case as well, not just for LOK. Verified that tdf#115262 is not re-introduced in the GL case, also that manual PDF export (with GL enabled) does not produce the mentioned unexpected image position offsets. (cherry picked from commit 7069ec6de9807d12ff9ad52ecbb66ea7dc373723) Change-Id: I23a8d6dce1b48c178977bda9909feb59fe8f3ad8 Reviewed-on: https://gerrit.libreoffice.org/70410 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-04-08Related tdf#124329 Handle shapes resizing with the cellSamuel Mehrbrodt1-4/+10
The same as shapes just anchored to the cell. Change-Id: I0ce03e4c650dd10bd89cee87aa26775c32703d06 Reviewed-on: https://gerrit.libreoffice.org/70065 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit e587645f551c6c684f9f36606f8fa5e1b06004a1) Reviewed-on: https://gerrit.libreoffice.org/70401 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-04-06tdf#124326 : ScUndoDragDrop : don't do update references...Dennis Francis1-4/+0
on undo, as all affected formula-cells are preserved in original form in the undo document. This is ensured by the drag-drop move-block code (ScDocFunc::MoveBlock) which in-turn calls ScDocument::UpdateReference, which records all original formula-cells to the undo-document. Anyway the sc::RefMovedHint object created in ScUndoDragDrop::Undo is wrong, as it operates on original data-range(aCxt.maRange = aSrcRange) which is interpreted as "old data-range" in the context of undo-move operation. Change-Id: Ic48cc3fa51fdb17e9338f65ac95b8e8d30c2c92c Reviewed-on: https://gerrit.libreoffice.org/70315 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 9079da7f62febaf4cef0b77320c31b4e8bb6b5a5) Reviewed-on: https://gerrit.libreoffice.org/70327
2019-04-03tdf#120270 : ScUndoDragDrop - Notifying listeners of the area...Dennis Francis1-27/+1
is not enough. This needs to be done recursively, ie notify the listeners, notify the listeners of the listeners and so on. ScDocument::BroadcastCells() seems to do exactly that, so lets use it here intead of collect+notify. Change-Id: Ifa273fea5f08af661958cd9b4c3d01d9044b8727 Reviewed-on: https://gerrit.libreoffice.org/70044 Reviewed-by: Dennis Francis <dennis.francis@collabora.com> Tested-by: Dennis Francis <dennis.francis@collabora.com> (cherry picked from commit 86ba9cdc69976d9cdb7d6ec1a527012647abf10d) Reviewed-on: https://gerrit.libreoffice.org/70179 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
2019-04-03tdf#121103 ANOVA sum of squares formula correctionJaromir Wysoglad1-2/+1
The ANOVA sum of squares is now hardcoded to use '$Sheet?' in the source cell addless every time. Change-Id: I215b719be11ecfc2ae20c5df8e86876bc22d50f0 Reviewed-on: https://gerrit.libreoffice.org/69899 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 66c08a0d308fd6119460546a906434bbc9d23c2e) Reviewed-on: https://gerrit.libreoffice.org/70153
2019-03-29tdf#120660: Populate rNewSharedRows even if no FC...Dennis Francis2-16/+55
at specified position. At least in case of ScUndoPaste, during undo operation, the content from changed area in main-document is removed before actual undo-paste, so when cloned formula-cell from undo-doc is inserted to main-doc, there is no "old" cell to detach, so "rNewSharedRows" is not populated which is needed for proper re-establishment of listeners if there are formula/ formula-groups adjacent to insertion position. Change-Id: Id2bfb65a2a7a5abb03effbdcc4405015fddc401c Next: fix the vector version of this case and write unit tests. Reviewed-on: https://gerrit.libreoffice.org/69737 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit e7d0785a7d2a07e64dc58dee4f1b072a72e32aa5) Reviewed-on: https://gerrit.libreoffice.org/69905
2019-03-28Unit tests for tdf#121002 tdf#120013 tdf#123714 tdf#123736Eike Rathke2-0/+736
This is a combination of 4 commits. Add unit tests for tdf#123736 and related unshared/regrouped listening Reviewed-on: https://gerrit.libreoffice.org/69372 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 8925bd2efca8dd07a3ac044ecbc6505bb7bfa0a6) Unit test for cut copy move into shared formula group reference, tdf#123714 Reviewed-on: https://gerrit.libreoffice.org/69453 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit f81d532648ccbbd08d3cb568eadc9f402dac67ad) Unit test for cut copy move with a group reference adjusting along, tdf#121002 Reviewed-on: https://gerrit.libreoffice.org/69532 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 92657eed57548511f26f0c22f1bbc47d554c8b5b) bcf03f5068630c18eeecf2625cdff7ec1704d292 4f3731e2236f1b8be97a6f5d21e32e678610fecb Unit test for cut copy move intersecting a formula group run, tdf#120013 Reviewed-on: https://gerrit.libreoffice.org/69568 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 6280b5c1c62ad40b5b9780a93c7cbee9ca0260f8) ce7e1e42dba7bfbc2db6a60e4457c3610430b87e Change-Id: If48e6d75288b42b47c90f3104006b7c52982c9f6 Reviewed-on: https://gerrit.libreoffice.org/69555 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2019-03-28avoid a crash with an editor-forced matrix formula (tdf#123479)Luboš Luňák2-14/+19
Normally when ScInterpreter has bMatrixFormula set, pMyFormulaCell is set as well (done in the ctor). But in some rare cases, this may not be so, and some functions such as ScRandom() already check for this. But not all do, tdf#123479 specifically crashes because ec97496525f82f added AssertFormulaMatrix() to force bMatrixFormula be set without pMyFormulaCell being set, and ScColumn() doesn't handle this case. Fix this by trying to pass ScFormulaCell* to ScInterpreter when AssertFormulaMatrix() is used, this should ensure the result in the formula editor fits better the edited formula. Since there still may be cases when the cell is not set (e.g. editing a new formula), also handle that case gracefully. Ideally ScSimpleFormulaCalculator should pass ScMarkData to ScInterpreter in such cases so that those functions use that when they can't use GetMatColsRows(), but currently the handling of selections is rather poor in the formula edit dialog: Non-array formulas are simply entered in one cell and the selection is ignored, in case of a multi-selection there's an error dialog only after the dialog is closed, and the result field of the dialog is rather small and doesn't scroll, so e.g. matrix result of ScRandom() wouldn't show more than one item anyway. Given that tdf#123479 is a priority bug, better just fix it and possibly handle selections better somewhen later. Change-Id: I5fcbe1e358fac3623d4917eb0ead8eae00a1e153 Reviewed-on: https://gerrit.libreoffice.org/69161 Reviewed-by: Dennis Francis <dennis.francis@collabora.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Luboš Luňák <l.lunak@collabora.com> (cherry picked from commit ade1df0948563b532a5d293c31d46a4f042559ee) Reviewed-on: https://gerrit.libreoffice.org/69849 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-03-26tdf#122989 remove update check from notebookbar for the momentThorsten Behrens4-56/+0
Temp fix, since update check is an extension, and extensions can't currently modify notebookbars. This needs implementation of something like https://wiki.openoffice.org/wiki/Framework/Article/Addon_Menu_Toolbar_Merging for notebookbar popup menus. Such that Addons.xcs provide some merge points with notebookbar menu IDs, we can then plug into existing popup menus. Change-Id: If30525fec1e7be0429e351588614618c5f56cdd4 Reviewed-on: https://gerrit.libreoffice.org/69735 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 98174e163348ab44461f114142bc546e97720eec) Reviewed-on: https://gerrit.libreoffice.org/69741 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
2019-03-26Resolves: tdf#120013 tdf#123714 tdf#123736 shared formula group splitEike Rathke7-69/+358
This is a combination of 7 commits. Resolves: tdf#123714 tdf#123736 all split formula groups; tdf#120013 related Add all split shared formula groups to regrouping and mark for listening, even if the references had not be to adjusted. This partly also resolves tdf#120013 but there's more to that, a remaining partial group is not updated. Reviewed-on: https://gerrit.libreoffice.org/68951 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 7fdc5df36f5b50e0629405a47ff3d5765fcfeb93) Resolves: tdf#120013 tdf#123714 split-off group or single cell needs listening Reviewed-on: https://gerrit.libreoffice.org/69066 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 5c27a048658afcd2f78ef4d7e6c7128554ed3f4c) Resolves: tdf#123736 re-establish listeners for unshared formula groups ... when replacing one of their formula cells, with another formula cell or any other cell, passing through DetachFormulaCell() Reviewed-on: https://gerrit.libreoffice.org/69221 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 1634a6d926c6cfd8fe92be1f3ae6083d2fb80f5e) In case of sc::NoListening only SetNeedsListeningGroup(), tdf#123736 follow-up Reviewed-on: https://gerrit.libreoffice.org/69303 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 6160025b27e97841321be29863bb1efd8c194a5f) Related: tdf#123736 re-establish listeners also for vector unsharing ... via DetachFormulaCells() Reviewed-on: https://gerrit.libreoffice.org/69320 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 564d0d145cf9c164ea9c717b4b2113fd971fa0af) Reget position_type as the block or type may have changed, tdf#123736 related Reviewed-on: https://gerrit.libreoffice.org/69358 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit e5de84e73ffbaa1a45ab787750f5997582bbfa49) Listening when grouping in ScColumn::AttachNewFormulaCells(), (tdf#123736) Not directly related to tdf#123736 but similar approach. Setting a vector with ScColumn::SetFormulaCells() is currently only done for Undo documents, but implementation provided listening as only single cell listening for not-undo/clip documents, which wouldn't work if actually used in grouping context. The upcoming unit tests will use SetFormulaCells() for checks. Reviewed-on: https://gerrit.libreoffice.org/69371 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit de024e572dd7a588f82b84c68daa2051ec6b20e9) c511f618e9dde2288491c01cfcd889970fd6e4e5 d527307ef5278d87345c6dbfab9d05cb490dfe6c 3e5a5334dfe11002b526f942463626b62efbc340 a57308495a06e0df612eb1610b5f387d6b60ce08 2faf3e74d95cb1f3088f20cbb7de7ba965a6de21 990e6a5d6e1efcf70a2661b3a9a39c37d9e4c2e6 Change-Id: If6d1fef7e545017232a1b7e29b4d60dd58775e88 Reviewed-on: https://gerrit.libreoffice.org/69554 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.francis@collabora.com> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2019-03-25Use RegexMatcher.find(pos, status) call on old ICUTomáš Chvátal1-2/+12
The RegexMatcher.find(status) is new since icu 55 and this works even on the old releases thus revert there to the available albeit slower call. Change-Id: I964c10efd15515b04ac9037cda3b5b309910baf5 Reviewed-on: https://gerrit.libreoffice.org/69311 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/69312 Reviewed-by: Tomáš Chvátal <tchvatal@suse.cz> Tested-by: Tomáš Chvátal <tchvatal@suse.cz> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-25tdf#124318 FILEOPEN: XLS Hyperlink URL incorrectNoel Grandin1-1/+3
regression from commit 52f69445c55c9af8ad97bee6da335b4592d56d4d Date: Wed Aug 1 17:03:18 2018 +0200 loplugin:stringloop in sc Change-Id: I7d481ea27866fc146c5de9d027aa7bb308f14e52 Reviewed-on: https://gerrit.libreoffice.org/69652 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 756252ce13f541049af620983f6741223d44573b) Reviewed-on: https://gerrit.libreoffice.org/69660 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-25tdf#114969 XLSX export: fix 'sheet.name.with.dot'!A1-like linksTünde Tóth3-5/+21
When the sheet name/cell address separator was an exclamation mark, bad conversion of the optional dot separator replaced the last dot of the exported sheet name, resulting broken links: 'sheet.name.with!dot'!A1 Change-Id: I84fb6c8da345c144b04657ea350f1f96614071b7 Reviewed-on: https://gerrit.libreoffice.org/69272 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 37a3af2413f9407639157caef67d7d5168230e49) Reviewed-on: https://gerrit.libreoffice.org/69583 Reviewed-by: Tünde Tóth <tundeth@gmail.com>
2019-03-20Resolves: tdf#124024 scaling factor isn't displayed correctlyCaolán McNamara1-1/+1
Change-Id: If08731217c0839ebd8d51399bb0dd1a3b598dceb Reviewed-on: https://gerrit.libreoffice.org/69421 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-03-20tdf#120161 sc: pdf export unit testSerge Krot3-0/+382
Change-Id: I42579d4d61be43318f7e2b06b3465890dd624a12 Reviewed-on: https://gerrit.libreoffice.org/69035 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 87bf5a930a72a12f88a21b450da0dd86348c3077) Reviewed-on: https://gerrit.libreoffice.org/69411
2019-03-19Related: tdf#122301 TRANSPOSE() with ForceArrayReturn on callerEike Rathke1-1/+1
This is a combination of 2 commits. Related: tdf#122301 TRANSPOSE() with ForceArrayReturn on caller As stated in ECMA-376-1:2016 OOXML 18.17.7.327 TRANSPOSE "The formula containing the call to TRANSPOSE shall be an array formula [...]" Similar to commit d0ded163d8e93dc5b10d7a7c9bdab1d0a6a50bac CommitDate: Wed Jan 16 11:17:14 2019 +0100 Related: tdf#122301 FREQUENCY() with ForceArrayReturn on caller Reviewed-on: https://gerrit.libreoffice.org/68436 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 5413c8871dec08eff19f514f5f391b946a45c86c) ocMatTrans with ForceArray Now that OOXML reveiled that the formula expression containing a TRANSPOSE() call shall be in array mode, the old comment about Excel not forcing array on the argument (in BIFF token class) makes sense. Use ForceArray and remove now moot comment. Reviewed-on: https://gerrit.libreoffice.org/68509 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit d2be2f1aebb883c74460d049a5e2b821ecd5947c) Change-Id: I617bfcc0b8ecb244df3441ab885ec926efd77e3f ab2bced788de3429aab2bb7c3ca7f24d5dbf0340 Reviewed-on: https://gerrit.libreoffice.org/69275 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-19do not access uninitialized values when printing (tdf#121439)Luboš Luňák2-7/+21
The assert in the bugreport is triggered by ScPrintFunc::CalcPages() passing uninitialized values of nEndRow (and others). These variables apparently get initialized only by constructors that take ScPrintState. These ctors also set (the somewhat poorly named) bState and the call to CalcPages() is guarded by this. However, GetPrintState() will simply create ScPrintState filled with these uninitialized values and later on this will be used with these ctors, so bState will be set, but nEndRow will be bogus. Although 5217a2a0bf27e496cc429ee45dff7c239b466ae6 introduced tdf#121439, this strange bState logic and unitialized variables has been these since the initial commit, and the code doesn't take any precautions to check whether the values are valid or not, so I assume this always was just lucky enough to work and 5217a2a0bf finally triggered a problem. Given that it's rather unclear to me how this is supposed to work properly, just add an extra flag to both ScPrintFunc and ScPrintState marking whether the values are set or not and make CalcPages() depends on this flag instead. Change-Id: I0620de6562865c24f5a0edca2566b01546bf2e2b Reviewed-on: https://gerrit.libreoffice.org/68739 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins (cherry picked from commit 9432bab9f8f4a246d205ff2a460f60aeedba8ce1) Reviewed-on: https://gerrit.libreoffice.org/69261 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-03-17tdf#123923: make COUNTIF propagate errors in its first parameterMike Kaganski3-0/+20
In a specific case, Err:504 was emitted by COUNTIF when its 1st parameter was #REF!. This value was written into pivot cache definition when exporting to XLSX. Clearly Excel only expected propagated #REF! there, emitted error to user, and dropped the pivot table. This problem made XLSX pivot table cache generated by Calc unusable by Excel, despite ECMA-376 Part 1, 18.10.1.27 tells that the error value is application-dependent. The change makes COUNTIF to propagate errors received in its 1st parameter, instead of owerwriting them with own Err:504. This will likely need to be extended to other functions, if similar problems would arise. Change-Id: I459fa163a0e3e5f2c658631d66e096f4d46b1ace Reviewed-on: https://gerrit.libreoffice.org/68868 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 1f970c20a25deed282dbaf08a4be5af25e4951db) Reviewed-on: https://gerrit.libreoffice.org/69273 Reviewed-by: Eike Rathke <erack@redhat.com>
2019-03-14tdf#120161 sc: use selection to set required printed areaSerge Krot1-1/+2
Change-Id: Id0798cbff2d327e2bb955fbbc530a201975f6003 Reviewed-on: https://gerrit.libreoffice.org/68833 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 03b6c20c66047af41ed2f78fe5dd229cd06392e8) Reviewed-on: https://gerrit.libreoffice.org/69118 Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de> Tested-by: Serge Krot (CIB) <Serge.Krot@cib.de>
2019-03-13tdf#121040 sc: use pixel-per-twips in X for horizontal value conversionSerge Krot1-1/+1
Change-Id: I25bc3b3ec42ef5b026c2cd9572e8ff1863ed8c2d Reviewed-on: https://gerrit.libreoffice.org/68492 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 1b4cfd79240f153703a02d63639b3895ab7c1d1b) Reviewed-on: https://gerrit.libreoffice.org/69206 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-03-13tdf#123293 sfx2: fix metadata loss when loading from streamMichael Stahl1-1/+3
The problem is that when loading from a stream, there is no BaseURL and also no storage for the document. Due to the lack of BaseURL, the sfx2::createBaseURI() throws and loading RDF metadata fails, which also pops up an annoying warning dialog. Try to handle this in a similar way than a newly created document (see GetDMA()), by using the vnd.sun.star.tdoc scheme URL for the document; this however currently requires that the document has a XStorage, which is also not the case here. So add another UNO method to tdoc UCP's tdoc_ucp::ContentProvider, to split out the creation of the tdoc schema URL from the creation of the ucb Content, to get rid of the XStorage requirement. Change-Id: Ica62743f9d21db0b1464b70db1a62ebc61989ef8 Reviewed-on: https://gerrit.libreoffice.org/67882 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 0a5ca5768f56db481dd3b947b3dddaab7ed96450) Reviewed-on: https://gerrit.libreoffice.org/69101 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-03-04reintroduce ScCaptionPtrLuboš Luňák24-392/+638
This basically reverts b6b1ded0a0539e7be1b5338de378a3276a6ff445, since it introduces tdf#118707, and I cannot reproduce any of the original problems when reverting. The patch itself is technically correct, but the problem is in the Windows implementation of clipboard handling, which uses delayed processing of setting clipboard contents. This leads to previous clipboard contents being deleted too late, and with shared_ptr instances of SdrCaptionObj may get deleted after the related SdrModel has already been deleted. A proper fix would be to remove the stupid delayed processing from the clipboard code, but that's non-trivial. If that gets fixed, the change removing ScCaptionPtr may most probably be applied again. Change-Id: I29634847486aa955b20483c9eb38bba4fed87187 Reviewed-on: https://gerrit.libreoffice.org/67725 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/68685 Reviewed-by: Eike Rathke <erack@redhat.com>
2019-03-04do not call GetFormatTable() from GetNonThreadedContext() (tdf#121949)Luboš Luňák5-8/+20
ScDocument dtor calls ClearLookupCaches(), which calls GetNonThreadedContext(). But ScDocument instances used for copy&paste GetFormatTable() fails on null mxPoolHelper, because ScDocument ctor doesn't set it in such a case. So set up the pointer in ScInterpreterContext on demand only if actually needed. Change-Id: If3811da5bb00a2d7d404c089ee1bf46037a2cddb Reviewed-on: https://gerrit.libreoffice.org/68350 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit b5c3f38cb8d4121e3303be362e0757d3d3431059) Reviewed-on: https://gerrit.libreoffice.org/68539
2019-03-01avoid std::out_of_range thrown by mdds (tdf#122643)Luboš Luňák1-1/+1
Calling GetLastDataRow/Pos() with MAXROW as the last row is apparently fine, but if that's an invalid row, but anything beyond that is not ok. ScDependantsCalculator::trimLength() may use such larger "last" row value because it works on a range of cells. Change-Id: I819a4d20a4765e23af6208df5f2e208ac44b694c Reviewed-on: https://gerrit.libreoffice.org/68349 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> (cherry picked from commit beba45a5639bc32ca6893885ca3b1f07e3175c08) Reviewed-on: https://gerrit.libreoffice.org/68512
2019-02-28fix "doc will be saved" dialog messageNoel Grandin1-1/+1
looks like a copy/paste error in commit 942f05996bc287923cdbcae12c64e57adf8ec975 Author: Caolán McNamara <caolanm@redhat.com> convert remaining ErrorBox to weld::MessageDialog Change-Id: I52d38311b1e276fd799128e058ea0b9c902aef06 Reviewed-on: https://gerrit.libreoffice.org/68491 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit e76203f45a4c645447f8379ee2123f518a8aca77) Reviewed-on: https://gerrit.libreoffice.org/68502 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-27add missing responsesCaolán McNamara1-0/+2
Change-Id: I2c24ea46b6e81ed02ae53da5e9ae1b7df85e44a1 Reviewed-on: https://gerrit.libreoffice.org/68455 Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-19tdf#122982 Remove image from cell when cutting the cellSamuel Mehrbrodt2-4/+72
Change-Id: Idd73dcc88a8cd76eb4011bb26efdd5c712d16e5e Reviewed-on: https://gerrit.libreoffice.org/67844 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit e756b6f310f309ac29bb2bce92309bb74edd788d) Reviewed-on: https://gerrit.libreoffice.org/67852 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-02-15buttons are at the wrong endCaolán McNamara1-6/+6
Change-Id: Ie4c2c017d2e4426f5b4ad06e4318b439d1aac1a4 Reviewed-on: https://gerrit.libreoffice.org/67841 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2019-02-14tdf#121040 sc: cell with ### has too big heightSerge Krot4-5/+35
Make the same behavior as inside MSO - numbers with any different number format should not be broken on two or more lines regardless "wrap text automatically" option. Change-Id: I135ecef1ad01171dd22828100309311bd8eea6ce Reviewed-on: https://gerrit.libreoffice.org/67470 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/67777 Reviewed-by: Eike Rathke <erack@redhat.com>
2019-02-13Resolves: tdf#93951 set remainder as bad string if not parsed as validEike Rathke1-3/+23
Change-Id: Ieb9fa5e9cd2d5919a36fbe65ced107eab33c72e2 Reviewed-on: https://gerrit.libreoffice.org/67090 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit 7d6f30d04c51088b26815c241a7473c48822c6c3) Reviewed-on: https://gerrit.libreoffice.org/67115 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-12tdf#121388 : Disable threading and dep evaluation for IF...Dennis Francis4-1/+47
IFS/SWITCH if the call did not originate from ScDocShell::DoRecalc()/ScDocShell::DoHardRecalc() Change-Id: Ifdb3a496276dc841fc42a1bad1876cfb1057baf6 Reviewed-on: https://gerrit.libreoffice.org/67414 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.francis@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/67728 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-02-12Resolves: tdf#123052 correctly init pNextRows[] values for up/back unprotectedEike Rathke1-2/+10
Regression from commit ec68d58afd53ffd5f0f524503dec607e52385c72 CommitDate: Fri Jul 6 14:25:07 2018 +0200 GetNextPos: deduplicate some nMovX code Change-Id: I0352d44eda587d2c340df4c7d8fe35b7b8591fc1 Reviewed-on: https://gerrit.libreoffice.org/67693 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit febe6a57f9bc9145ffc8e9faeb34b8ac5af1c718) Reviewed-on: https://gerrit.libreoffice.org/67696 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-02-09Resolves: tdf#121002 UpdateRefOnNonCopy::mbUpdated=true if references changeEike Rathke1-0/+2
... somewhere in a previous shared formula group, so for the new groups after split the column is added to sc::RefUpdateContext::maRegroupCols in ScColumn::UpdateReference() to setup new listeners later, and true returned there, which also results in ScTable::SetStreamValid(false) at the end, which in this constellation wasn't the case. It may have been a reason that some documents have individual unrecalculated results stored (i.e. values moved within ranges that a shared formula group pointed to) that can be corrected by recalculating after load. Said to be a regression from commit 2f6a06856ad8df0c11a112d1e457b408e9a7af1d CommitDate: Fri Jun 5 16:22:38 2015 +0200 tdf#90694 reset group area listeners when splitting group but that only uncovered this misbehaviour. Change-Id: I6b04b71898c3f1774452dd19790c208f3167d8eb Reviewed-on: https://gerrit.libreoffice.org/67461 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit cdfa8b27f28328612b6734533981c1b363ced0a0) Reviewed-on: https://gerrit.libreoffice.org/67465 Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
2019-02-03tdf#122260 sc: Autofilters not properly clearedSerge Krot4-1/+104
Change-Id: I301b9ae8640e93b1ecf9e6818c9792ce45993cba Reviewed-on: https://gerrit.libreoffice.org/67001 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit fb3c3216ba1a6fc978176eebcef0cab4599a39e7) Reviewed-on: https://gerrit.libreoffice.org/67302
2019-02-02uitest for bug tdf#117276Zdeněk Crhonek2-0/+115
Change-Id: Ib61eee95d7ed4e6ede9455b058406eccd140e31c Reviewed-on: https://gerrit.libreoffice.org/65555 Tested-by: Jenkins Reviewed-by: Zdenek Crhonek <zcrhonek@gmail.com> (cherry picked from commit 83e957bfbfa22980461b6c0f07231902549504d4) Reviewed-on: https://gerrit.libreoffice.org/67257 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-01-21Resetting all fields for all dims corrupts pivot cacheKatarina Behrens7-3/+50
test case is exporting ooo55266-3 (contains data grouped in numerical intervals) to xlsx and without closing the document, opening filter on 1st pivot table (kaboom!) ClearGroupFields corrupts the cache bc it resets Field.mpGroup items for all dimensions, not just the one present in ScDPDimensionSaveData (all this happening in ScDPCollection::SheetCaches::getCache). Consequently, accessing or rebuilding pivot cache may crash bc mpGroup now points nowhere. I split and renamed ScDPCache::ClearGroupFields into 2 parts, one of them clears maGroupFields, the other resets mpGroup ptrs in maFields. When adding data to cache, the former is used (bc group ptrs get reset almost immediately afterwards) Change-Id: I96e8d234a17da0f3cc65c0625aa47b12284b98b8 Reviewed-on: https://gerrit.libreoffice.org/65329 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> (cherry picked from commit f70d29fd91d232f0b030f0f76bd23bd2919eb868) Reviewed-on: https://gerrit.libreoffice.org/66623 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-01-17Resolves: tdf#122301 FREQUENCY() ReferenceOrForceArray, ForceArrayReturnEike Rathke1-1/+1
This is a combination of 2 commits. Resolves: tdf#122301 ReferenceOrForceArray for FREQUENCY() parameters It's yet unclear whether ECMA-376-1:2016 OOXML 18.17.7.127 FREQUENCY "A call to FREQUENCY shall be an array formula." indicates that the entire formula expression should be in array mode as well, see https://bugs.documentfoundation.org/show_bug.cgi?id=122301#c8 If so, that will need a follow-up change. Reviewed-on: https://gerrit.libreoffice.org/65940 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit a6572f5f014ed159e340ed31b6e5a08527c09088) Related: tdf#122301 FREQUENCY() with ForceArrayReturn on caller FREQUENCY() forces its direct caller into array mode, but only for the immediate subexpression and not for further operators of the same parameter. This weird Excel behaviour is stated in ECMA-376-1:2016 OOXML 18.17.7.127 FREQUENCY "A call to FREQUENCY shall be an array formula." somewhat unclear what it actually applies to, but it turned out that "a call" is indeed *only* THE direct call, see https://bugs.documentfoundation.org/show_bug.cgi?id=122301#c19 Reviewed-on: https://gerrit.libreoffice.org/66407 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit d0ded163d8e93dc5b10d7a7c9bdab1d0a6a50bac) 145d8fe26d75d5af25b987e190bf35f2d2c03ec6 Change-Id: Ic302d25631fb870b46989b922c95912ab5d123df Reviewed-on: https://gerrit.libreoffice.org/66487 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-01-11tdf#121978 use round again for Calc function SECOND.Winfried Donkers2-8/+88
Round was inadvertedly replaced by floor in commit 273b3e10eab70ebc084cb62568bd699fddfb376e. Change-Id: Ie0824e228c62509952a11b866638482a409c851d Reviewed-on: https://gerrit.libreoffice.org/65579 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 1692034d53ce28b2c5d1c63ab429232a92b2f861) Reviewed-on: https://gerrit.libreoffice.org/66094
2018-12-31tdf#114919: fix ods export in ODF 1.2 strictJulien Nabet1-1/+1
See Valgrind trace here: https://bugs.documentfoundation.org/attachment.cgi?id=147891 which contains bt Due to a8b7c72425aabae87bfd2e141aa06f06319ae11c " add error to office:value-type for calc cells and fdo#51810 For cached value import we need the information which cells are error cells. For ODF 1.2 extended we therefore export now calcext:office-value with the additional value "error". " Change-Id: I13547ecc7ef8c1c4e1a236229d3b19d51f12470b Reviewed-on: https://gerrit.libreoffice.org/65728 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit 5534bfef6426128af2147de995224d7cdf43a2bf) Reviewed-on: https://gerrit.libreoffice.org/65737 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2018-12-31tdf#112484: repeat-item-labels is invalid in odf1.2 strictJulien Nabet1-0/+1
Change-Id: I23d204ef3d4e466876bb3416d616dc1f3682ad4c Reviewed-on: https://gerrit.libreoffice.org/65740 Tested-by: Jenkins (cherry picked from commit 40a7e9c93855ac6cceb4c4189587998e21581de5) Reviewed-on: https://gerrit.libreoffice.org/65748 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>