cover header_footer.hpp

This commit is contained in:
Thomas Fussell 2016-07-09 00:22:08 -04:00
parent 5147a282af
commit a2814d3465

View File

@ -933,24 +933,42 @@ public:
{ {
xlnt::workbook wb; xlnt::workbook wb;
auto ws = wb.get_active_sheet(); auto ws = wb.get_active_sheet();
TS_ASSERT(ws.get_header_footer().get_center_header().is_default());
ws.get_header_footer().get_center_header().set_text("abc"); auto &header_footer = ws.get_header_footer();
ws.get_header_footer().get_center_header().set_font_name("def");
ws.get_header_footer().get_center_header().set_font_size(121); for (auto header_pointer : { &header_footer.get_left_header(),
ws.get_header_footer().get_center_header().set_font_color("ghi"); &header_footer.get_center_header(), &header_footer.get_right_header() })
TS_ASSERT(!ws.get_header_footer().get_center_header().is_default()); {
auto &header = *header_pointer;
TS_ASSERT(header.is_default());
header.set_text("abc");
header.set_font_name("def");
header.set_font_size(121);
header.set_font_color("ghi");
TS_ASSERT(!header.is_default());
}
} }
void test_footer() void test_footer()
{ {
xlnt::workbook wb; xlnt::workbook wb;
auto ws = wb.get_active_sheet(); auto ws = wb.get_active_sheet();
TS_ASSERT(ws.get_header_footer().get_center_footer().is_default());
ws.get_header_footer().get_center_footer().set_text("abc"); auto &header_footer = ws.get_header_footer();
ws.get_header_footer().get_center_footer().set_font_name("def");
ws.get_header_footer().get_center_footer().set_font_size(121); for (auto header_pointer : { &header_footer.get_left_footer(),
ws.get_header_footer().get_center_footer().set_font_color("ghi"); &header_footer.get_center_footer(), &header_footer.get_right_footer() })
TS_ASSERT(!ws.get_header_footer().get_center_footer().is_default()); {
auto &header = *header_pointer;
TS_ASSERT(header.is_default());
header.set_text("abc");
header.set_font_name("def");
header.set_font_size(121);
header.set_font_color("ghi");
TS_ASSERT(!header.is_default());
}
} }
void test_page_setup() void test_page_setup()