]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCitation.cpp
Consider possibility of empty tooltip
[lyx.git] / src / frontends / qt4 / GuiCitation.cpp
index b2fe9a9239eafed1522c09fecd2b4a64f941b2bd..5889d68f7c7abd668f41f78a624715aab0007c8f 100644 (file)
@@ -270,21 +270,20 @@ void GuiCitation::updateFormatting(CitationStyle currentStyle)
        if (starred && !currentStyle.stardesc.empty()) {
                string val =
                        bp.documentClass().getCiteMacro(bp.citeEngineType(), currentStyle.stardesc);
+               docstring guistring;
                if (!val.empty()) {
-                       docstring const trans =
-                               translateIfPossible(from_utf8(val));
-                       starredCB->setText(toqstr(trans));
+                       guistring = translateIfPossible(from_utf8(val));
+                       starredCB->setText(toqstr(guistring));
                        starredCB->setEnabled(haveSelection);
                }
                if (!currentStyle.startooltip.empty()) {
                        val = bp.documentClass().getCiteMacro(bp.citeEngineType(),
                                                              currentStyle.startooltip);
-                       if (!val.empty()) {
-                               docstring const trans =
-                                       translateIfPossible(from_utf8(val));
-                               starredCB->setToolTip(toqstr(trans));
-                       }
+                       if (!val.empty())
+                               guistring = translateIfPossible(from_utf8(val));
                }
+               // Tooltip might also be empty
+               starredCB->setToolTip(toqstr(guistring));
        } else {
                // This is the default meaning of the starred commands
                starredCB->setText(qt_("All aut&hors"));