Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

excel-15.01.debug.js 43KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600
  1. /* Excel specific API library */
  2. /* Version: 15.0.4615.1000 */
  3. /*
  4. Copyright (c) Microsoft Corporation. All rights reserved.
  5. */
  6. /*
  7. Your use of this file is governed by the Microsoft Services Agreement http://go.microsoft.com/fwlink/?LinkId=266419.
  8. */
  9. OSF.OUtil.augmentList(Microsoft.Office.WebExtension.FilterType, {
  10. OnlyVisible: "onlyVisible"
  11. });
  12. OSF.ClientMode={
  13. ReadWrite: 0,
  14. ReadOnly: 1
  15. }
  16. OSF.DDA.RichInitializationReason={
  17. 1: Microsoft.Office.WebExtension.InitializationReason.Inserted,
  18. 2: Microsoft.Office.WebExtension.InitializationReason.DocumentOpened
  19. };
  20. Microsoft.Office.WebExtension.FileType={
  21. Text: "text",
  22. Compressed: "compressed"
  23. };
  24. OSF.DDA.RichClientSettingsManager={
  25. read: function OSF_DDA_RichClientSettingsManager$Read(onCalling, onReceiving) {
  26. var keys=[];
  27. var values=[];
  28. if (onCalling) {
  29. onCalling();
  30. }
  31. window.external.GetContext().GetSettings().Read(keys, values);
  32. if (onReceiving) {
  33. onReceiving();
  34. }
  35. var serializedSettings={};
  36. for (var index=0; index < keys.length; index++) {
  37. serializedSettings[keys[index]]=values[index];
  38. }
  39. return serializedSettings;
  40. },
  41. write: function OSF_DDA_RichClientSettingsManager$Write(serializedSettings, overwriteIfStale, onCalling, onReceiving) {
  42. var keys=[];
  43. var values=[];
  44. for (var key in serializedSettings) {
  45. keys.push(key);
  46. values.push(serializedSettings[key]);
  47. }
  48. if (onCalling) {
  49. onCalling();
  50. }
  51. window.external.GetContext().GetSettings().Write(keys, values);
  52. if (onReceiving) {
  53. onReceiving();
  54. }
  55. }
  56. };
  57. OSF.DDA.DispIdHost.getRichClientDelegateMethods=function (actionId) {
  58. var delegateMethods={};
  59. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=OSF.DDA.SafeArray.Delegate.executeAsync;
  60. delegateMethods[OSF.DDA.DispIdHost.Delegates.RegisterEventAsync]=OSF.DDA.SafeArray.Delegate.registerEventAsync;
  61. delegateMethods[OSF.DDA.DispIdHost.Delegates.UnregisterEventAsync]=OSF.DDA.SafeArray.Delegate.unregisterEventAsync;
  62. function getSettingsExecuteMethod(hostDelegateMethod) {
  63. return function (args) {
  64. var status, response;
  65. try {
  66. response=hostDelegateMethod(args.hostCallArgs, args.onCalling, args.onReceiving);
  67. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess;
  68. } catch (ex) {
  69. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  70. response={ name : Strings.OfficeOM.L_InternalError, message : ex };
  71. }
  72. if (args.onComplete) {
  73. args.onComplete(status, response);
  74. }
  75. };
  76. }
  77. function readSerializedSettings(hostCallArgs, onCalling, onReceiving) {
  78. return OSF.DDA.RichClientSettingsManager.read(onCalling, onReceiving);
  79. }
  80. function writeSerializedSettings(hostCallArgs, onCalling, onReceiving) {
  81. return OSF.DDA.RichClientSettingsManager.write(
  82. hostCallArgs[OSF.DDA.SettingsManager.SerializedSettings],
  83. hostCallArgs[Microsoft.Office.WebExtension.Parameters.OverwriteIfStale],
  84. onCalling,
  85. onReceiving
  86. );
  87. }
  88. switch (actionId) {
  89. case OSF.DDA.AsyncMethodNames.RefreshAsync.id:
  90. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(readSerializedSettings);
  91. break;
  92. case OSF.DDA.AsyncMethodNames.SaveAsync.id:
  93. delegateMethods[OSF.DDA.DispIdHost.Delegates.ExecuteAsync]=getSettingsExecuteMethod(writeSerializedSettings);
  94. break;
  95. default:
  96. break;
  97. }
  98. return delegateMethods;
  99. }
  100. OSF.DDA.File=function OSF_DDA_File(handle, fileSize, sliceSize) {
  101. OSF.OUtil.defineEnumerableProperties(this, {
  102. "size": {
  103. value: fileSize
  104. },
  105. "sliceCount": {
  106. value: Math.ceil(fileSize / sliceSize)
  107. }
  108. });
  109. var privateState={};
  110. privateState[OSF.DDA.FileProperties.Handle]=handle;
  111. privateState[OSF.DDA.FileProperties.SliceSize]=sliceSize;
  112. var am=OSF.DDA.AsyncMethodNames;
  113. OSF.DDA.DispIdHost.addAsyncMethods(
  114. this, [
  115. am.GetDocumentCopyChunkAsync,
  116. am.ReleaseDocumentCopyAsync
  117. ],
  118. privateState
  119. );
  120. }
  121. OSF.DDA.FileSliceOffset="fileSliceoffset";
  122. OSF.DDA.CustomXmlParts=function OSF_DDA_CustomXmlParts() {
  123. this._eventDispatches=[];
  124. var am=OSF.DDA.AsyncMethodNames;
  125. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  126. am.AddDataPartAsync,
  127. am.GetDataPartByIdAsync,
  128. am.GetDataPartsByNameSpaceAsync
  129. ]);
  130. };
  131. OSF.DDA.CustomXmlPart=function OSF_DDA_CustomXmlPart(customXmlParts, id, builtIn) {
  132. OSF.OUtil.defineEnumerableProperties(this, {
  133. "builtIn": {
  134. value: builtIn
  135. },
  136. "id": {
  137. value: id
  138. },
  139. "namespaceManager": {
  140. value: new OSF.DDA.CustomXmlPrefixMappings(id)
  141. }
  142. });
  143. var am=OSF.DDA.AsyncMethodNames;
  144. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  145. am.DeleteDataPartAsync,
  146. am.GetPartNodesAsync,
  147. am.GetPartXmlAsync
  148. ]);
  149. var customXmlPartEventDispatches=customXmlParts._eventDispatches;
  150. var dispatch=customXmlPartEventDispatches[id];
  151. if (!dispatch) {
  152. var et=Microsoft.Office.WebExtension.EventType;
  153. dispatch=new OSF.EventDispatch([
  154. et.DataNodeDeleted,
  155. et.DataNodeInserted,
  156. et.DataNodeReplaced
  157. ]);
  158. customXmlPartEventDispatches[id]=dispatch;
  159. }
  160. OSF.DDA.DispIdHost.addEventSupport(this, dispatch);
  161. };
  162. OSF.DDA.CustomXmlPrefixMappings=function OSF_DDA_CustomXmlPrefixMappings(partId) {
  163. var am=OSF.DDA.AsyncMethodNames;
  164. OSF.DDA.DispIdHost.addAsyncMethods(
  165. this,
  166. [
  167. am.AddDataPartNamespaceAsync,
  168. am.GetDataPartNamespaceAsync,
  169. am.GetDataPartPrefixAsync
  170. ],
  171. partId
  172. );
  173. };
  174. OSF.DDA.CustomXmlNode=function OSF_DDA_CustomXmlNode(handle, nodeType, ns, baseName) {
  175. OSF.OUtil.defineEnumerableProperties(this, {
  176. "baseName": {
  177. value: baseName
  178. },
  179. "namespaceUri": {
  180. value: ns
  181. },
  182. "nodeType": {
  183. value: nodeType
  184. }
  185. });
  186. var am=OSF.DDA.AsyncMethodNames;
  187. OSF.DDA.DispIdHost.addAsyncMethods(
  188. this,
  189. [
  190. am.GetRelativeNodesAsync,
  191. am.GetNodeValueAsync,
  192. am.GetNodeXmlAsync,
  193. am.SetNodeValueAsync,
  194. am.SetNodeXmlAsync
  195. ],
  196. handle
  197. );
  198. };
  199. OSF.DDA.NodeInsertedEventArgs=function OSF_DDA_NodeInsertedEventArgs(newNode, inUndoRedo) {
  200. OSF.OUtil.defineEnumerableProperties(this, {
  201. "type": {
  202. value: Microsoft.Office.WebExtension.EventType.DataNodeInserted
  203. },
  204. "newNode": {
  205. value: newNode
  206. },
  207. "inUndoRedo": {
  208. value: inUndoRedo
  209. }
  210. });
  211. };
  212. OSF.DDA.NodeReplacedEventArgs=function OSF_DDA_NodeReplacedEventArgs(oldNode, newNode, inUndoRedo) {
  213. OSF.OUtil.defineEnumerableProperties(this, {
  214. "type": {
  215. value: Microsoft.Office.WebExtension.EventType.DataNodeReplaced
  216. },
  217. "oldNode": {
  218. value: oldNode
  219. },
  220. "newNode": {
  221. value: newNode
  222. },
  223. "inUndoRedo": {
  224. value: inUndoRedo
  225. }
  226. });
  227. };
  228. OSF.DDA.NodeDeletedEventArgs=function OSF_DDA_NodeDeletedEventArgs(oldNode, oldNextSibling, inUndoRedo) {
  229. OSF.OUtil.defineEnumerableProperties(this, {
  230. "type": {
  231. value: Microsoft.Office.WebExtension.EventType.DataNodeDeleted
  232. },
  233. "oldNode": {
  234. value: oldNode
  235. },
  236. "oldNextSibling": {
  237. value: oldNextSibling
  238. },
  239. "inUndoRedo": {
  240. value: inUndoRedo
  241. }
  242. });
  243. };
  244. OSF.OUtil.setNamespace("SafeArray", OSF.DDA);
  245. OSF.DDA.SafeArray.Response={
  246. Status: 0,
  247. Payload: 1
  248. };
  249. OSF.DDA.SafeArray.UniqueArguments={
  250. Offset: "offset",
  251. Run: "run",
  252. BindingSpecificData: "bindingSpecificData",
  253. MergedCellGuid: "{66e7831f-81b2-42e2-823c-89e872d541b3}"
  254. };
  255. OSF.OUtil.setNamespace("Delegate", OSF.DDA.SafeArray);
  256. OSF.DDA.SafeArray.Delegate.SpecialProcessor=function OSF_DDA_SafeArray_Delegate_SpecialProcessor() {
  257. function _2DVBArrayToJaggedArray(vbArr) {
  258. var ret;
  259. try {
  260. var rows=vbArr.ubound(1);
  261. var cols=vbArr.ubound(2);
  262. vbArr=vbArr.toArray();
  263. if (rows==1 && cols==1) {
  264. ret=[vbArr];
  265. } else {
  266. ret=[];
  267. for (var row=0; row < rows; row++) {
  268. var rowArr=[];
  269. for (var col=0; col < cols; col++) {
  270. var datum=vbArr[row * cols+col];
  271. if (datum !=OSF.DDA.SafeArray.UniqueArguments.MergedCellGuid) {
  272. rowArr.push(datum);
  273. }
  274. }
  275. if (rowArr.length > 0) {
  276. ret.push(rowArr);
  277. }
  278. }
  279. }
  280. } catch (ex) {
  281. }
  282. return ret;
  283. }
  284. var complexTypes=[
  285. OSF.DDA.PropertyDescriptors.FileProperties,
  286. OSF.DDA.PropertyDescriptors.FileSliceProperties,
  287. OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,
  288. OSF.DDA.PropertyDescriptors.BindingProperties,
  289. OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,
  290. OSF.DDA.SafeArray.UniqueArguments.Offset,
  291. OSF.DDA.SafeArray.UniqueArguments.Run,
  292. OSF.DDA.PropertyDescriptors.Subset,
  293. OSF.DDA.PropertyDescriptors.DataPartProperties,
  294. OSF.DDA.PropertyDescriptors.DataNodeProperties,
  295. OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,
  296. OSF.DDA.EventDescriptors.DataNodeInsertedEvent,
  297. OSF.DDA.EventDescriptors.DataNodeReplacedEvent,
  298. OSF.DDA.EventDescriptors.DataNodeDeletedEvent,
  299. OSF.DDA.EventDescriptors.DocumentThemeChangedEvent,
  300. OSF.DDA.EventDescriptors.OfficeThemeChangedEvent,
  301. OSF.DDA.EventDescriptors.ActiveViewChangedEvent,
  302. OSF.DDA.DataNodeEventProperties.OldNode,
  303. OSF.DDA.DataNodeEventProperties.NewNode,
  304. OSF.DDA.DataNodeEventProperties.NextSiblingNode,
  305. Microsoft.Office.Internal.Parameters.OfficeTheme,
  306. Microsoft.Office.Internal.Parameters.DocumentTheme
  307. ];
  308. var dynamicTypes={};
  309. dynamicTypes[Microsoft.Office.WebExtension.Parameters.Data]=(function () {
  310. var tableRows=0;
  311. var tableHeaders=1;
  312. return {
  313. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$toHost(data) {
  314. if (typeof data !="string" && data[OSF.DDA.TableDataProperties.TableRows] !==undefined) {
  315. var tableData=[];
  316. tableData[tableRows]=data[OSF.DDA.TableDataProperties.TableRows];
  317. tableData[tableHeaders]=data[OSF.DDA.TableDataProperties.TableHeaders];
  318. data=tableData;
  319. }
  320. return data;
  321. },
  322. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_Data$fromHost(hostArgs) {
  323. var ret;
  324. if (hostArgs.toArray) {
  325. var dimensions=hostArgs.dimensions();
  326. if(dimensions===2) {
  327. ret=_2DVBArrayToJaggedArray(hostArgs);
  328. } else {
  329. var array=hostArgs.toArray();
  330. if(array.length===2 && ((array[0] !=null && array[0].toArray) || (array[1] !=null && array[1].toArray))) {
  331. ret={};
  332. ret[OSF.DDA.TableDataProperties.TableRows]=_2DVBArrayToJaggedArray(array[tableRows]);
  333. ret[OSF.DDA.TableDataProperties.TableHeaders]=_2DVBArrayToJaggedArray(array[tableHeaders]);
  334. } else {
  335. ret=array;
  336. }
  337. }
  338. } else {
  339. ret=hostArgs;
  340. }
  341. return ret;
  342. }
  343. }
  344. })();
  345. OSF.DDA.SafeArray.Delegate.SpecialProcessor.uber.constructor.call(this, complexTypes, dynamicTypes);
  346. this.pack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$pack(param, arg) {
  347. var value;
  348. if (this.isDynamicType(param)) {
  349. value=dynamicTypes[param].toHost(arg);
  350. } else {
  351. value=arg;
  352. }
  353. return value;
  354. };
  355. this.unpack=function OSF_DDA_SafeArray_Delegate_SpecialProcessor$unpack(param, arg) {
  356. var value;
  357. if (this.isComplexType(param) || OSF.DDA.ListType.isListType(param)) {
  358. try {
  359. value=arg.toArray();
  360. } catch (ex) {
  361. value=arg || {};
  362. }
  363. } else if (this.isDynamicType(param)) {
  364. value=dynamicTypes[param].fromHost(arg);
  365. } else {
  366. value=arg;
  367. }
  368. return value;
  369. };
  370. this.dynamicTypes=dynamicTypes;
  371. }
  372. OSF.OUtil.extend(OSF.DDA.SafeArray.Delegate.SpecialProcessor, OSF.DDA.SpecialProcessor);
  373. OSF.DDA.SafeArray.Delegate.ParameterMap=(function () {
  374. var parameterMap=new OSF.DDA.HostParameterMap(new OSF.DDA.SafeArray.Delegate.SpecialProcessor());
  375. var ns;
  376. var self=parameterMap.self;
  377. function createObject(properties) {
  378. var obj=null;
  379. if (properties) {
  380. obj={};
  381. var len=properties.length;
  382. for (var i=0; i < len; i++) {
  383. obj[properties[i].name]=properties[i].value;
  384. }
  385. }
  386. return obj;
  387. }
  388. function define(definition) {
  389. var args={};
  390. var toHost=createObject(definition.toHost);
  391. if (definition.invertible) {
  392. args.map=toHost;
  393. }
  394. else if (definition.canonical) {
  395. args.toHost=args.fromHost=toHost;
  396. }
  397. else {
  398. args.toHost=toHost;
  399. args.fromHost=createObject(definition.fromHost);
  400. }
  401. parameterMap.setMapping(definition.type, args);
  402. }
  403. ns=OSF.DDA.FileProperties;
  404. define({
  405. type: OSF.DDA.PropertyDescriptors.FileProperties,
  406. fromHost: [
  407. { name: ns.Handle, value: 0 },
  408. { name: ns.FileSize, value: 1 }
  409. ]
  410. });
  411. define({
  412. type: OSF.DDA.PropertyDescriptors.FileSliceProperties,
  413. fromHost: [
  414. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 0 },
  415. { name: ns.SliceSize, value: 1}
  416. ]
  417. });
  418. ns=OSF.DDA.FilePropertiesDescriptor;
  419. define({
  420. type: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor,
  421. fromHost: [
  422. { name: ns.Url, value: 0 }
  423. ]
  424. });
  425. ns=OSF.DDA.BindingProperties;
  426. define({
  427. type: OSF.DDA.PropertyDescriptors.BindingProperties,
  428. fromHost: [
  429. { name: ns.Id, value: 0 },
  430. { name: ns.Type, value: 1 },
  431. { name: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData, value: 2 }
  432. ]
  433. });
  434. define({
  435. type: OSF.DDA.SafeArray.UniqueArguments.BindingSpecificData,
  436. fromHost: [
  437. { name: ns.RowCount, value: 0 },
  438. { name: ns.ColumnCount, value: 1 },
  439. { name: ns.HasHeaders, value: 2 }
  440. ]
  441. });
  442. ns=OSF.DDA.SafeArray.UniqueArguments;
  443. define({
  444. type: OSF.DDA.PropertyDescriptors.Subset,
  445. toHost: [
  446. { name: ns.Offset, value: 0 },
  447. { name: ns.Run, value: 1 }
  448. ],
  449. canonical: true
  450. });
  451. ns=Microsoft.Office.WebExtension.Parameters;
  452. define({
  453. type: OSF.DDA.SafeArray.UniqueArguments.Offset,
  454. toHost: [
  455. { name: ns.StartRow, value: 0 },
  456. { name: ns.StartColumn, value: 1 }
  457. ],
  458. canonical: true
  459. });
  460. define({
  461. type: OSF.DDA.SafeArray.UniqueArguments.Run,
  462. toHost: [
  463. { name: ns.RowCount, value: 0 },
  464. { name: ns.ColumnCount, value: 1 }
  465. ],
  466. canonical: true
  467. });
  468. ns=OSF.DDA.DataPartProperties;
  469. define({
  470. type: OSF.DDA.PropertyDescriptors.DataPartProperties,
  471. fromHost: [
  472. { name: ns.Id, value: 0 },
  473. { name: ns.BuiltIn, value: 1 }
  474. ]
  475. });
  476. ns=OSF.DDA.DataNodeProperties;
  477. define({
  478. type: OSF.DDA.PropertyDescriptors.DataNodeProperties,
  479. fromHost: [
  480. { name: ns.Handle, value: 0 },
  481. { name: ns.BaseName, value: 1 },
  482. { name: ns.NamespaceUri, value: 2 },
  483. { name: ns.NodeType, value: 3 }
  484. ]
  485. });
  486. define({
  487. type: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent,
  488. fromHost: [
  489. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: 0 },
  490. { name: OSF.DDA.PropertyDescriptors.Subset, value: 1 }
  491. ]
  492. });
  493. define({
  494. type: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent,
  495. fromHost: [
  496. { name: Microsoft.Office.Internal.Parameters.DocumentTheme, value: self}
  497. ]
  498. })
  499. define({
  500. type: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent,
  501. fromHost: [
  502. { name: Microsoft.Office.Internal.Parameters.OfficeTheme, value: self}
  503. ]
  504. })
  505. define({
  506. type: OSF.DDA.EventDescriptors.ActiveViewChangedEvent,
  507. fromHost: [
  508. { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: 0}
  509. ]
  510. })
  511. ns=OSF.DDA.DataNodeEventProperties;
  512. define({
  513. type: OSF.DDA.EventDescriptors.DataNodeInsertedEvent,
  514. fromHost: [
  515. { name: ns.InUndoRedo, value: 0 },
  516. { name: ns.NewNode, value: 1 }
  517. ]
  518. });
  519. define({
  520. type: OSF.DDA.EventDescriptors.DataNodeReplacedEvent,
  521. fromHost: [
  522. { name: ns.InUndoRedo, value: 0 },
  523. { name: ns.OldNode, value: 1 },
  524. { name: ns.NewNode, value: 2 }
  525. ]
  526. });
  527. define({
  528. type: OSF.DDA.EventDescriptors.DataNodeDeletedEvent,
  529. fromHost: [
  530. { name: ns.InUndoRedo, value: 0 },
  531. { name: ns.OldNode, value: 1 },
  532. { name: ns.NextSiblingNode, value: 2 }
  533. ]
  534. });
  535. define({
  536. type: ns.OldNode,
  537. fromHost: [
  538. { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self }
  539. ]
  540. });
  541. define({
  542. type: ns.NewNode,
  543. fromHost: [
  544. { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self }
  545. ]
  546. });
  547. define({
  548. type: ns.NextSiblingNode,
  549. fromHost: [
  550. { name: OSF.DDA.PropertyDescriptors.DataNodeProperties, value: self }
  551. ]
  552. });
  553. ns=Microsoft.Office.WebExtension.AsyncResultStatus;
  554. define({
  555. type: OSF.DDA.PropertyDescriptors.AsyncResultStatus,
  556. fromHost: [
  557. { name: ns.Succeeded, value: 0 },
  558. { name: ns.Failed, value: 1 }
  559. ]
  560. });
  561. ns=Microsoft.Office.WebExtension.CoercionType;
  562. define({
  563. type: Microsoft.Office.WebExtension.Parameters.CoercionType,
  564. toHost: [
  565. { name: ns.Text, value: 0 },
  566. { name: ns.Matrix, value: 1 },
  567. { name: ns.Table, value: 2 },
  568. { name: ns.Html, value: 3 },
  569. { name: ns.Ooxml, value: 4 },
  570. { name: ns.SlideRange, value:7 }
  571. ]
  572. });
  573. ns=Microsoft.Office.WebExtension.GoToType;
  574. define({
  575. type: Microsoft.Office.WebExtension.Parameters.GoToType,
  576. toHost: [
  577. { name: ns.Binding, value: 0 },
  578. { name: ns.NamedItem, value: 1 },
  579. { name: ns.Slide, value: 2 },
  580. { name: ns.Index, value: 3 }
  581. ]
  582. });
  583. ns=Microsoft.Office.WebExtension.FileType;
  584. if (ns) {
  585. define({
  586. type: Microsoft.Office.WebExtension.Parameters.FileType,
  587. toHost: [
  588. { name: ns.Text, value: 0 },
  589. { name: ns.Compressed, value: 5 },
  590. { name: ns.Pdf, value: 6 }
  591. ]
  592. });
  593. }
  594. ns=Microsoft.Office.WebExtension.BindingType;
  595. if (ns) {
  596. define({
  597. type: Microsoft.Office.WebExtension.Parameters.BindingType,
  598. toHost: [
  599. { name: ns.Text, value: 0 },
  600. { name: ns.Matrix, value: 1 },
  601. { name: ns.Table, value: 2 }
  602. ],
  603. invertible: true
  604. });
  605. }
  606. ns=Microsoft.Office.WebExtension.ValueFormat;
  607. define({
  608. type: Microsoft.Office.WebExtension.Parameters.ValueFormat,
  609. toHost: [
  610. { name: ns.Unformatted, value: 0 },
  611. { name: ns.Formatted, value: 1 }
  612. ]
  613. });
  614. ns=Microsoft.Office.WebExtension.FilterType;
  615. define({
  616. type: Microsoft.Office.WebExtension.Parameters.FilterType,
  617. toHost: [
  618. { name: ns.All, value: 0 },
  619. { name: ns.OnlyVisible, value: 1 }
  620. ]
  621. });
  622. ns=Microsoft.Office.Internal.OfficeTheme;
  623. if (ns) {
  624. define({
  625. type:Microsoft.Office.Internal.Parameters.OfficeTheme,
  626. fromHost: [
  627. {name: ns.PrimaryFontColor, value: 0},
  628. {name: ns.PrimaryBackgroundColor, value: 1},
  629. {name: ns.SecondaryFontColor, value:2},
  630. {name: ns.SecondaryBackgroundColor, value:3}
  631. ]
  632. })
  633. }
  634. ns=Microsoft.Office.WebExtension.ActiveView;
  635. if (ns) {
  636. define({
  637. type:Microsoft.Office.WebExtension.Parameters.ActiveView,
  638. fromHost: [
  639. {name: 0, value: ns.Read},
  640. {name: 1, value: ns.Edit}
  641. ]
  642. })
  643. }
  644. ns=Microsoft.Office.Internal.DocumentTheme;
  645. if (ns) {
  646. define({
  647. type:Microsoft.Office.Internal.Parameters.DocumentTheme,
  648. fromHost: [
  649. {name: ns.PrimaryBackgroundColor, value: 0},
  650. {name: ns.PrimaryFontColor, value: 1},
  651. {name: ns.SecondaryBackgroundColor, value: 2},
  652. {name: ns.SecondaryFontColor, value: 3},
  653. {name: ns.Accent1, value: 4},
  654. {name: ns.Accent2, value: 5},
  655. {name: ns.Accent3, value: 6},
  656. {name: ns.Accent4, value: 7},
  657. {name: ns.Accent5, value: 8},
  658. {name: ns.Accent6, value: 9},
  659. {name: ns.Hyperlink, value: 10},
  660. {name: ns.FollowedHyperlink, value: 11},
  661. {name: ns.HeaderLatinFont, value: 12},
  662. {name: ns.HeaderEastAsianFont, value: 13},
  663. {name: ns.HeaderScriptFont, value: 14},
  664. {name: ns.HeaderLocalizedFont, value: 15},
  665. {name: ns.BodyLatinFont, value: 16},
  666. {name: ns.BodyEastAsianFont, value: 17},
  667. {name: ns.BodyScriptFont, value: 18},
  668. {name: ns.BodyLocalizedFont, value: 19}
  669. ]
  670. })
  671. }
  672. ns=Microsoft.Office.WebExtension.SelectionMode;
  673. define({
  674. type: Microsoft.Office.WebExtension.Parameters.SelectionMode,
  675. toHost: [
  676. { name: ns.Default, value: 0 },
  677. { name: ns.Selected, value: 1 },
  678. { name: ns.None, value: 2 },
  679. ]
  680. });
  681. ns=Microsoft.Office.WebExtension.Parameters;
  682. var cns=OSF.DDA.MethodDispId;
  683. define({
  684. type: cns.dispidNavigateToMethod,
  685. toHost: [
  686. { name: ns.Id, value: 0 },
  687. { name: ns.GoToType, value: 1 },
  688. { name: ns.SelectionMode, value: 2 }
  689. ]
  690. });
  691. define({
  692. type: cns.dispidGetSelectedDataMethod,
  693. fromHost: [
  694. { name: ns.Data, value: self }
  695. ],
  696. toHost: [
  697. { name: ns.CoercionType, value: 0 },
  698. { name: ns.ValueFormat, value: 1 },
  699. { name: ns.FilterType, value: 2 }
  700. ]
  701. });
  702. define({
  703. type: cns.dispidSetSelectedDataMethod,
  704. toHost: [
  705. { name: ns.CoercionType, value: 0 },
  706. { name: ns.Data, value: 1 }
  707. ]
  708. });
  709. define({
  710. type: cns.dispidGetFilePropertiesMethod,
  711. fromHost: [
  712. { name: OSF.DDA.PropertyDescriptors.FilePropertiesDescriptor, value: self }
  713. ]
  714. });
  715. define({
  716. type: cns.dispidGetDocumentCopyMethod,
  717. toHost: [{ name: ns.FileType, value: 0}],
  718. fromHost: [
  719. { name: OSF.DDA.PropertyDescriptors.FileProperties, value: self }
  720. ]
  721. });
  722. define({
  723. type: cns.dispidGetDocumentCopyChunkMethod,
  724. toHost: [
  725. { name: OSF.DDA.FileProperties.Handle, value: 0 },
  726. { name: OSF.DDA.FileSliceOffset, value: 1 },
  727. { name: OSF.DDA.FileProperties.SliceSize, value: 2 }
  728. ],
  729. fromHost: [
  730. { name: OSF.DDA.PropertyDescriptors.FileSliceProperties, value: self }
  731. ]
  732. });
  733. define({
  734. type: cns.dispidReleaseDocumentCopyMethod,
  735. toHost: [{ name: OSF.DDA.FileProperties.Handle, value: 0}]
  736. });
  737. define({
  738. type: cns.dispidAddBindingFromSelectionMethod,
  739. fromHost: [
  740. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self }
  741. ],
  742. toHost: [
  743. { name: ns.Id, value: 0 },
  744. { name: ns.BindingType, value: 1 }
  745. ]
  746. });
  747. define({
  748. type: cns.dispidAddBindingFromPromptMethod,
  749. fromHost: [
  750. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self }
  751. ],
  752. toHost: [
  753. { name: ns.Id, value: 0 },
  754. { name: ns.BindingType, value: 1 },
  755. { name: ns.PromptText, value: 2 }
  756. ]
  757. });
  758. define({
  759. type: cns.dispidAddBindingFromNamedItemMethod,
  760. fromHost: [
  761. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self }
  762. ],
  763. toHost: [
  764. { name: ns.ItemName, value: 0 },
  765. { name: ns.Id, value: 1 },
  766. { name: ns.BindingType, value: 2 },
  767. { name: ns.FailOnCollision, value: 3 }
  768. ]
  769. });
  770. define({
  771. type: cns.dispidReleaseBindingMethod,
  772. toHost: [
  773. { name: ns.Id, value: 0 }
  774. ]
  775. });
  776. define({
  777. type: cns.dispidGetBindingMethod,
  778. fromHost: [
  779. { name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self }
  780. ],
  781. toHost: [
  782. { name: ns.Id, value: 0 }
  783. ]
  784. });
  785. define({
  786. type: cns.dispidGetAllBindingsMethod,
  787. fromHost: [
  788. { name: OSF.DDA.ListDescriptors.BindingList, value: self }
  789. ]
  790. });
  791. define({
  792. type: cns.dispidGetBindingDataMethod,
  793. fromHost: [
  794. { name: ns.Data, value: self }
  795. ],
  796. toHost: [
  797. { name: ns.Id, value: 0 },
  798. { name: ns.CoercionType, value: 1 },
  799. { name: ns.ValueFormat, value: 2 },
  800. { name: ns.FilterType, value: 3 },
  801. { name: OSF.DDA.PropertyDescriptors.Subset, value: 4 }
  802. ]
  803. });
  804. define({
  805. type: cns.dispidSetBindingDataMethod,
  806. toHost: [
  807. { name: ns.Id, value: 0 },
  808. { name: ns.CoercionType, value: 1 },
  809. { name: ns.Data, value: 2 },
  810. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 }
  811. ]
  812. });
  813. define({
  814. type: cns.dispidAddRowsMethod,
  815. toHost: [
  816. { name: ns.Id, value: 0 },
  817. { name: ns.Data, value: 1 }
  818. ]
  819. });
  820. define({
  821. type: cns.dispidAddColumnsMethod,
  822. toHost: [
  823. { name: ns.Id, value: 0 },
  824. { name: ns.Data, value: 1 }
  825. ]
  826. });
  827. define({
  828. type: cns.dispidClearAllRowsMethod,
  829. toHost: [
  830. { name: ns.Id, value: 0 }
  831. ]
  832. });
  833. define({
  834. type: cns.dispidClearFormatsMethod,
  835. toHost: [
  836. { name: ns.Id, value: 0 }
  837. ]
  838. });
  839. define({
  840. type: cns.dispidSetTableOptionsMethod,
  841. toHost: [
  842. { name: ns.Id, value: 0 },
  843. { name: ns.TableOptions, value: 1 },
  844. ]
  845. });
  846. define({
  847. type: cns.dispidSetFormatsMethod,
  848. toHost: [
  849. { name: ns.Id, value: 0 },
  850. { name: ns.CellFormat, value: 1 },
  851. ]
  852. });
  853. define({
  854. type: cns.dispidLoadSettingsMethod,
  855. fromHost: [
  856. { name: OSF.DDA.SettingsManager.SerializedSettings, value: self }
  857. ]
  858. });
  859. define({
  860. type: cns.dispidSaveSettingsMethod,
  861. toHost: [
  862. { name: OSF.DDA.SettingsManager.SerializedSettings, value: OSF.DDA.SettingsManager.SerializedSettings },
  863. { name: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale, value: Microsoft.Office.WebExtension.Parameters.OverwriteIfStale }
  864. ]
  865. });
  866. define({
  867. type: OSF.DDA.MethodDispId.dispidGetOfficeThemeMethod,
  868. fromHost: [
  869. { name: Microsoft.Office.Internal.Parameters.OfficeTheme, value: self }
  870. ]
  871. });
  872. define({
  873. type: OSF.DDA.MethodDispId.dispidGetDocumentThemeMethod,
  874. fromHost: [
  875. { name: Microsoft.Office.Internal.Parameters.DocumentTheme, value: self }
  876. ]
  877. });
  878. define({
  879. type: OSF.DDA.MethodDispId.dispidGetActiveViewMethod,
  880. fromHost: [
  881. { name: Microsoft.Office.WebExtension.Parameters.ActiveView, value: self }
  882. ]
  883. });
  884. define({
  885. type: cns.dispidAddDataPartMethod,
  886. fromHost: [
  887. { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self }
  888. ],
  889. toHost: [
  890. { name: ns.Xml, value: 0 }
  891. ]
  892. });
  893. define({
  894. type: cns.dispidGetDataPartByIdMethod,
  895. fromHost: [
  896. { name: OSF.DDA.PropertyDescriptors.DataPartProperties, value: self }
  897. ],
  898. toHost: [
  899. { name: ns.Id, value: 0 }
  900. ]
  901. });
  902. define({
  903. type: cns.dispidGetDataPartsByNamespaceMethod,
  904. fromHost: [
  905. { name: OSF.DDA.ListDescriptors.DataPartList, value: self }
  906. ],
  907. toHost: [
  908. { name: ns.Namespace, value: 0 }
  909. ]
  910. });
  911. define({
  912. type: cns.dispidGetDataPartXmlMethod,
  913. fromHost: [
  914. { name: ns.Data, value: self}
  915. ],
  916. toHost: [
  917. { name: ns.Id, value: 0 }
  918. ]
  919. });
  920. define({
  921. type: cns.dispidGetDataPartNodesMethod,
  922. fromHost: [
  923. { name: OSF.DDA.ListDescriptors.DataNodeList, value: self }
  924. ],
  925. toHost: [
  926. { name: ns.Id, value: 0 },
  927. { name: ns.XPath, value: 1 }
  928. ]
  929. });
  930. define({
  931. type: cns.dispidDeleteDataPartMethod,
  932. toHost: [
  933. { name: ns.Id, value: 0 }
  934. ]
  935. });
  936. define({
  937. type: cns.dispidGetDataNodeValueMethod,
  938. fromHost: [
  939. { name: ns.Data, value: self}
  940. ],
  941. toHost: [
  942. { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }
  943. ]
  944. });
  945. define({
  946. type: cns.dispidGetDataNodeXmlMethod,
  947. fromHost: [
  948. { name: ns.Data, value: self}
  949. ],
  950. toHost: [
  951. { name: OSF.DDA.DataNodeProperties.Handle, value: 0 }
  952. ]
  953. });
  954. define({
  955. type: cns.dispidGetDataNodesMethod,
  956. fromHost: [
  957. { name: OSF.DDA.ListDescriptors.DataNodeList, value: self }
  958. ],
  959. toHost: [
  960. { name: OSF.DDA.DataNodeProperties.Handle, value: 0 },
  961. { name: ns.XPath, value: 1 }
  962. ]
  963. });
  964. define({
  965. type: cns.dispidSetDataNodeValueMethod,
  966. toHost: [
  967. { name: OSF.DDA.DataNodeProperties.Handle, value: 0 },
  968. { name: ns.Data, value: 1 }
  969. ]
  970. });
  971. define({
  972. type: cns.dispidSetDataNodeXmlMethod,
  973. toHost: [
  974. { name: OSF.DDA.DataNodeProperties.Handle, value: 0 },
  975. { name: ns.Xml, value: 1 }
  976. ]
  977. });
  978. define({
  979. type: cns.dispidAddDataNamespaceMethod,
  980. toHost: [
  981. { name: OSF.DDA.DataPartProperties.Id, value: 0 },
  982. { name: ns.Prefix, value: 1 },
  983. { name: ns.Namespace, value: 2 }
  984. ]
  985. });
  986. define({
  987. type: cns.dispidGetDataUriByPrefixMethod,
  988. fromHost: [
  989. { name: ns.Data, value: self}
  990. ],
  991. toHost: [
  992. { name: OSF.DDA.DataPartProperties.Id, value: 0 },
  993. { name: ns.Prefix, value: 1 }
  994. ]
  995. });
  996. define({
  997. type: cns.dispidGetDataPrefixByUriMethod,
  998. fromHost: [
  999. { name: ns.Data, value: self}
  1000. ],
  1001. toHost: [
  1002. { name: OSF.DDA.DataPartProperties.Id, value: 0 },
  1003. { name: ns.Namespace, value: 1 }
  1004. ]
  1005. });
  1006. define({
  1007. type: cns.dispidGetSelectedTaskMethod,
  1008. fromHost: [
  1009. { name: ns.TaskId, value: self }
  1010. ]
  1011. });
  1012. define({
  1013. type: cns.dispidGetTaskMethod,
  1014. fromHost: [
  1015. { name: "taskName", value: 0 },
  1016. { name: "wssTaskId", value: 1 },
  1017. { name: "resourceNames", value: 2 }
  1018. ],
  1019. toHost: [
  1020. { name: ns.TaskId, value: 0 }
  1021. ]
  1022. });
  1023. define({
  1024. type: cns.dispidGetTaskFieldMethod,
  1025. fromHost: [
  1026. { name: ns.FieldValue, value: self }
  1027. ],
  1028. toHost: [
  1029. { name: ns.TaskId, value: 0 },
  1030. { name: ns.FieldId, value: 1 },
  1031. { name: ns.GetRawValue, value: 2 }
  1032. ]
  1033. });
  1034. define({
  1035. type: cns.dispidGetWSSUrlMethod,
  1036. fromHost: [
  1037. { name: ns.ServerUrl, value: 0 },
  1038. { name: ns.ListName, value: 1 }
  1039. ]
  1040. });
  1041. define({
  1042. type: cns.dispidGetSelectedResourceMethod,
  1043. fromHost: [
  1044. { name: ns.ResourceId, value: self }
  1045. ]
  1046. });
  1047. define({
  1048. type: cns.dispidGetResourceFieldMethod,
  1049. fromHost: [
  1050. { name: ns.FieldValue, value: self }
  1051. ],
  1052. toHost: [
  1053. { name: ns.ResourceId, value: 0 },
  1054. { name: ns.FieldId, value: 1 },
  1055. { name: ns.GetRawValue, value: 2 }
  1056. ]
  1057. });
  1058. define({
  1059. type: cns.dispidGetProjectFieldMethod,
  1060. fromHost: [
  1061. { name: ns.FieldValue, value: self }
  1062. ],
  1063. toHost: [
  1064. { name: ns.FieldId, value: 0 },
  1065. { name: ns.GetRawValue, value: 1 }
  1066. ]
  1067. });
  1068. define({
  1069. type: cns.dispidGetSelectedViewMethod,
  1070. fromHost: [
  1071. { name: ns.ViewType, value: 0 },
  1072. { name: ns.ViewName, value: 1 }
  1073. ]
  1074. });
  1075. cns=OSF.DDA.EventDispId
  1076. define({ type: cns.dispidDocumentSelectionChangedEvent });
  1077. define({
  1078. type: cns.dispidBindingSelectionChangedEvent,
  1079. fromHost: [
  1080. {name: OSF.DDA.EventDescriptors.BindingSelectionChangedEvent, value: self}
  1081. ]
  1082. });
  1083. define({
  1084. type: cns.dispidBindingDataChangedEvent,
  1085. fromHost: [{ name: OSF.DDA.PropertyDescriptors.BindingProperties, value: self}]
  1086. });
  1087. define({ type: cns.dispidSettingsChangedEvent });
  1088. define({
  1089. type: cns.dispidDocumentThemeChangedEvent,
  1090. fromHost: [
  1091. {name: OSF.DDA.EventDescriptors.DocumentThemeChangedEvent, value: self}
  1092. ]
  1093. });
  1094. define({
  1095. type: cns.dispidOfficeThemeChangedEvent,
  1096. fromHost: [
  1097. {name: OSF.DDA.EventDescriptors.OfficeThemeChangedEvent, value: self}
  1098. ]
  1099. });
  1100. define({
  1101. type: cns.dispidActiveViewChangedEvent,
  1102. fromHost: [{ name: OSF.DDA.EventDescriptors.ActiveViewChangedEvent, value: self}]
  1103. });
  1104. define({
  1105. type: cns.dispidDataNodeAddedEvent,
  1106. fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeInsertedEvent, value: self}]
  1107. });
  1108. define({
  1109. type: cns.dispidDataNodeReplacedEvent,
  1110. fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeReplacedEvent, value: self}]
  1111. });
  1112. define({
  1113. type: cns.dispidDataNodeDeletedEvent,
  1114. fromHost: [{ name: OSF.DDA.EventDescriptors.DataNodeDeletedEvent, value: self}]
  1115. });
  1116. define({ type: cns.dispidTaskSelectionChangedEvent });
  1117. define({ type: cns.dispidResourceSelectionChangedEvent });
  1118. define({ type: cns.dispidViewSelectionChangedEvent });
  1119. parameterMap.define=define;
  1120. return parameterMap;
  1121. })();
  1122. OSF.DDA.SafeArray.Delegate._onException=function OSF_DDA_SafeArray_Delegate$OnException(ex, args) {
  1123. var status;
  1124. var number=ex.number;
  1125. if (number) {
  1126. switch (number) {
  1127. case -2146828218:
  1128. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeNoCapability;
  1129. break;
  1130. case -2146827850:
  1131. default:
  1132. status=OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError;
  1133. break;
  1134. }
  1135. }
  1136. if (args.onComplete) {
  1137. args.onComplete(status || OSF.DDA.ErrorCodeManager.errorCodes.ooeInternalError);
  1138. }
  1139. }
  1140. OSF.DDA.SafeArray.Delegate.executeAsync=function OSF_DDA_SafeArray_Delegate$ExecuteAsync(args) {
  1141. try {
  1142. if (args.onCalling) {
  1143. args.onCalling();
  1144. }
  1145. function toArray(args) {
  1146. var arrArgs=args;
  1147. if (OSF.OUtil.isArray(args)) {
  1148. var len=arrArgs.length;
  1149. for (var i=0; i < len; i++) {
  1150. arrArgs[i]=toArray(arrArgs[i]);
  1151. }
  1152. } else if (OSF.OUtil.isDate(args)) {
  1153. arrArgs=args.getVarDate();
  1154. } else if (typeof args==="object" && !OSF.OUtil.isArray(args)) {
  1155. arrArgs=[];
  1156. for (var index in args) {
  1157. if (!OSF.OUtil.isFunction(args[index])) {
  1158. arrArgs[index]=toArray(args[index]);
  1159. }
  1160. }
  1161. }
  1162. return arrArgs;
  1163. }
  1164. var startTime=(new Date()).getTime();
  1165. window.external.Execute(
  1166. args.dispId,
  1167. toArray(args.hostCallArgs),
  1168. function OSF_DDA_SafeArrayFacade$Execute_OnResponse(hostResponseArgs) {
  1169. if (args.onReceiving) {
  1170. args.onReceiving();
  1171. }
  1172. var result=hostResponseArgs.toArray();
  1173. var status=result[OSF.DDA.SafeArray.Response.Status];
  1174. if (args.onComplete) {
  1175. var payload;
  1176. if (status==OSF.DDA.ErrorCodeManager.errorCodes.ooeSuccess) {
  1177. if (result.length > 2) {
  1178. payload=[];
  1179. for (var i=1; i < result.length; i++)
  1180. payload[i - 1]=result[i];
  1181. }
  1182. else {
  1183. payload=result[OSF.DDA.SafeArray.Response.Payload];
  1184. }
  1185. }
  1186. else {
  1187. payload=result[OSF.DDA.SafeArray.Response.Payload];
  1188. }
  1189. args.onComplete(status, payload);
  1190. }
  1191. if (OSF.AppTelemetry) {
  1192. OSF.AppTelemetry.onMethodDone(args.dispId, args.hostCallArgs, Math.abs((new Date()).getTime() - startTime), status);
  1193. }
  1194. }
  1195. );
  1196. }
  1197. catch (ex) {
  1198. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  1199. }
  1200. };
  1201. OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent=function OSF_DDA_SafeArrayDelegate$GetOnAfterRegisterEvent(register, args) {
  1202. var startTime=(new Date()).getTime();
  1203. return function OSF_DDA_SafeArrayDelegate$OnAfterRegisterEvent(hostResponseArgs) {
  1204. if (args.onReceiving) {
  1205. args.onReceiving();
  1206. }
  1207. var status=hostResponseArgs.toArray ? hostResponseArgs.toArray()[OSF.DDA.SafeArray.Response.Status] : hostResponseArgs;
  1208. if (args.onComplete) {
  1209. args.onComplete(status)
  1210. }
  1211. if (OSF.AppTelemetry) {
  1212. OSF.AppTelemetry.onRegisterDone(register, args.dispId, Math.abs((new Date()).getTime() - startTime), status);
  1213. }
  1214. }
  1215. }
  1216. OSF.DDA.SafeArray.Delegate.registerEventAsync=function OSF_DDA_SafeArray_Delegate$RegisterEventAsync(args) {
  1217. if (args.onCalling) {
  1218. args.onCalling();
  1219. }
  1220. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(true, args);
  1221. try {
  1222. window.external.RegisterEvent(
  1223. args.dispId,
  1224. args.targetId,
  1225. function OSF_DDA_SafeArrayDelegate$RegisterEventAsync_OnEvent(eventDispId, payload) {
  1226. if (args.onEvent) {
  1227. args.onEvent(payload);
  1228. }
  1229. if (OSF.AppTelemetry) {
  1230. OSF.AppTelemetry.onEventDone(args.dispId);
  1231. }
  1232. },
  1233. callback
  1234. );
  1235. }
  1236. catch (ex) {
  1237. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  1238. }
  1239. };
  1240. OSF.DDA.SafeArray.Delegate.unregisterEventAsync=function OSF_DDA_SafeArray_Delegate$UnregisterEventAsync(args) {
  1241. if (args.onCalling) {
  1242. args.onCalling();
  1243. }
  1244. var callback=OSF.DDA.SafeArray.Delegate._getOnAfterRegisterEvent(false, args);
  1245. try {
  1246. window.external.UnregisterEvent(
  1247. args.dispId,
  1248. args.targetId,
  1249. callback
  1250. );
  1251. }
  1252. catch (ex) {
  1253. OSF.DDA.SafeArray.Delegate._onException(ex, args);
  1254. }
  1255. };
  1256. delete Microsoft.Office.WebExtension.FileType;
  1257. OSF.DDA.ExcelDocument=function OSF_DDA_ExcelDocument(officeAppContext, settings) {
  1258. var bf=new OSF.DDA.BindingFacade(this);
  1259. OSF.DDA.DispIdHost.addAsyncMethods(bf, [OSF.DDA.AsyncMethodNames.AddFromPromptAsync]);
  1260. OSF.DDA.DispIdHost.addAsyncMethods(this, [OSF.DDA.AsyncMethodNames.GetFilePropertiesAsync]);
  1261. OSF.DDA.ExcelDocument.uber.constructor.call(this,
  1262. officeAppContext,
  1263. bf,
  1264. settings
  1265. );
  1266. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  1267. OSF.DDA.AsyncMethodNames.GoToByIdAsync
  1268. ]);
  1269. OSF.OUtil.finalizeProperties(this);
  1270. };
  1271. OSF.OUtil.extend(OSF.DDA.ExcelDocument, OSF.DDA.JsomDocument);
  1272. OSF.DDA.ExcelTableBinding=function OSF_DDA_ExcelTableBinding(id, docInstance, rows, cols, hasHeaders) {
  1273. var am=OSF.DDA.AsyncMethodNames;
  1274. OSF.DDA.DispIdHost.addAsyncMethods(this, [
  1275. am.ClearFormatsAsync,
  1276. am.SetTableOptionsAsync,
  1277. am.SetFormatsAsync
  1278. ]);
  1279. OSF.DDA.ExcelTableBinding.uber.constructor.call(this, id, docInstance, rows, cols, hasHeaders);
  1280. OSF.OUtil.finalizeProperties(this);
  1281. };
  1282. OSF.OUtil.extend(OSF.DDA.ExcelTableBinding, OSF.DDA.TableBinding);
  1283. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  1284. type: OSF.DDA.MethodDispId.dispidSetSelectedDataMethod,
  1285. toHost: [
  1286. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 0 },
  1287. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 1 },
  1288. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 2 },
  1289. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 3 }
  1290. ]
  1291. });
  1292. OSF.DDA.SafeArray.Delegate.ParameterMap.define({
  1293. type: OSF.DDA.MethodDispId.dispidSetBindingDataMethod,
  1294. toHost: [
  1295. { name: Microsoft.Office.WebExtension.Parameters.Id, value: 0 },
  1296. { name: Microsoft.Office.WebExtension.Parameters.CoercionType, value: 1 },
  1297. { name: Microsoft.Office.WebExtension.Parameters.Data, value: 2 },
  1298. { name: OSF.DDA.SafeArray.UniqueArguments.Offset, value: 3 },
  1299. { name: Microsoft.Office.WebExtension.Parameters.CellFormat, value: 4 },
  1300. { name: Microsoft.Office.WebExtension.Parameters.TableOptions, value: 5 }
  1301. ]
  1302. });
  1303. Microsoft.Office.WebExtension.Table={
  1304. All : 0,
  1305. Data : 1,
  1306. Headers : 2
  1307. };
  1308. (function (){
  1309. var tableOptionProperties={
  1310. headerRow : 0,
  1311. bandedRows : 1,
  1312. firstColumn : 2,
  1313. lastColumn : 3,
  1314. bandedColumns : 4,
  1315. filterButton : 5,
  1316. style : 6,
  1317. totalRow : 7
  1318. };
  1319. var cellProperties={
  1320. row : 0,
  1321. column : 1
  1322. };
  1323. var formatProperties={
  1324. alignHorizontal : {text:"alignHorizontal", type:1},
  1325. alignVertical : {text:"alignVertical", type:2},
  1326. backgroundColor : {text:"backgroundColor", type:101},
  1327. borderStyle : {text:"borderStyle", type:201},
  1328. borderColor : {text:"borderColor", type:202},
  1329. borderTopStyle : {text:"borderTopStyle", type:203},
  1330. borderTopColor : {text:"borderTopColor", type:204},
  1331. borderBottomStyle : {text:"borderBottomStyle", type:205},
  1332. borderBottomColor : {text:"borderBottomColor", type:206},
  1333. borderLeftStyle : {text:"borderLeftStyle", type:207},
  1334. borderLeftColor : {text:"borderLeftColor", type:208},
  1335. borderRightStyle : {text:"borderRightStyle", type:209},
  1336. borderRightColor : {text:"borderRightColor", type:210},
  1337. borderOutlineStyle : {text:"borderOutlineStyle", type:211},
  1338. borderOutlineColor : {text:"borderOutlineColor", type:212},
  1339. borderInlineStyle : {text:"borderInlineStyle", type:213},
  1340. borderInlineColor : {text:"borderInlineColor", type:214},
  1341. fontFamily : {text:"fontFamily", type:301},
  1342. fontStyle : {text:"fontStyle", type:302},
  1343. fontSize : {text:"fontSize", type:303},
  1344. fontUnderlineStyle : {text:"fontUnderlineStyle", type:304},
  1345. fontColor : {text:"fontColor", type:305},
  1346. fontDirection : {text:"fontDirection", type:306},
  1347. fontStrikethrough : {text:"fontStrikethrough", type:307},
  1348. fontSuperscript : {text:"fontSuperscript", type:308},
  1349. fontSubscript : {text:"fontSubscript", type:309},
  1350. fontNormal : {text:"fontNormal", type:310},
  1351. indentLeft : {text:"indentLeft", type:401},
  1352. indentRight : {text:"indentRight", type:402},
  1353. numberFormat: {text:"numberFormat", type:501},
  1354. width : {text:"width", type:701},
  1355. height : {text:"height", type:702},
  1356. wrapping : {text:"wrapping", type:703}
  1357. };
  1358. var borderStyleSet=[
  1359. {name:"none", value: 0},
  1360. {name:"thin", value: 1},
  1361. {name:"medium", value: 2},
  1362. {name:"dashed", value: 3},
  1363. {name:"dotted", value: 4},
  1364. {name:"thick", value: 5},
  1365. {name:"double", value: 6},
  1366. {name:"hair", value: 7},
  1367. {name:"medium dashed", value: 8},
  1368. {name:"dash dot", value: 9},
  1369. {name:"medium dash dot", value: 10},
  1370. {name:"dash dot dot", value: 11},
  1371. {name:"medium dash dot dot", value: 12},
  1372. {name:"slant dash dot", value: 13},
  1373. ];
  1374. var colorSet=[
  1375. {name: "none", value: 0},
  1376. {name: "black", value: 1},
  1377. {name: "blue", value: 2},
  1378. {name: "gray", value: 3},
  1379. {name: "green", value: 4},
  1380. {name: "orange", value: 5},
  1381. {name: "pink", value: 6},
  1382. {name: "purple", value: 7},
  1383. {name: "red", value: 8},
  1384. {name: "teal", value: 9},
  1385. {name: "turquoise", value: 10},
  1386. {name: "violet", value: 11},
  1387. {name: "white", value: 12},
  1388. {name: "yellow", value: 13},
  1389. {name: "automatic", value: 14},
  1390. ];
  1391. var ns=OSF.DDA.SafeArray.Delegate.ParameterMap;
  1392. ns.define({
  1393. type: formatProperties.alignHorizontal.text,
  1394. toHost: [
  1395. {name: "general", value: 0},
  1396. {name: "left", value: 1},
  1397. {name: "center", value: 2},
  1398. {name: "right", value: 3},
  1399. {name: "fill", value: 4},
  1400. {name: "justify", value: 5},
  1401. {name: "center across selection", value: 6},
  1402. {name: "distributed", value: 7},
  1403. ]});
  1404. ns.define({
  1405. type: formatProperties.alignVertical.text,
  1406. toHost: [
  1407. {name: "top", value: 0},
  1408. {name: "center", value: 1},
  1409. {name: "bottom", value: 2},
  1410. {name: "justify", value: 3},
  1411. {name: "distributed", value: 4},
  1412. ]});
  1413. ns.define({
  1414. type: formatProperties.backgroundColor.text,
  1415. toHost: colorSet
  1416. });
  1417. ns.define({
  1418. type: formatProperties.borderStyle.text,
  1419. toHost: borderStyleSet
  1420. });
  1421. ns.define({
  1422. type: formatProperties.borderColor.text,
  1423. toHost: colorSet
  1424. });
  1425. ns.define({
  1426. type: formatProperties.borderTopStyle.text,
  1427. toHost: borderStyleSet
  1428. });
  1429. ns.define({
  1430. type: formatProperties.borderTopColor.text,
  1431. toHost: colorSet
  1432. });
  1433. ns.define({
  1434. type: formatProperties.borderBottomStyle.text,
  1435. toHost: borderStyleSet
  1436. });
  1437. ns.define({
  1438. type: formatProperties.borderBottomColor.text,
  1439. toHost: colorSet
  1440. });
  1441. ns.define({
  1442. type: formatProperties.borderLeftStyle.text,
  1443. toHost: borderStyleSet
  1444. });
  1445. ns.define({
  1446. type: formatProperties.borderLeftColor.text,
  1447. toHost: colorSet
  1448. });
  1449. ns.define({
  1450. type: formatProperties.borderRightStyle.text,
  1451. toHost: borderStyleSet
  1452. });
  1453. ns.define({
  1454. type: formatProperties.borderRightColor.text,
  1455. toHost: colorSet
  1456. });
  1457. ns.define({
  1458. type: formatProperties.borderOutlineStyle.text,
  1459. toHost: borderStyleSet
  1460. });
  1461. ns.define({
  1462. type: formatProperties.borderOutlineColor.text,
  1463. toHost: colorSet
  1464. });
  1465. ns.define({
  1466. type: formatProperties.borderInlineStyle.text,
  1467. toHost: borderStyleSet
  1468. });
  1469. ns.define({
  1470. type: formatProperties.borderInlineColor.text,
  1471. toHost: colorSet
  1472. });
  1473. ns.define({
  1474. type: formatProperties.fontStyle.text,
  1475. toHost: [
  1476. {name: "regular", value: 0},
  1477. {name: "italic", value: 1},
  1478. {name: "bold", value: 2},
  1479. {name: "bold italic", value: 3},
  1480. ]});
  1481. ns.define({
  1482. type: formatProperties.fontUnderlineStyle.text,
  1483. toHost: [
  1484. {name: "none", value: 0},
  1485. {name: "single", value: 1},
  1486. {name: "double", value: 2},
  1487. {name: "single accounting", value: 3},
  1488. {name: "double accounting", value: 4},
  1489. ]});
  1490. ns.define({
  1491. type: formatProperties.fontColor.text,
  1492. toHost: colorSet
  1493. });
  1494. ns.define({
  1495. type: formatProperties.fontDirection.text,
  1496. toHost: [
  1497. {name: "context", value: 0},
  1498. {name: "left-to-right", value: 1},
  1499. {name: "right-to-left", value: 2},
  1500. ]});
  1501. ns.define({
  1502. type: formatProperties.width.text,
  1503. toHost: [
  1504. {name: "auto fit", value: -1},
  1505. ]});
  1506. ns.define({
  1507. type: formatProperties.height.text,
  1508. toHost: [
  1509. {name: "auto fit", value: -1},
  1510. ]});
  1511. ns.define({
  1512. type: Microsoft.Office.WebExtension.Parameters.TableOptions,
  1513. toHost: [
  1514. {name: "headerRow", value: 0 },
  1515. {name: "bandedRows", value: 1 },
  1516. {name: "firstColumn", value: 2 },
  1517. {name: "lastColumn", value: 3 },
  1518. {name: "bandedColumns", value: 4 },
  1519. {name: "filterButton", value: 5 },
  1520. {name: "style", value: 6 },
  1521. {name: "totalRow", value: 7 }
  1522. ]});
  1523. ns.dynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat]={
  1524. toHost: function (data) {
  1525. for (entry in data) {
  1526. if (data[entry].format) {
  1527. data[entry].format=ns.mapValues(data[entry].format, "toHost");
  1528. }
  1529. }
  1530. return data;
  1531. },
  1532. fromHost: function (args) {
  1533. return args;
  1534. }
  1535. }
  1536. ns.specialProcessorDynamicTypes[Microsoft.Office.WebExtension.Parameters.CellFormat]=(function () {
  1537. return {
  1538. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$toHost(cellFormats) {
  1539. var textCells="cells";
  1540. var textFormat="format";
  1541. var posCells=0;
  1542. var posFormat=1;
  1543. var ret=[];
  1544. for (index in cellFormats) {
  1545. var cfOld=cellFormats[index];
  1546. var cfNew=[];
  1547. if (cfOld[textCells] !=='undefined') {
  1548. var cellsOld=cfOld[textCells];
  1549. var cellsNew;
  1550. if (typeof cfOld[textCells]==="object") {
  1551. cellsNew=[];
  1552. for (entry in cellsOld) {
  1553. if (typeof(cellProperties[entry])!=='undefined') {
  1554. cellsNew[cellProperties[entry]]=cellsOld[entry];
  1555. }
  1556. }
  1557. } else {
  1558. cellsNew=cellsOld;
  1559. }
  1560. cfNew[posCells]=cellsNew;
  1561. }
  1562. if (cfOld[textFormat]) {
  1563. var formatOld=cfOld[textFormat];
  1564. var formatNew=[];
  1565. for (entry in formatOld) {
  1566. if (typeof(formatProperties[entry])!=='undefined') {
  1567. formatNew.push([formatProperties[entry].type, formatOld[entry]]);
  1568. }
  1569. }
  1570. cfNew[posFormat]=formatNew;
  1571. }
  1572. ret[index]=cfNew;
  1573. }
  1574. return ret;
  1575. },
  1576. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_CellFormat$fromHost(hostArgs) {
  1577. return hostArgs;
  1578. }
  1579. }
  1580. })();
  1581. ns.specialProcessorDynamicTypes[Microsoft.Office.WebExtension.Parameters.TableOptions]=(function () {
  1582. return {
  1583. toHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$toHost(tableOptions) {
  1584. var ret=[];
  1585. for (entry in tableOptions) {
  1586. if (tableOptionProperties[entry]!=undefined){
  1587. ret[tableOptionProperties[entry]]=tableOptions[entry];
  1588. }
  1589. }
  1590. return ret;
  1591. },
  1592. fromHost: function OSF_DDA_SafeArray_Delegate_SpecialProcessor_TableOptions$fromHost(hostArgs) {
  1593. return hostArgs;
  1594. }
  1595. }
  1596. })();
  1597. })();