mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Fix oddity in bibtotoc handling.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23339 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
5e853c1803
commit
cef5f40f47
@ -1151,6 +1151,17 @@ DocumentClass::DocumentClass(TextClass const & tc)
|
||||
{}
|
||||
|
||||
|
||||
bool DocumentClass::hasLaTeXLayout(std::string const & lay) const
|
||||
{
|
||||
LayoutList::const_iterator it = layoutlist_.begin();
|
||||
LayoutList::const_iterator end = layoutlist_.end();
|
||||
for (; it != end; ++it)
|
||||
if (it->get()->latexname() == lay)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
ostream & operator<<(ostream & os, PageSides p)
|
||||
{
|
||||
switch (p) {
|
||||
|
@ -205,6 +205,9 @@ public:
|
||||
bool hasTocLevels() const;
|
||||
///
|
||||
static InsetLayout const & emptyInsetLayout() { return empty_insetlayout_; }
|
||||
protected:
|
||||
/// Paragraph styles used in this layout
|
||||
LayoutList layoutlist_;
|
||||
private:
|
||||
///
|
||||
bool deleteLayout(docstring const &);
|
||||
@ -265,10 +268,6 @@ private:
|
||||
TitleLatexType titletype_;
|
||||
/// The name of the title command
|
||||
std::string titlename_;
|
||||
|
||||
/// Paragraph styles used in this layout
|
||||
LayoutList layoutlist_;
|
||||
|
||||
/// Input layouts available to this layout
|
||||
mutable InsetLayouts insetlayoutlist_;
|
||||
|
||||
@ -299,6 +298,8 @@ private:
|
||||
/// These TextClasses represent the layout information that is
|
||||
/// associated with a given buffer.
|
||||
class DocumentClass : public TextClass {
|
||||
public:
|
||||
bool hasLaTeXLayout(std::string const & lay) const;
|
||||
private:
|
||||
/// Constructs a DocumentClass based upon a TextClass.
|
||||
DocumentClass(TextClass const & tc);
|
||||
|
@ -306,11 +306,7 @@ int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
|
||||
|
||||
// bibtotoc-Option
|
||||
if (!bibtotoc.empty() && !buffer().params().use_bibtopic) {
|
||||
// maybe a problem when a textclass has no "art" as
|
||||
// part of its name, because it's than book.
|
||||
// For the "official" lyx-layouts it's no problem to support
|
||||
// all well
|
||||
if (!contains(buffer().params().documentClass().name(), "art")) {
|
||||
if (buffer().params().documentClass().hasLaTeXLayout("chapter")) {
|
||||
if (buffer().params().sides == OneSide) {
|
||||
// oneside
|
||||
os << "\\clearpage";
|
||||
@ -318,14 +314,9 @@ int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
|
||||
// twoside
|
||||
os << "\\cleardoublepage";
|
||||
}
|
||||
|
||||
// bookclass
|
||||
os << "\\addcontentsline{toc}{chapter}{\\bibname}";
|
||||
|
||||
} else {
|
||||
// article class
|
||||
} else if (buffer().params().documentClass().hasLaTeXLayout("section"))
|
||||
os << "\\addcontentsline{toc}{section}{\\refname}";
|
||||
}
|
||||
}
|
||||
|
||||
if (!db_out.empty() && !buffer().params().use_bibtopic) {
|
||||
|
Loading…
Reference in New Issue
Block a user