text
stringlengths
0
234
) &
-- ^ 4 - Horizontal alignment, text break, parent style XF
Intel_16(area_code) &
-- ^ 6 - XF_AREA_34
( Boolean'Pos(border(top_single)),
Boolean'Pos(border(left_single)),
Boolean'Pos(border(bottom_single)),
Boolean'Pos(border(right_single))
)
-- ^ 8 - XF_BORDER_34 - thin (=1) line; we could have other line styles:
-- Thin, Medium, Dashed, Dotted, Thick, Double, Hair
);
end Define_BIFF3_XF;
procedure Define_BIFF4_XF is
begin
-- 5.115.2 XF Record Contents, p. 222 for BIFF4
WriteBiff(
xl,
16#0443#, -- XF code in BIFF4
(Unsigned_8(font),
-- ^ 0 - Index to FONT record
Number_format_type'Pos(actual_number_format),
-- ^ 1 - Number format and cell flags
cell_is_locked, 0,
-- ^ 2 - XF type, cell protection, and parent style XF
Horizontal_alignment'Pos(horizontal_align) +
Boolean'Pos(wrap_text) * 8 +
(Vertical_alignment'Pos(vertical_align) and 3) * 16 +
Text_orientation'Pos(text_orient) * 64,
-- ^ 4 - Alignment (hor & ver), text break, and text orientation
16#FF#
-- ^ 3 - XF_USED_ATTRIB
) &
-- ^ 4 - Horizontal alignment, text break, parent style XF
Intel_16(area_code) &
-- ^ 6 - XF_AREA_34
( Boolean'Pos(border(top_single)),
Boolean'Pos(border(left_single)),
Boolean'Pos(border(bottom_single)),
Boolean'Pos(border(right_single))
)
-- ^ 8 - XF_BORDER_34 - thin (=1) line; we could have other line styles:
-- Thin, Medium, Dashed, Dotted, Thick, Double, Hair
);
end Define_BIFF4_XF;
begin
-- 2.5.12 Patterns for Cell and Chart Background Area
-- This is for BIFF3+
if shaded then
area_code:=
Boolean'Pos(shaded) * 17 + -- Sparse pattern, like BIFF2 "shade"
16#40# * color_code(BIFF3, black)(for_background) + -- pattern colour
16#800# * color_code(BIFF3, background_color)(for_background); -- pattern background
elsif background_color = automatic then
area_code:= 0;
else
area_code:=
1 + -- Full pattern
16#40# * color_code(BIFF3, background_color)(for_background) + -- pattern colour
16#800# * color_code(BIFF3, background_color)(for_background); -- pattern background
end if;
case xl.format is
when BIFF2 =>
case actual_number_format is
when general .. no_currency_2 =>
null;
when currency_0 .. fraction_2 =>
actual_number_format:= actual_number_format - 4;
when dd_mm_yyyy .. last_custom =>
actual_number_format:= actual_number_format - 6;
when others =>
null;
end case;
Define_BIFF2_XF;
when BIFF3 =>
if actual_number_format in currency_0 .. last_custom then
actual_number_format:= actual_number_format - 4;
end if;
Define_BIFF3_XF;
when BIFF4 =>
Define_BIFF4_XF;
-- when BIFF8 =>
-- Define_BIFF8_XF; -- BIFF8: 16#00E0#, p. 224
end case;
xl.xfs:= xl.xfs + 1;
cell_format:= Format_type(xl.xfs);
xl.xf_def(xl.xfs):= (font => font, numb => number_format);
end Define_format;
procedure Header(xl : Excel_Out_Stream; page_header_string: String) is
begin
WriteBiff(xl, 16#0014#, To_buf_8_bit_length(page_header_string)); -- 5.55 p.180
end Header;
procedure Footer(xl : Excel_Out_Stream; page_footer_string: String) is
begin
WriteBiff(xl, 16#0015#, To_buf_8_bit_length(page_footer_string)); -- 5.48 p.173
end Footer;