summaryrefslogtreecommitdiff
path: root/vcl/unx/source/gdi/salprnpsp.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/source/gdi/salprnpsp.cxx')
-rw-r--r--vcl/unx/source/gdi/salprnpsp.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx
index 3491622f783c..90c6a196143e 100644
--- a/vcl/unx/source/gdi/salprnpsp.cxx
+++ b/vcl/unx/source/gdi/salprnpsp.cxx
@@ -694,6 +694,18 @@ BOOL PspSalInfoPrinter::SetData(
pKey = aData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) );
pValue = pKey ? pKey->getValueCaseInsensitive( aPaper ) : NULL;
+
+ // some PPD files do not specify the standard paper names (e.g. C5 instead of EnvC5)
+ // try to find the correct paper anyway using the size
+ if( pKey && ! pValue && pJobSetup->mePaperFormat != PAPER_USER )
+ {
+ PaperInfo aInfo( pJobSetup->mePaperFormat );
+ aPaper = aData.m_pParser->matchPaper(
+ TenMuToPt( aInfo.getWidth() ),
+ TenMuToPt( aInfo.getHeight() ) );
+ pValue = pKey->getValueCaseInsensitive( aPaper );
+ }
+
if( ! ( pKey && pValue && aData.m_aContext.setValue( pKey, pValue, false ) == pValue ) )
return FALSE;
}