]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
Streamlining CollapseStatus stuff
[lyx.git] / src / Cursor.cpp
index 929b4b9230d70e65e9899ecf1f3aa7c69b346727..9bfbada8a986a651d08f9db269f635a73673feac 100644 (file)
 #include <limits>
 #include <map>
 
-namespace lyx {
-
 using std::string;
 using std::vector;
 using std::endl;
 using std::min;
 using std::for_each;
 
+
+namespace lyx {
+
 namespace {
 
        bool
@@ -511,9 +512,7 @@ void Cursor::setSelection()
 {
        selection() = true;
        // A selection with no contents is not a selection
-#ifdef WITH_WARNINGS
-#warning doesnt look ok
-#endif
+       // FIXME: doesnt look ok
        if (pit() == anchor().pit() && pos() == anchor().pos())
                selection() = false;
 }
@@ -1011,9 +1010,7 @@ InsetMathUnknown * Cursor::activeMacro()
 
 void Cursor::pullArg()
 {
-#ifdef WITH_WARNINGS
-#warning Look here
-#endif
+       // FIXME: Look here
        MathData ar = cell();
        if (popLeft() && inMathed()) {
                plainErase();
@@ -1027,9 +1024,7 @@ void Cursor::pullArg()
 
 void Cursor::touch()
 {
-#ifdef WITH_WARNINGS
-#warning look here
-#endif
+       // FIXME: look here
 #if 0
        DocIterator::const_iterator it = begin();
        DocIterator::const_iterator et = end();
@@ -1082,7 +1077,7 @@ bool Cursor::upDownInMath(bool up)
                
                // We want to keep the x-target on subsequent up/down movements
                // that cross beyond the end of short lines. Thus a special
-               // handling when the cursor is at the end of line: Use the new 
+               // handling when the cursor is at the end of line: Use the new
                // x-target only if the old one was before the end of line
                // or the old one was after the beginning of the line
                bool inRTL = isWithinRtlParagraph(*this);
@@ -1096,12 +1091,12 @@ bool Cursor::upDownInMath(bool up)
                        right = pos() == textRow().endpos();
                }
                if ((!left && !right) ||
-                               (left && !right && xo < x_target_) || 
+                               (left && !right && xo < x_target_) ||
                                (!left && right && x_target_ < xo))
                        setTargetX(xo);
                else
                        xo = targetX();
-       } else 
+       } else
                xo = targetX();
 
        // try neigbouring script insets
@@ -1174,7 +1169,7 @@ bool Cursor::upDownInMath(bool up)
 }
 
 
-bool Cursor::upDownInText(bool up, bool & updateNeeded) 
+bool Cursor::upDownInText(bool up, bool & updateNeeded)
 {
        BOOST_ASSERT(text());
 
@@ -1189,14 +1184,14 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
        // if we cannot move up/down inside this inset anymore
        if (x_target_ == -1)
                setTargetX(xo);
-       else if (xo - textTargetOffset() != x_target() && 
+       else if (xo - textTargetOffset() != x_target() &&
                                         depth() == beforeDispatchCursor_.depth()) {
                // In text mode inside the line (not left or right) possibly set a new target_x,
                // but only if we are somewhere else than the previous target-offset.
                
                // We want to keep the x-target on subsequent up/down movements
                // that cross beyond the end of short lines. Thus a special
-               // handling when the cursor is at the end of line: Use the new 
+               // handling when the cursor is at the end of line: Use the new
                // x-target only if the old one was before the end of line
                // or the old one was after the beginning of the line
                bool inRTL = isWithinRtlParagraph(*this);
@@ -1210,12 +1205,12 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
                        right = pos() == textRow().endpos();
                }
                if ((!left && !right) ||
-                               (left && !right && xo < x_target_) || 
+                               (left && !right && xo < x_target_) ||
                                (!left && right && x_target_ < xo))
                        setTargetX(xo);
                else
                        xo = targetX();
-       } else 
+       } else
                xo = targetX();
                
        // first get the current line
@@ -1232,7 +1227,7 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
                if (pit() == 0 && row == 0)
                        return false;
        } else {
-               if (pit() + 1 >= int(text()->paragraphs().size()) && 
+               if (pit() + 1 >= int(text()->paragraphs().size()) &&
                                row + 1 >= int(pm.rows().size()))
                        return false;
        }       
@@ -1468,7 +1463,7 @@ Font Cursor::getFont() const
        // on space? Take the font before (only for RTL boundary stay)
        if (pos > 0) {
                if (pos == sl.lastpos()
-                               || (par.isSeparator(pos) && 
+                               || (par.isSeparator(pos) &&
                                                !text.isRTLBoundary(buffer(), par, pos)))
                        --pos;
        }