BufferParams::Impl *
BufferParams::MemoryTraits::clone(BufferParams::Impl const * ptr)
{
- BOOST_ASSERT(ptr);
+ LASSERT(ptr, /**/);
return new BufferParams::Impl(*ptr);
}
docstring BufferParams::B_(string const & l10n) const
{
- BOOST_ASSERT(language);
+ LASSERT(language, /**/);
return getMessages(language->code()).get(l10n);
}
Bullet & BufferParams::temp_bullet(lyx::size_type const index)
{
- BOOST_ASSERT(index < 4);
+ LASSERT(index < 4, /**/);
return pimpl_->temp_bullets[index];
}
Bullet const & BufferParams::temp_bullet(lyx::size_type const index) const
{
- BOOST_ASSERT(index < 4);
+ LASSERT(index < 4, /**/);
return pimpl_->temp_bullets[index];
}
Bullet & BufferParams::user_defined_bullet(lyx::size_type const index)
{
- BOOST_ASSERT(index < 4);
+ LASSERT(index < 4, /**/);
return pimpl_->user_defined_bullets[index];
}
Bullet const & BufferParams::user_defined_bullet(lyx::size_type const index) const
{
- BOOST_ASSERT(index < 4);
+ LASSERT(index < 4, /**/);
return pimpl_->user_defined_bullets[index];
}
else
os << "\\author " << Author() << "\n";
}
-
- vector<string>::const_iterator e_it = extraEmbeddedFiles().begin();
- vector<string>::const_iterator e_end = extraEmbeddedFiles().end();
- os << "\\extra_embedded_files \"";
- bool first = true;
- for (; e_it != e_end; ++e_it) {
- if (!first)
- os << ",";
- else
- first = false;
- os << *e_it;
- }
- os << "\"\n";
}
lyxpreamble += oss.str();
}
- // this might be useful...
- lyxpreamble += "\n\\makeatletter\n";
+ // only add \makeatletter and \makeatother when actually needed
+ bool makeatletter = false;
// Some macros LyX will need
docstring tmppreamble(from_ascii(features.getMacros()));
if (!tmppreamble.empty()) {
+ if (!makeatletter) {
+ lyxpreamble += "\n\\makeatletter\n";
+ makeatletter = true;
+ }
lyxpreamble += "\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% "
"LyX specific LaTeX commands.\n"
+ tmppreamble + '\n';
// the text class specific preamble
tmppreamble = features.getTClassPreamble();
if (!tmppreamble.empty()) {
+ if (!makeatletter) {
+ lyxpreamble += "\n\\makeatletter\n";
+ makeatletter = true;
+ }
lyxpreamble += "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% "
"Textclass specific LaTeX commands.\n"
+ tmppreamble + '\n';
/* the user-defined preamble */
if (!preamble.empty()) {
+ if (!makeatletter) {
+ lyxpreamble += "\n\\makeatletter\n";
+ makeatletter = true;
+ }
// FIXME UNICODE
lyxpreamble += "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% "
"User specified LaTeX commands.\n"
}
}
- if (!bullets_def.empty())
+ if (!bullets_def.empty()) {
+ if (!makeatletter) {
+ lyxpreamble += "\n\\makeatletter\n";
+ makeatletter = true;
+ }
lyxpreamble += bullets_def + "}\n\n";
+ }
- lyxpreamble += "\\makeatother\n\n";
+ if (makeatletter)
+ lyxpreamble += "\\makeatother\n\n";
int const nlines =
int(count(lyxpreamble.begin(), lyxpreamble.end(), '\n'));
if (test == tmptok) {
graphicsDriver = tmptok;
break;
- } else if (test == "") {
+ }
+ if (test.empty()) {
lex.printError(
"Warning: graphics driver `$$Token' not recognized!\n"
" Setting graphics driver to `default'.\n");