fixed initial snip for default-style-name

svn: r1786
This commit is contained in:
Matthew Flatt 2006-01-08 16:40:16 +00:00
parent a4bc935235
commit f6ff774bef
3 changed files with 6 additions and 1 deletions

View File

@ -1591,7 +1591,7 @@ void wxMediaEdit::_Insert(wxSnip *isnip, long strlen, wxchar *str, wxList *snips
if (!len) {
wxStyle *style;
style = (stickyStyles
style = ((stickyStyles & !initialStyleNeeded)
? snips->style
: GetDefaultStyle());
snip = InsertTextSnip(start, style);
@ -1790,6 +1790,8 @@ void wxMediaEdit::_Insert(wxSnip *isnip, long strlen, wxchar *str, wxList *snips
len += addlen;
}
initialStyleNeeded = 0;
revision_count++;
AdjustClickbacks(start, start, addlen, NULL);

View File

@ -506,6 +506,8 @@ class wxMediaEdit : public wxMediaBuffer
TF_Flag( caretBlinked ); /* Whether we want to hide an active caret or not */
TF_Flag( initialStyleNeeded );
#undef TF_Flag
int lastDrawCaret;

View File

@ -289,6 +289,7 @@ void wxMediaEdit::_ChangeStyle(long start, long end,
if (!len) {
startSnip = snips;
endSnip = NULL;
initialStyleNeeded = 0;
} else {
startSnip = FindSnip(start, +1);
endSnip = FindSnip(end, +2);