KoXmlWriter::addCompleteElement leaves device open
t.zachmann at zagge.de
Sat Feb 5 05:21:31 CET 2011
On Friday, February 04, 2011 23:17:57 David Faure wrote:
> I was surprised that the following code (which I'm working on for the
> applix filter) ...
> bodyWriter->addAttribute("text:style-name", autoStyleName);
> bodyWriter->endElement(); // text:p
> ... would fail in QBuffer::setData with "can't do that while the buffer is
> Turns out that addCompleteElement opens the iodevice, but doesn't close it
> afterwards -- blame me, I wrote that code long ago ;)
> Can I commit the attached patch?
> I had a look at the existing callers of addCompleteElement (some of them --
> there are many many more than I thought there would be!), and it seems to
> be always a one-time buffer. And if it was reused, then a second close()
> won't hurt.
More information about the calligra-devel