]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetlabel.C
fix compilation pb ; update eu.po
[lyx.git] / src / insets / insetlabel.C
index 72376e442799d187d9bd33e806d268403534e55f..ddff0337d1abe0081a19c16deef392e567f61747 100644 (file)
@@ -20,6 +20,7 @@
 #include "support/lstrings.h" //frontStrip, strip
 #include "lyxtext.h"
 #include "buffer.h"
+#include "gettext.h"
 
 using std::ostream;
 using std::vector;
@@ -35,7 +36,7 @@ InsetLabel::InsetLabel(InsetCommandParams const & p)
 
 vector<string> const InsetLabel::getLabelList() const
 {
-       return vector<string>(1,getContents());
+       return vector<string>(1, getContents());
 }
 
 
@@ -52,14 +53,15 @@ void InsetLabel::Edit(BufferView * bv, int, int, unsigned int)
                if (!new_contents.empty() &&
                    getContents() != new_contents) {
                        bv->buffer()->markDirty();
-                       bool flag = bv->ChangeRefs(getContents(),new_contents);
-                       setContents( new_contents );
+                       bool flag = bv->ChangeRefsIfUnique(getContents(),
+                                                          new_contents);
+                       setContents(new_contents);
                        bv->text->RedoParagraph(bv);
                        if (flag) {
                                bv->redraw();
                                bv->fitCursor(getLyXText(bv));
                        } else
-                               bv->update(BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+                               bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
                }
        }
 }
@@ -88,7 +90,7 @@ int InsetLabel::Linuxdoc(Buffer const *, ostream & os) const
 
 int InsetLabel::DocBook(Buffer const *, ostream & os) const
 {
-       os << "<anchor id=\"" << getContents() << "\" >";
+       os << "<anchor id=\"" << getContents() << "\" ></anchor>";
        return 0;
 }