]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Menus.cpp
Implement CiteItem in the chain
[lyx.git] / src / frontends / qt4 / Menus.cpp
index de0c887d528546993a78639e8fa75427933aac9c..cdd70fb3dc53ae2803db9f0e66ee6b5348606982 100644 (file)
@@ -1543,20 +1543,20 @@ void MenuDefinition::expandCiteStyles(BufferView const * bv)
                return;
        }
 
-       docstring const & before = citinset->getParam("before");
-       docstring const & after = citinset->getParam("after");
-
        size_t const n = cmd.size();
-       bool const force = cmd[0] == 'C';
-       bool const full = cmd[n] == '*';
+       bool const force = isUpperCase(cmd[0]);
+       bool const star = cmd[n] == '*';
 
        vector<docstring> const keys = getVectorFromString(key);
 
        vector<CitationStyle> const citeStyleList = buf->params().citeStyles();
-       static const size_t max_length = 40;
+       CiteItem ci;
+       ci.textBefore = citinset->getParam("before");
+       ci.textAfter = citinset->getParam("after");
+       ci.context = CiteItem::Dialog;
+       ci.max_size = 40;
        vector<docstring> citeStrings =
-               buf->masterBibInfo().getCiteStrings(keys, citeStyleList, bv->buffer(),
-               before, after, from_utf8("dialog"), max_length);
+               buf->masterBibInfo().getCiteStrings(keys, citeStyleList, bv->buffer(), ci);
 
        vector<docstring>::const_iterator cit = citeStrings.begin();
        vector<docstring>::const_iterator end = citeStrings.end();
@@ -1565,7 +1565,7 @@ void MenuDefinition::expandCiteStyles(BufferView const * bv)
                docstring label = *cit;
                CitationStyle cs = citeStyleList[ii - 1];
                cs.forceUpperCase &= force;
-               cs.fullAuthorList &= full;
+               cs.hasStarredVersion &= star;
                addWithStatusCheck(MenuItem(MenuItem::Command, toqstr(label),
                                    FuncRequest(LFUN_INSET_MODIFY,
                                                "changetype " + from_utf8(citationStyleToString(cs)))));