]> git.lyx.org Git - features.git/commitdiff
try to pass a Buffer & to inset construction if some buffer(param)
authorAndré Pönitz <poenitz@gmx.net>
Tue, 4 Mar 2008 22:28:18 +0000 (22:28 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 4 Mar 2008 22:28:18 +0000 (22:28 +0000)
access is needed

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

44 files changed:
src/Buffer.cpp
src/Text2.cpp
src/factory.cpp
src/insets/InsetBox.cpp
src/insets/InsetBox.h
src/insets/InsetBranch.cpp
src/insets/InsetBranch.h
src/insets/InsetCaption.cpp
src/insets/InsetCaption.h
src/insets/InsetCollapsable.cpp
src/insets/InsetCollapsable.h
src/insets/InsetERT.cpp
src/insets/InsetERT.h
src/insets/InsetEnvironment.cpp
src/insets/InsetEnvironment.h
src/insets/InsetFlex.cpp
src/insets/InsetFlex.h
src/insets/InsetFloat.cpp
src/insets/InsetFloat.h
src/insets/InsetFoot.cpp
src/insets/InsetFoot.h
src/insets/InsetFootlike.cpp
src/insets/InsetFootlike.h
src/insets/InsetIndex.cpp
src/insets/InsetIndex.h
src/insets/InsetInfo.cpp
src/insets/InsetInfo.h
src/insets/InsetListings.cpp
src/insets/InsetListings.h
src/insets/InsetMarginal.cpp
src/insets/InsetMarginal.h
src/insets/InsetNote.cpp
src/insets/InsetNote.h
src/insets/InsetOptArg.cpp
src/insets/InsetOptArg.h
src/insets/InsetQuotes.cpp
src/insets/InsetQuotes.h
src/insets/InsetRef.cpp
src/insets/InsetRef.h
src/insets/InsetTabular.cpp
src/insets/InsetText.cpp
src/insets/InsetText.h
src/insets/InsetWrap.cpp
src/insets/InsetWrap.h

index f7f962141ef3e328e5158f823ec8afa06fc6fdde..dc7343677e47deeea18f4594bc7cf6c861593f11 100644 (file)
@@ -167,9 +167,6 @@ public:
         */
        bool file_fully_loaded;
 
         */
        bool file_fully_loaded;
 
-       /// our Text that should be wrapped in an InsetText
-       InsetText inset;
-
        ///
        mutable TocBackend toc_backend;
 
        ///
        mutable TocBackend toc_backend;
 
@@ -209,6 +206,9 @@ public:
        mutable EmbeddedFileList bibfilesCache_;
 
        mutable RefCache ref_cache_;
        mutable EmbeddedFileList bibfilesCache_;
 
        mutable RefCache ref_cache_;
+
+       /// our Text that should be wrapped in an InsetText
+       InsetText inset;
 };
 
 /// Creates the per buffer temporary directory
 };
 
 /// Creates the per buffer temporary directory
@@ -233,13 +233,11 @@ static FileName createBufferTmpDir()
 Buffer::Impl::Impl(Buffer & parent, FileName const & file, bool readonly_)
        : parent_buffer(0), lyx_clean(true), bak_clean(true), unnamed(false),
          read_only(readonly_), filename(file), file_fully_loaded(false),
 Buffer::Impl::Impl(Buffer & parent, FileName const & file, bool readonly_)
        : parent_buffer(0), lyx_clean(true), bak_clean(true), unnamed(false),
          read_only(readonly_), filename(file), file_fully_loaded(false),
