summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2014-11-21 19:26:06 +0100
committerEike Rathke <erack@redhat.com>2014-11-21 19:47:35 +0100
commit7feda69016fc42b889dfc5b8de088bbca36ba931 (patch)
treefc0af14ecb74340ac74b7bcd4cf6e499472244af /sc/qa
parent008bf8c595e37b7267ec37e4423cd60304160475 (diff)
check that sort with absolute references works in both modes
Change-Id: I7de490377fbceb17e7d678590c46d24674bd8024 (cherry picked from commit 674c7abbd6b5e9014812d4f8839f62639fe9a7f4)
Diffstat (limited to 'sc/qa')
-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();