]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/TocWidget.cpp
Amend f441590c
[lyx.git] / src / frontends / qt4 / TocWidget.cpp
index c3b9e034ac3edd90ea730b08ceba94c996c0e679..bb15f31e2b71bf9ca7dca027c130aa4267856c0f 100644 (file)
@@ -119,16 +119,12 @@ Inset * TocWidget::itemInset() const
 
        else if (current_type_ == "branch"
                         || current_type_ == "index"
-                        || current_type_ == "change")
+                        || current_type_ == "change"
+                        || current_type_ == "table" 
+                    || current_type_ == "listing"
+                    || current_type_ == "figure")
                inset = &dit.inset();
 
-       else if (current_type_ == "table" 
-                    || current_type_ == "listing"
-                    || current_type_ == "figure") {
-               DocIterator tmp_dit(dit);
-               tmp_dit.pop_back();
-               inset = &tmp_dit.inset();
-       }
        return inset;
 }
 
@@ -157,9 +153,10 @@ bool TocWidget::getStatus(Cursor & cur, FuncRequest const & cmd,
 
        case LFUN_LABEL_COPY_AS_REFERENCE: {
                // For labels in math, we need to supply the label as a string
-               FuncRequest label_copy(LFUN_LABEL_COPY_AS_REFERENCE, item.asString());
+               FuncRequest label_copy(LFUN_LABEL_COPY_AS_REFERENCE, item.str());
                if (inset)
                        return inset->getStatus(cur, label_copy, status);
+               break;
        }
 
        default:
@@ -201,7 +198,7 @@ void TocWidget::doDispatch(Cursor & cur, FuncRequest const & cmd)
 
        case LFUN_LABEL_COPY_AS_REFERENCE: {
                // For labels in math, we need to supply the label as a string
-               FuncRequest label_copy(LFUN_LABEL_COPY_AS_REFERENCE, item.asString());
+               FuncRequest label_copy(LFUN_LABEL_COPY_AS_REFERENCE, item.str());
                if (inset)
                        inset->dispatch(cur, label_copy);
                break;