diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-23 15:09:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-24 16:52:52 +0200 |
commit | 095e3ac51eaae12da641018e889d79e3ae029038 (patch) | |
tree | 727e80e718c80b970f45f7b077badf58a595680b /sw | |
parent | 4e511cc7dfbf14b6176ce352db8125c16eefeebf (diff) |
use officecfg to retrieve SaveRelFSys
Change-Id: If4e943153080e1c8fea02e712038dd6dee92c5a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119454
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/CppunitTest_sw_ooxmllinks.mk | 4 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmllinks.cxx | 29 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 3 |
4 files changed, 15 insertions, 24 deletions
diff --git a/sw/CppunitTest_sw_ooxmllinks.mk b/sw/CppunitTest_sw_ooxmllinks.mk index 7018cc4f5bd7..79c1cfd1a000 100644 --- a/sw/CppunitTest_sw_ooxmllinks.mk +++ b/sw/CppunitTest_sw_ooxmllinks.mk @@ -44,6 +44,10 @@ $(eval $(call gb_CppunitTest_use_vcl,sw_ooxmllinks)) $(eval $(call gb_CppunitTest_use_rdb,sw_ooxmllinks,services)) +$(eval $(call gb_CppunitTest_use_custom_headers,sw_ooxmllinks,\ + officecfg/registry \ +)) + $(eval $(call gb_CppunitTest_use_configuration,sw_ooxmllinks)) # vim: set noet sw=4 ts=4: diff --git a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx index d5f0e8784516..743c5a3ad31c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx @@ -11,6 +11,7 @@ #include <unotools/tempfile.hxx> #include <tools/urlobj.hxx> #include <unotools/saveopt.hxx> +#include <officecfg/Office/Common.hxx> // This file contains tests to check relative/absolute hyperlinks handling @@ -59,17 +60,9 @@ CPPUNIT_TEST_SUITE_END(); \ void Import_Export_Import() \ { \ - SvtSaveOptions aOpt; \ - if (bAbsolute) \ - { \ - aOpt.SetSaveRelFSys(false); \ - CPPUNIT_ASSERT(!aOpt.IsSaveRelFSys()); \ - } \ - else \ - { \ - aOpt.SetSaveRelFSys(true); \ - CPPUNIT_ASSERT(aOpt.IsSaveRelFSys()); \ - } \ + auto xChanges = comphelper::ConfigurationChanges::create(); \ + officecfg::Office::Common::Save::URL::FileSystem::set(!bAbsolute, xChanges); \ + xChanges->commit(); \ executeLoadReloadVerify(FileName); \ } \ void verify() override; \ @@ -90,17 +83,9 @@ CPPUNIT_TEST_SUITE_END(); \ void Import() \ { \ - SvtSaveOptions aOpt; \ - if (bAbsolute) \ - { \ - aOpt.SetSaveRelFSys(false); \ - CPPUNIT_ASSERT(!aOpt.IsSaveRelFSys()); \ - } \ - else \ - { \ - aOpt.SetSaveRelFSys(true); \ - CPPUNIT_ASSERT(aOpt.IsSaveRelFSys()); \ - } \ + auto xChanges = comphelper::ConfigurationChanges::create(); \ + officecfg::Office::Common::Save::URL::FileSystem::set(!bAbsolute, xChanges); \ + xChanges->commit(); \ executeImportTest(FileName); \ } \ void verify() override; \ diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 29058a3cd691..7c77c9d6c7ac 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -22,6 +22,7 @@ #include <hintids.hxx> +#include <officecfg/Office/Common.hxx> #include <o3tl/any.hxx> #include <com/sun/star/drawing/XShape.hpp> #include <vcl/svapp.hxx> @@ -107,7 +108,7 @@ bool SwBasicEscherEx::IsRelUrl() const bool bRelUrl = false; SfxMedium * pMedium = rWrt.GetWriter().GetMedia(); if ( pMedium ) - bRelUrl = pMedium->IsRemote() ? aSaveOpt.IsSaveRelINet() : aSaveOpt.IsSaveRelFSys(); + bRelUrl = pMedium->IsRemote() ? aSaveOpt.IsSaveRelINet() : officecfg::Office::Common::Save::URL::FileSystem::get(); return bRelUrl; } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index f28221e3912c..d2735ca3c8e3 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -24,6 +24,7 @@ #include "docxexport.hxx" +#include <officecfg/Office/Common.hxx> #include <i18nlangtag/mslangid.hxx> #include <hintids.hxx> #include <tools/urlobj.hxx> @@ -1007,7 +1008,7 @@ bool AttributeOutputBase::AnalyzeURL( const OUString& rUrl, const OUString& /*rT if ( aProtocol == INetProtocol::File || aProtocol == INetProtocol::NotValid ) { // INetProtocol::NotValid - may be a relative link - bool bExportRelative = m_aSaveOpt.IsSaveRelFSys(); + bool bExportRelative = officecfg::Office::Common::Save::URL::FileSystem::get(); sURL = ConvertURL( rUrl, !bExportRelative ); } } |