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 | |
parent | da4071958ce368e1798987e665e442b9ab2c7c69 (diff) |
vcl120: #i117267# better paper matching
-rw-r--r-- | i18npool/source/paper/paper.cxx | 2 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salprn.cxx | 22 | ||||
-rwxr-xr-x | vcl/source/window/printdlg.cxx | 1 |
3 files changed, 19 insertions, 6 deletions
diff --git a/i18npool/source/paper/paper.cxx b/i18npool/source/paper/paper.cxx index 0d9235747fd6..aaac0e83a4eb 100644 --- a/i18npool/source/paper/paper.cxx +++ b/i18npool/source/paper/paper.cxx @@ -159,7 +159,7 @@ static PageDesc aDinTab[] = static const size_t nTabSize = sizeof(aDinTab) / sizeof(aDinTab[0]); -#define MAXSLOPPY 11 +#define MAXSLOPPY 21 bool PaperInfo::doSloppyFit() { 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 ); + } } } } diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 98e93e748737..d38128e04f1e 100755 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -2107,6 +2107,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() ); // update text fields updatePrinterText(); + preparePreview( true, false ); } else if( pBox == &maNUpPage.maNupOrientationBox || pBox == &maNUpPage.maNupOrderBox ) { |