summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/gridwin4.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-08 15:04:07 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-10 13:45:16 +0100
commit961ffd72e2051490b3650348e97f99ef727a573b (patch)
tree2c92222ee8fe88c3cf75648598f9fa4fbd349765 /sc/source/ui/view/gridwin4.cxx
parent212bbbe5cafab06b408ddde930bf9c8d37b7c3aa (diff)
Related: cool#7951 don't invalidate when creating a new view
In writer the ViewOptions are in the ViewShell and are copied when a new ViewShell is created from that ViewShell so the dark/light-mode and doc color are the same in a new view as the old view. But in calc the ViewOptions exist in both the ViewShell and Document and a new ViewShell copies from the document not the old ViewShell. Setting the ViewOptions of a ViewShell in calc doesn't have an effect of having the same setting in a new view in calc. So if you create a new view from an old view you got the ViewOptions of the document, whose light/dark mode remained as "Default" when the old view dark/light more was set. So the mismatch triggered an invalidate. These additions to ViewOptions are relatively new in calc, and the desire is to get the same behaviour in calc as in writer, so move the new additions to a separate class that belongs to the ViewShell and copy them from the current ViewShell when creating a new ViewShell. Change-Id: Ie4b1dbb0437763ec4c8d067179c1fbef520161e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161791 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161880 Tested-by: Jenkins
Diffstat (limited to 'sc/source/ui/view/gridwin4.cxx')
-rw-r--r--sc/source/ui/view/gridwin4.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 95ed4d0c7600..301082c5754c 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1127,13 +1127,12 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI
ScTabViewShell* pCurrentViewShell = dynamic_cast<ScTabViewShell*>(pSfxViewShell);
if (pCurrentViewShell)
{
- const ScViewData& pViewData = pCurrentViewShell->GetViewData();
- const ScViewOptions& aViewOptions = pViewData.GetOptions();
const ScPatternAttr* pPattern = rDoc.GetPattern( nCol1, nRow1, nTab );
Color aCellColor = pPattern->GetItem(ATTR_BACKGROUND).GetColor();
if (aCellColor.IsTransparent())
{
- aCellColor = aViewOptions.GetDocColor();
+ const ScViewRenderingOptions& rViewRenderingOptions = pCurrentViewShell->GetViewRenderingData();
+ aCellColor = rViewRenderingOptions.GetDocColor();
}
rDevice.SetFillColor(aCellColor);
pOtherEditView->SetBackgroundColor(aCellColor);