Changeset 420 for trunk/Components/RichTextDocumentUnit.pas
- Timestamp:
- Feb 28, 2019, 4:17:24 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Components/RichTextDocumentUnit.pas
r418 r420 143 143 const Codepage: LongInt ): boolean; 144 144 145 // Adjusts the character position to the beginning of any multi-byte character. 145 // Adjusts the character position to the beginning or end of any multi-byte 146 // character. 146 147 procedure MoveToCharacterBoundary( TextPointer: PChar; 147 148 var Index: LongInt; 148 149 var Offset: LongInt; 149 150 RowStart: LongInt; 150 Codepage: LongInt ); 151 Codepage: LongInt; 152 Advance: Boolean; ); 151 153 // 152 154 // ALT ends … … 967 969 var Offset: LongInt; 968 970 RowStart: LongInt; 969 Codepage: LongInt ); 971 Codepage: LongInt; 972 Advance: Boolean; ); 970 973 var 971 974 P: PChar; … … 989 992 inc( RowStart ); 990 993 end; 991 { 994 992 995 // We've reached the target position, and the current parsing state should 993 996 // be correctly set. So now we can safely determine the target byte's type. 994 997 Element := ExtractNextTextElement( P, NextP ); 995 998 CheckSpecialElementType( Element.Character, Element.ElementType, InsideDBC, Codepage ); 996 }997 999 if InsideDBC then 998 1000 begin 999 // If this the first byte of a double byte character, move back by one. 1000 dec( Index ); 1001 dec( Offset ); 1001 // If this the first byte of a double byte character, move position by one. 1002 if Advance Then 1003 Begin 1004 inc( Index ); 1005 inc( Offset ); 1006 End 1007 Else 1008 Begin 1009 dec( Index ); 1010 dec( Offset ); 1011 End 1002 1012 end; 1003 1013 end;
Note:
See TracChangeset
for help on using the changeset viewer.