update bufferview after document settings have been applied (bug 2023)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10447 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2005-09-15 14:56:28 +00:00
parent e164c26ad2
commit f61e2b3ad9
2 changed files with 27 additions and 21 deletions

View File

@ -1,3 +1,8 @@
2005-09-15 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* ControlDocument.C (dispatchParams): update bufferview at the end
(fixes bug 2023).
2005-09-08 Angus Leeming <leeming@lyx.org> 2005-09-08 Angus Leeming <leeming@lyx.org>
* ControlSpellchecker.C: correct grammar describing invocation of the * ControlSpellchecker.C: correct grammar describing invocation of the

View File

@ -103,32 +103,33 @@ void ControlDocument::dispatchParams()
dispatch_bufferparams(kernel(), params(), LFUN_BUFFERPARAMS_APPLY); dispatch_bufferparams(kernel(), params(), LFUN_BUFFERPARAMS_APPLY);
// redo the numbering if necessary // redo the numbering if necessary
if (new_secnumdepth != old_secnumdepth) { if (new_secnumdepth != old_secnumdepth)
updateCounters(kernel().buffer()); updateCounters(kernel().buffer());
kernel().bufferview()->update();
}
// Generate the colours requested by each new branch. // Generate the colours requested by each new branch.
BranchList & branchlist = params().branchlist(); BranchList & branchlist = params().branchlist();
if (branchlist.empty()) if (!branchlist.empty()) {
return; BranchList::const_iterator it = branchlist.begin();
BranchList::const_iterator const end = branchlist.end();
BranchList::const_iterator it = branchlist.begin(); for (; it != end; ++it) {
BranchList::const_iterator const end = branchlist.end(); string const & current_branch = it->getBranch();
for (; it != end; ++it) { Branch const * branch = branchlist.find(current_branch);
string const & current_branch = it->getBranch(); string x11hexname = branch->getColor();
Branch const * branch = branchlist.find(current_branch); // check that we have a valid color!
string x11hexname = branch->getColor(); if (x11hexname.empty() || x11hexname[0] != '#')
// check that we have a valid color! x11hexname =
if (x11hexname.empty() || x11hexname[0] != '#') lcolor.getX11Name(LColor::background);
x11hexname = lcolor.getX11Name(LColor::background); // display the new color
// display the new color string const str = current_branch + ' ' + x11hexname;
string const str = current_branch + ' ' + x11hexname; kernel().dispatch(FuncRequest(LFUN_SET_COLOR, str));
kernel().dispatch(FuncRequest(LFUN_SET_COLOR, str)); }
// Open insets of selected branches, close deselected ones
kernel().dispatch(FuncRequest(LFUN_ALL_INSETS_TOGGLE,
"assign branch"));
} }
// update the bufferview
// Open insets of selected branches, close deselected ones kernel().bufferview()->update();
kernel().dispatch(FuncRequest(LFUN_ALL_INSETS_TOGGLE, "assign branch"));
} }