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

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