summaryrefslogtreecommitdiff
path: root/dbaccess/qa
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-10-31 22:04:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-11-01 15:14:33 +0100
commit7a896f183dca54aa9d8529f5797920cf629f9210 (patch)
treec4475c2352c5dcab2521709db12199fa7084c2fb /dbaccess/qa
parent9aa8552bf9168836662b45798e06de4b972550ed (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/qa')
-rw-r--r--dbaccess/qa/unit/hsql_binary_import.cxx19
-rw-r--r--dbaccess/qa/unit/tdf119625.cxx20
-rw-r--r--dbaccess/qa/unit/tdf126268.cxx20
3 files changed, 42 insertions, 17 deletions
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);