]> git.lyx.org Git - features.git/commitdiff
Tiny unicode optimization: avoid ucs4->utf8->ucs4 roundtrip
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sat, 4 Nov 2006 14:40:59 +0000 (14:40 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sat, 4 Nov 2006 14:40:59 +0000 (14:40 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15735 a592a061-630c-0410-9148-cb99ea01b6c8

src/factory.C
src/lyxtext.h
src/text2.C

index 86f6119bcec818f4aedd7496c11e0ee04b75c419..e0211221e11223a39858cf0677679343a094785c 100644 (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);
        }
index d45c181532a00ec1aa65caaf271b844f35489a40..75cb8021144e4c227a23e6b7848d12e05d2257f1 100644 (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);
index b5883f3ba676609d77f95ffb282114e54ea15d69..16ca5c565b5a31afc8fff04f7a4aba2fe71d20a5 100644 (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;
 }