]> git.lyx.org Git - features.git/commitdiff
prepare for further work and a parlist thingie
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 16 Apr 2003 04:35:43 +0000 (04:35 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 16 Apr 2003 04:35:43 +0000 (04:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6823 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.C
src/ChangeLog
src/CutAndPaste.C
src/buffer.C
src/insets/ChangeLog
src/insets/insetert.C
src/paragraph_funcs.C
src/paragraph_funcs.h
src/text2.C

index 0f8c66f02e5911cd03e142987d8ad55567c7e44d..c5c5ee5e12d7b6b71b9fb7973158074bedaeb147 100644 (file)
@@ -969,7 +969,7 @@ Encoding const * BufferView::getEncoding() const
 
        LyXCursor const & c = t->cursor;
        LyXFont const font = c.par()->getFont(buffer()->params, c.pos(),
-                                             outerFont(c.par()));
+                                             outerFont(c.par(), t->ownerParagraphs()));
        return font.language()->encoding();
 }
 
index 35b19313a4be7f4a1e97f298edfa406a32a8e7fe..ae5100dd8fb434550c322747cb47d135f33a1c5f 100644 (file)
@@ -1,3 +1,20 @@
+2003-04-16  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * text2.C (getFont): adjust
+       (getLayoutFont): adjust
+       (getLabelFont): adjust
+
+       * paragraph_funcs.C (TeXOnePar): adjust
+
+       * buffer.C (simpleLinuxDocOnePar): adjust
+       (simpleDocBookOnePar): adjust
+
+       * CutAndPaste.C (pasteSelection): adjust
+
+       * BufferView.C (getEncoding): adjust
+
+       * paragraph_funcs.C (outerFont): prepare for a ParagraphList arg.
+
 2003-04-16  John Levon  <levon@movementarian.org>
 
        * lyxfind.C: use parlist stuff for search/changes
@@ -8,7 +25,7 @@
 
        * text2.C (deleteEmptyParagraphMechanism): adjust
 
