]> git.lyx.org Git - features.git/commitdiff
use std::copy for transformation from vector to char*
authorLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 5 Nov 1999 06:49:59 +0000 (06:49 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 5 Nov 1999 06:49:59 +0000 (06:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@293 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
src/text2.C

index d4fb43985cba474d0b0cd5d339b62cd7a446eb28..e3b05331fdd9ffd1b5ec83481f9b361f0fc5df2e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 1999-11-05  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
+       * src/text2.C (InsertStringB): use std::copy
+       (InsertStringA): use std::copy
+
        * src/bufferlist.C: use a vector to store the buffers in. This is
        an internal change and should not affect any other thing.
        
index 6ec9e0f7c7a0892e7cd549cda4b765152447f06e..57e3af9e9d66996f51ae60bdfe060b76f5bb102d 100644 (file)
@@ -2505,11 +2505,7 @@ bool LyXText::SearchBackward(char const * string)
 void LyXText::InsertStringA(LyXParagraph::TextContainer const & text)
 {
        char * str = new char[text.size() + 1];
-       // shoudl use std::copy or something
-       for (LyXParagraph::size_type i = 0; i < static_cast<int>(text.size());
-            ++i) {
-               str[i] = text[i];
-       }
+       copy(text.begin(), text.end(), str);
        str[text.size()] = '\0';
        InsertStringA(str);
        delete [] str;
@@ -2664,11 +2660,7 @@ void LyXText::InsertStringA(char const * str)
 void LyXText::InsertStringB(LyXParagraph::TextContainer const & text)
 {
        char * str = new char[text.size() + 1];
-       // should use std::copy or something
-       for(LyXParagraph::size_type i = 0; i < static_cast<int>(text.size());
-           ++i) {
-               str[i] = text[i];
-       }
+       copy(text.begin(), text.end(), str);
        str[text.size()] = '\0';
        InsertStringB(str);
        delete [] str;