The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 427fa812e9774ddf82a6f3c92071c61b0bc61540
Author: Julien Rioux <[email protected]>
Date:   Tue Jan 15 15:07:58 2013 +0100

    Regenerate lib/CREDITS.

diff --git a/lib/CREDITS b/lib/CREDITS
index adc9010..5631bb3 100644
--- a/lib/CREDITS
+++ b/lib/CREDITS
@@ -46,6 +46,9 @@
 @bKornel Benko
 @iE-mail: Kornel.Benko () berlin ! de
    small bugfixes, CMake build system, Slovak translation
+@bJacob Bishop
+@iE-mail: bishop.jacob () gmail ! com
+   APA 6 Layout
 @bPunyashloka Biswal
 @iE-mail: punya.biswal () gmail ! com
    Bug fixes
@@ -217,6 +220,9 @@
 @bAmir Karger
 @iE-mail: amirkarger () gmail ! com
    Tutorial, reLyX: the LaTeX to LyX translator
+@bZahari Dmitrov Kassabov
+@iE-mail: zaharid () gmail ! com
+   Bug fixes
 @bCarmen Kauffmann
    Original name that is now two character shorter
 @bKDE Artists
@@ -360,6 +366,9 @@
 @bGeoffroy Piroux
 @iE-mail: piroux () fyma ! ucl ! ac ! be
    Mathematica backend for mathed
+@bBenjamin Piwowarski
+@iE-mail: benjamin ! piwowarski () lip6 ! fr
+   AppleScript, integration with bibliography managers
 @bNeoklis Polyzotis
 @iE-mail: alkis () soe ! ucsc ! edu
    Keymap work

commit 12d6de7e704eea8450f841cd2c7d6b3810f46461
Author: Julien Rioux <[email protected]>
Date:   Tue Jan 15 15:07:32 2013 +0100

    Add Benjamin Piwowarski to contributors. Welcome to LyX!

diff --git a/lib/generate_contributions.py b/lib/generate_contributions.py
index afac963..01b70d6 100755
--- a/lib/generate_contributions.py
+++ b/lib/generate_contributions.py
@@ -1289,6 +1289,14 @@ contributers = [
                  "",
                  u"Mathematica backend for mathed"),
 
