]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetText.cpp
de.po
[lyx.git] / src / insets / InsetText.cpp
index 107753e8ab7aaa433ae82b3cf230155b2fd8a798..9cc3e002d284dfd0c66c6c34a24ce9e87928bfa2 100644 (file)
@@ -140,7 +140,7 @@ void InsetText::clear()
 Dimension const InsetText::dimensionHelper(BufferView const & bv) const
 {
        TextMetrics const & tm = bv.textMetrics(&text_);
-       Dimension dim = tm.dimension();
+       Dimension dim = tm.dim();
        dim.wid += 2 * TEXT_TO_INSET_OFFSET;
        dim.des += TEXT_TO_INSET_OFFSET;
        dim.asc += TEXT_TO_INSET_OFFSET;
@@ -499,14 +499,20 @@ void InsetText::latex(otexstream & os, OutputParams const & runparams) const
                rp.pass_thru = true;
        if (il.isNeedProtect())
                rp.moving_arg = true;
+       if (il.isNeedMBoxProtect())
+               ++rp.inulemcmd;
        if (!il.passThruChars().empty())
                rp.pass_thru_chars += il.passThruChars();
+       if (!il.newlineCmd().empty())
+               rp.newlinecmd = il.newlineCmd();
        rp.par_begin = 0;
        rp.par_end = paragraphs().size();
 
        // Output the contents of the inset
        latexParagraphs(buffer(), text_, os, rp);
        runparams.encoding = rp.encoding;
+       // Pass the post_macros upstream
+       runparams.post_macro = rp.post_macro;
 
        if (!il.rightdelim().empty())
                os << il.rightdelim();
@@ -763,12 +769,13 @@ ParagraphList & InsetText::paragraphs()
 }
 
 
-bool InsetText::hasCProtectContent(bool const fragile) const
+bool InsetText::hasCProtectContent(bool fragile) const
 {
+       fragile |= getLayout().isNeedProtect();
        ParagraphList const & pars = paragraphs();
-       pit_type pend = paragraphs().size();
+       pit_type pend = pit_type(paragraphs().size());
        for (pit_type pit = 0; pit != pend; ++pit) {
-               Paragraph const & par = pars[pit];
+               Paragraph const & par = pars[size_type(pit)];
                if (par.needsCProtection(fragile))
                        return true;
        }
@@ -1121,10 +1128,10 @@ bool InsetText::needsCProtection(bool const maintext, bool const fragile) const
                '&', '_', '$', '%', '#', '^', '{', '}', '\\'};
 
        ParagraphList const & pars = paragraphs();
-       pit_type pend = paragraphs().size();
+       pit_type pend = pit_type(paragraphs().size());
 
        for (pit_type pit = 0; pit != pend; ++pit) {
-               Paragraph const & par = pars[pit];
+               Paragraph const & par = pars[size_type(pit)];
                if (par.needsCProtection(fragile))
                        return true;
                docstring const pars = par.asString();