mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
Get rid of the global use_babel variable.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7026 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
f5b4f841c6
commit
5d429a45a3
@ -1,3 +1,8 @@
|
||||
2003-05-23 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* LaTeXFeatures.[Ch] (useBabel): new method.
|
||||
* bufferparams.C (writeLaTeX): use it.
|
||||
|
||||
2003-05-23 Lars Gullik Bjønnes <larsbj@gullik.net>
|
||||
|
||||
* ParagraphList.h (set): remove unused function.
|
||||
|
@ -38,6 +38,14 @@ LaTeXFeatures::LaTeXFeatures(BufferParams const & p)
|
||||
{}
|
||||
|
||||
|
||||
bool LaTeXFeatures::useBabel() const
|
||||
{
|
||||
return lyxrc.language_use_babel ||
|
||||
bufferParams().language->lang() != lyxrc.default_language ||
|
||||
this->hasLanguages();
|
||||
}
|
||||
|
||||
|
||||
void LaTeXFeatures::require(string const & name)
|
||||
{
|
||||
if (isRequired(name))
|
||||
|
@ -78,7 +78,8 @@ public:
|
||||
void useLayout(string const & lyt);
|
||||
///
|
||||
BufferParams const & bufferParams() const;
|
||||
///
|
||||
/// the return value is dependent upon both LyXRC and LaTeXFeatures.
|
||||
bool useBabel() const;
|
||||
|
||||
private:
|
||||
string externalPreambles;
|
||||
|
@ -38,11 +38,6 @@ using std::ostream;
|
||||
using std::endl;
|
||||
using std::pair;
|
||||
|
||||
#ifdef WITH_WARNINGS
|
||||
#warning Do we need this horrible thing? (JMarc)
|
||||
#endif
|
||||
bool use_babel;
|
||||
|
||||
|
||||
BufferParams::BufferParams()
|
||||
// Initialize textclass to point to article. if `first' is
|
||||
@ -524,17 +519,14 @@ bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
|
||||
clsoptions << "landscape,";
|
||||
|
||||
// language should be a parameter to \documentclass
|
||||
use_babel = false;
|
||||
ostringstream language_options;
|
||||
if (language->babel() == "hebrew"
|
||||
&& default_language->babel() != "hebrew")
|
||||
// This seems necessary
|
||||
features.useLanguage(default_language);
|
||||
|
||||
if (lyxrc.language_use_babel ||
|
||||
language->lang() != lyxrc.default_language ||
|
||||
features.hasLanguages()) {
|
||||
use_babel = true;
|
||||
ostringstream language_options;
|
||||
bool const use_babel = features.useBabel();
|
||||
if (use_babel) {
|
||||
language_options << features.getLanguages();
|
||||
language_options << language->babel();
|
||||
if (lyxrc.language_global_options)
|
||||
|
@ -1,3 +1,7 @@
|
||||
2003-05-23 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* insetquotes (validate): use the new LaTeXFeatures::useBabel() method.
|
||||
|
||||
2003-05-23 Angus Leeming <leeming@lyx.org>
|
||||
|
||||
* insetfoot.C (latex):
|
||||
|
@ -322,10 +322,9 @@ int InsetQuotes::docbook(Buffer const *, ostream & os, bool) const
|
||||
}
|
||||
|
||||
|
||||
extern bool use_babel;
|
||||
|
||||
void InsetQuotes::validate(LaTeXFeatures & features) const
|
||||
{
|
||||
bool const use_babel = features.useBabel();
|
||||
char type = quote_char[quote_index[side_][language_]];
|
||||
|
||||
#ifdef DO_USE_DEFAULT_LANGUAGE
|
||||
|
Loading…
Reference in New Issue
Block a user