From c8babc2cbf3b2a7a9570075cf230963b9fcf56bd Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 19 Apr 2005 08:56:15 +0000 Subject: [PATCH] update counters if secnumdepth has changed git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9829 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/controllers/ChangeLog | 7 ++++++- src/frontends/controllers/ControlDocument.C | 12 +++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index 65418b43dd..d1958482b2 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,8 +1,13 @@ +2005-04-11 Jean-Marc Lasgouttes + + * ControlDocument.C (dispatchParams): update the counters if + necessary. + 2005-04-13 Georg Baum * Dialog.[Ch] (checkStatus): new -2005-03-27 MArtin Vermeer +2005-03-27 Martin Vermeer * ControlDocument.C (dispatch_bufferparams): fix bug 1843 diff --git a/src/frontends/controllers/ControlDocument.C b/src/frontends/controllers/ControlDocument.C index 50f0d8bdc9..245ff5355a 100644 --- a/src/frontends/controllers/ControlDocument.C +++ b/src/frontends/controllers/ControlDocument.C @@ -16,6 +16,8 @@ #include "BranchList.h" #include "buffer.h" #include "bufferparams.h" +#include "BufferView.h" +#include "buffer_funcs.h" #include "funcrequest.h" #include "language.h" #include "LColor.h" @@ -89,15 +91,23 @@ void ControlDocument::dispatchParams() textclass_type const old_class = kernel().buffer().params().textclass; textclass_type const new_class = bp_->textclass; - if (new_class != old_class) { string const name = textclasslist[new_class].name(); kernel().dispatch(FuncRequest(LFUN_TEXTCLASS_APPLY, name)); } + int const old_secnumdepth = kernel().buffer().params().secnumdepth; + int const new_secnumdepth = bp_->secnumdepth; + // Apply the BufferParams. dispatch_bufferparams(kernel(), params(), LFUN_BUFFERPARAMS_APPLY); + // redo the numbering if necessary + 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()) -- 2.39.2