diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-27 14:56:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-27 20:05:46 +0100 |
commit | 12be8dadfad2167ff4317935d30782626afa3eaf (patch) | |
tree | eb04c03fa883c953e7464fa9f67577611d21ddef /sfx2 | |
parent | 0e570fafd319c6567d798ff9e5530099c53312ee (diff) |
no need to call GetWhich on these SID_ values
none of them are remapped (via the SfxItemEntryInfo stuff in the pool)
Change-Id: Ic7b5f2c3cc75a65bdf9c45f9522cc53954b4ba38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129040
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appcfg.cxx | 106 | ||||
-rw-r--r-- | sfx2/source/appl/appserv.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 3 |
3 files changed, 54 insertions, 58 deletions
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); |