/* This file is part of
* ======================================================
- *
+ *
* LyX, The Document Processor
- *
+ *
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX Team.
*
#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() &&
bool flag = bv->ChangeRefsIfUnique(getContents(),
new_contents);
setContents(new_contents);
+#if 0
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);
+#else
+ bv->updateInset(this, !flag);
+#endif
}
}
}
+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>";
+ os << "<anchor id=\"" << getContents() << "\">";
return 0;
}