Reduce duplicate code: PrinterJob::writeProlog

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


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 

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...


More information about the LibreOffice mailing list