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-10 10:01:17 +0200
commit44784c7428503a5a6588ce23b52fe62404cc2f51 (patch)
treea4758a32c5024185a6cd58ba106c938742bd8c13 /sfx2
parent410d1ff92edaa0cf544ee79e77711c1eb2283b22 (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/+/115300 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;
}