]> git.lyx.org Git - features.git/commitdiff
update bufferview after document settings have been applied (bug 2023)
authorJürgen Spitzmüller <spitz@lyx.org>
Thu, 15 Sep 2005 14:56:28 +0000 (14:56 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Thu, 15 Sep 2005 14:56:28 +0000 (14:56 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10447 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlDocument.C

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