Fix BOOL accessors to return a genuine boolean (YES or NO)

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22413 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-02-02 21:16:55 +00:00
parent e5757e137f
commit 7d97327c27
8 changed files with 163 additions and 156 deletions

View file

@ -9,6 +9,13 @@
Honor the NSWindow-canHide method when deactivating apps.
* Source/NSWindow.m: Fix accessor methods which return a BOOL to
do the right thing when they are accessing a bit in a bitfield.
* Source/NSWindowController.m: ditto
* Source/NSDataLinkManager.m: ditto
* Source/NSTextView.m: ditto
* Source/NSDocumentController.m: ditto
* Source/NSDataLink.m: ditto
* Source/NSView.m: ditto
* Source/NSDocument.m: ditto
2006-02-01 Richard Frith-Macdonald <rfm@gnu.org>

View file

@ -288,15 +288,15 @@
[aCoder encodeValueOfObjCType: @encode(id) at: &types];
// flags...
flag = _flags.appVerifies;
flag = (_flags.appVerifies ? YES : NO);
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
flag = _flags.canUpdateContinuously;
flag = (_flags.canUpdateContinuously ? YES : NO);
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
flag = _flags.isDirty;
flag = (_flags.isDirty ? YES : NO);
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
flag = _flags.willOpenSource;
flag = (_flags.willOpenSource ? YES : NO);
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
flag = _flags.willUpdate;
flag = (_flags.willUpdate ? YES : NO);
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
}

View file

@ -259,7 +259,7 @@
- (BOOL)delegateVerifiesLinks
{
return _flags.delegateVerifiesLinks;
return (_flags.delegateVerifiesLinks ? YES : NO);
}
- (NSString *)filename
@ -269,12 +269,12 @@
- (BOOL)interactsWithUser
{
return _flags.interactsWithUser;
return (_flags.interactsWithUser ? YES : NO);
}
- (BOOL)isEdited
{
return _flags.isEdited;
return (_flags.isEdited ? YES : NO);
}
- (void)setDelegateVerifiesLinks:(BOOL)flag
@ -292,7 +292,7 @@
//
- (BOOL)areLinkOutlinesVisible
{
return _flags.areLinkOutlinesVisible;
return (_flags.areLinkOutlinesVisible ? YES : NO);
}
- (NSEnumerator *)destinationLinkEnumerator
@ -337,13 +337,13 @@
[aCoder encodeValueOfObjCType: @encode(id) at: &sourceLinks];
[aCoder encodeValueOfObjCType: @encode(id) at: &destinationLinks];
flag = _flags.areLinkOutlinesVisible;
flag = (_flags.areLinkOutlinesVisible ? YES : NO);
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
flag = _flags.delegateVerifiesLinks;
flag = (_flags.delegateVerifiesLinks ? YES : NO);
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
flag = _flags.interactsWithUser;
flag = (_flags.interactsWithUser ? YES : NO);
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
flag = _flags.isEdited;
flag = (_flags.isEdited ? YES : NO);
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &flag];
}

View file

@ -916,7 +916,7 @@
- (BOOL)hasUndoManager
{
return _docFlags.hasUndoManager;
return (_docFlags.hasUndoManager ? YES : NO);
}
- (void)setHasUndoManager: (BOOL)flag

View file

@ -188,7 +188,7 @@ static NSDictionary *TypeInfoForName (NSArray *types, NSString *typeName)
- (BOOL) shouldCreateUI
{
return _controllerFlags.shouldCreateUI;
return (_controllerFlags.shouldCreateUI ? YES : NO);
}
- (void) setShouldCreateUI: (BOOL)flag

View file

