Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 189608 Details for
Bug 337987
Javascript error if multi text contains the unicode character 2028
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
0001-337987-Javascript-error-if-multi-text-contains-the-u.patch (text/plain), 4.75 KB, created by
Istvan Ballok
on 2011-02-23 10:53:56 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Istvan Ballok
Created:
2011-02-23 10:53:56 EST
Size:
4.75 KB
patch
obsolete
>From 8b9f873d9f66a8afb41839f2ca1b66b1c2924aa2 Mon Sep 17 00:00:00 2001 >From: Istvan Ballok <Istvan.Ballok@cas.de> >Date: Wed, 23 Feb 2011 16:53:17 +0100 >Subject: [PATCH] 337987 Javascript error if multi text contains the unicode character 2028 > >resolution: use the TextLCAUtil.writeText() method in all 3 Text LCAs. > that method performs the necessary string transformations. > >note: to preserve the behaviour of replacing new line characters with a > space, a boolean replaceNewLines parameter was added to > TextLCAUtil.writeText, and the 3 calls were adjusted appropriately >--- > .../swt/internal/widgets/textkit/MultiTextLCA.java | 3 +-- > .../internal/widgets/textkit/PasswordTextLCA.java | 2 +- > .../internal/widgets/textkit/SingleTextLCA.java | 2 +- > .../swt/internal/widgets/textkit/TextLCAUtil.java | 7 +++++-- > 4 files changed, 8 insertions(+), 6 deletions(-) > >diff --git a/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/MultiTextLCA.java b/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/MultiTextLCA.java >index ce6e816..b151a3f 100644 >--- a/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/MultiTextLCA.java >+++ b/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/MultiTextLCA.java >@@ -50,9 +50,8 @@ final class MultiTextLCA extends AbstractTextDelegateLCA { > } > > void renderChanges( final Text text ) throws IOException { >- JSWriter writer = JSWriter.getWriterFor( text ); > ControlLCAUtil.writeChanges( text ); >- writer.set( TextLCAUtil.PROP_TEXT, "value", text.getText(), "" ); >+ TextLCAUtil.writeText( text, false ); > TextLCAUtil.writeReadOnly( text ); > TextLCAUtil.writeSelection( text ); > TextLCAUtil.writeTextLimit( text ); >diff --git a/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/PasswordTextLCA.java b/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/PasswordTextLCA.java >index f6ce002..4e3a1a5 100644 >--- a/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/PasswordTextLCA.java >+++ b/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/PasswordTextLCA.java >@@ -51,7 +51,7 @@ final class PasswordTextLCA extends AbstractTextDelegateLCA { > void renderChanges( final Text text ) throws IOException { > ControlLCAUtil.writeChanges( text ); > TextLCAUtil.writePasswordMode( text ); >- TextLCAUtil.writeText( text ); >+ TextLCAUtil.writeText( text, true ); > TextLCAUtil.writeReadOnly( text ); > TextLCAUtil.writeSelection( text ); > TextLCAUtil.writeTextLimit( text ); >diff --git a/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/SingleTextLCA.java b/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/SingleTextLCA.java >index 3506988..99c4f8a 100644 >--- a/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/SingleTextLCA.java >+++ b/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/SingleTextLCA.java >@@ -59,7 +59,7 @@ final class SingleTextLCA extends AbstractTextDelegateLCA { > void renderChanges( final Text text ) throws IOException { > ControlLCAUtil.writeChanges( text ); > TextLCAUtil.writePasswordMode( text ); >- TextLCAUtil.writeText( text ); >+ TextLCAUtil.writeText( text, true ); > TextLCAUtil.writeReadOnly( text ); > TextLCAUtil.writeSelection( text ); > TextLCAUtil.writeTextLimit( text ); >diff --git a/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/TextLCAUtil.java b/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/TextLCAUtil.java >index 1e9b0aa..f63989b 100644 >--- a/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/TextLCAUtil.java >+++ b/runtime.rwt/org.eclipse.rap.rwt.q07/src/org/eclipse/swt/internal/widgets/textkit/TextLCAUtil.java >@@ -111,11 +111,14 @@ final class TextLCAUtil { > new Object[] { text } ); > } > >- static void writeText( final Text text ) throws IOException { >+ static void writeText( final Text text, boolean replaceNewLines ) throws IOException { > String newValue = text.getText(); > JSWriter writer = JSWriter.getWriterFor( text ); > if( WidgetLCAUtil.hasChanged( text, PROP_TEXT, newValue, "" ) ) { >- String value = WidgetLCAUtil.replaceNewLines( newValue, " " ); >+ String value = newValue; >+ if (replaceNewLines) { >+ value = WidgetLCAUtil.replaceNewLines( newValue, " " ); >+ } > value = EncodingUtil.removeNonDisplayableChars( value ); > value = EncodingUtil.truncateAtZero( value ); > writer.set( JS_PROP_VALUE, value ); >-- >1.7.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 337987
: 189608