You've already forked lazarus-ccr
Adds bold style support to OpenDocument
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1400 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -1,21 +1,23 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="9"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="7"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<LRSInOutputDirectory Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
<Title Value="opendocwrite"/>
|
||||
<UseAppBundle Value="False"/>
|
||||
<ActiveEditorIndexAtStart Value="1"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
<ProjectVersion Value=""/>
|
||||
<StringTable ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IgnoreBinaries Value="False"/>
|
||||
@@ -33,328 +35,30 @@
|
||||
<PackageName Value="laz_fpspreadsheet"/>
|
||||
</Item1>
|
||||
</RequiredPackages>
|
||||
<Units Count="24">
|
||||
<Units Count="1">
|
||||
<Unit0>
|
||||
<Filename Value="opendocwrite.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="opendocwrite"/>
|
||||
<CursorPos X="33" Y="35"/>
|
||||
<TopLine Value="6"/>
|
||||
<EditorIndex Value="0"/>
|
||||
<UsageCount Value="309"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="..\fpolestorage.pas"/>
|
||||
<UnitName Value="fpolestorage"/>
|
||||
<CursorPos X="1" Y="1"/>
|
||||
<TopLine Value="1"/>
|
||||
<UsageCount Value="19"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="..\..\..\..\..\lazarus\lcl\interfaces\win32\win32wsstdctrls.pp"/>
|
||||
<UnitName Value="Win32WSStdCtrls"/>
|
||||
<CursorPos X="35" Y="720"/>
|
||||
<TopLine Value="713"/>
|
||||
<UsageCount Value="76"/>
|
||||
</Unit2>
|
||||
<Unit3>
|
||||
<Filename Value="..\..\..\..\..\lazarus\ideintf\componenteditors.pas"/>
|
||||
<UnitName Value="ComponentEditors"/>
|
||||
<CursorPos X="40" Y="332"/>
|
||||
<TopLine Value="330"/>
|
||||
<UsageCount Value="74"/>
|
||||
</Unit3>
|
||||
<Unit4>
|
||||
<Filename Value="..\..\xlsbiff5.pas"/>
|
||||
<UnitName Value="xlsbiff5"/>
|
||||
<CursorPos X="38" Y="1059"/>
|
||||
<TopLine Value="1045"/>
|
||||
<EditorIndex Value="10"/>
|
||||
<UsageCount Value="140"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit4>
|
||||
<Unit5>
|
||||
<Filename Value="..\..\fpsutils.pas"/>
|
||||
<UnitName Value="fpsutils"/>
|
||||
<CursorPos X="1" Y="49"/>
|
||||
<TopLine Value="30"/>
|
||||
<EditorIndex Value="9"/>
|
||||
<UsageCount Value="140"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit5>
|
||||
<Unit6>
|
||||
<Filename Value="..\..\xlsbiff2.pas"/>
|
||||
<UnitName Value="xlsbiff2"/>
|
||||
<CursorPos X="25" Y="216"/>
|
||||
<TopLine Value="203"/>
|
||||
<EditorIndex Value="11"/>
|
||||
<UsageCount Value="139"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit6>
|
||||
<Unit7>
|
||||
<Filename Value="..\..\fpolestorage.pas"/>
|
||||
<UnitName Value="fpolestorage"/>
|
||||
<CursorPos X="30" Y="654"/>
|
||||
<TopLine Value="642"/>
|
||||
<EditorIndex Value="12"/>
|
||||
<UsageCount Value="139"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit7>
|
||||
<Unit8>
|
||||
<Filename Value="..\..\..\..\..\lazarus26\fpc\2.2.2\source\rtl\objpas\classes\classesh.inc"/>
|
||||
<CursorPos X="19" Y="562"/>
|
||||
<TopLine Value="553"/>
|
||||
<UsageCount Value="41"/>
|
||||
</Unit8>
|
||||
<Unit9>
|
||||
<Filename Value="..\..\..\..\..\lazarus26\fpc\2.2.2\source\rtl\objpas\classes\streams.inc"/>
|
||||
<CursorPos X="21" Y="158"/>
|
||||
<TopLine Value="151"/>
|
||||
<UsageCount Value="41"/>
|
||||
</Unit9>
|
||||
<Unit10>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<UnitName Value="fpspreadsheet"/>
|
||||
<CursorPos X="20" Y="112"/>
|
||||
<TopLine Value="118"/>
|
||||
<EditorIndex Value="6"/>
|
||||
<UsageCount Value="100"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit10>
|
||||
<Unit11>
|
||||
<Filename Value="..\..\..\..\..\lazarus\lcl\include\customtrayicon.inc"/>
|
||||
<CursorPos X="22" Y="203"/>
|
||||
<TopLine Value="197"/>
|
||||
<UsageCount Value="67"/>
|
||||
</Unit11>
|
||||
<Unit12>
|
||||
<Filename Value="..\..\fpsopendocument.pas"/>
|
||||
<UnitName Value="fpsopendocument"/>
|
||||
<CursorPos X="1" Y="384"/>
|
||||
<TopLine Value="373"/>
|
||||
<EditorIndex Value="4"/>
|
||||
<UsageCount Value="22"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit12>
|
||||
<Unit13>
|
||||
<Filename Value="..\..\xlsxooxml.pas"/>
|
||||
<UnitName Value="xlsxooxml"/>
|
||||
<CursorPos X="1" Y="35"/>
|
||||
<TopLine Value="16"/>
|
||||
<EditorIndex Value="5"/>
|
||||
<UsageCount Value="22"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit13>
|
||||
<Unit14>
|
||||
<Filename Value="..\..\..\..\..\..\usr\local\share\fpcsrc\rtl\objpas\sysutils\sysstrh.inc"/>
|
||||
<CursorPos X="38" Y="145"/>
|
||||
<TopLine Value="141"/>
|
||||
<UsageCount Value="15"/>
|
||||
</Unit14>
|
||||
<Unit15>
|
||||
<Filename Value="..\..\fpsallformats.pas"/>
|
||||
<UnitName Value="fpsallformats"/>
|
||||
<CursorPos X="44" Y="13"/>
|
||||
<TopLine Value="1"/>
|
||||
<EditorIndex Value="3"/>
|
||||
<UsageCount Value="17"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit15>
|
||||
<Unit16>
|
||||
<Filename Value="..\..\..\..\..\..\usr\local\share\fpcsrc\packages\paszlib\src\zipper.pp"/>
|
||||
<UnitName Value="zipper"/>
|
||||
<CursorPos X="24" Y="7"/>
|
||||
<TopLine Value="1"/>
|
||||
<UsageCount Value="12"/>
|
||||
</Unit16>
|
||||
<Unit17>
|
||||
<Filename Value="..\..\..\..\..\..\usr\local\share\fpcsrc\rtl\objpas\sysutils\finah.inc"/>
|
||||
<CursorPos X="27" Y="25"/>
|
||||
<TopLine Value="17"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit17>
|
||||
<Unit18>
|
||||
<Filename Value="..\..\..\..\..\..\usr\local\share\fpcsrc\rtl\objpas\sysutils\fina.inc"/>
|
||||
<CursorPos X="28" Y="258"/>
|
||||
<TopLine Value="249"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit18>
|
||||
<Unit19>
|
||||
<Filename Value="..\..\fpszipper.pp"/>
|
||||
<UnitName Value="fpszipper"/>
|
||||
<CursorPos X="36" Y="9"/>
|
||||
<TopLine Value="1"/>
|
||||
<EditorIndex Value="8"/>
|
||||
<UsageCount Value="14"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit19>
|
||||
<Unit20>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
<CursorPos X="1" Y="1"/>
|
||||
<TopLine Value="1"/>
|
||||
<UsageCount Value="10"/>
|
||||
</Unit20>
|
||||
<Unit21>
|
||||
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
||||
<UnitName Value="fpspreadsheetgrid"/>
|
||||
<CursorPos X="31" Y="66"/>
|
||||
<TopLine Value="36"/>
|
||||
<EditorIndex Value="1"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit21>
|
||||
<Unit22>
|
||||
<Filename Value="..\..\..\..\..\lazarus\lcl\grids.pas"/>
|
||||
<UnitName Value="Grids"/>
|
||||
<CursorPos X="17" Y="1415"/>
|
||||
<TopLine Value="1396"/>
|
||||
<EditorIndex Value="2"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit22>
|
||||
<Unit23>
|
||||
<Filename Value="..\..\..\..\..\lazarus27\fpc\2.2.4\source\packages\fcl-base\src\avl_tree.pp"/>
|
||||
<UnitName Value="AVL_Tree"/>
|
||||
<CursorPos X="1" Y="58"/>
|
||||
<TopLine Value="39"/>
|
||||
<EditorIndex Value="7"/>
|
||||
<UsageCount Value="10"/>
|
||||
<Loaded Value="True"/>
|
||||
</Unit23>
|
||||
</Units>
|
||||
<JumpHistory Count="30" HistoryIndex="29">
|
||||
<Position1>
|
||||
<Filename Value="..\..\xlsxooxml.pas"/>
|
||||
<Caret Line="103" Column="31" TopLine="103"/>
|
||||
</Position1>
|
||||
<Position2>
|
||||
<Filename Value="..\..\xlsxooxml.pas"/>
|
||||
<Caret Line="51" Column="15" TopLine="50"/>
|
||||
</Position2>
|
||||
<Position3>
|
||||
<Filename Value="..\..\xlsxooxml.pas"/>
|
||||
<Caret Line="249" Column="5" TopLine="224"/>
|
||||
</Position3>
|
||||
<Position4>
|
||||
<Filename Value="..\..\xlsxooxml.pas"/>
|
||||
<Caret Line="242" Column="1" TopLine="238"/>
|
||||
</Position4>
|
||||
<Position5>
|
||||
<Filename Value="opendocwrite.lpr"/>
|
||||
<Caret Line="30" Column="5" TopLine="10"/>
|
||||
</Position5>
|
||||
<Position6>
|
||||
<Filename Value="..\..\fpsopendocument.pas"/>
|
||||
<Caret Line="51" Column="22" TopLine="39"/>
|
||||
</Position6>
|
||||
<Position7>
|
||||
<Filename Value="..\..\fpsopendocument.pas"/>
|
||||
<Caret Line="68" Column="10" TopLine="55"/>
|
||||
</Position7>
|
||||
<Position8>
|
||||
<Filename Value="..\..\xlsxooxml.pas"/>
|
||||
<Caret Line="268" Column="5" TopLine="244"/>
|
||||
</Position8>
|
||||
<Position9>
|
||||
<Filename Value="..\..\fpsopendocument.pas"/>
|
||||
<Caret Line="38" Column="36" TopLine="32"/>
|
||||
</Position9>
|
||||
<Position10>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="62" Column="4" TopLine="52"/>
|
||||
</Position10>
|
||||
<Position11>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="66" Column="21" TopLine="53"/>
|
||||
</Position11>
|
||||
<Position12>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="102" Column="20" TopLine="89"/>
|
||||
</Position12>
|
||||
<Position13>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="105" Column="20" TopLine="94"/>
|
||||
</Position13>
|
||||
<Position14>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="764" Column="1" TopLine="739"/>
|
||||
</Position14>
|
||||
<Position15>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="777" Column="36" TopLine="767"/>
|
||||
</Position15>
|
||||
<Position16>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="785" Column="10" TopLine="762"/>
|
||||
</Position16>
|
||||
<Position17>
|
||||
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
||||
<Caret Line="11" Column="33" TopLine="1"/>
|
||||
</Position17>
|
||||
<Position18>
|
||||
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
||||
<Caret Line="9" Column="8" TopLine="1"/>
|
||||
</Position18>
|
||||
<Position19>
|
||||
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
||||
<Caret Line="15" Column="3" TopLine="1"/>
|
||||
</Position19>
|
||||
<Position20>
|
||||
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
||||
<Caret Line="46" Column="1" TopLine="9"/>
|
||||
</Position20>
|
||||
<Position21>
|
||||
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
||||
<Caret Line="14" Column="6" TopLine="9"/>
|
||||
</Position21>
|
||||
<Position22>
|
||||
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
||||
<Caret Line="43" Column="36" TopLine="9"/>
|
||||
</Position22>
|
||||
<Position23>
|
||||
<Filename Value="..\..\fpspreadsheetgrid.pas"/>
|
||||
<Caret Line="60" Column="8" TopLine="26"/>
|
||||
</Position23>
|
||||
<Position24>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="344" Column="11" TopLine="335"/>
|
||||
</Position24>
|
||||
<Position25>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="1" Column="1" TopLine="1"/>
|
||||
</Position25>
|
||||
<Position26>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="338" Column="52" TopLine="319"/>
|
||||
</Position26>
|
||||
<Position27>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="355" Column="5" TopLine="318"/>
|
||||
</Position27>
|
||||
<Position28>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="101" Column="16" TopLine="93"/>
|
||||
</Position28>
|
||||
<Position29>
|
||||
<Filename Value="..\..\..\..\..\lazarus27\fpc\2.2.4\source\packages\fcl-base\src\avl_tree.pp"/>
|
||||
<Caret Line="58" Column="18" TopLine="38"/>
|
||||
</Position29>
|
||||
<Position30>
|
||||
<Filename Value="..\..\fpspreadsheet.pas"/>
|
||||
<Caret Line="362" Column="5" TopLine="325"/>
|
||||
</Position30>
|
||||
</JumpHistory>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="8"/>
|
||||
<Version Value="9"/>
|
||||
<PathDelim Value="\"/>
|
||||
<SearchPaths>
|
||||
<OtherUnitFiles Value="..\"/>
|
||||
<SrcPath Value="..\"/>
|
||||
<OtherUnitFiles Value=".."/>
|
||||
<SrcPath Value=".."/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<UseAnsiStrings Value="False"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<Other>
|
||||
<CompilerMessages>
|
||||
<UseMsgFile Value="True"/>
|
||||
</CompilerMessages>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
|
@@ -31,6 +31,8 @@ begin
|
||||
MyWorksheet.WriteNumber(0, 3, 4.0);// D1
|
||||
MyWorksheet.WriteUTF8Text(4, 2, 'Total:');// C5
|
||||
MyWorksheet.WriteNumber(4, 3, 10); // D5
|
||||
// Add some formatting
|
||||
MyWorksheet.WriteUsedFormatting(0, 0, [uffBold]);
|
||||
|
||||
// Creates a new worksheet
|
||||
MyWorksheet := MyWorkbook.AddWorksheet('My Worksheet 2');
|
||||
|
@@ -60,7 +60,11 @@ type
|
||||
FSMeta, FSSettings, FSStyles, FSContent, FSMimetype: TStringStream;
|
||||
FSMetaInfManifest: TStringStream;
|
||||
// Routines to write those files
|
||||
procedure WriteGlobalFiles;
|
||||
procedure WriteMimetype;
|
||||
procedure WriteMetaInfManifest;
|
||||
procedure WriteMeta;
|
||||
procedure WriteSettings;
|
||||
procedure WriteStyles;
|
||||
procedure WriteContent(AData: TsWorkbook);
|
||||
procedure WriteWorksheet(CurSheet: TsWorksheet);
|
||||
public
|
||||
@@ -72,7 +76,7 @@ type
|
||||
{ Record writing methods }
|
||||
procedure WriteFormula(AStream: TStream; const ARow, ACol: Word; const AFormula: TsFormula); override;
|
||||
procedure WriteLabel(AStream: TStream; const ARow, ACol: Word; const AValue: string; ACell: PCell); override;
|
||||
procedure WriteNumber(AStream: TStream; const ARow, ACol: Cardinal; const AValue: double); override;
|
||||
procedure WriteNumber(AStream: TStream; const ARow, ACol: Cardinal; const AValue: double; ACell: PCell); override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@@ -257,10 +261,13 @@ end;
|
||||
|
||||
{ TsSpreadOpenDocWriter }
|
||||
|
||||
procedure TsSpreadOpenDocWriter.WriteGlobalFiles;
|
||||
procedure TsSpreadOpenDocWriter.WriteMimetype;
|
||||
begin
|
||||
FMimetype := 'application/vnd.oasis.opendocument.spreadsheet';
|
||||
end;
|
||||
|
||||
procedure TsSpreadOpenDocWriter.WriteMetaInfManifest;
|
||||
begin
|
||||
FMetaInfManifest :=
|
||||
XML_HEADER + LineEnding +
|
||||
'<manifest:manifest xmlns:manifest="' + SCHEMAS_XMLNS_MANIFEST + '">' + LineEnding +
|
||||
@@ -270,7 +277,10 @@ begin
|
||||
' <manifest:file-entry manifest:media-type="text/xml" manifest:full-path="meta.xml" />' + LineEnding +
|
||||
' <manifest:file-entry manifest:media-type="text/xml" manifest:full-path="settings.xml" />' + LineEnding +
|
||||
'</manifest:manifest>';
|
||||
end;
|
||||
|
||||
procedure TsSpreadOpenDocWriter.WriteMeta;
|
||||
begin
|
||||
FMeta :=
|
||||
XML_HEADER + LineEnding +
|
||||
'<office:document-meta xmlns:office="' + SCHEMAS_XMLNS_OFFICE +
|
||||
@@ -283,7 +293,10 @@ begin
|
||||
' <meta:document-statistic />' + LineEnding +
|
||||
' </office:meta>' + LineEnding +
|
||||
'</office:document-meta>';
|
||||
end;
|
||||
|
||||
procedure TsSpreadOpenDocWriter.WriteSettings;
|
||||
begin
|
||||
FSettings :=
|
||||
XML_HEADER + LineEnding +
|
||||
'<office:document-settings xmlns:office="' + SCHEMAS_XMLNS_OFFICE +
|
||||
@@ -309,7 +322,10 @@ begin
|
||||
' </config:config-item-set>' + LineEnding +
|
||||
' </office:settings>' + LineEnding +
|
||||
'</office:document-settings>';
|
||||
end;
|
||||
|
||||
procedure TsSpreadOpenDocWriter.WriteStyles;
|
||||
begin
|
||||
FStyles :=
|
||||
XML_HEADER + LineEnding +
|
||||
'<office:document-styles xmlns:office="' + SCHEMAS_XMLNS_OFFICE +
|
||||
@@ -320,31 +336,31 @@ begin
|
||||
'" xmlns:text="' + SCHEMAS_XMLNS_TEXT +
|
||||
'" xmlns:v="' + SCHEMAS_XMLNS_V + '">' + LineEnding +
|
||||
'<office:font-face-decls>' + LineEnding +
|
||||
'<style:font-face style:name="Arial" svg:font-family="Arial" />' + LineEnding +
|
||||
' <style:font-face style:name="Arial" svg:font-family="Arial" />' + LineEnding +
|
||||
'</office:font-face-decls>' + LineEnding +
|
||||
'<office:styles>' + LineEnding +
|
||||
'<style:style style:name="Default" style:family="table-cell">' + LineEnding +
|
||||
'<style:text-properties fo:font-size="10" style:font-name="Arial" />' + LineEnding +
|
||||
'</style:style>' + LineEnding +
|
||||
' <style:style style:name="Default" style:family="table-cell">' + LineEnding +
|
||||
' <style:text-properties fo:font-size="10" style:font-name="Arial" />' + LineEnding +
|
||||
' </style:style>' + LineEnding +
|
||||
'</office:styles>' + LineEnding +
|
||||
'<office:automatic-styles>' + LineEnding +
|
||||
'<style:page-layout style:name="pm1">' + LineEnding +
|
||||
'<style:page-layout-properties fo:margin-top="1.25cm" fo:margin-bottom="1.25cm" fo:margin-left="1.905cm" fo:margin-right="1.905cm" />' + LineEnding +
|
||||
'<style:header-style>' + LineEnding +
|
||||
'<style:header-footer-properties fo:min-height="0.751cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="0.25cm" fo:margin-top="0cm" />' + LineEnding +
|
||||
'</style:header-style>' + LineEnding +
|
||||
'<style:footer-style>' + LineEnding +
|
||||
'<style:header-footer-properties fo:min-height="0.751cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.25cm" fo:margin-bottom="0cm" />' + LineEnding +
|
||||
'</style:footer-style>' + LineEnding +
|
||||
'</style:page-layout>' + LineEnding +
|
||||
' <style:page-layout style:name="pm1">' + LineEnding +
|
||||
' <style:page-layout-properties fo:margin-top="1.25cm" fo:margin-bottom="1.25cm" fo:margin-left="1.905cm" fo:margin-right="1.905cm" />' + LineEnding +
|
||||
' <style:header-style>' + LineEnding +
|
||||
' <style:header-footer-properties fo:min-height="0.751cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="0.25cm" fo:margin-top="0cm" />' + LineEnding +
|
||||
' </style:header-style>' + LineEnding +
|
||||
' <style:footer-style>' + LineEnding +
|
||||
' <style:header-footer-properties fo:min-height="0.751cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-top="0.25cm" fo:margin-bottom="0cm" />' + LineEnding +
|
||||
' </style:footer-style>' + LineEnding +
|
||||
' </style:page-layout>' + LineEnding +
|
||||
'</office:automatic-styles>' + LineEnding +
|
||||
'<office:master-styles>' + LineEnding +
|
||||
'<style:master-page style:name="Default" style:page-layout-name="pm1">' + LineEnding +
|
||||
'<style:header />' + LineEnding +
|
||||
'<style:header-left style:display="false" />' + LineEnding +
|
||||
'<style:footer />' + LineEnding +
|
||||
'<style:footer-left style:display="false" />' + LineEnding +
|
||||
'</style:master-page>' + LineEnding +
|
||||
' <style:master-page style:name="Default" style:page-layout-name="pm1">' + LineEnding +
|
||||
' <style:header />' + LineEnding +
|
||||
' <style:header-left style:display="false" />' + LineEnding +
|
||||
' <style:footer />' + LineEnding +
|
||||
' <style:footer-left style:display="false" />' + LineEnding +
|
||||
' </style:master-page>' + LineEnding +
|
||||
'</office:master-styles>' + LineEnding +
|
||||
'</office:document-styles>';
|
||||
end;
|
||||
@@ -393,6 +409,9 @@ begin
|
||||
' <style:style style:name="ta1" style:family="table" style:master-page-name="Default">' + LineEnding +
|
||||
' <style:table-properties table:display="true" style:writing-mode="lr-tb"/>' + LineEnding +
|
||||
' </style:style>' + LineEnding +
|
||||
' <style:style style:name="bold" style:family="table-cell" style:parent-style-name="Default">' + LineEnding +
|
||||
' <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>' + LineEnding +
|
||||
' </style:style>' + LineEnding +
|
||||
' </office:automatic-styles>' + LineEnding +
|
||||
|
||||
// Body
|
||||
@@ -479,7 +498,11 @@ var
|
||||
begin
|
||||
{ Fill the strings with the contents of the files }
|
||||
|
||||
WriteGlobalFiles();
|
||||
WriteMimetype();
|
||||
WriteMetaInfManifest();
|
||||
WriteMeta();
|
||||
WriteSettings();
|
||||
WriteStyles();
|
||||
WriteContent(AData);
|
||||
|
||||
{ Write the data to streams }
|
||||
@@ -538,21 +561,30 @@ end;
|
||||
|
||||
procedure TsSpreadOpenDocWriter.WriteLabel(AStream: TStream; const ARow,
|
||||
ACol: Word; const AValue: string; ACell: PCell);
|
||||
var
|
||||
lStyle: string = '';
|
||||
begin
|
||||
if uffBold in ACell^.UsedFormattingFields then
|
||||
lStyle := ' table:style-name="bold" ';
|
||||
|
||||
// The row should already be the correct one
|
||||
FContent := FContent +
|
||||
' <table:table-cell office:value-type="string">' + LineEnding +
|
||||
' <table:table-cell office:value-type="string"' + lStyle + '>' + LineEnding +
|
||||
' <text:p>' + AValue + '</text:p>' + LineEnding +
|
||||
' </table:table-cell>' + LineEnding;
|
||||
end;
|
||||
|
||||
procedure TsSpreadOpenDocWriter.WriteNumber(AStream: TStream; const ARow,
|
||||
ACol: Cardinal; const AValue: double);
|
||||
ACol: Cardinal; const AValue: double; ACell: PCell);
|
||||
var
|
||||
StrValue: string;
|
||||
DisplayStr: string;
|
||||
FSettings: TFormatSettings;
|
||||
lStyle: string = '';
|
||||
begin
|
||||
if uffBold in ACell^.UsedFormattingFields then
|
||||
lStyle := ' table:style-name="bold" ';
|
||||
|
||||
// The row should already be the correct one
|
||||
if IsInfinite(AValue) then begin
|
||||
StrValue:='1.#INF';
|
||||
@@ -563,7 +595,7 @@ begin
|
||||
DisplayStr:=FloatToStr(AValue); // Uses locale decimal separator
|
||||
end;
|
||||
FContent := FContent +
|
||||
' <table:table-cell office:value-type="float" office:value="' + StrValue + '">' + LineEnding +
|
||||
' <table:table-cell office:value-type="float" office:value="' + StrValue + '"' + lStyle + '>' + LineEnding +
|
||||
' <text:p>' + DisplayStr + '</text:p>' + LineEnding +
|
||||
' </table:table-cell>' + LineEnding;
|
||||
end;
|
||||
|
@@ -233,7 +233,7 @@ type
|
||||
procedure WriteFormula(AStream: TStream; const ARow, ACol: Word; const AFormula: TsFormula); virtual;
|
||||
procedure WriteRPNFormula(AStream: TStream; const ARow, ACol: Word; const AFormula: TsRPNFormula); virtual;
|
||||
procedure WriteLabel(AStream: TStream; const ARow, ACol: Word; const AValue: string; ACell: PCell); virtual; abstract;
|
||||
procedure WriteNumber(AStream: TStream; const ARow, ACol: Cardinal; const AValue: double); virtual; abstract;
|
||||
procedure WriteNumber(AStream: TStream; const ARow, ACol: Cardinal; const AValue: double; ACell: PCell); virtual; abstract;
|
||||
end;
|
||||
|
||||
{@@ List of registered formats }
|
||||
@@ -979,7 +979,7 @@ begin
|
||||
AStream := TStream(arg);
|
||||
|
||||
case ACell.ContentType of
|
||||
cctNumber: WriteNumber(AStream, ACell^.Row, ACell^.Col, ACell^.NumberValue);
|
||||
cctNumber: WriteNumber(AStream, ACell^.Row, ACell^.Col, ACell^.NumberValue, ACell);
|
||||
cctUTF8String: WriteLabel(AStream, ACell^.Row, ACell^.Col, ACell^.UTF8StringValue, ACell);
|
||||
cctFormula: WriteFormula(AStream, ACell^.Row, ACell^.Col, ACell^.FormulaValue);
|
||||
cctRPNFormula: WriteRPNFormula(AStream, ACell^.Row, ACell^.Col, ACell^.RPNFormulaValue);
|
||||
|
@@ -66,7 +66,7 @@ type
|
||||
procedure WriteEOF(AStream: TStream);
|
||||
procedure WriteRPNFormula(AStream: TStream; const ARow, ACol: Word; const AFormula: TsRPNFormula); override;
|
||||
procedure WriteLabel(AStream: TStream; const ARow, ACol: Word; const AValue: string; ACell: PCell); override;
|
||||
procedure WriteNumber(AStream: TStream; const ARow, ACol: Cardinal; const AValue: double); override;
|
||||
procedure WriteNumber(AStream: TStream; const ARow, ACol: Cardinal; const AValue: double; ACell: PCell); override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@@ -316,7 +316,7 @@ end;
|
||||
*
|
||||
*******************************************************************}
|
||||
procedure TsSpreadBIFF2Writer.WriteNumber(AStream: TStream; const ARow,
|
||||
ACol: Cardinal; const AValue: double);
|
||||
ACol: Cardinal; const AValue: double; ACell: PCell);
|
||||
begin
|
||||
{ BIFF Record header }
|
||||
AStream.WriteWord(WordToLE(INT_EXCEL_ID_NUMBER));
|
||||
|
@@ -122,7 +122,7 @@ type
|
||||
procedure WriteRPNFormula(AStream: TStream; const ARow, ACol: Word; const AFormula: TsRPNFormula); override;
|
||||
procedure WriteIndex(AStream: TStream);
|
||||
procedure WriteLabel(AStream: TStream; const ARow, ACol: Word; const AValue: string; ACell: PCell); override;
|
||||
procedure WriteNumber(AStream: TStream; const ARow, ACol: Cardinal; const AValue: double); override;
|
||||
procedure WriteNumber(AStream: TStream; const ARow, ACol: Cardinal; const AValue: double; ACell: PCell); override;
|
||||
procedure WriteStyle(AStream: TStream);
|
||||
procedure WriteWindow1(AStream: TStream);
|
||||
procedure WriteWindow2(AStream: TStream; ASheetSelected: Boolean);
|
||||
@@ -858,7 +858,7 @@ end;
|
||||
*
|
||||
*******************************************************************}
|
||||
procedure TsSpreadBIFF5Writer.WriteNumber(AStream: TStream; const ARow,
|
||||
ACol: Cardinal; const AValue: double);
|
||||
ACol: Cardinal; const AValue: double; ACell: PCell);
|
||||
begin
|
||||
{ BIFF Record header }
|
||||
AStream.WriteWord(WordToLE(INT_EXCEL_ID_NUMBER));
|
||||
|
@@ -118,7 +118,7 @@ type
|
||||
procedure WriteFormula(AStream: TStream; const ARow, ACol: Word; const AFormula: TsFormula); override;
|
||||
procedure WriteIndex(AStream: TStream);
|
||||
procedure WriteLabel(AStream: TStream; const ARow, ACol: Word; const AValue: string; ACell: PCell); override;
|
||||
procedure WriteNumber(AStream: TStream; const ARow, ACol: Cardinal; const AValue: double); override;
|
||||
procedure WriteNumber(AStream: TStream; const ARow, ACol: Cardinal; const AValue: double; ACell: PCell); override;
|
||||
procedure WriteStyle(AStream: TStream);
|
||||
procedure WriteWindow1(AStream: TStream);
|
||||
procedure WriteWindow2(AStream: TStream; ASheetSelected: Boolean);
|
||||
@@ -773,7 +773,7 @@ end;
|
||||
*
|
||||
*******************************************************************}
|
||||
procedure TsSpreadBIFF8Writer.WriteNumber(AStream: TStream; const ARow,
|
||||
ACol: Cardinal; const AValue: double);
|
||||
ACol: Cardinal; const AValue: double; ACell: PCell);
|
||||
begin
|
||||
{ BIFF Record header }
|
||||
AStream.WriteWord(WordToLE(INT_EXCEL_ID_NUMBER));
|
||||
|
@@ -64,7 +64,7 @@ type
|
||||
procedure WriteToStream(AStream: TStream; AData: TsWorkbook); override;
|
||||
{ Record writing methods }
|
||||
procedure WriteLabel(AStream: TStream; const ARow, ACol: Word; const AValue: string; ACell: PCell); override;
|
||||
procedure WriteNumber(AStream: TStream; const ARow, ACol: Cardinal; const AValue: double); override;
|
||||
procedure WriteNumber(AStream: TStream; const ARow, ACol: Cardinal; const AValue: double; ACell: PCell); override;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@@ -391,7 +391,7 @@ end;
|
||||
Writes a number (64-bit IEE 754 floating point) to the sheet
|
||||
}
|
||||
procedure TsSpreadOOXMLWriter.WriteNumber(AStream: TStream; const ARow,
|
||||
ACol: Cardinal; const AValue: double);
|
||||
ACol: Cardinal; const AValue: double; ACell: PCell);
|
||||
begin
|
||||
|
||||
end;
|
||||
|
Reference in New Issue
Block a user