[poppler] Patch: New additions in FileSpec
srinivas adicherla
srinivas.adicherla at gmail.com
Wed Apr 6 23:58:26 PDT 2011
Hi Pino
I am sorry to say about my previous patch. Thank you for your
patience suggestions. This time I sent a new patch with all those changes.
instead of filename i gave fsName (filespecName). Some how I miss that
delete(filename) which included in the patch, yes you are correct we don't
have to delete this otherwise it won't set it.
Thanks
--
A Srinivas
On Thu, Apr 7, 2011 at 12:30 AM, <poppler-request at lists.freedesktop.org>wrote:
> Send poppler mailing list submissions to
> poppler at lists.freedesktop.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.freedesktop.org/mailman/listinfo/poppler
> or, via email, send a message with subject or body 'help' to
> poppler-request at lists.freedesktop.org
>
> You can reach the person managing the list at
> poppler-owner at lists.freedesktop.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of poppler digest..."
>
>
> Today's Topics:
>
> 1. Re: Patch: New additions in FileSpec (Pino Toscano)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 6 Apr 2011 12:28:26 +0200
> From: Pino Toscano <pino at kde.org>
> Subject: Re: [poppler] Patch: New additions in FileSpec
> To: poppler at lists.freedesktop.org
> Message-ID: <201104061228.26995.pino at kde.org>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
> Alle mercoled? 6 aprile 2011, srinivas adicherla ha scritto:
> > For i/o checks for fseek() and ftell(),
> > here we don't have to check for 10 bytes.
>
> The point is: I/O can fail, and you have to check for it.
>
> > +static GBool getFileSpecObject(XRef *xref, Stream *stream, const
> > char* fileName, Object *obj)
> > +{
> > + Object fileSpec, obj1, obj2;
> > + int length;
> > +
> > + GooString *filename = new GooString(fileName);
>
> Please give it a slightly different name, otherwise it is easy to
> misread filename and fileName.
>
> > + char *fileNameUTF16 = pdfDocEncodingToUTF16(filename, &length);
> > +
> > + fileSpec.initDict(xref);
> > + fileSpec.dictSet("Type", obj1.initName("Filespec"));
> > + fileSpec.dictSet("F", obj1.initString(filename));
> > + fileSpec.dictSet("UF", obj1.initString(new
> > GooString(fileNameUTF16, length)));
> > +
> > + delete []fileNameUTF16;
> > + delete(filename);
>
> no, obj1.initString(filename) already takes ownership of filename, so
> you don't delete it.
>
> > +GBool createFilespec (XRef *xref, GooString *filePathA, Object *obj)
>
> "FileSpec", not "Filespec"
>
> > +{
> > [...]
> > + if (!(size = ftell(fs)))
> > + return gFalse;
>
> no, any return value >= 0 means success, while -1 means error.
> also, you miss the error() call for ftell() failure
>
> > + // Extract the video name from the file uri
>
> again video name?!
>
> srinivas, let's be frank now: do you ever *read* your patches, or you
> just do some partially untested changes, rediff and send?
>
> --
> Pino Toscano
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 190 bytes
> Desc: This is a digitally signed message part.
> URL: <
> http://lists.freedesktop.org/archives/poppler/attachments/20110406/fb1a817d/attachment-0001.pgp
> >
>
> ------------------------------
>
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
>
>
> End of poppler Digest, Vol 74, Issue 11
> ***************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20110407/a310a4f2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: srinivas_filespec.patch
Type: text/x-patch
Size: 2975 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20110407/a310a4f2/attachment.bin>
More information about the poppler
mailing list