sc/source/ui/view/gridwin4.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 6c36f5bfad2d446f87fb1de319a45a0ebc2905d0
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Feb 15 15:28:21 2024 +0000
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Feb 15 18:26:58 2024 +0100

    kit: cell in editing mode shown with dark view bg in light view
    
    open a calc doc in light mode (view 1) and again in another view (view
    2) and toggle the second view to dark mode.
    
    Now edit a cell in the dark mode view and in the light move view the
    edited cell background is drawn as dark.
    
    bisected this to:
    
    commit f0adebce7a64b6c7dd57e10811cbe45767c6a540
    Date:   Wed Dec 13 17:50:44 2023 +0100
    
        lok: calc: fix for rendering issues on in place editing
    
    Change-Id: I5bdd0c1afaf5fa942c1b1f8bc1009b9057656840
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163400
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 4a9e92668b7e..97fff9f65049 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1116,8 +1116,11 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
             Color aCellColor = pPattern->GetItem(ATTR_BACKGROUND).GetColor();
             if (aCellColor.IsTransparent())
             {
-                const ScViewRenderingOptions& rViewRenderingOptions = 
pTabViewShell->GetViewRenderingData();
-                aCellColor = rViewRenderingOptions.GetDocColor();
+                if (ScTabViewShell* pCurrentViewShell = 
dynamic_cast<ScTabViewShell*>(SfxViewShell::Current()))
+                {
+                    const ScViewRenderingOptions& rViewRenderingOptions = 
pCurrentViewShell->GetViewRenderingData();
+                    aCellColor = rViewRenderingOptions.GetDocColor();
+                }
             }
             rDevice.SetFillColor(aCellColor);
             pOtherEditView->SetBackgroundColor(aCellColor);

Reply via email to