|
From: <cre...@us...> - 2007-10-28 00:06:44
|
Revision: 1759
http://frontierkernel.svn.sourceforge.net/frontierkernel/?rev=1759&view=rev
Author: creecode
Date: 2007-10-27 17:06:49 -0700 (Sat, 27 Oct 2007)
Log Message:
-----------
in filemenufunctionvalue, function for newfunc case, clearbytes of fs and for Mac, copy path element of fs
Modified Paths:
--------------
Frontier/branches/IUDA_Desktop/Common/source/shellverbs.c
Modified: Frontier/branches/IUDA_Desktop/Common/source/shellverbs.c
===================================================================
--- Frontier/branches/IUDA_Desktop/Common/source/shellverbs.c 2007-10-27 22:58:34 UTC (rev 1758)
+++ Frontier/branches/IUDA_Desktop/Common/source/shellverbs.c 2007-10-28 00:06:49 UTC (rev 1759)
@@ -1056,37 +1056,43 @@
static boolean filemenufunctionvalue (short token, hdltreenode hparam1, tyvaluerecord *vreturned, bigstring bserror) {
+
+ //
+ // 2007-10-27 creedon: newfunc clearbytes of fs and for Mac, copy path
+ // element of fs
+ //
+ // 5.1.4 dmb: closefunc takes optional win parameter; savefunc checks
+ // hinfo for nil
+ //
+ // 5.0d18 dmb: closefunc respects the target
+ //
+ // 5.0d16 dmb: savefunc, newfunc need new (optional) parameters
+ //
+ // 3.0b15 dmb: quitfunc should just return false and let everything flow
+ // normally, instead of yielding here. this could problems
+ // calling filemenu.quit from a component menusharing (osa)
+ // client... however it doesn't, so this change is disabled
+ // for the time being.
+ //
+ // 1993-06-01 dmb: when vreturned is nil, return whether or not verb token
+ // must be run in the Frontier process
+ //
+ // 1993-05-19 dmb: closefunc uses getfrontwindow, not shellwindow
+ //
+ // 1991-10-23 dmb: must try to restore globals after revert, so new globals
+ // aren't in effect when deferred disposal takes place.
+ //
+ // 1991-10-03 dmb: split off fileMenu verbs from shell verbs
+ //
+ // 1991-02-07 dmb: functions that change the current file (closeall, new,
+ // open, revert) have to save & restore the language
+ // globals. we don't want the language to have to do this
+ // on every external call, so we do it selectively here
+ //
+ // added parameters to new, open & save; added boolean to
+ // avoid dialog in various shell routines.
+ //
- /*
- 2/7/91 dmb: added parameters to new, open & save; added boolean to avoid
- dialog in various shell routines.
-
- 2/7/91 dmb: functions that change the current file (closeall, new, open, revert) have
- to save & restore the language globals. we don't want the language to have
- to do this on every external call, so we do it selectively here
-
- 10/3/91 dmb: split off fileMenu verbs from shell verbs
-
- 10/23/91 dmb: must try to restore globals after revert, so new globals aren't
- in effect when deferred disposal takes place.
-
- 5/19/93 dmb: closefunc uses getfrontwindow, not shellwindow
-
- 6/1/93 dmb: when vreturned is nil, return whether or not verb token must
- be run in the Frontier process
-
- 3.0b15 dmb: quitfunc should just return false and let everything flow normally,
- instead of yielding here. this could problems calling filemenu.quit from a
- component menusharing (osa) client... however it doesn't, so this change is
- disabled for the time being.
-
- 5.0d16 dmb: savefunc, newfunc need new (optional) parameters
-
- 5.0d18 dmb: closefunc respects the target
-
- 5.1.4 dmb: closefunc takes optional win parameter; savefunc checks hinfo for nil
- */
-
register tyvaluerecord *v = vreturned;
register boolean fl;
@@ -1098,14 +1104,16 @@
switch (token) { /*these verbs don't need any special globals pushed*/
case newfunc: {
+
+ WindowPtr w;
+ short ctconsumed = 0, ctpositional;
+ tyexternalid id;
+ tyfilespec fs;
tyvaluerecord val;
- tyfilespec fs;
- tyexternalid id;
tyvaluerecord vhidden;
- short ctconsumed = 0;
- short ctpositional;
- WindowPtr w;
+ clearbytes ( &fs, sizeof ( fs ) );
+
if (!getparamvalue (hparam1, ++ctconsumed, &val))
return (false);
@@ -1129,8 +1137,19 @@
if (!coercetofilespec (&val))
return (false);
- fs = (**val.data.filespecvalue);
+ #ifdef MACVERSION
+ fs.fsref = ( **val.data.filespecvalue ).fsref;
+
+ if ( ( **val.data.filespecvalue ).path != NULL )
+ fs.path = CFStringCreateCopy ( kCFAllocatorDefault, ( **val.data.filespecvalue ).path );
+
+ #else
+
+ fs = **val.data.filespecvalue;
+
+ #endif
+
langsaveglobals (); /*see comment at function head*/
fl = shellnewfile (&fs, vhidden.data.flvalue, &w);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|