From 4ffb036fd5858c1acee9930e8f03d8b8a0d88730 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Mon, 19 Aug 2019 17:05:15 +0200 Subject: Resolves: tdf#72040 add predefined ISO 8601 date+time format with "T" Still missing is selecting the format if such input is detected, but if applied it is preserved as edit format when editing the value. Change-Id: Ic36a643bb90ac897a303d5d59782aa4b297a56ea Reviewed-on: https://gerrit.libreoffice.org/77732 Reviewed-by: Eike Rathke Tested-by: Jenkins --- svx/source/items/numfmtsh.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'svx') diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index 85c051fbc226..8f39c009351f 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -688,7 +688,8 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl(std::vector& rL // Ugly hack to suppress an ISO date+time format that is the // default date+time format of the locale and identical to the // internally generated one to be added below. - if (!bSuppressDuplicates || aNewFormNInfo != "YYYY-MM-DD HH:MM:SS") + if (!bSuppressDuplicates || (aNewFormNInfo != "YYYY-MM-DD HH:MM:SS" + && aNewFormNInfo != "YYYY-MM-DD\"T\"HH:MM:SS")) { rList.push_back(aNewFormNInfo); aCurEntryList.push_back(nNFEntry); @@ -697,9 +698,9 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl(std::vector& rL } } - // Always add the internally generated ISO format. + // Always add the internally generated ISO formats. nSelPos = FillEListWithFormats_Impl(rList, nSelPos, NF_DATETIME_ISO_YYYYMMDD_HHMMSS, - NF_DATETIME_ISO_YYYYMMDD_HHMMSS, false); + NF_DATETIME_ISO_YYYYMMDDTHHMMSS, false); return nSelPos; } @@ -720,6 +721,7 @@ bool SvxNumberFormatShell::IsEssentialFormat_Impl(SvNumFormatType eType, sal_uIn case NF_TIME_HH_MMSS00: case NF_DATETIME_SYS_DDMMYYYY_HHMMSS: case NF_DATETIME_ISO_YYYYMMDD_HHMMSS: + case NF_DATETIME_ISO_YYYYMMDDTHHMMSS: return true; default: break; -- cgit