Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9591/src/gui
Modified Files:
wxllist.cpp
Log Message:
fixed attributes of wrapped lines
Index: wxllist.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxllist.cpp,v
retrieving revision 1.166
retrieving revision 1.167
diff -b -u -2 -r1.166 -r1.167
--- wxllist.cpp 9 Jul 2005 20:38:18 -0000 1.166
+++ wxllist.cpp 9 Jul 2005 22:09:12 -0000 1.167
@@ -1509,10 +1509,10 @@
(void) new wxLayoutLine(this, llist);
wxASSERT(m_Next);
+
// We need to move this and all following objects to the next
// line. Starting from the end of line, to keep the order right.
if(copyObject != m_ObjectList.end())
{
- wxLOiterator j;
- for(j = m_ObjectList.tail(); j != copyObject; j--)
+ for(wxLOiterator j = m_ObjectList.tail(); j != copyObject; j--)
m_Next->Prepend(*j);
m_Next->Prepend(*copyObject);
@@ -1526,7 +1526,23 @@
m_Length -= shorter;
- if(prependText.Length() > 0)
+ // move the wrapped text itself
+ if ( !prependText.empty() )
m_Next->Insert(0, prependText);
+ // we also need to copy all the style information from the previous line
+ // occuring before the wrap point, otherwise formatting would be broken
+ for ( wxLOiterator j = m_ObjectList.tail(); ; j-- )
+ {
+ if ( j->GetType() == WXLO_TYPE_CMD )
+ {
+ // we have to make a new object to avoid referencing the same pointer
+ // from 2 lines (would result in a crash when deleting them)
+ m_Next->Prepend(j->Copy());
+ }
+
+ if ( j == m_ObjectList.begin() )
+ break;
+ }
+
// do we need to adjust the cursor position?
if( this == llist->GetCursorLine() && xpos >= breakpos)
-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates