summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-05-04 13:32:51 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2021-05-11 08:34:00 +0200
commit3595670c9082639b3efcd8d9426e4909b8fa212a (patch)
tree9fab2bba325beb19613ca0e9f5d232b4ad574bf9 /sfx2
parent69b376d21dfe43482f67ece137421a7487f0cbae (diff)
Fix style previews widget with multiple languages
Broadcast also universal name (English identifier) for styles on change. This allows to select correct style without knowledge about all languages that other users use in other views. Fixes style previews widget in online with multiple sessions in different languages Change-Id: I9b9bcc92d96b5a5482a97a5947f148a638f257d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115093 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115298 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/tplpitem.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/sfx2/source/dialog/tplpitem.cxx b/sfx2/source/dialog/tplpitem.cxx
index 66f378620acb..11d48584d304 100644
--- a/sfx2/source/dialog/tplpitem.cxx
+++ b/sfx2/source/dialog/tplpitem.cxx
@@ -31,9 +31,11 @@ SfxTemplateItem::SfxTemplateItem() :
SfxTemplateItem::SfxTemplateItem
(
sal_uInt16 nWhichId, // Slot-ID
- const OUString& rStyle // Name of the current Styles
+ const OUString& rStyle, // Name of the current Styles
+ const OUString& rStyleIdentifier // Prog Name of current Style
) : SfxFlagItem( nWhichId, static_cast<sal_uInt16>(SfxStyleSearchBits::All) ),
- aStyle( rStyle )
+ aStyle( rStyle ),
+ aStyleIdentifier( rStyleIdentifier )
{
}
@@ -42,7 +44,8 @@ SfxTemplateItem::SfxTemplateItem
bool SfxTemplateItem::operator==( const SfxPoolItem& rCmp ) const
{
return ( SfxFlagItem::operator==( rCmp ) &&
- aStyle == static_cast<const SfxTemplateItem&>(rCmp).aStyle );
+ aStyle == static_cast<const SfxTemplateItem&>(rCmp).aStyle &&
+ aStyleIdentifier == static_cast<const SfxTemplateItem&>(rCmp).aStyleIdentifier );
}
SfxTemplateItem* SfxTemplateItem::Clone( SfxItemPool *) const
@@ -56,6 +59,7 @@ bool SfxTemplateItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
aTemplate.Value = static_cast<sal_uInt16>(GetValue());
aTemplate.StyleName = aStyle;
+ aTemplate.StyleNameIdentifier = aStyleIdentifier;
rVal <<= aTemplate;
return true;
@@ -70,6 +74,7 @@ bool SfxTemplateItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /*nMemberId
{
SetValue( static_cast<SfxStyleSearchBits>(aTemplate.Value) );
aStyle = aTemplate.StyleName;
+ aStyleIdentifier = aTemplate.StyleNameIdentifier;
return true;
}