diff options
Diffstat (limited to 'sc/source/ui/view/formatsh.cxx')
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 35220871d22a..045ddf066650 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -212,9 +212,12 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet ) case SID_STYLE_UPDATE_BY_EXAMPLE: { - ISfxTemplateCommon* pDesigner = SFX_APP()-> - GetCurrentTemplateCommon(pTabViewShell->GetViewFrame()->GetBindings()); - bool bPage = pDesigner && SFX_STYLE_FAMILY_PAGE == pDesigner->GetActualFamily(); + SfxPoolItem* pItem = NULL; + pTabViewShell->GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); + SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); + + bool bPage = pFamilyItem && SFX_STYLE_FAMILY_PAGE == SfxTemplateDialog::NIdToSfxFamilyId(pFamilyItem->GetValue()); + delete pItem; if ( bProtected || bPage ) rSet.DisableItem( nSlotId ); @@ -226,9 +229,11 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet ) case SID_STYLE_HIDE: case SID_STYLE_SHOW: { - ISfxTemplateCommon* pDesigner = SFX_APP()-> - GetCurrentTemplateCommon(pTabViewShell->GetViewFrame()->GetBindings()); - bool bPage = pDesigner && SFX_STYLE_FAMILY_PAGE == pDesigner->GetActualFamily(); + SfxPoolItem* pItem = NULL; + pTabViewShell->GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); + SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); + bool bPage = pFamilyItem && SFX_STYLE_FAMILY_PAGE == SfxTemplateDialog::NIdToSfxFamilyId(pFamilyItem->GetValue()); + delete pItem; if ( bProtected && !bPage ) rSet.DisableItem( nSlotId ); |