[Libreoffice-commits] core.git: dbaccess/source

Lionel Elie Mamane lionel at mamane.lu
Tue Nov 5 19:14:55 CET 2013


 dbaccess/source/ui/inc/TypeInfo.hxx |    2 ++
 dbaccess/source/ui/misc/DExport.cxx |    5 +++++
 dbaccess/source/ui/misc/UITools.cxx |    5 +++++
 3 files changed, 12 insertions(+)

New commits:
commit 730c6bfce574e386d07193e8b3974748ef30e464
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Tue Nov 5 18:37:50 2013 +0100

    fill in nNumPrecRadix
    
    Wrongfully removed by commit 808052a13947c9841ce5c9e40860c48bbfbf3434
    Date: Tue Jun 20 02:21:13 2006 +0000
    which only wanted to make the code warning-free...
    
    But also disallow radix 1 (which does not make much sense)
    
    Change-Id: Id8e313301fa6d5e9643d76865a62cc933999a63e

diff --git a/dbaccess/source/ui/inc/TypeInfo.hxx b/dbaccess/source/ui/inc/TypeInfo.hxx
index 0c88e41..5eb834576 100644
--- a/dbaccess/source/ui/inc/TypeInfo.hxx
+++ b/dbaccess/source/ui/inc/TypeInfo.hxx
@@ -73,6 +73,7 @@ const sal_uInt16 TYPE_BIT       = 31;
         OUString aLocalTypeName;
 
         sal_Int32       nPrecision;     // length of type
+        sal_Int32       nNumPrecRadix;  // indicating the radix, which is usually 2 or 10
         sal_Int32       nType;          // database type
 
         sal_Int16       nMaximumScale;  // decimal places after decimal point
@@ -88,6 +89,7 @@ const sal_uInt16 TYPE_BIT       = 31;
 
         OTypeInfo()
                 :nPrecision(0)
+                ,nNumPrecRadix(10)
                 ,nType(::com::sun::star::sdbc::DataType::OTHER)
                 ,nMaximumScale(0)
                 ,nMinimumScale(0)
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index 1e8ea2b..bd5cdbb 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -267,6 +267,9 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection,
                 ++nPos;
                 aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
                 m_pTypeInfo->nMaximumScale  = aValue;
+                nPos = 18;
+                aValue.fill(nPos,aTypes[nPos],xRow);
+                m_pTypeInfo->nNumPrecRadix  = aValue;
 
                 // check if values are less than zero like it happens in a oracle jdbc driver
                 if( m_pTypeInfo->nPrecision < 0)
@@ -275,6 +278,8 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection,
                     m_pTypeInfo->nMinimumScale = 0;
                 if( m_pTypeInfo->nMaximumScale < 0)
                     m_pTypeInfo->nMaximumScale = 0;
+                if( m_pTypeInfo->nNumPrecRadix <= 1)
+                    m_pTypeInfo->nNumPrecRadix = 10;
                 break;
             }
         }
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 807764b..3f6ffab 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -507,8 +507,11 @@ void fillTypeInfo(  const Reference< ::com::sun::star::sdbc::XConnection>& _rxCo
             ++nPos;
             aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
             pInfo->nMaximumScale    = aValue;
+            assert(nPos == 15);
+            // 16 and 17 are unused
             nPos = 18;
             aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
+            pInfo->nNumPrecRadix    = aValue;
 
             // check if values are less than zero like it happens in a oracle jdbc driver
             if( pInfo->nPrecision < 0)
@@ -517,6 +520,8 @@ void fillTypeInfo(  const Reference< ::com::sun::star::sdbc::XConnection>& _rxCo
                 pInfo->nMinimumScale = 0;
             if( pInfo->nMaximumScale < 0)
                 pInfo->nMaximumScale = 0;
+            if( pInfo->nNumPrecRadix <= 1)
+                pInfo->nNumPrecRadix = 10;
 
             OUString aName;
             switch(pInfo->nType)


More information about the Libreoffice-commits mailing list