kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

Blame SOURCES/0330-sw-lok-comments-fix-cursor-position-of-a-newly-creat.patch

135360
From bade9dc2b36b7ee92fa9ada8e033639a8c49a593 Mon Sep 17 00:00:00 2001
135360
From: Miklos Vajna <vmiklos@collabora.co.uk>
135360
Date: Sat, 14 Nov 2015 13:39:02 +0100
135360
Subject: [PATCH 330/398] sw lok comments: fix cursor position of a newly
135360
 created sidebar window
135360
135360
With this, pressing ctrl-alt-c to create a new comment has the correct
135360
cursor position.
135360
135360
Change-Id: Icb8d708dab015d8ffa9bcfe28de66238a75b50bc
135360
(cherry picked from commit d78432e9a077725046419902c542ce4e5f515705)
135360
---
135360
 sw/source/uibase/docvw/SidebarWin.cxx | 17 +++++++++++++++++
135360
 1 file changed, 17 insertions(+)
135360
135360
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
135360
index 32d8b78815ae..cf803b618263 100644
135360
--- a/sw/source/uibase/docvw/SidebarWin.cxx
135360
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
135360
@@ -666,7 +666,24 @@ void SwSidebarWin::SetPosAndSize()
135360
     {
135360
         bChange = true;
135360
         SetSizePixel(mPosSize.GetSize());
135360
+
135360
+        if (comphelper::LibreOfficeKit::isActive())
135360
+        {
135360
+            // Position is not yet set at VCL level, but the map mode should
135360
+            // contain the right origin to emit the correct cursor position.
135360
+            mpSidebarTextControl->Push(PushFlags::MAPMODE);
135360
+            Point aOffset(mPosSize.Left(), mPosSize.Top());
135360
+            aOffset = PixelToLogic(aOffset);
135360
+            MapMode aMapMode(mpSidebarTextControl->GetMapMode());
135360
+            aMapMode.SetOrigin(aOffset);
135360
+            mpSidebarTextControl->SetMapMode(aMapMode);
135360
+            mpSidebarTextControl->EnableMapMode(false);
135360
+        }
135360
+
135360
         DoResize();
135360
+
135360
+        if (comphelper::LibreOfficeKit::isActive())
135360
+            mpSidebarTextControl->Pop();
135360
     }
135360
 
135360
     if (GetPosPixel().X() != mPosSize.TopLeft().X() || (std::abs(GetPosPixel().Y() - mPosSize.TopLeft().Y()) > 5) )
135360
-- 
135360
2.12.0
135360