Bug 44990

Summary: Grid misalignment in Copy and Paste (regression in 3.5.0 wrt 3.4.x)
Product: LibreOffice Reporter: sergio.callegari
Component: DrawingAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: medium CC: LibreOffice
Version: 3.5.0 RC1   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard: (target:3.6.2)
i915 platform: i915 features:
Attachments: Test case
Screenshot before copy and paste - 1 object, on grid
Screenshot after copy and paste - two objects, one of them is the copied one, off grid

Description sergio.callegari 2012-01-20 06:30:53 UTC
Suppose that I am drawing something with the grid on and that I have carefully aligned an object on grid.  Now suppose that I need to duplicate such object.

In 3.4.x I can copy the object (select + ctrl+c) and paste (ctrl+v). The so pasted objects does perfectly overlap the original object and can then be moved to its final location.

LibO 3.5.0beta3 when pasting tries to improve over 3.4 behavior by assuring that the pasted object does not perfectly overlap the original one. This can be convenient in that it avoids having identical overlapping objects that hide each other.

However, the logic used by LibO 3.5 to achieve this behavior is flawed and ends up being extremely inconvenient (and thus a regression wrt 3.4.x). In fact, the pasted object is not anymore aligned on grid, which makes it a pain to put it in its final location.

LibO, when pasting should assure that things that are aligned to grid remain aligned to grid. Specifically, a skew is inserted to avoid overlapping objects, this should be a multiple of the grid step.
Comment 1 sergio.callegari 2012-01-23 01:02:08 UTC
Created attachment 56014 [details]
Test case

This is a test case for the bug.

Open the file. Check the object position and size. Top left is at x=8cm, y=1.6cm, on grid.

Select object, copy (ctrl+c) and paste (ctrl+v).

Check the copied object position and size. Top left is at x=7.95, y=1.55, off grid.

Note: seems to only happen with lines with special terminations and when such terminations have specific sizes.
Comment 2 sergio.callegari 2012-01-23 01:02:49 UTC
Created attachment 56015 [details]
Screenshot before copy and paste - 1 object, on grid
Comment 3 sergio.callegari 2012-01-23 01:03:29 UTC
Created attachment 56016 [details]
Screenshot after copy and paste - two objects, one of them is the copied one, off grid
Comment 4 martinstingl 2012-06-04 06:08:29 UTC
It may has something to do with the line width.
A duplicated line with width=0,00 keeps exactly its position. (pressing ctrl+c ant ctrl+v).
A duplicated line with width=0,10 gets shiftet by x=-0.05, y=-0.05 for example.
Comment 5 sergio.callegari 2012-06-28 02:36:23 UTC
Yes, it definitely has to do with line width.

Recently I need to make drawings with a minimal line width set to 0.2 mm
(We have some printers that declare a super resolution of 1200 dpi, but then with
0.0, namely minimal width lines, do not print anything.)

In this condition working with libreoffice is simply impossible. Whenever you copy+paste or cut+paste alignment to the grid is lost.
Comment 6 martinstingl 2012-10-16 11:24:06 UTC
I cannot reproduce the bug with LO Version 3.6.2.2 (Windows) anymore.
Seems to be fixed at least for 3.6.2.2.
Comment 7 Rainer Bielefeld Retired 2013-04-10 04:49:04 UTC
Fix not known
<https://wiki.documentfoundation.org/BugReport_Details#Whiteboard>

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.