remove default field from margins and fix ref to non-const

This commit is contained in:
Thomas Fussell 2016-08-13 15:12:00 -04:00
parent b50bd4890f
commit 6acba8ee9c
3 changed files with 1 additions and 19 deletions

View File

@ -35,8 +35,6 @@ class XLNT_CLASS page_margins
public:
page_margins();
bool is_default() const;
double get_top() const;
void set_top(double top);
@ -56,8 +54,6 @@ public:
void set_footer(double footer);
private:
bool default_ = true;
double top_ = 1;
double left_ = 0.75;
double bottom_ = 1;

View File

@ -29,11 +29,6 @@ page_margins::page_margins()
{
}
bool page_margins::is_default() const
{
return default_;
}
double page_margins::get_top() const
{
return top_;
@ -41,7 +36,6 @@ double page_margins::get_top() const
void page_margins::set_top(double top)
{
default_ = false;
top_ = top;
}
@ -52,7 +46,6 @@ double page_margins::get_left() const
void page_margins::set_left(double left)
{
default_ = false;
left_ = left;
}
@ -63,7 +56,6 @@ double page_margins::get_bottom() const
void page_margins::set_bottom(double bottom)
{
default_ = false;
bottom_ = bottom;
}
@ -74,7 +66,6 @@ double page_margins::get_right() const
void page_margins::set_right(double right)
{
default_ = false;
right_ = right;
}
@ -85,7 +76,6 @@ double page_margins::get_header() const
void page_margins::set_header(double header)
{
default_ = false;
header_ = header;
}
@ -96,7 +86,6 @@ double page_margins::get_footer() const
void page_margins::set_footer(double footer)
{
default_ = false;
footer_ = footer;
}

View File

@ -933,9 +933,7 @@ public:
{
xlnt::workbook wb;
auto ws = wb.get_active_sheet();
auto &margins = ws.get_page_margins();
TS_ASSERT(margins.is_default());
auto margins = ws.get_page_margins();
margins.set_top(0);
margins.set_bottom(1);
@ -943,7 +941,6 @@ public:
margins.set_footer(3);
margins.set_left(4);
margins.set_right(5);
TS_ASSERT(!margins.is_default());
}
void test_to_string()