* Looking at the diff I remember it contains a patch Andrea Anzani send me,

fixes indicating the focus of the resized column if it isn't the first one.
* Code cleanups by myself in the archiving implementation. No functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24026 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2008-02-20 00:40:53 +00:00
parent 94fec641a7
commit f6a3e5637b
+29 -57
View File
@@ -1514,79 +1514,51 @@ void BColumnListView::SaveState(BMessage *msg)
{ {
msg->MakeEmpty(); msg->MakeEmpty();
// Damn compiler issuing l43m incorrect warnings. for (int32 i = 0; BColumn *col = (BColumn*)fColumns.ItemAt(i); i++) {
int i;
for (i = 0; ;i++)
{
BColumn *col = (BColumn*) fColumns.ItemAt(i);
if(!col)
break;
msg->AddInt32("ID",col->fFieldID); msg->AddInt32("ID",col->fFieldID);
msg->AddFloat("width",col->fWidth); msg->AddFloat("width", col->fWidth);
msg->AddBool("visible",col->fVisible); msg->AddBool("visible", col->fVisible);
} }
msg->AddBool("sortingenabled",fSortingEnabled); msg->AddBool("sortingenabled", fSortingEnabled);
if(fSortingEnabled) if (fSortingEnabled) {
{ for (int32 i = 0; BColumn *col = (BColumn*)fSortColumns.ItemAt(i);
for (i = 0; ;i++) i++) {
{ msg->AddInt32("sortID", col->fFieldID);
BColumn *col = (BColumn*) fSortColumns.ItemAt(i); msg->AddBool("sortascending", col->fSortAscending);
if(!col)
break;
msg->AddInt32("sortID",col->fFieldID);
msg->AddBool("sortascending",col->fSortAscending);
} }
} }
} }
void BColumnListView::LoadState(BMessage *msg) void BColumnListView::LoadState(BMessage *msg)
{ {
for(int i=0;;i++) int32 id;
{ for (int i = 0; msg->FindInt32("ID", i, &id) == B_OK; i++) {
int32 ID; for (int j = 0; BColumn* column = (BColumn*)fColumns.ItemAt(j); j++) {
if(B_OK!=msg->FindInt32("ID",i,&ID)) if (column->fFieldID == id) {
break;
for(int j=0;;j++)
{
BColumn *col = (BColumn*) fColumns.ItemAt(j);
if(!col)
break;
if(col->fFieldID==ID)
{
// move this column to position 'i' and set its attributes // move this column to position 'i' and set its attributes
MoveColumn(col,i); MoveColumn(column, i);
float f; float width;
if(B_OK==msg->FindFloat("width",i,&f)) if (msg->FindFloat("width", i, &width) == B_OK)
col->SetWidth(f); column->SetWidth(width);
bool b; bool visible;
if(B_OK==msg->FindBool("visible",i,&b)) if (msg->FindBool("visible", i, &visible) == B_OK)
col->SetVisible(b); column->SetVisible(visible);
} }
} }
} }
bool b; bool b;
if(B_OK==msg->FindBool("sortingenabled",&b)) if (msg->FindBool("sortingenabled", &b) == B_OK) {
{
SetSortingEnabled(b); SetSortingEnabled(b);
// Damn compiler issuing l43m incorrect warnings. for (int k = 0; msg->FindInt32("sortID", k, &id) == B_OK; k++) {
for(int k=0;;k++) for (int j = 0; BColumn* column = (BColumn*)fColumns.ItemAt(j);
{ j++) {
int32 ID; if (column->fFieldID == id) {
if(B_OK!=msg->FindInt32("sortID", k, &ID))
break;
for(int j=0;;j++)
{
BColumn *col = (BColumn*) fColumns.ItemAt(j);
if(!col)
break;
if(col->fFieldID==ID)
{
// add this column to the sort list // add this column to the sort list
bool val; bool value;
if(B_OK==msg->FindBool("sortascending", k, &val)) if (msg->FindBool("sortascending", k, &value) == B_OK)
SetSortColumn(col, true, val); SetSortColumn(column, true, value);
} }
} }
} }
@@ -2616,7 +2588,7 @@ void OutlineView::RedrawColumn(BColumn *column, float leftEdge, bool isFirstColu
if (fFocusRow == row) { if (fFocusRow == row) {
if(!fEditMode) { if(!fEditMode) {
SetHighColor(fMasterView->Color(B_COLOR_SELECTION_TEXT)); fDrawBufferView->SetHighColor(fMasterView->Color(B_COLOR_SELECTION_TEXT));
fDrawBufferView->StrokeRect(BRect(-1, sourceRect.top, 10000.0, sourceRect.bottom - 1)); fDrawBufferView->StrokeRect(BRect(-1, sourceRect.top, 10000.0, sourceRect.bottom - 1));
} }
} }