n_xls_format.sru 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886
  1. $PBExportHeader$n_xls_format.sru
  2. forward
  3. global type n_xls_format from nonvisualobject
  4. end type
  5. end forward
  6. global type n_xls_format from nonvisualobject
  7. end type
  8. global n_xls_format n_xls_format
  9. type variables
  10. PUBLIC UINT ii_font_index
  11. PUBLIC UINT ii_num_format
  12. PUBLIC STRING is_num_format=''
  13. PUBLIC STRING is_font = "宋体" //"Arial" //
  14. PUBLIC INTEGER ii_size = 9 //10
  15. PUBLIC UINT ii_bold = 400
  16. PUBLIC INTEGER ii_italic
  17. PUBLIC UINT ii_color = 32767
  18. PUBLIC INTEGER ii_underline
  19. PUBLIC INTEGER ii_font_strikeout
  20. PUBLIC INTEGER ii_font_outline
  21. PUBLIC INTEGER ii_font_shadow
  22. PUBLIC INTEGER ii_font_script
  23. PUBLIC INTEGER ii_font_family
  24. PUBLIC INTEGER ii_font_charset
  25. PUBLIC INTEGER ii_hidden
  26. PUBLIC INTEGER ii_locked = 1
  27. PUBLIC INTEGER ii_text_h_align
  28. PUBLIC INTEGER ii_text_wrap
  29. PUBLIC INTEGER ii_text_v_align = 1 //垂直居中
  30. PUBLIC INTEGER ii_text_justlast
  31. PUBLIC INTEGER ii_rotation
  32. PUBLIC INTEGER ii_fg_color = 64
  33. PUBLIC INTEGER ii_bg_color = 65
  34. PUBLIC INTEGER ii_pattern
  35. PUBLIC INTEGER ii_bottom
  36. PUBLIC INTEGER ii_top
  37. PUBLIC INTEGER ii_left
  38. PUBLIC INTEGER ii_right
  39. PUBLIC INTEGER ii_bottom_color = 64
  40. PUBLIC INTEGER ii_top_color = 64
  41. PUBLIC INTEGER ii_left_color = 64
  42. PUBLIC INTEGER ii_right_color = 64
  43. PUBLIC INTEGER ii_merge_range
  44. public n_xls_subroutines invo_sub
  45. end variables
  46. forward prototypes
  47. public function integer of_set_font (string as_fontname)
  48. public function integer of_set_size (integer ai_size)
  49. public function integer of_set_color (long al_colorindex)
  50. public function integer of_set_color (string as_color)
  51. public function integer of_set_bold (boolean ab_bold)
  52. public function integer of_set_italic (boolean ab_italic)
  53. public function integer of_set_num_format (integer ai_builtin_format)
  54. public function integer of_set_num_format (string as_num_format)
  55. public function integer of_set_align (string as_align)
  56. public function integer of_set_text_wrap (boolean ab_text_wrap)
  57. public function integer of_set_bg_color (string as_color)
  58. public function integer of_set_bg_color (long al_colorindex)
  59. public function integer of_set_border (integer ai_border_style)
  60. public function integer of_set_border_color (long al_color_index)
  61. public function integer of_set_border_color (string as_color)
  62. public function integer of_set_bottom (integer ai_border_style)
  63. public function integer of_set_right (integer ai_border_style)
  64. public function integer of_set_left (integer ai_border_style)
  65. public function integer of_set_top (integer ai_border_style)
  66. public function integer of_set_bottom_color (long al_color_index)
  67. public function integer of_set_bottom_color (string as_color)
  68. public function integer of_set_left_color (long al_color_index)
  69. public function integer of_set_left_color (string as_color)
  70. public function integer of_set_right_color (long al_color_index)
  71. public function integer of_set_right_color (string as_color)
  72. public function integer of_set_top_color (long al_color_index)
  73. public function integer of_set_top_color (string as_color)
  74. public function integer of_set_underline (integer ai_style)
  75. public function integer of_set_rotation (integer ai_rotation)
  76. public function integer of_set_script (integer ai_script)
  77. public function integer of_set_outline (boolean ab_option)
  78. public function integer of_set_hidden (boolean ab_option)
  79. public function integer of_set_locked (boolean ab_option)
  80. public function integer of_set_strikeout (boolean ab_option)
  81. public function integer of_set_text_justlast ()
  82. public function integer of_set_pattern (integer ai_pattern)
  83. public function integer of_set_fg_color (string as_color)
  84. public function integer of_set_fg_color (long al_colorindex)
  85. public function integer of_set_merge ()
  86. public function string of_get_format_key ()
  87. public function integer of_get_color (string as_color)
  88. public function blob of_get_font ()
  89. public function string of_get_font_key ()
  90. public function blob of_get_xf (string as_style)
  91. public function integer of_set_merge_range ()
  92. public function integer of_set_text_h_align (unsignedinteger ai_align)
  93. public function integer of_set_text_v_align (unsignedinteger ai_align)
  94. public function integer of_copy (n_xls_format anvo_format)
  95. end prototypes
  96. public function integer of_set_font (string as_fontname);integer li_ret = 1
  97. is_font = as_fontname
  98. return li_ret
  99. end function
  100. public function integer of_set_size (integer ai_size);integer li_ret = 1
  101. ii_size = ai_size
  102. return li_ret
  103. end function
  104. public function integer of_set_color (long al_colorindex);integer li_ret = 1
  105. if al_colorindex < 8 then
  106. al_colorindex += 8
  107. end if
  108. if al_colorindex > 63 then
  109. al_colorindex = 32767
  110. end if
  111. ii_color = al_colorindex
  112. return li_ret
  113. end function
  114. public function integer of_set_color (string as_color);integer li_ret = 1
  115. of_set_color(of_get_color(as_color))
  116. return li_ret
  117. end function
  118. public function integer of_set_bold (boolean ab_bold);integer li_ret = 1
  119. if ab_bold then
  120. ii_bold = 700
  121. else
  122. ii_bold = 400
  123. end if
  124. return li_ret
  125. end function
  126. public function integer of_set_italic (boolean ab_italic);integer li_ret =1
  127. if ab_italic then
  128. ii_italic = 1
  129. else
  130. ii_italic = 0
  131. end if
  132. return li_ret
  133. end function
  134. public function integer of_set_num_format (integer ai_builtin_format);
  135. ii_num_format = ai_builtin_format
  136. return 1
  137. end function
  138. public function integer of_set_num_format (string as_num_format);integer li_ret = 1
  139. is_num_format = as_num_format
  140. ii_num_format = 0
  141. return li_ret
  142. end function
  143. public function integer of_set_align (string as_align);integer li_ret = 1
  144. choose case trim(lower(as_align))
  145. case "left"
  146. of_set_text_h_align(1)
  147. case "centre", "center"
  148. of_set_text_h_align(2)
  149. case "right"
  150. of_set_text_h_align(3)
  151. case "fill"
  152. of_set_text_h_align(4)
  153. case "justify"
  154. of_set_text_h_align(5)
  155. case "merge"
  156. of_set_text_h_align(6)
  157. case "equal_space"
  158. of_set_text_h_align(7)
  159. case "top"
  160. of_set_text_v_align(0)
  161. case "vcentre", "vcenter"
  162. of_set_text_v_align(1)
  163. case "bottom"
  164. of_set_text_v_align(2)
  165. case "vjustify"
  166. of_set_text_v_align(3)
  167. case "vequal_space"
  168. of_set_text_v_align(4)
  169. case else
  170. return -1
  171. end choose
  172. return li_ret
  173. end function
  174. public function integer of_set_text_wrap (boolean ab_text_wrap);integer li_ret = 1
  175. if ab_text_wrap then
  176. ii_text_wrap = 1
  177. else
  178. ii_text_wrap = 0
  179. end if
  180. return li_ret
  181. end function
  182. public function integer of_set_bg_color (string as_color);integer li_ret = 1
  183. of_set_bg_color(of_get_color(as_color))
  184. return li_ret
  185. end function
  186. public function integer of_set_bg_color (long al_colorindex);integer li_ret = 1
  187. if al_colorindex < 8 then
  188. al_colorindex += 8
  189. end if
  190. if al_colorindex > 63 then
  191. al_colorindex = 32767
  192. end if
  193. ii_bg_color = al_colorindex
  194. return li_ret
  195. end function
  196. public function integer of_set_border (integer ai_border_style);of_set_left(ai_border_style)
  197. of_set_right(ai_border_style)
  198. of_set_top(ai_border_style)
  199. of_set_bottom(ai_border_style)
  200. return 1
  201. end function
  202. public function integer of_set_border_color (long al_color_index);of_set_left_color(al_color_index)
  203. of_set_right_color(al_color_index)
  204. of_set_top_color(al_color_index)
  205. of_set_bottom_color(al_color_index)
  206. return 1
  207. end function
  208. public function integer of_set_border_color (string as_color);of_set_left_color(as_color)
  209. of_set_right_color(as_color)
  210. of_set_top_color(as_color)
  211. of_set_bottom_color(as_color)
  212. return 1
  213. end function
  214. public function integer of_set_bottom (integer ai_border_style);ii_bottom = ai_border_style
  215. return 1
  216. end function
  217. public function integer of_set_right (integer ai_border_style);ii_right = ai_border_style
  218. return 1
  219. end function
  220. public function integer of_set_left (integer ai_border_style);ii_left = ai_border_style
  221. return 1
  222. end function
  223. public function integer of_set_top (integer ai_border_style);ii_top = ai_border_style
  224. return 1
  225. end function
  226. public function integer of_set_bottom_color (long al_color_index);integer li_ret = 1
  227. if al_color_index < 8 then
  228. al_color_index += 8
  229. end if
  230. if al_color_index > 63 then
  231. al_color_index = 32767
  232. end if
  233. ii_bottom_color = al_color_index
  234. return li_ret
  235. end function
  236. public function integer of_set_bottom_color (string as_color);integer li_ret = 1
  237. of_set_bottom_color(of_get_color(as_color))
  238. return li_ret
  239. end function
  240. public function integer of_set_left_color (long al_color_index);integer li_ret = 1
  241. if al_color_index < 8 then
  242. al_color_index += 8
  243. end if
  244. if al_color_index > 63 then
  245. al_color_index = 32767
  246. end if
  247. ii_left_color = al_color_index
  248. return li_ret
  249. end function
  250. public function integer of_set_left_color (string as_color);integer li_ret = 1
  251. of_set_left_color(of_get_color(as_color))
  252. return li_ret
  253. end function
  254. public function integer of_set_right_color (long al_color_index);integer li_ret = 1
  255. if al_color_index < 8 then
  256. al_color_index += 8
  257. end if
  258. if al_color_index > 63 then
  259. al_color_index = 32767
  260. end if
  261. ii_right_color = al_color_index
  262. return li_ret
  263. end function
  264. public function integer of_set_right_color (string as_color);integer li_ret = 1
  265. of_set_right_color(of_get_color(as_color))
  266. return li_ret
  267. end function
  268. public function integer of_set_top_color (long al_color_index);integer li_ret = 1
  269. if al_color_index < 8 then
  270. al_color_index += 8
  271. end if
  272. if al_color_index > 63 then
  273. al_color_index = 32767
  274. end if
  275. ii_top_color = al_color_index
  276. return li_ret
  277. end function
  278. public function integer of_set_top_color (string as_color);integer li_ret = 1
  279. of_set_top_color(of_get_color(as_color))
  280. return li_ret
  281. end function
  282. public function integer of_set_underline (integer ai_style);ii_underline=ai_style
  283. return 1
  284. end function
  285. public function integer of_set_rotation (integer ai_rotation);integer li_ret = 1
  286. if ai_rotation >= 0 and ai_rotation <= 180 or ai_rotation = 255 then
  287. ii_rotation = ai_rotation
  288. else
  289. li_ret = -1
  290. end if
  291. return li_ret
  292. end function
  293. public function integer of_set_script (integer ai_script);integer li_ret = 1
  294. if ai_script < 0 or ai_script > 2 then
  295. li_ret = -1
  296. else
  297. ii_font_script = ai_script
  298. end if
  299. return li_ret
  300. end function
  301. public function integer of_set_outline (boolean ab_option);if ab_option then
  302. ii_font_outline = 1
  303. else
  304. ii_font_outline = 0
  305. end if
  306. return 1
  307. end function
  308. public function integer of_set_hidden (boolean ab_option);if ab_option then
  309. ii_hidden = 1
  310. else
  311. ii_hidden = 0
  312. end if
  313. return 1
  314. end function
  315. public function integer of_set_locked (boolean ab_option);if ab_option then
  316. ii_locked = 1
  317. else
  318. ii_locked = 0
  319. end if
  320. return 1
  321. end function
  322. public function integer of_set_strikeout (boolean ab_option);if ab_option then
  323. ii_font_strikeout = 1
  324. else
  325. ii_font_strikeout = 0
  326. end if
  327. return 1
  328. end function
  329. public function integer of_set_text_justlast ();ii_text_justlast=1
  330. return 1
  331. end function
  332. public function integer of_set_pattern (integer ai_pattern);integer li_ret = 1
  333. if ai_pattern < 0 or ai_pattern > 18 then
  334. li_ret = -1
  335. else
  336. ii_pattern = ai_pattern
  337. end if
  338. return li_ret
  339. end function
  340. public function integer of_set_fg_color (string as_color);return of_set_fg_color(of_get_color(as_color))
  341. end function
  342. public function integer of_set_fg_color (long al_colorindex);integer li_ret = 1
  343. if al_colorindex < 8 then
  344. al_colorindex += 8
  345. end if
  346. if al_colorindex > 63 then
  347. al_colorindex = 32767
  348. end if
  349. ii_fg_color = al_colorindex
  350. return li_ret
  351. end function
  352. public function integer of_set_merge ();return of_set_text_h_align(6)
  353. end function
  354. public function string of_get_format_key ();string ls_ret
  355. uint li_pos
  356. IF Trim(is_num_format)="" OR is_num_format="?" or is_num_format="!" Then
  357. is_num_format='General'
  358. END IF
  359. ls_ret = string(ii_num_format, "00000") + string(len(is_num_format), "000") + is_num_format + string(ii_hidden, "0") + string(ii_locked, "0") + string(ii_text_h_align, "00") + string(ii_text_wrap, "0") + string(ii_text_v_align, "00") + string(ii_text_justlast, "00") + string(ii_rotation, "000") + string(ii_fg_color, "000") + string(ii_bg_color, "000") + string(ii_pattern, "000") + string(ii_bottom, "000") + string(ii_top, "000") + string(ii_left, "000") + string(ii_right, "000") + string(ii_bottom_color, "000") + string(ii_top_color, "000") + string(ii_left_color, "000") + string(ii_right_color, "000") + string(ii_merge_range, "0") + of_get_font_key()
  360. li_pos = pos(ls_ret, " ")
  361. //do While li_pos > 0
  362. Do While li_Pos>0
  363. ls_ret = replace(ls_ret, li_pos, 1, "_")
  364. li_pos = pos(ls_ret, " ")
  365. loop
  366. return ls_ret
  367. end function
  368. public function integer of_get_color (string as_color);CHOOSE CASE TRIM(LOWER(as_color))
  369. CASE "aqua"
  370. RETURN 15
  371. CASE "cyan"
  372. RETURN 15
  373. CASE "black"
  374. RETURN 8
  375. CASE "blue"
  376. RETURN 12
  377. CASE "brown"
  378. RETURN 16
  379. CASE "magenta"
  380. RETURN 14
  381. CASE "fuchsia"
  382. RETURN 14
  383. CASE "gray"
  384. RETURN 23
  385. CASE "grey"
  386. RETURN 23
  387. CASE "green"
  388. RETURN 17
  389. CASE "lime"
  390. RETURN 11
  391. CASE "navy"
  392. RETURN 18
  393. CASE "orange"
  394. RETURN 53
  395. CASE "purple"
  396. RETURN 20
  397. CASE "red"
  398. RETURN 10
  399. CASE "silver"
  400. RETURN 22
  401. CASE "white"
  402. RETURN 9
  403. CASE "yellow"
  404. RETURN 13
  405. END CHOOSE
  406. RETURN 32767
  407. end function
  408. public function blob of_get_font ();uint li_record
  409. uint li_length
  410. uint li_dyheight
  411. uint li_grbit
  412. uint li_icv
  413. uint li_bls
  414. uint li_sss
  415. uint li_uls
  416. uint li_bfamily
  417. uint li_bcharset
  418. uint li_reserved
  419. uint li_cch
  420. blob lb_data
  421. Blob lb_Font
  422. lb_Font=invo_sub.to_unicode(is_font)
  423. li_dyheight = ii_size * 20
  424. li_icv = ii_color
  425. li_bls = ii_bold
  426. li_sss = ii_font_script
  427. li_uls = ii_underline
  428. li_bfamily = ii_font_family
  429. li_bcharset = ii_font_charset
  430. li_cch = len(lb_font) / 2
  431. li_record = 49
  432. li_length = 16 + li_cch * 2
  433. li_reserved = 0
  434. li_grbit = 0
  435. li_grbit = li_grbit + ii_italic * 2
  436. li_grbit = li_grbit + ii_font_strikeout * 8
  437. li_grbit = li_grbit + ii_font_outline * 16
  438. li_grbit = li_grbit + ii_font_shadow * 32
  439. lb_data = invo_sub.of_pack("v", li_record) + invo_sub.of_pack("v", li_length) + invo_sub.of_pack("v", li_dyheight) + invo_sub.of_pack("v", li_grbit) + invo_sub.of_pack("v", li_icv) + invo_sub.of_pack("v", li_bls) + invo_sub.of_pack("v", li_sss) + invo_sub.of_pack("C", li_uls) + invo_sub.of_pack("C", li_bfamily) + invo_sub.of_pack("C", li_bcharset) + invo_sub.of_pack("C", li_reserved) + invo_sub.of_pack("C", li_cch) + invo_sub.of_pack("C", 1) + lb_Font
  440. return lb_data
  441. end function
  442. public function string of_get_font_key ();string ls_ret
  443. uint li_pos
  444. ls_ret = string(len(is_font), "000") + is_font + trim(string(ii_size, "0000")) + trim(string(ii_font_script, "00")) + trim(string(ii_underline, "00")) + trim(string(ii_font_strikeout, "00")) + trim(string(ii_bold, "000")) + trim(string(ii_font_outline, "00")) + trim(string(ii_font_family, "0000")) + trim(string(ii_font_charset, "000000")) + trim(string(ii_font_shadow, "00")) + trim(string(ii_color, "000")) + trim(string(ii_italic, "0"))
  445. li_pos = pos(ls_ret, " ")
  446. Do While li_Pos>0
  447. ls_ret = replace(ls_ret, li_pos, 1, "_")
  448. li_pos = pos(ls_ret, " ")
  449. loop
  450. return ls_ret
  451. end function
  452. public function blob of_get_xf (string as_style);uint li_record
  453. uint li_length
  454. uint li_ifnt
  455. uint li_ifmt
  456. uint li_style
  457. uint li_align
  458. ulong ll_border1
  459. ulong ll_border2
  460. uint li_pcolor
  461. uint li_atr_num
  462. uint li_atr_fnt
  463. uint li_atr_alc
  464. uint li_atr_bdr
  465. uint li_atr_pat
  466. uint li_atr_prot
  467. uint li_rotation
  468. uint li_grbit8
  469. uint li_usedattr
  470. blob lb_data
  471. if as_style = "style" then
  472. li_style = 65525
  473. else
  474. li_style = ii_locked + ii_hidden * 2
  475. end if
  476. if ii_num_format <> 0 then
  477. li_atr_num = 1
  478. end if
  479. if ii_font_index <> 0 then
  480. li_atr_fnt = 1
  481. end if
  482. if ii_text_h_align <> 0 or ii_text_v_align <> 2 or ii_text_wrap <> 0 then
  483. li_atr_alc = 1
  484. end if
  485. if ii_bottom <> 0 or ii_top <> 0 or ii_left <> 0 or ii_right <> 0 then
  486. li_atr_bdr = 1
  487. end if
  488. if ii_fg_color <> 64 or ii_bg_color <> 65 or ii_pattern <> 0 then
  489. li_atr_pat = 1
  490. end if
  491. if ii_hidden <> 0 or ii_locked <> 1 then
  492. li_atr_prot = 1
  493. end if
  494. if ii_fg_color = 32767 then
  495. ii_fg_color = 64
  496. end if
  497. if ii_bg_color = 32767 then
  498. ii_bg_color = 65
  499. end if
  500. if ii_bottom_color = 32767 then
  501. ii_bottom_color = 64
  502. end if
  503. if ii_top_color = 32767 then
  504. ii_top_color = 64
  505. end if
  506. if ii_left_color = 32767 then
  507. ii_left_color = 64
  508. end if
  509. if ii_right_color = 32767 then
  510. ii_right_color = 64
  511. end if
  512. if ii_bottom = 0 then
  513. ii_bottom_color = 0
  514. end if
  515. if ii_top = 0 then
  516. ii_top_color = 0
  517. end if
  518. if ii_left = 0 then
  519. ii_left_color = 0
  520. end if
  521. if ii_right = 0 then
  522. ii_right_color = 0
  523. end if
  524. if ii_pattern <= 1 and ii_bg_color <> 65 and ii_fg_color = 64 then
  525. ii_fg_color = ii_bg_color
  526. ii_bg_color = 64
  527. ii_pattern = 1
  528. end if
  529. if ii_pattern <= 1 and ii_bg_color = 65 and ii_fg_color <> 64 then
  530. ii_bg_color = 64
  531. ii_pattern = 1
  532. end if
  533. choose case ii_rotation
  534. case 0
  535. li_rotation = 0
  536. case 1
  537. li_rotation = 255
  538. case 2
  539. li_rotation = 90
  540. case 3
  541. li_rotation = 180
  542. end choose
  543. li_ifnt = ii_font_index
  544. li_ifmt = ii_num_format
  545. li_align = ii_text_h_align + ii_text_wrap * 8 + ii_text_v_align * 16 + ii_text_justlast * 128
  546. li_grbit8 = 0 + 0 * 16 + 0 * 64
  547. li_usedattr = li_atr_num + li_atr_fnt * 2 + li_atr_alc * 4 + li_atr_bdr * 8 + li_atr_pat * 16 + li_atr_prot * 32
  548. ll_border1 = ii_left + ii_right * 16 + ii_top * 256 + ii_bottom * 4096 + ii_left_color * 65536 + ii_right_color * 8388608
  549. ll_border2 = ii_top_color + ii_bottom_color * 128 + 0 * 16384 + 0 * 2097152 + ii_pattern * 67108864
  550. li_pcolor = ii_fg_color + ii_bg_color * 128
  551. li_record = 224
  552. li_length = 20
  553. lb_data = invo_sub.of_pack("v", li_record) + invo_sub.of_pack("v", li_length) + invo_sub.of_pack("v", li_ifnt) + invo_sub.of_pack("v", li_ifmt) + invo_sub.of_pack("v", li_style) + invo_sub.of_pack("C", li_align) + invo_sub.of_pack("C", li_rotation) + invo_sub.of_pack("C", li_grbit8) + invo_sub.of_pack("C", li_usedattr * 4) + invo_sub.of_pack("V", ll_border1) + invo_sub.of_pack("V", ll_border2) + invo_sub.of_pack("v", li_pcolor)
  554. return lb_data
  555. end function
  556. public function integer of_set_merge_range ();ii_merge_range=1
  557. return 1
  558. end function
  559. public function integer of_set_text_h_align (unsignedinteger ai_align);ii_text_h_align =ai_align
  560. return 1
  561. end function
  562. public function integer of_set_text_v_align (unsignedinteger ai_align);ii_text_v_align=ai_align
  563. return 1
  564. end function
  565. public function integer of_copy (n_xls_format anvo_format);n_xls_format lnvo_format
  566. lnvo_format = anvo_format
  567. ii_font_index = lnvo_format.ii_font_index
  568. is_num_format = lnvo_format.is_num_format
  569. ii_num_format = lnvo_format.ii_num_format
  570. is_font = lnvo_format.is_font
  571. ii_size = lnvo_format.ii_size
  572. ii_bold = lnvo_format.ii_bold
  573. ii_italic = lnvo_format.ii_italic
  574. ii_color = lnvo_format.ii_color
  575. ii_underline = lnvo_format.ii_underline
  576. ii_font_strikeout = lnvo_format.ii_font_strikeout
  577. ii_font_outline = lnvo_format.ii_font_outline
  578. ii_font_shadow = lnvo_format.ii_font_shadow
  579. ii_font_script = lnvo_format.ii_font_script
  580. ii_font_family = lnvo_format.ii_font_family
  581. ii_font_charset = lnvo_format.ii_font_charset
  582. ii_hidden = lnvo_format.ii_hidden
  583. ii_locked = lnvo_format.ii_locked
  584. ii_text_h_align = lnvo_format.ii_text_h_align
  585. ii_text_wrap = lnvo_format.ii_text_wrap
  586. ii_text_v_align = lnvo_format.ii_text_v_align
  587. ii_text_justlast = lnvo_format.ii_text_justlast
  588. ii_rotation = lnvo_format.ii_rotation
  589. ii_fg_color = lnvo_format.ii_fg_color
  590. ii_bg_color = lnvo_format.ii_bg_color
  591. ii_pattern = lnvo_format.ii_pattern
  592. ii_bottom = lnvo_format.ii_bottom
  593. ii_top = lnvo_format.ii_top
  594. ii_left = lnvo_format.ii_left
  595. ii_right = lnvo_format.ii_right
  596. ii_bottom_color = lnvo_format.ii_bottom_color
  597. ii_top_color = lnvo_format.ii_top_color
  598. ii_left_color = lnvo_format.ii_left_color
  599. ii_right_color = lnvo_format.ii_right_color
  600. ii_merge_range = lnvo_format.ii_merge_range
  601. return 1
  602. end function
  603. on n_xls_format.create
  604. call super::create
  605. TriggerEvent( this, "constructor" )
  606. end on
  607. on n_xls_format.destroy
  608. TriggerEvent( this, "destructor" )
  609. call super::destroy
  610. end on
  611. event constructor;invo_sub = create n_xls_subroutines
  612. end event
  613. event destructor;destroy(invo_sub)
  614. if isvalid(message) then
  615. return 0
  616. else
  617. return message.returnvalue
  618. end if
  619. end event