X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetlabel.C;h=590b50a65dd85f6a5218a630da96d86c7524a6c1;hb=4a5b7a5952ad2381fcdf4830511293e184c7c5a1;hp=cb1cc921fb5c1fe0932a3791626aad580217a430;hpb=85a5ea7bfc80e179a61a99f2955455e84d3384cc;p=lyx.git diff --git a/src/insets/insetlabel.C b/src/insets/insetlabel.C index cb1cc921fb..590b50a65d 100644 --- a/src/insets/insetlabel.C +++ b/src/insets/insetlabel.C @@ -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" @@ -31,7 +31,7 @@ using std::pair; /* Label. Used to insert a label automatically */ -InsetLabel::InsetLabel(InsetCommandParams const & p) +InsetLabel::InsetLabel(InsetCommandParams const & p, bool) : InsetCommand(p) {} @@ -44,12 +44,7 @@ vector const InsetLabel::getLabelList() const void InsetLabel::edit(BufferView * bv, int, int, unsigned int) { - if (bv->buffer()->isReadonly()) { - WarnReadonly(bv->buffer()->fileName()); - return; - } - - pair result = askForText(_("Enter label:"), getContents()); + pair 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 << ""; return 0;