https://bugs.freedesktop.org/show_bug.cgi?id=87974

--- Comment #20 from Bill Gradwohl <bill-l...@ycc.com> ---
Testing was done on Fedora 21 & LibreOffice 4.3.5.2

I've discovered that forcing Main to execute at document start up, and then
starting a forms execution somewhat later, causes Global items created via 
Global dateStruct as new "com.sun.star.util.Date"
and then subsequently initialized in Main to lose their value by time the form
execution causes a sub to fire.

Option Explicit

Global defaultVendor         as string
Global dateStruct            as new "com.sun.star.util.Date"

Sub Main   ' started via event "Open Document" at the document level
dim dateString               as string

BasicLibraries.LoadLibrary("XrayTool")

defaultVendor = "Eldons"
dateString = date()
dateStruct.Month = left(dateString,2)
dateStruct.Day   = mid(dateString,4,2)
dateStruct.Year  = right(dateString,4)
msgbox ("Today is " + dateStruct.Month + "/" + dateStruct.Day + "/" +
dateStruct.Year)
xray dateStruct   ' this clearly shows that dateStruct is properly initialized.
End Sub




Sub PriorToReset(event)       'started via Form Properties event "Prior to
reset" attached to the "Date" field.
xray dateStruct   ' this shows the structure exists, but with 0 values.
msgbox (defaultVendor) ' This shows "Eldons"
End Sub

If the document level event to execute Main is deleted, and the form level
event "Open Document" is set to execute Main, the same thing happens. The
Global values are reset to 0 for the dateStruct, but the default Vendor has its
value of Eldons. In addition, this change to run Main at forms start causes any
attempt at editing the form to run Main. Main executes when an attempt is made
to just edit the form, not execute it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to