summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-01-03 11:16:40 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-01-04 12:32:19 +0100
commitd5f36648643399ad63006a97a1f58b81690ccddf (patch)
treebecdd4eee00c4b96673bb741f6472da117afa24d /sc
parentff68d7d5f5a29c7bd2016914d43628d11015eb5e (diff)
CppunitTest_sc_subsequent_filters_test2: check format instead of string
Otherwise, this might fail. See 660e538ee77109bc3e7dff4491164d696e503abc < Disable broken part of ScFiltersTest2::testTdf126116 > Change-Id: I40534b70fc19ee163d9e6cb0c081fae40b81fdb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127774 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127776
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/subsequent_filters-test2.cxx12
1 files changed, 7 insertions, 5 deletions
diff --git a/sc/qa/unit/subsequent_filters-test2.cxx b/sc/qa/unit/subsequent_filters-test2.cxx
index 18a571e08537..35ad23deba54 100644
--- a/sc/qa/unit/subsequent_filters-test2.cxx
+++ b/sc/qa/unit/subsequent_filters-test2.cxx
@@ -1365,13 +1365,15 @@ void ScFiltersTest2::testTdf126116()
rDoc.SetString(ScAddress(0, 0, 0), "03/03");
- // Get the current year from B1 with format YY
- OUString aYear = rDoc.GetString(ScAddress(1, 0, 0));
+ sal_uInt32 nNumberFormat;
+ rDoc.GetNumberFormat(0, 0, 0, nNumberFormat);
+ const SvNumberformat* pNumberFormat = rDoc.GetFormatTable()->GetEntry(nNumberFormat);
+ const OUString& rFormatStr = pNumberFormat->GetFormatstring();
// Without the fix in place, this test would have failed with
- // - Expected: 03/03/21
- // - Actual : 03/03/2021
- CPPUNIT_ASSERT_EQUAL(OUString("03/03/" + aYear), rDoc.GetString(ScAddress(0, 0, 0)));
+ // - Expected: MM/DD/YY
+ // - Actual : MM/DD/YYYY
+ CPPUNIT_ASSERT_EQUAL(OUString("MM/DD/YY"), rFormatStr);
xDocSh->DoClose();
}