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 | |
parent | f86df6e0849cdac74b3254e8d4d847cbd7b75236 (diff) |
fdo#85584: Adapt the unit test to the new default.
Change-Id: I7c4935040ba16378023695c74bf2a5cd75fe8a77
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/inputopt.hxx | 3 | ||||
-rw-r--r-- | sc/inc/scmod.hxx | 4 | ||||
-rw-r--r-- | sc/qa/unit/filters-test.cxx | 21 |
3 files changed, 25 insertions, 3 deletions
diff --git a/sc/inc/inputopt.hxx b/sc/inc/inputopt.hxx index 37bfbc46095d..b6d2a0940913 100644 --- a/sc/inc/inputopt.hxx +++ b/sc/inc/inputopt.hxx @@ -20,9 +20,10 @@ #ifndef INCLUDED_SC_INC_INPUTOPT_HXX #define INCLUDED_SC_INC_INPUTOPT_HXX +#include <scdllapi.h> #include <unotools/configitem.hxx> -class ScInputOptions +class SC_DLLPUBLIC ScInputOptions { private: sal_uInt16 nMoveDir; // enum ScDirection diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx index 136f08fbd573..59b1ab010468 100644 --- a/sc/inc/scmod.hxx +++ b/sc/inc/scmod.hxx @@ -174,14 +174,14 @@ SC_DLLPUBLIC const ScDocOptions& GetDocOptions (); SC_DLLPUBLIC const ScAppOptions& GetAppOptions (); SC_DLLPUBLIC const ScDefaultsOptions& GetDefaultsOptions (); SC_DLLPUBLIC const ScFormulaOptions& GetFormulaOptions (); - const ScInputOptions& GetInputOptions (); + SC_DLLPUBLIC const ScInputOptions& GetInputOptions (); SC_DLLPUBLIC const ScPrintOptions& GetPrintOptions (); void SetViewOptions ( const ScViewOptions& rOpt ); SC_DLLPUBLIC void SetDocOptions ( const ScDocOptions& rOpt ); SC_DLLPUBLIC void SetAppOptions ( const ScAppOptions& rOpt ); void SetDefaultsOptions ( const ScDefaultsOptions& rOpt ); SC_DLLPUBLIC void SetFormulaOptions ( const ScFormulaOptions& rOpt ); - void SetInputOptions ( const ScInputOptions& rOpt ); + SC_DLLPUBLIC void SetInputOptions ( const ScInputOptions& rOpt ); void SetPrintOptions ( const ScPrintOptions& rOpt ); void InsertEntryToLRUList(sal_uInt16 nFIndex); void RecentFunctionsChanged(); 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); |