+
+ // In case of an RTL inset, the edited inset will be positioned to the left
+ // of xx:yy
+ if (sl.text()) {
+ bool boundary_i = boundary && i + 1 == dit.depth();
+ bool rtl = bv.textMetrics(sl.text()).isRTL(sl, boundary_i);
+ if (rtl)
+ x -= lastw;
+ // remember width for the case that sl.inset() is positioned in an RTL inset
+ Dimension const & dim = bv.parMetrics(sl.text(), sl.pit()).
+ insetDimension(&sl.inset());
+ lastw = dim.wid;
+ } else {
+ // remember width for the case that sl.inset() is positioned in an RTL inset
+ Dimension const dim = sl.inset().dimension(bv);
+ lastw = dim.wid;
+ }
+