]> git.lyx.org Git - features.git/commitdiff
Fix bug #7774. It should be fine to show the complete index entry
authorRichard Heck <rgheck@comcast.net>
Mon, 16 Jan 2012 15:08:55 +0000 (15:08 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 16 Jan 2012 15:08:55 +0000 (15:08 +0000)
in the TOC, as these generally aren't that long.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40627 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text.cpp
src/Text.h
src/insets/InsetIndex.cpp
status.20x

index 066d0f9cf95308c279b7f58fce8095ecf231d6b8..c1d782f342c05c6009f7594f2b3b5bf2192658c8 100644 (file)
@@ -69,6 +69,7 @@
 
 #include <boost/next_prior.hpp>
 
+#include <limits>
 #include <sstream>
 
 using namespace std;
@@ -1942,7 +1943,10 @@ docstring Text::asString(pit_type beg, pit_type end, int options) const
 
 void Text::forToc(docstring & os, size_t maxlen, bool shorten) const
 {
-       LASSERT(maxlen > 10, maxlen = 30);
+       if (maxlen == 0)
+               maxlen = std::numeric_limits<std::size_t>::max();
+       else
+               LASSERT(maxlen >= 8, maxlen = TOC_ENTRY_LENGTH);
        for (size_t i = 0; i != pars_.size() && os.length() < maxlen; ++i)
                pars_[i].forToc(os, maxlen);
        if (shorten && os.length() >= maxlen)
index 60b6130cc4f2ea067d156ad2ec736ef88bc4196c..c4da020cceb442e2e1fd8b2209a60ba6aa3948ae 100644 (file)
@@ -129,6 +129,8 @@ public:
        /// of \param os. If \param shorten is true, then we will shorten
        /// \param os to maxlen chars and replace the final three by "...,
        /// if \param os is longer than maxlen chars.
+       /// if \param maxlen is passed as 0, then it is ignored. (In fact,
+       /// it is reset to the maximum value for size_t.)
        void forToc(docstring & os, size_t maxlen, bool shorten = true) const;
 
        /// insert a character at cursor position
index bec5a90e097d7ac298753d86afa0e13728f943f4..0bab8008bdf9b61f84d40f894cce5a2d204b2c84 100644 (file)
@@ -356,7 +356,7 @@ void InsetIndex::addToToc(DocIterator const & cpit) const
        DocIterator pit = cpit;
        pit.push_back(CursorSlice(const_cast<InsetIndex &>(*this)));
        docstring str;
-       text().forToc(str, TOC_ENTRY_LENGTH);
+       text().forToc(str, 0);
        buffer().tocBackend().toc("index").push_back(TocItem(pit, 0, str));
        // Proceed with the rest of the inset.
        InsetCollapsable::addToToc(cpit);
index 713b8d26debfdff79f0f67585411e3835e4d6003..bc27d5e5c2b162bfe7201da3c8d4996a8927c35e 100644 (file)
@@ -180,6 +180,8 @@ What's new
 
 - Fix broken instant preview due to ghostscript on 64-bit Windows (bug 7938).
 
+- Show entire index entry in outliner (bug 7774).
+
 
 * DOCUMENTATION AND LOCALIZATION