diff options
-rw-r--r-- | extensions/Library_WinUserInfoBe.mk | 4 | ||||
-rw-r--r-- | extensions/source/config/WinUserInfo/WinUserInfoBe.cxx | 29 |
2 files changed, 12 insertions, 21 deletions
diff --git a/extensions/Library_WinUserInfoBe.mk b/extensions/Library_WinUserInfoBe.mk index 3d5932f3b279..3e20e09419af 100644 --- a/extensions/Library_WinUserInfoBe.mk +++ b/extensions/Library_WinUserInfoBe.mk @@ -13,6 +13,10 @@ $(eval $(call gb_Library_Library,WinUserInfoBe)) $(eval $(call gb_Library_set_componentfile,WinUserInfoBe,extensions/source/config/WinUserInfo/WinUserInfoBe,services)) +$(eval $(call gb_Library_use_custom_headers,WinUserInfoBe,\ + officecfg/registry \ +)) + $(eval $(call gb_Library_use_sdk_api,WinUserInfoBe)) $(eval $(call gb_Library_add_exception_objects,WinUserInfoBe,\ diff --git a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx index ce4d147220c2..e62068f17b04 100644 --- a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx +++ b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx @@ -11,14 +11,12 @@ #include <com/sun/star/beans/Optional.hpp> #include <comphelper/base64.hxx> -#include <comphelper/configurationhelper.hxx> -#include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/container/XNameReplace.hpp> -#include <com/sun/star/util/XChangesBatch.hpp> +#include <comphelper/configuration.hxx> #include <cppuhelper/supportsservice.hxx> #include <map> #include <o3tl/char16_t2wchar_t.hxx> #include <tools/diagnose_ex.h> +#include <officecfg/UserProfile.hxx> #include <Iads.h> #include <Adshlp.h> @@ -213,16 +211,10 @@ private: OUStringBuffer sOutBuf; comphelper::Base64::encode(sOutBuf, seqCachedData); - auto xIface = comphelper::ConfigurationHelper::openConfig( - xContext, "org.openoffice.UserProfile/WinUserInfo", - comphelper::EConfigurationModes::Standard); - css::uno::Reference<css::container::XNameReplace> xNameReplace( - xIface, css::uno::UNO_QUERY_THROW); - xNameReplace->replaceByName("Cache", css::uno::makeAny(sOutBuf.makeStringAndClear())); - - css::uno::Reference<css::util::XChangesBatch> xChangesBatch(xIface, - css::uno::UNO_QUERY_THROW); - xChangesBatch->commitChanges(); + std::shared_ptr<comphelper::ConfigurationChanges> batch( + comphelper::ConfigurationChanges::create(xContext)); + officecfg::UserProfile::WinUserInfo::Cache::set(sOutBuf.makeStringAndClear(), batch); + batch->commit(); } catch (const css::uno::Exception&) { @@ -236,13 +228,8 @@ private: if (m_sUserDN.isEmpty()) throw css::uno::RuntimeException(); - auto xIface = comphelper::ConfigurationHelper::openConfig( - xContext, "org.openoffice.UserProfile/WinUserInfo", - comphelper::EConfigurationModes::ReadOnly); - css::uno::Reference<css::container::XNameAccess> xNameAccess(xIface, - css::uno::UNO_QUERY_THROW); - OUString sCache; - xNameAccess->getByName("Cache") >>= sCache; + OUString sCache = officecfg::UserProfile::WinUserInfo::Cache::get(xContext); + if (sCache.isEmpty()) throw css::uno::RuntimeException(); |