Bug 76160

Summary: VIEWING Calc zoom or print preview changes the position of images on the Y axis
Product: LibreOffice Reporter: Damien Chambe <damien.chambe>
Component: SpreadsheetAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: damien.chambe, erack
Version: 4.2.1.1 releaseKeywords: regression
Hardware: All   
OS: All   
Whiteboard: target:4.4.0 target:4.3.0.2 target:4.2.6
i915 platform: i915 features:
Attachments: Spreadsheet with incorrect image position when you preview/zoom
patch for correct Y picture position with zoom/preview

Description Damien Chambe 2014-03-14 07:42:25 UTC
Created attachment 95778 [details]
Spreadsheet with incorrect image position when you preview/zoom

When zooming in calc, image change position on the Y axis.

This incorrect image position appears when you have huge cell height, and anchored picture fit inside. The more the cell is far from the top, the more the problem is visible.

Print preview is affected too.

Step to reproduce :
- load Image_y_axis_zoom_preview_problem.xls
- Select the last image
- Zoom in and out, notice how the selection corners move on the Y axis
- Launch a preview, the pictures at the bottom are not at the right position

Expected result:
Images position should not be affected by zooming or previewing.

Tested on linux/ubuntu 64 , libreoffice 2014-03-13 4.3.0.0.alpha0+ 2014-Build ID: ccd765079ae573d24ded2a07ec434e4e89b619a2 

Same bug in LibreOffice 4.1.5 (tested on windows XP), LibreOffice 4.2.1
Comment 1 Damien Chambe 2014-03-14 07:46:25 UTC
The fix for this bug appears in /sc/source/ui/view/drawview.cxx :
- if (nEndRow<1000)
+ if (nEndRow<20)

It has been corrected, see 31737.

But it has been reverted by :
http://cgit.freedesktop.org/libreoffice/core/commit/sc/source/ui/view/drawview.cxx?id=bc30ba74e880122b257cc6aa2965a79851fa4608

If you apply the attached patch correction (Same patch in bug #i116848#), zooming and preview are correct. 
(Tested on linux 64 , libreoffice 4.3.0.0.alpha0+ Build ID: ccd765079ae573d24ded2a07ec434e4e89b619a2 )

I don't know why the commit has been reverted, I don't understand the code, I've just tracked the regression.
Comment 2 Damien Chambe 2014-03-14 07:46:58 UTC
Created attachment 95779 [details] [review]
patch for correct Y picture position with zoom/preview
Comment 3 A (Andy) 2014-03-14 23:03:13 UTC
reproducible with LO 4.2.1.1 (Win 8.1)
Comment 4 Commit Notification 2014-06-24 21:26:35 UTC
Damien Chambe committed a patch related to this issue.
It has been pushed to "master":

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

Resolves fdo#76160 Calc invalid image position on zooming



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2014-06-25 23:12:07 UTC
Damien Chambe committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4b708a14d6a9cb0643c6f405a47f4ebd8044494b&h=libreoffice-4-3

Resolves fdo#76160 Calc invalid image position on zooming


It will be available in LibreOffice 4.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2014-06-25 23:31:57 UTC
Damien Chambe committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2153e1febbb2ae2254df42d85d33590928b14f5a&h=libreoffice-4-2

Resolves fdo#76160 Calc invalid image position on zooming


It will be available in LibreOffice 4.2.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 7 Kohei Yoshida (inactive) 2014-06-25 23:39:01 UTC
I'll mark this fixed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.