summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2011-03-15 15:26:25 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2011-03-15 15:26:25 +0100
commit7363d8a165443b6e8da150d193949e738daa9f05 (patch)
treecb7dafa4a7f2ade6517dec68bcdad77a7c9b4de9 /vcl
parentda4071958ce368e1798987e665e442b9ab2c7c69 (diff)
vcl120: #i117267# better paper matching
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/source/gdi/salprn.cxx22
-rwxr-xr-xvcl/source/window/printdlg.cxx1
2 files changed, 18 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 );
+ }
}
}
}
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 )
{