]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSelectionManager.cpp
Also display the info about BibTeX databases in the TeX info panel.
[lyx.git] / src / frontends / qt4 / GuiSelectionManager.cpp
index 0981adc1ab75254c04c7bb2a3e81b7a5a903c486..825115cb3a368fff67470dc774a2269ff427bd25 100644 (file)
 #undef ControlModifier
 #endif
 
+#ifdef FocusIn
+#undef FocusIn
+#endif
+
 
 namespace lyx {
 namespace frontend {
@@ -45,15 +49,10 @@ GuiSelectionManager::GuiSelectionManager(
        QPushButton * down,
        QAbstractListModel * amod,
        QAbstractListModel * smod)
+  : availableLV(avail), selectedLV(sel), addPB(add), deletePB(del),
+               upPB(up), downPB(down), availableModel(amod), selectedModel(smod),
+    selectedHasFocus_(false)
 {
-       availableLV = avail;
-       selectedLV = sel;
-       addPB = add;
-       deletePB = del;
-       upPB = up;
-       downPB = down;
-       availableModel = amod;
-       selectedModel = smod;
        
        selectedLV->setModel(smod);
        availableLV->setModel(amod);
@@ -225,8 +224,10 @@ void GuiSelectionManager::selectedChanged(const QModelIndex & idx, const QModelI
 bool GuiSelectionManager::insertRowToSelected(int i, 
                QMap<int, QVariant> const & itemData)
 {
-       if (i <= -1 || i > selectedModel->rowCount())
-               return false;
+       if (i <= -1)
+               i = 0;
+       if (i > selectedModel->rowCount())
+               i = selectedModel->rowCount();
        if (!selectedModel->insertRow(i))
                return false;
        return selectedModel->setItemData(selectedModel->index(i), itemData);