From: Georg Baum Date: Sat, 4 Nov 2006 14:40:59 +0000 (+0000) Subject: Tiny unicode optimization: avoid ucs4->utf8->ucs4 roundtrip X-Git-Tag: 1.6.10~12044 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d06475855c85e16fec9b708779509cab1dd3a470;p=features.git 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 --- diff --git a/src/factory.C b/src/factory.C index 86f6119bce..e0211221e1 100644 --- a/src/factory.C +++ b/src/factory.C @@ -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); } diff --git a/src/lyxtext.h b/src/lyxtext.h index d45c181532..75cb802114 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -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); diff --git a/src/text2.C b/src/text2.C index b5883f3ba6..16ca5c565b 100644 --- a/src/text2.C +++ b/src/text2.C @@ -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; }