]> git.lyx.org Git - features.git/commitdiff
ws changes only
authorLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 4 Mar 2003 09:27:27 +0000 (09:27 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Tue, 4 Mar 2003 09:27:27 +0000 (09:27 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6333 a592a061-630c-0410-9148-cb99ea01b6c8

24 files changed:
src/BufferView.C
src/BufferView.h
src/ChangeLog
src/CutAndPaste.C
src/InsetList.C
src/LaTeX.C
src/MenuBackend.C
src/MenuBackend.h
src/author.h
src/bufferlist.C
src/bufferview_funcs.C
src/changes.C
src/format.C
src/funcrequest.C
src/graph.C
src/graph.h
src/ispell.C
src/lyxfind.C
src/lyxfind.h
src/lyxrc.C
src/lyxrow.C
src/lyxrow.h
src/lyxtext.h
src/rowpainter.C

index 8459e042f4e45cdf30f2871b4b4754e1d697dd6e..293e0f9f4ed9452c6b1d76dcd9a966b82ff5a9c3 100644 (file)
@@ -157,7 +157,7 @@ Change const BufferView::getCurrentChange()
        return pimpl_->getCurrentChange();
 }
 
+
 void BufferView::beforeChange(LyXText * text)
 {
        pimpl_->beforeChange(text);
index b2261ff69f638f0d131307924e0a8ce35c391662..77aff425ef7ea5443b348333dbe9d2c02d7c2266 100644 (file)
@@ -104,7 +104,7 @@ public:
        void restorePosition(unsigned int i);
        /// does the given bookmark have a saved position ?
        bool isSavedPosition(unsigned int i);
+
        /// return the current change at the cursor
        Change const getCurrentChange();
 
index 2bb76a43a19baa9a6f6e7e75e656b62f73323ba9..78521d1a22fabbf0c07514d70cb22e1839158af8 100644 (file)
@@ -1,5 +1,7 @@
 2003-03-04  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
+       * several files: ws changes only
+
        * paragraph_funcs.C (TeXOnePar): take ParagraphList::iterator as args
        (TeXEnvironment): ditto
        (TeXDeeper): ditto
index f9ba675a2245d4adb31b544ae6d9a3edf53e9e91..78dddda1286042063ef87a4bd6ae1ce21d2d0f5e 100644 (file)
@@ -55,7 +55,7 @@ extern BufferView * current_view;
 
 namespace {
 
-// FIXME: stupid name 
+// FIXME: stupid name
 Paragraph * buf = 0;
 textclass_type textclass = 0;
 
@@ -99,27 +99,27 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
                }
                return true;
        }
+
        bool actually_erased = false;
+
        // clear end/begin fragments of the first/last par in selection
        actually_erased |= (startpar)->erase(start, startpar->size());
        if ((*endpar)->erase(0, end)) {
-               actually_erased = true; 
+               actually_erased = true;
                end = 0;
        }
+
        // Loop through the deleted pars if any, erasing as needed
+
        Paragraph * pit = startpar->next();
+
        while (1) {
                // *endpar can be 0
                if (!pit)
                        break;
+
                Paragraph * next = pit->next();
+
                // "erase" the contents of the par
                if (pit != *endpar) {
                        actually_erased |= pit->erase(0, pit->size());
@@ -130,29 +130,29 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
                                if (next) {
                                        next->previous(pit->previous());
                                }
-        
+
                                delete pit;
                        }
                }
+
                if (pit == *endpar)
                        break;
+
                pit = next;
        }
 
-#if 0 // FIXME: why for cut but not copy ? 
+#if 0 // FIXME: why for cut but not copy ?
        // the cut selection should begin with standard layout
        if (realcut) {
                buf->params().clear();
                buf->bibkey = 0;
                buf->layout(textclasslist[buffer->params.textclass].defaultLayoutName());
        }
-#endif 
+#endif
 
        if (!startpar->next())
                return true;
