]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBibitem.cpp
Move isMultiCell() to Cursor, and use it.
[lyx.git] / src / insets / InsetBibitem.cpp
index 69599c27bbb08f5e456b930f25728c146626bd2d..137d041c1b8e915679f8ea16360d4dca98f5e02e 100644 (file)
 
 #include "frontends/alert.h"
 
-#include "support/lstrings.h"
+#include "support/convert.h"
 #include "support/docstream.h"
 #include "support/gettext.h"
-#include "support/convert.h"
+#include "support/lstrings.h"
 
 using namespace std;
 using namespace lyx::support;
@@ -57,7 +57,7 @@ InsetBibitem::InsetBibitem(Buffer const & buf, InsetCommandParams const & p)
 
 InsetBibitem::~InsetBibitem()
 {
-       if (buffer_)
+       if (isBufferValid())
                buffer_->invalidateBibinfoCache();
 }
 
@@ -118,10 +118,11 @@ void InsetBibitem::doDispatch(Cursor & cur, FuncRequest & cmd)
                }
                docstring old_key = params()["key"];
                setParam("label", p["label"]);
-               updateCommand(p["key"]);
-               if (params()["key"] != old_key)
+               if (params()["key"] != old_key) {
+                       updateCommand(p["key"]);
                        cur.bv().buffer().changeRefsIfUnique(old_key,
                                params()["key"], CITE_CODE);
+               }
                buffer_->invalidateBibinfoCache();
                break;
        }