mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
use std::copy for transformation from vector to char*
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@293 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
65e9b99a59
commit
47526150a1
@ -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.
|
||||
|
||||
|
12
src/text2.C
12
src/text2.C
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user