-         inset(params), toc_backend(&parent), macro_lock(false),
+         toc_backend(&parent), macro_lock(false),
          embedded_files(), timestamp_(0), checksum_(0), wa_(0), 
          undo_(parent)
 {
        temppath = createBufferTmpDir();
          embedded_files(), timestamp_(0), checksum_(0), wa_(0), 
          undo_(parent)
 {
        temppath = createBufferTmpDir();
-       inset.setBuffer(parent);
-       inset.setAutoBreakRows(true);
        lyxvc.setBuffer(&parent);
        if (use_gui)
                wa_ = new frontend::WorkAreaManager;
        lyxvc.setBuffer(&parent);
        if (use_gui)
                wa_ = new frontend::WorkAreaManager;
@@ -251,6 +249,9 @@ Buffer::Buffer(string const & file, bool readonly)
 {
        LYXERR(Debug::INFO, "Buffer::Buffer()");
 
 {
        LYXERR(Debug::INFO, "Buffer::Buffer()");
 
+       d->inset.setBuffer(*this);
+       d->inset.initParagraphs(*this);
+       d->inset.setAutoBreakRows(true);
        d->inset.getText(0)->setMacrocontextPosition(par_iterator_begin());
 }
 
        d->inset.getText(0)->setMacrocontextPosition(par_iterator_begin());
 }
 
index fa0ed179b30bbe775ac20737593e8fcdd8182078..c8fc4e70bfd65289deb099349f957ac87bb0c0e2 100644 (file)
@@ -225,7 +225,7 @@ void Text::setLayout(Cursor & cur, docstring const & layout)
                lyx::dispatch(FuncRequest(LFUN_LINE_BEGIN));
                lyx::dispatch(FuncRequest(LFUN_LINE_END_SELECT));
                lyx::dispatch(FuncRequest(LFUN_CUT));
                lyx::dispatch(FuncRequest(LFUN_LINE_BEGIN));
                lyx::dispatch(FuncRequest(LFUN_LINE_END_SELECT));
                lyx::dispatch(FuncRequest(LFUN_CUT));
-               Inset * inset = new InsetEnvironment(params, layout);
+               Inset * inset = new InsetEnvironment(bv.buffer(), layout);
                insertInset(cur, inset);
                //inset->edit(cur, true);
                //lyx::dispatch(FuncRequest(LFUN_PASTE));
                insertInset(cur, inset);
                //inset->edit(cur, true);
                //lyx::dispatch(FuncRequest(LFUN_PASTE));
index fd6c8c1a45e2d9ab5c544d973da120df9280f1a0..300345d913a3165521ecb760585b6d33dfcfeb89 100644 (file)
@@ -102,44 +102,44 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
 
                case LFUN_FLEX_INSERT: {
                        string s = cmd.getArg(0);
 
                case LFUN_FLEX_INSERT: {
                        string s = cmd.getArg(0);
-                       return new InsetFlex(params, params.documentClassPtr(), s);
+                       return new InsetFlex(buf, buf.params().documentClassPtr(), s);
                }
 
                case LFUN_NOTE_INSERT: {
                        string arg = cmd.getArg(0);
                        if (arg.empty())
                                arg = "Note";
                }
 
                case LFUN_NOTE_INSERT: {
                        string arg = cmd.getArg(0);
                        if (arg.empty())
                                arg = "Note";
-                       return new InsetNote(params, arg);
+                       return new InsetNote(buf, arg);
                }
 
                case LFUN_BOX_INSERT: {
                        string arg = cmd.getArg(0);
                        if (arg.empty())
                                arg = "Boxed";
                }
 
                case LFUN_BOX_INSERT: {
                        string arg = cmd.getArg(0);
                        if (arg.empty())
                                arg = "Boxed";
-                       return new InsetBox(params, arg);
+                       return new InsetBox(buf, arg);
                }
 
                case LFUN_BRANCH_INSERT: {
                        docstring arg = cmd.argument();
                        if (arg.empty())
                                arg = from_ascii("none");
                }
 
                case LFUN_BRANCH_INSERT: {
                        docstring arg = cmd.argument();
                        if (arg.empty())
                                arg = from_ascii("none");
-                       return new InsetBranch(params, InsetBranchParams(arg));
+                       return new InsetBranch(buf, InsetBranchParams(arg));
                }
 
                case LFUN_ERT_INSERT:
                }
 
                case LFUN_ERT_INSERT:
-                       return new InsetERT(params);
+                       return new InsetERT(buf);
 
                case LFUN_LISTING_INSERT:
 
                case LFUN_LISTING_INSERT:
-                       return new InsetListings(params);
+                       return new InsetListings(buf);
 
                case LFUN_FOOTNOTE_INSERT:
 
                case LFUN_FOOTNOTE_INSERT:
-                       return new InsetFoot(params);
+                       return new InsetFoot(buf);
 
                case LFUN_MARGINALNOTE_INSERT:
 
                case LFUN_MARGINALNOTE_INSERT:
-                       return new InsetMarginal(params);
+                       return new InsetMarginal(buf);
 
                case LFUN_OPTIONAL_INSERT:
 
                case LFUN_OPTIONAL_INSERT:
-                       return new InsetOptArg(params);
+                       return new InsetOptArg(buf);
 
                case LFUN_BIBITEM_INSERT:
                        return new InsetBibitem(InsetCommandParams(BIBITEM_CODE));
 
                case LFUN_BIBITEM_INSERT:
                        return new InsetBibitem(InsetCommandParams(BIBITEM_CODE));
@@ -147,8 +147,8 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                case LFUN_FLOAT_INSERT: {
                        // check if the float type exists
                        string const argument = to_utf8(cmd.argument());
                case LFUN_FLOAT_INSERT: {
                        // check if the float type exists
                        string const argument = to_utf8(cmd.argument());
-                       if (params.documentClass().floats().typeExist(argument))
-                               return new InsetFloat(params, argument);
+                       if (buf.params().documentClass().floats().typeExist(argument))
+                               return new InsetFloat(buf, argument);
                        lyxerr << "Non-existent float type: " << argument << endl;
                }
 
                        lyxerr << "Non-existent float type: " << argument << endl;
                }
 
@@ -156,7 +156,7 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                        // check if the float type exists
                        string const argument = to_utf8(cmd.argument());
                        if (params.documentClass().floats().typeExist(argument)) {
                        // check if the float type exists
                        string const argument = to_utf8(cmd.argument());
                        if (params.documentClass().floats().typeExist(argument)) {
-                               auto_ptr<InsetFloat> p(new InsetFloat(params, argument));
+                               auto_ptr<InsetFloat> p(new InsetFloat(buf, argument));
                                p->wide(true, params);
                                return p.release();
                        }
                                p->wide(true, params);
                                return p.release();
                        }
@@ -167,13 +167,13 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                case LFUN_WRAP_INSERT: {
                        string const argument = to_utf8(cmd.argument());
                        if (argument == "figure" || argument == "table")
                case LFUN_WRAP_INSERT: {
                        string const argument = to_utf8(cmd.argument());
                        if (argument == "figure" || argument == "table")
-                               return new InsetWrap(params, argument);
+                               return new InsetWrap(buf, argument);
                        lyxerr << "Non-existent wrapfig type: " << argument << endl;
                        return 0;
                }
 
                case LFUN_INDEX_INSERT:
                        lyxerr << "Non-existent wrapfig type: " << argument << endl;
                        return 0;
                }
 
                case LFUN_INDEX_INSERT:
-                       return new InsetIndex(params);
+                       return new InsetIndex(buf);
 
                case LFUN_NOMENCL_INSERT: {
                        InsetCommandParams icp(NOMENCL_CODE);
 
                case LFUN_NOMENCL_INSERT: {
                        InsetCommandParams icp(NOMENCL_CODE);
@@ -195,7 +195,7 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                }
 
                case LFUN_CAPTION_INSERT: {
                }
 
                case LFUN_CAPTION_INSERT: {
-                       auto_ptr<InsetCaption> inset(new InsetCaption(params));
+                       auto_ptr<InsetCaption> inset(new InsetCaption(buf));
                        inset->setAutoBreakRows(true);
                        inset->setDrawFrame(true);
                        inset->setFrameColor(Color_captionframe);
                        inset->setAutoBreakRows(true);
                        inset->setDrawFrame(true);
                        inset->setFrameColor(Color_captionframe);
@@ -212,10 +212,10 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                        return new InsetTOC(InsetCommandParams(TOC_CODE));
 
                case LFUN_ENVIRONMENT_INSERT:
                        return new InsetTOC(InsetCommandParams(TOC_CODE));
 
                case LFUN_ENVIRONMENT_INSERT:
-                       return new InsetEnvironment(params, cmd.argument());
+                       return new InsetEnvironment(buf, cmd.argument());
 
                case LFUN_INFO_INSERT:
 
                case LFUN_INFO_INSERT:
-                       return new InsetInfo(params, to_utf8(cmd.argument()));
+                       return new InsetInfo(buf, to_utf8(cmd.argument()));
 #if 0
                case LFUN_THEOREM_INSERT:
                        return new InsetTheorem;
 #if 0
                case LFUN_THEOREM_INSERT:
                        return new InsetTheorem;
@@ -250,13 +250,13 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                        case ERT_CODE: {
                                InsetCollapsable::CollapseStatus st;
                                InsetERTMailer::string2params(to_utf8(cmd.argument()), st);
                        case ERT_CODE: {
                                InsetCollapsable::CollapseStatus st;
                                InsetERTMailer::string2params(to_utf8(cmd.argument()), st);
-                               return new InsetERT(params, st);
+                               return new InsetERT(buf, st);
                        }
                                
                        case LISTINGS_CODE: {
                                InsetListingsParams par;
                                InsetListingsMailer::string2params(to_utf8(cmd.argument()), par);
                        }
                                
                        case LISTINGS_CODE: {
                                InsetListingsParams par;
                                InsetListingsMailer::string2params(to_utf8(cmd.argument()), par);
-                               return new InsetListings(params, par);
+                               return new InsetListings(buf, par);
                        }
                        
                        case EXTERNAL_CODE: {
                        }
                        
                        case EXTERNAL_CODE: {
@@ -288,7 +288,7 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                        }
                        
                        case INDEX_CODE:
                        }
                        
                        case INDEX_CODE:
-                               return new InsetIndex(params);
+                               return new InsetIndex(buf);
                        
                        case NOMENCL_CODE: {
                                InsetCommandParams icp(code);
                        
                        case NOMENCL_CODE: {
                                InsetCommandParams icp(code);
@@ -305,7 +305,7 @@ Inset * createInsetHelper(Buffer & buf, FuncRequest const & cmd)
                        case REF_CODE: {
                                InsetCommandParams icp(code);
                                InsetCommandMailer::string2params(name, to_utf8(cmd.argument()), icp);
                        case REF_CODE: {
                                InsetCommandParams icp(code);
                                InsetCommandMailer::string2params(name, to_utf8(cmd.argument()), icp);
-                               return new InsetRef(icp, buf);
+                               return new InsetRef(buf, icp);
                        }
                        
                        case TOC_CODE: {
                        }
                        
                        case TOC_CODE: {
@@ -446,7 +446,7 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
                                break;
                        case REF_CODE:
                                if (!inscmd["name"].empty() || !inscmd["reference"].empty())
                                break;
                        case REF_CODE:
                                if (!inscmd["name"].empty() || !inscmd["reference"].empty())
-                                       inset.reset(new InsetRef(inscmd, buf));
+                                       inset.reset(new InsetRef(buf, inscmd));
                                break;
                        case TOC_CODE:
                                inset.reset(new InsetTOC(inscmd));
                                break;
                        case TOC_CODE:
                                inset.reset(new InsetTOC(inscmd));
@@ -478,58 +478,58 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
                } else if (tmptok == "Graphics") {
                        inset.reset(new InsetGraphics);
                } else if (tmptok == "Note") {
                } else if (tmptok == "Graphics") {
                        inset.reset(new InsetGraphics);
                } else if (tmptok == "Note") {
-                       inset.reset(new InsetNote(buf.params(), tmptok));
+                       inset.reset(new InsetNote(buf, tmptok));
                } else if (tmptok == "Box") {
                } else if (tmptok == "Box") {
-                       inset.reset(new InsetBox(buf.params(), tmptok));
+                       inset.reset(new InsetBox(buf, tmptok));
                } else if (tmptok == "Flex") {
                        lex.next();
                        string s = lex.getString();
                } else if (tmptok == "Flex") {
                        lex.next();
                        string s = lex.getString();
-                       inset.reset(new InsetFlex(buf.params()
+                       inset.reset(new InsetFlex(buf, 
                                buf.params().documentClassPtr(), s));
                } else if (tmptok == "Branch") {
                                buf.params().documentClassPtr(), s));
                } else if (tmptok == "Branch") {
-                       inset.reset(new InsetBranch(buf.params(),
+                       inset.reset(new InsetBranch(buf,
                                                    InsetBranchParams()));
                } else if (tmptok == "Environment") {
                        lex.next();
                                                    InsetBranchParams()));
                } else if (tmptok == "Environment") {
                        lex.next();
-                       inset.reset(new InsetEnvironment(buf.params(), lex.getDocString()));
+                       inset.reset(new InsetEnvironment(buf, lex.getDocString()));
                } else if (tmptok == "ERT") {
                } else if (tmptok == "ERT") {
-                       inset.reset(new InsetERT(buf.params()));
+                       inset.reset(new InsetERT(buf));
                } else if (tmptok == "listings") {
                } else if (tmptok == "listings") {
-                       inset.reset(new InsetListings(buf.params()));
+                       inset.reset(new InsetListings(buf));
                } else if (tmptok == "InsetSpace") {
                        inset.reset(new InsetSpace);
                } else if (tmptok == "Tabular") {
                        inset.reset(new InsetTabular(buf));
                } else if (tmptok == "Text") {
                } else if (tmptok == "InsetSpace") {
                        inset.reset(new InsetSpace);
                } else if (tmptok == "Tabular") {
                        inset.reset(new InsetTabular(buf));
                } else if (tmptok == "Text") {
-                       inset.reset(new InsetText(buf.params()));
+                       inset.reset(new InsetText(buf));
                } else if (tmptok == "VSpace") {
                        inset.reset(new InsetVSpace);
                } else if (tmptok == "Foot") {
                } else if (tmptok == "VSpace") {
                        inset.reset(new InsetVSpace);
                } else if (tmptok == "Foot") {
-                       inset.reset(new InsetFoot(buf.params()));
+                       inset.reset(new InsetFoot(buf));
                } else if (tmptok == "Marginal") {
                } else if (tmptok == "Marginal") {
-                       inset.reset(new InsetMarginal(buf.params()));
+                       inset.reset(new InsetMarginal(buf));
                } else if (tmptok == "OptArg") {
                } else if (tmptok == "OptArg") {
-                       inset.reset(new InsetOptArg(buf.params()));
+                       inset.reset(new InsetOptArg(buf));
                } else if (tmptok == "Float") {
                        lex.next();
                        string tmptok = lex.getString();
                } else if (tmptok == "Float") {
                        lex.next();
                        string tmptok = lex.getString();
-                       inset.reset(new InsetFloat(buf.params(), tmptok));
+                       inset.reset(new InsetFloat(buf, tmptok));
                } else if (tmptok == "Wrap") {
                        lex.next();
                        string tmptok = lex.getString();
                } else if (tmptok == "Wrap") {
                        lex.next();
                        string tmptok = lex.getString();
-                       inset.reset(new InsetWrap(buf.params(), tmptok));
+                       inset.reset(new InsetWrap(buf, tmptok));
 #if 0
                } else if (tmptok == "Theorem") {
                        inset.reset(new InsetList);
 #endif
                } else if (tmptok == "Caption") {
 #if 0
                } else if (tmptok == "Theorem") {
                        inset.reset(new InsetList);
 #endif
                } else if (tmptok == "Caption") {
-                       inset.reset(new InsetCaption(buf.params()));
+                       inset.reset(new InsetCaption(buf));
                } else if (tmptok == "Index") {
                } else if (tmptok == "Index") {
-                       inset.reset(new InsetIndex(buf.params()));
+                       inset.reset(new InsetIndex(buf));
                } else if (tmptok == "FloatList") {
                        inset.reset(new InsetFloatList);
                } else if (tmptok == "Info") {
                } else if (tmptok == "FloatList") {
                        inset.reset(new InsetFloatList);
                } else if (tmptok == "Info") {
-                       inset.reset(new InsetInfo(buf.params()));
+                       inset.reset(new InsetInfo(buf));
                } else {
                        lyxerr << "unknown Inset type '" << tmptok
                               << "'" << endl;
                } else {
                        lyxerr << "unknown Inset type '" << tmptok
                               << "'" << endl;
index 9744ccd3f01584453a20ac8b6a5781522602cd78..44638964f8c276fb264afd50d1bee7198f7be618 100644 (file)
@@ -85,11 +85,11 @@ BoxTranslatorLoc const & boxtranslator_loc()
 } // anon
 
 
 } // anon
 
 
-InsetBox::InsetBox(BufferParams const & bp, string const & label)
-       : InsetCollapsable(bp), params_(label)
+InsetBox::InsetBox(Buffer const & buffer, string const & label)
+       : InsetCollapsable(buffer), params_(label)
 {
        if (forceEmptyLayout())
 {
        if (forceEmptyLayout())
-               paragraphs().back().setLayout(bp.documentClass().emptyLayout());
+               paragraphs().back().setLayout(buffer.params().documentClass().emptyLayout());
 }
 
 
 }
 
 
index d74c68cc9f0d673fe94fc716ff37874e9c7b17d3..4aa9336c6804d3c1222ba0af677ce504130d354c 100644 (file)
@@ -58,7 +58,7 @@ public:
 class InsetBox : public InsetCollapsable {
 public:
        ///
 class InsetBox : public InsetCollapsable {
 public:
        ///
-       InsetBox(BufferParams const &, std::string const &);
+       InsetBox(Buffer const &, std::string const &);
        ///
        ~InsetBox();
        ///
        ///
        ~InsetBox();
        ///
index 3da72ae1d19531062be0f16556ebb78346fceb5d..852b04fc0cee4e993a3196ec898db45527bc88a5 100644 (file)
@@ -33,14 +33,8 @@ using namespace std;
 namespace lyx {
 
 
 namespace lyx {
 
 
-InsetBranch::InsetBranch(BufferParams const & bp,
-                        InsetBranchParams const & params)
-       : InsetCollapsable(bp), params_(params)
-{}
-
-
-InsetBranch::InsetBranch(InsetBranch const & in)
-       : InsetCollapsable(in), params_(in.params_)
+InsetBranch::InsetBranch(Buffer const & buf, InsetBranchParams const & params)
+       : InsetCollapsable(buf), params_(params)
 {}
 
 
 {}
 
 
@@ -50,12 +44,6 @@ InsetBranch::~InsetBranch()
 }
 
 
 }
 
 
-Inset * InsetBranch::clone() const
-{
-       return new InsetBranch(*this);
-}
-
-
 docstring InsetBranch::editMessage() const
 {
        return _("Opened Branch Inset");
 docstring InsetBranch::editMessage() const
 {
        return _("Opened Branch Inset");
index a214ef9e730281df0619c389c7adcb4f9898649c..09e9dbc11aec1ae7ca3848eb3db2a8ea11842170 100644 (file)
@@ -37,7 +37,7 @@ public:
 class InsetBranch : public InsetCollapsable {
 public:
        ///
 class InsetBranch : public InsetCollapsable {
 public:
        ///
-       InsetBranch(BufferParams const &, InsetBranchParams const &);
+       InsetBranch(Buffer const &, InsetBranchParams const &);
        ///
        ~InsetBranch();
        ///
        ///
        ~InsetBranch();
        ///
@@ -83,16 +83,14 @@ public:
        docstring toolTip(BufferView const & bv, int x, int y) const;
 protected:
        ///
        docstring toolTip(BufferView const & bv, int x, int y) const;
 protected:
        ///
-       InsetBranch(InsetBranch const &);
-       ///
-       virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
+       void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
        docstring name() const { return from_ascii("Branch"); }
 private:
        ///
        docstring name() const { return from_ascii("Branch"); }
 private:
+       ///
        friend class InsetBranchParams;
        friend class InsetBranchParams;
-
-       virtual Inset * clone() const;
-
+       ///
+       Inset * clone() const { return new InsetBranch(*this); }
        ///
        InsetBranchParams params_;
 };
        ///
        InsetBranchParams params_;
 };
index 5c7a9753b8227ab02fb57a469c186093f5968864..afdcd8c6e00054a41af5d4083ad94d0bdc6a37fc 100644 (file)
@@ -56,15 +56,14 @@ InsetCaption::InsetCaption(InsetCaption const & ic)
 }
 
 
 }
 
 
-InsetCaption::InsetCaption(BufferParams const & bp)
-       : InsetText(bp)
+InsetCaption::InsetCaption(Buffer const & buf)
+       : InsetText(buf)
 {
        setAutoBreakRows(true);
        setDrawFrame(true);
        setFrameColor(Color_captionframe);
 {
        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.documentClass().emptyLayout());
+       // There will always be only one
+       paragraphs().back().setLayout(buf.params().documentClass().emptyLayout());
 }
 
 
 }
 
 
index cbfba828da9ad0dd33e52a9f5470cfd8f702c40a..631181b9224e55bfda69eb391b6bffddd4c16ce2 100644 (file)
@@ -22,7 +22,7 @@ class InsetCaption : public InsetText {
 public:
        ///
        InsetCaption(InsetCaption const &);
 public:
        ///
        InsetCaption(InsetCaption const &);
-       InsetCaption(BufferParams const &);
+       InsetCaption(Buffer const &);
        ///
        virtual ~InsetCaption() {}
        ///
        ///
        virtual ~InsetCaption() {}
        ///
index a0cae0124412931137eb48a0b320dff8dc768043..7c6d49dc6a0cdc6da17c0252e6e9dcabea876400 100644 (file)
@@ -77,16 +77,16 @@ InsetCollapsable::Geometry InsetCollapsable::geometry() const
 }
 
 
 }
 
 
-InsetCollapsable::InsetCollapsable(BufferParams const & bp,
+InsetCollapsable::InsetCollapsable(Buffer const & buf,
                CollapseStatus status, DocumentClass * dc)
                CollapseStatus status, DocumentClass * dc)
-       : InsetText(bp), status_(status),
+       : InsetText(buf), status_(status),
          openinlined_(false), autoOpen_(false), mouse_hover_(false)
 {
        setLayout(dc);
        setAutoBreakRows(true);
        setDrawFrame(true);
        setFrameColor(Color_collapsableframe);
          openinlined_(false), autoOpen_(false), mouse_hover_(false)
 {
        setLayout(dc);
        setAutoBreakRows(true);
        setDrawFrame(true);
        setFrameColor(Color_collapsableframe);
-       paragraphs().back().setLayout(bp.documentClass().emptyLayout());
+       paragraphs().back().setLayout(buf.params().documentClass().emptyLayout());
 }
 
 
 }
 
 
index c137579635ec5e1f353c459867fb27bf29fa40bd..0085431dc97ccee56e7a1f1ee7213bb55ce57521 100644 (file)
@@ -38,7 +38,7 @@ namespace frontend { class Painter; }
 class InsetCollapsable : public InsetText {
 public:
        ///
 class InsetCollapsable : public InsetText {
 public:
        ///
-       InsetCollapsable(BufferParams const &,
+       InsetCollapsable(Buffer const &,
                CollapseStatus status = Inset::Open, DocumentClass * tc = 0);
        ///
        InsetCollapsable(InsetCollapsable const & rhs);
                CollapseStatus status = Inset::Open, DocumentClass * tc = 0);
        ///
        InsetCollapsable(InsetCollapsable const & rhs);
index 937696f0583b639e48d7a7c1010250f9d457d37f..e53c90ffb879999663fc97e7edccaf52ab397812 100644 (file)
@@ -43,8 +43,8 @@ using namespace lyx::support;
 namespace lyx {
 
 
 namespace lyx {
 
 
-InsetERT::InsetERT(BufferParams const & bp, CollapseStatus status)
-       : InsetCollapsable(bp, status)
+InsetERT::InsetERT(Buffer const & buf, CollapseStatus status)
+       : InsetCollapsable(buf, status)
 {}
 
 
 {}
 
 
index 176c412fd99c1eb8dc05b4aa0a20589c2f96c031..f6a3497f59ea494986e8930957221f8203fde1f1 100644 (file)
@@ -33,7 +33,7 @@ class Language;
 class InsetERT : public InsetCollapsable {
 public:
        ///
 class InsetERT : public InsetCollapsable {
 public:
        ///
-       InsetERT(BufferParams const &, CollapseStatus status = Open);
+       InsetERT(Buffer const &, CollapseStatus status = Open);
 #if 0
        ///
        InsetERT(BufferParams const &,
 #if 0
        ///
        InsetERT(BufferParams const &,
index 69b33e72546c6ab6f8c0b657355ce4e9f737be7c..48ee8539aa3c79398de7e214b032fb506b7e9b7e 100644 (file)
 
 #include "InsetEnvironment.h"
 
 
 #include "InsetEnvironment.h"
 
+#include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferParams.h"
-#include "support/gettext.h"
 #include "Layout.h"
 #include "OutputParams.h"
 #include "output_latex.h"
 #include "TexRow.h"
 #include "TextClass.h"
 
 #include "Layout.h"
 #include "OutputParams.h"
 #include "output_latex.h"
 #include "TexRow.h"
 #include "TextClass.h"
 
+#include "support/gettext.h"
+
 using namespace std;
 
 namespace lyx {
 
 
 using namespace std;
 
 namespace lyx {
 
 
-InsetEnvironment::InsetEnvironment
-               (BufferParams const & bp, docstring const & name)
-       : InsetText(bp), layout_(bp.documentClass()[name]), name_(name)
+InsetEnvironment::InsetEnvironment(Buffer const & buf, docstring const & name)
+       : InsetText(buf), layout_(buf.params().documentClass()[name]), name_(name)
 {
        setAutoBreakRows(true);
        setDrawFrame(true);
 {
        setAutoBreakRows(true);
        setDrawFrame(true);
@@ -39,12 +40,6 @@ InsetEnvironment::InsetEnvironment(InsetEnvironment const & in)
 {}
 
 
 {}
 
 
-Inset * InsetEnvironment::clone() const
-{
-       return new InsetEnvironment(*this);
-}
-
-
 void InsetEnvironment::write(ostream & os) const
 {
        os << "Environment " << to_utf8(name()) << "\n";
 void InsetEnvironment::write(ostream & os) const
 {
        os << "Environment " << to_utf8(name()) << "\n";
index 46ae2bea8e11eec9c8e8a256e5e803c6633c0abc..c853492a269a813fa3a49c3be5db6f24378c3197 100644 (file)
@@ -21,7 +21,7 @@ namespace lyx {
 class InsetEnvironment : public InsetText {
 public:
        ///
 class InsetEnvironment : public InsetText {
 public:
        ///
-       InsetEnvironment(BufferParams const &, docstring const & name);
+       InsetEnvironment(Buffer const &, docstring const & name);
        ///
        docstring name() const { return name_; }
        ///
        ///
        docstring name() const { return name_; }
        ///
@@ -48,7 +48,7 @@ protected:
        InsetEnvironment(InsetEnvironment const &);
 private:
        ///
        InsetEnvironment(InsetEnvironment const &);
 private:
        ///
-       Inset * clone() const;
+       Inset * clone() const { return new InsetEnvironment(*this); }
        /// the layout
        LayoutPtr layout_;
        ///
        /// the layout
        LayoutPtr layout_;
        ///
index 70679bf78d4b81a1728408c81b69ee8ccc939592..d61346d342db57fb41038c515b22e00c0c03a206 100644 (file)
@@ -39,9 +39,9 @@ using namespace std;
 namespace lyx {
 
 
 namespace lyx {
 
 
-InsetFlex::InsetFlex(BufferParams const & bp,
+InsetFlex::InsetFlex(Buffer const & buf,
        DocumentClass * dc, string const & layoutName)
        DocumentClass * dc, string const & layoutName)
-       : InsetCollapsable(bp, Collapsed, dc),
+       : InsetCollapsable(buf, Collapsed, dc),
        name_(layoutName)
 {
        setLayout(dc); // again, because now the name is initialized
        name_(layoutName)
 {
        setLayout(dc); // again, because now the name is initialized
@@ -55,12 +55,6 @@ InsetFlex::InsetFlex(InsetFlex const & in)
 {}
 
 
 {}
 
 
-Inset * InsetFlex::clone() const
-{
-       return new InsetFlex(*this);
-}
-
-
 docstring InsetFlex::editMessage() const
 {
        return _("Opened Flex Inset");
 docstring InsetFlex::editMessage() const
 {
        return _("Opened Flex Inset");
index 4250617eb44c26f158d7a879876723120f26b6a7..eb827f8bd7cb6c0ca89b073345b33f187ce422a3 100644 (file)
@@ -23,7 +23,7 @@ namespace lyx {
 class InsetFlex : public InsetCollapsable {
 public:
        ///
 class InsetFlex : public InsetCollapsable {
 public:
        ///
-       InsetFlex(BufferParams const &, DocumentClass * dc, 
+       InsetFlex(Buffer const &, DocumentClass * dc, 
                        std::string const & layoutName);
        ///
        docstring name() const { return from_utf8(name_); }
                        std::string const & layoutName);
        ///
        docstring name() const { return from_utf8(name_); }
@@ -55,7 +55,7 @@ protected:
        InsetFlex(InsetFlex const &);
 
 private:
        InsetFlex(InsetFlex const &);
 
 private:
-       virtual Inset * clone() const;
+       Inset * clone() const { return new InsetFlex(*this); }
 
        ///
        std::string name_;
 
        ///
        std::string name_;
index 370a29d16d502ffed22d0f08d92c5ef2d8ed2bff..7c44325ebfdd503f108c17c6701ef431f7eff3d4 100644 (file)
@@ -111,10 +111,10 @@ namespace lyx {
 // Lgb
 
 
 // Lgb
 
 
-InsetFloat::InsetFloat(BufferParams const & bp, string const & type)
-       : InsetCollapsable(bp), name_(from_utf8(type))
+InsetFloat::InsetFloat(Buffer const & buf, string const & type)
+       : InsetCollapsable(buf), name_(from_utf8(type))
 {
 {
-       setLabel(_("float: ") + floatName(type, bp));
+       setLabel(_("float: ") + floatName(type, buf.params()));
        params_.type = type;
 }
 
        params_.type = type;
 }
 
index cf50e2a53cfa1d4eeb06fe6a597b750240c2ba21..34c5a28020fffca9ae338416ed269c39987206b8 100644 (file)
@@ -47,7 +47,7 @@ public:
 class InsetFloat : public InsetCollapsable {
 public:
        ///
 class InsetFloat : public InsetCollapsable {
 public:
        ///
-       InsetFloat(BufferParams const &, std::string const &);
+       InsetFloat(Buffer const &, std::string const &);
        ///
        ~InsetFloat();
        ///
        ///
        ~InsetFloat();
        ///
index 5a97a3c8df47fccdae12d7f727efb752af721ccd..98ab7bcd992e5c476088ebc20518a4177ffd99a1 100644 (file)
@@ -35,8 +35,8 @@ using namespace std;
 namespace lyx {
 
 
 namespace lyx {
 
 
-InsetFoot::InsetFoot(BufferParams const & bp)
-       : InsetFootlike(bp)
+InsetFoot::InsetFoot(Buffer const & buf)
+       : InsetFootlike(buf)
 {}
 
 
 {}
 
 
@@ -45,12 +45,6 @@ InsetFoot::InsetFoot(InsetFoot const & in)
 {}
 
 
 {}
 
 
-Inset * InsetFoot::clone() const
-{
-       return new InsetFoot(*this);
-}
-
-
 docstring InsetFoot::editMessage() const
 {
        return _("Opened Footnote Inset");
 docstring InsetFoot::editMessage() const
 {
        return _("Opened Footnote Inset");
index 36c20c1aeb8fa9f0a0c4938bac6ed8ec0c8cb221..6514d133630c24ff1f6b4a689e45854932774754 100644 (file)
@@ -24,7 +24,7 @@ namespace lyx {
 class InsetFoot : public InsetFootlike {
 public:
        ///
 class InsetFoot : public InsetFootlike {
 public:
        ///
-       InsetFoot(BufferParams const &);
+       InsetFoot(Buffer const &);
        ///
        InsetCode lyxCode() const { return FOOT_CODE; }
        ///
        ///
        InsetCode lyxCode() const { return FOOT_CODE; }
        ///
@@ -45,7 +45,7 @@ public:
 protected:
        InsetFoot(InsetFoot const &);
 private:
 protected:
        InsetFoot(InsetFoot const &);
 private:
-       Inset * clone() const;
+       Inset * clone() const { return new InsetFoot(*this); }
 };
 
 
 };
 
 
index 872c8b19ee99d3bf4484d6810bd52ce832cc7a87..ce82e6461a2731a6236862621227936b326c00bd 100644 (file)
@@ -24,8 +24,8 @@ using namespace std;
 namespace lyx {
 
 
 namespace lyx {
 
 
-InsetFootlike::InsetFootlike(BufferParams const & bp)
-       : InsetCollapsable(bp)
+InsetFootlike::InsetFootlike(Buffer const & buf)
+       : InsetCollapsable(buf)
 {}
 
 
 {}
 
 
index 217b1f20252a1772ab9b98e9d6f6c47494c52a4a..0283e06461424b5b1aeade599244a574bb991885 100644 (file)
@@ -23,7 +23,7 @@ namespace lyx {
 class InsetFootlike : public InsetCollapsable {
 public:
        ///
 class InsetFootlike : public InsetCollapsable {
 public:
        ///
-       InsetFootlike(BufferParams const &);
+       InsetFootlike(Buffer const &);
        ///
        InsetFootlike(InsetFootlike const &);
        ///
        ///
        InsetFootlike(InsetFootlike const &);
        ///
index 0effcfc7d3d68f3839c9f70cba1b317e2999b958..7489f7ce90f4478ec466fca09673e74e411890e1 100644 (file)
@@ -29,8 +29,8 @@ using namespace std;
 namespace lyx {
 
 
 namespace lyx {
 
 
-InsetIndex::InsetIndex(BufferParams const & bp)
-       : InsetCollapsable(bp)
+InsetIndex::InsetIndex(Buffer const & buf)
+       : InsetCollapsable(buf)
 {}
 
 
 {}
 
 
index 4f7fb9130dd2103b20beeaf257f545e247036c32..d25657e674cd7af79be39cbe1e1085e9c6aa8229 100644 (file)
@@ -26,7 +26,7 @@ class LaTeXFeatures;
 class InsetIndex : public InsetCollapsable {
 public:
        ///
 class InsetIndex : public InsetCollapsable {
 public:
        ///
-       InsetIndex(BufferParams const &);
+       InsetIndex(Buffer const &);
        ///
        InsetIndex(InsetIndex const &);
        ///
        ///
        InsetIndex(InsetIndex const &);
        ///
index 44d3b5e0a7082c11c9d9229903758e6002f6c267..dd4afdeafb016219d633db798fbf20ad42861272 100644 (file)
@@ -44,8 +44,8 @@ using namespace lyx::support;
 namespace lyx {
 
 
 namespace lyx {
 
 
-InsetInfo::InsetInfo(BufferParams const & bp, string const & name) 
-       : InsetText(bp), type_(UNKNOWN_INFO), name_(),
+InsetInfo::InsetInfo(Buffer const & buf, string const & name) 
+       : InsetText(buf), type_(UNKNOWN_INFO), name_(),
          mouse_hover_(false)
 {
        setAutoBreakRows(true);
          mouse_hover_(false)
 {
        setAutoBreakRows(true);
index 6b62e443862dd96e859581397e37afeb084d504d..9a82e13d724d4683101e5d5a2d33d8a1c5b04b3d 100644 (file)
@@ -84,7 +84,7 @@ public:
        };
 
        ///
        };
 
        ///
-       InsetInfo(BufferParams const & bp, std::string const & info = std::string());
+       InsetInfo(Buffer const & buf, std::string const & info = std::string());
        ///
        Inset * editXY(Cursor & cur, int x, int y);
        ///
        ///
        Inset * editXY(Cursor & cur, int x, int y);
        ///
index c4497ded2f5c90c9d8e466ad12c05ca6927f2cb8..0b63ec28e6783c45f3bd06a9da710068096c7d42 100644 (file)
@@ -41,8 +41,8 @@ namespace lyx {
 char const lstinline_delimiters[] =
        "!*()-=+|;:'\"`,<.>/?QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm";
 
 char const lstinline_delimiters[] =
        "!*()-=+|;:'\"`,<.>/?QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm";
 
-InsetListings::InsetListings(BufferParams const & bp, InsetListingsParams const & par)
-       : InsetCollapsable(bp, par.status())
+InsetListings::InsetListings(Buffer const & buf, InsetListingsParams const & par)
+       : InsetCollapsable(buf, par.status())
 {}
 
 
 {}
 
 
index c761c4c6f856ba4ccdb01dcd3489ebd3d0e80b08..0e4482bc2810b38d9ca775179df190aa84a7c4e4 100644 (file)
@@ -27,7 +27,7 @@ namespace lyx {
 class InsetListings : public InsetCollapsable {
 public:
        ///
 class InsetListings : public InsetCollapsable {
 public:
        ///
-       InsetListings(BufferParams const &, InsetListingsParams const & par = InsetListingsParams());
+       InsetListings(Buffer const &, InsetListingsParams const & par = InsetListingsParams());
        ///
        ~InsetListings();
        ///
        ///
        ~InsetListings();
        ///
index d96653ca2be37863f2535c521bc9d2bfd49edbe7..820abddc9c3f9fe0e67a763d8ad903e6dbd02c50 100644 (file)
@@ -25,8 +25,8 @@
 namespace lyx {
 
 
 namespace lyx {
 
 
-InsetMarginal::InsetMarginal(BufferParams const & bp)
-       : InsetFootlike(bp)
+InsetMarginal::InsetMarginal(Buffer const & buf)
+       : InsetFootlike(buf)
 {}
 
 
 {}
 
 
index 19a8c079286016bf8968a59eb35d7ea86c5e22d3..ee249f3361986afa73b1699499a3b12002eb4cb5 100644 (file)
@@ -25,7 +25,7 @@ namespace lyx {
 class InsetMarginal : public InsetFootlike {
 public:
        ///
 class InsetMarginal : public InsetFootlike {
 public:
        ///
-       InsetMarginal(BufferParams const &);
+       InsetMarginal(Buffer const &);
        ///
        InsetCode lyxCode() const { return MARGIN_CODE; }
        ///
        ///
        InsetCode lyxCode() const { return MARGIN_CODE; }
        ///
index 4c11a1e89e8f3c710cb6ff826f7d42bca514197e..9ffd68e8d468e19bceecfb7bae8cc69345d711f8 100644 (file)
@@ -106,8 +106,8 @@ void InsetNoteParams::read(Lexer & lex)
 }
 
 
 }
 
 
-InsetNote::InsetNote(BufferParams const & bp, string const & label)
-       : InsetCollapsable(bp)
+InsetNote::InsetNote(Buffer const & buf, string const & label)
+       : InsetCollapsable(buf)
 {
        params_.type = notetranslator().find(label);
 }
 {
        params_.type = notetranslator().find(label);
 }
index 65cc2ce2eeacc216b706b1a097e1bd133fdccf77..050ee435b9c2177cfdc7d3d5becd0efb36ba2d7b 100644 (file)
@@ -42,7 +42,7 @@ public:
 class InsetNote : public InsetCollapsable {
 public:
        ///
 class InsetNote : public InsetCollapsable {
 public:
        ///
-       InsetNote(BufferParams const &, std::string const &);
+       InsetNote(Buffer const &, std::string const &);
        ///
        ~InsetNote();
        ///
        ///
        ~InsetNote();
        ///
index d05902bfaff2eb97fa43565f4d93dd59df7754df..03d1da6206d72915cf82e14f653c33a967460c34 100644 (file)
@@ -21,8 +21,8 @@ using namespace std;
 namespace lyx {
 
 
 namespace lyx {
 
 
-InsetOptArg::InsetOptArg(BufferParams const & ins)
-       : InsetCollapsable(ins)
+InsetOptArg::InsetOptArg(Buffer const & buf)
+       : InsetCollapsable(buf)
 {}
 
 
 {}
 
 
index 38e92d9f3d5e2e1f4609ad54350afae95bcf23ef..ebf52a86e3733e0fd5c1c741e5af2460df5f4242 100644 (file)
@@ -25,7 +25,7 @@ namespace lyx {
  */
 class InsetOptArg : public InsetCollapsable {
 public:
  */
 class InsetOptArg : public InsetCollapsable {
 public:
-       InsetOptArg(BufferParams const &);
+       InsetOptArg(Buffer const &);
 
        /// code of the inset
        InsetCode lyxCode() const { return OPTARG_CODE; }
 
        /// code of the inset
        InsetCode lyxCode() const { return OPTARG_CODE; }
index 35c1358e506b672824cb9ac6fdedbc3ae5ca3f25..96a6047d80789873e421a59eca3e3fbdc097ebaa 100644 (file)
@@ -94,8 +94,8 @@ InsetQuotes::InsetQuotes(quote_language l, quote_side s, quote_times t)
 }
 
 
 }
 
 
-InsetQuotes::InsetQuotes(char_type c, BufferParams const & params)
-       : language_(params.quotes_language), times_(params.quotes_times)
+InsetQuotes::InsetQuotes(Buffer const & buf, char_type c)
+       : language_(buf.params().quotes_language), times_(buf.params().quotes_times)
 {
        getPosition(c);
 }
 {
        getPosition(c);
 }
index 55bd794f189bcfd973f5ca7efac8e6c75a5ebd7b..b4cbcc290f227a6a74a2f4e3a8e1c4aa188d0aac 100644 (file)
@@ -69,7 +69,7 @@ public:
          */
        explicit InsetQuotes(std::string const & str = "eld");
        /// Create the right quote inset after character c
          */
        explicit InsetQuotes(std::string const & str = "eld");
        /// Create the right quote inset after character c
-       InsetQuotes(char_type c, BufferParams const & params);
+       InsetQuotes(Buffer const & buffer, char_type c);
        /// Direct access to inner/outer quotation marks
        InsetQuotes(char_type c, quote_language l, quote_times t);
        ///
        /// Direct access to inner/outer quotation marks
        InsetQuotes(char_type c, quote_language l, quote_times t);
        ///
index 0b36a7f7c71edc6bfd5c1ba1e0fad79f9412b620..c2c3358ddd438133ee2458115123a82ca14bd088 100644 (file)
@@ -33,7 +33,7 @@ using namespace std;
 namespace lyx {
 
 
 namespace lyx {
 
 
-InsetRef::InsetRef(InsetCommandParams const & p, Buffer const & buf)
+InsetRef::InsetRef(Buffer const & buf, InsetCommandParams const & p)
        : InsetCommand(p, "ref"), isLatex(buf.isLatex())
 {}
 
        : InsetCommand(p, "ref"), isLatex(buf.isLatex())
 {}
 
index 9ba7895d86bb624aed5db59f2ee0e0a72e72da6d..9bb4521aa271f6b45a790d4fc13cb161ffa20fd1 100644 (file)
@@ -36,7 +36,7 @@ public:
        static std::string const & getName(int type);
 
 
        static std::string const & getName(int type);
 
 
-       InsetRef(InsetCommandParams const &, Buffer const &);
+       InsetRef(Buffer const & buffer, InsetCommandParams const &);
 
        /// verify label and reference.
        /**
 
        /// verify label and reference.
        /**
index 20dbba81d97df6bc1741a99c6aefa6b7c5bf7b97..cf3d046f48bd9bc2fddd3281abe7da2cc92fce08 100644 (file)
@@ -472,7 +472,7 @@ string const featureAsString(Tabular::Feature feature)
 /////////////////////////////////////////////////////////////////////
 
 
 /////////////////////////////////////////////////////////////////////
 
 
-Tabular::CellData::CellData(Buffer const & buffer)
+Tabular::CellData::CellData(Buffer const & buf)
        : cellno(0),
          width(0),
          multicolumn(Tabular::CELL_NORMAL),
        : cellno(0),
          width(0),
          multicolumn(Tabular::CELL_NORMAL),
@@ -484,10 +484,10 @@ Tabular::CellData::CellData(Buffer const & buffer)
          right_line(false),
          usebox(BOX_NONE),
          rotate(false),
          right_line(false),
          usebox(BOX_NONE),
          rotate(false),
-         inset(new InsetText(buffer.params()))
+         inset(new InsetText(buf))
 {
 {
-       inset->setBuffer(const_cast<Buffer &>(buffer));
-       inset->paragraphs().back().setLayout(buffer.params().documentClass().emptyLayout());
+       inset->setBuffer(const_cast<Buffer &>(buf));
+       inset->paragraphs().back().setLayout(buf.params().documentClass().emptyLayout());
 }
 
 
 }
 
 
index 9d188de26d6fb60fbabeebd4ac25c261838ea2ab..45eb41688e076bcc2dbbaa3b4f95e3db8adfb4d8 100644 (file)
@@ -98,13 +98,10 @@ private:
 
 /////////////////////////////////////////////////////////////////////
 
 
 /////////////////////////////////////////////////////////////////////
 
-InsetText::InsetText(BufferParams const & bp)
+InsetText::InsetText(Buffer const & buf)
        : drawFrame_(false), frame_color_(Color_insetframe)
 {
        : drawFrame_(false), frame_color_(Color_insetframe)
 {
-       paragraphs().push_back(Paragraph());
-       Paragraph & ourpar = paragraphs().back();
-       ourpar.setEmptyOrDefaultLayout(bp.documentClass());
-       ourpar.setInsetOwner(this);
+       initParagraphs(buf);
 }
 
 
 }
 
 
@@ -123,6 +120,16 @@ InsetText::InsetText()
 {}
 
 
 {}
 
 
+void InsetText::initParagraphs(Buffer const & buf)
+{
+       BOOST_ASSERT(paragraphs().empty());
+       buffer_ = const_cast<Buffer *>(&buf);
+       paragraphs().push_back(Paragraph());
+       Paragraph & ourpar = paragraphs().back();
+       ourpar.setEmptyOrDefaultLayout(buf.params().documentClass());
+       ourpar.setInsetOwner(this);
+}
+
 void InsetText::setParagraphOwner()
 {
        for_each(paragraphs().begin(), paragraphs().end(),
 void InsetText::setParagraphOwner()
 {
        for_each(paragraphs().begin(), paragraphs().end(),
index e9f7c6b7c54d8ba16f09ffb23abfc48b0a94da0e..9c9165e9515cddc98f3b227075079406b699c569 100644 (file)
@@ -34,11 +34,13 @@ class InsetTabular;
 class InsetText : public Inset {
 public:
        ///
 class InsetText : public Inset {
 public:
        ///
-       explicit InsetText(BufferParams const &);
+       explicit InsetText(Buffer const & buffer);
        ///
        InsetText();
        ///
        InsetText(InsetText const &);
        ///
        InsetText();
        ///
        InsetText(InsetText const &);
+       ///
+       void initParagraphs(Buffer const & buffer);
 
        ///
        Dimension const dimension(BufferView const &) const;
 
        ///
        Dimension const dimension(BufferView const &) const;
index 0b0ab1f388894ea933fcbfc880626c79f6477ec5..152146ac540b8c740ca3701cde0aef44c5a7cff5 100644 (file)
@@ -39,10 +39,10 @@ using namespace std;
 namespace lyx {
 
 
 namespace lyx {
 
 
-InsetWrap::InsetWrap(BufferParams const & bp, string const & type)
-       : InsetCollapsable(bp), name_(from_utf8(type))
+InsetWrap::InsetWrap(Buffer const & buf, string const & type)
+       : InsetCollapsable(buf), name_(from_utf8(type))
 {
 {
-       setLabel(_("wrap: ") + floatName(type, bp));
+       setLabel(_("wrap: ") + floatName(type, buf.params()));
        params_.type = type;
        params_.lines = 0;
        params_.placement = "o";
        params_.type = type;
        params_.lines = 0;
        params_.placement = "o";
index 789774241d89c17dfa8da11edf1b87709ebf3c7b..9bf5a551c3f64b2f1352c1de2e1290117bb5cb29 100644 (file)
@@ -45,7 +45,7 @@ public:
 class InsetWrap : public InsetCollapsable {
 public:
        ///
 class InsetWrap : public InsetCollapsable {
 public:
        ///
-       InsetWrap(BufferParams const &, std::string const &);
+       InsetWrap(Buffer const &, std::string const &);
        ///
        ~InsetWrap();
        ///
        ///
        ~InsetWrap();
        ///