https://bugs.documentfoundation.org/show_bug.cgi?id=141844

            Bug ID: 141844
           Summary: XCloseListener attached to form does not throw errors
                    in case of bad Python coding
           Product: LibreOffice
           Version: 6.4.7.2 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Base
          Assignee: [email protected]
          Reporter: [email protected]

Description:
When coding errors are present in a closelistener class for some bad coding the
expected behaviour is not invoked, while no errors are thrown
I have python opened is a separate editor, CTRL +S, then run the code in libO
(no IDE)

Steps to Reproduce:
def dialog2(oEvent):


    oForm = XSCRIPTCONTEXT.getDocument()

    time.sleep(0.5)
    AB = CloseListener()
    oForm.addCloseListener(AB)

class CloseListener(unohelper.Base, XCloseListener):

    def notifyClosing(self, evt: FrameActionEvent):
       # msgbox("notifyClosing")
       pass

    def queryClosing(self,evt: FrameActionEvent):#,   ownership=True):
        msgbox("qC"+str(9))
        return
    def disposing(self, evt: EventObject):
        pass

0) dialog2 is attached to the 'when loading' form event
1) above code throws no exception, msgbox is not shown, form closes normally

2) if ):# is removed, closing of the form shows the msgbox

3) removing the str function in the msgbox,

4) def queryClosing(self,evt: FrameActionEvent, ownership=True)
without the : an error is thrown

Actual Results:
re 1) no error shown, form closes normally
re 2) good coding, as expected
re 3) no error shown, form closes normally
re 4) bad coding, error is thrown, the only correct case in this list

Expected Results:
re 1) expected is an error like 'expected 2 parameters, got 1
re 2) behaviour is as expected
re 3) should raise the error 'cannot concatenate string and integers'
re 4) behaviour as expected


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 6.4.7.2
Build ID: 1:6.4.7-0ubuntu0.20.04.1
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3;

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to