sc/source/ui/cctrl/checklistmenu.cxx |    5 +++--
 sc/source/ui/inc/checklistmenu.hxx   |    2 +-
 sc/source/ui/view/gridwin.cxx        |    3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit e5b2c2c5b85a239bba332ca754eef5328949e7ee
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Oct 29 14:52:37 2019 +0000
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Wed Oct 30 08:25:35 2019 +0100

    tdf#49813 make autofilter popup at least the width of its column
    
    Change-Id: Idbcf3cdb62fb2886c3b05da721e8d326e0187588
    Reviewed-on: https://gerrit.libreoffice.org/81709
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 6a8a51a0328e..b9b5acca11c8 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -878,7 +878,7 @@ void ScCheckListMenuWindow::CancelButton::Click()
     ::CancelButton::Click();
 }
 
-ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* 
pDoc) :
+ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* 
pDoc, int nWidth) :
     ScMenuFloatingWindow(pParent, pDoc),
     maEdSearch(VclPtr<ScSearchEdit>::Create(this)),
     maChecks(VclPtr<ScCheckListBox>::Create(this)),
@@ -893,7 +893,8 @@ ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* 
pParent, ScDocument* p
 {
     float fScaleFactor = GetDPIScaleFactor();
 
-    maWndSize = Size(200 * fScaleFactor, 330 * fScaleFactor);
+    nWidth = std::max<int>(nWidth, 200 * fScaleFactor);
+    maWndSize = Size(nWidth, 330 * fScaleFactor);
 
     maTabStops.AddTabStop( this );
     maTabStops.AddTabStop( maEdSearch.get() );
diff --git a/sc/source/ui/inc/checklistmenu.hxx 
b/sc/source/ui/inc/checklistmenu.hxx
index f62e8f6dc13c..2ff574a15252 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -335,7 +335,7 @@ public:
         Config();
     };
 
-    explicit ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc);
+    explicit ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc, int 
nWidth = -1);
     virtual ~ScCheckListMenuWindow() override;
     virtual void dispose() override;
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 1d573e977c50..e2b1815141ec 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -644,7 +644,8 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW 
nRow)
     ScDocument* pDoc = pViewData->GetDocument();
 
     mpAutoFilterPopup.disposeAndClear();
-    mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pDoc));
+    int nColWidth = ScViewData::ToPixel(pDoc->GetColWidth(nCol, nTab), 
pViewData->GetPPTX());
+    mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pDoc, 
nColWidth));
 
     // Avoid flicker when hovering over the menu items.
     if (!IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Focus))
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to