]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetText.cpp
InsetTabular.cpp: fix #6585 also for wrapped floats - thanks Vincent
[lyx.git] / src / insets / InsetText.cpp
index 157ab71181bf358f76420f4197a24dd4cb3b58d9..9cccee55c538ba30298928a203eaeae32d4539ee 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "InsetText.h"
 
-#include "insets/InsetOptArg.h"
+#include "insets/InsetArgument.h"
 
 #include "buffer_funcs.h"
 #include "Buffer.h"
@@ -397,7 +397,7 @@ int InsetText::latex(odocstream & os, OutputParams const & runparams) const
        }
        OutputParams rp = runparams;
        if (il.isPassThru())
-               rp.verbatim = true;
+               rp.pass_thru = true;
        if (il.isNeedProtect())
                rp.moving_arg = true;
 
@@ -405,6 +405,7 @@ int InsetText::latex(odocstream & os, OutputParams const & runparams) const
        TexRow texrow;
        latexParagraphs(buffer(), text_, os, texrow, rp);
        rows += texrow.rows();
+       runparams.encoding = rp.encoding;
 
        if (!il.latexname().empty()) {
                if (il.latextype() == InsetLayout::COMMAND) {
@@ -699,12 +700,12 @@ void InsetText::addToToc(DocIterator const & cdit)
                        //lyxerr << (void*)&inset << " code: " << inset.lyxCode() << std::endl;
                        inset.addToToc(dit);
                        switch (inset.lyxCode()) {
-                       case OPTARG_CODE: {
+                       case ARG_CODE: {
                                if (!tocstring.empty())
                                        break;
                                dit.pos() = 0;
                                Paragraph const & insetpar =
-                                       *static_cast<InsetOptArg&>(inset).paragraphs().begin();
+                                       *static_cast<InsetArgument&>(inset).paragraphs().begin();
                                if (!par.labelString().empty())
                                        tocstring = par.labelString() + ' ';
                                tocstring += insetpar.asString(AS_STR_INSETS);
@@ -721,7 +722,8 @@ void InsetText::addToToc(DocIterator const & cdit)
                        // insert this into the table of contents
                        if (tocstring.empty())
                                tocstring = par.asString(AS_STR_LABEL | AS_STR_INSETS);
-                       toc.push_back(TocItem(dit, toclevel - min_toclevel, tocstring));
+                       toc.push_back(TocItem(dit, toclevel - min_toclevel,
+                               tocstring, tocstring));
                }
                
                // And now the list of changes.
@@ -818,6 +820,18 @@ docstring InsetText::contextMenu(BufferView const &, int, int) const
 }
 
 
+docstring InsetText::toolTipText() const
+{
+       OutputParams rp(&buffer().params().encoding());
+       odocstringstream ods;
+       // do not remove InsetText::, otherwise there
+       // will be no tooltip text for InsetNotes
+       InsetText::plaintext(ods, rp);
+       docstring const content_tip = ods.str();
+       return support::wrapParas(content_tip, 4);
+}
+
+
 InsetCaption const * InsetText::getCaptionInset() const
 {
        ParagraphList::const_iterator pit = paragraphs().begin();