summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-05-04 10:24:53 +0100
committerAndras Timar <andras.timar@collabora.com>2023-05-13 20:05:31 +0200
commit5fdeae6399b44ee633e68c175f4b1c27d0084a2c (patch)
tree267685f9ce577dc94245c3b6cd09169c9e5e7539 /toolkit
parentff4c6d2a7c464ff1179ffb38de10ef56efbcdadb (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/+/151370 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/controls/unocontrol.cxx37
1 files changed, 19 insertions, 18 deletions
diff --git a/toolkit/source/controls/unocontrol.cxx b/toolkit/source/controls/unocontrol.cxx
index a3d0a251c382..dc60204ccc47 100644
--- a/toolkit/source/controls/unocontrol.cxx
+++ b/toolkit/source/controls/unocontrol.cxx
@@ -1298,6 +1298,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).
@@ -1317,24 +1336,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;