jvcllaz: Add html test demo for JvNet packages. Fix some bugs in html conversion routines.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6948 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
12a03ba23c
commit
bdedb40277
@ -19,7 +19,7 @@ uses
|
|||||||
|
|
||||||
procedure Register;
|
procedure Register;
|
||||||
begin
|
begin
|
||||||
RegisterComponents(RsPaletteJvcl, [
|
RegisterComponents(RsPaletteJvclNonVisual, [
|
||||||
TJvHtmlParser, TJvFormToHtml, TJvStringListToHtml, TJvStrToHtml
|
TJvHtmlParser, TJvFormToHtml, TJvStringListToHtml, TJvStrToHtml
|
||||||
]);
|
]);
|
||||||
end;
|
end;
|
||||||
|
93
components/jvcllaz/examples/JvHTML/JvHTMLTest.lpi
Normal file
93
components/jvcllaz/examples/JvHTML/JvHTMLTest.lpi
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<CONFIG>
|
||||||
|
<ProjectOptions>
|
||||||
|
<Version Value="12"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<General>
|
||||||
|
<SessionStorage Value="InProjectDir"/>
|
||||||
|
<Title Value="JvHTMLTest"/>
|
||||||
|
<Scaled Value="True"/>
|
||||||
|
<ResourceType Value="res"/>
|
||||||
|
<UseXPManifest Value="True"/>
|
||||||
|
<XPManifest>
|
||||||
|
<DpiAware Value="True"/>
|
||||||
|
</XPManifest>
|
||||||
|
<Icon Value="0"/>
|
||||||
|
</General>
|
||||||
|
<BuildModes>
|
||||||
|
<Item Name="Default" Default="True"/>
|
||||||
|
</BuildModes>
|
||||||
|
<PublishOptions>
|
||||||
|
<Version Value="2"/>
|
||||||
|
<UseFileFilters Value="True"/>
|
||||||
|
</PublishOptions>
|
||||||
|
<RunParams>
|
||||||
|
<FormatVersion Value="2"/>
|
||||||
|
<Modes Count="0"/>
|
||||||
|
</RunParams>
|
||||||
|
<RequiredPackages Count="3">
|
||||||
|
<Item1>
|
||||||
|
<PackageName Value="SynEdit"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<PackageName Value="JvNetLazR"/>
|
||||||
|
</Item2>
|
||||||
|
<Item3>
|
||||||
|
<PackageName Value="LCL"/>
|
||||||
|
</Item3>
|
||||||
|
</RequiredPackages>
|
||||||
|
<Units>
|
||||||
|
<Unit>
|
||||||
|
<Filename Value="JvHTMLTest.lpr"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
</Unit>
|
||||||
|
<Unit>
|
||||||
|
<Filename Value="htmltestform.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="MainForm"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="HTMLTestForm"/>
|
||||||
|
</Unit>
|
||||||
|
<Unit>
|
||||||
|
<Filename Value="demoform.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<ComponentName Value="Form2"/>
|
||||||
|
<HasResources Value="True"/>
|
||||||
|
<ResourceBaseClass Value="Form"/>
|
||||||
|
<UnitName Value="DemoForm"/>
|
||||||
|
</Unit>
|
||||||
|
</Units>
|
||||||
|
</ProjectOptions>
|
||||||
|
<CompilerOptions>
|
||||||
|
<Version Value="11"/>
|
||||||
|
<PathDelim Value="\"/>
|
||||||
|
<Target>
|
||||||
|
<Filename Value="..\..\bin\JvHTMLTest"/>
|
||||||
|
</Target>
|
||||||
|
<SearchPaths>
|
||||||
|
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||||
|
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||||
|
</SearchPaths>
|
||||||
|
<Linking>
|
||||||
|
<Options>
|
||||||
|
<Win32>
|
||||||
|
<GraphicApplication Value="True"/>
|
||||||
|
</Win32>
|
||||||
|
</Options>
|
||||||
|
</Linking>
|
||||||
|
</CompilerOptions>
|
||||||
|
<Debugging>
|
||||||
|
<Exceptions Count="3">
|
||||||
|
<Item1>
|
||||||
|
<Name Value="EAbort"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Name Value="ECodetoolError"/>
|
||||||
|
</Item2>
|
||||||
|
<Item3>
|
||||||
|
<Name Value="EFOpenError"/>
|
||||||
|
</Item3>
|
||||||
|
</Exceptions>
|
||||||
|
</Debugging>
|
||||||
|
</CONFIG>
|
22
components/jvcllaz/examples/JvHTML/JvHTMLTest.lpr
Normal file
22
components/jvcllaz/examples/JvHTML/JvHTMLTest.lpr
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
program JvHTMLTest;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||||
|
cthreads,
|
||||||
|
{$ENDIF}{$ENDIF}
|
||||||
|
Interfaces, // this includes the LCL widgetset
|
||||||
|
Forms, HTMLTestForm, DemoForm
|
||||||
|
{ you can add units after this };
|
||||||
|
|
||||||
|
{$R *.res}
|
||||||
|
|
||||||
|
begin
|
||||||
|
RequireDerivedFormResource:=True;
|
||||||
|
Application.Scaled:=True;
|
||||||
|
Application.Initialize;
|
||||||
|
Application.CreateForm(TMainForm, MainForm);
|
||||||
|
Application.Run;
|
||||||
|
end.
|
||||||
|
|
205
components/jvcllaz/examples/JvHTML/demoform.lfm
Normal file
205
components/jvcllaz/examples/JvHTML/demoform.lfm
Normal file
@ -0,0 +1,205 @@
|
|||||||
|
object Form2: TForm2
|
||||||
|
Left = 445
|
||||||
|
Height = 386
|
||||||
|
Top = 170
|
||||||
|
Width = 487
|
||||||
|
Caption = 'Find'
|
||||||
|
ClientHeight = 386
|
||||||
|
ClientWidth = 487
|
||||||
|
LCLVersion = '2.1.0.0'
|
||||||
|
object lblTextToFind: TLabel
|
||||||
|
Left = 24
|
||||||
|
Height = 15
|
||||||
|
Top = 16
|
||||||
|
Width = 59
|
||||||
|
Caption = 'Text to find'
|
||||||
|
ParentColor = False
|
||||||
|
end
|
||||||
|
object edName: TEdit
|
||||||
|
Left = 128
|
||||||
|
Height = 23
|
||||||
|
Top = 11
|
||||||
|
Width = 337
|
||||||
|
TabOrder = 0
|
||||||
|
Text = 'object'
|
||||||
|
end
|
||||||
|
object btnFind: TButton
|
||||||
|
Left = 264
|
||||||
|
Height = 25
|
||||||
|
Top = 344
|
||||||
|
Width = 75
|
||||||
|
Caption = 'Find'
|
||||||
|
ModalResult = 1
|
||||||
|
TabOrder = 8
|
||||||
|
end
|
||||||
|
object btnCancel: TButton
|
||||||
|
Left = 390
|
||||||
|
Height = 25
|
||||||
|
Top = 344
|
||||||
|
Width = 75
|
||||||
|
Caption = 'Cancel'
|
||||||
|
ModalResult = 2
|
||||||
|
TabOrder = 9
|
||||||
|
end
|
||||||
|
object cmbReplaceWidth: TComboBox
|
||||||
|
Left = 128
|
||||||
|
Height = 23
|
||||||
|
Top = 46
|
||||||
|
Width = 337
|
||||||
|
ItemHeight = 15
|
||||||
|
TabOrder = 2
|
||||||
|
Text = 'class'
|
||||||
|
end
|
||||||
|
object btnHelp: TButton
|
||||||
|
Left = 16
|
||||||
|
Height = 25
|
||||||
|
Top = 344
|
||||||
|
Width = 75
|
||||||
|
Caption = 'Help'
|
||||||
|
ModalResult = 6
|
||||||
|
TabOrder = 7
|
||||||
|
end
|
||||||
|
object cbReplaceWith: TCheckBox
|
||||||
|
Left = 24
|
||||||
|
Height = 19
|
||||||
|
Top = 48
|
||||||
|
Width = 87
|
||||||
|
Caption = 'Replace with'
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object gbOptions: TGroupBox
|
||||||
|
Left = 24
|
||||||
|
Height = 231
|
||||||
|
Top = 89
|
||||||
|
Width = 232
|
||||||
|
Caption = 'Options'
|
||||||
|
ClientHeight = 211
|
||||||
|
ClientWidth = 228
|
||||||
|
TabOrder = 3
|
||||||
|
object cbCaseSensitive: TCheckBox
|
||||||
|
Left = 18
|
||||||
|
Height = 19
|
||||||
|
Top = 8
|
||||||
|
Width = 93
|
||||||
|
Caption = 'Case sensitive'
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object cbWholeWordsOnly: TCheckBox
|
||||||
|
Left = 18
|
||||||
|
Height = 19
|
||||||
|
Top = 36
|
||||||
|
Width = 115
|
||||||
|
Caption = 'Whole words only'
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
object cbRegularExpressions: TCheckBox
|
||||||
|
Left = 18
|
||||||
|
Height = 19
|
||||||
|
Top = 64
|
||||||
|
Width = 123
|
||||||
|
Caption = 'Regular expressions'
|
||||||
|
TabOrder = 2
|
||||||
|
end
|
||||||
|
object cbMultilinePattern: TCheckBox
|
||||||
|
Left = 18
|
||||||
|
Height = 19
|
||||||
|
Top = 96
|
||||||
|
Width = 108
|
||||||
|
Caption = 'Multiline pattern'
|
||||||
|
TabOrder = 3
|
||||||
|
end
|
||||||
|
object cbPromptOnReplace: TCheckBox
|
||||||
|
Left = 18
|
||||||
|
Height = 19
|
||||||
|
Top = 128
|
||||||
|
Width = 118
|
||||||
|
Caption = 'Prompt on replace'
|
||||||
|
Enabled = False
|
||||||
|
TabOrder = 4
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object gbOrigin: TGroupBox
|
||||||
|
Left = 280
|
||||||
|
Height = 71
|
||||||
|
Top = 89
|
||||||
|
Width = 185
|
||||||
|
Caption = 'Origin'
|
||||||
|
ClientHeight = 51
|
||||||
|
ClientWidth = 181
|
||||||
|
TabOrder = 4
|
||||||
|
object rbFromCursor: TRadioButton
|
||||||
|
Left = 16
|
||||||
|
Height = 19
|
||||||
|
Top = 0
|
||||||
|
Width = 84
|
||||||
|
Caption = 'From cursor'
|
||||||
|
Checked = True
|
||||||
|
TabOrder = 0
|
||||||
|
TabStop = True
|
||||||
|
end
|
||||||
|
object rbFromBeginning: TRadioButton
|
||||||
|
Left = 16
|
||||||
|
Height = 19
|
||||||
|
Top = 24
|
||||||
|
Width = 105
|
||||||
|
Caption = 'From beginning'
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object gbSearchScope: TGroupBox
|
||||||
|
Left = 280
|
||||||
|
Height = 72
|
||||||
|
Top = 168
|
||||||
|
Width = 185
|
||||||
|
Caption = 'Search scope'
|
||||||
|
ClientHeight = 52
|
||||||
|
ClientWidth = 181
|
||||||
|
TabOrder = 5
|
||||||
|
object rbSelectedText: TRadioButton
|
||||||
|
Left = 16
|
||||||
|
Height = 19
|
||||||
|
Top = 1
|
||||||
|
Width = 86
|
||||||
|
Caption = 'Selected text'
|
||||||
|
Checked = True
|
||||||
|
TabOrder = 0
|
||||||
|
TabStop = True
|
||||||
|
end
|
||||||
|
object rbGlobal: TRadioButton
|
||||||
|
Left = 16
|
||||||
|
Height = 19
|
||||||
|
Top = 24
|
||||||
|
Width = 54
|
||||||
|
Caption = 'Global'
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object gbDirection: TGroupBox
|
||||||
|
Left = 280
|
||||||
|
Height = 72
|
||||||
|
Top = 248
|
||||||
|
Width = 185
|
||||||
|
Caption = 'Direction'
|
||||||
|
ClientHeight = 52
|
||||||
|
ClientWidth = 181
|
||||||
|
TabOrder = 6
|
||||||
|
object rbBackwardSearch: TRadioButton
|
||||||
|
Left = 16
|
||||||
|
Height = 19
|
||||||
|
Top = 0
|
||||||
|
Width = 108
|
||||||
|
Caption = 'Backward search'
|
||||||
|
Checked = True
|
||||||
|
TabOrder = 0
|
||||||
|
TabStop = True
|
||||||
|
end
|
||||||
|
object rbForwardSearch: TRadioButton
|
||||||
|
Left = 16
|
||||||
|
Height = 19
|
||||||
|
Top = 24
|
||||||
|
Width = 100
|
||||||
|
Caption = 'Forward search'
|
||||||
|
TabOrder = 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
51
components/jvcllaz/examples/JvHTML/demoform.pas
Normal file
51
components/jvcllaz/examples/JvHTML/demoform.pas
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
unit DemoForm;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TForm2 }
|
||||||
|
|
||||||
|
TForm2 = class(TForm)
|
||||||
|
btnFind: TButton;
|
||||||
|
btnCancel: TButton;
|
||||||
|
btnHelp: TButton;
|
||||||
|
cbReplaceWith: TCheckBox;
|
||||||
|
cbCaseSensitive: TCheckBox;
|
||||||
|
cbWholeWordsOnly: TCheckBox;
|
||||||
|
cbRegularExpressions: TCheckBox;
|
||||||
|
cbMultilinePattern: TCheckBox;
|
||||||
|
cbPromptOnReplace: TCheckBox;
|
||||||
|
cmbReplaceWidth: TComboBox;
|
||||||
|
edName: TEdit;
|
||||||
|
gbOptions: TGroupBox;
|
||||||
|
gbOrigin: TGroupBox;
|
||||||
|
gbSearchScope: TGroupBox;
|
||||||
|
gbDirection: TGroupBox;
|
||||||
|
lblTextToFind: TLabel;
|
||||||
|
rbFromCursor: TRadioButton;
|
||||||
|
rbFromBeginning: TRadioButton;
|
||||||
|
rbSelectedText: TRadioButton;
|
||||||
|
rbGlobal: TRadioButton;
|
||||||
|
rbBackwardSearch: TRadioButton;
|
||||||
|
rbForwardSearch: TRadioButton;
|
||||||
|
private
|
||||||
|
|
||||||
|
public
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Form2: TForm2;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.lfm}
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
1221
components/jvcllaz/examples/JvHTML/htmltestform.lfm
Normal file
1221
components/jvcllaz/examples/JvHTML/htmltestform.lfm
Normal file
File diff suppressed because it is too large
Load Diff
111
components/jvcllaz/examples/JvHTML/htmltestform.pas
Normal file
111
components/jvcllaz/examples/JvHTML/htmltestform.pas
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
unit HTMLTestForm;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
|
||||||
|
ExtCtrls, SynEdit, SynHighlighterHTML, JvStringListToHtml, JvStrToHtml,
|
||||||
|
JvFormToHtml;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
{ TMainForm }
|
||||||
|
|
||||||
|
TMainForm = class(TForm)
|
||||||
|
Button1: TButton;
|
||||||
|
cbIncludeHeader: TCheckBox;
|
||||||
|
edHTMLTitle: TEdit;
|
||||||
|
edTextOut: TEdit;
|
||||||
|
edTextIn: TEdit;
|
||||||
|
edHTML: TEdit;
|
||||||
|
JvFormToHtml1: TJvFormToHtml;
|
||||||
|
JvStringListToHtml1: TJvStringListToHtml;
|
||||||
|
lblHTMLTitle: TLabel;
|
||||||
|
lblTextIn: TLabel;
|
||||||
|
lblTextAsHTML: TLabel;
|
||||||
|
lblTextOut: TLabel;
|
||||||
|
Memo: TMemo;
|
||||||
|
PageControl: TPageControl;
|
||||||
|
Splitter1: TSplitter;
|
||||||
|
FormSynEdit: TSynEdit;
|
||||||
|
StringsSynEdit: TSynEdit;
|
||||||
|
SynHTMLSyn: TSynHTMLSyn;
|
||||||
|
pgFormToHTML: TTabSheet;
|
||||||
|
pgStringToHTML: TTabSheet;
|
||||||
|
pgStringsToHTML: TTabSheet;
|
||||||
|
procedure Button1Click(Sender: TObject);
|
||||||
|
procedure cbIncludeHeaderChange(Sender: TObject);
|
||||||
|
procedure edHTMLTitleChange(Sender: TObject);
|
||||||
|
procedure edTextInChange(Sender: TObject);
|
||||||
|
procedure FormShow(Sender: TObject);
|
||||||
|
procedure MemoChange(Sender: TObject);
|
||||||
|
procedure Splitter1Moved(Sender: TObject);
|
||||||
|
private
|
||||||
|
|
||||||
|
public
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
MainForm: TMainForm;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.lfm}
|
||||||
|
|
||||||
|
uses
|
||||||
|
DemoForm;
|
||||||
|
|
||||||
|
{ TMainForm }
|
||||||
|
|
||||||
|
procedure TMainForm.Button1Click(Sender: TObject);
|
||||||
|
var
|
||||||
|
F: TForm2;
|
||||||
|
begin
|
||||||
|
F := TForm2.Create(nil);
|
||||||
|
try
|
||||||
|
JvFormToHtml1.FormToHtml(F, FormSynEdit.Lines);
|
||||||
|
F.ShowModal;
|
||||||
|
finally
|
||||||
|
F.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.cbIncludeHeaderChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
JvStringListToHTML1.IncludeHeader := cbIncludeHeader.Checked;
|
||||||
|
MemoChange(nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.edHTMLTitleChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
MemoChange(nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.edTextInChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
edHTML.Text := StringToHTML(edTextIn.Text);
|
||||||
|
edTextOut.Text := HTMLToString(edHTML.Text);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.FormShow(Sender: TObject);
|
||||||
|
begin
|
||||||
|
edTextInChange(nil);
|
||||||
|
MemoChange(nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.MemoChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
StringsSynEdit.Lines.Clear;
|
||||||
|
JvStringListToHTML1.ConvertToHTMLStrings(Memo.Lines, StringsSynEdit.Lines);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TMainForm.Splitter1Moved(Sender: TObject);
|
||||||
|
begin
|
||||||
|
MemoChange(nil);
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
|
|
@ -37,6 +37,7 @@ type
|
|||||||
TJvFormToHtml = class(TComponent) //TJvComponent)
|
TJvFormToHtml = class(TComponent) //TJvComponent)
|
||||||
public
|
public
|
||||||
procedure FormToHtml(const Form: TCustomForm; const Filename: string);
|
procedure FormToHtml(const Form: TCustomForm; const Filename: string);
|
||||||
|
procedure FormToHtml(const Form: TCustomForm; HTML: TStrings);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -54,13 +55,27 @@ end;
|
|||||||
|
|
||||||
procedure TJvFormToHtml.FormToHtml(const Form: TCustomForm; const Filename: string);
|
procedure TJvFormToHtml.FormToHtml(const Form: TCustomForm; const Filename: string);
|
||||||
var
|
var
|
||||||
I, J: Integer;
|
|
||||||
C: TComponent;
|
|
||||||
S, S2, St: string;
|
|
||||||
HTML: TStringList;
|
HTML: TStringList;
|
||||||
begin
|
begin
|
||||||
HTML := TStringList.Create;
|
HTML := TStringList.Create;
|
||||||
try
|
try
|
||||||
|
FormToHTML(Form, HTML);
|
||||||
|
HTML.SaveToFile(FileName);
|
||||||
|
finally
|
||||||
|
HTML.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJvFormToHtml.FormToHtml(const Form: TCustomForm;
|
||||||
|
HTML: TStrings);
|
||||||
|
var
|
||||||
|
I, J: Integer;
|
||||||
|
C: TComponent;
|
||||||
|
S, S2, St: string;
|
||||||
|
begin
|
||||||
|
if HTML = nil then
|
||||||
|
exit;
|
||||||
|
|
||||||
HTML.Add('<HTML><BODY>');
|
HTML.Add('<HTML><BODY>');
|
||||||
for I := 0 to Form.ComponentCount - 1 do
|
for I := 0 to Form.ComponentCount - 1 do
|
||||||
begin
|
begin
|
||||||
@ -249,11 +264,6 @@ begin
|
|||||||
HTML.Add(St);
|
HTML.Add(St);
|
||||||
end;
|
end;
|
||||||
HTML.Add('</BODY></HTML>');
|
HTML.Add('</BODY></HTML>');
|
||||||
|
|
||||||
HTML.SaveToFile(Filename);
|
|
||||||
finally
|
|
||||||
HTML.Free;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -130,12 +130,13 @@ end;
|
|||||||
|
|
||||||
procedure TJvStringListToHtml.DoStringsChange(Sender: TObject);
|
procedure TJvStringListToHtml.DoStringsChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
FreeAndNil(FHTML);
|
FHTML.Clear; // wp: clear instead of Free
|
||||||
|
// FreeAndNil(FHTML);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TJvStringListToHtml.GetHTML: TStrings;
|
function TJvStringListToHtml.GetHTML: TStrings;
|
||||||
begin
|
begin
|
||||||
if ComponentState * [csLoading, csDestroying] <> [] then
|
// if ComponentState * [csLoading, csDestroying] <> [] then // wp: removed
|
||||||
if FHTML.Count = 0 then
|
if FHTML.Count = 0 then
|
||||||
ConvertToHTMLStrings(Strings, FHTML);
|
ConvertToHTMLStrings(Strings, FHTML);
|
||||||
Result := FHTML;
|
Result := FHTML;
|
||||||
|
@ -320,12 +320,8 @@ const
|
|||||||
var
|
var
|
||||||
ConversionsHash: array of Word;
|
ConversionsHash: array of Word;
|
||||||
|
|
||||||
{$IFNDEF UNICODE}
|
|
||||||
const
|
|
||||||
MB_ERR_INVALID_CHARS = 8;
|
|
||||||
{$ENDIF ~UNICODE}
|
|
||||||
|
|
||||||
{ TJvStrToHtml }
|
{ TJvStrToHtml }
|
||||||
|
|
||||||
constructor TJvStrToHtml.Create(AOwner: TComponent);
|
constructor TJvStrToHtml.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
@ -478,6 +474,7 @@ begin
|
|||||||
if not found then begin
|
if not found then begin
|
||||||
Delete(html, Length(html), 1);
|
Delete(html, Length(html), 1);
|
||||||
Delete(html, 1, 1);
|
Delete(html, 1, 1);
|
||||||
|
if html[1] = '#' then Delete(html, 1, 1);
|
||||||
if html[1] = 'x' then html[1] := '$';
|
if html[1] = 'x' then html[1] := '$';
|
||||||
Append(UnicodeToUTF8(StrToInt(html)));
|
Append(UnicodeToUTF8(StrToInt(html)));
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user