]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph.C
zlib stuff
[lyx.git] / src / paragraph.C
index 84d8b2350d5fb1410c7326ae6aff25428bcfbfde..a637f98abeec94cc502283046865a552d0943da8 100644 (file)
@@ -240,6 +240,8 @@ void Paragraph::write(Buffer const * buf, ostream & os,
        }
        Changes::lyxMarkChange(os, column, curtime,
                running_change, Change(Change::UNCHANGED));
+
+       os << "\n\\end_layout\n";
 }
 
 
@@ -411,6 +413,21 @@ LyXFont const Paragraph::getFontSettings(BufferParams const & bparams,
        return retfont;
 }
 
+lyx::pos_type 
+Paragraph::getEndPosOfFontSpan(lyx::pos_type pos) const 
+{
+       Assert(pos <= size());
+
+       Pimpl::FontList::const_iterator cit = pimpl_->fontlist.begin();
+       Pimpl::FontList::const_iterator end = pimpl_->fontlist.end();
+       for (; cit != end; ++cit) {
+               if (cit->pos() >= pos)
+                       return cit->pos();
+       }
+       // This should not happen, but if so, we take no chances.
+       return pos;
+}
+
 
 // Gets uninstantiated font setting at position 0
 LyXFont const Paragraph::getFirstFontSettings() const
@@ -445,8 +462,9 @@ LyXFont const Paragraph::getFont(BufferParams const & bparams, pos_type pos,
        LyXFont tmpfont = getFontSettings(bparams, pos);
        tmpfont.realize(layoutfont);
        tmpfont.realize(outerfont);
+       tmpfont.realize(bparams.getLyXTextClass().defaultfont());
 
-       return realizeFont(tmpfont, bparams);
+       return tmpfont;
 }
 
 
@@ -458,8 +476,9 @@ LyXFont const Paragraph::getLabelFont(BufferParams const & bparams,
        LyXFont tmpfont = lout->labelfont;
        tmpfont.setLanguage(getParLanguage(bparams));
        tmpfont.realize(outerfont);
+       tmpfont.realize(bparams.getLyXTextClass().defaultfont());
 
-       return realizeFont(tmpfont, bparams);
+       return tmpfont;
 }
 
 
@@ -471,8 +490,9 @@ LyXFont const Paragraph::getLayoutFont(BufferParams const & bparams,
        LyXFont tmpfont = lout->font;
        tmpfont.setLanguage(getParLanguage(bparams));
        tmpfont.realize(outerfont);
+       tmpfont.realize(bparams.getLyXTextClass().defaultfont());
 
-       return realizeFont(tmpfont, bparams);
+       return tmpfont;
 }
 
 
@@ -1141,15 +1161,10 @@ bool Paragraph::isWord(pos_type pos) const
 Language const *
 Paragraph::getParLanguage(BufferParams const & bparams) const
 {
-       if (!empty()) {
+       if (!empty())
                return getFirstFontSettings().language();
 #warning FIXME we should check the prev par as well (Lgb)
-#if 0
-       } else if (previous_) {
-               return previous_->getParLanguage(bparams);
-#endif
-       }else
-               return bparams.language;
+       return bparams.language;
 }