Compare commits

..

709 Commits

Author SHA1 Message Date
ec882b6ecd Merge pull request #405 from ONLYOFFICE/fixBug47276
Fix bug47276
2020-11-08 10:09:20 +03:00
4bcab7e8ce . 2020-11-08 10:09:58 +03:00
13c9a5e872 Fix bug 47276 2020-11-08 10:07:13 +03:00
2368e794ba Merge branch hotfix/v6.0.1 into master 2020-10-28 14:09:27 +00:00
d297d7852c Merge pull request #373 from ONLYOFFICE/fix/bugsY
Fix typo
2020-10-18 14:46:27 +03:00
84221f619e Fix typo 2020-10-18 14:46:47 +03:00
7b55e13263 Merge pull request #372 from ONLYOFFICE/fix/bugsY
Fix linux build
2020-10-17 17:11:38 +03:00
7d32d74022 Fix linux build 2020-10-17 17:10:56 +03:00
46a7372ccf Merge pull request #371 from ONLYOFFICE/fix/bugsY
Fix 41
2020-10-16 11:56:39 +03:00
5f0f6ec9bc Fix 41 2020-10-15 21:04:15 +03:00
251a3e58b0 Fix typo 2020-10-15 18:55:57 +03:00
c5b5fbb763 Merge pull request #370 from ONLYOFFICE/fix/bugsY
Fix typo
2020-10-15 18:55:11 +03:00
214c2e00f1 Merge pull request #369 from ONLYOFFICE/fix/bugsY
Fix typo
2020-10-15 13:55:26 +03:00
4d316781ec Fix typo 2020-10-15 13:54:43 +03:00
47a453a745 Merge pull request #361 from ONLYOFFICE/fix/bugsY
Fix/bugs y
2020-10-13 20:47:11 +03:00
8b594be2ab Fix 2/3 "problem 41" 2020-10-13 20:45:34 +03:00
88cf60a3ed Fix 25 errors 2020-10-13 20:11:21 +03:00
9a9d60031e Merge pull request #355 from ONLYOFFICE/feature/pre6.0.1
Feature/pre6.0.1
2020-10-08 13:45:24 +03:00
8bc803850d Merge pull request #349 from ONLYOFFICE/fix/v6.0.1-fix_bugs_1
Fix/v6.0.1 fix bugs 1
2020-09-30 21:46:08 +03:00
5c36946442 Merge branch release/v6.0.0 into master 2020-09-30 14:59:42 +00:00
a3d52549d3 x2t - fixed check images from download 2020-09-30 17:47:51 +03:00
6ecdc4acfd x2t - fix bugs 2020-09-30 15:34:11 +03:00
66a6b7a111 Fix 2020-09-30 15:19:20 +03:00
a09de43723 . 2020-09-30 13:54:01 +03:00
b17d5e860f Fix 34, 35, 37 2020-09-30 13:52:41 +03:00
4cd2bd34ce Fix spaces 2020-09-25 14:15:51 +03:00
0b3502afdd Fix build on macOS with xcode 12+ 2020-09-25 13:54:40 +03:00
829fa21ecb Fix build with new windows sdk 2020-09-25 12:05:39 +03:00
91c50e6620 Merge pull request #340 from ONLYOFFICE/fix/standardtester
Fix standardtester update script
2020-09-22 15:32:10 +03:00
b6da6093b8 Fix standardtester update script 2020-09-22 15:32:08 +03:00
96c8cf69ff Merge pull request #339 from ONLYOFFICE/fix/v6.0.0_fix_bugs2
OdfFormat - fix bug #45590
2020-09-21 21:19:46 +03:00
8f4d8feffa OdfFormat - fix bug #45590 2020-09-21 21:18:05 +03:00
4c708ce8f1 Merge pull request #337 from ONLYOFFICE/fix/allfonts_version
Add version to allfonts.js
2020-09-21 21:10:27 +03:00
c3657a6b95 Add version to allfonts.js 2020-09-21 21:09:53 +03:00
379a452cca Merge pull request #336 from ONLYOFFICE/fix/bug46677
Fix bug 46677
2020-09-21 19:43:58 +03:00
af166c1db3 Fix bug 46677 2020-09-21 19:44:24 +03:00
62746194c0 Merge pull request #335 from ONLYOFFICE/fix/v6.0.0_fix_bugs2
x2t - fix bug #46662
2020-09-21 08:31:59 +03:00
36da9596c3 x2t - fix bug #46662 2020-09-21 08:28:22 +03:00
7c459a1235 Merge pull request #334 from ONLYOFFICE/fix/fontsBuilder
Use ApplicationFontsWorker in builder
2020-09-20 11:03:15 +03:00
28dfa20cf4 Use ApplicationFontsWorker in builder 2020-09-20 11:03:05 +03:00
0176766ede Merge pull request #331 from ONLYOFFICE/fix/bugFontsEA
.
2020-09-18 19:14:54 +03:00
3c87ae665f . 2020-09-18 15:49:50 +03:00
d6711bf478 Merge pull request #329 from ONLYOFFICE/fix/v6.0.0-fix_bugs
OdfFormat - fix bug #46149, fix bug #37705
2020-09-17 10:58:02 +03:00
2a8fd22d52 OdfFormat - fix bug #46149, fix bug #37705 2020-09-16 15:45:09 +03:00
d041646709 Merge pull request #327 from ONLYOFFICE/fix/bug34733
Fix bug 34733
2020-09-14 19:38:45 +03:00
ad28973882 Fix bug 34733 2020-09-14 19:35:47 +03:00
11d271014b Merge pull request #326 from ONLYOFFICE/fix/v6.0.0-fix_bugs
x2t - fix bug #22793
2020-09-14 15:48:27 +03:00
cb38fae383 x2t - fix bug #22793 2020-09-14 12:23:25 +03:00
0d14c7a5fc Merge pull request #325 from ONLYOFFICE/fix/v6.0.0-fix_bugs
x2t - binary - fix pptx theme
2020-09-13 20:30:46 +03:00
915478c1a0 x2t - binary - fix pptx theme 2020-09-13 20:28:55 +03:00
c4cc96e7e5 Merge pull request #324 from ONLYOFFICE/fix/v6.0.0-fix_bugs
PptFormat - fix bug #46195
2020-09-11 11:12:40 +03:00
a68a7b4d7b PptFormat - fix bug #46195 2020-09-11 11:10:33 +03:00
80919a4a69 Merge pull request #322 from ONLYOFFICE/fix/v6.0.0-fix_bugs
fix build
2020-09-10 11:34:23 +03:00
d6fa93f72d fix build 2020-09-10 11:32:33 +03:00
ae8fc6b167 Merge pull request #320 from ONLYOFFICE/fix/v6.0.0-flat_ooxml
OdfFormat - fix bug #46487
2020-09-09 18:40:29 +03:00
218bb347f0 Merge pull request #319 from ONLYOFFICE/fix/v6.0.0-flat_ooxml
Fix/v6.0.0 flat ooxml
2020-09-09 18:23:08 +03:00
0123c54f1a OdfFormat - fix bug #46487 2020-09-09 16:33:49 +03:00
0d45d9843c Merge pull request #316 from ONLYOFFICE/fix/mac_ios
Fix build on mac/ios
2020-09-09 16:18:09 +03:00
e43ee93e1d Fix build on mac/ios 2020-09-09 16:14:36 +03:00
cd8adbe83b x2t - ooxml flat - fix gzip image 2020-09-09 11:32:55 +03:00
6456fa802a OdfFormat - fix section 2020-09-09 11:32:08 +03:00
cb051ec67d Merge branch hotfix/v5.6.4 into master 2020-09-08 08:13:46 +00:00
770020089b Merge pull request #314 from ONLYOFFICE/fix/emptyDash
Fix bug 46350
2020-09-08 11:07:12 +03:00
d68bf5ab38 Fix bug 46350 2020-09-08 11:00:04 +03:00
6e3cb9e7ef Merge pull request #313 from ONLYOFFICE/fix/calcOnePage
Fix/calc one page
2020-09-07 15:36:27 +03:00
7c0ba8b45f . 2020-09-07 15:36:36 +03:00
935483f3d0 Send json params to calculate function (as to GetPDF) 2020-09-07 15:31:18 +03:00
ea04067abf DocxFormat - fix image in zip and read sub-section 2020-09-04 10:57:40 +03:00
75f74b7e41 Merge pull request #312 from ONLYOFFICE/fix/v6.0.0-from-v5.6.4
Fix/v6.0.0 from v5.6.4
2020-09-04 06:37:50 +03:00
5906e23c98 Merge remote-tracking branch 'origin/hotfix/v5.6.4' into fix/v6.0.0-from-v5.6.4 2020-09-04 06:35:23 +03:00
8ae9952294 Merge pull request #311 from ONLYOFFICE/fix/v6.0.0_files_tests
Fix/v6.0.0 files tests
2020-09-03 17:45:07 +03:00
7d86f3e860 OdfFormat - fix bug #45218 2020-09-03 17:42:50 +03:00
1b89d50c20 x2t - binary -fix bug #46433 2020-09-03 17:41:36 +03:00
3033c59eaa Merge pull request #310 from ONLYOFFICE/fix/v5.6.4-bin3
Fix/v5.6.4 bin3
2020-09-03 17:26:14 +03:00
874cbb62d2 Merge pull request #309 from ONLYOFFICE/fix/bug43650
Fix bug 43650
2020-09-03 16:12:57 +03:00
9e2b51ec6d Fix bug 43650 2020-09-03 16:12:25 +03:00
c455f1b420 TxtFormat - fix bug #46437 2020-09-02 21:52:10 +03:00
7fdb44a93f x2t - fix bug #46436 2020-09-02 21:46:02 +03:00
e53ba81da3 x2t - fix bug #46434 2020-09-02 21:35:25 +03:00
da1f604f09 Merge pull request #308 from ONLYOFFICE/fix/v5.6.4-bin2
x2t - fix bug #46353
2020-09-02 18:31:59 +03:00
68e791c2fd x2t - fix bug #46353 2020-09-02 18:30:46 +03:00
30cdf52611 Merge pull request #307 from ONLYOFFICE/fix/v5.6.4-bin2
x2t - fix bug #46353
2020-09-01 10:37:42 +03:00
83f1a9e068 x2t - fix bug #46353 2020-09-01 10:35:41 +03:00
df3382c616 Merge pull request #305 from ONLYOFFICE/fix/v5.6.4_bin
x2t - fix #46353
2020-08-31 19:52:58 +03:00
70c886cd9a x2t - fix #46353 2020-08-31 19:51:30 +03:00
0d8c21af22 Merge branch 'hotfix/v5.6.4' into fix/v6.0.0_files_tests 2020-08-31 09:53:27 +03:00
8cb6415915 Merge pull request #303 from ONLYOFFICE/fix/v5.6.4_bin
x2t - fix bug #46348
2020-08-31 09:45:12 +03:00
279eaed9c8 x2t - fix bug #46348 2020-08-31 09:43:51 +03:00
7d5f8c2f99 Merge branch 'hotfix/v5.6.4' into fix/v6.0.0_files_tests 2020-08-31 08:41:13 +03:00
f2c69ba9a4 Merge remote-tracking branch 'origin/hotfix/v5.6.4' into fix/v6.0.0_files_tests 2020-08-31 08:10:28 +03:00
078aa9c5e7 Merge pull request #302 from ONLYOFFICE/fix/bug-46384
[x2t] Fix bug 46384
2020-08-30 16:08:23 +03:00
b76463f8d1 [x2t] Fix bug 46384
Fix omitted break statement in switch
2020-08-30 16:06:00 +03:00
a2110b9947 Merge pull request #301 from ONLYOFFICE/fix/bug-46352
[x2t] Fix bug 46352
2020-08-28 14:30:47 +03:00
de2c16ed7c [x2t] Fix bug 46352
Fix out_of_range while binary reading
2020-08-28 14:25:31 +03:00
5aa32a21f6 Merge pull request #300 from ONLYOFFICE/fix/v5.6.4_bin
x2t - binary - fix bug #46352
2020-08-28 13:07:30 +03:00
bec0a59ac1 x2t - binary - fix bug #46352 2020-08-28 13:05:18 +03:00
9024feaf5d Merge pull request #299 from ONLYOFFICE/fix/v5.6.4_bin
x2t - binary - fix bug #46353
2020-08-28 12:49:33 +03:00
078d3bc991 x2t - binary - fix bug #46353 2020-08-28 12:47:24 +03:00
55be5be654 Merge pull request #298 from ONLYOFFICE/fix/v6.0.0_files_tests
Fix/v6.0.0 files tests
2020-08-26 21:53:31 +03:00
fbe5ce3dd6 OdfFormat - fix bug #46149 2020-08-26 21:51:57 +03:00
410be67daa . 2020-08-26 19:01:58 +03:00
c260db3d3d OdfFormat - fix after testing 2020-08-26 14:32:51 +03:00
2cb0628f17 . 2020-08-26 13:32:34 +03:00
4d7479d4c9 OdfFormat - fix bug #45590 2020-08-25 12:53:13 +03:00
c0570d8ae1 Merge pull request #295 from ONLYOFFICE/fix/v6.0.0_files_tests
.
2020-08-24 10:25:47 +03:00
7812ad4c88 . 2020-08-24 10:24:31 +03:00
9c9726e6e3 Fix bug #45498
Fix the problem with reading WmfRect object
2020-08-21 10:31:31 +03:00
f4c869c423 Merge pull request #293 from ONLYOFFICE/fix/v6.0.0_files_tests
OdfFormat - fix bug #46255
2020-08-21 09:58:00 +03:00
0bdd1efb6d OdfFormat - fix bug #46255 2020-08-21 09:55:18 +03:00
ce566cb1b5 Merge pull request #292 from ONLYOFFICE/fix/v6.0.0_files_tests
Fix/v6.0.0 files tests
2020-08-21 08:57:33 +03:00
c9f367e269 OdfFormat - fix bug #45218 2020-08-21 08:56:26 +03:00
0d4f9dd5ce Merge branch 'release/v6.0.0' into fix/v6.0.0_files_tests 2020-08-20 16:35:36 +03:00
60c24619a8 OdfFormat - fix after testing 2020-08-20 16:34:37 +03:00
fd432c92af Merge pull request #291 from ONLYOFFICE/fix/v6.0.0_files_tests
Fix/v6.0.0 files tests
2020-08-19 14:33:05 +03:00
d6274ff045 . 2020-08-19 14:31:55 +03:00
4859ab54b7 . 2020-08-19 12:47:36 +03:00
749da667eb Merge pull request #290 from ONLYOFFICE/fix/v6.0.0_files_tests
Fix/v6.0.0 files tests
2020-08-19 12:06:40 +03:00
cbe7ea1497 PptFormat - fix after testing 2020-08-19 12:04:55 +03:00
aa7943cd73 OdfFormat - fix bugs #45218, #46207 2020-08-19 12:00:22 +03:00
1472c3e2c4 Fix bug #46164
Fix the problem with PDF/A conformance
2020-08-17 16:24:28 +03:00
997ab10074 Merge pull request #286 from ONLYOFFICE/fix/v6.0.0_files_tests
OdfFormat - fix bug #46060
2020-08-14 18:23:08 +03:00
465a45aa43 . 2020-08-14 13:58:50 +03:00
55a2f2a4a7 XLsFormat - fix bug #46137, #45869 2020-08-14 13:57:25 +03:00
228f8cacf6 XlsFormat - fix bug #46088 2020-08-11 12:32:31 +03:00
244b9acc9a OdfFormat - fix bug #46076 2020-08-11 11:37:56 +03:00
86182e7c54 OdfFormat - fix bug #46060 2020-08-10 11:34:28 +03:00
27398b5ccd Merge branch hotfix/v5.6.2 into release/v6.0.0 2020-08-07 08:01:04 +00:00
ef6af5a1ae Merge branch hotfix/v5.6.1 into master 2020-08-05 09:19:35 +00:00
52bcc587ba Merge pull request #279 from ONLYOFFICE/hotfix/v5.6.1
Hotfix/v5.6.1
2020-08-03 12:05:37 +03:00
6e5fe1202e Merge pull request #278 from ONLYOFFICE/fix/fixXP
Fix xp build
2020-08-03 12:00:48 +03:00
0005b20095 Fix xp build 2020-08-03 11:29:19 +03:00
d48faa778b Merge pull request #277 from ONLYOFFICE/fix/v6.0.0_pole
.
2020-08-03 10:41:10 +03:00
1eb51d9a39 . 2020-07-31 13:49:17 +03:00
6570319bfe Merge pull request #276 from ONLYOFFICE/fix/v6.0.0_pole
.
2020-07-30 10:03:49 +03:00
14ad7ac534 . 2020-07-30 09:04:54 +03:00
a7da029138 Merge branch hotfix/v5.6.0 into release/v6.0.0 2020-07-28 13:31:44 +00:00
82cdd75365 Merge branch hotfix/v5.6.0 into master 2020-07-28 13:31:16 +00:00
3410e157e0 Merge pull request #272 from ONLYOFFICE/feature/fixIOSBoost
Fix ios build
2020-07-21 16:02:46 +03:00
92d0edeb48 Fix ios build 2020-07-21 15:55:55 +03:00
e6928330d4 Fix bug #35500
Fix reading PDF fields with specified value equals to the default value
2020-07-17 15:42:07 +03:00
6522a682e0 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2020-07-16 17:30:37 +03:00
a63adfcb97 OdfFormat - fix bug #45862 2020-07-16 17:21:37 +03:00
bc91a3a19c Implement saving internal links 2020-07-16 10:24:35 +03:00
46bd3427f8 DocFormat - fix bug #45851 2020-07-15 13:01:35 +03:00
ec24932bf3 Revert "."
This reverts commit 6785d185c8.
2020-07-14 11:47:50 +03:00
be67e37ff7 Revert "."
This reverts commit 81a7416403.
2020-07-14 11:47:42 +03:00
671f9f543a Revert "."
This reverts commit 6d8ac07e60.
2020-07-14 11:47:34 +03:00
9174529906 Revert "."
This reverts commit d1e399ba83.
2020-07-14 11:47:26 +03:00
76044dfa68 Revert "."
This reverts commit eb699347d4.
2020-07-14 11:46:43 +03:00
a7c6eeeced Revert "."
This reverts commit d10a0ccadd.
2020-07-14 11:46:31 +03:00
5ce6fa0288 Revert "."
This reverts commit 8c605dca1c.
2020-07-14 11:46:17 +03:00
6785d185c8 . 2020-07-14 08:31:14 +03:00
81a7416403 . 2020-07-13 11:06:45 +03:00
6d8ac07e60 . 2020-07-13 10:44:44 +03:00
d1e399ba83 . 2020-07-13 09:13:43 +03:00
72edd021d0 [test] Update test apps 2020-07-13 01:31:40 +03:00
1d8860f73e Fix bug #35032
Implement saving hyperlinks
2020-07-10 18:15:28 +03:00
ce397b13f6 Fix bug with redirects in downloads 2020-07-10 16:31:37 +03:00
206f53f0c1 . 2020-07-10 10:35:05 +03:00
eb699347d4 . 2020-07-10 10:29:42 +03:00
d10a0ccadd . 2020-07-10 10:21:36 +03:00
8c605dca1c . 2020-07-10 10:10:54 +03:00
52ac2a7524 PptxFormat - fix bug #45817 2020-07-09 17:57:49 +03:00
4b961b000f OdfFormat - fix bug #45814 2020-07-09 12:50:40 +03:00
b691f7bf0b Fix bug #31382
Simple variant for transparency group
2020-07-08 16:07:38 +03:00
04240aa8df Fix bug #25374
Implement matte color support for images with specified smask
2020-07-08 10:22:45 +03:00
9d065c546a x2t - fix #45244, ... 2020-07-07 13:34:42 +03:00
3a7bc3a5fa Merge pull request #266 from ONLYOFFICE/hotfix/v5.5.4
Hotfix/v5.5.4
2020-07-06 18:38:34 +03:00
d197c0da15 . 2020-07-06 16:55:04 +03:00
1fed9b0aed OdfFormat - fix bug #45088 2020-07-06 16:41:57 +03:00
0e7a8c1af9 Fix rpath instead runpath 2020-07-06 16:14:41 +03:00
a52bcb3205 Fix previous commit 2020-07-06 14:05:06 +03:00
b57bf58068 Use std::vector in CArray realization. Deprecated class! 2020-07-06 13:50:43 +03:00
618e61e012 Fix previous commit 2020-07-06 11:43:02 +03:00
d70bf7d361 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2020-07-06 09:30:13 +03:00
a0f4d06ca7 [x2t] Set encoding and delimiter for empty txt, csv instead of NEED_PARAMS error
The main purpose - to show right error in case of presentation download error
2020-07-06 02:46:13 +03:00
c835a0741e Fix rendering dashed lines 2020-07-05 12:37:01 +03:00
a8ee916ffa Fix android build & work 2020-07-05 10:04:34 +03:00
b8442ce2fb x2t - BinaryWriter - fix bug #45244 2020-07-04 21:24:16 +03:00
26ea36f242 . 2020-07-04 14:12:23 +03:00
6b89ec979d PptFormat - fix bug #45424 2020-07-04 07:45:31 +03:00
802dfe7da6 Merge pull request #265 from ONLYOFFICE/hotfix/v5.5.4
Hotfix/v5.5.4
2020-07-03 11:44:51 +03:00
7be6410a13 Fix fonts selection 2020-07-03 11:25:24 +03:00
76375da047 x2t - BinWriter - fix bug #45744 2020-07-03 10:12:39 +03:00
528806df30 Fix bug #32339
Fix the problem with color of the mask
2020-07-03 09:47:02 +03:00
46fdd6aaa7 . 2020-07-02 21:38:12 +03:00
dbe8fe29f7 For bug #32615
Implement reading page labels
2020-07-02 15:30:51 +03:00
468bf90f9f XlsFormat - fix bug #45737 2020-07-02 08:11:26 +03:00
84789d2083 Fix base pri 2020-07-01 21:52:28 +03:00
1ef73f12a4 Change font selection algorithm 2020-07-01 13:03:19 +03:00
9706ca50d5 Fix bug #39097
Implement color mask for images
2020-07-01 10:52:39 +03:00
7fba804f17 Fix bug #19078
Fix the problem with reading CID to GID map for CIDType2 fonts
2020-07-01 10:52:32 +03:00
d4f9eecbba Fix bug #45319 2020-07-01 10:52:23 +03:00
9719490d68 Fix bug #39097
Implement color mask for images
2020-07-01 10:36:49 +03:00
4ac26edee1 Fix bug #19078
Fix the problem with reading CID to GID map for CIDType2 fonts
2020-06-30 12:57:57 +03:00
839b1bee9f Fix bug #45319 2020-06-30 12:45:04 +03:00
245dfe198a Fix bug 45336 2020-06-29 11:55:04 +03:00
9aad184fca Add android script 2020-06-27 15:21:09 +03:00
8fc7db8e4e . 2020-06-26 06:30:17 +03:00
f3a807b65e TxtFormat - fix bug #45695 2020-06-25 20:39:15 +03:00
bbe07b8166 OdfFormat - .... 2020-06-25 12:37:25 +03:00
546ba267ac OdfFormat - fix bug #45593 2020-06-24 22:33:18 +03:00
7d2e0db0c0 OdfFormat - fix bug #45594 2020-06-24 07:33:47 +03:00
3b8c1c1f01 Merge pull request #258 from ONLYOFFICE/hotfix/v5.5.4
Hotfix/v5.5.4
2020-06-23 20:53:24 +03:00
d49bed47b6 Fix bug 31323 2020-06-23 11:15:50 +03:00
52b9a4b683 . 2020-06-23 08:10:46 +03:00
6d949ed6bf . 2020-06-23 05:08:29 +03:00
61973714b9 x2t - fix bug #45535 2020-06-22 19:57:08 +03:00
4b2656b07c OdfFormat - fix bug #45616 2020-06-22 16:34:09 +03:00
9c5e79619a DocFormatReader - fix bug #44864 2020-06-19 10:03:51 +03:00
302f3aa7b6 [test] Update test apps 2020-06-18 15:53:56 +03:00
daf05b4410 [x2t] For opening DOCX_FLAT via xml 2020-06-18 12:59:43 +03:00
a103fc00b5 . 2020-06-17 13:14:04 +03:00
f9de7868c5 [ios][documents] color schemas event 2020-06-17 12:33:17 +03:00
e72a4f2c76 RtfFormatReader - fix bug #45619 2020-06-16 22:00:10 +03:00
374d005e14 OdfFormatReader - fix bug #45626 2020-06-16 21:16:15 +03:00
b95065fd70 Openssl build for windows xp 2020-06-16 15:28:10 +03:00
106880b7f4 [test] Update test apps 2020-06-15 18:04:04 +03:00
de9d2b303d [x2t] Fix writing corrupted xlsx 2020-06-15 18:01:54 +03:00
4082244e80 . 2020-06-15 12:23:51 +03:00
ec8a674be4 OdfFormatReader - fix bug #45530 2020-06-10 18:03:21 +03:00
f917165411 Fix bug 45556 2020-06-10 11:29:54 +03:00
f4b46d144d [x2t] Fix CPresetColorVal::FromStringIgnoreCase 2020-06-09 18:39:03 +03:00
add0ab9dd3 [ios] Fixed icu project 2020-06-08 18:34:10 +03:00
afedec1dd2 fix #45282 2020-06-03 08:36:33 +03:00
75386cab65 DocxFormat - fix bug #45504 2020-06-02 19:12:34 +03:00
7df59d9491 [ios] Fixed boost and icu paths 2020-05-29 14:55:22 +03:00
dcda192c0a Merge remote-tracking branch 'origin/hotfix/v5.5.4' into develop 2020-05-27 20:04:17 +03:00
961bde6723 RtfFormatReader - fix bug #45439, fix bug #45477 2020-05-27 20:02:12 +03:00
2261de2884 Fix build without UNICODE
(cherry picked from commit 4503678e2c)
2020-05-26 12:33:36 +03:00
7bc4ab9655 Use boost 1.72 2020-05-26 12:32:02 +03:00
5e6d2f12d5 x2t - bin reader - fix error 2020-05-25 19:35:52 +03:00
fb7d20c7e0 Merge pull request #257 from ONLYOFFICE/feature/fixFor554
Feature/fix for554
2020-05-25 16:22:34 +00:00
60ba4407b9 . 2020-05-25 19:02:32 +03:00
ba518d7c85 . 2020-05-25 18:26:26 +03:00
a045f57430 . 2020-05-25 18:24:18 +03:00
b10274c65d x2t - fix users files; fix bug #45439 2020-05-25 17:21:05 +03:00
567ecfb5e2 [ios][documents] fixed build 2020-05-24 23:34:19 +03:00
cd62b1d5c0 [ios][documents] fonts 2020-05-24 23:29:31 +03:00
7a32e5f163 [ios][documents] fonts 2020-05-22 23:04:14 +03:00
a79fa0a2c5 RtfReader - fix bug #45439 2020-05-22 14:56:37 +03:00
2c64e08e3c v5.5.3 2020-05-22 11:25:18 +03:00
c1e4a2ce33 v5.5.3 2020-05-22 11:21:42 +03:00
c277590e3b . 2020-05-21 10:39:29 +03:00
42c89ac604 .. 2020-05-21 06:26:12 +03:00
bfc691741a [x2t] Fix bug 45081 2020-05-20 19:13:03 +03:00
517e71a6fb [android][se] fix nCodePage for Encodings 2020-05-20 16:16:19 +03:00
ab68837a90 [ios][documents] fixed build for fonts 2020-05-20 12:38:53 +03:00
ba122b98f0 [ios][documents] fixed build for fonts 2020-05-20 12:38:29 +03:00
8900c58bd3 [ios][documents] universal fonts 2020-05-19 19:42:24 +03:00
6573ce860e [ios][documents] universal fonts 2020-05-19 18:30:31 +03:00
681935eb68 . 2020-05-18 16:37:05 +03:00
afd58646be Update gitignore 2020-05-15 09:44:07 +03:00
4503678e2c Fix build without UNICODE 2020-05-14 16:44:06 +03:00
1bc81c9be9 OdfFormtReader - fix quick displayed mode for styles 2020-05-14 10:26:50 +03:00
1cffeea6ab [test] Update test apps 2020-05-13 19:00:19 +03:00
d4b91d828a Add decryption support 2020-05-12 11:11:35 +03:00
5e36f80c93 Server app for encrypt files 2020-05-12 10:11:26 +03:00
49a1a2d6a1 Fix linux/macos build 2020-05-12 09:25:04 +03:00
6389bd4d3d Server app for encrypt files 2020-05-11 16:43:09 +03:00
92c2aa3d06 Developing... 2020-05-08 16:45:25 +03:00
a25ecc22fb Merge pull request #254 from ONLYOFFICE/feature/crypto
Feature/crypto
2020-05-07 18:35:52 +03:00
8417eedf84 Refactoring 2020-05-07 12:51:05 +03:00
89e88c03c4 XlsxFormat - x15 connection 2020-05-06 18:01:16 +03:00
785f5ae1db . 2020-05-06 17:31:03 +03:00
aaf3fb5652 OpenSSL add aes methods for desktop 2020-05-06 11:13:49 +03:00
6bdcfe53de Add openssl to windows version ooxmlsignature 2020-05-06 10:41:15 +03:00
ee091e7ca9 [x2t] Fix writing corrupted docx
any docx file with chart in group shape
2020-05-06 10:30:07 +03:00
4eb58cd967 Developing... 2020-05-05 22:08:48 +03:00
d0df8d17a1 Test example for openssl 2020-05-05 21:35:13 +03:00
8751075b26 Fix boost.pri 2020-05-01 18:49:44 +03:00
d1b70c416a Fix android armv7 build 2020-04-30 11:05:12 +03:00
f9c71dff07 [x2t] For opening XLSX_FLAT via xml 2020-04-29 16:50:55 +03:00
8b49cc5463 DocFormat - fix bug #45301 2020-04-29 14:12:13 +03:00
fbd4ad1565 . 2020-04-29 13:08:41 +03:00
45b3b568b6 . 2020-04-29 12:40:39 +03:00
a654eb9396 . 2020-04-28 18:46:38 +03:00
7ab24309ee Fix windows build 2020-04-28 16:44:33 +03:00
10b087b946 fix build ios 2020-04-28 14:55:07 +03:00
baa9a19b70 x2t - fix bug #45282 2020-04-28 14:34:16 +03:00
5a416e201a . 2020-04-28 14:19:34 +03:00
3d814e7b40 Merge pull request #253 from ONLYOFFICE/hotfix/v5.5.2 2020-04-27 18:37:39 +03:00
5eb1fac52c Merge branch 'develop' of github.com:ONLYOFFICE/core into develop 2020-04-27 16:47:58 +03:00
987396b426 [x2t] Fix build 2020-04-27 13:50:00 +03:00
9caaab8942 Fix build bugs (android) 2020-04-27 12:25:56 +03:00
52e558103b Fix boost build for ios 2020-04-27 12:06:54 +03:00
7c723b6c2a . 2020-04-27 11:51:23 +03:00
0e782ab80f Merge pull request #252 from ONLYOFFICE/feature/slicer
Feature/slicer
2020-04-26 11:25:14 +03:00
2e2218d495 [x2t] Add x14:dxfs; other fixes for slicer 2020-04-26 11:22:29 +03:00
5f44b7fea0 Developing 2020-04-24 14:56:49 +03:00
824c59cbd8 [x2t] Add reading/writing of all slicer xml 2020-04-24 12:13:53 +03:00
06b4a03ebc . 2020-04-24 12:09:53 +03:00
1cb65a3f4f . 2020-04-24 11:38:31 +03:00
7259801cd5 [x2t] Add SlicerCache 2020-04-24 10:59:24 +03:00
1256f87df0 [x2t] Fix CWorksheet::fromXML 2020-04-24 09:55:16 +03:00
4512d9e22c [ios][pe] coauth themes thumbnails 2020-04-22 22:50:03 +03:00
49d51257ba Refactoring copying files on windows 2020-04-22 13:22:16 +03:00
7d5f2a4d41 Fix ios build 2020-04-20 09:56:51 +03:00
46df190a44 Fix previous commit 2020-04-19 16:53:27 +03:00
13d7538d4e Merge remote-tracking branch 'origin/feature/develop-and' into develop
Add support android build
2020-04-19 15:37:56 +03:00
f912aa1fb5 Merge remote-tracking branch 'origin/hotfix/v5.5.2' into develop 2020-04-18 08:12:19 +03:00
bb65549dc1 RtfFormat - fix bug #45195 (#250) 2020-04-17 15:56:01 +03:00
a99eaf1ec4 . 2020-04-16 22:57:11 +03:00
a25e9e98c8 . 2020-04-16 19:42:18 +03:00
6015132652 Merge remote-tracking branch 'origin/hotfix/v5.5.2' into develop 2020-04-16 18:11:40 +03:00
ac0c16e475 Merge remote-tracking branch 'origin/hotfix/v5.5.2' into develop
#	without XlsxSerializerCom/Reader/CSVReader.cpp
2020-04-16 18:06:23 +03:00
5294089fd0 [builder] Stop work with local resources in web mode (#249) 2020-04-16 17:37:14 +03:00
3ec24e5e39 RtfFormat - fix bug #45166 2020-04-16 16:32:25 +03:00
dc44dc5e84 RtfFormat - fix bug #45150 2020-04-16 16:32:25 +03:00
cf76de8811 . 2020-04-16 16:32:25 +03:00
86421d8235 DocxFormat - fix bug #44709 2020-04-16 16:32:25 +03:00
5e77e96e5f [x2t] Fix bug 45171 (#248) 2020-04-16 15:52:16 +03:00
2f4296001a [ios] retrieve query url parametr 2020-04-15 22:30:41 +03:00
1ba171c2fe Merge branch 'develop' of github.com:ONLYOFFICE/core into develop 2020-04-15 18:49:00 +03:00
75e64e8c1d Merge pull request #247 from ONLYOFFICE/hotfix/v5.5.1
v5.5.1r2
2020-04-15 14:31:53 +03:00
916c61483d v5.5.1r2 2020-04-15 14:18:32 +03:00
0bf013e118 [x2t] For bug 45150.
Write gridAfter and wAfter independently
2020-04-15 14:15:28 +03:00
973b89609d v5.5.1r2 2020-04-15 13:04:24 +03:00
93d96145b9 . 2020-04-14 11:51:02 +03:00
cb48a131ce DocxFormat - fix bug #44709 2020-04-13 11:21:00 +03:00
a0c0171d12 Set small fontscache size by allfontsgen working... (#244) 2020-04-11 12:12:50 +03:00
736476f9cc OdfFormat - fix bug #45088 2020-04-09 19:31:36 +03:00
d5c5c4b8cf v5.5.1 2020-04-09 12:40:22 +03:00
8e0e8e96af . 2020-04-09 10:37:03 +03:00
23b4fb4722 . 2020-04-08 11:37:05 +03:00
93f6d44759 . 2020-04-07 21:52:10 +03:00
23546dc602 . 2020-04-07 16:13:37 +03:00
89976b31dd . 2020-04-07 15:19:40 +03:00
60904a6df0 Fix windows xp support for non-console apps (#240) 2020-04-06 12:08:03 +03:00
07295de852 . 2020-04-06 11:29:15 +03:00
72315d1229 Add sort to application fonts list (#239) 2020-04-06 10:51:12 +03:00
fef5735437 . 2020-04-04 16:15:32 +03:00
61f4ef0f3c . 2020-04-04 11:23:37 +03:00
e3c66e7f54 . 2020-04-04 08:54:50 +03:00
91918313b4 Merge remote-tracking branch 'origin/hotfix/v5.5.1' into develop 2020-04-02 13:19:23 +03:00
abb5fd1ec1 x2t - fix bug #44957 (#238) 2020-04-02 13:16:09 +03:00
fd6beb0044 return error from abnormal zip (#237) 2020-04-02 11:46:00 +03:00
3e8816786a . 2020-04-01 18:57:07 +03:00
1b6eff5cb7 Fix writing sdk version when linking binary files (macos) (#236) 2020-04-01 10:38:33 +03:00
f018582446 Merge remote-tracking branch 'origin/hotfix/v5.5.1' into develop 2020-04-01 09:19:34 +03:00
4fc6511b37 . (#235) 2020-03-31 19:00:41 +03:00
52ff8af2be Feature/year (#234)
* Correct year detect on windows

* Remove qmake message
2020-03-31 15:15:17 +03:00
d29475b6fb Update base.pri (#233) 2020-03-30 17:45:42 +03:00
32e7193212 [x2t] Fix bug 44934 (#232) 2020-03-28 19:39:47 +03:00
23fc146eca Fix wget/curl parameters injection 2020-03-24 13:38:10 +03:00
c4ac29a97d . 2020-03-23 19:11:32 +03:00
9c24d4a4bb . 2020-03-20 16:22:20 +03:00
bd579b8004 Merge remote-tracking branch 'origin/hotfix/v5.5.1' into develop 2020-03-20 16:14:53 +03:00
7fd9e52bc3 Merge pull request #230 from ONLYOFFICE/feature/fix_bug_v5.5.1
fix bug in zip
2020-03-19 18:22:53 +03:00
dd13f9f24c fix bug in zip 2020-03-19 18:21:00 +03:00
a2d9c972c1 . 2020-03-19 15:53:22 +03:00
0fe3c3ece5 Merge pull request #228 from ONLYOFFICE/feature/fix_bug_v5.5.1
XlsxFormat - fix bug #44840
2020-03-19 12:56:48 +03:00
963d2f9589 . 2020-03-18 19:34:23 +03:00
d5574186b1 . 2020-03-18 19:29:13 +03:00
5d148a6d0d Set htmlfileinternal path to doctrenderer.config 2020-03-18 18:28:56 +03:00
d7af2cb41d Remove path to HtmlFileInternal from x2t xml params 2020-03-18 18:09:52 +03:00
ed5bfb7b27 Add gitignore file 2020-03-18 16:33:25 +03:00
b81e988da5 XlsxFormat - fix bug #44840 2020-03-18 15:15:26 +03:00
a7c868d3d1 Remove unused files 2020-03-18 09:55:30 +03:00
d34d80788b . 2020-03-17 18:57:30 +03:00
a381305a9f . 2020-03-17 16:25:18 +03:00
bb022c49bd Fix xp build 2020-03-16 17:54:21 +03:00
31e8a1cbdd Fix previous commit 2020-03-16 17:27:31 +03:00
a19074993d Fix xp artifacts 2020-03-16 17:23:27 +03:00
2621ff9b5c . 2020-03-14 13:31:10 +03:00
0a1c718cc0 Refactoring 2020-03-13 17:49:15 +03:00
751e39960c . 2020-03-12 14:18:04 +03:00
bc0bb1a721 Add constant for display nonprinting characters in native 2020-03-11 16:20:57 +03:00
fb5da5e4ff Extend event types for native 2020-03-11 11:37:54 +03:00
addd684e4a Revert "fix build"
This reverts commit 293f3c6cef.
2020-03-11 11:28:27 +03:00
293f3c6cef fix build 2020-03-11 11:25:02 +03:00
61a157a3c4 Update gitignore 2020-03-11 09:23:06 +03:00
a7ba4c471e [x2t] For bug 44756
Fixed opening docx with special tblpPr values
2020-03-10 14:42:50 +03:00
d9d161655c DocFormat - fix bug #44776 2020-03-06 15:21:22 +03:00
8c18843b58 [android][se] fix find oEncodindId 2020-03-05 16:31:15 +03:00
04d796d760 [x2t] For bug 44689
Fix DurableId generation. Numbers greater than 0x7FFFFFFE cause MS Office errors(ST_LongHexNumber by spec)
2020-03-05 13:24:22 +03:00
12c427b11e Merge branch 'hotfix/v5.5.1' of github.com:ONLYOFFICE/core into hotfix/v5.5.1 2020-03-05 12:05:12 +03:00
9415983797 Merge feature/pre5.5.1 into hotfix/v5.5.1 2020-03-05 12:04:10 +03:00
e82ea1bc5c Merge pull request #227 from ONLYOFFICE/feature/pre5.5.1
Feature/pre5.5.1
2020-03-05 11:23:06 +03:00
b100cb3927 Xlsx 2003 XML Document 2020-03-04 20:08:40 +03:00
2b3a0cd5b3 v5.5.0 2020-03-04 18:33:54 +03:00
49f4bdb933 v5.5.0 2020-03-04 18:09:03 +03:00
911fe73f58 Update gitignore 2020-03-04 13:21:55 +03:00
a577378a1e Merge pull request #225 from ONLYOFFICE/feature/pre_hotfix5.5.1
Hide openssl symbols
2020-03-04 10:14:56 +03:00
997bf0b887 Hide openssl symbols 2020-03-03 19:10:03 +03:00
428a2652de . 2020-02-27 18:27:30 +03:00
0580375bf4 x2t - fix bug #44640 2020-02-27 18:24:09 +03:00
51c1b7d21a Fix common apps (#224) 2020-02-27 15:09:14 +03:00
c8fbd13a31 Merge remote-tracking branch 'origin/release/v5.5.0' into develop 2020-02-26 11:56:37 +03:00
4b0ce196e8 [x2t] Fxi bug 44611 (#223) 2020-02-25 22:53:48 +03:00
ddacd8f2b0 . 2020-02-25 20:12:00 +03:00
49597e16ab Add defines for comments 2020-02-25 14:39:29 +03:00
7a713f925f App for server work with crypto files 2020-02-21 18:37:58 +03:00
d64bfc230a . 2020-02-21 15:23:18 +03:00
938d593fc4 . 2020-02-21 11:55:14 +03:00
b96189c213 [android][xt2] Fix overwrite document 2020-02-21 11:45:11 +03:00
987e6b6e76 [android][xt2] Open password odf document 2020-02-21 11:45:11 +03:00
a39652e1eb . 2020-02-20 19:46:11 +03:00
f62781de18 OdfFormatReader - embedded audio 2020-02-20 16:37:36 +03:00
aefef93e21 icu for ios (#221)
Co-authored-by: Alexey.Musinov <alexey.musinov@gmail.com>
2020-02-19 19:05:23 +03:00
4d4142f3ae . 2020-02-19 16:52:17 +03:00
22f9c5188d . 2020-02-18 19:24:53 +03:00
1781318bad [android] Fix overwrite document 2020-02-18 17:43:21 +03:00
b936394a68 Add defines of events for track reviews on mobile native 2020-02-18 09:20:25 +03:00
38926d086c icu for ios 2020-02-17 19:37:40 +03:00
f49d3756ea icu for ios 2020-02-17 17:39:57 +03:00
dcb0621e5f . 2020-02-17 15:53:33 +03:00
5a5a444f42 . 2020-02-14 18:27:39 +03:00
9b608b2f76 . 2020-02-14 14:42:14 +03:00
2c04e9fb57 Fix windows flags (#220) 2020-02-13 19:41:15 +03:00
4142577664 . 2020-02-13 18:32:22 +03:00
30e92bab83 icu for ios 2020-02-13 16:54:29 +03:00
6957af8450 icu for ios 2020-02-13 16:28:48 +03:00
9ba350035f Extend types of comment events 2020-02-12 16:55:20 +03:00
f356755725 build icu for ios 2020-02-12 16:20:18 +03:00
d865ec0b59 Extend types of comment events 2020-02-11 17:58:57 +03:00
2cdbcf4017 Add defines for read of comments 2020-02-10 13:31:17 +03:00
319a66181a . 2020-02-10 12:52:17 +03:00
e6007815a2 [x2t] Fix bug 44466 (#219)
Move m_oFirstLine, m_oHanging from CTwipsMeasure(unsigned) to CSignedTwipsMeasure
2020-02-07 18:39:20 +03:00
e4090bb123 . 2020-02-06 16:32:04 +03:00
b9d6e370ca OdfFormatWriter - fix bug #44403 2020-02-03 17:44:11 +03:00
0b5e521f0d DocxReader - fix bug #44364 2020-01-31 15:27:15 +03:00
593e18225e . 2020-01-30 19:07:57 +03:00
c064daed08 . 2020-01-30 17:51:52 +03:00
838d506af6 Word 2003 XML Document 2020-01-28 18:46:28 +03:00
56482f0524 Feature/build ios (#218)
* Fix build on ios in debug mode

* Fix ios build
2020-01-28 14:19:20 +03:00
dbf78d4c9f . 2020-01-27 18:04:50 +03:00
e1ec5066f5 . 2020-01-27 18:04:36 +03:00
70cefc0467 OdfFormatWriter - fix bug #44226 2020-01-27 18:02:47 +03:00
3b4d6147b3 [android] add field message for error 2020-01-26 15:12:06 +03:00
8114811bce Merge pull request #217 from ONLYOFFICE/release/v5.5.0
Release/v5.5.0
2020-01-22 10:38:27 +03:00
006d79851a OdfFormatWriter - fix bug #44193 2020-01-20 18:47:34 +03:00
656b443af7 . 2020-01-20 18:46:19 +03:00
fa472b3d9f OdfFormatWriter - fix bug #44190 2020-01-20 16:54:57 +03:00
b901073171 Remove travis build (#216)
This speed up PR process (requested by @K0R0L)
This build is deprecated, since build of project is moved
to another tool - `build_tool` since v5.5.0
And this config is never worked
See:
https://github.com/ONLYOFFICE/core/pull/29#issuecomment-306773327
2020-01-20 14:39:07 +03:00
03404d74a4 Merge pull request #215 from ONLYOFFICE/feature/fixBoost
Feature/fix boost
2020-01-20 14:21:13 +03:00
2154cb1dba Update boost build script for ios 2020-01-20 13:58:57 +03:00
f3fb3f7ca7 Fix build 2020-01-20 12:07:31 +03:00
3d154f9915 . 2020-01-16 20:20:08 +03:00
20090072ae Add new method (#214) 2020-01-16 18:17:27 +03:00
7a0c3c9bfa Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2020-01-15 18:31:10 +03:00
0cfb79f2aa OdfFormat - ... 2020-01-15 18:30:27 +03:00
405e5a4aaa XlsFormat - fix after testing 2020-01-15 18:29:45 +03:00
45cfdde703 Fix ios build 2020-01-15 18:25:19 +03:00
5fe7642ad7 Merge pull request #213 from ONLYOFFICE/release/v5.5.0
Add functionality to base.pri (#212)
2020-01-15 17:51:38 +03:00
bd85ec1b10 Add functionality to base.pri (#212) 2020-01-15 16:55:09 +03:00
18d61f9f14 Merge pull request #211 from ONLYOFFICE/release/v5.5.0
Release/v5.5.0
2020-01-15 15:50:05 +03:00
cee502b855 Add CopyDirectory method (#210) 2020-01-15 15:45:18 +03:00
524eac388e [x2t] For bug 38945 (#209)
For comments without author
2020-01-14 16:12:55 +03:00
9197a889a2 Fix build on ios in debug mode 2020-01-13 14:11:16 +03:00
0daaf560ae [x2t] For bug 44039 (#208)
Abs negative comment coordinates and offset as Excel does
2020-01-09 17:01:20 +03:00
e7c87085a7 Fix metafile to raster sizes (#207) 2020-01-09 15:37:39 +03:00
1b445aa3bb . 2020-01-09 10:41:41 +03:00
9a5cb77ca0 developing... 2020-01-07 19:08:08 +03:00
39ddc7582f Add Events to FileDownloader
OnComplete: worked
OnProgress: not implemented
2019-12-26 17:40:17 +03:00
6225da01dc [x2t] Fix bug 43709 2019-12-26 13:58:30 +03:00
0e17401c16 Merge remote-tracking branch 'origin/release/v5.5.0' into develop 2019-12-25 18:51:40 +03:00
00b16d548c . 2019-12-25 18:50:37 +03:00
9f5b114106 PptFormat - fix bug #43994 2019-12-25 18:31:57 +03:00
b277385d4f . 2019-12-24 19:18:05 +03:00
e91718f11b . 2019-12-22 15:16:29 +03:00
aacc6faf88 [x2t] Replace some AVS_FILEUTILS_ERROR_CONVERT errors with AVS_FILEUTILS_ERROR_CONVERT_PARAMS 2019-12-20 19:18:00 +03:00
442413f4a8 Fixed gitignore for build_tools 2019-12-20 13:23:07 +03:00
4f69be6dc5 [x2t] Fix crash in case of incorrect m_oInputLimit.template; Allow multiple m_oInputLimit 2019-12-19 11:34:50 +03:00
6522ded7d9 [android][x2t] add state 2019-12-18 17:27:50 +03:00
68f2c3f6eb . 2019-12-16 19:23:04 +03:00
6a8d109a47 x2t - from binary to docx for libreoffice 2019-12-16 18:12:07 +03:00
0ffe61b2fc . 2019-12-16 17:30:47 +03:00
f38e31a081 . 2019-12-16 15:47:29 +03:00
9a925ffa1b Merge branch 'feature/dylibs' into develop
* feature/dylibs:
  [ios] rmeove unsused project
2019-12-16 11:14:00 +03:00
f47b968000 Add support custom version & icon for branding docbuilder 2019-12-14 16:23:50 +03:00
1dfef1f347 Refactoring 2019-12-14 15:55:02 +03:00
f774f78a8d Fix build on xp 2019-12-14 12:53:16 +03:00
699e533fff Revert last commit 2019-12-13 18:52:06 +03:00
88fcbcee28 . 2019-12-13 16:27:30 +03:00
f754f81e6b [x2t] Fix CConditionalFormatValueObject::toXML2 2019-12-10 18:37:27 +03:00
19ae5946b9 [x2t] Remove undocumented param m_nDoctParams and doct xml param OnlyOnePage 2019-12-10 15:33:41 +03:00
3b8959b8a3 Switch doctrenderer param to json 2019-12-09 19:15:10 +03:00
0b651a95bc Switch doctrenderer param to json 2019-12-09 18:11:32 +03:00
43ce595c92 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-12-09 15:28:39 +03:00
9ba07b30f0 . 2019-12-09 15:22:50 +03:00
4c956f9a91 Move custom plist to build_tools 2019-12-08 23:12:13 +03:00
ca5307dd5d Switch to python version 2019-12-08 15:24:16 +03:00
ca348a9ea9 Fix update script 2019-12-08 13:50:25 +03:00
e94dfb53b0 Add support custom plist 2019-12-06 17:52:30 +03:00
b4d1b414ee Use custom plist 2019-12-06 17:40:02 +03:00
19ec211697 DocFormat - used user lcid 2019-12-06 17:39:03 +03:00
384d51318c RtfFormat - used user lcid 2019-12-06 17:14:54 +03:00
5a00bfb7b8 XlsFormat - used user lcid 2019-12-06 16:43:42 +03:00
453b3dc2b6 Remove StandardTester from git 2019-12-06 15:38:32 +03:00
6d70e67649 StandardTester new scheme 2019-12-06 15:12:28 +03:00
1e8b88b032 Fix bugs with standardtester 2019-12-06 14:30:41 +03:00
2f078de341 Fix bugs frameworks build 2019-12-06 11:39:55 +03:00
ec7d1efc93 . 2019-12-05 19:59:19 +03:00
ea99cf21b4 [x2t] Add m_nLcid option 2019-12-05 19:01:58 +03:00
0b8b524ebc . 2019-12-05 18:52:07 +03:00
1097518927 Fix bugs 2019-12-05 18:19:16 +03:00
26a9eda4ea Add frameworks build support 2019-12-05 18:15:23 +03:00
3012252048 Build on XP 2019-12-05 17:03:23 +03:00
f3fd70a895 bundle_dylibs support 2019-12-05 16:25:26 +03:00
998742d331 XlsFormat - fix after testing 2019-12-05 15:20:42 +03:00
0e9f4386cc [x2t] Fix bug 43375 2019-12-05 14:29:23 +03:00
0b518d2272 Deploy core archive from 'build_tools' dir 2019-12-04 19:36:34 +03:00
44b4a808c4 Change destination folder for standardtester 2019-12-04 16:29:53 +03:00
3e6c04fdf2 Fix build 2019-12-04 15:51:41 +03:00
f2c4f429b7 XlsFormat - fix bug #43746 2019-12-03 18:43:09 +03:00
2565ccacd7 OdfFormatWriter - fix after testing 2019-12-03 16:50:04 +03:00
f914bc03ea Add full bitcode support on ios 2019-12-03 11:35:45 +03:00
06b73865b8 . 2019-12-02 16:49:42 +03:00
3e651985c1 DocFormatReader - fix bug #43676 2019-12-02 12:16:12 +03:00
9ead37d43f Add support new build_tools 2019-11-29 18:30:31 +03:00
26b1b5acf0 Update boost.pri 2019-11-29 18:27:03 +03:00
194cd7b9dd Change icu.pri file 2019-11-29 16:43:30 +03:00
1724504378 XlsFormat - fix after testing 2019-11-27 19:31:11 +03:00
9b75205de1 Fix compile with no_dylibs flag 2019-11-27 17:47:07 +03:00
4b78d15845 Add support disabling dynamic libraries 2019-11-27 16:27:36 +03:00
93108c244a v5.4.2 2019-11-27 12:23:13 +03:00
fd1bc80682 OdfFormatReader - fix bug #43643 2019-11-26 19:27:41 +03:00
723c0f9f34 [x2t] Add editAs(xdr:twoCellAnchor) to Editor.bin 2019-11-26 15:27:06 +03:00
86fd036bad Correct build paths 2019-11-26 14:53:02 +03:00
932ec85676 [ios][x2t] Fixed path to sources of Pivot 2019-11-25 10:00:06 +03:00
84919a9a02 [ios][x2t] update settings 2019-11-22 19:36:46 +03:00
bd702e9c61 XlsFormat - fix after testing 2019-11-22 19:34:51 +03:00
5d7348ac8a [ios] rmeove unsused project 2019-11-22 13:04:04 +03:00
a547fa8ad1 . 2019-11-21 19:34:04 +03:00
30424c3c1f Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-11-21 19:00:10 +03:00
4e3dda042d . 2019-11-21 18:59:27 +03:00
40009363ee [x2t] Add m_sJsonParams option 2019-11-21 18:57:18 +03:00
70ccf677c3 Add embed-bitcode flag 2019-11-21 13:00:00 +03:00
50032f2fbf [x2t] For w14:checkbox 2019-11-20 15:07:42 +03:00
04c0030a85 OdfFormatReader - fix bug #43578 2019-11-20 14:06:45 +03:00
95a8c7870b OdfFormatReader - fix bug #43577 2019-11-19 19:47:03 +03:00
b58194b5b4 . 2019-11-15 14:53:13 +03:00
be35df9b5c . 2019-11-14 14:40:13 +03:00
b638f6336a . 2019-11-14 14:36:44 +03:00
79cfaed6a8 . 2019-11-14 13:53:33 +03:00
f677bf91e9 XlsFormat - fix after testing 2019-11-14 12:17:43 +03:00
3f5bc0f444 [ios][se] add clear curr font 2019-11-14 11:45:44 +03:00
c2cd9b7b87 [android][x2t] fix gradle script 2019-11-13 13:23:51 +03:00
68ad5e9515 XlsFormat - fix after testing 2019-11-12 17:31:56 +03:00
d808689cb3 x2t - for bug #40375. 2019-11-12 14:21:53 +03:00
f736a6e5fa [android][x2t] fix module script 2019-11-08 16:40:54 +03:00
460b087b1f [android][x2t] fix module script 2019-11-08 16:27:41 +03:00
447b590365 [android][x2t] fix build 2019-11-08 11:15:00 +03:00
af50daa022 XlsFormat - fix after testing 2019-11-07 19:30:54 +03:00
89df29b945 OdfFormatReader - fix comment range 2019-11-06 16:49:45 +03:00
b5b35f1d3d OdfFormatWriter - for bug #42982 2019-11-06 13:27:23 +03:00
b48406c941 OdfFormat - fix bug #43418, fix bug #42098 2019-11-05 19:21:34 +03:00
47826b7e23 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-11-01 14:43:00 +03:00
b9865d09c7 OdfFormatReader - fix bug #43420 2019-11-01 14:41:54 +03:00
d4577a487e Full support comparing files 2019-11-01 14:17:57 +03:00
36332af06e . 2019-10-31 18:32:17 +03:00
8c93208255 Merge remote-tracking branch 'origin/develop' into develop 2019-10-31 17:38:25 +03:00
7d45cfaf45 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-10-31 16:15:21 +03:00
858def093f developing... 2019-10-31 16:14:33 +03:00
be04366d4c [x2t] Fix bug 43423 2019-10-31 16:05:07 +03:00
8ab28c7ad3 [android][x2t] fix module dependency 2019-10-31 12:37:38 +03:00
8d6249f9a5 developing... 2019-10-30 20:16:59 +03:00
1bc6615534 [android][x2t] fix dependency version 2019-10-29 19:30:11 +03:00
6d46824387 [android][x2t] fix lib path 2019-10-29 18:00:28 +03:00
84a9194649 [android][x2t] fix lib names 2019-10-29 17:51:10 +03:00
f8c7bda679 [android][x2t] fix relative paths for windows 2019-10-29 16:41:31 +03:00
ea6f776dcb [ios][documents] fix build 2019-10-29 16:07:35 +03:00
9254479612 [android][x2t] fix relative paths 2019-10-29 15:55:05 +03:00
4f01ab3f7a [android][x2t] update x2t gui test app for x2t library 2019-10-29 15:45:12 +03:00
e2d2e2a7f2 [android][x2t] add module relative path 2019-10-29 15:45:12 +03:00
32909effd9 OdfFormatWriter - fix bug #43390 2019-10-29 14:56:33 +03:00
354a02b94c OdfFormat - fix bug #42098 2019-10-29 14:09:18 +03:00
195520d21c [android][x2t] add project for build library 2019-10-29 13:52:59 +03:00
3d2069592c [android][x2t] add project for build library 2019-10-29 13:15:01 +03:00
368ccff384 OdfFormat - fix bug #43369 2019-10-28 16:48:36 +03:00
6774ab10f5 [x2t] For pdf->pdf\a convertion 2019-10-25 20:08:28 +03:00
d3110f5c43 refactoring 2019-10-25 10:45:01 +03:00
015146a927 Inject builderJS object 2019-10-24 19:14:40 +03:00
ecbfefeb5c OdfFormatReader - fix bug #43347 2019-10-24 18:42:28 +03:00
57d0475281 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-10-24 17:09:38 +03:00
88aa8a4c54 x2t - fix bug #38594 2019-10-24 17:06:07 +03:00
56348548be fix previous merge 2019-10-24 16:42:36 +03:00
b21ff58336 Merge pull request #205 from alexandervnuchkov/patch-4
Update Readme.md
2019-10-24 15:15:27 +03:00
baaa6ed85b Update Readme.md 2019-10-24 12:35:59 +03:00
8f3ae7e04b Update build.sh [boost] 2019-10-24 10:36:35 +03:00
542d000435 Merge remote-tracking branch 'origin/feature/mobileIOS' into develop
# Conflicts:
#	DesktopEditor/doctrenderer/doctrenderer.pro
2019-10-24 10:24:53 +03:00
9edd45f1bb builderJS funcs 2019-10-23 18:53:46 +03:00
d9eb4f2cdc Refactoring (override GetTempPath) 2019-10-23 18:29:57 +03:00
590da3344b . 2019-10-23 14:43:46 +03:00
81a50062b1 [x2t] Fix bug 43301 2019-10-23 11:43:44 +03:00
c204d77b0d [x2t] Fix bug 43290 2019-10-22 19:41:02 +03:00
c6750bb7bc developing... 2019-10-22 17:58:03 +03:00
53d4825b13 . 2019-10-22 17:26:58 +03:00
0be8ff94a1 . 2019-10-22 15:12:54 +03:00
7d7d60bf08 test for ios x2t 2019-10-21 22:56:24 +03:00
c5c1911791 .
XlsFormat - fix after testing
2019-10-21 18:36:18 +03:00
0fb95e259c developing... 2019-10-21 17:34:10 +03:00
5db9ebe93a developing... 2019-10-21 11:15:13 +03:00
39ed75c19c developing... 2019-10-21 09:55:53 +03:00
5b9688e087 developing... 2019-10-20 00:07:19 +03:00
bd92dcf80b UnicodeConverter refactoring 2019-10-19 13:22:40 +03:00
f77dfa7825 UnicodeConverter refacoring 2019-10-19 12:55:27 +03:00
c26dc8cd78 developing... 2019-10-18 23:49:42 +03:00
c7308f4211 developing... 2019-10-18 23:49:21 +03:00
cbb2628856 . 2019-10-18 15:29:08 +03:00
ae90c75b78 developing... 2019-10-17 19:46:07 +03:00
5be7ca2bc5 developing... 2019-10-17 19:35:21 +03:00
79bccd5002 . 2019-10-17 14:31:46 +03:00
254db1fc2c Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-10-16 18:38:58 +03:00
d6735d1fb5 XlsFormat - fix after testing 2019-10-16 18:37:58 +03:00
9b3944a017 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11 2019-10-16 17:54:09 +03:00
6ebeaae305 Merge pull request #203 from ONLYOFFICE/hotfix/v5.4.2
Hotfix/v5.4.2
2019-10-16 14:08:44 +03:00
8cdaf43001 Feature/font bugs (#202)
* Fonts bugs

* Move fonts_check version to src file
2019-10-16 14:07:24 +03:00
ee0329cc1d . 2019-10-16 11:45:22 +03:00
52bf8581e7 XlsFormat - fix after testing 2019-10-15 18:33:28 +03:00
afc60a62a7 Fonts bugs 2019-10-15 16:46:09 +03:00
cb25a15a36 OdfFormat - fix bug #43170 2019-10-15 13:59:22 +03:00
cd0e152dbe Correct fetching boost 2019-10-15 09:53:05 +03:00
8d014ee27a refactoring 2019-10-14 19:04:55 +03:00
67a09bf28e Rename Api variable 2019-10-14 18:11:40 +03:00
9b1e705347 [x2t] Add missing from d4f2f69ed0 2019-10-14 10:31:22 +03:00
4f09747caf Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-10-12 16:31:12 +03:00
3af89f83eb XlsFormat - fix after testing 2019-10-12 16:29:30 +03:00
d4f2f69ed0 [x2t] Add SdtCheckBoxPr to Editor.bin 2019-10-11 20:14:55 +03:00
21984680ce XlsFormat - fix bug #43072 (#200) 2019-10-11 14:15:37 +03:00
6e2e23f5d0 XlsFormat - fix after testing 2019-10-11 12:30:16 +03:00
06b5f0e8b8 XlsFormat - fix bug #43133 2019-10-09 18:02:04 +03:00
484f6d2889 [android][se] fix temp path 2019-10-08 16:49:02 +03:00
1eaa656001 refactoring 2019-10-08 16:44:54 +03:00
5075d49b40 DocxFormat - for bug #43071 2019-10-07 16:52:38 +03:00
d5529f4077 Merge remote-tracking branch 'origin/develop' into develop 2019-10-07 16:04:37 +03:00
b4240ca49b [android][de & pe & se] get temp directory for Android 2019-10-07 16:00:08 +03:00
b04c6b2f87 [x2t] Add sortState.columnSort,sortMethod to Editor.bin 2019-10-07 15:30:36 +03:00
9d3b9ef021 XlsFormat - fix bug #43072 2019-10-07 14:09:09 +03:00
01577278f0 [android][de] temp directory for Android 2019-10-03 18:01:00 +03:00
f97050a685 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-10-02 15:05:05 +03:00
2715c774ed OdfFormatWriter - add pilot tables (pivot) 2019-10-02 15:04:30 +03:00
aa545edf3d [x2t] Add worksheet.sortState to Editor.bin 2019-10-02 13:46:41 +03:00
7626d6d75f v5.4.1 2019-10-02 12:07:22 +03:00
c8def9eb7b v5.4.1 2019-10-02 12:02:37 +03:00
cba74d6e8d . 2019-09-30 17:41:30 +03:00
62c9490282 DocxFormat - pivot cache 2019-09-30 16:40:19 +03:00
048318e341 Fix icu building (#198)
Change icu repos
2019-09-30 15:59:13 +03:00
0f25a738d5 Merge remote-tracking branch 'origin/hotfix/v5.4.1' into develop
# Conflicts:
#	DesktopEditor/fontengine/FontFile.h
2019-09-30 15:10:54 +03:00
0d327e7743 [ios][se] fixed build 2019-09-30 14:47:32 +03:00
49ee434202 Fix fonts bug (#196) 2019-09-30 14:39:57 +03:00
8b3f1b9d86 [x2t] Fix rtlGutter writing to Editor.bin 2019-09-30 14:17:10 +03:00
a76e93cea6 [x2t] Remove reply duplicates. Fix bug 42969 2019-09-27 12:04:56 +03:00
c26252d25f [x2t] Fix Excel recovery error; Fix bug 42968 2019-09-27 10:51:48 +03:00
2e23b79ab8 [x2t] Fix GenerateGuid. For bug 42947 2019-09-26 20:08:58 +03:00
7faa83eb8a Fix bug 42926 2019-09-26 16:17:24 +03:00
6d6d097069 Fix bug 42926 2019-09-26 15:54:55 +03:00
e9c1deaca6 fix error #42938 2019-09-24 18:56:54 +03:00
0b34858d49 fix error #42932 2019-09-24 18:56:28 +03:00
b900613df1 DocxFormat - pivot table 2019-09-21 14:58:10 +03:00
095c53a61a Merge pull request #195 from ONLYOFFICE/feature/fix_errors7_v5.4.1
RtfFormat - fix after testing
2019-09-18 12:42:49 +03:00
640b914ff8 RtfFormat - fix after testing 2019-09-18 12:40:50 +03:00
e48be100ed [x2t] Change tab type format in Editor.bin 2019-09-17 19:51:02 +03:00
429b4f1245 DocFormatReader - fix bullet picture(dib with pallete) 2019-09-17 13:08:14 +03:00
cc7dee211a Merge remote-tracking branch 'origin/hotfix/v5.4.1' into develop 2019-09-17 12:41:37 +03:00
3238d504eb Merge pull request #194 from ONLYOFFICE/feature/fix_errors6_v54.1
DocFormatReader - fix after testing
2019-09-13 17:09:26 +03:00
aeda8ec571 DocFormatReader - fix after testing 2019-09-13 17:08:12 +03:00
ec440d0bd3 [ios][x2t] fixed build 2019-09-13 16:48:44 +03:00
2d094ae872 Merge pull request #193 from ONLYOFFICE/feature/v8_7.0
.
2019-09-13 14:03:34 +03:00
839c180d8c . 2019-09-13 14:02:39 +03:00
3f55d6d4ff Merge pull request #192 from ONLYOFFICE/feature/v8_7.0
Feature/v8 7.0
2019-09-13 12:36:56 +03:00
d67a4b9f6e Merge remote-tracking branch 'remotes/origin/hotfix/v5.4.1' into develop
# Conflicts:
#	Common/DocxFormat/Source/XlsxFormat/Worksheets/DataValidation.cpp
2019-09-13 12:33:14 +03:00
eb9242cba0 developing 2019-09-13 11:55:09 +03:00
11eb11e502 developing 2019-09-12 18:39:45 +03:00
cf4451e60f [x2t] Fix table shd reading from Editor.bin 2019-09-12 15:04:05 +03:00
1e2b9dbc34 Support flv fotmat (and work v8 with newer gcc) 2019-09-12 14:11:06 +03:00
7d7b4b816f [x2t] Fix 42667
Fix typo
2019-09-11 19:32:34 +03:00
5405763b05 Merge pull request #189 from ONLYOFFICE/hotfix/v5.4.1
Hotfix/v5.4.1
2019-09-11 16:55:11 +03:00
0b468d5dd5 Support different theme thumbnails params 2019-09-11 16:38:25 +03:00
50477b5091 Merge pull request #188 from ONLYOFFICE/feature/fix_errors5_v5.4.1
x2t - fix after testing; fix error #42790
2019-09-11 15:57:19 +03:00
f53103efe0 x2t - fix after testing; fix error #42790 2019-09-11 15:56:03 +03:00
f57e9718b9 Merge pull request #187 from ONLYOFFICE/hotfix/v5.4.1
Hotfix/v5.4.1
2019-09-11 11:15:24 +03:00
a747f96a9d Fix fonts picker bugs 2019-09-09 15:05:41 +03:00
c5db9cf61f Merge pull request #186 from ONLYOFFICE/feature/bug-bookmark-writing
[x2t] Fix bookmarks saving inside hyperlink
2019-09-06 17:01:38 +03:00
c0cf748677 [x2t] Fix bookmarks saving inside hyperlink 2019-09-06 16:51:08 +03:00
148d6b01ef [x2t] Extend lvl Format in Editor.bin
(cherry picked from commit 41920875ff)
2019-09-05 13:17:09 +03:00
54dbe697f1 Merge remote-tracking branch 'origin/hotfix/v5.4.1' into develop 2019-09-05 12:55:32 +03:00
22306842d6 Merge pull request #185 from ONLYOFFICE/feature/fix_errors5_v5.4.1
x2t - fix after testing
2019-09-05 12:32:04 +03:00
e1237b99e2 x2t - fix after testing 2019-09-05 12:30:22 +03:00
66d534a415 [x2t] For c215344550. Fix memory leak 2019-09-04 10:34:33 +03:00
72467589e2 Merge pull request #184 from ONLYOFFICE/feature/fix_errors4_v5.4.1
XlsFormat - fix bug #42618, fix bug #42216
2019-09-03 18:00:39 +03:00
9739507dcd XlsFormat - fix bug #42618, fix bug #42216 2019-09-03 17:57:26 +03:00
c215344550 [x2t] Fix _xHHHH_ chars in dataValidation attributes. Fix bug 42663. 2019-09-03 17:41:04 +03:00
f849f79595 DocFormatReader - fix extended comments; fix bug #42654, fix bug #42239; OdfFormatWriter - fix error in headers/footers; fix after testing (#181)
* DocFormatReader - fix extended comments

* XlsFormatReader - fix bug #42239

* OdfFormatWriter - fix error in headers/footers

* OdfFormatWriter - fix bug #42654

* x2t - fix after testing

* .
2019-09-03 15:24:44 +03:00
4f42a2230e XlsFormatReader - fix bug #42239; OdfFormatWriter - fix error in headers/footers (#182)
* XlsFormatReader - fix bug #42239

* OdfFormatWriter - fix error in headers/footers
2019-09-03 15:24:23 +03:00
11dad1b10b v5.4.0 2019-09-03 14:37:38 +03:00
9fb9fd3511 Merge remote-tracking branch 'origin/feature/fix_errors2_v5.4.0' into develop 2019-09-03 11:52:25 +03:00
246474a2f7 Merge branch 'feature/fix_errors3_v.5.4.0' into feature/fix_errors2_v5.4.0 2019-09-03 11:47:23 +03:00
af0f878de2 [ios] refactoring 2019-09-03 10:53:09 +03:00
fc8d16196d Fixed project of OdfReaderFormat library for ios 2019-09-03 09:45:01 +03:00
41fc3eb8c1 x2t - fix after testing 2019-09-02 17:52:47 +03:00
53878c9d88 OdfFormatWriter - fix bug #42654 2019-09-02 16:00:46 +03:00
677982b4ce OdfFormatWriter - fix error in headers/footers 2019-09-02 12:58:53 +03:00
e7290f5ad9 XlsFormatReader - fix bug #42239 2019-09-02 11:43:54 +03:00
816c43bffe [android][de] fix emf 2019-09-02 08:56:17 +03:00
8dd58a2050 [android][de] fix emf 2019-08-31 11:32:27 +03:00
e96221c83b DocFormatReader - fix extended comments 2019-08-30 13:00:48 +03:00
2a4ee72059 [ios][x2t] fixed build 2019-08-29 18:14:37 +03:00
9a3e9a9851 [ios][x2t] fixed build 2019-08-29 18:07:34 +03:00
41920875ff [x2t] Extend lvl Format in Editor.bin 2019-08-29 14:18:10 +03:00
0ae9b97774 [ios][x2t] fixed build 2019-08-28 14:41:00 +03:00
c644c419ec Merge remote-tracking branch 'origin/release/v5.4.0' into develop 2019-08-28 13:45:01 +03:00
3874b56289 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-08-27 15:24:44 +03:00
29df40407e [android][se] fix crash 2019-08-27 14:57:13 +03:00
e3ff8912f0 [ios][de] update file utils 2019-08-26 17:12:06 +03:00
ae6d231acc OdfFormatW - fix after testing 2019-08-26 14:31:43 +03:00
98114aa7a5 fix bug #42542 2019-08-26 13:18:55 +03:00
cc8cfb6124 v5.3.5 2019-08-26 11:23:38 +03:00
1364 changed files with 68179 additions and 32836 deletions

6
.gitignore vendored
View File

@ -3,13 +3,17 @@ dictionaries/
LicenceManager/
Common/boost_1_58_0
Common/3dParty/boost/boost_1_58_0
Common/3dParty/boost/boost.data
Common/3dParty/boost/ios
Common/3dParty/boost/osx
Common/3dParty/icu/icu
Common/3dParty/icu/win_64
Common/3dParty/icu/win_32
Common/3dParty/icu/linux_64
Common/3dParty/icu/linux_32
Common/3dParty/icu/mac_64
Common/3dParty/icu/ios
Common/3dParty/icu/mac-build
Common/3dParty/cef/win_64
Common/3dParty/cef/win_32
Common/3dParty/cef/linux_64
@ -44,6 +48,7 @@ Common/3dParty/openssl/openssl
Thumbs.db
*.xcuserstate
*.xcuserdatad
**/Makefile.*
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2.idl
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2.tlb
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2.h
@ -51,7 +56,6 @@ ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_i.c
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_p.c
ASCOfficeXlsFile2/win32/dlldata.c
OfficeUtils/win32/OfficeUtilsLib/OfficeUtilsLib/ReadMe.txt
X2tConverter/**/Makefile.*
X2tConverter/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/Makefile
X2tConverter/Common/DocxFormat/DocxFormatLib/Makefile
*.7z

View File

@ -1,14 +0,0 @@
language: cpp
compiler: gcc
dist: trusty
addons:
apt:
packages:
- p7zip-full
script:
- exit 0
# Build fails anyway. See explanation in
# https://github.com/ONLYOFFICE/core/pull/29#issuecomment-306773327
- cd Common/3dParty && ./make.sh
- cd ../../
- make

View File

@ -641,7 +641,7 @@ namespace DocFileFormat
}
}
else
{
{
std::string sCodePage;
std::map<int, std::string>::const_iterator pFind = NSUnicodeConverter::mapEncodingsICU.find(code_page);
if (pFind != NSUnicodeConverter::mapEncodingsICU.end())
@ -653,7 +653,7 @@ namespace DocFileFormat
sCodePage = "CP1250"/* + std::to_string(code_page)*/;
NSUnicodeConverter::CUnicodeConverter oConverter;
std::wstring unicode_string = oConverter.toUnicode((char*)bytes, size, sCodePage.c_str());
std::wstring unicode_string = oConverter.toUnicode((char*)bytes, (unsigned int)size, sCodePage.c_str());
for (size_t i = 0; i < unicode_string.size(); i++)
{

View File

@ -35,6 +35,7 @@
#include <map>
#include <list>
#include <boost/shared_ptr.hpp>
#include "../../DesktopEditor/common/File.h"
@ -112,7 +113,10 @@ namespace XMLTools
class XMLElement
========================================================================================================*/
class XMLElement
class XMLElement;
typedef class boost::shared_ptr<XMLElement> XMLElementPtr;
class XMLElement
{
typedef std::pair< std::wstring, std::wstring> AttributeValuePair;
@ -180,7 +184,20 @@ namespace XMLTools
}
m_Elements.push_back( element );
}
void AppendChild( XMLElementPtr element, bool uniq = false)
{
if (!element) return;
if (m_ChildMap.find(element->GetName()) != m_ChildMap.end())
{
if (uniq) return;
}
else
{
m_ChildMap.insert(m_ChildMap.end(), std::pair<std::wstring, int>(element->GetName(), 0));
}
m_Elements.push_back( *element.get() );
}
void RemoveChild( const XMLElement& element )
{
m_Elements.remove( element );
@ -368,7 +385,6 @@ namespace XMLTools
}
};
class CStringXmlWriter
{
std::wstring m_str;
@ -383,6 +399,10 @@ namespace XMLTools
{
m_str = strValue;
}
void Clear()
{
m_str.clear();
}
bool SaveToFile(const std::wstring& strFilePath, bool bEncodingToUTF8 = false)
{
NSFile::CFileBinary file;

View File

@ -77,24 +77,28 @@ namespace DocFileFormat
return static_cast<ByteStructure*>(newObject);
}
ByteStructure* AnnotationReferenceExDescriptor::ConstructObject(VirtualStreamReader* reader, int length)
AnnotationReferenceExDescriptors::AnnotationReferenceExDescriptors(size_t count, POLE::Stream* stream, unsigned int fc, unsigned int lcb)
{
AnnotationReferenceExDescriptor *newObject = new AnnotationReferenceExDescriptor();
if (reader->nWordVersion > 0)
if ((lcb > 0) && (NULL != stream))
{
VirtualStreamReader reader(stream, (ULONG)fc, 0);
if (fc > reader.GetSize()) return;
for (size_t i = 0; i < (std::min)((unsigned int)count, lcb / 18); i++)
{
_desc desc;
desc.nDTTM = DateAndTime(reader.ReadUInt32());
reader.ReadUInt16(); //padding1
desc.nDepth = reader.ReadUInt32();
desc.nDiatrdParent = reader.ReadUInt32();
unsigned int flag = reader.ReadUInt32();
desc.fInkAtn = GETBIT(flag, 1);
m_ReferencesEx.push_back(desc);
}
}
else
{
m_nDTTM = DateAndTime(reader->ReadUInt32());
reader->ReadUInt16(); //padding1
m_nDepth = reader->ReadUInt32();
m_nDiatrdParent = reader->ReadUInt32();
unsigned int flag = reader->ReadUInt32();
m_fInkAtn = GETBIT(flag, 1);
}
return static_cast<ByteStructure*>(newObject);
}
}

View File

@ -63,30 +63,25 @@ namespace DocFileFormat
int m_CommentId;
};
class AnnotationReferenceExDescriptor: public ByteStructure
class AnnotationReferenceExDescriptors
{
public:
static const int STRUCTURE_SIZE = 18;
static const int STRUCTURE_SIZE_OLD = 0;
AnnotationReferenceExDescriptors(size_t count, POLE::Stream* stream, unsigned int fc, unsigned int lcb);
static const int GetSize(int nWordVersion)
{
return (nWordVersion > 0) ? STRUCTURE_SIZE_OLD : STRUCTURE_SIZE;
}
AnnotationReferenceExDescriptor() : m_nDepth(0), m_nDiatrdParent(0), m_fInkAtn(false)
virtual ~AnnotationReferenceExDescriptors()
{
}
virtual ~AnnotationReferenceExDescriptor()
//virtual ByteStructure* ConstructObject( VirtualStreamReader* reader, int length );
struct _desc
{
}
DateAndTime nDTTM;
unsigned int nDepth = 0;
int nDiatrdParent = 0;
bool fInkAtn = false;
};
virtual ByteStructure* ConstructObject( VirtualStreamReader* reader, int length );
DateAndTime m_nDTTM;
unsigned int m_nDepth;
unsigned int m_nDiatrdParent;
bool m_fInkAtn;
std::vector<_desc> m_ReferencesEx;
};
}

View File

@ -48,6 +48,9 @@ namespace DocFileFormat
{
m_document = static_cast<WordDocument*>( visited );
_UINT64 x = 0x10000001;
std::vector<std::wstring> arrParaId;
if ( ( m_document != NULL ) && ( m_document->FIB->m_RgLw97.ccpAtn > 0 ) )
{
m_context->_docx->RegisterComments();
@ -55,7 +58,6 @@ namespace DocFileFormat
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
m_pXmlWriter->WriteNodeBegin( L"w:comments", TRUE );
//write namespaces
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
@ -84,39 +86,27 @@ namespace DocFileFormat
size_t count = m_document->AnnotationsReferencePlex->Elements.size();
for (size_t index = 0; index < count; ++index)
{
{
_paraId.clear();
AnnotationReferenceDescriptor* atrdPre10 = static_cast<AnnotationReferenceDescriptor*>(m_document->AnnotationsReferencePlex->Elements[index]);
AnnotationReferenceExDescriptor* atrdPost10 = NULL;
if ((m_document->AnnotationsReferenceExPlex) && (index < m_document->AnnotationsReferenceExPlex->Elements.size()))
{
atrdPost10 = static_cast<AnnotationReferenceExDescriptor*>(m_document->AnnotationsReferenceExPlex->Elements[index]);
}
m_pXmlWriter->WriteNodeBegin( L"w:comment", TRUE );
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::SizeTToWideString(atrdPre10->m_CommentId));
//if (atrdPre10->m_BookmarkId < 0)//-1 - easy ref (not start/end comment ref)
//{
// m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::SizeTToWideString( index + 1 + count + 1024 ));
//}
//else
//{
// m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::SizeTToWideString( index + 1 ));
//}
if (atrdPost10)
{
m_pXmlWriter->WriteAttribute( L"w:date", atrdPost10->m_nDTTM.getString());
}
if (atrdPre10->m_AuthorIndex < m_document->AnnotationOwners->size()) //conv_253l2H1CehgKwsxCtNk__docx.doc
{
m_pXmlWriter->WriteAttribute( L"w:author",
FormatUtils::XmlEncode(m_document->AnnotationOwners->at( atrdPre10->m_AuthorIndex ) ));
}
if ((m_document->AnnotationsReferencesEx) && (index < m_document->AnnotationsReferencesEx->m_ReferencesEx.size()))
{
m_pXmlWriter->WriteAttribute( L"w:date", m_document->AnnotationsReferencesEx->m_ReferencesEx[index].nDTTM.getString());
}
m_pXmlWriter->WriteAttribute( L"w:initials", FormatUtils::XmlEncode(atrdPre10->m_UserInitials));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
while ( ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpHdr ) < (*m_document->IndividualCommentsPlex)[index + 1] )
@ -136,16 +126,70 @@ namespace DocFileFormat
}
else
{
//this PAPX is for a normal paragraph
if ((m_document->AnnotationsReferencesEx) && (index < m_document->AnnotationsReferencesEx->m_ReferencesEx.size()))
{
_paraId = XmlUtils::IntToString(x++, L"%08X");
}
cp = writeParagraph(cp, 0x7fffffff);
}
}
if (false == _paraId.empty())
arrParaId.push_back(_paraId);
m_pXmlWriter->WriteNodeEnd(L"w:comment" );
}
m_pXmlWriter->WriteNodeEnd( L"w:comments" );
m_context->_docx->CommentsXML = std::wstring(m_pXmlWriter->GetXmlString());
m_pXmlWriter->Clear();
if (false == arrParaId.empty() && (m_document->AnnotationsReferencesEx) && (false == m_document->AnnotationsReferencesEx->m_ReferencesEx.empty()))
{
m_context->_docx->RegisterCommentsExtended();
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
m_pXmlWriter->WriteNodeBegin( L"w15:commentsEx", TRUE );
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteAttribute( L"xmlns:wpc", L"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" );
m_pXmlWriter->WriteAttribute( L"xmlns:cx", L"http://schemas.microsoft.com/office/drawing/2014/chartex" );
m_pXmlWriter->WriteAttribute( L"xmlns:cx1", L"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" );
m_pXmlWriter->WriteAttribute( L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006" );
m_pXmlWriter->WriteAttribute( L"xmlns:m", L"http://schemas.openxmlformats.org/officeDocument/2006/math" );
m_pXmlWriter->WriteAttribute( L"xmlns:wp14", L"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" );
m_pXmlWriter->WriteAttribute( L"xmlns:wp", L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" );
m_pXmlWriter->WriteAttribute( L"xmlns:w14", L"http://schemas.microsoft.com/office/word/2010/wordml" );
m_pXmlWriter->WriteAttribute( L"xmlns:w15", L"http://schemas.microsoft.com/office/word/2012/wordml" );
m_pXmlWriter->WriteAttribute( L"xmlns:w16se", L"http://schemas.microsoft.com/office/word/2015/wordml/symex" );
m_pXmlWriter->WriteAttribute( L"xmlns:wpg", L"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" );
m_pXmlWriter->WriteAttribute( L"xmlns:wpi", L"http://schemas.microsoft.com/office/word/2010/wordprocessingInk" );
m_pXmlWriter->WriteAttribute( L"xmlns:wne", L"http://schemas.microsoft.com/office/word/2006/wordml" );
m_pXmlWriter->WriteAttribute( L"xmlns:wps", L"http://schemas.microsoft.com/office/word/2010/wordprocessingShape" );
m_pXmlWriter->WriteAttribute( L"mc:Ignorable", L"w14 w15 w16se wp14");
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
for (size_t index = 0; index < m_document->AnnotationsReferencesEx->m_ReferencesEx.size(); ++index)
{
m_pXmlWriter->WriteNodeBegin( L"w15:commentEx", TRUE );
m_pXmlWriter->WriteAttribute( L"w15:paraId", arrParaId[index]);
if (m_document->AnnotationsReferencesEx->m_ReferencesEx[index].nDepth > 0)
{
m_pXmlWriter->WriteAttribute( L"w15:paraIdParent", arrParaId[index + m_document->AnnotationsReferencesEx->m_ReferencesEx[index].nDiatrdParent]);
}
m_pXmlWriter->WriteAttribute( L"w15:done", L"0");
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd(L"w15:commentEx" );
}
m_pXmlWriter->WriteNodeEnd( L"w15:commentsEx" );
m_context->_docx->CommentsExtendedXML = std::wstring(m_pXmlWriter->GetXmlString());
}
}
}
};

View File

@ -91,6 +91,7 @@ namespace WordprocessingMLContentTypes
static const wchar_t* Settings = L"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";
static const wchar_t* Comments = L"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml";
static const wchar_t* CommentsExtended = L"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml";
static const wchar_t* Footnotes = L"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml";
static const wchar_t* Endnotes = L"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml";
@ -154,6 +155,7 @@ namespace OpenXmlRelationshipTypes
static const wchar_t* CustomXml = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml";
static const wchar_t* CustomXmlProperties = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps";
static const wchar_t* Comments = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
static const wchar_t* CommentsExtended = L"http://schemas.microsoft.com/office/2011/relationships/commentsExtended";
static const wchar_t* Footnotes = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes";
static const wchar_t* Endnotes = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes";
static const wchar_t* Header = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";

View File

@ -50,7 +50,7 @@
namespace DocFileFormat
{
Converter::Converter()
Converter::Converter() : m_nUserLCID(-1)
{
}
@ -204,7 +204,7 @@ namespace DocFileFormat
_UINT32 Converter::LoadAndConvert(const std::wstring& strSrcFile, const std::wstring& strDstDirectory, const std::wstring& password, const ProgressCallback* progress, bool &bMacros)
{
WordDocument doc(progress, m_sTempFolder);
WordDocument doc(progress, m_sTempFolder, m_nUserLCID);
WordprocessingDocument docx(strDstDirectory, &doc);
_UINT32 result = doc.LoadDocument(strSrcFile, password);

View File

@ -48,6 +48,7 @@ namespace DocFileFormat
~Converter();
std::wstring m_sTempFolder;
int m_nUserLCID;
_UINT32 LoadAndConvert(const std::wstring & strSrcFile, const std::wstring & strDstDirectory, const std::wstring & password, const ProgressCallback* progress, bool &bMacros);

View File

@ -37,103 +37,80 @@ namespace DocFileFormat
{
class DateAndTime
{
private:
/// minutes (0-59)
short mint;
/// hours (0-23)
short hr;
/// day of month (1-31)
short dom;
/// month (1-12)
short mon;
/// year (1900-2411)-1900
short yr;
/// weekday<br/>
/// 0 Sunday
/// 1 Monday
/// 2 Tuesday
/// 3 Wednesday
/// 4 Thursday
/// 5 Friday
/// 6 Saturday
short wdy;
protected:
short minutes;
short hour;
short day;
short month;
short year;
/// 0 Sunday
/// 1 Monday
/// 2 Tuesday
/// 3 Wednesday
/// 4 Thursday
/// 5 Friday
/// 6 Saturday
short weekday;
public:
DateAndTime()
{
setDefaultValues();
}
DateAndTime( unsigned int val )
DateAndTime( _UINT32 val )
{
DateAndTime((unsigned char*)&val, 4);
unsigned char* bytes = ((unsigned char*) &val);
minutes = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, 4 ), 0, 6 );
hour = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, 4 ), 6, 5 );
day = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, 4 ), 11, 5 );
month = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, 4 ), 16, 4 );
year = (short)( 1900 + FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, 4 ), 20, 9 ) );
weekday = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, 4 ), 29, 3 );
}
DateAndTime( unsigned char* bytes, int size )
{
if ( size == 4 )
{
this->mint = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, size ), 0, 6 );
this->hr = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, size ), 6, 5 );
this->dom = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, size ), 11, 5 );
this->mon = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, size ), 16, 4 );
this->yr = (short)( 1900 + FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, size ), 20, 9 ) );
this->wdy = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, size ), 29, 3 );
minutes = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, size ), 0, 6 );
hour = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, size ), 6, 5 );
day = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, size ), 11, 5 );
month = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, size ), 16, 4 );
year = (short)( 1900 + FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, size ), 20, 9 ) );
weekday = (short)FormatUtils::GetIntFromBits( FormatUtils::BytesToInt32( bytes, 0, size ), 29, 3 );
}
else
{
//throw new ByteParseException("Cannot parse the struct DTTM, the length of the struct doesn't match");
}
}
DateAndTime& operator=(const DateAndTime& oSrc)
{
minutes = oSrc.minutes;
hour = oSrc.hour;
day = oSrc.day;
month = oSrc.month;
year = oSrc.year;
weekday = oSrc.weekday;
return (*this);
}
std::wstring getString()
{
return std::to_wstring(yr) + L"-" + (mon < 9 ? L"0" : L"" ) + std::to_wstring(mon) + L"-" +
(dom < 9 ? L"0" : L"" ) + std::to_wstring(dom) + L"T" +
(hr < 9 ? L"0" : L"" ) + std::to_wstring(hr) + L":" +
(mint < 9 ? L"0" : L"" )+ std::to_wstring(mint) + L"Z";
return std::to_wstring(year) + L"-" + (month < 9 ? L"0" : L"" ) + std::to_wstring(month) + L"-" +
(day < 9 ? L"0" : L"" ) + std::to_wstring(day) + L"T" +
(hour < 9 ? L"0" : L"" ) + std::to_wstring(hour) + L":" +
(minutes < 9 ? L"0" : L"" ) + std::to_wstring(minutes) + L":00Z";
}
#if defined(_WIN32) || defined(_WIN64)
SYSTEMTIME ToSYSTEMTIME()
{
SYSTEMTIME st = { 0 };
if ( ( this->yr == 1900 ) && ( this->mon == 0 ) && ( this->dom == 0 ) &&
( this->hr == 0 ) && ( this->mint == 0 ) )
{
st.wYear = 1900;
st.wMonth = 1;
st.wDayOfWeek = 0;
st.wDay = 1;
st.wHour = 0;
st.wMinute = 0;
st.wSecond = 0;
st.wMilliseconds = 0;
return st;
}
else
{
st.wYear = this->yr;
st.wMonth = this->mon;
st.wDayOfWeek = 0;
st.wDay = this->dom;
st.wHour = this->hr;
st.wMinute = this->mint;
st.wSecond = 0;
st.wMilliseconds = 0;
return st;
}
}
#endif
private:
void setDefaultValues()
{
this->dom = 0;
this->hr = 0;
this->mint = 0;
this->mon = 0;
this->wdy = 0;
this->yr = 0;
day = 0;
hour = 0;
minutes = 0;
month = 0;
weekday = 0;
year = 0;
}
};
}

View File

@ -217,6 +217,11 @@ namespace DocFileFormat
// start paragraph
m_pXmlWriter->WriteNodeBegin(L"w:p", true);
if (false == _paraId.empty())
{
m_pXmlWriter->WriteAttribute(L"w14:paraId", _paraId);
}
writeParagraphRsid(papx);
// ----------- check for section properties
@ -369,7 +374,7 @@ namespace DocFileFormat
if (DocFileFormat::sprmPRsid == iter->OpCode)
{
std::wstring id = FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize), L"%08x");
std::wstring id = FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize), L"%08X");
m_context->AddRsid(id);
m_pXmlWriter->WriteAttribute(L"w:rsidP", id);
@ -416,21 +421,21 @@ namespace DocFileFormat
//append rsids
if (0 != rev.Rsid)
{
std::wstring rsid = FormatUtils::IntToFormattedWideString(rev.Rsid, L"%08x");
std::wstring rsid = FormatUtils::IntToFormattedWideString(rev.Rsid, L"%08X");
m_pXmlWriter->WriteAttribute(L"w:rsidR", rsid);
m_context->AddRsid(rsid);
}
if (0 != rev.RsidDel)
{
std::wstring rsidDel = FormatUtils::IntToFormattedWideString(rev.RsidDel, L"%08x");
std::wstring rsidDel = FormatUtils::IntToFormattedWideString(rev.RsidDel, L"%08X");
m_pXmlWriter->WriteAttribute(L"w:rsidDel", rsidDel);
m_context->AddRsid(rsidDel);
}
if (0 != rev.RsidProp)
{
std::wstring rsidProp = FormatUtils::IntToFormattedWideString(rev.RsidProp, L"%08x");
std::wstring rsidProp = FormatUtils::IntToFormattedWideString(rev.RsidProp, L"%08X");
m_pXmlWriter->WriteAttribute(L"w:rsidRPr", rsidProp);
m_context->AddRsid(rsidProp);
}
@ -1339,7 +1344,7 @@ namespace DocFileFormat
{
ParagraphPropertyExceptions* backup = _lastValidPapx;
std::map<short, short> boundaries;
std::map<short, short> mapBoundaries;
int cp = initialCp;
int fc = m_document->FindFileCharPos( cp );
@ -1383,7 +1388,8 @@ namespace DocFileFormat
}
if (nestingLevel == iTap_current)
{
for ( std::list<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); iter != papx->grpprl->end(); iter++ )
bool bPresent = false; //118854.doc
for ( std::list<SinglePropertyModifier>::reverse_iterator iter = papx->grpprl->rbegin(); !bPresent && iter != papx->grpprl->rend(); iter++ )
{
//find the tDef SPRM
DWORD code = iter->OpCode;
@ -1401,19 +1407,27 @@ namespace DocFileFormat
boundary1 = FormatUtils::BytesToInt16( iter->Arguments + 1, i * 2 , iter->argumentsSize );
boundary2 = FormatUtils::BytesToInt16( iter->Arguments + 1, ( i + 1 ) * 2, iter->argumentsSize );
AddBoundary(boundary1, boundary2, boundaries);
//if (boundary1 < 0) boundary1 = 0;
//if (boundary2 < 0) boundary2 = 0;
mapBoundaries.insert(std::make_pair(boundary1, 0));
mapBoundaries.insert(std::make_pair(boundary2, 0));
//AddBoundary(boundary1, boundary2, mapBoundaries);
}
if (max_boundary < boundary2)
max_boundary = boundary2;
AddBoundary(boundary2, max_boundary, boundaries);
mapBoundaries.insert(std::make_pair(boundary2, 0));
mapBoundaries.insert(std::make_pair(max_boundary, 0));
//AddBoundary(boundary2, max_boundary, mapBoundaries);
bPresent = true;
}break;
default:
break;
}
}
}
if (nestingLevel != iTap_current && fEndNestingLevel && !boundaries.empty())
if (nestingLevel != iTap_current && fEndNestingLevel && !mapBoundaries.empty())
break;
//get the next papx
papx = findValidPapx( fcRowEnd );
@ -1426,11 +1440,16 @@ namespace DocFileFormat
}
if ( !boundaries.empty() )
if ( !mapBoundaries.empty() )
{
for ( std::map<short, short>::iterator it = boundaries.begin(); it != boundaries.end(); ++it)
std::map<short, short>::iterator it = mapBoundaries.begin();
std::map<short, short>::iterator it_next = it; it_next++;
for ( ; it_next != mapBoundaries.end(); ++it_next, ++it)
{
grid.push_back( it->second );
int sz = it_next->first - it->first;
if (sz > 2)
grid.push_back( it_next->first - it->first );
}
}
_lastValidPapx = backup;

View File

@ -158,6 +158,8 @@ namespace DocFileFormat
std::wstring _writeAfterRun;
std::wstring _lastOLEObject;
int _cacheListNum;
std::wstring _paraId;
struct fieldLevels
{

View File

@ -492,9 +492,12 @@ namespace DocFileFormat
struct FibNew
{
FibNew() : nFibNew(Fib1997), cQuickSavesNew(0) {}
FibNew() : nFibNew(Fib1997), cQuickSavesNew(0), lidThemeOther(0), lidThemeFE(0), lidThemeCS(0) {}
FibVersion nFibNew;
WORD cQuickSavesNew;
WORD lidThemeOther;
WORD lidThemeFE;
WORD lidThemeCS;
};
@ -545,11 +548,11 @@ namespace DocFileFormat
}
else
{
/*ccpSpare0 = */ reader.ReadInt32();
/*ccpSpare1 = */ reader.ReadInt32();
/*ccpSpare2 = */ reader.ReadInt32();
int ccpSpare0 = reader.ReadInt32();
int ccpSpare1 = reader.ReadInt32();
int ccpSpare2 = reader.ReadInt32();
}
/*ccpSpare3 = */ reader.ReadInt32();
int ccpSpare3 = reader.ReadInt32();
if (m_FibBase.nFib > Fib1985)
{
@ -872,23 +875,43 @@ namespace DocFileFormat
}
if (m_FibBase.nFib > Fib1995 || m_FibBase.nFib == 0)
{
reader.ReadBytes(8, false); //68
int reserv1 = reader.ReadInt32();
int reserv2 = reader.ReadInt32();
m_RgLw97.ccpText = reader.ReadInt32(); //76
m_RgLw97.ccpFtn = reader.ReadInt32(); //80
m_RgLw97.ccpHdr = reader.ReadInt32(); //84
reader.ReadBytes( 4, false ); //88
int reserv3 = reader.ReadInt32();
m_RgLw97.ccpAtn = reader.ReadInt32(); //92
m_RgLw97.ccpEdn = reader.ReadInt32(); //96
m_RgLw97.ccpTxbx = reader.ReadInt32(); //100
m_RgLw97.ccpHdrTxbx = reader.ReadInt32(); //104
reader.ReadBytes(44, false); //108
int reserv4 = reader.ReadInt32();
int reserv5 = reader.ReadInt32();
int reserv6 = reader.ReadInt32();
int reserv7 = reader.ReadInt32();
int reserv8 = reader.ReadInt32();
int reserv9 = reader.ReadInt32();
int reserv10 = reader.ReadInt32();
int reserv11 = reader.ReadInt32();
int reserv12 = reader.ReadInt32();
int reserv13 = reader.ReadInt32();
int reserv14 = reader.ReadInt32();
cbRgFcLcb = reader.ReadUInt16(); //152
switch(cbRgFcLcb)
{
case 0x005D: m_FibBase.nFib = Fib1997; break;
case 0x006C: m_FibBase.nFib = Fib2000; break;
case 0x0088: m_FibBase.nFib = Fib2002; break;
case 0x00A4: m_FibBase.nFib = Fib2003; break;
case 0x00B7: m_FibBase.nFib = Fib2007; break;
}
m_FibWord97.fcStshfOrig = reader.ReadUInt32(); //154
m_FibWord97.lcbStshfOrig = reader.ReadUInt32(); //158
m_FibWord97.fcStshf = reader.ReadUInt32(); //162
@ -922,7 +945,7 @@ namespace DocFileFormat
m_FibWord97.fcSttbfFfn = reader.ReadUInt32(); //274
m_FibWord97.lcbSttbfFfn = reader.ReadUInt32(); //278
m_FibWord97.fcPlcfFldMom = reader.ReadUInt32(); //282
m_FibWord97.lcbPlcfFldMom = reader.ReadUInt32(); //286
m_FibWord97.lcbPlcfFldMom = reader.ReadUInt32(); //286
m_FibWord97.fcPlcfFldHdr = reader.ReadUInt32(); //290
m_FibWord97.lcbPlcfFldHdr = reader.ReadUInt32(); //294
m_FibWord97.fcPlcfFldFtn = reader.ReadUInt32(); //298
@ -1286,11 +1309,24 @@ namespace DocFileFormat
if (cswNew != 0)
{
//Read the FibRgCswNew
//Read the FibRgCswNew
m_FibNew.nFibNew = (FibVersion)reader.ReadUInt16();
if (m_FibNew.nFibNew == 0) m_FibNew.nFibNew = Fib1997;
m_FibNew.cQuickSavesNew = reader.ReadUInt16();
if (m_FibNew.nFibNew == 0x00D9 ||
m_FibNew.nFibNew == 0x0101 ||
m_FibNew.nFibNew == 0x010C )
{
}
else if (m_FibNew.nFibNew == 0x0112)
{
m_FibNew.lidThemeOther = reader.ReadUInt16();
m_FibNew.lidThemeFE = reader.ReadUInt16();
m_FibNew.lidThemeCS = reader.ReadUInt16();
}
}
}
FileInformationBlock( VirtualStreamReader reader )
@ -1363,13 +1399,26 @@ namespace DocFileFormat
}
else if (m_FibBase.nFib > Fib1995 || m_FibBase.nFib == 0)
{
//read the RgW97
reader.ReadBytes( 26, false ); //34
//read the RgW97
int reserv1 = reader.ReadUInt16();
int reserv2 = reader.ReadUInt16();
int reserv3 = reader.ReadUInt16();
int reserv4 = reader.ReadUInt16();
int reserv5 = reader.ReadUInt16();
int reserv6 = reader.ReadUInt16();
int reserv7 = reader.ReadUInt16();
int reserv8 = reader.ReadUInt16();
int reserv9 = reader.ReadUInt16();
int reserv10 = reader.ReadUInt16();
int reserv11 = reader.ReadUInt16();
int reserv12 = reader.ReadUInt16();
int reserv13 = reader.ReadUInt16();
m_RgW97.lidFE = reader.ReadUInt16(); //60
cslw = reader.ReadUInt16(); //62
//read the RgLW97
//read the RgLW97
m_RgLw97.cbMac = reader.ReadInt32(); //64
}

View File

@ -124,12 +124,12 @@ namespace DocFileFormat
//font signature
m_pXmlWriter->WriteNodeBegin( L"w:sig", TRUE );
m_pXmlWriter->WriteAttribute( L"w:usb0", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield0, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:usb1", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield1, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:usb2", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield2, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:usb3", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield3, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:csb0", FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield0, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:csb1", FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield1, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:usb0", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield0, L"%08X" ));
m_pXmlWriter->WriteAttribute( L"w:usb1", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield1, L"%08X" ));
m_pXmlWriter->WriteAttribute( L"w:usb2", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield2, L"%08X" ));
m_pXmlWriter->WriteAttribute( L"w:usb3", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield3, L"%08X" ));
m_pXmlWriter->WriteAttribute( L"w:csb0", FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield0, L"%08X" ));
m_pXmlWriter->WriteAttribute( L"w:csb1", FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield1, L"%08X" ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:sig" );

View File

@ -126,7 +126,7 @@ FormFieldData::FormFieldData( int type, const CharacterPropertyExceptions* chpx,
break;
case sprmCRsidText:
{
rsid = FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize), L"%08x");
rsid = FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize), L"%08X");
}
break;
case sprmCFData:

View File

@ -122,7 +122,8 @@ namespace DocFileFormat
fNumber1 == val.fNumber1 &&
fNumberAcross == val.fNumberAcross &&
fRestartHdn == val.fRestartHdn &&
fSpareX == val.fSpareX;
fSpareX == val.fSpareX &&
xst == val.xst;
return res;
}
@ -158,7 +159,8 @@ namespace DocFileFormat
fNumber1 == val->fNumber1 &&
fNumberAcross == val->fNumberAcross &&
fRestartHdn == val->fRestartHdn &&
fSpareX == val->fSpareX;
fSpareX == val->fSpareX &&
xst == val->xst;
return res;

View File

@ -129,6 +129,7 @@ namespace DocFileFormat
std::wstring xst; //32 chars ansi
public:
std::wstring rPr;
bool operator == (const NumberingDescriptor & val) const;
bool operator == (const NumberingDescriptorPtr & val) const;

View File

@ -72,16 +72,17 @@ namespace DocFileFormat
}
}
size_t ListTable::appendNumbering( NumberingDescriptorPtr &desc )
size_t ListTable::appendNumbering( NumberingDescriptorPtr &desc, const std::wstring & rPr )
{
for (size_t i = 0; i < listNumbering.size(); ++i)
{
if (listNumbering[i]->operator==(desc))
if (listNumbering[i]->operator == (desc))
{
return listNumbering[i]->id;
}
}
desc->id = listData.size() + listNumbering.size()/* + 1*/;
desc->rPr = rPr;
desc->id = listData.size() + listNumbering.size() + 1; // 23.doc
listNumbering.push_back(desc);
return desc->id;
}

View File

@ -47,6 +47,6 @@ namespace DocFileFormat
virtual ~ListTable();
ListTable( FileInformationBlock* fib, POLE::Stream* tableStream );
size_t appendNumbering( NumberingDescriptorPtr &desc );
size_t appendNumbering( NumberingDescriptorPtr &desc, const std::wstring & rPr );
};
}

View File

@ -87,7 +87,7 @@ namespace DocFileFormat
m_document->DocProperties->bDisplayBackgroundShape = true;
ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeBackgound();
ODRAW::OfficeArtFOPTEPtr boolFill = pShape->ExtractOption(fillStyleBooleanProperties);
ODRAW::OfficeArtFOPTEPtr boolFill = pShape->ExtractOption(ODRAW::fillStyleBooleanProperties);
ODRAW::FillStyleBooleanProperties* booleans = dynamic_cast<ODRAW::FillStyleBooleanProperties*>(boolFill.get());

View File

@ -97,7 +97,7 @@ namespace DocFileFormat
//nsid
m_pXmlWriter->WriteNodeBegin( L"w:nsid", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( rglst->listData[i]->lsid, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( rglst->listData[i]->lsid, L"%08X" ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
//multiLevelType
@ -120,7 +120,7 @@ namespace DocFileFormat
//template
m_pXmlWriter->WriteNodeBegin( L"w:tmpl", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( rglst->listData[i]->tplc, L"%08x"));
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( rglst->listData[i]->tplc, L"%08X"));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
// writes the levels
@ -540,17 +540,24 @@ namespace DocFileFormat
m_pXmlWriter->WriteNodeEnd(L"w:pPr");
// rPr
m_pXmlWriter->WriteNodeBegin( L"w:rPr", FALSE );
if (!fontFamily.empty())
if (false == lvl->rPr.empty())
{
m_pXmlWriter->WriteNodeBegin( L"w:rFonts", TRUE );
// w:hint="default"
m_pXmlWriter->WriteAttribute(L"w:hAnsi",fontFamily);
m_pXmlWriter->WriteAttribute(L"w:ascii",fontFamily);
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
m_pXmlWriter->WriteString( lvl->rPr );
}
else
{
m_pXmlWriter->WriteNodeBegin( L"w:rPr", FALSE );
if (!fontFamily.empty())
{
m_pXmlWriter->WriteNodeBegin( L"w:rFonts", TRUE );
// w:hint="default"
m_pXmlWriter->WriteAttribute(L"w:hAnsi", fontFamily);
m_pXmlWriter->WriteAttribute(L"w:ascii", fontFamily);
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
}
m_pXmlWriter->WriteNodeEnd(L"w:rPr");
}
m_pXmlWriter->WriteNodeEnd(L"w:rPr");
m_pXmlWriter->WriteNodeEnd(L"w:lvl");
}
@ -702,7 +709,7 @@ namespace DocFileFormat
}
}
if (isPictureBullet)
if (isPictureBullet && false == m_document->PictureBulletsCPsMap.empty())
{
m_pXmlWriter->WriteNodeBegin(L"w:lvlPicBulletId",TRUE);
m_pXmlWriter->WriteAttribute(L"w:val",FormatUtils::IntToWideString(index));

View File

@ -80,7 +80,7 @@ namespace DocFileFormat
ShapeOptions* sh_options = dynamic_cast<ShapeOptions*>( this->Children[j] );
if (sh_options)
{
if (sh_options->OptionsByID.end() != sh_options->OptionsByID.find(Pib))
if (sh_options->OptionsByID.end() != sh_options->OptionsByID.find(ODRAW::pib))
{
m_nShapeType = msosptPictureFrame;
}
@ -101,7 +101,7 @@ namespace DocFileFormat
return new ShapeContainer( _reader, bodySize, typeCode, version, instance );
}
ODRAW::OfficeArtFOPTEPtr ExtractOption(const PropertyId & prop) const
ODRAW::OfficeArtFOPTEPtr ExtractOption(const ODRAW::ePropertyId & prop) const
{
ODRAW::OfficeArtFOPTEPtr ret;
@ -111,7 +111,7 @@ namespace DocFileFormat
if ( opt == NULL ) continue;
std::map<PropertyId, ODRAW::OfficeArtFOPTEPtr>::iterator pFind = opt->OptionsByID.find(prop);
std::map<ODRAW::ePropertyId, ODRAW::OfficeArtFOPTEPtr>::iterator pFind = opt->OptionsByID.find(prop);
if (pFind != opt->OptionsByID.end())
{
ret = pFind->second;

View File

@ -36,432 +36,6 @@
namespace DocFileFormat
{
typedef enum _PropertyId
{
//Transform
PropertyId_left=0,
PropertyId_top=1,
PropertyId_right=2,
PropertyId_bottom=3,
PropertyId_rotation=4,
PropertyId_gvPage=5,
PropertyId_fChangePage=61,
PropertyId_fFlipV=62,
PropertyId_fFlipH=63,
//Protection
//fLockAgainstUngrouping=118,
//fLockRotation=119,
//fLockAspectRatio=120,
//fLockPosition=121,
//fLockAgainstSelect=122,
//fLockCropping=123,
//fLockVertices=124,
//fLockText=125,
//fLockAdjustHandles=126,
protectionBooleans=127,
//Text
lTxid=128,
dxTextLeft=129,
dyTextTop=130,
dxTextRight=131,
dyTextBottom=132,
WrapText=133,
scaleText=134,
anchorText=135,
txflTextFlow=136,
cdirFont=137,
hspNext=138,
txdir=139,
ccol=140,
dzColMargin=141,
textBooleanProperties=191,
//GeoText
gtextUNICODE=192,
gtextRTF=193,
gtextAlign=194,
gtextSize=195,
gtextSpacing=196,
gtextFont=197,
gtextCSSFont=198,
//gtextFReverseRows=240,
//fGtext=241,
//gtextFVertical=242,
//gtextFKern=243,
//gtextFTight=244,
//gtextFStretch=245,
//gtextFShrinkFit=246,
//gtextFBestFit=247,
//gtextFNormalize=248,
//gtextFDxMeasure=249,
//gtextFBold=250,
//gtextFItalic=251,
//gtextFUnderline=252,
//gtextFShadow=253,
//gtextFSmallcaps=254,
geometryTextBooleanProperties=255,
//BLIP
cropFromTop=256,
cropFromBottom=257,
cropFromLeft=258,
cropFromRight=259,
Pib=260,
pibName=261,
pibFlags=262,
pictureTransparent=263,
pictureContrast=264,
pictureBrightness=265,
pictureGamma=266,
pictureId=267,
pictureDblCrMod=268,
pictureFillCrMod=269,
pictureLineCrMod=270,
pibPrint=271,
pibPrintName=272,
pibPrintFlags=273,
movie=274,
pictureRecolor=282,
picturePreserveGrays=313,
blipBooleanProperties=319,
//Geometry
geoLeft=320,
geoTop=321,
geoRight=322,
geoBottom=323,
shapePath=324,
pVertices=325,
pSegmentInfo=326,
adjustValue=327,
adjust2Value=328,
adjust3Value=329,
adjust4Value=330,
adjust5Value=331,
adjust6Value=332,
adjust7Value=333,
adjust8Value=334,
adjust9Value=335,
adjust10Value=336,
pConnectionSites=337,
pConnectionSitesDir=338,
xLimo=339,
yLimo=340,
pAdjustHandles=341,
pGuides=342,
pInscribe=343,
cxk=344,
pFragments=345,
geometryBooleans=383,
//Fill Style
fillType=384,
fillColor=385,
fillOpacity=386,
fillBackColor=387,
fillBackOpacity=388,
fillCrMod=389,
fillBlip=390,
fillBlipName=391,
fillBlipFlags=392,
fillWidth=393,
fillHeight=394,
fillAngle=395,
fillFocus=396,
fillToLeft=397,
fillToTop=398,
fillToRight=399,
fillToBottom=400,
fillRectLeft=401,
fillRectTop=402,
fillRectRight=403,
fillRectBottom=404,
fillDztype=405,
fillShadePreset=406,
fillShadeColors=407,
fillOriginX=408,
fillOriginY=409,
fillShapeOriginX=410,
fillShapeOriginY=411,
fillShadeType=412,
fillColorExt=414,
fillColorExtMod=416,
fillBackColorExt=418,
fillBackColorExtMod=420,
fillStyleBooleanProperties=447,
//Line Style
lineColor=448,
lineOpacity=449,
lineBackColor=450,
lineCrMod=451,
lineType=452,
lineFillBlip=453,
lineFillBlipName=454,
lineFillBlipFlags=455,
lineFillWidth=456,
lineFillHeight=457,
lineFillDztype=458,
lineWidth=459,
lineMiterLimit=460,
lineStyle=461,
lineDashing=462,
lineDashStyle=463,
lineStartArrowhead=464,
lineEndArrowhead=465,
lineStartArrowWidth=466,
lineStartArrowLength=467,
lineEndArrowWidth=468,
lineEndArrowLength=469,
lineJoinStyle=470,
lineEndCapStyle=471,
lineStyleBooleans=511,
//Shadow Style
shadowType=512,
shadowColor=513,
shadowHighlight=514,
shadowCrMod=515,
shadowOpacity=516,
shadowOffsetX=517,
shadowOffsetY=518,
shadowSecondOffsetX=519,
shadowSecondOffsetY=520,
shadowScaleXToX=521,
shadowScaleYToX=522,
shadowScaleXToY=523,
shadowScaleYToY=524,
shadowPerspectiveX=525,
shadowPerspectiveY=526,
shadowWeight=527,
shadowOriginX=528,
shadowOriginY=529,
shadowStyleBooleanProperties=575,
//Perspective Style
perspectiveType=576,
perspectiveOffsetX=577,
perspectiveOffsetY=578,
perspectiveScaleXToX=579,
perspectiveScaleYToX=580,
perspectiveScaleXToY=581,
perspectiveScaleYToY=582,
perspectivePerspectiveX=583,
perspectivePerspectiveY=584,
perspectiveWeight=585,
perspectiveOriginX=586,
perspectiveOriginY=587,
perspectiveStyleBooleanProperties=639,
//3D Object
c3DSpecularAmt=640,
c3DDiffuseAmt=641,
c3DShininess=642,
c3DEdgeThickness=643,
C3DExtrudeForward=644,
c3DExtrudeBackward=645,
c3DExtrudePlane=646,
c3DExtrusionColor=647,
c3DCrMod=648,
threeDObjectBooleanProperties=703,
//3D Style
c3DYRotationAngle=704,
c3DXRotationAngle=705,
c3DRotationAxisX=706,
c3DRotationAxisY=707,
c3DRotationAxisZ=708,
c3DRotationAngle=709,
c3DRotationCenterX=710,
c3DRotationCenterY=711,
c3DRotationCenterZ=712,
c3DRenderMode=713,
c3DTolerance=714,
c3DXViewpoint=715,
c3DYViewpoint=716,
c3DZViewpoint=717,
c3DOriginX=718,
c3DOriginY=719,
c3DSkewAngle=720,
c3DSkewAmount=721,
c3DAmbientIntensity=722,
c3DKeyX=723,
c3DKeyY=724,
c3DKeyZ=725,
c3DKeyIntensity=726,
c3DFillX=727,
c3DFillY=728,
c3DFillZ=729,
c3DFillIntensity=730,
threeDStyleBooleanProperties=767,
//Shape
hspMaster=769,
cxstyle=771,
bWMode=772,
bWModePureBW=773,
bWModeBW=774,
idDiscussAnchor=775,
dgmLayout=777,
dgmNodeKind=778,
dgmLayoutMRU=779,
wzEquationXML=780,
shapeBooleans=831,
//Callout
spcot=832,
dxyCalloutGap=833,
spcoa=834,
spcod=835,
dxyCalloutDropSpecified=836,
dxyCalloutLengthSpecified=837,
fCallout=889,
fCalloutAccentBar=890,
fCalloutTextBorder=891,
fCalloutMinusX=892,
fCalloutMinusY=893,
fCalloutDropAuto=894,
fCalloutLengthSpecified=895,
//Groupe Shape
wzName=896,
wzDescription=897,
pihlShape=898,
pWrapPolygonVertices=899,
dxWrapDistLeft=900,
dyWrapDistTop=901,
dxWrapDistRight=902,
dyWrapDistBottom=903,
lidRegroup=904,
groupLeft=905,
groupTop=906,
groupRight=907,
groupBottom=908,
wzTooltip=909,
wzScript=910,
posh=911,
posrelh=912,
posv=913,
posrelv=914,
pctHR=915,
alignHR=916,
dxHeightHR=917,
dxWidthHR=918,
wzScriptExtAttr=919,
scriptLang=920,
wzScriptIdAttr=921,
wzScriptLangAttr=922,
borderTopColor=923,
borderLeftColor=924,
borderBottomColor=925,
borderRightColor=926,
tableProperties=927,
tableRowProperties=928,
scriptHtmlLocation=929,
wzApplet=930,
wzFrameTrgtUnused=932,
wzWebBot=933,
wzAppletArg=934,
wzAccessBlob=936,
metroBlob=937,
dhgt=938,
groupShapeBooleans = 959,
relRotation = 964,
//Unknown HTML
wzLineId=1026,
wzFillId=1027,
wzPictureId=1028,
wzPathId=1029,
wzShadowId=1030,
wzPerspectiveId=1031,
wzGtextId=1032,
wzFormulaeId=1033,
wzHandlesId=1034,
wzCalloutId=1035,
wzLockId=1036,
wzTextId=1037,
wzThreeDId=1038,
FakeShapeType=1039,
fFakeMaster=1086,
//Diagramm
dgmt=1280,
dgmStyle=1281,
pRelationTbl=1284,
dgmScaleX=1285,
dgmScaleY=1286,
dgmDefaultFontSize=1287,
dgmConstrainBounds=1288,
dgmBaseTextScale=1289,
fBorderlessCanvas=1338,
fNonStickyInkCanvas=1339,
fDoFormat=1340,
fReverse=1341,
fDoLayout=1342,
diagramBooleans=1343,
//Web Component
webComponentWzHtml=1664,
webComponentWzName=1665,
webComponentWzUrl=1666,
webComponentWzProperties=1667,
fIsWebComponent=1727,
//Clip
pVerticesClip=1728,
pSegmentInfoClip=1729,
shapePathClip=1730,
fClipToWrap=1790,
fClippedOK=1791,
//Ink
pInkData=1792,
fInkAnnotation=1852,
fHitTestInk=1853,
fRenderShape=1854,
fRenderInk=1855,
//Signature
wzSigSetupId=1921,
wzSigSetupProvId=192,
wzSigSetupSuggSigner=1923,
wzSigSetupSuggSigner2=1924,
wzSigSetupSuggSignerEmail=1925,
wzSigSetupSignInst=1926,
wzSigSetupAddlXml=1927,
wzSigSetupProvUrl=1928,
fSigSetupShowSignDate=1980,
fSigSetupAllowComments=1981,
fSigSetupSignInstSet=1982,
fIsSignatureLine=1983,
//Groupe Shape 2
pctHoriz=1984,
pctVert=1985,
pctHorizPos=1986,
pctVertPos=1987,
sizerelh=1988,
sizerelv=1989,
colStart=1990,
colSpan=1991
} PropertyId;
//!!!TODO: Реальные значения не соответствуют значениям из спецификации!!!
typedef enum _PositionHorizontal
{
@ -534,8 +108,8 @@ namespace DocFileFormat
static const unsigned short TYPE_CODE_0xF121 = 0xF121;
static const unsigned short TYPE_CODE_0xF122 = 0xF122;
std::vector<ODRAW::OfficeArtFOPTEPtr> Options;
std::map<PropertyId, ODRAW::OfficeArtFOPTEPtr> OptionsByID;
std::vector<ODRAW::OfficeArtFOPTEPtr> Options;
std::map<ODRAW::ePropertyId, ODRAW::OfficeArtFOPTEPtr> OptionsByID;
ShapeOptions() : Record()
{
@ -566,7 +140,7 @@ namespace DocFileFormat
{
Options[i]->ReadComplexData(Reader);
}
OptionsByID.insert(std::make_pair((PropertyId)Options[i]->opid, Options[i]));
OptionsByID.insert(std::make_pair((ODRAW::ePropertyId)Options[i]->opid, Options[i]));
}
Reader->Seek(( pos + size ), 0/*STREAM_SEEK_SET*/);

View File

@ -359,24 +359,24 @@ namespace DocFileFormat
return FootnotesRelationshipsFile.RelID;
}
int OpenXmlPackage::RegisterEndnotes()
{
return AddPart( L"word", L"endnotes.xml", WordprocessingMLContentTypes::Endnotes, OpenXmlRelationshipTypes::Endnotes );
}
int OpenXmlPackage::AddEndnotesPart( const std::wstring& fileName, const std::wstring& relationshipType, const std::wstring& targetMode )
{
EndnotesRelationshipsFile.Relationships.push_back( Relationship( ( std::wstring( L"rId" ) + FormatUtils::IntToWideString( ++EndnotesRelationshipsFile.RelID ) ), relationshipType, fileName, targetMode ) );
return EndnotesRelationshipsFile.RelID;
}
int OpenXmlPackage::RegisterComments()
{
return AddPart( L"word", L"comments.xml", WordprocessingMLContentTypes::Comments, OpenXmlRelationshipTypes::Comments );
}
int OpenXmlPackage::RegisterCommentsExtended()
{
return AddPart( L"word", L"commentsExtended.xml", WordprocessingMLContentTypes::CommentsExtended, OpenXmlRelationshipTypes::CommentsExtended );
}
int OpenXmlPackage::AddCommentsPart( const std::wstring& fileName, const std::wstring& relationshipType, const std::wstring& targetMode )
{
CommentsRelationshipsFile.Relationships.push_back( Relationship( ( std::wstring( L"rId" ) + FormatUtils::IntToWideString( ++CommentsRelationshipsFile.RelID ) ), relationshipType, fileName, targetMode ) );

View File

@ -176,6 +176,7 @@ namespace DocFileFormat
int RegisterFootnotes();
int RegisterEndnotes();
int RegisterComments();
int RegisterCommentsExtended();
int RegisterImage ( const IMapping* mapping, Global::BlipType blipType );
int RegisterHyperlink ( const IMapping* mapping, const std::wstring& link);
int RegisterOLEObject ( const IMapping* mapping, const std::wstring& objectType );

View File

@ -104,32 +104,33 @@ namespace DocFileFormat
}
//append formatting of paragraph end mark
XMLTools::XMLElementPtr rPr = XMLTools::XMLElementPtr(XMLTools::XMLElementPtr(new XMLTools::XMLElement( L"w:rPr" )));
if ( _paraEndChpx != NULL )
{
XMLTools::XMLElement* rPr = new XMLTools::XMLElement( L"w:rPr" );
//append properties
RevisionData* rev = new RevisionData( _paraEndChpx );
CharacterPropertiesMapping* ccMapping = new CharacterPropertiesMapping( rPr, m_document, rev, papx, false );
CharacterPropertiesMapping* ccMapping = new CharacterPropertiesMapping( rPr.get(), m_document, rev, papx, false );
_paraEndChpx->Convert( ccMapping );
//append delete infos
if ( rev->Type == Deleted )
{
XMLTools::XMLElement del( L"w:del" );
XMLTools::XMLElement del( L"w:del" );
rPr->AppendChild( del );
}
if( rPr->GetChildCount() >0 )
if( rPr->GetChildCount() > 0 )
{
_pPr->AppendChild( *rPr );
_pPr->AppendChild( rPr );
}
RELEASEOBJECT( ccMapping );
RELEASEOBJECT( rev );
RELEASEOBJECT( rPr );
}
bool bNumPr = false;
std::list<SinglePropertyModifier>::iterator end = papx->grpprl->end();
for (std::list<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); iter != end; ++iter)
{
@ -426,7 +427,10 @@ namespace DocFileFormat
if (m_document->listTable)
{
unsigned short numId = m_document->listTable->appendNumbering( desc );
std::wstring sRPr;
if (rPr->GetChildCount() > 0) sRPr = rPr->GetXMLString();
unsigned short numId = m_document->listTable->appendNumbering( desc, sRPr );
appendValueElement( &numPr, L"numId", numId, true );
}
}break;
@ -439,8 +443,10 @@ namespace DocFileFormat
case sprmOldPNLvlAnm:
{
short level = FormatUtils::BytesToUChar( iter->Arguments, 0, iter->argumentsSize) - 1;
if (level > 0 && level < 10)
appendValueElement( _pPr, L"outlineLvl", level, false );
level = 0;
appendValueElement( &numPr, L"ilvl", level, true );
bNumPr = true;
}break;
case sprmOldPFNoLineNumb:
@ -456,25 +462,11 @@ namespace DocFileFormat
case sprmPIlfo:
{
//Если numbering.xml пустой, то не пищем свойство
//Todo разобраться с закоментированным кодом
if (NULL != m_document->listTable && false == m_document->listTable->listData.empty())
{
unsigned short numId = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
appendValueElement( &numPr, L"numId", numId, true );
}
//check if there is a ilvl reference, if not, check the count of LVLs.
//if only one LVL exists in the referenced list, create a hard reference to that LVL
//if (containsLvlReference(papx.grpprl) == false)
//{
// ListFormatOverride lfo = m_context.Doc.ListFormatOverrideTable[val];
// int index = NumberingMapping.FindIndexbyId(m_context.Doc.ListTable, lfo.lsid);
// ListData lst = m_context.Doc.ListTable[index];
// if (lst.rglvl.Length == 1)
// {
// appendValueElement(numPr, "ilvl", "0", true);
// }
//}
}
break;
@ -645,15 +637,18 @@ namespace DocFileFormat
}break;
}
}
//append frame properties
if ( numPr.GetChildCount() > 0 && ((bNumPr && m_document->nWordVersion > 0) || m_document->nWordVersion == 0))//append numPr
{//23.doc
_pPr->AppendChild( numPr );
}
if ( _framePr->GetAttributeCount() > 0 )
{
_pPr->AppendChild( *_framePr );
}
_isSectionPageBreak = 0;
//append section properties
if ( _sepx != NULL )
{
XMLTools::XMLElement sectPr( L"w:sectPr" );
@ -672,34 +667,27 @@ namespace DocFileFormat
_pPr->AppendChild( sectPr );
}
//append indent
if ( ind.GetAttributeCount() > 0 )
{
_pPr->AppendChild( ind );
}
if ( spacing.GetAttributeCount() > 0 )//append spacing
if ( spacing.GetAttributeCount() > 0 )
{
_pPr->AppendChild( spacing );
}
if ( jc ) //append justification
if ( jc )
{
_pPr->AppendChild( *jc );
RELEASEOBJECT( jc );
}
if ( numPr.GetChildCount() > 0 )//append numPr
{
_pPr->AppendChild( numPr );
}
if ( pBdr.GetChildCount() > 0 ) //append borders
if ( pBdr.GetChildCount() > 0 )
{
_pPr->AppendChild( pBdr );
}
//write Properties
if ( ( _pPr->GetChildCount() > 0 ) || ( _pPr->GetAttributeCount() > 0 ) )
{
m_pXmlWriter->WriteString( _pPr->GetXMLString() );

View File

@ -45,7 +45,7 @@
namespace ImageHelper
{
Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, const std::wstring& file_name)//without ext
Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, std::wstring& file_name)//without ext
{
Global::_BlipType result = Global::msoblipERROR;
@ -99,14 +99,21 @@ namespace ImageHelper
//if (header->biWidth % 2 != 0 && sz_bitmap < size -offset)
// header->biWidth++;
if (header->biClrUsed > 0)
{
oFrame.put_Palette((unsigned char*)data + offset, header->biClrUsed);
offset += header->biClrUsed * 4;
}
int stride = -(size - offset) / header->biHeight;
if (-stride >= header->biWidth && header->biBitCount >= 24)
if (-stride >= header->biWidth/* && header->biBitCount >= 24*/)
{
result = Global::msoblipPNG;
}
oFrame.put_Stride (stride/*header->biBitCount * header->biWidth /8*/);
oFrame.put_Stride(stride);
biSizeImage = header->biSizeImage > 0 ? header->biSizeImage : (size - offset);
}
@ -117,24 +124,28 @@ namespace ImageHelper
{
oFrame.put_Data((unsigned char*)data + offset);
if (!oFrame.SaveFile(file_name + L".png", 4/*CXIMAGE_FORMAT_PNG*/))
result = Global::msoblipERROR;
file_name += L".png";
if (!oFrame.SaveFile(file_name, 4/*CXIMAGE_FORMAT_PNG*/))
{
result = Global::msoblipDIB;
}
oFrame.put_Data(NULL);
}
else if (result == Global::msoblipWMF)
{
file_name += L".wmf";
NSFile::CFileBinary file;
if (file.CreateFileW(file_name + L".wmf"))
if (file.CreateFileW(file_name))
{
file.WriteFile((BYTE*)data, size);
file.CloseFile();
}
}
else if (biSizeImage > 0)
if (biSizeImage > 0 && result == Global::msoblipDIB)
{
file_name += L".bmp";
NSFile::CFileBinary file;
if (file.CreateFileW(file_name + L".bmp"))
if (file.CreateFileW(file_name))
{
_UINT16 vtType = 0x4D42; file.WriteFile((BYTE*)&vtType, 2);
_UINT32 dwLen = biSizeImage; file.WriteFile((BYTE*)&dwLen, 4);

View File

@ -162,6 +162,6 @@ namespace ImageHelper
_UINT16 bcBitCount;
};
Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, const std::wstring& file_name);
Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, std::wstring& file_name);
}

View File

@ -77,13 +77,13 @@ namespace DocFileFormat
}
StringTable( VirtualStreamReader *reader, int code_page_ ):
code_page(code_page_), fExtend(false), cbData(0), cbExtra(0), DataExtra(NULL)
code_page(code_page_), fExtend(false), cbData(0), cbExtra(0)
{
parse( reader, (unsigned int)reader->GetPosition(), 0, false );
}
StringTable( POLE::Stream* tableStream, unsigned int fc, unsigned int lcb, int nWordVersion, bool bReadExta = false) :
code_page(1250), fExtend(false), cbData(0), cbExtra(0), DataExtra(NULL)
code_page(1250), fExtend(false), cbData(0), cbExtra(0)
{
if ( lcb > 0 )
{

View File

@ -96,94 +96,100 @@ namespace DocFileFormat
break;
}
}
std::list<SinglePropertyModifier>::const_reverse_iterator rend = tapx->grpprl->rend();
for (std::list<SinglePropertyModifier>::const_reverse_iterator iter = tapx->grpprl->rbegin(); iter != rend; ++iter)
bool bPresentDefTable = false;
for (std::list<SinglePropertyModifier>::reverse_iterator iter = tapx->grpprl->rbegin(); iter != tapx->grpprl->rend(); ++iter)
{
switch (iter->OpCode)
{
case sprmOldTDefTable:
case sprmTDefTable:
{
SprmTDefTable tdef(iter->Arguments, iter->argumentsSize);
int cc = tdef.numberOfColumns;
_tGrid = tdef.rgdxaCenter;
_tcDef = tdef.rgTc80[(std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1)];
appendValueElement( _tcPr, L"textDirection", FormatUtils::MapValueToWideString( _tcDef.textFlow, &Global::TextFlowMap[0][0], 6, 6 ), false );
if ( _tcDef.vertMerge == Global::fvmMerge )
if (!bPresentDefTable) //118854.doc
{
appendValueElement( _tcPr, L"vMerge", L"continue", false );
}
else if ( _tcDef.vertMerge == Global::fvmRestart )
{
appendValueElement( _tcPr, L"vMerge", L"restart", false );
}
bPresentDefTable = true;
appendValueElement( _tcPr, L"vAlign", FormatUtils::MapValueToWideString( _tcDef.vertAlign, &Global::VerticalAlignMap[0][0], 3, 7 ), false );
SprmTDefTable tdef(iter->Arguments, iter->argumentsSize);
int cc = tdef.numberOfColumns;
if ( _tcDef.fFitText )
{
appendValueElement( _tcPr, L"tcFitText", L"", false );
}
_tGrid = tdef.rgdxaCenter;
_tcDef = tdef.rgTc80[(std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1)];
if ( _tcDef.fNoWrap )
{
appendValueElement( _tcPr, L"noWrap", L"", true );
}
//int ind = (std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1);
//int ind1 = ind;
//while (ind1 < tdef.rgdxaCenter.size() - 1)
//{
// int sz = tdef.rgdxaCenter[ ind1 + 1] - tdef.rgdxaCenter[ ind1 ] ;
// if (sz > 1)
// break;
// ind1++;
//}
appendValueElement( _tcPr, L"textDirection", FormatUtils::MapValueToWideString( _tcDef.textFlow, &Global::TextFlowMap[0][0], 6, 6 ), false );
if (tdef.rgTc80[_cellIndex].horzMerge == 1)
{
for (size_t i = _cellIndex; i < tdef.rgTc80.size(); i++)
if ( _tcDef.vertMerge == Global::fvmMerge )
{
if (tdef.rgTc80[i].horzMerge < 1)
break;
nComputedCellWidth += tdef.rgdxaCenter[ i + 1] - tdef.rgdxaCenter[ i ] ;
_gridSpan++;
appendValueElement( _tcPr, L"vMerge", L"continue", false );
}
else if ( _tcDef.vertMerge == Global::fvmRestart )
{
appendValueElement( _tcPr, L"vMerge", L"restart", false );
}
}
else if (tdef.rgTc80[_cellIndex].horzMerge == 2)
{//skip cover cell
_gridSpan = 1;
nComputedCellWidth = 0;
_bCoverCell = true;
}
else
{
_gridSpan = 1;
appendValueElement( _tcPr, L"vAlign", FormatUtils::MapValueToWideString( _tcDef.vertAlign, &Global::VerticalAlignMap[0][0], 3, 7 ), false );
nComputedCellWidths += (tdef.rgdxaCenter[ _cellIndex + 1] - tdef.rgdxaCenter[ 0 ]);
nComputedCellWidth += tdef.rgTc80[ _cellIndex].wWidth > 1 ? tdef.rgTc80[ _cellIndex].wWidth : (tdef.rgdxaCenter[ _cellIndex + 1] - tdef.rgdxaCenter[ _cellIndex ]);
//Технические_Требования_1_287_ДИТ.DOC
if ( _tcDef.fFitText )
{
appendValueElement( _tcPr, L"tcFitText", L"", false );
}
}
if ( _tcDef.fNoWrap )
{
appendValueElement( _tcPr, L"noWrap", L"", true );
}
//int ind = (std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1);
//int ind1 = ind;
//while (ind1 < tdef.rgdxaCenter.size() - 1)
//{
// int sz = tdef.rgdxaCenter[ ind1 + 1] - tdef.rgdxaCenter[ ind1 ] ;
// if (sz > 1)
// break;
// ind1++;
//}
if (!IsTableBordersDefined(tapx->grpprl))
{
RELEASEOBJECT(_brcTop);
_brcTop = new BorderCode(*_tcDef.brcTop);
if (tdef.rgTc80[_cellIndex].horzMerge == 1)
{
for (size_t i = _cellIndex; i < tdef.rgTc80.size(); i++)
{
if (tdef.rgTc80[i].horzMerge < 1)
break;
nComputedCellWidth += tdef.rgdxaCenter[ i + 1] - tdef.rgdxaCenter[ i ] ;
_gridSpan++;
}
}
else if (tdef.rgTc80[_cellIndex].horzMerge == 2)
{//skip cover cell
_gridSpan = 1;
nComputedCellWidth = 0;
_bCoverCell = true;
RELEASEOBJECT(_brcLeft);
_brcLeft = new BorderCode(*_tcDef.brcLeft);
}
else
{
_gridSpan = 1;
RELEASEOBJECT(_brcRight);
_brcRight = new BorderCode(*_tcDef.brcRight);
nComputedCellWidths += (tdef.rgdxaCenter[ _cellIndex + 1] - tdef.rgdxaCenter[ 0 ]);
nComputedCellWidth += tdef.rgTc80[ _cellIndex].wWidth > 1 ? tdef.rgTc80[ _cellIndex].wWidth : (tdef.rgdxaCenter[ _cellIndex + 1] - tdef.rgdxaCenter[ _cellIndex ]);
//Технические_Требования_1_287_ДИТ.DOC
RELEASEOBJECT(_brcBottom);
_brcBottom = new BorderCode(*_tcDef.brcBottom);
}
if (!IsTableBordersDefined(tapx->grpprl))
{
RELEASEOBJECT(_brcTop);
_brcTop = new BorderCode(*_tcDef.brcTop);
RELEASEOBJECT(_brcLeft);
_brcLeft = new BorderCode(*_tcDef.brcLeft);
RELEASEOBJECT(_brcRight);
_brcRight = new BorderCode(*_tcDef.brcRight);
RELEASEOBJECT(_brcBottom);
_brcBottom = new BorderCode(*_tcDef.brcBottom);
}
}
}
break;

View File

@ -225,8 +225,11 @@ namespace DocFileFormat
documentMapping->m_document->nWordVersion);
std::list<CharacterPropertyExceptions*>* chpxs = documentMapping->m_document->GetCharacterPropertyExceptions( fcRowEnd, fcRowEnd + 1 );
TableRowPropertiesMapping trpMapping( documentMapping->GetXMLWriter(), *(chpxs->begin()) );
tapx.Convert( &trpMapping );
if (chpxs)
{
TableRowPropertiesMapping trpMapping( documentMapping->GetXMLWriter(), *(chpxs->begin()) );
tapx.Convert( &trpMapping );
}
documentMapping->_lastValidPapx = papxBackup;
documentMapping->_lastValidSepx = sepxBackup;

View File

@ -336,7 +336,7 @@ namespace DocFileFormat
}
}
}break;
case metroBlob:
case ODRAW::metroBlob:
{//встроенная неведомая хуйня
ODRAW::MetroBlob* blob = dynamic_cast<ODRAW::MetroBlob*>(iter.get());
if (blob)
@ -350,28 +350,28 @@ namespace DocFileFormat
}
}break;
//BORDERS
case borderBottomColor:
case ODRAW::borderBottomColor:
if (!pict->brcBottom)
{
RGBColor bottomColor( (int)iter->op, RedFirst );
m_pXmlWriter->WriteAttribute( L"o:borderbottomcolor", L"#" + bottomColor.SixDigitHexCode);
}
break;
case borderLeftColor:
case ODRAW::borderLeftColor:
if (!pict->brcLeft)
{
RGBColor leftColor( (int)iter->op, RedFirst );
m_pXmlWriter->WriteAttribute( L"o:borderleftcolor", L"#" + leftColor.SixDigitHexCode);
}
break;
case borderRightColor:
case ODRAW::borderRightColor:
if (!pict->brcRight)
{
RGBColor rightColor( (int)iter->op, RedFirst );
m_pXmlWriter->WriteAttribute( L"o:borderrightcolor", L"#" + rightColor.SixDigitHexCode);
}
break;
case borderTopColor:
case ODRAW::borderTopColor:
if (!pict->brcTop)
{
RGBColor topColor( (int)iter->op, RedFirst );
@ -379,28 +379,28 @@ namespace DocFileFormat
}
break;
//CROPPING
case cropFromBottom:
case ODRAW::cropFromBottom:
{
//cast to signed integer
int cropBottom = (int)iter->op;
appendValueAttribute(m_imageData, L"cropbottom", FormatUtils::IntToWideString( cropBottom ) + L"f" );
}
break;
case cropFromLeft:
case ODRAW::cropFromLeft:
{
//cast to signed integer
int cropLeft = (int)iter->op;
appendValueAttribute(m_imageData, L"cropleft", FormatUtils::IntToWideString( cropLeft ) + L"f" );
}
break;
case cropFromRight:
case ODRAW::cropFromRight:
{
//cast to signed integer
int cropRight = (int)iter->op;
appendValueAttribute(m_imageData, L"cropright", FormatUtils::IntToWideString( cropRight ) + L"f" );
}
break;
case cropFromTop:
case ODRAW::cropFromTop:
{
//cast to signed integer
int cropTop = (int)iter->op;
@ -408,7 +408,7 @@ namespace DocFileFormat
}
break;
//------------------------------------------------------------
case PropertyId_rotation:
case ODRAW::ePropertyId_rotation:
{
double dAngle = (double)((int)iter->op) / 65535.0;
@ -420,23 +420,23 @@ namespace DocFileFormat
appendStyleProperty(strStyle, L"rotation", FormatUtils::DoubleToWideString(dAngle));
}break;
case posh:
case ODRAW::posh:
{
appendStyleProperty(strStyle, L"mso-position-horizontal", VMLShapeMapping::mapHorizontalPosition((PositionHorizontal)iter->op));
}break;
case posrelh:
case ODRAW::posrelh:
{
appendStyleProperty(strStyle, L"mso-position-horizontal-relative", VMLShapeMapping::mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op));
}break;
case posv:
case ODRAW::posv:
{
appendStyleProperty(strStyle, L"mso-position-vertical", VMLShapeMapping::mapVerticalPosition((PositionVertical)iter->op));
}break;
case posrelv:
case ODRAW::posrelv:
{
appendStyleProperty(strStyle, L"mso-position-vertical-relative", VMLShapeMapping::mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
}break;
case groupShapeBooleans:
case ODRAW::groupShapeBooleanProperties:
{
ODRAW::GroupShapeBooleanProperties* booleans = dynamic_cast<ODRAW::GroupShapeBooleanProperties*>(iter.get());
@ -559,8 +559,8 @@ namespace DocFileFormat
pict->embeddedData = newData;
}
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(Global::msoblipDIB),
pict->embeddedData, pict->embeddedDataSize, Global::msoblipDIB));
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(btWin32),
pict->embeddedData, pict->embeddedDataSize, btWin32));
m_nImageId = m_context->_docx->RegisterImage(m_caller, btWin32);
result = true;
@ -589,22 +589,20 @@ namespace DocFileFormat
BitmapBlip* bitBlip = static_cast<BitmapBlip*>(oBlipEntry->Blip);
if (bitBlip)
{
std::wstring file_name = m_context->_doc->m_sTempFolder + L"tmp_image";
std::wstring file_name = m_context->_doc->m_sTempFolder + FILE_SEPARATOR_STR + L"tmp_image";
oBlipEntry->btWin32 = ImageHelper::SaveImageToFileFromDIB(bitBlip->m_pvBits, bitBlip->pvBitsSize, file_name);
if (oBlipEntry->btWin32 == Global::msoblipPNG)
unsigned char* pData = NULL;
DWORD nData = 0;
if (NSFile::CFileBinary::ReadAllBytes(file_name, &pData, nData))
{
unsigned char* pData = NULL;
DWORD nData = 0;
if (NSFile::CFileBinary::ReadAllBytes(file_name, &pData, nData))
{
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(Global::msoblipPNG),
boost::shared_array<unsigned char>(pData), nData, Global::msoblipPNG));
break;
}
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlipEntry->btWin32),
boost::shared_array<unsigned char>(pData), nData, oBlipEntry->btWin32));
break;
}
}
}//в случае ошибки конвертации -храним оригинальный dib
}
case Global::msoblipJPEG:
case Global::msoblipCMYKJPEG:
case Global::msoblipPNG:

View File

@ -141,7 +141,9 @@ namespace DocFileFormat
m_pXmlWriter->WriteNodeBegin( L"v:group", true );
m_pXmlWriter->WriteAttribute( L"id", m_shapeId);
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(shape, anchor, options, container->Index)));
bool twistDimensions = false;
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(shape, anchor, options, container->Index, twistDimensions)));
m_pXmlWriter->WriteAttribute( L"coordorigin", ( FormatUtils::IntToWideString(gsr->rcgBounds.topLeftAngle.x) + L"," + FormatUtils::IntToWideString( gsr->rcgBounds.topLeftAngle.y)));
m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString(gsr->rcgBounds.size.cx) + L"," + FormatUtils::IntToWideString(gsr->rcgBounds.size.cy)));
@ -150,7 +152,7 @@ namespace DocFileFormat
{
switch (options[i]->opid)
{
case pWrapPolygonVertices:
case ODRAW::pWrapPolygonVertices:
{
std::wstring wrapCoords = GetWrapCoords(options[i]);
if (!wrapCoords.empty())
@ -237,18 +239,19 @@ namespace DocFileFormat
if ( !pShape->fBackground )
{
bool twistDimensions = false;
if (pShape->GetShapeType())
{
freeform = false;
m_pXmlWriter->WriteAttribute( L"type", (std::wstring(L"#") + VMLShapeTypeMapping::GenerateTypeId(pShape->GetShapeType())));
}
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(pShape, pAnchor, options, pContainer->m_nIndex)));
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(pShape, pAnchor, options, pContainer->m_nIndex, twistDimensions)));
if (pShape->is<LineType>())
{
//append "from" and "to" attributes
m_pXmlWriter->WriteAttribute(L"from", GetLineFrom(pAnchor));
m_pXmlWriter->WriteAttribute(L"to", GetLineTo(pAnchor));
m_pXmlWriter->WriteAttribute(L"from", GetLineFrom(pAnchor, twistDimensions));
m_pXmlWriter->WriteAttribute(L"to", GetLineTo(pAnchor, twistDimensions));
}
if (m_isBullete)
@ -304,7 +307,7 @@ namespace DocFileFormat
switch (iter->opid)
{
//BOOLEANS
case geometryBooleans:
case ODRAW::geometryBooleanProperties:
{
ODRAW::GeometryBooleanProperties *booleans = dynamic_cast<ODRAW::GeometryBooleanProperties*>(iter.get());
if (booleans->fUsefLineOK && !booleans->fLineOK)
@ -325,7 +328,7 @@ namespace DocFileFormat
}
}
break;
case fillStyleBooleanProperties:
case ODRAW::fillStyleBooleanProperties:
{
ODRAW::FillStyleBooleanProperties *booleans = dynamic_cast<ODRAW::FillStyleBooleanProperties *>(iter.get());
if (booleans->fUsefFilled && !booleans->fFilled)
@ -338,7 +341,7 @@ namespace DocFileFormat
appendValueAttribute(&m_fill, L"rotate", L"t");
}
}break;
case lineStyleBooleans:
case ODRAW::lineStyleBooleanProperties:
{
ODRAW::LineStyleBooleanProperties *booleans = dynamic_cast<ODRAW::LineStyleBooleanProperties *>(iter.get());
if (booleans->fUsefLine && !booleans->fLine)
@ -347,16 +350,16 @@ namespace DocFileFormat
}
}
break;
case protectionBooleans:
case ODRAW::protectionBooleanProperties:
{
//ProtectionBooleanProperties booleans(iter->op);
}
break;
case diagramBooleans:
case ODRAW::diagramBooleanProperties:
{
}
break;
case groupShapeBooleans:
case ODRAW::groupShapeBooleanProperties:
{
ODRAW::GroupShapeBooleanProperties *booleans = dynamic_cast<ODRAW::GroupShapeBooleanProperties *>(iter.get());
if (booleans->fUsefLayoutInCell)
@ -366,78 +369,78 @@ namespace DocFileFormat
}
break;
// GEOMETRY
case shapePath :
case ODRAW::shapePath :
{
bHavePath = true;
nShapePath = iter->op;
}break;
case pVertices:
case ODRAW::pVertices:
{
opVerticles = iter;
}break;
case pSegmentInfo:
case ODRAW::pSegmentInfo:
{
opSegmentInfo = iter;
}break;
case pGuides:
case ODRAW::pGuides:
{
GetGuides(iter);
}break;
case pConnectionSites:
case ODRAW::pConnectionSites:
{
opConnectLocs = iter;
}break;
case pConnectionSitesDir:
case ODRAW::pConnectionSitesDir:
{
opConnectAngles = iter;
}break;
case pInscribe:
case ODRAW::pInscribe:
{
opInscribe = iter;
}break;
case adjustValue:
case ODRAW::adjustValue:
{
m_nAdjValues[0] = (int)iter->op;
nAdjValues = (std::max)(nAdjValues,1);
}
break;
case adjust2Value:
case ODRAW::adjust2Value:
{
m_nAdjValues[1] = (int)iter->op;
nAdjValues = (std::max)(nAdjValues, 2);
}
break;
case adjust3Value:
case ODRAW::adjust3Value:
{
m_nAdjValues[2] = (int)iter->op;
nAdjValues =(std::max)(nAdjValues, 3);
}break;
case adjust4Value:
case ODRAW::adjust4Value:
{
m_nAdjValues[3] = (int)iter->op;
nAdjValues = (std::max)(nAdjValues, 4);
}break;
case adjust5Value:
case ODRAW::adjust5Value:
{
m_nAdjValues[4] = (int)iter->op;
nAdjValues = (std::max)(nAdjValues, 5);
}break;
case adjust6Value:
case ODRAW::adjust6Value:
{
m_nAdjValues[5] = (int)iter->op;
nAdjValues = (std::max)(nAdjValues, 6);
}break;
case adjust7Value:
case ODRAW::adjust7Value:
{
m_nAdjValues[6] = (int)iter->op;
nAdjValues = (std::max)(nAdjValues, 7);
}break;
case adjust8Value:
case ODRAW::adjust8Value:
{
m_nAdjValues[7] = (int)iter->op;
nAdjValues = (std::max)(nAdjValues, 8);
}break;
case pWrapPolygonVertices:
case ODRAW::pWrapPolygonVertices:
{
std::wstring wrapCoords = GetWrapCoords(iter);
@ -446,22 +449,22 @@ namespace DocFileFormat
m_pXmlWriter->WriteAttribute( L"wrapcoords", wrapCoords);
}
}break;
case geoRight:
case ODRAW::geoRight:
{
xCoord = iter->op;
}break;
case geoBottom:
case ODRAW::geoBottom:
{
yCoord = iter->op;
}break;
// LINE
case lineColor:
case ODRAW::lineColor:
{
RGBColor lineColor((int)iter->op, RedFirst);
if ( !pShape->fBackground )
m_pXmlWriter->WriteAttribute( L"strokecolor", (std::wstring(L"#") + lineColor.SixDigitHexCode));
}break;
case lineWidth:
case ODRAW::lineWidth:
{
if (iter->op > 0)
{
@ -469,39 +472,39 @@ namespace DocFileFormat
m_pXmlWriter->WriteAttribute(L"strokeweight", FormatUtils::DoubleToWideString(eLineWidth.ToPoints()) + L"pt");
}
}break;
case lineDashing:
case ODRAW::lineDashing:
{
appendValueAttribute(&m_stroke, L"dashstyle", FormatUtils::MapValueToWideString( iter->op, &Global::DashStyleMap[0][0], 11, 16 ) );
}break;
case lineStyle:
case ODRAW::lineStyle:
{
appendValueAttribute(&m_stroke, L"linestyle", getLineStyle( iter->op ));
}break;
case lineEndArrowhead:
case ODRAW::lineEndArrowhead:
{
appendValueAttribute(&m_stroke, L"endarrow", getArrowStyle( iter->op ));
}break;
case lineEndArrowLength:
case ODRAW::lineEndArrowLength:
{
appendValueAttribute(&m_stroke, L"endarrowlength", getArrowLength( iter->op ));
}break;
case lineEndArrowWidth:
case ODRAW::lineEndArrowWidth:
{
appendValueAttribute(&m_stroke, L"endarrowwidth", getArrowWidth( iter->op ));
}break;
case lineStartArrowhead:
case ODRAW::lineStartArrowhead:
{
appendValueAttribute(&m_stroke, L"startarrow", getArrowStyle( iter->op ));
}break;
case lineStartArrowLength:
case ODRAW::lineStartArrowLength:
{
appendValueAttribute(&m_stroke, L"startarrowlength", getArrowLength( iter->op ));
}break;
case lineStartArrowWidth:
case ODRAW::lineStartArrowWidth:
{
appendValueAttribute(&m_stroke, L"startarrowwidth", getArrowWidth( iter->op ));
}break;
case cxstyle:
case ODRAW::cxstyle:
{
if (pShape->GetShapeType() == NULL)
{
@ -517,39 +520,39 @@ namespace DocFileFormat
}
}break;
// FILL
case fillColor:
case ODRAW::fillColor:
{
RGBColor fillColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(L"fillcolor", ( std::wstring( L"#" ) + fillColor.SixDigitHexCode ));
}break;
case fillBackColor:
case ODRAW::fillBackColor:
{
RGBColor fillBackColor( (int)iter->op, RedFirst );
appendValueAttribute(&m_fill, L"color2", ( std::wstring( L"#" ) + fillBackColor.SixDigitHexCode ));
}break;
case fillAngle:
case ODRAW::fillAngle:
{
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) appendValueAttribute(&m_fill, L"angle", FormatUtils::DoubleToWideString( point->dVal ));
}break;
case fillShadeType:
case ODRAW::fillShadeType:
{
appendValueAttribute(&m_fill, L"method", getFillMethod( iter->op ));
}break;
case fillShadeColors:
case ODRAW::fillShadeColors:
{
appendValueAttribute(&m_fill, L"colors", getFillColorString( iter ));
}break;
case fillFocus:
case ODRAW::fillFocus:
{
appendValueAttribute(&m_fill, L"focus", ( FormatUtils::IntToWideString( iter->op ) + L"%" ));
appendValueAttribute(&m_fill, L"focussize", L"");
}break;
case fillType:
case ODRAW::fillType:
{
appendValueAttribute(&m_fill, L"type", getFillType( iter->op ));
}break;
case fillBlip:
case ODRAW::fillBlip:
{
BlipStoreEntry* pFillBlip = NULL;
@ -570,76 +573,76 @@ namespace DocFileFormat
bPicturePresent = true;
}break;
case fillBlipName:
case ODRAW::fillBlipName:
{
ODRAW::AnyString* str = dynamic_cast<ODRAW::AnyString*>(iter.get());
if ((str) && (!str->string_.empty()))
{
appendValueAttribute(&m_fill, L"o:title", FormatUtils::XmlEncode(str->string_));
appendValueAttribute(&m_fill, L"o:title", str->string_);
}
}break;
case fillOpacity:
case ODRAW::fillOpacity:
{
appendValueAttribute(&m_fill, L"opacity", ( FormatUtils::IntToWideString( iter->op ) + L"f" ));
}
break;
case fillBackOpacity:
case ODRAW::fillBackOpacity:
{
appendValueAttribute(&m_fill, L"o:opacity2", (FormatUtils::IntToWideString(iter->op) + L"f"));
}break;
// SHADOW
case shadowType:
case ODRAW::shadowType:
{
appendValueAttribute(&m_shadow, L"type", getShadowType(iter->op));
}break;
case shadowColor:
case ODRAW::shadowColor:
{
RGBColor shadowColor((int)iter->op, RedFirst);
appendValueAttribute(&m_shadow, L"color", ( std::wstring( L"#" ) + shadowColor.SixDigitHexCode ));
}break;
case shadowOffsetX:
case ODRAW::shadowOffsetX:
{
ShadowOffsetX = EmuValue( (int)iter->op );
}break;
case shadowSecondOffsetX:
case ODRAW::shadowSecondOffsetX:
{
SecondShadowOffsetX = EmuValue( (int)iter->op );
}break;
case shadowOffsetY:
case ODRAW::shadowOffsetY:
{
ShadowOffsetY = EmuValue( (int)iter->op );
}break;
case shadowSecondOffsetY:
case ODRAW::shadowSecondOffsetY:
{
SecondShadowOffsetY = EmuValue( (int)iter->op );
}break;
case shadowOriginX:
case ODRAW::shadowOriginX:
{
ShadowOriginX = ( iter->op / pow( (double)2, (double)16 ) );
}break;
case shadowOriginY:
case ODRAW::shadowOriginY:
{
ShadowOriginY = (iter->op / pow( (double)2, (double)16));
}break;
case shadowOpacity:
case ODRAW::shadowOpacity:
{
double shadowOpa = (iter->op / pow( (double)2, (double)16));
appendValueAttribute(&m_shadow, L"opacity", FormatUtils::DoubleToFormattedWideString( shadowOpa, L"%.2f" ));
}break;
case shadowStyleBooleanProperties:
case ODRAW::shadowStyleBooleanProperties:
{
//ODRAW::ShadowStyleBooleanProperties
}break;
// OLE
case pictureId:
case ODRAW::pictureId:
{
indexOLE = iter->op;
}break;
// PICTURE
case Pib:
case ODRAW::pib:
{
int index = (int)( iter->op - 1 );
@ -653,101 +656,101 @@ namespace DocFileFormat
}
bPicturePresent = true;
}break;
case pibName:
case ODRAW::pibName:
{
ODRAW::AnyString* str = dynamic_cast<ODRAW::AnyString*>(iter.get());
if ((str) && (!str->string_.empty()))
{
appendValueAttribute(&m_imagedata, L"o:title", FormatUtils::XmlEncode(str->string_));
appendValueAttribute(&m_imagedata, L"o:title", str->string_);
}
}break;
// 3D STYLE
case threeDStyleBooleanProperties:
case ODRAW::threeDStyleBooleanProperties:
{
ODRAW::ThreeDStyleBooleanProperties* booleans = dynamic_cast<ODRAW::ThreeDStyleBooleanProperties*>(iter.get());
}break;
case threeDObjectBooleanProperties:
case ODRAW::threeDObjectBooleanProperties:
{
ODRAW::ThreeDObjectBooleanProperties* booleans = dynamic_cast<ODRAW::ThreeDObjectBooleanProperties*>(iter.get());
if ((booleans) && (booleans->fUsef3D && !booleans->f3D))
b3D = false;
}break;
case c3DRenderMode:
case ODRAW::c3DRenderMode:
{
}break;
case c3DExtrudeBackward:
case ODRAW::c3DExtrudeBackward:
{
EmuValue backwardValue( (int)iter->op );
std::wstring depth = FormatUtils::DoubleToWideString( backwardValue.ToPoints() ) + L"pt";
appendValueAttribute(&m_3dstyle, L"backdepth", depth);
}break;
case c3DAmbientIntensity:
case ODRAW::c3DAmbientIntensity:
{
std::wstring intens = FormatUtils::IntToWideString((int)iter->op) + L"f";
appendValueAttribute(&m_3dstyle, L"brightness", intens);
}break;
case c3DSpecularAmt:
case ODRAW::c3DSpecularAmt:
{
std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f";
appendValueAttribute(&m_3dstyle, L"specularity", amt);
}break;
case c3DDiffuseAmt:
case ODRAW::c3DDiffuseAmt:
{
std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f";
appendValueAttribute(&m_3dstyle, L"diffusity", amt);
}break;
case c3DKeyIntensity:
case ODRAW::c3DKeyIntensity:
{
std::wstring amt = FormatUtils::IntToWideString((int)iter->op);
appendValueAttribute(&m_3dstyle, L"lightlevel", amt);
}break;
case c3DExtrusionColor:
case ODRAW::c3DExtrusionColor:
{
std::wstring color = FormatUtils::IntToFormattedWideString(iter->op, L"#%06x");
appendValueAttribute(&m_3dstyle, L"color", color);
}break;
case c3DSkewAngle:
case ODRAW::c3DSkewAngle:
{
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) appendValueAttribute(&m_3dstyle, L"skewangle", FormatUtils::DoubleToWideString( point->dVal ));
}break;
case c3DXViewpoint:
case ODRAW::c3DXViewpoint:
{
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) ViewPointX = EmuValue( (int)point->dVal );
}break;
case c3DYViewpoint:
case ODRAW::c3DYViewpoint:
{
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) ViewPointY = EmuValue( (int)point->dVal );
}break;
case c3DZViewpoint:
case ODRAW::c3DZViewpoint:
{
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) ViewPointZ = EmuValue( (int)point->dVal );
}break;
case c3DOriginX:
case ODRAW::c3DOriginX:
{
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) viewPointOriginX = point->dVal;
}break;
case c3DOriginY:
case ODRAW::c3DOriginY:
{
ODRAW::FixedPoint* point = dynamic_cast<ODRAW::FixedPoint*>(iter.get());
if (point) viewPointOriginY = point->dVal;
}break;
// TEXTBOX
case lTxid:
case ODRAW::lTxid:
{
hasTextbox = true;
nLTxID = (((iter->op) >> 16) & 0xFFFF);
}break;
case dxTextLeft: {ndxTextLeft = (int)iter->op; break;}
case dyTextTop: {ndyTextTop = (int)iter->op; break;}
case dxTextRight: {ndxTextRight = (int)iter->op; break;}
case dyTextBottom: {ndyTextBottom = (int)iter->op; break;}
case txflTextFlow:
case ODRAW::dxTextLeft: {ndxTextLeft = (int)iter->op; break;}
case ODRAW::dyTextTop: {ndyTextTop = (int)iter->op; break;}
case ODRAW::dxTextRight: {ndxTextRight = (int)iter->op; break;}
case ODRAW::dyTextBottom: {ndyTextBottom = (int)iter->op; break;}
case ODRAW::txflTextFlow:
{
switch(iter->op)
{
@ -755,6 +758,7 @@ namespace DocFileFormat
case 4://обычный
break;
case 1:
case 3:
case 5://верт (склони голову направо)
appendStyleProperty(sTextboxStyle, L"layout-flow", L"vertical");
break;
@ -765,49 +769,33 @@ namespace DocFileFormat
}
}break;
// Word Art
case gtextUNICODE:
case ODRAW::gtextUNICODE:
{
ODRAW::AnyString* str = dynamic_cast<ODRAW::AnyString*>(iter.get());
if ((str) && (!str->string_.empty()))
{
std::wstring text = FormatUtils::XmlEncode(str->string_);
if (std::wstring::npos != text.find(L"\n"))
{
m_textpath.AppendText(text);
}
text = ReplaceString(text, L"\n", L"&#xA;");
appendValueAttribute(&m_textpath, L"string", text);
appendValueAttribute(&m_textpath, L"string", str->string_);
}
}break;
case gtextFont:
case ODRAW::gtextFont:
{
ODRAW::AnyString* str = dynamic_cast<ODRAW::AnyString*>(iter.get());
if ((str) && (!str->string_.empty()))
if (str)
{
std::wstring font = str->string_;
size_t i = font.size();
while (i > 0)
{
if (font[i-1] != 0) break;
i--;
}
if (i < font.size()) font.erase(font.begin() + i, font.end());
font = std::wstring(L"\"") + font + std::wstring(L"\"");
appendStyleProperty(m_textPathStyle, L"font-family", font);
appendStyleProperty(m_textPathStyle, L"font-family", str->string_);
}
}break;
case gtextSize:
case ODRAW::gtextSize:
{
std::wstring fontSize = FormatUtils::IntToWideString(iter->op/65535);
appendStyleProperty(m_textPathStyle, L"font-size", fontSize + L"pt");
}break;
case gtextSpacing:
case ODRAW::gtextSpacing:
{
std::wstring spacing = FormatUtils::IntToWideString(iter->op);
appendStyleProperty(m_textPathStyle, L"v-text-spacing", spacing + L"f");
}break;
case geometryTextBooleanProperties:
case ODRAW::geometryTextBooleanProperties:
{
ODRAW::GeometryTextBooleanProperties *props = dynamic_cast<ODRAW::GeometryTextBooleanProperties*>(iter.get());
if (props->fUsegFBestFit && props->fBestFit)
@ -1128,7 +1116,14 @@ namespace DocFileFormat
m_context->_doc->Convert(&textboxMapping);
m_pXmlWriter->WriteString(textboxMapping.getOLEObject());
std::wstring sOleXml = textboxMapping.getOLEObject();
if (false == sOleXml.empty())
m_pXmlWriter->WriteString(sOleXml);
else
{
m_pXmlWriter->WriteString(txtBoxWrapper.GetXmlString());
}
}
//ShapeType
@ -1215,7 +1210,7 @@ namespace DocFileFormat
return strXmlAttr;
}
std::wstring VMLShapeMapping::GetLineFrom(const ChildAnchor* pAnchor) const
std::wstring VMLShapeMapping::GetLineFrom(const ChildAnchor* pAnchor, bool twistDimensions) const
{
//Если линия находится в группе, то координаты должны быть в Twips
//Если линия находится в группе, то координаты должны быть в других единицах измерения (например в twips)
@ -1224,15 +1219,33 @@ namespace DocFileFormat
if (NULL != pAnchor)
{
strXmlFrom += FormatUtils::IntToWideString(pAnchor->rcgBounds.topLeftAngle.x);
int left = pAnchor->rcgBounds.topLeftAngle.x;
int top = pAnchor->rcgBounds.topLeftAngle.y;
if (twistDimensions)
{
int right = pAnchor->rcgBounds.topLeftAngle.x + pAnchor->rcgBounds.size.cx;
int bottom = pAnchor->rcgBounds.topLeftAngle.y + pAnchor->rcgBounds.size.cy;
left = (right + pAnchor->rcgBounds.topLeftAngle.x) * 0.5 - (bottom - pAnchor->rcgBounds.topLeftAngle.y) * 0.5;
top = (bottom + pAnchor->rcgBounds.topLeftAngle.y) * 0.5 - (right - pAnchor->rcgBounds.topLeftAngle.x) * 0.5;
}
strXmlFrom += FormatUtils::IntToWideString(left);
strXmlFrom += L",";
strXmlFrom += FormatUtils::IntToWideString(pAnchor->rcgBounds.topLeftAngle.y);
strXmlFrom += FormatUtils::IntToWideString(top);
}
else if (m_pSpa)
{
TwipsValue oLeft(m_pSpa->xaLeft);
TwipsValue oTop(m_pSpa->yaTop);
if (twistDimensions)
{
oLeft = TwipsValue((m_pSpa->xaRight + m_pSpa->xaLeft) * 0.5 - (m_pSpa->yaBottom - m_pSpa->yaTop) * 0.5);
oTop = TwipsValue((m_pSpa->yaBottom + m_pSpa->yaTop) * 0.5 - (m_pSpa->xaRight - m_pSpa->xaLeft) * 0.5);
}
strXmlFrom += FormatUtils::DoubleToWideString(oLeft.ToPoints());
strXmlFrom += L"pt,";
strXmlFrom += FormatUtils::DoubleToWideString(oTop.ToPoints());
@ -1242,7 +1255,7 @@ namespace DocFileFormat
return strXmlFrom;
}
std::wstring VMLShapeMapping::GetLineTo(const ChildAnchor* pAnchor) const
std::wstring VMLShapeMapping::GetLineTo(const ChildAnchor* pAnchor, bool twistDimensions) const
{
//Если линия находится в группе, то координаты должны быть в других единицах измерения (например в twips)
@ -1250,15 +1263,32 @@ namespace DocFileFormat
if (NULL != pAnchor)
{
strXmlTo += FormatUtils::IntToWideString(pAnchor->rcgBounds.topLeftAngle.x + pAnchor->rcgBounds.size.cx);
int right = pAnchor->rcgBounds.topLeftAngle.x + pAnchor->rcgBounds.size.cx;
int bottom = pAnchor->rcgBounds.topLeftAngle.y + pAnchor->rcgBounds.size.cy;
if (twistDimensions)
{
int left = (right + pAnchor->rcgBounds.topLeftAngle.x) * 0.5 - (bottom - pAnchor->rcgBounds.topLeftAngle.y) * 0.5;
int top = (bottom + pAnchor->rcgBounds.topLeftAngle.y) * 0.5 - (right - pAnchor->rcgBounds.topLeftAngle.x) * 0.5;
right = left + pAnchor->rcgBounds.size.cy;
bottom = top + pAnchor->rcgBounds.size.cx;
}
strXmlTo += FormatUtils::IntToWideString(right);
strXmlTo += L",";
strXmlTo += FormatUtils::IntToWideString(pAnchor->rcgBounds.topLeftAngle.y + pAnchor->rcgBounds.size.cy);
strXmlTo += FormatUtils::IntToWideString(bottom);
}
else if (m_pSpa)
{
TwipsValue oRight (m_pSpa->xaRight);
TwipsValue oBottom (m_pSpa->yaBottom);
if (twistDimensions)
{
oRight = TwipsValue((m_pSpa->yaBottom - m_pSpa->yaTop) + (m_pSpa->xaRight + m_pSpa->xaLeft) * 0.5 - (m_pSpa->yaBottom - m_pSpa->yaTop) * 0.5);
oBottom = TwipsValue((m_pSpa->xaRight - m_pSpa->xaLeft) + (m_pSpa->yaBottom + m_pSpa->yaTop) * 0.5 - (m_pSpa->xaRight - m_pSpa->xaLeft) * 0.5);
}
strXmlTo += FormatUtils::DoubleToWideString(oRight.ToPoints());
strXmlTo += L"pt,";
strXmlTo += FormatUtils::DoubleToWideString(oBottom.ToPoints());
@ -1322,12 +1352,11 @@ namespace DocFileFormat
{
boost::shared_array<unsigned char> arDecompressed(decompressed);
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlip->btWin32), arDecompressed, decompressedSize));
result = true;
}
RELEASEOBJECT(metaBlip);
}
}
break;
}break;
case Global::msoblipJPEG:
case Global::msoblipCMYKJPEG:
case Global::msoblipPNG:
@ -1341,38 +1370,35 @@ namespace DocFileFormat
{
std::wstring file_name = m_context->_doc->m_sTempFolder + L"tmp_image";
if (Global::msoblipPNG == ImageHelper::SaveImageToFileFromDIB(bitBlip->m_pvBits, bitBlip->pvBitsSize, file_name))
oBlip->btWin32 = ImageHelper::SaveImageToFileFromDIB(bitBlip->m_pvBits, bitBlip->pvBitsSize, file_name);
unsigned char* pData = NULL;
DWORD nData = 0;
if (NSFile::CFileBinary::ReadAllBytes(file_name, &pData, nData))
{
oBlip->btWin32 = Global::msoblipPNG;
unsigned char* pData = NULL;
DWORD nData = 0;
if (NSFile::CFileBinary::ReadAllBytes(file_name, &pData, nData))
{
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(Global::msoblipPNG),
boost::shared_array<unsigned char>(pData), nData, Global::msoblipPNG));
break;
}
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlip->btWin32),
boost::shared_array<unsigned char>(pData), nData, oBlip->btWin32));
result = true;
break;
}//в случае ошибки конвертации -храним оригинальный dib
}
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlip->btWin32),
bitBlip->m_pvBits, bitBlip->pvBitsSize, oBlip->btWin32));
RELEASEOBJECT (bitBlip);
}
}break;
result = true;
}break;
}
default:
{
result = false;
return result;
}
break;
}
m_nImageId = m_context->_docx->RegisterImage (m_pCaller, oBlip->btWin32);
result = true;
}
if (result)
{
m_nImageId = m_context->_docx->RegisterImage (m_pCaller, oBlip->btWin32);
}
return result;
}
@ -1613,26 +1639,26 @@ namespace DocFileFormat
switch (iter->opid)
{
// POSITIONING
case posh:
case ODRAW::posh:
{
nPosH = iter->op;
}break;
case posrelh:
case ODRAW::posrelh:
{
nRelH = iter->op;
appendStyleProperty(oStyle, L"mso-position-horizontal-relative", mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op));
}break;
case posv:
case ODRAW::posv:
{
nPosV = iter->op;
}break;
case posrelv:
case ODRAW::posrelv:
{
nRelV = iter->op;
appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
}break;
// BOOLEANS
case groupShapeBooleans:
case ODRAW::groupShapeBooleanProperties:
{
ODRAW::GroupShapeBooleanProperties* booleans = dynamic_cast<ODRAW::GroupShapeBooleanProperties*>(iter.get());
@ -1660,7 +1686,7 @@ namespace DocFileFormat
}
}break;
// GEOMETRY
case PropertyId_rotation:
case ODRAW::ePropertyId_rotation:
{
double dAngle = (double)((int)iter->op) / 65535.0;
@ -1670,24 +1696,24 @@ namespace DocFileFormat
appendStyleProperty(oStyle, L"rotation", FormatUtils::DoubleToWideString(dAngle));
}break;
// TEXTBOX
case anchorText:
case ODRAW::anchorText:
{
appendStyleProperty(oStyle, L"v-text-anchor", getTextboxAnchor(iter->op));
}break;
// WRAP DISTANCE
case dxWrapDistLeft:
case ODRAW::dxWrapDistLeft:
{
appendStyleProperty(oStyle, L"mso-wrap-distance-left", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt")));
}break;
case dxWrapDistRight:
case ODRAW::dxWrapDistRight:
{
appendStyleProperty(oStyle, L"mso-wrap-distance-right", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt")));
}break;
case dyWrapDistBottom:
case ODRAW::dyWrapDistBottom:
{
appendStyleProperty(oStyle, L"mso-wrap-distance-bottom", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt")));
}break;
case dyWrapDistTop:
case ODRAW::dyWrapDistTop:
{
appendStyleProperty(oStyle, L"mso-wrap-distance-top", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt")));
}break;
@ -1746,17 +1772,17 @@ namespace DocFileFormat
}
//
std::wstring VMLShapeMapping::buildStyle (const Shape* shape, const ChildAnchor* anchor, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex) const
std::wstring VMLShapeMapping::buildStyle (const Shape* shape, const ChildAnchor* anchor, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex, bool &twistDimensions) const
{
std::wstring style;
bool twistDimensions = false;
twistDimensions = false;
for (size_t i = 0; i < options.size(); i++)
{
const ODRAW::OfficeArtFOPTEPtr & iter = options[i];
if (geometryTextBooleanProperties == iter->opid)
if (ODRAW::geometryTextBooleanProperties == iter->opid)
{
ODRAW::GeometryTextBooleanProperties* booleans = dynamic_cast<ODRAW::GeometryTextBooleanProperties*>(iter.get());
@ -1766,13 +1792,16 @@ namespace DocFileFormat
}
}
else if (PropertyId_rotation == iter->opid)
else if (ODRAW::ePropertyId_rotation == iter->opid)
{
double dAngle = (double)((int)iter->op) / 65535.0;
if (dAngle < -360.0)
dAngle += 360.0;
if (dAngle > 360.0)
dAngle -= 360.0;
if ((dAngle >= 45.0 && dAngle <= 135.0) || (dAngle >= 225.0 && dAngle <= 315.0) || (dAngle <= -45.0 && dAngle >= -135.0) || (dAngle <= -225.0 && dAngle >= -315.0))
twistDimensions = true;
}

View File

@ -91,7 +91,7 @@ namespace DocFileFormat
std::wstring getTextboxAnchor( unsigned int anchor ) const;
std::wstring buildStyle ( const Shape* shape, const ChildAnchor* anchor, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex ) const;
std::wstring buildStyle ( const Shape* shape, const ChildAnchor* anchor, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex, bool &twistDimensions) const;
void AppendOptionsToStyle ( std::wstring& style, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex ) const;
int UpdateFromGuides(const int val) const;
@ -112,8 +112,8 @@ namespace DocFileFormat
void WriteEndShapeNode (const Shape* pShape);
std::wstring GetShapeID (const Shape* pShape) const;
std::wstring GetLineFrom (const ChildAnchor* pAnchor) const;
std::wstring GetLineTo (const ChildAnchor* pAnchor) const;
std::wstring GetLineFrom (const ChildAnchor* pAnchor, bool twistDimensions) const;
std::wstring GetLineTo (const ChildAnchor* pAnchor, bool twistDimensions) const;
std::wstring GetWrapCoords ( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
std::vector<std::wstring> GetTextRectangles ( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;

View File

@ -33,6 +33,7 @@
#include "WordDocument.h"
#include "../../Common/OfficeFileErrorDescription.h"
#include "../../Common/MS-LCID.h"
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/SummaryInformation.h"
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Binary/CFStream.h"
@ -79,13 +80,13 @@ namespace DocFileFormat
254, 437,//PC 437
255, 850//OEM
};
WordDocument::WordDocument (const ProgressCallback* pCallFunc, const std::wstring & sTempFolder ) :
WordDocument::WordDocument (const ProgressCallback* pCallFunc, const std::wstring & sTempFolder, const int userLCID) :
m_PieceTable(NULL), WordDocumentStream(NULL), TableStream(NULL), DataStream(NULL), FIB(NULL),
Text(NULL), RevisionAuthorTable(NULL), FontTable(NULL), BookmarkNames(NULL), AutoTextNames(NULL),
IndividualFootnotesPlex(NULL), FootnoteReferenceCharactersPlex(NULL), IndividualEndnotesPlex(NULL),
EndnoteReferenceCharactersPlex(NULL), FieldsPlex(NULL), FootnoteDocumentFieldsPlex(NULL),
EndnoteDocumentFieldsPlex(NULL), HeadersAndFootersDocumentFieldsPlex(NULL), HeaderStoriesPlex(NULL), AnnotationsFieldsPlex(NULL),
AnnotationsReferencePlex(NULL), AnnotationsReferenceExPlex(NULL), IndividualCommentsPlex(NULL), TextboxBreakPlex(NULL), TextboxBreakPlexHeader(NULL),
AnnotationsReferencePlex(NULL), AnnotationsReferencesEx(NULL), IndividualCommentsPlex(NULL), TextboxBreakPlex(NULL), TextboxBreakPlexHeader(NULL),
TextboxIndividualPlex(NULL),AssocNames(NULL), BookmarkAnnotNames(NULL), Captions(NULL), AutoCaptions(NULL), ListPlex(NULL),
OfficeDrawingPlex(NULL), OfficeDrawingPlexHeader(NULL), SectionPlex(NULL), BookmarkStartPlex(NULL), BookmarkEndPlex(NULL),
AutoTextPlex(NULL), AllPapxFkps(NULL), AllChpxFkps(NULL), AllPapx(NULL), AllPapxVector(NULL), AllSepx(NULL), Styles(NULL), listTable(NULL),
@ -94,6 +95,7 @@ namespace DocFileFormat
{
m_pCallFunc = pCallFunc;
m_sTempFolder = sTempFolder;
m_nUserLCID = userLCID;
m_pStorage = NULL;
officeArtContent = NULL;
@ -276,6 +278,17 @@ namespace DocFileFormat
}
FIB->m_CodePage = nDocumentCodePage;
if (!bDocumentCodePage && m_nUserLCID > 0)
{
int user_codepage = msLCID2DefCodePage(m_nUserLCID);
if (user_codepage > 0)
{
bDocumentCodePage = true;
nDocumentCodePage = user_codepage;
}
}
//-------------------------------------------------------------------------------------------------
try
{
@ -345,9 +358,10 @@ namespace DocFileFormat
IndividualCommentsPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfandTxt, FIB->m_FibWord97.lcbPlcfandTxt, nWordVersion);
}
if (FIB->m_FibWord2002.lcbAtrdExtra > 0)
if (FIB->m_FibWord2002.lcbAtrdExtra > 0 && AnnotationsReferencePlex)
{
AnnotationsReferenceExPlex = new Plex<AnnotationReferenceExDescriptor>(AnnotationReferenceExDescriptor::GetSize(nWordVersion), TableStream, FIB->m_FibWord2002.fcAtrdExtra, FIB->m_FibWord2002.lcbAtrdExtra, nWordVersion);
size_t count = AnnotationsReferencePlex->Elements.size();
AnnotationsReferencesEx = new AnnotationReferenceExDescriptors(count, TableStream, FIB->m_FibWord2002.fcAtrdExtra, FIB->m_FibWord2002.lcbAtrdExtra);
}
OfficeDrawingPlex = new Plex<Spa> (Spa::GetSize(nWordVersion), TableStream, FIB->m_FibWord97.fcPlcSpaMom, FIB->m_FibWord97.lcbPlcSpaMom, nWordVersion);
OfficeDrawingPlexHeader = new Plex<Spa> (Spa::GetSize(nWordVersion), TableStream, FIB->m_FibWord97.fcPlcSpaHdr, FIB->m_FibWord97.lcbPlcSpaHdr, nWordVersion);
@ -368,7 +382,7 @@ namespace DocFileFormat
for (size_t i = 0; i < BookmarkStartPlex->Elements.size(); ++i)
{
BookmarkFirst* pBookmark = static_cast<BookmarkFirst*>(BookmarkStartPlex->Elements[i]);
BookmarkFirst* pBookmark = static_cast<BookmarkFirst*>(BookmarkStartPlex->Elements[i]);
if (pBookmark)
{
BookmarkStartEndCPs.push_back(std::make_pair(BookmarkStartPlex->CharacterPositions[i], BookmarkEndPlex->CharacterPositions[pBookmark->GetIndex()]));
@ -865,7 +879,6 @@ namespace DocFileFormat
RELEASEOBJECT(AllSepx);
}
RELEASEOBJECT(Text);
RELEASEOBJECT(m_PieceTable);
@ -891,7 +904,7 @@ namespace DocFileFormat
RELEASEOBJECT(HeaderStoriesPlex);
RELEASEOBJECT(IndividualCommentsPlex);
RELEASEOBJECT(AnnotationsReferencePlex);
RELEASEOBJECT(AnnotationsReferenceExPlex);
RELEASEOBJECT(AnnotationsReferencesEx);
RELEASEOBJECT(TextboxBreakPlex);
RELEASEOBJECT(TextboxBreakPlexHeader);
RELEASEOBJECT(OfficeDrawingPlex);

View File

@ -92,7 +92,7 @@ namespace DocFileFormat
public:
WordDocument (const ProgressCallback* pCallFunc, const std::wstring & tempFolder );
WordDocument (const ProgressCallback* pCallFunc, const std::wstring & tempFolder, const int userLCID);
virtual ~WordDocument();
_UINT32 LoadDocument(const std::wstring & fileName, const std::wstring & password);
@ -153,6 +153,7 @@ namespace DocFileFormat
std::wstring m_sPassword;
std::wstring m_sTempFolder;
std::wstring m_sTempDecryptFileName;
int m_nUserLCID;
const ProgressCallback* m_pCallFunc;
@ -218,7 +219,7 @@ namespace DocFileFormat
Plex<Spa> *OfficeDrawingPlex;
Plex<Spa> *OfficeDrawingPlexHeader;
Plex<SectionDescriptor> *SectionPlex; // A Plex containing all section descriptors
Plex<SectionDescriptor> *SectionPlex;
Plex<BookmarkFirst> *BookmarkStartPlex;
Plex<EmptyStructure> *BookmarkEndPlex;
@ -233,9 +234,9 @@ namespace DocFileFormat
Plex<FieldCharacter> *HeadersAndFootersDocumentFieldsPlex;
Plex<FieldCharacter> *AnnotationsFieldsPlex;
Plex<AnnotationReferenceDescriptor> *AnnotationsReferencePlex;
Plex<AnnotationReferenceExDescriptor> *AnnotationsReferenceExPlex;
Plex<EmptyStructure> *AutoTextPlex;
// Each character position specifies the beginning of a range of text that constitutes the contents of an AutoText item
AnnotationReferenceExDescriptors *AnnotationsReferencesEx;
};
}

View File

@ -42,10 +42,7 @@
namespace DocFileFormat
{
WordprocessingDocument::WordprocessingDocument(const std::wstring & _pathOutput, const WordDocument* _docFile) :
OpenXmlPackage( _docFile ),
FontTableXML( L"" ), DocumentXML( L"" ),
StyleSheetXML( L"" ), FootnotesXML ( L"" ), NumberingXML( L"" ),
CommentsXML( L"" ), SettingsXML( L"" ), CommandTableXML ( L"" )
OpenXmlPackage( _docFile )
{
m_strOutputPath = _pathOutput;
}
@ -131,6 +128,7 @@ namespace DocFileFormat
SaveToFile(pathWord, std::wstring( L"endnotes.xml" ), EndnotesXML );
SaveToFile(pathWord, std::wstring( L"numbering.xml" ), NumberingXML );
SaveToFile(pathWord, std::wstring( L"comments.xml" ), CommentsXML );
SaveToFile(pathWord, std::wstring( L"commentsExtended.xml"),CommentsExtendedXML );
SaveToFile(pathWord, std::wstring( L"settings.xml" ), SettingsXML );
SaveToFile(pathWord, std::wstring( L"customizations.xml" ), CommandTableXML );

View File

@ -65,6 +65,7 @@ namespace DocFileFormat
std::wstring EndnotesXML;
std::wstring NumberingXML;
std::wstring CommentsXML;
std::wstring CommentsExtendedXML;
std::wstring SettingsXML;
std::wstring CommandTableXML;

View File

@ -39,7 +39,9 @@ _UINT32 COfficeDocFile::LoadFromFile(const std::wstring & docFile, const std::w
_UINT32 hr = 0;
DocFileFormat::Converter docToDocx;
docToDocx.m_sTempFolder = m_sTempFolder;
docToDocx.m_nUserLCID = m_nUserLCID;
hr= docToDocx.LoadAndConvert(docFile, docxDirectory, password, ffCallBack, bMacros);

View File

@ -43,15 +43,11 @@ struct ProgressCallback;
class COfficeDocFile
{
public:
COfficeDocFile()
{
}
COfficeDocFile() : m_nUserLCID(-1) {}
virtual ~COfficeDocFile() {}
virtual ~COfficeDocFile()
{
}
std::wstring m_sTempFolder;
std::wstring m_sTempFolder;
int m_nUserLCID;
_UINT32 LoadFromFile(const std::wstring & sSrcFileName, const std::wstring & sDstFileName, const std::wstring & password, bool &bMacros, ProgressCallback *ffCallBack = NULL);
_UINT32 SaveToFile(const std::wstring & sDstFileName, const std::wstring & sSrcFileName, ProgressCallback *ffCallBack = NULL);

View File

@ -77,6 +77,7 @@ HRESULT convert_single(std::wstring srcFileName)
COfficeDocFile docFile;
docFile.m_sTempFolder = outputDir;
docFile.m_nUserLCID = 1049;
bool bMacros = true;
HRESULT hRes = docFile.LoadFromFile( srcFileName, dstTempPath, L"password", bMacros, NULL);

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Version="8.00"
Name="DocFormatTest"
ProjectGUID="{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
RootNamespace="PptFormatTest"
@ -45,7 +45,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../DesktopEditor/xml/build/vs2005;../../DesktopEditor/xml/libxml2/include;../../DesktopEditor/freetype-2.5.2/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS;DONT_USED_EXTRA_LIBRARY"
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -397,6 +397,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\BinReader\FileWriter.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\FontProcessor.cpp"
>

View File

@ -29,10 +29,9 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef COMMENTS_WRITER
#define COMMENTS_WRITER
#pragma once
#include "../../XlsxSerializerCom/Common/Common.h"
#include "HeaderFooterWriter.h"
#include "../../Common/DocxFormat/Source/DocxFormat/FileTypes.h"
namespace Writers
@ -49,8 +48,9 @@ namespace Writers
class CommentsWriter
{
std::wstring m_sDir;
std::wstring m_sFileName;
public:
std::wstring m_sComment;
std::wstring m_sComment;
std::wstring m_sCommentExt;
std::wstring m_sCommentsIds;
std::wstring m_sPeople;
@ -73,6 +73,10 @@ namespace Writers
m_sDocumentCommentsIds = sDocumentCommentsIds;
m_sDocumentPeople = sDocumentPeople;
}
std::wstring getFilename()
{
return OOX::FileTypes::Comments.DefaultFileName().GetPath();
}
void Write()
{
std::wstring sDir = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR;
@ -156,5 +160,4 @@ namespace Writers
}
};
}
#endif // #ifndef COMMENTS_WRITER
}

View File

@ -0,0 +1,91 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "FileWriter.h"
#include "ReaderClasses.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Core.h"
#include "../../Common/DocxFormat/Source/DocxFormat/App.h"
namespace Writers
{
FileWriter::FileWriter(std::wstring sDirOutput,std::wstring sFontDir, bool bNoFontDir, int nVersion, bool bSaveChartAsImg, NSBinPptxRW::CDrawingConverter* pDrawingConverter, std::wstring sThemePath)
:
m_oFontTableWriter (sDirOutput, sFontDir, bNoFontDir),
m_oDocumentWriter (sDirOutput, m_oHeaderFooterWriter),
m_oMediaWriter (sDirOutput),
m_oStylesWriter (sDirOutput, nVersion),
m_oNumberingWriter (sDirOutput),
m_oHeaderFooterWriter (sDirOutput),
m_oFootnotesWriter (sDirOutput),
m_oEndnotesWriter (sDirOutput),
m_oSettingWriter (sDirOutput, m_oHeaderFooterWriter),
m_oCommentsWriter (sDirOutput),
m_oChartWriter (sDirOutput),
m_oDocumentRelsWriter (sDirOutput),
m_oWebSettingsWriter (sDirOutput),
m_oCustomXmlWriter (sDirOutput, pDrawingConverter),
m_pDrawingConverter (pDrawingConverter),
m_bSaveChartAsImg (bSaveChartAsImg),
m_sThemePath (sThemePath),
m_nDocPrIndex (0),
m_pComments (NULL),
m_pApp (NULL),
m_pCore (NULL)
{
}
FileWriter::~FileWriter()
{
RELEASEOBJECT(m_pApp);
RELEASEOBJECT(m_pCore);
}
void FileWriter::Write()
{
m_oCommentsWriter.Write();
m_oChartWriter.Write();
m_oStylesWriter.Write();
m_oNumberingWriter.Write();
m_oFontTableWriter.Write();
m_oHeaderFooterWriter.Write();
m_oFootnotesWriter.Write();
m_oEndnotesWriter.Write();
//Setting пишем после HeaderFooter, чтобы заполнить evenAndOddHeaders
m_oSettingWriter.Write();
m_oWebSettingsWriter.Write();
//Document пишем после HeaderFooter, чтобы заполнить sectPr
m_oDocumentWriter.Write();
//Rels и ContentTypes пишем в конце
m_oDocumentRelsWriter.Write();
}
}

View File

@ -29,8 +29,7 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef FILE_WRITER
#define FILE_WRITER
#pragma once
#include "../../DesktopEditor/common/Path.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/VbaProject.h"
@ -95,57 +94,15 @@ namespace Writers
OOX::CApp* m_pApp;
OOX::CCore* m_pCore;
FileWriter (std::wstring sDirOutput,std::wstring sFontDir, bool bNoFontDir, int nVersion, bool bSaveChartAsImg, NSBinPptxRW::CDrawingConverter* pDrawingConverter, std::wstring sThemePath)
: m_pDrawingConverter(pDrawingConverter), m_sThemePath(sThemePath), m_bSaveChartAsImg(bSaveChartAsImg),
m_oFontTableWriter (sDirOutput, sFontDir, bNoFontDir),
m_oHeaderFooterWriter (sDirOutput),
m_oFootnotesWriter (sDirOutput),
m_oEndnotesWriter (sDirOutput),
m_oMediaWriter (sDirOutput),
m_oStylesWriter (sDirOutput, nVersion),
m_oNumberingWriter (sDirOutput),
m_oDocumentWriter (sDirOutput, m_oHeaderFooterWriter),
m_oSettingWriter (sDirOutput, m_oHeaderFooterWriter),
m_oCommentsWriter (sDirOutput),
m_oChartWriter (sDirOutput),
m_oDocumentRelsWriter (sDirOutput),
m_oWebSettingsWriter (sDirOutput),
m_nDocPrIndex(0),
m_pComments(NULL),
m_oCustomXmlWriter (sDirOutput, pDrawingConverter),
m_pApp (NULL),
m_pCore (NULL)
{
}
~FileWriter()
{
RELEASEOBJECT(m_pApp);
RELEASEOBJECT(m_pCore);
}
FileWriter (std::wstring sDirOutput,std::wstring sFontDir, bool bNoFontDir, int nVersion, bool bSaveChartAsImg, NSBinPptxRW::CDrawingConverter* pDrawingConverter, std::wstring sThemePath);
~FileWriter();
int getNextDocPr()
{
m_nDocPrIndex++;
return m_nDocPrIndex;
}
void Write()
{
m_oCommentsWriter.Write();
m_oChartWriter.Write();
m_oStylesWriter.Write();
m_oNumberingWriter.Write();
m_oFontTableWriter.Write();
m_oHeaderFooterWriter.Write();
m_oFootnotesWriter.Write();
m_oEndnotesWriter.Write();
//Setting пишем после HeaderFooter, чтобы заполнить evenAndOddHeaders
m_oSettingWriter.Write();
m_oWebSettingsWriter.Write();
//Document пишем после HeaderFooter, чтобы заполнить sectPr
m_oDocumentWriter.Write();
//Rels и ContentTypes пишем в конце
m_oDocumentRelsWriter.Write();
}
void Write();
};
}
#endif // #ifndef FILE_WRITER

View File

@ -29,8 +29,7 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef HEADER_FOOTER_WRITER
#define HEADER_FOOTER_WRITER
#pragma once
#include "../../XlsxSerializerCom/Common/Common.h"
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_Word.h"
@ -60,8 +59,8 @@ namespace Writers
std::wstring rId;
SimpleTypes::EHdrFtr eType;
};
static std::wstring g_string_hdr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<w:hdr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
static std::wstring g_string_xml_start = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
static std::wstring g_string_xmlns = L"xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
@ -78,35 +77,19 @@ xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
mc:Ignorable=\"w14 w15 wp14\">");
static std::wstring g_string_hdr_End = _T("</w:hdr>");
mc:Ignorable=\"w14 w15 wp14\">";
static std::wstring g_string_hdr_Start = g_string_xml_start + L"<w:hdr " + g_string_xmlns;
static std::wstring g_string_hdr_End = L"</w:hdr>";
static std::wstring g_string_ftr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<w:ftr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
mc:Ignorable=\"w14 w15 wp14\">");
static std::wstring g_string_ftr_End = _T("</w:ftr>");
static std::wstring g_string_ftr_Start = g_string_xml_start + L"<w:ftr " + g_string_xmlns;
static std::wstring g_string_ftr_End = L"</w:ftr>";
static std::wstring g_string_footnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:footnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" mc:Ignorable=\"w14 w15 wp14\">");
static std::wstring g_string_footnotes_End = _T("</w:footnotes>");
static std::wstring g_string_footnotes_Start = g_string_xml_start + L"<w:footnotes " + g_string_xmlns;
static std::wstring g_string_footnotes_End = L"</w:footnotes>";
static std::wstring g_string_endnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:endnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" mc:Ignorable=\"w14 w15 wp14\">");
static std::wstring g_string_endnotes_End = _T("</w:endnotes>");
static std::wstring g_string_endnotes_Start = g_string_xml_start + L"<w:endnotes " + g_string_xmlns;
static std::wstring g_string_endnotes_End = L"</w:endnotes>";
class HeaderFooterWriter
{
@ -133,17 +116,17 @@ mc:Ignorable=\"w14 w15 wp14\">");
for(size_t i = 0, length = m_aHeaders.size(); i < length; ++i)
{
HdrFtrItem* pHeader = m_aHeaders[i];
WriteItem(_T("header"), pHeader->m_sFilename, pHeader->Header, true);
WriteItem(L"header", pHeader->m_sFilename, pHeader->Header, true);
}
for(size_t i = 0, length = m_aFooters.size(); i < length; ++i)
{
HdrFtrItem* pFooter = m_aFooters[i];
WriteItem(_T("footer"), pFooter->m_sFilename, pFooter->Header, false);
WriteItem(L"footer", pFooter->m_sFilename, pFooter->Header, false);
}
}
void WriteItem( std::wstring sHeader, std::wstring& sFilename, ContentWriter& m_oWriter, bool bHeader)
{
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + sFilename;
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR + sFilename;
NSFile::CFileBinary oFile;
oFile.CreateFileW(filePath.GetPath());
@ -186,7 +169,7 @@ mc:Ignorable=\"w14 w15 wp14\">");
}
std::wstring getFilename()
{
return _T("footnotes.xml");
return L"footnotes.xml";
}
bool IsEmpty()
{
@ -208,7 +191,7 @@ mc:Ignorable=\"w14 w15 wp14\">");
std::wstring sFilename = getFilename();
std::wstring filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + sFilename;
std::wstring filePath = m_sDir + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR + sFilename;
NSFile::CFileBinary oFile;
oFile.CreateFileW(filePath);
@ -219,7 +202,7 @@ mc:Ignorable=\"w14 w15 wp14\">");
}
std::wstring getFilename()
{
return _T("endnotes.xml");
return L"endnotes.xml";
}
bool IsEmpty()
{
@ -227,4 +210,3 @@ mc:Ignorable=\"w14 w15 wp14\">");
}
};
}
#endif // #ifndef HEADER_FOOTER_WRITER

View File

@ -31,10 +31,10 @@
*/
#pragma once
#ifndef READER_CLASSES
#define READER_CLASSES
#include "HeaderFooterWriter.h"
#include "../../Common/DocxFormat/Source/XML/Utils.h"
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_Word.h"
#include <boost/algorithm/string.hpp>
@ -99,6 +99,7 @@ public:
bSectionType = false;
bPageNumStart = false;
bRtlGutter = false;
bGutter = false;
}
std::wstring Write()
{
@ -439,13 +440,12 @@ public:
class Tab
{
public:
BYTE Val;
SimpleTypes::CTabJc<> Val;
long Pos;
BYTE Leader;
bool bLeader;
Tab()
{
Val = shd_Nil;
Pos = 0;
bLeader = false;
}
@ -688,8 +688,8 @@ public:
{
if(DStrikeout)
pCStringWriter->WriteString(L"<w:dstrike/>");
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(L"<w:dstrike w:val=\"false\"/>");
//else if(false == bDoNotWriteNullProp)
// pCStringWriter->WriteString(L"<w:dstrike w:val=\"false\"/>");
}
if(bVanish)
{
@ -732,7 +732,9 @@ public:
}
if(bFontSizeCs)
{
pCStringWriter->WriteString(L"<w:szCs w:val=\"" + std::to_wstring(FontSizeCs) + L"\"/>");
if(false == bFontSize)
pCStringWriter->WriteString(L"<w:sz w:val=\"" + std::to_wstring(FontSizeCs) + L"\"/>");
pCStringWriter->WriteString(L"<w:szCs w:val=\"" + std::to_wstring(FontSizeCs) + L"\"/>");
}
if(bHighLight)
{
@ -1406,7 +1408,9 @@ class docLvl
public:
long ILvl;
long Format;
std::wstring sFormat;
BYTE Jc;
std::wstring sJc;
std::vector<docLvlText*> Text;
long Restart;
long Start;
@ -1491,7 +1495,11 @@ public:
{
oWriter.WriteString(L"<w:start w:val=\"" + std::to_wstring(Start) + L"\"/>");
}
if(bFormat)
if(!sFormat.empty())
{
oWriter.WriteString(sFormat);
}
else if(bFormat)
{
std::wstring sFormat;
switch(Format)
@ -1599,19 +1607,23 @@ public:
}
oWriter.WriteString(L"/>");
}
if(bJc)
if(!sJc.empty())
{
std::wstring sJc;
oWriter.WriteString(sJc);
}
else if(bJc)
{
std::wstring sJcType;
switch(Jc)
{
case align_Right:sJc = _T("right");break;
case align_Left:sJc = _T("left");break;
case align_Center:sJc = _T("center");break;
case align_Justify:sJc = _T("distribute");break;
case align_Right:sJcType = _T("right");break;
case align_Left:sJcType = _T("left");break;
case align_Center:sJcType = _T("center");break;
case align_Justify:sJcType = _T("distribute");break;
}
if(!sJc.empty())
if(!sJcType.empty())
{
oWriter.WriteString(L"<w:lvlJc w:val=\"" + sJc + L"\"/>");
oWriter.WriteString(L"<w:lvlJc w:val=\"" + sJcType + L"\"/>");
}
}
if(bParaPr)
@ -1759,9 +1771,9 @@ public:
if(bGridAfter && nGridAfter > 0)
{
writer.WriteString(L"<w:grid" + sName + L" w:val=\"" + std::to_wstring(nGridAfter) + L"\"/>");
if(oAfterWidth.bW)
oAfterWidth.Write(writer, _T("w:w") + sName);
}
if(oAfterWidth.bW)
oAfterWidth.Write(writer, _T("w:w") + sName);
}
};
class WriteHyperlink
@ -1893,12 +1905,19 @@ public:
m_nId += nCount;
return nRes;
}
int getCurrentId()
{
return m_nId;
}
};
class CComment{
class CComment
{
private:
IdCounter& m_oParaIdCounter;
IdCounter& m_oFormatIdCounter;
public:
void *pBinary_DocumentTableReader;
int IdOpen;
int IdFormat;
std::wstring UserName;
@ -1910,8 +1929,10 @@ public:
bool Solved;
unsigned int DurableId;
std::wstring Text;
std::wstring m_sParaId;
std::wstring m_sParaIdParent;
std::wstring sContent;
std::wstring sParaId;
std::wstring sParaIdParent;
std::vector<CComment*> replies;
bool bIdOpen;
@ -1982,8 +2003,8 @@ public:
int nId = pComment->m_oParaIdCounter.getNextId();
pComment->m_sParaId = XmlUtils::IntToString(nId, L"%08X");
sRes += L"<w:p w14:paraId=\"" + pComment->m_sParaId + L"\" w14:textId=\"" + pComment->m_sParaId + L"\">";
pComment->sParaId = XmlUtils::IntToString(nId, L"%08X");
sRes += L"<w:p w14:paraId=\"" + pComment->sParaId + L"\" w14:textId=\"" + pComment->sParaId + L"\">";
sRes += L"<w:pPr><w:spacing w:line=\"240\" w:after=\"0\" w:lineRule=\"auto\" w:before=\"0\"/><w:ind w:firstLine=\"0\" w:left=\"0\" w:right=\"0\"/><w:jc w:val=\"left\"/></w:pPr><w:r><w:rPr><w:rFonts w:eastAsia=\"Arial\" w:ascii=\"Arial\" w:hAnsi=\"Arial\" w:cs=\"Arial\"/><w:sz w:val=\"22\"/></w:rPr><w:t xml:space=\"preserve\">";
sRes += sPart;
sRes += L"</w:t></w:r></w:p>";
@ -2025,49 +2046,58 @@ public:
sRes += L"\"";
}
sRes += L">";
std::wstring sText = pComment->Text;
XmlUtils::replace_all(sText, L"\r", L"");
int nPrevIndex = 0;
for (int i = 0; i < (int)sText.length(); i++)
if (false == pComment->sContent.empty())
{
wchar_t cToken = sText[i];
if('\n' == cToken)
{
writeContentWritePart(pComment, sText, nPrevIndex, i, sRes);
nPrevIndex = i + 1;
}
sRes += pComment->sContent;
}
writeContentWritePart(pComment, sText, nPrevIndex, (int)sText.length(), sRes);
sRes += L"</w:comment>";
else
{
//old comments
std::wstring sText = pComment->Text;
XmlUtils::replace_all(sText, L"\r", L"");
int nPrevIndex = 0;
for (int i = 0; i < (int)sText.length(); i++)
{
wchar_t cToken = sText[i];
if('\n' == cToken)
{
writeContentWritePart(pComment, sText, nPrevIndex, i, sRes);
nPrevIndex = i + 1;
}
}
writeContentWritePart(pComment, sText, nPrevIndex, (int)sText.length(), sRes);
}
sRes += L"</w:comment>";
return sRes;
}
static std::wstring writeContentExt(CComment* pComment)
{
std::wstring sRes;
if(!pComment->m_sParaId.empty())
if(false == pComment->sParaId.empty())
{
std::wstring sDone(L"0");
if(pComment->bSolved && pComment->Solved)
sDone = _T("1");
if(!pComment->m_sParaIdParent.empty())
sRes += L"<w15:commentEx w15:paraId=\"" + pComment->m_sParaId + L"\" \
w15:paraIdParent=\"" + pComment->m_sParaIdParent + L"\" w15:done=\"" + sDone + L"\"/>";
if(!pComment->sParaIdParent.empty())
sRes += L"<w15:commentEx w15:paraId=\"" + pComment->sParaId + L"\" \
w15:paraIdParent=\"" + pComment->sParaIdParent + L"\" w15:done=\"" + sDone + L"\"/>";
else
sRes += L"<w15:commentEx w15:paraId=\"" + pComment->m_sParaId + L"\" w15:done=\"" + sDone + L"\"/>";
sRes += L"<w15:commentEx w15:paraId=\"" + pComment->sParaId + L"\" w15:done=\"" + sDone + L"\"/>";
//расставляем paraIdParent
for(size_t i = 0; i < pComment->replies.size(); i++)
pComment->replies[i]->m_sParaIdParent = pComment->m_sParaId;
pComment->replies[i]->sParaIdParent = pComment->sParaId;
}
return sRes;
}
static std::wstring writeContentsIds(CComment* pComment)
{
std::wstring sRes;
if(!pComment->m_sParaId.empty() && pComment->bDurableId)
if(!pComment->sParaId.empty() && pComment->bDurableId)
{
sRes += L"<w16cid:commentId w16cid:paraId=\"" + pComment->m_sParaId + L"\" w16cid:durableId=\"" + XmlUtils::IntToString(pComment->DurableId, L"%08X") + L"\"/>";
sRes += L"<w16cid:commentId w16cid:paraId=\"" + pComment->sParaId + L"\" w16cid:durableId=\"" + XmlUtils::IntToString(pComment->DurableId, L"%08X") + L"\"/>";
}
return sRes;
}
@ -2099,8 +2129,8 @@ class CComments
public:
IdCounter m_oFormatIdCounter;
IdCounter m_oParaIdCounter;
public:
CComments():m_oParaIdCounter(1)
CComments() : m_oParaIdCounter(1)
{
}
~CComments()
@ -3117,4 +3147,3 @@ public:
}
};
}
#endif // #ifndef READER_CLASSES

View File

@ -112,7 +112,9 @@ public:
long read1defCurPos = 0;\
while(read1defCurPos < (long)stLen)\
{\
BYTE read1defType = m_oBufferedStream.GetUChar();\
BYTE read1defType = 0;\
if (false == m_oBufferedStream.GetUCharWithResult(&read1defType))\
break;\
long read1defLength = m_oBufferedStream.GetLong();\
res = fReadFunction(read1defType, read1defLength, arg);\
if(res == c_oSerConstants::ReadUnknown)\
@ -129,7 +131,9 @@ public:
long read2defCurPos = 0;\
while(read2defCurPos < (long)stLen)\
{\
BYTE read2defType = m_oBufferedStream.GetUChar();\
BYTE read2defType = 0;\
if (false == m_oBufferedStream.GetUCharWithResult(&read2defType))\
break;\
long read2defLenType = m_oBufferedStream.GetUChar();\
int read2defCurPosShift = 2;\
int read2defRealLen;\
@ -904,15 +908,7 @@ int Binary_pPrReader::ReadContent( BYTE type, long length, void* poResult)
for(size_t i = 0; i < nLen; ++i)
{
Tab& oTab = oTabs.m_aTabs[i];
std::wstring sVal;
switch(oTab.Val)
{
case g_tabtype_right: sVal = L"right"; break;
case g_tabtype_center: sVal = L"center"; break;
case g_tabtype_clear: sVal = L"clear"; break;
default: sVal = L"left"; break;
}
pCStringWriter->WriteString(L"<w:tab w:val=\"" + sVal + L"\" w:pos=\"" + std::to_wstring(oTab.Pos) + L"\"");
pCStringWriter->WriteString(L"<w:tab w:val=\"" + oTab.Val.ToString() + L"\" w:pos=\"" + std::to_wstring(oTab.Pos) + L"\"");
if (oTab.bLeader)
{
std::wstring sLeader;
@ -1138,7 +1134,17 @@ int Binary_pPrReader::ReadTabItem(BYTE type, long length, void* poResult)
int res = c_oSerConstants::ReadOk;
Tab* poTabItem = static_cast<Tab*>(poResult);
if(c_oSerProp_pPrType::Tab_Item_Val == type)
poTabItem->Val = m_oBufferedStream.GetUChar();
poTabItem->Val.SetValue((SimpleTypes::ETabJc)m_oBufferedStream.GetUChar());
else if(c_oSerProp_pPrType::Tab_Item_Val_deprecated == type)
{
switch(m_oBufferedStream.GetUChar())
{
case 1: poTabItem->Val.SetValue(SimpleTypes::tabjcRight);break;
case 2: poTabItem->Val.SetValue(SimpleTypes::tabjcCenter);break;
case 3: poTabItem->Val.SetValue(SimpleTypes::tabjcClear);break;
default:poTabItem->Val.SetValue(SimpleTypes::tabjcLeft);break;
}
}
else if(c_oSerProp_pPrType::Tab_Item_Pos == type)
poTabItem->Pos = SerializeCommon::Round( g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
else if(c_oSerProp_pPrType::Tab_Item_PosTwips == type)
@ -1429,8 +1435,7 @@ int Binary_pPrReader::ReadFootnotePr(BYTE type, long length, void* poResult)
else if( c_oSerNotes::PrStart == type )
{
pFtnProps->m_oNumStart.Init();
pFtnProps->m_oNumStart->m_oVal.Init();
pFtnProps->m_oNumStart->m_oVal->SetValue(m_oBufferedStream.GetLong());
pFtnProps->m_oNumStart->m_oVal = m_oBufferedStream.GetLong();
}
else if( c_oSerNotes::PrFntPos == type )
{
@ -1460,8 +1465,7 @@ int Binary_pPrReader::ReadEndnotePr(BYTE type, long length, void* poResult)
else if( c_oSerNotes::PrStart == type )
{
pEdnProps->m_oNumStart.Init();
pEdnProps->m_oNumStart->m_oVal.Init();
pEdnProps->m_oNumStart->m_oVal->SetValue(m_oBufferedStream.GetLong());
pEdnProps->m_oNumStart->m_oVal = m_oBufferedStream.GetLong();
}
else if( c_oSerNotes::PrEndPos == type )
{
@ -1935,7 +1939,6 @@ int Binary_tblPrReader::Read_tblPr(BYTE type, long length, void* poResult)
Shd oShd;
READ2_DEF(length, res, oBinary_CommonReader2.ReadShd, &oShd);
pWiterTblPr->Shd = oShd.ToString();
m_sCurTableShd = pWiterTblPr->Shd;
}
else if( c_oSerProp_tblPrType::tblpPr == type )
{
@ -2402,7 +2405,6 @@ int Binary_tblPrReader::Read_CellPr(BYTE type, long length, void* poResult)
}
else if( c_oSerProp_cellPrType::Shd == type )
{
bCellShd = true;
Shd oShd;
READ2_DEF(length, res, oBinary_CommonReader2.ReadShd, &oShd);
pCStringWriter->WriteString(oShd.ToString());
@ -2824,11 +2826,24 @@ int Binary_NumberingTableReader::ReadLevel(BYTE type, long length, void* poResul
odocLvl->bFormat = true;
odocLvl->Format = m_oBufferedStream.GetLong();
}
else if ( c_oSerNumTypes::lvl_Jc == type )
else if ( c_oSerNumTypes::lvl_NumFmt == type )
{
ComplexTypes::Word::CNumFmt oNumFmt;
READ1_DEF(length, res, oBinary_pPrReader.ReadNumFmt, &oNumFmt);
odocLvl->sFormat = L"<w:numFmt " + oNumFmt.ToString() + L"/>";
}
else if ( c_oSerNumTypes::lvl_Jc_deprecated == type )
{
odocLvl->bJc = true;
odocLvl->Jc = m_oBufferedStream.GetUChar();
}
else if ( c_oSerNumTypes::lvl_Jc == type )
{
ComplexTypes::Word::CJc oJc;
oJc.m_oVal.Init();
oJc.m_oVal->SetValue((SimpleTypes::EJc)m_oBufferedStream.GetUChar());
odocLvl->sJc = L"<w:lvlJc " + oJc.ToString() + L"/>";
}
else if ( c_oSerNumTypes::lvl_LvlText == type )
{
odocLvl->bText = true;
@ -3281,7 +3296,14 @@ int Binary_OtherTableReader::ReadOtherContent(BYTE type, long length, void* poRe
else if(c_oSerOtherTableTypes::DocxTheme == type)
{
smart_ptr<PPTX::Theme> pTheme = new PPTX::Theme(NULL);
pTheme->fromPPTY(&m_oBufferedStream);
try
{
pTheme->fromPPTY(&m_oBufferedStream);
}
catch(...)
{
//todooo в отдельный лог
}
NSBinPptxRW::CXmlWriter xmlWriter;
pTheme->toXmlWriter(&xmlWriter);
m_oFileWriter.m_oTheme.m_sContent = xmlWriter.GetXmlString();
@ -3340,22 +3362,40 @@ int Binary_OtherTableReader::ReadImageMapContent(BYTE type, long length, void* p
}
Binary_CommentsTableReader::Binary_CommentsTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter):Binary_CommonReader(poBufferedStream)
Binary_CommentsTableReader::Binary_CommentsTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter)
: Binary_CommonReader(poBufferedStream), m_oFileWriter(oFileWriter)
{
}
int Binary_CommentsTableReader::Read()
{
m_oFileWriter.m_pDrawingConverter->SetDstContentRels();
Writers::ContentWriter oContentWriter;
Binary_DocumentTableReader oBinary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, oContentWriter, &m_oComments);
oBinary_DocumentTableReader.m_bUsedParaIdCounter = true;
int res = c_oSerConstants::ReadOk;
READ_TABLE_DEF(res, this->ReadComments, NULL);
READ_TABLE_DEF(res, this->ReadComments, &oBinary_DocumentTableReader);
OOX::CPath fileRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + L"word" +
FILE_SEPARATOR_STR + L"_rels"+
FILE_SEPARATOR_STR + m_oFileWriter.m_oCommentsWriter.getFilename() + L".rels";
m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(fileRelsPath.GetPath());
return res;
};
}
int Binary_CommentsTableReader::ReadComments(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
if ( c_oSer_CommentsType::Comment == type )
{
CComment* pComment = new CComment(m_oComments.m_oParaIdCounter, m_oComments.m_oFormatIdCounter);
pComment->pBinary_DocumentTableReader = poResult;
READ1_DEF(length, res, this->ReadCommentContent, pComment);
if(pComment->bIdOpen && NULL == m_oComments.get(pComment->IdOpen))
m_oComments.add(pComment);
else
@ -3364,11 +3404,12 @@ int Binary_CommentsTableReader::ReadComments(BYTE type, long length, void* poRes
else
res = c_oSerConstants::ReadUnknown;
return res;
};
}
int Binary_CommentsTableReader::ReadCommentContent(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
CComment* pComment = static_cast<CComment*>(poResult);
if ( c_oSer_CommentsType::Id == type )
{
pComment->bIdOpen = true;
@ -3418,28 +3459,55 @@ int Binary_CommentsTableReader::ReadCommentContent(BYTE type, long length, void*
pComment->bDurableId = true;
pComment->DurableId = m_oBufferedStream.GetULong();
}
else if ( c_oSer_CommentsType::CommentContent == type )
{
READ1_DEF(length, res, this->ReadCommentContentExt, pComment->pBinary_DocumentTableReader);
Binary_DocumentTableReader* doc_reader = (Binary_DocumentTableReader*)pComment->pBinary_DocumentTableReader;
pComment->sContent = doc_reader->m_oDocumentWriter.m_oContent.GetData();
doc_reader->m_oDocumentWriter.m_oContent.Clear();
int nId = doc_reader->m_pComments->m_oParaIdCounter.getCurrentId();
pComment->sParaId = XmlUtils::IntToString(nId, L"%08X");
}
else if ( c_oSer_CommentsType::Replies == type )
{
READ1_DEF(length, res, this->ReadReplies, &pComment->replies);
READ1_DEF(length, res, this->ReadReplies, pComment);
}
else
res = c_oSerConstants::ReadUnknown;
return res;
};
}
int Binary_CommentsTableReader::ReadCommentContentExt(BYTE type, long length, void* poResult)
{
Binary_DocumentTableReader* pBinary_DocumentTableReader = static_cast<Binary_DocumentTableReader*>(poResult);
if (!pBinary_DocumentTableReader) return c_oSerConstants::ReadOk;
return pBinary_DocumentTableReader->ReadDocumentContent(type, length, NULL);
}
int Binary_CommentsTableReader::ReadReplies(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
std::vector<CComment*>* paComments = static_cast<std::vector<CComment*>*>(poResult);
CComment* pCommentParent = static_cast<CComment*>(poResult);
if ( c_oSer_CommentsType::Comment == type )
{
CComment* pNewComment = new CComment(m_oComments.m_oParaIdCounter, m_oComments.m_oFormatIdCounter);
pNewComment->pBinary_DocumentTableReader = pCommentParent->pBinary_DocumentTableReader;
READ1_DEF(length, res, this->ReadCommentContent, pNewComment);
paComments->push_back(pNewComment);
pNewComment->sParaIdParent = pCommentParent->sParaId;
pCommentParent->replies.push_back(pNewComment);
}
else
res = c_oSerConstants::ReadUnknown;
return res;
};
}
Binary_SettingsTableReader::Binary_SettingsTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, OOX::CSettingsCustom& oSettingsCustom):
@ -3742,8 +3810,7 @@ int Binary_SettingsTableReader::ReadFootnotePr(BYTE type, long length, void* poR
else if( c_oSerNotes::PrStart == type )
{
pFtnProps->m_oNumStart.Init();
pFtnProps->m_oNumStart->m_oVal.Init();
pFtnProps->m_oNumStart->m_oVal->SetValue(m_oBufferedStream.GetLong());
pFtnProps->m_oNumStart->m_oVal = m_oBufferedStream.GetLong();
}
else if( c_oSerNotes::PrFntPos == type )
{
@ -3781,8 +3848,7 @@ int Binary_SettingsTableReader::ReadEndnotePr(BYTE type, long length, void* poRe
else if( c_oSerNotes::PrStart == type )
{
pEdnProps->m_oNumStart.Init();
pEdnProps->m_oNumStart->m_oVal.Init();
pEdnProps->m_oNumStart->m_oVal->SetValue(m_oBufferedStream.GetLong());
pEdnProps->m_oNumStart->m_oVal = m_oBufferedStream.GetLong();
}
else if( c_oSerNotes::PrEndPos == type )
{
@ -3944,9 +4010,9 @@ int Binary_SettingsTableReader::ReadMathDispDef(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:dispDef");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
m_oFileWriter.m_oSettingWriter.AddSetting(sVal);
}
else
@ -4120,9 +4186,9 @@ int Binary_SettingsTableReader::ReadMathSmallFrac(BYTE type, long length, void*
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:smallFrac m:val=");
if (bVal)
sVal += _T("\"true\" />");
sVal += _T("\"on\" />");
else
sVal += _T("\"false\" />");
sVal += _T("\"off\" />");
m_oFileWriter.m_oSettingWriter.AddSetting(sVal);
}
else
@ -4154,9 +4220,9 @@ int Binary_SettingsTableReader::ReadMathWrapRight(BYTE type, long length, void*
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:wrapRight m:val=");
if (bVal)
sVal += _T("\"true\" />");
sVal += _T("\"on\" />");
else
sVal += _T("\"false\" />");
sVal += _T("\"off\" />");
m_oFileWriter.m_oSettingWriter.AddSetting(sVal);
}
else
@ -4191,6 +4257,7 @@ Binary_DocumentTableReader::Binary_DocumentTableReader(NSBinPptxRW::CBinaryFileR
, m_oMath_rPr(m_oFontTableWriter.m_mapFonts)
, m_pComments(pComments)
{
m_bUsedParaIdCounter = false;
m_byteLastElemType = c_oSerParType::Content;
m_pCurWriter = NULL;
}
@ -4224,20 +4291,26 @@ int Binary_DocumentTableReader::ReadDocumentContent(BYTE type, long length, void
m_byteLastElemType = c_oSerParType::Par;
m_oCur_pPr.ClearNoAttack();
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<w:p>")));
if (m_bUsedParaIdCounter && m_pComments)
{
int nId = m_pComments->m_oParaIdCounter.getNextId();
std::wstring sParaId = XmlUtils::IntToString(nId, L"%08X");
m_oDocumentWriter.m_oContent.WriteString(L"<w:p w14:paraId=\"" + sParaId + L"\" w14:textId=\"" + sParaId + L"\">");
}
else
{
m_oDocumentWriter.m_oContent.WriteString(std::wstring(L"<w:p>"));
}
READ1_DEF(length, res, this->ReadParagraph, NULL);
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</w:p>")));
m_oDocumentWriter.m_oContent.WriteString(std::wstring(L"</w:p>"));
}
else if(c_oSerParType::Table == type)
{
m_byteLastElemType = c_oSerParType::Table;
//сбрасываем Shd
oBinary_tblPrReader.m_sCurTableShd.clear();
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<w:tbl>")));
READ1_DEF(length, res, this->ReadDocTable, &m_oDocumentWriter.m_oContent);
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</w:tbl>")));
//сбрасываем Shd
oBinary_tblPrReader.m_sCurTableShd.clear();
}
else if(c_oSerParType::Sdt == type)
{
@ -4457,13 +4530,13 @@ int Binary_DocumentTableReader::ReadParagraphContent(BYTE type, long length, voi
{
OOX::Logic::CBookmarkStart oBookmarkStart;
READ1_DEF(length, res, this->ReadBookmarkStart, &oBookmarkStart);
m_oDocumentWriter.m_oContent.WriteString(oBookmarkStart.toXML());
GetRunStringWriter().WriteString(oBookmarkStart.toXML());
}
else if ( c_oSerParType::BookmarkEnd == type )
{
OOX::Logic::CBookmarkEnd oBookmarkEnd;
READ1_DEF(length, res, this->ReadBookmarkEnd, &oBookmarkEnd);
m_oDocumentWriter.m_oContent.WriteString(oBookmarkEnd.toXML());
GetRunStringWriter().WriteString(oBookmarkEnd.toXML());
}
else
res = c_oSerConstants::ReadUnknown;
@ -4704,8 +4777,7 @@ int Binary_DocumentTableReader::ReadFFData(BYTE type, long length, void* poResul
else if ( c_oSerFFData::Label == type )
{
pFFData->m_oLabel.Init();
pFFData->m_oLabel->m_oVal.Init();
pFFData->m_oLabel->m_oVal->SetValue(m_oBufferedStream.GetLong());
pFFData->m_oLabel->m_oVal = m_oBufferedStream.GetLong();
}
else if ( c_oSerFFData::Name == type )
{
@ -4770,20 +4842,18 @@ int Binary_DocumentTableReader::ReadDDList(BYTE type, long length, void* poResul
if ( c_oSerFFData::DLDefault == type )
{
pDDList->m_oDefault.Init();
pDDList->m_oDefault->m_oVal.Init();
pDDList->m_oDefault->m_oVal->SetValue(m_oBufferedStream.GetLong());
pDDList->m_oDefault->m_oVal = m_oBufferedStream.GetLong();
}
else if ( c_oSerFFData::DLResult == type )
{
pDDList->m_oResult.Init();
pDDList->m_oResult->m_oVal.Init();
pDDList->m_oResult->m_oVal->SetValue(m_oBufferedStream.GetLong());
pDDList->m_oResult->m_oVal = m_oBufferedStream.GetLong();
}
else if ( c_oSerFFData::DLListEntry == type )
{
ComplexTypes::Word::String* pVal = new ComplexTypes::Word::String();
pVal->m_sVal.Init();
pVal->m_sVal->append(m_oBufferedStream.GetString3(length));
pVal->m_sVal = m_oBufferedStream.GetString3(length);
pDDList->m_arrListEntry.push_back(pVal);
}
else
@ -4835,20 +4905,17 @@ int Binary_DocumentTableReader::ReadTextInput(BYTE type, long length, void* poRe
if ( c_oSerFFData::TIDefault == type )
{
pTextInput->m_oDefault.Init();
pTextInput->m_oDefault->m_sVal.Init();
pTextInput->m_oDefault->m_sVal->append(m_oBufferedStream.GetString3(length));
pTextInput->m_oDefault->m_sVal = m_oBufferedStream.GetString3(length);
}
else if ( c_oSerFFData::TIFormat == type )
{
pTextInput->m_oFormat.Init();
pTextInput->m_oFormat->m_sVal.Init();
pTextInput->m_oFormat->m_sVal->append(m_oBufferedStream.GetString3(length));
pTextInput->m_oFormat->m_sVal = m_oBufferedStream.GetString3(length);
}
else if ( c_oSerFFData::TIMaxLength == type )
{
pTextInput->m_oMaxLength.Init();
pTextInput->m_oMaxLength->m_oVal.Init();
pTextInput->m_oMaxLength->m_oVal->SetValue(m_oBufferedStream.GetLong());
pTextInput->m_oMaxLength->m_oVal = m_oBufferedStream.GetLong();
}
else if ( c_oSerFFData::TIType == type )
{
@ -5209,9 +5276,9 @@ int Binary_DocumentTableReader::ReadMathAln(BYTE type, long length, void* poResu
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:aln");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -5226,9 +5293,9 @@ int Binary_DocumentTableReader::ReadMathAlnScr(BYTE type, long length, void* poR
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:alnScr");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -5642,12 +5709,13 @@ int Binary_DocumentTableReader::ReadMathDegHide(BYTE type, long length, void* po
int res = c_oSerConstants::ReadOk;
if ( c_oSer_OMathBottomNodesValType::Val == type )
{
//word writes "1"(excel, powerpoint write "on"). "on" is correct for word, libre, onedrive, gdrive
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:degHide");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -5662,9 +5730,9 @@ int Binary_DocumentTableReader::ReadMathDiff(BYTE type, long length, void* poRes
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:diff");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -5912,9 +5980,9 @@ int Binary_DocumentTableReader::ReadMathGrow(BYTE type, long length, void* poRes
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:grow");
if (!bVal)
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
else
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
GetRunStringWriter().WriteString(sVal);
}
@ -5930,9 +5998,9 @@ int Binary_DocumentTableReader::ReadMathHideBot(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:hideBot");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -5947,9 +6015,9 @@ int Binary_DocumentTableReader::ReadMathHideLeft(BYTE type, long length, void* p
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:hideLeft");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -5964,9 +6032,9 @@ int Binary_DocumentTableReader::ReadMathHideRight(BYTE type, long length, void*
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:hideRight");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -5981,9 +6049,9 @@ int Binary_DocumentTableReader::ReadMathHideTop(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:hideTop");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -6115,9 +6183,9 @@ int Binary_DocumentTableReader::ReadMathLit(BYTE type, long length, void* poResu
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:lit");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -6151,9 +6219,9 @@ int Binary_DocumentTableReader::ReadMathMaxDist(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:maxDist");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -6363,9 +6431,9 @@ int Binary_DocumentTableReader::ReadMathNoBreak(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:noBreak");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -6380,9 +6448,9 @@ int Binary_DocumentTableReader::ReadMathNor(BYTE type, long length, void* poResu
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:nor");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -6397,9 +6465,9 @@ int Binary_DocumentTableReader::ReadMathObjDist(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:objDist");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -6457,9 +6525,9 @@ int Binary_DocumentTableReader::ReadMathOpEmu(BYTE type, long length, void* poRe
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:opEmu");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -6526,9 +6594,9 @@ int Binary_DocumentTableReader::ReadMathPlcHide(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:plcHide");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -6811,9 +6879,9 @@ int Binary_DocumentTableReader::ReadMathShow(BYTE type, long length, void* poRes
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:show");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -7015,9 +7083,9 @@ int Binary_DocumentTableReader::ReadMathStrikeBLTR(BYTE type, long length, void*
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:strikeBLTR");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -7032,9 +7100,9 @@ int Binary_DocumentTableReader::ReadMathStrikeH(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:strikeH");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -7049,9 +7117,9 @@ int Binary_DocumentTableReader::ReadMathStrikeTLBR(BYTE type, long length, void*
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:strikeTLBR");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -7066,9 +7134,9 @@ int Binary_DocumentTableReader::ReadMathStrikeV(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:strikeV");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -7104,9 +7172,9 @@ int Binary_DocumentTableReader::ReadMathSubHide(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:subHide");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -7121,9 +7189,9 @@ int Binary_DocumentTableReader::ReadMathSupHide(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:supHide");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -7138,9 +7206,9 @@ int Binary_DocumentTableReader::ReadMathTransp(BYTE type, long length, void* poR
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:transp");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -7195,9 +7263,9 @@ int Binary_DocumentTableReader::ReadMathZeroAsc(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:zeroAsc");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -7212,9 +7280,9 @@ int Binary_DocumentTableReader::ReadMathZeroDesc(BYTE type, long length, void* p
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:zaroDesc");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -7229,9 +7297,9 @@ int Binary_DocumentTableReader::ReadMathZeroWid(BYTE type, long length, void* po
bool bVal = m_oBufferedStream.GetBool();
std::wstring sVal = _T("<m:zeroWid");
if (bVal)
sVal += _T(" m:val=\"true\" />");
sVal += _T(" m:val=\"on\" />");
else
sVal += _T(" m:val=\"false\" />");
sVal += _T(" m:val=\"off\" />");
GetRunStringWriter().WriteString(sVal);
}
else
@ -7356,23 +7424,29 @@ int Binary_DocumentTableReader::ReadRunContent(BYTE type, long length, void* poR
}
else if(c_oSerRunType::table == type)
{
//сбрасываем Shd
oBinary_tblPrReader.m_sCurTableShd.clear();
//todo
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</w:p>")));
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<w:tbl>")));
m_oDocumentWriter.m_oContent.WriteString(std::wstring(L"</w:p>"));
m_oDocumentWriter.m_oContent.WriteString(std::wstring(L"<w:tbl>"));
READ1_DEF(length, res, this->ReadDocTable, &m_oDocumentWriter.m_oContent);
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</w:tbl>")));
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<w:p>")));
m_oDocumentWriter.m_oContent.WriteString(std::wstring(L"</w:tbl>"));
if (m_bUsedParaIdCounter && m_pComments)
{
int nId = m_pComments->m_oParaIdCounter.getNextId();
std::wstring sParaId = XmlUtils::IntToString(nId, L"%08X");
m_oDocumentWriter.m_oContent.WriteString(L"<w:p w14:paraId=\"" + sParaId + L"\" w14:textId=\"" + sParaId + L"\">");
}
else
{
m_oDocumentWriter.m_oContent.WriteString(std::wstring(L"<w:p>"));
}
if(m_oCur_pPr.GetCurSize() > 0)
{
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<w:pPr>")));
m_oDocumentWriter.m_oContent.WriteString(std::wstring(L"<w:pPr>"));
m_oDocumentWriter.m_oContent.Write(m_oCur_pPr);
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</w:pPr>")));
m_oDocumentWriter.m_oContent.WriteString(std::wstring(L"</w:pPr>"));
}
//сбрасываем Shd
oBinary_tblPrReader.m_sCurTableShd.clear();
}
else if(c_oSerRunType::fldstart_deprecated == type)
{
@ -7753,13 +7827,7 @@ int Binary_DocumentTableReader::ReadCell(BYTE type, long length, void* poResult)
if( c_oSerDocTableType::Cell_Pr == type )
{
pCStringWriter->WriteString(std::wstring(_T("<w:tcPr>")));
oBinary_tblPrReader.bCellShd = false;
READ2_DEF(length, res, oBinary_tblPrReader.Read_CellPr, pCStringWriter);
if(false == oBinary_tblPrReader.bCellShd && !oBinary_tblPrReader.m_sCurTableShd.empty())
{
pCStringWriter->WriteString(oBinary_tblPrReader.m_sCurTableShd);
}
oBinary_tblPrReader.bCellShd = false;
pCStringWriter->WriteString(std::wstring(_T("</w:tcPr>")));
}
else if( c_oSerDocTableType::Cell_Content == type )
@ -7769,7 +7837,7 @@ int Binary_DocumentTableReader::ReadCell(BYTE type, long length, void* poResult)
//Потому что если перед </tc> не идет <p>, то документ считается невалидным
if(c_oSerParType::Par != oBinary_DocumentTableReader.m_byteLastElemType)
{
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<w:p />")));
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("<w:p/>")));
}
}
else
@ -8614,8 +8682,7 @@ int Binary_DocumentTableReader::ReadSdtPr(BYTE type, long length, void* poResult
else if (c_oSerSdt::Alias == type)
{
pSdtPr->m_oAlias.Init();
pSdtPr->m_oAlias->m_sVal.Init();
pSdtPr->m_oAlias->m_sVal->append(m_oBufferedStream.GetString3(length));
pSdtPr->m_oAlias->m_sVal = m_oBufferedStream.GetString3(length);
}
else if (c_oSerSdt::Appearance == type)
{
@ -8663,14 +8730,12 @@ int Binary_DocumentTableReader::ReadSdtPr(BYTE type, long length, void* poResult
else if (c_oSerSdt::Id == type)
{
pSdtPr->m_oId.Init();
pSdtPr->m_oId->m_oVal.Init();
pSdtPr->m_oId->m_oVal->SetValue(m_oBufferedStream.GetULong());
pSdtPr->m_oId->m_oVal = m_oBufferedStream.GetULong();
}
else if (c_oSerSdt::Label == type)
{
pSdtPr->m_oLabel.Init();
pSdtPr->m_oLabel->m_oVal.Init();
pSdtPr->m_oLabel->m_oVal->SetValue(m_oBufferedStream.GetULong());
pSdtPr->m_oLabel->m_oVal = m_oBufferedStream.GetULong();
}
else if (c_oSerSdt::Lock == type)
{
@ -8681,8 +8746,7 @@ int Binary_DocumentTableReader::ReadSdtPr(BYTE type, long length, void* poResult
{
pSdtPr->m_oPlaceHolder.Init();
pSdtPr->m_oPlaceHolder->m_oDocPart.Init();
pSdtPr->m_oPlaceHolder->m_oDocPart->m_sVal.Init();
pSdtPr->m_oPlaceHolder->m_oDocPart->m_sVal->append(m_oBufferedStream.GetString3(length));
pSdtPr->m_oPlaceHolder->m_oDocPart->m_sVal = m_oBufferedStream.GetString3(length);
}
else if (c_oSerSdt::RPr == type)
{
@ -8703,8 +8767,7 @@ int Binary_DocumentTableReader::ReadSdtPr(BYTE type, long length, void* poResult
else if (c_oSerSdt::Tag == type)
{
pSdtPr->m_oTag.Init();
pSdtPr->m_oTag->m_sVal.Init();
pSdtPr->m_oTag->m_sVal->append(m_oBufferedStream.GetString3(length));
pSdtPr->m_oTag->m_sVal = m_oBufferedStream.GetString3(length);
}
else if (c_oSerSdt::Temporary == type)
{
@ -8717,6 +8780,52 @@ int Binary_DocumentTableReader::ReadSdtPr(BYTE type, long length, void* poResult
pSdtPr->m_oText->m_oMultiLine.Init();
pSdtPr->m_oText->m_oMultiLine->FromBool(m_oBufferedStream.GetBool());
}
else if (c_oSerSdt::Checkbox == type)
{
pSdtPr->m_oCheckbox.Init();
READ1_DEF(length, res, this->ReadSdtCheckBox, pSdtPr->m_oCheckbox.GetPointer());
}
else
res = c_oSerConstants::ReadUnknown;
return res;
}
int Binary_DocumentTableReader::ReadSdtCheckBox(BYTE type, long length, void* poResult)
{
int res = 0;
OOX::Logic::CSdtCheckBox* pSdtCheckBox = static_cast<OOX::Logic::CSdtCheckBox*>(poResult);
if (c_oSerSdt::CheckboxChecked == type)
{
pSdtCheckBox->m_oChecked.Init();
pSdtCheckBox->m_oChecked->m_oVal.FromBool(m_oBufferedStream.GetBool());
}
else if (c_oSerSdt::CheckboxCheckedFont == type)
{
if(!pSdtCheckBox->m_oCheckedState.IsInit())
pSdtCheckBox->m_oCheckedState.Init();
pSdtCheckBox->m_oCheckedState->m_oFont.Init();
pSdtCheckBox->m_oCheckedState->m_oFont->append(m_oBufferedStream.GetString3(length));
}
else if (c_oSerSdt::CheckboxCheckedVal == type)
{
if(!pSdtCheckBox->m_oCheckedState.IsInit())
pSdtCheckBox->m_oCheckedState.Init();
pSdtCheckBox->m_oCheckedState->m_oVal.Init();
pSdtCheckBox->m_oCheckedState->m_oVal->SetValue(m_oBufferedStream.GetLong());
}
else if (c_oSerSdt::CheckboxUncheckedFont == type)
{
if(!pSdtCheckBox->m_oUncheckedState.IsInit())
pSdtCheckBox->m_oUncheckedState.Init();
pSdtCheckBox->m_oUncheckedState->m_oFont.Init();
pSdtCheckBox->m_oUncheckedState->m_oFont->append(m_oBufferedStream.GetString3(length));
}
else if (c_oSerSdt::CheckboxUncheckedVal == type)
{
if(!pSdtCheckBox->m_oUncheckedState.IsInit())
pSdtCheckBox->m_oUncheckedState.Init();
pSdtCheckBox->m_oUncheckedState->m_oVal.Init();
pSdtCheckBox->m_oUncheckedState->m_oVal->SetValue(m_oBufferedStream.GetLong());
}
else
res = c_oSerConstants::ReadUnknown;
return res;
@ -8745,13 +8854,11 @@ int Binary_DocumentTableReader::ReadSdtListItem(BYTE type, long length, void* po
ComplexTypes::Word::CSdtListItem* pSdtListItem = static_cast<ComplexTypes::Word::CSdtListItem*>(poResult);
if (c_oSerSdt::DisplayText == type)
{
pSdtListItem->m_sDisplayText.Init();
pSdtListItem->m_sDisplayText->append(m_oBufferedStream.GetString3(length));
pSdtListItem->m_sDisplayText = m_oBufferedStream.GetString3(length);
}
else if (c_oSerSdt::Value == type)
{
pSdtListItem->m_sValue.Init();
pSdtListItem->m_sValue->append(m_oBufferedStream.GetString3(length));
pSdtListItem->m_sValue = m_oBufferedStream.GetString3(length);
}
else
res = c_oSerConstants::ReadUnknown;
@ -8799,8 +8906,7 @@ int Binary_DocumentTableReader::ReadSdtPrDate(BYTE type, long length, void* poRe
else if (c_oSerSdt::DateFormat == type)
{
pDate->m_oDateFormat.Init();
pDate->m_oDateFormat->m_sVal.Init();
pDate->m_oDateFormat->m_sVal->append(m_oBufferedStream.GetString3(length));
pDate->m_oDateFormat->m_sVal = m_oBufferedStream.GetString3(length);
}
else if (c_oSerSdt::Lid == type)
{
@ -8825,14 +8931,12 @@ int Binary_DocumentTableReader::ReadDocPartList(BYTE type, long length, void* po
if (c_oSerSdt::DocPartCategory == type)
{
pDocPart->m_oDocPartCategory.Init();
pDocPart->m_oDocPartCategory->m_sVal.Init();
pDocPart->m_oDocPartCategory->m_sVal->append(m_oBufferedStream.GetString3(length));
pDocPart->m_oDocPartCategory->m_sVal = m_oBufferedStream.GetString3(length);
}
else if (c_oSerSdt::DocPartGallery == type)
{
pDocPart->m_oDocPartGallery.Init();
pDocPart->m_oDocPartGallery->m_sVal.Init();
pDocPart->m_oDocPartGallery->m_sVal->append(m_oBufferedStream.GetString3(length));
pDocPart->m_oDocPartGallery->m_sVal = m_oBufferedStream.GetString3(length);
}
else if (c_oSerSdt::DocPartUnique == type)
{
@ -8849,8 +8953,7 @@ int Binary_DocumentTableReader::ReadDropDownList(BYTE type, long length, void* p
OOX::Logic::CSdtDropDownList* pDropDownList = static_cast<OOX::Logic::CSdtDropDownList*>(poResult);
if (c_oSerSdt::LastValue == type)
{
pDropDownList->m_sLastValue.Init();
pDropDownList->m_sLastValue->append(m_oBufferedStream.GetString3(length));
pDropDownList->m_sLastValue = m_oBufferedStream.GetString3(length);
}
else if (c_oSerSdt::SdtListItem == type)
{
@ -8864,14 +8967,15 @@ int Binary_DocumentTableReader::ReadDropDownList(BYTE type, long length, void* p
}
Binary_NotesTableReader::Binary_NotesTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, CComments* pComments, bool bIsFootnote):
Binary_CommonReader(poBufferedStream),m_oFileWriter(oFileWriter),m_pComments(pComments),m_bIsFootnote(bIsFootnote)
Binary_NotesTableReader::Binary_NotesTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, CComments* pComments, bool bIsFootnote)
: Binary_CommonReader(poBufferedStream), m_oFileWriter(oFileWriter), m_pComments(pComments), m_bIsFootnote(bIsFootnote)
{
}
int Binary_NotesTableReader::Read()
{
m_oFileWriter.m_pDrawingConverter->SetDstContentRels();
std::wstring sFilename;
std::wstring sFilename;
Writers::ContentWriter* pContentWriter = NULL;
if(m_bIsFootnote)
{
@ -8973,7 +9077,18 @@ BinaryFileReader::BinaryFileReader(std::wstring& sFileInDir, NSBinPptxRW::CBinar
}
int BinaryFileReader::ReadFile()
{
return ReadMainTable();
long res = c_oSerConstants::ReadOk;
try
{
res = ReadMainTable();
}
catch(...)
{
res = c_oSerConstants::ErrorStream;
}
return res;
}
int BinaryFileReader::ReadMainTable()
{

View File

@ -152,9 +152,7 @@ protected:
Binary_pPrReader oBinary_pPrReader;
Binary_CommonReader2 oBinary_CommonReader2;
public:
std::wstring m_sCurTableShd;
std::vector<double> m_aCurTblGrid;
bool bCellShd;
public:
Binary_tblPrReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter);
int Read_tblPr(BYTE type, long length, void* poResult);
@ -228,12 +226,14 @@ public:
class Binary_CommentsTableReader : public Binary_CommonReader
{
public:
CComments m_oComments;
public:
CComments m_oComments;
Writers::FileWriter& m_oFileWriter;
Binary_CommentsTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter);
int Read();
int ReadComments(BYTE type, long length, void* poResult);
int ReadCommentContent(BYTE type, long length, void* poResult);
int ReadCommentContentExt(BYTE type, long length, void* poResult);
int ReadReplies(BYTE type, long length, void* poResult);
};
class Binary_SettingsTableReader : public Binary_CommonReader
@ -281,18 +281,21 @@ private:
Binary_pPrReader oBinary_pPrReader;
Binary_rPrReader oBinary_rPrReader;
Binary_tblPrReader oBinary_tblPrReader;
NSStringUtils::CStringBuilder* m_pCurWriter;
NSStringUtils::CStringBuilder* m_pCurWriter;
rPr m_oCur_rPr;
rPr m_oMath_rPr;
NSStringUtils::CStringBuilder m_oCur_pPr;
NSStringUtils::CStringBuilder m_oCur_pPr;
BYTE m_byteLastElemType;
CComments* m_pComments;
public:
CComments* m_pComments;
Writers::ContentWriter& m_oDocumentWriter;
Writers::MediaWriter& m_oMediaWriter;
bool m_bUsedParaIdCounter;
Binary_DocumentTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, Writers::ContentWriter& oDocumentWriter, CComments* pComments);
~Binary_DocumentTableReader();
int Read();
NSStringUtils::CStringBuilder& GetRunStringWriter();
int ReadDocumentContentOut(long length);
@ -456,6 +459,7 @@ public:
int Read_SecPr(BYTE type, long length, void* poResult);
int ReadSdt(BYTE type, long length, void* poResult);
int ReadSdtPr(BYTE type, long length, void* poResult);
int ReadSdtCheckBox(BYTE type, long length, void* poResult);
int ReadSdtComboBox(BYTE type, long length, void* poResult);
int ReadSdtListItem(BYTE type, long length, void* poResult);
int ReadSdtPrDataBinding(BYTE type, long length, void* poResult);

View File

@ -36,9 +36,6 @@ namespace BinDocxRW
{
const double eps = 0.001;
const int shd_Clear = 0;
const int shd_Nil = 1;
const int g_tabtype_left = 0;
const int g_tabtype_right = 1;
const int g_tabtype_center = 2;
@ -173,7 +170,7 @@ extern int g_nCurFormatVersion;
AbstractNum_Lvls = 4,
Lvl = 5,
lvl_Format = 6,//deprecated (instead use lvl_NumFmt)
lvl_Jc = 7,
lvl_Jc_deprecated = 7,//deprecated
lvl_LvlText = 8,
lvl_LvlTextItem = 9,
lvl_LvlTextItemText = 10,
@ -202,7 +199,8 @@ extern int g_nCurFormatVersion;
LvlLegacy = 33,
Legacy = 34,
LegacyIndent = 35,
LegacySpace = 36
LegacySpace = 36,
lvl_Jc = 37
};}
namespace c_oSerOtherTableTypes{enum c_oSerOtherTableTypes
{
@ -345,7 +343,7 @@ extern int g_nCurFormatVersion;
Tab = 17,
Tab_Item = 18,
Tab_Item_Pos = 19,
Tab_Item_Val = 20,
Tab_Item_Val_deprecated = 20,
ParaStyle = 21,
numPr = 22,
numPr_lvl = 23,
@ -367,7 +365,8 @@ extern int g_nCurFormatVersion;
Spacing_LineTwips = 39,
Spacing_BeforeTwips = 40,
Spacing_AfterTwips = 41,
Tab_Item_PosTwips = 42
Tab_Item_PosTwips = 42,
Tab_Item_Val = 43
};}
namespace c_oSerProp_rPrType{enum c_oSerProp_rPrType
{
@ -806,7 +805,8 @@ extern int g_nCurFormatVersion;
Replies = 9,
OOData = 10,
DurableId = 11,
ProviderId = 12
ProviderId = 12,
CommentContent = 13
};}
namespace c_oSer_SettingsType{enum c_oSer_SettingsType
{
@ -1169,7 +1169,13 @@ extern int g_nCurFormatVersion;
Temporary = 34,
MultiLine = 35,
Appearance = 36,
Color = 37
Color = 37,
Checkbox = 38,
CheckboxChecked = 39,
CheckboxCheckedFont = 40,
CheckboxCheckedVal = 41,
CheckboxUncheckedFont = 42,
CheckboxUncheckedVal = 43
};}
namespace c_oSerFFData{enum c_oSerFFData
{

File diff suppressed because it is too large Load Diff

View File

@ -35,16 +35,14 @@
#include "BinReaderWriterDefines.h"
#include "../../Common/DocxFormat/Source/DocxFormat/DocxFlat.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Docx.h"
#include "../../Common/DocxFormat/Source/MathEquation/MathEquation.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Document.h"
#include "../../Common/DocxFormat/Source/DocxFormat/FontTable.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Numbering.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Comments.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Styles.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Footnote.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Endnote.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Settings/Settings.h"
#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/VbaProject.h"
@ -76,24 +74,42 @@ namespace BinDocxRW
NSBinPptxRW::CDrawingConverter* m_pOfficeDrawingConverter;
NSFontCutter::CEmbeddedFontsManager* m_pEmbeddedFontsManager;
OOX::CSettings* m_oSettings;
PPTX::Theme* m_poTheme;
OOX::Document* m_pMain;
OOX::CSettings* m_pSettings;
PPTX::Theme* m_pTheme;
OOX::CStyles* m_pStyles;
OOX::CNumbering* m_pNumbering;
bool m_bLocalStyles;
bool m_bLocalNumbering;
OOX::CStyles* m_pEmbeddedStyles;
OOX::CNumbering* m_pEmbeddedNumbering;
OOX::IFileContainer* m_pCurRels;
std::map<int, bool> m_mapIgnoreComments;
ParamsWriter(NSBinPptxRW::CBinaryFileWriter* pCBufferedStream, DocWrapper::FontProcessor* pFontProcessor, NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager):
m_pCBufferedStream(pCBufferedStream),m_pFontProcessor(pFontProcessor),m_pOfficeDrawingConverter(pOfficeDrawingConverter),m_pEmbeddedFontsManager(pEmbeddedFontsManager)
m_pCBufferedStream(pCBufferedStream), m_pFontProcessor(pFontProcessor), m_pOfficeDrawingConverter(pOfficeDrawingConverter), m_pEmbeddedFontsManager(pEmbeddedFontsManager)
{
m_oSettings = NULL;
m_poTheme = NULL;
m_pMain = NULL;
m_pSettings = NULL;
m_pTheme = NULL;
m_pCurRels = NULL;
m_pStyles = NULL;
m_pNumbering = NULL;
m_pEmbeddedStyles = NULL;
m_pEmbeddedNumbering = NULL;
m_bLocalStyles = m_bLocalNumbering = false;
}
};
class ParamsDocumentWriter
{
public:
OOX::IFileContainer* m_pRels;
OOX::IFileContainer* m_pRels;
ParamsDocumentWriter(OOX::IFileContainer* pRels) : m_pRels(pRels)
{
@ -129,22 +145,20 @@ namespace BinDocxRW
class BinaryHeaderFooterTableWriter
{
BinaryCommonWriter m_oBcw;
ParamsWriter& m_oParamsWriter;
OOX::CSettings* m_oSettings;
PPTX::Theme* m_poTheme;
DocWrapper::FontProcessor& m_oFontProcessor;
NSBinPptxRW::CDrawingConverter* m_pOfficeDrawingConverter;
std::map<int, bool>* m_mapIgnoreComments;
public:
OOX::IFileContainer* m_oDocumentRels;
std::vector<OOX::CHdrFtr*> m_aHeaders;
std::vector<SimpleTypes::EHdrFtr> m_aHeaderTypes;
std::vector<OOX::Logic::CSectionProperty*> m_aHeaderSectPrs;
std::vector<OOX::CHdrFtr*> m_aFooters;
std::vector<SimpleTypes::EHdrFtr> m_aFooterTypes;
std::vector<OOX::Logic::CSectionProperty*> m_aFooterSectPrs;
public:
ParamsWriter& m_oParamsWriter;
OOX::IFileContainer* m_oDocumentRels;
std::vector<OOX::CHdrFtr*> m_aHeaders;
std::vector<SimpleTypes::EHdrFtr> m_aHeaderTypes;
std::vector<OOX::Logic::CSectionProperty*> m_aHeaderSectPrs;
std::vector<OOX::CHdrFtr*> m_aFooters;
std::vector<SimpleTypes::EHdrFtr> m_aFooterTypes;
std::vector<OOX::Logic::CSectionProperty*> m_aFooterSectPrs;
BinaryHeaderFooterTableWriter(ParamsWriter& oParamsWriter, OOX::IFileContainer* oDocumentRel, std::map<int, bool>* mapIgnoreComments);
void Write();
void WriteHdrFtrContent(std::vector<OOX::CHdrFtr*>& aHdrFtrs, std::vector<SimpleTypes::EHdrFtr>& aHdrFtrTypes, std::vector<OOX::Logic::CSectionProperty*>& aHdrSectPrs, bool bHdr);
@ -161,7 +175,7 @@ namespace BinDocxRW
{
BinaryCommonWriter m_oBcw;
public:
PPTX::Theme* m_poTheme;
PPTX::Theme* m_pTheme;
NSBinPptxRW::CDrawingConverter* m_pOfficeDrawingConverter;
DocWrapper::FontProcessor& m_oFontProcessor;
@ -173,7 +187,8 @@ namespace BinDocxRW
{
BinaryCommonWriter m_oBcw;
Binary_rPrWriter brPrs;
OOX::CSettings* m_oSettings;
ParamsWriter& m_oParamsWriter;
public:
BinaryHeaderFooterTableWriter* m_oBinaryHeaderFooterTableWriter;
@ -201,6 +216,9 @@ namespace BinDocxRW
const nullable<ComplexTypes::Word::CDecimalNumber>& numStart, nullable<ComplexTypes::Word::CFtnPos>* ftnPos,
nullable<ComplexTypes::Word::CEdnPos>* endPos, std::vector<OOX::CFtnEdnSepRef*>* refs);
void WriteNumFmt(const ComplexTypes::Word::CNumFmt& oNumFmt);
private:
std::wstring AddEmbeddedStyle(const std::wstring & styleId);
};
class Binary_tblPrWriter
{
@ -291,19 +309,19 @@ namespace BinDocxRW
{
private:
ParamsWriter& m_oParamsWriter;
ParamsDocumentWriter& m_oParamsDocumentWriter;
BinaryCommonWriter m_oBcw;
Binary_pPrWriter bpPrs;
Binary_rPrWriter brPrs;
std::wstring m_sCurParStyle;
OOX::CSettings* m_oSettings;
NSBinPptxRW::CDrawingConverter* m_pOfficeDrawingConverter;
std::map<int, bool>* m_mapIgnoreComments;
public:
Binary_tblPrWriter btblPrs;
OOX::Logic::CSectionProperty* pSectPr;
OOX::Logic::CBackground * pBackground;
OOX::WritingElement* pBackground;
OOX::CDocument* poDocument;
OOX::JsaProject* pJsaProject;
@ -315,7 +333,7 @@ namespace BinDocxRW
void WriteVbaProject(OOX::VbaProject& oVbaProject);
void Write(std::vector<OOX::WritingElement*> & aElems);
void WriteDocumentContent(const std::vector<OOX::WritingElement*> & aElems);
void WriteBackground (OOX::Logic::CBackground* pBackground);
void WriteBackground (OOX::WritingElement* pBackground);
void WriteParapraph(OOX::Logic::CParagraph& par, OOX::Logic::CParagraphProperty* pPr);
void WriteParagraphContent(const std::vector<OOX::WritingElement*> & content, bool bHyperlink = false);
void WriteDel(const OOX::Logic::CDel& oDel);
@ -439,7 +457,7 @@ namespace BinDocxRW
void WriteRunContent(std::vector<OOX::WritingElement*>::iterator &start, std::vector<OOX::WritingElement*>::iterator &end, bool bHyperlink = false);
void WriteNoteRef(const nullable<SimpleTypes::COnOff<>>& oCustomMarkFollows, const nullable<SimpleTypes::CDecimalNumber<>>& oId);
void WriteText(const std::wstring& text, BYTE type);
void WriteDrawingPptx(OOX::WritingElement* item);
bool WriteDrawingPptx(OOX::WritingElement* item);
void WriteDrawing(std::wstring* pXml, OOX::Logic::CDrawing* pDrawing, PPTX::Logic::GraphicFrame *pGraphic);
void WriteNvGraphicFramePr(const PPTX::Logic::NvGraphicFramePr& oGraphicFramePr);
void WriteDocPr(const PPTX::Logic::CNvPr& oDocPr);
@ -469,6 +487,7 @@ namespace BinDocxRW
void WriteCell(OOX::Logic::CTc& tc, OOX::Logic::CTableProperty* pTblPr, int nCurRowIndex, int nCurColIndex, int nRows, int nCols);
void WriteSdt(OOX::Logic::CSdt* pStd, int type, OOX::Logic::CTableProperty* pTblPr, int nCurRowIndex, int nRows, int nCols);
void WriteSdtPr(const OOX::Logic::CSdtPr& oStdPr);
void WriteSdtCheckBox(const OOX::Logic::CSdtCheckBox& oSdtCheckBox);
void WriteSdtComboBox(const OOX::Logic::CSdtComboBox& oSdtComboBox);
void WriteSdtListItem(const ComplexTypes::Word::CSdtListItem& oSdtListItem);
void WriteSdtPrDataBinding(const ComplexTypes::Word::CDataBinding& oDataBinding);
@ -488,12 +507,14 @@ namespace BinDocxRW
std::vector<CCommentWriteTemp*> aReplies;
};
BinaryCommonWriter m_oBcw;
ParamsWriter& m_oParamsWriter;
NSBinPptxRW::CDrawingConverter* m_pOfficeDrawingConverter;
public:
BinaryCommentsTableWriter(ParamsWriter& oParamsWriter);
void Write(OOX::CComments& oComments, OOX::CCommentsExt* pCommentsExt, OOX::CPeople* pPeople, OOX::CCommentsIds* pCommentsIds, std::map<int, bool>& mapIgnoreComments);
void WriteCommentsContent(OOX::CComments& oComments, OOX::CCommentsExt* pCommentsExt, OOX::CPeople* pPeople, OOX::CCommentsIds* pCommentsIds, std::map<int, bool>& mapIgnoreComments);
void WriteComment(CCommentWriteTemp& oComment);
void WriteReplies(std::vector<CCommentWriteTemp*>& aCommentWriteTemp);
void WriteCommentsContent(OOX::CComments& oComments, OOX::CCommentsExt* pCommentsExt, OOX::CPeople* pPeople, OOX::CCommentsIds* pCommentsIds, std::map<int, bool>& mapIgnoreComments, ParamsDocumentWriter& oParamsDocumentWriter);
void WriteComment(CCommentWriteTemp& oComment, BinaryDocumentTableWriter & oBinaryDocumentTableWriter);
void WriteReplies(std::vector<CCommentWriteTemp*>& aCommentWriteTemp, BinaryDocumentTableWriter & oBinaryDocumentTableWriter);
};
class BinarySettingsTableWriter
{

View File

@ -163,8 +163,7 @@ namespace BinXlsxRW{
toXlsxSheetdata(pWorksheet, *it->second, aSharedStrings);
OOX::Spreadsheet::CSheet* pSheet = new OOX::Spreadsheet::CSheet();
pSheet->m_oName.Init();
pSheet->m_oName->append(sSheetName);
pSheet->m_oName = sSheetName;
pSheet->m_oSheetId.Init();
pSheet->m_oSheetId->SetValue(nSheetId++);
@ -212,8 +211,7 @@ namespace BinXlsxRW{
for (boost::unordered_map<std::wstring, int>::iterator it = m_mapFormats.begin(); it != m_mapFormats.end(); ++it)
{
OOX::Spreadsheet::CNumFmt* pNumFmt = new OOX::Spreadsheet::CNumFmt();
pNumFmt->m_oFormatCode.Init();
pNumFmt->m_oFormatCode->append(it->first);
pNumFmt->m_oFormatCode = (it->first);
pNumFmt->m_oNumFmtId.Init();
pNumFmt->m_oNumFmtId->SetValue(NUMID_START + it->second);
oXlsx.m_pStyles->m_oNumFmts->m_arrItems.push_back(pNumFmt);

View File

@ -64,7 +64,7 @@ BinDocxRW::CDocxSerializer::~CDocxSerializer()
RELEASEOBJECT(m_pParamsWriter);
RELEASEOBJECT(m_pCurFileWriter);
}
bool BinDocxRW::CDocxSerializer::saveToFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions)
bool BinDocxRW::CDocxSerializer::saveToFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sTempPath)
{
OOX::CPath pathMain(sSrcFileName);
@ -105,6 +105,7 @@ bool BinDocxRW::CDocxSerializer::saveToFile(const std::wstring& sSrcFileName, co
oDrawingConverter.SetDstPath(pathMain.GetDirectory() + FILE_SEPARATOR_STR + L"word");
oDrawingConverter.SetMediaDstPath(pathMedia.GetPath());
oDrawingConverter.SetTempPath(sTempPath);
m_pParamsWriter = new ParamsWriter(&oBufferedStream, &fp, &oDrawingConverter, pEmbeddedFontsManager);
@ -201,7 +202,8 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
bool bValidFormat = false;
std::wstring sSignature(g_sFormatSignature);
int nSigLength = (int)sSignature.length();
if((int)nBase64DataSize > nSigLength)
if ((int)nBase64DataSize > nSigLength)
{
std::string sCurSig((char*)pBase64Data, nSigLength);
if(sSignature == std::wstring(sCurSig.begin(), sCurSig.end()))
@ -216,7 +218,8 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
int nType = 0;
std::string version = "";
std::string dst_len = "";
while (true)
while (nIndex < nBase64DataSize)
{
nIndex++;
BYTE _c = pBase64Data[nIndex];

View File

@ -63,7 +63,7 @@ namespace BinDocxRW
virtual ~CDocxSerializer();
bool loadFromFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sThemePath, const std::wstring& sMediaPath, const std::wstring& sEmbedPath);
bool saveToFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions);
bool saveToFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sTempPath);
bool CreateDocxFolders(std::wstring strDirectory, std::wstring& sThemePath, std::wstring& sMediaPath, std::wstring& sEmbedPath);

View File

@ -174,8 +174,15 @@ namespace BinXlsxRW{
BinXlsxRW::SaveParams oSaveParams(sDrawingsPath, sThemePath, m_pExternalDrawingConverter->GetContentTypes());
OOX::Spreadsheet::CChartSpace oChartSpace(NULL);
BinXlsxRW::BinaryChartReader oBinaryChartReader(*pReader, oSaveParams, m_pExternalDrawingConverter);
oBinaryChartReader.ReadCT_ChartSpace(lLength, &oChartSpace);
try
{
oBinaryChartReader.ReadCT_ChartSpace(lLength, &oChartSpace);
}
catch(...)
{
//todooo
}
if(oChartSpace.isValid())
{

View File

@ -38,7 +38,8 @@ SOURCES += \
../../OfficeCryptReader/source/ECMACryptFile.cpp \
../../OfficeCryptReader/source/CryptTransform.cpp \
../BinReader/Readers.cpp \
../BinReader/CustormXmlWriter.cpp
../BinReader/CustormXmlWriter.cpp \
../BinReader/FileWriter.cpp
HEADERS += ../DocWrapper/DocxSerializer.h \
../DocWrapper/FontProcessor.h \

View File

@ -615,10 +615,8 @@ namespace formulasconvert {
cells_out.append(cells[j]);
cells_out.append(L":");
}
size_t res1 = sheet.find(L"-");
size_t res2 = sheet.find(L"'");
if (res1 != std::wstring::npos && res2 != std::wstring::npos && !(res2 == 0))
if (sheet.find(L"-") != std::wstring::npos && sheet.find(L"'") == std::wstring::npos && sheet.find(L"\"") == std::wstring::npos)
{
sheet = L"'" + sheet + L"'";
}

View File

@ -148,7 +148,7 @@ public:
{
case 'M':
{
if ((pos + 5 < size) && (expr.substr(pos, 5) == L"MINYS"))
if ((pos + 5 <= size) && (expr.substr(pos, 5) == L"MINYS"))
{
result += L"-"; pos += 5;
}
@ -159,7 +159,7 @@ public:
}break;
case 'T':
{
if ((pos + 6 < size) && (expr.substr(pos, 6) == L"ТОСHKA"))
if ((pos + 6 <= size) && (expr.substr(pos, 6) == L"ТОСHKA"))
{
result += L"."; pos += 6;
}
@ -170,7 +170,7 @@ public:
}break;
case 'V':
{
if ((pos + 5 < size) && (expr.substr(pos, 5) == L"VOSKL"))
if ((pos + 5 <= size) && (expr.substr(pos, 5) == L"VOSKL"))
{
result += L"!"; pos += 5;
}
@ -181,11 +181,11 @@ public:
}break;
case 'S':
{
if ((pos + 8 < size) && (expr.substr(pos, 8) == L"SCOBCAIN"))
if ((pos + 8 <= size) && (expr.substr(pos, 8) == L"SCOBCAIN"))
{
result += L"("; pos += 8;
}
else if ((pos + 9 < size) && (expr.substr(pos, 9) == L"SCOBCAOUT"))
else if ((pos + 9 <= size) && (expr.substr(pos, 9) == L"SCOBCAOUT"))
{
result += L")"; pos += 9;
}
@ -196,15 +196,15 @@ public:
}break;
case 'K':
{
if ((pos + 9 < size) && (expr.substr(pos, 9) == L"KVADRATIN"))
if ((pos + 9 <= size) && (expr.substr(pos, 9) == L"KVADRATIN"))
{
result += L"["; pos += 9;
}
else if ((pos + 10 < size) && (expr.substr(pos, 10) == L"KVADRATOUT"))
else if ((pos + 10 <= size) && (expr.substr(pos, 10) == L"KVADRATOUT"))
{
result += L"]"; pos += 10;
}
else if ((pos + 8 < size) && (expr.substr(pos, 8) == L"KAVYCHKA"))
else if ((pos + 8 <= size) && (expr.substr(pos, 8) == L"KAVYCHKA"))
{
result += L"\""; pos += 8;
}
@ -215,7 +215,7 @@ public:
}break;
case 'P':
{
if ((pos + 6 < size) && (expr.substr(pos, 6) == L"PROBEL"))
if ((pos + 6 <= size) && (expr.substr(pos, 6) == L"PROBEL"))
{
result += L" "; pos += 6;
}
@ -226,7 +226,7 @@ public:
}break;
case 'A':
{
if ((pos + 8 < size) && (expr.substr(pos, 8) == L"APOSTROF"))
if ((pos + 8 <= size) && (expr.substr(pos, 8) == L"APOSTROF"))
{
result += L"'"; pos += 8;
}
@ -385,6 +385,78 @@ void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr, bool bSele
return;
}
size_t getColAddressInv(const std::wstring & a_)
{
std::wstring a = a_;
::boost::algorithm::to_upper(a);
static const size_t r = (L'Z' - L'A' + 1);
size_t mul = 1;
bool f = true;
size_t res = 0;
for (int i = a.length() - 1; i >= 0; i--)
{
size_t v = a[i] - L'A';
if (f)
f = false;
else
v += 1;
res += v * mul;
mul *= r;
}
return res;
}
size_t getRowAdderssInv(const std::wstring & a_)
{
int sz = a_.length();
if (a_.length()>0)
{
return boost::lexical_cast<size_t>(a_)-1;
}
else
return 0;
}
void splitCellAddress(const std::wstring & a_, std::wstring & col, std::wstring & row)
{
std::wstring a = a_;
std::reverse(a.begin(), a.end());
::XmlUtils::replace_all( a, L"$", L"");
//::XmlUtils::replace_all( a, L"'", L"");
::boost::algorithm::to_upper(a);
for (size_t i = 0; i < a.length(); i++)
{
if (a[i] >= L'0' && a[i] <= L'9')
row += a[i];
else
col += a[i];
}
std::reverse(col.begin(), col.end());
std::reverse(row.begin(), row.end());
}
void getCellAddressInv(const std::wstring & a_, int & col, int & row)
{
std::wstring colStr=L"", rowStr=L"";
splitCellAddress(a_, colStr, rowStr);
col = getColAddressInv(colStr);
row = getRowAdderssInv(rowStr);
if (col > 16384) col= -1;
}
bool IsRefPresent(const std::wstring& ref_test)
{
int col = -1, row = -1;
getCellAddressInv(ref_test, col, row);
if (col >= 0 && row >=0) return true;
return false;
}
std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmatch const & what)
{
const size_t sz = what.size();
@ -413,8 +485,21 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmat
if (!c2.empty() && c2.substr(0, 1) == L":")
c2 = c2.substr(1);
s = L"[" + sheet + L"." + c1 + (c2.empty() ? L"" : (L":" + sheet + L"." + c2)) + std::wstring(L"]");
bool bRefPresent = true;
if (sheet.empty() && c2.empty())
{
bRefPresent = IsRefPresent(c1);
}
if (bRefPresent)
{
s = L"[" + sheet + L"." + c1 + (c2.empty() ? L"" : (L":" + sheet + L"." + c2)) + std::wstring(L"]");
}
else
{
s = c1;
}
}
return s;
}
@ -856,67 +941,6 @@ std::wstring oox2odf_converter::convert_spacechar(std::wstring expr)
}
return expr;
}
size_t getColAddressInv(const std::wstring & a_)
{
std::wstring a = a_;
::boost::algorithm::to_upper(a);
static const size_t r = (L'Z' - L'A' + 1);
size_t mul = 1;
bool f = true;
size_t res = 0;
for (int i = a.length() - 1; i >= 0; i--)
{
size_t v = a[i] - L'A';
if (f)
f = false;
else
v += 1;
res += v * mul;
mul *= r;
}
return res;
}
size_t getRowAdderssInv(const std::wstring & a_)
{
int sz = a_.length();
if (a_.length()>0)
{
return boost::lexical_cast<size_t>(a_)-1;
}
else
return 0;
}
void splitCellAddress(const std::wstring & a_, std::wstring & col, std::wstring & row)
{
std::wstring a = a_;
std::reverse(a.begin(), a.end());
::XmlUtils::replace_all( a, L"$", L"");
//::XmlUtils::replace_all( a, L"'", L"");
::boost::algorithm::to_upper(a);
for (size_t i = 0; i < a.length(); i++)
{
if (a[i] >= L'0' && a[i] <= L'9')
row += a[i];
else
col += a[i];
}
std::reverse(col.begin(), col.end());
std::reverse(row.begin(), row.end());
}
void getCellAddressInv(const std::wstring & a_, int & col, int & row)
{
std::wstring colStr=L"", rowStr=L"";
splitCellAddress(a_, colStr, rowStr);
col = getColAddressInv(colStr);
row = getRowAdderssInv(rowStr);
}
int oox2odf_converter::get_count_value_points(std::wstring expr)
{
int count =0;

View File

@ -238,6 +238,9 @@ enum ElementType
typeStyleListLevelProperties,
typeStyleListLevelLabelAlignment,
typeTextOutlineStyle,
typeTextOutlineLevelStyle,
typeStyleTabStop,
typeStyleTabStops,
typeStyleDropCap,
@ -257,6 +260,9 @@ enum ElementType
typeStyleFooterLeft,
typeStyleFootnoteSep,
typeLoextHeaderFirst,
typeLoextFooterFirst,
typeStyleSectionProperties,
typeStyleHeaderStyle,
typeStyleFooterStyle,
@ -595,6 +601,7 @@ enum ElementType
typeChartStockRangeLine,
typeChartRegressionCurve,
typeChartEquation,
typeChartDateScale,
typeStyleChartProperties,

View File

@ -216,6 +216,8 @@ SOURCES += \
../src/odf/datatypes/dategroup.cpp \
../src/odf/datatypes/bibliography.cpp \
../src/odf/datatypes/commandtype.cpp \
../src/odf/datatypes/styleprint.cpp \
../src/odf/datatypes/charttimeunit.cpp \
../src/docx/xlsx_conditionalFormatting.cpp \
../src/docx/xlsx_dxfs.cpp \
../src/docx/docx_content_type.cpp \
@ -476,6 +478,8 @@ HEADERS += \
../src/odf/datatypes/xlink.h \
../src/odf/datatypes/chartlabelposition.h \
../src/odf/datatypes/grandtotal.h \
../src/odf/datatypes/styleprint.h \
../src/odf/datatypes/charttimeunit.h \
../src/docx/docx_content_type.h \
../src/docx/docx_conversion_context.h \
../src/docx/docx_conversion_state.h \

View File

@ -130,3 +130,5 @@
#include "../src/odf/datatypes/commandtype.cpp"
#include "../src/odf/datatypes/stylenumformat.cpp"
#include "../src/odf/datatypes/bibliography.cpp"
#include "../src/odf/datatypes/styleprint.cpp"
#include "../src/odf/datatypes/charttimeunit.cpp"

View File

@ -198,7 +198,30 @@ std::wstring styles_map::name(const std::wstring & Name, odf_types::style_family
}
void docx_conversion_context::add_element_to_run(std::wstring parenStyleId)
{
if (!state_.in_run_)
if(false == current_process_comment_)
{
for (size_t i = 0; i < get_comments_context().ref_start_.size(); i++)
{
output_stream() << L"<w:commentRangeStart w:id=\"" << get_comments_context().ref_start_[i] << L"\"/>";
}
get_comments_context().ref_start_.clear();
if (false == get_comments_context().ref_end_.empty())
{
for (size_t i = 0; i < get_comments_context().ref_end_.size(); i++)
{
output_stream()<< L"<w:commentRangeEnd w:id=\"" << get_comments_context().ref_end_[i] << L"\"/>";
}
for (size_t i = 0; i < get_comments_context().ref_end_.size(); i++)
{
output_stream()<< L"<w:commentReference w:id=\"" << get_comments_context().ref_end_[i] << L"\"/>";
}
get_comments_context().ref_end_.clear();
}
}
if (!state_.in_run_)
{
state_.in_run_ = true;
output_stream() << L"<w:r>";
@ -241,6 +264,20 @@ void docx_conversion_context::finish_paragraph()
{
end_changes();
if (false == current_process_comment_ && false == get_comments_context().ref_end_.empty())
{
for (size_t i = 0; i < get_comments_context().ref_end_.size(); i++)
{
output_stream()<< L"<w:commentRangeEnd w:id=\"" << get_comments_context().ref_end_[i] << L"\"/>";
}
for (size_t i = 0; i < get_comments_context().ref_end_.size(); i++)
{
output_stream()<< L"<w:commentReference w:id=\"" << get_comments_context().ref_end_[i] << L"\"/>";
}
get_comments_context().ref_end_.clear();
}
output_stream() << L"</w:p>";
}
@ -254,23 +291,17 @@ void docx_conversion_context::finish_run()
{
if (false == state_.in_run_) return;
if (get_comments_context().state() == 4)
if (false == current_process_comment_)
{
output_stream()<< L"<w:commentReference w:id=\"" << get_comments_context().current_id() << L"\"/>";
get_comments_context().state(0);
for (size_t i = 0; i < get_comments_context().ref_.size(); i++)
{
output_stream()<< L"<w:commentReference w:id=\"" << get_comments_context().ref_[i] << L"\"/>";
}
get_comments_context().ref_.clear();
}
output_stream() << L"</w:r>";
state_.in_run_ = false;
if (get_comments_context().state() == 2)
{
output_stream()<< L"<w:commentRangeEnd w:id=\"" << get_comments_context().current_id() << L"\"/>";
add_element_to_run();
output_stream()<< L"<w:commentReference w:id=\"" << get_comments_context().current_id() << L"\"/>";
get_comments_context().state(0);
finish_run();
}
}
void docx_conversion_context::start_math_formula()
{
@ -609,34 +640,36 @@ void docx_conversion_context::back_context_state()
void docx_conversion_context::add_new_run(std::wstring parentStyleId)
{
finish_run();
if (get_comments_context().state() == 1 ||
get_comments_context().state() == 4)//??? comment in run
{
output_stream() << L"<w:commentRangeStart w:id=\"" << get_comments_context().current_id() << L"\" />";
get_comments_context().state(2);//active
}
add_element_to_run(parentStyleId);
}
std::wstring docx_conversion_context::add_hyperlink(const std::wstring & href, bool draw)
{
hyperlinks::_type_place type = hyperlinks::document_place;
if (current_process_comment_ == true) type = hyperlinks::comment_place;
else if (current_process_note_ == footNote || current_process_note_ == footNoteRefSet) type = hyperlinks::footnote_place;
else if (current_process_note_ == endNote || current_process_note_ == endNoteRefSet ) type = hyperlinks::endnote_place;
oox::_rels_type_place type_place = get_type_place();
std::wstring href_correct = xml::utils::replace_text_to_xml(href);
XmlUtils::replace_all( href_correct, L" .", L".");//1 (130).odt
return hyperlinks_.add(href_correct, type, draw);
return hyperlinks_.add(href_correct, type_place, draw);
}
hyperlinks::_ref docx_conversion_context::last_hyperlink()
{
return hyperlinks_.last();
}
_rels_type_place docx_conversion_context::get_type_place()
{
if (current_process_comment_) return oox::comment_place;
if (current_process_note_ == footNote ||
current_process_note_ == footNoteRefSet) return oox::footnote_place;
if (current_process_note_ == endNote ||
current_process_note_ == endNoteRefSet ) return oox::endnote_place;
if (process_headers_footers_) return oox::header_footer_place;
void docx_conversion_context::dump_hyperlinks(rels & Rels, hyperlinks::_type_place type)
return oox::document_place;
}
void docx_conversion_context::dump_hyperlinks(rels & Rels, _rels_type_place type)
{
hyperlinks_.dump_rels(Rels, type);
}
@ -702,9 +735,12 @@ void docx_conversion_context::end_document()
////////////////////////////////////////////////////////////////////////////
dump_bibliography();
dump_hyperlinks (notes_context_.footnotesRels(), hyperlinks::footnote_place);
dump_hyperlinks (notes_context_.endnotesRels(), hyperlinks::endnote_place);
dump_hyperlinks (notes_context_.footnotesRels(), oox::footnote_place);
dump_hyperlinks (notes_context_.endnotesRels(), oox::endnote_place);
get_mediaitems()->dump_rels(notes_context_.footnotesRels(), oox::footnote_place);
get_mediaitems()->dump_rels(notes_context_.endnotesRels(), oox::endnote_place);
output_document_->get_word_files().set_notes(notes_context_);
////////////////////////
for (size_t i = 0; i < charts_.size(); i++)
@ -872,21 +908,25 @@ namespace
}
}
std::wstring StyleDisplayName(const std::wstring & Name, const std::wstring & DisplayName, odf_types::style_family::type Type)
std::wstring StyleDisplayName(const std::wstring & Name, const std::wstring & DisplayName, odf_types::style_family::type Type, bool &bDisplayed)
{
if (!DisplayName.empty())
bDisplayed = true;
if (false == DisplayName.empty())
return DisplayName;
if (!Name.empty())
if (false == Name.empty())
{
bDisplayed = false;
return Name;
}
else
{
switch(Type)
{
case odf_types::style_family::Paragraph:
return L"Normal";
break;
default:
bDisplayed = false;
return std::wstring(L"DStyle_") + boost::lexical_cast<std::wstring>(odf_types::style_family( Type) );
}
}
@ -928,28 +968,44 @@ mc:Ignorable=\"w14 wp14\">";
std::vector<int> numIds;
odf_reader::list_style_container::instances_array & arListStyles = list_styles.instances();
for (size_t i = 0; i < arListStyles.size(); i++)
{
odf_reader::office_element_ptr_array & content = arListStyles[i]->get_text_list_style()->get_content();
{
odf_reader::office_element_ptr_array & content = arListStyles[i]->get_text_list_style()->content_;
if (content.size() < 1)
if (content.empty())
continue;
const int abstractNumId = list_styles.id_by_name(arListStyles[i]->get_style_name());
numIds.push_back(abstractNumId);
strm << L"<w:abstractNum w:abstractNumId=\"" << abstractNumId << "\">";
numIds.push_back(abstractNumId);
for (size_t j = 0; j < (std::min)( content.size(), (size_t)9); j++)
{
start_text_list_style(arListStyles[i]->get_text_list_style()->get_style_name());
content[j]->docx_convert(*this);
// TODO
start_text_list_style(arListStyles[i]->get_text_list_style()->attr_.style_name_);
content[j]->docx_convert(*this);
end_text_list_style();
}
strm << L"</w:abstractNum>";
}
}
if (list_styles.outline_style())
{
const int abstractNumId = list_styles.id_outline();
numIds.push_back(abstractNumId);
strm << L"<w:abstractNum w:abstractNumId=\"" << abstractNumId << "\">";
for (size_t j = 0; j < (std::min)( list_styles.outline_style()->content_.size(), (size_t)9); j++)
{
start_text_list_style(L"Outline");
list_styles.outline_style()->content_[j]->docx_convert(*this);
end_text_list_style();
}
strm << L"</w:abstractNum>";
}
for (size_t i = 0; i < numIds.size(); i++)
{
@ -1071,11 +1127,9 @@ void docx_conversion_context::process_styles()
for (size_t i = 0; i < arStyles.size(); i++)
{
if (!arStyles[i]->is_automatic() &&
(
arStyles[i]->type() == odf_types::style_family::Paragraph ||
arStyles[i]->type() == odf_types::style_family::Text
))
if (false == arStyles[i]->is_automatic() &&
(arStyles[i]->type() == odf_types::style_family::Paragraph ||
arStyles[i]->type() == odf_types::style_family::Text))
{
const std::wstring id = styles_map_.get(arStyles[i]->name(), arStyles[i]->type());
_Wostream << L"<w:style w:styleId=\"" << id << L"\" w:type=\"" << StyleTypeOdf2Docx(arStyles[i]->type()) << L"\"";
@ -1085,7 +1139,8 @@ void docx_conversion_context::process_styles()
}
_Wostream << L">";
const std::wstring displayName = StyleDisplayName(arStyles[i]->name(), arStyles[i]->display_name(), arStyles[i]->type());
bool bDisplayed = (arStyles[i]->type() == odf_types::style_family::Paragraph);
const std::wstring displayName = StyleDisplayName(arStyles[i]->name(), arStyles[i]->display_name(), arStyles[i]->type(), bDisplayed);
_Wostream << L"<w:name w:val=\"" << XmlUtils::EncodeXmlString(displayName) << L"\"/>";
@ -1094,12 +1149,13 @@ void docx_conversion_context::process_styles()
const std::wstring basedOnId = styles_map_.get(baseOn->name(), baseOn->type());
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\"/>";
}
else if (!arStyles[i]->is_default() && styles_map_.check(L"", arStyles[i]->type()))
else if (false == arStyles[i]->is_default() && styles_map_.check(L"", arStyles[i]->type()))
{
bDisplayed = false;
const std::wstring basedOnId = styles_map_.get(L"", arStyles[i]->type());
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\"/>";
}
else
if (bDisplayed)
{
_Wostream << L"<w:qFormat/>";
}
@ -1145,7 +1201,7 @@ void docx_conversion_context::process_section(std::wostream & strm, odf_reader::
int count_columns = 1;
bool sep_columns = false;
oox::section_context::_section & section = get_section_context().get();
oox::section_context::_section & section = get_section_context().get_last();
if (!columns)
{
@ -1243,7 +1299,7 @@ void docx_conversion_context::process_section(std::wostream & strm, odf_reader::
}
bool docx_conversion_context::process_page_properties(std::wostream & strm)
{
if (is_next_dump_page_properties() || get_section_context().get().is_dump_)
if (is_next_dump_page_properties() || get_section_context().get_last().is_dump_)
{
std::wstring pageProperties = get_page_properties();
odf_reader::page_layout_instance * page_layout_instance_ = root()->odf_context().pageLayoutContainer().page_layout_by_name(pageProperties);
@ -1421,14 +1477,14 @@ bool docx_conversion_context::get_page_break_before()
void docx_conversion_context::add_page_properties(const std::wstring & StyleName)
{
section_context::_section & s = section_context_.get();
section_context::_section & s = section_context_.get_last();
s.page_properties_.push_back( StyleName);
}
std::wstring docx_conversion_context::get_page_properties()
{
section_context::_section & s = section_context_.get();
section_context::_section & s = section_context_.get_last();
if (s.page_properties_.size() > 1) return s.page_properties_[1];
else if (s.page_properties_.size() == 1) return s.page_properties_[0];
@ -1436,7 +1492,7 @@ std::wstring docx_conversion_context::get_page_properties()
}
void docx_conversion_context::remove_page_properties()
{
section_context::_section & s = section_context_.get();
section_context::_section & s = section_context_.get_last();
if (s.page_properties_.size() > 1)
{
@ -1524,7 +1580,8 @@ void docx_conversion_context::start_list_item(bool restart)
list_style_renames_[curStyleName] = newStyleName;
odf_reader::list_style_container & lists = root()->odf_context().listStyleContainer();
odf_reader::text_list_style * curStyle = lists.list_style_by_name(curStyleName);
odf_reader::text_list_style * curStyle = lists.list_style_by_name(curStyleName);
lists.add_list_style(curStyle, newStyleName);
end_list();
start_list(newStyleName);
@ -1671,6 +1728,8 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
double font_size = odf_reader::text_format_properties_content::process_font_size_impl(odf_types::font_size(odf_types::percent(100.0)), styleInst);
if (font_size > 0) current_fontSize.push_back(font_size);
_CP_OPT(int) outline_level = calc_outline_level(Attr->outline_level_, styleInst);
process_page_break_after(styleInst);
if (styleInst->is_automatic())
@ -1710,11 +1769,14 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
set_rtl(false);
}
}
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
get_styles_context().start_process_style(styleInst);
if (outline_level)
{
set_outline_level(*Attr->outline_level_ - 1);
set_outline_level(*outline_level);
}
styleContent->docx_convert(*this);
styleContent->docx_convert(*this);
get_styles_context().end_process_style();
end_automatic_style();
@ -1736,10 +1798,11 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
start_paragraph();
//process_paragraph_style(Context.get_current_paragraph_style()); ??
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
//if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
if (outline_level)
{
output_stream() << L"<w:pPr>";
output_stream() << L"<w:outlineLvl w:val=\"" << *Attr->outline_level_ - 1 << L"\"/>";
output_stream() << L"<w:outlineLvl w:val=\"" << *outline_level << L"\"/>";
output_stream() << L"</w:pPr>";
}
}
@ -1747,9 +1810,10 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
{
output_stream() << get_section_context().dump_;
get_section_context().dump_.clear();
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
//if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
if (outline_level)
{
output_stream() << L"<w:outlineLvl w:val=\"" << *Attr->outline_level_ - 1 << L"\"/>";
output_stream() << L"<w:outlineLvl w:val=\"" << *outline_level << L"\"/>";
}
output_stream() << L"</w:pPr>";
}
@ -1794,9 +1858,19 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
serialize_list_properties(output_stream());
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
//if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
if (outline_level)
{
output_stream() << L"<w:outlineLvl w:val=\"" << *Attr->outline_level_ - 1 << L"\" />";
odf_reader::list_style_container & list_styles = root()->odf_context().listStyleContainer();
if (list_style_stack_.empty() && list_styles.outline_style())
{
output_stream() << L"<w:numPr>";
output_stream() << L"<w:ilvl w:val=\"" << *outline_level - 1 << L"\"/>";
output_stream() << L"<w:numId w:val=\"" << list_styles.id_outline() << L"\"/>";
output_stream() << L"</w:numPr>";
}
output_stream() << L"<w:outlineLvl w:val=\"" << *outline_level << L"\"/>";
}
if (!get_text_tracked_context().dumpRPrInsDel_.empty())
@ -1914,7 +1988,34 @@ void section_context::add_section(const std::wstring & SectionName, const std::w
_section newSec(SectionName, Style, PageProperties );
sections_.push_back(newSec);
}
section_context::_section & section_context::get_first()
{
if (sections_.empty())
return main_section_;
else
return sections_[0];
}
section_context::_section & section_context::get_last()
{
if (sections_.empty())
return main_section_;
else
return sections_.back();
}
void section_context::remove_section()
{
if (sections_.empty()) return;
sections_.pop_back();
//sections_.erase(sections_.begin(), sections_.begin() + 1);
if (sections_.empty())
{
//после оканчания разметки секциями и начале (возобновлении) основного раздела нужен разрыв (хотя настройки страницы могут и не поменяться)
//щас разрыв на текущей странице
//todooo проверить - может типо если следующий будет заголовок - разорвать
main_section_.is_dump_ = false;
}
}
namespace
{
// обработка Header/Footer
@ -1933,8 +2034,8 @@ namespace
//слить если есть mediaitems, добавить релсы и обнулить их для основного документа.
rels internal_rels;
Context.get_mediaitems()->dump_rels(internal_rels);
Context.dump_hyperlinks(internal_rels, hyperlinks::document_place);
Context.get_mediaitems()->dump_rels(internal_rels, oox::header_footer_place);
Context.dump_hyperlinks(internal_rels, oox::header_footer_place);
Context.get_headers_footers().add(styleName, dbgStr, type, internal_rels);
}

View File

@ -324,11 +324,10 @@ public:
struct _section
{
_section() {is_dump_ = false;}
_section() : is_dump_(false){}
_section(const std::wstring & SectionName, const std::wstring & Style, const std::wstring & PageProperties)
_section(const std::wstring & SectionName, const std::wstring & Style, const std::wstring & PageProperties) : is_dump_(false)
{
is_dump_ = false;
name_ = SectionName;
style_ = Style;
page_properties_.push_back(PageProperties);
@ -340,7 +339,7 @@ public:
std::vector<std::wstring> page_properties_;
bool is_dump_;
bool is_dump_ = false;
};
void add_section(const std::wstring & SectionName, const std::wstring & Style, const std::wstring & PageProperties);
@ -349,27 +348,12 @@ public:
{
return sections_.empty();
}
_section & get()
{
if (sections_.empty())
return main_section_;
else
return sections_[0];
}
void remove_section()
{
if (sections_.empty()) return;
_section & get_first();
_section & get_last();
sections_.erase(sections_.begin(), sections_.begin() + 1);
if (sections_.empty())
{
//после оканчания разметки секциями и начале (возобновлении) основного раздела нужен разрыв (хотя настройки страницы могут и не поменяться)
//щас разрыв на текущей странице
//todooo проверить - может типо если следующий будет заголовок - разорвать
main_section_.is_dump_ = false;
}
}
std::wstring dump_;
void remove_section();
std::wstring dump_;
private:
_section main_section_;
@ -475,42 +459,56 @@ private:
class comments_context : boost::noncopyable
{
public:
comments_context() : state_(0) {}
comments_context(){}
struct _comment_desc
{
_comment_desc(const std::wstring & c, int _id, const std::wstring & a, const std::wstring & d) :
content(c), id(_id), author(a), date(d)
{}
std::wstring content;
int id;
std::wstring date;
std::wstring author;
std::wstring initials;
};
void start_comment(const std::wstring & content, const std::wstring & author, const std::wstring & date, bool inRun = false)
void end_comment(const std::wstring & name)
{
std::map<std::wstring, int>::iterator pFind = comments_map_.find(name);
if (pFind != comments_map_.end())
{
ref_end_.push_back(pFind->second);
}
}
void start_comment(const std::wstring & content, const std::wstring & author, const std::wstring & date, _CP_OPT(std::wstring) name)
{
int id = comments_.size() + 1;
_comment_desc new_comment={content, id, date, author};
_comment_desc new_comment(content, id, author, date);
if ((name) && (false == name->empty()))
{
comments_map_.insert(std::make_pair(*name, id));
ref_start_.push_back(id);
}
else
{
ref_.push_back(id);
}
comments_.push_back(new_comment);
state_ = inRun ? 4 : 1;
}
int current_id()
{
if (comments_.size()>0 && state_ >0 )return comments_.back().id;
else return -1; //not set
}
void state(int state) {state_ = state;}
int state(){return state_;}
rels& get_rels(){return internal_rels_;}
std::vector<_comment_desc> comments_;
std::vector<_comment_desc> comments_;
std::vector<int> ref_start_;
std::vector<int> ref_end_;
std::vector<int> ref_;
private:
int state_;
rels internal_rels_;//это для гиперлинков или медиа в комментариях
std::map<std::wstring, int> comments_map_;
};
class text_tracked_context
{
public:
@ -784,10 +782,12 @@ public:
std::wstring add_hyperlink (const std::wstring & href, bool drawing);
hyperlinks::_ref last_hyperlink ();
void dump_hyperlinks (rels & Rels, hyperlinks::_type_place type);
void dump_hyperlinks (rels & Rels, _rels_type_place type);
void dump_headers_footers (rels & Rels) const;
void dump_notes (rels & Rels) const;
_rels_type_place get_type_place();
void dump_bibliography();
std::wstring dump_settings_document();
@ -934,9 +934,12 @@ public:
void start_chart(std::wstring name);
void end_chart ();
void start_comment () {current_process_comment_ = true;}
void end_comment () {current_process_comment_ = false;}
void start_comment_content () {current_process_comment_ = true;}
void end_comment_content () {current_process_comment_ = false;}
void start_comment(const std::wstring & content, const std::wstring & author, const std::wstring & date, _CP_OPT(std::wstring) name);
void end_comment(const std::wstring & name);
void start_math_formula ();
void end_math_formula ();

View File

@ -114,7 +114,7 @@ void serialize_wrap_extent(std::wostream & strm, _docx_drawing const & val)
if (odf_reader::GetProperty(val.additional,L"border_width_top",iVal)) CP_XML_ATTR(L"t",iVal.get());
if (odf_reader::GetProperty(val.additional,L"border_width_right",iVal)) CP_XML_ATTR(L"r",iVal.get());
if (odf_reader::GetProperty(val.additional,L"border_width_bottom",iVal)) CP_XML_ATTR(L"b",iVal.get());
}
}
}break;
default:
serialize_null_extent( strm);
@ -151,6 +151,7 @@ void serialize_wrap(std::wostream & strm, _docx_drawing const & val)
break;
case odf_types::style_wrap::Left:
case odf_types::style_wrap::Right:
case odf_types::style_wrap::Dynamic: //Présentation_de_tib.odt
serialize_wrap_square(strm, val);
break;
case odf_types::style_wrap::RunThrough:
@ -159,7 +160,6 @@ void serialize_wrap(std::wostream & strm, _docx_drawing const & val)
case odf_types::style_wrap::None:
serialize_wrap_top_bottom(strm, val);
break;
case odf_types::style_wrap::Dynamic:
default:
CP_XML_NODE(L"wp:wrapTopAndBottom");
break;
@ -195,6 +195,86 @@ void _docx_drawing::serialize_text(std::wostream & strm)
serialize_bodyPr(strm, L"wps");
}
//--------------------------------------------------------------------
void docx_serialize_media_child(std::wostream & strm, _docx_drawing & val)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"pic:pic")
{
CP_XML_ATTR(L"xmlns:pic",L"http://schemas.openxmlformats.org/drawingml/2006/picture");
{
CP_XML_NODE(L"pic:nvPicPr")
{
CP_XML_NODE(L"pic:cNvPr")
{
CP_XML_ATTR(L"id", val.id + 1);
CP_XML_ATTR(L"name", val.name);
//oox_serialize_action(CP_XML_STREAM(), val.action);
}
CP_XML_NODE(L"pic:cNvPicPr")
{
CP_XML_NODE(L"a:picLocks") CP_XML_ATTR(L"noChangeAspect",1);
}
CP_XML_NODE(L"pic:nvPr")
{
std::wstring strNode;
if (val.type == typeVideo) strNode = L"a:videoFile";
else if (val.type == typeAudio) strNode = L"a:audioFile";
if (false == strNode.empty())
{
CP_XML_NODE(strNode)
{
CP_XML_ATTR(L"r:link", val.objectId);
}
}
if (false == val.extId.empty())
{
CP_XML_NODE(L"a:extLst")
{
CP_XML_NODE(L"a:ext")
{
CP_XML_ATTR(L"uri", L"{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}");
CP_XML_NODE(L"wp15:media")
{
CP_XML_ATTR(L"xmlns:wp15", L"http://schemas.microsoft.com/office/word/2012/wordprocessingDrawing");
if (val.extExternal)
{
CP_XML_ATTR(L"r:link", val.extId);
}
else
{
CP_XML_ATTR(L"r:embed", val.extId);
}
}
}
}
}
}
}
}
val.fill.bitmap->name_space = L"pic";
oox_serialize_fill(CP_XML_STREAM(), val.fill);
CP_XML_NODE(L"pic:spPr")
{
val.serialize_xfrm(CP_XML_STREAM());
CP_XML_NODE(L"a:prstGeom")
{
CP_XML_ATTR(L"prst", L"rect");
CP_XML_NODE(L"a:avLst");
}
oox_serialize_ln(CP_XML_STREAM(), val.additional);
oox_serialize_effects(CP_XML_STREAM(), val.additional);
}
}
}
}
//--------------------------------------------------------------------
void docx_serialize_image_child(std::wostream & strm, _docx_drawing & val)
{
@ -211,6 +291,8 @@ void docx_serialize_image_child(std::wostream & strm, _docx_drawing & val)
//CP_XML_ATTR(L"desc text",L"");
CP_XML_ATTR(L"id", val.id + 1);
CP_XML_ATTR(L"name", val.name);
//oox_serialize_action(CP_XML_STREAM(), val.action);
}
CP_XML_NODE(L"pic:cNvPicPr")
{
@ -346,6 +428,11 @@ void docx_serialize_common(std::wostream & strm, _docx_drawing & val)
CP_XML_ATTR(L"uri", L"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
docx_serialize_group_child(CP_XML_STREAM(), val);
}
else if (val.type == typeAudio || val.type == typeVideo || val.type == typeMedia)
{
CP_XML_ATTR(L"uri",L"http://schemas.openxmlformats.org/drawingml/2006/picture");
docx_serialize_media_child(CP_XML_STREAM(), val);
}
else if (val.type == typeImage)
{
CP_XML_ATTR(L"uri",L"http://schemas.openxmlformats.org/drawingml/2006/picture");

View File

@ -144,9 +144,9 @@ void word_files::write(const std::wstring & RootPath)
void word_files::update_rels(docx_conversion_context & Context)
{
Context.get_mediaitems()->dump_rels(rels_files_.get_rel_file()->get_rels());
Context.get_mediaitems()->dump_rels(rels_files_.get_rel_file()->get_rels(), oox::document_place);
Context.dump_hyperlinks (rels_files_.get_rel_file()->get_rels(), hyperlinks::document_place);
Context.dump_hyperlinks (rels_files_.get_rel_file()->get_rels(), oox::document_place);
Context.dump_headers_footers(rels_files_.get_rel_file()->get_rels());
Context.dump_notes (rels_files_.get_rel_file()->get_rels());
}

View File

@ -51,7 +51,7 @@ struct drawing_object_description
{
bool bNotes_;
oox::RelsType type_;
oox::_rels_type type_;
std::wstring name_;
std::wstring descriptor_;

View File

@ -31,7 +31,6 @@
*/
#include "hyperlinks.h"
#include "oox_rels.h"
#include <xml/utils.h>
@ -48,7 +47,7 @@ hyperlinks::_ref hyperlinks::last()
return r;
}
std::wstring hyperlinks::add(const std::wstring & href, _type_place type_place, bool drawing)
std::wstring hyperlinks::add(const std::wstring & href, _rels_type_place type_place, bool drawing)
{
std::wstring id = std::wstring(L"rHpId") + std::to_wstring(hrefs_.size() + 1);
@ -60,14 +59,14 @@ std::wstring hyperlinks::add(const std::wstring & href, _type_place type_place,
}
void hyperlinks::dump_rels(rels & Rels, _type_place type)
void hyperlinks::dump_rels(rels & Rels, _rels_type_place type_place)
{
size_t i = 0;
for (size_t i = 0; i < hrefs_.size(); i++)
{
if (hrefs_[i].used_rels)continue; // уже использовали этот релс
if (hrefs_[i].type_place == type)
if (hrefs_[i].type_place == type_place)
{
Rels.add( relationship(hrefs_[i].id, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", hrefs_[i].href, L"External" ) );
hrefs_[i].used_rels = true;

View File

@ -31,40 +31,29 @@
*/
#pragma once
#include <vector>
#include <string>
#include "oox_rels.h"
namespace cpdoccore {
namespace oox {
class rels;
class hyperlinks
{
public:
enum _type_place
{
document_place,
endnote_place,
footnote_place,
comment_place
};
struct _ref
{
std::wstring href;
_type_place type_place;
bool drawing;
std::wstring id;
bool used_rels;
std::wstring href;
_rels_type_place type_place;
bool drawing;
std::wstring id;
bool used_rels;
};
std::wstring add(const std::wstring & href, _type_place type_place, bool drawing);
std::wstring add(const std::wstring & href, _rels_type_place type_place, bool drawing);
_ref last();
void dump_rels(rels & Rels, _type_place type);
void dump_rels(rels & Rels, _rels_type_place type_place);
private:

View File

@ -34,47 +34,38 @@
#include <boost/lexical_cast.hpp>
#include <logging.h>
#include <float.h>
#include "../../../DesktopEditor/graphics/pro/Fonts.h"
namespace cpdoccore {
namespace utils {
namespace
std::pair<double, double> GetMaxDigitSizePixelsImpl(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, NSFonts::IFontManager *pFontManager)
{
class Error : public std::exception {};
class LoadFontError : public Error {};
class MeasureError : public Error {};
}
if (pFontManager == NULL) return std::pair<double, double>(7., 8.);
std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, NSFonts::IFontManager *pFontManager)
{
if (pFontManager == NULL) return std::pair<float, float>(7,8);
int hr = FALSE;
int hr = FALSE;
if (FALSE == (hr = pFontManager->LoadFontByName(fontName, fontSize, fontStyle, dpi, dpi )))
{
if (FALSE == (hr = pFontManager->LoadFontByName(L"Arial", fontSize, fontStyle, dpi, dpi )))
{
return std::pair<float, float>(7, 8);
return std::pair<double, double>(7, 8);
}
}
float maxWidth = 0;
float maxHeight = 0;
double maxWidth = 0;
double maxHeight = 0;
float minWidth = 0xffff;
float minHeight = 0xffff;
double minWidth = 0xffffffff;
double minHeight = 0xfffffff;
// for (int i = 0; i <= 9; ++i)
{
//if (FALSE == (hr = pFontManager->LoadString2( std::to_wstring(i), 0, 0)))
// return std::pair<float, float>(7,8);
if (FALSE == (hr = pFontManager->LoadString2( L"0123456789abcdefghijklmnopqrstuvwxyz" , 0, 0)))
return std::pair<float, float>(7,8);
if (FALSE == (hr = pFontManager->LoadString2( L"0123456789abcdefghijklmnopqrstuvwxyz" , 0, 0)))//
return std::pair<double, double>(7., 8.);
TBBox box;
try
@ -82,12 +73,12 @@ std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName,
box = pFontManager->MeasureString();
}catch(...)
{
return std::pair<float, float>(7,8);
return std::pair<double, double>(7.,8.);
}
if (box.fMaxX < -0xffff+1 || box.fMaxY < -0xffff+1 ||
box.fMinX > 0xffff-1 || box.fMinY > 0xffff-1)
return std::pair<float, float>(7,8);
return std::pair<double, double>(7., 8. );
if (box.fMaxX - box.fMinX > maxWidth) maxWidth = box.fMaxX - box.fMinX;
if (box.fMaxY - box.fMinY > maxHeight) maxHeight = box.fMaxY - box.fMinY;
@ -96,12 +87,13 @@ std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName,
if (box.fMaxY - box.fMinY < minHeight) minHeight = box.fMaxY - box.fMinY;
}
double width = (minWidth + 2 * maxWidth) /36. /3.;
return std::pair<float, float>(width, maxHeight);
double width = (minWidth + 2 * maxWidth) /36. /3.;
//double width = (minWidth + 2 * maxWidth) / 5./*/36.*/ /3.;
return std::pair<double, double>(width, maxHeight);
}
std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, NSFonts::IApplicationFonts *appFonts)
std::pair<double, double> GetMaxDigitSizePixels(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, NSFonts::IApplicationFonts *appFonts)
{
try
{
@ -111,7 +103,7 @@ std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, dou
{
NSFonts::IFontManager *pFontManager = appFonts->GenerateFontManager();
std::pair<float, float> val = GetMaxDigitSizePixelsImpl(fontName, fontSize, dpi, fontStyle, pFontManager);
std::pair<double, double> val = GetMaxDigitSizePixelsImpl(fontName, fontSize, dpi, fontStyle, pFontManager);
if (pFontManager)
{
@ -126,7 +118,7 @@ std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, dou
{
// TODO: default value!
}
return std::pair<float, float>(7, 8);
return std::pair<double, double>(7., 8.);
}
}

View File

@ -42,7 +42,7 @@ namespace NSFonts
namespace cpdoccore {
namespace utils {
std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, NSFonts::IApplicationFonts *appFonts);
std::pair<double, double> GetMaxDigitSizePixels(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, NSFonts::IApplicationFonts *appFonts);
}
}

View File

@ -59,18 +59,10 @@ bool is_internal(const std::wstring & uri, const std::wstring & packetRoot)
return NSFile::CFileBinary::Exists(resultPath) || NSDirectory::Exists(mediaPath);
}
mediaitems::item::item( std::wstring const & _href,
RelsType _type,
std::wstring const & _outputName,
bool _mediaInternal,
std::wstring const & _Id
)
: href(_href),
type(_type),
outputName(_outputName),
mediaInternal(_mediaInternal),
Id(_Id),
valid(true) //вообще говоря даже если файл покоцанный то мы все равно обязаны перенести "объект"
mediaitems::item::item(std::wstring const & _href,_rels_type _type, std::wstring const & _outputName,
bool _mediaInternal, std::wstring const & _Id, _rels_type_place type_place_)
: href(_href), type(_type), outputName(_outputName), mediaInternal(_mediaInternal), Id(_Id), valid(true), type_place(type_place_)
//вообще говоря даже если файл покоцанный то мы все равно обязаны перенести "объект"
{
count_add = 1;
count_used = 0;
@ -102,13 +94,13 @@ void mediaitems::set_font_directory(std::wstring pathFonts)
applicationFonts_->InitializeFromFolder(pathFonts);
}
std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, bool & isInternal)
std::wstring mediaitems::add_or_find(const std::wstring & href, _rels_type type, bool & isInternal, _rels_type_place type_place)
{
std::wstring ref;
return add_or_find(href, type, isInternal, ref);
return add_or_find(href, type, isInternal, ref, type_place);
}
std::wstring static get_default_file_name(RelsType type)
std::wstring static get_default_file_name(_rels_type type)
{
switch (type)
{
@ -136,7 +128,7 @@ std::wstring static get_default_file_name(RelsType type)
return L"";
}
}
std::wstring mediaitems::create_file_name(const std::wstring & uri, RelsType type, bool & isInternal, size_t Num)
std::wstring mediaitems::create_file_name(const std::wstring & uri, _rels_type type, bool & isInternal, size_t Num)
{
if (uri.empty()) return L"";
@ -206,7 +198,7 @@ std::wstring mediaitems::detectImageFileExtension(const std::wstring &fileName)
return XmlUtils::GetLower(sExt);
}
std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, bool & isInternal, std::wstring & ref)
std::wstring mediaitems::add_or_find(const std::wstring & href, _rels_type type, bool & isInternal, std::wstring & ref, _rels_type_place type_place)
{
bool isMediaInternal = true;
std::wstring sub_path = L"media/";
@ -254,6 +246,8 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
std::wstring id;
for (size_t i = 0 ; i < items_.size(); i++)
{
if (items_[i].type_place != type_place) continue;
if ((items_[i].href == inputPath && !inputPath.empty()) || (items_[i].type == type && inputPath.empty()))
{
id = items_[i].Id;
@ -313,13 +307,18 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
count_shape++;
}
items_.push_back( item(inputPath, type, xml::utils::replace_text_to_xml(outputPath), isMediaInternal, id) );
items_.push_back( item(inputPath, type, xml::utils::replace_text_to_xml(outputPath), isMediaInternal, id, type_place) );
}
ref = outputPath;
isInternal = isMediaInternal;
return id;
}
void mediaitems::add_rels(bool isInternal, std::wstring const & rid, std::wstring const & ref, _rels_type type, _rels_type_place type_place)
{
items_.push_back( item(L"", type, ref, isInternal, rid, type_place) );
}
std::wstring mediaitems::add_control_props(std::wstring & oox_target)
{
const bool isMediaInternal = true;
@ -330,10 +329,10 @@ std::wstring mediaitems::add_control_props(std::wstring & oox_target)
oox_target = std::wstring(L"ctrlProp") + std::to_wstring(count_control) + L".xml";
items_.push_back( item(L"", typeControlProps, oox_target, isMediaInternal, rId) );
items_.push_back( item(L"", typeControlProps, oox_target, isMediaInternal, rId, oox::document_place) );
return rId;
}
void mediaitems::dump_rels(rels & Rels)
void mediaitems::dump_rels(rels & Rels, _rels_type_place type_place)
{
for (size_t i = 0; i < items_.size(); i++)
{
@ -341,8 +340,10 @@ void mediaitems::dump_rels(rels & Rels)
if ( items_[i].type == typeShape ) continue;
if ( items_[i].type == typeGroupShape ) continue;
if (items_[i].type_place != type_place) continue;
if (items_[i].count_used >= items_[i].count_add) continue; // уже использовали этот релс выше(колонтитул ....)
Rels.add( relationship(
items_[i].Id,
get_rel_type (items_[i].type),

View File

@ -46,25 +46,28 @@ namespace oox {
class mediaitems
{
public:
mediaitems(const std::wstring & odfPacket);
virtual ~mediaitems();
struct item
{
item( std::wstring const & _href,
RelsType _type,
std::wstring const & _outputName,
bool _mediaInternal,
std::wstring const & _Id);
item( std::wstring const & href,
_rels_type type,
std::wstring const & outputName,
bool mediaInternal,
std::wstring const & Id,
_rels_type_place type_place);
std::wstring href;
RelsType type;
std::wstring outputName;
bool mediaInternal;
bool valid;
std::wstring Id;
int count_used;
int count_add;
std::wstring href;
_rels_type type;
_rels_type_place type_place;
std::wstring outputName;
bool mediaInternal;
bool valid;
std::wstring Id;
int count_used;
int count_add;
};
typedef std::vector< item > items_array;
@ -83,15 +86,17 @@ public:
void set_font_directory(std::wstring pathFonts);
NSFonts::IApplicationFonts *applicationFonts() {return applicationFonts_;}
std::wstring add_or_find(const std::wstring & href, RelsType type, bool & isInternal);//возможны ссылки на один и тот же объект
std::wstring add_or_find(const std::wstring & href, RelsType type, bool & isInternal, std::wstring & ref);
std::wstring add_or_find(const std::wstring & href, _rels_type type, bool & isInternal, _rels_type_place type_place);//возможны ссылки на один и тот же объект
std::wstring add_or_find(const std::wstring & href, _rels_type type, bool & isInternal, std::wstring & ref, _rels_type_place type_place);
void add_rels(bool isInternal, std::wstring const & rid, std::wstring const & ref, _rels_type type, _rels_type_place type_place);
std::wstring add_control_props (std::wstring & oox_target);
void dump_rels(rels & Rels);
items_array & items() { return items_; }
void dump_rels(rels & Rels, _rels_type_place type);
items_array & items() { return items_; }
static std::wstring get_rel_type(RelsType type)
static std::wstring get_rel_type(_rels_type type)
{
switch (type)
{
@ -111,7 +116,7 @@ public:
return L"";
}
}
static RelsType detectMediaType(const std::wstring & fileName)
static _rels_type detectMediaType(const std::wstring & fileName)
{
size_t pos = fileName.rfind(L".");
@ -139,7 +144,7 @@ public:
}
private:
std::wstring create_file_name (const std::wstring & uri, RelsType type, bool & isInternal, size_t Num);
std::wstring create_file_name (const std::wstring & uri, _rels_type type, bool & isInternal, size_t Num);
std::wstring detectImageFileExtension (const std::wstring &fileName);
items_array items_;

View File

@ -137,7 +137,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
{
CP_XML_NODE(L"c:orientation")
{
odf_reader::GetProperty(content_.properties_,L"reverse-direction",boolVal);
odf_reader::GetProperty(content_.properties_, L"reverse-direction",boolVal);
if ((boolVal == true) && (boolVal.get()==true))
{
CP_XML_ATTR(L"val", "maxMin");
@ -147,7 +147,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
CP_XML_ATTR(L"val", "minMax");//default
}
}
odf_reader::GetProperty(content_.properties_,L"maximum", doubleVal);
odf_reader::GetProperty(content_.properties_, L"maximum", doubleVal);
if (doubleVal)
{
CP_XML_NODE(L"c:max")
@ -189,16 +189,31 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
CP_XML_ATTR(L"val",L"l");// "b" | "l" | "r" | "t"// == bottom left right top
}
//oox_serialize_ln(_Wostream, content_.graphic_properties_);
_CP_OPT(std::wstring) strNumFormat, strPercentFormat;
_CP_OPT(bool) bLinkData;
_CP_OPT(int) nTypeFormat;
odf_reader::GetProperty(content_.properties_, L"num_format", strVal);
odf_reader::GetProperty(content_.properties_, L"link-data-style-to-source", boolVal);
odf_reader::GetProperty(content_.properties_, L"num_format", strNumFormat);
odf_reader::GetProperty(content_.properties_, L"percentage_num_format", strPercentFormat);
odf_reader::GetProperty(content_.properties_, L"data-label-number", nTypeFormat);
odf_reader::GetProperty(content_.properties_, L"link-data-style-to-source", bLinkData);
if ((strVal) && (strVal->length() > 1))
std::wstring formatCode;
if ((nTypeFormat) && (*nTypeFormat == 2) && strPercentFormat)
{
formatCode = *strPercentFormat;
}
else if ((strNumFormat) && (strNumFormat->length() > 1))
{
formatCode = *strNumFormat;
}
if (formatCode.length() > 1)
{
CP_XML_NODE(L"c:numFmt")
{
CP_XML_ATTR(L"formatCode", *strVal);
CP_XML_ATTR(L"sourceLinked", boolVal.get_value_or(true));
CP_XML_ATTR(L"formatCode", formatCode);
CP_XML_ATTR(L"sourceLinked", bLinkData.get_value_or(true));
}
}
@ -228,7 +243,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
{
shape.oox_serialize(CP_XML_STREAM());
}
odf_reader::GetProperty(content_.properties_,L"display_label",boolVal);
odf_reader::GetProperty(content_.properties_, L"display_label",boolVal);
if ((boolVal == true) && (boolVal.get()==true))
{
CP_XML_NODE(L"c:minorTickMark")
@ -241,7 +256,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
title.oox_serialize(_Wostream);
odf_reader::GetProperty(content_.properties_,L"display_label", boolVal);
odf_reader::GetProperty(content_.properties_, L"display_label", boolVal);
if ((boolVal == true) && (boolVal.get()==true))
{
CP_XML_NODE(L"c:tickLblPos")
@ -250,7 +265,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
}
}
shape.set(content_.graphic_properties_,content_.fill_) ;
shape.set(content_.graphic_properties_, content_.fill_) ;
shape.oox_serialize(_Wostream);
oox_serialize_default_text(_Wostream, content_.text_properties_);

View File

@ -41,22 +41,8 @@
namespace cpdoccore {
namespace oox {
class oox_chart_context::Impl
oox_chart_context::oox_chart_context(mediaitems_ptr & m, std::wstring name) : mediaitems_(m), no_used_local_tables_(false)
{
public:
Impl(std::wstring name){}
std::wstring name_;
std::wstringstream chartData_;
std::wstring drawingName_;
std::wstring drawingId_;
};
oox_chart_context::oox_chart_context(mediaitems_ptr & m, std::wstring name) :
impl_(new oox_chart_context::Impl( name)), mediaitems_(m)
{
}
void oox_chart_context::reset_fill(oox::_oox_fill &f)
@ -65,7 +51,7 @@ void oox_chart_context::reset_fill(oox::_oox_fill &f)
{
bool isInternal = true;
std::wstring ref;
f.bitmap->rId = mediaitems_->add_or_find(f.bitmap->xlink_href_, typeImage, isInternal, ref);
f.bitmap->rId = mediaitems_->add_or_find(f.bitmap->xlink_href_, typeImage, isInternal, ref, oox::chart_place);
rels_.push_back(_rel(isInternal, f.bitmap->rId, ref, typeImage));
}
@ -75,7 +61,7 @@ void oox_chart_context::set_externalData(const std::wstring & href)
bool isInternal = true;
std::wstring href_out;
externalDataId_ = mediaitems_->add_or_find(href, typeMsObject, isInternal, href_out);
externalDataId_ = mediaitems_->add_or_find(href, typeMsObject, isInternal, href_out, oox::chart_place);
rels_.push_back(_rel(isInternal, externalDataId_, href_out, typeMsObject));
}
void oox_chart_context::set_userShapes(std::pair<std::wstring, std::wstring> &link)
@ -84,10 +70,6 @@ void oox_chart_context::set_userShapes(std::pair<std::wstring, std::wstring> &li
userShapesId_ = link.second;
rels_.push_back(_rel(isInternal, userShapesId_, link.first, typeChartUserShapes));
}
std::wostream & oox_chart_context::chartData()
{
return impl_->chartData_;
}
void oox_chart_context::dump_rels(rels & Rels)
{
@ -146,9 +128,12 @@ void oox_chart_context::serialize(std::wostream & strm)
CP_XML_NODE(L"c:lang")
{
CP_XML_ATTR(L"val",L"en-US");
CP_XML_ATTR(L"val", L"en-US");
}
CP_XML_NODE(L"c:roundedCorners")
{
CP_XML_ATTR(L"val", 0);
}
if (pivot_source_.empty() == false)
{
set_cache_only(true);
@ -169,6 +154,7 @@ void oox_chart_context::serialize(std::wostream & strm)
{
if (plot_area_.current_chart_->is3D_)
{
plot_area_.oox_serialize_view3D(CP_XML_STREAM());
//CP_XML_NODE(L"c:view3D");
CP_XML_NODE(L"c:floor");
CP_XML_NODE(L"c:backWall");

View File

@ -45,7 +45,6 @@
namespace cpdoccore {
namespace oox {
class oox_chart_context;
typedef _CP_PTR(oox_chart_context) oox_chart_context_ptr;
@ -56,8 +55,6 @@ public:
oox_chart_context(mediaitems_ptr & mediaitems_, std::wstring name);
~oox_chart_context();
std::wostream & chartData();
void reset_fill(oox::_oox_fill &fill_);
void serialize(std::wostream & strm);
@ -67,9 +64,10 @@ public:
{
pivot_source_ = source;
}
void set_title(odf_reader::chart::title & t)
void set_title(odf_reader::chart::title & t, odf_reader::chart::title & sub)
{
title_.set_content(t);
title_.set_sub_content(sub);
}
void add_axis(int type, odf_reader::chart::axis & content)
{
@ -118,18 +116,17 @@ public:
graphic_properties_= prop;
fill_ = fill;
}
void set_plot_area_properties(std::vector<odf_reader::_property> & prop, _oox_fill &fill)
void set_plot_area_properties(std::vector<odf_reader::_property> & prop, std::vector<odf_reader::_property> & prop_3d, _oox_fill &fill)
{
reset_fill(fill);
plot_area_.properties_ = prop;
plot_area_.properties_3d_ = prop_3d;
plot_area_.fill_ = fill;
}
bool no_used_local_tables_;
void set_cache_only (bool val);
private:
class Impl;
_CP_SCOPED_PTR(Impl) impl_;
mediaitems_ptr mediaitems_;
std::vector<_rel> rels_;
@ -144,18 +141,6 @@ private:
std::vector<odf_reader::_property> graphic_properties_;
_oox_fill fill_;
};
//autoTitleDeleted (Auto Title Is Deleted) §21.2.2.7
//backWall (Back Wall) §21.2.2.11
//dispBlanksAs (Display Blanks As) §21.2.2.42
//extLst (Chart Extensibility) §21.2.2.64
//floor (Floor) §21.2.2.69
//legend (Legend) §21.2.2.93
//pivotFmts (Pivot Formats) §21.2.2.143
//plotArea (Plot Area) §21.2.2.145
//plotVisOnly (Plot Visible Only) §21.2.2.146
//showDLblsOverMax (Show Data Labels over Maximum) §21.2.2.180
//sideWall (Side Wall) §21.2.2.191
//title (Title) §21.2.2.210
//view3D (View In 3D)
}
}

View File

@ -40,7 +40,7 @@
namespace cpdoccore {
namespace oox {
class oox_chart_legend: boost::noncopyable
class oox_chart_legend : boost::noncopyable
{
public:
oox_chart_legend(){}

View File

@ -55,9 +55,9 @@ oox_chart_series::oox_chart_series()
values_[3].type = L"c:yVal";
values_[4].type = L"c:bubbleSize";//заместо оси х!!!!
iSymbolMarkerType_ = 0;
bLocalTable_ = false;
labelPosEnabled_ = true;
iSymbolMarkerType_ = 0;
bCacheOnly_ = false;
labelPosEnabled_ = true;
}
void oox_chart_series::setName(const std::wstring &value)
{
@ -93,7 +93,7 @@ void oox_chart_series::setFormula(int ind, const std::wstring &value, const std:
void oox_chart_series::set_cache_only (bool val)
{
bLocalTable_ = val;
bCacheOnly_ = val;
}
void oox_chart_series::parse_properties()
@ -127,14 +127,32 @@ void oox_chart_series::parse_properties()
data_labels_->set_showCatName(*boolVal);
}
odf_reader::GetProperty(content_.properties_, L"data-label-number", intVal);
_CP_OPT(std::wstring) strNumFormat, strPercentFormat;
_CP_OPT(bool) bLinkData;
_CP_OPT(int) nTypeFormat;
if (intVal)
odf_reader::GetProperty(content_.properties_, L"num_format", strNumFormat);
odf_reader::GetProperty(content_.properties_, L"percentage_num_format", strPercentFormat);
odf_reader::GetProperty(content_.properties_, L"data-label-number", nTypeFormat);
odf_reader::GetProperty(content_.properties_, L"link-data-style-to-source", bLinkData);
std::wstring formatCode = strNumFormat.get_value_or(L"");
if (nTypeFormat)
{
if (!data_labels_) data_labels_ = oox_data_labels();
if (*intVal == 1) data_labels_->set_showVal(true);
if (*intVal == 2) data_labels_->set_showPercent(true);
if (*nTypeFormat == 1) data_labels_->set_showVal(true);
if (*nTypeFormat == 2)
{
data_labels_->set_showPercent(true);
if (strPercentFormat)
formatCode = *strPercentFormat;
}
}
if (false == formatCode.empty())
{
if (!data_labels_) data_labels_ = oox_data_labels();
data_labels_->set_formatCode(formatCode, bLinkData.get_value_or(true));
}
odf_reader::GetProperty(content_.properties_, L"label-position", intVal);
if (intVal && labelPosEnabled_)
@ -149,8 +167,14 @@ void oox_chart_series::setValues(int ind, std::vector<std::wstring> & values)
{
values_[ind].present = true;
if (ind == 0) values_[ind].strRef_.present = true;
else values_[ind].numRef_.present = true;
if (ind == 0)
{
values_[ind].strRef_.present = true;
}
else
{
values_[ind].numRef_.present = true;
}
for (size_t i = 0; i < values.size(); i++)
{
@ -227,37 +251,45 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
{
CP_XML_NODE(L"c:tx")
{
CP_XML_NODE(L"c:strRef")
if (false == label_.formula.empty())
{
if (!label_.formula.empty())
CP_XML_NODE(L"c:strRef")
{
CP_XML_NODE(L"c:f")
{
CP_XML_STREAM() << label_.formula;
}
}
if (false == label_.str_cache.empty())
{
CP_XML_NODE(L"c:strCache")
if (false == label_.str_cache.empty())
{
CP_XML_NODE(L"c:ptCount")
CP_XML_NODE(L"c:strCache")
{
CP_XML_ATTR(L"val", label_.str_cache.size());
}
for (size_t i = 0; i < label_.str_cache.size(); i++)
{
CP_XML_NODE(L"c:pt")
CP_XML_NODE(L"c:ptCount")
{
CP_XML_ATTR(L"idx", i);
CP_XML_NODE(L"c:v")
CP_XML_ATTR(L"val", label_.str_cache.size());
}
for (size_t i = 0; i < label_.str_cache.size(); i++)
{
CP_XML_NODE(L"c:pt")
{
CP_XML_STREAM() << label_.str_cache[i];
CP_XML_ATTR(L"idx", i);
CP_XML_NODE(L"c:v")
{
CP_XML_STREAM() << label_.str_cache[i];
}
}
}
}
}
}
}
else if (false == label_.str_cache.empty())
{
CP_XML_NODE(L"c:v")
{
CP_XML_STREAM() << label_.str_cache[0];
}
}
}
}
@ -265,7 +297,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
{
if (values_[i].present)
{
if (bLocalTable_)
if (bCacheOnly_)
{
if (values_[i].numRef_.present && values_[i].numRef_.num_cache_count == 0)
{
@ -279,16 +311,13 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
CP_XML_NODE(values_[i].type)
{
if (values_[i].numRef_.present && !bLocalTable_)
if (values_[i].numRef_.present && false == values_[i].numRef_.formula.empty())
{
CP_XML_NODE(L"c:numRef")
{
CP_XML_NODE(L"c:f")
{
if (values_[i].numRef_.formula.empty())
CP_XML_CONTENT(L"label");
else
CP_XML_CONTENT(values_[i].numRef_.formula);
CP_XML_CONTENT(values_[i].numRef_.formula);
}
if (values_[i].numRef_.num_cache_count > 0)
@ -364,16 +393,13 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
}
}
}
else if (values_[i].strRef_.present && !bLocalTable_)
else if (values_[i].strRef_.present && false == values_[i].strRef_.formula.empty())
{
CP_XML_NODE(L"c:strRef")
{
CP_XML_NODE(L"c:f")
{
if (values_[i].strRef_.formula.empty())
CP_XML_CONTENT(L"label");
else
CP_XML_CONTENT(values_[i].strRef_.formula);
CP_XML_CONTENT(values_[i].strRef_.formula);
}
CP_XML_NODE(L"c:strCache")
{
@ -466,7 +492,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
}
}
if (!content_.text_properties_.empty())
if (!content_.text_properties_)
{
if (!data_labels_) data_labels_ = oox_data_labels();
@ -500,7 +526,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
shape.oox_serialize(CP_XML_STREAM());
}
if (!content_.points_[i].text_properties_.empty())
if (!content_.points_[i].text_properties_)
{
if (!data_labels_) data_labels_ = oox_data_labels();

View File

@ -62,7 +62,9 @@ public:
int id_;
std::wstring name_;
int iSymbolMarkerType_;
bool bLocalTable_;
bool bCacheOnly_; // used embedded or only cache values
_CP_OPT(oox_data_labels) data_labels_;
void setName(const std::wstring &value);

View File

@ -36,11 +36,16 @@
#include "oox_chart_shape.h"
#include "oox_drawing.h"
#include "../odf/odfcontext.h"
#include "../odf/style_text_properties.h"
namespace cpdoccore {
namespace oox {
void oox_chart_shape::oox_serialize(std::wostream & _Wostream)
{
if (!bEnabled) return;
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE(L"c:spPr")
@ -52,15 +57,16 @@ void oox_chart_shape::oox_serialize(std::wostream & _Wostream)
}
void oox_chart_shape::set(std::vector<odf_reader::_property> & prop,_oox_fill & fill)
void oox_chart_shape::set(std::vector<odf_reader::_property> & prop, _oox_fill & fill)
{
bEnabled = true;
content_ = prop;
fill_ = fill;
}
void oox_serialize_default_text(std::wostream & _Wostream, std::vector<odf_reader::_property>& properties)
void oox_serialize_default_text(std::wostream & _Wostream, odf_reader::text_format_properties_content_ptr properties)
{
if (properties.size() < 1)return;
if (!properties) return;
CP_XML_WRITER(_Wostream)
{
@ -72,27 +78,8 @@ void oox_serialize_default_text(std::wostream & _Wostream, std::vector<odf_reade
{
CP_XML_NODE(L"a:pPr")
{
CP_XML_NODE(L"a:defRPr")
{
_CP_OPT(double) dVal;
_CP_OPT(int) iVal;
_CP_OPT(std::wstring) sVal;
if (odf_reader::GetProperty(properties, L"font-size",dVal))
CP_XML_ATTR(L"sz", (int)(dVal.get()*100));
if ((odf_reader::GetProperty(properties, L"font-style",iVal)) && (*iVal >0))
CP_XML_ATTR(L"i", "true");
if ((odf_reader::GetProperty(properties, L"font-weight",iVal)) && (*iVal >0))
CP_XML_ATTR(L"b", "true");
if (odf_reader::GetProperty(properties, L"font-color",sVal))
CP_XML_NODE(L"a:solidFill")
{
CP_XML_NODE(L"a:srgbClr"){CP_XML_ATTR(L"val", sVal.get());}
}
}
odf_reader::fonts_container fonts;
properties->oox_serialize(CP_XML_STREAM(), true, fonts, true);
}
}

View File

@ -39,19 +39,27 @@
#include "oox_drawing_fills.h"
namespace cpdoccore {
namespace odf_reader {
class text_format_properties_content;
typedef boost::shared_ptr<text_format_properties_content> text_format_properties_content_ptr;
}
namespace oox {
void oox_serialize_default_text(std::wostream & _Wostream, std::vector<odf_reader::_property>& properties);
void oox_serialize_default_text(std::wostream & _Wostream, odf_reader::text_format_properties_content_ptr properties);
class oox_chart_shape : boost::noncopyable
{
public:
oox_chart_shape(){}
oox_chart_shape() : bEnabled ( false) {}
~oox_chart_shape(){}
void set(std::vector<odf_reader::_property> & prop,_oox_fill & fill);
void oox_serialize(std::wostream & _Wostream);
bool bEnabled;
private:
std::vector<odf_reader::_property> content_;
_oox_fill fill_;

View File

@ -49,18 +49,19 @@ oox_data_labels::oox_data_labels()//подписи на значениях
showPercent_ = false;
showSerName_ = false;
showVal_ = false;
linkData_ = true;
position_ = -1; //not set
}
void oox_data_labels::set_common_dLbl ( std::vector<odf_reader::_property> & text_properties)
void oox_data_labels::set_common_dLbl ( odf_reader::text_format_properties_content_ptr text_properties)
{
textPr_ = text_properties;
}
void oox_data_labels::add_dLbl(int ind, std::vector<odf_reader::_property> & text_properties)
void oox_data_labels::add_dLbl(int ind, odf_reader::text_format_properties_content_ptr text_properties)
{
dLbls_.insert(std::pair<int, std::vector<odf_reader::_property>>(ind, text_properties));
dLbls_.insert(std::make_pair(ind, text_properties));
}
void oox_data_labels::oox_serialize(std::wostream & _Wostream)
@ -69,9 +70,17 @@ void oox_data_labels::oox_serialize(std::wostream & _Wostream)
{
CP_XML_NODE(L"c:dLbls")
{
if (false == formatCode_.empty())
{
CP_XML_NODE(L"c:numFmt")
{
CP_XML_ATTR(L"formatCode", formatCode_);
CP_XML_ATTR(L"sourceLinked", linkData_);
}
}
oox_serialize_default_text(CP_XML_STREAM(), textPr_);
for (std::map<int, std::vector<odf_reader::_property>>::iterator it = dLbls_.begin(); it != dLbls_.end(); ++it)
for (std::map<int, odf_reader::text_format_properties_content_ptr>::iterator it = dLbls_.begin(); it != dLbls_.end(); ++it)
{
CP_XML_NODE(L"c:dLbl")
{

View File

@ -41,6 +41,13 @@
#include <xml/attributes.h>
namespace cpdoccore {
namespace odf_reader {
class text_format_properties_content;
typedef boost::shared_ptr<text_format_properties_content> text_format_properties_content_ptr;
}
namespace oox {
class oox_data_labels
@ -58,14 +65,22 @@ public:
void set_showPercent (bool Val){showPercent_ = Val;}
void set_showSerName (bool Val){showSerName_ = Val;}
void set_showVal (bool Val){showVal_ = Val;}
void set_formatCode (std::wstring & formatCode, bool linkData)
{
formatCode_ = formatCode;
linkData_ = linkData;
}
void set_position (int Val){position_ = Val;}
void add_dLbl (int ind, std::vector<odf_reader::_property> & text_properties);
void set_common_dLbl ( std::vector<odf_reader::_property> & text_properties);
void add_dLbl (int ind, odf_reader::text_format_properties_content_ptr text_properties);
void set_common_dLbl ( odf_reader::text_format_properties_content_ptr text_properties);
private:
std::wstring formatCode_;
bool linkData_;
bool showBubbleSize_; // (Show Bubble Size) §21.2.2.178
bool showCatName_; // (Show Category Name) §21.2.2.179
bool showLeaderLines_; // (Show Leader Lines) §21.2.2.183
@ -76,8 +91,8 @@ private:
int position_;
std::vector<odf_reader::_property> textPr_;
std::map<int, std::vector<odf_reader::_property>> dLbls_;
odf_reader::text_format_properties_content_ptr textPr_;
std::map<int, odf_reader::text_format_properties_content_ptr> dLbls_;
//delete (Delete) §21.2.2.40

View File

@ -170,7 +170,8 @@ void oox_serialize_effects(std::wostream & strm, const std::vector<odf_reader::_
double offsetY = dShadowOffsetY.get_value_or(0);
double dist = sqrt(offsetX * offsetX + offsetY * offsetY);
double dir = (offsetX > 0 ? atan(offsetY / offsetX) : 0) * 180. / 3.1415926;
double dir = atan(offsetY / offsetX) * 180. / 3.1415926;
if (dir < 0) dir += 360;
CP_XML_ATTR(L"dist", (int)(dist));
CP_XML_ATTR(L"dir", (int)(dir * 60000));

View File

@ -77,7 +77,7 @@ namespace oox {
std::wstring hId;
std::wstring hRef;
RelsType typeRels;
_rels_type typeRels;
bool highlightClick;
};
class _oox_drawing
@ -86,7 +86,7 @@ namespace oox {
_oox_drawing() : type(typeUnknown), id(0), x(0), y(0), cx(0), cy(0), sub_type(0), hidden(false), inGroup(false), lined(false), connector(false), name(L"object"), extExternal(false)
{
}
RelsType type;
_rels_type type;
bool inGroup;
size_t id;

View File

@ -125,7 +125,7 @@ namespace oox {
//////////////////////////////////////////////////////////////////////////////
struct _oox_fill
{
_oox_fill() : type(-1){}
int type = -1;
oox_gradient_fill_ptr gradient;
oox_hatch_fill_ptr hatch;
@ -133,11 +133,10 @@ namespace oox {
oox_solid_fill_ptr solid;
_CP_OPT(double) opacity;
int type;
void clear()
{
type=-1;
type = -1;
opacity = boost::none;
gradient.reset();

View File

@ -36,13 +36,6 @@
#include <CPScopedPtr.h>
#include "../odf/chart_objects.h"
namespace cpdoccore {
namespace odf_reader
{
//class style_table_cell_properties_attlist;
}
}
namespace cpdoccore {
namespace oox {
@ -58,8 +51,6 @@ public:
//size_t borderId(const odf_reader::style_table_cell_properties_attlist * cellProp, bool & is_default);
void oox_serialize(std::wostream & _Wostream);/* const;*/
};
}

View File

@ -94,6 +94,8 @@ static std::wstring get_mime_type(const std::wstring & extension)
else if (L"xlsx" == extension) return L"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
else if (L"docx" == extension) return L"application/vnd.openxmlformats-officedocument.wordprocessingml.document";
else if (L"doc" == extension) return L"application/msword";
else if (L"vsd" == extension) return L"application/vnd.visio";
else if (L"vsdx" == extension) return L"application/vnd.ms-visio.drawing";
else return L"application/octet-stream";
@ -387,16 +389,18 @@ void media::write(const std::wstring & RootPath)
items[i].type == typeAudio ||
items[i].type == typeVideo ))
{
std::wstring & file_name = items[i].href;
std::wstring &file_name = items[i].href;
std::wstring file_name_out = RootPath + FILE_SEPARATOR_STR + items[i].outputName;
if (file_name.empty()) continue;
CImageFileFormatChecker svmFileChecker;
if (svmFileChecker.isSvmFile(file_name))
{
ConvertSvmToImage(file_name, file_name_out, appFonts_);
}
else
NSFile::CFileBinary::Copy(items[i].href, file_name_out);
NSFile::CFileBinary::Copy(file_name, file_name_out);
}
}

View File

@ -34,6 +34,7 @@
#include <CPOptional.h>
#include <xml/simple_xml_writer.h>
#include <boost/algorithm/string.hpp>
#include "../odf/style_text_properties.h"
@ -95,7 +96,10 @@ void oox_plot_area::add_axis(int type, odf_reader::chart::axis & content)
axis_.push_back(ax);
}
void oox_plot_area::set_no_local_table (bool val)
{
no_used_local_tables_ = val;
}
void oox_plot_area::reset_cross_axis()//обязательно после всех добавлений
{
for (size_t i = 0; i < axis_.size(); i++)
@ -120,6 +124,104 @@ void oox_plot_area::reset_cross_axis()//обязательно после все
}
}
}
void oox_plot_area::oox_serialize_view3D(std::wostream & _Wostream)
{
_CP_OPT(std::wstring) strVal;
_CP_OPT(double) doubleVal;
odf_reader::GetProperty(properties_3d_, L"transform", strVal);
if (!strVal) return;
size_t pos_matrix = strVal->find(L"matrix(");
if (pos_matrix == std::wstring::npos) return;
size_t pos_matrix_end = strVal->find(L")", pos_matrix);
if (pos_matrix_end == std::wstring::npos || pos_matrix_end == pos_matrix + 7) return;
std::wstring tmp = strVal->substr(pos_matrix + 7, pos_matrix_end - 7 - pos_matrix);
std::vector<std::wstring> values;
boost::algorithm::split(values, tmp, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
if (values.size() < 12) return;
double left_x = XmlUtils::GetDouble(values[0]);
double up_x = XmlUtils::GetDouble(values[1]);
double forward_x = XmlUtils::GetDouble(values[2]);
double left_y = XmlUtils::GetDouble(values[3]);
double up_y = XmlUtils::GetDouble(values[4]);
double forward_y = XmlUtils::GetDouble(values[5]);
double left_z = XmlUtils::GetDouble(values[6]);
double up_z = XmlUtils::GetDouble(values[7]);
double forward_z = XmlUtils::GetDouble(values[8]);
const double DEG2RAD = 3.1415926 / 180;
double sx, sy, sz, cx, cy, cz, theta_x, theta_y, theta_z = 0;
sy = forward_x;
theta_y = (sy == 0 ? 0 : asin(sy));
cy = cos(theta_y);
theta_y /= DEG2RAD;
sx = - forward_y / cy;
cx = forward_z / cy;
theta_x = (sx == 0 ? 0 : asin(sx));
double theta_x_test = (sx == 0 ? 0 : acos(cx));
theta_x /= DEG2RAD;
sz = - up_x / cy;
cz = left_x / cy;
theta_z = (sz == 0 ? 0 : asin(sz));
double theta_z_test = (sz == 0 ? 0 : acos(cz));
theta_z /= DEG2RAD;
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE(L"c:view3D")
{
CP_XML_NODE(L"c:rotX")
{
CP_XML_ATTR(L"val", (int) (theta_x + 0.5) );
}
CP_XML_NODE(L"c:rotY")
{
CP_XML_ATTR(L"val", (int) (theta_y + 0.5) );
}
CP_XML_NODE(L"c:depthPercent")
{
CP_XML_ATTR(L"val", 100 );
}
if (theta_z == 0)
{
CP_XML_NODE(L"c:rAngAx")
{
CP_XML_ATTR(L"val", 1 );
}
}
else
{
CP_XML_NODE(L"c:rAngAx")
{
CP_XML_ATTR(L"val", 0 );
}
CP_XML_NODE(L"c:perspective")
{
CP_XML_ATTR(L"val", (int) (theta_z * 2 + 0.5) );
}
}
}
}
}
void oox_plot_area::oox_serialize(std::wostream & _Wostream)
{
reset_cross_axis();

View File

@ -45,7 +45,7 @@ namespace oox {
class oox_plot_area: boost::noncopyable
{
public:
oox_plot_area(){}
oox_plot_area() : no_used_local_tables_(false) {}
~oox_plot_area(){}
std::vector<oox_chart_ptr> charts_;
@ -54,31 +54,23 @@ public:
std::vector<odf_reader::_property> graphic_properties_;
std::vector<odf_reader::_property> properties_;
std::vector<odf_reader::_property> properties_3d_;
_oox_fill fill_;
//std::vector<odf_reader::_property> wall_graphic_properties_;
void oox_serialize(std::wostream & _Wostream);
void oox_serialize_view3D(std::wostream & _Wostream);
void add_chart (int type);
void add_axis (int type, odf_reader::chart::axis & content);
//void set_content_series (odf_reader::chart::series & content);
void set_no_local_table (bool val); //whithout embedded tables
//void set_content_series (odf_reader::chart::series & content);
private:
void reset_cross_axis();//обязательно после всех добавлений
//variable charts
//catAx (Category Axis Data) §21.2.2.25
//dateAx (Date Axis) §21.2.2.39
//serAx (Series Axis) §21.2.2.175
//valAx (Value Axis) §21.2.2.226
//extLst (Chart Extensibility) §21.2.2.64
//layout (Layout) §21.2.2.88
//spPr (Shape Properties) §21.2.2.197
//dTable (Data Table) §21.2.2.54
void reset_cross_axis(); //обязательно после всех добавлений
bool no_used_local_tables_;
};

View File

@ -40,7 +40,7 @@
namespace cpdoccore {
namespace oox {
enum RelsType
enum _rels_type
{
typeUnknown = 0,
typeDefault,
@ -63,10 +63,18 @@ enum RelsType
typeControlProps,
typeChartUserShapes
};
enum _rels_type_place
{
document_place,
endnote_place,
footnote_place,
comment_place,
header_footer_place,
chart_place
};
struct _rel
{
_rel(bool is_internal_, std::wstring const & rid_, std::wstring const & ref_, RelsType const & type_) :
_rel(bool is_internal_, std::wstring const & rid_, std::wstring const & ref_, _rels_type const & type_) :
is_internal(is_internal_),
rid(rid_),
ref(ref_),
@ -76,7 +84,7 @@ struct _rel
bool is_internal;
std::wstring rid;
std::wstring ref;
RelsType type;
_rels_type type;
};
class relationship : public xml::element_impl<relationship>

View File

@ -34,63 +34,81 @@
#include <boost/functional.hpp>
#include <CPOptional.h>
#include <xml/simple_xml_writer.h>
#include "../odf/odfcontext.h"
#include "../odf/style_text_properties.h"
namespace cpdoccore {
namespace oox {
void oox_title::oox_content_serialize(std::wostream & _Wostream, odf_reader::chart::title & content)
{
if (content_.content_.empty()) return;
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE(L"a:p")
{
CP_XML_NODE(L"a:pPr")
{
CP_XML_NODE(L"a:defRPr"){}
}
CP_XML_NODE(L"a:r")
{
//odf_reader::fonts_container & fonts = context.fontContainer();
odf_reader::fonts_container fonts;
if (content.text_properties_)
content.text_properties_->oox_serialize(CP_XML_STREAM(), true, fonts);
CP_XML_NODE(L"a:t")
{
CP_XML_CONTENT(content.content_);
}
}
}
}
}
void oox_title::oox_serialize(std::wostream & _Wostream)
{
if (content_.content_.length() < 1)
{
//возможен шаблон txPr
return;
}
if (!content_.bEnabled && !sub_.bEnabled) return;
CP_XML_WRITER(_Wostream)
{
CP_XML_NODE(L"c:title")
{
CP_XML_NODE(L"c:tx")
if (false == content_.content_.empty() || false == sub_.content_.empty())
{
CP_XML_NODE(L"c:rich")
CP_XML_NODE(L"c:tx")
{
CP_XML_NODE(L"c:rich")
{
CP_XML_NODE(L"a:bodyPr"){}
CP_XML_NODE(L"a:lstStyle"){}
oox_content_serialize(CP_XML_STREAM(), content_);
oox_content_serialize(CP_XML_STREAM(), sub_);
}
}
}
else if (content_.text_properties_)
{
CP_XML_NODE(L"c:txPr")
{
CP_XML_NODE(L"a:bodyPr"){}
CP_XML_NODE(L"a:lstStyle"){}
CP_XML_NODE(L"a:p")
{
CP_XML_NODE(L"a:pPr")
{
CP_XML_NODE(L"a:defRPr"){}
}
CP_XML_NODE(L"a:r")
{
CP_XML_NODE(L"a:rPr")
CP_XML_NODE(L"a:defRPr")
{
_CP_OPT(double) dVal;
_CP_OPT(std::wstring) sVal;
_CP_OPT(int) iVal;
if (odf_reader::GetProperty(content_.text_properties_,L"font-size",dVal))
CP_XML_ATTR(L"sz", (int)(dVal.get()*100));
if ((odf_reader::GetProperty(content_.text_properties_,L"font-style",iVal)) && (*iVal >0))
CP_XML_ATTR(L"i", "true");
if ((odf_reader::GetProperty(content_.text_properties_,L"font-weight",iVal)) && (*iVal >0))
CP_XML_ATTR(L"b", "true");
if (odf_reader::GetProperty(content_.text_properties_,L"font-color",sVal))
CP_XML_NODE(L"a:solidFill")
{
CP_XML_NODE(L"a:srgbClr"){CP_XML_ATTR(L"val", sVal.get());}
}
}
CP_XML_NODE(L"a:t")
{
CP_XML_CONTENT(content_.content_);
//odf_reader::fonts_container & fonts = context.fontContainer();
odf_reader::fonts_container fonts;
content_.text_properties_->oox_serialize(CP_XML_STREAM(), true, fonts);
}
}
}
}
}
}
layout_.oox_serialize(CP_XML_STREAM());
@ -98,8 +116,13 @@ void oox_title::oox_serialize(std::wostream & _Wostream)
{
CP_XML_ATTR(L"val", 0);
}
oox_chart_shape shape;
shape.set(content_.graphic_properties_, content_.fill_);
shape.oox_serialize(CP_XML_STREAM());
}
}
}
}
}

View File

@ -55,9 +55,17 @@ public:
{
content_ = t;
}
void set_sub_content(odf_reader::chart::title & t)
{
sub_ = t;
}
private:
void oox_content_serialize(std::wostream & _Wostream, odf_reader::chart::title & content);
cpdoccore::oox::oox_layout layout_;
odf_reader::chart::title content_;
odf_reader::chart::title sub_;
//extLst (Chart Extensibility) §21.2.2.64
//layout (Layout) §21.2.2.88

View File

@ -32,7 +32,6 @@
#include <xml/simple_xml_writer.h>
#include "oox_types_chart.h"
#include "oox_chart_shape.h"
namespace cpdoccore {
namespace oox {
@ -59,8 +58,9 @@ void oox_chart::set_name(const std::wstring& val)
}
void oox_chart::set_content_series(odf_reader::chart::series & content)
{
series_.back()->content_=content;
series_.back()->content_= content;
}
void oox_chart::set_values_series(int ind, std::vector<std::wstring> & val)
{
if (val.empty())return;
@ -467,7 +467,21 @@ void oox_stock_chart::set_properties(std::vector<odf_reader::_property> g)
oox_chart::set_properties(g);
odf_reader::GetProperty(g, L"japanese-candle-stick",bCandleStick);
odf_reader::GetProperty(g, L"japanese-candle-stick", bCandleStick);
}
void oox_stock_chart::set_stock_gain_marke(odf_reader::chart::simple & obj)
{
if (!obj.bEnabled) return;
}
void oox_stock_chart::set_stock_loss_marker(odf_reader::chart::simple & obj)
{
if (!obj.bEnabled) return;
}
void oox_stock_chart::set_stock_range_line(odf_reader::chart::simple & obj)
{
if (!obj.bEnabled) return;
range_line.set(obj.graphic_properties_, obj.fill_);
}
void oox_stock_chart::oox_serialize(std::wostream & _Wostream)
{
@ -480,10 +494,13 @@ void oox_stock_chart::oox_serialize(std::wostream & _Wostream)
{
oox_serialize_common(CP_XML_STREAM());
//CP_XML_NODE(L"c:hiLowLines")//hiLowLines (High Low Lines) §21.2.2.80
//{
// //shape.oox_serialize(CP_XML_STREAM());
//}
if (range_line.bEnabled)
{
CP_XML_NODE(L"c:hiLowLines")
{
range_line.oox_serialize(CP_XML_STREAM());
}
}
CP_XML_NODE(L"c:upDownBars")
{
CP_XML_NODE(L"c:gapWidth")

View File

@ -31,11 +31,9 @@
*/
#pragma once
#include <iosfwd>
#include <boost/noncopyable.hpp>
#include <CPScopedPtr.h>
#include <CPSharedPtr.h>
#include "oox_chart_shape.h"
#include "xlsx_color.h"
#include "oox_chart_series.h"
@ -84,6 +82,9 @@ public:
void set_name (const std::wstring& val);
void set_content_series (odf_reader::chart::series & content);
virtual void set_stock_gain_marke(odf_reader::chart::simple & obj){}
virtual void set_stock_loss_marker(odf_reader::chart::simple & obj){}
virtual void set_stock_range_line(odf_reader::chart::simple & obj){}
//void set_showBubbleSize(bool Val){data_labels_.set_showBubbleSize(Val);}
//void set_showCatName(bool Val){data_labels_.set_showCatName(Val);}
//void set_showLeaderLines(bool Val){data_labels_.set_showLeaderLines(Val);}
@ -349,6 +350,9 @@ class oox_stock_chart: public oox_chart
static _CP_PTR(oox_chart) create();
virtual void set_stock_gain_marke(odf_reader::chart::simple & obj);
virtual void set_stock_loss_marker(odf_reader::chart::simple & obj);
virtual void set_stock_range_line(odf_reader::chart::simple & obj);
_CP_OPT(bool) bCandleStick;
@ -357,6 +361,7 @@ class oox_stock_chart: public oox_chart
_oox_fill fill_;
oox_chart_shape range_line;
//dropLines (Drop Lines) §21.2.2.53
//hiLowLines (High Low Lines) §21.2.2.80
//ser (Line Chart Series) §21.2.2.171

View File

@ -208,7 +208,7 @@ void pptx_conversion_context::start_document()
instances.push_back(odfContext.styleContainer().style_default_by_type(odf_types::style_family::Presentation));
instances.push_back(odfContext.styleContainer().style_by_name(L"Default",odf_types::style_family::Presentation,false));
odf_reader::text_format_properties_content textFormatProperties = calc_text_properties_content(instances);
odf_reader::text_format_properties_content_ptr textFormatProperties = calc_text_properties_content(instances);
odf_reader::paragraph_format_properties parFormatProperties = calc_paragraph_properties_content(instances);
process_masters_ = false;

View File

@ -50,7 +50,7 @@ public:
bool isInternal,
std::wstring const & rid,
std::wstring const & ref,
RelsType type)
_rels_type type)
{
pptx_drawings_.push_back(d);
@ -79,7 +79,7 @@ public:
bool isInternal,
std::wstring const & rid,
std::wstring const & ref,
RelsType type)
_rels_type type)
{
bool present = false;
@ -153,7 +153,7 @@ void pptx_drawings::add(_pptx_drawing const & d,
bool isInternal,
std::wstring const & rid,
std::wstring const & ref,
RelsType type)
_rels_type type)
{
impl_->add(d, isInternal, rid, ref, type);
}
@ -161,7 +161,7 @@ void pptx_drawings::add(/**/
bool isInternal,
std::wstring const & rid,
std::wstring const & ref,
RelsType type)
_rels_type type)
{
impl_->add(isInternal, rid, ref, type);
}

View File

@ -56,13 +56,13 @@ public:
bool isInternal,
std::wstring const & rid,
std::wstring const & ref,
RelsType type
_rels_type type
);
void add(/**/
bool isInternal,
std::wstring const & rid,
std::wstring const & ref,
RelsType type
_rels_type type
);
bool empty() const;

View File

@ -82,11 +82,11 @@ public:
bool header, footer, date_time, slideNum;
void add_drawing(_pptx_drawing const & d, bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type)
void add_drawing(_pptx_drawing const & d, bool isInternal, std::wstring const & rid, std::wstring const & ref, _rels_type type)
{
pptx_drawings_->add(d, isInternal, rid, ref, type);
}
void add_additional_rels (bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type)
void add_additional_rels (bool isInternal, std::wstring const & rid, std::wstring const & ref, _rels_type type)
{
pptx_drawings_->add(isInternal, rid, ref, type);
}
@ -359,7 +359,7 @@ void pptx_slide_context::add_background(_oox_fill & fill)
bool isMediaInternal = false;
std::wstring ref;
fill.bitmap->rId = get_mediaitems()->add_or_find(fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
fill.bitmap->rId = get_mediaitems()->add_or_find(fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref, oox::document_place);
add_rels(isMediaInternal, fill.bitmap->rId, ref, typeImage);
}
impl_->background_fill_ = fill;
@ -413,7 +413,7 @@ void pptx_slide_context::start_action(std::wstring action)
impl_->object_description_.action_.highlightClick = true;
}
}
void pptx_slide_context::set_link(std::wstring link, RelsType typeRels)
void pptx_slide_context::set_link(std::wstring link, _rels_type typeRels)
{
++hlinks_size_;
@ -423,7 +423,7 @@ void pptx_slide_context::set_link(std::wstring link, RelsType typeRels)
{
bool isMediaInternal = true;
impl_->object_description_.action_.hSoundId = get_mediaitems()->add_or_find(link, typeAudio, isMediaInternal, impl_->object_description_.action_.hSoundRef);
impl_->object_description_.action_.hSoundId = get_mediaitems()->add_or_find(link, typeAudio, isMediaInternal, impl_->object_description_.action_.hSoundRef, oox::document_place);
impl_->add_additional_rels(isMediaInternal, impl_->object_description_.action_.hSoundId, impl_->object_description_.action_.hSoundRef, typeAudio);
}
else
@ -578,7 +578,7 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _p
std::wstring ref;/// это ссылка на выходной внешний объект
bool isMediaInternal = false;
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(obj.xlink_href_, typeImage, isMediaInternal, ref);
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(obj.xlink_href_, typeImage, isMediaInternal, ref, oox::document_place);
drawing.fill.bitmap->isInternal = isMediaInternal;
if (drawing.type == typeShape)
@ -586,7 +586,7 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _p
add_additional_rels(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);//собственно это не объект, а доп рел и ref объекта
isMediaInternal = true;
std::wstring rId = get_mediaitems()->add_or_find(L"", typeShape, isMediaInternal, ref);
std::wstring rId = get_mediaitems()->add_or_find(L"", typeShape, isMediaInternal, ref, oox::document_place);
add_drawing(drawing, isMediaInternal, rId, ref, typeShape);//объект
@ -601,7 +601,7 @@ void pptx_slide_context::Impl::process_chart(drawing_object_description & obj, _
std::wstring ref;
bool isMediaInternal = true;
drawing.objectId = get_mediaitems()->add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
drawing.objectId = get_mediaitems()->add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref, oox::document_place);
add_drawing(drawing, isMediaInternal, drawing.objectId, ref, drawing.type);
}
@ -610,7 +610,7 @@ void pptx_slide_context::Impl::process_table(drawing_object_description & obj, _
{
std::wstring ref;
bool isMediaInternal = true;
std::wstring rId = get_mediaitems()->add_or_find(L"", obj.type_, isMediaInternal, ref);
std::wstring rId = get_mediaitems()->add_or_find(L"", obj.type_, isMediaInternal, ref, oox::document_place);
add_drawing(drawing, isMediaInternal, rId, ref, drawing.type);
@ -625,12 +625,12 @@ void pptx_slide_context::Impl::process_shape(drawing_object_description & obj, _
if (drawing.fill.bitmap)
{
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref, oox::document_place);
add_additional_rels(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);
}
std::wstring rId = get_mediaitems()->add_or_find(L"", typeShape, isMediaInternal, ref);
std::wstring rId = get_mediaitems()->add_or_find(L"", typeShape, isMediaInternal, ref, oox::document_place);
////////////////////////////////////////////////////////////////
_CP_OPT(std::wstring) sPlaceHolderType;
@ -653,7 +653,7 @@ void pptx_slide_context::Impl::process_object(drawing_object_description& obj, _
std::wstring ref, ref_image;
bool isMediaInternal = true, isMediaInternal_image = true;
drawing.objectId = get_mediaitems()->add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
drawing.objectId = get_mediaitems()->add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref, oox::document_place);
drawing.objectProgId = obj.descriptor_;
if (!drawing.fill.bitmap)
@ -664,7 +664,7 @@ void pptx_slide_context::Impl::process_object(drawing_object_description& obj, _
_image_file_::GenerateZeroImage(odfPacket_ + FILE_SEPARATOR_STR + L"zero.png");
}
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal_image, ref_image);
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal_image, ref_image, oox::document_place);
add_additional_rels(isMediaInternal_image, drawing.fill.bitmap->rId, ref_image, typeImage);
add_drawing(drawing, isMediaInternal, drawing.objectId, ref, drawing.type);
@ -676,7 +676,7 @@ void pptx_slide_context::Impl::process_media(drawing_object_description& obj, _p
drawing.type = mediaitems::detectMediaType(obj.xlink_href_); //reset from Media to Audio, Video, ... QuickTime? AudioCD? ...
drawing.objectId = get_mediaitems()->add_or_find(obj.xlink_href_, drawing.type, isMediaInternal, ref);
drawing.objectId = get_mediaitems()->add_or_find(obj.xlink_href_, drawing.type, isMediaInternal, ref, oox::document_place);
drawing.extId = L"ext" + drawing.objectId;
drawing.extExternal = !isMediaInternal;
@ -687,7 +687,7 @@ void pptx_slide_context::Impl::process_media(drawing_object_description& obj, _p
_image_file_::GenerateZeroImage(odfPacket_ + FILE_SEPARATOR_STR + L"zero.png");
}
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal_image, ref_image);
drawing.fill.bitmap->rId = get_mediaitems()->add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal_image, ref_image, oox::document_place);
add_additional_rels(isMediaInternal_image, drawing.fill.bitmap->rId, ref_image, typeImage);
add_drawing(drawing, false, drawing.objectId, L"NULL", drawing.type);
@ -725,7 +725,7 @@ mediaitems_ptr & pptx_slide_context::get_mediaitems()
return impl_->get_mediaitems();
}
void pptx_slide_context::add_rels( bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type)
void pptx_slide_context::add_rels( bool isInternal, std::wstring const & rid, std::wstring const & ref, _rels_type type)
{
impl_->add_additional_rels(isInternal, rid, ref, type);
}

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