[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 2 commits - include/vcl sc/source vcl/source

Jan Holesovsky kendy at collabora.com
Tue Mar 27 13:49:12 UTC 2018


 include/vcl/floatwin.hxx             |    6 +++---
 sc/source/ui/cctrl/checklistmenu.src |    5 -----
 sc/source/ui/inc/checklistmenu.hrc   |   15 +++++++--------
 sc/source/ui/view/gridwin.cxx        |    3 ---
 vcl/source/window/floatwin.cxx       |   22 +++++++++++++++-------
 5 files changed, 25 insertions(+), 26 deletions(-)

New commits:
commit 5c44aae8197e08b4b50baecd947160f570fe5bc7
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Tue Mar 27 12:23:22 2018 +0200

    Revert "lokdialog: Give non-programmatic name to autofilter"
    
    The online now shows no title when no title name is provided, which is better
    for the AutoFilter too.
    
    This reverts commit 04abf03ecb18ccf1f805faa763d6f29013efc6bb.
    
    Change-Id: If3e26e2b6d5b5b5a6d6a85c95ce1b8a7e6d358c8
    Reviewed-on: https://gerrit.libreoffice.org/51953
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>

diff --git a/sc/source/ui/cctrl/checklistmenu.src b/sc/source/ui/cctrl/checklistmenu.src
index 2c65b2fbb851..59c8eb09477b 100644
--- a/sc/source/ui/cctrl/checklistmenu.src
+++ b/sc/source/ui/cctrl/checklistmenu.src
@@ -21,11 +21,6 @@
 
 Resource RID_POPUP_FILTER
 {
-    String STR_MENU_TITLE
-    {
-        Text [ en-US ] = "AutoFilter" ;
-    };
-
     String STR_MENU_SORT_ASC
     {
         Text [ en-US ] = "Sort Ascending" ;
diff --git a/sc/source/ui/inc/checklistmenu.hrc b/sc/source/ui/inc/checklistmenu.hrc
index 33b689887eb6..7d009576f1dd 100644
--- a/sc/source/ui/inc/checklistmenu.hrc
+++ b/sc/source/ui/inc/checklistmenu.hrc
@@ -22,14 +22,13 @@
 
 #include <sc.hrc>
 
-#define STR_MENU_TITLE              1
-#define STR_MENU_SORT_ASC           2
-#define STR_MENU_SORT_DESC          3
-#define STR_MENU_SORT_CUSTOM        4
-#define STR_BTN_TOGGLE_ALL          5
-#define STR_BTN_SELECT_CURRENT      6
-#define STR_BTN_UNSELECT_CURRENT    7
-#define STR_EDIT_SEARCH_ITEMS       8
+#define STR_MENU_SORT_ASC           1
+#define STR_MENU_SORT_DESC          2
+#define STR_MENU_SORT_CUSTOM        3
+#define STR_BTN_TOGGLE_ALL          4
+#define STR_BTN_SELECT_CURRENT      5
+#define STR_BTN_UNSELECT_CURRENT    6
+#define STR_EDIT_SEARCH_ITEMS       7
 
 #endif
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 0b5a3e310d8b..5b7ede7a2be7 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -682,10 +682,7 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow)
     mpAutoFilterPopup.disposeAndClear();
     mpAutoFilterPopup.reset(VclPtr<ScCheckListMenuWindow>::Create(this, pDoc));
     if (comphelper::LibreOfficeKit::isActive())
-    {
         mpAutoFilterPopup->SetLOKNotifier(SfxViewShell::Current());
-        mpAutoFilterPopup->SetText(SC_STRLOAD(RID_POPUP_FILTER, STR_MENU_TITLE));
-    }
     mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, Normal));
     mpAutoFilterPopup->setPopupEndAction(
         new AutoFilterPopupEndAction(this, ScAddress(nCol, nRow, nTab)));
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 7171761f0a8a..2a9b7aab26cf 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -645,8 +645,6 @@ void FloatingWindow::StateChanged( StateChangedType nType )
                 aItems.emplace_back("position", mpImplData->maPos.toString()); // pixels
             }
             aItems.emplace_back("size", GetSizePixel().toString());
-            if (!GetText().isEmpty())
-                aItems.emplace_back("title", GetText().toUtf8());
             GetLOKNotifier()->notifyWindow(GetLOKWindowId(), "created", aItems);
         }
         else if (!IsVisible() && nType == StateChangedType::Visible)
commit 5bed90ff0d77b0a51e815ccec2f7caf3ae9dc587
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Tue Mar 27 11:26:43 2018 +0200

    lokdialog: For the tunneled top-level popups, provide the position in twips.
    
    Change-Id: I7b1ca50b06c3bdf0958bb88946873c6ddf717b0e
    Reviewed-on: https://gerrit.libreoffice.org/51952
    Reviewed-by: pranavk <pranavk at collabora.co.uk>
    Tested-by: pranavk <pranavk at collabora.co.uk>

diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
index a63d0e1422c1..ba4982599feb 100644
--- a/include/vcl/floatwin.hxx
+++ b/include/vcl/floatwin.hxx
@@ -120,9 +120,9 @@ public:
     SAL_DLLPRIVATE bool             ImplIsFloatPopupModeWindow( const vcl::Window* pWindow );
     SAL_DLLPRIVATE void             ImplSetMouseDown() { mbMouseDown = true; }
     SAL_DLLPRIVATE bool             ImplIsMouseDown() const  { return mbMouseDown; }
-                   static Point     ImplCalcPos( vcl::Window* pWindow,
-                                                 const Rectangle& rRect, FloatWinPopupFlags nFlags,
-                                                 sal_uInt16& rArrangeIndex );
+                   static Point     ImplCalcPos(vcl::Window* pWindow,
+                                                const Rectangle& rRect, FloatWinPopupFlags nFlags,
+                                                sal_uInt16& rArrangeIndex, Point* pLOKTwipsPos = nullptr);
                    static Point     ImplConvertToAbsPos(vcl::Window* pReference, const Point& rPos);
                    static Rectangle ImplConvertToAbsPos(vcl::Window* pReference, const Rectangle& rRect);
     SAL_DLLPRIVATE void             ImplEndPopupMode( FloatWinPopupEndFlags nFlags, const VclPtr<vcl::Window>& xFocusId );
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 9c08ac1c5732..7171761f0a8a 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -43,6 +43,7 @@ public:
     VclPtr<ToolBox> mpBox;
     Rectangle       maItemEdgeClipRect; // used to clip the common edge between a toolbar item and the border of this window
     Point maPos; // position of the floating window wrt. parent
+    Point maLOKTwipsPos; ///< absolute position of the floating window in the document - in twips (for toplevel floating windows).
 };
 
 FloatingWindow::ImplData::ImplData()
@@ -233,9 +234,9 @@ Point FloatingWindow::CalcFloatingPosition( vcl::Window* pWindow, const Rectangl
     return ImplCalcPos( pWindow, rRect, nFlags, rArrangeIndex );
 }
 
-Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow,
-                                   const Rectangle& rRect, FloatWinPopupFlags nFlags,
-                                   sal_uInt16& rArrangeIndex )
+Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow,
+                                  const Rectangle& rRect, FloatWinPopupFlags nFlags,
+                                  sal_uInt16& rArrangeIndex, Point* pLOKTwipsPos)
 {
     // get window position
     Point       aPos;
@@ -442,6 +443,14 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow,
             Rectangle( e1, e2 );
     }
 
+    if (bLOKActive && pLOKTwipsPos)
+    {
+        if (pW->IsMapModeEnabled())
+            *pLOKTwipsPos = pW->PixelToLogic(aPos, MapMode(MapUnit::MapTwip));
+        else
+            *pLOKTwipsPos = pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip));
+    }
+
     // caller expects coordinates relative to top-level win
     return pW->OutputToScreenPixel( aPos );
 }
@@ -626,15 +635,16 @@ void FloatingWindow::StateChanged( StateChangedType nType )
                 // dialog - but maybe we'll need a separate type for this
                 // later
                 aItems.emplace_back("type", "dialog");
+                aItems.emplace_back("position", mpImplData->maLOKTwipsPos.toString()); // twips
             }
             else
             {
                 SetLOKNotifier(pParent->GetLOKNotifier());
                 aItems.emplace_back("type", "child");
                 aItems.emplace_back("parentId", OString::number(pParent->GetLOKWindowId()));
+                aItems.emplace_back("position", mpImplData->maPos.toString()); // pixels
             }
             aItems.emplace_back("size", GetSizePixel().toString());
-            aItems.emplace_back("position", mpImplData->maPos.toString());
             if (!GetText().isEmpty())
                 aItems.emplace_back("title", GetText().toUtf8());
             GetLOKNotifier()->notifyWindow(GetLOKWindowId(), "created", aItems);
@@ -721,7 +731,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, FloatWinPopupFlags
 
     // compute window position according to flags and arrangement
     sal_uInt16 nArrangeIndex;
-    mpImplData->maPos = ImplCalcPos( this, rRect, nFlags, nArrangeIndex );
+    mpImplData->maPos = ImplCalcPos(this, rRect, nFlags, nArrangeIndex, &mpImplData->maLOKTwipsPos);
     SetPosPixel( mpImplData->maPos );
 
     // set data and display window


More information about the Libreoffice-commits mailing list