diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-14 12:28:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-14 14:20:26 +0100 |
commit | 6ba9daac763baf37c833911be5e5fb97e068bea1 (patch) | |
tree | 12ba4c5402747074f5a4b69a10fc60ab1c3d6603 /sd/source/ui/view | |
parent | a342ac91e21dd45640b7dea063bc04b80f0feb6e (diff) |
add TypedWhichId version of QueryState
Change-Id: I95b86fc081847da01e06f50a1b2c7e7f5456c638
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131529
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r-- | sd/source/ui/view/drviews3.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsf.cxx | 20 | ||||
-rw-r--r-- | sd/source/ui/view/outlnvsh.cxx | 5 |
3 files changed, 12 insertions, 17 deletions
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index 25422d400f73..c80c6b3bbd5b 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -710,8 +710,8 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) case SID_ATTR_PARA_LINESPACE: if (pArgs) { - SvxLineSpacingItem aParaLineSP = static_cast<const SvxLineSpacingItem&>(pArgs->Get( - GetPool().GetWhich(SID_ATTR_PARA_LINESPACE))); + SvxLineSpacingItem aParaLineSP = pArgs->Get( + GetPool().GetWhich(SID_ATTR_PARA_LINESPACE)); SfxItemSetFixed<EE_PARA_SBL, EE_PARA_SBL> aEditAttr( GetPool() ); aParaLineSP.SetWhich( EE_PARA_SBL ); diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx index 471d549cb12a..f23bd042ce23 100644 --- a/sd/source/ui/view/drviewsf.cxx +++ b/sd/source/ui/view/drviewsf.cxx @@ -529,9 +529,8 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) case SID_STYLE_WATERCAN: { - std::unique_ptr<SfxPoolItem> pItem; - GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); - SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get()); + std::unique_ptr<SfxUInt16Item> pFamilyItem; + GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pFamilyItem); if (pFamilyItem && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SfxStyleFamily::Pseudo) rSet.Put(SfxBoolItem(nWhich,false)); else @@ -544,9 +543,8 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) case SID_STYLE_NEW: { - std::unique_ptr<SfxPoolItem> pItem; - GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); - SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get()); + std::unique_ptr<SfxUInt16Item> pFamilyItem; + GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pFamilyItem); if (pFamilyItem && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SfxStyleFamily::Pseudo) { rSet.DisableItem(nWhich); @@ -556,9 +554,8 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) case SID_STYLE_DRAGHIERARCHIE: { - std::unique_ptr<SfxPoolItem> pItem; - GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); - SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get()); + std::unique_ptr<SfxUInt16Item> pFamilyItem; + GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pFamilyItem); if (pFamilyItem && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SfxStyleFamily::Pseudo) rSet.DisableItem(nWhich); } @@ -569,9 +566,8 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet ) // It is not possible to create PseudoStyleSheets 'by Example'; // normal style sheets need a selected object for that - std::unique_ptr<SfxPoolItem> pItem; - GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); - SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get()); + std::unique_ptr<SfxUInt16Item> pFamilyItem; + GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pFamilyItem); if (pFamilyItem) { if (static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SfxStyleFamily::Pseudo) diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index a24f3596b290..0eb351f915b0 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -1460,9 +1460,8 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet ) case SID_STYLE_EDIT: { - std::unique_ptr<SfxPoolItem> pItem; - GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); - SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get()); + std::unique_ptr<SfxUInt16Item> pFamilyItem; + GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pFamilyItem); if (pFamilyItem && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SfxStyleFamily::Pseudo) { SfxItemSetFixed<SID_STATUS_LAYOUT, SID_STATUS_LAYOUT> aSet(*rSet.GetPool()); |