summaryrefslogtreecommitdiff
path: root/vcl/source/control/listbox.cxx
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2018-11-23 00:00:28 -0500
committerJan Holesovsky <kendy@collabora.com>2018-12-07 11:52:34 +0100
commite86f5a07efbb533a072aca841d040771484d388b (patch)
treeecdf251b34e182bf713f63935dff6ab703e49cd7 /vcl/source/control/listbox.cxx
parent50dccc1d59bc851f1c877d4cf2e060f3e4c60ca2 (diff)
LOK: dialogs: limit listbox/combobox drop-down length
Dialogs routed to the LOK client have limited real estate on the screen because dialogs are rendered on a canvas. When the listbox drop-down bleeds outside the dialog area, on the desktop it's no problem, but in the browser, that requires a larger canvas and that brings a host of problems. Here we limit the maximum length of listbox/combobox drop-down lists to avoid this situation. This would ideally be configured via ListBoxMaximumLineCount alas it doesn't work. Change-Id: I55fff28dbfc59dec36714e221f76cf4160ba1505
Diffstat (limited to 'vcl/source/control/listbox.cxx')
-rw-r--r--vcl/source/control/listbox.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/vcl/source/control/listbox.cxx b/vcl/source/control/listbox.cxx
index 5de0f2fe1a0b..52960a762d17 100644
--- a/vcl/source/control/listbox.cxx
+++ b/vcl/source/control/listbox.cxx
@@ -35,6 +35,7 @@
#include <controldata.hxx>
#include <listbox.hxx>
#include <dndeventdispatcher.hxx>
+#include <comphelper/lok.hxx>
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
@@ -537,8 +538,12 @@ void ListBox::SetDropDownLineCount( sal_uInt16 nLines )
void ListBox::AdaptDropDownLineCountToMaximum()
{
- // adapt to maximum allowed number
- SetDropDownLineCount(GetSettings().GetStyleSettings().GetListBoxMaximumLineCount());
+ // Adapt to maximum allowed number.
+ // Limit for LOK as we can't render outside of the dialog canvas.
+ if (comphelper::LibreOfficeKit::isActive())
+ SetDropDownLineCount(11);
+ else
+ SetDropDownLineCount(GetSettings().GetStyleSettings().GetListBoxMaximumLineCount());
}
sal_uInt16 ListBox::GetDropDownLineCount() const