]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Fix screen display of parts and chapters in default classes
[lyx.git] / src / Buffer.cpp
index 940f30cd1cf4a10a46e9455bb733b026beff56c3..23f6315f5f63dc69cdc1878977dc6112883a3751 100644 (file)
@@ -1183,9 +1183,8 @@ bool Buffer::readString(string const & s)
 
 Buffer::ReadStatus Buffer::readFile(FileName const & fn)
 {
-       FileName fname(fn);
        Lexer lex;
-       if (!lex.setFile(fname)) {
+       if (!lex.setFile(fn)) {
                Alert::error(_("File Not Found"),
                        bformat(_("Unable to open file `%1$s'."),
                                from_utf8(fn.absFileName())));
@@ -2702,7 +2701,7 @@ bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag)
                break;
 
        case LFUN_BUFFER_EXPORT: {
-               docstring const arg = cmd.argument();
+               docstring const arg = cmd.argument();
                if (arg == "custom") {
                        enable = true;
                        break;
@@ -2731,7 +2730,7 @@ bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag)
                                     || cmd.action() == LFUN_BRANCH_MASTER_DEACTIVATE);
                BranchList const & branchList = master ? masterBuffer()->params().branchlist()
                        : params().branchlist();
-               docstring const branchName = cmd.argument();
+               docstring const branchName = cmd.argument();
                flag.setEnabled(!branchName.empty() && branchList.find(branchName));
                break;
        }
@@ -2893,7 +2892,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
                Buffer * buf = master ? const_cast<Buffer *>(masterBuffer())
                                      : this;
 
-               docstring const branch_name = func.argument();
+               docstring const branch_name = func.argument();
                // the case without a branch name is handled elsewhere
                if (branch_name.empty()) {
                        dispatched = false;
@@ -2921,7 +2920,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
        }
 
        case LFUN_BRANCH_ADD: {
-               docstring branchnames = func.argument();
+               docstring const & branchnames = func.argument();
                if (branchnames.empty()) {
                        dispatched = false;
                        break;
@@ -3526,19 +3525,19 @@ bool Buffer::hasChildren() const
 }
 
 
-void Buffer::collectChildren(ListOfBuffers & clist, bool grand_children) const
+void Buffer::collectChildren(ListOfBuffers & children, bool grand_children) const
 {
        // loop over children
        for (auto const & p : d->children_positions) {
                Buffer * child = const_cast<Buffer *>(p.first);
                // No duplicates
-               ListOfBuffers::const_iterator bit = find(clist.begin(), clist.end(), child);
-               if (bit != clist.end())
+               ListOfBuffers::const_iterator bit = find(children.begin(), children.end(), child);
+               if (bit != children.end())
                        continue;
-               clist.push_back(child);
+               children.push_back(child);
                if (grand_children)
                        // there might be grandchildren
-                       child->collectChildren(clist, true);
+                       child->collectChildren(children, true);
        }
 }
 
@@ -3727,7 +3726,6 @@ void Buffer::Impl::updateMacros(DocIterator & it, DocIterator & scope)
        while (it.pit() <= lastpit) {
                Paragraph & par = it.paragraph();
 
-               // FIXME Can this be done with the new-style iterators?
                // iterate over the insets of the current paragraph
                for (auto const & insit : par.insetList()) {
                        it.pos() = insit.pos;
@@ -5154,9 +5152,9 @@ void Buffer::Impl::setLabel(ParIterator & it, UpdateType utype) const
                }
 
                if (needEnumCounterReset(it)) {
-                       // Increase the master counter?
-                       if (layout.stepmastercounter)
-                               counters.stepMaster(enumcounter, utype);
+                       // Increase the parent counter?
+                       if (layout.stepparentcounter)
+                               counters.stepParent(enumcounter, utype);
                        // Maybe we have to reset the enumeration counter.
                        if (!layout.resumecounter)
                                counters.reset(enumcounter);