Implement display of forceUpperCase

This commit is contained in:
Juergen Spitzmueller 2017-01-07 17:21:41 +01:00
parent 3a0d1d1049
commit 6933051747
4 changed files with 8 additions and 3 deletions

View File

@ -744,6 +744,8 @@ docstring BibTeXInfo::getValueForKey(string const & oldkey, Buffer const & buf,
+ " [" + operator[]("year") + "]";
else
ret = operator[]("title");
if (ci.forceUpperCase && isLowerCase(ret[0]))
ret[0] = uppercase(ret[0]);
} else if (key == "bibentry") {
// Special key to provide the full bibliography entry: see getInfo()
CiteEngineType const engine_type = buf.params().citeEngineType();

View File

@ -127,7 +127,7 @@ GuiCitation::GuiCitation(GuiView & lv)
connect(starredCB, SIGNAL(clicked()),
this, SLOT(changed()));
connect(forceuppercaseCB, SIGNAL(clicked()),
this, SLOT(changed()));
this, SLOT(updateStyles()));
connect(textBeforeED, SIGNAL(textChanged(QString)),
this, SLOT(updateStyles()));
connect(textAfterED, SIGNAL(textChanged(QString)),
@ -685,6 +685,7 @@ QStringList GuiCitation::citationStyles(BiblioInfo const & bi, size_t max_size)
CiteItem ci;
ci.textBefore = qstring_to_ucs4(textBeforeED->text());
ci.textAfter = qstring_to_ucs4(textAfterED->text());
ci.forceUpperCase = forceuppercaseCB->isChecked();
ci.context = CiteItem::Dialog;
ci.max_size = max_size;
vector<docstring> ret = bi.getCiteStrings(keys, styles, documentBuffer(), ci);

View File

@ -1553,6 +1553,7 @@ void MenuDefinition::expandCiteStyles(BufferView const * bv)
CiteItem ci;
ci.textBefore = citinset->getParam("before");
ci.textAfter = citinset->getParam("after");
ci.forceUpperCase = force;
ci.context = CiteItem::Dialog;
ci.max_size = 40;
vector<docstring> citeStrings =

View File

@ -256,8 +256,8 @@ docstring InsetCitation::complexLabel(bool for_xhtml) const
// We don't currently use the full or forceUCase fields.
string cite_type = getCmdName();
if (isUpperCase(cite_type[0]))
// If we were going to use them, this would mean ForceUCase
bool const uppercase = isUpperCase(cite_type[0]);
if (uppercase)
cite_type[0] = lowercase(cite_type[0]);
if (cite_type[cite_type.size() - 1] == '*')
// and this would mean FULL
@ -278,6 +278,7 @@ docstring InsetCitation::complexLabel(bool for_xhtml) const
CiteItem ci;
ci.textBefore = getParam("before");
ci.textAfter = getParam("after");
ci.forceUpperCase = uppercase;
ci.max_size = UINT_MAX;
if (for_xhtml) {
ci.max_key_size = UINT_MAX;