Bug 129580 HCG_BIDI: Undesirable order of BiDi chars in Edit Text Item dialog
This is BiDi specific defect. Capital characters refer to BiDi (Hebrew/Arabic) characters. 1. Create report 2. Add text item from the palette 3. Define it as HTML/Dynamic Text 4. Add <CODE> section 5. Type inside some logical expression using BiDi characters. if ABC != "OLLEH world" then ABC = "ELLOH" Actual result: if OLLEH" =! ABC world" then ELLOH" = ABC" The order of characters is corrupted. The content of comment and variables names is mixed.
UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/util/UIUtil.java
/**
	 * Get Bidi level of Expression String.
	 * @param message
	 * @return
	 */
	public static int[] getExpressionBidiLevel( String message )
	{
		java.text.Bidi bidi = new Bidi( message,
				Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT );
		int[] level = new int[message.length( )];
		boolean bidiStart = false;
		Stack bracket = new Stack( );
		for ( int i = 0; i < message.length( ); i++ )
		{
			char c = message.charAt( i );
			if ( isNeutral( c ) )
			{
				if ( ( c = getBracketLeft( c ) ) != '0' )
				{
					if ( bracket.empty( ) )
					{
						bracket.add( new Character( c ) );
					}
					else
					{
						if ( ( (Character) bracket.peek( ) ).charValue( ) == c )
						{
							bracket.pop( );
							bidiStart = false;
						}