#include <boost/bind.hpp>
#include <boost/signals/connection.hpp>
-#include "BoostFormat.h"
+#include "support/BoostFormat.h"
#include <unistd.h>
#include <sys/wait.h>
using std::min;
using lyx::pos_type;
+using namespace bv_funcs;
extern BufferList bufferlist;
// FIXME: needed when ?
bv_->text->top_y(screen().topCursorVisible(bv_->text->cursor, bv_->text->top_y()));
- // Similarly, buffer-dependent dialogs should be updated or
+ // Buffer-dependent dialogs should be updated or
// hidden. This should go here because some dialogs (eg ToC)
// require bv_->text.
owner_->getDialogs().updateBufferDependent(true);
owner_->updateLayoutChoice();
owner_->updateWindowTitle();
+ if (buffer_) {
+ // Don't forget to update the Layout
+ string const layoutname =
+ bv_->text->cursor.par()->layout()->name();
+ owner_->setLayout(layoutname);
+ }
+
if (grfx::Previews::activated() && buffer_)
grfx::Previews::get().generateBufferPreviews(*buffer_);
}
dispatch(FuncRequest(LFUN_PARAGRAPH_UPDATE));
- if (ret)
- updateScrollbar();
+ // We need to always update, in case we did a
+ // paste and we stayed anchored to a row, but
+ // the actual height of the doc changed ...
+ updateScrollbar();
return ret;
}
owner_->message(_("Formatting document..."));
if (bv_->text) {
- par = bv_->text->cursor.par();
+ par = &*bv_->text->cursor.par();
pos = bv_->text->cursor.pos();
- selstartpar = bv_->text->selection.start.par();
+ selstartpar = &*bv_->text->selection.start.par();
selstartpos = bv_->text->selection.start.pos();
- selendpar = bv_->text->selection.end.par();
+ selendpar = &*bv_->text->selection.end.par();
selendpos = bv_->text->selection.end.pos();
selection = bv_->text->selection.set();
mark_set = bv_->text->selection.mark();
switchKeyMap();
owner_->busy(false);
+ // reset the "Formatting..." message
+ owner_->clearMessage();
+
updateScrollbar();
return 0;
if (b != 0) buffer(b);
}
- Paragraph * par = buffer_->getParFromID(saved_positions[i].par_id);
+ Paragraph * par = &*buffer_->getParFromID(saved_positions[i].par_id);
if (!par)
return;
bool const res = dispatch(ev_in);
+ // FIXME: we should skip these when selecting
bv_->owner()->updateLayoutChoice();
+ bv_->owner()->updateToolbar();
bv_->fitCursor();
+ // slight hack: this is only called currently when
+ // we clicked somewhere, so we force through the display
+ // of the new status here.
+ bv_->owner()->clearMessage();
+
return res;
}
// a tabular-inset
break;
- case LFUN_LAYOUT_COPY:
- bv_->copyEnvironment();
- break;
-
- case LFUN_LAYOUT_PASTE:
- bv_->pasteEnvironment();
- switchKeyMap();
- break;
-
case LFUN_FILE_INSERT:
MenuInsertLyXFile(ev.argument);
break;
restorePosition(strToUnsignedInt(ev.argument));
break;
- case LFUN_REF_GOTO:
- {
+ case LFUN_REF_GOTO: {
string label = ev.argument;
if (label.empty()) {
InsetRef * inset =
}
}
- if (!label.empty()) {
- //bv_->savePosition(0);
- if (!bv_->gotoLabel(label))
- Alert::alert(_("Error"),
- _("Couldn't find this label"),
- _("in current document."));
- }
+ if (!label.empty())
+ bv_->gotoLabel(label);
}
break;
}
}
break;
-
+
case LFUN_FLOAT_LIST:
if (tclass.floats().typeExist(ev.argument)) {
Inset * inset = new InsetFloatList(ev.argument);
break;
case LFUN_LAYOUT_PARAGRAPH: {
- Paragraph const * par = bv_->getLyXText()->cursor.par();
+ Paragraph const * par = &*bv_->getLyXText()->cursor.par();
if (!par)
break;
}
case LFUN_PARAGRAPH_UPDATE: {
- Paragraph const * par = bv_->getLyXText()->cursor.par();
+ Paragraph const * par = &*bv_->getLyXText()->cursor.par();
if (!par)
break;