diff options
26 files changed, 117 insertions, 132 deletions
diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx index 7ba649d010ff..9b24588cfa64 100644 --- a/cui/source/customize/SvxToolbarConfigPage.cxx +++ b/cui/source/customize/SvxToolbarConfigPage.cxx @@ -106,7 +106,7 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(weld::Container* pPage, m_aURLToSelect = ITEM_TOOLBAR_URL; m_aURLToSelect += "standardbar"; - const SfxPoolItem* pItem = rSet.GetItem(rSet.GetPool()->GetWhich(SID_CONFIG)); + const SfxPoolItem* pItem = rSet.GetItem(SID_CONFIG); if (pItem) { diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 8531907e805c..dc4788b7a983 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -214,8 +214,7 @@ SvxConfigDialog::SvxConfigDialog(weld::Window * pParent, const SfxItemSet* pInSe AddTabPage("keyboard", CreateKeyboardConfigPage, nullptr); AddTabPage("events", CreateSvxEventConfigPage, nullptr); - const SfxPoolItem* pItem = - pInSet->GetItem( pInSet->GetPool()->GetWhich( SID_CONFIG ) ); + const SfxPoolItem* pItem = pInSet->GetItem( SID_CONFIG ); if ( pItem ) { diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index 860c53f99d8c..2a2129a6d162 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -653,10 +653,10 @@ void SvxCharacterMap::insertCharToDoc(const OUString& sGlyph) } else { sal_UCS4 cChar = sGlyph.iterateCodePoints(&o3tl::temporary(sal_Int32(0))); const SfxItemPool* pPool = m_xOutputSet->GetPool(); - m_xOutputSet->Put( SfxStringItem( pPool->GetWhich(SID_CHARMAP), sGlyph ) ); + m_xOutputSet->Put( SfxStringItem( SID_CHARMAP, sGlyph ) ); m_xOutputSet->Put( SvxFontItem( aFont.GetFamilyType(), aFont.GetFamilyName(), aFont.GetStyleName(), aFont.GetPitch(), aFont.GetCharSet(), pPool->GetWhich(SID_ATTR_CHAR_FONT) ) ); - m_xOutputSet->Put( SfxStringItem( pPool->GetWhich(SID_FONT_NAME), aFont.GetFamilyName() ) ); + m_xOutputSet->Put( SfxStringItem( SID_FONT_NAME, aFont.GetFamilyName() ) ); m_xOutputSet->Put( SfxInt32Item( pPool->GetWhich(SID_ATTR_CHAR), cChar ) ); } } diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx index 91e8cf911e99..ed7d9fecbfad 100644 --- a/cui/source/options/optgenrl.cxx +++ b/cui/source/options/optgenrl.cxx @@ -363,11 +363,9 @@ void SvxGeneralTabPage::Reset( const SfxItemSet* rSet ) { SetData_Impl(); - sal_uInt16 const nWhich = GetWhich(SID_FIELD_GRABFOCUS); - - if (rSet->GetItemState(nWhich) == SfxItemState::SET) + if (rSet->GetItemState(SID_FIELD_GRABFOCUS) == SfxItemState::SET) { - EditPosition nField = static_cast<EditPosition>(static_cast<const SfxUInt16Item&>(rSet->Get(nWhich)).GetValue()); + EditPosition nField = static_cast<EditPosition>(static_cast<const SfxUInt16Item&>(rSet->Get(SID_FIELD_GRABFOCUS)).GetValue()); if (nField != EditPosition::UNKNOWN) { for (auto const & i: vFields) diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 46e0d6e90892..c0f40df728e6 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1052,8 +1052,7 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet ) const SfxPoolItem* pOld = GetOldItem( *rCoreSet, SID_AUTOSPELL_CHECK ); if ( !pOld || static_cast<const SfxBoolItem*>(pOld)->GetValue() != bNewAutoCheck ) { - rCoreSet->Put( SfxBoolItem( GetWhich( SID_AUTOSPELL_CHECK ), - bNewAutoCheck ) ); + rCoreSet->Put( SfxBoolItem( SID_AUTOSPELL_CHECK, bNewAutoCheck ) ); bModified = true; } diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 08e4ce219197..1a9932e91442 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -239,55 +239,54 @@ bool SvxSaveTabPage::FillItemSet( SfxItemSet* rSet ) if ( m_xDocInfoCB->get_state_changed_from_saved() ) { - rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_DOCINFO ), + rSet->Put( SfxBoolItem( SID_ATTR_DOCINFO, m_xDocInfoCB->get_active() ) ); bModified = true; } if ( m_xBackupCB->get_sensitive() && m_xBackupCB->get_state_changed_from_saved() ) { - rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_BACKUP ), - m_xBackupCB->get_active() ) ); + rSet->Put( SfxBoolItem( SID_ATTR_BACKUP, m_xBackupCB->get_active() ) ); bModified = true; } if ( m_xAutoSaveCB->get_state_changed_from_saved() ) { - rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_AUTOSAVE ), + rSet->Put( SfxBoolItem( SID_ATTR_AUTOSAVE, m_xAutoSaveCB->get_active() ) ); bModified = true; } if ( m_xWarnAlienFormatCB->get_state_changed_from_saved() ) { - rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_WARNALIENFORMAT ), + rSet->Put( SfxBoolItem( SID_ATTR_WARNALIENFORMAT, m_xWarnAlienFormatCB->get_active() ) ); bModified = true; } if ( m_xAutoSaveEdit->get_value_changed_from_saved() ) { - rSet->Put( SfxUInt16Item( GetWhich( SID_ATTR_AUTOSAVEMINUTE ), + rSet->Put( SfxUInt16Item( SID_ATTR_AUTOSAVEMINUTE, static_cast<sal_uInt16>(m_xAutoSaveEdit->get_value()) ) ); bModified = true; } if ( m_xUserAutoSaveCB->get_state_changed_from_saved() ) { - rSet->Put( SfxBoolItem( GetWhich( SID_ATTR_USERAUTOSAVE ), + rSet->Put( SfxBoolItem( SID_ATTR_USERAUTOSAVE, m_xUserAutoSaveCB->get_active() ) ); bModified = true; } // save relatively if ( m_xRelativeFsysCB->get_state_changed_from_saved() ) { - rSet->Put( SfxBoolItem( GetWhich( SID_SAVEREL_FSYS ), + rSet->Put( SfxBoolItem( SID_SAVEREL_FSYS, m_xRelativeFsysCB->get_active() ) ); bModified = true; } if ( m_xRelativeInetCB->get_state_changed_from_saved() ) { - rSet->Put( SfxBoolItem( GetWhich( SID_SAVEREL_INET ), + rSet->Put( SfxBoolItem( SID_SAVEREL_INET, m_xRelativeInetCB->get_active() ) ); bModified = true; } diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index ae9f8b8e422f..583f83d2a1c3 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -1044,7 +1044,7 @@ std::optional<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId ) SID_ATTR_YEAR2000, SID_ATTR_YEAR2000> ); SfxItemSetFixed<SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER> aOptSet( SfxGetpApp()->GetPool() ); - SfxGetpApp()->GetOptions(aOptSet); + SfxApplication::GetOptions(aOptSet); pRet->Put(aOptSet); SfxViewFrame* pViewFrame = SfxViewFrame::Current(); @@ -1147,7 +1147,7 @@ std::optional<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId ) SID_SAVEREL_INET, SID_SAVEREL_FSYS, SID_INET_NOPROXY, SID_INET_FTP_PROXY_PORT, SID_SECURE_URL, SID_SECURE_URL> ); - SfxGetpApp()->GetOptions(*pRet); + SfxApplication::GetOptions(*pRet); break; case SID_FILTER_DLG: pRet.emplace( @@ -1157,7 +1157,7 @@ std::optional<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId ) SID_ATTR_DOCINFO, SID_ATTR_AUTOSAVEMINUTE, SID_SAVEREL_INET, SID_SAVEREL_FSYS, SID_ATTR_PRETTYPRINTING, SID_ATTR_PRETTYPRINTING> ); - SfxGetpApp()->GetOptions(*pRet); + SfxApplication::GetOptions(*pRet); break; case SID_SB_STARBASEOPTIONS: diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index ada608229f8b..f7e9a8ec8930 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -288,7 +288,7 @@ bool shouldLaunchQuickstart() { const SfxPoolItem* pItem=nullptr; SfxItemSetFixed<SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER> aQLSet(SfxGetpApp()->GetPool()); - SfxGetpApp()->GetOptions(aQLSet); + SfxApplication::GetOptions(aQLSet); SfxItemState eState = aQLSet.GetItemState(SID_ATTR_QUICKLAUNCHER, false, &pItem); if (SfxItemState::SET == eState) bQuickstart = static_cast<const SfxBoolItem*>(pItem)->GetValue(); diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx index fd8e556c7af1..3be6671986a5 100644 --- a/include/sfx2/app.hxx +++ b/include/sfx2/app.hxx @@ -149,7 +149,7 @@ public: void SaveBasicAndDialogContainer() const; // misc. - void GetOptions(SfxItemSet &); + static void GetOptions(SfxItemSet &); void SetOptions(const SfxItemSet &); virtual void Invalidate(sal_uInt16 nId = 0) override; void NotifyEvent(const SfxEventHint& rEvent, bool bSynchron = true ); diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 2643fefc208a..f2af9e93be22 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -213,7 +213,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq ) const SfxItemSet *pArgs = rReq.GetArgs(); const SfxPoolItem* pItem = nullptr; if( pArgs ) - pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem); + pArgs->GetItemState(SID_CHARMAP, false, &pItem); if ( pItem ) { diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx index b7c4989a0c20..558eec388480 100644 --- a/sc/source/ui/inc/tpcalc.hxx +++ b/sc/source/ui/inc/tpcalc.hxx @@ -37,7 +37,6 @@ public: private: std::unique_ptr<ScDocOptions> pOldOptions; std::unique_ptr<ScDocOptions> pLocalOptions; - sal_uInt16 nWhichCalc; std::unique_ptr<weld::CheckButton> m_xBtnIterate; std::unique_ptr<weld::Label> m_xFtSteps; diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx index df8d827ef670..6ab3baaa70c9 100644 --- a/sc/source/ui/optdlg/tpcalc.cxx +++ b/sc/source/ui/optdlg/tpcalc.cxx @@ -36,10 +36,8 @@ ScTpCalcOptions::ScTpCalcOptions(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rCoreAttrs) : SfxTabPage(pPage, pController, "modules/scalc/ui/optcalculatepage.ui", "OptCalculatePage", &rCoreAttrs) , pOldOptions(new ScDocOptions( - static_cast<const ScTpCalcItem&>(rCoreAttrs.Get( - GetWhich(SID_SCDOCOPTIONS))).GetDocOptions())) + static_cast<const ScTpCalcItem&>(rCoreAttrs.Get(SID_SCDOCOPTIONS)).GetDocOptions())) , pLocalOptions(new ScDocOptions) - , nWhichCalc(GetWhich(SID_SCDOCOPTIONS)) , m_xBtnIterate(m_xBuilder->weld_check_button("iterate")) , m_xFtSteps(m_xBuilder->weld_label("stepsft")) , m_xEdSteps(m_xBuilder->weld_spin_button("steps")) @@ -90,7 +88,7 @@ void ScTpCalcOptions::Reset(const SfxItemSet* rCoreAttrs) pOldOptions.reset(new ScDocOptions( static_cast<const ScTpCalcItem&>(rCoreAttrs->Get( - GetWhich(SID_SCDOCOPTIONS))).GetDocOptions())); + SID_SCDOCOPTIONS)).GetDocOptions())); *pLocalOptions = *pOldOptions; @@ -193,7 +191,7 @@ bool ScTpCalcOptions::FillItemSet( SfxItemSet* rCoreAttrs ) } if ( *pLocalOptions != *pOldOptions ) { - rCoreAttrs->Put( ScTpCalcItem( nWhichCalc, *pLocalOptions ) ); + rCoreAttrs->Put( ScTpCalcItem( SID_SCDOCOPTIONS, *pLocalOptions ) ); return true; } else diff --git a/sc/source/ui/optdlg/tpformula.cxx b/sc/source/ui/optdlg/tpformula.cxx index 10a4b407c796..0656c03948c7 100644 --- a/sc/source/ui/optdlg/tpformula.cxx +++ b/sc/source/ui/optdlg/tpformula.cxx @@ -77,7 +77,7 @@ ScTpFormulaOptions::ScTpFormulaOptions(weld::Container* pPage, weld::DialogContr mnDecSep = aSep.isEmpty() ? u'.' : aSep[0]; maSavedDocOptions = static_cast<const ScTpCalcItem&>(rCoreAttrs.Get( - GetWhich(SID_SCDOCOPTIONS))).GetDocOptions(); + SID_SCDOCOPTIONS)).GetDocOptions(); } ScTpFormulaOptions::~ScTpFormulaOptions() diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index c1eb2ed66583..8d342d0d2c4e 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2534,7 +2534,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) const SfxItemSet *pArgs = rReq.GetArgs(); const SfxPoolItem* pItem = nullptr; if ( pArgs ) - pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem); + pArgs->GetItemState(SID_CHARMAP, false, &pItem); if ( pItem ) { const SfxStringItem* pStringItem = dynamic_cast<const SfxStringItem*>( pItem ); diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 7f0a6d9ef080..559f4a539a83 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -392,7 +392,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) const SfxItemSet *pArgs = rReq.GetArgs(); const SfxPoolItem* pItem = nullptr; if( pArgs ) - pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem); + pArgs->GetItemState(SID_CHARMAP, false, &pItem); if ( pItem ) { diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index da770da9f89c..2d83a0763993 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -154,7 +154,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq ) const SfxItemSet *pArgs = rReq.GetArgs(); const SfxPoolItem* pItem = nullptr; if( pArgs ) - pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_CHARMAP), false, &pItem); + pArgs->GetItemState(SID_CHARMAP, false, &pItem); OUString aChars; vcl::Font aFont; diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index bf0641a47aeb..54ec1575255b 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -687,8 +687,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) ::tools::Rectangle aRect = maMarkRect; aRect.SetPos(aRect.TopLeft() + aPagePos); - const SvxObjectItem& rOI = static_cast<const SvxObjectItem&>( - pArgs->Get(GetPool().GetWhich(SID_RULER_OBJECT))); + const SvxObjectItem& rOI = pArgs->Get(SID_RULER_OBJECT); if ( rOI.GetStartX() != rOI.GetEndX() ) { diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index feeb621b1596..8bcc6c0232fc 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -111,7 +111,6 @@ IMPL_LINK(SfxEventAsyncer_Impl, IdleHdl, Timer*, pAsyncIdle, void) void SfxApplication::GetOptions( SfxItemSet& rSet ) { bool bRet = false; - SfxItemPool &rPool = GetPool(); const WhichRangesContainer& pRanges = rSet.GetRanges(); SvtMiscOptions aMiscOptions; @@ -124,7 +123,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { case SID_ATTR_BUTTON_BIGSIZE : { - if( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_BIGSIZE ), aMiscOptions.AreCurrentSymbolsLarge() ) ) ) + if( rSet.Put( SfxBoolItem( SID_ATTR_BUTTON_BIGSIZE, aMiscOptions.AreCurrentSymbolsLarge() ) ) ) bRet = true; break; } @@ -132,7 +131,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { bRet = true; if (!officecfg::Office::Common::Save::Document::CreateBackup::isReadOnly()) - if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BACKUP ), + if (!rSet.Put( SfxBoolItem( SID_ATTR_BACKUP, officecfg::Office::Common::Save::Document::CreateBackup::get() ))) bRet = false; } @@ -141,7 +140,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { bRet = true; if (!officecfg::Office::Common::Save::Document::PrettyPrinting::isReadOnly()) - if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), + if (!rSet.Put( SfxBoolItem( SID_ATTR_PRETTYPRINTING, officecfg::Office::Common::Save::Document::PrettyPrinting::get()))) bRet = false; } @@ -150,7 +149,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { bRet = true; if (!officecfg::Office::Common::Save::Document::WarnAlienFormat::isReadOnly()) - if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), + if (!rSet.Put( SfxBoolItem( SID_ATTR_WARNALIENFORMAT, officecfg::Office::Common::Save::Document::WarnAlienFormat::get() ))) bRet = false; } @@ -159,7 +158,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { bRet = true; if (!officecfg::Office::Common::Save::Document::AutoSave::isReadOnly()) - if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVE ), + if (!rSet.Put( SfxBoolItem( SID_ATTR_AUTOSAVE, officecfg::Office::Common::Save::Document::AutoSave::get() ))) bRet = false; } @@ -168,7 +167,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { bRet = true; if (!officecfg::Office::Common::Save::Document::AutoSavePrompt::isReadOnly()) - if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVEPROMPT ), + if (!rSet.Put( SfxBoolItem( SID_ATTR_AUTOSAVEPROMPT, officecfg::Office::Common::Save::Document::AutoSavePrompt::get()))) bRet = false; } @@ -177,7 +176,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { bRet = true; if (!officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::isReadOnly()) - if (!rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_AUTOSAVEMINUTE ), + if (!rSet.Put( SfxUInt16Item( SID_ATTR_AUTOSAVEMINUTE, officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::get() ))) bRet = false; } @@ -186,7 +185,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { bRet = true; if (!officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::isReadOnly()) - if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_USERAUTOSAVE ), + if (!rSet.Put( SfxBoolItem( SID_ATTR_USERAUTOSAVE, officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::get() ))) bRet = false; } @@ -195,7 +194,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { bRet = true; if (!officecfg::Office::Common::Save::Document::EditProperty::isReadOnly()) - if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_DOCINFO ), + if (!rSet.Put( SfxBoolItem( SID_ATTR_DOCINFO, officecfg::Office::Common::Save::Document::EditProperty::get()))) bRet = false; } @@ -204,7 +203,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { bRet = true; if (!officecfg::Office::Common::Save::WorkingSet::isReadOnly()) - if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WORKINGSET ), + if (!rSet.Put( SfxBoolItem( SID_ATTR_WORKINGSET, officecfg::Office::Common::Save::WorkingSet::get()))) bRet = false; } @@ -213,31 +212,31 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { bRet = true; if (!officecfg::Office::Common::Save::Document::ViewInfo::isReadOnly()) - if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCVIEW ), officecfg::Office::Common::Save::Document::ViewInfo::get()))) + if (!rSet.Put( SfxBoolItem( SID_ATTR_SAVEDOCVIEW, officecfg::Office::Common::Save::Document::ViewInfo::get()))) bRet = false; } break; case SID_ATTR_METRIC : break; case SID_HELPBALLOONS : - if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPBALLOONS ), + if(rSet.Put( SfxBoolItem ( SID_HELPBALLOONS, officecfg::Office::Common::Help::ExtendedTip::get() ) ) ) bRet = true; break; case SID_HELPTIPS : - if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPTIPS ), + if(rSet.Put( SfxBoolItem ( SID_HELPTIPS, officecfg::Office::Common::Help::Tip::get() ) ) ) bRet = true; break; case SID_HELP_STYLESHEET : - if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_HELP_STYLESHEET ), + if(rSet.Put( SfxStringItem ( SID_HELP_STYLESHEET, officecfg::Office::Common::Help::HelpStyleSheet::get() ) ) ) bRet = true; break; case SID_ATTR_UNDO_COUNT : if (rSet.Put( SfxUInt16Item ( - rPool.GetWhich(SID_ATTR_UNDO_COUNT), + SID_ATTR_UNDO_COUNT, officecfg::Office::Common::Undo::Steps::get()))) { bRet = true; @@ -247,13 +246,13 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { if ( ShutdownIcon::IsQuickstarterInstalled() ) { - if ( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_QUICKLAUNCHER ), + if ( rSet.Put( SfxBoolItem( SID_ATTR_QUICKLAUNCHER, ShutdownIcon::GetAutostart() ) ) ) bRet = true; } else { - rSet.DisableItem( rPool.GetWhich( SID_ATTR_QUICKLAUNCHER ) ); + rSet.DisableItem( SID_ATTR_QUICKLAUNCHER ); bRet = true; } break; @@ -262,7 +261,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { bRet = true; if (!officecfg::Office::Common::Save::URL::Internet::isReadOnly()) - if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_INET ), + if (!rSet.Put( SfxBoolItem ( SID_SAVEREL_INET, officecfg::Office::Common::Save::URL::Internet::get() ))) bRet = false; } @@ -271,7 +270,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { bRet = true; if (!officecfg::Office::Common::Save::URL::FileSystem::isReadOnly()) - if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_FSYS ), + if (!rSet.Put( SfxBoolItem ( SID_SAVEREL_FSYS, officecfg::Office::Common::Save::URL::FileSystem::get() ))) bRet = false; } @@ -283,7 +282,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) { std::vector< OUString > seqURLs = SvtSecurityOptions::GetSecureURLs(); - if( !rSet.Put( SfxStringListItem( rPool.GetWhich(SID_SECURE_URL), &seqURLs ) ) ) + if( !rSet.Put( SfxStringListItem( SID_SECURE_URL, &seqURLs ) ) ) bRet = false; } } @@ -291,7 +290,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) case SID_INET_PROXY_TYPE : if (rSet.Put( SfxUInt16Item( - rPool.GetWhich(SID_INET_PROXY_TYPE), + SID_INET_PROXY_TYPE, (officecfg::Inet::Settings::ooInetProxyType:: get().value_or(0))))) { @@ -301,7 +300,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) case SID_INET_HTTP_PROXY_NAME : if (rSet.Put( SfxStringItem( - rPool.GetWhich(SID_INET_HTTP_PROXY_NAME), + SID_INET_HTTP_PROXY_NAME, officecfg::Inet::Settings::ooInetHTTPProxyName:: get()))) { @@ -311,7 +310,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) case SID_INET_HTTP_PROXY_PORT : if (rSet.Put( SfxInt32Item( - rPool.GetWhich(SID_INET_HTTP_PROXY_PORT), + SID_INET_HTTP_PROXY_PORT, (officecfg::Inet::Settings:: ooInetHTTPProxyPort::get().value_or(0))))) { @@ -321,7 +320,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) case SID_INET_FTP_PROXY_NAME : if (rSet.Put( SfxStringItem( - rPool.GetWhich(SID_INET_FTP_PROXY_NAME), + SID_INET_FTP_PROXY_NAME, officecfg::Inet::Settings::ooInetFTPProxyName:: get()))) { @@ -331,7 +330,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) case SID_INET_FTP_PROXY_PORT : if (rSet.Put( SfxInt32Item( - rPool.GetWhich(SID_INET_FTP_PROXY_PORT), + SID_INET_FTP_PROXY_PORT, (officecfg::Inet::Settings::ooInetFTPProxyPort:: get().value_or(0))))) { @@ -341,7 +340,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) case SID_INET_NOPROXY : if (rSet.Put( SfxStringItem( - rPool.GetWhich( SID_INET_NOPROXY), + SID_INET_NOPROXY, (officecfg::Inet::Settings::ooInetNoProxy:: get())))) { @@ -350,7 +349,7 @@ void SfxApplication::GetOptions( SfxItemSet& rSet ) break; case SID_ATTR_PATHNAME : { - SfxAllEnumItem aValues(rPool.GetWhich(SID_ATTR_PATHNAME)); + SfxAllEnumItem aValues(SID_ATTR_PATHNAME); SvtPathOptions aPathCfg; for ( sal_uInt16 nProp = static_cast<sal_uInt16>(SvtPathOptions::Paths::AddIn); nProp <= static_cast<sal_uInt16>(SvtPathOptions::Paths::Work); nProp++ ) @@ -409,7 +408,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create()); - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_BIGSIZE), true, &pItem) ) + if ( SfxItemState::SET == rSet.GetItemState(SID_ATTR_BUTTON_BIGSIZE, true, &pItem) ) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); bool bBigSize = static_cast<const SfxBoolItem*>(pItem)->GetValue(); @@ -426,7 +425,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // Backup - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BACKUP), true, &pItem) ) + if ( SfxItemState::SET == rSet.GetItemState(SID_ATTR_BACKUP, true, &pItem) ) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); officecfg::Office::Common::Save::Document::CreateBackup::set( @@ -435,7 +434,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // PrettyPrinting - if ( SfxItemState::SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), true, &pItem ) ) + if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PRETTYPRINTING, true, &pItem ) ) { DBG_ASSERT( dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected" ); officecfg::Office::Common::Save::Document::PrettyPrinting::set( @@ -444,7 +443,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // WarnAlienFormat - if ( SfxItemState::SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), true, &pItem ) ) + if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_WARNALIENFORMAT, true, &pItem ) ) { DBG_ASSERT( dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected" ); officecfg::Office::Common::Save::Document::WarnAlienFormat::set( @@ -453,7 +452,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // AutoSave - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVE), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_AUTOSAVE, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); officecfg::Office::Common::Save::Document::AutoSave::set( @@ -462,7 +461,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // AutoSave-Prompt - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEPROMPT), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_AUTOSAVEPROMPT, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); officecfg::Office::Common::Save::Document::AutoSavePrompt::set( @@ -471,7 +470,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // AutoSave-Time - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEMINUTE), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_ATTR_AUTOSAVEMINUTE, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxUInt16Item *>( pItem ) != nullptr, "UInt16Item expected"); officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::set( @@ -480,7 +479,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // UserAutoSave - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_USERAUTOSAVE), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_ATTR_USERAUTOSAVE, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::set( @@ -489,7 +488,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // DocInfo - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_DOCINFO), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_ATTR_DOCINFO, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); officecfg::Office::Common::Save::Document::EditProperty::set( @@ -498,7 +497,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // Mark open Documents - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_ATTR_WORKINGSET, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); officecfg::Office::Common::Save::WorkingSet::set( @@ -507,7 +506,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // Save window settings - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_ATTR_SAVEDOCVIEW, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); officecfg::Office::Common::Save::Document::ViewInfo::set(static_cast<const SfxBoolItem *>(pItem)->GetValue(), batch); @@ -520,7 +519,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // HelpBalloons - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_HELPBALLOONS), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_HELPBALLOONS, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); officecfg::Office::Common::Help::ExtendedTip::set( @@ -529,7 +528,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // HelpTips - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_HELPTIPS), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_HELPTIPS, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); officecfg::Office::Common::Help::Tip::set( @@ -537,7 +536,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) batch); } - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_HELP_STYLESHEET ), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_HELP_STYLESHEET, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxStringItem *>( pItem ) != nullptr, "StringItem expected"); OUString sStyleSheet = static_cast<const SfxStringItem *>(pItem)->GetValue(); @@ -545,7 +544,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // SaveRelINet - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_INET), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_SAVEREL_INET, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); officecfg::Office::Common::Save::URL::Internet::set( @@ -554,7 +553,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // SaveRelFSys - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_FSYS), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_SAVEREL_FSYS, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); officecfg::Office::Common::Save::URL::FileSystem::set( @@ -563,7 +562,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // Undo-Count - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_UNDO_COUNT), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_ATTR_UNDO_COUNT, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxUInt16Item *>( pItem ) != nullptr, "UInt16Item expected"); sal_uInt16 nUndoCount = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); @@ -592,38 +591,38 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) } // Office autostart - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_QUICKLAUNCHER), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_ATTR_QUICKLAUNCHER, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxBoolItem *>( pItem ) != nullptr, "BoolItem expected"); ShutdownIcon::SetAutostart( static_cast<const SfxBoolItem*>( pItem )->GetValue() ); } - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_INET_PROXY_TYPE), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_INET_PROXY_TYPE, true, &pItem)) { DBG_ASSERT( dynamic_cast< const SfxUInt16Item *>( pItem ) != nullptr, "UInt16Item expected" ); officecfg::Inet::Settings::ooInetProxyType::set( static_cast< SfxUInt16Item const * >(pItem)->GetValue(), batch); } - if ( SfxItemState::SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_NAME ), true, &pItem ) ) + if ( SfxItemState::SET == rSet.GetItemState( SID_INET_HTTP_PROXY_NAME, true, &pItem ) ) { DBG_ASSERT( dynamic_cast< const SfxStringItem *>( pItem ) != nullptr, "StringItem expected" ); officecfg::Inet::Settings::ooInetHTTPProxyName::set( static_cast< SfxStringItem const * >(pItem)->GetValue(), batch); } - if ( SfxItemState::SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_PORT ), true, &pItem ) ) + if ( SfxItemState::SET == rSet.GetItemState( SID_INET_HTTP_PROXY_PORT, true, &pItem ) ) { DBG_ASSERT( dynamic_cast< const SfxInt32Item *>( pItem ) != nullptr, "Int32Item expected" ); officecfg::Inet::Settings::ooInetHTTPProxyPort::set( static_cast< SfxInt32Item const * >(pItem)->GetValue(), batch); } - if ( SfxItemState::SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_NAME ), true, &pItem ) ) + if ( SfxItemState::SET == rSet.GetItemState( SID_INET_FTP_PROXY_NAME, true, &pItem ) ) { DBG_ASSERT( dynamic_cast< const SfxStringItem *>( pItem ) != nullptr, "StringItem expected" ); officecfg::Inet::Settings::ooInetFTPProxyName::set( static_cast< SfxStringItem const * >(pItem)->GetValue(), batch); } - if ( SfxItemState::SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_PORT ), true, &pItem ) ) + if ( SfxItemState::SET == rSet.GetItemState( SID_INET_FTP_PROXY_PORT, true, &pItem ) ) { DBG_ASSERT( dynamic_cast< const SfxInt32Item *>( pItem ) != nullptr, "Int32Item expected" ); officecfg::Inet::Settings::ooInetFTPProxyPort::set( @@ -654,12 +653,11 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) // Data is saved in DocInfo and IniManager const SfxPoolItem *pItem = nullptr; - SfxItemPool &rPool = GetPool(); SfxAllItemSet aSendSet( rSet ); // PathName - if ( SfxItemState::SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_PATHNAME), true, &pItem)) + if ( SfxItemState::SET == rSet.GetItemState(SID_ATTR_PATHNAME, true, &pItem)) { DBG_ASSERT(dynamic_cast< const SfxAllEnumItem *>( pItem ) != nullptr, "AllEnumItem expected"); const SfxAllEnumItem* pEnumItem = static_cast<const SfxAllEnumItem *>(pItem); @@ -740,7 +738,7 @@ void SfxApplication::SetOptions(const SfxItemSet &rSet) } } - aSendSet.ClearItem( rPool.GetWhich( SID_ATTR_PATHNAME ) ); + aSendSet.ClearItem( SID_ATTR_PATHNAME ); } SetOptions_Impl( rSet ); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index ee447497fdd5..eeb47762611d 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1623,8 +1623,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) SfxItemSetFixed<SID_AUTO_CORRECT_DLG, SID_AUTO_CORRECT_DLG> aSet(GetPool()); const SfxPoolItem* pItem=nullptr; const SfxItemSet* pSet = rReq.GetArgs(); - SfxItemPool* pSetPool = pSet ? pSet->GetPool() : nullptr; - if ( pSet && pSet->GetItemState( pSetPool->GetWhich( SID_AUTO_CORRECT_DLG ), false, &pItem ) == SfxItemState::SET ) + if ( pSet && pSet->GetItemState( SID_AUTO_CORRECT_DLG, false, &pItem ) == SfxItemState::SET ) aSet.Put( *pItem ); ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateAutoCorrTabDialog(rReq.GetFrameWeld(), &aSet)); diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index f6cd8936ee84..6b0b1812683e 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -470,9 +470,8 @@ void SfxViewShell::SetPrinter_Impl( VclPtr<SfxPrinter>& pNewPrinter ) SfxPrinter *pDocPrinter = GetPrinter(); // Evaluate Printer Options - sal_uInt16 nWhich = GetPool().GetWhich(SID_PRINTER_CHANGESTODOC); const SfxFlagItem *pFlagItem = nullptr; - pDocPrinter->GetOptions().GetItemState( nWhich, false, reinterpret_cast<const SfxPoolItem**>(&pFlagItem) ); + pDocPrinter->GetOptions().GetItemState( SID_PRINTER_CHANGESTODOC, false, reinterpret_cast<const SfxPoolItem**>(&pFlagItem) ); bool bOriToDoc = pFlagItem && (static_cast<SfxPrinterChangeFlags>(pFlagItem->GetValue()) & SfxPrinterChangeFlags::CHG_ORIENTATION); bool bSizeToDoc = pFlagItem && (static_cast<SfxPrinterChangeFlags>(pFlagItem->GetValue()) & SfxPrinterChangeFlags::CHG_SIZE); diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index a235446eb279..156b61b8b2d5 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -1415,23 +1415,21 @@ void SmMathConfig::ItemSetToConfig(const SfxItemSet &rSet) void SmMathConfig::ConfigToItemSet(SfxItemSet &rSet) const { - const SfxItemPool *pPool = rSet.GetPool(); - - rSet.Put(SfxUInt16Item(pPool->GetWhich(SID_PRINTSIZE), + rSet.Put(SfxUInt16Item(SID_PRINTSIZE, sal::static_int_cast<sal_uInt16>(GetPrintSize()))); - rSet.Put(SfxUInt16Item(pPool->GetWhich(SID_PRINTZOOM), + rSet.Put(SfxUInt16Item(SID_PRINTZOOM, GetPrintZoomFactor())); - rSet.Put(SfxUInt16Item(pPool->GetWhich(SID_SMEDITWINDOWZOOM), + rSet.Put(SfxUInt16Item(SID_SMEDITWINDOWZOOM, GetSmEditWindowZoomFactor())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTTITLE), IsPrintTitle())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTTEXT), IsPrintFormulaText())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_PRINTFRAME), IsPrintFrame())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_AUTOREDRAW), IsAutoRedraw())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_NO_RIGHT_SPACES), IsIgnoreSpacesRight())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_SAVE_ONLY_USED_SYMBOLS), IsSaveOnlyUsedSymbols())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_AUTO_CLOSE_BRACKETS), IsAutoCloseBrackets())); - rSet.Put(SfxBoolItem(pPool->GetWhich(SID_DEFAULT_SM_SYNTAX_VERSION), GetDefaultSmSyntaxVersion())); + rSet.Put(SfxBoolItem(SID_PRINTTITLE, IsPrintTitle())); + rSet.Put(SfxBoolItem(SID_PRINTTEXT, IsPrintFormulaText())); + rSet.Put(SfxBoolItem(SID_PRINTFRAME, IsPrintFrame())); + rSet.Put(SfxBoolItem(SID_AUTOREDRAW, IsAutoRedraw())); + rSet.Put(SfxBoolItem(SID_NO_RIGHT_SPACES, IsIgnoreSpacesRight())); + rSet.Put(SfxBoolItem(SID_SAVE_ONLY_USED_SYMBOLS, IsSaveOnlyUsedSymbols())); + rSet.Put(SfxBoolItem(SID_AUTO_CLOSE_BRACKETS, IsAutoCloseBrackets())); + rSet.Put(SfxBoolItem(SID_DEFAULT_SM_SYNTAX_VERSION, GetDefaultSmSyntaxVersion())); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 0857f2456db6..0c720927280a 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -194,15 +194,15 @@ bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet) else nPrintSize = PRINT_SIZE_ZOOMED; - rSet->Put(SfxUInt16Item(GetWhich(SID_PRINTSIZE), nPrintSize)); - rSet->Put(SfxUInt16Item(GetWhich(SID_PRINTZOOM), sal::static_int_cast<sal_uInt16>(m_xZoom->get_value(FieldUnit::PERCENT)))); - rSet->Put(SfxBoolItem(GetWhich(SID_PRINTTITLE), m_xTitle->get_active())); - rSet->Put(SfxBoolItem(GetWhich(SID_PRINTTEXT), m_xText->get_active())); - rSet->Put(SfxBoolItem(GetWhich(SID_PRINTFRAME), m_xFrame->get_active())); - rSet->Put(SfxBoolItem(GetWhich(SID_NO_RIGHT_SPACES), m_xNoRightSpaces->get_active())); - rSet->Put(SfxBoolItem(GetWhich(SID_SAVE_ONLY_USED_SYMBOLS), m_xSaveOnlyUsedSymbols->get_active())); - rSet->Put(SfxBoolItem(GetWhich(SID_AUTO_CLOSE_BRACKETS), m_xAutoCloseBrackets->get_active())); - rSet->Put(SfxUInt16Item(GetWhich(SID_SMEDITWINDOWZOOM), sal::static_int_cast<sal_uInt16>(m_xSmZoom->get_value(FieldUnit::PERCENT)))); + rSet->Put(SfxUInt16Item(SID_PRINTSIZE, nPrintSize)); + rSet->Put(SfxUInt16Item(SID_PRINTZOOM, sal::static_int_cast<sal_uInt16>(m_xZoom->get_value(FieldUnit::PERCENT)))); + rSet->Put(SfxBoolItem(SID_PRINTTITLE, m_xTitle->get_active())); + rSet->Put(SfxBoolItem(SID_PRINTTEXT, m_xText->get_active())); + rSet->Put(SfxBoolItem(SID_PRINTFRAME, m_xFrame->get_active())); + rSet->Put(SfxBoolItem(SID_NO_RIGHT_SPACES, m_xNoRightSpaces->get_active())); + rSet->Put(SfxBoolItem(SID_SAVE_ONLY_USED_SYMBOLS, m_xSaveOnlyUsedSymbols->get_active())); + rSet->Put(SfxBoolItem(SID_AUTO_CLOSE_BRACKETS, m_xAutoCloseBrackets->get_active())); + rSet->Put(SfxUInt16Item(SID_SMEDITWINDOWZOOM, sal::static_int_cast<sal_uInt16>(m_xSmZoom->get_value(FieldUnit::PERCENT)))); SmGetActiveView()->GetEditWindow()->UpdateStatus(false); return true; @@ -210,7 +210,7 @@ bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet) void SmPrintOptionsTabPage::Reset(const SfxItemSet* rSet) { - SmPrintSize ePrintSize = static_cast<SmPrintSize>(static_cast<const SfxUInt16Item &>(rSet->Get(GetWhich(SID_PRINTSIZE))).GetValue()); + SmPrintSize ePrintSize = static_cast<SmPrintSize>(static_cast<const SfxUInt16Item &>(rSet->Get(SID_PRINTSIZE)).GetValue()); m_xSizeNormal->set_active(ePrintSize == PRINT_SIZE_NORMAL); m_xSizeScaled->set_active(ePrintSize == PRINT_SIZE_SCALED); @@ -218,15 +218,15 @@ void SmPrintOptionsTabPage::Reset(const SfxItemSet* rSet) m_xZoom->set_sensitive(m_xSizeZoomed->get_active()); - m_xZoom->set_value(static_cast<const SfxUInt16Item &>(rSet->Get(GetWhich(SID_PRINTZOOM))).GetValue(), FieldUnit::PERCENT); + m_xZoom->set_value(static_cast<const SfxUInt16Item &>(rSet->Get(SID_PRINTZOOM)).GetValue(), FieldUnit::PERCENT); m_xSmZoom->set_sensitive(true); - m_xSmZoom->set_value(static_cast<const SfxUInt16Item &>(rSet->Get(GetWhich(SID_SMEDITWINDOWZOOM))).GetValue(), FieldUnit::PERCENT); + m_xSmZoom->set_value(static_cast<const SfxUInt16Item &>(rSet->Get(SID_SMEDITWINDOWZOOM)).GetValue(), FieldUnit::PERCENT); - m_xTitle->set_active(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_PRINTTITLE))).GetValue()); - m_xNoRightSpaces->set_active(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_NO_RIGHT_SPACES))).GetValue()); - m_xSaveOnlyUsedSymbols->set_active(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_SAVE_ONLY_USED_SYMBOLS))).GetValue()); - m_xAutoCloseBrackets->set_active(static_cast<const SfxBoolItem &>(rSet->Get(GetWhich(SID_AUTO_CLOSE_BRACKETS))).GetValue()); + m_xTitle->set_active(static_cast<const SfxBoolItem &>(rSet->Get(SID_PRINTTITLE)).GetValue()); + m_xNoRightSpaces->set_active(static_cast<const SfxBoolItem &>(rSet->Get(SID_NO_RIGHT_SPACES)).GetValue()); + m_xSaveOnlyUsedSymbols->set_active(static_cast<const SfxBoolItem &>(rSet->Get(SID_SAVE_ONLY_USED_SYMBOLS)).GetValue()); + m_xAutoCloseBrackets->set_active(static_cast<const SfxBoolItem &>(rSet->Get(SID_AUTO_CLOSE_BRACKETS)).GetValue()); } std::unique_ptr<SfxTabPage> SmPrintOptionsTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet) diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 6448efddab68..9b0584af8949 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -302,7 +302,7 @@ void SwPageBreakWin::execute(std::string_view rIdent) { SwPaM aPaM( rNd ); SwPaMItem aPaMItem( pEditWin->GetView().GetPool( ).GetWhich( FN_PARAM_PAM ), &aPaM ); - SfxStringItem aItem( pEditWin->GetView().GetPool( ).GetWhich( SID_PARA_DLG ), "textflow" ); + SfxStringItem aItem( SID_PARA_DLG, "textflow" ); pEditWin->GetView().GetViewFrame()->GetDispatcher()->ExecuteList( SID_PARA_DLG, SfxCallMode::SYNCHRON | SfxCallMode::RECORD, diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index dd5a01adb62f..61b665058381 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -1725,7 +1725,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) const SfxItemSet *pArgs = rReq.GetArgs(); const SfxPoolItem* pItem = nullptr; if( pArgs ) - pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem); + pArgs->GetItemState(SID_CHARMAP, false, &pItem); OUString sSym; OUString sFontName; @@ -1832,7 +1832,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) pOutliner->SetUpdateLayout(true); pOLV->ShowCursor(); - rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), sSym ) ); + rReq.AppendItem( SfxStringItem( SID_CHARMAP, sSym ) ); if(!aFont.GetFamilyName().isEmpty()) rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aFont.GetFamilyName() ) ); rReq.Done(); diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index 3996277fc855..d1f82bdfb572 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -677,7 +677,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) const SfxItemSet *pArgs = rReq.GetArgs(); const SfxPoolItem* pItem = nullptr; if( pArgs ) - pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem); + pArgs->GetItemState(SID_CHARMAP, false, &pItem); OUString sSym; OUString sFontName; @@ -777,7 +777,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) pOutliner->SetUpdateLayout(true); pOLV->ShowCursor(); - rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), sSym ) ); + rReq.AppendItem( SfxStringItem( SID_CHARMAP, sSym ) ); if(!aFont.GetFamilyName().isEmpty()) rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aFont.GetFamilyName() ) ); rReq.Done(); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index eece3fcf4588..627861a7b13f 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -878,7 +878,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) const SfxItemSet *pArgs = rReq.GetArgs(); const SfxPoolItem* pItem = nullptr; if( pArgs ) - pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), false, &pItem); + pArgs->GetItemState(SID_CHARMAP, false, &pItem); OUString aChars, aFontName; if ( pItem ) @@ -1035,7 +1035,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) if ( !aChars.isEmpty() ) { - rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), aChars ) ); + rReq.AppendItem( SfxStringItem( SID_CHARMAP, aChars ) ); rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aNewFont.GetFamilyName() ) ); rReq.Done(); } |