summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/source/control/spinfld.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index ecb0e51bd91f..47aa1974f32d 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -995,7 +995,24 @@ Size SpinField::CalcMinimumSizeForText(const rtl::OUString &rString) const
if ( GetStyle() & WB_DROPDOWN )
aSz.Width() += GetSettings().GetStyleSettings().GetScrollBarSize();
if ( GetStyle() & WB_SPIN )
- aSz.Width() += maUpperRect.GetWidth();
+ {
+ ImplControlValue aControlValue;
+ Rectangle aArea( Point(), Size(100, aSz.Height()));
+ Rectangle aEntireBound, aEntireContent, aEditBound, aEditContent;
+ if (
+ GetNativeControlRegion(CTRL_SPINBOX, PART_ENTIRE_CONTROL,
+ aArea, 0, aControlValue, rtl::OUString(), aEntireBound, aEntireContent) &&
+ GetNativeControlRegion(CTRL_SPINBOX, PART_SUB_EDIT,
+ aArea, 0, aControlValue, rtl::OUString(), aEditBound, aEditContent)
+ )
+ {
+ aSz.Width() += (aEntireContent.GetWidth() - aEditContent.GetWidth());
+ }
+ else
+ {
+ aSz.Width() += maUpperRect.GetWidth();
+ }
+ }
return aSz;
}