Issue 125322 - UnoControlGrid horizontal scrollbar does not scroll to the last column
Summary: UnoControlGrid horizontal scrollbar does not scroll to the last column
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.4.0 Beta (OOo)
Hardware: All All
: P3 Normal
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2014-07-29 19:32 UTC by Ariel Constenla-Haile
Modified: 2014-07-30 08:26 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.2.0-dev
Developer Difficulty: ---

Writer document with a macro (11.34 KB, application/vnd.oasis.opendocument.text)
2014-07-29 19:32 UTC, Ariel Constenla-Haile
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Ariel Constenla-Haile 2014-07-29 19:32:18 UTC
Created attachment 83748 [details]
Writer document with a macro

The horizontal scrollbar of the UnoControlGrid does not scroll to the last column under certain circumstances. See attached document and the report in
Comment 1 Ariel Constenla-Haile 2014-07-29 19:39:18 UTC
(In reply to Ariel Constenla-Haile from comment #0)
> See attached document and the report in

The message is
Comment 2 Oliver Brinzing 2014-07-30 06:21:48 UTC
Comment 3 Amenel VOGLOZIN 2014-07-30 08:26:09 UTC
Workaround offered at the end of this comment.

The reason is that the scrollbar is currently used to represent a ratio that is based on the number of columns. The ratio should be based on the width of the grid content.

The current configuration is not a problem when all columns have the same width. It becomes a problem when:
* the grid control's width is smaller than the total of column widths, which warrants a horizontal scroll bar;
* hence, when the scroll bar is to the left, the grid has columns that are not currently visible;
* the columns that are not visible (especially the rightmost one) are wider than the one or more columns to the left.

Here is a configuration that reproduces the problem:
* 5-column grid with vertical scroll bar
* grid control's width: 200
* width of columns 1 to 4: 50
* width of column 5: 100

When the horizontal scroll bar is to the right, column #1 is hidden and columns #2 to #5 are visible, but column #5 is visible only for the first 50 units.

A **workaround** for fixed-width grids is to add a dummy column as the last one to the right. Its width has to be set to that of the last column to become hidden. In the example configuration above, that last column to become hidden is column #1. Therefore, we need to add data-less column #6 with width=50 so that when the scroll bar is fully to the right, columns #3 to #5 are displayed and the entire width of column #5 becomes visible while the user doesn't know there is a sixth column. There are constraints to this workaround:
* columns #5 and #6 should be non-resizeable;
* column # 6 should have an empty-string title.