+
        Buffer * buffer = current_view->buffer();
 
        if (doclear) {
@@ -161,7 +161,7 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
 
        if (!actually_erased)
                return true;
+
        // paste the paragraphs again, if possible
        if (startpar->hasSameLayout(startpar->next()) ||
            startpar->next()->empty()) {
@@ -173,7 +173,7 @@ bool CutAndPaste::cutSelection(Paragraph * startpar, Paragraph ** endpar,
        return true;
 }
 
+
 bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
                                int start, int end, char tc)
 {
index dab5287baf2ead8e0133ea38dbd35c213987b98d..95471333836113139334f4de111a9b97dbf2a8e8 100644 (file)
@@ -19,7 +19,7 @@ struct MatchIt {
        /// used by lower_bound and upper_bound
        inline
        int operator()(InsetList::InsetTable const & a,
-                      InsetList::InsetTable const & b) const
+                      InsetList::InsetTable const & b) const
        {
                return a.pos < b.pos;
        }
index 5995025dee4872a8781e4d96595bc33a798c0433..69f46d63f281a95864a7cbec897f8488332f0533 100644 (file)
@@ -79,7 +79,7 @@ void showRunMessage(LyXFunc * lf, unsigned int count)
        lf->dispatch(FuncRequest(LFUN_MESSAGE, STRCONV(str.str())));
 }
 
+
 };
 /*
  * CLASS TEXERRORS
@@ -213,7 +213,7 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun)
        ++count;
        lyxerr[Debug::LATEX] << "Run #" << count << endl;
        if (lfun) {
-               showRunMessage(lfun, count); 
+               showRunMessage(lfun, count);
        }
 
        this->operator()();
index 6fdec55cb2451ae0c3408ee957cd259c38a8c59b..86c79e24850b5f90c54b89eb613fccd35a5ede03 100644 (file)
@@ -113,7 +113,7 @@ string const MenuItem::binding() const
 {
        if (kind_ != Command)
                return string();
-       
+
        // Get the keys bound to this action, but keep only the
        // first one later
        string bindings = toplevel_keymap->findbinding(action_);
@@ -131,7 +131,7 @@ Menu & Menu::add(MenuItem const & i, LyXView const * view)
                items_.push_back(i);
                return *this;
        }
-               
+
        switch (i.kind()) {
        case MenuItem::Command:
        {
@@ -173,7 +173,7 @@ Menu & Menu::add(MenuItem const & i, LyXView const * view)
                break;
        default:
                items_.push_back(i);
-       }       
+       }
 
        return *this;
 }
index 136814ad809e02d72a737b742161f805bb80760e..c768623d4b07240c530eec38f18ec34cd0021ba0 100644 (file)
@@ -89,11 +89,11 @@ public:
        /// returns true if the entry should be ommited when disabled
        bool optional() const { return optional_; }
        /// returns the status of the lfun associated with this entry
-       FuncStatus const & status() const { return status_; }   
+       FuncStatus const & status() const { return status_; }
        /// returns the status of the lfun associated with this entry
-       FuncStatus & status() { return status_; }       
+       FuncStatus & status() { return status_; }
        /// returns the status of the lfun associated with this entry
-       void status(FuncStatus const & status) { status_ = status; }    
+       void status(FuncStatus const & status) { status_ = status; }
        /// returns the binding associated to this action
        string const binding() const;
        /// the description of the  submenu (if relevant)
index d362d7f9d5eafbed39a1adb76dc14ae1924ffa14..2764923d1347bbf5febb9e8aed6b407db307d5d7 100644 (file)
 #include <iosfwd>
 
 #include "LString.h"
+
 class Author {
 public:
        Author() {}
+
        Author(string n, string e)
                : name_(n), email_(e) {}
 
@@ -30,7 +30,7 @@ public:
        string const email() const {
                return email_;
        }
+
        friend  std::istream & operator>>(std::istream & os, Author & a);
 
 private:
@@ -38,18 +38,18 @@ private:
 
        string email_;
 };
+
 
 class AuthorList {
 public:
        int record(Author const & a);
 
        void record(int id, Author const & a);
+
        Author const & get(int id);
 
        typedef std::map<int, Author> Authors;
+
        Authors::const_iterator begin() const;
 
        Authors::const_iterator end() const;
@@ -57,11 +57,11 @@ public:
 private:
        Authors authors_;
 };
+
 bool operator==(Author const & l, Author const & r);
-std::ostream & operator<<(std::ostream & os, Author const & a); 
-std::istream & operator>>(std::istream & os, Author & a); 
+
+std::ostream & operator<<(std::ostream & os, Author const & a);
+
+std::istream & operator>>(std::istream & os, Author & a);
+
 #endif // AUTHOR_H
index a68a8a9adf09c7fa01441aa520b553549a0b4b53..0739d30c398ca488caef1fef277395c55f2f2b9c 100644 (file)
@@ -145,7 +145,7 @@ Buffer * BufferList::newBuffer(string const & s, bool ronly)
        bstore.push_back(tmpbuf);
        return tmpbuf;
 }
+
 
 void BufferList::closeAll()
 {
index 58ed8fdaf12a05c9201d2f243fcdc6b9f049eb1a..4ed3413732a7a4c8fb59f63780989a631949a29c 100644 (file)
@@ -169,7 +169,7 @@ string const currentState(BufferView * bv)
                        state << _(" at ") << ctime(&change.changetime);
                state << " : ";
        }
+
        // I think we should only show changes from the default
        // font. (Asger)
        LyXFont font = text->real_current_font;
index 3f827db07d903ed07f3c0a311a88a0861a823261..c97ec917031fadf3b460034db3925f0aaa26fda7 100644 (file)
@@ -9,34 +9,34 @@
  */
 
 #include <config.h>
