]> git.lyx.org Git - lyx.git/blobdiff - src/Paragraph.cpp
Update Win installer for new dictionary links. Untested.
[lyx.git] / src / Paragraph.cpp
index 333aeb8862cbda0c70e4d2b0832d5dcfcba89132..4282defa4a8fc5fed58bd71507138b012a8a6537 100644 (file)
@@ -2375,8 +2375,8 @@ bool Paragraph::allowedInContext(Cursor const & cur, InsetLayout const & il) con
        if (in_allowed_inset && inInset().asInsetText() && il.allowedOccurrences() != -1) {
                ParagraphList & pars = cur.text()->paragraphs();
                        for (Paragraph const & par : pars) {
-                               for (auto const & table : par.insetList())
-                               if (table.inset->getLayout().name() == il.name())
+                               for (auto const & elem : par.insetList())
+                               if (elem.inset->getLayout().name() == il.name())
                                        ++have_ins;
                        }
                if (have_ins >= il.allowedOccurrences())
@@ -2412,8 +2412,8 @@ bool Paragraph::allowedInContext(Cursor const & cur, InsetLayout const & il) con
                for (; pit <= lastpit; ++pit) {
                        if (&pars[pit].layout() != d->layout_)
                                break;
-                       for (auto const & table : pars[pit].insetList())
-                               if (table.inset->getLayout().name() == il.name())
+                       for (auto const & elem : pars[pit].insetList())
+                               if (elem.inset->getLayout().name() == il.name())
                                        ++have_ins;
                }
                if (have_ins >= il.allowedOccurrences())
@@ -3150,8 +3150,9 @@ void Paragraph::latex(BufferParams const & bparams,
                                }
                        }
                } else if (i >= start_pos && (end_pos == -1 || i < end_pos)) {
-                       if (!bparams.useNonTeXFonts)
-                         script = Encodings::isKnownScriptChar(c);
+                       if (!bparams.useNonTeXFonts && !runparams.pass_thru
+                           && !contains(runparams.pass_thru_chars, c))
+                               script = Encodings::isKnownScriptChar(c);
                        if (script != alien_script) {
                                if (!alien_script.empty()) {
                                        os << "}";
@@ -3635,11 +3636,11 @@ std::tuple<vector<xml::FontTag>, vector<xml::EndFontTag>> computeDocBookFontSwit
 
 std::tuple<std::vector<docstring>, std::vector<docstring>, std::vector<docstring>>
     Paragraph::simpleDocBookOnePar(Buffer const & buf,
-                                                      OutputParams const & runparams,
-                                                      Font const & outerfont,
-                                                      pos_type initial,
-                                                      bool is_last_par,
-                                                      bool ignore_fonts) const
+                                   OutputParams const & runparams,
+                                   Font const & outerfont,
+                                   pos_type initial,
+                                   bool is_last_par,
+                                   bool ignore_fonts) const
 {
        // Return values: segregation of the content of this paragraph.
        std::vector<docstring> prependedParagraphs; // Anything that must be output before the main tag of this paragraph.
@@ -3669,6 +3670,7 @@ std::tuple<std::vector<docstring>, std::vector<docstring>, std::vector<docstring
             }
         }
     }
+       rp.lastid = id();
 
     // State variables for the main loop.
     auto xs = new XMLStream(os); // XMLStream has no copy constructor: to create a new object, the only solution
@@ -4282,9 +4284,10 @@ bool Paragraph::isHardHyphenOrApostrophe(pos_type pos) const
 bool Paragraph::needsCProtection(bool const fragile) const
 {
        // first check the layout of the paragraph, but only in insets
+       // and not in tables
        InsetText const * textinset = inInset().asInsetText();
        bool const maintext = textinset
-               ? textinset->text().isMainText()
+               ? textinset->text().isMainText() || inInset().lyxCode() == CELL_CODE
                : false;
 
        if (!maintext && layout().needcprotect) {
@@ -4422,7 +4425,7 @@ docstring Paragraph::asString(pos_type beg, pos_type end, int options, const Out
                else if (c == META_INSET && (options & AS_STR_INSETS)) {
                        if (c == META_INSET && (options & AS_STR_PLAINTEXT)) {
                                LASSERT(runparams != nullptr, return docstring());
-                               if (runparams->find_effective() && getInset(i)->hasToString())
+                               if (runparams->find_effective() && getInset(i)->findUsesToString())
                                        getInset(i)->toString(os);
                                else
                                        getInset(i)->plaintext(os, *runparams);