Add list of branches.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25011 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-05-30 13:59:29 +00:00
parent a43de95180
commit ebcc4db6de
3 changed files with 16 additions and 0 deletions

View 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))

View 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';

View 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; }