Compare commits

...

254 Commits

Author SHA1 Message Date
447e1f5ccc Fix for snapshots 2024-08-28 13:08:06 +03:00
06ee659edc Fixwork with replaceAll function 2024-08-27 23:07:25 +03:00
fe35178e26 Add support snapshots 2024-08-27 22:52:05 +03:00
13590d4c2e Refactoring work with cache 2024-08-27 13:04:20 +03:00
84fc9f876e Add flag for fonts generation 2024-08-26 13:56:36 +03:00
c4530caac1 Merge pull request #1623 from ONLYOFFICE/release/v8.2.0
Release/v8.2.0
2024-08-21 04:17:49 -07:00
c018d57081 fix bug #69634 2024-08-21 12:52:16 +03:00
43f49b7a9d fix bug #69775 2024-08-21 12:14:48 +03:00
f8e19a7f0b Merge pull request #1620 from ONLYOFFICE/fix/bug-69767
Fix bug #69767
2024-08-20 05:39:52 -07:00
f245985bbd fix bug #69774 2024-08-20 11:29:57 +03:00
68171df991 Merge branch 'release/v8.2.0' of https://github.com/ONLYOFFICE/core into release/v8.2.0 2024-08-20 11:27:58 +03:00
bbf4003ec7 Refactoring 2024-08-20 11:00:12 +03:00
75cc7d8457 Fix bug #69767 2024-08-20 10:59:32 +03:00
7018402a58 Merge pull request #1619 from ONLYOFFICE/fix/pdf-bugs
Fix pdf bugs
2024-08-20 00:04:03 -07:00
6ce30ccaad Fix test 2024-08-20 09:23:10 +03:00
670677c23b Fix pdf clip 2024-08-20 09:22:39 +03:00
208f6efcc5 fix bug #69781 2024-08-20 08:39:42 +03:00
685165d270 fix bug #69780 2024-08-20 08:39:02 +03:00
f18eb2ef5b Developing 2024-08-20 00:23:59 +03:00
facdff46fe Refactoring 2024-08-19 18:24:06 +03:00
8843c3dd36 Merge pull request #1617 from ONLYOFFICE/feature/docbuilder-java
Add JAVA_HOME environment variable support when compiling docbuilder Java-wrapper
2024-08-19 04:50:27 -07:00
2708479152 Add class for embed pdf object 2024-08-19 13:57:26 +03:00
f3facfa8e8 Fix for some JDK versions 2024-08-19 14:13:19 +04:00
1e26e1723a For buf 59297 2024-08-19 12:57:30 +03:00
6d9242e1dd Add building support for JDK > 8 2024-08-19 13:49:43 +04:00
e8de8dc03b fix bug #60796 2024-08-16 17:39:11 +03:00
57447f757f Merge pull request #1618 from ONLYOFFICE/fix/pdf-time
Fix pdf clip
2024-08-16 04:24:27 -07:00
46d6eaa793 Fix test Save/Restore graphics 2024-08-16 13:35:03 +03:00
def502c7eb Refactoring drawingfile (native realization support) 2024-08-15 22:00:37 +03:00
1e5e43cbe5 Fix clip 2024-08-15 16:59:00 +03:00
60a888fc19 Fix PdfFile test 2024-08-15 16:58:39 +03:00
01ca25d798 Fix test 2024-08-15 16:58:20 +03:00
6812ebaa42 fix bug #68293 2024-08-15 10:46:06 +03:00
aacb2842f7 Fix typo 2024-08-14 16:39:41 +04:00
27a2a47cbe Fixes 2024-08-14 16:35:22 +04:00
02f8178c01 Merge pull request #1616 from ONLYOFFICE/fix/bug65304
Fix bug 65304
2024-08-14 01:55:26 -07:00
a0e2384409 fix bug #69490 2024-08-13 21:33:51 +03:00
56088e9eff Add support for JAVA_HOME environment variable 2024-08-13 20:44:46 +04:00
1d6b895496 Refactoring 2024-08-13 16:32:41 +03:00
fa4b8c8d76 Fix build 2024-08-13 11:40:51 +03:00
2db2b98c8f Fix bug 65304 2024-08-13 10:54:23 +03:00
f45fb3c6be for bug #69599 2024-08-13 09:40:06 +03:00
6f60d75863 Fix build 2024-08-13 00:24:51 +03:00
d1acdf35d8 Refactoring 2024-08-13 00:16:51 +03:00
a1bf6a76ed fix bug #69658 2024-08-12 19:25:27 +03:00
3634d59ece Merge branch 'release/v8.2.0' of https://github.com/ONLYOFFICE/core into release/v8.2.0 2024-08-12 19:07:54 +03:00
1b21e8f136 fix bug #69647 2024-08-12 19:07:07 +03:00
554ca5ec7c Merge pull request #1615 from ONLYOFFICE/fix/docbuilder-script-cache
Fix script caching on Windows
2024-08-12 08:15:16 -07:00
dc2e0edf80 fix bug #25787 2024-08-12 18:13:52 +03:00
e38fa336d2 Fix script caching with v8_89 2024-08-12 17:32:14 +04:00
357450f242 Merge pull request #1614 from ONLYOFFICE/fix/html
Fix html to ooxml conversion
2024-08-12 03:20:37 -07:00
4ed9925aff Merge pull request #1610 from ONLYOFFICE/feature/MetafileSize
The size setting of metafiles has been changed
2024-08-12 03:20:17 -07:00
796537565b Fixed unnecessary use of standard styles in html to ooxml conversion 2024-08-09 15:43:55 +03:00
fcf8e28ae8 Added tabs to the text in html to ooxml conversion 2024-08-09 15:27:29 +03:00
de949afbb6 fix bug #69618 2024-08-09 12:33:40 +03:00
fb7bb041c1 Merge pull request #1613 from ONLYOFFICE/fix/pdf-leaks
Fix pdf leaks, clip and read jpeg
2024-08-09 02:03:52 -07:00
8d6e15627b Refactoring RenderOutputDev and test diff 2024-08-08 18:42:43 +03:00
0583cbb5cc Merge branch 'release/v8.2.0' of https://github.com/ONLYOFFICE/core into release/v8.2.0 2024-08-08 17:31:35 +03:00
a68bec86df Improved html to ooxml conversion 2024-08-08 16:05:19 +03:00
6554185ec7 Refacroting DrawImage 2024-08-07 18:07:12 +03:00
22bbde155d fix bug #44738 2024-08-07 12:03:23 +03:00
4a123d33ea fix bug #69552 2024-08-07 08:18:32 +03:00
c7d0f27f6b Fix ReadImage 2024-08-06 18:59:28 +03:00
f1ddd51164 Add support /* comments in script files 2024-08-06 18:08:47 +03:00
1d636b717f [x2t] Fix bug 69574 2024-08-06 15:53:40 +03:00
c026f33aa7 Improved html to ooxml conversion 2024-08-06 15:47:58 +03:00
29e5769d6d fix bug #30042 2024-08-06 10:54:09 +03:00
6586fc39ee Merge pull request #1612 from ONLYOFFICE/feature/gradients
Feature/gradients
2024-08-05 11:50:27 -07:00
e8c7a4f670 Fix ReadDCT 2024-08-05 18:14:56 +03:00
ead6b305b2 Create ReadDCT for jpeg image in pdf 2024-08-05 16:36:50 +03:00
2de6a6d199 Merge pull request #1611 from ONLYOFFICE/feature/docbuilder-java
Feature/docbuilder java
2024-08-05 05:38:52 -07:00
c6ca99994b Fix build into JAR on mac and linux 2024-08-02 19:35:13 +04:00
b707510c88 Remove explicit workDirectory setting 2024-08-02 18:38:40 +04:00
7171dcb9f0 Set library path at runtime
Now there is no need to pass `-D...` parameter to run java program
2024-08-02 18:26:15 +04:00
49dedc7a6d fix bug #69392 2024-08-02 16:43:20 +03:00
431fa060c4 fix bug #69488 2024-08-02 16:10:50 +03:00
0fc5133d98 Fix for building test example 2024-08-02 16:05:08 +04:00
8d5fc7d6ca Fix build for JDK 8 and force build into JAR 2024-08-02 15:58:13 +04:00
3221d20d81 Remove docbuilder_jni_utils helper library 2024-08-02 12:36:17 +04:00
9fdb81554a fix bug #69518 2024-08-02 10:58:01 +03:00
95a1983e75 Refactoring RendererOutputDev 2024-08-01 18:59:19 +03:00
c27aa4d807 Improved html to ooxml conversion 2024-08-01 13:54:07 +03:00
c4f8c524b5 Merge remote-tracking branch 'origin/release/v8.2.0' into fix/pdf-leaks 2024-08-01 12:32:12 +03:00
f7d55c08d8 fix bug #69474 2024-07-31 21:56:23 +03:00
4cfb8cc97a fix bug #69104 2024-07-31 21:51:15 +03:00
a41ecb0715 for bug #69405 2024-07-31 21:32:50 +03:00
faa9e5e640 Merge pull request #1608 from ONLYOFFICE/fix/bug-65822
For bug 65822
2024-07-31 05:40:58 -07:00
ac2ee1b56d Save line AP 2024-07-31 14:01:34 +03:00
b722238d21 Draw AP for markup annots 2024-07-31 14:00:24 +03:00
83e20057f4 Merge pull request #1607 from ONLYOFFICE/feature/docx-renderer
Feature/docx renderer
2024-07-30 10:34:35 -07:00
373786fca6 Update Clip 2024-07-30 18:35:57 +03:00
0fa1b4feec Add return 0/1 for builder external scripts 2024-07-30 11:47:13 +03:00
6a6204ae33 Fix add to conts & highlights 2024-07-30 11:35:39 +03:00
f02147b97c Fix jar build 2024-07-30 12:25:54 +04:00
88b1660735 Add another way to load native libraries 2024-07-30 11:36:47 +04:00
f5f7cb1aec . 2024-07-29 22:13:28 +03:00
af01306997 . 2024-07-29 21:58:34 +03:00
ef30a30e00 Fix first word width in splitted lines 2024-07-29 20:33:20 +03:00
16ae48ef4e Fix memory leaks 2024-07-29 17:56:48 +03:00
0eb8c93cf9 Merge pull request #1606 from ONLYOFFICE/fix/bug66692
Fix bug #66692
2024-07-29 14:50:16 +03:00
c98285ffef Merge pull request #1605 from ONLYOFFICE/fix/bug66675
Fix bug #66675
2024-07-29 14:50:03 +03:00
4b99c4179b Fixed inaccuracies when converting html to ooxml elements big and small 2024-07-29 12:39:51 +03:00
e98dec952f Fix build 2024-07-26 21:43:43 +03:00
8b2d7035c1 Add build to JAR 2024-07-26 19:42:37 +04:00
234def9cd7 Autowrap function arguments
+ Add constructor from Java arrays
2024-07-26 19:10:32 +04:00
ce92766ef6 Fix paths 2024-07-26 17:16:06 +03:00
59c95c5039 Merge pull request #1597 from ONLYOFFICE/feature/pdf-layer
Feature pdf layer
2024-07-26 07:05:38 -07:00
a23002225a Merge pull request #1598 from ONLYOFFICE/fix/bug-59297
Feature pdf headings
2024-07-26 07:03:52 -07:00
cb64a5a266 Fix bug #66675 2024-07-26 16:51:24 +06:00
65483d0460 fix bug #69395 2024-07-26 13:31:16 +03:00
41758f0552 Merge pull request #1604 from ONLYOFFICE/feature/docx-renderer
Fix bug with spacing
2024-07-26 02:30:17 -07:00
bfd790ba11 Fix bug with spacing 2024-07-26 12:26:59 +03:00
81d9e3cfd7 Merge pull request #1603 from ONLYOFFICE/feature/docx_renderer
Feature/docx renderer
2024-07-26 01:42:31 -07:00
2920527898 Reformat code 2024-07-26 11:40:01 +03:00
7013fdcb8d Merge branch hotfix/v8.1.1 into release/v8.2.0 2024-07-26 08:05:06 +00:00
0d84e22e79 Fix spaces more 2024-07-25 19:13:29 +03:00
f2acef6bb2 Add docbuilder.utils.Utils class to edit PATH on Windows 2024-07-25 20:06:11 +04:00
84b8850a52 Fix bug with spaces 2024-07-25 16:12:40 +03:00
b2a3de852a Fix bug #66692 2024-07-25 17:51:20 +06:00
a8fa59d64d Added ruby support and bug fixes 2024-07-25 14:44:20 +03:00
59b84f26ee Merge remote-tracking branch 'origin/fix/bug68344' into release/v8.2.0 2024-07-25 10:44:47 +03:00
5b17009fb9 Merge remote-tracking branch 'origin/fix/bug68540' into release/v8.2.0 2024-07-25 10:41:50 +03:00
a5827f187c Merge remote-tracking branch 'origin/fix/bug68585' into release/v8.2.0 2024-07-25 10:41:09 +03:00
6ae25ca4c4 Merge remote-tracking branch 'origin/fix/bug69238' into release/v8.2.0 2024-07-25 10:39:58 +03:00
ff4425e977 fix grad 2024-07-24 18:36:10 +03:00
06edc93c7b Fix bug #69238 2024-07-24 18:16:50 +03:00
8f9b35d94a Fix inline destination 2024-07-24 16:35:14 +03:00
14c06e4e7b Fix x coord Outlines 2024-07-24 15:16:21 +03:00
abaaa54bc2 Fix SetByIndex and test example
(now it does work)
2024-07-24 14:05:29 +04:00
7d0683e338 Update test example
(it doesn't work yet)
2024-07-23 20:32:44 +04:00
f9d6b49a05 Rename Call() to call() 2024-07-23 20:31:43 +04:00
01916b7de6 Add file type constants 2024-07-23 19:49:14 +04:00
666d62239e Add class CDocBuilderContext to Java and JNI 2024-07-23 19:36:49 +04:00
2e25f5dc64 Get previous array on return 2024-07-23 18:36:27 +03:00
cc61536a90 Fix function naming for CDocBuilderContextScope 2024-07-23 19:36:01 +04:00
58b5417ab4 Add class CDocBuilderContextScope to Java and JNI 2024-07-23 19:10:08 +04:00
c056c14303 Add hint how to run compiled Java example 2024-07-23 18:15:39 +04:00
1b975c7048 Get headings as an array
Get headings as an array with levels and convert to tree
2024-07-23 17:07:04 +03:00
3fd5b5612b Add test Java example 2024-07-23 17:32:51 +04:00
b8a8d36b8b Improved html to ooxml conversion 2024-07-23 14:55:38 +03:00
ccbeb28f8a fix bug #69325 2024-07-23 14:23:35 +03:00
6ab0d9d106 Fixes in Java code 2024-07-22 21:31:27 +04:00
79309d3f02 Add Java code for CDocBuilder
+ Change private members to package-private
2024-07-22 17:09:48 +04:00
c8c4edf592 Add JNI code for CDocBuilder 2024-07-22 16:37:17 +04:00
64afe55078 Add Java code for CDocBuilderValue
+ Changed all JNI functions to static
2024-07-22 15:28:15 +04:00
967a5728c7 fix build 2024-07-22 11:46:35 +03:00
8a105d35d5 Merge pull request #1596 from ONLYOFFICE/fix/bug-69284
Fix bug 69284
2024-07-22 00:56:50 -07:00
eaf2c02b86 Fix bug 69284 2024-07-20 13:37:23 +03:00
46f30b980f Add JNI code for CDocBuilderValue 2024-07-19 20:35:42 +04:00
ac4f15b999 Improved html to ooxml conversion 2024-07-19 16:59:58 +03:00
918a940e05 . 2024-07-19 15:18:58 +03:00
47961709ad Fix docbuilder.c ToString function 2024-07-19 13:13:34 +04:00
a47e72cf2f fix bug #69311 2024-07-19 11:07:47 +03:00
472c9ecd0d for bug #61035 2024-07-17 18:21:03 +03:00
7b8aa38c37 Fix bug 45813 2024-07-17 17:40:11 +03:00
5c87955ae2 Fix bug 56118 2024-07-17 16:12:53 +03:00
c37aa9d9dc Fix bug 55429 2024-07-17 16:11:02 +03:00
d699c30bda Fix bug 48721 2024-07-17 16:09:42 +03:00
9db017b9f4 Fix bug 69136 2024-07-17 12:16:44 +03:00
70fe676300 Improved colgroup support in html to ooxml conversion 2024-07-16 18:36:09 +03:00
e73d4455c2 Fix bug 55995
Support pTransferFunc for setSoftMask
2024-07-16 17:57:52 +03:00
3158e830ff Indetns fix 2024-07-16 13:56:17 +03:00
33daee696c Delete unused 2024-07-16 13:13:28 +03:00
305492ec7b Fix flip SoftMask 2024-07-15 18:22:06 +03:00
2d213df8af Create CSoftMask 2024-07-12 18:25:11 +03:00
4bb3953171 Added colgroup implementation for tables in html to ooxml conversion 2024-07-12 18:03:18 +03:00
f8e894af67 Testing agg::scanline_u8_am 2024-07-11 18:27:49 +03:00
777be23513 [android] Replace dependencies 2024-07-11 14:59:43 +03:00
b8af955fcd fix bug #69104 2024-07-11 10:52:47 +03:00
176290adaf Fix bug + refactoring 2024-07-10 19:34:01 +03:00
b3868ff146 fix bug #54575 2024-07-10 16:49:08 +03:00
f30aba8bf1 Added support for the rules attribute for tables in html to ooxml conversion 2024-07-10 15:23:05 +03:00
b039eeca38 fix bug #69097 2024-07-10 13:00:33 +03:00
450cbf0ab1 fix bug #69096 2024-07-10 12:10:14 +03:00
2e33e7d097 fix bug #69095 2024-07-10 12:00:34 +03:00
e9af537e63 Merge remote-tracking branch 'origin/hotfix/v8.1.1' into develop 2024-07-10 11:27:41 +03:00
fb209c6c8a Fix bugs 2024-07-09 19:49:21 +03:00
d4af1308c0 Merge pull request #1591 from ONLYOFFICE/feature/svg-font
Added custom SVG font
2024-07-09 18:48:00 +03:00
824d9c59cf Fix shapes merging 2024-07-09 16:56:43 +03:00
d4f3cd3801 Fix bugs in html to ooxml conversion 2024-07-09 16:44:50 +03:00
c7fc2bc3a7 The blockquote tag implementation has been added to the html to ooxml conversion 2024-07-09 16:44:32 +03:00
a8c815d7bd Fix bugs
Fix paragpraph bug
Fix bug with lines in tables
2024-07-09 16:25:32 +03:00
685434b2ab Merge remote-tracking branch 'origin/hotfix/v8.1.1' into develop 2024-07-09 16:04:22 +03:00
4559d53a97 Change CContText logic 2024-07-09 15:01:34 +03:00
5e5fec1666 add bg 2024-07-09 11:37:35 +03:00
74d7bbca7c Improvement in html to xml conversion of image size calculation 2024-07-04 18:00:32 +03:00
6eba82f433 Improvement in html to ooxml conversion of multi-level lists 2024-07-04 18:00:06 +03:00
d1460a057e Merge remote-tracking branch 'origin/fix/bug68957' into develop 2024-07-04 15:36:26 +03:00
21ba3ac0c9 fix bug #68957 2024-07-04 15:35:36 +03:00
b1ff8b79d3 Merge remote-tracking branch 'origin/hotfix/v8.1.1' into develop 2024-07-02 09:52:52 +03:00
3aab7fd183 fix bug #45681 2024-07-01 17:33:14 +03:00
82c06b5aaa Merge pull request #1581 from ONLYOFFICE/feature/libvlc-linux
Update libvlc build with changed RPATHs
2024-06-29 11:32:24 -07:00
efa4433195 Added rendering of custom fonts in svg 2024-06-28 21:18:00 +03:00
e9c9530d66 Update build with changed rpaths 2024-06-28 20:27:57 +04:00
6c36fc7146 Add script to change rpaths in libvlc build 2024-06-28 20:27:36 +04:00
5770551ed4 Merge remote-tracking branch 'origin/hotfix/v8.1.1' into develop 2024-06-28 11:28:45 +03:00
73fc80aa7d Merge remote-tracking branch 'origin/fix/bug23800' into develop 2024-06-26 10:03:49 +03:00
84836a3e8b Merge remote-tracking branch 'origin/fix/bug53148' into develop 2024-06-26 10:03:27 +03:00
6dc7ff0874 fix bug #49062 2024-06-26 09:51:20 +03:00
eec0fa47ce Merge remote-tracking branch 'origin/hotfix/v8.1.1' into develop 2024-06-26 09:14:19 +03:00
7d3bf0c328 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2024-06-26 08:41:11 +03:00
7e7ed8d746 Merge pull request #1577 from ONLYOFFICE/feature/libvlc-linux
Add new libva libraries to linux libVLC build
2024-06-25 11:30:59 -07:00
92a3c6cfce Fix Dockerfile 2024-06-25 19:14:16 +04:00
f3e6b5bc21 Add libva libraries to build 2024-06-25 18:42:16 +04:00
fe489b9da0 Rebuild libvlc with libva2 2024-06-25 17:38:25 +04:00
6ae6c37ef1 Added reading of custom fonts in svg 2024-06-25 15:51:04 +03:00
b1810af6f0 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2024-06-25 10:59:46 +03:00
263b48dea0 Fix bug #53148 2024-06-24 23:04:22 +05:00
128e09f839 Merge pull request #1571 from ONLYOFFICE/fix/bug68007
Fix bug #68007
2024-06-24 17:36:58 +03:00
5b16ea0693 Merge pull request #1570 from ONLYOFFICE/fix/bug58826
Fix bug #58826
2024-06-24 17:36:42 +03:00
be821d6b45 Fix bug #23800 2024-06-24 19:29:28 +05:00
e55101141c [x2t] Save changes.zip in applyChangesPdf; Fix bug 67341 2024-06-24 16:03:28 +03:00
e7751e891a Fix bug #58826 2024-06-24 17:47:13 +06:00
d9269bcd33 fix bug #68406 2024-06-19 13:23:11 +03:00
df6c20b57d Fix bug #68007 2024-06-18 19:36:37 +06:00
59b3862d89 Fix bug #68585 2024-06-18 17:18:41 +05:00
91b82d9dcb Merge remote-tracking branch 'origin/release/v8.1.0' into develop 2024-06-14 16:03:23 +03:00
142ed45a1b . 2024-06-14 16:02:49 +03:00
a72b42bd6d Fix placeholder index attribute 2024-06-14 15:58:56 +05:00
7a4cebb89c fix bug #68569 2024-06-13 17:46:06 +03:00
3a8c941649 Merge remote-tracking branch 'origin/release/v8.1.0' into develop 2024-06-13 17:22:43 +03:00
32464cb685 The size setting of metafiles has been changed 2024-06-13 17:22:09 +03:00
af9a69d0f2 Update logic & fix bugs 2024-06-11 08:00:48 +03:00
f39355156c Merge remote-tracking branch 'origin/release/v8.1.0' into develop 2024-06-07 17:28:36 +03:00
29115060b4 Merge pull request #1540 from ONLYOFFICE/release/v8.1.0
Release/v8.1.0
2024-06-06 23:03:36 +03:00
f665afc1ad Fix bug #68344 2024-06-05 14:31:48 +05:00
e18fc06c7b Fix bug in first word splitting 2024-06-04 11:12:18 +03:00
4cd6e99531 Merge pull request #1527 from ONLYOFFICE/release/v8.1.0
Release/v8.1.0
2024-06-03 20:10:54 +03:00
2d3cd6bd3a Merge remote-tracking branch 'origin/release/v8.1.0' into develop 2024-06-03 16:15:48 +03:00
56a08867db refactoring 2024-05-31 21:45:44 +03:00
85be8041b1 Merge remote-tracking branch 'origin/release/v8.1.0' into develop 2024-05-30 16:42:51 +03:00
f86548c873 Refactoring 2024-05-30 16:27:00 +03:00
be64e3e624 Fix spacing 2024-05-28 11:05:59 +03:00
2f6a542d02 Fix tatPlainParagraph type 2024-05-28 05:48:49 +03:00
f69b52e232 Fix bug 68004 2024-05-28 04:57:26 +03:00
ce15265d5a Fix split logic (in progress) 2024-05-27 23:28:05 +03:00
370e317b79 Updated split logic (in progress) 2024-05-27 22:21:28 +03:00
4be711c0bf Merge remote-tracking branch 'origin/release/v8.1.0' into develop 2024-05-24 17:43:32 +03:00
3bf80a74fe Add split logic in paragraph 2024-05-21 12:13:43 +03:00
de31b16f91 Add Split logic 2024-05-21 09:27:54 +03:00
f4ec536794 Fix bug 67809 2024-05-14 10:40:54 +03:00
fb12bfa57f Add MovablePoints on Label 2024-05-13 11:17:30 +03:00
1a5af05024 Merge pull request #1490 from ONLYOFFICE/release/v8.1.0
Release/v8.1.0
2024-05-13 00:36:14 -07:00
5c495dcf8d Merge pull request #1488 from ONLYOFFICE/release/v8.1.0
Release/v8.1.0
2024-05-12 07:16:18 -07:00
63c9185fd2 Add choice of colors for non parametric gradients 2024-04-29 22:08:28 +03:00
51c6fe496b Add parametrs input 2024-04-26 19:40:08 +03:00
283f21de86 Add class Custom label for handle click 2024-04-19 20:13:30 +03:00
0700038802 Refactoring 2024-04-10 19:12:01 +03:00
3e4c531538 Add default parametrs and new gradient types 2024-04-10 01:18:40 +03:00
29afb2aed9 Add Triangle gradient 2024-04-05 19:34:20 +03:00
86b53b7ede Refactoring 2024-04-04 10:22:35 +03:00
21e3293895 fix image size from pixels to millimeters 2024-04-03 15:31:07 +03:00
cd86a8a3c7 fix image size and GenerateImg method 2024-04-02 00:47:50 +03:00
9e1e641218 Add test for Linear and Radial gradients 2024-03-29 12:37:31 +03:00
608 changed files with 18866 additions and 10660 deletions

View File

@ -34,6 +34,9 @@ namespace NSCSS
CCompiledStyle& CCompiledStyle::operator+= (const CCompiledStyle &oElement)
{
if (oElement.Empty())
return *this;
m_oBackground += oElement.m_oBackground;
m_oBorder += oElement.m_oBorder;
m_oFont += oElement.m_oFont;
@ -42,6 +45,9 @@ namespace NSCSS
m_oText += oElement.m_oText;
m_oDisplay += oElement.m_oDisplay;
if (!oElement.m_sId.empty())
m_sId += L'+' + oElement.m_sId;
return *this;
}

View File

@ -23,6 +23,11 @@ namespace NSCSS
return m_pInternal->GetCompiledStyle(oStyle, arSelectors, bIsSettings, unitMeasure);
}
std::wstring CCssCalculator::CalculateStyleId(const CNode& oNode)
{
return m_pInternal->CalculateStyleId(oNode);
}
bool CCssCalculator::CalculatePageStyle(NSProperties::CPage& oPageData, const std::vector<CNode> &arSelectors)
{
return m_pInternal->CalculatePageStyle(oPageData, arSelectors);

View File

@ -22,6 +22,7 @@ namespace NSCSS
CCompiledStyle GetCompiledStyle(const std::vector<CNode> &arSelectors, const bool& bIsSettings = false, const UnitMeasure& unitMeasure = Point) const;
bool GetCompiledStyle(CCompiledStyle& oStyle, const std::vector<CNode> &arSelectors, const bool& bIsSettings = false, const UnitMeasure& unitMeasure = Point) const;
std::wstring CalculateStyleId(const CNode& oNode);
bool CalculatePageStyle(NSProperties::CPage& oPageData, const std::vector<CNode> &arSelectors);
// void AddStyle(const std::vector<std::string>& sSelectors, const std::string& sStyle);

View File

@ -157,28 +157,34 @@ namespace NSCSS
std::vector<CElement*> CCssCalculator_Private::FindElements(std::vector<std::wstring> &arNodes, std::vector<std::wstring> &arNextNodes, bool bIsSettings)
{
if (arNodes.empty())
return {};
std::vector<CElement*> arFindedElements;
std::wstring wsName, wsId;
std::vector<std::wstring> arClasses;
if (arNodes.back()[0] == L'#')
if (!arNodes.empty() && arNodes.back()[0] == L'#')
{
wsId = arNodes.back();
arNodes.pop_back();
arNextNodes.push_back(wsId);
}
if (arNodes.back()[0] == L'.')
if (!arNodes.empty() && arNodes.back()[0] == L'.')
{
arClasses = NS_STATIC_FUNCTIONS::GetWordsW(arNodes.back(), false, L" ");
arNextNodes.push_back(arNodes.back());
arNodes.pop_back();
}
wsName = arNodes.back();
arNodes.pop_back();
arNextNodes.push_back(wsName);
if (!arNodes.empty())
{
wsName = arNodes.back();
arNodes.pop_back();
arNextNodes.push_back(wsName);
}
const std::map<std::wstring, CElement*>::const_iterator oFindName = m_mData.find(wsName);
std::map<std::wstring, CElement*>::const_iterator oFindId;
@ -561,7 +567,7 @@ namespace NSCSS
}
}
oStyle.SetID(arSelectors.back().m_wsName + ((!arSelectors.back().m_wsClass.empty()) ? L'.' + arSelectors.back().m_wsClass : L"") + ((arSelectors.back().m_wsId.empty()) ? L"" : L'#' + arSelectors.back().m_wsId) + L'-' + std::to_wstring(++m_nCountNodes));
oStyle.SetID(CalculateStyleId(arSelectors.back()));
if (!bIsSettings && !oStyle.Empty())
m_mUsedStyles[arSelectors] = oStyle;
@ -569,6 +575,11 @@ namespace NSCSS
return true;
}
std::wstring CCssCalculator_Private::CalculateStyleId(const CNode& oNode)
{
return oNode.m_wsName + ((!oNode.m_wsClass.empty()) ? L'.' + oNode.m_wsClass : L"") + ((oNode.m_wsId.empty()) ? L"" : L'#' + oNode.m_wsId) + L'-' + std::to_wstring(++m_nCountNodes);
}
bool CCssCalculator_Private::CalculatePageStyle(NSProperties::CPage &oPageData, const std::vector<CNode> &arSelectors)
{
if (arSelectors.empty())

View File

@ -75,6 +75,7 @@ namespace NSCSS
CCompiledStyle GetCompiledStyle(const std::vector<CNode> &arSelectors, const bool& bIsSettings = false, const UnitMeasure& unitMeasure = Point);
bool GetCompiledStyle(CCompiledStyle& oStyle, const std::vector<CNode> &arSelectors, const bool& bIsSettings = false, const UnitMeasure& unitMeasure = Point);
std::wstring CalculateStyleId(const CNode& oNode);
bool CalculatePageStyle(NSProperties::CPage& oPageData, const std::vector<CNode> &arSelectors);
#endif

View File

@ -5,7 +5,7 @@ namespace NSCSS
CNode::CNode()
{}
CNode::CNode(std::wstring wsName, std::wstring wsClass, std::wstring wsId)
CNode::CNode(const std::wstring& wsName, const std::wstring& wsClass, const std::wstring& wsId)
: m_wsName(wsName), m_wsClass(wsClass), m_wsId(wsId)
{}

View File

@ -18,7 +18,7 @@ namespace NSCSS
public:
CNode();
CNode(std::wstring wsName, std::wstring wsClass, std::wstring wsId);
CNode(const std::wstring& wsName, const std::wstring& wsClass, const std::wstring& wsId);
bool Empty() const;

View File

@ -141,7 +141,9 @@ namespace NS_STATIC_FUNCTIONS
while (std::wstring::npos != unEnd)
{
arWords.emplace_back(wsLine.data() + unStart, unEnd - unStart + ((bWithSigns) ? 1 : 0));
if (unStart != unEnd)
arWords.emplace_back(wsLine.data() + unStart, unEnd - unStart + ((bWithSigns) ? 1 : 0));
unStart = wsLine.find_first_not_of(wsDelimiters, unEnd);
unEnd = wsLine.find_first_of(wsDelimiters, unStart);
}

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,8 @@ namespace NSCSS
{
namespace NSProperties
{
#define NEXT_LEVEL UINT_MAX, true
template<typename T>
class CValue
{
@ -21,6 +23,7 @@ namespace NSCSS
friend class CDigit;
friend class CColor;
friend class CEnum;
friend class CURL;
T m_oValue;
unsigned int m_unLevel;
@ -74,13 +77,13 @@ namespace NSCSS
return *this;
}
CValue& operator =(const T& oValue)
virtual CValue& operator =(const T& oValue)
{
//m_oValue = oValue.m_oValue;
return *this;
}
CValue& operator+=(const CValue& oValue)
virtual CValue& operator+=(const CValue& oValue)
{
if (m_unLevel > oValue.m_unLevel || (m_bImportant && !oValue.m_bImportant) || oValue.Empty())
return *this;
@ -92,10 +95,15 @@ namespace NSCSS
return *this;
}
bool operator==(const CValue& oValue) const
virtual bool operator==(const CValue& oValue) const
{
return m_oValue == oValue.m_oValue;
}
virtual bool operator!=(const CValue& oValue) const
{
return m_oValue != oValue.m_oValue;
}
};
class CString : public CValue<std::wstring>
@ -130,6 +138,7 @@ namespace NSCSS
bool SetValue(const std::wstring& wsValue, unsigned int unLevel = 0, bool bHardMode = true) override;
bool SetValue(const CDigit& oValue);
bool SetValue(const double& dValue, unsigned int unLevel, bool bHardMode);
bool Empty() const override;
bool Zero() const;
@ -178,8 +187,28 @@ namespace NSCSS
bool Empty() const;
bool operator==(const TRGB& oRGB) const;
bool operator!=(const TRGB& oRGB) const;
};
class CURL
{
public:
CURL();
bool Empty() const;
bool LinkToId() const;
void Clear();
bool SetValue(const std::wstring& wsValue);
std::wstring GetValue() const;
bool operator==(const CURL& oValue) const;
bool operator!=(const CURL& oValue) const;
private:
std::wstring m_wsValue;
};
typedef enum
{
ColorEmpty,
@ -189,39 +218,8 @@ namespace NSCSS
ColorUrl
} ColorType;
class Q_DECL_EXPORT CColorValue
class CColor : public CValue<void*>
{
public:
CColorValue();
CColorValue(const CColorValue& oColorValue);
~CColorValue();
void SetRGB(unsigned char uchR, unsigned char uchG, unsigned char uchB);
void SetRGB(const TRGB& oRGB);
void SetHEX(const std::wstring& wsValue);
void SetUrl(const std::wstring& wsValue);
void SetNone();
void Clear();
bool Empty() const;
ColorType m_enType;
void* m_pColor = NULL;
std::wstring GetColor() const;
bool operator==(const CColorValue& oColorValue) const;
CColorValue& operator= (const CColorValue& oColorValue);
};
class CColor : public CValue<CColorValue>
{
CDigit m_oOpacity;
static TRGB ConvertHEXtoRGB(const std::wstring& wsValue);
static std::wstring ConvertRGBtoHEX(const TRGB& oValue);
static std::wstring CutURL(const std::wstring& wsValue);
void SetEmpty(unsigned int unLevel = 0);
public:
CColor();
@ -242,6 +240,25 @@ namespace NSCSS
std::wstring ToWString() const override;
std::wstring EquateToColor(const std::vector<std::pair<TRGB, std::wstring>>& arColors) const;
TRGB ToRGB() const;
static TRGB ConvertHEXtoRGB(const std::wstring& wsValue);
static std::wstring ConvertRGBtoHEX(const TRGB& oValue);
bool operator==(const CColor& oColor) const;
bool operator!=(const CColor& oColor) const;
CColor& operator =(const CColor& oColor);
CColor& operator+=(const CColor& oColor);
private:
CDigit m_oOpacity;
ColorType m_enType;
void SetEmpty(unsigned int unLevel = 0);
void SetRGB(unsigned char uchR, unsigned char uchG, unsigned char uchB);
void SetRGB(const TRGB& oRGB);
void SetHEX(const std::wstring& wsValue);
void SetUrl(const std::wstring& wsValue);
void SetNone();
};
typedef enum
@ -427,6 +444,7 @@ namespace NSCSS
{
public:
CBorderSide();
CBorderSide(const CBorderSide& oBorderSide);
void Clear();
@ -434,9 +452,12 @@ namespace NSCSS
bool SetValue(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidth(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidth(const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetStyle(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColor(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
void SetNone(unsigned int unLevel, bool bHardMode);
void Block();
void Unblock();
@ -452,6 +473,7 @@ namespace NSCSS
CBorderSide& operator+=(const CBorderSide& oBorderSide);
bool operator==(const CBorderSide& oBorderSide) const;
bool operator!=(const CBorderSide& oBorderSide) const;
CBorderSide& operator =(const CBorderSide& oBorderSide);
private:
CDigit m_oWidth;
@ -473,39 +495,50 @@ namespace NSCSS
CBorder();
void Clear();
void ClearLeftSide();
void ClearTopSide();
void ClearRightSide();
void ClearBottomSide();
static void Equation(CBorder &oFirstBorder, CBorder &oSecondBorder);
bool SetSides(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidth(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetStyle(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColor(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetSides(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidth(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidth(const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetStyle(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColor(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetCollapse(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
//Left Side
bool SetLeftSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthLeftSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthLeftSide (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetStyleLeftSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColorLeftSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
//Top Side
bool SetTopSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthTopSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthTopSide (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetStyleTopSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColorTopSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
//Right Side
bool SetRightSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthRightSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthRightSide (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetStyleRightSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColorRightSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
//Bottom Side
bool SetBottomSide (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthBottomSide(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetWidthBottomSide(const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetStyleBottomSide(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColorBottomSide(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
void SetNone(unsigned int unLevel, bool bHardMode = false);
void Block();
void Unblock();
@ -522,7 +555,7 @@ namespace NSCSS
CBorder& operator+=(const CBorder& oBorder);
bool operator==(const CBorder& oBorder) const;
bool operator!=(const CBorder& oBorder) const;
CBorder& operator =(const CBorder& oBorder);
private:
CBorderSide m_oLeft;
@ -574,11 +607,13 @@ namespace NSCSS
bool SetAlign (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetDecoration(const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetColor (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetHighlight (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
const CDigit& GetIndent() const;
const CString& GetAlign() const;
const TTextDecoration& GetDecoration() const;
const CColor& GetColor() const;
const CColor& GetHighlight() const;
bool Empty() const;
@ -593,6 +628,7 @@ namespace NSCSS
CDigit m_oIndent;
CString m_oAlign;
CColor m_oColor;
CColor m_oHighlight;
};
class CIndent
@ -610,9 +646,13 @@ namespace NSCSS
bool SetValues (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetTop (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetTop (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetRight (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetRight (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetBottom (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetBottom (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetLeft (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetLeft (const double& dValue, unsigned int unLevel, bool bHardMode = false);
void UpdateAll (double dFontSize);
void UpdateTop (double dFontSize);
@ -652,6 +692,7 @@ namespace NSCSS
bool SetValue (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetSize (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetSize (const double& dValue, unsigned int unLevel, bool bHardMode = false);
bool SetLineHeight (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetFamily (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);
bool SetStretch (const std::wstring& wsValue, unsigned int unLevel, bool bHardMode = false);

View File

@ -341,12 +341,14 @@ namespace NSCSS
sSpacingValue.reserve(128);
if (!oStyle.m_oMargin.GetTop().Empty() && !oStyle.m_oMargin.GetTop().Zero())
sSpacingValue += L"w:before=\"" + std::to_wstring(VALUE_TO_INT(oStyle.m_oMargin.GetTop(), NSCSS::Twips)) + L"\" w:beforeAutospacing=\"0\" ";
sSpacingValue += L"w:before=\"" + std::to_wstring(VALUE_TO_INT(oStyle.m_oMargin.GetTop(), NSCSS::Twips)) + L"\" w:beforeAutospacing=\"0\"";
else if (oStyle.m_oMargin.GetBottom().Zero() || bInTable)
sSpacingValue += L"w:before=\"0\" w:beforeAutospacing=\"0\"";
if (!oStyle.m_oMargin.GetBottom().Empty() && !oStyle.m_oMargin.GetBottom().Zero())
sSpacingValue += L"w:after=\"" + std::to_wstring(VALUE_TO_INT(oStyle.m_oMargin.GetBottom(), NSCSS::Twips)) + L"\" w:afterAutospacing=\"0\" ";
sSpacingValue += L" w:after=\"" + std::to_wstring(VALUE_TO_INT(oStyle.m_oMargin.GetBottom(), NSCSS::Twips)) + L"\" w:afterAutospacing=\"0\"";
else if (oStyle.m_oMargin.GetBottom().Zero() || bInTable)
sSpacingValue += L"w:after=\"0\" ";
sSpacingValue += L" w:after=\"0\" w:afterAutospacing=\"0\"";
if (!oStyle.m_oFont.GetLineHeight().Empty() && !oStyle.m_oFont.GetLineHeight().Zero())
{
@ -356,7 +358,7 @@ namespace NSCSS
sSpacingValue += L" w:line=\"" + wsLine + L"\" w:lineRule=\"" + wsLineRule + L"\"";
}
else if (oStyle.m_oFont.GetLineHeight().Zero() || bInTable)
sSpacingValue += L"w:lineRule=\"auto\" w:line=\"240\"";
sSpacingValue += L" w:lineRule=\"auto\" w:line=\"240\"";
if (!sSpacingValue.empty())
oXmlElement.AddPropertiesInP(PProperties::P_Spacing, sSpacingValue);
@ -491,17 +493,15 @@ namespace NSCSS
if (!oStyle.m_oBackground.GetColor().Empty() && !oStyle.m_oBackground.GetColor().None() && !oStyle.m_oBackground.GetColor().Url())
oXmlElement.AddPropertiesInR(RProperties::R_Shd, oStyle.m_oBackground.GetColor().ToWString());
/*
const std::wstring wsHighlight{oStyle.m_oBackground.GetColor().EquateToColor({{{0, 0, 0}, L"black"}, {{0, 0, 255}, L"blue"}, {{0, 255, 255}, L"cyan"},
{{0, 255, 0}, L"green"}, {{255, 0, 255}, L"magenta"}, {{255, 0, 0}, L"red"},
{{255, 255, 0}, L"yellow"}, {{255, 255, 255}, L"white"}, {{0, 0, 139}, L"darkBlue"},
{{0, 139, 139}, L"darkCyan"}, {{0, 100, 0}, L"darkGreen"}, {{139, 0, 139}, L"darkMagenta"},
{{139, 0, 0}, L"darkRed"}, {{128, 128, 0}, L"darkYellow"},{{169, 169, 169}, L"darkGray"},
{{211, 211, 211}, L"lightGray"}})};
const std::wstring wsHighlight{oStyle.m_oText.GetHighlight().EquateToColor({{{0, 0, 0}, L"black"}, {{0, 0, 255}, L"blue"}, {{0, 255, 255}, L"cyan"},
{{0, 255, 0}, L"green"}, {{255, 0, 255}, L"magenta"}, {{255, 0, 0}, L"red"},
{{255, 255, 0}, L"yellow"}, {{255, 255, 255}, L"white"}, {{0, 0, 139}, L"darkBlue"},
{{0, 139, 139}, L"darkCyan"}, {{0, 100, 0}, L"darkGreen"}, {{139, 0, 139}, L"darkMagenta"},
{{139, 0, 0}, L"darkRed"}, {{128, 128, 0}, L"darkYellow"},{{169, 169, 169}, L"darkGray"},
{{211, 211, 211}, L"lightGray"}})};
if (L"none" != wsHighlight)
oXmlElement.AddPropertiesInR(RProperties::R_Highlight, wsHighlight);
*/
oXmlElement.AddPropertiesInR(RProperties::R_Color, oStyle.m_oText.GetColor().ToWString());
@ -523,10 +523,7 @@ namespace NSCSS
Clear();
if(oStyle.GetId().empty())
{
m_sId = L"normal";
return false;
}
CStyleUsed structStyle(oStyle, false);
@ -589,10 +586,7 @@ namespace NSCSS
Clear();
if(oStyle.GetId().empty())
{
m_sId = L"normal";
return true;
}
return false;
CStyleUsed structStyle(oStyle, true);
std::vector<CStyleUsed>::iterator oItem = std::find(m_arStyleUsed.begin(), m_arStyleUsed.end(), structStyle);

