-string LCursor::getPossibleLabel()
+docstring LCursor::getPossibleLabel()
- return inMathed() ? "eq:" : text()->getPossibleLabel(*this);
+ return inMathed() ? from_ascii("eq:") : text()->getPossibleLabel(*this);
/// display an error message
void errorMessage(docstring const & msg) const;
///
/// display an error message
void errorMessage(docstring const & msg) const;
///
- std::string getPossibleLabel();
+ docstring getPossibleLabel();
/// moves position somehow up or down
bool goUpDown(bool up);
/// moves position somehow up or down
bool goUpDown(bool up);
///
double spacing(Buffer const & buffer, Paragraph const & par) const;
/// make a suggestion for a label
///
double spacing(Buffer const & buffer, Paragraph const & par) const;
/// make a suggestion for a label
- std::string getPossibleLabel(LCursor & cur) const;
+ docstring getPossibleLabel(LCursor & cur) const;
/// is this paragraph right-to-left?
bool isRTL(Buffer const &, Paragraph const & par) const;
///
/// is this paragraph right-to-left?
bool isRTL(Buffer const &, Paragraph const & par) const;
///
-string LyXText::getPossibleLabel(LCursor & cur) const
+docstring LyXText::getPossibleLabel(LCursor & cur) const
{
pit_type pit = cur.pit();
{
pit_type pit = cur.pit();
- string name = layout->latexname();
+ docstring name = from_ascii(layout->latexname());
// for captions, we want the abbreviation of the float type
if (layout->labeltype == LABEL_SENSITIVE) {
// for captions, we want the abbreviation of the float type
if (layout->labeltype == LABEL_SENSITIVE) {
InsetBase * const in = &cur[i].inset();
if (in->lyxCode() == InsetBase::FLOAT_CODE
|| in->lyxCode() == InsetBase::WRAP_CODE) {
InsetBase * const in = &cur[i].inset();
if (in->lyxCode() == InsetBase::FLOAT_CODE
|| in->lyxCode() == InsetBase::WRAP_CODE) {
- name = to_utf8(in->getInsetName());
+ name = in->getInsetName();
- string text = name.substr(0, 3);
+ docstring text = name.substr(0, 3);
- text = "thm"; // Create a correct prefix for prettyref
+ text = from_ascii("thm"); // Create a correct prefix for prettyref
text += ':';
if (layout->latextype == LATEX_PARAGRAPH || lyxrc.label_init_length < 0)
text.erase();
text += ':';
if (layout->latextype == LATEX_PARAGRAPH || lyxrc.label_init_length < 0)
text.erase();
- // FIXME UNICODE
- string par_text = to_utf8(pars_[pit].asString(cur.buffer(), false));
+ docstring par_text = pars_[pit].asString(cur.buffer(), false);
for (int i = 0; i < lyxrc.label_init_length; ++i) {
if (par_text.empty())
break;
for (int i = 0; i < lyxrc.label_init_length; ++i) {
if (par_text.empty())
break;
par_text = split(par_text, head, ' ');
// Is it legal to use spaces in labels ?
if (i > 0)
par_text = split(par_text, head, ' ');
// Is it legal to use spaces in labels ?
if (i > 0)
InsetCommandParams p("label");
// Try to generate a valid label
p["name"] = (cmd.argument().empty()) ?
InsetCommandParams p("label");
// Try to generate a valid label
p["name"] = (cmd.argument().empty()) ?
- // FIXME UNICODE
- from_utf8(cur.getPossibleLabel()) :
+ cur.getPossibleLabel() :
cmd.argument();
string const data = InsetCommandMailer::params2string("label", p);
cmd.argument();
string const data = InsetCommandMailer::params2string("label", p);