-#include "changes.h" 
+
+#include "changes.h"
 #include "debug.h"
 #include "author.h"
+
 #include "support/LAssert.h"
 #include "support/LOstream.h"
+
 using std::vector;
 using std::endl;
 using lyx::pos_type;
+
 bool operator==(Change const & l, Change const & r)
 {
        return l.type == r.type && l.author == r.author
                && l.changetime == r.changetime;
 }
+
 
 bool operator!=(Change const & l, Change const & r)
 {
        return !(l == r);
 }
 
+
 bool operator==(Changes::Range const & r1, Changes::Range const & r2)
 {
-       return r1.start == r2.start && r1.end == r2.end; 
+       return r1.start == r2.start && r1.end == r2.end;
 }
 
 
@@ -44,8 +44,8 @@ bool operator!=(Changes::Range const & r1, Changes::Range const & r2)
 {
        return !(r1 == r2);
 }
+
+
 bool Changes::Range::contains(Range const & r) const
 {
        return r.start >= start && r.end <= end;
@@ -56,27 +56,27 @@ bool Changes::Range::contained(Range const & r) const
 {
        return r.contains(*this);
 }
+
 
 bool Changes::Range::contains(pos_type pos) const
 {
        return pos >= start && pos < end;
 }
 
+
 bool Changes::Range::loose_contains(pos_type pos) const
 {
        return pos >= start && pos <= end;
 }
 
+
 bool Changes::Range::intersects(Range const & r) const
 {
        return contained(r) || contains(r)
                || contains(r.start) || contains(r.end);
 }
+
+
 Changes::Changes(Change::Type type)
        : empty_type_(type)
 {
@@ -119,19 +119,19 @@ void Changes::set(Change change, pos_type pos)
        set(change, pos, pos + 1);
 }
 
+
 void Changes::set(Change::Type type, pos_type pos)
 {
        set(type, pos, pos + 1);
 }
 
+
 void Changes::set(Change::Type type, pos_type start, pos_type end)
 {
        set(Change(type), start, end);
 }
 
+
 void Changes::set(Change change, pos_type start, pos_type end)
 {
        ChangeTable::iterator it = table_.begin();
@@ -139,9 +139,9 @@ void Changes::set(Change change, pos_type start, pos_type end)
        lyxerr[Debug::CHANGES] << "changeset of " << change.type
                << " author " << change.author << " time " << change.changetime
                << " in range " << start << "," << end << endl;
+
        Range const new_range(start, end);
+
        // remove all sub-ranges
        for (; it != table_.end();) {
                if (new_range != it->range && it->range.contained(new_range)) {
@@ -176,11 +176,11 @@ void Changes::set(Change change, pos_type start, pos_type end)
        }
 
        ChangeRange c(*it);
+
        lyxerr[Debug::CHANGES] << "Using change of type " << c.change.type
                << " over " << c.range.start << "," << c.range.end << endl;
-       // split head 
+
+       // split head
        if (c.range.start < start) {
                it = table_.insert(it, ChangeRange(c.range.start, start, c.change));
                lyxerr[Debug::CHANGES] << "Splitting head of type " << c.change.type
@@ -193,7 +193,7 @@ void Changes::set(Change change, pos_type start, pos_type end)
        it->range.end = end;
        it->change = change;
        lyxerr[Debug::CHANGES] << "Resetting to new change" << endl;
+
        // split tail
        if (c.range.end > end) {
                ++it;
@@ -213,13 +213,13 @@ void Changes::erase(pos_type pos)
        ChangeTable::iterator end = table_.end();
 
        bool found = false;
+
        for (; it != end; ++it) {
                Range & range(it->range);
+
                lyxerr[Debug::CHANGES] << "era:Range of type " << it->change.type << " is "
-                       << it->range.start << "," << it->range.end << endl; 
+                       << it->range.start << "," << it->range.end << endl;
+
                if (range.contains(pos)) {
                        found = true;
                        --range.end;
@@ -231,7 +231,7 @@ void Changes::erase(pos_type pos)
                        --range.end;
                }
        }
-       check(); 
+       check();
        merge();
 }
 
@@ -243,12 +243,12 @@ void Changes::del(Change change, ChangeTable::size_type pos)
                set(change, pos);
                return;
        }
+
        ChangeTable::iterator it = table_.begin();
 
        for (; it != table_.end(); ++it) {
                Range & range(it->range);
+
                if (range.contains(pos)) {
                        if (it->change.type != Change::INSERTED) {
                                set(change, pos);
@@ -264,21 +264,21 @@ void Changes::del(Change change, ChangeTable::size_type pos)
        }
 }
 
+
 void Changes::add(Change change, ChangeTable::size_type pos)
 {
        ChangeTable::iterator it = table_.begin();
        ChangeTable::iterator end = table_.end();
 
        bool found = false;
+
        for (; it != end; ++it) {
                Range & range(it->range);
+
                if (!found && range.loose_contains(pos)) {
                        found = true;
                        lyxerr[Debug::CHANGES] << "Found range of "
-                               << range.start << "," << range.end << endl; 
+                               << range.start << "," << range.end << endl;
                        ++range.end;
                        continue;
                }
@@ -291,14 +291,14 @@ void Changes::add(Change change, ChangeTable::size_type pos)
        set(change, pos);
 }
 
+
 Change const Changes::lookupFull(pos_type pos) const
 {
        if (!table_.size()) {
                lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl;
                return Change(empty_type_);
        }
+
        ChangeTable::const_iterator it = table_.begin();
        ChangeTable::const_iterator end = table_.end();
 
@@ -306,12 +306,12 @@ Change const Changes::lookupFull(pos_type pos) const
                if (it->range.contains(pos))
                        return it->change;
        }
+
        check();
        lyx::Assert(0);
        return Change(Change::UNCHANGED);
 }
+
 
 Change::Type Changes::lookup(pos_type pos) const
 {
@@ -319,7 +319,7 @@ Change::Type Changes::lookup(pos_type pos) const
                lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl;
                return empty_type_;
        }
+
        ChangeTable::const_iterator it = table_.begin();
        ChangeTable::const_iterator end = table_.end();
 
@@ -327,7 +327,7 @@ Change::Type Changes::lookup(pos_type pos) const
                if (it->range.contains(pos))
                        return it->change.type;
        }
+
        check();
        lyx::Assert(0);
        return Change::UNCHANGED;
@@ -340,14 +340,14 @@ bool Changes::isChange(pos_type start, pos_type end) const
                lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl;
                return empty_type_ != Change::UNCHANGED;
        }
+
        ChangeTable::const_iterator it = table_.begin();
        ChangeTable::const_iterator itend = table_.end();
 
        for (; it != itend; ++it) {
                lyxerr[Debug::CHANGES] << "Looking for " << start << ","
-                       << end << " in " << it->range.start << "," 
-                       << it->range.end << "of type " << it->change.type << endl; 
+                       << end << " in " << it->range.start << ","
+                       << it->range.end << "of type " << it->change.type << endl;
                if (it->range.intersects(Range(start, end))
                        && it->change.type != Change::UNCHANGED) {
                        lyxerr[Debug::CHANGES] << "Found intersection of "
@@ -357,18 +357,18 @@ bool Changes::isChange(pos_type start, pos_type end) const
                        return true;
                }
        }
+
        return false;
 }
 
+
 bool Changes::isChangeEdited(lyx::pos_type start, lyx::pos_type end) const
 {
        if (!table_.size()) {
                lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl;
                return empty_type_ != Change::INSERTED;
        }
+
        ChangeTable::const_iterator it = table_.begin();
        ChangeTable::const_iterator itend = table_.end();
 
@@ -376,12 +376,12 @@ bool Changes::isChangeEdited(lyx::pos_type start, lyx::pos_type end) const
                if (it->range.intersects(Range(start, end ? end - 1 : 0))
                        && it->change.type != Change::INSERTED) {
                        return true;
-               } 
-       } 
+               }
+       }
        return false;
 }
 
