Compare commits

...

656 Commits

Author SHA1 Message Date
42aa73520b Fix debug build 2026-05-23 18:57:58 +03:00
ad6094b18c Merge branch 'develop' into feature/libxml2 2026-05-19 18:47:54 +03:00
c0cad5429e Addons for previous commit 2026-05-19 17:54:52 +03:00
e353ff1b96 Fix EncodeXmlString method 2026-05-19 17:48:55 +03:00
5f6075ca33 Merge branch 'release/v9.4.0' into develop 2026-05-19 16:46:09 +03:00
55e5f973b0 Fix UTF-8 BOM position 2026-05-19 09:37:04 +03:00
78ed5b3d74 . 2026-05-18 17:59:14 +03:00
ba0e0f7449 Merge branch 'develop' of https://git.onlyoffice.com/ONLYOFFICE/core into develop 2026-05-18 16:31:05 +03:00
ba992cc401 . 2026-05-18 16:30:25 +03:00
fba14fcf7b Merge pull request 'fix bug #74293' (#763) from fix/bug74293 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/763
2026-05-18 12:25:26 +00:00
a2c24b8dc0 Merge pull request 'Fix bug 77975' (#764) from fix/forbug77975 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/764
2026-05-18 07:13:43 +00:00
073f100fe0 Fix prev 2026-05-18 10:11:07 +03:00
e30a6acc87 Fix bug 77975 2026-05-17 23:00:22 +03:00
a016fc2868 Fix crash with downloads with file:// scheme 2026-05-17 18:03:58 +03:00
b77b3dc7e2 Remove unused files 2026-05-17 15:35:33 +03:00
c0a9c1a1dc Revert "Refactoring"
This reverts commit a982ff0ce2.
2026-05-16 09:08:57 +03:00
a982ff0ce2 Refactoring 2026-05-15 17:37:26 +03:00
a1fe8752fa Update wasm build 2026-05-15 17:13:34 +03:00
30f21fc3c7 Fix prev commit 2026-05-15 17:11:44 +03:00
b2c2a0ec6c Fix build wasm 2026-05-15 14:50:00 +03:00
77ef943473 Refactoring PdfFile 2026-05-15 13:53:02 +03:00
67ae9115c9 Fix compile on windows with far/near defines 2026-05-14 16:02:23 +03:00
be921d6be7 fix bug #81371 2026-05-14 12:28:56 +03:00
67733c1733 fix bug #74293 2026-05-14 11:30:40 +03:00
76ee07f61c [copyright] Update copyright header
Co-authored-by: Alexander Trofimov <alexander.trofimov@onlyoffice.com>
Co-committed-by: Alexander Trofimov <alexander.trofimov@onlyoffice.com>
2026-05-14 08:23:56 +00:00
ff32068a97 Merge pull request 'Fix bug 80333' (#761) from fix/bug-80333 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/761
2026-05-14 07:45:04 +00:00
a1ce3b53c2 Fix bug 80333 2026-05-14 10:19:45 +03:00
df08ed4614 Update LICENSE with restructured AGPLv3 additional terms 2026-05-13 22:00:21 +03:00
bd92a3550f libxml2 has been moved to 3dParty 2026-05-13 16:01:47 +03:00
812c59beaa Fix bug 81426 2026-05-13 14:31:41 +03:00
bee1e30e12 Revert prev commit 2026-05-12 23:07:49 +03:00
2da2866862 Refactoring 2026-05-12 21:39:13 +03:00
075052dd3f Merge pull request 'Fix bug 81448' (#760) from fix/big-81448 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/760
2026-05-12 10:29:29 +00:00
4207d697fa Fix bug 81448 2026-05-12 13:26:39 +03:00
c5b798b8a9 Merge pull request 'Update OFD file interface' (#759) from fix/OFD into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/759
2026-05-08 13:01:58 +00:00
8a4e115384 Merge pull request 'fix bug #75103' (#758) from fix/bug75103 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/758
2026-05-08 12:52:14 +00:00
f4b2184985 fix bug #75103
(cherry picked from commit 1c9ce65ba9)
2026-05-08 15:49:45 +03:00
6a6c85b6bd Added getting the links in OFD file 2026-05-07 16:59:38 +03:00
0e40482b9f . 2026-05-07 11:06:24 +03:00
742dfb54b8 fix bug #66296 2026-05-07 10:51:27 +03:00
52b21fbaed Added getting the structure in OFD file 2026-05-07 01:56:10 +03:00
aef42511ad . 2026-05-06 16:47:43 +03:00
692eb8c878 . 2026-05-06 16:39:19 +03:00
7f16ac66f0 Merge remote-tracking branch 'origin/fix/bug81411' into develop 2026-05-06 13:12:56 +03:00
a94d46ee06 fix bug #81411 2026-05-06 13:12:17 +03:00
2dd929dc95 Merge pull request 'fix/FillingSM' (#673) from fix/FillingSM into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/673
2026-05-05 15:30:46 +00:00
1cfce0fe84 Merge pull request 'fix bug #81408' (#757) from fix/bug81408 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/757
2026-05-05 15:26:55 +00:00
1fc363c189 fix bug #81408 2026-05-05 21:16:16 +06:00
3a0c438b9c Merge branch 'fix/fix-build-html2' into develop 2026-05-04 19:25:39 +03:00
25b30b3a73 Fix bug 81335 2026-05-04 13:23:09 +03:00
8c2c4060a7 Fix bug 81273 2026-05-04 11:40:24 +03:00
f2bf914e72 Fix build 2026-05-03 16:55:48 +03:00
62a25fa847 Refactoring HTML tags 2026-05-03 04:18:39 +03:00
f5a0278d4b Move files to data repo 2026-04-30 19:59:28 +03:00
7ac9645010 Merge remote-tracking branch 'origin/fix/fix-bugs' into develop 2026-04-30 15:08:09 +03:00
4250382f87 fix bug #81350 2026-04-30 15:04:12 +03:00
4eca22efde . 2026-04-30 14:45:11 +03:00
9db2d2f328 for bug #53378 2026-04-30 13:01:23 +03:00
a868451b5d . 2026-04-30 10:48:14 +03:00
cb217be2a2 . 2026-04-30 10:38:36 +03:00
6ccf19e036 Merge remote-tracking branch 'origin/release/v9.4.0' into develop 2026-04-30 10:07:24 +03:00
2582927c72 Merge remote-tracking branch 'origin/feature/add-xls-writing' into develop 2026-04-30 10:04:54 +03:00
764a8e4cd9 Fix bug 81335 2026-04-29 18:10:44 +03:00
3fe3382c1e Merge remote-tracking branch 'origin/feature/odf-drawingfile' into develop 2026-04-29 17:10:04 +03:00
b139dec538 Fix bug 2026-04-29 16:22:47 +03:00
0b12c5b521 Added some fields to GetInfo in OFD 2026-04-29 14:40:37 +03:00
4c0c47a3cf Added font selection by glyph in ofd in the WASM module 2026-04-29 14:39:58 +03:00
234f867837 Fix LoadFont 2026-04-29 11:57:06 +03:00
6366306f9c Add gradient fill conversion 2026-04-29 13:26:46 +06:00
75f97349ca Fix build 2026-04-28 23:46:45 +03:00
9ef4de7010 Fix build 2026-04-28 22:54:51 +03:00
6a45740f98 Fix mac|ios build 2026-04-28 18:53:14 +03:00
dfe6d300d8 Fixes with rand 2026-04-28 18:17:32 +03:00
cce7058d46 Merge branch 'release/v9.4.0' of https://git.onlyoffice.com/ONLYOFFICE/core into release/v9.4.0 2026-04-28 18:12:13 +03:00
71a8a22d2e Add security rand function 2026-04-28 18:11:51 +03:00
5bf72dcfb6 Added retrieval of information about the OFD file 2026-04-28 17:29:59 +03:00
7c7ebd5f2a Merge pull request 'Fix Embedded font use in pushbutton' (#756) from fix/pdf-pushbutton into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/756
2026-04-28 11:52:06 +00:00
7890f5b87f Fix Embedded font use in pushbutton 2026-04-28 14:49:38 +03:00
f6decd4754 add border clr ext conversion 2026-04-28 17:23:21 +06:00
f4a0f3f01a add font clr ext conversion 2026-04-28 15:28:17 +06:00
69a066fac9 Merge pull request 'Fix bug 80336' (#755) from fix/bug-80336 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/755
2026-04-28 09:27:58 +00:00
1a94960abf Fix bug 80336 2026-04-28 12:20:59 +03:00
50816132e9 Fix rgb ext color conversion 2026-04-28 14:38:28 +06:00
00bee83d0e Merge pull request 'fix bug #81283' (#754) from fix/bug81283 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/754
2026-04-27 17:01:14 +00:00
37d83faffd fix bug #81283 2026-04-27 19:46:31 +03:00
8e596451a9 Work with fonts in OFD for the WASM module has been updated 2026-04-27 19:38:31 +03:00
8364bc02a6 Fix xlx version in bof 2026-04-27 22:11:24 +06:00
5b15d9b77b Fix bug 81149 2026-04-27 18:12:54 +03:00
c5a040c807 For bug 81147 2026-04-27 16:52:52 +03:00
bb9e3a2a7e Add readme 2026-04-27 16:45:46 +03:00
e2c560d5ad For bug 81146 2026-04-27 16:37:38 +03:00
815b6623a3 Merge pull request 'fix bug #81244' (#753) from fix/bug81244 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/753
2026-04-27 08:58:08 +00:00
051f1d2c94 Merge pull request 'fix bug #80899' (#737) from fix/bug80899 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/737
2026-04-27 08:57:59 +00:00
c2000257aa fix bug #81244 2026-04-27 14:50:04 +06:00
c5b2f3d1f2 fix flipH 2026-04-27 07:01:09 +03:00
72f7aaa6c2 Improved font handling in OFD in the WASM module 2026-04-24 19:22:00 +03:00
2ed3521355 Merge pull request 'fix bugs' (#752) from fix/fix-bugs into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/752
2026-04-24 15:51:37 +00:00
1c1947459d fix bug #81251 2026-04-24 18:50:20 +03:00
29b2b2e086 Merge pull request 'Fix bug 81148' (#751) from fix/bug-81148 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/751
2026-04-24 14:45:31 +00:00
2761614b8d Fix bug 81148 2026-04-24 17:42:29 +03:00
2deb6b8c42 fix bug #81241 2026-04-24 16:48:47 +03:00
13b19cc13f Fix build 2026-04-24 15:56:49 +03:00
9720bd18a4 TODO 2026-04-24 13:37:50 +03:00
a46e0d0a67 Test ofd 2026-04-24 13:31:35 +03:00
59e4d02f01 Merge pull request 'fix bug #81216' (#750) from fix/bug81216 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/750
2026-04-24 08:18:34 +00:00
99b31a46f7 fix bug #81216 2026-04-24 11:10:57 +03:00
5a0bc5a19d Merge pull request 'fix bugs' (#749) from fix/fix-bugs into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/749
2026-04-23 09:02:45 +00:00
38bbe37f40 fix bug #81042 2026-04-23 11:50:35 +03:00
eb4c5cfc2a fix bug #81038 2026-04-23 11:26:25 +03:00
6262048e75 fix bug #81038 2026-04-23 11:13:49 +03:00
7877f542b3 fix bug #81037 2026-04-23 10:56:59 +03:00
f00581fd1d fix bug #81039 2026-04-23 10:52:25 +03:00
bd3dd15a4f fix bug #81040 2026-04-23 10:41:30 +03:00
a796e92fe1 fix bug #81215 2026-04-23 10:32:30 +03:00
9ddd969b01 fix size shape 2026-04-22 22:32:36 +03:00
828eee5ed5 Added memory reading for ofd 2026-04-22 20:44:45 +03:00
a95d8712d3 Create IOfficeDrawingFilePainter 2026-04-22 13:51:34 +03:00
3f76fca0f7 Merge pull request 'Fix html conversion' (#746) from fix/markdown into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/746
2026-04-22 07:07:01 +00:00
1c9ce65ba9 fix bug #75103 2026-04-22 09:12:47 +03:00
09b1d56a9a Merge remote-tracking branch 'origin/release/v9.4.0' into develop 2026-04-22 08:50:01 +03:00
3d7381dc68 Merge pull request 'Fix bug 81092' (#748) from fix/bug-81092 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/748
2026-04-21 13:46:39 +00:00
e33e3d6b42 Fix bug 81092 2026-04-21 16:13:34 +03:00
c03fd25b6d Fix build 2026-04-21 16:06:19 +03:00
bc59e34153 Fix OFD detected 2026-04-21 14:28:07 +03:00
9679c6e7f8 OFD detected 2026-04-21 14:18:32 +03:00
2ffc0a7844 drawingfile build OFDFile 2026-04-21 13:29:18 +03:00
c7c98d3f69 Merge pull request 'fix bug #81148' (#747) from fix/bug81148- into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/747
2026-04-21 10:00:55 +00:00
d9d7ffef26 fix bug #81148 2026-04-21 12:50:49 +03:00
c7e7fd4aa1 Dependency on boost has been removed 2026-04-21 11:29:45 +03:00
1846056b74 Fix bug 81029 2026-04-20 14:38:20 +03:00
378841d655 Fix bug 80025 2026-04-20 11:47:09 +03:00
facd131d7b fix rotate 2026-04-17 13:43:56 +03:00
f39716a5da fix bug #80887 2026-04-17 13:39:12 +03:00
d1fada2542 Refactoring 2026-04-16 17:21:11 +03:00
16929b3a54 Merge branch 'develop' into fix/markdown 2026-04-16 17:15:01 +03:00
a2f52951b2 Fix build 2026-04-16 16:29:06 +03:00
b0efeafd27 Merge pull request 'Add patch for fix build Xcode 26+ Clang treats enum-constexpr-conversion as hard error' (#742) from fix/boost-integral-wrapper-xcode into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/742
2026-04-16 07:18:21 +00:00
f3d34b1363 . 2026-04-15 22:27:35 +03:00
07e563afe8 fix bug #81054 2026-04-15 22:12:12 +03:00
75b3665ad5 Fix bugs in html to OOXML/Markdown conversion 2026-04-15 21:14:30 +03:00
bdbad87830 Merge remote-tracking branch 'origin/feature/add-xls-writing' into develop 2026-04-15 18:07:31 +03:00
290e4a0884 Fix AP removal for modified annotations on split-merge 2026-04-15 10:50:34 +03:00
0242c5885b Merge pull request 'add horizontal rule' (#736) from fix/doc into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/736
2026-04-14 19:25:15 +00:00
8a3a922dba Merge pull request 'Fix bug 81029' (#744) from fix/bug-81029 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/744
2026-04-14 13:20:10 +00:00
b78bcb10dc Fix bug 81029 2026-04-14 16:16:38 +03:00
1c13c80197 Fix AP removal for modified annotations on split-merge 2026-04-14 11:25:41 +03:00
653ff24c0e Merge pull request 'Fix AP removal for modified annotations' (#743) from fix/pdf-bugs into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/743
2026-04-14 07:52:40 +00:00
a62f97627b Fix AP removal for modified annotations 2026-04-14 10:50:07 +03:00
ddd991601c Fix bug 57854 2026-04-13 12:23:34 +03:00
57c26eb998 Add default theme writing 2026-04-10 19:37:16 +06:00
2c35b5f422 Fix bugs in html conversion 2026-04-09 16:46:37 +03:00
ab76f46fd4 add extProps conversion 2026-04-09 16:41:28 +06:00
2dd2f3bcc6 fix xfext frt 2026-04-09 16:19:29 +06:00
612c26cf6c Add patch for fix build Xcode 26+ Clang treats enum-constexpr-conversion as hard error 2026-04-09 11:07:45 +03:00
2873418d74 Merge pull request 'Fix bug 80951' (#741) from fix/bug-80951 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/741
2026-04-08 12:52:43 +00:00
77346270a4 Fix bug 80951 2026-04-08 15:07:22 +03:00
5f005b4501 for bug #53378 2026-04-08 13:29:34 +03:00
5f39acbe51 Merge pull request 'For bug 80374' (#740) from fix/forbug80374 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/740
2026-04-08 08:34:04 +00:00
6badba384c For bug 80374 2026-04-08 11:27:44 +03:00
0830ed031e Merge branch 'develop' into feature/add-xls-writing 2026-04-08 13:16:56 +06:00
e63d62bb04 Merge pull request 'fix conversion to xls' (#739) from fix/xls-conversion into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/739
2026-04-08 07:13:31 +00:00
90029fb2f3 fix conversion to xls 2026-04-08 13:04:57 +06:00
c96df4e62e Fix bugs in fromUnicode method 2026-04-07 22:11:37 +03:00
d4e1b31e10 Merge branch 'release/v9.4.0' into develop 2026-04-07 15:11:10 +03:00
1580494bdb fix bug #80899 2026-04-07 16:30:32 +06:00
f4fc487ce3 Fix bugs and refactoring in html cenversion 2026-04-06 21:47:03 +03:00
a5bfa94770 Fix bugs in HTML to OOXML conversion 2026-04-06 19:41:29 +03:00
85a615cc9a add xfs Crc writing 2026-04-06 21:33:04 +06:00
91701ed58d add horizontal rule 2026-04-06 13:49:45 +03:00
be200af7d9 Merge remote-tracking branch 'origin/fix/comments-i18n' into release/v9.4.0 2026-04-06 12:05:13 +03:00
279349323f Merge remote-tracking branch 'origin/fix/bug-65751' into develop 2026-04-06 10:52:40 +03:00
1dae175272 Fix bug 65751 2026-04-06 10:51:27 +03:00
7c6f9f2ad6 edit the flipV 2026-04-04 09:29:15 +03:00
efc9bab6ed for bug #53378 2026-04-04 09:26:06 +03:00
73b32984e2 fix ptgList toArea conversion 2026-04-03 21:47:41 +06:00
19758d579d . 2026-04-03 16:55:46 +03:00
f269db67bb Read Type3 font 2026-04-03 16:54:05 +03:00
2fd10fc33f . 2026-04-03 15:57:38 +03:00
685b2bb9e0 Merge pull request 'Fix bug 77975' (#735) from fix/bug77975 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/735
2026-04-03 12:18:02 +00:00
55fe2e968f Fix bug 77975 2026-04-03 14:56:34 +03:00
d90c3aa3ac Add row fields check 2026-04-03 15:44:01 +06:00
47fed9cb63 Fix CssCalculator, EpubTest, HWPFile
Checked:
- Apple
- HtmlFile2
- DesktopEditor\raster\Metafile
- EpubFile
- Fb2File
- HWPFile
- OFDFile
2026-04-02 23:21:57 +03:00
e3e247e835 fix date fields in pivot cache 2026-04-02 21:50:37 +06:00
bd245cd62a Fix drawingfile, htmltoxhtml, Fb2File, HtmlFile2, PdfFile
Also checked:
Common/3dParty/html/htmltoxhtml.cpp
DesktopEditor/doctrenderer/drawingfile.h
DjVuFile
EpubFile
Fb2File
HtmlFile2/htmlfile2.cpp
PdfFile
XpsFile
2026-04-02 13:43:56 +03:00
87c3f9beff fix pivot row items conversion 2026-04-02 16:34:07 +06:00
9b196ada1f Fix bug 68657 2026-04-02 10:04:28 +03:00
10b2b0d3d0 standardize comments in English 2026-04-02 08:10:57 +03:00
cd58508d0f Fix pivot cache conversion 2026-04-01 21:00:31 +06:00
d41aef7ec6 Fix bug 68459 2026-04-01 11:20:35 +03:00
cda332109e Update 3rdParty licences info 2026-03-31 18:42:03 +03:00
bdc22190bd fix pivot cache ref conversion 2026-03-31 18:14:27 +06:00
9989510d60 add shared item index conversion 2026-03-31 16:59:21 +06:00
2f1a76fba6 Improved work with images in the html converter 2026-03-30 20:41:14 +03:00
0693bdc115 add pivot items conversion 2026-03-30 18:38:20 +06:00
ffb528636f Fix bug 80784 2026-03-30 14:52:50 +03:00
abc4619924 add pivot cache file check 2026-03-30 15:48:05 +06:00
fe36b3e1e6 add inlineStr cell value conversion 2026-03-27 20:47:01 +06:00
e72a4f8e8c add picture file check 2026-03-27 19:50:06 +06:00
0b2babbefc for bug #53378 2026-03-27 12:28:44 +03:00
32da1a4901 Refactoring 2026-03-27 01:53:35 +03:00
d2c6a4821c Merge pull request 'Fix bug 80374' (#733) from fix/bug-80374 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/733
2026-03-26 19:54:01 +00:00
15e3b57c58 Fix bug 80374 2026-03-26 19:23:11 +03:00
15f423dbb9 Merge pull request 'add horizontal rule' (#732) from fix/bugrtf into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/732
2026-03-26 14:19:15 +00:00
5d4e08a86f Merge pull request 'fix hr shade' (#731) from fix/fix-hr into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/731
2026-03-26 13:02:38 +00:00
6b3db7355b fix hr shade 2026-03-26 15:29:15 +03:00
b5c29e49e2 Add emf image conversion 2026-03-26 17:14:09 +06:00
9a4f929510 fix build 2026-03-25 19:02:05 +03:00
206ee9c976 Transparency Group for stamp 2026-03-25 14:41:43 +03:00
7a8669d7f8 Merge remote-tracking branch 'origin/feature/pdf-annots' into develop 2026-03-25 13:42:10 +03:00
ea28ff69a9 Write stamp opacity to AP 2026-03-25 13:28:44 +03:00
88626378a7 Create IgnoreStampOpacity for drawingfile 2026-03-25 12:52:31 +03:00
261cf72685 fix surface chart conversion 2026-03-24 21:23:12 +06:00
219bf06855 add seriesAxis conversion 2026-03-24 18:29:29 +06:00
23e736051f Merge remote-tracking branch 'origin/feature/add-xls-writing' into develop 2026-03-24 15:06:48 +03:00
8870516a8a Fix bug 68012 2026-03-23 16:07:38 +03:00
dbe56878b1 fix drawing conversion 2026-03-23 18:18:23 +06:00
1f9ee8628e Merge branch 'develop' into fix/FillingSM 2026-03-23 11:47:07 +03:00
84aa409b1e Merge branch 'develop' into feature/add-xls-writing 2026-03-23 13:06:49 +06:00
6df60b9b4e Redesigned the principle of working with tables in html 2026-03-23 03:14:08 +03:00
22bbfa3729 Merge pull request 'for bug #79358' (#729) from fix/fix-bugs2 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/729
2026-03-20 19:40:48 +00:00
52096d1b0b add horizontal rule 2026-03-20 21:10:37 +03:00
b1623b203b for bug #79358 2026-03-20 17:10:08 +03:00
8fa5f8944e Fix bug 56081 2026-03-20 14:56:53 +03:00
27dc6403d7 add several image conversion 2026-03-20 17:50:25 +06:00
ecaef0fbed fix drawing group pict conversion 2026-03-19 20:48:49 +06:00
ca08c74fb4 Merge pull request 'Fix bug 80686' (#728) from fix/bug-80686 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/728
2026-03-19 13:18:17 +00:00
7d161bda01 Fix bug 80686 2026-03-19 16:10:42 +03:00
2addc5a3d8 fix bstoreContainer size 2026-03-19 18:21:34 +06:00
4e1afe5c55 add file blip store entry writin 2026-03-19 16:49:36 +06:00
9ae5855ed0 refactor drawing generation methods 2026-03-18 16:26:40 +06:00
8d4e216852 Link RD read and write 2026-03-18 10:42:20 +03:00
866bf08da3 Merge pull request 'Fix bug 80655' (#727) from fix/bug-80655 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/727
2026-03-17 18:36:25 +00:00
9e1bb2cd22 Fix bug 80655 2026-03-17 21:30:04 +03:00
bb97d00ae7 add imageWriting 2026-03-17 18:51:26 +06:00
66eaed4f18 Merge remote-tracking branch 'origin/feature/pdf-screen' into develop 2026-03-16 15:55:29 +03:00
4739b9f9dd Merge remote-tracking branch 'origin/develop' into feature/pdf-screen 2026-03-16 15:54:10 +03:00
57c99df412 Merge pull request 'Fix bug 80646' (#724) from fix/bug-80646 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/724
2026-03-16 12:49:48 +00:00
e8f1691348 Write FileAttachment annot 2026-03-16 15:48:12 +03:00
0b42267c43 Merge pull request 'fix bug #68331' (#726) from fix/bug68331 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/726
2026-03-16 12:20:22 +00:00
6f1bfc3064 Merge pull request 'fix/bug79255' (#725) from fix/bug79255 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/725
2026-03-16 12:19:35 +00:00
f57f573ac4 fix bug #79471 2026-03-16 14:20:41 +03:00
df86855ccf Fix bug 80646 2026-03-16 14:14:53 +03:00
0579b93796 fix bug #79255 2026-03-16 14:10:11 +03:00
2074785963 add cell anchor writing for pics 2026-03-13 21:55:00 +06:00
ed697edba2 add pic conversion method 2026-03-13 20:43:39 +06:00
686c72a1c8 Write Screen annot 2026-03-13 15:21:54 +03:00
41124d3301 pdf write Screen and FileAttachment annots 2026-03-13 13:37:33 +03:00
95d6c6c927 Merge branch 'release/v9.4.0' into feature/add-xls-writing 2026-03-13 14:22:03 +06:00
9ae76b07a1 fix bug #79246 2026-03-13 10:39:01 +03:00
da769a642b Merge branch hotfix/v9.3.1 into release/v9.4.0 2026-03-12 15:19:51 +00:00
0d7e535114 Merge branch hotfix/v9.3.1 into develop 2026-03-12 15:19:49 +00:00
b18715ae81 Merge branch hotfix/v9.3.1 into master 2026-03-12 15:19:46 +00:00
e0af1357e5 Merge pull request 'for bug #80497' (#723) from fix/bmpConversion into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/723
2026-03-12 13:58:54 +00:00
d4f80ea036 for bug #80497 2026-03-12 19:55:56 +06:00
8e90fbac69 pdf read Screen annots 2026-03-12 15:31:41 +03:00
12083ae8c9 Merge pull request 'Fix bugs 75897, 80163' (#722) from fix/pdf-bug into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/722
2026-03-12 12:29:03 +00:00
322fda0e07 fix bug #71064 2026-03-12 15:28:28 +03:00
b0d70ff38a Merge remote-tracking branch 'origin/feature/add-xls-writing' into develop 2026-03-12 14:34:08 +03:00
2a409336a3 fix multiple comment writing 2026-03-12 17:15:03 +06:00
6819a41452 Fix bug 75897 2026-03-12 14:06:57 +03:00
4cdc416e0b fix bug #79301 2026-03-12 12:34:51 +03:00
5d5732161a Fix bug 80163 2026-03-12 11:11:32 +03:00
7046f1d465 Merge pull request 'fix/bug73640' (#721) from fix/bug73640 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/721
2026-03-11 15:17:16 +00:00
61f25af847 fix/bug73640
fix bug #73640
2026-03-11 18:13:45 +03:00
9304d10674 Merge remote-tracking branch 'origin/release/v9.4.0' into develop 2026-03-11 18:12:11 +03:00
21dd6c2a61 Merge pull request 'fix prev hr' (#720) from fix/fix-bugs into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/720
2026-03-11 15:11:31 +00:00
278dffc7c7 fix bug #80491 2026-03-11 18:11:16 +03:00
b607aeb4c6 fix prev hr 2026-03-11 18:08:12 +03:00
bd7aa2df96 Add multiple comment writing 2026-03-11 19:17:02 +06:00
3d4dc3116e fix comment conversion 2026-03-11 18:14:51 +06:00
f2fdcf4efd Merge branch 'develop' into fix/bug73640 2026-03-11 11:51:07 +03:00
ae7dbf291f Merge remote-tracking branch 'origin/release/v9.4.0' into develop 2026-03-10 19:49:07 +03:00
e83dbf57af Fixed a bug with unnecessary transfer of images to markdown 2026-03-10 18:52:19 +03:00
3aa729d65b Fixed a bug with formatted spaces in markdown 2026-03-10 18:51:44 +03:00
cb0176ecca add comment writing 2026-03-10 21:00:46 +06:00
e1b3fe270a Merge pull request 'fix/fix-bugs' (#719) from fix/fix-bugs into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/719
2026-03-10 12:33:19 +00:00
615cf0982d fix hr in odf 2026-03-10 10:52:20 +03:00
b75afead99 Merge pull request 'fix/bug59695' (#717) from fix/bug45616 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/717
2026-03-10 07:12:08 +00:00
290a134cdb Reapply "fix/bug59695"
This reverts commit 6d9a2e0d09.
2026-03-10 10:06:11 +03:00
6d9a2e0d09 Revert "fix/bug59695"
This reverts commit 32c4964cca.
2026-03-10 10:05:45 +03:00
32c4964cca fix/bug59695
fix bug #59695
2026-03-10 10:01:08 +03:00
a027644bf0 fix hr 2026-03-09 21:51:31 +03: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
c2dd7b5108 fix bug #68331 2026-03-09 19:06:21 +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
11000aa465 Merge pull request 'fix/bug79974' (#715) from fix/bug79974 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/715
2026-03-05 19:59:28 +00:00
eada4b4ebe Merge pull request 'fix/bug79818' (#714) from fix/bug79818 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/714
2026-03-05 14:51:33 +00:00
6630a882ed Merge remote-tracking branch 'origin/release/v9.4.0' into develop 2026-03-05 17:23:02 +03:00
e20143fa2e for bug #66794 2026-03-05 17:17:18 +03:00
57ca5da2c0 fix/bug79818
fix bug #79818
2026-03-05 13:36:32 +03:00
08bad0753a Merge pull request 'Fix bug 80374' (#713) from fix/bug80374 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/713
2026-03-05 10:11:56 +00:00
6224b6384d Fix prev 2026-03-05 12:59:26 +03:00
be1aed4cae Fix bug 80374 2026-03-05 12:27:40 +03:00
e40603df61 add chart file check 2026-03-05 15:22:33 +06:00
6d0db29975 Merge remote-tracking branch 'origin/develop' into fix/bug80407 2026-03-05 11:26:26 +03:00
3fe2ed032d Merge branch hotfix/v9.3.1 into master 2026-03-05 07:46:21 +00:00
a43af51577 . 2026-03-04 20:16:08 +03:00
cf0f2be204 fix axis conversion 2026-03-04 20:09:47 +06:00
44e3e77631 refactoring 2026-03-04 16:59:25 +03:00
e4df8df318 fix drawing conversion 2026-03-04 15:18:34 +06:00
3676400e66 Merge branch release/v9.3.0 into release/v9.4.0 2026-03-04 09:17:05 +00:00
573b85932f Merge branch release/v9.3.0 into hotfix/v9.3.1 2026-03-04 09:17:03 +00:00
eca98f612c Merge branch release/v9.3.0 into develop 2026-03-04 09:17:01 +00:00
c5f1a08422 Merge branch release/v9.3.0 into master 2026-03-04 09:16:59 +00:00
3b0c9cea7e Merge pull request 'Fix swap rgba for djvu' (#711) from fix/bug-75351 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/711
2026-03-03 13:34:27 +00:00
3dc0f482c8 Fix swap rgba for djvu 2026-03-03 16:21:20 +03:00
7043b36093 Merge branch hotfix/v9.3.1 into master 2026-03-03 11:57:42 +00:00
e429ff685f Merge branch 'release/v9.4.0' into feature/add-xls-writing 2026-03-03 17:14:06 +06:00
03334267c9 fix table conversion 2026-03-03 16:54:16 +06:00
417c3a55ec Merge branch 'hotfix/v9.3.1' into develop 2026-03-03 11:07:46 +03:00
90eb06ac20 fix/bug73635
fix bug #73635

(cherry picked from commit 84b2849f53730af5f544c8245800da4478e95463)
2026-03-02 20:58:39 +03:00
031c1c91e6 fix bug #80407 2026-03-02 18:31:45 +03:00
d17c22772f Merge pull request 'Fix bug 80395' (#708) from fix/bug-80395 into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/708
2026-03-02 14:21:35 +00:00
2a09f9da90 Fix bug 80395 2026-03-02 17:05:50 +03:00
8a8e17562b fix defined names conversion 2026-03-02 19:17:40 +06: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
9f36c04d33 fix title pos 2026-03-02 15:56:10 +06:00
8a1a45f403 fix prev 2026-03-02 10:04:34 +03:00
7dffc8245a Merge remote-tracking branch 'origin/hotfix/v9.3.1' into develop 2026-02-28 11:07:16 +03:00
869774bcc1 fix/bug79974
fix bug #79974
2026-02-27 18:59:52 +03:00
27103958fe add default theme clrs to chart 2026-02-27 20:44:47 +06: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
95c9c95a2e fix chartsheet conversion 2026-02-27 17:43:23 +06:00
1753007900 Merge pull request 'Fix bug 80293' (#704) from fix/bug80293 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/704
2026-02-27 08:55:33 +00:00
f43230dcaf Fix bug 80293 2026-02-27 11:45:55 +03:00
df576b6e99 Merge pull request 'fix/fix-bugs' (#703) from fix/fix-bugs into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/703
2026-02-26 15:23:19 +00:00
bb7d2ce8ee Merge pull request 'fix/bug79307' (#702) from fix/bug79307 into develop
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/702
2026-02-26 14:57:59 +00:00
ed8a47cbb7 fix/bug79307
fix bug #79307
2026-02-26 17:27:18 +03:00
3c707ebbf4 Fix bug 78204 2026-02-26 15:44:32 +03:00
3b2721e2da fix/bug79307
fix bug #79307
2026-02-26 15:15:23 +03:00
b430c3f296 fix bug #78514 2026-02-26 14:26:41 +03:00
c21827825b fix bug #79266 2026-02-26 13:22:58 +03:00
19c66750a8 fix/bug79307
fix bug #79307
2026-02-25 23:09:05 +03:00
0424c73db0 Merge pull request 'fix/fix-bugs' (#700) from fix/fix-bugs into release/v9.4.0
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/700
2026-02-25 16:54:14 +00:00
dc6a72892c Merge branch 'release/v9.4.0' into fix/fix-bugs 2026-02-25 19:47:12 +03:00
4b61f6e62a Merge branch 'release/v9.4.0' into feature/add-xls-writing 2026-02-25 22:36:59 +06:00
927f49291a Merge branch release/v9.3.0 into develop 2026-02-25 15:14:16 +00:00
72b57be353 fix numFmt conversion 2026-02-25 18:01:46 +06:00
ef295fc115 fix aboveAverage condFmt conversion 2026-02-25 16:36:39 +06:00
a62528e90e fix category axis conversion 2026-02-24 20:59:14 +06: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
cf72c836a1 fix bug #79708 2026-02-24 12:33:36 +03:00
b9a905f6b2 fix bug #80221 2026-02-24 11:37:37 +03:00
644ec4e651 fix separate chart conversion 2026-02-24 14:05:03 +06: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
6ca34d9c69 fix several charts conversion 2026-02-20 19:20:59 +06: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
473f6aef1e add several chart conversion 2026-02-19 16:58:22 +06: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
85027065e6 Add drawing group conversion 2026-02-17 15:01:53 +06: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
f66c646c2c add drawingGroup writing 2026-02-16 19:00:09 +06: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
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
68f2f0760d fix surface conversion 2026-01-27 18:35:55 +06: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
a9dc790f92 Migrated most of the html conversion to the new architecture 2026-01-26 19:03:34 +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
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
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
e820a9c936 fix chart conversion 2026-01-21 19:08:27 +06: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
79f8e14d07 The division of the html converter into components has begun 2026-01-20 20:22:40 +03:00
83745da5f3 add attached label conversion 2026-01-20 21:47:55 +06:00
b64b31a972 Merge remote-tracking branch 'origin/release/v9.3.0' into develop 2026-01-20 11:35:55 +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
31f274fbc4 add barChart crt conversion 2026-01-16 21:37:14 +06:00
6e696daa15 add dv axis conversion 2026-01-16 20:15:31 +06:00
c4708222c6 Merge branch 'develop' into feature/add-xls-writing 2026-01-16 19:02:08 +06:00
ead20d7bfe Merge commit '2ff12c06a428232d1742d5f76970e8e87d83dc4f' into develop 2026-01-14 15:39:56 +03:00
116ec89cd2 add ivaxis conversion 2026-01-13 19:20:37 +06:00
8133e3f7b7 add axisParent conversion 2025-12-30 16:07:33 +06:00
3081d02c9c Add ser2crt conversion 2025-12-29 19:24:13 +06:00
91afd3d340 Merge branch 'develop' into feature/add-xls-writing 2025-12-29 15:28:05 +06:00
b616ce6fd7 Merge branch 'release/v9.3.0' into develop 2025-12-28 14:35:30 +03: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
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
5d6caf8a93 Add BRAI records conversion 2025-12-25 18:10:16 +06: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
527cc5f89f Merge branch 'release/v9.3.0' into develop 2025-12-25 11:53:08 +03:00
50ae7db2f0 add area format conversion 2025-12-24 17:38:27 +06:00
dd17cb7243 add frame conversion 2025-12-23 19:16:45 +06:00
b3988b002f add chartformats conversion 2025-12-22 18:51:32 +06:00
bb3091b6f1 Merge branch 'develop' into feature/add-xls-writing 2025-12-22 13:26:37 +06:00
dde96288ed for bug #54521 2025-12-19 16:21:52 +06:00
482810712e Merge branch hotfix/v9.2.1 into develop 2025-12-17 15:27:40 +00:00
a22f0bfb60 Merge branch hotfix/v9.2.1 into master 2025-12-17 11:33:19 +00:00
ea338db68a add chart drawing conversion 2025-12-17 14:17:37 +06:00
76f3afc6c0 Merge branch 'develop' into feature/add-xls-writing 2025-12-16 16:16:04 +06:00
9c12c0b30a Merge remote-tracking branch 'origin/release/v9.3.0' into develop 2025-12-11 11:20:42 +03:00
e232fc779d Merge remote-tracking branch 'origin/hotfix/v9.2.1' into develop 2025-12-11 11:19:31 +03:00
981df3fce7 add chart sheet conversion 2025-12-10 20:43:38 +06:00
c3b3a1b5ef Fix SetDV for radiobutton 2025-12-10 15:23:40 +03:00
85d98daedd Merge branch 'develop' into feature/add-xls-writing 2025-12-10 15:43:25 +06:00
dd00be6dce add fontlist writing 2025-12-04 13:53:42 +06:00
a40e246d7d fix bug 2025-10-10 13:52:46 +03:00
66d36b64b0 for bug #68408 2025-10-04 19:52:32 +03:00
954f3c91bb Merge pull request 'release/v9.1.0' (#468) from release/v9.1.0 into fix/FillingSM
Reviewed-on: https://git.onlyoffice.com/ONLYOFFICE/core/pulls/468
2025-10-02 12:39:53 +00:00
18d36179bd add hash annotation 2025-08-12 10:27:21 +03:00
13125 changed files with 228383 additions and 1001389 deletions

1
.gitignore vendored
View File

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

View File

@ -16,3 +16,14 @@
- cryptopp ([BSL](https://raw.githubusercontent.com/weidai11/cryptopp/master/License.txt))
- openssl ([Apache-2.0](https://raw.githubusercontent.com/openssl/openssl/master/LICENSE.txt))
- v8 ([3-clause BSD License](https://raw.githubusercontent.com/v8/v8/main/LICENSE))
- googletest ([3-clause BSD License](https://raw.githubusercontent.com/google/googletest/refs/heads/main/LICENSE))
- glm ([MIT](https://raw.githubusercontent.com/g-truc/glm/refs/heads/master/copying.txt))
- mdds ([MIT](https://raw.githubusercontent.com/kohei-us/mdds/refs/heads/master/LICENSES/MIT.txt))
- librevenge ([MPL-2](https://raw.githubusercontent.com/Distrotech/librevenge/refs/heads/distrotech-librevenge/COPYING.MPL))
- libodfgen ([MPL-2](https://raw.githubusercontent.com/Distrotech/libodfgen/refs/heads/master/COPYING.MPL))
- libetonyek ([MPL-2](https://raw.githubusercontent.com/LibreOffice/libetonyek/refs/heads/master/COPYING))
- md4c ([MIT](https://raw.githubusercontent.com/mity/md4c/refs/heads/master/LICENSE.md))
- libheif([MIT](https://raw.githubusercontent.com/strukturag/libheif/refs/heads/master/COPYING))
- libde265([MIT](https://raw.githubusercontent.com/strukturag/libde265/refs/heads/master/COPYING))
- x265([GPL 2.0](https://bitbucket.org/multicoreware/x265_git/raw/cfee9638c82b655c5887cedbdf1aa856f81b906a/COPYING))
- pole([FREE](https://github.com/otofoto/Pole/blob/master/pole/LICENSE))

View File

@ -1,3 +1,38 @@
/*
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* No trademark rights are granted under this License.
*
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "IWork.h"
#include "../DesktopEditor/common/File.h"
#include "../DesktopEditor/common/Directory.h"
@ -53,7 +88,7 @@ bool GetRVNGInputStream(const DATA_TYPE_INPUTFILE& sFile, std::shared_ptr<librev
IWorkFileType CIWorkFile::GetType(const std::wstring& sFile) const
{
//TODO:: так как на данный момент мы работает только напрямую с файлом, то работа с директорией нам пока не нужна
//TODO:: since currently we work directly with file only, directory handling is not needed yet
if (NSDirectory::PathIsDirectory(sFile))
return IWorkFileType::None;
@ -107,7 +142,7 @@ int Convert(const std::wstring& wsOutputFile, std::shared_ptr<librevenge::RVNGIn
int CIWorkFile::Convert2Odf(const std::wstring& sFile, const std::wstring& sOutputFile) const
{
//TODO:: так как на данный момент мы работает только напрямую с файлом, то работа с директорией нам пока не нужна
//TODO:: since currently we work directly with file only, directory handling is not needed yet
if (NSDirectory::PathIsDirectory(sFile))
return -1;

View File

@ -1,3 +1,38 @@
/*
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* No trademark rights are granted under this License.
*
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef _IWORKFILE_IWORKFILE_H
#define _IWORKFILE_IWORKFILE_H

View File

@ -1,3 +1,36 @@
# Copyright (C) Ascensio System SIA, 2009-2026
#
# This program is a free software product. You can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License (AGPL)
# version 3 as published by the Free Software Foundation, together with the
# additional terms provided in the LICENSE file.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
# details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
#
# You can contact Ascensio System SIA by email at info@onlyoffice.com
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
# LV-1050, Latvia, European Union.
#
# The interactive user interfaces in modified versions of the Program
# are required to display Appropriate Legal Notices in accordance with
# Section 5 of the GNU AGPL version 3.
#
# No trademark rights are granted under this License.
#
# All non-code elements of the Product, including illustrations,
# icon sets, and technical writing content, are licensed under the
# Creative Commons Attribution-ShareAlike 4.0 International License:
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
#
# This license applies only to such non-code elements and does not
# modify or replace the licensing terms applicable to the Program's
# source code, which remains licensed under the GNU Affero General
# Public License v3.
#
# SPDX-License-Identifier: AGPL-3.0-only
QT -= core
QT -= gui

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "../IWork.h"

View File

@ -1,3 +1,36 @@
# Copyright (C) Ascensio System SIA, 2009-2026
#
# This program is a free software product. You can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License (AGPL)
# version 3 as published by the Free Software Foundation, together with the
# additional terms provided in the LICENSE file.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
# details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
#
# You can contact Ascensio System SIA by email at info@onlyoffice.com
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
# LV-1050, Latvia, European Union.
#
# The interactive user interfaces in modified versions of the Program
# are required to display Appropriate Legal Notices in accordance with
# Section 5 of the GNU AGPL version 3.
#
# No trademark rights are granted under this License.
#
# All non-code elements of the Product, including illustrations,
# icon sets, and technical writing content, are licensed under the
# Creative Commons Attribution-ShareAlike 4.0 International License:
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
#
# This license applies only to such non-code elements and does not
# modify or replace the licensing terms applicable to the Program's
# source code, which remains licensed under the GNU Affero General
# Public License v3.
#
# SPDX-License-Identifier: AGPL-3.0-only
CONFIG -= qt
QT -= core gui

View File

@ -0,0 +1,36 @@
<<<<<<<
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
private:
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
public:
typedef AUX_WRAPPER_INST(next_value) next;
typedef AUX_WRAPPER_INST(prior_value) prior;
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
|| (BOOST_WORKAROUND(__HP_aCC, <= 53800) && (BOOST_WORKAROUND(__hpxstd98, != 1)))
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
#else
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
#endif
=======
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) \
|| defined(__clang__)
private:
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
public:
typedef AUX_WRAPPER_INST(next_value) next;
typedef AUX_WRAPPER_INST(prior_value) prior;
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
|| (BOOST_WORKAROUND(__HP_aCC, <= 53800) && (BOOST_WORKAROUND(__hpxstd98, != 1)))
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
#else
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
#endif
>>>>>>>

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,34 @@ 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"}});
m_mDefaultStyleData[L"th"] = new CElement(L"b", {{L"font-weight", L"bold"}});
}
CCssCalculator_Private::CCssCalculator_Private()
: m_nDpi(96), m_nCountNodes(0), m_sEncoding(L"UTF-8")
{
}
CCssCalculator_Private::~CCssCalculator_Private()
{}
@ -503,12 +554,17 @@ 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;
@ -542,7 +598,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);
@ -562,7 +619,7 @@ namespace NSCSS
if (!arSelectors[i].m_wsStyle.empty())
arSelectors[i].m_pCompiledStyle->AddStyle(arSelectors[i].m_wsStyle, i + 1, true);
// Скидываем некоторые внешние стили, которые внутри таблицы переопределяются
// Reset some external styles that are overridden inside the table
if (bInTable && i < arSelectors.size() - 1)
{
arSelectors[i].m_pCompiledStyle->m_oFont.GetLineHeight().Clear();
@ -581,7 +638,7 @@ namespace NSCSS
void CCssCalculator_Private::SetPageData(NSProperties::CPage &oPage, const std::map<std::wstring, std::wstring> &mData, unsigned int unLevel, bool bHardMode)
{
//TODO:: пересмотреть данный метод
//TODO:: review this method
m_oStyleStorage.SetPageData(oPage, mData, unLevel, bHardMode);
}
@ -615,8 +672,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);
@ -644,6 +701,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())
@ -702,6 +789,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)

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

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

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;

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

@ -13,12 +13,12 @@ namespace NSCSS
class CNode
{
public:
std::wstring m_wsName; // Имя тэга
std::wstring m_wsClass; // Класс тэга
std::wstring m_wsId; // Id тэга
std::wstring m_wsStyle; // Стиль тэга
std::map<std::wstring, std::wstring> m_mAttributes; // Остальные аттрибуты тэга
//TODO:: возможно использование std::wstring излишне
std::wstring m_wsName; // Tag name
std::wstring m_wsClass; // Tag class
std::wstring m_wsId; // Tag id
std::wstring m_wsStyle; // Tag style
std::map<std::wstring, std::wstring> m_mAttributes; // Other tag attributes
//TODO:: perhaps using std::wstring is excessive
#ifdef CSS_CALCULATOR_WITH_XHTML
CCompiledStyle *m_pCompiledStyle;
@ -31,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

@ -23,7 +23,7 @@ namespace NSCSS
case NSCSS::Inch:
return dValue / (double)ushDPI;
case NSCSS::Peak:
return dValue * 6. / (double)ushDPI; // 1 дюйм = 6 пик
return dValue * 6. / (double)ushDPI; // 1 inch = 6 peak
case NSCSS::Twips:
return dValue * 1440. / (double)ushDPI;
default:
@ -36,17 +36,17 @@ namespace NSCSS
switch (enUnitMeasure)
{
case NSCSS::Point:
return dValue * 28.3465 ; // 1 см = (2.54 / 72) пункта
return dValue * 28.3465 ; // 1 cm = (2.54 / 72) points
case NSCSS::Pixel:
return dValue * (double)ushDPI / 2.54;
case NSCSS::Millimeter:
return dValue * 10.;
case NSCSS::Inch:
return dValue / 2.54; // 1 дюйм = 2.54 см
return dValue / 2.54; // 1 inch = 2.54 cm
case NSCSS::Peak:
return dValue * 2.36; // 2.36 = 6 / 2.54
case NSCSS::Twips:
return dValue * 567.; // 1 см = (1440 / 2.54) твипов
return dValue * 567.; // 1 cm = (1440 / 2.54) twips
default:
return dValue;
}
@ -57,7 +57,7 @@ namespace NSCSS
switch (enUnitMeasure)
{
case NSCSS::Point:
return dValue * 2.8346; // 1 мм = (25.4 / 72) пункта
return dValue * 2.8346; // 1 mm = (25.4 / 72) points
case NSCSS::Pixel:
return dValue * (double)ushDPI / 25.4;
case NSCSS::Cantimeter:
@ -82,7 +82,7 @@ namespace NSCSS
case NSCSS::Pixel:
return dValue * (double)ushDPI;
case NSCSS::Cantimeter:
return dValue * 2.54; // 1 дюйм = 2.54 см
return dValue * 2.54; // 1 inch = 2.54 cm
case NSCSS::Millimeter:
return dValue * 25.4;
case NSCSS::Peak:
@ -105,9 +105,9 @@ namespace NSCSS
case NSCSS::Millimeter:
return dValue * 0.3528;
case NSCSS::Inch:
return dValue / 72.; // 1 дюйм = 72 пункта
return dValue / 72.; // 1 inch = 72 points
case NSCSS::Peak:
return dValue * 0.0833; // 0.0833 = 6 / 72 (1 пункт = 1/72 дюйма)
return dValue * 0.0833; // 0.0833 = 6 / 72 (1 point = 1/72 inch)
case NSCSS::Twips:
return dValue * 20.; // 20 = 1440 / 72
default:
@ -122,7 +122,7 @@ namespace NSCSS
case NSCSS::Point:
return dValue * 12.; // 12 = 72 / 6
case NSCSS::Pixel:
return dValue * (double)ushDPI / 6.; // 1 дюйм = 6 пика
return dValue * (double)ushDPI / 6.; // 1 inch = 6 peak
case NSCSS::Cantimeter:
return dValue * 0.423; // 0.423 = 2.54 / 6
case NSCSS::Millimeter:
@ -143,7 +143,7 @@ namespace NSCSS
case NSCSS::Point:
return dValue * 0.05; // 0.05 = 72. / 1440.
case NSCSS::Pixel:
return dValue * (double)ushDPI / 1440.; // 1 дюйм = 1440 твипов
return dValue * (double)ushDPI / 1440.; // 1 inch = 1440 twips
case NSCSS::Cantimeter:
return dValue * 0.001764; // 0.001764 = 2.54 / 1440
case NSCSS::Millimeter:

View File

@ -70,7 +70,9 @@ namespace NSCSS
R_Shd,
R_SmallCaps,
R_Kern,
R_Vanish
R_Vanish,
R_Strike,
R_VertAlign
} RunnerProperties;
typedef enum

View File

@ -16,14 +16,14 @@ namespace NS_STATIC_FUNCTIONS
std::string GetContentAsUTF8(const std::wstring& sFileName)
{
std::string sContent;
// читаем файл как есть. utf-8 тут просто название.
// read file as-is. utf-8 here is just a name.
if(!NSFile::CFileBinary::ReadAllTextUtf8A(sFileName, sContent))
return sContent;
std::string sEncoding;
if (true)
{
// определяем кодировку
//determining the encoding
const std::string::size_type& posCharset = sContent.find("@charset");
if (std::string::npos != posCharset)

View File

@ -392,8 +392,8 @@ namespace NSCSS
std::wstring wsNewValue = wsValue;
const bool bImportant{CutImportant(wsNewValue)}; //TODO:: иногда мы знаем, что "!important" точно не встретится
// возможно стоит добавить ещё метод
const bool bImportant{CutImportant(wsNewValue)};
if (m_bImportant && !bImportant)
return false;
@ -600,12 +600,6 @@ namespace NSCSS
return true;
}
void CColor::SetNone()
{
Clear();
m_oValue.reset();
}
char NormalizeNegativeColorValue(INT nValue)
{
@ -647,18 +641,21 @@ namespace NSCSS
}
else if (L"none" == wsNewValue || wsNewValue == L"transparent")
{
SetNone();
Clear();
m_oValue = CColorValue();
bResult = true;
}
else if (L"context-stroke" == wsNewValue)
{
Clear();
m_oValue = CColorValueContextStroke();
bResult = true;
}
else if (L"context-fill" == wsNewValue)
{
Clear();
m_oValue = CColorValueContextFill();
bResult = true;
}
else if (10 <= wsNewValue.length() && wsNewValue.substr(0, 3) == L"rgb")
{
@ -1071,7 +1068,7 @@ namespace NSCSS
}
case TransformRotate:
{
//TODO:: добавить реализацию
//TODO:: add implementation
wsValue = L"rotate(";
break;
}
@ -2550,7 +2547,7 @@ namespace NSCSS
bool CFont::SetValue(const std::wstring &wsValue, unsigned int unLevel, bool bHardMode)
{
//TODO:: скорее всего стоит переделать парсинг строки со шрифтом
//TODO:: probably should redo font string parsing
const std::vector<std::wstring> arValues = NSCSS::NS_STATIC_FUNCTIONS::GetWordsW(wsValue, false, L" ,/");
unsigned short ushPosition = 0;

View File

@ -118,6 +118,11 @@ namespace NSCSS
return *this;
}
bool LessSignificantThen(const CValueBase& oValue) const
{
return oValue.m_unLevel >= m_unLevel && (!m_bImportant || oValue.m_bImportant) && !oValue.Empty();
}
};
template<typename T>
@ -343,7 +348,6 @@ namespace NSCSS
void SetRGB(const TRGB& oRGB);
void SetHEX(const std::wstring& wsValue);
bool SetUrl(const std::wstring& wsValue);
void SetNone();
};
typedef enum
@ -860,7 +864,7 @@ namespace NSCSS
CDigit m_oSize;
CDigit m_oLineHeight;
CString m_oFamily;
//TODO:: возможно стоит перейти в слудующих переменных на enum
//TODO:: perhaps should switch to enum for the following variables
CString m_oStretch;
CString m_oStyle;
CString m_oVariant;

View File

@ -1,6 +1,5 @@
#include "CDocumentStyle.h"
#include <iostream>
#include <unordered_set>
#include <wchar.h>
#include <math.h>
@ -9,7 +8,7 @@
#include <list>
#define DEFAULT_LINEHEIGHT 240
#define LINEHEIGHTSCALE 10 // Значение LineHeight в OOXML должно быть в 10 раз больше чем указано в стиле
#define LINEHEIGHTSCALE 10 // LineHeight value in OOXML must be 10 times larger than specified in style
#define VALUE_TO_INT(value, unit_measure) \
(NSCSS::UnitMeasure::None != value.GetUnitMeasure()) ? \
@ -22,6 +21,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 +61,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 +84,7 @@ namespace NSCSS
std::wstring CDocumentStyle::GetIdAndClear()
{
std::wstring sId = m_sId;
const std::wstring sId = m_sId;
Clear();
return sId;
}
@ -110,10 +109,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 +122,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 +141,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 +189,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 +227,7 @@ namespace NSCSS
if (oStyle.Empty())
{
m_sId = sParentsStyleID;
return;
return true;
}
oElement.AddBasicProperties(BProperties::B_BasedOn, sParentsStyleID);
@ -234,7 +240,7 @@ namespace NSCSS
if (oStyle.Empty())
{
m_sId = sStandPlusParent;
return;
return true;
}
oElement.AddBasicProperties(BProperties::B_BasedOn, sStandPlusParent);
}
@ -258,7 +264,7 @@ namespace NSCSS
if (oStyle.Empty())
{
m_sId = sStandPlusParent;
return;
return true;
}
oElement.AddBasicProperties(BProperties::B_BasedOn, oTempElement.GetStyleId());
}
@ -281,7 +287,7 @@ namespace NSCSS
if (oStyle.Empty())
{
m_sId = sStandartStyleID;
return;
return true;
}
oElement.AddBasicProperties(BProperties::B_BasedOn, sStandartStyleID);
}
@ -289,7 +295,7 @@ namespace NSCSS
if (oStyle.Empty() && oElement.Empty())
{
m_sId = L"normal";
return;
return true;
}
m_sId = oStyle.GetId();
@ -302,15 +308,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")};
@ -390,6 +400,8 @@ namespace NSCSS
SetBorderStyle(oStyle, oXmlElement, PProperties::P_LeftBorder);
}
}
return bResult || !oXmlElement.Empty();
}
void CDocumentStyle::SetBorderStyle(const CCompiledStyle &oStyle, CXmlElement &oXmlElement, const PProperties &enBorderProperty)
@ -441,7 +453,7 @@ namespace NSCSS
int nWidth = static_cast<int>(std::round(oBorder.GetWidth().ToDouble(Point) * 8.));
if (L"double" == wsStyle)
nWidth /= 3; // в ooxml double граница формируется из трёх линий
nWidth /= 3; // in ooxml double border is formed from three lines
if (nWidth <= 3)
nWidth = 2;
@ -473,16 +485,18 @@ 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
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))); // Font value is multiplied by 2
if (oStyle.m_oText.GetDecoration().m_oLine.Underline())
oXmlElement.AddPropertiesInR(RProperties::R_U, (!oStyle.m_oText.GetDecoration().m_oStyle.Empty()) ? oStyle.m_oText.GetDecoration().m_oStyle.ToWString() : L"single");
@ -516,6 +530,18 @@ namespace NSCSS
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)
@ -531,16 +557,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();
@ -593,16 +619,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");
@ -479,6 +478,19 @@ std::wstring CXmlElement::ConvertRStyle(bool bIsLite) const
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

@ -371,10 +371,10 @@ int main(int argc, char *argv[])
}
std::cout << "-----END-----" << std::endl;
// Тесты багов
// Bug tests
/*
// Стандарный katana_parser не считывает @page
// Также, если заккомитить всё, что было до тестов бага, то всё будет крашиться с ошибкой "-1073741819"
// Standard katana_parser doesn't read @page
// Also, if you uncomment everything before bug tests, it will crash with error "-1073741819"
const char* css = "#page{margin:10px; padding:5pt} "
"@page{color:white;}";
@ -382,7 +382,7 @@ int main(int argc, char *argv[])
katana_dump_output(output);
katana_destroy_output(output);
// Из-за того, что стандарный katana_parser не считывает @page, не считывает и CCssCalculator
// Because standard katana_parser doesn't read @page, CCssCalculator doesn't read it either
std::wstring sFilePath = NSFile::GetProcessDirectory() + L"../../../../cssFiles/test.css";
NSCSS::CCssCalculator oCSS;

View File

@ -10,14 +10,14 @@ base_directory = os.getcwd()
if not base.is_dir("gumbo-parser"):
base.cmd("git", ["clone", "https://github.com/google/gumbo-parser.git"])
base.cmd_in_dir("gumbo-parser", "git", ["checkout", "aa91b27b02c0c80c482e24348a457ed7c3c088e0"])
base.cmd_in_dir("gumbo-parser", "git", ["checkout", "aa91b27b02c0c80c482e24348a457ed7c3c088e0", "--quiet"])
# fix gumbo
base.replaceInFile(base_directory + "/gumbo-parser/src/tag.c", "isspace(*c)", "isspace((unsigned char)*c)")
if not base.is_dir("katana-parser"):
base.cmd("git", ["clone", "https://github.com/jasenhuang/katana-parser.git"])
base.cmd_in_dir("katana-parser", "git", ["checkout", "be6df458d4540eee375c513958dcb862a391cdd1"])
base.cmd_in_dir("katana-parser", "git", ["checkout", "be6df458d4540eee375c513958dcb862a391cdd1", "--quiet"])
# fix katana
base.replaceInFileUtf8(base_directory + "/katana-parser/src/tokenizer.c", "static inline bool katana_is_html_space(char c);", "static inline bool2 katana_is_html_space(char c);")

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);
// Main document
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")))
{
// Styles are enclosed in <style> tag
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>");
}
// Images
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;
// Search for 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;
// Loop through 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;
}
// Replaces entities &,<,> in 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; });
}
}
// Replaces entity " in 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);
// Remove 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)
{
// Error message
// 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)
{ // Encoding detection
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()));
}
}
// Remove extra characters before <...
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());
//Remove <a ... />
while (NSStringFinder::RemoveEmptyTag(sFileContent, "a"));
//Remove <title ... />
while (NSStringFinder::RemoveEmptyTag(sFileContent, "title"));
//Remove <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);
// Convert from string utf8 to 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);
// Convert from string utf8 to 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

@ -1,5 +1,2 @@
emsdk/
hunspell/
deploy/
o
hunspell.data

View File

@ -1,49 +0,0 @@
{
"name": "spell",
"res_folder": "./deploy/spell",
"wasm": true,
"asm": true,
"embed_mem_file": true,
"run_before": "before.py",
"run_after": "import sys;sys.path.append(\"../../../../build_tools/scripts\");import base;base.configure_common_apps();base.replaceInFile(\"./deploy/spell/spell.js\", \"__ATPOSTRUN__=[];\", \"__ATPOSTRUN__=[function(){self.onEngineInit();}];\");base.replaceInFile(\"./deploy/spell/spell.js\", \"function getBinaryPromise(){\", \"function getBinaryPromise2(){\");base.replaceInFile(\"./deploy/spell/spell_ie.js\", \"__ATPOSTRUN__=[];\", \"__ATPOSTRUN__=[function(){self.onEngineInit();}];\");base.replaceInFile(\"./deploy/spell/spell_ie.js\", \"function getBinaryPromise(){\", \"function getBinaryPromise2(){\");base.copy_file(\"./wasm/js/code.js\", \"./deploy/spell.js\");base.copy_file(\"./wasm/js/index.html\", \"./deploy/index.html\")",
"base_js_content": "./wasm/js/spell.js",
"compiler_flags": [
"-O3",
"-fno-exceptions",
"-fno-rtti",
"-Wno-unused-command-line-argument",
"-s ALLOW_MEMORY_GROWTH=1",
"-s FILESYSTEM=0",
"-s ENVIRONMENT='web,worker'"
],
"exported_functions": [
"_malloc",
"_free",
"_Spellchecker_Malloc",
"_Spellchecker_Free",
"_Spellchecker_Create",
"_Spellchecker_Destroy",
"_Spellchecker_AddDictionary",
"_Spellchecker_RemoveDicrionary",
"_Spellchecker_Load",
"_Spellchecker_Spell",
"_Spellchecker_Suggest",
"_Spellchecker_RemoveEngine",
"_Spellchecker_TotalAllocatedMemory"
],
"include_path": ["./hunspell/src/hunspell", "./wasm/src"],
"define": ["WIN32", "NDEBUG", "HUNSPELL_STATIC", "BUILDING_LIBHUNSPELL", "HUNSPELL_WASM_MODULE"],
"compile_files_array": [
{
"name": "h",
"folder": "./hunspell/src/hunspell/",
"files": ["affentry.cxx", "affixmgr.cxx", "csutil.cxx", "hashmgr.cxx", "hunspell.cxx", "hunzip.cxx", "phonet.cxx", "replist.cxx", "suggestmgr.cxx"]
},
{
"name": "s",
"folder": "./wasm/src/",
"files": ["filemgr_wrapper_new.cxx", "base.cpp"]
}
]
}

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "../../../../Common/3dParty/hunspell/hunspell/src/hunspell/hunspell.h"

View File

@ -1,125 +0,0 @@
function CSpellchecker(settings)
{
useWasm = false;
var webAsmObj = window["WebAssembly"];
if (typeof webAsmObj === "object")
{
if (typeof webAsmObj["Memory"] === "function")
{
if ((typeof webAsmObj["instantiateStreaming"] === "function") || (typeof webAsmObj["instantiate"] === "function"))
useWasm = true;
}
}
var enginePath = "./spell/";
if (settings && settings.enginePath)
{
enginePath = settings.enginePath;
if (enginePath.substring(enginePath.length - 1) != "/")
enginePath += "/";
}
var dictionariesPath = "./../dictionaries";
if (settings && settings.dictionariesPath)
{
dictionariesPath = settings.dictionariesPath;
if (dictionariesPath.substring(dictionariesPath.length - 1) == "/")
dictionariesPath = dictionariesPath.substr(0, dictionariesPath.length - 1);
}
var isUseSharedWorker = !!window.SharedWorker;
if (isUseSharedWorker && (false === settings.useShared))
isUseSharedWorker = false;
var worker_src = useWasm ? "spell.js" : "spell_ie.js";
worker_src = enginePath + worker_src;
var _worker = this;
var _port = null;
if (isUseSharedWorker)
{
this.worker = new SharedWorker(worker_src, "onlyoffice-spellchecker");
_port = this.worker.port;
}
else
{
this.worker = new Worker(worker_src);
_port = this.worker;
}
this.languages = {
"1068" : "az_Latn_AZ",
"1026" : "bg_BG",
"1027" : "ca_ES",
"2051" : "ca_ES_valencia",
"1029" : "cs_CZ",
"1030" : "da_DK",
"3079" : "de_AT",
"2055" : "de_CH",
"1031" : "de_DE",
"1032" : "el_GR",
"3081" : "en_AU",
"4105" : "en_CA",
"2057" : "en_GB",
"1033" : "en_US",
"7177" : "en_ZA",
"3082" : "es_ES",
"1069" : "eu_ES",
"1036" : "fr_FR",
"1110" : "gl_ES",
"1050" : "hr_HR",
"1038" : "hu_HU",
"1057" : "id_ID",
"1040" : "it_IT",
"1087" : "kk_KZ",
"1042" : "ko_KR",
"1134" : "lb_LU",
"1063" : "lt_LT",
"1062" : "lv_LV",
"1104" : "mn_MN",
"1044" : "nb_NO",
"1043" : "nl_NL",
"2068" : "nn_NO",
"1045" : "pl_PL",
"1046" : "pt_BR",
"2070" : "pt_PT",
"1048" : "ro_RO",
"1049" : "ru_RU",
"1051" : "sk_SK",
"1060" : "sl_SI",
"10266" : "sr_Cyrl_RS",
"9242" : "sr_Latn_RS",
"1053" : "sv_SE",
"1055" : "tr_TR",
"1058" : "uk_UA",
"1066" : "vi_VN",
"2067" : "nl_NL" // nl_BE
};
_port.onmessage = function(message) {
_worker.oncommand && _worker.oncommand(message.data);
};
_port.postMessage({ "type" : "init", "dictionaries_path" : dictionariesPath, "languages" : this.languages });
this.stop = function()
{
this.worker.terminate();
this.worker = null;
};
this.command = function(message)
{
_port && _port.postMessage(message);
};
this.oncommand = function(message) { console.log(message); };
this.checkDictionary = function(lang) {
return (undefined !== this.languages["" + lang]) ? true : false;
};
this.getLanguages = function() {
var ret = [];
for (var lang in this.languages)
ret.push(lang);
return ret;
};
}

View File

@ -1,33 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Demo of spellchecker</title>
<meta name="viewport" content="width=device-width">
<script src="./spell.js"></script>
<script type="text/javascript">
window.spellcheck = new CSpellchecker({
enginePath : "./spell",
dictionariesPath : "./../dictionaries"
});
window.spellcheck.oncommand = function(message) {
console.log(message);
};
window.spellcheck.command({
"type" : "spell",
"usrLang" : [1033, 1033, 1049],
"usrWords" : ["hello", "hellop", "привет"]
});
window.spellcheck.command({
"type" : "suggest",
"usrLang" : [1033],
"usrWords" : ["hellop"]
});
</script>
</head>
<body>
</body>
</html>

View File

@ -1,546 +0,0 @@
var printErr = undefined;
var FS = undefined;
var print = undefined;
var fetch = self.fetch;
var getBinaryPromise = null;
if (self.AscDesktopEditor && document.currentScript && 0 == document.currentScript.src.indexOf("file:///"))
{
fetch = undefined; // fetch not support file:/// scheme
getBinaryPromise = function() {
var wasmPath = "ascdesktop://fonts/" + wasmBinaryFile.substr(8);
return new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('GET', wasmPath, true);
xhr.responseType = 'arraybuffer';
if (xhr.overrideMimeType)
xhr.overrideMimeType('text/plain; charset=x-user-defined');
else
xhr.setRequestHeader('Accept-Charset', 'x-user-defined');
xhr.onload = function () {
if (this.status == 200) {
resolve(new Uint8Array(this.response));
}
};
xhr.send(null);
});
}
}
else
{
getBinaryPromise = function() {
return getBinaryPromise2();
}
}
//polyfill
//module
self.spellchecker = null;
function onMessageEvent(data, port)
{
if (data.type == "init")
{
if (self.spellchecker)
return;
self.spellchecker = new Spellchecker();
self.spellchecker.languagesPath = data.dictionaries_path;
var languages = data.languages;
for (var i in languages)
self.spellchecker.addDefaultLanguage(i, languages[i]);
self.spellchecker.init();
return;
}
if (!self.spellchecker)
return;
self.spellchecker.messages.push(data);
if (port)
self.spellchecker.ports.push(port);
if (1 < self.spellchecker.messages.length)
{
// значит еще грузим что-то
return;
}
self.spellchecker.checkMessage();
}
self.onconnect = function(e)
{
var port = e.ports[0];
port.onmessage = function(e) {
onMessageEvent(e.data, port);
}
};
self.onmessage = function(e)
{
onMessageEvent(e.data);
};
self.engineInit = false;
self.onEngineInit = function()
{
self.engineInit = true;
if (self.spellchecker)
{
self.spellchecker.init();
self.spellchecker.checkMessage();
}
};
function Dictionary()
{
this.dataAff = null;
this.dataDic = null;
this.status = 0;
this.id = 0;
this.language = null;
this.load_file = function(src, params)
{
var xhr = new XMLHttpRequest();
xhr.sender = this;
xhr.params = params;
xhr.open('GET', src, true);
xhr.responseType = 'arraybuffer';
if (xhr.overrideMimeType)
xhr.overrideMimeType('text/plain; charset=x-user-defined');
else
xhr.setRequestHeader('Accept-Charset', 'x-user-defined');
xhr.onload = function()
{
if (xhr.sender.status >= 2)
return;
if (this.response && this.status == 200)
{
var uintData = new Uint8Array(this.response);
switch (this.params)
{
case "aff":
{
this.sender.dataAff = uintData;
break;
}
case "dic":
{
this.sender.dataDic = uintData;
break;
}
default:
break;
}
xhr.sender.status++;
}
if (xhr.sender.status == 2)
{
self.spellchecker.onLoadDictionary(this.sender);
}
};
xhr.onerror = function()
{
xhr.sender.status = 2;
self.spellchecker.onLoadDictionary(this.sender);
};
xhr.send(null);
};
this.load = function()
{
if (!this.language)
{
this.status = 2;
self.spellchecker.onLoadDictionary(this);
return;
}
this.load_file(self.spellchecker.languagesPath + "/" + this.language.aff, "aff");
this.load_file(self.spellchecker.languagesPath + "/" + this.language.dic, "dic");
};
this.freeUnusedData = function()
{
this.dataAff = null;
this.dataDic = null;
};
}
function Spellchecker()
{
this.languagesPath = "";
this.languages = {};
this.readyLanguages = {};
this.messages = [];
this.ports = [];
this.tmpStrings = new ArrayBuffer(1000);
this.engine = 0;
this.maxEngines = 3;
this.maxDictionaries = 5;
this.languageQueue = [];
this.maxDictionariesHandler = function()
{
if (this.languageQueue.length > this.maxDictionaries)
{
var toDelete = this.languageQueue.length - this.maxDictionaries;
for (let i = 0; i < toDelete; i++)
{
var lk = this.languageQueue[0];
this.deleteDictionaty(lk);
delete this.readyLanguages[lk];
this.languageQueue.shift();
}
}
};
this.deleteDictionaty = function(lk)
{
if (!lk)
return;
var affID = lk + ".aff";
var dicID = lk + ".dic"
var engineID = affID + dicID;
var engineIDptr = this.allocString(engineID);
var langAffptr = this.allocString(affID);
var langDicptr = this.allocString(dicID);
Module._Spellchecker_RemoveDicrionary(this.engine, langAffptr);
Module._Spellchecker_RemoveDicrionary(this.engine, langDicptr);
Module._Spellchecker_RemoveEngine(this.engine, engineIDptr);
this.freeString(engineIDptr);
this.freeString(langAffptr);
this.freeString(langDicptr);
};
this.init = function()
{
if (0 == this.engine && self.engineInit)
this.engine = this.createEngine();
};
this.addDefaultLanguage = function(id, path)
{
this.languages["" + id] = {
aff : path + "/" + path + ".aff",
dic : path + "/" + path + ".dic"
};
};
this.onLoadDictionary = function(dictionary)
{
if (!dictionary.dataAff || !dictionary.dataDic)
{
this.checkMessage();
return;
}
var aff_path = this.allocString(dictionary.id + ".aff");
var dic_path = this.allocString(dictionary.id + ".dic");
var pointerAff = Module._Spellchecker_Malloc(dictionary.dataAff.length);
Module.HEAP8.set(dictionary.dataAff, pointerAff);
var pointerDic = Module._Spellchecker_Malloc(dictionary.dataDic.length);
Module.HEAP8.set(dictionary.dataDic, pointerDic);
Module._Spellchecker_AddDictionary(this.engine, aff_path, pointerAff, dictionary.dataAff.length);
Module._Spellchecker_AddDictionary(this.engine, dic_path, pointerDic, dictionary.dataDic.length);
this.freeString(aff_path);
this.freeString(dic_path);
dictionary.freeUnusedData();
this.checkMessage();
};
this.checkMessage = function()
{
if (0 == this.messages.length || !self.engineInit)
return;
var m = this.messages[0];
var isReady = true;
for (var indexLang = 0, lenLangs = m.usrLang.length; indexLang < lenLangs; indexLang++)
{
var lang_key = "" + m.usrLang[indexLang];
var readyLang = this.readyLanguages[lang_key];
if (!readyLang)
{
// начнем грузить
var langToReady = new Dictionary();
langToReady.id = lang_key;
langToReady.language = this.languages[lang_key];
this.readyLanguages[lang_key] = langToReady;
this.languageQueue.push(lang_key); // push lang info into the queue
langToReady.load();
isReady = false;
break;
}
else if (readyLang.status != 2)
{
// ждем
isReady = false;
break;
}
else
{
// все готово.
continue;
}
}
if (!isReady)
{
// ждем
return;
}
switch (m.type)
{
case "spell":
{
this.Spell(m);
break;
}
case "suggest":
{
this.Suggest(m);
break;
}
default:
break;
}
this.maxDictionariesHandler();
this.messages.shift();
};
this.allocString = function(string)
{
var inputLen = string.length;
var testLen = 6 * inputLen + 1;
if (testLen > this.tmpStrings.byteLength)
this.tmpStrings = new ArrayBuffer(testLen);
var code = 0;
var index = 0;
var outputIndex = 0;
var outputDataTmp = new Uint8Array(this.tmpStrings);
var outputData = outputDataTmp;
while (index < inputLen)
{
code = string.charCodeAt(index++);
if (code >= 0xD800 && code <= 0xDFFF && index < inputLen)
{
code = 0x10000 + (((code & 0x3FF) << 10) | (0x03FF & string.charCodeAt(index++)));
}
if (code < 0x80)
{
outputData[outputIndex++] = code;
}
else if (code < 0x0800)
{
outputData[outputIndex++] = 0xC0 | (code >> 6);
outputData[outputIndex++] = 0x80 | (code & 0x3F);
}
else if (code < 0x10000)
{
outputData[outputIndex++] = 0xE0 | (code >> 12);
outputData[outputIndex++] = 0x80 | ((code >> 6) & 0x3F);
outputData[outputIndex++] = 0x80 | (code & 0x3F);
}
else if (code < 0x1FFFFF)
{
outputData[outputIndex++] = 0xF0 | (code >> 18);
outputData[outputIndex++] = 0x80 | ((code >> 12) & 0x3F);
outputData[outputIndex++] = 0x80 | ((code >> 6) & 0x3F);
outputData[outputIndex++] = 0x80 | (code & 0x3F);
}
else if (code < 0x3FFFFFF)
{
outputData[outputIndex++] = 0xF8 | (code >> 24);
outputData[outputIndex++] = 0x80 | ((code >> 18) & 0x3F);
outputData[outputIndex++] = 0x80 | ((code >> 12) & 0x3F);
outputData[outputIndex++] = 0x80 | ((code >> 6) & 0x3F);
outputData[outputIndex++] = 0x80 | (code & 0x3F);
}
else if (code < 0x7FFFFFFF)
{
outputData[outputIndex++] = 0xFC | (code >> 30);
outputData[outputIndex++] = 0x80 | ((code >> 24) & 0x3F);
outputData[outputIndex++] = 0x80 | ((code >> 18) & 0x3F);
outputData[outputIndex++] = 0x80 | ((code >> 12) & 0x3F);
outputData[outputIndex++] = 0x80 | ((code >> 6) & 0x3F);
outputData[outputIndex++] = 0x80 | (code & 0x3F);
}
}
outputData[outputIndex++] = 0;
var tmpBuffer = new Uint8Array(this.tmpStrings, 0, outputIndex);
var pointer = Module._Spellchecker_Malloc(outputIndex);
Module.HEAP8.set(tmpBuffer, pointer);
return pointer;
};
this.freeString = function(stringPointer)
{
Module._Spellchecker_Free(stringPointer);
};
this.readFromUtf8 = function(buffer, start, len)
{
var result = "";
var index = start;
var end = start + len;
while (index < end)
{
var u0 = buffer[index++];
if (!(u0 & 128))
{
result += String.fromCharCode(u0);
continue;
}
var u1 = buffer[index++] & 63;
if ((u0 & 224) == 192)
{
result += String.fromCharCode((u0 & 31) << 6 | u1);
continue;
}
var u2 = buffer[index++] & 63;
if ((u0 & 240) == 224)
{
u0 = (u0 & 15) << 12 | u1 << 6 | u2;
}
else
{
u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | buffer[index++] & 63;
}
if (u0 < 65536)
{
result += String.fromCharCode(u0);
}
else
{
var ch = u0 - 65536;
result += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);
}
}
return result;
};
this.readSuggests = function(pointer)
{
if (0 == pointer)
return [];
var lenArray = new Int32Array(Module["HEAP8"].buffer, pointer, 4);
var len = lenArray[0];
len -= 4;
var buffer = new Uint8Array(Module["HEAP8"].buffer, pointer + 4, len);
var index = 0;
var ret = [];
while (index < len)
{
var lenRec = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
index += 4;
ret.push(this.readFromUtf8(buffer, index, lenRec));
index += lenRec;
}
return ret;
};
this.createEngine = function()
{
return Module._Spellchecker_Create(this.maxEngines);
};
this.destroyEngine = function()
{
Module._Spellchecker_Destroy();
};
this.Spell = function(data)
{
var len = Math.min(data.usrLang.length, data.usrWords.length);
if (0 == len)
return;
data.usrCorrect = new Array(len);
var curLang = "";
for (var i = 0; i < len; i++)
{
if (curLang != ("" + data.usrLang[i]))
{
curLang = "" + data.usrLang[i];
var aff = this.allocString(curLang + ".aff");
var dic = this.allocString(curLang + ".dic");
ret = Module._Spellchecker_Load(this.engine, aff, dic);
this.freeString(aff);
this.freeString(dic);
}
var word = this.allocString(data.usrWords[i]);
data.usrCorrect[i] = (1 == Module._Spellchecker_Spell(this.engine, word)) ? true : false;
this.freeString(word);
}
this.sendAnswer(data);
};
this.Suggest = function(data)
{
var len = Math.min(data.usrLang.length, data.usrWords.length);
if (0 == len)
return;
data.usrSuggest = new Array(len);
var curLang = "";
for (var i = 0; i < len; i++)
{
if (curLang != ("" + data.usrLang[i]))
{
curLang = "" + data.usrLang[i];
var aff = this.allocString(curLang + ".aff");
var dic = this.allocString(curLang + ".dic");
ret = Module._Spellchecker_Load(this.engine, aff, dic);
this.freeString(aff);
this.freeString(dic);
}
var word = this.allocString(data.usrWords[i]);
var pointerSuggests = Module._Spellchecker_Suggest(this.engine, word);
data.usrSuggest[i] = this.readSuggests(pointerSuggests);
this.freeString(word);
}
this.sendAnswer(data);
};
this.sendAnswer = function(data)
{
if (self.spellchecker.ports.length == 0)
{
self.postMessage(data);
}
else
{
var port = self.spellchecker.ports.shift();
port.postMessage(data);
}
setTimeout(function(){
self.spellchecker.checkMessage();
}, 1);
};
}

View File

@ -1,61 +0,0 @@
#include "base.h"
#include "engine.h"
std::map<std::string, CFileMemory*> CSpellchecker::g_dictionaries;
void* Spellchecker_Malloc(unsigned int size)
{
return ::malloc(size);
}
void Spellchecker_Free(void* p)
{
if (p)
::free(p);
}
CSpellchecker* Spellchecker_Create(size_t max_engine_number)
{
return new CSpellchecker(max_engine_number);
}
void Spellchecker_Destroy(CSpellchecker* p)
{
delete p;
}
int Spellchecker_AddDictionary(CSpellchecker* p, const char* id, unsigned char* data, unsigned int size)
{
if (!p)
return 0;
return p->AddDictionary(id, data, size);
}
void Spellchecker_RemoveDicrionary(CSpellchecker* p, const char* id)
{
if (!p)
return;
p->RemoveDictionary(id);
}
int Spellchecker_Load(CSpellchecker* p, const char* aff_id, const char* dic_id)
{
if (!p) return 0;
return p->Load(aff_id, dic_id);
}
int Spellchecker_Spell(CSpellchecker* p, const char* word_utf8)
{
return p->Spell(word_utf8);
}
unsigned char* Spellchecker_Suggest(CSpellchecker* p, const char* word_utf8)
{;
return p->Suggest(word_utf8);
}
void Spellchecker_RemoveEngine(CSpellchecker* p, const char* sid)
{
p->RemoveEngine(sid);
}
double Spellchecker_TotalAllocatedMemory()
{
struct mallinfo a;
a = mallinfo(); // Debug
return (double)a.uordblks / 1000. / 1000.;
}

View File

@ -1,22 +0,0 @@
#include <memory>
#include <malloc.h>
class CSpellchecker;
extern "C"
{
void* Spellchecker_Malloc(unsigned int size);
void Spellchecker_Free(void* p);
CSpellchecker* Spellchecker_Create(size_t max_engine_number);
void Spellchecker_Destroy(CSpellchecker*);
int Spellchecker_AddDictionary(CSpellchecker* p, const char* sid, unsigned char* data, unsigned int size);
void Spellchecker_RemoveDicrionary(CSpellchecker* p, const char* sid);
int Spellchecker_Load(CSpellchecker* p, const char* aff_id, const char* dic_id);
int Spellchecker_Spell(CSpellchecker* p, const char* word_utf8);
void Spellchecker_RemoveEngine(CSpellchecker* p, const char* sid);
unsigned char* Spellchecker_Suggest(CSpellchecker* p, const char* word_utf8);
double Spellchecker_TotalAllocatedMemory(); //Debug
}

View File

@ -1,355 +0,0 @@
#include "hunspell.h"
#include <iostream>
#include <stdlib.h>
#include "base.h"
#include <map>
#include <queue>
#include <string>
#include <memory.h>
//#define WASM_LOGGING fprintf
class CFileMemory
{
public:
unsigned char* data;
unsigned int len;
public:
CFileMemory(unsigned char* _data = NULL, unsigned int _len = 0)
{
data = _data;
len = _len;
}
~CFileMemory()
{
if (data)
{
Spellchecker_Free(data);
data = NULL;
}
}
};
class CSuggests
{
protected:
char* m_pData;
size_t m_lSize;
char* m_pDataCur;
size_t m_lSizeCur;
public:
CSuggests()
{
m_pData = NULL;
m_lSize = 0;
m_pDataCur = m_pData;
m_lSizeCur = m_lSize;
}
CSuggests(const size_t& nLen)
{
m_lSize = nLen;
m_pData = (char*)malloc(m_lSize * sizeof(char));
m_lSizeCur = 0;
m_pDataCur = m_pData;
}
virtual ~CSuggests()
{
Clear();
}
inline void AddSize(const size_t& nSize)
{
if (NULL == m_pData)
{
m_lSize = 1000;
if (nSize > m_lSize)
m_lSize = nSize;
m_pData = (char*)malloc(m_lSize * sizeof(char));
m_lSizeCur = 0;
m_pDataCur = m_pData;
return;
}
if ((m_lSizeCur + nSize) > m_lSize)
{
while ((m_lSizeCur + nSize) > m_lSize)
{
m_lSize *= 2;
}
char* pRealloc = (char*)realloc(m_pData, m_lSize * sizeof(char));
if (NULL != pRealloc)
{
// реаллок сработал
m_pData = pRealloc;
m_pDataCur = m_pData + m_lSizeCur;
}
else
{
char* pMalloc = (char*)malloc(m_lSize * sizeof(char));
memcpy(pMalloc, m_pData, m_lSizeCur * sizeof(char));
free(m_pData);
m_pData = pMalloc;
m_pDataCur = m_pData + m_lSizeCur;
}
}
}
public:
void AddInt(const unsigned int& value)
{
AddSize(4);
memcpy(m_pDataCur, &value, sizeof(unsigned int));
m_pDataCur += 4;
m_lSizeCur += 4;
}
void WriteString(const char* value, const unsigned int& len)
{
AddSize(len + 4);
memcpy(m_pDataCur, &len, sizeof(unsigned int));
m_pDataCur += 4;
m_lSizeCur += 4;
memcpy(m_pDataCur, value, len);
m_pDataCur += len;
m_lSizeCur += len;
}
unsigned char* GetBuffer()
{
return (unsigned char*)m_pData;
}
void Clear()
{
free(m_pData);
m_pData = NULL;
m_lSize = 0;
m_pDataCur = m_pData;
m_lSizeCur = 0;
}
void ClearNoAttack()
{
m_pDataCur = m_pData;
m_lSizeCur = 0;
}
unsigned int GetSize()
{
return (unsigned int)m_lSizeCur;
}
void SkipLen()
{
AddInt(0);
}
void WriteLen()
{
unsigned int len = (unsigned int)m_lSizeCur;
memcpy(m_pData, &len, sizeof(unsigned int));
}
};
class LimitedEngineMap
{
public:
LimitedEngineMap(size_t _maxEngineNumer)
{
m_nMaxEngineNumber = _maxEngineNumer;
}
~LimitedEngineMap()
{
for (std::pair<const std::string, Hunhandle*> &i : m_mapDictionariesEngines)
{
Hunspell_destroy(i.second);
}
m_mapDictionariesEngines.clear();
}
std::map<std::string, Hunhandle*>::iterator find(const std::string &to_find)
{
return m_mapDictionariesEngines.find(to_find);
}
std::map<std::string, Hunhandle*>::iterator end()
{
return m_mapDictionariesEngines.end();
}
std::pair<std::map<std::string, Hunhandle*>::iterator,bool> insert(const std::pair<std::string, Hunhandle*> &data)
{
if (m_qEngineQueue.size() == m_nMaxEngineNumber)
{
if (m_mapDictionariesEngines.find(m_qEngineQueue.front()) !=
m_mapDictionariesEngines.end())
{
Hunspell_destroy(m_mapDictionariesEngines[m_qEngineQueue.front()]);
m_mapDictionariesEngines.erase(m_qEngineQueue.front());
m_qEngineQueue.pop();
}
}
m_qEngineQueue.push(data.first);
return m_mapDictionariesEngines.insert(data);
}
void RemoveEngine(const char* id)
{
if (m_mapDictionariesEngines.find(id) == m_mapDictionariesEngines.end())
{
return;
}
std::queue<std::string> new_queue;;
Hunspell_destroy(m_mapDictionariesEngines[id]);
m_mapDictionariesEngines.erase(id);
while (!m_qEngineQueue.empty())
{
if (m_qEngineQueue.front() != id)
{
new_queue.push(m_qEngineQueue.front());
}
m_qEngineQueue.pop();
}
m_qEngineQueue = new_queue;
}
private:
std::map<std::string, Hunhandle*> m_mapDictionariesEngines;
std::queue<std::string> m_qEngineQueue;
size_t m_nMaxEngineNumber;
};
class CSpellchecker
{
public:
static std::map<std::string, CFileMemory*> g_dictionaries;
public:
LimitedEngineMap m_oDictionariesEngines;
std::string m_sCurrentDictionaryId;
Hunhandle* m_pCurrentDictionary;
CSuggests m_oSuggests;
public:
CSpellchecker(size_t _MaxEngineNumber) :
m_oDictionariesEngines(_MaxEngineNumber)
{
m_sCurrentDictionaryId = "";
m_pCurrentDictionary = NULL;
}
~CSpellchecker()
{
m_pCurrentDictionary = NULL;
for (std::pair<const std::string, CFileMemory*> &i : g_dictionaries)
{
delete i.second;
}
g_dictionaries.clear();
}
public:
int AddDictionary(const char*& id, unsigned char* data, unsigned int size)
{
#ifdef WASM_LOGGING
WASM_LOGGING(stderr, "add dictionary: [%s, %d]\n", id, (int)size);
#endif
RemoveDictionary(id);
g_dictionaries.insert(std::pair<std::string, CFileMemory*>(std::string(id), new CFileMemory(data, size)));
return 1;
}
void RemoveDictionary(const char*& id)
{
std::string sid(id);
std::map<std::string, CFileMemory*>::iterator iter = g_dictionaries.find(sid);
if (iter != g_dictionaries.end())
{
CFileMemory* file = iter->second;
g_dictionaries.erase(iter);
delete file;
}
}
static CFileMemory* Get(const char*& id)
{
std::map<std::string, CFileMemory*>::iterator iter = g_dictionaries.find(std::string(id));
if (iter == g_dictionaries.end())
return NULL;
return iter->second;
}
int Load(const char*& aff_id, const char*& dic_id)
{
#ifdef WASM_LOGGING
WASM_LOGGING(stderr, "load: [%s, %s]\n", aff_id, dic_id);
#endif
return (NULL != SetLanguage(aff_id, dic_id)) ? 1 : 0;
}
int Spell(const char*& word)
{
#ifdef WASM_LOGGING
WASM_LOGGING(stderr, "spell: [%s]\n", word);
#endif
if (!m_pCurrentDictionary)
return 0;
return Hunspell_spell(m_pCurrentDictionary, word);
}
unsigned char* Suggest(const char*& word)
{
#ifdef WASM_LOGGING
WASM_LOGGING(stderr, "suggest: [%s]\n", word);
#endif
if (!m_pCurrentDictionary)
return NULL;
char** pSuggest;
int nSuggestCount = Hunspell_suggest(m_pCurrentDictionary, &pSuggest, word);
m_oSuggests.ClearNoAttack();
m_oSuggests.SkipLen();
for (int i = 0; i < nSuggestCount; ++i)
{
m_oSuggests.WriteString(pSuggest[i], (unsigned int)strlen(pSuggest[i]));
}
m_oSuggests.WriteLen();
if (0 < nSuggestCount)
Hunspell_free_list(m_pCurrentDictionary, &pSuggest, nSuggestCount);
return m_oSuggests.GetBuffer();
}
void RemoveEngine(const char* id)
{
m_oDictionariesEngines.RemoveEngine(id);
if (m_sCurrentDictionaryId == id)
{
m_sCurrentDictionaryId = "";
m_pCurrentDictionary = NULL;
}
}
protected:
Hunhandle* SetLanguage(const std::string& aff_id, const std::string& dic_id)
{
if ((aff_id + dic_id) == m_sCurrentDictionaryId)
return m_pCurrentDictionary;
m_sCurrentDictionaryId = aff_id + dic_id;
m_pCurrentDictionary = NULL;
std::map<std::string, Hunhandle*>::iterator iterEngine = m_oDictionariesEngines.find(m_sCurrentDictionaryId);
if (iterEngine != m_oDictionariesEngines.end())
{
m_pCurrentDictionary = iterEngine->second;
return m_pCurrentDictionary;
}
Hunhandle* pDictionary = Hunspell_create(aff_id.c_str(), dic_id.c_str());
m_oDictionariesEngines.insert(std::pair<std::string, Hunhandle*>(m_sCurrentDictionaryId, pDictionary));
m_pCurrentDictionary = pDictionary;
return m_pCurrentDictionary;
}
};

View File

@ -1,58 +0,0 @@
#include "license.hunspell"
#include "license.myspell"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "filemgr.hxx"
#include "csutil.hxx"
#include "./engine.h"
int FileMgr::fail(const char * err, const char * par) {
fprintf(stderr, err, par);
return -1;
}
FileMgr::FileMgr(const char * file, const char * key)
: hin(NULL), fin(NULL), linenum(0)
{
in[0] = '\0';
CFileMemory* file_memory = CSpellchecker::Get(file);
if (!file_memory)
{
fail(MSG_OPEN, file);
}
else
{
index = 0;
size = file_memory->len;
memory = (char*)file_memory->data;
}
}
FileMgr::~FileMgr()
{
if (fin) fclose(fin);
if (hin) delete hin;
}
char * FileMgr::getline() {
if(index >= size)
return NULL;
int i = 0,
l = BUFSIZE -1;
for(;index < size && memory[index] != '\n' && memory[index] != EOF && i <= l; index++, i++)
in[i] = memory[index];
in[i] = '\0';
index++;
if(index < size)
linenum++;
return strdup(in);
}
int FileMgr::getlinenum() {
return linenum;
}

View File

@ -1,52 +0,0 @@
//#include "license.hunspell"
//#include "license.myspell"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "./filemgr.hxx"
#include "csutil.hxx"
#include "./engine.h"
int FileMgr::fail(const char *err, const char *par)
{
fprintf(stderr, err, par);
return -1;
}
FileMgr::FileMgr(const char *file, const char *key)
: hin(NULL), linenum(0), memin(NULL)
{
in[0] = '\0';
CFileMemory *file_memory = CSpellchecker::Get(file);
if (!file_memory)
{
fail(MSG_OPEN, file);
}
else
{
memin.from_buffer((char *)file_memory->data, file_memory->len);
}
}
FileMgr::~FileMgr()
{
if (hin)
delete hin;
}
bool FileMgr::getline(std::string &dest)
{
bool ret = memin.get_line(dest);
if (ret)
++linenum;
return ret;
}
int FileMgr::getlinenum()
{
return linenum;
}

View File

@ -1,37 +0,0 @@
#include "./base.h"
#include <iostream>
int main()
{
CSpellchecker* spell = Spellchecker_Create(100);
FILE* fAff = fopen("en_GB.aff", "rb");
fseek(fAff, 0, SEEK_END);
unsigned int nAffSize = (unsigned int)ftell(fAff);
fseek(fAff, 0, SEEK_SET);
unsigned char* pAffData = (unsigned char*)Spellchecker_Malloc(nAffSize);
size_t nAffSizeRead = fread((void*)pAffData, 1, (size_t)nAffSize, fAff);
fclose(fAff);
FILE* fDic = fopen("en_GB.dic", "rb");
fseek(fDic, 0, SEEK_END);
unsigned int nDicSize = (unsigned int)ftell(fDic);
fseek(fDic, 0, SEEK_SET);
unsigned char* pDicData = (unsigned char*)Spellchecker_Malloc(nDicSize);
size_t nDicSizeRead = fread((void*)pDicData, 1, (size_t)nDicSize, fDic);
fclose(fDic);
int bIsAdd1 = Spellchecker_AddDictionary(spell, "en_US.aff", pAffData, nAffSize);
int bIsAdd2 = Spellchecker_AddDictionary(spell, "en_US.dic", pDicData, nDicSize);
while(1) {
Spellchecker_Load(spell, "en_US.aff", "en_US.dic");
Spellchecker_RemoveEngine(spell, "en_US.affen_US.dic");
std::cout << Spellchecker_Debug() << std::endl;
}
// int nCheck1 = Spellchecker_Spell(spell, "hello");
// int nCheck2 = Spellchecker_Spell(spell, "hellop");
// unsigned char* pSuggestData = Spellchecker_Suggest(spell, "hellop");
Spellchecker_Destroy(spell);
return 0;
}

View File

@ -1,50 +0,0 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
class string_buffer_stream
{
private:
char* m_buffer;
unsigned int m_pos;
unsigned int m_size;
public:
string_buffer_stream(char* buf = NULL, unsigned int len = 0)
{
m_buffer = buf;
m_pos = 0;
m_size = len;
}
void from_buffer(char* buf, unsigned int len)
{
m_buffer = buf;
m_pos = 0;
m_size = len;
}
// emulate
// https://en.cppreference.com/w/cpp/string/basic_string/getline
bool get_line(std::string& data)
{
data.erase();
if (m_pos >= m_size)
return false;
while (m_pos < m_size)
{
char c = m_buffer[m_pos++];
if (c == '\n')
break;
if (c == '\r')
{
if (m_pos < m_size && m_buffer[m_pos] == '\n')
++m_pos;
break;
}
data += c;
}
return true;
}
};

View File

@ -1,14 +0,0 @@
import sys
sys.path.append("../../../../../../build_tools/scripts")
import base
base.configure_common_apps()
base.replaceInFile("../deploy/engine/hyphen.js", "__ATPOSTRUN__=[];", "__ATPOSTRUN__=[onLoadModule];")
base.replaceInFile("../deploy/engine/hyphen_ie.js", "__ATPOSTRUN__=[];", "__ATPOSTRUN__=[onLoadModule];")
base.replaceInFile("../deploy/engine/hyphen.js", "__ATPOSTRUN__ = [];", "__ATPOSTRUN__=[onLoadModule];")
base.replaceInFile("../deploy/engine/hyphen_ie.js", "__ATPOSTRUN__ = [];", "__ATPOSTRUN__=[onLoadModule];")
base.replaceInFile("../deploy/engine/hyphen.js", "function getBinaryPromise()", "function getBinaryPromise2()")
base.replaceInFile("../deploy/engine/hyphen_ie.js", "function getBinaryPromise()", "function getBinaryPromise2()")
base.copy_file("../library.js", "../deploy/hyphen.js")

View File

@ -1,40 +0,0 @@
{
"name": "hyphen",
"res_folder": "../deploy/engine",
"wasm": true,
"asm": true,
"embed_mem_file": true,
"run_before": "",
"run_after": "after.py",
"base_js_content": "../module.js",
"compiler_flags": [
"-O3",
"-fno-exceptions",
"-fno-rtti",
"-Wno-unused-command-line-argument",
"-sALLOW_MEMORY_GROWTH"
],
"exported_functions": [
"_malloc",
"_free",
"_hyphenCreateApplication",
"_hyphenDestroyApplication",
"_hyphenLoadDictionary",
"_hyphenWord"
],
"include_path": ["../src"],
"define": ["GRAPHICS_NO_USE_DYNAMIC_LIBRARY", "HYPHEN_ENGINE_DISABLE_FILESYSTEM"],
"compile_files_array": [
{
"name": "h_e",
"folder": "../../../../../DesktopEditor/fontengine",
"files": ["TextHyphen.cpp"]
},
{
"name": "h_m",
"folder": "../src",
"files": ["hyphen.cpp"]
}
]
}

View File

@ -1,43 +0,0 @@
(function(window) {
window.hyphen = window.hyphen || {};
window.hyphen.isReady = false;
var not_ready = function() {
console.log('Module is not ready');
}
window.hyphen.destroyApplication = not_ready;
window.hyphen.loadDictionary = not_ready;
window.hyphen.hyphenWord = not_ready;
window.hyphen.onLoadModule = function(exports) {
window.hyphen.isReady = true;
window.hyphen.destroyApplication = exports.destroyApplication;
window.hyphen.loadDictionary = exports.loadDictionary;
window.hyphen.hyphenWord = exports.hyphenWord;
};
window.hyphen.loadModule = function() {
var path = '../deploy/engine/';
// wasm support check
var useWasm = false;
const webAsmObj = window['WebAssembly'];
if (typeof webAsmObj === 'object') {
if (typeof webAsmObj['Memory'] === 'function') {
if ((typeof webAsmObj['instantiateStreaming'] === 'function') || (typeof webAsmObj['instantiate'] === 'function')) {
useWasm = true;
}
}
}
path += (useWasm ? 'hyphen.js' : 'hyphen_ie.js');
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = path;
document.head.appendChild(script);
}
})(self);

View File

@ -1,81 +0,0 @@
(function(window) {
var isModuleLoaded = false;
var application;
function onLoadModule() {
isModuleLoaded = true;
application = Module._hyphenCreateApplication();
if (window.hyphen) {
window.hyphen.onLoadModule && window.hyphen.onLoadModule({
destroyApplication: function() {
Module._hyphenDestroyApplication(application);
},
loadDictionary: hyphenLoadDictionary,
hyphenWord: hyphenWord
});
}
};
//desktop_fetch
//polyfill
//string_utf8
//module
/**
*
* @param {Number} app
* @param {Number} lang
* @param {arraybuffer} dict
* @returns {Boolean} isSuccess
*/
function hyphenLoadDictionary(lang, dict)
{
if (!isModuleLoaded)
return;
let dictSize = dict.byteLength;
let dictPointer = Module._malloc(dictSize);
Module.HEAP8.set(new Uint8ClampedArray(dict), dictPointer);
let result = Module._hyphenLoadDictionary(application, lang, dictPointer, dictSize);
Module._free(dictPointer);
return (result === 0) ? true : false;
}
/**
*
* @param {Number} lang
* @param {String} word
* @returns {Array}
* Returns hyphen vector of word
*/
function hyphenWord(lang, word)
{
if (!isModuleLoaded)
return;
let wordPointer = word.toUtf8Pointer();
let wordLen = wordPointer.length;
let hyphens = [];
if (wordPointer)
{
const ptr = Module._hyphenWord(application, lang, wordPointer.ptr, wordLen);
wordPointer.free();
let vector = new Uint8ClampedArray(Module.HEAP8.buffer, ptr, wordLen + 5);
for (let i = 0; vector[i] != 0; i++)
{
if (1 == (vector[i] & 1))
hyphens.push((i + 1));
}
}
return hyphens;
}
})(self);

View File

@ -1,52 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>test</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<form>
<textarea id = "textarea"></textarea>
<button type = "submit">OK</button>
<select name = "combobox" id = "combobox">
<option></option>
<option value = "bg_BG">bg_BG</option>
<option value = "ca_ES">ca_ES</option>
<option value = "da_DK">da_DK</option>
<option value = "de_AT">de_AT</option>
<option value = "de_CH">de_CH</option>
<option value = "de_DE">de_DE</option>
<option value = "el_GR">el_GR</option>
<option value = "en_AU">en_AU</option>
<option value = "en_GB">en_GB</option>
<option value = "en_US">en_US</option>
<option value = "es_ES">es_ES</option>
<option value = "fr_FR">fr_FR</option>
<option value = "gl_ES">gl_ES</option>
<option value = "hr_HR">hr_HR</option>
<option value = "hu_HU">hu_HU</option>
<option value = "id_ID">id_ID</option>
<option value = "it_IT">it_IT</option>
<option value = "lv_LV">lv_LV</option>
<option value = "mn_MN">mn_MN</option>
<option value = "nb_NO">nb_NO</option>
<option value = "nl_NL">nl_NL</option>
<option value = "nn_NO">nn_NO</option>
<option value = "pl_PL">pl_PL</option>
<option value = "pt_BR">pt_BR</option>
<option value = "pt_PT">pt_PT</option>
<option value = "ro_RO">ro_RO</option>
<option value = "ru_RU">ru_RU</option>
<option value = "sk_SK">sk_SK</option>
<option value = "sl_SI">sl_SI</option>
<option value = "sr_Cyrl_RS">sr_Cyrl_RS</option>
<option value = "sr_Latn_RS">sr_Latn_RS</option>
<option value = "sv_SE">sv_SE</option>
<option value = "uk_UA">uk_UA</option>
</select>
</form>
<script src = "../deploy/hyphen.js"></script>
<script src = "main.js"></script>
</body>
</html>

View File

@ -1,117 +0,0 @@
(function (window, undefined) {
window.hyphen.loadModule();
var langs = {
"az_Latn_AZ" : 1068,
"bg_BG" : 1026,
"ca_ES" : 1027,
"ca_ES_valencia" : 2051,
"cs_CZ" : 1029,
"da_DK" : 1030,
"de_AT" : 3079,
"de_CH" : 2055,
"de_DE" : 1031,
"el_GR" : 1032,
"en_AU" : 3081,
"en_CA" : 4105,
"en_GB" : 2057,
"en_US" : 1033,
"en_ZA" : 7177,
"es_ES" : 3082,
"eu_ES" : 1069,
"fr_FR" : 1036,
"gl_ES" : 1110,
"hr_HR" : 1050,
"hu_HU" : 1038,
"id_ID" : 1057,
"it_IT" : 1040,
"kk_KZ" : 1087,
"ko_KR" : 1042,
"lb_LU" : 1134,
"lt_LT" : 1063,
"lv_LV" : 1062,
"mn_MN" : 1104,
"nb_NO" : 1044,
"nl_NL" : 1043,
"nn_NO" : 2068,
"oc_FR" : 1154,
"pl_PL" : 1045,
"pt_BR" : 1046,
"pt_PT" : 2070,
"ro_RO" : 1048,
"ru_RU" : 1049,
"sk_SK" : 1051,
"sl_SI" : 1060,
"sr_Cyrl_RS" : 10266,
"sr_Latn_RS" : 9242,
"sv_SE" : 1053,
"tr_TR" : 1055,
"uk_UA" : 1058,
"uz_Cyrl_UZ" : 2115,
"uz_Latn_UZ" : 1091,
"vi_VN" : 1066,
"nl_NL" : 2067
};
var textarea = document.getElementById("textarea");
var form = document.querySelector("form");
var combobox = document.getElementById("combobox");
combobox.value = "en_US";
textarea.value = "expedition";
form.onsubmit = function(event)
{
if(combobox.value == "")
return;
var lang = combobox.value;
var text = textarea.value.split("\n").join(" ").split(" ");
var request = new XMLHttpRequest();
var path = '../../../../../../dictionaries/' + lang + '/' + 'hyph_' + lang + '.dic';
request.responseType = 'arraybuffer';
if (request.overrideMimeType) {
request.overrideMimeType('text/plain; charset=x-user-defined');
} else {
request.setRequestHeader('Accept-Charset', 'x-user-defined');
}
request.open('GET', path, true);
request.send(null);
request.onload = function ()
{
var dict = request.response;
var langInt = langs[lang];
window.hyphen.loadDictionary(langInt, dict);
for (var i = 0; i < text.length; i++)
{
var hyphens = window.hyphen.hyphenWord(langInt, text[i].toLowerCase());
let itemUtf8 = text[i].toUtf8(true);
let start = 0;
let hword = "";
for (let j = 0, len = hyphens.length; j < len; j++)
{
hword += "".fromUtf8(itemUtf8, start, hyphens[j] - start);
hword += "=";
start = hyphens[j];
}
if (start < itemUtf8.length)
{
hword += "".fromUtf8(itemUtf8, start);
hword += "=";
}
console.log(hword);
}
}
event.preventDefault();
}
})(self);

View File

@ -1,10 +0,0 @@
button {
width: 60px;
height: 30px;
}
#textarea{
display: block;
width: 300px;
height: 300px;
}

View File

@ -0,0 +1,327 @@
#!/usr/bin/env python
import sys
import os
sys.path.append('../../../../build_tools/scripts')
import base
# suppresses status output when set via --quiet/-q; errors are still shown
QUIET = False
def log(msg):
if not QUIET:
print(msg)
return
def log_info(msg):
if not QUIET:
base.print_info(msg)
return
# ---------------------------------------------------------------------------
# Per-target defaults (mirror LIBXML2_WITH_* options from CMakeLists.txt
# and the platform branches inside configure.ac)
# ---------------------------------------------------------------------------
COMMON_FEATURES = {
"WITH_C14N": 0,
"WITH_CATALOG": 0,
"WITH_DEBUG": 0,
"WITH_HTML": 1,
"WITH_HTTP": 0,
"WITH_ICONV": 0,
"WITH_ICU": 0,
"WITH_ISO8859X": 0,
"WITH_MODULES": 0,
"WITH_OUTPUT": 1,
"WITH_PATTERN": 0,
"WITH_PUSH": 1,
"WITH_READER": 1,
"WITH_REGEXPS": 0,
"WITH_RELAXNG": 0,
"WITH_SAX1": 1,
"WITH_SCHEMAS": 0,
"WITH_SCHEMATRON": 0,
"WITH_THREADS": 0,
"WITH_THREAD_ALLOC": 0,
"WITH_VALID": 0,
"WITH_WRITER": 0,
"WITH_XINCLUDE": 0,
"WITH_XPATH": 0,
"WITH_XPTR": 1,
"WITH_ZLIB": 0
}
TARGETS = {
"windows": {
"WITH_WINPATH": 1,
"HAVE_DECL_GETENTROPY": 0,
"HAVE_DECL_GLOB": 0,
"HAVE_DECL_MMAP": 0,
"HAVE_FUNC_ATTRIBUTE_DESTRUCTOR": 0,
"HAVE_DLOPEN": 0,
"HAVE_SHLLOAD": 0,
"HAVE_LIBHISTORY": 0,
"HAVE_LIBREADLINE": 0,
"HAVE_STDINT_H": 1,
"XML_SYSCONFDIR": "/etc",
"MODULE_EXTENSION": ".dll",
"XML_THREAD_LOCAL": "__declspec(thread)"
},
"linux": {
"WITH_WINPATH": 0,
"HAVE_DECL_GETENTROPY": 0,
"HAVE_DECL_GLOB": 1,
"HAVE_DECL_MMAP": 1,
"HAVE_FUNC_ATTRIBUTE_DESTRUCTOR": 1,
"HAVE_DLOPEN": 1,
"HAVE_SHLLOAD": 0,
"HAVE_LIBHISTORY": 0,
"HAVE_LIBREADLINE": 0,
"HAVE_STDINT_H": 1,
"XML_SYSCONFDIR": "/etc",
"MODULE_EXTENSION": ".so",
"XML_THREAD_LOCAL": "__thread"
},
"mac": {
"WITH_WINPATH": 0,
"HAVE_DECL_GETENTROPY": 0,
"HAVE_DECL_GLOB": 1,
"HAVE_DECL_MMAP": 1,
"HAVE_FUNC_ATTRIBUTE_DESTRUCTOR": 1,
"HAVE_DLOPEN": 1,
"HAVE_SHLLOAD": 0,
"HAVE_LIBHISTORY": 0,
"HAVE_LIBREADLINE": 0,
"HAVE_STDINT_H": 1,
"XML_SYSCONFDIR": "/etc",
"MODULE_EXTENSION": ".dylib",
"XML_THREAD_LOCAL": "__thread"
}
}
# ---------------------------------------------------------------------------
# Helpers
# ---------------------------------------------------------------------------
def build_defaults(target):
if target not in TARGETS:
base.print_error("unknown target: " + target)
sys.exit(1)
cfg = {}
for k in COMMON_FEATURES:
cfg[k] = COMMON_FEATURES[k]
for k in TARGETS[target]:
cfg[k] = TARGETS[target][k]
return cfg
def derive(cfg):
parts = cfg["VERSION"].split(".")
major = int(parts[0])
minor = int(parts[1])
micro = int(parts[2])
cfg["LIBXML_MAJOR_VERSION"] = major
cfg["LIBXML_MINOR_VERSION"] = minor
cfg["LIBXML_MICRO_VERSION"] = micro
cfg["LIBXML_VERSION_NUMBER"] = major * 10000 + minor * 100 + micro
if "LIBXML_VERSION_EXTRA" not in cfg:
cfg["LIBXML_VERSION_EXTRA"] = ""
return
def subst_atvars(text, cfg):
for key in cfg:
text = text.replace("@" + key + "@", str(cfg[key]))
# warn about leftover placeholders (helps catch typos in xmlversion.h.in)
i = text.find("@")
while i != -1:
j = text.find("@", i + 1)
if j == -1:
break
token = text[i + 1:j]
is_name = (len(token) > 0)
for ch in token:
if not (ch.isalnum() or ch == "_"):
is_name = False
break
if is_name:
base.print_error("undefined template variable: @" + token + "@")
i = text.find("@", j + 1)
return text
def process_cmakedefine_line(line, cfg):
stripped = line.lstrip()
if not stripped.startswith("#"):
return None
indent = line[:len(line) - len(stripped)]
body = stripped[1:].lstrip() # skip '#' and any whitespace after it
if body.startswith("cmakedefine01"):
rest = body[len("cmakedefine01"):].strip()
if rest == "":
return None
name = rest.split()[0]
value = 1 if int(cfg.get(name, 0)) else 0
return indent + "#define " + name + " " + str(value)
if body.startswith("cmakedefine"):
rest = body[len("cmakedefine"):]
if rest == "" or not rest[0].isspace():
return None
rest = rest.lstrip()
sp = -1
for k in range(len(rest)):
if rest[k].isspace():
sp = k
break
if sp == -1:
name = rest
tail = ""
else:
name = rest[:sp]
tail = rest[sp:]
if cfg.get(name):
return indent + "#define " + name + subst_atvars(tail, cfg)
return indent + "/* #undef " + name + " */"
return None
def process_template(text, cfg, cmake_style):
out_lines = []
for line in text.splitlines():
if cmake_style:
replaced = process_cmakedefine_line(line, cfg)
if replaced is not None:
out_lines.append(replaced)
continue
out_lines.append(subst_atvars(line, cfg))
return "\n".join(out_lines) + "\n"
def configure_file(src, dst, cfg, cmake_style):
if not base.is_file(src):
base.print_error("template not found: " + src)
sys.exit(1)
text = base.readFile(src)
dst_dir = os.path.dirname(base.get_path(dst))
if dst_dir != "":
base.create_dir(dst_dir)
base.writeFile(dst, process_template(text, cfg, cmake_style))
log(" wrote " + dst)
return
# ---------------------------------------------------------------------------
# CLI
# ---------------------------------------------------------------------------
def print_help():
print("Usage: python configure_libxml2.py [options]")
print("")
print("Generates config.h and include/libxml/xmlversion.h from the")
print("libxml2 *.in templates, mirroring the logic of configure.ac /")
print("CMakeLists.txt without invoking autoconf or cmake.")
print("")
print("Paths:")
print(" --source DIR libxml2 source root (default: cwd)")
print(" --config-h PATH explicit path for config.h")
print(" (default: <script-dir>/config.h)")
print(" --xmlversion-h PATH explicit path for xmlversion.h")
print(" (default: <script-dir>/xmlversion.h)")
print("")
print("Build options:")
print(" --target NAME windows | linux | mac (default: host)")
print(" --with-FEATURE 0|1 toggle any LIBXML2_WITH_* feature")
print(" e.g. --with-zlib 1 --with-iconv 1")
print(" --have-NAME 0|1 set any HAVE_* probe value")
print(" e.g. --have-dlopen 1")
print(" --xml-sysconfdir DIR override XML_SYSCONFDIR")
print(" --xml-thread-local S override TLS specifier")
print(" --module-extension S override dynamic-module suffix")
print(" --version-extra S set LIBXML_VERSION_EXTRA")
print("")
print(" -q, --quiet suppress status output (errors still shown)")
print(" -h, --help show this message")
return
def parse_args(argv):
args = {}
i = 1
while i < len(argv):
arg = argv[i]
if arg == "-h" or arg == "--help":
args["help"] = "1"
i += 1
continue
if arg == "-q" or arg == "--quiet":
args["quiet"] = "1"
i += 1
continue
if not arg.startswith("--"):
base.print_error("unexpected positional argument: " + arg)
sys.exit(1)
key = arg[2:]
if i + 1 >= len(argv):
base.print_error("missing value for --" + key)
sys.exit(1)
args[key] = argv[i + 1]
i += 2
return args
def apply_overrides(cfg, args):
reserved = ("source", "target", "config-h", "xmlversion-h",
"version-extra", "help", "quiet")
for key in args:
if key in reserved:
continue
cfg_key = key.upper().replace("-", "_")
value = args[key]
if cfg_key not in cfg:
base.print_error("unknown option: --" + key + " "
"(maps to " + cfg_key + ")")
sys.exit(1)
# keep type stable: numeric keys stay numeric
if isinstance(cfg[cfg_key], int):
try:
cfg[cfg_key] = int(value)
except ValueError:
base.print_error("--" + key + " expects 0 or 1, got: " + value)
sys.exit(1)
else:
cfg[cfg_key] = value
return
def main(argv):
global QUIET
args = parse_args(argv)
if "help" in args:
print_help()
return 0
QUIET = ("quiet" in args)
source = args.get("source", os.getcwd())
script_dir = os.path.dirname(os.path.realpath(__file__))
target = args.get("target", base.host_platform())
cfg = build_defaults(target)
version_file = source + "/VERSION"
if not base.is_file(version_file):
base.print_error("VERSION file not found in: " + source)
return 1
cfg["VERSION"] = base.readFile(version_file).strip()
apply_overrides(cfg, args)
if "version-extra" in args:
cfg["LIBXML_VERSION_EXTRA"] = args["version-extra"]
derive(cfg)
config_h_out = args.get("config-h", script_dir + "/config.h")
xmlversion_h_out = args.get("xmlversion-h", script_dir + "/xmlversion.h")
log_info("libxml2 " + cfg["VERSION"] + " target=" + target)
log(" source = " + source)
configure_file(source + "/config.h.cmake.in",
config_h_out, cfg, True)
configure_file(source + "/include/libxml/xmlversion.h.in",
xmlversion_h_out, cfg, False)
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv))

View File

@ -0,0 +1,26 @@
#!/usr/bin/env python
import sys
sys.path.append('../../../../build_tools/scripts')
import base
import configure_libxml2
if not base.is_dir("libxml2"):
base.cmd("git", ["clone", "https://github.com/GNOME/libxml2.git"])
base.cmd_in_dir("libxml2", "git", ["checkout", "39b66eb2089f491eacf8e22a7965a235f7f5735e", "--quiet"])
configure_libxml2.main(["", "--source", "./libxml2",
"--config-h", "../../../DesktopEditor/xml/build/qt/config.h",
"--xmlversion-h", "./libxml2/include/libxml/xmlversion.h",
"--quiet"])
#fix parserInternals.h
base.replaceInFileUtf8("libxml2/include/libxml/parserInternals.h", "#define XML_MAX_TEXT_LENGTH 10000000", "#define XML_MAX_TEXT_LENGTH 15000000")
base.replaceInFileUtf8("libxml2/include/libxml/parserInternals.h", "#define XML_MAX_DICTIONARY_LIMIT 10000000", "#define XML_MAX_DICTIONARY_LIMIT 15000000")
base.replaceInFileUtf8("libxml2/include/libxml/parserInternals.h", "#define XML_MAX_LOOKUP_LIMIT 10000000", "#define XML_MAX_LOOKUP_LIMIT 15000000")
#Logging has been removed
target = "void\nxmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) {\n va_list args;\n\n if (xmlGenericErrorContext == NULL)\n xmlGenericErrorContext = (void *) stderr;\n\n va_start(args, msg);\n vfprintf((FILE *)xmlGenericErrorContext, msg, args);\n va_end(args);\n}"
replacement = "#ifndef XML_ERROR_DISABLE_MODE\n" + target + "\n#else\nvoid\nxmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) {\n // NONE\n}\n#endif"
base.replaceInFile("libxml2/error.c", target, replacement)

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "./common_openssl.h"
@ -673,8 +676,8 @@ namespace NSOpenSSL
#define GCM_IV_LENGTH 12
#define GCM_TAG_LENGHT 16
// для того, чтобы мы могли менять алгоритмы, в зависимости от версии
// на шифровке - дописываем хедер. сделано на этом уровне, чтобы лишний раз не выделять/копировать память
// so that we can change algorithms depending on the version
// on encryption - we append header. done at this level to avoid unnecessary memory allocation/copying
std::string g_aes_header = "VER2;";
unsigned char* PBKDF2_desktop_GCM(const std::string& pass, const std::string& salt)

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef COMMON_OPENSSL_H

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "./../common/common_openssl.h"

View File

@ -399,7 +399,7 @@ void Header::load( const unsigned char* buffer ) {
num_mbat = readU32( buffer + 0x48 ); // [48H,04] number of SECTs in the DIFAT chain
if (threshold == 0)
threshold = 4096; //поле не задано ... файл xls от полльзователя
threshold = 4096; //field not set ... xls file from user
for( unsigned int i = 0; i < 8; i++ )
id[i] = buffer[i];

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

@ -30,7 +30,7 @@ if False:
build_func()
else:
if not base.is_file("./build.7z"):
base.download("http://d2ettrnqo7v976.cloudfront.net/v8/android/build.7z", "./build.7z")
base.download("https://github.com/ONLYOFFICE-data/build_tools_data/raw/refs/heads/master/android/v8.7z", "./build.7z")
base.extract("./build.7z", "./")
base.copy_dir("./build/v8", "./v8")
base.delete_dir("./build/v8")

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once
#include "VideoFileErrorDescription.h"

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifdef _MSC_VER
#pragma once // for MSVS

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef ATLDEFINE_H_DEFINE
#define ATLDEFINE_H_DEFINE

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef BASE64_H_DEFINE
#define BASE64_H_DEFINE
@ -287,7 +290,7 @@ static bool Base64Decode(const char* szSrc, int nSrcLen, BYTE *& pbDest, int *pn
{
unsigned int index= in[i]-43;
if (index>=FF_ARRAY_ELEMS(map2) || map2[index] == 0xff)
return false; ///???? было -1
return false; ///???? was -1
v = (v << 6) + map2[index];
if (i & 3) {
if (dst - out < out_size) {

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once
@ -57,9 +60,9 @@ namespace NFileWriter
NSFile::CFileBinary m_oFile;
LONG64 m_lBufferSize; // Размер буффера
BYTE* m_lpBuffer; // Сам буффер
LONG64 m_lWritePointer; // Позиция для записи данных в буффер
LONG64 m_lBufferSize; // Buffer size
BYTE* m_lpBuffer; // The buffer itself
LONG64 m_lWritePointer; // Position for writing data to the buffer
public :

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifdef _MSC_VER
#pragma once // for MSVS

View File

@ -1,3 +1,36 @@
# Copyright (C) Ascensio System SIA, 2009-2026
#
# This program is a free software product. You can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License (AGPL)
# version 3 as published by the Free Software Foundation, together with the
# additional terms provided in the LICENSE file.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
# details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
#
# You can contact Ascensio System SIA by email at info@onlyoffice.com
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
# LV-1050, Latvia, European Union.
#
# The interactive user interfaces in modified versions of the Program
# are required to display Appropriate Legal Notices in accordance with
# Section 5 of the GNU AGPL version 3.
#
# No trademark rights are granted under this License.
#
# All non-code elements of the Product, including illustrations,
# icon sets, and technical writing content, are licensed under the
# Creative Commons Attribution-ShareAlike 4.0 International License:
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
#
# This license applies only to such non-code elements and does not
# modify or replace the licensing terms applicable to the Program's
# source code, which remains licensed under the GNU Affero General
# Public License v3.
#
# SPDX-License-Identifier: AGPL-3.0-only
HEADERS += \
$$PWD/include/FileTransporter.h \
$$PWD/include/manager.h \

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef APPLICATION_DOWNLOAD_MANAGER_H

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "FileTransporter_private.h"
@ -106,7 +109,7 @@ namespace NSNetwork
{
CURL *curl;
int fp;
CURLcode res;
CURLcode res = CURLE_FAILED_INIT;
std::string sUrl = U_TO_UTF8(m_sDownloadFileUrl);
std::string sOut;
const char *url = sUrl.c_str();
@ -121,7 +124,7 @@ namespace NSNetwork
// Install the callback function
//curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_func);
#if defined(__linux__)
//в linux нет встроенных в систему корневых сертификатов, поэтому отключаем проверку
//linux has no built-in root certificates, so we disable verification
//http://curl.haxx.se/docs/sslcerts.html
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif
@ -181,7 +184,7 @@ namespace NSNetwork
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
#if defined(__linux__)
//в linux нет встроенных в систему корневых сертификатов, поэтому отключаем проверку
//linux has no built-in root certificates, so we disable verification
//http://curl.haxx.se/docs/sslcerts.html
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
#endif

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "FileTransporter_private.h"
@ -105,11 +108,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 +174,189 @@ 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)
// NSURLSession does not support file:// URLs reliably on macOS/iOS
// NSFileManager to copy the file directly instead.
if (url && [[url scheme] isEqualToString:@"file"])
{
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)
return 1;
#else
#ifndef _ASC_USE_ARC_
NSString* dstPath = StringWToNSString(m_sDownloadFilePath);
NSFileManager* fm = [NSFileManager defaultManager];
// copyItemAtURL:toURL: fails if destination exists — remove it first
// to match the overwrite semantics of writeToFile:atomically:YES
[fm removeItemAtPath:dstPath error:nil];
NSError* err = nil;
BOOL ok = [fm copyItemAtURL:url
toURL:[NSURL fileURLWithPath:dstPath]
error:&err];
if (!ok)
NSLog(@"[DownloadFile] file:// copy failed: %@", err);
#if !defined(_IOS)
#ifndef _ASC_USE_ARC_
if (!GetARCEnabled())
{
[dstPath release];
[stringURL release];
//[url release];
}
#endif
#endif
#endif
#endif
return ok ? 0 : 1;
}
if (!url)
{
NSLog(@"[DownloadFile] Invalid URL: %@", stringURL);
#if !defined(_IOS)
#ifndef _ASC_USE_ARC_
if (!GetARCEnabled())
[stringURL release];
#endif
#endif
return 1;
}
// 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];
}
#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

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once
@ -115,13 +118,13 @@ namespace NSNetwork
virtual int UploadData() = 0;
public:
std::wstring m_sDownloadFilePath; // Путь к сохраненному файлу на диске
std::wstring m_sDownloadFileUrl;// Ссылка на скачивание файла
std::wstring m_sUploadFilePath; // Путь к файлу для выгрузки на сервер
std::wstring m_sUploadUrl; // URL для выгрузки данных
std::wstring m_sDownloadFilePath; // Path to saved file on disk
std::wstring m_sDownloadFileUrl;// Download file URL
std::wstring m_sUploadFilePath; // Path to file for upload to server
std::wstring m_sUploadUrl; // URL for data upload
bool m_bComplete; // Закачался файл или нет
bool m_bDelete; // Удалять ли файл в деструкторе
bool m_bComplete; // Whether file is downloaded or not
bool m_bDelete; // Delete file in destructor?
typedef enum LoadType
{
@ -130,12 +133,12 @@ namespace NSNetwork
UPLOADDATA
} LoadType;
LoadType m_eLoadType; // Тип загрузки/выгрузки данных/файла
LoadType m_eLoadType; // Load/upload type for data/file
const unsigned char* m_cData; // Данные в сыром виде для выгрузки
int m_nSize; // Размер данных
const unsigned char* m_cData; // Raw data for upload
int m_nSize; // Data size
std::wstring m_sResponse = L""; // Ответ сервера
std::wstring m_sResponse = L""; // Server response
std::function<void(int)> m_func_onComplete = nullptr;
std::function<void(int)> m_func_onProgress = nullptr;
@ -143,13 +146,13 @@ namespace NSNetwork
CSession* m_pSession;
// std::atomic<bool>* m_bIsExit; // Для остановки и выхода потока
// std::atomic<bool>* m_bIsExit; // For stopping and exiting the thread
};
class CFileTransporter_private : public NSThreads::CBaseThread
{
protected:
// создаем в зависимости от платформы
// create depending on platform
CFileTransporterBase* m_pInternal;
public:

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "FileTransporter_private.h"
@ -45,16 +48,16 @@
//------------------------------------------------------------------------------------------------------
// Константа для максимального числа символов в строке
// Constant for maximum number of characters in a string
#define MAX_SIZE 256
// Константа для максимального числа загружаемых байт
// Constant for maximum number of downloadable bytes
#define DOWNLOAD_FILE_SIZE 32768
#define MAX_SINGLE_DOWNLOAD_FILE_SIZE 524288
// Константа для получения размера файла
// Constant for getting file size
#define CONTENT_RANGE L"bytes 0-0/"
// Константа для колличества символов у CONTENT_RANGE
// Constant for CONTENT_RANGE character count
#define CONTENT_RANGE_SIZE ( 11/*sizeof ( CONTENT_RANGE )*/ - 1 )
namespace NSNetwork
@ -134,10 +137,10 @@ namespace NSNetwork
}
protected:
FILE * m_pFile = nullptr; // Хэндл на временный файл
FILE * m_pFile = nullptr; // Handle to temporary file
unsigned int _DownloadFile(std::wstring sFileUrl)
{
// Проверяем состояние соединения
// Check connection state
if ( FALSE == InternetGetConnectedState ( 0, 0 ) )
return S_FALSE;
@ -154,67 +157,67 @@ namespace NSNetwork
m_sDownloadFilePath = std::wstring( sTempFile );
// Открываем сессию
// Open session
HINTERNET hInternetSession = InternetOpenW ( L"Mozilla/4.0 (compatible; MSIE 5.0; Windows 98)", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 );
if ( NULL == hInternetSession )
return S_FALSE;
// Заголовок запроса ( пока содержит 0 байт ( необходимо для проверки ) )
// Request header (currently contains 0 bytes, needed for verification)
std::wstring sHTTPHdr = L"Range: bytes=0-0";
// Открываем ссылку для проверки на ее существование, а также на возможность чтения частями
// Open URL to check its existence and ability to read in chunks
HINTERNET hInternetOpenURL = InternetOpenUrlW ( hInternetSession, sFileUrl.c_str(), sHTTPHdr.c_str(), -1, INTERNET_FLAG_RESYNCHRONIZE, 0 );
if ( NULL != hInternetOpenURL )
{
// Открытие произошло, проверяем ответ
// Opened successfully, check response
if ( TRUE == QueryStatusCode ( hInternetOpenURL, TRUE ) )
{
// Запрос прошел удачно, проверяем возможность чтения частями и получаем размер данных
// Request succeeded, check ability to read in chunks and get data size
LONGLONG nFileSize = IsAccept_Ranges ( hInternetOpenURL );
// Закрываем хендл
// Close handle
InternetCloseHandle ( hInternetOpenURL );
if ( -1 == nFileSize )
{
// Чтение частями недоступно
// Закрываем хендл соединения
// Reading in chunks is not available
// Close connection handle
InternetCloseHandle ( hInternetSession );
// Закрываем файл (сделается на DownloadAll)
// Попробуем записать его целиком
// Close file (will be done in DownloadAll)
// Try to write it entirely
return S_FALSE;
}
else
{
// Чтение частями доступно
// Reading in chunks is available
LONGLONG nStartByte = 0;
while ( true )
{
// Если закачали весь файл - то выходим
// If entire file is downloaded - exit
if ( nStartByte == nFileSize - 1 )
{
// Закрываем хендл соединения
// Close connection handle
InternetCloseHandle ( hInternetSession );
return S_OK;
}
LONGLONG nEndByte = nStartByte + DOWNLOAD_FILE_SIZE;
// Если файл заканчивается, то загружаем меньшее колличество байт ( на 1 меньше, чем размер, т.к. начинается с 0 )
// If file is ending, download fewer bytes (1 less than size, since it starts from 0)
if ( nEndByte >= nFileSize )
nEndByte = nFileSize - 1;
// Буффер для закачки
// Download buffer
BYTE arrBuffer [ DOWNLOAD_FILE_SIZE ] = { 0 };
DWORD dwBytesDownload = DownloadFilePath ( hInternetSession, arrBuffer, nStartByte, nEndByte, sFileUrl );
nStartByte = nEndByte;
if ( -1 == dwBytesDownload )
{
// Ничего не прочиталось - это плохо!!!!
// Закрываем хендл соединения
// Nothing was read - this is bad!!!!
// Close connection handle
InternetCloseHandle ( hInternetSession );
// Закрываем файл (сделается на DownloadAll)
// Попробуем записать его целиком
// Close file (will be done in DownloadAll)
// Try to write it entirely
return S_FALSE;
}
// Пишем в файл
// Write to file
::fwrite( (BYTE*)arrBuffer, 1, dwBytesDownload, m_pFile );
::fflush( m_pFile );
@ -224,62 +227,62 @@ namespace NSNetwork
}
else
{
// Закрываем хендл соединения
// Close connection handle
InternetCloseHandle ( hInternetSession );
// Закрываем файл (сделается на DownloadAll)
// Попробуем записать его целиком
// Close file (will be done in DownloadAll)
// Try to write it entirely
return S_FALSE;
}
}
else
{
// Закрываем хендл соединения
// Close connection handle
InternetCloseHandle ( hInternetSession );
// Закрываем файл (сделается на DownloadAll)
// Попробуем записать его целиком
// Close file (will be done in DownloadAll)
// Try to write it entirely
return S_FALSE;
}
// Закрываем хендл соединения
// Close connection handle
InternetCloseHandle ( hInternetSession );
return S_OK;
}
DWORD DownloadFilePath ( HINTERNET hInternet, LPBYTE pBuffer, LONGLONG nStartByte, LONGLONG nEndByte, std::wstring sFileURL )
{
// Неоткрытая сессия
// Session not opened
if ( NULL == hInternet )
return -1;
// Пришли непонятные параметры
// Invalid parameters received
if ( nStartByte > nEndByte || !pBuffer )
return -1;
// Заголовок запроса ( содержит nEndByte - nStartByte байт )
// Request header (contains nEndByte - nStartByte bytes)
std::wstring sHTTPHdr = L"Range: bytes=" + std::to_wstring(nStartByte) + L"-" + std::to_wstring(nEndByte);
// Открываем ссылку для закачки
// Open URL for download
HINTERNET hInternetOpenURL = InternetOpenUrlW ( hInternet, sFileURL.c_str(), sHTTPHdr.c_str(), -1, INTERNET_FLAG_RESYNCHRONIZE, 0 );
if ( NULL == hInternetOpenURL )
return -1;
// Открытие произошло, проверяем ответ
// Opened successfully, check response
if ( FALSE == QueryStatusCode ( hInternetOpenURL, TRUE ) )
{
// Закрываем хендл соединения
// Close connection handle
InternetCloseHandle ( hInternetOpenURL );
return -1;
}
// Какое колличество байт прочитано
// Number of bytes read
DWORD dwBytesRead = 0;
// Читаем файл
// Read file
if ( FALSE == InternetReadFile ( hInternetOpenURL, pBuffer, DOWNLOAD_FILE_SIZE, &dwBytesRead ) )
{
// Закрываем хендл соединения
// Close connection handle
InternetCloseHandle ( hInternetOpenURL );
return -1;
}
// Закрываем хендл соединения
// Close connection handle
InternetCloseHandle ( hInternetOpenURL );
return dwBytesRead;
@ -287,93 +290,93 @@ namespace NSNetwork
BOOL QueryStatusCode ( HINTERNET hInternet, BOOL bIsRanges )
{
// Зачем проверять у неоткрытой сессии что-то
// Why check anything for an unopened session
if ( NULL == hInternet )
return FALSE;
// Результат ответа
// Response result
INT nResult = 0;
// Размер данных ответа ( должно быть = 4 )
// Response data size (should be = 4)
DWORD dwLengthDataSize = 4;
// Делаем запрос, если не проходит - то возвращаем FALSE
// Make request, if it fails - return FALSE
if ( FALSE == HttpQueryInfo ( hInternet, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &nResult, &dwLengthDataSize, NULL ) )
return FALSE;
// Запрос прошел, теперь проверяем код ответа
// Request succeeded, now check response code
if ( HTTP_STATUS_NOT_FOUND == nResult )
{
// Объект не найден, плохая ссылка или что-то еще
// Object not found, bad link or something else
return FALSE;
}
else if ( ( HTTP_STATUS_OK != nResult && FALSE == bIsRanges ) || ( HTTP_STATUS_PARTIAL_CONTENT != nResult && TRUE == bIsRanges ) )
{
// Запрос не прошел по какой-то причине
// Request failed for some reason
return FALSE;
}
// Все отлично, запрос прошел
// Everything is fine, request succeeded
return TRUE;
}
// Проверяет, доступно ли для ресурса чтение частями и возвращает -1 если не доступно и размер данных, если доступно
// Checks if resource supports reading in chunks and returns -1 if not available, or data size if available
LONGLONG IsAccept_Ranges ( HINTERNET hInternet )
{
// Зачем проверять у неоткрытой сессии что-то
// Why check anything for an unopened session
if ( NULL == hInternet )
return -1;
// Результат ответа
// Response result
wchar_t arrResult [ MAX_SIZE ] = { 0 };
// Размер данных ответа
// Response data size
DWORD dwLengthDataSize = sizeof ( arrResult );
// Делаем запрос, если не проходит - то возвращаем FALSE
// Make request, if it fails - return FALSE
if ( FALSE == HttpQueryInfoW ( hInternet, HTTP_QUERY_CONTENT_RANGE, &arrResult, &dwLengthDataSize, NULL ) )
{
// Получаем последнюю ошибку
// Get last error
DWORD dwLastError = GetLastError ();
if ( dwLastError == ERROR_HTTP_HEADER_NOT_FOUND )
{
// Не пришел заголовок, значит ресурс не поддерживает чтение частями
// Header not received, resource doesn't support reading in chunks
return -1;
}
// Возникла какая-то другая ошибка - возвращаем FALSE
// Some other error occurred - return FALSE
return -1;
}
// Если размер 0, то заголовка нет
// If size is 0, there is no header
if ( 0 >= dwLengthDataSize )
return -1;
// Приведем к std::wstring
// Convert to std::wstring
std::wstring strResult ( arrResult );
// Содержит размер данных
// Contains data size
LONGLONG nFileSize = 0;
try
{
// Ищем индекс размера данных в строке
// Find data size index in string
INT nStartIndex = (INT)strResult.find ( CONTENT_RANGE );
if ( -1 == nStartIndex )
return -1;
// Оставляем в строке только размер данных
// Leave only data size in string
strResult = strResult.substr( nStartIndex + CONTENT_RANGE_SIZE );
// Теперь получим размер данных, переводя стринг в LONGLONG
// Now get the data size by converting string to LONGLONG
nFileSize = _wtoi64 ( strResult.c_str() );
// Т.к. реально нумерация с 0 ( поэтому добавляем еще 1 байт )
// Since numbering starts from 0 (so we add 1 more byte)
if ( 0 < nFileSize )
nFileSize += 1;
}
catch ( ... )
{
// не нашли возвращаем ошибку
// not found, return error
return -1;
}
// Все отлично, ресурс поддерживает чтение частями, возвращаем размер
// All good, resource supports partial reading, return size
return nFileSize;
}
@ -388,7 +391,7 @@ namespace NSNetwork
DownloadProgress progress;
progress.func_checkAborted = m_check_aborted;
progress.func_onProgress = m_func_onProgress;
// Скачиваем файл с возвратом процентов состояния
// Download file with progress percentage callback
return URLDownloadToFileW (NULL, sFileURL.c_str(), strFileOutput.c_str(), NULL, static_cast<IBindStatusCallback*>(&progress));
}

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once
#include "Session.h"

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include <list>

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include <iostream>

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef _WEB_SOCKET_H_

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "ixwebsocket_internal.h"

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef _IX_WEB_SOCKET_H_

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "./../include/websocket.h"

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "socketio_internal_private.h"

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef _IO_WEB_SOCKET_H_

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once
@ -46,7 +49,7 @@ namespace NSNetwork
{
public:
std::shared_ptr<sio::client> m_socket;
// проблема закрытия сокета, пока он не приконнектился
// problem closing socket while it's not yet connected
bool m_connecting_in_process;
bool m_closing_in_progress;
@ -136,7 +139,7 @@ namespace NSNetwork
if (!message)
return;
// TODO: пока только текстовые и json команды
// TODO: for now only text and json commands
switch (message->get_flag())
{
case sio::message::flag_null:
@ -208,7 +211,7 @@ namespace NSNetwork
{
//CTemporaryCS (&m_internal->m_oCS);
// если json -то надо объект
// if json - then need object
if (0 == message_str.find("{") ||
0 == message_str.find("["))
{

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
///////////////////////////////////////////////////////////
@ -50,7 +53,7 @@ namespace NSNetwork
{
public:
std::shared_ptr<sio_no_tls::client> m_socket;
// проблема закрытия сокета, пока он не приконнектился
// problem closing socket while it's not yet connected
bool m_connecting_in_process;
bool m_closing_in_progress;
@ -125,7 +128,7 @@ namespace NSNetwork
if (!message)
return;
// TODO: пока только текстовые и json команды
// TODO: for now only text and json commands
switch (message->get_flag())
{
case sio_no_tls::message::flag_null:
@ -197,7 +200,7 @@ namespace NSNetwork
{
//CTemporaryCS (&m_internal->m_oCS);
// если json -то надо объект
// if json - then need object
if (0 == message_str.find("{") ||
0 == message_str.find("["))
{

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef _SOCKET_ROCKET_H_

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "socketRocket_internal.h"

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef _SOCKET_ROCKET_OBJC_H_

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef _WEB_WORKER_BASE_H_

View File

@ -1,3 +1,36 @@
# Copyright (C) Ascensio System SIA, 2009-2026
#
# This program is a free software product. You can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License (AGPL)
# version 3 as published by the Free Software Foundation, together with the
# additional terms provided in the LICENSE file.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
# details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
#
# You can contact Ascensio System SIA by email at info@onlyoffice.com
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
# LV-1050, Latvia, European Union.
#
# The interactive user interfaces in modified versions of the Program
# are required to display Appropriate Legal Notices in accordance with
# Section 5 of the GNU AGPL version 3.
#
# No trademark rights are granted under this License.
#
# All non-code elements of the Product, including illustrations,
# icon sets, and technical writing content, are licensed under the
# Creative Commons Attribution-ShareAlike 4.0 International License:
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
#
# This license applies only to such non-code elements and does not
# modify or replace the licensing terms applicable to the Program's
# source code, which remains licensed under the GNU Affero General
# Public License v3.
#
# SPDX-License-Identifier: AGPL-3.0-only
core_mac:CONFIG += apple_platform
core_ios:CONFIG += apple_platform

View File

@ -1,3 +1,36 @@
# Copyright (C) Ascensio System SIA, 2009-2026
#
# This program is a free software product. You can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License (AGPL)
# version 3 as published by the Free Software Foundation, together with the
# additional terms provided in the LICENSE file.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
# details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
#
# You can contact Ascensio System SIA by email at info@onlyoffice.com
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
# LV-1050, Latvia, European Union.
#
# The interactive user interfaces in modified versions of the Program
# are required to display Appropriate Legal Notices in accordance with
# Section 5 of the GNU AGPL version 3.
#
# No trademark rights are granted under this License.
#
# All non-code elements of the Product, including illustrations,
# icon sets, and technical writing content, are licensed under the
# Creative Commons Attribution-ShareAlike 4.0 International License:
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
#
# This license applies only to such non-code elements and does not
# modify or replace the licensing terms applicable to the Program's
# source code, which remains licensed under the GNU Affero General
# Public License v3.
#
# SPDX-License-Identifier: AGPL-3.0-only
TARGET = kernel_network
TEMPLATE = lib

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifndef _OFFICEDEFINES_H_
#define _OFFICEDEFINES_H_
@ -54,19 +57,19 @@ namespace EncodingType
const int BigEndian = 51;
}
#define PERMISSION_PRINT ( 1 << 2 ) // Ограничение печати документа
#define PERMISSION_CHANGE ( 1 << 3 ) // Ограничение на изменение содержимого документа (текст, графика, картинки)
#define PERMISSION_COPY ( 1 << 4 ) // Ограничение на копирование документа и его содержимого
#define PERMISSION_PRINT ( 1 << 2 ) // Restriction on document printing
#define PERMISSION_CHANGE ( 1 << 3 ) // Restriction on changing document content (text, graphics, images)
#define PERMISSION_COPY ( 1 << 4 ) // Restriction on copying document and its content
//Тип печати
const int c_nPrintTypeFit = 0; //вписывать по аспекту
const int c_nPrintTypeStrech = 1; //растягивать
const int c_nPrintType100 = 2; // печатать как есть
//пример xml для функции PrintPage <PrintSettings><Mode ZoomEnable=\"0\" RotateEnable=\"0\" PrintableAreaEnable=\"0\">%d</Mode></PrintSettings>
//enable - 0; diable - 1 ( если атрибут не задан, то он берется как 0 )
//ZoomEnable растягивать любой документ до размеров страницы
//RotateEnable поворачивать документ,если в повернутом состоянии он будет занимать большую площадь(например при c_nPrintType100) или если в обычном состоянии он не вписывает, а в повернутом вписывается
//PrintableAreaEnable печать только в области печати принтера
//Print type
const int c_nPrintTypeFit = 0; //fit by aspect ratio
const int c_nPrintTypeStrech = 1; //stretch
const int c_nPrintType100 = 2; // print as is
//xml example for PrintPage function <PrintSettings><Mode ZoomEnable=\"0\" RotateEnable=\"0\" PrintableAreaEnable=\"0\">%d</Mode></PrintSettings>
//enable - 0; disable - 1 (if attribute is not set, it defaults to 0)
//ZoomEnable stretch any document to page size
//RotateEnable rotate document if rotated state takes more area (e.g. with c_nPrintType100) or if normal state doesn't fit but rotated does
//PrintableAreaEnable print only in printer's printable area
namespace TextFormatting
{
@ -75,7 +78,7 @@ namespace TextFormatting
const int c_nWordProcessing = 2;
}
//additional param сохранения нескольких документов в один для IAVSOfficeFileConverter
//additional param for saving multiple documents into one for IAVSOfficeFileConverter
const int c_nSaveModeNone = 0;
const int c_nSaveModeStart = 1;
const int c_nSaveModeContinue = 2;

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once
@ -48,39 +51,39 @@
// AVSOfficeUniversalConverter 0x0050 - 0x0075
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST (AVS_ERROR_FIRST + 0x0050)
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_XML_FORMAT (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0001) //Входная XML имеет неправильный формат
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_TEMP_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0002) //Ошибка при создании темповой директории
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_REMOVE_TEMP_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0003) //Ошибка при удалении темповой директории
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CONVERT_THIS_FORMATS (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Не поддерживается конвертация данных типов файлов
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_LOAD_FILE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Не поддерживается конвертация данных типов файлов
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_SAVE_FILE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Не поддерживается конвертация данных типов файлов
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_ADVERTISE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0005) //при добавлении рекламы
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_COPY (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0006) //ошибка при копировании source в destination( копируются когда их тип совпадает )
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_EXTR_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0007) //ошибка при копировании source в destination( копируются когда их тип совпадает )
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_XML_FORMAT (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0001) //Input XML has incorrect format
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_TEMP_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0002) //Error creating temp directory
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_REMOVE_TEMP_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0003) //Error removing temp directory
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CONVERT_THIS_FORMATS (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Conversion of these file types is not supported
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_LOAD_FILE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Conversion of these file types is not supported
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_SAVE_FILE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0004) //Conversion of these file types is not supported
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_ADVERTISE (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0005) //when adding advertisement
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_COPY (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0006) //error copying source to destination (copied when their types match)
#define AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_CREATE_EXTR_DIR (AVS_UNIVERSALDOCUMENTCONVERTER_ERROR_FIRST + 0x0007) //error copying source to destination (copied when their types match)
// AVSOfficeFile 0x0075 - 0x00100
#define AVS_OFFICEFILE_ERROR_FIRST (AVS_ERROR_FIRST + 0x0075)
#define AVS_OFFICEFILE_ERROR_CREATE_TEMP (AVS_OFFICEFILE_ERROR_FIRST + 0x0001) //Ошибка при создании темповой директории или файла
#define AVS_OFFICEFILE_ERROR_UNSUPPORTED_LOAD_FORMAT (AVS_OFFICEFILE_ERROR_FIRST + 0x0002) //Формат файла не поддерживается
#define AVS_OFFICEFILE_ERROR_UNSUPPORTED_SAVE_FORMAT (AVS_OFFICEFILE_ERROR_FIRST + 0x0003) //Формат файла не поддерживается
#define AVS_OFFICEFILE_ERROR_SAVE_EMPTY (AVS_OFFICEFILE_ERROR_FIRST + 0x0004) //Формат файла не поддерживается
#define AVS_OFFICEFILE_ERROR_PRINT_OUT_OF_AREA (AVS_OFFICEFILE_ERROR_FIRST + 0x0005) //печать за границами области печати
#define AVS_OFFICEFILE_ERROR_CREATE_TEMP (AVS_OFFICEFILE_ERROR_FIRST + 0x0001) //Error creating temp directory or file
#define AVS_OFFICEFILE_ERROR_UNSUPPORTED_LOAD_FORMAT (AVS_OFFICEFILE_ERROR_FIRST + 0x0002) //File format is not supported
#define AVS_OFFICEFILE_ERROR_UNSUPPORTED_SAVE_FORMAT (AVS_OFFICEFILE_ERROR_FIRST + 0x0003) //File format is not supported
#define AVS_OFFICEFILE_ERROR_SAVE_EMPTY (AVS_OFFICEFILE_ERROR_FIRST + 0x0004) //File format is not supported
#define AVS_OFFICEFILE_ERROR_PRINT_OUT_OF_AREA (AVS_OFFICEFILE_ERROR_FIRST + 0x0005) //printing outside of print area
//AVSOfficeMsFile
#define AVS_MSFILE_ERROR_OLDER (AVS_ERROR_FIRST + 0x0090)
// AVSOdfFile 0x0100 - 0x0200
#define AVS_ODTFILE_ERROR_INPUT_FILE (AVS_ERROR_FIRST + 0x0100) // Ошибка в входном файле
#define AVS_ODTFILE_ERROR_ORIGIN_FILE (AVS_ERROR_FIRST + 0x0101) // Ошибка в шаблоном файле
#define AVS_ODTFILE_ERROR_CONVERT (AVS_ERROR_FIRST + 0x0102) // Ошибка при конвертации
#define AVS_ODTFILE_ERROR_INPUT_FILE (AVS_ERROR_FIRST + 0x0100) // Error in input file
#define AVS_ODTFILE_ERROR_ORIGIN_FILE (AVS_ERROR_FIRST + 0x0101) // Error in template file
#define AVS_ODTFILE_ERROR_CONVERT (AVS_ERROR_FIRST + 0x0102) // Error during conversion
// AVSTxtFile 0x0200 - 0x0300
#define AVS_TXTFILE_ERROR_INPUT_FILE (AVS_ERROR_FIRST + 0x0200) // Ошибка в входном файле
#define AVS_TXTFILE_ERROR_ORIGIN_FILE (AVS_ERROR_FIRST + 0x0201) // Ошибка в шаблоном файле
#define AVS_TXTFILE_ERROR_CONVERT (AVS_ERROR_FIRST + 0x0202) // Ошибка при конвертации
#define AVS_TXTFILE_ERROR_INPUT_FILE (AVS_ERROR_FIRST + 0x0200) // Error in input file
#define AVS_TXTFILE_ERROR_ORIGIN_FILE (AVS_ERROR_FIRST + 0x0201) // Error in template file
#define AVS_TXTFILE_ERROR_CONVERT (AVS_ERROR_FIRST + 0x0202) // Error during conversion
// AVSOfficePDFWriter 0x0300 - 0x0400

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#include "OfficeFileFormatChecker.h"
@ -113,7 +116,7 @@ bool COfficeFileFormatChecker::isMultiPartsHtmlFormatFile(unsigned char *pBuffer
return false;
const char *contentTypeFormatLine1 = "Content-Type: multipart/related";
const char *contentTypeFormatLine2 = "Content-Type: text/html"; // может быть и вне заданого буфера (todooo)
const char *contentTypeFormatLine2 = "Content-Type: text/html"; // may be outside the given buffer (todooo)
std::string xml_string((char *)pBuffer, dwBytes);
@ -706,7 +709,7 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
std::wstring fileName = _fileName;
#endif
// приоритет как оказывается важен
// priority turns out to be important
// Metamorphic Manual for windows 28415.doc
POLE::Storage storage(fileName.c_str());
if (storage.open())
@ -719,7 +722,7 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
}
else if (isDocFormatFile(&storage))
{
// nFileType внутри
// nFileType inside
return true;
}
else if (isXlsFormatFile(&storage))
@ -930,7 +933,7 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
//------------------------------------------------------------------------------------------------
if (iXmlFile(fileName))
{
// nFileType внутри
// nFileType inside
return true;
}
//// by Extension
@ -978,7 +981,7 @@ bool COfficeFileFormatChecker::isOfficeFile(const std::wstring &_fileName)
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML;
else if (0 == sExt.compare(L".bin")) // base64 string
nFileType = AVS_OFFICESTUDIO_FILE_CANVAS_PDF;
else if (0 == sExt.compare(L".doct")) // случай архива с html viewer
else if (0 == sExt.compare(L".doct")) // case of archive with html viewer
nFileType = AVS_OFFICESTUDIO_FILE_TEAMLAB_DOCY;
else if (0 == sExt.compare(L".txt") || 0 == sExt.compare(L".xml") || 0 == sExt.compare(L".rtf") || 0 == sExt.compare(L".doc") || 0 == sExt.compare(L".docx"))
nFileType = AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT;
@ -1168,7 +1171,7 @@ bool COfficeFileFormatChecker::isDocFormatFile(const std::wstring &fileName)
{
if (isDocFormatFile(&storage))
{
// nFileType внутри;
// nFileType inside;
return true;
}
}
@ -1191,7 +1194,7 @@ bool COfficeFileFormatChecker::isOnlyOfficeFormatFile(const std::wstring &fileNa
{
COfficeUtils OfficeUtils(NULL);
ULONG nBufferSize = 128; // ограничим считывание из бинарника
ULONG nBufferSize = 128; // limit reading from binary
BYTE *pBuffer = NULL;
HRESULT hresult = OfficeUtils.LoadFileFromArchive(fileName, L"Editor.bin", &pBuffer, nBufferSize);
@ -1541,7 +1544,7 @@ bool COfficeFileFormatChecker::isOpenOfficeFormatFile(const std::wstring &fileNa
}
else
{
// если не записан тип смотрим манифест
// if type is not written, check manifest
nBufferSize = 0;
HRESULT hresult = OfficeUtils.LoadFileFromArchive(fileName, L"META-INF/manifest.xml", &pBuffer, nBufferSize);
if (hresult == S_OK && pBuffer != NULL)

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#pragma once
@ -131,7 +134,7 @@
#define AVS_OFFICESTUDIO_FILE_OTHER_OLD_PRESENTATION AVS_OFFICESTUDIO_FILE_OTHER + 0x0005
#define AVS_OFFICESTUDIO_FILE_OTHER_OLD_DRAWING AVS_OFFICESTUDIO_FILE_OTHER + 0x0006
#define AVS_OFFICESTUDIO_FILE_OTHER_OOXML AVS_OFFICESTUDIO_FILE_OTHER + 0x0007
#define AVS_OFFICESTUDIO_FILE_OTHER_JSON AVS_OFFICESTUDIO_FILE_OTHER + 0x0008 // Для mail-merge
#define AVS_OFFICESTUDIO_FILE_OTHER_JSON AVS_OFFICESTUDIO_FILE_OTHER + 0x0008 // For mail-merge
#define AVS_OFFICESTUDIO_FILE_OTHER_ZIP AVS_OFFICESTUDIO_FILE_OTHER + 0x0009
#define AVS_OFFICESTUDIO_FILE_OTHER_ODF AVS_OFFICESTUDIO_FILE_OTHER + 0x000a
#define AVS_OFFICESTUDIO_FILE_OTHER_MS_MITCRYPTO AVS_OFFICESTUDIO_FILE_OTHER + 0x000b

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
// OfficeFileTemplate.h : Declaration of the CAVSOfficeFileTemplate

View File

@ -1,33 +1,36 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
* Copyright (C) Ascensio System SIA, 2009-2026
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
* version 3 as published by the Free Software Foundation, together with the
* additional terms provided in the LICENSE file.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
* You can contact Ascensio System SIA by email at info@onlyoffice.com
* or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
* LV-1050, Latvia, European Union.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* The interactive user interfaces in modified versions of the Program
* are required to display Appropriate Legal Notices in accordance with
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
* No trademark rights are granted under this License.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
* All non-code elements of the Product, including illustrations,
* icon sets, and technical writing content, are licensed under the
* Creative Commons Attribution-ShareAlike 4.0 International License:
* https://creativecommons.org/licenses/by-sa/4.0/legalcode
*
* This license applies only to such non-code elements and does not
* modify or replace the licensing terms applicable to the Program's
* source code, which remains licensed under the GNU Affero General
* Public License v3.
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
#ifdef _MSC_VER
#pragma once // for MSVS

View File

@ -1,3 +1,36 @@
# Copyright (C) Ascensio System SIA, 2009-2026
#
# This program is a free software product. You can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License (AGPL)
# version 3 as published by the Free Software Foundation, together with the
# additional terms provided in the LICENSE file.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
# details, see the GNU AGPL at: https://www.gnu.org/licenses/agpl-3.0.html
#
# You can contact Ascensio System SIA by email at info@onlyoffice.com
# or by postal mail at 20A-6 Ernesta Birznieka-Upisha Street, Riga,
# LV-1050, Latvia, European Union.
#
# The interactive user interfaces in modified versions of the Program
# are required to display Appropriate Legal Notices in accordance with
# Section 5 of the GNU AGPL version 3.
#
# No trademark rights are granted under this License.
#
# All non-code elements of the Product, including illustrations,
# icon sets, and technical writing content, are licensed under the
# Creative Commons Attribution-ShareAlike 4.0 International License:
# https://creativecommons.org/licenses/by-sa/4.0/legalcode
#
# This license applies only to such non-code elements and does not
# modify or replace the licensing terms applicable to the Program's
# source code, which remains licensed under the GNU Affero General
# Public License v3.
#
# SPDX-License-Identifier: AGPL-3.0-only
VERSION = $$cat(version.txt)
PRODUCT_VERSION = $$(PRODUCT_VERSION)
@ -478,6 +511,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 {

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