src/CutAndPaste.C
src/debug.C
src/exporter.C
+src/ext_l10n.h
src/figure_form.C
src/figureForm.C
src/FontLoader.C
void BufferView::showLockedInsetCursor(int x, int y, int asc, int desc)
{
- if (available() && theLockingInset()) {
+ if (available() && theLockingInset() && !theLockingInset()->nodraw()) {
LyXCursor cursor = text->cursor;
Inset * locking_inset = theLockingInset()->getLockingInset();
+2002-01-06 Juergen Vigna <jug@sad.it>
+
+ * text.C (nextBreakPoint): fixed up this function we had this bug
+ since ever but now hopefully we break row better.
+ (insertChar): we have to check if an inset is the next char as it
+ could now happen that a large inset is causing a break.
+
+2002-01-05 Juergen Vigna <jug@sad.it>
+
+ * BufferView2.C (showLockedInsetCursor): don't draw the inset cursor
+ if it doesn't like to be drawed.
+
2002-01-04 Juergen Vigna <jug@sad.it>
* BufferView2.C (lockInset): forgot to set a cursor.
+2002-01-05 Juergen Vigna <jug@sad.it>
+
+ * insettext.C (draw): move the calls so that insetWidth/Asc/Desc
+ variables are updated.
+
+ * insettabular.C (resetPos): set always the inset_y as it may be
+ needed in another function.
+ (searchBackward): don't draw while searching.
+
2002-01-04 Juergen Vigna <jug@sad.it>
* insettext.C (lockInsetInInset): forgot to set a cursor.
{
if (!the_locking_inset)
return 0;
-
return inset_y + the_locking_inset->insetInInsetY();
}
void InsetTabular::toggleInsetCursor(BufferView * bv)
{
+ if (nodraw()) {
+ if (isCursorVisible())
+ bv->hideLockedInsetCursor();
+ return;
+ }
if (the_locking_inset) {
the_locking_inset->toggleInsetCursor(bv);
return;
void InsetTabular::showInsetCursor(BufferView * bv, bool show)
{
+ if (nodraw())
+ return;
if (!isCursorVisible()) {
LyXFont font; // = GetFont(par, cursor.pos);
void InsetTabular::resetPos(BufferView * bv) const
{
- if (!locked || nodraw())
- return;
#warning This should be fixed in the right manner (20011128 Jug)
// fast hack to fix infinite repaintings!
if (in_reset_pos)
return;
- in_reset_pos = true;
-
- actcol = tabular->column_of_cell(actcell);
int cell = 0;
+ actcol = tabular->column_of_cell(actcell);
actrow = 0;
cursor_.y(0);
for (; (cell < actcell) && !tabular->IsLastRow(cell); ++cell) {
++actrow;
}
}
+ if (!locked || nodraw()) {
+ if (the_locking_inset)
+ inset_y = cursor_.y();
+ return;
+ }
+ // we need this only from here on!!!
+ in_reset_pos = true;
static int const offset = ADD_TO_TABULAR_WIDTH + 2;
int new_x = getCellXPos(actcell);
int old_x = cursor_.x();
string const
InsetTabular::selectNextWordToSpellcheck(BufferView * bv, float & value) const
{
+ nodraw(true);
if (the_locking_inset) {
string const str(the_locking_inset->selectNextWordToSpellcheck(bv, value));
- if (!str.empty())
+ if (!str.empty()) {
+ nodraw(false);
return str;
+ }
if (tabular->IsLastCell(actcell)) {
bv->unlockInset(const_cast<InsetTabular *>(this));
+ nodraw(false);
return string();
}
++actcell;
}
- nodraw(true);
// otherwise we have to lock the next inset and ask for it's selecttion
UpdatableInset * inset =
static_cast<UpdatableInset*>(tabular->GetCellInset(actcell));
bool InsetTabular::searchForward(BufferView * bv, string const & str,
bool const & cs, bool const & mw)
{
+ nodraw(true);
if (the_locking_inset) {
- if (the_locking_inset->searchForward(bv, str, cs, mw))
+ if (the_locking_inset->searchForward(bv, str, cs, mw)) {
+ nodraw(false);
+ updateLocal(bv, CELL, false);
return true;
+ }
if (tabular->IsLastCell(actcell)) {
+ nodraw(false);
bv->unlockInset(const_cast<InsetTabular *>(this));
return false;
}
UpdatableInset * inset =
static_cast<UpdatableInset*>(tabular->GetCellInset(actcell));
inset->edit(bv);
-#if 0
- bool const res = searchForward(bv, str, cs, mw);
- updateLocal(bv, NONE, false);
- bv->updateInset(const_cast<InsetTabular *>(this), false);
- return res;
-#else
- return searchForward(bv, str, cs, mw);
-#endif
+ bool const ret = searchForward(bv, str, cs, mw);
+ nodraw(false);
+ updateLocal(bv, CELL, false);
+ return ret;
}
bool InsetTabular::searchBackward(BufferView * bv, string const & str,
bool const & cs, bool const & mw)
{
+ nodraw(true);
if (the_locking_inset) {
- if (the_locking_inset->searchBackward(bv, str, cs, mw))
+ if (the_locking_inset->searchBackward(bv, str, cs, mw)) {
+ nodraw(false);
+ updateLocal(bv, CELL, false);
return true;
+ }
if (!actcell) { // we are already in the first cell
+ nodraw(false);
bv->unlockInset(const_cast<InsetTabular *>(this));
return false;
}
UpdatableInset * inset =
static_cast<UpdatableInset*>(tabular->GetCellInset(actcell));
inset->edit(bv, false);
-#if 0
- bool const res = searchBackward(bv, str, cs, mw);
- bv->updateInset(const_cast<InsetTabular *>(this), false);
- return res;
-#else
- return searchBackward(bv, str, cs, mw);
-#endif
+ bool const ret = searchBackward(bv, str, cs, mw);
+ nodraw(false);
+ updateLocal(bv, CELL, false);
+ return ret;
}
}
}
+ // call these methods so that insetWidth, insetAscent and
+ // insetDescent have the right values.
+ width(bv, f);
+ ascent(bv, f);
+ descent(bv, f);
+
// repaint the background if needed
if (cleared && backgroundColor() != LColor::background) {
top_x = int(x);
return;
}
- // call these methods so that insetWidth, insetAscent and
- // insetDescent have the right values.
- width(bv, f);
- ascent(bv, f);
- descent(bv, f);
-
top_baseline = baseline;
top_y = baseline - insetAscent;
frame_y = top_baseline - insetAscent + ttoD2;
frame_w = insetWidth - TEXT_TO_INSET_OFFSET;
frame_h = insetAscent + insetDescent - TEXT_TO_INSET_OFFSET;
- pain.rectangle(frame_x, frame_y,
- frame_w, frame_h,
+ pain.rectangle(frame_x, frame_y, frame_w, frame_h,
frame_color);
frame_is_visible = true;
}
void InsetText::clearInset(BufferView * bv, int baseline, bool & cleared) const
{
- LyXFont dummy;
Painter & pain = bv->painter();
int w = insetWidth;
- int h = ascent(bv, dummy) + descent(bv, dummy);
+ int h = insetAscent + insetDescent;
int ty = baseline - insetAscent;
if (ty < 0) {
textclasslist.Style(bview->buffer()->params.textclass,
par->getLayout());
pos_type i = pos;
-
+
if (layout.margintype == MARGIN_RIGHT_ADDRESS_BOX) {
/* special code for right address boxes, only newlines count */
while (i < par->size()) {
last_separator = i;
x = width; // this means break
} else if (c == Paragraph::META_INSET &&
- par->getInset(i)) {
+ par->getInset(i)) {
// check wether a Display() inset is
// valid here. if not, change it to
if (par->getInset(i)->display() &&
(layout.isCommand() ||
(layout.labeltype == LABEL_MANUAL
- && i < beginningOfMainBody(bview->buffer(), par)))) {
+ && i < beginningOfMainBody(bview->buffer(), par))))
+ {
// display istn't allowd
par->getInset(i)->display(false);
x += singleWidth(bview, par, i, c);
} else if (par->getInset(i)->display() ||
- par->getInset(i)->needFullRow()) {
+ par->getInset(i)->needFullRow())
+ {
// So break the line here
if (i == pos) {
if (pos < last-1) {
x = width; // this means break
} else {
x += singleWidth(bview, par, i, c);
+ // we have to check this separately as we could have a
+ // lineseparator and then the algorithm below would prefer
+ // that which IS wrong! We should always break on an inset
+ // if it's too long and not on the last separator.
+ // Maybe the only exeption is insets used as chars but
+ // then we would have to have a special function inside
+ // the inset to tell us this. Till then we leave it as
+ // it is now. (Jug 20020106)
+ if (pos < i && x >= width && last_separator >= 0)
+ last_separator = i - 1;
}
} else {
if (IsLineSeparatorChar(c))
x = left_margin;
}
}
+ if ((pos+1 < i) && (last_separator < 0) && (x >= width))
+ last_separator = i - 2;
+ else if ((pos < i) && (last_separator < 0) && (x >= width))
+ last_separator = i - 1;
// end of paragraph is always a suitable separator
- if (i == last && x < width)
+ else if (i == last && x < width)
last_separator = i;
}
if (main_body && last_separator < main_body)
last_separator = main_body - 1;
+ lyxerr << last_separator << ":" << pos << endl;
return last_separator;
}
// Is there a break one row above
if ((cursor.par()->isLineSeparator(cursor.pos())
|| cursor.par()->isNewline(cursor.pos())
+ || ((cursor.pos() < cursor.par()->size()) &&
+ cursor.par()->isInset(cursor.pos()+1))
|| cursor.row()->fill() == -1)
&& row->previous() && row->previous()->par() == row->par()) {
pos_type z = nextBreakPoint(bview,