Compare commits

..

901 Commits

Author SHA1 Message Date
7c83535528 Merge branch hotfix/v7.0.1 into master 2022-02-22 08:13:32 +00:00
35a86586ab Merge pull request #849 from ONLYOFFICE/fix/bug-55460
Fix bug #55460
2022-02-15 11:51:25 +03:00
00fa7e7afe Fix bug #55460 2022-02-15 11:38:54 +03:00
dc574f6606 [x2t] For bug 55284 2022-02-06 13:02:42 +03:00
c886341ac1 Fix bug 53831 2022-02-04 15:03:06 +03:00
4a93c91011 Fix bug 47558 2022-01-28 11:39:25 +03:00
209a3874c8 Merge pull request #832 from ONLYOFFICE/fix/v7.0.1-fix-bugs
fix bug #55027
2022-01-21 15:34:22 +03:00
abc74e21d0 fix bug #55027 2022-01-21 15:33:26 +03:00
e78b399810 Merge pull request #830 from ONLYOFFICE/fix/v7.0-fix-bugs
Fix/v7.0 fix bugs
2022-01-19 11:39:52 +03:00
1f976ae79a Merge branch release/v7.0.0 into master 2022-01-17 14:18:57 +00:00
4b9da896ab fix bug #54485 2022-01-13 18:12:26 +03:00
6561216356 fix bug #54819 2022-01-11 19:10:16 +03:00
6d53f5745b [ios] Add NSDictionary and NSString extension 2021-12-16 18:02:27 +03:00
b3d9d4cc6e Merge pull request #806 from ONLYOFFICE/fix/v7-fix-bugs
Fix/v7 fix bugs
2021-12-16 17:25:28 +03:00
03b10cb446 fix bug 2021-12-16 17:24:37 +03:00
b87dad75fc fix bug #54521 2021-12-16 11:57:59 +03:00
0275791b2c fix bug #54461 2021-12-14 17:39:19 +03:00
a30e9ac37f fix bug #54492 2021-12-13 15:33:54 +03:00
cdc74ada43 Fix allfontsgen 2021-12-11 21:17:42 +03:00
74920d70b7 Merge pull request #804 from ONLYOFFICE/fix/v7.0.0-ppt
Fix/v7.0.0 ppt
2021-12-10 15:06:34 +03:00
5a2b693092 fix reset binary run props 2021-12-10 15:05:19 +03:00
e2bae2e187 fix bug #54461 2021-12-10 14:48:08 +03:00
2cd312f396 Fix bug 54475 (problem with opening locked file) 2021-12-10 11:12:27 +03:00
d796de176c fix part of bug 54124. Fix text bold 2021-12-09 21:04:08 +03:00
d44da46e1e fix shape text box a:bodyPr wrap=none 2021-12-09 19:57:06 +03:00
2e83d4e9c8 fix bug #54460 2021-12-09 12:39:05 +03:00
8293a06d40 Merge pull request #802 from ONLYOFFICE/fix/v7.0.0-ppt
Fix/v7.0.0 ppt
2021-12-09 11:11:51 +03:00
6b78d139ee fix bug #54384 2021-12-09 11:03:52 +03:00
51c33e0701 Merge pull request #801 from ONLYOFFICE/fix/v7.0.0-fix-bugs
Fix/v7.0.0 fix bugs
2021-12-08 20:06:03 +03:00
a707ded8b2 . 2021-12-08 20:05:06 +03:00
0756b8ff90 for bug #54311 2021-12-08 20:05:00 +03:00
a2d1a74e3d Add destroy method for pixels 2021-12-08 15:57:30 +03:00
840d679e49 fix bug #54124 2021-12-08 14:26:48 +03:00
22d4592a1a Add ASCW3 to picker font by character 2021-12-07 19:19:02 +03:00
446ef4d577 fix bug #54333 2021-12-07 18:21:51 +03:00
6e789e0697 Merge pull request #800 from ONLYOFFICE/fix/v7.0.0-ppt
Fix/v7.0.0 ppt
2021-12-07 09:45:48 +03:00
fc2cb5f533 fix bug #54200 2021-12-04 13:00:17 +03:00
5388697b0c Fix bug 54322 2021-12-03 18:26:15 +03:00
82909e892f fix bug #53541 2021-12-02 23:27:42 +03:00
941b9d0ec1 Merge pull request #798 from ONLYOFFICE/fix/v7.0.0-fix-bugs
Fix/v7.0.0 fix bugs
2021-12-02 19:58:16 +03:00
136d123ba2 fix bug #52412 2021-12-02 19:56:30 +03:00
c036733ff8 fix bug #54187 2021-12-02 19:21:24 +03:00
9ac1a088b5 Fix pick font by name 2021-12-02 18:26:40 +03:00
a29d7cb8b3 Merge pull request #797 from ONLYOFFICE/fix/v7.0.0-ppt
Fix/v7.0.0 ppt
2021-12-02 10:05:51 +03:00
8264f89be2 Fix bug #53273
Fix the problem with saving MaxLen parameter of a text form in case of several forms with the same key
2021-12-02 10:00:53 +03:00
98f7b9d647 Fix bug #54088
Fix the problem with writing strings encoded with UTF-16
2021-12-02 10:00:53 +03:00
711d0017df Fix bug #53616
Fix the problem with bold and italic fonts
2021-12-02 10:00:53 +03:00
6bf0f0faf3 Fix bug #54168
Rework font substitution based on font embedding restrictions
2021-12-02 10:00:53 +03:00
021f9f64b4 For bug #54170
Fix the problem with writing shade color of a form. Also fix the problem with ExtGState counter
2021-12-02 10:00:53 +03:00
925979c534 trying to fix 53541. Add tag a:lum. No exists ppt struct 2021-12-01 19:44:18 +03:00
b9c53b877c Merge pull request #795 from ONLYOFFICE/fix/v7.0.0-fix-bugs
fix bug #54270
2021-12-01 19:39:21 +03:00
a081b37d6d fix bug #54270 2021-12-01 19:38:16 +03:00
01107f5a07 Fix bug 53947 2021-12-01 16:49:47 +03:00
72a48b656f Merge pull request #794 from ONLYOFFICE/fix/v7.0.0-fix-bugs
Fix/v7.0.0 fix bugs
2021-12-01 10:45:01 +03:00
9834392df8 fix bug #54186 2021-12-01 10:44:04 +03:00
3428df7bac fix bug #52780 2021-11-30 19:40:00 +03:00
d71477e8a3 fix bug #54184 2021-11-30 17:49:51 +03:00
c100d54aa5 fix bug #54187 2021-11-30 16:28:13 +03:00
cb0360008b Merge pull request #793 from ONLYOFFICE/fix/v7.0.0-ppt
fix bug #54197
2021-11-30 10:29:05 +03:00
bf78be5e81 Merge pull request #792 from ONLYOFFICE/fix/v7.0.0-fix-bugs
fix bug #54161
2021-11-29 18:40:45 +03:00
ba1a0f7763 fix bug #54161 2021-11-29 18:39:04 +03:00
f77fe887ae fix bug #54197 2021-11-29 16:07:11 +03:00
57e5fea9cc [x2t] Add AVS_FILEUTILS_ERROR_CONVERT_DRM_UNSUPPORTED type for bug 54148 2021-11-28 19:34:37 +03:00
046e0f7710 [x2t] Fix saving to docxf 2021-11-28 19:34:37 +03:00
3dba3a4d06 Merge pull request #789 from ONLYOFFICE/fix.v7.0.0-fix-bugs2
fix bug #54148
2021-11-27 11:39:43 +03:00
2b78a8b617 fix bug #54148
fix ppt project
2021-11-27 11:38:55 +03:00
c73bd8b904 Merge pull request #788 from ONLYOFFICE/fix/v7.0.0-ppt
Fix/v7.0.0 ppt
2021-11-27 10:35:58 +03:00
92d8d9ad05 fix bug #54031 2021-11-26 15:04:41 +03:00
9ce86699ed Merge branch 'fix/v7.0.0-ppt' of https://github.com/ONLYOFFICE/core into fix/v7.0.0-ppt 2021-11-26 13:39:46 +03:00
c051240cd4 fix bug #54032 2021-11-26 13:39:08 +03:00
978d80e198 Fix reading strings in pdf to xml conversion 2021-11-26 11:00:10 +03:00
23c427495b Merge pull request #787 from ONLYOFFICE/fix/v7.0.0-fix-bugs
Fix/v7.0.0 fix bugs
2021-11-25 22:21:00 +03:00
cac9293d87 fix bug #54116 2021-11-25 22:20:08 +03:00
137d757631 Merge pull request #786 from ONLYOFFICE/fix_bug_54053
[android] Fix bug 54053
2021-11-25 17:20:08 +03:00
06052da308 [android] Fix bug 54053 2021-11-25 16:37:57 +03:00
9cd8cb0662 fix bug #53305 2021-11-25 13:21:57 +03:00
f76bf0cee1 add buBlip. bullet as image 2021-11-24 18:41:17 +03:00
c8ef152d08 Merge pull request #785 from ONLYOFFICE/fix/v7.0.0-fix-bugs
fix bug #53908
2021-11-24 18:29:06 +03:00
b058f017e0 fix bug #53908
docxf
2021-11-24 18:28:20 +03:00
0ffc7ef04c add ConvertExtention9() for buBlip 2021-11-23 23:25:13 +03:00
853b22bf73 Merge pull request #784 from ONLYOFFICE/fix/v7.0.0-fix-bugs
fix bug #53873
2021-11-23 12:45:54 +03:00
93ed14aba2 fix bug #53873 2021-11-23 12:43:58 +03:00
f5e4369384 Fix build 2021-11-23 12:03:47 +03:00
9e6b88c920 Fix build mobile target 2021-11-23 10:41:33 +03:00
2a9ffc41b5 Find new substitution font if the specified font is restricted for embedding 2021-11-21 20:06:33 +03:00
cb84378637 Fix bug #53629
Forbid to embed fonts that are limited by license
2021-11-21 17:13:56 +03:00
9c05b99951 Refactoring fonts_selection.bin generation 2021-11-21 15:59:42 +03:00
cad1004d28 Read file without write rights if not needed 2021-11-19 23:33:14 +03:00
70dbebf727 Merge pull request #780 from ONLYOFFICE/fix/v7.0.0-fix-bugs
for bug #53888
2021-11-19 17:45:36 +03:00
d5087108d0 for bug #53888 2021-11-19 16:19:20 +03:00
29822ad719 Merge pull request #779 from ONLYOFFICE/fix/v7.0.0-fix-bugs
Fix/v7.0.0 fix bugs
2021-11-19 14:26:22 +03:00
b47c766b24 fix bug #53873 2021-11-19 14:25:46 +03:00
67bb9f18e6 fix bug #53877 2021-11-19 13:59:57 +03:00
c81c98f524 Merge pull request #778 from ONLYOFFICE/fix/v7.0.0-fix-bugs
Fix/v7.0.0 fix bugs
2021-11-18 19:45:35 +03:00
06079aa022 fix bug #53873 2021-11-18 19:44:23 +03:00
1e66105813 fix bug #53875 2021-11-18 18:13:57 +03:00
03dec3dcf6 fix bug #53813 2021-11-18 17:22:09 +03:00
560b07f3ca oform 2021-11-18 15:25:25 +03:00
3ca8446729 Merge branch 'fix/v7.0.0-ppt' of https://github.com/ONLYOFFICE/core into fix/v7.0.0-ppt 2021-11-17 22:56:10 +03:00
aad0ec464f trying to add blip bullet to fix numbering 2021-11-17 22:54:07 +03:00
89a8a1d62a Fix build with new qmake 2021-11-17 19:40:56 +03:00
3219de14ee Merge pull request #776 from ONLYOFFICE/fix/v7.0.0-ppt
Fix/v7.0.0 ppt
2021-11-17 10:26:37 +03:00
8906ea6707 . 2021-11-17 10:21:43 +03:00
d8e9b2d2b4 fix bug #53690 2021-11-16 20:27:38 +03:00
15ccea0306 Merge pull request #775 from ONLYOFFICE/fix/v7.0.0-fix-bugs
fix bug #53582
2021-11-16 19:39:54 +03:00
d1f99b7018 Refactoring 2021-11-16 19:39:39 +03:00
1a3191216a fix bug #53582 2021-11-16 19:32:42 +03:00
6f447ee939 Support relative paths to fonts in font_selection.bin 2021-11-16 19:31:26 +03:00
7414003d86 Merge pull request #774 from ONLYOFFICE/fix/v7.0.0-fix-bugs
fix bug #53499
2021-11-15 20:02:15 +03:00
b5d2b40acb fix bug #53499 2021-11-15 20:01:15 +03:00
b18a789e99 Merge pull request #773 from ONLYOFFICE/fix/v7.0.0-ppt
fix bug #53086
2021-11-15 17:38:06 +03:00
8e67aa129e fix bug #53086 2021-11-15 17:35:07 +03:00
e447369665 Merge pull request #772 from ONLYOFFICE/fix/v7.0.0-fix-bugs
fix bug #53539
2021-11-15 16:24:13 +03:00
1e8e50e0a8 fix bug #53539 2021-11-15 16:14:21 +03:00
dc84658b7f Merge pull request #771 from ONLYOFFICE/fix/v7.0.0-fix-bugs
fix bug #53582
2021-11-15 14:57:47 +03:00
74bbbfd0e9 Refactoring gitignore 2021-11-13 20:13:39 +03:00
47e72c2210 Rename module & fix bugs 2021-11-12 18:19:45 +03:00
81db77330f Merge pull request #769 from ONLYOFFICE/fix/v7.0.0-ppt
fix bug #53666
2021-11-12 17:17:09 +03:00
e68e8ba644 fix bug #53666 2021-11-12 16:16:31 +03:00
cfa3ad151e Refactoring hash method 2021-11-12 12:55:38 +03:00
d0e5d86243 Fix bug 53586 2021-11-11 19:43:33 +03:00
27a93dc070 Merge pull request #767 from ONLYOFFICE/fix/v7.0.0-ppt
Fix/v7.0.0 ppt
2021-11-11 10:29:05 +03:00
069a9f3d3a fix bug #53538. 2021-11-10 22:36:36 +03:00
56cfa9d57d fix part of 53538. Text replaces to '_' 2021-11-10 20:20:58 +03:00
e475ed88fa fix bug #53582 2021-11-10 11:58:26 +03:00
f1271da9aa Merge pull request #766 from ONLYOFFICE/fix/v7.0.0-ppt
fix bug #53591. Some text has broken yet. But crush fixed
2021-11-10 10:02:15 +03:00
f9cfdd85ca fix bug #53591. Some text has broken yet. But crush fixed 2021-11-09 21:41:41 +03:00
c8e5debf80 Add GetLimitsY method to fontmanager 2021-11-09 12:25:26 +03:00
c8eb931b92 Add missed define 2021-11-08 20:14:08 +03:00
9ed41ccb67 Fix bug #53544
Handle placeholders for text fields in case when several fields have the same key
2021-11-08 20:11:03 +03:00
05f0c63e40 Fix bug #53518
Fix the problem with writing placeholders
2021-11-08 20:11:03 +03:00
f5c80ed236 Fix bug #53222
Fully rework writing the text value of the form fields in PDF
2021-11-08 20:11:03 +03:00
f9f0a7896f Merge pull request #764 from ONLYOFFICE/fix/v7.0.0-ppt
fix win build
2021-11-08 18:30:10 +03:00
56a0d29f10 fix win build 2021-11-08 18:28:56 +03:00
eecf99373f Merge pull request #762 from ONLYOFFICE/fix/v7.0.0-ppt
Fix/v7.0.0 ppt
2021-11-08 18:10:11 +03:00
ef970a6009 Merge remote-tracking branch 'origin/feature/ppt_7' into fix/v7.0.0-ppt 2021-11-08 18:08:57 +03:00
bd0feeadeb Merge pull request #761 from ONLYOFFICE/fix/v7.0.0-fix-bugs
Fix/v7.0.0 fix bugs
2021-11-08 17:45:05 +03:00
eeb982cb64 fix bug #53555 2021-11-08 17:44:00 +03:00
7c380c7bae fix bug #53552 2021-11-08 13:34:38 +03:00
baa03b2bfa Fix memory leak 2021-11-06 09:43:23 +03:00
90609cc515 trying to fix 52374. a:rPr corrected 2021-11-03 19:23:46 +03:00
d5da22e62b [android] Add formats 2021-11-03 17:24:02 +03:00
fc612032fd Fix bug 52637 2021-11-03 10:52:37 +03:00
dd1757e777 fix part of 52374. Animation tav tm problem and empty last conds 2021-11-02 21:35:21 +03:00
140802ac66 Merge pull request #760 from ONLYOFFICE/fix/v7.0.0-fix-bugs
Fix/v7.0.0 fix bugs
2021-11-02 17:02:52 +03:00
a6b459923e fix bug #53379 2021-11-02 17:01:44 +03:00
b86f0cc869 for bug #53435 2021-11-02 16:45:49 +03:00
c82c994184 fix bug #53435 2021-11-02 12:04:38 +03:00
06f3e4562a For bug #53323
Remove additional space for drop-down list button, because it causes layout problems for right-aligned drop-down lists
2021-11-02 11:50:40 +03:00
68e99604f7 Merge pull request #758 from ONLYOFFICE/fix/v7.0.0-fix-bugs
fix bug #53400
2021-11-02 11:44:07 +03:00
17ec7bc611 fix bug #53400 2021-11-02 11:42:57 +03:00
85cfd2bf70 fix part of 52374. It was added second chance to convert of animation. 2021-11-01 22:01:30 +03:00
904eece17a Add GetFontBySymbol method to interface IApplicationFonts 2021-11-01 19:52:04 +03:00
ab1bd76a48 Fix bug #53270
Fix the problem with images form when saving to PDF
2021-10-31 23:29:12 +03:00
2746b35e12 Fix the problem with placeholders for text fields with specified maxCharacters parameter 2021-10-31 23:29:12 +03:00
6b755c03d3 Fix the problem with drawing border around text form
Also fix the problem with calculating the position of glyphs for text form with comb option enabled
2021-10-31 23:29:12 +03:00
4d9c7a4c01 Implement horizontal text align for text forms with com option enabled 2021-10-31 23:29:12 +03:00
5d7042746f Fix bug #53245
Fix the problem with rendering text fields to PDF with comb option enabled
2021-10-31 23:29:12 +03:00
f583be5ee4 Fix bug #53227
Add ability to set a placeholder for text forms, combo boxes and drop down lists
2021-10-31 23:29:12 +03:00
0870527a82 Implement ability to set a placeholder for comboxes and dropdown lists 2021-10-31 23:29:12 +03:00
ac70b849ca Implement ability to set placeholder text for text forms 2021-10-31 23:29:12 +03:00
4f529461f5 Worker version 2021-10-31 20:52:40 +03:00
ed261400d1 Fix typo 2021-10-31 15:04:27 +03:00
0ef7b83ec9 Add native support hash method for office 2021-10-31 14:55:13 +03:00
1c91c72039 Fix ios build 2021-10-30 11:59:49 +03:00
ba9423c5ff Add project for hash.js module 2021-10-29 16:42:19 +03:00
a2b318f6fb Merge pull request #754 from ONLYOFFICE/fix/v.7.0.0-fix-bugs
Fix/v.7.0.0 fix bugs
2021-10-29 16:17:55 +03:00
2bcaff66bf for bug #53395 2021-10-28 16:55:36 +03:00
0f2e6a251e fix part of #52374. Correct text and trying to fix nodeType 2021-10-27 22:40:01 +03:00
3267e7e0fc Fix android build 2021-10-27 21:44:26 +03:00
be358da524 fix bug #53304 2021-10-27 16:10:41 +03:00
8044c5157c fix bug #53379 2021-10-27 14:49:03 +03:00
7a05534142 fix part of #52374 2021-10-26 22:37:23 +03:00
537fbfb5e8 fix part of 52374. cahrset == 128 problem. 2021-10-25 19:36:13 +03:00
a42d8eb10a [android] Fix library name 2021-10-25 15:31:13 +03:00
0c4f285410 Merge pull request #753 from ONLYOFFICE/android_build
[android] Fix android build
2021-10-25 12:43:18 +03:00
dece8bdcba Fix ios build 2021-10-23 14:55:14 +03:00
6eedc2a2f9 [android] Fix android build 2021-10-23 12:25:37 +03:00
044e501b69 fix #52749 2021-10-22 19:26:19 +03:00
5d2b5c92d5 Fix ios build with new clang 2021-10-22 17:32:20 +03:00
29a65be954 fix bug #53032 2021-10-22 15:15:13 +03:00
0e4f194269 Fix ios build 2021-10-22 12:03:17 +03:00
8fe6e1ce23 for bug 53032 2021-10-22 10:13:57 +03:00
65076f0a5e Refactoring .pro file 2021-10-21 23:29:10 +03:00
eeb325b8ad Fix typo 2021-10-21 23:14:20 +03:00
7c836c61a0 Fix build 2021-10-21 23:06:08 +03:00
2dea9f2096 Fix curl command 2021-10-21 21:36:15 +03:00
c0d4bcd16a Fix build without terminal colors 2021-10-21 21:18:07 +03:00
53f766271f fix bug #53233 2021-10-21 13:52:28 +03:00
9db42c3494 trying to fix 52749 2021-10-20 18:43:08 +03:00
2a32233d13 fix #52046 2021-10-20 11:40:27 +03:00
ec9e3d098f Merge pull request #752 from ONLYOFFICE/fix/v7.0.0-fix-bugs2
fix bug #53032
2021-10-20 10:37:39 +03:00
e65851ef3b fix bug #53032 2021-10-20 10:36:36 +03:00
f5837dcf44 Fix build android 2021-10-20 09:54:16 +03:00
40dba648f1 add media inside RoundTripMasters 2021-10-19 23:10:12 +03:00
b9fd01d632 Fix build 2021-10-19 20:55:09 +03:00
f15b5cd463 Merge pull request #750 from ONLYOFFICE/fix/v7.0.0-fix-bugs2
for bug #52781
2021-10-19 20:14:55 +03:00
efde950a11 for bug #52781 2021-10-19 20:13:58 +03:00
5c61f9e6f1 trying to fix 52046 2021-10-19 18:39:29 +03:00
c1fd29423c fix slideMasters. Now we can convert presentation as before. Layouts are old. 2021-10-18 18:40:11 +03:00
de9f4a9814 remove RoundTrips layout. Trying to repair presentation 2021-10-15 22:50:32 +03:00
87d864527b Implement filled picture forms 2021-10-15 22:44:55 +03:00
a862facf6a Add ability to save picture value to picture forms
Also improve writing appearance of picture form in PDF
2021-10-15 22:44:55 +03:00
11291cba06 Handle autofit for multilined forms in PDF 2021-10-15 22:44:55 +03:00
b881f02a02 Handle align to center and right side for multiline forms
Also fix the problem with vertical shift and spacing between lines for multiline forms for better compatibility with AdobeReader
2021-10-15 22:44:55 +03:00
4385caa969 First variant of calculating line breaks for multiline form 2021-10-15 22:44:55 +03:00
087594e557 Handle horizontal align for text forms when saving to PDF 2021-10-15 22:44:55 +03:00
133a05542f Fix problem with non initialized text align in the forms
Also fix saving picture forms for now AdobeReader shows special picture sign
2021-10-15 22:44:55 +03:00
3703cde00a Rework writing parameters of a TrueType font 2021-10-15 22:44:55 +03:00
903ae550d0 Implement new parameters and work around checkboxes 2021-10-15 22:44:55 +03:00
bb31a9733a Fix problems with RadioButtons 2021-10-15 22:44:55 +03:00
42b4cdf733 Work on checkboxes 2021-10-15 22:44:55 +03:00
55b2fff256 Rework writing default appearances 2021-10-15 22:44:55 +03:00
36bb26c9fe Add ability to write non-cid True Type font
Also move field resources to AcroForm record
2021-10-15 22:44:55 +03:00
6285a59b43 Rework saving field with the same field name in PDF 2021-10-15 22:44:55 +03:00
2e28ca5550 delete some old file. Ready for removing roundtrips layouts 2021-10-15 18:27:19 +03:00
a9a7dce495 Merge pull request #748 from ONLYOFFICE/fix/v.7.0.0-fix-bugs
fix bug #53116
2021-10-14 12:38:52 +03:00
fd0b734a2b fix bug #53116 2021-10-14 12:00:51 +03:00
3d18db25e3 Merge pull request #747 from ONLYOFFICE/gradle_7
[android] Migrate to gradle 7
2021-10-14 11:52:26 +03:00
dae7dac2d5 Merge pull request #746 from ONLYOFFICE/fix/3thparty-gitignore
Add to ignore downloaded sources of curl and openssl projects
2021-10-14 11:06:18 +03:00
a519bcf0c4 Add to ignore downloaded sources of curl and openssl projects 2021-10-14 11:05:11 +03:00
14c0a2a7c0 add Round Trip Notes masters 2021-10-13 21:36:20 +03:00
06f6278e59 Merge pull request #745 from ONLYOFFICE/fix/v.7.0.0-fix-bugs
Fix/v.7.0.0 fix bugs
2021-10-13 19:30:21 +03:00
77b206a62c for bug #52767 2021-10-13 19:29:15 +03:00
74359e39a8 Merge branch 'fix/v6.5.0-fix-bugs' into fix/v.7.0.0-fix-bugs 2021-10-13 10:36:21 +03:00
531b4ba0dc [x2t] Fix conversion to oform 2021-10-13 00:24:59 +03:00
d003dd8310 add master and clrMap RoundTrips. Correct handout and layouts 2021-10-12 22:50:33 +03:00
c58817fc18 add base slideMasters 2021-10-11 22:42:17 +03:00
0c1c2b4c2e for bug #37564 2021-10-11 12:54:28 +03:00
8008ff2e29 fix bug #44721 2021-10-11 11:20:53 +03:00
24acbd309a return to classic write theme. Add layouts and their _rels 2021-10-08 18:38:02 +03:00
23f7029703 Merge pull request #740 from ONLYOFFICE/fix/v6.5.0-fix-bugs
Fix/v6.5.0 fix bugs
2021-10-08 08:51:53 +03:00
8c212908bd fix bug #52560 2021-10-07 19:08:05 +03:00
19420e98d4 fix bug #53001 2021-10-07 14:04:25 +03:00
fe50098db7 Trying to use pptx classes 2021-10-06 23:15:41 +03:00
37a554f1f9 fix bug #52978 2021-10-06 16:54:00 +03:00
fbd9eba8bd Write all RoundTripThemes. It was already before, but now it with new classes 2021-10-06 13:35:23 +03:00
272a270bc8 Merge remote-tracking branch 'origin/master' into release/v6.5.0 2021-10-01 14:46:00 +03:00
ffdb21583e Merge pull request #738 from ONLYOFFICE/fix/v6.5.0-fix-bugs
add lcid for xls(sheet)
2021-09-30 17:00:34 +03:00
9bce904409 add lcid for xls(sheet) 2021-09-30 16:58:44 +03:00
c5c78fce18 Merge pull request #737 from ONLYOFFICE/fix/v6.5.0-fix-bugs
xlsx_flat convert
2021-09-30 15:14:32 +03:00
0e6e32d4da Merge branch hotfix/v6.4.1 into release/v6.5.0 2021-09-30 12:13:49 +00:00
0c29e4d08e Merge branch hotfix/v6.4.1 into master 2021-09-30 12:13:32 +00:00
16238f5e80 xlsx flat convert 2021-09-30 14:59:12 +03:00
9d520219ae Merge pull request #733 from ONLYOFFICE/fix/v6.5.0-fix-bugs
fix bug #52754
2021-09-30 14:37:56 +03:00
9e342b93cf fix bug #52754
convert xmlSpreadsheet20003->xlsx without bin_t
add cell horizontal aligment center_continuous
2021-09-30 14:36:24 +03:00
be1d417639 [x2t] Fix docm->dotm conversion 2021-09-29 23:16:35 +03:00
9acd562c20 Merge pull request #731 from ONLYOFFICE/fix/v6.5.0-fix-bugs
.
2021-09-29 09:57:04 +03:00
17126e2f6a . 2021-09-29 09:54:21 +03:00
c36a6d8ce2 Merge pull request #730 from ONLYOFFICE/fix/v6.5.0-fix-bugs
fix bug #52767
2021-09-28 20:21:33 +03:00
3fd3940119 fix bug #52767
add format xls sheet
2021-09-28 20:20:32 +03:00
e7ab7b1558 Fix bug with GetProperty method (#725)
Co-authored-by: Oleg Korshul <Oleg.Korshul@onlyoffice.com>
2021-09-28 12:09:47 +03:00
38a2f8535f Merge pull request #727 from ONLYOFFICE/fix/v6.5.0-fix-bugs
oform
2021-09-28 11:33:53 +03:00
e310954222 oform 2021-09-28 11:32:38 +03:00
a7b7484cdf Merge branch hotfix/v6.4.1 into master 2021-09-28 08:01:21 +00:00
d1488f6a0a Merge pull request #724 from ONLYOFFICE/fix/v6.5.0-fix-bugs-ppt
disable RoundTripTheme
2021-09-27 21:08:32 +03:00
497b201dc1 new theme from master RoundTrip 2021-09-27 18:38:54 +03:00
2440bf68a5 correct some not ziped RoundTrips 2021-09-27 16:35:20 +03:00
288b0dcb90 Fix bug with GetProperty method 2021-09-26 16:39:43 +03:00
94059919d7 special RoundTrip commit for saving zip 2021-09-24 17:02:19 +03:00
65c35b9af7 Implement background color for forms in PDF
Also implement new parameters for text forms and picture forms in PDF
2021-09-24 14:17:16 +03:00
bee3ff541a Rework PDFWriter on new CFieldInfo class 2021-09-24 14:17:16 +03:00
9b64445e3e Rework CFormFieldInfo class and add new parameters 2021-09-24 14:17:16 +03:00
00802528e5 Update for PDFWriter 2021-09-24 14:17:16 +03:00
e4c1384bbd Add empty functions for future work on field keys 2021-09-24 14:17:16 +03:00
817b90418f Implement AutoFit option when saving form to PDF 2021-09-24 14:17:16 +03:00
ba57308120 disable RoundTripTheme 2021-09-24 11:50:31 +03:00
df6fb494be Merge pull request #719 from ONLYOFFICE/fix/v6.5.0-fix-bugs3
Fix/v6.5.0 fix bugs3
2021-09-23 18:06:27 +03:00
931e19048b fix bug #52688 2021-09-23 18:02:43 +03:00
f5fb1cd5a7 Special version with writting RoundTrips to custom folder 2021-09-22 23:33:48 +03:00
63f6e16664 Add RoundTripExtractor 2021-09-22 17:23:20 +03:00
709360930a fix . 2021-09-22 17:17:34 +03:00
6c2b1bf1a9 fix bug #52667 2021-09-22 16:14:58 +03:00
a705625321 All RoundTrips were rewritten 2021-09-22 14:26:10 +03:00
bf75cfab48 add RoundTrip records 2021-09-22 12:06:13 +03:00
3bfb4d4f29 rewrite WriteRoundTripSlideMasters, but without _rels 2021-09-22 00:12:53 +03:00
d4fd9314bc Merge branch 'feature/ppt_7' of https://github.com/ONLYOFFICE/core into feature/ppt_7 2021-09-21 20:39:28 +03:00
0937f5ef8f Trying to add RoundTrip slideMasters 2021-09-21 18:40:54 +03:00
d2a3c8b139 Correct writting RoundTrip theme. Rewritting... 2021-09-21 15:30:51 +03:00
39765a5a61 Collect all RoundTrip for themes. Rewritting... 2021-09-21 14:41:23 +03:00
b75eeaefe6 Merge pull request #718 from ONLYOFFICE/fix/v6.5.0-fix-bugs-ppt
Fix/v6.5.0 fix bugs ppt
2021-09-21 09:22:25 +03:00
ff0f86b4ba Merge branch 'feature/ppt_7' of https://github.com/ONLYOFFICE/core into feature/ppt_7 2021-09-20 19:51:30 +03:00
83feb20265 Special version with ppt record's tree 2021-09-20 18:34:48 +03:00
07711ba4d1 Merge branch 'fix/v6.5.0-fix-bugs-ppt' into feature/ppt_7 2021-09-20 12:14:53 +03:00
1d1054d762 Merge remote-tracking branch 'origin/fix/v6.5.0-fix-bugs-ppt' into feature/ppt_7 2021-09-17 12:59:52 +03:00
a0ebe7acb3 Merge remote-tracking branch 'origin/hotfix/v6.4.1' into release/v6.5.0 2021-09-17 11:45:17 +03:00
154f9691a3 [android] Clean code 2021-09-17 10:14:52 +03:00
88741b4e82 Merge pull request #717 from ONLYOFFICE/fix/v6.4.1-fix-bugs2
Fix/v6.4.1 fix bugs2
2021-09-16 19:09:37 +03:00
76f94eaacc fix bug #52607 2021-09-16 19:08:03 +03:00
c886e0da68 for bug #52560 - restore all pages 2021-09-16 18:43:59 +03:00
996b85951d [android][all] Migrate version gradle plugin to 7 2021-09-16 18:39:23 +03:00
4ee53a3e27 Merge pull request #716 from ONLYOFFICE/fix/native-order
Fixed order constants for native editors
2021-09-16 14:29:02 +03:00
22943dcf0b Fixed order constants for native editors 2021-09-16 14:28:12 +03:00
2ace756da4 Merge pull request #715 from ONLYOFFICE/fix/v6.5.0-fix-bugs1
fix bug #52422
2021-09-16 14:17:40 +03:00
d964cb3d37 fix bug #52422 2021-09-16 14:16:24 +03:00
d1ac7c9e34 add roundTrip Layout 2021-09-15 17:21:58 +03:00
9267fc8aeb Merge branch 'fix/v6.5.0-fix-bugs-ppt' of https://github.com/ONLYOFFICE/core into fix/v6.5.0-fix-bugs-ppt 2021-09-15 10:41:46 +03:00
1fcc07708b Revert "Correct RoundTrip theme.xml for Note and Handout"
This reverts commit b451472ba3.
2021-09-15 10:41:30 +03:00
63ff79af7f Update Readme.md (#713) 2021-09-14 17:41:30 +03:00
10d2e2c960 Merge pull request #714 from ONLYOFFICE/fix/v6.4.1-fix-bugs2
Fix/v6.4.1 fix bugs2
2021-09-14 17:23:47 +03:00
2da99edbd6 fix bug #52395 2021-09-14 17:18:07 +03:00
fb5c459e05 Starting roundTrip Layout 2021-09-14 16:38:28 +03:00
c5d85bc2b9 Correct and rewrite roundTrip theme 2021-09-14 16:23:34 +03:00
836b6a638b bix bugs 2021-09-14 15:17:23 +03:00
ea59351da8 Fix bug 51756 2021-09-13 19:43:19 +03:00
64bb70bbef Fix signatures 2021-09-13 18:20:25 +03:00
b451472ba3 Correct RoundTrip theme.xml for Note and Handout 2021-09-13 17:32:46 +03:00
0a702d44e4 replace grepPaths() to PPT Converter.h/cpp 2021-09-13 12:41:50 +03:00
ca8b6d9c5c Fix build with v8 8.7 version 2021-09-13 10:08:28 +03:00
14f0249708 rewrite grepPaths() std -> boost 2021-09-10 18:15:52 +03:00
f6e6fb28ef Fix bug 49156 2021-09-09 23:22:01 +03:00
cd82eb40b6 Add oxps files support 2021-09-09 19:26:36 +03:00
4813f1d07a Removed unnecessary theme/_rels/ 2021-09-08 15:17:28 +03:00
771c813936 Fix bug 52397 2021-09-08 10:16:46 +03:00
9728a2277b correct RoundTripTheme layouts 2021-09-07 18:44:31 +03:00
a4245ef832 Fix bugs with regenerate thumbnails 2021-09-07 16:31:55 +03:00
06136ddd0d Sort fonts by name 2021-09-07 15:59:04 +03:00
390a568555 Merge pull request #712 from ONLYOFFICE/fix/eaFonts
Fix/ea fonts
2021-09-06 20:26:03 +03:00
8d098d9951 Refactoring AllFontsGen (start using CApplicationFontsWorker) 2021-09-06 20:25:12 +03:00
35bd761c9c Merge pull request #711 from ONLYOFFICE/fix/v6.5.0-fix-bugs
Fix/v6.5.0 fix bugs
2021-09-06 17:35:20 +03:00
78bc7afa13 Merge remote-tracking branch 'origin/fix/v6.4.1-fix-bugs2' into fix/v6.5.0-fix-bugs 2021-09-06 17:33:26 +03:00
8742086a0a fix bug #52344 2021-09-06 17:32:41 +03:00
98a8a865fe Refactoring 2021-09-06 09:10:44 +03:00
10348a72f1 Fonts thumbnail for ea 2021-09-05 15:21:18 +03:00
30264e12d1 Merge pull request #710 from ONLYOFFICE/fix/v6.5.0-fix-bugs
.
2021-09-03 17:29:16 +03:00
3c19d5e26e . 2021-09-03 17:26:35 +03:00
7b0b4b9cd9 Merge pull request #709 from ONLYOFFICE/fix/v6.5.0-fix-bugs
fix merge
2021-09-03 17:17:40 +03:00
9ba942e3a1 fix merge 2021-09-03 17:16:09 +03:00
84b3883a1f Merge remote-tracking branch 'origin/hotfix/v6.4.1' into release/v6.5.0 2021-09-03 17:02:35 +03:00
8c726e475a Fix bug 52097 2021-09-03 16:35:56 +03:00
334c31fcda Fix bug 52291 2021-09-03 13:24:16 +03:00
70db061853 Merge pull request #708 from ONLYOFFICE/fix/v6.4.1-fix-bugs
fix open xlsx protect
2021-09-03 09:47:11 +03:00
e6cb6d9438 Add new method to BaseThread (DestroyOnFinish) 2021-09-02 16:27:22 +03:00
973e263b46 fix open xlsx protect 2021-09-01 11:02:23 +03:00
53b55326be Merge remote-tracking branch 'origin/hotfix/v6.4.1' into develop 2021-09-01 07:59:02 +03:00
6530ff95db Merge pull request #707 from ONLYOFFICE/fix/v6.4.1-fix-bugs
fix bad temp directory
2021-08-31 19:40:58 +03:00
ac98378b4b fix bad temp directory 2021-08-31 19:39:52 +03:00
397352fb75 Merge pull request #706 from ONLYOFFICE/fix/v6.4.1-fix-bugs
Fix/v6.4.1 fix bugs
2021-08-30 15:09:57 +03:00
50a765eb4c fix bug #52259 2021-08-30 15:08:24 +03:00
8c0f2a6b2c fix bug #52240 2021-08-30 15:02:26 +03:00
b5b7ec1633 Merge pull request #705 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-08-27 13:27:00 +03:00
d0b49a7741 fix bug #50003 2021-08-27 12:37:46 +03:00
77c3a821a0 fix bug #52191 2021-08-26 17:05:02 +03:00
ce43301d5f Merge branch release/v6.4.0 into develop 2021-08-26 13:50:47 +00:00
3cc2d904d4 Merge branch release/v6.4.0 into master 2021-08-26 11:33:13 +00:00
158546d3fa fix bug #51937 2021-08-25 15:57:32 +03:00
4570ac9d1a fix bug #52159 2021-08-25 07:54:52 +03:00
55531d6ede fix bug #51935 2021-08-25 07:52:01 +03:00
d67dc8939a Fix bug 51928 (#702) 2021-08-24 12:14:08 +03:00
15152283b7 Merge pull request #701 from ONLYOFFICE/fix/gumbo-parser
fix includes for iswspace
2021-08-24 12:11:43 +03:00
8032e05f7a fix isspace 2021-08-24 11:14:48 +03:00
4ed4163588 fix includes for iswspace 2021-08-24 10:16:10 +03:00
6ff2719109 Merge pull request #700 from ONLYOFFICE/fix/v6.4.0-fix-bugs
fix bug #51705
2021-08-23 15:15:40 +03:00
f79027d21e fix bug #51705 2021-08-23 15:14:09 +03:00
9098f18db2 Merge remote-tracking branch 'origin/release/v6.4.0' into develop 2021-08-23 10:24:30 +03:00
effb0f0066 Merge pull request #699 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-08-22 14:42:11 +03:00
79964fc766 fix bug #51720 2021-08-22 14:41:13 +03:00
0337c4265a fix bug #51733 2021-08-22 11:13:35 +03:00
d590eebbe1 Merge pull request #698 from ONLYOFFICE/fix/v6.4.0-fix-bugs
fix bug #51705
2021-08-20 12:58:38 +03:00
1eea84e369 fix bug #51705 2021-08-20 12:58:05 +03:00
e628644d44 Merge pull request #697 from ONLYOFFICE/fix/v6.4.0-fix-bugs
fix bug #51751
2021-08-20 11:44:34 +03:00
b8d065fcdc fix bug #51751 2021-08-20 11:43:03 +03:00
80e3d5a0a8 [x2t] For bug 52058 2021-08-20 10:29:22 +03:00
0f0a448541 Merge pull request #695 from ONLYOFFICE/fix/v6.4.0-fix-bugs
fix build
2021-08-20 10:09:24 +03:00
592edbc574 fix build 2021-08-20 10:08:36 +03:00
170d26562a Merge pull request #694 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-08-20 10:04:14 +03:00
40dc29d815 Merge pull request #693 from ONLYOFFICE/fix/v6.4.0-fix-bugs-ppt2
fix bug #52046
2021-08-19 20:10:15 +03:00
7950b821a0 fix bug #52046 2021-08-19 20:09:03 +03:00
d36c3aeea3 fix protection read 2021-08-19 12:15:50 +03:00
38f20032f4 Fix bug 51525 2021-08-18 17:41:45 +03:00
6d57eaa978 Merge pull request #692 from ONLYOFFICE/fix/v6.4.0-fix-bugs-ppt
Fix/v6.4.0 fix bugs ppt
2021-08-17 20:18:33 +03:00
1534aa4e0c Fix bug 51936 2021-08-17 20:10:36 +03:00
03c6ffa870 return URI. It's roped with bug 51720 2021-08-17 18:46:03 +03:00
db74e10f48 fix URI bug. It's roped with bug 51720 2021-08-17 18:41:06 +03:00
2efb111c91 Merge pull request #691 from ONLYOFFICE/fix/v6.4.0-fix-bugs-ppt
Fix/v6.4.0 fix bugs ppt
2021-08-17 18:28:06 +03:00
edb35f0c55 fix bug #51733 2021-08-17 17:23:25 +03:00
ce1fbdeb4d . 2021-08-17 14:53:22 +03:00
a6b33f977b fix bug #50718 2021-08-17 14:22:29 +03:00
78cd4ed710 fix bad drawing part in smartarts;
fix circles smartart
2021-08-16 16:10:23 +03:00
510291b65a fix part of bug #51705 2021-08-16 15:08:57 +03:00
fb28aadbb9 clientData & fLocksText 2021-08-16 11:45:47 +03:00
b255b5e655 Merge pull request #690 from ONLYOFFICE/fix/bug51500
Fix bug 51500
2021-08-16 10:41:40 +03:00
25c133d870 Fix bug 51500 2021-08-16 10:39:28 +03:00
cb86631775 Merge pull request #689 from ONLYOFFICE/release/v6.4.0
Release/v6.4.0
2021-08-16 09:37:27 +03:00
a696c46700 Add scales for themes, correct fonts thumbnails 2021-08-13 17:51:33 +03:00
6c4bbae905 Small changes 2021-08-13 17:37:17 +03:00
0a01752648 Merge pull request #688 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-08-13 15:58:58 +03:00
3e97080d33 fix bug #51949 2021-08-13 15:57:28 +03:00
f93add5032 fix bug #51716 2021-08-13 15:56:57 +03:00
9b3d0bb323 Fix bug 51795 2021-08-13 13:41:21 +03:00
00be628ec6 Fix bug 51928 2021-08-13 12:17:33 +03:00
d9baf576a5 Merge pull request #686 from ONLYOFFICE/fix/bug51928
fix gumbo-parser
2021-08-13 11:17:01 +03:00
5d917b93e3 Merge remote-tracking branch 'origin/release/v6.4.0' into develop 2021-08-12 18:49:22 +03:00
55eac108a4 Merge pull request #687 from ONLYOFFICE/fix/v6.4.0-fix-bugs3
Fix/v6.4.0 fix bugs3
2021-08-12 18:45:02 +03:00
8d6402acdd fix bug #51935 2021-08-12 18:44:01 +03:00
db5b10ef6d fix #51735. Check extLst, next problem there 2021-08-12 18:41:01 +03:00
65d846b761 fix bug #51937 2021-08-12 18:28:51 +03:00
d4708d8d2e fix bug #51923 2021-08-12 17:59:06 +03:00
ad4e5d348b fix gumbo-parser
isspaсe crashes when reading unicode characters
2021-08-12 16:05:35 +03:00
c62b479832 fix protection 2021-08-12 13:45:22 +03:00
5003ac4eae Merge pull request #684 from ONLYOFFICE/fix/bug50799
Fix bug 50799
2021-08-12 10:39:42 +03:00
90a3231c75 Fix bug 50799
The bug has already been fixed on develop. Making a duplication in release
2021-08-12 10:37:19 +03:00
beb6bb4dcf return layout with theme roundtrip 2021-08-10 23:16:42 +03:00
c888b809b3 Merge branch hotfix/v6.3.2 into release/v6.4.0 2021-08-10 12:23:17 +00:00
660acc4e0b Merge branch hotfix/v6.3.2 into develop 2021-08-10 12:23:11 +00:00
2bf24200fb Merge pull request #681 from ONLYOFFICE/fix/v6.4.0-fix-bugs2
for bug #51748
2021-08-09 21:29:33 +03:00
839ecaaefc for bug #51748 2021-08-09 21:27:36 +03:00
b4ca670737 add roundtrip themes/_rels 2021-08-08 20:32:13 +03:00
86d4eb2ac3 Write roundtrip themes and they's images, but not they's rels 2021-08-08 14:14:49 +03:00
a1a81a808c fix build 2021-08-07 09:18:03 +03:00
2ed79e00e7 Correct regex strings were found 2021-08-06 22:19:58 +03:00
a4ec9b1b6d rewrite some part of theme roundtrip. Not work now 2021-08-06 15:17:02 +03:00
178e809729 there were added RegEx for paths in kernel 2021-08-06 14:24:53 +03:00
2056d81343 Merge remote-tracking branch 'origin/release/v6.4.0' into develop 2021-08-05 19:52:23 +03:00
388c12e177 Merge pull request #680 from ONLYOFFICE/fix/v6.4.0-fix-bugs
fix bug #51748
2021-08-05 19:51:52 +03:00
d375e15418 fix bug #51748 2021-08-05 19:49:34 +03:00
a2820bdd79 change theme writer. For the next need to write theme/_rels 2021-08-05 19:27:23 +03:00
3cb4c2d23b add md5 to write unique themes. Work now. Need _rels 2021-08-05 13:46:37 +03:00
5752f56314 add md5 to write unique themes. Not fineshed yet 2021-08-04 23:03:21 +03:00
9c896ec55e trying to add theme roundtrip. Not build 2021-08-04 18:38:04 +03:00
1078df18f8 . 2021-08-04 15:01:26 +03:00
3729083e3e Merge remote-tracking branch 'origin/release/v6.4.0' into develop 2021-08-04 14:51:56 +03:00
8856759922 return table xml 2021-08-04 12:28:29 +03:00
7c26ca6899 Merge pull request #679 from ONLYOFFICE/fix/v6.4.0-fix-bugs
fix bug #51648
2021-08-04 09:51:46 +03:00
3df76f6c67 trying to include table 2021-08-03 23:58:49 +03:00
24f8b68c0d fix slide hyperlinks for difference languages 2021-08-03 18:43:14 +03:00
84c4447fa2 fix bug #51648 2021-08-03 17:58:30 +03:00
5650a56262 fix text hyperlinks. It wasn't been a merging problem. 2021-08-03 17:27:51 +03:00
27cac74a8d fix #51660. But while was merging I broken text hyperlinks 2021-08-03 14:48:32 +03:00
5d505d58ce [mobile] Add event type for send theme color 2021-08-03 11:11:27 +03:00
72af33964d Merge pull request #678 from ONLYOFFICE/fix/v6.4.0-fix-bugs-ppt
Fix/v6.4.0 fix bugs ppt
2021-08-03 08:56:50 +03:00
da6b89af94 trying to fix 51660 2021-08-02 18:55:23 +03:00
12f644a898 Merge pull request #677 from ONLYOFFICE/fix/pdf
Fix/pdf
2021-08-02 18:10:50 +03:00
de9812479d . 2021-08-02 18:03:20 +03:00
f8db90b29a . 2021-08-02 18:02:03 +03:00
9cdd43cfa9 Fix bug 50975 2021-08-02 17:57:19 +03:00
389387eebf was repaired vbaProject.bin file writer 2021-08-02 17:52:16 +03:00
0ed170de45 Fix bug 50866 2021-08-02 16:22:31 +03:00
2b0611ac25 Merge pull request #676 from ONLYOFFICE/fix/v6.4.0-fix-bugs
fix forms
2021-08-01 08:45:09 +03:00
11ebcfa476 fix forms 2021-07-31 10:39:04 +03:00
be0e9d4a08 Merge pull request #675 from ONLYOFFICE/fix/v6.4.0-fix-bugs-ppt
Fix/v6.4.0 fix bugs ppt
2021-07-30 18:08:12 +03:00
02310f1d64 merge with ppt_6. (Table + roundTrip Theme & Table) 2021-07-30 17:26:52 +03:00
8d143b8682 Merge pull request #674 from ONLYOFFICE/feature/v8_inspector_xx
Support v8 inspector
2021-07-30 17:01:31 +03:00
4bb6c8554c refactoring 2021-07-30 16:59:15 +03:00
1d04e2dddc remove some debug cout 2021-07-30 16:27:53 +03:00
af184659f3 restored v8.pri and ixwebsocket sources 2021-07-30 14:06:49 +03:00
7698d47e09 finalized check for 'silent' breakpoints 2021-07-30 13:58:09 +03:00
bfa4e0a5d0 found workaround with setting breakpoints 2021-07-30 01:20:11 +03:00
92519a5d62 added readme 2021-07-29 21:30:56 +03:00
9febebf33c Merge pull request #673 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-07-29 20:50:40 +03:00
ef365fc08e form. border & shd 2021-07-29 20:49:59 +03:00
6c28c529e3 fix bug #51584 2021-07-29 20:04:07 +03:00
e78bc7ea57 cleaned the code up 2021-07-29 19:09:30 +03:00
9746b63f46 removed redundunt code from inspector 2021-07-29 18:48:16 +03:00
458c9ba638 fixed pause on breakpoints and steps 2021-07-29 18:23:04 +03:00
86f7a181f8 Merge pull request #672 from ONLYOFFICE/fix/v6.4.0-fix-bugs-ppt
Fix/v6.4.0 fix bugs ppt
2021-07-29 16:57:16 +03:00
be6871a2a4 Merge pull request #671 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-07-29 16:53:23 +03:00
f43a38bdc9 convert empty files 2021-07-29 16:52:03 +03:00
2a8e8995bd add checker for empty
fix macro
2021-07-29 15:46:10 +03:00
95bba9d44a Fixed missing text when converting an EMF file 2021-07-28 18:26:31 +03:00
cab34310bf tested v8-debug - it also works fine 2021-07-27 23:53:19 +03:00
9b8d805ea9 cleaner and still working version 2021-07-27 23:31:53 +03:00
9cf28e70e0 works and looks as Oleg wanted 2021-07-27 21:26:22 +03:00
558cfb8048 refactoring ExHyperlinkContainer 2021-07-27 17:21:25 +03:00
c031c8e9cd Merge pull request #669 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-07-27 17:11:43 +03:00
b0363dad58 for bug #51543 2021-07-27 17:08:01 +03:00
4ff7be8245 fix bug #51543 2021-07-27 16:51:19 +03:00
476ebe6e95 fix bug #51541 2021-07-27 15:58:58 +03:00
37f5bdcaf5 fully working version 2021-07-27 11:31:58 +03:00
09c30e2686 Merge pull request #668 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-07-27 09:42:18 +03:00
8210595178 fix bug #51522 2021-07-26 21:58:41 +03:00
ec9a1802bf working version 2021-07-26 19:55:52 +03:00
f8f307aa29 add Other Files and http(s) hyperlinks 2021-07-26 18:06:40 +03:00
fb9d4d0460 add Other Presentation hyperlinks 2021-07-26 17:48:03 +03:00
c92847d254 check for logging long message added 2021-07-26 15:11:02 +03:00
ac865d292f text hyperlinks were corrected! Now it has problem with some visible hyperlink, but it goesn't work 2021-07-26 14:59:42 +03:00
6a0d882178 very bad desing, needs to be rewritten. but it works 2021-07-26 00:58:39 +03:00
086212209f trial works 2021-07-25 23:20:27 +03:00
bf0b1e8d97 trying to correct text hyperlinks 2021-07-25 22:49:10 +03:00
f591bcbd45 trying to correct text hyperlinks for hard cases. Problems with text after hyperlink 2021-07-25 18:03:53 +03:00
5490140a02 version with server out of inspector. it does not work, commiting just in case, to not lose it 2021-07-24 23:26:30 +03:00
37402ebb39 [x2t] Set m_bMacro flag according to nFormatTo 2021-07-24 19:48:20 +03:00
ef277b4656 fix bug #51489 2021-07-24 13:20:27 +03:00
89c2322393 experimental 2021-07-23 18:53:32 +03:00
ee19ab476f trying to correct hyperlinks 2021-07-23 18:31:23 +03:00
06c8c0e075 add text hyperlinks. But it has bugs 2021-07-23 15:58:01 +03:00
10bf455263 Merge pull request #667 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-07-23 15:00:46 +03:00
9df5a2616c . 2021-07-23 13:19:02 +03:00
a26264775b change read/write macro in/to binary 2021-07-23 12:24:51 +03:00
6973cec1a1 add client text box record for hyperlinks 2021-07-22 18:37:37 +03:00
396fc30ac5 Merge pull request #666 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-07-22 18:24:42 +03:00
383bae3750 fix bug #51327 2021-07-22 18:23:20 +03:00
974b9bcc1b add CRecordMouseInteractiveInfoContainer 2021-07-22 17:50:10 +03:00
bbc0f1231d fix issue 1321 2021-07-22 15:23:34 +03:00
90565663d5 fix bug #51445 2021-07-22 15:06:42 +03:00
208bf78003 fix bug #51328 2021-07-22 15:05:12 +03:00
6aa9b0518b removed shutting the server down from the inspector
also added temporary logging to server
2021-07-22 13:35:32 +03:00
bb8ce719b7 Refactoring 2021-07-22 11:10:51 +03:00
02d93007d4 Move inspector files to v8_use_inspector section 2021-07-22 10:37:19 +03:00
a009d4d918 remove text hyperlinking. Need to rewrite it 2021-07-21 18:30:53 +03:00
d7a801402e Merge pull request #665 from ONLYOFFICE/fix/v6.4.0-fix-bugs
fix bug #51387; fix macro save
2021-07-21 16:28:30 +03:00
bbcd181d9d fix bug #51387; fix macro save 2021-07-21 16:27:12 +03:00
cdbf82ab7e . 2021-07-21 10:54:16 +03:00
727be4a0da Merge pull request #664 from ONLYOFFICE/fix/v6.4.0-fix-bugs-ppt
Fix/v6.4.0 fix bugs ppt
2021-07-21 08:43:18 +03:00
9f57fdb739 removed file checking 2021-07-21 00:59:34 +03:00
2dc209afcc added shutting the server down and a file to control debug 2021-07-21 00:43:46 +03:00
3a97757b86 Fix bug #50874
Fix the problem with escaping text strings
2021-07-20 22:11:39 +03:00
14c517eaf5 Add flag for disable all warnings 2021-07-20 20:36:09 +03:00
110cee404a Fix bug #50743
Improve rendering of bold text when there is no bold font
2021-07-20 19:06:59 +03:00
0586cabee5 add image hyperlinks, change text hyperlinks, but last one works uncorrect 2021-07-20 18:43:51 +03:00
0e9fc9329d deleted scriptholder class 2021-07-20 14:03:21 +03:00
a3d95d67c5 cleaned the code up 2021-07-20 13:56:23 +03:00
af3cf7f33a added counting the number of inspectors in single thread
js code can call c++ code, that can again call js code, thus creating more than one inspector in single thread
it leaded to creating multiple servers that attempted to listen on the single port and failed
to distribute ports between inspectors counting of inspectors amount in each thread was added
now several inspectors in single thread gain unique ports
2021-07-19 23:24:44 +03:00
7393a8220b . 2021-07-19 23:08:13 +03:00
e00e309662 Merge remote-tracking branch 'origin/release/v6.4.0' into develop 2021-07-19 19:04:46 +03:00
d294c98f9e Merge pull request #661 from ONLYOFFICE/fix/v6.4.0-fix-bugs2
fix bug #51374
2021-07-19 18:59:40 +03:00
bf804905c7 fix bug #51374 2021-07-19 18:58:57 +03:00
a8e537220b start to rewrite Rels in buttons 2021-07-19 18:43:38 +03:00
2567e61944 [x2t] Fix VbaProject reading from Editor.bin 2021-07-19 14:20:07 +03:00
1ee41654a2 added new files to js_base.pri 2021-07-19 03:12:08 +03:00
a1a0feb432 fine version with test sample in main.cpp 2021-07-19 02:25:45 +03:00
9372226d5c preliminary working version 2021-07-19 01:42:47 +03:00
a2f6876f60 Merge pull request #659 from ONLYOFFICE/fix/v6.4.0-fix-bugs
read macro from binary, add macro mode saving
2021-07-18 11:33:36 +03:00
5b53f2395f read macro from binary, add macro mode saving 2021-07-18 11:30:08 +03:00
f8a9135f93 Merge remote-tracking branch 'origin/release/v6.4.0' into develop 2021-07-17 16:30:21 +03:00
e13a95fa0a . 2021-07-17 10:09:22 +03:00
38c31f25e1 trying to fix 51028. Change slide number recognizer 2021-07-16 19:11:01 +03:00
e4f9cf881b fix bug #49667 2021-07-16 11:20:11 +03:00
79882d03af [x2t] Add AVS_OFFICESTUDIO_FILE_OTHER_ODF to convert to any odf format; Split AVS_OFFICESTUDIO_FILE_DOCUMENT_PACKAGE format into parts; Add macro param to changeForm 2021-07-15 20:05:54 +03:00
8382ba6fee Merge pull request #658 from ONLYOFFICE/fix/v6.4.0-fix-bugs-ppt
Fix/v6.4.0 fix bugs ppt
2021-07-15 11:10:30 +03:00
a6bd2e1a74 fix trigger begin condition 2021-07-14 18:17:07 +03:00
ae20888616 fix transition's spd 2021-07-14 17:45:30 +03:00
ad29f72359 correct and refactoring Transitions 2021-07-14 17:44:00 +03:00
0c1185c9d6 correct and refactoring Transitions 2021-07-14 16:53:45 +03:00
e1a08edb99 Merge pull request #657 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-07-14 12:37:42 +03:00
54f3716ce6 fix bug #51281 2021-07-14 12:36:28 +03:00
6bafc487d4 Merge pull request #656 from ONLYOFFICE/fix/v6.4.0-fix-bugs-ppt
correct some params in stCondLst and cond
2021-07-14 11:59:12 +03:00
b2be8e63b6 correct some params in stCondLst and cond 2021-07-13 18:42:05 +03:00
26e5889be5 Refactoring 2021-07-13 11:57:27 +03:00
2559e97f48 finish to rewrite table text. Can merge with develop 2021-07-12 17:52:37 +03:00
e37ef6b999 fix bug #50003 2021-07-12 15:39:41 +03:00
b32d52bb85 repaired inspector client
i even more shamefully forgot to schedule pause before script execution
2021-07-12 13:55:04 +03:00
571bad5381 Merge pull request #655 from ONLYOFFICE/fix/v6.4.0-fix-bugs
add sdt picture
2021-07-12 13:21:51 +03:00
2fea55841a add sdt picture 2021-07-12 13:20:45 +03:00
2e3a753280 modified .pro file so the project could be build for testing
also repaired Inspector: i shamefully forgot to initialize isolate pointer and logging flag
2021-07-12 12:44:51 +03:00
f81b269215 removed unused code 2021-07-11 18:52:01 +03:00
9f9a19e84b added comments, restructured code a bit 2021-07-11 18:31:38 +03:00
633f2b56f9 made fine .pri file for inspector usage 2021-07-11 18:30:57 +03:00
0ba261fa11 commited annoying ixwebsocket_internal.cpp 2021-07-11 13:19:55 +03:00
e3b71d57fc modified a bit v8.pri and ixwebsocket_internal
CIXWebsocket now prints error info to std::cerr and closes itself on destruction
2021-07-11 13:13:06 +03:00
a6f8b7c7ac deleted main.cpp from v8.pri 2021-07-11 12:56:35 +03:00
f542483beb added v8_use_inspector to v8.pri 2021-07-11 10:54:08 +03:00
a67b397491 project finalized, but not tested yet
a lot of code to make cleaner and better
2021-07-11 00:32:06 +03:00
495493ee59 moved runScript implementation into CJSContextPrivate
also slightly modified server
2021-07-10 21:32:17 +03:00
b3dec6066a connected CJSContextPrivate and CInspectorClient
declared CInspectorClient as a friend of CJSContextPrivate so client could use its runScript method later
forward declared CJSContextPrivate before CInspectorClient so client can store pointer to CJSContextPrivate inside
2021-07-10 16:26:15 +03:00
4a0ae7eff3 made isolate locking macros in utils
now depending on V8_DEBUG_MULTITHREADED define utils methods may lock or not isolate they use
also added namespaces and changed class names to conventional
2021-07-10 16:10:16 +03:00
16f55bc01a entering isolate scope removed from utils
utils are renamed into single thread utils so it's indicated that
they should access isolate only from single thread, and thus inspector
should be single-threaded, as it is now with boost::beast server realization
2021-07-10 15:13:50 +03:00
436b268e49 continue to rewrite table text 2021-07-09 18:43:11 +03:00
539d7b1356 slightly modified inspector 2021-07-09 18:04:51 +03:00
4dd2aa8df6 x2t - doc & write protection 2021-07-09 15:10:05 +03:00
b85d11cc05 start to rewrite table text 2021-07-08 18:44:11 +03:00
3eb5c21b10 preliminary working (at least, on my machine) version
comments and namespaces to add, logging to implement, some other features to be done.
but it works and might be tested.
2021-07-08 18:16:57 +03:00
9d35757245 add margins for top and down, but it fail with text. Some conditions were disable! 2021-07-08 16:44:20 +03:00
c7e73feb0f Merge pull request #653 from ONLYOFFICE/fix/v6.4.0-fix-bugs-ppt
fix bug #51098
2021-07-08 09:54:23 +03:00
53accfc084 add styles for tables (not all) 2021-07-07 18:34:24 +03:00
eb032af457 correct some table properties 2021-07-06 18:36:08 +03:00
63cfded90c add zero height for proto table 2021-07-06 16:36:41 +03:00
64453f020c fix bug #51098 2021-07-05 19:28:53 +03:00
ef3e4c2cfa add invizible table cells 2021-07-05 18:49:33 +03:00
7f6d04eb34 add round trip theme. Now it works fine. 2021-07-05 11:36:28 +03:00
f02690c3fe Developing... 2021-07-04 21:35:53 +03:00
09d3f946e7 add theme*.xml from CRecordRoundTripThemeAtom 2021-07-02 17:45:30 +03:00
0fb91dc2f8 Merge remote-tracking branch 'origin/release/v6.4.0' into develop 2021-07-02 10:44:38 +03:00
589f5cdbe9 Merge pull request #652 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-07-02 10:38:59 +03:00
eb8cea5cb2 for bug #51002 2021-07-02 10:36:44 +03:00
6174e93a7c Fix v8 crash with bad script 2021-07-01 17:37:10 +03:00
ca716c5b7d Fix string creating 2021-07-01 17:02:03 +03:00
5bf3e4d7ab add xml correct. Not works as I wanted 2021-07-01 16:41:39 +03:00
9644701947 fix bug #51053 2021-07-01 16:30:55 +03:00
ed9bb79889 Add zlib for ixwebsocket 2021-07-01 15:29:31 +03:00
043f193f2c [x2t] Fix bug 49613; Write CustomXml in ContentTypes.xml 2021-06-30 19:09:52 +03:00
83230fb3ec xml table. It has some problem with color 2021-06-30 18:51:50 +03:00
9a91fac28c . 2021-06-30 13:55:26 +03:00
e98b542eae Correct some class for xml tables. Last home's changes. 2021-06-30 09:19:23 +03:00
825a5d78af Merge branch 'feature/ppt_6' of https://github.com/ONLYOFFICE/core into feature/ppt_6 2021-06-29 15:53:06 +03:00
66e103fd94 I can exctract tableStyles.xml, but it's not perfect solition 2021-06-29 15:52:21 +03:00
a76b7ec328 Merge pull request #650 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-06-29 09:54:18 +03:00
4df0f97918 fix bug #51006 2021-06-29 09:52:53 +03:00
79ae7e99d7 fix bug #49613 2021-06-29 09:46:47 +03:00
17de9d8da0 Refactorng 2021-06-29 08:59:34 +03:00
d7dcd96a90 Merge pull request #648 from ONLYOFFICE/fix/v6.4.0-fix-bugs
add marker drawing form
2021-06-27 13:33:54 +03:00
4cdc2b1ea5 add marker drawing form 2021-06-27 13:32:58 +03:00
a3fc7849ae Merge pull request #647 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-06-27 10:56:50 +03:00
387b89e720 fix bug #50895 2021-06-27 10:55:19 +03:00
8c560d638d Rename libnetwork => libkernel_network (conflict with system) 2021-06-27 10:53:04 +03:00
2c45908473 fix bug #50997 2021-06-27 09:47:05 +03:00
1541e891b4 Fix build on macos 2021-06-27 09:46:52 +03:00
daf2f1a20f Merge pull request #646 from ONLYOFFICE/feature/nativeRefactoring
Feature/native refactoring
2021-06-26 22:14:59 +03:00
fa7690a239 Refactoring (add network library) 2021-06-26 22:11:52 +03:00
4a621f44c2 Refactoring (network library & kernel) 2021-06-25 17:10:05 +03:00
01ee676614 add records: metafile, RoundTripOArtTextStyles12Atom 2021-06-25 12:16:54 +03:00
2e20dd9058 Repair FontAssistant for support core-ext (deprecated class) 2021-06-25 10:53:02 +03:00
13f125f508 Merge remote-tracking branch 'origin/release/v6.4.0' into feature/nativeRefactoring 2021-06-25 10:45:23 +03:00
c025e51106 Merge pull request #645 from ONLYOFFICE/feature/webscoket
Feature/webscoket
2021-06-25 10:16:56 +03:00
edcff7f718 fix bug #50718 2021-06-24 14:38:19 +03:00
e5e0949f39 add bullets for text in table 2021-06-23 19:46:41 +03:00
08e6fee7a8 merge with home fork 2021-06-23 14:18:17 +03:00
9afcc242b7 fix bug #31329 2021-06-23 12:02:37 +03:00
bd0b0e7830 Fixed bug #38896 2021-06-22 13:01:05 +03:00
b48fd55607 Refactoring 2021-06-20 20:13:46 +03:00
06fb3f0203 add pt spacing 2021-06-18 18:07:39 +03:00
cb55300286 add line spacing 2021-06-18 17:12:12 +03:00
be7b3c1bbc Merge pull request #644 from ONLYOFFICE/fix/v6.4.0-fix-bugs
fix bug #50881
2021-06-18 17:03:13 +03:00
5a6d6c9057 fix bug #50881 2021-06-18 17:01:34 +03:00
a2a65579c1 add common anchor 2021-06-18 16:01:44 +03:00
59c0abbee9 add horz align 2021-06-18 14:54:24 +03:00
e4896d7893 Update standardtester.pro 2021-06-18 10:58:57 +03:00
fac71f7b4a Fix merge from hotfix 2021-06-17 22:31:34 +03:00
90fd93de9a correct alpha and diagonal borders 2021-06-17 17:56:28 +03:00
30ab4a55d1 add border writer 2021-06-17 17:06:15 +03:00
942d39598e Merge pull request #643 from ONLYOFFICE/fix/v6.4.0-fix-bugs
fix bug #50842
2021-06-17 14:43:35 +03:00
be6ade46dd fix bug #50842 2021-06-17 14:42:27 +03:00
047de070cb Merge pull request #642 from ONLYOFFICE/fix/v6.4.0-fix-bugs
fix bug #50880
2021-06-17 12:25:33 +03:00
4b2439b7d8 fix bug #50880 2021-06-17 12:24:19 +03:00
c2d4d4f9bd add border writer, but it format is broken 2021-06-16 18:41:44 +03:00
f687d21149 Merge pull request #641 from ONLYOFFICE/fix/v6.4.0-fix-bugs
Fix/v6.4.0 fix bugs
2021-06-16 15:52:09 +03:00
b416c5e85a fix bug #50827 2021-06-16 15:50:34 +03:00
7a92cca760 fix bug #46986 2021-06-16 15:49:54 +03:00
c71b649621 Merge pull request #640 from ONLYOFFICE/android_kts
[android] build.gradle to kts
2021-06-16 13:59:34 +03:00
1f18cd62a5 [android] build.gradle to kts 2021-06-16 13:25:42 +03:00
0594d9decd add border setter 2021-06-16 12:46:05 +03:00
a3fb1eccd1 Merge remote-tracking branch 'origin/hotfix/v6.3.1' into release/v6.4.0 2021-06-16 11:05:22 +03:00
4603f6db84 . 2021-06-15 19:28:27 +03:00
985a4b41dc . 2021-06-13 08:12:02 +03:00
5be7c96319 . 2021-06-12 16:47:49 +03:00
b3a9d8d07d . 2021-06-12 08:21:23 +03:00
e9944e0147 . 2021-06-11 20:09:54 +03:00
5dbc4b4d49 add cell's color 2021-06-11 17:42:28 +03:00
0363867177 smart arts 2021-06-11 17:10:37 +03:00
b2cd5f0211 add base styles fot text 2021-06-11 16:07:06 +03:00
5a10bb897e convert text but sometimes it's uncorrect 2021-06-10 18:32:25 +03:00
89bbbb0aac start new class for table text 2021-06-09 18:38:15 +03:00
f26de54016 Fix bug 50799 2021-06-09 18:00:28 +03:00
12789ab7f6 empty table was converted 2021-06-09 17:19:09 +03:00
1e5819f9f9 add merging 2021-06-09 16:26:41 +03:00
810e01e7e9 add class ProtoTable 2021-06-09 14:10:13 +03:00
22bae397cf start to rewrite proto table 2021-06-07 18:43:23 +03:00
7c9444e086 add not work protoTable 2021-06-07 18:05:32 +03:00
46d0acb106 add getProtoTable method 2021-06-04 18:53:50 +03:00
04374ade42 add spliter for old table shapes 2021-06-04 17:22:04 +03:00
f5fa11dde5 add some methods for tables 2021-06-03 21:52:28 +03:00
389472e2fb add some methods for tables 2021-06-03 18:40:47 +03:00
f8ba2aeeb3 Implement adding picture fields 2021-06-02 20:29:36 +03:00
2c2e74d182 Merge remote-tracking branch 'remotes/origin/release/v6.4.0' into develop 2021-06-01 18:56:36 +03:00
3afc193c73 Fix build on Mac 2021-06-01 18:55:12 +03:00
3450f81f99 Implement converting pdf to xml 2021-06-01 18:25:11 +03:00
7d4f6a24d6 Merge pull request #627 from ONLYOFFICE/release/v6.4.0
Release/v6.4.0
2021-05-31 19:40:59 +03:00
190f1ffc10 add table class 2021-05-31 18:36:27 +03:00
d377bef3a1 catch table 2021-05-31 14:38:18 +03:00
3d2c71b51a Merge pull request #626 from ONLYOFFICE/fix/buildError
Fix build
2021-05-31 12:17:31 +03:00
91688ebc5d Fix build 2021-05-31 12:15:11 +03:00
f9e7e8c91f Fix includes 2021-05-31 10:16:07 +03:00
d83c208339 Fix includes 2021-05-31 10:15:28 +03:00
95b7dae910 Implement class for picture field 2021-05-31 10:06:34 +03:00
d065709e0a Implement drawing border for field and special border for text-comb fields 2021-05-31 10:06:34 +03:00
b686c743c2 Implement class for picture field 2021-05-31 10:04:56 +03:00
65ceacc5ac add some things for recognizing table 2021-05-30 21:48:47 +03:00
971611603b Implement drawing border for field and special border for text-comb fields 2021-05-30 19:27:11 +03:00
4049fb98e6 Implement read/write checkboxes/radiobuttons/comboboxes to pdf from online binary 2021-05-28 15:20:34 +03:00
f95e5a4487 Merge remote-tracking branch 'origin/feature/localraster' into develop
# Conflicts:
#	EpubFile/test/main.cpp
2021-05-28 09:54:28 +03:00
a03f7f47bd Merge pull request #622 from ONLYOFFICE/feature/localzlib
Feature/localzlib
2021-05-28 09:48:46 +03:00
f3b673e85e Implement adding radio buttons to PDF 2021-05-27 15:24:42 +03:00
fb72127183 Implement saving checkbox field to PDF 2021-05-26 20:35:12 +03:00
a2480098c7 [x2t] For bug 50369; rework ThreadedComment stub message to old comment format 2021-05-26 19:37:06 +03:00
69cf19ddfb fix xmlns before image
If xmlns is used before the svg image, then the converter does not recognize the tag
2021-05-26 15:47:03 +03:00
8da953facf Implement writing choice fields 2021-05-26 11:52:57 +03:00
471bc8a248 Merge pull request #621 from ONLYOFFICE/fix/bug50358(style-part)
Fix bug 50358 (the part related to styles)
2021-05-25 20:13:50 +03:00
1495779207 Added a ban on negative margins and text background adjustments 2021-05-25 20:10:42 +03:00
fd02518b7a adding comments about memory 2021-05-25 15:45:15 +03:00
170974ac60 Merge remote-tracking branch 'remotes/origin/feature/formsPDF' into develop 2021-05-25 15:00:43 +03:00
7c1ab855d1 Fix bug 50358 2021-05-25 12:07:43 +03:00
0ca8ac97c6 Fix bug 50004 2021-05-25 10:34:06 +03:00
e5bf10efb4 rename 2021-05-24 17:53:58 +03:00
541b5d7647 Merge pull request #620 from ONLYOFFICE/feature/signWasm
Fix libxml2 error in wasm module
2021-05-24 16:24:58 +03:00
bd0864fca3 Fix libxml2 error in wasm module 2021-05-24 16:24:54 +03:00
8cd34880e4 Merge branch 'feature/signWasm' into feature/localzlib
# Conflicts:
#	DesktopEditor/xmlsec/src/wasm/module/make.py
2021-05-24 14:17:52 +03:00
24f0fd731d Fix typo 2021-05-24 14:05:22 +03:00
a031523e13 support -O3 and -g3 compilation 2021-05-24 13:35:47 +03:00
d5f42cec2b adding comments, path fix, move function
implementation of the move function without re-allocating memory - just changing the relative path
2021-05-24 13:33:20 +03:00
8c95392373 Merge remote-tracking branch 'origin/hotfix/v6.3.1' into develop 2021-05-24 13:13:47 +03:00
107e6daf2f Add support in workers 2021-05-24 12:49:47 +03:00
9df683049d Use window.crypto instead openssl rands 2021-05-24 12:47:27 +03:00
f997885e3c fix bug #49730 2021-05-24 11:25:38 +03:00
b41ca06e50 Merge pull request #616 from ONLYOFFICE/feature/localzlib2
Feature/localzlib2
2021-05-23 22:27:57 +03:00
1779672ea6 Rework the interface of the function for adding form fields 2021-05-23 21:43:19 +03:00
494f895ce1 . 2021-05-23 19:27:12 +03:00
327f6982a5 Implement 0.5 alpha for field placeholder 2021-05-23 18:43:24 +03:00
a4a6441377 Implement saving text fields from OnlineBin 2021-05-23 18:10:22 +03:00
a5eda01ad3 Refactoring 2021-05-23 17:39:59 +03:00
1e42d594b7 Refactoring 2021-05-23 13:55:43 +03:00
50733e3979 Fix typo 2021-05-22 20:56:51 +03:00
d1ad3cd973 Refactoring 2021-05-22 20:47:10 +03:00
f205b21b76 fix win build 2021-05-22 06:17:14 +03:00
683cb6b09a Merge branch 'feature/ppt_5' into develop 2021-05-21 18:12:50 +03:00
2cadcaaad5 fix paths 2021-05-21 17:15:37 +03:00
517d173c45 added first triggers 2021-05-21 15:36:49 +03:00
05abe91a14 js test 2021-05-21 14:42:44 +03:00
39fe62c91a Implement color change for text in fields 2021-05-21 13:36:50 +03:00
7c0926e250 c++ test 2021-05-21 11:03:29 +03:00
54e5f27ced Merge branch 'release/v6.3.0' into develop
# Conflicts:
#	EpubFile/test/main.cpp
2021-05-21 10:20:56 +03:00
885a225c2e add hyperlink for paragraph 2021-05-20 18:32:42 +03:00
155fea77dc inlude opennsl for wasm 2021-05-20 18:15:52 +03:00
d15f25f6ed add includes for openssl 2021-05-20 16:06:07 +03:00
f06abd20e1 Implement ResourecesDict
Also implement normal appearance stream for fields
2021-05-20 15:16:00 +03:00
ee3011a7b4 Merge branch 'feature/ppt_5' of https://github.com/ONLYOFFICE/core into feature/ppt_5 2021-05-20 11:15:36 +03:00
d0a64944b7 rewrote buttons. hlinks that isn't a button not converts 2021-05-20 11:11:55 +03:00
56105807bf rewrote buttons. It has problem with hlinks that isn't a button 2021-05-20 11:06:55 +03:00
81292abb87 Add special class for storing Resources dictionary 2021-05-19 23:46:22 +03:00
e6345385b3 includes
xmlIO.c needs io / unistd for read / write
miniunz.c need sys/stat.h for mkdir
2021-05-19 16:35:41 +03:00
c127afb750 includes for openssl 2021-05-19 16:33:10 +03:00
58492a53f8 includes for wasm 2021-05-19 13:14:19 +03:00
01b12e4a99 fix path in make.py 2021-05-18 13:11:26 +03:00
a90d4dfd99 fixed problems with memory 2021-05-18 12:44:54 +03:00
94c48a6a3e Read simple text fields from binary
Also fix the problem with unicode fields names and hints
2021-05-17 22:51:30 +03:00
953af5b6b1 [network] add upload file/data external (curl) 2021-05-17 22:05:54 +03:00
77c47267f6 there was no memory leak for CZipFolderMemory 2021-05-17 18:22:22 +03:00
8d37f4b433 fix some problems 2021-05-17 15:06:42 +03:00
757dc61ce8 rewrite audio for animation 2021-05-17 12:20:16 +03:00
f9c3a41a1d Refactoring 2021-05-16 18:17:27 +03:00
eba362d724 Refactoring 2021-05-15 23:17:54 +03:00
3bf78a7828 Merge pull request #610 from ONLYOFFICE/develop
Develop
2021-05-15 22:45:14 +03:00
d34b9bb1dd Add support openssl engine for sign/verify on windows 2021-05-15 22:01:10 +03:00
4929328d7f [common][network] separate FileTransporter for 2 interfaces FileDownloader and FileUploader for client. Add UploadData, UploadFile, DownloadFile function on inside classes 2021-05-14 21:10:15 +03:00
42170638c2 add sound buttons 2021-05-14 17:53:04 +03:00
7c02a9d9fc rewrite buttons with help pptx classes 2021-05-14 16:06:42 +03:00
3254167f08 add custom slide buttons 2021-05-14 14:47:23 +03:00
8ae8b79e9e linux fix 2021-05-13 18:52:51 +03:00
c71da950ee [Common] add network lib 2021-05-13 18:43:25 +03:00
2bac3ef4cc rename CZLib to CZipBuffer 2021-05-13 18:26:29 +03:00
058b9a5fd4 Refactoring 2021-05-13 17:10:08 +03:00
dd599d1f80 fix constructor CZLib 2021-05-13 15:48:00 +03:00
36d9b5044c zlib с++ test 2021-05-13 15:41:47 +03:00
fdd4c9b5c4 zlib c++ and js fix 2021-05-13 15:24:56 +03:00
b092ff1371 CZLib and CZipFolderMemory with pretty interface 2021-05-13 13:02:49 +03:00
d0b617a10c ZipLib in kernel 2021-05-12 19:27:48 +03:00
8123b8d899 Merge branch 'feature/webscoket' of https://github.com/ONLYOFFICE/core into feature/webscoket 2021-05-11 18:47:56 +03:00
828112bc48 [websocket] default ixwebsocket 2021-05-11 18:47:23 +03:00
f3803591aa getFiles with slash 2021-05-11 18:09:39 +03:00
93f8485c6e path without a slash at the beginning 2021-05-11 17:44:49 +03:00
1524c0f1c8 SetImageValid and SetImageInvalid with paths outside the archive 2021-05-11 17:28:30 +03:00
6d6e217e64 OOXMLVerifier without CFileBinary 2021-05-11 17:17:35 +03:00
8110e5de7c OOXMLSignerBuffer to ZipFolderMemory 2021-05-11 14:00:43 +03:00
f328523112 Sign use fileToWrite 2021-05-07 17:30:19 +03:00
11d6bfaa01 also delete CFileBinary 2021-05-07 16:55:14 +03:00
aec48da361 add dependency 2021-05-07 16:30:17 +03:00
27840241ab without CFileBinary 2021-05-07 16:30:01 +03:00
fd3c746db2 [3dParty] fix curl build ios 2021-05-07 14:38:47 +03:00
6878e82310 fix some methods 2021-05-06 13:08:47 +03:00
4743d856d9 Add max len 2021-05-05 21:35:09 +03:00
76c55a87cb create COOXMLSignerBuffer_private 2021-05-05 16:27:58 +03:00
864d0af190 Implement very first variant of adding simple text fields 2021-05-05 14:02:11 +03:00
40e05fcb72 [3dParty][webscoket] add mac support 2021-05-04 16:35:13 +03:00
443fd59974 Merge branch 'release/v6.3.0' into develop 2021-05-04 10:53:49 +03:00
063c3cf659 add jump buttons 2021-04-30 14:54:33 +03:00
68422064cf . 2021-04-30 13:12:37 +03:00
bb11c8d2ca add array actions for buttons 2021-04-28 18:43:21 +03:00
c4e94c2293 Add AcroForm file and update TestProject 2021-04-27 20:26:11 +03:00
d43120cb0e refactoring 2021-04-26 14:30:54 +03:00
586e4a8edf start adding buttons 2021-04-26 14:20:09 +03:00
63670c57a8 Add interface for zlib wasm/asmjs module 2021-04-25 21:42:31 +03:00
091d594e0f fix 2021-04-23 15:40:31 +03:00
e8657eff2a [3dParty][socket] add support ixwebsocket for win64 2021-04-23 15:19:05 +03:00
8e2bd3331b don't repeat GetFilesInZip 2021-04-23 13:35:34 +03:00
33b018c910 fix js test 2021-04-23 13:31:09 +03:00
a9f0fcdd47 js don't copy object 2021-04-23 13:09:08 +03:00
1c70fb74a2 disable frameworks on mac 2021-04-23 12:36:28 +03:00
6000880da6 fix 2021-04-23 10:09:13 +03:00
aeae070e20 splitting CreateZipFromFiles into GetZip 2021-04-22 17:53:52 +03:00
166564dc6e AddFileInZip
files are not copied
2021-04-22 14:44:13 +03:00
1254020428 add js OpenZipFromUint8Array 2021-04-22 11:47:38 +03:00
ccd2814bee js test _Zlib_CompressFiles 2021-04-22 11:25:16 +03:00
152300c88e fix js test 2021-04-21 18:04:40 +03:00
1a75df8721 c++ test Zlib_CompressFiles 2021-04-21 14:36:03 +03:00
c6b6a54d79 . 2021-04-21 12:04:43 +03:00
d931a2d160 first Zlib_CompressFiles 2021-04-20 17:29:54 +03:00
27dcbf4b8b Add some info nodes for table. It has not works yet 2021-04-19 18:42:58 +03:00
c8d01a6352 . 2021-04-19 18:16:48 +03:00
d27fc163ca Uint8Array return type and create Zlib_CompressFiles 2021-04-19 18:11:15 +03:00
55766a4b7a [3dParty][websocket] fix include/lib openssl 2021-04-19 14:14:11 +03:00
3c70dc0db4 protectedRanges 2021-04-19 12:29:27 +03:00
0894bcef72 start add table converter. It has not works yet 2021-04-16 18:45:32 +03:00
4b4c0bf00a fiz zlib 2021-04-16 16:30:18 +03:00
e3fc5f2513 Zlib js class 2021-04-16 11:44:50 +03:00
5e2618a81a add macro to graphics 2021-04-16 11:27:22 +03:00
e18873cfa6 [3dParty][websocket] fix includes 2 2021-04-16 01:24:24 +03:00
357539e84e only utf8 paths 2021-04-15 17:27:18 +03:00
cf76729189 return MultiByteToWideChar and delete CPaths 2021-04-15 16:43:45 +03:00
0f9c06bd31 fix js test 2021-04-15 12:51:18 +03:00
bdf9e04eb3 fix types and first js test 2021-04-15 09:55:30 +03:00
f4af806e4f test with new classes CPaths and CFile 2021-04-14 18:33:48 +03:00
7cbfe8eea4 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into feature/webscoket 2021-04-14 12:59:52 +03:00
dcd956e1b6 without wstring 2021-04-14 11:45:31 +03:00
ae784a8e29 [3dParty][websocket] fix socketrocket name 2021-04-13 20:14:33 +03:00
6d5e9a6835 [3dParty][websocket] fix build scripts 2021-04-13 19:57:36 +03:00
819dd7b55f Rename Common/3dParty/socketRocket/socketRocket.pri to Common/3dParty/socketrocket/socketrocket.pri 2021-04-13 19:29:04 +03:00
473caef815 add js test 2021-04-13 16:53:25 +03:00
19a5e3e384 add environment 2021-04-13 14:24:20 +03:00
b1a743bc02 Fix compile 2021-04-13 09:36:36 +03:00
157934032e [3dParty][websocket] build openssl and ixwebsocket for ios 2021-04-12 22:21:13 +03:00
26fe7c877d addition make.py 2021-04-12 18:13:59 +03:00
29252d6ae5 fix types 2021-04-12 15:31:18 +03:00
7f289d4ef0 normal types
return types changed to standard
2021-04-12 14:22:21 +03:00
fe97761316 add all(54) old animations for PP95 2021-04-09 18:09:00 +03:00
a4f5d5cd09 add Zlib_GetPaths 2021-04-09 14:50:53 +03:00
6f45b3d20c no change to ZLibZipUtils 2021-04-09 13:53:24 +03:00
e549e89cd0 fix test 2021-04-09 13:42:49 +03:00
ae204cabcd first test 2021-04-09 12:57:27 +03:00
1a36dc4571 fix build 2021-04-09 11:53:43 +03:00
72bd9836fe fix fill_buffer_filefunc 2021-04-09 10:48:10 +03:00
2a2cafbd65 Compilation with c++17 compiler 2021-04-08 18:34:11 +03:00
91c9fd0679 create ioapibuf
create first version of ioapibuf and add BUILDING_WASM_MODULE in zlib. Will be deleted later.
2021-04-08 16:50:50 +03:00
e0278e4b13 [websocket][interface] refactoring code 2 2021-04-07 19:08:16 +03:00
9f5157dc36 try LoadFileFromArchive
In zlib I do not find functions for working with a buffer, only with files. I'm trying to trick you into making a file from the buffer
2021-04-07 15:43:48 +03:00
32d9962dd1 [websocket][interface] refactoring code 2021-04-06 21:07:53 +03:00
4b1334390c add support void* 2021-04-06 13:43:03 +03:00
3fa91220ae openoffice xml 1.0 2021-04-06 05:03:20 +03:00
03dee31707 add old animations: Spiral In, Flash Once. fix Stretch animation 2021-04-05 16:37:45 +03:00
ab2a640201 Merge branch 'fix/v6.3.0-ppt' into feature/ppt_5 2021-04-05 14:22:33 +03:00
261430fdf9 [3dParty][lib] add build socketRocket for ios & mac 2021-04-02 19:06:13 +03:00
549436e319 add CrawlIn BasicZoom Stretch. Add experimental SpiralIn 2021-04-02 17:26:10 +03:00
83caf6bb40 Merge branch 'feature/ppt_5' of https://github.com/ONLYOFFICE/core into feature/ppt_5 2021-04-02 11:26:51 +03:00
c9a901a737 add FlyIn, Appear 2021-04-02 11:25:35 +03:00
ddeca339dd add FlyIn, Appear 2021-03-31 22:00:04 +03:00
34de10c65f Merge pull request #559 from ONLYOFFICE/feature/odf
Feature/odf
2021-03-31 11:36:31 +03:00
054f1ef270 . 2021-03-31 11:30:20 +03:00
ca45de67c2 openoffice xml 1.0 2021-03-31 11:25:48 +03:00
2dcad83f5e add methods 2021-03-30 18:58:58 +03:00
07e9cc5be2 possible fix
It is possible that doct_bin2docx_dir changes the index.html created by oDoctRenderer.Execute, which is why the shapes disappear.
2021-03-30 15:25:38 +03:00
1659e1380b Merge pull request #557 from ONLYOFFICE/release/v6.3.0
Release/v6.3.0
2021-03-30 14:02:21 +03:00
6c51371d66 Merge pull request #555 from ONLYOFFICE/release/v6.3.0
Release/v6.3.0
2021-03-30 13:50:59 +03:00
baeae4a367 add new functions for write old anim 2021-03-29 18:46:46 +03:00
2c489d7831 fix EPUB validation 2021-03-29 18:20:42 +03:00
a554a07954 Remove ApplicationFontsWorker from doctrenderer 2021-03-29 16:41:17 +03:00
48ad1ef291 empty project 2021-03-29 13:33:18 +03:00
ffb82e3d61 Merge branch 'develop' into feature/ppt_5 2021-03-29 12:14:25 +03:00
ecb8bcd0d4 Merge remote-tracking branch 'origin/release/v6.3.0' into develop 2021-03-29 12:13:30 +03:00
7671dcdac6 fix test
correct size and RGBA format
2021-03-26 09:55:43 +03:00
40595468e7 less me 2021-03-25 16:32:57 +03:00
cd943c43fd less me 2021-03-25 16:08:08 +03:00
3b84a04b3a add raw and ska support 2021-03-25 14:42:13 +03:00
948f3b5e09 [websocket][ios] add wrappers 2021-03-25 11:17:12 +03:00
775ff2e284 fix problem with maximum command line length in Windows 8191 characters 2021-03-24 18:19:33 +03:00
762d17016d Add glew module 2021-03-24 15:17:43 +03:00
d9e7574642 Move ApplicationFontsWorker to graphics library 2021-03-24 15:12:55 +03:00
b81f542613 add mng and psd support
Issue with maximum command line length in Windows 8191 characters
2021-03-24 11:10:59 +03:00
07bab0c3b5 add wbmp, jpc, pgx, pnm, ras support and return no-exception 2021-03-23 18:18:43 +03:00
9a2e6069b3 add gif, ico, tga, pcx support and fix RGBA in jpeg2000 2021-03-23 12:37:26 +03:00
87631cdf58 add jpeg2000 support 2021-03-23 10:57:07 +03:00
fdf85aeae6 Create <p:anim> converter. Convert some animation. Has problem with <p:tavLst> child 2021-03-22 18:26:28 +03:00
dee89eaa13 Merge branch 'feature/ppt_5' of https://github.com/ONLYOFFICE/core into feature/ppt_5 2021-03-19 18:40:15 +03:00
ed3fff4db5 it can convert apear animation. 2021-03-19 18:34:02 +03:00
015a667484 add bmp and tiff support 2021-03-19 18:02:52 +03:00
f5355c19df it can convert apear animation. 2021-03-19 18:02:48 +03:00
c38482bb24 fix BGRA 2021-03-19 13:15:47 +03:00
f39af219f4 add png support 2021-03-19 12:09:28 +03:00
0df2234609 Merge branch 'fix/v6.3.0-ppt' into feature/ppt_5 2021-03-19 10:09:49 +03:00
d15e479a17 Merge branch release/v6.2.0 into develop 2021-03-18 15:14:22 +00:00
cfc17ec834 flip horizontally 2021-03-18 16:44:07 +03:00
ded9f4198f without me 2021-03-18 16:11:25 +03:00
5984794ca5 [3dParty][mobile] add build scripts curl, openssl, ixwebsocket 2021-03-17 19:06:31 +03:00
69c37ebe64 without new class begin 2021-03-17 18:27:10 +03:00
aeb8d53d92 fix canvas size 2021-03-17 14:52:37 +03:00
2dc0233b90 fix upside-down picture 2021-03-17 14:48:55 +03:00
b8fb0d58ad Fix test of the module 2021-03-17 14:50:11 +03:00
e28d040b7b Fix bugs 2021-03-17 14:28:24 +03:00
e63e2c77b8 fix js code 2021-03-17 13:42:21 +03:00
3da2f58ce7 [android][editors] add upload image by curl 2021-03-16 21:05:20 +03:00
9a1f910a4b fix epub test 2021-03-16 18:16:34 +03:00
e5d3ad3083 add first command 2021-03-16 17:57:18 +03:00
3513563ae7 add functions in js model 2021-03-16 17:35:24 +03:00
0f32054f5c add code.js 2021-03-16 12:53:55 +03:00
e693cb433e add anim structure but params may be wrong 2021-03-15 18:47:45 +03:00
8e6c09d77a add raster.js
js module begin
2021-03-15 18:30:23 +03:00
78e211cad4 Add Encode2RGBA and Encode2JPEG 2021-03-15 16:42:09 +03:00
262021c12e realization decode 2021-03-12 19:34:14 +03:00
65b243b19f [android][editors] add async loadUrlImage, reconnect after 2 sec, some feature 2021-03-12 15:15:33 +03:00
f9c0982d85 without tabs 2021-03-12 15:10:08 +03:00
00a553f3f6 add decode 2021-03-12 14:20:16 +03:00
e606d8a110 try use Module 2021-03-12 10:28:02 +03:00
71fa7b2196 Merge pull request #533 from ONLYOFFICE/release/v6.3.0
Release/v6.3.0
2021-03-11 22:11:33 +03:00
049bf6cdd8 first compilation
how to check the compiled javascript code in the browser?
2021-03-11 18:09:28 +03:00
9ba46bb6ba Allow fill forms for native 2021-03-11 18:09:02 +03:00
a0402e1096 fix bug #49043 2021-03-11 18:05:24 +03:00
e096c40166 new CxImage 2021-03-11 15:07:08 +03:00
762b0a07ea try 2021-03-10 17:46:29 +03:00
784c7186a8 try to understand 2021-03-10 17:31:11 +03:00
209f664782 add qt lib and test 2021-03-10 11:55:54 +03:00
67e82e22d8 [x2t] Add IsExt(ConditionalFormattingRule) to Editor.bin 2021-03-10 11:48:36 +03:00
28c7b54c47 add finalize
need to implement wasm/js/raster.js, fix index.html
2021-03-09 17:23:52 +03:00
6cc1d99de6 draft version
errors with __int64
2021-03-09 14:33:19 +03:00
723badfdab [android][editors] add websocket support 2021-02-26 15:03:07 +03:00
802 changed files with 61952 additions and 28272 deletions

47
.gitignore vendored
View File

@ -1,41 +1,4 @@
build/
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/android
Common/3dParty/icu/mac-build
Common/3dParty/cef/win_64
Common/3dParty/cef/win_32
Common/3dParty/cef/linux_64
Common/3dParty/cef/linux_32
Common/3dParty/cef/mac_64
Common/3dParty/curl/win_64
Common/3dParty/curl/win_32
Common/3dParty/curl/linux_64
Common/3dParty/curl/linux_32
Common/3dParty/curl/mac_64
Common/3dParty/v8/.cipd
Common/3dParty/v8/.gclient
Common/3dParty/v8/.gclient_entries
Common/3dParty/v8/v8
Common/3dParty/v8/depot_tools
Common/3dParty/v8/win_64
Common/3dParty/v8/win_32
Common/3dParty/v8/linux_64
Common/3dParty/v8/linux_32
Common/3dParty/v8/mac_64
Common/3dParty/openssl/openssl
**/core_build
**/Release
**/Debug
@ -50,15 +13,7 @@ Thumbs.db
*.xcuserstate
*.xcuserdatad
**/Makefile.*
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2.idl
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2.tlb
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2.h
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_i.c
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_p.c
ASCOfficeXlsFile2/win32/dlldata.c
OfficeUtils/win32/OfficeUtilsLib/OfficeUtilsLib/ReadMe.txt
X2tConverter/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/Makefile
X2tConverter/Common/DocxFormat/DocxFormatLib/Makefile
**/Makefile
*.7z
*.obj
*.pdb

View File

@ -100,9 +100,6 @@ namespace DocFileFormat
typedef std::pair <int, int> Int_Pair;
static const int gc_nZeroWidth = 222;
#define ENCODING_UTF16 1200
#define ENCODING_WINDOWS_1250 1250
#define ENCODING_UTF8 65001

View File

@ -32,7 +32,7 @@
#pragma once
#include <string>
#include <map>
#include <unordered_map>
#include <list>
#include <boost/shared_ptr.hpp>
@ -123,15 +123,15 @@ namespace XMLTools
private:
std::wstring m_Name;
std::wstring m_ElementText;
std::map<std::wstring, std::wstring> m_AttributeMap;
std::map<std::wstring, int> m_ChildMap; //for uniq
std::unordered_map<std::wstring, std::wstring> m_AttributeMap;
std::unordered_map<std::wstring, int> m_ChildMap; //for uniq
std::list<XMLElement> m_Elements;
typedef std::list<XMLElement>::iterator ElementsIterator;
typedef std::list<XMLElement>::const_iterator ElementsIteratorConst;
typedef std::map<std::wstring, std::wstring>::iterator AttMapIterator;
typedef std::map<std::wstring, std::wstring>::const_iterator AttMapIteratorConst;
typedef std::unordered_map<std::wstring, std::wstring>::iterator AttMapIterator;
typedef std::unordered_map<std::wstring, std::wstring>::const_iterator AttMapIteratorConst;
public:

View File

@ -130,7 +130,7 @@ namespace DocFileFormat
if (_webHidden)
{
XMLTools::XMLElement * webHidden = new XMLTools::XMLElement ( L"w:webHidden" );
XMLTools::XMLElement *webHidden = new XMLTools::XMLElement ( L"w:webHidden" );
parent->AppendChild( *webHidden );
RELEASEOBJECT( webHidden );
}
@ -141,322 +141,308 @@ namespace DocFileFormat
{
int nProperty = 0; //for unknown test
switch ( (int)( iter->OpCode ) )
switch ((int)(iter->OpCode))
{
case sprmOldCIstd :
case sprmCIstd : // style id
case sprmOldCIstd:
case sprmCIstd: // style id
{
if (_isRunStyleNeeded && !_webHidden)
{
_currentIstd = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
_currentIstd = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
if (_currentIstd < _doc->Styles->Styles->size())
{
appendValueElement( parent, L"rStyle", StyleSheetMapping::MakeStyleId( _doc->Styles->Styles->at( _currentIstd ) ), true );
appendValueElement(parent, L"rStyle", StyleSheetMapping::MakeStyleId(_doc->Styles->Styles->at(_currentIstd)), true);
}
}
}break;
case sprmCFBiDi :
appendFlagElement( parent, *iter, L"rtl", true );
_isRTL = true;
break;
case sprmOldCFBold :
case sprmCFBold :
appendFlagElement( parent, *iter, L"b", true );
break;
case sprmCFBoldBi :
appendFlagElement( parent, *iter, L"bCs", true );
break;
case sprmOldCFCaps :
case sprmCFCaps :
appendFlagElement( parent, *iter, L"caps", true );
break;
case sprmCFComplexScripts :
appendFlagElement( parent, *iter, L"cs", true );
break;
case sprmCFDStrike :
appendFlagElement( parent, *iter, L"dstrike", true );
break;
case sprmCFEmboss :
appendFlagElement( parent, *iter, L"emboss", true );
break;
case sprmCFImprint :
appendFlagElement( parent, *iter, L"imprint", true );
break;
case sprmOldCFItalic :
case sprmCFItalic :
appendFlagElement( parent, *iter, L"i", true );
break;
case sprmCFItalicBi:
appendFlagElement( parent, *iter, L"iCs", true );
break;
case 0x0875:
appendFlagElement( parent, *iter, L"noProof", true );
break;
case sprmOldCFOutline:
case sprmCFOutline:
appendFlagElement( parent, *iter, L"outline", true );
break;
case sprmOldCFShadow:
case sprmCFShadow:
appendFlagElement( parent, *iter, L"shadow", true );
break;
case sprmOldCFSmallCaps:
case sprmCFSmallCaps:
appendFlagElement( parent, *iter, L"smallCaps", true );
break;
case sprmCFSpecVanish:
appendFlagElement( parent, *iter, L"specVanish", true );
break;
case sprmOldCFStrike:
case sprmCFStrike:
appendFlagElement( parent, *iter, L"strike", true );
break;
case sprmOldCFVanish:
case sprmCFVanish:
appendFlagElement( parent, *iter, L"vanish", true );
break;
case 0x0811:
appendFlagElement( parent, *iter, L"webHidden", true );
break;
case sprmOldCIss:
case sprmCIss:
if (iter->argumentsSize > 0 && iter->Arguments[0] < 3) //Metaevan.doc
appendValueElement( parent, L"vertAlign", FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ), true );
break;
case sprmCRgLid0_80:
case sprmCRgLid0:
}break;
case sprmCFBiDi:
{
appendFlagElement(parent, *iter, L"rtl", true);
_isRTL = true;
}break;
case sprmOldCFBold:
case sprmCFBold:
{
appendFlagElement(parent, *iter, L"b", true);
}break;
case sprmCFBoldBi:
{
appendFlagElement(parent, *iter, L"bCs", true);
}break;
case sprmOldCFCaps:
case sprmCFCaps:
{
appendFlagElement(parent, *iter, L"caps", true);
}break;
case sprmCFComplexScripts:
{
appendFlagElement(parent, *iter, L"cs", true);
}break;
case sprmCFDStrike:
{
appendFlagElement(parent, *iter, L"dstrike", true);
}break;
case sprmCFEmboss:
{
appendFlagElement(parent, *iter, L"emboss", true);
}break;
case sprmCFImprint:
{
appendFlagElement(parent, *iter, L"imprint", true);
}break;
case sprmOldCFItalic:
case sprmCFItalic:
{
appendFlagElement(parent, *iter, L"i", true);
}break;
case sprmCFItalicBi:
{
appendFlagElement(parent, *iter, L"iCs", true);
}break;
case 0x0875:
{
appendFlagElement(parent, *iter, L"noProof", true);
}break;
case sprmOldCFOutline:
case sprmCFOutline:
{
appendFlagElement(parent, *iter, L"outline", true);
}break;
case sprmOldCFShadow:
case sprmCFShadow:
{
appendFlagElement(parent, *iter, L"shadow", true);
}break;
case sprmOldCFSmallCaps:
case sprmCFSmallCaps:
{
appendFlagElement(parent, *iter, L"smallCaps", true);
}break;
case sprmCFSpecVanish:
{
appendFlagElement(parent, *iter, L"specVanish", true);
}break;
case sprmOldCFStrike:
case sprmCFStrike:
{
appendFlagElement(parent, *iter, L"strike", true);
}break;
case sprmOldCFVanish:
case sprmCFVanish:
{
appendFlagElement(parent, *iter, L"vanish", true);
}break;
case 0x0811:
{
appendFlagElement(parent, *iter, L"webHidden", true);
}break;
case sprmOldCIss:
case sprmCIss:
{
if (iter->argumentsSize > 0 && iter->Arguments[0] < 3) //Metaevan.doc
appendValueElement(parent, L"vertAlign", FormatUtils::MapValueToWideString(iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12), true);
}break;
case sprmCRgLid0_80:
case sprmCRgLid0:
{ //latin
LanguageId langid( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
LanguageId langid(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
LanguageIdMapping* langIDMapping = new LanguageIdMapping( lang, Default );
LanguageIdMapping* langIDMapping = new LanguageIdMapping(lang, Default);
langid.Convert( langIDMapping );
langid.Convert(langIDMapping);
RELEASEOBJECT( langIDMapping );
}break;
case sprmOldCLid:
case sprmCRgLid1_80:
case sprmCRgLid1:
RELEASEOBJECT(langIDMapping);
}break;
case sprmOldCLid:
case sprmCRgLid1_80:
case sprmCRgLid1:
{ //east asia
LanguageId langid( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
LanguageId langid(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
LanguageIdMapping* langIDMapping = new LanguageIdMapping( lang, EastAsian );
LanguageIdMapping* langIDMapping = new LanguageIdMapping(lang, EastAsian);
langid.Convert( langIDMapping );
langid.Convert(langIDMapping);
RELEASEOBJECT( langIDMapping );
RELEASEOBJECT(langIDMapping);
}break;
case sprmCLidBi:
{
LanguageId langid(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
case sprmCLidBi:
{
LanguageId langid( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
LanguageIdMapping* langIDMapping = new LanguageIdMapping(lang, Complex);
LanguageIdMapping* langIDMapping = new LanguageIdMapping( lang, Complex );
langid.Convert(langIDMapping);
langid.Convert( langIDMapping );
RELEASEOBJECT( langIDMapping );
}break;
case sprmCBrc80:
case sprmCBrc:
RELEASEOBJECT(langIDMapping);
}break;
case sprmCBrc80:
case sprmCBrc:
{ //borders
XMLTools::XMLElement bdr( L"w:bdr" );
BorderCode bc( iter->Arguments, iter->argumentsSize );
appendBorderAttributes( &bc, &bdr );
parent->AppendChild( bdr );
}break;
case sprmCShd80:
case sprmCShd:
{ //shading
ShadingDescriptor desc( iter->Arguments, iter->argumentsSize );
appendShading( parent, desc );
}break;
case sprmOldCIco:
case sprmCIco:
case sprmCIcoBi:
{//color
colorVal->SetValue( FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ));
XMLTools::XMLElement bdr(L"w:bdr");
BorderCode bc(iter->Arguments, iter->argumentsSize);
appendBorderAttributes(&bc, &bdr);
parent->AppendChild(bdr);
}break;
case sprmCShd80:
case sprmCShd:
{ //shading
ShadingDescriptor desc(iter->Arguments, iter->argumentsSize);
case sprmCCv:
appendShading(parent, desc);
}break;
case sprmOldCIco:
case sprmCIco:
case sprmCIcoBi:
{//color
colorVal->SetValue(FormatUtils::MapValueToWideString(iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12));
}break;
case sprmCCv:
{
std::wstringstream sstream;
sstream << boost::wformat(L"%02x%02x%02x") % iter->Arguments[0] % /*G*/iter->Arguments[1] % /*B*/iter->Arguments[2];
colorVal->SetValue(sstream.str());
}break;
case sprmCOldHighlight:
{
appendValueElement( parent, L"highlight", FormatUtils::MapValueToWideString( iter->Arguments[1], &Global::ColorNameIdentifier[0][0], 17, 12 ), true );
}break;
case sprmCHighlight:
{
appendValueElement( parent, L"highlight", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorNameIdentifier[0][0], 17, 12 ), true );
}break;
case sprmOldCDxaSpace:
case sprmCDxaSpace:
{
appendValueElement( parent, L"spacing", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
}break;
case sprmCFtcBi :
case sprmCOldHighlight:
{
appendValueElement(parent, L"highlight", FormatUtils::MapValueToWideString(iter->Arguments[1], &Global::ColorNameIdentifier[0][0], 17, 12), true);
}break;
case sprmCHighlight:
{
appendValueElement(parent, L"highlight", FormatUtils::MapValueToWideString(iter->Arguments[0], &Global::ColorNameIdentifier[0][0], 17, 12), true);
}break;
case sprmOldCDxaSpace:
case sprmCDxaSpace:
{
appendValueElement(parent, L"spacing", FormatUtils::IntToWideString(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize)), true);
}break;
case sprmCFtcBi:
{//default from FontTable
size_t nIndex = FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize);
if( nIndex < _doc->FontTable->Data.size() )
size_t nIndex = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
if (nIndex < _doc->FontTable->Data.size())
{
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
FontFamilyName* ffn = static_cast<FontFamilyName*>(_doc->FontTable->operator [] (nIndex));
if (ffn)
m_sDefaultFont = ffn->xszFtn;
}
}break;
case sprmCHpsBi :
case sprmCHpsBi:
{
appendValueElement( parent, L"szCs",
FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
appendValueElement(parent, L"szCs",
FormatUtils::IntToWideString(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize)), true);
}
break;
// Font Size in points (2~3276) default 20-half-points
case sprmOldCHps :
// Font Size in points (2~3276) default 20-half-points
case sprmOldCHps:
{
appendValueElement (parent, L"sz",
FormatUtils::IntToWideString (FormatUtils::BytesToUChar (iter->Arguments, 0, iter->argumentsSize) ),
true );
appendValueElement(parent, L"sz",
FormatUtils::IntToWideString(FormatUtils::BytesToUChar(iter->Arguments, 0, iter->argumentsSize)),
true);
}break;
case sprmCHps :
{
appendValueElement (parent, L"sz",
FormatUtils::IntToWideString (FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize) ), true );
case sprmCHps:
{
appendValueElement(parent, L"sz",
FormatUtils::IntToWideString(FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize)), true);
}break;
case sprmCMajority :
case sprmCMajority:
{ //for complex props
}break;
case sprmOldCHpsPos:
case sprmOldCHpsPos:
{ // The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
short nVertPos = FormatUtils::BytesToUChar(iter->Arguments, 0, iter->argumentsSize);
appendValueElement (parent, L"position", nVertPos, true);
appendValueElement(parent, L"position", nVertPos, true);
}break;
case sprmCHpsPos:
case sprmCHpsPos:
{ // The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
short nVertPos = FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize);
appendValueElement (parent, L"position", nVertPos, true);
appendValueElement(parent, L"position", nVertPos, true);
}break;
case sprmOldCHpsKern:
case sprmCHpsKern:
case sprmOldCHpsKern:
case sprmCHpsKern:
{
appendValueElement( parent, L"kern", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
appendValueElement(parent, L"kern", FormatUtils::IntToWideString(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize)), true);
}break;
case sprmOldCFtc:
case sprmCRgFtc0:
case sprmOldCFtc:
case sprmCRgFtc0:
{ // font family
size_t nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
if( nIndex < _doc->FontTable->Data.size() )
size_t nIndex = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
if (nIndex < _doc->FontTable->Data.size())
{
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( L"w:ascii" );
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute(L"w:ascii");
FontFamilyName* ffn = static_cast<FontFamilyName*>(_doc->FontTable->operator [] (nIndex));
m_sAsciiFont = ffn->xszFtn;
ascii->SetValue( FormatUtils::XmlEncode(m_sAsciiFont, true));
rFonts->AppendAttribute( *ascii );
RELEASEOBJECT( ascii );
ascii->SetValue(FormatUtils::XmlEncode(m_sAsciiFont, true));
rFonts->AppendAttribute(*ascii);
RELEASEOBJECT(ascii);
}
}break;
case sprmCRgFtc1:
case sprmCRgFtc1:
{
size_t nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
size_t nIndex = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
if( nIndex >= 0 && nIndex < _doc->FontTable->Data.size() )
if (nIndex >= 0 && nIndex < _doc->FontTable->Data.size())
{
XMLTools::XMLAttribute* eastAsia = new XMLTools::XMLAttribute( L"w:eastAsia" );
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
XMLTools::XMLAttribute* eastAsia = new XMLTools::XMLAttribute(L"w:eastAsia");
FontFamilyName* ffn = static_cast<FontFamilyName*>(_doc->FontTable->operator [] (nIndex));
m_sEastAsiaFont = ffn->xszFtn;
eastAsia->SetValue( FormatUtils::XmlEncode(m_sEastAsiaFont));
rFonts->AppendAttribute( *eastAsia );
RELEASEOBJECT( eastAsia );
eastAsia->SetValue(FormatUtils::XmlEncode(m_sEastAsiaFont));
rFonts->AppendAttribute(*eastAsia);
RELEASEOBJECT(eastAsia);
}
}
break;
case sprmCRgFtc2:
case sprmCRgFtc2:
{
size_t nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
size_t nIndex = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
if( nIndex>=0 && nIndex < _doc->FontTable->Data.size() )
if (nIndex >= 0 && nIndex < _doc->FontTable->Data.size())
{
XMLTools::XMLAttribute* ansi = new XMLTools::XMLAttribute( L"w:hAnsi" );
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
XMLTools::XMLAttribute* ansi = new XMLTools::XMLAttribute(L"w:hAnsi");
FontFamilyName* ffn = static_cast<FontFamilyName*>(_doc->FontTable->operator [] (nIndex));
m_shAnsiFont = ffn->xszFtn;
ansi->SetValue( FormatUtils::XmlEncode(m_shAnsiFont));
rFonts->AppendAttribute( *ansi );
RELEASEOBJECT( ansi );
ansi->SetValue(FormatUtils::XmlEncode(m_shAnsiFont));
rFonts->AppendAttribute(*ansi);
RELEASEOBJECT(ansi);
}
}break;
case sprmOldCKul:
case sprmCKul:
}break;
case sprmOldCKul:
case sprmCKul:
{ //Underlining
appendValueElement( parent, L"u", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::UnderlineCode[0][0], 56, 16 ), true );
appendValueElement(parent, L"u", FormatUtils::MapValueToWideString(iter->Arguments[0], &Global::UnderlineCode[0][0], 56, 16), true);
}
break;
case sprmCCharScale:
break;
case sprmCCharScale:
{ //char width
appendValueElement( parent, L"w", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
}break;
case sprmCSfxText:
appendValueElement(parent, L"w", FormatUtils::IntToWideString(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize)), true);
}break;
case sprmCSfxText:
{ //animation
appendValueElement( parent, L"effect", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::TextAnimation[0][0], 7, 16 ), true );
}break;
case sprmCIdctHint:
appendValueElement(parent, L"effect", FormatUtils::MapValueToWideString(iter->Arguments[0], &Global::TextAnimation[0][0], 7, 16), true);
}break;
case sprmCIdctHint:
{
switch(iter->Arguments[0])
XMLTools::XMLAttribute hint(L"w:hint");
switch (iter->Arguments[0])
{
case 0: break; // default
case 1: break; // eastAsia
case 2: break; // cs
case 1:
{
hint.SetValue(L"eastAsia");
rFonts->AppendAttribute(hint);
}break;
case 2:
{
hint.SetValue(L"eastAsia");
rFonts->AppendAttribute(hint);
}break;
case 0: break; // default
case 0xFF: break; //No ST_Hint equivalent
}
}break;
case sprmCPbiIBullet:
case sprmCPbiIBullet:
{
int nIndex = FormatUtils::BytesToInt32( iter->Arguments, 0, iter->argumentsSize );
if (nIndex >=0)
int nIndex = FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize);
if (nIndex >= 0)
{
std::map<int, int>::iterator it = _doc->PictureBulletsCPsMap.find(nIndex);
if (it != _doc->PictureBulletsCPsMap.end())
@ -465,28 +451,34 @@ namespace DocFileFormat
}
}
}break;
case sprmCPbiGrf:
case sprmCPbiGrf:
{
//used picture bullet
int val = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
int val = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
}break;
case sprmCRsidProp:
case sprmCRsidText:
break;
default:
if (iter->argumentsSize == 2)
case sprmCRsidProp:
case sprmCRsidText:
break;
case sprmCFUsePgsuSettings:
{
nProperty = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
}else
if (iter->argumentsSize == 1)
appendFlagElement(parent, *iter, L"snapToGrid", true);
}break;
default:
{
nProperty = FormatUtils::BytesToUChar( iter->Arguments, 0, iter->argumentsSize );
}
break;
switch (iter->argumentsSize)
{
case 1:
nProperty = FormatUtils::BytesToUChar(iter->Arguments, 0, iter->argumentsSize);
break;
case 2:
nProperty = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
break;
case 4:
nProperty = FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize);
break;
}
}break;
}
}
}
@ -544,7 +536,7 @@ namespace DocFileFormat
if ( flag == 0 )
{
val->SetValue( L"false" );
val->SetValue( L"0" );
ele->AppendAttribute( *val );
node->AppendChild( *ele );
}
@ -587,7 +579,7 @@ namespace DocFileFormat
//invert it
if ( stylesVal )
{
val->SetValue( L"false" );
val->SetValue( L"0" );
ele->AppendAttribute( *val );
}

View File

@ -61,7 +61,7 @@ namespace DocFileFormat
namespace DocFileFormat
{
_UINT32 Converter::Convert(WordDocument* doc, WordprocessingDocument* docx, const ProgressCallback* progress)
_UINT32 Converter::Convert(WordDocument* doc, WordprocessingDocument* docx)
{
if (!doc || !docx) return S_FALSE;
@ -81,21 +81,9 @@ namespace DocFileFormat
}
//write document.xml and the header and footers
MainDocumentMapping mainDocMapping( &context, progress );
MainDocumentMapping mainDocMapping( &context);
doc->Convert( &mainDocMapping );
if ( progress != NULL )
{
progress->OnProgress( progress->caller, DOC_ONPROGRESSEVENT_ID, 810000 );
short cancel = 0;
progress->OnProgressEx( progress->caller, DOC_ONPROGRESSEVENT_ID, 810000, &cancel );
if ( cancel != 0 )
{
return S_FALSE;
}
}
//Write numbering.xml
if (doc->listTable)
{
@ -103,129 +91,43 @@ namespace DocFileFormat
doc->listTable->Convert( &numberingMapping );
}
if ( progress != NULL )
{
progress->OnProgress( progress->caller, DOC_ONPROGRESSEVENT_ID, 850000 );
short cancel = 0;
progress->OnProgressEx( progress->caller, DOC_ONPROGRESSEVENT_ID, 850000, &cancel );
if ( cancel != 0 )
{
return S_FALSE;
}
}
if ( progress != NULL )
{
progress->OnProgress( progress->caller, DOC_ONPROGRESSEVENT_ID, 875000 );
short cancel = 0;
progress->OnProgressEx( progress->caller, DOC_ONPROGRESSEVENT_ID, 875000, &cancel );
if ( cancel != 0 )
{
return S_FALSE;
}
}
//write the footnotes
FootnotesMapping footnotesMapping( &context );
doc->Convert( &footnotesMapping );
if ( progress != NULL )
{
progress->OnProgress( progress->caller, DOC_ONPROGRESSEVENT_ID, 900000 );
short cancel = 0;
progress->OnProgressEx( progress->caller, DOC_ONPROGRESSEVENT_ID, 900000, &cancel );
if ( cancel != 0 )
{
return S_FALSE;
}
}
//write the endnotes
EndnotesMapping endnotesMapping( &context );
doc->Convert( &endnotesMapping );
if ( progress != NULL )
{
progress->OnProgress( progress->caller, DOC_ONPROGRESSEVENT_ID, 925000 );
short cancel = 0;
progress->OnProgressEx( progress->caller, DOC_ONPROGRESSEVENT_ID, 925000, &cancel );
if ( cancel != 0 )
{
return S_FALSE;
}
}
//write the comments
CommentsMapping commentsMapping( &context );
doc->Convert( &commentsMapping );
if ( progress != NULL )
{
progress->OnProgress( progress->caller, DOC_ONPROGRESSEVENT_ID, 950000 );
short cancel = 0;
progress->OnProgressEx( progress->caller, DOC_ONPROGRESSEVENT_ID, 950000, &cancel );
if ( cancel != 0 )
{
return S_FALSE;
}
}
//write settings.xml at last because of the rsid list
if (doc->DocProperties)
{
SettingsMapping settingsMapping( &context );
doc->DocProperties->Convert( &settingsMapping );
}
if ( progress != NULL )
{
progress->OnProgress( progress->caller, DOC_ONPROGRESSEVENT_ID, 975000 );
short cancel = 0;
progress->OnProgressEx( progress->caller, DOC_ONPROGRESSEVENT_ID, 975000, &cancel );
if ( cancel != 0 )
{
return S_FALSE;
}
}
return S_OK;
}
_UINT32 Converter::LoadAndConvert(const std::wstring& strSrcFile, const std::wstring& strDstDirectory, const std::wstring& password, const ProgressCallback* progress, bool &bMacros)
_UINT32 Converter::LoadAndConvert(const std::wstring& strSrcFile, const std::wstring& strDstDirectory, const std::wstring& password, bool &bMacros)
{
WordDocument doc(progress, m_sTempFolder, m_nUserLCID);
WordDocument doc(m_sTempFolder, m_nUserLCID);
WordprocessingDocument docx(strDstDirectory, &doc);
_UINT32 result = doc.LoadDocument(strSrcFile, password);
if (result == 0)
{
result = Convert(&doc, &docx, progress);
result = Convert(&doc, &docx);
if (result == 0)
{
docx.SaveDocument(bMacros);
if (progress)progress->OnProgress(progress->caller, DOC_ONPROGRESSEVENT_ID, 1000000);
short cancel = 0;
if (progress)progress->OnProgressEx(progress->caller, DOC_ONPROGRESSEVENT_ID, 1000000, &cancel);
if (0 != cancel)
{
return S_FALSE;
}
result = docx.SaveDocument(bMacros);
}
}

View File

@ -34,8 +34,6 @@
#include <string>
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
struct ProgressCallback;
namespace DocFileFormat
{
class WordDocument;
@ -50,9 +48,9 @@ namespace DocFileFormat
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);
_UINT32 LoadAndConvert(const std::wstring & strSrcFile, const std::wstring & strDstDirectory, const std::wstring & password, bool &bMacros);
private:
_UINT32 Convert(WordDocument* doc, WordprocessingDocument* docx, const ProgressCallback* progress);
_UINT32 Convert(WordDocument* doc, WordprocessingDocument* docx);
};
}

View File

@ -52,9 +52,9 @@ namespace DocFileFormat
m_bInternalXmlWriter = false;
_writeWebHidden = false;
_isSectionPageBreak = 0;
_isTextBoxContent = false;
m_context->_docx->_isSectionPageBreak = 0;
//--------------------------------------------
_embeddedObject = false;
}
@ -68,11 +68,12 @@ namespace DocFileFormat
m_bInternalXmlWriter = false;
_writeWebHidden = false;
_isSectionPageBreak = 0;
_isTextBoxContent = false;
_embeddedObject = false;
_cacheListNum = -1;
m_context->_docx->_isSectionPageBreak = 0;
}
DocumentMapping::~DocumentMapping()
@ -115,7 +116,7 @@ namespace DocFileFormat
{
if ((fc >= m_document->ListPlex->CharacterPositions[i-1]) && (fc_end <= m_document->ListPlex->CharacterPositions[i]))
{
ListNumCache* listNum = dynamic_cast<ListNumCache*> (m_document->ListPlex->Elements[i-1]);
ListNumCache* listNum = dynamic_cast<ListNumCache*> (m_document->ListPlex->Elements[i - 1]);
return listNum->value;
}
@ -233,7 +234,7 @@ namespace DocFileFormat
}
//-----------------------------------------------------------
//_cacheListNum = getListNumCache(fc, fcEnd);
_isSectionPageBreak = 0;
m_context->_docx->_isSectionPageBreak = 0;
if (sectionEnd)
{
// this is the last paragraph of this section
@ -244,7 +245,7 @@ namespace DocFileFormat
ParagraphPropertiesMapping oMapping(m_pXmlWriter, m_context, m_document, paraEndChpx, isBidi, findValidSepx(cpEnd), _sectionNr);
papx->Convert(&oMapping);
_isSectionPageBreak = oMapping.get_section_page_break();
m_context->_docx->_isSectionPageBreak = oMapping.get_section_page_break();
}
++_sectionNr;
@ -360,8 +361,10 @@ namespace DocFileFormat
RELEASEOBJECT(chpxFcs);
RELEASEOBJECT(chpxs);
return cpEnd++;
return (std::max)(cp, cpEnd); //ralph_scovile.doc
}
void DocumentMapping::writeParagraphRsid (const ParagraphPropertyExceptions* papx)
@ -515,6 +518,7 @@ namespace DocFileFormat
std::wstring PAGEREF ( L"PAGEREF" );
std::wstring PAGE ( L"PAGE" );
std::wstring SHAPE ( L"SHAPE" );
std::wstring NREF ( L"NREF");
if (arField.empty() == false)
f = arField[0];
@ -535,8 +539,9 @@ namespace DocFileFormat
bool bEquation = search( f.begin(), f.end(), Equation.begin(), Equation.end()) != f.end();
bool bPAGE = search( f.begin(), f.end(), PAGE.begin(), PAGE.end()) != f.end();
bool bTOC = search( f.begin(), f.end(), TOC.begin(), TOC.end()) != f.end();
bool bSHAPE = search( f.begin(), f.end(), SHAPE.begin(), SHAPE.end()) != f.end();
bool bSHAPE = search( f.begin(), f.end(), SHAPE.begin(), SHAPE.end()) != f.end();
bool bNREF = search( f.begin(), f.end(), NREF.begin(), NREF.end()) != f.end();
bool bPAGEREF = false;
if (bHYPERLINK && arField.size() > 1)
{
@ -630,8 +635,8 @@ namespace DocFileFormat
d = (int)_writeTocLink.find(L" ");
_writeTocLink = _writeTocLink.substr(0, d);
_writeAfterRun = std::wstring (L"<w:hyperlink w:anchor = \"");
_writeAfterRun += _writeTocLink;
_writeAfterRun = std::wstring (L"<w:hyperlink w:anchor=\"");
_writeAfterRun += XmlUtils::EncodeXmlString(_writeTocLink);
_writeAfterRun += std::wstring (L"\" w:history=\"1\">");
break;
@ -823,8 +828,10 @@ namespace DocFileFormat
}
else if (TextMark::PageBreakOrSectionMark == code)
{
if (_isSectionPageBreak == 0)
if (m_context->_docx->_isSectionPageBreak == 0 || m_context->_docx->_isSectionPageBreak == 2)
{
m_context->_docx->_isSectionPageBreak = -1;
writeTextElement(text, textType);
text.clear();
@ -912,22 +919,26 @@ namespace DocFileFormat
//<w:sym w:font="Symbol" w:char="F062"/>
m_pXmlWriter->WriteNodeBegin(L"w:sym", true);
m_pXmlWriter->WriteAttribute(L"w:font", FormatUtils::XmlEncode(s.FontName));
m_pXmlWriter->WriteAttribute(L"w:char", FormatUtils::XmlEncode(s.HexValue));
m_pXmlWriter->WriteNodeEnd(L"", true);
if (false == s.HexValue.empty()) //09FluGuide.doc - поврежденный
{
m_pXmlWriter->WriteNodeBegin(L"w:sym", true);
if (false == s.FontName.empty()) // ??? default
m_pXmlWriter->WriteAttribute(L"w:font", FormatUtils::XmlEncode(s.FontName));
m_pXmlWriter->WriteAttribute(L"w:char", FormatUtils::XmlEncode(s.HexValue));
m_pXmlWriter->WriteNodeEnd(L"", true);
}
}
else if ((TextMark::DrawnObject == code) && fSpec)
{
Spa* pSpa = NULL;
Spa* pSpa = NULL;
if (typeid(*this) == typeid(MainDocumentMapping))
{
pSpa = static_cast<Spa*>(m_document->OfficeDrawingPlex->GetStruct(cp));
pSpa = static_cast<Spa*>(m_document->OfficeDrawingPlex->GetStruct(cp));
}
else if ((typeid(*this) == typeid(HeaderMapping) ) || ( typeid(*this) == typeid(FooterMapping)))
{
int headerCp = ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn );
pSpa = static_cast<Spa*>(m_document->OfficeDrawingPlexHeader->GetStruct(headerCp));
int headerCp = ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn );
pSpa = static_cast<Spa*>(m_document->OfficeDrawingPlexHeader->GetStruct(headerCp));
}
bool bPicture = false;
@ -1029,7 +1040,7 @@ namespace DocFileFormat
}
else
{
VMLShapeMapping oVmlMapper(m_context, &pictWriter, NULL, &oPicture, _caller, isInline);
VMLShapeMapping oVmlMapper(m_context, &pictWriter, NULL, &oPicture, _caller, isInline, false);
oPicture.shapeContainer->Convert(&oVmlMapper);
}
@ -1786,7 +1797,11 @@ namespace DocFileFormat
{
if ((m_document->FootnoteReferenceCharactersPlex != NULL) && (m_document->FootnoteReferenceCharactersPlex->IsCpExists(cp)))
{
FootnoteDescriptor* desc = dynamic_cast<FootnoteDescriptor*>(m_document->FootnoteReferenceCharactersPlex->Elements[_footnoteNr]);
FootnoteDescriptor* desc = NULL;
if (_footnoteNr < m_document->FootnoteReferenceCharactersPlex->Elements.size())
desc = dynamic_cast<FootnoteDescriptor*>(m_document->FootnoteReferenceCharactersPlex->Elements[_footnoteNr]);
if ((desc) && (false == desc->bUsed))
{
desc->bUsed = true;

View File

@ -154,7 +154,7 @@ namespace DocFileFormat
int _endnoteNr;
int _commentNr;
bool _isTextBoxContent;
int _isSectionPageBreak; //0 - not set, 1 -page break, 2 - continues
// int _isSectionPageBreak; //0 - not set, 1 -page break, 2 - continues, -1 - already
bool _writeWebHidden;
std::wstring _writeAfterRun;
std::wstring _lastOLEObject;

View File

@ -444,40 +444,50 @@ namespace DocFileFormat
rsidRoot = FormatUtils::BytesToInt32(bytes, 588, size);
//unused 2
if (size > 594 && size > 609) //start && stop bound /* && fib->m_FibNew.nFibNew > Fib2002*/
if (size > 594 && size > 609)
{
//split bytes 592,593,594,595 into bits
fTreatLockAtnAsReadOnly = FormatUtils::GetBitFromBytes((bytes + 592), 4, 0);
fStyleLock = FormatUtils::GetBitFromBytes((bytes + 592), 4, 1);
fAutoFmtOverride = FormatUtils::GetBitFromBytes((bytes + 592), 4, 2);
fRemoveWordML = FormatUtils::GetBitFromBytes((bytes + 592), 4, 3);
fApplyCustomXForm = FormatUtils::GetBitFromBytes((bytes + 592), 4, 4);
fStyeLockEnforced = FormatUtils::GetBitFromBytes((bytes + 592), 4, 5);
fFakeLockAtn = FormatUtils::GetBitFromBytes((bytes + 592), 4, 6);
fIgnoreMixedContent = FormatUtils::GetBitFromBytes((bytes + 592), 4, 7);
fShowPlaceholderText = FormatUtils::GetBitFromBytes((bytes + 592), 4, 8);
grf = FormatUtils::GetUIntFromBytesBits((bytes + 592), 4, 9, 23);
const size_t dop2003_offset = 594;
//split bytes 596 and 597 into bits
fReadingModeInkLockDown = FormatUtils::GetBitFromBytes((bytes + 596), 2, 0);
fAcetateShowInkAtn = FormatUtils::GetBitFromBytes((bytes + 596), 2, 1);
fFilterDttm = FormatUtils::GetBitFromBytes((bytes + 596), 2, 2);
fEnforceDocProt = FormatUtils::GetBitFromBytes((bytes + 596), 2, 3);
iDocProtCur = (unsigned short)FormatUtils::GetUIntFromBytesBits((bytes + 596), 2, 4, 3);
fDispBkSpSaved = FormatUtils::GetBitFromBytes((bytes + 596), 2, 7);
_UINT32 flags = FormatUtils::BytesToUInt32(bytes, dop2003_offset, size);
fTreatLockAtnAsReadOnly = GETBIT(flags, 0);
fStyleLock = GETBIT(flags, 1);
fAutoFmtOverride = GETBIT(flags, 2);
fRemoveWordML = GETBIT(flags, 3);
fApplyCustomXForm = GETBIT(flags, 4);
fStyeLockEnforced = GETBIT(flags, 5);
fFakeLockAtn = GETBIT(flags, 6);
fIgnoreMixedContent = GETBIT(flags, 7);
fShowPlaceholderText = GETBIT(flags, 8);
bool unused = GETBIT(flags, 9);
fWord97Doc = GETBIT(flags, 10);
fStyleLockTheme = GETBIT(flags, 11);
fStyleLockQFSet = GETBIT(flags, 12);
//empty = 19
dxaPageLock = FormatUtils::BytesToInt16(bytes, 598, size);
dyaPageLock = FormatUtils::BytesToInt16(bytes, 600, size);
pctFontLock = FormatUtils::BytesToInt32(bytes, 602, size);
grfitbid = bytes[606];
//unsigned char 607 is unused
ilfoMacAtCleanup = FormatUtils::BytesToUInt16(bytes, 608, size);
BYTE flags2 = bytes[dop2003_offset + 4];
fReadingModeInkLockDown = GETBIT(flags2, 0);
fAcetateShowInkAtn = GETBIT(flags2, 1);
fFilterDttm = GETBIT(flags2, 2);
fEnforceDocProt = GETBIT(flags2, 3);
iDocProtCur = GETBITS(flags2, 4, 6);
fDispBkSpSaved = GETBIT(flags2, 7);
//empty2 = 8
dxaPageLock = FormatUtils::BytesToInt32(bytes, dop2003_offset + 6, size);
dyaPageLock = FormatUtils::BytesToInt32(bytes, dop2003_offset + 10, size);
pctFontLock = FormatUtils::BytesToInt32(bytes, dop2003_offset + 14, size);
grfitbid = bytes[dop2003_offset + 18];
//empty3 = 8
ilfoMacAtCleanup = FormatUtils::BytesToUInt16(bytes, dop2003_offset + 20, size);
if (size > 616 && size > 621) //start && stop bound /* && fib->m_FibNew.nFibNew > Fib2003*/
{
const size_t dop2007_offset = 616;
//4 bytes reserved
bool fRMTrackFormatting = FormatUtils::GetBitFromBytes((bytes + 620), 2, 0);
bool fRMTrackMoves = FormatUtils::GetBitFromBytes((bytes + 620), 2, 1);
bool fRMTrackFormatting = FormatUtils::GetBitFromBytes((bytes + dop2007_offset + 4), 2, 0);
bool fRMTrackMoves = FormatUtils::GetBitFromBytes((bytes + dop2007_offset + 4), 2, 1);
//dopMth = 34 bytes from 624 = 658
if (size > 674/* && fib->m_FibNew.nFibNew > Fib2007*/)
@ -799,13 +809,12 @@ namespace DocFileFormat
fFakeLockAtn = false;
fIgnoreMixedContent = false;
fShowPlaceholderText = false;
grf = 0;
fReadingModeInkLockDown = false;
fAcetateShowInkAtn = false;
fFilterDttm = false;
fEnforceDocProt = false;
iDocProtCur = 0;
fDispBkSpSaved = true;
fDispBkSpSaved = false;
dxaPageLock = 0;
dyaPageLock = 0;
pctFontLock = 0;

View File

@ -570,7 +570,11 @@ namespace DocFileFormat
bool fIgnoreMixedContent;
// XML Option: Show placeholder text for all empty XML elements
bool fShowPlaceholderText;
unsigned int grf;
bool fWord97Doc = false;
bool fStyleLockTheme = false;
bool fStyleLockQFSet = false;
// Reading mode: ink lock down
bool fReadingModeInkLockDown;
// Track changes: Show ink annotations
@ -587,9 +591,9 @@ namespace DocFileFormat
unsigned short iDocProtCur;
bool fDispBkSpSaved;
// Reading Layout page size lockdown
short dxaPageLock;
int dxaPageLock;
// Reading Layout page size lockdown
short dyaPageLock;
int dyaPageLock;
// Reading Layout font lockdown
int pctFontLock;
unsigned char grfitbid;

View File

@ -34,9 +34,8 @@
namespace DocFileFormat
{
MainDocumentMapping::MainDocumentMapping (ConversionContext* ctx, const ProgressCallback* ffCallBack) : DocumentMapping( ctx, this ), m_ffCallBack(NULL)
MainDocumentMapping::MainDocumentMapping (ConversionContext* ctx) : DocumentMapping( ctx, this )
{
m_ffCallBack = ffCallBack;
}
MainDocumentMapping::~MainDocumentMapping()
@ -168,24 +167,6 @@ namespace DocFileFormat
cp = m_document->FIB->m_RgLw97.ccpText;
}
if (m_ffCallBack)
{
if (( (unsigned int) cp > (progressStep * index) ) && (m_ffCallBack))
{
double progress = ( double( 800000 - 500000 ) / m_document->FIB->m_RgLw97.ccpText * cp );
m_ffCallBack->OnProgress (m_ffCallBack->caller, DOC_ONPROGRESSEVENT_ID, long( 500000 + progress ));
short bCancel = 0;
m_ffCallBack->OnProgressEx (m_ffCallBack->caller, DOC_ONPROGRESSEVENT_ID, long( 500000 + progress ), &bCancel);
if (0 != bCancel)
return;
++index;
}
}
}
//write the section properties of the body with the last SEPX

View File

@ -41,12 +41,9 @@ namespace DocFileFormat
class MainDocumentMapping : public DocumentMapping
{
public:
MainDocumentMapping (ConversionContext* ctx, const ProgressCallback* ffCallBack);
MainDocumentMapping (ConversionContext* ctx);
virtual ~MainDocumentMapping();
virtual void Apply (IVisitable* visited);
private:
const ProgressCallback* m_ffCallBack;
};
}

View File

@ -40,7 +40,7 @@ namespace DocFileFormat
public:
static const unsigned short TYPE_CODE_0xF00D = 0xF00D;
OfficeArtClientTextbox () : Record(), m_nIndex(0)
OfficeArtClientTextbox () : Record()
{
}
@ -50,24 +50,15 @@ namespace DocFileFormat
unsigned int number = Reader->ReadUInt16();
m_nIndex = Reader->ReadUInt16();
}
virtual ~OfficeArtClientTextbox()
{
}
virtual Record* NewObject(IBinaryReader* reader, unsigned int bodySize, unsigned int typeCode, unsigned int version, unsigned int instance)
{
return new OfficeArtClientTextbox(reader, bodySize, typeCode, version, instance);
}
inline int GetIndex ()
{
return m_nIndex;
}
public:
int m_nIndex;
int m_nIndex = 0;
};
}

View File

@ -661,7 +661,8 @@ namespace DocFileFormat
//Vinci_Customer_Case_Study.doc
_isSectionPageBreak = 1;
}
else _isSectionPageBreak = 2;
else
_isSectionPageBreak = 2;
RELEASEOBJECT( sectionPropertiesMapping );
_pPr->AppendChild( sectPr );

View File

@ -393,8 +393,15 @@ namespace DocFileFormat
//read from pcd.fc to fcEnd
int cb = fcEnd - (int)pcd.fc;
if (cb <= 0)
break;
if (cb == 0) //ralph_scovile.doc
{
if (pcd.cpEnd - pcd.cpStart < 2) // com2010_0624pl01.doc
cb = pcdFcEnd - (int)pcd.fc;
if (cb <= 0)
break;
}
else if (cb < 0)
break;
if (!ReadSymbolsBuffer((int)pcd.fc, cb, pcd.code_page, word, encodingChars))
break;

View File

@ -439,15 +439,15 @@ namespace DocFileFormat
val.SetValue( getBorderType( brc->brcType ));
border->AppendAttribute( val );
XMLTools::XMLAttribute color( L"w:color" );
color.SetValue( RGBColor( brc->cv, RedFirst ).SixDigitHexCode);
border->AppendAttribute( color );
XMLTools::XMLAttribute space( L"w:space" , FormatUtils::IntToWideString( brc->dptSpace ));
border->AppendAttribute( space );
XMLTools::XMLAttribute sz( L"w:sz", FormatUtils::IntToWideString( brc->dptLineWidth ));
border->AppendAttribute( sz );
XMLTools::XMLAttribute space( L"w:space" , FormatUtils::IntToWideString( brc->dptSpace ));
border->AppendAttribute( space );
XMLTools::XMLAttribute color( L"w:color" );
color.SetValue( RGBColor( brc->cv, RedFirst ).SixDigitHexCode);
border->AppendAttribute( color );
if ( brc->fShadow )
{

View File

@ -108,7 +108,7 @@ namespace DocFileFormat
switch (iter->OpCode)
{
case sprmOldSGprfIhdt:
case sprmSGprfIhdt:
//case sprmSGprfIhdt: //betesil_pl_it.doc
{
fHF = FormatUtils::BytesToUChar( iter->Arguments, 0, iter->argumentsSize );
}break;
@ -162,6 +162,7 @@ namespace DocFileFormat
//MUST be ignored if the section does not have page number restart enabled.([MS-DOC] — v20101113. стр 152)
bool bWasSprmSFPgnRestart = false;
std::wstring wsSprmSPgnStart;
int nProperty = 0; // for unknown
for (std::list<SinglePropertyModifier>::iterator iter = sepx->grpprl->begin(); iter != sepx->grpprl->end(); ++iter)
{
@ -474,9 +475,14 @@ namespace DocFileFormat
break;
default:
if (iter->argumentsSize == 2)
{
int sz = iter->argumentsSize;
}break;
nProperty = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
}
else if (iter->argumentsSize == 1)
{
nProperty = FormatUtils::BytesToUChar(iter->Arguments, 0, iter->argumentsSize);
}
}
}

View File

@ -60,7 +60,6 @@ namespace DocFileFormat
}
Spa();
virtual ~Spa();
virtual ByteStructure* ConstructObject(VirtualStreamReader* reader, int length);
@ -68,7 +67,6 @@ namespace DocFileFormat
{
return spid;
}
private:
/// Shape Identifier. Used in conjunction with the office art data

View File

@ -114,7 +114,7 @@ namespace DocFileFormat
TC80 oTC80;
oTC80.ftsWidth = Global::dxa;
oTC80.wWidth = 3190;
oTC80.wWidth = 0;
oTC80.brcTop = new BorderCode();
oTC80.brcLeft = new BorderCode();

View File

@ -98,12 +98,23 @@ namespace DocFileFormat
m_pXmlWriter->WriteAttribute( L"w:styleId", FormatUtils::XmlEncode(MakeStyleId( *iter )));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
// <w:name val="" />
// <w:name val="" />
std::wstring sName = FormatUtils::XmlEncode(getStyleName(*iter), true);
m_pXmlWriter->WriteNodeBegin( L"w:name", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(getStyleName( *iter ), true ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
if ((*iter)->sti == StyleIdentifier::Normal)
m_pXmlWriter->WriteAttribute(L"w:val", L"Normal");
else
m_pXmlWriter->WriteAttribute(L"w:val", sName);
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
// <w:basedOn val="" />
if ((*iter)->sti == StyleIdentifier::Normal) // ??? < sti < 159
{
m_pXmlWriter->WriteNodeBegin(L"w:aliases", TRUE);
m_pXmlWriter->WriteAttribute(L"w:val", sName);
m_pXmlWriter->WriteNodeEnd(L"", TRUE);
}
// <w:basedOn val="" />
if ( ( (*iter)->istdBase != 4095 ) && ( (*iter)->istdBase < sheet->Styles->size() ) )
{
m_pXmlWriter->WriteNodeBegin( L"w:basedOn", TRUE );
@ -111,7 +122,7 @@ namespace DocFileFormat
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
}
// <w:next val="" />
// <w:next val="" />
if ( (*iter)->istdNext < sheet->Styles->size() )
{
m_pXmlWriter->WriteNodeBegin( L"w:next", TRUE );
@ -119,7 +130,7 @@ namespace DocFileFormat
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
}
// <w:link val="" />
// <w:link val="" />
if ( (*iter)->istdLink < sheet->Styles->size() )
{
m_pXmlWriter->WriteNodeBegin( L"w:link", TRUE );

View File

@ -63,10 +63,6 @@ namespace DocFileFormat
RELEASEOBJECT(_tcPr);
RELEASEOBJECT(_tcMar);
RELEASEOBJECT(_tcBorders);
RELEASEOBJECT(_brcTop);
RELEASEOBJECT(_brcLeft);
RELEASEOBJECT(_brcRight);
RELEASEOBJECT(_brcBottom);
}
}
@ -97,7 +93,6 @@ namespace DocFileFormat
}
}
bool bPresentDefTable = false;
for (std::list<SinglePropertyModifier>::reverse_iterator iter = tapx->grpprl->rbegin(); iter != tapx->grpprl->rend(); ++iter)
{
@ -111,6 +106,18 @@ namespace DocFileFormat
bPresentDefTable = true;
SprmTDefTable tdef(iter->Arguments, iter->argumentsSize);
bool bUseWidth = true;
for (size_t j = 0; j < tdef.rgTc80.size(); ++j)
{ // 1bc0f6c0-b226-4bcb-912c-e7f97b009d8a.doc
// Технические_Требования_1_287_ДИТ.DOC
if (tdef.rgTc80[j].horzMerge == 0 && tdef.rgTc80[j].wWidth < 1)
{
bUseWidth = false;
break;
}
}
int cc = tdef.numberOfColumns;
_tGrid = tdef.rgdxaCenter;
@ -172,33 +179,23 @@ namespace DocFileFormat
_gridSpan = 1;
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
nComputedCellWidth += bUseWidth ? tdef.rgTc80[ _cellIndex].wWidth :
(tdef.rgdxaCenter[ _cellIndex + 1] - tdef.rgdxaCenter[ _cellIndex ]);
}
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);
_brcTop = std::shared_ptr<BorderCode>(new BorderCode(*_tcDef.brcTop));
_brcLeft = std::shared_ptr<BorderCode>(new BorderCode(*_tcDef.brcLeft));
_brcRight = std::shared_ptr<BorderCode>(new BorderCode(*_tcDef.brcRight));
_brcBottom = std::shared_ptr<BorderCode>(new BorderCode(*_tcDef.brcBottom));
}
}
}
break;
case sprmTDxaCol:
{
}break;
case sprmTCellPadding:
{
unsigned char first = iter->Arguments[0];
@ -237,10 +234,9 @@ namespace DocFileFormat
apppendCellShading(iter->Arguments, iter->argumentsSize, _cellIndex);
}
}break;
case sprmOldTDefTableShd:
case sprmTDefTableShd:
{ // cell shading for cells 0-20
{ // cell shading for cells 0-20
apppendCellShading(iter->Arguments, iter->argumentsSize, _cellIndex);
}break;
@ -248,14 +244,12 @@ namespace DocFileFormat
{ // cell shading for cells 21-42
apppendCellShading(iter->Arguments, iter->argumentsSize, (_cellIndex - 21));
}break;
case sprmTDefTableShd3rd:
{ // cell shading for cells 43-62
apppendCellShading(iter->Arguments, iter->argumentsSize, (_cellIndex - 43));
}break;
case sprmTCellWidth:
{ //width
{ //width
unsigned char first = iter->Arguments[0];
unsigned char lim = iter->Arguments[1];
@ -265,10 +259,9 @@ namespace DocFileFormat
_width = FormatUtils::BytesToInt16(iter->Arguments, 3, iter->argumentsSize);
}
}
break;
break;
case sprmTVertAlign:
{ //vertical alignment
{ //vertical alignment
unsigned char first = iter->Arguments[0];
unsigned char lim = iter->Arguments[1];
@ -278,7 +271,6 @@ namespace DocFileFormat
}
}
break;
case sprmTFitText:
{ //Autofit
unsigned char first = iter->Arguments[0];
@ -290,10 +282,9 @@ namespace DocFileFormat
}
}
break;
case sprmOldTSetBrc:
case sprmTSetBrc:
{ //borders (cell definition)
{ //borders (cell definition)
unsigned char min = iter->Arguments[0];
unsigned char max = iter->Arguments[1];
@ -307,35 +298,34 @@ namespace DocFileFormat
if( FormatUtils::BitmaskToBool( bordersToApply, 0x01 ) )
{
RELEASEOBJECT( _brcTop );
_brcTop = new BorderCode( brcBytes, brcSize );
_brcTop = std::shared_ptr<BorderCode>(new BorderCode( brcBytes, brcSize ));
}
if( FormatUtils::BitmaskToBool( bordersToApply, 0x02 ) )
{
RELEASEOBJECT( _brcLeft );
_brcLeft = new BorderCode( brcBytes, brcSize );
_brcLeft = std::shared_ptr<BorderCode>(new BorderCode( brcBytes, brcSize ));
}
if ( FormatUtils::BitmaskToBool( bordersToApply, 0x04 ) )
{
RELEASEOBJECT( _brcBottom );
_brcBottom = new BorderCode( brcBytes, brcSize );
_brcBottom = std::shared_ptr<BorderCode>(new BorderCode( brcBytes, brcSize ));
}
if ( FormatUtils::BitmaskToBool( bordersToApply, 0x08 ) )
{
RELEASEOBJECT( _brcRight );
_brcRight = new BorderCode( brcBytes, brcSize );
_brcRight = std::shared_ptr<BorderCode>(new BorderCode( brcBytes, brcSize ));
}
}
}
break;
}break;
default:
break;
}
}
if (_gridSpan <= 1 && nComputedCellWidth > _width && _width > 1)
int nComputedCellWidthsGrid = 0;
for (size_t ccc = 0; ccc < _grid->size() && ccc <= _gridIndex; ccc++)
{
nComputedCellWidthsGrid += _grid->at(ccc);
}//zadost.doc
if (_gridSpan <= 1 && nComputedCellWidth > _width && _width > 1 && nComputedCellWidths > nComputedCellWidthsGrid)
{
int width_current = 0;
for (int i = _gridIndex; i < _grid->size(); i++)
@ -349,21 +339,15 @@ namespace DocFileFormat
}
XMLTools::XMLElement tcW ( L"w:tcW" );
XMLTools::XMLAttribute tcWVal ( L"w:w", FormatUtils::IntToWideString( _width > 1 ? _width : nComputedCellWidth) );
XMLTools::XMLAttribute tcWType ( L"w:type", (_width > 1 || nComputedCellWidth > 0) ? FormatUtils::MapValueToWideString( _ftsWidth, &Global::CellWidthTypeMap[0][0], 4, 5 ) : L"auto");
tcW.AppendAttribute( tcWType );
tcW.AppendAttribute( tcWVal );
tcW.AppendAttribute( tcWType );
_tcPr->AppendChild( tcW );
int nComputedCellWidthsGrid = 0;
for (size_t ccc = 0; ccc < _grid->size() && ccc <= _gridIndex; ccc++)
{
nComputedCellWidthsGrid += _grid->at(ccc);
}
if ( _gridSpan == 1 && ( _gridIndex < (int)_grid->size() ) && ( nComputedCellWidths > nComputedCellWidthsGrid ) )
{
//check the number of merged cells
@ -394,28 +378,28 @@ namespace DocFileFormat
if (_brcTop)
{
XMLTools::XMLElement topBorder( L"w:top" );
appendBorderAttributes(_brcTop, &topBorder);
appendBorderAttributes(_brcTop.get(), &topBorder);
addOrSetBorder(_tcBorders, &topBorder );
}
if (_brcLeft )
{
XMLTools::XMLElement leftBorder( L"w:left" );
appendBorderAttributes(_brcLeft, &leftBorder);
appendBorderAttributes(_brcLeft.get(), &leftBorder);
addOrSetBorder(_tcBorders, &leftBorder);
}
if (_brcBottom)
{
XMLTools::XMLElement bottomBorder( L"w:bottom" );
appendBorderAttributes(_brcBottom, &bottomBorder);
appendBorderAttributes(_brcBottom.get(), &bottomBorder);
addOrSetBorder(_tcBorders, &bottomBorder);
}
if (_brcRight)
{
XMLTools::XMLElement rightBorder( L"w:right" );
appendBorderAttributes( _brcRight, &rightBorder );
appendBorderAttributes( _brcRight.get(), &rightBorder );
addOrSetBorder( _tcBorders, &rightBorder );
}

View File

@ -87,15 +87,15 @@ namespace DocFileFormat
const std::vector<short>* _grid;
std::vector<short> _tGrid;
short _width;
int _width;
Global::CellWidthType _ftsWidth;
TC80 _tcDef;
unsigned int _depth;
BorderCode* _brcTop;
BorderCode* _brcLeft;
BorderCode* _brcRight;
BorderCode* _brcBottom;
std::shared_ptr<BorderCode> _brcLeft;
std::shared_ptr<BorderCode> _brcTop;
std::shared_ptr<BorderCode> _brcBottom;
std::shared_ptr<BorderCode> _brcRight;
int _gridSpan;
bool _bCoverCell;

View File

@ -47,491 +47,390 @@ TablePropertiesMapping::~TablePropertiesMapping()
RELEASEOBJECT (_tblPr);
RELEASEOBJECT (_tblGrid);
RELEASEOBJECT (_tblBorders);
RELEASEOBJECT (brcLeft);
RELEASEOBJECT (brcTop);
RELEASEOBJECT (brcBottom);
RELEASEOBJECT (brcRight);
RELEASEOBJECT (brcHorz);
RELEASEOBJECT (brcVert);
}
}
namespace DocFileFormat
void TablePropertiesMapping::Apply(IVisitable* visited)
{
void TablePropertiesMapping::Apply(IVisitable* visited)
TablePropertyExceptions* tapx = static_cast<TablePropertyExceptions*>(visited);
XMLTools::XMLElement tblCellMar(L"w:tblCellMar");
XMLTools::XMLElement tblLayout(L"w:tblLayout");
XMLTools::XMLElement tblpPr(L"w:tblpPr");
XMLTools::XMLAttribute layoutType(L"w:type", L"fixed");
_CP_OPT(short) tblIndent;
short gabHalf = 0;
short marginLeft = 0;
short marginRight = 0;
short cellSpacing = 0;
BYTE itcFirst = 0;
BYTE itcLim = 0;
bool bTableW = false;
for (std::list<SinglePropertyModifier>::iterator iter = tapx->grpprl->begin(); iter != tapx->grpprl->end(); iter++)
{
TablePropertyExceptions* tapx = static_cast<TablePropertyExceptions*>( visited );
XMLTools::XMLElement tblCellMar ( L"w:tblCellMar");
XMLTools::XMLElement tblLayout ( L"w:tblLayout");
XMLTools::XMLElement tblpPr ( L"w:tblpPr");
XMLTools::XMLAttribute layoutType ( L"w:type", L"");
bool bLayoutFixed = true;
//layoutType.SetValue(L"fixed");
_CP_OPT(short) tblIndent;
short gabHalf = 0;
short marginLeft = 0;
short marginRight = 0;
BYTE itcFirst = 0;
BYTE itcLim = 0;
bool bTableW = false;
for ( std::list<SinglePropertyModifier>::iterator iter = tapx->grpprl->begin(); iter != tapx->grpprl->end(); iter++ )
switch (iter->OpCode)
{
switch( iter->OpCode )
case sprmOldTDxaGapHalf:
case sprmTDxaGapHalf:
{
gabHalf = FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize);
}break;
case sprmOldTDefTable:
case sprmTDefTable:
{
//table definition
SprmTDefTable tDef(iter->Arguments, iter->argumentsSize);
//Workaround for retrieving the indent of the table:
//In some files there is a indent but no sprmTWidthIndent is set.
//For this cases we can calculate the indent of the table by getting the
//first boundary of the TDef and adding the padding of the cells
tblIndent = gabHalf + FormatUtils::BytesToInt16(iter->Arguments, 1, iter->argumentsSize);
//If there follows a real sprmTWidthIndent, this value will be overwritten
//tblIndent = (std::max)((int)tblIndent,0); //cerere.doc
}break;
case sprmTTableWidth:
{
//preferred table width
unsigned char fts = iter->Arguments[0];
short width = FormatUtils::BytesToInt16(iter->Arguments, 1, iter->argumentsSize);
XMLTools::XMLElement tblW(L"w:tblW");
XMLTools::XMLAttribute w(L"w:w", FormatUtils::IntToWideString(width));
XMLTools::XMLAttribute type(L"w:type", FormatUtils::MapValueToWideString(fts, &WidthType[0][0], 4, 5));
tblW.AppendAttribute(type);
tblW.AppendAttribute(w);
_tblPr->AppendChild(tblW);
bTableW = true;
}break;
case sprmTMerge:
{
itcFirst = iter->Arguments[0];
itcLim = iter->Arguments[1];
}break;
case sprmTSplit:
{
}break;
case sprmOldTJc:
case sprmTJc:
case sprmTJcRow:
{
appendValueElement(_tblPr, L"jc", FormatUtils::MapValueToWideString(iter->Arguments[0], &Global::JustificationCode[0][0], 10, 15), true);
}break;
case sprmTWidthIndent:
{
tblIndent = FtsWWidth_Indent(iter->Arguments).wWidth;
}break;
case sprmTIstd:
case sprmTIstdPermute:
{
if (_isTableStyleNeeded)
{
case sprmOldTDxaGapHalf:
case sprmTDxaGapHalf:
size_t ind = FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize);
std::wstring id = ind < _styles->Styles->size() ? StyleSheetMapping::MakeStyleId(_styles->Styles->at(ind)) : L"";
if (id != std::wstring(L"TableNormal") && !id.empty())
{
gabHalf = FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize );
}
break;
case sprmOldTDefTable:
case sprmTDefTable:
{
//table definition
SprmTDefTable tDef( iter->Arguments, iter->argumentsSize );
//Workaround for retrieving the indent of the table:
//In some files there is a indent but no sprmTWidthIndent is set.
//For this cases we can calculate the indent of the table by getting the
//first boundary of the TDef and adding the padding of the cells
tblIndent = gabHalf + FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
//If there follows a real sprmTWidthIndent, this value will be overwritten
//tblIndent = (std::max)((int)tblIndent,0); //cerere.doc
}
break;
case sprmTTableWidth:
{
//preferred table width
unsigned char fts = iter->Arguments[0];
short width = FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
XMLTools::XMLElement tblW( L"w:tblW");
XMLTools::XMLAttribute w( L"w:w", FormatUtils::IntToWideString( width ) );
XMLTools::XMLAttribute type( L"w:type", FormatUtils::MapValueToWideString( fts, &WidthType[0][0], 4, 5 ) );
tblW.AppendAttribute( type );
tblW.AppendAttribute( w );
_tblPr->AppendChild( tblW );
bTableW = true;
}
break;
case sprmTMerge:
{
itcFirst = iter->Arguments[0];
itcLim = iter->Arguments[1];
}break;
case sprmTSplit:
{
}break;
case sprmOldTJc:
case sprmTJc:
case sprmTJcRow:
{ //justification
appendValueElement( _tblPr, L"jc" , FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::JustificationCode[0][0], 10, 15 ), true );
}
break;
case sprmTWidthIndent:
{ //indent
tblIndent = FtsWWidth_Indent(iter->Arguments).wWidth;
// tblIndent = FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
}
break;
case sprmTIstd:
case sprmTIstdPermute:
{ //style
if ( _isTableStyleNeeded )
{
size_t ind = FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize );
std::wstring id = ind < _styles->Styles->size() ? StyleSheetMapping::MakeStyleId( _styles->Styles->at( ind ) ) : L"";
if( id != std::wstring( L"TableNormal") && !id.empty() )
{
appendValueElement( _tblPr, L"tblStyle", id, true );
}
}
}
break;
case sprmTFBiDi:
case sprmTFBiDi90:
{ //bidi
appendValueElement( _tblPr, L"bidiVisual", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ), true );
}
break;
case sprmOldTTlp:
case sprmTTlp:
{ //table look
appendValueElement( _tblPr, L"tblLook", FormatUtils::IntToFormattedWideString( FormatUtils::BytesToInt16( iter->Arguments, 2, iter->argumentsSize ), L"%04x" ), true );
}
break;
case sprmTFAutofit:
{//autofit
layoutType.SetValue(L"fixed");
if ( iter->Arguments[0] == 1 )
{
layoutType.SetValue( L"auto" );
bLayoutFixed = false;
}
}break;
case sprmTCellPadding:
case sprmTCellPaddingDefault:
case sprmTCellPaddingOuter:
{ //default cell padding (margin)
unsigned char grfbrc = iter->Arguments[2];
short wMar = FormatUtils::BytesToInt16( iter->Arguments, 4, iter->argumentsSize );
std::wstring strValue = FormatUtils::IntToWideString( wMar );
if ( FormatUtils::BitmaskToBool( (int)grfbrc, 0x01 ) )
{
appendDxaElement( &tblCellMar, L"top" , strValue, true );
}
if ( FormatUtils::BitmaskToBool( (int)grfbrc, 0x02 ) )
{
marginLeft = wMar;
}
if ( FormatUtils::BitmaskToBool( (int)grfbrc, 0x04 ) )
{
appendDxaElement( &tblCellMar, L"bottom", strValue, true );
}
if ( FormatUtils::BitmaskToBool( (int)grfbrc, 0x08 ) )
{
marginRight = wMar;
}
}
break;
case sprmTCHorzBands:
{ //row count
appendValueElement( _tblPr, L"tblStyleRowBandSize", iter->Arguments[0], true );
}
break;
case sprmTCVertBands:
{ //col count
appendValueElement( _tblPr, L"tblStyleColBandSize", iter->Arguments[0], true );
}
break;
case sprmTFNoAllowOverlap:
{ //overlap
std::wstring tblOverlapVal = std::wstring( L"overlap");
if ( iter->Arguments[0] )
{
tblOverlapVal = std::wstring( L"never");
}
appendValueElement( _tblPr, L"tblOverlap", tblOverlapVal, true );
}
break;
case sprmOldTSetShd :
case sprmTSetShdTable :
{ //shading
appendShading( _tblPr, ShadingDescriptor( iter->Arguments, iter->argumentsSize ) );
}
break;
case sprmTTableBorders80:
{ //borders 80 exceptions
const int size = 4;
unsigned char brc80[size];
//top border
memcpy( brc80, iter->Arguments, size );
RELEASEOBJECT( brcTop );
brcTop = new BorderCode( brc80, size );
//left
memcpy( brc80, ( iter->Arguments + 4 ), size );
RELEASEOBJECT( brcLeft );
brcLeft = new BorderCode( brc80, size );
//bottom
memcpy( brc80, ( iter->Arguments + 8 ), size );
RELEASEOBJECT( brcBottom );
brcBottom = new BorderCode( brc80, size );
//right
memcpy( brc80, ( iter->Arguments + 12 ), size );
RELEASEOBJECT( brcRight );
brcRight = new BorderCode( brc80, size );
//inside H
memcpy( brc80, ( iter->Arguments + 16 ), size );
RELEASEOBJECT( brcHorz );
brcHorz = new BorderCode( brc80, size );
//inside V
memcpy( brc80, ( iter->Arguments + 20 ), size );
RELEASEOBJECT( brcVert );
brcVert = new BorderCode( brc80, size );
}
break;
//border exceptions
case sprmOldTTableBorders:
case sprmTTableBorders:
{
const int size = 8;
unsigned char brc[size];
//top border
memcpy( brc, iter->Arguments, size );
RELEASEOBJECT( brcTop );
brcTop = new BorderCode( brc, size );
//left
memcpy( brc, ( iter->Arguments + 8 ), size );
RELEASEOBJECT( brcLeft );
brcLeft = new BorderCode( brc, size );
//bottom
memcpy( brc, ( iter->Arguments + 16 ), size );
RELEASEOBJECT( brcBottom );
brcBottom = new BorderCode( brc, size );
//right
memcpy( brc, ( iter->Arguments + 24 ), size );
RELEASEOBJECT( brcRight );
brcRight = new BorderCode( brc, size );
//inside H
memcpy( brc, ( iter->Arguments + 32 ), size );
RELEASEOBJECT( brcHorz );
brcHorz = new BorderCode( brc, size );
//inside V
memcpy( brc, ( iter->Arguments + 40 ), size );
RELEASEOBJECT( brcVert );
brcVert = new BorderCode( brc, size );
}
break;
//floating table properties
case sprmTPc:
{
unsigned char flag = ( iter->Arguments[0] & 0x30 ) >> 4;
appendValueAttribute( &tblpPr, L"w:vertAnchor", FormatUtils::MapValueToWideString( flag, &Global::VerticalPositionCode[0][0], 4, 7 ) );
flag = ( iter->Arguments[0] & 0xC0 ) >> 6;
appendValueAttribute( &tblpPr, L"w:horzAnchor", FormatUtils::MapValueToWideString( flag, &Global::HorizontalPositionCode[0][0], 4, 7 ) );
}
break;
case sprmTDxaFromText:
{
appendValueAttribute( &tblpPr, L"w:leftFromText", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
}
break;
case sprmTDxaFromTextRight:
{
appendValueAttribute( &tblpPr, L"w:rightFromText", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
}
break;
case sprmTDyaFromText:
{
appendValueAttribute( &tblpPr, L"w:topFromText", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
}
break;
case sprmTDyaFromTextBottom:
{
appendValueAttribute( &tblpPr, L"w:bottomFromText", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
}
break;
case sprmTDxaAbs:
{
appendValueAttribute( &tblpPr, L"w:tblpX", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
}
break;
case sprmTDyaAbs:
{
appendValueAttribute( &tblpPr, L"w:tblpY", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
}
break;
}
}
if (false == bTableW)
{
XMLTools::XMLElement tblW( L"w:tblW");
XMLTools::XMLAttribute w( L"w:w", L"0");
XMLTools::XMLAttribute type( L"w:type", L"auto" );
tblW.AppendAttribute( type );
tblW.AppendAttribute( w );
_tblPr->AppendChild( tblW );
}
//indent
if ( tblIndent )
{
XMLTools::XMLElement tblInd( L"w:tblInd");
XMLTools::XMLAttribute tblIndW( L"w:w", FormatUtils::IntToWideString( *tblIndent ) );
tblInd.AppendAttribute( tblIndW );
XMLTools::XMLAttribute tblIndType( L"w:type", L"dxa");
tblInd.AppendAttribute( tblIndType );
_tblPr->AppendChild( tblInd );
}
//append floating props
if ( tblpPr.GetAttributeCount() > 0 )
{
_tblPr->AppendChild( tblpPr );
}
//set borders
if ( brcTop != NULL )
{
XMLTools::XMLElement topBorder( L"w:top");
appendBorderAttributes( brcTop, &topBorder );
addOrSetBorder( _tblBorders, &topBorder );
}
if ( brcLeft != NULL )
{
XMLTools::XMLElement leftBorder( L"w:left");
appendBorderAttributes( brcLeft, &leftBorder );
addOrSetBorder( _tblBorders, &leftBorder );
}
if ( brcBottom != NULL )
{
XMLTools::XMLElement bottomBorder( L"w:bottom");
appendBorderAttributes( brcBottom, &bottomBorder );
addOrSetBorder( _tblBorders, &bottomBorder );
}
if ( brcRight != NULL )
{
XMLTools::XMLElement rightBorder( L"w:right");
appendBorderAttributes( brcRight, &rightBorder );
addOrSetBorder( _tblBorders, &rightBorder );
}
if ( brcHorz != NULL )
{
XMLTools::XMLElement insideHBorder( L"w:insideH");
appendBorderAttributes( brcHorz, &insideHBorder );
addOrSetBorder( _tblBorders, &insideHBorder );
}
if ( brcVert != NULL )
{
XMLTools::XMLElement insideVBorder( L"w:insideV");
appendBorderAttributes( brcVert, &insideVBorder );
addOrSetBorder( _tblBorders, &insideVBorder );
}
if ( _tblBorders->GetChildCount() > 0 )
{
_tblPr->AppendChild( *_tblBorders );
}
if (false == layoutType.GetValue().empty())
{
tblLayout.AppendAttribute(layoutType);
}
_tblPr->AppendChild( tblLayout );
if ( ( marginLeft == 0 ) && ( gabHalf != 0 ) )
{
appendDxaElement( &tblCellMar, L"left", FormatUtils::IntToWideString( gabHalf ), true );
}
else
{
appendDxaElement( &tblCellMar, L"left", FormatUtils::IntToWideString( marginLeft ), true );
}
if ( ( marginRight == 0 ) && ( gabHalf != 0 ) )
{
appendDxaElement( &tblCellMar, L"right", FormatUtils::IntToWideString( gabHalf ), true );
}
else
{
appendDxaElement( &tblCellMar, L"right", FormatUtils::IntToWideString( marginRight ), true );
}
_tblPr->AppendChild( tblCellMar );
//write Properties
if ( ( _tblPr->GetChildCount() > 0 ) || ( _tblPr->GetAttributeCount() > 0 ) )
{
m_pXmlWriter->WriteString( _tblPr->GetXMLString() );
}
//append the grid
_tblGrid = new XMLTools::XMLElement( L"w:tblGrid");
//Если _grid состоит из одних DocFormatUtils::gc_nZeroWidth и layout != "fixed", значит это doc полученный нами при конвертации из html. Таблицу размеров писать не нужно
bool bWriteGridCol = false;
if (true == bLayoutFixed)
bWriteGridCol = true;
else
{
for ( size_t i = 0, nSize = _grid->size(); i < nSize; i++ )
{
if(_grid->at(i) % DocFileFormat::gc_nZeroWidth != 0)
{
bWriteGridCol = true;
break;
appendValueElement(_tblPr, L"tblStyle", id, true);
}
}
}
if (true == bWriteGridCol)
}break;
case sprmTFBiDi:
case sprmTFBiDi90:
{
for ( size_t i = 0; i < _grid->size(); i++ )
appendValueElement(_tblPr, L"bidiVisual", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize), true);
}break;
case sprmOldTTlp:
case sprmTTlp:
{
appendValueElement(_tblPr, L"tblLook", FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt16(iter->Arguments, 2, iter->argumentsSize), L"%04x"), true);
}break;
case sprmTFAutofit:
{
if (iter->Arguments[0] == 1)
{
XMLTools::XMLElement gridCol( L"w:gridCol");
XMLTools::XMLAttribute gridColW( L"w:w", FormatUtils::IntToWideString( _grid->at( i ) ) );
gridCol.AppendAttribute( gridColW );
_tblGrid->AppendChild( gridCol );
layoutType.SetValue(L"auto");
}
}
}break;
case sprmTCellSpacing:
case sprmTCellSpacingDefault:
{
unsigned char grfbrc = iter->Arguments[2];
short wSpc = FormatUtils::BytesToInt16(iter->Arguments, 4, iter->argumentsSize);
std::wstring strValue = FormatUtils::IntToWideString(wSpc);
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x01))
{
appendDxaElement(_tblPr, L"tblCellSpacing", strValue, true);
}
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x02))
{
cellSpacing = wSpc;
}
}break;
case sprmTCellPadding:
case sprmTCellPaddingDefault:
case sprmTCellPaddingOuter:
{//default cell padding (margin)
unsigned char grfbrc = iter->Arguments[2];
short wMar = FormatUtils::BytesToInt16(iter->Arguments, 4, iter->argumentsSize);
std::wstring strValue = FormatUtils::IntToWideString(wMar);
m_pXmlWriter->WriteString( _tblGrid->GetXMLString() );
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x01))
{
appendDxaElement(&tblCellMar, L"top", strValue, true);
}
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x02))
{
marginLeft = wMar;
}
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x04))
{
appendDxaElement(&tblCellMar, L"bottom", strValue, true);
}
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x08))
{
marginRight = wMar;
}
}break;
case sprmTCHorzBands:
{
appendValueElement(_tblPr, L"tblStyleRowBandSize", iter->Arguments[0], true);
}break;
case sprmTCVertBands:
{
appendValueElement(_tblPr, L"tblStyleColBandSize", iter->Arguments[0], true);
}break;
case sprmTFNoAllowOverlap:
{
std::wstring tblOverlapVal(L"overlap");
if (iter->Arguments[0])
{
tblOverlapVal = L"never";
}
appendValueElement(_tblPr, L"tblOverlap", tblOverlapVal, true);
}break;
case sprmOldTSetShd:
case sprmTSetShdTable:
{
appendShading(_tblPr, ShadingDescriptor(iter->Arguments, iter->argumentsSize));
}break;
case sprmTTableBorders80:
{
const int size = 4;
unsigned char brc80[size];
memcpy(brc80, iter->Arguments, size);
brcTop = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
memcpy(brc80, (iter->Arguments + 4), size);
brcLeft = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
memcpy(brc80, (iter->Arguments + 8), size);
brcBottom = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
memcpy(brc80, (iter->Arguments + 12), size);
brcRight = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
memcpy(brc80, (iter->Arguments + 16), size);
brcHorz = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
memcpy(brc80, (iter->Arguments + 20), size);
brcVert = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
}break;
case sprmOldTTableBorders:
case sprmTTableBorders:
{
const int size = 8;
unsigned char brc[size];
memcpy(brc, iter->Arguments, size);
brcTop = std::shared_ptr<BorderCode>(new BorderCode(brc, size));
memcpy(brc, (iter->Arguments + 8), size);
brcLeft = std::shared_ptr<BorderCode>(new BorderCode(brc, size));
memcpy(brc, (iter->Arguments + 16), size);
brcBottom = std::shared_ptr<BorderCode>(new BorderCode(brc, size));
memcpy(brc, (iter->Arguments + 24), size);
brcRight = std::shared_ptr<BorderCode>(new BorderCode(brc, size));
memcpy(brc, (iter->Arguments + 32), size);
brcHorz = std::shared_ptr<BorderCode>(new BorderCode(brc, size));
memcpy(brc, (iter->Arguments + 40), size);
brcVert = std::shared_ptr<BorderCode>(new BorderCode(brc, size));
}break;
case sprmTPc:
{
unsigned char flag = (iter->Arguments[0] & 0x30) >> 4;
appendValueAttribute(&tblpPr, L"w:vertAnchor", FormatUtils::MapValueToWideString(flag, &Global::VerticalPositionCode[0][0], 4, 7));
flag = (iter->Arguments[0] & 0xC0) >> 6;
appendValueAttribute(&tblpPr, L"w:horzAnchor", FormatUtils::MapValueToWideString(flag, &Global::HorizontalPositionCode[0][0], 4, 7));
}break;
case sprmTDxaFromText:
{
appendValueAttribute(&tblpPr, L"w:leftFromText", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
}break;
case sprmTDxaFromTextRight:
{
appendValueAttribute(&tblpPr, L"w:rightFromText", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
}break;
case sprmTDyaFromText:
{
appendValueAttribute(&tblpPr, L"w:topFromText", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
}break;
case sprmTDyaFromTextBottom:
{
appendValueAttribute(&tblpPr, L"w:bottomFromText", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
}break;
case sprmTDxaAbs:
{
appendValueAttribute(&tblpPr, L"w:tblpX", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
}break;
case sprmTDyaAbs:
{
appendValueAttribute(&tblpPr, L"w:tblpY", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
}break;
}
}
if (false == bTableW)
{
XMLTools::XMLElement tblW(L"w:tblW");
XMLTools::XMLAttribute w(L"w:w", L"0");
XMLTools::XMLAttribute type(L"w:type", L"auto");
tblW.AppendAttribute(type);
tblW.AppendAttribute(w);
_tblPr->AppendChild(tblW);
}
if (tblIndent)
{
XMLTools::XMLElement tblInd(L"w:tblInd");
XMLTools::XMLAttribute tblIndW(L"w:w", FormatUtils::IntToWideString(*tblIndent));
tblInd.AppendAttribute(tblIndW);
XMLTools::XMLAttribute tblIndType(L"w:type", L"dxa");
tblInd.AppendAttribute(tblIndType);
_tblPr->AppendChild(tblInd);
}
if (tblpPr.GetAttributeCount() > 0)
{
_tblPr->AppendChild(tblpPr);
}
if (brcTop)
{
XMLTools::XMLElement topBorder(L"w:top");
appendBorderAttributes(brcTop.get(), &topBorder);
addOrSetBorder(_tblBorders, &topBorder);
}
if (brcLeft)
{
XMLTools::XMLElement leftBorder(L"w:left");
appendBorderAttributes(brcLeft.get(), &leftBorder);
addOrSetBorder(_tblBorders, &leftBorder);
}
if (brcBottom)
{
XMLTools::XMLElement bottomBorder(L"w:bottom");
appendBorderAttributes(brcBottom.get(), &bottomBorder);
addOrSetBorder(_tblBorders, &bottomBorder);
}
if (brcRight)
{
XMLTools::XMLElement rightBorder(L"w:right");
appendBorderAttributes(brcRight.get(), &rightBorder);
addOrSetBorder(_tblBorders, &rightBorder);
}
if (brcHorz)
{
XMLTools::XMLElement insideHBorder(L"w:insideH");
appendBorderAttributes(brcHorz.get(), &insideHBorder);
addOrSetBorder(_tblBorders, &insideHBorder);
}
if (brcVert)
{
XMLTools::XMLElement insideVBorder(L"w:insideV");
appendBorderAttributes(brcVert.get(), &insideVBorder);
addOrSetBorder(_tblBorders, &insideVBorder);
}
if (_tblBorders->GetChildCount() > 0)
{
_tblPr->AppendChild(*_tblBorders);
}
if (false == layoutType.GetValue().empty())
{
tblLayout.AppendAttribute(layoutType);
}
_tblPr->AppendChild(tblLayout);
if ((marginLeft == 0) && (gabHalf != 0))
{
appendDxaElement(&tblCellMar, L"left", FormatUtils::IntToWideString(gabHalf), true);
}
else
{
appendDxaElement(&tblCellMar, L"left", FormatUtils::IntToWideString(marginLeft), true);
}
if ((marginRight == 0) && (gabHalf != 0))
{
appendDxaElement(&tblCellMar, L"right", FormatUtils::IntToWideString(gabHalf), true);
}
else
{
appendDxaElement(&tblCellMar, L"right", FormatUtils::IntToWideString(marginRight), true);
}
_tblPr->AppendChild(tblCellMar);
if ((_tblPr->GetChildCount() > 0) || (_tblPr->GetAttributeCount() > 0))
{
m_pXmlWriter->WriteString(_tblPr->GetXMLString());
}
//append the grid
_tblGrid = new XMLTools::XMLElement(L"w:tblGrid");
for (size_t i = 0; i < _grid->size(); i++)
{
XMLTools::XMLElement gridCol(L"w:gridCol");
XMLTools::XMLAttribute gridColW(L"w:w", FormatUtils::IntToWideString(_grid->at(i)));
gridCol.AppendAttribute(gridColW);
_tblGrid->AppendChild(gridCol);
}
m_pXmlWriter->WriteString(_tblGrid->GetXMLString());
}
}

View File

@ -84,12 +84,12 @@ namespace DocFileFormat
StyleSheet* _styles;
std::vector<short>* _grid;
BorderCode* brcLeft;
BorderCode* brcTop;
BorderCode* brcBottom;
BorderCode* brcRight;
BorderCode* brcHorz;
BorderCode* brcVert;
std::shared_ptr<BorderCode> brcLeft;
std::shared_ptr<BorderCode> brcTop;
std::shared_ptr<BorderCode> brcBottom;
std::shared_ptr<BorderCode> brcRight;
std::shared_ptr<BorderCode> brcHorz;
std::shared_ptr<BorderCode> brcVert;
bool _isTableStyleNeeded;
};

View File

@ -53,6 +53,13 @@ namespace DocFileFormat
{
TablePropertyExceptions* tapx = static_cast<TablePropertyExceptions*>( visited );
std::shared_ptr<BorderCode> brcLeft;
std::shared_ptr<BorderCode> brcTop;
std::shared_ptr<BorderCode> brcBottom;
std::shared_ptr<BorderCode> brcRight;
std::shared_ptr<BorderCode> brcHorz;
std::shared_ptr<BorderCode> brcVert;
//delete infos
RevisionData rev( _rowEndChpx );
@ -84,7 +91,7 @@ namespace DocFileFormat
}
}break;
case sprmTWidthAfter:
{ //width after
{ //width after
XMLTools::XMLElement wAfter( L"w:wAfter" );
XMLTools::XMLAttribute wAfterValue( L"w:w", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize ) ) );
wAfter.AppendAttribute( wAfterValue );
@ -94,7 +101,7 @@ namespace DocFileFormat
_trPr->AppendChild( wAfter, true );
}break;
case sprmTWidthBefore:
{ //width before
{ //width before
short before = FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
if ( before != 0 )
@ -110,7 +117,7 @@ namespace DocFileFormat
}break;
case sprmOldTDyaRowHeight:
case sprmTDyaRowHeight:
{ //row height
{ //row height
XMLTools::XMLElement rowHeight( L"w:trHeight" );
XMLTools::XMLAttribute rowHeightVal( L"w:val" );
XMLTools::XMLAttribute rowHeightRule( L"w:hRule" );
@ -142,113 +149,98 @@ namespace DocFileFormat
case sprmOldTFCantSplit:
case sprmTFCantSplit:
case sprmTFCantSplit90:
{ //can't split
{ //can't split
appendFlagElement( _trPr, *iter, L"cantSplit", true );
}break;
//div id
}break;
case sprmTIpgp:// = PGPInfo.ipgpSelf (PGPInfo structure describes the border and margin properties)
{ //div id
}break;
case sprmTCellSpacing:
case sprmTCellSpacingDefault:
{
unsigned char grfbrc = iter->Arguments[2];
short wSpc = FormatUtils::BytesToInt16(iter->Arguments, 4, iter->argumentsSize);
std::wstring strValue = FormatUtils::IntToWideString(wSpc);
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x01))
{
appendDxaElement(_trPr, L"tblCellSpacing", strValue, true);
}
}break;
case sprmTTableBorders80:
{
const int size = 4;
unsigned char brc80[size];
memcpy(brc80, iter->Arguments, size);
brcTop = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
memcpy(brc80, (iter->Arguments + 4), size);
brcLeft = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
memcpy(brc80, (iter->Arguments + 8), size);
brcBottom = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
memcpy(brc80, (iter->Arguments + 12), size);
brcRight = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
memcpy(brc80, (iter->Arguments + 16), size);
brcHorz = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
memcpy(brc80, (iter->Arguments + 20), size);
brcVert = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
}break;
default:
break;
//borders 80 exceptions
//case SinglePropertyModifier.OperationCode.sprmTTableBorders80:
// unsigned char[] brc80 = new unsigned char[4];
// //top border
// Array.Copy(sprm.Arguments, 0, brc80, 0, 4);
// brcTop = new BorderCode(brc80);
// //left
// Array.Copy(sprm.Arguments, 4, brc80, 0, 4);
// brcLeft = new BorderCode(brc80);
// //bottom
// Array.Copy(sprm.Arguments, 8, brc80, 0, 4);
// brcBottom = new BorderCode(brc80);
// //right
// Array.Copy(sprm.Arguments, 12, brc80, 0, 4);
// brcRight = new BorderCode(brc80);
// //inside H
// Array.Copy(sprm.Arguments, 16, brc80, 0, 4);
// brcHorz = new BorderCode(brc80);
// //inside V
// Array.Copy(sprm.Arguments, 20, brc80, 0, 4);
// brcVert = new BorderCode(brc80);
// break;
//border exceptions
//case SinglePropertyModifier.OperationCode.sprmTTableBorders:
// unsigned char[] brc = new unsigned char[8];
// //top border
// Array.Copy(sprm.Arguments, 0, brc, 0, 8);
// brcTop = new BorderCode(brc);
// //left
// Array.Copy(sprm.Arguments, 8, brc, 0, 8);
// brcLeft = new BorderCode(brc);
// //bottom
// Array.Copy(sprm.Arguments, 16, brc, 0, 8);
// brcBottom = new BorderCode(brc);
// //right
// Array.Copy(sprm.Arguments, 24, brc, 0, 8);
// brcRight = new BorderCode(brc);
// //inside H
// Array.Copy(sprm.Arguments, 32, brc, 0, 8);
// brcHorz = new BorderCode(brc);
// //inside V
// Array.Copy(sprm.Arguments, 40, brc, 0, 8);
// brcVert = new BorderCode(brc);
// break;
}
}
//set borders
//if (brcTop != null)
//{
// XmlNode topBorder = _nodeFactory.CreateNode(XmlNodeType.Element, "w", "top", OpenXmlNamespaces.WordprocessingML);
// appendBorderAttributes(brcTop, topBorder);
// addOrSetBorder(_tblBorders, topBorder);
//}
//if (brcLeft != null)
//{
// XmlNode leftBorder = _nodeFactory.CreateNode(XmlNodeType.Element, "w", "left", OpenXmlNamespaces.WordprocessingML);
// appendBorderAttributes(brcLeft, leftBorder);
// addOrSetBorder(_tblBorders, leftBorder);
//}
//if (brcBottom != null)
//{
// XmlNode bottomBorder = _nodeFactory.CreateNode(XmlNodeType.Element, "w", "bottom", OpenXmlNamespaces.WordprocessingML);
// appendBorderAttributes(brcBottom, bottomBorder);
// addOrSetBorder(_tblBorders, bottomBorder);
//}
//if (brcRight != null)
//{
// XmlNode rightBorder = _nodeFactory.CreateNode(XmlNodeType.Element, "w", "right", OpenXmlNamespaces.WordprocessingML);
// appendBorderAttributes(brcRight, rightBorder);
// addOrSetBorder(_tblBorders, rightBorder);
//}
//if (brcHorz != null)
//{
// XmlNode insideHBorder = _nodeFactory.CreateNode(XmlNodeType.Element, "w", "insideH", OpenXmlNamespaces.WordprocessingML);
// appendBorderAttributes(brcHorz, insideHBorder);
// addOrSetBorder(_tblBorders, insideHBorder);
//}
//if (brcVert != null)
//{
// XmlNode insideVBorder = _nodeFactory.CreateNode(XmlNodeType.Element, "w", "insideV", OpenXmlNamespaces.WordprocessingML);
// appendBorderAttributes(brcVert, insideVBorder);
// addOrSetBorder(_tblBorders, insideVBorder);
//}
//if (_tblBorders.ChildNodes.Count > 0)
//{
// _tblPrEx.AppendChild(_tblBorders);
//}
//set exceptions
XMLTools::XMLElement* _tblBorders = new XMLTools::XMLElement(L"w:tblBorders");
if (brcTop)
{
XMLTools::XMLElement border(L"w:top");
appendBorderAttributes(brcTop.get(), &border);
addOrSetBorder(_tblBorders, &border);
}
if (brcLeft)
{
XMLTools::XMLElement border(L"w:left");
appendBorderAttributes(brcLeft.get(), &border);
addOrSetBorder(_tblBorders, &border);
}
if (brcBottom)
{
XMLTools::XMLElement border(L"w:left");
appendBorderAttributes(brcBottom.get(), &border);
addOrSetBorder(_tblBorders, &border);
}
if (brcRight)
{
XMLTools::XMLElement border(L"w:right");
appendBorderAttributes(brcRight.get(), &border);
addOrSetBorder(_tblBorders, &border);
}
if (brcHorz)
{
XMLTools::XMLElement border(L"w:insideH");
appendBorderAttributes(brcHorz.get(), &border);
addOrSetBorder(_tblBorders, &border);
}
if (brcVert)
{
XMLTools::XMLElement border(L"w:insideV");
appendBorderAttributes(brcHorz.get(), &border);
addOrSetBorder(_tblBorders, &border);
}
if (_tblBorders->GetChildCount() > 0)
{
_tblPrEx->AppendChild(*_tblBorders);
}
//---------------------------------------------------------------------------
if ( _tblPrEx->GetChildCount() > 0 )
{
_trPr->AppendChild( *(_tblPrEx) );
m_pXmlWriter->WriteString(_tblPrEx->GetXMLString());
}
//write Properties
if ( ( _trPr->GetChildCount() > 0 ) || ( _trPr->GetAttributeCount() > 0 ) )
{
m_pXmlWriter->WriteString( _trPr->GetXMLString() );

View File

@ -39,16 +39,16 @@ namespace DocFileFormat
class Tbkd : public ByteStructure
{
public:
friend class TextboxMapping;
static const int STRUCTURE_SIZE = 6;
Tbkd() : ipgd(0), itxbxs(0), dcpDepend(0), icol(0), fTableBreak(false), fColumnBreak(false), fMarked(false), fUnk(false), fTextOverflow(false)
{
}
virtual ~Tbkd()
{
}
virtual ByteStructure* ConstructObject (VirtualStreamReader* reader, int length)
@ -72,7 +72,7 @@ namespace DocFileFormat
}
private:
bool bUsed = false;
/// Except in textbox BKD, index to PGD in plfpgd that describes the page this break is on
short ipgd;
/// In textbox BKD

View File

@ -83,102 +83,102 @@ namespace DocFileFormat
{
m_document = static_cast<WordDocument*>(visited);
if (m_document)
if (!m_document) return;
m_pXmlWriter->WriteNodeBegin(L"v:textbox", true);
if (m_dxTextLeft >= 0 && m_dyTextTop >= 0 && m_dxTextRight >= 0 && m_dyTextBottom >= 0)
{
//if (m_nTBIndex < m_document->TextboxBreakPlex->Elements.size())
// return;
m_pXmlWriter->WriteNodeBegin(L"v:textbox", true);
if(m_dxTextLeft >= 0 && m_dyTextTop >= 0 && m_dxTextRight >= 0 && m_dyTextBottom >= 0)
{
m_pXmlWriter->WriteAttribute( L"inset" , FormatUtils::DoubleToWideString(m_dxTextLeft) + L"pt," +
FormatUtils::DoubleToWideString(m_dyTextTop) + L"pt," +
FormatUtils::DoubleToWideString(m_dxTextRight) + L"pt," +
FormatUtils::DoubleToWideString(m_dyTextBottom) + L"pt");
}
if (!m_sTextBoxStyle.empty())
{
m_pXmlWriter->WriteAttribute( L"style", m_sTextBoxStyle);
}
m_pXmlWriter->WriteNodeEnd( L"", true, false );
m_pXmlWriter->WriteNodeBegin( L"w:txbxContent" );
int cp = 0;
int cpEnd = 0;
Tbkd* bkd = NULL;
int txtbxSubdocStart =
m_document->FIB->m_RgLw97.ccpText +
m_document->FIB->m_RgLw97.ccpFtn +
m_document->FIB->m_RgLw97.ccpHdr +
m_document->FIB->m_RgLw97.ccpAtn +
m_document->FIB->m_RgLw97.ccpEdn ;
if (typeid(*_caller) == typeid(MainDocumentMapping))
{
if (m_nTBIndex < m_document->TextboxBreakPlex->Elements.size() )//file(21).doc
{
bkd = static_cast<Tbkd*>(m_document->TextboxBreakPlex->Elements[m_nTBIndex]);
}
if (m_nTBIndex + 1 < m_document->TextboxBreakPlex->CharacterPositions.size())
{
cp = txtbxSubdocStart + m_document->TextboxBreakPlex->CharacterPositions[m_nTBIndex];
cpEnd = txtbxSubdocStart + m_document->TextboxBreakPlex->CharacterPositions[m_nTBIndex + 1];
}
else if (m_nTBIndex + 1 < m_document->TextboxIndividualPlex->CharacterPositions.size())
{
//todooo сделать чище
cp = m_document->TextboxIndividualPlex->CharacterPositions[m_nTBIndex] + 2;
cpEnd = m_document->TextboxIndividualPlex->CharacterPositions[m_nTBIndex + 1];
}
}
else if ((typeid(*_caller) == typeid(HeaderMapping)) || (typeid(*_caller) == typeid(FooterMapping)))
{
txtbxSubdocStart += m_document->FIB->m_RgLw97.ccpTxbx;
bkd = static_cast<Tbkd*>(m_document->TextboxBreakPlexHeader->Elements[m_nTBIndex]);
cp = txtbxSubdocStart + m_document->TextboxBreakPlexHeader->CharacterPositions[m_nTBIndex];
cpEnd = txtbxSubdocStart + m_document->TextboxBreakPlexHeader->CharacterPositions[m_nTBIndex + 1];
}
_isTextBoxContent = true;
//convert the textbox text
_lastValidPapx = (*(m_document->AllPapxFkps->begin()))->grppapx[0];
ParagraphPropertyExceptions* papx_prev = NULL;
while (cp < cpEnd)
{
int fc = m_document->FindFileCharPos(cp);
if (fc < 0) break;
ParagraphPropertyExceptions* papx = findValidPapx( fc );
if (papx_prev && papx_prev == papx)//file(21).doc
break;
papx_prev = papx;
TableInfo tai( papx, m_document->nWordVersion );
if ( tai.fInTable )
{
//this PAPX is for a table
Table table( this, cp, ( ( tai.iTap > 0 ) ? ( 1 ) : ( 0 ) ) );
table.Convert( this );
cp = table.GetCPEnd();
}
else
{
//this PAPX is for a normal paragraph
cp = writeParagraph( cp, 0x7fffffff );
}
}
_isTextBoxContent = false;
m_pXmlWriter->WriteNodeEnd( L"w:txbxContent" );
m_pXmlWriter->WriteNodeEnd( L"v:textbox" );
m_pXmlWriter->WriteAttribute(L"inset", FormatUtils::DoubleToWideString(m_dxTextLeft) + L"pt," +
FormatUtils::DoubleToWideString(m_dyTextTop) + L"pt," +
FormatUtils::DoubleToWideString(m_dxTextRight) + L"pt," +
FormatUtils::DoubleToWideString(m_dyTextBottom) + L"pt");
}
if (!m_sTextBoxStyle.empty())
{
m_pXmlWriter->WriteAttribute(L"style", m_sTextBoxStyle);
}
m_pXmlWriter->WriteNodeEnd(L"", true, false);
m_pXmlWriter->WriteNodeBegin(L"w:txbxContent");
int cpStart = 0;
int cpEnd = 0;
Tbkd* bkd = NULL;
int txtbxSubdocStart =
m_document->FIB->m_RgLw97.ccpText +
m_document->FIB->m_RgLw97.ccpFtn +
m_document->FIB->m_RgLw97.ccpHdr +
m_document->FIB->m_RgLw97.ccpAtn +
m_document->FIB->m_RgLw97.ccpEdn;
if (typeid(*_caller) == typeid(MainDocumentMapping))
{
if (m_nTBIndex < m_document->TextboxBreakPlex->Elements.size())//file(21).doc
{
bkd = static_cast<Tbkd*>(m_document->TextboxBreakPlex->Elements[m_nTBIndex]);
}
if (m_nTBIndex + 1 < m_document->TextboxIndividualPlex->CharacterPositions.size())
{//Jukivka.doc
cpStart = txtbxSubdocStart + m_document->TextboxIndividualPlex->CharacterPositions[m_nTBIndex];
cpEnd = txtbxSubdocStart + m_document->TextboxIndividualPlex->CharacterPositions[m_nTBIndex + 1];
}
else if (m_nTBIndex + 1 < m_document->TextboxBreakPlex->CharacterPositions.size())
{
cpStart = txtbxSubdocStart + m_document->TextboxBreakPlex->CharacterPositions[m_nTBIndex];
cpEnd = txtbxSubdocStart + m_document->TextboxBreakPlex->CharacterPositions[m_nTBIndex + 1];
}
}
else if ((typeid(*_caller) == typeid(HeaderMapping)) || (typeid(*_caller) == typeid(FooterMapping)))
{
txtbxSubdocStart += m_document->FIB->m_RgLw97.ccpTxbx;
bkd = static_cast<Tbkd*>(m_document->TextboxBreakPlexHeader->Elements[m_nTBIndex]);
cpStart = txtbxSubdocStart + m_document->TextboxBreakPlexHeader->CharacterPositions[m_nTBIndex];
cpEnd = txtbxSubdocStart + m_document->TextboxBreakPlexHeader->CharacterPositions[m_nTBIndex + 1];
}
bool bUsed = bkd ? bkd->bUsed : false;
_isTextBoxContent = true;
//convert the textbox text
_lastValidPapx = (*(m_document->AllPapxFkps->begin()))->grppapx[0];
ParagraphPropertyExceptions* papx_prev = NULL;
int cp = cpStart;
while (cp < cpEnd && cp >= cpStart && !bUsed)
{
int fc = m_document->FindFileCharPos(cp);
if (fc < 0) break;
ParagraphPropertyExceptions* papx = findValidPapx(fc);
if (papx_prev && papx_prev == papx)//file(21).doc
break;
papx_prev = papx;
TableInfo tai(papx, m_document->nWordVersion);
if (tai.fInTable)
{
//this PAPX is for a table
Table table(this, cp, ((tai.iTap > 0) ? (1) : (0)));
table.Convert(this);
cp = table.GetCPEnd();
}
else
{
//this PAPX is for a normal paragraph
cp = writeParagraph(cp, 0x7fffffff);
}
}
_isTextBoxContent = false;
if (bkd)
bkd->bUsed = true;
m_pXmlWriter->WriteNodeEnd(L"w:txbxContent");
m_pXmlWriter->WriteNodeEnd(L"v:textbox");
}
}

View File

@ -39,7 +39,6 @@ namespace DocFileFormat
class TextboxMapping : public DocumentMapping
{
public:
TextboxMapping(ConversionContext* ctx, int textboxIndex, XMLTools::CStringXmlWriter* writer, IMapping* caller);
TextboxMapping(ConversionContext* ctx, XMLTools::CStringXmlWriter* writer, IMapping* caller);

View File

@ -228,7 +228,7 @@ namespace DocFileFormat
style +=( L";" );
}
VMLPictureMapping::VMLPictureMapping(ConversionContext* ctx, XMLTools::CStringXmlWriter* writer, bool olePreview, IMapping* caller, bool isInlinePicture) : PropertiesMapping(writer)
VMLPictureMapping::VMLPictureMapping(ConversionContext* ctx, XMLTools::CStringXmlWriter* writer, bool olePreview, IMapping* caller, bool isInlinePicture, bool inGroup) : PropertiesMapping(writer)
{
m_context = ctx;
m_isOlePreview = olePreview;
@ -236,6 +236,7 @@ namespace DocFileFormat
m_nImageId = 0;
m_caller = caller;
m_isInlinePicture = isInlinePicture;
m_inGroup = inGroup;
m_isBullete = false;
m_isEquation = false;
@ -318,7 +319,7 @@ namespace DocFileFormat
for (size_t i = 0; i < options.size(); i++)
{
ODRAW::OfficeArtFOPTEPtr & iter = options[i];
switch ( iter->opid )
switch (iter->opid)
{
case wzEquationXML:
{
@ -327,10 +328,10 @@ namespace DocFileFormat
{
m_isEquation = true;
m_isEmbedded = true;
m_embeddedData = pXml->data;
if (ParseEmbeddedEquation( m_embeddedData, m_equationXml))
if (ParseEmbeddedEquation(m_embeddedData, m_equationXml))
{
m_isEmbedded = false;
}
@ -340,74 +341,74 @@ namespace DocFileFormat
{//встроенная неведомая хуйня
ODRAW::MetroBlob* blob = dynamic_cast<ODRAW::MetroBlob*>(iter.get());
if (blob)
{
m_isBlob = true;
m_isEmbedded = true;
{
m_isBlob = true;
m_isEmbedded = true;
//if (ParseEmbeddedBlob( blob->data.first, blob->data.second)) // todoooo
//{
// m_isEmbedded = false;
//}
}
}break;
//BORDERS
//BORDERS
case ODRAW::borderBottomColor:
if (!pict->brcBottom)
{
RGBColor bottomColor( (int)iter->op, RedFirst );
m_pXmlWriter->WriteAttribute( L"o:borderbottomcolor", L"#" + bottomColor.SixDigitHexCode);
RGBColor bottomColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(L"o:borderbottomcolor", L"#" + bottomColor.SixDigitHexCode);
}
break;
case ODRAW::borderLeftColor:
if (!pict->brcLeft)
{
RGBColor leftColor( (int)iter->op, RedFirst );
m_pXmlWriter->WriteAttribute( L"o:borderleftcolor", L"#" + leftColor.SixDigitHexCode);
}
{
RGBColor leftColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(L"o:borderleftcolor", L"#" + leftColor.SixDigitHexCode);
}
break;
case ODRAW::borderRightColor:
if (!pict->brcRight)
{
RGBColor rightColor( (int)iter->op, RedFirst );
m_pXmlWriter->WriteAttribute( L"o:borderrightcolor", L"#" + rightColor.SixDigitHexCode);
{
RGBColor rightColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(L"o:borderrightcolor", L"#" + rightColor.SixDigitHexCode);
}
break;
case ODRAW::borderTopColor:
if (!pict->brcTop)
{
RGBColor topColor( (int)iter->op, RedFirst );
m_pXmlWriter->WriteAttribute( L"o:bordertopcolor", L"#" + topColor.SixDigitHexCode);
RGBColor topColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(L"o:bordertopcolor", L"#" + topColor.SixDigitHexCode);
}
break;
//CROPPING
//CROPPING
case ODRAW::cropFromBottom:
{
{
//cast to signed integer
int cropBottom = (int)iter->op;
appendValueAttribute(m_imageData, L"cropbottom", FormatUtils::IntToWideString( cropBottom ) + L"f" );
appendValueAttribute(m_imageData, L"cropbottom", FormatUtils::IntToWideString(cropBottom) + L"f");
}
break;
case ODRAW::cropFromLeft:
{
{
//cast to signed integer
int cropLeft = (int)iter->op;
appendValueAttribute(m_imageData, L"cropleft", FormatUtils::IntToWideString( cropLeft ) + L"f" );
appendValueAttribute(m_imageData, L"cropleft", FormatUtils::IntToWideString(cropLeft) + L"f");
}
break;
case ODRAW::cropFromRight:
{
//cast to signed integer
int cropRight = (int)iter->op;
appendValueAttribute(m_imageData, L"cropright", FormatUtils::IntToWideString( cropRight ) + L"f" );
appendValueAttribute(m_imageData, L"cropright", FormatUtils::IntToWideString(cropRight) + L"f");
}
break;
case ODRAW::cropFromTop:
{
//cast to signed integer
int cropTop = (int)iter->op;
appendValueAttribute(m_imageData, L"croptop", FormatUtils::IntToWideString( cropTop ) + L"f" );
appendValueAttribute(m_imageData, L"croptop", FormatUtils::IntToWideString(cropTop) + L"f");
}
break;
//------------------------------------------------------------
//------------------------------------------------------------
case ODRAW::ePropertyId_rotation:
{
double dAngle = (double)((int)iter->op) / 65535.0;
@ -426,7 +427,8 @@ namespace DocFileFormat
}break;
case ODRAW::posrelh:
{
appendStyleProperty(strStyle, L"mso-position-horizontal-relative", VMLShapeMapping::mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op));
if (false == m_inGroup)
appendStyleProperty(strStyle, L"mso-position-horizontal-relative", VMLShapeMapping::mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op));
}break;
case ODRAW::posv:
{
@ -434,7 +436,8 @@ namespace DocFileFormat
}break;
case ODRAW::posrelv:
{
appendStyleProperty(strStyle, L"mso-position-vertical-relative", VMLShapeMapping::mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
if (false == m_inGroup)
appendStyleProperty(strStyle, L"mso-position-vertical-relative", VMLShapeMapping::mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
}break;
case ODRAW::groupShapeBooleanProperties:
{
@ -443,7 +446,7 @@ namespace DocFileFormat
if (booleans->fUsefBehindDocument && booleans->fBehindDocument)
{
//The shape is behind the text, so the z-index must be negative.
appendStyleProperty(strStyle, L"z-index", L"-1" );
appendStyleProperty(strStyle, L"z-index", L"-1");
}
//else if (!m_isInlinePicture)
//{
@ -455,8 +458,20 @@ namespace DocFileFormat
appendStyleProperty(strStyle, L"visibility", L"hidden");
}
}break;
case ODRAW::blipBooleanProperties:
{
ODRAW::BlipBooleanProperties * bools = (ODRAW::BlipBooleanProperties *)(iter.get());
if (bools)
{
if (bools->fUsefPictureGray && bools->fPictureGray)
appendValueAttribute(m_imageData, L"grayscale", L"t");
if (bools->fUsefPictureBiLevel && bools->fPictureBiLevel)
appendValueAttribute(m_imageData, L"bilevel", L"t");
}
}break;
default:
break;
{
}break;
}
}

View File

@ -50,7 +50,7 @@ namespace DocFileFormat
class VMLPictureMapping: public PropertiesMapping, public IMapping
{
public:
VMLPictureMapping( ConversionContext* ctx, XMLTools::CStringXmlWriter* writer, bool olePreview, IMapping* caller, bool isInlinePicture = false );
VMLPictureMapping( ConversionContext* ctx, XMLTools::CStringXmlWriter* writer, bool olePreview, IMapping* caller, bool isInlinePicture = false, bool inGroup = false);
virtual ~VMLPictureMapping();
virtual void Apply( IVisitable* visited );
private:
@ -88,6 +88,7 @@ namespace DocFileFormat
bool m_isOlePreview;
bool m_isInlinePicture;
bool m_inGroup;
XMLTools::XMLElement* m_imageData;

View File

@ -48,8 +48,9 @@
namespace DocFileFormat
{
VMLShapeMapping::VMLShapeMapping (ConversionContext* pConv, XMLTools::CStringXmlWriter* pWriter, Spa* pSpa, PictureDescriptor* pPicture, IMapping* pCaller, bool isInlineShape) : PropertiesMapping(pWriter)
VMLShapeMapping::VMLShapeMapping (ConversionContext* pConv, XMLTools::CStringXmlWriter* pWriter, Spa* pSpa, PictureDescriptor* pPicture, IMapping* pCaller, bool isInlineShape, bool inGroup) : PropertiesMapping(pWriter)
{
m_inGroup = inGroup;
m_isInlineShape = isInlineShape;
m_isBullete = false;
m_isPictureBroken = false;
@ -87,6 +88,11 @@ namespace DocFileFormat
{
m_pBlipStore = static_cast<BlipStoreContainer*>(recBs);
}
for (int i = 0; i < 8; ++i)
{
m_nAdjValues[i] = 0x7fffffff;
}
}
VMLShapeMapping::~VMLShapeMapping()
@ -191,7 +197,7 @@ namespace DocFileFormat
ShapeContainer* pChildShape = static_cast<ShapeContainer*>(container->Children[i]);
if (pChildShape)
{
VMLShapeMapping vmlShapeMapping(m_context, m_pXmlWriter, m_pSpa, NULL, m_pCaller);
VMLShapeMapping vmlShapeMapping(m_context, m_pXmlWriter, m_pSpa, NULL, m_pCaller, false, true);
pChildShape->Convert(&vmlShapeMapping);
}
}
@ -306,6 +312,8 @@ namespace DocFileFormat
int nAdjValues = 0;
int nLTxID = -1;
int nProperty = 0;
std::wstring sTextboxStyle;
ODRAW::OfficeArtFOPTEPtr opSegmentInfo;
@ -559,6 +567,7 @@ namespace DocFileFormat
case ODRAW::fillFocus:
{
appendValueAttribute(&m_fill, L"focus", (FormatUtils::IntToWideString(iter->op) + L"%"));
appendValueAttribute(&m_fill, L"focusposition", L".5, .5");
appendValueAttribute(&m_fill, L"focussize", L"");
}break;
case ODRAW::fillType:
@ -596,12 +605,14 @@ namespace DocFileFormat
}break;
case ODRAW::fillOpacity:
{
appendValueAttribute(&m_fill, L"opacity", (FormatUtils::IntToWideString(iter->op) + L"f"));
double opa = (iter->op / pow((double)2, (double)16));
appendValueAttribute(&m_fill, L"opacity", FormatUtils::DoubleToFormattedWideString(opa, L"%.2f"));
}
break;
case ODRAW::fillBackOpacity:
{
appendValueAttribute(&m_fill, L"o:opacity2", (FormatUtils::IntToWideString(iter->op) + L"f"));
double opa = (iter->op / pow((double)2, (double)16));
appendValueAttribute(&m_fill, L"o:opacity2", FormatUtils::DoubleToFormattedWideString(opa, L"%.2f"));
}break;
// SHADOW
case ODRAW::shadowType:
@ -646,8 +657,14 @@ namespace DocFileFormat
}break;
case ODRAW::shadowStyleBooleanProperties:
{
//ODRAW::ShadowStyleBooleanProperties
ODRAW::ShadowStyleBooleanProperties* booleans = dynamic_cast<ODRAW::ShadowStyleBooleanProperties*>(iter.get());
if (booleans)
{
if (booleans->fUsefShadow && booleans->fShadow)
{
bShadow = true;
}
}
}break;
// OLE
case ODRAW::pictureId:
@ -826,6 +843,10 @@ namespace DocFileFormat
break;
}
}break;
case ODRAW::hspNext:
{
appendStyleProperty(sTextboxStyle, L"mso-next-textbox", std::wstring(L"_x0000_s") + FormatUtils::IntToWideString((unsigned int)iter->op));
}break;
case ODRAW::textBooleanProperties:
{
ODRAW::TextBooleanProperties *props = dynamic_cast<ODRAW::TextBooleanProperties*>(iter.get());
@ -835,7 +856,6 @@ namespace DocFileFormat
appendStyleProperty(sTextboxStyle, L"mso-fit-shape-to-text", L"t");
}
}break;
// Word Art
case ODRAW::gtextUNICODE:
{
@ -894,7 +914,7 @@ namespace DocFileFormat
}break;
default:
{
int val = iter->op;
nProperty = iter->op;
}break;
}
}
@ -956,12 +976,14 @@ namespace DocFileFormat
{
if (nAdjValues > 0)
{
std::wstring adjTag = std::to_wstring(m_nAdjValues[0]);
std::wstring adjTag;
for (int i = 1; i < nAdjValues; ++i)
adjTag += L"," + std::to_wstring(m_nAdjValues[i]);
for (int i = 0; i < nAdjValues; ++i)
{
adjTag += L"," + (m_nAdjValues[i] != 0x7fffffff ? std::to_wstring(m_nAdjValues[i]) : L"");
}
m_pXmlWriter->WriteAttribute(L"adj", adjTag);
m_pXmlWriter->WriteAttribute(L"adj", adjTag.substr(1));
}
}
@ -1012,13 +1034,6 @@ namespace DocFileFormat
appendValueAttribute(&m_shadow, L"origin", FormatUtils::DoubleToWideString(*ShadowOriginX) + std::wstring(L"," ) + FormatUtils::DoubleToWideString(*ShadowOriginY));
}
// write shadow
if (m_shadow.GetAttributeCount() > 0)
{
appendValueAttribute(&m_shadow, L"on", bShadow ? L"t" : L"f" );
m_pXmlWriter->WriteString(m_shadow.GetXMLString());
}
//write the viewpoint
if ( ViewPointX || ViewPointY || ViewPointZ )
{
@ -1087,6 +1102,13 @@ namespace DocFileFormat
{
m_pXmlWriter->WriteString(m_fill.GetXMLString());
}
// write shadow
if (m_shadow.GetAttributeCount() > 0)
{
appendValueAttribute(&m_shadow, L"on", bShadow ? L"t" : L"f");
m_pXmlWriter->WriteString(m_shadow.GetXMLString());
}
// write imagedata
if (m_imagedata.GetAttributeCount())
{
@ -1141,8 +1163,8 @@ namespace DocFileFormat
//Word appends a OfficeArtClientTextbox record to the container.
//This record stores the index of the textbox.
int nIndex = pTextBox->GetIndex();
if (nIndex)
int nIndex = pTextBox->m_nIndex;
if (nIndex > 0)
{
TextboxMapping textboxMapping(m_context, nIndex - 1, m_pXmlWriter, m_pCaller);
textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom);
@ -1153,12 +1175,6 @@ namespace DocFileFormat
}
else if( hasTextbox )
{
//Open Office textbox
//Open Office doesn't append a OfficeArtClientTextbox record to the container.
//We don't know how Word gets the relation to the text, but we assume that the first textbox in the document
//get the index 0, the second textbox gets the index 1 (and so on).
if (-1 != nLTxID)
{
TextboxMapping textboxMapping(m_context, nLTxID - 1, m_pXmlWriter, m_pCaller);
@ -1696,7 +1712,7 @@ namespace DocFileFormat
switch (val)
{
case 0: return L"square";
//case 1: return L"ByPoints";
case 1: return L"tight";
case 2: return L"none";
//case 3: return L"TopBottom";
//case 3: return L"Through";
@ -1731,7 +1747,8 @@ namespace DocFileFormat
case ODRAW::posrelh:
{
nRelH = iter->op;
appendStyleProperty(oStyle, L"mso-position-horizontal-relative", mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op));
if (false == m_inGroup)
appendStyleProperty(oStyle, L"mso-position-horizontal-relative", mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op));
}break;
case ODRAW::posv:
{
@ -1740,7 +1757,8 @@ namespace DocFileFormat
case ODRAW::posrelv:
{
nRelV = iter->op;
appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
if (false == m_inGroup)
appendStyleProperty(oStyle, L"mso-position-vertical-relative", mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
}break;
// BOOLEANS
case ODRAW::groupShapeBooleanProperties:
@ -1752,7 +1770,7 @@ namespace DocFileFormat
//за текстом (The shape is behind the text, so the z-index must be negative.)
m_isInlineShape = false;
if (!bZIndex)
if (false == bZIndex/* && false == m_inGroup*/) // Пример.doc
{
appendStyleProperty(oStyle, L"z-index", FormatUtils::IntToWideString(-zIndex - 0x7ffff));
bZIndex = true;
@ -1807,7 +1825,7 @@ namespace DocFileFormat
}
}
if (nRelH < 0 && m_pSpa)
if (nRelH < 0 && m_pSpa && false == m_inGroup)
{
//if (m_pSpa->bx == TEXT && bZIndex)
//{
@ -1820,7 +1838,7 @@ namespace DocFileFormat
else if (m_pSpa->bx == TEXT)
appendStyleProperty(oStyle, L"mso-position-horizontal-relative", mapHorizontalPositionRelative(msoprhText));
}
if (nRelV < 0 && m_pSpa)
if (nRelV < 0 && m_pSpa && false == m_inGroup)
{
//if (m_pSpa->by == TEXT && bZIndex)
//{
@ -1837,12 +1855,12 @@ namespace DocFileFormat
{
m_isInlineShape = true;
}
if (!m_isInlineShape && !bZIndex)
if (false == m_isInlineShape && false == bZIndex && false == m_inGroup)
{
appendStyleProperty( oStyle, L"z-index", FormatUtils::IntToWideString(zIndex + 0x7ffff));
bZIndex = true;
}
if (false == m_isInlineShape)
if (false == m_isInlineShape && false == m_inGroup)
{
if (nPosH >= 0)
{
@ -2019,8 +2037,12 @@ namespace DocFileFormat
std::wstring result;
for (size_t i = 0; i < pColors->complex.data.size(); ++i)
{
result += FormatUtils::IntToWideString((int)pColors->complex.data[i].dPosition);
result += L"f #";
if (pColors->complex.data[i].position.Fractional == 0)
result += FormatUtils::IntToWideString(pColors->complex.data[i].position.Integral);
else
result += FormatUtils::IntToWideString(pColors->complex.data[i].position.Fractional) +L"f";
result += L" #";
result += pColors->complex.data[i].color.sColorRGB;
result += L";";
}
@ -2306,16 +2328,19 @@ namespace DocFileFormat
strStyle += L"margin-left:" + FormatUtils::IntToWideString( (int)x.ToPoints()) + L"pt;";
strStyle += L"margin-top:" + FormatUtils::IntToWideString( (int)y.ToPoints()) + L"pt;";
std::wstring xMargin;
std::wstring yMargin;
if (m_pSpa->bx == PAGE) xMargin = L"page;";
if (m_pSpa->by == PAGE) yMargin = L"page;";
if (m_pSpa->bx == MARGIN) xMargin = L"margin;";
if (m_pSpa->by == MARGIN) yMargin = L"margin;";
if (false == m_inGroup)
{
std::wstring xMargin;
std::wstring yMargin;
if (m_pSpa->bx == PAGE) xMargin = L"page;";
if (m_pSpa->by == PAGE) yMargin = L"page;";
if (!xMargin.empty()) strStyle += L"mso-position-horizontal-relative:" + xMargin;
if (!yMargin.empty()) strStyle += L"mso-position-vertical-relative:" + yMargin;
if (m_pSpa->bx == MARGIN) xMargin = L"margin;";
if (m_pSpa->by == MARGIN) yMargin = L"margin;";
if (!xMargin.empty()) strStyle += L"mso-position-horizontal-relative:" + xMargin;
if (!yMargin.empty()) strStyle += L"mso-position-vertical-relative:" + yMargin;
}
std::wstring strSize = FormatUtils::IntToWideString(primitive->dxa) + L"," + FormatUtils::IntToWideString(primitive->dya);
std::wstring strOrigin = FormatUtils::IntToWideString(primitive->xa) + L"," + FormatUtils::IntToWideString(primitive->ya);

View File

@ -57,7 +57,7 @@ namespace DocFileFormat
{
public:
VMLShapeMapping (ConversionContext* ctx ,XMLTools::CStringXmlWriter* writer, Spa* pSpa, PictureDescriptor* pict, IMapping* caller, bool bullet = false);
VMLShapeMapping (ConversionContext* ctx, XMLTools::CStringXmlWriter* writer, Spa* pSpa, PictureDescriptor* pict, IMapping* caller, bool bullet = false, bool in_group = false);
virtual ~VMLShapeMapping();
virtual void Apply(IVisitable* visited);
@ -67,6 +67,7 @@ namespace DocFileFormat
static std::wstring mapHorizontalPositionRelative (int hRel );
static std::wstring mapWrapText (int val_);
bool m_inGroup;
bool m_isBullete;
bool m_isPictureBroken;
std::wstring m_shapeId;

View File

@ -80,7 +80,7 @@ namespace DocFileFormat
254, 437,//PC 437
255, 850//OEM
};
WordDocument::WordDocument (const ProgressCallback* pCallFunc, const std::wstring & sTempFolder, const int userLCID) :
WordDocument::WordDocument (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),
@ -93,7 +93,6 @@ namespace DocFileFormat
AnnotationOwners(NULL), DocProperties(NULL), listFormatOverrideTable(NULL), headerAndFooterTable(NULL),
AnnotStartPlex(NULL), AnnotEndPlex(NULL), encryptionHeader(NULL)
{
m_pCallFunc = pCallFunc;
m_sTempFolder = sTempFolder;
m_nUserLCID = userLCID;
@ -315,21 +314,7 @@ namespace DocFileFormat
BookmarkAnnotNames = new StringTable<WideString> (TableStream, FIB->m_FibWord97.fcSttbfAtnBkmk, FIB->m_FibWord97.lcbSttbfAtnBkmk, nWordVersion, true);
if (m_pCallFunc)
{
m_pCallFunc->OnProgress (m_pCallFunc->caller, DOC_ONPROGRESSEVENT_ID, 100000);
SHORT bCancel = 0;
m_pCallFunc->OnProgressEx(m_pCallFunc->caller, DOC_ONPROGRESSEVENT_ID, 100000, &bCancel);
if (bCancel)
{
Clear();
return AVS_ERROR_FILEFORMAT;
}
}
// Read all needed PLCFs
// Read all needed PLCFs
if (FIB->m_RgLw97.ccpFtn > 0)
{
FootnoteReferenceCharactersPlex = new Plex<FootnoteDescriptor>(FootnoteDescriptor::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcffndRef, FIB->m_FibWord97.lcbPlcffndRef, nWordVersion);
@ -422,20 +407,6 @@ namespace DocFileFormat
ListPlex = new Plex<ListNumCache> (ListNumCache::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBteLvc, FIB->m_FibWord97.lcbPlcfBteLvc, nWordVersion);
if (m_pCallFunc)
{
m_pCallFunc->OnProgress(m_pCallFunc->caller, DOC_ONPROGRESSEVENT_ID, 200000 );
SHORT bCancel = 0;
m_pCallFunc->OnProgressEx(m_pCallFunc->caller, DOC_ONPROGRESSEVENT_ID, 200000, &bCancel);
if (bCancel)
{
Clear();
return AVS_ERROR_FILEFORMAT;
}
}
// Read the FKPs
AllPapxFkps = FormattedDiskPagePAPX::GetAllPAPXFKPs (FIB, WordDocumentStream, TableStream, DataStream);
AllChpxFkps = FormattedDiskPageCHPX::GetAllCHPXFKPs (FIB, WordDocumentStream, TableStream);
@ -452,19 +423,6 @@ namespace DocFileFormat
AnnotationOwners = new AnnotationOwnerList (FIB, TableStream);
}
if (m_pCallFunc)
{
m_pCallFunc->OnProgress(m_pCallFunc->caller, DOC_ONPROGRESSEVENT_ID, 300000 );
SHORT bCancel = 0;
m_pCallFunc->OnProgressEx(m_pCallFunc->caller, DOC_ONPROGRESSEVENT_ID, 300000, &bCancel);
if (bCancel)
{
Clear();
return AVS_ERROR_FILEFORMAT;
}
}
if (FontTable)
{
std::unordered_map<int, int> fonts_charsets;
@ -556,20 +514,6 @@ namespace DocFileFormat
std::sort (AllPapxVector->begin(), AllPapxVector->end());
if (m_pCallFunc)
{
m_pCallFunc->OnProgress(m_pCallFunc->caller, DOC_ONPROGRESSEVENT_ID, 400000 );
SHORT bCancel = 0;
m_pCallFunc->OnProgressEx(m_pCallFunc->caller, DOC_ONPROGRESSEVENT_ID, 400000, &bCancel);
if (bCancel)
{
Clear();
return AVS_ERROR_FILEFORMAT;
}
}
//build a dictionary of all SEPX
if ( !SectionPlex->Elements.empty() )
{
@ -594,20 +538,6 @@ namespace DocFileFormat
}
}
if (m_pCallFunc)
{
m_pCallFunc->OnProgress(m_pCallFunc->caller, DOC_ONPROGRESSEVENT_ID, 500000 );
SHORT bCancel = 0;
m_pCallFunc->OnProgressEx(m_pCallFunc->caller, DOC_ONPROGRESSEVENT_ID, 500000, &bCancel);
if (bCancel)
{
Clear();
return AVS_ERROR_FILEFORMAT;
}
}
return 0;
}
bool WordDocument::LoadDocumentFlat()

View File

@ -58,7 +58,6 @@
#include "EndnoteDescriptor.h"
#include "FieldCharacter.h"
#include "IVisitable.h"
#include "../Common/Callback.h"
namespace CRYPT
{
@ -92,7 +91,7 @@ namespace DocFileFormat
public:
WordDocument (const ProgressCallback* pCallFunc, const std::wstring & tempFolder, const int userLCID);
WordDocument (const std::wstring & tempFolder, const int userLCID);
virtual ~WordDocument();
_UINT32 LoadDocument(const std::wstring & fileName, const std::wstring & password);
@ -155,8 +154,6 @@ namespace DocFileFormat
std::wstring m_sTempDecryptFileName;
int m_nUserLCID;
const ProgressCallback* m_pCallFunc;
POLE::Stream * WordDocumentStream; // The stream "WordDocument"
POLE::Stream * TableStream; // The stream "0Table" or "1Table"
POLE::Stream * DataStream; // The stream called "Data"

View File

@ -49,9 +49,10 @@ namespace DocFileFormat
WordprocessingDocument::~WordprocessingDocument()
{
_isSectionPageBreak = 0;
}
void WordprocessingDocument::SaveDocument(bool &bMacros)
_UINT32 WordprocessingDocument::SaveDocument(bool &bMacros)
{
std::wstring pathWord = m_strOutputPath + FILE_SEPARATOR_STR + L"word" ;
NSDirectory::CreateDirectory( pathWord );
@ -179,5 +180,6 @@ namespace DocFileFormat
{
SaveToFile(pathWord, ( std::wstring( L"footer" ) + FormatUtils::IntToWideString(++footersCount) + std::wstring( L".xml" ) ), *iter);
}
return 0;
}
}

View File

@ -76,9 +76,11 @@ namespace DocFileFormat
std::list<std::wstring> FooterXMLList;
public:
int _isSectionPageBreak; //0 - not set, 1 -page break, 2 - continues, -1 - already
WordprocessingDocument(const std::wstring & _docxDirectory, const WordDocument* _docFile);
virtual ~WordprocessingDocument();
void SaveDocument(bool &bMacros);
_UINT32 SaveDocument(bool &bMacros);
};
}

View File

@ -34,7 +34,7 @@
#include "../DocDocxConverter/Converter.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
_UINT32 COfficeDocFile::LoadFromFile(const std::wstring & docFile, const std::wstring & docxDirectory, const std::wstring & password, bool &bMacros, ProgressCallback *ffCallBack)
_UINT32 COfficeDocFile::LoadFromFile(const std::wstring & docFile, const std::wstring & docxDirectory, const std::wstring & password, bool &bMacros)
{
_UINT32 hr = 0;
@ -43,12 +43,12 @@ _UINT32 COfficeDocFile::LoadFromFile(const std::wstring & docFile, const std::w
docToDocx.m_sTempFolder = m_sTempFolder;
docToDocx.m_nUserLCID = m_nUserLCID;
hr= docToDocx.LoadAndConvert(docFile, docxDirectory, password, ffCallBack, bMacros);
hr= docToDocx.LoadAndConvert(docFile, docxDirectory, password, bMacros);
return hr;
}
_UINT32 COfficeDocFile::SaveToFile (const std::wstring & sDstFileName, const std::wstring & sSrcFileName, ProgressCallback *ffCallBack )
_UINT32 COfficeDocFile::SaveToFile (const std::wstring & sDstFileName, const std::wstring & sSrcFileName)
{
return 0;
}

View File

@ -29,8 +29,7 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef DOC_FORMAT_LIB
#define DOC_FORMAT_LIB
#pragma once
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
@ -38,8 +37,6 @@
#include "../../DesktopEditor/common/ASCVariant.h"
struct ProgressCallback;
class COfficeDocFile
{
public:
@ -49,9 +46,8 @@ public:
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);
_UINT32 LoadFromFile(const std::wstring & sSrcFileName, const std::wstring & sDstFileName, const std::wstring & password, bool &bMacros);
_UINT32 SaveToFile(const std::wstring & sDstFileName, const std::wstring & sSrcFileName);
};
#endif //DOC_FORMAT_LIB

View File

@ -74,6 +74,8 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<IncludePath>D:\_Work\core\Common\3dParty\boost\build\win_64\include;$(IncludePath)</IncludePath>
<LibraryPath>D:\_Work\core\Common\3dParty\boost\build\win_64\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
@ -103,7 +105,7 @@
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>

View File

@ -40,12 +40,12 @@ namespace Writers
{
m_nCount = 0;
}
void CustomXmlWriter::WriteCustom(const std::wstring& sCustomXmlPropertiesContent, const std::wstring& sCustomXmlContent)
void CustomXmlWriter::WriteCustom(const std::wstring& sCustomXmlPropertiesContent, const std::wstring& sCustomXmlContent, bool bGlossaryMode)
{
m_nCount++;
std::wstring sCustomXmlDir = m_sDir + FILE_SEPARATOR_STR;
sCustomXmlDir += OOX::FileTypes::CustomXmlProps.DefaultDirectory().GetPath();
sCustomXmlDir += OOX::FileTypes::CustomXml.DefaultDirectory().GetPath();
std::wstring sCustomXmlRelsDir = sCustomXmlDir + FILE_SEPARATOR_STR + L"_rels";
@ -53,6 +53,8 @@ namespace Writers
sCustomXMLPropsFilename += std::to_wstring(m_nCount) + OOX::FileTypes::CustomXmlProps.DefaultFileName().GetExtention();
NSFile::CFileBinary::SaveToFile(sCustomXmlDir + FILE_SEPARATOR_STR + sCustomXMLPropsFilename, sCustomXmlPropertiesContent);
OOX::CContentTypes& oContentTypes = *m_pDrawingConverter->GetContentTypes();
oContentTypes.Registration( OOX::FileTypes::CustomXmlProps.OverrideType(), OOX::FileTypes::CustomXml.DefaultDirectory(), sCustomXMLPropsFilename );
std::wstring sCustomXmlFilename;
sCustomXmlFilename = OOX::FileTypes::CustomXml.DefaultFileName().GetBasename() + std::to_wstring(m_nCount);
@ -65,9 +67,9 @@ namespace Writers
m_pDrawingConverter->WriteRels(OOX::FileTypes::CustomXmlProps.RelationType(), sCustomXMLPropsFilename, L"", &lId);
m_pDrawingConverter->SaveDstContentRels(sCustomXmlRelsDir + FILE_SEPARATOR_STR + sCustomXmlFilename + L".rels");
arItems.push_back(sCustomXmlFilename);
arItems.push_back(std::make_pair(sCustomXmlFilename, bGlossaryMode));
}
void CustomXmlWriter::WriteCustomSettings(const std::wstring& sUrl, const std::wstring& sXml)
void CustomXmlWriter::WriteCustomSettings(const std::wstring& sUrl, const std::wstring& sXml, bool bGlossaryMode)
{
m_nCount++;
OOX::CCustomXMLProps oCustomXMLProps(NULL);
@ -79,7 +81,7 @@ namespace Writers
oCustomXMLProps.m_oShemaRefs->m_arrItems.push_back(pShemaRef);
std::wstring sCustomXmlPropsDir = m_sDir + FILE_SEPARATOR_STR;
sCustomXmlPropsDir += OOX::FileTypes::CustomXmlProps.DefaultDirectory().GetPath();
sCustomXmlPropsDir += OOX::FileTypes::CustomXml.DefaultDirectory().GetPath();
NSDirectory::CreateDirectories(sCustomXmlPropsDir);
std::wstring sCustomXMLPropsFilename = OOX::FileTypes::CustomXmlProps.DefaultFileName().GetBasename();
sCustomXMLPropsFilename += std::to_wstring(m_nCount) + OOX::FileTypes::CustomXmlProps.DefaultFileName().GetExtention();
@ -99,6 +101,6 @@ namespace Writers
NSFile::CFileBinary::SaveToFile(sCustomXmlDir + FILE_SEPARATOR_STR + sCustomXmlFilename, sXml);
arItems.push_back(sCustomXmlFilename);
arItems.push_back(std::make_pair(sCustomXmlFilename, bGlossaryMode));
}
}

View File

@ -46,12 +46,12 @@ namespace Writers
std::wstring m_sDir;
NSBinPptxRW::CDrawingConverter* m_pDrawingConverter;
public:
std::vector<std::wstring> arItems;
std::vector<std::pair<std::wstring, bool>> arItems;
CustomXmlWriter(std::wstring sDir, NSBinPptxRW::CDrawingConverter* pDrawingConverter);
void WriteCustomSettings(const std::wstring& sUrl, const std::wstring& sXml);
void WriteCustom(const std::wstring& sCustomXmlPropertiesContent, const std::wstring& sCustomXmlContents);
void WriteCustomSettings(const std::wstring& sUrl, const std::wstring& sXml, bool bGlossaryMode);
void WriteCustom(const std::wstring& sCustomXmlPropertiesContent, const std::wstring& sCustomXmlContents, bool bGlossaryMode);
};
}

View File

@ -53,7 +53,8 @@ FileWriter::FileWriter(std::wstring sDirOutput,std::wstring sFontDir, bool bNoFo
m_pComments (NULL),
m_pApp (NULL),
m_pCore (NULL),
m_pCustomProperties (NULL)
m_pCustomProperties (NULL),
m_pCurrentSettings (NULL)
{
}
FileWriter::~FileWriter()
@ -61,6 +62,8 @@ FileWriter::~FileWriter()
RELEASEOBJECT(m_pApp);
RELEASEOBJECT(m_pCore);
RELEASEOBJECT(m_pCustomProperties);
m_pCurrentSettings = NULL;
}
void FileWriter::Write()
{

View File

@ -61,6 +61,7 @@ namespace OOX
{
class CApp;
class CCore;
class CSettings;
}
namespace PPTX
{
@ -80,7 +81,7 @@ namespace Writers
numbering(sDirOutput),
footnotes(sDirOutput),
endnotes(sDirOutput),
settings(sDirOutput, headers_footers),
settings(sDirOutput),
comments(sDirOutput),
web_settings(sDirOutput)
{}
@ -167,6 +168,7 @@ namespace Writers
BinDocxRW::CComments* m_pComments;
OOX::CApp* m_pApp;
OOX::CCore* m_pCore;
OOX::CSettings* m_pCurrentSettings;
PPTX::CustomProperties* m_pCustomProperties;
bool m_bGlossaryMode = false;

View File

@ -54,7 +54,7 @@ namespace Writers
}
std::wstring AddImageGetNewPath()
{
OOX::CSystemUtility::CreateDirectories(m_sMediaDir);
NSDirectory::CreateDirectories(m_sMediaDir);
std::wstring sNewImgName = L"image" + std::to_wstring(nImageCount + 1) + L".jpg";
std::wstring sNewImg = m_sMediaDir + FILE_SEPARATOR_STR + sNewImgName;

View File

@ -382,107 +382,6 @@ public:
}
};
class Shd
{
public:
BYTE Value;
docRGB Color;
docRGB Fill;
CThemeColor ThemeColor;
CThemeColor ThemeFill;
bool bValue = false;
bool bColor = false;
bool bThemeColor = false;
bool bThemeFill = false;
bool bFill = false;
Shd(){}
std::wstring ToString()
{
std::wstring sShd;
if(bValue || bColor || (bThemeColor && ThemeColor.IsNoEmpty()) || (bThemeFill && ThemeFill.IsNoEmpty()))
{
sShd += L"<w:shd";
if(bValue)
{
switch(Value)
{
case SimpleTypes::shdClear : sShd += L" w:val=\"clear\""; break;
case SimpleTypes::shdDiagCross : sShd += L" w:val=\"diagCross\""; break;
case SimpleTypes::shdDiagStripe : sShd += L" w:val=\"diagStripe\""; break;
case SimpleTypes::shdHorzCross : sShd += L" w:val=\"horzCross\""; break;
case SimpleTypes::shdHorzStripe : sShd += L" w:val=\"horzStripe\""; break;
case SimpleTypes::shdNil : sShd += L" w:val=\"nil\""; break;
case SimpleTypes::shdPct10 : sShd += L" w:val=\"pct10\""; break;
case SimpleTypes::shdPct12 : sShd += L" w:val=\"pct12\""; break;
case SimpleTypes::shdPct15 : sShd += L" w:val=\"pct15\""; break;
case SimpleTypes::shdPct20 : sShd += L" w:val=\"pct20\""; break;
case SimpleTypes::shdPct25 : sShd += L" w:val=\"pct25\""; break;
case SimpleTypes::shdPct30 : sShd += L" w:val=\"pct30\""; break;
case SimpleTypes::shdPct35 : sShd += L" w:val=\"pct35\""; break;
case SimpleTypes::shdPct37 : sShd += L" w:val=\"pct37\""; break;
case SimpleTypes::shdPct40 : sShd += L" w:val=\"pct40\""; break;
case SimpleTypes::shdPct45 : sShd += L" w:val=\"pct45\""; break;
case SimpleTypes::shdPct5 : sShd += L" w:val=\"pct5\""; break;
case SimpleTypes::shdPct50 : sShd += L" w:val=\"pct50\""; break;
case SimpleTypes::shdPct55 : sShd += L" w:val=\"pct55\""; break;
case SimpleTypes::shdPct60 : sShd += L" w:val=\"pct60\""; break;
case SimpleTypes::shdPct62 : sShd += L" w:val=\"pct62\""; break;
case SimpleTypes::shdPct65 : sShd += L" w:val=\"pct65\""; break;
case SimpleTypes::shdPct70 : sShd += L" w:val=\"pct70\""; break;
case SimpleTypes::shdPct75 : sShd += L" w:val=\"pct75\""; break;
case SimpleTypes::shdPct80 : sShd += L" w:val=\"pct80\""; break;
case SimpleTypes::shdPct85 : sShd += L" w:val=\"pct85\""; break;
case SimpleTypes::shdPct87 : sShd += L" w:val=\"pct87\""; break;
case SimpleTypes::shdPct90 : sShd += L" w:val=\"pct90\""; break;
case SimpleTypes::shdPct95 : sShd += L" w:val=\"pct95\""; break;
case SimpleTypes::shdReverseDiagStripe : sShd += L" w:val=\"reverseDiagStripe\""; break;
case SimpleTypes::shdSolid : sShd += L" w:val=\"solid\""; break;
case SimpleTypes::shdThinDiagCross : sShd += L" w:val=\"thinDiagCross\""; break;
case SimpleTypes::shdThinDiagStripe : sShd += L" w:val=\"thinDiagStripe\""; break;
case SimpleTypes::shdThinHorzCross : sShd += L" w:val=\"thinHorzCross\""; break;
case SimpleTypes::shdThinHorzStripe : sShd += L" w:val=\"thinHorzStripe\""; break;
case SimpleTypes::shdThinReverseDiagStripe : sShd += L" w:val=\"thinReverseDiagStripe\""; break;
case SimpleTypes::shdThinVertStripe : sShd += L" w:val=\"thinVertStripe\""; break;
case SimpleTypes::shdVertStripe : sShd += L" w:val=\"vertStripe\""; break;
default : sShd += L" w:val=\"solid\""; break;
}
}
if (bColor)
sShd += L" w:color=\"" + Color.ToString() + L"\"";
if (bFill)
sShd += L" w:fill=\"" + Fill.ToString() + L"\"";
if(bThemeColor && ThemeColor.IsNoEmpty())
{
if(ThemeColor.Auto && !bFill)
sShd += L" w:fill=\"auto\"";
if(ThemeColor.bColor)
sShd += L" w:themeFill=\"" + ThemeColor.ToStringColor() + L"\"";
if(ThemeColor.bTint)
sShd += L" w:themeFillTint=\"" + ThemeColor.ToStringTint() + L"\"";
if(ThemeColor.bShade)
sShd += L" w:themeFillShade=\"" + ThemeColor.ToStringShade() + L"\"";
}
if(bThemeFill && ThemeFill.IsNoEmpty())
{
if(ThemeFill.Auto && !bColor)
sShd += L" w:color=\"auto\"";
if(ThemeFill.bColor)
sShd += L" w:themeColor=\"" + ThemeFill.ToStringColor() + L"\"";
if(ThemeFill.bTint)
sShd += L" w:themeTint=\"" + ThemeFill.ToStringTint() + L"\"";
if(ThemeFill.bShade)
sShd += L" w:themeShade=\"" + ThemeFill.ToStringShade() + L"\"";
}
sShd += L"/>";
}
return sShd;
}
};
class Tab
{
public:
@ -578,7 +477,9 @@ public:
bool bLangEA;
bool bThemeColor;
bool bVanish;
bool bSnapToGrid;
long CompressText;
bool bDoNotWriteNullProp;
public:
rPr(boost::unordered_map<std::wstring, int>& mapFonts) : m_mapFonts(mapFonts)
@ -596,7 +497,6 @@ public:
DStrikeout = false;
Caps = false;
SmallCaps = false;
bBold = false;
bItalic = false;
bUnderline = false;
@ -627,6 +527,7 @@ public:
bThemeColor = false;
ThemeColor.Reset();
bVanish = false;
bSnapToGrid = true;
nHighLight = 0; //not set
Outline.clear();
@ -636,10 +537,25 @@ public:
MoveFrom.clear();
MoveTo.clear();
rPrChange.clear();
FontAscii.clear();
FontHAnsi.clear();
FontAE.clear();
FontCS.clear();
FontAsciiTheme.clear();
FontHAnsiTheme.clear();
FontAETheme.clear();
FontCSTheme.clear();
Shd.clear();
RStyle.clear();
LangBidi.clear();
LangEA.clear();
CompressText = -1; //not set
}
bool IsNoEmpty()
{
return bBold || bItalic || bUnderline || bStrikeout || bFontAscii || bFontHAnsi || bFontAE || bFontCS || bFontSize || bColor || bVertAlign || nHighLight > 0 || bShd ||
return !bSnapToGrid || bBold || bItalic || bUnderline || bStrikeout || bFontAscii || bFontHAnsi || bFontAE || bFontCS || bFontSize || bColor || bVertAlign || nHighLight > 0 || bShd ||
bRStyle || bSpacing || bDStrikeout || bCaps || bSmallCaps || bPosition || bFontHint || bBoldCs || bItalicCs || bFontSizeCs || bCs || bRtl || bLang || bLangBidi || bLangEA || bThemeColor || bVanish ||
!Outline.empty() || !Fill.empty() || !Del.empty() || !Ins.empty() || !MoveFrom.empty() || !MoveTo.empty() || !rPrChange.empty() || !FontAsciiTheme.empty() || !FontHAnsiTheme.empty() || !FontAETheme.empty() || !FontCSTheme.empty();
}
@ -701,47 +617,51 @@ public:
sFont += _T("/>");
pCStringWriter->WriteString(sFont);
}
if (CompressText >= 0 && CompressText <= 600)
{
pCStringWriter->WriteString(L"<w:w w:val=\"" + std::to_wstring(CompressText) + L"\"/>");
}
if(bBold)
{
if(Bold)
pCStringWriter->WriteString(L"<w:b/>");
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(L"<w:b w:val=\"false\"/>");
pCStringWriter->WriteString(L"<w:b w:val=\"0\"/>");
}
if(bBoldCs)
{
if(BoldCs)
pCStringWriter->WriteString(L"<w:bCs/>");
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(L"<w:bCs w:val=\"false\"/>");
pCStringWriter->WriteString(L"<w:bCs w:val=\"0\"/>");
}
if(bItalic)
{
if(Italic)
pCStringWriter->WriteString(L"<w:i/>");
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(L"<w:i w:val=\"false\"/>");
pCStringWriter->WriteString(L"<w:i w:val=\"0\"/>");
}
if(bItalicCs)
{
if(ItalicCs)
pCStringWriter->WriteString(L"<w:iCs />");
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(L"<w:iCs w:val=\"false\"/>");
pCStringWriter->WriteString(L"<w:iCs w:val=\"0\"/>");
}
if(bCaps)
{
if(Caps)
pCStringWriter->WriteString(L"<w:caps/>");
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(L"<w:caps w:val=\"false\"/>");
pCStringWriter->WriteString(L"<w:caps w:val=\"0\"/>");
}
if(bSmallCaps)
{
if(SmallCaps)
pCStringWriter->WriteString(L"<w:smallCaps/>");
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(L"<w:smallCaps w:val=\"false\"/>");
pCStringWriter->WriteString(L"<w:smallCaps w:val=\"0\"/>");
}
if(bStrikeout)
{
@ -783,6 +703,10 @@ public:
sColor += L"/>";
pCStringWriter->WriteString(sColor);
}
if (!bSnapToGrid)
{
pCStringWriter->WriteString(L"<w:snapToGrid w:val=\"0\"/>");
}
if(bSpacing)
{
pCStringWriter->WriteString(L"<w:spacing w:val=\"" + std::to_wstring(Spacing) + L"\"/>");
@ -798,8 +722,8 @@ public:
}
if(bFontSizeCs)
{
if(false == bFontSize)
pCStringWriter->WriteString(L"<w:sz w:val=\"" + std::to_wstring(FontSizeCs) + L"\"/>");
//if(false == bFontSize) - Sample Doc.docx
// 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(nHighLight > 0)
@ -984,10 +908,10 @@ public:
std::wstring sType;
switch(byteType)
{
case styletype_Character: sType = _T("character");break;
case styletype_Numbering: sType = _T("numbering");break;
case styletype_Table: sType = _T("table");break;
default: sType = _T("paragraph");break;
case styletype_Character: sType = _T("character");break;
case styletype_Numbering: sType = _T("numbering");break;
case styletype_Table: sType = _T("table");break;
default: sType = _T("paragraph");break;
}
if(!Id.empty())
{
@ -1009,12 +933,31 @@ public:
sStyle += L">";
pCStringWriter->WriteString(sStyle);
if(!Aliases.empty())
if(!Name.empty())
{
pCStringWriter->WriteString(L"<w:name w:val=\"" + Name + L"\"/>");
}
if (!Aliases.empty())
{
pCStringWriter->WriteString(L"<w:aliases w:val=\"");
pCStringWriter->WriteEncodeXmlString(Aliases);
pCStringWriter->WriteString(L"\"/>");
}
if (!BasedOn.empty())
{
pCStringWriter->WriteString(L"<w:basedOn w:val=\"" + BasedOn + L"\"/>");
}
if (!NextId.empty())
{
pCStringWriter->WriteString(L"<w:next w:val=\"" + NextId + L"\"/>");
}
if (!Link.empty())
{
pCStringWriter->WriteString(L"<w:link w:val=\"");
pCStringWriter->WriteEncodeXmlString(Link);
pCStringWriter->WriteString(L"\"/>");
}
if(bautoRedefine)
{
if(autoRedefine)
@ -1022,17 +965,44 @@ public:
else
pCStringWriter->WriteString(L"<w:autoRedefine val=\"false\"/>");
}
if(!Name.empty())
if (bhidden)
{
pCStringWriter->WriteString(L"<w:name w:val=\"" + Name + L"\"/>");
if (hidden)
pCStringWriter->WriteString(L"<w:hidden/>");
else
pCStringWriter->WriteString(L"<w:hidden val=\"false\"/>");
}
if(!BasedOn.empty())
if (buiPriority)
{
pCStringWriter->WriteString(L"<w:basedOn w:val=\"" + BasedOn + L"\"/>");
pCStringWriter->WriteString(L"<w:uiPriority w:val=\"" + std::to_wstring(uiPriority) + L"\"/>");
}
if(!NextId.empty())
if (bsemiHidden)
{
pCStringWriter->WriteString(L"<w:next w:val=\"" + NextId + L"\"/>");
if (semiHidden)
pCStringWriter->WriteString(L"<w:semiHidden/>");
else
pCStringWriter->WriteString(L"<w:semiHidden val=\"false\"/>");
}
if (bunhideWhenUsed)
{
if (unhideWhenUsed)
pCStringWriter->WriteString(L"<w:unhideWhenUsed/>");
else
pCStringWriter->WriteString(L"<w:unhideWhenUsed val=\"false\"/>");
}
if (bqFormat)
{
if (qFormat)
pCStringWriter->WriteString(L"<w:qFormat/>");
else
pCStringWriter->WriteString(L"<w:qFormat val=\"false\"/>");
}
if (blocked)
{
if (locked)
pCStringWriter->WriteString(L"<w:locked/>");
else
pCStringWriter->WriteString(L"<w:locked val=\"false\"/>");
}
if(bpersonal)
{
@ -1055,61 +1025,17 @@ public:
else
pCStringWriter->WriteString(L"<w:personalReply val=\"false\"/>");
}
if(!Link.empty())
{
pCStringWriter->WriteString(L"<w:link w:val=\"");
pCStringWriter->WriteEncodeXmlString(Link);
pCStringWriter->WriteString(L"\"/>");
}
if(blocked)
{
if(locked)
pCStringWriter->WriteString(L"<w:locked/>");
else
pCStringWriter->WriteString(L"<w:locked val=\"false\"/>");
}
if(bqFormat)
{
if(qFormat)
pCStringWriter->WriteString(L"<w:qFormat/>");
else
pCStringWriter->WriteString(L"<w:qFormat val=\"false\"/>");
}
if(buiPriority)
{
pCStringWriter->WriteString(L"<w:uiPriority w:val=\"" + std::to_wstring(uiPriority) + L"\"/>");
}
if(bhidden)
{
if(hidden)
pCStringWriter->WriteString(L"<w:hidden/>");
else
pCStringWriter->WriteString(L"<w:hidden val=\"false\"/>");
}
if(bsemiHidden)
{
if(semiHidden)
pCStringWriter->WriteString(L"<w:semiHidden/>");
else
pCStringWriter->WriteString(L"<w:semiHidden val=\"false\"/>");
}
if(bunhideWhenUsed)
{
if(unhideWhenUsed)
pCStringWriter->WriteString(L"<w:unhideWhenUsed/>");
else
pCStringWriter->WriteString(L"<w:unhideWhenUsed val=\"false\"/>");
}
if(!TextPr.empty())
{
pCStringWriter->WriteString(TextPr);
}
if(!ParaPr.empty())
{
pCStringWriter->WriteString(L"<w:pPr>");
pCStringWriter->WriteString(ParaPr);
pCStringWriter->WriteString(L"</w:pPr>");
}
if(!TextPr.empty())
{
pCStringWriter->WriteString(TextPr);
}
if(!TablePr.empty())
pCStringWriter->WriteString(TablePr);
if(!RowPr.empty())
@ -1364,14 +1290,6 @@ public:
{
pCStringWriter->WriteString(L" w:color=\"" + Color.ToString() + L"\"");
}
if(bSize)
{
pCStringWriter->WriteString(L" w:sz=\"" + std::to_wstring(Size) + L"\"");
}
if(bSpace)
{
pCStringWriter->WriteString(L" w:space=\"" + std::to_wstring(Space) + L"\"");
}
if(bThemeColor && ThemeColor.IsNoEmpty())
{
if(ThemeColor.Auto && !bColor)
@ -1392,6 +1310,14 @@ public:
pCStringWriter->WriteString(L" w:themeShade=\"" + ThemeColor.ToStringShade() + L"\"");
}
}
if(bSize)
{
pCStringWriter->WriteString(L" w:sz=\"" + std::to_wstring(Size) + L"\"");
}
if(bSpace)
{
pCStringWriter->WriteString(L" w:space=\"" + std::to_wstring(Space) + L"\"");
}
pCStringWriter->WriteString(L"/>");
}
else
@ -1441,18 +1367,18 @@ public:
}
void Write(NSStringUtils::CStringBuilder* pCStringWriter, bool bCell)
{
if(bLeft)
oLeft.Write(L"w:left", pCStringWriter, bCell);
if(bTop)
oTop.Write(L"w:top", pCStringWriter, bCell);
if(bRight)
oRight.Write(L"w:right", pCStringWriter, bCell);
if(bLeft)
oLeft.Write(L"w:left", pCStringWriter, bCell);
if(bBottom)
oBottom.Write(L"w:bottom", pCStringWriter, bCell);
if(bInsideV)
oInsideV.Write(L"w:insideV", pCStringWriter, bCell);
if(bRight)
oRight.Write(L"w:right", pCStringWriter, bCell);
if(bInsideH)
oInsideH.Write(L"w:insideH", pCStringWriter, bCell);
if(bInsideV)
oInsideV.Write(L"w:insideV", pCStringWriter, bCell);
if(bBetween)
oBetween.Write(L"w:between", pCStringWriter, bCell);
}

File diff suppressed because it is too large Load Diff

View File

@ -38,8 +38,8 @@
namespace OOX
{
class CComments;
class CSettingsCustom;
class CSettings;
}
namespace BinDocxRW {
@ -56,35 +56,24 @@ class Binary_CommonReader2 : public Binary_CommonReader
public:
Binary_CommonReader2(NSBinPptxRW::CBinaryFileReader& poBufferedStream);
docRGB ReadColor();
void ReadColor2(SimpleTypes::CHexColor<>& color);
void ReadHexColor(SimpleTypes::CHexColor<> *pColor);
void ReadThemeColor(int length, CThemeColor& oCThemeColor);
int _ReadThemeColor(BYTE type, long length, void* poResult);
int ReadThemeColorContent(BYTE type, long length, void* poResult);
template<typename T> int ReadTrackRevision(long length, T* poResult);
int ReadShd(BYTE type, long length, void* poResult);
int ReadShdComplexType(BYTE type, long length, void* poResult);
private:
template<typename T> int ReadTrackRevisionInner(BYTE type, long length, T* poResult);
};
class Binary_VbaProjectTableReader : public Binary_CommonReader
{
Writers::FileWriter& m_oFileWriter;
public:
Binary_VbaProjectTableReader (NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter);
int Read ();
};
class Binary_HdrFtrTableReader : public Binary_CommonReader
{
Writers::FileWriter& m_oFileWriter;
CComments* m_pComments;
int nCurType;
int nCurHeaderType;
public:
Writers::HeaderFooterWriter& m_oHeaderFooterWriter;
Binary_HdrFtrTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, CComments* pComments);
Binary_HdrFtrTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter);
int Read();
int ReadHdrFtrContent (BYTE type, long length, void* poResult);
int ReadHdrFtrFEO (BYTE type, long length, void* poResult);
@ -251,10 +240,13 @@ class Binary_SettingsTableReader : public Binary_CommonReader
Binary_rPrReader m_oBinary_rPrReader;
Writers::SettingWriter& m_oSettingWriter;
Writers::FileWriter& m_oFileWriter;
OOX::CSettingsCustom& m_oSettingsCustom;
OOX::CSettingsCustom* m_pSettingsCustom;
public:
Binary_SettingsTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, OOX::CSettingsCustom& oSettingsCustom);
Binary_SettingsTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, OOX::CSettingsCustom* pSettingsCustom);
int Read();
int ReadDocProtect(BYTE type, long length, void* poResult);
int ReadWriteProtect(BYTE type, long length, void* poResult);
int ReadSettings(BYTE type, long length, void* poResult);
int ReadCompat(BYTE type, long length, void* poResult);
int ReadCompatSetting(BYTE type, long length, void* poResult);
@ -296,13 +288,12 @@ private:
NSStringUtils::CStringBuilder m_oCur_pPr;
BYTE m_byteLastElemType;
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(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, Writers::ContentWriter& oDocumentWriter);
~Binary_DocumentTableReader();
int Read();
@ -485,16 +476,16 @@ public:
int ReadSdtFormPr(BYTE type, long length, void* poResult);
int ReadSdtTextFormPr(BYTE type, long length, void* poResult);
int ReadSdtTextFormPrComb(BYTE type, long length, void* poResult);
int ReadSdtPicture(BYTE type, long length, void* poResult);
};
class Binary_NotesTableReader : public Binary_CommonReader
{
Writers::FileWriter& m_oFileWriter;
CComments* m_pComments;
bool m_bIsFootnote;
nullable<SimpleTypes::CDecimalNumber<>> m_oId;
nullable<SimpleTypes::CFtnEdn<>> m_oType;
public:
Binary_NotesTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, CComments* pComments, bool bIsFootnote);
Binary_NotesTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, bool bIsFootnote);
int Read();
int ReadNotes(BYTE type, long length, void* poResult);
int ReadNote(BYTE type, long length, void* poResult);
@ -506,8 +497,9 @@ private:
NSBinPptxRW::CBinaryFileReader& m_oBufferedStream;
Writers::FileWriter& m_oFileWriter;
std::wstring m_sFileInDir;
bool m_bMacro;
public:
BinaryFileReader(std::wstring& sFileInDir, NSBinPptxRW::CBinaryFileReader& oBufferedStream, Writers::FileWriter& oFileWriter);
BinaryFileReader(std::wstring& sFileInDir, NSBinPptxRW::CBinaryFileReader& oBufferedStream, Writers::FileWriter& oFileWriter, bool bMacro = false);
int ReadFile();
int ReadMainTable();
};

View File

@ -36,55 +36,28 @@
namespace Writers
{
static std::wstring g_string_set_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><w:settings xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\">");
static std::wstring g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults>");
static std::wstring g_string_set_End = _T("</w:settings>");
class SettingWriter
{
std::wstring m_sDir;
NSStringUtils::CStringBuilder m_oSettingWriter;
HeaderFooterWriter& m_oHeaderFooterWriter;
public:
SettingWriter(std::wstring sDir, HeaderFooterWriter& oHeaderFooterWriter):m_sDir(sDir),m_oHeaderFooterWriter(oHeaderFooterWriter)
SettingWriter(std::wstring sDir) : m_sDir(sDir)
{
}
void Write(bool bGlossary = false)
{
Prepare();
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + L"word" + (bGlossary ? (FILE_SEPARATOR_STR + std::wstring(L"glossary")) : L"") + FILE_SEPARATOR_STR + L"settings.xml";
NSFile::CFileBinary oFile;
oFile.CreateFileW(filePath.GetPath());
oFile.WriteStringUTF8(g_string_set_Start);
oFile.WriteStringUTF8(m_oSettingWriter.GetData());
oFile.WriteStringUTF8(g_string_set_Default);
oFile.WriteStringUTF8(g_string_set_End);
oFile.CloseFile();
}
void AddSetting(std::wstring sSetting)
{
m_oSettingWriter.WriteString(sSetting);
}
void Prepare()
{
if(BinDocxRW::g_nCurFormatVersion < 5)
{
bool bevenAndOddHeaders = false;
for(size_t i = 0, length = m_oHeaderFooterWriter.m_aHeaders.size(); i < length; ++i)
{
HdrFtrItem* pHeader = m_oHeaderFooterWriter.m_aHeaders[i];
if(SimpleTypes::hdrftrEven == pHeader->eType)
bevenAndOddHeaders = true;
}
for(size_t i = 0, length = m_oHeaderFooterWriter.m_aFooters.size(); i < length; ++i)
{
HdrFtrItem* pFooter = m_oHeaderFooterWriter.m_aFooters[i];
if(SimpleTypes::hdrftrEven == pFooter->eType)
bevenAndOddHeaders = true;
}
if(bevenAndOddHeaders)
AddSetting(L"<w:evenAndOddHeaders/>");
}
}
};
}

View File

@ -110,7 +110,7 @@ const double g_dKoef_mm_to_hps = 2 * g_dKoef_mm_to_pt;
const static wchar_t* g_sFormatSignature = L"DOCY";
const int g_nFormatVersion = 5;
const int g_nFormatVersionNoBase64 = 10;
const int g_nFormatVersionNoBase64 = 10;
extern int g_nCurFormatVersion;
namespace c_oAscWrapStyle{enum c_oSerFormat
{
@ -416,7 +416,9 @@ extern int g_nCurFormatVersion;
FontAsciiTheme = 40,
FontHAnsiTheme = 41,
FontAETheme = 42,
FontCSTheme = 43
FontCSTheme = 43,
CompressText = 44,
SnapToGrid = 45
};}
namespace c_oSerProp_rowPrType{enum c_oSerProp_rowPrType
{
@ -864,7 +866,10 @@ extern int g_nCurFormatVersion;
BookFoldPrinting = 15,
BookFoldPrintingSheets = 16,
BookFoldRevPrinting = 17,
SpecialFormsHighlight = 18
SpecialFormsHighlight = 18,
DocumentProtection = 19,
WriteProtection = 20
};}
namespace c_oSer_MathPrType{enum c_oSer_SettingsType
{
@ -1153,7 +1158,8 @@ extern int g_nCurFormatVersion;
Custom = 0,
ItemId = 1,
Uri = 2,
Content = 3
Content = 3,
ContentA = 4
};}
namespace c_oSerApp{enum c_oSerApp
{
@ -1166,7 +1172,8 @@ extern int g_nCurFormatVersion;
Name = 1,
Hidden = 2,
Title = 3,
Descr = 4
Descr = 4,
Form = 5
};}
namespace c_oSerEmbedded{enum c_oSerEmbedded
{
@ -1232,7 +1239,17 @@ extern int g_nCurFormatVersion;
TextFormPrCombSym = 53,
TextFormPrCombFont = 54,
TextFormPrMaxCharacters = 55,
TextFormPrCombBorder = 56
TextFormPrCombBorder = 56,
TextFormPrAutoFit = 57,
TextFormPrMultiLine = 58,
PictureFormPr = 60,
PictureFormPrScaleFlag = 61,
PictureFormPrLockProportions = 62,
PictureFormPrRespectBorders = 63,
PictureFormPrShiftX = 64,
PictureFormPrShiftY = 65,
FormPrBorder = 70,
FormPrShd = 71
};}
namespace c_oSerFFData{enum c_oSerFFData
{
@ -1291,4 +1308,46 @@ extern int g_nCurFormatVersion;
Flags2 = 5,
Flags3 = 6
};}
namespace c_oDocProtect {
enum c_oDocProtect
{
AlgorithmName = 0,
Edit = 1,
Enforcment = 2,
Formatting = 3,
HashValue = 4,
SaltValue = 5,
SpinCount = 6,
AlgIdExt = 7,
AlgIdExtSource = 8,
CryptAlgorithmClass = 9,
CryptAlgorithmSid = 10,
CryptAlgorithmType = 11,
CryptProvider = 12,
CryptProviderType = 13,
CryptProviderTypeExt = 14,
CryptProviderTypeExtSource = 15
};
}
namespace c_oWriteProtect {
enum c_oWriteProtect
{
AlgorithmName = 0,
Recommended = 1,
HashValue = 2,
SaltValue = 3,
SpinCount = 4,
AlgIdExt = 7,
AlgIdExtSource = 8,
CryptAlgorithmClass = 9,
CryptAlgorithmSid = 10,
CryptAlgorithmType = 11,
CryptProvider = 12,
CryptProviderType = 13,
CryptProviderTypeExt = 14,
CryptProviderTypeExtSource = 15
};
}
}

File diff suppressed because it is too large Load Diff

View File

@ -88,8 +88,12 @@ namespace BinDocxRW
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)
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_pMain = NULL;
m_pSettings = NULL;
@ -331,7 +335,6 @@ namespace BinDocxRW
void WriteAltChunk(OOX::Media& oAltChunk, OOX::CStyles* styles);
void WriteVbaProject(OOX::VbaProject& oVbaProject);
void Write(std::vector<OOX::WritingElement*> & aElems);
void WriteDocumentContent(const std::vector<OOX::WritingElement*> & aElems);
void WriteBackground (OOX::WritingElement* pBackground);
@ -495,9 +498,10 @@ namespace BinDocxRW
void WriteSdtPrDate(const OOX::Logic::CDate& oDate);
void WriteDocPartList(const OOX::Logic::CSdtDocPart& oSdtDocPart);
void WriteDropDownList(const OOX::Logic::CSdtDropDownList& oDropDownList);
void WriteSdtFormPr(const ComplexTypes::Word::CFormPr& oFormPr);
void WriteSdtFormPr(const OOX::Logic::CFormPr& oFormPr);
void WriteSdtTextFormPr(const OOX::Logic::CTextFormPr& oTextFormPr);
void WriteSdtTextFormPrComb(const ComplexTypes::Word::CComb& oComb);
void WriteSdtPicture(const OOX::Logic::CSdtPicture& oSdtPicture);
};
class BinaryCustomsTableWriter
{
@ -544,6 +548,8 @@ namespace BinDocxRW
void WriteColorSchemeMapping(const PPTX::Logic::ClrMap& oColorSchemeMapping);
void WriteCompat(const OOX::Settings::CCompat& oCompat);
void WriteCompatSetting(const OOX::Settings::CCompatSetting& oCompatSetting);
void WriteDocumentProtection(const OOX::Settings::CDocProtect& oDocProtect);
void WriteWriteProtection(const OOX::Settings::CWriteProtection& oWriteProtection);
};
class BinaryNotesTableWriter
{

View File

@ -516,8 +516,7 @@ namespace BinXlsxRW{
{
pWorksheet = new OOX::Spreadsheet::CWorksheet(NULL);
pWorksheet->m_oSheetFormatPr.Init();
pWorksheet->m_oSheetFormatPr->m_oDefaultRowHeight.Init();
pWorksheet->m_oSheetFormatPr->m_oDefaultRowHeight->SetValue(15);
pWorksheet->m_oSheetFormatPr->m_oDefaultRowHeight = 15.;
pWorksheet->m_oPageMargins.Init();
pWorksheet->m_oPageMargins.Init();
pWorksheet->m_oPageMargins->m_oLeft.Init();

View File

@ -122,6 +122,9 @@ namespace BinDocxRW
if (L"pkg:xmlData" == sName)
{
std::wstring data = oReader.GetInnerXml();
XmlUtils::replace_all(data, L"&#xA;", L"");
XmlUtils::replace_all(data, L"&#x9;", L"");
//todooo убрать "красивую" разметку xml
WriteXmlFile(*name, data);
}
if (L"pkg:binaryData" == sName)
@ -142,6 +145,7 @@ namespace BinDocxRW
NSFile::CFileBinary file;
if (file.CreateFileW(path.GetPath()))
{
file.WriteStringUTF8(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n");
file.WriteStringUTF8(data);
file.CloseFile();
}
@ -175,13 +179,10 @@ namespace BinDocxRW
};
}
BinDocxRW::CDocxSerializer::CDocxSerializer()
BinDocxRW::CDocxSerializer::CDocxSerializer() : m_bIsMacro(false), m_bIsNoBase64Save(false), m_bIsNoBase64(false)
{
m_pParamsWriter = NULL;
m_pCurFileWriter = NULL;
m_bIsNoBase64Save = false;
m_bIsNoBase64 = false;
}
BinDocxRW::CDocxSerializer::~CDocxSerializer()
{
@ -414,7 +415,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
oDrawingConverter.SetSrcPath(sFileInDir);
BinaryFileReader oBinaryFileReader(sFileInDir, oBufferedStream, *m_pCurFileWriter);
BinaryFileReader oBinaryFileReader(sFileInDir, oBufferedStream, *m_pCurFileWriter, m_bIsMacro);
oBinaryFileReader.ReadFile();
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//themes
@ -475,7 +476,7 @@ bool BinDocxRW::CDocxSerializer::getXmlContent(NSBinPptxRW::CBinaryFileReader& o
{
long nLength = oBufferedStream.GetLong();
Writers::ContentWriter oTempContentWriter;
BinDocxRW::Binary_DocumentTableReader oBinary_DocumentTableReader(oBufferedStream, *m_pCurFileWriter, oTempContentWriter, m_pCurFileWriter->m_pComments);
BinDocxRW::Binary_DocumentTableReader oBinary_DocumentTableReader(oBufferedStream, *m_pCurFileWriter, oTempContentWriter);
oBinary_DocumentTableReader.ReadDocumentContentOut(nLength);
sOutputXml = oTempContentWriter.m_oContent.GetData();
@ -563,7 +564,7 @@ bool BinDocxRW::CDocxSerializer::getXmlContentElem(OOX::EElementType eType, NSBi
{
long nLength = oBufferedStream.GetLong();
Writers::ContentWriter oTempContentWriter;
BinDocxRW::Binary_DocumentTableReader oBinary_DocumentTableReader(oBufferedStream, *m_pCurFileWriter, oTempContentWriter, m_pCurFileWriter->m_pComments);
BinDocxRW::Binary_DocumentTableReader oBinary_DocumentTableReader(oBufferedStream, *m_pCurFileWriter, oTempContentWriter);
if(OOX::et_m_oMathPara == eType)
{
@ -591,13 +592,17 @@ void BinDocxRW::CDocxSerializer::setEmbeddedFontsDir(const std::wstring& sEmbedd
{
m_sEmbeddedFontsDir = sEmbeddedFontsDir;
}
void BinDocxRW::CDocxSerializer::setIsNoBase64Save(bool bIsNoBase64Save)
void BinDocxRW::CDocxSerializer::setIsNoBase64Save(bool val)
{
m_bIsNoBase64Save = bIsNoBase64Save;
m_bIsNoBase64Save = val;
}
void BinDocxRW::CDocxSerializer::setIsNoBase64(bool bIsNoBase64)
void BinDocxRW::CDocxSerializer::setIsNoBase64(bool val)
{
m_bIsNoBase64 = bIsNoBase64;
m_bIsNoBase64 = val;
}
void BinDocxRW::CDocxSerializer::setMacroEnabled(bool val)
{
m_bIsMacro = val;
}
bool BinDocxRW::CDocxSerializer::unpackageFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath)
{

View File

@ -49,14 +49,16 @@ namespace BinDocxRW
class CDocxSerializer
{
public:
private:
std::wstring m_sFontDir;
std::wstring m_sEmbeddedFontsDir;
bool m_bIsMacro;
bool m_bIsNoBase64Save;
bool m_bIsNoBase64;
ParamsWriter* m_pParamsWriter;
public:
Writers::FileWriter* m_pCurFileWriter;
ParamsWriter* m_pParamsWriter;
CDocxSerializer();
virtual ~CDocxSerializer();
@ -75,8 +77,9 @@ namespace BinDocxRW
void setFontDir (const std::wstring& sFontDir);
void setEmbeddedFontsDir(const std::wstring& sEmbeddedFontsDir);
void setIsNoBase64Save (bool bIsNoBase64Save);
void setIsNoBase64 (bool bIsNoBase64);
void setSaveChartAsImg (bool bSaveChartAsImg);
void setIsNoBase64Save (bool val);
void setIsNoBase64 (bool val);
void setSaveChartAsImg (bool val);
void setMacroEnabled (bool val);
};
}

View File

@ -42,15 +42,13 @@
#include "ChartWriter.h"
#include "../BinReader/DefaultThemeWriter.h"
//#include "../../Common/DocxFormat/Source/XlsxFormat/Chart/Chart.h"
namespace BinXlsxRW{
int g_nCurFormatVersion = 0;
CXlsxSerializer::CXlsxSerializer()
CXlsxSerializer::CXlsxSerializer() : m_bIsMacro(false), m_bIsNoBase64(false)
{
m_pExternalDrawingConverter = NULL;
m_bIsNoBase64 = false;
}
CXlsxSerializer::~CXlsxSerializer()
{
@ -98,18 +96,18 @@ namespace BinXlsxRW{
oDrawingConverter.SetEmbedDstPath(sEmbedDir);
BinXlsxRW::BinaryFileReader oBinaryFileReader;
return oBinaryFileReader.ReadFile(sSrcFileName, sDstPath, &oDrawingConverter, sXMLOptions);
return oBinaryFileReader.ReadFile(sSrcFileName, sDstPath, &oDrawingConverter, sXMLOptions, m_bIsMacro);
}
_UINT32 CXlsxSerializer::saveToFile(const std::wstring& sDstFileName, const std::wstring& sSrcPath, const std::wstring& sXMLOptions)
_UINT32 CXlsxSerializer::saveToFile(const std::wstring& sDstFileName, const std::wstring& sSrcPath, const std::wstring& sXMLOptions)
{
COfficeFontPicker* pFontPicker = new COfficeFontPicker();
pFontPicker->Init(m_sFontDir);
NSFonts::IFontManager* pFontManager = pFontPicker->get_FontManager();
NSFonts::IFontManager* pFontManager = pFontPicker->get_FontManager();
DocWrapper::FontProcessor fp;
fp.setFontManager(pFontManager);
NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager = NULL;
if(false == m_sEmbeddedFontsDir.empty())
if (false == m_sEmbeddedFontsDir.empty())
{
NSDirectory::CreateDirectory(m_sEmbeddedFontsDir);
@ -122,12 +120,12 @@ namespace BinXlsxRW{
//pEmbeddedFontsManager добавляются все цифры
//для заголовков
pEmbeddedFontsManager->CheckFont(_T("Calibri"), pFontManager);
pEmbeddedFontsManager->CheckString(std::wstring(_T("ABCDEFGHIJKLMNOPQRSTUVWXYZ")));
pEmbeddedFontsManager->CheckString(std::wstring(_T("ABCDEFGHIJKLMNOPQRSTUVWXYZ")));
//дополнение для ошибок "#NULL!", "#DIV/0!"...
pEmbeddedFontsManager->CheckString(std::wstring(_T("#!/?")));
pEmbeddedFontsManager->CheckString(std::wstring(_T("#!/?")));
//дополнение для num форматов по умолчанию с id от 0 до 49
pEmbeddedFontsManager->CheckString(std::wstring(_T(".%E+-():")));
pEmbeddedFontsManager->CheckString(std::wstring(_T(".%E+-():")));
}
NSBinPptxRW::CDrawingConverter oOfficeDrawingConverter;
@ -141,7 +139,19 @@ namespace BinXlsxRW{
RELEASEOBJECT(pFontPicker);
return result;
}
bool CXlsxSerializer::saveChart(NSBinPptxRW::CBinaryFileReader* pReader, long lLength, NSCommon::smart_ptr<OOX::File> &file, const int& nChartNumber)
_UINT32 CXlsxSerializer::xml2Xlsx(const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions)
{
std::wstring strFileInDir = NSSystemPath::GetDirectoryName(sSrcFileName);
NSBinPptxRW::CDrawingConverter oDrawingConverter;
oDrawingConverter.SetDstPath(sDstPath + FILE_SEPARATOR_STR + L"xl");
oDrawingConverter.SetSrcPath(strFileInDir, 2);
BinXlsxRW::BinaryFileReader oBinaryFileReader;
return oBinaryFileReader.Xml2Xlsx(sSrcFileName, sDstPath, &oDrawingConverter, sXMLOptions, m_bIsMacro);
}
bool CXlsxSerializer::saveChart(NSBinPptxRW::CBinaryFileReader* pReader, long lLength, NSCommon::smart_ptr<OOX::File> &file)
{
if (NULL == pReader) return false;
if (NULL == m_pExternalDrawingConverter) return false;
@ -182,7 +192,7 @@ namespace BinXlsxRW{
NSCommon::smart_ptr<OOX::Spreadsheet::CChartFile> chart_file = file.smart_dynamic_cast<OOX::Spreadsheet::CChartFile>();
if (chart_file.IsInit())
{
sFileName = L"chart" + std::to_wstring(nChartNumber) + L".xml";
sFileName = L"chart" + std::to_wstring(chart_file->GetGlobalNumber()) + L".xml";
bResult = (0 == oBinaryChartReader.ReadCT_ChartFile(lLength, chart_file.GetPointer()));
@ -218,7 +228,7 @@ namespace BinXlsxRW{
NSCommon::smart_ptr<OOX::Spreadsheet::CChartExFile> chartEx_file = file.smart_dynamic_cast<OOX::Spreadsheet::CChartExFile>();
if (chartEx_file.IsInit())
{
sFileName = L"chartEx" + std::to_wstring(nChartNumber) + L".xml";
sFileName = L"chartEx" + std::to_wstring(chartEx_file->GetGlobalNumber()) + L".xml";
bResult = (0 == oBinaryChartReader.ReadCT_ChartExFile(lLength, chartEx_file.GetPointer()));
@ -259,9 +269,13 @@ namespace BinXlsxRW{
{
m_pExternalDrawingConverter = pDrawingConverter;
}
void CXlsxSerializer::setIsNoBase64(bool bIsNoBase64)
void CXlsxSerializer::setIsNoBase64(bool val)
{
m_bIsNoBase64 = bIsNoBase64;
m_bIsNoBase64 = val;
}
void CXlsxSerializer::setMacroEnabled(bool val)
{
m_bIsMacro = val;
}
bool CXlsxSerializer::writeChartXlsx(const std::wstring& sDstFile, NSCommon::smart_ptr<OOX::File> &file)

View File

@ -55,22 +55,25 @@ namespace BinXlsxRW {
std::wstring m_sEmbeddedFontsDir;
NSBinPptxRW::CDrawingConverter* m_pExternalDrawingConverter;
bool m_bIsNoBase64;
bool m_bIsMacro;
public:
CXlsxSerializer();
~CXlsxSerializer();
static void CreateXlsxFolders (const std::wstring& sXmlOptions, const std::wstring& sDstPath, std::wstring& sMediaPath, std::wstring& sEmbedPath);
_UINT32 loadFromFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sMediaDir, const std::wstring& sEmbedPath);
_UINT32 saveToFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions);
bool saveChart (NSBinPptxRW::CBinaryFileReader* pReader, long lLength, NSCommon::smart_ptr<OOX::File> &file, const int& nChartNumber);
_UINT32 saveToFile (const std::wstring& sDstPath, const std::wstring& sSrcFileName, const std::wstring& sXMLOptions);
//------------------------------------------------
static void CreateXlsxFolders (const std::wstring& sXmlOptions, const std::wstring& sDstPath, std::wstring& sMediaPath, std::wstring& sEmbedPath);
void setFontDir (const std::wstring& sFontDir);
void setEmbeddedFontsDir(const std::wstring& sEmbeddedFontsDir);
void setDrawingConverter(NSBinPptxRW::CDrawingConverter* pDrawingConverter);
void setIsNoBase64 (bool bIsNoBase64);
void setIsNoBase64 (bool val);
void setMacroEnabled (bool val);
_UINT32 xml2Xlsx (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions);
bool saveChart (NSBinPptxRW::CBinaryFileReader* pReader, long lLength, NSCommon::smart_ptr<OOX::File> &file);
bool writeChartXlsx (const std::wstring& sDstFile, NSCommon::smart_ptr<OOX::File> &file);
bool hasPivot (const std::wstring& sSrcPath);
};

View File

@ -37,41 +37,38 @@
namespace cpdoccore {
namespace xml {
namespace xml {
class sax;
class sax;
class attributes;
class attributes;
typedef attributes attributes_wc;
typedef shared_ptr< attributes_wc >::Type attributes_wc_ptr;
typedef attributes attributes_wc;
}
namespace common
{
typedef shared_ptr< attributes_wc >::Type attributes_wc_ptr;
// Базовый класс для элемента, который может быть прочитан sax-reader -ом
// Для каждого элемента будут вызваны методы
// add_attributes, add_child_element, add_text как колбеки для чтения соответствующих данных
}
namespace common {
// Базовый класс для элемента, который может быть прочитан sax-reader -ом
// Для каждого элемента будут вызваны методы
// add_attributes, add_child_element, add_text как колбеки для чтения соответствующих данных
class read_doc_element
{
public:
bool read_sax( xml::sax * Reader);
virtual ~read_doc_element() = 0;
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name) = 0;
private:
virtual void add_attributes (const xml::attributes_wc_ptr & Attributes) = 0;
virtual void add_text (const std::wstring & Text) = 0;
virtual void add_space (const std::wstring & Text) = 0;
};
inline read_doc_element::~read_doc_element()
{
}
}
class read_doc_element
{
public:
bool read_sax( xml::sax * Reader);
virtual ~read_doc_element() = 0;
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name) = 0;
virtual void add_attributes (const xml::attributes_wc_ptr & Attributes) = 0;
private:
virtual void add_text (const std::wstring & Text) = 0;
virtual void add_space (const std::wstring & Text) = 0;
};
inline read_doc_element::~read_doc_element()
{
}
}
}

View File

@ -52,6 +52,7 @@ enum ElementType
typeTextReferenceMarkStart,
typeTextReferenceMarkEnd,
typeTextReferenceRef,
typeTextTabStop,
typeFieldFieldmarkStart,
typeFieldFieldmarkEnd,
@ -260,6 +261,8 @@ enum ElementType
typeStyleFooterLeft,
typeStyleFootnoteSep,
typeStyleProperties,
typeLoextHeaderFirst,
typeLoextFooterFirst,
@ -279,6 +282,7 @@ enum ElementType
typeStylePageLayout,
typeStyleMap,
typeStylePageMaster, // openoffice xml 1.0
typeTableTemplate,
typeTableTemplateElement,
@ -344,6 +348,7 @@ enum ElementType
typeTableTableRowNoGroup,
typeTableTableSource,
typeTableTableProtection,
typeTableSubTable, //openoffice xml 1.0
typeTableDataPilotTables,
typeTableDataPilotTable,

View File

@ -85,6 +85,7 @@ SOURCES += \
../src/odf/style_chart_properties.cpp \
../src/odf/style_graphic_properties.cpp \
../src/odf/style_map.cpp \
../src/odf/style_properties.cpp \
../src/odf/style_paragraph_properties.cpp \
../src/odf/style_paragraph_properties_docx.cpp \
../src/odf/style_paragraph_properties_pptx.cpp \
@ -220,7 +221,9 @@ SOURCES += \
../src/odf/datatypes/styleprint.cpp \
../src/odf/datatypes/charttimeunit.cpp \
../src/odf/datatypes/drawangle.cpp \
../src/odf/datatypes/messagetype.cpp \
../src/odf/datatypes/timeperiod.cpp \
../src/odf/datatypes/messagetype.cpp \
../src/odf/datatypes/stylecellprotect.cpp \
../src/docx/xlsx_conditionalFormatting.cpp \
../src/docx/xlsx_dxfs.cpp \
../src/docx/docx_content_type.cpp \
@ -484,7 +487,9 @@ HEADERS += \
../src/odf/datatypes/styleprint.h \
../src/odf/datatypes/drawangle.h \
../src/odf/datatypes/charttimeunit.h \
../src/odf/datatypes/messagetype.h \
../src/odf/datatypes/timeperiod.h \
../src/odf/datatypes/messagetype.h \
./src/odf/datatypes/stylecellprotect.h \
../src/docx/docx_content_type.h \
../src/docx/docx_conversion_context.h \
../src/docx/docx_conversion_state.h \

View File

@ -75,6 +75,7 @@
#include "../src/odf/style_chart_properties.cpp"
#include "../src/odf/style_graphic_properties.cpp"
#include "../src/odf/style_map.cpp"
#include "../src/odf/style_properties.cpp"
#include "../src/odf/style_paragraph_properties.cpp"
#include "../src/odf/style_paragraph_properties_docx.cpp"
#include "../src/odf/style_paragraph_properties_pptx.cpp"

View File

@ -134,4 +134,6 @@
#include "../src/odf/datatypes/styleprint.cpp"
#include "../src/odf/datatypes/charttimeunit.cpp"
#include "../src/odf/datatypes/drawangle.cpp"
#include "../src/odf/datatypes/messagetype.cpp""
#include "../src/odf/datatypes/messagetype.cpp"
#include "../src/odf/datatypes/timeperiod.cpp"
#include "../src/odf/datatypes/stylecellprotect.cpp"

View File

@ -111,12 +111,15 @@ _UINT32 ConvertODF2OOXml(const std::wstring & srcPath, const std::wstring & dstP
switch (type)
{
case 1:
case 4:
nResult = ConvertOdt2Docx(inputOdf, dstPath, fontsPath);
break;
case 2:
case 5:
nResult = ConvertOds2Xlsx(inputOdf, dstPath, fontsPath);
break;
case 3:
case 6:
nResult = ConvertOdp2Pptx(inputOdf, dstPath, fontsPath);
break;
}

View File

@ -198,7 +198,7 @@ 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(false == current_process_comment_)
if (false == current_process_comment_)
{
for (size_t i = 0; i < get_comments_context().ref_start_.size(); i++)
{
@ -226,6 +226,8 @@ void docx_conversion_context::add_element_to_run(std::wstring parenStyleId)
state_.in_run_ = true;
output_stream() << L"<w:r>";
start_changes();
if (!state_.text_properties_stack_.empty() || parenStyleId.length() > 0)
{
if (!state_.text_properties_stack_.empty())
@ -234,8 +236,8 @@ void docx_conversion_context::add_element_to_run(std::wstring parenStyleId)
get_styles_context().start();
if(( textProp) && (textProp->content().r_style_))parenStyleId = _T("");
textProp->content().docx_convert(*this);
if(( textProp) && (textProp->content_.r_style_))parenStyleId = _T("");
textProp->content_.docx_convert(*this);
}
get_styles_context().docx_serialize_text_style( output_stream(), parenStyleId, text_tracked_context_.dumpRPr_);
@ -1119,6 +1121,8 @@ void docx_conversion_context::process_styles()
}
_Wostream << L"</w:docDefaults>";
std::wstring default_style;
for (size_t i = 0; i < arStyles.size(); i++)
{
if (false == arStyles[i]->is_automatic() &&
@ -1134,6 +1138,11 @@ void docx_conversion_context::process_styles()
if (bDefault) // style
{
_Wostream << L" w:default=\"1\"";
if (arStyles[i]->type() == odf_types::style_family::Paragraph)
{
default_style = id;
}
}
else if (!arStyles[i]->is_default()) // default-style
{
@ -1150,6 +1159,10 @@ 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 (!bDefault && !default_style.empty())
{
_Wostream << L"<w:basedOn w:val=\"" << default_style << "\"/>";
}
// else if (false == bDefault && false == arStyles[i]->is_default() && styles_map_.check(L"", arStyles[i]->type()))
// {
//bDisplayed = false;
@ -1197,7 +1210,7 @@ void docx_conversion_context::start_process_style_content()
styles_context_.start();
}
void docx_conversion_context::process_section(std::wostream & strm, odf_reader::style_columns * columns)//from page layout
void docx_conversion_context::process_section(std::wostream & strm, odf_reader::style_columns *columns_page)//from page layout
{
if (root()->odf_context().pageLayoutContainer().linenumbering())
{
@ -1209,7 +1222,8 @@ void docx_conversion_context::process_section(std::wostream & strm, odf_reader::
oox::section_context::_section & section = get_section_context().get_last();
if (!columns)
odf_reader::style_columns *columns = columns_page;
//if (!columns)
{
if (const odf_reader::style_instance * secStyle = root()->odf_context().styleContainer().style_by_name(section.style_, odf_types::style_family::Section, process_headers_footers_))
{
@ -1266,20 +1280,27 @@ void docx_conversion_context::process_section(std::wostream & strm, odf_reader::
}
for (size_t i = 0; page_width > 0, i < columns->style_columns_.size(); i++)
{
odf_reader::style_column * col = dynamic_cast<odf_reader::style_column*>( columns->style_columns_[i].get());
odf_reader::style_column *col = dynamic_cast<odf_reader::style_column*>( columns->style_columns_[i].get());
if (!col) continue;
double width = page_width * (col->style_rel_width_ ? col->style_rel_width_->get_value() / 65535. : 0);
double percent = col->style_rel_width_ ? col->style_rel_width_->get_value() : 0;
if (percent > 1000.) percent /= 100.;
double space = col->fo_end_indent_ ? col->fo_end_indent_->get_value_unit(odf_types::length::pt) : 0;
double width = page_width * percent / 100.;
double space_end = col->fo_end_indent_ ? col->fo_end_indent_->get_value_unit(odf_types::length::pt) : 0;
double space_start = col->fo_start_indent_ ? col->fo_start_indent_->get_value_unit(odf_types::length::pt) : 0;
width -= space_end;
width -= space_start;
if (i < columns->style_columns_.size() - 1)
{
col = dynamic_cast<odf_reader::style_column*>( columns->style_columns_[i + 1].get());
space += col->fo_start_indent_ ? col->fo_start_indent_->get_value_unit(odf_types::length::pt) : 0;
space_start = col->fo_start_indent_ ? col->fo_start_indent_->get_value_unit(odf_types::length::pt) : 0;
}
width_space.push_back(std::make_pair(width, space));
width_space.push_back(std::make_pair(width, space_start + space_end));
}
}
}
@ -1449,17 +1470,17 @@ odf_reader::style_text_properties_ptr docx_conversion_context::current_text_prop
for (size_t i = 0; i < state_.text_properties_stack_.size(); i++)
{
if (state_.text_properties_stack_[i])
cur->content().apply_from( state_.text_properties_stack_[i]->content() );
cur->content_.apply_from( state_.text_properties_stack_[i]->content_);
}
return cur;
}
void docx_conversion_context::set_page_break_after(bool val)
void docx_conversion_context::set_page_break_after(int val)
{
page_break_after_ = val;
}
bool docx_conversion_context::get_page_break_after()
int docx_conversion_context::get_page_break_after()
{
return page_break_after_ ;
}
@ -1471,12 +1492,12 @@ bool docx_conversion_context::get_page_break()
{
return page_break_;
}
void docx_conversion_context::set_page_break_before(bool val)
void docx_conversion_context::set_page_break_before(int val)
{
page_break_before_ = val;
}
bool docx_conversion_context::get_page_break_before()
int docx_conversion_context::get_page_break_before()
{
return page_break_before_;
}
@ -1809,7 +1830,7 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
//process_paragraph_style(Context.get_current_paragraph_style()); ??
//if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
if (outline_level)
if ((outline_level) && (*outline_level < 10))
{
output_stream() << L"<w:pPr>";
output_stream() << L"<w:outlineLvl w:val=\"" << *outline_level << L"\"/>";
@ -1821,7 +1842,7 @@ 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 (outline_level)
if ((outline_level) && (*outline_level < 10))
{
output_stream() << L"<w:outlineLvl w:val=\"" << *outline_level << L"\"/>";
}
@ -1924,15 +1945,8 @@ void docx_conversion_context::process_page_break_after(const odf_reader::style_i
_CP_OPT(odf_types::fo_break) fo_break_val = inst->content()->get_style_paragraph_properties()->content_.fo_break_after_;
if (fo_break_val)
{
if (fo_break_val->get_type() == odf_types::fo_break::Page)
{
set_page_break_after(true);
break;
}
else if (fo_break_val->get_type() == odf_types::fo_break::Auto)
{
break;
}
set_page_break_after(fo_break_val->get_type());
break;
}
}
inst = inst->parent();
@ -2224,37 +2238,37 @@ void docx_conversion_context::start_changes()
if (state.active) continue;
std::wstring change_attr;
change_attr += L" w:date=\"" + state.date + L"\"";
change_attr += L" w:author=\"" + state.author + L"\"";
change_attr += L" w:id=\"" + std::to_wstring(current_id_changes++) + L"\"";
change_attr += L" w:date=\"" + state.date + L"\"";
change_attr += L" w:author=\"" + state.author + L"\"";
change_attr += L" w:id=\"" + std::to_wstring(current_id_changes++) + L"\"";
if (state.type == 1)
if (state.type == 1)
{
text_tracked_context_.dumpRPrInsDel_ = L"<w:ins" + change_attr + L"/>";
}
if (state.type == 2)
if (state.type == 2)
{
text_tracked_context_.dumpRPrInsDel_ = L"<w:del" + change_attr + L"/>";
}
if (state.type == 3)
if (state.type == 3 && false == state.style_name.empty())
{
odf_reader::style_instance * styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Paragraph, false);
if (styleInst)
{
odf_reader::style_paragraph_properties * props = styleInst->content()->get_style_paragraph_properties();
odf_reader::style_text_properties * props_text = styleInst->content()->get_style_text_properties();
odf_reader::style_paragraph_properties * props = styleInst->content()->get_style_paragraph_properties();
odf_reader::style_text_properties * props_text = styleInst->content()->get_style_text_properties();
text_tracked_context_.dumpPPr_ += L"<w:pPrChange" + change_attr;
if (props)
{
props->docx_convert(*this);
props->docx_convert(*this);
text_tracked_context_.dumpPPr_ += get_styles_context().paragraph_attr().str();
}
text_tracked_context_.dumpPPr_ += L">";
if (props) text_tracked_context_.dumpPPr_ += get_styles_context().paragraph_nodes().str();
if (props_text)
{
@ -2269,7 +2283,7 @@ void docx_conversion_context::start_changes()
else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Text, false))
{
text_tracked_context_.dumpRPr_ = L"<w:rPrChange" + change_attr + L">";
odf_reader::style_text_properties * props = NULL;
odf_reader::style_text_properties * props = NULL;
props = styleInst->content()->get_style_text_properties();
if (props)
{
@ -2281,8 +2295,8 @@ void docx_conversion_context::start_changes()
else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Table, false))
{
text_tracked_context_.dumpTblPr_ = L"<w:TblPrChange" + change_attr + L">";
odf_reader::style_table_properties * props = styleInst->content()->get_style_table_properties();
odf_reader::style_table_cell_properties * props_cell = styleInst->content()->get_style_table_cell_properties();
odf_reader::style_table_properties * props = styleInst->content()->get_style_table_properties();
odf_reader::style_table_cell_properties * props_cell = styleInst->content()->get_style_table_cell_properties();
if (props)
{
props->docx_convert(*this);
@ -2293,7 +2307,7 @@ void docx_conversion_context::start_changes()
else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::TableCell, false))
{
text_tracked_context_.dumpTcPr_ = L"<w:TcPrChange" + change_attr + L">";
odf_reader::style_table_cell_properties * props = styleInst->content()->get_style_table_cell_properties();
odf_reader::style_table_cell_properties * props = styleInst->content()->get_style_table_cell_properties();
if (props)
{
props->docx_convert(*this);
@ -2302,6 +2316,13 @@ void docx_conversion_context::start_changes()
text_tracked_context_.dumpTcPr_ += L"</w:TcPrChange>";
}
}
else if (state.type == 3 && state.style_name.empty())
{
if (state_.in_run_)
text_tracked_context_.dumpRPr_ += L"<w:rPrChange" + change_attr + L"/>";
else
text_tracked_context_.dumpPPr_ += L"<w:pPrChange" + change_attr + L"/>";
}
}
}

View File

@ -227,7 +227,7 @@ public:
std::wstring & get_text_stream_frame()
{
if (frames_.size()>0)
if (false == frames_.empty())
return frames_.back().text_content;
else
return zero_string_;
@ -235,7 +235,7 @@ public:
bool & get_use_image_replace()
{
bool res = false;
if (!frames_.empty()) return frames_.back().use_image_replace;
if (false == frames_.empty()) return frames_.back().use_image_replace;
else
throw;
}
@ -245,11 +245,11 @@ public:
}
void clear_stream_shape()
{
shape_text_content_=L"";
shape_text_content_ = L"";
}
void clear_stream_frame()
{
if (!frames_.empty())
if (false == frames_.empty())
frames_.back().text_content.clear();
}
void stop_shape()
@ -276,7 +276,7 @@ public:
int get_current_frame_id() const
{
if (!frames_.empty()) return frames_.back().id;
if (false == frames_.empty()) return frames_.back().id;
else return 0;
}
bool in_group() { return !groups_.empty(); }
@ -287,7 +287,7 @@ public:
odf_reader::draw_frame * get_current_frame() const
{
if (!frames_.empty()) return frames_.back().ptr;
if (false == frames_.empty()) return frames_.back().ptr;
else return NULL;
}
odf_reader::draw_shape * get_current_shape() const { return current_shape_; }
@ -853,11 +853,11 @@ public:
odf_reader::style_text_properties_ptr current_text_properties();
void set_page_break_after(bool val);
bool get_page_break_after();
void set_page_break_after(int val);
int get_page_break_after();
void set_page_break_before(bool val);
bool get_page_break_before();
void set_page_break_before(int val);
int get_page_break_before();
void set_page_break (bool val);
bool get_page_break ();
@ -1044,8 +1044,8 @@ private:
bool first_element_list_item_;
bool page_break_after_;
bool page_break_before_;
int page_break_after_; // 0 = false, 1 - column, 2 -page
int page_break_before_;
bool page_break_;
bool in_automatic_style_;

View File

@ -358,12 +358,12 @@ void docx_serialize_shape_child(std::wostream & strm, _docx_drawing & val)
}
void docx_serialize_group_child(std::wostream & strm, _docx_drawing & val)
{
std::wstring name_node = L"wpg:wgp";
if (val.inGroup)name_node = L"wpg:grpSp";
std::wstring node_name = L"wpg:wgp";
if (val.inGroup)node_name = L"wpg:grpSp";
CP_XML_WRITER(strm)
{
CP_XML_NODE(name_node)
CP_XML_NODE(node_name)
{
CP_XML_NODE(L"wpg:cNvGrpSpPr")
{

View File

@ -183,13 +183,13 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
CP_XML_NODE(L"c:axPos")
{
if (content_.dimension_ == L"x")
CP_XML_ATTR(L"val",L"b");// "b" | "l" | "r" | "t"// == bottom left right top
CP_XML_ATTR(L"val", L"b");// "b" | "l" | "r" | "t"// == bottom left right top
if (content_.dimension_ == L"y")
CP_XML_ATTR(L"val",L"l");// "b" | "l" | "r" | "t"// == bottom left right top
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(std::wstring) strNumFormat, strPercentFormat, strAxisType;
_CP_OPT(bool) bLinkData;
_CP_OPT(int) nTypeFormat;
@ -197,6 +197,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
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);
odf_reader::GetProperty(content_.properties_, L"axis-type", strAxisType);
std::wstring formatCode;
if ((nTypeFormat) && (*nTypeFormat == 2) && strPercentFormat)
@ -213,7 +214,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
CP_XML_NODE(L"c:numFmt")
{
CP_XML_ATTR(L"formatCode", formatCode);
CP_XML_ATTR(L"sourceLinked", bLinkData.get_value_or(true));
CP_XML_ATTR(L"sourceLinked", bLinkData.get_value_or(strAxisType ? false : true));
}
}

View File

@ -152,7 +152,7 @@ void oox_chart_series::parse_properties()
if (false == formatCode.empty())
{
if (!data_labels_) data_labels_ = oox_data_labels();
data_labels_->set_formatCode(formatCode, bLinkData.get_value_or(true));
data_labels_->set_formatCode(formatCode, bLinkData.get_value_or(false));
}
odf_reader::GetProperty(content_.properties_, L"label-position", intVal);
if (intVal && labelPosEnabled_)

View File

@ -263,10 +263,9 @@ void math_context::start()
{
text_properties_ = odf_reader::style_text_properties_ptr(new odf_reader::style_text_properties());
text_properties_->content().style_font_name_ = L"Cambria Math";
text_properties_->content().fo_font_size_ = odf_types::length(base_font_size_, odf_types::length::pt);
text_properties_->content_.style_font_name_ = L"Cambria Math";
text_properties_->content_.fo_font_size_ = odf_types::length(base_font_size_, odf_types::length::pt);
}
std::wstring math_context::end()
{
std::wstring math = math_stream_.str();

View File

@ -83,11 +83,11 @@ std::size_t hash_value(xlsx_alignment const & val)
bool is_default(const xlsx_alignment & rVal)
{
/*const */xlsx_alignment defaultAlignment;
xlsx_alignment defaultAlignment;
return rVal == defaultAlignment;
}
xlsx_alignment OdfProperties2XlsxAlignment( xlsx_conversion_context * context,
xlsx_alignment OdfProperties2XlsxAlignment( xlsx_conversion_context * context,
const odf_reader::text_format_properties_content_ptr textProp,
const odf_reader::paragraph_format_properties * parProp,
const odf_reader::style_table_cell_properties_attlist * cellProp)

View File

@ -36,6 +36,7 @@
#include <string>
namespace cpdoccore {
namespace odf_reader {
class text_format_properties_content;
@ -44,9 +45,7 @@ namespace odf_reader {
class paragraph_format_properties;
class style_table_cell_properties_attlist;
}
}
namespace cpdoccore {
namespace oox {
class xlsx_conversion_context;
@ -70,7 +69,6 @@ struct xlsx_alignment
friend bool is_default(const xlsx_alignment & rVal);
friend std::size_t hash_value(xlsx_alignment const & val);
};
xlsx_alignment OdfProperties2XlsxAlignment( xlsx_conversion_context * context,
const odf_reader::text_format_properties_content_ptr textProp,
const odf_reader::paragraph_format_properties * parProp,

View File

@ -89,19 +89,22 @@ namespace oox {
_CP_OPT(std::wstring) text;
_CP_OPT(std::wstring) formula2;
_CP_OPT(int) rank;
_CP_OPT(bool) bottom;
//color scale icon set data_bar
std::vector<_cfvo> cfvo;
//color scale data_bar(1 element)
std::vector<std::wstring> color;
//data_bar icon_set
//data bar icon_set
_CP_OPT(bool) showValue;
//data_bar
//data bar
_CP_OPT(int) minLength;
_CP_OPT(int) maxLength;
//icon set
_CP_OPT(bool) reverse;
_CP_OPT(bool) iconset_percent;
_CP_OPT(int) iconset_type;
//date is
_CP_OPT(int) time_period;
};
struct conditionalFormatting
{
@ -144,9 +147,8 @@ public:
if (c.rules[j].stopIfTrue) CP_XML_ATTR(L"stopIfTrue", *c.rules[j].stopIfTrue);
if (c.rules[j].text) CP_XML_ATTR(L"text", *c.rules[j].text);
if (c.rules[j].rank) CP_XML_ATTR(L"rank", *c.rules[j].rank);
//CP_XML_ATTR(L"bottom" , 0);
//CP_XML_ATTR(L"equalAverage" , 0);
if (c.rules[j].bottom) CP_XML_ATTR(L"bottom", *c.rules[j].bottom);
//CP_XML_ATTR(L"equalAverage" , 0);
//CP_XML_ATTR(L"aboveAverage" , 0);
if (c.rules[j].type == 1)
{
@ -220,6 +222,23 @@ public:
}
}
}
else if (c.rules[j].type == 5)
{
CP_XML_ATTR(L"type", L"timePeriod");
switch (*c.rules[j].time_period)
{
case 0: CP_XML_ATTR(L"timePeriod", L"today"); break;
case 1: CP_XML_ATTR(L"timePeriod", L"yesterday"); break;
case 2: CP_XML_ATTR(L"timePeriod", L"tomorrow"); break;
case 3: CP_XML_ATTR(L"timePeriod", L"last7Days"); break;
case 4: CP_XML_ATTR(L"timePeriod", L"thisMonth"); break;
case 5: CP_XML_ATTR(L"timePeriod", L"lastMonth"); break;
case 6: CP_XML_ATTR(L"timePeriod", L"nextMonth"); break;
case 7: CP_XML_ATTR(L"timePeriod", L"thisWeek"); break;
case 8: CP_XML_ATTR(L"timePeriod", L"lastWeek"); break;
case 9: CP_XML_ATTR(L"timePeriod", L"nextWeek"); break;
}
}
}
}
}
@ -243,7 +262,7 @@ void xlsx_conditionalFormatting_context::serialize(std::wostream & _Wostream)
return impl_->serialize(_Wostream);
}
void xlsx_conditionalFormatting_context::add(std::wstring ref)
void xlsx_conditionalFormatting_context::start(std::wstring ref)
{
formulasconvert::odf2oox_converter converter;
impl_->conditionalFormattings_.push_back(conditionalFormatting());
@ -255,7 +274,6 @@ void xlsx_conditionalFormatting_context::add_rule(int type)
{
impl_->conditionalFormattings_.back().rules.push_back(rule());
impl_->conditionalFormattings_.back().rules.back().type = type;
}
void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
{
@ -309,11 +327,35 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"duplicateValues";
}
else if (0 <= (pos = f.find(L"begins-with")))
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"beginsWith";
std::wstring text = f.substr(pos + 12, f.length() - pos - 13);
if (0 == text.find(L"\"") && text.length() - 1 == text.rfind(L"\""))
{
text = text.substr(1, text.length() - 2);
}
impl_->conditionalFormattings_.back().rules.back().text = text;
}
else if (0 <= (pos = f.find(L"ends-with")))
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"endsWith";
std::wstring text = f.substr(pos + 10, f.length() - pos - 11);
if (0 == text.find(L"\"") && text.length() - 1 == text.rfind(L"\""))
{
text = text.substr(1, text.length() - 2);
}
impl_->conditionalFormattings_.back().rules.back().text = text;
}
else if (0 <= (pos = f.find(L"contains-text")))
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"containsText";
std::wstring text = f.substr(14, f.length() - 15);
std::wstring text = f.substr(pos + 14, f.length() - pos - 15);
if (std::wstring::npos != text.find(L"IF(") ||
std::wstring::npos != text.find(L"AND(") ||
@ -362,6 +404,21 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
impl_->conditionalFormattings_.back().rules.back().rank = boost::lexical_cast<int>(val);
}
}
else if (0 <= (pos = f.find(L"bottom")))
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"top10";
impl_->conditionalFormattings_.back().rules.back().bottom = true;
if (0 < (pos = f.find(L"percent")))
{
impl_->conditionalFormattings_.back().rules.back().percent = true;
}
if (0 <= (pos = f.find(L"(")))
{
val = f.substr(pos + 1, f.length() - pos - 2);
if (!val.empty())
impl_->conditionalFormattings_.back().rules.back().rank = boost::lexical_cast<int>(val);
}
}
else
{
impl_->conditionalFormattings_.back().rules.back().formula_type = L"cellIs";
@ -468,7 +525,9 @@ void xlsx_conditionalFormatting_context::set_showVal(bool val)
{
impl_->conditionalFormattings_.back().rules.back().showValue = val;
}
void xlsx_conditionalFormatting_context::set_time_period(int val)
{
impl_->conditionalFormattings_.back().rules.back().time_period = val;
}
}
}

View File

@ -44,7 +44,8 @@ public:
xlsx_conditionalFormatting_context();
~xlsx_conditionalFormatting_context();
void add(std::wstring ref);
void start(std::wstring ref);
void end(){}
void add_rule(int type);
@ -53,6 +54,7 @@ public:
void set_dxf (int dxf_id);
void set_showVal(bool val);
void set_time_period(int val);
void add_sfv (int type, std::wstring value);
void add_color (std::wstring col);

View File

@ -34,6 +34,7 @@
#include <boost/functional/hash/hash.hpp>
#include "xlsx_protection.h"
#include "../odf/style_table_properties.h"
#pragma once
@ -44,7 +45,7 @@ bool xlsx_protection::operator == (const xlsx_protection & rVal) const
{
const bool res =
hidden.get_value_or(false) == rVal.hidden.get_value_or(false) &&
locked.get_value_or(false) == rVal.locked.get_value_or(false);
locked.get_value_or(true) == rVal.locked.get_value_or(true);
return res;
}
@ -55,7 +56,10 @@ bool xlsx_protection::operator != (const xlsx_protection & rVal) const
void xlsx_serialize(std::wostream & _Wostream, const xlsx_protection & protection)
{
_Wostream << L"<protection ";
if (is_default(protection))
return;
_Wostream << L"<protection ";
if (protection.hidden)
_Wostream << L"hidden=\"" << protection.hidden.get() << L"\" ";
@ -64,7 +68,6 @@ void xlsx_serialize(std::wostream & _Wostream, const xlsx_protection & protectio
_Wostream << L"/>";
}
std::size_t hash_value(xlsx_protection const & val)
{
std::size_t seed = 0;
@ -72,5 +75,41 @@ std::size_t hash_value(xlsx_protection const & val)
boost::hash_combine(seed, val.locked.get_value_or(false));
return seed;
}
bool is_default(const xlsx_protection & rVal)
{
xlsx_protection defaultProtection;
return rVal == defaultProtection;
}
xlsx_protection OdfProperties2XlsxProtection(const odf_reader::style_table_cell_properties_attlist *cellProp)
{
xlsx_protection protection;
if (cellProp->style_cell_protect_)
{
switch (cellProp->style_cell_protect_->get_type())
{
case odf_types::style_cell_protect::hidden_and_protected:
case odf_types::style_cell_protect::protected_formula_hidden:
{
protection.locked = true;
protection.hidden = true;
}break;
case odf_types::style_cell_protect::protected_:
{
protection.locked = true;
}break;
case odf_types::style_cell_protect::formula_hidden:
{
protection.hidden = true;
}break;
case odf_types::style_cell_protect::none:
{
protection.locked = false;
}break;
}
}
return protection;
}
}
}

View File

@ -37,6 +37,9 @@
namespace cpdoccore {
namespace odf_reader {
class style_table_cell_properties_attlist;
}
namespace oox {
/// \struct xlsx_protection
@ -49,9 +52,11 @@ struct xlsx_protection
bool operator == (const xlsx_protection & rVal) const;
bool operator != (const xlsx_protection & rVal) const;
friend void xlsx_serialize(std::wostream & _Wostream, const xlsx_protection & font);
friend bool is_default(const xlsx_protection & rVal);
friend void xlsx_serialize(std::wostream & _Wostream, const xlsx_protection & font);
friend std::size_t hash_value(xlsx_protection const & val);
};
xlsx_protection OdfProperties2XlsxProtection(const odf_reader::style_table_cell_properties_attlist *cellProp);
}
}

View File

@ -133,18 +133,21 @@ size_t xlsx_style_manager::Impl::xfId(const odf_reader::text_format_properties_c
const size_t borderId = borders_.borderId(cellProp, default_border);
bool default_fill = false;
const size_t fillId = fills_.fillId(textProp, parProp, cellProp, default_set,default_fill);
const size_t fillId = fills_.fillId(textProp, parProp, cellProp, default_set, default_fill);
if (!default_border || !default_fill || is_visible_set/* || (fillId >2 && default_set!=default_fill)*/)
if (!default_border || !default_fill || is_visible_set/* || (fillId > 2 && default_set != default_fill)*/)
is_visible = true;
xlsx_alignment alignment = OdfProperties2XlsxAlignment(context, textProp, parProp, cellProp);
const unsigned int id = next_index_;//static_cast<unsigned int>(cellXfs_.size());
xlsx_protection protection = OdfProperties2XlsxProtection( cellProp);
const unsigned int id = next_index_;//static_cast<unsigned int>(cellXfs_.size());
xlsx_xf xfRecord;
const bool dbgApplyAlignment = !is_default(alignment);
xfRecord.applyAlignment = dbgApplyAlignment;
xfRecord.applyAlignment = !is_default(alignment);
xfRecord.alignment = alignment;
xfRecord.applyBorder = true;
xfRecord.borderId = borderId;
@ -154,7 +157,8 @@ size_t xlsx_style_manager::Impl::xfId(const odf_reader::text_format_properties_c
xfRecord.applyFont = true;
xfRecord.fontId = fontId;
xfRecord.applyProtection = false; // TODO
xfRecord.applyProtection = !is_default(protection);
xfRecord.protection = protection;
if (false == num_format.empty())
{
@ -170,7 +174,6 @@ size_t xlsx_style_manager::Impl::xfId(const odf_reader::text_format_properties_c
}
xfRecord.xfId = 0;
xfRecord.alignment = alignment;
xlsx_xf_array::const_iterator i = cellXfs_.find(xfRecord);
if (i != cellXfs_.end())

View File

@ -137,8 +137,7 @@ xlsx_table_state::xlsx_table_state(xlsx_conversion_context * Context, std::wstri
in_cell(false),
bEndTable(false),
bRTL(false),
bHidden(false),
bProtected(false)
bHidden(false)
{
odf_reader::style_table_properties * table_prop = NULL;
odf_reader::style_instance * tableStyle = context_->root()->odf_context().styleContainer().style_by_name(table_style_, odf_types::style_family::Table, false);
@ -176,13 +175,13 @@ void xlsx_table_state::set_rtl(bool val)
void xlsx_table_state::set_protection(bool val, const std::wstring &key, const std::wstring &algorithm)
{
bProtected = val;
protect_key = key;
protection.bEnabled = val;
protection.protect_key = key;
size_t pos = algorithm.find(L"#");
if (pos != std::wstring::npos)
{
protect_key_algorithm = algorithm.substr(pos + 1);
protection.protect_key_algorithm = algorithm.substr(pos + 1);
}
//test
@ -193,7 +192,30 @@ void xlsx_table_state::set_protection(bool val, const std::wstring &key, const s
//bool res = protect.Verify();
}
void xlsx_table_state::set_protection_select_protected_cells(bool val)
{
protection.selectLockedCells = !val;
}
void xlsx_table_state::set_protection_select_unprotected_cells(bool val)
{
protection.selectUnockedCells = !val;
}
void xlsx_table_state::set_protection_insert_columns(bool val)
{
protection.insertColumns = !val;
}
void xlsx_table_state::set_protection_insert_rows(bool val)
{
protection.insertRows = !val;
}
void xlsx_table_state::set_protection_delete_columns(bool val)
{
protection.deleteColumns = !val;
}
void xlsx_table_state::set_protection_delete_rows(bool val)
{
protection.deleteRows = !val;
}
unsigned int xlsx_table_state::columns_count() const
{
return columns_count_;
@ -487,16 +509,34 @@ void xlsx_table_state::serialize_background (std::wostream & strm)
}
void xlsx_table_state::serialize_protection (std::wostream & strm)
{
if (!bProtected) return;
if (!protection.bEnabled) return;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"sheetProtection")
{
CP_XML_ATTR(L"sheet", 1);
CP_XML_ATTR(L"objects", 1);
CP_XML_ATTR(L"scenarios", 1);
//convert protection odf->ooxml impossible without password !!!
//CP_XML_ATTR(L"algorithmName", );
//CP_XML_ATTR(L"hashValue", );
//CP_XML_ATTR(L"saltValue", );
//CP_XML_ATTR(L"spinCount", );
CP_XML_ATTR(L"sheet", 1);
CP_XML_ATTR(L"objects", 0);
CP_XML_ATTR(L"scenarios", 0);
CP_XML_ATTR(L"formatCells", 1);
CP_XML_ATTR(L"formatColumns", 1);
CP_XML_ATTR(L"formatRows", 1);
CP_XML_ATTR(L"insertColumns", protection.insertColumns);
CP_XML_ATTR(L"insertRows", protection.insertRows);
CP_XML_ATTR(L"insertHyperlinks", 1);
CP_XML_ATTR(L"deleteColumns", protection.deleteColumns);
CP_XML_ATTR(L"deleteRows", protection.deleteRows);
CP_XML_ATTR(L"selectLockedCells", protection.selectLockedCells);
CP_XML_ATTR(L"sort", 1);
CP_XML_ATTR(L"autoFilter", 1);
CP_XML_ATTR(L"pivotTables", 1);
CP_XML_ATTR(L"selectUnlockedCells", protection.selectUnockedCells);
}
}
}

View File

@ -128,6 +128,13 @@ public:
void set_rtl(bool val);
void set_protection(bool val, const std::wstring &key, const std::wstring &algorithm);
void set_protection_select_protected_cells(bool val);
void set_protection_select_unprotected_cells(bool val);
void set_protection_insert_columns(bool val);
void set_protection_insert_rows(bool val);
void set_protection_delete_columns(bool val);
void set_protection_delete_rows(bool val);
void start_column (unsigned int repeated, const std::wstring & defaultCellStyleName);
void start_row (const std::wstring & StyleName, const std::wstring & defaultCellStyleName);
@ -212,9 +219,18 @@ public:
private:
xlsx_conversion_context * context_;
bool bProtected;
std::wstring protect_key;
std::wstring protect_key_algorithm;
struct _protection
{
bool bEnabled = false;
std::wstring protect_key;
std::wstring protect_key_algorithm;
bool insertColumns = true;
bool insertRows = true;
bool deleteColumns = true;
bool deleteRows = true;
bool selectLockedCells = false;
bool selectUnockedCells = false;
} protection;
bool bRTL;
bool bEndTable;
bool bHidden;

View File

@ -139,6 +139,13 @@ void xlsx_conversion_context::end_document()
{
std::wstringstream workbook_content;
if (sheets_.empty())
{ // owncloud new document ... oO
start_table(L"Sheet1", L"");
current_sheet().cols() << L"<col min=\"1\" max=\"1024\" width=\"11.6\" customWidth=\"0\"/>";
end_table();
}
for (size_t i = 0; i < sheets_.size(); i++)
{
xlsx_xml_worksheet_ptr& sheet = sheets_[i];
@ -234,6 +241,13 @@ void xlsx_conversion_context::end_document()
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/spreadsheetml/2006/main");
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
if (table_structure_protected_)
{
CP_XML_NODE(L"workbookProtection")
{
CP_XML_ATTR(L"lockStructure", 1);
}
}
serialize_bookViews (CP_XML_STREAM());
CP_XML_NODE(L"sheets")
@ -602,7 +616,10 @@ void xlsx_conversion_context::start_office_spreadsheet(const odf_reader::office_
{
spreadsheet_ = elm;
}
void xlsx_conversion_context::set_table_structure_protected(bool val)
{
table_structure_protected_ = val;
}
const odf_reader::office_element * xlsx_conversion_context::get_spreadsheet()
{
return spreadsheet_;
@ -665,7 +682,27 @@ int xlsx_conversion_context::get_current_cell_style_id()
{
return get_table_context().get_current_cell_style_id();
}
int xlsx_conversion_context::get_dxfId_style(const std::wstring &style_name)
{
if (style_name.empty()) return -1;
int dxfId = -1;
odf_reader::style_instance * instStyle =
root()->odf_context().styleContainer().style_by_name(style_name, odf_types::style_family::TableCell, false);
if (!instStyle)
instStyle = root()->odf_context().styleContainer().style_by_display_name(style_name, odf_types::style_family::TableCell, false);
if (instStyle)
{
odf_reader::text_format_properties_content_ptr textFormats = calc_text_properties_content(instStyle);
odf_reader::graphic_format_properties graphicFormats = calc_graphic_properties_content(instStyle);
odf_reader::style_table_cell_properties_attlist cellFormats = calc_table_cell_properties(instStyle);
dxfId = get_style_manager().dxfId(textFormats, &graphicFormats, &cellFormats);
}
return dxfId;
}
std::pair<double, double> xlsx_conversion_context::getMaxDigitSize()
{
if (maxDigitSize_.first <= 0.1)
@ -732,7 +769,10 @@ xlsx_drawing_context & xlsx_conversion_context::get_drawing_context()
{
return get_table_context().get_drawing_context();
}
xlsx_conditionalFormatting_context & xlsx_conversion_context::get_conditionalFormatting_context()
{
return get_table_context().state()->get_conditionalFormatting_context();
}
xlsx_drawing_context_handle_ptr & xlsx_conversion_context::get_drawing_context_handle()
{
return drawing_context_handle_;
@ -784,39 +824,6 @@ void xlsx_conversion_context::add_pivot_sheet_source (const std::wstring & sheet
{//ващето в либре жесткая привязка что на одном листе тока одна сводная может быть ..
mapPivotsTableView_.insert(std::make_pair(sheet_name, index_table_view));
}
void xlsx_conversion_context::start_conditional_format(std::wstring ref)
{
get_table_context().state()->get_conditionalFormatting_context().add(ref);
}
void xlsx_conversion_context::start_conditional_format_rule(int type)
{
get_table_context().state()->get_conditionalFormatting_context().add_rule(type);
}
void xlsx_conversion_context::set_conditional_format_formula (std::wstring f)
{
get_table_context().state()->get_conditionalFormatting_context().set_formula(f);
}
void xlsx_conversion_context::set_conditional_format_dxf (int dxfId)
{
get_table_context().state()->get_conditionalFormatting_context().set_dxf(dxfId);
}
void xlsx_conversion_context::add_conditional_format_entry (int type, std::wstring value)
{
get_table_context().state()->get_conditionalFormatting_context().add_sfv(type, value);
}
void xlsx_conversion_context::set_conditional_format_showval (bool val)
{
get_table_context().state()->get_conditionalFormatting_context().set_showVal(val);
}
void xlsx_conversion_context::add_conditional_format_color (std::wstring col)
{
get_table_context().state()->get_conditionalFormatting_context().add_color(col);
}
void xlsx_conversion_context::set_conditional_format_dataBar (_CP_OPT(int) min, _CP_OPT(int) max)
{
get_table_context().state()->get_conditionalFormatting_context().set_dataBar(min, max);
}
void xlsx_conversion_context::add_jsaProject(const std::string &content)
{
if (content.empty()) return;

View File

@ -83,6 +83,8 @@ public:
void start_document ();
void end_document ();
void set_table_structure_protected(bool val);
void start_chart(std::wstring name);
void end_chart ();
@ -115,9 +117,6 @@ public:
void start_table_cell (const std::wstring & formula, size_t columnsSpanned, size_t rowsSpanned);
void end_table_cell ();
void set_current_cell_style_id (unsigned int xfId);
int get_current_cell_style_id ();
void start_table_covered_cell ();
void end_table_covered_cell ();
@ -129,24 +128,16 @@ public:
void start_hyperlink (const std::wstring & styleName);
void end_hyperlink (std::wstring const & href);
void set_current_cell_style_id (unsigned int xfId);
int get_current_cell_style_id ();
size_t get_default_cell_style() const { return default_style_; }
int get_dxfId_style(const std::wstring &style_name);
//------------------------------------------------------------------------------------
void add_pivot_sheet_source (const std::wstring & sheet_name, int index_table_view);
void start_conditional_format (std::wstring ref);
void end_conditional_format (){}
void start_conditional_format_rule (int type);
void end_conditional_format_rule () {}
void set_conditional_format_formula (std::wstring f);
void set_conditional_format_dxf (int dxfId);
void set_conditional_format_showval (bool val);
void add_conditional_format_color (std::wstring col);
void add_conditional_format_entry (int type, std::wstring value);
void set_conditional_format_dataBar (_CP_OPT(int) min, _CP_OPT(int) max);
void add_jsaProject (const std::string &content);
void add_control_props(const std::wstring & rid, const std::wstring & target, const std::wstring & props);
@ -155,7 +146,6 @@ public:
void add_table_part(const std::wstring & table) {table_parts_.push_back(table);}
size_t get_table_parts_size() {return table_parts_.size();}
//------------------------------------------------------------------------------------
odf_reader::odf_document * root()
@ -172,26 +162,25 @@ public:
const xlsx_table_context & get_table_context() const { return xlsx_table_context_; }
xlsx_style_manager & get_style_manager() { return xlsx_style_; }
forms_context & get_forms_context() { return forms_context_; }
oox_chart_context & current_chart();
math_context & get_math_context() { return math_context_; }
num_format_context & get_num_format_context() { return num_format_context_; }
size_t get_default_cell_style() const { return default_style_; }
xlsx_defined_names & get_xlsx_defined_names() { return xlsx_defined_names_; }
xlsx_pivots_context & get_pivots_context() { return xlsx_pivots_context_;}
xlsx_table_metrics & get_table_metrics();
xlsx_drawing_context & get_drawing_context();
xlsx_comments_context & get_comments_context();
xlsx_comments_context_handle & get_comments_context_handle();
xlsx_dataValidations_context& get_dataValidations_context() { return xlsx_dataValidations_context_;}
xlsx_conditionalFormatting_context & get_conditionalFormatting_context();
xlsx_drawing_context_handle_ptr & get_drawing_context_handle();
xlsx_dataValidations_context & get_dataValidations_context() { return xlsx_dataValidations_context_;}
xlsx_drawing_context_handle_ptr & get_drawing_context_handle();
void set_drawing_context_handle(xlsx_drawing_context_handle_ptr &handle);
mediaitems_ptr & get_mediaitems() { return mediaitems_; }
void set_mediaitems(mediaitems_ptr &items);
void set_mediaitems(mediaitems_ptr &items);
//---------------------------------------
static std::unordered_map<std::wstring, int> mapExternalLink_;
std::map<std::wstring, int> mapUsedNames_;
private:
@ -202,12 +191,14 @@ private:
const odf_reader::office_element *spreadsheet_;
odf_reader::odf_document *odf_document_;
bool table_structure_protected_ = false;
std::vector<xlsx_xml_worksheet_ptr> sheets_;
std::vector<oox_chart_context_ptr> charts_;
std::vector<std::wstring> table_parts_;
std::wstringstream defaultOutput_;
std::pair<double, double> maxDigitSize_;
std::pair<double, double> maxDigitSize_;
num_format_context num_format_context_;
size_t default_style_;
mediaitems_ptr mediaitems_;

View File

@ -113,13 +113,13 @@ void calcext_conditional_format::xlsx_convert(oox::xlsx_conversion_context & Con
{
if (!calcext_target_range_address_) return;
Context.start_conditional_format(*calcext_target_range_address_);
Context.get_conditionalFormatting_context().start(*calcext_target_range_address_);
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
Context.end_conditional_format();
Context.get_conditionalFormatting_context().end();
}
// calcext_data_bar
@ -130,7 +130,7 @@ const wchar_t * calcext_data_bar::name = L"data-bar";
void calcext_data_bar::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"calcext:show-value", calcext_show_value_);
calcext_data_bar_attr_.add_attributes(Attributes);
attr_.add_attributes(Attributes);
}
void calcext_data_bar::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
@ -139,20 +139,19 @@ void calcext_data_bar::add_child_element( xml::sax * Reader, const std::wstring
}
void calcext_data_bar::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.start_conditional_format_rule(2);
Context.get_conditionalFormatting_context().add_rule(2);
if (calcext_show_value_)
Context.set_conditional_format_showval(*calcext_show_value_);
Context.get_conditionalFormatting_context().set_showVal(*calcext_show_value_);
if (calcext_data_bar_attr_.calcext_positive_color_)
Context.add_conditional_format_color(L"ff" + calcext_data_bar_attr_.calcext_positive_color_->get_hex_value());
if (attr_.calcext_positive_color_)
Context.get_conditionalFormatting_context().add_color(L"ff" + attr_.calcext_positive_color_->get_hex_value());
Context.set_conditional_format_dataBar(calcext_data_bar_attr_.calcext_min_length_, calcext_data_bar_attr_.calcext_max_length_);
Context.get_conditionalFormatting_context().set_dataBar(attr_.calcext_min_length_, attr_.calcext_max_length_);
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
Context.end_conditional_format_rule();
}
// calcext_color_scale
//////////////////////////////////////////////////////////////////////////////////////////////////
@ -168,12 +167,11 @@ void calcext_color_scale::add_child_element( xml::sax * Reader, const std::wstri
}
void calcext_color_scale::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.start_conditional_format_rule(3);
Context.get_conditionalFormatting_context().add_rule(3);
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
Context.end_conditional_format_rule();
}
// calcext_icon_set
//////////////////////////////////////////////////////////////////////////////////////////////////
@ -183,7 +181,7 @@ const wchar_t * calcext_icon_set::name = L"icon-set";
void calcext_icon_set::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"calcext:show-value", calcext_show_value_);
calcext_icon_set_attr_.add_attributes(Attributes);
attr_.add_attributes(Attributes);
}
void calcext_icon_set::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
@ -191,15 +189,15 @@ void calcext_icon_set::add_child_element( xml::sax * Reader, const std::wstring
}
void calcext_icon_set::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.start_conditional_format_rule(4);
Context.get_conditionalFormatting_context().add_rule(4);
if (calcext_show_value_)
Context.set_conditional_format_showval(*calcext_show_value_);
Context.get_conditionalFormatting_context().set_showVal(*calcext_show_value_);
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
Context.end_conditional_format_rule();
}
// calcext_formatting_entry
@ -219,7 +217,7 @@ void calcext_formatting_entry::add_child_element( xml::sax * Reader, const std::
void calcext_formatting_entry::xlsx_convert(oox::xlsx_conversion_context & Context)
{
calcext_type::type type_ = calcext_type_.get_value_or(calcext_type::Number).get_type();
Context.add_conditional_format_entry((int)type_, calcext_value_.get_value_or(L""));
Context.get_conditionalFormatting_context().add_sfv((int)type_, calcext_value_.get_value_or(L""));
}
// calcext_color_scale_entry
@ -240,12 +238,12 @@ void calcext_color_scale_entry::add_child_element( xml::sax * Reader, const std:
void calcext_color_scale_entry::xlsx_convert(oox::xlsx_conversion_context & Context)
{
if (calcext_color_)
Context.add_conditional_format_color(L"ff" + calcext_color_->get_hex_value());
Context.get_conditionalFormatting_context().add_color(L"ff" + calcext_color_->get_hex_value());
else
Context.add_conditional_format_color(L"ffffffff");
Context.get_conditionalFormatting_context().add_color(L"ffffffff");
calcext_type::type type_ = calcext_type_.get_value_or(calcext_type::Number).get_type();
Context.add_conditional_format_entry((int)type_, calcext_value_.get_value_or(L""));
Context.get_conditionalFormatting_context().add_sfv((int)type_, calcext_value_.get_value_or(L""));
}
// calcext_condition
//////////////////////////////////////////////////////////////////////////////////////////////////
@ -254,7 +252,7 @@ const wchar_t * calcext_condition::name = L"condition";
void calcext_condition::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
calcext_condition_attr_.add_attributes(Attributes);
attr_.add_attributes(Attributes);
}
void calcext_condition::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
@ -262,28 +260,18 @@ void calcext_condition::add_child_element( xml::sax * Reader, const std::wstring
}
void calcext_condition::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.start_conditional_format_rule(1);
Context.get_conditionalFormatting_context().add_rule(1);
if (calcext_condition_attr_.calcext_value_)
if (attr_.calcext_value_)
{
Context.set_conditional_format_formula(*calcext_condition_attr_.calcext_value_);
Context.get_conditionalFormatting_context().set_formula(*attr_.calcext_value_);
}
std::wstring style_name = calcext_condition_attr_.calcext_apply_style_name_.get_value_or(L"");
std::wstring style_name = attr_.calcext_apply_style_name_.get_value_or(L"");
style_instance * instStyle =
Context.root()->odf_context().styleContainer().style_by_name(style_name, style_family::TableCell, false);
if (!instStyle)
instStyle = Context.root()->odf_context().styleContainer().style_by_display_name(style_name, style_family::TableCell, false);
if (instStyle)
{
text_format_properties_content_ptr textFormats = calc_text_properties_content (instStyle);
graphic_format_properties graphicFormats = calc_graphic_properties_content (instStyle);
style_table_cell_properties_attlist cellFormats = calc_table_cell_properties (instStyle);
int dxfId = Context.get_style_manager().dxfId(textFormats, &graphicFormats, &cellFormats);
Context.set_conditional_format_dxf(dxfId);
}
Context.end_conditional_format_rule();
int dxfId = Context.get_dxfId_style(style_name);
if (dxfId >= 0)
Context.get_conditionalFormatting_context().set_dxf(dxfId);
}
// calcext_condition
//////////////////////////////////////////////////////////////////////////////////////////////////
@ -292,7 +280,7 @@ const wchar_t * calcext_date_is::name = L"date-is";
void calcext_date_is::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
calcext_date_is_attr_.add_attributes(Attributes);
attr_.add_attributes(Attributes);
}
void calcext_date_is::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
@ -300,8 +288,16 @@ void calcext_date_is::add_child_element( xml::sax * Reader, const std::wstring &
}
void calcext_date_is::xlsx_convert(oox::xlsx_conversion_context & Context)
{
//Context.start_conditional_format_rule(5);
//Context.end_conditional_format_rule();
Context.get_conditionalFormatting_context().add_rule(5);
Context.get_conditionalFormatting_context().set_time_period(attr_.calcext_date_.get_value_or(odf_types::time_period::today).get_type());
std::wstring style_name = attr_.calcext_style_.get_value_or(L"");
int dxfId = Context.get_dxfId_style(style_name);
if (dxfId >= 0)
Context.get_conditionalFormatting_context().set_dxf(dxfId);
}
}

View File

@ -44,6 +44,7 @@
#include "datatypes/iconset_type.h"
#include "datatypes/calcext_type.h"
#include "datatypes/timeperiod.h"
namespace cpdoccore {
namespace odf_reader {
@ -87,7 +88,7 @@ public:
void add_attributes( const xml::attributes_wc_ptr & Attributes );
_CP_OPT(std::wstring) calcext_style_;
_CP_OPT(std::wstring) calcext_date_;
_CP_OPT(odf_types::time_period) calcext_date_;
};
//////////////////////////////////////////////////////////////////////////////////////////////////
@ -151,7 +152,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
_CP_OPT(bool) calcext_show_value_;
calcext_icon_set_attr calcext_icon_set_attr_;
calcext_icon_set_attr attr_;
office_element_ptr_array content_;
};
@ -173,7 +174,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
_CP_OPT(bool) calcext_show_value_;
calcext_data_bar_attr calcext_data_bar_attr_;
calcext_data_bar_attr attr_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(calcext_data_bar)
@ -212,7 +213,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
calcext_date_is_attr calcext_date_is_attr_;
calcext_date_is_attr attr_;
};
CP_REGISTER_OFFICE_ELEMENT2(calcext_date_is)
@ -231,7 +232,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
calcext_condition_attr calcext_condition_attr_;
calcext_condition_attr attr_;
};
CP_REGISTER_OFFICE_ELEMENT2(calcext_condition)

View File

@ -48,7 +48,7 @@ text_format_properties_content_ptr calc_text_properties_content(const std::vecto
for (size_t i = 0; i < textProps.size(); i++)
{
if (textProps[i])
result->apply_from(textProps[i]->content());
result->apply_from(textProps[i]->content_);
}
return result;
}

View File

@ -106,15 +106,23 @@ void object_odf_context::set_style_name(std::wstring const & val)
{
style_name_ = val;
}
void object_odf_context::start_axis(std::wstring const & dimensionName, std::wstring const & name, std::wstring const & styleName)
void object_odf_context::start_axis(std::wstring const & dimension, std::wstring const & name, std::wstring const & styleName)
{
in_axis_ = true;
axis ax;
ax.dimension_ = dimensionName;
ax.dimension_ = dimension;
ax.chart_name_ = name;
ax.style_name_ = styleName;
if (ax.dimension_.empty())
{
if (std::wstring::npos != ax.chart_name_.find(L"primary-"))
{
ax.dimension_ = ax.chart_name_.substr(8);
}
}
axises_.push_back(ax);
}
@ -451,7 +459,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
}
std::wstring formatCode = L"General";
_CP_OPT(std::wstring) strNumFormat, strPercentFormat;
_CP_OPT(std::wstring) strNumFormat, strPercentFormat, strAxisType;
_CP_OPT(int) nTypeFormat;
_CP_OPT(bool) bLinkData;
@ -459,6 +467,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
odf_reader::GetProperty(series_[i].properties_, L"percentage_num_format", strPercentFormat);
odf_reader::GetProperty(series_[i].properties_, L"link-data-style-to-source", bLinkData);
odf_reader::GetProperty(series_[i].properties_, L"data-label-number", nTypeFormat);
odf_reader::GetProperty(series_[i].properties_, L"axis-type", strAxisType);
if ((nTypeFormat) && (*nTypeFormat == 2) && strPercentFormat)
{
@ -480,11 +489,11 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
if (last_set_class == chart_class::bubble)
{ //bubble(x)
if (!bPivotChart_)
current->set_formula_series(4, domain_cell_range_adress_, formatCode, bLinkData.get_value_or(true));
current->set_formula_series(4, domain_cell_range_adress_, formatCode, bLinkData.get_value_or(strAxisType ? false : true));
current->set_values_series (4, domain_cash);
//y
if (!bPivotChart_)
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, bLinkData.get_value_or(true));
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, bLinkData.get_value_or(strAxisType ? false : true));
current->set_values_series (3, cell_cash);
}
else
@ -492,14 +501,14 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
if (false == domain_cash.empty() || false == cash_values.empty())
{
if (!bPivotChart_)
current->set_formula_series(2, domain_cell_range_adress_, formatCode, bLinkData.get_value_or(true));
current->set_formula_series(2, domain_cell_range_adress_, formatCode, bLinkData.get_value_or(strAxisType ? false : true));
current->set_values_series (2, domain_cash);
}
//y
if (false == cell_cash.empty() || false == cash_values.empty())
{
if (!bPivotChart_)
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, bLinkData.get_value_or(true));
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, bLinkData.get_value_or(strAxisType ? false : true));
current->set_values_series (3, cell_cash);
}
}
@ -507,7 +516,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
else
{ //common
if (!bPivotChart_)
current->set_formula_series(1, series_[i].cell_range_address_, formatCode, bLinkData.get_value_or(true));
current->set_formula_series(1, series_[i].cell_range_address_, formatCode, bLinkData.get_value_or(strAxisType ? false : true));
current->set_values_series(1, cell_cash);
}

View File

@ -39,7 +39,7 @@
namespace cpdoccore {
namespace odf_reader {
class document_context;
bool create_element_and_read(xml::sax * Reader,
const std::wstring & Ns,
@ -50,7 +50,8 @@ bool create_element_and_read(xml::sax * Reader,
{
if (office_element_ptr elm = office_element_creator::get()->create(Ns, Name, Context, isRoot))
{
elm->read_sax( Reader );
elm->afterCreate();
elm->read_sax( Reader );
elm->afterReadContent();
if (_Element) // элемент читается повторно
@ -63,7 +64,7 @@ bool create_element_and_read(xml::sax * Reader,
}
else
{
_CP_LOG << L"[error] : create element failed (" << Ns << L":" << Name << L")\n";
_CP_LOG << L"[error] : create element failed (" << Ns << L":" << Name << L")\n";
not_applicable_element(L"[!!!]", Reader, Ns, Name);
}
@ -85,8 +86,37 @@ bool create_element_and_read(xml::sax * Reader,
}
return false;
}
//----------------------------------------------------------------------------------------------------
void office_element::afterCreate()
{
if (!context_) return;
ElementType type_ = this->get_type();
context_->levels.push_back(this);
}
void office_element::afterReadContent()
{
if (!context_) return;
ElementType type_ = this->get_type();
std::wstring style = element_style_name.get_value_or(L"");
if ((type_ == typeTextH || type_ == typeTextP) && element_style_name)
{
if ((context_->last_paragraph) && (!context_->last_paragraph->next_element_style_name))
{
context_->last_paragraph->next_element_style_name = element_style_name;
}
context_->last_paragraph = this;
}
if (false == context_->levels.empty())
context_->levels.pop_back();
}
}
}

View File

@ -400,15 +400,25 @@ void common_xlink_attlist::serialize(CP_ATTR_NODE)
}
//////////////////////////////////////////////////////////////////////////////////////////////////
bool common_value_and_type_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
bool common_value_and_type_attlist::add_attributes(const xml::attributes_wc_ptr & Attributes)
{
CP_APPLY_ATTR(L"office:value-type" , office_value_type_);
CP_APPLY_ATTR(L"office:value" , office_value_);
CP_APPLY_ATTR(L"office:currency" , office_currency_);
CP_APPLY_ATTR(L"office:date-value" , office_date_value_);
CP_APPLY_ATTR(L"office:time-value" , office_time_value_);
CP_APPLY_ATTR(L"office:boolean-value", office_boolean_value_);
CP_APPLY_ATTR(L"office:string-value", office_string_value_);
CP_APPLY_ATTR(L"office:value-type", office_value_type_);
CP_APPLY_ATTR(L"office:value", office_value_);
CP_APPLY_ATTR(L"office:currency", office_currency_);
CP_APPLY_ATTR(L"office:date-value", office_date_value_);
CP_APPLY_ATTR(L"office:time-value", office_time_value_);
CP_APPLY_ATTR(L"office:boolean-value", office_boolean_value_);
CP_APPLY_ATTR(L"office:string-value", office_string_value_);
if (!office_value_)
{
CP_APPLY_ATTR(L"table:value", office_value_); //openoffice xml 1.0
}
if (!office_value_type_)
{
CP_APPLY_ATTR(L"table:value-type", office_value_type_); //openoffice xml 1.0
}
if (office_value_type_ || office_value_ || office_currency_ || office_date_value_ || office_time_value_
|| office_boolean_value_ || office_string_value_) return true;

View File

@ -0,0 +1,86 @@
/*
* (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 <boost/algorithm/string.hpp>
#include "stylecellprotect.h"
#include <ostream>
namespace cpdoccore { namespace odf_types {
std::wostream & operator << (std::wostream & _Wostream, const style_cell_protect & _Val)
{
switch (_Val.get_type())
{
case style_cell_protect::none:
_Wostream << L"none";
break;
case style_cell_protect::formula_hidden:
_Wostream << L"formula-hidden";
break;
case style_cell_protect::hidden_and_protected:
_Wostream << L"hidden-and-protected";
break;
case style_cell_protect::protected_:
_Wostream << L"protected";
break;
case style_cell_protect::protected_formula_hidden:
_Wostream << L"protected formula-hidden";
break;
default:
break;
}
return _Wostream;
}
style_cell_protect style_cell_protect::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
boost::algorithm::to_lower(tmp);
if (tmp == L"formula_hidden")
return style_cell_protect(formula_hidden);
else if (tmp == L"hidden-and-protected")
return style_cell_protect(hidden_and_protected);
else if (tmp == L"protected")
return style_cell_protect(protected_);
else if (tmp == L"protected formula-hidden" ||
tmp == L"formula-hidden protected")
return style_cell_protect(protected_formula_hidden);
else
{
return style_cell_protect(none);
}
}
} }

View File

@ -1,55 +1,75 @@
/*
* (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
*
*/
#pragma once
#include "../Reader/Records.h"
class CRecordRoundTripColorMappingAtom : public CUnknownRecord
{
public:
std::pair<boost::shared_array<unsigned char>, _INT32> data;
CRecordRoundTripColorMappingAtom()
{
}
~CRecordRoundTripColorMappingAtom()
{
}
virtual void ReadFromStream(SRecordHeader & oHeader, POLE::Stream* pStream)
{
m_oHeader = oHeader;
data = std::make_pair(boost::shared_array<unsigned char>(new unsigned char[m_oHeader.RecLen]), m_oHeader.RecLen);
pStream->read(data.first.get(), data.second);
}
};
/*
* (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
*
*/
#pragma once
#include <iosfwd>
#include <string>
#include "odfattributes.h"
namespace cpdoccore { namespace odf_types {
class style_cell_protect
{
public:
enum type
{
none,
formula_hidden,
hidden_and_protected,
protected_,
protected_formula_hidden
};
style_cell_protect() {}
style_cell_protect(type _Type) : type_(_Type)
{}
type get_type() const
{
return type_;
};
static style_cell_protect parse(const std::wstring & Str);
private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const style_cell_protect & _Val);
}
APPLY_PARSE_XML_ATTRIBUTES(odf_types::style_cell_protect);
}

View File

@ -126,7 +126,7 @@ style_family style_family::parse(const std::wstring & Str)
return style_family( Default );
else if (tmp == L"drawing-page")
return style_family( DrawingPage );
else if (tmp == L"graphic")
else if (tmp == L"graphic" || tmp == L"graphics")
return style_family( Graphic );
else if (tmp == L"presentation")
return style_family( Presentation );

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 "timeperiod.h"
#include <boost/algorithm/string.hpp>
#include <ostream>
namespace cpdoccore { namespace odf_types {
std::wostream & operator << (std::wostream & _Wostream, const time_period & _Val)
{
switch(_Val.get_type())
{
case time_period::yesterday: _Wostream << L"yesterday"; break;
case time_period::tomorrow: _Wostream << L"tomorrow"; break;
case time_period::last7Days: _Wostream << L"last-7-days"; break;
case time_period::thisMonth: _Wostream << L"this-month"; break;
case time_period::lastMonth: _Wostream << L"last-month"; break;
case time_period::nextMonth: _Wostream << L"next-month"; break;
case time_period::thisWeek: _Wostream << L"this-week"; break;
case time_period::lastWeek: _Wostream << L"last-week"; break;
case time_period::nextWeek: _Wostream << L"next-week"; break;
case time_period::today: _Wostream << L"today"; break;
default:
_Wostream << L"today"; break;
}
return _Wostream;
}
time_period time_period::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
boost::algorithm::to_lower(tmp);
if (tmp == L"today")
return time_period(today);
else if (tmp == L"yesterday")
return time_period(yesterday);
else if (tmp == L"tomorrow")
return time_period(tomorrow);
else if (tmp == L"last-7-days")
return time_period(last7Days);
else if (tmp == L"this-month")
return time_period(thisMonth);
else if (tmp == L"last-month")
return time_period(lastMonth);
else if (tmp == L"next-month")
return time_period(nextMonth);
else if (tmp == L"this-week")
return time_period(thisWeek);
else if (tmp == L"last-week")
return time_period(lastWeek);
else if (tmp == L"next-week")
return time_period(nextWeek);
else
{
return time_period(today);
}
}
} }

View File

@ -0,0 +1,83 @@
/*
* (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
*
*/
#pragma once
#include <iosfwd>
#include <string>
#include "odfattributes.h"
namespace cpdoccore { namespace odf_types {
class time_period
{
public:
enum type
{
today = 0,
yesterday = 1,
tomorrow = 2,
last7Days = 3,
thisMonth = 4,
lastMonth = 5,
nextMonth = 6,
thisWeek = 7,
lastWeek = 8,
nextWeek = 9
};
time_period() {}
time_period(type _Type) : type_(_Type)
{}
type get_type() const
{
return type_;
};
static time_period parse(const std::wstring & Str);
private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const time_period & _Val);
}
APPLY_PARSE_XML_ATTRIBUTES(odf_types::time_period);
}

View File

@ -29,53 +29,40 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include <stdio.h>
#include "documentcontext.h"
#include "office_elements.h"
namespace cpdoccore {
namespace odf_reader {
class document_context::Impl
{
public:
Impl() : last_element_(NULL) {}
public:
void set_last_element(office_element* elem)
{
last_element_ = elem;
}
office_element* get_last_element()
{
return last_element_;
}
private:
office_element * last_element_;
};
//////////////////////////////////////////////////////////////////////////////////////////////////
document_context::document_context() : impl_( new document_context::Impl() )
document_context::document_context() : last_paragraph(NULL)
{
level = 0;
}
document_context::~document_context()
{
delete impl_;
}
void document_context::set_last_element(office_element* elem)
{
return impl_->set_last_element(elem);
levels.clear();
last_paragraph = NULL;
}
office_element* document_context::get_last_element()
{
return impl_->get_last_element();
if (levels.size() > 1)
return levels[levels.size() - 2];
else
return NULL;
}
office_element* document_context::get_last_paragraph()
{
for (int i = levels.size() - 2; i >= 0; i--)
{
if (levels[i]->get_type() == typeTextH || levels[i]->get_type() == typeTextP)
{
return levels[i];
}
}
return last_paragraph;
}

View File

@ -31,6 +31,9 @@
*/
#pragma once
#include <string>
#include <vector>
namespace cpdoccore {
namespace odf_reader {
@ -42,14 +45,13 @@ public:
document_context();
virtual ~document_context();
void set_last_element(office_element* elem);
office_element* get_last_paragraph();
office_element* get_last_element();
int level;
private:
class Impl;
Impl * impl_;
std::wstring office_class_; //openoffice xml 1.0
std::vector<office_element*> levels;
office_element* last_paragraph;
};
}

View File

@ -90,7 +90,14 @@ const wchar_t * draw_image::name = L"image";
void draw_image::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
draw_image_attlist_.add_attributes(Attributes);
office_element* last_element = getContext()->get_last_element();
if ((!last_element) || (last_element->get_type() != typeDrawFrame))
{
draw_frame_ptr = office_element_creator::get()->create(L"draw", L"frame", getContext(), false);
draw_frame_ptr->add_attributes(Attributes);
}
draw_image_attlist_.add_attributes(Attributes);
xlink_attlist_.add_attributes(Attributes);
}
@ -325,6 +332,12 @@ std::wostream & draw_text_box::text_to_stream(std::wostream & _Wostream, bool bX
void draw_text_box::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
office_element* last_element = getContext()->get_last_element();
if ((!last_element) || (last_element->get_type() != typeDrawFrame))
{
draw_frame_ptr = office_element_creator::get()->create(L"draw", L"frame", getContext(), false);
draw_frame_ptr->add_attributes(Attributes);
}
draw_text_box_attlist_.add_attributes(Attributes);
}
@ -340,7 +353,14 @@ const wchar_t * draw_object::name = L"object";
void draw_object::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
draw_object_attlist_.add_attributes(Attributes);
office_element* last_element = getContext()->get_last_element();
if ((!last_element) || (last_element->get_type() != typeDrawFrame))
{
draw_frame_ptr = office_element_creator::get()->create(L"draw", L"frame", getContext(), false);
draw_frame_ptr->add_attributes(Attributes);
}
draw_object_attlist_.add_attributes(Attributes);
xlink_attlist_.add_attributes(Attributes);
}
@ -390,7 +410,7 @@ void draw_object_ole::detectObject(const std::wstring &fileName, std::wstring &p
std::vector<std::string> str;
while (sz_obj > 0)
while (sz_obj > 4)
{
_UINT32 sz = 0;
pStream->read((unsigned char*)&sz, 4); sz_obj-= 4;
@ -440,6 +460,8 @@ std::wstring draw_object::office_convert(odf_document_ptr odfDocument, int type)
std::wstring folderPath = odfDocument->get_folder();
std::wstring objectOutPath = NSDirectory::CreateDirectoryWithUniqueName(folderPath);
if (objectOutPath.empty()) return L"";
if (type == 1)
{
oox::package::docx_document outputDocx;

View File

@ -83,9 +83,10 @@ private:
draw_image_attlist draw_image_attlist_;
odf_types::common_xlink_attlist xlink_attlist_;
office_element_ptr office_binary_data_;
office_element_ptr_array content_;
office_element_ptr office_binary_data_;
office_element_ptr draw_frame_ptr; //openoffice xml 1.0
};
CP_REGISTER_OFFICE_ELEMENT2(draw_image);
@ -172,10 +173,9 @@ public:
office_element_ptr_array content_;
office_element_ptr office_event_listeners_;
// в content перенести нельзя - иначе событи будет добавляться не к этому объекту а следующему
office_element_ptr draw_glue_point_;
office_element_ptr draw_glue_point_;
office_element_ptr draw_image_map_;
//office_element_ptr draw_chart_map_;
office_element_ptr draw_contour_; // draw-contour-polygon or draw-contour-path
@ -189,8 +189,10 @@ public:
private:
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
void docx_convert_start(oox::docx_conversion_context & Context);
void docx_convert_end(oox::docx_conversion_context & Context);
};
CP_REGISTER_OFFICE_ELEMENT2(draw_frame);
//-------------------------------------------------------------------------------------------------------------
@ -270,13 +272,14 @@ public:
draw_text_box_attlist draw_text_box_attlist_;
office_element_ptr_array content_;
office_element_ptr draw_frame_ptr; //openoffice xml 1.0
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void add_text(const std::wstring & Text){}
virtual void add_space(const std::wstring & Text){}
};
CP_REGISTER_OFFICE_ELEMENT2(draw_text_box);
//-------------------------------------------------------------------------------------------------------------
@ -315,6 +318,8 @@ private:
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
std::wstring office_convert(odf_document_ptr odfDocument, int type);
office_element_ptr draw_frame_ptr; //openoffice xml 1.0
};
CP_REGISTER_OFFICE_ELEMENT2(draw_object);

View File

@ -167,9 +167,9 @@ length ComputeContextWidth(const style_page_layout_properties * pageProperties
columnGap = styleColumns->fo_column_gap_.get_value_or( length(0, length::pt ));
}
}
//$pageWidth - $pageLeftMargin - $pageRightMargin - $columnGap
//$pageWidth - $pageLeftMargin - $pageRightMargin - $columnGap
return length( (pageWidth.get_value_or(length(0, length::pt)).get_value_unit(length::pt) -
pageMarginRight.get_value_or(length(0, length::pt)).get_value_unit(length::pt) -
pageMarginRight.get_value_or(length(0, length::pt)).get_value_unit(length::pt) -
pageMarginRight.get_value_or(length(0, length::pt)).get_value_unit(length::pt) -
columnGap.get_value_unit(length::pt)) / columnsCount
);
@ -1153,19 +1153,36 @@ void draw_shape::docx_convert(oox::docx_conversion_context & Context)
void draw_image::docx_convert(oox::docx_conversion_context & Context)
{
if (!xlink_attlist_.href_)
return;
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
size_t pos_replaicement = href.find(L"ObjectReplacements");
const draw_frame *frame = Context.get_drawing_context().get_current_frame();//owner
if (!frame && draw_frame_ptr)
{
draw_frame *frame = dynamic_cast<draw_frame *>(draw_frame_ptr.get());
if (frame)
{
office_element_ptr elm = office_element_ptr(new draw_image(*this));
draw_image *image = dynamic_cast<draw_image *>(elm.get());
image->draw_frame_ptr = office_element_ptr();
const draw_frame * frame = Context.get_drawing_context().get_current_frame();//owner
frame->content_.push_back(elm);
frame->docx_convert(Context);
}
return;
}
//-----------------------------------------------------------------------------------------------
if (!frame)
return;
oox::_docx_drawing * drawing = dynamic_cast<oox::_docx_drawing *>(frame->oox_drawing_.get());
if (!drawing) return;
if (!xlink_attlist_.href_)
return;
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
oox::_docx_drawing * drawing = dynamic_cast<oox::_docx_drawing *>(frame->oox_drawing_.get());
if (!drawing)
return;
size_t pos_replaicement = href.find(L"ObjectReplacements");
if (pos_replaicement != std::wstring::npos)
{
if (!Context.get_drawing_context().get_use_image_replace())
@ -1173,6 +1190,7 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
if (href.length() - (pos_replaicement + 18) < 2)
return; //href="./ObjectReplacements/"
}
if (href[0] == L'#') href = href.substr(1);
if (drawing->type == oox::typeUnknown)
drawing->type = oox::typeImage;
@ -1245,6 +1263,24 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
void draw_text_box::docx_convert(oox::docx_conversion_context & Context)
{
const draw_frame *frame = Context.get_drawing_context().get_current_frame();//owner
if (!frame && draw_frame_ptr)
{
draw_frame *frame = dynamic_cast<draw_frame *>(draw_frame_ptr.get());
if (frame)
{
office_element_ptr elm = office_element_ptr(new draw_text_box(*this));
draw_text_box *text_box = dynamic_cast<draw_text_box *>(elm.get());
text_box->draw_frame_ptr = office_element_ptr();
frame->content_.push_back(elm);
frame->docx_convert(Context);
}
return;
}
//---------------------------------------------------------------------------------------------------------------
//тут может быть не только текст , но и таблицы, другие объекты ...
oox::StreamsManPtr prev = Context.get_stream_man();
@ -1269,13 +1305,12 @@ void draw_text_box::docx_convert(oox::docx_conversion_context & Context)
Context.back_context_state();
//---------------------------------------------------------------------------------------------------------
const draw_frame * frame = Context.get_drawing_context().get_current_frame();//owner
if (!frame)
return;
oox::_docx_drawing * drawing = dynamic_cast<oox::_docx_drawing *>(frame->oox_drawing_.get());
if (!drawing) return;
if (!drawing)
return;
drawing->type = oox::typeShape;
drawing->sub_type = 1; //textBox
@ -1516,7 +1551,8 @@ void draw_frame::docx_convert(oox::docx_conversion_context & Context)
drawing->inGroup = Context.get_drawing_context().in_group();
common_draw_docx_convert(Context, common_draw_attlists_, drawing);
//-----------------------------------------------------------------------------------------------------
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->docx_convert(Context);
@ -1555,14 +1591,36 @@ void draw_frame::docx_convert(oox::docx_conversion_context & Context)
void draw_object::docx_convert(oox::docx_conversion_context & Context)
{
try
const draw_frame *frame = Context.get_drawing_context().get_current_frame();//owner
if (!frame && draw_frame_ptr)
{
draw_frame *frame = dynamic_cast<draw_frame *>(draw_frame_ptr.get());
if (frame)
{
office_element_ptr elm = office_element_ptr(new draw_object(*this));
draw_object *object = dynamic_cast<draw_object *>(elm.get());
object->draw_frame_ptr = office_element_ptr();
frame->content_.push_back(elm);
frame->docx_convert(Context);
}
return;
}
//-----------------------------------------------------------------------------------------------
if (!frame)
return;
oox::_docx_drawing *drawing = dynamic_cast<oox::_docx_drawing *>(frame->oox_drawing_.get());
try
{
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
std::wstring tempPath = Context.root()->get_temp_folder();
std::wstring odfPath = Context.root()->get_folder();
if (!odf_document_ && !href.empty())
{
if (!odf_document_ && false == href.empty())
{
if (href[0] == L'#') href = href.substr(1);
std::wstring objectPath = odfPath + FILE_SEPARATOR_STR + href;
// normalize path ???? todooo
@ -1571,9 +1629,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
odf_document_ = odf_document_ptr(new odf_document(objectPath, tempPath, L"", NULL));
}
//---------------------------------------------------------------------------------------------------------------------
draw_frame* frame = NULL;
oox::_docx_drawing * drawing = NULL;
office_element* contentSubDoc = odf_document_ ? odf_document_->get_impl()->get_content() : NULL;
office_element* contentSubDoc = odf_document_ ? odf_document_->get_impl()->get_content() : NULL;
object_odf_context objectBuild (href);
if (contentSubDoc)
@ -1581,10 +1637,6 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
process_build_object process_build_object_(objectBuild, odf_document_->odf_context());
contentSubDoc->accept(process_build_object_);
frame = Context.get_drawing_context().get_current_frame(); //owner
if (frame)
drawing = dynamic_cast<oox::_docx_drawing *>(frame->oox_drawing_.get());
if (objectBuild.table_table_)
{
oox::xlsx_conversion_context xlsx_context(odf_document_.get());

View File

@ -213,9 +213,32 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
void draw_image::pptx_convert(oox::pptx_conversion_context & Context)
{
const std::wstring href = xlink_attlist_.href_.get_value_or(L"");
if (draw_frame_ptr)
{
draw_frame *frame = dynamic_cast<draw_frame *>(draw_frame_ptr.get());
if (frame)
{
office_element_ptr elm = office_element_ptr(new draw_image(*this));
draw_image *image = dynamic_cast<draw_image *>(elm.get());
image->draw_frame_ptr = office_element_ptr();
Context.get_slide_context().set_image(href);
frame->content_.push_back(elm);
frame->pptx_convert(Context);
}
return;
}
//-----------------------------------------------------------------------------------------------
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
if (true == href.empty())
{
}
else
{
if (href[0] == L'#') href = href.substr(1);
}
Context.get_slide_context().set_image(href);
////////////////////////////////////в принципе достаточно общая часть ...
Context.get_text_context().start_object();
@ -243,6 +266,22 @@ void draw_chart::pptx_convert(oox::pptx_conversion_context & Context)
void draw_text_box::pptx_convert(oox::pptx_conversion_context & Context)
{
if (draw_frame_ptr)
{
draw_frame *frame = dynamic_cast<draw_frame *>(draw_frame_ptr.get());
if (frame)
{
office_element_ptr elm = office_element_ptr(new draw_text_box(*this));
draw_text_box *text_box = dynamic_cast<draw_text_box *>(elm.get());
text_box->draw_frame_ptr = office_element_ptr();
frame->content_.push_back(elm);
frame->pptx_convert(Context);
}
return;
}
//---------------------------------------------------------------------------------------------------------------
Context.get_slide_context().set_text_box(); //rect с наваротами
Context.get_text_context().start_object();
@ -260,14 +299,31 @@ void draw_text_box::pptx_convert(oox::pptx_conversion_context & Context)
}
void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
{
try
if (draw_frame_ptr)
{
draw_frame *frame = dynamic_cast<draw_frame *>(draw_frame_ptr.get());
if (frame)
{
office_element_ptr elm = office_element_ptr(new draw_object(*this));
draw_object *object = dynamic_cast<draw_object *>(elm.get());
object->draw_frame_ptr = office_element_ptr();
frame->content_.push_back(elm);
frame->pptx_convert(Context);
}
return;
}
//-----------------------------------------------------------------------------------------------
try
{
std::wstring tempPath = Context.root()->get_temp_folder();
std::wstring odfPath = Context.root()->get_folder();
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
if (!odf_document_ && !href.empty())
if (!odf_document_ && false == href.empty())
{
if (href[0] == L'#') href = href.substr(1);
std::wstring objectPath = odfPath + FILE_SEPARATOR_STR + href;
// normalize path ???? todooo

View File

@ -205,9 +205,24 @@ void draw_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
void draw_image::xlsx_convert(oox::xlsx_conversion_context & Context)
{
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
if (draw_frame_ptr)
{
draw_frame *frame = dynamic_cast<draw_frame *>(draw_frame_ptr.get());
if (frame)
{
office_element_ptr elm = office_element_ptr(new draw_image(*this));
draw_image *image = dynamic_cast<draw_image *>(elm.get());
image->draw_frame_ptr = office_element_ptr();
if (href.empty() && office_binary_data_)
frame->content_.push_back(elm);
frame->xlsx_convert(Context);
}
return;
}
//-----------------------------------------------------------------------------------------------
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
if (true == href.empty())
{
office_binary_data* binary_data = dynamic_cast<office_binary_data*>(office_binary_data_.get());
@ -216,6 +231,10 @@ void draw_image::xlsx_convert(oox::xlsx_conversion_context & Context)
href = binary_data->write_to(Context.root()->get_folder());
}
}
else
{
if (href[0] == L'#') href = href.substr(1);
}
Context.get_drawing_context().set_image(href);
@ -246,6 +265,22 @@ void draw_chart::xlsx_convert(oox::xlsx_conversion_context & Context)
}
void draw_text_box::xlsx_convert(oox::xlsx_conversion_context & Context)
{
if (draw_frame_ptr)
{
draw_frame *frame = dynamic_cast<draw_frame *>(draw_frame_ptr.get());
if (frame)
{
office_element_ptr elm = office_element_ptr(new draw_text_box(*this));
draw_text_box *text_box = dynamic_cast<draw_text_box *>(elm.get());
text_box->draw_frame_ptr = office_element_ptr();
frame->content_.push_back(elm);
frame->xlsx_convert(Context);
}
return;
}
//---------------------------------------------------------------------------------------------------------------
Context.get_drawing_context().set_text_box();
Context.get_text_context().start_drawing_content();
@ -264,12 +299,29 @@ void draw_text_box::xlsx_convert(oox::xlsx_conversion_context & Context)
}
void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
{
if (draw_frame_ptr)
{
draw_frame *frame = dynamic_cast<draw_frame *>(draw_frame_ptr.get());
if (frame)
{
office_element_ptr elm = office_element_ptr(new draw_object(*this));
draw_object *object = dynamic_cast<draw_object *>(elm.get());
object->draw_frame_ptr = office_element_ptr();
frame->content_.push_back(elm);
frame->xlsx_convert(Context);
}
return;
}
//-----------------------------------------------------------------------------------------------
try
{
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
if (!odf_document_ && !href.empty())
if (!odf_document_ && false == href.empty())
{
if (href[0] == L'#') href = href.substr(1);
std::wstring tempPath = Context.root()->get_temp_folder();
std::wstring folderPath = Context.root()->get_folder();
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;

View File

@ -297,21 +297,21 @@ void math_mstyle::oox_convert(oox::math_context & Context)
{
Context.text_properties_ = odf_reader::style_text_properties_ptr(new odf_reader::style_text_properties());
Context.text_properties_->content().style_font_name_ = L"Cambria Math";
Context.text_properties_->content().fo_font_size_ = odf_types::length(Context.base_font_size_, odf_types::length::pt);
Context.text_properties_->content_.style_font_name_ = L"Cambria Math";
Context.text_properties_->content_.fo_font_size_ = odf_types::length(Context.base_font_size_, odf_types::length::pt);
if (mathsize_)
Context.text_properties_->content().fo_font_size_ = mathsize_;
Context.text_properties_->content_.fo_font_size_ = mathsize_;
if (color_)
Context.text_properties_->content().fo_color_ = color_;
Context.text_properties_->content_.fo_color_ = color_;
if (common_attlist_.mathvariant_)
{
if (common_attlist_.mathvariant_->style_.bold)
Context.text_properties_->content().fo_font_weight_ = odf_types::font_weight(odf_types::font_weight::WBold);
Context.text_properties_->content_.fo_font_weight_ = odf_types::font_weight(odf_types::font_weight::WBold);
if (common_attlist_.mathvariant_->style_.italic)
Context.text_properties_->content().fo_font_style_ = odf_types::font_style(odf_types::font_style::Italic);
Context.text_properties_->content_.fo_font_style_ = odf_types::font_style(odf_types::font_style::Italic);
}
//--------------------------------------------------
@ -324,7 +324,7 @@ void math_mstyle::oox_convert(oox::math_context & Context)
{
CP_XML_NODE(L"m:ctrlPr")
{
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
Context.text_properties_->content_.oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
}
}
}
@ -352,8 +352,8 @@ void math_mstyle::oox_convert(oox::math_context & Context)
//reset to default math text props
Context.text_properties_ = odf_reader::style_text_properties_ptr(new odf_reader::style_text_properties());
Context.text_properties_->content().style_font_name_ = L"Cambria Math";
Context.text_properties_->content().fo_font_size_ = odf_types::length(Context.base_font_size_, odf_types::length::pt);
Context.text_properties_->content_.style_font_name_ = L"Cambria Math";
Context.text_properties_->content_.fo_font_size_ = odf_types::length(Context.base_font_size_, odf_types::length::pt);
Context.is_need_e_ = need_e_old;
{
@ -365,7 +365,7 @@ void math_mstyle::oox_convert(oox::math_context & Context)
{
CP_XML_NODE(L"m:ctrlPr")
{
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
Context.text_properties_->content_.oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
}
}
}

View File

@ -112,7 +112,7 @@ void math_mi::oox_convert(oox::math_context & Context)
}
}
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
Context.text_properties_->content_.oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
CP_XML_NODE(L"m:t")
{
@ -160,7 +160,7 @@ void math_mo::oox_convert(oox::math_context & Context)
{
// + доп стили текста ... todoooo
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
Context.text_properties_->content_.oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
CP_XML_NODE(L"m:t")
{
@ -201,7 +201,7 @@ void math_mn::oox_convert(oox::math_context & Context)
{
// + доп стили текста ... todoooo
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
Context.text_properties_->content_.oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
CP_XML_NODE(L"m:t")
{

View File

@ -65,10 +65,10 @@ void number_style_base::oox_convert_impl(oox::num_format_context & Context)
{
if (style_text_properties * textProp = dynamic_cast<style_text_properties*>(style_text_properties_.get()))
{
if (textProp->content().fo_color_)
if (textProp->content_.fo_color_)
{
int r = 0, g = 0, b = 0;
if (HEXStringToRGB(textProp->content().fo_color_->get_hex_value(), r, g, b))
if (HEXStringToRGB(textProp->content_.fo_color_->get_hex_value(), r, g, b))
{
std::wostream & strm = Context.output();
strm << L"[" << RGBToString(r, g, b) << L"]";

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