@ -1011,7 +1011,7 @@ to make sure syncing is handled properly in all cases.
- (BOOL) isEditable
{
return _tf.is_editable;
return (_tf.is_editable ? YES : NO);
}
- (void) setEditable: (BOOL)flag
@ -1038,7 +1038,7 @@ to make sure syncing is handled properly in all cases.
- (BOOL) isSelectable
{
return _tf.is_selectable;
return (_tf.is_selectable ? YES : NO);
}
- (void) setSelectable: (BOOL)flag
@ -1057,7 +1057,7 @@ to make sure syncing is handled properly in all cases.
- (BOOL) isFieldEditor
{
return _tf.is_field_editor;
return (_tf.is_field_editor ? YES : NO);
}
- (void) setFieldEditor: (BOOL)flag
@ -1074,7 +1074,7 @@ to make sure syncing is handled properly in all cases.
- (BOOL) isRichText
{
return _tf.is_rich_text;
return (_tf.is_rich_text ? YES : NO);
}
- (void) setRichText: (BOOL)flag
@ -1095,7 +1095,7 @@ to make sure syncing is handled properly in all cases.
- (BOOL) importsGraphics
{
return _tf.imports_graphics;
return (_tf.imports_graphics ? YES : NO);
}
- (void) setImportsGraphics: (BOOL)flag
@ -1114,7 +1114,7 @@ to make sure syncing is handled properly in all cases.
- (BOOL) usesRuler
{
return _tf.uses_ruler;
return (_tf.uses_ruler ? YES : NO);
}
/* TODO: set ruler visible to NO if flag==NO? */
@ -1129,7 +1129,7 @@ to make sure syncing is handled properly in all cases.
- (BOOL) isRulerVisible
{
return _tf.is_ruler_visible;
return (_tf.is_ruler_visible ? YES : NO);
}
- (void) setRulerVisible: (BOOL)flag
@ -1151,7 +1151,7 @@ to make sure syncing is handled properly in all cases.
- (BOOL) usesFontPanel
{
return _tf.uses_font_panel;
return (_tf.uses_font_panel ? YES : NO);
}
- (void) setUsesFontPanel: (BOOL)flag
@ -1165,7 +1165,7 @@ to make sure syncing is handled properly in all cases.
- (BOOL) smartInsertDeleteEnabled
{
return _tf.smart_insert_delete;
return (_tf.smart_insert_delete ? YES : NO);
}
- (void) setSmartInsertDeleteEnabled: (BOOL)flag
@ -1179,7 +1179,7 @@ to make sure syncing is handled properly in all cases.
- (BOOL) allowsUndo
{
return _tf.allows_undo;
return (_tf.allows_undo ? YES : NO);
}
- (void) setAllowsUndo: (BOOL)flag
@ -1230,7 +1230,7 @@ to make sure syncing is handled properly in all cases.
- (BOOL) needsPanelToBecomeKey
{
return _tf.is_editable;
return (_tf.is_editable ? YES : NO);
}
- (BOOL) acceptsFirstResponder
@ -1362,7 +1362,7 @@ started (in another text view attached to the same layout manager). */
- (BOOL) drawsBackground
{
return _tf.draws_background;
return (_tf.draws_background ? YES : NO);
}
- (void) setBackgroundColor: (NSColor *)color
@ -1459,11 +1459,11 @@ incorrectly. */
}
- (BOOL) isHorizontallyResizable
{
return _tf.is_horizontally_resizable;
return (_tf.is_horizontally_resizable ? YES : NO);
}
- (BOOL) isVerticallyResizable
{
return _tf.is_vertically_resizable;
return (_tf.is_vertically_resizable ? YES : NO);
}

View file

@ -4108,7 +4108,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
- (BOOL) needsDisplay
{
return _rFlags.needs_display;
return (_rFlags.needs_display ? YES : NO);
}
- (int) tag

View file

@ -207,7 +207,7 @@
- (BOOL) shouldCloseDocument
{
return _wcFlags.shouldCloseDocument;
return (_wcFlags.shouldCloseDocument ? YES : NO);
}
- (void) setShouldCascadeWindows: (BOOL)flag
@ -217,7 +217,7 @@
- (BOOL) shouldCascadeWindows
{
return _wcFlags.shouldCascade;
return (_wcFlags.shouldCascade ? YES : NO);
}
- (void) close
@ -375,7 +375,7 @@
- (BOOL) isWindowLoaded
{
return _wcFlags.nibIsLoaded;
return (_wcFlags.nibIsLoaded ? YES : NO);
}
- (void) windowDidLoad