mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18:50 +00:00
Rationalize lyxCode().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20990 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b5538c32aa
commit
13d7df639b
@ -103,6 +103,8 @@ static TranslatorMap const build_translator()
|
||||
InsetName("mathmacroarg", MATHMACROARG_CODE),
|
||||
InsetName("listings", LISTINGS_CODE),
|
||||
InsetName("info", INFO_CODE),
|
||||
InsetName("collapsable", COLLAPSABLE_CODE),
|
||||
InsetName("pagebreak", PAGEBREAK_CODE),
|
||||
};
|
||||
|
||||
std::size_t const insetnames_size =
|
||||
|
@ -123,13 +123,17 @@ enum InsetCode {
|
||||
LISTINGS_CODE,
|
||||
///
|
||||
INFO_CODE,
|
||||
///
|
||||
COLLAPSABLE_CODE, // 50
|
||||
};
|
||||
|
||||
/** returns the InsetCode corresponding to the \c name.
|
||||
* Eg, translate("branch") == BRANCH_CODE
|
||||
* implemented in 'Inset.cpp'.
|
||||
* Eg, insetCode("branch") == BRANCH_CODE
|
||||
* Implemented in 'Inset.cpp'.
|
||||
*/
|
||||
InsetCode insetCode(std::string const & name);
|
||||
/// the other way
|
||||
std::string insetName(InsetCode);
|
||||
|
||||
} // namespace lyx
|
||||
|
||||
|
@ -136,6 +136,8 @@ public:
|
||||
OutputParams const &) const;
|
||||
///
|
||||
void validate(LaTeXFeatures &) const;
|
||||
///
|
||||
virtual InsetCode lyxCode() const { return COLLAPSABLE_CODE; }
|
||||
|
||||
protected:
|
||||
///
|
||||
|
@ -60,12 +60,6 @@ docstring const InsetFloatList::getScreenLabel(Buffer const & buf) const
|
||||
}
|
||||
|
||||
|
||||
InsetCode InsetFloatList::lyxCode() const
|
||||
{
|
||||
return FLOAT_LIST_CODE;
|
||||
}
|
||||
|
||||
|
||||
void InsetFloatList::write(Buffer const &, ostream & os) const
|
||||
{
|
||||
os << "FloatList " << to_ascii(getParam("type")) << "\n";
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
///
|
||||
EDITABLE editable() const { return IS_EDITABLE; }
|
||||
///
|
||||
InsetCode lyxCode() const;
|
||||
InsetCode lyxCode() const { return FLOAT_LIST_CODE; }
|
||||
///
|
||||
DisplayType display() const { return AlignCenter; }
|
||||
///
|
||||
|
@ -50,12 +50,6 @@ int InsetIndex::docbook(Buffer const & buf, odocstream & os,
|
||||
}
|
||||
|
||||
|
||||
InsetCode InsetIndex::lyxCode() const
|
||||
{
|
||||
return INDEX_CODE;
|
||||
}
|
||||
|
||||
|
||||
Inset * InsetIndex::clone() const
|
||||
{
|
||||
return new InsetIndex(*this);
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
///
|
||||
EDITABLE editable() const { return IS_EDITABLE; }
|
||||
///
|
||||
InsetCode lyxCode() const;
|
||||
InsetCode lyxCode() const { return INDEX_CODE; }
|
||||
///
|
||||
///
|
||||
void metrics(MetricsInfo &, Dimension &) const;
|
||||
|
@ -70,12 +70,6 @@ void InsetNomencl::validate(LaTeXFeatures & features) const
|
||||
}
|
||||
|
||||
|
||||
InsetCode InsetNomencl::lyxCode() const
|
||||
{
|
||||
return NOMENCL_CODE;
|
||||
}
|
||||
|
||||
|
||||
InsetPrintNomencl::InsetPrintNomencl(InsetCommandParams const & p)
|
||||
: InsetCommand(p, string())
|
||||
{}
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
/// Updates needed features for this inset.
|
||||
void validate(LaTeXFeatures & features) const;
|
||||
///
|
||||
InsetCode lyxCode() const;
|
||||
InsetCode lyxCode() const { return NOMENCL_CODE; }
|
||||
///
|
||||
int docbook(Buffer const &, odocstream &,
|
||||
OutputParams const &) const;
|
||||
|
@ -385,10 +385,4 @@ Inset * InsetQuotes::clone() const
|
||||
}
|
||||
|
||||
|
||||
InsetCode InsetQuotes::lyxCode() const
|
||||
{
|
||||
return QUOTE_CODE;
|
||||
}
|
||||
|
||||
|
||||
} // namespace lyx
|
||||
|
@ -100,8 +100,8 @@ public:
|
||||
///
|
||||
void validate(LaTeXFeatures &) const;
|
||||
///
|
||||
InsetCode lyxCode() const;
|
||||
// should this inset be handled like a normal character
|
||||
InsetCode lyxCode() const { return QUOTE_CODE; }
|
||||
/// should this inset be handled like a normal character
|
||||
bool isChar() const { return true; }
|
||||
|
||||
private:
|
||||
|
@ -48,14 +48,6 @@ docstring const InsetTOC::getScreenLabel(Buffer const & buf) const
|
||||
}
|
||||
|
||||
|
||||
InsetCode InsetTOC::lyxCode() const
|
||||
{
|
||||
if (getCmdName() == "tableofcontents")
|
||||
return TOC_CODE;
|
||||
return NO_CODE;
|
||||
}
|
||||
|
||||
|
||||
int InsetTOC::plaintext(Buffer const & buffer, odocstream & os,
|
||||
OutputParams const &) const
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
///
|
||||
EDITABLE editable() const { return IS_EDITABLE; }
|
||||
///
|
||||
InsetCode lyxCode() const;
|
||||
InsetCode lyxCode() const { return TOC_CODE; }
|
||||
///
|
||||
DisplayType display() const { return AlignCenter; }
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user