void InsetText::init(InsetText const * ins)
{
- top_y = last_width = last_height = 0;
- insetAscent = insetDescent = insetWidth = 0;
+ top_y = 0;
+ last_width = 0;
+ last_height = 0;
+ insetAscent = 0;
+ insetDescent = 0;
+ insetWidth = 0;
the_locking_inset = 0;
cursor_visible = false;
interline_space = 1;
no_selection = false;
need_update = INIT;
- drawTextXOffset = drawTextYOffset = 0;
+ drawTextXOffset = 0;
+ drawTextYOffset = 0;
autoBreakRows = false;
drawFrame = NEVER;
xpos = 0.0;
int InsetText::ascent(BufferView * bv, LyXFont const &) const
{
- long int y_temp = 0;
+ int y_temp = 0;
Row * row = TEXT(bv)->GetRowNearY(y_temp);
insetAscent = row->ascent_of_text() + TEXT_TO_INSET_OFFSET;
return insetAscent;
int InsetText::descent(BufferView * bv, LyXFont const &) const
{
- long int y_temp = 0;
+ int y_temp = 0;
Row * row = TEXT(bv)->GetRowNearY(y_temp);
insetDescent = TEXT(bv)->height - row->ascent_of_text() +
TEXT_TO_INSET_OFFSET;
if (!cleared && ((need_update==FULL) || (top_x!=int(x)) ||
(top_baseline!=baseline))) {
int w = insetWidth;
- int h = insetAscent + insetDescent;
+ unsigned int h = insetAscent + insetDescent;
int ty = baseline - insetAscent;
if (ty < 0) {
return;
}
x += TEXT_TO_INSET_OFFSET;
- long int y = 0;
+ int y = 0;
Row * row = TEXT(bv)->GetRowNearY(y);
y += baseline - row->ascent_of_text();
if (cleared || !locked || (need_update == FULL)) {
if (TEXT(bv)->status == LyXText::NEED_MORE_REFRESH)
need_update = FULL;
- long int y_temp = 0;
+ int y_temp = 0;
Row * row = TEXT(bv)->GetRowNearY(y_temp);
insetAscent = row->ascent_of_text() + TEXT_TO_INSET_OFFSET;
insetDescent = TEXT(bv)->height - row->ascent_of_text() +
}
-void InsetText::GetCursorPos(BufferView * bv, int & x, int & y) const
+void InsetText::GetCursorPos(BufferView * bv,
+ int & x, int & y) const
{
x = cx(bv);
y = cy(bv);
}
-int InsetText::InsetInInsetY()
+unsigned int InsetText::InsetInInsetY()
{
if (!the_locking_inset)
return 0;
bool InsetText::checkAndActivateInset(BufferView * bv, bool behind)
{
if (cpar(bv)->GetChar(cpos(bv)) == LyXParagraph::META_INSET) {
- int x, y;
+ unsigned int x;
+ unsigned int y;
Inset * inset =
static_cast<UpdatableInset*>(cpar(bv)->GetInset(cpos(bv)));
if (!inset || inset->Editable() != Inset::HIGHLY_EDITABLE)
return false;
- LyXFont font = TEXT(bv)->GetFont(bv->buffer(), cpar(bv), cpos(bv));
+ LyXFont const font =
+ TEXT(bv)->GetFont(bv->buffer(), cpar(bv), cpos(bv));
if (behind) {
x = inset->width(bv, font);
y = inset->descent(bv, font);
}
inset_x = cx(bv) - top_x + drawTextXOffset;
inset_y = cy(bv) + drawTextYOffset;
- inset->Edit(bv, x-inset_x, y-inset_y, 0);
+ inset->Edit(bv, x - inset_x, y - inset_y, 0);
if (!the_locking_inset)
return false;
UpdateLocal(bv, CURSOR_PAR, false);
bool InsetText::checkAndActivateInset(BufferView * bv, int x, int y,
int button)
{
- int tmp_x = x - drawTextXOffset;
- int tmp_y = y + insetAscent;
- Inset * inset = bv->checkInsetHit(TEXT(bv), tmp_x, tmp_y, button);
+ x = x - drawTextXOffset;
+ y = y + insetAscent;
+ Inset * inset = bv->checkInsetHit(TEXT(bv), x, y, button);
if (inset) {
if (x < 0)
#endif
-long InsetText::cx(BufferView * bv) const
+int InsetText::cx(BufferView * bv) const
{
return TEXT(bv)->cursor.x() + top_x + TEXT_TO_INSET_OFFSET;
}
-long InsetText::cy(BufferView * bv) const
+int InsetText::cy(BufferView * bv) const
{
LyXFont font;
return TEXT(bv)->cursor.y() - ascent(bv, font) + TEXT_TO_INSET_OFFSET;