diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-01-25 18:18:18 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-01-25 18:18:52 +0100 |
commit | a2195b2dc301a6c2cfd0bf1a7ff74483bcc5998a (patch) | |
tree | ed7d466e0c75fcc7bf9ca0a0dfa9b8b23ef0a89a /cui | |
parent | Add configuration wrappers for groups, too (to add listeners etc.). (diff) | |
download | core-a2195b2dc301a6c2cfd0bf1a7ff74483bcc5998a.tar.gz core-a2195b2dc301a6c2cfd0bf1a7ff74483bcc5998a.zip |
Replace SourceViewConfig with (simplified) direct configuration access.
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/fontsubs.cxx | 42 | ||||
-rw-r--r-- | cui/source/options/fontsubs.hxx | 7 |
2 files changed, 30 insertions, 19 deletions
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index 8e8035461e84..8971cf2bb416 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -26,12 +26,15 @@ * ************************************************************************/ +#include "sal/config.h" + +#include <comphelper/processfactory.hxx> +#include <officecfg/Office/Common.hxx> #include <tools/shl.hxx> #include <svtools/ctrltool.hxx> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> #include <svtools/fontsubstconfig.hxx> -#include <unotools/sourceviewconfig.hxx> #include "fontsubs.hrc" #include "fontsubs.hxx" #include <dialmgr.hxx> @@ -71,7 +74,6 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( Window* pParent, sAutomatic (CUI_RES( STR_AUTOMATIC )), pConfig(new SvtFontSubstConfig), - pSourceViewConfig(new utl::SourceViewConfig), sHeader1 (CUI_RES( STR_HEADER1 )), sHeader2 (CUI_RES( STR_HEADER2 )), @@ -192,7 +194,6 @@ SvLBoxEntry* SvxFontSubstTabPage::CreateEntry(String& rFont1, String& rFont2) { delete pCheckButtonData; delete pConfig; - delete pSourceViewConfig; } /*********************************************************************/ @@ -230,15 +231,25 @@ sal_Bool SvxFontSubstTabPage::FillItemSet( SfxItemSet& ) if(pConfig->IsModified()) pConfig->Commit(); pConfig->Apply(); + boost::shared_ptr< unotools::ConfigurationChanges > batch( + unotools::ConfigurationChanges::create( + comphelper::getProcessComponentContext())); if(aFontHeightLB.GetSavedValue() != aFontHeightLB.GetSelectEntryPos()) - pSourceViewConfig->SetFontHeight((sal_Int16)aFontHeightLB.GetSelectEntry().ToInt32()); + officecfg::Office::Common::Font::SourceViewFont::FontHeight::set( + comphelper::getProcessComponentContext(), batch, + static_cast< sal_Int16 >(aFontHeightLB.GetSelectEntry().ToInt32())); if(aNonPropFontsOnlyCB.GetSavedValue() != aNonPropFontsOnlyCB.IsChecked()) - pSourceViewConfig->SetShowProportionalFontsOnly(aNonPropFontsOnlyCB.IsChecked()); + officecfg::Office::Common::Font::SourceViewFont:: + NonProportionalFontsOnly::set( + comphelper::getProcessComponentContext(), batch, + aNonPropFontsOnlyCB.IsChecked()); //font name changes cannot be detected by saved values - String sFontName; + rtl::OUString sFontName; if(aFontNameLB.GetSelectEntryPos()) sFontName = aFontNameLB.GetSelectEntry(); - pSourceViewConfig->SetFontName(sFontName); + officecfg::Office::Common::Font::SourceViewFont::FontName::set( + comphelper::getProcessComponentContext(), batch, sFontName); + batch->commit(); return sal_False; } @@ -276,15 +287,22 @@ void SvxFontSubstTabPage::Reset( const SfxItemSet& ) aCheckLB.SetUpdateMode(sal_True); //fill font name box first - aNonPropFontsOnlyCB.Check(pSourceViewConfig->IsShowProportionalFontsOnly()); + aNonPropFontsOnlyCB.Check( + officecfg::Office::Common::Font::SourceViewFont:: + NonProportionalFontsOnly::get( + comphelper::getProcessComponentContext())); NonPropFontsHdl(&aNonPropFontsOnlyCB); - String sFontName(pSourceViewConfig->GetFontName()); - if(sFontName.Len()) + rtl::OUString sFontName( + officecfg::Office::Common::Font::SourceViewFont::FontName::get( + comphelper::getProcessComponentContext())); + if(!sFontName.isEmpty()) aFontNameLB.SelectEntry(sFontName); else aFontNameLB.SelectEntryPos(0); - short nFontHeight = pSourceViewConfig->GetFontHeight(); - aFontHeightLB.SelectEntry(String::CreateFromInt32(nFontHeight)); + aFontHeightLB.SelectEntry( + String::CreateFromInt32( + officecfg::Office::Common::Font::SourceViewFont::FontHeight::get( + comphelper::getProcessComponentContext()))); aNonPropFontsOnlyCB.SaveValue(); aFontHeightLB.SaveValue(); } diff --git a/cui/source/options/fontsubs.hxx b/cui/source/options/fontsubs.hxx index ecd324ea4f63..ad714bdab86a 100644 --- a/cui/source/options/fontsubs.hxx +++ b/cui/source/options/fontsubs.hxx @@ -34,11 +34,6 @@ #include <vcl/toolbox.hxx> #include <svtools/ctrlbox.hxx> -namespace utl -{ - class SourceViewConfig; -} - // class SvxFontSubstCheckListBox ------------------------------------------ class SvxFontSubstCheckListBox : public SvxSimpleTable @@ -71,7 +66,6 @@ class SvxFontSubstCheckListBox : public SvxSimpleTable // class SvxFontSubstTabPage ---------------------------------------------------- class SvtFontSubstConfig; -namespace svt {class SourceViewConfig;} class SvxFontSubstTabPage : public SfxTabPage { CheckBox aUseTableCB; @@ -94,7 +88,6 @@ class SvxFontSubstTabPage : public SfxTabPage String sAutomatic; SvtFontSubstConfig* pConfig; - utl::SourceViewConfig* pSourceViewConfig; String sHeader1; String sHeader2; |