Bug 49430 - imported shape positions incorrect
Summary: imported shape positions incorrect
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: Other All
: medium normal
Assignee: Noel Power
QA Contact:
URL:
Whiteboard: target:3.6.0 target:3.5.5
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-03 07:27 UTC by Noel Power
Modified: 2013-02-05 13:00 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
picture showing the anchor and actual shape position skewed (22.36 KB, image/png)
2012-05-03 08:23 UTC, Noel Power
Details
document for the image shown earlier (7.92 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-05-03 08:25 UTC, Noel Power
Details
image of some shapes in excel doc (23.22 KB, image/png)
2012-05-03 13:16 UTC, Noel Power
Details
top xlsx version of excel document imported by 3.5 (38.88 KB, image/png)
2012-05-03 13:19 UTC, Noel Power
Details
images of the imported content after patches applied (39.14 KB, image/png)
2012-05-03 13:20 UTC, Noel Power
Details
actual xlsx version of the test document (19.12 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2012-05-03 13:21 UTC, Noel Power
Details
actual xls version of the test document (52.50 KB, application/vnd.ms-excel)
2012-05-03 13:22 UTC, Noel Power
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Noel Power 2012-05-03 07:27:07 UTC
sometimes the imported position of shapes are totally and catastrophically wrong.
Comment 1 Not Assigned 2012-05-03 08:08:23 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9dc4fa1b22a533ba0a6ce0353112c55eef8a14ef

fix bad import positions of shapes & controls fdo#49430
Comment 2 Not Assigned 2012-05-03 08:08:47 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5813422d3eb9657c5a818057be0ebf831ca6a794

tweak imported shape position for xls( binary ) format fdo#49430
Comment 3 Noel Power 2012-05-03 08:21:26 UTC
The import filters ( for both oox and xls ) miscalculate the positions of imported shapes. In particular it appears the further down the sheet the worse the error can be, additionally when we have lots of different row heights this can also really adversely affect things. By far the worst problem though is that there is an inbuilt error in calc where the position of a row/col calculated by the view can be very different from that calculated by the drawing layer ( or the filter ). In otherwords even in an ordinary calc document you can for example anchor a cell to A769 but the shape will be drawn at A766 or A775 or basically somewhere other than where you expect. This discrepancy is not normally noticed because shapes in a document are positioned manually and the geometry information ( which includes the error ) is persisted, when the document is loaded the geometry information ( including the error ) is re-read and re-applied and the shape position is displayed in the expected position.
Comment 4 Noel Power 2012-05-03 08:23:30 UTC
Created attachment 60974 [details]
picture showing the anchor and actual shape position skewed

note: in the attached image the checkbox is anchored to a769 and one would expect the checkbox to be displayed within that bordered cell, reality though... disagrees
Comment 5 Noel Power 2012-05-03 08:25:59 UTC
Created attachment 60975 [details]
document for the image shown earlier

I guess we have to live with this 'effect' as afterall the offset error is already built into millions of documents
Comment 6 Noel Power 2012-05-03 08:31:34 UTC
Now, down to business, the import problem is hard to live with as the import filters calculate the desired shape position based on cell anchor, when we have this offset between anchor position and actual shape position then the shape will be displayed at the wrong position. The oox filter also screws up the position more as it seems there is some row height adjustment that further mucks things up ( for some reason this doesn't affect the binary filter ).
Comment 7 Noel Power 2012-05-03 13:16:10 UTC
Created attachment 60987 [details]
image of some shapes in excel doc

some shapes, drawing, form control and a chart in excel document, note the positions
Comment 8 Noel Power 2012-05-03 13:19:08 UTC
Created attachment 60989 [details]
top xlsx version of excel document imported by 3.5

image of the imported ( by libreoffice 3.5 ) excel content xlsx on top and xls on bottom, note the positions of the objects ( in fact the form control seems to be missing, the size is corrupted as the vml anchor interprets the row/col offsets in the wrong units )
Comment 9 Noel Power 2012-05-03 13:20:24 UTC
Created attachment 60990 [details]
images of the imported content after patches applied

on top is the imported xlsx content, on the bottom is the xls content, note the positions of the objects, also note the form control is now visible
Comment 10 Noel Power 2012-05-03 13:21:34 UTC
Created attachment 60991 [details]
actual xlsx version of the test document
Comment 11 Noel Power 2012-05-03 13:22:04 UTC
Created attachment 60994 [details]
actual xls version of the test document
Comment 12 Not Assigned 2012-05-04 04:40:51 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=76bab166e21bc3646ae2d3079aae2c5d9ce0d1e5

reorganise code a little so ole controls are catered for wrt fdo#49430
Comment 13 Not Assigned 2012-05-04 04:52:11 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b2af4b20a009cce57f547865b02fde41d1232a17

Revert "reorganise code a little so ole controls are catered for wrt fdo#49430"
Comment 14 Not Assigned 2012-05-04 04:58:05 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=da81525ec2e86364def8b558e16c4e8eca6a121e

(reworked )reorg. code a little so ole controls are catered for wrt fdo#49430
Comment 15 Not Assigned 2012-05-25 03:35:14 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0a8de8d937ea1e9cb26ea7c89951f559961b49de

Revert "(reworked )reorg. code a little so ole controls are catered for wrt fdo#49430"
Comment 16 Not Assigned 2012-05-25 03:35:40 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3ed479a1d83916cb5dc3be0eee0aa6fbe65a844a

Revert "fix bad import positions of shapes & controls fdo#49430"
Comment 17 Not Assigned 2012-05-25 03:36:04 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=56f450187343688f20f88e68a849c8dcd660b629

Revert "tweak imported shape position for xls( binary ) format fdo#49430"
Comment 18 Not Assigned 2012-05-30 06:36:04 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=dbb385df0fc83c36cfc91b82979fabea868592c2

fix missing form control, partial fix for fdo#49430
Comment 19 Not Assigned 2012-06-11 03:10:40 UTC
Noel Power committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=edd7b00431f5d3c008437e974b93dda804300bbf&g=libreoffice-3-5

fix missing form control, partial fix for fdo#49430


It will be available in LibreOffice 3.5.5.