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 /cui | |
parent | 03e17a141fbb4e1242de9d9979b5b699e6840454 (diff) |
Simplify code by making getProcessComponentContext() implicit.
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/fontsubs.cxx | 24 | ||||
-rw-r--r-- | cui/source/options/optmemory.cxx | 41 |
2 files changed, 25 insertions, 40 deletions
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 961c40a83608..44e7cef4bfcc 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -28,7 +28,6 @@ #include "sal/config.h" -#include <comphelper/processfactory.hxx> #include <officecfg/Office/Common.hxx> #include <tools/shl.hxx> #include <svtools/ctrltool.hxx> @@ -232,24 +231,21 @@ sal_Bool SvxFontSubstTabPage::FillItemSet( SfxItemSet& ) pConfig->Commit(); pConfig->Apply(); boost::shared_ptr< comphelper::ConfigurationChanges > batch( - comphelper::ConfigurationChanges::create( - comphelper::getProcessComponentContext())); + comphelper::ConfigurationChanges::create()); if(aFontHeightLB.GetSavedValue() != aFontHeightLB.GetSelectEntryPos()) officecfg::Office::Common::Font::SourceViewFont::FontHeight::set( - comphelper::getProcessComponentContext(), batch, - static_cast< sal_Int16 >(aFontHeightLB.GetSelectEntry().ToInt32())); + static_cast< sal_Int16 >(aFontHeightLB.GetSelectEntry().ToInt32()), + batch); if(aNonPropFontsOnlyCB.GetSavedValue() != aNonPropFontsOnlyCB.IsChecked()) officecfg::Office::Common::Font::SourceViewFont:: NonProportionalFontsOnly::set( - comphelper::getProcessComponentContext(), batch, - aNonPropFontsOnlyCB.IsChecked()); + aNonPropFontsOnlyCB.IsChecked(), batch); //font name changes cannot be detected by saved values rtl::OUString sFontName; if(aFontNameLB.GetSelectEntryPos()) sFontName = aFontNameLB.GetSelectEntry(); officecfg::Office::Common::Font::SourceViewFont::FontName::set( - comphelper::getProcessComponentContext(), batch, - boost::optional< rtl::OUString >(sFontName)); + boost::optional< rtl::OUString >(sFontName), batch); batch->commit(); return sal_False; @@ -290,12 +286,10 @@ void SvxFontSubstTabPage::Reset( const SfxItemSet& ) //fill font name box first aNonPropFontsOnlyCB.Check( officecfg::Office::Common::Font::SourceViewFont:: - NonProportionalFontsOnly::get( - comphelper::getProcessComponentContext())); + NonProportionalFontsOnly::get()); NonPropFontsHdl(&aNonPropFontsOnlyCB); rtl::OUString sFontName( - officecfg::Office::Common::Font::SourceViewFont::FontName::get( - comphelper::getProcessComponentContext()). + officecfg::Office::Common::Font::SourceViewFont::FontName::get(). get_value_or(rtl::OUString())); if(!sFontName.isEmpty()) aFontNameLB.SelectEntry(sFontName); @@ -303,8 +297,8 @@ void SvxFontSubstTabPage::Reset( const SfxItemSet& ) aFontNameLB.SelectEntryPos(0); aFontHeightLB.SelectEntry( String::CreateFromInt32( - officecfg::Office::Common::Font::SourceViewFont::FontHeight::get( - comphelper::getProcessComponentContext()))); + officecfg::Office::Common::Font::SourceViewFont::FontHeight:: + get())); aNonPropFontsOnlyCB.SaveValue(); aFontHeightLB.SaveValue(); } diff --git a/cui/source/options/optmemory.cxx b/cui/source/options/optmemory.cxx index 69bdf4e68250..ffe2a4dc17ab 100644 --- a/cui/source/options/optmemory.cxx +++ b/cui/source/options/optmemory.cxx @@ -30,7 +30,6 @@ #include <algorithm> -#include <comphelper/processfactory.hxx> #include <officecfg/Office/Common.hxx> #include <svtools/langtab.hxx> #include <svl/zforlist.hxx> @@ -185,28 +184,26 @@ sal_Bool OfaMemoryOptionsPage::FillItemSet( SfxItemSet& rSet ) sal_Bool bModified = sal_False; boost::shared_ptr< comphelper::ConfigurationChanges > batch( - comphelper::ConfigurationChanges::create( - comphelper::getProcessComponentContext())); + comphelper::ConfigurationChanges::create()); // Undo-Schritte if ( aUndoEdit.GetText() != aUndoEdit.GetSavedValue() ) officecfg::Office::Common::Undo::Steps::set( - comphelper::getProcessComponentContext(), batch, - aUndoEdit.GetValue()); + aUndoEdit.GetValue(), batch); // GraphicCache sal_Int32 totalCacheSize = GetNfGraphicCacheVal(); officecfg::Office::Common::Cache::GraphicManager::TotalCacheSize::set( - comphelper::getProcessComponentContext(), batch, totalCacheSize); + totalCacheSize, batch); sal_Int32 objectCacheSize = GetNfGraphicObjectCacheVal(); officecfg::Office::Common::Cache::GraphicManager::ObjectCacheSize::set( - comphelper::getProcessComponentContext(), batch, objectCacheSize); + objectCacheSize, batch); const Time aTime( aTfGraphicObjectTime.GetTime() ); sal_Int32 objectReleaseTime = aTime.GetSec() + aTime.GetMin() * 60 + aTime.GetHour() * 3600; officecfg::Office::Common::Cache::GraphicManager::ObjectReleaseTime::set( - comphelper::getProcessComponentContext(), batch, objectReleaseTime); + objectReleaseTime, batch); // create a dummy graphic object to get access to the common GraphicManager GraphicObject aDummyObject; @@ -218,11 +215,9 @@ sal_Bool OfaMemoryOptionsPage::FillItemSet( SfxItemSet& rSet ) // OLECache officecfg::Office::Common::Cache::Writer::OLE_Objects::set( - comphelper::getProcessComponentContext(), batch, - aNfOLECache.GetValue()); + aNfOLECache.GetValue(), batch); officecfg::Office::Common::Cache::DrawingEngine::OLE_Objects::set( - comphelper::getProcessComponentContext(), batch, - aNfOLECache.GetValue()); + aNfOLECache.GetValue(), batch); batch->commit(); @@ -242,25 +237,22 @@ void OfaMemoryOptionsPage::Reset( const SfxItemSet& rSet ) const SfxPoolItem* pItem; // Undo-Schritte - aUndoEdit.SetValue( - officecfg::Office::Common::Undo::Steps::get( - comphelper::getProcessComponentContext())); + aUndoEdit.SetValue(officecfg::Office::Common::Undo::Steps::get()); aUndoEdit.SaveValue(); // GraphicCache long n = - officecfg::Office::Common::Cache::GraphicManager::TotalCacheSize::get( - comphelper::getProcessComponentContext()); + officecfg::Office::Common::Cache::GraphicManager::TotalCacheSize::get(); SetNfGraphicCacheVal( n ); SetNfGraphicObjectCacheVal( std::min( GetNfGraphicCacheVal(), - officecfg::Office::Common::Cache::GraphicManager::ObjectCacheSize::get( - comphelper::getProcessComponentContext()))); + (officecfg::Office::Common::Cache::GraphicManager::ObjectCacheSize:: + get()))); sal_Int32 nTime = - officecfg::Office::Common::Cache::GraphicManager::ObjectReleaseTime::get( - comphelper::getProcessComponentContext()); + officecfg::Office::Common::Cache::GraphicManager::ObjectReleaseTime:: + get(); Time aTime( (sal_uInt16)( nTime / 3600 ), (sal_uInt16)( ( nTime % 3600 ) / 60 ), (sal_uInt16)( ( nTime % 3600 ) % 60 ) ); aTfGraphicObjectTime.SetTime( aTime ); @@ -269,10 +261,9 @@ void OfaMemoryOptionsPage::Reset( const SfxItemSet& rSet ) // OLECache aNfOLECache.SetValue( std::max( - officecfg::Office::Common::Cache::Writer::OLE_Objects::get( - comphelper::getProcessComponentContext()), - officecfg::Office::Common::Cache::DrawingEngine::OLE_Objects::get( - comphelper::getProcessComponentContext()))); + officecfg::Office::Common::Cache::Writer::OLE_Objects::get(), + (officecfg::Office::Common::Cache::DrawingEngine::OLE_Objects:: + get()))); SfxItemState eState = rSet.GetItemState( SID_ATTR_QUICKLAUNCHER, sal_False, &pItem ); if ( SFX_ITEM_SET == eState ) |