[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sc/qa
Eike Rathke
erack at redhat.com
Fri Nov 21 10:48:04 PST 2014
sc/qa/unit/filters-test.cxx | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
New commits:
commit 7feda69016fc42b889dfc5b8de088bbca36ba931
Author: Eike Rathke <erack at redhat.com>
Date: Fri Nov 21 19:26:06 2014 +0100
check that sort with absolute references works in both modes
Change-Id: I7de490377fbceb17e7d678590c46d24674bd8024
(cherry picked from commit 674c7abbd6b5e9014812d4f8839f62639fe9a7f4)
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 618fd94..1592241 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();
More information about the Libreoffice-commits
mailing list