Changeset 1391 for trunk/dll/codepage.c


Ignore:
Timestamp:
Jan 12, 2009, 12:55:53 AM (17 years ago)
Author:
Gregg Young
Message:

Move nontranslated strings to init.c and codepage.c; use those strings in place of GetPString calls. Move other strings to a StringTable; minor cleanup and code changes to codepage.c to use a string array instead of GetPString calls. Ticket 340

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/codepage.c

    r1346 r1391  
    1111  14 Jul 06 SHL Use Runtime_Error
    1212  20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
     13  11 Jan 09 GKY Moved codepage names to a character array here from the string file.
    1314
    1415***********************************************************************/
     
    3536
    3637static PSZ pszSrcFile = __FILE__;
     38static CHAR *CodePage[23] = {"437 USA",
     39"850 Multilingual",
     40"852 Latin 2",
     41"857 Turkish",
     42"860 Portuguese",
     43"861 Iceland",
     44"863 French-Canadian",
     45"865 Nordic",
     46"866 Russian OS/2",
     47"878 Russian KOI8-R",
     48"932 Japan",
     49"934 Korea",
     50"936 China",
     51"938 Taiwan",
     52"942 Japan SAA",
     53"944 Korea SAA",
     54"946 China SAA",
     55"948 Taiwan SAA",
     56"949 Korea KS",
     57"950 Taiwan (Big 5)",
     58"1004 DTP/Win",
     59"1251 Russian Win",
     60"1381 China GB"};
    3761
    3862MRESULT EXPENTRY PickCodePageDlgBox(HWND hwnd, ULONG msg, MPARAM mp1,
     
    5074
    5175      cp = WinQueryCp(WinQueryWindowULong(hwnd, QWL_HMQ));
    52       for (sSelect = 0;
    53            (p = GetPString(IDS_CODEPAGES1 + sSelect)) != NULL; sSelect++) {
    54         if (!strcmp(p, "0"))
    55           break;
     76      for (sSelect = 0; sSelect < 23; sSelect++) {
     77        p = CodePage[sSelect];
    5678        WinSendDlgItemMsg(hwnd,
    5779                          PICK_LISTBOX,
     
    127149                                             MPFROMSHORT(LIT_FIRST), MPVOID);
    128150        if (sSelect >= 0)
    129           WinSetDlgItemText(hwnd,
    130                             PICK_INPUT, GetPString(IDS_CODEPAGES1 + sSelect));
     151          WinSetDlgItemText(hwnd, PICK_INPUT, CodePage[sSelect]);
    131152        break;
    132153      case LN_ENTER:
     
    150171          Runtime_Error(pszSrcFile, __LINE__, "no input");
    151172        else {
    152           for (x = 0; (p = GetPString(IDS_CODEPAGES1 + x)) != NULL; x++) {
     173          for (x = 0; x < 23; x++) {
     174            p = CodePage[x];
    153175            if (!stricmp(s, p)) {
    154176              WinDismissDlg(hwnd, atoi(p));
Note: See TracChangeset for help on using the changeset viewer.