Save the state of printdir codec dependent method.

This commit is contained in:
Andrey Kiselev 2006-10-12 18:11:30 +00:00
parent 7ddafe6c10
commit 481b53b4e1

View File

@ -1,4 +1,4 @@
/* $Id: tif_fax3.c,v 1.42 2006-09-28 16:26:03 dron Exp $ */
/* $Id: tif_fax3.c,v 1.43 2006-10-12 18:11:30 dron Exp $ */
/*
* Copyright (c) 1990-1997 Sam Leffler
@ -63,6 +63,7 @@ typedef struct {
char* faxdcs; /* Table 2/T.30 encoded session params */
TIFFVGetMethod vgetparent; /* super-class method */
TIFFVSetMethod vsetparent; /* super-class method */
TIFFPrintMethod printdir; /* super-class method */
} Fax3BaseState;
#define Fax3State(tif) ((Fax3BaseState*) (tif)->tif_data)
@ -1076,6 +1077,7 @@ Fax3Cleanup(TIFF* tif)
tif->tif_tagmethods.vgetfield = sp->b.vgetparent;
tif->tif_tagmethods.vsetfield = sp->b.vsetparent;
tif->tif_tagmethods.printdir = sp->b.printdir;
if (sp->runs)
_TIFFfree(sp->runs);
@ -1199,6 +1201,8 @@ Fax3VGetField(TIFF* tif, ttag_t tag, va_list ap)
{
Fax3BaseState* sp = Fax3State(tif);
assert(sp != 0);
switch (tag) {
case TIFFTAG_FAXMODE:
*va_arg(ap, int*) = sp->mode;
@ -1242,6 +1246,8 @@ Fax3PrintDir(TIFF* tif, FILE* fd, long flags)
{
Fax3BaseState* sp = Fax3State(tif);
assert(sp != 0);
(void) flags;
if (TIFFFieldSet(tif,FIELD_OPTIONS)) {
const char* sep = " ";
@ -1326,6 +1332,7 @@ InitCCITTFax3(TIFF* tif)
tif->tif_tagmethods.vgetfield = Fax3VGetField; /* hook for codec tags */
sp->vsetparent = tif->tif_tagmethods.vsetfield;
tif->tif_tagmethods.vsetfield = Fax3VSetField; /* hook for codec tags */
sp->printdir = tif->tif_tagmethods.printdir;
tif->tif_tagmethods.printdir = Fax3PrintDir; /* hook for codec tags */
sp->groupoptions = 0;
sp->recvparams = 0;