+
 void Changes::merge()
 {
        lyxerr[Debug::CHANGES] << "Starting merge" << endl;
@@ -389,8 +389,8 @@ void Changes::merge()
 
        while (it != table_.end()) {
                lyxerr[Debug::CHANGES] << "Range of type " << it->change.type << " is "
-                       << it->range.start << "," << it->range.end << endl; 
+                       << it->range.start << "," << it->range.end << endl;
+
                if (it->range.start == it->range.end) {
                        lyxerr[Debug::CHANGES] << "Removing empty range for pos "
                                << it->range.start << endl;
@@ -399,15 +399,15 @@ void Changes::merge()
                        it = table_.begin();
                        continue;
                }
-                        
+
                if (it + 1 == table_.end())
                        break;
+
                if (it->change == (it + 1)->change) {
                        lyxerr[Debug::CHANGES] << "Merging equal ranges "
                                << it->range.start << "," << it->range.end
                                << " and " << (it + 1)->range.start << ","
-                               << (it + 1)->range.end << endl; 
+                               << (it + 1)->range.end << endl;
                        (it + 1)->range.start = it->range.start;
                        table_.erase(it);
                        // start again
@@ -417,24 +417,24 @@ void Changes::merge()
 
                ++it;
        }
+
        lyxerr[Debug::CHANGES] << "Merge ended" << endl;
        check();
 }
 
+
 void Changes::check() const
 {
        ChangeTable::const_iterator it = table_.begin();
        ChangeTable::const_iterator end = table_.end();
 
        bool dont_assert(true);
+
        lyxerr[Debug::CHANGES] << "Changelist:" << endl;
        for (; it != end; ++it) {
                lyxerr[Debug::CHANGES] << "Range of type " << it->change.type << " is "
                        << it->range.start << "," << it->range.end << " author "
-                       << it->change.author << " time " << it->change.changetime << endl; 
+                       << it->change.author << " time " << it->change.changetime << endl;
                if (it + 1 == end)
                        break;
 
@@ -443,13 +443,13 @@ void Changes::check() const
                if (range.end != next.start)
                        dont_assert = false;
        }
-       lyxerr[Debug::CHANGES] << "End" << endl; 
+       lyxerr[Debug::CHANGES] << "End" << endl;
        lyx::Assert(dont_assert);
 }
 
+
 int Changes::latexMarkChange(std::ostream & os, Change::Type old, Change::Type change)
-{ 
+{
        if (old == change)
                return 0;
 
@@ -457,14 +457,14 @@ int Changes::latexMarkChange(std::ostream & os, Change::Type old, Change::Type c
        string const end("\\changeend{}");
        string const son("\\overstrikeon{}");
        string const soff("\\overstrikeoff{}");
+
        int column = 0;
+
        if (old == Change::DELETED) {
                os << soff;
                column += soff.length();
        }
+
        switch (change) {
                case Change::UNCHANGED:
                        os << end;
@@ -487,7 +487,7 @@ int Changes::latexMarkChange(std::ostream & os, Change::Type old, Change::Type c
                        }
                        break;
        }
+
        return column;
 }
 
@@ -499,7 +499,7 @@ void Changes::lyxMarkChange(std::ostream & os, int & column, lyx::time_type curt
                return;
 
        column = 0;
+
        switch (change.type) {
                case Change::UNCHANGED:
                        os << "\n\\change_unchanged\n";
@@ -511,7 +511,7 @@ void Changes::lyxMarkChange(std::ostream & os, int & column, lyx::time_type curt
                                t = curtime;
                        os << "\n\\change_deleted " << change.author
                                << " " << t << "\n";
+
                        break;
                }
 
index 79cfdf78b67f378c1312fa4bdaecdae992096c2e..e3ad3f0503cd7cc7c61c4110e3a1a0cc4f9d24c1 100644 (file)
@@ -43,11 +43,11 @@ bool operator<(Format const & a, Format const & b)
 }
 
 Format::Format(string const & n, string const & e, string const & p,
-       string const & s, string const & v): name_(n), 
-                                           extension_(e), 
-                                           prettyname_(p), 
+       string const & s, string const & v): name_(n),
+                                           extension_(e),
+                                           prettyname_(p),
                                            shortcut_(s),
-                                           viewer_(v) 
+                                           viewer_(v)
 {}
 
 
index 7b486f199ff1cd453e286a629f37b905ba7fd9ca..28007f08e68e871ba424cfb55ea9ac25fd430b31 100644 (file)
@@ -112,7 +112,7 @@ void split(vector<string> & args, string str)
                char c;
                string s;
                is >> c;
-               if (c == '"') 
+               if (c == '"')
                        getline(is, s, '"');
                else {
                        is.putback(c);
index c31861588af569f882e4ca5cddb73e407bd28ca1..6c7ef87476d4d0971e4261b0246de4c848a02289 100644 (file)
@@ -194,5 +194,3 @@ void Graph::addEdge(int s, int t)
 }
 
 vector<Graph::Vertex> Graph::vertices_;
-
-
index e7c4ac60b9236472fc6af174a6056a69f1000e43..d8cc03498b259d4d749a9fa8fc99bf1147cae281 100644 (file)
@@ -19,7 +19,7 @@
 #include <vector>
 
 class Graph {
-public: 
+public:
        Graph() : numedges_(0) {};
        ///
        typedef std::vector<int> EdgePath;
index a4f91c517d6d7aee2737dea2b52b103c58501279..4cd221f1822fec91e4bb27ce7fdfd35cf92a5e90 100644 (file)
@@ -183,7 +183,7 @@ ISpell::ISpell(BufferParams const & params, string const & lang)
 
        // static due to the setvbuf. Ugly.
        static char o_buf[BUFSIZ];
-       
+
        // We need to throw an exception not do this
        pipein[0] = pipein[1] = pipeout[0] = pipeout[1]
                = pipeerr[0] = pipeerr[1] = -1;
@@ -232,7 +232,7 @@ ISpell::ISpell(BufferParams const & params, string const & lang)
        child_.reset(li);
        if (li->start() == -1) {
                error_ = _("Could not create an ispell process.\nYou may not have "
-                       " the right languages installed.");     
+                       " the right languages installed.");
                child_.reset(0);
                return;
        }
index 598ce0e1acd03942c49924e6079684214a0dcf5b..781377babfae9c77e7ae5ce9881a07a6b9189f90 100644 (file)
@@ -310,7 +310,7 @@ SearchResult SearchBackward(BufferView * bv, LyXText * text,
        }
 }
 
+
 SearchResult nextChange(BufferView * bv, LyXText * text, pos_type & length)
 {
        Paragraph * par = text->cursor.par();
@@ -363,8 +363,8 @@ SearchResult nextChange(BufferView * bv, LyXText * text, pos_type & length)
                return SR_NOT_FOUND;
        }
 }
+
+
 SearchResult findNextChange(BufferView * bv, LyXText * text, pos_type & length)
 {
        if (text->selection.set())
@@ -386,15 +386,15 @@ bool findNextChange(BufferView * bv)
        bv->update(bv->getLyXText(), BufferView::SELECT | BufferView::FITCUR);
 
        pos_type length;
+
        if (bv->theLockingInset()) {
                bool found = bv->theLockingInset()->nextChange(bv, length);
+
                // We found the stuff inside the inset so we don't have to
                // do anything as the inset did all the update for us!
                if (found)
                        return true;
+
                // We now are in the main text but if we did a forward
                // search we have to put the cursor behind the inset.
                bv->text->cursorRight(bv, true);
@@ -409,13 +409,13 @@ bool findNextChange(BufferView * bv)
 
        bv->toggleSelection();
        text->clearSelection();
-       
+
        SearchResult result = nextChange(bv, text, length);
 
        lyxerr << "Result is " << result << endl;
+
        bool found = true;
+
        // If we found the cursor inside an inset we will get back
        // SR_FOUND_NOUPDATE and we don't have to do anything as the
        // inset did it already.
@@ -433,5 +433,5 @@ bool findNextChange(BufferView * bv)
 
        return found;
 }
+
 } // end lyxfind namespace
index 03a70e3408ed4bae71047edb583e266bafbfb646..5177e8f6cbd840c8dc07558ab75432fb65fdd31c 100644 (file)
@@ -48,11 +48,11 @@ SearchResult LyXFind(BufferView *, LyXText * text,
 
 /// find the next change in the buffer
 bool findNextChange(BufferView * bv);
+
 SearchResult findNextChange(BufferView * bv, LyXText * text, lyx::pos_type & length);
+
 SearchResult nextChange(BufferView * bv, LyXText * text, lyx::pos_type & length);
+
 } // end namespace LyXFind
+
 #endif // LYXFIND_H
index d3170f7c0f6be7e9d5ee135290a3965ca0d3a58b..b59080a5c17873ddbd2943d11350b41b6d708d96 100644 (file)
@@ -263,9 +263,9 @@ void LyXRC::setDefaults() {
        // should be moved from the LyXRC class).
        use_gui = true;
        pdf_mode = false;
+
        user_name = lyx::user_name();
-       
+
        user_email = lyx::user_email();
 
        if (user_email.empty())
@@ -1109,7 +1109,7 @@ int LyXRC::read(string const & filename)
                        if (lexrc.next())
                                user_email = lexrc.getString();
                        break;
+
                case RC_LAST: break; // this is just a dummy
                }
        }
