summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-12-23 15:43:27 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2021-12-28 19:10:57 +0100
commitc6feb49dc3a763c7ab4a3db7d1380bb82844705a (patch)
treeba9c33d5f11e799e7c433a2dd9ab3ed98970cc36
parent7dfd06cf9e0f34956b7f81e9052934184cde779f (diff)
CppunitTest_sc_subsequent_filters_test2: fix test depending on current year
While at it, move the file from ods to fods for better tracking in git Change-Id: I16df221e3a7341dc7c53de6130158c3887c472a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127361 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/+/127371 Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-by: René Engelhard <rene@debian.org> Tested-by: René Engelhard <rene@debian.org>
-rw-r--r--sc/qa/unit/data/fods/tdf126116.fods170
-rw-r--r--sc/qa/unit/data/ods/tdf126116.odsbin7813 -> 0 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test2.cxx7
3 files changed, 175 insertions, 2 deletions
diff --git a/sc/qa/unit/data/fods/tdf126116.fods b/sc/qa/unit/data/fods/tdf126116.fods
new file mode 100644
index 000000000000..2db351642f73
--- /dev/null
+++ b/sc/qa/unit/data/fods/tdf126116.fods
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:xforms="http://www.w3.org/2002/xforms" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.spreadsheet">
+ <office:styles>
+ <style:default-style style:family="table-cell">
+ <style:paragraph-properties style:tab-stop-distance="0.5in"/>
+ <style:text-properties style:font-name="Liberation Sans" fo:font-size="10pt" fo:language="en" fo:country="US" style:font-name-asian="Noto Sans CJK SC Regular" style:font-size-asian="10pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="10pt" style:language-complex="hi" style:country-complex="IN"/>
+ </style:default-style>
+ <number:number-style style:name="N0">
+ <number:number number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:date-style style:name="N121">
+ <number:year/>
+ </number:date-style>
+ <style:style style:name="Default" style:family="table-cell"/>
+ <style:style style:name="Heading" style:family="table-cell" style:parent-style-name="Default">
+ <style:text-properties fo:color="#000000" fo:font-size="24pt" fo:font-style="normal" fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="table-cell" style:parent-style-name="Heading">
+ <style:text-properties fo:color="#000000" fo:font-size="18pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Heading_20_2" style:display-name="Heading 2" style:family="table-cell" style:parent-style-name="Heading">
+ <style:text-properties fo:color="#000000" fo:font-size="12pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Text" style:family="table-cell" style:parent-style-name="Default"/>
+ <style:style style:name="Note" style:family="table-cell" style:parent-style-name="Text">
+ <style:table-cell-properties fo:background-color="#ffffcc" style:diagonal-bl-tr="none" style:diagonal-tl-br="none" fo:border="0.74pt solid #808080"/>
+ <style:text-properties fo:color="#333333" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Footnote" style:family="table-cell" style:parent-style-name="Text">
+ <style:text-properties fo:color="#808080" fo:font-size="10pt" fo:font-style="italic" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Hyperlink" style:family="table-cell" style:parent-style-name="Text">
+ <style:text-properties fo:color="#0000ee" fo:font-size="10pt" fo:font-style="normal" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="#0000ee" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Status" style:family="table-cell" style:parent-style-name="Default"/>
+ <style:style style:name="Good" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:background-color="#ccffcc"/>
+ <style:text-properties fo:color="#006600" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Neutral" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:background-color="#ffffcc"/>
+ <style:text-properties fo:color="#996600" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Bad" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:background-color="#ffcccc"/>
+ <style:text-properties fo:color="#cc0000" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Warning" style:family="table-cell" style:parent-style-name="Status">
+ <style:text-properties fo:color="#cc0000" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Error" style:family="table-cell" style:parent-style-name="Status">
+ <style:table-cell-properties fo:background-color="#cc0000"/>
+ <style:text-properties fo:color="#ffffff" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="Accent" style:family="table-cell" style:parent-style-name="Default">
+ <style:text-properties fo:color="#000000" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="Accent_20_1" style:display-name="Accent 1" style:family="table-cell" style:parent-style-name="Accent">
+ <style:table-cell-properties fo:background-color="#000000"/>
+ <style:text-properties fo:color="#ffffff" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Accent_20_2" style:display-name="Accent 2" style:family="table-cell" style:parent-style-name="Accent">
+ <style:table-cell-properties fo:background-color="#808080"/>
+ <style:text-properties fo:color="#ffffff" fo:font-size="10pt" fo:font-style="normal" fo:font-weight="normal"/>
+ </style:style>
+ <style:style style:name="Accent_20_3" style:display-name="Accent 3" style:family="table-cell" style:parent-style-name="Accent">
+ <style:table-cell-properties fo:background-color="#dddddd"/>
+ </style:style>
+ <style:style style:name="Result" style:family="table-cell" style:parent-style-name="Default">
+ <style:text-properties fo:color="#000000" fo:font-size="10pt" fo:font-style="italic" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="#000000" fo:font-weight="bold"/>
+ </style:style>
+ </office:styles>
+ <office:automatic-styles>
+ <style:style style:name="co1" style:family="table-column">
+ <style:table-column-properties fo:break-before="auto" style:column-width="0.889in"/>
+ </style:style>
+ <style:style style:name="ro1" style:family="table-row">
+ <style:table-row-properties style:row-height="0.178in" fo:break-before="auto" style:use-optimal-row-height="true"/>
+ </style:style>
+ <style:style style:name="ta1" style:family="table" style:master-page-name="Default">
+ <style:table-properties table:display="true" style:writing-mode="lr-tb"/>
+ </style:style>
+ <number:number-style style:name="N2">
+ <number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1"/>
+ </number:number-style>
+ <number:date-style style:name="N37" number:automatic-order="true">
+ <number:month number:style="long"/>
+ <number:text>/</number:text>
+ <number:day number:style="long"/>
+ <number:text>/</number:text>
+ <number:year/>
+ </number:date-style>
+ <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>
+ <style:style style:name="ce3" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N121"/>
+ <style:style style:name="ce5" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>
+ <style:style style:name="ce6" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N121"/>
+ <style:page-layout style:name="pm1">
+ <style:page-layout-properties style:writing-mode="lr-tb"/>
+ <style:header-style>
+ <style:header-footer-properties fo:min-height="0.2953in" fo:margin-left="0in" fo:margin-right="0in" fo:margin-bottom="0.0984in"/>
+ </style:header-style>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="0.2953in" fo:margin-left="0in" fo:margin-right="0in" fo:margin-top="0.0984in"/>
+ </style:footer-style>
+ </style:page-layout>
+ <style:page-layout style:name="pm2">
+ <style:page-layout-properties style:writing-mode="lr-tb"/>
+ <style:header-style>
+ <style:header-footer-properties fo:min-height="0.2953in" fo:margin-left="0in" fo:margin-right="0in" fo:margin-bottom="0.0984in" fo:border="2.49pt solid #000000" fo:padding="0.0071in" fo:background-color="#c0c0c0">
+ <style:background-image/>
+ </style:header-footer-properties>
+ </style:header-style>
+ <style:footer-style>
+ <style:header-footer-properties fo:min-height="0.2953in" fo:margin-left="0in" fo:margin-right="0in" fo:margin-top="0.0984in" fo:border="2.49pt solid #000000" fo:padding="0.0071in" fo:background-color="#c0c0c0">
+ <style:background-image/>
+ </style:header-footer-properties>
+ </style:footer-style>
+ </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Default" style:page-layout-name="pm1">
+ <style:header>
+ <text:p><text:sheet-name>???</text:sheet-name></text:p>
+ </style:header>
+ <style:header-left style:display="false"/>
+ <style:header-first style:display="false"/>
+ <style:footer>
+ <text:p>Page <text:page-number>1</text:page-number></text:p>
+ </style:footer>
+ <style:footer-left style:display="false"/>
+ <style:footer-first style:display="false"/>
+ </style:master-page>
+ <style:master-page style:name="Report" style:page-layout-name="pm2">
+ <style:header>
+ <style:region-left>
+ <text:p><text:sheet-name>???</text:sheet-name><text:s/>(<text:title>???</text:title>)</text:p>
+ </style:region-left>
+ <style:region-right>
+ <text:p><text:date style:data-style-name="N2" text:date-value="2021-12-23">00/00/0000</text:date>, <text:time style:data-style-name="N2" text:time-value="15:58:01.703768631">00:00:00</text:time></text:p>
+ </style:region-right>
+ </style:header>
+ <style:header-left style:display="false"/>
+ <style:header-first style:display="false"/>
+ <style:footer>
+ <text:p>Page <text:page-number>1</text:page-number><text:s/>/ <text:page-count>99</text:page-count></text:p>
+ </style:footer>
+ <style:footer-left style:display="false"/>
+ <style:footer-first style:display="false"/>
+ </style:master-page>
+ </office:master-styles>
+ <office:body>
+ <office:spreadsheet>
+ <table:calculation-settings table:automatic-find-labels="false" table:use-regular-expressions="false" table:use-wildcards="true"/>
+ <table:table table:name="Sheet1" table:style-name="ta1">
+ <table:table-column table:style-name="co1" table:default-cell-style-name="ce5"/>
+ <table:table-column table:style-name="co1" table:default-cell-style-name="ce6"/>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell office:value-type="date" office:date-value="2021-02-02" calcext:value-type="date">
+ <text:p>02/02/21</text:p>
+ </table:table-cell>
+ <table:table-cell table:formula="of:=TODAY()" office:value-type="date" office:date-value="2021-12-23" calcext:value-type="date">
+ <text:p>21</text:p>
+ </table:table-cell>
+ </table:table-row>
+ </table:table>
+ <table:named-expressions/>
+ </office:spreadsheet>
+ </office:body>
+</office:document>
diff --git a/sc/qa/unit/data/ods/tdf126116.ods b/sc/qa/unit/data/ods/tdf126116.ods
deleted file mode 100644
index c9fb2816e21c..000000000000
--- a/sc/qa/unit/data/ods/tdf126116.ods
+++ /dev/null
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test2.cxx b/sc/qa/unit/subsequent_filters-test2.cxx
index 9c15eebfff0a..18a571e08537 100644
--- a/sc/qa/unit/subsequent_filters-test2.cxx
+++ b/sc/qa/unit/subsequent_filters-test2.cxx
@@ -1357,7 +1357,7 @@ void ScFiltersTest2::testTdf103734()
void ScFiltersTest2::testTdf126116()
{
- ScDocShellRef xDocSh = loadDoc(u"tdf126116.", FORMAT_ODS);
+ ScDocShellRef xDocSh = loadDoc(u"tdf126116.", FORMAT_FODS);
CPPUNIT_ASSERT_MESSAGE("Failed to open doc", xDocSh.is());
ScDocument& rDoc = xDocSh->GetDocument();
@@ -1365,10 +1365,13 @@ 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));
+
// 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/21"), rDoc.GetString(ScAddress(0, 0, 0)));
+ CPPUNIT_ASSERT_EQUAL(OUString("03/03/" + aYear), rDoc.GetString(ScAddress(0, 0, 0)));
xDocSh->DoClose();
}