* The view always included the "error" in the reply, but that's only supposed
to happen when an actual error occured. * The "set frame" property resized the view incorrectly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31388 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
8a07918f6d
commit
9515252e02
@ -4219,13 +4219,13 @@ BView::MessageReceived(BMessage* msg)
|
|||||||
int32 index;
|
int32 index;
|
||||||
BMessage specifier;
|
BMessage specifier;
|
||||||
int32 what;
|
int32 what;
|
||||||
const char *prop;
|
const char* property;
|
||||||
|
|
||||||
if (msg->GetCurrentSpecifier(&index, &specifier, &what, &prop) != B_OK)
|
if (msg->GetCurrentSpecifier(&index, &specifier, &what, &property) != B_OK)
|
||||||
return BHandler::MessageReceived(msg);
|
return BHandler::MessageReceived(msg);
|
||||||
|
|
||||||
BPropertyInfo propertyInfo(sViewPropInfo);
|
BPropertyInfo propertyInfo(sViewPropInfo);
|
||||||
switch (propertyInfo.FindMatch(msg, index, &specifier, what, prop)) {
|
switch (propertyInfo.FindMatch(msg, index, &specifier, what, property)) {
|
||||||
case 0:
|
case 0:
|
||||||
if (msg->what == B_GET_PROPERTY) {
|
if (msg->what == B_GET_PROPERTY) {
|
||||||
err = replyMsg.AddRect("result", Frame());
|
err = replyMsg.AddRect("result", Frame());
|
||||||
@ -4234,7 +4234,7 @@ BView::MessageReceived(BMessage* msg)
|
|||||||
err = msg->FindRect("data", &newFrame);
|
err = msg->FindRect("data", &newFrame);
|
||||||
if (err == B_OK) {
|
if (err == B_OK) {
|
||||||
MoveTo(newFrame.LeftTop());
|
MoveTo(newFrame.LeftTop());
|
||||||
ResizeTo(newFrame.right, newFrame.bottom);
|
ResizeTo(newFrame.Width(), newFrame.Height());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -4259,16 +4259,17 @@ BView::MessageReceived(BMessage* msg)
|
|||||||
return BHandler::MessageReceived(msg);
|
return BHandler::MessageReceived(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err < B_OK) {
|
if (err != B_OK) {
|
||||||
replyMsg.what = B_MESSAGE_NOT_UNDERSTOOD;
|
replyMsg.what = B_MESSAGE_NOT_UNDERSTOOD;
|
||||||
|
|
||||||
if (err == B_BAD_SCRIPT_SYNTAX)
|
if (err == B_BAD_SCRIPT_SYNTAX)
|
||||||
replyMsg.AddString("message", "Didn't understand the specifier(s)");
|
replyMsg.AddString("message", "Didn't understand the specifier(s)");
|
||||||
else
|
else
|
||||||
replyMsg.AddString("message", strerror(err));
|
replyMsg.AddString("message", strerror(err));
|
||||||
|
|
||||||
|
replyMsg.AddInt32("error", err);
|
||||||
}
|
}
|
||||||
|
|
||||||
replyMsg.AddInt32("error", err);
|
|
||||||
msg->SendReply(&replyMsg);
|
msg->SendReply(&replyMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user