fpspreadsheet: Fix centering of worksheet in xlsx print-out. Fix print page orientation in ods.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9507 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
03cf0e9c90
commit
43f8e27ce2
@ -925,7 +925,8 @@ uses
|
|||||||
{ TsChartColor }
|
{ TsChartColor }
|
||||||
|
|
||||||
{@@ Helper function to create a record with a color for the fpspreadsheet charts.
|
{@@ Helper function to create a record with a color for the fpspreadsheet charts.
|
||||||
The record contains a Transparency field.
|
The record contains a Transparency field in addition to the standard TsColor
|
||||||
|
field.
|
||||||
|
|
||||||
@param AColor RGB color
|
@param AColor RGB color
|
||||||
@param ATransparency Transparency of the color, value between 0.0 and 1.0
|
@param ATransparency Transparency of the color, value between 0.0 and 1.0
|
||||||
|
@ -9074,16 +9074,24 @@ function TsSpreadOpenDocWriter.WritePageLayoutXMLAsString(AStyleName: String;
|
|||||||
APageLayout.FooterMargin, APageLayout.BottomMargin);
|
APageLayout.FooterMargin, APageLayout.BottomMargin);
|
||||||
|
|
||||||
Result := Format(
|
Result := Format(
|
||||||
'fo:page-width="%.2fmm" fo:page-height="%.2fmm" '+
|
|
||||||
'fo:margin-top="%.2fmm" fo:margin-bottom="%.2fmm" '+
|
'fo:margin-top="%.2fmm" fo:margin-bottom="%.2fmm" '+
|
||||||
'fo:margin-left="%.2fmm" fo:margin-right="%.2fmm" ', [
|
'fo:margin-left="%.2fmm" fo:margin-right="%.2fmm" ', [
|
||||||
APageLayout.PageWidth, APageLayout.PageHeight,
|
|
||||||
topmargin, bottommargin,
|
topmargin, bottommargin,
|
||||||
APageLayout.LeftMargin, APageLayout.RightMargin
|
APageLayout.LeftMargin, APageLayout.RightMargin
|
||||||
], FPointSeparatorSettings);
|
], FPointSeparatorSettings);
|
||||||
|
|
||||||
if APageLayout.Orientation = spoLandscape then
|
if APageLayout.Orientation = spoLandscape then
|
||||||
Result := Result + 'style:print-orientation="landscape" ';
|
Result := Result + Format(
|
||||||
|
'fo:page-width="%.2fmm" fo:page-height="%.2fmm" '+
|
||||||
|
'style:print-orientation="landscape" ', [
|
||||||
|
APageLayout.PageHeight, APagelayout.PageWidth // Width and hight must be exchanged
|
||||||
|
], FPointSeparatorSettings)
|
||||||
|
else
|
||||||
|
Result := Result + Format(
|
||||||
|
'fo:page-width="%.2fmm" fo:page-height="%.2fmm" ', [
|
||||||
|
APageLayout.PageWidth, APageLayout.PageHeight
|
||||||
|
], FPointSeparatorSettings);
|
||||||
|
|
||||||
|
|
||||||
if poPrintPagesByRows in APageLayout.Options then
|
if poPrintPagesByRows in APageLayout.Options then
|
||||||
Result := Result + 'style:print-page-order="ltr" ';
|
Result := Result + 'style:print-page-order="ltr" ';
|
||||||
|
@ -3801,6 +3801,14 @@ begin
|
|||||||
s := GetAttrValue(ANode, 'gridLines');
|
s := GetAttrValue(ANode, 'gridLines');
|
||||||
if StrIsTrue(s) then
|
if StrIsTrue(s) then
|
||||||
with sheet.PageLayout do Options := Options + [poPrintGridLines];
|
with sheet.PageLayout do Options := Options + [poPrintGridLines];
|
||||||
|
|
||||||
|
s := GetAttrValue(ANode, 'horizontalCentered');
|
||||||
|
if StrIsTrue(s) then
|
||||||
|
with sheet.PageLayout do Options := Options + [poHorCentered];
|
||||||
|
|
||||||
|
s := GetAttrValue(ANode, 'verticalCentered');
|
||||||
|
if StrIsTrue(s) then
|
||||||
|
with sheet.PageLayout do Options := Options + [poVertCentered];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TsSpreadOOXMLReader.ReadRels(AStream: TStream; ARelsFile: String;
|
procedure TsSpreadOOXMLReader.ReadRels(AStream: TStream; ARelsFile: String;
|
||||||
@ -5966,13 +5974,19 @@ end;
|
|||||||
procedure TsSpreadOOXMLWriter.WritePrintOptions(AStream: TStream;
|
procedure TsSpreadOOXMLWriter.WritePrintOptions(AStream: TStream;
|
||||||
AWorksheet: TsBasicWorksheet);
|
AWorksheet: TsBasicWorksheet);
|
||||||
var
|
var
|
||||||
|
sheet: TsWorksheet;
|
||||||
s: String;
|
s: String;
|
||||||
begin
|
begin
|
||||||
|
sheet := AWorksheet as TsWorksheet;
|
||||||
s := '';
|
s := '';
|
||||||
if poPrintGridLines in (AWorksheet as TsWorksheet).PageLayout.Options then
|
if poPrintGridLines in sheet.PageLayout.Options then
|
||||||
s := s + ' gridLines="1"';
|
s := s + ' gridLines="1"';
|
||||||
if poPrintHeaders in (AWorksheet as TsWorksheet).PageLayout.Options then
|
if poPrintHeaders in sheet.PageLayout.Options then
|
||||||
s := s + ' headings="1"';
|
s := s + ' headings="1"';
|
||||||
|
if poHorCentered in sheet.PageLayout.Options then
|
||||||
|
s := s + ' horizontalCentered="1"';
|
||||||
|
if poVertCentered in sheet.PageLayout.Options then
|
||||||
|
s := s + ' verticalCentered="1"';
|
||||||
|
|
||||||
if s <> '' then
|
if s <> '' then
|
||||||
AppendToStream(AStream,
|
AppendToStream(AStream,
|
||||||
|
Loading…
Reference in New Issue
Block a user