/// clear the "Formatting Document" message
owner_->message("");
-
- /// get rid of the splash screen if it's not gone already
- owner_->getDialogs()->destroySplash();
-
+
return 0;
}
void BufferView::Pimpl::tripleClick(int /*x*/, int /*y*/, unsigned int button)
{
// select a line
- if (buffer_)
+ if (!buffer_)
return;
LyXText * text = bv_->getLyXText();
return;
}
+#ifdef WITH_WARNINGS
+#warning variable c is set but never used. What is it good for?? (JMarc)
+#endif
// check whether we want to open a float
if (bv_->text) {
bool hit = false;
(cursor.par()->getInset(cursor.pos() - 1)->editable())) {
Inset * tmpinset = cursor.par()->getInset(cursor.pos()-1);
LyXFont font = text->getFont(buffer_, cursor.par(),
- cursor.pos()-1);
+ cursor.pos() - 1);
int const width = tmpinset->width(bv_, font);
int const inset_x = font.isVisibleRightToLeft()
? cursor.x() : cursor.x() - width;
bv_->text->status(bv_, st);
screen_->update(bv_->text, bv_);
}
+ // do this here instead of in the screen::update because of
+ // the above loop!
+ bv_->text->status(bv_, LyXText::UNCHANGED);
if (fitc)
fitCursor();
}
if (text->inset_owner) {
text->inset_owner->setUpdateStatus(bv_, InsetText::NONE);
- updateInset(text->inset_owner, true);
+ updateInset(text->inset_owner, false);
} else {
update();
}
return;
LyXText * text = bv_->getLyXText();
- if (text->real_current_font.isRightToLeft()
-#ifndef NO_LATEX
- &&
- text->real_current_font.latex() != LyXFont::ON
-#endif
- ) {
+ if (text->real_current_font.isRightToLeft()) {
if (owner_->getIntl()->keymap == Intl::PRIMARY)
owner_->getIntl()->KeyMapSec();
} else {
owner_->getDialogs()->setUserFreeFont();
break;
-#ifndef NO_LATEX
- case LFUN_TEX:
- Tex(bv_);
- setState();
- owner_->showState();
- break;
-#endif
-
case LFUN_FILE_INSERT:
{
MenuInsertLyXFile(argument);
// just comment out the line below...
showCursor();
} else {
- bv_->cut();
+ bv_->cut(false);
}
moveCursorUpdate(false);
owner_->showState();
cursor.par()->params().pagebreakBottom(),
VSpace(VSpace::NONE),
cursor.par()->params().spaceBottom(),
+ cursor.par()->params().spacing(),
cursor.par()->params().align(),
cursor.par()->params().labelWidthString(), 0);
lt->cursorLeft(bv_);
| BufferView::CHANGE);
}
} else {
- bv_->cut();
+ bv_->cut(false);
}
}
break;
showCursor();
}
} else {
- bv_->cut();
+ bv_->cut(false);
}
owner_->showState();
setState();
cursor.par()->params().pagebreakTop(),
cursor.par()->params().pagebreakBottom(),
VSpace(VSpace::NONE), cursor.par()->params().spaceBottom(),
+ cursor.par()->params().spacing(),
cursor.par()->params().align(),
cursor.par()->params().labelWidthString(), 0);
update(lt,
| BufferView::CHANGE);
}
} else
- bv_->cut();
+ bv_->cut(false);
}
break;
cursor.par()->params().pagebreakTop(),
cursor.par()->params().pagebreakBottom(),
VSpace(VSpace::DEFSKIP), cursor.par()->params().spaceBottom(),
+ cursor.par()->params().spacing(),
cursor.par()->params().align(),
cursor.par()->params().labelWidthString(), 1);
//update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
if (floatList.typeExist(argument)) {
insertAndEditInset(new InsetFloat(argument));
} else {
- lyxerr << "Non-existant float type: "
+ lyxerr << "Non-existent float type: "
<< argument << endl;
}
break;
else
delete new_inset;
} else {
- lyxerr << "Non-existant float type: "
+ lyxerr << "Non-existent float type: "
<< argument << endl;
}
}
break;
- case LFUN_GETLATEX:
- {
-#ifndef NO_LATEX
- LyXFont & font = bv_->getLyXText()->current_font;
- if (font.latex() == LyXFont::ON)
- owner_->getLyXFunc()->setMessage("L");
- else
-#endif
- owner_->getLyXFunc()->setMessage("0");
- }
- break;
-
// --- accented characters ---------------------------
case LFUN_UMLAUT:
// The argument can be up to two tokens separated
// by a space. The first one is the bibstyle.
string const db = token(argument, ' ', 0);
- string bibstyle = token(argument, ' ', 1);
- if (bibstyle.empty())
- bibstyle = "plain";
+ string const bibstyle = token(argument, ' ', 1);
InsetCommandParams p( "BibTeX", db, bibstyle );
InsetBibtex * inset = new InsetBibtex(p);
InsetCommandParams p("index");
if (argument.empty()) {
string const idxstring(bv_->getLyXText()->getStringToIndex(bv_));
- if (!idxstring.empty()) {
- p.setContents(idxstring);
- } else {
- break;
- }
+ p.setContents(idxstring);
} else {
p.setContents(argument);
}
string arg = argument;
if (arg.empty()) {
- arg = bv_->getLyXText()->selectionAsString(buffer_);
+ arg = bv_->getLyXText()->selectionAsString(buffer_,
+ false);
// FIXME
if (arg.size() > 100 || arg.empty()) {
// Get word or selection
bv_->getLyXText()->selectWordWhenUnderCursor(bv_, LyXText::WHOLE_WORD);
- arg = bv_->getLyXText()->selectionAsString(buffer_);
+ arg = bv_->getLyXText()->selectionAsString(buffer_, false);
// FIXME: where is getLyXText()->unselect(bv_) ?
}
}
if (lyxrc.auto_region_delete) {
if (lt->selection.set()) {
- lt->cutSelection(bv_, false);
+ lt->cutSelection(bv_, false, false);
bv_->update(lt,
BufferView::SELECT
| BufferView::FITCUR
InsetSpecialChar * new_inset =
new InsetSpecialChar(kind);
insertInset(new_inset);
+ // Ok, what happens here if we are unable to insert
+ // the inset? Leak it?
}
}
c = ' ';
hideCursor();
- if (!insertInset(new InsetQuotes(c, bv_->buffer()->params)))
+
+ LyXLayout const & style = textclasslist.Style(
+ bv_->buffer()->params.textclass,
+ lt->cursor.par()->getLayout());
+
+ if (style.pass_thru ||
+ (!insertInset(new InsetQuotes(c, bv_->buffer()->params))))
Dispatch(LFUN_SELFINSERT, "\"");
}
bv_->text->setParagraph(bv_, 0, 0,
0, 0,
VSpace(VSpace::NONE), VSpace(VSpace::NONE),
+ Spacing(),
LYX_ALIGN_LAYOUT,
string(),
0);
update(bv_->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
-#ifndef NO_LATEX
- bv_->text->current_font.setLatex(LyXFont::OFF);
-#endif
}
bv_->text->insertInset(bv_, inset);