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.
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;
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;