summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2013-08-10 16:22:00 +0200
committerJulien Nabet <serval2412@yahoo.fr>2013-08-10 16:22:00 +0200
commit203951880a4a61b7569eb5878efc8aa5d7ff8652 (patch)
treea586ee8470b1dd979a7ef0abf721eec3633d7dc5 /unotools
parent651a252374d67716afedebb2a5eae76243da8e3b (diff)
fdo#46037: 1 less occurrence comphelper/configurationhelper in unotools
Change-Id: If188eecd0f5ea3802ec795866d21c41e643cbd63
Diffstat (limited to 'unotools')
-rw-r--r--unotools/Library_utl.mk4
-rw-r--r--unotools/source/config/saveopt.cxx59
2 files changed, 14 insertions, 49 deletions
diff --git a/unotools/Library_utl.mk b/unotools/Library_utl.mk
index e36481167b76..2f14d75f3073 100644
--- a/unotools/Library_utl.mk
+++ b/unotools/Library_utl.mk
@@ -13,6 +13,10 @@ $(eval $(call gb_Library_Library,utl))
$(eval $(call gb_Library_use_external,utl,boost_headers))
+$(eval $(call gb_Library_use_custom_headers,utl,\
+ officecfg/registry \
+))
+
# in case UNO services are exported: declare location of component file
$(eval $(call gb_Library_set_componentfile,utl,unotools/util/utl))
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 6ff12529f7a3..a58439b018e8 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -26,9 +26,9 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <osl/mutex.hxx>
-#include <comphelper/configurationhelper.hxx>
#include <comphelper/processfactory.hxx>
#include "itemholder1.hxx"
+#include <officecfg/Office/Recovery.hxx>
using namespace utl;
using namespace com::sun::star::uno;
@@ -564,30 +564,9 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
}
}
- try
- {
- css::uno::Reference< css::uno::XInterface > xCFG = ::comphelper::ConfigurationHelper::openConfig(
- ::comphelper::getProcessComponentContext(),
- OUString("org.openoffice.Office.Recovery"),
- ::comphelper::ConfigurationHelper::E_READONLY);
-
- ::comphelper::ConfigurationHelper::readRelativeKey(
- xCFG,
- OUString("AutoSave"),
- OUString("Enabled")) >>= bAutoSave;
-
- ::comphelper::ConfigurationHelper::readRelativeKey(
- xCFG,
- OUString("AutoSave"),
- OUString("TimeIntervall")) >>= nAutoSaveTime;
-
- ::comphelper::ConfigurationHelper::readRelativeKey(
- xCFG,
- OUString("AutoSave"),
- OUString("UserAutoSaveEnabled")) >>= bUserAutoSave;
- }
- catch(const css::uno::Exception&)
- { OSL_FAIL("Could not find needed information for AutoSave feature."); }
+ bAutoSave = officecfg::Office::Recovery::AutoSave::Enabled::get();
+ nAutoSaveTime = officecfg::Office::Recovery::AutoSave::TimeIntervall::get();
+ bUserAutoSave = officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::get();
}
SvtSaveOptions_Impl::~SvtSaveOptions_Impl()
@@ -758,30 +737,12 @@ void SvtSaveOptions_Impl::Commit()
aValues.realloc(nRealCount);
PutProperties( aNames, aValues );
- css::uno::Reference< css::uno::XInterface > xCFG = ::comphelper::ConfigurationHelper::openConfig(
- ::comphelper::getProcessComponentContext(),
- OUString("org.openoffice.Office.Recovery"),
- ::comphelper::ConfigurationHelper::E_STANDARD);
-
- ::comphelper::ConfigurationHelper::writeRelativeKey(
- xCFG,
- OUString("AutoSave"),
- OUString("TimeIntervall"),
- css::uno::makeAny(nAutoSaveTime));
-
- ::comphelper::ConfigurationHelper::writeRelativeKey(
- xCFG,
- OUString("AutoSave"),
- OUString("Enabled"),
- css::uno::makeAny(bAutoSave));
-
- ::comphelper::ConfigurationHelper::writeRelativeKey(
- xCFG,
- OUString("AutoSave"),
- OUString("UserAutoSaveEnabled"),
- css::uno::makeAny(bUserAutoSave));
-
- ::comphelper::ConfigurationHelper::flush(xCFG);
+ boost::shared_ptr< comphelper::ConfigurationChanges > batch(
+ comphelper::ConfigurationChanges::create());
+ officecfg::Office::Recovery::AutoSave::TimeIntervall::set(nAutoSaveTime, batch);
+ officecfg::Office::Recovery::AutoSave::Enabled::set(bAutoSave, batch);
+ officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::set(bUserAutoSave, batch);
+ batch->commit();
}
// -----------------------------------------------------------------------