commit 3294b16bf65c6776879e471da9c7466d1ea08abe
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Fri Sep 16 19:39:53 2016 +0200

    Keep citation style settings bot within and between sessions.
    
    Fixes: #10256
---
 src/frontends/qt4/GuiCitation.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt4/GuiCitation.cpp 
b/src/frontends/qt4/GuiCitation.cpp
index a7b4af5..8972c86 100644
--- a/src/frontends/qt4/GuiCitation.cpp
+++ b/src/frontends/qt4/GuiCitation.cpp
@@ -307,7 +307,8 @@ void GuiCitation::updateStyles(BiblioInfo const & bi)
        citationStyleCO->blockSignals(true);
 
        // save old index
-       int const oldIndex = citationStyleCO->currentIndex();
+       int const curindex = citationStyleCO->currentIndex();
+       int const oldIndex = (curindex < 0) ? style_ : curindex;
        citationStyleCO->clear();
        citationStyleCO->insertItems(0, sty);
        citationStyleCO->setEnabled(true);
@@ -822,6 +823,8 @@ void GuiCitation::saveSession() const
                sessionKey() + "/casesensitive", casesense_->isChecked());
        settings.setValue(
                sessionKey() + "/autofind", instant_->isChecked());
+       settings.setValue(
+               sessionKey() + "/citestyle", style_);
 }
 
 
@@ -832,6 +835,7 @@ void GuiCitation::restoreSession()
        regexp_->setChecked(settings.value(sessionKey() + "/regex").toBool());
        casesense_->setChecked(settings.value(sessionKey() + 
"/casesensitive").toBool());
        instant_->setChecked(settings.value(sessionKey() + 
"/autofind").toBool());
+       style_ = settings.value(sessionKey() + "/citestyle").toInt();
        updateFilterHint();
 }
 

Reply via email to