Blame SOURCES/0299-sw-lok-fix-length-of-the-line-overlay-above-the-note.patch

f325b2
From 7f5920e44431b79eb9961e9ca07b322dbaf9e8c7 Mon Sep 17 00:00:00 2001
f325b2
From: Miklos Vajna <vmiklos@collabora.co.uk>
f325b2
Date: Tue, 10 Nov 2015 19:29:22 +0100
f325b2
Subject: [PATCH 299/398] sw lok: fix length of the line overlay above the
f325b2
 notes
f325b2
f325b2
With this, e.g. a line above a note (with width of 180 px) is also 180
f325b2
px, not 12 px.
f325b2
f325b2
Change-Id: I7c4eeda1bc904242dc298013411b9671ba0f2149
f325b2
(cherry picked from commit 096408073c2de484cba3736d13b57d22b7f48775)
f325b2
---
f325b2
 sw/source/uibase/docvw/SidebarWin.cxx | 12 ++++++++++++
f325b2
 1 file changed, 12 insertions(+)
f325b2
f325b2
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
f325b2
index e3e238715365..4975513ffc34 100644
f325b2
--- a/sw/source/uibase/docvw/SidebarWin.cxx
f325b2
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
f325b2
@@ -606,6 +606,18 @@ void SwSidebarWin::SetPosAndSize()
f325b2
             break;
f325b2
         }
f325b2
 
f325b2
+        // LOK has map mode disabled, and we still want to perform pixel ->
f325b2
+        // twips conversion for the size of the line above the note.
f325b2
+        bool bEnableMapMode = comphelper::LibreOfficeKit::isActive() && !EditWin().IsMapModeEnabled();
f325b2
+        if (bEnableMapMode)
f325b2
+            EditWin().EnableMapMode();
f325b2
+        Size aSize(aLineEnd.getX() - aLineStart.getX(), aLineEnd.getY() - aLineStart.getY());
f325b2
+        aSize = EditWin().PixelToLogic(aSize);
f325b2
+        aLineEnd = aLineStart;
f325b2
+        aLineEnd.Move(aSize.getWidth(), aSize.getHeight());
f325b2
+        if (bEnableMapMode)
f325b2
+            EditWin().EnableMapMode(false);
f325b2
+
f325b2
         if (!IsPreview())
f325b2
         {
f325b2
             if (mpAnchor)
f325b2
-- 
f325b2
2.12.0
f325b2