Apache OpenOffice (AOO) Bugzilla – Issue 52830
save failed after pasting multiselection of embedded object and drawing object into Calc
Last modified: 2013-08-07 15:13:53 UTC
- create new Draw document - insert a chart object and a circle - select both objects and copy them into the clipboard - create new Calc document - paste clipboard into the Calc document - save of Calc document fails with message: Error saving the document ...: Writer Error The file could not be written Please have a look as discussed. Please inform SAB, if the defect has to be fixed in the Calc core. Note: The same defect for Writer is issue i50824, which is already fixed in the Writer core in cws swqbf35.
I can confirm that problem with 2.0 (1.9.m122) German version WIN XP: [680m122(Build8941)] @od: did you really test with all platforms and OS? :-/ Pls. specify! Hint that might be useful: after first vainly attempt to save the file, I tried a second time to save it with the same name as I had for the first attempt. I got the message "file name does already exist", but the file does not esixt.
OD->rainerbielefeld: Thank you for controlling my work ;-) No, I didn't test all platforms and all OS. But I've tested SRC680m122 on Windows XP and on Solaris. Thus, I had to set fields <platform> and <OS> to value <All>
All right! I have to correct my comments from rainerbielefeld Thu Aug 4 03:26:26: There _is_ a 0 byte file on harddisk with the name I wanted to have for the saved calc document; that file disappeared when I closed the calc document without saving. I also saw that bug in with 2.0 (1.9.m113) German version WIN XP: [680m113(Build8930)] and 2.0 (1.9.m104) German version WIN 98: [680m104(Build8913)]. So, I will no longer prevent you all from bug fixing with my comments, Rainer
Fixed, there where at least two issues. in sd, SdTransferable::GetData() was called and the call to pSdViewIntern->GetAllMarkedModel() failed since the document of the pSdViewIntern was different then the pSourceDocument of the SdTransferable. If fixed this by getting the document from the pSdViewIntern for calling CreatingDataObj to ensure this is the model where pSdViewIntern later calls AllocModel() in calc, ScViewFunc::PasteDataFormat() created a temporary FmFormModel for importing the drawing layer objects from the clipboard xml. It uses GetViewData()->GetDocShell() as the docshell for this model. This caused the temporary FmFormModel to have the same persist as the drawing layer model of the target calc application. When the temporary model was deleted, the containing SdrOle2Object disposed its EmbeddedObj but didn't remove it from the docshell. So after the paste finished there still was this disposed EmbeddedObj in the target calc applications persist. That caused Sfx to not export the document. @cl->nn: I fixed this by creating a temporary ScDocShell for the temporary model, please verify my changes in viewfun5.cxx
@cl->rainerbielefeld, all comments are mostly welcome
I have just commited a code for this issue into svx that removes the embedded objects from container when a model is destroyed. As result the objects that are copied to a temporary model with wrong persistance and then to an another target model should not influence the storing process of either source or target document any more. This removing is not necessary when the model has correct persistance, but if an object is set to a model with wrong persistance ( as in case of this issue ) this workaround allows user to store the document. There are also two new assertions in the "SdrOle2Obj::SetModel()" method that shoud allow to detect whether the target model has a suspicious persistance.
verified in cws, back to qa re-open issue and reassign to wg@openoffice.org
reassign to wg@openoffice.org
reset resolution to FIXED
Verified in CWS.
Verified in cws c03v2
*** Issue 54558 has been marked as a duplicate of this issue. ***
Tested in m139. Closed.