| 61 | } |
| 62 | |
| 63 | bool ParagraphModel::ValidBodyLine(int lmargin, int lindent, |
| 64 | int rindent, int rmargin) const { |
| 65 | switch (justification_) { |
| 66 | case JUSTIFICATION_LEFT: |
| 67 | return NearlyEqual(lmargin + lindent, margin_ + body_indent_, |
| 68 | tolerance_); |
| 69 | case JUSTIFICATION_RIGHT: |
| 70 | return NearlyEqual(rmargin + rindent, margin_ + body_indent_, |
| 71 | tolerance_); |
| 72 | case JUSTIFICATION_CENTER: |
| 73 | return NearlyEqual(lindent, rindent, tolerance_ * 2); |
| 74 | default: |
| 75 | // shouldn't happen |
| 76 | return false; |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | bool ParagraphModel::Comparable(const ParagraphModel &other) const { |
| 81 | if (justification_ != other.justification_) |
no test coverage detected