]> git.lyx.org Git - lyx.git/commitdiff
fix http://bugzilla.lyx.org/show_bug.cgi?id=4608
authorAbdelrazak Younes <younes@lyx.org>
Mon, 10 Mar 2008 15:01:57 +0000 (15:01 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 10 Mar 2008 15:01:57 +0000 (15:01 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23636 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetCitation.cpp
src/insets/InsetCitation.h

index 917b8fd8f499d394e369614b089c7e17aa06bbb7..bd149a61cf3d396fe1e4f11ad5185ae383f0e7c5 100644 (file)
@@ -14,6 +14,7 @@
 #include "InsetCitation.h"
 
 #include "Buffer.h"
+#include "buffer_funcs.h"
 #include "BufferParams.h"
 #include "DispatchResult.h"
 #include "EmbeddedFiles.h"
@@ -385,6 +386,14 @@ InsetCitation::InsetCitation(InsetCommandParams const & p)
 {}
 
 
+void InsetCitation::initView()
+{
+       // We need an update of the Buffer reference cache. This is achieved by
+       // updateLabel().
+       lyx::updateLabels(buffer());
+}
+
+
 ParamInfo const & InsetCitation::findInfo(string const & /* cmdName */)
 {
        // standard cite does only take one argument if jurabib is
@@ -465,16 +474,8 @@ void InsetCitation::addToToc(ParConstIterator const & cpit) const
 
 int InsetCitation::plaintext(odocstream & os, OutputParams const &) const
 {
-       docstring str;
-
-       if (cache.params == params() &&
-           cache.engine == buffer().params().getEngine())
-               str = cache.generated_label;
-       else
-               str = generateLabel();
-
-       os << str;
-       return str.size();
+       os << cache.generated_label;
+       return cache.generated_label.size();
 }
 
 
index e30d036caa72eca817f16c2046c510753cf50cf0..440e3a185abfaf4fd52d5668b9798f91fe550998 100644 (file)
@@ -30,6 +30,8 @@ public:
        ///
        InsetCitation(InsetCommandParams const &);
        ///
+       void initView();
+       ///
        docstring screenLabel() const;
        ///
        EDITABLE editable() const { return IS_EDITABLE; }