Andre's s/getTextClass/textClass/ cleanup.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23190 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2008-02-24 15:06:35 +00:00
parent 2e7d1199df
commit 0362c6aae7
43 changed files with 119 additions and 119 deletions

View File

@ -1187,19 +1187,19 @@ void Buffer::writeLaTeXSource(odocstream & os,
bool Buffer::isLatex() const
{
return params().getTextClass().outputType() == LATEX;
return params().textClass().outputType() == LATEX;
}
bool Buffer::isLiterate() const
{
return params().getTextClass().outputType() == LITERATE;
return params().textClass().outputType() == LITERATE;
}
bool Buffer::isDocBook() const
{
return params().getTextClass().outputType() == DOCBOOK;
return params().textClass().outputType() == DOCBOOK;
}
@ -1230,7 +1230,7 @@ void Buffer::writeDocBookSource(odocstream & os, string const & fname,
d->texrow.reset();
TextClass const & tclass = params().getTextClass();
TextClass const & tclass = params().textClass();
string const top_element = tclass.latexname();
if (!only_body) {
@ -1285,7 +1285,7 @@ void Buffer::writeDocBookSource(odocstream & os, string const & fname,
<< " file was created by LyX " << lyx_version
<< "\n See http://www.lyx.org/ for more information -->\n";
params().getTextClass().counters().reset();
params().textClass().counters().reset();
loadChildDocuments();
@ -2536,7 +2536,7 @@ vector<Format const *> Buffer::exportableFormats(bool only_viewable) const
vector<string> Buffer::backends() const
{
vector<string> v;
if (params().getTextClass().isTeXClassAvailable()) {
if (params().textClass().isTeXClassAvailable()) {
v.push_back(bufferFormat());
// FIXME: Don't hardcode format names here, but use a flag
if (v.back() == "latex")

View File

@ -482,7 +482,7 @@ string const BufferParams::readToken(Lexer & lex, string const & token,
// 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 (!getTextClass().isTeXClassAvailable()) {
if (!textClass().isTeXClassAvailable()) {
docstring const msg =
bformat(_("The layout file requested by this document,\n"
"%1$s.layout,\n"
@ -819,7 +819,7 @@ void BufferParams::writeFile(ostream & os) const
void BufferParams::validate(LaTeXFeatures & features) const
{
features.require(getTextClass().requires());
features.require(textClass().requires());
if (outputChanges) {
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
@ -861,7 +861,7 @@ void BufferParams::validate(LaTeXFeatures & features) const
// AMS Style is at document level
if (use_amsmath == package_on
|| getTextClass().provides("amsmath"))
|| textClass().provides("amsmath"))
features.require("amsmath");
if (use_esint == package_on)
features.require("esint");
@ -902,7 +902,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
{
os << "\\documentclass";
TextClass const & tclass = getTextClass();
TextClass const & tclass = textClass();
ostringstream clsoptions; // the document class options.
@ -1243,7 +1243,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
// hyperref, see
// http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129680.html
if (language->lang() == "japanese-plain" &&
!getTextClass().provides("japanese")) {
!textClass().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";
@ -1261,7 +1261,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
// use hyperref explicitely when it is required
if (features.isRequired("hyperref")) {
odocstringstream oss;
pdfoptions().writeLaTeX(oss, getTextClass().provides("hyperref"));
pdfoptions().writeLaTeX(oss, textClass().provides("hyperref"));
lyxpreamble += oss.str();
}
@ -1370,13 +1370,13 @@ bool BufferParams::hasClassDefaults() const
}
TextClass const & BufferParams::getTextClass() const
TextClass const & BufferParams::textClass() const
{
return *textClass_;
}
TextClassPtr BufferParams::getTextClassPtr() const {
TextClassPtr BufferParams::textClassPtr() const {
return textClass_;
}
@ -1475,7 +1475,7 @@ void BufferParams::clearLayoutModules() {
Font const BufferParams::getFont() const
{
FontInfo f = getTextClass().defaultfont();
FontInfo f = textClass().defaultfont();
if (fontsDefaultFamily == "rmdefault")
f.setFamily(ROMAN_FAMILY);
else if (fontsDefaultFamily == "sfdefault")
@ -1922,7 +1922,7 @@ biblio::CiteEngine BufferParams::getEngine() const
{
// FIXME the class should provide the numerical/
// authoryear choice
if (getTextClass().provides("natbib")
if (textClass().provides("natbib")
&& cite_engine_ != biblio::ENGINE_NATBIB_NUMERICAL)
return biblio::ENGINE_NATBIB_AUTHORYEAR;
return cite_engine_;

View File

@ -117,10 +117,10 @@ public:
void makeTextClass();
/// Returns the TextClass currently in use: the BaseClass as modified
/// by modules.
TextClass const & getTextClass() const;
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 getTextClassPtr() const;
TextClassPtr textClassPtr() 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().

View File

@ -1887,7 +1887,7 @@ void BufferView::insertLyXFile(FileName const & fname)
el = buf.errorList("Parse");
buffer_.undo().recordUndo(d->cursor_);
cap::pasteParagraphList(d->cursor_, buf.paragraphs(),
buf.params().getTextClassPtr(), el);
buf.params().textClassPtr(), el);
res = _("Document %1$s inserted.");
} else {
res = _("Could not insert document %1$s");

View File

@ -120,7 +120,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
// Make a copy of the CaP paragraphs.
ParagraphList insertion = parlist;
TextClassPtr const tc = buffer.params().getTextClassPtr();
TextClassPtr const tc = buffer.params().textClassPtr();
// Now remove all out of the pars which is NOT allowed in the
// new environment and set also another font if that is required.
@ -148,7 +148,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
// supposed to be the default, not just if it is forced
if (cur.inset().useEmptyLayout()) {
LayoutPtr const layout =
buffer.params().getTextClass().emptyLayout();
buffer.params().textClass().emptyLayout();
ParagraphList::iterator const end = insertion.end();
for (ParagraphList::iterator par = insertion.begin();
par != end; ++par)
@ -518,7 +518,7 @@ void cutSelection(Cursor & cur, bool doclear, bool realcut)
text->paragraphs(),
begpit, endpit,
cur.selBegin().pos(), endpos,
bp.getTextClassPtr(), theCuts);
bp.textClassPtr(), theCuts);
// Stuff what we got on the clipboard.
// Even if there is no selection.
putClipboard(theCuts[0].first, theCuts[0].second,
@ -602,7 +602,7 @@ void copySelectionToStack(Cursor & cur, CutStack & cutstack)
copySelectionHelper(cur.buffer(), pars, par, cur.selEnd().pit(),
pos, cur.selEnd().pos(),
cur.buffer().params().getTextClassPtr(), cutstack);
cur.buffer().params().textClassPtr(), cutstack);
dirtyTabularStack(false);
}
@ -611,10 +611,10 @@ void copySelectionToStack(Cursor & cur, CutStack & cutstack)
ParagraphList pars;
Paragraph par;
BufferParams const & bp = cur.buffer().params();
par.setLayout(bp.getTextClass().defaultLayout());
par.setLayout(bp.textClass().defaultLayout());
par.insert(0, grabSelection(cur), Font(), Change(Change::UNCHANGED));
pars.push_back(par);
cutstack.push(make_pair(pars, bp.getTextClassPtr()));
cutstack.push(make_pair(pars, bp.textClassPtr()));
}
}
@ -638,10 +638,10 @@ void copySelection(Cursor & cur, docstring const & plaintext)
ParagraphList pars;
Paragraph par;
BufferParams const & bp = cur.buffer().params();
par.setLayout(bp.getTextClass().defaultLayout());
par.setLayout(bp.textClass().defaultLayout());
par.insert(0, plaintext, Font(), Change(Change::UNCHANGED));
pars.push_back(par);
theCuts.push(make_pair(pars, bp.getTextClassPtr()));
theCuts.push(make_pair(pars, bp.textClassPtr()));
} else {
copySelectionToStack(cur, theCuts);
}
@ -746,7 +746,7 @@ void pasteClipboardText(Cursor & cur, ErrorList & errorList, bool asParagraphs)
if (buffer.readString(lyx)) {
cur.recordUndo();
pasteParagraphList(cur, buffer.paragraphs(),
buffer.params().getTextClassPtr(), errorList);
buffer.params().textClassPtr(), errorList);
cur.setSelection();
return;
}

View File

@ -375,7 +375,7 @@ void LaTeXFeatures::useLayout(docstring const & layoutname)
return;
}
TextClass const & tclass = params_.getTextClass();
TextClass const & tclass = params_.textClass();
if (tclass.hasLayout(layoutname)) {
// Is this layout already in usedLayouts?
if (find(usedLayouts_.begin(), usedLayouts_.end(), layoutname)
@ -409,7 +409,7 @@ bool LaTeXFeatures::isRequired(string const & name) const
bool LaTeXFeatures::mustProvide(string const & name) const
{
return isRequired(name) && !params_.getTextClass().provides(name);
return isRequired(name) && !params_.textClass().provides(name);
}
@ -439,7 +439,7 @@ void LaTeXFeatures::useFloat(string const & 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_.getTextClass().floats().getType(name);
Floating const & fl = params_.textClass().floats().getType(name);
if (!fl.type().empty() && !fl.builtin()) {
require("float");
}
@ -555,7 +555,7 @@ int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
string const LaTeXFeatures::getPackages() const
{
ostringstream packages;
TextClass const & tclass = params_.getTextClass();
TextClass const & tclass = params_.textClass();
// FIXME: currently, we can only load packages and macros known
// to LyX.
@ -828,7 +828,7 @@ string const LaTeXFeatures::getBabelOptions() const
docstring const LaTeXFeatures::getTClassPreamble() const
{
// the text class specific preamble
TextClass const & tclass = params_.getTextClass();
TextClass const & tclass = params_.textClass();
odocstringstream tcpreamble;
tcpreamble << tclass.preamble();
@ -903,7 +903,7 @@ BufferParams const & LaTeXFeatures::bufferParams() const
void LaTeXFeatures::getFloatDefinitions(ostream & os) const
{
FloatList const & floats = params_.getTextClass().floats();
FloatList const & floats = params_.textClass().floats();
// Here we will output the code to create the needed float styles.
// We will try to do this as minimal as possible.

View File

@ -1536,7 +1536,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
Buffer * buffer = lyx_view_->buffer();
TextClassPtr oldClass = buffer->params().getTextClassPtr();
TextClassPtr oldClass = buffer->params().textClassPtr();
Cursor & cur = view()->cursor();
cur.recordUndoFullDocument();
@ -1580,7 +1580,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
case LFUN_LAYOUT_MODULES_CLEAR: {
BOOST_ASSERT(lyx_view_);
Buffer * buffer = lyx_view_->buffer();
TextClassPtr oldClass = buffer->params().getTextClassPtr();
TextClassPtr oldClass = buffer->params().textClassPtr();
view()->cursor().recordUndoFullDocument();
buffer->params().clearLayoutModules();
buffer->params().makeTextClass();
@ -1592,7 +1592,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
case LFUN_LAYOUT_MODULE_ADD: {
BOOST_ASSERT(lyx_view_);
Buffer * buffer = lyx_view_->buffer();
TextClassPtr oldClass = buffer->params().getTextClassPtr();
TextClassPtr oldClass = buffer->params().textClassPtr();
view()->cursor().recordUndoFullDocument();
buffer->params().addLayoutModule(argument);
buffer->params().makeTextClass();
@ -1621,7 +1621,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
break;
//Save the old, possibly modular, layout for use in conversion.
TextClassPtr oldClass = buffer->params().getTextClassPtr();
TextClassPtr oldClass = buffer->params().textClassPtr();
view()->cursor().recordUndoFullDocument();
buffer->params().setBaseClass(new_class);
buffer->params().makeTextClass();
@ -1633,7 +1633,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
case LFUN_LAYOUT_RELOAD: {
BOOST_ASSERT(lyx_view_);
Buffer * buffer = lyx_view_->buffer();
TextClassPtr oldClass = buffer->params().getTextClassPtr();
TextClassPtr oldClass = buffer->params().textClassPtr();
textclass_type const tc = buffer->params().getBaseClass();
textclasslist.reset(tc);
buffer->params().setBaseClass(tc);
@ -1881,7 +1881,7 @@ void LyXFunc::updateLayout(TextClassPtr const & oldlayout,
StableDocIterator backcur(view()->cursor());
ErrorList & el = buffer->errorList("Class Switch");
cap::switchBetweenClasses(
oldlayout, buffer->params().getTextClassPtr(),
oldlayout, buffer->params().textClassPtr(),
static_cast<InsetText &>(buffer->inset()), el);
view()->setCursor(backcur.asDocIterator(&(buffer->inset())));

View File

@ -599,7 +599,7 @@ void expandFloatListInsert(Menu & tomenu, Buffer const * buf)
}
FloatList const & floats =
buf->params().getTextClass().floats();
buf->params().textClass().floats();
FloatList::const_iterator cit = floats.begin();
FloatList::const_iterator end = floats.end();
for (; cit != end; ++cit) {
@ -621,7 +621,7 @@ void expandFloatInsert(Menu & tomenu, Buffer const * buf)
}
FloatList const & floats =
buf->params().getTextClass().floats();
buf->params().textClass().floats();
FloatList::const_iterator cit = floats.begin();
FloatList::const_iterator end = floats.end();
for (; cit != end; ++cit) {
@ -643,7 +643,7 @@ void expandFlexInsert(Menu & tomenu, Buffer const * buf, string s)
return;
}
InsetLayouts const & insetLayouts =
buf->params().getTextClass().insetLayouts();
buf->params().textClass().insetLayouts();
InsetLayouts::const_iterator cit = insetLayouts.begin();
InsetLayouts::const_iterator end = insetLayouts.end();
for (; cit != end; ++cit) {
@ -743,7 +743,7 @@ void expandToc(Menu & tomenu, Buffer const * buf)
tomenu.add(MenuItem(MenuItem::Command, _("Master Document"), f));
}
FloatList const & floatlist = buf->params().getTextClass().floats();
FloatList const & floatlist = buf->params().textClass().floats();
TocList const & toc_list = buf->tocBackend().tocs();
TocList::const_iterator cit = toc_list.begin();
TocList::const_iterator end = toc_list.end();

View File

@ -1512,7 +1512,7 @@ docstring const Paragraph::translateIfPossible(docstring const & s,
docstring Paragraph::expandLabel(LayoutPtr const & layout,
BufferParams const & bparams, bool process_appendix) const
{
TextClass const & tclass = bparams.getTextClass();
TextClass const & tclass = bparams.textClass();
docstring fmt;
if (process_appendix && d->params_.appendix())
@ -1818,7 +1818,7 @@ bool Paragraph::latex(Buffer const & buf,
bool asdefault = forceEmptyLayout();
if (asdefault) {
style = bparams.getTextClass().defaultLayout();
style = bparams.textClass().defaultLayout();
} else {
style = d->layout_;
}

View File

@ -198,7 +198,7 @@ void ParagraphMetrics::dump() const
int ParagraphMetrics::rightMargin(BufferView const & bv) const
{
BufferParams const & params = bv.buffer().params();
TextClass const & tclass = params.getTextClass();
TextClass const & tclass = params.textClass();
frontend::FontMetrics const & fm = theFontMetrics(params.getFont());
int const r_margin =
bv.rightMargin()

View File

@ -96,7 +96,7 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
font = Font(inherit_font, bp.language);
change = Change(Change::UNCHANGED);
TextClass const & tclass = bp.getTextClass();
TextClass const & tclass = bp.textClass();
if (layoutname.empty())
layoutname = tclass.defaultLayoutName();
@ -125,12 +125,12 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
tclass.defaultLayoutName();
}
par.setLayout(bp.getTextClass()[layoutname]);
par.setLayout(bp.textClass()[layoutname]);
// Test whether the layout is obsolete.
LayoutPtr const & layout = par.layout();
if (!layout->obsoleted_by().empty())
par.setLayout(bp.getTextClass()[layout->obsoleted_by()]);
par.setLayout(bp.textClass()[layout->obsoleted_by()]);
par.params().read(lex);
@ -355,7 +355,7 @@ void Text::breakParagraph(Cursor & cur, bool inverse_logic)
Paragraph & cpar = cur.paragraph();
pit_type cpit = cur.pit();
TextClass const & tclass = cur.buffer().params().getTextClass();
TextClass const & tclass = cur.buffer().params().textClass();
LayoutPtr const & layout = cpar.layout();
// this is only allowed, if the current paragraph is not empty
@ -928,9 +928,9 @@ bool Text::handleBibitems(Cursor & cur)
// otherwise reset to default
if (par.useEmptyLayout())
cur.paragraph().setLayout(bufparams.getTextClass().emptyLayout());
cur.paragraph().setLayout(bufparams.textClass().emptyLayout());
else
cur.paragraph().setLayout(bufparams.getTextClass().defaultLayout());
cur.paragraph().setLayout(bufparams.textClass().defaultLayout());
return true;
}
@ -991,7 +991,7 @@ bool Text::backspacePos0(Cursor & cur)
bool needsUpdate = false;
BufferParams const & bufparams = cur.buffer().params();
TextClass const & tclass = bufparams.getTextClass();
TextClass const & tclass = bufparams.textClass();
ParagraphList & plist = cur.text()->paragraphs();
Paragraph const & par = cur.paragraph();
Cursor prevcur = cur;
@ -1116,7 +1116,7 @@ bool Text::dissolveInset(Cursor & cur) {
for (; it != it_end; it++)
it->changeLanguage(b.params(), latex_language, b.language());
pasteParagraphList(cur, plist, b.params().getTextClassPtr(),
pasteParagraphList(cur, plist, b.params().textClassPtr(),
b.errorList("Paste"));
// restore position
cur.pit() = min(cur.lastpit(), spit);

View File

@ -199,7 +199,7 @@ void Text::setLayout(Buffer const & buffer, pit_type start, pit_type end,
BOOST_ASSERT(start != end);
BufferParams const & bufparams = buffer.params();
LayoutPtr const & lyxlayout = bufparams.getTextClass()[layout];
LayoutPtr const & lyxlayout = bufparams.textClass()[layout];
for (pit_type pit = start; pit != end; ++pit) {
Paragraph & par = pars_[pit];
@ -218,7 +218,7 @@ void Text::setLayout(Cursor & cur, docstring const & layout)
// special handling of new environment insets
BufferView & bv = cur.bv();
BufferParams const & params = bv.buffer().params();
LayoutPtr const & lyxlayout = params.getTextClass()[layout];
LayoutPtr const & lyxlayout = params.textClass()[layout];
if (lyxlayout->is_environment) {
// move everything in a new environment inset
LYXERR(Debug::DEBUG, "setting layout " << to_utf8(layout));

View File

@ -220,7 +220,7 @@ static bool doInsertInset(Cursor & cur, Text * text,
if (insetText && !insetText->allowMultiPar() || cur.lastpit() == 0) {
// reset first par to default
cur.text()->paragraphs().begin()
->setEmptyOrDefaultLayout(bparams.getTextClass());
->setEmptyOrDefaultLayout(bparams.textClass());
cur.pos() = 0;
cur.pit() = 0;
// Merge multiple paragraphs -- hack
@ -229,8 +229,8 @@ static bool doInsertInset(Cursor & cur, Text * text,
} else {
// reset surrounding par to default
docstring const layoutname = insetText->useEmptyLayout()
? bparams.getTextClass().emptyLayoutName()
: bparams.getTextClass().defaultLayoutName();
? bparams.textClass().emptyLayoutName()
: bparams.textClass().defaultLayoutName();
cur.leaveInset(*inset);
text->setLayout(cur, layoutname);
}
@ -266,7 +266,7 @@ static void outline(OutlineOp mode, Cursor & cur)
ParagraphList::iterator finish = start;
ParagraphList::iterator end = pars.end();
TextClass const & tc = buf.params().getTextClass();
TextClass const & tc = buf.params().textClass();
int const thistoclevel = start->layout()->toclevel;
int toclevel;
@ -1011,7 +1011,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
Paragraph const & para = cur.paragraph();
docstring const old_layout = para.layout()->name();
TextClass const & tclass = bv->buffer().params().getTextClass();
TextClass const & tclass = bv->buffer().params().textClass();
if (layout.empty())
layout = tclass.defaultLayoutName();
@ -1384,7 +1384,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
cur.posForward();
ParagraphList & pars = cur.text()->paragraphs();
TextClass const & tclass = bv->buffer().params().getTextClass();
TextClass const & tclass = bv->buffer().params().textClass();
// add a separate paragraph for the caption inset
pars.push_back(Paragraph());
@ -1675,7 +1675,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
break;
case LFUN_FLOAT_LIST: {
TextClass const & tclass = bv->buffer().params().getTextClass();
TextClass const & tclass = bv->buffer().params().textClass();
if (tclass.floats().typeExist(to_utf8(cmd.argument()))) {
cur.recordUndo();
if (cur.selection())
@ -1946,7 +1946,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
case LFUN_FLEX_INSERT: {
code = FLEX_CODE;
string s = cmd.getArg(0);
InsetLayout il = cur.buffer().params().getTextClass().insetLayout(from_utf8(s));
InsetLayout il = cur.buffer().params().textClass().insetLayout(from_utf8(s));
if (il.lyxtype() != "charstyle" &&
il.lyxtype() != "custom" &&
il.lyxtype() != "element" &&

View File

@ -1764,7 +1764,7 @@ int TextMetrics::leftMargin(int max_width,
BOOST_ASSERT(pos <= par.size());
Buffer const & buffer = bv_->buffer();
//lyxerr << "TextMetrics::leftMargin: pit: " << pit << " pos: " << pos << endl;
TextClass const & tclass = buffer.params().getTextClass();
TextClass const & tclass = buffer.params().textClass();
LayoutPtr const & layout = par.layout();
docstring parindent = layout->parindent;

View File

@ -108,7 +108,7 @@ void TocBackend::updateItem(ParConstIterator const & par_it)
}
BufferParams const & bufparams = buffer_->params();
const int min_toclevel = bufparams.getTextClass().min_toclevel();
const int min_toclevel = bufparams.textClass().min_toclevel();
TocIterator toc_item = item("tableofcontents", par_it);
@ -147,7 +147,7 @@ void TocBackend::update()
tocs_.clear();
BufferParams const & bufparams = buffer_->params();
const int min_toclevel = bufparams.getTextClass().min_toclevel();
const int min_toclevel = bufparams.textClass().min_toclevel();
Toc & toc = tocs_["tableofcontents"];
ParConstIterator pit = buffer_->par_iterator_begin();

View File

@ -294,7 +294,7 @@ bool needEnumCounterReset(ParIterator const & it)
// set the label of a paragraph. This includes the counters.
void setLabel(Buffer const & buf, ParIterator & it)
{
TextClass const & textclass = buf.params().getTextClass();
TextClass const & textclass = buf.params().textClass();
Paragraph & par = it.paragraph();
LayoutPtr const & layout = par.layout();
Counters & counters = textclass.counters();
@ -482,7 +482,7 @@ void updateLabels(Buffer const & buf, bool childonly)
{
Buffer const * const master = buf.masterBuffer();
// Use the master text class also for child documents
TextClass const & textclass = master->params().getTextClass();
TextClass const & textclass = master->params().textClass();
if (!childonly) {
// If this is a child document start with the master

View File

@ -102,7 +102,7 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
case LFUN_FLEX_INSERT: {
string s = cmd.getArg(0);
return new InsetFlex(params, params.getTextClassPtr(), s);
return new InsetFlex(params, params.textClassPtr(), s);
}
case LFUN_NOTE_INSERT: {
@ -147,7 +147,7 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
case LFUN_FLOAT_INSERT: {
// check if the float type exists
string const argument = to_utf8(cmd.argument());
if (params.getTextClass().floats().typeExist(argument))
if (params.textClass().floats().typeExist(argument))
return new InsetFloat(params, argument);
lyxerr << "Non-existent float type: " << argument << endl;
}
@ -155,7 +155,7 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
case LFUN_FLOAT_WIDE_INSERT: {
// check if the float type exists
string const argument = to_utf8(cmd.argument());
if (params.getTextClass().floats().typeExist(argument)) {
if (params.textClass().floats().typeExist(argument)) {
auto_ptr<InsetFloat> p(new InsetFloat(params, argument));
p->wide(true, params);
return p.release();
@ -484,7 +484,7 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
lex.next();
string s = lex.getString();
inset.reset(new InsetFlex(buf.params(),
buf.params().getTextClassPtr(), s));
buf.params().textClassPtr(), s));
} else if (tmptok == "Branch") {
inset.reset(new InsetBranch(buf.params(),
InsetBranchParams()));

View File

@ -1354,7 +1354,7 @@ void GuiDocument::updateEmbeddedFileList()
void GuiDocument::updateNumbering()
{
TextClass const & tclass = bp_.getTextClass();
TextClass const & tclass = bp_.textClass();
numberingModule->tocTW->setUpdatesEnabled(false);
numberingModule->tocTW->clear();
@ -1441,7 +1441,7 @@ void GuiDocument::apply(BufferParams & params)
params.language = lyx::languages.getLanguage(lang_[pos]);
// numbering
if (params.getTextClass().hasTocLevels()) {
if (params.textClass().hasTocLevels()) {
params.tocdepth = numberingModule->tocSL->value();
params.secnumdepth = numberingModule->depthSL->value();
}

View File

@ -234,7 +234,7 @@ docstring GuiToc::guiName(string const & type) const
if (type == "note")
return _("List of Notes");
FloatList const & floats = buffer().params().getTextClass().floats();
FloatList const & floats = buffer().params().textClass().floats();
if (floats.typeExist(type))
return _(floats.getType(type).listName());

View File

@ -308,7 +308,7 @@ void GuiLayoutBox::updateContents(bool reset)
return;
}
TextClass const * text_class = &buffer->params().getTextClass();
TextClass const * text_class = &buffer->params().textClass();
Inset const * inset =
owner_.view()->cursor().innerParagraph().inInset();

View File

@ -361,7 +361,7 @@ bool Inset::covers(BufferView const & bv, int x, int y) const
InsetLayout const & Inset::getLayout(BufferParams const & bp) const
{
return bp.getTextClass().insetLayout(name());
return bp.textClass().insetLayout(name());
}

View File

@ -210,7 +210,7 @@ void InsetBibitem::fillWithBibKeys(Buffer const & buf,
/// Update the counters of this inset and of its contents
void InsetBibitem::updateLabels(Buffer const &buf, ParIterator const &)
{
Counters & counters = buf.params().getTextClass().counters();
Counters & counters = buf.params().textClass().counters();
docstring const bibitem = from_ascii("bibitem");
if (counters.hasCounter(bibitem) && getParam("label").empty()) {
counters.step(bibitem);

View File

@ -313,7 +313,7 @@ int InsetBibtex::latex(Buffer const & buffer, odocstream & os,
// 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().getTextClass().name(),
if (!contains(buffer.params().textClass().name(),
"art")) {
if (buffer.params().sides == OneSide) {
// oneside

View File

@ -89,7 +89,7 @@ InsetBox::InsetBox(BufferParams const & bp, string const & label)
: InsetCollapsable(bp), params_(label)
{
if (forceEmptyLayout())
paragraphs().back().setLayout(bp.getTextClass().emptyLayout());
paragraphs().back().setLayout(bp.textClass().emptyLayout());
}

View File

@ -225,7 +225,7 @@ void InsetBranch::updateLabels(Buffer const & buf, ParIterator const & it)
if (isBranchSelected(buf))
InsetCollapsable::updateLabels(buf, it);
else {
TextClass const & tclass = buf.params().getTextClass();
TextClass const & tclass = buf.params().textClass();
Counters savecnt = tclass.counters();
InsetCollapsable::updateLabels(buf, it);
tclass.counters() = savecnt;

View File

@ -57,14 +57,14 @@ InsetCaption::InsetCaption(InsetCaption const & ic)
InsetCaption::InsetCaption(BufferParams const & bp)
: InsetText(bp), textclass_(bp.getTextClass())
: InsetText(bp), textclass_(bp.textClass())
{
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.getTextClass().emptyLayout());
paragraphs().back().setLayout(bp.textClass().emptyLayout());
}
@ -278,7 +278,7 @@ int InsetCaption::getOptArg(Buffer const & buf, odocstream & os,
void InsetCaption::updateLabels(Buffer const & buf, ParIterator const & it)
{
TextClass const & tclass = buf.params().getTextClass();
TextClass const & tclass = buf.params().textClass();
Counters & cnts = tclass.counters();
string const & type = cnts.current_float();
// Memorize type for addToToc().

View File

@ -86,7 +86,7 @@ InsetCollapsable::InsetCollapsable(BufferParams const & bp,
setAutoBreakRows(true);
setDrawFrame(true);
setFrameColor(Color_collapsableframe);
paragraphs().back().setLayout(bp.getTextClass().emptyLayout());
paragraphs().back().setLayout(bp.textClass().emptyLayout());
}
@ -125,7 +125,7 @@ docstring InsetCollapsable::toolTip(BufferView const & bv, int x, int y) const
void InsetCollapsable::setLayout(BufferParams const & bp)
{
setLayout(bp.getTextClassPtr());
setLayout(bp.textClassPtr());
}
@ -796,7 +796,7 @@ void InsetCollapsable::setStatus(Cursor & cur, CollapseStatus status)
docstring InsetCollapsable::floatName(
string const & type, BufferParams const & bp) const
{
FloatList const & floats = bp.getTextClass().floats();
FloatList const & floats = bp.textClass().floats();
FloatList::const_iterator it = floats[type];
// FIXME UNICODE
return (it == floats.end()) ? from_ascii(type) : bp.B_(it->second.name());

View File

@ -119,7 +119,7 @@ void InsetERT::doDispatch(Cursor & cur, FuncRequest & cmd)
{
BufferParams const & bp = cur.buffer().params();
LayoutPtr const layout =
bp.getTextClass().emptyLayout();
bp.textClass().emptyLayout();
//lyxerr << "\nInsetERT::doDispatch (begin): cmd: " << cmd << endl;
switch (cmd.action) {

View File

@ -27,7 +27,7 @@ namespace lyx {
InsetEnvironment::InsetEnvironment
(BufferParams const & bp, docstring const & name)
: InsetText(bp), layout_(bp.getTextClass()[name]), name_(name)
: InsetText(bp), layout_(bp.textClass()[name]), name_(name)
{
setAutoBreakRows(true);
setDrawFrame(true);

View File

@ -175,7 +175,7 @@ bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
void InsetFloat::updateLabels(Buffer const & buf, ParIterator const & it)
{
Counters & cnts = buf.params().getTextClass().counters();
Counters & cnts = buf.params().textClass().counters();
string const saveflt = cnts.current_float();
// Tell to captions what the current float is
@ -283,7 +283,7 @@ docstring const InsetFloat::editMessage() const
int InsetFloat::latex(Buffer const & buf, odocstream & os,
OutputParams const & runparams) const
{
FloatList const & floats = buf.params().getTextClass().floats();
FloatList const & floats = buf.params().textClass().floats();
string tmptype = params_.type;
if (params_.sideways)
tmptype = "sideways" + params_.type;

View File

@ -68,7 +68,7 @@ bool InsetFloatList::isCompatibleCommand(string const & s)
docstring const InsetFloatList::getScreenLabel(Buffer const & buf) const
{
FloatList const & floats = buf.params().getTextClass().floats();
FloatList const & floats = buf.params().textClass().floats();
FloatList::const_iterator it = floats[to_ascii(getParam("type"))];
if (it != floats.end())
return buf.B_(it->second.listName());
@ -85,7 +85,7 @@ void InsetFloatList::write(Buffer const &, ostream & os) const
void InsetFloatList::read(Buffer const & buf, Lexer & lex)
{
FloatList const & floats = buf.params().getTextClass().floats();
FloatList const & floats = buf.params().textClass().floats();
string token;
if (lex.eatLine()) {
@ -114,7 +114,7 @@ void InsetFloatList::read(Buffer const & buf, Lexer & lex)
int InsetFloatList::latex(Buffer const & buf, odocstream & os,
OutputParams const &) const
{
FloatList const & floats = buf.params().getTextClass().floats();
FloatList const & floats = buf.params().textClass().floats();
FloatList::const_iterator cit = floats[to_ascii(getParam("type"))];
if (cit != floats.end()) {

View File

@ -59,7 +59,7 @@ docstring const InsetFoot::editMessage() const
void InsetFoot::updateLabels(Buffer const & buf, ParIterator const & it)
{
TextClass const & tclass = buf.params().getTextClass();
TextClass const & tclass = buf.params().textClass();
Counters & cnts = tclass.counters();
docstring const foot = from_ascii("footnote");
Paragraph const & outer = it.paragraph();

View File

@ -447,8 +447,8 @@ int InsetInclude::latex(Buffer const & buffer, odocstream & os,
"has textclass `%2$s'\n"
"while parent file has textclass `%3$s'."),
included_file.displayName(),
from_utf8(tmp->params().getTextClass().name()),
from_utf8(masterBuffer->params().getTextClass().name()));
from_utf8(tmp->params().textClass().name()),
from_utf8(masterBuffer->params().textClass().name()));
Alert::warning(_("Different textclasses"), text);
//return 0;
}
@ -902,7 +902,7 @@ void InsetInclude::updateLabels(Buffer const & buffer, ParIterator const &)
listings_label_.clear();
return;
}
Counters & counters = buffer.params().getTextClass().counters();
Counters & counters = buffer.params().textClass().counters();
docstring const cnt = from_ascii("listing");
listings_label_ = buffer.B_("Program Listing");
if (counters.hasCounter(cnt)) {

View File

@ -242,7 +242,7 @@ void InsetInfo::updateInfo(Buffer const & buf)
else if (name_ == "path")
setText(from_utf8(buf.filePath()), bp.getFont(), false);
else if (name_ == "class")
setText(from_utf8(bp.getTextClass().name()), bp.getFont(), false);
setText(from_utf8(bp.textClass().name()), bp.getFont(), false);
else
setText(_("Unknown buffer info"), bp.getFont(), false);
break;

View File

@ -71,7 +71,7 @@ Inset::DisplayType InsetListings::display() const
void InsetListings::updateLabels(Buffer const & buf, ParIterator const & it)
{
Counters & cnts = buf.params().getTextClass().counters();
Counters & cnts = buf.params().textClass().counters();
string const saveflt = cnts.current_float();
// Tell to captions what the current float is

View File

@ -213,7 +213,7 @@ bool InsetNote::getStatus(Cursor & cur, FuncRequest const & cmd,
void InsetNote::updateLabels(Buffer const & buf, ParIterator const & it)
{
TextClass const & tclass = buf.params().getTextClass();
TextClass const & tclass = buf.params().textClass();
Counters savecnt = tclass.counters();
InsetCollapsable::updateLabels(buf, it);
tclass.counters() = savecnt;

View File

@ -486,7 +486,7 @@ Tabular::cellstruct::cellstruct(BufferParams const & bp)
rotate(false),
inset(new InsetText(bp))
{
inset->paragraphs().back().setLayout(bp.getTextClass().emptyLayout());
inset->paragraphs().back().setLayout(bp.textClass().emptyLayout());
}
@ -1093,7 +1093,7 @@ void toggleFixedWidth(Cursor & cur, InsetText * inset, bool fixedWidth)
cur.push(*inset);
// undo information has already been recorded
inset->getText(0)->setLayout(cur.bv().buffer(), 0, cur.lastpit() + 1,
bp.getTextClass().emptyLayoutName());
bp.textClass().emptyLayoutName());
cur.pop();
}
@ -3177,7 +3177,7 @@ void InsetTabular::edit(Cursor & cur, bool front, EntryDirection)
void InsetTabular::updateLabels(Buffer const & buf, ParIterator const & it)
{
// In a longtable, tell captions what the current float is
Counters & cnts = buf.params().getTextClass().counters();
Counters & cnts = buf.params().textClass().counters();
string const saveflt = cnts.current_float();
if (tabular.isLongTabular())
cnts.current_float("table");

View File

@ -100,7 +100,7 @@ InsetText::InsetText(BufferParams const & bp)
{
paragraphs().push_back(Paragraph());
Paragraph & ourpar = paragraphs().back();
ourpar.setEmptyOrDefaultLayout(bp.getTextClass());
ourpar.setEmptyOrDefaultLayout(bp.textClass());
ourpar.setInsetOwner(this);
}

View File

@ -107,7 +107,7 @@ bool InsetWrap::getStatus(Cursor & cur, FuncRequest const & cmd,
void InsetWrap::updateLabels(Buffer const & buf, ParIterator const & it)
{
Counters & cnts = buf.params().getTextClass().counters();
Counters & cnts = buf.params().textClass().counters();
string const saveflt = cnts.current_float();
// Tell to captions what the current float is

View File

@ -103,7 +103,7 @@ ParagraphList::const_iterator makeParagraph(Buffer const & buf,
ParagraphList::const_iterator const & pend)
{
LayoutPtr const & defaultstyle =
buf.params().getTextClass().defaultLayout();
buf.params().textClass().defaultLayout();
for (ParagraphList::const_iterator par = pbegin; par != pend; ++par) {
if (par != pbegin)
os << '\n';
@ -127,7 +127,7 @@ ParagraphList::const_iterator makeEnvironment(Buffer const & buf,
ParagraphList::const_iterator const & pend) {
ParagraphList::const_iterator par = pbegin;
LayoutPtr const & defaultstyle = buf.params().getTextClass().defaultLayout();
LayoutPtr const & defaultstyle = buf.params().textClass().defaultLayout();
LayoutPtr const & bstyle = par->layout();
string item_tag;

View File

@ -109,7 +109,7 @@ TeXEnvironment(Buffer const & buf,
BufferParams const & bparams = buf.params();
LayoutPtr const & style = pit->forceEmptyLayout() ?
bparams.getTextClass().emptyLayout() :
bparams.textClass().emptyLayout() :
pit->layout();
ParagraphList const & paragraphs = text.paragraphs();
@ -310,7 +310,7 @@ TeXOnePar(Buffer const & buf,
// In an inset with unlimited length (all in one row),
// force layout to default
LayoutPtr const style = pit->forceEmptyLayout() ?
bparams.getTextClass().emptyLayout() :
bparams.textClass().emptyLayout() :
pit->layout();
OutputParams runparams = runparams_in;
@ -479,7 +479,7 @@ TeXOnePar(Buffer const & buf,
}
}
bool const useSetSpace = bparams.getTextClass().provides("SetSpace");
bool const useSetSpace = bparams.textClass().provides("SetSpace");
if (pit->allowParagraphCustomization()) {
if (pit->params().startOfAppendix()) {
os << "\\appendix\n";
@ -745,7 +745,7 @@ void latexParagraphs(Buffer const & buf,
bool was_title = false;
bool already_title = false;
BufferParams const & bparams = buf.params();
TextClass const & tclass = bparams.getTextClass();
TextClass const & tclass = bparams.textClass();
ParagraphList const & paragraphs = text.paragraphs();
ParagraphList::const_iterator par = paragraphs.begin();
ParagraphList::const_iterator endpar = paragraphs.end();

View File

@ -77,9 +77,9 @@ void breakParagraph(BufferParams const & bparams,
// without doing that we get a crash when typing <Return> at the
// end of a paragraph
if (par.useEmptyLayout())
tmp->setLayout(bparams.getTextClass().emptyLayout());
tmp->setLayout(bparams.textClass().emptyLayout());
else
tmp->setLayout(bparams.getTextClass().defaultLayout());
tmp->setLayout(bparams.textClass().defaultLayout());
// layout stays the same with latex-environments
if (keep_layout) {
@ -144,7 +144,7 @@ void breakParagraph(BufferParams const & bparams,
par.params().clear();
// do not lose start of appendix marker (bug 4212)
par.params().startOfAppendix(soa);
par.setLayout(bparams.getTextClass().defaultLayout());
par.setLayout(bparams.textClass().defaultLayout());
}
// layout stays the same with latex-environments

View File

@ -121,7 +121,7 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams,
// 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().getTextClass();
TextClass const & tclass = buf.params().textClass();
docstring const allowed = from_ascii(
runparams.flavor == OutputParams::XML? ".-_:":tclass.options());
@ -204,7 +204,7 @@ void sgml::openTag(Buffer const & buf, odocstream & os,
LayoutPtr const & style = par.layout();
string const & name = style->latexname();
string param = style->latexparam();
Counters & counters = buf.params().getTextClass().counters();
Counters & counters = buf.params().textClass().counters();
string id = par.getID(buf, runparams);