Re: Determining underline style and mask?
Re: Determining underline style and mask?
- Subject: Re: Determining underline style and mask?
- From: Martin Wierschin <email@hidden>
- Date: Mon, 23 Apr 2007 16:34:11 -0700
int underlineStyle = NSUnderlineStyleSingle |
NSUnderlineByWordMask;
BOOL isSingle = (underlineStyle &
NSUnderlineStyleSingle) == NSUnderlineStyleSingle;
BOOL isDouble = (underlineStyle &
NSUnderlineStyleDouble) == NSUnderlineStyleDouble;
BOOL byWord = (underlineStyle &
NSUnderlineByWordMask) == NSUnderlineByWordMask;
Returns non-zero for everything.
The trouble you are experiencing is that the double underline mask
includes the single underline bit. What you're after is:
BOOL isDouble = (NSUnderlineStyleDouble == (style &
NSUnderlineStyleDouble));
BOOL isSingle = (! isDouble) && (NSUnderlineStyleSingle == (style &
NSUnderlineStyleSingle));
BOOL isByWord = (0 != (style & NSUnderlineByWordMask));
~Martin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden