diff options
author | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-03-15 15:26:25 +0100 |
---|---|---|
committer | Philipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM> | 2011-03-15 15:26:25 +0100 |
commit | 7363d8a165443b6e8da150d193949e738daa9f05 (patch) | |
tree | cb7dafa4a7f2ade6517dec68bcdad77a7c9b4de9 /vcl/aqua | |
parent | da4071958ce368e1798987e665e442b9ab2c7c69 (diff) |
vcl120: #i117267# better paper matching
Diffstat (limited to 'vcl/aqua')
-rw-r--r-- | vcl/aqua/source/gdi/salprn.cxx | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx index a1d51376aa0b..ed80110cacc6 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -834,12 +834,24 @@ void AquaSalInfoPrinter::InitPaperFormats( const ImplJobSetup* i_pSetupData ) for( unsigned int i = 0; i < nPapers; i++ ) { NSString* pPaper = [pPaperNames objectAtIndex: i]; - NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper]; - if( aPaperSize.width > 0 && aPaperSize.height > 0 ) + // first try to match the name + rtl::OString aPaperName( [pPaper UTF8String] ); + Paper ePaper = PaperInfo::fromPSName( aPaperName ); + if( ePaper != PAPER_USER ) { - PaperInfo aInfo( PtTo10Mu( aPaperSize.width ), - PtTo10Mu( aPaperSize.height ) ); - m_aPaperFormats.push_back( aInfo ); + m_aPaperFormats.push_back( PaperInfo( ePaper ) ); + } + else + { + NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper]; + if( aPaperSize.width > 0 && aPaperSize.height > 0 ) + { + PaperInfo aInfo( PtTo10Mu( aPaperSize.width ), + PtTo10Mu( aPaperSize.height ) ); + if( aInfo.getPaper() == PAPER_USER ) + aInfo.doSloppyFit(); + m_aPaperFormats.push_back( aInfo ); + } } } } |