diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-11-10 12:17:35 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-11-10 12:19:06 +0100 |
commit | 447d523fa7c6c82476f9ee48e4b9c82cfad05c50 (patch) | |
tree | 348fb90e76bd1f07a3b5c58311612853b4cbff6b /sc/qa | |
parent | 602 regression test (diff) | |
download | core-447d523fa7c6c82476f9ee48e4b9c82cfad05c50.tar.gz core-447d523fa7c6c82476f9ee48e4b9c82cfad05c50.zip |
fdo#85584: Adapt the unit test to the new default.
Change-Id: I7c4935040ba16378023695c74bf2a5cd75fe8a77
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/filters-test.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 208020714d10..f8a911f422b2 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -23,6 +23,7 @@ #include "helper/qahelper.hxx" #include "docsh.hxx" +#include "inputopt.hxx" #include "postit.hxx" #include "patattr.hxx" #include "scitems.hxx" @@ -103,6 +104,7 @@ public: private: uno::Reference<uno::XInterface> m_xCalcComponent; + bool mbUpdateReferenceOnSort; ///< Remember the configuration option so that we can set it back. }; bool ScFiltersTest::load(const OUString &rFilter, const OUString &rURL, @@ -611,6 +613,12 @@ void ScFiltersTest::testSortWithSharedFormulasODS() // Document contains cached external references. void ScFiltersTest::testSortWithSheetExternalReferencesODS() { + // this test only works with UpdateReferenceOnSort == true, set it now. + // we reset the value back to the original in tearDown() + ScInputOptions aInputOption = SC_MOD()->GetInputOptions(); + aInputOption.SetSortRefUpdate(true); + SC_MOD()->SetInputOptions(aInputOption); + ScDocShellRef xDocSh = loadDoc("sort-with-sheet-external-references.", ODS, true); CPPUNIT_ASSERT(xDocSh.Is()); ScDocument& rDoc = xDocSh->GetDocument(); @@ -698,12 +706,25 @@ void ScFiltersTest::setUp() m_xCalcComponent = getMultiServiceFactory()->createInstance("com.sun.star.comp.Calc.SpreadsheetDocument"); CPPUNIT_ASSERT_MESSAGE("no calc component!", m_xCalcComponent.is()); + + // one test sets this configuration option; make sure we remember the + // original value + ScInputOptions aInputOption = SC_MOD()->GetInputOptions(); + mbUpdateReferenceOnSort = aInputOption.GetSortRefUpdate(); } void ScFiltersTest::tearDown() { uno::Reference< lang::XComponent >( m_xCalcComponent, UNO_QUERY_THROW )->dispose(); test::BootstrapFixture::tearDown(); + + // one test sets this configuration option; make sure we return it back + ScInputOptions aInputOption = SC_MOD()->GetInputOptions(); + if (mbUpdateReferenceOnSort != aInputOption.GetSortRefUpdate()) + { + aInputOption.SetSortRefUpdate(mbUpdateReferenceOnSort); + SC_MOD()->SetInputOptions(aInputOption); + } } CPPUNIT_TEST_SUITE_REGISTRATION(ScFiltersTest); |