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

New commits:
commit c55d3c857e35554f44c30d7e8bd7514dd6ad681f
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 17:48:30 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/+/163446
    Reviewed-by: Marco Cecchetti <marco.cecche...@collabora.com>
    Tested-by: Marco Cecchetti <marco.cecche...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 892ac654c477..1feb6bbff42a 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1113,8 +1113,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