]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCitation.cpp
Don't add localswitch if no language changes
[lyx.git] / src / insets / InsetCitation.cpp
index 3201e83a2cb243b05e708aaf447369514b98a938..24441268984d2525395e8a913f08ab108faad25c 100644 (file)
@@ -59,6 +59,12 @@ InsetCitation::~InsetCitation()
 }
 
 
+// May well be over-ridden when session settings are loaded
+// in GuiCitation. Unfortunately, that will not happen until
+// such a dialog is created.
+bool InsetCitation::last_literal = true;
+
+
 ParamInfo const & InsetCitation::findInfo(string const & /* cmdName */)
 {
        static ParamInfo param_info_;
@@ -383,9 +389,12 @@ docstring InsetCitation::complexLabel(bool for_xhtml) const
        buffer().params().documentClass().addCiteMacro("!textafter", to_utf8(after));
        */
        docstring label;
-       vector<docstring> keys = getVectorFromString(key);
+       // we only really want the last 'false', to suppress trimming, but
+       // we need to give the other defaults, too, to set it.
+       vector<docstring> keys =
+               getVectorFromString(key, from_ascii(","), false, false);
        CitationStyle cs = getCitationStyle(buffer().masterParams(),
-                                           cite_type, buffer().masterParams().citeStyles());
+                       cite_type, buffer().masterParams().citeStyles());
        bool const qualified = cs.hasQualifiedList
                && (keys.size() > 1
                    || !getParam("pretextlist").empty()
@@ -421,8 +430,7 @@ docstring InsetCitation::basicLabel(bool for_xhtml) const
        do {
                // if there is no comma, then everything goes into key
                // and keys will be empty.
-               keys = trim(split(keys, key, ','));
-               key = trim(key);
+               keys = split(keys, key, ',');
                if (!label.empty())
                        label += ", ";
                label += wrapCitation(key, key, for_xhtml);