Community
Participate
Working Groups
The anchor inside a Link with mixed directional text can be split into two parts by Bidi reordering. In this case the clickable area extends from the furthest left point of the anchor to the furthest right point, including intervening text which should not be part of the anchor. Example: myLink.setText("\u05d1\u05e7\u05e8 \u05d1-<A HREF=\"www.eclipse.org\">\u05d0\u05ea\u05e8 \u05e9\u05dc Eclipse.org</A> project.");
Created attachment 24302 [details] The example link with LEFT_TO_RIGHT orientation
Created attachment 24303 [details] The example link with RIGHT_TO_LEFT orientation
Created attachment 24617 [details] results When running with the manifest the results are very different, not sure I can fix it. See the attachment, on top I've a fixed version of the emulated link and on the bottom the native syslink. Are the results right ?
I don't understand the implications of "running with the manifest", but the top two images in attachment 24617 [details] are what I consider to be the correct results.
Run with the manifest: http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt- home/faq.html#xpthemes
*** Bug 118431 has been marked as a duplicate of this bug. ***
Simoen, can I have the text you were using in Bug 118431 ? Please, encoded it as java literal (see comment 1). thanks.
Please: link1.setText("Visit \u05de\u05d1\u05e7\u05e8 <A HREF=\"www.eclipse.org\">123 \u05d0\u05d1\u05d2 ABC.</A> project and the <A HREF=\"www.eclipse.org\\swt\">\u05d0\u05d1\u05d1 ABC 123.</A> homepage.");
BTW, what do you think about addidng all bidi markers as constant into SWT class?
Code from bug 118431 is not good. Here is the better solution: ... int parseMnemonics (char[] buffer, int start, int end, StringBuffer result) { int mnemonic = -1, index = start; boolean isMarkerUsed = OS.COMCTL32_MAJOR < 6? false : true; //bidi while (index < end) { if (buffer [index] == '&') { if (index + 1 < end && buffer [index + 1] == '&') { if (!isMarkerUsed) //bidi isMarkerUsed = checkMarker(result); //bidi result.append (buffer [index]); index++; } else { mnemonic = result.length(); } } else { if (!isMarkerUsed) //bidi isMarkerUsed = checkMarker(result); //bidi result.append (buffer [index]); } index++; } return mnemonic; } boolean checkMarker(StringBuffer result){ //bidi start if ((getStyle() & SWT.RIGHT_TO_LEFT)!= 0) result.append('\u200f'); //RLM else result.append('\u200e'); //LRM return true; } //bidi end ...
See Bug 223336 The fix proposed in this bug, which is forcing textlayout based link to emulated bidi reordering of the native syslink, will actually introduce bug 223336 to textlayout based link. We can fix this original problem report in this bug by fixing Link#getRectangles(). Withtout touching the bidi reordering. Note: nowadays this problem only happens on windows 2000, low priority.
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
(In reply to Felipe Heidrich from comment #11) > Note: nowadays this problem only happens on windows 2000, low priority. Win2000 is no longer a supported environment. If this issue occurs on a supported environment, please re-open with details to reproduce the issue.