diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-10-12 18:18:57 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-10-12 20:22:43 +0200 |
commit | 2a1ea77eebed14c86b170c0845f0eb5330fd6a0c (patch) | |
tree | 40c168cde949a5d85a94bb9c2d9b1c20400eac41 /sc | |
parent | b26793b907ce823e5cce38f6fe93b420ebe38579 (diff) |
sc: qa: avoid OUStringChar for better readability
Change-Id: Idf730e05d2ebec9003a2a4700b43b8658d858b03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141265
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/subsequent_export_test2.cxx | 9 | ||||
-rw-r--r-- | sc/qa/unit/subsequent_filters_test2.cxx | 3 | ||||
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 4 |
3 files changed, 5 insertions, 11 deletions
diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 17e5da80eabb..71466d7ee720 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -909,20 +909,15 @@ void ScExportTest2::testEscapeCharInNumberFormatXLSX() = XPathHelper::parseExport2(*this, *xDocSh, m_xSFactory, "xl/styles.xml", FORMAT_XLSX); CPPUNIT_ASSERT(pDoc); - const sal_Unicode cEuro(8364); // € symbol assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[2]", "formatCode", "00\\ 00\\ 00\\ 00\\ 00"); assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[3]", "formatCode", "00\\.00\\.00\\.000\\.0"); // tdf#81939 // "_-* #,##0\ _€_-;\-* #,##0\ _€_-;_-* "- "_€_-;_-@_-" // tdf#81222 - OUString rFormatStrExpected("_-* #,##0\\ _" + OUStringChar(cEuro) + "_-;\\-* #,##0\\ _" - + OUStringChar(cEuro) + "_-;_-* \"- \"_" + OUStringChar(cEuro) - + "_-;_-@_-"); + OUString rFormatStrExpected(u"_-* #,##0\\ _€_-;\\-* #,##0\\ _€_-;_-* \"- \"_€_-;_-@_-"); assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[4]", "formatCode", rFormatStrExpected); // "_-* #,##0" €"_-;\-* #,##0" €"_-;_-* "- €"_-;_-@_-"); - rFormatStrExpected = "_-* #,##0\" " + OUStringChar(cEuro) + "\"_-;\\-* #,##0\" " - + OUStringChar(cEuro) + "\"_-;_-* \"- " + OUStringChar(cEuro) - + "\"_-;_-@_-"; + rFormatStrExpected = u"_-* #,##0\" €\"_-;\\-* #,##0\" €\"_-;_-* \"- €\"_-;_-@_-"; assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[5]", "formatCode", rFormatStrExpected); // remove escape char in fraction assertXPath(pDoc, "/x:styleSheet/x:numFmts/x:numFmt[6]", "formatCode", diff --git a/sc/qa/unit/subsequent_filters_test2.cxx b/sc/qa/unit/subsequent_filters_test2.cxx index 8c77721cc790..2a7bdb65f843 100644 --- a/sc/qa/unit/subsequent_filters_test2.cxx +++ b/sc/qa/unit/subsequent_filters_test2.cxx @@ -2323,8 +2323,7 @@ void ScFiltersTest2::testTdf70455() // Without the fix in place, this test would have failed with // - Expected: €780.00 // - Actual : Err:509 - CPPUNIT_ASSERT_EQUAL(OUString(OUStringChar(u'\x20AC') + "780.00"), - rDoc.GetString(ScAddress(7, 7, 0))); + CPPUNIT_ASSERT_EQUAL(OUString(u"€780.00"), rDoc.GetString(ScAddress(7, 7, 0))); xDocSh->DoClose(); } diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index d821a146eef8..18a7be1af068 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -693,14 +693,14 @@ void Test::testTdf114406() void Test::testTdf93951() { CPPUNIT_ASSERT(m_pDoc->InsertTab (0, "Test")); - m_pDoc->SetString(ScAddress(0,0,0), "=2*" + OUStringChar(u'\x00A7') + "*2"); + m_pDoc->SetString(ScAddress(0,0,0), u"=2*§*2"); OUString aFormula = m_pDoc->GetFormula(0,0,0); // Without the fix in place, this test would have failed with // - Expected: =2*§*2 // - Actual : =2* - CPPUNIT_ASSERT_EQUAL(OUString("=2*" + OUStringChar(u'\x00A7') + "*2"), aFormula); + CPPUNIT_ASSERT_EQUAL(OUString(u"=2*§*2"), aFormula); m_pDoc->DeleteTab(0); } |