-#ifndef NEW_INSETS
- // check whether we want to open a float
- if (bv_->text) {
- bool hit = false;
- char c = ' ';
- if (bv_->text->cursor.pos() <
- bv_->text->cursor.par()->Last()) {
- c = bv_->text->cursor.par()->
- GetChar(bv_->text->cursor.pos());
- }
- if(!bv_->text->selection)
- if (c == LyXParagraph::META_FOOTNOTE
- || c == LyXParagraph::META_MARGIN
- || c == LyXParagraph::META_FIG
- || c == LyXParagraph::META_TAB
- || c == LyXParagraph::META_WIDE_FIG
- || c == LyXParagraph::META_WIDE_TAB
- || c == LyXParagraph::META_ALGORITHM){
- hit = true;
- } else
- if (bv_->text->cursor.pos() - 1 >= 0) {
- c = bv_->text->cursor.par()->
- GetChar(bv_->text->cursor.pos() - 1);
- if (c == LyXParagraph::META_FOOTNOTE
- || c == LyXParagraph::META_MARGIN
- || c == LyXParagraph::META_FIG
- || c == LyXParagraph::META_TAB
- || c == LyXParagraph::META_WIDE_FIG
- || c == LyXParagraph::META_WIDE_TAB
- || c == LyXParagraph::META_ALGORITHM){
- // We are one step too far to the right
- bv_->text->CursorLeft(bv_);
- hit = true;
- }
- }
- if (hit == true) {
- bv_->toggleFloat();
- selection_possible = false;
- return;
- }
- }
- // Do we want to close a float? (click on the float-label)
- if (bv_->text->cursor.row()->par()->footnoteflag ==
- LyXParagraph::OPEN_FOOTNOTE
- && bv_->text->cursor.row()->previous() &&
- bv_->text->cursor.row()->previous()->par()->
- footnoteflag != LyXParagraph::OPEN_FOOTNOTE){
- LyXFont font(LyXFont::ALL_SANE);
- font.setSize(LyXFont::SIZE_FOOTNOTE);
-
- int box_x = 20; // LYX_PAPER_MARGIN;
- box_x += lyxfont::width(" wide-tab ", font);
-
- unsigned int screen_first = bv_->text->first;
-
- if (x < box_x
- && y + screen_first > bv_->text->cursor.y() -
- bv_->text->cursor.row()->baseline()
- && y + screen_first < bv_->text->cursor.y() -
- bv_->text->cursor.row()->baseline()
- + lyxfont::maxAscent(font) * 1.2 + lyxfont::maxDescent(font) * 1.2) {
- bv_->toggleFloat();
- selection_possible = false;
- return;
- }
- }
-#else