]> git.lyx.org Git - features.git/commitdiff
Not sure why I introduced this test at r28378, but it causes pasting to
authorRichard Heck <rgheck@comcast.net>
Fri, 26 Nov 2010 17:08:40 +0000 (17:08 +0000)
committerRichard Heck <rgheck@comcast.net>
Fri, 26 Nov 2010 17:08:40 +0000 (17:08 +0000)
fail e.g., of URLs in math, since tocString() is called by
Paragraph::asString() to give us the contents of insets. Probably, I was
misled by the name, and the comment in Inset.h. That means, at least,
that this method is misnamed, but it probably means we do the wrong
thing in other cases.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36517 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/Inset.h
src/insets/InsetText.cpp

index b6084d530995f063d243d03061df7f97cdfea743..b39c59cc86df00de3d51f3c4f5dc3ac04897733c 100644 (file)
@@ -319,6 +319,10 @@ public:
        /// normal stream, and which will in fact be written after the current
        /// paragraph closes. this is appropriate e.g. for floats.
        virtual docstring xhtml(XHTMLStream & xs, OutputParams const &) const;
+
+       // FIXME This method is used for things other than generating strings
+       // for the TOC. E.g., it is called by Paragraph::asString() to get the
+       // contents of the inset. These two functions should be disentangled.
        /// the string that is passed to the TOC
        virtual void tocString(odocstream &) const {}
 
index 5de6a2f02543bc04e2ca95bdc1a07309d233b87b..c73d5103779aa41f28ad357ff60924a856db8a33 100644 (file)
@@ -667,8 +667,6 @@ void InsetText::updateBuffer(ParIterator const & it, UpdateType utype)
 
 void InsetText::tocString(odocstream & os) const
 {
-       if (!getLayout().isInToc())
-               return;
        os << text().asString(0, 1, AS_STR_LABEL | AS_STR_INSETS);
 }