Tiny unicode optimization: avoid ucs4->utf8->ucs4 roundtrip

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15735 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Georg Baum 2006-11-04 14:40:59 +00:00
parent b61b9cc6a4
commit d06475855c
3 changed files with 4 additions and 4 deletions

View File

@ -166,7 +166,7 @@ InsetBase * createInset(BufferView * bv, FuncRequest const & cmd)
// Try and generate a valid index entry.
InsetCommandParams icp("index");
icp["name"] = cmd.argument().empty() ?
from_utf8(bv->getLyXText()->getStringToIndex(bv->cursor())) :
bv->getLyXText()->getStringToIndex(bv->cursor()) :
cmd.argument();
return new InsetIndex(icp);
}

View File

@ -107,7 +107,7 @@ public:
void toggleFree(LCursor & cur, LyXFont const &, bool toggleall = false);
///
std::string getStringToIndex(LCursor const & cur);
docstring getStringToIndex(LCursor const & cur);
/// insert a character at cursor position
void insertChar(LCursor & cur, char_type c);

View File

@ -576,7 +576,7 @@ void LyXText::toggleFree(LCursor & cur, LyXFont const & font, bool toggleall)
}
string LyXText::getStringToIndex(LCursor const & cur)
docstring LyXText::getStringToIndex(LCursor const & cur)
{
BOOST_ASSERT(this == cur.text());
@ -598,7 +598,7 @@ string LyXText::getStringToIndex(LCursor const & cur)
idxstring = tmpcur.selectionAsString(false);
}
return to_utf8(idxstring);
return idxstring;
}