24 files changed:
return pimpl_->getCurrentChange();
}
return pimpl_->getCurrentChange();
}
void BufferView::beforeChange(LyXText * text)
{
pimpl_->beforeChange(text);
void BufferView::beforeChange(LyXText * text)
{
pimpl_->beforeChange(text);
void restorePosition(unsigned int i);
/// does the given bookmark have a saved position ?
bool isSavedPosition(unsigned int i);
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();
/// return the current change at the cursor
Change const getCurrentChange();
2003-03-04 Lars Gullik Bjønnes <larsbj@gullik.net>
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
* paragraph_funcs.C (TeXOnePar): take ParagraphList::iterator as args
(TeXEnvironment): ditto
(TeXDeeper): ditto
Paragraph * buf = 0;
textclass_type textclass = 0;
Paragraph * buf = 0;
textclass_type textclass = 0;
bool actually_erased = false;
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)) {
// 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;
// Loop through the deleted pars if any, erasing as needed
// Loop through the deleted pars if any, erasing as needed
Paragraph * pit = startpar->next();
Paragraph * pit = startpar->next();
while (1) {
// *endpar can be 0
if (!pit)
break;
while (1) {
// *endpar can be 0
if (!pit)
break;
Paragraph * next = pit->next();
Paragraph * next = pit->next();
// "erase" the contents of the par
if (pit != *endpar) {
actually_erased |= pit->erase(0, pit->size());
// "erase" the contents of the par
if (pit != *endpar) {
actually_erased |= pit->erase(0, pit->size());
if (next) {
next->previous(pit->previous());
}
if (next) {
next->previous(pit->previous());
}
if (pit == *endpar)
break;
if (pit == *endpar)
break;
-#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());
}
// the cut selection should begin with standard layout
if (realcut) {
buf->params().clear();
buf->bibkey = 0;
buf->layout(textclasslist[buffer->params.textclass].defaultLayoutName());
}
if (!startpar->next())
return true;
if (!startpar->next())
return true;
Buffer * buffer = current_view->buffer();
if (doclear) {
Buffer * buffer = current_view->buffer();
if (doclear) {
if (!actually_erased)
return true;
if (!actually_erased)
return true;
// paste the paragraphs again, if possible
if (startpar->hasSameLayout(startpar->next()) ||
startpar->next()->empty()) {
// paste the paragraphs again, if possible
if (startpar->hasSameLayout(startpar->next()) ||
startpar->next()->empty()) {
bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
int start, int end, char tc)
{
bool CutAndPaste::copySelection(Paragraph * startpar, Paragraph * endpar,
int start, int end, char tc)
{
/// used by lower_bound and upper_bound
inline
int operator()(InsetList::InsetTable const & a,
/// 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;
}
{
return a.pos < b.pos;
}
lf->dispatch(FuncRequest(LFUN_MESSAGE, STRCONV(str.str())));
}
lf->dispatch(FuncRequest(LFUN_MESSAGE, STRCONV(str.str())));
}
++count;
lyxerr[Debug::LATEX] << "Run #" << count << endl;
if (lfun) {
++count;
lyxerr[Debug::LATEX] << "Run #" << count << endl;
if (lfun) {
- showRunMessage(lfun, count);
+ showRunMessage(lfun, count);
{
if (kind_ != Command)
return string();
{
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_);
// Get the keys bound to this action, but keep only the
// first one later
string bindings = toplevel_keymap->findbinding(action_);
items_.push_back(i);
return *this;
}
items_.push_back(i);
return *this;
}
switch (i.kind()) {
case MenuItem::Command:
{
switch (i.kind()) {
case MenuItem::Command:
{
break;
default:
items_.push_back(i);
break;
default:
items_.push_back(i);
/// 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
/// 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
/// 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
/// 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)
/// returns the binding associated to this action
string const binding() const;
/// the description of the submenu (if relevant)
#include <iosfwd>
#include "LString.h"
#include <iosfwd>
#include "LString.h"
class Author {
public:
Author() {}
class Author {
public:
Author() {}
Author(string n, string e)
: name_(n), email_(e) {}
Author(string n, string e)
: name_(n), email_(e) {}
string const email() const {
return email_;
}
string const email() const {
return email_;
}
friend std::istream & operator>>(std::istream & os, Author & a);
private:
friend std::istream & operator>>(std::istream & os, Author & a);
private:
class AuthorList {
public:
int record(Author const & a);
void record(int id, Author const & a);
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;
Author const & get(int id);
typedef std::map<int, Author> Authors;
Authors::const_iterator begin() const;
Authors::const_iterator end() const;
Authors::const_iterator begin() const;
Authors::const_iterator end() const;
private:
Authors authors_;
};
private:
Authors authors_;
};
bool operator==(Author const & l, Author const & r);
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);
+
bstore.push_back(tmpbuf);
return tmpbuf;
}
bstore.push_back(tmpbuf);
return tmpbuf;
}
void BufferList::closeAll()
{
void BufferList::closeAll()
{
state << _(" at ") << ctime(&change.changetime);
state << " : ";
}
state << _(" at ") << ctime(&change.changetime);
state << " : ";
}
// I think we should only show changes from the default
// font. (Asger)
LyXFont font = text->real_current_font;
// I think we should only show changes from the default
// font. (Asger)
LyXFont font = text->real_current_font;
#include "debug.h"
#include "author.h"
#include "debug.h"
#include "author.h"
#include "support/LAssert.h"
#include "support/LOstream.h"
#include "support/LAssert.h"
#include "support/LOstream.h"
using std::vector;
using std::endl;
using lyx::pos_type;
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.type == r.type && l.author == r.author
&& l.changetime == r.changetime;
}
bool operator!=(Change const & l, Change const & r)
{
return !(l == r);
}
bool operator!=(Change const & l, Change const & r)
{
return !(l == r);
}
bool operator==(Changes::Range const & r1, Changes::Range const & r2)
{
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;
bool Changes::Range::contains(Range const & r) const
{
return r.start >= start && r.end <= end;
bool Changes::Range::contains(Range const & r) const
{
return r.start >= start && r.end <= end;
{
return r.contains(*this);
}
{
return r.contains(*this);
}
bool Changes::Range::contains(pos_type pos) const
{
return pos >= start && pos < end;
}
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::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);
}
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)
{
Changes::Changes(Change::Type type)
: empty_type_(type)
{
set(change, pos, pos + 1);
}
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 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::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();
void Changes::set(Change change, pos_type start, pos_type end)
{
ChangeTable::iterator it = table_.begin();
lyxerr[Debug::CHANGES] << "changeset of " << change.type
<< " author " << change.author << " time " << change.changetime
<< " in range " << start << "," << end << endl;
lyxerr[Debug::CHANGES] << "changeset of " << change.type
<< " author " << change.author << " time " << change.changetime
<< " in range " << start << "," << end << endl;
Range const new_range(start, end);
Range const new_range(start, end);
// remove all sub-ranges
for (; it != table_.end();) {
if (new_range != it->range && it->range.contained(new_range)) {
// remove all sub-ranges
for (; it != table_.end();) {
if (new_range != it->range && it->range.contained(new_range)) {
lyxerr[Debug::CHANGES] << "Using change of type " << c.change.type
<< " over " << c.range.start << "," << c.range.end << endl;
lyxerr[Debug::CHANGES] << "Using change of type " << c.change.type
<< " over " << c.range.start << "," << c.range.end << endl;
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
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
it->range.end = end;
it->change = change;
lyxerr[Debug::CHANGES] << "Resetting to new change" << endl;
it->range.end = end;
it->change = change;
lyxerr[Debug::CHANGES] << "Resetting to new change" << endl;
// split tail
if (c.range.end > end) {
++it;
// split tail
if (c.range.end > end) {
++it;
ChangeTable::iterator end = table_.end();
bool found = false;
ChangeTable::iterator end = table_.end();
bool found = false;
for (; it != end; ++it) {
Range & range(it->range);
for (; it != end; ++it) {
Range & range(it->range);
lyxerr[Debug::CHANGES] << "era:Range of type " << it->change.type << " is "
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;
if (range.contains(pos)) {
found = true;
--range.end;
set(change, pos);
return;
}
set(change, pos);
return;
}
ChangeTable::iterator it = table_.begin();
for (; it != table_.end(); ++it) {
Range & range(it->range);
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);
if (range.contains(pos)) {
if (it->change.type != Change::INSERTED) {
set(change, pos);
void Changes::add(Change change, ChangeTable::size_type pos)
{
ChangeTable::iterator it = table_.begin();
ChangeTable::iterator end = table_.end();
bool found = false;
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);
for (; it != end; ++it) {
Range & range(it->range);
if (!found && range.loose_contains(pos)) {
found = true;
lyxerr[Debug::CHANGES] << "Found range of "
if (!found && range.loose_contains(pos)) {
found = true;
lyxerr[Debug::CHANGES] << "Found range of "
- << range.start << "," << range.end << endl;
+ << range.start << "," << range.end << endl;
Change const Changes::lookupFull(pos_type pos) const
{
if (!table_.size()) {
lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl;
return Change(empty_type_);
}
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();
ChangeTable::const_iterator it = table_.begin();
ChangeTable::const_iterator end = table_.end();
if (it->range.contains(pos))
return it->change;
}
if (it->range.contains(pos))
return it->change;
}
check();
lyx::Assert(0);
return Change(Change::UNCHANGED);
}
check();
lyx::Assert(0);
return Change(Change::UNCHANGED);
}
Change::Type Changes::lookup(pos_type pos) const
{
Change::Type Changes::lookup(pos_type pos) const
{
lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl;
return empty_type_;
}
lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl;
return empty_type_;
}
ChangeTable::const_iterator it = table_.begin();
ChangeTable::const_iterator end = table_.end();
ChangeTable::const_iterator it = table_.begin();
ChangeTable::const_iterator end = table_.end();
if (it->range.contains(pos))
return it->change.type;
}
if (it->range.contains(pos))
return it->change.type;
}
check();
lyx::Assert(0);
return Change::UNCHANGED;
check();
lyx::Assert(0);
return Change::UNCHANGED;
lyxerr[Debug::CHANGES] << "Empty, type is " << empty_type_ << endl;
return empty_type_ != Change::UNCHANGED;
}
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 << ","
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 "
if (it->range.intersects(Range(start, end))
&& it->change.type != Change::UNCHANGED) {
lyxerr[Debug::CHANGES] << "Found intersection of "
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;
}
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();
ChangeTable::const_iterator it = table_.begin();
ChangeTable::const_iterator itend = table_.end();
if (it->range.intersects(Range(start, end ? end - 1 : 0))
&& it->change.type != Change::INSERTED) {
return true;
if (it->range.intersects(Range(start, end ? end - 1 : 0))
&& it->change.type != Change::INSERTED) {
return true;
void Changes::merge()
{
lyxerr[Debug::CHANGES] << "Starting merge" << endl;
void Changes::merge()
{
lyxerr[Debug::CHANGES] << "Starting merge" << endl;
while (it != table_.end()) {
lyxerr[Debug::CHANGES] << "Range of type " << it->change.type << " is "
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;
if (it->range.start == it->range.end) {
lyxerr[Debug::CHANGES] << "Removing empty range for pos "
<< it->range.start << endl;
it = table_.begin();
continue;
}
it = table_.begin();
continue;
}
if (it + 1 == table_.end())
break;
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 << ","
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
(it + 1)->range.start = it->range.start;
table_.erase(it);
// start again
lyxerr[Debug::CHANGES] << "Merge ended" << endl;
check();
}
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);
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 "
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;
if (it + 1 == end)
break;
if (range.end != next.start)
dont_assert = false;
}
if (range.end != next.start)
dont_assert = false;
}
- lyxerr[Debug::CHANGES] << "End" << endl;
+ lyxerr[Debug::CHANGES] << "End" << endl;
lyx::Assert(dont_assert);
}
lyx::Assert(dont_assert);
}
int Changes::latexMarkChange(std::ostream & os, Change::Type old, Change::Type change)
int Changes::latexMarkChange(std::ostream & os, Change::Type old, Change::Type change)
if (old == change)
return 0;
if (old == change)
return 0;
string const end("\\changeend{}");
string const son("\\overstrikeon{}");
string const soff("\\overstrikeoff{}");
string const end("\\changeend{}");
string const son("\\overstrikeon{}");
string const soff("\\overstrikeoff{}");
if (old == Change::DELETED) {
os << soff;
column += soff.length();
}
if (old == Change::DELETED) {
os << soff;
column += soff.length();
}
switch (change) {
case Change::UNCHANGED:
os << end;
switch (change) {
case Change::UNCHANGED:
os << end;
switch (change.type) {
case Change::UNCHANGED:
os << "\n\\change_unchanged\n";
switch (change.type) {
case Change::UNCHANGED:
os << "\n\\change_unchanged\n";
t = curtime;
os << "\n\\change_deleted " << change.author
<< " " << t << "\n";
t = curtime;
os << "\n\\change_deleted " << change.author
<< " " << t << "\n";
}
Format::Format(string const & n, string const & e, string const & p,
}
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),
char c;
string s;
is >> c;
char c;
string s;
is >> c;
getline(is, s, '"');
else {
is.putback(c);
getline(is, s, '"');
else {
is.putback(c);
}
vector<Graph::Vertex> Graph::vertices_;
}
vector<Graph::Vertex> Graph::vertices_;
#include <vector>
class Graph {
#include <vector>
class Graph {
Graph() : numedges_(0) {};
///
typedef std::vector<int> EdgePath;
Graph() : numedges_(0) {};
///
typedef std::vector<int> EdgePath;
// static due to the setvbuf. Ugly.
static char o_buf[BUFSIZ];
// 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;
// We need to throw an exception not do this
pipein[0] = pipein[1] = pipeout[0] = pipeout[1]
= pipeerr[0] = pipeerr[1] = -1;
child_.reset(li);
if (li->start() == -1) {
error_ = _("Could not create an ispell process.\nYou may not have "
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;
}
child_.reset(0);
return;
}
SearchResult nextChange(BufferView * bv, LyXText * text, pos_type & length)
{
Paragraph * par = text->cursor.par();
SearchResult nextChange(BufferView * bv, LyXText * text, pos_type & length)
{
Paragraph * par = text->cursor.par();
SearchResult findNextChange(BufferView * bv, LyXText * text, pos_type & length)
{
if (text->selection.set())
SearchResult findNextChange(BufferView * bv, LyXText * text, pos_type & length)
{
if (text->selection.set())
bv->update(bv->getLyXText(), BufferView::SELECT | BufferView::FITCUR);
pos_type length;
bv->update(bv->getLyXText(), BufferView::SELECT | BufferView::FITCUR);
pos_type length;
if (bv->theLockingInset()) {
bool found = bv->theLockingInset()->nextChange(bv, 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 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);
// 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);
bv->toggleSelection();
text->clearSelection();
bv->toggleSelection();
text->clearSelection();
SearchResult result = nextChange(bv, text, length);
lyxerr << "Result is " << result << endl;
SearchResult result = nextChange(bv, text, length);
lyxerr << "Result is " << result << endl;
// 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.
// 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.
} // end lyxfind namespace
} // end lyxfind namespace
/// find the next change in the buffer
bool findNextChange(BufferView * bv);
/// find the next change in the buffer
bool findNextChange(BufferView * bv);
SearchResult findNextChange(BufferView * bv, LyXText * text, lyx::pos_type & length);
SearchResult findNextChange(BufferView * bv, LyXText * text, lyx::pos_type & length);
SearchResult nextChange(BufferView * bv, LyXText * text, lyx::pos_type & length);
SearchResult nextChange(BufferView * bv, LyXText * text, lyx::pos_type & length);
} // end namespace LyXFind
} // end namespace LyXFind
// should be moved from the LyXRC class).
use_gui = true;
pdf_mode = false;
// should be moved from the LyXRC class).
use_gui = true;
pdf_mode = false;
user_name = lyx::user_name();
user_name = lyx::user_name();
user_email = lyx::user_email();
if (user_email.empty())
user_email = lyx::user_email();
if (user_email.empty())
if (lexrc.next())
user_email = lexrc.getString();
break;
if (lexrc.next())
user_email = lexrc.getString();
break;
case RC_LAST: break; // this is just a dummy
}
}
case RC_LAST: break; // this is just a dummy
}
}
unsigned int Row::top_of_text() const
{
return top_of_text_;
}
unsigned int Row::top_of_text() const
{
return top_of_text_;
}
void Row::baseline(unsigned int b)
{
baseline_ = b;
void Row::baseline(unsigned int b)
{
baseline_ = b;
lyx::pos_type lastPos() const;
/// return the position of the last normal, printable character in this row
lyx::pos_type lastPrintablePos() const;
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 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!
* 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!
/// accept selected change
void acceptChange(BufferView * bv);
/// accept selected change
void acceptChange(BufferView * bv);
- /// reject selected change
+ /// reject selected change
void rejectChange(BufferView * bv);
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.
/** '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.
unsigned char c = str[0];
str[0] = transformChar(c, pos);
}
unsigned char c = str[0];
str[0] = transformChar(c, pos);
}
bool prev_struckout(isDeletedText(par_, pos));
bool prev_newtext(isInsertedText(par_, pos));
bool prev_struckout(isDeletedText(par_, pos));
bool prev_newtext(isInsertedText(par_, pos));
++vpos;
// collect as much similar chars as we can
++vpos;
// collect as much similar chars as we can
if (prev_struckout != isDeletedText(par_, pos))
break;
if (prev_struckout != isDeletedText(par_, pos))
break;
if (prev_newtext != isInsertedText(par_, pos))
break;
if (prev_newtext != isInsertedText(par_, pos))
break;
if (arabic && Encodings::IsComposeChar_arabic(c))
break;
if (hebrew && Encodings::IsComposeChar_hebrew(c))
if (arabic && Encodings::IsComposeChar_arabic(c))
break;
if (hebrew && Encodings::IsComposeChar_hebrew(c))
pos_type const start = row_.pos();
pos_type const end = row_.lastPrintablePos();
pos_type const start = row_.pos();
pos_type const end = row_.lastPrintablePos();
- if (!par_.isChanged(start, end))
+ if (!par_.isChanged(start, end))
int const height = (row_.next()
int const height = (row_.next()
- ? row_.height() + row_.next()->top_of_text()
+ ? row_.height() + row_.next()->top_of_text()
pain_.fillRectangle(4, yo_, 5, height, LColor::changebar);
}
pain_.fillRectangle(4, yo_, 5, height, LColor::changebar);
}
void RowPainter::paintAppendix()
{
// FIXME: can be just width_ ?
void RowPainter::paintAppendix()
{
// FIXME: can be just width_ ?
} else {
// adding or removing space
bool const added = vsp.kind() != VSpace::LENGTH ||
} 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;
ty1 = added ? (start + arrow_size) : start;
ty2 = added ? start : (start + arrow_size);
by1 = added ? (end - arrow_size) : end;
bool running_strikeout = false;
bool is_struckout = false;
float last_strikeout_x = 0.0;
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);
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;
}
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_;
}
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));
bool const highly_editable_inset = par_.isInset(pos)
&& isHighlyEditableInset(par_.getInset(pos));
LColor::strikeout, Painter::line_solid, Painter::line_thin);
running_strikeout = false;
}
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());
if (main_body > 0 && pos == main_body - 1) {
int const lwidth = font_metrics::width(layout->labelsep,
getLabelFont());
++vpos;
} else {
if (paintFromPos(vpos))
++vpos;
} else {
if (paintFromPos(vpos))
// if we reach the end of a struck out range, paint it
if (running_strikeout) {
int const middle = yo_ + row_.top_of_text()
// if we reach the end of a struck out range, paint it
if (running_strikeout) {
int const middle = yo_ + row_.top_of_text()
// changebar
paintChangeBar();
// changebar
paintChangeBar();
if (row_.isParStart()) {
paintFirst();
}
if (row_.isParStart()) {
paintFirst();
}