diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-12-20 16:28:32 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-12-20 16:52:57 +0000 |
commit | f97ffd1c019d19f2b32bb80a93f69cb188b828f0 (patch) | |
tree | 10c2e168bfc4acbade6c62185ef63a1b3e88f247 /svtools | |
parent | c38a1de224b911387fba74ae3039d634509085fb (diff) |
The LineListBox drew lines wider than can fit in its text area
it takes the outputsize of the entire widget and take a little
(not enough) off that as the line width. The line is always
wider that space available, so with widget-layout enabled it
will request more space. On the next update of the lines it
repeats, so listbox grows ever wider.
Change-Id: Ib43239d297bb0ba0dc1096acf347ef17b5e41273
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index e9872d7c8176..09cf09f4f6c0 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -680,9 +680,16 @@ void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance, Color aColor1, Color aColor2, Color aColorDist, sal_uInt16 nStyle, Bitmap& rBmp ) { - Size aSize = GetOutputSizePixel(); - aSize.Width() -= 20; + //TODO, rather than including the " " text to force + //the line height, better would be do drop + //this calculation and draw a bitmap of height + //equal to normal text line and center the + //line within that + long nMinWidth = GetTextWidth(OUString("----------")); + Size aSize = CalcSubEditSize(); + aSize.Width() = std::max(nMinWidth, aSize.Width()); aSize.Width() -= aTxtSize.Width(); + aSize.Width() -= 6; aSize.Height() = aTxtSize.Height(); // SourceUnit nach Twips |