Blame SOURCES/0001-Resolves-tdf-91778-drawing-the-background-over-an-ac.patch

f325b2
From f34863825fca2002b420d10679d0cdbb9d767a81 Mon Sep 17 00:00:00 2001
f325b2
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
f325b2
Date: Wed, 20 Apr 2016 11:55:01 +0100
f325b2
Subject: [PATCH] Resolves: tdf#91778 drawing the background over an active
f325b2
 cursor
f325b2
f325b2
will overwrite it, which means that when it toggles "off" afterwards, it uses
f325b2
invert on the freshly drawn background which will visually make it appear "on"
f325b2
and not off
f325b2
f325b2
Just explictly turn it off and restore it and avoid the whole potential
f325b2
problem.
f325b2
f325b2
Change-Id: Ie21d77e9d704124011e43b42c98b26eaf208eef2
f325b2
(cherry picked from commit 29a9f433c268414747d8ec7343fc2b5987971738)
f325b2
---
f325b2
 sc/source/ui/view/gridwin4.cxx | 12 ++++++++++++
f325b2
 1 file changed, 12 insertions(+)
f325b2
f325b2
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
f325b2
index ceaf3d8..5ec4bf0 100644
f325b2
--- a/sc/source/ui/view/gridwin4.cxx
f325b2
+++ b/sc/source/ui/view/gridwin4.cxx
f325b2
@@ -902,6 +902,14 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
f325b2
         aEnd.X() -= 2 * nLayoutSign;
f325b2
         aEnd.Y() -= 2;
f325b2
 
f325b2
+        // toggle the cursor off if its on to ensure the cursor invert
f325b2
+        // background logic remains valid after the background is cleared on
f325b2
+        // the next cursor flash
f325b2
+        vcl::Cursor* pCrsr = pEditView->GetCursor();
f325b2
+        const bool bVisCursor = pCrsr && pCrsr->IsVisible();
f325b2
+        if (bVisCursor)
f325b2
+            pCrsr->Hide();
f325b2
+
f325b2
         // set the correct mapmode
f325b2
         Rectangle aBackground(aStart, aEnd);
f325b2
         if (bIsTiledRendering)
f325b2
@@ -918,6 +926,10 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
f325b2
         // paint the editeng text
f325b2
         pEditView->Paint(rDevice.PixelToLogic(Rectangle(Point(nScrX, nScrY), Size(aOutputData.GetScrW(), aOutputData.GetScrH()))), &rDevice);
f325b2
         rDevice.SetMapMode(MAP_PIXEL);
f325b2
+
f325b2
+        // restore the cursor it it was originally visible
f325b2
+        if (bVisCursor)
f325b2
+            pCrsr->Show();
f325b2
     }
f325b2
 
f325b2
     if (pViewData->HasEditView(eWhich))
f325b2
-- 
f325b2
2.7.3
f325b2