summaryrefslogtreecommitdiff
path: root/vcl/source/control/combobox.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-04-22 15:38:05 +0000
committerArmin Le Grand <alg@apache.org>2013-04-22 15:38:05 +0000
commit35c9acfc98fc98399005815e0464b1944f327d4e (patch)
treec613c3fb82b757b1c991bf5527ff3f3abc2834c5 /vcl/source/control/combobox.cxx
parent61ed9eac0583e34a9b69f0a1adcc208509e336a1 (diff)
i122041 More unifications for FillStyles, better defaults, better preview visualizations
Notes
Notes: merged as: 1a3047112b917dc02eca621028f9de9bdaab3794
Diffstat (limited to 'vcl/source/control/combobox.cxx')
-rw-r--r--vcl/source/control/combobox.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 1f04cbb2ea29..f95a4d39443c 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -546,9 +546,14 @@ void ComboBox::EnableAutoSize( sal_Bool bAuto )
if ( mpFloatWin )
{
if ( bAuto && !mpFloatWin->GetDropDownLineCount() )
- mpFloatWin->SetDropDownLineCount( 5 );
+ {
+ // Adapt to GetListBoxMaximumLineCount here; was on fixed number of five before
+ AdaptDropDownLineCountToMaximum();
+ }
else if ( !bAuto )
+ {
mpFloatWin->SetDropDownLineCount( 0 );
+ }
}
}
@@ -578,6 +583,14 @@ void ComboBox::SetDropDownLineCount( sal_uInt16 nLines )
// -----------------------------------------------------------------------
+void ComboBox::AdaptDropDownLineCountToMaximum()
+{
+ // adapt to maximum allowed number
+ SetDropDownLineCount(std::min(GetEntryCount(), GetSettings().GetStyleSettings().GetListBoxMaximumLineCount()));
+}
+
+// -----------------------------------------------------------------------
+
sal_uInt16 ComboBox::GetDropDownLineCount() const
{
sal_uInt16 nLines = 0;