sc/source/filter/xml/xmlcelli.cxx | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-)
New commits: commit dc8017563934dee2aef7597f1c2f3719cb1d90e8 Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Wed Feb 26 21:55:40 2025 +0530 Commit: Pranam Lashkari <lpra...@collabora.com> CommitDate: Thu Feb 27 20:31:52 2025 +0100 sc comment kit: use iso format dates problem: Online expects iso format dates, different date type confuses online as there is no way to identify in online which format date is sent 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> (cherry picked from commit 432e75c8997dafca72ab816ac5decee7bfed21c7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182312 Tested-by: Jenkins Reviewed-by: Pranam Lashkari <lpra...@collabora.com> diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 84c0409d1f45..6efbd607a7b1 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -930,18 +930,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 );