]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetlabel.C
fix typo that put too many include paths for most people
[lyx.git] / src / insets / insetlabel.C
index c4134be27223ea4693dfd69c0a46e397ce17fda3..9c61eb763ff0c30a0d67dbaadee1eddb6929b688 100644 (file)
@@ -1,8 +1,8 @@
 /* This file is part of
  * ======================================================
- * 
+ *
  *           LyX, The Document Processor
- *      
+ *
  *         Copyright 1995 Matthias Ettrich
  *          Copyright 1995-2001 The LyX Team.
  *
@@ -16,7 +16,7 @@
 
 #include "insetlabel.h"
 #include "support/LOstream.h"
-#include "lyx_gui_misc.h"     //askForText
+#include "frontends/Alert.h"
 #include "support/lstrings.h" //frontStrip, strip
 #include "lyxtext.h"
 #include "buffer.h"
@@ -44,12 +44,7 @@ vector<string> const InsetLabel::getLabelList() const
 
 void InsetLabel::edit(BufferView * bv, int, int, unsigned int)
 {
-       if (bv->buffer()->isReadonly()) {
-               WarnReadonly(bv->buffer()->fileName());
-               return;
-       }
-
-       pair<bool, string> result = askForText(_("Enter label:"), getContents());
+       pair<bool, string> result = Alert::askForText(_("Enter label:"), getContents());
        if (result.first) {
                string new_contents = frontStrip(strip(result.second));
                if (!new_contents.empty() &&
@@ -58,12 +53,16 @@ void InsetLabel::edit(BufferView * bv, int, int, unsigned int)
                        bool flag = bv->ChangeRefsIfUnique(getContents(),
                                                           new_contents);
                        setContents(new_contents);
+#if 0
                        bv->text->redoParagraph(bv);
                        if (flag) {
                                bv->redraw();
                                bv->fitCursor();
                        } else
                                bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+#else
+                       bv->updateInset(this, !flag);
+#endif
                }
        }
 }
@@ -96,7 +95,7 @@ int InsetLabel::linuxdoc(Buffer const *, ostream & os) const
 }
 
 
-int InsetLabel::docBook(Buffer const *, ostream & os) const
+int InsetLabel::docbook(Buffer const *, ostream & os) const
 {
        os << "<anchor id=\"" << getContents() << "\" ></anchor>";
        return 0;