diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2020-05-11 08:45:19 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2020-05-11 10:28:42 +0200 |
commit | 2539f1d142e0077dfeec36ef349a1f5443f1c94b (patch) | |
tree | 2bd41c698911799bb6d95ffd370978e9275c1a47 /vcl | |
parent | 5814f08c01ab7973cc83e6721ef434f5acc63a1a (diff) |
tdf#132832 calcAdjustedSize: Take max width into account
Actually take into account the preferred width when
calculating the size of radio button, checkbox and
hyperlink controls.
This e.g. makes word wrap work properly when the
multiline property is set for a checkbox, radio or hyperlink
control and the single line text exceeds the preferred width,
rather than keeping the whole text in one line that exceeds
the preferred width.
Change-Id: Id04668e4e1afe7c10a28468eff05cf04c10ae3c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93947
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/button.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 45c922dcb362..a0b65b900208 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -2780,7 +2780,7 @@ void RadioButton::ImplAdjustNWFSizes() Pop(); } -Size RadioButton::CalcMinimumSize() const +Size RadioButton::CalcMinimumSize(long nMaxWidth) const { Size aSize; if ( !maImage ) @@ -2804,7 +2804,7 @@ Size RadioButton::CalcMinimumSize() const { bool bTopImage = (GetStyle() & WB_TOP) != 0; - Size aTextSize = GetTextRect( tools::Rectangle( Point(), Size( 0x7fffffff, 0x7fffffff ) ), + Size aTextSize = GetTextRect( tools::Rectangle( Point(), Size( nMaxWidth > 0 ? nMaxWidth : 0x7fffffff, 0x7fffffff ) ), aText, FixedText::ImplGetTextStyle( GetStyle() ) ).GetSize(); aSize.AdjustWidth(2 ); // for focus rect |