diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-10-31 22:04:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-01 15:14:33 +0100 |
commit | 7a896f183dca54aa9d8529f5797920cf629f9210 (patch) | |
tree | c4475c2352c5dcab2521709db12199fa7084c2fb /dbaccess | |
parent | 9aa8552bf9168836662b45798e06de4b972550ed (diff) |
use officecfg for Experimental flag
move IsShowOutlineContentVisibilityButton out of header to
avoid having to add extra include paths to all the unit
test makefiles.
Change-Id: I2763390e07cd85b8f09b6f2ad7702039daecb22f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105100
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk | 4 | ||||
-rw-r--r-- | dbaccess/CppunitTest_dbaccess_tdf119625.mk | 4 | ||||
-rw-r--r-- | dbaccess/CppunitTest_dbaccess_tdf126268.mk | 4 | ||||
-rw-r--r-- | dbaccess/Library_dba.mk | 4 | ||||
-rw-r--r-- | dbaccess/qa/unit/hsql_binary_import.cxx | 19 | ||||
-rw-r--r-- | dbaccess/qa/unit/tdf119625.cxx | 20 | ||||
-rw-r--r-- | dbaccess/qa/unit/tdf126268.cxx | 20 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/datasource.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/core/misc/dsntypes.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/generalpage.cxx | 8 |
10 files changed, 65 insertions, 28 deletions
diff --git a/dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk b/dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk index 6f682c040cf2..ee10da23df90 100644 --- a/dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk +++ b/dbaccess/CppunitTest_dbaccess_hsqlbinary_import.mk @@ -61,6 +61,10 @@ $(eval $(call gb_CppunitTest_set_include,dbaccess_hsql_binary_import,\ $$(INCLUDE) \ )) +$(eval $(call gb_CppunitTest_use_custom_headers,dbaccess_hsql_binary_import,\ + officecfg/registry \ +)) + $(eval $(call gb_CppunitTest_use_api,dbaccess_hsql_binary_import,\ offapi \ oovbaapi \ diff --git a/dbaccess/CppunitTest_dbaccess_tdf119625.mk b/dbaccess/CppunitTest_dbaccess_tdf119625.mk index 3420f752dee0..b58aa973df52 100644 --- a/dbaccess/CppunitTest_dbaccess_tdf119625.mk +++ b/dbaccess/CppunitTest_dbaccess_tdf119625.mk @@ -61,6 +61,10 @@ $(eval $(call gb_CppunitTest_set_include,dbaccess_tdf119625,\ $$(INCLUDE) \ )) +$(eval $(call gb_CppunitTest_use_custom_headers,dbaccess_tdf119625,\ + officecfg/registry \ +)) + $(eval $(call gb_CppunitTest_use_api,dbaccess_tdf119625,\ offapi \ oovbaapi \ diff --git a/dbaccess/CppunitTest_dbaccess_tdf126268.mk b/dbaccess/CppunitTest_dbaccess_tdf126268.mk index 5d2120ffd54e..bdcec51f2f46 100644 --- a/dbaccess/CppunitTest_dbaccess_tdf126268.mk +++ b/dbaccess/CppunitTest_dbaccess_tdf126268.mk @@ -61,6 +61,10 @@ $(eval $(call gb_CppunitTest_set_include,dbaccess_tdf126268,\ $$(INCLUDE) \ )) +$(eval $(call gb_CppunitTest_use_custom_headers,dbaccess_tdf126268,\ + officecfg/registry \ +)) + $(eval $(call gb_CppunitTest_use_api,dbaccess_tdf126268,\ offapi \ oovbaapi \ diff --git a/dbaccess/Library_dba.mk b/dbaccess/Library_dba.mk index e8f65a5e1a6b..90f775d146ef 100644 --- a/dbaccess/Library_dba.mk +++ b/dbaccess/Library_dba.mk @@ -20,6 +20,10 @@ $(eval $(call gb_Library_set_include,dba,\ $(eval $(call gb_Library_set_precompiled_header,dba,dbaccess/inc/pch/precompiled_dba)) +$(eval $(call gb_Library_use_custom_headers,dba,\ + officecfg/registry \ +)) + $(eval $(call gb_Library_add_defs,dba,\ -DOOO_DLLIMPLEMENTATION_DBA \ )) diff --git a/dbaccess/qa/unit/hsql_binary_import.cxx b/dbaccess/qa/unit/hsql_binary_import.cxx index 1f5ecb310efc..842e03e74621 100644 --- a/dbaccess/qa/unit/hsql_binary_import.cxx +++ b/dbaccess/qa/unit/hsql_binary_import.cxx @@ -13,7 +13,7 @@ #include <cppunit/plugin/TestPlugIn.h> #include <com/sun/star/sdbc/XRow.hpp> #include <cppunit/extensions/HelperMacros.h> -#include <svtools/miscopt.hxx> +#include <officecfg/Office/Common.hxx> class HsqlBinaryImportTest : public DBTestBase { @@ -37,10 +37,14 @@ void HsqlBinaryImportTest::setUp() void HsqlBinaryImportTest::testBinaryImport() { - SvtMiscOptions aMiscOptions; - bool oldValue = aMiscOptions.IsExperimentalMode(); + bool oldValue = officecfg::Office::Common::Misc::ExperimentalMode::get(); + { + std::shared_ptr<comphelper::ConfigurationChanges> xChanges( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Misc::ExperimentalMode::set(true, xChanges); + xChanges->commit(); + } - aMiscOptions.SetExperimentalMode(true); // the migration requires the file to be writable utl::TempFile const temp(createTempCopy("hsqldb_migration_test.odb")); uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL()); @@ -84,7 +88,12 @@ void HsqlBinaryImportTest::testBinaryImport() closeDocument(uno::Reference<lang::XComponent>(xDocument, uno::UNO_QUERY)); if (!oldValue) - aMiscOptions.SetExperimentalMode(false); + { + std::shared_ptr<comphelper::ConfigurationChanges> xChanges( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Misc::ExperimentalMode::set(false, xChanges); + xChanges->commit(); + } } CPPUNIT_TEST_SUITE_REGISTRATION(HsqlBinaryImportTest); diff --git a/dbaccess/qa/unit/tdf119625.cxx b/dbaccess/qa/unit/tdf119625.cxx index 5d0ec008ff7a..632089f94e9e 100644 --- a/dbaccess/qa/unit/tdf119625.cxx +++ b/dbaccess/qa/unit/tdf119625.cxx @@ -13,8 +13,8 @@ #include <cppunit/plugin/TestPlugIn.h> #include <com/sun/star/sdbc/XRow.hpp> #include <cppunit/extensions/HelperMacros.h> -#include <svtools/miscopt.hxx> #include <com/sun/star/util/Time.hpp> +#include <officecfg/Office/Common.hxx> class Tdf119625Test : public DBTestBase { @@ -57,10 +57,13 @@ const expect_t expect[] = { { 0, 15, 10, 10 }, { 1, 23, 30, 30 }, { 2, 5, 0, 0 } void Tdf119625Test::testTime() { - SvtMiscOptions aMiscOptions; - bool oldValue = aMiscOptions.IsExperimentalMode(); - - aMiscOptions.SetExperimentalMode(true); + bool oldValue = officecfg::Office::Common::Misc::ExperimentalMode::get(); + { + std::shared_ptr<comphelper::ConfigurationChanges> xChanges( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Misc::ExperimentalMode::set(true, xChanges); + xChanges->commit(); + } // the migration requires the file to be writable utl::TempFile const temp(createTempCopy("tdf119625.odb")); @@ -105,7 +108,12 @@ void Tdf119625Test::testTime() closeDocument(uno::Reference<lang::XComponent>(xDocument, uno::UNO_QUERY)); if (!oldValue) - aMiscOptions.SetExperimentalMode(false); + { + std::shared_ptr<comphelper::ConfigurationChanges> xChanges( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Misc::ExperimentalMode::set(false, xChanges); + xChanges->commit(); + } } CPPUNIT_TEST_SUITE_REGISTRATION(Tdf119625Test); diff --git a/dbaccess/qa/unit/tdf126268.cxx b/dbaccess/qa/unit/tdf126268.cxx index 90039af825de..5cba7c1923f7 100644 --- a/dbaccess/qa/unit/tdf126268.cxx +++ b/dbaccess/qa/unit/tdf126268.cxx @@ -13,7 +13,7 @@ #include <cppunit/plugin/TestPlugIn.h> #include <com/sun/star/sdbc/XRow.hpp> #include <cppunit/extensions/HelperMacros.h> -#include <svtools/miscopt.hxx> +#include <officecfg/Office/Common.hxx> class Tdf126268Test : public DBTestBase { @@ -51,10 +51,13 @@ const expect_t expect[] = { void Tdf126268Test::testNumbers() { - SvtMiscOptions aMiscOptions; - bool oldValue = aMiscOptions.IsExperimentalMode(); - - aMiscOptions.SetExperimentalMode(true); + bool oldValue = officecfg::Office::Common::Misc::ExperimentalMode::get(); + { + std::shared_ptr<comphelper::ConfigurationChanges> xChanges( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Misc::ExperimentalMode::set(true, xChanges); + xChanges->commit(); + } // the migration requires the file to be writable utl::TempFile const temp(createTempCopy("tdf126268.odb")); @@ -81,7 +84,12 @@ void Tdf126268Test::testNumbers() closeDocument(uno::Reference<lang::XComponent>(xDocument, uno::UNO_QUERY)); if (!oldValue) - aMiscOptions.SetExperimentalMode(false); + { + std::shared_ptr<comphelper::ConfigurationChanges> xChanges( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Misc::ExperimentalMode::set(false, xChanges); + xChanges->commit(); + } } CPPUNIT_TEST_SUITE_REGISTRATION(Tdf126268Test); diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 7398253f576f..891df4de9dc8 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -54,11 +54,11 @@ #include <connectivity/dbexception.hxx> #include <connectivity/dbtools.hxx> #include <cppuhelper/typeprovider.hxx> +#include <officecfg/Office/Common.hxx> #include <tools/diagnose_ex.h> #include <osl/diagnose.h> #include <osl/process.h> #include <sal/log.hxx> -#include <svtools/miscopt.hxx> #include <tools/urlobj.hxx> #include <unotools/sharedunocomponent.hxx> #include <rtl/digest.h> @@ -617,9 +617,8 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString //ignore when we don't have a model. E.g. Mailmerge, data sources, fields... bIgnoreMigration = true; } - SvtMiscOptions aMiscOptions; - if (!aMiscOptions.IsExperimentalMode()) + if (!officecfg::Office::Common::Misc::ExperimentalMode::get()) bIgnoreMigration = true; if(!bIgnoreMigration && m_pImpl->m_sConnectURL == "sdbc:embedded:hsqldb") diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx index 8256f370cce3..3662148b9462 100644 --- a/dbaccess/source/core/misc/dsntypes.cxx +++ b/dbaccess/source/core/misc/dsntypes.cxx @@ -20,9 +20,9 @@ #include <dsntypes.hxx> #include <unotools/confignode.hxx> #include <osl/diagnose.h> -#include <svtools/miscopt.hxx> #include <tools/wldcrd.hxx> #include <osl/file.hxx> +#include <officecfg/Office/Common.hxx> #include <comphelper/string.hxx> namespace dbaccess @@ -285,8 +285,7 @@ bool ODsnTypeCollection::isEmbeddedDatabase( const OUString& _sURL ) OUString ODsnTypeCollection::getEmbeddedDatabase() { - SvtMiscOptions aMiscOptions; - if (aMiscOptions.IsExperimentalMode()) + if (officecfg::Office::Common::Misc::ExperimentalMode::get()) return "sdbc:embedded:firebird"; else return "sdbc:embedded:hsqldb"; diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 1ad3e8272595..37ac9c5c1ae5 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -30,11 +30,11 @@ #include <svl/stritem.hxx> #include <com/sun/star/ui/dialogs/TemplateDescription.hpp> #include <UITools.hxx> +#include <officecfg/Office/Common.hxx> #include <comphelper/processfactory.hxx> #include <unotools/confignode.hxx> #include <o3tl/safeint.hxx> #include <osl/diagnose.h> -#include <svtools/miscopt.hxx> #include <sal/log.hxx> #include <dbwizsetup.hxx> @@ -142,9 +142,6 @@ namespace dbaui DisplayedTypes aDisplayedTypes; ::dbaccess::ODsnTypeCollection::TypeIterator aEnd = m_pCollection->end(); - - SvtMiscOptions aMiscOptions; - for ( ::dbaccess::ODsnTypeCollection::TypeIterator aTypeLoop = m_pCollection->begin(); aTypeLoop != aEnd; ++aTypeLoop @@ -157,7 +154,8 @@ namespace dbaui if (m_xEmbeddedDBType->find_text(sDisplayName) == -1 && dbaccess::ODsnTypeCollection::isEmbeddedDatabase(sURLPrefix)) { - if( !aMiscOptions.IsExperimentalMode() && sURLPrefix.startsWith("sdbc:embedded:firebird") ) + if( !officecfg::Office::Common::Misc::ExperimentalMode::get() + && sURLPrefix.startsWith("sdbc:embedded:firebird") ) continue; aDisplayedTypes.emplace_back( sURLPrefix, sDisplayName ); m_bIsDisplayedTypesEmpty = false; |