31 static STRING ParagraphJustificationToString(
33 switch (justification) {
46 int rindent,
int rmargin)
const {
47 switch (justification_) {
49 return NearlyEqual(lmargin + lindent, margin_ + first_indent_,
52 return NearlyEqual(rmargin + rindent, margin_ + first_indent_,
55 return NearlyEqual(lindent, rindent, tolerance_ * 2);
63 int rindent,
int rmargin)
const {
64 switch (justification_) {
66 return NearlyEqual(lmargin + lindent, margin_ + body_indent_,
69 return NearlyEqual(rmargin + rindent, margin_ + body_indent_,
72 return NearlyEqual(lindent, rindent, tolerance_ * 2);
80 if (justification_ != other.justification_)
85 int tolerance = (tolerance_ + other.tolerance_) / 4;
87 other.margin_ + other.first_indent_,
tolerance) &&
89 other.margin_ + other.body_indent_,
tolerance);
94 const STRING &alignment = ParagraphJustificationToString(justification_);
95 snprintf(buffer,
sizeof(buffer),
96 "margin: %d, first_indent: %d, body_indent: %d, alignment: %s",
97 margin_, first_indent_, body_indent_, alignment.
c_str());