CppunitTest_sc_subsequent_filters_test2: check format instead of string

Otherwise, this might fail. See 660e538ee7
< Disable broken part of ScFiltersTest2::testTdf126116 >

Change-Id: I40534b70fc19ee163d9e6cb0c081fae40b81fdb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127887
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli
2022-01-03 14:31:53 +01:00
parent 2951cbdf3a
commit f6fefed87a
+7 -6
View File
@@ -21,6 +21,7 @@
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
#include <svl/stritem.hxx>
#include <svl/numformat.hxx>
#include <svl/zformat.hxx>
#include <svx/svdograf.hxx>
#include <svx/svxids.hrc>
@@ -1366,14 +1367,14 @@ 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);
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
(void)
aYear; //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();
}