]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFloat.cpp
Fix bug http://bugzilla.lyx.org/show_bug.cgi?id=4910 by creating InsetText::addToToc().
[lyx.git] / src / insets / InsetFloat.cpp
index f449e97783e7aec983cd436187364b2fa9603c67..a98d52170f57a932c5e43ea2bcb0f72da698e8f0 100644 (file)
@@ -129,8 +129,15 @@ InsetFloat::~InsetFloat()
 
 docstring InsetFloat::toolTip(BufferView const & bv, int x, int y) const
 {
+       if (InsetCollapsable::toolTip(bv, x, y).empty())
+               return docstring();
+
+       docstring default_tip;
+       if (isOpen())
+               default_tip = _("Left-click to collapse the inset");
+       else
+               default_tip = _("Left-click to open the inset");
        OutputParams rp(&buffer().params().encoding());
-       docstring default_tip = InsetCollapsable::toolTip(bv, x, y);
        docstring caption_tip = getCaptionText(rp);
        if (!isOpen() && !caption_tip.empty())
                return caption_tip + '\n' + default_tip;
@@ -173,7 +180,7 @@ bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
 
        case LFUN_INSET_MODIFY:
        case LFUN_INSET_DIALOG_UPDATE:
-               flag.enabled(true);
+               flag.setEnabled(true);
                return true;
 
        default:
@@ -184,7 +191,7 @@ bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
 
 void InsetFloat::updateLabels(ParIterator const & it)
 {
-       Counters & cnts = buffer().params().documentClass().counters();
+       Counters & cnts = buffer().masterBuffer()->params().documentClass().counters();
        string const saveflt = cnts.current_float();
        bool const savesubflt = cnts.isSubfloat();