Issue 36098 - Unpacked XStorable->storeToUrl(...) broken in 1.1.3?
Summary: Unpacked XStorable->storeToUrl(...) broken in 1.1.3?
Status: ACCEPTED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Windows XP
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-25 16:10 UTC by jamieson
Modified: 2017-05-20 11:27 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jamieson 2004-10-25 16:10:16 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 );


-----------------------------------------
Comment 1 jamieson 2004-10-25 16:21:51 UTC
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.
Comment 2 stephan.wunderlich 2004-11-01 10:36:25 UTC
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
Comment 3 andreas.schluens 2004-11-01 10:50:34 UTC
AS->MAV: Seems to be your part ...
Comment 4 mikhail.voytenko 2004-11-01 12:12:49 UTC
Yes, the unpacked format is not completely supported for now.
Comment 5 Marcus 2017-05-20 11:27:34 UTC
Reset assigne to the default "issues@openoffice.apache.org".