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

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