]> git.lyx.org Git - lyx.git/blobdiff - src/paragraph_pimpl.C
next step...
[lyx.git] / src / paragraph_pimpl.C
index b021e805025398fe3a0a8fcdde22759c2569795b..a2a31eb5fa3a627a49cb40a93f56231604dd6904 100644 (file)
@@ -83,15 +83,15 @@ Paragraph::Pimpl::getChar(Paragraph::size_type pos) const
 
 
 void Paragraph::Pimpl::setChar(Paragraph::size_type pos,
-                              Paragraph::value_type c)
+                               Paragraph::value_type c)
 {
        text[pos] = c;
 }
 
 
 void Paragraph::Pimpl::insertChar(Paragraph::size_type pos,
-                                 Paragraph::value_type c,
-                                 LyXFont const & font)
+                                  Paragraph::value_type c,
+                                  LyXFont const & font)
 {
        lyx::Assert(pos <= size());
 
@@ -100,19 +100,22 @@ void Paragraph::Pimpl::insertChar(Paragraph::size_type pos,
        // Update the font table.
        FontTable search_font(pos, LyXFont());
        for (FontList::iterator it = std::lower_bound(fontlist.begin(),
-                                                     fontlist.end(),
-                                                     search_font, matchFT());
+                                                     fontlist.end(),
+                                                     search_font, matchFT());
             it != fontlist.end(); ++it)
+       {
                it->pos(it->pos() + 1);
+       }
    
        // Update the inset table.
        InsetTable search_inset(pos, 0);
        for (InsetList::iterator it = std::lower_bound(owner_->insetlist.begin(),
-                                                      owner_->insetlist.end(),
-                                                      search_inset, matchIT());
+                                                      owner_->insetlist.end(),
+                                                      search_inset, matchIT());
             it != owner_->insetlist.end(); ++it)
+       {
                ++it->pos;
-
+       }
        owner_->setFont(pos, font);
 }
 
@@ -284,13 +287,14 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
                                os << "}";
 
                        if (tmp) {
+                               for (int j = 0; j < tmp; ++j) {
+                                       texrow.newline();
+                               }
+                               texrow.start(owner_, i + 1);
                                column = 0;
                        } else {
                                column += int(os.tellp()) - len;
                        }
-                       for (; tmp--;) {
-                               texrow.newline();
-                       }
                }
        }
        break;
@@ -323,10 +327,13 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
                case '°': case '±': case '²': case '³':  
                case '×': case '÷': case '¹': case 'ª':
                case 'º': case '¬': case 'µ':
-                       if (bparams.inputenc == "latin1" ||
+                       if ((bparams.inputenc == "latin1" ||
+                            bparams.inputenc == "latin9") ||
                            (bparams.inputenc == "auto" &&
-                            font.language()->encoding()->LatexName()
-                            == "latin1")) {
+                            (font.language()->encoding()->LatexName()
+                             == "latin1" ||
+                             font.language()->encoding()->LatexName()
+                             == "latin9"))) {
                                os << "\\ensuremath{"
                                   << c
                                   << '}';
@@ -538,15 +545,25 @@ LyXFont const Paragraph::Pimpl::realizeFont(LyXFont const & font,
        while (par && par->getDepth() && !tmpfont.resolved()) {
                par = par->outerHook();
                if (par) {
+#ifndef INHERIT_LANGUAGE
+                       tmpfont.realize(textclasslist.
+                                       Style(bparams.textclass,
+                                             par->getLayout()).font);
+#else
                        tmpfont.realize(textclasslist.
                                        Style(bparams.textclass,
                                              par->getLayout()).font, bparams.language);
+#endif
                        par_depth = par->getDepth();
                }
        }
 
-       tmpfont.realize(textclasslist
-                       .TextClass(bparams.textclass)
+#ifndef INHERIT_LANGUAGE
+       tmpfont.realize(textclasslist.TextClass(bparams.textclass)
+                       .defaultfont());
+#else
+       tmpfont.realize(textclasslist.TextClass(bparams.textclass)
                        .defaultfont(), bparams.language);
+#endif
        return tmpfont; 
 }