On 26/09/2008 14:20, Jean-Marc Lasgouttes wrote:
Abdelrazak Younes<[EMAIL PROTECTED]>  writes:
On 24/09/2008 05:43, Jack M. Lyon wrote:
It would also be nice to display each index entry in its entirety rather
than just a snippet . . .

This is implemented in the attached patch. I think this is safe for
rc3 Jose but this is your call.

+       buffer().tocBackend().toc("index").push_back(TocItem(pit, 0, 
plaintext()));

Please do not use plaintext() for that. We have to sort it out properly,
but for now TOC stuff should use the textString() method of the insets.
The difference is in particular about how the contained insets are
shown.

Is the attached what you have in mind?

Abdel.

Index: insets/InsetIndex.cpp
===================================================================
--- insets/InsetIndex.cpp       (revision 26565)
+++ insets/InsetIndex.cpp       (working copy)
@@ -175,11 +175,9 @@
 {
        DocIterator pit = cpit;
        pit.push_back(CursorSlice(*this));
-
-       Toc & toc = buffer().tocBackend().toc("index");
-       docstring str;
-       str = getNewLabel(str);
-       toc.push_back(TocItem(pit, 0, str));
+       odocstringstream ods;
+       textString(ods);
+       buffer().tocBackend().toc("index").push_back(TocItem(pit, 0, 
ods.str()));
        // Proceed with the rest of the inset.
        InsetCollapsable::addToToc(cpit);
 }
Index: insets/InsetText.cpp
===================================================================
--- insets/InsetText.cpp        (revision 26565)
+++ insets/InsetText.cpp        (working copy)
@@ -284,6 +284,16 @@
 }
 
 
+void InsetText::textString(odocstream & os) const
+{
+       OutputParams rp(&buffer().params().encoding());
+       ParagraphList::const_iterator it = paragraphs().begin();
+       ParagraphList::const_iterator end = paragraphs().end();
+       for (; it != end; ++it)
+               os << it->asString(AS_STR_LABEL | AS_STR_INSETS);
+}
+
+
 int InsetText::plaintext(odocstream & os, OutputParams const & runparams) const
 {
        ParagraphList::const_iterator beg = paragraphs().begin();
Index: insets/InsetText.h
===================================================================
--- insets/InsetText.h  (revision 26565)
+++ insets/InsetText.h  (working copy)
@@ -70,8 +70,12 @@
        ///
        int latex(odocstream &, OutputParams const &) const;
        ///
+       docstring plaintext() const;
+       ///
        int plaintext(odocstream &, OutputParams const &) const;
        ///
+       void textString(odocstream &) const;
+       ///
        int docbook(odocstream &, OutputParams const &) const;
        ///
        void validate(LaTeXFeatures & features) const;

Reply via email to