]> git.lyx.org Git - lyx.git/commitdiff
ws chanes only
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 2 Mar 2003 12:16:00 +0000 (12:16 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sun, 2 Mar 2003 12:16:00 +0000 (12:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6313 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/ChangeLog
src/author.C
src/buffer.C
src/buffer.h
src/bufferlist.h
src/changes.h
src/lyxfunc.C

index 6bfa31a50242eaa4fd570d4e4f034f6665f12ddb..249f23edddc8ab0d1d3564523f2d6cab036f958e 100644 (file)
@@ -165,9 +165,9 @@ void BufferView::Pimpl::buffer(Buffer * b)
        // set current buffer
        buffer_ = b;
 
-       // if we're quitting lyx, don't bother updating stuff 
+       // if we're quitting lyx, don't bother updating stuff
        if (quitting)
-               return; 
+               return;
 
        // if we are closing the buffer, use the first buffer as current
        if (!buffer_) {
@@ -261,7 +261,7 @@ int BufferView::Pimpl::resizeCurrentBuffer()
        bool mark_set  = false;
 
        owner_->busy(true);
+
        owner_->message(_("Formatting document..."));
 
        if (bv_->text) {
@@ -621,14 +621,14 @@ bool BufferView::Pimpl::available() const
 
 Change const BufferView::Pimpl::getCurrentChange()
 {
-       if (!bv_->buffer()->params.tracking_changes) 
+       if (!bv_->buffer()->params.tracking_changes)
                return Change(Change::UNCHANGED);
 
        LyXText * t(bv_->getLyXText());
+
        if (!t->selection.set())
                return Change(Change::UNCHANGED);
+
        LyXCursor const & cur(t->selection.start);
        return cur.par()->lookupChangeFull(cur.pos());
 }
@@ -941,7 +941,7 @@ void BufferView::Pimpl::trackChanges()
        } else {
                bv_->update(bv_->text, BufferView::SELECT | BufferView::FITCUR);
                bv_->text->setCursor(bv_, &(*buf->paragraphs.begin()), 0);
-#warning changes FIXME 
+#warning changes FIXME
                //moveCursorUpdate(false);
 
                bool found = lyxfind::findNextChange(bv_);
@@ -956,7 +956,7 @@ void BufferView::Pimpl::trackChanges()
                }
                buf->params.tracking_changes = false;
        }
+
        buf->redostack.clear();
 }
 
@@ -1256,15 +1256,15 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
        case LFUN_TRACK_CHANGES:
                trackChanges();
                break;
+
        case LFUN_MERGE_CHANGES:
                owner_->getDialogs().showMergeChanges();
                break;
+
        case LFUN_ACCEPT_ALL_CHANGES: {
                bv_->update(bv_->text, BufferView::SELECT | BufferView::FITCUR);
                bv_->text->setCursor(bv_, &(*bv_->buffer()->paragraphs.begin()), 0);
-#warning FIXME changes 
+#warning FIXME changes
                //moveCursorUpdate(false);
 
                while (lyxfind::findNextChange(bv_)) {
@@ -1274,11 +1274,11 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
                        BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
                break;
        }
+
        case LFUN_REJECT_ALL_CHANGES: {
                bv_->update(bv_->text, BufferView::SELECT | BufferView::FITCUR);
                bv_->text->setCursor(bv_, &(*bv_->buffer()->paragraphs.begin()), 0);
-#warning FIXME changes 
+#warning FIXME changes
                //moveCursorUpdate(false);
 
                while (lyxfind::findNextChange(bv_)) {
@@ -1288,7 +1288,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
                        BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
                break;
        }
+
        case LFUN_ACCEPT_CHANGE: {
                bv_->getLyXText()->acceptChange(bv_);
                update(bv_->text,
@@ -1302,7 +1302,7 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
                        BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
                break;
        }
+
        case LFUN_UNKNOWN_ACTION:
                ev.errorMessage(N_("Unknown function!"));
                break;
index 6d6d75814a680812407c49c8a1c10789cb6b1d16..e217d560b4d4006572bb2fed2060c1568f3f3ce1 100644 (file)
@@ -1,3 +1,13 @@
+2003-03-02  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * buffer.C: ws changes
+       * BufferView_pimpl.C: ditto
+       * author.C: ditto
+       * buffer.h: ditto
+       * bufferlist.h: ditto
+       * changes.h: ditto
+       * lyxfunc.C: ditto
+
 2003-02-28  Alfredo Braunstein <abraunst@libero.it>
 
        * converter.[Ch]: split into itself +
        * factory.C (createInset):
        * lyxfunc.C (getStatus, dispatch):
        * text3.C (dispatch): retire old LFUNs and bring new ones to life.
-       
+
 2003-02-21  Angus Leeming  <leeming@lyx.org>
 
        * BufferView_pimpl.C (MenuInsertLyXFile):
        * lyxfunc.C: fix revert to behave sensibly
 
 2003-02-17 André Pönitz <poenitz@gmx.net>
-       
+
        * LyXAction.C:
        * commandtags.h: new LFUN_INSERT_BIBKEY
 
 2003-02-15  Jean-Marc Lasgouttes  <lasgouttes@freesurf.fr>
 
        * buffer.C (makeLaTeXFile): move the code that generates the
-         preamble... 
+         preamble...
 
        * bufferparams.C (writeLaTeX): ... in this new method
 
          (getLanguages): make const
 
        * MenuBackend.C (binding): returns the binding associated to this
-         action 
+         action
          (add): sets the status of each item by calling getStatus. Adds
          some intelligence.
          (read): add support for OptSubMenu
 2003-02-14  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * text2.C (LyXText): change order of initilizers to shut off
-         warnings 
+         warnings
 
 2003-02-14  John Levon  <levon@movementarian.org>
 
        * text.h:
        * text.C:
        * text2.C: move hfillExpansion(), numberOfSeparators(),
-         rowLast(), rowLastPrintable(), numberofHfills(), 
+         rowLast(), rowLastPrintable(), numberofHfills(),
          numberOfLabelHfills() ...
 
        * lyxrow.h:
 
        * paragraph.C (asString): remove two unused variables
 
-       * lyxtextclass.C (readTitleType): 
-         (Read): 
+       * lyxtextclass.C (readTitleType):
+         (Read):
          (LyXTextClass): handle new members titletype_ and titlename_
 
        * buffer.C (latexParagraphs): honor LyXTextClass::titletype
        * text2.C:
        * BufferView.C: change setSelectionOverString() to setSelectionRange()
          and pass the size in explicitly
-       
+
        * BufferView_pimpl.h:
        * BufferView_pimpl.C:
        * BufferView.h:
 
 2003-02-07  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
-       * text.C (getLengthMarkerHeight): 
+       * text.C (getLengthMarkerHeight):
        (drawLengthMarker): make the `symbolic' lengths (small/med/big)
        visible on screen too.
 
index 2cbd6986feef63f9fe5ea7e71cb1468fbd09cb05..aef006e535c5b830f50ffb25d941b2da2c9f3507 100644 (file)
 #include "author.h"
 
 #include "debug.h"
-#include "support/LAssert.h" 
+
+#include "support/LAssert.h"
 #include "support/LOstream.h"
 #include "support/LIstream.h"
 #include "support/lstrings.h"
+
 using std::endl;
+
 namespace {
        int cur_id;
 }
+
+
 bool operator==(Author const & l, Author const & r)
 {
        return l.name() == r.name() && l.email() == r.email();
 }
+
 
 std::ostream & operator<<(std::ostream & os, Author const & a)
 {
        os << "\"" << a.name() << "\" " << a.email();
        return os;
 }
+
 std::istream & operator>>(std::istream & is, Author & a)
 {
        string s;
@@ -47,33 +47,33 @@ std::istream & operator>>(std::istream & is, Author & a)
        lyxerr << "Read name " << a.name_ << " email " << a.email_ << endl;
        return is;
 }
+
+
 int AuthorList::record(Author const & a)
 {
        Authors::const_iterator it(authors_.begin());
        Authors::const_iterator itend(authors_.end());
+
        for (;  it != itend; ++it) {
                if (it->second == a)
                        return it->first;
-       }
+       }
+
        lyxerr[Debug::CHANGES] << "Adding author " << a << endl;
-        
+
        authors_[cur_id++] = a;
        return cur_id - 1;
 }
+
 
 void AuthorList::record(int id, Author const & a)
 {
        lyx::Assert(id < authors_.size());
+
        authors_[id] = a;
 }
 
+
 Author const & AuthorList::get(int id)
 {
        Authors::const_iterator it(authors_.find(id));
@@ -81,12 +81,12 @@ Author const & AuthorList::get(int id)
        return it->second;
 }
 
+
 AuthorList::Authors::const_iterator AuthorList::begin() const
 {
        return authors_.begin();
 }
+
 
 AuthorList::Authors::const_iterator AuthorList::end() const
 {
index 546f986c704f392198213ba488df867ca5e13fb6..8e3e03e3d91f5a73078f0f2c05cbffd68357f071 100644 (file)
@@ -162,7 +162,7 @@ Buffer::Buffer(string const & file, bool ronly)
        }
 
        // set initial author
-       authorlist.record(Author(lyxrc.user_name, lyxrc.user_email)); 
+       authorlist.record(Author(lyxrc.user_name, lyxrc.user_email));
 }
 
 
@@ -396,7 +396,7 @@ namespace {
        // but this code is too b0rken to admit of a better solution yet
        Change current_change;
 };
+
 
 bool
 Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
@@ -772,7 +772,7 @@ Buffer::parseSingleLyXformat2Token(LyXLex & lex, Paragraph *& par,
                istringstream ss(lex.getString());
                Author a;
                ss >> a;
-               int aid(authorlist.record(a)); 
+               int aid(authorlist.record(a));
                lyxerr << "aid is " << aid << endl;
                lyxerr << "listed aid is " << author_ids.size() << endl;
                author_ids.push_back(authorlist.record(a));
@@ -1400,7 +1400,7 @@ bool Buffer::writeFile(string const & fname) const
                        ofs << "\\author " << it->second << "\n";
                }
        }
+
        Paragraph::depth_type depth = 0;
 
        // this will write out all the paragraphs
@@ -2813,7 +2813,7 @@ void Buffer::validate(LaTeXFeatures & features) const
                features.require("dvipost");
                features.require("color");
        }
+
        // AMS Style is at document level
        if (params.use_amsmath || tclass.provides(LyXTextClass::amsmath))
                features.require("amsmath");
@@ -3014,7 +3014,7 @@ Paragraph * Buffer::getParFromID(int id) const
 {
        if (id < 0)
                return 0;
+
        // why should we allow < 0 ??
        //lyx::Assert(id >= 0);
 
index ff59d967ba75b7d93baa166b76c38184b302e2ad..5f603a41e5acb86e5e24a04e5cfff274d36c2ee7 100644 (file)
@@ -298,7 +298,7 @@ private:
 
        /// need to regenerate .tex ?
        DepClean dep_clean_;
+
        /// the author list
        AuthorList authorlist;
 
index d049c71bf9a626f870b257d170b7d0837a54bba9..573f08b5c215fe92cf26eff8a1d1dc88c5cc633c 100644 (file)
@@ -44,7 +44,7 @@ public:
 
        /// delete a buffer
        void release(Buffer * b);
+
        /// Close all open buffers.
        void closeAll();
 
@@ -91,7 +91,7 @@ private:
                       string & unsaved_list);
 
        typedef std::vector<Buffer *> BufferStorage;
+
        /// storage of all buffers
        BufferStorage bstore;
 
index ac378e59257916c61ee55c2b3e56b8a37224b0e8..00429d94a1e6c661f9e9b18cdc02efc635a9b612 100644 (file)
@@ -29,19 +29,19 @@ struct Change {
        Change(Type t = UNCHANGED, int a = 0, lyx::time_type ct = 0)
                : type(t), author(a), changetime(ct) {}
 
-       Type type; 
+       Type type;
 
        int author;
 
-       lyx::time_type changetime; 
+       lyx::time_type changetime;
 };
+
 bool operator==(Change const & l, Change const & r);
 bool operator!=(Change const & l, Change const & r);
+
 class Changes {
 public:
-               
+
        Changes(Change::Type type);
 
        ~Changes();
@@ -52,10 +52,10 @@ public:
        void reset(Change::Type type) {
                empty_type_ = type;
        }
+
        /// set the position to the given change
        void set(Change change, lyx::pos_type pos);
+
        /// set the position to the given change
        void set(Change::Type, lyx::pos_type pos);
 
@@ -79,7 +79,7 @@ public:
 
        /// return true if there is a deleted or unchanged range contained
        bool isChangeEdited(lyx::pos_type start, lyx::pos_type end) const;
+
        /// remove the given entry
        void erase(lyx::pos_type pos);
 
@@ -90,7 +90,7 @@ public:
        /// output .lyx file format for transitions between changes
        static void lyxMarkChange(std::ostream & os, int & column,
                lyx::time_type curtime, Change const & old, Change const & change);
+
 private:
        struct Range {
                Range(lyx::pos_type s, lyx::pos_type e)
@@ -110,35 +110,35 @@ private:
 
                // do the ranges intersect ?
                bool intersects(Range const & r) const;
+
                lyx::pos_type start;
                lyx::pos_type end;
        };
+
        friend bool operator==(Range const & r1, Range const & r2);
        friend bool operator!=(Range const & r1, Range const & r2);
+
        struct ChangeRange {
                ChangeRange(lyx::pos_type s, lyx::pos_type e, Change c)
                        : range(Range(s, e)), change(c) {}
                Range range;
                Change change;
        };
-       typedef std::vector<ChangeRange> ChangeTable; 
+
+       typedef std::vector<ChangeRange> ChangeTable;
 
        /// our table of changes
        ChangeTable table_;
+
        /// change type for an empty paragraph
        Change::Type empty_type_;
+
        /// handle a delete
        void del(Change change, ChangeTable::size_type pos);
 
        /// handle an add
        void add(Change change, ChangeTable::size_type pos);
+
        /// merge neighbouring ranges
        void merge();
 
index f14984b7f1c134715f3d5c54a4632b1a0a13b1d3..ee199e8291f61e1154abd420ded505c0ee90ba80 100644 (file)
@@ -1370,7 +1370,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                        data = InsetERTMailer::params2string(name,
                                                             InsetERT::Open);
                }
-                owner->getDialogs().show(name, data, 0);
+               owner->getDialogs().show(name, data, 0);
        }
        break;
 
@@ -1423,7 +1423,7 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                break;
 
        case LFUN_DIALOG_DISCONNECT_INSET:
-                owner->getDialogs().disconnect(argument);
+               owner->getDialogs().disconnect(argument);
                break;
 
        case LFUN_CHILDOPEN: