Apache OpenOffice (AOO) Bugzilla – Issue 36098
Unpacked XStorable->storeToUrl(...) broken in 1.1.3?
Last modified: 2017-05-20 11:27:34 UTC
The XStorable method, when invoked with the 'unpacked' flag, saves zero-byte xml files, eg content.xml, meta.xml, settings.xml, style.xml, etc... This affects writer, calc, and impress (maybe it's not an api issue?) on Windows XP, SP2. Have not tested other platforms. Tested by calling from C++ and Java. I have written code that opens a document, and then stores it as an 'unpacked' OpenOffice file, eg sxw. This is supposed to write XML files to a folder named 'content.whatever.sxw'. eg., whatever.sxw content.whatever.sxw/content.xml content.whatever.sxw/meta.xml etc... This functionality worked within OpenOffice 1.1.0. After upgrading to OpenOffice 1.1.3, the XML files are all saved as zero-length files. Storing 'packed' files still works, of course. Sample Code (to save an open component): ----------------------------------------- Start with SDK/Examples/java/DocumentHandling/DocumentSaver.java Add "Unpacked" as the 3rd save prop. line 159: XStorable xstorable = ( XStorable ) UnoRuntime.queryInterface( XStorable.class, objectDocumentToStore ); propertyvalue = new PropertyValue[ 3 ]; propertyvalue[ 0 ] = new PropertyValue(); propertyvalue[ 0 ].Name = "Overwrite"; propertyvalue[ 0 ].Value = new Boolean(true); propertyvalue[ 1 ] = new PropertyValue(); propertyvalue[ 1 ].Name = "FilterName"; propertyvalue[ 1 ].Value = "swriter: StarOffice XML (Writer)"; + propertyvalue[ 2 ] = new PropertyValue(); + propertyvalue[ 2 ].Name = "Unpacked"; + propertyvalue[ 2 ].Value = new Boolean(true); xstorable.storeAsURL( sSaveUrl.toString(), propertyvalue ); -----------------------------------------
Just in case DocumentSaver.java has changed, (and therefore the line numbers too, etc...) this is the version I used: * $RCSfile: DocumentSaver.java,v $ * * $Revision: 1.3 $ As well, I missed marking (by hand) the change from 2 to 3 on the line propertyvalue = new PropertyValue[ 3 ]; - Jamie.
The following macro demonstrates the behaviour: Sub Main dim args(0) as new com.sun.star.beans.PropertyValue args(0).Name="Unpacked" args(0).Value=true thiscomponent.storeAsUrl("file:///home/sw/empty.sxw",args()) End Sub This works properly with OOo1.1.0, creates empty xml-files with OOo1.1.3 and the property seems to have no effect in src680_m57
AS->MAV: Seems to be your part ...
Yes, the unpacked format is not completely supported for now.
Reset assigne to the default "issues@openoffice.apache.org".