1. mst
  2. ooo340

Commits

Philipp Lohmann [pl]  committed 2e3e556

vcl120: #i117267# better paper matching

  • Participants
  • Parent commits a816723
  • Branches default

Comments (0)

Files changed (3)

File i18npool/source/paper/paper.cxx

View file
  • Ignore whitespace
 
 static const size_t nTabSize = sizeof(aDinTab) / sizeof(aDinTab[0]);
 
-#define MAXSLOPPY 11
+#define MAXSLOPPY 21
 
 bool PaperInfo::doSloppyFit()
 {

File vcl/aqua/source/gdi/salprn.cxx

View file
  • Ignore whitespace
                 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 );
+                        }
                     }
                 }
             }

File vcl/source/window/printdlg.cxx

View file
  • Ignore whitespace
         maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() );
         // update text fields
         updatePrinterText();
+        preparePreview( true, false );
     }
     else if( pBox == &maNUpPage.maNupOrientationBox || pBox == &maNUpPage.maNupOrderBox )
     {