]> git.saurik.com Git - wxWidgets.git/commitdiff
applied patch that fixes paper size handling under MSW and sets PD_SELECTION correctly
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 15 May 2001 22:04:27 +0000 (22:04 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 15 May 2001 22:04:27 +0000 (22:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10168 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/cmndata.cpp

index 741840dc8a1fe179ab3943e73d1b0a1b9ccc652f..de57dda478225b0e3bcbb3d0a2d1008333a8db88 100644 (file)
@@ -589,7 +589,11 @@ void wxPrintData::ConvertFromNative()
 #ifndef __WXWINE__
         //// Paper size
 
-        if (devMode->dmFields & DM_PAPERSIZE)
+        // We don't know size of user defined paper and some buggy drivers
+        // set both DM_PAPERSIZE and DM_PAPERWIDTH & DM_PAPERLENGTH. Since
+        // dmPaperSize >= DMPAPER_USER wouldn't be in wxWin's database, this
+        // code wouldn't set m_paperSize correctly.
+        if ((devMode->dmFields & DM_PAPERSIZE) && (devMode->dmPaperSize < DMPAPER_USER))
         {
             if (wxThePrintPaperDatabase)
             {
@@ -942,7 +946,7 @@ void wxPrintDialogData::ConvertToNative()
 
     if ( m_printAllPages )
         pd->Flags |= PD_ALLPAGES;
-    if ( m_printAllPages )
+    if ( m_printSelection )
         pd->Flags |= PD_SELECTION;
     if ( m_printCollate )
         pd->Flags |= PD_COLLATE;