mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-09 10:47:57 +00:00
Fix bug #11748.
Track the last chosen citation style when we clear the entries.
This commit is contained in:
parent
ca40d1f92a
commit
64f7da961a
@ -386,6 +386,8 @@ void GuiCitation::updateStyles(BiblioInfo const & bi)
|
|||||||
int curr = selectedLV->model()->rowCount() - 1;
|
int curr = selectedLV->model()->rowCount() - 1;
|
||||||
|
|
||||||
if (curr < 0 || selected_keys.empty()) {
|
if (curr < 0 || selected_keys.empty()) {
|
||||||
|
last_chosen_style_ =
|
||||||
|
citationStyleCO->itemData(citationStyleCO->currentIndex()).toString();
|
||||||
citationStyleCO->clear();
|
citationStyleCO->clear();
|
||||||
citationStyleCO->setEnabled(false);
|
citationStyleCO->setEnabled(false);
|
||||||
citationStyleLA->setEnabled(false);
|
citationStyleLA->setEnabled(false);
|
||||||
@ -408,7 +410,10 @@ void GuiCitation::updateStyles(BiblioInfo const & bi)
|
|||||||
// save old style selection
|
// save old style selection
|
||||||
QString const curdata =
|
QString const curdata =
|
||||||
citationStyleCO->itemData(citationStyleCO->currentIndex()).toString();
|
citationStyleCO->itemData(citationStyleCO->currentIndex()).toString();
|
||||||
QString const olddata = (curdata.isEmpty()) ? style_ : curdata;
|
QString const olddata = (curdata.isEmpty()) ?
|
||||||
|
(last_chosen_style_.isEmpty() ? style_ : last_chosen_style_): curdata;
|
||||||
|
// reset this
|
||||||
|
last_chosen_style_.clear();
|
||||||
citationStyleCO->clear();
|
citationStyleCO->clear();
|
||||||
BiblioInfo::CiteStringMap::const_iterator cit = sty.begin();
|
BiblioInfo::CiteStringMap::const_iterator cit = sty.begin();
|
||||||
BiblioInfo::CiteStringMap::const_iterator end = sty.end();
|
BiblioInfo::CiteStringMap::const_iterator end = sty.end();
|
||||||
|
@ -182,6 +182,8 @@ private:
|
|||||||
|
|
||||||
/// last used citation style
|
/// last used citation style
|
||||||
QString style_;
|
QString style_;
|
||||||
|
/// this is the last style chosen in the current dialog
|
||||||
|
QString last_chosen_style_;
|
||||||
///
|
///
|
||||||
GuiSelectionManager * selectionManager;
|
GuiSelectionManager * selectionManager;
|
||||||
/// available keys.
|
/// available keys.
|
||||||
|
Loading…
Reference in New Issue
Block a user