View File

@ -27,7 +27,7 @@ CXmlElement::CXmlElement(const std::wstring& sNameDefaultElement)
bool CXmlElement::Empty() const
{
return m_mPStyleValues.empty() && m_mRStyleValues.empty() && m_mBasicValues.find(CSSProperties::BasicProperties::B_BasedOn) == m_mBasicValues.end();
return m_mPStyleValues.empty() && m_mRStyleValues.empty() && GetBasedOn().empty();
}
void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
@ -35,7 +35,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
if (!Empty())
Clear();
if (sNameDefaultElement == L"p")
/* if (sNameDefaultElement == L"p")
{
AddBasicProperties(CSSProperties::BasicProperties::B_Type, L"paragraph");
AddBasicProperties(CSSProperties::BasicProperties::B_StyleId, L"p");
@ -47,7 +47,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
// AddPropertiesInP(CSSProperties::ParagraphProperties::P_Spacing, L"w:before=\"100\" w:beforeAutospacing=\"1\" w:after=\"100\" w:afterAutospacing=\"1\"");
}
else if (sNameDefaultElement == L"li")
else */if (sNameDefaultElement == L"li")
{
AddBasicProperties(CSSProperties::BasicProperties::B_Type, L"paragraph");
AddBasicProperties(CSSProperties::BasicProperties::B_StyleId, L"li");
@ -203,7 +203,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
AddPropertiesInR(CSSProperties::RunnerProperties::R_Sz, L"15");
AddPropertiesInR(CSSProperties::RunnerProperties::R_B, L"bold");
}
else if (sNameDefaultElement == L"div-c")
/*else if (sNameDefaultElement == L"div-c")
{
AddBasicProperties(CSSProperties::BasicProperties::B_Type, L"character");
AddBasicProperties(CSSProperties::BasicProperties::B_StyleId, L"div-c");
@ -219,7 +219,7 @@ void CXmlElement::CreateDefaultElement(const std::wstring& sNameDefaultElement)
AddBasicProperties(CSSProperties::BasicProperties::B_Name, L"Div paragraph");
AddBasicProperties(CSSProperties::BasicProperties::B_BasedOn, L"normal");
AddBasicProperties(CSSProperties::BasicProperties::B_Link, L"div-c");
}
}*/
else if (sNameDefaultElement == L"a-c")
{
AddBasicProperties(CSSProperties::BasicProperties::B_Type, L"character");

View File

@ -33,6 +33,7 @@
#include "../../../../Common/3dParty/hunspell/hunspell/src/hunspell/hunspell.h"
#include "../../../../DesktopEditor/common/StringExt.h"
#include "../../../../DesktopEditor/common/Directory.h"
#include <iostream>
bool CheckCaret(std::vector<std::wstring>& words)
{
@ -85,11 +86,36 @@ std::wstring CheckWord(Hunhandle* pDic, const std::wstring& sWord, const bool& b
return sResult;
}
#if defined(_WIN32) || defined(_WIN64)
#define USE_WCHAR_ARGC
#endif
#ifdef USE_WCHAR_ARGC
std::wstring GetParam(wchar_t* arg)
{
return std::wstring(arg);
}
#else
std::wstring GetParam(char* arg)
{
return NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE *)arg, (LONG)strlen(arg));
}
#endif
#ifdef USE_WCHAR_ARGC
int wmain(int argc, wchar_t *argv[])
#else
int main(int argc, char *argv[])
#endif
{
std::wstring sSrcDir = NSFile::GetProcessDirectory() + L"/../src";
std::wstring sDstDir = NSFile::GetProcessDirectory() + L"/../dst";
std::wstring sDictionariesDir = NSFile::GetProcessDirectory() + L"/../../../../../../dictionaries";
if (argc > 1) sSrcDir = GetParam(argv[1]);
if (argc > 2) sDstDir = GetParam(argv[2]);
if (argc > 3) sDictionariesDir = GetParam(argv[3]);
std::vector<std::wstring> arSrcFiles = NSDirectory::GetFiles(sSrcDir);
for (int i = 0, len = (int)arSrcFiles.size(); i < len; ++i)
@ -125,6 +151,8 @@ int main(int argc, char *argv[])
Hunspell_destroy(pDictionary);
NSFile::CFileBinary::SaveToFile(sFileDst, sResult, true);
std::cout << "[" << (i + 1) << " of " << (int)arSrcFiles.size() << "] " << U_TO_UTF8(sName) << std::endl;
}
return 0;

View File

@ -6,7 +6,7 @@
QT -= core gui
TARGET = test
TARGET = dictionariestester
CONFIG += console
CONFIG -= app_bundle
@ -22,8 +22,7 @@ include($$CORE_ROOT_DIR/Common/3dParty/icu/icu.pri)
ADD_DEPENDENCY(UnicodeConverter kernel hunspell)
core_windows:LIBS += -lgdi32 -ladvapi32 -luser32 -lshell32
core_linux:LIBS += -lz
SOURCES += main.cpp
DESTDIR = $$PWD/build
DESTDIR = $$CORE_BUILDS_BINARY_PATH

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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