Monotone-Parent: a59f6d7afaa2784c96352c1b819c57a31206c4bd

Monotone-Revision: 8e14613f7e0332410a0bb4de6eea4181b3432372

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-08-02T18:54:08
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2011-08-02 18:54:08 +00:00
parent 90b80cdf7f
commit 6a67a2ff30
3 changed files with 39 additions and 16 deletions

View File

@@ -580,8 +580,7 @@ static Class NSDataK, NSStringK;
return rc;
}
- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res
intoQualifier: (EOQualifier **) qualifier
- (SEL) operatorFromRestrictionOperator: (uint32_t) resOp
{
static SEL operators[] = { EOQualifierOperatorLessThan,
EOQualifierOperatorLessThanOrEqualTo,
@@ -591,6 +590,23 @@ static Class NSDataK, NSStringK;
EOQualifierOperatorNotEqual,
EOQualifierOperatorContains };
SEL operator;
if (resOp < 7)
operator = operators[resOp];
else
{
operator = NULL;
[NSException raise: @"MAPIStoreRestrictionException"
format: @"unhandled operator type number %d", resOp];
}
return operator;
}
- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res
intoQualifier: (EOQualifier **) qualifier
{
SEL operator;
id value;
NSString *property;
MAPIRestrictionState rc;
@@ -598,17 +614,8 @@ static Class NSDataK, NSStringK;
property = [self backendIdentifierForProperty: res->ulPropTag];
if (property)
{
if (res->relop >= 0 && res->relop < 7)
operator = operators[res->relop];
else
{
operator = NULL;
[NSException raise: @"MAPIStoreRestrictionException"
format: @"unhandled operator type number %d", res->relop];
}
operator = [self operatorFromRestrictionOperator: res->relop];
value = NSObjectFromMAPISPropValue (&res->lpProp);
*qualifier = [[EOKeyValueQualifier alloc] initWithKey: property
operatorSelector: operator
value: value];
@@ -713,6 +720,14 @@ static Class NSDataK, NSStringK;
intoQualifier: qualifier];
break;
case RES_COMMENT:
if (res->res.resComment.RestrictionPresent)
state = [self evaluateRestriction: (struct mapi_SRestriction *) res->res.resComment.Restriction.res
intoQualifier: qualifier];
else
state = MAPIRestrictionStateAlwaysTrue;
break;
// case 5: MAPIStringForComparePropsRestriction(&resPtr->res.resCompareProps); break;
// case 7: MAPIStringForPropertyRestriction(&resPtr->res.resProperty); break;
// case 9: MAPIStringForPropertyRestriction(&resPtr->res.resProperty); break;