summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2020-10-20 18:58:34 +0200
committerEike Rathke <erack@redhat.com>2020-10-27 16:04:35 +0100
commitb73151c8f8fd4e67dc5674ebb6538783bdfb91df (patch)
tree9b741dd12c4c34ba0968f52ba98cf6577691bafb /sw/qa
parent713fcfae066badfaa29f347a52738e9d4f1c841b (diff)
tdf#116214 Allow for scientific notation in Custom Properties
To keep compatibility with OOXML format, it should be allowed to use Scientific Format in Custom Properties. The solution is backward compatible with standard numbers (it is still possible to write integer numbers and fractions). With that fix it is also possible to store very small and very big numbers in scientific notation. Change-Id: Ic788a6e3f4f748b905828f3d6c8c40dc7e46ba52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104569 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/custom-properties.docxbin13191 -> 10968 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport2.cxx20
2 files changed, 12 insertions, 8 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/custom-properties.docx b/sw/qa/extras/ooxmlexport/data/custom-properties.docx
index 4d104cb26824..01db34977baa 100644
--- a/sw/qa/extras/ooxmlexport/data/custom-properties.docx
+++ b/sw/qa/extras/ooxmlexport/data/custom-properties.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index 6906989d645b..2f1e60fd8c9c 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -101,14 +101,14 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCustomProperties, "custom-properties.doc
assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Characters", "22");
assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:CharactersWithSpaces", "24");
assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Company", "hhhhkompany");
- assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Manager", "ffffmenadzer");
+ assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:Manager", "ffffmenadzer;iiiiisecondmanager");
assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:HyperlinkBase", "gggghiperlink");
//assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:DocSecurity", "2");
assertXPathContent(pXmlDoc, "/extended-properties:Properties/extended-properties:AppVersion", "15.0000");
// Custom file properties - defined by user
xmlDocUniquePtr pCustomXml = parseExport("docProps/custom.xml");
- assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property", 8);
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property", 9);
assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[1]",
"name", "testDateProperty");
assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[1]/vt:filetime",
@@ -126,22 +126,26 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testCustomProperties, "custom-properties.doc
assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[5]/vt:r8",
"-128.1");
assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[6]",
+ "name", "testScientificNumber");
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[6]/vt:r8",
+ "1.23456789E+023");
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[7]",
"name", "testTextProperty");
- assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[6]/vt:lpwstr",
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[7]/vt:lpwstr",
"testPropertyValue");
- assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[7]",
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[8]",
"name", "testYesNoProperty");
- assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[7]/vt:bool",
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[8]/vt:bool",
"1");
// Hidden Custom File Property. With Final set, MS Office notifies recipients that the document is final, and sets the document to read-only.
- assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[8]",
+ assertXPath(pCustomXml, "/custom-properties:Properties/custom-properties:property[9]",
"name", "_MarkAsFinal");
- assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[8]/vt:bool",
+ assertXPathContent(pCustomXml, "/custom-properties:Properties/custom-properties:property[9]/vt:bool",
"1");
// Core file properties - common for all packages (eg. creation date, modify date)
pXmlDoc = parseExport("docProps/core.xml");
- assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:creator", "Bartosz Kosiorek");
+ assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:creator", "Bartosz Kosiorek;secondauthor");
assertXPathContent(pXmlDoc, "/cp:coreProperties/dc:description", "cccckomentarzglowny");
assertXPathContent(pXmlDoc, "/cp:coreProperties/cp:lastPrinted", "2020-10-15T07:42:00Z");
assertXPathContent(pXmlDoc, "/cp:coreProperties/dcterms:created", "2020-10-14T16:23:00Z");