diff --git a/components/fpspreadsheet/fpsopendocument.pas b/components/fpspreadsheet/fpsopendocument.pas
index 1254693f0..690a9d13f 100755
--- a/components/fpspreadsheet/fpsopendocument.pas
+++ b/components/fpspreadsheet/fpsopendocument.pas
@@ -770,6 +770,7 @@ var
numFmtIndex: Integer;
numFmtIndexDefault: Integer;
wrap: Boolean;
+ txtRot: TsTextRotation;
borders: TsCellBorders;
borderStyles: TsCellBorderStyles;
bkClr: TsColorValue;
@@ -866,6 +867,7 @@ begin
borders := [];
wrap := false;
bkClr := TsColorValue(-1);
+ txtRot := trHorizontal;
styleChildNode := styleNode.FirstChild;
while Assigned(styleChildNode) do begin
@@ -907,6 +909,17 @@ begin
// Text wrap
s := GetAttrValue(styleChildNode, 'fo:wrap-option');
wrap := (s='wrap');
+
+ // Test rotation
+ s := GetAttrValue(styleChildNode, 'style:rotation-angle');
+ if s = '90' then
+ txtRot := rt90DegreeCounterClockwiseRotation
+ else if s = '270' then
+ txtRot := rt90DegreeClockwiseRotation;
+ s := GetAttrValue(styleChildNode, 'style:direction');
+ if s = 'ttb' then
+ txtRot := rtStacked;
+
end else
if styleChildNode.NodeName = 'style:paragraph-properties' then begin
//
@@ -921,7 +934,7 @@ begin
style.HorAlignment := haDefault;
style.VertAlignment := vaDefault;
style.WordWrap := wrap;
- style.TextRotation := trHorizontal;
+ style.TextRotation := txtRot;
style.Borders := borders;
style.BorderStyles := borderStyles;
style.BackgroundColor := IfThen(bkClr = TsColorValue(-1), scNotDefined,
@@ -1179,10 +1192,14 @@ begin
' ' + LineEnding;
// style:table-cell-properties
+ if (FFormattingStyles[i].UsedFormattingFields <> []) then begin
+ {
if (uffBorder in FFormattingStyles[i].UsedFormattingFields) or
(uffBackgroundColor in FFormattingStyles[i].UsedFormattingFields) or
- (uffWordWrap in FFormattingStyles[i].UsedFormattingFields) then
- begin
+ (uffWordWrap in FFormattingStyles[i].UsedFormattingFields) or
+ (uffTextRotation in FFormattingStyles[i].UsedFormattingFields)
+ then begin
+ }
Result := Result + ' ' + LineEnding;
end;
diff --git a/components/fpspreadsheet/fpspreadsheet.pas b/components/fpspreadsheet/fpspreadsheet.pas
index a3d9da599..e8cc117de 100755
--- a/components/fpspreadsheet/fpspreadsheet.pas
+++ b/components/fpspreadsheet/fpspreadsheet.pas
@@ -1286,6 +1286,7 @@ begin
Result^.Row := ARow;
Result^.Col := ACol;
+ Result^.ContentType := cctEmpty;
Result^.BorderStyles := DEFAULT_BORDERSTYLES;
Cells.Add(Result);
diff --git a/components/fpspreadsheet/tests/formattests.pas b/components/fpspreadsheet/tests/formattests.pas
index 2b7e1fc50..1dde2862c 100644
--- a/components/fpspreadsheet/tests/formattests.pas
+++ b/components/fpspreadsheet/tests/formattests.pas
@@ -106,6 +106,7 @@ type
{ ODS Tests }
procedure TestWriteRead_ODS_Border;
procedure TestWriteRead_ODS_BorderStyles;
+ procedure TestWriteRead_ODS_TextRotation;
procedure TestWriteRead_ODS_WordWrap;
end;
@@ -883,6 +884,11 @@ begin
TestWriteReadTextRotation(sfExcel8);
end;
+procedure TSpreadWriteReadFormatTests.TestWriteRead_ODS_TextRotation;
+begin
+ TestWriteReadTextRotation(sfOpenDocument);
+end;
+
{ --- Wordwrap tests --- }