Skip to content

Commit 81a4d53

Browse files
ver.2.1.0
- Built with Delphi 12 - Updated Copyright - Aligned to MarkDown HelpViewer project - Added create table wizard - Added "mark" command in markdown toolbar - Recognized 1) same as 1. (ordered list) - Added .text and .txt extensions to editor/shell extensions
1 parent c5b6ba8 commit 81a4d53

File tree

112 files changed

+4546
-1035
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+4546
-1035
lines changed

Build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
call "C:\BDS\Studio\22.0\bin\rsvars.bat"
1+
call "C:\BDS\Studio\23.0\bin\rsvars.bat"
22
msbuild.exe "Source\MDShellExtensions.dproj" /target:Clean;Build /p:Platform=Win64 /p:config=release
33
msbuild.exe "Source\MDShellExtensions32.dproj" /target:Clean;Build /p:Platform=Win32 /p:config=release
44
msbuild.exe "Source\MDTextEditor.dproj" /target:Clean;Build /p:Platform=Win64 /p:config=release

Ext/HTMLViewer/Source/vwPrint.pas

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,9 @@ procedure TvwPrinter.SetState(Value: TvwPrinterState);
418418
TmpDeviceMode: HGLOBAL;
419419
Driver, Device, Port: array[0..200] of {$ifdef UNICODE} WideChar {$else} char {$endif};
420420
begin
421+
{$warn SYMBOL_DEPRECATED off}
421422
Printers.Printer.GetPrinter(Device, Driver, Port, TmpDeviceMode);
423+
{$warn SYMBOL_DEPRECATED on}
422424
if DeviceMode <> 0 then
423425
begin
424426
GlobalUnlock(DeviceMode);

Ext/MarkdownProcessor/source/MarkdownCommonMark.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ MarkDown Processor }
44
{ Delphi version of FPC-markdown by Miguel A. Risco-Castillo }
55
{ }
6-
{ Copyright (c) 2022-2023 (Ethea S.r.l.) }
6+
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/MarkdownProcessor }

Ext/MarkdownProcessor/source/MarkdownDaringFireball.pas

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ MarkDown Processor }
44
{ Delphi version of FPC-markdown by Miguel A. Risco-Castillo }
55
{ }
6-
{ Copyright (c) 2022-2023 (Ethea S.r.l.) }
6+
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/MarkdownProcessor }
@@ -101,7 +101,9 @@ procedure TMarkdownDaringFireball.initListBlock(root: TBlock);
101101
while (line <> nil) do
102102
begin
103103
t := line.getLineType(Config);
104-
if ((t = ltOLIST) or (t = ltULIST) or (not line.isEmpty and (line.prevEmpty and (line.leading = 0) and not((t = ltOLIST) or (t = ltULIST))))) then
104+
if ((t in [ltOLIST,ltULIST,ltBLIST]) or
105+
(not line.isEmpty and (line.prevEmpty and (line.leading = 0) and not(t in [ltOLIST,ltULIST,ltBLIST])))
106+
) then
105107
root.split(line.previous).type_ := btLIST_ITEM;
106108
line := line.next;
107109
end;
@@ -360,7 +362,7 @@ procedure TMarkdownDaringFireball.recurse(root: TBlock; listMode: boolean);
360362
while (line <> nil) and (not line.isEmpty) do
361363
begin
362364
t := line.getLineType(Config);
363-
if (listMode or FuseExtensions) and (t in [ltOLIST, ltULIST]) then
365+
if (listMode or FuseExtensions) and (t in [ltOLIST,ltULIST,ltBLIST]) then
364366
break;
365367
if (FuseExtensions and (t in [ltCODE, ltFENCED_CODE])) then
366368
break;
@@ -483,7 +485,7 @@ procedure TMarkdownDaringFireball.recurse(root: TBlock; listMode: boolean);
483485
root.removeLeadingEmptyLines();
484486
line := root.lines;
485487
end;
486-
ltOLIST, ltULIST:
488+
ltOLIST, ltULIST, ltBLIST:
487489
begin
488490
while (line <> nil) do
489491
begin
@@ -496,7 +498,7 @@ procedure TMarkdownDaringFireball.recurse(root: TBlock; listMode: boolean);
496498
list := root.split(line.previous)
497499
else
498500
list := root.split(root.lineTail);
499-
if type_ = ltOLIST then
501+
if type_ in [ltOLIST, ltBLIST] then
500502
list.type_ := btORDERED_LIST
501503
else
502504
list.type_ := btUNORDERED_LIST;

