summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-01-28 13:01:14 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-01-28 13:01:14 +0000
commit22902da7139c9154fae183c6245d12a5acc41ae5 (patch)
tree30d61c12dc40b95b819c5591e5377bdd938835f3
parentf112532e42e661762cc9f69bc3a8cfb85c9165d2 (diff)
INTEGRATION: CWS ab42 (1.11.12); FILE MERGED
2007/12/21 13:41:59 ab 1.11.12.2: #i81674# Use sb res manager to access predefined format resource strings 2007/12/21 11:16:36 ab 1.11.12.1: #151250# Support date/time formats
-rw-r--r--basic/source/sbx/sbxscan.cxx42
1 files changed, 39 insertions, 3 deletions
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 85a00e92b6..f553d0aae7 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: sbxscan.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: rt $ $Date: 2007-11-13 15:23:45 $
+ * last change: $Author: vg $ $Date: 2008-01-28 14:01:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -62,6 +62,10 @@
#include "basrid.hxx"
+#include <svtools/zforlist.hxx>
+#include <comphelper/processfactory.hxx>
+
+
void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep )
{
SvtSysLocale aSysLocale;
@@ -640,7 +644,7 @@ ResMgr* implGetResMgr( void )
if( !pResMgr )
{
::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale();
- pResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(stt), aLocale );
+ pResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(sb), aLocale );
}
return pResMgr;
}
@@ -658,6 +662,38 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
{
short nComma = 0;
double d = 0;
+
+ // Check for date format
+ if( pFmt && !SbxBasicFormater::isBasicFormat( *pFmt ) )
+ {
+ LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ xFactory = comphelper::getProcessServiceFactory();
+ SvNumberFormatter aFormatter( xFactory, eLangType );
+
+ sal_uInt32 nIndex;
+ xub_StrLen nCheckPos = 0;
+ short nType;
+
+ String aFmtStr = *pFmt;
+ aFormatter.PutandConvertEntry( aFmtStr,
+ nCheckPos,
+ nType,
+ nIndex,
+ LANGUAGE_ENGLISH,
+ eLangType );
+
+ if( nType == NUMBERFORMAT_DATE ||
+ nType == NUMBERFORMAT_TIME ||
+ nType == NUMBERFORMAT_DATETIME )
+ {
+ double dt = GetDate();
+ Color* pColor;
+ aFormatter.GetOutputString( dt, nIndex, rRes, &pColor );
+ return;
+ }
+ }
+
SbxDataType eType = GetType();
switch( eType )
{