// bv_->text->owner(bv_);
if (lyxerr.debugging())
textcache.show(lyxerr, "resizeCurrentBuffer");
+
+ buffer_->resizeInsets(bv_);
} else {
bv_->text = new LyXText(bv_);
bv_->text->init(bv_);
}
-int BufferView::Pimpl::scroll(long time)
+void BufferView::Pimpl::scroll(int lines)
{
- if (!buffer_)
- return 0;
+ if (!buffer_) {
+ return;
+ }
LyXText const * t = bv_->text;
+ int const line_height = t->defaultHeight();
+
+ // The new absolute coordinate
+ int new_first_y = t->first_y + lines * line_height;
+
+ // Restrict to a valid value
+ new_first_y = std::min(t->height - 4 * line_height, new_first_y);
+ new_first_y = std::max(0, new_first_y);
- double const diff = t->defaultHeight()
- + double(time) * double(time) * 0.125;
+ scrollDocView(new_first_y);
- scrollDocView(int(diff));
+ // Update the scrollbar.
workarea().setScrollbarParams(t->height, t->first_y, t->defaultHeight());
- return 0;
}
return;
}
- /* FIXME */
- extern void reapSpellchecker(void);
- reapSpellchecker();
-
if (!bv_->theLockingInset()) {
screen().cursorToggle(bv_);
} else {
if (i > 0) {
ostringstream str;
str << _("Saved bookmark") << ' ' << i;
- owner_->message(str.str().c_str());
+ owner_->message(STRCONV(str.str()));
}
}
if (i > 0) {
ostringstream str;
str << _("Moved to bookmark") << ' ' << i;
- owner_->message(str.str().c_str());
+ owner_->message(STRCONV(str.str()));
}
}
ostringstream s1;
s1 << _("Inserting document") << ' '
<< disp_fn << " ...";
- owner_->message(s1.str().c_str());
+ owner_->message(STRCONV(s1.str()));
bool const res = bv_->insertLyXFile(filename);
if (res) {
ostringstream str;
str << _("Document") << ' ' << disp_fn
<< ' ' << _("inserted.");
- owner_->message(str.str().c_str());
+ owner_->message(STRCONV(str.str()));
} else {
ostringstream str;
str << _("Could not insert document") << ' '
<< disp_fn;
- owner_->message(str.str().c_str());
+ owner_->message(STRCONV(str.str()));
}
}
// e.g. Qt mouse press when no buffer
if (!buffer_)
return false;
-
+
LyXTextClass const & tclass = buffer_->params.getLyXTextClass();
switch (ev.action) {
InsetCitation * inset = new InsetCitation(p);
if (!insertInset(inset))
delete inset;
- else
+ else {
+ inset->setLoadingBuffer(bv_->buffer(), false);
updateInset(inset, true);
+ }
+
}
break;
{
InsetBibtex * inset =
static_cast<InsetBibtex*>(getInsetByCode(Inset::BIBTEX_CODE));
- if (inset)
+ if (inset)
inset->setOptions(ev.argument);
}
break;