Changeset 208 for trunk/src/plugins


Ignore:
Timestamp:
Oct 17, 2009, 2:42:39 AM (16 years ago)
Author:
lpino
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/plugins/org.eclipse.swt/Eclipse SWT/pm/org/eclipse/swt/widgets/FontDialog.java

    r14 r208  
    119119         fontDlg.cbSize = FONTDLG.sizeof;
    120120         //Init from FATTRS
    121          fontDlg.fl = OS.FNTS_CENTER|OS.FNTS_INITFROMFATTRS;
     121         fontDlg.fl = OS.FNTS_CENTER;
    122122         //Size fontname buffer
    123123         fontDlg.usFamilyBufLen = OS.FACESIZE;
     124         
    124125         //Fontname buffer
    125126         byte[] szCurrentFont = new byte[OS.FACESIZE];
    126          byte[] buffer = fontData.getName().getBytes();
    127          for(int i=0;i<buffer.length&&i<szCurrentFont.length;i++)
    128              szCurrentFont[i] = buffer[i];
     127         
     128         if (fontData != null) {
     129                 fontDlg.fl |= OS.FNTS_INITFROMFATTRS;
     130                 byte[] buffer = fontData.getName().getBytes();
     131                 for(int i=0;i<buffer.length&&i<szCurrentFont.length;i++)
     132                     szCurrentFont[i] = buffer[i];
     133                 fontDlg.fAttrs = fontData.getFAttrs();
     134         } else {
     135                 szCurrentFont[0] = ' ';
     136         }
    129137         fontDlg.pszFamilyname = new PSZ(szCurrentFont);
    130138         //Foreground color
     
    136144         //Text shown in the preview area
    137145         fontDlg.pszPreview = new PSZ("Eclipse/2");
    138          if (fontData != null) {
    139                  fontDlg.fAttrs = fontData.getFAttrs();
    140          }
    141146         int rc = OS.WinFontDlg(OS.HWND_DESKTOP, hwndOwner, fontDlg);
    142147         if(fontDlg.lReturn == OS.DID_OK){
Note: See TracChangeset for help on using the changeset viewer.