Ext/MarkdownProcessor/source/MarkdownMathCode.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ MarkDown Processor }
44
{ Delphi version of FPC-markdown by Miguel A. Risco-Castillo }
55
{ }
6-
{ Copyright (c) 2022-2023 (Ethea S.r.l.) }
6+
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/MarkdownProcessor }

Ext/MarkdownProcessor/source/MarkdownProcessor.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ MarkDown Processor }
44
{ Delphi version of FPC-markdown by Miguel A. Risco-Castillo }
55
{ }
6-
{ Copyright (c) 2022-2023 (Ethea S.r.l.) }
6+
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/MarkdownProcessor }

Ext/MarkdownProcessor/source/MarkdownTables.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ MarkDown Processor }
44
{ Delphi version of FPC-markdown by Miguel A. Risco-Castillo }
55
{ }
6-
{ Copyright (c) 2022-2023 (Ethea S.r.l.) }
6+
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/MarkdownProcessor }

Ext/MarkdownProcessor/source/MarkdownTxtMark.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ MarkDown Processor }
44
{ Delphi version of FPC-markdown by Miguel A. Risco-Castillo }
55
{ }
6-
{ Copyright (c) 2022-2023 (Ethea S.r.l.) }
6+
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/MarkdownProcessor }

Ext/MarkdownProcessor/source/MarkdownUtils.pas

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{ MarkDown Processor }
44
{ Delphi version of FPC-markdown by Miguel A. Risco-Castillo }
55
{ }
6-
{ Copyright (c) 2022-2023 (Ethea S.r.l.) }
6+
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
77
{ Author: Carlo Barazzetta }
88
{ }
99
{ https://github.com/EtheaDev/MarkdownProcessor }
@@ -294,7 +294,9 @@ TConfiguration = class
294294
// A code block line. */
295295
ltCODE,
296296
// A list. */
297-
ltULIST, ltOLIST,
297+
ltULIST, //Unordered
298+
ltOLIST, //Ordered with dot
299+
ltBLIST, //Ordered with brackets
298300
// A block quote. */
299301
ltBQUOTE,
300302
// A horizontal ruler. */
@@ -378,7 +380,7 @@ TLinkRef = class
378380
btHEADLINE,
379381
// A list item.
380382
btLIST_ITEM,
381-
// An ordered list.
383+
// An ordered list
382384
btORDERED_LIST,
383385
// A paragraph.
384386
btPARAGRAPH,
@@ -2532,6 +2534,8 @@ function TLine.getLineType(config: TConfiguration): TLineType;
25322534
inc(i);
25332535
if (i + 1 < Length(value)) and (value[1 + i] = '.') and (value[1 + i + 1] = ' ') then
25342536
exit(ltOLIST);
2537+
if (i + 1 < Length(value)) and (value[1 + i] = ')') and (value[1 + i + 1] = ' ') then
2538+
exit(ltBLIST);
25352539
end;
25362540

25372541
if (value[1 + leading] = '<') then
@@ -2973,11 +2977,11 @@ procedure TBlock.removeListIndent(config: TConfiguration);
29732977
begin
29742978
case (line.getLineType(config)) of
29752979
ltULIST:
2976-
// line.value := line.value.substring(line.leading + 2); PSTfix
29772980
line.value := Copy(line.value, line.leading +3);
29782981
ltOLIST:
2979-
// line.value := line.value.substring(line.value.indexOf('.') + 2); pstfix
2980-
line.value := Copy(line.value, pos('.', line.value) + 2);
2982+
line.value := Copy(line.value, pos('.', line.value) + 2);
2983+
ltBLIST:
2984+
line.value := Copy(line.value, pos(')', line.value) + 2);
29812985
else
29822986
// line.value := line.value.substring(Math.min(line.leading, 4)); pstfix
29832987
line.value := Copy(line.value, Math.Min(line.leading + 1, 5));

Ext/SVGIconImageList/Image32/source/Clipper.Core.pas

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
(*******************************************************************************
44
* Author : Angus Johnson *
5-
* Date : 19 February 2023 *
5+
* Date : 17 July 2023 *
66
* Website : http://www.angusj.com *
77
* Copyright : Angus Johnson 2010-2023 *
88
* Purpose : Core Clipper Library module *
@@ -120,6 +120,7 @@ TListEx = class
120120
protected
121121
function UnsafeGet(idx: integer): Pointer; // no range checking
122122
procedure UnsafeSet(idx: integer; val: Pointer);
123+
procedure UnsafeDelete(index: integer); virtual;
123124
public
124125
constructor Create(capacity: integer = 0); virtual;
125126
destructor Destroy; override;
@@ -347,6 +348,9 @@ procedure CheckPrecisionRange(var precision: integer);
347348
NullRectD : TRectD = (left: 0; top: 0; right: 0; Bottom: 0);
348349
Tolerance : Double = 1.0E-12;
349350

351+
//https://github.com/AngusJohnson/Clipper2/discussions/564
352+
MaxDecimalPrecision = 8;
353+
350354
implementation
351355

352356
resourcestring
@@ -608,6 +612,14 @@ procedure TListEx.UnsafeSet(idx: integer; val: Pointer);
608612
end;
609613
//------------------------------------------------------------------------------
610614

615+
procedure TListEx.UnsafeDelete(index: integer);
616+
begin
617+
dec(fCount);
618+
if index < fCount then
619+
Move(fList[index +1], fList[index], (fCount - index) * SizeOf(Pointer));
620+
end;
621+
//------------------------------------------------------------------------------
622+
611623
procedure TListEx.Swap(idx1, idx2: integer);
612624
var
613625
p: Pointer;
@@ -623,7 +635,7 @@ procedure TListEx.Swap(idx1, idx2: integer);
623635

624636
procedure CheckPrecisionRange(var precision: integer);
625637
begin
626-
if (precision < -8) or (precision > 8) then
638+
if (precision < -MaxDecimalPrecision) or (precision > MaxDecimalPrecision) then
627639
Raise EClipper2LibException(rsClipper_PrecisonErr);
628640
end;
629641
//------------------------------------------------------------------------------
@@ -1922,36 +1934,24 @@ function __Trunc(val: double): Int64; {$IFDEF INLINE} inline; {$ENDIF}
19221934
end;
19231935
//------------------------------------------------------------------------------
19241936

1925-
function CheckCastInt64(val: double): Int64; {$IFDEF INLINE} inline; {$ENDIF}
1926-
begin
1927-
if (val >= MaxCoord) or (val <= MinCoord) then
1928-
Raise EClipper2LibException.Create('overflow error.');
1929-
Result := Trunc(val);
1930-
//Result := __Trunc(val);
1931-
end;
1932-
//------------------------------------------------------------------------------
1933-
19341937
function GetIntersectPoint(const ln1a, ln1b, ln2a, ln2b: TPoint64;
19351938
out ip: TPoint64): Boolean;
19361939
var
1937-
dx1,dy1, dx2,dy2, qx,qy, cp: double;
1940+
dx1,dy1, dx2,dy2, t, cp: double;
19381941
begin
19391942
// https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection
19401943
dy1 := (ln1b.y - ln1a.y);
19411944
dx1 := (ln1b.x - ln1a.x);
19421945
dy2 := (ln2b.y - ln2a.y);
19431946
dx2 := (ln2b.x - ln2a.x);
19441947
cp := dy1 * dx2 - dy2 * dx1;
1945-
if (cp = 0.0) then
1946-
begin
1947-
Result := false;
1948-
Exit;
1949-
end;
1950-
qx := dx1 * ln1a.y - dy1 * ln1a.x;
1951-
qy := dx2 * ln2a.y - dy2 * ln2a.x;
1952-
ip.X := CheckCastInt64((dx1 * qy - dx2 * qx) / cp);
1953-
ip.Y := CheckCastInt64((dy1 * qy - dy2 * qx) / cp);
1954-
Result := (ip.x <> invalid64) and (ip.y <> invalid64);
1948+
Result := (cp <> 0.0);
1949+
if not Result then Exit;
1950+
t := ((ln1a.x-ln2a.x) * dy2 - (ln1a.y-ln2a.y) * dx2) / cp;
1951+
if t <= 0.0 then ip := ln1a
1952+
else if t >= 1.0 then ip := ln1b;
1953+
ip.X := Trunc(ln1a.X + t * dx1);
1954+
ip.Y := Trunc(ln1a.Y + t * dy1);
19551955
end;
19561956
//------------------------------------------------------------------------------
19571957

0 commit comments

Comments
 (0)