diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-11-05 18:37:50 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-11-05 19:14:24 +0100 |
commit | 730c6bfce574e386d07193e8b3974748ef30e464 (patch) | |
tree | bb453cc83c39d797d26768845cf599875d69c961 /dbaccess | |
parent | 0340125f912294c76ab409480f5aadecf8aada04 (diff) |
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
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/ui/inc/TypeInfo.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/DExport.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/UITools.cxx | 5 |
3 files changed, 12 insertions, 0 deletions
diff --git a/dbaccess/source/ui/inc/TypeInfo.hxx b/dbaccess/source/ui/inc/TypeInfo.hxx index 0c88e41de504..5eb834576f52 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 1e8ea2b13861..bd5cdbbfa9a6 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 807764b2a78f..3f6ffab3412e 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) |