#include "support/textutils.h"
#include "support/LAssert.h"
#include "support/lstrings.h"
+#include "support/lyxalgo.h" // lyx::count
#include <fstream>
#include <algorithm>
using std::max;
using std::make_pair;
using std::vector;
+using std::pair;
using lyx::pos_type;
using lyx::layout_type;
int old_x = top_x;
if (top_x != int(x)) {
top_x = int(x);
+ topx_set = true;
int nw = getMaxWidth(bv, this);
if (nw > 0 && old_max_width != nw) {
need_update = INIT;
old_max_width = nw;
bv->text->status(bv, LyXText::CHANGED_IN_DRAW);
- topx_set = true;
return;
- } else {
- top_x = old_x;
}
}
// repaint the background if needed
if (cleared && backgroundColor() != LColor::background) {
- top_x = int(x);
clearInset(bv, baseline, cleared);
- top_x = old_x;
}
// no draw is necessary !!!
if ((drawFrame_ == LOCKED) && !locked && !par->size()) {
- top_x = int(x);
- topx_set = true;
top_baseline = baseline;
x += width(bv, f);
if (need_update & CLEAR_FRAME)
x += static_cast<float>(scroll());
// if top_x differs we did it already
- if (!cleared && (top_x == int(x))
+ if (!cleared && (old_x == int(x))
&& ((need_update&(INIT|FULL)) || (top_baseline != baseline)
- ||(last_drawn_width != insetWidth))) {
+ ||(last_drawn_width != insetWidth)))
+ {
// Condition necessary to eliminate bug 59 attachment 37
- if (baseline > 0) clearInset(bv, baseline, cleared);
+ if (baseline > 0)
+ clearInset(bv, baseline, cleared);
}
- top_x = int(x);
- topx_set = true;
if (cleared)
frame_is_visible = false;
showInsetCursor(bv);
if (clear)
lt = 0;
- updateLocal(bv, CURSOR, false);
+
+ int code = CURSOR;
+ if (drawFrame_ == LOCKED)
+ code = CURSOR|DRAW_FRAME;
+ updateLocal(bv, code, false);
}
showInsetCursor(bv);
if (clear)
lt = 0;
- updateLocal(bv, CURSOR, false);
+ int code = CURSOR;
+ if (drawFrame_ == LOCKED)
+ code = CURSOR|DRAW_FRAME;
+ updateLocal(bv, code, false);
}
}
if ((*it)->getInsetFromID(id)) {
getLyXText(bv)->setCursorIntern(bv, p, it.getPos());
- lockInset(bv, static_cast<UpdatableInset *>(*it));
+ (*it)->edit(bv);
return the_locking_inset->lockInsetInInset(bv, inset);
}
}
updateLocal(bv, CURSOR_PAR, false);
return result;
} else if (result >= FINISHED) {
- switch(result) {
+ switch (result) {
case FINISHED_RIGHT:
moveRightIntern(bv, false, false);
result = DISPATCHED;
// Derive layout number from given argument (string)
// and current buffer's textclass (number). */
textclass_type tclass = bv->buffer()->params.textclass;
- std::pair <bool, layout_type> layout =
+ pair<bool, layout_type> layout =
textclasslist.NumberOfLayout(tclass, arg);
// If the entry is obsolete, use the new one instead.
while (p) {
string const tmp = buf->asciiParagraph(p, linelen, p->previous()==0);
- lines += countChar(tmp, '\n');
+ lines += lyx::count(tmp.begin(), tmp.end(), '\n');
os << tmp;
p = p->next();
}
}
if (environment_stack[depth] != style.latexname()) {
- if(environment_stack.size() == depth + 1) {
+ if (environment_stack.size() == depth + 1) {
environment_stack.push_back("!-- --");
environment_inner.push_back("!-- --");
}
if (style.latextype == LATEX_ENVIRONMENT) {
if (!style.latexparam().empty()) {
- if(style.latexparam() == "CDATA")
+ if (style.latexparam() == "CDATA")
os << "<![CDATA[";
else
buf->sgmlOpenTag(os, depth + command_depth,
switch (style.latextype) {
case LATEX_ENVIRONMENT:
if (!style.latexparam().empty()) {
- if(style.latexparam() == "CDATA")
+ if (style.latexparam() == "CDATA")
os << "]]>";
else
buf->sgmlCloseTag(os, depth + command_depth,
}
-std::vector<string> const InsetText::getLabelList() const
+vector<string> const InsetText::getLabelList() const
{
- std::vector<string> label_list;
+ vector<string> label_list;
Paragraph * tpar = par;
while (tpar) {
Paragraph::inset_iterator beg = tpar->inset_iterator_begin();
Paragraph::inset_iterator end = tpar->inset_iterator_end();
for (; beg != end; ++beg) {
- std::vector<string> const l = (*beg)->getLabelList();
+ vector<string> const l = (*beg)->getLabelList();
label_list.insert(label_list.end(), l.begin(), l.end());
}
tpar = tpar->next();
if (!recursive && (cached_bview == lbv)) {
LyXText * lt = cached_text.get();
lyx::Assert(lt && lt->firstRow()->par() == par);
- return cached_text.get();
+ return lt;
}
// Super UGLY! (Lgb)
lt = 0;
return str;
}
-#warning Dekel please have a look on this one RTL? (Jug)
-#warning DEKEL!
- // we have to go on checking so move cusor to the right
+ // we have to go on checking so move cusor to the next char
lt->cursor.pos(lt->cursor.pos() + 1);
}
str = lt->selectNextWordToSpellcheck(bv, value);