summaryrefslogtreecommitdiff
path: root/sw/source/uibase/app
diff options
context:
space:
mode:
authorParis Oplopoios <paris.oplopoios@collabora.com>2023-03-08 17:34:02 +0200
committerMiklos Vajna <vmiklos@collabora.com>2023-03-16 08:41:38 +0000
commit1916d161902bdd52b8cfa5b29153c8f8c39fce52 (patch)
treefdb789357ef4e58e3f26066235b5928efcf63437 /sw/source/uibase/app
parentee8e9b993595e728f827a5fe6ab1ae5fb1f6aaae (diff)
De-static-izing colors in SwViewOption
The view colors in SwViewOption were static which means that two separate views couldn't have different colors Change-Id: Id595b00ba56bdb210ad1a784cf76e99ead0d6014 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148481 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source/uibase/app')
-rw-r--r--sw/source/uibase/app/apphdl.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 5d6a0a66514a..a78ba9416e19 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -969,19 +969,20 @@ void SwModule::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdCst, Con
}
else if ( pBrdCst == m_pColorConfig.get() )
{
- if( pBrdCst == m_pColorConfig.get() )
- SwViewOption::ApplyColorConfigValues(*m_pColorConfig);
-
//invalidate all edit windows
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while(pViewShell)
{
if(pViewShell->GetWindow())
{
- if(dynamic_cast< const SwView *>( pViewShell ) != nullptr ||
+ auto pSwView = dynamic_cast<SwView *>( pViewShell );
+ if(pSwView != nullptr ||
dynamic_cast< const SwPagePreview *>( pViewShell ) != nullptr ||
dynamic_cast< const SwSrcView *>( pViewShell ) != nullptr)
{
+ SwViewOption aNewOptions = *pSwView->GetWrtShell().GetViewOptions();
+ aNewOptions.SetColorConfig(*m_pColorConfig);
+ pSwView->GetWrtShell().ApplyViewOptions(aNewOptions);
pViewShell->GetWindow()->Invalidate();
}
}
@@ -1044,7 +1045,7 @@ svtools::ColorConfig& SwModule::GetColorConfig()
if(!m_pColorConfig)
{
m_pColorConfig.reset(new svtools::ColorConfig);
- SwViewOption::ApplyColorConfigValues(*m_pColorConfig);
+ SwViewOption::SetInitialColorConfig(*m_pColorConfig);
m_pColorConfig->AddListener(this);
}
return *m_pColorConfig;