]> git.lyx.org Git - lyx.git/commitdiff
Fix bug #11748.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Thu, 27 Feb 2020 04:00:09 +0000 (23:00 -0500)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Tue, 17 Mar 2020 06:01:37 +0000 (02:01 -0400)
Track the last chosen citation style when we clear the entries.

(cherry picked from commit 64f7da961a853f4ea60716129f0f22f39e451aa7)

src/frontends/qt4/GuiCitation.cpp
src/frontends/qt4/GuiCitation.h
status.23x

index 638ec7d84da8bae0750230c165d4fa973f241cd5..0a9dbbf1ee332b55b92e32f642e73d87400a1555 100644 (file)
@@ -386,6 +386,8 @@ void GuiCitation::updateStyles(BiblioInfo const & bi)
        int curr = selectedLV->model()->rowCount() - 1;
 
        if (curr < 0 || selected_keys.empty()) {
+               last_chosen_style_ =
+                       citationStyleCO->itemData(citationStyleCO->currentIndex()).toString();
                citationStyleCO->clear();
                citationStyleCO->setEnabled(false);
                citationStyleLA->setEnabled(false);
@@ -408,7 +410,10 @@ void GuiCitation::updateStyles(BiblioInfo const & bi)
        // save old style selection
        QString const curdata =
                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();
        BiblioInfo::CiteStringMap::const_iterator cit = sty.begin();
        BiblioInfo::CiteStringMap::const_iterator end = sty.end();
index 4d85c0315ae242de88656a046503284b9112318b..08a7c4c42d8372e07e1339201190f408de5b0e92 100644 (file)
@@ -183,6 +183,8 @@ private:
 
        /// last used citation style
        QString style_;
+        /// this is the last style chosen in the current dialog
+        QString last_chosen_style_;
        ///
        GuiSelectionManager * selectionManager;
        /// available keys.
index 3fbb135d68fbf1f7161981e5f7a2510a0496f9a9..cf3a79311f58408905ffa5fe7881e510a01d9919 100644 (file)
@@ -27,6 +27,8 @@ What's new
 
 * USER INTERFACE
 
+- Keep citation style when all selected citations are deleted (bug 11748).
+
 
 * DOCUMENTATION AND LOCALIZATION