diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-01-31 17:25:42 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-01-31 17:26:57 +0100 |
commit | 6fca59d9c2d3ee3833da6a71d390a2a5b6b73299 (patch) | |
tree | 4a367bb7c33626eb753d1d3b7b6fd0743ee94f50 /sfx2 | |
parent | 03e17a141fbb4e1242de9d9979b5b699e6840454 (diff) |
Simplify code by making getProcessComponentContext() implicit.
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appbas.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/appl/appcfg.cxx | 55 | ||||
-rw-r--r-- | sfx2/source/control/shell.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 2 |
4 files changed, 26 insertions, 45 deletions
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx index 58b95c0687e5..c16338bee821 100644 --- a/sfx2/source/appl/appbas.cxx +++ b/sfx2/source/appl/appbas.cxx @@ -28,7 +28,6 @@ #include <com/sun/star/frame/XDesktop.hpp> #include <com/sun/star/script/XLibraryContainer.hpp> -#include <comphelper/processfactory.hxx> #include <com/sun/star/uno/Reference.h> #include <basic/basrdll.hxx> #include <officecfg/Office/Common.hxx> @@ -183,11 +182,9 @@ void SfxApplication::PropExec_Impl( SfxRequest &rReq ) { SFX_REQUEST_ARG(rReq, pCountItem, SfxUInt16Item, nSID, sal_False); boost::shared_ptr< comphelper::ConfigurationChanges > batch( - comphelper::ConfigurationChanges::create( - comphelper::getProcessComponentContext())); + comphelper::ConfigurationChanges::create()); officecfg::Office::Common::Undo::Steps::set( - comphelper::getProcessComponentContext(), batch, - pCountItem->GetValue()); + pCountItem->GetValue(), batch); batch->commit(); break; } @@ -254,8 +251,7 @@ void SfxApplication::PropState_Impl( SfxItemSet &rSet ) rSet.Put( SfxUInt16Item( SID_ATTR_UNDO_COUNT, - officecfg::Office::Common::Undo::Steps::get( - comphelper::getProcessComponentContext()))); + officecfg::Office::Common::Undo::Steps::get())); break; case SID_UPDATE_VERSION: diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index 006d9770b2a5..4b8d786d4b1a 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -62,7 +62,6 @@ #include <svtools/miscopt.hxx> #include <vcl/toolbox.hxx> #include <unotools/localfilehelper.hxx> -#include <comphelper/processfactory.hxx> #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> @@ -298,8 +297,7 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) if (rSet.Put( SfxUInt16Item ( rPool.GetWhich(SID_ATTR_UNDO_COUNT), - officecfg::Office::Common::Undo::Steps::get( - comphelper::getProcessComponentContext())))) + officecfg::Office::Common::Undo::Steps::get()))) { bRet = true; } @@ -401,9 +399,8 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) if (rSet.Put( SfxUInt16Item( rPool.GetWhich(SID_INET_PROXY_TYPE), - (officecfg::Inet::Settings::ooInetProxyType::get( - comphelper::getProcessComponentContext()). - get_value_or(0))))) + (officecfg::Inet::Settings::ooInetProxyType:: + get().get_value_or(0))))) { bRet = true; } @@ -412,8 +409,8 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) if (rSet.Put( SfxStringItem( rPool.GetWhich(SID_INET_HTTP_PROXY_NAME), - officecfg::Inet::Settings::ooInetHTTPProxyName::get( - comphelper::getProcessComponentContext())))) + officecfg::Inet::Settings::ooInetHTTPProxyName:: + get()))) { bRet = true; } @@ -422,9 +419,8 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) if (rSet.Put( SfxInt32Item( rPool.GetWhich(SID_INET_HTTP_PROXY_PORT), - (officecfg::Inet::Settings::ooInetHTTPProxyPort::get( - comphelper::getProcessComponentContext()). - get_value_or(0))))) + (officecfg::Inet::Settings:: + ooInetHTTPProxyPort::get().get_value_or(0))))) { bRet = true; } @@ -433,8 +429,8 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) if (rSet.Put( SfxStringItem( rPool.GetWhich(SID_INET_FTP_PROXY_NAME), - officecfg::Inet::Settings::ooInetFTPProxyName::get( - comphelper::getProcessComponentContext())))) + officecfg::Inet::Settings::ooInetFTPProxyName:: + get()))) { bRet = true; } @@ -443,9 +439,8 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) if (rSet.Put( SfxInt32Item( rPool.GetWhich(SID_INET_FTP_PROXY_PORT), - (officecfg::Inet::Settings::ooInetFTPProxyPort::get( - comphelper::getProcessComponentContext()). - get_value_or(0))))) + (officecfg::Inet::Settings::ooInetFTPProxyPort:: + get().get_value_or(0))))) { bRet = true; } @@ -460,8 +455,8 @@ sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet ) if (rSet.Put( SfxStringItem( rPool.GetWhich( SID_INET_NOPROXY), - officecfg::Inet::Settings::ooInetNoProxy::get( - comphelper::getProcessComponentContext())))) + (officecfg::Inet::Settings::ooInetNoProxy:: + get())))) { bRet = true; } @@ -543,8 +538,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) SvtPathOptions aPathOptions; SvtMiscOptions aMiscOptions; boost::shared_ptr< comphelper::ConfigurationChanges > batch( - comphelper::ConfigurationChanges::create( - comphelper::getProcessComponentContext())); + comphelper::ConfigurationChanges::create()); if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_OUTSTYLE3D), sal_True, &pItem) ) { DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected"); @@ -709,8 +703,7 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) { DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected"); sal_uInt16 nUndoCount = ((const SfxUInt16Item*)pItem)->GetValue(); - officecfg::Office::Common::Undo::Steps::set( - comphelper::getProcessComponentContext(), batch, nUndoCount); + officecfg::Office::Common::Undo::Steps::set(nUndoCount, batch); // To catch all Undo-Managers: Iterate over all Frames for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(); @@ -759,44 +752,38 @@ void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet ) { DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" ); officecfg::Inet::Settings::ooInetProxyType::set( - comphelper::getProcessComponentContext(), batch, - static_cast< SfxUInt16Item const * >(pItem)->GetValue()); + static_cast< SfxUInt16Item const * >(pItem)->GetValue(), batch); } if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_NAME ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" ); officecfg::Inet::Settings::ooInetHTTPProxyName::set( - comphelper::getProcessComponentContext(), batch, - static_cast< SfxStringItem const * >(pItem)->GetValue()); + static_cast< SfxStringItem const * >(pItem)->GetValue(), batch); } if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_PORT ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" ); officecfg::Inet::Settings::ooInetHTTPProxyPort::set( - comphelper::getProcessComponentContext(), batch, - static_cast< SfxInt32Item const * >(pItem)->GetValue()); + static_cast< SfxInt32Item const * >(pItem)->GetValue(), batch); } if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_NAME ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" ); officecfg::Inet::Settings::ooInetFTPProxyName::set( - comphelper::getProcessComponentContext(), batch, - static_cast< SfxStringItem const * >(pItem)->GetValue()); + static_cast< SfxStringItem const * >(pItem)->GetValue(), batch); } if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_PORT ), sal_True, &pItem ) ) { DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" ); officecfg::Inet::Settings::ooInetFTPProxyPort::set( - comphelper::getProcessComponentContext(), batch, - static_cast< SfxInt32Item const * >(pItem)->GetValue()); + static_cast< SfxInt32Item const * >(pItem)->GetValue(), batch); } if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_NOPROXY, sal_True, &pItem)) { DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected"); officecfg::Inet::Settings::ooInetNoProxy::set( - comphelper::getProcessComponentContext(), batch, - static_cast< SfxStringItem const * >(pItem)->GetValue()); + static_cast< SfxStringItem const * >(pItem)->GetValue(), batch); } // Secure-Referers diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index de879755459e..ecc5fb4cc03e 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -28,7 +28,6 @@ #include <com/sun/star/embed/VerbDescriptor.hpp> #include <com/sun/star/embed/VerbAttributes.hpp> -#include <comphelper/processfactory.hxx> #include <basic/sbstar.hxx> #include <officecfg/Office/Common.hxx> #include <rtl/oustringostreaminserter.hxx> @@ -487,8 +486,7 @@ void SfxShell::SetUndoManager( ::svl::IUndoManager *pNewUndoMgr ) pUndoMgr = pNewUndoMgr; if ( pUndoMgr ) pUndoMgr->SetMaxUndoActionCount( - officecfg::Office::Common::Undo::Steps::get( - comphelper::getProcessComponentContext())); + officecfg::Office::Common::Undo::Steps::get()); } //-------------------------------------------------------------------- diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index b030d4e0d645..c4685aba1e1e 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -205,7 +205,7 @@ sal_Bool IsOOoLockFileUsed() bool IsLockingUsed() { - return officecfg::Office::Common::Misc::UseLocking::get(comphelper::getProcessComponentContext()); + return officecfg::Office::Common::Misc::UseLocking::get(); } } // anonymous namespace |