diff --git a/.gitattributes b/.gitattributes
index 7d50c9bbc0..e9a4bedc87 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1260,6 +1260,8 @@ components/fpvectorial/examples/fpvectorialconverter.lpi svneol=native#text/plai
components/fpvectorial/examples/fpvectorialconverter.lpr svneol=native#text/plain
components/fpvectorial/examples/fpvmodifytest.lpi svneol=native#text/plain
components/fpvectorial/examples/fpvmodifytest.pas svneol=native#text/plain
+components/fpvectorial/examples/fpvtextwritetest.lpi svneol=native#text/plain
+components/fpvectorial/examples/fpvtextwritetest.pas svneol=native#text/plain
components/fpvectorial/examples/fpvwritetest.lpi svneol=native#text/plain
components/fpvectorial/examples/fpvwritetest.pas svneol=native#text/plain
components/fpvectorial/fpvectbuildunit.pas svneol=native#text/plain
diff --git a/components/fpvectorial/examples/fpvtextwritetest.lpi b/components/fpvectorial/examples/fpvtextwritetest.lpi
new file mode 100644
index 0000000000..aef9f58776
--- /dev/null
+++ b/components/fpvectorial/examples/fpvtextwritetest.lpi
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/fpvectorial/examples/fpvtextwritetest.pas b/components/fpvectorial/examples/fpvtextwritetest.pas
new file mode 100644
index 0000000000..f8ec01a9b4
--- /dev/null
+++ b/components/fpvectorial/examples/fpvtextwritetest.pas
@@ -0,0 +1,36 @@
+{
+FPVectorial example application for writing a text document file to disk.
+
+Author: Felipe Monteiro de Carvalho
+
+License: Public Domain
+}
+program fpvtextwritetest;
+
+{$mode objfpc}{$H+}
+
+uses
+ fpvectorial, odtvectorialwriter, fpvutils, fpvectorialpkg;
+
+var
+ Vec: TvVectorialDocument;
+ Page: TvTextPageSequence;
+begin
+ Vec := TvVectorialDocument.Create;
+ try
+ // A4 -> 210mm x 297mm
+ Vec.Width := 210;
+ Vec.Height := 297;
+ Page := Vec.AddTextPageSequence();
+
+ // First page sequence
+ {Page.StartPath(0, 20);
+ Page.AddLineToPath(30, 30);
+ Page.EndPath();}
+
+ Vec.WriteToFile('text_output.odt', vfODT);
+ finally
+ Vec.Free;
+ end;
+end.
+
diff --git a/components/fpvectorial/fpvectorial.pas b/components/fpvectorial/fpvectorial.pas
index 1122c16d60..e54da3e2d7 100644
--- a/components/fpvectorial/fpvectorial.pas
+++ b/components/fpvectorial/fpvectorial.pas
@@ -90,7 +90,7 @@ type
TvCustomVectorialWriter = class;
TvCustomVectorialReader = class;
TvVectorialPage = class;
- TvTextDocumentPage = class;
+ TvTextPageSequence = class;
{ Pen, Brush and Font }
@@ -819,7 +819,7 @@ type
function GetCurrentPage: TvVectorialPage;
procedure SetCurrentPage(AIndex: Integer);
function AddPage(): TvVectorialPage;
- function AddTextPage(): TvTextDocumentPage;
+ function AddTextPageSequence(): TvTextPageSequence;
{ Data removing methods }
procedure Clear; virtual;
{ Debug methods }
@@ -916,9 +916,9 @@ type
property Entities[AIndex: Cardinal]: TvEntity read GetEntity;
end;
- { TvTextDocumentPage }
+ { TvTextPageSequence }
- TvTextDocumentPage = class(TvVectorialPage)
+ TvTextPageSequence = class(TvVectorialPage)
public
Footer, Header: TvRichText;
MainText: TvRichText;
@@ -4651,19 +4651,19 @@ begin
end;
end;
-{ TvTextDocumentPage }
+{ TvTextPageSequence }
-constructor TvTextDocumentPage.Create(AOwner: TvVectorialDocument);
+constructor TvTextPageSequence.Create(AOwner: TvVectorialDocument);
begin
inherited Create(AOwner);
end;
-destructor TvTextDocumentPage.Destroy;
+destructor TvTextPageSequence.Destroy;
begin
inherited Destroy;
end;
-procedure TvTextDocumentPage.Assign(ASource: TvVectorialPage);
+procedure TvTextPageSequence.Assign(ASource: TvVectorialPage);
begin
inherited Assign(ASource);
end;
@@ -4964,9 +4964,9 @@ begin
if FCurrentPageIndex < 0 then FCurrentPageIndex := FPages.Count-1;
end;
-function TvVectorialDocument.AddTextPage: TvTextDocumentPage;
+function TvVectorialDocument.AddTextPageSequence: TvTextPageSequence;
begin
- Result := TvTextDocumentPage.Create(Self);
+ Result := TvTextPageSequence.Create(Self);
FPages.Add(Result);
if FCurrentPageIndex < 0 then FCurrentPageIndex := FPages.Count-1;
end;
diff --git a/components/fpvectorial/odtvectorialwriter.pas b/components/fpvectorial/odtvectorialwriter.pas
index 9adf3c67c8..f32915ecbe 100644
--- a/components/fpvectorial/odtvectorialwriter.pas
+++ b/components/fpvectorial/odtvectorialwriter.pas
@@ -69,7 +69,7 @@ type
procedure WriteSettings;
procedure WriteStyles;
procedure WriteDocument(AData: TvVectorialDocument);
- procedure WritePage(ACurPage: TvTextDocumentPage);
+ procedure WritePage(ACurPage: TvTextPageSequence);
// Routines to write parts of those files
function WriteStylesXMLAsString: string;
//
@@ -97,34 +97,45 @@ const
OPENDOC_PATH_METAINF_MANIFEST = 'META-INF' + '/' + 'manifest.xml';
{ OpenDocument schemas constants }
- SCHEMAS_XMLNS_OFFICE = 'urn:oasis:names:tc:opendocument:xmlns:office:1.0';
- SCHEMAS_XMLNS_DCTERMS = 'http://purl.org/dc/terms/';
- SCHEMAS_XMLNS_META = 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0';
SCHEMAS_XMLNS = 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties';
+ SCHEMAS_XMLNS_CALCEXT = 'urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0';
+ SCHEMAS_XMLNS_CHART = 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0';
SCHEMAS_XMLNS_CONFIG = 'urn:oasis:names:tc:opendocument:xmlns:config:1.0';
- SCHEMAS_XMLNS_OOO = 'http://openoffice.org/2004/office';
- SCHEMAS_XMLNS_MANIFEST = 'urn:oasis:names:tc:opendocument:xmlns:manifest:1.0';
+ SCHEMAS_XMLNS_CSS3T = 'http://www.w3.org/TR/css3-text/';
+ SCHEMAS_XMLNS_DC = 'http://purl.org/dc/elements/1.1/';
+ SCHEMAS_XMLNS_DCTERMS = 'http://purl.org/dc/terms/';
+ SCHEMAS_XMLNS_DOM = 'http://www.w3.org/2001/xml-events';
+ SCHEMAS_XMLNS_DR3D = 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0';
+ SCHEMAS_XMLNS_DRAW = 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0';
+ SCHEMAS_XMLNS_DRAWOOO = 'http://openoffice.org/2010/draw';
+ SCHEMAS_XMLNS_FIELD = 'urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0';
SCHEMAS_XMLNS_FO = 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0';
+ SCHEMAS_XMLNS_FORM = 'urn:oasis:names:tc:opendocument:xmlns:form:1.0';
+ SCHEMAS_XMLNS_FORMX = 'urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0';
+ SCHEMAS_XMLNS_GRDDL = 'http://www.w3.org/2003/g/data-view#';
+ SCHEMAS_XMLNS_MANIFEST = 'urn:oasis:names:tc:opendocument:xmlns:manifest:1.0';
+ SCHEMAS_XMLNS_MATH = 'http://www.w3.org/1998/Math/MathML';
+ SCHEMAS_XMLNS_META = 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0';
+ SCHEMAS_XMLNS_NUMBER = 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0';
+ SCHEMAS_XMLNS_OF = 'urn:oasis:names:tc:opendocument:xmlns:of:1.2';
+ SCHEMAS_XMLNS_OFFICE = 'urn:oasis:names:tc:opendocument:xmlns:office:1.0';
+ SCHEMAS_XMLNS_OFFICEOOO= 'http://openoffice.org/2009/office';
+ SCHEMAS_XMLNS_OOO = 'http://openoffice.org/2004/office';
+ SCHEMAS_XMLNS_OOOC = 'http://openoffice.org/2004/calc';
+ SCHEMAS_XMLNS_OOOW = 'http://openoffice.org/2004/writer';
+ SCHEMAS_XMLNS_RPT = 'http://openoffice.org/2005/report';
+ SCHEMAS_XMLNS_SCRIPT = 'urn:oasis:names:tc:opendocument:xmlns:script:1.0';
SCHEMAS_XMLNS_STYLE = 'urn:oasis:names:tc:opendocument:xmlns:style:1.0';
SCHEMAS_XMLNS_SVG = 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0';
SCHEMAS_XMLNS_TABLE = 'urn:oasis:names:tc:opendocument:xmlns:table:1.0';
+ SCHEMAS_XMLNS_TABLEOOO = 'http://openoffice.org/2009/table';
SCHEMAS_XMLNS_TEXT = 'urn:oasis:names:tc:opendocument:xmlns:text:1.0';
SCHEMAS_XMLNS_V = 'urn:schemas-microsoft-com:vml';
- SCHEMAS_XMLNS_NUMBER = 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0';
- SCHEMAS_XMLNS_CHART = 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0';
- SCHEMAS_XMLNS_DR3D = 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0';
- SCHEMAS_XMLNS_MATH = 'http://www.w3.org/1998/Math/MathML';
- SCHEMAS_XMLNS_FORM = 'urn:oasis:names:tc:opendocument:xmlns:form:1.0';
- SCHEMAS_XMLNS_SCRIPT = 'urn:oasis:names:tc:opendocument:xmlns:script:1.0';
- SCHEMAS_XMLNS_OOOW = 'http://openoffice.org/2004/writer';
- SCHEMAS_XMLNS_OOOC = 'http://openoffice.org/2004/calc';
- SCHEMAS_XMLNS_DOM = 'http://www.w3.org/2001/xml-events';
SCHEMAS_XMLNS_XFORMS = 'http://www.w3.org/2002/xforms';
+ SCHEMAS_XMLNS_XHTML = 'http://www.w3.org/1999/xhtml';
+ SCHEMAS_XMLNS_XLINK = 'http://www.w3.org/1999/xlink';
SCHEMAS_XMLNS_XSD = 'http://www.w3.org/2001/XMLSchema';
SCHEMAS_XMLNS_XSI = 'http://www.w3.org/2001/XMLSchema-instance';
- SCHEMAS_XMLNS_GRDDL = 'http://www.w3.org/2003/g/data-view#';
- SCHEMAS_XMLNS_XLINK = 'http://www.w3.org/1999/xlink';
- SCHEMAS_XMLNS_DC = 'http://purl.org/dc/elements/1.1/';
// SVG requires hardcoding a DPI value
@@ -492,10 +503,193 @@ end;
procedure TvODTVectorialWriter.WriteDocument(AData: TvVectorialDocument);
begin
+ FContent :=
+ XML_HEADER + LineEnding +
+ '' + LineEnding;
+ FContent := FContent +
+ ' ' + LineEnding;
+{
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ }
+ FContent := FContent +
+ ' ' + LineEnding;
+
+{
+
+
+
+
+
+
+
+ Lazarus
+ Lazarus is a free and open source development tool for the Free Pascal compiler, which is also free and open source.
+ Overview
+ Lazarus is a free cross-platform visual integrated development environment (IDE) for rapid application development (RAD) using the Free Pascal compiler supported dialects of Object Pascal. Developers use Lazarus to create native code console and graphical user interface (GUI) applications for the desktop along with mobile devices, web applications, web services, and visual components and function libraries (.so, .dll, etc) for use by other programs for any platform the Free Pascal compiler supports( Mac, Unix, Linux, Windows, etc).
+
+ Lazarus provides a highly visual development environment for the creation of rich user interfaces, application logic, and other supporting code artifacts. Along with the customary project management features, the Lazarus IDE also provides features that includes but are not limited to:
+
+
+
+ A What You See Is What You Get (WYSIWYG) visual windows layout designer
+
+
+ An extensive set of GUI widgets or visual components such as edit boxes, buttons, dialogs, menus, etc.
+
+
+ An extensive set of non visual components for common behaviors such as persistence of application settings
+
+
+ A set of data connectivity components for MySQL, PostgresSQL, FireBird, Oracle, SQL Lite, Sybase, and others
+
+
+ Data aware widget set that allows the developer to see data in visual components in the designer to assist with development
+
+
+ Interactive code debugger
+
+
+ Code completion
+
+
+ Code templates
+
+
+ Syntax highlighting
+
+
+ Context sensitive help
+
+
+ Text resource manager for internationalization
+
+
+ Automatic code formatting
+
+
+ The ability to create custom components
+
+
+
+ Lazarus inherits three features from its use of the Free Pascal compiler: compile and execution speed, and cross-compilation. The Free Pascal compiler benefits from the Pascal language structure, which is rigid, and the steady advancements of Pascal compiler design, spanning several decades, to compile large applications quickly, often seconds.
+
+}
+
+ FContent := FContent +
+ ' ' + LineEnding;
+ FContent := FContent +
+ '' + LineEnding;
end;
-procedure TvODTVectorialWriter.WritePage(ACurPage: TvTextDocumentPage);
+procedure TvODTVectorialWriter.WritePage(ACurPage: TvTextPageSequence);
begin
end;