[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sfx2/source sw/qa

Bartosz Kosiorek (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 28 08:40:25 UTC 2020


 sfx2/source/dialog/dinfdlg.cxx                       |    7 +++---
 sw/qa/extras/ooxmlexport/data/custom-properties.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport2.cxx            |   20 +++++++++++--------
 3 files changed, 16 insertions(+), 11 deletions(-)

New commits:
commit 966880403f6b9b58d53b7b6e0da9520cdfdc0baa
Author:     Bartosz Kosiorek <gang65 at poczta.onet.pl>
AuthorDate: Tue Oct 20 18:58:34 2020 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Wed Oct 28 09:39:51 2020 +0100

    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 at redhat.com>
    (cherry picked from commit b73151c8f8fd4e67dc5674ebb6538783bdfb91df)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104842
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 0d1fac1a9622..0d09643680d4 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1408,15 +1408,16 @@ bool CustomPropertiesWindow::IsLineValid( CustomPropertyLine* pLine ) const
     if ( sValue.isEmpty() )
         return true;
 
-    sal_uInt32 nIndex = 0xFFFFFFFF;
+    sal_uInt32 nIndex = NUMBERFORMAT_ENTRY_NOT_FOUND;
     if ( CUSTOM_TYPE_NUMBER == nType )
+        // tdf#116214 Scientific format allows to use also standard numbers
         nIndex = const_cast< SvNumberFormatter& >(
-            m_aNumberFormatter ).GetFormatIndex( NF_NUMBER_SYSTEM );
+            m_aNumberFormatter ).GetFormatIndex( NF_SCIENTIFIC_000E00 );
     else if ( CUSTOM_TYPE_DATE == nType )
         nIndex = const_cast< SvNumberFormatter& >(
             m_aNumberFormatter).GetFormatIndex( NF_DATE_SYS_DDMMYYYY );
 
-    if ( nIndex != 0xFFFFFFFF )
+    if ( nIndex != NUMBERFORMAT_ENTRY_NOT_FOUND )
     {
         sal_uInt32 nTemp = nIndex;
         double fDummy = 0.0;
diff --git a/sw/qa/extras/ooxmlexport/data/custom-properties.docx b/sw/qa/extras/ooxmlexport/data/custom-properties.docx
index 4d104cb26824..01db34977baa 100644
Binary files a/sw/qa/extras/ooxmlexport/data/custom-properties.docx and b/sw/qa/extras/ooxmlexport/data/custom-properties.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
index 5f160fab6007..8149a444e8f0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx
@@ -94,14 +94,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",
@@ -119,22 +119,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");


More information about the Libreoffice-commits mailing list