Reduce duplicate code: PrinterJob::writeProlog

Chr. Rossmanith ChrRossmanith at gmx.de
Fri Mar 2 12:03:21 PST 2012


Hi,

static const sal_Char pProlog[] and static const sal_Char 
pSO52CompatProlog[] share about 90% of their content (2 out of 84 lines 
differ). I could split the prolog in three parts: part 1 and 3 identical 
for both variables and part 2 varies with 
m_pGraphics->getStrictSO52Compatibility()

This is where the prologs are used:
     WritePS (pFile, m_pGraphics && 
m_pGraphics->getStrictSO52Compatibility() ? pSO52CompatProlog : pProlog);

Any arguments against that approach? It would need 3 instead of 1 call 
to WritePS...

Christina


More information about the LibreOffice mailing list