summaryrefslogtreecommitdiff
path: root/sw/source/uibase/app
diff options
context:
space:
mode:
authorParis Oplopoios <paris.oplopoios@collabora.com>2023-03-16 03:58:18 +0200
committerParis Oplopoios <parisoplop@gmail.com>2023-03-16 23:48:10 +0000
commit9f0cf00d29298ed55737928ec4dddc50ac850cd8 (patch)
treea4f69bb28a004e533306f31baf4a37d816c80f7d /sw/source/uibase/app
parent9310192a4a0af4e7e3e9ac6124cdd2a706dfedcb (diff)
Update view options string based on theme
Update the view options string based on the theme when tiled rendering, and make sure only the currently active view is updated Change-Id: Ib24111848f2926fe7ae858ca2e18e946d980e83f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148943 Tested-by: Paris Oplopoios <parisoplop@gmail.com> Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
Diffstat (limited to 'sw/source/uibase/app')
-rw-r--r--sw/source/uibase/app/apphdl.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index a78ba9416e19..bbc2ada8e165 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -79,6 +79,7 @@
#include <swabstdlg.hxx>
#include <comphelper/dispatchcommand.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/lok.hxx>
#include <salhelper/simplereferenceobject.hxx>
#include <rtl/ref.hxx>
@@ -969,8 +970,9 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, Con
}
else if ( pBrdCst == m_pColorConfig.get() )
{
- //invalidate all edit windows
- SfxViewShell* pViewShell = SfxViewShell::GetFirst();
+ //invalidate only the current view in tiled rendering mode, or all views otherwise
+ bool bOnlyInvalidateCurrentView = comphelper::LibreOfficeKit::isActive();
+ SfxViewShell* pViewShell = bOnlyInvalidateCurrentView ? SfxViewShell::Current() : SfxViewShell::GetFirst();
while(pViewShell)
{
if(pViewShell->GetWindow())
@@ -981,11 +983,14 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, Con
dynamic_cast< const SwSrcView *>( pViewShell ) != nullptr)
{
SwViewOption aNewOptions = *pSwView->GetWrtShell().GetViewOptions();
+ aNewOptions.SetThemeName(m_pColorConfig->GetCurrentSchemeName());
aNewOptions.SetColorConfig(*m_pColorConfig);
pSwView->GetWrtShell().ApplyViewOptions(aNewOptions);
pViewShell->GetWindow()->Invalidate();
}
}
+ if (bOnlyInvalidateCurrentView)
+ break;
pViewShell = SfxViewShell::GetNext( *pViewShell );
}
}