[Libreoffice-commits] core.git: wizards/source
Jean-Pierre Ledure
jp at ledure.be
Sun Mar 27 14:44:25 UTC 2016
wizards/source/access2base/Field.xba | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
New commits:
commit c85a438f412f32a94f8e872ed7b419b9f7667d6e
Author: Jean-Pierre Ledure <jp at ledure.be>
Date: Sun Mar 27 16:42:05 2016 +0200
Access2Base - GetChunk - tests of BLOB field type
Change-Id: I02f51ff264c64458c99c47ea48d960a50c65cb75
diff --git a/wizards/source/access2base/Field.xba b/wizards/source/access2base/Field.xba
index 7bff09d..5b94ba2 100644
--- a/wizards/source/access2base/Field.xba
+++ b/wizards/source/access2base/Field.xba
@@ -189,6 +189,7 @@ Const cstThisSub = "Field.GetChunk"
Utils._SetCalledSub(cstThisSub)
Dim oValue As Object, bNullable As Boolean, bNull As Boolean, vValue() As Variant
+Dim lLength As Long, lOffset As Long, lValue As Long
If IsMissing(pvOffset) Or IsMissing(pvBytes) Then Call _TraceArguments()
If Not Utils._CheckArgument(pvOffset, 1, _AddNumeric()) Then Goto Exit_Function
@@ -205,6 +206,7 @@ Dim oValue As Object, bNullable As Boolean, bNull As Boolean, vValue() As Varian
bNullable = ( Column.IsNullable = com.sun.star.sdbc.ColumnValue.NULLABLE )
bNull = False
GetChunk = Null
+ vValue = Array()
With com.sun.star.sdbc.DataType
Select Case Column.Type ' DOES NOT WORK FOR CHARACTER TYPES
' Case .CHAR, .VARCHAR, .LONGVARCHAR
@@ -218,14 +220,15 @@ Dim oValue As Object, bNullable As Boolean, bNull As Boolean, vValue() As Varian
Case Else
Goto Trace_Error
End Select
+ If bNullable Then bNull = Column.wasNull()
+ If Not bNull Then
+ lOffset = CLng(pvOffset)
+ If lOffset > 0 Then oValue.skipBytes(lOffset)
+ lValue = oValue.readBytes(vValue, pvBytes)
+ End If
+ oValue.closeInput()
End With
- If bNullable Then bNull = Column.wasNull()
- If Not bNull Then
- If pvOffset > 0 Then oValue.skipBytes(pvOffset)
- oValue.readBytes(vValue, pvBytes)
- GetChunk = vValue
- End If
- oValue.closeInput()
+ GetChunk = vValue
Exit_Function:
Utils._ResetCalledSub(cstThisSub)
More information about the Libreoffice-commits
mailing list