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

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