diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-05-04 10:24:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-05-04 16:43:34 +0200 |
commit | 96a403b9b12fbea4cd1d72c55597dd64023de465 (patch) | |
tree | bf4ab5984b5ee1faa3c2598b11033eede9ad8497 /toolkit | |
parent | 894bb1128ca0e80b96d48bfd94556f70af02ce41 (diff) |
Resolves: tdf#155029 set StandardStyles before updateFromModel
otherwise it overrides custom settings set by the model properties
Change-Id: If5898aba3f2701b6d6bdaed99f9cb01174e53613
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151356
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/controls/unocontrol.cxx | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx index 217d8f94185d..5401cf86d7b7 100644 --- a/toolkit/source/controls/unocontrol.cxx +++ b/toolkit/source/controls/unocontrol.cxx @@ -1299,6 +1299,25 @@ void UnoControl::createPeer( const Reference< XToolkit >& rxToolkit, const Refer aGuard.clear(); + // tdf#150886 if false use the same settings for widgets regardless of theme + // for consistency of document across platforms and in pdf/print output + // note: tdf#155029 do this before updateFromModel + if (xInfo->hasPropertyByName("StandardTheme")) + { + aVal = xPSet->getPropertyValue("StandardTheme"); + bool bUseStandardTheme = false; + aVal >>= bUseStandardTheme; + if (bUseStandardTheme) + { + VclPtr<vcl::Window> pVclPeer = VCLUnoHelper::GetWindow(getPeer()); + AllSettings aAllSettings = pVclPeer->GetSettings(); + StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); + aStyleSettings.SetStandardStyles(); + aAllSettings.SetStyleSettings(aStyleSettings); + pVclPeer->SetSettings(aAllSettings); + } + } + // the updateFromModel is done without a locked mutex, too. // The reason is that the only thing this method does is firing property changes, and this in general has // to be done without locked mutexes (as every notification to external listeners). @@ -1318,24 +1337,6 @@ void UnoControl::createPeer( const Reference< XToolkit >& rxToolkit, const Refer xView->setGraphics( xGraphics ); - // tdf#150886 if false use the same settings for widgets regardless of theme - // for consistency of document across platforms and in pdf/print output - if (xInfo->hasPropertyByName("StandardTheme")) - { - aVal = xPSet->getPropertyValue("StandardTheme"); - bool bUseStandardTheme = false; - aVal >>= bUseStandardTheme; - if (bUseStandardTheme) - { - VclPtr<vcl::Window> pVclPeer = VCLUnoHelper::GetWindow(getPeer()); - AllSettings aAllSettings = pVclPeer->GetSettings(); - StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); - aStyleSettings.SetStandardStyles(); - aAllSettings.SetStyleSettings(aStyleSettings); - pVclPeer->SetSettings(aAllSettings); - } - } - peerCreated(); mbCreatingPeer = false; |