mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 19:21:16 +00:00
Tidied indentation
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@10573 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
949f20149f
commit
56ca810cfa
1 changed files with 109 additions and 81 deletions
|
@ -200,7 +200,9 @@ readNSString(StringContext *ctxt)
|
||||||
tabChanged = YES;
|
tabChanged = YES;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
[paragraph addTabStop: tab];
|
[paragraph addTabStop: tab];
|
||||||
|
}
|
||||||
|
|
||||||
changed = YES;
|
changed = YES;
|
||||||
RELEASE(tab);
|
RELEASE(tab);
|
||||||
|
@ -230,8 +232,10 @@ readNSString(StringContext *ctxt)
|
||||||
NSAttributedString *text = nil;
|
NSAttributedString *text = nil;
|
||||||
|
|
||||||
if ([wrapper isRegularFile])
|
if ([wrapper isRegularFile])
|
||||||
|
{
|
||||||
text = [consumer parseRTF: [wrapper regularFileContents]
|
text = [consumer parseRTF: [wrapper regularFileContents]
|
||||||
documentAttributes: dict];
|
documentAttributes: dict];
|
||||||
|
}
|
||||||
else if ([wrapper isDirectory])
|
else if ([wrapper isDirectory])
|
||||||
{
|
{
|
||||||
NSDictionary *files = [wrapper fileWrappers];
|
NSDictionary *files = [wrapper fileWrappers];
|
||||||
|
@ -240,9 +244,11 @@ readNSString(StringContext *ctxt)
|
||||||
//FIXME: We should store the files in the consumer
|
//FIXME: We should store the files in the consumer
|
||||||
// We try to read the main file in the directory
|
// We try to read the main file in the directory
|
||||||
if ((contents = [files objectForKey: @"TXT.rtf"]) != nil)
|
if ((contents = [files objectForKey: @"TXT.rtf"]) != nil)
|
||||||
|
{
|
||||||
text = [consumer parseRTF: [contents regularFileContents]
|
text = [consumer parseRTF: [contents regularFileContents]
|
||||||
documentAttributes: dict];
|
documentAttributes: dict];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RELEASE(consumer);
|
RELEASE(consumer);
|
||||||
|
|
||||||
|
@ -340,7 +346,8 @@ readNSString(StringContext *ctxt)
|
||||||
CREATE_AUTORELEASE_POOL(pool);
|
CREATE_AUTORELEASE_POOL(pool);
|
||||||
RTFscannerCtxt scanner;
|
RTFscannerCtxt scanner;
|
||||||
StringContext stringCtxt;
|
StringContext stringCtxt;
|
||||||
// We should read in the first few characters to find out which encoding we have
|
// We should read in the first few characters to find out which
|
||||||
|
// encoding we have
|
||||||
NSString *rtfString = [[NSString alloc]
|
NSString *rtfString = [[NSString alloc]
|
||||||
initWithData: rtfData
|
initWithData: rtfData
|
||||||
encoding: NSASCIIStringEncoding];
|
encoding: NSASCIIStringEncoding];
|
||||||
|
@ -362,7 +369,9 @@ readNSString(StringContext *ctxt)
|
||||||
RELEASE(pool);
|
RELEASE(pool);
|
||||||
// document attributes
|
// document attributes
|
||||||
if (dict)
|
if (dict)
|
||||||
|
{
|
||||||
*dict = [self documentAttributes];
|
*dict = [self documentAttributes];
|
||||||
|
}
|
||||||
|
|
||||||
return [self result];
|
return [self result];
|
||||||
}
|
}
|
||||||
|
@ -430,16 +439,22 @@ void GSRTFstop(void *ctxt)
|
||||||
void GSRTFopenBlock (void *ctxt, BOOL ignore)
|
void GSRTFopenBlock (void *ctxt, BOOL ignore)
|
||||||
{
|
{
|
||||||
if (!IGNORE)
|
if (!IGNORE)
|
||||||
|
{
|
||||||
[(RTFConsumer *)ctxt push];
|
[(RTFConsumer *)ctxt push];
|
||||||
|
}
|
||||||
// Switch off any output for ignored block statements
|
// Switch off any output for ignored block statements
|
||||||
if (ignore)
|
if (ignore)
|
||||||
|
{
|
||||||
IGNORE++;
|
IGNORE++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GSRTFcloseBlock (void *ctxt, BOOL ignore)
|
void GSRTFcloseBlock (void *ctxt, BOOL ignore)
|
||||||
{
|
{
|
||||||
if (ignore)
|
if (ignore)
|
||||||
|
{
|
||||||
IGNORE--;
|
IGNORE--;
|
||||||
|
}
|
||||||
if (!IGNORE)
|
if (!IGNORE)
|
||||||
{
|
{
|
||||||
[(RTFConsumer *)ctxt pop];
|
[(RTFConsumer *)ctxt pop];
|
||||||
|
@ -460,25 +475,34 @@ void GSRTFmangleText(void *ctxt, const char *text)
|
||||||
|
|
||||||
if (CHANGED)
|
if (CHANGED)
|
||||||
{
|
{
|
||||||
attributes = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
attributes = [NSMutableDictionary
|
||||||
|
dictionaryWithObjectsAndKeys:
|
||||||
[CTXT currentFont], NSFontAttributeName,
|
[CTXT currentFont], NSFontAttributeName,
|
||||||
PARAGRAPH, NSParagraphStyleAttributeName,
|
PARAGRAPH, NSParagraphStyleAttributeName,
|
||||||
nil];
|
nil];
|
||||||
if (UNDERLINE)
|
if (UNDERLINE)
|
||||||
|
{
|
||||||
[attributes setObject: [CTXT underline]
|
[attributes setObject: [CTXT underline]
|
||||||
forKey: NSUnderlineStyleAttributeName];
|
forKey: NSUnderlineStyleAttributeName];
|
||||||
|
}
|
||||||
if (SCRIPT)
|
if (SCRIPT)
|
||||||
|
{
|
||||||
[attributes setObject: [CTXT script]
|
[attributes setObject: [CTXT script]
|
||||||
forKey: NSSuperscriptAttributeName];
|
forKey: NSSuperscriptAttributeName];
|
||||||
|
}
|
||||||
if (FGCOLOUR != nil)
|
if (FGCOLOUR != nil)
|
||||||
|
{
|
||||||
[attributes setObject: FGCOLOUR
|
[attributes setObject: FGCOLOUR
|
||||||
forKey: NSForegroundColorAttributeName];
|
forKey: NSForegroundColorAttributeName];
|
||||||
|
}
|
||||||
if (BGCOLOUR != nil)
|
if (BGCOLOUR != nil)
|
||||||
|
{
|
||||||
[attributes setObject: BGCOLOUR
|
[attributes setObject: BGCOLOUR
|
||||||
forKey: NSBackgroundColorAttributeName];
|
forKey: NSBackgroundColorAttributeName];
|
||||||
|
}
|
||||||
|
|
||||||
[RESULT setAttributes: attributes range:
|
[RESULT setAttributes: attributes
|
||||||
NSMakeRange(oldPosition, textlen)];
|
range: NSMakeRange(oldPosition, textlen)];
|
||||||
CHANGED = NO;
|
CHANGED = NO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -545,7 +569,9 @@ void GSRTFpaperWidth(void *ctxt, int width)
|
||||||
NSSize size;
|
NSSize size;
|
||||||
|
|
||||||
if (val == nil)
|
if (val == nil)
|
||||||
|
{
|
||||||
size = NSMakeSize(fwidth, 792);
|
size = NSMakeSize(fwidth, 792);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size = [val sizeValue];
|
size = [val sizeValue];
|
||||||
|
@ -562,7 +588,9 @@ void GSRTFpaperHeight(void *ctxt, int height)
|
||||||
NSSize size;
|
NSSize size;
|
||||||
|
|
||||||
if (val == nil)
|
if (val == nil)
|
||||||
|
{
|
||||||
size = NSMakeSize(612, fheight);
|
size = NSMakeSize(612, fheight);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size = [val sizeValue];
|
size = [val sizeValue];
|
||||||
|
|
Loading…
Reference in a new issue