summaryrefslogtreecommitdiff
path: root/sc/source/ui/optdlg/tpdefaults.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-03-01 11:08:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-01 19:17:09 +0100
commite50f13c9947332639f455739c87213a954067299 (patch)
tree85d98a501258a9734c550f997f833c3c353ceee9 /sc/source/ui/optdlg/tpdefaults.cxx
parent05db887bc226b85befe2c2b9e84b796020a6ca05 (diff)
use SfxItemSet::GetItemIfSet in sc/source/ui/
Change-Id: Ia360a0bbc57f2d50dc26ae670d6e953d3f2d8a8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130745 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/optdlg/tpdefaults.cxx')
-rw-r--r--sc/source/ui/optdlg/tpdefaults.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx
index 7aad4501b254..7a47f3dbc23a 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -67,10 +67,9 @@ bool ScTpDefaultsOptions::FillItemSet(SfxItemSet *rCoreSet)
void ScTpDefaultsOptions::Reset(const SfxItemSet* rCoreSet)
{
ScDefaultsOptions aOpt;
- const SfxPoolItem* pItem = nullptr;
- if(SfxItemState::SET == rCoreSet->GetItemState(SID_SCDEFAULTSOPTIONS, false , &pItem))
- aOpt = static_cast<const ScTpDefaultsItem*>(pItem)->GetDefaultsOptions();
+ if(const ScTpDefaultsItem* pDefaultsItem = rCoreSet->GetItemIfSet(SID_SCDEFAULTSOPTIONS, false))
+ aOpt = pDefaultsItem->GetDefaultsOptions();
m_xEdNSheets->set_value(aOpt.GetInitTabCount());
m_xEdSheetPrefix->set_text( aOpt.GetInitTabPrefix() );