#include <boost/next_prior.hpp>
using namespace std;
+using namespace lyx::support;
namespace lyx {
-using support::subst;
-
namespace {
LayoutPtr style;
if (runparams_in.verbatim) {
- int const dist = std::distance(paragraphs.begin(), pit);
+ int const dist = distance(paragraphs.begin(), pit);
Font const outerfont = outerFont(dist, paragraphs);
// No newline if only one paragraph in this lyxtext
OutputParams tmp_rp = runparams;
runparams.moving_arg = false;
pair<bool, int> enc_switch = switchEncoding(os, bparams, runparams,
- *(runparams.encoding), *encoding);
+ *encoding);
runparams = tmp_rp;
// the following is necessary after a CJK environment in a multilingual
// context (nesting issue).
// In an inset with unlimited length (all in one row),
// don't allow any special options in the paragraph
+ bool const useSetSpace = bparams.getTextClass().provides("SetSpace");
if (!pit->forceDefaultParagraphs()) {
if (pit->params().startOfAppendix()) {
os << "\\appendix\n";
&& (pit == paragraphs.begin()
|| !boost::prior(pit)->hasSameLayout(*pit)))
{
- os << from_ascii(pit->params().spacing().writeEnvirBegin())
+ os << from_ascii(pit->params().spacing().writeEnvirBegin(useSetSpace))
<< '\n';
texrow.newline();
}
}
Font const outerfont =
- outerFont(std::distance(paragraphs.begin(), pit),
+ outerFont(distance(paragraphs.begin(), pit),
paragraphs);
// FIXME UNICODE
os << '\n';
texrow.newline();
}
- os << from_ascii(pit->params().spacing().writeEnvirEnd());
+ os << from_ascii(pit->params().spacing().writeEnvirEnd(useSetSpace));
pending_newline = true;
}
}
par = TeXOnePar(buf, paragraphs, par, os, texrow,
runparams, everypar);
}
- if (std::distance(lastpar, par) >= std::distance(lastpar, endpar))
+ if (distance(lastpar, par) >= distance(lastpar, endpar))
break;
}
// It might be that we only have a title in this document
pair<bool, int> switchEncoding(odocstream & os, BufferParams const & bparams,
- OutputParams const & runparams, Encoding const & oldEnc,
- Encoding const & newEnc)
+ OutputParams const & runparams, Encoding const & newEnc)
{
+ Encoding const oldEnc = *runparams.encoding;
bool moving_arg = runparams.moving_arg;
if ((bparams.inputenc != "auto" && bparams.inputenc != "default")
|| moving_arg)