diff options
-rw-r--r-- | include/sfx2/tplpitem.hxx | 5 | ||||
-rw-r--r-- | offapi/com/sun/star/frame/status/Template.idl | 7 | ||||
-rw-r--r-- | sfx2/source/dialog/tplpitem.cxx | 11 | ||||
-rw-r--r-- | svx/source/tbxctrls/StylesPreviewWindow.cxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/app/docst.cxx | 7 |
5 files changed, 31 insertions, 6 deletions
diff --git a/include/sfx2/tplpitem.hxx b/include/sfx2/tplpitem.hxx index 927d67e89625..647e2b8e72bf 100644 --- a/include/sfx2/tplpitem.hxx +++ b/include/sfx2/tplpitem.hxx @@ -28,13 +28,16 @@ class SFX2_DLLPUBLIC SfxTemplateItem final : public SfxFlagItem { OUString aStyle; + OUString aStyleIdentifier; public: static SfxPoolItem* CreateDefault(); SfxTemplateItem(); SfxTemplateItem( sal_uInt16 nWhich, - const OUString &rStyle ); + const OUString &rStyle, + const OUString &rStyleIdentifier = "" ); const OUString& GetStyleName() const { return aStyle; } + const OUString& GetStyleIdentifier() const { return aStyleIdentifier; } virtual SfxTemplateItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual bool operator==( const SfxPoolItem& ) const override; diff --git a/offapi/com/sun/star/frame/status/Template.idl b/offapi/com/sun/star/frame/status/Template.idl index e9e688eb1363..9bb9402cef89 100644 --- a/offapi/com/sun/star/frame/status/Template.idl +++ b/offapi/com/sun/star/frame/status/Template.idl @@ -39,6 +39,13 @@ struct Template /** specifies a value that is bound to the style name. */ long Value; + + + /** specifies an identifier name in English (only for standard style). + + @since LO 7.2 + */ + string StyleNameIdentifier; }; 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; } diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx b/svx/source/tbxctrls/StylesPreviewWindow.cxx index 08d812af6493..cdeee7e3c772 100644 --- a/svx/source/tbxctrls/StylesPreviewWindow.cxx +++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx @@ -69,7 +69,12 @@ void StyleStatusListener::StateChanged(SfxItemState /*eState*/, const SfxPoolIte { const SfxTemplateItem* pStateItem = dynamic_cast<const SfxTemplateItem*>(pState); if (pStateItem) - m_pPreviewControl->Select(pStateItem->GetStyleName()); + { + if (pStateItem->GetStyleIdentifier().isEmpty()) + m_pPreviewControl->Select(pStateItem->GetStyleName()); + else + m_pPreviewControl->Select(pStateItem->GetStyleIdentifier()); + } } StylePoolChangeListener::StylePoolChangeListener(StylesPreviewWindow_Base* pPreviewControl) diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 43cebe917a2a..aceb1c548ded 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -150,11 +150,16 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) case SID_STYLE_FAMILY2: if(!pShell->IsFrameSelected()) { + OUString aProgName; SwTextFormatColl* pColl = pShell->GetCurTextFormatColl(); if(pColl) + { aName = pColl->GetName(); + sal_uInt16 nId = pColl->GetPoolFormatId(); + SwStyleNameMapper::FillProgName(nId, aProgName); + } - SfxTemplateItem aItem(nWhich, aName); + SfxTemplateItem aItem(nWhich, aName, aProgName); SfxStyleSearchBits nMask = SfxStyleSearchBits::Auto; if (m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE)) |