Karl's kinda busy and it's a pain to mess with the printer, maybe someone else can test the patch? But it looks good to me. One thing that would be nice, instead of the mPaperSizeWorkaround variable, just always copy mGtkPageSetup and mGTKPrintSettings so we can unref them unconditionally in EndDocument or better still the nsDeviceContextSpecGTK destructor. Similarly we could always make a copy of the paper size so we can always free it in the destructor.
Karl's kinda busy and it's a pain to mess with the printer, maybe someone else can test the patch? But it looks good to me. One thing that would be nice, instead of the mPaperSizeWorka round variable, just always copy mGtkPageSetup and mGTKPrintSettings so we can unref them unconditionally in EndDocument or better still the nsDeviceContext SpecGTK destructor. Similarly we could always make a copy of the paper size so we can always free it in the destructor.