https://bugs.documentfoundation.org/show_bug.cgi?id=147697

            Bug ID: 147697
           Summary: Wrong field or value inserted from 'Data Sources' when
                    table preview needs to scroll.
           Product: LibreOffice
           Version: 7.1.8.1 release
          Hardware: All
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: minor
          Priority: medium
         Component: UI
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: jncres...@outlook.com

Description:
Affects the UI in Writer, Calc, Math, Impress, and Draw.

The 'Data Sources' panel can be used to insert fields into documents for
creating a mail merge and into spreadsheets as form controls by dragging their
header onto the document or spreadsheet.

The problem is when the field that the user wants to insert has its column half
visible, and half off the right-hand edge of the table preview.

After the drag, the correct column becomes highlighted, but the wrong field is
inserted, which can confuse.

The 'Data Sources' panel can also be used to insert the actual values from a
table by dragging the value. If you drag from a value under the same
conditions, again the wrong field is used; so the wrong value is inserted. In
addition to Writer and Calc, inserting actual values affects Math, Impress, and
Draw. (The 'Data Sources' panel can be shown in Math, Impress, and Draw by
pressing ctrl+shift+f4 despite note appearing in the menu bar)

An easy workaround is to scroll the column into view before dragging it onto
the document or spreadsheet.

Steps to Reproduce:
1. Download and extract 'Database.odb', 'Spreadsheet.ods', and 'Text.odt' from
'minimal-example.zip'.

   - 'Database.odb' has a single table 'Table1' with 30 fields with random data
over a few records.
   - 'Spreadsheet.ods' is a new empty spreadsheet.
   - 'Text.odt' is a new empty document.

2. Register 'Database.odb' as a database with the name 'Database'.

   1. Open LibreOffice
   2. Choose Tools - Options - LibreOffice Base - Databases.
   3. Click 'New' and select the database file.
   4. Press Apply or OK

3. Open 'Text.odt' in LibreOffice Writer, or open 'Spreadsheet.ods' in
LibreOffice Calc.

4. Show the Data Sources pane. (menu bar - View - Data Sources) or
(ctrl+shift+f4)

5. In the Data Sources pane, expand the database 'Database', and expand
'Tables'.

6. Click on 'Table1'.

7. Resize the column of 'field1' in the preview such that, while field1 is
showing, the column for 'field2' is half showing and half clipped over the
righthand edge.

8. Scroll the preview to entirely show 'field2'.

9. If, while 'field2' is in view, the last field ends before the righthand
edge, resize some columns after 'field2' such that the table does span the
whole width of the pane while 'field2' is in view.

10. Scroll the preview back to show 'field1' and part of 'field2'.

11. Click on a value in the column of 'field1'. (So that no columns are
selected. If the column for 'field2' is highlighted, then the table doesn't
scroll, so the strange behaviour doesn't happen.)

12. Drag and hold (don't let go yet) from the heading of 'field2' onto the
document or spreadsheet.

    - observe the column of 'field2' becomes highlighted
    - observe the table scrolls so that 'field2' is entirely in view.

13. Release the drag onto the document or spreadsheet.

    - observe that 'field2' is still highlighted on the table view.
    - observe that the field that has been inserted is not 'field2'. 
    - observe that the field which does appear inserted in the document is
whichever field has been scrolled to where on the screen you started dragging
from in step 10. 

14. To repeat, go to step 10. Or go to step 3 to try with the other document or
spreadsheet.

Actual Results:
The inserted field doesn't match the column which was dragged and becomes
highlighted during the action, which can be confusing.

- The behaviour is easiest observed if 'field2' has a small width such that
after the scroll, it has no overlap with where you could have started dragging
from.
- If you skipped step 9, and the table ends before the point that you started
dragging from, then no field is inserted into the document
- If you drag a value from 'field2' instead of the column heading, the wrong
field is again used. It inserts the value from the wrong column. However, there
is no highlighting of 'field2' in this action, so the inconsistency is more
difficult to see. 

Expected Results:
The field that is inserted should be what the user started dragging.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.8.1 (x64) / LibreOffice Community
Build ID: e1f30c802c3269a1d052614453f260e49458c82c
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: threaded

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to