fpspreadsheet: OpenDocument: Adds support for word-wrap formatting option and fixes the styles setting for numeric cells
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2463 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
e4f415e21d
commit
6962323c2e
@ -497,12 +497,16 @@ begin
|
|||||||
' <style:style style:name="ce' + IntToStr(i) + '" style:family="table-cell" style:parent-style-name="Default">' + LineEnding;
|
' <style:style style:name="ce' + IntToStr(i) + '" style:family="table-cell" style:parent-style-name="Default">' + LineEnding;
|
||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
|
|
||||||
|
// style:text-properties
|
||||||
if uffBold in FFormattingStyles[i].UsedFormattingFields then
|
if uffBold in FFormattingStyles[i].UsedFormattingFields then
|
||||||
Result := Result +
|
Result := Result +
|
||||||
' <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>' + LineEnding;
|
' <style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>' + LineEnding;
|
||||||
|
|
||||||
|
// style:table-cell-properties
|
||||||
if (uffBorder in FFormattingStyles[i].UsedFormattingFields) or
|
if (uffBorder in FFormattingStyles[i].UsedFormattingFields) or
|
||||||
(uffBackgroundColor in FFormattingStyles[i].UsedFormattingFields) then
|
(uffBackgroundColor in FFormattingStyles[i].UsedFormattingFields) or
|
||||||
|
(uffWordWrap in FFormattingStyles[i].UsedFormattingFields) then
|
||||||
begin
|
begin
|
||||||
Result := Result + ' <style:table-cell-properties ';
|
Result := Result + ' <style:table-cell-properties ';
|
||||||
|
|
||||||
@ -527,6 +531,11 @@ begin
|
|||||||
+ FPSColorToHexString(FFormattingStyles[i].BackgroundColor) +'" ';
|
+ FPSColorToHexString(FFormattingStyles[i].BackgroundColor) +'" ';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if (uffWordWrap in FFormattingStyles[i].UsedFormattingFields) then
|
||||||
|
begin
|
||||||
|
Result := Result + 'fo:wrap-option="wrap" ';
|
||||||
|
end;
|
||||||
|
|
||||||
Result := Result + '/>' + LineEnding;
|
Result := Result + '/>' + LineEnding;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -660,9 +669,13 @@ var
|
|||||||
StrValue: string;
|
StrValue: string;
|
||||||
DisplayStr: string;
|
DisplayStr: string;
|
||||||
lStyle: string = '';
|
lStyle: string = '';
|
||||||
|
lIndex: Integer;
|
||||||
begin
|
begin
|
||||||
if uffBold in ACell^.UsedFormattingFields then
|
if ACell^.UsedFormattingFields <> [] then
|
||||||
lStyle := ' table:style-name="bold" ';
|
begin
|
||||||
|
lIndex := FindFormattingInList(ACell);
|
||||||
|
lStyle := ' table:style-name="ce' + IntToStr(lIndex) + '" ';
|
||||||
|
end;
|
||||||
|
|
||||||
// The row should already be the correct one
|
// The row should already be the correct one
|
||||||
if IsInfinite(AValue) then begin
|
if IsInfinite(AValue) then begin
|
||||||
|
@ -89,7 +89,8 @@ type
|
|||||||
|
|
||||||
{@@ List of possible formatting fields }
|
{@@ List of possible formatting fields }
|
||||||
|
|
||||||
TsUsedFormattingField = (uffTextRotation, uffBold, uffBorder, uffBackgroundColor);
|
TsUsedFormattingField = (uffTextRotation, uffBold, uffBorder, uffBackgroundColor,
|
||||||
|
uffWordWrap);
|
||||||
|
|
||||||
{@@ Describes which formatting fields are active }
|
{@@ Describes which formatting fields are active }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user