Skip to content

Commit

Permalink
sc: Use FormulaGrammarSwitch
Browse files Browse the repository at this point in the history
Change-Id: Ia4d21886a5a8536f20fed87bfea9676ac8603d86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145481
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <[email protected]>
  • Loading branch information
Xisco Fauli committed Jan 17, 2023
1 parent 5355f52 commit 18f1e7a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sc/qa/unit/subsequent_export_test.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3053,7 +3053,7 @@ void ScExportTest::testSharedFormulaExportXLS()
bool checkContent(ScDocument& rDoc)
{
formula::FormulaGrammar::Grammar eGram = formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1;
rDoc.SetGrammar(eGram);
FormulaGrammarSwitch aFGSwitch(&rDoc, eGram);
sc::TokenStringContext aCxt(rDoc, eGram);

// Check the title row.
Expand Down
4 changes: 2 additions & 2 deletions sc/qa/unit/subsequent_export_test2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ void ScExportTest2::testRefStringUnspecified()
aConfig.meStringRefAddressSyntax);

// change formula syntax (i.e. not string ref syntax) to ExcelA1
pDoc->SetGrammar(formula::FormulaGrammar::GRAM_NATIVE_XL_A1);
FormulaGrammarSwitch aFGSwitch(pDoc, formula::FormulaGrammar::GRAM_NATIVE_XL_A1);

saveAndReload("calc8");

Expand Down Expand Up @@ -502,7 +502,7 @@ void ScExportTest2::testTdf121260()

ScDocument* pDoc = getScDoc();
// change formula syntax (i.e. not string ref syntax) to ExcelA1
pDoc->SetGrammar(formula::FormulaGrammar::GRAM_NATIVE_XL_A1);
FormulaGrammarSwitch aFGSwitch(pDoc, formula::FormulaGrammar::GRAM_NATIVE_XL_A1);

save("Calc Office Open XML");
xmlDocUniquePtr pChart1 = parseExport("xl/charts/chart1.xml");
Expand Down
4 changes: 1 addition & 3 deletions sc/qa/unit/ucalc_formula.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9085,7 +9085,7 @@ void TestFormula::testIntersectionOpExcel()
// Data in C2.
m_pDoc->SetValue(2,1,0, 1.0);

m_pDoc->SetGrammar(FormulaGrammar::GRAM_ENGLISH_XL_A1);
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_A1);

// Choose formula positions that don't intersect with those data ranges.
ScAddress aPos(0,3,0);
Expand All @@ -9101,8 +9101,6 @@ void TestFormula::testIntersectionOpExcel()
m_pDoc->SetString(aPos,"=2*(horz vert)");
CPPUNIT_ASSERT_EQUAL_MESSAGE("A7 calculating with intersecting named expressions failed", 2.0, m_pDoc->GetValue(aPos));

m_pDoc->SetGrammar(FormulaGrammar::GRAM_ENGLISH);

m_pDoc->DeleteTab(0);
}

Expand Down

0 comments on commit 18f1e7a

Please sign in to comment.