]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetlabel.C
Hopefully fixed the redo problems with insets!
[lyx.git] / src / insets / insetlabel.C
index 026721a0d772b8865ef0d9ab143b9bee17737e44..590b50a65dd85f6a5218a630da96d86c7524a6c1 100644 (file)
@@ -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() &&
@@ -61,7 +56,7 @@ void InsetLabel::edit(BufferView * bv, int, int, unsigned int)
                        bv->text->redoParagraph(bv);
                        if (flag) {
                                bv->redraw();
-                               bv->fitCursor(getLyXText(bv));
+                               bv->fitCursor();
                        } else
                                bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
                }
@@ -69,6 +64,12 @@ void InsetLabel::edit(BufferView * bv, int, int, unsigned int)
 }
 
 
+void InsetLabel::edit(BufferView * bv, bool)
+{
+       edit(bv, 0, 0, 0);
+}
+
+
 int InsetLabel::latex(Buffer const *, ostream & os,
                      bool /*fragile*/, bool /*fs*/) const
 {
@@ -90,7 +91,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;