[poppler] [big patch] Document attachment support
Albert Astals Cid
aacid at kde.org
Sun Jan 1 12:00:17 PST 2006
A Dijous 29 Desembre 2005 10:32, Brad Hards va escriure:
> The attached patch is a refined version of the patch I originally posted in
> August. This version properly supports the description element and has
> decent unit tests. I'll commit the test cases soon. Feedback appreciated.
Having a second look at the patch, do you really need to iterate twice over
the stream in EmbeddedFile::data? I mean, QByteArray is able of growing
dinamically so why not just using
QByteArray EmbeddedFile::data() const
{
QByteArray fileArray;
m_streamData->reset();
int dataLen = 0;
char c;
while (EOF != (c = m_streamData->getChar())) {
fileArray.append(c);
dataLen++;
}
fileArray.resize(dataLen);
return fileArray;
};
I'm not even sure we need the final resize, but that loop seems more
performant to me.
Albert
>
> Right now there are only qt4 bindings, and while it works, it doesn't feel
> quite right yet (valgrind tells me there is a couple of huge memory leaks).
> There is an easier way - just copy the whole file out on initialisation,
> however this will slow down the startup parsing for every file with
> attachments, so I don't want to do that.
>
> Can the glib experts give this some thought, and describe what sort of API
> will work for them?
>
> For the kpdf/kviewshell guys, can you have a look at the current Qt4 API
> and provide feedback?
>
> Leonard: in your original review, you suggested that there was a variation
> on this that dates back to PDF1.2. Do you have an example?
>
> Brad
______________________________________________
Renovamos el Correo Yahoo!
Nuevos servicios, más seguridad
http://correo.yahoo.es
More information about the poppler
mailing list