[Libreoffice] vcl/unx: remove duplicate printer code

Caolán McNamara caolanm at redhat.com
Fri Dec 17 02:22:19 PST 2010


On Wed, 2010-12-15 at 19:58 +0100, Joachim wrote:
> Hi,
> 
> I have found some duplicate classes between vcl/unx and 
> vcl/unx/headless; PspSalInfoPrinter and PspSalPrinter.
> As suggested by Caolàn, the attached patch removes these two classes 
> from vcl/unx/headless
> 
> - The following removed methods were not strictly identical to the 
> existing:
> BOOL PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
> void vcl_sal::PrinterUpdate::doUpdate()
> void vcl_sal::PrinterUpdate::update()

Hmm, I don't think that's going to fly. They are different, and need to
be different seeing as one pumps the events into the X11 event loop and
the headless one doesn't have such a loop.

We could, in general, rename PspSalInfoPrinter to SvpSalInfoPrinter and
PspSalPrinter to SvpSalPrinter inside the headless module. And now
inherit SvpSalInfoPrinter from PspSalInfoPrinter and SvpSalPrinter from
PspSalPrinter and retain the methods that are different, and remove the
Svp method variants that are the same as the parent class.

> - libvclplug_svpxl.so generated by vcl/unx/headless is now indirectly 
> linked with X11, something probably not desired for a headless library.

Well, that's not a problem really, in practice it all needs libX11
anyway. What is a problem however is that there are two different
vcl_sal::PrinterUpdate so that needs to be retweaked to be something
that can be different per vclplug.

Let me poke at this a bit and see if I can reorganize it to make it easy
to do this.

C.



More information about the LibreOffice mailing list