Apache OpenOffice (AOO) Bugzilla – Issue 42533
Cannot add certain text documents to Web Page Wizard
Last modified: 2017-05-20 10:55:55 UTC
- "File - Wizards - WebPage..." - On "2. Documents" use "Add..." to add the attached test.txt (which contains both Unix-style and DOS-style line ends). - A message box "An unexpected error occured while validating the file: [...]" appears, on stderr you get the below output, and the document is not added. java.lang.NullPointerException at com.sun.star.wizards.web.data.CGDocument.validate(CGDocument.java:222) at com.sun.star.wizards.web.WWD_Startup.checkDocument(WWD_Startup.java:778) at com.sun.star.wizards.web.WWD_Events$LoadDocs.run(WWD_Events.java:1125) at com.sun.star.wizards.web.WWD_Events.addDocument(WWD_Events.java:354) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sun.star.wizards.ui.event.MethodInvocation.invoke(MethodInvocation.java:112) at com.sun.star.wizards.ui.event.AbstractListener.invoke(AbstractListener.java:110) at com.sun.star.wizards.ui.event.CommonListener.actionPerformed(CommonListener.java:79) The reason is that CGDocument analyzes the given document to be of type writer_Text_encoded, calls loadComponentFromURL on it, which returns null as properties which are necessary for this filter are not included in the call, but CGDocument does not check for a null return. (AS mentioned that com.sun.star.document.StandAloneDocumentInfo might be more appropriate here, but might be broken at the moment.)
Created attachment 22455 [details] Text file that contains both Unix-style and DOS-style line ends.
BC->OS: In the following macro the document returned from 'loadComponentfromUrl' delivers 'null' when used with the document attached. Even when the assumed default mediadescriptors might not be correct there should be a valid component returned. Sub Main Dim NoArgs() oDoc = StarDesktop.loadComponentfromUrl("file:///tausch/bc/test.txt","_default",0, NoArgs()) Msgbox "Document is null: " & IsNull(oDoc) End Sub
BC: bug does not occur under Windows
Should be at least fixed for OOo2.0.1
->mba: Opening the attached document doesn't work via loadComponentFromURL but it works when directly called on the command line (including the text filter options dialog). Where is the difference? Is it necessary to provide the filter options?
That's something you should ask the filter developer. The options are not required on our side, but maybe the text filter does not work without them.
The filter is absolutely innocent. It is able to work without parameters. The problem is that the text/encoded filter has a UIComponent configured and that in SfxObjectShell::HandleFilter() this leads to the abortion of the loading. ... com::sun::star::uno::Reference< XInteractionRequest > rRequest( pFORequest ); rHandler->handle( rRequest ); if ( !pFORequest->isAbort() ) { ... pFORequest->isAbort() returns false and that's why the document isn't loaded.
We already have too much issues for the next micro release -> set to "Later".
Reset assigne to the default "issues@openoffice.apache.org".