]> git.lyx.org Git - lyx.git/commitdiff
Remove TextClassPtr without losing the type safety it provided.
authorRichard Heck <rgheck@comcast.net>
Thu, 28 Feb 2008 01:42:02 +0000 (01:42 +0000)
committerRichard Heck <rgheck@comcast.net>
Thu, 28 Feb 2008 01:42:02 +0000 (01:42 +0000)
See these threads:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg136112.html
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg136062.html
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg135997.html
for some background.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23299 a592a061-630c-0410-9148-cb99ea01b6c8

54 files changed:
development/scons/scons_manifest.py
src/Buffer.cpp
src/BufferParams.cpp
src/BufferParams.h
src/BufferView.cpp
src/CutAndPaste.cpp
src/CutAndPaste.h
src/LaTeXFeatures.cpp
src/LyXFunc.cpp
src/LyXFunc.h
src/Makefile.am
src/MenuBackend.cpp
src/Paragraph.cpp
src/ParagraphMetrics.cpp
src/Text.cpp
src/Text2.cpp
src/Text3.cpp
src/TextClass.cpp
src/TextClass.h
src/TextClassPtr.h [deleted file]
src/TextMetrics.cpp
src/TocBackend.cpp
src/buffer_funcs.cpp
src/factory.cpp
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiToc.cpp
src/frontends/qt4/GuiToolbar.cpp
src/frontends/qt4/GuiToolbars.h
src/insets/Inset.cpp
src/insets/InsetBibitem.cpp
src/insets/InsetBibtex.cpp
src/insets/InsetBox.cpp
src/insets/InsetBranch.cpp
src/insets/InsetCaption.cpp
src/insets/InsetCollapsable.cpp
src/insets/InsetCollapsable.h
src/insets/InsetERT.cpp
src/insets/InsetEnvironment.cpp
src/insets/InsetFlex.cpp
src/insets/InsetFlex.h
src/insets/InsetFloat.cpp
src/insets/InsetFloatList.cpp
src/insets/InsetFoot.cpp
src/insets/InsetInclude.cpp
src/insets/InsetInfo.cpp
src/insets/InsetListings.cpp
src/insets/InsetNote.cpp
src/insets/InsetTabular.cpp
src/insets/InsetText.cpp
src/insets/InsetWrap.cpp
src/output_docbook.cpp
src/output_latex.cpp
src/paragraph_funcs.cpp
src/sgml.cpp

