Tag: cws_src680_dba22b
User: oj      
Date: 2007/01/03 06:42:43

Modified:
   dba/dbaccess/source/ui/misc/DExport.cxx

Log:
 #i69831# check any number format

File Changes:

Directory: /dba/dbaccess/source/ui/misc/
========================================

File [changed]: DExport.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/DExport.cxx?r1=1.36&r2=1.36.10.1
Delta lines:  +21 -25
---------------------
--- DExport.cxx 1 Dec 2006 17:31:38 -0000       1.36
+++ DExport.cxx 3 Jan 2007 14:42:40 -0000       1.36.10.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: DExport.cxx,v $
  *
- *  $Revision: 1.36 $
+ *  $Revision: 1.36.10.1 $
  *
- *  last change: $Author: rt $ $Date: 2006/12/01 17:31:38 $
+ *  last change: $Author: oj $ $Date: 2007/01/03 14:42:40 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -413,36 +413,32 @@
                         else
                         {
                             Reference<XNumberFormatTypes> 
xNumType(xSupplier->getNumberFormats(),UNO_QUERY);
-
-                            try
-                            {
-                                nNumberFormat = 
m_xFormatter->detectNumberFormat(xNumType->getStandardFormat(NumberFormat::DATETIME,m_aLocale),m_sTextToken);
-                            }
-                            catch(Exception&)
+                            sal_Int16 nFormats[] = { NumberFormat::DATETIME
+                                ,NumberFormat::DATETIME
+                                ,NumberFormat::DATE
+                                ,NumberFormat::TIME
+                                ,NumberFormat::NUMBER
+                                ,NumberFormat::LOGICAL
+                            };
+                            for (sal_Int16 i = 0; i < 
sizeof(nFormats)/sizeof(nFormats[0]); ++i)
                             {
                                 try
                                 {
-                                    nNumberFormat = 
m_xFormatter->detectNumberFormat(xNumType->getStandardFormat(NumberFormat::DATE,m_aLocale),m_sTextToken);
+                                    nNumberFormat = 
m_xFormatter->detectNumberFormat(xNumType->getStandardFormat(nFormats[i],m_aLocale),m_sTextToken);
+                                    break;
                                 }
                                 catch(Exception&)
                                 {
-                                    try
-                                    {
-                                        nNumberFormat = 
m_xFormatter->detectNumberFormat(xNumType->getStandardFormat(NumberFormat::TIME,m_aLocale),m_sTextToken);
                                     }
-                                    catch(Exception&)
-                                    {
+                            }
                                         try
                                         {
-                                            nNumberFormat = 
m_xFormatter->detectNumberFormat(xNumType->getStandardFormat(NumberFormat::NUMBER,m_aLocale),m_sTextToken);
+                                fOutNumber = 
m_xFormatter->convertStringToNumber(nNumberFormat,m_sTextToken);
                                         }
                                         catch(Exception&)
                                         {
+                                OSL_ENSURE(0,"Could not convert to number!");
                                         }
-                                    }
-                                }
-                            }
-                            fOutNumber = 
m_xFormatter->convertStringToNumber(nNumberFormat,m_sTextToken);
                         }
                         try
                         {




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to