]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBranch.h
Fix bug #10901.
[lyx.git] / src / insets / InsetBranch.h
index e005bce24594384cc1737a4fb2b6377097a02630..391f2475f06765971a9d4d69afb324b5bef05943 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef INSETBRANCH_H
 #define INSETBRANCH_H
 
-#include "InsetCollapsable.h"
+#include "InsetCollapsible.h"
 
 namespace lyx {
 
@@ -20,13 +20,17 @@ class InsetBranchParams {
 public:
        ///
        explicit InsetBranchParams(docstring const & b = docstring())
-               : branch(b) {}
+               : branch(b), inverted(false) {}
+       InsetBranchParams(docstring const & b, bool i)
+               : branch(b), inverted(i) {}
        ///
        void write(std::ostream & os) const;
        ///
        void read(Lexer & lex);
        ///
        docstring branch;
+       ///
+       bool inverted;
 };
 
 
@@ -38,7 +42,7 @@ public:
 
 /// The Branch inset for alternative, conditional output.
 
-class InsetBranch : public InsetCollapsable
+class InsetBranch : public InsetCollapsible
 {
 public:
        ///
@@ -52,6 +56,8 @@ public:
        docstring branch() const { return params_.branch; }
        ///
        void rename(docstring const & newname) { params_.branch = newname; }
+       ///
+       InsetBranchParams const & params() const { return params_; }
 
 private:
        ///
@@ -61,7 +67,7 @@ private:
        ///
        void read(Lexer & lex);
        ///
-       docstring const buttonLabel(BufferView const & bv) const;
+       docstring const buttonLabel(BufferView const &) const;
        ///
        ColorCode backgroundColor(PainterInfo const &) const;
        ///
@@ -82,10 +88,7 @@ private:
        ///
        std::string contextMenuName() const;
        ///
-       void addToToc(DocIterator const & di, bool output_active,
-                                 UpdateType utype) const;
-       ///
-       InsetBranchParams const & params() const { return params_; }
+       void updateBuffer(ParIterator const & it, UpdateType utype);
        ///
        void setParams(InsetBranchParams const & params) { params_ = params; }
 
@@ -96,10 +99,10 @@ private:
        /*!
         * Is the content of this inset part of the output document?
         *
-        * Note that Branch insets are only considered part of the
-        * document when they are selected.
+        * Note that Branch insets are considered part of the
+        * document when they are selected XOR inverted.
         */
-       bool producesOutput() const { return isBranchSelected(); }
+       bool producesOutput() const;
        ///
        bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
        ///