Changeset 10593 for trunk/src


Ignore:
Timestamp:
Apr 30, 2004, 3:25:59 PM (21 years ago)
Author:
sandervl
Message:

drawSingleLinePoint: wrong pen style checks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comdlg32/printdlg.c

    r10267 r10593  
    135135
    136136
    137 #ifdef __WIN32OS2__
    138 /***********************************************************************
    139  *   PrnNameToQueue
    140  *
    141  * Odin helper function that gets Queue Name from Printer Name
    142  *
    143  * Returns TRUE on success else FALSE
    144  */
    145 
    146 BOOL PrnNameToQueue(char* PrnName, char* QueueName)
    147 {
    148  BOOL rc = FALSE;
    149 
    150   if (PrnName && QueueName)
    151   {
    152     LPPRINTER_INFO_2A pi;
    153     DWORD needed, num;
    154     INT i;
    155 
    156     EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &needed, &num);
    157     pi = HeapAlloc(GetProcessHeap(), 0, needed);
    158     EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 2, (LPBYTE)pi, needed, &needed,
    159                   &num);
    160 
    161     for(i = 0; i < num; i++)
    162        if (!strcmp(pi[i].pComment, PrnName))
    163        {
    164          strcpy(QueueName, pi[i].pPrinterName);
    165          rc = TRUE;
    166        }
    167     HeapFree(GetProcessHeap(), 0, pi);
    168   }
    169   return rc;
    170 }
    171 #endif
    172 
    173137/***********************************************************************
    174138 *    PRINTDLG_GetDefaultPrinterName
     
    255219    INT i;
    256220    LPPRINTER_INFO_2A pi;
    257 #ifdef __WIN32OS2__
    258     char substName[260];
    259 #endif
    260221
    261222    EnumPrintersA(PRINTER_ENUM_LOCAL, NULL, 2, NULL, 0, &needed, &num);
     
    264225                  &num);
    265226
    266 #ifndef __WIN32OS2__
    267227    for(i = 0; i < num; i++) {
    268228        SendDlgItemMessageA(hDlg, id, CB_ADDSTRING, 0,
     
    270230    }
    271231    HeapFree(GetProcessHeap(), 0, pi);
    272 #else
    273     substName[0] = 0;
    274 
    275     for(i = 0; i < num; i++)
    276     {
    277         SendDlgItemMessageA(hDlg, id, CB_ADDSTRING, 0,
    278                             (LPARAM)pi[i].pComment );
    279         if (!name || !strcmp(pi[i].pPrinterName, name))
    280            strcpy(substName, pi[i].pComment);
    281     }
    282 #endif
    283232
    284233    if(!name ||
    285234       (i = SendDlgItemMessageA(hDlg, id, CB_FINDSTRINGEXACT, -1,
    286 #ifndef __WIN32OS2__
    287235                                (LPARAM)name)) == CB_ERR) {
    288 #else
    289                                 (LPARAM)substName)) == CB_ERR) {
    290 #endif
    291236        char buf[260];
    292237        FIXME("Can't find '%s' in printer list so trying to find default\n",
     
    294239        if(!PRINTDLG_GetDefaultPrinterNameA(buf, sizeof(buf)))
    295240            return num;
    296 #ifndef __WIN32OS2__
    297241        i = SendDlgItemMessageA(hDlg, id, CB_FINDSTRINGEXACT, -1, (LPARAM)buf);
    298 #else
    299         for(i = 0; i < num; i++)
    300            if (!strcmp(pi[i].pComment, buf))
    301               break;
    302         HeapFree(GetProcessHeap(), 0, pi);
    303 #endif
    304242
    305243        if(i == CB_ERR)
     
    11931131
    11941132        if (lppd->Flags & PD_USEDEVMODECOPIESANDCOLLATE) {
     1133#ifdef __WIN32OS2__
     1134            EnableWindow(GetDlgItem(hDlg, chx2), FALSE);
     1135            EnableWindow(GetDlgItem(hDlg, ico3), FALSE);
     1136            ShowWindow(GetDlgItem(hDlg, chx2), SW_HIDE);
     1137#else
    11951138          /* if printer doesn't support it: no Collate */
    11961139            if (!(lpdm->dmFields & DM_COLLATE)) {
     
    11981141                EnableWindow(GetDlgItem(hDlg, ico3), FALSE);
    11991142            }
     1143#endif
    12001144        }
    12011145
     
    13561300
    13571301        if (lppd->Flags & PD_USEDEVMODECOPIESANDCOLLATE) {
     1302#ifdef __WIN32OS2__
     1303            EnableWindow(GetDlgItem(hDlg, chx2), FALSE);
     1304            EnableWindow(GetDlgItem(hDlg, ico3), FALSE);
     1305            ShowWindow(GetDlgItem(hDlg, chx2), SW_HIDE);
     1306#else
    13581307          /* if printer doesn't support it: no Collate */
    13591308            if (!(lpdm->dmFields & DM_COLLATE)) {
     
    13611310                EnableWindow(GetDlgItem(hDlg, ico3), FALSE);
    13621311            }
     1312#endif
    13631313        }
    13641314
     
    15071457        name = HeapAlloc(GetProcessHeap(),0,256);
    15081458        if (GetDlgItemTextA(hDlg, comboID, name, 255))
    1509 #ifdef __WIN32OS2__
    1510             PrnNameToQueue(name, name);
    1511 #endif
    15121459            PRINTDLG_ChangePrinterA(hDlg, name, PrintStructures);
    15131460        HeapFree(GetProcessHeap(),0,name);
     
    15161463        char name[200];
    15171464        BOOL ret = PRINTDLG_GetDefaultPrinterNameA(name, sizeof(name));
    1518 #ifdef __WIN32OS2__
    1519         PrnNameToQueue(name, name);
    1520 #endif
    15211465        if (ret)
    15221466            PRINTDLG_ChangePrinterA(hDlg, name, PrintStructures);
     
    18081752
    18091753    case edt3:
     1754#ifndef __WIN32OS2__
    18101755        if(HIWORD(wParam) == EN_CHANGE) {
    18111756            INT copies = GetDlgItemInt(hDlg, edt3, NULL, FALSE);
     
    18151760                EnableWindow(GetDlgItem(hDlg, chx2), TRUE);
    18161761        }
     1762#endif
    18171763        break;
    18181764
     
    18421788
    18431789         GetDlgItemTextA(hDlg, PrinterComboID, PrinterName, 255);
    1844 #ifdef __WIN32OS2__
    1845          PrnNameToQueue(PrinterName, PrinterName);
    1846 #endif
    18471790         if (!OpenPrinterA(PrinterName, &hPrinter, NULL)) {
    18481791             FIXME(" Call to OpenPrinter did not succeed!\n");
     
    18911834             char   PrinterName[256];
    18921835             GetDlgItemTextA(hDlg, LOWORD(wParam), PrinterName, 255);
    1893 #ifdef __WIN32OS2__
    1894              PrnNameToQueue(PrinterName, PrinterName);
    1895 #endif
    18961836             PRINTDLG_ChangePrinterA(hDlg, PrinterName, PrintStructures);
    18971837         }
     
    19981938
    19991939    case edt3:
     1940#ifndef __WIN32OS2__
    20001941        if(HIWORD(wParam) == EN_CHANGE) {
    20011942            INT copies = GetDlgItemInt(hDlg, edt3, NULL, FALSE);
     
    20051946                EnableWindow(GetDlgItem(hDlg, chx2), TRUE);
    20061947        }
     1948#endif
    20071949        break;
    20081950
     
    21372079        res = PRINTDLG_WMInitDialog(hDlg, wParam, PrintStructures);
    21382080
    2139         if(PrintStructures->dlg.lpPrintDlg->Flags & PD_ENABLEPRINTHOOK)
     2081        if(PrintStructures->dlg.lpPrintDlg->Flags & PD_ENABLEPRINTHOOK) {
    21402082            res = PrintStructures->dlg.lpPrintDlg->lpfnPrintHook(
    21412083                hDlg, uMsg, wParam, (LPARAM)PrintStructures->dlg.lpPrintDlg
    21422084            );
     2085#ifdef __WIN32OS2__
     2086            EnableWindow(GetDlgItem(hDlg, chx2), FALSE);
     2087            EnableWindow(GetDlgItem(hDlg, ico3), FALSE);
     2088            ShowWindow(GetDlgItem(hDlg, chx2), SW_HIDE);
     2089#endif
     2090        }
    21432091        return res;
    21442092    }
     
    21822130
    21832131        if(PrintStructures->dlg.lpPrintDlg->Flags & PD_ENABLEPRINTHOOK)
     2132        {
    21842133            res = PrintStructures->dlg.lpPrintDlg->lpfnPrintHook(
    21852134                hDlg, uMsg, wParam, (LPARAM)PrintStructures->dlg.lpPrintDlg
    21862135            );
     2136#ifdef __WIN32OS2__
     2137            EnableWindow(GetDlgItem(hDlg, chx2), FALSE);
     2138            EnableWindow(GetDlgItem(hDlg, ico3), FALSE);
     2139            ShowWindow(GetDlgItem(hDlg, chx2), SW_HIDE);
     2140#endif
     2141        }
    21872142        return res;
    21882143    }
Note: See TracChangeset for help on using the changeset viewer.