[Aptitude-svn-commit] r3406 - in branches/aptitude-0.3/aptitude: . src/vscreen

Daniel Burrows dburrows@costa.debian.org
Wed, 15 Jun 2005 19:19:33 +0000


Author: dburrows
Date: Wed Jun 15 19:19:31 2005
New Revision: 3406

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/vscreen/curses++.cc
   branches/aptitude-0.3/aptitude/src/vscreen/curses++.h
Log:
Fix some thinkos so everything compiles and links.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Wed Jun 15 19:19:31 2005
@@ -1,5 +1,11 @@
 2005-06-15  Daniel Burrows  <dburrows@debian.org>
 
+	* src/vscreen/curses++.cc, src/vscreen/curses++.h:
+
+	Fix the missing reference to operator=(wstring&) in wchstring by
+	removing it and just writing it into the constructor where it was
+	used.
+
 	* src/vscreen/config/style.h, src/vscreen/curses++.cc, src/vscreen/curses++.h:
 
 	Add definitions of a chstring-analogue for wide-characters (it

Modified: branches/aptitude-0.3/aptitude/src/vscreen/curses++.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/curses++.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/curses++.cc	Wed Jun 15 19:19:31 2005
@@ -64,13 +64,16 @@
 
 wchstring::wchstring(const wstring &s)
 {
-  (*this)=s;
+  for(wstring::const_iterator i=s.begin(); i!=s.end(); ++i)
+    push_back(wchtype(*i, A_NORMAL));
 }
 
 wchstring::wchstring(const wstring &s, const style &st)
 {
-  (*this)=s;
-  apply_style(st);
+  attr_t attrs=st.get_attrs();
+
+  for(wstring::const_iterator i=s.begin(); i!=s.end(); ++i)
+    push_back(wchtype(*i, attrs));
 }
 
 wchstring::wchstring(const wchstring &s, const style &st)

Modified: branches/aptitude-0.3/aptitude/src/vscreen/curses++.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/curses++.h	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/curses++.h	Wed Jun 15 19:19:31 2005
@@ -200,6 +200,10 @@
 
   /** Create a new wchstring with empty attribute information. */
   wchstring(const std::wstring &s);
+
+  /** Create a new wchstring from the given wide string with the given
+   *  attributes.
+   */
   wchstring(const std::wstring &s, const style &st);
 
   wchstring(const wchstring &s):super(s) {}
@@ -214,9 +218,6 @@
   wchstring(size_t n, wchtype c)
     :super(n, c) {}
 
-  /** Assign the characters of s to this, setting all attributes to A_NORMAL. */
-  chstring &operator=(const std::wstring &s);
-
   /** Change the attributes of this string by using the given style. */
   void apply_style(const style &st);
 };