/// name of the file the buffer is associated with.
FileName filename;
- Messages * messages;
-
/** Set to true only when the file is fully loaded.
* Used to prevent the premature generation of previews
* and by the citation inset.
Buffer::Impl::Impl(Buffer & parent, FileName const & file, bool readonly_)
: lyx_clean(true), bak_clean(true), unnamed(false), read_only(readonly_),
- filename(file), messages(0), file_fully_loaded(false), inset(params),
+ filename(file), file_fully_loaded(false), inset(params),
toc_backend(&parent)
{
inset.setAutoBreakRows(true);
break;
}
- // After we have read a file, we must ensure that the buffer
- // language is set and used in the gui.
- // If you know of a better place to put this, please tell me. (Lgb)
- updateDocLang(params().language);
-
return true;
}
if (readFile(lex, filename) != success)
return false;
- // After we have read a file, we must ensure that the buffer
- // language is set and used in the gui.
- // If you know of a better place to put this, please tell me. (Lgb)
- updateDocLang(params().language);
-
return true;
}
busy(true);
// get LaTeX-Filename
- string const path = temppath();
- string const name = addName(path, getLatexName());
+ FileName const path(temppath());
+ string const name = addName(path.absFilename(), getLatexName());
string const org_path = filePath();
support::Path p(path); // path to LaTeX file
// AMS Style is at document level
if (params().use_amsmath == BufferParams::package_on
- || tclass.provides(LyXTextClass::amsmath))
+ || tclass.provides("amsmath"))
features.require("amsmath");
if (params().use_esint == BufferParams::package_on)
features.require("esint");
BOOST_ASSERT(from);
BOOST_ASSERT(to);
- // Take care of l10n/i18n
- updateDocLang(to);
-
for_each(par_iterator_begin(),
par_iterator_end(),
bind(&Paragraph::changeLanguage, _1, params(), from, to));
}
-void Buffer::updateDocLang(Language const * nlang)
-{
- BOOST_ASSERT(nlang);
-
- pimpl_->messages = &getMessages(nlang->code());
-}
-
-
bool Buffer::isMultiLingual() const
{
ParConstIterator end = par_iterator_end();
docstring const Buffer::B_(string const & l10n) const
{
- if (pimpl_->messages)
- return pimpl_->messages->get(l10n);
+ Language const * lang = pimpl_->params.language;
+ if (lang)
+ return getMessages(lang->code()).get(l10n);
return _(l10n);
}