http://bugs.winehq.org/show_bug.cgi?id=16597
Summary: Wrong detection of SelAttributes in RichEdit Product: Wine Version: 1.1.11 Platform: All OS/Version: All Status: UNCONFIRMED Severity: normal Priority: P2 Component: richedit AssignedTo: wine-bugs@winehq.org ReportedBy: teach2000@basement.nl
Created an attachment (id=18124) --> (http://bugs.winehq.org/attachment.cgi?id=18124) Application to show behavior of RichEdit
Open the attached Project10.exe. This is an test executable to demonstrate the RTF problem.
Three text boxes are visible: Text box 1: Plain text where you can enter BBCode. Text box 2: RichEdit that converts the BBCode to display it WYSIWYG. Text box 3: The opposite, this plain text memo displays the BBCode from 2. This BBCode should be the same as the BBCode from 1.
Steps: Clear the first text box. Enter the text 'test'. Exp: The third text box displays 'test'. Act: The third text box displays '[i][/red]t[/red]e[/red]s[/red]t[/red]'.
This is a big problem for the application Teach2000 under Wine.
Wine version: 1.1.11 WineTricks: wget http://kegel.com/wine/winetricks && sh winetricks allfonts gecko riched20 msxml3 Suse Linux 10.2 Project10.exe is built with Delphi 2007
http://bugs.winehq.org/show_bug.cgi?id=16597
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- OS/Version|All |Linux Platform|All |PC
http://bugs.winehq.org/show_bug.cgi?id=16597
Vitaliy Margolen vitaliy@kievinfo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
http://bugs.winehq.org/show_bug.cgi?id=16597
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #1 from Austin English austinenglish@gmail.com 2008-12-22 15:33:34 --- Confirming. Could you attach the source?
http://bugs.winehq.org/show_bug.cgi?id=16597
--- Comment #2 from bas teach2000@basement.nl 2008-12-23 05:01:46 --- The code of the demo-application:
--------------------- procedure TForm14.FormCreate(Sender: TObject); begin Memo1Change(nil); end;
procedure TForm14.Memo1Change(Sender: TObject); begin T2KItemEdit1.BBCode := Memo1.Text; end;
procedure TForm14.T2KItemEdit1Change(Sender: TObject); begin Memo2.Text := T2KItemEdit1.BBCode; end; ---------------------
The code of the procedure that introduces the problem:
--------------------- class function TT2KBBCode.FromRichEdit(ARichEdit: TBasCustomRichEdit): WideString; var LRow: Integer; LBBState: TBBState;
procedure CheckLine(ALine: WideString); var LCol: Integer;
procedure AddControl; begin // Bold if (fsBold in ARichEdit.SelAttributes.Style) and (not LBBState.Bold) then begin LBBState.Bold := True; LBBState.Text.AppendString(cBBControlOpen + cBBBold + cBBControlClose); end else if (not (fsBold in ARichEdit.SelAttributes.Style)) and LBBState.Bold then begin LBBState.Bold := False; LBBState.Text.AppendString(cBBControlOpen + cBBBoldEnd + cBBControlClose); end;
// Italic if (fsItalic in ARichEdit.SelAttributes.Style) and (not LBBState.Italic) then begin LBBState.Italic := True; LBBState.Text.AppendString(cBBControlOpen + cBBItalic + cBBControlClose); end else if (not (fsItalic in ARichEdit.SelAttributes.Style)) and LBBState.Italic then begin LBBState.Italic := False; LBBState.Text.AppendString(cBBControlOpen + cBBItalicEnd + cBBControlClose); end;
// Underline if (fsUnderline in ARichEdit.SelAttributes.Style) and (not LBBState.Underline) then begin LBBState.Underline := True; LBBState.Text.AppendString(cBBControlOpen + cBBUnderline + cBBControlClose); end else if (not (fsUnderline in ARichEdit.SelAttributes.Style)) and LBBState.Underline then begin LBBState.Underline := False; LBBState.Text.AppendString(cBBControlOpen + cBBUnderlineEnd + cBBControlClose); end;
// Strike if (fsStrikeOut in ARichEdit.SelAttributes.Style) and (not LBBState.Strike) then begin LBBState.Strike := True; LBBState.Text.AppendString(cBBControlOpen + cBBStrike + cBBControlClose); end else if (not (fsStrikeOut in ARichEdit.SelAttributes.Style)) and LBBState.Strike then begin LBBState.Strike := False; LBBState.Text.AppendString(cBBControlOpen + cBBStrikeEnd + cBBControlClose); end;
if ARichEdit.CharScript <> LBBState.CharScript then begin case LBBState.CharScript of csSuper: LBBState.Text.AppendString(cBBControlOpen + cBBSuperEnd + cBBControlClose); csSub: LBBState.Text.AppendString(cBBControlOpen + cBBSubEnd + cBBControlClose); end;
LBBState.CharScript := ARichEdit.CharScript;
case LBBState.CharScript of csSuper: LBBState.Text.AppendString(cBBControlOpen + cBBSuper + cBBControlClose); csSub: LBBState.Text.AppendString(cBBControlOpen + cBBSub + cBBControlClose); end; end;
if LBBState.Color <> ARichEdit.SelAttributes.Color then begin if ARichEdit.SelAttributes.Color = clRed then begin LBBState.Text.AppendString(cBBControlOpen + cBBRed + cBBControlClose); LBBState.Color := clRed; end else begin LBBState.Text.AppendString(cBBControlOpen + cBBRedEnd + cBBControlClose); LBBState.Color := cDefaultColor; end; end; end;
begin for LCol := 1 to Length(ALine) do begin ARichEdit.SelLength := 1; AddControl; LBBState.Text.AppendString(ARichEdit.SelText);
ARichEdit.SelStart := ARichEdit.SelStart + 1; end;
if LRow < ARichEdit.Lines.Count - 1 then LBBState.Text.AppendString(cBBLineBreakComplete); end;
begin LBBState := TBBState.Create; try LBBState.Color := cDefaultColor; for LRow := 0 to ARichEdit.Lines.Count - 1 do begin ARichEdit.SelStart := ARichEdit.EmulatedCharPos(ARichEdit.Perform(EM_LINEINDEX, LRow, 0)); CheckLine(ARichEdit.Lines[LRow]); end;
LBBState.Text.Trim; Result := LBBState.Text.Result; finally LBBState.Free; end; end; ---------------------
http://bugs.winehq.org/show_bug.cgi?id=16597
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source
--- Comment #3 from Austin English austinenglish@gmail.com 2008-12-23 06:42:37 --- Thanks. Hopefully that'll make it easier for someone who knows riched to fix it.
http://bugs.winehq.org/show_bug.cgi?id=16597
Dylan Smith dylan.ah.smith@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dylan.ah.smith@gmail.com
--- Comment #4 from Dylan Smith dylan.ah.smith@gmail.com 2009-03-23 19:23:50 --- I don't know if I fixed this intentionally at some point, but it does seem to be working for me now.
Could you retest this to see if it is fixed?
http://bugs.winehq.org/show_bug.cgi?id=16597
bas teach2000@basement.nl changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #5 from bas teach2000@basement.nl 2009-04-09 13:07:42 --- This bug is fixed. Seen on a MacBook (Darwine 1.1.18).
Thanks!
http://bugs.winehq.org/show_bug.cgi?id=16597
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #6 from Alexandre Julliard julliard@winehq.org 2009-04-10 11:20:16 --- Closing bugs fixed in 1.1.19.