summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-24 14:23:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-25 16:50:03 +0200
commit2b71e0683cf8a34aaddce3558b941ba62b1b4ec5 (patch)
tree5dc7f1bc4b78228e9dceacf1d746196f42ab7158 /unotools
parent5d83e940f7636050891f52929ace29650025cd36 (diff)
use officecfg to retrieve LoadUserSettings
Change-Id: I9680c02207ff2d21785a20061b784066ead07a8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119473 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/saveopt.cxx59
1 files changed, 0 insertions, 59 deletions
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 615cc033acd3..aa7e875e1d97 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -48,7 +48,6 @@ class SvtLoadOptions_Impl;
struct SvtLoadSaveOptions_Impl
{
std::unique_ptr<SvtSaveOptions_Impl> pSaveOpt;
- std::unique_ptr<SvtLoadOptions_Impl> pLoadOpt;
};
static std::unique_ptr<SvtLoadSaveOptions_Impl> pOptions;
@@ -233,51 +232,6 @@ void SvtSaveOptions_Impl::Notify( const Sequence<OUString>& )
{
}
-namespace {
-
-class SvtLoadOptions_Impl : public utl::ConfigItem
-{
-private:
- bool bLoadUserDefinedSettings;
-
- virtual void ImplCommit() override;
-
-public:
- SvtLoadOptions_Impl();
-
- virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override;
-
- void SetLoadUserSettings(bool b){bLoadUserDefinedSettings = b; SetModified();}
- bool IsLoadUserSettings() const {return bLoadUserDefinedSettings;}
-};
-
-}
-
-constexpr OUStringLiteral cUserDefinedSettings = u"UserDefinedSettings";
-
-SvtLoadOptions_Impl::SvtLoadOptions_Impl()
- : ConfigItem( "Office.Common/Load" )
- , bLoadUserDefinedSettings( false )
-{
- Sequence< OUString > aNames { cUserDefinedSettings };
- Sequence< Any > aValues = GetProperties( aNames );
- EnableNotification( aNames );
- const Any* pValues = aValues.getConstArray();
- DBG_ASSERT( aValues.getLength() == aNames.getLength(), "GetProperties failed" );
- pValues[0] >>= bLoadUserDefinedSettings;
-}
-
-void SvtLoadOptions_Impl::ImplCommit()
-{
- PutProperties(
- {cUserDefinedSettings}, {css::uno::Any(bLoadUserDefinedSettings)});
-}
-
-void SvtLoadOptions_Impl::Notify( const Sequence<OUString>& )
-{
- SAL_WARN( "unotools.config", "properties have been changed" );
-}
-
namespace
{
class LocalSingleton : public rtl::Static< osl::Mutex, LocalSingleton >
@@ -293,7 +247,6 @@ SvtSaveOptions::SvtSaveOptions()
{
pOptions.reset(new SvtLoadSaveOptions_Impl);
pOptions->pSaveOpt.reset(new SvtSaveOptions_Impl);
- pOptions->pLoadOpt.reset( new SvtLoadOptions_Impl);
}
++nRefCount;
pImp = pOptions.get();
@@ -307,23 +260,11 @@ SvtSaveOptions::~SvtSaveOptions()
{
if ( pOptions->pSaveOpt->IsModified() )
pOptions->pSaveOpt->Commit();
- if ( pOptions->pLoadOpt->IsModified() )
- pOptions->pLoadOpt->Commit();
pOptions.reset();
}
}
-void SvtSaveOptions::SetLoadUserSettings(bool b)
-{
- pImp->pLoadOpt->SetLoadUserSettings(b);
-}
-
-bool SvtSaveOptions::IsLoadUserSettings() const
-{
- return pImp->pLoadOpt->IsLoadUserSettings();
-}
-
void SvtSaveOptions::SetODFDefaultVersion( SvtSaveOptions::ODFDefaultVersion eVersion )
{
pImp->pSaveOpt->SetODFDefaultVersion( eVersion );