[Libreoffice-commits] core.git: wizards/source
Jean-Pierre Ledure
jp at ledure.be
Thu May 25 16:11:22 UTC 2017
wizards/source/access2base/Field.xba | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
New commits:
commit 4be228af5ae177ad0057613ef0a98d6cc1b67584
Author: Jean-Pierre Ledure <jp at 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, "Scale") Then
If Column.Scale > 0 Then
vValue = Column.getDouble()
- Else ' CLng checks local decimal point, getString does not !
+ Else ' Try Long otherwise Double (CDec not implemented anymore in LO ?!?)
+ On Local Error Resume Next ' Avoid overflow error
+ ' CLng checks local decimal point, getString does not !
sValue = Join(Split(Column.getString(), "."), Utils._DecimalPoint())
- vValue = CLng(sValue) ' CDec disappeared from LO ?!?
+ vValue = CLng(sValue)
+ If Err <> 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() ' vbString
More information about the Libreoffice-commits
mailing list