-       * text2.[Ch] (ownerParagraph): delete func (both of them 
+       * text2.[Ch] (ownerParagraph): delete func (both of them
 
 2003-04-15  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
index d34da31303e8f6bd537d1c2e3b8432ff775b6ffb..0b3499746aa9653d6b7860b993e415c31ae6b4c7 100644 (file)
@@ -282,7 +282,7 @@ bool CutAndPaste::pasteSelection(Paragraph ** par, Paragraph ** endpar,
                                        tmpbuf->erase(i--);
                                }
                        } else {
-                               LyXFont f1 = tmpbuf->getFont(current_view->buffer()->params, i, outerFont(tmpbuf));
+                               LyXFont f1 = tmpbuf->getFont(current_view->buffer()->params, i, outerFont(tmpbuf, current_view->text->ownerParagraphs()));
                                LyXFont f2 = f1;
                                if (!(*par)->checkInsertChar(f1)) {
                                        tmpbuf->erase(i--);
index acfb00f15d16de8cd816f97b2d276a387b978603..aa177d7d4b2b1011bc6d8f46d23233459b7a46b7 100644 (file)
@@ -1433,7 +1433,7 @@ void Buffer::simpleLinuxDocOnePar(ostream & os,
                PAR_TAG tag_close = NONE;
                list < PAR_TAG > tag_open;
 
-               LyXFont const font = par->getFont(params, i, outerFont(par));
+               LyXFont const font = par->getFont(params, i, outerFont(par, paragraphs));
 
                if (font_old.family() != font.family()) {
                        switch (family_type) {
@@ -1922,7 +1922,7 @@ void Buffer::simpleDocBookOnePar(ostream & os,
 
        // parsing main loop
        for (pos_type i = 0; i < par->size(); ++i) {
-               LyXFont font = par->getFont(params, i, outerFont(par));
+               LyXFont font = par->getFont(params, i, outerFont(par, paragraphs));
 
                // handle <emphasis> tag
                if (font_old.emph() != font.emph()) {
index 68cd136508fea57f840a7333d19ba4baf67a7929..b94e64e36b8132ce92287cf4181a60414f5f2085 100644 (file)
@@ -1,3 +1,7 @@
+2003-04-16  Lars Gullik Bjønnes  <larsbj@gullik.net>
+
+       * insetert.C (read): use ParagraphList::iterator.
+
 2003-04-15  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * insetquotes.C (latex): comment some code and add warnings.
index 15c01498c6bf3adab0a9acfd3ca46a8a5e315a9c..0e53c9db9ced9656d26f70f448f22ee509a41c91 100644 (file)
@@ -158,13 +158,14 @@ void InsetERT::read(Buffer const * buf, LyXLex & lex)
        LyXFont font(LyXFont::ALL_INHERIT, latex_language);
        font.setFamily(LyXFont::TYPEWRITER_FAMILY);
        font.setColor(LColor::latex);
-       Paragraph * par = inset.paragraph();
-       while (par) {
-               pos_type siz = par->size();
+
+       ParagraphList::iterator pit = inset.paragraphs.begin();
+       ParagraphList::iterator pend = inset.paragraphs.end();
+       for (; pit != pend; ++pit) {
+               pos_type siz = pit->size();
                for (pos_type i = 0; i < siz; ++i) {
-                       par->setFont(i, font);
+                       pit->setFont(i, font);
                }
-               par = par->next();
        }
 #endif
 
index b19226190f5c57812c629852206d262295601f56..2a3994f38cc8867aeb1c6b8366a7e810b02169a1 100644 (file)
@@ -471,7 +471,7 @@ TeXOnePar(Buffer const * buf,
                }
 
                if (pit->params().lineTop()) {
-                       os << "\\lyxline{\\" << pit->getFont(bparams, 0, outerFont(pit)).latexSize() << '}'
+                       os << "\\lyxline{\\" << pit->getFont(bparams, 0, outerFont(pit, paragraphs)).latexSize() << '}'
                           << "\\vspace{-1\\parskip}";
                        further_blank_line = true;
                }
@@ -550,7 +550,8 @@ TeXOnePar(Buffer const * buf,
                break;
        }
 
-       bool need_par = pit->simpleTeXOnePar(buf, bparams, outerFont(pit),
+       bool need_par = pit->simpleTeXOnePar(buf, bparams,
+                                            outerFont(pit, paragraphs),
                                             os, texrow, moving_arg);
 
        // Make sure that \\par is done with the font of the last
@@ -562,7 +563,7 @@ TeXOnePar(Buffer const * buf,
        // Is this really needed ? (Dekel)
        // We do not need to use to change the font for the last paragraph
        // or for a command.
-       LyXFont const outerfont(outerFont(pit));
+       LyXFont const outerfont(outerFont(pit, paragraphs));
 
        LyXFont const font =
                (pit->empty()
@@ -1029,7 +1030,8 @@ int readParagraph(Buffer & buf, Paragraph & par, LyXLex & lex)
 }
 
 
-LyXFont const outerFont(ParagraphList::iterator pit)
+LyXFont const outerFont(ParagraphList::iterator pit,
+                       ParagraphList const & /*plist*/)
 {
        Paragraph::depth_type par_depth = pit->getDepth();
        LyXFont tmpfont(LyXFont::ALL_INHERIT);
index 4e42e4985cecd01177b0d9c62e6927e39c0ca700..433c5a04b2e9bc35b988c57b1cbf7c5d1b340b40 100644 (file)
@@ -69,6 +69,7 @@ int readParagraph(Buffer & buf, Paragraph & par, LyXLex & lex);
 LyXFont const realizeFont(LyXFont const & font,
                          BufferParams const & params);
 
-LyXFont const outerFont(ParagraphList::iterator pit);
+LyXFont const outerFont(ParagraphList::iterator pit,
+                       ParagraphList const & plist);
 
 #endif // PARAGRAPH_FUNCS_H
index 3f4bfb310915f5ab1a0ea8b78e9c4aef47b9c27b..32c8f0c1b268cdad2624985a8de430d1c3d80f15 100644 (file)
@@ -150,7 +150,7 @@ LyXFont const LyXText::getFont(Buffer const * buf, ParagraphList::iterator pit,
                pit->inInset()->getDrawFont(tmpfont);
 
        // Realize with the fonts of lesser depth.
-       tmpfont.realize(outerFont(pit));
+       tmpfont.realize(outerFont(pit, ownerParagraphs()));
 
        return realizeFont(tmpfont, buf->params);
 }
@@ -167,7 +167,7 @@ LyXFont const LyXText::getLayoutFont(Buffer const * buf,
 
        LyXFont font(layout->font);
        // Realize with the fonts of lesser depth.
-       font.realize(outerFont(pit));
+       font.realize(outerFont(pit, ownerParagraphs()));
 
        return realizeFont(font, buf->params);
 }
@@ -184,7 +184,7 @@ LyXFont const LyXText::getLabelFont(Buffer const * buf,
 
        LyXFont font(layout->labelfont);
        // Realize with the fonts of lesser depth.
-       font.realize(outerFont(pit));
+       font.realize(outerFont(pit, ownerParagraphs()));
 
        return realizeFont(layout->labelfont, buf->params);
 }