diff options
author | Eike Rathke <erack@redhat.com> | 2014-11-21 19:26:06 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-11-21 19:43:59 +0100 |
commit | 674c7abbd6b5e9014812d4f8839f62639fe9a7f4 (patch) | |
tree | e6c422a7bd9c8659b51f39f75091adec05d2053d /sc/qa | |
parent | 384595f07528aa4323769c8825ea6efa94ea3c4c (diff) |
check that sort with absolute references works in both modes
Change-Id: I7de490377fbceb17e7d678590c46d24674bd8024
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/filters-test.cxx | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx index 618fd94057c3..15922411416e 100644 --- a/sc/qa/unit/filters-test.cxx +++ b/sc/qa/unit/filters-test.cxx @@ -613,22 +613,35 @@ 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(); sc::AutoCalcSwitch aACSwitch(rDoc, true); // turn auto calc on. rDoc.CalcAll(); + // The relative 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); + // Sort A15:D20 with relative row references. testSortWithSheetExternalReferencesODS_Impl( xDocSh, 14, 19); - // Sort A23:D28 with absolute row references. + // Sort with absolute references has to work in both UpdateReferenceOnSort + // modes. + + // Sort A23:D28 with absolute row references. UpdateReferenceOnSort==true + testSortWithSheetExternalReferencesODS_Impl( xDocSh, 22, 27); + + // Undo sort with absolute references to perform same sort. + rDoc.GetUndoManager()->Undo(); + rDoc.CalcAll(); + + aInputOption.SetSortRefUpdate(false); + SC_MOD()->SetInputOptions(aInputOption); + + // Sort A23:D28 with absolute row references. UpdateReferenceOnSort==false testSortWithSheetExternalReferencesODS_Impl( xDocSh, 22, 27); xDocSh->DoClose(); |