]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
Add margin to paragraph dialog.
[lyx.git] / src / text.C
index 9b1f3ffd242bbc934871af18e9f3345af9e177c6..d2826eb0cdc9731ab09924d4e3dd4cec650598b1 100644 (file)
@@ -319,7 +319,7 @@ void readParagraph(Buffer const & buf, Paragraph & par, LyXLex & lex,
                        break;
                }
 
-               lyxerr[Debug::PARSER] << "Handling paragraph token: `"
+               LYXERR(Debug::PARSER) << "Handling paragraph token: `"
                                      << token << '\'' << endl;
                if (token == "\\begin_layout" || token == "\\end_document"
                    || token == "\\end_inset" || token == "\\begin_deeper"
@@ -653,9 +653,9 @@ void LyXText::breakParagraph(LCursor & cur, bool keep_layout)
        // This check is necessary. Otherwise the new empty paragraph will
        // be deleted automatically. And it is more friendly for the user!
        if (cur.pos() != 0 || isempty)
-               setCursor(cur.top(), cur.pit() + 1, 0);
+               setCursor(cur, cur.pit() + 1, 0);
        else
-               setCursor(cur.top(), cur.pit(), 0);
+               setCursor(cur, cur.pit(), 0);
 }
 
 
@@ -1094,7 +1094,7 @@ void LyXText::changeCase(LCursor & cur, LyXText::TextCase action)
 
        bool const trackChanges = cur.buffer().params().trackChanges;
 
-       pos_type right; // needed after the for loop
+       pos_type right = 0; // needed after the for loop
 
        for (pit_type pit = begPit; pit <= endPit; ++pit) {
                pos_type parSize = pars_[pit].size();
@@ -1366,12 +1366,10 @@ void LyXText::drawSelection(PainterInfo & pi, int x, int) const
        if (!ptr_cmp(cur.text(), this))
                return;
 
-       if (lyxerr.debugging(Debug::DEBUG)) {
-               lyxerr[Debug::DEBUG]
-                       << BOOST_CURRENT_FUNCTION
-                       << "draw selection at " << x
-                       << endl;
-       }
+       LYXERR(Debug::DEBUG)
+               << BOOST_CURRENT_FUNCTION
+               << "draw selection at " << x
+               << endl;
 
        DocIterator beg = cur.selectionBegin();
        DocIterator end = cur.selectionEnd();
@@ -1446,11 +1444,9 @@ void LyXText::drawSelection(PainterInfo & pi, int x, int) const
                return;
        }
 
-       if (lyxerr.debugging(Debug::DEBUG)) {
-               lyxerr[Debug::DEBUG] << " y1: " << y1 << " y2: " << y2
-                          << "X1:" << X1 << " x2: " << X2 << " wid: " << tm.width()
-                       << endl;
-       }
+       LYXERR(Debug::DEBUG) << " y1: " << y1 << " y2: " << y2
+               << "X1:" << X1 << " x2: " << X2 << " wid: " << tm.width()
+               << endl;
 
        // paint upper rectangle
        pi.pain.fillRectangle(x + x1, y1, x2 - x1, y2 - y1,
@@ -1847,7 +1843,7 @@ void LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
        ParagraphMetrics const & pm = tm.parMetrics(pit);
 
        int yy = cur.bv().coordCache().get(this, pit).y_ - pm.ascent();
-       lyxerr[Debug::DEBUG]
+       LYXERR(Debug::DEBUG)
                << BOOST_CURRENT_FUNCTION
                << ": x: " << x
                << " y: " << y
@@ -1865,7 +1861,7 @@ void LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
 
        Row const & row = pm.rows()[r];
 
-       lyxerr[Debug::DEBUG]
+       LYXERR(Debug::DEBUG)
                << BOOST_CURRENT_FUNCTION
                << ": row " << r
                << " from pos: " << row.pos()
@@ -1876,7 +1872,7 @@ void LyXText::setCursorFromCoordinates(LCursor & cur, int const x, int const y)
        pos_type const pos = row.pos() 
                + tm.getColumnNearX(pit, row, xx, bound);
 
-       lyxerr[Debug::DEBUG]
+       LYXERR(Debug::DEBUG)
                << BOOST_CURRENT_FUNCTION
                << ": setting cursor pit: " << pit
                << " pos: " << pos