wizards/source/access2base/Field.xba |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 4be228af5ae177ad0057613ef0a98d6cc1b67584
Author: Jean-Pierre Ledure <j...@ledure.be>
Date:   Thu May 25 18:07:56 2017 +0200

    Access2Base - Value property of DECIMAL fields
    
    Avoid overflow on CLng function
    
    Change-Id: I75dc25299cbfbc1fff9eeac4e2a8d2f3e8ed7d85

diff --git a/wizards/source/access2base/Field.xba 
b/wizards/source/access2base/Field.xba
index 651ae6ec64b6..b52938641710 100644
--- a/wizards/source/access2base/Field.xba
+++ b/wizards/source/access2base/Field.xba
@@ -545,12 +545,19 @@ Const cstMaxBinlength = 2 * 65535
                                                If 
Utils._hasUNOProperty(Column, &quot;Scale&quot;) Then
                                                        If Column.Scale &gt; 0 
Then
                                                                vValue = 
Column.getDouble()
-                                                       Else            &apos;  
CLng checks local decimal point, getString does not !
+                                                       Else    &apos;  Try 
Long otherwise Double (CDec not implemented anymore in LO ?!?)
+                                                               On Local Error 
Resume Next      &apos;  Avoid overflow error
+                                                               &apos;  CLng 
checks local decimal point, getString does not !
                                                                sValue = 
Join(Split(Column.getString(), &quot;.&quot;), Utils._DecimalPoint())
-                                                               vValue = 
CLng(sValue)           &apos;  CDec disappeared from LO ?!?
+                                                               vValue = 
CLng(sValue)
+                                                               If Err &lt;&gt; 
0 Then
+                                                                       vValue 
= CDbl(sValue)
+                                                                       
Err.Clear
+                                                                       On 
Local Error Goto Error_Function
+                                                               End If
                                                        End If
                                                Else
-                                                       vValue = 
CDec(Column.getString())
+                                                       vValue = 
CDbl(Column.getString())
                                                End If
                                        Case .CHAR                              
:       vValue = Column.getString()
                                        Case .VARCHAR                   :       
vValue = Column.getString()                             &apos;  vbString
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to