]> git.lyx.org Git - lyx.git/blobdiff - src/rowpainter.C
hopefully fix tex2lyx linking.
[lyx.git] / src / rowpainter.C
index a2936fe8d96be1500a54897165c960be6663a723..fdb3450e6407679b09c51d90fc9ce9b2853d8b10 100644 (file)
@@ -180,9 +180,11 @@ void RowPainter::paintInset(pos_type const pos, LyXFont const & font)
        InsetText const * const in = inset->asTextInset();
        // non-wide insets are painted completely. Recursive
        bool tmp = refreshInside;
-       if (!in || !in->Wide()) {
+       if (!in || !in->wide()) {
                refreshInside = true;
-               lyxerr[Debug::PAINTING] << endl << "Paint inset fully" << endl;
+               if (lyxerr.debugging(Debug::PAINTING)) { 
+                       lyxerr << endl << "Paint inset fully" << endl;
+               }
        }
        if (refreshInside)
                inset->drawSelection(pi, int(x_), yo_);
@@ -880,12 +882,17 @@ void paintPar
                        text);
 
                // If this is the only object on the row, we can make it wide
+               //
+               // FIXME: there is a const_cast here because paintPar() is not supposed
+               // to touch the paragraph contents. So either we move this "wide"
+               // property out of InsetText or we localize the feature to the painting
+               // done here.
                for (pos_type i = rit->pos() ; i != rit->endpos(); ++i) {
                        InsetBase const * const in = par.getInset(i);
                        if (in) {
-                               InsetText const * const t = in->asTextInset();
+                               InsetText * t = const_cast<InsetText *>(in->asTextInset());
                                if (t)
-                                       t->Wide() = in_inset_alone_on_row;
+                                       t->setWide(in_inset_alone_on_row);
                        }
                }
 
@@ -916,12 +923,14 @@ void paintPar
 
                        // Instrumentation for testing row cache (see also
                        // 12 lines lower):
-                       if (text.isMainText(*pi.base.bv->buffer()))
-                               lyxerr[Debug::PAINTING] << "#";
-                       else
-                               lyxerr[Debug::PAINTING] << "[" <<
-                                   repaintAll << row_has_changed <<
-                                   cursor_on_row << "]";
+                       if (lyxerr.debugging(Debug::PAINTING)) {
+                               if (text.isMainText(*pi.base.bv->buffer()))
+                                       lyxerr[Debug::PAINTING] << "#";
+                               else
+                                       lyxerr[Debug::PAINTING] << "[" <<
+                                               repaintAll << row_has_changed <<
+                                               cursor_on_row << "]";
+                       }
                        rp.paintAppendix();
                        rp.paintDepthBar();
                        rp.paintChangeBar();
@@ -938,7 +947,9 @@ void paintPar
        // Re-enable screen drawing for future use of the painter.
        pi.pain.setDrawingEnabled(true);
 
-       lyxerr[Debug::PAINTING] << "." << endl;
+       if (lyxerr.debugging(Debug::PAINTING)) {
+               lyxerr[Debug::PAINTING] << "." << endl;
+       }
 }
 
 } // namespace anon