index e5cb15826f221274a45415b21bebd01d68651b17..7351b7f2481c8896ac4b72b0db4c1a91d59acf0f 100644 (file)
@@ -93,13 +93,13 @@ void Row::top_of_text(unsigned int top)
        top_of_text_ = top;
 }
 
+
 unsigned int Row::top_of_text() const
 {
        return top_of_text_;
 }
 
+
 void Row::baseline(unsigned int b)
 {
        baseline_ = b;
index ab94db1a4cade351edc9bc27ae9570e0b105b7c9..fb53c7d4540236b1493c539b312005ae2606540f 100644 (file)
@@ -77,14 +77,14 @@ public:
        lyx::pos_type lastPos() const;
        /// return the position of the last normal, printable character in this row
        lyx::pos_type lastPrintablePos() const;
-       
+
        /**
         * Returns the number of separators.
         * The separator on the very last column doesnt count.
         */
        int numberOfSeparators() const;
 
-       /** 
+       /**
         * Returns the number of hfills. It works like a LaTeX \hfill:
         * the hfills at the beginning and at the end are ignored.
         * This is much more useful than not to ignore!
index 7fc88c31ea5162d7d0034b695110b3d58f1f8627..84ae9e2e2d2ed21cdbcf3fd6145a27f654544ef1 100644 (file)
@@ -281,9 +281,9 @@ public:
        /// accept selected change
        void acceptChange(BufferView * bv);
 
-       /// reject selected change 
+       /// reject selected change
        void rejectChange(BufferView * bv);
+
        /** 'selects" the next word, where the cursor is not in
         and returns this word as string. THe cursor will be moved
         to the beginning of this word.
index 31c3df5130dd2bc0ab165a100b0afc3f9c59edbc..287832afa35cab5243b807fc155b57ea0ecb9bd9 100644 (file)
@@ -249,10 +249,10 @@ void RowPainter::paintChars(pos_type & vpos, bool hebrew, bool arabic)
                unsigned char c = str[0];
                str[0] = transformChar(c, pos);
        }
+
        bool prev_struckout(isDeletedText(par_, pos));
        bool prev_newtext(isInsertedText(par_, pos));
+
        ++vpos;
 
        // collect as much similar chars as we can
@@ -264,10 +264,10 @@ void RowPainter::paintChars(pos_type & vpos, bool hebrew, bool arabic)
 
                if (prev_struckout != isDeletedText(par_, pos))
                        break;
+
                if (prev_newtext != isInsertedText(par_, pos))
                        break;
+
                if (arabic && Encodings::IsComposeChar_arabic(c))
                        break;
                if (hebrew && Encodings::IsComposeChar_hebrew(c))
@@ -525,17 +525,17 @@ void RowPainter::paintChangeBar()
        pos_type const start = row_.pos();
        pos_type const end = row_.lastPrintablePos();
 
-       if (!par_.isChanged(start, end)) 
+       if (!par_.isChanged(start, end))
                return;
+
        int const height = (row_.next()
-               ? row_.height() + row_.next()->top_of_text() 
+               ? row_.height() + row_.next()->top_of_text()
                : row_.baseline());
+
        pain_.fillRectangle(4, yo_, 5, height, LColor::changebar);
 }
 
+
 void RowPainter::paintAppendix()
 {
        // FIXME: can be just width_ ?
@@ -628,7 +628,7 @@ int RowPainter::paintLengthMarker(string const & prefix, VSpace const & vsp, int
        } else {
                // adding or removing space
                bool const added = vsp.kind() != VSpace::LENGTH ||
-                                  vsp.length().len().value() > 0.0;
+                                  vsp.length().len().value() > 0.0;
                ty1 = added ? (start + arrow_size) : start;
                ty2 = added ? start : (start + arrow_size);
                by1 = added ? (end - arrow_size) : end;
@@ -942,26 +942,26 @@ bool RowPainter::paintText()
        bool running_strikeout = false;
        bool is_struckout = false;
        float last_strikeout_x = 0.0;
+
        pos_type vpos = row_.pos();
        while (vpos <= last) {
                if (x_ > bv_.workWidth())
                        break;
                pos_type pos = text_.vis2log(vpos);
+
                if (x_ + singleWidth(pos) < 0) {
                        x_ += singleWidth(pos);
                        ++vpos;
                        continue;
                }
+
                is_struckout = isDeletedText(par_, pos);
 
                if (is_struckout && !running_strikeout) {
                        running_strikeout = true;
                        last_strikeout_x = x_;
                }
+
                bool const highly_editable_inset = par_.isInset(pos)
                        && isHighlyEditableInset(par_.getInset(pos));
 
@@ -974,7 +974,7 @@ bool RowPainter::paintText()
                                LColor::strikeout, Painter::line_solid, Painter::line_thin);
                        running_strikeout = false;
                }
+
                if (main_body > 0 && pos == main_body - 1) {
                        int const lwidth = font_metrics::width(layout->labelsep,
                                getLabelFont());
@@ -1021,10 +1021,10 @@ bool RowPainter::paintText()
                        ++vpos;
                } else {
                        if (paintFromPos(vpos))
-                               return true;    
+                               return true;
                }
        }
+
        // if we reach the end of a struck out range, paint it
        if (running_strikeout) {
                int const middle = yo_ + row_.top_of_text()
@@ -1073,7 +1073,7 @@ bool RowPainter::paint(int y_offset, int x_offset, int y, bool cleared)
 
        // changebar
        paintChangeBar();
+
        if (row_.isParStart()) {
                paintFirst();
        }