[Libreoffice-commits] core.git: sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 29 20:00:27 UTC 2019


 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 bdbc439ac6c6a0eb615d55dcaaf0722f3013b812
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Oct 29 14:52:37 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Oct 29 20:59:08 2019 +0100

    tdf#49813 make autofilter popup at least the width of its column
    
    Change-Id: Idbcf3cdb62fb2886c3b05da721e8d326e0187588
    Reviewed-on: https://gerrit.libreoffice.org/81690
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.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 777a9ed220f1..8f5324a7cd00 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -629,7 +629,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))


More information about the Libreoffice-commits mailing list