mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 10:10:59 +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;
|
||||
}
|
||||
else
|
||||
{
|
||||
[paragraph addTabStop: tab];
|
||||
}
|
||||
|
||||
changed = YES;
|
||||
RELEASE(tab);
|
||||
|
@ -230,8 +232,10 @@ readNSString(StringContext *ctxt)
|
|||
NSAttributedString *text = nil;
|
||||
|
||||
if ([wrapper isRegularFile])
|
||||
{
|
||||
text = [consumer parseRTF: [wrapper regularFileContents]
|
||||
documentAttributes: dict];
|
||||
}
|
||||
else if ([wrapper isDirectory])
|
||||
{
|
||||
NSDictionary *files = [wrapper fileWrappers];
|
||||
|
@ -240,9 +244,11 @@ readNSString(StringContext *ctxt)
|
|||
//FIXME: We should store the files in the consumer
|
||||
// We try to read the main file in the directory
|
||||
if ((contents = [files objectForKey: @"TXT.rtf"]) != nil)
|
||||
{
|
||||
text = [consumer parseRTF: [contents regularFileContents]
|
||||
documentAttributes: dict];
|
||||
}
|
||||
}
|
||||
|
||||
RELEASE(consumer);
|
||||
|
||||
|
@ -340,7 +346,8 @@ readNSString(StringContext *ctxt)
|
|||
CREATE_AUTORELEASE_POOL(pool);
|
||||
RTFscannerCtxt scanner;
|
||||
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]
|
||||
initWithData: rtfData
|
||||
encoding: NSASCIIStringEncoding];
|
||||
|
@ -362,7 +369,9 @@ readNSString(StringContext *ctxt)
|
|||
RELEASE(pool);
|
||||
// document attributes
|
||||
if (dict)
|
||||
{
|
||||
*dict = [self documentAttributes];
|
||||
}
|
||||
|
||||
return [self result];
|
||||
}
|
||||
|
@ -430,16 +439,22 @@ void GSRTFstop(void *ctxt)
|
|||
void GSRTFopenBlock (void *ctxt, BOOL ignore)
|
||||
{
|
||||
if (!IGNORE)
|
||||
{
|
||||
[(RTFConsumer *)ctxt push];
|
||||
}
|
||||
// Switch off any output for ignored block statements
|
||||
if (ignore)
|
||||
{
|
||||
IGNORE++;
|
||||
}
|
||||
}
|
||||
|
||||
void GSRTFcloseBlock (void *ctxt, BOOL ignore)
|
||||
{
|
||||
if (ignore)
|
||||
{
|
||||
IGNORE--;
|
||||
}
|
||||
if (!IGNORE)
|
||||
{
|
||||
[(RTFConsumer *)ctxt pop];
|
||||
|
@ -460,25 +475,34 @@ void GSRTFmangleText(void *ctxt, const char *text)
|
|||
|
||||
if (CHANGED)
|
||||
{
|
||||
attributes = [NSMutableDictionary dictionaryWithObjectsAndKeys:
|
||||
attributes = [NSMutableDictionary
|
||||
dictionaryWithObjectsAndKeys:
|
||||
[CTXT currentFont], NSFontAttributeName,
|
||||
PARAGRAPH, NSParagraphStyleAttributeName,
|
||||
nil];
|
||||
if (UNDERLINE)
|
||||
{
|
||||
[attributes setObject: [CTXT underline]
|
||||
forKey: NSUnderlineStyleAttributeName];
|
||||
}
|
||||
if (SCRIPT)
|
||||
{
|
||||
[attributes setObject: [CTXT script]
|
||||
forKey: NSSuperscriptAttributeName];
|
||||
}
|
||||
if (FGCOLOUR != nil)
|
||||
{
|
||||
[attributes setObject: FGCOLOUR
|
||||
forKey: NSForegroundColorAttributeName];
|
||||
}
|
||||
if (BGCOLOUR != nil)
|
||||
{
|
||||
[attributes setObject: BGCOLOUR
|
||||
forKey: NSBackgroundColorAttributeName];
|
||||
}
|
||||
|
||||
[RESULT setAttributes: attributes range:
|
||||
NSMakeRange(oldPosition, textlen)];
|
||||
[RESULT setAttributes: attributes
|
||||
range: NSMakeRange(oldPosition, textlen)];
|
||||
CHANGED = NO;
|
||||
}
|
||||
}
|
||||
|
@ -545,7 +569,9 @@ void GSRTFpaperWidth(void *ctxt, int width)
|
|||
NSSize size;
|
||||
|
||||
if (val == nil)
|
||||
{
|
||||
size = NSMakeSize(fwidth, 792);
|
||||
}
|
||||
else
|
||||
{
|
||||
size = [val sizeValue];
|
||||
|
@ -562,7 +588,9 @@ void GSRTFpaperHeight(void *ctxt, int height)
|
|||
NSSize size;
|
||||
|
||||
if (val == nil)
|
||||
{
|
||||
size = NSMakeSize(612, fheight);
|
||||
}
|
||||
else
|
||||
{
|
||||
size = [val sizeValue];
|
||||
|
|
Loading…
Reference in a new issue