]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCitation.cpp
Clarify that the Dialog::lyxview_ pointer is in fact a reference
[lyx.git] / src / insets / InsetCitation.cpp
index 4dcec9474e15bc5de8a5e9c0ea74af4d861d92bb..13fddd7802217c2f6015ee5c87bf2625a5bdfeb9 100644 (file)
@@ -24,6 +24,7 @@
 #include "LaTeXFeatures.h"
 #include "output_xhtml.h"
 #include "ParIterator.h"
+#include "texstream.h"
 #include "TocBackend.h"
 
 #include "support/debug.h"
@@ -165,17 +166,18 @@ docstring InsetCitation::toolTip(BufferView const & bv, int, int) const
                return _("No citations selected!");
 
        vector<docstring> keys = getVectorFromString(key);
-       vector<docstring>::const_iterator it = keys.begin();
-       vector<docstring>::const_iterator en = keys.end();
+       if (keys.size() == 1)
+               return  bi.getInfo(keys[0], buffer(), true);
+
        docstring tip;
-       for (; it != en; ++it) {
-               docstring const key_info = bi.getInfo(*it, buffer());
+       tip += "<ol>";
+       for (docstring const & key : keys) {
+               docstring const key_info = bi.getInfo(key, buffer(), true);
                if (key_info.empty())
                        continue;
-               if (!tip.empty())
-                       tip += "\n";
-               tip += wrap(key_info, -4);
+               tip += "<li>" + key_info + "</li>";
        }
+       tip += "</ol>";
        return tip;
 }
 
@@ -318,7 +320,7 @@ void InsetCitation::updateBuffer(ParIterator const &, UpdateType)
        cache.recalculate = false;
        cache.generated_label = glabel;
        unsigned int const maxLabelChars = 45;
-       cache.screen_label = glabel.substr(0, maxLabelChars);
+       cache.screen_label = glabel.substr(0, maxLabelChars + 1);
        support::truncateWithEllipsis(cache.screen_label, maxLabelChars);
 }