From koffice-devel Sun May 31 20:02:19 2009 From: cricketc () gmail ! com Date: Sun, 31 May 2009 20:02:19 +0000 To: koffice-devel Subject: Re: [patch] KoOdfExporter and MSWordOdfImport port & fixes Message-Id: <200905311602.20401.cricketc () gmail ! com> X-MARC-Message: https://marc.info/?l=koffice-devel&m=124386180527140 On Sunday 31 May 2009 15:27:29 you wrote: > > + //now create real content/body writers & dump the information there > > + KoXmlWriter* realContentWriter = oasisStore.contentWriter(); > > + realContentWriter->addCompleteElement(&contentBuf); > > + KoXmlWriter* realBodyWriter = oasisStore.bodyWriter(); > > + realBodyWriter->addCompleteElement(&bodyBuf); > > > > Why is this copy needed? Can't you use the correct writers from the > > beginning? > > The code for KoOdfExporter mostly copied from based on > MSWordOdfImport::convert() and just abstracted. > > Perhaps the buffered writers for body and content are no longer needed > once we do not use QDom? Here are the comments that may say something, > from KoOdfExporter::save() (previously > fromMSWordOdfImport::createDocument()): > > //open contentWriter & bodyWriter *temp* writers > //so we can write picture files while we parse > > Or Benjamin, could you please give a hint on the purpose of using QBuffer > here? I was trying to remember why I did that. I think it was a problem I was having where I was trying to write the picture data file to the KoStore, and I kept getting errors doing it if the content writer was already open. Seems like KoStore didn't let me write any new files if the content/body writers were open at the same time. Hope that helps. -Benjamin _______________________________________________ koffice-devel mailing list koffice-devel@kde.org https://mail.kde.org/mailman/listinfo/koffice-devel