diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-01 11:08:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-01 19:17:09 +0100 |
commit | e50f13c9947332639f455739c87213a954067299 (patch) | |
tree | 85d98a501258a9734c550f997f833c3c353ceee9 /sc/source/ui/optdlg/tpprint.cxx | |
parent | 05db887bc226b85befe2c2b9e84b796020a6ca05 (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/tpprint.cxx')
-rw-r--r-- | sc/source/ui/optdlg/tpprint.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx index e8294c92f196..c257f6f3da91 100644 --- a/sc/source/ui/optdlg/tpprint.cxx +++ b/sc/source/ui/optdlg/tpprint.cxx @@ -56,18 +56,17 @@ void ScTpPrintOptions::Reset( const SfxItemSet* rCoreSet ) { ScPrintOptions aOptions; - const SfxPoolItem* pItem; - if(SfxItemState::SET == rCoreSet->GetItemState(SID_SCPRINTOPTIONS, false , &pItem)) - aOptions = static_cast<const ScTpPrintItem*>(pItem)->GetPrintOptions(); + if(const ScTpPrintItem* pItem = rCoreSet->GetItemIfSet(SID_SCPRINTOPTIONS, false)) + aOptions = pItem->GetPrintOptions(); else { // when called from print dialog and no options set, use configuration aOptions = SC_MOD()->GetPrintOptions(); } - if ( SfxItemState::SET == rCoreSet->GetItemState( SID_PRINT_SELECTEDSHEET, false , &pItem ) ) + if ( const SfxBoolItem* pItem = rCoreSet->GetItemIfSet( SID_PRINT_SELECTEDSHEET, false)) { - bool bChecked = static_cast<const SfxBoolItem*>(pItem)->GetValue(); + bool bChecked = pItem->GetValue(); m_xSelectedSheetsCB->set_active( bChecked ); } else |