index 485d5ae27ac6f8807d434a6d69e6a3a8c56149ee..5314186d112dfc8e26ebdcf227b89c8523152c81 100644 (file)
@@ -113,7 +113,6 @@ src_header_files = Split('''
     TexRow.h
     Text.h
     TextClass.h
-    TextClassPtr.h
     TextMetrics.h
     Thesaurus.h
     TocBackend.h
index 3a6109c6c3e92aa38dfeb7f46b631928fe604f92..2031d6a66f4bb054a3ad00a707d5c9fe2a7274a7 100644 (file)
@@ -522,7 +522,7 @@ int Buffer::readHeader(Lexer & lex)
                        s, -1, 0, 0));
        }
        
-       params().makeTextClass();
+       params().makeDocumentClass();
 
        return unknown_tokens;
 }
@@ -1186,19 +1186,19 @@ void Buffer::writeLaTeXSource(odocstream & os,
 
 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;
 }
 
 
@@ -1229,7 +1229,7 @@ void Buffer::writeDocBookSource(odocstream & os, string const & fname,
 
        d->texrow.reset();
 
-       TextClass const & tclass = params().textClass();
+       DocumentClass const & tclass = params().documentClass();
        string const top_element = tclass.latexname();
 
        if (!only_body) {
@@ -1284,7 +1284,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().textClass().counters().reset();
+       params().documentClass().counters().reset();
 
        loadChildDocuments();
 
@@ -2535,7 +2535,7 @@ vector<Format const *> Buffer::exportableFormats(bool only_viewable) const
 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")
index bed6a23debbc926245ed09d0cf26c809e7073127..14389a7f7a141f545cf1aebba771f3a505547554 100644 (file)
@@ -315,7 +315,7 @@ BufferParams::BufferParams()
        : pimpl_(new Impl)
 {
        setBaseClass(defaultBaseclass());
-       makeTextClass();
+       makeDocumentClass();
        paragraph_separation = PARSEP_INDENT;
        quotes_language = InsetQuotes::EnglishQ;
        fontsize = "default";
@@ -483,7 +483,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 (!textClass().isTeXClassAvailable()) {
+               if (!documentClass().isTeXClassAvailable()) {
                        docstring const msg =
                                bformat(_("The layout file requested by this document,\n"
                                                 "%1$s.layout,\n"
@@ -820,7 +820,7 @@ void BufferParams::writeFile(ostream & os) const
 
 void BufferParams::validate(LaTeXFeatures & features) const
 {
-       features.require(textClass().requires());
+       features.require(documentClass().requires());
 
        if (outputChanges) {
                bool dvipost    = LaTeXFeatures::isAvailable("dvipost");
@@ -862,7 +862,7 @@ void BufferParams::validate(LaTeXFeatures & features) const
 
        // 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");
@@ -903,7 +903,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
 {
        os << "\\documentclass";
 
-       TextClass const & tclass = textClass();
+       DocumentClass const & tclass = documentClass();
 
        ostringstream clsoptions; // the document class options.
 
@@ -1244,7 +1244,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" &&
-               !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";
@@ -1262,7 +1262,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features,
        // 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();
        }
 
@@ -1371,19 +1371,20 @@ bool BufferParams::hasClassDefaults() const
 }
 
 
-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);
 }
 
 
@@ -1408,9 +1409,9 @@ BaseClassIndex BufferParams::baseClass() const
 }
 
 
-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 
@@ -1427,7 +1428,7 @@ void BufferParams::makeTextClass()
                                        "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;
@@ -1440,7 +1441,7 @@ void BufferParams::makeTextClass()
                        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);
@@ -1479,7 +1480,7 @@ void BufferParams::clearLayoutModules()
 
 Font const BufferParams::getFont() const
 {
-       FontInfo f = textClass().defaultfont();
+       FontInfo f = documentClass().defaultfont();
        if (fontsDefaultFamily == "rmdefault")
                f.setFamily(ROMAN_FAMILY);
        else if (fontsDefaultFamily == "sfdefault")
@@ -1929,7 +1930,7 @@ biblio::CiteEngine BufferParams::getEngine() const
 {
        // 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_;
index 35089e1858e0f2daf6705e5dd03958e1dbfccd26..c8fe76fe63cbb50a476b3ce848a9c38111ca1d4b 100644 (file)
@@ -18,7 +18,6 @@
 #include "Font.h"
 #include "BiblioInfo.h"
 #include "paper.h"
-#include "TextClassPtr.h"
 
 #include "insets/InsetQuotes.h"
 
@@ -36,6 +35,7 @@ class AuthorList;
 class BaseClassIndex;
 class BranchList;
 class Bullet;
+class DocumentClass;
 class Encoding;
 class Language;
 class Lexer;
@@ -109,27 +109,27 @@ public:
        ///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).
@@ -327,8 +327,8 @@ private:
 
        /// 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;
        /// 
index c6d5b6aee867f750751e7aac6fbbaa4aa80bb673..dbe396c0704ab5c678757c3ca2ab37f037497e72 100644 (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().textClassPtr(), el);
+                                            buf.params().documentClassPtr(), el);
                res = _("Document %1$s inserted.");
        } else {
                res = _("Could not insert document %1$s");
index 48453cdd632a53a1523c2f3f41c3b07dc4860bbc..975cf789c9f8ca3beee989df09b2a8539ca91598 100644 (file)
@@ -70,7 +70,7 @@ namespace {
 
 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
@@ -106,7 +106,7 @@ bool checkPastePossible(int index)
 
 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();
@@ -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().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.
@@ -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().textClass().emptyLayout();
+                       buffer.params().documentClass().emptyLayout();
                ParagraphList::iterator const end = insertion.end();
                for (ParagraphList::iterator par = insertion.begin();
                                par != end; ++par)
@@ -162,7 +162,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist,
        // 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();
@@ -317,15 +317,15 @@ PitPosPair eraseSelectionHelper(BufferParams const & params,
 }
 
 
-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);
@@ -336,7 +336,7 @@ void putClipboard(ParagraphList const & paragraphs, TextClassPtr textclass,
 
 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());
@@ -372,7 +372,8 @@ void copySelectionHelper(Buffer const & buf, ParagraphList & pars,
        // 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
@@ -392,8 +393,8 @@ docstring grabAndEraseSelection(Cursor & cur)
 }
 
 
-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();
 
@@ -401,8 +402,8 @@ void switchBetweenClasses(TextClassPtr const & oldone,
        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);
@@ -410,7 +411,9 @@ void switchBetweenClasses(TextClassPtr const & oldone,
                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());
@@ -518,7 +521,7 @@ void cutSelection(Cursor & cur, bool doclear, bool realcut)
                                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,
@@ -602,7 +605,7 @@ void copySelectionToStack(Cursor & cur, CutStack & cutstack)
 
                copySelectionHelper(cur.buffer(), pars, par, cur.selEnd().pit(),
                        pos, cur.selEnd().pos(), 
-                       cur.buffer().params().textClassPtr(), cutstack);
+                       cur.buffer().params().documentClassPtr(), cutstack);
                dirtyTabularStack(false);
        }
 
@@ -611,10 +614,11 @@ void copySelectionToStack(Cursor & cur, CutStack & cutstack)
                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()));
        }
 }
 
@@ -638,10 +642,10 @@ void copySelection(Cursor & cur, docstring const & plaintext)
                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);
        }
@@ -692,7 +696,7 @@ docstring selection(size_t sel_index)
 
 
 void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
-                       TextClassPtr textclass, ErrorList & errorList)
+                       DocumentClass const * const docclass, ErrorList & errorList)
 {
        if (cur.inTexted()) {
                Text * text = cur.text();
@@ -702,7 +706,7 @@ void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
                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);
@@ -745,7 +749,7 @@ void pasteClipboardText(Cursor & cur, ErrorList & errorList, bool asParagraphs)
                        if (buffer.readString(lyx)) {
                                cur.recordUndo();
                                pasteParagraphList(cur, buffer.paragraphs(),
-                                       buffer.params().textClassPtr(), errorList);
+                                       buffer.params().documentClassPtr(), errorList);
                                cur.setSelection();
                                return;
                        }
index 622ccf644bedb4f16a6a3b3ee8ba7d2cac9ae17b..3796966f0969ef1d22e1ae0f748414ec7da5a847 100644 (file)
@@ -14,8 +14,6 @@
 #ifndef CUTANDPASTE_H
 #define CUTANDPASTE_H
 
-#include "TextClassPtr.h"
-
 #include "support/docstring.h"
 
 #include "frontends/Clipboard.h"
@@ -26,6 +24,7 @@ using lyx::frontend::Clipboard;
 
 namespace lyx {
 
+class DocumentClass;
 class ErrorList;
 class InsetText;
 class Cursor;
@@ -100,15 +99,15 @@ void pasteFromStack(Cursor & cur, ErrorList & errorList, size_t sel_index);
 /// 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.
index 903b87c72244b05d53dc48e2027af5489aa0de17..7bd0944d3e6156c95e28626c0123c1234a45a0af 100644 (file)
@@ -375,7 +375,7 @@ void LaTeXFeatures::useLayout(docstring const & layoutname)
                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) 
@@ -409,7 +409,7 @@ bool LaTeXFeatures::isRequired(string const & name) const
 
 bool LaTeXFeatures::mustProvide(string const & name) const
 {
-       return isRequired(name) && !params_.textClass().provides(name);
+       return isRequired(name) && !params_.documentClass().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_.textClass().floats().getType(name);
+       Floating const & fl = params_.documentClass().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_.textClass();
+       DocumentClass const & tclass = params_.documentClass();
 
        // 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_.textClass();
+       DocumentClass const & tclass = params_.documentClass();
        odocstringstream tcpreamble;
 
        tcpreamble << tclass.preamble();
@@ -903,7 +903,7 @@ BufferParams const & LaTeXFeatures::bufferParams() const
 
 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.
index 717d686f1c33fb010c78757c442c3ca5a427fdd6..b5789e00690e05f0d38a4de4117ea477b96902da 100644 (file)
@@ -1539,7 +1539,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        
                        Buffer * buffer = lyx_view_->buffer();
 
-                       TextClassPtr oldClass = buffer->params().textClassPtr();
+                       DocumentClass * oldClass = buffer->params().documentClassPtr();
 
                        Cursor & cur = view()->cursor();
                        cur.recordUndoFullDocument();
@@ -1583,10 +1583,10 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                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;
@@ -1595,10 +1595,10 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                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;
@@ -1624,10 +1624,10 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                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;
@@ -1636,11 +1636,11 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                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;
@@ -1866,14 +1866,14 @@ bool LyXFunc::wasMetaKey() const
 }
 
 
-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())));
index a97d85b2c63706a86fe8087616d89b227e9b6a13..3b062b8f53b6baee93a9b0817007d3088da337b2 100644 (file)
@@ -17,7 +17,6 @@
 
 #include "KeySequence.h"
 #include "lfuns.h"
-#include "TextClassPtr.h"
 
 #include "support/docstring.h"
 
@@ -25,6 +24,7 @@ namespace lyx {
 
 class Buffer;
 class BufferView;
+class DocumentClass;
 class FuncRequest;
 class FuncStatus;
 class KeySymbol;
@@ -134,7 +134,7 @@ private:
        ///
        bool ensureBufferClean(BufferView * bv);
        ///
-       void updateLayout(TextClassPtr oldlayout, Buffer * buffer);
+       void updateLayout(DocumentClass * oldlayout, Buffer * buffer);
 };
 
 /// Implementation is in LyX.cpp
index e0162919481c38354fef4203d0bc1f83ee9307ea..c2119a170552a5d5461d04bf979e32401f1e7dd7 100644 (file)
@@ -262,7 +262,6 @@ HEADERFILESCORE = \
        TexStream.h \
        Text.h \
        TextClass.h \
-       TextClassPtr.h \
        TextMetrics.h \
        TocBackend.h \
        ToolbarBackend.h \
index 6e4f6a38fb4d8620ed56703f1e8f2193395a266c..df4de67b54a86b341a9bea3ce5eeef6577cc6321 100644 (file)
@@ -598,7 +598,7 @@ void expandFloatListInsert(Menu & tomenu, Buffer const * buf)
                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) {
@@ -619,7 +619,7 @@ void expandFloatInsert(Menu & tomenu, Buffer const * buf)
                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) {
@@ -641,7 +641,7 @@ void expandFlexInsert(Menu & tomenu, Buffer const * buf, string s)
                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) {
@@ -741,7 +741,7 @@ void expandToc(Menu & tomenu, Buffer const * buf)
                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();
index ada2517b3b358af70c1f67bb0ede656b1c058881..176ad2eec3e2284c5edda704de6a24021ad5b5b0 100644 (file)
@@ -1522,7 +1522,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.textClass();
+       DocumentClass const & tclass = bparams.documentClass();
 
        docstring fmt;
        if (process_appendix && d->params_.appendix())
@@ -1827,7 +1827,7 @@ bool Paragraph::latex(BufferParams const & bparams,
        bool asdefault = forceEmptyLayout();
 
        if (asdefault)
-               style = bparams.textClass().defaultLayout();
+               style = bparams.documentClass().emptyLayout();
         else
                style = d->layout_;
 
index b249f01d9bf0baa1359a891d0355f71bc9a0f2c1..12f387d18f37e3680a15b69552387a41cee41e99 100644 (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.textClass();
+       DocumentClass const & tclass = params.documentClass();
        frontend::FontMetrics const & fm = theFontMetrics(params.getFont());
        int const r_margin =
                bv.rightMargin()
index 7db3b5db2daf2227ab1b1125ab0f92302c24ab64..4d6df2e7d5c64b04fdef0ed7507b21d77dd695a8 100644 (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.textClass();
+               DocumentClass const & tclass = bp.documentClass();
 
                if (layoutname.empty())
                        layoutname = tclass.defaultLayoutName();
@@ -125,12 +125,12 @@ void readParToken(Buffer const & buf, Paragraph & par, Lexer & lex,
                                        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);
 
@@ -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().textClass();
+       DocumentClass const & tclass = cur.buffer().params().documentClass();
        LayoutPtr const & layout = cpar.layout();
 
        // this is only allowed, if the current paragraph is not empty
@@ -915,11 +915,7 @@ bool Text::handleBibitems(Cursor & cur)
        } 
 
        // 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());
 }
 
 
@@ -979,7 +975,7 @@ bool Text::backspacePos0(Cursor & cur)
        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;
@@ -1104,7 +1100,7 @@ bool Text::dissolveInset(Cursor & 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);
index 39300ba3f71160275004e73252326683b25c3c67..fa0ed179b30bbe775ac20737593e8fcdd8182078 100644 (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.textClass()[layout];
+       LayoutPtr const & lyxlayout = bufparams.documentClass()[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.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));
index 1a7f3f1b8baf0a8512fff56e6688ec0df9d68460..f40d37f8d86ce504f7a725550eb42b90f08ce959 100644 (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.textClass());
+                       ->setEmptyOrDefaultLayout(bparams.documentClass());
                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.textClass().emptyLayoutName()
-                       : bparams.textClass().defaultLayoutName();
+                       ? bparams.documentClass().emptyLayoutName()
+                       : bparams.documentClass().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().textClass();
+       DocumentClass const & tc = buf.params().documentClass();
 
        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().textClass();
+               DocumentClass const & tclass = bv->buffer().params().documentClass();
 
                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().textClass();
+               DocumentClass const & tclass = bv->buffer().params().documentClass();
 
                // 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().textClass();
+               DocumentClass const & tclass = bv->buffer().params().documentClass();
                if (tclass.floats().typeExist(to_utf8(cmd.argument()))) {
                        cur.recordUndo();
                        if (cur.selection())
@@ -1946,7 +1946,8 @@ 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().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" &&
index 740a4c336b5c703190e48e0830a522c7fe4ad446..a36e169072cbfe4408115ac24ed4a5f7ba8c1d74 100644 (file)
@@ -1131,28 +1131,24 @@ bool TextClass::hasTocLevels() const
 }
 
 
-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)
index 23175a2b9d0f520ee648a8c2a6ead1285e52d3a1..ff64c7d4d4b68a18dde014c8fb5a501efc71c20b 100644 (file)
@@ -14,7 +14,6 @@
 #include "FontInfo.h"
 #include "LayoutEnums.h"
 #include "LayoutPtr.h"
-#include "TextClassPtr.h"
 
 #include "insets/InsetLayout.h"
 
@@ -32,10 +31,10 @@ namespace lyx {
 
 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 
@@ -292,34 +291,44 @@ private:
 };
 
 
+/// 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_;
 };
 
 
diff --git a/src/TextClassPtr.h b/src/TextClassPtr.h
deleted file mode 100644 (file)
index 07e6a36..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// -*- 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
index db45eb842e6b54155d194b61782b2f9faa4e708b..74f8d29b8d1dca2b5d6eb9ff117f49a6f33e2912 100644 (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().textClass();
+       DocumentClass const & tclass = buffer.params().documentClass();
        LayoutPtr const & layout = par.layout();
 
        docstring parindent = layout->parindent;
index 77929a5f5d05615fe67f13dc77a5e60e3419e585..9e558aab3050a338c89e72f433b5b1cad1400c92 100644 (file)
@@ -108,7 +108,7 @@ void TocBackend::updateItem(ParConstIterator const & par_it)
        }
 
        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);
 
@@ -146,7 +146,7 @@ void TocBackend::update()
        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();
index 94dd94a00b86628f375ffe13db5c985b099db688..6c081b67c30313a15dafb41677614d376bf41c5a 100644 (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().textClass();
+       DocumentClass const & textclass = buf.params().documentClass();
        Paragraph & par = it.paragraph();
        LayoutPtr const & layout = par.layout();
        Counters & counters = textclass.counters();
@@ -481,7 +481,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().textClass();
+       DocumentClass const & textclass = master->params().documentClass();
 
        if (!childonly) {
                // If this is a child document start with the master
index 2dd57eec95b8b0c5150c2f99055dcdc599aca7c2..9d317b94b02d375ba35f46800648ac745cbb0829 100644 (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.textClassPtr(), s);
+                       return new InsetFlex(params, params.documentClassPtr(), 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.textClass().floats().typeExist(argument))
+                       if (params.documentClass().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.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();
@@ -485,7 +485,7 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
                        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()));
index bf694e826bfa83e98a99e81929962780b9df0adc..9e3edc0e9e7ccce108aaf74f2c484af58e8a9e24 100644 (file)
@@ -1354,7 +1354,7 @@ void GuiDocument::updateEmbeddedFileList()
 
 void GuiDocument::updateNumbering()
 {
-       TextClass const & tclass = bp_.textClass();
+       DocumentClass const & tclass = bp_.documentClass();
 
        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.textClass().hasTocLevels()) {
+       if (params.documentClass().hasTocLevels()) {
                params.tocdepth = numberingModule->tocSL->value();
                params.secnumdepth = numberingModule->depthSL->value();
        }
index 3dd5ea1b2e55b1f98557f0894a523d2808e1b8b3..87709c0eca0a2e7cff55bc69b7b4bad14da5ee0a 100644 (file)
@@ -236,7 +236,7 @@ docstring GuiToc::guiName(string const & type) const
        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());
 
index bd889cae39e86623f211905f0db0ad1c16a2761c..1951870d9c803cc635442b373eaa9374890dc4c9 100644 (file)
@@ -307,7 +307,7 @@ void GuiLayoutBox::updateContents(bool reset)
                return;
        }
 
-       TextClass const * text_class = &buffer->params().textClass();
+       DocumentClass const * text_class = &buffer->params().documentClass();
        Inset const * inset = 
                owner_.view()->cursor().innerParagraph().inInset();
 
index 0b9d23cb3ad7aa8de3bf590996f021b102e95320..49ac3a5af3b9099cd942a3fc7700473448322e32 100644 (file)
 #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 {
@@ -86,7 +85,7 @@ private:
        ToolbarsMap toolbars_;
 
        /// The last textclass layout list in the layout choice selector
-       TextClassPtr last_textclass_;
+       DocumentClass * last_textclass_;
 };
 
 
index 8a028096deeb07c4e4321c8a16b8cce6b1e0456c..a59a0e36f34dc51f4679df4d23ec58ddc4c38232 100644 (file)
@@ -387,7 +387,7 @@ bool Inset::covers(BufferView const & bv, int x, int y) const
 
 InsetLayout const & Inset::getLayout(BufferParams const & bp) const
 {
-       return bp.textClass().insetLayout(name());  
+       return bp.documentClass().insetLayout(name());  
 }
 
 
index 1fcfda3b09afe0bfddffd3ae86d360a3e8f902a5..e0a14e68b8539496ea7db382fda5e095377ed21f 100644 (file)
@@ -208,7 +208,7 @@ void InsetBibitem::fillWithBibKeys(BiblioInfo & keys, InsetIterator const & it)
 /// 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);
index 4d79ffa7fa5bea7176c8d30ebec99bd5013198e5..a54b0b4a3a033155d0c5099b4fdf046c1595b9f1 100644 (file)
@@ -293,7 +293,7 @@ int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
                                              "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())
@@ -310,8 +310,7 @@ int InsetBibtex::latex(odocstream & os, OutputParams const & runparams) const
                // 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";
index c40c3c54a01eea45ece9cea95321d25b2686622c..9744ccd3f01584453a20ac8b6a5781522602cd78 100644 (file)
@@ -89,7 +89,7 @@ InsetBox::InsetBox(BufferParams const & bp, string const & label)
        : InsetCollapsable(bp), params_(label)
 {
        if (forceEmptyLayout())
-               paragraphs().back().setLayout(bp.textClass().emptyLayout());
+               paragraphs().back().setLayout(bp.documentClass().emptyLayout());
 }
 
 
index 9d968e7aa93f4d7476cb51f4f635c431876d91cc..3da72ae1d19531062be0f16556ebb78346fceb5d 100644 (file)
@@ -76,7 +76,7 @@ void InsetBranch::read(Lexer & lex)
 }
 
 
-docstring InsetBranch::toolTip(BufferView const & bv, int x, int y) const
+docstring InsetBranch::toolTip(BufferView const &, int, int) const
 {
        return _("Branch: ") + params_.branch;
 }
@@ -224,7 +224,7 @@ void InsetBranch::updateLabels(ParIterator const & it)
        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;
index 8cb5151a32dcff4fae772817273aa6cd751e354c..1c968b4a01f9a41a1ab8165bc9aa149f5dca2416 100644 (file)
@@ -57,14 +57,14 @@ InsetCaption::InsetCaption(InsetCaption const & ic)
 
 
 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());
 }
 
 
@@ -277,7 +277,7 @@ int InsetCaption::getOptArg(odocstream & os,
 
 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().
index 25e2cff7876085d4795c677085ea04013f056c46..870f75ac378f6501afaf5b14738be588974408d0 100644 (file)
@@ -78,21 +78,20 @@ InsetCollapsable::Geometry InsetCollapsable::geometry() const
 
 
 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),
@@ -125,15 +124,14 @@ docstring InsetCollapsable::toolTip(BufferView const & bv, int x, int y) const
 
 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();
@@ -795,7 +793,7 @@ void InsetCollapsable::setStatus(Cursor & cur, CollapseStatus status)
 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());
index 3b6f4c1e08fd53039a8666af28e6b05052cbeed1..c137579635ec5e1f353c459867fb27bf29fa40bd 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "Box.h"
 #include "TextClass.h"
-#include "TextClassPtr.h"
 
 #include <string>
 
@@ -40,7 +39,7 @@ class InsetCollapsable : public InsetText {
 public:
        ///
        InsetCollapsable(BufferParams const &,
-               CollapseStatus status = Inset::Open, TextClassPtr tc = 0);
+               CollapseStatus status = Inset::Open, DocumentClass * tc = 0);
        ///
        InsetCollapsable(InsetCollapsable const & rhs);
        ///
@@ -59,7 +58,7 @@ public:
        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; }
        ///
@@ -171,10 +170,7 @@ protected:
        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;
index 1ea0783a88657d7c49f75e77db1fa567c605147e..937696f0583b639e48d7a7c1010250f9d457d37f 100644 (file)
@@ -115,8 +115,7 @@ int InsetERT::docbook(odocstream & os, OutputParams const &) 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) {
 
index 1e2455e49197f8ffd3beee31e843c94b02404046..69b33e72546c6ab6f8c0b657355ce4e9f737be7c 100644 (file)
@@ -27,7 +27,7 @@ namespace lyx {
 
 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);
index 45e8b739d756a2ce5af012f4e6d14d57acd9c498..70679bf78d4b81a1728408c81b69ee8ccc939592 100644 (file)
@@ -40,11 +40,11 @@ namespace lyx {
 
 
 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();
 }
index 99418de10446aa6917bf7c99387cedd37d37327d..4250617eb44c26f158d7a879876723120f26b6a7 100644 (file)
@@ -23,7 +23,7 @@ namespace lyx {
 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_); }
index e0fbb0194b93fb4ec4bf26977e52734c71a5fad5..b7c34f02aaafd859b0d86d2a0a80b5738a098cff 100644 (file)
@@ -175,7 +175,7 @@ bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 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
@@ -282,7 +282,7 @@ docstring InsetFloat::editMessage() const
 
 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;
index 745712a34b96f7d6ca90a6074678afaa7505012f..3251b50936fb5235784a29cfd74d80da280e8ac1 100644 (file)
@@ -68,7 +68,7 @@ bool InsetFloatList::isCompatibleCommand(string const & s)
 
 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());
@@ -85,7 +85,7 @@ void InsetFloatList::write(ostream & os) const
 
 void InsetFloatList::read(Lexer & lex)
 {
-       FloatList const & floats = buffer().params().textClass().floats();
+       FloatList const & floats = buffer().params().documentClass().floats();
        string token;
 
        if (lex.eatLine()) {
@@ -113,7 +113,7 @@ void InsetFloatList::read(Lexer & lex)
 
 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()) {
index 68ab63daf54b2478081016b3beb2d69e923747f7..5a97a3c8df47fccdae12d7f727efb752af721ccd 100644 (file)
@@ -59,7 +59,7 @@ docstring InsetFoot::editMessage() const
 
 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();
index 0e0ace5bc47b7fa3d8d085aba1cdeab02220d4ec..5d9cd9426b2619093973cf42e88bc719b244c341 100644 (file)
@@ -447,8 +447,8 @@ int InsetInclude::latex(odocstream & os, OutputParams const & runparams) const
                                                "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;
                }
@@ -898,7 +898,7 @@ void InsetInclude::updateLabels(ParIterator const &)
                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)) {
index c10d619ee9434273044d87e00f8ff8f1125ded80..aeaece2b28dfe11b3e5cce2043af7f13582a5083 100644 (file)
@@ -242,7 +242,7 @@ void InsetInfo::updateInfo()
                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;
index 5bf4e8cbd73960ba1539334322e49cb7b9cc674e..c4497ded2f5c90c9d8e466ad12c05ca6927f2cb8 100644 (file)
@@ -71,7 +71,7 @@ Inset::DisplayType InsetListings::display() const
 
 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
index 11b37a0f6320f994d5249593bac717c49d15de27..4c11a1e89e8f3c710cb6ff826f7d42bca514197e 100644 (file)
@@ -213,7 +213,7 @@ bool InsetNote::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 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;
index 19583ecbf64a17c79918f136adfa6b992d1c27b0..20dbba81d97df6bc1741a99c6aefa6b7c5bf7b97 100644 (file)
@@ -487,7 +487,7 @@ Tabular::CellData::CellData(Buffer const & buffer)
          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());
 }
 
 
@@ -1097,7 +1097,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.textClass().emptyLayoutName());
+                       bp.documentClass().emptyLayoutName());
        cur.pop();
 }
 
@@ -3175,7 +3175,7 @@ void InsetTabular::edit(Cursor & cur, bool front, EntryDirection)
 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");
index d6975558aad200494b71bb059c1fcd89bbb84a9e..83f705dbf0b73fbb864176cfceaacf529de91f6e 100644 (file)
@@ -103,7 +103,7 @@ InsetText::InsetText(BufferParams const & bp)
 {
        paragraphs().push_back(Paragraph());
        Paragraph & ourpar = paragraphs().back();
-       ourpar.setEmptyOrDefaultLayout(bp.textClass());
+       ourpar.setEmptyOrDefaultLayout(bp.documentClass());
        ourpar.setInsetOwner(this);
 }
 
index 91d0808de880594ba1a2d1786c5d0f2742f7a7ed..580c8c5a9c05f18a2cc123991e19115a0bee6ce7 100644 (file)
@@ -107,7 +107,7 @@ bool InsetWrap::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 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
index 05f001f4102ba2400f1196b5737e23d3641abb91..0efc7d6e73b57d9a7e14d940e28785b2f34a7872 100644 (file)
@@ -101,7 +101,7 @@ ParagraphList::const_iterator makeParagraph(Buffer const & buf,
                                            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';
@@ -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().textClass().defaultLayout();
+       LayoutPtr const & defaultstyle = buf.params().documentClass().defaultLayout();
        LayoutPtr const & bstyle = par->layout();
        string item_tag;
 
index 9d2e08d988bd72ca9bd629b7a52556447de26a6a..335c7d01f9a82a43a7b76b1d89d50db6389189ad 100644 (file)
@@ -109,7 +109,7 @@ TeXEnvironment(Buffer const & buf,
        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();
 
@@ -309,7 +309,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.textClass().emptyLayout() : pit->layout();
+               bparams.documentClass().emptyLayout() : pit->layout();
 
        OutputParams runparams = runparams_in;
        runparams.moving_arg |= style->needprotect;
@@ -477,7 +477,7 @@ TeXOnePar(Buffer const & buf,
                }
        }
 
-       bool const useSetSpace = bparams.textClass().provides("SetSpace");
+       bool const useSetSpace = bparams.documentClass().provides("SetSpace");
        if (pit->allowParagraphCustomization()) {
                if (pit->params().startOfAppendix()) {
                        os << "\\appendix\n";
@@ -741,7 +741,7 @@ void latexParagraphs(Buffer const & buf,
        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();
index 7d984f61ad32a8063fa57bbb07ab6c3d4e44fc1e..e8241050b07b470a0bc76ddd4f21f543801f5d06 100644 (file)
@@ -76,7 +76,7 @@ void breakParagraph(BufferParams const & bparams,
        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) {
@@ -141,7 +141,7 @@ void breakParagraph(BufferParams const & bparams,
                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
index 68d922e76e782a473807183d293c095fc78dec66..1611f32495ceb0125651af950ef39b4a810a0f5e 100644 (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().textClass();
+       DocumentClass const & tclass = buf.params().documentClass();
        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().textClass().counters();
+       Counters & counters = buf.params().documentClass().counters();
 
        string id = par.getID(buf, runparams);