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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Aug 24 14:33:54 UTC 2018


 wizards/source/access2base/Database.xba |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 84c02b6d9f2fbe6658b58182f57d60e2bc797016
Author:     Jean-Pierre Ledure <jp at ledure.be>
AuthorDate: Fri Aug 24 16:30:10 2018 +0200
Commit:     Jean-Pierre Ledure <jp at ledure.be>
CommitDate: Fri Aug 24 16:30:10 2018 +0200

    Access2Base - Fix OutputTo of null string
    
    Basic builtin function IsDate
    returns True for a null-length string.
    Intercepted to avoid conversion to date giving "00:00:00"
    
    Change-Id: Ie917574043ea743e43cd79c5d95d023c8ccab38a

diff --git a/wizards/source/access2base/Database.xba b/wizards/source/access2base/Database.xba
index cf8617e0b285..72f73cb8daf2 100644
--- a/wizards/source/access2base/Database.xba
+++ b/wizards/source/access2base/Database.xba
@@ -1458,7 +1458,9 @@ Const cstMaxRows = 200
 					If Not vFieldsBin(i) Then
 						If bDataArray Then vDataCell = pvData(i, j) Else vDataCell = vData(i, j)
 						If vDataCell Is Nothing Then vDataCell = Null		'	Necessary because Null object has not a VarType = vbNull
-						If IsDate(vDataCell) And VarType(vDataCell) = vbString Then vDataCell = CDate(vDataCell)
+						If VarType(vDataCell) = vbString Then	'	Null string gives IsDate = True !
+							If Len(vDataCell) > 0 And IsDate(vDataCell) Then vDataCell = CDate(vDataCell)
+						End If
 						Select Case VarType(vDataCell)
 							Case vbEmpty, vbNull
 								vTdClass() = _AddArray(vTdClass, "null")
@@ -1563,7 +1565,7 @@ Dim i As Integer, l As Long
 
 	lCurrentChar = 1
 	sOutput = ""
-	
+
 	Do While lCurrentChar <= Len(psString)
 		'	Where is next closest pattern ?
 		lPattern = Len(psString) + 1


More information about the Libreoffice-commits mailing list