Tag: cws_dev300_dba31b
User: oj      
Date: 2008-08-18 07:05:01+0000
Modified:
   dba/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx

Log:
 #i48493# handle fixed prec types

File Changes:

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

File [changed]: FieldDescriptions.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx?r1=1.29&r2=1.29.50.1
Delta lines:  +22 -6
--------------------
--- FieldDescriptions.cxx       2008-05-05 16:08:34+0000        1.29
+++ FieldDescriptions.cxx       2008-08-18 07:04:59+0000        1.29.50.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: FieldDescriptions.cxx,v $
- * $Revision: 1.29 $
+ * $Revision: 1.29.50.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -519,10 +519,26 @@
 // 
-----------------------------------------------------------------------------
 sal_Int32                                      
OFieldDescription::GetPrecision()                       const
 {
+    sal_Int32 nPrec = m_nPrecision;
        if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_PRECISION) 
)
-               return 
::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_PRECISION));
-       else
-               return m_nPrecision;
+               nPrec = 
::comphelper::getINT32(m_xDest->getPropertyValue(PROPERTY_PRECISION));
+
+    TOTypeInfoSP pTypeInfo = getTypeInfo();
+    if ( pTypeInfo )
+    {
+           switch ( pTypeInfo->nType )
+           {
+            case DataType::TINYINT:
+            case DataType::SMALLINT:
+                   case DataType::INTEGER:
+            case DataType::BIGINT:
+                if ( !nPrec )
+                    nPrec = pTypeInfo->nPrecision;
+                break;
+        } // switch ( pTypeInfo->nType )
+    }
+       
+       return nPrec;
 }
 // 
-----------------------------------------------------------------------------
 sal_Int32                                      OFieldDescription::GetScale()   
                        const




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

Reply via email to