Changeset 418 for trunk/Components/RichTextView.PAS
- Timestamp:
- Feb 25, 2019, 8:34:42 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Components/RichTextView.PAS
r395 r418 459 459 460 460 Procedure TRichTextView.SetSelectionStartInternal( SelectionStart: longint ); 461 var 462 Offset: longint; // ALT 461 463 begin 462 464 if SelectionStart = FSelectionStart then … … 468 470 ClearSelection; 469 471 472 // ALT 473 Offset := FCursorOffset; 474 MovetoCharacterBoundary( FText, SelectionStart, FCursorOffset, Offset, FLayout.Codepage ); 475 470 476 FSelectionStart := SelectionStart; 471 477 if FSelectionEnd = -1 then … … 479 485 StartRedrawLine: longint; 480 486 EndRedrawLine: longint; 487 Offset: longint; // ALT 481 488 OldClip: TRect; 482 489 begin 483 490 if SelectionEnd = FSelectionEnd then 484 491 exit; 492 493 // ALT 494 Offset := FCursorOffset; 495 MovetoCharacterBoundary( FText, SelectionEnd, FCursorOffset, Offset, FLayout.Codepage ); 485 496 486 497 if FSelectionStart = -1 then … … 797 808 // we haven't yet done a layout 798 809 Layout; 810 799 811 800 812 end; … … 2018 2030 PreserveSelection: boolean ); 2019 2031 var 2032 // P: PChar; // ALT 2033 // NextP: PChar; // ALT 2034 // Element: TTextElement; // ALT 2035 // InsideDBC: boolean; // ALT 2036 RowStart: longint; // ALT 2020 2037 Index: longint; 2021 2038 begin 2022 2039 RemoveCursor; 2040 2041 Index := FLayout.GetCharIndex( FLayout.FLines[ Row ].Text ) + Offset; 2042 2043 // ALT 2044 { 2045 if ( Offset > 0 ) and 2046 ( FLayout.Codepage in [ 932, 936, 942, 943, 949, 950, 1381, 1386 ]) then 2047 begin 2048 RowStart := FLayout.GetCharIndex( FLayout.FLines[ Row ].Text ); 2049 P := FText + RowStart; 2050 InsideDBC := false; 2051 while RowStart < Index do 2052 begin 2053 Element := ExtractNextTextElement( P, NextP ); 2054 CheckSpecialElementType( Element.Character, Element.ElementType, InsideDBC, FLayout.Codepage ); 2055 P := NextP; 2056 inc( RowStart ); 2057 end; 2058 Element := ExtractNextTextElement( P, NextP ); 2059 CheckSpecialElementType( Element.Character, Element.ElementType, InsideDBC, FLayout.Codepage ); 2060 if InsideDBC then 2061 begin 2062 dec( Index ); 2063 dec( Offset ); 2064 end; 2065 end; 2066 } 2067 2068 RowStart := FLayout.GetCharIndex( FLayout.FLines[ Row ].Text ); 2069 MoveToCharacterBoundary( FText, Index, Offset, RowStart, FLayout.Codepage ); // ALT 2070 2023 2071 FCursorOffset := Offset; 2024 2072 FCursorRow := Row; 2025 Index := FLayout.GetCharIndex( FLayout.FLines[ Row ].Text ) + Offset; 2073 2026 2074 if PreserveSelection then 2027 2075 begin … … 2047 2095 2048 2096 Element := ExtractNextTextElement( P, NextP ); 2097 2049 2098 P := NextP; 2050 2099 while Element.ElementType = teStyle do
Note:
See TracChangeset
for help on using the changeset viewer.