Apache OpenOffice (AOO) Bugzilla – Issue 98206
exporting to raster graphics (PNG/JPEG) gives 0 byte file
Last modified: 2009-02-20 13:53:46 UTC
1. Create a circle in OOo Draw 2. Click - File - Export 3. Choose PNG or JPEG Result: File size is 0 bytes System: Linux DEV300m_39 (pre 3.1.0) Comment: Exporting to HTML or PDF seems fine.
Confirm for OOoDEV300m39 on WinXP. It has been OK in m37 here.
Reproducible. Reassigned.
*** Issue 98310 has been marked as a duplicate of this issue. ***
sj->mav: SfxMedium::Commit() is called twice, the first time it is called from svx/source/xoutdev/_xoutbmp.cxx. In the first time the Transfer_Impl in SfxMedium::Commit() is copying and then killing the temporary stream. So the second commit call from SfxObjectShell::SaveTo_Impl makes the Transfer_Impl() working with a killed temporary stream having a size 0. If I am skipping the secondary call, everything works as expected. As you are having the most experience with sfx, I am glad hand over this issue to you.
.
It is not the second commit to the same medium. It is a commit of the different medium. The problem here is that the filter writes directly to the document instead of writing to the SfxMedium provided in ConvertTo() call. As result the framework implementation commits at the end the medium that was never written. It worked before because the medium did not try to open the output stream, and thus has nothing to commit. Now it has to open the stream, to handle the file locking centrally. I believed till now that we have a kind of rule, nobody writes directly to the target document file except framework. If it is still true then this is a problem of the export filter, the filter should get stream from the provided medium and export there.
I have changed the sfx2 behavior for 3.1, since it is not only one filter. At least two filters in sd ( grf and cgm ) have the problem. Some other filters might have the problem as well. It looks to be too risky for me to change all the filters for 3.1 now. So I have submitted a successor issue for this.
issue 98972 is the successor issue
mav->wg: Please verify the issue.
Checked manually and autotests on linux/windows have been run- ok. Verified.
Tested in OOO310_m2. Closed.