fix Menu copy constructor

it has to make deep copy of itsOptions.
This commit is contained in:
Andrzej Rybczak
2009-03-13 13:26:29 +01:00
parent a20469b403
commit d03c4a88b6
2 changed files with 40 additions and 26 deletions

View File

@@ -47,6 +47,7 @@ namespace NCurses
public:
basic_buffer() : itsTempString(0) { }
basic_buffer(const basic_buffer &b);
std::basic_string<C> Str() const;
void SetFormatting(short vb, const std::basic_string<C> &s, short ve, bool for_each = 1);
@@ -71,6 +72,12 @@ namespace NCurses
typedef basic_buffer<wchar_t> WBuffer;
}
template <typename C> NCurses::basic_buffer<C>::basic_buffer(const basic_buffer &b) : itsFormat(b.itsFormat),
itsTempString(b.itsTempString)
{
itsString << b.itsString.str();
}
template <typename C> std::basic_string<C> NCurses::basic_buffer<C>::Str() const
{
return itsString.str();