Kaydet (Commit) e86f5a07 authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Jan Holesovsky

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
üst 50dccc1d
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include <svdata.hxx> #include <svdata.hxx>
#include <listbox.hxx> #include <listbox.hxx>
#include <controldata.hxx> #include <controldata.hxx>
#include <comphelper/lok.hxx>
struct ComboBoxBounds struct ComboBoxBounds
{ {
...@@ -530,8 +530,12 @@ void ComboBox::SetDropDownLineCount( sal_uInt16 nLines ) ...@@ -530,8 +530,12 @@ void ComboBox::SetDropDownLineCount( sal_uInt16 nLines )
void ComboBox::AdaptDropDownLineCountToMaximum() void ComboBox::AdaptDropDownLineCountToMaximum()
{ {
// adapt to maximum allowed number // Adapt to maximum allowed number.
SetDropDownLineCount(GetSettings().GetStyleSettings().GetListBoxMaximumLineCount()); // 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 ComboBox::GetDropDownLineCount() const sal_uInt16 ComboBox::GetDropDownLineCount() const
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include <controldata.hxx> #include <controldata.hxx>
#include <listbox.hxx> #include <listbox.hxx>
#include <dndeventdispatcher.hxx> #include <dndeventdispatcher.hxx>
#include <comphelper/lok.hxx>
#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp> #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
...@@ -537,8 +538,12 @@ void ListBox::SetDropDownLineCount( sal_uInt16 nLines ) ...@@ -537,8 +538,12 @@ void ListBox::SetDropDownLineCount( sal_uInt16 nLines )
void ListBox::AdaptDropDownLineCountToMaximum() void ListBox::AdaptDropDownLineCountToMaximum()
{ {
// adapt to maximum allowed number // Adapt to maximum allowed number.
SetDropDownLineCount(GetSettings().GetStyleSettings().GetListBoxMaximumLineCount()); // 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 sal_uInt16 ListBox::GetDropDownLineCount() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment