Summary: | BASIC: Race condition in FilePicker dialog methods, an perhaps other dialogs | ||
---|---|---|---|
Product: | LibreOffice | Reporter: | Ewald Anderl <ecanderl> |
Component: | BASIC | Assignee: | Not Assigned <libreoffice-bugs> |
Status: | UNCONFIRMED --- | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | ecanderl |
Version: | 4.2.3.3 release | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | BSA | ||
i915 platform: | i915 features: | ||
Attachments: |
Screen shots and additional notes to reproduce problem
Screen shots and additional notes to reproduce problem (updated) |
Description
Ewald Anderl
2014-05-02 22:50:33 UTC
Created attachment 98353 [details]
Screen shots and additional notes to reproduce problem
This bug was discovered while documenting a requested enhancement for the behavior of FilePicker and FolderPicker dialog(s). This is the current version of that document and should provide some context. It includes the code where the problem appeared as well as additional discussions and screen shots from the IDE showing the problem in my environment.
The enhancement request will be filed seperately. I will come back here to provide a bugzilla reference once it is filed.
Enhancement request referenced in comment 1 is Bugzilla 78210 Created attachment 99451 [details]
Screen shots and additional notes to reproduce problem (updated)
I was request to provide a simple reproducable test case as an exampe for a related problem. I have proactively done the same for this bug report. I have also updated the associated document which was streamlined. Problem description: ==================== After making a call to setDisplayDirectory(), the call to getDisplayDirectory() should return the new directory value. If the “get...” call is made too quickly, the correct value is not returned. It is possible that other similar race conditions exist. Given the behavior, it is possible that this is also related to bug 43021. How to reproduce the problem: ============================= 1. In LibreOffice, open Tools --> Options; in the LibreOffice – General tab ensure that “Use LibreOffice dialogs” is unchecked. 2. In LibreOffice, open Tools --> Macros --> Organize Macros --> pick any module to edit 3. Type (or cut/paste) the following program in to the empty “Sub” of your choice (Main will do): Dim oDialog 'FilePicker dialog Dim vBefore 'value before call to setDisplayDirectory Dim vAfter 'value after call. Dim s 'tmp string for creatint output oDialog = CreateUnoService("com.sun.star.ui.dialogs.FilePicker") Print "setDisplayDirectory --> /tmp" 'pick any reasonable directory. vBefore = oDialog.getDisplayDirectory() 'Before oDialog.setDisplayDirectory(ConvertToURL("/tmp")) REM Wait 500 'This line makes it work vAfter = oDialog.getDisplayDirectory() 'After s = s & "getDisplayDirectory before = [" & vBefore & "] " & Chr$(10) s = s & "getDisplayDirectory after = [" & vAfter & "] " & Chr$(10) MsgBox s, 0 4. Run this Macro, getDisplayDirectory() fails 5. Edit the Macro to remove the 'REM' in front of the 'Wait” statement 6. Run the Macro again, getDisplayDirectory() works correctly Current behavior: ================= Without the “Wait” statement, getDisplayDirectory() returns an empty string. With the “Wait” statement, getDisplayDirectory() returns the correct directory (“file:///tmp”). Using the Libreoffice dialog style appears to work correctly. Expected behavior: ================== With or without a wait (or code) following the call to setDisplayDirectory(), getDisplayDirectory() should return (“file:///tmp”). |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.