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

             Bug #: 50599
           Summary: Macros: NoSuchElementException during normal work on
                    new record
    Classification: Unclassified
           Product: LibreOffice
           Version: LibO 3.5.4 release
          Platform: x86-64 (AMD64)
        OS/Version: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
        AssignedTo: [email protected]
        ReportedBy: [email protected]


I have this problem when:
1. On Form I have two forms, each attached to the different table
2. I am inserting new row in sub-form, by editing list boxes, and date list
boxes.
NOTE: The subform is joined to the main table by master - slave field.
3. When I click on the drop-down button on date list box (one field in my table
stores date), this exception occures:

Type: com.sun.star.container.NoSuchElementException

And I have no macro, just editing NewRow in my table.
To get this exception caught I had to add a macro to the "Before Record Action"
event (see below).
The problem is that I simply click on the date control. Or sometimes
double-click the form (not any specific control) - and the whole LibreOffice
crashes and the I had to recover the file.


Function prevent_saving_uncompleted_record (oEvent As Object)
REM When clicking on the Form during record modification/creation, Libre Office
unexpectedly attempts to save uncompleted record
REM Because of that this function is set on the "Before record action" event to
prevent saving a record during modifications.
    REM Set up error handler
    On error GoTo ErrorHandler

    REM By default all modifications to the row are not allowed
    prevent_saving_uncompleted_record = True
Dim oForm As Object
Dim oControl As Object
    oForm = oEvent.Source.Model
    oControl = oForm.GetByName("Save button")
    REM Check if "Save button" is enabled (it is enabled when any of the field
has changed)
    If oControl.Enabled = "True" Then
        prevent_saving_uncompleted_record = False
    End If
    Exit Function

    ErrorHandler:
    MsgBox "Error " & err & ": " & error$ + chr(13) + "In line : " + Erl +
chr(13) + Now , 16 ,"An error occurred"
End Function

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to