#include "TocModel.h"
#include "Buffer.h"
+#include "BufferView.h"
#include "CutAndPaste.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
-#include "LyXFunc.h"
+#include "LyX.h"
#include "Menus.h"
#include "TocBackend.h"
TocItem const & item =
gui_view_.tocModels().currentItem(current_type_, index);
+ // Start an undo group.
+ cur.beginUndoGroup();
+
switch (cmd.action)
{
case LFUN_CHANGE_ACCEPT:
if (inset)
inset->dispatch(cur, tmpcmd);
}
+ cur.endUndoGroup();
}
void TocWidget::updateView()
{
- if (!gui_view_.currentBufferView()) {
+ if (!gui_view_.documentBufferView()) {
enableControls(false);
typeCO->setEnabled(false);
tocTV->setModel(0);
persistentCB->setEnabled(can_navigate_);
bool controls_enabled = toc_model && toc_model->rowCount() > 0
- && !gui_view_.buffer()->isReadonly();
+ && !gui_view_.documentBufferView()->buffer().isReadonly();
enableControls(controls_enabled);
depthSL->setMaximum(gui_view_.tocModels().depth(current_type_));