mORMot and Open Source friends
Check-in [f64cd122ef]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:{6381} fixed regression after UpperCopy255Buf() last modification
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f64cd122efac5b0e4570472cb2a2c9fc7b76d12b
User & Date: ab 2022-04-26 12:46:01
Context
2022-04-27
10:28
{6382} allow to embed symbol font subset to the pdf check-in: a4eaf1c539 user: ab tags: trunk
2022-04-26
12:46
{6381} fixed regression after UpperCopy255Buf() last modification check-in: f64cd122ef user: ab tags: trunk
2022-04-25
14:50
{6380} new TPdfDocument.AddTrueTypeFont() method - to be used e.g. when some fonts may not be enumerated in the system, e.g. after calling AddFontMemResourceEx() API check-in: aedd978136 user: ab tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SynCommons.pas.

40404
40405
40406
40407
40408
40409
40410
40411
40412
40413
40414
40415
40416
40417
40418
.....
44350
44351
44352
44353
44354
44355
44356
44357
44358
44359
44360
44361
44362
44363
44364
end;
{$endif CPUX64}

function FastFindUpperPUTF8CharSorted(P: PPUTF8CharArray; R: PtrInt;
  Value: PUTF8Char; ValueLen: PtrInt): PtrInt;
var tmp: array[byte] of AnsiChar;
begin
  UpperCopy255Buf(@tmp,Value,ValueLen);
  result := FastFindPUTF8CharSorted(P,R,@tmp);
end;

function FastFindIndexedPUTF8Char(P: PPUTF8CharArray; R: PtrInt;
  var SortedIndexes: TCardinalDynArray; Value: PUTF8Char;
  ItemComp: TUTF8Compare): PtrInt;
var L, cmp: PtrInt;
................................................................................
    up: PUTF8Char;
    tmp: array[byte] of AnsiChar; // avoid unneeded memory allocation
begin
  if ItemTypeName<>nil then begin
    UpperCaseCopy(TypeName,TypeNameLen,ItemTypeName^);
    up := pointer(ItemTypeName^);
  end else begin
    UpperCopy255Buf(@tmp,TypeName,TypeNameLen);
    up := @tmp;
  end;
//for ndx := 1 to SORTEDMAX do assert(StrComp(SORTEDNAMES[ndx],SORTEDNAMES[ndx-1])>0,SORTEDNAMES[ndx]);
  ndx := FastFindPUTF8CharSorted(@SORTEDNAMES,SORTEDMAX,up);
  if ndx>=0 then
    result := SORTEDTYPES[ndx] else
    result := ptCustom;






|







 







|







40404
40405
40406
40407
40408
40409
40410
40411
40412
40413
40414
40415
40416
40417
40418
.....
44350
44351
44352
44353
44354
44355
44356
44357
44358
44359
44360
44361
44362
44363
44364
end;
{$endif CPUX64}

function FastFindUpperPUTF8CharSorted(P: PPUTF8CharArray; R: PtrInt;
  Value: PUTF8Char; ValueLen: PtrInt): PtrInt;
var tmp: array[byte] of AnsiChar;
begin
  UpperCopy255Buf(@tmp,Value,ValueLen)^ := #0;
  result := FastFindPUTF8CharSorted(P,R,@tmp);
end;

function FastFindIndexedPUTF8Char(P: PPUTF8CharArray; R: PtrInt;
  var SortedIndexes: TCardinalDynArray; Value: PUTF8Char;
  ItemComp: TUTF8Compare): PtrInt;
var L, cmp: PtrInt;
................................................................................
    up: PUTF8Char;
    tmp: array[byte] of AnsiChar; // avoid unneeded memory allocation
begin
  if ItemTypeName<>nil then begin
    UpperCaseCopy(TypeName,TypeNameLen,ItemTypeName^);
    up := pointer(ItemTypeName^);
  end else begin
    UpperCopy255Buf(@tmp,TypeName,TypeNameLen)^ := #0;
    up := @tmp;
  end;
//for ndx := 1 to SORTEDMAX do assert(StrComp(SORTEDNAMES[ndx],SORTEDNAMES[ndx-1])>0,SORTEDNAMES[ndx]);
  ndx := FastFindPUTF8CharSorted(@SORTEDNAMES,SORTEDMAX,up);
  if ndx>=0 then
    result := SORTEDTYPES[ndx] else
    result := ptCustom;

Changes to SynopseCommit.inc.

1
'1.18.6380'
|
1
'1.18.6381'