+     contributer(u"Benjamin Piwowarski",
+                 "benjamin ! piwowarski () lip6 ! fr",
+                 "GPL",
+                 "GPL statement",
+                 "m=133958334631163",
+                 "13 June 2012",
+                 u"AppleScript, integration with bibliography managers"),
+
      contributer(u"Neoklis Polyzotis",
                  "alkis () soe ! ucsc ! edu",
                  "GPL",

commit 843be77e54283a57534f13fb3bf68c5d0589aa86
Author: Julien Rioux <[email protected]>
Date:   Tue Jan 15 15:33:33 2013 +0100

    Remove unused include.

diff --git a/src/insets/InsetCitation.h b/src/insets/InsetCitation.h
index af817dd..1b2f714 100644
--- a/src/insets/InsetCitation.h
+++ b/src/insets/InsetCitation.h
@@ -16,7 +16,6 @@
 #include "InsetCommand.h"
 
 #include "Citation.h"
-#include "support/strfwd.h"
 
 namespace lyx {
 

commit 8c09d3ba1a916aeab204ea79a0b6a342ffeb718b
Author: Benjamin Piwowarski <[email protected]>
Date:   Tue Jun 5 11:06:38 2012 +0200

    Fixed a bug when there is no citation

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index cb2b7fb..4aa3360 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -1914,7 +1914,7 @@ void BufferView::dispatch(FuncRequest const & cmd, 
DispatchResult & dr)
                Inset * inset = cur.nextInset();
                if (!inset || inset->lyxCode() != CITE_CODE)
                        inset = cur.prevInset();
-               if (inset->lyxCode() == CITE_CODE) {
+               if (inset && inset->lyxCode() == CITE_CODE) {
                        InsetCitation * icite = static_cast<InsetCitation 
*>(inset);
                        if (icite->addKey(arg)) {
                                dr.forceBufferUpdate();

commit 9f62413b103b74dbbd223388101b537a4988cae2
Author: Benjamin Piwowarski <[email protected]>
Date:   Tue Jun 5 10:37:34 2012 +0200

    Initial patch for citation-insert

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index fd26a81..cb2b7fb 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -54,6 +54,7 @@
 #include "WordLangTuple.h"
 
 #include "insets/InsetBibtex.h"
+#include "insets/InsetCitation.h"
 #include "insets/InsetCommand.h" // ChangeRefs
 #include "insets/InsetExternal.h"
 #include "insets/InsetGraphics.h"
@@ -1907,6 +1908,23 @@ void BufferView::dispatch(FuncRequest const & cmd, 
DispatchResult & dr)
                        arg = token(argument, '|', 0);
                        opt1 = token(argument, '|', 1);
                }
+
+               // if our cursor is direclty in front of or behind a citation 
inset,
+               // we will instead add the new key to it.
+               Inset * inset = cur.nextInset();
+               if (!inset || inset->lyxCode() != CITE_CODE)
+                       inset = cur.prevInset();
+               if (inset->lyxCode() == CITE_CODE) {
+                       InsetCitation * icite = static_cast<InsetCitation 
*>(inset);
+                       if (icite->addKey(arg)) {
+                               dr.forceBufferUpdate();
+                               dr.screenUpdate(Update::FitCursor | 
Update::SinglePar);
+                               if (!opt1.empty())
+                                       LYXERR0("Discarding optional argument 
to citation-insert.");
+                       }
+                       dispatched = true;
+                       break;
+               }
                InsetCommandParams icp(CITE_CODE);
                icp["key"] = from_utf8(arg);
                if (!opt1.empty())
diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp
index 2778e19..b1e48a6 100644
--- a/src/insets/InsetCitation.cpp
+++ b/src/insets/InsetCitation.cpp
@@ -122,6 +122,32 @@ void InsetCitation::doDispatch(Cursor & cur, FuncRequest & 
cmd)
 }
 
 
+bool InsetCitation::addKey(string const & key)
+{
+       docstring const ukey = from_utf8(key);
+       docstring const & curkeys = getParam("key");
+       if (curkeys.empty()) {
+               setParam("key", ukey);
+               cache.recalculate = true;
+               return true;
+       }
+
+       vector<docstring> keys = getVectorFromString(curkeys);
+       vector<docstring>::const_iterator it = keys.begin();
+       vector<docstring>::const_iterator en = keys.end();
+       for (; it != en; ++it) {
+               if (*it == ukey) {
+                       LYXERR0("Key " << key << " already present.");
+                       return false;
+               }
+       }
+       keys.push_back(ukey);
+       setParam("key", getStringFromVector(keys));
+       cache.recalculate = true;
+       return true;
+}
+
+
 docstring InsetCitation::toolTip(BufferView const & bv, int, int) const
 {
        Buffer const & buf = bv.buffer();
diff --git a/src/insets/InsetCitation.h b/src/insets/InsetCitation.h
index e29c399..af817dd 100644
--- a/src/insets/InsetCitation.h
+++ b/src/insets/InsetCitation.h
@@ -16,6 +16,7 @@
 #include "InsetCommand.h"
 
 #include "Citation.h"
+#include "support/strfwd.h"
 
 namespace lyx {
 
@@ -34,6 +35,9 @@ public:
        ///
        ~InsetCitation();
 
+       ///
+       bool addKey(std::string const & key);
+
        /// \name Public functions inherited from Inset class
        //@{
        ///

-----------------------------------------------------------------------

Summary of changes:
 lib/CREDITS                   |    9 +++++++++
 lib/generate_contributions.py |    8 ++++++++
 src/BufferView.cpp            |   18 ++++++++++++++++++
 src/insets/InsetCitation.cpp  |   26 ++++++++++++++++++++++++++
 src/insets/InsetCitation.h    |    3 +++
 5 files changed, 64 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to