}
-void Row::reverseRTL(bool const rtl_par)
+void Row::reverseRTL()
{
pos_type i = 0;
pos_type const end = elements_.size();
++j;
// if the direction is not the same as the paragraph
// direction, the sequence has to be reverted.
- if (rtl != rtl_par)
+ if (rtl != rtl_)
reverse(elements_.begin() + i, elements_.begin() + j);
i = j;
}
// If the paragraph itself is RTL, reverse everything
- if (rtl_par)
+ if (rtl_)
reverse(elements_.begin(), elements_.end());
- rtl_ = rtl_par;
}
Row::const_iterator const
* Find sequences of right-to-left elements and reverse them.
* This should be called once the row is completely built.
*/
- void reverseRTL(bool rtl_par);
+ void reverseRTL();
///
bool isRTL() const { return rtl_; }
///
+ void setRTL(bool rtl) { rtl_ = rtl; }
+ ///
bool needsChangeBar() const { return changebar_; }
///
void needsChangeBar(bool ncb) { changebar_ = ncb; }
nrow.pos(pos);
nrow.left_margin = tm.leftMargin(pit, pos);
nrow.right_margin = tm.rightMargin(pit);
+ nrow.setRTL(is_rtl);
if (is_rtl)
swap(nrow.left_margin, nrow.right_margin);
// Remember that the row width takes into account the left_margin
}
-void cleanupRow(Row & row, bool at_end, bool is_rtl)
+void cleanupRow(Row & row, bool at_end)
{
if (row.empty()) {
row.endpos(0);
// boundary exists when there was no space at the end of row
row.right_boundary(!at_end && row.back().endpos == row.endpos());
// make sure that the RTL elements are in reverse ordering
- row.reverseRTL(is_rtl);
+ row.reverseRTL();
}
: fcit->row_flags;
if (rows.empty() || needsRowBreak(f1, f2)) {
if (!rows.empty())
- cleanupRow(rows.back(), false, is_rtl);
+ cleanupRow(rows.back(), false);
pos_type pos = rows.empty() ? 0 : rows.back().endpos();
rows.push_back(newRow(*this, bigrow.pit(), pos, is_rtl));
// the width available for the row.
}
if (!rows.empty()) {
- cleanupRow(rows.back(), true, is_rtl);
+ cleanupRow(rows.back(), true);
// Last row in paragraph is flushed
rows.back().flushed(true);
}