]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiRef.cpp
Use QFontMetrics information for underlines (and friends) width and position
[lyx.git] / src / frontends / qt4 / GuiRef.cpp
index 141c67bc13733ac413da9d2c4c0e39eb0f0f94a6..1150d586b20efd01204755a944abd551d4f4c3f6 100644 (file)
@@ -61,9 +61,9 @@ GuiRef::GuiRef(GuiView & lv)
                this, SLOT(changed_adaptor()));
        connect(referenceED, SIGNAL(textChanged(QString)),
                this, SLOT(changed_adaptor()));
-       connect(findLE, SIGNAL(textEdited(QString)), 
+       connect(findLE, SIGNAL(textEdited(QString)),
                this, SLOT(filterLabels()));
-       connect(csFindCB, SIGNAL(clicked()), 
+       connect(csFindCB, SIGNAL(clicked()),
                this, SLOT(filterLabels()));
        connect(nameED, SIGNAL(textChanged(QString)),
                this, SLOT(changed_adaptor()));
@@ -251,7 +251,7 @@ void GuiRef::updateContents()
 
        // insert buffer list
        bufferCO->clear();
-       FileNameList const & buffers = theBufferList().fileNames();
+       FileNameList const buffers(theBufferList().fileNames());
        for (FileNameList::const_iterator it = buffers.begin();
             it != buffers.end(); ++it) {
                bufferCO->addItem(toqstr(makeDisplayPath(it->absFileName())));
@@ -386,7 +386,7 @@ void GuiRef::redoRefs()
                        qSort(refsStrings.begin(), refsStrings.end(),
                              caseInsensitiveLessThan /*defined above*/);
        }
-       
+
        if (groupCB->isChecked()) {
                QList<QTreeWidgetItem *> refsCats;
                for (int i = 0; i < refsCategories.size(); ++i) {
@@ -428,7 +428,7 @@ void GuiRef::redoRefs()
                QTreeWidgetItemIterator it(refsTW);
                while (*it) {
                        if ((*it)->text(0) == textToFind) {
-                               refsTW->setCurrentItem(*it);
+                               refsTW->setCurrentItem(*it);
                                refsTW->setItemSelected(*it, !newInset);
                                //Make sure selected item is visible
                                refsTW->scrollToItem(*it);
@@ -455,7 +455,8 @@ void GuiRef::updateRefs()
        refs_.clear();
        int const the_buffer = bufferCO->currentIndex();
        if (the_buffer != -1) {
-               FileName const & name = theBufferList().fileNames()[the_buffer];
+               FileNameList const names(theBufferList().fileNames());
+               FileName const & name = names[the_buffer];
                Buffer const * buf = theBufferList().getBuffer(name);
                buf->getLabelList(refs_);
        }