From: Georg Baum Date: Wed, 22 Nov 2006 09:15:38 +0000 (+0000) Subject: avoid one string copy by s/from_utf8(lex.getString())/lex.getDocString()/ X-Git-Tag: 1.6.10~11798 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e0e00a92fc04cba66dd0825ed95b7420deb4afcd;p=lyx.git avoid one string copy by s/from_utf8(lex.getString())/lex.getDocString()/ git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16009 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/MenuBackend.C b/src/MenuBackend.C index 44f32e0e5a..356c4eb44f 100644 --- a/src/MenuBackend.C +++ b/src/MenuBackend.C @@ -351,7 +351,7 @@ Menu & Menu::read(LyXLex & lex) lex.next(true); docstring const mlabel = _(lex.getString()); lex.next(true); - docstring const mname = from_utf8(lex.getString()); + docstring const mname = lex.getDocString(); add(MenuItem(MenuItem::Submenu, mlabel, mname, optional)); optional = false; @@ -939,7 +939,7 @@ void MenuBackend::read(LyXLex & lex) break; case md_menu: { lex.next(true); - docstring const name = from_utf8(lex.getString()); + docstring const name = lex.getDocString(); if (hasMenu(name)) { getMenu(name).read(lex); } else { diff --git a/src/buffer.C b/src/buffer.C index 22eb727982..538e94ee1a 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -460,7 +460,7 @@ int Buffer::readHeader(LyXLex & lex) docstring const s = bformat(_("Unknown token: " "%1$s %2$s\n"), from_utf8(token), - from_utf8(lex.getString())); + lex.getDocString()); errorList.push_back(ErrorItem(_("Document header error"), s, -1, 0, 0)); } diff --git a/src/text.C b/src/text.C index 5442eba7a7..af93b7c45f 100644 --- a/src/text.C +++ b/src/text.C @@ -218,7 +218,7 @@ void readParToken(Buffer const & buf, Paragraph & par, LyXLex & lex, par.insertInset(par.size(), inset, font, change); else { lex.eatLine(); - docstring line = from_utf8(lex.getString()); + docstring line = lex.getDocString(); errorList.push_back(ErrorItem(_("Unknown Inset"), line, par.id(), 0, par.size())); } @@ -348,7 +348,7 @@ void readParToken(Buffer const & buf, Paragraph & par, LyXLex & lex, lex.eatLine(); errorList.push_back(ErrorItem(_("Unknown token"), bformat(_("Unknown token: %1$s %2$s\n"), from_utf8(token), - from_utf8(lex.getString())), + lex.getDocString()), par.id(), 0, par.size())); } }