+#else
+
+void LyXText::drawSelection(PainterInfo & pi, int x, int) const
+{
+ LCursor & cur = pi.base.bv->cursor();
+ if (!cur.selection())
+ return;
+ if (!ptr_cmp(cur.text(), this))
+ return;
+
+ lyxerr[Debug::DEBUG]
+ << BOOST_CURRENT_FUNCTION
+ << "draw selection at " << x
+ << endl;
+
+ DocIterator beg = cur.selectionBegin();
+ DocIterator end = cur.selectionEnd();
+
+ // the selection doesn't touch the visible screen
+ if (bv_funcs::status(pi.base.bv, beg) == bv_funcs::CUR_BELOW
+ || bv_funcs::status(pi.base.bv, end) == bv_funcs::CUR_ABOVE)
+ return;
+
+ Paragraph const & par1 = pars_[beg.pit()];
+ Paragraph const & par2 = pars_[end.pit()];
+
+ bool const above = (bv_funcs::status(pi.base.bv, beg)
+ == bv_funcs::CUR_ABOVE);
+ bool const below = (bv_funcs::status(pi.base.bv, end)
+ == bv_funcs::CUR_BELOW);
+ int y1,y2,x1,x2;
+ if (above) {
+ y1 = 0;
+ y2 = 0;
+ x1 = 0;
+ x2 = dim_.wid;
+ } else {
+ Row const & row1 = par1.getRow(beg.pos(), beg.boundary());
+ y1 = bv_funcs::getPos(beg, beg.boundary()).y_ - row1.ascent();
+ y2 = y1 + row1.height();
+ int const startx = cursorX(beg.top(), beg.boundary());
+ x1 = !isRTL(par1) ? startx : 0;
+ x2 = !isRTL(par1) ? 0 + dim_.wid : startx;
+ }
+
+ int Y1,Y2,X1,X2;
+ if (below) {
+ Y1 = pi.base.bv->workHeight();
+ Y2 = pi.base.bv->workHeight();
+ X1 = 0;
+ X2 = dim_.wid;
+ } else {
+ Row const & row2 = par2.getRow(end.pos(), end.boundary());
+ Y1 = bv_funcs::getPos(end, end.boundary()).y_ - row2.ascent();
+ Y2 = Y1 + row2.height();
+ int const endx = cursorX(end.top(), end.boundary());
+ X1 = !isRTL(par2) ? 0 : endx;
+ X2 = !isRTL(par2) ? endx : 0 + dim_.wid;
+ }
+
+ if (!above && !below && &par1.getRow(beg.pos(), beg.boundary())
+ == &par2.getRow(end.pos(), end.boundary()))
+ {
+ // paint only one rectangle
+ int const b( !isRTL(par1) ? x + x1 : x + X1 );
+ int const w( !isRTL(par1) ? X2 - x1 : x2 - X1 );
+ pi.pain.fillRectangle(b, y1, w, y2 - y1, LColor::selection);
+ return;
+ }