void BufferView::setCursor(ParIterator const & par, lyx::pos_type pos)
{
- for (int i = 0, n = par.size(); i < n; ++i)
+ for (int i = 0, n = par.depth(); i < n; ++i)
par[i].inset().edit(cursor(), true);
cursor().setCursor(makeDocIterator(par, pos));
cursor().selection() = false;
}
+
void BufferView::putSelectionAt(DocIterator const & cur,
int length, bool backwards)
{
}
-void BufferView::Pimpl::scroll(int lines)
+void BufferView::Pimpl::scroll(int /*lines*/)
{
// if (!buffer_)
// return;
}
if (!xsel_cache_.set ||
- cur.back() != xsel_cache_.cursor ||
- cur.anchor_.back() != xsel_cache_.anchor)
+ cur.top() != xsel_cache_.cursor ||
+ cur.anchor_.top() != xsel_cache_.anchor)
{
- xsel_cache_.cursor = cur.back();
- xsel_cache_.anchor = cur.anchor_.back();
+ xsel_cache_.cursor = cur.top();
+ xsel_cache_.anchor = cur.anchor_.top();
xsel_cache_.set = cur.selection();
sel = cur.selectionAsString(false);
if (!sel.empty())
+2005-02-08 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * text3.C (dispatch): size() -> depth()
+
+ * text2.C: remove some debug output
+
+ * paragraph.C: ws changes only
+
+ * lyxfunc.C (getStatus): size() -> depth()
+
+ * dociterator.h (clear, push_back, pop_back, internalData,
+ operator[], resize, empty): new functions
+ Make StableDocIterator and operator== be friends. Don't inherit
+ from std::vector use a privat class variable slices_ instead.
+ Modify to fit.
+
+ * dociterator.C: update because of not inheriting from std::vector
+ anymore. Call explictly to slices_ instead. Use depth() instead of
+ size() and top() instead of back()
+
+ * cursor.C: chagne size() -> depth and back() -> top(). Also
+ remove some direct operator[](i) calls in favour of foo[i]
+ (getFont): remove some dead code
+
+ * bufferview_funcs.C (coordOffset): size() -> depth()
+
+ * buffer.C: ws changes only
+
+ * CutAndPaste.C (eraseSelection): back() -> top()
+
+ * BufferView_pimpl.C (selectionRequested): back() -> top()
+
+ * BufferView.C (setCursor): size() -> depth()
+
2005-02-08 Lars Gullik Bjonnes <larsbj@gullik.net>
* text3.C (cursorPrevious): return true if depm changed something
for (InsetBase::col_type col = c1; col <= c2; ++col)
p->cell(p->index(row, col)).clear();
}
- cur.back() = i1;
+ cur.top() = i1;
cur.pos() = 0; // We've deleted the whole cell. Only pos 0 is valid.
cur.resetAnchor();
} else {
// insert the string, don't insert doublespace
bool space_inserted = true;
for (string::const_iterator cit = str.begin();
- cit != str.end(); ++cit) {
+ cit != str.end(); ++cit) {
Paragraph & par = pars[pit];
if (*cit == '\n') {
if (autobreakrows && (!par.empty() || par.allowEmpty())) {
int y = 0;
// Contribution of nested insets
- for (size_t i = 1; i != dit.size(); ++i) {
+ for (size_t i = 1; i != dit.depth(); ++i) {
CursorSlice const & sl = dit[i];
- int xx = 0, yy = 0;
+ int xx = 0;
+ int yy = 0;
sl.inset().getCursorPos(sl, xx, yy);
x += xx;
y += yy;
CoordCache::InnerParPosCache::const_iterator it = cache.find(bot.pit());
if (it == cache.end()) {
//lyxerr << "cursor out of view" << std::endl;
- return Point(-1,-1);
+ return Point(-1, -1);
}
Point p = coordOffset(dit); // offset from outer paragraph
p.y_ += it->second.y_;
positionable(DocIterator const & cursor, DocIterator const & anchor)
{
// avoid deeper nested insets when selecting
- if (cursor.size() > anchor.size())
+ if (cursor.depth() > anchor.depth())
return false;
// anchor might be deeper, should have same path then
- for (size_t i = 0; i < cursor.size(); ++i)
+ for (size_t i = 0; i < cursor.depth(); ++i)
if (&cursor[i].inset() != &anchor[i].inset())
return false;
DocIterator result;
DocIterator it = c;
- it.back().pos() = 0;
+ it.top().pos() = 0;
DocIterator et = c;
- et.back().pos() = et.back().asMathInset()->cell(et.back().idx()).size();
+ et.top().pos() = et.top().asMathInset()->cell(et.top().idx()).size();
for (int i = 0; ; ++i) {
- int xo, yo;
+ int xo;
+ int yo;
LCursor cur = c;
cur.setCursor(it);
cur.inset().getCursorPos(cur.top(), xo, yo);
void LCursor::dispatch(FuncRequest const & cmd0)
{
- lyxerr[Debug::DEBUG] << "LCursor::dispatch: cmd: "
- << cmd0 << endl << *this << endl;
+ lyxerr[Debug::DEBUG] << BOOST_CURRENT_FUNCTION
+ << " cmd: " << cmd0 << '\n'
+ << *this << endl;
if (empty())
return;
FuncRequest cmd = cmd0;
LCursor safe = *this;
- for (; size(); pop()) {
+ for (; depth(); pop()) {
lyxerr[Debug::DEBUG] << "LCursor::dispatch: cmd: "
<< cmd0 << endl << *this << endl;
BOOST_ASSERT(pos() <= lastpos());
void LCursor::pop()
{
- BOOST_ASSERT(size() >= 1);
+ BOOST_ASSERT(depth() >= 1);
pop_back();
}
int LCursor::currentMode()
{
BOOST_ASSERT(!empty());
- for (int i = size() - 1; i >= 0; --i) {
+ for (int i = depth() - 1; i >= 0; --i) {
int res = operator[](i).inset().currentMode();
if (res != InsetBase::UNDECIDED_MODE)
return res;
CursorSlice LCursor::anchor() const
{
- BOOST_ASSERT(anchor_.size() >= size());
- CursorSlice normal = anchor_[size() - 1];
- if (size() < anchor_.size() && back() <= normal) {
+ BOOST_ASSERT(anchor_.depth() >= depth());
+ CursorSlice normal = anchor_[depth() - 1];
+ if (depth() < anchor_.depth() && top() <= normal) {
// anchor is behind cursor -> move anchor behind the inset
++normal.pos();
}
CursorSlice LCursor::selBegin() const
{
if (!selection())
- return back();
- return anchor() < back() ? anchor() : back();
+ return top();
+ return anchor() < top() ? anchor() : top();
}
CursorSlice LCursor::selEnd() const
{
if (!selection())
- return back();
- return anchor() > back() ? anchor() : back();
+ return top();
+ return anchor() > top() ? anchor() : top();
}
{
if (!selection())
return *this;
- return anchor() < back() ? anchor_ : *this;
+ return anchor() < top() ? anchor_ : *this;
}
{
if (!selection())
return *this;
- return anchor() > back() ? anchor_ : *this;
+ return anchor() > top() ? anchor_ : *this;
}
std::ostream & operator<<(std::ostream & os, LCursor const & cur)
{
os << "\n cursor: | anchor:\n";
- for (size_t i = 0, n = cur.size(); i != n; ++i) {
- os << " " << cur.operator[](i) << " | ";
- if (i < cur.anchor_.size())
+ for (size_t i = 0, n = cur.depth(); i != n; ++i) {
+ os << " " << cur[i] << " | ";
+ if (i < cur.anchor_.depth())
os << cur.anchor_[i];
else
os << "-------------------------------";
os << "\n";
}
- for (size_t i = cur.size(), n = cur.anchor_.size(); i < n; ++i) {
+ for (size_t i = cur.depth(), n = cur.anchor_.depth(); i < n; ++i) {
os << "------------------------------- | " << cur.anchor_[i] << "\n";
}
os << " selection: " << cur.selection_
return true;
// we can't move into anything new during selection
- if (depth() >= anchor_.size())
+ if (depth() >= anchor_.depth())
return false;
if (!ptr_cmp(t.nucleus(), &anchor_[depth()].inset()))
return false;
void LCursor::niceInsert(MathAtom const & t)
{
macroModeClose();
- string safe = lyx::cap::grabAndEraseSelection(*this);
+ string const safe = lyx::cap::grabAndEraseSelection(*this);
plainInsert(t);
// enter the new inset and move the contents of the selection if possible
if (t->isActive()) {
return;
MathUnknownInset * p = activeMacro();
p->finalize();
- string s = p->name();
+ string const s = p->name();
--pos();
cell().erase(pos());
void LCursor::setTargetX()
{
- //for now this is good enough. A better solution would be to
- //avoid this rebreak by setting cursorX only after drawing
+ // For now this is good enough. A better solution would be to
+ // avoid this rebreak by setting cursorX only after drawing
bottom().text()->redoParagraph(bottom().pit());
- int x, y;
+ int x;
+ int y;
getPos(x, y);
x_target_ = x;
}
//}
// try to find an inset that knows better then we
- while (1) {
+ while (true) {
//lyxerr << "updown: We are in " << &inset() << " idx: " << idx() << endl;
// ask inset first
if (inset().idxUpDown(*this, up)) {
}
// any improvement so far?
- int xnew, ynew;
+ int xnew;
+ int ynew;
getPos(xnew, ynew);
if (up ? ynew < yo : ynew > yo)
return true;
}
if (inTexted())
- return text()->currentState(*this);
+ return text()->currentState(*this);
return string();
}
int s = 0;
// go up until first non-0 text is hit
// (innermost text is 0 in mathed)
- for (s = size() - 1; s >= 0; --s)
+ for (s = depth() - 1; s >= 0; --s)
if (operator[](s).text())
break;
CursorSlice const & sl = operator[](s);
int s = 0;
// go up until first non-0 text is hit
// (innermost text is 0 in mathed)
- for (s = size() - 1; s >= 0; --s)
+ for (s = depth() - 1; s >= 0; --s)
if (operator[](s).text())
break;
CursorSlice const & sl = operator[](s);
bv().buffer()->params(),
sl.pos(),
outerFont(sl.pit(), text.paragraphs()));
- for (; s < size(); ++s)
- ;
+
return font;
}
LyXText * DocIterator::innerText()
{
BOOST_ASSERT(!empty());
- // go up until first non-0 text is hit
+ // Go up until first non-0 text is hit
// (innermost text is 0 in mathed)
- for (int i = size() - 1; i >= 0; --i)
- if (operator[](i).text())
- return operator[](i).text();
+ for (int i = depth() - 1; i >= 0; --i)
+ if (slices_[i].text())
+ return slices_[i].text();
return 0;
}
BOOST_ASSERT(!empty());
// go up until first non-0 text is hit
// (innermost text is 0 in mathed)
- for (int i = size() - 1; i >= 0; --i)
- if (operator[](i).text())
- return operator[](i).text();
+ for (int i = depth() - 1; i >= 0; --i)
+ if (slices_[i].text())
+ return slices_[i].text();
return 0;
}
InsetBase * DocIterator::innerInsetOfType(int code) const
{
- for (int i = size() - 1; i >= 0; --i)
- if (operator[](i).inset_->lyxCode() == code)
- return operator[](i).inset_;
+ for (int i = depth() - 1; i >= 0; --i)
+ if (slices_[i].inset_->lyxCode() == code)
+ return slices_[i].inset_;
return 0;
}
return;
}
- CursorSlice & top = back();
+ CursorSlice & tip = top();
//lyxerr << "XXX\n" << *this << endl;
// this is used twice and shows up in the profiler!
// move into an inset to the right if possible
InsetBase * n = 0;
- if (top.pos() != lastp) {
+ if (tip.pos() != lastp) {
// this is impossible for pos() == size()
if (inMathed()) {
- n = (top.cell().begin() + top.pos())->nucleus();
+ n = (tip.cell().begin() + tip.pos())->nucleus();
} else {
- if (paragraph().isInset(top.pos()))
- n = paragraph().getInset(top.pos());
+ if (paragraph().isInset(tip.pos()))
+ n = paragraph().getInset(tip.pos());
}
}
}
// otherwise move on one position if possible
- if (top.pos() < lastp) {
+ if (tip.pos() < lastp) {
//lyxerr << "... next pos" << endl;
- ++top.pos();
+ ++tip.pos();
return;
}
//lyxerr << "... no next pos" << endl;
// otherwise move on one paragraph if possible
- if (top.pit() < lastpit()) {
+ if (tip.pit() < lastpit()) {
//lyxerr << "... next par" << endl;
- ++top.pit();
- top.pos() = 0;
+ ++tip.pit();
+ tip.pos() = 0;
return;
}
//lyxerr << "... no next pit" << endl;
// otherwise try to move on one cell if possible
- if (top.idx() < lastidx()) {
+ if (tip.idx() < lastidx()) {
//lyxerr << "... next idx" << endl;
- ++top.idx();
- top.pit() = 0;
- top.pos() = 0;
+ ++tip.idx();
+ tip.pit() = 0;
+ tip.pos() = 0;
return;
}
//lyxerr << "... no next idx" << endl;
// otherwise leave inset and jump over inset as a whole
pop_back();
// 'top' is invalid now...
- if (size())
- ++back().pos();
+ if (!empty())
+ ++top().pos();
}
void DocIterator::forwardChar()
{
forwardPos();
- while (size() != 0 && pos() == lastpos())
+ while (!empty() && pos() == lastpos())
forwardPos();
}
void DocIterator::forwardInset()
{
forwardPos();
- while (size() != 0 && (pos() == lastpos() || nextInset() == 0))
+ while (!empty() && (pos() == lastpos() || nextInset() == 0))
forwardPos();
}
void DocIterator::backwardChar()
{
backwardPos();
- while (size() != 0 && pos() == lastpos())
+ while (!empty() && pos() == lastpos())
backwardPos();
}
//this dog bites his tail
if (empty()) {
push_back(CursorSlice(*inset_));
- back().idx() = lastidx();
- back().pit() = lastpit();
- back().pos() = lastpos();
+ top().idx() = lastidx();
+ top().pit() = lastpit();
+ top().pos() = lastpos();
return;
}
- CursorSlice & top = back();
+ CursorSlice & tip = top();
- if (top.pos() != 0) {
- --top.pos();
- } else if (top.pit() != 0) {
- --top.pit();
- top.pos() = lastpos();
+ if (tip.pos() != 0) {
+ --tip.pos();
+ } else if (tip.pit() != 0) {
+ --tip.pit();
+ tip.pos() = lastpos();
return;
- } else if (top.idx() != 0) {
- --top.idx();
- top.pit() = lastpit();
- top.pos() = lastpos();
+ } else if (tip.idx() != 0) {
+ --tip.idx();
+ tip.pit() = lastpit();
+ tip.pos() = lastpos();
return;
} else {
pop_back();
InsetBase * n = 0;
if (inMathed()) {
- n = (top.cell().begin() + top.pos())->nucleus();
+ n = (tip.cell().begin() + tip.pos())->nucleus();
} else {
- if (paragraph().isInset(top.pos()))
- n = paragraph().getInset(top.pos());
+ if (paragraph().isInset(tip.pos()))
+ n = paragraph().getInset(tip.pos());
}
if (n && n->isActive()) {
push_back(CursorSlice(*n));
- back().idx() = lastidx();
- back().pit() = lastpit();
- back().pos() = lastpos();
+ top().idx() = lastidx();
+ top().pit() = lastpit();
+ top().pos() = lastpos();
}
}
bool DocIterator::hasPart(DocIterator const & it) const
{
// it can't be a part if it is larger
- if (it.size() > size())
+ if (it.depth() > depth())
return false;
// as inset adresses are the 'last' level
- return &it.back().inset() == &operator[](it.size() - 1).inset();
+ return &it.top().inset() == &slices_[it.depth() - 1].inset();
}
std::ostream & operator<<(std::ostream & os, DocIterator const & dit)
{
- for (size_t i = 0, n = dit.size(); i != n; ++i)
- os << " " << dit.operator[](i) << "\n";
+ for (size_t i = 0, n = dit.depth(); i != n; ++i)
+ os << " " << dit[i] << "\n";
return os;
}
///////////////////////////////////////////////////////
-StableDocIterator::StableDocIterator(const DocIterator & dit)
+StableDocIterator::StableDocIterator(DocIterator const & dit)
{
- data_ = dit;
+ data_ = dit.internalData();
for (size_t i = 0, n = data_.size(); i != n; ++i)
data_[i].inset_ = 0;
}
for (size_t i = 0, n = data_.size(); i != n; ++i) {
if (inset == 0) {
// FIXME
- lyxerr << "Should not happen, but does e.g. after C-n C-l C-z S-C-z"
- << endl << "dit: " << dit << endl
+ lyxerr << BOOST_CURRENT_FUNCTION
+ << " Should not happen, but does e.g. after C-n C-l C-z S-C-z"
+ << '\n' << "dit: " << dit << '\n'
<< " lastpos: " << dit.lastpos() << endl;
//break;
BOOST_ASSERT(false);
}
dit.push_back(data_[i]);
- dit.back().inset_ = inset;
+ dit.top().inset_ = inset;
if (i + 1 != n)
inset = dit.nextInset();
}
// The public inheritance should go in favour of a suitable data member
// (or maybe private inheritance) at some point of time.
-class DocIterator : public std::vector<CursorSlice>
+class DocIterator // : public std::vector<CursorSlice>
{
public:
/// type for cell number in inset
///
explicit DocIterator(InsetBase & inset);
+ CursorSlice const & operator[](size_t i) const {
+ return slices_[i];
+ }
+
+ CursorSlice & operator[](size_t i) {
+ return slices_[i];
+ }
+
+ // What is the point of this function?
+ void resize(size_t i) { slices_.resize(i); }
+
/// is the iterator valid?
operator const void*() const { return empty() ? 0 : this; }
/// is this iterator invalid?
bool operator!() const { return empty(); }
+ bool empty() const { return slices_.empty(); }
+
//
// access to slice at tip
//
/// access to tip
- CursorSlice & top() { return back(); }
+ CursorSlice & top() { return slices_.back(); }
/// access to tip
- CursorSlice const & top() const { return back(); }
+ CursorSlice const & top() const { return slices_.back(); }
/// access to outermost slice
- CursorSlice & bottom() { return front(); }
+ CursorSlice & bottom() { return slices_.front(); }
/// access to outermost slicetip
- CursorSlice const & bottom() const { return front(); }
+ CursorSlice const & bottom() const { return slices_.front(); }
/// how many nested insets do we have?
- size_t depth() const { return size(); }
+ size_t depth() const { return slices_.size(); }
/// the containing inset
- InsetBase & inset() const { return back().inset(); }
+ InsetBase & inset() const { return top().inset(); }
/// return the cell of the inset this cursor is in
- idx_type idx() const { return back().idx(); }
+ idx_type idx() const { return top().idx(); }
/// return the cell of the inset this cursor is in
- idx_type & idx() { return back().idx(); }
+ idx_type & idx() { return top().idx(); }
/// return the last possible cell in this inset
idx_type lastidx() const;
/// return the paragraph this cursor is in
- pit_type pit() const { return back().pit(); }
+ pit_type pit() const { return top().pit(); }
/// return the paragraph this cursor is in
- pit_type & pit() { return back().pit(); }
+ pit_type & pit() { return top().pit(); }
/// return the last possible paragraph in this inset
pit_type lastpit() const;
/// return the position within the paragraph
- pos_type pos() const { return back().pos(); }
+ pos_type pos() const { return top().pos(); }
/// return the position within the paragraph
- pos_type & pos() { return back().pos(); }
+ pos_type & pos() { return top().pos(); }
/// return the last position within the paragraph
pos_type lastpos() const;
/// output
friend std::ostream &
operator<<(std::ostream & os, DocIterator const & cur);
+ friend bool operator==(DocIterator const &, DocIterator const &);
+ friend class StableDocIterator;
+protected:
+ void clear() { slices_.clear(); }
+ void push_back(CursorSlice const & sl) {
+ slices_.push_back(sl);
+ }
+ void pop_back() {
+ slices_.pop_back();
+ }
private:
+ std::vector<CursorSlice> const & internalData() const {
+ return slices_;
+ }
+ std::vector<CursorSlice> slices_;
InsetBase * inset_;
};
DocIterator doc_iterator_end(InsetBase & inset);
+inline
+bool operator==(DocIterator const & di1, DocIterator const & di2)
+{
+ return di1.slices_ == di2.slices_;
+}
+
+
+inline
+bool operator!=(DocIterator const & di1, DocIterator const & di2)
+{
+ return !(di1 == di2);
+}
+
+
// The difference to a ('non stable') DocIterator is the removed
// (overwritte by 0...) part of the CursorSlice data items. So this thing
// is suitable for external storage, but not for iteration as such.
+2005-02-08 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * LyXView.C (updateLayoutChoice): minor change to some comments
+
2005-01-20 Asger Ottar Alstrup <aalstrup@laerdal.dk>
* pch.h: use the HAVE_UNISTD_H preprocessor guard.
void LyXView::updateLayoutChoice()
{
- // don't show any layouts without a buffer
+ // Don't show any layouts without a buffer
if (!view()->buffer()) {
toolbars_->clearLayoutList();
return;
}
- // update the layout display
+ // Update the layout display
if (toolbars_->updateLayoutList(buffer()->params().textclass)) {
current_layout = buffer()->params().getLyXTextClass().defaultLayoutName();
}
+2005-02-08 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * ControlSpellchecker.C (nextWord): size() -> depth()
+ * ControlTabular.C(initializeParams): ditto
+
2005-01-31 Lars Gullik Bjonnes <larsbj@gullik.net>
* ControlGraphics.C (browse): rewrite to use boost.filesystem
bool ignoreword = false;
string word, lang_code;
- while(cur.size()) {
+ while (cur.depth()) {
if (isLetter(cur)) {
if (!inword) {
inword = true;
LCursor const & cur = bv->cursor();
// get the innermost tabular inset;
// assume that it is "ours"
- for (int i = cur.size() - 1; i >= 0; --i)
+ for (int i = cur.depth() - 1; i >= 0; --i)
if (cur[i].inset().lyxCode() == InsetBase::TABULAR_CODE) {
active_cell_ = cur[i].idx();
break;
+2005-02-08 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * insetcollapsable.C (leaveInset): size() -> depth()
+ * insettabular.C (isRightToLeft): ditto
+
2005-02-03 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* insetert.C (latex, linuxdoc, docbook): remove newline handling
void leaveInset(LCursor & cur, InsetBase const & in)
{
- for (unsigned int i = 0; i != cur.size(); ++i) {
+ for (size_t i = 0; i != cur.depth(); ++i) {
if (&cur[i].inset() == &in) {
cur.resize(i);
return;
bool InsetTabular::isRightToLeft(LCursor & cur) const
{
- BOOST_ASSERT(cur.size() > 1);
- Paragraph const & parentpar = cur[cur.size() - 2].paragraph();
- LCursor::pos_type const parentpos = cur[cur.size() - 2].pos();
+ BOOST_ASSERT(cur.depth() > 1);
+ Paragraph const & parentpar = cur[cur.depth() - 2].paragraph();
+ LCursor::pos_type const parentpos = cur[cur.depth() - 2].pos();
return parentpar.getFontSettings(cur.bv().buffer()->params(),
parentpos).language()->RightToLeft();
}
void InsetText::doDispatch(LCursor & cur, FuncRequest & cmd)
{
- //lyxerr << "InsetText::doDispatch: " << cmd.action << " " << endl;
+ lyxerr << BOOST_CURRENT_FUNCTION
+ << " [ cmd.action = " << cmd.action << ']' << endl;
setViewCache(&cur.bv());
text_.dispatch(cur, cmd);
// BufferView * arg, though (which should be avoided)
//LCursor safe = *this;
bool res = false;
- for ( ; cursor.size(); cursor.pop()) {
+ for ( ; cursor.depth(); cursor.pop()) {
//lyxerr << "\nLCursor::getStatus: cmd: " << cmd << endl << *this << endl;
DocIterator::idx_type & idx = cursor.idx();
DocIterator::idx_type const lastidx = cursor.lastidx();
case LFUN_INSET_SETTINGS: {
enable = false;
- if (!cur.size())
+ if (!cur)
break;
UpdatableInset * inset = cur.inset().asUpdatableInset();
lyxerr << "inset: " << inset << endl;
+2005-02-08 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * math_data.C (isInside): size() -> depth()
+
2005-01-31 Asger Ottar Alstrup <aalstrup@laerdal.dk>
* math_data.C:
bool isInside(DocIterator const & it, MathArray const & ar,
lyx::pos_type p1, lyx::pos_type p2)
{
- for (size_t i = 0; i != it.size(); ++i) {
+ for (size_t i = 0; i != it.depth(); ++i) {
CursorSlice const & sl = it[i];
if (sl.inset().inMathed() && &sl.cell() == &ar)
return p1 <= sl.pos() && sl.pos() < p2;
}
LyXFont basefont;
-
+
LaTeXFeatures features(buf, bparams, runparams.nice);
-
+
// output change tracking marks only if desired,
// if dvipost is installed,
// and with dvi/ps (other formats don't work)
Change::Type change = pimpl_->lookupChange(i);
- column += Changes::latexMarkChange(os, running_change,
+ column += Changes::latexMarkChange(os, running_change,
change, output);
running_change = change;
rows_[i].dump();
}
}
-
if (cur.pos() != cur.lastpos()) {
bool updateNeeded = false;
if (!checkAndActivateInset(cur, true)) {
- lyxerr << BOOST_CURRENT_FUNCTION
- << " Running setCursor" << endl;
-
updateNeeded |= setCursor(cur, cur.pit(), cur.pos() + 1, true, false);
if (false && bidi.isBoundary(cur.buffer(), cur.paragraph(),
cur.pos()))
break;
case LFUN_BEGINNINGBUF:
- if (cur.size() == 1) {
+ if (cur.depth() == 1) {
if (!cur.mark())
cur.clearSelection();
cursorTop(cur);
break;
case LFUN_BEGINNINGBUFSEL:
- if (cur.size() == 1) {
+ if (cur.depth() == 1) {
if (!cur.selection())
cur.resetAnchor();
cursorTop(cur);
break;
case LFUN_ENDBUF:
- if (cur.size() == 1) {
+ if (cur.depth() == 1) {
if (!cur.mark())
cur.clearSelection();
cursorBottom(cur);
break;
case LFUN_ENDBUFSEL:
- if (cur.size() == 1) {
+ if (cur.depth() == 1) {
if (!cur.selection())
cur.resetAnchor();
cursorBottom(cur);