mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 11:08:41 +00:00
ws chanes only
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6313 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
dd5454171d
commit
1583baeb34
@ -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;
|
||||
|
@ -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 +
|
||||
@ -100,7 +110,7 @@
|
||||
* 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):
|
||||
@ -148,7 +158,7 @@
|
||||
* lyxfunc.C: fix revert to behave sensibly
|
||||
|
||||
2003-02-17 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
|
||||
* LyXAction.C:
|
||||
* commandtags.h: new LFUN_INSERT_BIBKEY
|
||||
|
||||
@ -180,7 +190,7 @@
|
||||
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
|
||||
|
||||
@ -188,7 +198,7 @@
|
||||
(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
|
||||
@ -231,7 +241,7 @@
|
||||
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>
|
||||
|
||||
@ -251,7 +261,7 @@
|
||||
* text.h:
|
||||
* text.C:
|
||||
* text2.C: move hfillExpansion(), numberOfSeparators(),
|
||||
rowLast(), rowLastPrintable(), numberofHfills(),
|
||||
rowLast(), rowLastPrintable(), numberofHfills(),
|
||||
numberOfLabelHfills() ...
|
||||
|
||||
* lyxrow.h:
|
||||
@ -286,8 +296,8 @@
|
||||
|
||||
* 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
|
||||
@ -308,7 +318,7 @@
|
||||
* text2.C:
|
||||
* BufferView.C: change setSelectionOverString() to setSelectionRange()
|
||||
and pass the size in explicitly
|
||||
|
||||
|
||||
* BufferView_pimpl.h:
|
||||
* BufferView_pimpl.C:
|
||||
* BufferView.h:
|
||||
@ -395,7 +405,7 @@
|
||||
|
||||
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.
|
||||
|
||||
|
38
src/author.C
38
src/author.C
@ -13,31 +13,31 @@
|
||||
#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
|
||||
{
|
||||
|
12
src/buffer.C
12
src/buffer.C
@ -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);
|
||||
|
||||
|
@ -298,7 +298,7 @@ private:
|
||||
|
||||
/// need to regenerate .tex ?
|
||||
DepClean dep_clean_;
|
||||
|
||||
|
||||
/// the author list
|
||||
AuthorList authorlist;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user