+2004-08-04 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * outputparams.h: add new members intitle and lang.
+
+ * paragraph.C (simpleTeXOnePar): initialize rp.lang and
+ rp.intitle. Actually use rp in call to simpleTeXSpecialChars
+
2004-08-01 Lars Gullik Bjonnes <larsbj@gullik.net>
* text3.C (dispatch): remove special handling of button 4 and 5,
+2004-08-04 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
+
+ * insetfoot.C (latex): use OutputParams::intitle instead of
+ parOwner() (avoids time consuming lookup)
+
+ * insetquotes.C (latex): same as above with OutputParams::lang.
+ Moreover the code actually works now.
+
2004-07-24 Lars Gullik Bjonnes <larsbj@gullik.net>
* insetwrap.C, insetvspace.C, insettabular.C, insetnote.C:
OutputParams const & runparams_in) const
{
OutputParams runparams = runparams_in;
- runparams.moving_arg |= ownerPar(buf, this).layout()->intitle;
+ // footnotes in titling commands like \title have moving arguments
+ runparams.moving_arg |= runparams_in.intitle;
os << "%\n\\footnote{";
}
-int InsetQuotes::latex(Buffer const & buf, ostream & os,
+int InsetQuotes::latex(Buffer const &, ostream & os,
OutputParams const & runparams) const
{
- // How do we get the local language here??
- lyx::pos_type curr_pos = ownerPar(buf, this).getPositionOfInset(this);
- BOOST_ASSERT(curr_pos != -1);
-
-#ifdef WITH_WARNINGS
-#warning FIXME. We _must_ find another way to get the language. (Lgb)
-#endif
-#if 0
- // This cannot be used. (Lgb)
- string const curr_lang =
- parOwner()->getFont(buf->params, curr_pos).language()->babel();
-#else
- // And this is not the way... (Lgb)
- string const curr_lang = buf.params().language->lang();
-#endif
const int quoteind = quote_index[side_][language_];
string qstr;
if (language_ == FrenchQ && times_ == DoubleQ
- && curr_lang == "frenchb") {
+ && runparams.lang == "frenchb") {
if (side_ == LeftQ)
qstr = "\\og "; //the spaces are important here
else
qstr = " \\fg{}"; //and here
} else if (language_ == FrenchQ && times_ == DoubleQ
- && curr_lang == "french") {
+ && runparams.lang == "french") {
if (side_ == LeftQ)
qstr = "<< "; //the spaces are important here
else
#ifndef OUTPUTPARAMS_H
#define OUTPUTPARAMS_H
+#include <string>
+
#include "support/types.h"
#include <boost/shared_ptr.hpp>
*/
bool moving_arg;
+ /** intitle == true means that the environment in which the
+ inset is typeset is part of a title (before a \maketitle).
+ Footnotes in such environments have moving arguments.
+ */
+ bool intitle;
+
+ /** the babel name of the language at the point where the inset is
+ */
+ std::string lang;
+
/** free_spacing == true means that the inset is in a free-spacing
paragraph.
*/
basefont = getLayoutFont(bparams, outerfont);
}
- bool moving_arg = runparams.moving_arg;
- moving_arg |= style->needprotect;
+ bool const moving_arg = runparams.moving_arg | style->needprotect;
// Which font is currently active?
LyXFont running_font(basefont);
OutputParams rp = runparams;
rp.moving_arg = moving_arg;
rp.free_spacing = style->free_spacing;
+ rp.lang = font.language()->babel();
+ rp.intitle = style->intitle;
pimpl_->simpleTeXSpecialChars(buf, bparams,
- os, texrow, runparams,
+ os, texrow, rp,
font, running_font,
basefont, outerfont, open_font,
running_change,