From c0372c90b7a8f70409e752c434b8014bb237c4b5 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Tue, 26 Jun 2001 13:31:42 +0000 Subject: #88678# SvxExtTimeField::GetFormatted: insert or reuse forrmat not builtin --- svx/source/items/flditem.cxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'svx') diff --git a/svx/source/items/flditem.cxx b/svx/source/items/flditem.cxx index 61e847b55682..a5ca0356639a 100644 --- a/svx/source/items/flditem.cxx +++ b/svx/source/items/flditem.cxx @@ -2,9 +2,9 @@ * * $RCSfile: flditem.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: ka $ $Date: 2001-06-19 14:56:39 $ + * last change: $Author: er $ $Date: 2001-06-26 14:31:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -749,10 +749,6 @@ String SvxExtTimeField::GetFormatted( SvNumberFormatter& rFormatter, LanguageTyp DBG_ERROR( "SVXTIMEFORMAT_APPDEFAULT: not implemented" ); eTmpFormat = SVXTIMEFORMAT_STANDARD; break; - case SVXTIMEFORMAT_12_HMSH: - DBG_ERROR( "SVXTIMEFORMAT_12_HMSH: not implemented" ); - eTmpFormat = SVXTIMEFORMAT_24_HMSH; - break; } ULONG nFormatKey; @@ -762,6 +758,18 @@ String SvxExtTimeField::GetFormatted( SvNumberFormatter& rFormatter, LanguageTyp case SVXTIMEFORMAT_12_HM: nFormatKey = rFormatter.GetFormatIndex( NF_TIME_HHMMAMPM, eLang ); break; + case SVXTIMEFORMAT_12_HMSH: + { // no builtin format available, try to insert or reuse + String aFormatCode( RTL_CONSTASCII_USTRINGPARAM( "HH:MM:SS,00 AM/PM" ) ); + xub_StrLen nCheckPos; + short nType; + BOOL bInserted = rFormatter.PutandConvertEntry( aFormatCode, + nCheckPos, nType, nFormatKey, LANGUAGE_ENGLISH_US, eLang ); + DBG_ASSERT( nCheckPos == 0, "SVXTIMEFORMAT_12_HMSH: could not insert format code" ); + if ( nCheckPos ) + nFormatKey = rFormatter.GetFormatIndex( NF_TIME_HH_MMSS00, eLang ); + } + break; case SVXTIMEFORMAT_24_HM: nFormatKey = rFormatter.GetFormatIndex( NF_TIME_HHMM, eLang ); break; -- cgit