]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
Rob's latest and greatest dialog tweaking.
[lyx.git] / src / text.C
index e29788c31c87e849cc4f5dd6e84366ad8fa2f2ef..e435cd7a367bd2acf94e48a2d5c787898015d244 100644 (file)
 #include "bufferparams.h"
 #include "buffer.h"
 #include "debug.h"
+#include "intl.h"
 #include "lyxrc.h"
 #include "encoding.h"
 #include "frontends/LyXView.h"
 #include "frontends/Painter.h"
 #include "frontends/font_metrics.h"
 #include "frontends/screen.h"
+#include "frontends/WorkArea.h"
 #include "bufferview_funcs.h"
 #include "BufferView.h"
 #include "language.h"
 #include "ParagraphParameters.h"
 #include "undo_funcs.h"
 #include "WordLangTuple.h"
+#include "paragraph_funcs.h"
 
 #include "insets/insetbib.h"
 #include "insets/insettext.h"
@@ -78,7 +81,7 @@ int LyXText::workWidth(BufferView * bview, Inset * inset) const
                Buffer::inset_iterator it = bview->buffer()->inset_iterator_begin();
                Buffer::inset_iterator end = bview->buffer()->inset_iterator_end();
                for (; it != end; ++it) {
-                       if (*it == inset) {
+                       if (&(*it) == inset) {
                                par = it.getPar();
                                pos = it.getPos();
                                break;
@@ -687,13 +690,6 @@ bool LyXText::draw(DrawRowParams & p, pos_type & vpos)
 
        drawForeignMark(p, orig_x, orig_font);
 
-#ifdef INHERIT_LANGUAGE
-#ifdef WITH_WARNINGS
-       if ((font.language() == inherit_language) ||
-               (font.language() == ignore_language))
-               lyxerr << "No this shouldn't happen!\n";
-#endif
-#endif
        return true;
 }
 
@@ -733,8 +729,7 @@ int LyXText::leftMargin(BufferView * bview, Row const * row) const
        } else {
                // find the next level paragraph
 
-               Paragraph * newpar =
-                       row->par()->outerHook();
+               Paragraph * newpar = row->par()->outerHook();
 
                // make a corresponding row. Needed to call LeftMargin()
 
@@ -1757,8 +1752,8 @@ void LyXText::breakParagraph(BufferView * bview, char keep_layout)
        // paragraph before or behind and we should react on that one
        // but we can fix this in 1.3.0 (Jug 20020509)
        bool const isempty = (layout->keepempty && cursor.par()->empty());
-       cursor.par()->breakParagraph(bview->buffer()->params, cursor.pos(),
-                               keep_layout);
+       ::breakParagraph(bview->buffer()->params, cursor.par(), cursor.pos(),
+                      keep_layout);
 
        // well this is the caption hack since one caption is really enough
        if (layout->labeltype == LABEL_SENSITIVE) {
@@ -2289,7 +2284,7 @@ void LyXText::cursorLeftOneWord(BufferView * bview)  const
 }
 
 
-void LyXText::cursorLeftOneWord(LyXCursor  & cur)  const
+void LyXText::cursorLeftOneWord(LyXCursor & cur) const
 {
        // treat HFills, floats and Insets as words
        cur = cursor;
@@ -2311,7 +2306,7 @@ void LyXText::cursorLeftOneWord(LyXCursor  & cur)  const
                }
        } else {                // Here, cur != 0
                while (cur.pos() > 0 &&
-                      cur.par()->isWord(cur.pos()-1))
+                      cur.par()->isWord(cur.pos() - 1))
                        cur.pos(cur.pos() - 1);
        }
 }
@@ -2329,8 +2324,8 @@ void LyXText::getWord(LyXCursor & from, LyXCursor & to,
                if (cursor.pos() == 0 || cursor.pos() == cursor.par()->size()
                    || cursor.par()->isSeparator(cursor.pos())
                    || cursor.par()->isKomma(cursor.pos())
-                   || cursor.par()->isSeparator(cursor.pos() -1)
-                   || cursor.par()->isKomma(cursor.pos() -1)) {
+                   || cursor.par()->isSeparator(cursor.pos() - 1)
+                   || cursor.par()->isKomma(cursor.pos() - 1)) {
                        to = from;
                        return;
                }
@@ -2794,7 +2789,7 @@ void LyXText::backspace(BufferView * bview)
                    && cursor.par()->getAlign() == tmppar->getAlign()) {
                        removeParagraph(tmprow);
                        removeRow(tmprow);
-                       cursor.par()->pasteParagraph(bview->buffer()->params);
+                       pasteParagraph(bview->buffer()->params, cursor.par());
 
                        if (!cursor.pos() || !cursor.par()->isSeparator(cursor.pos() - 1))
                                ; //cursor.par()->insertChar(cursor.pos(), ' ');
@@ -3793,7 +3788,7 @@ LyXText::getColumnNearX(BufferView * bview, Row * row, int & x,
                }
 
                if (hfillExpansion(bview->buffer(), row, c)) {
-                       x += singleWidth(bview, row->par(), c);
+                       tmpx += singleWidth(bview, row->par(), c);
                        if (c >= main_body)
                                tmpx += fill_hfill;
                        else