Revision: 6865
http://skim-app.svn.sourceforge.net/skim-app/?rev=6865&view=rev
Author: hofman
Date: 2010-10-02 17:11:35 +0000 (Sat, 02 Oct 2010)
Log Message:
-----------
define macros for tex editors
Modified Paths:
--------------
trunk/SKSyncPreferences.m
Modified: trunk/SKSyncPreferences.m
===================================================================
--- trunk/SKSyncPreferences.m 2010-10-01 21:49:12 UTC (rev 6864)
+++ trunk/SKSyncPreferences.m 2010-10-02 17:11:35 UTC (rev 6865)
@@ -50,6 +50,8 @@
{@"LyX", @"lyxeditor",
@"\"%file\" %line"},
{@"TeXMaker", @"texmaker",
@"\"%file\" -line %line"},
{@"AlphaX", @"alphac",
@"+%line \"%file\""}};
+#define SKTeXEditorCount (sizeof(SKTeXEditors) / sizeof(SKTeXEditor))
+#define SKNullTeXEditor ((SKTeXEditor){nil, nil, nil})
@implementation SKSyncPreferences
@@ -71,7 +73,7 @@
SKAutoSizeLabelFields(texEditorLabels, texEditorControls, YES);
NSString *editorPreset = [[NSUserDefaults standardUserDefaults]
stringForKey:SKTeXEditorPresetKey];
- NSInteger i = sizeof(SKTeXEditors) / sizeof(SKTeXEditor);
+ NSInteger i = SKTeXEditorCount;
NSInteger idx = -1;
NSPopUpButton *texEditorPopUpButton = [texEditorControls objectAtIndex:0];
@@ -97,13 +99,13 @@
- (NSImage *)icon { return [NSImage imageNamed:@"SyncPreferences"]; }
+ (SKTeXEditor)TeXEditorForPreset:(NSString *)name {
- NSInteger i = sizeof(SKTeXEditors) / sizeof(SKTeXEditor);
+ NSInteger i = SKTeXEditorCount;
while (i--) {
SKTeXEditor editor = SKTeXEditors[i];
if ([editor.name isEqualToString:name])
return editor;
}
- return (SKTeXEditor){nil, nil, nil};
+ return SKNullTeXEditor;
}
#pragma mark Actions
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit