summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/tabview.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-01-08 15:04:07 +0000
committerAndras Timar <andras.timar@collabora.com>2024-01-15 19:41:40 +0100
commit4cbbd8d6261dfebbe0808168a3ab745e52825492 (patch)
treea35fa28ac080caf005b6ec7745f37509b17de20f /sc/source/ui/view/tabview.cxx
parent197fcfe3aa0251c14ea5ff44238ba346aad74214 (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/tabview.cxx')
-rw-r--r--sc/source/ui/view/tabview.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 9eff50195e84..71a37ddce9da 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -169,11 +169,18 @@ bool lcl_HasRowOutline( const ScViewData& rViewData )
return false;
}
+ScViewRenderingOptions getViewRenderingOptions(ScDocShell& rDocShell)
+{
+ ScTabViewShell* pViewShell = rDocShell.GetBestViewShell();
+ return pViewShell ? pViewShell->GetViewRenderingData() : ScViewRenderingOptions();
+}
+
} // anonymous namespace
ScTabView::ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ) :
pFrameWin( pParent ),
aViewData( rDocSh, pViewShell ),
+ aViewRenderingData(getViewRenderingOptions(rDocSh)),
aFunctionSet( &aViewData ),
aHdrFunc( &aViewData ),
aVScrollTop( VclPtr<ScrollAdaptor>::Create( pFrameWin, false ) ),