summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/filters-test.cxx27
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();