Hello I try to implement drag and drop via Java UNO from an LO control (XTreeControl). Dropping of Text/Files onto the control works fine. However, dragging a "FileList" type (application/x-openoffice-filelist;windows_formatname="FileList") from LO to any application accepting files (FileList) fails with a crash of the receiving application e.g. Explorer/Notepad. Dragging text from LO however works (sort of). Due to little documentation I am not sure if I do this correctly. Tried a number of different options returning raw byte[], many combinations of Any etc. Debugging the receiving application crashes here (win32 api): DragQueryFile(hDropInfo, 0, szFileName, _MAX_PATH); The call succeeds however, szFileName contains garbage. I use the following test Java code to implement the drag source: //////////////////////////////////////////////////////////////// private static final String MIME_FILE_LIST = "application/x-openoffice-filelist;windows_formatname=\"FileList\""; @Override public void dragGestureRecognized(DragGestureEvent evt) { evt.DragSource.startDrag(evt, DNDConstants.ACTION_COPY, 0, 0, new XTransferable() { @Override public Object getTransferData(DataFlavor dataFlavor) throws UnsupportedFlavorException, IOException { String s = "C:\\Users\\xxx\\file.log"; if(dataFlavor.MimeType.equals(MIME_FILE_LIST)) { return new Any(byte[].class, s.getBytes()); } return null; } @Override public DataFlavor[] getTransferDataFlavors() { return new DataFlavor[]{ new DataFlavor(MIME_FILE_LIST, "FileList", new Type(byte[].class)), }; } @Override public boolean isDataFlavorSupported(DataFlavor dataFlavor) { return true; } //// } ////////////////////////////////////////////////////////////////////////////////////////////////
Sorry, I was wrong. The call DragQueryFile crashes with an Access Violation 0xC0000005.
I do not understand why you opened this bug report against LibreOffice. What make you thinking there is a bug in LibreOffice related to this crash in your application? I suggest you to ask for help on developer mailing list or irc (http://devcentral.libreoffice.org/). I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested information is provided. Best regards. JBF
I think the LO UNO API does not work as expected: The receiving (Windows) application (e.g Explorer, Wordpad) gets the WM_DROP message, but when it is calling WIN32 API DragQueryFiles to get the list of dropped files, the (receiving) application crashes. I assume this is due to the fact that the passed data structure from LO is invalid. As I understand the "getTransferData" needs to return a byte[] containing the list of files separated by a null byte(character?) and needs to be terminated by a null byte/character. This is what the WIN32 documentation claims. And this is what I get the other way around: If files are dropped to my LO extension, they're separated by a (byte)0. I tried a lot of combinations of byte[] to be returned but never succeeded in any reasonable behavior. I tried to return wrapped byte[] in an Any or raw byte[]. Returning anything else e.g. char[] would not lead to any WM_DROP message at all, so I assume it needs to be byte[], which is what the LO UNO documentation says anyway. Searching for documentation/example which demonstrated this was unsuccessful. Looking at the LO source code did not reveal any more clues. I was hoping to get some hints by filing this issue. Regards Christian
Are you still facing this problem. If yes did you try to ask the developer mailing list for help ? Set status to NEEDINFO, please set it back to UNCONFIRMED once requested informations are provided. Best regards. JBF
Dear Bug Submitter, This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INSUFFICIENTDATA due to lack of needed information. For more information about our NEEDINFO policy please read the wiki located here: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/NEEDINFO If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed. Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-NeedInfo-Ping-20181009
Dear Bug Submitter, Please read this message in its entirety before proceeding. Your bug report is being closed as INSUFFICIENTDATA due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided): a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present b) Provide easy to reproduce steps – the simpler the better c) Provide any test case(s) which will help us confirm the problem d) Provide screenshots of the problem if you think it might help e) Read all comments and provide any requested information Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue. Please do not: a) respond via email b) update the version field in the bug or any of the other details on the top section of our bug tracker Warm Regards, QA Team MassPing-NeedInfo-20181105