#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"
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() &&
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);
}
}
+void InsetLabel::edit(BufferView * bv, bool)
+{
+ edit(bv, 0, 0, 0);
+}
+
+
int InsetLabel::latex(Buffer const *, ostream & os,
bool /*fragile*/, bool /*fs*/) const
{
}
-int InsetLabel::docBook(Buffer const *, ostream & os) const
+int InsetLabel::docbook(Buffer const *, ostream & os) const
{
os << "<anchor id=\"" << getContents() << "\" ></anchor>";
return 0;