- Fixed crash during unarchiving, caused by the use of the wrong variable (thanks to Bill Hayden for reporting), and added a check which would have avoided the crash.

- Style changes to StyleBuffer.cpp plus a small fix in ContinuousGetStyle().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8723 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2004-08-30 09:02:31 +00:00
parent 2d2e1091d5
commit 74dca7b4f4
2 changed files with 80 additions and 72 deletions
+12 -6
View File
@@ -177,6 +177,8 @@ sPropertyList[] = {
};
/*! \brief Creates a BTextView object with the given charachteristics.
*/
BTextView::BTextView(BRect frame, const char *name, BRect textRect,
uint32 resizeMask, uint32 flags)
: BView(frame, name, resizeMask,
@@ -187,6 +189,8 @@ BTextView::BTextView(BRect frame, const char *name, BRect textRect,
}
/*! \brief Creates a BTextView object with the given charachteristics.
*/
BTextView::BTextView(BRect frame, const char *name, BRect textRect,
const BFont *initialFont, const rgb_color *initialColor,
uint32 resizeMask, uint32 flags)
@@ -266,12 +270,14 @@ BTextView::BTextView(BMessage *archive)
}
ssize_t runSize = 0;
const void *flattenedRunArray = NULL;
if (archive->FindData("_runs", B_RAW_TYPE, &flattenedRunArray, &runSize) == B_OK) {
const void *flattenedRun = NULL;
if (archive->FindData("_runs", B_RAW_TYPE, &flattenedRun, &runSize) == B_OK) {
text_run_array *runArray = UnflattenRunArray(runArray, (int32 *)&runSize);
SetRunArray(0, TextLength(), runArray);
free(runArray);
text_run_array *runArray = UnflattenRunArray(flattenedRun, (int32 *)&runSize);
if (runArray) {
SetRunArray(0, TextLength(), runArray);
free(runArray);
}
}
}
@@ -4290,7 +4296,7 @@ BTextView::HandleInputMethodChanged(BMessage *message)
if (fInline->IsActive()) {
int32 oldOffset = fInline->Offset();
DeleteText(oldOffset, oldOffset + fInline->Length());
fSelStart = fSelEnd = oldOffset;
fClickOffset = fSelStart = fSelEnd = oldOffset;
}
int32 stringLen = strlen(string);