TexRow.h
Text.h
TextClass.h
- TextClassPtr.h
TextMetrics.h
Thesaurus.h
TocBackend.h
s, -1, 0, 0));
}
- params().makeTextClass();
+ params().makeDocumentClass();
return unknown_tokens;
}
bool Buffer::isLatex() const
{
- return params().textClass().outputType() == LATEX;
+ return params().documentClass().outputType() == LATEX;
}
bool Buffer::isLiterate() const
{
- return params().textClass().outputType() == LITERATE;
+ return params().documentClass().outputType() == LITERATE;
}
bool Buffer::isDocBook() const
{
- return params().textClass().outputType() == DOCBOOK;
+ return params().documentClass().outputType() == DOCBOOK;
}
d->texrow.reset();
- TextClass const & tclass = params().textClass();
+ DocumentClass const & tclass = params().documentClass();
string const top_element = tclass.latexname();
if (!only_body) {
<< " file was created by LyX " << lyx_version
<< "\n See http://www.lyx.org/ for more information -->\n";
- params().textClass().counters().reset();
+ params().documentClass().counters().reset();
loadChildDocuments();
vector<string> Buffer::backends() const
{
vector<string> v;
- if (params().textClass().isTeXClassAvailable()) {
+ if (params().documentClass().isTeXClassAvailable()) {
v.push_back(bufferFormat());
// FIXME: Don't hardcode format names here, but use a flag
if (v.back() == "latex")
: pimpl_(new Impl)
{
setBaseClass(defaultBaseclass());
- makeTextClass();
+ makeDocumentClass();
paragraph_separation = PARSEP_INDENT;
quotes_language = InsetQuotes::EnglishQ;
fontsize = "default";
// FIXME: this warning will be given even if there exists a local .cls
// file. Even worse, the .lyx file can not be compiled or exported
// because the textclass is marked as unavilable.
- if (!textClass().isTeXClassAvailable()) {
+ if (!documentClass().isTeXClassAvailable()) {
docstring const msg =
bformat(_("The layout file requested by this document,\n"
"%1$s.layout,\n"
void BufferParams::validate(LaTeXFeatures & features) const
{
- features.require(textClass().requires());
+ features.require(documentClass().requires());
if (outputChanges) {
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
// AMS Style is at document level
if (use_amsmath == package_on
- || textClass().provides("amsmath"))
+ || documentClass().provides("amsmath"))
features.require("amsmath");
if (use_esint == package_on)
features.require("esint");
{
os << "\\documentclass";
- TextClass const & tclass = textClass();
+ DocumentClass const & tclass = documentClass();
ostringstream clsoptions; // the document class options.
// hyperref, see
// http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129680.html
if (language->lang() == "japanese-plain" &&
- !textClass().provides("japanese")) {
+ !documentClass().provides("japanese")) {
//load babel in case it was not loaded due to an empty language list
if (language_options.str().empty())
lyxpreamble += "\\usepackage{babel}\n";
// use hyperref explicitely when it is required
if (features.isRequired("hyperref")) {
odocstringstream oss;
- pdfoptions().writeLaTeX(oss, textClass().provides("hyperref"));
+ pdfoptions().writeLaTeX(oss, documentClass().provides("hyperref"));
lyxpreamble += oss.str();
}
}
-TextClass const & BufferParams::textClass() const
+DocumentClass const & BufferParams::documentClass() const
{
- return *textClass_;
+ return *doc_class_;
}
-TextClassPtr BufferParams::textClassPtr() const {
- return textClass_;
+DocumentClass * BufferParams::documentClassPtr() const {
+ return doc_class_;
}
-void BufferParams::setTextClass(TextClassPtr tc) {
- textClass_ = tc;
+void BufferParams::setDocumentClass(DocumentClass const * const tc) {
+ // evil, but this function is evil
+ doc_class_ = const_cast<DocumentClass *>(tc);
}
}
-void BufferParams::makeTextClass()
+void BufferParams::makeDocumentClass()
{
- textClass_ = TextClassBundle::get().newClass(baseclasslist[baseClass()]);
+ doc_class_ = &(DocumentClassBundle::get().newClass(baseclasslist[baseClass()]));
//FIXME It might be worth loading the children's modules here,
//just as we load their bibliographies and such, instead of just
"probably need to reconfigure LyX.\n"), from_utf8(modName));
frontend::Alert::warning(_("Module not available"),
msg + _("Some layouts may not be available."));
- lyxerr << "BufferParams::makeTextClass(): Module " <<
+ lyxerr << "BufferParams::makeDocumentClass(): Module " <<
modName << " requested but not found in module list." <<
endl;
continue;
frontend::Alert::warning(_("Package not available"), msg);
}
FileName layout_file = libFileSearch("layouts", lm->getFilename());
- if (!textClass_->read(layout_file, TextClass::MODULE)) {
+ if (!doc_class_->read(layout_file, TextClass::MODULE)) {
docstring const msg =
bformat(_("Error reading module %1$s\n"), from_utf8(modName));
frontend::Alert::warning(_("Read Error"), msg);
Font const BufferParams::getFont() const
{
- FontInfo f = textClass().defaultfont();
+ FontInfo f = documentClass().defaultfont();
if (fontsDefaultFamily == "rmdefault")
f.setFamily(ROMAN_FAMILY);
else if (fontsDefaultFamily == "sfdefault")
{
// FIXME the class should provide the numerical/
// authoryear choice
- if (textClass().provides("natbib")
+ if (documentClass().provides("natbib")
&& cite_engine_ != biblio::ENGINE_NATBIB_NUMERICAL)
return biblio::ENGINE_NATBIB_AUTHORYEAR;
return cite_engine_;
#include "Font.h"
#include "BiblioInfo.h"
#include "paper.h"
-#include "TextClassPtr.h"
#include "insets/InsetQuotes.h"
class BaseClassIndex;
class BranchList;
class Bullet;
+class DocumentClass;
class Encoding;
class Language;
class Lexer;
///Get the LyX TextClass (that is, the layout file) this document is using.
BaseClassIndex baseClass() const;
/// Set the LyX TextClass (that is, the layout file) this document is using.
- /// NOTE: This does not call makeTextClass() to update the local TextClass.
- /// That needs to be done manually.
+ /// NOTE: This does not call makeDocumentClass() to update the local
+ /// DocumentClass. That needs to be done manually.
bool setBaseClass(BaseClassIndex);
/// Adds the module information to the baseClass information to
- /// create our local TextClass.
- void makeTextClass();
- /// Returns the TextClass currently in use: the BaseClass as modified
+ /// create our local DocumentClass.
+ void makeDocumentClass();
+ /// Returns the DocumentClass currently in use: the BaseClass as modified
/// by modules.
- TextClass const & textClass() const;
- /// Returns a pointer to the TextClass currently in use: the BaseClass
- /// as modified by modules. (See \file TextClassPtr.h for the typedef.)
- TextClassPtr textClassPtr() const;
+ DocumentClass const & documentClass() const;
+ /// \return A pointer to the DocumentClass currently in use: the BaseClass
+ /// as modified by modules.
+ DocumentClass * documentClassPtr() const;
/// This bypasses the baseClass and sets the textClass directly.
/// Should be called with care and would be better not being here,
/// but it seems to be needed by CutAndPaste::putClipboard().
- void setTextClass(TextClassPtr);
+ void setDocumentClass(DocumentClass const * const);
/// List of modules in use
std::vector<std::string> const & getModules() const;
/// Add a module to the list of modules in use.
/// Returns true if module was successfully added.
- /// The makeClass variable signals whether to call makeTextClass. This
+ /// The makeClass variable signals whether to call makeDocumentClass. This
/// need not be done if we know this isn't the final time through, or if
/// the BufferParams do not represent the parameters for an actual buffer
/// (as in GuiDocument).
/// for use with natbib
biblio::CiteEngine cite_engine_;
- /// the possibly modular TextClass actually in use
- TextClassPtr textClass_;
+ ///
+ DocumentClass * doc_class_;
///
typedef std::vector<std::string> LayoutModuleList;
///
el = buf.errorList("Parse");
buffer_.undo().recordUndo(d->cursor_);
cap::pasteParagraphList(d->cursor_, buf.paragraphs(),
- buf.params().textClassPtr(), el);
+ buf.params().documentClassPtr(), el);
res = _("Document %1$s inserted.");
} else {
res = _("Could not insert document %1$s");
typedef pair<pit_type, int> PitPosPair;
-typedef limited_stack<pair<ParagraphList, TextClassPtr> > CutStack;
+typedef limited_stack<pair<ParagraphList, DocumentClass const *> > CutStack;
CutStack theCuts(10);
// persistent selection, cleared until the next selection
pair<PitPosPair, pit_type>
pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
- TextClassPtr textclass, ErrorList & errorlist)
+ DocumentClass const * const docclass, ErrorList & errorlist)
{
Buffer const & buffer = cur.buffer();
pit_type pit = cur.pit();
// Make a copy of the CaP paragraphs.
ParagraphList insertion = parlist;
- TextClassPtr const tc = buffer.params().textClassPtr();
+ DocumentClass const * const tc = buffer.params().documentClassPtr();
// Now remove all out of the pars which is NOT allowed in the
// new environment and set also another font if that is required.
// supposed to be the default, not just if it is forced
if (cur.inset().useEmptyLayout()) {
LayoutPtr const layout =
- buffer.params().textClass().emptyLayout();
+ buffer.params().documentClass().emptyLayout();
ParagraphList::iterator const end = insertion.end();
for (ParagraphList::iterator par = insertion.begin();
par != end; ++par)
// since we store pointers to insets at some places and we don't
// want to invalidate them.
insertion.swap(in.paragraphs());
- cap::switchBetweenClasses(textclass, tc, in, errorlist);
+ cap::switchBetweenClasses(docclass, tc, in, errorlist);
insertion.swap(in.paragraphs());
ParagraphList::iterator tmpbuf = insertion.begin();
}
-void putClipboard(ParagraphList const & paragraphs, TextClassPtr textclass,
- docstring const & plaintext)
+void putClipboard(ParagraphList const & paragraphs,
+ DocumentClass const * const docclass, docstring const & plaintext)
{
// For some strange reason gcc 3.2 and 3.3 do not accept
// Buffer buffer(string(), false);
Buffer buffer("", false);
buffer.setUnnamed(true);
buffer.paragraphs() = paragraphs;
- buffer.params().setTextClass(textclass);
+ buffer.params().setDocumentClass(docclass);
ostringstream lyx;
if (buffer.write(lyx))
theClipboard().put(lyx.str(), plaintext);
void copySelectionHelper(Buffer const & buf, ParagraphList & pars,
pit_type startpit, pit_type endpit,
- int start, int end, TextClassPtr tc, CutStack & cutstack)
+ int start, int end, DocumentClass const * const dc, CutStack & cutstack)
{
BOOST_ASSERT(0 <= start && start <= pars[startpit].size());
BOOST_ASSERT(0 <= end && end <= pars[endpit].size());
// do not copy text (also nested in insets) which is marked as deleted
acceptChanges(copy_pars, buf.params());
- cutstack.push(make_pair(copy_pars, tc));
+ DocumentClass * d = const_cast<DocumentClass *>(dc);
+ cutstack.push(make_pair(copy_pars, d));
}
} // namespace anon
}
-void switchBetweenClasses(TextClassPtr const & oldone,
- TextClassPtr const & newone, InsetText & in, ErrorList & errorlist)
+void switchBetweenClasses(DocumentClass const * const oldone,
+ DocumentClass const * const newone, InsetText & in, ErrorList & errorlist)
{
errorlist.clear();
if (oldone == newone)
return;
- TextClass const & oldtc = *oldone;
- TextClass const & newtc = *newone;
+ DocumentClass const & oldtc = *oldone;
+ DocumentClass const & newtc = *newone;
// layouts
ParIterator end = par_iterator_end(in);
docstring const name = it->layout()->name();
bool hasLayout = newtc.hasLayout(name);
- if (hasLayout)
+ if (in.useEmptyLayout())
+ it->setLayout(newtc.emptyLayout());
+ else if (hasLayout)
it->setLayout(newtc[name]);
else
it->setLayout(newtc.defaultLayout());
text->paragraphs(),
begpit, endpit,
cur.selBegin().pos(), endpos,
- bp.textClassPtr(), theCuts);
+ bp.documentClassPtr(), theCuts);
// Stuff what we got on the clipboard.
// Even if there is no selection.
putClipboard(theCuts[0].first, theCuts[0].second,
copySelectionHelper(cur.buffer(), pars, par, cur.selEnd().pit(),
pos, cur.selEnd().pos(),
- cur.buffer().params().textClassPtr(), cutstack);
+ cur.buffer().params().documentClassPtr(), cutstack);
dirtyTabularStack(false);
}
ParagraphList pars;
Paragraph par;
BufferParams const & bp = cur.buffer().params();
- par.setLayout(bp.textClass().defaultLayout());
+ // FIXME This should be the empty layout...right?
+ par.setLayout(bp.documentClass().emptyLayout());
par.insert(0, grabSelection(cur), Font(), Change(Change::UNCHANGED));
pars.push_back(par);
- cutstack.push(make_pair(pars, bp.textClassPtr()));
+ cutstack.push(make_pair(pars, bp.documentClassPtr()));
}
}
ParagraphList pars;
Paragraph par;
BufferParams const & bp = cur.buffer().params();
- par.setLayout(bp.textClass().defaultLayout());
+ par.setLayout(bp.documentClass().emptyLayout());
par.insert(0, plaintext, Font(), Change(Change::UNCHANGED));
pars.push_back(par);
- theCuts.push(make_pair(pars, bp.textClassPtr()));
+ theCuts.push(make_pair(pars, bp.documentClassPtr()));
} else {
copySelectionToStack(cur, theCuts);
}
void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
- TextClassPtr textclass, ErrorList & errorList)
+ DocumentClass const * const docclass, ErrorList & errorList)
{
if (cur.inTexted()) {
Text * text = cur.text();
PitPosPair ppp;
boost::tie(ppp, endpit) =
- pasteSelectionHelper(cur, parlist, textclass, errorList);
+ pasteSelectionHelper(cur, parlist, docclass, errorList);
updateLabels(cur.buffer());
cur.clearSelection();
text->setCursor(cur, ppp.first, ppp.second);
if (buffer.readString(lyx)) {
cur.recordUndo();
pasteParagraphList(cur, buffer.paragraphs(),
- buffer.params().textClassPtr(), errorList);
+ buffer.params().documentClassPtr(), errorList);
cur.setSelection();
return;
}
#ifndef CUTANDPASTE_H
#define CUTANDPASTE_H
-#include "TextClassPtr.h"
-
#include "support/docstring.h"
#include "frontends/Clipboard.h"
namespace lyx {
+class DocumentClass;
class ErrorList;
class InsetText;
class Cursor;
/// Paste the paragraph list \p parlist at the position given by \p cur.
/// Does not handle undo. Does only work in text, not mathed.
void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
- TextClassPtr textclass, ErrorList & errorList);
+ DocumentClass const * const textclass, ErrorList & errorList);
/** Needed to switch between different classes. This works
* for a list of paragraphs beginning with the specified par.
* It changes layouts and character styles.
*/
-void switchBetweenClasses(TextClassPtr const & c1,
- TextClassPtr const & c2, InsetText & in, ErrorList &);
+void switchBetweenClasses(DocumentClass const * const c1,
+ DocumentClass const * const c2, InsetText & in, ErrorList &);
/// Get the current selection as a string. Does not change the selection.
/// Does only work if the whole selection is in mathed.
return;
}
- TextClass const & tclass = params_.textClass();
+ DocumentClass const & tclass = params_.documentClass();
if (tclass.hasLayout(layoutname)) {
// Is this layout already in usedLayouts?
if (find(usedLayouts_.begin(), usedLayouts_.end(), layoutname)
bool LaTeXFeatures::mustProvide(string const & name) const
{
- return isRequired(name) && !params_.textClass().provides(name);
+ return isRequired(name) && !params_.documentClass().provides(name);
}
// We only need float.sty if we use non builtin floats, or if we
// use the "H" modifier. This includes modified table and
// figure floats. (Lgb)
- Floating const & fl = params_.textClass().floats().getType(name);
+ Floating const & fl = params_.documentClass().floats().getType(name);
if (!fl.type().empty() && !fl.builtin()) {
require("float");
}
string const LaTeXFeatures::getPackages() const
{
ostringstream packages;
- TextClass const & tclass = params_.textClass();
+ DocumentClass const & tclass = params_.documentClass();
// FIXME: currently, we can only load packages and macros known
// to LyX.
docstring const LaTeXFeatures::getTClassPreamble() const
{
// the text class specific preamble
- TextClass const & tclass = params_.textClass();
+ DocumentClass const & tclass = params_.documentClass();
odocstringstream tcpreamble;
tcpreamble << tclass.preamble();
void LaTeXFeatures::getFloatDefinitions(ostream & os) const
{
- FloatList const & floats = params_.textClass().floats();
+ FloatList const & floats = params_.documentClass().floats();
// Here we will output the code to create the needed float styles.
// We will try to do this as minimal as possible.
Buffer * buffer = lyx_view_->buffer();
- TextClassPtr oldClass = buffer->params().textClassPtr();
+ DocumentClass * oldClass = buffer->params().documentClassPtr();
Cursor & cur = view()->cursor();
cur.recordUndoFullDocument();
case LFUN_LAYOUT_MODULES_CLEAR: {
BOOST_ASSERT(lyx_view_);
Buffer * buffer = lyx_view_->buffer();
- TextClassPtr oldClass = buffer->params().textClassPtr();
+ DocumentClass * oldClass = buffer->params().documentClassPtr();
view()->cursor().recordUndoFullDocument();
buffer->params().clearLayoutModules();
- buffer->params().makeTextClass();
+ buffer->params().makeDocumentClass();
updateLayout(oldClass, buffer);
updateFlags = Update::Force | Update::FitCursor;
break;
case LFUN_LAYOUT_MODULE_ADD: {
BOOST_ASSERT(lyx_view_);
Buffer * buffer = lyx_view_->buffer();
- TextClassPtr oldClass = buffer->params().textClassPtr();
+ DocumentClass * oldClass = buffer->params().documentClassPtr();
view()->cursor().recordUndoFullDocument();
buffer->params().addLayoutModule(argument);
- buffer->params().makeTextClass();
+ buffer->params().makeDocumentClass();
updateLayout(oldClass, buffer);
updateFlags = Update::Force | Update::FitCursor;
break;
break;
//Save the old, possibly modular, layout for use in conversion.
- TextClassPtr oldClass = buffer->params().textClassPtr();
+ DocumentClass * oldClass = buffer->params().documentClassPtr();
view()->cursor().recordUndoFullDocument();
buffer->params().setBaseClass(new_class);
- buffer->params().makeTextClass();
+ buffer->params().makeDocumentClass();
updateLayout(oldClass, buffer);
updateFlags = Update::Force | Update::FitCursor;
break;
case LFUN_LAYOUT_RELOAD: {
BOOST_ASSERT(lyx_view_);
Buffer * buffer = lyx_view_->buffer();
- TextClassPtr oldClass = buffer->params().textClassPtr();
+ DocumentClass * oldClass = buffer->params().documentClassPtr();
BaseClassIndex const tc = buffer->params().baseClass();
baseclasslist.reset(tc);
buffer->params().setBaseClass(tc);
- buffer->params().makeTextClass();
+ buffer->params().makeDocumentClass();
updateLayout(oldClass, buffer);
updateFlags = Update::Force | Update::FitCursor;
break;
}
-void LyXFunc::updateLayout(TextClassPtr oldlayout,Buffer * buffer)
+void LyXFunc::updateLayout(DocumentClass * oldlayout,Buffer * buffer)
{
lyx_view_->message(_("Converting document to new document class..."));
StableDocIterator backcur(view()->cursor());
ErrorList & el = buffer->errorList("Class Switch");
cap::switchBetweenClasses(
- oldlayout, buffer->params().textClassPtr(),
+ oldlayout, buffer->params().documentClassPtr(),
static_cast<InsetText &>(buffer->inset()), el);
view()->setCursor(backcur.asDocIterator(&(buffer->inset())));
#include "KeySequence.h"
#include "lfuns.h"
-#include "TextClassPtr.h"
#include "support/docstring.h"
class Buffer;
class BufferView;
+class DocumentClass;
class FuncRequest;
class FuncStatus;
class KeySymbol;
///
bool ensureBufferClean(BufferView * bv);
///
- void updateLayout(TextClassPtr oldlayout, Buffer * buffer);
+ void updateLayout(DocumentClass * oldlayout, Buffer * buffer);
};
/// Implementation is in LyX.cpp
TexStream.h \
Text.h \
TextClass.h \
- TextClassPtr.h \
TextMetrics.h \
TocBackend.h \
ToolbarBackend.h \
return;
}
- FloatList const & floats = buf->params().textClass().floats();
+ FloatList const & floats = buf->params().documentClass().floats();
FloatList::const_iterator cit = floats.begin();
FloatList::const_iterator end = floats.end();
for (; cit != end; ++cit) {
return;
}
- FloatList const & floats = buf->params().textClass().floats();
+ FloatList const & floats = buf->params().documentClass().floats();
FloatList::const_iterator cit = floats.begin();
FloatList::const_iterator end = floats.end();
for (; cit != end; ++cit) {
return;
}
TextClass::InsetLayouts const & insetLayouts =
- buf->params().textClass().insetLayouts();
+ buf->params().documentClass().insetLayouts();
TextClass::InsetLayouts::const_iterator cit = insetLayouts.begin();
TextClass::InsetLayouts::const_iterator end = insetLayouts.end();
for (; cit != end; ++cit) {
tomenu.add(MenuItem(MenuItem::Command, _("Master Document"), f));
}
- FloatList const & floatlist = buf->params().textClass().floats();
+ FloatList const & floatlist = buf->params().documentClass().floats();
TocList const & toc_list = buf->tocBackend().tocs();
TocList::const_iterator cit = toc_list.begin();
TocList::const_iterator end = toc_list.end();
docstring Paragraph::expandLabel(LayoutPtr const & layout,
BufferParams const & bparams, bool process_appendix) const
{
- TextClass const & tclass = bparams.textClass();
+ DocumentClass const & tclass = bparams.documentClass();
docstring fmt;
if (process_appendix && d->params_.appendix())
bool asdefault = forceEmptyLayout();
if (asdefault)
- style = bparams.textClass().defaultLayout();
+ style = bparams.documentClass().emptyLayout();
else
style = d->layout_;
int ParagraphMetrics::rightMargin(BufferView const & bv) const
{
BufferParams const & params = bv.buffer().params();
- TextClass const & tclass = params.textClass();
+ DocumentClass const & tclass = params.documentClass();
frontend::FontMetrics const & fm = theFontMetrics(params.getFont());
int const r_margin =
bv.rightMargin()
font = Font(inherit_font, bp.language);
change = Change(Change::UNCHANGED);
- TextClass const & tclass = bp.textClass();
+ DocumentClass const & tclass = bp.documentClass();
if (layoutname.empty())
layoutname = tclass.defaultLayoutName();
tclass.defaultLayoutName();
}
- par.setLayout(bp.textClass()[layoutname]);
+ par.setLayout(bp.documentClass()[layoutname]);
// Test whether the layout is obsolete.
LayoutPtr const & layout = par.layout();
if (!layout->obsoleted_by().empty())
- par.setLayout(bp.textClass()[layout->obsoleted_by()]);
+ par.setLayout(bp.documentClass()[layout->obsoleted_by()]);
par.params().read(lex);
Paragraph & cpar = cur.paragraph();
pit_type cpit = cur.pit();
- TextClass const & tclass = cur.buffer().params().textClass();
+ DocumentClass const & tclass = cur.buffer().params().documentClass();
LayoutPtr const & layout = cpar.layout();
// this is only allowed, if the current paragraph is not empty
}
// otherwise reset to default
- if (par.useEmptyLayout())
- cur.paragraph().setLayout(bufparams.textClass().emptyLayout());
- else
- cur.paragraph().setLayout(bufparams.textClass().defaultLayout());
- return true;
+ cur.paragraph().setEmptyOrDefaultLayout(bufparams.documentClass());
}
bool needsUpdate = false;
BufferParams const & bufparams = cur.buffer().params();
- TextClass const & tclass = bufparams.textClass();
+ DocumentClass const & tclass = bufparams.documentClass();
ParagraphList & plist = cur.text()->paragraphs();
Paragraph const & par = cur.paragraph();
Cursor prevcur = cur;
for (; it != it_end; it++)
it->changeLanguage(b.params(), latex_language, b.language());
- pasteParagraphList(cur, plist, b.params().textClassPtr(),
+ pasteParagraphList(cur, plist, b.params().documentClassPtr(),
b.errorList("Paste"));
// restore position
cur.pit() = min(cur.lastpit(), spit);
BOOST_ASSERT(start != end);
BufferParams const & bufparams = buffer.params();
- LayoutPtr const & lyxlayout = bufparams.textClass()[layout];
+ LayoutPtr const & lyxlayout = bufparams.documentClass()[layout];
for (pit_type pit = start; pit != end; ++pit) {
Paragraph & par = pars_[pit];
// special handling of new environment insets
BufferView & bv = cur.bv();
BufferParams const & params = bv.buffer().params();
- LayoutPtr const & lyxlayout = params.textClass()[layout];
+ LayoutPtr const & lyxlayout = params.documentClass()[layout];
if (lyxlayout->is_environment) {
// move everything in a new environment inset
LYXERR(Debug::DEBUG, "setting layout " << to_utf8(layout));
if (insetText && !insetText->allowMultiPar() || cur.lastpit() == 0) {
// reset first par to default
cur.text()->paragraphs().begin()
- ->setEmptyOrDefaultLayout(bparams.textClass());
+ ->setEmptyOrDefaultLayout(bparams.documentClass());
cur.pos() = 0;
cur.pit() = 0;
// Merge multiple paragraphs -- hack
} else {
// reset surrounding par to default
docstring const layoutname = insetText->useEmptyLayout()
- ? bparams.textClass().emptyLayoutName()
- : bparams.textClass().defaultLayoutName();
+ ? bparams.documentClass().emptyLayoutName()
+ : bparams.documentClass().defaultLayoutName();
cur.leaveInset(*inset);
text->setLayout(cur, layoutname);
}
ParagraphList::iterator finish = start;
ParagraphList::iterator end = pars.end();
- TextClass const & tc = buf.params().textClass();
+ DocumentClass const & tc = buf.params().documentClass();
int const thistoclevel = start->layout()->toclevel;
int toclevel;
Paragraph const & para = cur.paragraph();
docstring const old_layout = para.layout()->name();
- TextClass const & tclass = bv->buffer().params().textClass();
+ DocumentClass const & tclass = bv->buffer().params().documentClass();
if (layout.empty())
layout = tclass.defaultLayoutName();
cur.posForward();
ParagraphList & pars = cur.text()->paragraphs();
- TextClass const & tclass = bv->buffer().params().textClass();
+ DocumentClass const & tclass = bv->buffer().params().documentClass();
// add a separate paragraph for the caption inset
pars.push_back(Paragraph());
break;
case LFUN_FLOAT_LIST: {
- TextClass const & tclass = bv->buffer().params().textClass();
+ DocumentClass const & tclass = bv->buffer().params().documentClass();
if (tclass.floats().typeExist(to_utf8(cmd.argument()))) {
cur.recordUndo();
if (cur.selection())
case LFUN_FLEX_INSERT: {
code = FLEX_CODE;
string s = cmd.getArg(0);
- InsetLayout il = cur.buffer().params().textClass().insetLayout(from_utf8(s));
+ InsetLayout il =
+ cur.buffer().params().documentClass().insetLayout(from_utf8(s));
if (il.lyxtype() != "charstyle" &&
il.lyxtype() != "custom" &&
il.lyxtype() != "element" &&
}
-TextClassPtr TextClassBundle::newClass(TextClass const & baseClass)
+DocumentClass & DocumentClassBundle::newClass(TextClass const & baseClass)
{
- TextClass * tc = new TextClass(baseClass);
- tc_list_.push_back(tc);
- return tc;
+ DocumentClass dc(baseClass);
+ tc_list_.push_back(dc);
+ return tc_list_.back();
}
-TextClassBundle & TextClassBundle::get()
+DocumentClassBundle & DocumentClassBundle::get()
{
- static TextClassBundle singleton;
+ static DocumentClassBundle singleton;
return singleton;
}
-TextClassBundle::~TextClassBundle()
-{
- std::list<TextClassPtr>::iterator it = tc_list_.begin();
- std::list<TextClassPtr>::iterator end = tc_list_.end();
- for (; it != end; ++it)
- delete *it;
-}
+DocumentClass::DocumentClass(TextClass const & tc)
+ : TextClass(tc)
+{}
ostream & operator<<(ostream & os, PageSides p)
#include "FontInfo.h"
#include "LayoutEnums.h"
#include "LayoutPtr.h"
-#include "TextClassPtr.h"
#include "insets/InsetLayout.h"
namespace support { class FileName; }
-class Layout;
-class Lexer;
class Counters;
class FloatList;
+class Layout;
+class Lexer;
/// A TextClass represents a collection of layout information: At the
};
+/// This class amounts to little more than a `strong typedef'.
+/// Its purpose is to control the creation of TextClass objects
+/// within the DocumentClassBundle.
+/// These TextClasses represent the layout information that is
+/// associated with a given buffer.
+class DocumentClass : public TextClass {
+private:
+ /// Constructs a DocumentClass based upon a TextClass.
+ DocumentClass(TextClass const & tc);
+ /// The only class that can create a DocumentClass is
+ /// DocumentClassBundle, which calls the private constructor.
+ friend class DocumentClassBundle;
+};
+
+
/// This is simply a container for the text classes generated when modules
/// are read, so that they stay in memory for use by Insets, CutAndPaste,
-/// and the like. Since they're constructed via new, they wouldn't actually
-/// disappear without this class---but this class holds the pointers to them
-/// so that they don't leak.
+/// and the like.
/// FIXME Some sort of garbage collection or reference counting wouldn't
/// be a bad idea here. It might be enough to check when a Buffer is closed
-/// (or makeTextClass is called) whether the old TextClass is in use anywhere.
+/// (or makeDocumentClass is called) whether the old DocumentClass is in use
+/// anywhere.
///
/// This is a singleton class. Its sole instance is accessed via
-/// TextClassBundle::get().
-///
-/// See \file TextClassPtr.h for the definition of TextClassPtr.
-class TextClassBundle {
+/// DocumentClassBundle::get().
+class DocumentClassBundle {
public:
/// \return Pointer to a new class equal to baseClass
- TextClassPtr newClass(TextClass const & baseClass);
+ DocumentClass & newClass(TextClass const & baseClass);
/// \return The sole instance of this class.
- static TextClassBundle & get();
- ///
- ~TextClassBundle();
+ static DocumentClassBundle & get();
private:
/// control instantiation
- TextClassBundle() {};
+ DocumentClassBundle() {}
/// noncopyable
- TextClassBundle(TextClassBundle const &);
+ DocumentClassBundle(DocumentClassBundle const &);
///
- std::list<TextClassPtr> tc_list_;
+ std::list<DocumentClass> tc_list_;
};
+++ /dev/null
-// -*- C++ -*-
-/**
- * \file TextClassPtr.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * Full author contact details are available in file CREDITS.
- */
-#ifndef TEXTCLASS_PTR_H
-#define TEXTCLASS_PTR_H
-
-namespace lyx {
-
-class TextClass;
-
-// This largely useless typedef is scheduled to be replaced by
-// something better.
-typedef TextClass * TextClassPtr;
-
-} // namespace lyx
-
-#endif
BOOST_ASSERT(pos <= par.size());
Buffer const & buffer = bv_->buffer();
//lyxerr << "TextMetrics::leftMargin: pit: " << pit << " pos: " << pos << endl;
- TextClass const & tclass = buffer.params().textClass();
+ DocumentClass const & tclass = buffer.params().documentClass();
LayoutPtr const & layout = par.layout();
docstring parindent = layout->parindent;
}
BufferParams const & bufparams = buffer_->params();
- const int min_toclevel = bufparams.textClass().min_toclevel();
+ const int min_toclevel = bufparams.documentClass().min_toclevel();
TocIterator toc_item = item("tableofcontents", par_it);
tocs_.clear();
BufferParams const & bufparams = buffer_->params();
- const int min_toclevel = bufparams.textClass().min_toclevel();
+ const int min_toclevel = bufparams.documentClass().min_toclevel();
Toc & toc = tocs_["tableofcontents"];
ParConstIterator pit = buffer_->par_iterator_begin();
// set the label of a paragraph. This includes the counters.
void setLabel(Buffer const & buf, ParIterator & it)
{
- TextClass const & textclass = buf.params().textClass();
+ DocumentClass const & textclass = buf.params().documentClass();
Paragraph & par = it.paragraph();
LayoutPtr const & layout = par.layout();
Counters & counters = textclass.counters();
{
Buffer const * const master = buf.masterBuffer();
// Use the master text class also for child documents
- TextClass const & textclass = master->params().textClass();
+ DocumentClass const & textclass = master->params().documentClass();
if (!childonly) {
// If this is a child document start with the master
case LFUN_FLEX_INSERT: {
string s = cmd.getArg(0);
- return new InsetFlex(params, params.textClassPtr(), s);
+ return new InsetFlex(params, params.documentClassPtr(), s);
}
case LFUN_NOTE_INSERT: {
case LFUN_FLOAT_INSERT: {
// check if the float type exists
string const argument = to_utf8(cmd.argument());
- if (params.textClass().floats().typeExist(argument))
+ if (params.documentClass().floats().typeExist(argument))
return new InsetFloat(params, argument);
lyxerr << "Non-existent float type: " << argument << endl;
}
case LFUN_FLOAT_WIDE_INSERT: {
// check if the float type exists
string const argument = to_utf8(cmd.argument());
- if (params.textClass().floats().typeExist(argument)) {
+ if (params.documentClass().floats().typeExist(argument)) {
auto_ptr<InsetFloat> p(new InsetFloat(params, argument));
p->wide(true, params);
return p.release();
lex.next();
string s = lex.getString();
inset.reset(new InsetFlex(buf.params(),
- buf.params().textClassPtr(), s));
+ buf.params().documentClassPtr(), s));
} else if (tmptok == "Branch") {
inset.reset(new InsetBranch(buf.params(),
InsetBranchParams()));
void GuiDocument::updateNumbering()
{
- TextClass const & tclass = bp_.textClass();
+ DocumentClass const & tclass = bp_.documentClass();
numberingModule->tocTW->setUpdatesEnabled(false);
numberingModule->tocTW->clear();
params.language = lyx::languages.getLanguage(lang_[pos]);
// numbering
- if (params.textClass().hasTocLevels()) {
+ if (params.documentClass().hasTocLevels()) {
params.tocdepth = numberingModule->tocSL->value();
params.secnumdepth = numberingModule->depthSL->value();
}
if (type == "label")
return _("Labels and References");
- FloatList const & floats = buffer().params().textClass().floats();
+ FloatList const & floats = buffer().params().documentClass().floats();
if (floats.typeExist(type))
return _(floats.getType(type).listName());
return;
}
- TextClass const * text_class = &buffer->params().textClass();
+ DocumentClass const * text_class = &buffer->params().documentClass();
Inset const * inset =
owner_.view()->cursor().innerParagraph().inInset();
#ifndef GUI_TOOLBARS_H
#define GUI_TOOLBARS_H
-#include "TextClassPtr.h"
-
#include "support/docstring.h"
#include <map>
namespace lyx {
+class DocumentClass;
class ToolbarInfo;
namespace frontend {
ToolbarsMap toolbars_;
/// The last textclass layout list in the layout choice selector
- TextClassPtr last_textclass_;
+ DocumentClass * last_textclass_;
};
InsetLayout const & Inset::getLayout(BufferParams const & bp) const
{
- return bp.textClass().insetLayout(name());
+ return bp.documentClass().insetLayout(name());
}
/// Update the counters of this inset and of its contents
void InsetBibitem::updateLabels(ParIterator const &)
{
- Counters & counters = buffer().params().textClass().counters();
+ Counters & counters = buffer().params().documentClass().counters();
docstring const bibitem = from_ascii("bibitem");
if (counters.hasCounter(bibitem) && getParam("label").empty()) {
counters.step(bibitem);
"BibTeX will be unable to find it."));
}
- if (!db_out.empty() && buffer().params().use_bibtopic){
+ if (!db_out.empty() && buffer().params().use_bibtopic) {
os << "\\begin{btSect}{" << db_out << "}\n";
docstring btprint = getParam("btprint");
if (btprint.empty())
// part of its name, because it's than book.
// For the "official" lyx-layouts it's no problem to support
// all well
- if (!contains(buffer().params().textClass().name(),
- "art")) {
+ if (!contains(buffer().params().documentClass().name(), "art")) {
if (buffer().params().sides == OneSide) {
// oneside
os << "\\clearpage";
: InsetCollapsable(bp), params_(label)
{
if (forceEmptyLayout())
- paragraphs().back().setLayout(bp.textClass().emptyLayout());
+ paragraphs().back().setLayout(bp.documentClass().emptyLayout());
}
}
-docstring InsetBranch::toolTip(BufferView const & bv, int x, int y) const
+docstring InsetBranch::toolTip(BufferView const &, int, int) const
{
return _("Branch: ") + params_.branch;
}
if (isBranchSelected())
InsetCollapsable::updateLabels(it);
else {
- TextClass const & tclass = buffer().params().textClass();
+ DocumentClass const & tclass = buffer().params().documentClass();
Counters savecnt = tclass.counters();
InsetCollapsable::updateLabels(it);
tclass.counters() = savecnt;
InsetCaption::InsetCaption(BufferParams const & bp)
- : InsetText(bp), textclass_(bp.textClass())
+ : InsetText(bp), textclass_(bp.documentClass())
{
setAutoBreakRows(true);
setDrawFrame(true);
setFrameColor(Color_captionframe);
//FIXME Do we need to set all paragraphs here? or will there
//always only be one?
- paragraphs().back().setLayout(bp.textClass().emptyLayout());
+ paragraphs().back().setLayout(bp.documentClass().emptyLayout());
}
void InsetCaption::updateLabels(ParIterator const & it)
{
- TextClass const & tclass = buffer().params().textClass();
+ DocumentClass const & tclass = buffer().params().documentClass();
Counters & cnts = tclass.counters();
string const & type = cnts.current_float();
// Memorize type for addToToc().
InsetCollapsable::InsetCollapsable(BufferParams const & bp,
- CollapseStatus status, TextClassPtr tc)
+ CollapseStatus status, DocumentClass * dc)
: InsetText(bp), status_(status),
openinlined_(false), autoOpen_(false), mouse_hover_(false)
{
- setLayout(tc);
+ setLayout(dc);
setAutoBreakRows(true);
setDrawFrame(true);
setFrameColor(Color_collapsableframe);
- paragraphs().back().setLayout(bp.textClass().emptyLayout());
+ paragraphs().back().setLayout(bp.documentClass().emptyLayout());
}
InsetCollapsable::InsetCollapsable(InsetCollapsable const & rhs)
: InsetText(rhs),
- textClass_(rhs.textClass_),
layout_(rhs.layout_),
labelstring_(rhs.labelstring_),
button_dim(rhs.button_dim),
void InsetCollapsable::setLayout(BufferParams const & bp)
{
- setLayout(bp.textClassPtr());
+ setLayout(bp.documentClassPtr());
}
-void InsetCollapsable::setLayout(TextClassPtr tc)
+void InsetCollapsable::setLayout(DocumentClass const * const dc)
{
- textClass_ = tc;
- if ( textClass_ != 0 ) {
- layout_ = &textClass_->insetLayout(name());
+ if (dc != 0) {
+ layout_ = &(dc->insetLayout(name()));
labelstring_ = layout_->labelstring();
} else {
layout_ = &TextClass::emptyInsetLayout();
docstring InsetCollapsable::floatName(
string const & type, BufferParams const & bp) const
{
- FloatList const & floats = bp.textClass().floats();
+ FloatList const & floats = bp.documentClass().floats();
FloatList::const_iterator it = floats[type];
// FIXME UNICODE
return (it == floats.end()) ? from_ascii(type) : bp.B_(it->second.name());
#include "Box.h"
#include "TextClass.h"
-#include "TextClassPtr.h"
#include <string>
public:
///
InsetCollapsable(BufferParams const &,
- CollapseStatus status = Inset::Open, TextClassPtr tc = 0);
+ CollapseStatus status = Inset::Open, DocumentClass * tc = 0);
///
InsetCollapsable(InsetCollapsable const & rhs);
///
void setLayout(BufferParams const &);
/// (Re-)set the character style parameters from \p tc according
/// to name()
- void setLayout(TextClassPtr tc);
+ void setLayout(DocumentClass const * const tc);
///
virtual bool useEmptyLayout() { return true; }
///
virtual void resetParagraphsFont();
private:
- /// text class to keep the InsetLayout above in memory
- /// FIXME This probably isn't needed now
- TextClassPtr textClass_;
- /// cache for the layout_. Make sure it is in sync with the text class!
+ /// cache for the layout_. Make sure it is in sync with the document class!
InsetLayout const * layout_;
///
Dimension dimensionCollapsed() const;
void InsetERT::doDispatch(Cursor & cur, FuncRequest & cmd)
{
BufferParams const & bp = cur.buffer().params();
- LayoutPtr const layout =
- bp.textClass().emptyLayout();
+ LayoutPtr const layout = bp.documentClass().emptyLayout();
//lyxerr << "\nInsetERT::doDispatch (begin): cmd: " << cmd << endl;
switch (cmd.action) {
InsetEnvironment::InsetEnvironment
(BufferParams const & bp, docstring const & name)
- : InsetText(bp), layout_(bp.textClass()[name]), name_(name)
+ : InsetText(bp), layout_(bp.documentClass()[name]), name_(name)
{
setAutoBreakRows(true);
setDrawFrame(true);
InsetFlex::InsetFlex(BufferParams const & bp,
- TextClassPtr tc, string const & layoutName)
- : InsetCollapsable(bp, Collapsed, tc),
+ DocumentClass * dc, string const & layoutName)
+ : InsetCollapsable(bp, Collapsed, dc),
name_(layoutName)
{
- setLayout(tc); // again, because now the name is initialized
+ setLayout(dc); // again, because now the name is initialized
packages_ = getLayout().requires();
preamble_ = getLayout().preamble();
}
class InsetFlex : public InsetCollapsable {
public:
///
- InsetFlex(BufferParams const &,TextClassPtr tc,
+ InsetFlex(BufferParams const &, DocumentClass * dc,
std::string const & layoutName);
///
docstring name() const { return from_utf8(name_); }
void InsetFloat::updateLabels(ParIterator const & it)
{
- Counters & cnts = buffer().params().textClass().counters();
+ Counters & cnts = buffer().params().documentClass().counters();
string const saveflt = cnts.current_float();
// Tell to captions what the current float is
int InsetFloat::latex(odocstream & os, OutputParams const & runparams) const
{
- FloatList const & floats = buffer().params().textClass().floats();
+ FloatList const & floats = buffer().params().documentClass().floats();
string tmptype = params_.type;
if (params_.sideways)
tmptype = "sideways" + params_.type;
docstring InsetFloatList::screenLabel() const
{
- FloatList const & floats = buffer().params().textClass().floats();
+ FloatList const & floats = buffer().params().documentClass().floats();
FloatList::const_iterator it = floats[to_ascii(getParam("type"))];
if (it != floats.end())
return buffer().B_(it->second.listName());
void InsetFloatList::read(Lexer & lex)
{
- FloatList const & floats = buffer().params().textClass().floats();
+ FloatList const & floats = buffer().params().documentClass().floats();
string token;
if (lex.eatLine()) {
int InsetFloatList::latex(odocstream & os, OutputParams const &) const
{
- FloatList const & floats = buffer().params().textClass().floats();
+ FloatList const & floats = buffer().params().documentClass().floats();
FloatList::const_iterator cit = floats[to_ascii(getParam("type"))];
if (cit != floats.end()) {
void InsetFoot::updateLabels(ParIterator const & it)
{
- TextClass const & tclass = buffer().params().textClass();
+ DocumentClass const & tclass = buffer().params().documentClass();
Counters & cnts = tclass.counters();
docstring const foot = from_ascii("footnote");
Paragraph const & outer = it.paragraph();
"has textclass `%2$s'\n"
"while parent file has textclass `%3$s'."),
included_file.displayName(),
- from_utf8(tmp->params().textClass().name()),
- from_utf8(masterBuffer->params().textClass().name()));
+ from_utf8(tmp->params().documentClass().name()),
+ from_utf8(masterBuffer->params().documentClass().name()));
Alert::warning(_("Different textclasses"), text);
//return 0;
}
listings_label_.clear();
return;
}
- Counters & counters = buffer().params().textClass().counters();
+ Counters & counters = buffer().params().documentClass().counters();
docstring const cnt = from_ascii("listing");
listings_label_ = buffer().B_("Program Listing");
if (counters.hasCounter(cnt)) {
else if (name_ == "path")
setText(from_utf8(buffer().filePath()), bp.getFont(), false);
else if (name_ == "class")
- setText(from_utf8(bp.textClass().name()), bp.getFont(), false);
+ setText(from_utf8(bp.documentClass().name()), bp.getFont(), false);
else
setText(_("Unknown buffer info"), bp.getFont(), false);
break;
void InsetListings::updateLabels(ParIterator const & it)
{
- Counters & cnts = buffer().params().textClass().counters();
+ Counters & cnts = buffer().params().documentClass().counters();
string const saveflt = cnts.current_float();
// Tell to captions what the current float is
void InsetNote::updateLabels(ParIterator const & it)
{
- TextClass const & tclass = buffer().params().textClass();
+ DocumentClass const & tclass = buffer().params().documentClass();
Counters savecnt = tclass.counters();
InsetCollapsable::updateLabels(it);
tclass.counters() = savecnt;
inset(new InsetText(buffer.params()))
{
inset->setBuffer(const_cast<Buffer &>(buffer));
- inset->paragraphs().back().setLayout(buffer.params().textClass().emptyLayout());
+ inset->paragraphs().back().setLayout(buffer.params().documentClass().emptyLayout());
}
cur.push(*inset);
// undo information has already been recorded
inset->getText(0)->setLayout(cur.bv().buffer(), 0, cur.lastpit() + 1,
- bp.textClass().emptyLayoutName());
+ bp.documentClass().emptyLayoutName());
cur.pop();
}
void InsetTabular::updateLabels(ParIterator const & it)
{
// In a longtable, tell captions what the current float is
- Counters & cnts = buffer().params().textClass().counters();
+ Counters & cnts = buffer().params().documentClass().counters();
string const saveflt = cnts.current_float();
if (tabular.isLongTabular())
cnts.current_float("table");
{
paragraphs().push_back(Paragraph());
Paragraph & ourpar = paragraphs().back();
- ourpar.setEmptyOrDefaultLayout(bp.textClass());
+ ourpar.setEmptyOrDefaultLayout(bp.documentClass());
ourpar.setInsetOwner(this);
}
void InsetWrap::updateLabels(ParIterator const & it)
{
- Counters & cnts = buffer().params().textClass().counters();
+ Counters & cnts = buffer().params().documentClass().counters();
string const saveflt = cnts.current_float();
// Tell to captions what the current float is
ParagraphList::const_iterator const & pbegin,
ParagraphList::const_iterator const & pend)
{
- LayoutPtr const & defaultstyle = buf.params().textClass().defaultLayout();
+ LayoutPtr const & defaultstyle = buf.params().documentClass().defaultLayout();
for (ParagraphList::const_iterator par = pbegin; par != pend; ++par) {
if (par != pbegin)
os << '\n';
ParagraphList::const_iterator const & pend) {
ParagraphList::const_iterator par = pbegin;
- LayoutPtr const & defaultstyle = buf.params().textClass().defaultLayout();
+ LayoutPtr const & defaultstyle = buf.params().documentClass().defaultLayout();
LayoutPtr const & bstyle = par->layout();
string item_tag;
BufferParams const & bparams = buf.params();
LayoutPtr const & style = pit->forceEmptyLayout() ?
- bparams.textClass().emptyLayout() : pit->layout();
+ bparams.documentClass().emptyLayout() : pit->layout();
ParagraphList const & paragraphs = text.paragraphs();
// In an inset with unlimited length (all in one row),
// force layout to default
LayoutPtr const style = pit->forceEmptyLayout() ?
- bparams.textClass().emptyLayout() : pit->layout();
+ bparams.documentClass().emptyLayout() : pit->layout();
OutputParams runparams = runparams_in;
runparams.moving_arg |= style->needprotect;
}
}
- bool const useSetSpace = bparams.textClass().provides("SetSpace");
+ bool const useSetSpace = bparams.documentClass().provides("SetSpace");
if (pit->allowParagraphCustomization()) {
if (pit->params().startOfAppendix()) {
os << "\\appendix\n";
bool was_title = false;
bool already_title = false;
BufferParams const & bparams = buf.params();
- TextClass const & tclass = bparams.textClass();
+ DocumentClass const & tclass = bparams.documentClass();
ParagraphList const & paragraphs = text.paragraphs();
ParagraphList::const_iterator par = paragraphs.begin();
ParagraphList::const_iterator endpar = paragraphs.end();
tmp->setInsetOwner(par.inInset());
// without doing that we get a crash when typing <Return> at the
// end of a paragraph
- tmp->setEmptyOrDefaultLayout(bparams.textClass());
+ tmp->setEmptyOrDefaultLayout(bparams.documentClass());
// layout stays the same with latex-environments
if (keep_layout) {
par.params().clear();
// do not lose start of appendix marker (bug 4212)
par.params().startOfAppendix(soa);
- par.setEmptyOrDefaultLayout(bparams.textClass());
+ par.setEmptyOrDefaultLayout(bparams.documentClass());
}
// layout stays the same with latex-environments
// and adds a number for uniqueness.
// If you know what you are doing, you can set allowed==""
// to disable this mangling.
- TextClass const & tclass = buf.params().textClass();
+ DocumentClass const & tclass = buf.params().documentClass();
docstring const allowed = from_ascii(
runparams.flavor == OutputParams::XML ? ".-_:" : tclass.options());
LayoutPtr const & style = par.layout();
string const & name = style->latexname();
string param = style->latexparam();
- Counters & counters = buf.params().textClass().counters();
+ Counters & counters = buf.params().documentClass().counters();
string id = par.getID(buf, runparams);