}
-bool BufferView::Pimpl::fitCursor()
+bool BufferView::Pimpl::fitCursor(LyXText * text)
{
Assert(screen_); // it is a programming error to call fitCursor
// without a valid screen.
- bool ret = screen_->FitCursor(bv_->text);
- if (ret) updateScrollbar();
+ bool ret = screen_->FitCursor(text);
+ if (ret)
+ updateScrollbar();
return ret;
}
bv_->text->SetSelection();
screen_->ToggleToggle(bv_->text);
- fitCursor();
+ fitCursor(bv_->text);
screen_->ShowCursor(bv_->text);
}
return;
selection_possible = true;
screen_->HideCursor();
-#ifndef NEW_TABULAR
- // Right button mouse click on a table
- if (button == 3 &&
- (bv_->text->cursor.par()->table ||
- bv_->text->MouseHitInTable(bv_, xpos, ypos + bv_->text->first))) {
- // Set the cursor to the press-position
- bv_->text->SetCursorFromCoordinates(bv_, xpos, ypos + bv_->text->first);
- bool doit = true;
-
- // Only show the table popup if the hit is in
- // the table, too
- if (!bv_->text->HitInTable(bv_,
- bv_->text->cursor.row(), xpos))
- doit = false;
-
- // Hit above or below the table?
- if (doit) {
- if (!bv_->text->selection) {
- screen_->ToggleSelection(bv_->text);
- bv_->text->ClearSelection();
- bv_->text->FullRebreak(bv_);
- screen_->Update(bv_->text);
- updateScrollbar();
- }
- // Popup table popup when on a table.
- // This is obviously temporary, since we
- // should be able to popup various
- // context-sensitive-menus with the
- // the right mouse. So this should be done more
- // general in the future. Matthias.
- selection_possible = false;
- owner_->getLyXFunc()
- ->Dispatch(LFUN_LAYOUT_TABLE,
- "true");
- return;
- }
- }
-#endif
-
- int screen_first = bv_->text->first;
+ int const screen_first = bv_->text->first;
// Middle button press pastes if we have a selection
bool paste_internally = false;
bv_->text->cursor.x_fix(bv_->text->cursor.x());
owner_->updateLayoutChoice();
- if (fitCursor()) {
+ if (fitCursor(bv_->text)) {
selection_possible = false;
}
* if necessary */
update(BufferView::SELECT|BufferView::FITCUR);
}
- }
+ }
}
}
selection_possible = false;
-#ifndef NEW_TABULAR
- if (bv_->text->cursor.par()->table) {
- int cell = bv_->text->
- NumberOfCell(bv_->text->cursor.par(),
- bv_->text->cursor.pos());
- if (bv_->text->cursor.par()->table->IsContRow(cell) &&
- bv_->text->cursor.par()->table->
- CellHasContRow(bv_->text->cursor.par()->table->
- GetCellAbove(cell))<0) {
- bv_->text->CursorUp(bv_);
- }
- }
-#endif
if (button >= 2) return;
// fitCursor() ensures we don't jump back
// to the start of the document on vertical
// resize
- fitCursor();
+ fitCursor(bv_->text);
// The main window size has changed, repaint most stuff
redraw();
update();
if ((f & FITCUR)) {
- fitCursor();
+ fitCursor(bv_->text);
}
if ((f & CHANGE)) {
{
if (!bv_->text->cursor.row()->previous()) return;
- long y = bv_->text->first;
+ int y = bv_->text->first;
Row * cursorrow = bv_->text->cursor.row();
bv_->text->SetCursorFromCoordinates(bv_, bv_->text->cursor.x_fix(), y);
bv_->text->FinishUndo();
{
if (!bv_->text->cursor.row()->next()) return;
- long y = bv_->text->first;
+ int y = bv_->text->first;
bv_->text->GetRowNearY(y);
Row * cursorrow = bv_->text->cursor.row();
bv_->text->SetCursorFromCoordinates(bv_, bv_->text->cursor.x_fix(), y