// 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_) {
bool mark_set = false;
owner_->busy(true);
-
+
owner_->message(_("Formatting document..."));
if (bv_->text) {
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());
}
} 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_);
}
buf->params.tracking_changes = false;
}
-
+
buf->redostack.clear();
}
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_)) {
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_)) {
BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
break;
}
-
+
case LFUN_ACCEPT_CHANGE: {
bv_->getLyXText()->acceptChange(bv_);
update(bv_->text,
BufferView::SELECT | BufferView::FITCUR | BufferView::CHANGE);
break;
}
-
+
case LFUN_UNKNOWN_ACTION:
ev.errorMessage(N_("Unknown function!"));
break;
+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.
#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;
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));
return it->second;
}
-
+
AuthorList::Authors::const_iterator AuthorList::begin() const
{
return authors_.begin();
}
-
+
AuthorList::Authors::const_iterator AuthorList::end() const
{
}
// set initial author
- authorlist.record(Author(lyxrc.user_name, lyxrc.user_email));
+ authorlist.record(Author(lyxrc.user_name, lyxrc.user_email));
}
// but this code is too b0rken to admit of a better solution yet
Change current_change;
};
-
+
bool
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));
ofs << "\\author " << it->second << "\n";
}
}
-
+
Paragraph::depth_type depth = 0;
// this will write out all the paragraphs
features.require("dvipost");
features.require("color");
}
-
+
// AMS Style is at document level
if (params.use_amsmath || tclass.provides(LyXTextClass::amsmath))
features.require("amsmath");
{
if (id < 0)
return 0;
-
+
// why should we allow < 0 ??
//lyx::Assert(id >= 0);
/// need to regenerate .tex ?
DepClean dep_clean_;
-
+
/// the author list
AuthorList authorlist;
/// delete a buffer
void release(Buffer * b);
-
+
/// Close all open buffers.
void closeAll();
string & unsaved_list);
typedef std::vector<Buffer *> BufferStorage;
-
+
/// storage of all buffers
BufferStorage bstore;
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();
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);
/// 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);
/// 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)
// 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();
data = InsetERTMailer::params2string(name,
InsetERT::Open);
}
- owner->getDialogs().show(name, data, 0);
+ owner->getDialogs().show(name, data, 0);
}
break;
break;
case LFUN_DIALOG_DISCONNECT_INSET:
- owner->getDialogs().disconnect(argument);
+ owner->getDialogs().disconnect(argument);
break;
case LFUN_CHILDOPEN: