summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-07-25 12:08:37 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-07-25 12:11:51 +0100
commit0fcf74d203d97b7e829e72b7e55782d86a048802 (patch)
treee8b21057abf27352b97856a36c1f40ea81c941c2
parent92442a9276e58f0c82e0a84fa4c47f549f25b629 (diff)
Related: fdo#61544 don't include border size twice in edit optimal size
CalcSize calls CalcWindowSize, but we will call that also in GetOptimalSize, so undo the first one with CalcOutputSize. This makes the editboxes especially less tall under MacOSX Change-Id: Ibbbf5a30e0c640744b1a979937301f87d250873a
-rw-r--r--vcl/source/control/edit.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 260cdaa65d9f..545fb273e869 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2855,7 +2855,9 @@ Size Edit::CalcMinimumSizeForText(const OUString &rString) const
Size aSize;
if (mnWidthInChars != -1)
{
- aSize = CalcSize(mnWidthInChars);
+ //CalcSize calls CalcWindowSize, but we will call that also in this
+ //function, so undo the first one with CalcOutputSize
+ aSize = CalcOutputSize(CalcSize(mnWidthInChars));
}
else
{
@@ -2868,9 +2870,13 @@ Size Edit::CalcMinimumSizeForText(const OUString &rString) const
aSize.Height() = GetTextHeight();
aSize.Width() = GetTextWidth(aString);
aSize.Width() += ImplGetExtraOffset() * 2;
+
// do not create edit fields in which one cannot enter anything
// a default minimum width should exist for at least 3 characters
- Size aMinSize(CalcSize(3));
+
+ //CalcSize calls CalcWindowSize, but we will call that also in this
+ //function, so undo the first one with CalcOutputSize
+ Size aMinSize(CalcOutputSize(CalcSize(3)));
if (aSize.Width() < aMinSize.Width())
aSize.Width() = aMinSize.Width();
}