Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 334509
Collapse All | Expand All

(-)src/org/eclipse/swt/internal/widgets/canvaskit/GCOperationWriter.java (-6 / +7 lines)
Lines 185-191 Link Here
185
    String result = WidgetLCAUtil.escapeText( text, drawMnemonic );
185
    String result = WidgetLCAUtil.escapeText( text, drawMnemonic );
186
    String replacement = "";
186
    String replacement = "";
187
    if( ( flags & SWT.DRAW_DELIMITER ) != 0 ) {
187
    if( ( flags & SWT.DRAW_DELIMITER ) != 0 ) {
188
      replacement = "</br>";
188
      replacement = "<br/>";
189
    }
189
    }
190
    result = EncodingUtil.replaceNewLines( result, replacement );
190
    result = EncodingUtil.replaceNewLines( result, replacement );
191
    replacement = "";
191
    replacement = "";
Lines 198-204 Link Here
198
198
199
  private void setProperty( final SetProperty operation ) throws IOException {
199
  private void setProperty( final SetProperty operation ) throws IOException {
200
    JSWriter writer = JSWriter.getWriterFor( control );
200
    JSWriter writer = JSWriter.getWriterFor( control );
201
    String jsProperty = null;
201
    String jsProperty;
202
    switch( operation.id ) {
202
    switch( operation.id ) {
203
      case SetProperty.FOREGROUND:
203
      case SetProperty.FOREGROUND:
204
        jsProperty = "foreground";
204
        jsProperty = "foreground";
Lines 218-228 Link Here
218
      case SetProperty.LINE_JOIN:
218
      case SetProperty.LINE_JOIN:
219
        jsProperty = "lineJoin";
219
        jsProperty = "lineJoin";
220
      break;
220
      break;
221
      default:
222
        String msg = "Unsupported operation id: " + operation.id;
223
        throw new RuntimeException( msg );
221
    }
224
    }
222
    if( jsProperty != null ) {
225
    Object[] args = new Object[] { jsProperty, operation.value };
223
      Object[] args = new Object[] { jsProperty, operation.value };
226
    writer.call( GC_VAR, "setProperty", args );
224
      writer.call( GC_VAR, "setProperty", args );
225
    }
226
  }
227
  }
227
228
228
  private void setFont( final SetFont operation ) throws IOException {
229
  private void setFont( final SetFont operation ) throws IOException {
(-)src/org/eclipse/swt/internal/widgets/canvaskit/GCOperationWriter_Test.java (-2 / +2 lines)
Lines 19-31 Link Here
19
    String text = "text with \ttab, \nnew line and &mnemonic";
19
    String text = "text with \ttab, \nnew line and &mnemonic";
20
    int flags = SWT.DRAW_TAB | SWT.DRAW_DELIMITER | SWT.DRAW_MNEMONIC;
20
    int flags = SWT.DRAW_TAB | SWT.DRAW_DELIMITER | SWT.DRAW_MNEMONIC;
21
    String expected
21
    String expected
22
      = "text with &nbsp;&nbsp;&nbsp;&nbsp;tab, </br>new line and mnemonic";
22
      = "text with &nbsp;&nbsp;&nbsp;&nbsp;tab, <br/>new line and mnemonic";
23
    String result = GCOperationWriter.processText( text, flags );
23
    String result = GCOperationWriter.processText( text, flags );
24
    assertEquals( expected, result );
24
    assertEquals( expected, result );
25
25
26
    flags = SWT.DRAW_TAB | SWT.DRAW_DELIMITER;
26
    flags = SWT.DRAW_TAB | SWT.DRAW_DELIMITER;
27
    expected
27
    expected
28
      = "text with &nbsp;&nbsp;&nbsp;&nbsp;tab, </br>new line and &amp;mnemonic";
28
      = "text with &nbsp;&nbsp;&nbsp;&nbsp;tab, <br/>new line and &amp;mnemonic";
29
    result = GCOperationWriter.processText( text, flags );
29
    result = GCOperationWriter.processText( text, flags );
30
    assertEquals( expected, result );
30
    assertEquals( expected, result );
31
31

Return to bug 334509