Compare commits

...

1239 Commits

Author SHA1 Message Date
b18715ae81 Merge branch hotfix/v9.3.1 into master 2026-03-12 15:19:46 +00:00
9983161e3d Merge branch 'hotfix/v9.3.1' of https://git.onlyoffice.com/ONLYOFFICE/core into hotfix/v9.3.1 2026-03-09 21:14:43 +03:00
33c4b5130e Revert missed file 2026-03-09 21:14:26 +03:00
0101774675 Fix safeUrl method 2026-03-09 13:35:40 +03:00
de9709ea50 Fix fromUnicode on ios 2026-03-09 13:35:02 +03:00
22e7c5bed4 Change download method 2026-03-06 23:25:00 +03:00
3fe2ed032d Merge branch hotfix/v9.3.1 into master 2026-03-05 07:46:21 +00:00
573b85932f Merge branch release/v9.3.0 into hotfix/v9.3.1 2026-03-04 09:17:03 +00:00
c5f1a08422 Merge branch release/v9.3.0 into master 2026-03-04 09:16:59 +00:00
7043b36093 Merge branch hotfix/v9.3.1 into master 2026-03-03 11:57:42 +00:00
52f8640b10 Merge pull request 'fix prev' (#707) from fix/fix-bugs into hotfix/v9.3.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/707
2026-03-02 10:46:12 +00:00
8a1a45f403 fix prev 2026-03-02 10:04:34 +03:00
2b46e0251f Merge pull request 'fix for prev binary' (#705) from fix/fix-bugs into hotfix/v9.3.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/705
2026-02-27 13:42:47 +00:00
078a58772c fix for prev binary 2026-02-27 16:37:30 +03:00
3c707ebbf4 Fix bug 78204 2026-02-26 15:44:32 +03:00
d54f0326cd Merge branch release/v9.3.0 into master 2026-02-24 14:07:21 +00:00
269dd9b8bc Merge pull request 'Fix bugs 80287, 80300, 80281' (#699) from fix/bug-80287 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/699
2026-02-24 14:00:15 +00:00
9da0b82ead Fix bug 80281 2026-02-24 16:45:55 +03:00
e3334cbea5 Fix bug 80300 2026-02-24 14:27:45 +03:00
01c928c724 Fix bug 80287 2026-02-24 13:41:01 +03:00
e5c1dc4bc3 Merge pull request 'fix bug #79951' (#698) from fix/fix_bugs into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/698
2026-02-23 16:20:47 +00:00
2c5cd93ac5 fix bug #79951 2026-02-23 19:14:03 +03:00
1ff1334746 Merge pull request 'Fix bugs 80285, 80286' (#697) from fix/pdf-bugs into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/697
2026-02-23 15:13:03 +00:00
de096d4229 Fix bug 80286 2026-02-23 17:58:42 +03:00
6c9d795167 Fix bug 80285 2026-02-23 15:39:09 +03:00
8116322018 Fix build on windows 2026-02-23 08:18:44 +03:00
5428c28874 Fix bug 80220 2026-02-23 02:50:05 +03:00
e389b4d799 Merge pull request 'Fix memory init' (#696) from fix/pict into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/696
2026-02-22 19:59:27 +00:00
8c607a429a Fix memory init 2026-02-22 22:55:54 +03:00
00e80b68f6 Merge pull request 'For bug 79086' (#695) from fix/pict into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/695
2026-02-22 19:46:58 +00:00
377317892d For bug 79086 2026-02-22 22:41:43 +03:00
ef77688ea2 Merge pull request 'For bug 80280' (#694) from fix/bug-80280 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/694
2026-02-22 17:26:59 +00:00
eb756fab5c For bug 80280 2026-02-22 20:20:53 +03:00
2d2bb7cee7 Merge pull request 'Fix stroke with images' (#693) from fix/docx-renderer into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/693
2026-02-20 17:25:52 +00:00
1abe5b2dcc Fix stroke with images 2026-02-20 20:22:03 +03:00
2b4bdfdc05 Merge pull request 'Fix paragraph line spacing' (#692) from fix/docx-renderer into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/692
2026-02-20 16:13:46 +00:00
007c70bcc0 Fix paragraph line spacing 2026-02-20 19:11:20 +03:00
017b43dd66 Merge pull request 'fix bug #80155' (#691) from fix/fix-bugs into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/691
2026-02-20 14:40:36 +00:00
88a6760086 fix bug #80155 2026-02-20 17:39:07 +03:00
98a0551123 Merge pull request 'fix/bug80153' (#690) from fix/bug80153 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/690
2026-02-20 14:36:15 +00:00
49cb1cdbca fix/bug80153
fix bug #80153 and #80152
2026-02-20 14:39:17 +03:00
73e00a5096 Merge pull request 'fix bug #80011' (#689) from fix/bug80011 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/689
2026-02-20 11:11:46 +00:00
462eeda60c fix bug #80011 2026-02-20 12:22:26 +03:00
e1f81b6830 Merge pull request 'Fix bug 80240' (#688) from fix/bug-80240 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/688
2026-02-20 08:39:06 +00:00
d63a6e2ba4 Fix buf 80240 2026-02-20 11:35:44 +03:00
b9cf1bd204 Merge pull request 'Fix bug #80228' (#687) from fix/bug-80228 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/687
2026-02-20 08:04:03 +00:00
81ec569f59 Fix bug #80228 2026-02-20 03:55:40 +03:00
236913f902 Merge pull request 'Fix default CheckBox border style' (#686) from fix/pdf-bugs into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/686
2026-02-19 14:52:53 +00:00
2a6d9faaf8 Fix default CheckBox border style 2026-02-19 17:49:30 +03:00
7a78e1bbc6 Merge pull request 'Fix bug 80175' (#685) from fix/bug-80175 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/685
2026-02-19 14:30:24 +00:00
f2db0df9f5 Fix bug 80175 2026-02-19 17:26:01 +03:00
c2dfac0d27 Merge pull request 'Fix bug 77348' (#684) from fix/bug-77348 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/684
2026-02-19 11:55:58 +00:00
902497b299 Fix CropBox offset 2026-02-19 14:38:33 +03:00
35aa329619 Fix MediaBox offset 2026-02-19 13:10:45 +03:00
6ace9b1cc5 Fix bug 77348 2026-02-19 13:09:50 +03:00
f6bc46c551 Merge pull request 'fix/bug80151' (#680) from fix/bug80151 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/680
2026-02-18 16:44:28 +00:00
790049d14a Merge pull request 'fix/bug79610' (#682) from fix/bug79610 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/682
2026-02-18 15:27:50 +00:00
ccc9f8f91f Merge pull request 'Fix bug 78772' (#681) from fix/bug78772 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/681
2026-02-18 15:05:22 +00:00
f2eace2b53 Merge pull request 'fix/bug80009' (#679) from fix/bug80009 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/679
2026-02-18 15:04:52 +00:00
dfe7a64e1a fix/bug79610 2026-02-18 16:33:49 +03:00
65f89c1e4b fix/bug79610
fix bug #79610
2026-02-18 16:32:15 +03:00
ea7ff62816 Fix bug 78772 2026-02-18 16:08:04 +03:00
4ac45f41cb fix bug #80011 2026-02-18 15:32:27 +03:00
947e5a1f5d fix bug #80151 2026-02-18 15:31:35 +03:00
3e724e6164 fix/bug80009
fix bug #80009
2026-02-18 11:59:26 +03:00
8ef0713adc Merge pull request 'fix bug #80172' (#678) from fix/fix-bugs into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/678
2026-02-18 07:37:33 +00:00
2f74b3b69b fix bug #80172 2026-02-18 10:30:46 +03:00
7ce71b6f5d Merge pull request 'fix/fix-bugs' (#677) from fix/fix-bugs into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/677
2026-02-18 06:28:02 +00:00
9b5847e653 for bug #76556 2026-02-17 22:36:15 +03:00
d81e26eff7 fix bug #80155 2026-02-17 22:11:25 +03:00
67e987e389 Merge pull request 'Fix bug 80103' (#676) from fix/bug80103 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/676
2026-02-17 15:08:26 +00:00
bc91106ea4 Merge pull request 'Fix right postiton via width in font' (#675) from fix/docx-renderer into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/675
2026-02-17 13:44:18 +00:00
d91a19cbc2 Fix right postiton via width in font 2026-02-17 16:17:26 +03:00
970720575a Fix bug 80103 2026-02-17 14:51:18 +03:00
f11045c87f Merge pull request 'Fix bugs in html to md conversion' (#674) from fix/html2md into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/674
2026-02-17 07:14:42 +00:00
70e819c56b Added a new constructor to CStringBuilder 2026-02-17 01:52:35 +03:00
5a662b3567 Fix bug #80116 2026-02-17 01:51:21 +03:00
0f920531ac Fix bugs in html2md conversion 2026-02-16 22:25:31 +03:00
84d3ea7a21 Fix bug #80121 2026-02-16 20:16:50 +03:00
4893ff96fd Fix bug in html2md conversion 2026-02-16 18:45:44 +03:00
6a7791ae0a Fix bug #80119 2026-02-16 18:23:37 +03:00
78ac7bb427 Refactoring 2026-02-16 17:50:54 +03:00
8180a20cb8 Fix bug #80112 2026-02-16 17:37:59 +03:00
eb51861f39 fix bug #80117 2026-02-16 17:36:32 +03:00
e4cc737c38 . 2026-02-16 16:14:00 +03:00
6c89a66b3d Merge pull request 'Fix set Kids for widget Parents' (#672) from fix/pdf-bugs into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/672
2026-02-16 12:49:12 +00:00
b127bd3ac1 Fix set Kids for widget Parents 2026-02-16 15:42:50 +03:00
0cca75b662 fix build 2026-02-16 15:39:29 +03:00
08dc0c99cf Merge pull request 'for bug #54521' (#579) from fix/bug54521 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/579
2026-02-16 09:47:25 +00:00
d2af89a2f6 Merge pull request 'fix bug #80011' (#670) from fix/bug80011 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/670
2026-02-16 09:46:48 +00:00
836787f151 fix bug #80012 2026-02-16 12:18:20 +03:00
eb78332705 Merge pull request 'Fix bug 80093' (#671) from fix/bug-80093 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/671
2026-02-16 09:17:27 +00:00
f232d0ca51 Fix bug 80093 2026-02-16 12:11:25 +03:00
24d436fb9c fix bug #80011 2026-02-15 20:48:31 +03:00
1d362cf69a Merge remote-tracking branch 'origin/feature/add-xls-writing' into release/v9.3.0 2026-02-15 16:45:38 +03:00
6c0326d660 Merge pull request 'fix/bug79610' (#669) from fix/bug79610 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/669
2026-02-14 19:23:55 +00:00
4400c9d4f4 Api => Asc.editor 2026-02-14 00:07:22 +03:00
71c7d25c9e fix/bug79610
fix bug #79610
2026-02-13 22:41:51 +03:00
ab1dd7a48b fix/bug79610
fix bug #79610
2026-02-13 22:34:41 +03:00
6e3d625420 Merge pull request 'fix/docx-renderer' (#668) from fix/docx-renderer into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/668
2026-02-13 16:11:11 +00:00
ebb0eb8136 Merge pull request 'Add signature info' (#667) from fix/pdf-signature into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/667
2026-02-13 15:24:55 +00:00
10f34fb67d Add signature info 2026-02-13 18:17:25 +03:00
98d2f62f9e Fix paragraphs splits with overlapping text lines 2026-02-13 18:07:58 +03:00
096df8fc31 Fix logic with paragraph lines 2026-02-13 16:48:47 +03:00
a7886c5cd6 Fix bugs 2026-02-13 15:27:18 +03:00
ee6ea683d1 Added definition of md text styles from html styles 2026-02-13 15:06:39 +03:00
9343f73818 Merge pull request 'Fix bug 80055' (#666) from fix/pdf-bugs into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/666
2026-02-13 11:53:56 +00:00
61aeb6f386 Fixed a bug with the initial number of the list element 2026-02-13 14:41:10 +03:00
06e8d136bf Merge pull request 'To Markdown conversion' (#660) from feature/html2md into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/660
2026-02-13 11:28:47 +00:00
c1d649b506 Fix bug 80055 2026-02-13 14:23:53 +03:00
4386e9c794 Fix shape merging 2026-02-12 23:12:00 +03:00
4900305b4a Merge branch 'release/v9.3.0' of https://git.onlyoffice.com/ONLYOFFICE/core into release/v9.3.0 2026-02-12 18:32:29 +03:00
e1f923c593 fix bug #79470 2026-02-12 18:32:03 +03:00
07ef2269ac Merge pull request 'For bug 80007' (#665) from fix/bug-80007 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/665
2026-02-12 15:31:48 +00:00
cf44441645 For bug 80007 2026-02-12 18:29:43 +03:00
7157d209d7 add worksheet drawing conversion 2026-02-12 20:02:41 +06:00
64a560679c add cell anchor pos getter 2026-02-12 18:29:29 +06:00
2682e49090 fix drawing conversion 2026-02-12 18:28:28 +06:00
7fd4219ff4 add clientAnchorSheet writing 2026-02-12 16:35:48 +06:00
4f9c229f77 Merge pull request 'Fix bug 79949' (#664) from fix/bug-79949 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/664
2026-02-12 09:10:37 +00:00
6d8454c39d Fix bug 79949 2026-02-12 12:03:08 +03:00
58deecba88 Merge pull request 'Fix bug #79894' (#663) from fix/bug-79894 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/663
2026-02-11 16:06:57 +00:00
1940bc53f7 Fix bug #79894 2026-02-11 18:58:35 +03:00
a6ac765676 add office art client data writing 2026-02-11 21:24:12 +06:00
08624e8334 Merge pull request 'Fix bug 79999' (#662) from fix/pdf-bugs into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/662
2026-02-11 14:59:29 +00:00
1f078c8c49 Merge pull request 'Fix bug 79885' (#661) from fix/bug-79885 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/661
2026-02-11 14:53:51 +00:00
e6036b37be Fix bug 79885 2026-02-11 17:51:17 +03:00
04f1c30036 The possible md conversion formats have been expanded 2026-02-11 17:44:05 +03:00
86f84f89de Fix bugs in html2md conversion 2026-02-11 17:30:42 +03:00
17b80ac96e fix bug #79968 2026-02-11 17:00:25 +03:00
710bfef301 Add clientAnchor writing 2026-02-11 17:32:08 +06:00
aa75825a73 Fix bug 79999 2026-02-11 13:53:29 +03:00
f74caacbd0 Merge pull request 'fix/bug56564' (#659) from fix/bug56564 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/659
2026-02-11 10:50:48 +00:00
4d903b58b8 fix/bug56564
fix bug #56564
2026-02-11 13:45:41 +03:00
6434965f09 Merge pull request 'Fix pdf signature' (#658) from fix/pdf-signature into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/658
2026-02-11 09:03:17 +00:00
f60f957d00 Fix comment 2026-02-11 11:58:04 +03:00
bad5b172d5 Fix x2t 2026-02-11 11:37:55 +03:00
7b6f29a5f0 Merge pull request 'HTML to Markdown' (#657) from feature/html2md into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/657
2026-02-11 07:59:58 +00:00
b5e1cf9d06 Change PrepareSignature 2026-02-11 10:03:50 +03:00
0f73b2aa8b Added html to md conversion in x2t 2026-02-10 22:34:04 +03:00
e3b5d72ec8 add client anchor writing 2026-02-10 21:43:50 +06:00
8f8a9ad29b fix bug #56683 2026-02-10 16:12:41 +03:00
1417b4bbd4 add embedded chartsheet substream writing 2026-02-10 18:26:39 +06:00
87c9f66c58 Merge pull request 'Fix pdf bugs' (#656) from fix/pdf-bugs into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/656
2026-02-10 11:27:36 +00:00
d0a9d2cfe2 Merge pull request 'fix/bug78280' (#654) from fix/bug78280 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/654
2026-02-10 11:19:41 +00:00
627d5913e6 Merge pull request 'feature/x2ttester' (#655) from feature/x2ttester into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/655
2026-02-10 10:57:05 +00:00
5ca60f6bcd Add md suppot and fix default delim in tsv 2026-02-10 13:55:38 +03:00
72f679b649 Fix actrion GoTo flag 2026-02-10 13:50:54 +03:00
c84c35933e Add more parms for tsv format 2026-02-10 13:44:07 +03:00
63f160641d Fix bug 79962
Add tsv format
2026-02-10 13:39:31 +03:00
7a8ccfdfa0 fix bug 2026-02-10 12:58:13 +03:00
6091a7b5cd Fix build 2026-02-10 11:58:52 +03:00
95b4461961 Fix bug 79937 2026-02-10 11:15:48 +03:00
ec5afc1f17 fix bug #79859 2026-02-10 11:11:04 +03:00
9dd13a2f74 Merge pull request 'Fix docx-renderer' (#653) from fix/docx-renderer into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/653
2026-02-10 06:30:00 +00:00
b850450c25 Fix build 2026-02-10 03:42:13 +03:00
098d40d44f Modification of the html converter 2026-02-10 02:18:38 +03:00
82769d3c0e Fix paragraph build 2026-02-09 23:30:30 +03:00
5121f74851 Fix subscript/superscript 2026-02-09 23:15:28 +03:00
6fa8b51541 Merge pull request 'Fix missprint' (#652) from fix/docx-renderer-missprint into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/652
2026-02-09 19:51:15 +00:00
3b32ba4d14 Fix missprint 2026-02-09 22:47:22 +03:00
e23acc8881 Merge pull request 'Fix flipY in tiles' (#651) from fix/docx-renderer into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/651
2026-02-09 18:23:25 +00:00
c266ffa85f Fix flipY in tiles 2026-02-09 21:13:18 +03:00
bd2af5f455 Merge pull request 'Fix bug 75900' (#648) from fix/bug-75900 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/648
2026-02-09 15:54:39 +00:00
ec8c0182c3 Merge pull request 'Fix bug 79790' (#650) from fix/bug-79790 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/650
2026-02-09 15:47:17 +00:00
04ad9d4e47 Merge pull request 'Fix bug 79879' (#649) from fix/bug-79879 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/649
2026-02-09 15:47:04 +00:00
3261ba0d0c Fix bug 79790 2026-02-09 18:19:41 +03:00
2189934a50 Fix bug 79879 2026-02-09 17:45:04 +03:00
e3842c796a fix bug #79811 2026-02-09 17:08:56 +03:00
7507b6c71f Fix bug 75900 2026-02-09 16:48:07 +03:00
8a406c9612 fix value axis conversion 2026-02-09 19:44:40 +06:00
3a004e8495 fix scatter chart conversion 2026-02-09 17:47:16 +06:00
404748ec5a fix axis conversion 2026-02-09 14:46:19 +06:00
d4f7767c45 fix bug #78279 2026-02-08 12:19:50 +03:00
f91cc79e7d for bug #79472 2026-02-08 12:18:34 +03:00
b14e7fd3a2 Merge pull request 'fix/bug79610' (#646) from fix/bug79610 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/646
2026-02-07 19:14:06 +00:00
fce8173ce4 Merge pull request 'Fix bug 78774' (#647) from fix/bug78774 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/647
2026-02-07 19:13:34 +00:00
8f5bfef6b2 Merge pull request 'Fix bug 59750' (#645) from fix/bug67390 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/645
2026-02-07 19:13:22 +00:00
f6bf73dfab Fix bug 78774 2026-02-06 18:48:55 +03:00
3b10e1a0f3 add axis hiding 2026-02-06 21:13:12 +06:00
f7555af6b3 fix/bug79610
fix bug #79610
2026-02-06 17:33:50 +03:00
3e09e5ad48 Fix bug 59750 2026-02-06 16:24:20 +03:00
655bc0698f Merge pull request 'Fix pdf signature' (#644) from fix/pdf-signature into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/644
2026-02-06 12:40:51 +00:00
e16b85f671 Fix x2t pdfSign 2026-02-06 15:04:30 +03:00
981b8b16a3 Fix unsuccessful signing 2026-02-06 14:26:54 +03:00
70aa8c7e64 add val axis style conversion 2026-02-06 17:13:37 +06:00
4144723822 Merge pull request 'fix/bug-79086' (#643) from fix/bug-79086 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/643
2026-02-06 09:47:04 +00:00
2663e412ef Fix AppFonts initialize 2026-02-06 12:41:52 +03:00
9a91e8192c Fix xref 2026-02-06 11:34:38 +03:00
bff86db600 Merge branch 'develop' into feature/add-xls-writing 2026-02-06 14:05:44 +06:00
668804035a fix svg in base64 2026-02-06 10:47:59 +03:00
cb97ee9fdc Fix bug 79867 2026-02-06 09:31:41 +03:00
56b8e41875 Added some alternative tags 2026-02-05 23:38:21 +03:00
565b2ec494 Fix bugs 2026-02-05 23:09:46 +03:00
a243e60e5a add axis line format conversion 2026-02-05 22:00:39 +06:00
96ce3c22f1 Fix bug 79086 2026-02-05 18:57:33 +03:00
6b58358186 Create PrepareSignature and FinalizeSignature 2026-02-05 18:55:26 +03:00
6c95810f63 add chart gridlines 2026-02-05 21:25:54 +06:00
d9260e5eee Fix bug with heading styles 2026-02-05 17:26:33 +03:00
63510a1fe9 Merge pull request 'Fix bug #79431' (#642) from fix/bug-79478 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/642
2026-02-05 13:00:42 +00:00
1e05ab9acb for bug #70264 2026-02-04 22:33:00 +03:00
c1236815a3 Fix bug #79431 2026-02-04 19:55:12 +03:00
c822a995c1 Merge pull request 'Fix bugs' (#641) from fix/bug-72703 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/641
2026-02-04 14:04:36 +00:00
e612306d75 fix chart size 2026-02-04 19:54:10 +06:00
2d6382e61a Fix bug #79797 2026-02-04 16:51:54 +03:00
2f34fd917e Refactoring 2026-02-04 16:30:08 +03:00
024a5e0192 Merge pull request 'Fix pdf bugs' (#640) from fix/pdf-bugs into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/640
2026-02-04 11:26:56 +00:00
a6183fa4cd Fix bug 79336 2026-02-04 11:18:47 +03:00
13912c93ef Fix different FontKey 2026-02-04 10:54:57 +03:00
adcdbc164f Fix buid 2026-02-04 10:18:35 +03:00
a48a78c1c5 Merge pull request 'Fix clipRect clear' (#639) from fix/bug-79522 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/639
2026-02-03 20:01:10 +00:00
da57bd115c Fix clipRect clear 2026-02-03 22:46:34 +03:00
71b21ea79d add window conversion for chartsheet 2026-02-03 21:42:48 +06:00
5fbb998524 For bug 79437 2026-02-03 18:15:35 +03:00
ea47a90763 Merge pull request 'fix/bug79616' (#637) from fix/bug79554 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/637
2026-02-03 13:16:49 +00:00
daefd8744a Merge pull request 'Fix repeat font name' (#638) from fix/pdf-font into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/638
2026-02-03 12:30:38 +00:00
647327a0c5 Fix repeat font name 2026-02-03 15:12:56 +03:00
58b221f4fa fix/bug79616
for bug #79616
2026-02-03 13:31:14 +03:00
22eaf8241b fix legend pos conversion 2026-02-03 15:18:46 +06:00
64c7b7a3fd handout binary 2026-02-02 22:36:39 +03:00
858c2e14c8 Fix bug #79697 2026-02-02 20:54:26 +03:00
2024302fbe Merge pull request 'Fix bug 79443' (#617) from fix/bug-79443 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/617
2026-02-02 17:42:29 +00:00
00f4752dda Fix bug #72703 2026-02-02 18:36:03 +03:00
90b329e06c fix sheet ref conversion 2026-02-02 20:34:04 +06:00
d286b8459b Add offset for unexisted symbol (last width) 2026-02-02 15:36:07 +03:00
ff93f1e8b3 Merge pull request 'Fix bug #79712' (#636) from fix/bug-79712 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/636
2026-02-02 11:08:52 +00:00
65a4fa90a5 Fixed bugs 2026-02-01 23:53:35 +03:00
4471940b92 Fix bug #79712 2026-01-31 18:26:05 +03:00
c4daa0acd4 for bug #79472 2026-01-30 17:43:32 +03:00
6df0cf26f3 Merge pull request 'fix bug #79684' (#634) from fix/bug79684 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/634
2026-01-30 14:24:20 +00:00
720d66ad74 Merge pull request 'fix bug #79698' (#633) from fix/bug79698 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/633
2026-01-30 14:23:49 +00:00
e6522c6ce4 Merge pull request 'fix bug #79699' (#632) from fix/bug79699 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/632
2026-01-30 14:23:23 +00:00
9b3c2291d8 Merge pull request 'Fix subset tag font' (#635) from fix/pdf-font into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/635
2026-01-30 13:49:31 +00:00
e7cfb67962 Fix subset tag font 2026-01-30 16:44:57 +03:00
8725be55f0 fix bug #79699 2026-01-30 18:48:21 +06:00
37ae77d0d2 fix bug #79698 2026-01-30 16:23:03 +06:00
4c6ded76a1 Merge pull request 'Fix bug 67390' (#631) from fix/bug67390 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/631
2026-01-30 08:54:09 +00:00
2d8701cd4f Fix bug 67390 2026-01-30 11:25:45 +03:00
d5c321d47d fix bug #79684 2026-01-30 14:25:41 +06:00
bddfadabb2 fix bug #78280 2026-01-30 11:00:00 +03:00
324f7b3933 Merge pull request 'feature/add-xls-writing' (#630) from feature/add-xls-writing into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/630
2026-01-30 07:21:45 +00:00
edef6a83c8 Merge pull request 'feature/docx-renderer' (#629) from feature/docx-renderer into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/629
2026-01-30 05:02:42 +00:00
e7c21fb2cd Fix bugs 2026-01-30 06:43:34 +03:00
be8ba62c3f Merge pull request 'release/v9.3.0' from release/v9.3.0 into feature/docx-renderer 2026-01-29 22:26:04 +00:00
fda8c8e445 No calc asc/desc using spaces in text lines 2026-01-30 01:15:24 +03:00
d9ebae1724 Change single line width 2026-01-29 23:53:19 +03:00
92ec3d854e Added html to md conversion for some tags 2026-01-29 23:19:02 +03:00
f4867bd9f9 Fix more bugs 2026-01-29 22:26:37 +03:00
9b9da90dcc Fix bugs 2026-01-29 22:03:24 +03:00
cba4bc8085 add legend conversion 2026-01-29 20:41:24 +06:00
325c2d3000 Fix text line shape between lines of paragraph 2026-01-29 16:50:48 +03:00
3187913c8e fix bug #79660 2026-01-29 16:46:05 +03:00
8958d13b56 fix bug #78766 2026-01-29 15:25:40 +03:00
9d13526724 add line 3d chart conversion 2026-01-29 16:56:37 +06:00
93f70176bc add area chart3d conversion 2026-01-29 16:40:44 +06:00
e2ad965d7c add 3dBarChartConversion 2026-01-29 15:58:06 +06:00
d535aa64ef Merge pull request 'Fix bug 75486' (#607) from fix/bug75486 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/607
2026-01-29 09:46:37 +00:00
c155a4c53a add chart3d conversion 2026-01-29 15:11:42 +06:00
97cbd8dcc7 Fix text shape offsets 2026-01-29 09:42:54 +03:00
5e58298d1e Migrated most of the html conversion to the new architecture 2026-01-29 00:38:08 +03:00
d38576085c Merge pull request 'fix/bug79554' (#627) from fix/bug79554 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/627
2026-01-28 17:48:19 +00:00
46dd9efa2e for bug #47231 2026-01-28 16:58:30 +03:00
6af52920a2 fix/bug79554
fix bug #79554
2026-01-28 16:51:11 +03:00
f13baca136 Fix build with c++14 2026-01-28 16:16:32 +03:00
28a91a1519 add area chart conversion 2026-01-28 17:57:30 +06:00
0e48e65ef1 add radar chart conversion 2026-01-28 17:44:31 +06:00
ad1709d4af Merge pull request 'Fix include' (#626) from fix/pdf-font into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/626
2026-01-28 11:26:33 +00:00
e2c6ecec9b Fix include 2026-01-28 14:20:27 +03:00
ef55594f90 Merge pull request 'Fix pdf font' (#625) from fix/pdf-font into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/625
2026-01-28 09:48:08 +00:00
223bbe3347 Fix bug 79318 2026-01-28 12:23:29 +03:00
eca0cdb318 Fix GIDByUnicode for non-CID font 2026-01-28 11:35:21 +03:00
4a52368c30 Merge remote-tracking branch 'origin/release/v9.3.0' into release/v9.3.0 2026-01-27 16:23:22 +00:00
73f4e20c56 Fix qmake bug 2026-01-27 19:21:05 +03:00
d53768969b . 2026-01-27 16:20:16 +00:00
324d6ec0bd Merge pull request 'fix/bug79433' (#624) from fix/bug79433 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/624
2026-01-27 13:25:07 +00:00
767b652ef2 fix/bug79433
fix bug #79433 and fix 51965
2026-01-27 16:10:42 +03:00
68f2f0760d fix surface conversion 2026-01-27 18:35:55 +06:00
694282a013 Merge pull request 'Fix bug 79426' (#623) from fix/bug-79426 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/623
2026-01-27 10:39:07 +00:00
e64eeb26af Fix bug 79426 2026-01-27 13:31:41 +03:00
873b2b9351 Add scatter chart conversion 2026-01-27 16:23:03 +06:00
d5ecb00472 Add surf chart conversion 2026-01-27 16:22:46 +06:00
2ac6801afa add area chart conversion 2026-01-27 14:39:29 +06:00
213c65fe54 Add line chart conversion 2026-01-27 14:23:07 +06:00
8269c14207 Merge pull request 'fix/bug77970' (#622) from fix/bug77970 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/622
2026-01-27 08:20:57 +00:00
f438a17779 fix bug #79483 2026-01-27 00:39:19 +03:00
9c8b739d0e fix bug #77970 2026-01-27 00:38:21 +03:00
a9dc790f92 Migrated most of the html conversion to the new architecture 2026-01-26 19:03:34 +03:00
7f0720bb95 Merge pull request 'Fix merging conts' (#621) from fix/docx-renderer-merge-conts-fix into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/621
2026-01-26 15:28:13 +00:00
846b212882 Fix merging conts 2026-01-26 18:22:05 +03:00
344a096e24 Merge pull request 'PdfWriter use embedded fonts' (#619) from fix/pdf-font into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/619
2026-01-26 14:07:14 +00:00
15eb4793f5 Fix CodeToUnicode and CodeToGID 2026-01-26 15:31:44 +03:00
3ce4b4bfe8 Merge pull request 'Fix readAnnotationsInfoFromBinary Link' (#620) from fix/pdf-action into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/620
2026-01-26 10:00:29 +00:00
b8fab6f4df Fix readAnnotationsInfoFromBinary Link 2026-01-26 12:56:03 +03:00
14bb45d2fe Migrated most of the html conversion to the new architecture 2026-01-25 22:53:08 +03:00
347c1f82a9 Migrated most of the html conversion to the new architecture 2026-01-25 01:39:48 +03:00
7ebf12c1e4 Complete PdfFont 2026-01-23 17:16:58 +03:00
1813e09e1f add chart title conversion 2026-01-23 20:02:11 +06:00
e32b48524e Migrated most of the html conversion to the new architecture 2026-01-22 20:16:47 +03:00
d2a986c480 Merge pull request 'fix/bug59965' (#618) from fix/bug59965 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/618
2026-01-22 13:27:24 +00:00
73880f6207 fix/bug59965
fix #bug59965
2026-01-22 16:22:47 +03:00
24ad4adf6f Merge pull request 'fix/bug79432' (#616) from fix/bug79432 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/616
2026-01-22 13:15:38 +00:00
e4ea19ed81 fix/bug79432
fix #bug79432
2026-01-22 15:59:33 +03:00
575e379c4b Develop PdfFont 2026-01-22 15:11:17 +03:00
86d8c7bfa3 Change anchor 2026-01-22 14:20:41 +03:00
a3e1efb75b add pie chart conversion 2026-01-22 17:13:59 +06:00
e1f7feb5c1 fix bar chart conversion 2026-01-22 15:43:49 +06:00
2a3f565b44 Fix bug 79443 2026-01-22 01:53:25 +03:00
13008c60e5 Merge pull request 'Fix signature size of xref' (#615) from fix/pdf-signature into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/615
2026-01-21 15:41:53 +00:00
df69099689 Fix Copy ProxyObject 2026-01-21 18:36:26 +03:00
4e6f6e44bd Fix clear ProxyObject 2026-01-21 18:32:44 +03:00
67b54dc371 Fix signature size of xref 2026-01-21 18:28:21 +03:00
b0c3172ae5 Remove wrong comment 2026-01-21 18:13:11 +03:00
91d21a80ac Add support sign params 2026-01-21 18:11:03 +03:00
e820a9c936 fix chart conversion 2026-01-21 19:08:27 +06:00
b38b12dfaf Merge pull request 'Fix empty password' (#614) from fix/pdf-password into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/614
2026-01-21 13:03:16 +00:00
39b9e89e77 Fix empty password 2026-01-21 16:01:24 +03:00
0b6ea2a399 Create PdfFont 2026-01-21 15:51:28 +03:00
eee3161833 save tsv 2026-01-21 13:53:11 +03:00
fc422bb2e7 fix chartsheet writing 2026-01-21 16:30:57 +06:00
f359f180bb Merge branch 'develop' into feature/add-xls-writing 2026-01-21 13:26:04 +06:00
b0338919fe [android] Add ooxmlsignature 2026-01-21 09:05:41 +03:00
41358e3308 Fix build 2026-01-20 23:38:47 +03:00
1a29fb1389 Merge pull request 'feature/ios-swiftc' (#613) from feature/ios-swiftc into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/613
2026-01-20 20:30:42 +00:00
2fa048303f Add ooxmlsirnature ref to x2t 2026-01-20 20:57:02 +03:00
79f8e14d07 The division of the html converter into components has begun 2026-01-20 20:22:40 +03:00
e837479426 Fix build 2026-01-20 19:57:20 +03:00
e8f68e3a40 Merge pull request 'for/bug70498' (#612) from for/bug70498 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/612
2026-01-20 16:24:30 +00:00
702987e00c Merge pull request 'Password NULL and empty' (#608) from fix/pdf-password into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/608
2026-01-20 15:56:50 +00:00
83745da5f3 add attached label conversion 2026-01-20 21:47:55 +06:00
6b73faac12 fix variable 2026-01-20 17:53:04 +03:00
cab91648ce Merge pull request 'fix/bug74265' (#611) from fix/bug74265 into for/bug70498
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/611
2026-01-20 14:47:32 +00:00
57b51a8854 fix prev 2026-01-20 17:44:40 +03:00
4a84b8887f Use environment variables set from build_tools 2026-01-20 17:11:04 +04:00
23027e4c2c Merge pull request 'fix bug #79436' (#610) from fix/bug79436 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/610
2026-01-20 12:31:17 +00:00
52c61219dc fix bug #79436 2026-01-20 16:57:10 +06:00
2c37dac18c Merge pull request 'For bug 59181' (#609) from fix/forbug59181 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/609
2026-01-20 10:02:27 +00:00
aa7f104e60 Fix prev 2026-01-20 12:59:08 +03:00
83ea144c16 Merge branch 'release/v9.3.0' into fix/forbug59181 2026-01-20 12:22:50 +03:00
ea6fdc8872 For bug 59181 2026-01-20 11:47:09 +03:00
b64b31a972 Merge remote-tracking branch 'origin/release/v9.3.0' into develop 2026-01-20 11:35:55 +03:00
59fb6e4838 fix bug #79287 2026-01-20 11:16:58 +03:00
d38ce5b836 . 2026-01-19 22:23:33 +03:00
bb4ceb14e5 Password NULL and empty 2026-01-19 17:14:26 +03:00
ef9f25aa4d Fix bug 75486 2026-01-19 16:04:31 +03:00
0c2a5eac1b fix barChart conversion 2026-01-19 16:58:32 +06:00
0f85422315 Merge pull request 'fix bug #79291' (#595) from fix/bug79291 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/595
2026-01-19 09:28:31 +00:00
38fa7436c0 Merge pull request 'fix/bug59181' (#603) from fix/bug59181 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/603
2026-01-19 07:50:40 +00:00
e2ce58a055 Fix compilation for ios simulators 2026-01-18 20:54:56 +04:00
cadba798b0 for bug #70498 2026-01-18 16:54:18 +03:00
3941d5ced2 Add m_sCmapDir param 2026-01-16 21:20:38 +03:00
c529cc6d5c Merge pull request 'feature/docx-renderer' (#606) from feature/docx-renderer into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/606
2026-01-16 18:19:45 +00:00
31f274fbc4 add barChart crt conversion 2026-01-16 21:37:14 +06:00
58fe8ae679 Fix to compile both on ios and simulator
TODO: fails to compile for x86_64 ios_simulator
2026-01-16 18:35:26 +04:00
e3f77e11e0 Fix spacing problem 2026-01-16 17:17:57 +03:00
6e696daa15 add dv axis conversion 2026-01-16 20:15:31 +06:00
21dd930d30 Merge pull request 'Fix bug 79329' (#604) from fix/bug-79329 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/604
2026-01-16 13:45:33 +00:00
c4708222c6 Merge branch 'develop' into feature/add-xls-writing 2026-01-16 19:02:08 +06:00
34aae89432 Merge pull request 'Fix bug #79297' (#605) from fix/bug-79297 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/605
2026-01-16 12:53:48 +00:00
273454a391 Fix path reset 2026-01-16 14:53:19 +03:00
ae4edab75e For bug 79329 2026-01-16 14:20:28 +03:00
e61aa447f2 Merge pull request 'fix bug #76076' (#601) from fix/bug76076 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/601
2026-01-15 14:30:24 +00:00
6609e84bd1 Merge pull request 'for bug #78691' (#602) from fix/bug78691 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/602
2026-01-15 14:30:05 +00:00
402fe2c796 for bug #78691 2026-01-15 20:26:40 +06:00
e2aab8a241 Merge pull request 'Fix GetGIDByUnicode' (#599) from fix/pdf-text into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/599
2026-01-15 12:06:34 +00:00
555a251211 Fix GetGIDByUnicode 2026-01-15 15:04:42 +03:00
4a605d2424 Remove charspace fix 2026-01-15 13:33:47 +03:00
e49c4bc7fe Fix calcucaltion bug 2026-01-15 13:30:27 +03:00
f5a4e570bb Merge pull request 'Fix bug 78932' (#598) from fix/bug-78932 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/598
2026-01-15 10:30:23 +00:00
af5a87327b fix bug #76076 2026-01-15 16:28:35 +06:00
11c637deeb Fix bug 78932 2026-01-15 13:07:47 +03:00
b3a7e20b35 Merge pull request 'release/v9.3.0' (#597) from release/v9.3.0 into feature/docx-renderer
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/597
2026-01-15 09:13:16 +00:00
915576a819 [android] add libStarMathConverter 2026-01-15 11:35:33 +03:00
38a07b3c4d Merge pull request 'Fix Redact repeat XObject' (#596) from fix/pdf-bugs into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/596
2026-01-14 12:48:08 +00:00
ead20d7bfe Merge commit '2ff12c06a428232d1742d5f76970e8e87d83dc4f' into develop 2026-01-14 15:39:56 +03:00
90dc792fae Update ContText.cpp 2026-01-14 10:22:51 +03:00
0561ed2182 Fix Redact repeat forms 2026-01-13 17:47:04 +03:00
116ec89cd2 add ivaxis conversion 2026-01-13 19:20:37 +06:00
f44de11437 fix bug #79291 2026-01-13 15:15:37 +06:00
f5395b8b5f Add support swift files (TODO: calculate sdk/arch) 2026-01-12 23:00:01 +03:00
614222ee44 Fix bug #79297 2026-01-12 22:05:31 +03:00
1b5d71a14c Fix Redact repeat images 2026-01-12 17:27:27 +03:00
2ff12c06a4 Merge pull request 'fix bug #79272' (#594) from fix/bug79272 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/594
2026-01-12 11:45:21 +00:00
a3b6295058 fix bug #79272 2026-01-12 15:57:19 +06:00
efd9e3a29e Merge pull request 'Fix type of pdf print' (#593) from fix/pdf-print into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/593
2025-12-30 12:49:20 +00:00
0fa13f3659 Fix type of pdf print 2025-12-30 15:08:18 +03:00
8133e3f7b7 add axisParent conversion 2025-12-30 16:07:33 +06:00
7eabfd0838 Merge pull request 'fix/bug76636' (#592) from fix/bug76636 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/592
2025-12-29 18:45:28 +00:00
3081d02c9c Add ser2crt conversion 2025-12-29 19:24:13 +06:00
fd2710e46e For bug 59181 2025-12-29 14:57:48 +03:00
bc076fb5b6 fix/bug76636
fix bug #76636
2025-12-29 14:09:56 +03:00
33fa3fa38b Merge pull request 'Feature pdf print' (#590) from feature/pdf-print into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/590
2025-12-29 11:03:41 +00:00
9bc03ffdef Fix pdf PrintPages 2025-12-29 13:56:42 +03:00
91afd3d340 Merge branch 'develop' into feature/add-xls-writing 2025-12-29 15:28:05 +06:00
6018add7a5 Merge remote-tracking branch 'origin/release/v9.3.0' into feature/pdf-print 2025-12-29 11:23:19 +03:00
b616ce6fd7 Merge branch 'release/v9.3.0' into develop 2025-12-28 14:35:30 +03:00
570482b60d fix build 2025-12-28 14:32:22 +03:00
201cae0e6f pdf PrintPages 2025-12-26 23:08:41 +03:00
1cca5e3c12 Merge branch hotfix/v9.2.1 into release/v9.3.0 2025-12-26 16:24:55 +00:00
048eebc613 Merge branch hotfix/v9.2.1 into develop 2025-12-26 16:24:54 +00:00
7d06219664 Merge branch hotfix/v9.2.1 into master 2025-12-26 16:24:51 +00:00
760b4f9079 Merge pull request 'fix bug #79244' (#588) from fix/bug79244 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/588
2025-12-26 14:17:27 +00:00
578118380e add series style conversion 2025-12-26 19:53:11 +06:00
59f376908c Merge branch 'develop' into feature/add-xls-writing 2025-12-26 18:35:06 +06:00
38ceb61e4a Merge pull request 'Fix paths in pro file for starmath lib' (#589) from fix/build-starmath into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/589
2025-12-26 11:42:54 +00:00
b3a76d5678 Fix paths in pro file 2025-12-26 14:43:03 +04:00
c2d1bf113b fix bug #79244 2025-12-26 15:18:32 +06:00
bde1115962 Merge remote-tracking branch 'origin/release/v9.3.0' into feature/pdf-print 2025-12-26 10:19:42 +03:00
d8dc82ea35 Strip binaries on macos 2025-12-26 01:18:06 +03:00
0ef0518f1a Remove old linker flag on macos 2025-12-25 23:11:46 +03:00
f2da15defa Fix previous commit 2025-12-25 23:01:52 +03:00
e3272a5e91 Add strip binaries 2025-12-25 21:50:17 +03:00
d29dae37cb Merge pull request '[mac] Fix path to binary in docbuilder.py' (#587) from fix/py-mac-docbuilder into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/587
2025-12-25 18:31:07 +00:00
d82c96dc0f Fix path to binary in docbuilder.py on mac 2025-12-25 22:18:09 +04:00
69948ba383 . 2025-12-25 16:36:20 +03:00
d04f9cb8cf Merge pull request 'feature/EQN2OOXml2' (#419) from feature/EQN2OOXml2 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/419
2025-12-25 12:50:58 +00:00
5d6caf8a93 Add BRAI records conversion 2025-12-25 18:10:16 +06:00
f6ede7a53f Merge pull request 'Feature pdf new renderer command' (#586) from feature/pdf-new-command into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/586
2025-12-25 11:37:22 +00:00
3839ab4c15 Brush offset, brush scale, tile flip 2025-12-25 14:26:35 +03:00
e936b0e4e7 Merge branch hotfix/v9.2.1 into master 2025-12-25 10:57:58 +00:00
6283a68841 add seriesFormat conversion 2025-12-25 16:06:52 +06:00
75477e8c03 fix text direction 2025-12-25 12:30:33 +03:00
527cc5f89f Merge branch 'release/v9.3.0' into develop 2025-12-25 11:53:08 +03:00
f4cb421b49 refactoring 2025-12-25 11:51:44 +03:00
83d8a073a7 Merge remote-tracking branch 'origin/release/v9.3.0' into fix/fix-bugs 2025-12-25 09:12:16 +03:00
55ba36f4d2 Merge pull request 'Add logs during snapshot creation' (#585) from feature/v8-snapshots-android into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/585
2025-12-24 18:58:57 +00:00
f760d03281 Remove LOGD in platform-common code 2025-12-24 22:57:52 +04:00
50ae7db2f0 add area format conversion 2025-12-24 17:38:27 +06:00
0e02919540 Merge pull request 'release/v9.3.0' (#584) from release/v9.3.0 into feature/EQN2OOXml2
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/584
2025-12-24 10:59:04 +00:00
1237991ffb Fix typo 2025-12-24 13:11:47 +03:00
5e5293b77b Merge remote-tracking branch 'origin/release/v9.3.0' into fix/fix-bugs 2025-12-24 12:35:09 +03:00
8250b59558 Test ConvertToRasterBase64 2025-12-24 11:10:19 +03:00
646c29166e Merge remote-tracking branch 'origin/feature/texture-fill' into release/v9.3.0 2025-12-23 19:34:09 +03:00
a2fc927b39 Resolve merge conflict 2025-12-23 17:58:22 +03:00
b6f024b73f Refactoring 2025-12-23 16:43:29 +03:00
3aca7bec15 Merge pull request 'For bug 79199' (#582) from fix/bug-79199 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/582
2025-12-23 13:40:02 +00:00
078ec02efd For bug 79199 2025-12-23 16:23:42 +03:00
dd17cb7243 add frame conversion 2025-12-23 19:16:45 +06:00
deff23eaac Merge pull request 'Fix bugs' (#581) from fix/svg into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/581
2025-12-22 12:58:25 +00:00
b3988b002f add chartformats conversion 2025-12-22 18:51:32 +06:00
db2a9e88a1 Merge pull request 'Fix bug 79153' (#580) from fix/bug-79153 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/580
2025-12-22 10:11:01 +00:00
a8fe05fb6a Fix bug 79153 2025-12-22 12:15:15 +03:00
bb3091b6f1 Merge branch 'develop' into feature/add-xls-writing 2025-12-22 13:26:37 +06:00
d908cb668e Refactoring sysroots 2025-12-22 05:55:07 +03:00
d595d3ea86 Refactoring sysroots 2025-12-20 23:42:01 +03:00
dde96288ed for bug #54521 2025-12-19 16:21:52 +06:00
41d79b0df6 Merge pull request 'Fix bug 79082' (#578) from fix/bug-79082 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/578
2025-12-19 10:11:19 +00:00
2330f1dae8 Fix unicode=code when isCIDFont 2025-12-19 13:02:53 +03:00
8f108582b9 Fix bug 79082 2025-12-19 12:42:44 +03:00
6c6d575908 Merge pull request 'Fix bug 79141' (#577) from fix/bug-79141 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/577
2025-12-19 07:41:26 +00:00
14dd41a2a2 Fix bug 79141 2025-12-19 10:24:42 +03:00
b000343b86 For bug 59181 2025-12-18 17:59:59 +03:00
c7e1250287 Merge pull request 'fix text paragraph conversion' (#508) from fix/TextStyle into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/508
2025-12-18 14:53:16 +00:00
dc6ca55b57 For bug 79141 2025-12-18 16:07:37 +03:00
707aab41f3 refactoring 2025-12-18 14:42:44 +03:00
fba3767e36 Merge pull request 'add tsv conversion support' (#576) from feature/add-tsv-conversion into release/v9.3.0
fix bug #47231
2025-12-18 09:42:13 +00:00
7b8eae26c1 add tsv conversion support 2025-12-18 14:51:55 +06:00
c445c0444d Merge pull request 'fix linux build' (#575) from fix/linux-build into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/575
2025-12-18 08:09:58 +00:00
94edfff846 fix linux build 2025-12-18 14:02:42 +06:00
482810712e Merge branch hotfix/v9.2.1 into develop 2025-12-17 15:27:40 +00:00
43ba8fca21 fix bug #71085 2025-12-17 17:30:51 +03:00
f38759d071 Refactoring 2025-12-17 17:29:48 +03:00
52e47745de Added the latex formula processing flag in md 2025-12-17 14:49:11 +03:00
554d3d0dfd Fix bug in html 2025-12-17 14:48:15 +03:00
c9100737e0 fix prev 2025-12-17 14:38:52 +03:00
a22f0bfb60 Merge branch hotfix/v9.2.1 into master 2025-12-17 11:33:19 +00:00
d21b44a0b8 Merge pull request 'Fix libfont' (#574) from fix/libfont into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/574
2025-12-17 11:23:53 +00:00
0da5ad2f48 Fix libfont 2025-12-17 14:19:57 +03:00
8611c5f781 Fix build 2025-12-17 12:39:12 +03:00
ea338db68a add chart drawing conversion 2025-12-17 14:17:37 +06:00
5089a76b43 Merge pull request 'Feature docx-renderer' (#573) from feature/docx-renderer into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/573
2025-12-17 08:14:05 +00:00
a8678c5d10 Add _GetGIDByUnicode 2025-12-17 11:10:22 +03:00
ac5c7d6d76 refactoring 2025-12-16 17:09:33 +03:00
080ae0d924 Merge remote-tracking branch 'origin/hotfix/v9.2.1' into release/v9.3.0 2025-12-16 16:10:00 +03:00
77c9bd8c6d Merge pull request 'fix rotWithShape' (#572) from fix/fix-bugs into hotfix/v9.2.1 2025-12-16 13:09:35 +00:00
8144f98bb8 fix rotWithShape 2025-12-16 16:08:23 +03:00
aec1220bff Create GetGIDByUnicode 2025-12-16 15:41:14 +03:00
76f3afc6c0 Merge branch 'develop' into feature/add-xls-writing 2025-12-16 16:16:04 +06:00
3e78043cdd Merge pull request 'fix xls conversion' (#571) from fix/xls-conversion into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/571
2025-12-16 07:37:49 +00:00
0319918827 fix xls conversion 2025-12-16 13:33:30 +06:00
80d8f4b12e Merge remote-tracking branch 'origin/hotfix/v9.2.1' into release/v9.3.0 2025-12-16 10:29:05 +03:00
c52cfd0886 Merge pull request 'fix bug #78986' (#570) from fix/bug78986 into hotfix/v9.2.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/570
2025-12-15 18:09:15 +00:00
4c9a24bf71 fix bug #78986 2025-12-15 21:07:19 +03:00
9ece4889a1 Add ordering for any object 2025-12-15 13:28:16 +03:00
00c24f9d68 Add fix with two lines in paragraph 2025-12-15 12:10:43 +03:00
0223b1beab Fix missprint 2025-12-12 16:20:42 +03:00
5c15b76598 Merge branch 'release/v9.3.0' of https://git.onlyoffice.com/ONLYOFFICE/core into release/v9.3.0 2025-12-12 14:57:04 +03:00
72315df901 Merge pull request 'Fix bug 78919' (#569) from fix/bug-78919 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/569
2025-12-12 11:19:15 +00:00
cb0e361490 Fix bug 78919 2025-12-12 14:08:52 +03:00
db279bd725 Merge branch 'release/v9.3.0' of https://git.onlyoffice.com/ONLYOFFICE/core into release/v9.3.0 2025-12-12 12:21:50 +03:00
40c4c922c1 Merge pull request 'fix xls record size check' (#568) from fix/record-size-check into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/568
2025-12-12 09:18:33 +00:00
67f287f30f fix xls record size check 2025-12-12 14:58:43 +06:00
964a44ed93 . 2025-12-11 19:51:50 +03:00
57984ca8a2 Merge branch 'hotfix/v9.2.1' into release/v9.3.0 2025-12-11 17:05:36 +03:00
a30f7dfdf4 Merge pull request 'Fix bug 65734' (#567) from fix/bug65734 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/567
2025-12-11 14:04:21 +00:00
b369c32e9e fix value array xlsx 2025-12-11 17:03:42 +03:00
40a4fa1a92 Fix bug 65734 2025-12-11 17:02:56 +03:00
3870d23511 Realize AddPath in IRenderer 2025-12-11 15:58:40 +03:00
9c12c0b30a Merge remote-tracking branch 'origin/release/v9.3.0' into develop 2025-12-11 11:20:42 +03:00
2779542061 Merge branch 'hotfix/v9.2.1' into release/v9.3.0 2025-12-11 11:20:23 +03:00
e232fc779d Merge remote-tracking branch 'origin/hotfix/v9.2.1' into develop 2025-12-11 11:19:31 +03:00
3209c8e42e Merge pull request 'fix/fix-bugs-9.2.1' (#566) from fix/fix-bugs-9.2.1 into hotfix/v9.2.1
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/566
2025-12-11 08:16:12 +00:00
037057ea7a fix bug #78960
(cherry picked from commit bebb39a619)
2025-12-11 11:13:01 +03:00
d373a8cc4c fix bug #78953
(cherry picked from commit 84847f1e74)
2025-12-11 11:09:34 +03:00
13e2efe724 fix bug #78955
(cherry picked from commit 6ea64599bd)
2025-12-11 11:08:56 +03:00
b09d441987 fix bug #78958
(cherry picked from commit e15391ea35)
2025-12-11 11:06:44 +03:00
9e835d5cc1 Merge pull request 'For bug 79029' (#565) from fix/bug-79029 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/565
2025-12-11 07:24:25 +00:00
f75df05824 Fix SetDV for radiobutton 2025-12-11 10:14:13 +03:00
0d6d273573 Fix bug #74628 2025-12-10 19:07:26 +03:00
d7a1642a62 Merge pull request 'Fix bug 79005' (#564) from fixbugs/rtf into release/v9.3.0 2025-12-10 15:12:28 +00:00
d74899a116 Fix bug 79005 2025-12-10 18:08:20 +03:00
981df3fce7 add chart sheet conversion 2025-12-10 20:43:38 +06:00
d0dfd6737c [x2t] Add m_sSigningKeyStorePath to params.xml and SIGNING_KEYSTORE_PASSPHRASE to env for pdf 2025-12-10 16:50:43 +03:00
05d7d88481 Add logs during snapshot creation 2025-12-10 17:17:51 +04:00
cec10b7058 Fix problem with shape top and height 2025-12-10 15:58:50 +03:00
c3b3a1b5ef Fix SetDV for radiobutton 2025-12-10 15:23:40 +03:00
47258d9c30 Fix typo 2025-12-10 15:23:29 +03:00
10ab7009a1 Refactoring 2025-12-10 15:23:22 +03:00
3623b0970b Merge pull request 'Fix bug 78932' (#563) from fix/bug-78932 into release/v9.3.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/563
2025-12-10 11:38:48 +00:00
7ecab52601 Add Ascent/Descent bot and top in shape form 2025-12-10 12:54:01 +03:00
9fedabc0e2 Fix write Opt radiobutton at child 2025-12-10 12:46:52 +03:00
85d98daedd Merge branch 'develop' into feature/add-xls-writing 2025-12-10 15:43:25 +06:00
fa46455e74 Fix Opt radiobutton at child 2025-12-10 12:19:26 +03:00
0c87e66785 Fix Parent page 2025-12-10 12:17:52 +03:00
9dacd4a548 Merge pull request 'fix bug #54521' (#562) from fix/bug54521 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/562
2025-12-10 09:17:46 +00:00
e815f39905 Fix bug 2025-12-10 12:04:57 +03:00
fb8a72cd6b fix bug #54521 2025-12-10 15:01:52 +06:00
ad6113cf21 Fix bugs 2025-12-10 11:50:57 +03:00
11914f8dc2 Fix non-collecting meta-info 2025-12-10 11:30:22 +03:00
50b2656c44 Change comment 2025-12-10 11:12:29 +03:00
39235f7fd6 Add ignoring meta-info in covertion and add bFontSubstitution 2025-12-10 11:10:22 +03:00
d2527e5707 Fix stretch not rotate 2025-12-09 19:46:05 +03:00
3484834b9d Test PrintPdf 2025-12-09 18:45:41 +03:00
81b4ba3493 Rollback 2025-12-09 16:28:15 +03:00
44e217cf7c Move AddPath to IRenderer 2025-12-09 15:53:54 +03:00
61311457be Merge pull request 'fix bug #78958' (#561) from fix/bug78958 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/561
2025-12-09 12:33:45 +00:00
e15391ea35 fix bug #78958 2025-12-09 16:43:05 +06:00
fefeb483e5 Fix bug 78932 2025-12-09 12:56:53 +03:00
e31e02d993 Font substitution info 2025-12-09 10:42:13 +03:00
5c7ef5a6eb add rdValueData 2025-12-08 23:42:44 +03:00
bcdcfa8bf7 fix bug #74265 2025-12-08 16:36:25 +03:00
fc110a004d Merge remote-tracking branch 'origin/feature/pdf-link' into develop 2025-12-08 11:33:57 +03:00
12d33fad53 Merge remote-tracking branch 'origin/develop' into feature/pdf-link 2025-12-08 11:31:42 +03:00
2534d2b5c9 Fix swap rectangle 2025-12-08 11:20:59 +03:00
7019b192bd Merge pull request 'fix bug #78955' (#558) from fix/bug78955 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/558
2025-12-05 14:30:49 +00:00
ac97a5680b Merge pull request 'fix bug #78960' (#559) from fix/bug78960 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/559
2025-12-05 14:24:41 +00:00
bebb39a619 fix bug #78960 2025-12-05 20:10:56 +06:00
1ee8baa672 Develop PrintPages 2025-12-05 17:06:26 +03:00
d014383a6d Merge pull request 'fix/bug59965' (#557) from fix/bug45616 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/557
2025-12-05 13:45:12 +00:00
6422ce7f78 Fix bugs in html 2025-12-05 15:55:23 +03:00
31f7136f70 Fix bug #78915 2025-12-05 14:05:19 +03:00
f2023f626b fix/bug59965
fix bug #59965
2025-12-05 13:57:34 +03:00
6ea64599bd fix bug #78955 2025-12-05 16:09:45 +06:00
d1d94f481d . 2025-12-04 18:49:57 +03:00
82eb921f05 Merge pull request 'fix bug #78953' (#556) from fix/bug78953 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/556
2025-12-04 15:22:13 +00:00
84847f1e74 fix bug #78953 2025-12-04 21:19:39 +06:00
3730827cd8 Create PrintPages 2025-12-04 17:51:23 +03:00
eab6d5530b Fix build 2025-12-04 11:43:56 +03:00
dd00be6dce add fontlist writing 2025-12-04 13:53:42 +06:00
8391667147 Merge pull request 'Fix bug #48033' (#554) from fix/rtf into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/554
2025-12-03 14:26:26 +00:00
b8748e40d5 Merge pull request 'release/v9.2.0' (#555) from release/v9.2.0 into feature/docx-renderer
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/555
2025-12-03 12:48:30 +00:00
39da47bc21 Fix bug #48033 2025-12-03 12:57:51 +03:00
3a201b8b28 Merge pull request 'fix bug #78778' (#553) from fix/bug78778 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/553
2025-12-02 14:04:25 +00:00
bbfbe4a149 Merge remote-tracking branch 'origin/fix/bug-78854' into develop 2025-12-02 16:28:20 +03:00
0c1c57ccb3 Fix bug 78854 2025-12-02 16:27:25 +03:00
fa532edad6 Deferred Link resolution 2025-12-02 15:10:49 +03:00
df82306306 Merge remote-tracking branch 'origin/develop' into feature/pdf-link 2025-12-02 12:59:10 +03:00
7a3464b985 Fix test 2025-12-02 12:56:54 +03:00
49924e23ac AcroForm at the beginning 2025-12-02 12:56:07 +03:00
b5f0b39258 Remove pure virtual functions 2025-12-02 11:22:12 +03:00
3f6a800dd8 Rollback 2025-12-02 02:06:17 +03:00
1c8ad7a5c4 Add docxmethods for test 2025-12-02 01:44:07 +03:00
8464d3aeb7 Add AddPath method for test 2025-12-02 01:41:15 +03:00
ed939ebd1d Add html methods for test 2025-12-02 01:37:30 +03:00
fe6c5614d4 Add pdf methods for test 2025-12-02 01:24:49 +03:00
1eaac39e48 . 2025-12-01 22:34:28 +03:00
7624e24027 Merge remote-tracking branch 'origin/master' into develop 2025-12-01 21:53:15 +03:00
44ffa4b72e For bug 78854 2025-12-01 19:59:30 +03:00
10bdf2703a Merge pull request 'fix/bug69510' (#552) from fix/bug69510 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/552
2025-12-01 16:09:59 +00:00
c488384dbc fix/bug69510
fix bug #69510
2025-12-01 18:57:08 +03:00
cd80bca553 Fix fill with context color in svg 2025-12-01 16:49:44 +03:00
6e49670513 Implemented support for the BaselineShift property in svg 2025-12-01 16:13:49 +03:00
b1b3e1fb7c Merge branch release/v9.2.0 into master 2025-12-01 07:25:12 +00:00
d78487e0f5 . 2025-11-29 12:25:03 +03:00
5069b68247 fix build 2025-11-28 20:46:03 +03:00
31433e20de Fix year detection on windows 2025-11-28 19:55:26 +03:00
86d0d2113e . 2025-11-28 17:30:28 +03:00
8f2b4e4153 Merge remote-tracking branch 'origin/feature/add-xls-writing' into develop 2025-11-28 15:03:05 +03:00
0be867c47d for bug #78766 2025-11-28 15:02:03 +03:00
78aae7e9d0 Merge pull request 'fix/bug76076' (#551) from fix/bug76076 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/551
2025-11-28 11:58:23 +00:00
10e63543dc Merge pull request 'fix bug #77811' (#550) from fix/bug77811 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/550
2025-11-28 11:57:22 +00:00
900cf01902 Merge pull request 'fix bug #78487' (#549) from fix/bug78487 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/549
2025-11-28 11:56:50 +00:00
f6a52876ce Fix bug 78801 2025-11-27 18:26:36 +03:00
45ad566eb1 Merge pull request 'Fix bug #75486' (#548) from fix/rtf into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/548
2025-11-27 15:09:08 +00:00
5bbea51848 Fix bug #75486 2025-11-27 18:07:12 +03:00
28a1828000 fix bug #78778 2025-11-27 17:43:59 +06:00
816430e0e2 Generate doctrenderer embed 2025-11-27 13:40:37 +03:00
29a29cc818 Fix bug 78786 2025-11-27 13:37:05 +03:00
bf66c1d9c0 fix bug #78766 2025-11-27 11:39:26 +03:00
2a3982a884 Merge pull request 'Fix bug #69318' (#546) from fix/rtf into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/546
2025-11-27 08:12:46 +00:00
9f94166f82 Fix bug 78773 2025-11-27 10:37:43 +03:00
f11beb659f Merge pull request 'Fix html bugs' (#547) from fix/html into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/547
2025-11-26 16:37:47 +00:00
9a9182a1e9 Fix bug #71375 2025-11-26 19:22:01 +03:00
c7cce459bc Fix bug #78770 2025-11-26 19:21:27 +03:00
b5fb8a34dc fix shared formulas conversion 2025-11-26 19:54:45 +06:00
11f0c937f4 Fix bug #69318 2025-11-26 16:28:07 +03:00
5e435d322f Merge branch 'develop' into feature/add-xls-writing 2025-11-26 17:03:08 +06:00
05660e8c31 Merge pull request 'Fix libVLC build for win_arm64' (#545) from fix/libvlc-winarm64 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/545
2025-11-26 10:05:40 +00:00
b9ff6ba943 Fix libVLC build for win_arm64 2025-11-26 01:59:44 -08:00
d603e4f5dd Merge pull request 'Fix bug 78733' (#544) from fix/bug-78733 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/544
2025-11-26 07:25:21 +00:00
207dd32a5d Fix bug 78733 2025-11-26 10:22:54 +03:00
f2d0d7ac4c Fix bug 74149 2025-11-25 23:08:21 +03:00
842d17f79e Merge pull request 'fix/bug37832' (#543) from fix/bug37832 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/543
2025-11-25 13:55:07 +00:00
d48a28fe1d Fix Redact merge image&form 2025-11-25 16:42:16 +03:00
2a22c5e1f3 fix/bug37832
fix bug #37832
2025-11-25 15:30:06 +03:00
629a35213e Merge remote-tracking branch 'origin/release/v9.2.0' into develop 2025-11-24 22:30:18 +03:00
7b995bb45f Merge pull request 'fix bug #78714' (#542) from fix/bug78714 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/542
2025-11-24 19:24:33 +00:00
08502f0b24 fix bug #78714 2025-11-25 00:50:38 +06:00
aeca319710 Merge pull request 'fix bug #78713' (#541) from fix/fix-bugs into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/541
2025-11-24 18:24:15 +00:00
7425d53eb3 fix bug #78713 2025-11-24 20:58:34 +03:00
a056b2e4a9 Merge pull request 'Fix direction determination' (#540) from fix/boolean-op into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/540
2025-11-24 14:46:42 +00:00
2dd35a7d81 Fix direction determination 2025-11-24 17:31:01 +03:00
080d89c8a0 Merge remote-tracking branch 'origin/fix/bug69510' into develop 2025-11-24 15:57:45 +03:00
1809f7f4c2 Merge remote-tracking branch 'origin/fix/pdf-redact' into develop 2025-11-24 15:16:17 +03:00
4bfd4f0a08 Fix Encrypt with Redact 2025-11-24 15:13:35 +03:00
3ef5651dfd fix/bug69510
fix bug #69510
2025-11-24 14:52:55 +03:00
8231809ef0 fix bug #78487 2025-11-24 16:42:46 +06:00
7f3d073d63 Fix hierarchy of heading levels 2025-11-24 13:12:55 +03:00
5f09e91944 . 2025-11-23 12:39:22 +03:00
f4359e0b7f no message 2025-11-22 17:25:10 +03:00
ca9cf4ee61 . 2025-11-21 16:58:09 +03:00
f52538f66a . 2025-11-21 15:52:56 +03:00
bd76b2add0 Merge pull request 'Fix bug 78624' (#539) from fix/bug-78624 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/539
2025-11-21 11:18:36 +00:00
0436e39722 Fix bug 78624 2025-11-21 13:52:20 +03:00
15359be125 fix bug #77811 2025-11-21 16:10:49 +06:00
07be806ae3 Merge pull request 'Fix bug 74748' (#536) from fix/bug-74748 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/536
2025-11-21 09:47:22 +00:00
fc2a12c6f2 Merge remote-tracking branch 'origin/fix/bug69510' into develop 2025-11-21 10:34:42 +03:00
42030372fe fix logging 2025-11-21 10:29:36 +03:00
bbf6c2d8e9 fix/bug69510
fix bug #69510
2025-11-20 23:42:25 +03:00
cb15cc18eb Merge pull request 'fix/bug69510' (#538) from fix/bug69510 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/538
2025-11-20 11:46:32 +00:00
389bf976a9 fix/bug69510
fix bug #69510
2025-11-20 14:41:10 +03:00
4d1b516cc9 Merge remote-tracking branch 'origin/feature/pdf-password' into develop 2025-11-20 13:28:08 +03:00
600a59c966 Fix Open with owner password 2025-11-20 13:11:37 +03:00
94f06bf997 Merge pull request 'fix bug #78614' (#537) from fix/bug78614 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/537
2025-11-20 10:09:25 +00:00
230316aefa fix bug #78614 2025-11-20 12:51:35 +03:00
66b2f3c828 Fix bug 78602 2025-11-20 12:48:09 +03:00
64e077da19 For bug 76845 2025-11-20 12:08:43 +03:00
499fe52b8c Merge remote-tracking branch 'origin/release/v9.2.0' into develop 2025-11-20 11:31:17 +03:00
6f9c376040 Create CheckPerm 2025-11-20 10:41:43 +03:00
f0b266793f Refactoring 2025-11-19 23:24:05 +03:00
490281dda0 Fix compare double 2025-11-19 23:14:28 +03:00
b98b808cda Delete unused methods 2025-11-19 22:40:25 +03:00
6c77718f17 Fix reset rotation 2025-11-19 22:30:47 +03:00
1e18352e77 Create CheckOwnerPassword 2025-11-19 18:23:23 +03:00
c3f4f32702 fix read alternative drawing 2025-11-19 18:17:33 +03:00
50c7e106fb Merge pull request 'Fix bug #78449' (#535) from fix/bug-78449 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/535
2025-11-19 15:16:23 +00:00
6b5ee390a2 Fix bug #78449 2025-11-19 18:08:55 +03:00
6df7a7e01e Merge pull request 'Fix bug #53908' (#534) from fix/rtf into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/534
2025-11-19 13:54:00 +00:00
6167f23a08 Fix bug #53908 2025-11-19 15:36:42 +03:00
7c544729bc Fix drawForm 2025-11-19 13:23:51 +03:00
74a2b3b06f Fix Not rotate 2025-11-18 22:41:23 +03:00
8f3e19a5db Fix offset 2025-11-18 22:06:42 +03:00
d60c102dbb fix xlst->xlsb conversion 2025-11-18 19:41:06 +06:00
9049e2e6a8 Merge pull request 'Fix bugs' (#533) from fix/metafile into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/533
2025-11-18 11:26:53 +00:00
67c6707072 Merge pull request 'Fix bug 76845' (#531) from fix/bug-76845 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/531
2025-11-18 08:10:19 +00:00
0c29a5d436 Fix bug 76845 2025-11-18 11:06:10 +03:00
d709598563 Fix SaveRGBAToStream 2025-11-18 10:32:38 +03:00
0019f589bc Fix scale tile texture 2025-11-18 10:12:59 +03:00
02d492ff90 Fix typo 2025-11-17 23:02:02 +03:00
a7026ccb8d Fix bug #77816 2025-11-17 23:01:50 +03:00
200c17ee40 Fix not rotate 2025-11-17 19:37:30 +03:00
4543bfa6cd Fix add path to renderer 2025-11-17 11:26:07 +03:00
16e78d87a4 Add logic for customRect 2025-11-17 10:14:35 +03:00
051597a78a Add new commands to CheckBuffer 2025-11-17 10:14:06 +03:00
7afad1fe49 fix bug #76076 2025-11-14 21:27:49 +06:00
aa53d6302f Fix RedactOutputDev::drawImageMask 2025-11-14 17:09:22 +03:00
13e03328af Renumbering tile flip 2025-11-14 16:58:09 +03:00
04ccd4fe27 Fix scale for tile 2025-11-14 16:56:43 +03:00
ae8fb19147 Merge pull request 'fix bug #78248' (#530) from fix/fix-bugs into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/530
2025-11-14 08:05:38 +00:00
12083905dc fix bug #78248 2025-11-14 10:46:48 +03:00
e653442b8c Merge pull request 'Fix bug #74743' (#529) from fix/bug-74743 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/529
2025-11-13 18:10:58 +00:00
511cfb6158 Fix bug #74743 2025-11-13 20:08:15 +03:00
7f665b96a5 Create Image for InlineImg 2025-11-13 18:00:15 +03:00
6b80b39d4d Merge pull request 'fix bug #78278' (#525) from fix/bug78278 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/525
2025-11-13 14:32:04 +00:00
8926c15908 fix numFmt conversion 2025-11-13 19:49:14 +06:00
033c45b7a0 . 2025-11-13 16:40:30 +03:00
cbf138b1eb Merge pull request 'fix/fix-bugs' (#528) from fix/fix-bugs into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/528
2025-11-13 12:43:13 +00:00
897f8fa9f2 Merge pull request 'fix/sysroot' (#527) from fix/sysroot into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/527
2025-11-13 12:19:14 +00:00
8feb44225d Fix bug 2025-11-13 14:52:11 +03:00
517e337049 Fix building with newer qmake 2025-11-13 14:31:35 +03:00
c05231cf58 Merge pull request 'Fix bug in metafile conversion' (#526) from fix/metafile into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/526
2025-11-13 10:57:15 +00:00
66b1007ab4 fix bug #78278 2025-11-13 12:44:09 +03:00
16d75fe498 Merge branch 'develop' into feature/add-xls-writing 2025-11-13 15:02:17 +06:00
62413b8df5 Fix bug in metafile conversion 2025-11-13 03:03:25 +03:00
fe2e1568fa Merge pull request 'fix/bug51597' (#524) from fix/bug51597 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/524
2025-11-12 18:27:24 +00:00
f93c259977 . 2025-11-12 20:57:32 +03:00
7e057bab6e fix list fmla conversion 2025-11-12 19:31:42 +06:00
910ff6a6dd Merge pull request 'Fix bug 78223' (#523) from fix/bug-78223 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/523
2025-11-12 10:42:18 +00:00
22e5bcbde3 Fix bug 78223 2025-11-12 13:05:51 +03:00
4bf8308bff Merge branch 'develop' into feature/add-xls-writing 2025-11-12 14:16:45 +06:00
a77cbf903b fix bug #77941 2025-11-12 10:52:37 +03:00
9b4416952f Merge pull request 'fix bug #78156' (#521) from fix/bug78156 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/521
2025-11-12 07:10:09 +00:00
a320b5bd5a Fix build 2025-11-11 22:46:36 +03:00
34a1f117c9 Merge pull request 'For bug #74646' (#522) from fix/md into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/522
2025-11-11 16:16:23 +00:00
ec4700ac38 For bug #74646 2025-11-11 18:57:35 +03:00
6af3f2fe35 Do RedactOutputDev::drawImageMask 2025-11-11 17:05:02 +03:00
b61d8df484 fix ptgArea3d conversion 2025-11-11 16:25:20 +06:00
fc3748e516 for bug #40743 2025-11-11 11:26:46 +03:00
468dcd7ba4 Merge remote-tracking branch 'origin/release/v9.2.0' into develop 2025-11-11 10:21:53 +03:00
85047874b7 fix bug #78156 2025-11-11 10:03:48 +03:00
52bf1a6988 Merge pull request 'Fix bugs' (#517) from fix/bug-77446 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/517
2025-11-10 12:46:20 +00:00
27746f5c2b Merge pull request 'fix bug #76076' (#519) from fix/bug76076 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/519
2025-11-10 11:57:02 +00:00
d3710a755e Merge pull request 'Fix md bugs' (#518) from fix/md into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/518
2025-11-10 11:56:06 +00:00
5c8dcd7ed2 Merge pull request 'Fix bug 78035' (#520) from fix/pdf-bugs into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/520
2025-11-10 11:51:18 +00:00
5c0b3744ee Fix bug 78035 2025-11-10 13:53:51 +03:00
7048f132c6 Fix action GoTo FitR 2025-11-10 13:13:52 +03:00
1f3467d75f Fix serNum loading 2025-11-10 15:38:25 +06:00
238cdc8084 Merge branch 'develop' into feature/add-xls-writing 2025-11-10 15:08:26 +06:00
a1d8597b4f fix bug #76076 2025-11-10 15:02:27 +06:00
15dc718211 Fix bug #74969 2025-11-08 00:23:30 +03:00
1db12e66c6 For bug #74743 2025-11-08 00:07:43 +03:00
580283ef45 Merge remote-tracking branch 'origin/fix/rtf' into develop 2025-11-07 16:50:47 +03:00
5de19652f2 Fix bug #74726 2025-11-07 14:36:31 +03:00
fd648a7dd3 Merge remote-tracking branch 'origin/release/v9.2.0' into fix/pdf-redact
# Conflicts:
#	PdfFile/SrcReader/Adaptors.cpp
2025-11-07 14:03:51 +03:00
76b5bd594d Fix bug #77446 2025-11-07 13:22:07 +03:00
61b55c9230 Merge pull request 'Fix bugs in svg' (#516) from fix/bug-78017 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/516
2025-11-07 09:51:04 +00:00
22aecb56ec Fix bug in svg 2025-11-07 12:48:08 +03:00
4d4f3be717 Fix bug #77975 2025-11-07 11:32:31 +03:00
6e481f6a34 Merge pull request 'fix/bug51965' (#515) from fix/bug51965 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/515
2025-11-07 06:47:08 +00:00
2059e4bb95 fix/bug51965
fix bug #51965
2025-11-07 00:58:31 +03:00
3586a010a8 Fix bug #78017 2025-11-06 20:48:57 +03:00
146fc90746 Merge pull request 'Fix bug 78049' (#513) from fix/bug-78049 into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/513
2025-11-06 13:37:03 +00:00
4452d7bf3d Fix bug 78049 2025-11-06 16:18:42 +03:00
673678e80a Merge pull request 'Fix bug in svg' (#512) from fix/svg into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/512
2025-11-06 12:43:45 +00:00
b51960e925 fix bug #78023 2025-11-06 15:24:42 +03:00
6a5186c411 fix 2025-11-06 14:55:28 +03:00
b5ea9d68e2 fix defined names fmlas xls conversion 2025-11-06 16:24:04 +06:00
71e96930c9 Fix read Action 2025-11-06 12:08:23 +03:00
d9be0df8fb Fix data validations conversion 2025-11-06 15:00:38 +06:00
0477002e85 Fix bug in svg 2025-11-06 00:59:45 +03:00
68f1c6f97d for bug #78007 2025-11-05 18:05:49 +03:00
3cee4b0212 Merge pull request 'For bug 77757' (#511) from rtfbugs/fix into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/511
2025-11-05 12:22:52 +00:00
6f85ce7116 Merge pull request 'Fix bugs 77966, 77904' (#510) from fix/pdf-bugs into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/510
2025-11-05 11:20:13 +00:00
d920492afe Fix bug 77966 2025-11-05 14:03:25 +03:00
d69a54de38 Fix bug 77904 2025-11-05 14:03:02 +03:00
cfb62d599d For bug 77757 2025-11-05 13:55:43 +03:00
919d117a1f Fix ptgList conversion 2025-11-05 16:14:58 +06:00
d4b289d0ca Fix RedactOutputDev::drawSoftMaskedImage 2025-11-05 12:58:48 +03:00
cbb1df1522 Merge pull request 'Fix SVG' (#509) from fix/svg into release/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/509
2025-11-01 18:50:12 +00:00
3b0e98fc4a Fix typo 2025-11-01 18:16:43 +03:00
a29eb52e1a Fix build 2025-11-01 18:15:14 +03:00
270e8e41dd fix ptg list xls conversion 2025-11-01 19:44:50 +06:00
16eb1b51e7 fix bug #77963 2025-11-01 13:10:54 +03:00
751b82dc51 fix dxfs conversion 2025-11-01 13:09:43 +06:00
320e30c857 Do RedactOutputDev::drawSoftMaskedImage 2025-10-31 17:13:38 +03:00
e4c84e2972 fix text paragraph conversion 2025-10-31 16:50:04 +03:00
527ff672d9 Merge pull request 'Fix md/html bugs' (#507) from fix/md into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/507
2025-10-31 13:27:05 +00:00
aa24268a2e Fix bug #74743 2025-10-31 16:19:42 +03:00
39e4c3a09c Fix build 2025-10-31 15:03:44 +03:00
a6898c8235 Merge branch 'develop' into feature/add-xls-writing 2025-10-31 13:58:33 +06:00
8158ace0eb Fix bug #74969 2025-10-31 02:58:19 +03:00
463ca05404 Do RedactOutputDev::drawImage 2025-10-30 18:44:06 +03:00
f38ce7b61b change type in binary paraId 2025-10-30 18:37:46 +03:00
95a1b39fb1 Fix bugs 2025-10-30 18:15:47 +03:00
f58be7754a Fixed a bug calculating complex styles in CSS 2025-10-30 18:15:34 +03:00
a31c3ee00a Fix bug #74646 2025-10-30 16:41:07 +03:00
548cee436a Merge remote-tracking branch 'origin/hotfix/v9.2.0' into develop 2025-10-30 15:13:03 +03:00
b1a36d546b fix ptgName writing 2025-10-30 18:06:11 +06:00
23e9187f5a fix bug #77929 2025-10-30 14:40:52 +03:00
07d3f371a2 Merge pull request 'fix/bug77123' (#506) from fix/bug77123 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/506
2025-10-30 11:02:46 +00:00
278cac8a61 Merge branch 'fix/bug77123' into fix/bug51965 2025-10-30 13:56:13 +03:00
07fd1e87d7 Merge branch 'develop' into fix/bug51965 2025-10-30 13:55:14 +03:00
817ee4dde0 fix/bug77123
fix bug #77123
2025-10-30 13:50:56 +03:00
d93bd27896 Do RedactOutputDev::drawImage 2025-10-29 18:05:39 +03:00
0e991719bf fix bug #77664 2025-10-29 17:18:11 +03:00
be56209baf Fix empty cells conversion 2025-10-29 20:10:34 +06:00
6a573d0da7 Merge branch 'develop' into feature/add-xls-writing 2025-10-29 16:12:17 +06:00
ca2504edb6 Fix bug #74647 2025-10-28 18:49:06 +03:00
e936e330d9 Do RedactOutputDev::drawForm 2025-10-28 18:21:00 +03:00
07bedd847e Fix bug #77940 2025-10-28 18:13:02 +03:00
bda95fc03d Fix column styles conversion 2025-10-28 20:04:27 +06:00
c0c0289ffb Merge remote-tracking branch 'origin/Rtf/fixbugs' into develop 2025-10-28 15:57:46 +03:00
5c110799a6 . 2025-10-28 15:51:41 +03:00
1b6c81407b Merge branch 'develop' of https://git.onlyoffice.com/ONLYOFFICE/core into develop 2025-10-28 15:46:25 +03:00
1e0d662838 Fix previous 2025-10-28 15:35:46 +03:00
ae2680c419 fix defined names formula conversion 2025-10-28 18:18:57 +06:00
506a805654 Merge branch release/v9.1.0 into hotfix/v9.2.0 2025-10-28 11:58:13 +00:00
1b61353b2e Merge branch release/v9.1.0 into develop 2025-10-28 11:58:11 +00:00
7777048790 Merge branch release/v9.1.0 into master 2025-10-28 11:58:09 +00:00
fd6c0907bd Merge pull request 'fix/bug77123' (#504) from fix/bug77123 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/504
2025-10-28 11:33:11 +00:00
1bdff9e7fe For bug #74647 2025-10-28 14:15:00 +03:00
8fab1802df Added support for text fill transparency in svg 2025-10-28 14:13:12 +03:00
2aef5daf12 fix/bug77123 2025-10-28 14:06:05 +03:00
6cf6ade6e3 Fix bug 2025-10-28 13:11:40 +03:00
2399ba41e4 Fix miss place 2025-10-28 13:07:03 +03:00
fe2fb0c08d Add meta info 2025-10-28 13:04:00 +03:00
bfffcda0c5 Fix bug in SVG 2025-10-28 12:15:14 +03:00
e96ceab1e3 Fix bugs in svg gradient 2025-10-28 12:05:05 +03:00
317e21af6a Merge remote-tracking branch 'origin/hotfix/v9.2.0' into develop 2025-10-28 11:29:01 +03:00
5046c1b326 add labeledCheckBox 2025-10-28 11:27:56 +03:00
4bc78e7bb4 Fix bug 74748 2025-10-28 11:16:53 +03:00
4f6daaae67 fix/bug77123
fix correct receipt page parametrs
2025-10-28 10:51:52 +03:00
8203492999 Merge branch 'develop' into feature/add-xls-writing 2025-10-28 13:19:12 +06:00
6616a11e7c Merge pull request 'Fix bugs' (#501) from fix/bug-72300 into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/501
2025-10-27 16:43:58 +00:00
45e97b76f0 Merge branch 'hotfix/v9.2.0' into fix/bug-72300 2025-10-27 19:37:13 +03:00
d3017c2777 Merge pull request 'Fix MD bugs' (#500) from fix/md into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/500
2025-10-27 16:24:39 +00:00
910f453ce8 Do RedactOutputDev::drawForm 2025-10-27 19:17:36 +03:00
54fb5a7891 remove smart_ptr for IFileConteiner (rels) 2025-10-27 18:54:00 +03:00
93b96e5555 fix bug #77324 2025-10-27 18:53:09 +03:00
41c4032fe8 Fix build 2025-10-27 17:54:56 +03:00
9e57f8c3b1 Improve txt 2025-10-27 17:47:58 +03:00
57221c0e32 fix/bug77123
fix bug when the tabs were longer than available width
2025-10-27 16:27:48 +03:00
76b7099a37 Fix merged cells conversion 2025-10-27 19:04:55 +06:00
85f428fda6 fix formula conversion 2025-10-27 16:49:25 +06:00
d97a62442f Improve txt file writer 2025-10-27 13:40:48 +03:00
41fb12d58b Merge branch 'develop' into feature/add-xls-writing 2025-10-27 13:36:21 +06:00
df49a4fbde Redesigned bounds calculation in svg and refactoring 2025-10-26 20:53:31 +03:00
3d586a4bb6 Added processing of hidden elements in html 2025-10-26 17:57:21 +03:00
6d76fd71cc Fixed a bug with CSS styles calculation 2025-10-26 17:56:50 +03:00
ed0811d8ab For bug #50842 2025-10-25 11:52:35 +03:00
84cc97f035 Merge remote-tracking branch 'origin/hotfix/v9.2.0' into develop 2025-10-25 11:41:47 +03:00
170cada6e6 Remove logs 2025-10-24 19:45:17 +03:00
984807d611 fix pivot cache id conversion 2025-10-24 19:23:02 +06:00
250c85c077 Add meta info in docx-renderer 2025-10-24 15:26:33 +03:00
dbd92bfdfa Fix Link Border 2025-10-24 15:01:51 +03:00
e4825294ed Merge pull request 'For bug 77199' (#499) from for/bug-77199 into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/499
2025-10-24 11:31:36 +00:00
17c336d57c Fix build 2025-10-24 14:24:02 +03:00
4e7af40367 For bug 77199 2025-10-24 14:23:45 +03:00
b7230d16fc Merge pull request 'fix/bugs' (#498) from fix/bugs into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/498
2025-10-24 11:12:01 +00:00
22a7e6bb05 fix bug #77587 2025-10-24 13:17:02 +03:00
a4ed2dea41 fix bug #77232 2025-10-24 13:14:22 +03:00
ab2eabdd23 Merge pull request 'Fix bug 77823' (#497) from fix/bug-77823 into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/497
2025-10-24 09:15:58 +00:00
2796fbed8b Optimization read drawSoftMaskedImage 2025-10-24 12:10:33 +03:00
ab052c7c59 . 2025-10-24 10:23:24 +03:00
2b209ed5e4 Fix bug #77443 2025-10-24 01:45:24 +03:00
04bce828be Fix bug #77442 2025-10-24 01:38:24 +03:00
4c5259494d Refactoring 2025-10-24 01:37:24 +03:00
289a77a978 . 2025-10-23 20:29:57 +03:00
a22cc4e410 add ext logging 2025-10-23 20:26:35 +03:00
9ccbb25acd Improve txt file writer 2025-10-23 17:48:08 +03:00
954d86ed0f fix sxdb conversion 2025-10-23 20:01:28 +06:00
091af38e0d fix bug #73635 2025-10-23 15:35:09 +03:00
4b335fc796 Add mirror for tile brush 2025-10-23 14:41:34 +03:00
5e177412e2 Add scale for brush rect 2025-10-23 14:37:48 +03:00
2b214ab07d Fix bug 77823 2025-10-23 13:13:15 +03:00
c8b34959d7 fix bug #77807 2025-10-23 12:07:31 +03:00
2bf44900de Fix bug #77441 2025-10-22 20:29:38 +03:00
c235a4c646 Fix bug #77440 2025-10-22 18:58:37 +03:00
3bdd0e2053 Merge pull request 'fix bug #77651' (#495) from fix/bug77651 into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/495
2025-10-22 13:23:04 +00:00
339820e5df Merge pull request 'fix bug #76076' (#496) from fix/bug76076 into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/496
2025-10-22 13:22:34 +00:00
1dd5eb3368 Write Link annots 2025-10-22 16:19:43 +03:00
47e0a0c9e7 Improve txt file reader 2025-10-22 12:37:03 +03:00
475cbb6f8a fix bug #77651 2025-10-22 14:57:57 +06:00
5a491aea3e Read Link annots 2025-10-21 17:04:30 +03:00
2d7c5ec2df fix defined names conversion 2025-10-21 19:03:16 +06:00
ee784a7189 Merge pull request 'Fix pdf bugs' (#494) from fix/pdf-bugs into hotfix/v9.2.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/494
2025-10-20 14:22:46 +00:00
650fb84b6d For bug 75161 2025-10-20 17:18:41 +03:00
dec13334db Add not rotation with shape 2025-10-20 16:57:13 +03:00
4a2d0b5e1f Fix reset font settings 2025-10-20 16:11:16 +03:00
54ce32cfaf Add file to ignore 2025-10-20 16:05:16 +03:00
38079e8692 comment unfinished functionality 2025-10-20 16:01:45 +06:00
ac75675367 optimized theme colors conversion 2025-10-20 15:41:44 +06:00
a0fc634f5f Merge branch 'develop' into feature/add-xls-writing 2025-10-20 14:03:42 +06:00
1d58d8fc7f Fix bug 77608 2025-10-20 10:15:25 +03:00
1624a2dda2 Fix bug 75990 2025-10-19 14:53:49 +03:00
b0a850745d Merge branch 'fix/fix-bugs' into hotfix/v9.2.0 2025-10-17 20:57:29 +03:00
2ebade4413 add theme colors conversion 2025-10-17 21:38:28 +06:00
a0a9d899a8 fix binary paraId 2025-10-17 17:56:14 +03:00
5e9f99e960 For bug #50842 2025-10-17 11:59:06 +03:00
a67935908a Merge remote-tracking branch 'origin/master' into develop 2025-10-16 18:57:38 +03:00
da1bc5d2d6 add theme colors registration 2025-10-16 20:33:32 +06:00
7156669830 Intermediate refactoring 2025-10-15 19:06:28 +03:00
9d5388a7bf fix pivotCache id conversion 2025-10-15 20:38:36 +06:00
3b85841ea6 fix bug #77472 2025-10-15 12:37:04 +03:00
4899ed4e7f fix bug #77562 2025-10-15 12:36:08 +03:00
f335a5b024 fix bug #73585 2025-10-15 12:35:03 +03:00
2cdb04656d Fix pivotfrt writing 2025-10-15 15:16:39 +06:00
6eeae2e804 Intermediate refactoring 2025-10-14 20:42:24 +03:00
3934c28eb8 Fix pivot table conversion 2025-10-14 21:17:58 +06:00
82e281cf6b Merge branch release/v9.1.0 into master 2025-10-14 14:36:21 +00:00
f6337bb12c add pivot table styles conversion 2025-10-14 18:30:59 +06:00
1d88830b38 fix/bug51597
fix bug when document convert from odt to docx and docx to odt and after this document cells width will smaller then before convertation.
2025-10-14 12:33:13 +03:00
b4395efa91 Merge pull request 'fix bug #77588' (#492) from fix/bug77588 into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/492
2025-10-13 15:33:25 +00:00
32f683137a fix bug #77588 2025-10-13 18:31:21 +03:00
9737038776 add addlStyles writing 2025-10-13 19:19:11 +06:00
915c3497e4 add pivotAddl writing 2025-10-13 16:26:19 +06:00
d59573c3b3 Merge pull request 'Fix bug 77556' (#491) from fix/pdf-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/491
2025-10-13 08:15:25 +00:00
abb884c714 Fix bug 77556 2025-10-13 09:18:24 +03:00
befeed6233 Merge pull request 'Fix goto and variable declaration' (#490) from fix/pdf-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/490
2025-10-12 17:24:31 +00:00
54e329915c Fix goto and variable declaration
cannot jump from this goto statement to its label
2025-10-12 20:20:01 +03:00
f27d78ef48 Merge pull request 'Fix bug 77560' (#489) from fix/bug-77560 into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/489
2025-10-12 17:04:22 +00:00
58ee2582d6 Fix 2025-10-12 19:59:53 +03:00
4c3af930a5 Merge pull request 'Fix bug 77560' (#488) from fix/bug-77560 into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/488
2025-10-12 16:58:05 +00:00
db86830824 Fix bug 77560
Related bug 76533
2025-10-12 19:51:35 +03:00
77496c6df7 Merge pull request 'Fix RedactOutputDev' (#487) from fix/pdf-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/487
2025-10-12 14:20:11 +00:00
dd73d05dd1 Fix 2025-10-12 17:18:58 +03:00
cabd994f5f Fix RedactOutputDev 2025-10-12 17:09:38 +03:00
2a3f90ab93 Merge pull request 'Fix pdf bugs' (#486) from fix/pdf-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/486
2025-10-11 13:25:18 +00:00
1849f7a69f Fix bug 76533 2025-10-11 16:08:32 +03:00
e898a9bb99 Fix bug 77224 2025-10-11 16:04:17 +03:00
bed0f29ac6 Fix bug 76445 2025-10-11 12:04:06 +03:00
320d000030 Fix default memory limit 2025-10-10 21:39:29 +03:00
1fb9ef4713 Fix bug 76926 2025-10-10 21:32:01 +03:00
264edeb9b6 Merge pull request 'fix/bug-76927' (#485) from fix/bug-76927 into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/485
2025-10-10 17:18:17 +00:00
4e48821faf Fix compare double 2025-10-10 17:36:14 +03:00
fd5d6f41dc Merge pull request 'Fix pdf bugs' (#483) from fix/pdf-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/483
2025-10-10 14:07:19 +00:00
29b9cf515a Fix Clear Content 2025-10-10 17:05:53 +03:00
53c4f320f6 add pivot frt writing 2025-10-10 19:33:23 +06:00
e126ceef3c Fix bug 77348 2025-10-10 15:09:22 +03:00
df22ad3855 Fix curve subtraction 2025-10-10 14:07:38 +03:00
9a17338be7 Fix condition 2025-10-10 13:49:24 +03:00
e344c4ca0d Fix bug 77371 2025-10-10 13:34:29 +03:00
1aec69965d add dateType pivot oper parsing 2025-10-10 15:15:22 +06:00
1212a78d58 Merge pull request 'Fix bug 77353' (#482) from fix/bug-77353 into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/482
2025-10-10 08:57:29 +00:00
869bbf6cc9 Fix bug 77353 2025-10-10 11:55:00 +03:00
afdac778b0 Merge branch 'develop' into feature/add-xls-writing 2025-10-10 13:34:45 +06:00
6de079a487 Fix bug 76927 2025-10-10 00:47:56 +03:00
78085554b5 Merge pull request 'Fix pdf bugs' (#481) from fix/pdf-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/481
2025-10-09 16:40:08 +00:00
7310eb49a9 For bug 77353 2025-10-09 19:34:28 +03:00
66d94cf00c Intermediate refactoring 2025-10-09 18:59:40 +03:00
d0f1691a5e Fix bug #72300 2025-10-09 17:36:17 +03:00
26b598784e Merge pull request 'Fix bug 77333' (#480) from fix/bug77333 into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/480
2025-10-09 14:27:31 +00:00
8795539c20 Fix bug 77333 2025-10-09 17:03:01 +03:00
0ccff9944d Merge branch 'release/v9.1.0' into fix/bug-72300 2025-10-09 16:50:28 +03:00
c6d1f5e502 For bug 77407 2025-10-09 16:49:46 +03:00
fbc42a514f Fix pivots conversion 2025-10-09 19:46:21 +06:00
5b5a1d461c For bug 77407 2025-10-09 15:15:26 +03:00
c567c9739c Merge remote-tracking branch 'origin/release/v9.1.0' into develop 2025-10-09 12:00:09 +03:00
992f6616e0 Fix intersection line and rectangles 2025-10-09 11:54:06 +03:00
686b719bff add pivot cache records conversion 2025-10-08 20:12:59 +06:00
c5a047f83a Merge pull request 'Fix pdf bugs' (#479) from pdf/fix-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/479
2025-10-08 13:47:12 +00:00
97560748aa Fix Redact in progress 2025-10-08 16:43:13 +03:00
6481c2d531 Fix prev commit 2025-10-08 15:49:46 +03:00
0f51381926 Add method gid => unicode 2025-10-08 15:49:30 +03:00
7e012dac94 C in OC for Redact annot 2025-10-08 15:43:29 +03:00
c4525f8ae1 Fix bug 77362 2025-10-08 14:07:47 +03:00
fc0d3abd6a Fix Redact coords 2025-10-08 13:36:45 +03:00
cebd668fe9 Fix coords order 2025-10-08 11:46:53 +03:00
2f965fd578 Fix bug 77405
For bug 77404
2025-10-08 11:08:46 +03:00
115c51cd7c Merge pull request 'fix/pict-bugs' (#478) from fix/pict-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/478
2025-10-07 18:26:14 +00:00
a123af1066 Fix bug 77400 2025-10-07 21:20:03 +03:00
e640331750 Fix bug 77403 2025-10-07 21:19:55 +03:00
a42310d2c5 Fix bug 77398 2025-10-07 21:19:08 +03:00
24e7c822ff Fix bug 77395 2025-10-07 21:18:56 +03:00
9c2c9509db Fix bug 77333 2025-10-07 21:11:13 +03:00
a3d947d855 Redact 8xN 2025-10-07 18:37:32 +03:00
9900726e43 Fix AP 2025-10-07 18:35:56 +03:00
f05fa7c0ee add pivotCache source conversion 2025-10-07 20:59:28 +06:00
9a46a6b514 Fix proxy 2025-10-07 15:59:01 +03:00
497c64e713 Fix Annot without Type, only Subtype 2025-10-07 15:55:02 +03:00
104a6ee3ae Merge pull request 'Fix bug 77312' (#477) from fix/bug-77312 into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/477
2025-10-07 12:16:58 +00:00
ed99de9976 Fix bug 77312 2025-10-07 15:12:00 +03:00
ada62871eb Fix bug 76350 2025-10-07 14:33:49 +03:00
0d646a32c4 add workbook pivotCache conversion 2025-10-07 17:09:10 +06:00
80a2cfc0fe Fix bug 76352 2025-10-07 12:44:40 +03:00
8c91eea87a Fix copy proxy object 2025-10-07 12:44:13 +03:00
7a2c32cb47 Merge pull request 'fx bug #74266' (#476) from fix/fix-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/476
2025-10-07 07:59:04 +00:00
503e462366 fx bug #74266 2025-10-07 10:56:33 +03:00
917c33e76d Fix pivot cache conversion 2025-10-06 21:08:26 +06:00
1301da284c Merge pull request 'Fix bugs 77268, 77299' (#475) from fix/pdf-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/475
2025-10-06 14:05:57 +00:00
4d9a4ed300 Fix bug 77268 2025-10-06 16:37:37 +03:00
1937895a56 add sqlTypes conversion 2025-10-06 18:14:34 +06:00
01fbf07c9e add pivot field properties conversion 2025-10-06 16:56:13 +06:00
173a29419a Fix bug 77299 2025-10-06 13:26:13 +03:00
526e53e465 Fix test Split&Merge 2025-10-06 13:02:07 +03:00
d208215814 Merge branch 'develop' into feature/add-xls-writing 2025-10-06 13:15:13 +06:00
605e5e2c9d Fix crash on open pdf 2025-10-05 21:34:06 +03:00
c45c63f914 Merge pull request 'release/v9.1.0' (#474) from release/v9.1.0 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/474
2025-10-04 19:25:57 +00:00
59bd457253 Merge pull request 'fix/pdf-redact' (#473) from fix/pdf-redact into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/473
2025-10-03 20:21:14 +00:00
4db7b36303 Fix bug 77215 2025-10-03 23:14:23 +03:00
23cc9ec824 Merge pull request 'Fix pdf bugs' (#472) from fix/pdf-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/472
2025-10-03 15:12:57 +00:00
63d74183a1 Fix intersect XObject 2025-10-03 18:06:49 +03:00
542837dd3a For bug 76974 2025-10-03 16:42:31 +03:00
7a4dfdbbe4 For bug 77238 2025-10-03 13:39:40 +03:00
a220822b7b fix bug #76076 2025-10-03 16:06:46 +06:00
a9a391c960 Fix create AP for Line 2025-10-03 12:04:27 +03:00
7a8f926852 Fix bug 76352 2025-10-03 10:59:02 +03:00
3bd50dbece Fix trace path 2025-10-02 19:14:46 +03:00
a306faf286 Merge pull request 'fix bug #77171' (#470) from fix/fix-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/470
2025-10-02 15:41:54 +00:00
63d6430502 fix bug #77171 2025-10-02 18:35:51 +03:00
21a637594a For bug #72300 2025-10-02 18:20:12 +03:00
5c5a18de0d add pivotCache properties conversion 2025-10-02 20:04:29 +06:00
add2a66da9 Merge pull request 'Fix pdf bugs' (#469) from fix/pdf-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/469
2025-10-02 13:34:36 +00:00
2213f6415d Merge remote-tracking branch 'origin/release/v9.1.0' into fix/pdf-bugs 2025-10-02 15:31:12 +03:00
e26f220a40 Fix bug 76737 2025-10-02 15:25:42 +03:00
9f24bda011 add pivotCache files conversion 2025-10-02 18:13:24 +06:00
0e68a83f0d Fix Redact with shapes 2025-10-02 15:11:42 +03:00
10d05760dd Merge pull request 'fix/bug65069' (#467) from fix/bug65096 into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/467
2025-10-02 11:33:53 +00:00
db5f239cb1 fix/bug65069
fix bug when we activate "Keep with next" parametr and after conversation from docx to odt it lose
2025-10-02 14:28:23 +03:00
8cc18975b7 Fix build 2025-10-02 14:11:32 +03:00
2bc14634bb Fix bug 77022 2025-10-02 14:10:30 +03:00
408d677640 Merge pull request 'Fix bug #77184' (#461) from fix/bug-77184 into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/461
2025-10-02 10:40:55 +00:00
dc904a1f13 Fix build 2025-10-02 12:55:32 +03:00
fdb9eaa2a5 Add pivotCache stream writing 2025-10-02 15:41:11 +06:00
3e9b0ffbda add default params for SXEx 2025-10-02 14:30:16 +06:00
e28aea4734 Merge pull request 'fix/sysroot' (#462) from fix/sysroot into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/462
2025-10-02 05:44:53 +00:00
28584e7df1 Fix build 2025-10-02 08:39:13 +03:00
7a6e00a792 Fix bug #77184 2025-10-02 00:53:49 +03:00
e7d913e1d2 Merge remote-tracking branch 'origin/fix/pict' into release/v9.1.0 2025-10-01 22:59:02 +03:00
3e2223ae6d Merge pull request 'Add selfInters' (#460) from fix/boolean-op into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/460
2025-10-01 18:02:20 +00:00
d3793169aa Add CFLAGS for sysroot 2025-10-01 20:20:28 +03:00
6dccf05e92 Add selfInters 2025-10-01 18:39:27 +03:00
eb2ba042ef add pivotEx default writing 2025-10-01 21:22:55 +06:00
1111f421d9 Fix sxli conversion 2025-10-01 19:24:36 +06:00
28c2e748a3 Merge pull request 'Fix save Redact' (#459) from fix/pdf-bugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/459
2025-10-01 11:39:27 +00:00
e2bda52737 fix sxvd conversion 2025-10-01 17:38:08 +06:00
ad496ca7cd Fix save Redact 2025-10-01 14:30:46 +03:00
8ee1c33532 Merge pull request 'Fix bug #55424' (#458) from Rtf/Fixbugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/458
2025-10-01 11:15:58 +00:00
6c9c2cf538 fix pivot view header conversion 2025-10-01 17:13:56 +06:00
303c395c84 Fix bug #55424 2025-10-01 13:38:50 +03:00
62d826d8c6 Merge branch 'develop' into feature/add-xls-writing 2025-10-01 14:05:17 +06:00
964a3b455b Merge pull request 'Fix build' (#457) from fix/pdf-redact into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/457
2025-10-01 08:01:51 +00:00
96ba4495ed Fix build 2025-10-01 10:59:56 +03:00
ec246526ac Merge pull request 'Feature pdf redact' (#456) from feature/pdf-redact-fix into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/456
2025-09-30 16:07:38 +00:00
5cf633ede6 Fix text color 2025-09-30 18:41:22 +03:00
a8d34f2437 Merge remote-tracking branch 'origin/release/v9.1.0' into feature/pdf-redact-fix 2025-09-30 12:36:03 +03:00
c3d2761c10 Fix setFillColorN 2025-09-30 12:22:51 +03:00
dfbdb869d7 add row&column items conversion 2025-09-30 15:04:03 +06:00
98d10c0c33 Merge pull request 'Add pdf/pptx -> txt convertion in x2ttester' (#455) from feature/x2ttester into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/455
2025-09-30 05:42:25 +00:00
2f6b41d06a Add pdf/pptx -> txt convertion in x2ttester 2025-09-30 08:24:20 +03:00
ed7a50855e Merge remote-tracking branch 'origin/release/v9.1.0' into develop 2025-09-29 21:58:01 +03:00
87e4738481 Merge pull request 'Fix bug #76691' (#453) from Rtf/Fixbugs into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/453
2025-09-29 15:17:17 +00:00
c622fa54fc Redact writer 2025-09-29 17:32:33 +03:00
c45b9fa0df Merge pull request 'Added support HWPML format' (#454) from feature/HWPML into release/v9.1.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/454
2025-09-29 14:22:46 +00:00
fe877b128b Fix bug in HWP conversion 2025-09-29 17:21:53 +03:00
aa4b0c8844 Fixed conversion of geometric shapes in HWP 2025-09-29 17:00:06 +03:00
14e9a198c4 Fix bug #76691 2025-09-29 16:31:54 +03:00
b96e024145 fix bug #77019 2025-09-29 15:36:25 +03:00
4734d58ba6 Fix build 2025-09-29 14:36:05 +03:00
526a21da57 Merge branch 'develop' into feature/add-xls-writing 2025-09-29 17:06:24 +06:00
fb6bda209b add pivotIvd conversion 2025-09-29 17:04:36 +06:00
414afabce7 Fix stroke 2025-09-29 13:57:51 +03:00
4b0f79a1ab add sxdi conversion 2025-09-29 16:00:11 +06:00
c3c9dfcc70 m_oPathRedact in class 2025-09-29 10:40:55 +03:00
2cd69351c7 Fix bugs in HWPX/HWPML conversion 2025-09-27 17:56:13 +03:00
de8a054b26 fix subtraction op 2025-09-26 18:59:32 +03:00
e1157b8507 Test 2025-09-26 18:50:41 +03:00
e5946892c9 add pivot field items conversion 2025-09-26 20:37:04 +06:00
d399027127 Add pivotField conversion 2025-09-26 19:31:23 +06:00
a873787fd7 Use Aggplus::CalcBooleanOperation 2025-09-26 15:56:29 +03:00
2e732ce62f add sxview conversion 2025-09-26 15:59:28 +06:00
21a166208f Merge remote-tracking branch 'origin/release/v9.1.0' into feature/pdf-redact-fix 2025-09-26 11:04:54 +03:00
c3f98e011d Fix iterator 2025-09-26 11:04:13 +03:00
49fc001aa3 Fix bugs in HWPX/HWPML conversion and refactoring 2025-09-26 00:25:26 +03:00
a7b0b0a938 Redact writer 2025-09-25 17:48:08 +03:00
c8ebcfac87 Add offset for brush rect 2025-09-25 16:12:07 +03:00
44e6774c5a add pivot table writing 2025-09-25 18:37:33 +06:00
2931c4b53e Aff offset metafile command 2025-09-25 13:58:55 +03:00
7ddb363d60 fix build 2025-09-25 13:19:47 +03:00
ecd333e238 Merge pull request 'feature/compound2' (#452) from feature/compound2 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/452
2025-09-25 09:27:18 +00:00
b377493ecb Merge branch 'develop' into feature/compound_any 2025-09-25 12:23:12 +03:00
afeeeab564 Merge remote-tracking branch 'origin/release/v9.1.0' into develop 2025-09-25 10:23:12 +03:00
b52dff617b Refactoring in HWPX/HWPML conversion 2025-09-24 18:47:24 +03:00
31644cc5d7 Fix bugs in HWPX/HWPML conversion 2025-09-24 18:21:03 +03:00
460abc0d55 fix xls color conversion 2025-09-24 20:48:11 +06:00
1aa17ba09e Fix shape with redact 2025-09-24 17:32:11 +03:00
d654092289 ctRedact change format 2025-09-24 12:52:08 +03:00
01b2aaedb2 add table styles conversion 2025-09-23 20:41:56 +06:00
7577bd2d20 Fix writer content 2025-09-23 17:13:13 +03:00
9453e9c87d Fix bugs in HWPML conversion 2025-09-23 16:24:48 +03:00
580c896b72 fix table conversion 2025-09-23 18:13:47 +06:00
8916814106 Try Redact writer 2025-09-23 14:16:46 +03:00
03a1d9fa4c add table conversion 2025-09-22 19:37:14 +06:00
0fd709bf93 Fix test 2025-09-22 10:33:43 +03:00
3a047cfab0 Refactoring in HWPX/HWPML conversion 2025-09-19 22:04:34 +03:00
0ed11abb38 HWPML format added to x2t and refactoring 2025-09-19 16:46:51 +03:00
61d199a0c1 add list12 writing 2025-09-19 16:16:00 +06:00
e7a57c1584 Expanded support for the HWPML format 2025-09-18 20:10:39 +03:00
4ea31dcb00 Merge remote-tracking branch 'origin/release/v9.1.0' into develop 2025-09-18 19:07:44 +03:00
54a0c7f231 add feature11 writing 2025-09-18 20:36:54 +06:00
a4d60a1ae1 fix list parsed formula 2025-09-18 19:09:18 +06:00
b7b3e0dd65 add feat11field parts writing 2025-09-18 19:08:52 +06:00
c28a6bf1ea add feat11fieldData writing 2025-09-18 17:57:14 +06:00
842a44ccf9 Expanded support for the HWPML format 2025-09-18 12:42:52 +03:00
9f24254cc7 add feat11 writing 2025-09-18 14:20:32 +06:00
e105eca426 add tablestyle element conversion 2025-09-17 19:51:02 +06:00
02a923afb4 add table styles conversion 2025-09-17 18:06:07 +06:00
c7a0996a6c Fix condfmt colors conversion 2025-09-16 21:33:48 +06:00
51de435393 Expanded support for the HWPML format 2025-09-16 17:59:22 +03:00
6d27231e15 add OfficeArtFOPT writing 2025-09-15 21:11:32 +06:00
a2a5ef8fcd add author writing to notes 2025-09-15 19:20:20 +06:00
1c877ebe59 add spgroup writing 2025-09-15 17:48:06 +06:00
f03248ca86 fix TextObject writing 2025-09-12 16:47:46 +06:00
a4005412a7 Merge branch 'develop' into feature/add-xls-writing 2025-09-12 13:37:30 +06:00
d5434f190f Added the implementation of the object property parse in HWPML 2025-09-11 23:33:24 +03:00
e50016259a add textObject processing 2025-09-11 21:38:36 +06:00
0ed5be36a8 Rollback IsRGB 2025-09-11 16:40:26 +03:00
d5a6c935e5 add obj specifying for comment 2025-09-11 17:56:50 +06:00
aa3d4cb3ce add drawing preparation 2025-09-11 16:20:34 +06:00
73fa9b6aac Merge pull request 'fix bug 74748' (#439) from fix/bug-74748 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/439
2025-09-11 08:54:43 +00:00
c9a0d6e4e5 Merge branch hotfix/v9.0.4 into develop 2025-09-11 08:40:08 +00:00
a517cef437 Merge branch hotfix/v9.0.4 into master 2025-09-11 08:40:05 +00:00
130de28e4b Add comments conversion 2025-09-10 18:10:17 +06:00
2ee94c4920 Text conversion from HWPML format is implemented 2025-09-10 13:59:15 +03:00
cd53c06be3 fix bug 74748 2025-09-09 17:53:21 +03:00
122a54f510 add textObjectWriting 2025-09-09 18:45:39 +06:00
f96dd51403 Fix bug #73727 2025-09-08 17:40:18 +03:00
b425405744 add gboData writing 2025-09-08 17:36:02 +06:00
28ffd27fca add FtLbsData writing 2025-09-08 16:11:51 +06:00
9bc9d86dd6 add pict fmla writing 2025-09-08 14:43:35 +06:00
a1891b597f add pictFmla writing 2025-09-05 21:24:54 +06:00
bf9ce4f535 add ft macro writing 2025-09-05 19:10:52 +06:00
508d8f25db add obj writing 2025-09-05 18:09:11 +06:00
efbfcaed37 add OfficeArtSpContainer writing 2025-09-04 20:54:51 +06:00
deb90037d5 StarMath conversion to a dynamic library 2025-09-04 17:12:15 +03:00
d1fc31ac28 add OfficeArtFRITContainer writing 2025-09-04 18:50:50 +06:00
b8efe6c554 add fdg writing 2025-09-04 17:26:28 +06:00
13410f8467 add objects writing 2025-09-03 19:37:32 +06:00
3a389147dd add dbb writing 2025-09-03 15:13:04 +06:00
ba203f734d add fdb writing 2025-09-02 20:19:02 +06:00
758454747d add sxformula writing 2025-09-02 16:46:39 +06:00
d904245e9a Refactoring CPictFile 2025-09-02 11:06:06 +03:00
bf175e92a3 add sxdb writing 2025-09-01 20:02:35 +06:00
0c9b5821e7 add pivotcache stream writing 2025-09-01 19:29:29 +06:00
98dae842ae Add data validations conversion 2025-09-01 18:26:48 +06:00
7bb68aedca Merge remote-tracking branch 'origin/release/v9.1.0' into feature/pdf-redact-fix 2025-08-29 10:28:59 +03:00
5475c246ab Fix test Redact 2025-08-28 18:09:25 +03:00
5864ab8e7a Fix test 2025-08-28 13:47:42 +03:00
03809c0a1c Add SetEditType 2025-08-28 13:45:56 +03:00
6c3f0e88cb Fix CropBox 2025-08-27 17:03:31 +03:00
bb40cd0467 Fix coords 2025-08-27 15:18:59 +03:00
5c98a92faf Merge remote-tracking branch 'origin/fix/bug-76416' into feature/pdf-redact-fix 2025-08-27 12:13:41 +03:00
2b54cfaf37 Add drawing line, text, arc methods for PICT 2025-08-27 07:20:58 +03:00
00cd3a9497 RGB to arrayBufferFiller 2025-08-26 14:40:03 +03:00
a488266ba1 Fix drawing methods for PICT 2025-08-26 06:30:04 +03:00
65f4acc2ac Add drawing recr, oval methods for PICT 2025-08-26 04:35:16 +03:00
ff53c1b474 Add others template params for cf12 conversion 2025-08-25 21:12:27 +06:00
a47f3df7bf Add drawing polygon method for PICT converter 2025-08-25 15:32:39 +03:00
abd4c2f4a8 Fix cliping 2025-08-25 12:54:54 +03:00
334f9602b4 add conditional formatting filter conversion 2025-08-22 20:06:20 +06:00
e32aea2138 Redact stroke path 2025-08-22 14:56:44 +03:00
fed94358fe add multistate conversion 2025-08-22 17:44:53 +06:00
89b669e319 fix databar conversion 2025-08-22 15:16:06 +06:00
db213d3ae4 add cf databar conversion 2025-08-21 21:35:04 +06:00
79df81301f add colorScale cond fmt conversion 2025-08-21 18:52:07 +06:00
3cf3a3e098 Try DoPathStroke 2025-08-21 15:47:26 +03:00
197bbf7027 Add aligment conversion to conditional formatting 2025-08-20 18:17:03 +06:00
d092b88d9b Redact Do&Undo 2025-08-20 14:54:02 +03:00
a466592bc2 add protection conversion 2025-08-20 14:48:03 +06:00
4bce73d81d Add numfmt convesion to dxf 2025-08-20 14:06:50 +06:00
2a6c50db89 Redact PdfReader 2025-08-19 17:39:36 +03:00
ed13e54d26 Add dxf border conversion 2025-08-19 19:18:01 +06:00
e0dee3720f Try CalcBooleanOperation 2025-08-19 14:25:43 +03:00
4686fb4081 Merge remote-tracking branch 'origin/develop' into feature/pdf-redact-fix 2025-08-19 13:14:11 +03:00
dda020a1d5 Create SetExtGrStateKey 2025-08-18 17:48:23 +03:00
e371f7ccf1 add font condfmt conversion 2025-08-18 20:42:46 +06:00
14a0e4713c add fills conversion to conditional formatting 2025-08-18 17:03:07 +06:00
74b9a426c2 fix/bug-with break-columns
update comments
2025-08-18 13:27:29 +03:00
43c7e2c9a8 Add global info using in conversion 2025-08-15 20:55:34 +06:00
cac28771d3 Test pathkit 2025-08-15 17:30:21 +03:00
39b9c28607 fix dxfn conversion 2025-08-15 17:34:07 +06:00
6e57d7e4e7 fix cfParsed formula conversion 2025-08-14 20:40:20 +06:00
a938ce4c76 Fix drawForm 2025-08-14 16:05:33 +03:00
f831d9a22d add condFmt conversion 2025-08-14 17:56:01 +06:00
930165a993 fix bugs 2025-08-14 14:50:46 +03:00
fc56b22d40 Test easy Redact 2025-08-14 11:29:36 +03:00
c53fff1ffb Write text 2025-08-13 18:16:16 +03:00
7f54430813 Add dxf conversion 2025-08-13 17:21:03 +06:00
ea42899b9e Merge branch 'develop' into feature/add-xls-writing 2025-08-13 13:20:11 +06:00
b420fd731f Add borders style conversion 2025-08-12 20:59:33 +06:00
dbbf4d04f9 Add blanc cell processing 2025-08-12 20:16:16 +06:00
d854608d45 Begin drawForm 2025-08-12 11:19:10 +03:00
fe2b631c87 Merge pull request 'release/v9.1.0' (#405) from release/v9.1.0 into feature/EQN2OOXml2
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/405
2025-08-12 08:13:11 +00:00
71e1f7c726 Redact create path 2025-08-11 15:32:27 +03:00
62132c27bd add fills conversion 2025-08-11 17:09:43 +06:00
239d82deb4 Fix remove entry from xref 2025-08-08 17:01:34 +03:00
e4449d7aa9 Add font color conversion 2025-08-08 18:55:02 +06:00
cb304293b7 Add palette conversion 2025-08-08 14:20:56 +06:00
ffb62243a9 Merge branch 'develop' into feature/add-xls-writing 2025-08-08 13:27:43 +06:00
63a80580cc fix number value conversion 2025-08-07 20:04:19 +06:00
fed142690b Add data consolidation conversion 2025-08-07 15:13:09 +06:00
8d368ca91c Merge branch 'develop' into feature/add-xls-writing 2025-08-07 13:07:10 +06:00
2cc2434982 fix continue record writing 2025-08-06 20:27:16 +06:00
f5989b979a Fix autofilter record writing 2025-08-06 18:44:53 +06:00
5bab01517a New function for RedactOutputDev 2025-08-06 10:19:07 +03:00
62955d5f6e Add autofilter writing 2025-08-05 21:35:39 +06:00
cb68e4389e EQN conversion added to HWPX 2025-08-04 20:16:57 +03:00
72a445fb54 Create Redact annotation 2025-08-04 18:13:44 +03:00
9fc3fcabcb Fix sort data record writing 2025-08-04 19:01:27 +06:00
6af0b89c1d Add sort state conversion 2025-08-04 17:48:04 +06:00
7451ba6e10 Merge remote-tracking branch 'origin/develop' into feature/pdf-redact 2025-08-04 11:54:40 +03:00
c34b9e00e5 Merge branch 'develop' into feature/add-xls-writing 2025-08-04 13:14:17 +06:00
e715da8680 Add header and footer conversion 2025-08-01 18:33:49 +06:00
d6c58a4655 Create RedactOutputDev 2025-08-01 14:01:27 +03:00
7a26c345c5 Fix margin conversion 2025-08-01 16:42:57 +06:00
2a6e76a2bc Add pagesetup conversion 2025-08-01 15:42:05 +06:00
adfc79938d Merge branch 'develop' into feature/add-xls-writing 2025-08-01 14:00:31 +06:00
c3ce1d2756 Fix hlink conversion 2025-07-31 19:14:09 +06:00
cf5208d6a5 Add hyperlinks conversion 2025-07-31 13:53:14 +06:00
56e6a0a3b8 Merge branch 'develop' into feature/add-xls-writing 2025-07-31 13:06:10 +06:00
c1bb697725 Create Redact function 2025-07-30 15:31:40 +03:00
0a7ad2f560 Add worksheet protection conversion 2025-07-30 17:25:53 +06:00
fede5921e1 add workbook protection conversion 2025-07-30 16:54:57 +06:00
897ea781b7 Fix font conversion 2025-07-30 15:45:59 +06:00
f95014f46f Add phonetic string conversion 2025-07-29 17:25:33 +06:00
92fae52a6d Fix rich string xls conversion 2025-07-28 21:52:30 +06:00
afb0f44af2 Add crun shared string conversion 2025-07-28 20:49:38 +06:00
1027f3cc6b Fix Edit in WriteNew mode 2025-07-28 16:18:18 +03:00
af20b1f63d fix cell xf index writiong 2025-07-28 18:34:52 +06:00
c779654a58 Add cell styles conversion 2025-07-25 21:04:32 +06:00
d1c99891c6 Add xfs conversion 2025-07-25 18:12:27 +06:00
ffc94bf455 Add numFmts conversion 2025-07-25 15:27:53 +06:00
680c83853a Add fonts conversion 2025-07-25 14:44:08 +06:00
33e698242c Merge branch 'develop' into feature/add-xls-writing 2025-07-25 13:16:39 +06:00
e8ad643a0e Add bookviewsConversion 2025-07-24 21:24:07 +06:00
609e3bc158 Add worksheet view conversion 2025-07-24 20:50:37 +06:00
f04c60fbb0 Develop WriteNew 2025-07-24 14:13:14 +03:00
7e51dd143a Add colls & merged cells conversion 2025-07-24 15:02:36 +06:00
31d65dea7c Merge branch 'develop' into feature/add-xls-writing 2025-07-24 13:02:00 +06:00
89172a9047 add relsSorting 2025-07-23 20:45:04 +06:00
0103717241 add dimensions conversion 2025-07-23 20:44:54 +06:00
cc294ab2b2 New mode WriteNew 2025-07-23 16:50:31 +03:00
c012662402 Add array formula writing 2025-07-23 17:21:30 +06:00
0f1cb37153 edit of the previous comment 2025-07-22 18:23:24 +03:00
95bad7b071 writing Arabic characters 2025-07-22 18:04:52 +03:00
00c3085a90 Merge branch 'develop' into feature/add-xls-writing 2025-07-22 17:37:35 +06:00
f1fa861c8a Add shared formula conversion 2025-07-22 17:35:57 +06:00
48d6ce60ee Merge remote-tracking branch 'origin/develop' into feature/pdf-redact 2025-07-22 10:58:03 +03:00
c37f96da2d Add formula conversion 2025-07-21 19:20:37 +06:00
3b4097310b Write Redact 2025-07-21 16:09:12 +03:00
89473c5ba0 Add simple shared strings conversion 2025-07-18 20:03:37 +06:00
07afc6e4c3 add simple cells conversion 2025-07-18 16:16:03 +06:00
05404c1bad Merge pull request 'develop' (#398) from develop into feature/EQN2OOXml2
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/398
2025-07-18 09:21:14 +00:00
b0e810013d editing conversion and parsing, fixing bugs, adding tests 2025-07-18 12:18:27 +03:00
34c34018a0 Merge branch 'develop' into feature/add-xls-writing 2025-07-18 14:48:55 +06:00
05dd636a1c Add cellType processing function 2025-07-17 21:36:00 +06:00
e6158043b9 add sheet data conversion 2025-07-17 18:42:22 +06:00
cfd1dcc3ee Add worksheets conversion 2025-07-17 17:14:12 +06:00
7a2944ce58 Add defined names conversion 2025-07-17 15:26:34 +06:00
8a11fa5aac Merge branch 'develop' into feature/add-xls-writing 2025-07-17 13:03:44 +06:00
aa2127b55f Add bundlesheet conversion 2025-07-16 20:28:40 +06:00
86a2d66d83 Add xlsx2xls conversion 2025-07-16 19:13:12 +06:00
9b3b6caef9 pars diacritical marks 2025-06-27 13:12:49 +03:00
2aeec01f1e fix index 2025-06-12 16:40:26 +03:00
70412f5f8e pars index(without underover) 2025-04-27 20:22:26 +03:00
b1885e5b91 pars oper 2025-04-22 10:55:36 +03:00
8e2d1e2c16 parse development 2025-04-17 22:19:08 +03:00
d6ed01e1df fix compound2 function 2023-09-04 12:25:28 +03:00
0fcf29eddc fix compound converter 2023-09-01 18:01:58 +03:00
474a500819 Add compound file to checker 2023-08-31 18:15:27 +03:00
1059 changed files with 50867 additions and 17178 deletions

View File

@ -6,12 +6,13 @@ 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"])
base.replaceInFile("./glm/glm/detail/func_common.inl", "vec<L, T, Q> v;", "vec<L, T, Q> v{};")
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 = "#if __cplusplus < 201703L\n"
fix_cpp_version += "#ifndef _MSC_VER\n"
fix_cpp_version += "namespace std {\n"
fix_cpp_version += " template<bool __v>\n"

View File

@ -3,6 +3,8 @@ DEPENDPATH += $$PWD
CORE_ROOT_DIR = $$PWD/../../../..
include($$CORE_ROOT_DIR/Common/3dParty/boost/boost.pri)
css_calculator_without_xhtml {
HEADERS += \
$$PWD/src/CCssCalculator_Private.h \

View File

@ -7,7 +7,6 @@
#include <iterator>
#include <map>
#include <iostream>
#include "../../../../../DesktopEditor/common/File.h"
#include "StaticFunctions.h"
#include "ConstValues.h"
@ -18,14 +17,16 @@ namespace NSCSS
{
typedef std::map<std::wstring, std::wstring>::const_iterator styles_iterator;
CCompiledStyle::CCompiledStyle() : m_nDpi(96), m_UnitMeasure(Point), m_dCoreFontSize(DEFAULT_FONT_SIZE)
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_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_oTransform(oStyle.m_oTransform){}
m_oText(oStyle.m_oText), m_oBorder(oStyle.m_oBorder), m_oDisplay(oStyle.m_oDisplay), m_oTransform(oStyle.m_oTransform)
{}
CCompiledStyle::~CCompiledStyle()
{
@ -34,6 +35,8 @@ namespace NSCSS
CCompiledStyle& CCompiledStyle::operator+= (const CCompiledStyle &oElement)
{
m_arParentsStyles.insert(oElement.m_arParentsStyles.begin(), oElement.m_arParentsStyles.end());
if (oElement.Empty())
return *this;
@ -49,8 +52,6 @@ namespace NSCSS
if (!oElement.m_sId.empty())
m_sId += L'+' + oElement.m_sId;
m_arParentsStyles.insert(oElement.m_arParentsStyles.begin(), oElement.m_arParentsStyles.end());
return *this;
}

View File

@ -15,29 +15,33 @@ inline static std::wstring StringifyValueList(const KatanaArray* oValues);
inline static std::wstring StringifyValue(const KatanaValue* oValue);
inline static bool IsTableElement(const std::wstring& wsNameTag);
bool operator<(const std::vector<NSCSS::CNode> &arLeftSelectors, const std::vector<NSCSS::CNode> &arRightSelectors)
{
const size_t& sizeLeftSelectors = arLeftSelectors.size();
const size_t& sizeRightSelectors = arRightSelectors.size();
if (sizeLeftSelectors < sizeRightSelectors)
return true;
else if (sizeLeftSelectors > sizeRightSelectors)
return false;
for (size_t i = 0; i < arLeftSelectors.size(); ++i)
{
if (arLeftSelectors[i] < arRightSelectors[i])
return true;
}
return false;
}
namespace NSCSS
{
bool operator<(const std::vector<NSCSS::CNode> &arLeftSelectors, const std::vector<NSCSS::CNode> &arRightSelectors)
{
if (arLeftSelectors.size() < arRightSelectors.size())
return true;
else if (arLeftSelectors.size() > arRightSelectors.size())
return false;
for (size_t i = 0; i < arLeftSelectors.size(); ++i)
{
if (arLeftSelectors[i] == arRightSelectors[i])
continue;
if (arLeftSelectors[i] < arRightSelectors[i])
return true;
else if (arRightSelectors[i] < arLeftSelectors[i])
return false;
}
return false;
}
CStyleStorage::CStyleStorage()
{}
{
InitDefaultStyles();
}
CStyleStorage::~CStyleStorage()
{
@ -62,6 +66,7 @@ namespace NSCSS
m_arEmptyStyleFiles.clear();
ClearEmbeddedStyles();
ClearDefaultStyles();
ClearAllowedStyleFiles();
#ifdef CSS_CALCULATOR_WITH_XHTML
@ -208,6 +213,16 @@ namespace NSCSS
return nullptr;
}
const CElement* CStyleStorage::FindDefaultElement(const std::wstring& wsSelector) const
{
if (wsSelector.empty())
return nullptr;
const CElement* pFoundElement = FindSelectorFromStyleData(wsSelector, m_mDefaultStyleData);
return (nullptr != pFoundElement) ? pFoundElement : nullptr;
}
void CStyleStorage::AddStyles(const std::string& sStyle, std::map<std::wstring, CElement*>& mStyleData)
{
if (sStyle.empty())
@ -227,6 +242,15 @@ namespace NSCSS
m_mEmbeddedStyleData.clear();
}
void CStyleStorage::ClearDefaultStyles()
{
for (std::map<std::wstring, CElement*>::iterator oIter = m_mDefaultStyleData.begin(); oIter != m_mDefaultStyleData.end(); ++oIter)
if (oIter->second != nullptr)
delete oIter->second;
m_mDefaultStyleData.clear();
}
void CStyleStorage::ClearAllowedStyleFiles()
{
m_arAllowedStyleFiles.clear();
@ -480,7 +504,33 @@ namespace NSCSS
return nullptr;
}
CCssCalculator_Private::CCssCalculator_Private() : m_nDpi(96), m_nCountNodes(0), m_sEncoding(L"UTF-8"){}
void CStyleStorage::InitDefaultStyles()
{
m_mDefaultStyleData[L"b"] = new CElement(L"b", {{L"font-weight", L"bold"}});
m_mDefaultStyleData[L"center"] = new CElement(L"center", {{L"text-align", L"center"}});
m_mDefaultStyleData[L"i"] = new CElement(L"i", {{L"font-style", L"italic"}});
m_mDefaultStyleData[L"code"] = new CElement(L"code", {{L"font-family", L"Courier New"}});
m_mDefaultStyleData[L"kbd"] = new CElement(L"kbd", {{L"font-family", L"Courier New"},
{L"font_weight", L"bold"}});
m_mDefaultStyleData[L"s"] = new CElement(L"s", {{L"text-decoration", L"line-through"}});
m_mDefaultStyleData[L"u"] = new CElement(L"u", {{L"text-decoration", L"underline"}});
m_mDefaultStyleData[L"mark"] = new CElement(L"mark", {{L"background-color", L"yellow"}});
m_mDefaultStyleData[L"sup"] = new CElement(L"sup", {{L"vertical-align", L"top"}});
m_mDefaultStyleData[L"sub"] = new CElement(L"sub", {{L"vertical-align", L"bottom"}});
m_mDefaultStyleData[L"dd"] = new CElement(L"dd", {{L"margin-left", L"720tw"}});
m_mDefaultStyleData[L"pre"] = new CElement(L"pre", {{L"font-family", L"Courier New"},
{L"margin-top", L"0"},
{L"margin-bottom", L"0"}});
m_mDefaultStyleData[L"blockquote"] = new CElement(L"blockquote", {{L"margin", L"0px"}});
m_mDefaultStyleData[L"ul"] = new CElement(L"ul", {{L"margin-top", L"100tw"},
{L"margin-bottom", L"100tw"}});
m_mDefaultStyleData[L"textarea"] = new CElement(L"textarea", {{L"border", L"1px solid black"}});
}
CCssCalculator_Private::CCssCalculator_Private()
: m_nDpi(96), m_nCountNodes(0), m_sEncoding(L"UTF-8")
{
}
CCssCalculator_Private::~CCssCalculator_Private()
{}
@ -503,17 +553,25 @@ namespace NSCSS
arSelectors.back().m_pCompiledStyle->m_oBorder.Clear();
}
if (arSelectors.size() > 1)
arSelectors.back().m_pCompiledStyle->AddParent(arSelectors[arSelectors.size() - 2].m_wsName);
arSelectors.back().m_pCompiledStyle->SetID(L"text-" + std::to_wstring(++m_nCountNodes));
return true;
}
const std::map<std::vector<CNode>, CCompiledStyle>::iterator oItem = m_mUsedStyles.find(arSelectors);
const std::map<std::vector<CNode>, CCompiledStyle>::const_iterator oItem = m_mUsedStyles.find(arSelectors);
if (oItem != m_mUsedStyles.end())
if (oItem != m_mUsedStyles.cend() && (arSelectors.back().m_wsId.empty() || !HaveStylesById(arSelectors.back().m_wsId)))
{
arSelectors.back().SetCompiledStyle(new CCompiledStyle(oItem->second));
return true;
}
if (!arSelectors.back().m_pCompiledStyle->Empty())
return true;
arSelectors.back().m_pCompiledStyle->SetDpi(m_nDpi);
unsigned int unStart = 0;
@ -522,8 +580,8 @@ namespace NSCSS
if (itFound != arSelectors.crend())
unStart = itFound.base() - arSelectors.cbegin();
std::vector<std::wstring> arNodes = CalculateAllNodes(arSelectors, unStart);
std::vector<std::wstring> arPrevNodes;
std::vector<std::wstring> arNodes = CalculateAllNodes(arSelectors, unStart, arSelectors.size());
std::vector<std::wstring> arPrevNodes = CalculateAllNodes(arSelectors, 0, unStart);
bool bInTable = false;
for (size_t i = 0; i < unStart; ++i)
@ -539,7 +597,8 @@ namespace NSCSS
if (0 != i)
*arSelectors[i].m_pCompiledStyle += *arSelectors[i - 1].m_pCompiledStyle;
arSelectors[i].m_pCompiledStyle->AddParent(arSelectors[i].m_wsName);
if (i != arSelectors.size() - 1)
arSelectors[i].m_pCompiledStyle->AddParent(arSelectors[i].m_wsName);
if (!bInTable)
bInTable = IsTableElement(arSelectors[i].m_wsName);
@ -548,6 +607,7 @@ namespace NSCSS
{
arSelectors[i].m_pCompiledStyle->m_oBackground.Clear();
arSelectors[i].m_pCompiledStyle->m_oBorder.Clear();
arSelectors[i].m_pCompiledStyle->m_oDisplay.Clear();
}
arSelectors[i].m_pCompiledStyle->AddStyle(arSelectors[i].m_mAttributes, i + 1);
@ -592,11 +652,14 @@ namespace NSCSS
}
#endif
std::vector<std::wstring> CCssCalculator_Private::CalculateAllNodes(const std::vector<CNode> &arSelectors, unsigned int unStart)
std::vector<std::wstring> CCssCalculator_Private::CalculateAllNodes(const std::vector<CNode> &arSelectors, unsigned int unStart, unsigned int unEnd)
{
if ((0 != unEnd && (unEnd < unStart || unEnd > arSelectors.size())) || (unStart == unEnd))
return std::vector<std::wstring>();
std::vector<std::wstring> arNodes;
for (std::vector<CNode>::const_reverse_iterator oNode = arSelectors.rbegin(); oNode != arSelectors.rend() - unStart; ++oNode)
for (std::vector<CNode>::const_reverse_iterator oNode = arSelectors.rbegin() + ((0 != unEnd) ? (arSelectors.size() - unEnd) : 0); oNode != arSelectors.rend() - unStart; ++oNode)
{
if (!oNode->m_wsName.empty())
arNodes.push_back(oNode->m_wsName);
@ -608,8 +671,8 @@ namespace NSCSS
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' ';}));
[](std::wstring sRes, const std::wstring& sClass)
{return sRes += L'.' + sClass + L' ';}));
}
else
arNodes.push_back(L'.' + oNode->m_wsClass);
@ -627,7 +690,7 @@ namespace NSCSS
if (arNextNodes.empty())
return;
const std::vector<CElement*> arTempPrev = pElement->GetPrevElements(arNextNodes.crbegin() + 1, arNextNodes.crend());
const std::vector<CElement*> arTempPrev = pElement->GetPrevElements(arNextNodes.cbegin(), arNextNodes.cend());
const std::vector<CElement*> arTempKins = pElement->GetNextOfKin(wsName, arClasses);
if (!arTempPrev.empty())
@ -637,6 +700,36 @@ namespace NSCSS
arFindedElements.insert(arFindedElements.end(), arTempKins.begin(), arTempKins.end());
}
inline std::wstring GetAlternativeDefaultNodeName(const std::wstring& wsNodeName)
{
if (L"strong" == wsNodeName)
return L"b";
if (L"cite" == wsNodeName || L"dfn" == wsNodeName || L"em" == wsNodeName ||
L"var" == wsNodeName || L"adress" == wsNodeName)
return L"i";
if (L"tt" == wsNodeName || L"samp" == wsNodeName)
return L"code";
if (L"strike" == wsNodeName || L"del" == wsNodeName)
return L"s";
if (L"ins" == wsNodeName)
return L"u";
if (L"xmp" == wsNodeName || L"nobr" == wsNodeName)
return L"pre";
if (L"ol" == wsNodeName)
return L"ul";
if (L"fieldset" == wsNodeName)
return L"textarea";
return wsNodeName;
}
std::vector<const CElement*> CCssCalculator_Private::FindElements(std::vector<std::wstring> &arNodes, std::vector<std::wstring> &arNextNodes)
{
if (arNodes.empty())
@ -644,20 +737,19 @@ namespace NSCSS
std::vector<const CElement*> arFindedElements;
std::wstring wsName, wsId;
std::wstring wsName, wsClasses, 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());
wsClasses = arNodes.back();
arClasses = NS_STATIC_FUNCTIONS::GetWordsW(wsClasses, false, L" ");
arNodes.pop_back();
}
@ -665,7 +757,6 @@ namespace NSCSS
{
wsName = arNodes.back();
arNodes.pop_back();
arNextNodes.push_back(wsName);
}
if (!wsId.empty())
@ -697,6 +788,11 @@ namespace NSCSS
}
}
const CElement* pFoundDefault = m_oStyleStorage.FindDefaultElement(GetAlternativeDefaultNodeName(wsName));
if (nullptr != pFoundDefault)
arFindedElements.push_back(pFoundDefault);
const CElement* pFoundName = m_oStyleStorage.FindElement(wsName);
if (nullptr != pFoundName)
@ -724,6 +820,14 @@ namespace NSCSS
{ return oFirstElement->GetWeight() > oSecondElement->GetWeight(); });
}
if (!wsId.empty())
arNextNodes.push_back(wsId);
if (!wsClasses.empty())
arNextNodes.push_back(wsClasses);
arNextNodes.push_back(wsName);
return arFindedElements;
}
@ -738,7 +842,7 @@ namespace NSCSS
if (arSelectors.empty())
return false;
std::vector<std::wstring> arNodes = CalculateAllNodes(arSelectors);
std::vector<std::wstring> arNodes = CalculateAllNodes(arSelectors, 0, arSelectors.size());
std::vector<std::wstring> arNextNodes;
for (size_t i = 0; i < arSelectors.size(); ++i)

View File

@ -27,6 +27,7 @@ namespace NSCSS
void AddStylesFromFile(const std::wstring& wsFileName);
void ClearEmbeddedStyles();
void ClearDefaultStyles();
void ClearAllowedStyleFiles();
void ClearStylesFromFile(const std::wstring& wsFileName);
@ -38,6 +39,7 @@ namespace NSCSS
#endif
const CElement* FindElement(const std::wstring& wsSelector) const;
const CElement* FindDefaultElement(const std::wstring& wsSelector) const;
private:
typedef struct
{
@ -49,6 +51,7 @@ namespace NSCSS
std::set<std::wstring> m_arAllowedStyleFiles;
std::vector<TStyleFileData*> m_arStyleFiles;
std::map<std::wstring, CElement*> m_mEmbeddedStyleData;
std::map<std::wstring, CElement*> m_mDefaultStyleData;
#ifdef CSS_CALCULATOR_WITH_XHTML
typedef struct
@ -78,6 +81,8 @@ namespace NSCSS
void GetOutputData(KatanaOutput* oOutput, std::map<std::wstring, CElement*>& mStyleData);
const CElement* FindSelectorFromStyleData(const std::wstring& wsSelector, const std::map<std::wstring, CElement*>& mStyleData) const;
void InitDefaultStyles();
};
class CCssCalculator_Private
@ -110,7 +115,7 @@ namespace NSCSS
void ClearPageData();
#endif
std::vector<std::wstring> CalculateAllNodes(const std::vector<CNode>& arSelectors, unsigned int unStart = 0);
std::vector<std::wstring> CalculateAllNodes(const std::vector<CNode>& arSelectors, unsigned int unStart, unsigned int unEnd);
std::vector<const CElement*> FindElements(std::vector<std::wstring>& arNodes, std::vector<std::wstring>& arNextNodes);
void AddStyles(const std::string& sStyle);

View File

@ -9,6 +9,13 @@ namespace NSCSS
CElement::CElement()
{
}
CElement::CElement(const std::wstring& wsSelector, std::map<std::wstring, std::wstring> mStyle)
: m_mStyle(mStyle), m_sSelector(wsSelector), m_sFullSelector(wsSelector)
{
UpdateWeight();
}
CElement::~CElement()
{
for (CElement* oElement : m_arPrevElements)
@ -18,7 +25,6 @@ namespace NSCSS
continue;
m_mStyle.clear();
}
std::wstring CElement::GetSelector() const
@ -176,14 +182,14 @@ namespace NSCSS
return arElements;
}
std::vector<CElement *> CElement::GetPrevElements(const std::vector<std::wstring>::const_reverse_iterator& oNodesRBegin, const std::vector<std::wstring>::const_reverse_iterator& oNodesREnd) const
std::vector<CElement *> CElement::GetPrevElements(const std::vector<std::wstring>::const_iterator& oNodesBegin, const std::vector<std::wstring>::const_iterator& oNodesEnd) const
{
if (oNodesRBegin >= oNodesREnd || m_arPrevElements.empty())
if (oNodesBegin >= oNodesEnd || m_arPrevElements.empty())
return std::vector<CElement*>();
std::vector<CElement*> arElements;
for (std::vector<std::wstring>::const_reverse_iterator iWord = oNodesRBegin; iWord != oNodesREnd; ++iWord)
for (std::vector<std::wstring>::const_iterator iWord = oNodesBegin; iWord != oNodesEnd; ++iWord)
{
if ((*iWord)[0] == L'.' && ((*iWord).find(L" ") != std::wstring::npos))
{
@ -195,7 +201,7 @@ namespace NSCSS
if (oPrevElement->m_sSelector == wsClass)
{
arElements.push_back(oPrevElement);
std::vector<CElement*> arTempElements = oPrevElement->GetPrevElements(iWord + 1, oNodesREnd);
std::vector<CElement*> arTempElements = oPrevElement->GetPrevElements(iWord + 1, oNodesEnd);
arElements.insert(arElements.end(), arTempElements.begin(), arTempElements.end());
}
}
@ -208,9 +214,8 @@ namespace NSCSS
if (oPrevElement->m_sSelector == *iWord)
{
arElements.push_back(oPrevElement);
std::vector<CElement*> arTempElements = oPrevElement->GetPrevElements(iWord + 1, oNodesREnd);
std::vector<CElement*> arTempElements = oPrevElement->GetPrevElements(iWord + 1, oNodesEnd);
arElements.insert(arElements.end(), arTempElements.begin(), arTempElements.end());
// return arElements;
}
}
}

View File

@ -22,6 +22,7 @@ namespace NSCSS
public:
CElement();
CElement(const std::wstring& wsSelector, std::map<std::wstring, std::wstring> mStyle);
~CElement();
std::wstring GetSelector() const;
@ -39,7 +40,7 @@ namespace NSCSS
std::map<std::wstring, std::wstring> GetFullStyle(const std::vector<CNode>& arSelectors) const;
std::map<std::wstring, std::wstring> GetFullStyle(const std::vector<std::wstring>& arNodes) const;
std::vector<CElement *> GetNextOfKin(const std::wstring& sName, const std::vector<std::wstring>& arClasses = {}) const;
std::vector<CElement *> GetPrevElements(const std::vector<std::wstring>::const_reverse_iterator& oNodesRBegin, const std::vector<std::wstring>::const_reverse_iterator& oNodesREnd) const;
std::vector<CElement *> GetPrevElements(const std::vector<std::wstring>::const_iterator& oNodesBegin, const std::vector<std::wstring>::const_iterator& oNodesEnd) const;
std::map<std::wstring, std::wstring> GetConvertStyle(const std::vector<CNode>& arNodes) const;
CElement *FindPrevElement(const std::wstring& sSelector) const;

View File

@ -17,8 +17,7 @@ namespace NSCSS
m_wsStyle(oNode.m_wsStyle), m_mAttributes(oNode.m_mAttributes)
{
#ifdef CSS_CALCULATOR_WITH_XHTML
m_pCompiledStyle = new CCompiledStyle();
*m_pCompiledStyle = *oNode.m_pCompiledStyle;
m_pCompiledStyle = new CCompiledStyle(*oNode.m_pCompiledStyle);
#endif
}
@ -42,6 +41,23 @@ namespace NSCSS
return m_wsName.empty() && m_wsClass.empty() && m_wsId.empty() && m_wsStyle.empty();
}
bool CNode::GetAttributeValue(const std::wstring& wsAttributeName, std::wstring& wsAttributeValue) const
{
const std::map<std::wstring, std::wstring>::const_iterator itFound{m_mAttributes.find(wsAttributeName)};
if (m_mAttributes.cend() == itFound)
return false;
wsAttributeValue = itFound->second;
return true;
}
std::wstring CNode::GetAttributeValue(const std::wstring& wsAttributeName) const
{
const std::map<std::wstring, std::wstring>::const_iterator itFound{m_mAttributes.find(wsAttributeName)};
return (m_mAttributes.cend() != itFound) ? itFound->second : std::wstring();
}
#ifdef CSS_CALCULATOR_WITH_XHTML
void CNode::SetCompiledStyle(CCompiledStyle* pCompiledStyle)
{
@ -86,6 +102,9 @@ namespace NSCSS
if(m_wsStyle != oNode.m_wsStyle)
return m_wsStyle < oNode.m_wsStyle;
if (m_mAttributes.size() != oNode.m_mAttributes.size())
return m_mAttributes.size() < oNode.m_mAttributes.size();
if (m_mAttributes != oNode.m_mAttributes)
return m_mAttributes < oNode.m_mAttributes;
@ -94,10 +113,9 @@ namespace NSCSS
bool CNode::operator==(const CNode& oNode) const
{
return((m_wsId == oNode.m_wsId) &&
(m_wsName == oNode.m_wsName) &&
(m_wsClass == oNode.m_wsClass) &&
(m_wsStyle == oNode.m_wsStyle) &&
(m_mAttributes == oNode.m_mAttributes));
return((m_wsName == oNode.m_wsName) &&
(m_wsClass == oNode.m_wsClass) &&
(m_wsStyle == oNode.m_wsStyle) &&
(m_mAttributes == oNode.m_mAttributes));
}
}

View File

@ -18,6 +18,7 @@ namespace NSCSS
std::wstring m_wsId; // Id тэга
std::wstring m_wsStyle; // Стиль тэга
std::map<std::wstring, std::wstring> m_mAttributes; // Остальные аттрибуты тэга
//TODO:: возможно использование std::wstring излишне
#ifdef CSS_CALCULATOR_WITH_XHTML
CCompiledStyle *m_pCompiledStyle;
@ -30,6 +31,9 @@ namespace NSCSS
bool Empty() const;
bool GetAttributeValue(const std::wstring& wsAttributeName, std::wstring& wsAttributeValue) const;
std::wstring GetAttributeValue(const std::wstring& wsAttributeName) const;
#ifdef CSS_CALCULATOR_WITH_XHTML
void SetCompiledStyle(CCompiledStyle* pCompiledStyle);
#endif

View File

@ -149,7 +149,7 @@ namespace NSCSS
case NSCSS::Millimeter:
return dValue * 0.01764;
case NSCSS::Inch:
return dValue * 1440.;
return dValue / 1440.;
case NSCSS::Peak:
return dValue * 0.004167; // 0.004167 = 6 / 1440
default:

View File

@ -69,7 +69,10 @@ namespace NSCSS
R_Highlight,
R_Shd,
R_SmallCaps,
R_Kern
R_Kern,
R_Vanish,
R_Strike,
R_VertAlign
} RunnerProperties;
typedef enum

File diff suppressed because it is too large Load Diff

View File

@ -4,11 +4,14 @@
#include <map>
#include <string>
#include <vector>
#include <sstream>
#include "../../../../DesktopEditor/graphics/Matrix.h"
#include "CUnitMeasureConverter.h"
#include <boost/optional.hpp>
#include "boost/blank.hpp"
#include <boost/variant2/variant.hpp>
namespace NSCSS
{
namespace NSProperties
@ -16,33 +19,34 @@ namespace NSCSS
#define NEXT_LEVEL UINT_MAX, true
template<typename T>
class CValue
class CValueBase
{
friend class CString;
friend class CMatrix;
friend class CDigit;
friend class CColor;
friend class CEnum;
friend class CURL;
protected:
CValueBase()
: m_unLevel(0), m_bImportant(false)
{}
CValueBase(const CValueBase& oValue)
: m_oValue(oValue.m_oValue), m_unLevel(oValue.m_unLevel), m_bImportant(oValue.m_bImportant)
{}
CValueBase(const T& oValue, unsigned int unLevel, bool bImportant)
: m_oValue(oValue), m_unLevel(unLevel), m_bImportant(bImportant)
{}
T m_oValue;
unsigned int m_unLevel;
bool m_bImportant;
public:
CValue(const T& oValue, unsigned int unLevel, bool bImportant) :
m_oValue(oValue), m_unLevel(unLevel), m_bImportant(bImportant)
{
}
virtual bool Empty() const = 0;
virtual void Clear() = 0;
virtual bool SetValue(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode) = 0;
virtual bool Empty() const = 0;
virtual void Clear() = 0;
virtual int ToInt() const = 0;
virtual double ToDouble() const = 0;
virtual std::wstring ToWString() const = 0;
static void Equation(CValue &oFirstValue, CValue &oSecondValue)
static void Equation(CValueBase &oFirstValue, CValueBase &oSecondValue)
{
if (oFirstValue.m_bImportant && !oSecondValue.m_bImportant && oFirstValue.Empty())
oSecondValue.Clear();
@ -57,18 +61,39 @@ namespace NSCSS
}
}
static bool LevelIsSame(const CValue& oFirstValue, const CValue& oSecondValue)
static bool LevelIsSame(const CValueBase& oFirstValue, const CValueBase& oSecondValue)
{
return oFirstValue.m_unLevel == oSecondValue.m_unLevel;
}
bool operator==(const T& oValue) const { return m_oValue == oValue; }
bool operator>=(const T& oValue) const { return m_oValue >= oValue; }
bool operator<=(const T& oValue) const { return m_oValue <= oValue; }
bool operator> (const T& oValue) const { return m_oValue > oValue; }
bool operator< (const T& oValue) const { return m_oValue < oValue; }
friend bool operator==(const CValueBase& oLeftValue, const CValueBase& oRightValue)
{
if (oLeftValue.Empty() && oRightValue.Empty())
return true;
virtual CValue& operator =(const CValue& oValue)
if (( oLeftValue.Empty() && !oRightValue.Empty()) ||
(!oLeftValue.Empty() && oRightValue.Empty()))
return false;
return oLeftValue.m_oValue == oRightValue.m_oValue;
}
friend bool operator!=(const CValueBase& oLeftValue, const CValueBase& oRightValue)
{
return !(oLeftValue == oRightValue);
}
bool operator==(const T& oValue) const
{
return m_oValue == oValue;
}
bool operator!=(const T& oValue) const
{
return m_oValue != oValue;
}
virtual CValueBase& operator =(const CValueBase& oValue)
{
m_oValue = oValue.m_oValue;
m_unLevel = oValue.m_unLevel;
@ -77,70 +102,93 @@ namespace NSCSS
return *this;
}
virtual CValue& operator =(const T& oValue)
virtual CValueBase& operator =(const T& oValue)
{
//m_oValue = oValue.m_oValue;
m_oValue = oValue;
return *this;
}
virtual CValue& operator+=(const CValue& oValue)
virtual CValueBase& operator+=(const CValueBase& oValue)
{
if (m_unLevel > oValue.m_unLevel || (m_bImportant && !oValue.m_bImportant) || oValue.Empty())
return *this;
m_oValue = oValue.m_oValue;
m_unLevel = oValue.m_unLevel;
m_bImportant = oValue.m_bImportant;
*this = oValue;
return *this;
}
};
virtual bool operator==(const CValue& oValue) const
template<typename T>
class CValueOptional : public CValueBase<boost::optional<T>>
{
protected:
CValueOptional() = default;
CValueOptional(const T& oValue, unsigned int unLevel = 0, bool bImportant = false)
: CValueBase<boost::optional<T>>(oValue, unLevel, bImportant)
{}
public:
virtual bool Empty() const override
{
return m_oValue == oValue.m_oValue;
return !this->m_oValue.has_value();
}
void Clear() override
{
this->m_oValue.reset();
this->m_unLevel = 0;
this->m_bImportant = false;
}
virtual bool operator!=(const CValue& oValue) const
bool operator==(const T& oValue) const
{
return m_oValue != oValue.m_oValue;
if (!this->m_oValue.has_value())
return false;
return this->m_oValue.value() == oValue;
}
virtual CValueOptional& operator=(const T& oValue)
{
this->m_oValue = oValue;
return *this;
}
};
class CString : public CValue<std::wstring>
class CString : public CValueOptional<std::wstring>
{
public:
CString();
CString(const std::wstring& wsValue, unsigned int unLevel, bool bImportant = false);
CString() = default;
CString(const std::wstring& wsValue, unsigned int unLevel = 0, bool bImportant = false);
bool SetValue(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode) override;
bool SetValue(const std::wstring& wsValue, const std::vector<std::wstring>& arValiableValues, unsigned int unLevel, bool bHardMode);
bool SetValue(const std::wstring& wsValue, const std::map<std::wstring, std::wstring>& arValiableValues, unsigned int unLevel, bool bHardMode);
bool Empty() const override;
void Clear() override;
int ToInt() const override;
double ToDouble() const override;
std::wstring ToWString() const override;
CString& operator+=(const CString& oString);
bool operator==(const wchar_t* pValue) const;
bool operator!=(const wchar_t* pValue) const;
using CValueOptional<std::wstring>::operator=;
};
class CDigit : public CValue<double>
class CDigit : public CValueOptional<double>
{
UnitMeasure m_enUnitMeasure;
double ConvertValue(double dPrevValue, UnitMeasure enUnitMeasure) const;
public:
CDigit();
CDigit(double dValue);
CDigit(double dValue, unsigned int unLevel, bool bImportant = false);
CDigit(const double& dValue, unsigned int unLevel = 0, bool bImportant = false);
bool SetValue(const std::wstring& wsValue, unsigned int unLevel = 0, bool bHardMode = true) override;
bool SetValue(const CDigit& oValue);
bool SetValue(const double& dValue, unsigned int unLevel, bool bHardMode);
bool SetValue(const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel = 0, bool bHardMode = true);
bool Empty() const override;
bool Zero() const;
void Clear() override;
@ -156,7 +204,7 @@ namespace NSCSS
UnitMeasure GetUnitMeasure() const;
bool operator==(const double& oValue) const;
bool operator==(const double& dValue) const;
bool operator==(const CDigit& oDigit) const;
bool operator!=(const double& oValue) const;
@ -171,11 +219,19 @@ namespace NSCSS
CDigit& operator+=(const CDigit& oDigit);
CDigit& operator-=(const CDigit& oDigit);
CDigit& operator+=(double dValue);
CDigit& operator-=(double dValue);
CDigit& operator*=(double dValue);
CDigit& operator/=(double dValue);
CDigit& operator =(double dValue);
CDigit& operator+=(const double& dValue);
CDigit& operator-=(const double& dValue);
CDigit& operator*=(const double& dValue);
CDigit& operator/=(const double& dValue);
using CValueOptional<double>::operator=;
private:
UnitMeasure m_enUnitMeasure;
double ConvertValue(double dPrevValue, UnitMeasure enUnitMeasure) const;
template <typename Operation>
CDigit ApplyOperation(const CDigit& oDigit, Operation operation) const;
};
struct TRGB
@ -186,6 +242,8 @@ namespace NSCSS
bool Empty() const;
int ToInt() const;
bool operator==(const TRGB& oRGB) const;
bool operator!=(const TRGB& oRGB) const;
};
@ -211,31 +269,58 @@ namespace NSCSS
typedef enum
{
ColorEmpty,
ColorNone,
ColorRGB,
ColorHEX,
ColorUrl,
ColorContextStroke,
ColorContextFill
} ColorType;
} EColorType;
class CColor : public CValue<void*>
class CColorValue
{
using color_value = boost::variant2::variant<boost::blank, std::wstring, TRGB, CURL>;
protected:
EColorType m_eType;
public:
CColorValue();
CColorValue(const CColorValue& oValue);
CColorValue(const std::wstring& wsValue);
CColorValue(const TRGB& oValue);
CColorValue(const CURL& oValue);
EColorType GetType() const;
bool operator==(const CColorValue& oValue) const;
color_value m_oValue;
};
class CColorValueContextStroke : public CColorValue
{
public:
CColorValueContextStroke();
};
class CColorValueContextFill : public CColorValue
{
public:
CColorValueContextFill();
};
class CColor : public CValueOptional<CColorValue>
{
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);
bool Empty() const override;
bool None() const;
bool Url() const;
void Clear() override;
ColorType GetType() const;
EColorType GetType() const;
double GetOpacity() const;
@ -249,21 +334,15 @@ namespace NSCSS
static TRGB ConvertHEXtoRGB(const std::wstring& wsValue);
static std::wstring ConvertRGBtoHEX(const TRGB& oValue);
bool operator==(const CColor& oColor) const;
bool operator!=(const CColor& oColor) const;
CColor& operator =(const CColor& oColor);
CColor& operator+=(const CColor& oColor);
using CValueOptional<CColorValue>::operator=;
private:
CDigit m_oOpacity;
ColorType m_enType;
CDigit m_oOpacity;
void SetEmpty(unsigned int unLevel = 0);
void SetRGB(unsigned char uchR, unsigned char uchG, unsigned char uchB);
void SetRGB(const TRGB& oRGB);
void SetHEX(const std::wstring& wsValue);
void SetUrl(const std::wstring& wsValue);
void SetNone();
bool SetUrl(const std::wstring& wsValue);
};
typedef enum
@ -279,7 +358,7 @@ namespace NSCSS
typedef std::vector<std::pair<std::vector<double>, TransformType>> MatrixValues;
class CMatrix : public CValue<MatrixValues>
class CMatrix : public CValueBase<MatrixValues>
{
std::vector<std::wstring> CutTransforms(const std::wstring& wsValue) const;
public:
@ -302,29 +381,29 @@ namespace NSCSS
void ApplyTranform(Aggplus::CMatrix& oMatrix, Aggplus::MatrixOrder order = Aggplus::MatrixOrderPrepend) const;
bool operator==(const CMatrix& oMatrix) const;
CMatrix& operator+=(const CMatrix& oMatrix);
CMatrix& operator-=(const CMatrix& oMatrix);
using CValueBase<MatrixValues>::operator=;
};
class CEnum : public CValue<int>
class CEnum : public CValueOptional<int>
{
std::map<std::wstring, int> m_mMap;
public:
CEnum();
bool SetValue(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode) override;
void SetMapping(const std::map<std::wstring, int>& mMap, int nDefaulvalue = -1);
bool Empty() const override;
void Clear() override;
CEnum &operator =(int nValue);
bool operator==(int nValue) const;
bool operator!=(int nValue) const;
int ToInt() const override;
using CValueOptional<int>::operator=;
private:
double ToDouble() const override;
std::wstring ToWString() const override;
int m_nDefaultValue;
std::map<std::wstring, int> m_mMap;
};
// PROPERTIES
@ -371,6 +450,7 @@ namespace NSCSS
const CEnum& GetWhiteSpace() const;
bool Empty() const;
void Clear();
CDisplay& operator+=(const CDisplay& oDisplay);
bool operator==(const CDisplay& oDisplay) const;
@ -472,7 +552,7 @@ namespace NSCSS
bool SetValue(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidth(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidth(const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidth(const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetStyle(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColor(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
@ -524,7 +604,7 @@ namespace NSCSS
bool SetSides(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidth(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidth(const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidth(const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetStyle(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColor(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetCollapse(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
@ -532,28 +612,28 @@ namespace NSCSS
//Left Side
bool SetLeftSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthLeftSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthLeftSide (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthLeftSide (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetStyleLeftSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColorLeftSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
//Top Side
bool SetTopSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthTopSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthTopSide (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthTopSide (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetStyleTopSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColorTopSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
//Right Side
bool SetRightSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthRightSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthRightSide (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthRightSide (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetStyleRightSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColorRightSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
//Bottom Side
bool SetBottomSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthBottomSide(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthBottomSide(const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthBottomSide(const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetStyleBottomSide(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColorBottomSide(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
@ -616,6 +696,30 @@ namespace NSCSS
bool operator==(const TTextDecoration& oTextDecoration) const;
};
typedef enum
{
Baseline,
Sub,
Super,
Percentage,
Length
} EBaselineShift;
class CBaselineShift
{
CEnum m_eType;
CDigit m_oValue;
public:
CBaselineShift();
bool Empty() const;
EBaselineShift GetType() const;
double GetValue() const;
bool SetValue(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
};
class CText
{
public:
@ -623,11 +727,12 @@ namespace NSCSS
static void Equation(CText &oFirstText, CText &oSecondText);
bool SetIndent (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetAlign (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetDecoration(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColor (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetHighlight (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetIndent (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetAlign (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetDecoration (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColor (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetHighlight (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetBaselineShift (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
const CDigit& GetIndent() const;
const CString& GetAlign() const;
@ -635,6 +740,9 @@ namespace NSCSS
const CColor& GetColor() const;
const CColor& GetHighlight() const;
EBaselineShift GetBaselineShiftType() const;
double GetBaselineShiftValue() const;
bool Empty() const;
bool Underline() const;
@ -644,6 +752,7 @@ namespace NSCSS
CText& operator+=(const CText& oText);
bool operator==(const CText& oText) const;
private:
CBaselineShift m_oBaselineShift;
TTextDecoration m_oDecoration;
CDigit m_oIndent;
CString m_oAlign;
@ -666,13 +775,15 @@ namespace NSCSS
bool SetValues (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetTop (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetTop (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetRight (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetRight (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetBottom (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetBottom (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetLeft (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetLeft (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetValues (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetTop (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetRight (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetBottom (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetLeft (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
void UpdateAll (const double& dParentFontSize, const double& dCoreFontSize);
void UpdateTop (const double& dParentFontSize, const double& dCoreFontSize);
@ -685,6 +796,9 @@ namespace NSCSS
const CDigit& GetBottom() const;
const CDigit& GetLeft () const;
bool GetAfterAutospacing () const;
bool GetBeforeAutospacing() const;
bool Empty() const;
bool Zero() const;
@ -712,7 +826,7 @@ namespace NSCSS
bool SetValue (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetSize (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetSize (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetSize (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetLineHeight (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetFamily (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetStretch (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
@ -762,6 +876,12 @@ namespace NSCSS
bool SetFooter (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetHeader (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidth (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetHeight (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetMargin (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetFooter (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
bool SetHeader (const double& dValue, UnitMeasure enUnitMeasure, unsigned int unLevel, bool bHardMode = false);
const CDigit& GetWidth() const;
const CDigit& GetHeight() const;
const CIndent& GetMargin() const;

View File

@ -22,6 +22,11 @@ namespace NSCSS
: m_oStyle(oStyle), m_bIsPStyle(bIsPStyle)
{}
void CStyleUsed::SetFinalId(const std::wstring& wsFinalId)
{
m_wsFinalId = wsFinalId;
}
bool CheckArrays(const std::vector<std::wstring>& arInitial, const std::set<std::wstring>& arFirst, const std::set<std::wstring>& arSecond)
{
std::unordered_set<std::wstring> arInitialSet(arInitial.begin(), arInitial.end());
@ -57,19 +62,14 @@ namespace NSCSS
m_oStyle == oUsedStyle.m_oStyle;
}
std::wstring CStyleUsed::getId()
std::wstring CStyleUsed::GetId() const
{
if (m_bIsPStyle)
return m_oStyle.GetId();
return m_oStyle.GetId() + L"-c";
return m_wsFinalId;
}
CDocumentStyle::CDocumentStyle() : m_arStandardStyles(Names_Standard_Styles)
{
for (const std::wstring& oNameStandardStyle : Names_Standard_Styles)
m_arStandardStyles.push_back(oNameStandardStyle + L"-c");
}
CDocumentStyle::CDocumentStyle()
: m_arStandardStyles(Names_Standard_Styles)
{}
CDocumentStyle::~CDocumentStyle()
{
@ -85,7 +85,7 @@ namespace NSCSS
std::wstring CDocumentStyle::GetIdAndClear()
{
std::wstring sId = m_sId;
const std::wstring sId = m_sId;
Clear();
return sId;
}
@ -110,10 +110,10 @@ namespace NSCSS
m_sId = sId;
}
void CDocumentStyle::CombineStandardStyles(const std::vector<std::wstring>& arStandartedStyles, CXmlElement& oElement)
bool CDocumentStyle::CombineStandardStyles(const std::vector<std::wstring>& arStandartedStyles, CXmlElement& oElement)
{
if (arStandartedStyles.empty())
return;
return false;
std::vector<std::wstring> arStyles;
for (const std::wstring& sStyleName : arStandartedStyles)
@ -123,7 +123,7 @@ namespace NSCSS
}
if (arStyles.empty())
return;
return false;
std::wstring sId;
for (std::vector<std::wstring>::const_reverse_iterator iStyleName = arStyles.rbegin(); iStyleName != arStyles.rend(); ++iStyleName)
@ -142,18 +142,25 @@ namespace NSCSS
oElement.AddBasicProperties(BProperties::B_Name, sId);
oElement.AddBasicProperties(BProperties::B_StyleId, sId);
return true;
}
void CDocumentStyle::CreateStandardStyle(const std::wstring& sNameStyle, CXmlElement& oElement)
bool CDocumentStyle::CreateStandardStyle(const std::wstring& sNameStyle, CXmlElement& oElement)
{
if (std::find(m_arStandardStyles.begin(), m_arStandardStyles.end(), sNameStyle) != m_arStandardStyles.end())
{
oElement.CreateDefaultElement(sNameStyle);
return true;
}
return false;
}
void CDocumentStyle::ConvertStyle(const NSCSS::CCompiledStyle& oStyle, CXmlElement& oElement, bool bIsPStyle)
bool CDocumentStyle::ConvertStyle(const NSCSS::CCompiledStyle& oStyle, CXmlElement& oElement, bool bIsPStyle)
{
if (oStyle.GetId().empty())
return;
return false;
std::wstring sName = oStyle.GetId();
const size_t posPoint = sName.find(L'.');
@ -183,25 +190,25 @@ namespace NSCSS
for (std::wstring& sParentName : arParentsName)
sParentName += L"-c";
bool bResult{false};
if (!arParentsName.empty())
{
CombineStandardStyles(arParentsName, oParentStyle);
bResult = CombineStandardStyles(arParentsName, oParentStyle);
if (!oParentStyle.Empty())
{
oParentStyle.AddBasicProperties(BProperties::B_BasedOn, L"normal");
oParentStyle.AddBasicProperties(BProperties::B_StyleId, L"(" + oParentStyle.GetStyleId() + L")");
oParentStyle.AddBasicProperties(BProperties::B_StyleId, oParentStyle.GetStyleId());
if (!bIsPStyle)
{
oParentStyle.AddBasicProperties(BProperties::B_StyleId, oParentStyle.GetStyleId() + L"-c");
oParentStyle.AddBasicProperties(BProperties::B_Type, L"character");
}
}
}
CXmlElement oStandardXmlElement;
if (std::find(m_arStandardStyles.begin(), m_arStandardStyles.end(), sName) != m_arStandardStyles.end())
CreateStandardStyle(sName, oStandardXmlElement);
if (CreateStandardStyle(sName, oStandardXmlElement))
bResult = true;
if (oStandardXmlElement.Empty() && !oParentStyle.Empty())
{
@ -221,7 +228,7 @@ namespace NSCSS
if (oStyle.Empty())
{
m_sId = sParentsStyleID;
return;
return true;
}
oElement.AddBasicProperties(BProperties::B_BasedOn, sParentsStyleID);
@ -234,7 +241,7 @@ namespace NSCSS
if (oStyle.Empty())
{
m_sId = sStandPlusParent;
return;
return true;
}
oElement.AddBasicProperties(BProperties::B_BasedOn, sStandPlusParent);
}
@ -258,7 +265,7 @@ namespace NSCSS
if (oStyle.Empty())
{
m_sId = sStandPlusParent;
return;
return true;
}
oElement.AddBasicProperties(BProperties::B_BasedOn, oTempElement.GetStyleId());
}
@ -281,7 +288,7 @@ namespace NSCSS
if (oStyle.Empty())
{
m_sId = sStandartStyleID;
return;
return true;
}
oElement.AddBasicProperties(BProperties::B_BasedOn, sStandartStyleID);
}
@ -289,7 +296,7 @@ namespace NSCSS
if (oStyle.Empty() && oElement.Empty())
{
m_sId = L"normal";
return;
return true;
}
m_sId = oStyle.GetId();
@ -302,15 +309,19 @@ namespace NSCSS
oElement.AddBasicProperties(BProperties::B_Name, m_sId);
oElement.AddBasicProperties(BProperties::B_Type, bIsPStyle ? L"paragraph" : L"character");
oElement.AddBasicProperties(BProperties::B_CustomStyle, L"1");
return bResult;
}
void CDocumentStyle::SetPStyle (const NSCSS::CCompiledStyle& oStyle, CXmlElement& oXmlElement, bool bIsLite)
bool CDocumentStyle::SetPStyle(const NSCSS::CCompiledStyle& oStyle, CXmlElement& oXmlElement, bool bIsLite)
{
bool bResult{false};
if (!bIsLite)
ConvertStyle(oStyle, oXmlElement, true);
bResult = ConvertStyle(oStyle, oXmlElement, true);
if (oStyle.Empty())
return;
return bResult;
const bool bInTable{oStyle.HaveThisParent(L"table")};
@ -341,14 +352,14 @@ namespace NSCSS
sSpacingValue.reserve(128);
if (!oStyle.m_oMargin.GetTop().Empty() && !oStyle.m_oMargin.GetTop().Zero())
sSpacingValue += L"w:before=\"" + std::to_wstring(VALUE_TO_INT(oStyle.m_oMargin.GetTop(), NSCSS::Twips)) + L"\" w:beforeAutospacing=\"0\"";
sSpacingValue += L"w:before=\"" + std::to_wstring(VALUE_TO_INT(oStyle.m_oMargin.GetTop(), NSCSS::Twips)) + L"\" w:beforeAutospacing=\"1\"";
else if (oStyle.m_oMargin.GetBottom().Zero() || bInTable)
sSpacingValue += L"w:before=\"0\" w:beforeAutospacing=\"0\"";
sSpacingValue += L"w:before=\"0\" w:beforeAutospacing=\"1\"";
if (!oStyle.m_oMargin.GetBottom().Empty() && !oStyle.m_oMargin.GetBottom().Zero())
sSpacingValue += L" w:after=\"" + std::to_wstring(VALUE_TO_INT(oStyle.m_oMargin.GetBottom(), NSCSS::Twips)) + L"\" w:afterAutospacing=\"0\"";
sSpacingValue += L" w:after=\"" + std::to_wstring(VALUE_TO_INT(oStyle.m_oMargin.GetBottom(), NSCSS::Twips)) + L"\" w:afterAutospacing=\"1\"";
else if (oStyle.m_oMargin.GetBottom().Zero() || bInTable)
sSpacingValue += L" w:after=\"0\" w:afterAutospacing=\"0\"";
sSpacingValue += L" w:after=\"0\" w:afterAutospacing=\"1\"";
if (!oStyle.m_oFont.GetLineHeight().Empty() && !oStyle.m_oFont.GetLineHeight().Zero())
{
@ -390,6 +401,8 @@ namespace NSCSS
SetBorderStyle(oStyle, oXmlElement, PProperties::P_LeftBorder);
}
}
return bResult || !oXmlElement.Empty();
}
void CDocumentStyle::SetBorderStyle(const CCompiledStyle &oStyle, CXmlElement &oXmlElement, const PProperties &enBorderProperty)
@ -473,13 +486,15 @@ namespace NSCSS
return L"w:val=\"" + wsStyle + L"\" w:sz=\"" + std::to_wstring(nWidth) + + L"\" w:space=\"" + std::to_wstring(nSpace) + L"\" w:color=\"" + wsColor + L"\"";
}
void CDocumentStyle::SetRStyle(const NSCSS::CCompiledStyle& oStyle, CXmlElement& oXmlElement, bool bIsLite)
bool CDocumentStyle::SetRStyle(const NSCSS::CCompiledStyle& oStyle, CXmlElement& oXmlElement, bool bIsLite)
{
bool bResult{false};
if (!bIsLite)
ConvertStyle(oStyle, oXmlElement, false);
bResult = ConvertStyle(oStyle, oXmlElement, false);
if (oStyle.Empty() && oXmlElement.Empty())
return;
return bResult;
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. * oStyle.m_oTransform.GetMatrix().GetFinalValue().sy() + 0.5))); // Значения шрифта увеличивает на 2
@ -509,10 +524,25 @@ namespace NSCSS
else if (L"serif" == wsFontFamily)
wsFontFamily = L"Times New Roman";
if (oStyle.m_oDisplay.GetDisplay() == L"none")
oXmlElement.AddPropertiesInR(RProperties::R_Vanish, L"true");
oXmlElement.AddPropertiesInR(RProperties::R_RFonts, oStyle.m_oFont.GetFamily().ToWString());
oXmlElement.AddPropertiesInR(RProperties::R_I, oStyle.m_oFont.GetStyle().ToWString());
oXmlElement.AddPropertiesInR(RProperties::R_B, oStyle.m_oFont.GetWeight().ToWString());
oXmlElement.AddPropertiesInR(RProperties::R_SmallCaps, oStyle.m_oFont.GetVariant().ToWString());
if (oStyle.m_oText.LineThrough())
{
if (L"double" == oStyle.m_oText.GetDecoration().m_oStyle.ToWString())
oXmlElement.AddPropertiesInR(RProperties::R_Strike, L"dstrike");
else
oXmlElement.AddPropertiesInR(RProperties::R_Strike, L"strike");
}
oXmlElement.AddPropertiesInR(RProperties::R_VertAlign, oStyle.m_oDisplay.GetVAlign().ToWString());
return bResult || !oXmlElement.Empty();
}
bool CDocumentStyle::WriteRStyle(const NSCSS::CCompiledStyle& oStyle)
@ -528,16 +558,16 @@ namespace NSCSS
if (oItem != m_arStyleUsed.end())
{
m_sId = (*oItem).getId();
m_sId = (*oItem).GetId();
return true;
}
CXmlElement oXmlElement;
SetRStyle(oStyle, oXmlElement);
if (oXmlElement.Empty())
if (!SetRStyle(oStyle, oXmlElement))
return false;
structStyle.SetFinalId(m_sId);
m_arStyleUsed.push_back(structStyle);
m_sStyle += oXmlElement.GetRStyle();
@ -590,16 +620,16 @@ namespace NSCSS
if (oItem != m_arStyleUsed.end())
{
m_sId = (*oItem).getId();
m_sId = (*oItem).GetId();
return true;
}
CXmlElement oXmlElement;
SetPStyle(oStyle, oXmlElement);
if (oXmlElement.Empty())
if (!SetPStyle(oStyle, oXmlElement))
return false;
structStyle.SetFinalId(m_sId);
m_arStyleUsed.push_back(structStyle);
m_sStyle += oXmlElement.GetPStyle();

View File

@ -12,16 +12,19 @@ namespace NSCSS
{
CCompiledStyle m_oStyle;
bool m_bIsPStyle;
std::wstring m_wsFinalId;
public:
CStyleUsed(const CCompiledStyle& oStyle, bool bIsPStyle);
void SetFinalId(const std::wstring& wsFinalId);
bool operator==(const CStyleUsed& oUsedStyle) const;
std::wstring getId();
std::wstring GetId() const;
};
static const std::vector<std::wstring> Names_Standard_Styles = {L"a", L"li", L"h1", L"h2", L"h3", L"h4", L"h5", L"h6",L"p", L"div"};
static const std::vector<std::wstring> Names_Standard_Styles = {L"a", L"a-c", L"li", L"h1", L"h2", L"h3", L"h4", L"h5", L"h6", L"h1-c", L"h2-c", L"h3-c", L"h4-c", L"h5-c", L"h6-c"};
class CSSCALCULATOR_EXPORT CDocumentStyle
{
@ -36,12 +39,12 @@ namespace NSCSS
std::wstring m_sStyle;
std::wstring m_sId;
void CombineStandardStyles(const std::vector<std::wstring>& arStandartedStyles, CXmlElement& oElement);
void CreateStandardStyle (const std::wstring& sNameStyle, CXmlElement& oElement);
void ConvertStyle (const NSCSS::CCompiledStyle& oStyle, CXmlElement& oElement, bool bIsPStyle);
bool CombineStandardStyles(const std::vector<std::wstring>& arStandartedStyles, CXmlElement& oElement);
bool CreateStandardStyle (const std::wstring& sNameStyle, CXmlElement& oElement);
bool ConvertStyle (const NSCSS::CCompiledStyle& oStyle, CXmlElement& oElement, bool bIsPStyle);
void SetRStyle(const NSCSS::CCompiledStyle& oStyle, CXmlElement& oXmlElement, bool bIsLite = false);
void SetPStyle(const NSCSS::CCompiledStyle& oStyle, CXmlElement& oXmlElement, bool bIsLite = false);
bool SetRStyle(const NSCSS::CCompiledStyle& oStyle, CXmlElement& oXmlElement, bool bIsLite = false);
bool SetPStyle(const NSCSS::CCompiledStyle& oStyle, CXmlElement& oXmlElement, bool bIsLite = false);
void SetBorderStyle(const NSCSS::CCompiledStyle& oStyle, CXmlElement& oXmlElement, const PProperties& enBorderProperty);
public:

View File

@ -5,7 +5,6 @@
#include <cwctype>
#include <functional>
#include <iostream>
#include "../ConstValues.h"
#define DEFAULTFONTNAME L"Times New Roman"
@ -67,7 +66,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
AddBasicProperties(CSSProperties::BasicProperties::B_Link, L"h1-c");
AddPropertiesInP(CSSProperties::ParagraphProperties::P_OutlineLvl, L"0");
// AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
}
else if (sNameDefaultElement == L"h2")
{
@ -78,7 +77,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
AddBasicProperties(CSSProperties::BasicProperties::B_Link, L"h2-c");
AddPropertiesInP(CSSProperties::ParagraphProperties::P_OutlineLvl, L"1");
// AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
}
else if (sNameDefaultElement == L"h3")
{
@ -89,7 +88,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
AddBasicProperties(CSSProperties::BasicProperties::B_Link, L"h3-c");
AddPropertiesInP(CSSProperties::ParagraphProperties::P_OutlineLvl, L"2");
// AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
}
else if (sNameDefaultElement == L"h4")
{
@ -100,7 +99,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
AddBasicProperties(CSSProperties::BasicProperties::B_Link, L"h4-c");
AddPropertiesInP(CSSProperties::ParagraphProperties::P_OutlineLvl, L"3");
// AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
}
else if (sNameDefaultElement == L"h5")
{
@ -111,7 +110,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
AddBasicProperties(CSSProperties::BasicProperties::B_Link, L"h5-c");
AddPropertiesInP(CSSProperties::ParagraphProperties::P_OutlineLvl, L"4");
// AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
}
else if (sNameDefaultElement == L"h6")
@ -123,13 +122,13 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
AddBasicProperties(CSSProperties::BasicProperties::B_Link, L"h6-c");
AddPropertiesInP(CSSProperties::ParagraphProperties::P_OutlineLvl, L"5");
// AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
}
else if (sNameDefaultElement == L"h1-c")
{
AddBasicProperties(CSSProperties::BasicProperties::B_Type, L"character");
AddBasicProperties(CSSProperties::BasicProperties::B_StyleId, L"h1-c");
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Title 1 Sign");
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Heading 1 Sign");
AddBasicProperties(CSSProperties::BasicProperties::B_CustomStyle, L"1");
AddBasicProperties(CSSProperties::BasicProperties::B_UiPriority, L"9");
AddBasicProperties(CSSProperties::BasicProperties::B_Link, L"h1");
@ -142,7 +141,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
{
AddBasicProperties(CSSProperties::BasicProperties::B_Type, L"character");
AddBasicProperties(CSSProperties::BasicProperties::B_StyleId, L"h2-c");
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Title 2 Sign");
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Heading 2 Sign");
AddBasicProperties(CSSProperties::BasicProperties::B_CustomStyle, L"1");
AddBasicProperties(CSSProperties::BasicProperties::B_UiPriority, L"9");
AddBasicProperties(CSSProperties::BasicProperties::B_UnhideWhenUsed, L"true");
@ -155,7 +154,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
{
AddBasicProperties(CSSProperties::BasicProperties::B_Type, L"character");
AddBasicProperties(CSSProperties::BasicProperties::B_StyleId, L"h3-c");
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Title 3 Sign");
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Heading 3 Sign");
AddBasicProperties(CSSProperties::BasicProperties::B_CustomStyle, L"1");
AddBasicProperties(CSSProperties::BasicProperties::B_UiPriority, L"9");
AddBasicProperties(CSSProperties::BasicProperties::B_UnhideWhenUsed, L"true");
@ -168,7 +167,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
{
AddBasicProperties(CSSProperties::BasicProperties::B_Type, L"character");
AddBasicProperties(CSSProperties::BasicProperties::B_StyleId, L"h4-c");
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Title 4 Sign");
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Heading 4 Sign");
AddBasicProperties(CSSProperties::BasicProperties::B_CustomStyle, L"1");
AddBasicProperties(CSSProperties::BasicProperties::B_UiPriority, L"9");
AddBasicProperties(CSSProperties::BasicProperties::B_UnhideWhenUsed, L"true");
@ -181,7 +180,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
{
AddBasicProperties(CSSProperties::BasicProperties::B_Type, L"character");
AddBasicProperties(CSSProperties::BasicProperties::B_StyleId, L"h5-c");
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Title 5 Sign");
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Heading 5 Sign");
AddBasicProperties(CSSProperties::BasicProperties::B_CustomStyle, L"1");
AddBasicProperties(CSSProperties::BasicProperties::B_UiPriority, L"9");
AddBasicProperties(CSSProperties::BasicProperties::B_UnhideWhenUsed, L"true");
@ -194,7 +193,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
{
AddBasicProperties(CSSProperties::BasicProperties::B_Type, L"character");
AddBasicProperties(CSSProperties::BasicProperties::B_StyleId, L"h6-c");
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Title 6 Sign");
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Heading 6 Sign");
AddBasicProperties(CSSProperties::BasicProperties::B_CustomStyle, L"1");
AddBasicProperties(CSSProperties::BasicProperties::B_UiPriority, L"9");
AddBasicProperties(CSSProperties::BasicProperties::B_UnhideWhenUsed, L"true");
@ -473,6 +472,25 @@ std::wstring CXmlElement::ConvertRStyle(bool bIsLite) const
sRStyle += L"<w:kern w:val=\"" + oItem.second + L"\"/>";
break;
}
case CSSProperties::RunnerProperties::R_Vanish:
{
if (oItem.second == L"true")
sRStyle += L"<w:vanish/>";
break;
}
case CSSProperties::RunnerProperties::R_Strike:
{
sRStyle += L"<w:" + oItem.second + L"/>";
break;
}
case CSSProperties::RunnerProperties::R_VertAlign:
{
if (L"top" == oItem.second)
sRStyle += L"<w:vertAlign w:val=\"superscript\"/>";
else if (L"bottom" == oItem.second)
sRStyle += L"<w:vertAlign w:val=\"subscript\"/>";
break;
}
default:
break;
}

View File

@ -7,4 +7,5 @@ core_windows:INCLUDEPATH += $$PWD/gumbo-parser/visualc/include
HEADERS += $$files($$PWD/gumbo-parser/src/*.h, true) \
$$PWD/htmltoxhtml.h
SOURCES += $$files($$PWD/gumbo-parser/src/*.c, true)
SOURCES += $$files($$PWD/gumbo-parser/src/*.c, true) \
$$PWD/htmltoxhtml.cpp

View File

@ -0,0 +1,657 @@
#include "htmltoxhtml.h"
#include <map>
#include <cctype>
#include <vector>
#include <algorithm>
#include "gumbo-parser/src/gumbo.h"
#include "../../../DesktopEditor/common/File.h"
#include "../../../DesktopEditor/common/Directory.h"
#include "../../../DesktopEditor/common/StringBuilder.h"
#include "../../../UnicodeConverter/UnicodeConverter.h"
#include "../../../HtmlFile2/src/StringFinder.h"
namespace HTML
{
#if defined(CreateDirectory)
#undef CreateDirectory
#endif
static std::string nonbreaking_inline = "|a|abbr|acronym|b|bdo|big|cite|code|dfn|em|font|i|img|kbd|nobr|s|small|span|strike|strong|sub|sup|tt|";
static std::string empty_tags = "|area|base|basefont|bgsound|br|command|col|embed|event-source|frame|hr|image|img|input|keygen|link|menuitem|meta|param|source|spacer|track|wbr|";
static std::string preserve_whitespace = "|pre|textarea|script|style|";
static std::string special_handling = "|html|body|";
static std::string treat_like_inline = "|p|";
static std::vector<std::string> html_tags = {"div","span","a","img","p","h1","h2","h3","h4","h5","h6",
"ul", "ol", "li","td","tr","table","thead","tbody","tfoot","th",
"br","form","input","button","section","nav","header","footer",
"main","figure","figcaption","strong","em","i", "b", "u","pre",
"code","blockquote","hr","script","link","meta","style","title",
"head","body","html","legend","optgroup","option","select","dl",
"dt","dd","time","data","abbr","address","area","base","bdi",
"bdo","cite","col","iframe","video","source","track","textarea",
"label","fieldset","colgroup","del","ins","details","summary",
"dialog","embed","kbd","map","mark","menu","meter","object",
"output","param","progress","q","samp","small","sub","sup","var",
"wbr","acronym","applet","article","aside","audio","basefont",
"bgsound","big","blink","canvas","caption","center","command",
"comment","datalist","dfn","dir","font","frame","frameset",
"hgroup","isindex","keygen","marquee","nobr","noembed","noframes",
"noscript","plaintext","rp","rt","ruby","s","strike","tt","xmp"};
static std::vector<std::string> unchecked_nodes_new = {"svg"};
static void replace_all(std::string& s, const std::string& s1, const std::string& s2)
{
size_t pos = s.find(s1);
while(pos != std::string::npos)
{
s.replace(pos, s1.length(), s2);
pos = s.find(s1, pos + s2.length());
}
}
static bool NodeIsUnprocessed(const std::string& sTagName)
{
return "xml" == sTagName;
}
static bool IsUnckeckedNodes(const std::string& sValue)
{
return unchecked_nodes_new.end() != std::find(unchecked_nodes_new.begin(), unchecked_nodes_new.end(), sValue);
}
static std::string Base64ToString(const std::string& sContent, const std::string& sCharset)
{
std::string sRes;
int nSrcLen = (int)sContent.length();
int nDecodeLen = NSBase64::Base64DecodeGetRequiredLength(nSrcLen);
BYTE* pData = new BYTE[nDecodeLen];
if (TRUE == NSBase64::Base64Decode(sContent.c_str(), nSrcLen, pData, &nDecodeLen))
{
std::wstring sConvert;
if(!sCharset.empty() && NSStringFinder::Equals<std::string>("utf-8", sCharset))
{
NSUnicodeConverter::CUnicodeConverter oConverter;
sConvert = oConverter.toUnicode(reinterpret_cast<char *>(pData), (unsigned)nDecodeLen, sCharset.data());
}
sRes = sConvert.empty() ? std::string(reinterpret_cast<char *>(pData), nDecodeLen) : U_TO_UTF8(sConvert);
}
RELEASEARRAYOBJECTS(pData);
return sRes;
}
static std::string QuotedPrintableDecode(const std::string& sContent, std::string& sCharset)
{
NSStringUtils::CStringBuilderA sRes;
size_t ip = 0;
size_t i = sContent.find('=');
if(i == 0)
{
size_t nIgnore = 12;
std::string charset = sContent.substr(0, nIgnore);
if(charset == "=00=00=FE=FF")
sCharset = "UTF-32BE";
else if(charset == "=FF=FE=00=00")
sCharset = "UTF-32LE";
else if(charset == "=2B=2F=76=38" || charset == "=2B=2F=76=39" ||
charset == "=2B=2F=76=2B" || charset == "=2B=2F=76=2F")
sCharset = "UTF-7";
else if(charset == "=DD=73=66=73")
sCharset = "UTF-EBCDIC";
else if(charset == "=84=31=95=33")
sCharset = "GB-18030";
else
{
nIgnore -= 3;
charset.erase(nIgnore);
if(charset == "=EF=BB=BF")
sCharset = "UTF-8";
else if(charset == "=F7=64=4C")
sCharset = "UTF-1";
else if(charset == "=0E=FE=FF")
sCharset = "SCSU";
else if(charset == "=FB=EE=28")
sCharset = "BOCU-1";
else
{
nIgnore -= 3;
charset.erase(nIgnore);
if(charset == "=FE=FF")
sCharset = "UTF-16BE";
else if(charset == "=FF=FE")
sCharset = "UTF-16LE";
else
nIgnore -= 6;
}
}
ip = nIgnore;
i = sContent.find('=', ip);
}
while(i != std::string::npos && i + 2 < sContent.length())
{
sRes.WriteString(sContent.c_str() + ip, i - ip);
std::string str = sContent.substr(i + 1, 2);
if(str.front() == '\n' || str.front() == '\r')
{
char ch = str[1];
if(ch != '\n' && ch != '\r')
sRes.WriteString(&ch, 1);
}
else
{
char* err;
char ch = (int)strtol(str.data(), &err, 16);
if(*err)
sRes.WriteString('=' + str);
else
sRes.WriteString(&ch, 1);
}
ip = i + 3;
i = sContent.find('=', ip);
}
if(ip != std::string::npos)
sRes.WriteString(sContent.c_str() + ip);
return sRes.GetData();
}
static std::string mhtTohtml(const std::string& sFileContent);
static void ReadMht(const std::string& sMhtContent, std::map<std::string, std::string>& sRes, NSStringUtils::CStringBuilderA& oRes)
{
size_t unContentPosition = 0, unCharsetBegin = 0, unCharsetEnd = std::string::npos;
NSStringFinder::TFoundedData<char> oData;
// Content-Type
oData = NSStringFinder::FindProperty(sMhtContent, "content-type", {":"}, {";", "\\n", "\\r"});
const std::string sContentType{oData.m_sValue};
if (sContentType.empty())
return;
if (NSStringFinder::Equals(sContentType, "multipart/alternative"))
{
oRes.WriteString(mhtTohtml(sMhtContent.substr(oData.m_unEndPosition, sMhtContent.length() - oData.m_unEndPosition)));
return;
}
unContentPosition = std::max(unContentPosition, oData.m_unEndPosition);
unCharsetBegin = oData.m_unEndPosition;
// name
// std::string sName = NSStringFinder::FindProperty(sMhtContent, "name", {"="}, {";", "\\n", "\\r"}, 0, unLastPosition);
// unContentPosition = std::max(unContentPosition, unLastPosition);
// Content-Location
oData = NSStringFinder::FindProperty(sMhtContent, "content-location", {":"}, {";", "\\n", "\\r"});
std::string sContentLocation{oData.m_sValue};
if (!oData.Empty())
unContentPosition = std::max(unContentPosition, oData.m_unEndPosition);
// Content-ID
oData = NSStringFinder::FindProperty(sMhtContent, "content-id", {":"}, {";", "\\n", "\\r"});
std::string sContentID{oData.m_sValue};
if (!oData.Empty())
{
unContentPosition = std::max(unContentPosition, oData.m_unEndPosition);
unCharsetEnd = std::min(unCharsetEnd, oData.m_unBeginPosition);
NSStringFinder::CutInside<std::string>(sContentID, "<", ">");
}
if (sContentLocation.empty() && !sContentID.empty())
sContentLocation = "cid:" + sContentID;
// Content-Transfer-Encoding
oData = NSStringFinder::FindProperty(sMhtContent, "content-transfer-encoding", {":"}, {";", "\\n", "\\r"});
const std::string sContentEncoding{oData.m_sValue};
if (!oData.Empty())
{
unContentPosition = std::max(unContentPosition, oData.m_unEndPosition);
unCharsetEnd = std::min(unCharsetEnd, oData.m_unBeginPosition);
}
// charset
std::string sCharset = "utf-8";
if (std::string::npos != unCharsetEnd && unCharsetBegin < unCharsetEnd)
{
sCharset = NSStringFinder::FindProperty(sMhtContent.substr(unCharsetBegin, unCharsetEnd - unCharsetBegin), "charset", {"="}, {";", "\\n", "\\r"}).m_sValue;
NSStringFinder::CutInside<std::string>(sCharset, "\"");
}
// Content
std::string sContent = sMhtContent.substr(unContentPosition, sMhtContent.length() - unContentPosition);
// std::wstring sExtention = NSFile::GetFileExtention(UTF8_TO_U(sName));
// std::transform(sExtention.begin(), sExtention.end(), sExtention.begin(), tolower);
// Основной документ
if (NSStringFinder::Equals(sContentType, "multipart/alternative"))
oRes.WriteString(mhtTohtml(sContent));
else if ((NSStringFinder::Find(sContentType, "text") /*&& (sExtention.empty() || NSStringFinder::EqualOf(sExtention, {L"htm", L"html", L"xhtml", L"css"}))*/)
|| (NSStringFinder::Equals(sContentType, "application/octet-stream") && NSStringFinder::Find(sContentLocation, "css")))
{
// Стили заключаются в тэг <style>
const bool bAddTagStyle = NSStringFinder::Equals(sContentType, "text/css") /*|| NSStringFinder::Equals(sExtention, L"css")*/ || NSStringFinder::Find(sContentLocation, "css");
if (bAddTagStyle)
oRes.WriteString("<style>");
if (NSStringFinder::Equals(sContentEncoding, "base64"))
sContent = Base64ToString(sContent, sCharset);
else if (NSStringFinder::EqualOf(sContentEncoding, {"8bit", "7bit"}) || sContentEncoding.empty())
{
if (!NSStringFinder::Equals(sCharset, "utf-8") && !sCharset.empty())
{
NSUnicodeConverter::CUnicodeConverter oConverter;
sContent = U_TO_UTF8(oConverter.toUnicode(sContent, sCharset.data()));
}
}
else if (NSStringFinder::Equals(sContentEncoding, "quoted-printable"))
{
sContent = QuotedPrintableDecode(sContent, sCharset);
if (!NSStringFinder::Equals(sCharset, "utf-8") && !sCharset.empty())
{
NSUnicodeConverter::CUnicodeConverter oConverter;
sContent = U_TO_UTF8(oConverter.toUnicode(sContent, sCharset.data()));
}
}
if (NSStringFinder::Equals(sContentType, "text/html"))
sContent = U_TO_UTF8(htmlToXhtml(sContent, false));
oRes.WriteString(sContent);
if(bAddTagStyle)
oRes.WriteString("</style>");
}
// Картинки
else if ((NSStringFinder::Find(sContentType, "image") /*|| NSStringFinder::Equals(sExtention, L"gif")*/ || NSStringFinder::Equals(sContentType, "application/octet-stream")) &&
NSStringFinder::Equals(sContentEncoding, "base64"))
{
// if (NSStringFinder::Equals(sExtention, L"ico") || NSStringFinder::Find(sContentType, "ico"))
// sContentType = "image/jpg";
// else if(NSStringFinder::Equals(sExtention, L"gif"))
// sContentType = "image/gif";
int nSrcLen = (int)sContent.length();
int nDecodeLen = NSBase64::Base64DecodeGetRequiredLength(nSrcLen);
BYTE* pData = new BYTE[nDecodeLen];
if (TRUE == NSBase64::Base64Decode(sContent.c_str(), nSrcLen, pData, &nDecodeLen))
sRes.insert(std::make_pair(sContentLocation, "data:" + sContentType + ";base64," + sContent));
RELEASEARRAYOBJECTS(pData);
}
}
static std::string mhtTohtml(const std::string& sFileContent)
{
std::map<std::string, std::string> sRes;
NSStringUtils::CStringBuilderA oRes;
// Поиск boundary
NSStringFinder::TFoundedData<char> oData{NSStringFinder::FindProperty(sFileContent, "boundary", {"="}, {"\\r", "\\n", "\""})};
size_t nFound{oData.m_unEndPosition};
std::string sBoundary{oData.m_sValue};
if (sBoundary.empty())
{
size_t nFoundEnd = sFileContent.length();
nFound = 0;
ReadMht(sFileContent.substr(nFound, nFoundEnd), sRes, oRes);
return oRes.GetData();
}
NSStringFinder::CutInside<std::string>(sBoundary, "\"");
size_t nFoundEnd{nFound};
sBoundary = "--" + sBoundary;
size_t nBoundaryLength = sBoundary.length();
nFound = sFileContent.find(sBoundary, nFound) + nBoundaryLength;
// Цикл по boundary
while(nFound != std::string::npos)
{
nFoundEnd = sFileContent.find(sBoundary, nFound + nBoundaryLength);
if(nFoundEnd == std::string::npos)
break;
ReadMht(sFileContent.substr(nFound, nFoundEnd - nFound), sRes, oRes);
nFound = sFileContent.find(sBoundary, nFoundEnd);
}
std::string sFile = oRes.GetData();
for(const std::pair<std::string, std::string>& item : sRes)
{
std::string sName = item.first;
size_t found = sFile.find(sName);
size_t sfound = sName.rfind('/');
if(found == std::string::npos && sfound != std::string::npos)
found = sFile.find(sName.erase(0, sfound + 1));
while(found != std::string::npos)
{
size_t fq = sFile.find_last_of("\"\'>=", found);
if (std::string::npos == fq)
break;
char ch = sFile[fq];
if(ch != '\"' && ch != '\'')
fq++;
size_t tq = sFile.find_first_of("\"\'<> ", found) + 1;
if (std::string::npos == tq)
break;
if(sFile[tq] != '\"' && sFile[tq] != '\'')
tq--;
if(ch != '>')
{
std::string is = '\"' + item.second + '\"';
sFile.replace(fq, tq - fq, is);
found = sFile.find(sName, fq + is.length());
}
else
found = sFile.find(sName, tq);
}
}
return sFile;
}
// Заменяет сущности &,<,> в text
static void substitute_xml_entities_into_text(std::string& text)
{
// replacing & must come first
replace_all(text, "&", "&amp;");
replace_all(text, "<", "&lt;");
replace_all(text, ">", "&gt;");
}
// After running through Gumbo, the values of type "&#1;" are replaced with the corresponding code '0x01'
// Since the attribute value does not use control characters (value <= 0x09),
// then just delete them, otherwise XmlUtils::CXmlLiteReader crashes on them.
// bug#73486
static void remove_control_symbols(std::string& text)
{
std::string::iterator itFound = std::find_if(text.begin(), text.end(), [](unsigned char chValue){ return chValue <= 0x09; });
while (itFound != text.end())
{
itFound = text.erase(itFound);
itFound = std::find_if(itFound, text.end(), [](unsigned char chValue){ return chValue <= 0x09; });
}
}
// Заменяет сущности " в text
static void substitute_xml_entities_into_attributes(std::string& text)
{
remove_control_symbols(text);
substitute_xml_entities_into_text(text);
replace_all(text, "\"", "&quot;");
}
static std::string handle_unknown_tag(GumboStringPiece* text)
{
if (text->data == NULL)
return "";
GumboStringPiece gsp = *text;
gumbo_tag_from_original_text(&gsp);
std::string sAtr = std::string(gsp.data, gsp.length);
size_t found = sAtr.find_first_of("-'+,./=?;!*#@$_%<>&;\"\'()[]{}");
while(found != std::string::npos)
{
sAtr.erase(found, 1);
found = sAtr.find_first_of("-'+,./=?;!*#@$_%<>&;\"\'()[]{}", found);
}
return sAtr;
}
static std::string get_tag_name(GumboNode* node)
{
std::string tagname = (node->type == GUMBO_NODE_DOCUMENT ? "document" : gumbo_normalized_tagname(node->v.element.tag));
if (tagname.empty())
tagname = handle_unknown_tag(&node->v.element.original_tag);
return tagname;
}
static void build_doctype(GumboNode* node, NSStringUtils::CStringBuilderA& oBuilder)
{
if (node->v.document.has_doctype)
{
oBuilder.WriteString("<!DOCTYPE ");
oBuilder.WriteString(node->v.document.name);
std::string pi(node->v.document.public_identifier);
remove_control_symbols(pi);
if ((node->v.document.public_identifier != NULL) && !pi.empty())
{
oBuilder.WriteString(" PUBLIC \"");
oBuilder.WriteString(pi);
oBuilder.WriteString("\" \"");
oBuilder.WriteString(node->v.document.system_identifier);
oBuilder.WriteString("\"");
}
oBuilder.WriteString(">");
}
}
static void build_attributes(const GumboVector* attribs, NSStringUtils::CStringBuilderA& atts)
{
std::vector<std::string> arrRepeat;
for (size_t i = 0; i < attribs->length; ++i)
{
GumboAttribute* at = static_cast<GumboAttribute*>(attribs->data[i]);
std::string sVal(at->value);
std::string sName(at->name);
remove_control_symbols(sVal);
remove_control_symbols(sName);
atts.WriteString(" ");
bool bCheck = false;
size_t nBad = sName.find_first_of("+,.=?#%<>&;\"\'()[]{}");
while(nBad != std::string::npos)
{
sName.erase(nBad, 1);
nBad = sName.find_first_of("+,.=?#%<>&;\"\'()[]{}", nBad);
if(sName.empty())
break;
bCheck = true;
}
if(sName.empty())
continue;
while(sName.front() >= '0' && sName.front() <= '9')
{
sName.erase(0, 1);
if(sName.empty())
break;
bCheck = true;
}
if(bCheck)
{
GumboAttribute* check = gumbo_get_attribute(attribs, sName.c_str());
if(check || std::find(arrRepeat.begin(), arrRepeat.end(), sName) != arrRepeat.end())
continue;
else
arrRepeat.push_back(sName);
}
if(sName.empty())
continue;
atts.WriteString(sName);
// determine original quote character used if it exists
std::string qs ="\"";
atts.WriteString("=");
atts.WriteString(qs);
substitute_xml_entities_into_attributes(sVal);
atts.WriteString(sVal);
atts.WriteString(qs);
}
}
static void prettyprint(GumboNode* node, NSStringUtils::CStringBuilderA& oBuilder, bool bCheckValidNode = true);
static void prettyprint_contents(GumboNode* node, NSStringUtils::CStringBuilderA& contents, bool bCheckValidNode)
{
std::string key = "|" + get_tag_name(node) + "|";
bool keep_whitespace = preserve_whitespace.find(key) != std::string::npos;
bool is_inline = nonbreaking_inline.find(key) != std::string::npos;
bool is_like_inline = treat_like_inline.find(key) != std::string::npos;
GumboVector* children = &node->v.element.children;
for (size_t i = 0; i < children->length; i++)
{
GumboNode* child = static_cast<GumboNode*> (children->data[i]);
if (child->type == GUMBO_NODE_TEXT)
{
std::string val(child->v.text.text);
remove_control_symbols(val);
substitute_xml_entities_into_text(val);
// Избавление от FF
size_t found = val.find_first_of("\014");
while(found != std::string::npos)
{
val.erase(found, 1);
found = val.find_first_of("\014", found);
}
contents.WriteString(val);
}
else if ((child->type == GUMBO_NODE_ELEMENT) || (child->type == GUMBO_NODE_TEMPLATE))
prettyprint(child, contents, bCheckValidNode);
else if (child->type == GUMBO_NODE_WHITESPACE)
{
if (keep_whitespace || is_inline || is_like_inline)
contents.WriteString(child->v.text.text);
}
else if (child->type != GUMBO_NODE_COMMENT)
{
// Сообщение об ошибке
// Does this actually exist: (child->type == GUMBO_NODE_CDATA)
// fprintf(stderr, "unknown element of type: %d\n", child->type);
}
}
}
static void prettyprint(GumboNode* node, NSStringUtils::CStringBuilderA& oBuilder, bool bCheckValidNode)
{
// special case the document node
if (node->type == GUMBO_NODE_DOCUMENT)
{
build_doctype(node, oBuilder);
prettyprint_contents(node, oBuilder, bCheckValidNode);
return;
}
std::string tagname = get_tag_name(node);
remove_control_symbols(tagname);
if (NodeIsUnprocessed(tagname))
return;
if (bCheckValidNode)
bCheckValidNode = !IsUnckeckedNodes(tagname);
if (bCheckValidNode && html_tags.end() == std::find(html_tags.begin(), html_tags.end(), tagname))
{
prettyprint_contents(node, oBuilder, bCheckValidNode);
return;
}
std::string close = "";
std::string closeTag = "";
std::string key = "|" + tagname + "|";
bool is_empty_tag = empty_tags.find(key) != std::string::npos;
// determine closing tag type
if (is_empty_tag)
close = "/";
else
closeTag = "</" + tagname + ">";
// build results
oBuilder.WriteString("<" + tagname);
// build attr string
const GumboVector* attribs = &node->v.element.attributes;
build_attributes(attribs, oBuilder);
oBuilder.WriteString(close + ">");
// prettyprint your contents
prettyprint_contents(node, oBuilder, bCheckValidNode);
oBuilder.WriteString(closeTag);
}
std::wstring htmlToXhtml(std::string& sFileContent, bool bNeedConvert)
{
if (bNeedConvert)
{ // Определение кодировки
std::string sEncoding = NSStringFinder::FindProperty(sFileContent, "charset", {"="}, {";", "\\n", "\\r", " ", "\"", "'"}).m_sValue;
if (sEncoding.empty())
sEncoding = NSStringFinder::FindProperty(sFileContent, "encoding", {"="}, {";", "\\n", "\\r", " "}).m_sValue;
if (!sEncoding.empty() && !NSStringFinder::Equals("utf-8", sEncoding))
{
NSUnicodeConverter::CUnicodeConverter oConverter;
sFileContent = U_TO_UTF8(oConverter.toUnicode(sFileContent, sEncoding.c_str()));
}
}
// Избавляемся от лишних символов до <...
boost::regex oRegex("<[a-zA-Z]");
boost::match_results<typename std::string::const_iterator> oResult;
if (boost::regex_search(sFileContent, oResult, oRegex))
sFileContent.erase(0, oResult.position());
//Избавление от <a ... />
while (NSStringFinder::RemoveEmptyTag(sFileContent, "a"));
//Избавление от <title ... />
while (NSStringFinder::RemoveEmptyTag(sFileContent, "title"));
//Избавление от <script ... />
while (NSStringFinder::RemoveEmptyTag(sFileContent, "script"));
// Gumbo
GumboOptions options = kGumboDefaultOptions;
GumboOutput* output = gumbo_parse_with_options(&options, sFileContent.data(), sFileContent.length());
// prettyprint
NSStringUtils::CStringBuilderA oBuilder;
prettyprint(output->document, oBuilder);
// Конвертирование из string utf8 в wstring
return UTF8_TO_U(oBuilder.GetData());
}
std::wstring mhtToXhtml(std::string& sFileContent)
{
sFileContent = mhtTohtml(sFileContent);
// Gumbo
GumboOptions options = kGumboDefaultOptions;
GumboOutput* output = gumbo_parse_with_options(&options, sFileContent.data(), sFileContent.length());
// prettyprint
NSStringUtils::CStringBuilderA oBuilder;
prettyprint(output->document, oBuilder);
// Конвертирование из string utf8 в wstring
return UTF8_TO_U(oBuilder.GetData());
}
}

View File

@ -2,658 +2,11 @@
#define HTMLTOXHTML_H
#include <string>
#include <map>
#include <cctype>
#include <vector>
#include <algorithm>
#include "gumbo-parser/src/gumbo.h"
#include "../../../DesktopEditor/common/File.h"
#include "../../../DesktopEditor/common/Directory.h"
#include "../../../DesktopEditor/common/StringBuilder.h"
#include "../../../DesktopEditor/xml/include/xmlutils.h"
#include "../../../UnicodeConverter/UnicodeConverter.h"
#include "../../../HtmlFile2/src/StringFinder.h"
#if defined(CreateDirectory)
#undef CreateDirectory
#endif
static std::string nonbreaking_inline = "|a|abbr|acronym|b|bdo|big|cite|code|dfn|em|font|i|img|kbd|nobr|s|small|span|strike|strong|sub|sup|tt|";
static std::string empty_tags = "|area|base|basefont|bgsound|br|command|col|embed|event-source|frame|hr|image|img|input|keygen|link|menuitem|meta|param|source|spacer|track|wbr|";
static std::string preserve_whitespace = "|pre|textarea|script|style|";
static std::string special_handling = "|html|body|";
static std::string treat_like_inline = "|p|";
static std::vector<std::string> html_tags = {"div","span","a","img","p","h1","h2","h3","h4","h5","h6",
"ul", "ol", "li","td","tr","table","thead","tbody","tfoot","th",
"br","form","input","button","section","nav","header","footer",
"main","figure","figcaption","strong","em","i", "b", "u","pre",
"code","blockquote","hr","script","link","meta","style","title",
"head","body","html","legend","optgroup","option","select","dl",
"dt","dd","time","data","abbr","address","area","base","bdi",
"bdo","cite","col","iframe","video","source","track","textarea",
"label","fieldset","colgroup","del","ins","details","summary",
"dialog","embed","kbd","map","mark","menu","meter","object",
"output","param","progress","q","samp","small","sub","sup","var",
"wbr","acronym","applet","article","aside","audio","basefont",
"bgsound","big","blink","canvas","caption","center","command",
"comment","datalist","dfn","dir","font","frame","frameset",
"hgroup","isindex","keygen","marquee","nobr","noembed","noframes",
"noscript","plaintext","rp","rt","ruby","s","strike","tt","xmp"};
static std::vector<std::string> unchecked_nodes_new = {"svg"};
static void prettyprint(GumboNode*, NSStringUtils::CStringBuilderA& oBuilder, bool bCheckValidNode = true);
static std::string mhtTohtml(const std::string &sFileContent);
// Заменяет в строке s все символы s1 на s2
static void replace_all(std::string& s, const std::string& s1, const std::string& s2)
namespace HTML
{
size_t pos = s.find(s1);
while(pos != std::string::npos)
{
s.replace(pos, s1.length(), s2);
pos = s.find(s1, pos + s2.length());
}
}
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);
}
static std::wstring htmlToXhtml(std::string& sFileContent, bool bNeedConvert)
{
if (bNeedConvert)
{ // Определение кодировки
std::string sEncoding = NSStringFinder::FindProperty(sFileContent, "charset", {"="}, {";", "\\n", "\\r", " ", "\"", "'"}).m_sValue;
if (sEncoding.empty())
sEncoding = NSStringFinder::FindProperty(sFileContent, "encoding", {"="}, {";", "\\n", "\\r", " "}).m_sValue;
if (!sEncoding.empty() && !NSStringFinder::Equals("utf-8", sEncoding))
{
NSUnicodeConverter::CUnicodeConverter oConverter;
sFileContent = U_TO_UTF8(oConverter.toUnicode(sFileContent, sEncoding.c_str()));
}
}
// Избавляемся от лишних символов до <...
boost::regex oRegex("<[a-zA-Z]");
boost::match_results<typename std::string::const_iterator> oResult;
if (boost::regex_search(sFileContent, oResult, oRegex))
sFileContent.erase(0, oResult.position());
//Избавление от <a ... />
while (NSStringFinder::RemoveEmptyTag(sFileContent, "a"));
//Избавление от <title ... />
while (NSStringFinder::RemoveEmptyTag(sFileContent, "title"));
//Избавление от <script ... />
while (NSStringFinder::RemoveEmptyTag(sFileContent, "script"));
// Gumbo
GumboOptions options = kGumboDefaultOptions;
GumboOutput* output = gumbo_parse_with_options(&options, sFileContent.data(), sFileContent.length());
// prettyprint
NSStringUtils::CStringBuilderA oBuilder;
prettyprint(output->document, oBuilder);
// Конвертирование из string utf8 в wstring
return UTF8_TO_U(oBuilder.GetData());
}
static std::string Base64ToString(const std::string& sContent, const std::string& sCharset)
{
std::string sRes;
int nSrcLen = (int)sContent.length();
int nDecodeLen = NSBase64::Base64DecodeGetRequiredLength(nSrcLen);
BYTE* pData = new BYTE[nDecodeLen];
if (TRUE == NSBase64::Base64Decode(sContent.c_str(), nSrcLen, pData, &nDecodeLen))
{
std::wstring sConvert;
if(!sCharset.empty() && NSStringFinder::Equals<std::string>("utf-8", sCharset))
{
NSUnicodeConverter::CUnicodeConverter oConverter;
sConvert = oConverter.toUnicode(reinterpret_cast<char *>(pData), (unsigned)nDecodeLen, sCharset.data());
}
sRes = sConvert.empty() ? std::string(reinterpret_cast<char *>(pData), nDecodeLen) : U_TO_UTF8(sConvert);
}
RELEASEARRAYOBJECTS(pData);
return sRes;
}
static std::string QuotedPrintableDecode(const std::string& sContent, std::string& sCharset)
{
NSStringUtils::CStringBuilderA sRes;
size_t ip = 0;
size_t i = sContent.find('=');
if(i == 0)
{
size_t nIgnore = 12;
std::string charset = sContent.substr(0, nIgnore);
if(charset == "=00=00=FE=FF")
sCharset = "UTF-32BE";
else if(charset == "=FF=FE=00=00")
sCharset = "UTF-32LE";
else if(charset == "=2B=2F=76=38" || charset == "=2B=2F=76=39" ||
charset == "=2B=2F=76=2B" || charset == "=2B=2F=76=2F")
sCharset = "UTF-7";
else if(charset == "=DD=73=66=73")
sCharset = "UTF-EBCDIC";
else if(charset == "=84=31=95=33")
sCharset = "GB-18030";
else
{
nIgnore -= 3;
charset.erase(nIgnore);
if(charset == "=EF=BB=BF")
sCharset = "UTF-8";
else if(charset == "=F7=64=4C")
sCharset = "UTF-1";
else if(charset == "=0E=FE=FF")
sCharset = "SCSU";
else if(charset == "=FB=EE=28")
sCharset = "BOCU-1";
else
{
nIgnore -= 3;
charset.erase(nIgnore);
if(charset == "=FE=FF")
sCharset = "UTF-16BE";
else if(charset == "=FF=FE")
sCharset = "UTF-16LE";
else
nIgnore -= 6;
}
}
ip = nIgnore;
i = sContent.find('=', ip);
}
while(i != std::string::npos && i + 2 < sContent.length())
{
sRes.WriteString(sContent.c_str() + ip, i - ip);
std::string str = sContent.substr(i + 1, 2);
if(str.front() == '\n' || str.front() == '\r')
{
char ch = str[1];
if(ch != '\n' && ch != '\r')
sRes.WriteString(&ch, 1);
}
else
{
char* err;
char ch = (int)strtol(str.data(), &err, 16);
if(*err)
sRes.WriteString('=' + str);
else
sRes.WriteString(&ch, 1);
}
ip = i + 3;
i = sContent.find('=', ip);
}
if(ip != std::string::npos)
sRes.WriteString(sContent.c_str() + ip);
return sRes.GetData();
}
static void ReadMht(const std::string& sMhtContent, std::map<std::string, std::string>& sRes, NSStringUtils::CStringBuilderA& oRes)
{
size_t unContentPosition = 0, unCharsetBegin = 0, unCharsetEnd = std::string::npos;
NSStringFinder::TFoundedData<char> oData;
// Content-Type
oData = NSStringFinder::FindProperty(sMhtContent, "content-type", {":"}, {";", "\\n", "\\r"});
const std::string sContentType{oData.m_sValue};
if (sContentType.empty())
return;
if (NSStringFinder::Equals(sContentType, "multipart/alternative"))
{
oRes.WriteString(mhtTohtml(sMhtContent.substr(oData.m_unEndPosition, sMhtContent.length() - oData.m_unEndPosition)));
return;
}
unContentPosition = std::max(unContentPosition, oData.m_unEndPosition);
unCharsetBegin = oData.m_unEndPosition;
// name
// std::string sName = NSStringFinder::FindProperty(sMhtContent, "name", {"="}, {";", "\\n", "\\r"}, 0, unLastPosition);
// unContentPosition = std::max(unContentPosition, unLastPosition);
// Content-Location
oData = NSStringFinder::FindProperty(sMhtContent, "content-location", {":"}, {";", "\\n", "\\r"});
std::string sContentLocation{oData.m_sValue};
if (!oData.Empty())
unContentPosition = std::max(unContentPosition, oData.m_unEndPosition);
// Content-ID
oData = NSStringFinder::FindProperty(sMhtContent, "content-id", {":"}, {";", "\\n", "\\r"});
std::string sContentID{oData.m_sValue};
if (!oData.Empty())
{
unContentPosition = std::max(unContentPosition, oData.m_unEndPosition);
unCharsetEnd = std::min(unCharsetEnd, oData.m_unBeginPosition);
NSStringFinder::CutInside<std::string>(sContentID, "<", ">");
}
if (sContentLocation.empty() && !sContentID.empty())
sContentLocation = "cid:" + sContentID;
// Content-Transfer-Encoding
oData = NSStringFinder::FindProperty(sMhtContent, "content-transfer-encoding", {":"}, {";", "\\n", "\\r"});
const std::string sContentEncoding{oData.m_sValue};
if (!oData.Empty())
{
unContentPosition = std::max(unContentPosition, oData.m_unEndPosition);
unCharsetEnd = std::min(unCharsetEnd, oData.m_unBeginPosition);
}
// charset
std::string sCharset = "utf-8";
if (std::string::npos != unCharsetEnd && unCharsetBegin < unCharsetEnd)
{
sCharset = NSStringFinder::FindProperty(sMhtContent.substr(unCharsetBegin, unCharsetEnd - unCharsetBegin), "charset", {"="}, {";", "\\n", "\\r"}).m_sValue;
NSStringFinder::CutInside<std::string>(sCharset, "\"");
}
// Content
std::string sContent = sMhtContent.substr(unContentPosition, sMhtContent.length() - unContentPosition);
// std::wstring sExtention = NSFile::GetFileExtention(UTF8_TO_U(sName));
// std::transform(sExtention.begin(), sExtention.end(), sExtention.begin(), tolower);
// Основной документ
if (NSStringFinder::Equals(sContentType, "multipart/alternative"))
oRes.WriteString(mhtTohtml(sContent));
else if ((NSStringFinder::Find(sContentType, "text") /*&& (sExtention.empty() || NSStringFinder::EqualOf(sExtention, {L"htm", L"html", L"xhtml", L"css"}))*/)
|| (NSStringFinder::Equals(sContentType, "application/octet-stream") && NSStringFinder::Find(sContentLocation, "css")))
{
// Стили заключаются в тэг <style>
const bool bAddTagStyle = NSStringFinder::Equals(sContentType, "text/css") /*|| NSStringFinder::Equals(sExtention, L"css")*/ || NSStringFinder::Find(sContentLocation, "css");
if (bAddTagStyle)
oRes.WriteString("<style>");
if (NSStringFinder::Equals(sContentEncoding, "base64"))
sContent = Base64ToString(sContent, sCharset);
else if (NSStringFinder::EqualOf(sContentEncoding, {"8bit", "7bit"}) || sContentEncoding.empty())
{
if (!NSStringFinder::Equals(sCharset, "utf-8") && !sCharset.empty())
{
NSUnicodeConverter::CUnicodeConverter oConverter;
sContent = U_TO_UTF8(oConverter.toUnicode(sContent, sCharset.data()));
}
}
else if (NSStringFinder::Equals(sContentEncoding, "quoted-printable"))
{
sContent = QuotedPrintableDecode(sContent, sCharset);
if (!NSStringFinder::Equals(sCharset, "utf-8") && !sCharset.empty())
{
NSUnicodeConverter::CUnicodeConverter oConverter;
sContent = U_TO_UTF8(oConverter.toUnicode(sContent, sCharset.data()));
}
}
if (NSStringFinder::Equals(sContentType, "text/html"))
sContent = U_TO_UTF8(htmlToXhtml(sContent, false));
oRes.WriteString(sContent);
if(bAddTagStyle)
oRes.WriteString("</style>");
}
// Картинки
else if ((NSStringFinder::Find(sContentType, "image") /*|| NSStringFinder::Equals(sExtention, L"gif")*/ || NSStringFinder::Equals(sContentType, "application/octet-stream")) &&
NSStringFinder::Equals(sContentEncoding, "base64"))
{
// if (NSStringFinder::Equals(sExtention, L"ico") || NSStringFinder::Find(sContentType, "ico"))
// sContentType = "image/jpg";
// else if(NSStringFinder::Equals(sExtention, L"gif"))
// sContentType = "image/gif";
int nSrcLen = (int)sContent.length();
int nDecodeLen = NSBase64::Base64DecodeGetRequiredLength(nSrcLen);
BYTE* pData = new BYTE[nDecodeLen];
if (TRUE == NSBase64::Base64Decode(sContent.c_str(), nSrcLen, pData, &nDecodeLen))
sRes.insert(std::make_pair(sContentLocation, "data:" + sContentType + ";base64," + sContent));
RELEASEARRAYOBJECTS(pData);
}
}
static std::string mhtTohtml(const std::string& sFileContent)
{
std::map<std::string, std::string> sRes;
NSStringUtils::CStringBuilderA oRes;
// Поиск boundary
NSStringFinder::TFoundedData<char> oData{NSStringFinder::FindProperty(sFileContent, "boundary", {"="}, {"\\r", "\\n", "\""})};
size_t nFound{oData.m_unEndPosition};
std::string sBoundary{oData.m_sValue};
if (sBoundary.empty())
{
size_t nFoundEnd = sFileContent.length();
nFound = 0;
ReadMht(sFileContent.substr(nFound, nFoundEnd), sRes, oRes);
return oRes.GetData();
}
NSStringFinder::CutInside<std::string>(sBoundary, "\"");
size_t nFoundEnd{nFound};
sBoundary = "--" + sBoundary;
size_t nBoundaryLength = sBoundary.length();
nFound = sFileContent.find(sBoundary, nFound) + nBoundaryLength;
// Цикл по boundary
while(nFound != std::string::npos)
{
nFoundEnd = sFileContent.find(sBoundary, nFound + nBoundaryLength);
if(nFoundEnd == std::string::npos)
break;
ReadMht(sFileContent.substr(nFound, nFoundEnd - nFound), sRes, oRes);
nFound = sFileContent.find(sBoundary, nFoundEnd);
}
std::string sFile = oRes.GetData();
for(const std::pair<std::string, std::string>& item : sRes)
{
std::string sName = item.first;
size_t found = sFile.find(sName);
size_t sfound = sName.rfind('/');
if(found == std::string::npos && sfound != std::string::npos)
found = sFile.find(sName.erase(0, sfound + 1));
while(found != std::string::npos)
{
size_t fq = sFile.find_last_of("\"\'>=", found);
if (std::string::npos == fq)
break;
char ch = sFile[fq];
if(ch != '\"' && ch != '\'')
fq++;
size_t tq = sFile.find_first_of("\"\'<> ", found) + 1;
if (std::string::npos == tq)
break;
if(sFile[tq] != '\"' && sFile[tq] != '\'')
tq--;
if(ch != '>')
{
std::string is = '\"' + item.second + '\"';
sFile.replace(fq, tq - fq, is);
found = sFile.find(sName, fq + is.length());
}
else
found = sFile.find(sName, tq);
}
}
return sFile;
}
static std::wstring mhtToXhtml(std::string& sFileContent)
{
sFileContent = mhtTohtml(sFileContent);
// Gumbo
GumboOptions options = kGumboDefaultOptions;
GumboOutput* output = gumbo_parse_with_options(&options, sFileContent.data(), sFileContent.length());
// prettyprint
NSStringUtils::CStringBuilderA oBuilder;
prettyprint(output->document, oBuilder);
// Конвертирование из string utf8 в wstring
return UTF8_TO_U(oBuilder.GetData());
}
// Заменяет сущности &,<,> в text
static void substitute_xml_entities_into_text(std::string& text)
{
// replacing & must come first
replace_all(text, "&", "&amp;");
replace_all(text, "<", "&lt;");
replace_all(text, ">", "&gt;");
}
// After running through Gumbo, the values of type "&#1;" are replaced with the corresponding code '0x01'
// Since the attribute value does not use control characters (value <= 0x09),
// then just delete them, otherwise XmlUtils::CXmlLiteReader crashes on them.
// bug#73486
static void remove_control_symbols(std::string& text)
{
std::string::iterator itFound = std::find_if(text.begin(), text.end(), [](unsigned char chValue){ return chValue <= 0x09; });
while (itFound != text.end())
{
itFound = text.erase(itFound);
itFound = std::find_if(itFound, text.end(), [](unsigned char chValue){ return chValue <= 0x09; });
}
}
// Заменяет сущности " в text
static void substitute_xml_entities_into_attributes(std::string& text)
{
remove_control_symbols(text);
substitute_xml_entities_into_text(text);
replace_all(text, "\"", "&quot;");
}
static std::string handle_unknown_tag(GumboStringPiece* text)
{
if (text->data == NULL)
return "";
GumboStringPiece gsp = *text;
gumbo_tag_from_original_text(&gsp);
std::string sAtr = std::string(gsp.data, gsp.length);
size_t found = sAtr.find_first_of("-'+,./=?;!*#@$_%<>&;\"\'()[]{}");
while(found != std::string::npos)
{
sAtr.erase(found, 1);
found = sAtr.find_first_of("-'+,./=?;!*#@$_%<>&;\"\'()[]{}", found);
}
return sAtr;
}
static std::string get_tag_name(GumboNode* node)
{
std::string tagname = (node->type == GUMBO_NODE_DOCUMENT ? "document" : gumbo_normalized_tagname(node->v.element.tag));
if (tagname.empty())
tagname = handle_unknown_tag(&node->v.element.original_tag);
return tagname;
}
static void build_doctype(GumboNode* node, NSStringUtils::CStringBuilderA& oBuilder)
{
if (node->v.document.has_doctype)
{
oBuilder.WriteString("<!DOCTYPE ");
oBuilder.WriteString(node->v.document.name);
std::string pi(node->v.document.public_identifier);
remove_control_symbols(pi);
if ((node->v.document.public_identifier != NULL) && !pi.empty())
{
oBuilder.WriteString(" PUBLIC \"");
oBuilder.WriteString(pi);
oBuilder.WriteString("\" \"");
oBuilder.WriteString(node->v.document.system_identifier);
oBuilder.WriteString("\"");
}
oBuilder.WriteString(">");
}
}
static void build_attributes(const GumboVector* attribs, NSStringUtils::CStringBuilderA& atts)
{
std::vector<std::string> arrRepeat;
for (size_t i = 0; i < attribs->length; ++i)
{
GumboAttribute* at = static_cast<GumboAttribute*>(attribs->data[i]);
std::string sVal(at->value);
std::string sName(at->name);
remove_control_symbols(sVal);
remove_control_symbols(sName);
atts.WriteString(" ");
bool bCheck = false;
size_t nBad = sName.find_first_of("+,.=?#%<>&;\"\'()[]{}");
while(nBad != std::string::npos)
{
sName.erase(nBad, 1);
nBad = sName.find_first_of("+,.=?#%<>&;\"\'()[]{}", nBad);
if(sName.empty())
break;
bCheck = true;
}
if(sName.empty())
continue;
while(sName.front() >= '0' && sName.front() <= '9')
{
sName.erase(0, 1);
if(sName.empty())
break;
bCheck = true;
}
if(bCheck)
{
GumboAttribute* check = gumbo_get_attribute(attribs, sName.c_str());
if(check || std::find(arrRepeat.begin(), arrRepeat.end(), sName) != arrRepeat.end())
continue;
else
arrRepeat.push_back(sName);
}
if(sName.empty())
continue;
atts.WriteString(sName);
// determine original quote character used if it exists
std::string qs ="\"";
atts.WriteString("=");
atts.WriteString(qs);
substitute_xml_entities_into_attributes(sVal);
atts.WriteString(sVal);
atts.WriteString(qs);
}
}
static void prettyprint_contents(GumboNode* node, NSStringUtils::CStringBuilderA& contents, bool bCheckValidNode)
{
std::string key = "|" + get_tag_name(node) + "|";
bool keep_whitespace = preserve_whitespace.find(key) != std::string::npos;
bool is_inline = nonbreaking_inline.find(key) != std::string::npos;
bool is_like_inline = treat_like_inline.find(key) != std::string::npos;
GumboVector* children = &node->v.element.children;
for (size_t i = 0; i < children->length; i++)
{
GumboNode* child = static_cast<GumboNode*> (children->data[i]);
if (child->type == GUMBO_NODE_TEXT)
{
std::string val(child->v.text.text);
remove_control_symbols(val);
substitute_xml_entities_into_text(val);
// Избавление от FF
size_t found = val.find_first_of("\014");
while(found != std::string::npos)
{
val.erase(found, 1);
found = val.find_first_of("\014", found);
}
contents.WriteString(val);
}
else if ((child->type == GUMBO_NODE_ELEMENT) || (child->type == GUMBO_NODE_TEMPLATE))
prettyprint(child, contents, bCheckValidNode);
else if (child->type == GUMBO_NODE_WHITESPACE)
{
if (keep_whitespace || is_inline || is_like_inline)
contents.WriteString(child->v.text.text);
}
else if (child->type != GUMBO_NODE_COMMENT)
{
// Сообщение об ошибке
// Does this actually exist: (child->type == GUMBO_NODE_CDATA)
// fprintf(stderr, "unknown element of type: %d\n", child->type);
}
}
}
static void prettyprint(GumboNode* node, NSStringUtils::CStringBuilderA& oBuilder, bool bCheckValidNode)
{
// special case the document node
if (node->type == GUMBO_NODE_DOCUMENT)
{
build_doctype(node, oBuilder);
prettyprint_contents(node, oBuilder, bCheckValidNode);
return;
}
std::string tagname = get_tag_name(node);
remove_control_symbols(tagname);
if (NodeIsUnprocessed(tagname))
return;
if (bCheckValidNode)
bCheckValidNode = !IsUnckeckedNodes(tagname);
if (bCheckValidNode && html_tags.end() == std::find(html_tags.begin(), html_tags.end(), tagname))
{
prettyprint_contents(node, oBuilder, bCheckValidNode);
return;
}
std::string close = "";
std::string closeTag = "";
std::string key = "|" + tagname + "|";
bool is_empty_tag = empty_tags.find(key) != std::string::npos;
// determine closing tag type
if (is_empty_tag)
close = "/";
else
closeTag = "</" + tagname + ">";
// build results
oBuilder.WriteString("<" + tagname);
// build attr string
const GumboVector* attribs = &node->v.element.attributes;
build_attributes(attribs, oBuilder);
oBuilder.WriteString(close + ">");
// prettyprint your contents
prettyprint_contents(node, oBuilder, bCheckValidNode);
oBuilder.WriteString(closeTag);
std::wstring htmlToXhtml(std::string& sFileContent, bool bNeedConvert);
std::wstring mhtToXhtml(std::string& sFileContent);
}
#endif // HTMLTOXHTML_H

View File

@ -5,6 +5,9 @@
namespace Md
{
#define MD_PARSER_FLAGS MD_DIALECT_GITHUB | MD_FLAG_NOINDENTEDCODEBLOCKS | MD_HTML_FLAG_SKIP_UTF8_BOM | MD_FLAG_HARD_SOFT_BREAKS | MD_HTML_FLAG_XHTML | MD_FLAG_LATEXMATHSPANS
#define MD_RENDERER_FLAGS MD_HTML_FLAG_XHTML
void ToHtml(const MD_CHAR* pValue, MD_SIZE uSize, void* pData)
{
if (NULL != pData)
@ -14,7 +17,7 @@ void ToHtml(const MD_CHAR* pValue, MD_SIZE uSize, void* pData)
std::string ConvertMdStringToHtml(const std::string& sMdString)
{
std::string sData;
md_html(sMdString.c_str(), sMdString.length(), ToHtml, &sData, 0, 0);
md_html(sMdString.c_str(), sMdString.length(), ToHtml, &sData, MD_PARSER_FLAGS, MD_RENDERER_FLAGS);
return sData;
}
@ -36,22 +39,21 @@ void WriteBaseHtmlStyles(NSFile::CFileBinary& oFile)
oFile.WriteStringUTF8(L"img { vertical-align: middle; }");
// Styles for tables
oFile.WriteStringUTF8(L"table { margin-bottom: 20px; width: 100%; max-width: 100%; border-spacing:0; border-collapse: collapse; border-color: gray;}");
oFile.WriteStringUTF8(L"thead { display: table-header-group; vertical-align: middle; }");
oFile.WriteStringUTF8(L"table { margin-bottom: 20px; width: 100%; max-width: 100%; border-spacing:0; border-collapse: collapse; border-color: gray; vertical-align:middle;}");
oFile.WriteStringUTF8(L"thead { display: table-header-group;}");
oFile.WriteStringUTF8(L"tr { display: table-row; }");
oFile.WriteStringUTF8(L"th { text-align: left; display: table-cell; font-weight: bold; }");
oFile.WriteStringUTF8(L"th { text-align: center; display: table-cell; font-weight: bold; }");
oFile.WriteStringUTF8(L"table thead tr th { vertical-align: bottom; border-bottom: 2px solid #ddd; }");
oFile.WriteStringUTF8(L"table thead tr th, table tbody tr th, table thead tr td, table tbody tr td { padding 8px; line-height: 1.4; vertical-align: top; border-top: 1px solid #ddd; }");
oFile.WriteStringUTF8(L"table > caption + thead > tr > th, table > colgroup + thead > tr > th, table > thead > tr > th, table > caption + thead > tr > td, table > colgroup + thead > tr > td, table > thead > tr > td { border-top: 0; }");
oFile.WriteStringUTF8(L"table thead tr th, table thead tr td { border-bottom: 2px solid #ddd; border-top: none; }");
oFile.WriteStringUTF8(L"table tbody tr th, table tbody tr td { padding 8px; line-height: 1.4; border-top: 1px solid #ddd; }");
// Styles for blockquote
oFile.WriteStringUTF8(L"blockquote { border-left: 3px solid #e9e9e9; margin: 1.5em 0; padding: 0.5em 10px 0.5em 24px; font-size: 1.25rem; display: block; margin-top: 8pt; font-style: italic; color: #404040; }");
// Styles for code
oFile.WriteStringUTF8(L"code { padding: 2px 4px; font-size: 90%; color: #c7254e; background-color: #f9f2f4; border-radius: 4px; }");
oFile.WriteStringUTF8(L"pre code { padding: 0px; white-space: pre-wrap; border-radius: 0; background-color: #f5f5f5; color:black; }");
oFile.WriteStringUTF8(L"pre { display: block; padding: 9.5px; margin: 0 0 10px; line-height: 1.4; word-break: break-all; word-wrap: break-word; background-color: #f5f5f5; border: 1px solid #ccc; border-radius: 4px; font-size: 1em; }");
oFile.WriteStringUTF8(L"code { padding: 2px 4px; font-size: 90%; color: #c7254e; background-color: #f9f2f4; }");
oFile.WriteStringUTF8(L"pre code { padding: 0px; white-space: pre-wrap; border-radius: 0; background-color: #f8f8f8; color:black; }");
oFile.WriteStringUTF8(L"pre { display: block; padding: 9.5px; margin: 0 0 10px; line-height: 1.4; word-break: break-all; word-wrap: break-word; background-color: #f8f8f8; border: none; font-size: 1em; }");
oFile.WriteStringUTF8(L"code, pre { font-family: Menlo, Monaco, Consolas, \"Courier New\", monospace; }");
// Styles for headings
@ -87,9 +89,7 @@ bool ConvertMdFileToHtml(const std::wstring& wsPathToMdFile, const std::wstring&
bool bResult = true;
if (0 != md_html(sMdData.c_str(), sMdData.length(), ToHtmlFile, &oFile,
MD_DIALECT_GITHUB | MD_FLAG_NOINDENTEDCODEBLOCKS | MD_HTML_FLAG_SKIP_UTF8_BOM,
0))
if (0 != md_html(sMdData.c_str(), sMdData.length(), ToHtmlFile, &oFile, MD_PARSER_FLAGS, MD_RENDERER_FLAGS))
bResult = false;
oFile.WriteStringUTF8(L"</body></html>");

View File

@ -90,7 +90,7 @@ static std::wstring convertUtf16ToWString(const UTF16 * Data, int nLength)
return std::wstring();
}
std::wstring wstr ((wchar_t *) pStrUtf32);
std::wstring wstr ((wchar_t *) pStrUtf32, nLength);
delete [] pStrUtf32;
return wstr;

View File

@ -1 +1,2 @@
socket.io-client-cpp/
socketio.data

View File

@ -0,0 +1,5 @@
<<<<<<<
if((c >= 'a' && c <= 'z') || (c>= 'A' && c<= 'Z') || (c >= '0' && c<= '9')){
=======
if((c >= 'a' && c <= 'z') || (c>= 'A' && c<= 'Z') || (c >= '0' && c<= '9') || ('-' == c) || ('_' == c) || ('.' == c) || ('~' == c)){
>>>>>>>

View File

@ -1,6 +1,6 @@
.cipd
.gclient
.gclient_entries
.gclient*
.gcs*
v8
depot_tools
v8.data

View File

@ -105,11 +105,37 @@ namespace NSNetwork
{
static NSString* StringWToNSString ( const std::wstring& Str )
{
// Returns +1 retained NSString (alloc/init). Caller must release in non-ARC.
NSString* pString = [ [ NSString alloc ]
initWithBytes : (char*)Str.data() length : Str.size() * sizeof(wchar_t)
encoding : CFStringConvertEncodingToNSStringEncoding ( kCFStringEncodingUTF32LE ) ];
initWithBytes : (char*)Str.data() length : Str.size() * sizeof(wchar_t)
encoding : CFStringConvertEncodingToNSStringEncoding ( kCFStringEncodingUTF32LE ) ];
return pString;
}
// NSURLComponents correctly handles mixed input (already-encoded + raw characters)
// without double-encoding, but normalises unreserved percent-sequences (%5F → _).
// If preserving the exact encoding is required, use [NSURL URLWithString:] instead.
static NSURL* SafeURLFromString(NSString* urlString)
{
if (!urlString || urlString.length == 0)
return nil;
NSURL* url = [NSURL URLWithString:urlString];
if (url)
return url;
// Fallback: the string contains unencoded characters (spaces, cyrillic,
// brackets, etc.). URLFragmentAllowedCharacterSet includes '%', so
// existing percent-sequences won't be double-encoded.
NSString* encoded =
[urlString stringByAddingPercentEncodingWithAllowedCharacters:
[NSCharacterSet URLFragmentAllowedCharacterSet]];
if (!encoded)
return nil;
return [NSURL URLWithString:encoded];
}
class CFileTransporterBaseCocoa : public CFileTransporterBase
{
public :
@ -145,83 +171,162 @@ namespace NSNetwork
return 0;
#endif
// stringURL: +1 retained (alloc/init). Must be released on all exit paths in non-ARC.
NSString* stringURL = StringWToNSString(m_sDownloadFileUrl);
NSString* escapedURL = [stringURL stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSURL* url = SafeURLFromString(stringURL);
int nResult = 1;
if (m_pSession)
if (!url)
{
NSURLRequest* urlRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:escapedURL]];
__block NSData* result = nil;
dispatch_semaphore_t sem = dispatch_semaphore_create(0);
NSURLSession* _session = ((CSessionMAC*)m_pSession->m_pInternal)->m_session;
if (nil == _session)
_session = [NSURLSession sharedSession];
[[_session dataTaskWithRequest:urlRequest
completionHandler:^(NSData *data, NSURLResponse* response, NSError *error) {
if (error == nil)
result = data;
dispatch_semaphore_signal(sem);
}] resume];
dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
if (result)
{
NSString* filePath = StringWToNSString(m_sDownloadFilePath);
[result writeToFile:filePath atomically:YES];
nResult = 0;
}
else
{
nResult = 1;
}
return nResult;
}
else
{
NSURL* url = [NSURL URLWithString:escapedURL];
NSData* urlData = [NSData dataWithContentsOfURL:url];
if ( urlData )
{
NSString* filePath = StringWToNSString(m_sDownloadFilePath);
[urlData writeToFile:filePath atomically:YES];
#if defined(_IOS)
return 0;
#else
#ifndef _ASC_USE_ARC_
if (!GetARCEnabled())
{
[stringURL release];
//[url release];
[urlData release];
}
#endif
#endif
return 0;
}
#if defined(_IOS)
NSLog(@"[DownloadFile] Invalid URL: %@", stringURL);
#if !defined(_IOS)
#ifndef _ASC_USE_ARC_
if (!GetARCEnabled())
[stringURL release];
#endif
#endif
return 1;
#else
#ifndef _ASC_USE_ARC_
}
// Select session. If the caller provided one, prefer it; fall back to the shared
// singleton. [NSURLSession sharedSession] is a singleton -- never retain/release it.
NSURLSession* session = nil;
if (m_pSession && m_pSession->m_pInternal)
{
CSessionMAC* sessionInternal = (CSessionMAC*)m_pSession->m_pInternal;
session = sessionInternal->m_session;
}
if (!session)
session = [NSURLSession sharedSession];
// NSData initWithContentsOfURL / dataWithContentsOfURL must NOT be used for HTTP:
// - Fails silently on CDN responses with Transfer-Encoding: chunked
// (returns NSCocoaErrorDomain Code=256 on some iOS versions)
// - Does not follow HTTP redirects reliably
// - Ignores Content-Encoding (gzip, br)
// - Has no timeout, can block indefinitely
// NSURLSession handles all of the above correctly on all supported iOS/macOS versions.
NSURLRequest* urlRequest = [NSURLRequest requestWithURL:url];
dispatch_semaphore_t sem = dispatch_semaphore_create(0);
// In non-ARC, __block variables are NOT automatically retained by the block.
// |data| passed to the completion handler is autoreleased; without an explicit
// retain it may be deallocated before semaphore_wait returns on the calling thread.
// We therefore retain inside the block and release after use below.
__block NSData* resultData = nil;
NSURLSessionDataTask* task =
[session dataTaskWithRequest:urlRequest
completionHandler:^(NSData* data, NSURLResponse* response, NSError* error)
{
if (error)
{
NSLog(@"[DownloadFile] Network error: %@, URL: %@", error, url);
}
else if ([response isKindOfClass:[NSHTTPURLResponse class]])
{
NSInteger status = [(NSHTTPURLResponse*)response statusCode];
if (status >= 200 && status < 300)
{
#if !defined(_IOS)
#ifndef _ASC_USE_ARC_
if (!GetARCEnabled())
resultData = [data retain];
else
#endif
#endif
resultData = data;
}
else
{
NSLog(@"[DownloadFile] HTTP %ld, URL: %@", (long)status, url);
}
}
else
{
// Non-HTTP scheme (e.g. file://) -- accept unconditionally.
#if !defined(_IOS)
#ifndef _ASC_USE_ARC_
if (!GetARCEnabled())
resultData = [data retain];
else
#endif
#endif
resultData = data;
}
dispatch_semaphore_signal(sem);
}];
[task resume];
// 60-second hard timeout. DISPATCH_TIME_FOREVER must not be used: if the network
// stack silently drops the connection the completion handler may never fire,
// leaving this thread suspended indefinitely (deadlock).
const int64_t kTimeoutSeconds = 60;
dispatch_time_t timeout = dispatch_time(DISPATCH_TIME_NOW, kTimeoutSeconds * NSEC_PER_SEC);
long waitResult = dispatch_semaphore_wait(sem, timeout);
// dispatch_semaphore_create returns a +1 object. Release it in non-ARC.
// In ARC (including all iOS targets) GCD objects are managed automatically.
#if !defined(_IOS)
#ifndef _ASC_USE_ARC_
if (!GetARCEnabled())
dispatch_release(sem);
#endif
#endif
if (waitResult != 0)
{
// Timeout expired. Cancel the in-flight task so that the completion handler
// is called with NSURLErrorCancelled (data == nil), preventing it from writing
// to resultData after we return and corrupting memory in non-ARC.
[task cancel];
NSLog(@"[DownloadFile] Timeout after %llds, URL: %@", (long long)kTimeoutSeconds, url);
#if !defined(_IOS)
#ifndef _ASC_USE_ARC_
if (!GetARCEnabled())
{
// resultData could theoretically be non-nil if the completion handler
// raced with the timeout check on a multicore device before cancel ran.
[resultData release];
[stringURL release];
//[url release];
}
#endif
#endif
#endif
#endif
return 1;
}
if (!resultData)
{
#if !defined(_IOS)
#ifndef _ASC_USE_ARC_
if (!GetARCEnabled())
[stringURL release];
#endif
#endif
return 1;
}
// filePath: +1 retained (alloc/init). Must be released in non-ARC.
NSString* filePath = StringWToNSString(m_sDownloadFilePath);
BOOL written = [resultData writeToFile:filePath atomically:YES];
if (!written)
NSLog(@"[DownloadFile] Failed to write file: %@", filePath);
#if !defined(_IOS)
#ifndef _ASC_USE_ARC_
if (!GetARCEnabled())
{
[resultData release];
[filePath release];
[stringURL release];
}
#endif
#endif
return written ? 0 : 1;
}
virtual int UploadData() override

View File

@ -69,10 +69,12 @@ public:
bool isOpenOfficeFormatFile(const std::wstring& fileName, std::wstring& documentID);
bool isOnlyOfficeFormatFile(const std::wstring& fileName);
bool isMacFormatFile(const std::wstring& fileName);
bool isHwpxFile(const std::wstring& fileName);
bool isDocFormatFile(const std::wstring& fileName);
bool isXlsFormatFile(const std::wstring& fileName);
bool isCompoundFile (POLE::Storage* storage);
bool isOleObjectFile(POLE::Storage* storage);
bool isDocFormatFile(POLE::Storage* storage);
bool isXlsFormatFile(POLE::Storage* storage);
@ -99,6 +101,7 @@ public:
bool isPdfFormatFile(unsigned char* pBuffer, int dwBytes, std::wstring& documentID);
bool isPdfOformFormatFile(unsigned char* pBuffer, int dwBytes);
bool isOpenOfficeFlatFormatFile(unsigned char* pBuffer, int dwBytes);
bool isHwpmlFile(unsigned char* pBuffer, int dwBytes);
bool isBinaryDoctFormatFile(unsigned char* pBuffer, int dwBytes);
bool isBinaryXlstFormatFile(unsigned char* pBuffer, int dwBytes);

View File

@ -467,15 +467,18 @@ bool COfficeFileFormatChecker::isHwpFile(POLE::Storage* storage)
if (storage == NULL)
return false;
unsigned char buffer[10];
unsigned char buffer[17];
POLE::Stream stream(storage, L"BodyText/Section0");
if (stream.read(buffer, 10) < 1)
{
return false;
}
return true;
POLE::Stream stream(storage, L"FileHeader");
static constexpr const char* hwpFormatLine = "HWP Document File";
if (17 == stream.read(buffer, 17) && NULL != strstr((char*)buffer, hwpFormatLine))
return true;
return false;
}
bool COfficeFileFormatChecker::isXlsFormatFile(POLE::Storage *storage)
{
if (storage == NULL)
@ -549,6 +552,15 @@ bool COfficeFileFormatChecker::isPptFormatFile(POLE::Storage *storage)
return true;
}
bool COfficeFileFormatChecker::isCompoundFile(POLE::Storage* storage)
{
if (storage == NULL) return false;
if (storage->GetAllStreams(L"/").size() == 1) return true;
return false;
}
std::wstring COfficeFileFormatChecker::getDocumentID(const std::wstring &_fileName)
{
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(_WIN64)
@ -746,6 +758,11 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
nFileType = AVS_OFFICESTUDIO_FILE_OTHER_MS_VBAPROJECT;
return true;
}
else if (isCompoundFile(&storage))
{
nFileType = AVS_OFFICESTUDIO_FILE_OTHER_COMPOUND;
return true;
}
else if (isHwpFile(&storage))
{
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HWP;
@ -811,6 +828,13 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
bufferDetect = NULL;
return true;
}
else if (isHwpxFile(fileName))
{
if (bufferDetect)
delete[] bufferDetect;
bufferDetect = NULL;
return true;
}
}
//-----------------------------------------------------------------------------------------------
@ -890,6 +914,10 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
{
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_MHT;
}
else if (isHwpmlFile(bufferDetect, sizeRead))
{
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HWPML;
}
//------------------------------------------------------------------------------------------------
file.CloseFile();
}
@ -939,7 +967,12 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_MHT;
else if (0 == sExt.compare(L".md"))
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_MD;
else if (0 == sExt.compare(L".csv") || 0 == sExt.compare(L".xls") || 0 == sExt.compare(L".xlsx") || 0 == sExt.compare(L".xlsb"))
else if (0 == sExt.compare(L".tsv"))
nFileType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_TSV;
else if (0 == sExt.compare(L".scsv"))
nFileType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_SCSV;
else if (0 == sExt.compare(L".csv") || 0 == sExt.compare(L".tsv") || 0 == sExt.compare(L".dsv") || 0 == sExt.compare(L".cssv")
|| 0 == sExt.compare(L".xls") || 0 == sExt.compare(L".xlsx") || 0 == sExt.compare(L".xlsb"))
nFileType = AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV;
else if (0 == sExt.compare(L".html") || 0 == sExt.compare(L".htm"))
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML;
@ -959,6 +992,8 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HWP;
else if (0 == sExt.compare(L".hwpx"))
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HWPX;
else if (0 == sExt.compare(L".hml"))
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HWPML;
if (nFileType != AVS_OFFICESTUDIO_FILE_UNKNOWN)
return true;
@ -1403,6 +1438,31 @@ bool COfficeFileFormatChecker::isMacFormatFile(const std::wstring& fileName)
return true;
}
bool COfficeFileFormatChecker::isHwpxFile(const std::wstring &fileName)
{
COfficeUtils oOfficeUtils;
ULONG unSize = 0;
BYTE* pBuffer = NULL;
HRESULT hresult = oOfficeUtils.LoadFileFromArchive(fileName, L"mimetype", &pBuffer, unSize);
if (hresult != S_OK || NULL == pBuffer)
return false;
static constexpr const char* hwpxFormatLine = "application/hwp+zip";
bool bResult = false;
if (19 <= unSize && NULL != strstr((char *)pBuffer, hwpxFormatLine))
{
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HWPX;
bResult = true;
}
delete[] pBuffer;
return bResult;
}
bool COfficeFileFormatChecker::isOpenOfficeFormatFile(const std::wstring &fileName, std::wstring &documentID)
{
documentID.clear();
@ -1568,6 +1628,28 @@ bool COfficeFileFormatChecker::isOpenOfficeFlatFormatFile(unsigned char *pBuffer
return false;
}
bool COfficeFileFormatChecker::isHwpmlFile(unsigned char *pBuffer, int dwBytes)
{
if (NULL == pBuffer || dwBytes < 8)
return false;
for (unsigned int unPos = 0; unPos < dwBytes - 8; ++unPos)
{
if ('<' != pBuffer[unPos])
continue;
if (dwBytes - unPos >= 15 && '!' == pBuffer[unPos + 1] &&
0 == memcmp(&pBuffer[unPos], "<!DOCTYPE HWPML", 15))
return true;
if (dwBytes - unPos >= 6 && 0 == memcmp(&pBuffer[unPos], "<HWPML", 6))
return true;
}
return false;
}
bool COfficeFileFormatChecker::isOOXFlatFormatFile(unsigned char *pBuffer, int dwBytes)
{
if (dwBytes < 8)
@ -1676,6 +1758,8 @@ std::wstring COfficeFileFormatChecker::GetExtensionByType(int type)
return L".hwp";
case AVS_OFFICESTUDIO_FILE_DOCUMENT_HWPX:
return L".hwpx";
case AVS_OFFICESTUDIO_FILE_DOCUMENT_HWPML:
return L".hml";
case AVS_OFFICESTUDIO_FILE_DOCUMENT_MD:
return L".md";
@ -1720,6 +1804,10 @@ std::wstring COfficeFileFormatChecker::GetExtensionByType(int type)
return L".ods";
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV:
return L".csv";
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_TSV:
return L".tsv";
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_SCSV:
return L".scsv";
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS_FLAT:
return L".fods";
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_OTS:
@ -1861,6 +1949,8 @@ int COfficeFileFormatChecker::GetFormatByExtension(const std::wstring &sExt)
return AVS_OFFICESTUDIO_FILE_DOCUMENT_HWP;
if (L".hwpx" == ext)
return AVS_OFFICESTUDIO_FILE_DOCUMENT_HWPX;
if (L".hml" == ext)
return AVS_OFFICESTUDIO_FILE_DOCUMENT_HWPML;
if (L".md" == ext)
return AVS_OFFICESTUDIO_FILE_DOCUMENT_MD;
@ -1907,7 +1997,11 @@ int COfficeFileFormatChecker::GetFormatByExtension(const std::wstring &sExt)
return AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSB;
if (L".xls" == ext)
return AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS;
if (L".csv" == ext)
if (L".tsv" == ext)
return AVS_OFFICESTUDIO_FILE_SPREADSHEET_TSV;
if (L".scsv" == ext)
return AVS_OFFICESTUDIO_FILE_SPREADSHEET_SCSV;
if (L".csv" == ext || L".dsv" == ext)
return AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV;
if (L".fods" == ext)
return AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS_FLAT;

View File

@ -59,7 +59,8 @@
#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 + 0x001a
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_MD AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x001b
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_HWPML AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x001b
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_MD AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x001c
#define AVS_OFFICESTUDIO_FILE_DOCUMENT_XML AVS_OFFICESTUDIO_FILE_DOCUMENT + 0x0030
@ -86,13 +87,14 @@
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0005
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0006
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTM AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0007
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSB AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0008
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS_FLAT AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0009
#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_SPREADSHEET_TSV AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0014
#define AVS_OFFICESTUDIO_FILE_SPREADSHEET_SCSV AVS_OFFICESTUDIO_FILE_SPREADSHEET + 0x0024
#define AVS_OFFICESTUDIO_FILE_CROSSPLATFORM 0x0200
#define AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF AVS_OFFICESTUDIO_FILE_CROSSPLATFORM + 0x0001
@ -135,6 +137,7 @@
#define AVS_OFFICESTUDIO_FILE_OTHER_MS_MITCRYPTO AVS_OFFICESTUDIO_FILE_OTHER + 0x000b
#define AVS_OFFICESTUDIO_FILE_OTHER_MS_VBAPROJECT AVS_OFFICESTUDIO_FILE_OTHER + 0x000c
#define AVS_OFFICESTUDIO_FILE_OTHER_PACKAGE_IN_OLE AVS_OFFICESTUDIO_FILE_OTHER + 0x000d
#define AVS_OFFICESTUDIO_FILE_OTHER_COMPOUND AVS_OFFICESTUDIO_FILE_OTHER + 0x000e
#define AVS_OFFICESTUDIO_FILE_TEAMLAB 0x1000
#define AVS_OFFICESTUDIO_FILE_TEAMLAB_DOCY AVS_OFFICESTUDIO_FILE_TEAMLAB + 0x0001

View File

@ -33,8 +33,7 @@ OO_BUILD_BRANDING = $$(OO_BRANDING)
OO_DESTDIR_BUILD_OVERRIDE = $$(DESTDIR_BUILD_OVERRIDE)
win32 {
CURRENT_YEAR = $$system(wmic PATH Win32_LocalTime GET ^Year /FORMAT:VALUE | find \"=\")
CURRENT_YEAR = $$replace(CURRENT_YEAR, "Year=", "")
CURRENT_YEAR = $$system(powershell -NoLogo -NoProfile -Command "(Get-Date).Year")
CURRENT_YEAR = $$replace(CURRENT_YEAR, "\r", "")
CURRENT_YEAR = $$replace(CURRENT_YEAR, "\n", "")
CURRENT_YEAR = $$replace(CURRENT_YEAR, "\t", "")
@ -45,6 +44,7 @@ win32 {
}
DEFINES += COPYRIGHT_YEAR=$${CURRENT_YEAR}
#DEFINES += _LOGOUT_ALWAYS
QMAKE_TARGET_COMPANY = $$PUBLISHER_NAME
QMAKE_TARGET_COPYRIGHT = © $${PUBLISHER_NAME} $${CURRENT_YEAR}. All rights reserved.
@ -118,13 +118,13 @@ win32:contains(QMAKE_TARGET.arch, arm64): {
}
linux-clang-libc++ {
CONFIG += core_linux
CONFIG += core_linux
CONFIG += core_linux_64
CONFIG += core_linux_clang
message("linux-64-clang-libc++")
}
linux-clang-libc++-32 {
CONFIG += core_linux
CONFIG += core_linux
CONFIG += core_linux_32
CONFIG += core_linux_clang
message("linux-32-clang-libc++")
@ -180,9 +180,9 @@ mac {
!core_ios {
CONFIG += core_mac
CONFIG += core_mac_64
DEFINES += _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
}
DEFINES += _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
}
# DEFINES
@ -199,31 +199,58 @@ core_win_64 {
DEFINES += WIN64 _WIN64
}
defineTest(startsWith) {
tmp = $$2
tmp ~= s,^$$re_escape($$1),,
!equals(tmp, $$2): return(true)
return(false)
}
core_linux {
DEFINES += LINUX _LINUX
QMAKE_CUSTOM_SYSROOT = $$(QMAKE_CUSTOM_SYSROOT)
QMAKE_CUSTOM_SYSROOT_BIN = $$(QMAKE_CUSTOM_SYSROOT)/usr/bin/
QMAKE_CUSTOM_SYSROOT = $$(QMAKE_CUSTOM_SYSROOT)
!isEmpty(QMAKE_CUSTOM_SYSROOT) {
CONFIG += core_linix_use_sysroot
message("using custom sysroot $$QMAKE_CUSTOM_SYSROOT")
core_linux_64 {
!linux_arm64 { # x86_64
QMAKE_CUSTOM_SYSROOT_LIB = $$(QMAKE_CUSTOM_SYSROOT)/usr/lib/x86_64-linux-gnu
!isEmpty(QMAKE_CUSTOM_SYSROOT) {
message("using custom sysroot $$QMAKE_CUSTOM_SYSROOT")
QMAKE_CC = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "gcc")
QMAKE_CXX = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "g++")
QMAKE_LINK = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "g++")
QMAKE_LINK_SHLIB = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "g++")
QMAKE_CXXFLAGS += --sysroot $$QMAKE_CUSTOM_SYSROOT
QMAKE_LFLAGS += --sysroot $$QMAKE_CUSTOM_SYSROOT
}
QMAKE_CUSTOM_SYSROOT_BIN = $$(QMAKE_CUSTOM_SYSROOT_BIN)
isEmpty(QMAKE_CUSTOM_SYSROOT_BIN) {
QMAKE_CUSTOM_SYSROOT_BIN = $$QMAKE_CUSTOM_SYSROOT/usr/bin
}
QMAKE_CUSTOM_SYSROOT_BIN = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , /)
startsWith($$QMAKE_CUSTOM_SYSROOT, $$QMAKE_CUSTOM_SYSROOT_BIN) {
message("Using compilers from same sysroot")
QMAKE_CC = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "gcc")
QMAKE_CXX = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "g++")
QMAKE_LINK = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "g++")
QMAKE_LINK_SHLIB = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "g++")
QMAKE_AR = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "ar") cqs
QMAKE_RANLIB = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "ranlib")
QMAKE_STRIP = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "strip")
} else {
message("Using cross-compilers from host sysroot")
QMAKE_CC = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "aarch64-linux-gnu-gcc")
QMAKE_CXX = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "aarch64-linux-gnu-g++")
QMAKE_LINK = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "aarch64-linux-gnu-g++")
QMAKE_LINK_SHLIB = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "aarch64-linux-gnu-g++")
QMAKE_AR = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "aarch64-linux-gnu-ar") cqs
QMAKE_RANLIB = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "aarch64-linux-gnu-ranlib")
QMAKE_STRIP = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "aarch64-linux-gnu-strip")
QMAKE_OBJCOPY = $$join(QMAKE_CUSTOM_SYSROOT_BIN, , , "aarch64-linux-gnu-objcopy")
}
QMAKE_CFLAGS += --sysroot=$$QMAKE_CUSTOM_SYSROOT
QMAKE_CXXFLAGS += --sysroot=$$QMAKE_CUSTOM_SYSROOT -std=gnu++1y
QMAKE_LFLAGS += --sysroot=$$QMAKE_CUSTOM_SYSROOT
QMAKE_INCDIR += $$QMAKE_CUSTOM_SYSROOT/usr/include
}
}
gcc {
COMPILER_VERSION = $$system($$QMAKE_CXX " -dumpversion")
COMPILER_VERSION = $$system($$QMAKE_CXX " -dumpversion")
COMPILER_MAJOR_VERSION_ARRAY = $$split(COMPILER_VERSION, ".")
COMPILER_MAJOR_VERSION = $$member(COMPILER_MAJOR_VERSION_ARRAY, 0)
lessThan(COMPILER_MAJOR_VERSION, 5): CONFIG += build_gcc_less_5
@ -253,6 +280,11 @@ core_mac {
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
!apple_silicon:QMAKE_APPLE_DEVICE_ARCHS = x86_64
}
!core_debug {
equals(TEMPLATE, app):QMAKE_POST_LINK += strip $(TARGET)
# TODO: plugin!
}
}
core_linux_clang {
@ -311,6 +343,10 @@ core_linux {
core_linux {
equals(TEMPLATE, app):CONFIG += core_static_link_libstd
plugin:CONFIG += core_static_link_libstd
equals(TEMPLATE, app):QMAKE_LFLAGS_RELEASE += -Wl,-s
plugin:QMAKE_LFLAGS_RELEASE += -Wl,-s
}
core_win_32 {
@ -320,7 +356,7 @@ core_win_64 {
CORE_BUILDS_PLATFORM_PREFIX = win_64
}
core_win_arm64 {
CORE_BUILDS_PLATFORM_PREFIX = win_arm64
CORE_BUILDS_PLATFORM_PREFIX = win_arm64
}
core_linux_32 {
CORE_BUILDS_PLATFORM_PREFIX = linux_32
@ -342,27 +378,6 @@ core_linux_arm {
linux_arm64 {
CORE_BUILDS_PLATFORM_PREFIX = linux_arm64
DEFINES += _ARM_ALIGN_
ARM64_TOOLCHAIN_BIN = $$(ARM64_TOOLCHAIN_BIN)
ARM64_TOOLCHAIN_BIN_PREFIX = $$(ARM64_TOOLCHAIN_BIN_PREFIX)
!isEmpty(ARM64_TOOLCHAIN_BIN){
!isEmpty(ARM64_TOOLCHAIN_BIN_PREFIX){
ARM64_TOOLCHAIN_BIN_FULL = $$ARM64_TOOLCHAIN_BIN/$$ARM64_TOOLCHAIN_BIN_PREFIX
message("using arm64 toolchain $$ARM64_TOOLCHAIN_BIN")
QMAKE_CC = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "gcc")
QMAKE_CXX = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_LINK_SHLIB = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "g++")
QMAKE_AR = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "ar cqs")
QMAKE_OBJCOPY = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "objcopy")
QMAKE_NM = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "nm -P")
QMAKE_STRIP = $$join(ARM64_TOOLCHAIN_BIN_FULL, , , "strip")
}
}
}
core_ios {
CORE_BUILDS_PLATFORM_PREFIX = ios
@ -463,6 +478,15 @@ core_android {
!core_android_no_unistd {
DEFINES += HAVE_UNISTD_H HAVE_FCNTL_H
}
core_release {
QMAKE_CFLAGS += -g0
QMAKE_CXXFLAGS += -g0
QMAKE_LFLAGS += -Wl,-s
QMAKE_CFLAGS -= -fno-limit-debug-info
QMAKE_CXXFLAGS -= -fno-limit-debug-info
}
}
core_debug {
@ -689,3 +713,105 @@ ADD_INC_PATH = $$(ADDITIONAL_INCLUDE_PATH)
!disable_precompiled_header {
CONFIG += precompile_header
}
SWIFT_SOURCES=
defineTest(UseSwift) {
isEmpty(SWIFT_SOURCES): return(false)
# work only on ios and mac
!core_ios:!core_mac {
return(false)
}
# path to the bridging header that exposes Objective-C code to Swift
BRIDGING_HEADER = $$1
# sdk and toolchain (set from environment variables)
SDK_PATH = $$(SDK_PATH)
XCODE_TOOLCHAIN_PATH = $$(XCODE_TOOLCHAIN_PATH)
IOS_TARGET_PLATFORM = apple-ios11.0
SWIFT_GEN_HEADERS_PATH = $$PWD_ROOT_DIR/core_build/$$CORE_BUILDS_PLATFORM_PREFIX/$$CORE_BUILDS_CONFIGURATION_PREFIX
ARCHS = arm64
# simulator
xcframework_platform_ios_simulator {
IOS_TARGET_PLATFORM = $${IOS_TARGET_PLATFORM}-simulator
SWIFT_GEN_HEADERS_PATH = $$SWIFT_GEN_HEADERS_PATH/simulator
ARCHS += x86_64
}
# add swift compiler for each architecture
SWIFT_COMPILERS_OUT =
for(ARCH, ARCHS) {
COMPILER_NAME = swift_compiler_$${ARCH}
COMPILER_OUTPUT = $$SWIFT_GEN_HEADERS_PATH/swift_module_$${ARCH}.o
SWIFT_COMPILERS_OUT += $$COMPILER_OUTPUT
$${COMPILER_NAME}.name = SwiftCompiler_$${ARCH}
$${COMPILER_NAME}.input = SWIFT_SOURCES
$${COMPILER_NAME}.output = $$COMPILER_OUTPUT
SWIFT_CMD = swiftc -c $$SWIFT_SOURCES \
-module-name SwiftModule \
-whole-module-optimization \
-emit-objc-header \
-emit-objc-header-path $$SWIFT_GEN_HEADERS_PATH/SwiftModule-Swift.h \
-emit-object \
-sdk $$SDK_PATH \
-target $${ARCH}-$${IOS_TARGET_PLATFORM} \
-o $$COMPILER_OUTPUT \
-framework UIKit
!isEmpty(BRIDGING_HEADER) {
SWIFT_CMD += -import-objc-header $$BRIDGING_HEADER
}
$${COMPILER_NAME}.commands = $$SWIFT_CMD
$${COMPILER_NAME}.CONFIG = combine target_predeps no_link
export($${COMPILER_NAME}.name)
export($${COMPILER_NAME}.input)
export($${COMPILER_NAME}.output)
export($${COMPILER_NAME}.commands)
export($${COMPILER_NAME}.CONFIG)
QMAKE_EXTRA_COMPILERS += $${COMPILER_NAME}
}
# add lipo tool execution to form universal binary
LIPO_OUT = $$SWIFT_GEN_HEADERS_PATH/swift_module.o
lipo_tool.name = LipoTool
# as input for lipo_tool we set SWIFT_SOURCES (not SWIFT_COMPILERS_OUT as it won't be executed otherwise!)
lipo_tool.input = SWIFT_SOURCES
# compiled swift sources go into depends
lipo_tool.depends = $$SWIFT_COMPILERS_OUT
lipo_tool.output = $$LIPO_OUT
lipo_tool.commands = lipo -create $$SWIFT_COMPILERS_OUT -output $$LIPO_OUT
lipo_tool.CONFIG = combine target_predeps no_link
lipo_tool.variable_out = OBJECTS
export(lipo_tool.name)
export(lipo_tool.input)
export(lipo_tool.depends)
export(lipo_tool.output)
export(lipo_tool.commands)
export(lipo_tool.CONFIG)
export(lipo_tool.variable_out)
QMAKE_EXTRA_COMPILERS += lipo_tool
export(QMAKE_EXTRA_COMPILERS)
INCLUDEPATH += $$SWIFT_GEN_HEADERS_PATH
export(INCLUDEPATH)
# link with libs from toolchain
SWIFT_LIB_PATH = $$XCODE_TOOLCHAIN_PATH/usr/lib/swift/iphoneos
xcframework_platform_ios_simulator {
SWIFT_LIB_PATH = $$XCODE_TOOLCHAIN_PATH/usr/lib/swift/iphonesimulator
}
LIBS += -L$$SWIFT_LIB_PATH
LIBS += -lswiftCore -lswiftFoundation -lswiftObjectiveC
export(LIBS)
OTHER_FILES += $$SWIFT_SOURCES
export(OTHER_FILES)
return(true)
}

View File

@ -45,6 +45,10 @@
#undef DeleteFile
#endif
#if defined(GetSystemDirectory)
#undef GetSystemDirectory
#endif
#ifndef _BUILD_FILE_CROSSPLATFORM_H_
#define _BUILD_FILE_CROSSPLATFORM_H_

View File

@ -246,6 +246,11 @@ namespace NSSystemPath
wsNewPath.pop_back();
#if !defined(_WIN32) && !defined(_WIN64)
if (L'/' == strPath[0] || L'\\' == strPath[0])
return L'/' + wsNewPath;
#endif
return wsNewPath;
}

View File

@ -195,6 +195,16 @@ namespace NSStringUtils
m_pDataCur = m_pData;
m_lSizeCur = m_lSize;
}
CStringBuilder::CStringBuilder(size_t nSize)
{
m_lSize = nSize;
m_pData = (wchar_t*)malloc(m_lSize * sizeof(wchar_t));
m_lSizeCur = 0;
m_pDataCur = m_pData;
return;
}
CStringBuilder::~CStringBuilder()
{
if (NULL != m_pData)

View File

@ -86,6 +86,7 @@ namespace NSStringUtils
public:
CStringBuilder();
CStringBuilder(size_t nSize);
virtual ~CStringBuilder();
virtual void AddSize(size_t nSize);

View File

@ -29,11 +29,11 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef _SYSTEMUTILS_H
#define _SYSTEMUTILS_H
#pragma once
#include <string>
#include "../../Common/kernel_config.h"
#include "../../OdfFile/Common/logging.h"
#define VALUE_STRINGIFY(d) L##d
#define VALUE_TO_STR(v) VALUE_STRINGIFY(v)
@ -59,7 +59,8 @@ namespace NSSystemUtils
static const wchar_t* gc_EnvLastModifiedBy = L"LAST_MODIFIED_BY";
static const wchar_t* gc_EnvModified = L"MODIFIED";
static const wchar_t* gc_EnvMemoryLimit = L"X2T_MEMORY_LIMIT";
static const wchar_t* gc_EnvMemoryLimitDefault = L"3GiB";
static const wchar_t* gc_EnvMemoryLimitDefault = L"4GiB";
static const wchar_t* gc_EnvSigningKeystorePassphrase = L"SIGNING_KEYSTORE_PASSPHRASE";
KERNEL_DECL std::string GetEnvVariableA(const std::wstring& strName);
KERNEL_DECL std::wstring GetEnvVariable(const std::wstring& strName);
@ -76,4 +77,3 @@ namespace NSSystemUtils
};
KERNEL_DECL std::wstring GetSystemDirectory(const SystemDirectoryType& type);
}
#endif // _SYSTEMUTILS_H

View File

@ -16,7 +16,15 @@
static tsize_t
_tiffReadProcEx(thandle_t fd, tdata_t buf, tsize_t size)
{
return (tsize_t)((CxFile*)fd)->Read(buf, 1, size);
tsize_t nReadCount = (tsize_t)((CxFile*)fd)->Read(buf, 1, size);
if (nReadCount < size)
{
memset(static_cast<char*>(buf) + nReadCount, 0, size - nReadCount);
return size;
}
return nReadCount;
}
static tsize_t

View File

@ -26,7 +26,7 @@ def _loadLibrary(path):
library_name = 'libdocbuilder.c.dylib'
# if there is no dylib file, get library from framework
if not os.path.exists(path + '/' + library_name):
path = path + '/docbuilder.c.framework'
path = path + '/docbuilder.c.framework/Versions/A'
library_name = 'docbuilder.c'
_lib = ctypes.CDLL(path + '/' + library_name)

View File

@ -347,11 +347,11 @@ bool CV8RealTimeWorker::OpenFile(const std::wstring& sBasePath, const std::wstri
}
if (!bIsBreak)
bIsBreak = !this->ExecuteCommand(L"Api.asc_nativeInitBuilder();");
bIsBreak = !this->ExecuteCommand(L"Asc.editor.asc_nativeInitBuilder();");
if (!bIsBreak)
bIsBreak = !this->ExecuteCommand(L"Api.asc_SetSilentMode(true);");
bIsBreak = !this->ExecuteCommand(L"Asc.editor.asc_SetSilentMode(true);");
if (!bIsBreak)
bIsBreak = !this->ExecuteCommand(L"Api.asc_showComments();");
bIsBreak = !this->ExecuteCommand(L"Asc.editor.asc_showComments();");
LOGGER_SPEED_LAP("open");
@ -425,7 +425,7 @@ bool CV8RealTimeWorker::SaveFileWithChanges(int type, const std::wstring& _path,
bIsSilentMode = true;
if (bIsSilentMode)
this->ExecuteCommand(L"Api.asc_SetSilentMode(false);", NULL, isEnterContext);
this->ExecuteCommand(L"Asc.editor.asc_SetSilentMode(false);", NULL, isEnterContext);
std::wstring strError;
bool bIsError = Doct_renderer_SaveFile_ForBuilder(_formatDst,
@ -437,7 +437,7 @@ bool CV8RealTimeWorker::SaveFileWithChanges(int type, const std::wstring& _path,
sJsonParams);
if (bIsSilentMode)
this->ExecuteCommand(L"Api.asc_SetSilentMode(true);", NULL, isEnterContext);
this->ExecuteCommand(L"Asc.editor.asc_SetSilentMode(true);", NULL, isEnterContext);
if (isEnterContext)
m_context->Exit();
@ -1507,7 +1507,7 @@ namespace NSDoctRenderer
if (m_pInternal->m_oParams.m_bSaveWithDoctrendererMode)
{
// перед сохранением в такой схеме нужно скинуть изменения
this->ExecuteCommand(L"Api.asc_Save();");
this->ExecuteCommand(L"Asc.editor.asc_Save();");
}
const wchar_t* sParams = NULL;

View File

@ -287,7 +287,10 @@ namespace NSDoctRenderer
JSSmart<CJSObject> js_objectApi = api_js_maybe_null;
if (!js_objectApi.IsInit() || js_objectApi->isUndefined())
js_objectApi = global_js->get("Api")->toObject();
{
JSSmart<CJSObject> js_objectAsc = global_js->get("Asc")->toObject();
js_objectApi = js_objectAsc->get("editor")->toObject();
}
bool bIsBreak = false;
if (js_objectApi->isUndefined() || !js_objectApi->isObject())
@ -687,7 +690,8 @@ namespace NSDoctRenderer
bIsBreak = true;
}
js_objectApi = global_js->get("Api")->toObject();
JSSmart<CJSObject> js_objectAsc = global_js->get("Asc")->toObject();
js_objectApi = js_objectAsc->get("editor")->toObject();
if (try_catch->Check())
{
strError = L"code=\"open\"";

View File

@ -120,7 +120,7 @@ public:
}
public:
bool OpenFile(const std::wstring& sFile, const std::wstring& sPassword)
bool OpenFile(const std::wstring& sFile, const wchar_t* sPassword)
{
CloseFile();
@ -171,7 +171,7 @@ public:
return m_pFile ? true : false;
}
bool OpenFile(BYTE* data, LONG size, const std::wstring& sPassword)
bool OpenFile(BYTE* data, LONG size, const wchar_t* sPassword)
{
CloseFile();
@ -245,7 +245,18 @@ public:
return 0;
}
bool CheckOwnerPassword(const wchar_t* sPassword)
{
if (m_nType == 0)
return ((CPdfFile*)m_pFile)->CheckOwnerPassword(sPassword);
return true;
}
bool CheckPerm(int nPerm)
{
if (m_nType == 0)
return ((CPdfFile*)m_pFile)->CheckPerm(nPerm);
return true;
}
BYTE* GetInfo()
{
NSWasm::CData oRes;
@ -311,6 +322,28 @@ public:
return ((CPdfFile*)m_pFile)->UnmergePages();
return false;
}
bool RedactPage(int nPageIndex, double* arrRedactBox, int nLengthX8, BYTE* data, int size, bool bCopy = false)
{
if (m_nType == 0)
{
// Память из CDrawingFileEmbed освобождается сразу после вызова функции, поэтому копируем
if (bCopy)
{
BYTE* pCopy = (BYTE*)malloc(size);
memcpy(pCopy, data, size);
data = pCopy;
}
// Захватывает полученную память data
return ((CPdfFile*)m_pFile)->RedactPage(nPageIndex, arrRedactBox, nLengthX8, data, size);
}
return false;
}
bool UndoRedact()
{
if (m_nType == 0)
return ((CPdfFile*)m_pFile)->UndoRedact();
return false;
}
BYTE* GetGlyphs(int nPageIndex)
{
@ -421,6 +454,20 @@ public:
if (m_nType == 0)
((CPdfFile*)m_pFile)->SetCMapMemory(data, size);
}
void SetScanPageFonts(int nPageIndex)
{
if (NULL == m_pImageStorage)
m_pImageStorage = NSDocxRenderer::CreateWasmImageStorage();
CDocxRenderer oRenderer(m_pApplicationFonts);
oRenderer.SetExternalImageStorage(m_pImageStorage);
oRenderer.SetTextAssociationType(NSDocxRenderer::TextAssociationType::tatParagraphToShape);
oRenderer.ScanPageBin(m_pFile, nPageIndex);
if (m_nType == 0)
((CPdfFile*)m_pFile)->SetPageFonts(nPageIndex);
}
BYTE* ScanPage(int nPageIndex, int mode)
{
if (NULL == m_pImageStorage)
@ -457,6 +504,9 @@ public:
return NULL;
}
if (m_nType == 0)
((CPdfFile*)m_pFile)->SetPageFonts(nPageIndex);
BYTE* res = oRes.GetBuffer();
oRes.ClearWithoutAttack();
return res;
@ -545,6 +595,19 @@ public:
}
return NULL;
}
BYTE* GetGIDByUnicode(const std::string& sPathA)
{
if (m_nType != 0)
return NULL;
std::wstring sFontName = UTF8_TO_U(sPathA);
return ((CPdfFile*)m_pFile)->GetGIDByUnicode(sFontName);
}
BYTE* GetGIDByUnicode(const std::wstring& wsPathA)
{
if (m_nType != 0)
return NULL;
return ((CPdfFile*)m_pFile)->GetGIDByUnicode(wsPathA);
}
std::wstring GetFontBinaryNative(const std::wstring& sName)
{

View File

@ -26,7 +26,8 @@ CDrawingFileEmbed::~CDrawingFileEmbed()
JSSmart<CJSValue> CDrawingFileEmbed::OpenFile(JSSmart<CJSValue> sFile, JSSmart<CJSValue> sPassword)
{
bool bResult = m_pFile->OpenFile(sFile->toStringW(), sPassword->isString() ? sPassword->toStringW() : L"");
std::wstring wsPassword = sPassword->isString() ? sPassword->toStringW() : L"";
bool bResult = m_pFile->OpenFile(sFile->toStringW(), sPassword->isString() ? wsPassword.c_str() : NULL);
return CJSContext::createBool(bResult);
}
JSSmart<CJSValue> CDrawingFileEmbed::CloseFile()
@ -136,6 +137,10 @@ JSSmart<CJSValue> CDrawingFileEmbed::DestroyTextInfo()
m_pFile->DestroyTextInfo();
return CJSContext::createUndefined();
}
JSSmart<CJSValue> CDrawingFileEmbed::GetGIDByUnicode(JSSmart<CJSValue> sId)
{
return WasmMemoryToJS(m_pFile->GetGIDByUnicode(sId->toStringW()));
}
JSSmart<CJSValue> CDrawingFileEmbed::IsNeedCMap()
{
return CJSContext::createBool(false);
@ -144,6 +149,11 @@ JSSmart<CJSValue> CDrawingFileEmbed::ScanPage(JSSmart<CJSValue> nPageIndex, JSSm
{
return WasmMemoryToJS(m_pFile->ScanPage(nPageIndex->toInt32(), mode->toInt32()));
}
JSSmart<CJSValue> CDrawingFileEmbed::SetScanPageFonts(JSSmart<CJSValue> nPageIndex)
{
m_pFile->SetScanPageFonts(nPageIndex->toInt32());
return CJSContext::createUndefined();
}
JSSmart<CJSValue> CDrawingFileEmbed::GetImageBase64(JSSmart<CJSValue> rId)
{
@ -207,6 +217,51 @@ JSSmart<CJSValue> CDrawingFileEmbed::UnmergePages()
return CJSContext::createBool(m_pFile->UnmergePages());
return CJSContext::createBool(false);
}
JSSmart<CJSValue> CDrawingFileEmbed::RedactPage(JSSmart<CJSValue> nPageIndex, JSSmart<CJSValue> arrRedactBox, JSSmart<CJSValue> dataFiller)
{
bool result = false;
if (m_pFile)
{
int pageIndex = nPageIndex->toInt32();
JSSmart<CJSArray> arrBox = arrRedactBox->toArray();
int nCountBox = arrBox->getCount();
double* pBox = NULL;
if (0 < nCountBox)
pBox = new double[nCountBox];
for (int i = 0; i < nCountBox; i++)
pBox[i] = arrBox->get(i)->toDouble();
JSSmart<CJSTypedArray> dataPtr = dataFiller->toTypedArray();
CJSDataBuffer buffer = dataPtr->getData();
result = m_pFile->RedactPage(pageIndex, pBox, nCountBox / 8, buffer.Data, (int)buffer.Len, true);
if (pBox)
delete[] pBox;
if (buffer.IsExternalize)
buffer.Free();
}
return CJSContext::createBool(result);
}
JSSmart<CJSValue> CDrawingFileEmbed::UndoRedact()
{
if (m_pFile)
return CJSContext::createBool(m_pFile->UndoRedact());
return CJSContext::createBool(false);
}
JSSmart<CJSValue> CDrawingFileEmbed::CheckOwnerPassword(JSSmart<CJSValue> sPassword)
{
std::wstring wsPassword = sPassword->isString() ? sPassword->toStringW() : L"";
bool bResult = m_pFile->CheckOwnerPassword(sPassword->isString() ? wsPassword.c_str() : NULL);
return CJSContext::createBool(bResult);
}
JSSmart<CJSValue> CDrawingFileEmbed::CheckPerm(JSSmart<CJSValue> nPerm)
{
return CJSContext::createBool(m_pFile->CheckPerm(nPerm->toInt32()));
}
bool EmbedDrawingFile(JSSmart<NSJSBase::CJSContext>& context, IOfficeDrawingFile* pFile)
{

View File

@ -43,9 +43,11 @@ public:
JSSmart<CJSValue> GetFontBinary(JSSmart<CJSValue> Id);
JSSmart<CJSValue> GetGlyphs(JSSmart<CJSValue> nPageIndex);
JSSmart<CJSValue> DestroyTextInfo();
JSSmart<CJSValue> GetGIDByUnicode(JSSmart<CJSValue> sId);
JSSmart<CJSValue> IsNeedCMap();
JSSmart<CJSValue> ScanPage(JSSmart<CJSValue> nPageIndex, JSSmart<CJSValue> mode);
JSSmart<CJSValue> SetScanPageFonts(JSSmart<CJSValue> nPageIndex);
JSSmart<CJSValue> GetImageBase64(JSSmart<CJSValue> rId);
@ -54,6 +56,11 @@ public:
JSSmart<CJSValue> SplitPages(JSSmart<CJSValue> arrPageIndexes, JSSmart<CJSValue> data);
JSSmart<CJSValue> MergePages(JSSmart<CJSValue> data, JSSmart<CJSValue> nMaxID, JSSmart<CJSValue> sPrefixForm);
JSSmart<CJSValue> UnmergePages();
JSSmart<CJSValue> RedactPage(JSSmart<CJSValue> nPageIndex, JSSmart<CJSValue> arrRedactBox, JSSmart<CJSValue> dataFiller);
JSSmart<CJSValue> UndoRedact();
JSSmart<CJSValue> CheckOwnerPassword(JSSmart<CJSValue> sPassword);
JSSmart<CJSValue> CheckPerm(JSSmart<CJSValue> nPerm);
DECLARE_EMBED_METHODS
};

View File

@ -194,6 +194,9 @@ JSSmart<CJSValue> CNativeControlEmbed::ZipOpenBase64(JSSmart<CJSValue> name)
JSSmart<CJSValue> CNativeControlEmbed::ZipFileAsString(JSSmart<CJSValue> name)
{
if (m_pInternal->m_oZipWorker.m_sTmpFolder.empty())
return CJSContext::createUndefined();
BYTE* pData = NULL;
DWORD len = 0;
m_pInternal->m_oZipWorker.GetFileData(name->toStringW(), pData, len);
@ -202,6 +205,9 @@ JSSmart<CJSValue> CNativeControlEmbed::ZipFileAsString(JSSmart<CJSValue> name)
JSSmart<CJSValue> CNativeControlEmbed::ZipFileAsBinary(JSSmart<CJSValue> name)
{
if (m_pInternal->m_oZipWorker.m_sTmpFolder.empty())
return CJSContext::createUndefined();
return CJSContext::createUint8Array(m_pInternal->m_oZipWorker.m_sTmpFolder + L"/" + name->toStringW());
}

View File

@ -23,13 +23,19 @@
-(JSValue*) GetFontBinary : (JSValue*)Id;
-(JSValue*) GetGlyphs : (JSValue*)nPageIndex;
-(JSValue*) DestroyTextInfo;
-(JSValue*) GetGIDByUnicode : (JSValue*)sId;
-(JSValue*) IsNeedCMap;
-(JSValue*) ScanPage : (JSValue*)nPageIndex : (JSValue*)mode;
-(JSValue*) SetScanPageFonts : (JSValue*)nPageIndex;
-(JSValue*) GetImageBase64 : (JSValue*)rId;
-(JSValue*) FreeWasmData : (JSValue*)typedArray;
-(JSValue*) SplitPages : (JSValue*)arrPageIndexes : (JSValue*)data;
-(JSValue*) MergePages : (JSValue*)data : (JSValue*)nMaxID : (JSValue*)sPrefixForm;
-(JSValue*) UnmergePages;
-(JSValue*) RedactPage : (JSValue*)nPageIndex : (JSValue*)arrRedactBox : (JSValue*)dataFiller;
-(JSValue*) UndoRedact;
-(JSValue*) CheckOwnerPassword : (JSValue*)sPassword;
-(JSValue*) CheckPerm : (JSValue*)nPerm;
@end
@interface CJSCDrawingFileEmbed : NSObject<IJSCDrawingFileEmbed, JSEmbedObjectProtocol>
@ -60,13 +66,19 @@ FUNCTION_WRAPPER_JS_6(GetAnnotationsAP, GetAnnotationsAP)
FUNCTION_WRAPPER_JS_1(GetFontBinary, GetFontBinary)
FUNCTION_WRAPPER_JS_1(GetGlyphs, GetGlyphs)
FUNCTION_WRAPPER_JS_0(DestroyTextInfo, DestroyTextInfo)
FUNCTION_WRAPPER_JS_1(GetGIDByUnicode, GetGIDByUnicode)
FUNCTION_WRAPPER_JS_0(IsNeedCMap, IsNeedCMap)
FUNCTION_WRAPPER_JS_2(ScanPage, ScanPage)
FUNCTION_WRAPPER_JS_1(SetScanPageFonts, SetScanPageFonts)
FUNCTION_WRAPPER_JS_1(GetImageBase64, GetImageBase64)
FUNCTION_WRAPPER_JS_1(FreeWasmData, FreeWasmData)
FUNCTION_WRAPPER_JS_2(SplitPages, SplitPages)
FUNCTION_WRAPPER_JS_3(MergePages, MergePages)
FUNCTION_WRAPPER_JS_0(UnmergePages, UnmergePages)
FUNCTION_WRAPPER_JS_3(RedactPage, RedactPage)
FUNCTION_WRAPPER_JS_0(UndoRedact, UndoRedact)
FUNCTION_WRAPPER_JS_1(CheckOwnerPassword, CheckOwnerPassword)
FUNCTION_WRAPPER_JS_1(CheckPerm, CheckPerm)
@end
class CDrawingFileEmbedAdapter : public CJSEmbedObjectAdapterJSC

View File

@ -26,13 +26,19 @@ namespace NSDrawingFileEmbed
FUNCTION_WRAPPER_V8_1(_GetFontBinary, GetFontBinary)
FUNCTION_WRAPPER_V8_1(_GetGlyphs, GetGlyphs)
FUNCTION_WRAPPER_V8_0(_DestroyTextInfo, DestroyTextInfo)
FUNCTION_WRAPPER_V8_1(_GetGIDByUnicode, GetGIDByUnicode)
FUNCTION_WRAPPER_V8_0(_IsNeedCMap, IsNeedCMap)
FUNCTION_WRAPPER_V8_2(_ScanPage, ScanPage)
FUNCTION_WRAPPER_V8_1(_SetScanPageFonts, SetScanPageFonts)
FUNCTION_WRAPPER_V8_1(_GetImageBase64, GetImageBase64)
FUNCTION_WRAPPER_V8_1(_FreeWasmData, FreeWasmData)
FUNCTION_WRAPPER_V8_2(_SplitPages, SplitPages)
FUNCTION_WRAPPER_V8_3(_MergePages, MergePages)
FUNCTION_WRAPPER_V8_0(_UnmergePages, UnmergePages)
FUNCTION_WRAPPER_V8_3(_RedactPage, RedactPage)
FUNCTION_WRAPPER_V8_0(_UndoRedact, UndoRedact)
FUNCTION_WRAPPER_V8_1(_CheckOwnerPassword, CheckOwnerPassword)
FUNCTION_WRAPPER_V8_1(_CheckPerm, CheckPerm)
v8::Handle<v8::ObjectTemplate> CreateTemplate(v8::Isolate* isolate)
{
@ -58,13 +64,19 @@ namespace NSDrawingFileEmbed
NSV8Objects::Template_Set(result, "GetFontBinary", _GetFontBinary);
NSV8Objects::Template_Set(result, "GetGlyphs", _GetGlyphs);
NSV8Objects::Template_Set(result, "DestroyTextInfo", _DestroyTextInfo);
NSV8Objects::Template_Set(result, "GetGIDByUnicode", _GetGIDByUnicode);
NSV8Objects::Template_Set(result, "IsNeedCMap", _IsNeedCMap);
NSV8Objects::Template_Set(result, "ScanPage", _ScanPage);
NSV8Objects::Template_Set(result, "SetScanPageFonts", _SetScanPageFonts);
NSV8Objects::Template_Set(result, "GetImageBase64", _GetImageBase64);
NSV8Objects::Template_Set(result, "FreeWasmData", _FreeWasmData);
NSV8Objects::Template_Set(result, "SplitPages", _SplitPages);
NSV8Objects::Template_Set(result, "MergePages", _MergePages);
NSV8Objects::Template_Set(result, "UnmergePages", _UnmergePages);
NSV8Objects::Template_Set(result, "RedactPage", _RedactPage);
NSV8Objects::Template_Set(result, "UndoRedact", _UndoRedact);
NSV8Objects::Template_Set(result, "CheckOwnerPassword", _CheckOwnerPassword);
NSV8Objects::Template_Set(result, "CheckPerm", _CheckPerm);
return handle_scope.Escape(result);
}

View File

@ -461,6 +461,8 @@ namespace NSJSBase
v8::SnapshotCreator snapshotCreator;
v8::Isolate* isolate = snapshotCreator.GetIsolate();
{
CV8TryCatch try_catch(isolate);
v8::HandleScope handle_scope(isolate);
// Create a new context
v8::Local<v8::Context> context = v8::Context::New(isolate);
@ -472,11 +474,12 @@ namespace NSJSBase
global->Set(context, v8::String::NewFromUtf8Literal(isolate, "self"), global).Check();
global->Set(context, v8::String::NewFromUtf8Literal(isolate, "native"), v8::Undefined(isolate)).Check();
// Compile and run
// Compile
v8::Local<v8::String> source = v8::String::NewFromUtf8(isolate, script.c_str()).ToLocalChecked();
v8::Local<v8::Script> script = v8::Script::Compile(context, source).ToLocalChecked();
// Run
script->Run(context).IsEmpty();
snapshotCreator.SetDefaultContext(context);
}
v8::StartupData data = snapshotCreator.CreateBlob(v8::SnapshotCreator::FunctionCodeHandling::kKeep);

View File

@ -62,7 +62,13 @@ v8::Local<v8::String> CreateV8String(v8::Isolate* i, const std::string& str);
#include <android/log.h>
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, "js", __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, "js", __VA_ARGS__)
#endif
#ifdef _DEBUG
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, "js", __VA_ARGS__)
#else
// should be disabled for release builds
#define LOGD(...)
#endif // _DEBUG
#endif // ANDROID_LOGS
#endif
@ -799,6 +805,9 @@ namespace NSJSBase
CV8TryCatch() : CJSTryCatch(), try_catch(V8IsolateOneArg)
{
}
CV8TryCatch(v8::Isolate* isolate) : CJSTryCatch(), try_catch(isolate)
{
}
virtual ~CV8TryCatch()
{
}

View File

@ -837,53 +837,63 @@ public:
CSymbolSimpleChecker2 oAllChecker(arSymbolsAll, nMaxSymbol);
std::map<std::wstring, int> mapFontsPriorityStandard;
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"ASCW3", 1));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Arial", 2));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Times New Roman", 3));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Tahoma", 4));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Cambria", 5));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Calibri", 6));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Verdana", 7));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Georgia", 8));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Open Sans", 9));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Liberation Sans", 10));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Helvetica", 11));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Nimbus Sans L", 12));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"DejaVu Sans", 13));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Liberation Serif", 14));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Trebuchet MS", 15));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Courier New", 16));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Carlito", 17));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Segoe UI", 18));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimSun", 19));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Gothic", 20));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Nirmala UI", 21));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Batang", 22));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MS Mincho", 23));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Wingdings", 24));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Microsoft JhengHei", 25));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Microsoft JhengHei UI", 26));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Microsoft YaHei", 27));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"PMingLiU", 28));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"MingLiU", 29));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"DFKai-SB", 30));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"FangSong", 31));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"KaiTi", 32));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimKai", 33));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"SimHei", 34));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Meiryo", 35));
int nCurrentPriority = 1;
#define SET_FONT_PRIORITY(fontName) mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(fontName, nCurrentPriority++))
SET_FONT_PRIORITY(L"ASCW3");
SET_FONT_PRIORITY(L"Arial");
SET_FONT_PRIORITY(L"Times New Roman");
SET_FONT_PRIORITY(L"Tahoma");
SET_FONT_PRIORITY(L"Cambria");
SET_FONT_PRIORITY(L"Calibri");
SET_FONT_PRIORITY(L"Verdana");
SET_FONT_PRIORITY(L"Georgia");
SET_FONT_PRIORITY(L"Open Sans");
SET_FONT_PRIORITY(L"Liberation Sans");
SET_FONT_PRIORITY(L"Helvetica");
SET_FONT_PRIORITY(L"Nimbus Sans L");
SET_FONT_PRIORITY(L"DejaVu Sans");
SET_FONT_PRIORITY(L"Liberation Serif");
SET_FONT_PRIORITY(L"Trebuchet MS");
SET_FONT_PRIORITY(L"Courier New");
SET_FONT_PRIORITY(L"Carlito");
SET_FONT_PRIORITY(L"Segoe UI");
SET_FONT_PRIORITY(L"SimSun");
SET_FONT_PRIORITY(L"MS Gothic");
SET_FONT_PRIORITY(L"Nirmala UI");
SET_FONT_PRIORITY(L"Batang");
SET_FONT_PRIORITY(L"MS Mincho");
SET_FONT_PRIORITY(L"Wingdings");
SET_FONT_PRIORITY(L"Microsoft JhengHei");
SET_FONT_PRIORITY(L"Microsoft JhengHei UI");
SET_FONT_PRIORITY(L"Microsoft YaHei");
SET_FONT_PRIORITY(L"PMingLiU");
SET_FONT_PRIORITY(L"MingLiU");
SET_FONT_PRIORITY(L"DFKai-SB");
SET_FONT_PRIORITY(L"FangSong");
SET_FONT_PRIORITY(L"KaiTi");
SET_FONT_PRIORITY(L"SimKai");
SET_FONT_PRIORITY(L"SimHei");
SET_FONT_PRIORITY(L"Meiryo");
#ifdef _MAC
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"PingFang SC", 36));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"PingFang TC", 37));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"PingFang HK", 38));
SET_FONT_PRIORITY(L"PingFang SC");
SET_FONT_PRIORITY(L"PingFang TC");
SET_FONT_PRIORITY(L"PingFang HK");
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Heiti SC", 39));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Heiti TC", 40));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Songti SC", 41));
mapFontsPriorityStandard.insert(std::pair<std::wstring, int>(L"Songti TC", 42));
SET_FONT_PRIORITY(L"Heiti SC");
SET_FONT_PRIORITY(L"Heiti TC");
SET_FONT_PRIORITY(L"Songti SC");
SET_FONT_PRIORITY(L"Songti TC");
#endif
SET_FONT_PRIORITY(L"Malgun Gothic");
SET_FONT_PRIORITY(L"Nanum Gothic");
SET_FONT_PRIORITY(L"NanumGothic");
SET_FONT_PRIORITY(L"Noto Sans KR");
SET_FONT_PRIORITY(L"TakaoGothic");
NSFonts::CApplicationFontsSymbols oApplicationChecker;
// приоритеты шрифтов. по имени (все стили)

View File

@ -36,7 +36,7 @@
#include <vector>
#include "../graphics/pro/Fonts.h"
#define ONLYOFFICE_FONTS_VERSION 14
#define ONLYOFFICE_FONTS_VERSION 15
#define ONLYOFFICE_ALL_FONTS_VERSION 2
class CApplicationFontsWorkerBreaker

View File

@ -731,10 +731,10 @@ void CFontFile::CheckHintsSupport()
int CFontFile::SetCMapForCharCode(long lUnicode, int *pnCMapIndex)
{
*pnCMapIndex = -1;
if (!m_pFace)
if (!m_pFace || !m_pFace->num_charmaps)
return 0;
if ( m_bStringGID || 0 == m_pFace->num_charmaps )
if ( m_bStringGID )
return lUnicode;
int nCharIndex = 0;
@ -1046,6 +1046,28 @@ int CFontFile::GetGIDByUnicode(int code)
return unGID;
}
int CFontFile::GetUnicodeByGID(int gid)
{
if (!m_pFace)
return 0;
FT_ULong charcode;
FT_UInt gindex;
charcode = FT_Get_First_Char(m_pFace, &gindex);
while (gindex != 0)
{
if (gindex == gid)
{
return charcode;
}
charcode = FT_Get_Next_Char(m_pFace, charcode, &gindex);
}
return 0;
}
INT CFontFile::GetString(CGlyphString& oString)
{
int nCountGlyph = oString.GetLength();

View File

@ -254,6 +254,7 @@ public:
double GetCharWidth(int gid);
int GetGIDByUnicode(int code);
int GetUnicodeByGID(int gid);
int GetKerning(FT_UInt unPrevGID, FT_UInt unGID);
void SetStringGID(const INT& bGID);

View File

@ -851,6 +851,14 @@ unsigned int CFontManager::GetGIDByUnicode(const unsigned int& unCode)
return m_pFont->GetGIDByUnicode(unCode);
}
int CFontManager::GetUnicodeByGID(const int& gid)
{
if (!m_pFont)
return 0;
return m_pFont->GetUnicodeByGID(gid);
}
void CFontManager::SetSubpixelRendering(const bool& hmul, const bool& vmul)
{
if (hmul)

View File

@ -186,6 +186,7 @@ public:
virtual std::wstring GetFontType();
virtual unsigned int GetNameIndex(const std::wstring& wsName);
virtual unsigned int GetGIDByUnicode(const unsigned int& unCode);
virtual int GetUnicodeByGID(const int& gid);
virtual void SetSubpixelRendering(const bool& hmul, const bool& vmul);

View File

@ -117,7 +117,7 @@ WASM_EXPORT unsigned int ASC_FT_SetCMapForCharCode(FT_Face face, unsigned int un
return 0;
if ( 0 == face->num_charmaps )
return unicode;
return 0;
unsigned int nCharIndex = 0;

View File

@ -265,15 +265,15 @@
},
{
"folder": "../../",
"files": ["graphics/Image.cpp", "raster/BgraFrame.cpp", "raster/ImageFileFormatChecker.cpp", "graphics/Matrix.cpp"]
"files": ["graphics/Image.cpp", "raster/BgraFrame.cpp", "raster/ImageFileFormatChecker.cpp", "graphics/Matrix.cpp", "graphics/GraphicsPath.cpp"]
},
{
"folder": "../../agg-2.4/src/",
"files": ["agg_trans_affine.cpp"]
"files": ["agg_trans_affine.cpp", "agg_bezier_arc.cpp"]
},
{
"folder": "../../raster/",
"files": ["PICT/PICFile.cpp", "PICT/pic.cpp"]
"files": ["PICT/PICFile.cpp"]
},
{
"folder": "../../graphics/pro/js/qt/raster",

View File

@ -85,6 +85,13 @@ bool Segment::IsEmpty() const noexcept
return Id == 0 && Index == -1 && P.IsZero() && HI.IsZero() && HO.IsZero();
}
bool Segment::Equals(const Segment& other) const noexcept
{
return isZero(P.X - other.P.X) && isZero(P.Y - other.P.Y) &&
isZero(HI.X - other.HI.X) && isZero(HI.Y - other.HI.Y) &&
isZero(HO.X - other.HO.X) && isZero(HO.Y - other.HO.Y);
}
bool Segment::operator==(const Segment& other) const noexcept
{
return (Index == other.Index) && (Id == other.Id);
@ -690,6 +697,12 @@ bool Curve::IsStraight() const noexcept
return !Segment2.IsCurve;
}
bool Curve::Equals(const Curve& other) const noexcept
{
return Segment1.Equals(other.Segment1) &&
Segment2.Equals(other.Segment2);
}
bool Curve::operator==(const Curve& other) const noexcept
{
return Segment1 == other.Segment1 &&
@ -737,11 +750,13 @@ CBooleanOperations::CBooleanOperations(const CGraphicsPath& path1,
const CGraphicsPath& path2,
BooleanOpType op,
long fillType,
bool isLuminosity) :
bool isLuminosity,
bool isSelf) :
Op(op),
Close1(path1.Is_poly_closed()),
Close2(path2.Is_poly_closed()),
IsLuminosity(isLuminosity),
IsSelf(isSelf),
FillType(fillType),
Path1(path1),
Path2(path2)
@ -758,12 +773,35 @@ CGraphicsPath&& CBooleanOperations::GetResult()
return std::move(Result);
}
bool CBooleanOperations::IsSelfInters(const CGraphicsPath& p)
{
PreparePath(p, 1, Segments1, Curves1);
PreparePath(p, 2, Segments2, Curves2);
OriginCurves1 = Curves1;
OriginCurves2 = Curves2;
GetIntersection();
if (Locations.empty())
return false;
else
{
for (const auto& l : Locations)
{
if (!isZero(l->Time) && !isZero(l->Time - 1.0) && l->C.Segment2.Index != l->Inters->C.Segment1.Index)
return true;
}
}
return false;
}
void CBooleanOperations::TraceBoolean()
{
bool reverse = false;
if ((Op == Subtraction || Op == Exclusion) ^
Path1.IsClockwise() ^
Path2.IsClockwise())
if (((Op == Subtraction || Op == Exclusion) ^
Path1.IsClockwise() ^
Path2.IsClockwise()) && !IsSelf)
reverse = true;
PreparePath(Path1, 1, Segments1, Curves1);
@ -774,7 +812,38 @@ void CBooleanOperations::TraceBoolean()
GetIntersection();
if (!Locations.empty())
if (IsSelf)
{
if (Op == Subtraction)
return;
std::vector<std::vector<int>> adj_matr(Locations.size());
for (size_t i = 0; i < Locations.size(); i++)
{
std::vector<int> adj_vec;
if (CheckLocation(Locations[i], true))
adj_vec.push_back(Locations[i]->C.Segment1.Index);
if (CheckLocation(Locations[i], false))
adj_vec.push_back(Locations[i]->C.Segment2.Index);
if (CheckLocation(Locations[i]->Inters, true))
adj_vec.push_back(Locations[i]->Inters->C.Segment1.Index);
if (CheckLocation(Locations[i]->Inters, false))
adj_vec.push_back(Locations[i]->Inters->C.Segment2.Index);
adj_matr[i] = adj_vec;
}
CreateNewPath(adj_matr);
return;
}
else if (Path1 == Path2)
{
Result = std::move(Path1);
return;
}
if (!Locations.empty() && !IsOnlyEnds())
{
int length = static_cast<int>(Locations.size());
for (int i = 0; i < length; i++)
@ -802,6 +871,16 @@ void CBooleanOperations::TraceBoolean()
TraceAllOverlap();
return;
}
if (IsOneCurvePath(1))
{
TraceOneCurvePath1();
return;
}
if (IsOneCurvePath(2))
{
TraceOneCurvePath2();
return;
}
}
SetWinding();
@ -1008,6 +1087,100 @@ void CBooleanOperations::TraceAllOverlap()
}
}
void CBooleanOperations::TraceOneCurvePath1()
{
if (Op == Intersection)
{
Result.StartFigure();
for (const auto& s : Segments1)
{
if (s.Inters && Result.GetPointCount() == 0)
{
Result.MoveTo(s.P.X, s.P.Y);
Segment s2 = GetNextSegment(s);
if (s2.IsCurve)
Result.CurveTo(s2.HI.X + s2.P.X, s2.HI.Y + s2.P.Y,
s2.HO.X + s2.P.X, s2.HO.Y + s2.P.Y,
s2.P.X, s2.P.Y);
else
Result.LineTo(s2.P.X, s2.P.Y);
break;
}
}
}
else if (Op == Union)
{
Result.AddPath(Path2);
for (size_t i = 0; i < Segments1.size(); i++)
{
if (i % 2 == 0)
Result.MoveTo(Segments1[i].P.X, Segments1[i].P.Y);
else if (Segments1[i].IsCurve)
Result.CurveTo(Segments1[i].HI.X + Segments1[i].P.X, Segments1[i].HI.Y + Segments1[i].P.Y,
Segments1[i].HO.X + Segments1[i].P.X, Segments1[i].HO.Y + Segments1[i].P.Y,
Segments1[i].P.X, Segments1[i].P.Y);
else
Result.LineTo(Segments1[i].P.X, Segments1[i].P.Y);
}
}
else
{
Result.StartFigure();
for (size_t i = 0; i < Segments1.size(); i++)
{
if (i % 2 == 0)
Result.MoveTo(Segments1[i].P.X, Segments1[i].P.Y);
else if (Segments1[i].IsCurve)
Result.CurveTo(Segments1[i].HI.X + Segments1[i].P.X, Segments1[i].HI.Y + Segments1[i].P.Y,
Segments1[i].HO.X + Segments1[i].P.X, Segments1[i].HO.Y + Segments1[i].P.Y,
Segments1[i].P.X, Segments1[i].P.Y);
else
Result.LineTo(Segments1[i].P.X, Segments1[i].P.Y);
}
}
}
void CBooleanOperations::TraceOneCurvePath2()
{
if (Op == Intersection)
{
Result.StartFigure();
for (const auto& s : Segments2)
{
if (s.Inters && Result.GetPointCount() == 0)
{
Result.MoveTo(s.P.X, s.P.Y);
Segment s2 = GetNextSegment(s);
if (s2.IsCurve)
Result.CurveTo(s2.HI.X + s2.P.X, s2.HI.Y + s2.P.Y,
s2.HO.X + s2.P.X, s2.HO.Y + s2.P.Y,
s2.P.X, s2.P.Y);
else
Result.LineTo(s2.P.X, s2.P.Y);
break;
}
}
}
else if (Op == Union)
{
Result.AddPath(Path1);
for (size_t i = 0; i < Segments2.size(); i++)
{
if (i % 2 == 0)
Result.MoveTo(Segments2[i].P.X, Segments2[i].P.Y);
else if (Segments2[i].IsCurve)
Result.CurveTo(Segments2[i].HI.X + Segments2[i].P.X, Segments2[i].HI.Y + Segments2[i].P.Y,
Segments2[i].HO.X + Segments2[i].P.X, Segments2[i].HO.Y + Segments2[i].P.Y,
Segments2[i].P.X, Segments2[i].P.Y);
else
Result.LineTo(Segments2[i].P.X, Segments2[i].P.Y);
}
}
else
Result = std::move(Path1);
}
void CBooleanOperations::TracePaths()
{
size_t length = Segments1.size();
@ -1044,7 +1217,10 @@ void CBooleanOperations::TracePaths()
Segment tmp = GetNextSegment(prev.Inters->S);
if (tmp.IsEmpty()) break;
if (tmp.IsValid(Op))
{
s = tmp;
valid = true;
}
}
if (!valid && prev.Inters)
@ -1253,6 +1429,218 @@ void CBooleanOperations::SetVisited(const Segment& segment)
Segments2[segment.Index].Visited = true;
}
void CBooleanOperations::CreateNewPath(const std::vector<std::vector<int>>& adjMatr) noexcept
{
int* loc_visited = new int[Locations.size()];
memset(loc_visited, false, Locations.size());
bool* seg_visited = new bool[Segments1.size()];
memset(seg_visited, false, Segments1.size());
Result.StartFigure();
for (int i = 0; i < Locations.size(); i++)
{
auto loc = Locations[i];
if (loc_visited[i] == 2)
continue;
bool finish = true;
for (size_t j = 0; j < Segments1.size(); j++)
finish = finish && seg_visited[j];
if (finish)
break;
auto add_seg = [&](int x, int prev_x) {
for (int j = adjMatr[x].size() - 1; j >= 0; j--)
{
int ver = adjMatr[x][j];
if (seg_visited[ver] || ver == prev_x)
continue;
seg_visited[ver] = true;
if (Segments1[ver].IsCurve)
{
Segment seg;
auto curve = Curves1[ver];
auto curve1 = Curves1[ver == 0 ? Curves1.size() - 1 : ver - 1];
if (curve.Segment2.Index == Locations[x]->C.Segment2.Index)
{
auto new_curve = curve.DivideAtTime(Locations[x]->Time);
seg = new_curve.Segment1;
}
if (curve.Segment2.Index == Locations[x]->Inters->C.Segment2.Index)
{
auto new_curve = curve.DivideAtTime(Locations[x]->Inters->Time);
seg = new_curve.Segment1;
}
if (curve1.Segment2.Index == Locations[x]->C.Segment2.Index)
{
auto new_curve = curve1.DivideAtTime(Locations[x]->Time);
seg = new_curve.Segment2;
}
if (curve1.Segment2.Index == Locations[x]->Inters->C.Segment2.Index)
{
auto new_curve = curve1.DivideAtTime(Locations[x]->Inters->Time);
seg = new_curve.Segment2;
}
Result.CurveTo(seg.HI.X + seg.P.X, seg.HI.Y + seg.P.Y,
seg.HO.X + seg.P.X, seg.HO.Y + seg.P.Y,
seg.P.X, seg.P.Y);
}
else
Result.LineTo(Segments1[ver].P.X, Segments1[ver].P.Y);
return ver;
}
return -1;
};
auto add_loc = [&](int x, int prev_x) {
while (1)
{
for (int j = 0; j < adjMatr.size(); j++)
{
if (std::find(adjMatr[j].begin(), adjMatr[j].end(), x) != adjMatr[j].end())
{
if (loc_visited[j] == 2 || j == prev_x)
continue;
if (j != i)
loc_visited[j]++;
auto ll = Locations[j];
Curve curve;
double t;
if ((x == Curves1.size() - 1 ? 0 : x + 1) == ll->C.Segment2.Index)
{
curve = Curves1[x];
t = ll->Time;
}
if ((x == Curves1.size() - 1 ? 0 : x + 1) == ll->Inters->C.Segment2.Index)
{
curve = Curves1[x];
t = ll->Inters->Time;
}
if (x == ll->C.Segment2.Index)
{
curve = Curves1[x == 0 ? Curves1.size() - 1 : x - 1];
t = ll->Time;
}
if (x == ll->Inters->C.Segment2.Index)
{
curve = Curves1[x == 0 ? Curves1.size() - 1 : x - 1];
t = ll->Inters->Time;
}
if (curve.Segment2.IsCurve)
{
auto new_curve = curve.DivideAtTime(t);
Result.CurveTo(new_curve.Segment1.HI.X + new_curve.Segment1.P.X, new_curve.Segment1.HI.Y + new_curve.Segment1.P.Y,
new_curve.Segment1.HO.X + new_curve.Segment1.P.X, new_curve.Segment1.HO.Y + new_curve.Segment1.P.Y,
new_curve.Segment1.P.X, new_curve.Segment1.P.Y);
}
else
{
auto pt = curve.GetPoint(t);
Result.LineTo(pt.X, pt.Y);
}
return j;
}
}
x = (x >= Curves1.size() - 1) ? 0 : x + 1;
prev_x = -1;
if (Curves1[x].Segment2.IsCurve)
Result.CurveTo(Curves1[x].Segment2.HI.X + Curves1[x].Segment2.P.X, Curves1[x].Segment2.HI.Y + Curves1[x].Segment2.P.Y,
Curves1[x].Segment2.HO.X + Curves1[x].Segment2.P.X, Curves1[x].Segment2.HO.Y + Curves1[x].Segment2.P.Y,
Curves1[x].Segment2.P.X, Curves1[x].Segment2.P.Y);
else
Result.LineTo(Curves1[x].Segment2.P.X, Curves1[x].Segment2.P.Y);
}
return -1;
};
loc_visited[i]++;
auto p = loc->C.GetPoint(loc->Time);
Result.MoveTo(p.X, p.Y);
int cur_seg = -1;
int cur_loc = i;
while (1)
{
cur_seg = add_seg(cur_loc, cur_seg);
if (cur_seg == -1)
break;
cur_loc = add_loc(cur_seg, cur_loc);
if (cur_loc == i || cur_loc == -1)
break;
}
}
for (int i = 0; i < Locations.size(); i++)
{
if (loc_visited[i] != 2)
{
loc_visited[i]++;
auto p = Locations[i]->C.GetPoint(Locations[i]->Time);
Result.MoveTo(p.X, p.Y);
auto prev_loc = Locations[i];
auto add_loc = [&](std::shared_ptr<Location> l1, std::shared_ptr<Location> l2) {
auto add_pt = [&](std::shared_ptr<Location> lc, std::shared_ptr<Location> prev){
if (prev->C.Segment2.IsCurve)
{
auto new_curve = prev->C;
double t1 = prev->Time;
double t2 = lc->Time;
if (t2 < t1)
{
new_curve.Flip();
t1 = 1.0 - t1;
t2 = 1.0 - t2;
}
new_curve = new_curve.DivideAtTime(t1);
new_curve = new_curve.DivideAtTime((t2 - t1) / (1.0 - t1));
Result.CurveTo(new_curve.Segment1.HI.X + new_curve.Segment1.P.X, new_curve.Segment1.HI.Y + new_curve.Segment1.P.Y,
new_curve.Segment1.HO.X + new_curve.Segment1.P.X, new_curve.Segment1.HO.Y + new_curve.Segment1.P.Y,
new_curve.Segment1.P.X, new_curve.Segment1.P.Y);
}
else
{
auto pt = lc->C.GetPoint(lc->Time);
Result.LineTo(pt.X, pt.Y);
}
};
if (l1->C.Segment2.Index == l2->C.Segment2.Index)
add_pt(l1, l2);
else if (l1->C.Segment2.Index == l2->Inters->C.Segment2.Index)
add_pt(l1, l2->Inters);
else if (l1->Inters->C.Segment2.Index == l2->C.Segment2.Index)
add_pt(l1->Inters, l2);
else if (l1->Inters->C.Segment2.Index == l2->Inters->C.Segment2.Index)
add_pt(l1->Inters, l2->Inters);
};
for (int j = i + 1; j < Locations.size(); j++)
{
if (loc_visited[j] == 2)
continue;
loc_visited[j]++;
add_loc(Locations[j], prev_loc);
prev_loc = Locations[j];
}
add_loc(Locations[i], prev_loc);
break;
}
}
Result.CloseFigure();
delete[] seg_visited;
delete[] loc_visited;
}
std::vector<std::vector<int>> CBooleanOperations::FindBoundsCollisions()
{
std::vector<std::vector<double>> allBounds, bounds2;
@ -1296,13 +1684,14 @@ std::vector<std::vector<int>> CBooleanOperations::FindBoundsCollisions()
activeIndicesByPri2.erase(activeIndicesByPri2.begin(),
activeIndicesByPri2.begin() + pruneCount);
for (int j = 0; j < static_cast<int>(activeIndicesByPri2.size()); j++)
{
bool isActive1 = activeIndicesByPri2[j] < length1,
isActive2 = self || !isActive1,
isActive1Or2 = (isCurrent1 && isActive2) || (isCurrent2 && isActive1),
inRange1 = allBounds[allIdicesByPri1[i]][1] <= allBounds[activeIndicesByPri2[j]][3] + GEOMETRIC_EPSILON,
inRange2 = allBounds[allIdicesByPri1[i]][3] >= allBounds[activeIndicesByPri2[j]][1] - GEOMETRIC_EPSILON;
isActive2 = self || !isActive1,
isActive1Or2 = (isCurrent1 && isActive2) || (isCurrent2 && isActive1),
inRange1 = allBounds[allIdicesByPri1[i]][1] <= allBounds[activeIndicesByPri2[j]][3] + GEOMETRIC_EPSILON,
inRange2 = allBounds[allIdicesByPri1[i]][3] >= allBounds[activeIndicesByPri2[j]][1] - GEOMETRIC_EPSILON;
if (isActive1Or2 && (inRange2 && inRange1))
{
@ -1314,10 +1703,7 @@ std::vector<std::vector<int>> CBooleanOperations::FindBoundsCollisions()
}
}
if (isCurrent1)
{
if (self) curCollisions.push_back(allIdicesByPri1[i]);
allCollisions[allIdicesByPri1[i]] = curCollisions;
}
if (activeIndicesByPri2.size() > 0)
{
int index = 1 + binarySearch(allBounds, activeIndicesByPri2, 2, allBounds[allIdicesByPri1[i]][2]);
@ -1327,8 +1713,23 @@ std::vector<std::vector<int>> CBooleanOperations::FindBoundsCollisions()
activeIndicesByPri2.push_back(allIdicesByPri1[i]);
}
int index = 0;
std::vector<std::vector<int>> erase_ver(length1);
for (auto& c : allCollisions)
{
std::sort(c.begin(), c.end());
if (self)
{
c.erase(std::remove(c.begin(), c.end(), index), c.end());
c.erase(std::remove(c.begin(), c.end(), index == allLength - 1 ? 0 : index + 1), c.end());
c.erase(std::remove(c.begin(), c.end(), index == 0 ? allLength - 1 : index - 1), c.end());
for (const auto& ind : erase_ver[index])
c.erase(std::remove(c.begin(), c.end(), ind), c.end());
for (const auto& ind : c)
erase_ver[ind].push_back(index);
}
index++;
}
return allCollisions;
}
@ -1457,7 +1858,7 @@ void CBooleanOperations::GetCurveIntersection(const Curve& curve1, const Curve&
AddCurveIntersection(flip ? curve2 : curve1, flip ? curve1 : curve2,
flip ? curve2 : curve1, flip ? curve1 : curve2, flip);
if (Locations.size() == before && (!straight || Locations.empty()))
if (Locations.size() == before && (!straight /*|| Locations.empty()*/))
{
double t = curve2.GetTimeOf(curve1.Segment1.P);
if (t != -1.0)
@ -1670,17 +2071,27 @@ bool CBooleanOperations::IsInside(const Segment& segment) const
void CBooleanOperations::SetWinding()
{
if (Locations.empty() || (Locations.size() == 2 && Locations[0]->Ends))
if (Locations.empty() || (Locations.size() == 2 && Locations[0]->Ends) || IsOnlyEnds())
{
Segment s1, s2;
Segment s1 = Segments1[0], s2 = Segments2[0];
for (const auto& s : Segments1)
if (!s.Inters)
{
bool skip = false;
for (const auto& ss : Segments2)
skip = skip || !s.Equals(ss);
if (!s.Inters && !skip)
s1 = s;
}
for (const auto& s : Segments2)
if (!s.Inters)
{
bool skip = false;
for (const auto& ss : Segments1)
skip = skip || !s.Equals(ss);
if (!s.Inters && !skip)
s2 = s;
}
bool winding = IsInside(s1);
@ -1888,11 +2299,17 @@ bool CBooleanOperations::AllInters(const std::vector<Segment>& segments) const n
return true;
}
bool CBooleanOperations::IsOneCurvePath(int pathIndex) const noexcept
{
return Locations.size() == 4 && pathIndex == 1 ? (OriginCurves1.size() == 1 && OriginCurves2.size() != 1)
: (OriginCurves2.size() == 1 && OriginCurves1.size() != 1);
}
void CBooleanOperations::AddLocation(Curve curve1, Curve curve2, double t1,
double t2, bool overlap, bool filter, bool ends)
{
bool excludeStart = !overlap && GetPreviousCurve(curve1) == curve2,
excludeEnd = !overlap && curve1 != curve2 && GetNextCurve(curve1) == curve2;
bool excludeStart = !overlap && GetPreviousCurve(curve1).Equals(curve2),
excludeEnd = !overlap && curve1 != curve2 && GetNextCurve(curve1).Equals(curve2);
double tMin = CURVETIME_EPSILON,
tMax = 1 - tMin;
@ -1928,6 +2345,41 @@ void CBooleanOperations::AddOffsets(std::vector<double>& offsets,
offsets.push_back(count != 0 ? offset : offset / 32);
}
bool CBooleanOperations::CheckLocation(std::shared_ptr<Location> loc, bool start) const noexcept
{
for (const auto& l : Locations)
{
if (start)
{
if (l->C.Segment1.Index == loc->C.Segment1.Index && l->Time != loc->Time)
return loc->Time < l->Time;
if (l->Inters->C.Segment1.Index == loc->C.Segment1.Index && l->Inters->Time != loc->Time)
return loc->Time < l->Inters->Time;
}
else
{
if (l->C.Segment2.Index == loc->C.Segment2.Index && l->Time != loc->Time)
return loc->Time > l->Time;
if (l->Inters->C.Segment2.Index == loc->C.Segment2.Index && l->Inters->Time != loc->Time)
return loc->Time > l->Inters->Time;
}
}
return false;
}
bool CBooleanOperations::IsOnlyEnds() const noexcept
{
bool onlyEnds1 = true;
bool onlyEnds2 = true;
for (const auto& l : Locations)
{
onlyEnds1 = onlyEnds1 && l->Ends;
onlyEnds2 = onlyEnds2 && l->Inters->Ends;
}
return onlyEnds1 || onlyEnds2;
}
CGraphicsPath CalcBooleanOperation(const CGraphicsPath& path1,
const CGraphicsPath& path2,
BooleanOpType op,
@ -1937,21 +2389,54 @@ CGraphicsPath CalcBooleanOperation(const CGraphicsPath& path1,
std::vector<CGraphicsPath> paths1 = path1.GetSubPaths(),
paths2 = path2.GetSubPaths(),
paths;
for (const auto& p1 : paths1)
int skip_end1 = -1;
for (size_t i = 0; i < paths2.size(); i++)
{
for (const auto& p2 : paths2)
int skip_end2 = -1;
CBooleanOperations o;
if (i > skip_end2 && o.IsSelfInters(paths2[i]))
{
CBooleanOperations operation(p1, p2, op, fillType, isLuminosity);
CBooleanOperations operation(paths2[i], paths2[i], Intersection, fillType, isLuminosity, true);
CGraphicsPath p = std::move(operation.GetResult());
std::vector<CGraphicsPath> tmp_paths = p.GetSubPaths();
paths2[i] = tmp_paths[0];
skip_end2 = i + tmp_paths.size() - 1;
for (size_t k = 1; k < tmp_paths.size(); k++)
paths2.insert(paths2.begin() + i + k, tmp_paths[k]);
}
for (size_t j = 0; j < paths1.size(); j++)
{
CBooleanOperations o2;
if (j > skip_end1 && o2.IsSelfInters(paths1[j]))
{
CBooleanOperations operation(paths1[j], paths1[j], Intersection, fillType, isLuminosity, true);
CGraphicsPath p = std::move(operation.GetResult());
std::vector<CGraphicsPath> tmp_paths = p.GetSubPaths();
paths1[j] = tmp_paths[0];
skip_end1 = j + tmp_paths.size() - 1;
for (size_t k = 1; k < tmp_paths.size(); k++)
paths1.insert(paths1.begin() + i + k, tmp_paths[k]);
}
CBooleanOperations operation(paths1[j], paths2[i], op, fillType, isLuminosity, false);
paths.push_back(operation.GetResult());
}
if (op == Subtraction)
{
paths1 = CGraphicsPath(paths).GetSubPaths();
paths.clear();
}
}
return CGraphicsPath(paths);
return op == Subtraction ? CGraphicsPath(paths1) : CGraphicsPath(paths);
}
//For unit-tests
bool CGraphicsPath::operator==(const CGraphicsPath& other) noexcept
// For Unit-tests
bool CGraphicsPath::Equals(const CGraphicsPath& other) noexcept
{
unsigned pointsCount = GetPointCount(),
otherPointsCount = other.GetPointCount();
@ -1960,7 +2445,7 @@ bool CGraphicsPath::operator==(const CGraphicsPath& other) noexcept
return false;
std::vector<PointD> points = GetPoints(0, pointsCount),
otherPoints = other.GetPoints(0, otherPointsCount);
otherPoints = other.GetPoints(0, otherPointsCount);
for (unsigned i = 0; i < pointsCount; i++)
if (getDistance(points[i], otherPoints[i]) > POINT_EPSILON)

View File

@ -37,6 +37,7 @@ namespace Aggplus
bool IsValid(const BooleanOpType& op) const noexcept;
bool IsEmpty() const noexcept;
bool Equals(const Segment& other) const noexcept;
bool operator==(const Segment& other) const noexcept;
bool operator!=(const Segment& other) const noexcept;
};
@ -82,6 +83,7 @@ namespace Aggplus
void Flip() noexcept;
bool IsStraight() const noexcept;
bool Equals(const Curve& other) const noexcept;
bool operator==(const Curve& other) const noexcept;
bool operator!=(const Curve& other) const noexcept;
};
@ -107,15 +109,19 @@ namespace Aggplus
class CBooleanOperations
{
public:
CBooleanOperations(const CGraphicsPath& path1, const CGraphicsPath& path2, BooleanOpType op, long fillType, bool isLuminosity);
CBooleanOperations() {};
CBooleanOperations(const CGraphicsPath& path1, const CGraphicsPath& path2, BooleanOpType op, long fillType, bool isLuminosity, bool isSelf);
~CBooleanOperations();
CGraphicsPath&& GetResult();
bool IsSelfInters(const CGraphicsPath& p);
// BooleanOp
void TraceBoolean();
void TraceOneInters();
void TraceAllOverlap();
void TracePaths();
void TraceOneCurvePath1();
void TraceOneCurvePath2();
// Path
void PreparePath(const CGraphicsPath& path, int id, std::vector<Segment>& segments,
@ -127,6 +133,7 @@ namespace Aggplus
Segment GetPreviousSegment(const Segment& segment) const noexcept;
Segment GetNextSegment(const Segment& segment) const noexcept;
void SetVisited(const Segment& segment);
void CreateNewPath(const std::vector<std::vector<int>>& adjMatr) noexcept;
// Bounds
std::vector<std::vector<int>> FindBoundsCollisions();
@ -151,7 +158,10 @@ namespace Aggplus
void InsertLocation(std::shared_ptr<Location> loc, bool overlap);
bool AllOverlap() const noexcept;
bool AllInters(const std::vector<Segment>& segments) const noexcept;
bool IsOneCurvePath(int pathIndex) const noexcept;
void AddOffsets(std::vector<double>& offsets, const Curve& curve, bool end);
bool CheckLocation(std::shared_ptr<Location> loc, bool start) const noexcept;
bool IsOnlyEnds() const noexcept;
private:
BooleanOpType Op = Intersection;
@ -159,13 +169,14 @@ namespace Aggplus
bool Close1 = true;
bool Close2 = true;
bool IsLuminosity = false;
bool IsSelf = false;
// c_nStroke, c_nWindingFillMode, c_nEvenOddFillMode
long FillType = c_nWindingFillMode;
CGraphicsPath Path1;
CGraphicsPath Path2;
CGraphicsPath Result;
CGraphicsPath Path1{};
CGraphicsPath Path2{};
CGraphicsPath Result{};
std::vector<Segment> Segments1;
std::vector<Segment> Segments2;

View File

@ -419,6 +419,7 @@ namespace Aggplus
m_bReleaseImage = FALSE;
Alpha = 255;
m_bUseBounds = false;
m_bIsScale = false;
}
CBrushTexture::CBrushTexture(const std::wstring& strName, WrapMode wrapMode) : CBrush(BrushTypeTextureFill), m_wrapMode(wrapMode)
@ -427,6 +428,7 @@ namespace Aggplus
m_bReleaseImage = TRUE;
Alpha = 255;
m_bUseBounds = false;
m_bIsScale = false;
}
CBrushTexture::CBrushTexture(CImage *pImage, WrapMode wrapMode) : CBrush(BrushTypeTextureFill), m_wrapMode(wrapMode)
@ -435,6 +437,7 @@ namespace Aggplus
m_bReleaseImage = FALSE;
Alpha = 255;
m_bUseBounds = false;
m_bIsScale = false;
}
CBrushTexture::~CBrushTexture()

View File

@ -205,6 +205,10 @@ public:
bool m_bUseBounds;
CDoubleRect m_oBounds;
bool m_bIsScale;
double m_dScaleX;
double m_dScaleY;
BYTE Alpha;
};
}

View File

@ -847,6 +847,8 @@ namespace Aggplus
double dScaleY = m_dDpiY / m_dDpiTile;
brushMatrix.Scale(dScaleX, dScaleY, Aggplus::MatrixOrderAppend);
if (ptxBrush->m_bIsScale)
brushMatrix.Scale(ptxBrush->m_dScaleX, ptxBrush->m_dScaleY, Aggplus::MatrixOrderAppend);
}
brushMatrix.Translate(x, y, Aggplus::MatrixOrderAppend);
@ -2142,7 +2144,12 @@ namespace Aggplus
agg::trans_affine* full_trans = &m_oFullTransform.m_internal->m_agg_mtx;
double dDet = full_trans->determinant();
if (fabs(dDet) < 0.0001)
double sx = sqrt(full_trans->sx * full_trans->sx + full_trans->shx * full_trans->shx);
double sy = sqrt(full_trans->shy * full_trans->shy + full_trans->sy * full_trans->sy);
double scale = std::max(sx, sy);
double adaptive_threshold = 1.0 / (scale * scale * 10000.0);
if (fabs(dDet) < std::max(0.0001, adaptive_threshold))
{
path_copy.transform_all_paths(m_oFullTransform.m_internal->m_agg_mtx);
dWidth *= sqrt(fabs(dDet));
@ -2240,6 +2247,8 @@ namespace Aggplus
LONG lCount2 = lCount / 2;
double dKoef = 1.0;
if (bIsUseIdentity)
dKoef = sqrt(fabs(m_oFullTransform.m_internal->m_agg_mtx.determinant()));
for (LONG i = 0; i < lCount2; ++i)
{

View File

@ -76,7 +76,7 @@ namespace Aggplus
j += 2;
}
}
if (p.Is_poly_closed()) CloseFigure();
//if (p.Is_poly_closed()) CloseFigure();
}
}
}
@ -262,6 +262,25 @@ namespace Aggplus
m_internal->m_agg_ps.line_to(x + width, y);
m_internal->m_agg_ps.line_to(x + width, y + height);
m_internal->m_agg_ps.line_to(x, y + height);
m_internal->m_agg_ps.line_to(x, y);
m_internal->m_agg_ps.close_polygon();
return Ok;
}
Status CGraphicsPath::AddRoundRectangle(double x, double y, double width, double height, double cx, double cy)
{
m_internal->m_agg_ps.move_to(x + cx, y);
m_internal->m_agg_ps.line_to(x + width - cx, y);
agg::bezier_arc arc1(x + width - cx, y + cy, cx, cy, -agg::pi / 2.0, agg::pi / 2.0);
m_internal->m_agg_ps.join_path(arc1, 0);
m_internal->m_agg_ps.line_to(x + width, y + height - cy);
agg::bezier_arc arc2(x + width - cx, y + height - cy, cx, cy, 0.0, agg::pi / 2.0);
m_internal->m_agg_ps.join_path(arc2, 0);
m_internal->m_agg_ps.line_to(x + cx, y + height);
agg::bezier_arc arc3(x + cx, y + height - cy, cx, cy, agg::pi / 2.0, agg::pi / 2.0);
m_internal->m_agg_ps.join_path(arc3, 0);
m_internal->m_agg_ps.line_to(x, y + cy);
agg::bezier_arc arc4(x + cx, y + cy, cx, cy, agg::pi, agg::pi / 2.0);
m_internal->m_agg_ps.join_path(arc4, 0);
m_internal->m_agg_ps.close_polygon();
return Ok;
}
@ -867,17 +886,17 @@ namespace Aggplus
if (isCurve)
{
std::vector<PointD> points = GetPoints(idx, 4);
area = (points[3].Y - points[0].Y) * (points[1].X + points[2].X)
- (points[3].X - points[0].X) * (points[1].Y + points[2].Y)
+ points[1].Y * (points[0].X - points[2].X)
- points[1].X * (points[0].Y - points[2].Y)
+ points[3].Y * (points[2].X + points[0].X / 3.0)
- points[3].X * (points[2].Y + points[0].Y / 3.0);
area = 3.0 * ((points[3].Y - points[0].Y) * (points[1].X + points[2].X)
- (points[3].X - points[0].X) * (points[1].Y + points[2].Y)
+ points[1].Y * (points[0].X - points[2].X)
- points[1].X * (points[0].Y - points[2].Y)
+ points[3].Y * (points[2].X + points[0].X / 3.0)
- points[3].X * (points[2].Y + points[0].Y / 3.0)) / 20.0;
}
else
{
std::vector<PointD> points = GetPoints(idx, 2);
area = 4.0 * (points[1].Y * points[0].X - points[1].X * points[0].Y) / 3.0;
area = (points[1].Y * points[0].X - points[1].X * points[0].Y) / 2.0;
}
return area;
@ -898,14 +917,11 @@ namespace Aggplus
PointD firstPoint = subPath.GetPoints(0, 1)[0];
double x, y;
subPath.GetLastPoint(x, y);
if ((abs(firstPoint.X - x) <= 1e-2 && abs(firstPoint.Y - y) <= 1e-2) ||
if ((abs(firstPoint.X - x) >= 1e-2 || abs(firstPoint.Y - y) >= 1e-2) ||
subPath.GetPointCount() == 1)
{
if (!firstPoint.Equals(PointD(x, y)) || subPath.GetPointCount() == 1)
subPath.LineTo(firstPoint.X, firstPoint.Y);
subPath.CloseFigure();
}
subPath.LineTo(firstPoint.X, firstPoint.Y);
subPath.CloseFigure();
result.push_back(subPath);
subPath.Reset();
}
@ -933,7 +949,7 @@ namespace Aggplus
double x, y;
subPath.GetLastPoint(x, y);
if (!firstPoint.Equals(PointD(x, y)) || subPath.GetPointCount() == 1)
if ((abs(firstPoint.X - x) >= 1e-2 || abs(firstPoint.Y - y) >= 1e-2) || subPath.GetPointCount() == 1)
subPath.LineTo(firstPoint.X, firstPoint.Y);
subPath.CloseFigure();
@ -987,6 +1003,26 @@ namespace Aggplus
return *this;
}
bool CGraphicsPath::operator==(const CGraphicsPath& other) noexcept
{
unsigned pointsCount = GetPointCount(),
otherPointsCount = other.GetPointCount();
if (pointsCount != otherPointsCount)
return false;
std::vector<PointD> points = GetPoints(0, pointsCount),
otherPoints = other.GetPoints(0, otherPointsCount);
bool reverse = IsClockwise() ^ other.IsClockwise();
for (unsigned i = 0; i < pointsCount; i++)
if (!points[i].Equals(otherPoints[reverse ? pointsCount - i - 1 : i]))
return false;
return true;
}
}
namespace Aggplus
@ -1515,3 +1551,31 @@ namespace Aggplus
return false;
}
}
HRESULT IRenderer::AddPath(const Aggplus::CGraphicsPath& path)
{
if (path.GetPointCount() == 0)
return S_FALSE;
size_t length = path.GetPointCount() + path.GetCloseCount();
std::vector<Aggplus::PointD> points = path.GetPoints(0, length);
for (size_t i = 0; i < length; i++)
{
if (path.IsCurvePoint(i))
{
PathCommandCurveTo(points[i].X, points[i].Y,
points[i + 1].X, points[i + 1].Y,
points[i + 2].X, points[i + 2].Y);
i += 2;
}
else if (path.IsMovePoint(i))
PathCommandMoveTo(points[i].X, points[i].Y);
else if (path.IsLinePoint(i))
PathCommandLineTo(points[i].X, points[i].Y);
else
PathCommandClose();
}
return S_OK;
}

View File

@ -72,6 +72,7 @@ namespace Aggplus
Status AddCurve(double* pPoints, int nCount);
Status AddEllipse(double x, double y, double width, double height);
Status AddRectangle(double x, double y, double width, double height);
Status AddRoundRectangle(double x, double y, double width, double height, double cx, double cy);
Status AddPolygon(double* pPoints, int nCount);
Status AddPath(const CGraphicsPath& oPath);
Status AddArc(double x, double y, double width, double height, double startAngle, double sweepAngle);
@ -116,6 +117,7 @@ namespace Aggplus
std::vector<PointD> GetPoints(unsigned idx, unsigned count) const noexcept;
std::vector<CGraphicsPath> GetSubPaths() const;
bool Equals(const CGraphicsPath& other) noexcept;
CGraphicsPath& operator=(const CGraphicsPath& other) noexcept;
CGraphicsPath& operator=(CGraphicsPath&& other) noexcept;
bool operator==(const CGraphicsPath& other) noexcept;

View File

@ -613,6 +613,32 @@ HRESULT CGraphicsRenderer::put_BrushTransform(const Aggplus::CMatrix& oMatrix)
m_oBrush.Transform = oMatrix;
return S_OK;
}
HRESULT CGraphicsRenderer::get_BrushOffset(double& offsetX, double& offsetY) const
{
offsetX = m_oBrush.OffsetX;
offsetY = m_oBrush.OffsetY;
return S_OK;
}
HRESULT CGraphicsRenderer::put_BrushOffset(const double& offsetX, const double& offsetY)
{
m_oBrush.OffsetX = offsetX;
m_oBrush.OffsetY = offsetY;
return S_OK;
}
HRESULT CGraphicsRenderer::get_BrushScale(bool& isScale, double& scaleX, double& scaleY) const
{
isScale = m_oBrush.IsScale;
scaleX = m_oBrush.ScaleX;
scaleY = m_oBrush.ScaleY;
return S_OK;
}
HRESULT CGraphicsRenderer::put_BrushScale(bool isScale, const double& scaleX, const double& scaleY)
{
m_oBrush.IsScale = isScale;
m_oBrush.ScaleX = scaleX;
m_oBrush.ScaleY = scaleY;
return S_OK;
}
HRESULT CGraphicsRenderer::BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height)
{
m_oBrush.Rectable = val;
@ -946,11 +972,18 @@ HRESULT CGraphicsRenderer::DrawPath(const LONG& nType)
switch (m_oBrush.TextureMode)
{
case c_BrushTextureModeTile:
oMode = Aggplus::WrapModeTile;
break;
case c_BrushTextureModeTileCenter:
oMode = Aggplus::WrapModeTile;
break;
case c_BrushTextureModeTileFlipX:
oMode = Aggplus::WrapModeTileFlipX;
break;
case c_BrushTextureModeTileFlipY:
oMode = Aggplus::WrapModeTileFlipY;
break;
case c_BrushTextureModeTileFlipXY:
oMode = Aggplus::WrapModeTileFlipXY;
break;
default:
break;
}
@ -1023,11 +1056,18 @@ HRESULT CGraphicsRenderer::DrawPath(const LONG& nType)
if (m_oBrush.Rectable == 1)
{
pTextureBrush->m_bUseBounds = true;
pTextureBrush->m_oBounds.left = m_oBrush.Rect.X;
pTextureBrush->m_oBounds.top = m_oBrush.Rect.Y;
pTextureBrush->m_oBounds.left = m_oBrush.Rect.X + m_oBrush.OffsetX;
pTextureBrush->m_oBounds.top = m_oBrush.Rect.Y + m_oBrush.OffsetY;
pTextureBrush->m_oBounds.right = pTextureBrush->m_oBounds.left + m_oBrush.Rect.Width;
pTextureBrush->m_oBounds.bottom = pTextureBrush->m_oBounds.top + m_oBrush.Rect.Height;
}
if (m_oBrush.IsScale == 1)
{
pTextureBrush->m_bIsScale = true;
pTextureBrush->m_dScaleX = m_oBrush.ScaleX;
pTextureBrush->m_dScaleY = m_oBrush.ScaleY;
}
}
pBrush = pTextureBrush;

View File

@ -189,6 +189,10 @@ public:
virtual HRESULT put_BrushLinearAngle(const double& dAngle);
virtual HRESULT get_BrushTransform(Aggplus::CMatrix& oMatrix);
virtual HRESULT put_BrushTransform(const Aggplus::CMatrix& oMatrix);
virtual HRESULT get_BrushOffset(double& offsetX, double& offsetY) const;
virtual HRESULT put_BrushOffset(const double& offsetX, const double& offsetY);
virtual HRESULT get_BrushScale(bool& isScale, double& scaleX, double& scaleY) const;
virtual HRESULT put_BrushScale(bool isScale, const double& scaleX, const double& scaleY);
virtual HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height);
virtual HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height);
virtual HRESULT put_BrushGradientColors(LONG* lColors, double* pPositions, LONG nCount);

View File

@ -117,6 +117,7 @@ const long c_nDarkMode = 0x0008;
const long c_nUseDictionaryFonts = 0x0010;
const long c_nPenWidth0As1px = 0x0020;
const long c_nSupportPathTextAsText = 0x0040;
const long c_nFontSubstitution = 0x0080;
// типы рендерера
const long c_nUnknownRenderer = 0x0000;
@ -156,6 +157,7 @@ public:
PageClear = 9,
PageRotate = 10,
Headings = 11,
Redact = 12,
Undefined = 255
};
@ -167,7 +169,10 @@ public:
AdvancedCommandType GetCommandType() { return m_nCommandType; }
};
namespace Aggplus { class CImage; }
namespace Aggplus {
class CImage;
class CGraphicsPath;
}
// IRenderer
class IRenderer : public IGrObject
@ -239,6 +244,32 @@ public:
virtual HRESULT put_BrushTransform(const Aggplus::CMatrix& oMatrix) = 0;
virtual HRESULT get_BrushLinearAngle(double* dAngle) = 0;
virtual HRESULT put_BrushLinearAngle(const double& dAngle) = 0;
virtual HRESULT get_BrushOffset(double& offsetX, double& offsetY) const
{
UNUSED_VARIABLE(offsetX);
UNUSED_VARIABLE(offsetY);
return S_OK;
}
virtual HRESULT put_BrushOffset(const double& offsetX, const double& offsetY)
{
UNUSED_VARIABLE(offsetX);
UNUSED_VARIABLE(offsetY);
return S_OK;
}
virtual HRESULT get_BrushScale(bool& isScale, double& scaleX, double& scaleY) const
{
UNUSED_VARIABLE(isScale);
UNUSED_VARIABLE(scaleX);
UNUSED_VARIABLE(scaleY);
return S_OK;
}
virtual HRESULT put_BrushScale(bool isScale, const double& scaleX, const double& scaleY)
{
UNUSED_VARIABLE(isScale);
UNUSED_VARIABLE(scaleX);
UNUSED_VARIABLE(scaleY);
return S_OK;
}
virtual HRESULT BrushRect(const INT& val, const double& left, const double& top, const double& width, const double& height) = 0;
virtual HRESULT BrushBounds(const double& left, const double& top, const double& width, const double& height) = 0;
@ -298,6 +329,8 @@ public:
virtual HRESULT PathCommandTextExCHAR(const LONG& c, const LONG& gid, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT PathCommandTextEx(const std::wstring& sText, const unsigned int* pGids, const unsigned int nGidsCount, const double& x, const double& y, const double& w, const double& h) = 0;
HRESULT AddPath(const Aggplus::CGraphicsPath& path);
//-------- Функции для вывода изображений ---------------------------------------------------
virtual HRESULT DrawImage(IGrObject* pImage, const double& x, const double& y, const double& w, const double& h) = 0;
virtual HRESULT DrawImageFromFile(const std::wstring&, const double& x, const double& y, const double& w, const double& h, const BYTE& lAlpha = 255) = 0;

View File

@ -36,6 +36,7 @@
#include "../fontengine/FontManager.h"
#include "../raster/BgraFrame.h"
#include "../common/StringExt.h"
#include "GraphicsPath.h"
// этот класс нужно переписать. должно работать как и в js
// а не просто на каждом символе переключаться, если нужно
@ -351,7 +352,13 @@ namespace NSOnlineOfficeBinToPdf
bool bIsPathOpened = false;
bool bIsEnableBrushRect = false;
double old_t1, old_t2, old_t3, old_t4, old_t5, old_t6;
CBufferReader oReader(pBuffer, lBufferLen);
Aggplus::CGraphicsPath path;
Aggplus::CMatrix transMatrRot;
Aggplus::RectF_T<double> clipRect;
bool isResetRot = false;
while (oReader.Check())
{
eCommand = (CommandType)(oReader.ReadByte());
@ -382,6 +389,8 @@ namespace NSOnlineOfficeBinToPdf
if (bIsPathOpened)
{
pRenderer->PathCommandEnd();
if (path.GetPointCount())
path.Reset();
pRenderer->EndCommand(c_nPathType);
}
bIsPathOpened = false;
@ -471,6 +480,17 @@ namespace NSOnlineOfficeBinToPdf
double m2 = oReader.ReadDouble();
double m3 = oReader.ReadDouble();
double m4 = oReader.ReadDouble();
clipRect = Aggplus::RectF_T<double>(m1, m2, m3, m4);
long type;
pRenderer->get_BrushTextureMode(&type);
if (type != c_BrushTextureModeStretch)
{
m1 = 0.0;
m2 = 0.0;
}
pRenderer->BrushRect(bIsEnableBrushRect ? 1 : 0, m1, m2, m3, m4);
break;
}
@ -479,7 +499,10 @@ namespace NSOnlineOfficeBinToPdf
bIsEnableBrushRect = oReader.ReadBool();
if (!bIsEnableBrushRect)
{
pRenderer->BrushRect(bIsEnableBrushRect ? 1 : 0, 0, 0, 1, 1);
clipRect = Aggplus::RectF_T<double>();
}
break;
}
case ctBrushTexturePathOld:
@ -590,6 +613,16 @@ namespace NSOnlineOfficeBinToPdf
pRenderer->put_BrushTextureAlpha(lAlpha);
break;
}
case ctBrushResetRotation:
{
pRenderer->GetTransform(&old_t1, &old_t2, &old_t3, &old_t4, &old_t5, &old_t6);
Aggplus::CMatrix mtr(old_t1, old_t2, old_t3, old_t4, old_t5, old_t6);
double rot = mtr.rotation();
transMatrRot.Rotate(agg::rad2deg(rot));
isResetRot = true;
break;
}
case ctSetTransform:
{
double m1 = oReader.ReadDouble();
@ -606,11 +639,15 @@ namespace NSOnlineOfficeBinToPdf
if (bIsPathOpened)
{
pRenderer->PathCommandEnd();
if (path.GetPointCount())
path.Reset();
pRenderer->EndCommand(c_nPathType);
}
pRenderer->BeginCommand(c_nPathType);
pRenderer->PathCommandStart();
path.Reset();
path.StartFigure();
bIsPathOpened = true;
break;
@ -619,14 +656,14 @@ namespace NSOnlineOfficeBinToPdf
{
double m1 = oReader.ReadDouble();
double m2 = oReader.ReadDouble();
pRenderer->PathCommandMoveTo(m1, m2);
path.MoveTo(m1, m2);
break;
}
case ctPathCommandLineTo:
{
double m1 = oReader.ReadDouble();
double m2 = oReader.ReadDouble();
pRenderer->PathCommandLineTo(m1, m2);
path.LineTo(m1, m2);
break;
}
case ctPathCommandCurveTo:
@ -637,12 +674,12 @@ namespace NSOnlineOfficeBinToPdf
double m4 = oReader.ReadDouble();
double m5 = oReader.ReadDouble();
double m6 = oReader.ReadDouble();
pRenderer->PathCommandCurveTo(m1, m2, m3, m4, m5, m6);
path.CurveTo(m1, m2, m3, m4, m5, m6);
break;
}
case ctPathCommandClose:
{
pRenderer->PathCommandClose();
path.CloseFigure();
break;
}
case ctPathCommandEnd:
@ -650,14 +687,107 @@ namespace NSOnlineOfficeBinToPdf
if (bIsPathOpened)
{
pRenderer->PathCommandEnd();
if (path.GetPointCount())
path.Reset();
pRenderer->EndCommand(c_nPathType);
bIsPathOpened = false;
}
break;
}
case ctPathCommandOffset:
{
double m1 = oReader.ReadDouble();
double m2 = oReader.ReadDouble();
pRenderer->put_BrushOffset(m1, m2);
break;
}
case ctPathCommandScale:
{
double m1 = oReader.ReadDouble();
double m2 = oReader.ReadDouble();
pRenderer->put_BrushScale(true, m1, m2);
break;
}
case ctDrawPath:
{
pRenderer->DrawPath(oReader.ReadInt());
long fill = oReader.ReadInt();
long type;
pRenderer->get_BrushType(&type);
if (fill != c_nStroke && type == c_BrushTypeTexture)
{
Aggplus::CGraphicsPath clipPath;
Aggplus::CGraphicsPath drawPath(path);
if (isResetRot)
{
pRenderer->get_BrushTextureMode(&type);
bool isStretch = type == c_BrushTextureModeStretch;
double left, top, width, height;
drawPath.GetBounds(left, top, width, height);
double rot = transMatrRot.rotation();
double cX = left + width / 2.0;
double cY = top + height / 2.0;
bool isZeroPt = clipRect.X < 0.1 && clipRect.X > -0.1 && clipRect.Y < 0.1 && clipRect.Y > -0.1;
bool isZeroRot = rot < 1e-6 && rot > -1e-6;
transMatrRot.Reset();
transMatrRot.RotateAt(agg::rad2deg(rot), cX, cY, Aggplus::MatrixOrderAppend);
double offX = old_t5 - transMatrRot.tx();
double offY = old_t6 - transMatrRot.ty();
drawPath.Transform(&transMatrRot);
pRenderer->SetTransform(1.0, 0.0, 0.0, 1.0, offX, offY);
if (isZeroPt && !isZeroRot && isStretch)
drawPath.GetBounds(left, top, width, height);
else
{
Aggplus::CGraphicsPath tmpPath;
tmpPath.AddRectangle(left, top, width, height);
tmpPath.Transform(&transMatrRot);
tmpPath.GetBounds(left, top, width, height);
}
if (isZeroPt || !isStretch)
clipRect = Aggplus::RectF_T<double>(left, top, width, height);
if (isStretch)
{
if (!isZeroPt)
clipRect.Offset(-offX, -offY);
pRenderer->BrushRect(true, clipRect.X, clipRect.Y, clipRect.Width, clipRect.Height);
}
else
{
double tileOffX, tileOffY;
pRenderer->get_BrushOffset(tileOffX, tileOffY);
pRenderer->put_BrushOffset(tileOffX - offX, tileOffY - offY);
}
}
clipPath.AddRectangle(clipRect.X, clipRect.Y, clipRect.Width, clipRect.Height);
path = Aggplus::CalcBooleanOperation(drawPath, clipPath, Aggplus::Intersection);
}
pRenderer->AddPath(path);
pRenderer->DrawPath(fill);
if (isResetRot)
{
pRenderer->SetTransform(old_t1, old_t2, old_t3, old_t4, old_t5, old_t6);
transMatrRot.Reset();
isResetRot = false;
}
pRenderer->put_BrushScale(false, 1.0, 1.0);
pRenderer->put_BrushOffset(0.0, 0.0);
break;
}
case ctDrawImageFromFile:
@ -734,6 +864,8 @@ namespace NSOnlineOfficeBinToPdf
if (bIsPathOpened)
{
pRenderer->PathCommandEnd();
if (path.GetPointCount())
path.Reset();
pRenderer->EndCommand(4);
bIsPathOpened = false;
}
@ -747,8 +879,13 @@ namespace NSOnlineOfficeBinToPdf
pRenderer->EndCommand(4);
bIsPathOpened = false;
}
pRenderer->EndCommand((DWORD)(oReader.ReadInt()));
int nCommand = oReader.ReadInt();
if (path.GetPointCount() && nCommand == c_nClipType)
pRenderer->AddPath(path);
pRenderer->EndCommand((DWORD)nCommand);
pRenderer->PathCommandEnd();
if (path.GetPointCount())
path.Reset();
break;
}
case ctGradientFill:
@ -921,6 +1058,7 @@ namespace NSOnlineOfficeBinToPdf
case ctPageClear:
case ctPageRotate:
case ctHeadings:
case ctRedact:
{
IAdvancedCommand::AdvancedCommandType eAdvancedCommandType = IAdvancedCommand::AdvancedCommandType::Undefined;
switch (eCommand)
@ -934,6 +1072,7 @@ namespace NSOnlineOfficeBinToPdf
case ctPageClear: eAdvancedCommandType = IAdvancedCommand::AdvancedCommandType::PageClear; break;
case ctPageRotate: eAdvancedCommandType = IAdvancedCommand::AdvancedCommandType::PageRotate; break;
case ctHeadings: eAdvancedCommandType = IAdvancedCommand::AdvancedCommandType::Headings; break;
case ctRedact: eAdvancedCommandType = IAdvancedCommand::AdvancedCommandType::Redact; break;
default:
break;
}
@ -944,7 +1083,7 @@ namespace NSOnlineOfficeBinToPdf
if ((IAdvancedCommand::AdvancedCommandType::Undefined != eAdvancedCommandType) &&
(S_OK == pRenderer->IsSupportAdvancedCommand(eAdvancedCommandType)))
{
IAdvancedCommand* pCommand = oReader.Read(eCommand, pCorrector);
IAdvancedCommand* pCommand = oReader.Read(eCommand, pCorrector, nLen);
if (pCommand)
{
pRenderer->AdvancedCommand(pCommand);
@ -1130,6 +1269,10 @@ namespace NSOnlineOfficeBinToPdf
oReader.Skip(1);
break;
}
case ctBrushResetRotation:
{
break;
}
case ctSetTransform:
{
oReader.SkipInt(6);
@ -1162,6 +1305,16 @@ namespace NSOnlineOfficeBinToPdf
{
break;
}
case ctPathCommandOffset:
{
oReader.SkipInt(2);
break;
}
case ctPathCommandScale:
{
oReader.SkipInt(2);
break;
}
case ctDrawPath:
{
oReader.SkipInt();

View File

@ -108,6 +108,7 @@ namespace NSOnlineOfficeBinToPdf
ctBrushRectableEnabled = 30,
ctBrushGradient = 31,
ctBrushTexturePath = 32,
ctBrushResetRotation = 33,
// font
ctFontXML = 40,
@ -153,6 +154,8 @@ namespace NSOnlineOfficeBinToPdf
ctPathCommandGetCurrentPoint = 101,
ctPathCommandText = 102,
ctPathCommandTextEx = 103,
ctPathCommandOffset = 104,
ctPathCommandScale = 105,
// image
ctDrawImage = 110,
@ -185,6 +188,7 @@ namespace NSOnlineOfficeBinToPdf
ctShapeStart = 167,
ctShapeEnd = 168,
ctHeadings = 169,
ctRedact = 170,
ctPageWidth = 200,
ctPageHeight = 201,

View File

@ -46,8 +46,16 @@ namespace NSOnlineOfficeBinToPdf
RELEASEOBJECT(command);
return command;
}
template<typename T>
inline IAdvancedCommand* Read_Command_Len(CBufferReader* pReader, IMetafileToRenderter* pCorrector, int nLen)
{
T* command = new T();
if (!command->Read(pReader, pCorrector, nLen))
RELEASEOBJECT(command);
return command;
}
IAdvancedCommand* CBufferReader::Read(int type, IMetafileToRenderter* pCorrector)
IAdvancedCommand* CBufferReader::Read(int type, IMetafileToRenderter* pCorrector, int nLen)
{
switch (type)
{
@ -58,11 +66,12 @@ namespace NSOnlineOfficeBinToPdf
case ctFormField: return Read_Command<CFormFieldInfo> (this, pCorrector);
case ctAnnotFieldDelete: return Read_Command<CAnnotFieldDelete>(this, pCorrector);
case ctWidgetsInfo: return Read_Command<CWidgetsInfo> (this, pCorrector);
case ctShapeStart: return Read_Command<CShapeStart> (this, pCorrector);
case ctShapeStart: return Read_Command_Len<CShapeStart> (this, pCorrector, nLen);
case ctShapeEnd: return new CEmptyComand(IAdvancedCommand::AdvancedCommandType::ShapeEnd);
case ctPageClear: return new CEmptyComand(IAdvancedCommand::AdvancedCommandType::PageClear);
case ctPageRotate: return Read_Command<CPageRotate> (this, pCorrector);
case ctHeadings: return Read_Command<CHeadings> (this, pCorrector);
case ctRedact: return Read_Command<CRedact> (this, pCorrector);
default: break;
}

View File

@ -190,8 +190,12 @@ namespace NSOnlineOfficeBinToPdf
int len = 2 * ReadUShort();
SkipString16(len);
}
inline int Tell()
{
return (int)(m_cur - m_buffer);
}
IAdvancedCommand* Read(int type, IMetafileToRenderter* pCorrector);
IAdvancedCommand* Read(int type, IMetafileToRenderter* pCorrector, int nLen = 0);
};
}

View File

@ -212,6 +212,20 @@ public:
void Offset(const PointF_T<T>& point) { Offset(point.X, point.Y); }
void Offset(T dx, T dy) { X += dx; Y += dy; }
inline bool IsPositive() { return Width > 0 && Height > 0; }
RectF_T& operator=(const RectF_T& other)
{
if (this == &other)
return *this;
X = other.X;
Y = other.Y;
Width = other.Width;
Height = other.Height;
return *this;
};
public:
T X, Y, Width, Height;
};

View File

@ -46,6 +46,92 @@
// void Set(const std::wstring& ws) { m_ws = ws; }
// const std::wstring& Get() { return m_ws; }
CAnnotFieldInfo::CActionFieldPr* ReadAction(NSOnlineOfficeBinToPdf::CBufferReader* pReader)
{
CAnnotFieldInfo::CActionFieldPr* pRes = new CAnnotFieldInfo::CActionFieldPr();
pRes->nActionType = pReader->ReadByte();
switch (pRes->nActionType)
{
case 14: // JavaScript
{
pRes->wsStr1 = pReader->ReadString();
break;
}
case 1: // GoTo
{
pRes->nInt1 = pReader->ReadInt();
pRes->nKind = pReader->ReadByte();
switch (pRes->nKind)
{
case 0:
case 2:
case 3:
case 6:
case 7:
{
pRes->nFlags = pReader->ReadInt();
if (pRes->nFlags & (1 << 0))
pRes->dD[0] = pReader->ReadDouble();
if (pRes->nFlags & (1 << 1))
pRes->dD[1] = pReader->ReadDouble();
if (pRes->nFlags & (1 << 2))
pRes->dD[2] = pReader->ReadDouble();
break;
}
case 4:
{
pRes->dD[0] = pReader->ReadDouble();
pRes->dD[1] = pReader->ReadDouble();
pRes->dD[2] = pReader->ReadDouble();
pRes->dD[3] = pReader->ReadDouble();
break;
}
case 1:
case 5:
default:
{
break;
}
}
break;
}
case 10: // Named
{
pRes->wsStr1 = pReader->ReadString();
break;
}
case 6: // URI
{
pRes->wsStr1 = pReader->ReadString();
break;
}
case 9: // Hide
{
pRes->nKind = pReader->ReadByte();
int n = pReader->ReadInt();
pRes->arrStr.reserve(n);
for (int i = 0; i < n; ++i)
pRes->arrStr.push_back(pReader->ReadString());
break;
}
case 12: // ResetForm
{
pRes->nInt1 = pReader->ReadInt();
int n = pReader->ReadInt();
pRes->arrStr.reserve(n);
for (int i = 0; i < n; ++i)
pRes->arrStr.push_back(pReader->ReadString());
break;
}
}
if (pReader->ReadByte())
pRes->pNext = ReadAction(pReader);
return pRes;
}
CAnnotFieldInfo::CAnnotFieldInfo() : IAdvancedCommand(AdvancedCommandType::Annotaion)
{
m_nType = EAnnotType::Unknown;
@ -76,6 +162,8 @@ CAnnotFieldInfo::CAnnotFieldInfo() : IAdvancedCommand(AdvancedCommandType::Annot
m_pFreeTextPr = NULL;
m_pCaretPr = NULL;
m_pStampPr = NULL;
m_pRedactPr = NULL;
m_pLinkPr = NULL;
m_pWidgetPr = NULL;
}
CAnnotFieldInfo::~CAnnotFieldInfo()
@ -91,6 +179,8 @@ CAnnotFieldInfo::~CAnnotFieldInfo()
RELEASEOBJECT(m_pFreeTextPr);
RELEASEOBJECT(m_pCaretPr);
RELEASEOBJECT(m_pStampPr);
RELEASEOBJECT(m_pRedactPr);
RELEASEOBJECT(m_pLinkPr);
RELEASEOBJECT(m_pWidgetPr);
}
@ -111,6 +201,12 @@ void CAnnotFieldInfo::SetType(int nType)
m_pTextPr = new CAnnotFieldInfo::CTextAnnotPr();
break;
}
case EAnnotType::Link:
{
RELEASEOBJECT(m_pLinkPr);
m_pLinkPr = new CAnnotFieldInfo::CLinkAnnotPr();
break;
}
case EAnnotType::FreeText:
{
CreateMarkup();
@ -178,6 +274,13 @@ void CAnnotFieldInfo::SetType(int nType)
m_pPopupPr = new CAnnotFieldInfo::CPopupAnnotPr();
break;
}
case EAnnotType::Redact:
{
CreateMarkup();
RELEASEOBJECT(m_pRedactPr);
m_pRedactPr = new CAnnotFieldInfo::CRedactAnnotPr();
break;
}
case EAnnotType::Widget:
case EAnnotType::WidgetPushButton:
case EAnnotType::WidgetRadioButton:
@ -292,6 +395,14 @@ bool CAnnotFieldInfo::IsStamp() const
{
return (m_nType == 12);
}
bool CAnnotFieldInfo::IsRedact() const
{
return (m_nType == 25);
}
bool CAnnotFieldInfo::IsLink() const
{
return (m_nType == 1);
}
CAnnotFieldInfo::CMarkupAnnotPr* CAnnotFieldInfo::GetMarkupAnnotPr() { return m_pMarkupPr; }
CAnnotFieldInfo::CTextAnnotPr* CAnnotFieldInfo::GetTextAnnotPr() { return m_pTextPr; }
@ -304,6 +415,8 @@ CAnnotFieldInfo::CPopupAnnotPr* CAnnotFieldInfo::GetPopupAnnotPr()
CAnnotFieldInfo::CFreeTextAnnotPr* CAnnotFieldInfo::GetFreeTextAnnotPr() { return m_pFreeTextPr; }
CAnnotFieldInfo::CCaretAnnotPr* CAnnotFieldInfo::GetCaretAnnotPr() { return m_pCaretPr; }
CAnnotFieldInfo::CStampAnnotPr* CAnnotFieldInfo::GetStampAnnotPr() { return m_pStampPr; }
CAnnotFieldInfo::CRedactAnnotPr* CAnnotFieldInfo::GetRedactAnnotPr() { return m_pRedactPr; }
CAnnotFieldInfo::CLinkAnnotPr* CAnnotFieldInfo::GetLinkAnnotPr() { return m_pLinkPr; }
CAnnotFieldInfo::CWidgetAnnotPr* CAnnotFieldInfo::GetWidgetAnnotPr() { return m_pWidgetPr; }
bool CAnnotFieldInfo::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector)
@ -391,11 +504,15 @@ bool CAnnotFieldInfo::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMeta
m_pCaretPr->Read(pReader, nFlags);
else if (IsStamp())
m_pStampPr->Read(pReader, nFlags);
else if (IsRedact())
m_pRedactPr->Read(pReader, nFlags);
}
else if (IsPopup())
m_pPopupPr->Read(pReader);
else if (IsWidget())
m_pWidgetPr->Read(pReader, nType);
else if (IsLink())
m_pLinkPr->Read(pReader);
return m_nType != -1;
}
@ -665,6 +782,85 @@ void CAnnotFieldInfo::CStampAnnotPr::Read(NSOnlineOfficeBinToPdf::CBufferReader*
m_dInRect[3] = pReader->ReadDouble();
}
BYTE CAnnotFieldInfo::CRedactAnnotPr::GetQ() const { return m_nQ; }
int CAnnotFieldInfo::CRedactAnnotPr::GetFontStyle() const { return m_nFontStyle; }
double CAnnotFieldInfo::CRedactAnnotPr::GetFontSize() const { return m_dFS; }
const std::wstring& CAnnotFieldInfo::CRedactAnnotPr::GetFontName() { return m_wsFN; }
const std::wstring& CAnnotFieldInfo::CRedactAnnotPr::GetOverlayText() { return m_wsOverlayText; }
const std::vector<double>& CAnnotFieldInfo::CRedactAnnotPr::GetIC() { return m_arrIC; }
const std::vector<double>& CAnnotFieldInfo::CRedactAnnotPr::GetFontColor() { return m_arrFC; }
const std::vector<double>& CAnnotFieldInfo::CRedactAnnotPr::GetQuadPoints() { return m_arrQuadPoints; }
void CAnnotFieldInfo::CRedactAnnotPr::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, int nFlags)
{
if (nFlags & (1 << 15))
{
int n = pReader->ReadInt();
m_arrQuadPoints.reserve(n);
for (int i = 0; i < n; ++i)
m_arrQuadPoints.push_back(pReader->ReadDouble());
}
if (nFlags & (1 << 16))
{
int n = pReader->ReadInt();
m_arrIC.reserve(n);
for (int i = 0; i < n; ++i)
m_arrIC.push_back(pReader->ReadDouble());
}
if (nFlags & (1 << 17))
m_wsOverlayText = pReader->ReadString();
if (nFlags & (1 << 19))
m_nQ = pReader->ReadByte();
if (nFlags & (1 << 20))
{
int n = pReader->ReadInt();
m_arrFC.reserve(n);
for (int i = 0; i < n; ++i)
m_arrFC.push_back(pReader->ReadDouble());
m_dFS = pReader->ReadDouble();
m_wsFN = pReader->ReadString();
m_nFontStyle = pReader->ReadInt();
}
}
CAnnotFieldInfo::CLinkAnnotPr::CLinkAnnotPr()
{
m_pAction = NULL;
m_pPA = NULL;
}
CAnnotFieldInfo::CLinkAnnotPr::~CLinkAnnotPr()
{
RELEASEOBJECT(m_pAction);
RELEASEOBJECT(m_pPA);
}
BYTE CAnnotFieldInfo::CLinkAnnotPr::GetH() const { return m_nH; }
int CAnnotFieldInfo::CLinkAnnotPr::GetFlags() const { return m_nFlags; }
const std::vector<double>& CAnnotFieldInfo::CLinkAnnotPr::GetQuadPoints() { return m_arrQuadPoints; }
CAnnotFieldInfo::CActionFieldPr* CAnnotFieldInfo::CLinkAnnotPr::GetA() { return m_pAction; }
CAnnotFieldInfo::CActionFieldPr* CAnnotFieldInfo::CLinkAnnotPr::GetPA() { return m_pPA; }
void CAnnotFieldInfo::CLinkAnnotPr::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader)
{
m_nFlags = pReader->ReadInt();
if (m_nFlags & (1 << 0))
{
pReader->ReadString();
m_pAction = ReadAction(pReader);
}
if (m_nFlags & (1 << 1))
{
pReader->ReadString();
m_pPA = ReadAction(pReader);
}
if (m_nFlags & (1 << 2))
m_nH = pReader->ReadByte();
if (m_nFlags & (1 << 3))
{
int n = pReader->ReadInt();
m_arrQuadPoints.reserve(n);
for (int i = 0; i < n; ++i)
m_arrQuadPoints.push_back(pReader->ReadDouble());
}
}
bool CAnnotFieldInfo::CPopupAnnotPr::IsOpen() const { return m_bOpen; }
int CAnnotFieldInfo::CPopupAnnotPr::GetFlag() const { return m_nFlag; }
int CAnnotFieldInfo::CPopupAnnotPr::GetParentID() const { return m_nParentID; }
@ -696,7 +892,7 @@ const std::wstring& CAnnotFieldInfo::CWidgetAnnotPr::GetFontKey() { return m_w
const std::vector<double>& CAnnotFieldInfo::CWidgetAnnotPr::GetTC() { return m_arrTC; }
const std::vector<double>& CAnnotFieldInfo::CWidgetAnnotPr::GetBC() { return m_arrBC; }
const std::vector<double>& CAnnotFieldInfo::CWidgetAnnotPr::GetBG() { return m_arrBG; }
const std::vector<CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget*>& CAnnotFieldInfo::CWidgetAnnotPr::GetActions() { return m_arrAction; }
const std::vector<CAnnotFieldInfo::CActionFieldPr*>& CAnnotFieldInfo::CWidgetAnnotPr::GetActions() { return m_arrAction; }
CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr* CAnnotFieldInfo::CWidgetAnnotPr::GetButtonWidgetPr() { return m_pButtonPr; }
CAnnotFieldInfo::CWidgetAnnotPr::CTextWidgetPr* CAnnotFieldInfo::CWidgetAnnotPr::GetTextWidgetPr() { return m_pTextPr; }
CAnnotFieldInfo::CWidgetAnnotPr::CChoiceWidgetPr* CAnnotFieldInfo::CWidgetAnnotPr::GetChoiceWidgetPr() { return m_pChoicePr; }
@ -756,93 +952,8 @@ CAnnotFieldInfo::CWidgetAnnotPr::~CWidgetAnnotPr()
RELEASEOBJECT(m_arrAction[i]);
}
CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget::CActionWidget() : pNext(NULL) {}
CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget::~CActionWidget() { RELEASEOBJECT(pNext); }
CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget* ReadAction(NSOnlineOfficeBinToPdf::CBufferReader* pReader)
{
CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget* pRes = new CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget();
pRes->nActionType = pReader->ReadByte();
switch (pRes->nActionType)
{
case 14: // JavaScript
{
pRes->wsStr1 = pReader->ReadString();
break;
}
case 1: // GoTo
{
pRes->nInt1 = pReader->ReadInt();
pRes->nKind = pReader->ReadByte();
switch (pRes->nKind)
{
case 0:
case 2:
case 3:
case 6:
case 7:
{
pRes->nFlags = pReader->ReadByte();
if (pRes->nFlags & (1 << 0))
pRes->dD[0] = pReader->ReadDouble();
if (pRes->nFlags & (1 << 1))
pRes->dD[1] = pReader->ReadDouble();
if (pRes->nFlags & (1 << 2))
pRes->dD[2] = pReader->ReadDouble();
break;
}
case 4:
{
pRes->dD[0] = pReader->ReadDouble();
pRes->dD[1] = pReader->ReadDouble();
pRes->dD[2] = pReader->ReadDouble();
pRes->dD[3] = pReader->ReadDouble();
break;
}
case 1:
case 5:
default:
{
break;
}
}
break;
}
case 10: // Named
{
pRes->wsStr1 = pReader->ReadString();
break;
}
case 6: // URI
{
pRes->wsStr1 = pReader->ReadString();
break;
}
case 9: // Hide
{
pRes->nKind = pReader->ReadByte();
int n = pReader->ReadInt();
pRes->arrStr.reserve(n);
for (int i = 0; i < n; ++i)
pRes->arrStr.push_back(pReader->ReadString());
break;
}
case 12: // ResetForm
{
pRes->nInt1 = pReader->ReadInt();
int n = pReader->ReadInt();
pRes->arrStr.reserve(n);
for (int i = 0; i < n; ++i)
pRes->arrStr.push_back(pReader->ReadString());
break;
}
}
if (pReader->ReadByte())
pRes->pNext = ReadAction(pReader);
return pRes;
}
CAnnotFieldInfo::CActionFieldPr::CActionFieldPr() : pNext(NULL) {}
CAnnotFieldInfo::CActionFieldPr::~CActionFieldPr() { RELEASEOBJECT(pNext); }
void CAnnotFieldInfo::CWidgetAnnotPr::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, BYTE nType)
{
m_wsFN = pReader->ReadString();
@ -901,7 +1012,7 @@ void CAnnotFieldInfo::CWidgetAnnotPr::Read(NSOnlineOfficeBinToPdf::CBufferReader
for (int i = 0; i < nAction; ++i)
{
std::wstring wsType = pReader->ReadString();
CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget* pA = ReadAction(pReader);
CAnnotFieldInfo::CActionFieldPr* pA = ReadAction(pReader);
if (pA)
{
pA->wsType = wsType;
@ -931,6 +1042,7 @@ const std::wstring& CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::GetCA() {
const std::wstring& CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::GetRC() { return m_wsRC; }
const std::wstring& CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::GetAC() { return m_wsAC; }
const std::wstring& CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::GetAP_N_Yes() { return m_wsAP_N_Yes; }
const std::vector< std::pair<std::wstring, std::wstring> >& CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::GetOpt() { return m_arrOpt; }
void CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, BYTE nType, int nFlags)
{
if (nType == 27)
@ -971,6 +1083,17 @@ void CAnnotFieldInfo::CWidgetAnnotPr::CButtonWidgetPr::Read(NSOnlineOfficeBinToP
if (nFlags & (1 << 9))
m_wsV = pReader->ReadString();
m_nStyle = pReader->ReadByte();
if (nFlags & (1 << 10))
{
int n = pReader->ReadInt();
m_arrOpt.reserve(n);
for (int i = 0; i < n; ++i)
{
std::wstring s1 = pReader->ReadString();
std::wstring s2 = pReader->ReadString();
m_arrOpt.push_back(std::make_pair(s1, s2));
}
}
if (nFlags & (1 << 14))
m_wsAP_N_Yes = pReader->ReadString();
}
@ -1136,7 +1259,7 @@ bool CWidgetsInfo::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafil
for (int i = 0; i < nAction; ++i)
{
std::wstring wsType = pReader->ReadString();
CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget* pA = ReadAction(pReader);
CAnnotFieldInfo::CActionFieldPr* pA = ReadAction(pReader);
if (pA)
{
pA->wsType = wsType;
@ -1166,3 +1289,46 @@ bool CWidgetsInfo::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafil
return true;
}
CRedact::CRedact() : IAdvancedCommand(AdvancedCommandType::Redact) {}
CRedact::~CRedact()
{
for (int i = 0; i < m_arrRedact.size(); ++i)
RELEASEOBJECT(m_arrRedact[i]);
}
const std::vector<CRedact::SRedact*>& CRedact::GetRedact() { return m_arrRedact; }
bool CRedact::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector)
{
int n = pReader->ReadInt();
m_arrRedact.reserve(n);
for (int i = 0; i < n; ++i)
{
SRedact* pRedact = new SRedact();
pRedact->sID = pReader->ReadString();
int m = pReader->ReadInt();
pRedact->arrQuadPoints.reserve(m * 8);
for (int j = 0; j < m; ++j)
{
pRedact->arrQuadPoints.push_back(pReader->ReadDouble());
pRedact->arrQuadPoints.push_back(pReader->ReadDouble());
pRedact->arrQuadPoints.push_back(pReader->ReadDouble());
pRedact->arrQuadPoints.push_back(pReader->ReadDouble());
double x = pReader->ReadDouble();
double y = pReader->ReadDouble();
pRedact->arrQuadPoints.push_back(pReader->ReadDouble());
pRedact->arrQuadPoints.push_back(pReader->ReadDouble());
pRedact->arrQuadPoints.push_back(x);
pRedact->arrQuadPoints.push_back(y);
}
pRedact->nFlag = pReader->ReadInt();
if (pRedact->nFlag & (1 << 0))
{
pRedact->nRenderLen = pReader->ReadInt() - 4;
pRedact->pRender = pReader->GetCurrentBuffer();
pReader->Skip(pRedact->nRenderLen);
}
m_arrRedact.push_back(pRedact);
}
return true;
}

View File

@ -59,6 +59,7 @@ public:
Ink = 14,
Popup = 15,
FileAttachment = 16,
Redact = 25,
Widget = 26,
WidgetPushButton = 27,
WidgetRadioButton = 28,
@ -69,6 +70,23 @@ public:
WidgetSignature = 33
};
class GRAPHICS_DECL CActionFieldPr
{
public:
CActionFieldPr();
~CActionFieldPr();
BYTE nKind;
BYTE nFlags;
BYTE nActionType;
int nInt1;
double dD[4]{};
std::wstring wsType;
std::wstring wsStr1;
std::vector<std::wstring> arrStr;
CActionFieldPr* pNext;
};
class GRAPHICS_DECL CWidgetAnnotPr
{
public:
@ -89,6 +107,7 @@ public:
const std::wstring& GetRC();
const std::wstring& GetAC();
const std::wstring& GetAP_N_Yes();
const std::vector< std::pair<std::wstring, std::wstring> >& GetOpt();
void Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, BYTE nType, int nFlags);
@ -107,6 +126,7 @@ public:
std::wstring m_wsRC;
std::wstring m_wsAC;
std::wstring m_wsAP_N_Yes;
std::vector< std::pair<std::wstring, std::wstring> > m_arrOpt;
};
class GRAPHICS_DECL CTextWidgetPr
@ -158,23 +178,6 @@ public:
};
class GRAPHICS_DECL CActionWidget
{
public:
CActionWidget();
~CActionWidget();
BYTE nKind;
BYTE nFlags;
BYTE nActionType;
int nInt1;
double dD[4]{};
std::wstring wsType;
std::wstring wsStr1;
std::vector<std::wstring> arrStr;
CActionWidget* pNext;
};
CWidgetAnnotPr(BYTE nType);
~CWidgetAnnotPr();
@ -198,7 +201,7 @@ public:
const std::vector<double>& GetTC();
const std::vector<double>& GetBC();
const std::vector<double>& GetBG();
const std::vector<CActionWidget*>& GetActions();
const std::vector<CActionFieldPr*>& GetActions();
CButtonWidgetPr* GetButtonWidgetPr();
CTextWidgetPr* GetTextWidgetPr();
@ -228,7 +231,7 @@ public:
std::vector<double> m_arrTC;
std::vector<double> m_arrBC;
std::vector<double> m_arrBG;
std::vector<CActionWidget*> m_arrAction;
std::vector<CActionFieldPr*> m_arrAction;
CButtonWidgetPr* m_pButtonPr;
CTextWidgetPr* m_pTextPr;
@ -388,7 +391,7 @@ public:
{
public:
bool IsOpen() const;
int GetFlag() const;
int GetFlag() const;
int GetParentID() const;
void Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader);
@ -452,6 +455,53 @@ public:
double m_dInRect[4]{};
};
class GRAPHICS_DECL CRedactAnnotPr
{
public:
BYTE GetQ() const;
int GetFontStyle() const;
double GetFontSize() const;
const std::wstring& GetFontName();
const std::wstring& GetOverlayText();
const std::vector<double>& GetIC();
const std::vector<double>& GetFontColor();
const std::vector<double>& GetQuadPoints();
void Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, int nFlags);
private:
BYTE m_nQ;
int m_nFontStyle;
double m_dFS;
std::wstring m_wsFN;
std::wstring m_wsOverlayText;
std::vector<double> m_arrIC;
std::vector<double> m_arrFC;
std::vector<double> m_arrQuadPoints;
};
class GRAPHICS_DECL CLinkAnnotPr
{
public:
CLinkAnnotPr();
~CLinkAnnotPr();
BYTE GetH() const;
int GetFlags() const;
const std::vector<double>& GetQuadPoints();
CActionFieldPr* GetA();
CActionFieldPr* GetPA();
void Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader);
private:
BYTE m_nH;
int m_nFlags;
std::vector<double> m_arrQuadPoints;
CActionFieldPr* m_pAction;
CActionFieldPr* m_pPA;
};
CAnnotFieldInfo();
virtual ~CAnnotFieldInfo();
@ -491,6 +541,8 @@ public:
bool IsFreeText() const;
bool IsCaret() const;
bool IsStamp() const;
bool IsRedact() const;
bool IsLink() const;
CMarkupAnnotPr* GetMarkupAnnotPr();
CTextAnnotPr* GetTextAnnotPr();
@ -503,6 +555,8 @@ public:
CFreeTextAnnotPr* GetFreeTextAnnotPr();
CCaretAnnotPr* GetCaretAnnotPr();
CStampAnnotPr* GetStampAnnotPr();
CRedactAnnotPr* GetRedactAnnotPr();
CLinkAnnotPr* GetLinkAnnotPr();
CWidgetAnnotPr* GetWidgetAnnotPr();
bool Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector);
@ -547,6 +601,8 @@ private:
CFreeTextAnnotPr* m_pFreeTextPr;
CCaretAnnotPr* m_pCaretPr;
CStampAnnotPr* m_pStampPr;
CRedactAnnotPr* m_pRedactPr;
CLinkAnnotPr* m_pLinkPr;
CWidgetAnnotPr* m_pWidgetPr;
};
@ -581,7 +637,7 @@ public:
std::wstring sTU;
std::vector<int> arrI;
std::vector<std::wstring> arrV;
std::vector<CAnnotFieldInfo::CWidgetAnnotPr::CActionWidget*> arrAction;
std::vector<CAnnotFieldInfo::CActionFieldPr*> arrAction;
std::vector< std::pair<std::wstring, std::wstring> > arrOpt;
};
@ -602,4 +658,27 @@ private:
std::vector<CParent*> m_arrParents;
};
class GRAPHICS_DECL CRedact : public IAdvancedCommand
{
public:
struct SRedact
{
std::wstring sID;
std::vector<double> arrQuadPoints;
int nFlag;
LONG nRenderLen;
BYTE* pRender;
};
CRedact();
virtual ~CRedact();
const std::vector<SRedact*>& GetRedact();
bool Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector);
private:
std::vector<SRedact*> m_arrRedact;
};
#endif // _BUILD_ANNOTFIELD_H_

View File

@ -147,10 +147,20 @@ void CShapeStart::SetShapeImage(BYTE* pImgData, int nWidth, int nHeight)
}
}
std::string& CShapeStart::GetShapeXML() { return m_sShapeXML; }
const std::vector<std::wstring>& CShapeStart::GetRedactID() { return m_arrRedactID; }
Aggplus::CImage* CShapeStart::GetShapeImage() { return m_pImage; }
bool CShapeStart::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector)
bool CShapeStart::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector, int nLen)
{
int nStart = pReader->Tell();
m_sShapeXML = pReader->ReadStringA();
int nEnd = pReader->Tell();
if (nEnd - nStart < nLen)
{
int n = pReader->ReadInt();
m_arrRedactID.reserve(n);
for (int i = 0; i < n; ++i)
m_arrRedactID.push_back(pReader->ReadString());
}
return true;
}
@ -169,7 +179,6 @@ CHeadings::CHeading::CHeading()
nPage = 0;
dX = 0.0;
dY = 0.0;
pParent = NULL;
}
CHeadings::CHeading::~CHeading()
{
@ -186,35 +195,26 @@ CHeadings::~CHeadings()
const std::vector<CHeadings::CHeading*>& CHeadings::GetHeading() { return m_arrHeading; }
bool CHeadings::Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector)
{
int nPredLevel = 0, nHeaderLevel = 0;
std::vector<CHeading*>* arrHeading = &m_arrHeading;
CHeading* pParent = NULL;
std::vector<CHeading*> arrParentStack;
int nHeadings = pReader->ReadInt();
for (int i = 0; i < nHeadings; ++i)
{
int nLevel = pReader->ReadInt();
if (nLevel > nPredLevel && i > 0)
{
nHeaderLevel = nPredLevel;
pParent = arrHeading->back();
arrHeading = &pParent->arrHeading;
}
else if (nLevel < nPredLevel && nLevel <= nHeaderLevel)
{
nHeaderLevel = nLevel;
pParent = pParent ? pParent->pParent : NULL;
arrHeading = pParent ? &pParent->arrHeading : &m_arrHeading;
}
nPredLevel = nLevel;
CHeading* pHeading = new CHeading();
pHeading->nPage = pReader->ReadInt();
pHeading->dX = pReader->ReadDouble();
pHeading->dY = pReader->ReadDouble();
pHeading->wsTitle = pReader->ReadString();
pHeading->pParent = pParent;
arrHeading->push_back(pHeading);
while (arrParentStack.size() > nLevel)
arrParentStack.pop_back();
if (arrParentStack.empty())
m_arrHeading.push_back(pHeading);
else
arrParentStack.back()->arrHeading.push_back(pHeading);
arrParentStack.push_back(pHeading);
}
return true;
}

View File

@ -139,15 +139,17 @@ public:
~CShapeStart();
std::string& GetShapeXML();
const std::vector<std::wstring>& GetRedactID();
Aggplus::CImage* GetShapeImage();
void SetShapeXML(const std::string& sShapeXML);
void SetShapeImage(BYTE* pImgData, int nWidth, int nHeight);
bool Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector);
bool Read(NSOnlineOfficeBinToPdf::CBufferReader* pReader, IMetafileToRenderter* pCorrector, int nLen);
private:
std::string m_sShapeXML;
std::vector<std::wstring> m_arrRedactID;
Aggplus::CImage* m_pImage;
};
@ -179,7 +181,6 @@ public:
int nPage;
double dX;
double dY;
CHeading* pParent;
std::vector<CHeading*> arrHeading;
CHeading();

View File

@ -639,6 +639,7 @@ namespace NSFonts
virtual double GetCharWidth(int gid) = 0;
virtual int GetGIDByUnicode(int code) = 0;
virtual int GetUnicodeByGID(int gid) = 0;
virtual int GetEmbeddingLicenceType() = 0;
virtual void FillFontSelectFormat(CFontSelectFormat& oFormat) = 0;
@ -736,6 +737,7 @@ namespace NSFonts
virtual unsigned int GetNameIndex(const std::wstring& wsName) = 0;
virtual unsigned int GetGIDByUnicode(const unsigned int& unCode) = 0;
virtual int GetUnicodeByGID(const int& gid) = 0;
virtual void GetFace(double& d0, double& d1, double& d2) = 0;
virtual void GetLimitsY(double& dMin, double& dMax) = 0;

View File

@ -46,14 +46,20 @@
"_InitializeFontsRanges",
"_SetFontBinary",
"_GetFontBinary",
"_GetGIDByUnicode",
"_IsFontBinaryExist",
"_DestroyTextInfo",
"_IsNeedCMap",
"_SetCMapData",
"_SetScanPageFonts",
"_ScanPage",
"_SplitPages",
"_MergePages",
"_UnmergePages",
"_RedactPage",
"_UndoRedact",
"_CheckOwnerPassword",
"_CheckPerm",
"_GetImageBase64",
"_GetImageBase64Len",
"_GetImageBase64Ptr",
@ -95,7 +101,7 @@
"compile_files_array": [
{
"folder": "../../../raster/",
"files": ["BgraFrame.cpp", "ImageFileFormatChecker.cpp", "PICT/PICFile.cpp", "PICT/pic.cpp"]
"files": ["BgraFrame.cpp", "ImageFileFormatChecker.cpp", "PICT/PICFile.cpp"]
},
{
"folder": "../../../cximage/CxImage/",
@ -155,11 +161,11 @@
},
{
"folder": "../../../agg-2.4/src/",
"files": ["agg_arc.cpp", "agg_vcgen_stroke.cpp", "agg_vcgen_dash.cpp", "agg_trans_affine.cpp", "agg_curves.cpp", "agg_image_filters.cpp"]
"files": ["agg_arc.cpp", "agg_vcgen_stroke.cpp", "agg_vcgen_dash.cpp", "agg_trans_affine.cpp", "agg_curves.cpp", "agg_image_filters.cpp", "agg_bezier_arc.cpp"]
},
{
"folder": "../../../common/",
"files": ["File.cpp", "Directory.cpp", "ByteBuilder.cpp", "Base64.cpp", "StringExt.cpp", "Path.cpp", "SystemUtils.cpp"]
"files": ["File.cpp", "Directory.cpp", "ByteBuilder.cpp", "Base64.cpp", "StringExt.cpp", "Path.cpp", "SystemUtils.cpp", "StringUTF32.cpp", "StringBuilder.cpp"]
},
{
"folder": "../../../../Common/3dParty/icu/icu/source/common/",
@ -191,11 +197,11 @@
},
{
"folder": "../../../../PdfFile/SrcReader/",
"files": ["Adaptors.cpp", "GfxClip.cpp", "RendererOutputDev.cpp", "JPXStream2.cpp", "PdfAnnot.cpp"]
"files": ["Adaptors.cpp", "GfxClip.cpp", "RendererOutputDev.cpp", "JPXStream2.cpp", "PdfAnnot.cpp", "PdfFont.cpp"]
},
{
"folder": "../../../../PdfFile/SrcWriter/",
"files": ["AcroForm.cpp", "Annotation.cpp", "Catalog.cpp", "Destination.cpp", "Document.cpp", "Encrypt.cpp", "EncryptDictionary.cpp", "Field.cpp", "Font.cpp", "Font14.cpp", "FontCidTT.cpp", "FontOTWriter.cpp", "FontTT.cpp", "FontTTWriter.cpp", "GState.cpp", "Image.cpp", "Info.cpp", "Metadata.cpp", "Objects.cpp", "Outline.cpp", "Pages.cpp", "Pattern.cpp", "ResourcesDictionary.cpp", "Shading.cpp", "States.cpp", "Streams.cpp", "Utils.cpp"]
"files": ["AcroForm.cpp", "Annotation.cpp", "Catalog.cpp", "Destination.cpp", "Document.cpp", "Encrypt.cpp", "EncryptDictionary.cpp", "Field.cpp", "Font.cpp", "Font14.cpp", "FontCidTT.cpp", "FontOTWriter.cpp", "FontTT.cpp", "FontTTWriter.cpp", "GState.cpp", "Image.cpp", "Info.cpp", "Metadata.cpp", "Objects.cpp", "Outline.cpp", "Pages.cpp", "Pattern.cpp", "ResourcesDictionary.cpp", "Shading.cpp", "States.cpp", "Streams.cpp", "Utils.cpp", "RedactOutputDev.cpp"]
},
{
"folder": "../../../../PdfFile/Resources/",
@ -250,8 +256,8 @@
"files": ["BaseItem.cpp", "ContText.cpp", "Paragraph.cpp", "Shape.cpp", "TextLine.cpp", "Table.cpp"]
},
{
"folder": "../../../common",
"files": ["StringUTF32.cpp", "StringBuilder.cpp"]
"folder": "../../../../OdfFile/Common",
"files": ["logging.cpp"]
}
]
}

View File

@ -113,7 +113,6 @@ SOURCES += \
../../../../raster/ImageFileFormatChecker.cpp \
../../../../raster/Metafile/MetaFile.cpp \
../../../../raster/PICT/PICFile.cpp \
../../../../raster/PICT/pic.cpp \
\
../../../ArrowHead.cpp \
../../../Brush.cpp \
@ -640,6 +639,7 @@ SOURCES += \
$$PDF_ROOT_DIR/SrcReader/Adaptors.cpp \
$$PDF_ROOT_DIR/SrcReader/GfxClip.cpp \
$$PDF_ROOT_DIR/SrcReader/PdfAnnot.cpp \
$$PDF_ROOT_DIR/SrcReader/PdfFont.cpp \
$$PDF_ROOT_DIR/Resources/BaseFonts.cpp \
$$PDF_ROOT_DIR/Resources/CMapMemory/cmap_memory.cpp
@ -665,6 +665,7 @@ HEADERS +=\
$$PDF_ROOT_DIR/SrcReader/MemoryUtils.h \
$$PDF_ROOT_DIR/SrcReader/GfxClip.h \
$$PDF_ROOT_DIR/SrcReader/FontsWasm.h \
$$PDF_ROOT_DIR/SrcReader/PdfFont.h \
$$PDF_ROOT_DIR/SrcReader/PdfAnnot.h
DEFINES += CRYPTOPP_DISABLE_ASM
@ -701,7 +702,8 @@ HEADERS += \
$$PDF_ROOT_DIR/SrcWriter/Utils.h \
$$PDF_ROOT_DIR/SrcWriter/Metadata.h \
$$PDF_ROOT_DIR/SrcWriter/ICCProfile.h \
$$PDF_ROOT_DIR/SrcWriter/States.h
$$PDF_ROOT_DIR/SrcWriter/States.h \
$$PDF_ROOT_DIR/SrcWriter/RedactOutputDev.h
SOURCES += \
$$PDF_ROOT_DIR/SrcWriter/AcroForm.cpp \
@ -730,7 +732,8 @@ SOURCES += \
$$PDF_ROOT_DIR/SrcWriter/Streams.cpp \
$$PDF_ROOT_DIR/SrcWriter/Utils.cpp \
$$PDF_ROOT_DIR/SrcWriter/Metadata.cpp \
$$PDF_ROOT_DIR/SrcWriter/States.cpp
$$PDF_ROOT_DIR/SrcWriter/States.cpp \
$$PDF_ROOT_DIR/SrcWriter/RedactOutputDev.cpp
# PdfFile

View File

@ -145,9 +145,17 @@ CFile.prototype["isNeedPassword"] = function()
{
return this._isNeedPassword;
};
CFile.prototype["SplitPages"] = function(arrPageIndex, arrayBufferChanges)
CFile.prototype["CheckOwnerPassword"] = function(password)
{
let ptr = this._SplitPages(arrPageIndex, arrayBufferChanges);
return this._CheckOwnerPassword(password);
};
CFile.prototype["CheckPerm"] = function(perm)
{
return this._CheckPerm(perm);
};
CFile.prototype["SplitPages"] = function(arrOriginIndex, arrayBufferChanges)
{
let ptr = this._SplitPages(arrOriginIndex, arrayBufferChanges);
let res = ptr.getMemory(true);
ptr.free();
return res;
@ -160,6 +168,14 @@ CFile.prototype["UndoMergePages"] = function()
{
return this._UndoMergePages();
};
CFile.prototype["RedactPage"] = function(originIndex, arrRedactBox, arrayBufferFiller)
{
return this._RedactPage(originIndex, arrRedactBox, arrayBufferFiller);
};
CFile.prototype["UndoRedact"] = function()
{
return this._UndoRedact();
};
// INFO DOCUMENT
CFile.prototype.getInfo = function()
@ -251,9 +267,9 @@ CFile.prototype["getStructure"] = function()
return res;
};
CFile.prototype["getLinks"] = function(pageIndex)
CFile.prototype["getLinks"] = function(originIndex)
{
let ptr = this._getLinks(pageIndex);
let ptr = this._getLinks(originIndex);
let reader = ptr.getReader();
if (!reader) return [];
@ -276,11 +292,12 @@ CFile.prototype["getLinks"] = function(pageIndex)
};
// TEXT
CFile.prototype["getGlyphs"] = function(pageIndex)
CFile.prototype["getGlyphs"] = function(originIndex)
{
let pageIndex = this.pages.findIndex(function(page) {
return page.originIndex == originIndex;
});
let page = this.pages[pageIndex];
if (page.originIndex == undefined)
return [];
if (page.fonts.length > 0)
{
// waiting fonts
@ -288,7 +305,7 @@ CFile.prototype["getGlyphs"] = function(pageIndex)
}
this.lockPageNumForFontsLoader(pageIndex, UpdateFontsSource.Page);
let res = this._getGlyphs(page.originIndex);
let res = this._getGlyphs(originIndex);
// there is no need to delete the result; this buffer is used as a text buffer
// for text commands on other pages. After receiving ALL text pages,
// you need to call destroyTextInfo()
@ -345,6 +362,26 @@ CFile.prototype["getFontByID"] = function(ID)
return this._getFontByID(ID);
};
CFile.prototype["getGIDByUnicode"] = function(ID)
{
let ptr = this._getGIDByUnicode(ID);
let reader = ptr.getReader();
if (!reader)
return {};
let res = {};
let nFontLength = reader.readInt();
for (let i = 0; i < nFontLength; i++)
{
let np1 = reader.readInt();
let np2 = reader.readInt();
res[np2] = np1;
}
ptr.free();
return res;
};
CFile.prototype["setCMap"] = function(memoryBuffer)
{
if (!this.nativeFile)
@ -392,7 +429,7 @@ function readAction(reader, rec, readDoubleFunc, readStringFunc)
case 6:
case 7:
{
let nFlag = reader.readByte();
let nFlag = reader.readInt();
if (nFlag & (1 << 0))
rec["left"] = readDoubleFunc.call(reader);
if (nFlag & (1 << 1))
@ -404,9 +441,9 @@ function readAction(reader, rec, readDoubleFunc, readStringFunc)
case 4:
{
rec["left"] = readDoubleFunc.call(reader);
rec["bottom"] = readDoubleFunc.call(reader);
rec["top"] = readDoubleFunc.call(reader);
rec["right"] = readDoubleFunc.call(reader);
rec["top"] = readDoubleFunc.call(reader);
rec["bottom"] = readDoubleFunc.call(reader);
break;
}
case 1:
@ -612,6 +649,7 @@ function readAnnotType(reader, rec, readDoubleFunc, readDouble2Func, readStringF
oFont["vertical"] = readDoubleFunc.call(reader);
if (nFontFlag & (1 << 6))
oFont["actual"] = readStringFunc.call(reader);
oFont["rtl"] = (nFontFlag >> 7) & 1;
oFont["size"] = readDoubleFunc.call(reader);
oFont["color"] = [];
oFont["color"].push(readDouble2Func.call(reader));
@ -1017,6 +1055,37 @@ function readAnnotType(reader, rec, readDoubleFunc, readDouble2Func, readStringF
rec["font"]["style"] = reader.readInt();
}
}
// Link
else if (rec["type"] == 1)
{
flags = reader.readInt();
if (flags & (1 << 0))
{
rec["A"] = {};
if (isRead)
readStringFunc.call(reader);
readAction(reader, rec["A"], readDoubleFunc, readStringFunc);
}
if (flags & (1 << 1))
{
rec["PA"] = {};
if (isRead)
readStringFunc.call(reader);
readAction(reader, rec["PA"], readDoubleFunc, readStringFunc);
}
// Selection mode - H
// 0 - none, 1 - invert, 2 - push, 3 - outline
if (flags & (1 << 2))
rec["highlight"] = reader.readByte();
// QuadPoints
if (flags & (1 << 3))
{
let n = reader.readInt();
rec["QuadPoints"] = [];
for (let i = 0; i < n; ++i)
rec["QuadPoints"].push(readDoubleFunc.call(reader));
}
}
}
function readWidgetType(reader, rec, readDoubleFunc, readDouble2Func, readStringFunc, isRead = false)
{
@ -1161,6 +1230,20 @@ function readWidgetType(reader, rec, readDoubleFunc, readDouble2Func, readString
rec["value"] = readStringFunc.call(reader);
// 0 - check, 1 - cross, 2 - diamond, 3 - circle, 4 - star, 5 - square
rec["style"] = reader.readByte();
if (flags & (1 << 10))
{
let n = reader.readInt();
rec["opt"] = [];
for (let i = 0; i < n; ++i)
{
let opt1 = readStringFunc.call(reader);
let opt2 = readStringFunc.call(reader);
if (opt1 == "")
rec["opt"].push(opt2);
else
rec["opt"].push([opt2, opt1]);
}
}
if (flags & (1 << 14))
rec["ExportValue"] = readStringFunc.call(reader);
// 12.7.4.2.1
@ -1399,7 +1482,7 @@ CFile.prototype["getInteractiveFormsInfo"] = function()
// optional nWidget - rec["AP"]["i"]
// optional sView - N/D/R
// optional sButtonView - state pushbutton-annotation - Off/Yes(or rec["ExportValue"])
CFile.prototype["getInteractiveFormsAP"] = function(pageIndex, width, height, backgroundColor, nWidget, sView, sButtonView)
CFile.prototype["getInteractiveFormsAP"] = function(originIndex, width, height, backgroundColor, nWidget, sView, sButtonView)
{
let nView = -1;
if (sView)
@ -1415,8 +1498,11 @@ CFile.prototype["getInteractiveFormsAP"] = function(pageIndex, width, height, ba
if (sButtonView)
nButtonView = (sButtonView == "Off" ? 0 : 1);
let pageIndex = this.pages.findIndex(function(page) {
return page.originIndex == originIndex;
});
this.lockPageNumForFontsLoader(pageIndex, UpdateFontsSource.Forms);
let ptr = this._getInteractiveFormsAP(width, height, backgroundColor, pageIndex, nWidget, nView, nButtonView);
let ptr = this._getInteractiveFormsAP(width, height, backgroundColor, originIndex, nWidget, nView, nButtonView);
let reader = ptr.getReader();
this.unlockPageNumForFontsLoader();
@ -1501,13 +1587,13 @@ CFile.prototype["getButtonIcons"] = function(pageIndex, width, height, backgroun
ptr.free();
return res;
};
// optional pageIndex - get annotations from specific page
CFile.prototype["getAnnotationsInfo"] = function(pageIndex)
// optional originIndex - get annotations from specific page
CFile.prototype["getAnnotationsInfo"] = function(originIndex)
{
if (!this.nativeFile)
return [];
let ptr = this._getAnnotationsInfo(pageIndex);
let ptr = this._getAnnotationsInfo(originIndex);
let reader = ptr.getReader();
if (!reader) return [];
@ -1539,7 +1625,7 @@ CFile.prototype["getAnnotationsInfo"] = function(pageIndex)
};
// optional nAnnot ...
// optional sView ...
CFile.prototype["getAnnotationsAP"] = function(pageIndex, width, height, backgroundColor, nAnnot, sView)
CFile.prototype["getAnnotationsAP"] = function(originIndex, width, height, backgroundColor, nAnnot, sView)
{
let nView = -1;
if (sView)
@ -1552,8 +1638,11 @@ CFile.prototype["getAnnotationsAP"] = function(pageIndex, width, height, backgro
nView = 2;
}
let pageIndex = this.pages.findIndex(function(page) {
return page.originIndex == originIndex;
});
this.lockPageNumForFontsLoader(pageIndex, UpdateFontsSource.Annotation);
let ptr = this._getAnnotationsAP(width, height, backgroundColor, pageIndex, nAnnot, nView);
let ptr = this._getAnnotationsAP(width, height, backgroundColor, originIndex, nAnnot, nView);
let reader = ptr.getReader();
this.unlockPageNumForFontsLoader();
@ -1632,6 +1721,11 @@ CFile.prototype["readAnnotationsInfoFromBinary"] = function(AnnotInfo)
};
// SCAN PAGES
CFile.prototype["scanPageFonts"] = function(page)
{
this._setScanPageFonts(page);
};
CFile.prototype["scanPage"] = function(page, mode)
{
let ptr = this._scanPage(page, mode);

View File

@ -135,6 +135,27 @@ CFile.prototype._UndoMergePages = function()
return g_native_drawing_file["UnmergePages"]();
};
CFile.prototype._RedactPage = function(pageIndex, box, filler)
{
let dataFiller = (undefined !== filler.byteLength) ? new Uint8Array(filler) : filler;
return g_native_drawing_file["RedactPage"](pageIndex, box, dataFiller);
};
CFile.prototype._UndoRedact = function()
{
return g_native_drawing_file["UndoRedact"]();
};
CFile.prototype._CheckOwnerPassword = function(password)
{
return true;
}
CFile.prototype._CheckPerm = function(perm)
{
return true;
}
// FONTS
CFile.prototype._isNeedCMap = function()
{
@ -151,6 +172,12 @@ CFile.prototype._getFontByID = function(ID)
return g_native_drawing_file["GetFontBinary"](ID);
};
CFile.prototype._getGIDByUnicode = function(ID)
{
g_module_pointer.ptr = g_native_drawing_file["GetGIDByUnicode"](ID);
return g_module_pointer;
}
CFile.prototype._getInteractiveFormsFonts = function(type)
{
g_module_pointer.ptr = g_native_drawing_file["GetInteractiveFormsFonts"](type);
@ -225,6 +252,11 @@ CFile.prototype._getInteractiveFormsAP = function(width, height, backgroundColor
};
// SCAN PAGES
CFile.prototype._setScanPageFonts = function(page)
{
g_native_drawing_file["SetScanPageFonts"](page);
};
CFile.prototype._scanPage = function(page, mode)
{
g_module_pointer.ptr = g_native_drawing_file["ScanPage"](page, (mode === undefined) ? 0 : mode);

View File

@ -106,7 +106,7 @@ CFile.prototype._openFile = function(buffer, password)
}
let passwordPtr = 0;
if (password)
if (password !== undefined)
{
let passwordBuf = password.toUtf8();
passwordPtr = Module["_malloc"](passwordBuf.length);
@ -192,6 +192,61 @@ CFile.prototype._UndoMergePages = function()
return Module["_UnmergePages"](this.nativeFile) == 1;
};
CFile.prototype._RedactPage = function(pageIndex, arrRedactBox, arrayBufferFiller)
{
let changesPtr = 0;
let changesLen = 0;
if (arrayBufferFiller)
{
let changes = new Uint8Array(arrayBufferFiller);
changesLen = changes.length;
changesPtr = Module["_malloc"](changesLen);
Module["HEAP8"].set(changes, changesPtr);
}
let memoryBuffer = new Int32Array(arrRedactBox.length);
for (let i = 0; i < arrRedactBox.length; i++)
memoryBuffer[i] = Math.round(arrRedactBox[i] * 10000);
let pointer = Module["_malloc"](memoryBuffer.length * 4);
Module["HEAP32"].set(memoryBuffer, pointer >> 2);
let bRes = Module["_RedactPage"](this.nativeFile, pageIndex, pointer, memoryBuffer.length / 8, changesPtr, changesLen);
changesPtr = 0; // Success or not, changesPtr is either taken or freed
Module["_free"](pointer);
return bRes == 1;
};
CFile.prototype._UndoRedact = function()
{
return Module["_UndoRedact"](this.nativeFile) == 1;
};
CFile.prototype._CheckOwnerPassword = function(password)
{
let passwordPtr = 0;
if (password !== undefined)
{
let passwordBuf = password.toUtf8();
passwordPtr = Module["_malloc"](passwordBuf.length);
Module["HEAP8"].set(passwordBuf, passwordPtr);
}
let bRes = Module["_CheckOwnerPassword"](this.nativeFile, passwordPtr);
if (passwordPtr)
Module["_free"](passwordPtr);
return bRes == 1;
}
CFile.prototype._CheckPerm = function(perm)
{
return Module["_CheckPerm"](this.nativeFile, perm) == 1;
}
// FONTS
CFile.prototype._isNeedCMap = function()
{
@ -231,6 +286,19 @@ CFile.prototype._getFontByID = function(ID)
return res;
};
CFile.prototype._getGIDByUnicode = function(ID)
{
if (ID === undefined)
return null;
let idBuffer = ID.toUtf8();
let idPointer = Module["_malloc"](idBuffer.length);
Module["HEAP8"].set(idBuffer, idPointer);
g_module_pointer.ptr = Module["_GetGIDByUnicode"](this.nativeFile, idPointer);
Module["_free"](idPointer);
return g_module_pointer;
}
CFile.prototype._getInteractiveFormsFonts = function(type)
{
g_module_pointer.ptr = Module["_GetInteractiveFormsFonts"](this.nativeFile, type);
@ -305,6 +373,11 @@ CFile.prototype._getInteractiveFormsAP = function(width, height, backgroundColor
};
// SCAN PAGES
CFile.prototype._setScanPageFonts = function(page)
{
Module["_SetScanPageFonts"](this.nativeFile, page);
};
CFile.prototype._scanPage = function(page, mode)
{
g_module_pointer.ptr = Module["_ScanPage"](this.nativeFile, page, (mode === undefined) ? 0 : mode);

View File

@ -80,7 +80,7 @@ WASM_EXPORT CDrawingFile* Open(BYTE* data, LONG size, const char* password)
std::wstring sPassword = L"";
if (NULL != password)
sPassword = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)password, strlen(password));
pFile->OpenFile(data, size, sPassword);
pFile->OpenFile(data, size, password ? sPassword.c_str() : NULL);
return pFile;
}
WASM_EXPORT int GetType(CDrawingFile* pFile)
@ -150,6 +150,10 @@ WASM_EXPORT BYTE* GetFontBinary(CDrawingFile* pFile, char* path)
{
return pFile->GetFontBinary(std::string(path));
}
WASM_EXPORT BYTE* GetGIDByUnicode(CDrawingFile* pFile, char* path)
{
return pFile->GetGIDByUnicode(std::string(path));
}
WASM_EXPORT void DestroyTextInfo(CDrawingFile* pFile)
{
return pFile->DestroyTextInfo();
@ -162,6 +166,10 @@ WASM_EXPORT void SetCMapData(CDrawingFile* pFile, BYTE* data, int size)
{
pFile->SetCMapData(data, size);
}
WASM_EXPORT void SetScanPageFonts(CDrawingFile* pFile, int nPageIndex)
{
return pFile->SetScanPageFonts(nPageIndex);
}
WASM_EXPORT BYTE* ScanPage(CDrawingFile* pFile, int nPageIndex, int mode)
{
return pFile->ScanPage(nPageIndex, mode);
@ -178,6 +186,30 @@ WASM_EXPORT int UnmergePages(CDrawingFile* pFile)
{
return pFile->UnmergePages() ? 1 : 0;
}
WASM_EXPORT int RedactPage(CDrawingFile* pFile, int nPageIndex, int* arrRedactBox, int nLengthX8, BYTE* data, int size)
{
double* arrDRedactBox = new double[nLengthX8 * 8];
for (int i = 0; i < nLengthX8 * 8; ++i)
arrDRedactBox[i] = arrRedactBox[i] / 10000.0;
int nRes = pFile->RedactPage(nPageIndex, arrDRedactBox, nLengthX8, data, size) ? 1 : 0;
delete[] arrDRedactBox;
return nRes;
}
WASM_EXPORT int UndoRedact(CDrawingFile* pFile)
{
return pFile->UndoRedact() ? 1 : 0;
}
WASM_EXPORT int CheckOwnerPassword(CDrawingFile* pFile, const char* password)
{
std::wstring sPassword = L"";
if (NULL != password)
sPassword = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)password, strlen(password));
return pFile->CheckOwnerPassword(password ? sPassword.c_str() : NULL) ? 1 : 0;
}
WASM_EXPORT int CheckPerm(CDrawingFile* pFile, int nPermFlag)
{
return pFile->CheckPerm(nPermFlag) ? 1 : 0;
}
WASM_EXPORT void* GetImageBase64(CDrawingFile* pFile, int rId)
{

View File

@ -704,6 +704,23 @@ void ReadInteractiveForms(BYTE* pWidgets, int& i)
i += 1;
std::cout << "Style " << arrStyle[nPathLength] << ", ";
if (nFlags & (1 << 10))
{
int nOptLength = READ_INT(pWidgets + i);
i += 4;
for (int j = 0; j < nOptLength; ++j)
{
nPathLength = READ_INT(pWidgets + i);
i += 4;
std::cout << std::to_string(j) << " Opt1 " << std::string((char*)(pWidgets + i), nPathLength) << ", ";
i += nPathLength;
nPathLength = READ_INT(pWidgets + i);
i += 4;
std::cout << std::to_string(j) << " Opt2 " << std::string((char*)(pWidgets + i), nPathLength) << ", ";
i += nPathLength;
}
}
if (nFlags & (1 << 14))
{
nPathLength = READ_INT(pWidgets + i);
@ -938,6 +955,36 @@ void ReadInteractiveFormsFonts(CDrawingFile* pGrFile, int nType)
std::cout << "font" << j << ".txt";
}
if (pFont)
free(pFont);
if (true)
continue;
pFont = GetGIDByUnicode(pGrFile, (char*)sFontName.c_str());
nLength2 = READ_INT(pFont);
i2 = 4;
nLength2 -= 4;
while (i2 < nLength2)
{
int nFontLength = READ_INT(pFont + i2);
i2 += 4;
std::cout << std::endl << "GIDtoUnicode" << std::endl;
for (int j = 0; j < nFontLength; ++j)
{
unsigned int code = READ_INT(pFont + i2);
i2 += 4;
unsigned int unicode = READ_INT(pFont + i2);
i2 += 4;
std::cout << "gid\t" << code << "\tunicode\t" << unicode << std::endl;
}
std::cout << std::endl;
}
if (pFont)
free(pFont);
}
@ -976,6 +1023,8 @@ bool GetFromBase64(const std::wstring& sPath, BYTE** pBuffer, int* nBufferLen)
if (!NSBase64::Base64Decode((const char*)pFileContent, dwFileSize, *pBuffer, nBufferLen))
return false;
}
else
return false;
oFile.CloseFile();
return true;
}
@ -1023,7 +1072,7 @@ int main(int argc, char* argv[])
if (!NSFile::CFileBinary::ReadAllBytes(sFilePath, &pFileData, nFileDataLen))
return 1;
CDrawingFile* pGrFile = Open(pFileData, (LONG)nFileDataLen, "");
CDrawingFile* pGrFile = Open(pFileData, (LONG)nFileDataLen, NULL);
int nError = GetErrorCode(pGrFile);
if (nError != 0)
@ -1031,7 +1080,7 @@ int main(int argc, char* argv[])
Close(pGrFile);
if (nError == 4)
{
std::string sPassword = "123456";
std::string sPassword = "";
pGrFile = Open(pFileData, nFileDataLen, sPassword.c_str());
}
else
@ -1049,7 +1098,7 @@ int main(int argc, char* argv[])
int nBufferLen = NULL;
BYTE* pBuffer = NULL;
if (GetFromBase64(NSFile::GetProcessDirectory() + L"/split1.txt", &pBuffer, &nBufferLen))
if (true && GetFromBase64(NSFile::GetProcessDirectory() + L"/split.txt", &pBuffer, &nBufferLen))
{
std::vector<int> arrPages = { 0 };
BYTE* pSplitPages = SplitPages(pGrFile, arrPages.data(), arrPages.size(), pBuffer, nBufferLen);
@ -1058,40 +1107,28 @@ int main(int argc, char* argv[])
if (nLength > 4)
{
NSFile::CFileBinary oFile;
if (oFile.CreateFileW(NSFile::GetProcessDirectory() + L"/split1.pdf"))
if (oFile.CreateFileW(NSFile::GetProcessDirectory() + L"/split.pdf"))
oFile.WriteFile(pSplitPages + 4, nLength - 4);
oFile.CloseFile();
BYTE* pMallocData = (BYTE*)malloc(nLength - 4);
memcpy(pMallocData, pSplitPages + 4, nLength - 4);
MergePages(pGrFile, pMallocData, nLength - 4, 0, "merge1");
}
RELEASEARRAYOBJECTS(pSplitPages);
}
RELEASEARRAYOBJECTS(pBuffer);
if (GetFromBase64(NSFile::GetProcessDirectory() + L"/split2.txt", &pBuffer, &nBufferLen))
if (true)
{
std::vector<int> arrPages = { 0 };
BYTE* pSplitPages = SplitPages(pGrFile, arrPages.data(), arrPages.size(), pBuffer, nBufferLen);
int nLength = READ_INT(pSplitPages);
if (nLength > 4)
NSFile::CFileBinary oFile;
if (oFile.OpenFile(NSFile::GetProcessDirectory() + L"/split.pdf"))
{
NSFile::CFileBinary oFile;
if (oFile.CreateFileW(NSFile::GetProcessDirectory() + L"/split2.pdf"))
oFile.WriteFile(pSplitPages + 4, nLength - 4);
oFile.CloseFile();
DWORD dwFileSize = oFile.GetFileSize();
BYTE* pFileContent = (BYTE*)malloc(dwFileSize);
BYTE* pMallocData = (BYTE*)malloc(nLength - 4);
memcpy(pMallocData, pSplitPages + 4, nLength - 4);
MergePages(pGrFile, pMallocData, nLength - 4, 0, "merge2");
DWORD dwReaded;
if (oFile.ReadFile(pFileContent, dwFileSize, dwReaded))
MergePages(pGrFile, pFileContent, dwReaded, 0, "merge1");
}
RELEASEARRAYOBJECTS(pSplitPages);
oFile.CloseFile();
}
RELEASEARRAYOBJECTS(pBuffer);
}
// INFO
@ -1135,17 +1172,38 @@ int main(int argc, char* argv[])
}
}
int i = nTestPage;
//for (int i = 0; i < nPagesCount; ++i)
// OWNER PASSWORD
if (false)
{
// RASTER
if (true)
std::string sPassword = "";
std::cout << "CheckPerm 4 Edit " << CheckPerm(pGrFile, 4) << std::endl;
std::cout << "CheckPerm 4 Print " << CheckPerm(pGrFile, 3) << std::endl;
std::cout << "CheckOwnerPassword " << CheckOwnerPassword(pGrFile, sPassword.c_str()) << std::endl;
std::cout << "CheckPerm 4 Edit " << CheckPerm(pGrFile, 4) << std::endl;
std::cout << "CheckPerm 4 Print " << CheckPerm(pGrFile, 3) << std::endl;
}
// REDACT
if (false)
{
BYTE* pColor = new BYTE[12] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int pRect[8] = { 307499, 217499, 307499, 1124999, 1799999, 1124999, 1799999, 217499 };
if (!RedactPage(pGrFile, nTestPage, pRect, 1, pColor, 12))
std::cout << "Redact false" << std::endl;
}
// RASTER
if (false)
{
int i = nTestPage;
//for (int i = 0; i < nPagesCount; ++i)
{
nWidth = READ_INT(pInfo + i * 16 + 12);
nHeight = READ_INT(pInfo + i * 16 + 16);
//nWidth *= 3;
//nHeight *= 3;
//nWidth *= 2;
//nHeight *= 2;
BYTE* res = NULL;
res = GetPixmap(pGrFile, i, nWidth, nHeight, 0xFFFFFF);
@ -1162,11 +1220,10 @@ int main(int argc, char* argv[])
RELEASEARRAYOBJECTS(res);
}
}
free(pInfo);
// LINKS
if (true && nPagesCount > 0)
if (false && nPagesCount > 0)
{
BYTE* pLinks = GetLinks(pGrFile, nTestPage);
nLength = READ_INT(pLinks);
@ -1202,7 +1259,7 @@ int main(int argc, char* argv[])
}
// STRUCTURE
if (true)
if (false)
{
BYTE* pStructure = GetStructure(pGrFile);
nLength = READ_INT(pStructure);
@ -1515,6 +1572,8 @@ int main(int argc, char* argv[])
std::cout << "; font-actual:" << std::string((char*)(pAnnots + i), nPathLength) << "; ";
i += nPathLength;
}
if (nFontFlag & (1 << 7))
std::cout << "; dir:rtl; ";
nPathLength = READ_INT(pAnnots + i);
i += 4;
@ -2132,6 +2191,44 @@ int main(int argc, char* argv[])
std::cout << nPathLength << ", ";
}
}
else if (sType == "Link")
{
nFlags = READ_INT(pAnnots + i);
i += 4;
if (nFlags & (1 << 0))
{
std::cout << std::endl << "A ";
ReadAction(pAnnots, i);
std::cout << std::endl;
}
if (nFlags & (1 << 1))
{
std::cout << std::endl << "PA ";
ReadAction(pAnnots, i);
std::cout << std::endl;
}
if (nFlags & (1 << 2))
{
std::string arrHighlighting[] = {"none", "invert", "push", "outline"};
nPathLength = READ_BYTE(pAnnots + i);
i += 1;
std::cout << "Highlight " << arrHighlighting[nPathLength] << ", ";
}
if (nFlags & (1 << 3))
{
std::cout << "QuadPoints";
int nQuadPointsLength = READ_INT(pAnnots + i);
i += 4;
for (int j = 0; j < nQuadPointsLength; ++j)
{
nPathLength = READ_INT(pAnnots + i);
i += 4;
std::cout << " " << (double)nPathLength / 100.0;
}
std::cout << ", ";
}
}
std::cout << std::endl << "]" << std::endl;
}
@ -2154,12 +2251,13 @@ int main(int argc, char* argv[])
free(pAnnotAP);
}
// SCAN PAGE
// SCAN PAGE Fonts
if (false)
{
BYTE* pScan = ScanPage(pGrFile, nTestPage, 1);
if (pScan)
free(pScan);
SetScanPageFonts(pGrFile, nTestPage);
ReadInteractiveFormsFonts(pGrFile, 1);
ReadInteractiveFormsFonts(pGrFile, 2);
}
Close(pGrFile);

View File

@ -121,7 +121,8 @@ METAFILE_PATH = $$PWD/../../raster/Metafile
$$METAFILE_PATH/svg/SvgObjects/CFont.h \
$$METAFILE_PATH/svg/SvgObjects/CStyle.h \
$$METAFILE_PATH/svg/SvgObjects/CObjectBase.h \
$$METAFILE_PATH/svg/SvgUtils.h
$$METAFILE_PATH/svg/SvgUtils.h \
$$METAFILE_PATH/svg/SvgReader.h
SOURCES += \
$$METAFILE_PATH/svg/CSvgFile.cpp \
@ -145,7 +146,8 @@ METAFILE_PATH = $$PWD/../../raster/Metafile
$$METAFILE_PATH/svg/SvgObjects/CPolyline.cpp \
$$METAFILE_PATH/svg/SvgObjects/CFont.cpp \
$$METAFILE_PATH/svg/SvgObjects/CObjectBase.cpp \
$$METAFILE_PATH/svg/SvgObjects/CStyle.cpp
$$METAFILE_PATH/svg/SvgObjects/CStyle.cpp \
$$METAFILE_PATH/svg/SvgReader.cpp
CONFIG += css_calculator_without_xhtml

View File

@ -63,9 +63,9 @@ public:
// Open
virtual bool LoadFromFile(const std::wstring& file, const std::wstring& options = L"",
const std::wstring& owner_password = L"", const std::wstring& user_password = L"") = 0;
const wchar_t* owner_password = NULL, const wchar_t* user_password = NULL) = 0;
virtual bool LoadFromMemory(unsigned char* data, unsigned long length, const std::wstring& options = L"",
const std::wstring& owner_password = L"", const std::wstring& user_password = L"") = 0;
const wchar_t* owner_password = NULL, const wchar_t* user_password = NULL) = 0;
// Close
virtual void Close() = 0;

View File

@ -282,8 +282,7 @@ SOURCES += \
$$LIB_GRAPHICS_PRI_PATH/raster/JBig2/source/JBig2File.cpp
SOURCES += \
$$LIB_GRAPHICS_PRI_PATH/raster/PICT/PICFile.cpp \
$$LIB_GRAPHICS_PRI_PATH/raster/PICT/pic.cpp
$$LIB_GRAPHICS_PRI_PATH/raster/PICT/PICFile.cpp
!build_xp {
CONFIG += support_heif

View File

@ -113,7 +113,10 @@ const long c_BrushTypeTensorCurveGradient = 6007;
const long c_BrushTextureModeStretch = 0;
const long c_BrushTextureModeTile = 1;
const long c_BrushTextureModeTileCenter = 2;
const long c_BrushTextureModeTileFlipX = 2;
const long c_BrushTextureModeTileFlipY = 3;
const long c_BrushTextureModeTileFlipXY = 4;
const long c_BrushTextureModeTileCenter = 5;
// --------------------------------------------------------------
namespace Aggplus { class CImage; }
@ -284,6 +287,13 @@ namespace NSStructures
Aggplus::RectF Rect;
Aggplus::CDoubleRect Bounds;
int IsScale;
double ScaleX;
double ScaleY;
double OffsetX;
double OffsetY;
double LinearAngle;
std::vector<TSubColor> m_arrSubColors;
NSStructures::GradientInfo m_oGradientInfo;
@ -415,6 +425,13 @@ namespace NSStructures
Rect.Width = 0.0F;
Rect.Height = 0.0F;
IsScale = FALSE;
ScaleX = 1.0;
ScaleY = 1.0;
OffsetX = 0.0;
OffsetY = 0.0;
Bounds.left = 0;
Bounds.top = 0;
Bounds.right = 0;
@ -454,6 +471,10 @@ namespace NSStructures
Rect = other.Rect;
Bounds = other.Bounds;
IsScale = other.IsScale;
ScaleX = other.ScaleX;
ScaleY = other.ScaleY;
LinearAngle = other.LinearAngle;
m_arrSubColors = other.m_arrSubColors;
m_oGradientInfo = other.m_oGradientInfo;

View File

@ -50,9 +50,9 @@ TEST(BooleanOperations, NoIntersOutside)
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, NoIntersInside)
@ -105,9 +105,9 @@ TEST(BooleanOperations, NoIntersInside)
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, OneIntersOutside)
@ -154,9 +154,9 @@ TEST(BooleanOperations, OneIntersOutside)
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, OneIntersInside)
@ -206,9 +206,9 @@ TEST(BooleanOperations, OneIntersInside)
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, OverlapOutside)
@ -258,9 +258,9 @@ TEST(BooleanOperations, OverlapOutside)
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, OverlapInside)
@ -312,9 +312,9 @@ TEST(BooleanOperations, OverlapInside)
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, LineIntersLine)
@ -368,9 +368,9 @@ TEST(BooleanOperations, LineIntersLine)
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, CurveIntersLine)
@ -415,9 +415,9 @@ TEST(BooleanOperations, CurveIntersLine)
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, CurveIntersCurve)
@ -453,9 +453,9 @@ TEST(BooleanOperations, CurveIntersCurve)
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, RectIntersRect)
@ -508,9 +508,9 @@ TEST(BooleanOperations, RectIntersRect)
resultSubtract.LineTo(55.0, 25.0);
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, EllipseIntersEllipse)
@ -550,9 +550,9 @@ TEST(BooleanOperations, EllipseIntersEllipse)
resultSubtract.CurveTo(303.228, 82.0, 348.0, 126.772, 348.0, 182.0);
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, EllipseIntersCross)
@ -621,9 +621,9 @@ TEST(BooleanOperations, EllipseIntersCross)
resultSubtract.CurveTo(188.228, 60, 233, 104.772, 233, 160);
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, TriangleIntersEllipse)
@ -665,9 +665,9 @@ TEST(BooleanOperations, TriangleIntersEllipse)
resultSubtract.CurveTo(243.078, 286.812, 260.127, 260.386, 263.419, 229.839);
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, TwoVerticesInters)
@ -715,9 +715,9 @@ TEST(BooleanOperations, TwoVerticesInters)
resultSubtract.LineTo(-300, -300);
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, RectIntersEllipse)
@ -773,9 +773,9 @@ TEST(BooleanOperations, RectIntersEllipse)
resultSubtract.CurveTo(257.623, 242.785, 258.883, 240.478, 260, 238.092);
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, RectIntersCross)
@ -869,9 +869,9 @@ TEST(BooleanOperations, RectIntersCross)
resultSubtract.LineTo(-89.5, 24);
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, CrossIntersTriangle)
@ -977,9 +977,9 @@ TEST(BooleanOperations, CrossIntersTriangle)
resultSubtract.LineTo(-6, 3.5);
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, CrossIntersCross)
@ -1077,9 +1077,9 @@ TEST(BooleanOperations, CrossIntersCross)
resultSubtract.LineTo(-72, -191);
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, EllipseTouchEllipse)
@ -1119,9 +1119,9 @@ TEST(BooleanOperations, EllipseTouchEllipse)
resultSubtract.CurveTo(138.137, 237, 165, 210.137, 165, 177);
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}
TEST(BooleanOperations, TriangleOverlapTriangle)
@ -1170,7 +1170,7 @@ TEST(BooleanOperations, TriangleOverlapTriangle)
resultSubtract.LineTo(-200, -300);
resultSubtract.CloseFigure();
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection) == resultIntersect);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union) == resultUnite);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction) == resultSubtract);
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Intersection).Equals(resultIntersect));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Union).Equals(resultUnite));
EXPECT_TRUE(Aggplus::CalcBooleanOperation(path1, path2, Aggplus::Subtraction).Equals(resultSubtract));
}

View File

@ -450,15 +450,15 @@ bool CBgraFrame::OpenFile(const std::wstring& strFileName, unsigned int nFileTyp
#if CXIMAGE_SUPPORT_PIC
if (CXIMAGE_FORMAR_PIC == m_nFileType)
{
PICT::CPictFile PIC;
return PIC.Open(this, strFileName, !m_bIsRGBA);
CPictFile pict_file;
return pict_file.Open(this, strFileName, m_bIsRGBA);
}
#endif
#if CXIMAGE_SUPPORT_HEIF
if (CXIMAGE_FORMAT_HEIF == m_nFileType)
{
return NSHeif::CHeifFile::Open(this, strFileName, m_bIsRGBA);
return NSHeif::CHeifFile::Open(this, strFileName, m_bIsRGBA);
}
#endif
@ -540,8 +540,8 @@ bool CBgraFrame::Decode(BYTE* pBuffer, int nSize, unsigned int nFileType)
#if CXIMAGE_SUPPORT_PIC
if (CXIMAGE_FORMAR_PIC == m_nFileType)
{
PICT::CPictFile PIC;
return PIC.Open(this, pBuffer, nSize, !m_bIsRGBA);
CPictFile pict_file;
return pict_file.Open(this, pBuffer, nSize, m_bIsRGBA);
}
#endif

View File

@ -202,6 +202,19 @@ bool CImageFileFormatChecker::isWbcFile(BYTE* pBuffer,DWORD dwBytes)
return false;
}
//raster graphics file format developed by Google
bool CImageFileFormatChecker::isWebPFile(BYTE* pBuffer, DWORD dwBytes)
{
if (eFileType)return false;
if ((20 <= dwBytes) && ('R' == pBuffer[0] && 'I' == pBuffer[1] && 'F' == pBuffer[2] && 'F' == pBuffer[3]
//47 length + 12
&& 'W' == pBuffer[8] && 'E' == pBuffer[9] && 'B' == pBuffer[10] && 'P' == pBuffer[11])
&& 'V' == pBuffer[12] && 'P' == pBuffer[13] && '8' == pBuffer[14])
return true;
return false;
}
//webshot(wb ver 1) HEX 57 57 42 42 31 31 31 31
//webshot (wb ver 2) HEX 00 00 02 00 02 10 c9 00 02 00 c8 06 4c 00 02 00
bool CImageFileFormatChecker::isWbFile(BYTE* pBuffer,DWORD dwBytes)
@ -336,7 +349,7 @@ bool CImageFileFormatChecker::isSvgFile(BYTE* pBuffer,DWORD dwBytes)
{
if (eFileType)return false;
if ( (6 <= dwBytes) &&(0x3C == pBuffer[0] && 0x3F == pBuffer[1] && 0x78 == pBuffer[2] && 0x6D == pBuffer[3]
if ( (6 <= dwBytes) && (0x3C == pBuffer[0] && 0x3F == pBuffer[1] && 0x78 == pBuffer[2] && 0x6D == pBuffer[3]
&& 0x6C == pBuffer[4] && 0x20 == pBuffer[5]))
{
std::string sXml_part = std::string((char*)pBuffer, dwBytes);
@ -345,6 +358,11 @@ bool CImageFileFormatChecker::isSvgFile(BYTE* pBuffer,DWORD dwBytes)
return true;
}
}
else if ( (6 <= dwBytes) && (0x3C == pBuffer[0] && 's' == pBuffer[1] && 'v' == pBuffer[2] && 'g' == pBuffer[3]
&& 0x20 == pBuffer[4]))
{
return true;
}
return false;
}
@ -509,6 +527,10 @@ bool CImageFileFormatChecker::isImageFile(const std::wstring& fileName)
{
eFileType = _CXIMAGE_FORMAT_WB;
}
else if (isWebPFile(buffer, sizeRead))
{
eFileType = _CXIMAGE_FORMAT_WEBP;
}
else if (isPsdFile(buffer,sizeRead))
{
eFileType = _CXIMAGE_FORMAT_PSD;

View File

@ -64,6 +64,7 @@ enum __ENUM_CXIMAGE_FORMATS
_CXIMAGE_FORMAT_SVG = 24,
_CXIMAGE_FORMAT_PIC = 25,
_CXIMAGE_FORMAT_HEIF = 26,
_CXIMAGE_FORMAT_WEBP = 27
};
class GRAPHICS_DECL CImageFileFormatChecker
@ -96,6 +97,7 @@ public:
bool isTiffFile(BYTE* pBuffer,DWORD dwBytes);
bool isJpgFile(BYTE* pBuffer,DWORD dwBytes);
bool isWbFile(BYTE* pBuffer,DWORD dwBytes);
bool isWebPFile(BYTE* pBuffer, DWORD dwBytes);
bool isIcoFile(BYTE* pBuffer,DWORD dwBytes);
bool isRasFile(BYTE* pBuffer,DWORD dwBytes);

View File

@ -53,7 +53,7 @@ namespace MetaFile
virtual void DrawBitmap(double dX, double dY, double dW, double dH, BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, unsigned int nBlendMode) = 0;
virtual void DrawString(std::wstring& wsText, unsigned int unCharsCount, double dX, double dY, double* pDx,
int iGraphicsMode = 1, double dXScale = 1, double dYScale = 1) = 0;
int iGraphicsMode = 1, double dXScale = 1, double dYScale = 1, bool bUseGID = false) = 0;
virtual void DrawDriverString(const std::wstring& wsString, const std::vector<TPointD>& arPoints) = 0;
@ -74,7 +74,7 @@ namespace MetaFile
virtual void EndClipPath(unsigned int unMode) = 0;
virtual void UpdateDC() = 0;
virtual void SetTransform(double& dM11, double& dM12, double& dM21, double& dM22, double& dX, double& dY) = 0;
virtual void SetTransform(const double& dM11, const double& dM12, const double& dM21, const double& dM22, const double& dX, const double& dY) = 0;
virtual void GetTransform(double* pdM11, double* pdM12, double* pdM21, double* pdM22, double* pdX, double* pdY) = 0;
};

View File

@ -352,7 +352,7 @@ namespace MetaFile
}
void DrawString(std::wstring& wsText, unsigned int unCharsCount, double _dX, double _dY, double* pDx, int iGraphicsMode, double dXScale, double dYScale)
void DrawString(std::wstring& wsText, unsigned int unCharsCount, double _dX, double _dY, double* pDx, int iGraphicsMode, double dXScale, double dYScale, bool bUseGID)
{
CheckEndPath();
const IFont* pFont = m_pFile->GetFont();
@ -681,11 +681,12 @@ namespace MetaFile
m_pRenderer->put_BrushColor1(m_pFile->GetTextColor());
m_pRenderer->put_BrushAlpha1(255);
if (bUseGID)
m_pRenderer->put_FontStringGID(TRUE);
// Рисуем сам текст
if (NULL == pDx)
{
m_pRenderer->CommandDrawText(wsString, dX, dY, 0, 0);
}
else
{
unsigned int unUnicodeLen = 0;
@ -704,6 +705,9 @@ namespace MetaFile
}
}
if (bUseGID)
m_pRenderer->put_FontStringGID(FALSE);
if (bChangeCTM)
m_pRenderer->ResetTransform();
}
@ -910,7 +914,7 @@ namespace MetaFile
m_bStartedPath = false;
}
void SetTransform(double& dM11, double& dM12, double& dM21, double& dM22, double& dX, double& dY)
void SetTransform(const double& dM11, const double& dM12, const double& dM21, const double& dM22, const double& dX, const double& dY)
{
double dKoefX = m_dScaleX;
double dKoefY = m_dScaleY;
@ -1233,7 +1237,7 @@ namespace MetaFile
// Вычисление минимально возможной ширины пера
// # Код явялется дублированным из Graphics
const double dSqrtDet = sqrt(abs(oMatrix.Determinant()));
const double dSqrtDet = sqrt(fabs(oMatrix.Determinant()));
const double dWidthMinSize = (dSqrtDet != 0) ? (1.0 / dSqrtDet) : dWidth;
if (0 == pPen->GetWidth())
@ -1266,19 +1270,6 @@ namespace MetaFile
if ((NULL != pDataDash && 0 != unSizeDash) || PS_SOLID != ulPenStyle)
{
// Дублированный код из Graphics
// Без этого используется оригинальный код в Graphics, который отрисовывает уже неверно
double dDashWidth{dWidth};
if (!Equals(dWidthMinSize, dWidth))
{
double dDet = oMatrix.Determinant();
if (fabs(dDet) < 0.0001)
dDashWidth *= dSqrtDet;
}
// -----------------------------
if (NULL != pDataDash && 0 != unSizeDash)
{
m_pRenderer->put_PenDashOffset(pPen->GetDashOffset());
@ -1286,7 +1277,7 @@ namespace MetaFile
std::vector<double> arDashes(unSizeDash);
for (unsigned int unIndex = 0; unIndex < unSizeDash; ++unIndex)
arDashes[unIndex] = pDataDash[unIndex] * dDashWidth;
arDashes[unIndex] = pDataDash[unIndex] * dWidth;
m_pRenderer->PenDashPattern(arDashes.data(), unSizeDash);
@ -1300,35 +1291,35 @@ namespace MetaFile
{
case PS_DASH:
{
arDashPattern.push_back(9 * dDashWidth);
arDashPattern.push_back(3 * dDashWidth);
arDashPattern.push_back(9 * dWidth);
arDashPattern.push_back(3 * dWidth);
break;
}
case PS_DOT:
{
arDashPattern.push_back(3 * dDashWidth);
arDashPattern.push_back(3 * dDashWidth);
arDashPattern.push_back(3 * dWidth);
arDashPattern.push_back(3 * dWidth);
break;
}
case PS_DASHDOT:
{
arDashPattern.push_back(9 * dDashWidth);
arDashPattern.push_back(6 * dDashWidth);
arDashPattern.push_back(3 * dDashWidth);
arDashPattern.push_back(6 * dDashWidth);
arDashPattern.push_back(9 * dWidth);
arDashPattern.push_back(6 * dWidth);
arDashPattern.push_back(3 * dWidth);
arDashPattern.push_back(6 * dWidth);
break;
}
case PS_DASHDOTDOT:
{
arDashPattern.push_back(9 * dDashWidth);
arDashPattern.push_back(6 * dDashWidth);
arDashPattern.push_back(3 * dDashWidth);
arDashPattern.push_back(6 * dDashWidth);
arDashPattern.push_back(3 * dDashWidth);
arDashPattern.push_back(6 * dDashWidth);
arDashPattern.push_back(9 * dWidth);
arDashPattern.push_back(6 * dWidth);
arDashPattern.push_back(3 * dWidth);
arDashPattern.push_back(6 * dWidth);
arDashPattern.push_back(3 * dWidth);
arDashPattern.push_back(6 * dWidth);
break;
}

View File

@ -999,20 +999,21 @@ namespace MetaFile
{
std::wstring wsText;
for (const wchar_t& wChar : wsString)
if (wChar == L'<')
{
if (wChar == L'<')
wsText += L"&lt;";
else if (wChar == L'>')
else if (wChar == L'>')
wsText += L"&gt;";
else if (wChar == L'&')
else if (wChar == L'&')
wsText += L"&amp;";
else if (wChar == L'\'')
else if (wChar == L'\'')
wsText += L"&apos;";
else if (wChar == L'"')
else if (wChar == L'"')
wsText += L"&quot;";
else if (wChar == L'\r' || (wChar >= 0x00 && wChar <=0x1F))
continue;
else wsText += wChar;
else wsText += wChar;
}
return wsText;
}

View File

@ -218,7 +218,7 @@ namespace MetaFile
void DrawBitmap(double dX, double dY, double dW, double dH, BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, unsigned int unBlendMode) override {};
void DrawString(std::wstring& wsText, unsigned int unCharsCount, double dX, double dY, double* pDx,
int iGraphicsMode = 1, double dXScale = 1, double dYScale = 1) override {};
int iGraphicsMode = 1, double dXScale = 1, double dYScale = 1, bool bUseGID = false) override {};
void DrawDriverString(const std::wstring& wsString, const std::vector<TPointD>& arPoints) override {};
@ -239,7 +239,7 @@ namespace MetaFile
void EndClipPath(unsigned int unMode) override {};
void UpdateDC() override {};
void SetTransform(double& dM11, double& dM12, double& dM21, double& dM22, double& dX, double& dY) override {};
void SetTransform(const double& dM11, const double& dM12, const double& dM21, const double& dM22, const double& dX, const double& dY) override {};
void GetTransform(double* pdM11, double* pdM12, double* pdM21, double* pdM22, double* pdX, double* pdY) override {};
};
}

View File

@ -80,10 +80,10 @@ namespace MetaFile
}
void CEmfInterpretatorArray::DrawString(std::wstring &wsText, unsigned int unCharsCount, double dX, double dY, double *pDx,
int iGraphicsMode, double dXScale, double dYScale)
int iGraphicsMode, double dXScale, double dYScale, bool bUseGID)
{
for (CEmfInterpretatorBase* pInterpretator : m_arInterpretators)
pInterpretator->DrawString(wsText, unCharsCount, dX, dY, pDx, iGraphicsMode, dXScale, dYScale);
pInterpretator->DrawString(wsText, unCharsCount, dX, dY, pDx, iGraphicsMode, dXScale, dYScale, bUseGID);
}
void CEmfInterpretatorArray::DrawDriverString(const std::wstring& wsString, const std::vector<TPointD>& arPoints)
@ -182,7 +182,7 @@ namespace MetaFile
pInterpretator->UpdateDC();
}
void CEmfInterpretatorArray::SetTransform(double &dM11, double &dM12, double &dM21, double &dM22, double &dX, double &dY)
void CEmfInterpretatorArray::SetTransform(const double &dM11, const double &dM12, const double &dM21, const double &dM22, const double &dX, const double &dY)
{
for (CEmfInterpretatorBase* pInterpretator : m_arInterpretators)
pInterpretator->SetTransform(dM11, dM12, dM21, dM22, dX, dY);

View File

@ -36,7 +36,7 @@ namespace MetaFile
void DrawBitmap(double dX, double dY, double dW, double dH, BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, unsigned int unBlendMode) override;
void DrawString(std::wstring& wsText, unsigned int unCharsCount, double dX, double dY, double* pDx,
int iGraphicsMode = 1, double dXScale = 1, double dYScale = 1) override;
int iGraphicsMode = 1, double dXScale = 1, double dYScale = 1, bool bUseGID = false) override;
void DrawDriverString(const std::wstring& wsString, const std::vector<TPointD>& arPoints) override;
@ -57,7 +57,7 @@ namespace MetaFile
void EndClipPath(unsigned int unMode) override;
void UpdateDC() override;
void SetTransform(double& dM11, double& dM12, double& dM21, double& dM22, double& dX, double& dY) override;
void SetTransform(const double& dM11, const double& dM12, const double& dM21, const double& dM22, const double& dX, const double& dY) override;
void GetTransform(double* pdM11, double* pdM12, double* pdM21, double* pdM22, double* pdX, double* pdY) override;
void HANDLE_EMR_HEADER(const TEmfHeader& oTEmfHeader) override;

View File

@ -18,8 +18,8 @@ namespace MetaFile
void CEmfInterpretatorRender::ChangeConditional()
{
if (NULL != m_pMetaFileRenderer)
m_pMetaFileRenderer->ChangeConditional();
if (NULL != m_pMetaFileRenderer)
m_pMetaFileRenderer->ChangeConditional();
}
void CEmfInterpretatorRender::Begin()
@ -41,10 +41,10 @@ namespace MetaFile
}
void CEmfInterpretatorRender::DrawString(std::wstring &wsText, unsigned int unCharsCount, double dX, double dY, double *pDx,
int iGraphicsMode, double dXScale, double dYScale)
int iGraphicsMode, double dXScale, double dYScale, bool bUseGID)
{
if (NULL != m_pMetaFileRenderer)
m_pMetaFileRenderer->DrawString(wsText, unCharsCount, dX, dY, pDx, iGraphicsMode, dXScale, dYScale);
m_pMetaFileRenderer->DrawString(wsText, unCharsCount, dX, dY, pDx, iGraphicsMode, dXScale, dYScale, bUseGID);
}
void CEmfInterpretatorRender::DrawDriverString(const std::wstring& wsString, const std::vector<TPointD>& arPoints)
@ -143,7 +143,7 @@ namespace MetaFile
m_pMetaFileRenderer->UpdateDC();
}
void CEmfInterpretatorRender::SetTransform(double &dM11, double &dM12, double &dM21, double &dM22, double &dX, double &dY)
void CEmfInterpretatorRender::SetTransform(const double& dM11, const double& dM12, const double& dM21, const double& dM22, const double& dX, const double& dY)
{
if (NULL != m_pMetaFileRenderer)
m_pMetaFileRenderer->SetTransform(dM11, dM12, dM21, dM22, dX, dY);

View File

@ -22,7 +22,7 @@ namespace MetaFile
void DrawBitmap(double dX, double dY, double dW, double dH, BYTE* pBuffer, unsigned int unWidth, unsigned int unHeight, unsigned int unBlendMode) override;
void DrawString(std::wstring& wsText, unsigned int unCharsCount, double dX, double dY, double* pDx,
int iGraphicsMode = 1, double dXScale = 1, double dYScale = 1) override;
int iGraphicsMode = 1, double dXScale = 1, double dYScale = 1, bool bUseGID = false) override;
void DrawDriverString(const std::wstring& wsString, const std::vector<TPointD>& arPoints) override;
@ -43,7 +43,7 @@ namespace MetaFile
void EndClipPath(unsigned int unMode) override;
void UpdateDC() override;
void SetTransform(double& dM11, double& dM12, double& dM21, double& dM22, double& dX, double& dY) override;
void SetTransform(const double& dM11, const double& dM12, const double& dM21, const double& dM22, const double& dX, const double& dY) override;
void GetTransform(double* pdM11, double* pdM12, double* pdM21, double* pdM22, double* pdX, double* pdY) override;
CMetaFileRenderer* GetRenderer() const;

View File

@ -346,7 +346,7 @@ namespace MetaFile
if (NULL != oTEmfExtTextoutA.oEmrText.pOutputDx)
arDx = std::vector<double>(oTEmfExtTextoutA.oEmrText.pOutputDx, oTEmfExtTextoutA.oEmrText.pOutputDx + oTEmfExtTextoutA.oEmrText.unChars);
WriteText(wsText, TPointD(oTEmfExtTextoutA.oEmrText.oReference.X, oTEmfExtTextoutA.oEmrText.oReference.Y), oTEmfExtTextoutA.oBounds, TPointD(oTEmfExtTextoutA.dExScale, oTEmfExtTextoutA.dEyScale), arDx);
WriteText(wsText, TPointD(oTEmfExtTextoutA.oEmrText.oReference.X, oTEmfExtTextoutA.oEmrText.oReference.Y), oTEmfExtTextoutA.oBounds, TPointD(oTEmfExtTextoutA.dExScale, oTEmfExtTextoutA.dEyScale), arDx, oTEmfExtTextoutA.oEmrText.unOptions & 0x00000010);
}
void CEmfInterpretatorSvg::HANDLE_EMR_EXTTEXTOUTW(const TEmfExtTextoutW &oTEmfExtTextoutW)
@ -358,7 +358,7 @@ namespace MetaFile
if (NULL != oTEmfExtTextoutW.oEmrText.pOutputDx)
arDx = std::vector<double>(oTEmfExtTextoutW.oEmrText.pOutputDx, oTEmfExtTextoutW.oEmrText.pOutputDx + oTEmfExtTextoutW.oEmrText.unChars);
WriteText(wsText, TPointD(oTEmfExtTextoutW.oEmrText.oReference.X, oTEmfExtTextoutW.oEmrText.oReference.Y), oTEmfExtTextoutW.oBounds, TPointD(oTEmfExtTextoutW.dExScale, oTEmfExtTextoutW.dEyScale), arDx);
WriteText(wsText, TPointD(oTEmfExtTextoutW.oEmrText.oReference.X, oTEmfExtTextoutW.oEmrText.oReference.Y), oTEmfExtTextoutW.oBounds, TPointD(oTEmfExtTextoutW.dExScale, oTEmfExtTextoutW.dEyScale), arDx, oTEmfExtTextoutW.oEmrText.unOptions & 0x00000010);
}
void CEmfInterpretatorSvg::HANDLE_EMR_LINETO(const TPointL &oPoint)

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