]> git.lyx.org Git - lyx.git/commitdiff
GuiRef: do not hide labels that start with ':'
authorScott Kostyshak <skostysh@lyx.org>
Fri, 19 Apr 2013 11:48:15 +0000 (07:48 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Mon, 22 Apr 2013 19:39:16 +0000 (15:39 -0400)
If a label starts with ':' and 'Group' is checked,
the label is now shown under "<No prefix>" instead of
not shown.

Note that labels starting with ':' can be valid in LaTeX.

src/frontends/qt4/GuiRef.cpp

index 9e647504866b850014d675b97c91e01a0a4ba592..15e6583623743fa9e477c0f2ec81cf84272fd777 100644 (file)
@@ -392,11 +392,11 @@ void GuiRef::redoRefs()
                                QString const ref = refsStrings.at(i);
                                if ((ref.startsWith(cat + QString(":")))
                                    || (cat == qt_("<No prefix>")
-                                       && !ref.contains(":"))) {
-                                       QTreeWidgetItem * child =
-                                               new QTreeWidgetItem(item);
-                                       child->setText(0, ref);
-                                       item->addChild(child);
+                                      && (!ref.mid(1).contains(":") || ref.left(1).contains(":")))) {
+                                               QTreeWidgetItem * child =
+                                                       new QTreeWidgetItem(item);
+                                               child->setText(0, ref);
+                                               item->addChild(child);
                                }
                        }
                        refsCats.append(item);