Description: After hide a colum and save the file, some object position are moved when reopen it.This may is related to “Group and Outline” and “Anchor”. Steps to Reproduce: 1. Open the attached file "bug2.ods". 2. Anchors of a circle and a line are seted to "To sell". 3. B column is grouped. 4. The circle and the line are on the "D" column. 5. Select B column, then "Format", "column", "hide". 6. Save the file and close Calc. After that, reopen the file, "bug2.ods". Actual Results: The position of the circle is not moved. But the position of the line is moved to column "C" Expected Results: I hope the position should not moved. Reproducible: Always User Profile Reset: No Additional Info: User-Agent: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
Created attachment 142466 [details] Sample
(In reply to Hidenori Ozaki from comment #0) > Description: > After hide a colum and save the file, some object position are moved when > reopen it.This may is related to “Group and Outline” and “Anchor”. > > Steps to Reproduce: > 1. Open the attached file "bug2.ods". > 2. Anchors of a circle and a line are seted to "To sell". > 3. B column is grouped. > 4. Select B column, then "Format", "column", "hide". > 5. The circle and the line are on the "D" column. > 6. Save the file and close Calc. After that, reopen the file, "bug2.ods". > > Actual Results: > The position of the circle is not moved. But the position of the line is > moved to column "C" > > Expected Results: > I hope the position should not moved. > > > Reproducible: Always > > > User Profile Reset: No > > > > Additional Info: > > > User-Agent: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like > Gecko) Chrome/66.0.3359.181 Safari/537.36
confirm with Version: 5.0.6.3 Build ID: 490fc03b25318460cfc54456516ea2519c11d1aa Locale: en-US (en_US.UTF-8) Version: 5.3.7.2 Build ID: 6b8ed514a9f8b44d37a1b96673cbbdd077e24059 CPU Threads: 8; OS Version: Linux 4.14; UI Render: default; VCL: kde4; Layout Engine: new; Locale: nl-BE (en_US.UTF-8); Calc: group Version: 5.4.1.2 Build ID: ea7cb86e6eeb2bf3a5af73a8f7777ac570321527 CPU threads: 8; OS: Linux 4.14; UI render: default; VCL: kde4; Locale: nl-BE (en_US.UTF-8); Calc: group Version: 6.1.0.0.beta1+ Build ID: e42f6174d30c9f2211bdaffdefb011eeb9ead1fc CPU threads: 8; OS: Linux 4.14; UI render: default; VCL: kde4; Locale: nl-BE (en_US.UTF-8); Calc: group threaded no problem with Aoo snapshot 4.2.0
Was going to bibisect this, but in Linux 41max, the oldest commit shows both shapes in column D upon opening. Same for all the older commits in 43all repo, including oldest. Same for 3.3.0. So if AOO 4.2.0 does not show the problem, they must have fixed something in the meanwhile. The wild thing is, the latest master shows both shapes in column D as well! I have to open a new report for it.
(In reply to Buovjaga from comment #4) > Was going to bibisect this, but in Linux 41max, the oldest commit shows both > shapes in column D upon opening. Same for all the older commits in 43all > repo, including oldest. Same for 3.3.0. > > So if AOO 4.2.0 does not show the problem, they must have fixed something in > the meanwhile. > > The wild thing is, the latest master shows both shapes in column D as well! > I have to open a new report for it. Urgh, both shapes being in column D is *the correct* rendering just like it says in the description. Will bibisect.
Well, I bibisected the older issue, where the line is in column A upon opening and disappears after hiding column B and reopening: commit d34912b1eb89f5b0fde219ea57902f3a7d05cb7a Author: Matthew Francis <mjay.francis@gmail.com> Date: Fri Sep 18 10:34:06 2015 +0800 source-hash-2b1aa949539d2fcbb3d349be3c279996630d83fc Bibisect: This commit covers the following source commit(s) which failed to build 43682489c18c707bc0d5701f7f6a2df2511eeb0c 88ed6d1348b5d3d517afcbe5fa1257d55625f39b fe8bcfa422c654e35ec22b5e3b1a512ae438b565 5de206a7fbe74a7022bb3b20f190e6a3e6f1e3ae fb455e5013ab014058ad5f92238ef6fc91b2afcf a4c80756ca429ac3654455b5e6a6b6a700361b9a 3a3254a900a6a8aad8d3321bf8b10d1770555cf5 cac113602c8f60b7eaea8709f6670b00b0925447 f8a75e4b225d3a998174f47066b9a72472546767 1dace0c3e0972c2bde8db177433b7d095025bcca 742515639168cd35a0c2036a5bf6c46b2a3a554e e70defefd80c44646a742ff581bca9b467b8e713 396eb4f5cf8b37cd2a9f14d85764e03761ade19f f37df270f1a984f0a6138f4f22fc79a50e71dcc2 349e9248f801d23735478abafe5328f79dfe4378 bf46dfdb45b1d6cd99a5c729ee98df89db363225 b8da61acb2bb887a7335a5db82b8b5ae1e0fab69 a062799bd6902061895e19cace0099fadf696bb4 95e6a0885e65cc57b11719cc0658be9d8b78fba9 138e5a051805ca8a3b7e9626742cc475e3577cc4 826cb27cc80ae843927d68e0337ad2caffa9f023 bee8ed6772f420f9eefc57fee01da29ff466a8e9 3998d1abb291309ddbbc2c9869736ebb1ea608f0 a09f11715be53587ee2b0368e19f45cc85fb6cf1 ef1d096ddc311a2fd821d4076421c4a8f8d63abf 55dda63b297a287c9abc6ba2f19946817e8744e7 5bdd1e9ee8f3ca9dc647998a8ec7b9415add01fe 0db079cd5a09b3f24b0dd3563f100c77561ccfde eea3634b2bd85e7f290e0504da1b8906c7d33ca4 49db90342f193f31500b2717cc27bdf2f25e2d95 bcaa4cd4f3be07f9211b51da4d258b61423f1e28 9e7f056bd08b18d084497b0846c7c8f31b82f58a f49b4581a0a5056a51712bcabcc66483a87a07c8 0d05957cf0c38abab45030ba172025e4ef318f43 commit 2b1aa949539d2fcbb3d349be3c279996630d83fc Author: Noel Power <noel.power@suse.com> AuthorDate: Tue Feb 19 17:29:32 2013 +0000 Commit: Noel Power <noel.power@suse.com> CommitDate: Tue Feb 19 18:09:24 2013 +0000 fdo#56276 - resize/reposition rotated shapes in a sensible way Probably it needs to be bibisected for the newer problem instead.
Bah, no bibisecting needed as the problem has existed as long as the initial display of the file has been correct (was wrong in 4.3 still).
Dear Hidenori Ozaki, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
The bug still exists in Version: 6.5.0.0.alpha0+ (x64) Build ID: 800b6f095f95ccfb8a7ba9755292332bf97f97ad CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; Locale: de-DE (en_US); UI-Language: en-US Calc: threaded
The problem is in RecalcPos() in https://opengrok.libreoffice.org/xref/core/sc/source/core/data/drwlayer.cxx?r=f147b160 starting from line #978. The comment indicates, that it assumes, that setting the LogicRect will resize the shape. That is the case for most shapes, but not for SdrPathObj. Here the size is contained in the coordinates of its points and not in maRect. Therefore #996 pObj->SetLogicRect(aFullRect); does not change the shape and #1001 const tools::Rectangle aObjRect(pObj->GetSnapRect()); does not return the expected rectangle. Possible solutions: A Handle SdrPathObj different in drwlayer.cxx. (Ideas: Use NbcResize() of the SdrPathObj or work on a copy of its maPathPolygon.) B Implement SetLogicRect for SdrPathObj so, that it resizes the shape. Currently it has no own implementation but uses the inherited one from SdrTextObj. A longer comment of the problems with maRect is in comment #1729-#1747 in https://opengrok.libreoffice.org/xref/core/svx/source/svdraw/svdopath.cxx?r=1f625b3f I'm not sure, which way would be better.
Or C Do not use SetLogicRect() at all, but resize via transformation matrix or via Resize() in all cases.
Or D Do not manipulate the shape at all. Get GeoStat from the shape and apply it via Rect2Poly to aFullRect and get the range of the created Polygon. (I'm currently not actively working on this issue. I come across this while working on a different topic. I have put here, what I have found so far, so that it is not lost.)
I have add to svdopath.hxx virtual void NbcSetLogicRect(const tools::Rectangle& rRect) override; and to svdo.cxx void SdrPathObj::NbcSetLogicRect(const tools::Rectangle& rRect) { NbcSetSnapRect(rRect); } NbxSetSnapRect does the needed calculations and updates maRect. Because transformations are incorporated into the points in case of SdrPathObj, maRect and maSnapRect should be identical. That solves the problem of the shift after hiding a row or column. But lines have an additional problem: To get the anchor type "To cell (resize with cell)" it is needed to write the attributes table:end-cell-address, table:end-x and table:end-y to file. For the line itself the attributes svg:x1, svg:y1, svg:x2 and svg:y2 are written, which determine the start and end point of the line. The problem is, that the values, which are written to file, are inconsistent. The coordinates, which are calculated from the table:end* attributes are different from the coordinates given is svg:x2 and svg:y2. With the above mentioned changes to SdrPathObj the table:end* attributes are correctly evaluated, which was not the case before. But older documents have wrong values in it. Therefore it would be necessary to have a kind of "repair" part for lines, which exchanges the wrong table:end* attributes with values suitable to the svg:x2 and svg:y2 attributes, on opening. And of cause make sure, that now correct values are written to file. I have no idea yet, how to solve that.
In the meantime I have changed the way objects are initialized in case they are anchored 'resize with cell'. [https://cgit.freedesktop.org/libreoffice/core/commit/?id=1f0b3c7a40edfa81bbc7a58d123a6a2dfd83e4ca]. But it does not fix the problems with collapsed group.
It is an export problem. The geometry of the shape needs to be so in file format, as if there are no hidden rows or columns. But currently the geometry considers hidden rows and columns. Therefore the transformation values are wrong. A conversion is missing.
Regina Henschel committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1cb6bb9576871ff5d56c9810ff1791abc3dd64fd tdf#117948 Do not treat hidden rows as zero in ODF export It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
I verify Regina's fix Arch Linux 64-bit Version: 7.1.0.0.alpha1+ Build ID: 3d3180115be3b87e76189aea2031f0caa735dbb3 CPU threads: 8; OS: Linux 5.9; UI render: default; VCL: kf5 Locale: fi-FI (fi_FI.UTF-8); UI: en-US Calc: threaded Built on 11 November 2020
Set to verify according comment #17