]> git.lyx.org Git - lyx.git/blobdiff - src/text_funcs.C
Move #includes out of header files.
[lyx.git] / src / text_funcs.C
index c9e13227546c53b938a249b40f84be93ebe5aa14..5640f9e32418abf32b96ae6882b9472109db67d2 100644 (file)
@@ -6,7 +6,7 @@
  * \author Lars Gullik Bjønnes
  * \author John Levon
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  *
  * This file contains some utility functions for actually mutating
  * the text contents of a document
@@ -25,6 +25,8 @@
 using lyx::pos_type;
 using lyx::word_location;
 
+using std::endl;
+
 
 bool transposeChars(LyXCursor const & cursor)
 {
@@ -66,8 +68,8 @@ void cursorLeftOneWord(LyXCursor & cursor, ParagraphList const & pars)
 
        while (pos &&
               (pit->isSeparator(pos - 1) ||
-               pit->isKomma(pos - 1) ||
-               pit->isNewline(pos - 1)) &&
+               pit->isKomma(pos - 1) ||
+               pit->isNewline(pos - 1)) &&
               !(pit->isHfill(pos - 1) ||
                 pit->isInset(pos - 1)))
                --pos;
@@ -77,7 +79,8 @@ void cursorLeftOneWord(LyXCursor & cursor, ParagraphList const & pars)
             pit->isHfill(pos - 1))) {
                --pos;
        } else if (!pos) {
-               if (pit != pars.begin()) {
+               // cast only for BSD's g++ 2.95
+               if (pit != const_cast<ParagraphList &>(pars).begin()) {
                        --pit;
                        pos = pit->size();
                }
@@ -99,7 +102,9 @@ void cursorRightOneWord(LyXCursor & cursor, ParagraphList const & pars)
 
        // CHECK See comment on top of text.C
 
-       if (pos == pit->size() && boost::next(pit) != pars.end()) {
+       // cast only for BSD's g++ 2.95
+       if (pos == pit->size() &&
+               boost::next(pit) != const_cast<ParagraphList &>(pars).end()) {
                ++pit;
                pos = 0;
        } else {
@@ -149,7 +154,8 @@ void getWord(LyXCursor & from, LyXCursor & to, word_location const loc,
                cursorLeftOneWord(from, pars);
                break;
        case lyx::NEXT_WORD:
-               lyxerr << "LyXText::getWord: NEXT_WORD not implemented yet\n";
+               lyxerr << "LyXText::getWord: NEXT_WORD not implemented yet"
+                      << endl;
                break;
        case lyx::PARTIAL_WORD:
                break;