Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync #153

Merged
merged 21 commits into from
Jun 21, 2024
Merged

sync #153

Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Daten/FPC/Prj_WriteOdf.lpi
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="Prj_WriteOdf"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
Expand Down Expand Up @@ -93,7 +95,6 @@
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<RequiredPackages Count="3">
<Item1>
Expand Down Expand Up @@ -139,6 +140,9 @@
<UnitOutputDirectory Value="..\..\bin\$(TargetCPU)-$(TargetOS)\units"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
Expand Down
Binary file modified Daten/FPC/Prj_WriteOdf.res
Binary file not shown.
89 changes: 73 additions & 16 deletions Daten/Source/WriteOdf/Frm_WriteOdfMain.lfm
Original file line number Diff line number Diff line change
@@ -1,53 +1,110 @@
object FrmWriteOdfMain: TFrmWriteOdfMain
Left = 463
Height = 807
Height = 538
Top = 250
Width = 1139
Width = 759
Caption = 'FrmWriteOdfMain'
ClientHeight = 807
ClientWidth = 1139
DesignTimePPI = 144
ClientHeight = 538
ClientWidth = 759
OnCreate = FormCreate
OnDestroy = FormDestroy
LCLVersion = '2.0.4.0'
LCLVersion = '2.0.12.0'
inline RTFEditFrame1: TRTFEditFrame
Height = 756
Top = 51
Width = 584
Width = 389
Align = alLeft
ClientHeight = 756
ClientWidth = 584
ClientWidth = 389
Visible = True
inherited RichMemo1: TRichMemo
Height = 692
Width = 560
Left = 5
Height = 713
Top = 27
Width = 568
Lines.Strings = (
'RichMemo1'
)
end
inherited btnJA: TSpeedButton
Left = 192
Height = 15
Top = 5
Width = 21
end
inherited btnCA: TSpeedButton
Left = 149
Height = 15
Top = 5
Width = 21
end
inherited btnLA: TSpeedButton
Left = 128
Height = 15
Top = 5
Width = 21
end
inherited btnRA: TSpeedButton
Left = 171
Height = 15
Top = 5
Width = 21
end
inherited btnBold: TSpeedButton
Left = 75
Height = 15
Top = 5
Width = 15
end
inherited btnItalic: TSpeedButton
Left = 91
Height = 15
Top = 5
Width = 15
end
inherited btnUnderline: TSpeedButton
Left = 107
Height = 15
Top = 5
Width = 15
end
inherited btnFont: TSpeedButton
Left = 5
Height = 15
Top = 5
Width = 32
end
inherited btnColor: TSpeedButton
Left = 37
Height = 15
Top = 5
Width = 32
end
end
object Button1: TButton
Left = 632
Height = 38
Top = 88
Width = 113
Left = 421
Height = 25
Top = 59
Width = 75
Caption = 'Button1'
OnClick = Button1Click
ParentFont = False
TabOrder = 1
end
object Splitter1: TSplitter
Left = 584
Height = 756
Top = 51
Width = 8
Width = 5
end
object Panel1: TPanel
Left = 0
Height = 51
Height = 34
Top = 0
Width = 1139
Align = alTop
Caption = 'Panel1'
ParentFont = False
TabOrder = 3
end
end
28 changes: 27 additions & 1 deletion Daten/Source/WriteOdf/Frm_WriteOdfMain.pas
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ procedure TFrmWriteOdfMain.Button1Click(Sender: TObject);

begin
FOdfTextDocument.Clear;

FOdfTextDocument.AddTOC('Inhalt',3);

FOdfTextDocument.AddHeadline(1).AppendText('Demonstration von fpOdf');
FOdfTextDocument.AddHeadline(2).AppendText('Überschriften');
for i := 3 to 8 do
Expand All @@ -67,6 +70,7 @@ procedure TFrmWriteOdfMain.Button1Click(Sender: TObject);
lpara.AddSpan('Hello', [fsBold]);
lpara.AppendOdfElement(oetTextLineBreak);
lpara.AddSpan('World', [fsItalic]);
// lpara.AddGraphic(
lPara := FOdfTextDocument.AddParagraph(cStyleName);
lpara.AddSpan('Hello', [fsUnderline]);
lpara.AppendOdfElement(oetTextLineBreak);
Expand Down Expand Up @@ -104,14 +108,23 @@ procedure TFrmWriteOdfMain.Button1Click(Sender: TObject);
end;

FOdfTextDocument.AddHeadline(2).AppendText('Schriftarten');
lFirstChar := '!';
lPara := FOdfTextDocument.AddParagraph(cStyleName);
for lFont in Screen.Fonts do
if copy(lfont, 1, 1) <> lFirstChar then
begin
lPara.AddLink('[' + copy(lfont, 1, 1)+']', [], 'FS' + copy(lfont, 1, 1));
lFirstChar := copy(lfont, 1, 1);
end;

lFirstChar := '!';
aFont := TFont.Create;
try
for lFont in Screen.Fonts do
begin
if copy(lfont, 1, 1) <> lFirstChar then
begin
FOdfTextDocument.AddHeadline(4).AppendText(copy(lfont, 1, 1));
TOdfParagraph(FOdfTextDocument.AddHeadline(3)).AddBookmark(copy(lfont, 1, 1), [], 'FS' + copy(lfont, 1, 1));
lFirstChar := copy(lfont, 1, 1);
end;
lPara := FOdfTextDocument.AddParagraph(cStyleName);
Expand All @@ -125,6 +138,19 @@ procedure TFrmWriteOdfMain.Button1Click(Sender: TObject);
finally
FreeAndNil(aFont)
end;

FOdfTextDocument.AddHeadline(2).AppendText('Langer Absatz');
lPara := FOdfTextDocument.AddParagraph(cStyleName);
lPara.AppendText('Lorem ipsum dolor sit amet, consetetur sadipscing elitr, '+
'sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam '+
'erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea '+
'rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum '+
'dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, '+
'sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam '+
'erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea '+
'rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum '+
'dolor sit amet. (ENDE)');

FOdfTextDocument.AddHeadline(2).AppendText('Schriftfarben');
lText := 'Bringt mehr Farben ins Leben, denn Farben machen das Leben bunt, und streicheln das Gemüt.';
lPara := FOdfTextDocument.AddParagraph(cStyleName);
Expand Down