From 64e77d6c145b5d2b9a12feb7b1a0176a7b08bfe1 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 1 Nov 2010 20:57:10 +0000 Subject: [PATCH] Fix bug #6888. This is why it was worth doing the updateBuffer() rewrite. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35975 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 19 +++++++++++++------ src/insets/InsetCommand.cpp | 1 + 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index eb689ce56b..92da2edbce 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1216,17 +1216,23 @@ void GuiView::setCurrentWorkArea(GuiWorkArea * wa) theGuiApp()->setCurrentView(this); d.current_work_area_ = wa; + + // We need to reset this now, because it will need to be + // right if the tabWorkArea gets reset in the for loop. We + // will change it back if we aren't in that case. + GuiWorkArea * const old_cmwa = d.current_main_work_area_; + d.current_main_work_area_ = wa; + for (int i = 0; i != d.splitter_->count(); ++i) { if (d.tabWorkArea(i)->setCurrentWorkArea(wa)) { - //if (d.current_main_work_area_) - // d.current_main_work_area_->setFrameStyle(QFrame::NoFrame); - d.current_main_work_area_ = wa; - //d.current_main_work_area_->setFrameStyle(QFrame::Box | QFrame::Plain); - //d.current_main_work_area_->setLineWidth(2); - LYXERR(Debug::DEBUG, "Current wa: " << currentWorkArea() << ", Current main wa: " << currentMainWorkArea()); + LYXERR(Debug::DEBUG, "Current wa: " << currentWorkArea() + << ", Current main wa: " << currentMainWorkArea()); return; } } + + d.current_main_work_area_ = old_cmwa; + LYXERR(Debug::DEBUG, "This is not a tabbed wa"); on_currentWorkAreaChanged(wa); BufferView & bv = wa->bufferView(); @@ -1394,6 +1400,7 @@ void GuiView::updateTocItem(string const & type, DocIterator const & dit) void GuiView::structureChanged() { d.toc_models_.reset(documentBufferView()); + LYXERR0(documentBufferView()); // Navigator needs more than a simple update in this case. It needs to be // rebuilt. updateDialog("toc", ""); diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index 08a932d277..9d9408fed5 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -147,6 +147,7 @@ void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd) case LFUN_INSET_MODIFY: { if (cmd.getArg(0) == "changetype") { p_.setCmdName(cmd.getArg(1)); + cur.forceBufferUpdate(); initView(); break; } -- 2.39.2