summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc_sort.cxx
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-05-12 16:56:18 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-05-12 20:28:37 +0200
commit145b2d8ee131dca592a41f7b26341a542a23845b (patch)
treeba0441f53948405ede7f5df21438ee7c881aee44 /sc/qa/unit/ucalc_sort.cxx
parentf7a86c5cdf4323c99d26512bf78de7f7c380667d (diff)
sc_ucalc: restore formula options after using them
Otherwise, it might affect other unittests Change-Id: I0750979742e6193f627a1eaf9b1e35f97976278b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115490 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc/qa/unit/ucalc_sort.cxx')
-rw-r--r--sc/qa/unit/ucalc_sort.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/sc/qa/unit/ucalc_sort.cxx b/sc/qa/unit/ucalc_sort.cxx
index 8ff3cf58e60d..58b6e5016674 100644
--- a/sc/qa/unit/ucalc_sort.cxx
+++ b/sc/qa/unit/ucalc_sort.cxx
@@ -129,11 +129,12 @@ void Test::testSortHorizontal()
{
SortRefUpdateSetter aUpdateSet;
- ScFormulaOptions aOptions;
- aOptions.SetFormulaSepArg(";");
- aOptions.SetFormulaSepArrayCol(";");
- aOptions.SetFormulaSepArrayRow("|");
- getDocShell().SetFormulaOptions(aOptions);
+ ScFormulaOptions aOldOptions, aNewOptions;
+ aOldOptions = SC_MOD()->GetFormulaOptions();
+ aNewOptions.SetFormulaSepArg(";");
+ aNewOptions.SetFormulaSepArrayCol(";");
+ aNewOptions.SetFormulaSepArrayRow("|");
+ getDocShell().SetFormulaOptions(aNewOptions);
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true);
m_pDoc->InsertTab(0, "Sort");
@@ -195,6 +196,9 @@ void Test::testSortHorizontal()
ASSERT_FORMULA_EQUAL(*m_pDoc, ScAddress(1,2,0), "CONCATENATE(C3;\"-\";D3)", "Wrong formula!");
ASSERT_FORMULA_EQUAL(*m_pDoc, ScAddress(1,3,0), "CONCATENATE(C4;\"-\";D4)", "Wrong formula!");
+ // restore formula options back to default
+ getDocShell().SetFormulaOptions(aOldOptions);
+
m_pDoc->DeleteTab(0);
}