#include "Buffer.h"
#include "BufferParams.h"
-#include "support/debug.h"
#include "Encoding.h"
#include "InsetList.h"
#include "Language.h"
#include "insets/InsetBibitem.h"
#include "insets/InsetOptArg.h"
+#include "support/debug.h"
#include "support/lstrings.h"
#include <boost/next_prior.hpp>
BufferParams const & bparams = buf.params();
- LayoutPtr const & style = pit->layout();
+ LayoutPtr const & style = pit->forceEmptyLayout() ?
+ bparams.documentClass().emptyLayout() : pit->layout();
ParagraphList const & paragraphs = text.paragraphs();
if (style->isEnvironment()) {
os << "\\begin{" << from_ascii(style->latexname()) << '}';
if (style->optionalargs > 0) {
- int ret = latexOptArgInsets(buf, *pit, os, runparams,
+ int ret = latexOptArgInsets(*pit, os, runparams,
style->optionalargs);
while (ret > 0) {
texrow.newline();
}
-int latexOptArgInsets(Buffer const & buf, Paragraph const & par,
- odocstream & os, OutputParams const & runparams, int number)
+int latexOptArgInsets(Paragraph const & par, odocstream & os,
+ OutputParams const & runparams, int number)
{
int lines = 0;
if (it->inset->lyxCode() == OPTARG_CODE) {
InsetOptArg * ins =
static_cast<InsetOptArg *>(it->inset);
- lines += ins->latexOptional(buf, os, runparams);
+ lines += ins->latexOptional(os, runparams);
--number;
}
}
LYXERR(Debug::LATEX, "TeXOnePar... " << &*pit << " '"
<< everypar << "'");
BufferParams const & bparams = buf.params();
- LayoutPtr style;
ParagraphList const & paragraphs = text.paragraphs();
if (runparams_in.verbatim) {
texrow.newline();
}
- /*bool need_par = */ pit->latex(buf, bparams, outerfont,
+ /*bool need_par = */ pit->latex(bparams, outerfont,
os, texrow, runparams_in);
return ++pit;
}
+ // FIXME This comment doesn't make sense. What's the
+ // length got to do with forceEmptyLayout()? I.e., what
+ // was forceDefaultParagraphs()?
// In an inset with unlimited length (all in one row),
// force layout to default
- if (!pit->forceDefaultParagraphs())
- style = pit->layout();
- else
- style = bparams.getTextClass().defaultLayout();
+ LayoutPtr const style = pit->forceEmptyLayout() ?
+ bparams.documentClass().emptyLayout() : pit->layout();
OutputParams runparams = runparams_in;
runparams.moving_arg |= style->needprotect;
}
}
- // 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()) {
+ bool const useSetSpace = bparams.documentClass().provides("SetSpace");
+ if (pit->allowParagraphCustomization()) {
if (pit->params().startOfAppendix()) {
os << "\\appendix\n";
texrow.newline();
// Separate handling of optional argument inset.
if (style->optionalargs > 0) {
- int ret = latexOptArgInsets(buf, *pit, os, runparams,
+ int ret = latexOptArgInsets(*pit, os, runparams,
style->optionalargs);
while (ret > 0) {
texrow.newline();
break;
}
- Font const outerfont =
- outerFont(distance(paragraphs.begin(), pit),
+ Font const outerfont = outerFont(distance(paragraphs.begin(), pit),
paragraphs);
// FIXME UNICODE
os << from_utf8(everypar);
- bool need_par = pit->latex(buf, bparams, outerfont,
+ bool need_par = pit->latex(bparams, outerfont,
os, texrow, runparams);
// Make sure that \\par is done with the font of the last
// We do not need to use to change the font for the last paragraph
// or for a command.
- Font const font =
- (pit->empty()
+ Font const font = pit->empty()
? pit->getLayoutFont(bparams, outerfont)
- : pit->getFont(bparams, pit->size() - 1, outerfont));
+ : pit->getFont(bparams, pit->size() - 1, outerfont);
bool is_command = style->isCommand();
pending_newline = true;
}
- if (!pit->forceDefaultParagraphs()) {
+ if (pit->allowParagraphCustomization()) {
if (!pit->params().spacing().isDefault()
&& (boost::next(pit) == paragraphs.end()
|| !boost::next(pit)->hasSameLayout(*pit)))
bool was_title = false;
bool already_title = false;
BufferParams const & bparams = buf.params();
- TextClass const & tclass = bparams.getTextClass();
+ DocumentClass const & tclass = bparams.documentClass();
ParagraphList const & paragraphs = text.paragraphs();
ParagraphList::const_iterator par = paragraphs.begin();
ParagraphList::const_iterator endpar = paragraphs.end();
// any special options in the paragraph and also we don't allow
// any environment other than the default layout of the
// text class to be valid!
- if (!par->forceDefaultParagraphs()) {
- LayoutPtr const & layout = par->layout();
+ if (par->allowParagraphCustomization()) {
+ LayoutPtr const & layout = par->forceEmptyLayout() ?
+ tclass.emptyLayout() :
+ par->layout();
if (layout->intitle) {
if (already_title) {