sc/source/filter/xml/xmlcelli.cxx |   30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

New commits:
commit 432e75c8997dafca72ab816ac5decee7bfed21c7
Author:     Pranam Lashkari <lpra...@collabora.com>
AuthorDate: Wed Feb 26 21:55:40 2025 +0530
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Feb 27 09:57:09 2025 +0100

    sc comment kit: use iso format dates
    
    Change-Id: I84d83005287869cea44f27c1d5a337bd67975bab
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182243
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index 252235c7abd1..d8aa06d710d7 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -917,18 +917,26 @@ void ScXMLTableRowCellContext::SetAnnotation(const 
ScAddress& rPos)
         double fDate;
         if (rXMLImport.GetMM100UnitConverter().convertDateTime(fDate, 
mxAnnotationData->maCreateDate))
         {
-            SvNumberFormatter* pNumForm = pDoc->GetFormatTable();
-
-            // Date string is in format ISO 8601 inside <dc:date>
-            // i.e: 2024-08-14 or 2024-08-14T23:55:06 or 20240814T235506
-            // Time always has prefix 'T'
-            sal_uInt32 nfIndex = pNumForm->GetFormatIndex(
-                mxAnnotationData->maCreateDate.indexOf('T') > -1 ? 
NF_DATETIME_SYS_DDMMYYYY_HHMMSS
-                                                                 : 
NF_DATE_SYS_DDMMYYYY,
-                LANGUAGE_SYSTEM);
             OUString aDate;
-            const Color* pColor = nullptr;
-            pNumForm->GetOutputString( fDate, nfIndex, aDate, &pColor );
+            if (comphelper::LibreOfficeKit::isActive())
+            {
+                //online handles the date format itself in browser
+                aDate = mxAnnotationData->maCreateDate;
+            }
+            else
+            {
+                SvNumberFormatter* pNumForm = pDoc->GetFormatTable();
+
+                // Date string is in format ISO 8601 inside <dc:date>
+                // i.e: 2024-08-14 or 2024-08-14T23:55:06 or 20240814T235506
+                // Time always has prefix 'T'
+                sal_uInt32 nfIndex = pNumForm->GetFormatIndex(
+                    mxAnnotationData->maCreateDate.indexOf('T') > -1 ? 
NF_DATETIME_SYS_DDMMYYYY_HHMMSS
+                                                                    : 
NF_DATE_SYS_DDMMYYYY,
+                    LANGUAGE_SYSTEM);
+                const Color* pColor = nullptr;
+                pNumForm->GetOutputString( fDate, nfIndex, aDate, &pColor );
+            }
             pNote->SetDate( aDate );
         }
         pNote->SetAuthor( mxAnnotationData->maAuthor );

Reply via email to