]> git.lyx.org Git - features.git/commitdiff
Add list of branches.
authorAbdelrazak Younes <younes@lyx.org>
Fri, 30 May 2008 13:59:29 +0000 (13:59 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 30 May 2008 13:59:29 +0000 (13:59 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25011 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/qt_helpers.cpp
src/insets/InsetBranch.cpp
src/insets/InsetBranch.h

index f0ac0b0cb6a30187252d30ee2d9682a49fe9d7a9..fc9bf190e815b3bc00959513f2948390be0565de 100644 (file)
@@ -502,6 +502,8 @@ QString guiName(string const & type, BufferParams const & bp)
                return qt_("List of Citations");
        if (type == "label")
                return qt_("Labels and References");
+       if (type == "branch")
+               return qt_("List of Branches");
 
        FloatList const & floats = bp.documentClass().floats();
        if (floats.typeExist(type))
index c0be8352b1790459f7b9d0beeb0a418d24f2929a..948a8d638842a38ff2e92df34bed37bb9e9ab042 100644 (file)
@@ -25,6 +25,7 @@
 #include "Lexer.h"
 #include "OutputParams.h"
 #include "TextClass.h"
+#include "TocBackend.h"
 
 #include "support/debug.h"
 #include "support/gettext.h"
@@ -273,6 +274,17 @@ void InsetBranch::string2params(string const & in, InsetBranchParams & params)
 }
 
 
+void InsetBranch::addToToc(DocIterator const & cpit)
+{
+       DocIterator pit = cpit;
+       pit.push_back(CursorSlice(*this));
+
+       Toc & toc = buffer().tocBackend().toc("branch");
+       docstring const str = params_.branch + ": " + text_.getPar(0).asString();
+       toc.push_back(TocItem(pit, 0, str));
+}
+
+
 void InsetBranchParams::write(ostream & os) const
 {
        os << "Branch " << to_utf8(branch) << '\n';
index e9c7f6b6f5803f3ee0329ad6b82871779f42b69e..f51315ff93f77c4de2c89fc3992c479677069e47 100644 (file)
@@ -78,6 +78,8 @@ private:
        ///
        void validate(LaTeXFeatures &) const;
        ///
+       void addToToc(DocIterator const &);
+       ///
        InsetBranchParams const & params() const { return params_; }
        ///
        void setParams(InsetBranchParams const & params) { params_ = params; }