[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - vcl/source
Caolán McNamara
caolanm at redhat.com
Thu Jul 25 06:25:10 PDT 2013
vcl/source/control/edit.cxx | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 74a3450b6d681b9ca0fa3e4d01522bfd4269ab5e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jul 25 12:08:37 2013 +0100
Resolves: fdo#63618 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
(cherry picked from commit 0fcf74d203d97b7e829e72b7e55782d86a048802)
Change-Id: Ibbbf5a30e0c640744b1a979937301f87d250873a
Reviewed-on: https://gerrit.libreoffice.org/5098
Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index e8798a2..bb94ee3 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -2894,7 +2894,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
{
@@ -2907,9 +2909,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();
}
More information about the Libreoffice-commits
mailing list