]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetText.cpp
de.po
[lyx.git] / src / insets / InsetText.cpp
index 78d5ad5e899ab67f8d7adede7495e617d205c5f3..85da8dd4ec4c35a18f608d1509b203b271631014 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;
@@ -232,12 +232,6 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const
                tm.draw(pi, x + TEXT_TO_INSET_OFFSET, y);
        }
 
-       if (canPaintChange(*pi.base.bv) && (!change_drawn || pi.change_.deleted()))
-               // Do not draw the change tracking cue if already done by RowPainter and
-               // do not draw the cue for INSERTED if the information is already in the
-               // color of the frame
-               pi.change_.paintCue(pi, xframe, yframe, xframe + w, yframe + h);
-
        if (drawFrame_) {
                // Change color of the frame in tracked changes, like for tabulars.
                // Only do so if the color is not custom. But do so even if RowPainter
@@ -258,6 +252,12 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const
                        c = frameColor();
                pi.pain.rectangle(xframe, yframe, w, h, c);
        }
+
+       if (canPaintChange(*pi.base.bv) && (!change_drawn || pi.change_.deleted()))
+               // Do not draw the change tracking cue if already done by RowPainter and
+               // do not draw the cue for INSERTED if the information is already in the
+               // color of the frame
+               pi.change_.paintCue(pi, xframe, yframe, xframe + w, yframe + h);
 }
 
 
@@ -499,6 +499,8 @@ 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();
        rp.par_begin = 0;
@@ -507,6 +509,8 @@ void InsetText::latex(otexstream & os, OutputParams const & runparams) const
        // 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();
@@ -814,13 +818,13 @@ void InsetText::updateBuffer(ParIterator const & it, UpdateType utype)
                // Note that we do not need to call:
                //      tclass.counters().clearLastLayout()
                // since we are saving and restoring the existing counters, etc.
-               Counters const savecnt = tclass.counters();
+               Counters savecnt = tclass.counters();
                tclass.counters().reset();
                // we need float information even in note insets (#9760)
                tclass.counters().current_float(savecnt.current_float());
                tclass.counters().isSubfloat(savecnt.isSubfloat());
                buffer().updateBuffer(it2, utype);
-               tclass.counters() = savecnt;
+               tclass.counters() = move(savecnt);
        }
 }
 
@@ -1071,7 +1075,11 @@ docstring InsetText::toolTipText(docstring prefix, size_t const len) const
        for (; it != end; ++it) {
                if (it != beg)
                        oss << '\n';
+               if ((*it).isRTL(buffer().params()))
+                       oss << "<div dir=\"rtl\">";
                writePlaintextParagraph(buffer(), *it, oss, rp, ref_printed, len);
+               if ((*it).isRTL(buffer().params()))
+                       oss << "</div>";
                if (oss.tellp() >= 0 && size_t(oss.tellp()) > len)
                        break;
        }