Ignore:
Timestamp:
Jun 13, 2007, 8:33:51 PM (18 years ago)
Author:
RBRi
Message:

using StringUtilsUnit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Components/RichTextStyleUnit.pas

    r39 r214  
    44
    55uses
    6   Forms, Classes, Graphics, CanvasFontManager, RichTextDocumentUnit;
     6  Forms,
     7  Classes,
     8  Graphics,
     9  CanvasFontManager,
     10  RichTextDocumentUnit;
    711
    812type
     
    144148uses
    145149  SysUtils,
    146   ACLStringUtility;
    147 //  ACLProfile;
     150  StringUtilsUnit;
    148151
    149152Procedure ApplyStyle( const Style: TTextDrawStyle;
     
    169172  XSizeStr: string;
    170173  YSizeStr: string;
     174  tmpFontParts : TStringList;
    171175
    172176  MarginSize: longint;
     
    203207    ttFont:
    204208    begin
    205       ParseIndex := 1;
    206       GetNextQuotedValue( Tag.Arguments, ParseIndex, FontFaceName, DoubleQuote );
    207       GetNextQuotedValue( Tag.Arguments, ParseIndex, FontSizeString, DoubleQuote );
     209      tmpFontParts := TStringList.Create;
     210      StrExtractStringsQuoted(tmpFontParts, Tag.Arguments);
     211      FontFaceName := tmpFontParts[0];
     212      FontSizeString := tmpFontParts[1];
     213      tmpFontParts.Destroy;
     214
    208215      NewStyle := Style;
    209216      try
     
    212219        if Pos( 'x', FontSizeString ) > 0 then
    213220        begin
    214           XSizeStr := ExtractNextValue( FontSizeString, 'x' );
    215           YSizeStr := FontSizeString;
     221          tmpFontParts := TStringList.Create;
     222          StrExtractStrings(tmpFontParts, FontSizeString, ['x'], #0);
     223          XSizeStr := tmpFontParts[0];
     224          YSizeStr := tmpFontParts[1];
     225          tmpFontParts.Destroy;
     226
    216227          NewStyle.Font.XSize := StrToInt( XSizeStr );
    217228          NewStyle.Font.YSize := StrToInt( YSizeStr );
     
    265276    ttSetRightMargin:
    266277    begin
     278      tmpFontParts := TStringList.Create;
     279      StrExtractStrings(tmpFontParts, Tag.Arguments, [' '], #0);
     280      MarginParam1 := tmpFontParts[0];
     281      tmpFontParts.Destroy;
     282
    267283      ParsePoint := 1;
    268       GetNextValue( Tag.Arguments, ParsePoint, MarginParam1, ' ' );
    269284      if     ( Tag.TagType = ttSetLeftMargin )
    270285         and ( MarginParam1 = 'here' ) then
     
    276291        try
    277292          MarginSize := StrToInt( MarginParam1 );
    278           GetNextValue( Tag.Arguments, ParsePoint, MarginParam2, ' ' );
     293          MarginParam2 := tmpFontParts[1];
    279294          if MarginParam2 = 'pixels' then
    280295            NewMargin := MarginSize
Note: See TracChangeset for help on using the changeset viewer.