diff options
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/drviewsf.cxx | 38 | ||||
-rw-r--r-- | sd/source/ui/view/outlnvsh.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/view/viewshe3.cxx | 10 |
3 files changed, 34 insertions, 22 deletions
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index 6c7436500064..d161d0ffcb66 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -486,30 +486,41 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) case SID_STYLE_WATERCAN: { - ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings()); - if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO) + SfxPoolItem* pItem = NULL; + GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); + SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); + if (pFamilyItem && SfxTemplateDialog::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO) rSet.Put(SfxBoolItem(nWhich,false)); else { SfxBoolItem aItem(nWhich, SD_MOD()->GetWaterCan()); aAllSet.Put( aItem, aItem.Which()); } + delete pItem; } break; case SID_STYLE_NEW: { - ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings()); - if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO) + SfxPoolItem* pItem = NULL; + GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); + SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); + if (pFamilyItem && SfxTemplateDialog::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO) + { rSet.DisableItem(nWhich); + } + delete pItem; } break; case SID_STYLE_DRAGHIERARCHIE: { - ISfxTemplateCommon* pTemplateCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings()); - if (pTemplateCommon && pTemplateCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO) + SfxPoolItem* pItem = NULL; + GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); + SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); + if (pFamilyItem && SfxTemplateDialog::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO) rSet.DisableItem(nWhich); + delete pItem; } break; @@ -517,14 +528,17 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) { // It is not possible to create PseudoStyleSheets 'by Example'; // normal style sheets need a selected object for that - ISfxTemplateCommon* pTemplCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings()); - if (pTemplCommon) + + SfxPoolItem* pItem = NULL; + GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); + SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); + if (pFamilyItem) { - if (pTemplCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO) + if (SfxTemplateDialog::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO) { rSet.DisableItem(nWhich); } - else if (pTemplCommon->GetActualFamily() == SD_STYLE_FAMILY_GRAPHICS) + else if (SfxTemplateDialog::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_GRAPHICS) { if (!mpDrawView->AreObjectsMarked()) { @@ -532,7 +546,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) } } } - // if there is no (yet) a designer, we have to go back into the + // if there is no (yet) a style designer, we have to go back into the // view state; an actual set family can not be considered else { @@ -541,7 +555,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) rSet.DisableItem(nWhich); } } - + delete pItem; } break; diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 291ea39289b3..b78fbfb1c67d 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -1594,9 +1594,10 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet ) case SID_STYLE_EDIT: { - ISfxTemplateCommon* pTmplCommon = SFX_APP()->GetCurrentTemplateCommon(GetViewFrame()->GetBindings()); - - if (pTmplCommon && pTmplCommon->GetActualFamily() == SD_STYLE_FAMILY_PSEUDO) + SfxPoolItem* pItem = NULL; + GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); + SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); + if (pFamilyItem && SfxTemplateDialog::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO) { SfxItemSet aSet(*rSet.GetPool(), SID_STATUS_LAYOUT, SID_STATUS_LAYOUT); GetStatusBarState(aSet); @@ -1607,6 +1608,7 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet ) rSet.DisableItem(nWhich); } } + delete pItem; } break; diff --git a/sd/source/ui/view/viewshe3.cxx b/sd/source/ui/view/viewshe3.cxx index e5205c4c1b54..826a39447b89 100644 --- a/sd/source/ui/view/viewshe3.cxx +++ b/sd/source/ui/view/viewshe3.cxx @@ -72,6 +72,7 @@ #include <svx/svxids.hrc> #include <sfx2/request.hxx> +#include <sfx2/templdlg.hxx> #include <svl/aeitem.hxx> #include <basic/sbstar.hxx> @@ -102,17 +103,12 @@ void ViewShell::GetMenuState( SfxItemSet &rSet ) if( pStyleSheet ) { SfxStyleFamily eFamily = pStyleSheet->GetFamily(); - if(eFamily == SD_STYLE_FAMILY_GRAPHICS) - nFamily = 2; - else if(eFamily == SD_STYLE_FAMILY_CELL ) - nFamily = 3; - else // SD_STYLE_FAMILY_PSEUDO - nFamily = 5; - + nFamily = SfxTemplateDialog::SfxFamilyIdToNId(eFamily); GetDocSh()->SetStyleFamily(nFamily); } } } + rSet.Put(SfxUInt16Item(SID_STYLE_FAMILY, nFamily )); } |