diff options
-rw-r--r-- | vcl/source/control/field.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 3548f611c80a..9474761969e5 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -962,6 +962,16 @@ namespace Size aRet(std::max(aMinTextSize.Width(), aMaxTextSize.Width()), std::max(aMinTextSize.Height(), aMaxTextSize.Height())); + OUStringBuffer sBuf("999999999"); + sal_uInt16 nDigits = rFormatter.GetDecimalDigits(); + if (nDigits) + { + sBuf.append('.'); + comphelper::string::padToLength(aBuf, aBuf.getLength() + nDigits, '9'); + } + aMaxTextSize = rSpinField.CalcMinimumSizeForText(sBuf.makeStringAndClear()); + aRet.Width() = std::min(aRet.Width(), aMaxTextSize.Width()); + return aRet; } } |