Compare commits

...

938 Commits

Author SHA1 Message Date
ce1763501b Optimization 2025-02-25 10:59:19 +03:00
896427db83 For bug 72964 2025-02-08 21:59:52 +03:00
2f4b7442c7 Fix CJSContext::GetCurrent method for jsc version 2025-02-06 12:44:39 +03:00
45da53e9ae Refactoring standarttester 2025-02-04 20:12:07 +03:00
a33743cff2 fix bug #73052 2025-02-04 13:44:41 +06:00
a83e19cbdf fix bug #72176 2025-02-03 16:35:23 +00:00
8a991ae24a Merge pull request 'Fix bug #72857' (#208) from fix/bug72857 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/208
2025-02-03 14:35:21 +00:00
6caca87b64 Merge pull request 'For bug #72496' (#207) from fix/bug72496 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/207
2025-02-03 14:35:10 +00:00
9ab884ae24 Merge pull request 'Fix hwp conversion' (#217) from fix/hwp into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/217
2025-02-03 14:15:54 +00:00
e493d976e3 Fix bug #73036 2025-02-03 16:59:47 +03:00
d75e7342cf Fix bug #73042 2025-02-03 15:45:09 +03:00
ddd750be9c Merge pull request 'Fix write base fonts' (#216) from fix/pdf-standart-fonts into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/216
2025-02-03 12:40:28 +00:00
79a4434583 Fix bug #73040 2025-02-03 15:35:39 +03:00
44ff2aff3c Fix empty FreeText AP 2025-02-03 15:32:41 +03:00
2f4b3e41b3 Fix write base fonts 2025-02-03 15:24:08 +03:00
fe208f5243 Merge pull request 'Fix bug #72961' (#215) from fix/bug-72961 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/215
2025-02-03 11:15:35 +00:00
e41c1d9703 Fix bug #72961 2025-02-03 14:12:29 +03:00
5c5f98a6e3 Fix bug 73014 2025-02-03 10:45:38 +03:00
f9dd82ad47 Merge pull request 'Fix HWP conversion' (#211) from fix/hwp into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/211
2025-02-03 06:43:31 +00:00
084c8f4b94 Fix bug #72999 2025-02-03 07:17:39 +03:00
bf15325a9e Fix bug #73000 2025-02-03 05:25:55 +03:00
1b50b3a53a Fix bug 72868 2025-02-01 17:39:08 +03:00
70b40c46d2 Fix bug #72721 2025-02-01 11:36:52 +03:00
23798f3c96 Fix ios build 2025-01-31 17:14:07 +03:00
1e8d22080d Merge pull request 'Fix hwp bugs' (#209) from fix/hwp into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/209
2025-01-31 05:08:55 +00:00
90bcd47fb7 The conversion of the character spacing to hwp has been removed 2025-01-31 03:15:19 +03:00
c1adf0b30c Fix bug #72685 2025-01-31 03:15:12 +03:00
81a4d9ccd0 Fix bug 72936 2025-01-30 16:51:25 +03:00
a97014c173 Disable use filesystem in metafiles (js module) 2025-01-30 14:26:57 +03:00
b3951d083a Fix elements align in html conversion 2025-01-30 10:37:42 +00:00
7d78b37540 Fix bug #72932 2025-01-30 10:37:42 +00:00
ff162d451e Merge pull request 'Fix hwp bug' (#205) from fix/hwp into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/205
2025-01-30 10:33:13 +00:00
5dc6402006 Fix test file 2025-01-30 13:12:27 +03:00
fae17d9bfc Merge pull request 'For bug #72694' (#204) from fix/bug72694 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/204
2025-01-30 08:02:28 +00:00
931f4edae4 For bug #72694 2025-01-30 13:36:42 +06:00
3609cf1237 Fix bug #72933 2025-01-30 00:49:49 +03:00
cc8fa641aa Merge pull request 'Fix bug 72811' (#203) from fix/bug-72811 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/203
2025-01-29 16:20:19 +00:00
3b9a865d77 Fix bug 72811 2025-01-29 19:07:58 +03:00
f3b0a992bd Fix typo 2025-01-29 18:57:35 +03:00
74f3e7f279 Merge pull request 'Fix hwp conversion' (#202) from fix/hwp into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/202
2025-01-29 15:45:08 +00:00
d195aa4a79 Fix build 2025-01-29 18:31:12 +03:00
4a384edf08 For bug #72496 2025-01-29 20:23:33 +05:00
30f96cbc6c Fix bug #72705 2025-01-29 18:15:29 +03:00
007362d8be Fix bug #72780 2025-01-29 17:57:54 +03:00
f4aac048ea fix bug #72012 2025-01-29 17:44:17 +03:00
f815fec8ed Fix bug #72714 2025-01-29 17:14:53 +03:00
4ec217226d Fix bug #72721 2025-01-29 16:32:43 +03:00
3cef41e876 Added bookmark conversion, fix bugs, refactoring in hwp format 2025-01-29 16:22:03 +03:00
20bff1d6fe for bug #72794 2025-01-29 11:17:21 +00:00
8da1a109de Fix bug #72857 2025-01-29 02:28:47 +05:00
704cef604e fix bug #72496 2025-01-28 19:26:15 +03:00
3c850e2086 Fix bug #72667 2025-01-28 13:47:20 +00:00
ab660cb8a3 Merge pull request 'for bug #72496' (#198) from For/bug72496 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/198
2025-01-28 13:12:05 +00:00
af4343b1d8 for bug #72496 2025-01-28 16:06:39 +03:00
7e4fe558f4 Fix bug #72847 2025-01-28 15:17:08 +03:00
f942e56361 fix namespaces 2025-01-28 13:46:28 +03:00
8b85f6987f Merge pull request 'Fix bug #72839' (#197) from fix/bug-72839 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/197
2025-01-28 09:13:21 +00:00
cbe412d3c7 Fix bug #72839 2025-01-28 12:03:31 +03:00
d3d9c8df94 Added text indent in hwp conversion 2025-01-27 22:14:25 +03:00
01b582c4b9 Added BorderFill in hwp conversion 2025-01-27 22:01:41 +03:00
4568144a22 Merge branch 'fix/bug72794' into release/v8.3.0 2025-01-27 20:38:15 +03:00
cc4df3726a fix bug #72745 2025-01-27 20:37:02 +03:00
696610862a . 2025-01-27 18:27:20 +03:00
da6a5e9e98 for binary 2025-01-27 15:30:56 +03:00
d395e63b80 Merge pull request 'Fix bug #72657' (#188) from fix/bug72657 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/188
2025-01-27 12:30:02 +00:00
0350675df6 Fix min version 2025-01-27 13:58:30 +03:00
aead2e9fb8 Merge pull request 'Fix bug#72779' (#196) from fix/bug72779 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/196
2025-01-27 10:03:20 +00:00
d12bad7bd1 Fix bug#72779 2025-01-27 15:58:25 +06:00
da2284fff6 Fix bug #72712 2025-01-26 18:26:03 +00:00
1382aa0b3d Fix bug #72780 2025-01-26 18:26:03 +00:00
8ba5df60d9 Fix bug #72705 2025-01-26 18:26:03 +00:00
5299872b17 Fixes for snapshots 2025-01-26 20:18:14 +03:00
e1757dd5d1 fix bug #72796 2025-01-26 12:10:44 +03:00
b5c5a5f1ed Fix bug #72781 2025-01-25 17:56:11 +00:00
6979e17c3d Added polygon and curve conversion in hwp format 2025-01-25 17:56:11 +00:00
c43fb92860 Fixed the correction of large text size in svg 2025-01-25 18:27:22 +03:00
63887c95b6 Use wmf&emf instead conversion to svg in zip images (for native convertations) 2025-01-25 13:39:35 +03:00
d3d4e86925 Merge pull request 'Fix bug #72365' (#179) from fix/bug72365 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/179
2025-01-25 09:25:56 +00:00
f6383571eb fix bug #72794 2025-01-25 12:18:30 +03:00
a6f6a67aed Fix prev commit 2025-01-24 23:30:51 +03:00
f9543ef9de Year Up 2025-01-24 23:03:42 +03:00
bb58be4f18 Add new method for images inside zip 2025-01-24 22:51:04 +03:00
40efe7dabc Fix build 2025-01-24 18:10:29 +00:00
80b7caaf7a Fix bug #72721 2025-01-24 18:10:29 +00:00
08e3dfb061 Fix bug #72772 2025-01-24 18:10:29 +00:00
3a9d91b291 Fix bug #72719 2025-01-24 18:10:29 +00:00
45b26554b2 Merge pull request 'Fix bug #72175' (#191) from fix/bug72175 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/191
2025-01-24 16:19:30 +00:00
09c4df8e05 Fix remove AP when transform 2025-01-24 17:53:23 +03:00
85533a6553 fix bug #72768 2025-01-24 17:35:53 +03:00
65898a94ad Merge pull request 'Fix hwp bugs' (#187) from fix/hwp into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/187
2025-01-24 11:31:39 +00:00
86009ff6fa Fix bug #72175 2025-01-24 12:46:02 +03:00
b91dfb075e Fix bug #72657 2025-01-24 13:42:37 +06:00
f057a16bc1 Fix bug #72700 2025-01-24 04:32:32 +03:00
bd76adc97f Fix bug #72714 2025-01-23 23:36:47 +03:00
27b5dbf15e Fix bad conversion hwp to ooxml 2025-01-23 23:08:52 +03:00
58a7c7cd9d Merge branch 'release/v8.3.0' of git.onlyoffice.com:ONLYOFFICE/core into release/v8.3.0 2025-01-23 15:12:51 +03:00
18fa4639b0 fix convert to ooxml 2025-01-23 15:12:43 +03:00
389e5314df Fix bug #72692 2025-01-23 15:03:17 +03:00
42636a8ab1 Merge pull request 'Fix bug #72173' (#185) from fix/bug72173 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/185
2025-01-23 11:45:45 +00:00
a3c87e7119 Fix crash with fonts with symbol > 0x10FFFF and wirh \n in name 2025-01-23 14:41:39 +03:00
2115371c0c Fix bug #72173 2025-01-23 13:17:46 +03:00
bd95478d77 Fix build 2025-01-22 19:40:15 +03:00
965680de23 Fix build 2025-01-22 19:32:31 +03:00
ad44ddf682 Fix build 2025-01-22 18:55:57 +03:00
06386d5458 Fix build 2025-01-22 18:25:41 +03:00
ffda83848d Fix bug 70819 2025-01-22 15:48:26 +03:00
55dc0b789f Merge remote-tracking branch 'origin/feature/hwpx' into release/v8.3.0 2025-01-22 14:28:50 +03:00
53e3f8c561 Merge pull request 'feature/docx-renderer' (#183) from feature/docx-renderer into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/183
2025-01-22 11:25:17 +00:00
731a7addee Comment logic 2025-01-22 12:57:21 +03:00
36b82c1ef9 add default font size on odf math 2025-01-22 12:42:46 +03:00
229a8f9dad . 2025-01-22 12:14:08 +03:00
5f5d74df92 . 2025-01-22 12:13:15 +03:00
66ea88bf14 fix bug #72043 2025-01-22 12:08:39 +03:00
3953044063 Add clearing 2025-01-22 11:36:13 +03:00
9a4a1546cb Fix bug #72655 2025-01-21 23:19:08 +03:00
4085ee5002 Merge pull request 'Fix bug #69572' (#180) from fix/bug69572 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/180
2025-01-21 15:03:02 +00:00
f6ef582658 Merge pull request 'Fix bug#72187' (#176) from fix/bug72187 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/176
2025-01-21 15:02:15 +00:00
7b62295149 Fix bug 72544 2025-01-21 17:38:05 +03:00
421dcd780d Fix bug #69572 2025-01-21 20:17:24 +06:00
b9e7a3143c Fix bug 72595 2025-01-21 15:57:35 +03:00
6026841c00 Refactoring 2025-01-21 13:01:02 +03:00
1e6d0a9f25 fix text entry 2025-01-21 12:14:13 +03:00
adad3a05ba Fix build 2025-01-21 11:51:14 +03:00
99fa27e693 Merge branch 'release/v8.3.0' into feature/hwpx 2025-01-21 11:50:09 +03:00
6b66c8fb50 Merge pull request 'Fix bug#72189' (#177) from fix/bug72189 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/177
2025-01-21 07:49:05 +00:00
9faa7fb69d Added hwpx format to ASCConverter 2025-01-21 02:49:51 +03:00
84042360ab Fixed bugs in hwpx conversion 2025-01-21 02:49:10 +03:00
8a8a6e78eb fix bug #72578 2025-01-20 21:49:25 +03:00
8bd655dd17 fix bug #72611 2025-01-20 21:22:45 +03:00
34ecf84835 Merge pull request 'Fix bug #72414' (#161) from fix/bug72414 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/161
2025-01-20 18:05:36 +00:00
4cf79c985d Merge pull request 'Fix bug #72432' (#162) from fix/bug72432 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/162
2025-01-20 18:05:05 +00:00
18e359c1a6 Merge pull request 'Fix bug #72375' (#163) from fix/bug72375 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/163
2025-01-20 18:04:21 +00:00
dc777f43d9 Merge pull request 'Fix bug #72264' (#164) from fix/bug72264 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/164
2025-01-20 18:03:52 +00:00
8cd7ca9731 Merge pull request 'Fix bug #72039' (#165) from fix/bug72039 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/165
2025-01-20 18:03:13 +00:00
8f91c47178 Merge pull request 'Fix bug #69238' (#166) from fix/bug69238 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/166
2025-01-20 18:02:44 +00:00
fdac954df5 Add main logic of tables (in developing) 2025-01-20 16:14:28 +03:00
70c98eb9f3 Fix build 2025-01-20 15:42:37 +03:00
024efd2e35 Fix bug #72535 2025-01-20 11:12:14 +00:00
da252bfa5e Fix bug #72589 2025-01-20 11:05:28 +00:00
c9ce68eab3 Improved work with external style files in html 2025-01-20 11:05:28 +00:00
3af549a158 Fix bug #72586 2025-01-20 11:05:28 +00:00
34627ff1c5 Fix bug #72519 2025-01-20 11:05:28 +00:00
0c2b49af11 Fix build for win XP 2025-01-20 10:53:51 +03:00
4324ea847c Reafactoring and fixed bugs in hwp conversion 2025-01-19 20:06:41 +03:00
df76ff3778 Fix bug 72537 2025-01-17 20:11:47 +03:00
172bb09305 Fix bug 72484 2025-01-17 20:07:45 +03:00
aa0ba83d32 Fix bug#72189 2025-01-17 18:44:27 +03:00
fb934ef527 Fix bug #72558 2025-01-17 15:18:52 +03:00
a2b817bbc2 Merge pull request 'for bug #72486' (#169) from fix/bug72486 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/169
2025-01-17 09:29:25 +00:00
ecd80408e2 for bug #72486 2025-01-17 15:23:28 +06:00
b78e2cb33c Adding parsing of hwpx format elements 2025-01-17 02:42:21 +03:00
f0c52d2e81 Merge pull request 'Fixed html bugs' (#168) from fix/html into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/168
2025-01-16 12:24:11 +00:00
23ac269339 Fix bug #72533 2025-01-16 15:02:32 +03:00
8239d6f51d Fix bug 72529 2025-01-16 10:42:07 +03:00
3adf336384 For bug #72519 2025-01-15 22:42:28 +03:00
8e1810697f Fix bug #72519 2025-01-15 20:34:02 +03:00
7c2105b613 Fix bug #72365 2025-01-15 22:13:04 +05:00
2027defafb Fix bug #69238
Merge remote-tracking branch 'origin/release/v8.3.0' into fix/bug69238
2025-01-15 21:11:24 +05:00
2ea586ec6f Fix bug #72414 2025-01-15 20:13:21 +05:00
a6940c42ac Obtain builder's version from INTVER 2025-01-15 13:16:59 +00:00
6ed1cb60d6 Merge pull request 'Fixed bugs in hwp format' (#159) from fix/hwp into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/159
2025-01-15 12:55:20 +00:00
2c9e58280b Fixed the bug of missing bmp images in hwp format 2025-01-15 15:09:24 +03:00
f18b50cd4f Fix typo 2025-01-15 14:37:45 +03:00
aa2af5d280 [android] Add new formats 2025-01-15 14:29:38 +03:00
dde69ba65f Fix typo 2025-01-15 13:09:45 +03:00
f51b58c927 [android] Add HWPFile 2025-01-15 09:36:16 +03:00
43f1ac0596 Adding parsing of hwpx format elements 2025-01-15 01:28:37 +03:00
321e0de9f3 Merge pull request 'Fix bug 72489' (#158) from fix/bug-72489 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/158
2025-01-14 14:33:32 +00:00
ca77113e79 . 2025-01-14 17:21:16 +03:00
2098c72a35 Fix bug 72489 2025-01-14 17:11:23 +03:00
06e34fc303 Merge pull request 'Fix bug 71493' (#154) from fix/bug-71493 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/154
2025-01-14 14:09:00 +00:00
7b56d56c0e [android] Add new formats 2025-01-14 15:17:17 +03:00
aa90104b18 Fix build 2025-01-14 13:03:28 +03:00
98b285ab64 Merge pull request 'Added HWP format' (#155) from feature/hwp into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/155
2025-01-14 09:43:21 +00:00
cbd7e8ee7b Refactoring 2025-01-14 09:40:42 +00:00
b76235d4fc For bug #72413 2025-01-14 09:40:42 +00:00
b9e1d77038 Fix bug #72353 2025-01-14 09:40:42 +00:00
8f448d3842 For bug #72318 2025-01-14 09:40:42 +00:00
89d7242d21 Fix bug #72386 2025-01-14 09:39:27 +00:00
9aaa241523 fix bug #72328 2025-01-14 11:01:03 +03:00
02bd5c4b0b Fix bug#72187 2025-01-14 10:17:09 +03:00
4003a39ef9 Fix typo 2025-01-14 01:42:46 +03:00
a5fed4af70 Fix build and refactoring 2025-01-14 01:41:13 +03:00
a9d8cbbc57 Fix bug 71493
Also fix bug 57854, 55429
2025-01-13 17:27:54 +03:00
6c79ab37fa Fix bug 72193 2025-01-13 17:16:52 +03:00
17762b71db Unused files have been deleted 2025-01-13 16:53:14 +03:00
be2f142fd3 Fix build 2025-01-13 16:52:45 +03:00
fdcb2cf7ba Fix bug #72432 2025-01-13 18:19:42 +05:00
07bf7a44aa Fix bug #72375 2025-01-13 17:08:46 +05:00
a2bfbd8368 Adding parsing of hwpx format elements 2025-01-13 01:12:37 +03:00
25553904df Adding parsing of hwpx format elements 2025-01-12 17:25:13 +03:00
954ef08975 Adding parsing of hwpx format elements 2025-01-12 00:34:45 +03:00
aea8b7873c Refactoring and fix bugs 2025-01-11 01:18:41 +03:00
a7774a6bc3 fix bug #72395 2025-01-10 17:10:46 +03:00
4d15b5c19d Improved conversion of shapes properties в hwp format 2025-01-10 00:50:11 +03:00
e230fa1d43 fix bug #53173 2025-01-09 14:02:46 +03:00
3d30144ebb Merge pull request 'Fix scientific numbers csv reading' (#153) from fix/scientific-scv-reading into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/153
2025-01-09 09:54:03 +00:00
3365ca15d6 Fix scientific numbers csv reading 2025-01-09 15:47:22 +06:00
c0debdfe39 Improved conversion of shape styles, fix bugs, refactoring in hwp format 2025-01-09 01:27:30 +03:00
f7d55d48fe Remove depends to CSvgFile from CConverter2OOXML in hwp format 2025-01-08 23:16:37 +03:00
f2510a9410 Merge branch 'release/v8.3.0' into feature/hwp 2025-01-08 23:09:44 +03:00
f2a8a9878b Added partial web video conversion in hwp format 2025-01-08 23:05:19 +03:00
39adc06921 Fixed the merge obstacle 2025-01-08 22:59:00 +03:00
64af642c40 Added AutoNumber conversion in hwp conversion 2025-01-08 01:12:03 +03:00
ef26ac732e Added columns conversion in hwp format 2025-01-08 00:19:57 +03:00
8bbaaf4cef Added header and footer conversion in hwp format, fix bugs and refactoring 2025-01-07 23:14:04 +03:00
de821b73c8 Added endnotes conversion in hwp format and fixed bugs 2025-01-05 23:44:46 +03:00
a7d5fe3994 Added footnotes conversion in hwp format 2025-01-05 23:13:24 +03:00
7deeefbcf4 Added chart conversion in hwp format 2025-01-05 01:48:16 +03:00
3666bdf6fc Fixed bugs in the parse and improved shapes conversion 2025-01-04 16:49:45 +03:00
eaa7bb30db Added rectangle conversion in hwp format 2025-01-03 23:04:36 +03:00
d4619c5786 Added hwp format to x2t 2025-01-03 21:16:03 +03:00
0f3852ab1e Refactoring 2025-01-03 21:14:30 +03:00
fb5b1c5a6e Added conversion of a numbered list in hwp format 2025-01-02 23:20:43 +03:00
cef8ac9fd9 Remove depends to CSvgFile from HtmlFile2. Add initialize fontsfor svg. 2025-01-02 22:36:18 +03:00
45aa5df267 Fix build 2025-01-02 21:50:30 +03:00
e8c94aa103 Improved text conversion in hwp format 2024-12-31 13:48:26 +03:00
aa5b7e1276 Improved conversion of styles in hwp format 2024-12-31 01:08:15 +03:00
dd98d0c11d Merge pull request 'Fix bug 72344' (#149) from fix/bug-72344 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/149
2024-12-28 11:00:20 +00:00
08971025bd Added support for conversion of HWP tables, fixed bugs 2024-12-27 23:58:06 +03:00
00f6a823d6 Fix bug 72344 2024-12-27 20:13:44 +03:00
b4f4da26d6 Mark files as debug 2024-12-27 17:54:45 +03:00
1c9f7ac597 . 2024-12-27 16:16:42 +03:00
673139f5a9 Merge pull request 'Fix Metafile conversion' (#148) from fix/Metafile into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/148
2024-12-27 11:57:39 +00:00
4bf0cee034 Added image conversion to hwp, bug fixes, and refactoring 2024-12-26 20:51:15 +03:00
00abbab370 Fix bug #72264 2024-12-26 17:52:59 +05:00
3125a7a928 fix bug #72263 2024-12-25 20:23:53 +03:00
f20c944c72 Merge pull request 'Fix bug 72273' (#146) from fix/bug-72273 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/146
2024-12-25 08:28:41 +00:00
6d7dc6517b fix bug #70653 2024-12-24 18:28:53 +03:00
6fd84c6c8c [android] Enable minify and update agp 2024-12-24 14:16:53 +03:00
d37f31208c Merge pull request 'Update branch' (#147) from release/v8.3.0 into fix/Metafile
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/147
2024-12-24 10:18:44 +00:00
c472b19e0d Fix bug#72243 2024-12-24 13:07:45 +03:00
7b03bcde89 Writing the HWP format conversion 2024-12-24 11:22:56 +03:00
03a7eb0fd4 Fix bug 72273 2024-12-24 10:45:29 +03:00
c0a779727e Merge pull request 'Fix bug #72173' (#145) from fix/bug72173 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/145
2024-12-24 07:20:13 +00:00
52d3f0bc19 Merge pull request 'Fix bug #72187' (#144) from fix/bug72187 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/144
2024-12-24 07:19:52 +00:00
c17497e304 Merge pull request 'Fix bug #72048' (#143) from fix/bug72048 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/143
2024-12-24 07:19:10 +00:00
6bc4ecbc73 Fix bug #72173 2024-12-24 10:10:08 +03:00
2246077589 Fix bug #72187 2024-12-24 09:57:00 +03:00
91eb74773b Merge branch 'fix/bug72039' of git.onlyoffice.com:ONLYOFFICE/core into fix/bug72039
# Conflicts:
#	OdfFile/Reader/Format/draw_shapes_docx.cpp
2024-12-23 20:31:41 +05:00
5b8d2660aa Fix bug #72039 2024-12-23 20:24:05 +05:00
60ad1c10fd fix bug #72196 2024-12-23 17:29:40 +03:00
36b0cc524e Fix bug #72039 2024-12-23 17:33:13 +05:00
bb33e70b3e The writing code for converting hwp format and fixed bugs 2024-12-23 15:15:24 +03:00
5f2d7b2f5a Add base xml for tables 2024-12-20 19:27:23 +03:00
02aeaa6a64 Fix bug with ascent/descent 2024-12-20 17:38:56 +03:00
7696541430 fix bug #72151 2024-12-20 17:33:11 +03:00
614156f575 fix bug #72170 2024-12-19 13:19:03 +03:00
397abd51a5 Fix bug 72159 2024-12-19 11:32:58 +03:00
d311090ced fix write empty custom 2024-12-18 19:44:06 +03:00
4a110d68c1 Fixed bugs in reading hwp format and added test example 2024-12-18 15:13:43 +03:00
505a3c6224 Merge pull request 'Fix bug 63154' (#140) from fix/bug-63154 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/140
2024-12-18 10:28:36 +00:00
75a21ee162 Fix bug 63154 2024-12-18 13:18:04 +03:00
440cf968d5 Fix bug 70708 2024-12-18 07:39:25 +00:00
3daa374a51 Compute text lines 2024-12-18 07:39:25 +00:00
5d83d912fc Fix bug 72142 2024-12-17 15:41:21 +00:00
695fd3ba1c Merge pull request 'Fix bug #69851' (#139) from fix/bug69851 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/139
2024-12-17 15:32:52 +00:00
75f68904f2 Merge branch 'release/v8.3.0' of git.onlyoffice.com:ONLYOFFICE/core into release/v8.3.0 2024-12-17 18:32:11 +03:00
b99badda9f fix bug #72057 2024-12-17 18:32:06 +03:00
48d86cb7ce Add base classes 2024-12-17 15:39:50 +03:00
9991cc8c03 Rewrite split lines logic 2024-12-17 15:13:53 +03:00
36a3b693d5 Update paragraph logic for enums 2024-12-17 13:44:31 +03:00
dbd6be9520 Fix bug #69851 2024-12-17 15:48:38 +06:00
42ef948fcc Merge pull request 'Create Stamp Annot' (#131) from feature/pdf-new-stamp into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/131
2024-12-17 09:23:32 +00:00
69f4ac3ed7 fix bug #71799 2024-12-17 10:14:47 +03:00
328e379ec2 The writing code for converting hwp format 2024-12-16 21:05:10 +03:00
7d65d4b11a Fix bug #72048 2024-12-16 16:30:44 +03:00
57ba4355f9 fix bug #72062 2024-12-16 15:22:04 +03:00
2eea44bc8c Merge pull request 'Fix int to double conversion' (#136) from fix/bug72062 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/136
2024-12-16 11:04:49 +00:00
cb982a1ad4 Fix int to double conversion 2024-12-16 15:28:15 +06:00
0aca0a0a5a fix bug #71977 2024-12-15 12:47:27 +03:00
0c1df859e2 The writing code for converting hwp format 2024-12-14 16:36:33 +03:00
7a153285c8 fix bug #72063 2024-12-14 12:56:00 +03:00
c2d00ee819 Merge pull request 'Fix bug #54422' (#135) from fix/bug54422 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/135
2024-12-14 09:01:38 +00:00
3603787df8 Merge pull request 'Fix bug #71477' (#134) from fix/bug71477 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/134
2024-12-14 08:58:29 +00:00
d58424d089 Fix build 2024-12-14 11:38:11 +03:00
fe2ca8c566 Delete unused headers & add new files 2024-12-14 11:33:47 +03:00
20d2ff7954 Refactoring 2024-12-14 11:18:42 +03:00
b125c19d02 Remove useless call 2024-12-14 07:13:48 +03:00
2f2d11a5f6 Fix bug with recalc size of space 2024-12-14 06:51:59 +03:00
de4897fdef Add HorVerLinesCollector 2024-12-13 16:54:16 +03:00
f9952d0f94 Refactoring for future tables 2024-12-13 15:50:32 +03:00
5483a8d36b Merge pull request 'Fix bug #72067' (#133) from fix/bug72067 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/133
2024-12-13 12:16:42 +00:00
80ac89f16b fix bug #72065 2024-12-13 15:12:49 +03:00
fcf9830aa6 Fix bug #72067 2024-12-13 17:53:06 +06:00
d7b435a446 Delete unused file 2024-12-13 12:28:13 +03:00
887d963d8d Fix bug 72045 2024-12-12 15:29:31 +03:00
bc4c39b7aa The writing code for converting hwp format 2024-12-11 21:34:46 +03:00
8d89026d19 Change path for pdf.bin 2024-12-11 17:44:48 +03:00
4e6e3ce5f0 Fix rotate double 2024-12-11 14:46:18 +03:00
3d7eced836 Fix Rotate 2024-12-11 14:34:26 +03:00
7130b1be34 [x2t] Rename draw->visio; For bug 72002 2024-12-11 12:25:47 +03:00
a5917c389f The writing code for converting hwp format 2024-12-10 22:19:37 +03:00
eee80b0f87 [x2t] Rename draw->visio; For bug 72002 2024-12-10 19:28:04 +03:00
35dff37820 Create Stamp Annot 2024-12-10 15:07:11 +03:00
2f45a87669 Remove HtmlRenderer library 2024-12-10 14:24:41 +03:00
185b3d54eb Merge pull request 'feature/docx-renderer' (#130) from feature/docx-renderer into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/130
2024-12-10 09:05:54 +00:00
f7f059b6c0 Merge pull request 'Feature pdf text' (#119) from feature/pdf-text into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/119
2024-12-10 09:04:32 +00:00
2a9044d066 No changes HtmlRenderer 2024-12-10 11:20:09 +03:00
a93f00d0af The writing code for converting hwp format 2024-12-09 22:18:04 +03:00
9a1abe9819 Fix bug 71495 2024-12-09 17:50:01 +03:00
f8f9d55ab8 Merge branch hotfix/v8.2.2 into release/v8.3.0 2024-12-09 12:00:06 +00:00
99b777a5eb Merge pull request 'Fix bug #71944' (#121) from fix/bug71944 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/121
2024-12-09 10:19:07 +00:00
d1506ec9fa Merge pull request 'Fix bug #71943' (#122) from fix/bug71943 into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/122
2024-12-09 10:17:14 +00:00
9fc74159ff Fix bug #71927 2024-12-09 12:57:55 +03:00
ec14915925 fix bug 2024-12-09 11:07:11 +03:00
f9f4efc383 Fix statistics 2024-12-09 10:31:50 +03:00
12ad4e604b Add indents logic with bullets 2024-12-09 09:02:07 +03:00
e0ad062380 Add origin font 2024-12-09 08:00:17 +03:00
b72f678c1d Fix drop caps 2024-12-09 07:53:41 +03:00
7b67dfa57c fix bug #71976 2024-12-07 15:48:54 +03:00
5153ac069b fix bug #71974 2024-12-07 12:52:47 +03:00
a08b614bce refactoring convert ods formula 2024-12-07 11:49:52 +03:00
59f41bcdec Fix bug 70699 2024-12-07 06:15:37 +03:00
e8aa709d4e Fix bug #54422 2024-12-07 01:35:12 +05:00
c4515aca3a Problem 2024-12-06 18:01:05 +03:00
3fde7b3f92 fix bug 2024-12-06 15:43:49 +03:00
b776b7b63f The writing code for converting hwp format 2024-12-06 15:18:32 +03:00
d69601c2d2 fix bug #71946 2024-12-06 13:04:37 +03:00
912482beee Merge pull request 'Fix pdf accuracy' (#118) from fix/pdf-precision into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/118
2024-12-06 07:56:22 +00:00
c0ca4189d3 Fix pdf accuracy 2024-12-06 10:48:07 +03:00
134a214a0b Refactoring 2024-12-06 10:45:06 +03:00
95f604ec68 Merge remote-tracking branch 'origin/release/v8.3.0' into feature/pdf-text 2024-12-06 10:33:37 +03:00
ecd71dd92a The writing code for converting hwp format 2024-12-05 21:27:21 +03:00
d8bd9ef845 Fix size of Line 2024-12-05 18:59:43 +03:00
d3a317ed4b Merge pull request 'Fix number format csv reading' (#117) from fix/number-formats-csv-reading into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/117
2024-12-05 09:50:00 +00:00
37141b6ba3 Fix number format csv reading 2024-12-05 15:26:19 +06:00
bd3cabd236 Return to typed arrays 2024-12-04 18:45:59 +03:00
c2403aa0b7 fix 2024-12-04 17:54:08 +03:00
bdf70dd99e Merge pull request 'feature/add-lcid-to-csv' (#116) from feature/add-lcid-to-csv into release/v8.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/116
2024-12-04 14:33:37 +00:00
9f18cbce01 Fix bug 71930 2024-12-04 12:38:45 +03:00
05a6f6afaf Fix build android version 2024-12-04 12:03:34 +03:00
7e11af5553 The writing code for converting hwp format 2024-12-03 20:12:50 +03:00
3275182013 Add local using to default date formats 2024-12-03 19:54:23 +06:00
ca2b6d78aa Fix iso date parsing 2024-12-03 15:26:18 +06:00
6a24fd149a Fix bug 71908 2024-12-03 11:56:00 +03:00
168dc1ddb8 Merge remote-tracking branch 'origin/develop' into fix/bug69238 2024-12-03 13:27:22 +05:00
8918b7fae0 Fix formula conversion order 2024-12-03 13:26:51 +05:00
4501adbc61 Update iwork 2024-12-03 08:01:08 +00:00
0c1864a136 Fixed a bug with the termination of recording when converting iwork formats on Linux 2024-12-03 08:01:08 +00:00
3e2373687c Add standart date reading 2024-12-03 13:32:09 +06:00
779af49e0d Add local info inicialization on request 2024-12-02 19:21:53 +06:00
cb2f1c5577 Add more locales support 2024-12-02 18:42:22 +06:00
446a0f9524 Fix bug 70337 2024-12-02 15:20:15 +03:00
1c839e6c62 Add more locales support 2024-12-02 15:39:44 +06:00
f7d7dc8c6b Fix bug 71899 2024-12-02 11:11:06 +03:00
6d789e966a Merge branch 'develop' into feature/add-lcid-to-csv 2024-12-02 13:18:12 +06:00
d20d1af154 The writing code for converting hwp format 2024-11-29 21:46:53 +03:00
925ffa09e2 Merge remote-tracking branch 'origin/develop' into fix/bug69238 2024-11-29 19:33:13 +05:00
dd0ed96e5a fix bug #71885 2024-11-29 16:43:26 +03:00
25b30981ce Add more locales support 2024-11-29 19:33:30 +06:00
ebfee2376f fix opacity 2024-11-29 15:34:57 +03:00
fa33af2304 Merge branch 'develop' into feature/add-lcid-to-csv 2024-11-29 17:45:21 +06:00
6b9fc964b9 Fix isSpace 2024-11-28 17:28:33 +03:00
9242ab9743 Merge remote-tracking branch 'origin/develop' into feature/pdf-text 2024-11-28 16:58:46 +03:00
e14cc2d5c5 HtmlRenderer to serialize 2024-11-28 12:29:24 +03:00
cd73a4d9e3 Merge pull request 'feature/docx-renderer' (#107) from feature/docx-renderer into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/107
2024-11-28 09:06:38 +00:00
1b39b9f416 Fix bug 70795 2024-11-28 08:12:16 +00:00
4e57fda1f6 . 2024-11-28 08:12:16 +00:00
f3d65cb04c . 2024-11-28 08:12:16 +00:00
4ba288978d Add method for get document type 2024-11-28 08:12:16 +00:00
c862d58966 fix perm 2024-11-28 08:12:16 +00:00
c6effb6de2 fix bug #71868 2024-11-27 22:49:31 +03:00
295dbbbb86 The writing code for converting hwp format 2024-11-27 20:45:00 +03:00
96b34ee008 fix bug #52238 2024-11-27 20:41:19 +03:00
265db0216b Fix new word 2024-11-27 17:32:14 +03:00
76f2d81655 Add more locales 2024-11-27 17:46:56 +06:00
10ff332f4d Merge remote-tracking branch 'origin/develop' into fix/bug69238 2024-11-27 15:45:33 +05:00
f57179911f The beginning of writing code for converting hwp format 2024-11-26 20:52:11 +03:00
863144596c Merge branch 'develop' into feature/add-lcid-to-csv 2024-11-26 21:43:46 +06:00
a82a8977c3 Add more locales to localinfo 2024-11-26 21:41:35 +06:00
0109c69e38 Merge pull request 'fix build' (#105) from fix/OOXml2Odf-build into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/105
2024-11-26 13:16:15 +00:00
92ce5d81ad fix build 2024-11-26 15:43:48 +03:00
482da0dab3 Merge branch 'develop' into feature/add-lcid-to-csv 2024-11-26 18:08:14 +06:00
32afe4f24e Merge pull request 'feature/binary-reading-optimisation' (#104) from feature/binary-reading-optimisation into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/104
2024-11-26 12:05:17 +00:00
182dd9e072 Merge branch 'develop' into feature/add-lcid-to-csv 2024-11-26 16:26:13 +06:00
2ba281a5ee Fix empty 2024-11-25 17:31:25 +03:00
b3a30cf2ea Fix row compression 2024-11-25 15:15:25 +06:00
c321783b44 Merge pull request 'fix OOXml2Odf' (#101) from fix/OOXml2Odf into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/101
2024-11-25 09:07:03 +00:00
182cd8d74a Fix bug 70795 2024-11-25 07:59:02 +00:00
98a1988d9a test editing 2024-11-25 10:39:54 +03:00
acd9219b16 Merge branch 'develop' into feature/binary-reading-optimisation 2024-11-25 12:58:53 +06:00
0cbcaa209c Add pcrRecord reading 2024-11-22 21:45:18 +06:00
a53e46be24 Add restriction for MS compiler 2024-11-22 17:50:42 +03:00
ab8070aa56 Fix build 2024-11-22 17:38:14 +03:00
6a930c5aa4 Merge pull request 'Fix build for linux' (#100) from fix/iwork-build into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/100
2024-11-22 13:44:43 +00:00
6c0715cc66 Fix build for linux 2024-11-22 15:46:52 +03:00
ce0f8251d3 Fix bug #69238 2024-11-22 17:32:40 +05:00
f019dfbb07 Words with X and Width 2024-11-22 15:09:21 +03:00
fefcef7da4 Add pivot cache records fast reading 2024-11-22 17:07:04 +06:00
361bc70fe3 Merge branch hotfix/v8.2.1 into hotfix/v8.2.2 2024-11-22 10:46:56 +00:00
09b4ab5092 Merge branch hotfix/v8.2.1 into develop 2024-11-22 10:46:55 +00:00
e1fcf17b34 Merge pull request 'feture/iwork-build' (#99) from feture/iwork-build into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/99
2024-11-22 07:34:59 +00:00
c83a8a3a54 Serialization 2024-11-21 17:54:33 +03:00
54f0635500 Optimise PCDIDT records loading 2024-11-21 18:56:29 +06:00
bb48b57af9 Merge branch 'develop' into feature/binary-reading-optimisation 2024-11-21 13:13:29 +06:00
8a000efb7f fill stretch 2024-11-20 18:59:09 +03:00
1c362612e3 Refactoring HtmlRendererText 2024-11-20 18:52:06 +03:00
78404c4ffe fix bug #45121 2024-11-20 17:44:22 +03:00
3a49869ce0 change sheet data conversion cicle condition 2024-11-20 19:39:43 +06:00
a1a6e6c9a0 Refactoring 2024-11-20 16:06:24 +03:00
4199716550 Add xlsx->xlsb empty cells compression 2024-11-20 15:36:03 +06:00
6d68d7aee5 . 2024-11-19 23:58:51 +03:00
cf346bd535 CMetafile to NSWasm::CData 2024-11-19 17:41:32 +03:00
61e6b54710 . 2024-11-19 16:44:39 +03:00
536dac5fc9 getSelectionQuads..
The function is called very often, and returns an array of borders for drawing the text selection. Therefore, frequent memory allocation for serialization of the result, frequent reading and freeing of memory. You will have to cache on JS
2024-11-19 15:17:57 +03:00
65ba8ffd3b Add method for get document type 2024-11-19 15:08:16 +03:00
c6467d67c5 Merge branch 'develop' into feature/binary-reading-optimisation 2024-11-19 17:46:57 +06:00
5a9812887b Add empty strings compression 2024-11-19 17:29:14 +06:00
e637b47d68 Removed the mandatory dependency on gperf when building iWork 2024-11-19 14:03:25 +03:00
0078a2e19b Move empty cells compression to individual method 2024-11-19 16:14:17 +06:00
d2713d0cfd fix perm 2024-11-19 11:24:16 +03:00
4bf363f458 Merge pull request 'COfficeDrawingPageParams' (#98) from feature/pdf-params into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/98
2024-11-18 16:14:00 +00:00
c1b01029df COfficeDrawingPageParams 2024-11-18 18:59:23 +03:00
4b299fedd7 Fix empty cell compression 2024-11-18 21:18:01 +06:00
dc4074299c change CHtmlRendererText 2024-11-18 18:13:29 +03:00
2d161f1341 edit attributes 2024-11-18 16:54:57 +03:00
fea872d779 Fixed the build of iWork on linux 2024-11-18 16:48:53 +03:00
6c614051d9 Merge branch 'develop' into feature/binary-reading-optimisation 2024-11-18 17:46:16 +06:00
2517316e2b Add empty rows compressing 2024-11-18 15:41:23 +06:00
c83e50d164 fix bug #59349 2024-11-16 19:32:40 +03:00
66bc0223cb fix bug #57207 2024-11-16 17:03:17 +03:00
9ea09f95f8 fix bug #17798 2024-11-16 15:01:57 +03:00
d66d95d4c6 Fix bullet paragraph
for simple cases (no paragraph style)
2024-11-15 17:02:45 +03:00
024c288e12 iWork formats are built into x2t 2024-11-15 16:47:05 +03:00
caac75fcc1 Create struct for text 2024-11-15 16:36:59 +03:00
eb88373ec5 Refactoring 2024-11-15 16:00:45 +03:00
4e86a9a08a add cellBlank compression to xlsb->xlsx conversion 2024-11-15 18:07:47 +06:00
099ebc3de9 Enable JS error logs in release mode 2024-11-15 13:57:43 +03:00
4c3b9411b4 Fix bug 70699 2024-11-15 13:17:05 +03:00
555b91e385 Merge branch 'develop' into feature/binary-reading-optimisation 2024-11-15 13:12:59 +06:00
9713138f4f Fix other currecyes csv reading 2024-11-14 21:02:02 +06:00
0934c2cda4 Add rtl csv reading for some currencyes 2024-11-14 19:44:47 +06:00
bb204098a1 Fix PDFCoordsToMM 2024-11-14 16:24:14 +03:00
c65e8d4a04 Merge branch 'develop' into feature/add-lcid-to-csv 2024-11-14 12:58:50 +06:00
a0cecd357f External libraries have been moved to 3dParty 2024-11-13 21:26:21 +03:00
6a4f30d6fa fix bug #59772 2024-11-13 20:30:11 +03:00
cfde4aa357 Add other currencyes 2024-11-13 19:05:11 +06:00
2a2f33fd6f Fix build 2024-11-13 10:34:59 +03:00
8ad76e4e1f Fix bug 68072 2024-11-13 01:33:43 +03:00
b0b3d6b280 Fix linux build 2024-11-12 20:33:49 +06:00
029e6c6df7 Merge branch hotfix/v8.2.1 into master 2024-11-12 12:49:59 +00:00
e8257896d4 Add loc date format csv writing 2024-11-12 17:45:41 +06:00
1e9a63083b Read CHTMLRenderer 2024-11-11 17:28:58 +03:00
2f525c1e4f Remove using iterator after remove it from list 2024-11-11 14:32:26 +03:00
40a1e15033 Merge branch 'develop' into feature/binary-reading-optimisation 2024-11-11 17:01:53 +06:00
6c93c8b16c Merge branch 'develop' into feature/add-lcid-to-csv 2024-11-11 13:07:37 +06:00
8813f8bb19 Merge remote-tracking branch 'origin/hotfix/v8.2.1' into develop 2024-11-10 20:47:25 +03:00
e979defdee Add param for disable own xml wrappers 2024-11-09 00:21:05 +03:00
cc585185dd Fix bug 71045 2024-11-08 23:03:58 +03:00
9a5240cbba For bug 70996 2024-11-08 19:58:09 +03:00
8e498c8299 Merge branch 'develop' into feature/add-lcid-to-csv 2024-11-08 20:59:58 +06:00
706a2252fa for bug #71510 2024-11-08 17:39:13 +03:00
d423549ae4 Add frtRecord skiping in rows and cols 2024-11-08 17:05:10 +06:00
cef0adda0a Add array formula reading 2024-11-08 16:23:53 +06:00
ab2ab7a407 Merge pull request 'Fix bug 71505' (#95) from fix/bug-71505 into hotfix/v8.2.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/95
2024-11-08 09:07:45 +00:00
62c401ae5b Refactoring 2024-11-08 11:51:12 +03:00
d73d682cbc Merge branch 'develop' into feature/binary-reading-optimisation 2024-11-08 13:07:38 +06:00
c470363ec0 Fix template parameter redefines default argument 2024-11-08 10:01:50 +03:00
25be50f058 Fix unresolved external symbol, delete include 2024-11-07 22:55:12 +03:00
10931f937a implementation moved to cpp 2024-11-07 21:49:12 +03:00
647c8a3cde Without template 2024-11-07 18:39:20 +03:00
1d4f9b5c41 Reduce _CSoftMask 2024-11-07 18:21:41 +03:00
3de464a31e for bug #71527 2024-11-07 18:01:24 +03:00
3429e8b345 Fix bug 71505 2024-11-07 17:05:16 +03:00
b3f5d84a51 Fix bug #71477 2024-11-07 18:26:12 +05:00
23c2ecfe54 Add shared formula reading 2024-11-07 19:08:42 +06:00
485dcb5272 Fix write int in StringBuilder 2024-11-07 14:27:22 +03:00
1c9a9f53e3 fix bug #52676 2024-11-07 12:35:40 +03:00
62ad5bf127 Add cell metadata conversion from bin 2024-11-07 14:21:22 +06:00
ecc1e974ae fix bug #53487 2024-11-07 11:06:27 +03:00
ef61b90242 Remove unused sheet data params from conversion 2024-11-07 14:01:31 +06:00
00bdf67b8a Merge branch 'develop' into feature/binary-reading-optimisation 2024-11-07 13:03:31 +06:00
ee83f6c826 Merge remote-tracking branch 'origin/hotfix/v8.2.1' into develop 2024-11-07 09:56:08 +03:00
ec50e77695 HtmlRenderer research 2024-11-06 16:22:19 +03:00
72fbe98925 fixing bugs with indices and brackets 2024-11-06 15:48:23 +03:00
4ef62b88cb Revert "Add quick binary reading method"
This reverts commit ac7614c4e6.
2024-11-06 18:37:57 +06:00
3e8d5926ba Revert "Add string conversion optimisation"
This reverts commit cf66adea28.
2024-11-06 18:34:45 +06:00
0284c8df70 Add table cell conversion 2024-11-06 18:31:50 +06:00
3d4faa267e add normal formula conversion 2024-11-06 16:11:35 +06:00
edc0ae2b8d Fix switch-case-break 2024-11-06 10:58:50 +03:00
ebaf0eb43a Fix bug with patch transform & unused memory 2024-11-06 07:35:46 +00:00
eab40d6bb2 fix bug #71478 2024-11-05 18:31:23 +03:00
e7d081aefb Add other cell value types conversion 2024-11-05 21:26:35 +06:00
cc2867e292 Fixed calculation of the conversion matrix in media file conversion 2024-11-05 18:05:09 +03:00
8e51f9bdbb for bug #71449 2024-11-05 18:01:01 +03:00
92b0f4e654 Updated calculation of line width in metafile conversion 2024-11-05 17:09:20 +03:00
46d4d76f26 Add datacell conversion 2024-11-05 18:41:42 +06:00
53593c96af Add direct from bin reading sheet data method 2024-11-05 17:11:06 +06:00
21f75547fb Remove unused code 2024-11-05 14:32:27 +06:00
ac8c99415f fix bug #71415 2024-11-02 19:26:45 +03:00
0daee49007 Add eny delimeter date reading 2024-11-02 19:16:53 +06:00
5a6a2f800f Fix bug 65824 2024-11-02 15:21:53 +03:00
8e3df35232 Add short months reading and writing 2024-11-02 17:49:39 +06:00
521d7c1ee8 Add short month names 2024-11-02 16:31:27 +06:00
f1e80adb9c Merge branch 'develop' into feature/add-lcid-to-csv 2024-11-02 14:22:08 +06:00
3503eee5b6 Create GetGlyphs for PdfFile 2024-11-02 10:00:44 +03:00
1041802214 Fix build 2024-11-02 09:31:07 +03:00
cebc04b852 Unused functionality has been removed 2024-11-02 00:11:02 +03:00
dbfdffd0c5 Fixed missing text in the specified font in the metafile 2024-11-01 23:28:42 +03:00
b8d2cba3ae Refactoring 2024-11-01 22:15:03 +03:00
b56d62442d Added the ability to set shape-rendering in metafile to svg conversion 2024-11-01 21:21:44 +03:00
5d70f47ebc Add lcid long month writing 2024-11-01 21:37:12 +06:00
859351a8d1 Add 14 format csv local writing 2024-11-01 20:36:36 +06:00
fbd408ec6d Add lcid using to csvwriter 2024-11-01 19:32:49 +06:00
c631b62e51 Merge branch 'develop' into feature/add-lcid-to-csv 2024-11-01 17:23:04 +06:00
1286dbaaaf Fix bug with numeric limits 2024-11-01 10:13:57 +00:00
1dbeea42b8 Fix build 2024-11-01 11:18:11 +03:00
0dc65baa25 Merge remote-tracking branch 'origin/hotfix/v8.2.1' into develop 2024-11-01 10:51:12 +03:00
50fec65617 Added support for custom markers in metafile to svg conversion 2024-11-01 10:48:36 +03:00
a5ea301e3e fix bug #71334 2024-11-01 10:22:21 +03:00
fb40437d21 fix bug #53148 2024-11-01 09:37:20 +03:00
cf66adea28 Add string conversion optimisation 2024-10-31 20:47:43 +06:00
42466cf648 Fix atan2 custom shape formula conversion 2024-10-31 18:08:36 +05:00
2b00698810 Add support iwork formats 2024-10-31 15:06:46 +03:00
b00fbeff53 Fix bug #69024 2024-10-31 09:42:40 +00:00
819d1fad17 fix bug #71349 2024-10-31 11:24:20 +03:00
97f0958f09 Merge branch 'develop' into feature/binary-reading-optimisation 2024-10-31 14:00:28 +06:00
ce88c4ca95 Fix pattern bbox offset 2024-10-30 17:58:01 +03:00
ac7614c4e6 Add quick binary reading method 2024-10-30 19:06:23 +06:00
a69a992a0d Fix bug 71330 2024-10-30 16:04:57 +03:00
b4bb20bea7 Fixed a bug with dotted lines in metafiles 2024-10-30 14:53:25 +03:00
949aed7bb4 Fix bug 71045 2024-10-30 14:17:48 +03:00
2ce37e34c4 Fixed a bug with incorrect positioning in EmfPlus 2024-10-30 14:06:12 +03:00
6ec4191483 Fix bug 71308 2024-10-30 12:30:33 +03:00
3401c2b02e Fix bug 70986 2024-10-29 15:05:49 +03:00
0dd0ad0023 Fix unbalanced text operator 2024-10-29 14:50:06 +03:00
8cf7809359 Fix unbalanced text operator 2024-10-29 14:45:27 +03:00
277dd4a464 Merge branch 'hotfix/v8.2.1' into develop 2024-10-29 14:37:45 +03:00
cb8466de27 Fix merge 2024-10-29 14:18:38 +03:00
1c2501eeb1 Merge pull request 'release/v8.2.0' (#85) from release/v8.2.0 into hotfix/v8.2.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/85
2024-10-29 10:50:11 +00:00
0d443743a8 Merge pull request 'fix/docx-renderer' (#79) from fix/docx-renderer into hotfix/v8.2.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/79
2024-10-29 10:49:29 +00:00
8c7a22b726 fix bug #70715 2024-10-29 13:39:55 +03:00
c8b8462d31 Support for embedded WMFs in emf is disabled 2024-10-29 12:15:50 +03:00
a14b3eb8e2 Fix bug 70952 2024-10-29 11:40:09 +03:00
6eaf590844 For bug #71100 2024-10-29 07:43:06 +00:00
fac279ba81 Fix bug #71100 2024-10-29 07:43:06 +00:00
571a7ee2d1 fix bug #71047 2024-10-29 10:13:34 +03:00
adb6d7bbc2 Remove debug logs by default 2024-10-28 21:22:40 +03:00
f7fa638591 Fix bug 69828 2024-10-28 19:11:56 +03:00
edfa558a38 Merge pull request 'Fix pdf widget AP' (#84) from fix/pdf-widget into hotfix/v8.2.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/84
2024-10-28 15:11:26 +00:00
b80ada4b4e Fix old server 2024-10-28 18:06:04 +03:00
492b821472 Fix old server 2024-10-28 17:44:50 +03:00
d75a3a5587 Merge branch 'develop' into feature/add-lcid-to-csv 2024-10-28 19:48:07 +06:00
a8ce7eaad3 Fix crash on v8 engine 2024-10-28 15:49:28 +03:00
8cf78b9e58 Fix write listbox 2024-10-28 15:40:28 +03:00
28bcfafcc6 Fix change font 2024-10-28 15:40:28 +03:00
e527db9515 Write Text Widget AP 2024-10-28 15:40:27 +03:00
db2660a1a3 Text Widget write 2024-10-28 15:40:26 +03:00
77b5ffb56d Fix write listbox 2024-10-28 15:19:04 +03:00
ca70de93a4 Removed memory leak 2024-10-28 15:09:37 +06:00
04565bbdd4 Fix change font 2024-10-28 11:55:01 +03:00
4266857c6e Merge branch 'develop' into feature/binary-reading-optimisation 2024-10-28 14:03:16 +06:00
8e6e510cd6 fix bug #71238 2024-10-26 18:11:29 +03:00
03919dcb33 fix bug #71238 2024-10-26 18:10:52 +03:00
46588b05b1 Merge pull request 'fix/nativeDraw' (#82) from fix/nativeDraw into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/82
2024-10-26 13:32:02 +00:00
dc0ea6a7f3 Add fromJS functionality for Images 2024-10-26 16:28:48 +03:00
a84c8cc471 Add support Images in nativeEditors 2024-10-26 15:06:09 +03:00
986d0f0d95 Write Text Widget AP 2024-10-25 17:26:12 +03:00
cd1bb3b658 Merge pull request 'release/v8.2.0' (#81) from release/v8.2.0 into fix/nativeDraw
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/81
2024-10-25 13:44:43 +00:00
cd71bc0672 Fix build 2024-10-25 14:52:55 +03:00
6caf517fe5 Merge branch 'develop' into feature/binary-reading-optimisation 2024-10-25 17:11:07 +06:00
d65d37476e Fix csv date reading 2024-10-25 17:10:03 +06:00
14c9896773 Merge pull request 'Fix bug #71134' (#78) from fix/bug-71134 into hotfix/v8.2.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/78
2024-10-25 10:01:12 +00:00
19694bf32d Adjusted the definition of the possibility of obtaining a local image in html 2024-10-25 12:54:11 +03:00
ffe85bd64f fix bug ooxml->odf. writing tests 2024-10-25 12:31:12 +03:00
d4c4b804c7 Text Widget write 2024-10-25 10:44:39 +03:00
1de2807051 fix bug odf->ooxml(empty row in matrix) 2024-10-25 09:06:27 +03:00
96e1280082 fix bug #71076 2024-10-25 08:41:33 +03:00
ce41e42851 . 2024-10-25 07:38:01 +03:00
b414fb961e Develop native drawer 2024-10-25 00:57:02 +03:00
0370948e98 Merge pull request 'feature/cvalue-image' (#77) from feature/cvalue-image into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/77
2024-10-24 17:57:51 +00:00
ccbd9da871 Add externalize method to Image 2024-10-24 20:56:21 +03:00
cec8402adc Add tests 2024-10-24 20:57:34 +04:00
fd90f73c19 Add functionality 2024-10-24 20:57:29 +04:00
6447aeafa5 . 2024-10-24 15:03:37 +03:00
aa3e0759d7 Fix bug 71025 2024-10-24 11:40:47 +03:00
3db4bdc93f Fix bug 71169 2024-10-24 11:09:52 +03:00
3003c66eba Merge branch 'develop' into feature/binary-reading-optimisation 2024-10-24 13:09:40 +06:00
cc4c0dd68e Fix comment 2024-10-24 10:01:45 +03:00
5692bee77a Fix gradients in xps 2024-10-23 19:12:27 +03:00
e25a952279 Add reading acording record type 2024-10-23 22:12:07 +06:00
d6864e044a Fix curves intersection 2024-10-23 18:31:43 +03:00
ad69100d3f fix bug #70790 2024-10-23 17:28:22 +03:00
b05a95d54e Merge pull request 'Fixed bugs in metafile conversion' (#74) from fix/Metafile into hotfix/v8.2.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/74
2024-10-23 12:00:38 +00:00
87a09faefb Fix bug #71134 2024-10-23 14:39:51 +03:00
5e35517d71 Merge pull request 'Fix hlinx binary reading' (#75) from fix/bug71042 into hotfix/v8.2.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/75
2024-10-23 11:30:53 +00:00
ca94882699 Fix hlinx binary reading 2024-10-23 17:27:21 +06:00
894f78d143 Get Stamp stream AP 2024-10-22 13:25:02 +03:00
eeac44a1ab Add word months parsing 2024-10-22 15:56:19 +06:00
77ece713ee fix bug #71042 2024-10-22 10:50:04 +03:00
a8e3dd2ef5 Fix FreeText generate AP 2024-10-21 18:32:53 +03:00
20a2aa1ef1 Draw Stamp 2024-10-21 18:32:36 +03:00
7d10e1e995 Add space separeted date conversion 2024-10-21 21:14:40 +06:00
c3531cb19c Add month names to local info 2024-10-21 19:05:49 +06:00
ba6de346dc Merge branch 'develop' into feature/add-lcid-to-csv 2024-10-21 13:31:43 +06:00
5b44611560 write alternative in binary 2024-10-20 20:27:27 +03:00
f2aa34b5ce Fix bug 70835 2024-10-18 17:42:19 +03:00
d43a724ee6 Fix drop cap logic 2024-10-18 16:20:07 +03:00
cba68e2d2a Add am-pm parsing 2024-10-18 19:14:19 +06:00
f8dd9fb085 Merge remote-tracking branch 'origin/fix/pfg-bugs' into develop 2024-10-18 14:04:47 +03:00
39e95e8b49 Merge remote-tracking branch 'origin/develop' into fix/pfg-bugs 2024-10-18 14:02:28 +03:00
b98922dbfd Fix style PdfAnnot 2024-10-18 13:59:26 +03:00
f57af6ecc1 Refactoring 2024-10-18 13:56:13 +03:00
af77bf3f77 Fix bug 70795 2024-10-18 13:42:51 +03:00
4578731001 Merge branch 'fix/fix-bugs-8.2.1' into hotfix/v8.2.1 2024-10-18 13:33:19 +03:00
72566e8064 Fix bug #70873 2024-10-18 13:32:37 +03:00
346f0e9dd0 Fixed a problem with writing the font name in metafile to svg conversion 2024-10-18 13:25:42 +03:00
e32bd8fd96 Fixed calcalate final transform 2024-10-18 13:25:30 +03:00
de51108ba7 Fixed unnecessary insertion of xml in an html document 2024-10-18 13:24:32 +03:00
83a6e52df2 Fix clip reset 2024-10-18 12:21:32 +03:00
b2e807ec33 Merge branch 'develop' into feature/add-lcid-to-csv 2024-10-18 13:29:46 +06:00
1eba4aefa8 Stamp Rotate 2024-10-18 10:03:11 +03:00
956508f994 Add date with time parsing 2024-10-17 21:16:22 +06:00
4eb761eec3 fix bug #71000 2024-10-17 16:48:29 +03:00
e27415bb84 Merge remote-tracking branch 'origin/release/v8.2.0' into develop 2024-10-17 15:32:17 +03:00
2afbd3c429 Add local datetimeParsing 2024-10-17 17:44:31 +06:00
baf9fb4a93 Merge branch release/v8.2.0 into master 2024-10-17 11:10:05 +00:00
0b8e833e77 fix bug #69488 2024-10-17 10:06:45 +03:00
94bb0f5306 Fix bug 70987 2024-10-16 17:23:50 +03:00
8cadb329b9 Fix for Stamp 2024-10-16 17:18:21 +03:00
af7cb378ac Merge branch 'develop' into feature/add-lcid-to-csv 2024-10-16 13:12:11 +06:00
81e075e715 . 2024-10-15 18:36:45 +03:00
f7607e1c92 Add short date format building 2024-10-15 20:35:31 +06:00
1022d29fe8 Merge remote-tracking branch 'origin/release/v8.2.0' into fix/pfg-bugs 2024-10-15 16:29:36 +03:00
fc3ce62ec7 fix bug #70698 2024-10-15 08:50:11 +00:00
3fac5441cb Merge branch 'release/v8.2.0' into fix/fix-bugs-8.2.1 2024-10-15 11:09:22 +03:00
32bd8166d7 for bug #60796 2024-10-15 11:07:47 +03:00
4acdd6dd20 Fix bug 70888 2024-10-14 22:18:52 +03:00
518a4ddb2b Fix bug 70840 2024-10-14 15:06:44 +00:00
895082cc93 Fix bug 70823 2024-10-14 15:06:44 +00:00
f16fa656e9 Fix types 2024-10-14 14:46:46 +00:00
f16318aebb Add check ooxml limits 2024-10-14 14:46:46 +00:00
d8d540bd02 Add local info class 2024-10-14 20:35:01 +06:00
a5c28b72bb for bug #70894 2024-10-14 17:04:27 +03:00
290d50ebcc Fix empty contents 2024-10-14 15:11:25 +03:00
3de1152a3f Fix bug 70813 2024-10-14 13:43:07 +03:00
93900a0be8 Fix Helvetica for empty Contents in FreeText 2024-10-14 13:40:24 +03:00
9ba32e031d Added Lcid using in csv conversion 2024-10-14 15:51:50 +06:00
109c891c1b Improve used memory 2024-10-14 10:34:46 +03:00
1b2d803976 For bug 70792. Improve memory usage in the AddCurveIntersection method 2024-10-14 09:46:00 +03:00
9f4613b15c Fix bug 70578 2024-10-13 11:09:35 +03:00
d69e4ca0ba . 2024-10-11 21:35:36 +03:00
ab7e8a07be Fixed bugs with clipping images in metafile conversion 2024-10-11 20:23:53 +03:00
7603aceee1 Optimization of image reflection in metafiles 2024-10-11 20:14:13 +03:00
7ea66d0bee For bug #70825 2024-10-11 20:14:02 +03:00
0e8230cc7f Fix inverseTransform in metafile conversion 2024-10-11 20:13:35 +03:00
ef2963242a Fix OShapes ID after editing 2024-10-11 17:39:42 +03:00
0229d928ab Fix bug 70825 2024-10-11 16:54:25 +03:00
cbfc2d5052 For FreeText read, fix test 2024-10-11 11:52:42 +03:00
1a979fe30a Fix Byte to Guchar 2024-10-11 11:48:21 +03:00
ff2146b671 Create read/write Stamp annot 2024-10-11 11:47:29 +03:00
4bdea2d154 fix bug #70717 2024-10-11 11:14:10 +03:00
d1d5a46896 writing tests 2024-10-11 10:17:21 +03:00
751a5d4d7d Fix bug 69723 2024-10-10 23:02:33 +03:00
dcc4342483 Merge pull request 'feature add pivot hierarchies' (#64) from feature/add-pivot-hierarchies into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/64
2024-10-10 14:41:45 +00:00
ef5e71e941 Merge pull request 'Fix bug #69169' (#63) from fix/bug69169 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/63
2024-10-10 14:41:28 +00:00
5c1b611b88 Fix bug #69169 2024-10-10 20:07:39 +06:00
4b1bd2fb70 fix bug #70790 2024-10-10 15:28:26 +03:00
cbbf650c56 Fix bug #69036 2024-10-10 09:50:29 +00:00
b55cd751d1 Merge branch 'release/v8.2.0' of git.onlyoffice.com:ONLYOFFICE/core into release/v8.2.0 2024-10-10 12:22:01 +03:00
c7d5b60637 Fix ios build 2024-10-10 12:21:55 +03:00
666f5c2f9e fix bug #70778 2024-10-10 10:34:51 +03:00
42b432b4de Add engine for base32 2024-10-10 02:59:18 +03:00
c6e15b7526 Fix bug 61203 2024-10-09 17:44:25 +03:00
08ca60091c Fix bug 70130 2024-10-09 16:10:00 +03:00
88d9827d3f Fix bug 70129 2024-10-09 16:06:42 +03:00
bae672f718 Fix bug 68986 2024-10-09 15:51:19 +03:00
00344df9ad Fix for -D with brackets 2024-10-09 11:27:54 +03:00
d9902ba6f9 returned exconnections15 conversion 2024-10-09 14:27:38 +06:00
cfb060e142 Fix build 2024-10-09 11:05:28 +03:00
633af32919 Fix condfmt number conversion 2024-10-09 13:51:42 +06:00
0565e6164b Add data for hard update hunspell module 2024-10-09 10:47:24 +03:00
306cc3f985 For bug 70578 2024-10-08 23:31:46 +03:00
2739dd3abd Fix bug 69154 2024-10-08 22:54:19 +03:00
70e6df5aae fix bug #70440 2024-10-08 22:00:45 +03:00
40d3cd1a85 Fix hierarchies reading with pcdh15 2024-10-08 18:41:59 +06:00
96030aa322 Set timelimits of dictionaries tester bigger 2024-10-08 15:18:40 +03:00
fee801eeeb Merge pull request 'Add custom timelimits logic in dictionariestester' (#59) from fix/dictionariestester into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/59
2024-10-08 11:55:37 +00:00
750273b526 Change timelimits 2024-10-08 14:51:48 +03:00
cfdb541c28 Add custom timelimits logic in dictionariestester 2024-10-08 14:36:30 +03:00
11121961d9 Fix typo 2024-10-08 08:47:12 +00:00
45828709ee Merge pull request 'Fix bug #70515' (#57) from fix/bug70515 into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/57
2024-10-08 08:15:23 +00:00
40916e5ccc Merge pull request 'Fix bug 60796' (#56) from fix/bug60796 into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/56
2024-10-08 08:07:18 +00:00
319610c58d Fix bug 60796 2024-10-08 10:22:32 +03:00
1837a2737e Fix RefTo id 2024-10-07 15:17:03 +00:00
686fc60860 For bug 61203 2024-10-07 15:17:03 +00:00
51216f27f4 Fix bug 70466 2024-10-07 17:47:12 +03:00
2eb33ddd22 Merge pull request 'Fix bug #70484' (#30) from fix/bug70484 into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/30
2024-10-07 14:05:10 +00:00
58c80b052b Merge pull request 'Fix bug #70492' (#34) from fix/bug70492 into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/34
2024-10-07 14:04:42 +00:00
5eee408eeb Merge pull request 'Fix bug #70617' (#54) from fix/bug70617 into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/54
2024-10-07 14:04:20 +00:00
32103b8b9f Add slicercachePivotCache ids binary reading 2024-10-07 19:38:07 +06:00
b6ae1f272c Fix bug #70617 2024-10-07 15:41:28 +05:00
045f23d921 Fix bug 68091 2024-10-07 02:46:38 +03:00
d06b52988c Fix bug 70352 2024-10-06 18:56:06 +00:00
4717b47388 Fix bug in metafile conversion 2024-10-06 17:11:32 +00:00
31ce9f6a18 Fix bug #66337 2024-10-06 17:11:32 +00:00
e44c9fa4c9 Fix bug #31062 2024-10-06 17:11:32 +00:00
3c59ba7a13 fixed a bug with the location of the embedded metafile 2024-10-06 17:11:32 +00:00
42e84249e8 For bug #68708 2024-10-06 17:11:32 +00:00
e2dbde8722 fix bug #70163 2024-10-06 11:43:33 +03:00
36c67d79d5 fix bug #70717 2024-10-06 11:17:16 +03:00
cdc14d22f0 fix bug #70684 2024-10-04 22:22:16 +03:00
baed05236b fix bug #70368 2024-10-04 20:41:18 +03:00
c644f94c0b fix bug #69104 2024-10-04 20:23:36 +03:00
1244ba5fe5 Fix pivot cache from bin conversion 2024-10-04 20:12:56 +06:00
087e4433f2 For bug 69977 2024-10-04 13:31:36 +00:00
bc11a5cf5f Fix bug 70574 2024-10-04 16:28:30 +03:00
d86303e290 Fix bug 69704 2024-10-03 15:44:14 +00:00
51f1faa51a Fix uncheckedsqrfx conversion to xlsx
(cherry picked from commit 9f62108376)
2024-10-03 18:12:10 +03:00
6775dccc2c Fix font tables 2024-10-03 13:29:46 +00:00
ee3b4c612d Merge pull request 'Fix bug 70563' (#45) from fix/bug-70563 into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/45
2024-10-03 12:37:44 +00:00
1144bb166c Remove using bitcode on ios 2024-10-03 14:19:08 +03:00
a9752208f6 Fix bug #70515 2024-10-03 15:43:45 +05:00
84016cf8cf Fix bug 70563 2024-10-03 13:00:18 +03:00
cb7edc373c Disable bitcode for ios builds with xcode 16+ 2024-10-03 12:11:31 +03:00
d1e43d68dc Fix getOriginPage 2024-10-03 11:47:04 +03:00
b5ab5f9b2b Fix bug 70559 2024-10-03 11:31:39 +03:00
761c5bec53 Fix detect allfonts path for builder 2024-10-03 00:11:28 +03:00
8cc7034c22 For bug 70566 2024-10-02 15:48:33 +00:00
ee1c385b54 Fix Bug 70566 2024-10-02 15:48:33 +00:00
ded640825b Fix alpha 2024-10-02 15:48:33 +00:00
84301531c8 . 2024-10-02 17:54:59 +03:00
66231b65c1 Add pivot cache other elements binari reading 2024-10-02 20:52:50 +06:00
7aa2d36d85 Add pivot hierarchies binary reading 2024-10-02 20:00:58 +06:00
310cd6d8fd Add full GetContext function 2024-10-02 13:51:43 +00:00
2d37cf634a Add new dependent libraries 2024-10-02 13:51:43 +00:00
04880b4e1d Merge pull request 'Fix bug 70590' (#41) from fix/bug-70590 into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/41
2024-10-02 13:38:15 +00:00
1000b5d5bd Merge pull request 'Add full GetContext function to docbuilder python wrapper' (#40) from feature/docbuilder-wrappers-getcontext into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/40
2024-10-02 12:56:45 +00:00
c324b4a11c Add to python wrapper 2024-10-02 16:02:23 +04:00
982d2d1872 edit start of conversion 2024-10-02 12:09:58 +03:00
a51fe4134c fix bug #68406 2024-10-01 19:37:56 +03:00
985d258bc1 Fix bug with rotated crop 2024-10-01 17:22:30 +03:00
71b1e4fbf3 Add pivot cache hierarchies binary reading 2024-10-01 18:39:57 +06:00
fee5c112b4 Merge pull request 'fix bug70534' (#37) from fix/bug70534 into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/37
2024-10-01 12:23:24 +00:00
9b50f9fbc2 Fix bug 68091 2024-10-01 14:43:27 +03:00
10f770fdbc Fix bug 70566 2024-10-01 13:10:52 +03:00
eb53c40135 fix 2024-10-01 12:32:29 +03:00
ded1655a04 Fix bug 70561 2024-10-01 12:20:54 +03:00
20c11889aa Fix bug 70590 2024-10-01 11:49:33 +03:00
910c2418d6 fix chartEx 2024-10-01 08:33:39 +03:00
e6ffdc0ae8 Merge remote-tracking branch 'origin/for-bug#68406' into release/v8.2.0 2024-09-30 19:27:52 +03:00
0335d330b8 Merge pull request 'Fix bug 69602' (#33) from fix/pdf-bugs into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/33
2024-09-30 14:55:14 +00:00
1a1ec927e2 Fix pivot cache conversion 2024-09-30 20:25:06 +06:00
af2e86e777 Fix name OUserID 2024-09-30 17:16:30 +03:00
bcf7d08c51 Fix bug 69602 2024-09-30 16:26:03 +03:00
11886dcdf7 Add user-id for annots 2024-09-30 15:05:39 +03:00
615d0b682c formula size calculation 2024-09-30 12:50:46 +03:00
535028fa0e For bug 70559 2024-09-30 12:44:09 +03:00
c421936857 Add pivot cache dimensions, measure groups and measure group maps binary conversion 2024-09-30 14:56:57 +06:00
3580e84184 Add measure groups and Dimension maps 2024-09-27 21:14:48 +06:00
5a6386e08b Fix bug #70492 2024-09-27 20:07:14 +05:00
1538997b63 Add pivot cache dimensions 2024-09-27 20:25:37 +06:00
7ca8b22160 fix bug #70518 2024-09-27 16:59:57 +03:00
ec16e247e9 Fix build 2024-09-27 13:39:27 +00:00
9a76575082 Fix bug 2024-09-27 13:39:27 +00:00
c1a586cb56 Fix bug 69974 2024-09-27 16:14:24 +03:00
7707aeb914 Fix NULL borderStyle in FreeText 2024-09-27 15:56:16 +03:00
50a8540f75 Fix build 2024-09-27 15:45:06 +03:00
bdb902128d Add slicerCache Pivot table part to xlsb writing 2024-09-27 17:37:27 +06:00
bb41c8b85f Merge branch 'develop' into feature/add-pivot-hierarchies 2024-09-27 13:33:06 +06:00
fbee170e87 fix build 2024-09-27 09:36:06 +03:00
cc2e755bca Fix bug 2024-09-26 15:18:30 +00:00
9c1efdeac2 Fix bug with text 2024-09-26 15:18:30 +00:00
ea1538bc11 Fix bug in xps 2024-09-26 15:18:30 +00:00
c0d0fb6f5c Critical fix 2024-09-26 15:18:30 +00:00
5e5e07b406 Fix bug 67321 2024-09-26 15:18:30 +00:00
9b5f762420 Fix bug #70484 2024-09-26 17:35:25 +05:00
7020548f06 Merge pull request 'Fix bug 69009' (#28) from fix/docx-renderer into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/28
2024-09-26 10:43:03 +00:00
2d2e15671a Fix bug 69009 2024-09-26 13:36:28 +03:00
115917b9e5 fix build 2024-09-26 12:39:21 +03:00
00ad32d420 Merge pull request 'For bug #70040' (#27) from fix/bug70040 into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/27
2024-09-26 08:23:58 +00:00
c67b78508e Merge branch 'develop' into feature/add-pivot-hierarchies 2024-09-26 13:53:16 +06:00
ba2cf66c31 Fix build 2024-09-26 10:44:12 +03:00
57ed9d0c32 Fix build 2024-09-26 06:15:42 +00:00
40d82f3287 Fix 2024-09-26 06:15:42 +00:00
9bdcbf0d89 Rollback std::vector 2024-09-26 06:15:42 +00:00
c1774219ec Fix pdf editor build 2024-09-26 06:15:42 +00:00
2a6f0bb1b6 Close any clip-path fix 2024-09-26 06:15:42 +00:00
a23ce22950 Add unit-tests 2024-09-26 06:15:42 +00:00
b4f0d32b6d Fix bugs 2024-09-26 06:15:42 +00:00
83db7f2165 Remove STL from export 2024-09-26 06:15:42 +00:00
3ce03d897d Fix bug 2024-09-26 06:15:42 +00:00
be12237042 Fix bug 2024-09-26 06:15:42 +00:00
cf7252b92d Fix bounds 2024-09-26 06:15:42 +00:00
523f3f24f9 Fix wrong bounds 2024-09-26 06:15:42 +00:00
0196a4bb57 Fix one inters 2024-09-26 06:15:42 +00:00
9ee9192cd4 Refactoring 2024-09-26 06:15:42 +00:00
5df63a58b7 Add more bullets 2024-09-26 06:15:42 +00:00
d107bd5df2 Fix unused font names in PDF 2024-09-26 06:15:42 +00:00
f51c1fced2 Fix bug 69109 2024-09-26 06:15:42 +00:00
86cba0bdcd Fix bug 70340 2024-09-26 06:15:42 +00:00
cceec83568 Transition from pointers to smart pointers 2024-09-26 06:15:42 +00:00
f733543b44 Fix memory leak 2024-09-26 06:15:42 +00:00
bb9d777c14 Refactoring 2024-09-26 06:15:42 +00:00
694dd852d0 Fix bug 2024-09-26 06:15:42 +00:00
18a18eaa40 Fix linux build 2024-09-26 06:15:42 +00:00
fb021b33ec Add limits 2024-09-26 06:15:42 +00:00
95ecd8468a Refactoring 2024-09-26 06:15:42 +00:00
fbb57d7009 Fix memory leak 2024-09-26 06:15:42 +00:00
22e9873208 Done gradients support 2024-09-26 06:15:42 +00:00
2581e9235d Develop rtl support 2024-09-26 06:15:42 +00:00
270fd0601f Fix close path 2024-09-26 06:15:42 +00:00
5f69b4f8e6 Fix bug with gradient 2024-09-26 06:15:42 +00:00
bdaf9fa10b Fix bug 2024-09-26 06:15:42 +00:00
77e64af80c Fix bug with gradient 2024-09-26 06:15:42 +00:00
6e3beac6bf Fix one point inters and refactoring 2024-09-26 06:15:42 +00:00
641297ac48 Fix bug with non-closed-paths 2024-09-26 06:15:42 +00:00
dcca1f06f4 Developing gradients 2024-09-26 06:15:42 +00:00
22d7cfb240 Fix bug 2024-09-26 06:15:42 +00:00
fa51ea21b4 Developing gradient support 2024-09-26 06:15:42 +00:00
7632be9f2f Fix stack overflow 2024-09-26 06:15:42 +00:00
cbf40d36f5 Develop gradient support (in porgress) 2024-09-26 06:15:42 +00:00
2b8e70e67f Add compound paths 2024-09-26 06:15:42 +00:00
4b05eb9a50 Indents fix + gitignore 2024-09-26 06:15:42 +00:00
3221e41e89 Add subtraction for all overlap 2024-09-26 06:15:42 +00:00
58cc6cf6e8 Fix epsilon 2024-09-26 06:15:42 +00:00
c86a8edd30 Fix 2024-09-26 06:15:42 +00:00
db1d6a935f Add metainfo in ToXmlPptx (CContText)
+ fix main in test
2024-09-26 06:15:42 +00:00
cb9589f6b4 Fix curve for pdf 2024-09-26 06:15:42 +00:00
cbad285a9f FIx curve conversion 2024-09-26 06:15:42 +00:00
82a3fa6132 Fix 2024-09-26 06:15:42 +00:00
0821eefbd3 Add figure "Cross" to test 2024-09-26 06:15:42 +00:00
38a9dfcd14 Fix subtract 2024-09-26 06:15:42 +00:00
0f222c15e9 Fix all overlap 2024-09-26 06:15:42 +00:00
d0a554c701 Fix overlap paths 2024-09-26 06:15:42 +00:00
acfec0ceb1 Rollback 2024-09-26 06:15:42 +00:00
899b27d697 Fix bug with stride for adobe 2024-09-26 06:15:42 +00:00
5a5db3e8c6 Fix bug with close 2024-09-26 06:15:42 +00:00
57fdf7eed5 Add test for negative vertices 2024-09-26 06:15:42 +00:00
7f13020f2f Fix bug with no clear clip vector 2024-09-26 06:15:42 +00:00
020298b023 Update clip logic
crop
2024-09-26 06:15:42 +00:00
8eb249056b Fix negative vertices 2024-09-26 06:15:42 +00:00
2ed7e803ca Fix 2024-09-26 06:15:42 +00:00
b9230ef5ff Develop clip + tile images 2024-09-26 06:15:42 +00:00
3907110e44 Fix + refactoring 2024-09-26 06:15:42 +00:00
787575a53f Fix including paths 2024-09-26 06:15:42 +00:00
b58554a3da Refactorting
in progress
2024-09-26 06:15:42 +00:00
9e8c0dfb16 Add clip logic
clip on clip is not working for now
2024-09-26 06:15:42 +00:00
6831820dd4 Fix 2024-09-26 06:15:42 +00:00
cac79cb66e Refactor includes + fix build dll 2024-09-26 06:15:42 +00:00
323213a63d Refacoring 2024-09-26 06:15:42 +00:00
473ef17be3 Fix 2024-09-26 06:15:42 +00:00
5e56d26a06 Fix bugs 2024-09-26 06:15:42 +00:00
a390c1ee18 Fix 2024-09-26 06:15:42 +00:00
4158ebcd98 FIx 2024-09-26 06:15:42 +00:00
7fc65a84ab Fix 2024-09-26 06:15:42 +00:00
69ffd656af Fix 2024-09-26 06:15:42 +00:00
cb929fc5c5 Fix 2024-09-26 06:15:42 +00:00
7cd7c9f98f Refactoring Winding 2024-09-26 06:15:42 +00:00
015c10495c Refactoring 2024-09-26 06:15:42 +00:00
e973c8f70b Refactoring test 2024-09-26 06:15:42 +00:00
a77987488b Refactoring 2024-09-26 06:15:42 +00:00
1cfd17e2f3 Fix and Refactoring 2024-09-26 06:15:42 +00:00
b4c6f69cee Add Test for Clip 2024-09-26 06:15:42 +00:00
67194499a8 Fix 2024-09-26 06:15:42 +00:00
9ec6489083 Fix 2024-09-26 06:15:42 +00:00
3971400c78 Fix 2024-09-26 06:15:42 +00:00
e21ed47019 Finish CGraphicsPathClip 2024-09-26 06:15:42 +00:00
2cf83df7d0 add new methods for clip 2024-09-26 06:15:42 +00:00
7f96336e75 add mathematical functions for clip 2024-09-26 06:15:42 +00:00
99da1e3b8c Move CPathForClip methods to CGraphicsPath 2024-09-26 06:15:42 +00:00
6d152880bd Add Clip lib for GraphicsPath 2024-09-26 06:15:42 +00:00
dd9fca2a5c Fix hor/ver shape trough logic 2024-09-26 06:15:42 +00:00
67043cf718 Fix & add logic 2024-09-26 06:15:42 +00:00
ba239f139d Images -> shapes 2024-09-26 06:15:42 +00:00
a99733c5a1 Fix bug 70119 2024-09-25 23:42:03 +03:00
a60bc542c7 Fix bug 70043 2024-09-25 14:36:12 +00:00
97d36fa1cd Fix multiline Text Widget indentation 2024-09-25 14:36:12 +00:00
87fa0f93be Fix bug 69972 2024-09-25 14:36:12 +00:00
29a48da730 Fix bug 69976 2024-09-25 14:36:12 +00:00
3d38fdd005 refactoring math 2024-09-25 17:14:45 +03:00
e0352541be Fix bug 69990 2024-09-25 16:53:33 +03:00
2e26a3697d For bug #70040 2024-09-25 18:23:21 +05:00
cd124d5112 Fix page sizes on build pdf file 2024-09-25 15:28:08 +03:00
296dba3a4e Add hierarhcies usage binary conversion 2024-09-25 17:43:28 +06:00
38457c0115 Merge remote-tracking branch 'origin/release/v8.2.0' into develop 2024-09-25 14:27:11 +03:00
40789fbd24 Merge pull request 'Add OOXml2Odf' (#24) from feature/OOXml2Odf into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/24
2024-09-25 11:25:03 +00:00
4adc16620b Add hierarchies usage 2024-09-25 16:58:46 +06:00
0bfe049e84 bug fix 2024-09-25 13:04:23 +03:00
4242d32d95 Fix release build 2024-09-25 12:18:18 +03:00
a6b5e7e010 Merge remote-tracking branch 'origin/release/v8.2.0' into release/v8.2.0 2024-09-24 22:05:25 +03:00
57800ec8dd fix bug #33177 2024-09-24 21:46:58 +03:00
0f3de35eb4 Fix bug 69927 2024-09-24 21:44:52 +03:00
8c83b18216 fix bug #70440 2024-09-24 21:23:16 +03:00
e1c2bf19d9 Fix build 2024-09-24 18:08:40 +03:00
a6d8deedcd editing parse and converting text string 2024-09-24 17:30:39 +03:00
26b69e8612 Fix hierarchy members 2024-09-24 19:49:27 +06:00
9fa00c8609 Add pivot hierarchies binary conversion 2024-09-24 18:30:09 +06:00
f38767ccbb Merge pull request 'Fix bug #69036' (#22) from fix/bug-69036 into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/22
2024-09-24 11:25:57 +00:00
fc94de8549 Refactoring and improving the debug mod 2024-09-24 11:48:59 +03:00
812fae8f6c Fix bug #69036 2024-09-24 11:46:34 +03:00
c938e2756e Merge pull request 'Fix bug #44363' (#20) from fix/bug44363 into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/20
2024-09-24 07:23:22 +00:00
5679a7902f Merge pull request 'Fix placeholder styles conversion' (#19) from fix/placeholder_conversion into release/v8.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/19
2024-09-24 07:22:22 +00:00
59bb3035bb Add xml hierarchies writing 2024-09-23 20:25:46 +06:00
dbb757a954 Add pivot table hierarchies xml reading 2024-09-23 18:28:50 +06:00
0af65b1137 Convert odp placeholder styles to pptx 2024-09-23 16:44:16 +05:00
55a2fb1b00 Add pivot table hierarchies structures 2024-09-23 16:07:49 +06:00
4c44edc9c9 Merge branch 'fix/bug70318' into fix/placeholder_conversion 2024-09-21 00:07:59 +05:00
e9c200e455 Add xml writing of hierarchies 2024-09-20 17:40:03 +06:00
887898fe58 Add group levels bin conversion 2024-09-19 17:21:21 +06:00
db28751875 Fix placeholder conversion 2024-09-18 22:02:54 +05:00
627d02b006 Add group levels xml reading 2024-09-18 21:24:40 +06:00
c9fad9a83f Add group levels 2024-09-18 18:51:28 +06:00
9b05fa38ea Add remained fields to pivotHierarchy 2024-09-18 17:14:52 +06:00
7062a26561 Add binari conversion of pivot hierarchies 2024-09-17 21:25:02 +06:00
311d35f332 Add pivot cache Hierarchies 2024-09-16 20:02:52 +06:00
a7fb914f5e Merge pull request 'fix xlsb conversion errors' (#12) from fix/xlsb-conversion-errors into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/12
2024-09-16 13:48:15 +00:00
c068fd2ee0 Fix richStr conversion 2024-09-13 21:01:42 +06:00
cfbb7d1216 index conversion, correction of brackets and fraction conversion 2024-09-13 17:47:23 +03:00
abd2421cc1 Merge branch hotfix/v8.1.3 into develop 2024-09-13 10:37:28 +00:00
592fbfccbb Fix cfvo formula conversion 2024-09-12 18:12:52 +06:00
cf51a10da9 Fix pivot table conversion 2024-09-11 19:22:03 +06:00
5f2c00a017 Fix databar conversion 2024-09-10 21:46:11 +06:00
6a2d3838ae Fix bug #70044 2024-09-10 03:24:57 +05:00
bb7b63c86e Add conditional formattings14 conversion 2024-09-09 18:46:47 +06:00
f6c48c1edb Fix bug #70039 2024-09-04 20:48:28 +05:00
00ccd7f7a0 Fix colors conversion for sparklines 2024-09-03 18:30:22 +06:00
4c9c79628f Fix bug #69957 2024-09-03 13:20:36 +05:00
3604ca9450 Fix row & col limits 2024-09-02 20:42:45 +06:00
01428dc78a Add data position check 2024-08-30 18:59:17 +06:00
8ae7e577f0 Test 2024-08-30 13:14:26 +03:00
d7922089ea Merge branch 'develop' into fix/xlsb-conversion-errors 2024-08-30 15:28:52 +06:00
3231593049 Fix number format code conversion 2024-08-30 15:27:14 +06:00
58c35139ea Merge branch 'fix/bug44363' of https://github.com/ONLYOFFICE/core into fix/bug44363
# Conflicts:
#	OdfFile/Reader/Format/text_elements.cpp
2024-08-29 19:41:23 +05:00
7d804f1c70 Fix bug #44363 2024-08-29 19:39:34 +05:00
41dcf2eac4 Fix SORTCOND conversion 2024-08-29 20:12:02 +06:00
9f62108376 Fix uncheckedsqrfx conversion to xlsx 2024-08-27 16:06:40 +06:00
0eedb80d36 Fix worksheet vew after xlsb2xlsx conversion 2024-08-26 21:10:44 +06:00
8daa8dd509 Fix table conversion to xlsx 2024-08-26 19:18:39 +06:00
8b82e48562 matrix conversion 2024-08-23 17:06:24 +03:00
2425a40d36 Fix other functions argument types 2024-08-23 17:33:14 +06:00
4384ca2274 Fix number value check 2024-08-23 15:12:25 +06:00
b3590d66f0 xml2odf test 2024-08-16 17:28:48 +03:00
14a8a4d8bb the algorithm for converting an array of strings 2024-08-09 18:07:32 +03:00
5b156d72c0 Fix bug #44363 2024-08-06 01:19:19 +03:00
7a9549633b conversion of indexes, operators and limits 2024-07-29 12:58:22 +03:00
8507c8d4d9 Adding text conversion, binary operators, and parentheses. 2024-07-12 21:14:07 +03:00
773 changed files with 53223 additions and 25826 deletions

2
.gitignore vendored
View File

@ -46,3 +46,5 @@ DesktopEditor/fontengine/js/common/freetype-2.10.4
.qtc_clangd
Common/3dParty/openssl/openssl/
msvc_make.bat

141
Apple/IWork.cpp Normal file
View File

@ -0,0 +1,141 @@
#include "IWork.h"
#include "../DesktopEditor/common/File.h"
#include "../DesktopEditor/common/Directory.h"
#include <libetonyek/libetonyek.h>
#include <libodfgen/OdtGenerator.hxx>
#include <libodfgen/OdsGenerator.hxx>
#include <libodfgen/OdpGenerator.hxx>
#include <libodfgen/test/StringDocumentHandler.hxx>
#include <memory>
#include <fstream>
class CIWorkFile_Private
{
public:
std::wstring m_sTempDirectory;
public:
CIWorkFile_Private()
{
}
~CIWorkFile_Private()
{
}
};
CIWorkFile::CIWorkFile()
{
m_internal = new CIWorkFile_Private();
}
CIWorkFile::~CIWorkFile()
{
delete m_internal;
}
#if !defined(_WIN32) && !defined(_WIN64)
#define DATA_TYPE_INPUTFILE std::string
#else
#define DATA_TYPE_INPUTFILE std::wstring
#endif
bool GetRVNGInputStream(const DATA_TYPE_INPUTFILE& sFile, std::shared_ptr<librevenge::RVNGInputStream>& oRVNGInputStream, libetonyek::EtonyekDocument::Type& oDocumentType)
{
oRVNGInputStream.reset(new librevenge::RVNGFileStream(sFile.c_str()));
oDocumentType = libetonyek::EtonyekDocument::TYPE_UNKNOWN;
const libetonyek::EtonyekDocument::Confidence confidence = libetonyek::EtonyekDocument::isSupported(oRVNGInputStream.get(), &oDocumentType);
return libetonyek::EtonyekDocument::CONFIDENCE_NONE != confidence;
}
IWorkFileType CIWorkFile::GetType(const std::wstring& sFile) const
{
//TODO:: так как на данный момент мы работает только напрямую с файлом, то работа с директорией нам пока не нужна
if (NSDirectory::PathIsDirectory(sFile))
return IWorkFileType::None;
std::shared_ptr<librevenge::RVNGInputStream> input;
libetonyek::EtonyekDocument::Type oDocumentType;
#if !defined(_WIN32) && !defined(_WIN64)
std::string sFileA = U_TO_UTF8(sFile);
if (!GetRVNGInputStream(sFileA, input, oDocumentType))
return IWorkFileType::None;
#else
if (!GetRVNGInputStream(sFile, input, oDocumentType))
return IWorkFileType::None;
#endif
switch (oDocumentType)
{
case libetonyek::EtonyekDocument::TYPE_PAGES:
return IWorkFileType::Pages;
case libetonyek::EtonyekDocument::TYPE_NUMBERS:
return IWorkFileType::Numbers;
case libetonyek::EtonyekDocument::TYPE_KEYNOTE:
return IWorkFileType::Keynote;
default:
break;
}
return IWorkFileType::None;
}
template<class Generator>
int Convert(const std::wstring& wsOutputFile, std::shared_ptr<librevenge::RVNGInputStream>& ptrInput, const std::wstring& wsPassword = L"", const std::wstring& wsTempDirectory = L"")
{
StringDocumentHandler content;
Generator generator;
generator.addDocumentHandler(&content, ODF_FLAT_XML);
bool bRes = libetonyek::EtonyekDocument::parse(ptrInput.get(), &generator);
if (!bRes)
return 1;
const std::string sOutputFileA = U_TO_UTF8(wsOutputFile);
std::ofstream output(sOutputFileA.c_str());
output << content.cstr();
if (output.bad())
return -1;
return 0;
}
int CIWorkFile::Convert2Odf(const std::wstring& sFile, const std::wstring& sOutputFile) const
{
//TODO:: так как на данный момент мы работает только напрямую с файлом, то работа с директорией нам пока не нужна
if (NSDirectory::PathIsDirectory(sFile))
return -1;
std::shared_ptr<librevenge::RVNGInputStream> input;
libetonyek::EtonyekDocument::Type oDocumentType;
#if !defined(_WIN32) && !defined(_WIN64)
std::string sFileA = U_TO_UTF8(sFile);
if (!GetRVNGInputStream(sFileA, input, oDocumentType))
return -1;
#else
if (!GetRVNGInputStream(sFile, input, oDocumentType))
return -1;
#endif
switch (oDocumentType)
{
case libetonyek::EtonyekDocument::TYPE_PAGES: return Convert<OdtGenerator>(sOutputFile, input);
case libetonyek::EtonyekDocument::TYPE_NUMBERS: return Convert<OdsGenerator>(sOutputFile, input);
case libetonyek::EtonyekDocument::TYPE_KEYNOTE: return Convert<OdpGenerator>(sOutputFile, input);
default:
break;
}
return -1;
}
void CIWorkFile::SetTmpDirectory(const std::wstring& sFolder)
{
m_internal->m_sTempDirectory = sFolder;
}

36
Apple/IWork.h Normal file
View File

@ -0,0 +1,36 @@
#ifndef _IWORKFILE_IWORKFILE_H
#define _IWORKFILE_IWORKFILE_H
#include <string>
#ifndef IWORK_USE_DYNAMIC_LIBRARY
#define IWORK_FILE_DECL_EXPORT
#else
#include "../DesktopEditor/common/base_export.h"
#define IWORK_FILE_DECL_EXPORT Q_DECL_EXPORT
#endif
enum class IWorkFileType
{
Pages = 0,
Numbers = 1,
Keynote = 2,
None = 255
};
class CIWorkFile_Private;
class IWORK_FILE_DECL_EXPORT CIWorkFile
{
private:
CIWorkFile_Private* m_internal;
public:
CIWorkFile();
~CIWorkFile();
IWorkFileType GetType(const std::wstring& sFile) const;
int Convert2Odf(const std::wstring& sFile, const std::wstring& sOutputFile) const;
void SetTmpDirectory(const std::wstring& sFolder);
};
#endif // _IWORKFILE_IWORKFILE_H

46
Apple/IWork.pro Normal file
View File

@ -0,0 +1,46 @@
QT -= core
QT -= gui
VERSION = 0.0.0.1
TARGET = IWorkFile
TEMPLATE = lib
CONFIG += shared
CONFIG += plugin
DEFINES += IWORK_USE_DYNAMIC_LIBRARY
CORE_ROOT_DIR = $$PWD/..
PWD_ROOT_DIR = $$PWD
include($$CORE_ROOT_DIR/Common/base.pri)
ADD_DEPENDENCY(kernel, UnicodeConverter)
INCLUDEPATH += \
$$PWD
core_android:DEFINES += NOT_USE_PTHREAD_CANCEL USE_FILE32API
# BOOST
CONFIG += core_boost_regex
include($$CORE_ROOT_DIR/Common/3dParty/boost/boost.pri)
# ZLIB
CONFIG += build_all_zlib build_zlib_as_sources
include($$PWD/../OfficeUtils/OfficeUtils.pri)
# LIBXML
CONFIG += core_static_link_xml_full
CONFIG += core_only_libxml
include($$PWD/../DesktopEditor/xml/build/qt/libxml2.pri)
#
include($$CORE_ROOT_DIR/Common/3dParty/apple/apple.pri)
# TEST
HEADERS += $$ODF_LIB_ROOT/test/StringDocumentHandler.h
SOURCES += $$ODF_LIB_ROOT/test/StringDocumentHandler.cxx
SOURCES += IWork.cpp
HEADERS += IWork.h

View File

45
Apple/test/main.cpp Normal file
View File

@ -0,0 +1,45 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "../IWork.h"
#include "../../DesktopEditor/common/File.h"
int main(int argc, char *argv[])
{
CIWorkFile oFile;
std::wstring sExamplesDir = NSFile::GetProcessDirectory() + L"/../examples";
oFile.Convert2Odf(sExamplesDir + L"/new.pages", sExamplesDir + L"/out_new.odt");
oFile.Convert2Odf(sExamplesDir + L"/old.pages", sExamplesDir + L"/out_old.odt");
return 0;
}

20
Apple/test/test.pro Normal file
View File

@ -0,0 +1,20 @@
CONFIG -= qt
QT -= core gui
TARGET = test
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
CORE_ROOT_DIR = $$PWD/../..
PWD_ROOT_DIR = $$PWD
include($$CORE_ROOT_DIR/Common/base.pri)
ADD_DEPENDENCY(UnicodeConverter, kernel, IWorkFile)
core_linux:include($$PWD/../../Common/3dParty/icu/icu.pri)
core_windows:LIBS += -lgdi32 -ladvapi32 -luser32 -lshell32
SOURCES += main.cpp
DESTDIR = $$PWD/build

8
Common/3dParty/apple/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Ignore everything in this directory
glm
mdds
librevenge
libodfgen
libetonyek
# Except this file
!.gitignore

View File

@ -0,0 +1,36 @@
INCLUDEPATH += $$PWD
# LIBREVENGE
REVENGE_LIB_ROOT = $$PWD/librevenge
INCLUDEPATH += \
$$REVENGE_LIB_ROOT/inc
HEADERS += $$files($$REVENGE_LIB_ROOT/inc/*.h, true)
HEADERS += $$files($$REVENGE_LIB_ROOT/src/lib/*.h, true)
SOURCES += $$files($$REVENGE_LIB_ROOT/src/lib/*.cpp, true)
# LIBODFGEN
ODF_LIB_ROOT = $$PWD/libodfgen
INCLUDEPATH += \
$$ODF_LIB_ROOT/inc
HEADERS += $$files($$ODF_LIB_ROOT/inc/libodfgen/*.hxx, true)
HEADERS += $$files($$ODF_LIB_ROOT/src/*.hxx, true)
SOURCES += $$files($$ODF_LIB_ROOT/src/*.cxx, true)
# LIBETONYEK
ETONYEK_LIB_ROOT = $$PWD/libetonyek
INCLUDEPATH += \
$$ETONYEK_LIB_ROOT/inc \
$$ETONYEK_LIB_ROOT/src/lib \
$$ETONYEK_LIB_ROOT/src/lib/contexts \
$$PWD/mdds/include \
$$PWD/glm
HEADERS += $$files($$ETONYEK_LIB_ROOT/inc/libetonyek/*.h, true)
HEADERS += $$files($$ETONYEK_LIB_ROOT/src/lib/*.h, true)
SOURCES += $$files($$ETONYEK_LIB_ROOT/src/lib/*.cpp, true)

View File

@ -0,0 +1,121 @@
import sys
sys.path.append('../../../../build_tools/scripts')
import base
import os
if not base.is_dir("glm"):
base.cmd("git", ["clone", "https://github.com/g-truc/glm.git"])
base.cmd_in_dir("glm", "git", ["checkout", "33b4a621a697a305bc3a7610d290677b96beb181", "--quiet"])
if not base.is_dir("mdds"):
base.cmd("git", ["clone", "https://github.com/kohei-us/mdds.git"])
base.cmd_in_dir("mdds", "git", ["checkout", "0783158939c6ce4b0b1b89e345ab983ccb0f0ad0"], "--quiet")
fix_cpp_version = "#if __cplusplus < 201402L\n"
fix_cpp_version += "#ifndef _MSC_VER\n"
fix_cpp_version += "namespace std {\n"
fix_cpp_version += " template<bool __v>\n"
fix_cpp_version += " using bool_constant = integral_constant<bool, __v>;\n\n"
fix_cpp_version += " template <class... _Types>\n"
fix_cpp_version += " using void_t = void;\n"
fix_cpp_version += "}\n#endif\n"
fix_cpp_version += "#endif\n\n"
fix_cpp_version += "namespace mdds {"
base.replaceInFile("./mdds/include/mdds/global.hpp", "namespace mdds {", fix_cpp_version)
if not base.is_dir("librevenge"):
base.cmd("git", ["clone", "https://github.com/Distrotech/librevenge.git"])
base.cmd_in_dir("librevenge", "git", ["checkout", "becd044b519ab83893ad6398e3cbb499a7f0aaf4", "--quiet"])
stat_windows = ""
stat_windows += "#if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)\n"
stat_windows += "#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)\n"
stat_windows += "#endif\n"
stat_windows += "#if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR)\n"
stat_windows += "#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)\n"
stat_windows += "#endif\n"
base.replaceInFile("./librevenge/src/lib/RVNGDirectoryStream.cpp", "#include <librevenge-stream/librevenge-stream.h>",
"#include <librevenge-stream/librevenge-stream.h>\n\n" + stat_windows)
fix_RVNG_H = "explicit RVNGFileStream(const char *filename);\n"
fix_RVNG_H += " #if defined(_WIN32) || defined(_WIN64)\n"
fix_RVNG_H += " explicit RVNGFileStream(const wchar_t *filename);\n"
fix_RVNG_H += " #endif\n"
base.replaceInFile("./librevenge/inc/librevenge-stream/RVNGStreamImplementation.h", "explicit RVNGFileStream(const char *filename);", fix_RVNG_H)
fix_RVNG_CPP_include = "#if defined(_WIN32) || defined(_WIN64)\n"
fix_RVNG_CPP_include += "#include <sys/stat.h>\n\n"
fix_RVNG_CPP_include += "static __inline int wstat(wchar_t const* const _FileName, struct stat* const _Stat)\n"
fix_RVNG_CPP_include += "{\n"
fix_RVNG_CPP_include += " _STATIC_ASSERT(sizeof(struct stat) == sizeof(struct _stat64i32));\n";
fix_RVNG_CPP_include += " return _wstat64i32(_FileName, (struct _stat64i32*)_Stat);\n";
fix_RVNG_CPP_include += "}\n"
fix_RVNG_CPP_include += "#endif\n\n"
fix_RVNG_CPP_include += "namespace librevenge"
base.replaceInFile("./librevenge/src/lib/RVNGStreamImplementation.cpp", "namespace librevenge", fix_RVNG_CPP_include)
fix_RVNG_CPP = "#if defined(_WIN32) || defined(_WIN64)\n"
fix_RVNG_CPP += "RVNGFileStream::RVNGFileStream(const wchar_t *filename) :\n"
fix_RVNG_CPP += " RVNGInputStream(),\n"
fix_RVNG_CPP += " d(new RVNGFileStreamPrivate())\n"
fix_RVNG_CPP += "{\n"
fix_RVNG_CPP += " d->file = _wfopen(filename, L\"rb\");\n"
fix_RVNG_CPP += " if (!d->file || ferror(d->file))\n"
fix_RVNG_CPP += " {\n"
fix_RVNG_CPP += " delete d;\n"
fix_RVNG_CPP += " d = 0;\n"
fix_RVNG_CPP += " return;\n"
fix_RVNG_CPP += " }\n\n"
fix_RVNG_CPP += " struct stat status;\n"
fix_RVNG_CPP += " const int retval = wstat(filename, &status);\n"
fix_RVNG_CPP += " if ((0 != retval) || !S_ISREG(status.st_mode))\n"
fix_RVNG_CPP += " {\n"
fix_RVNG_CPP += " delete d;\n"
fix_RVNG_CPP += " d = 0;\n"
fix_RVNG_CPP += " return;\n"
fix_RVNG_CPP += " }\n\n"
fix_RVNG_CPP += " fseek(d->file, 0, SEEK_END);\n\n"
fix_RVNG_CPP += " d->streamSize = (unsigned long) ftell(d->file);\n"
fix_RVNG_CPP += " if (d->streamSize == (unsigned long)-1)\n"
fix_RVNG_CPP += " d->streamSize = 0;\n"
fix_RVNG_CPP += " if (d->streamSize > (std::numeric_limits<unsigned long>::max)() / 2)\n"
fix_RVNG_CPP += " d->streamSize = (std::numeric_limits<unsigned long>::max)() / 2;\n"
fix_RVNG_CPP += " fseek(d->file, 0, SEEK_SET);\n"
fix_RVNG_CPP += "}\n"
fix_RVNG_CPP += "#endif\n\n"
fix_RVNG_CPP += "RVNGFileStream::~RVNGFileStream()"
base.replaceInFile("./librevenge/src/lib/RVNGStreamImplementation.cpp", "RVNGFileStream::~RVNGFileStream()", fix_RVNG_CPP)
if not base.is_dir("libodfgen"):
base.cmd("git", ["clone", "https://github.com/Distrotech/libodfgen.git"])
base.cmd_in_dir("libodfgen", "git", ["checkout", "8ef8c171ebe3c5daebdce80ee422cf7bb96aa3bc", "--quiet"])
if not base.is_dir("libetonyek"):
base.cmd("git", ["clone", "https://github.com/LibreOffice/libetonyek.git"])
base.cmd_in_dir("libetonyek", "git", ["checkout", "cb396b4a9453a457469b62a740d8fb933c9442c3", "--quiet"])
base.replaceInFile("./libetonyek/src/lib/IWORKTable.cpp", "is_tree_valid", "valid_tree")
cmd_args = sys.argv[1:]
use_gperf = False
for arg in cmd_args:
if '--gperf' == arg:
use_gperf = True
if use_gperf:
base_gperf_args = ["--compare-strncmp", "--enum", "--null-strings", "--readonly-tables", "--language", "C++"]
base_gperf_files = ["IWORKToken.gperf", "KEY1Token.gperf", "KEY2Token.gperf", "NUM1Token.gperf", "PAG1Token.gperf"]
for file in base_gperf_files:
base.cmd_in_dir("./libetonyek/src/lib", "gperf", base_gperf_args + [file, "--output-file", file[0:file.find(".")] + ".inc"])
else:
base.copy_dir_content("./headers", "./libetonyek/src/lib")

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,727 @@
/* C++ code produced by gperf version 3.0.1 */
/* Command-line: gperf --compare-strncmp --enum --null-strings --readonly-tables --language C++ --output-file KEY1Token.inc KEY1Token.gperf */
/* Computed positions: -k'1,3,6,9,14,$' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
#line 10 "KEY1Token.gperf"
#if defined __GNUC__
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
using namespace KEY1Token;
#line 18 "KEY1Token.gperf"
struct Token
{
const char *name;
int id;
};
#include <string.h>
/* maximum key range = 602, duplicates = 0 */
class Perfect_Hash
{
private:
static inline unsigned int hash (const char *str, unsigned int len);
public:
static const struct Token *in_word_set (const char *str, unsigned int len);
};
inline unsigned int
Perfect_Hash::hash (register const char *str, register unsigned int len)
{
static const unsigned short asso_values[] =
{
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 220, 612, 0, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 0, 0, 0, 0,
0, 0, 10, 612, 612, 612, 0, 612, 30, 15,
55, 612, 5, 60, 5, 612, 10, 612, 612, 612,
612, 612, 612, 612, 612, 0, 612, 20, 165, 115,
65, 0, 105, 135, 175, 60, 0, 0, 30, 145,
10, 5, 155, 10, 5, 30, 5, 200, 15, 20,
0, 190, 0, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612, 612, 612, 612, 612,
612, 612, 612, 612, 612, 612
};
register int hval = len;
switch (hval)
{
default:
hval += asso_values[(unsigned char)str[13]];
/*FALLTHROUGH*/
case 13:
case 12:
case 11:
case 10:
case 9:
hval += asso_values[(unsigned char)str[8]];
/*FALLTHROUGH*/
case 8:
case 7:
case 6:
hval += asso_values[(unsigned char)str[5]];
/*FALLTHROUGH*/
case 5:
case 4:
case 3:
hval += asso_values[(unsigned char)str[2]];
/*FALLTHROUGH*/
case 2:
case 1:
hval += asso_values[(unsigned char)str[0]];
break;
}
return hval + asso_values[(unsigned char)str[len - 1]];
}
const struct Token *
Perfect_Hash::in_word_set (register const char *str, register unsigned int len)
{
enum
{
TOTAL_KEYWORDS = 203,
MIN_WORD_LENGTH = 1,
MAX_WORD_LENGTH = 39,
MIN_HASH_VALUE = 10,
MAX_HASH_VALUE = 611
};
static const struct Token wordlist[] =
{
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0},
#line 199 "KEY1Token.gperf"
{"theme",theme},
{(char*)0},
#line 211 "KEY1Token.gperf"
{"tr",tr},
{(char*)0},
#line 196 "KEY1Token.gperf"
{"text",text},
#line 207 "KEY1Token.gperf"
{"title",title},
{(char*)0},
#line 198 "KEY1Token.gperf"
{"textbox",textbox},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 65 "KEY1Token.gperf"
{"element",element},
{(char*)0},
#line 132 "KEY1Token.gperf"
{"none",none},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0},
#line 175 "KEY1Token.gperf"
{"size",size},
{(char*)0}, {(char*)0},
#line 209 "KEY1Token.gperf"
{"tl",tl},
{(char*)0},
#line 206 "KEY1Token.gperf"
{"tile",tile},
#line 168 "KEY1Token.gperf"
{"serie",serie},
{(char*)0},
#line 221 "KEY1Token.gperf"
{"version",version},
{(char*)0},
#line 112 "KEY1Token.gperf"
{"line",line},
{(char*)0}, {(char*)0}, {(char*)0},
#line 174 "KEY1Token.gperf"
{"showZero",showZero},
{(char*)0},
#line 133 "KEY1Token.gperf"
{"notes",notes},
{(char*)0},
#line 188 "KEY1Token.gperf"
{"stroke-style",stroke_style},
{(char*)0},
#line 32 "KEY1Token.gperf"
{"axes",axes},
#line 172 "KEY1Token.gperf"
{"shape",shape},
{(char*)0},
#line 187 "KEY1Token.gperf"
{"stroke-color",stroke_color},
#line 166 "KEY1Token.gperf"
{"sequence",sequence},
{(char*)0},
#line 183 "KEY1Token.gperf"
{"start",start},
{(char*)0}, {(char*)0}, {(char*)0},
#line 182 "KEY1Token.gperf"
{"span",span},
#line 185 "KEY1Token.gperf"
{"steps",steps},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 93 "KEY1Token.gperf"
{"ident",ident},
{(char*)0}, {(char*)0}, {(char*)0},
#line 134 "KEY1Token.gperf"
{"null",null},
#line 197 "KEY1Token.gperf"
{"text-attributes",text_attributes},
{(char*)0},
#line 130 "KEY1Token.gperf"
{"natural-size",natural_size},
{(char*)0},
#line 131 "KEY1Token.gperf"
{"node",node},
#line 111 "KEY1Token.gperf"
{"level",level},
{(char*)0},
#line 225 "KEY1Token.gperf"
{"visible",visible},
{(char*)0}, {(char*)0},
#line 95 "KEY1Token.gperf"
{"image",image},
{(char*)0},
#line 171 "KEY1Token.gperf"
{"shadow-style",shadow_style},
{(char*)0},
#line 67 "KEY1Token.gperf"
{"end-color",end_color},
{(char*)0}, {(char*)0},
#line 208 "KEY1Token.gperf"
{"titleVisible",titleVisible},
#line 212 "KEY1Token.gperf"
{"tracks-master",tracks_master},
#line 53 "KEY1Token.gperf"
{"data",data},
#line 177 "KEY1Token.gperf"
{"slide",slide},
{(char*)0}, {(char*)0},
#line 62 "KEY1Token.gperf"
{"div",div},
#line 195 "KEY1Token.gperf"
{"tail",tail},
#line 170 "KEY1Token.gperf"
{"seriesDirection",seriesDirection},
#line 169 "KEY1Token.gperf"
{"series",series},
{(char*)0},
#line 162 "KEY1Token.gperf"
{"relative",relative},
#line 60 "KEY1Token.gperf"
{"direction",direction},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 27 "KEY1Token.gperf"
{"altLineVisible",altLineVisible},
{(char*)0}, {(char*)0}, {(char*)0},
#line 173 "KEY1Token.gperf"
{"showGrid",showGrid},
#line 33 "KEY1Token.gperf"
{"axis",axis},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 161 "KEY1Token.gperf"
{"reference",reference},
#line 114 "KEY1Token.gperf"
{"line-tail-style",line_tail_style},
{(char*)0}, {(char*)0}, {(char*)0},
#line 73 "KEY1Token.gperf"
{"font",font},
{(char*)0},
#line 137 "KEY1Token.gperf"
{"offset",offset},
#line 92 "KEY1Token.gperf"
{"id",id},
{(char*)0},
#line 160 "KEY1Token.gperf"
{"rect",rect},
#line 180 "KEY1Token.gperf"
{"solid",solid},
{(char*)0}, {(char*)0},
#line 66 "KEY1Token.gperf"
{"end",end},
#line 77 "KEY1Token.gperf"
{"font-name",font_name},
{(char*)0},
#line 159 "KEY1Token.gperf"
{"radius",radius},
#line 61 "KEY1Token.gperf"
{"display-name",display_name},
{(char*)0},
#line 68 "KEY1Token.gperf"
{"file",file},
{(char*)0},
#line 45 "KEY1Token.gperf"
{"center",center},
{(char*)0}, {(char*)0},
#line 109 "KEY1Token.gperf"
{"left",left},
{(char*)0}, {(char*)0},
#line 51 "KEY1Token.gperf"
{"content",content},
#line 64 "KEY1Token.gperf"
{"duration",duration},
#line 71 "KEY1Token.gperf"
{"fill-type",fill_type},
#line 163 "KEY1Token.gperf"
{"right",right},
#line 139 "KEY1Token.gperf"
{"orientation",orientation},
{(char*)0}, {(char*)0},
#line 78 "KEY1Token.gperf"
{"font-size",font_size},
#line 50 "KEY1Token.gperf"
{"color",color},
{(char*)0}, {(char*)0}, {(char*)0},
#line 129 "KEY1Token.gperf"
{"name",name},
#line 28 "KEY1Token.gperf"
{"angle",angle},
{(char*)0}, {(char*)0}, {(char*)0},
#line 215 "KEY1Token.gperf"
{"type",type},
#line 52 "KEY1Token.gperf"
{"dash-style",dash_style},
{(char*)0}, {(char*)0},
#line 82 "KEY1Token.gperf"
{"gradient",gradient},
#line 56 "KEY1Token.gperf"
{"dataFormatterPrefix",dataFormatterPrefix},
#line 54 "KEY1Token.gperf"
{"dataFormatterHasThousandsSeparators",dataFormatterHasThousandsSeparators},
#line 135 "KEY1Token.gperf"
{"number",number},
#line 38 "KEY1Token.gperf"
{"br",br},
#line 222 "KEY1Token.gperf"
{"vertical",vertical},
#line 57 "KEY1Token.gperf"
{"dataFormatterSuffix",dataFormatterSuffix},
#line 193 "KEY1Token.gperf"
{"table",table},
{(char*)0}, {(char*)0}, {(char*)0},
#line 24 "KEY1Token.gperf"
{"DefaultLegendRelativePosition",DefaultLegendRelativePosition},
{(char*)0}, {(char*)0},
#line 146 "KEY1Token.gperf"
{"pattern",pattern},
{(char*)0},
#line 55 "KEY1Token.gperf"
{"dataFormatterNumberOfDecimals",dataFormatterNumberOfDecimals},
{(char*)0}, {(char*)0},
#line 165 "KEY1Token.gperf"
{"segment",segment},
{(char*)0},
#line 59 "KEY1Token.gperf"
{"dict",dict},
{(char*)0}, {(char*)0},
#line 153 "KEY1Token.gperf"
{"presentation",presentation},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 35 "KEY1Token.gperf"
{"bl",bl},
#line 126 "KEY1Token.gperf"
{"metadata",metadata},
{(char*)0},
#line 86 "KEY1Token.gperf"
{"guide",guide},
{(char*)0},
#line 181 "KEY1Token.gperf"
{"spacing",spacing},
#line 120 "KEY1Token.gperf"
{"majorTickPositions",majorTickPositions},
{(char*)0},
#line 70 "KEY1Token.gperf"
{"fill-style",fill_style},
{(char*)0},
#line 118 "KEY1Token.gperf"
{"lock-aspect-ratio",lock_aspect_ratio},
{(char*)0},
#line 44 "KEY1Token.gperf"
{"byte-size",byte_size},
{(char*)0},
#line 40 "KEY1Token.gperf"
{"bullet",bullet},
#line 25 "KEY1Token.gperf"
{"DefaultLegendSize",DefaultLegendSize},
#line 128 "KEY1Token.gperf"
{"minorTickPositions",minorTickPositions},
{(char*)0},
#line 202 "KEY1Token.gperf"
{"tickLabelsAngle",tickLabelsAngle},
#line 127 "KEY1Token.gperf"
{"middle",middle},
{(char*)0},
#line 152 "KEY1Token.gperf"
{"pos",pos},
#line 155 "KEY1Token.gperf"
{"prototype-data",prototype_data},
#line 31 "KEY1Token.gperf"
{"array",array},
{(char*)0},
#line 122 "KEY1Token.gperf"
{"master-slide",master_slide},
#line 117 "KEY1Token.gperf"
{"location",location},
#line 176 "KEY1Token.gperf"
{"size-technique",size_technique},
{(char*)0},
#line 79 "KEY1Token.gperf"
{"font-superscript",font_superscript},
#line 138 "KEY1Token.gperf"
{"opacity",opacity},
{(char*)0}, {(char*)0}, {(char*)0},
#line 100 "KEY1Token.gperf"
{"interBarGap",interBarGap},
{(char*)0}, {(char*)0},
#line 156 "KEY1Token.gperf"
{"prototype-drawables",prototype_drawables},
{(char*)0},
#line 58 "KEY1Token.gperf"
{"description",description},
#line 43 "KEY1Token.gperf"
{"bullets",bullets},
{(char*)0},
#line 76 "KEY1Token.gperf"
{"font-ligatures",font_ligatures},
{(char*)0},
#line 191 "KEY1Token.gperf"
{"symbol",symbol},
#line 154 "KEY1Token.gperf"
{"prototype-bullets",prototype_bullets},
{(char*)0},
#line 194 "KEY1Token.gperf"
{"tab-stops",tab_stops},
#line 90 "KEY1Token.gperf"
{"horizontal",horizontal},
{(char*)0},
#line 204 "KEY1Token.gperf"
{"tickLabelsVisible",tickLabelsVisible},
{(char*)0},
#line 192 "KEY1Token.gperf"
{"symbolFillMode",symbolFillMode},
#line 74 "KEY1Token.gperf"
{"font-color",font_color},
{(char*)0}, {(char*)0},
#line 124 "KEY1Token.gperf"
{"master-slides",master_slides},
#line 147 "KEY1Token.gperf"
{"pieSliceOffset",pieSliceOffset},
{(char*)0}, {(char*)0}, {(char*)0},
#line 42 "KEY1Token.gperf"
{"bullet-indentation",bullet_indentation},
{(char*)0}, {(char*)0},
#line 87 "KEY1Token.gperf"
{"guides",guides},
{(char*)0}, {(char*)0},
#line 88 "KEY1Token.gperf"
{"head",head},
#line 226 "KEY1Token.gperf"
{"width",width},
#line 89 "KEY1Token.gperf"
{"hidden",hidden},
{(char*)0}, {(char*)0},
#line 46 "KEY1Token.gperf"
{"character",character},
#line 69 "KEY1Token.gperf"
{"fill-color",fill_color},
#line 81 "KEY1Token.gperf"
{"g",g},
#line 75 "KEY1Token.gperf"
{"font-kerning",font_kerning},
{(char*)0},
#line 103 "KEY1Token.gperf"
{"justified",justified},
{(char*)0},
#line 116 "KEY1Token.gperf"
{"lineVisible",lineVisible},
#line 107 "KEY1Token.gperf"
{"labelVisible",labelVisible},
{(char*)0}, {(char*)0}, {(char*)0},
#line 119 "KEY1Token.gperf"
{"locked",locked},
#line 189 "KEY1Token.gperf"
{"stroke-width",stroke_width},
{(char*)0},
#line 200 "KEY1Token.gperf"
{"thumbnail",thumbnail},
#line 201 "KEY1Token.gperf"
{"thumbnails",thumbnails},
#line 190 "KEY1Token.gperf"
{"styles",styles},
{(char*)0}, {(char*)0},
#line 136 "KEY1Token.gperf"
{"numberOfPoints",numberOfPoints},
#line 49 "KEY1Token.gperf"
{"chartFrame",chartFrame},
#line 167 "KEY1Token.gperf"
{"sequence-bullet-style",sequence_bullet_style},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 214 "KEY1Token.gperf"
{"transition-style",transition_style},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 110 "KEY1Token.gperf"
{"legend",legend},
#line 148 "KEY1Token.gperf"
{"pieSlicePercentVisible",pieSlicePercentVisible},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 47 "KEY1Token.gperf"
{"character-bullet-style",character_bullet_style},
{(char*)0},
#line 213 "KEY1Token.gperf"
{"transformation",transformation},
#line 224 "KEY1Token.gperf"
{"visibility",visibility},
#line 186 "KEY1Token.gperf"
{"string",string},
{(char*)0},
#line 39 "KEY1Token.gperf"
{"buildChunkingStyle",buildChunkingStyle},
{(char*)0}, {(char*)0},
#line 184 "KEY1Token.gperf"
{"start-color",start_color},
{(char*)0},
#line 210 "KEY1Token.gperf"
{"top",top},
#line 63 "KEY1Token.gperf"
{"drawables",drawables},
#line 179 "KEY1Token.gperf"
{"slide-size",slide_size},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 113 "KEY1Token.gperf"
{"line-head-style",line_head_style},
#line 157 "KEY1Token.gperf"
{"prototype-plugin",prototype_plugin},
{(char*)0}, {(char*)0},
#line 80 "KEY1Token.gperf"
{"font-underline",font_underline},
{(char*)0},
#line 97 "KEY1Token.gperf"
{"image-scale",image_scale},
{(char*)0},
#line 106 "KEY1Token.gperf"
{"labelPosition",labelPosition},
{(char*)0},
#line 96 "KEY1Token.gperf"
{"image-data",image_data},
{(char*)0}, {(char*)0}, {(char*)0},
#line 145 "KEY1Token.gperf"
{"path",path},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0},
#line 34 "KEY1Token.gperf"
{"background-fill-style",background_fill_style},
#line 158 "KEY1Token.gperf"
{"prototype-plugins",prototype_plugins},
{(char*)0}, {(char*)0},
#line 123 "KEY1Token.gperf"
{"master-slide-id",master_slide_id},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 178 "KEY1Token.gperf"
{"slide-list",slide_list},
#line 121 "KEY1Token.gperf"
{"marker-type",marker_type},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0},
#line 91 "KEY1Token.gperf"
{"http://developer.apple.com/schemas/APXL",NS_URI_KEY},
{(char*)0}, {(char*)0}, {(char*)0},
#line 98 "KEY1Token.gperf"
{"image-bullet-style",image_bullet_style},
#line 30 "KEY1Token.gperf"
{"application-version",application_version},
{(char*)0},
#line 149 "KEY1Token.gperf"
{"plugin",plugin},
#line 151 "KEY1Token.gperf"
{"point_at_top",point_at_top},
#line 104 "KEY1Token.gperf"
{"key",key},
{(char*)0}, {(char*)0},
#line 29 "KEY1Token.gperf"
{"application-name",application_name},
{(char*)0},
#line 223 "KEY1Token.gperf"
{"vertical-alignment",vertical_alignment},
#line 83 "KEY1Token.gperf"
{"gradient-angle",gradient_angle},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0},
#line 144 "KEY1Token.gperf"
{"paragraph-tail-indent",paragraph_tail_indent},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0},
#line 142 "KEY1Token.gperf"
{"paragraph-first-line-indent",paragraph_first_line_indent},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 72 "KEY1Token.gperf"
{"floating-content",floating_content},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 150 "KEY1Token.gperf"
{"plugin-data",plugin_data},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0},
#line 36 "KEY1Token.gperf"
{"body",body},
{(char*)0}, {(char*)0},
#line 41 "KEY1Token.gperf"
{"bullet-characters",bullet_characters},
{(char*)0}, {(char*)0}, {(char*)0},
#line 143 "KEY1Token.gperf"
{"paragraph-head-indent",paragraph_head_indent},
{(char*)0}, {(char*)0},
#line 99 "KEY1Token.gperf"
{"inherited",inherited},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0},
#line 125 "KEY1Token.gperf"
{"match-point",match_point},
{(char*)0},
#line 216 "KEY1Token.gperf"
{"ui-state",ui_state},
#line 102 "KEY1Token.gperf"
{"is-filled",is_filled},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0},
#line 115 "KEY1Token.gperf"
{"lineOpacity",lineOpacity},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0},
#line 37 "KEY1Token.gperf"
{"bottom",bottom},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0},
#line 140 "KEY1Token.gperf"
{"page-number",page_number},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 205 "KEY1Token.gperf"
{"time-stamp",time_stamp},
{(char*)0},
#line 203 "KEY1Token.gperf"
{"tickLabelsOpacity",tickLabelsOpacity},
{(char*)0}, {(char*)0}, {(char*)0},
#line 94 "KEY1Token.gperf"
{"id-ref",id_ref},
{(char*)0}, {(char*)0},
#line 141 "KEY1Token.gperf"
{"paragraph-alignment",paragraph_alignment},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0},
#line 164 "KEY1Token.gperf"
{"scale-to-fit",scale_to_fit},
{(char*)0},
#line 101 "KEY1Token.gperf"
{"interSeriesGap",interSeriesGap},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0},
#line 219 "KEY1Token.gperf"
{"userMaximum",userMaximum},
{(char*)0}, {(char*)0},
#line 217 "KEY1Token.gperf"
{"useUserMaximum",useUserMaximum},
#line 108 "KEY1Token.gperf"
{"layerElementsForShadowing",layerElementsForShadowing},
{(char*)0},
#line 105 "KEY1Token.gperf"
{"labelOpacity",labelOpacity},
{(char*)0}, {(char*)0},
#line 48 "KEY1Token.gperf"
{"chart-prototype",chart_prototype},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0},
#line 220 "KEY1Token.gperf"
{"userMinimum",userMinimum},
{(char*)0}, {(char*)0},
#line 218 "KEY1Token.gperf"
{"useUserMinimum",useUserMinimum},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0},
#line 26 "KEY1Token.gperf"
{"altLineOpacity",altLineOpacity},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0},
#line 85 "KEY1Token.gperf"
{"grow-horizontally",grow_horizontally},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 84 "KEY1Token.gperf"
{"gridOpacity",gridOpacity}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register const char *s = wordlist[key].name;
if (s && *str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
return &wordlist[key];
}
}
return 0;
}
#line 227 "KEY1Token.gperf"

View File

@ -0,0 +1,300 @@
/* C++ code produced by gperf version 3.0.1 */
/* Command-line: gperf --compare-strncmp --enum --null-strings --readonly-tables --language C++ --output-file KEY2Token.inc KEY2Token.gperf */
/* Computed positions: -k'1,4,$' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
#line 10 "KEY2Token.gperf"
#if defined __GNUC__
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
using namespace KEY2Token;
#line 18 "KEY2Token.gperf"
struct Token
{
const char *name;
int id;
};
#include <string.h>
/* maximum key range = 140, duplicates = 0 */
class Perfect_Hash
{
private:
static inline unsigned int hash (const char *str, unsigned int len);
public:
static const struct Token *in_word_set (const char *str, unsigned int len);
};
inline unsigned int
Perfect_Hash::hash (register const char *str, register unsigned int len)
{
static const unsigned char asso_values[] =
{
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 5, 65,
0, 141, 35, 0, 141, 5, 141, 0, 141, 141,
141, 141, 141, 141, 141, 141, 0, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 0, 25, 0,
15, 0, 55, 10, 10, 5, 141, 15, 20, 0,
10, 25, 40, 141, 25, 25, 5, 0, 30, 5,
141, 40, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
141, 141, 141, 141, 141, 141
};
register int hval = len;
switch (hval)
{
default:
hval += asso_values[(unsigned char)str[3]];
/*FALLTHROUGH*/
case 3:
case 2:
case 1:
hval += asso_values[(unsigned char)str[0]];
break;
}
return hval + asso_values[(unsigned char)str[len - 1]];
}
const struct Token *
Perfect_Hash::in_word_set (register const char *str, register unsigned int len)
{
enum
{
TOTAL_KEYWORDS = 67,
MIN_WORD_LENGTH = 1,
MAX_WORD_LENGTH = 46,
MIN_HASH_VALUE = 1,
MAX_HASH_VALUE = 140
};
static const struct Token wordlist[] =
{
{(char*)0},
#line 49 "KEY2Token.gperf"
{"c",c},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0},
#line 65 "KEY2Token.gperf"
{"metadata",metadata},
#line 89 "KEY2Token.gperf"
{"type",type},
#line 84 "KEY2Token.gperf"
{"theme",theme},
#line 58 "KEY2Token.gperf"
{"i",i},
#line 50 "KEY2Token.gperf"
{"comment",comment},
#line 41 "KEY2Token.gperf"
{"animationType",animationType},
#line 66 "KEY2Token.gperf"
{"name",name},
#line 26 "KEY2Token.gperf"
{"2005112100",VERSION_STR_3},
{(char*)0},
#line 62 "KEY2Token.gperf"
{"master-slide",master_slide},
{(char*)0},
#line 83 "KEY2Token.gperf"
{"text",text},
#line 85 "KEY2Token.gperf"
{"theme-list",theme_list},
#line 28 "KEY2Token.gperf"
{"92008102400",VERSION_STR_5},
{(char*)0},
#line 36 "KEY2Token.gperf"
{"animationEndOffset",animationEndOffset},
{(char*)0},
#line 39 "KEY2Token.gperf"
{"animationStartOffset",animationStartOffset},
#line 27 "KEY2Token.gperf"
{"72007061400",VERSION_STR_4},
#line 35 "KEY2Token.gperf"
{"animationDuration",animationDuration},
#line 40 "KEY2Token.gperf"
{"animationTimingReferent",animationTimingReferent},
#line 73 "KEY2Token.gperf"
{"size",size},
#line 86 "KEY2Token.gperf"
{"title",title},
{(char*)0}, {(char*)0},
#line 55 "KEY2Token.gperf"
{"headline",headline},
#line 53 "KEY2Token.gperf"
{"direction",direction},
#line 52 "KEY2Token.gperf"
{"depth",depth},
#line 78 "KEY2Token.gperf"
{"sticky-note",sticky_note},
#line 34 "KEY2Token.gperf"
{"animationDelayAutomaticWith",animationDelayAutomaticWith},
#line 30 "KEY2Token.gperf"
{"animationAuto",animationAuto},
{(char*)0},
#line 67 "KEY2Token.gperf"
{"notes",notes},
#line 54 "KEY2Token.gperf"
{"events",events},
#line 42 "KEY2Token.gperf"
{"authors",authors},
#line 63 "KEY2Token.gperf"
{"master-slides",master_slides},
#line 70 "KEY2Token.gperf"
{"page",page},
#line 74 "KEY2Token.gperf"
{"slide",slide},
#line 80 "KEY2Token.gperf"
{"string",string},
#line 56 "KEY2Token.gperf"
{"headlineParagraphStyle",headlineParagraphStyle},
#line 37 "KEY2Token.gperf"
{"animationInterchunkAuto",animationInterchunkAuto},
{(char*)0},
#line 24 "KEY2Token.gperf"
{"2004102100",VERSION_STR_2},
#line 77 "KEY2Token.gperf"
{"slide-style",slide_style},
#line 33 "KEY2Token.gperf"
{"animationDelayAutmaticAfter",animationDelayAutomaticAfter},
#line 61 "KEY2Token.gperf"
{"keywords",keywords},
#line 32 "KEY2Token.gperf"
{"animationDelay",animationDelay},
#line 75 "KEY2Token.gperf"
{"slide-list",slide_list},
{(char*)0},
#line 31 "KEY2Token.gperf"
{"animationAutoPlay",animationAutoPlay},
#line 60 "KEY2Token.gperf"
{"key",key},
#line 51 "KEY2Token.gperf"
{"decimal-number",number},
#line 82 "KEY2Token.gperf"
{"stylesheet",stylesheet},
{(char*)0},
#line 79 "KEY2Token.gperf"
{"sticky-notes",sticky_notes},
#line 29 "KEY2Token.gperf"
{"BGBuildDurationProperty",BGBuildDurationProperty},
#line 38 "KEY2Token.gperf"
{"animationInterchunkDelay",animationInterchunkDelay},
#line 45 "KEY2Token.gperf"
{"build",build},
#line 68 "KEY2Token.gperf"
{"number",number},
#line 87 "KEY2Token.gperf"
{"title-placeholder",title_placeholder},
#line 69 "KEY2Token.gperf"
{"object-placeholder",object_placeholder},
{(char*)0},
#line 64 "KEY2Token.gperf"
{"master-ref",master_ref},
#line 46 "KEY2Token.gperf"
{"build-chunk",build_chunk},
#line 90 "KEY2Token.gperf"
{"version",version},
{(char*)0}, {(char*)0},
#line 25 "KEY2Token.gperf"
{"2005092101",COMPATIBLE_VERSION_STR_3,},
{(char*)0},
#line 48 "KEY2Token.gperf"
{"bullets",bullets},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 47 "KEY2Token.gperf"
{"build-chunks",build_chunks},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 72 "KEY2Token.gperf"
{"presentation",presentation},
{(char*)0},
#line 76 "KEY2Token.gperf"
{"slide-number-placeholder",slide_number_placeholder},
{(char*)0}, {(char*)0}, {(char*)0},
#line 59 "KEY2Token.gperf"
{"info-ref",info_ref},
{(char*)0}, {(char*)0},
#line 57 "KEY2Token.gperf"
{"http://developer.apple.com/namespaces/keynote2",NS_URI_KEY},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 88 "KEY2Token.gperf"
{"title-placeholder-ref",title_placeholder_ref},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 43 "KEY2Token.gperf"
{"body-placeholder",body_placeholder},
{(char*)0}, {(char*)0},
#line 81 "KEY2Token.gperf"
{"style-ref",style_ref},
{(char*)0},
#line 71 "KEY2Token.gperf"
{"parent-build-ref",parent_build_ref},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 44 "KEY2Token.gperf"
{"body-placeholder-ref",body_placeholder_ref}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register const char *s = wordlist[key].name;
if (s && *str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
return &wordlist[key];
}
}
return 0;
}
#line 91 "KEY2Token.gperf"

View File

@ -0,0 +1,151 @@
/* C++ code produced by gperf version 3.0.1 */
/* Command-line: gperf --compare-strncmp --enum --null-strings --readonly-tables --language C++ --output-file NUM1Token.inc NUM1Token.gperf */
/* Computed positions: -k'$' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
#line 10 "NUM1Token.gperf"
#if defined __GNUC__
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
using namespace NUM1Token;
#line 18 "NUM1Token.gperf"
struct Token
{
const char *name;
int id;
};
#include <string.h>
/* maximum key range = 34, duplicates = 0 */
class Perfect_Hash
{
private:
static inline unsigned int hash (const char *str, unsigned int len);
public:
static const struct Token *in_word_set (const char *str, unsigned int len);
};
inline unsigned int
Perfect_Hash::hash (register const char *str, register unsigned int len)
{
static const unsigned char asso_values[] =
{
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 0, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 0, 41, 41, 41, 41, 41, 41, 41, 41,
0, 10, 41, 41, 41, 0, 0, 41, 41, 41,
41, 5, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
41, 41, 41, 41, 41, 41
};
return len + asso_values[(unsigned char)str[len - 1]];
}
const struct Token *
Perfect_Hash::in_word_set (register const char *str, register unsigned int len)
{
enum
{
TOTAL_KEYWORDS = 10,
MIN_WORD_LENGTH = 7,
MAX_WORD_LENGTH = 40,
MIN_HASH_VALUE = 7,
MAX_HASH_VALUE = 40
};
static const struct Token wordlist[] =
{
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0},
#line 29 "NUM1Token.gperf"
{"version",version},
#line 25 "NUM1Token.gperf"
{"document",document},
#line 30 "NUM1Token.gperf"
{"workspace",workspace},
#line 28 "NUM1Token.gperf"
{"stylesheet",stylesheet},
#line 24 "NUM1Token.gperf"
{"92008102400",VERSION_STR_2},
{(char*)0}, {(char*)0},
#line 32 "NUM1Token.gperf"
{"workspace-name",workspace_name},
#line 33 "NUM1Token.gperf"
{"workspace-style",workspace_style},
{(char*)0}, {(char*)0}, {(char*)0},
#line 27 "NUM1Token.gperf"
{"page-info",page_info},
#line 31 "NUM1Token.gperf"
{"workspace-array",workspace_array},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0},
#line 26 "NUM1Token.gperf"
{"http://developer.apple.com/namespaces/ls",NS_URI_LS}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register const char *s = wordlist[key].name;
if (s && *str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
return &wordlist[key];
}
}
return 0;
}
#line 34 "NUM1Token.gperf"

View File

@ -0,0 +1,209 @@
/* C++ code produced by gperf version 3.0.1 */
/* Command-line: gperf --compare-strncmp --enum --null-strings --readonly-tables --language C++ --output-file PAG1Token.inc PAG1Token.gperf */
/* Computed positions: -k'1,6' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#endif
#line 10 "PAG1Token.gperf"
#if defined __GNUC__
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
using namespace PAG1Token;
#line 18 "PAG1Token.gperf"
struct Token
{
const char *name;
int id;
};
#include <string.h>
/* maximum key range = 51, duplicates = 0 */
class Perfect_Hash
{
private:
static inline unsigned int hash (const char *str, unsigned int len);
public:
static const struct Token *in_word_set (const char *str, unsigned int len);
};
inline unsigned int
Perfect_Hash::hash (register const char *str, register unsigned int len)
{
static const unsigned char asso_values[] =
{
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 25, 55, 0, 55, 10,
55, 55, 55, 55, 55, 55, 55, 10, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
5, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 5, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 5, 25, 15,
20, 0, 20, 15, 5, 55, 55, 5, 10, 55,
0, 15, 5, 55, 0, 0, 0, 55, 5, 10,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55, 55, 55, 55, 55,
55, 55, 55, 55, 55, 55
};
register int hval = len;
switch (hval)
{
default:
hval += asso_values[(unsigned char)str[5]];
/*FALLTHROUGH*/
case 5:
case 4:
case 3:
case 2:
case 1:
hval += asso_values[(unsigned char)str[0]];
break;
}
return hval;
}
const struct Token *
Perfect_Hash::in_word_set (register const char *str, register unsigned int len)
{
enum
{
TOTAL_KEYWORDS = 31,
MIN_WORD_LENGTH = 4,
MAX_WORD_LENGTH = 40,
MIN_HASH_VALUE = 4,
MAX_HASH_VALUE = 54
};
static const struct Token wordlist[] =
{
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 38 "PAG1Token.gperf"
{"note",note},
#line 49 "PAG1Token.gperf"
{"rpage",rpage},
#line 39 "PAG1Token.gperf"
{"number",number},
{(char*)0}, {(char*)0},
#line 41 "PAG1Token.gperf"
{"page",page},
#line 52 "PAG1Token.gperf"
{"stylesheet",stylesheet},
#line 33 "PAG1Token.gperf"
{"header",header},
#line 51 "PAG1Token.gperf"
{"slprint-info",slprint_info},
{(char*)0},
#line 47 "PAG1Token.gperf"
{"prototype",prototype},
#line 44 "PAG1Token.gperf"
{"page-scale",page_scale},
#line 37 "PAG1Token.gperf"
{"layout",layout},
{(char*)0}, {(char*)0},
#line 27 "PAG1Token.gperf"
{"cell",cell},
#line 40 "PAG1Token.gperf"
{"order",order},
#line 43 "PAG1Token.gperf"
{"page-height",page_height},
#line 53 "PAG1Token.gperf"
{"textbox",textbox},
{(char*)0},
#line 28 "PAG1Token.gperf"
{"date",date},
#line 45 "PAG1Token.gperf"
{"page-width",page_width},
#line 31 "PAG1Token.gperf"
{"footer",footer},
#line 54 "PAG1Token.gperf"
{"version",version},
#line 29 "PAG1Token.gperf"
{"document",document},
#line 26 "PAG1Token.gperf"
{"body",body},
#line 42 "PAG1Token.gperf"
{"page-group",page_group},
#line 24 "PAG1Token.gperf"
{"92008102400",VERSION_STR_4},
#line 25 "PAG1Token.gperf"
{"SLCreationDateProperty",SLCreationDateProperty},
#line 50 "PAG1Token.gperf"
{"section-prototypes",section_prototypes},
#line 35 "PAG1Token.gperf"
{"kSFWPFootnoteGapProperty",kSFWPFootnoteGapProperty},
#line 36 "PAG1Token.gperf"
{"kSFWPFootnoteKindProperty",kSFWPFootnoteKindProperty},
#line 48 "PAG1Token.gperf"
{"publication-info",publication_info},
{(char*)0}, {(char*)0}, {(char*)0},
#line 46 "PAG1Token.gperf"
{"print-info",print_info},
{(char*)0}, {(char*)0},
#line 32 "PAG1Token.gperf"
{"footnote",footnote},
{(char*)0},
#line 34 "PAG1Token.gperf"
{"http://developer.apple.com/namespaces/sl",NS_URI_SL},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
{(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
#line 30 "PAG1Token.gperf"
{"drawables",drawables}
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
register const char *s = wordlist[key].name;
if (s && *str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] == '\0')
return &wordlist[key];
}
}
return 0;
}
#line 55 "PAG1Token.gperf"

View File

@ -27,7 +27,7 @@ CLEAN=
BOOST_VERSION=1.72.0
BOOST_VERSION2=1_72_0
MIN_IOS_VERSION=8.0
IOS_SDK_VERSION=`xcodebuild BITCODE_GENERATION_MODE="bitcode" ENABLE_BITCODE="YES" OTHER_CFLAGS="-fembed-bitcode" -showsdks | grep iphoneos | \
IOS_SDK_VERSION=`xcodebuild BITCODE_GENERATION_MODE="bitcode" ENABLE_BITCODE="NO" -showsdks | grep iphoneos | \
egrep "[[:digit:]]+\.[[:digit:]]+" -o | tail -1`
OSX_SDK_VERSION=`xcodebuild BITCODE_GENERATION_MODE="bitcode" ENABLE_BITCODE="YES" OTHER_CFLAGS="-fembed-bitcode" -showsdks | grep macosx | \
egrep "[[:digit:]]+\.[[:digit:]]+" -o | tail -1`
@ -42,7 +42,7 @@ XCODE_ROOT=`xcode-select -print-path`
#
# Should perhaps also consider/use instead: -BOOST_SP_USE_PTHREADS
EXTRA_CPPFLAGS="-DBOOST_AC_USE_PTHREADS -DBOOST_SP_USE_PTHREADS -g -DNDEBUG \
-std=c++11 -stdlib=libc++ -fvisibility=hidden -fvisibility-inlines-hidden -fembed-bitcode"
-std=c++11 -stdlib=libc++ -fvisibility=hidden -fvisibility-inlines-hidden"
EXTRA_IOS_CPPFLAGS="$EXTRA_CPPFLAGS -mios-version-min=$MIN_IOS_VERSION"
EXTRA_OSX_CPPFLAGS="$EXTRA_CPPFLAGS"
@ -259,20 +259,17 @@ buildBoost()
echo Building Boost for iPhone
# Install this one so we can copy the headers for the frameworks...
./b2 -j16 --build-dir=iphone-build --stagedir=iphone-build/stage \
cxxflags="-fembed-bitcode" \
--prefix=$PREFIXDIR toolset=darwin architecture=arm target-os=iphone \
macosx-version=iphone-${IOS_SDK_VERSION} define=_LITTLE_ENDIAN \
link=static stage
./b2 -j16 --build-dir=iphone-build --stagedir=iphone-build/stage \
--prefix=$PREFIXDIR toolset=darwin architecture=arm \
cxxflags="-fembed-bitcode" \
target-os=iphone macosx-version=iphone-${IOS_SDK_VERSION} \
define=_LITTLE_ENDIAN link=static install
doneSection
echo Building Boost for iPhoneSimulator
./b2 -j16 --build-dir=iphonesim-build --stagedir=iphonesim-build/stage \
cxxflags="-fembed-bitcode" \
toolset=darwin-${IOS_SDK_VERSION}~iphonesim architecture=x86 \
target-os=iphone macosx-version=iphonesim-${IOS_SDK_VERSION} \
link=static stage

View File

@ -78,24 +78,24 @@ function set_ios_cpu_feature() {
armv7)
export CC="xcrun -sdk iphoneos clang -arch armv7"
export CXX="xcrun -sdk iphoneos clang++ -arch armv7"
export CFLAGS="-arch armv7 -target armv7-ios-darwin -march=armv7 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -Wno-unused-function -fstrict-aliasing -Oz -Wno-ignored-optimization-argument -DIOS -isysroot ${sysroot} -fembed-bitcode -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch armv7 -target armv7-ios-darwin -march=armv7 -isysroot ${sysroot} -fembed-bitcode -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch armv7 -target armv7-ios-darwin -march=armv7 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fstrict-aliasing -fembed-bitcode -DIOS -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export CFLAGS="-arch armv7 -target armv7-ios-darwin -march=armv7 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -Wno-unused-function -fstrict-aliasing -Oz -Wno-ignored-optimization-argument -DIOS -isysroot ${sysroot} -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch armv7 -target armv7-ios-darwin -march=armv7 -isysroot ${sysroot} -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch armv7 -target armv7-ios-darwin -march=armv7 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fstrict-aliasing -DIOS -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
;;
arm64)
export CC="xcrun -sdk iphoneos clang -arch arm64"
export CXX="xcrun -sdk iphoneos clang++ -arch arm64"
export CFLAGS="-arch arm64 -target aarch64-ios-darwin -march=armv8 -mcpu=generic -Wno-unused-function -fstrict-aliasing -Oz -Wno-ignored-optimization-argument -DIOS -isysroot ${sysroot} -fembed-bitcode -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch arm64 -target aarch64-ios-darwin -march=armv8 -isysroot ${sysroot} -fembed-bitcode -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch arm64 -target aarch64-ios-darwin -march=armv8 -mcpu=generic -fstrict-aliasing -fembed-bitcode -DIOS -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export CFLAGS="-arch arm64 -target aarch64-ios-darwin -march=armv8 -mcpu=generic -Wno-unused-function -fstrict-aliasing -Oz -Wno-ignored-optimization-argument -DIOS -isysroot ${sysroot} -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch arm64 -target aarch64-ios-darwin -march=armv8 -isysroot ${sysroot} -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch arm64 -target aarch64-ios-darwin -march=armv8 -mcpu=generic -fstrict-aliasing -DIOS -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
;;
arm64e)
# -march=armv8.3 ???
export CC="xcrun -sdk iphoneos clang -arch arm64e"
export CXX="xcrun -sdk iphoneos clang++ -arch arm64e"
export CFLAGS="-arch arm64e -target aarch64-ios-darwin -Wno-unused-function -fstrict-aliasing -DIOS -isysroot ${sysroot} -fembed-bitcode -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch arm64e -target aarch64-ios-darwin -isysroot ${sysroot} -fembed-bitcode -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch arm64e -target aarch64-ios-darwin -fstrict-aliasing -fembed-bitcode -DIOS -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export CFLAGS="-arch arm64e -target aarch64-ios-darwin -Wno-unused-function -fstrict-aliasing -DIOS -isysroot ${sysroot} -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch arm64e -target aarch64-ios-darwin -isysroot ${sysroot} -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch arm64e -target aarch64-ios-darwin -fstrict-aliasing -DIOS -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
;;
i386)
export CC="xcrun -sdk iphonesimulator clang -arch i386"

View File

@ -18,14 +18,14 @@ namespace NSCSS
{
typedef std::map<std::wstring, std::wstring>::const_iterator styles_iterator;
CCompiledStyle::CCompiledStyle() : m_nDpi(96), m_UnitMeasure(Point)
CCompiledStyle::CCompiledStyle() : m_nDpi(96), m_UnitMeasure(Point), m_dCoreFontSize(DEFAULT_FONT_SIZE)
{}
CCompiledStyle::CCompiledStyle(const CCompiledStyle& oStyle) :
m_arParentsStyles(oStyle.m_arParentsStyles), m_sId(oStyle.m_sId),
m_nDpi(oStyle.m_nDpi), m_UnitMeasure(oStyle.m_UnitMeasure),
m_nDpi(oStyle.m_nDpi), m_UnitMeasure(oStyle.m_UnitMeasure), m_dCoreFontSize(oStyle.m_dCoreFontSize),
m_oFont(oStyle.m_oFont), m_oMargin(oStyle.m_oMargin), m_oPadding(oStyle.m_oPadding), m_oBackground(oStyle.m_oBackground),
m_oText(oStyle.m_oText), m_oBorder(oStyle.m_oBorder), m_oDisplay(oStyle.m_oDisplay){}
m_oText(oStyle.m_oText), m_oBorder(oStyle.m_oBorder), m_oDisplay(oStyle.m_oDisplay), m_oTransform(oStyle.m_oTransform){}
CCompiledStyle::~CCompiledStyle()
{
@ -44,6 +44,7 @@ namespace NSCSS
m_oPadding += oElement.m_oPadding;
m_oText += oElement.m_oText;
m_oDisplay += oElement.m_oDisplay;
m_oTransform += oElement.m_oTransform;
if (!oElement.m_sId.empty())
m_sId += L'+' + oElement.m_sId;
@ -66,6 +67,7 @@ namespace NSCSS
m_oPadding = oElement.m_oPadding;
m_oText = oElement.m_oText;
m_oDisplay = oElement.m_oDisplay;
m_oTransform = oElement.m_oTransform;
return *this;
}
@ -78,7 +80,8 @@ namespace NSCSS
m_oMargin == oStyle.m_oMargin &&
m_oPadding == oStyle.m_oPadding &&
m_oText == oStyle.m_oText &&
m_oDisplay == oStyle.m_oDisplay;
m_oDisplay == oStyle.m_oDisplay &&
m_oTransform == oStyle.m_oTransform;
}
void CCompiledStyle::StyleEquation(CCompiledStyle &oFirstStyle, CCompiledStyle &oSecondStyle)
@ -90,6 +93,7 @@ namespace NSCSS
NSProperties::CText ::Equation(oFirstStyle.m_oText, oSecondStyle.m_oText);
NSProperties::CBorder ::Equation(oFirstStyle.m_oBorder, oSecondStyle.m_oBorder);
NSProperties::CDisplay ::Equation(oFirstStyle.m_oDisplay, oSecondStyle.m_oDisplay);
NSProperties::CTransform ::Equation(oFirstStyle.m_oTransform, oSecondStyle.m_oTransform);
}
void CCompiledStyle::SetDpi(const unsigned short &uiDpi)
@ -116,7 +120,10 @@ namespace NSCSS
void CCompiledStyle::AddStyle(const std::map<std::wstring, std::wstring>& mStyle, const unsigned int unLevel, const bool& bHardMode)
{
const bool bIsThereBorder = (m_oBorder.Empty()) ? false : true;
const double dFontSize = (!m_oFont.GetSize().Empty()) ? m_oFont.GetSize().ToDouble(NSCSS::Point) : DEFAULT_FONT_SIZE;
const double dParentFontSize = (!m_oFont.GetSize().Empty()) ? m_oFont.GetSize().ToDouble(NSCSS::Point) : DEFAULT_FONT_SIZE;
if (0 == unLevel)
m_dCoreFontSize = dParentFontSize;
for (std::pair<std::wstring, std::wstring> pPropertie : mStyle)
{
@ -128,15 +135,15 @@ namespace NSCSS
CASE(L"font"):
{
m_oFont.SetValue(pPropertie.second, unLevel, bHardMode);
m_oFont.UpdateSize(dFontSize);
m_oFont.UpdateLineHeight(dFontSize);
m_oFont.UpdateSize(dParentFontSize, m_dCoreFontSize);
m_oFont.UpdateLineHeight(dParentFontSize, m_dCoreFontSize);
break;
}
CASE(L"font-size"):
CASE(L"font-size-adjust"):
{
m_oFont.SetSize(pPropertie.second, unLevel, bHardMode);
m_oFont.UpdateSize(dFontSize);
m_oFont.UpdateSize(dParentFontSize, m_dCoreFontSize);
break;
}
CASE(L"font-stretch"):
@ -176,7 +183,7 @@ namespace NSCSS
break;
m_oMargin.SetValues(pPropertie.second, unLevel, bHardMode);
m_oMargin.UpdateAll(dFontSize);
m_oMargin.UpdateAll(dParentFontSize, m_dCoreFontSize);
break;
}
CASE(L"margin-top"):
@ -196,7 +203,7 @@ namespace NSCSS
break;
m_oMargin.SetRight(pPropertie.second, unLevel, bHardMode);
m_oMargin.UpdateRight(dFontSize);
m_oMargin.UpdateRight(dParentFontSize, m_dCoreFontSize);
break;
}
CASE(L"margin-bottom"):
@ -206,7 +213,7 @@ namespace NSCSS
break;
m_oMargin.SetBottom(pPropertie.second, unLevel, bHardMode);
m_oMargin.UpdateBottom(dFontSize);
m_oMargin.UpdateBottom(dParentFontSize, m_dCoreFontSize);
break;
}
CASE(L"margin-left"):
@ -217,7 +224,7 @@ namespace NSCSS
break;
m_oMargin.SetLeft(pPropertie.second, unLevel, bHardMode);
m_oMargin.UpdateLeft(dFontSize);
m_oMargin.UpdateLeft(dParentFontSize, m_dCoreFontSize);
break;
}
//PADDING
@ -225,35 +232,35 @@ namespace NSCSS
CASE(L"mso-padding-alt"):
{
m_oPadding.SetValues(pPropertie.second, unLevel, bHardMode);
m_oPadding.UpdateAll(dFontSize);
m_oPadding.UpdateAll(dParentFontSize, m_dCoreFontSize);
break;
}
CASE(L"padding-top"):
CASE(L"mso-padding-top-alt"):
{
m_oPadding.SetTop(pPropertie.second, unLevel, bHardMode);
m_oPadding.UpdateTop(dFontSize);
m_oPadding.UpdateTop(dParentFontSize, m_dCoreFontSize);
break;
}
CASE(L"padding-right"):
CASE(L"mso-padding-right-alt"):
{
m_oPadding.SetRight(pPropertie.second, unLevel, bHardMode);
m_oPadding.UpdateRight(dFontSize);
m_oPadding.UpdateRight(dParentFontSize, m_dCoreFontSize);
break;
}
CASE(L"padding-bottom"):
CASE(L"mso-padding-bottom-alt"):
{
m_oPadding.SetBottom(pPropertie.second, unLevel, bHardMode);
m_oPadding.UpdateBottom(dFontSize);
m_oPadding.UpdateBottom(dParentFontSize, m_dCoreFontSize);
break;
}
CASE(L"padding-left"):
CASE(L"mso-padding-left-alt"):
{
m_oPadding.SetLeft(pPropertie.second, unLevel, bHardMode);
m_oPadding.UpdateLeft(dFontSize);
m_oPadding.UpdateLeft(dParentFontSize, m_dCoreFontSize);
break;
}
// TEXT
@ -428,6 +435,12 @@ namespace NSCSS
m_oDisplay.SetVAlign(pPropertie.second, unLevel, bHardMode);
break;
}
//TRANSFORM
CASE(L"transform"):
{
m_oTransform.SetMatrix(pPropertie.second, unLevel, bHardMode);
break;
}
default: AddOtherStyle(pPropertie, unLevel, bHardMode);
}
}

View File

@ -22,6 +22,7 @@ namespace NSCSS
unsigned short int m_nDpi;
UnitMeasure m_UnitMeasure;
double m_dCoreFontSize;
public:
NSProperties::CFont m_oFont;
NSProperties::CIndent m_oMargin;
@ -30,11 +31,12 @@ namespace NSCSS
NSProperties::CText m_oText;
NSProperties::CBorder m_oBorder;
NSProperties::CDisplay m_oDisplay;
NSProperties::CTransform m_oTransform;
CCompiledStyle();
CCompiledStyle(const CCompiledStyle& oStyle);
~CCompiledStyle();
virtual ~CCompiledStyle();
void SetDpi(const unsigned short& uiDpi);
void SetUnitMeasure(const UnitMeasure& enUnitMeasure);

View File

@ -13,14 +13,14 @@ namespace NSCSS
delete m_pInternal;
}
CCompiledStyle CCssCalculator::GetCompiledStyle(const std::vector<CNode> &arSelectors, const bool& bIsSettings, const UnitMeasure& unitMeasure) const
CCompiledStyle CCssCalculator::GetCompiledStyle(const std::vector<CNode> &arSelectors) const
{
return m_pInternal->GetCompiledStyle(arSelectors, bIsSettings, unitMeasure);
return m_pInternal->GetCompiledStyle(arSelectors);
}
bool CCssCalculator::GetCompiledStyle(CCompiledStyle &oStyle, const std::vector<CNode> &arSelectors, const bool &bIsSettings, const UnitMeasure &unitMeasure) const
bool CCssCalculator::GetCompiledStyle(CCompiledStyle &oStyle, const std::vector<CNode> &arSelectors) const
{
return m_pInternal->GetCompiledStyle(oStyle, arSelectors, bIsSettings, unitMeasure);
return m_pInternal->GetCompiledStyle(oStyle, arSelectors);
}
std::wstring CCssCalculator::CalculateStyleId(const CNode& oNode)
@ -48,26 +48,11 @@ namespace NSCSS
m_pInternal->AddStylesFromFile(wsFileName);
}
void CCssCalculator::SetUnitMeasure(const UnitMeasure& nType)
{
m_pInternal->SetUnitMeasure(nType);
}
void CCssCalculator::SetDpi(const unsigned short int& nValue)
{
m_pInternal->SetDpi(nValue);
}
void CCssCalculator::SetBodyTree(const CTree &oTree)
{
m_pInternal->SetBodyTree(oTree);
}
UnitMeasure CCssCalculator::GetUnitMeasure() const
{
return m_pInternal->GetUnitMeasure();
}
std::wstring CCssCalculator::GetEncoding() const
{
return m_pInternal->GetEncoding();
@ -78,6 +63,26 @@ namespace NSCSS
return m_pInternal->GetDpi();
}
void CCssCalculator::ClearPageData()
{
m_pInternal->ClearPageData();
}
void CCssCalculator::ClearEmbeddedStyles()
{
m_pInternal->ClearEmbeddedStyles();
}
void CCssCalculator::ClearAllowedStyleFiles()
{
m_pInternal->ClearAllowedStyleFiles();
}
void CCssCalculator::ClearStylesFromFile(const std::wstring& wsFilePath)
{
m_pInternal->ClearStylesFromFile(wsFilePath);
}
void CCssCalculator::Clear()
{
m_pInternal->Clear();

View File

@ -19,8 +19,8 @@ namespace NSCSS
CCssCalculator();
~CCssCalculator();
CCompiledStyle GetCompiledStyle(const std::vector<CNode> &arSelectors, const bool& bIsSettings = false, const UnitMeasure& unitMeasure = Point) const;
bool GetCompiledStyle(CCompiledStyle& oStyle, const std::vector<CNode> &arSelectors, const bool& bIsSettings = false, const UnitMeasure& unitMeasure = Point) const;
CCompiledStyle GetCompiledStyle(const std::vector<CNode> &arSelectors) const;
bool GetCompiledStyle(CCompiledStyle& oStyle, const std::vector<CNode> &arSelectors) const;
std::wstring CalculateStyleId(const CNode& oNode);
bool CalculatePageStyle(NSProperties::CPage& oPageData, const std::vector<CNode> &arSelectors);
@ -30,14 +30,15 @@ namespace NSCSS
void AddStyles (const std::wstring& wsStyle);
void AddStylesFromFile(const std::wstring& wsFileName);
void SetUnitMeasure(const UnitMeasure& nType);
void SetDpi(const unsigned short int& nValue);
void SetBodyTree(const CTree &oTree);
UnitMeasure GetUnitMeasure() const;
std::wstring GetEncoding() const;
unsigned short int GetDpi() const;
void ClearPageData();
void ClearEmbeddedStyles();
void ClearAllowedStyleFiles();
void ClearStylesFromFile(const std::wstring& wsFilePath);
void Clear();
};
}

View File

@ -5,12 +5,9 @@
#include <fstream>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <numeric>
#include "../../katana-parser/src/selector.h"
#include "../../../../../UnicodeConverter/UnicodeConverter.h"
#include "ConstValues.h"
#include "../../../../../DesktopEditor/common/File.h"
#include "StaticFunctions.h"
@ -41,61 +38,120 @@ bool operator<(const std::vector<NSCSS::CNode> &arLeftSelectors, const std::vect
namespace NSCSS
{
CCssCalculator_Private::CCssCalculator_Private() : m_nDpi(96), m_nCountNodes(0), m_UnitMeasure(Point), m_mStatictics(NULL), m_sEncoding(L"UTF-8"){}
CStyleStorage::CStyleStorage()
{}
CCssCalculator_Private::~CCssCalculator_Private()
CStyleStorage::~CStyleStorage()
{
m_arFiles.clear();
for (std::map<std::wstring, CElement*>::iterator oIter = m_mData.begin(); oIter != m_mData.end(); ++oIter)
if (oIter->second != NULL)
delete oIter->second;
m_mData.clear();
if (NULL != m_mStatictics)
delete m_mStatictics;
Clear();
}
inline void CCssCalculator_Private::GetOutputData(KatanaOutput *oOutput)
void CStyleStorage::Clear()
{
if ( NULL == oOutput )
return;
for (TStyleFileData* pStyleFileData : m_arStyleFiles)
{
if (nullptr == pStyleFileData)
continue;
switch (oOutput->mode) {
case KatanaParserModeStylesheet:
GetStylesheet(oOutput->stylesheet);
break;
case KatanaParserModeRule:
GetRule(oOutput->rule);
break;
case KatanaParserModeKeyframeRule:
case KatanaParserModeKeyframeKeyList:
case KatanaParserModeMediaList:
case KatanaParserModeValue:
case KatanaParserModeSelector:
case KatanaParserModeDeclarationList:
break;
for (std::map<std::wstring, CElement*>::iterator oIter = pStyleFileData->m_mStyleData.begin(); oIter != pStyleFileData->m_mStyleData.end(); ++oIter)
if (oIter->second != nullptr)
delete oIter->second;
delete pStyleFileData;
}
m_arStyleFiles.clear();
m_arEmptyStyleFiles.clear();
ClearEmbeddedStyles();
ClearAllowedStyleFiles();
#ifdef CSS_CALCULATOR_WITH_XHTML
ClearPageData();
#endif
}
void CStyleStorage::AddStyles(const std::string& sStyle)
{
if (sStyle.empty())
return;
KatanaOutput *output = katana_parse(sStyle.c_str(), sStyle.length(), KatanaParserModeStylesheet);
this->GetOutputData(output, m_mEmbeddedStyleData);
katana_destroy_output(output);
}
void CStyleStorage::AddStyles(const std::wstring& wsStyle)
{
if (wsStyle.empty())
return;
#ifdef CSS_CALCULATOR_WITH_XHTML
std::wregex oRegex(L"@page\\s*([^{]*)(\\{[^}]*\\})");
std::wsmatch oMatch;
std::wstring::const_iterator oSearchStart(wsStyle.cbegin());
while (std::regex_search(oSearchStart, wsStyle.cend(), oMatch, oRegex))
{
AddPageData(oMatch[1].str(), oMatch[2].str());
oSearchStart = oMatch.suffix().first;
}
#endif
AddStyles(U_TO_UTF8(wsStyle));
}
void CStyleStorage::AddStylesFromFile(const std::wstring& wsFileName)
{
std::set<std::wstring>::const_iterator itEmptyFileFound = m_arEmptyStyleFiles.find(wsFileName);
if (m_arEmptyStyleFiles.cend() != itEmptyFileFound)
return;
std::vector<TStyleFileData*>::const_iterator itFound = std::find_if(m_arStyleFiles.cbegin(), m_arStyleFiles.cend(),
[wsFileName](const TStyleFileData* pStyleFileData)
{ return wsFileName == pStyleFileData->m_wsStyleFilepath; });
m_arAllowedStyleFiles.insert(wsFileName);
if (m_arStyleFiles.cend() != itFound)
return;
TStyleFileData *pStyleFileData = new TStyleFileData();
pStyleFileData->m_wsStyleFilepath = wsFileName;
AddStyles(NS_STATIC_FUNCTIONS::GetContentAsUTF8(wsFileName), pStyleFileData->m_mStyleData);
if (!pStyleFileData->m_mStyleData.empty())
m_arStyleFiles.push_back(pStyleFileData);
else
{
m_arEmptyStyleFiles.insert(wsFileName);
delete pStyleFileData;
}
}
void CStyleStorage::ClearStylesFromFile(const std::wstring& wsFileName)
{
std::vector<TStyleFileData*>::const_iterator itFound = std::find_if(m_arStyleFiles.cbegin(), m_arStyleFiles.cend(),
[wsFileName](const TStyleFileData* pStyleFileData)
{ return wsFileName == pStyleFileData->m_wsStyleFilepath; });
if (m_arStyleFiles.cend() != itFound)
{
m_arStyleFiles.erase(itFound);
delete *itFound;
}
}
#ifdef CSS_CALCULATOR_WITH_XHTML
std::map<std::wstring, std::wstring> CCssCalculator_Private::GetPageData(const std::wstring &wsPageName)
void CStyleStorage::AddPageData(const std::wstring& wsPageName, const std::wstring& wsStyles)
{
if (m_arPageDatas.empty())
return {};
for (const TPageData& oPageData : m_arPageDatas)
{
if (std::find(oPageData.m_wsNames.begin(), oPageData.m_wsNames.end(), wsPageName) != oPageData.m_wsNames.end())
return oPageData.m_mData;
}
return {};
m_arPageDatas.push_back({NS_STATIC_FUNCTIONS::GetWordsW(wsPageName), NS_STATIC_FUNCTIONS::GetRules(wsStyles)});
}
void CCssCalculator_Private::SetPageData(NSProperties::CPage &oPage, const std::map<std::wstring, std::wstring> &mData, unsigned int unLevel, bool bHardMode)
void CStyleStorage::SetPageData(NSProperties::CPage& oPage, const std::map<std::wstring, std::wstring>& mData, unsigned int unLevel, bool bHardMode)
{
for (const std::pair<std::wstring, std::wstring> &oData : mData)
{
@ -110,162 +166,84 @@ namespace NSCSS
}
}
std::vector<std::wstring> CCssCalculator_Private::CalculateAllNodes(const std::vector<CNode> &arSelectors)
std::map<std::wstring, std::wstring> CStyleStorage::GetPageData(const std::wstring& wsPageName)
{
std::vector<std::wstring> arNodes;
for (std::vector<CNode>::const_reverse_iterator oNode = arSelectors.rbegin(); oNode != arSelectors.rend(); ++oNode)
{
if (!oNode->m_wsName.empty())
arNodes.push_back(oNode->m_wsName);
if (!oNode->m_wsClass.empty())
{
if (oNode->m_wsClass.find(L' ') != std::wstring::npos)
{
std::vector<std::wstring> arClasses = NS_STATIC_FUNCTIONS::GetWordsW(oNode->m_wsClass, false, L" ");
arNodes.push_back(std::accumulate(arClasses.begin(), arClasses.end(), std::wstring(),
[](std::wstring sRes, const std::wstring& sClass)
{return sRes += L'.' + sClass + L' ';}));
}
else
arNodes.push_back(L'.' + oNode->m_wsClass);
}
if (!oNode->m_wsId.empty())
arNodes.push_back(L'#' + oNode->m_wsId);
}
return arNodes;
}
void CCssCalculator_Private::FindPrevAndKindElements(const CElement *pElement, const std::vector<std::wstring> &arNextNodes, std::vector<CElement*>& arFindedElements, const std::wstring &wsName, const std::vector<std::wstring> &arClasses)
{
if (arNextNodes.empty())
return;
const std::vector<CElement*> arTempPrev = pElement->GetPrevElements(arNextNodes.crbegin() + 1, arNextNodes.crend());
const std::vector<CElement*> arTempKins = pElement->GetNextOfKin(wsName, arClasses);
if (!arTempPrev.empty())
arFindedElements.insert(arFindedElements.end(), arTempPrev.begin(), arTempPrev.end());
if (!arTempKins.empty())
arFindedElements.insert(arFindedElements.end(), arTempKins.begin(), arTempKins.end());
}
std::vector<CElement*> CCssCalculator_Private::FindElements(std::vector<std::wstring> &arNodes, std::vector<std::wstring> &arNextNodes, bool bIsSettings)
{
if (arNodes.empty())
if (m_arPageDatas.empty())
return {};
std::vector<CElement*> arFindedElements;
std::wstring wsName, wsId;
std::vector<std::wstring> arClasses;
if (!arNodes.empty() && arNodes.back()[0] == L'#')
for (const TPageData& oPageData : m_arPageDatas)
{
wsId = arNodes.back();
arNodes.pop_back();
arNextNodes.push_back(wsId);
if (std::find(oPageData.m_wsNames.begin(), oPageData.m_wsNames.end(), wsPageName) != oPageData.m_wsNames.end())
return oPageData.m_mData;
}
if (!arNodes.empty() && arNodes.back()[0] == L'.')
{
arClasses = NS_STATIC_FUNCTIONS::GetWordsW(arNodes.back(), false, L" ");
arNextNodes.push_back(arNodes.back());
arNodes.pop_back();
}
return {};
}
if (!arNodes.empty())
{
wsName = arNodes.back();
arNodes.pop_back();
arNextNodes.push_back(wsName);
}
const std::map<std::wstring, CElement*>::const_iterator oFindName = m_mData.find(wsName);
std::map<std::wstring, CElement*>::const_iterator oFindId;
if (!wsId.empty())
{
oFindId = m_mData.find(wsId);
if (oFindId != m_mData.end() && NULL != m_mStatictics)
{
std::map<StatistickElement, unsigned int>::const_iterator oFindCountId = m_mStatictics->find(StatistickElement{StatistickElement::IsId, wsId});
if ((m_mStatictics->end() != oFindCountId) &&
(((bIsSettings && oFindCountId->second < MaxNumberRepetitions) ||
(!bIsSettings && oFindCountId->second >= MaxNumberRepetitions))))
{
if (!oFindId->second->Empty())
arFindedElements.push_back(oFindId->second);
}
FindPrevAndKindElements(oFindId->second, arNextNodes, arFindedElements, wsName);
}
}
if (!arClasses.empty())
{
if (!bIsSettings)
{
for (std::vector<std::wstring>::const_reverse_iterator iClass = arClasses.rbegin(); iClass != arClasses.rend(); ++iClass)
{
const std::map<std::wstring, CElement*>::const_iterator oFindClass = m_mData.find(*iClass);
if (oFindClass != m_mData.end())
{
if (!oFindClass->second->Empty())
arFindedElements.push_back(oFindClass->second);
FindPrevAndKindElements(oFindClass->second, arNextNodes, arFindedElements, wsName);
}
}
}
}
if (oFindName != m_mData.end())
{
if (!bIsSettings)
{
if (!oFindName->second->Empty())
arFindedElements.push_back(oFindName->second);
FindPrevAndKindElements(oFindName->second, arNextNodes, arFindedElements, wsName, arClasses);
}
}
if (arFindedElements.size() > 1)
{
std::sort(arFindedElements.rbegin(), arFindedElements.rend(),
[](CElement* oFirstElement, CElement* oSecondElement)
{
return oFirstElement->GetWeight() > oSecondElement->GetWeight();
});
}
return arFindedElements;
void CStyleStorage::ClearPageData()
{
m_arPageDatas.clear();
}
#endif
void CCssCalculator_Private::AddPageData(const std::wstring &wsPageNames, const std::wstring &wsStyles)
const CElement* CStyleStorage::FindElement(const std::wstring& wsSelector)
{
m_arPageDatas.push_back({NS_STATIC_FUNCTIONS::GetWordsW(wsPageNames), NS_STATIC_FUNCTIONS::GetRules(wsStyles)});
if (wsSelector.empty())
return nullptr;
const CElement* pFoundElement = FindSelectorFromStyleData(wsSelector, m_mEmbeddedStyleData);
if (nullptr != pFoundElement)
return pFoundElement;
for (std::vector<TStyleFileData*>::const_reverse_iterator itIter = m_arStyleFiles.crbegin(); itIter < m_arStyleFiles.crend(); ++itIter)
{
if (m_arAllowedStyleFiles.cend() == std::find(m_arAllowedStyleFiles.cbegin(), m_arAllowedStyleFiles.cend(), (*itIter)->m_wsStyleFilepath))
continue;
pFoundElement = FindSelectorFromStyleData(wsSelector, (*itIter)->m_mStyleData);
if (nullptr != pFoundElement)
return pFoundElement;
}
return nullptr;
}
inline void CCssCalculator_Private::GetStylesheet(const KatanaStylesheet *oStylesheet)
void CStyleStorage::AddStyles(const std::string& sStyle, std::map<std::wstring, CElement*>& mStyleData)
{
if (sStyle.empty())
return;
KatanaOutput *output = katana_parse(sStyle.c_str(), sStyle.length(), KatanaParserModeStylesheet);
this->GetOutputData(output, mStyleData);
katana_destroy_output(output);
}
void CStyleStorage::ClearEmbeddedStyles()
{
for (std::map<std::wstring, CElement*>::iterator oIter = m_mEmbeddedStyleData.begin(); oIter != m_mEmbeddedStyleData.end(); ++oIter)
if (oIter->second != nullptr)
delete oIter->second;
m_mEmbeddedStyleData.clear();
}
void CStyleStorage::ClearAllowedStyleFiles()
{
m_arAllowedStyleFiles.clear();
}
void CStyleStorage::GetStylesheet(const KatanaStylesheet* oStylesheet, std::map<std::wstring, CElement*>& mStyleData)
{
for (size_t i = 0; i < oStylesheet->imports.length; ++i)
GetRule((KatanaRule*)oStylesheet->imports.data[i]);
GetRule((KatanaRule*)oStylesheet->imports.data[i], mStyleData);
for (size_t i = 0; i < oStylesheet->rules.length; ++i)
GetRule((KatanaRule*)oStylesheet->rules.data[i]);
GetRule((KatanaRule*)oStylesheet->rules.data[i], mStyleData);
}
inline void CCssCalculator_Private::GetRule(const KatanaRule *oRule)
void CStyleStorage::GetRule(const KatanaRule* oRule, std::map<std::wstring, CElement*>& mStyleData)
{
if ( NULL == oRule )
return;
@ -273,7 +251,7 @@ namespace NSCSS
switch (oRule->type) {
case KatanaRuleStyle:
{
GetStyleRule((KatanaStyleRule*)oRule);
GetStyleRule((KatanaStyleRule*)oRule, mStyleData);
break;
}
default:
@ -281,7 +259,7 @@ namespace NSCSS
}
}
inline void CCssCalculator_Private::GetStyleRule(const KatanaStyleRule *oRule)
void CStyleStorage::GetStyleRule(const KatanaStyleRule* oRule, std::map<std::wstring, CElement*>& mStyleData)
{
if (oRule->declarations->length == 0)
return;
@ -297,7 +275,7 @@ namespace NSCSS
for (std::vector<std::wstring>::reverse_iterator oWord = arWords.rbegin(); oWord != arWords.rend(); ++oWord)
{
const size_t posPoint = oWord->find(L'.');
const size_t posPoint = oWord->find(L'.');
const size_t posLattice = oWord->find(L'#');
const std::wstring sName = (posPoint != std::wstring::npos) ? oWord->substr(0, posPoint) : (posLattice != std::wstring::npos) ? oWord->substr(0, posLattice) : *oWord;
@ -313,8 +291,8 @@ namespace NSCSS
{
if (NULL == oFirstElement && bCreateFirst)
{
const std::map<std::wstring, CElement*>::const_iterator& oFindId = m_mData.find(sId);
if (oFindId != m_mData.end())
const std::map<std::wstring, CElement*>::const_iterator& oFindId = mStyleData.find(sId);
if (oFindId != mStyleData.end())
{
oIdElement = oFindId->second;
bCreateFirst = false;
@ -342,8 +320,8 @@ namespace NSCSS
{
if (NULL == oFirstElement && bCreateFirst)
{
const std::map<std::wstring, CElement*>::const_iterator& oFindClass = m_mData.find(sClass);
if (oFindClass != m_mData.end())
const std::map<std::wstring, CElement*>::const_iterator& oFindClass = mStyleData.find(sClass);
if (oFindClass != mStyleData.end())
{
oClassElement = oFindClass->second;
bCreateFirst = false;
@ -375,8 +353,8 @@ namespace NSCSS
{
if (NULL == oFirstElement && bCreateFirst)
{
const std::map<std::wstring, CElement*>::const_iterator& oFindName = m_mData.find(sName);
if (oFindName != m_mData.end())
const std::map<std::wstring, CElement*>::const_iterator& oFindName = mStyleData.find(sName);
if (oFindName != mStyleData.end())
{
oNameElement = oFindName->second;
bCreateFirst = false;
@ -408,11 +386,16 @@ namespace NSCSS
oLastElement->AddProperties(mStyle);
if (NULL != oFirstElement)
m_mData[oFirstElement->GetSelector()] = oFirstElement;
mStyleData[oFirstElement->GetSelector()] = oFirstElement;
}
}
inline std::vector<std::wstring> CCssCalculator_Private::GetSelectorList(const KatanaArray* oSelectors) const
std::wstring CStyleStorage::GetValueList(const KatanaArray* oValues)
{
return StringifyValueList(oValues);
}
std::vector<std::wstring> CStyleStorage::GetSelectorList(const KatanaArray* oSelectors) const
{
if (oSelectors->length == 0)
return std::vector<std::wstring>();
@ -425,7 +408,7 @@ namespace NSCSS
return arSelectors;
}
inline std::wstring CCssCalculator_Private::GetSelector(const KatanaSelector *oSelector) const
std::wstring CStyleStorage::GetSelector(const KatanaSelector* oSelector) const
{
KatanaParser oParser;
oParser.options = &kKatanaDefaultOptions;
@ -444,7 +427,7 @@ namespace NSCSS
return wsText;
}
inline std::map<std::wstring, std::wstring> CCssCalculator_Private::GetDeclarationList(const KatanaArray* oDeclarations) const
std::map<std::wstring, std::wstring> CStyleStorage::GetDeclarationList(const KatanaArray* oDeclarations) const
{
if(oDeclarations->length == 0)
return std::map<std::wstring, std::wstring>();
@ -457,7 +440,7 @@ namespace NSCSS
return arDeclarations;
}
inline std::pair<std::wstring, std::wstring> CCssCalculator_Private::GetDeclaration(const KatanaDeclaration* oDecl) const
std::pair<std::wstring, std::wstring> CStyleStorage::GetDeclaration(const KatanaDeclaration* oDecl) const
{
std::wstring sValueList = StringifyValueList(oDecl->values);
@ -467,52 +450,213 @@ namespace NSCSS
return std::make_pair(UTF8_TO_U(std::string(oDecl->property)), sValueList);
}
inline std::wstring CCssCalculator_Private::GetValueList(const KatanaArray *oValues)
void CStyleStorage::GetOutputData(KatanaOutput* oOutput, std::map<std::wstring, CElement*>& mStyleData)
{
return StringifyValueList(oValues);
if ( NULL == oOutput )
return;
switch (oOutput->mode) {
case KatanaParserModeStylesheet:
GetStylesheet(oOutput->stylesheet, mStyleData);
break;
case KatanaParserModeRule:
GetRule(oOutput->rule, mStyleData);
break;
case KatanaParserModeKeyframeRule:
case KatanaParserModeKeyframeKeyList:
case KatanaParserModeMediaList:
case KatanaParserModeValue:
case KatanaParserModeSelector:
case KatanaParserModeDeclarationList:
break;
}
}
const CElement* CStyleStorage::FindSelectorFromStyleData(const std::wstring& wsSelector, const std::map<std::wstring, CElement*>& mStyleData)
{
std::map<std::wstring, CElement*>::const_iterator itFound = mStyleData.find(wsSelector);
if (mStyleData.cend() != itFound)
return itFound->second;
return nullptr;
}
CCssCalculator_Private::CCssCalculator_Private() : m_nDpi(96), m_nCountNodes(0), m_sEncoding(L"UTF-8"){}
CCssCalculator_Private::~CCssCalculator_Private()
{}
#ifdef CSS_CALCULATOR_WITH_XHTML
void CCssCalculator_Private::SetPageData(NSProperties::CPage &oPage, const std::map<std::wstring, std::wstring> &mData, unsigned int unLevel, bool bHardMode)
{
//TODO:: пересмотреть данный метод
m_oStyleStorage.SetPageData(oPage, mData, unLevel, bHardMode);
}
std::map<std::wstring, std::wstring> CCssCalculator_Private::GetPageData(const std::wstring &wsPageName)
{
return m_oStyleStorage.GetPageData(wsPageName);
}
void CCssCalculator_Private::ClearPageData()
{
m_oStyleStorage.ClearPageData();
}
#endif
std::vector<std::wstring> CCssCalculator_Private::CalculateAllNodes(const std::vector<CNode> &arSelectors)
{
std::vector<std::wstring> arNodes;
for (std::vector<CNode>::const_reverse_iterator oNode = arSelectors.rbegin(); oNode != arSelectors.rend(); ++oNode)
{
if (!oNode->m_wsName.empty())
arNodes.push_back(oNode->m_wsName);
if (!oNode->m_wsClass.empty())
{
if (oNode->m_wsClass.find(L' ') != std::wstring::npos)
{
std::vector<std::wstring> arClasses = NS_STATIC_FUNCTIONS::GetWordsW(oNode->m_wsClass, false, L" ");
arNodes.push_back(std::accumulate(arClasses.begin(), arClasses.end(), std::wstring(),
[](std::wstring sRes, const std::wstring& sClass)
{return sRes += L'.' + sClass + L' ';}));
}
else
arNodes.push_back(L'.' + oNode->m_wsClass);
}
if (!oNode->m_wsId.empty())
arNodes.push_back(L'#' + oNode->m_wsId);
}
return arNodes;
}
void CCssCalculator_Private::FindPrevAndKindElements(const CElement *pElement, const std::vector<std::wstring> &arNextNodes, std::vector<const CElement*>& arFindedElements, const std::wstring &wsName, const std::vector<std::wstring> &arClasses)
{
if (arNextNodes.empty())
return;
const std::vector<CElement*> arTempPrev = pElement->GetPrevElements(arNextNodes.crbegin() + 1, arNextNodes.crend());
const std::vector<CElement*> arTempKins = pElement->GetNextOfKin(wsName, arClasses);
if (!arTempPrev.empty())
arFindedElements.insert(arFindedElements.end(), arTempPrev.begin(), arTempPrev.end());
if (!arTempKins.empty())
arFindedElements.insert(arFindedElements.end(), arTempKins.begin(), arTempKins.end());
}
std::vector<const CElement*> CCssCalculator_Private::FindElements(std::vector<std::wstring> &arNodes, std::vector<std::wstring> &arNextNodes)
{
if (arNodes.empty())
return {};
std::vector<const CElement*> arFindedElements;
std::wstring wsName, wsId;
std::vector<std::wstring> arClasses;
if (!arNodes.empty() && arNodes.back()[0] == L'#')
{
wsId = arNodes.back();
arNodes.pop_back();
arNextNodes.push_back(wsId);
}
if (!arNodes.empty() && arNodes.back()[0] == L'.')
{
arClasses = NS_STATIC_FUNCTIONS::GetWordsW(arNodes.back(), false, L" ");
arNextNodes.push_back(arNodes.back());
arNodes.pop_back();
}
if (!arNodes.empty())
{
wsName = arNodes.back();
arNodes.pop_back();
arNextNodes.push_back(wsName);
}
if (!wsId.empty())
{
const CElement* pFoundId = m_oStyleStorage.FindElement(wsId);
if(nullptr != pFoundId)
{
if (!pFoundId->Empty())
arFindedElements.push_back(pFoundId);
FindPrevAndKindElements(pFoundId, arNextNodes, arFindedElements, wsName);
}
}
if (!arClasses.empty())
{
for (std::vector<std::wstring>::const_reverse_iterator iClass = arClasses.rbegin(); iClass != arClasses.rend(); ++iClass)
{
const CElement* pFoundClass = m_oStyleStorage.FindElement(*iClass);
if (nullptr != pFoundClass)
{
if (!pFoundClass->Empty())
arFindedElements.push_back(pFoundClass);
FindPrevAndKindElements(pFoundClass, arNextNodes, arFindedElements, wsName);
}
}
}
const CElement* pFoundName = m_oStyleStorage.FindElement(wsName);
if (nullptr != pFoundName)
{
if (!pFoundName->Empty())
arFindedElements.push_back(pFoundName);
FindPrevAndKindElements(pFoundName, arNextNodes, arFindedElements, wsName, arClasses);
}
if (arFindedElements.size() > 1)
{
std::sort(arFindedElements.rbegin(), arFindedElements.rend(),
[](const CElement* oFirstElement, const CElement* oSecondElement)
{ return oFirstElement->GetWeight() > oSecondElement->GetWeight(); });
}
return arFindedElements;
}
#ifdef CSS_CALCULATOR_WITH_XHTML
CCompiledStyle CCssCalculator_Private::GetCompiledStyle(const std::vector<CNode>& arSelectors, const bool& bIsSettings, const UnitMeasure& unitMeasure)
CCompiledStyle CCssCalculator_Private::GetCompiledStyle(const std::vector<CNode>& arSelectors)
{
if (arSelectors.empty())
return CCompiledStyle();
CCompiledStyle oStyle;
GetCompiledStyle(oStyle, arSelectors, bIsSettings, unitMeasure);
GetCompiledStyle(oStyle, arSelectors);
return oStyle;
}
bool CCssCalculator_Private::GetCompiledStyle(CCompiledStyle &oStyle, const std::vector<CNode> &arSelectors, const bool &bIsSettings, const UnitMeasure &unitMeasure)
bool CCssCalculator_Private::GetCompiledStyle(CCompiledStyle &oStyle, const std::vector<CNode> &arSelectors)
{
if (arSelectors.empty())
return false;
SetUnitMeasure(unitMeasure);
const std::map<std::vector<CNode>, CCompiledStyle>::iterator oItem = m_mUsedStyles.find(arSelectors);
if (!bIsSettings)
if (oItem != m_mUsedStyles.end())
{
const std::map<std::vector<CNode>, CCompiledStyle>::iterator oItem = m_mUsedStyles.find(arSelectors);
if (oItem != m_mUsedStyles.end())
{
oStyle = oItem->second;
return true;
}
}
else if (NULL == m_mStatictics || m_mStatictics->empty())
{
oStyle.SetDpi(m_nDpi);
oStyle.SetUnitMeasure(m_UnitMeasure);
oStyle.SetID(arSelectors.back().m_wsName + ((!arSelectors.back().m_wsClass.empty()) ? L'.' + arSelectors.back().m_wsClass : L"") + ((arSelectors.back().m_wsId.empty()) ? L"" : L'#' + arSelectors.back().m_wsId) + L'-' + std::to_wstring(++m_nCountNodes));
return false;
oStyle = oItem->second;
return true;
}
oStyle.SetDpi(m_nDpi);
oStyle.SetUnitMeasure(m_UnitMeasure);
std::vector<std::wstring> arNodes = CalculateAllNodes(arSelectors);
std::vector<std::wstring> arPrevNodes;
@ -535,25 +679,10 @@ namespace NSCSS
oTempStyle.AddStyle(arSelectors[i].m_mAttributes, i + 1);
for (const CElement* oElement : FindElements(arNodes, arPrevNodes, bIsSettings))
for (const CElement* oElement : FindElements(arNodes, arPrevNodes))
oTempStyle.AddStyle(oElement->GetStyle(), i + 1);
if (NULL != m_mStatictics)
{
std::map<StatistickElement, unsigned int>::const_iterator oFindCountStyle = m_mStatictics->find(StatistickElement{StatistickElement::IsStyle, arSelectors[i].m_wsStyle});
if (oFindCountStyle != m_mStatictics->end())
{
if ((bIsSettings && oFindCountStyle->second < MaxNumberRepetitions) ||
(!bIsSettings && oFindCountStyle->second >= MaxNumberRepetitions))
oTempStyle.AddStyle(arSelectors[i].m_wsStyle, i + 1, true);
else if (!bIsSettings)
oTempStyle.AddStyle(arSelectors[i].m_wsStyle, i + 1, true);
}
else /*if (bIsSettings)*/
oTempStyle.AddStyle(arSelectors[i].m_wsStyle, i + 1, true);
}
else
if (!arSelectors[i].m_wsStyle.empty())
oTempStyle.AddStyle(arSelectors[i].m_wsStyle, i + 1, true);
oStyle += oTempStyle;
@ -569,7 +698,7 @@ namespace NSCSS
oStyle.SetID(CalculateStyleId(arSelectors.back()));
if (!bIsSettings && !oStyle.Empty())
if (!oStyle.Empty())
m_mUsedStyles[arSelectors] = oStyle;
return true;
@ -597,7 +726,7 @@ namespace NSCSS
SetPageData(oPageData, GetPageData(mRules[L"page"]), i + 1, true);
}
for (const CElement* oElement : FindElements(arNodes, arNextNodes, false))
for (const CElement* oElement : FindElements(arNodes, arNextNodes))
{
std::map<std::wstring, std::wstring> mRules = oElement->GetStyle();
if (mRules.end() != mRules.find(L"page"))
@ -611,42 +740,20 @@ namespace NSCSS
return true;
}
#endif
void CCssCalculator_Private::AddStyles(const std::string &sStyle)
{
if (sStyle.empty())
return;
KatanaOutput *output = katana_parse(sStyle.c_str(), sStyle.length(), KatanaParserModeStylesheet);
this->GetOutputData(output);
katana_destroy_output(output);
void CCssCalculator_Private::AddStyles(const std::string& sStyle)
{
m_oStyleStorage.AddStyles(sStyle);
}
void CCssCalculator_Private::AddStyles(const std::wstring &wsStyle)
void CCssCalculator_Private::AddStyles(const std::wstring& wsStyle)
{
if (wsStyle.empty())
return;
std::wregex oRegex(L"@page\\s*([^{]*)(\\{[^}]*\\})");
std::wsmatch oMatch;
std::wstring::const_iterator oSearchStart(wsStyle.cbegin());
while (std::regex_search(oSearchStart, wsStyle.cend(), oMatch, oRegex))
{
AddPageData(oMatch[1].str(), oMatch[2].str());
oSearchStart = oMatch.suffix().first;
}
AddStyles(U_TO_UTF8(wsStyle));
m_oStyleStorage.AddStyles(wsStyle);
}
void CCssCalculator_Private::AddStylesFromFile(const std::wstring& wsFileName)
{
if (std::find(m_arFiles.begin(), m_arFiles.end(), wsFileName) != m_arFiles.end())
return;
m_arFiles.push_back(wsFileName);
AddStyles(NS_STATIC_FUNCTIONS::GetContentAsUTF8(wsFileName));
m_oStyleStorage.AddStylesFromFile(wsFileName);
}
void CCssCalculator_Private::SetDpi(unsigned short int nValue)
@ -654,32 +761,28 @@ namespace NSCSS
m_nDpi = nValue;
}
void CCssCalculator_Private::SetBodyTree(const CTree &oTree)
{
if (NULL == m_mStatictics)
m_mStatictics = new std::map<StatistickElement, unsigned int>();
CTree::CountingNumberRepetitions(oTree, *m_mStatictics);
}
void CCssCalculator_Private::SetUnitMeasure(const UnitMeasure& nType)
{
m_UnitMeasure = nType;
}
unsigned short int CCssCalculator_Private::GetDpi() const
{
return m_nDpi;
}
const std::map<std::wstring, CElement *> *CCssCalculator_Private::GetData() const
void CCssCalculator_Private::ClearEmbeddedStyles()
{
return &m_mData;
m_oStyleStorage.ClearEmbeddedStyles();
#ifdef CSS_CALCULATOR_WITH_XHTML
m_mUsedStyles.clear();
#endif
}
UnitMeasure CCssCalculator_Private::GetUnitMeasure() const
void CCssCalculator_Private::ClearAllowedStyleFiles()
{
return m_UnitMeasure;
m_oStyleStorage.ClearAllowedStyleFiles();
}
void CCssCalculator_Private::ClearStylesFromFile(const std::wstring& wsFilePath)
{
m_oStyleStorage.ClearStylesFromFile(wsFilePath);
}
std::wstring CCssCalculator_Private::GetEncoding() const
@ -691,12 +794,22 @@ namespace NSCSS
{
m_sEncoding = L"UTF-8";
m_nDpi = 96;
m_UnitMeasure = Point;
m_mData.clear();
m_arFiles.clear();
m_oStyleStorage.Clear();
#ifdef CSS_CALCULATOR_WITH_XHTML
m_mUsedStyles.clear();
#endif
}
bool IsTableElement(const std::wstring& wsNameTag)
{
return L"td" == wsNameTag || L"tr" == wsNameTag || L"table" == wsNameTag ||
L"tbody" == wsNameTag || L"thead" == wsNameTag || L"tfoot" == wsNameTag ||
L"th" == wsNameTag;
}
}
inline static std::wstring StringifyValueList(const KatanaArray* oValues)
{
if (NULL == oValues)
@ -797,11 +910,4 @@ inline static std::wstring StringifyValue(const KatanaValue* oValue)
return str;
}
inline static bool IsTableElement(const std::wstring& wsNameTag)
{
return L"td" == wsNameTag || L"tr" == wsNameTag || L"table" == wsNameTag ||
L"tbody" == wsNameTag || L"thead" == wsNameTag || L"tfoot" == wsNameTag ||
L"th" == wsNameTag;
}

View File

@ -3,11 +3,9 @@
#include <vector>
#include <map>
#include <list>
#include <functional>
#include <set>
#include "CElement.h"
#include "ConstValues.h"
#include "CUnitMeasureConverter.h"
#include "StyleProperties.h"
#include "../../katana-parser/src/katana.h"
#ifdef CSS_CALCULATOR_WITH_XHTML
@ -16,16 +14,43 @@
namespace NSCSS
{
class CCssCalculator_Private
class CStyleStorage
{
unsigned short int m_nDpi;
unsigned short int m_nCountNodes;
UnitMeasure m_UnitMeasure;
public:
CStyleStorage();
~CStyleStorage();
std::list<std::wstring> m_arFiles;
void Clear();
std::map<std::wstring, CElement*> m_mData;
void AddStyles(const std::string& sStyle);
void AddStyles(const std::wstring& wsStyle);
void AddStylesFromFile(const std::wstring& wsFileName);
void ClearEmbeddedStyles();
void ClearAllowedStyleFiles();
void ClearStylesFromFile(const std::wstring& wsFileName);
#ifdef CSS_CALCULATOR_WITH_XHTML
void AddPageData(const std::wstring& wsPageName, const std::wstring& wsStyles);
void SetPageData(NSProperties::CPage& oPage, const std::map<std::wstring, std::wstring>& mData, unsigned int unLevel, bool bHardMode = false);
std::map<std::wstring, std::wstring> GetPageData(const std::wstring& wsPageName);
void ClearPageData();
#endif
const CElement* FindElement(const std::wstring& wsSelector);
private:
typedef struct
{
std::wstring m_wsStyleFilepath;
std::map<std::wstring, CElement*> m_mStyleData;
} TStyleFileData;
std::set<std::wstring> m_arEmptyStyleFiles;
std::set<std::wstring> m_arAllowedStyleFiles;
std::vector<TStyleFileData*> m_arStyleFiles;
std::map<std::wstring, CElement*> m_mEmbeddedStyleData;
#ifdef CSS_CALCULATOR_WITH_XHTML
typedef struct
{
std::vector<std::wstring> m_wsNames;
@ -33,29 +58,14 @@ namespace NSCSS
} TPageData;
std::vector<TPageData> m_arPageDatas;
std::map<StatistickElement, unsigned int> *m_mStatictics; // Количество повторений свойств id и style у селекторов
#ifdef CSS_CALCULATOR_WITH_XHTML
std::map<std::vector<CNode>, CCompiledStyle> m_mUsedStyles;
std::map<std::wstring, std::wstring> GetPageData(const std::wstring& wsPageName);
void SetPageData(NSProperties::CPage& oPage, const std::map<std::wstring, std::wstring>& mData, unsigned int unLevel, bool bHardMode = false);
std::vector<std::wstring> CalculateAllNodes(const std::vector<CNode>& arSelectors);
void FindPrevAndKindElements(const CElement* pElement, const std::vector<std::wstring>& arNextNodes, std::vector<CElement*>& arFindedElements, const std::wstring& wsName, const std::vector<std::wstring>& arClasses = {});
std::vector<CElement*> FindElements(std::vector<std::wstring>& arNodes, std::vector<std::wstring>& arNextNodes, bool bIsSettings);
#endif
private:
void AddStyles(const std::string& sStyle, std::map<std::wstring, CElement*>& mStyleData);
std::wstring m_sEncoding;
void GetStylesheet(const KatanaStylesheet* oStylesheet, std::map<std::wstring, CElement*>& mStyleData);
void GetRule(const KatanaRule* oRule, std::map<std::wstring, CElement*>& mStyleData);
void AddPageData(const std::wstring& wsPageName, const std::wstring& wsStyles);
void GetStylesheet(const KatanaStylesheet* oStylesheet);
void GetRule(const KatanaRule* oRule);
void GetStyleRule(const KatanaStyleRule* oRule);
void GetStyleRule(const KatanaStyleRule* oRule, std::map<std::wstring, CElement*>& mStyleData);
std::wstring GetValueList(const KatanaArray* oValues);
@ -65,36 +75,60 @@ namespace NSCSS
std::map<std::wstring, std::wstring> GetDeclarationList(const KatanaArray* oDeclarations) const;
std::pair<std::wstring, std::wstring> GetDeclaration(const KatanaDeclaration* oDecl) const;
void GetOutputData(KatanaOutput* oOutput);
void GetOutputData(KatanaOutput* oOutput, std::map<std::wstring, CElement*>& mStyleData);
const CElement* FindSelectorFromStyleData(const std::wstring& wsSelector, const std::map<std::wstring, CElement*>& mStyleData);
};
class CCssCalculator_Private
{
unsigned short int m_nDpi;
unsigned short int m_nCountNodes;
CStyleStorage m_oStyleStorage;
#ifdef CSS_CALCULATOR_WITH_XHTML
std::map<std::vector<CNode>, CCompiledStyle> m_mUsedStyles;
void SetPageData(NSProperties::CPage& oPage, const std::map<std::wstring, std::wstring>& mData, unsigned int unLevel, bool bHardMode = false);
std::map<std::wstring, std::wstring> GetPageData(const std::wstring &wsPageName);
#endif
void FindPrevAndKindElements(const CElement* pElement, const std::vector<std::wstring>& arNextNodes, std::vector<const CElement*>& arFindedElements, const std::wstring& wsName, const std::vector<std::wstring>& arClasses = {});
std::wstring m_sEncoding;
public:
CCssCalculator_Private();
~CCssCalculator_Private();
#ifdef CSS_CALCULATOR_WITH_XHTML
CCompiledStyle GetCompiledStyle(const std::vector<CNode> &arSelectors, const bool& bIsSettings = false, const UnitMeasure& unitMeasure = Point);
bool GetCompiledStyle(CCompiledStyle& oStyle, const std::vector<CNode> &arSelectors, const bool& bIsSettings = false, const UnitMeasure& unitMeasure = Point);
CCompiledStyle GetCompiledStyle(const std::vector<CNode> &arSelectors);
bool GetCompiledStyle(CCompiledStyle& oStyle, const std::vector<CNode> &arSelectors);
std::wstring CalculateStyleId(const CNode& oNode);
bool CalculatePageStyle(NSProperties::CPage& oPageData, const std::vector<CNode> &arSelectors);
void ClearPageData();
#endif
std::vector<std::wstring> CalculateAllNodes(const std::vector<CNode>& arSelectors);
std::vector<const CElement*> FindElements(std::vector<std::wstring>& arNodes, std::vector<std::wstring>& arNextNodes);
void AddStyles(const std::string& sStyle);
void AddStyles(const std::wstring& wsStyle);
void AddStylesFromFile(const std::wstring& wsFileName);
void SetUnitMeasure(const UnitMeasure& nType);
void SetDpi(unsigned short int nValue);
void SetBodyTree(const CTree &oTree);
UnitMeasure GetUnitMeasure() const;
std::wstring GetEncoding() const;
unsigned short int GetDpi() const;
const std::map<std::wstring, CElement*>* GetData() const;
void ClearEmbeddedStyles();
void ClearAllowedStyleFiles();
void ClearStylesFromFile(const std::wstring& wsFilePath);
void Clear();
};
inline bool IsTableElement(const std::wstring& wsNameTag);
}
#endif // CCSSCALCULATOR_PRIVATE_H

View File

@ -40,6 +40,7 @@ namespace NSCSS
{
m_sSelector = sSelector;
m_sFullSelector = m_sSelector;
UpdateWeight();
}
void NSCSS::CElement::AddPropertie(const std::wstring &sName, const std::wstring& sValue)
@ -67,6 +68,7 @@ namespace NSCSS
m_arPrevElements.push_back(oPrevElement);
oPrevElement->m_sFullSelector += L' ' + m_sFullSelector;
UpdateWeight();
}
void CElement::AddKinElement(CElement *oKinElement)
@ -76,6 +78,7 @@ namespace NSCSS
m_arKinElements.push_back(oKinElement);
oKinElement->m_sFullSelector += m_sFullSelector;
oKinElement->UpdateWeight();
}
std::map<std::wstring, std::wstring> CElement::GetStyle() const
@ -230,11 +233,14 @@ namespace NSCSS
return NULL;
}
std::vector<unsigned short> CElement::GetWeight()
void CElement::UpdateWeight()
{
if (m_arWeight.empty())
m_arWeight = NS_STATIC_FUNCTIONS::GetWeightSelector(m_sFullSelector);
}
std::vector<unsigned short> CElement::GetWeight() const
{
return m_arWeight;
}

View File

@ -44,7 +44,8 @@ namespace NSCSS
CElement *FindPrevElement(const std::wstring& sSelector) const;
std::vector<unsigned short int> GetWeight();
void UpdateWeight();
std::vector<unsigned short int> GetWeight() const;
void IncreasedWeight();
};
}

View File

@ -2,29 +2,6 @@
namespace NSCSS
{
bool StatistickElement::operator<(const StatistickElement &oStatistickElement) const
{
return sValue < oStatistickElement.sValue;
}
void CTree::Clear()
{
m_arrChild.clear();
m_oNode.Clear();
}
void CTree::CountingNumberRepetitions(const CTree &oTree, std::map<StatistickElement, unsigned int> &mStatictics)
{
if (!oTree.m_oNode.m_wsId.empty())
++mStatictics[StatistickElement{StatistickElement::IsId, L'#' + oTree.m_oNode.m_wsId}];
if (!oTree.m_oNode.m_wsStyle.empty())
++mStatictics[StatistickElement{StatistickElement::IsStyle, oTree.m_oNode.m_wsStyle}];
if (!oTree.m_arrChild.empty())
for (const CTree& oChildren : oTree.m_arrChild)
CountingNumberRepetitions(oChildren, mStatictics);
}
namespace NSConstValues
{
const std::map<std::wstring, std::wstring> COLORS

View File

@ -16,28 +16,6 @@ namespace NSCSS
ScalingDirectionY = 2
} ScalingDirection;
struct StatistickElement
{
enum TypeElement
{
IsStyle = 0,
IsId
} m_enType;
std::wstring sValue;
bool operator<(const StatistickElement& oStatistickElement) const;
};
struct CTree
{
NSCSS::CNode m_oNode;
std::vector<CTree> m_arrChild;
void Clear();
static void CountingNumberRepetitions(const CTree &oTree, std::map<StatistickElement, unsigned int> &mStatictics);
};
namespace NSConstValues
{
extern const std::map<std::wstring, std::wstring> COLORS;

View File

@ -48,7 +48,6 @@ namespace NS_STATIC_FUNCTIONS
if (sEncoding.empty())
sEncoding = "utf-8";
if (!sEncoding.empty() && sEncoding != "utf-8" && sEncoding != "UTF-8")
{
NSUnicodeConverter::CUnicodeConverter oConverter;

View File

@ -513,6 +513,9 @@ namespace NSCSS
return (*static_cast<std::wstring*>(m_oValue)) == (*static_cast<std::wstring*>(oColor.m_oValue));
case ColorUrl:
return (*static_cast<CURL*>(m_oValue)) == (*static_cast<CURL*>(oColor.m_oValue));
case ColorContextStroke:
case ColorContextFill:
return false;
}
}
@ -532,6 +535,9 @@ namespace NSCSS
return (*static_cast<std::wstring*>(m_oValue)) != (*static_cast<std::wstring*>(oColor.m_oValue));
case ColorUrl:
return (*static_cast<CURL*>(m_oValue)) != (*static_cast<CURL*>(oColor.m_oValue));
case ColorContextStroke:
case ColorContextFill:
return false;
}
}
@ -561,6 +567,9 @@ namespace NSCSS
m_oValue = new CURL(*static_cast<CURL*>(oColor.m_oValue));
break;
}
case ColorContextStroke:
case ColorContextFill:
break;
}
return *this;
@ -580,6 +589,39 @@ namespace NSCSS
: CValue(NULL, 0, false), m_oOpacity(1.), m_enType(ColorEmpty)
{}
CColor::CColor(const CColor& oColor)
: CValue(NULL, 0, false), m_oOpacity(oColor.m_oOpacity), m_enType(oColor.m_enType)
{
switch (m_enType)
{
case ColorRGB:
{
TRGB *pRGB = static_cast<TRGB*>(oColor.m_oValue);
m_oValue = new TRGB(*pRGB);
break;
}
case ColorHEX:
{
std::wstring* pValue = static_cast<std::wstring*>(oColor.m_oValue);
m_oValue = new std::wstring(*pValue);
break;
}
case ColorUrl:
{
CURL *pURL = static_cast<CURL*>(oColor.m_oValue);
m_oValue = new CURL(*pURL);
break;
}
default:
break;
}
}
CColor::~CColor()
{
Clear();
}
void CColor::SetEmpty(unsigned int unLevel)
{
Clear();
@ -875,6 +917,25 @@ namespace NSCSS
}
}
std::wstring CColor::ToHEX() const
{
switch(m_enType)
{
case ColorRGB:
{
TRGB* pRGB = static_cast<TRGB*>(m_oValue);
return ConvertRGBtoHEX(*pRGB);
}
case ColorHEX:
{
std::wstring *pValue = static_cast<std::wstring*>(m_oValue);
return *pValue;
}
default:
return std::wstring();
}
}
std::wstring CColor::EquateToColor(const std::vector<std::pair<TRGB, std::wstring>> &arColors) const
{
if (arColors.empty())
@ -2301,32 +2362,32 @@ namespace NSCSS
return m_oLeft.SetValue(dValue, unLevel, bHardMode);
}
void CIndent::UpdateAll(double dFontSize)
void CIndent::UpdateAll(const double& dParentFontSize, const double& dCoreFontSize)
{
UpdateTop (dFontSize);
UpdateRight (dFontSize);
UpdateBottom(dFontSize);
UpdateLeft (dFontSize);
UpdateTop (dParentFontSize, dCoreFontSize);
UpdateRight (dParentFontSize, dCoreFontSize);
UpdateBottom(dParentFontSize, dCoreFontSize);
UpdateLeft (dParentFontSize, dCoreFontSize);
}
void CIndent::UpdateTop(double dFontSize)
void CIndent::UpdateTop(const double& dParentFontSize, const double& dCoreFontSize)
{
UpdateSide(m_oTop, dFontSize);
UpdateSide(m_oTop, dParentFontSize, dCoreFontSize);
}
void CIndent::UpdateRight(double dFontSize)
void CIndent::UpdateRight(const double& dParentFontSize, const double& dCoreFontSize)
{
UpdateSide(m_oRight, dFontSize);
UpdateSide(m_oRight, dParentFontSize, dCoreFontSize);
}
void CIndent::UpdateBottom(double dFontSize)
void CIndent::UpdateBottom(const double& dParentFontSize, const double& dCoreFontSize)
{
UpdateSide(m_oBottom, dFontSize);
UpdateSide(m_oBottom, dParentFontSize, dCoreFontSize);
}
void CIndent::UpdateLeft(double dFontSize)
void CIndent::UpdateLeft(const double& dParentFontSize, const double& dCoreFontSize)
{
UpdateSide(m_oLeft, dFontSize);
UpdateSide(m_oLeft, dParentFontSize, dCoreFontSize);
}
const CDigit &CIndent::GetTop() const
@ -2395,13 +2456,15 @@ namespace NSCSS
return bTopResult || bRightResult || bBottomResult || bLeftResult;
}
void CIndent::UpdateSide(CDigit &oSide, double dFontSize)
void CIndent::UpdateSide(CDigit &oSide, const double& dParentFontSize, const double& dCoreFontSize)
{
if (oSide.Empty())
return;
if (NSCSS::Em == oSide.GetUnitMeasure() || NSCSS::Rem == oSide.GetUnitMeasure())
oSide.ConvertTo(NSCSS::Twips, dFontSize);
if (NSCSS::Em == oSide.GetUnitMeasure())
oSide.ConvertTo(NSCSS::Twips, dParentFontSize);
else if (NSCSS::Rem == oSide.GetUnitMeasure())
oSide.ConvertTo(NSCSS::Twips, dCoreFontSize);
}
// FONT
@ -2644,16 +2707,20 @@ namespace NSCSS
std::make_pair(L"700", L"bold"), std::make_pair(L"800", L"bold"), std::make_pair(L"900", L"bold")}, unLevel, bHardMode);
}
void CFont::UpdateSize(double dFontSize)
void CFont::UpdateSize(const double& dParentFontSize, const double& dCoreFontSize)
{
if (NSCSS::Em == m_oSize.GetUnitMeasure() || NSCSS::Rem == m_oSize.GetUnitMeasure() || NSCSS::Percent == m_oSize.GetUnitMeasure())
m_oSize.ConvertTo(NSCSS::Point, dFontSize);
if (NSCSS::Em == m_oSize.GetUnitMeasure() || NSCSS::Percent == m_oSize.GetUnitMeasure())
m_oSize.ConvertTo(NSCSS::Point, dParentFontSize);
else if (NSCSS::Rem == m_oSize.GetUnitMeasure())
m_oSize.ConvertTo(NSCSS::Point, dCoreFontSize);
}
void CFont::UpdateLineHeight(double dFontSize)
void CFont::UpdateLineHeight(const double& dParentFontSize, const double& dCoreFontSize)
{
if (NSCSS::Em == m_oLineHeight.GetUnitMeasure() || NSCSS::Rem == m_oLineHeight.GetUnitMeasure())
m_oLineHeight.ConvertTo(NSCSS::Twips, dFontSize);
if (NSCSS::Em == m_oLineHeight.GetUnitMeasure())
m_oLineHeight.ConvertTo(NSCSS::Twips, dParentFontSize);
else if (NSCSS::Rem == m_oLineHeight.GetUnitMeasure())
m_oLineHeight.ConvertTo(NSCSS::Twips, dCoreFontSize);
}
bool CFont::Bold() const

View File

@ -224,6 +224,8 @@ namespace NSCSS
{
public:
CColor();
CColor(const CColor& oColor);
~CColor();
bool SetValue(const std::wstring& wsValue, unsigned int unLevel = 0, bool bHardMode = true) override;
bool SetOpacity(const std::wstring& wsValue, unsigned int unLevel = 0, bool bHardMode = true);
@ -240,6 +242,7 @@ namespace NSCSS
int ToInt() const override;
double ToDouble() const override;
std::wstring ToWString() const override;
std::wstring ToHEX() const;
std::wstring EquateToColor(const std::vector<std::pair<TRGB, std::wstring>>& arColors) const;
TRGB ToRGB() const;
@ -656,11 +659,11 @@ namespace NSCSS
bool SetLeft (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetLeft (const double& dValue, unsigned int unLevel, bool bHardMode = false);
void UpdateAll (double dFontSize);
void UpdateTop (double dFontSize);
void UpdateRight (double dFontSize);
void UpdateBottom(double dFontSize);
void UpdateLeft (double dFontSize);
void UpdateAll (const double& dParentFontSize, const double& dCoreFontSize);
void UpdateTop (const double& dParentFontSize, const double& dCoreFontSize);
void UpdateRight (const double& dParentFontSize, const double& dCoreFontSize);
void UpdateBottom(const double& dParentFontSize, const double& dCoreFontSize);
void UpdateLeft (const double& dParentFontSize, const double& dCoreFontSize);
const CDigit& GetTop () const;
const CDigit& GetRight () const;
@ -675,7 +678,7 @@ namespace NSCSS
bool operator!=(const CIndent& oIndent) const;
private:
bool SetValues(const std::wstring& wsTopValue, const std::wstring& wsRightValue, const std::wstring& wsBottomValue, const std::wstring& wsLeftValue, unsigned int unLevel, bool bHardMode = false);
void UpdateSide(CDigit& oSide, double dFontSize);
void UpdateSide(CDigit& oSide, const double& dParentFontSize, const double& dCoreFontSize);
CDigit m_oLeft;
CDigit m_oTop;
@ -702,8 +705,8 @@ namespace NSCSS
bool SetVariant (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWeight (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
void UpdateSize(double dFontSize);
void UpdateLineHeight(double dFontSize);
void UpdateSize(const double& dParentFontSize, const double& dCoreFontSize);
void UpdateLineHeight(const double& dParentFontSize, const double& dCoreFontSize);
void Clear();

View File

@ -316,7 +316,7 @@ namespace NSCSS
std::wstring wsTextAlign{oStyle.m_oText.GetAlign().ToWString()};
if (wsTextAlign.empty() && bInTable)
if (wsTextAlign.empty())
wsTextAlign = oStyle.m_oDisplay.GetHAlign().ToWString();
oXmlElement.AddPropertiesInP(PProperties::P_Jc, wsTextAlign);
@ -485,7 +485,7 @@ namespace NSCSS
return;
if (!oStyle.m_oFont.GetSize().Empty())
oXmlElement.AddPropertiesInR(RProperties::R_Sz, std::to_wstring(static_cast<int>(oStyle.m_oFont.GetSize().ToDouble(NSCSS::Point) * 2. + 0.5))); // Значения шрифта увеличивает на 2
oXmlElement.AddPropertiesInR(RProperties::R_Sz, std::to_wstring(static_cast<int>(oStyle.m_oFont.GetSize().ToDouble(NSCSS::Point) * 2. * oStyle.m_oTransform.GetMatrix().GetFinalValue().sy() + 0.5))); // Значения шрифта увеличивает на 2
if (oStyle.m_oText.GetDecoration().m_oLine.Underline())
oXmlElement.AddPropertiesInR(RProperties::R_U, (!oStyle.m_oText.GetDecoration().m_oStyle.Empty()) ? oStyle.m_oText.GetDecoration().m_oStyle.ToWString() : L"single");

View File

@ -55,6 +55,11 @@ static void replace_all(std::string& s, const std::string& s1, const std::string
}
}
static bool NodeIsUnprocessed(const std::string& wsTagName)
{
return "xml" == wsTagName;
}
static bool IsUnckeckedNodes(const std::string& sValue)
{
return unchecked_nodes_new.end() != std::find(unchecked_nodes_new.begin(), unchecked_nodes_new.end(), sValue);
@ -592,6 +597,9 @@ static void prettyprint(GumboNode* node, NSStringUtils::CStringBuilderA& oBuilde
std::string tagname = get_tag_name(node);
if (NodeIsUnprocessed(tagname))
return;
if (bCheckValidNode)
bCheckValidNode = !IsUnckeckedNodes(tagname);

View File

@ -2,3 +2,4 @@ emsdk/
hunspell/
deploy/
o
hunspell.data

View File

@ -14,6 +14,12 @@ def get_hunspell(stable_commit):
base.replaceInFile("./src/hunspell/csutil.cxx", "void free_utf_tbl() {", "void free_utf_tbl() { \n return;\n")
# bug fix, we need to keep this utf table
# free_utf_tbl doesnt delete anything so we can destroy hunspell object
# replace & add defines to easy control of time limits (CUSTOM_LIMIT)
default_tl_defines = "#define TIMELIMIT_GLOBAL (CLOCKS_PER_SEC / 4)\n#define TIMELIMIT_SUGGESTION (CLOCKS_PER_SEC / 10)\n#define TIMELIMIT (CLOCKS_PER_SEC / 20)\n"
custom_tl_defines_tl = "#define TIMELIMIT_GLOBAL CUSTOM_TIMELIMIT_GLOBAL\n#define TIMELIMIT_SUGGESTION CUSTOM_TIMELIMIT_SUGGESTION\n#define TIMELIMIT CUSTOM_TIMELIMIT\n"
tl_defines = "#ifndef CUSTOM_TIMELIMITS\n" + default_tl_defines + "#else\n" + custom_tl_defines_tl + "#endif\n"
base.replaceInFile("./src/hunspell/atypes.hxx", default_tl_defines, tl_defines)
os.chdir("../")

View File

@ -14,12 +14,32 @@ DEFINES += KERNEL_USE_DYNAMIC_LIBRARY
TEMPLATE = app
CONFIG += hunspell_build_static
CORE_ROOT_DIR = $$PWD/../../../..
PWD_ROOT_DIR = $$PWD
include($$CORE_ROOT_DIR/Common/base.pri)
include($$CORE_ROOT_DIR/Common/3dParty/icu/icu.pri)
include($$CORE_ROOT_DIR/Common/3dParty/hunspell/qt/hunspell.pri)
ADD_DEPENDENCY(UnicodeConverter kernel hunspell)
# custom time limits of hunspell in clocks (if before.py was executed)
# when increasing the limit for each case, it is important to consider that the total time will
# also increase, so it is good to increase the global limit. this works the same for the candidate limit with suggest limit
DEFINES += CUSTOM_TIMELIMITS
escape_bracket=
!core_windows:escape_bracket=\\
# total time limit per word for all cases. (default is CLOCKS_PER_SEC/4)
DEFINES += "CUSTOM_TIMELIMIT_GLOBAL=$${escape_bracket}(20*CLOCKS_PER_SEC$${escape_bracket})"
# total time limit per "1 case" - forgotten char, double char, moved char and so on for all candidates. (default is CLOCKS_PER_SEC/10)
DEFINES += "CUSTOM_TIMELIMIT_SUGGESTION=$${escape_bracket}(5*CLOCKS_PER_SEC$${escape_bracket})"
# time limit per candidate (default is CLOCKS_PER_SEC/20)
DEFINES += "CUSTOM_TIMELIMIT=$${escape_bracket}(CLOCKS_PER_SEC$${escape_bracket}\)"
ADD_DEPENDENCY(UnicodeConverter kernel)
core_windows:LIBS += -lgdi32 -ladvapi32 -luser32 -lshell32

View File

@ -20,9 +20,9 @@ CONFIG_PREFIX=" --enable-extras=yes \
--enable-dyload=no \
--with-data-packaging=static"
CFLAGS="-O3 -D__STDC_INT64__ -fno-exceptions -fno-short-wchar -fno-short-enums -fembed-bitcode"
CFLAGS="-O3 -D__STDC_INT64__ -fno-exceptions -fno-short-wchar -fno-short-enums"
CXXFLAGS="${CFLAGS} -std=c++11 -fembed-bitcode"
CXXFLAGS="${CFLAGS} -std=c++11"
#will set value to 1
defines_config_set_1=(
@ -215,9 +215,9 @@ function build() {
export CXX="$(xcrun -find clang++)"
export CC="$(xcrun -find clang)"
export CFLAGS="-fembed-bitcode -isysroot $SDKROOT -I$SDKROOT/usr/include/ -I./include/ -arch $ARCH $IOS_MIN_VER $ICU_FLAGS $CFLAGS ${ADDITION_FLAG}"
export CXXFLAGS="${CXXFLAGS} -fembed-bitcode -stdlib=libc++ -isysroot $SDKROOT -I$SDKROOT/usr/include/ -I./include/ -arch $ARCH $IOS_MIN_VER $ICU_FLAGS ${ADDITION_FLAG}"
export LDFLAGS="-fembed-bitcode -stdlib=libc++ -L$SDKROOT/usr/lib/ -isysroot $SDKROOT -Wl,-dead_strip $IOS_MIN_VER -lstdc++ ${ADDITION_FLAG}"
export CFLAGS="-isysroot $SDKROOT -I$SDKROOT/usr/include/ -I./include/ -arch $ARCH $IOS_MIN_VER $ICU_FLAGS $CFLAGS ${ADDITION_FLAG}"
export CXXFLAGS="${CXXFLAGS} -stdlib=libc++ -isysroot $SDKROOT -I$SDKROOT/usr/include/ -I./include/ -arch $ARCH $IOS_MIN_VER $ICU_FLAGS ${ADDITION_FLAG}"
export LDFLAGS="-stdlib=libc++ -L$SDKROOT/usr/lib/ -isysroot $SDKROOT -Wl,-dead_strip $IOS_MIN_VER -lstdc++ ${ADDITION_FLAG}"
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}

View File

@ -84,24 +84,24 @@ function set_ios_cpu_feature() {
armv7)
export CC="xcrun -sdk iphoneos clang -arch armv7"
export CXX="xcrun -sdk iphoneos clang++ -arch armv7"
export CFLAGS="-arch armv7 -target armv7-ios-darwin -march=armv7 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -Wno-unused-function -fstrict-aliasing -Oz -Wno-ignored-optimization-argument -DIOS -isysroot ${sysroot} -fembed-bitcode -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch armv7 -target armv7-ios-darwin -march=armv7 -isysroot ${sysroot} -fembed-bitcode -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch armv7 -target armv7-ios-darwin -march=armv7 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fstrict-aliasing -fembed-bitcode -DIOS -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export CFLAGS="-arch armv7 -target armv7-ios-darwin -march=armv7 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -Wno-unused-function -fstrict-aliasing -Oz -Wno-ignored-optimization-argument -DIOS -isysroot ${sysroot} -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch armv7 -target armv7-ios-darwin -march=armv7 -isysroot ${sysroot} -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch armv7 -target armv7-ios-darwin -march=armv7 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fstrict-aliasing -DIOS -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
;;
arm64)
export CC="xcrun -sdk iphoneos clang -arch arm64"
export CXX="xcrun -sdk iphoneos clang++ -arch arm64"
export CFLAGS="-arch arm64 -target aarch64-ios-darwin -march=armv8 -mcpu=generic -Wno-unused-function -fstrict-aliasing -Oz -Wno-ignored-optimization-argument -DIOS -isysroot ${sysroot} -fembed-bitcode -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch arm64 -target aarch64-ios-darwin -march=armv8 -isysroot ${sysroot} -fembed-bitcode -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch arm64 -target aarch64-ios-darwin -march=armv8 -mcpu=generic -fstrict-aliasing -fembed-bitcode -DIOS -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export CFLAGS="-arch arm64 -target aarch64-ios-darwin -march=armv8 -mcpu=generic -Wno-unused-function -fstrict-aliasing -Oz -Wno-ignored-optimization-argument -DIOS -isysroot ${sysroot} -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch arm64 -target aarch64-ios-darwin -march=armv8 -isysroot ${sysroot} -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch arm64 -target aarch64-ios-darwin -march=armv8 -mcpu=generic -fstrict-aliasing -DIOS -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
;;
arm64e)
# -march=armv8.3 ???
export CC="xcrun -sdk iphoneos clang -arch arm64e"
export CXX="xcrun -sdk iphoneos clang++ -arch arm64e"
export CFLAGS="-arch arm64e -target aarch64-ios-darwin -Wno-unused-function -fstrict-aliasing -DIOS -isysroot ${sysroot} -fembed-bitcode -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch arm64e -target aarch64-ios-darwin -isysroot ${sysroot} -fembed-bitcode -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch arm64e -target aarch64-ios-darwin -fstrict-aliasing -fembed-bitcode -DIOS -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export CFLAGS="-arch arm64e -target aarch64-ios-darwin -Wno-unused-function -fstrict-aliasing -DIOS -isysroot ${sysroot} -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch arm64e -target aarch64-ios-darwin -isysroot ${sysroot} -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch arm64e -target aarch64-ios-darwin -fstrict-aliasing -DIOS -miphoneos-version-min=${ios_min_target} -I${sysroot}/usr/include"
;;
i386)
export CC="xcrun -sdk iphonesimulator clang -arch i386"
@ -120,9 +120,9 @@ function set_ios_cpu_feature() {
sim-arm64)
export CC="xcrun -sdk iphonesimulator clang -arch arm64"
export CXX="xcrun -sdk iphonesimulator clang++ -arch arm64"
export CFLAGS="-arch arm64 -target aarch64-apple-darwin -march=armv8 -mcpu=generic -Wno-unused-function -fstrict-aliasing -Oz -Wno-ignored-optimization-argument -DIOS -isysroot ${sysroot} -fembed-bitcode -mios-simulator-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch arm64 -target aaarch64-apple-darwin -march=armv8 -isysroot ${sysroot} -fembed-bitcode -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch arm64 -target aarch64-apple-darwin -march=armv8 -mcpu=generic -fstrict-aliasing -fembed-bitcode -DIOS -mios-simulator-version-min=${ios_min_target} -I${sysroot}/usr/include"
export CFLAGS="-arch arm64 -target aarch64-apple-darwin -march=armv8 -mcpu=generic -Wno-unused-function -fstrict-aliasing -Oz -Wno-ignored-optimization-argument -DIOS -isysroot ${sysroot} -mios-simulator-version-min=${ios_min_target} -I${sysroot}/usr/include"
export LDFLAGS="-arch arm64 -target aaarch64-apple-darwin -march=armv8 -isysroot ${sysroot} -L${sysroot}/usr/lib "
export CXXFLAGS="-std=c++11 -arch arm64 -target aarch64-apple-darwin -march=armv8 -mcpu=generic -fstrict-aliasing -DIOS -mios-simulator-version-min=${ios_min_target} -I${sysroot}/usr/include"
;;
*)
log_error "not support" && exit 1

View File

@ -107,26 +107,26 @@ function configure_make() {
# openssl1.1.1d can be set normally, 1.1.0f does not take effect
./Configure iphoneos-cross no-shared --prefix="${PREFIX_DIR}" enable-ssl3 enable-ssl3-method enable-md2
sed -ie "s!-fno-common!-fno-common -fembed-bitcode !" "Makefile"
#sed -ie "s!-fno-common!-fno-common -fembed-bitcode !" "Makefile"
elif [[ "${ARCH_NAME}" == "arm64" ]]; then
# openssl1.1.1d can be set normally, 1.1.0f does not take effect
./Configure iphoneos-cross no-shared --prefix="${PREFIX_DIR}" enable-ssl3 enable-ssl3-method enable-md2
sed -ie "s!-fno-common!-fno-common -fembed-bitcode !" "Makefile"
#sed -ie "s!-fno-common!-fno-common -fembed-bitcode !" "Makefile"
elif [[ "${ARCH_NAME}" == "i386" ]]; then
# openssl1.1.1d can be set normally, 1.1.0f does not take effect
./Configure darwin-i386-cc no-shared --prefix="${PREFIX_DIR}" enable-ssl3 enable-ssl3-method enable-md2
sed -ie "s!-fno-common!-fno-common -fembed-bitcode !" "Makefile"
#sed -ie "s!-fno-common!-fno-common -fembed-bitcode !" "Makefile"
sed -i -e 's/-mtune=intel//g' "Makefile"
elif [[ "${ARCH_NAME}" == "sim_arm64" ]]; then
# openssl1.1.1d can be set normally, 1.1.0f does not take effect
./Configure iphoneos-cross no-shared --prefix="${PREFIX_DIR}" enable-ssl3 enable-ssl3-method enable-md2
sed -ie "s!-fno-common!-fno-common -fembed-bitcode !" "Makefile"
#sed -ie "s!-fno-common!-fno-common -fembed-bitcode !" "Makefile"
else
log_error "not support" && exit 1

View File

@ -244,3 +244,4 @@
#define AVS_FILEUTILS_ERROR_CONVERT_LIMITS (AVS_ERROR_FIRST + AVS_FILEUTILS_ERROR_FIRST + 0x005d)
#define AVS_FILEUTILS_ERROR_CONVERT_ROWLIMITS (AVS_ERROR_FIRST + AVS_FILEUTILS_ERROR_FIRST + 0x005e)
#define AVS_FILEUTILS_ERROR_CONVERT_DETECT (AVS_ERROR_FIRST + AVS_FILEUTILS_ERROR_FIRST + 0x005f)
#define AVS_FILEUTILS_ERROR_CONVERT_CELLLIMITS (AVS_ERROR_FIRST + AVS_FILEUTILS_ERROR_FIRST + 0x0060)

View File

@ -740,13 +740,33 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
if (OfficeUtils.IsArchive(fileName) == S_OK && (false == isPdfFormatFile(bufferDetect, dwDetectdBytes, sDocumentID)))
{
if (isOOXFormatFile(fileName))
{
if (bufferDetect)
delete[] bufferDetect;
bufferDetect = NULL;
return true;
}
else if (isOpenOfficeFormatFile(fileName, sDocumentID))
return true;
{
if (bufferDetect)
delete[] bufferDetect;
bufferDetect = NULL;
return true;
}
else if (isOnlyOfficeFormatFile(fileName))
return true;
{
if (bufferDetect)
delete[] bufferDetect;
bufferDetect = NULL;
return true;
}
else if (isXpsFile(fileName))
return true;
{
if (bufferDetect)
delete[] bufferDetect;
bufferDetect = NULL;
return true;
}
}
//-----------------------------------------------------------------------------------------------
@ -879,6 +899,16 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
nFileType = AVS_OFFICESTUDIO_FILE_TEAMLAB_DOCY;
else if (0 == sExt.compare(L".txt") || 0 == sExt.compare(L".xml") || 0 == sExt.compare(L".rtf") || 0 == sExt.compare(L".doc") || 0 == sExt.compare(L".docx") || 0 == sExt.compare(L".md"))
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT;
else if (0 == sExt.compare(L".pages"))
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_PAGES;
else if (0 == sExt.compare(L".numbers"))
nFileType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_NUMBERS;
else if (0 == sExt.compare(L".key"))
nFileType = AVS_OFFICESTUDIO_FILE_PRESENTATION_KEY;
else if (0 == sExt.compare(L".hwp"))
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HWP;
else if (0 == sExt.compare(L".hwpx"))
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HWPX;
if (nFileType != AVS_OFFICESTUDIO_FILE_UNKNOWN)
return true;
@ -1345,6 +1375,7 @@ std::wstring COfficeFileFormatChecker::GetExtensionByType(int type)
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTM:
return L".dotm";
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC:
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC_FLAT:
return L".doc";
case AVS_OFFICESTUDIO_FILE_DOCUMENT_ODT:
return L".odt";

View File

@ -56,6 +56,9 @@
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_OFORM AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0015
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCXF AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0016
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_OFORM_PDF AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0017
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_PAGES AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0018
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_HWP AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0019
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_HWPX AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0020
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_XML AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0030
@ -72,6 +75,7 @@
#define AVS_OFFICESTUDIO_FILE_PRESENTATION_OTP AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x000a
#define AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX_PACKAGE AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x000b
#define AVS_OFFICESTUDIO_FILE_PRESENTATION_ODG AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x000c
#define AVS_OFFICESTUDIO_FILE_PRESENTATION_KEY AVS_OFFICESTUDIO_FILE_PRESENTATION + 0x000d
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET 0x0100
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0001
@ -87,6 +91,7 @@
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_OTS AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000a
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX_FLAT AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000b
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX_PACKAGE AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000c
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_NUMBERS AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x000d
#define AVS_OFFICESTUDIO_FILE_CROSSPLATFORM 0x0200
#define AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0001

View File

@ -148,7 +148,7 @@ mac {
CONFIG += core_mac
CONFIG += core_mac_64
DEFINES += _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
DEFINES += _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
}
}
@ -185,7 +185,7 @@ core_mac {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
QMAKE_LFLAGS += -isysroot $$QMAKE_MAC_SDK_PATH
# xcode15 add new linker
# xcode15 add new linker
QMAKE_LFLAGS += -Wl,-ld_classic
QMAKE_CFLAGS += "-Wno-implicit-function-declaration"
@ -301,22 +301,25 @@ linux_arm64 {
core_ios {
CORE_BUILDS_PLATFORM_PREFIX = ios
!versionAtLeast(QMAKE_XCODE_VERSION, 16.0) {
QMAKE_CFLAGS += -fembed-bitcode
QMAKE_CXXFLAGS += -fembed-bitcode
QMAKE_LFLAGS += -fembed-bitcode
} else {
CONFIG -= bitcode
}
CONFIG(iphonesimulator, iphoneos|iphonesimulator): {
message("iphonesimulator")
CORE_BUILDS_PLATFORM_PREFIX = ios_simulator
QMAKE_CFLAGS += -fembed-bitcode
QMAKE_CXXFLAGS += -fembed-bitcode
QMAKE_LFLAGS += -fembed-bitcode
QMAKE_CFLAGS += -fobjc-arc
QMAKE_CXXFLAGS += -fobjc-arc
} else {
QMAKE_IOS_DEPLOYMENT_TARGET = 11.0
QMAKE_CFLAGS += -fembed-bitcode
QMAKE_CXXFLAGS += -fembed-bitcode
QMAKE_LFLAGS += -fembed-bitcode
QMAKE_CFLAGS += -fobjc-arc
QMAKE_CXXFLAGS += -fobjc-arc
@ -573,7 +576,7 @@ defineTest(ADD_DEPENDENCY) {
libs = $$ARGS
for(lib, libs) {
CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH
isEqual(lib, videoplayer) {
libvlc {
CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH/mediaplayer
@ -586,7 +589,7 @@ defineTest(ADD_DEPENDENCY) {
isEqual(lib, qtascdocumentscore):CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH_DST/xp
isEqual(lib, videoplayer):CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH_DST/xp
isEqual(lib, ooxmlsignature):CORE_BUILDS_LIBRARIES_PATH_DST=$$CORE_BUILDS_LIBRARIES_PATH_DST/xp
}
}
!bundle_dylibs:LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH_DST -l$$lib
bundle_dylibs:LIBS += -F$$CORE_BUILDS_LIBRARIES_PATH_DST -framework $$lib
}

View File

@ -4,6 +4,7 @@
#include <stdio.h>
#define LOG_BUFFER_SIZE 1000
// not intended for use in production. only for testing/debugging purposes
namespace Logging
{
void logBytes(char* name, unsigned char* str, int len)

View File

@ -847,40 +847,10 @@ namespace agg
if (calculate_tensor_coefs)
calculate_tensor();
float minxres = m_oGradientInfo.shading.patch[0][0].x;
float minyres = m_oGradientInfo.shading.patch[0][0].y;
float maxxres = m_oGradientInfo.shading.patch[0][0].x;
float maxyres = m_oGradientInfo.shading.patch[0][0].y;
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 4; j++)
{
if (m_oGradientInfo.shading.patch[i][j].x > maxxres)
{
maxxres = m_oGradientInfo.shading.patch[i][j].x;
}
if (m_oGradientInfo.shading.patch[i][j].y > maxyres)
{
maxyres = m_oGradientInfo.shading.patch[i][j].y;
}
if (m_oGradientInfo.shading.patch[i][j].x < minxres)
{
minxres = m_oGradientInfo.shading.patch[i][j].x;
}
if (m_oGradientInfo.shading.patch[i][j].y < minyres)
{
minyres = m_oGradientInfo.shading.patch[i][j].y;
}
}
}
RES = std::max(1.0f, std::max(maxxres - minxres, maxyres - minyres) / 3);
float delta = 1.0 / RES;
float u = 0, v = 0;
auto start_p = get_p_curve(u, v);
xmax_curve = xmin_curve = start_p.x;
ymax_curve = ymin_curve = start_p.y;
precalc = std::vector<std::vector<ColorT>>(RES, std::vector<ColorT>(RES, {0, 0, 0, 0}));
/*
* Небольшая оптимизация основанная на том, что данная фигура не выходит за границы своих опорных точек.
@ -918,7 +888,7 @@ namespace agg
RES = nRES;
}
precalc = std::vector<std::vector<ColorT>>(RES, std::vector<ColorT>(RES, {0, 0, 0, 0}));
delta = 1.0f / RES;
float delta = 1.0f / RES;
std::vector<std::pair<int, int>> next_indexes(RES + 1);
u = 0;
for (int i = 0; i < RES; ++i)
@ -956,8 +926,6 @@ namespace agg
}
ColorT ifswapRGB(const ColorT &c)
{
if (m_bSwapRGB) {
return c;
}

View File

@ -250,3 +250,123 @@ namespace NSBase64
return Base64DecodeBase(szSrc, nSrcLen, pbDest, pnDestLen);
}
}
#include <cstring>
namespace NSBase32
{
const unsigned char PADDING_CHAR_32 = '=';
inline void pad(unsigned char* buf, int len)
{
for (int i = 0; i < len; i++)
buf[i] = PADDING_CHAR_32;
}
inline unsigned char shift_right(unsigned char byte, signed char offset)
{
if (offset > 0)
return byte >> offset;
else
return byte << -offset;
}
inline unsigned char shift_left(unsigned char byte, signed char offset)
{
return shift_right(byte, - offset);
}
unsigned char encode_char(unsigned char c)
{
static unsigned char base32[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
return base32[c & 0x1F];
}
int decode_char(unsigned char c)
{
char retval = -2;
if (c >= 'A' && c <= 'Z')
retval = c - 'A';
else if (c >= '2' && c <= '7')
retval = c - '2' + 26;
else if (c == PADDING_CHAR_32)
retval = -1;
return retval;
}
int decode_sequence(const unsigned char* coded, unsigned char* plain)
{
plain[0] = 0;
for (int block = 0; block < 8; block++)
{
int offset = (8 - 5 - (5*block) % 8);
int octet = (block*5) / 8;
int c = decode_char(coded[block]);
if (c < 0)
return c;
plain[octet] |= shift_left(c, offset);
if (offset < 0)
{ // does this block overflows to next octet?
plain[octet+1] = shift_left(c, 8 + offset);
}
}
return 5;
}
bool Decode(unsigned char* in, int inLen, unsigned char* out)
{
for (size_t i = 0, j = 0; (i + 8) <= inLen; i += 8, j += 5)
{
int n = decode_sequence(&in[i], &out[j]);
if (n == -2)
return false;
if (n < 5)
break;
}
return true;
}
void encode_sequence(const unsigned char* plain, int len, unsigned char* coded)
{
for (int block = 0; block < 8; block++)
{
int octet = (block*5) / 8;
int junk = (8 - 5 - (5*block) % 8);
if (octet >= len)
{
pad(&coded[block], 8 - block);
return;
}
unsigned char c = shift_right(plain[octet], junk); // first part
if (junk < 0 // is there a second part?
&& octet < len - 1) // is there still something to read?
{
c |= shift_right(plain[octet+1], 8 + junk);
}
coded[block] = encode_char(c);
}
}
bool Encode(unsigned char* src, int len, unsigned char* dst)
{
for (int i = 0, j = 0; i < len; i += 5, j += 8)
{
int tmpLen = len - i;
encode_sequence(&src[i], tmpLen > 5 ? 5 : tmpLen, &dst[j]);
}
return true;
}
int DecodeGetRequiredLength(int bytes)
{
return (((bytes)/8)*5);
}
int EncodeGetRequiredLength(int bytes)
{
return (((bytes)/5)*8 + ((bytes) % 5 ? 8 : 0));
}
}

View File

@ -58,4 +58,13 @@ namespace NSBase64
KERNEL_DECL int Base64Decode(const wchar_t* szSrc, int nSrcLen, BYTE *pbDest, int *pnDestLen);
}
namespace NSBase32
{
KERNEL_DECL bool Decode(unsigned char* in, int inLen, unsigned char* out);
KERNEL_DECL bool Encode(unsigned char* in, int inLen, unsigned char* out);
KERNEL_DECL int DecodeGetRequiredLength(int bytes);
KERNEL_DECL int EncodeGetRequiredLength(int bytes);
}
#endif//_BUILD_BASE64_CROSSPLATFORM_DEFINE

View File

@ -1535,6 +1535,11 @@ namespace NSFile
return bIsSuccess;
}
bool CFileBinary::IsGlobalTempPathUse()
{
return g_overrideTmpPath.empty() ? false : true;
}
std::wstring CFileBinary::GetTempPath()
{
if (!g_overrideTmpPath.empty())

View File

@ -189,6 +189,7 @@ namespace NSFile
static void SetTempPath(const std::wstring& strTempPath);
static std::wstring GetTempPath();
static bool IsGlobalTempPathUse();
static std::wstring CreateTempFileWithUniqueName(const std::wstring& strFolderPathRoot, const std::wstring& Prefix);
static bool OpenTempFile(std::wstring *pwsName, FILE **ppFile, wchar_t *wsMode, wchar_t *wsExt, wchar_t *wsFolder, wchar_t* wsName = NULL);

View File

@ -648,7 +648,7 @@ namespace NSStringUtils
}
void CStringBuilder::AddInt(int val)
{
AddSize(10);
AddSize(11);
AddIntNoCheck(val);
}
void CStringBuilder::AddUInt(unsigned int val)
@ -682,7 +682,11 @@ namespace NSStringUtils
}
if (val < 0)
{
val = -val;
if (val == -2147483648)
val = 2147483647;
else
val = -val;
*m_pDataCur++ = (wchar_t)'-';
++m_lSizeCur;
}

View File

@ -38,6 +38,9 @@
#include "../xml/include/xmlutils.h"
#include "../fontengine/TextHyphen.h"
#define VALUE_TO_STRING(x) #x
#define VALUE(x) VALUE_TO_STRING(x)
namespace NSDoctRenderer
{
class CAdditionalData
@ -145,13 +148,23 @@ namespace NSDoctRenderer
NSHyphen::CEngine::Init(private_GetFile(sConfigDir, oNodeDict.GetText()));
}
bool bIsAbsoluteFontsPath = false;
if (!m_bIsNotUseConfigAllFontsDir)
{
std::wstring sAllFontsPath = oNode.ReadNodeText(L"allfonts");
if (!sAllFontsPath.empty())
{
m_strAllFonts = private_GetFile(sConfigDir, sAllFontsPath);
if (NSFile::CFileBinary::Exists(sConfigDir + sAllFontsPath))
m_strAllFonts = sConfigDir + sAllFontsPath;
else if (NSFile::CFileBinary::Exists(sAllFontsPath))
m_strAllFonts = sAllFontsPath;
else
{
std::wstring sAllFontsDir = NSFile::GetDirectoryName(sAllFontsPath);
if (NSDirectory::Exists(sConfigDir + sAllFontsDir))
m_strAllFonts = sConfigDir + sAllFontsPath;
else
m_strAllFonts = sAllFontsPath;
}
// на папку может не быть прав
if (!NSFile::CFileBinary::Exists(m_strAllFonts))
@ -163,20 +176,16 @@ namespace NSDoctRenderer
if (NSDirectory::CreateDirectory(sAppDir + L"/docbuilder"))
{
m_strAllFonts = sAppDir + L"/docbuilder/AllFonts.js";
// файл может не существовать пока - и тогда private_GetFile не учтет его
bIsAbsoluteFontsPath = true;
}
}
else
{
fclose(pFileNative);
NSFile::CFileBinary::Remove(m_strAllFonts);
}
}
}
}
if (!bIsAbsoluteFontsPath)
m_strAllFonts = private_GetFile(sConfigDir, m_strAllFonts);
}
m_strSdkPath = oNode.ReadNodeText(L"sdkjs");
@ -197,28 +206,14 @@ namespace NSDoctRenderer
char* GetVersion()
{
std::wstring sFile = m_strSdkPath + L"/word/sdk-all-min.js";
std::string sVersion = VALUE(INTVER);
std::string sData;
if (!NSFile::CFileBinary::ReadAllTextUtf8A(sFile, sData))
return NULL;
std::string::size_type startPos = sData.find("Version:");
if (std::string::npos == startPos)
return NULL;
startPos += 8;
std::string::size_type endPos = sData.find(')', startPos);
if (std::string::npos == endPos)
return NULL;
size_t sSrcLen = endPos - startPos + 1;
size_t sSrcLen = sVersion.size();
if (sSrcLen == 0)
return NULL;
char* sRet = new char[sSrcLen + 1];
memcpy(sRet, sData.c_str() + startPos, sSrcLen);
memcpy(sRet, sVersion.c_str(), sSrcLen);
sRet[sSrcLen] = '\0';
return sRet;
}

View File

@ -83,6 +83,10 @@ public class CDocBuilder {
return new CDocBuilderContext(c_GetContext(c_internal));
}
public CDocBuilderContext getContext(boolean enterContext) {
return new CDocBuilderContext(c_GetContextWithEnterParam(c_internal, enterContext));
}
public static void initialize() {
c_Initialize();
}
@ -135,6 +139,7 @@ public class CDocBuilder {
private static native String c_GetVersion(long self);
private static native long c_GetContext(long self);
private static native long c_GetContextWithEnterParam(long self, boolean enterContext);
private static native void c_Initialize();
private static native void c_InitializeWithDirectory(String directory);

View File

@ -40,7 +40,7 @@ public class NativeLibraryLoader {
throw new RuntimeException("Unsupported OS");
}
String[] libs = {"UnicodeConverter", "kernel", "kernel_network", "graphics", "doctrenderer", "docbuilder.jni"};
String[] libs = {"UnicodeConverter", "kernel", "kernel_network", "graphics", "PdfFile", "XpsFile", "DjVuFile", "DocxRenderer", "doctrenderer", "docbuilder.jni"};
String prefix = "";
if (OSChecker.isMac() || OSChecker.isLinux()) {

View File

@ -162,6 +162,12 @@ jlong Java_docbuilder_CDocBuilder_c_1GetContext(JNIEnv* env, jclass cls, jlong s
return reinterpret_cast<jlong>(new CDocBuilderContext(pSelf->GetContext()));
}
jlong Java_docbuilder_CDocBuilder_c_1GetContextWithEnterParam(JNIEnv* env, jclass cls, jlong self, jboolean enterContext)
{
CDocBuilder* pSelf = reinterpret_cast<CDocBuilder*>(self);
return reinterpret_cast<jlong>(new CDocBuilderContext(pSelf->GetContext((bool)enterContext)));
}
void Java_docbuilder_CDocBuilder_c_1Initialize(JNIEnv* env, jclass cls)
{
CDocBuilder::Initialize();

View File

@ -167,6 +167,14 @@ JNIEXPORT jstring JNICALL Java_docbuilder_CDocBuilder_c_1GetVersion
JNIEXPORT jlong JNICALL Java_docbuilder_CDocBuilder_c_1GetContext
(JNIEnv *, jclass, jlong);
/*
* Class: docbuilder_CDocBuilder
* Method: c_GetContextWithEnterParam
* Signature: (JZ)J
*/
JNIEXPORT jlong JNICALL Java_docbuilder_CDocBuilder_c_1GetContextWithEnterParam
(JNIEnv *, jclass, jlong, jboolean);
/*
* Class: docbuilder_CDocBuilder
* Method: c_Initialize

View File

@ -17,7 +17,6 @@ public class Program {
builder.createFile(FileTypes.Document.DOCX);
CDocBuilderContext context = builder.getContext();
CDocBuilderContextScope scope = context.createScope();
CDocBuilderValue global = context.getGlobal();

View File

@ -203,7 +203,7 @@ def _loadLibrary(path):
_lib.CDocBuilder_GetVersion.argtypes = [OBJECT_HANDLE]
_lib.CDocBuilder_GetVersion.restype = STRING_HANDLE
_lib.CDocBuilder_GetContext.argtypes = [OBJECT_HANDLE]
_lib.CDocBuilder_GetContext.argtypes = [OBJECT_HANDLE, ctypes.c_bool]
_lib.CDocBuilder_GetContext.restype = OBJECT_HANDLE
_lib.CDocBuilder_Initialize.argtypes = []
@ -492,8 +492,8 @@ class CDocBuilder:
_lib.DeleteCharP(ctypes.cast(strVersion, ctypes.c_char_p))
return version
def GetContext(self):
return CDocBuilderContext(OBJECT_HANDLE(_lib.CDocBuilder_GetContext(self._internal)))
def GetContext(self, enterContext=True):
return CDocBuilderContext(OBJECT_HANDLE(_lib.CDocBuilder_GetContext(self._internal, ctypes.c_bool(enterContext))))
@classmethod
def Initialize(cls, directory=None):

View File

@ -301,9 +301,9 @@ char* CDocBuilder_GetVersion(CDocBuilder* self)
return self->GetVersion();
}
CDocBuilderContext* CDocBuilder_GetContext(CDocBuilder* self)
CDocBuilderContext* CDocBuilder_GetContext(CDocBuilder* self, bool enterContext)
{
return new CDocBuilderContext(self->GetContext());
return new CDocBuilderContext(self->GetContext(enterContext));
}
void CDocBuilder_Initialize()

View File

@ -97,7 +97,7 @@ DOCBUILDER_FUNC_DECL bool CDocBuilder_IsSaveWithDoctrendererMode(CDocBuilder* se
DOCBUILDER_FUNC_DECL char* CDocBuilder_GetVersion(CDocBuilder* self);
DOCBUILDER_FUNC_DECL CDocBuilderContext* CDocBuilder_GetContext(CDocBuilder* self);
DOCBUILDER_FUNC_DECL CDocBuilderContext* CDocBuilder_GetContext(CDocBuilder* self, bool enterContext);
DOCBUILDER_FUNC_DECL void CDocBuilder_Initialize();
DOCBUILDER_FUNC_DECL void CDocBuilder_InitializeWithDirectory(const wchar_t* directory);

View File

@ -56,7 +56,6 @@ CV8RealTimeWorker::CV8RealTimeWorker(NSDoctRenderer::CDocBuilder* pBuilder, cons
CJSContextScope scope(m_context);
CJSContext::Embed<CNativeControlEmbed>(false);
CJSContext::Embed<CGraphicsEmbed>();
NSJSBase::CreateDefaults();
JSSmart<CJSTryCatch> try_catch = m_context->GetExceptions();
@ -241,6 +240,14 @@ bool CV8RealTimeWorker::InitVariables()
if (try_catch->Check())
return false;
}
if (!m_sJSCodeStart.empty())
{
m_context->runScript(m_sJSCodeStart, try_catch);
if (try_catch->Check())
return false;
}
return true;
}
@ -297,7 +304,7 @@ bool CV8RealTimeWorker::OpenFile(const std::wstring& sBasePath, const std::wstri
else if (1 == m_nFileType)
pNative->m_strEditorType = L"presentation";
else if (7 == m_nFileType)
pNative->m_strEditorType = L"draw";
pNative->m_strEditorType = L"visio";
else
pNative->m_strEditorType = L"spreadsheet";

View File

@ -422,6 +422,7 @@ public:
int m_nFileType;
std::string m_sUtf8ArgumentJSON;
std::string m_sGlobalVariable;
std::string m_sJSCodeStart;
CJSContextData m_oContextData;
@ -455,7 +456,8 @@ namespace NSDoctRenderer
std::wstring m_sTmpFolder;
std::wstring m_sFileDir;
int m_nFileType;
bool m_bJavascriptBeforeEditor;
std::wstring m_sCommandsBeforeContextCreated;
std::wstring m_sX2tPath;
@ -478,7 +480,7 @@ namespace NSDoctRenderer
public:
CDocBuilder_Private() : CDoctRendererConfig(), m_sTmpFolder(NSFile::CFileBinary::GetTempPath()), m_nFileType(-1),
m_pWorker(NULL), m_pAdditionalData(NULL), m_bIsInit(false), m_bIsServerSafeVersion(false),
m_sGlobalVariable(""), m_bIsGlobalVariableUse(false), m_pParent(NULL), m_bJavascriptBeforeEditor(false)
m_sGlobalVariable(""), m_bIsGlobalVariableUse(false), m_pParent(NULL), m_sCommandsBeforeContextCreated(L"")
{
}
@ -639,9 +641,6 @@ namespace NSDoctRenderer
NSDirectory::CreateDirectory(m_sFileDir + L"/changes");
}
if (m_bJavascriptBeforeEditor)
CheckWorkerAfterOpen();
return bRet;
#else
std::wstring sPath = m_sX2tPath + L"/empty/new.";
@ -728,22 +727,13 @@ namespace NSDoctRenderer
oBuilder.WriteEncodeXmlString(sFolder);
oBuilder.WriteString(L"/Editor.bin</m_sFileTo><m_nFormatTo>8192</m_nFormatTo>");
if (!m_bIsNotUseConfigAllFontsDir)
{
oBuilder.WriteString(L"<m_sFontDir>");
oBuilder.WriteEncodeXmlString(m_sX2tPath + L"/sdkjs/common");
oBuilder.WriteString(L"</m_sFontDir>");
}
else
{
oBuilder.WriteString(L"<m_sFontDir>");
oBuilder.WriteEncodeXmlString(NSFile::GetDirectoryName(m_strAllFonts));
oBuilder.WriteString(L"</m_sFontDir>");
oBuilder.WriteString(L"<m_sFontDir>");
oBuilder.WriteEncodeXmlString(NSFile::GetDirectoryName(m_strAllFonts));
oBuilder.WriteString(L"</m_sFontDir>");
oBuilder.WriteString(L"<m_sAllFontsPath>");
oBuilder.WriteEncodeXmlString(m_strAllFonts);
oBuilder.WriteString(L"</m_sAllFontsPath>");
}
oBuilder.WriteString(L"<m_sAllFontsPath>");
oBuilder.WriteEncodeXmlString(m_strAllFonts);
oBuilder.WriteString(L"</m_sAllFontsPath>");
oBuilder.WriteString(L"<m_bIsNoBase64>true</m_bIsNoBase64>");
oBuilder.WriteString(L"<m_sThemeDir>./sdkjs/slide/themes</m_sThemeDir><m_bDontSaveAdditional>true</m_bDontSaveAdditional>");
@ -939,11 +929,7 @@ namespace NSDoctRenderer
LOGGER_SPEED_LAP("open_convert");
if (0 == nReturnCode)
{
if (m_bJavascriptBeforeEditor)
CheckWorkerAfterOpen();
return 0;
}
NSDirectory::DeleteDirectory(m_sFileDir);
m_sFileDir = L"";
@ -1054,22 +1040,13 @@ namespace NSDoctRenderer
oBuilder.WriteString(L"</m_sThemeDir><m_bFromChanges>true</m_bFromChanges><m_bDontSaveAdditional>true</m_bDontSaveAdditional>");
oBuilder.WriteString(L"<m_nCsvTxtEncoding>46</m_nCsvTxtEncoding><m_nCsvDelimiter>4</m_nCsvDelimiter>");
if (!m_bIsNotUseConfigAllFontsDir)
{
oBuilder.WriteString(L"<m_sFontDir>");
oBuilder.WriteEncodeXmlString(m_sX2tPath + L"/sdkjs/common");
oBuilder.WriteString(L"</m_sFontDir>");
}
else
{
oBuilder.WriteString(L"<m_sFontDir>");
oBuilder.WriteEncodeXmlString(NSFile::GetDirectoryName(m_strAllFonts));
oBuilder.WriteString(L"</m_sFontDir>");
oBuilder.WriteString(L"<m_sFontDir>");
oBuilder.WriteEncodeXmlString(NSFile::GetDirectoryName(m_strAllFonts));
oBuilder.WriteString(L"</m_sFontDir>");
oBuilder.WriteString(L"<m_sAllFontsPath>");
oBuilder.WriteEncodeXmlString(m_strAllFonts);
oBuilder.WriteString(L"</m_sAllFontsPath>");
}
oBuilder.WriteString(L"<m_sAllFontsPath>");
oBuilder.WriteEncodeXmlString(m_strAllFonts);
oBuilder.WriteString(L"</m_sAllFontsPath>");
if (!sConvertionParams.empty())
{
@ -1238,36 +1215,27 @@ namespace NSDoctRenderer
{
if (NULL == m_pWorker)
{
m_pWorker = new CV8RealTimeWorker(m_pParent, GetEditorType(), this);
NSDoctRenderer::DoctRendererEditorType editorType = GetEditorType();
if (NSDoctRenderer::DoctRendererEditorType::INVALID == editorType)
return false;
m_pWorker = new CV8RealTimeWorker(m_pParent, editorType, this);
m_pWorker->m_sUtf8ArgumentJSON = m_oParams.m_sArgumentJSON;
m_pWorker->m_sGlobalVariable = m_sGlobalVariable;
m_pWorker->m_sJSCodeStart = U_TO_UTF8(m_sCommandsBeforeContextCreated);
m_sCommandsBeforeContextCreated = L"";
return CheckWorkerAfterOpen();
m_pWorker->m_nFileType = m_nFileType;
CV8Params oParams;
oParams.IsServerSaveVersion = m_bIsServerSafeVersion;
oParams.DocumentDirectory = m_sFileDir;
return m_pWorker->OpenFile(m_sX2tPath, m_sFileDir, editorType, this, &oParams);
}
return true;
}
bool CheckWorkerAfterOpen()
{
if (!m_pWorker)
return false;
m_pWorker->m_nFileType = m_nFileType;
if (-1 == m_nFileType)
{
m_bJavascriptBeforeEditor = true;
return false;
}
m_bJavascriptBeforeEditor = false;
CV8Params oParams;
oParams.IsServerSaveVersion = m_bIsServerSafeVersion;
oParams.DocumentDirectory = m_sFileDir;
return m_pWorker->OpenFile(m_sX2tPath, m_sFileDir, GetEditorType(), this, &oParams);
}
int SaveFile(const std::wstring& ext, const std::wstring& path, const wchar_t* params = NULL)
{
int nType = GetFormatByTexExtention(ext);
@ -1279,21 +1247,26 @@ namespace NSDoctRenderer
if (command.length() < 7 && !retValue) // minimum command (!!!)
return true;
if (m_nFileType == -1)
{
m_sCommandsBeforeContextCreated += command;
return true;
}
Init();
bool bRes = CheckWorker();
if (CheckWorker())
return m_pWorker->ExecuteCommand(command, retValue);
if (!bRes && m_pWorker && m_bJavascriptBeforeEditor)
m_pWorker->InitVariables();
return m_pWorker->ExecuteCommand(command, retValue);
return false;
}
CDocBuilderContext GetContext(bool enterContext)
{
CDocBuilderContext ctx;
CheckWorker();
if (!CheckWorker())
return ctx;
ctx.m_internal->m_context = m_pWorker->m_context;
ctx.m_internal->m_context_data = &m_pWorker->m_oContextData;

View File

@ -445,7 +445,7 @@ namespace NSDoctRenderer
strError = L"code=\"save\"";
bIsBreak = true;
}
else
else if (!js_result2->isNull())
{
JSSmart<CJSTypedArray> typedArray = js_result2->toTypedArray();
NSJSBase::CJSDataBuffer oBuffer = typedArray->getData();
@ -575,7 +575,6 @@ namespace NSDoctRenderer
{
CJSContextScope scope(context);
CJSContext::Embed<CNativeControlEmbed>(false);
CJSContext::Embed<CGraphicsEmbed>();
NSJSBase::CreateDefaults();
JSSmart<CJSTryCatch> try_catch = context->GetExceptions();
@ -987,7 +986,7 @@ namespace NSDoctRenderer
case DoctRendererFormat::IMAGE:
{
editorType = NSDoctRenderer::DoctRendererEditorType::VISIO;
m_pInternal->m_strEditorType = L"draw";
m_pInternal->m_strEditorType = L"visio";
break;
}
default:
@ -1067,7 +1066,6 @@ namespace NSDoctRenderer
{
CJSContextScope scope(context);
CJSContext::Embed<CNativeControlEmbed>();
CJSContext::Embed<CGraphicsEmbed>();
NSJSBase::CreateDefaults();
JSSmart<CJSObject> global = context->GetGlobal();

View File

@ -121,7 +121,7 @@ drawingfile_support {
embed/DrawingFileEmbed.h
SOURCES += \
../../HtmlRenderer/src/HTMLRendererText.cpp \
../graphics/pro/js/wasm/src/HTMLRendererText.cpp \
embed/DrawingFileEmbed.cpp
ADD_FILES_FOR_EMBEDDED_CLASS_HEADER(embed/DrawingFileEmbed.h)

View File

@ -38,10 +38,12 @@
#include "../../PdfFile/PdfFile.h"
#include "../../XpsFile/XpsFile.h"
#include "../../DjVuFile/DjVu.h"
#include "../../DesktopEditor/graphics/pro/js/wasm/src/serialize.h"
#include "../../HtmlRenderer/include/HTMLRendererText.h"
#include "../graphics/pro/js/wasm/src/serialize.h"
#include "../graphics/pro/js/wasm/src/HTMLRendererText.h"
#include "../../DocxRenderer/DocxRenderer.h"
#define CHECKER_FILE_BUFFER_LEN 4096
class CDrawingFile
{
private:
@ -122,7 +124,11 @@ public:
{
CloseFile();
if (NULL == m_pFile)
int nType = DetectFormat(sFile);
switch (nType)
{
case 0:
{
m_pFile = new CPdfFile(m_pApplicationFonts);
if (!m_pFile->LoadFromFile(sFile, L"", sPassword, sPassword))
@ -136,9 +142,20 @@ public:
}
else
m_nType = 0;
break;
}
if (NULL == m_pFile)
case 1:
{
m_pFile = new CDjVuFile(m_pApplicationFonts);
if (!m_pFile->LoadFromFile(sFile, L"", sPassword, sPassword))
{
RELEASEOBJECT(m_pFile);
}
else
m_nType = 1;
break;
}
case 2:
{
m_pFile = new CXpsFile(m_pApplicationFonts);
if (!m_pFile->LoadFromFile(sFile, L"", sPassword, sPassword))
@ -148,16 +165,8 @@ public:
else
m_nType = 2;
}
if (NULL == m_pFile)
{
m_pFile = new CDjVuFile(m_pApplicationFonts);
if (!m_pFile->LoadFromFile(sFile, L"", sPassword, sPassword))
{
RELEASEOBJECT(m_pFile);
}
else
m_nType = 1;
default:
break;
}
return m_pFile ? true : false;
@ -167,42 +176,48 @@ public:
{
CloseFile();
if (NULL == m_pFile)
int nType = DetectFormat(data, size);
switch (nType)
{
m_pFile = new CPdfFile(m_pApplicationFonts);
if (!m_pFile->LoadFromMemory(data, size, L"", sPassword, sPassword))
case 0:
{
if (4 != ((CPdfFile*)m_pFile)->GetError())
m_pFile = new CPdfFile(m_pApplicationFonts);
if (!m_pFile->LoadFromMemory(data, size, L"", sPassword, sPassword))
{
if (4 != ((CPdfFile*)m_pFile)->GetError())
{
RELEASEOBJECT(m_pFile);
}
else
m_nType = 0;
}
else
m_nType = 0;
break;
}
case 1:
{
m_pFile = new CDjVuFile(m_pApplicationFonts);
if (!m_pFile->LoadFromMemory(data, size, L"", sPassword, sPassword))
{
RELEASEOBJECT(m_pFile);
}
else
m_nType = 0;
m_nType = 1;
break;
}
else
m_nType = 0;
}
if (NULL == m_pFile)
{
m_pFile = new CXpsFile(m_pApplicationFonts);
if (!m_pFile->LoadFromMemory(data, size, L"", sPassword, sPassword))
case 2:
{
RELEASEOBJECT(m_pFile);
m_pFile = new CXpsFile(m_pApplicationFonts);
if (!m_pFile->LoadFromMemory(data, size, L"", sPassword, sPassword))
{
RELEASEOBJECT(m_pFile);
}
else
m_nType = 2;
}
else
m_nType = 2;
}
if (NULL == m_pFile)
{
m_pFile = new CDjVuFile(m_pApplicationFonts);
if (!m_pFile->LoadFromMemory(data, size, L"", sPassword, sPassword))
{
RELEASEOBJECT(m_pFile);
}
else
m_nType = 1;
default:
break;
}
return m_pFile ? true : false;
@ -527,12 +542,49 @@ private:
}
if (m_nType == 0)
nRotate = ((CPdfFile*)m_pFile)->GetRotate(nPageIndex);
nWidth = dWidth;
nHeight = dHeight;
nWidth = round(dWidth);
nHeight = round(dHeight);
nPageDpiX = dPageDpiX;
}
int DetectFormat(const std::wstring& sFile)
{
NSFile::CFileBinary oFile;
if (oFile.OpenFile(sFile))
{
LONG size = oFile.GetFileSize();
if (size > CHECKER_FILE_BUFFER_LEN)
size = CHECKER_FILE_BUFFER_LEN;
BYTE* data = new BYTE[size];
oFile.ReadFile(data, size);
int nType = DetectFormat(data, size);
RELEASEARRAYOBJECTS(data);
return nType;
}
return -1;
}
int DetectFormat(BYTE* data, LONG size)
{
// 0 - PDF
// 1 - DJVU
// 2 - XPS
LONG nSize = size < CHECKER_FILE_BUFFER_LEN ? size : CHECKER_FILE_BUFFER_LEN;
char* pData = (char*)data;
for (int i = 0; i < nSize - 5; ++i)
{
int nPDF = strncmp(&pData[i], "%PDF-", 5);
if (!nPDF)
return 0;
}
if ( (8 <= size) && (0x41 == data[0] && 0x54 == data[1] && 0x26 == data[2] && 0x54 == data[3] &&
0x46 == data[4] && 0x4f == data[5] && 0x52 == data[6] && 0x4d == data[7]))
return 1;
return 2;
}
};
#endif // DRAWINGFILE_H

View File

@ -6,16 +6,16 @@ namespace NSDoctRenderer
{
namespace
{
void AppendScript(NSStringUtils::CStringBuilderA* builder, const std::wstring& path)
bool AppendScript(NSStringUtils::CStringBuilderA* builder, const std::wstring& path, const std::string& header = "", const std::string& footer = "")
{
NSFile::CFileBinary oFile;
if (!oFile.OpenFile(path))
return;
return false;
int size = (int)oFile.GetFileSize();
if (size < 3)
return;
return false;
BYTE* pData = new BYTE[size];
DWORD dwReadSize = 0;
@ -26,9 +26,18 @@ namespace NSDoctRenderer
if (pData[0] == 0xEF && pData[1] == 0xBB && pData[2] == 0xBF)
nOffset = 3;
if (!header.empty())
builder->WriteString(header);
builder->WriteString((char*)(pData + nOffset), size - nOffset);
if (!footer.empty())
builder->WriteString(footer);
builder->WriteString("\n\n");
RELEASEARRAYOBJECTS(pData);
return true;
}
bool RunScript(JSSmart<NSJSBase::CJSContext>& context, JSSmart<NSJSBase::CJSTryCatch>& try_catch, const std::wstring& path)
@ -100,12 +109,12 @@ namespace NSDoctRenderer
}
case DoctRendererEditorType::VISIO:
{
if (!NSFile::CFileBinary::Exists(config->m_strSdkPath + L"/draw/sdk-all-min.js"))
if (!NSFile::CFileBinary::Exists(config->m_strSdkPath + L"/visio/sdk-all-min.js"))
return L"";
AppendScript(builder, config->m_strSdkPath + L"/draw/sdk-all-min.js");
AppendScript(builder, config->m_strSdkPath + L"/visio/sdk-all-min.js");
AppendScript(builder, sFontsPath);
AppendScript(builder, config->m_strSdkPath + L"/draw/sdk-all.js");
sCachePath = config->m_strSdkPath + L"/draw/sdk-all";
AppendScript(builder, config->m_strSdkPath + L"/visio/sdk-all.js");
sCachePath = config->m_strSdkPath + L"/visio/sdk-all";
break;
}
case DoctRendererEditorType::PDF:
@ -114,6 +123,7 @@ namespace NSDoctRenderer
AppendScript(builder, sFontsPath);
AppendScript(builder, config->m_strSdkPath + L"/word/sdk-all.js");
AppendScript(builder, config->m_strSdkPath + L"/pdf/src/engine/drawingfile_native.js");
AppendScript(builder, config->m_strSdkPath + L"/pdf/src/annotations/stamps.json", "window[\"native_pdf_stamps\"]=", ";");
sCachePath = config->m_strSdkPath + L"/pdf/sdk-all";
break;
}
@ -147,7 +157,7 @@ namespace NSDoctRenderer
}
case DoctRendererEditorType::VISIO:
{
return config->m_strSdkPath + L"/draw/sdk-all.bin";
return config->m_strSdkPath + L"/visio/sdk-all.bin";
}
case DoctRendererEditorType::PDF:
{

View File

@ -4,6 +4,7 @@
#include "./MemoryStreamEmbed.h"
#include "./TextMeasurerEmbed.h"
#include "./HashEmbed.h"
#include "./GraphicsEmbed.h"
namespace NSJSBase
{
@ -13,5 +14,6 @@ namespace NSJSBase
CJSContext::Embed<CMemoryStreamEmbed>();
CJSContext::Embed<CTextMeasurerEmbed>();
CJSContext::Embed<CHashEmbed>();
CJSContext::Embed<CGraphicsEmbed>();
}
}

View File

@ -1,5 +1,6 @@
#include "DrawingFileEmbed.h"
#include "../drawingfile.h"
#include "../../raster/BgraFrame.h"
JSSmart<CJSValue> WasmMemoryToJS(BYTE* pWasmData)
{

View File

@ -1,8 +1,192 @@
#include "GraphicsEmbed.h"
#include "../graphics.h"
#include <map>
#include "../../../Common/Network/FileTransporter/include/FileTransporter.h"
// APPLICATION INFO
class CGraphicsAppImage_private
{
public:
NSFonts::IApplicationFonts* m_pFonts;
std::wstring m_sFontsDirectory;
std::wstring m_sImagesDirectory;
std::wstring m_sThemesDirectory;
bool m_bIsRgba;
std::map<std::wstring, std::wstring> m_mapDownloads;
CGraphicsAppImage_private()
{
m_pFonts = NULL;
m_sFontsDirectory = L"";
m_sImagesDirectory = L"";
m_sThemesDirectory = L"";
m_bIsRgba = false;
}
~CGraphicsAppImage_private()
{
RELEASEINTERFACE(m_pFonts);
for (std::map<std::wstring, std::wstring>::iterator i = m_mapDownloads.begin(); i != m_mapDownloads.end(); i++)
{
std::wstring sTmp = i->second;
if (NSFile::CFileBinary::Exists(sTmp))
NSFile::CFileBinary::Remove(sTmp);
}
}
bool IsNeedDownload(const std::wstring& sUrl)
{
if ((0 == sUrl.find(L"www.")) ||
(0 == sUrl.find(L"http://")) ||
(0 == sUrl.find(L"https://")))
return true;
return false;
}
std::wstring GetImagePath(const std::wstring& sUrl)
{
std::map<std::wstring, std::wstring>::iterator find = m_mapDownloads.find(sUrl);
if (find != m_mapDownloads.end())
return find->second;
NSNetwork::NSFileTransport::CFileDownloader oDownloader(sUrl, false);
std::wstring sTmpFile = NSFile::CFileBinary::CreateTempFileWithUniqueName(NSFile::CFileBinary::GetTempPath(), L"IMG");
if (NSFile::CFileBinary::Exists(sTmpFile))
NSFile::CFileBinary::Remove(sTmpFile);
sTmpFile = sTmpFile + L".png";
oDownloader.SetFilePath(sTmpFile);
oDownloader.Start(0);
while ( oDownloader.IsRunned() )
{
NSThreads::Sleep( 10 );
}
bool bIsDownloaded = oDownloader.IsFileDownloaded();
if (bIsDownloaded)
{
m_mapDownloads.insert(std::pair<std::wstring, std::wstring>(sUrl, sTmpFile));
return sTmpFile;
}
return sUrl;
}
};
CGraphicsAppImage::CGraphicsAppImage()
{
m_internal = new CGraphicsAppImage_private();
}
CGraphicsAppImage::~CGraphicsAppImage()
{
delete m_internal;
}
void CGraphicsAppImage::SetFontsDirectory(const std::wstring& dir)
{
m_internal->m_sFontsDirectory = dir;
}
std::wstring CGraphicsAppImage::GetFontsDirectory()
{
return m_internal->m_sFontsDirectory;
}
void CGraphicsAppImage::SetImagesDirectory(const std::wstring& dir)
{
m_internal->m_sImagesDirectory = dir;
}
std::wstring CGraphicsAppImage::GetImagesDirectory()
{
return m_internal->m_sImagesDirectory;
}
void CGraphicsAppImage::SetThemesDirectory(const std::wstring& dir)
{
m_internal->m_sThemesDirectory = dir;
}
std::wstring CGraphicsAppImage::GetThemesDirectory()
{
return m_internal->m_sThemesDirectory;
}
void CGraphicsAppImage::SetFonts(NSFonts::IApplicationFonts* fonts)
{
m_internal->m_pFonts = fonts;
ADDREFINTERFACE(fonts);
}
NSFonts::IApplicationFonts* CGraphicsAppImage::GetFonts()
{
return m_internal->m_pFonts;
}
void CGraphicsAppImage::SetRgba(const bool& isRgba)
{
m_internal->m_bIsRgba = isRgba;
}
bool CGraphicsAppImage::GetRgba()
{
return m_internal->m_bIsRgba;
}
unsigned char* CGraphicsAppImage::GetBits(int& w, int& h)
{
return NULL;
}
unsigned char* CGraphicsAppImage::AllocBits(const int& w, const int& h)
{
return new unsigned char[4 * w * h];
}
// APPLICATION INFO END
CGraphicsEmbed::CGraphicsEmbed() : m_pInternal(new NSGraphics::CGraphics())
{
}
CGraphicsEmbed::~CGraphicsEmbed()
{
RELEASEOBJECT(m_pInternal);
}
CGraphicsAppImage* CGraphicsEmbed::GetAppImage()
{
return m_pInternal->m_pAppImage;
}
void CGraphicsEmbed::SetAppImage(CGraphicsAppImage* appImage)
{
m_pInternal->m_pAppImage = appImage;
}
JSSmart<CJSValue> CGraphicsEmbed::create(JSSmart<CJSValue> Native, JSSmart<CJSValue> width_px, JSSmart<CJSValue> height_px, JSSmart<CJSValue> width_mm, JSSmart<CJSValue> height_mm)
{
m_pInternal->init((NSNativeControl::CNativeControl*)Native->toObject()->getNative()->getObject(), width_px->toDouble(), height_px->toDouble(), width_mm->toDouble(), height_mm->toDouble());
if (!Native->isNull())
{
JSSmart<CJSObject> pNativeObject = Native->toObject();
CJSEmbedObject* pNativeEmbedObject = pNativeObject->getNative();
if (m_pInternal->m_pAppImage)
delete m_pInternal->m_pAppImage;
m_pInternal->m_pAppImage = new CGraphicsAppImage();
if (pNativeEmbedObject)
{
NSNativeControl::CNativeControl* pControl = (NSNativeControl::CNativeControl*)pNativeEmbedObject->getObject();
m_pInternal->m_pAppImage->SetFontsDirectory(pControl->m_strFontsDirectory);
m_pInternal->m_pAppImage->SetImagesDirectory(pControl->m_strImagesDirectory);
}
else
{
JSSmart<CJSValue> checkResources = pNativeObject->get("isResourcesObject");
if (checkResources->isBool() && true == checkResources->toBool())
{
m_pInternal->m_pAppImage->SetFontsDirectory(pNativeObject->get("fontsDirectory")->toStringW());
m_pInternal->m_pAppImage->SetImagesDirectory(pNativeObject->get("imagesDirectory")->toStringW());
}
}
}
m_pInternal->init(width_px->toDouble(), height_px->toDouble(), width_mm->toDouble(), height_mm->toDouble());
return NULL;
}
JSSmart<CJSValue> CGraphicsEmbed::Destroy()
@ -150,11 +334,19 @@ JSSmart<CJSValue> CGraphicsEmbed::ClearLastFont()
}
JSSmart<CJSValue> CGraphicsEmbed::drawImage2(JSSmart<CJSValue> img, JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h, JSSmart<CJSValue> alpha, JSSmart<CJSValue> srcRect)
{
m_pInternal->drawImage(img->toStringW(), x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble(), alpha->toInt32());
std::wstring sUrl = img->toStringW();
if (m_pInternal->m_pAppImage && m_pInternal->m_pAppImage->m_internal->IsNeedDownload(sUrl))
sUrl = m_pInternal->m_pAppImage->m_internal->GetImagePath(sUrl);
m_pInternal->drawImage(sUrl, x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble(), alpha->toInt32());
return NULL;
}
JSSmart<CJSValue> CGraphicsEmbed::drawImage (JSSmart<CJSValue> img, JSSmart<CJSValue> x, JSSmart<CJSValue> y, JSSmart<CJSValue> w, JSSmart<CJSValue> h, JSSmart<CJSValue> alpha, JSSmart<CJSValue> srcRect, JSSmart<CJSValue> nativeImage)
{
std::wstring sUrl = img->toStringW();
if (m_pInternal->m_pAppImage && m_pInternal->m_pAppImage->m_internal->IsNeedDownload(sUrl))
sUrl = m_pInternal->m_pAppImage->m_internal->GetImagePath(sUrl);
m_pInternal->drawImage(img->toStringW(), x->toDouble(), y->toDouble(), w->toDouble(), h->toDouble(), alpha->toInt32());
return NULL;
}
@ -459,7 +651,11 @@ JSSmart<CJSValue> CGraphicsEmbed::GetBrushColor()
}
JSSmart<CJSValue> CGraphicsEmbed::put_brushTexture(JSSmart<CJSValue> src, JSSmart<CJSValue> type)
{
m_pInternal->put_brushTexture(src->toStringW(), type->toInt32());
std::wstring sUrl = src->toStringW();
if (m_pInternal->m_pAppImage && m_pInternal->m_pAppImage->m_internal->IsNeedDownload(sUrl))
sUrl = m_pInternal->m_pAppImage->m_internal->GetImagePath(sUrl);
m_pInternal->put_brushTexture(sUrl, type->toInt32());
return NULL;
}
JSSmart<CJSValue> CGraphicsEmbed::put_brushTextureMode(JSSmart<CJSValue> mode)

View File

@ -1,21 +1,57 @@
#ifndef _BUILD_NATIVE_GRAPHICS_EMBED_H_
#define _BUILD_NATIVE_GRAPHICS_EMBED_H_
#include "../graphics.h"
#include "../../graphics/pro/Fonts.h"
#include "../js_internal/js_base.h"
class CGraphicsAppImage_private;
class JS_DECL CGraphicsAppImage
{
public:
CGraphicsAppImage();
virtual ~CGraphicsAppImage();
public:
void SetFontsDirectory(const std::wstring& dir);
std::wstring GetFontsDirectory();
void SetImagesDirectory(const std::wstring& dir);
std::wstring GetImagesDirectory();
void SetThemesDirectory(const std::wstring& dir);
std::wstring GetThemesDirectory();
void SetFonts(NSFonts::IApplicationFonts* fonts);
NSFonts::IApplicationFonts* GetFonts();
void SetRgba(const bool& isRgba);
bool GetRgba();
virtual unsigned char* GetBits(int& w, int& h);
virtual unsigned char* AllocBits(const int& w, const int& h);
private:
CGraphicsAppImage_private* m_internal;
friend class CGraphicsEmbed;
};
namespace NSGraphics { class CGraphics; }
using namespace NSJSBase;
class CGraphicsEmbed : public CJSEmbedObject
class JS_DECL CGraphicsEmbed : public CJSEmbedObject
{
public:
NSGraphics::CGraphics* m_pInternal;
public:
CGraphicsEmbed() : m_pInternal(new NSGraphics::CGraphics()) {}
~CGraphicsEmbed() { RELEASEOBJECT(m_pInternal); }
CGraphicsEmbed();
~CGraphicsEmbed();
virtual void* getObject() override { return (void*)m_pInternal; }
CGraphicsAppImage* GetAppImage();
void SetAppImage(CGraphicsAppImage* appImage);
public:
JSSmart<CJSValue> create(JSSmart<CJSValue> Native, JSSmart<CJSValue> width_px, JSSmart<CJSValue> height_px, JSSmart<CJSValue> width_mm, JSSmart<CJSValue> height_mm);
JSSmart<CJSValue> Destroy();

View File

@ -2,6 +2,7 @@
#include "./../docbuilder_p.h"
#include "../../common/Directory.h"
#include "../server.h"
JSSmart<CJSValue> CBuilderDocumentEmbed::IsValid()
{
@ -68,13 +69,23 @@ void CBuilderDocumentEmbed::_OpenFile(const std::wstring& sFile, const std::wstr
int nConvertResult = pBuilder->ConvertToInternalFormat(m_sFolder, sFileCopy, sParams);
if (0 == nConvertResult)
{
if (CServerInstance::getInstance().IsEnable())
CServerInstance::getInstance().AddTmpFile(m_sFolder);
m_bIsValid = true;
}
}
void CBuilderDocumentEmbed::_CloseFile()
{
if (!m_sFolder.empty())
{
NSDirectory::DeleteDirectory(m_sFolder);
if (m_bIsValid && CServerInstance::getInstance().IsEnable())
CServerInstance::getInstance().RemoveTmpFile(m_sFolder);
}
m_bIsValid = false;
m_sFolder = L"";
}

View File

@ -258,3 +258,64 @@ JSSmart<CJSValue> CZipEmbed::getImageType(JSSmart<CJSValue> typedArray)
oBuffer.Free();
return CJSContext::createInt(bIsImageFile ? oChecker.eFileType : 0);
}
JSSmart<CJSValue> CZipEmbed::getImageBuffer(JSSmart<CJSValue> filePath)
{
if (!m_pFolder || !filePath->isString())
return CJSContext::createNull();
std::wstring sFilePath = filePath->toStringW();
IFolder::CBuffer* pBuffer;
if (!m_pFolder->read(sFilePath, pBuffer))
return CJSContext::createNull();
size_t nBufferSize = (size_t)pBuffer->Size;
CImageFileFormatChecker oChecker;
bool bIsImageFile = oChecker.isImageFile(pBuffer->Buffer, (DWORD)pBuffer->Size);
if (!bIsImageFile)
{
RELEASEOBJECT(pBuffer);
return CJSContext::createNull();
}
bool bIsNeedConvertMetfileToSvg = false;
// Make as wasm module
if (oChecker.eFileType == _CXIMAGE_FORMAT_WMF || oChecker.eFileType == _CXIMAGE_FORMAT_EMF)
oChecker.eFileType = _CXIMAGE_FORMAT_SVG;
else
bIsNeedConvertMetfileToSvg = false;
if (!bIsNeedConvertMetfileToSvg)
{
BYTE* pMemory = NSJSBase::NSAllocator::Alloc(nBufferSize);
memcpy(pMemory, pBuffer->Buffer, nBufferSize);
RELEASEOBJECT(pBuffer);
JSSmart<CJSObject> retObject = CJSContext::createObject();
retObject->set("type", CJSContext::createInt(oChecker.eFileType));
retObject->set("data", NSJSBase::CJSContext::createUint8Array(pMemory, (int)nBufferSize, false));
return retObject->toValue();
}
#ifndef GRAPHICS_DISABLE_METAFILE
MetaFile::IMetaFile* pMetaFile = MetaFile::Create(NULL);
pMetaFile->LoadFromBuffer(pBuffer->Buffer, (unsigned int)pBuffer->Size);
std::wstring wsSvg = pMetaFile->ConvertToSvg();
std::string sSvg = U_TO_UTF8(wsSvg);
pMetaFile->Release();
RELEASEOBJECT(pBuffer);
BYTE* pData = NSAllocator::Alloc(sSvg.length());
memcpy(pData, sSvg.c_str(), sSvg.length());
JSSmart<CJSObject> retObject = CJSContext::createObject();
retObject->set("type", CJSContext::createInt(24));
retObject->set("data", NSJSBase::CJSContext::createUint8Array(pData, sSvg.length(), false));
return retObject->toValue();
#else
return CJSContext::createNull();
#endif
}

View File

@ -36,6 +36,7 @@ public:
JSSmart<CJSValue> encodeImageData(JSSmart<CJSValue> typedArray, JSSmart<CJSValue> w, JSSmart<CJSValue> h, JSSmart<CJSValue> stride, JSSmart<CJSValue> format, JSSmart<CJSValue> isRgba);
JSSmart<CJSValue> encodeImage(JSSmart<CJSValue> typedArray, JSSmart<CJSValue> format);
JSSmart<CJSValue> getImageType(JSSmart<CJSValue> typedArray);
JSSmart<CJSValue> getImageBuffer(JSSmart<CJSValue> path);
DECLARE_EMBED_METHODS
};

View File

@ -17,6 +17,7 @@
-(JSValue*) encodeImageData : (JSValue*)typedArray : (JSValue*)w : (JSValue*)h : (JSValue*)stride : (JSValue*)format : (JSValue*)isRgba;
-(JSValue*) encodeImage : (JSValue*)typedArray : (JSValue*)format;
-(JSValue*) getImageType : (JSValue*)typedArray;
-(JSValue*) getImageBuffer : (JSValue*)path;
@end
@interface CJSCZipEmbed : NSObject<IJSCZipEmbed, JSEmbedObjectProtocol>
@ -41,6 +42,7 @@ FUNCTION_WRAPPER_JS_2(decodeImage, decodeImage)
FUNCTION_WRAPPER_JS_6(encodeImageData, encodeImageData)
FUNCTION_WRAPPER_JS_2(encodeImage, encodeImage)
FUNCTION_WRAPPER_JS_1(getImageType, getImageType)
FUNCTION_WRAPPER_JS_1(getImageBuffer, getImageBuffer)
@end
class CZipEmbedAdapter : public CJSEmbedObjectAdapterJSC

View File

@ -20,6 +20,7 @@ namespace NSZipEmbed
FUNCTION_WRAPPER_V8_6(_encodeImageData, encodeImageData)
FUNCTION_WRAPPER_V8_2(_encodeImage, encodeImage)
FUNCTION_WRAPPER_V8_1(_getImageType, getImageType)
FUNCTION_WRAPPER_V8_1(_getImageBuffer, getImageBuffer)
v8::Handle<v8::ObjectTemplate> CreateTemplate(v8::Isolate* isolate)
{
@ -39,6 +40,7 @@ namespace NSZipEmbed
NSV8Objects::Template_Set(result, "encodeImageData", _encodeImageData);
NSV8Objects::Template_Set(result, "encodeImage", _encodeImage);
NSV8Objects::Template_Set(result, "getImageType", _getImageType);
NSV8Objects::Template_Set(result, "getImageBuffer", _getImageBuffer);
return handle_scope.Escape(result);
}

View File

@ -10,18 +10,35 @@
#define M_PI 3.14159265358979323846
#endif
#ifdef _DEBUG
//#define ENABLE_GR_LOGS
#endif
namespace NSGraphics
{
void CGraphics::init(NSNativeControl::CNativeControl* oNative, double width_px, double height_px, double width_mm, double height_mm)
void CGraphics::init(double width_px, double height_px, double width_mm, double height_mm)
{
m_sApplicationImagesDirectory = oNative->m_strImagesDirectory;
m_sApplicationFontsDirectory = oNative->m_strFontsDirectory;
#ifdef _DEBUG
std::wcout << L"init "<< m_sApplicationImagesDirectory << L" " << m_sApplicationFontsDirectory << L" " << width_px << L" " << height_px << L" " << width_mm << L" " << height_mm << std::endl;
if (!m_pAppImage)
return;
if (NULL == m_pAppImage->GetFonts())
{
NSFonts::IApplicationFonts* pFonts = NSFonts::NSApplication::Create();
std::wstring sFontsDir = m_pAppImage->GetFontsDirectory();
pFonts->InitializeFromFolder(sFontsDir.empty() ? NSFile::GetProcessDirectory() : sFontsDir);
m_pAppImage->SetFonts(pFonts);
RELEASEINTERFACE(pFonts);
}
NSFonts::IFontManager* pManager = m_pAppImage->GetFonts()->GenerateFontManager();
#ifdef ENABLE_GR_LOGS
std::wcout << L"init "<<
m_pAppImage->GetImagesDirectory() << L" " <<
m_pAppImage->GetFontsDirectory() << L" " <<
width_px << L" " << height_px << L" " <<
width_mm << L" " << height_mm << std::endl;
#endif
m_pApplicationFonts = NSFonts::NSApplication::Create();
m_pApplicationFonts->InitializeFromFolder(m_sApplicationFontsDirectory.empty() ? NSFile::GetProcessDirectory() : m_sApplicationFontsDirectory);
NSFonts::IFontManager* pManager = m_pApplicationFonts->GenerateFontManager();
m_pRenderer = NSGraphics::Create();
m_pRenderer->SetFontManager(pManager);
@ -42,7 +59,19 @@ namespace NSGraphics
if (nRasterH < 1) nRasterH = 0;
}
BYTE* pData = new BYTE[4 * nRasterW * nRasterH];
int nExistW = 0;
int nExistH = 0;
BYTE* pData = m_pAppImage->GetBits(nExistW, nExistH);
if (pData != NULL)
{
nRasterW = nExistW;
nRasterH = nExistH;
}
else
{
pData = m_pAppImage->AllocBits(nRasterW, nRasterH);
}
unsigned int back = 0xffffff;
unsigned int* pData32 = (unsigned int*)pData;
unsigned int* pData32End = pData32 + nRasterW * nRasterH;
@ -55,21 +84,21 @@ namespace NSGraphics
m_oFrame.put_Stride(4 * nRasterW);
m_pRenderer->CreateFromBgraFrame(&m_oFrame);
m_pRenderer->SetSwapRGB(false);
m_pRenderer->SetSwapRGB(m_pAppImage->GetRgba());
m_pRenderer->put_Width(width_mm);
m_pRenderer->put_Height(height_mm);
}
void CGraphics::put_GlobalAlpha(bool enable, double alpha)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "put_GlobalAlpha " << enable << " " << alpha << std::endl;
#endif
m_pRenderer->put_GlobalAlphaEnabled(enable, alpha);
}
void CGraphics::End_GlobalAlpha()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "End_GlobalAlpha " << std::endl;
#endif
bool bIsInteger = m_pRenderer->get_IntegerGrid();
@ -86,7 +115,7 @@ namespace NSGraphics
}
void CGraphics::p_color(int r, int g, int b, int a)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "p_color " << r << " " << g << " " << b << " " << a << std::endl;
#endif
m_pRenderer->put_PenColor(r | (g << 8) | (b << 16));
@ -94,14 +123,14 @@ namespace NSGraphics
}
void CGraphics::p_width(double w)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "p_width " << w << std::endl;
#endif
m_pRenderer->put_PenSize(w / 1000.0);
}
void CGraphics::p_dash(size_t length, double* dash)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "p_dash " << length << std::endl;
#endif
if(length > 0)
@ -119,7 +148,7 @@ namespace NSGraphics
}
void CGraphics::b_color1(int r, int g, int b, int a)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "b_color1 " << r << " " << g << " " << b << " " << a << std::endl;
#endif
m_pRenderer->put_BrushType(c_BrushTypeSolid);
@ -128,7 +157,7 @@ namespace NSGraphics
}
void CGraphics::b_color2(int r, int g, int b, int a)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "b_color2 " << r << " " << g << " " << b << " " << a << std::endl;
#endif
m_pRenderer->put_BrushColor2(r | (g << 8) | (b << 16));
@ -136,42 +165,42 @@ namespace NSGraphics
}
void CGraphics::transform(double sx, double shy, double shx, double sy, double tx, double ty)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "transform " << sx << " " << shy << " " << shx << " " << sy << " " << tx << " " << ty << std::endl;
#endif
m_pRenderer->SetTransform(sx, shy, shx, sy, tx, ty);
}
void CGraphics::CalculateFullTransform()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "CalculateFullTransform " << std::endl;
#endif
m_pRenderer->CalculateFullTransform();
}
void CGraphics::_s()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "_s " << std::endl;
#endif
m_pRenderer->PathCommandEnd();
}
void CGraphics::_e()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "_e " << std::endl;
#endif
m_pRenderer->PathCommandEnd();
}
void CGraphics::_z()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "_z " << std::endl;
#endif
m_pRenderer->PathCommandClose();
}
void CGraphics::_m(double x, double y)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "_m " << x << " " << y << std::endl;
#endif
if (!m_pRenderer->get_IntegerGrid())
@ -184,7 +213,7 @@ namespace NSGraphics
}
void CGraphics::_l(double x, double y)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "_l " << x << " " << y << std::endl;
#endif
if (!m_pRenderer->get_IntegerGrid())
@ -197,7 +226,7 @@ namespace NSGraphics
}
void CGraphics::_c (double x1, double y1, double x2, double y2, double x3, double y3)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "_c " << x1 << " " << y1 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << std::endl;
#endif
if (!m_pRenderer->get_IntegerGrid())
@ -212,7 +241,7 @@ namespace NSGraphics
}
void CGraphics::_c2(double x1, double y1, double x2, double y2)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "_c2 " << x1 << " " << y1 << " " << x2 << " " << y2 << std::endl;
#endif
if (!m_pRenderer->get_IntegerGrid())
@ -226,28 +255,28 @@ namespace NSGraphics
}
void CGraphics::ds()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "ds " << std::endl;
#endif
m_pRenderer->Stroke();
}
void CGraphics::df()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "df " << std::endl;
#endif
m_pRenderer->Fill();
}
void CGraphics::save()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "save " << std::endl;
#endif
m_oFrame.SaveFile(m_sApplicationImagesDirectory + L"/img.png", _CXIMAGE_FORMAT_PNG);
m_oFrame.SaveFile(m_pAppImage->GetImagesDirectory() + L"/img.png", _CXIMAGE_FORMAT_PNG);
}
void CGraphics::restore()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "restore " << std::endl;
#endif
m_pRenderer->BeginCommand(c_nResetClipType);
@ -255,7 +284,7 @@ namespace NSGraphics
}
void CGraphics::clip()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "clip " << std::endl;
#endif
m_pRenderer->BeginCommand(c_nClipType);
@ -263,43 +292,46 @@ namespace NSGraphics
}
void CGraphics::reset()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "reset " << std::endl;
#endif
m_pRenderer->ResetTransform();
}
void CGraphics::FreeFont()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "FreeFont " << std::endl;
#endif
m_pRenderer->CloseFont();
}
void CGraphics::ClearLastFont()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "ClearLastFont " << std::endl;
#endif
m_pRenderer->ClearInstallFont();
}
void CGraphics::drawImage(const std::wstring& img, double x, double y, double w, double h, BYTE alpha)
{
std::wstring strImage = (0 == img.find(L"theme") ? m_sApplicationThemesDirectory : m_sApplicationImagesDirectory) + L'/' + img;
#ifdef _DEBUG
std::wstring strImage = img;
if (!NSFile::CFileBinary::Exists(img))
strImage = (0 == img.find(L"theme") ? m_pAppImage->GetThemesDirectory() : m_pAppImage->GetImagesDirectory()) + L'/' + img;
#ifdef ENABLE_GR_LOGS
std::wcout << L"drawImage " << strImage << L" " << x << " " << y << L" " << w << L" " << h << L" " << alpha << std::endl;
#endif
m_pRenderer->DrawImageFromFile(strImage, x, y, w, h, alpha);
}
std::wstring CGraphics::GetFont()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "GetFont " << std::endl;
#endif
return m_pRenderer->GetFontManager()->GetName();
}
void CGraphics::SetFont(const std::wstring& name, int face, double size, int style)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::wcout << L"SetFont " << name << L" " << face << L" " << size << L" " << style << std::endl;
#endif
double DpiX, DpiY;
@ -314,21 +346,21 @@ namespace NSGraphics
}
void CGraphics::FillText(double x, double y, int text)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::wcout << L"FillText " << (wchar_t)text << L" " << x << L" " << y << std::endl;
#endif
m_pRenderer->CommandDrawTextCHAR(text, x, y, 0, 0);
}
void CGraphics::t(double x, double y, const std::wstring& text)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::wcout << L"t " << text << L" " << x << L" " << y << std::endl;
#endif
m_pRenderer->CommandDrawText(text, x, y, 0, 0);
}
void CGraphics::tg(int text, double x, double y)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::wcout << L"tg " << text << L" " << x << L" " << y << std::endl;
#endif
m_pRenderer->put_FontStringGID(TRUE);
@ -337,21 +369,21 @@ namespace NSGraphics
}
void CGraphics::SetIntegerGrid(bool param)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "SetIntegerGrid " << param << std::endl;
#endif
m_pRenderer->put_IntegerGrid(param);
}
bool CGraphics::GetIntegerGrid()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "GetIntegerGrid " << std::endl;
#endif
return m_pRenderer->get_IntegerGrid();
}
void CGraphics::DrawStringASCII (const std::wstring& text, double x, double y)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::wcout << L"DrawStringASCII " << text << L" " << x << L" " << y << std::endl;
#endif
double DpiY;
@ -373,7 +405,7 @@ namespace NSGraphics
}
void CGraphics::DrawHeaderEdit(double yPos)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "DrawHeaderEdit " << std::endl;
#endif
m_pRenderer->PathCommandEnd();
@ -416,7 +448,7 @@ namespace NSGraphics
}
void CGraphics::DrawFooterEdit(double yPos)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "DrawFooterEdit " << std::endl;
#endif
m_pRenderer->PathCommandEnd();
@ -459,7 +491,7 @@ namespace NSGraphics
}
void CGraphics::DrawLockParagraph (double x, double y1, double y2)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "DrawLockParagraph " << std::endl;
#endif
m_pRenderer->PathCommandEnd();
@ -531,7 +563,7 @@ namespace NSGraphics
}
void CGraphics::DrawLockObjectRect(double x, double y, double w, double h)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "DrawLockObjectRect " << std::endl;
#endif
m_pRenderer->PathCommandEnd();
@ -557,7 +589,7 @@ namespace NSGraphics
}
void CGraphics::DrawEmptyTableLine(double x1, double y1, double x2, double y2)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "DrawEmptyTableLine " << std::endl;
#endif
m_pRenderer->PathCommandEnd();
@ -642,7 +674,7 @@ namespace NSGraphics
}
void CGraphics::DrawSpellingLine (double y0, double x0, double x1, double w)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "DrawSpellingLine " << std::endl;
#endif
Aggplus::CMatrix* pMatrix = m_pRenderer->GetTransformMatrix();
@ -988,7 +1020,7 @@ namespace NSGraphics
}
void CGraphics::SaveGrState()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "SaveGrState " << std::endl;
#endif
CGrStateState* pState = new CGrStateState();
@ -1004,7 +1036,7 @@ namespace NSGraphics
}
void CGraphics::RestoreGrState()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "RestoreGrState " << std::endl;
#endif
if (m_oGrState.States.empty())
@ -1068,14 +1100,14 @@ namespace NSGraphics
}
void CGraphics::StartClipPath()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "StartClipPath " << std::endl;
#endif
m_pRenderer->BeginCommand(c_nClipType);
}
void CGraphics::EndClipPath()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "EndClipPath " << std::endl;
#endif
m_pRenderer->EndCommand(c_nClipType);
@ -1133,7 +1165,7 @@ namespace NSGraphics
}
std::string CGraphics::toDataURL(std::wstring type)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::wcout << "toDataURL " << type << std::endl;
#endif
std::wstring sFormat = (type.length() > 6) ? type.substr(6) : type;
@ -1178,11 +1210,11 @@ namespace NSGraphics
{
if (src.find(L"data:") == 0)
{
std::wstring strImage = m_sApplicationImagesDirectory + L"/texture.png";
std::wstring strImage = m_pAppImage->GetImagesDirectory() + L"/texture.png";
bool bIsOnlyOfficeHatch = false;
if(src.find(L"onlyoffice_hatch") != std::wstring::npos)
bIsOnlyOfficeHatch = true;
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::wcout << L"put_brushTexture " << src << L" " << type << std::endl;
#endif
src.erase(0, src.find(L',') + 1);
@ -1221,7 +1253,10 @@ namespace NSGraphics
}
else
{
std::wstring strImage = (0 == src.find(L"theme") ? m_sApplicationThemesDirectory : m_sApplicationImagesDirectory) + L'/' + src;
std::wstring strImage = src;
if (!NSFile::CFileBinary::Exists(src))
strImage = (0 == src.find(L"theme") ? m_pAppImage->GetThemesDirectory() : m_pAppImage->GetImagesDirectory()) + L'/' + src;
std::wstring sName = strImage.substr(0, strImage.rfind(L'.') + 1);
std::wstring sExt = src.substr(src.rfind(L'.') + 1);
if (sExt == L"svg")
@ -1231,7 +1266,7 @@ namespace NSGraphics
else if (NSFile::CFileBinary::Exists(sName + L"emf") && src.find(L"display") == 0)
strImage = sName + L"emf";
MetaFile::IMetaFile* pMetafile = MetaFile::Create(m_pApplicationFonts);
MetaFile::IMetaFile* pMetafile = MetaFile::Create(m_pAppImage->GetFonts());
pMetafile->LoadFromFile(strImage.c_str());
double x = 0, y = 0, w = 0, h = 0;
@ -1244,7 +1279,7 @@ namespace NSGraphics
}
else
sName += sExt;
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::wcout << L"put_brushTexture " << sName << L" " << type << std::endl;
#endif
m_pRenderer->put_BrushType(c_BrushTypeTexture);
@ -1254,21 +1289,21 @@ namespace NSGraphics
}
void CGraphics::put_brushTextureMode(int mode)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "put_brushTextureMode " << mode << std::endl;
#endif
m_pRenderer->put_BrushTextureMode(mode);
}
void CGraphics::put_BrushTextureAlpha(int a)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "put_BrushTextureAlpha " << a << std::endl;
#endif
m_pRenderer->put_BrushTextureAlpha(a == 0 ? 255 : a);
}
void CGraphics::put_BrushGradient(LONG* pColors, double* pPositions, size_t nCount, double x0, double y0, double x1, double y1, double r0, double r1)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "put_BrushGradient " << nCount << " " << x0 << " " << y0 << " " << x1 << " " << y1 << " " << r0 << " " << r1 << std::endl;
for (size_t i = 0; i < nCount; i++)
std::cout << pPositions[i] << " " << pColors[i] << " ";
@ -1293,7 +1328,7 @@ namespace NSGraphics
}
double CGraphics::TransformPointX(double x, double y)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "TransformPointX " << std::endl;
#endif
m_pRenderer->GetFullTransform()->TransformPoint(x, y);
@ -1301,7 +1336,7 @@ namespace NSGraphics
}
double CGraphics::TransformPointY(double x, double y)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "TransformPointY " << std::endl;
#endif
m_pRenderer->GetFullTransform()->TransformPoint(x, y);
@ -1309,14 +1344,14 @@ namespace NSGraphics
}
void CGraphics::put_LineJoin(int nJoin)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "put_LineJoin " << std::endl;
#endif
m_pRenderer->put_PenLineJoin(nJoin);
}
int CGraphics::GetLineJoin()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "GetLineJoin " << std::endl;
#endif
BYTE nRes;
@ -1325,7 +1360,7 @@ namespace NSGraphics
}
void CGraphics::put_TextureBounds(double x, double y, double w, double h)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "put_TextureBounds " << x << " " << y << " " << w << " " << h << std::endl;
#endif
if(m_pRenderer->get_IntegerGrid())
@ -1341,7 +1376,7 @@ namespace NSGraphics
}
double CGraphics::GetlineWidth()
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "GetlineWidth " << std::endl;
#endif
double nRes;
@ -1350,7 +1385,7 @@ namespace NSGraphics
}
void CGraphics::DrawPath(int path)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "DrawPath " << path << std::endl;
#endif
if(path == 257)
@ -1363,7 +1398,7 @@ namespace NSGraphics
}
void CGraphics::CoordTransformOffset(double tx, double ty)
{
#ifdef _DEBUG
#ifdef ENABLE_GR_LOGS
std::cout << "CoordTransformOffset " << tx << " " << ty << std::endl;
#endif
m_pRenderer->SetCoordTransformOffset(tx, ty);

View File

@ -7,6 +7,7 @@
#include "../common/File.h"
#include "nativecontrol.h"
#include "../graphics/pro/Graphics.h"
#include "embed/GraphicsEmbed.h"
namespace NSGraphics
{
@ -114,28 +115,32 @@ namespace NSGraphics
class CGraphics
{
public:
std::wstring m_sApplicationFontsDirectory;
std::wstring m_sApplicationImagesDirectory;
std::wstring m_sApplicationThemesDirectory;
CGraphicsAppImage* m_pAppImage;
CBgraFrame m_oFrame;
private:
NSFonts ::IApplicationFonts* m_pApplicationFonts;
NSGraphics::IGraphicsRenderer* m_pRenderer;
CBgraFrame m_oFrame;
CGrState m_oGrState;
public:
CGraphics() {}
CGraphics()
{
m_pAppImage = NULL;
}
~CGraphics()
{
Destroy();
}
void init(NSNativeControl::CNativeControl* oNative, double width_px, double height_px, double width_mm, double height_mm);
void init(double width_px, double height_px, double width_mm, double height_mm);
void Destroy()
{
int w, h;
if (m_pAppImage && m_pAppImage->GetBits(w, h))
m_oFrame.put_Data(NULL);
RELEASEINTERFACE(m_pRenderer);
RELEASEINTERFACE(m_pApplicationFonts);
RELEASEOBJECT(m_pAppImage);
}
void EndDraw() {}
void put_GlobalAlpha(bool enable, double globalAlpha);

View File

@ -374,7 +374,7 @@ namespace NSJSBase
JSSmart<CJSContext> CJSContext::GetCurrent()
{
CJSContext* ret = new CJSContext();
CJSContext* ret = new CJSContext(false);
ret->m_internal->context = NSJSBase::CJSContextPrivate::GetCurrentContext();
return ret;
}

View File

@ -54,9 +54,9 @@ v8::Local<v8::String> CreateV8String(v8::Isolate* i, const std::string& str);
#ifdef __ANDROID__
#ifdef _DEBUG
//#ifdef _DEBUG
#define ANDROID_LOGS
#endif
//#endif
#ifdef ANDROID_LOGS
#include <android/log.h>
@ -488,7 +488,11 @@ namespace NSJSBase
virtual CJSEmbedObject* getNative()
{
if (0 == value->InternalFieldCount())
return NULL;
v8::Handle<v8::External> field = v8::Handle<v8::External>::Cast(value->GetInternalField(0));
if (field.IsEmpty())
return NULL;
return (CJSEmbedObject*)field->Value();
}
@ -991,67 +995,76 @@ inline void js_return(const v8::PropertyCallbackInfo<v8::Value>& info, JSSmart<N
#define PROPERTY_GET(NAME, NAME_EMBED) \
void NAME(v8::Local<v8::String> _name, const v8::PropertyCallbackInfo<v8::Value>& info) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(info.Holder()); \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(info.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(); \
js_return(info, ret); \
}
#define FUNCTION_WRAPPER_V8_0(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.Holder()); \
JSSmart<CJSValue> ret = _this->NAME_EMBED(); \
js_return(args, ret); \
#define FUNCTION_WRAPPER_V8_0(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(args.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(); \
js_return(args, ret); \
}
#define FUNCTION_WRAPPER_V8(NAME, NAME_EMBED) FUNCTION_WRAPPER_V8_0(NAME, NAME_EMBED)
#define FUNCTION_WRAPPER_V8_1(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.Holder()); \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0])); \
js_return(args, ret); \
#define FUNCTION_WRAPPER_V8_1(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(args.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0])); \
js_return(args, ret); \
}
#define FUNCTION_WRAPPER_V8_2(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.Holder()); \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0]), js_value(args[1])); \
js_return(args, ret); \
#define FUNCTION_WRAPPER_V8_2(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(args.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0]), js_value(args[1])); \
js_return(args, ret); \
}
#define FUNCTION_WRAPPER_V8_3(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.Holder()); \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(args.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0]), js_value(args[1]), js_value(args[2])); \
js_return(args, ret); \
}
#define FUNCTION_WRAPPER_V8_4(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.Holder()); \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(args.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0]), js_value(args[1]), js_value(args[2]), js_value(args[3])); \
js_return(args, ret); \
}
#define FUNCTION_WRAPPER_V8_5(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.Holder()); \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(args.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0]), js_value(args[1]), js_value(args[2]), js_value(args[3]), js_value(args[4])); \
js_return(args, ret); \
}
#define FUNCTION_WRAPPER_V8_6(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.Holder()); \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(args.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0]), js_value(args[1]), js_value(args[2]), js_value(args[3]), js_value(args[4]), js_value(args[5])); \
js_return(args, ret); \
}
#define FUNCTION_WRAPPER_V8_7(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.Holder()); \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(args.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0]), js_value(args[1]), js_value(args[2]), js_value(args[3]), js_value(args[4]), \
js_value(args[5]), js_value(args[6])); \
js_return(args, ret); \
@ -1059,7 +1072,8 @@ inline void js_return(const v8::PropertyCallbackInfo<v8::Value>& info, JSSmart<N
#define FUNCTION_WRAPPER_V8_8(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.Holder()); \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(args.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0]), js_value(args[1]), js_value(args[2]), js_value(args[3]), js_value(args[4]), \
js_value(args[5]), js_value(args[6]), js_value(args[7])); \
js_return(args, ret); \
@ -1067,7 +1081,8 @@ inline void js_return(const v8::PropertyCallbackInfo<v8::Value>& info, JSSmart<N
#define FUNCTION_WRAPPER_V8_9(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.Holder()); \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(args.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0]), js_value(args[1]), js_value(args[2]), js_value(args[3]), js_value(args[4]), \
js_value(args[5]), js_value(args[6]), js_value(args[7]), js_value(args[8])); \
js_return(args, ret); \
@ -1075,7 +1090,8 @@ inline void js_return(const v8::PropertyCallbackInfo<v8::Value>& info, JSSmart<N
#define FUNCTION_WRAPPER_V8_10(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.Holder()); \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(args.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0]), js_value(args[1]), js_value(args[2]), js_value(args[3]), js_value(args[4]), js_value(args[5]), \
js_value(args[6]), js_value(args[7]), js_value(args[8]), js_value(args[9])); \
js_return(args, ret); \
@ -1083,7 +1099,8 @@ inline void js_return(const v8::PropertyCallbackInfo<v8::Value>& info, JSSmart<N
#define FUNCTION_WRAPPER_V8_13(NAME, NAME_EMBED) \
void NAME(const v8::FunctionCallbackInfo<v8::Value>& args) \
{ \
CURRENTWRAPPER* _this = (CURRENTWRAPPER*)unwrap_native(args.Holder()); \
CURRENTWRAPPER* _this = dynamic_cast<CURRENTWRAPPER*>(unwrap_native(args.Holder())); \
if (!_this) return; \
JSSmart<CJSValue> ret = _this->NAME_EMBED(js_value(args[0]), js_value(args[1]), js_value(args[2]), js_value(args[3]), js_value(args[4]), js_value(args[5]), \
js_value(args[6]), js_value(args[7]), js_value(args[8]), js_value(args[9]), js_value(args[10]), js_value(args[11]), \
js_value(args[12])); \

View File

@ -99,6 +99,11 @@ namespace NSJSON
return m_internal->m_type == CTypedValue::vtObject;
}
bool IValue::IsImage() const
{
return m_internal->m_type == CTypedValue::vtImage;
}
bool IValue::ToBool() const
{
if (m_internal->m_type != CTypedValue::vtPrimitive)
@ -350,6 +355,11 @@ namespace NSJSON
strRes += "}";
break;
}
case CTypedValue::vtImage:
{
// TODO: implement like typed array?
break;
}
}
return strRes;
@ -497,6 +507,82 @@ namespace NSJSON
return static_cast<CObject*>(m_internal->m_value.get())->getPropertyNames();
}
const BYTE* IValue::GetImageBits() const
{
if (m_internal->m_type != CTypedValue::vtImage)
{
#ifdef JSON_DEBUG
throw std::bad_cast();
#endif
return nullptr;
}
return static_cast<CImage*>(m_internal->m_value.get())->getBits();
}
BYTE* IValue::GetImageBits()
{
return const_cast<BYTE*>(static_cast<const CValue&>(*this).GetImageBits());
}
int IValue::GetImageWidth() const
{
if (m_internal->m_type != CTypedValue::vtImage)
{
#ifdef JSON_DEBUG
throw std::bad_cast();
#endif
return 0;
}
return static_cast<CImage*>(m_internal->m_value.get())->getWidth();
}
int IValue::GetImageHeight() const
{
if (m_internal->m_type != CTypedValue::vtImage)
{
#ifdef JSON_DEBUG
throw std::bad_cast();
#endif
return 0;
}
return static_cast<CImage*>(m_internal->m_value.get())->getHeight();
}
ImageFormat IValue::GetImageFormat() const
{
if (m_internal->m_type != CTypedValue::vtImage)
{
#ifdef JSON_DEBUG
throw std::bad_cast();
#endif
return ImageFormat::ifInvalid;
}
return static_cast<CImage*>(m_internal->m_value.get())->getFormat();
}
void IValue::ImageExternalize()
{
if (m_internal->m_type != CTypedValue::vtImage)
{
#ifdef JSON_DEBUG
throw std::bad_cast();
#endif
return;
}
static_cast<CImage*>(m_internal->m_value.get())->externalize();
}
void IValue::ImageAlloc(const int& width, const int& height, const ImageFormat& format)
{
if (m_internal->m_type != CTypedValue::vtImage)
{
#ifdef JSON_DEBUG
throw std::bad_cast();
#endif
return;
}
static_cast<CImage*>(m_internal->m_value.get())->alloc(width, height, format);
}
CValue::CValue() : IValue()
{
@ -590,6 +676,35 @@ namespace NSJSON
NSJSBase::NSAllocator::Free(data, size);
}
CValue CValue::CreateImage(BYTE* bits, int width, int height, ImageFormat format, bool isExternalize)
{
CValue ret;
if (width <= 0 || height <= 0)
return ret;
ret.m_internal->m_value = std::make_shared<CImage>(bits, width, height, format, isExternalize);
ret.m_internal->m_type = CTypedValue::vtImage;
return ret;
}
CValue CValue::CreateEmptyImage(ImageFormat format)
{
CValue ret;
ret.m_internal->m_value = std::make_shared<CImage>((BYTE*)NULL, 0, 0, format, false);
ret.m_internal->m_type = CTypedValue::vtImage;
return ret;
}
BYTE* CValue::AllocImageBits(int width, int height)
{
return new BYTE[4 * width * height];
}
void CValue::FreeImageBits(BYTE* bits)
{
delete[] bits;
}
CValue CValue::CreateObject()
{
CValue ret;

View File

@ -20,7 +20,7 @@
#endif
// uncomment to enable exceptions throwing
//#define JSON_DEBUG
// #define JSON_DEBUG
#ifdef JSON_DEBUG
#include <stdexcept>
@ -29,6 +29,14 @@
namespace NSJSON
{
typedef unsigned char BYTE;
enum class ImageFormat
{
ifRGBA,
ifBGRA,
ifARGB,
ifInvalid
};
class CValue;
class CValueRef;
@ -88,6 +96,10 @@ namespace NSJSON
* Returns true if the value is an object.
*/
bool IsObject() const;
/**
* Returns true if the value is an image.
*/
bool IsImage() const;
// FUNCTIONS FOR WORKING WITH PRIMITIVE VALUES
/**
@ -193,6 +205,39 @@ namespace NSJSON
*/
std::vector<std::string> GetPropertyNames() const;
// FUNCTIONS FOR WORKING WITH IMAGES
/**
* Gets bits of image.
* @return the pointer to memory, allocated for the image. If current value is not an image, returns nullptr.
*/
const BYTE* GetImageBits() const;
BYTE* GetImageBits();
/**
* Gets width of the image.
* @returns Returns the width of the image. If current value is not an image, returns 0.
*/
int GetImageWidth() const;
/**
* Gets height of the image.
* @returns Returns the height of the image. If current value is not an image, returns 0.
*/
int GetImageHeight() const;
/**
* Gets format of the image.
* @returns Returns the image format. If current value is not an image, returns ImageFormat::ifInvalid.
*/
ImageFormat GetImageFormat() const;
/**
* Make image bits external.
*/
void ImageExternalize();
/**
* Alloc image bits as internal.
*/
void ImageAlloc(const int& width, const int& height, const ImageFormat& format);
protected:
std::shared_ptr<CTypedValue> m_internal;
};
@ -251,6 +296,30 @@ namespace NSJSON
*/
static void FreeTypedArray(BYTE* data, size_t size);
// IMAGE
/**
* Creates and returns new image object.
* @param bits The pointer to image data. The pointer should be acquired with AllocImageBits().
* @param width The width of the image.
* @param height The height of the image.
* @param format The format of the image.
* @param isExternalize If true the memory will not be reclaimed when the created image is destroyed.
* If this parameter is false then the memory will be released using FreeImageBits() during the image object destruction.
*/
static CValue CreateImage(BYTE* bits, int width, int height, ImageFormat format = ImageFormat::ifBGRA, bool isExternalize = true);
static CValue CreateEmptyImage(ImageFormat format = ImageFormat::ifBGRA);
/**
* Allocates the memory for an image.
* @param width The width of the image.
* @param height The height of the image.
*/
static BYTE* AllocImageBits(int width, int height);
/**
* Frees the memory for a image bits.
* @param data The allocated memory to be released.
*/
static void FreeImageBits(BYTE* bits);
// OBJECT CONSTRUCTOR
/**
* Creates and returns empty object.

View File

@ -17,7 +17,8 @@ namespace NSJSON
vtPrimitive,
vtArray,
vtTypedArray,
vtObject
vtObject,
vtImage
};
public:

View File

@ -211,4 +211,56 @@ namespace NSJSON
}
return ret;
}
CImage::CImage(BYTE* bits, const int& width, const int& height, const ImageFormat& format, const bool& isExternalize) :
m_bits(bits), m_width(width), m_height(height), m_format(format), m_isExternalize(isExternalize)
{
}
CImage::~CImage()
{
if (!m_isExternalize)
{
CValue::FreeImageBits(m_bits);
}
}
void CImage::alloc(const int& width, const int& height, const ImageFormat& format)
{
if (!m_isExternalize && m_bits)
{
CValue::FreeImageBits(m_bits);
}
m_bits = CValue::AllocImageBits(width, height);
m_width = width;
m_height = height;
m_format = format;
m_isExternalize = false;
}
BYTE* CImage::getBits()
{
return m_bits;
}
int CImage::getWidth()
{
return m_width;
}
int CImage::getHeight()
{
return m_height;
}
ImageFormat CImage::getFormat()
{
return m_format;
}
void CImage::externalize()
{
m_isExternalize = true;
}
}

View File

@ -113,6 +113,28 @@ namespace NSJSON
private:
storage_t m_values;
};
}
class CImage : public IBaseValue
{
public:
CImage(BYTE* bits, const int& width, const int& height, const ImageFormat& format, const bool& isExternalize = true);
~CImage();
public:
BYTE* getBits();
int getWidth();
int getHeight();
ImageFormat getFormat();
void externalize();
void alloc(const int& width, const int& height, const ImageFormat& format);
private:
BYTE* m_bits;
int m_width;
int m_height;
ImageFormat m_format;
bool m_isExternalize;
};
} // namespace
#endif // JSON_VALUES_H_

View File

@ -3,9 +3,75 @@
#include "json.h"
#include "../js_internal/js_base.h"
#include "../embed/GraphicsEmbed.h"
#include <cmath>
class CAppImageTo : public CGraphicsAppImage
{
private:
NSJSON::CValueRef* m_image;
public:
CAppImageTo(const NSJSON::CValue& image) : CGraphicsAppImage()
{
m_image = new NSJSON::CValueRef(image);
}
virtual ~CAppImageTo()
{
if (m_image)
delete m_image;
}
public:
virtual unsigned char* GetBits(int& w, int& h)
{
unsigned char* bits = m_image->GetImageBits();
if (NULL != bits)
{
w = m_image->GetImageWidth();
h = m_image->GetImageHeight();
}
return bits;
}
virtual unsigned char* AllocBits(const int& w, const int& h)
{
m_image->ImageAlloc(w, h, GetRgba() ? NSJSON::ImageFormat::ifRGBA : NSJSON::ImageFormat::ifBGRA);
return m_image->GetImageBits();
}
};
class CAppImageFrom : public CGraphicsAppImage
{
public:
unsigned char* m_pData;
int m_nW;
int m_nH;
public:
CAppImageFrom() : CGraphicsAppImage()
{
m_pData = NULL;
m_nW = 0;
m_nH = 0;
}
virtual ~CAppImageFrom()
{
}
public:
virtual unsigned char* GetBits(int& w, int& h)
{
return m_pData;
}
virtual unsigned char* AllocBits(const int& w, const int& h)
{
m_nW = w;
m_nH = h;
m_pData = NSJSON::CValue::AllocImageBits(w, h);
return m_pData;
}
};
namespace NSJSON
{
static JSSmart<NSJSBase::CJSValue> toJS(const CValue& value)
@ -50,6 +116,12 @@ namespace NSJSON
JSSmart<NSJSBase::CJSTypedArray> jsTypedArr = NSJSBase::CJSContext::createUint8Array(const_cast<BYTE*>(value.GetData()), value.GetCount());
ret = jsTypedArr->toValue();
}
else if (value.IsImage())
{
JSSmart<CJSObject> wrap = CJSContext::createEmbedObject("CGraphicsEmbed");
((CGraphicsEmbed*)wrap->getNative())->SetAppImage(new CAppImageTo(value));
ret = wrap->toValue();
}
// objects (there is no need for IsObject())
else
{
@ -130,6 +202,25 @@ namespace NSJSON
else if (jsValue->isObject())
{
JSSmart<NSJSBase::CJSObject> jsObj = jsValue->toObject();
CJSEmbedObject* pNative = jsObj->getNative();
if (pNative != NULL)
{
CGraphicsEmbed* pGrEmbed = dynamic_cast<CGraphicsEmbed*>(pNative);
if (pGrEmbed)
{
CAppImageFrom* pAppImage = dynamic_cast<CAppImageFrom*>(pGrEmbed->GetAppImage());
if (pAppImage)
{
return NSJSON::CValue::CreateImage(pAppImage->m_pData,
pAppImage->m_nW,
pAppImage->m_nH,
pAppImage->GetRgba() ? ImageFormat::ifRGBA : ImageFormat::ifBGRA,
false);
}
}
}
std::vector<std::string> properties = jsObj->getPropertyNames();
ret = CValue::CreateObject();
for (const std::string& name : properties)

View File

@ -44,7 +44,10 @@ CImagesWorker::CImagesWorker(const std::wstring& sFolder)
std::wstring CImagesWorker::GetImageLocal(const std::wstring& sUrl)
{
if (CServerInstance::getInstance().IsEnable())
return L"error";
{
if (!CServerInstance::getInstance().CheckTmpDirectory(sUrl))
return L"error";
}
std::wstring sExt = NSFile::GetFileExtention(sUrl);
std::wstring sRet = L"image" + std::to_wstring(m_nIndex++) + L"." + sExt;
m_mapImages.insert(std::make_pair(sUrl, sRet));

View File

@ -32,11 +32,19 @@
#ifndef SERVER_SETTINGS_H
#define SERVER_SETTINGS_H
#include <string>
#include <map>
#include "../common/File.h"
#include "../common/StringBuilder.h"
#include <iostream>
// class for server version (disable local files and etc)
class CServerInstance
{
private:
bool m_bIsEnabled;
std::map<std::wstring, bool> m_arMapTmpFiles;
CServerInstance()
{
m_bIsEnabled = false;
@ -58,6 +66,32 @@ public:
{
return m_bIsEnabled;
}
void AddTmpFile(const std::wstring& sFolder)
{
std::wstring sDirectory = sFolder + L"/media";
NSStringUtils::string_replace(sDirectory, L"\\", L"/");
std::map<std::wstring, bool>::iterator findDir = m_arMapTmpFiles.find(sDirectory);
if (findDir == m_arMapTmpFiles.end())
m_arMapTmpFiles.insert(std::make_pair(sDirectory, true));
}
void RemoveTmpFile(const std::wstring& sFolder)
{
std::wstring sDirectory = sFolder + L"/media";
NSStringUtils::string_replace(sDirectory, L"\\", L"/");
std::map<std::wstring, bool>::iterator findDir = m_arMapTmpFiles.find(sDirectory);
if (findDir != m_arMapTmpFiles.end())
m_arMapTmpFiles.erase(findDir);
}
bool CheckTmpDirectory(const std::wstring& sFile)
{
std::wstring sDirectory = NSFile::GetDirectoryName(sFile);
NSStringUtils::string_replace(sDirectory, L"\\", L"/");
std::map<std::wstring, bool>::iterator findDir = m_arMapTmpFiles.find(sDirectory);
return (findDir != m_arMapTmpFiles.end()) ? true : false;
}
};

View File

@ -467,6 +467,62 @@ TEST_F(CJSONTest, object)
EXPECT_FALSE(compare(obj, jsObj->toValue(), false));
}
TEST_F(CJSONTest, image_externalize)
{
int width = 1080;
int height = 480;
BYTE* bits = CValue::AllocImageBits(width, height);
CValue img = CValue::CreateImage(bits, width, height, ifBGRA);
EXPECT_TRUE(img.IsImage());
EXPECT_EQ(img.GetImageBits(), bits);
EXPECT_EQ(img.GetImageWidth(), width);
EXPECT_EQ(img.GetImageHeight(), height);
EXPECT_EQ(img.GetImageFormat(), ifBGRA);
CValue::FreeImageBits(bits);
width = 50;
height = 100;
bits = CValue::AllocImageBits(width, height);
img = CValue::CreateImage(bits, width, height, ifRGBA);
EXPECT_TRUE(img.IsImage());
EXPECT_EQ(img.GetImageBits(), bits);
EXPECT_EQ(img.GetImageWidth(), width);
EXPECT_EQ(img.GetImageHeight(), height);
EXPECT_EQ(img.GetImageFormat(), ifRGBA);
CValue::FreeImageBits(bits);
}
TEST_F(CJSONTest, image_not_externalize)
{
int width = 320;
int height = 480;
BYTE* bits = CValue::AllocImageBits(width, height);
CValue img = CValue::CreateImage(bits, width, height, ifARGB, false);
EXPECT_TRUE(img.IsImage());
EXPECT_EQ(img.GetImageBits(), bits);
EXPECT_EQ(img.GetImageWidth(), width);
EXPECT_EQ(img.GetImageHeight(), height);
EXPECT_EQ(img.GetImageFormat(), ifARGB);
}
TEST_F(CJSONTest, image_wrong_size)
{
BYTE* bits = CValue::AllocImageBits(100, 100);
CValue img = CValue::CreateImage(bits, 0, 100, ifARGB, false);
EXPECT_TRUE(img.IsUndefined());
img = CValue::CreateImage(bits, -1, 100, ifARGB, false);
EXPECT_TRUE(img.IsUndefined());
img = CValue::CreateImage(bits, 0, 0, ifARGB, false);
EXPECT_TRUE(img.IsUndefined());
img = CValue::CreateImage(bits, -100, -100, ifARGB, false);
EXPECT_TRUE(img.IsUndefined());
}
TEST_F(CJSONTest, references)
{
CValue val = 42;
@ -526,12 +582,20 @@ TEST_F(CJSONTest, wrong_usage)
EXPECT_THROW(val.GetPropertyNames(), std::bad_cast);
EXPECT_THROW(val.GetCount(), std::bad_cast);
EXPECT_THROW(val.GetData(), std::bad_cast);
EXPECT_THROW(val.GetImageBits(), std::bad_cast);
EXPECT_THROW(val.GetImageFormat(), std::bad_cast);
EXPECT_THROW(val.GetImageHeight(), std::bad_cast);
EXPECT_THROW(val.GetImageWidth(), std::bad_cast);
#else
EXPECT_TRUE(val["name"].IsUndefined());
EXPECT_TRUE(val[0].IsUndefined());
EXPECT_TRUE(val.GetPropertyNames().empty());
EXPECT_EQ(val.GetCount(), 0);
EXPECT_EQ(val.GetData(), nullptr);
EXPECT_EQ(val.GetImageBits(), nullptr);
EXPECT_EQ(val.GetImageFormat(), ifInvalid);
EXPECT_EQ(val.GetImageHeight(), 0);
EXPECT_EQ(val.GetImageWidth(), 0);
#endif
EXPECT_DOUBLE_EQ(val.ToDouble(), 42.0);
#ifdef JSON_DEBUG
@ -1601,7 +1665,11 @@ TEST_F(CJSONTest, FromJSON_arrays)
CValue val = CValue::FromJSON(strJson);
EXPECT_TRUE(val.IsArray());
EXPECT_EQ(val.GetCount(), 0);
#ifndef JSON_DEBUG
EXPECT_TRUE(val[0].IsUndefined());
#else
EXPECT_THROW(val[0], std::out_of_range);
#endif
strJson = "[1, 2, 3]";
val = CValue::FromJSON(strJson);

View File

@ -356,6 +356,8 @@ public:
virtual void Check(const int& nCode, const unsigned int& nIndex)
{
if (nCode > m_nMaxSymbols)
return;
if (nCode > m_nMax)
m_nMax = nCode;
if (nCode < m_nMin)
@ -794,6 +796,8 @@ public:
std::wstring sNameCorrect = pPair->second.m_sName;
NSStringUtils::string_replace(sNameCorrect, L"\\", L"\\\\");
NSStringUtils::string_replace(sNameCorrect, L"\"", L"\\\"");
NSStringUtils::string_replace(sNameCorrect, L"\n", L"");
NSStringUtils::string_replace(sNameCorrect, L"\r", L"");
oWriterJS += sNameCorrect;
oWriterJS.AddSize(120);

View File

@ -109,7 +109,7 @@ FT_Error FT_Load_Glyph_Wrapper( FT_Face face,
FT_Err_Invalid_Reference = 0x86;
*/
if ((bHintsSupport == TRUE) && ((nErr > 0x10 && nErr < 0x28) || nErr == 0x83 || nErr == 0x86))
if ((bHintsSupport == TRUE) && ((nErr > 0x10 && nErr < 0x28) || (nErr >= 0x83 && nErr <= 0x8D)))
{
int nErr2 = FT_Load_Glyph(face, glyph_index, 40970);

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* (c) Copyright Ascensio System SIA 2010-2024
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* (c) Copyright Ascensio System SIA 2010-2024
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* (c) Copyright Ascensio System SIA 2010-2024
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -531,6 +531,45 @@ ZLib.prototype.getImageAsSvg = function(path)
return string;
};
/**
* Get image file raw data. this memory was copied and detach from archive.
* @returns {Uint8Array}
*/
ZLib.prototype.getImageBuffer = function(path)
{
let result = {
type : 0,
data : null
};
result.type = this.getImageType(path);
if (result.type === 0)
return null;
let fileData = this.getFile(path);
result.data = new Uint8Array(fileData.length);
result.data.set(fileData);
if (result.type != 10 &&
result.type != 21)
{
return result;
}
result.type = 24;
// Source was saved as result.data for using original image in native convertations.
// But for js we need svg for metafiles.
let encodedData = Module["_Raster_Encode"](this.files[path].p + 4, fileData.length, 24);
let encodedSize = Module["_Raster_GetEncodedSize"](encodedData);
let encodedBuffer = Module["_Raster_GetEncodedBuffer"](encodedData);
let fileDataEnc = new Uint8Array(Module["HEAP8"].buffer, encodedBuffer, encodedSize);
result.dataBlob = new Uint8Array(fileDataEnc.length);
result.dataBlob.set(fileDataEnc);
Module["_Raster_DestroyEncodedData"](encodedData);
return result;
};
/**
* Get image blob for browser
* @returns {Blob}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* (c) Copyright Ascensio System SIA 2010-2024
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -35,7 +35,7 @@
window['AscFonts'] = window['AscFonts'] || {};
var AscFonts = window['AscFonts'];
var g_native_engine = CreateEmbedObject("CTextMeasurerEmbed");
var g_native_engine = null;
function CReturnObject()
{
@ -236,4 +236,6 @@ AscFonts.Hyphen_Word = function(lang, word)
AscFonts.onLoadModule();
AscFonts.onLoadModule();
window["InitNativeTextMeasurer"] = function() { g_native_engine = CreateEmbedObject("CTextMeasurerEmbed"); };
})(window, undefined);

View File

@ -100,6 +100,7 @@
"FT_CONFIG_OPTION_SYSTEM_ZLIB",
"GRAPHICS_NO_USE_DYNAMIC_LIBRARY",
"HYPHEN_ENGINE_DISABLE_FILESYSTEM",
"METAFILE_DISABLE_FILESYSTEM",
"HAVE_UNISTD_H", "HAVE_FCNTL_H", "_ARM_ALIGN_",
"METAFILE_SUPPORT_WMF_EMF",

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* (c) Copyright Ascensio System SIA 2010-2024
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -761,6 +761,14 @@ function onLoadFontsModule(window, undefined)
{
return this.engine["getImageBlob"](path);
};
/**
* Get image file raw data. this memory was copied and detach from archive.
* @returns {Uint8Array}
*/
ZLib.prototype.getImageBuffer = function(path)
{
return this.engine["getImageBuffer"](path);
};
/**
* Get all file paths in archive
* @returns {Array}
@ -772,10 +780,84 @@ function onLoadFontsModule(window, undefined)
AscCommon.ZLib = ZLib;
function ZlibImageBlobs()
{
this.url2BlobUrl = {};
this.blobUrl2Data = {};
this.url2Base64 = {};
this.nativeBlobCounter = 1;
}
ZlibImageBlobs.prototype.getBlobUrl = function(path, zip)
{
if (this.url2BlobUrl[path])
return this.url2BlobUrl[path];
let result = zip.getImageBuffer(path);
if (result == null)
return "";
let blobUrl = "";
let blobType = AscCommon.openXml.GetMimeType((24 !== result["type"]) ? AscCommon.GetFileExtension(path) : "svg");
if (window["NATIVE_EDITOR_ENJINE"])
{
blobUrl = "blob:internal-image" + this.nativeBlobCounter++;
}
else
{
try
{
let blob = new Blob([result["dataBlob"] ? result["dataBlob"] : result["data"]], {type: blobType});
blobUrl = window.URL.createObjectURL(blob);
}
catch (e)
{
blobUrl = "error";
AscCommon.consoleLog("ERROR: Image blob was not loaded");
}
}
this.blobUrl2Data[blobUrl] = result;
this.url2BlobUrl[path] = blobUrl;
return blobUrl;
};
ZlibImageBlobs.prototype.getImageBase64 = function(url)
{
if (this.url2Base64[url])
return this.url2Base64[url];
let obj = this.blobUrl2Data[url];
if (!obj)
return url;
let header = "";
switch (obj.type)
{
case 3:
header = "data:image/jpeg;base64,";
break;
case 24:
header = "data:image/svg+xml;base64,";
break;
case 4:
default:
header = "data:image/png;base64,";
}
this.url2Base64[url] = header + AscCommon.Base64.encode(obj.data);
return this.url2Base64[url];
};
window["AscCommon"].g_oDocumentBlobUrls = new ZlibImageBlobs();
if (AscCommon["CZLibEngineJS"])
AscCommon["CZLibEngineJS"].prototype["isModuleInit"] = true;
window.nativeZlibEngine = new ZLib();
if (window["NATIVE_EDITOR_ENJINE"])
window["InitNativeZLib"] = function() { window.nativeZlibEngine = new ZLib(); };
else
window.nativeZlibEngine = new ZLib();
function Hyphenation()
{

View File

@ -1,5 +1,4 @@
#include "AlphaMask.h"
#include <string.h>
#include "AlphaMask_p.h"
namespace Aggplus
{
@ -33,7 +32,6 @@ namespace Aggplus
{
case EMaskDataType::ImageBuffer: return 4;
case EMaskDataType::AlphaBuffer: return 1;
case EMaskDataType::Alpha4Buffer: return 4;
}
}
@ -65,130 +63,26 @@ namespace Aggplus
return Ok;
}
CSoftMask::CSoftMask() : m_unWidth(0), m_unHeight(0), m_pImageData(NULL), m_pAlphaBufferData(NULL) {}
CSoftMask::CSoftMask(BYTE* pBuffer, UINT unWidth, UINT unHeight, EMaskDataType enDataType, bool bExternalBuffer, bool bFlip) : m_pImageData(NULL), m_pAlphaBufferData(NULL)
CSoftMask::CSoftMask(BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, bool bFlip, bool bRGB, bool bAlpha)
{
LoadFromBuffer(pBuffer, unWidth, unHeight, enDataType, bExternalBuffer, bFlip);
if (bAlpha)
m_pInternal = new CSoftMaskAlpha(pBuffer, unWidth, unHeight, false, bFlip);
else
{
if (bRGB)
m_pInternal = new CSoftMaskBGRAgray(pBuffer, unWidth, unHeight, false, bFlip);
else
m_pInternal = new CSoftMaskRGBAgray(pBuffer, unWidth, unHeight, false, bFlip);
}
}
CSoftMask::~CSoftMask()
{
BYTE* pBuffer = m_oRenderingBuffer.buf();
if (NULL != pBuffer)
{
if (!m_bExternalBuffer)
RELEASEARRAYOBJECTS(pBuffer);
m_oRenderingBuffer.attach(NULL, 0, 0, 0);
}
RELEASEOBJECT(m_pImageData);
RELEASEOBJECT(m_pAlphaBufferData);
RELEASEOBJECT(m_pInternal);
}
EMaskDataType CSoftMask::GetDataType() const { return m_enDataType; }
unsigned int CSoftMask::GetStep() const
{
switch(m_enDataType)
{
case EMaskDataType::ImageBuffer: return 4;
case EMaskDataType::AlphaBuffer: return 1;
case EMaskDataType::Alpha4Buffer: return 4;
}
}
unsigned int CSoftMask::GetWidth() const { return m_unWidth; }
unsigned int CSoftMask::GetHeight() const { return m_unHeight; }
void CSoftMask::SetType(EMaskDataType enDataType)
{
m_enDataType = enDataType;
RELEASEOBJECT(m_pImageData);
RELEASEOBJECT(m_pAlphaBufferData);
switch (enDataType)
{
case EMaskDataType::ImageBuffer:
{
m_pImageData = new AMaskFromImage(m_oRenderingBuffer);
m_pImageData->m_oRendererBase.attach(m_pImageData->m_oPixfmt);
m_pImageData->m_oAlphaMask.attach(m_oRenderingBuffer);
break;
}
case EMaskDataType::Alpha4Buffer:
{
m_pAlphaBufferData = new AMaskFromABuffer(m_oRenderingBuffer);
m_pAlphaBufferData->m_oRendererBase.attach(m_pAlphaBufferData->m_oPixfmt);
m_pAlphaBufferData->m_oAlphaMask.attach(m_oRenderingBuffer);
break;
}
}
}
Status CSoftMask::Create(UINT unWidth, UINT unHeight, EMaskDataType enDataType)
{
if (0 == unWidth || 0 == unHeight)
return InvalidParameter;
m_bExternalBuffer = false;
UINT unSize = unWidth * unHeight * GetStep();
BYTE* pAlphaBufffer = new BYTE[unSize];
if (!pAlphaBufffer)
return OutOfMemory;
memset(pAlphaBufffer, 0x00, unSize);
Set(pAlphaBufffer, unWidth, unHeight, enDataType);
return Ok;
}
Status CSoftMask::LoadFromBuffer(BYTE *pBuffer, UINT unWidth, UINT unHeight, EMaskDataType enDataType, bool bExternalBuffer, bool bFlip)
{
if (NULL == pBuffer || 0 == unWidth || 0 == unHeight)
return InvalidParameter;
m_bExternalBuffer = bExternalBuffer;
Set(pBuffer, unWidth, unHeight, enDataType, bFlip);
return Ok;
}
RenBaseBGRA32& CSoftMask::GetRendererBaseImage()
{
return m_pImageData->m_oRendererBase;
}
ScanlineBGRA32Gray& CSoftMask::GetScanlineImage()
{
return m_pImageData->m_oScanLine;
}
ScanlineBGRA32A& CSoftMask::GetScanlineABuffer()
{
return m_pAlphaBufferData->m_oScanLine;
}
BYTE* CSoftMask::GetBuffer()
{
return m_oRenderingBuffer.buf();
}
agg::rendering_buffer& CSoftMask::GetRenderingBuffer()
{
return m_oRenderingBuffer;
}
void CSoftMask::Set(BYTE* pBuffer, UINT unWidth, UINT unHeight, EMaskDataType enDataType, bool bFlip)
{
m_enDataType = enDataType;
m_unWidth = unWidth;
m_unHeight = unHeight;
m_oRenderingBuffer.attach(pBuffer, unWidth, unHeight, (bFlip ? -1 : 1) * GetStep() * unWidth);
SetType(enDataType);
}
unsigned int CSoftMask::GetStep() const { return m_pInternal->GetStep(); }
unsigned int CSoftMask::GetWidth() const { return m_pInternal->GetWidth(); }
unsigned int CSoftMask::GetHeight() const { return m_pInternal->GetHeight(); }
BYTE* CSoftMask::GetBuffer() { return m_pInternal->GetBuffer(); }
ESoftMaskType CSoftMask::GetDataType() { return m_pInternal->GetDataType(); }
}

View File

@ -1,23 +1,16 @@
#ifndef _BUILD_ALPHAMASK_H_
#define _BUILD_ALPHAMASK_H_
#include <string>
#include "aggplustypes.h"
#include "../common/IGrObject.h"
#include "./config.h"
#include "../agg-2.4/include/agg_renderer_base.h"
#include "../agg-2.4/include/agg_pixfmt_rgba.h"
#include "../agg-2.4/include/agg_scanline_u.h"
#include "../agg-2.4/include/agg_alpha_mask_u8.h"
namespace Aggplus
{
enum class EMaskDataType
{
ImageBuffer,
AlphaBuffer,
Alpha4Buffer
AlphaBuffer
};
class GRAPHICS_DECL CAlphaMask : public IGrObject
@ -39,56 +32,30 @@ namespace Aggplus
bool m_bExternalBuffer;
};
template <class PixelFormat, class AlphaMask>
struct TAlphaMaskData
enum class ESoftMaskType
{
TAlphaMaskData(agg::rendering_buffer& oRenderingBuffer) : m_oPixfmt(oRenderingBuffer), m_oScanLine(m_oAlphaMask) {};
PixelFormat m_oPixfmt;
agg::renderer_base<PixelFormat> m_oRendererBase;
AlphaMask m_oAlphaMask;
agg::scanline_u8_am<AlphaMask> m_oScanLine;
RGBGrayBuffer,
BGRGrayBuffer,
Alpha4Buffer
};
typedef agg::renderer_base<agg::pixfmt_bgra32> RenBaseBGRA32;
typedef agg::scanline_u8_am<agg::alpha_mask_bgra32gray> ScanlineBGRA32Gray;
typedef agg::scanline_u8_am<agg::alpha_mask_bgra32a> ScanlineBGRA32A;
class CSoftMask_private;
class GRAPHICS_DECL CSoftMask : public IGrObject
{
public:
CSoftMask();
CSoftMask(BYTE* pBuffer, UINT unWidth, UINT unHeight, EMaskDataType enDataType, bool bExternalBuffer = true, bool bFlip = false);
virtual ~CSoftMask();
CSoftMask(BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, bool bFlip, bool bRGB, bool bAlpha);
~CSoftMask();
EMaskDataType GetDataType() const;
unsigned int GetStep() const;
unsigned int GetWidth() const;
unsigned int GetHeight() const;
BYTE* GetBuffer();
ESoftMaskType GetDataType();
void SetType(EMaskDataType enDataType);
Status Create(UINT unWidth, UINT unHeight, EMaskDataType enDataType);
Status LoadFromBuffer(BYTE* pBuffer, UINT unWidth, UINT unHeight, EMaskDataType enDataType, bool bExternalBuffer = true, bool bFlip = false);
agg::rendering_buffer& GetRenderingBuffer();
RenBaseBGRA32& GetRendererBaseImage();
ScanlineBGRA32Gray& GetScanlineImage();
ScanlineBGRA32A& GetScanlineABuffer();
BYTE* GetBuffer();
private:
void Set(BYTE* pBuffer, UINT unWidth, UINT unHeight, EMaskDataType enDataType, bool bFlip = false);
CSoftMask_private* m_pInternal;
agg::rendering_buffer m_oRenderingBuffer;
EMaskDataType m_enDataType;
bool m_bExternalBuffer;
unsigned int m_unWidth;
unsigned int m_unHeight;
typedef TAlphaMaskData<agg::pixfmt_bgra32, agg::alpha_mask_bgra32gray> AMaskFromImage;
typedef TAlphaMaskData<agg::pixfmt_bgra32, agg::alpha_mask_bgra32a> AMaskFromABuffer;
AMaskFromImage* m_pImageData;
AMaskFromABuffer* m_pAlphaBufferData;
friend class CGraphics;
};
}

View File

@ -0,0 +1,96 @@
#ifndef _BUILD_ALPHAMASK_P_H_
#define _BUILD_ALPHAMASK_P_H_
#include "AlphaMask.h"
#include <string>
#include <string.h>
#include "../agg-2.4/include/agg_rendering_buffer.h"
#include "../agg-2.4/include/agg_scanline_u.h"
#include "../agg-2.4/include/agg_alpha_mask_u8.h"
namespace Aggplus
{
class CSoftMask_private
{
public:
virtual ~CSoftMask_private()
{
BYTE* pBuffer = m_oRenderingBuffer.buf();
if (NULL != pBuffer)
{
if (!m_bExternalBuffer)
RELEASEARRAYOBJECTS(pBuffer);
m_oRenderingBuffer.attach(NULL, 0, 0, 0);
}
}
unsigned int GetStep() const { return 4; }
unsigned int GetWidth() const { return m_unWidth; }
unsigned int GetHeight() const { return m_unHeight; }
BYTE* GetBuffer() { return m_oRenderingBuffer.buf(); }
virtual ESoftMaskType GetDataType() const = 0;
virtual bool GetSwapRGB() const { return true; };
protected:
CSoftMask_private(BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, bool bExternalBuffer, bool bFlip)
{
m_bExternalBuffer = bExternalBuffer;
m_unWidth = unWidth;
m_unHeight = unHeight;
m_oRenderingBuffer.attach(pBuffer, unWidth, unHeight, (bFlip ? -1 : 1) * GetStep() * unWidth);
}
agg::rendering_buffer m_oRenderingBuffer;
bool m_bExternalBuffer;
unsigned int m_unWidth;
unsigned int m_unHeight;
};
class CSoftMaskBGRAgray : public CSoftMask_private
{
public:
CSoftMaskBGRAgray(BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, bool bExternalBuffer, bool bFlip)
: CSoftMask_private(pBuffer, unWidth, unHeight, bExternalBuffer, bFlip), m_oAlphaMask(m_oRenderingBuffer), m_oScanLine(m_oAlphaMask) {}
agg::scanline_u8_am<agg::alpha_mask_bgra32gray>& GetScanline() { return m_oScanLine; }
virtual ESoftMaskType GetDataType() const override { return ESoftMaskType::BGRGrayBuffer; }
private:
agg::alpha_mask_bgra32gray m_oAlphaMask;
agg::scanline_u8_am<agg::alpha_mask_bgra32gray> m_oScanLine;
};
class CSoftMaskRGBAgray : public CSoftMask_private
{
public:
CSoftMaskRGBAgray(BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, bool bExternalBuffer, bool bFlip)
: CSoftMask_private(pBuffer, unWidth, unHeight, bExternalBuffer, bFlip), m_oAlphaMask(m_oRenderingBuffer), m_oScanLine(m_oAlphaMask) {}
agg::scanline_u8_am<agg::alpha_mask_rgba32gray>& GetScanline() { return m_oScanLine; }
virtual bool GetSwapRGB() const override { return false; };
virtual ESoftMaskType GetDataType() const override { return ESoftMaskType::RGBGrayBuffer; }
private:
agg::alpha_mask_rgba32gray m_oAlphaMask;
agg::scanline_u8_am<agg::alpha_mask_rgba32gray> m_oScanLine;
};
class CSoftMaskAlpha : public CSoftMask_private
{
public:
CSoftMaskAlpha(BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, bool bExternalBuffer, bool bFlip)
: CSoftMask_private(pBuffer, unWidth, unHeight, bExternalBuffer, bFlip), m_oAlphaMask(m_oRenderingBuffer), m_oScanLine(m_oAlphaMask) {}
agg::scanline_u8_am<agg::alpha_mask_rgba32a>& GetScanline() { return m_oScanLine; }
virtual ESoftMaskType GetDataType() const override { return ESoftMaskType::Alpha4Buffer; }
private:
agg::alpha_mask_rgba32a m_oAlphaMask;
agg::scanline_u8_am<agg::alpha_mask_rgba32a> m_oScanLine;
};
}
#endif // _BUILD_ALPHAMASK_P_H_

View File

@ -107,9 +107,14 @@ namespace NSThreads
{
if (i->ID == nThreadId)
{
CBaseThreadInfo last;
last.ID = i->ID;
last.Instance = i->Instance;
m_listThreads.erase(i);
m_listThreads.insert(m_listThreads.begin(), *i);
return i->Instance;
m_listThreads.insert(m_listThreads.begin(), last);
return last.Instance;
}
i++;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,179 @@
#ifndef BOOLEANOPERATIONS_H
#define BOOLEANOPERATIONS_H
#include "GraphicsPath.h"
#include <memory>
namespace Aggplus
{
struct Location;
struct Segment
{
PointD P{};
PointD HI{};
PointD HO{};
bool IsCurve = false;
bool Visited = false;
bool PolyClosed = false;
int Index = -1;
int Id = 0;
int Winding = 0;
std::shared_ptr<Location> Inters{nullptr};
Segment() noexcept;
Segment(const std::vector<PointD>& points, const bool& isCurve,
const int& index, const int& id, const bool& polyClosed) noexcept;
Segment(const PointD& point, const bool& isCurve, const int& index,
const int& id, const bool& polyClosed) noexcept;
Segment(const PointD& p) noexcept;
Segment(const PointD& p, const PointD& hi, const PointD& ho) noexcept;
void SetHandles(const PointD& hi, const PointD& ho) noexcept;
void UpdateHandles(const PointD& hi, const PointD& ho) noexcept;
bool IsValid(const BooleanOpType& op) const noexcept;
bool IsEmpty() const noexcept;
bool operator==(const Segment& other) const noexcept;
bool operator!=(const Segment& other) const noexcept;
};
struct Curve
{
Segment Segment1{};
Segment Segment2{};
Curve() noexcept;
Curve(const Segment& segment1, const Segment& segment2) noexcept;
Curve(const std::vector<double>& values) noexcept;
Curve(const double& x0, const double& y0, const double& x1, const double& y1,
const double& x2, const double& y2, const double& x3, const double& y3) noexcept;
std::vector<double> GetXValues() const noexcept;
std::vector<double> GetYValues() const noexcept;
std::vector<double> GetBound() const noexcept;
std::vector<double> GetPeeks() const;
double GetLength(double a = 0, double b = 1) const;
double GetSquaredLineLength() const noexcept;
double GetTimeOf(const PointD& point) const noexcept;
double GetTimeAt(const double& offset) const noexcept;
PointD Get(const double& t, const int& type) const noexcept;
PointD GetPoint(const double& t) const noexcept;
PointD GetTangent(const double& t) const noexcept;
PointD GetTangent(const double& t, const double& offset,
const bool& inside, const PointD& p) const noexcept;
Curve GetPart(double from, double to) const noexcept;
std::vector<Curve> GetMonoCurves(const bool& dir) const noexcept;
std::vector<double> GetCurveLineIntersection(const double& px, const double& py,
const double& vx, const double& vy) const noexcept;
std::vector<std::pair<double, double>> GetOverlaps(const Curve& curve) const noexcept;
std::vector<Curve> Subdivide(const double& t) const noexcept;
Curve DivideAtTime(const double& time) noexcept;
int SolveCubic(const int& coord, const double& value, std::vector<double>& roots,
const double& mn, const double& mx) const noexcept;
int SolveCubic(double a, double b, double c, double d, std::vector<double>& roots,
const double& mn, const double& mx) const noexcept;
void Flip() noexcept;
bool IsStraight() const noexcept;
bool operator==(const Curve& other) const noexcept;
bool operator!=(const Curve& other) const noexcept;
};
struct Location
{
Curve C{};
Segment S{};
double Time = -1.0;
bool Overlap = false;
bool Ends = false;
std::shared_ptr<Location> Inters{nullptr};
std::shared_ptr<Location> Next{nullptr};
std::shared_ptr<Location> Prev{nullptr};
Location() noexcept;
Location(const Curve& curve, const double& time, const bool& overlap, const bool& ends) noexcept;
bool IsTouching() noexcept;
};
class CBooleanOperations
{
public:
CBooleanOperations(const CGraphicsPath& path1, const CGraphicsPath& path2, BooleanOpType op, long fillType = c_nWindingFillMode);
~CBooleanOperations();
CGraphicsPath&& GetResult();
// BooleanOp
void TraceBoolean();
void TraceOneInters();
void TraceAllOverlap();
void TracePaths();
// Path
void PreparePath(const CGraphicsPath& path, int id, std::vector<Segment>& segments,
std::vector<Curve>& curves, bool reverse = false);
void InsertSegment(Segment& segment, const Segment& handles, bool updateHandles);
Curve GetCurve(const Segment& segment) const noexcept;
Curve GetPreviousCurve(const Curve& curve) const noexcept;
Curve GetNextCurve(const Curve& curve) const noexcept;
Segment GetNextSegment(const Segment& segment) const noexcept;
void SetVisited(const Segment& segment);
// Bounds
std::vector<std::vector<int>> FindBoundsCollisions();
// Intersection
bool IsCrossing(std::shared_ptr<Location> loc) noexcept;
bool IntersectsBounds() noexcept;
void GetIntersection();
void GetCurveIntersection(const Curve& curve1, const Curve& curve2);
void LinkIntersection(std::shared_ptr<Location> form, std::shared_ptr<Location> to);
void AddLineIntersection(const Curve& curve1, const Curve& curve2);
void AddCurveLineIntersection(const Curve& curve1, const Curve& curve2, bool flip);
int AddCurveIntersection(const Curve& curve1, const Curve& curve2, const Curve& startCurve1, const Curve& startCurve2, bool flip,
int recursion = 0, int calls = 0, double tMin = 0.0, double tMax = 1.0, double uMin = 0.0, double uMax = 1.0);
int CheckInters(const Segment& segment, const Curve& curve, int& touchCount) const;
void SetWinding();
// Location
void DivideLocations();
void AddLocation(Curve curve1, Curve curve2, double t1, double t2, bool overlap = false, bool filter = true, bool bothEnds = false);
void InsertLocation(std::shared_ptr<Location> loc, bool overlap);
bool AllOverlap() const noexcept;
bool AllInters(const std::vector<Segment>& segments) const noexcept;
void AddOffsets(std::vector<double>& offsets, const Curve& curve, bool end);
private:
BooleanOpType Op = Intersection;
bool Close1 = true;
bool Close2 = true;
// c_nStroke, c_nWindingFillMode, c_nEvenOddFillMode
long FillType = c_nWindingFillMode;
CGraphicsPath Path1;
CGraphicsPath Path2;
CGraphicsPath Result;
std::vector<Segment> Segments1;
std::vector<Segment> Segments2;
std::vector<Curve> OriginCurves1;
std::vector<Curve> OriginCurves2;
std::vector<Curve> Curves1;
std::vector<Curve> Curves2;
std::vector<std::shared_ptr<Location>> Locations;
};
} // namespace Aggplus
#endif // BOOLEANOPERATIONS_H

Some files were not shown because too many files have changed in this diff Show More