Compare commits

...

659 Commits

Author SHA1 Message Date
23fc146eca Fix wget/curl parameters injection 2020-03-24 13:38:10 +03:00
7fd9e52bc3 Merge pull request #230 from ONLYOFFICE/feature/fix_bug_v5.5.1
fix bug in zip
2020-03-19 18:22:53 +03:00
dd13f9f24c fix bug in zip 2020-03-19 18:21:00 +03:00
0fe3c3ece5 Merge pull request #228 from ONLYOFFICE/feature/fix_bug_v5.5.1
XlsxFormat - fix bug #44840
2020-03-19 12:56:48 +03:00
5d148a6d0d Set htmlfileinternal path to doctrenderer.config 2020-03-18 18:28:56 +03:00
d7af2cb41d Remove path to HtmlFileInternal from x2t xml params 2020-03-18 18:09:52 +03:00
ed5bfb7b27 Add gitignore file 2020-03-18 16:33:25 +03:00
b81e988da5 XlsxFormat - fix bug #44840 2020-03-18 15:15:26 +03:00
a7c868d3d1 Remove unused files 2020-03-18 09:55:30 +03:00
bb022c49bd Fix xp build 2020-03-16 17:54:21 +03:00
31e8a1cbdd Fix previous commit 2020-03-16 17:27:31 +03:00
a19074993d Fix xp artifacts 2020-03-16 17:23:27 +03:00
0a1c718cc0 Refactoring 2020-03-13 17:49:15 +03:00
fb5da5e4ff Extend event types for native 2020-03-11 11:37:54 +03:00
61a157a3c4 Update gitignore 2020-03-11 09:23:06 +03:00
a7ba4c471e [x2t] For bug 44756
Fixed opening docx with special tblpPr values
2020-03-10 14:42:50 +03:00
8c18843b58 [android][se] fix find oEncodindId 2020-03-05 16:31:15 +03:00
04d796d760 [x2t] For bug 44689
Fix DurableId generation. Numbers greater than 0x7FFFFFFE cause MS Office errors(ST_LongHexNumber by spec)
2020-03-05 13:24:22 +03:00
12c427b11e Merge branch 'hotfix/v5.5.1' of github.com:ONLYOFFICE/core into hotfix/v5.5.1 2020-03-05 12:05:12 +03:00
9415983797 Merge feature/pre5.5.1 into hotfix/v5.5.1 2020-03-05 12:04:10 +03:00
e82ea1bc5c Merge pull request #227 from ONLYOFFICE/feature/pre5.5.1
Feature/pre5.5.1
2020-03-05 11:23:06 +03:00
49f4bdb933 v5.5.0 2020-03-04 18:09:03 +03:00
a577378a1e Merge pull request #225 from ONLYOFFICE/feature/pre_hotfix5.5.1
Hide openssl symbols
2020-03-04 10:14:56 +03:00
997bf0b887 Hide openssl symbols 2020-03-03 19:10:03 +03:00
51c1b7d21a Fix common apps (#224) 2020-02-27 15:09:14 +03:00
4b0ce196e8 [x2t] Fxi bug 44611 (#223) 2020-02-25 22:53:48 +03:00
b96189c213 [android][xt2] Fix overwrite document 2020-02-21 11:45:11 +03:00
987e6b6e76 [android][xt2] Open password odf document 2020-02-21 11:45:11 +03:00
aefef93e21 icu for ios (#221)
Co-authored-by: Alexey.Musinov <alexey.musinov@gmail.com>
2020-02-19 19:05:23 +03:00
2c04e9fb57 Fix windows flags (#220) 2020-02-13 19:41:15 +03:00
e6007815a2 [x2t] Fix bug 44466 (#219)
Move m_oFirstLine, m_oHanging from CTwipsMeasure(unsigned) to CSignedTwipsMeasure
2020-02-07 18:39:20 +03:00
56482f0524 Feature/build ios (#218)
* Fix build on ios in debug mode

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

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

* XlsFormatReader - fix bug #42239

* OdfFormatWriter - fix error in headers/footers

* OdfFormatWriter - fix bug #42654

* x2t - fix after testing

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

* OdfFormatWriter - fix error in headers/footers
2019-09-03 15:24:23 +03:00
11dad1b10b v5.4.0 2019-09-03 14:37:38 +03:00
9fb9fd3511 Merge remote-tracking branch 'origin/feature/fix_errors2_v5.4.0' into develop 2019-09-03 11:52:25 +03:00
246474a2f7 Merge branch 'feature/fix_errors3_v.5.4.0' into feature/fix_errors2_v5.4.0 2019-09-03 11:47:23 +03:00
af0f878de2 [ios] refactoring 2019-09-03 10:53:09 +03:00
fc8d16196d Fixed project of OdfReaderFormat library for ios 2019-09-03 09:45:01 +03:00
41fc3eb8c1 x2t - fix after testing 2019-09-02 17:52:47 +03:00
53878c9d88 OdfFormatWriter - fix bug #42654 2019-09-02 16:00:46 +03:00
677982b4ce OdfFormatWriter - fix error in headers/footers 2019-09-02 12:58:53 +03:00
e7290f5ad9 XlsFormatReader - fix bug #42239 2019-09-02 11:43:54 +03:00
816c43bffe [android][de] fix emf 2019-09-02 08:56:17 +03:00
8dd58a2050 [android][de] fix emf 2019-08-31 11:32:27 +03:00
e96221c83b DocFormatReader - fix extended comments 2019-08-30 13:00:48 +03:00
2a4ee72059 [ios][x2t] fixed build 2019-08-29 18:14:37 +03:00
9a3e9a9851 [ios][x2t] fixed build 2019-08-29 18:07:34 +03:00
41920875ff [x2t] Extend lvl Format in Editor.bin 2019-08-29 14:18:10 +03:00
4fd933f393 [x2t] Fix crash while opening (#180) 2019-08-28 18:25:41 +03:00
1165189242 [x2t] Read empty string from empty node value. For bug 42568 (#179) 2019-08-28 16:38:27 +03:00
0ae9b97774 [ios][x2t] fixed build 2019-08-28 14:41:00 +03:00
c644c419ec Merge remote-tracking branch 'origin/release/v5.4.0' into develop 2019-08-28 13:45:01 +03:00
b6e88ce999 Fix errors1 v5.4.0 (#178)
* fix bug #42542

* OdfFormatW - fix after testing

* fix bug #42542 (file 2)

* x2t - fix users files

* DocFormatReader - fix bug #42526
2019-08-28 12:02:25 +03:00
3874b56289 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-08-27 15:24:44 +03:00
29df40407e [android][se] fix crash 2019-08-27 14:57:13 +03:00
8a7b6fbb2b Fix bug #42542 (#177) 2019-08-27 13:03:12 +03:00
e3ff8912f0 [ios][de] update file utils 2019-08-26 17:12:06 +03:00
ae6d231acc OdfFormatW - fix after testing 2019-08-26 14:31:43 +03:00
98114aa7a5 fix bug #42542 2019-08-26 13:18:55 +03:00
6bd1d9b90b v5.3.5 2019-08-26 11:25:08 +03:00
cc8cfb6124 v5.3.5 2019-08-26 11:23:38 +03:00
36aa148aa0 . 2019-08-25 17:56:08 +03:00
f69180dcf6 . 2019-08-24 18:15:26 +03:00
864c3bfdc7 Fix memory error 2019-08-23 17:02:43 +03:00
4bb34abf91 Fix bug with font picker 2019-08-23 15:27:28 +03:00
3887879671 . 2019-08-23 14:07:15 +03:00
9516a0b02b Fix previous commit 2019-08-23 13:36:11 +03:00
047041aa9b Fix previous commit 2019-08-23 13:20:25 +03:00
ca5e70118c Add family names for picker 2019-08-23 13:15:42 +03:00
99159d5932 . 2019-08-22 19:39:07 +03:00
5d89558b5d Support picker on save to pdf command 2019-08-22 15:13:31 +03:00
5058d41d6a Support picker on save to pdf command 2019-08-22 14:37:31 +03:00
69be19feda Support picker on save to pdf command 2019-08-22 13:52:19 +03:00
73933c683e . 2019-08-22 13:17:15 +03:00
55e4902d66 [android][pe] fix build 2019-08-21 15:42:08 +03:00
2dc1ad5af7 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-08-20 19:18:34 +03:00
ab0def1840 OdfFormatWriter - add spreadsheets footers & headers (fix bug #42457) 2019-08-20 19:17:45 +03:00
957972e3be Merge pull request #176 from ONLYOFFICE/feature/android_fonts
Feature/android fonts
2019-08-20 18:44:49 +03:00
49e31f2c0c Correct write font_selection.bin 2019-08-20 16:20:30 +03:00
4585e86fb7 Developing... 2019-08-20 11:41:37 +03:00
6bcafa516a Merge branch 'feature/native_nosquares' into develop
# Conflicts:
#	DesktopEditor/fontengine/FontManager.cpp
2019-08-19 16:24:19 +03:00
e41f8019d6 Fix bugs 2019-08-19 16:09:08 +03:00
e8f1da2478 Add new common methods (#173) 2019-08-19 12:05:26 +03:00
b378084925 . 2019-08-16 16:46:16 +03:00
99f47b43a5 OdfFormat - spreadsheets forms 2019-08-16 13:26:30 +03:00
dc1999482e [fonts][windows] Remove recursion for user fonts 2019-08-16 11:24:59 +03:00
7c764f5b84 Developing... 2019-08-16 11:12:40 +03:00
03316ea82d [x2t] For bug 42422 2019-08-15 17:06:42 +03:00
567f547d10 [android][se] fix crash with xls format 2019-08-15 16:35:55 +03:00
a4a52ec016 [android][pe] fix crash for empty presentation 2019-08-15 15:19:52 +03:00
1458b1c57f RtfFormat - fix users files 2019-08-14 17:57:07 +03:00
7d59211e67 Add symbol ranges detection 2019-08-14 17:54:07 +03:00
f68662827d OdfFormat - fix bug #42381 2019-08-14 15:37:03 +03:00
bd61eb4bef DocFormat - fix word95 table 2019-08-13 15:55:20 +03:00
63fabad661 .. 2019-08-13 14:01:20 +03:00
b9981cffef Fix xp build 2019-08-12 10:30:12 +03:00
30a30d1bc6 [android][pe] fix runtime crash 2019-08-09 14:57:43 +03:00
d5d086d286 . 2019-08-08 13:14:43 +03:00
6822c8b7dd x2t - fix bug #42341 2019-08-08 12:12:49 +03:00
56b7889270 Add new common methods 2019-08-07 18:50:27 +03:00
f4cdfc49bb [x2t] Fix typo 2019-08-07 17:03:29 +03:00
972f1ef4e5 [x2t] Add EffectProperties::fromPPTY; Fix EffectLst::fromPPTY 2019-08-05 18:07:56 +03:00
8fda74aefc [x2t] Fix bug 42288 2019-08-05 11:17:00 +03:00
7bba282321 [android][x2t] fix crash 2019-08-05 10:06:59 +03:00
8c8f59da80 [x2t] Add outlinePr to Editor.bin 2019-08-02 14:51:45 +03:00
3027a038d0 [x2t] Fix build 2019-08-02 11:31:43 +03:00
9c6ee2a171 [x2t] Fix NSStringExt::FindLastNotOf 2019-08-01 20:03:56 +03:00
e8d6092a95 Add return values to builder interface 2019-08-01 18:27:17 +03:00
3bc08e72dc Add return values to builder interface 2019-08-01 18:15:48 +03:00
c094962751 [x2t] Fix mailmerge 2019-07-29 16:23:48 +03:00
70f8abf0bf OdfFormat - fix users files 2019-07-29 13:38:18 +03:00
47318eef9c RtfFormatReader - fix users files 2019-07-26 17:33:24 +03:00
094a1d98d6 Add executable path to rpath 2019-07-26 16:55:00 +03:00
471219e59a [x2t] Fix dataValidations writing 2019-07-26 14:10:29 +03:00
2cfd2a0126 Change com object 2019-07-26 14:07:43 +03:00
f3ec039a01 Fix bug #42195
Fix the problem with reading EMF_BITBLT record in the EMF
2019-07-26 12:26:07 +03:00
f4795db0b8 Add allfonts path param 2019-07-26 11:30:21 +03:00
b52d9cb5d6 Correct "LoadConfig" method in doctrenderer 2019-07-25 19:00:07 +03:00
ff2303f386 . 2019-07-25 15:55:04 +03:00
d78fe3b9b1 OdfFormat 2019-07-25 14:27:48 +03:00
b589d53213 OdfFormatWriter - fix watermark position 2019-07-24 17:12:55 +03:00
fcb01e9675 RtfFormat - fix users files 2019-07-24 16:43:27 +03:00
60b41cae31 [x2t] Add w:compat to Editor.bin 2019-07-24 13:54:14 +03:00
ecca92951c OdfFormat - fix users files 2019-07-23 18:47:52 +03:00
5612c09b0c Disable xml errors on check svg 2019-07-23 15:16:11 +03:00
8926c52369 [x2t] Add pageSetUpPr to Editor.bin 2019-07-23 13:11:39 +03:00
b1d0b7aac7 . 2019-07-23 12:14:06 +03:00
923fbfcbe0 Linux build errors 2019-07-23 10:50:11 +03:00
fc6f8bdba9 Add building allthemesgen 2019-07-22 18:58:18 +03:00
e6da67b3e1 OdfFormatWriter - fix bug #42158 2019-07-22 17:43:57 +03:00
49fa17978d Themes generator developing... 2019-07-22 15:43:55 +03:00
61211fc08c OdfFormatWriter - fix bug #42098 2019-07-18 19:24:58 +03:00
8316861e00 Add themes generator 2019-07-18 14:25:43 +03:00
8ebf0c590a [ios][documents] update build for bitcode 2019-07-18 14:11:53 +03:00
3451d93b57 Dump themes thumbnails 2019-07-17 18:59:42 +03:00
f36ba68722 [x2t] Fix bug 42023 2019-07-17 18:19:09 +03:00
9a8a0a9bf2 Add allthemesgen 2019-07-17 17:59:51 +03:00
ae6d97ffd8 DocFormatReader -... 2019-07-17 17:51:54 +03:00
16ffb9cefd Change destdir & target name in allfontsgen project 2019-07-17 10:28:17 +03:00
92beed0782 [v8] Fix windows build 2019-07-16 16:37:34 +03:00
27e68c0fa7 v5.3.4 2019-07-16 15:20:41 +03:00
9cdd977367 [x2t] Fix writing commentsIds.xml to rels 2019-07-16 14:11:50 +03:00
6ad996780b x2t - fix bug #42070 2019-07-15 16:53:31 +03:00
bd0a2bcbd7 [x2t] Add timeZoneBias to Editor.bin; Fix GenerateInt 2019-07-12 20:22:53 +03:00
a4e2fcad31 [x2t] Generate comments Guids if they are absent 2019-07-11 19:45:35 +03:00
7e23508e06 DocxFormat - add altChunk 2019-07-11 19:17:39 +03:00
c9928f0929 [ios][formats] update OdfConverter 2019-07-11 17:04:29 +03:00
207549cc88 [ios][formats] update OdfConverter 2019-07-11 16:14:46 +03:00
a16d889984 OdfFormatReader - fix bug #41390 2019-07-11 15:52:52 +03:00
8600020fb0 [x2t] Add providerId to Editor.bin 2019-07-10 20:24:27 +03:00
8950201785 [x2t] Write both "table", "pivot" tableStyle attibutes 2019-07-10 20:22:30 +03:00
c600841902 fix bug #42048 2019-07-10 17:18:33 +03:00
1a3a73d0ec . 2019-07-10 14:57:44 +03:00
5a82c47fa0 [x2t] Fix build 2019-07-10 00:36:08 +03:00
65f7a4a170 Merge pull request #172 from ONLYOFFICE/feature/comments
Feature/comments
2019-07-09 20:03:59 +03:00
413424bf62 Merge hotfix/v5.3.3 into develop 2019-07-09 19:39:31 +03:00
41606e907a v5.3.3 2019-07-09 19:18:07 +03:00
01499a21f3 Fix mac timers (#170) 2019-07-09 16:06:10 +03:00
a9215a867b . 2019-07-08 18:22:22 +03:00
e9fd8205fa . 2019-07-08 17:06:27 +03:00
f30a3c4ae8 x2t - fix bug #42030 2019-07-08 13:17:44 +03:00
615179f9da [x2t] Add ThreadedComments to Editor.bin 2019-07-05 20:11:22 +03:00
2fc5a4f37a . 2019-07-05 12:15:34 +03:00
25af6b2ecf x2t - fix bug #41757 2019-07-05 12:02:41 +03:00
f0fdf9f86e [x2t] Add w16cid:commentsIds to Editor.bin 2019-07-04 14:20:37 +03:00
5d5e7bce72 Speed up cloning openssl (#169)
Before:
```
real    3m6,793s
user    0m28,249s
sys     0m5,641s
```

After:
```
real    0m13,834s
user    0m2,169s
sys     0m0,838s
```
2019-07-04 11:42:54 +03:00
58903d92e1 [ios][odfconverter] fix crash 2019-07-03 18:41:19 +03:00
b7ea6bb376 . 2019-07-03 16:49:36 +03:00
a1007d4522 . 2019-07-03 13:42:24 +03:00
4b68d3294c . 2019-07-02 16:12:51 +03:00
24b44f6b03 [x2t] Fix writing m:oMath inside w:hyperlink 2019-07-02 14:02:16 +03:00
9f20ee6fef . 2019-07-01 18:48:47 +03:00
14921ca98d Fix building for xp (#168) 2019-07-01 14:03:21 +03:00
663bf866ed . 2019-07-01 12:57:57 +03:00
4894639c09 Build icu with only xp target (#167) 2019-06-28 10:41:31 +03:00
2314452d5a [x2t] Fix build 2019-06-28 00:16:41 +03:00
22c8ae9d0e Merge pull request #166 from ONLYOFFICE/feature/sheet-data
Feature/sheet data
2019-06-27 20:25:29 +03:00
996fa5c84d [x2t] Fix <w:t> elem with run content inside(<w:t>6<w:cr/>6</w:t>) 2019-06-27 20:20:20 +03:00
59d2dd2840 . 2019-06-27 12:24:51 +03:00
3727c2e982 Fix boost download error 2019-06-26 18:53:10 +03:00
1b67ebe9a6 [s2t] Add some optimization for xls->Editor.bin convertion 2019-06-26 16:30:50 +03:00
967ab71adc XLsFormat - fix bug #41967 2019-06-26 15:37:01 +03:00
d7c7dadbba [x2t] Use one CCell object while xml->binary convertion 2019-06-25 20:22:24 +03:00
a48322f1cc [x2t] Fix CStreamBinaryWriter 2019-06-25 20:20:28 +03:00
bd41922f66 OdfFormatWriter - fix bug #41956 2019-06-25 17:55:49 +03:00
ccd73c8c68 [ios][x2t] fixed build 2019-06-25 15:33:38 +03:00
5b6659f816 [android][x2t] fix build 2019-06-25 14:40:02 +03:00
a5122a6a47 Remove inline flag (#165) 2019-06-24 18:34:22 +03:00
7a4cf11c62 [x2t] Revert some merged files in 2019-06-24 17:31:42 +03:00
9b9d7df4e2 Merge remote-tracking branch 'remotes/origin/hotfix/v5.3.3' into develop
# Conflicts:
#	Common/DocxFormat/Source/XlsxFormat/SharedStrings/Text.h
2019-06-24 15:05:16 +03:00
c9330ee0f1 Feature/bug 41890 (#164)
* [x2t] Decode xlsx escaped chars

* [x2t] Fix bug #41890, #36575. Add CStringBuilder::WriteEncodeXmlStringHHHH
2019-06-24 14:56:02 +03:00
2214362426 Fix boost download error 2019-06-24 14:51:39 +03:00
bdce91fccf Merge hotfix/v5.3.2 into develop 2019-06-21 18:38:23 +03:00
f9e35983f4 v5.3.2 2019-06-21 18:13:37 +03:00
dd65f70fcb [ios][x2t] add support bitcode 2019-06-21 16:23:32 +03:00
bf600c6eb0 Core/mac build (#161) 2019-06-21 12:54:00 +03:00
0db6728463 Fix 3rdparty building 2019-06-20 14:32:51 +03:00
03bccc6b10 [x2t] Fix CCell::parseRefA; Fix CSV opening 2019-06-20 11:58:16 +03:00
09c43b1179 Remove curl & add errors to bat files (#159) 2019-06-19 17:20:12 +03:00
e6134405cb Merge remote-tracking branch 'origin/feature/fix_v5.3.1' into develop 2019-06-19 12:22:30 +03:00
0499c6ff4f Merge pull request #158 from ONLYOFFICE/feature/binary-sheet-data
Feature/binary sheet data
2019-06-18 18:36:40 +03:00
1860c19539 [x2t] Fix Editor.bin->xlsx drawing convertion 2019-06-18 17:09:15 +03:00
2d5015bcf2 Revert "[x2t] Move c_oSerWorksheetsTypes::XlsbPos record in Editor.bin"
This reverts commit c0d16ed7c3.
2019-06-18 15:33:53 +03:00
390ab3bcc8 [ios] add constants (#157) 2019-06-18 13:46:28 +03:00
c0d16ed7c3 [x2t] Move c_oSerWorksheetsTypes::XlsbPos record in Editor.bin 2019-06-17 19:05:25 +03:00
075f70c220 Fix prefious commit (#156) 2019-06-17 16:17:14 +03:00
6abf1613ec Fix mac build (#155) 2019-06-17 15:58:07 +03:00
0abc21d4ee Merge pull request #154 from ONLYOFFICE/ios/fixed-build
Fix ios build
2019-06-17 14:13:41 +03:00
7a7cdab770 up 2019-06-17 14:10:11 +03:00
7c6218ccb5 [x2t] Add Cell::fromXMLtoXLSB for performance reasons. Add other fixes 2019-06-14 18:05:01 +03:00
34c5a4b3af [x2t] Improve performance on xlsx->Editor.bin convertion 2019-06-11 20:24:24 +03:00
9256b0f9a3 [x2t] Fixes 2019-06-10 20:09:52 +03:00
ce370581a8 [android] add system initialize path 2019-06-10 13:15:48 +03:00
39647894a8 [android] add system setup fonts 2019-06-10 13:06:05 +03:00
3d456bcc80 [x2t] Fixes 2019-06-07 20:04:11 +03:00
7ae3c6f2ea Fix bug with svg (#153) 2019-06-07 15:22:15 +03:00
404058354e [x2t] Write SheetData to to Editor.bin on xml reading 2019-06-06 20:21:18 +03:00
d398488f3d OdfFormatWriter - fix bug #41789 2019-06-06 13:50:37 +03:00
35bd2803a4 v5.3.1 2019-06-06 12:32:18 +03:00
c312a2b868 XlsFormat - fix bug #41779 2019-06-05 16:44:37 +03:00
08f75771b9 Merge pull request #151 from ONLYOFFICE/gutter
Gutter
2019-06-04 13:36:23 +03:00
060f695fb1 . 2019-06-03 18:15:53 +03:00
de3261521e Merge 5.3.1 => develop 2019-06-03 13:40:34 +03:00
e7bf661432 Fix bug #41495 (#149)
Fix the problem with rendering WMF files
2019-05-31 17:32:12 +03:00
6470a3a8a4 fix bug #38183 2019-05-30 19:13:26 +03:00
14aed88307 . 2019-05-30 12:54:19 +03:00
132f770d28 . 2019-05-29 20:12:21 +03:00
8f5318a9a2 . 2019-05-29 20:07:35 +03:00
635265eaa2 Feature/pre5.3.1 (#146)
* Fix bug with fonts installed not for all users

* Fix compilation error with gcc >=5

* Fix  build for xp
2019-05-29 15:29:19 +03:00
038a687d01 . 2019-05-28 17:03:39 +03:00
69e8ea6f4b . 2019-05-28 13:33:10 +03:00
1393de8057 v5.3.0 2019-05-27 17:21:45 +03:00
7636ff79cc v5.3.0 2019-05-27 17:05:18 +03:00
2092aef589 [ios][odf] fixed build 2019-05-27 13:58:50 +03:00
eff937699b . 2019-05-27 13:39:25 +03:00
3efc1f0432 [ios][x2t] fixed build 2019-05-27 13:01:12 +03:00
69fee1ae0b . 2019-05-23 20:03:25 +03:00
a0cc6b6274 OdfFormatWriter - ...; fix vml comment 2019-05-23 17:28:24 +03:00
31eb395858 OdfFormat - ... 2019-05-21 19:05:00 +03:00
ed1019a004 Not writing transparency group in pdfa mode 2019-05-20 17:09:22 +03:00
4e554d128a Merge pull request #143 from ONLYOFFICE/feature/tester
Feature/tester
2019-05-20 14:39:17 +03:00
b8d441a327 Fix remove exe 2019-05-20 14:34:24 +03:00
8fb809bf4a tester 2019-05-20 14:22:26 +03:00
cabf6ab32a [x2t] Add Gutter to Editor.bin
For bug 40990
2019-05-20 13:57:14 +03:00
35c4d70cf5 Fix bug 41615 2019-05-20 11:57:52 +03:00
58952393f0 OdfFormat - data validations 2019-05-19 17:12:43 +03:00
688d5972ea [x2t] Change write order to Editor.bin 2019-05-17 20:00:11 +03:00
81176e851c [x2t] Add PageSetup properties to Editor.bin 2019-05-17 19:55:47 +03:00
0b987aeed2 Add variable for xp support 2019-05-17 15:00:16 +03:00
c7315e2f21 OdfFormatReader -... 2019-05-16 19:43:29 +03:00
aefb229343 [x2t] Fix typo (Core props) 2019-05-16 18:25:10 +03:00
ac080b3485 Merge commit 'eb9d69d1ec6f23036a820992cd1957463851ef04' into develop 2019-05-16 15:41:55 +03:00
eb9d69d1ec Fix svg bug 2019-05-15 19:28:02 +03:00
eb4ffee9e7 OdfFormat - ... 2019-05-15 19:07:34 +03:00
763347d8ec OdfFormatWriter -.. 2019-05-15 16:35:29 +03:00
9670d021c2 x2t - fix bug #41503 2019-05-14 19:22:20 +03:00
232115e684 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-05-14 14:08:38 +03:00
79f18355fe x2t - fix bug #41515 2019-05-13 15:27:03 +03:00
f86055c713 Epub images bug (xml files) 2019-05-08 12:51:29 +03:00
ea82bea6f1 . 2019-04-29 15:21:20 +03:00
28f5b1251a XlsxFormat - fix bug #41458 2019-04-29 14:20:41 +03:00
39fbf06511 PptFormatReader - fix bug #40482 2019-04-29 14:20:41 +03:00
a265d82dda Merge remote-tracking branch 'origin/feature/fix_v5.3' into develop 2019-04-27 17:30:36 +03:00
e68b550d1e OdfFormatReader - fix bug #41408 2019-04-27 17:14:31 +03:00
0821edca07 OdfFormatReader - fix bug #41408 2019-04-27 16:26:46 +03:00
bc4faa26b9 Fix linux build 2019-04-26 17:06:30 +03:00
668a89bbd1 Merge pull request #132 from ONLYOFFICE/feature/svg
Feature/svg
2019-04-26 16:50:48 +03:00
832d35dc17 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-04-26 16:39:58 +03:00
2d21d334cf OdfFormatReader - fix bug #41408 2019-04-26 16:36:56 +03:00
b23bc97fdb Fix bugs 2019-04-25 18:26:02 +03:00
f4df80ebf3 OdfFormatReader - fix bug #41409 2019-04-25 17:30:06 +03:00
230c51689d DocFormatReader - fix bug #41378 2019-04-24 15:48:41 +03:00
799fcbc342 [ios][x2t] fixed build 2019-04-24 15:39:43 +03:00
1d25f72ac9 SVG full support 2019-04-24 14:14:34 +03:00
9bfb0321b2 svg position support 2019-04-24 11:45:07 +03:00
6c1bdc6ff8 . 2019-04-23 19:27:56 +03:00
826be463f5 PdfWriter: Making full-transparent image pixels white 2019-04-23 18:10:07 +03:00
469ce9aafb [ios][x2t] fixed build 2019-04-23 18:07:50 +03:00
29bb606d04 . 2019-04-23 14:17:10 +03:00
8f8995cbe7 . 2019-04-23 11:00:39 +03:00
fb1ae2c79a . 2019-04-23 10:45:51 +03:00
0f4d594248 . 2019-04-22 18:56:37 +03:00
152d05d5a5 . 2019-04-22 18:40:22 +03:00
942767eb79 . 2019-04-22 17:08:37 +03:00
5c070f0475 . 2019-04-22 16:50:53 +03:00
17c68ae414 OdfFormatWriter - ... 2019-04-22 13:16:23 +03:00
ab45804644 . 2019-04-19 18:50:12 +03:00
5f7288f66f . 2019-04-19 17:41:29 +03:00
b308f53e76 . 2019-04-19 14:45:55 +03:00
0982b8fb11 OdfFormatWriter - .. 2019-04-18 20:01:12 +03:00
4cca54900d . 2019-04-18 18:46:34 +03:00
b66ed403e1 . 2019-04-18 18:22:08 +03:00
692fe69426 OdfFormatWriter - controls 2019-04-18 12:24:36 +03:00
428b5971e8 . 2019-04-17 18:55:31 +03:00
32193b8a04 x2t - for bug 41281 2019-04-17 18:01:14 +03:00
5bb1de7dbd Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-04-17 13:29:49 +03:00
97531fe80f OdfFormatReader - fix bug #41258 2019-04-17 12:06:54 +03:00
84755143fa . 2019-04-16 17:55:33 +03:00
37ab11c58a OdfFormatWriter - fix user file 2019-04-16 17:28:50 +03:00
22cdeaf821 Fix build error 2019-04-16 16:59:58 +03:00
ee4d2079dc Update videoplayerlib path 2019-04-16 12:46:09 +03:00
68606f4cb0 Change docbuilder path 2019-04-15 19:13:36 +03:00
dbb11a480e Move docbuilder to core 2019-04-15 18:31:47 +03:00
6c29f811d9 x2t - fixed bug #40823 2019-04-15 14:15:57 +03:00
eb157610d3 DocFormatReader - fix bug #41172 2019-04-15 12:06:30 +03:00
89ac698d35 . 2019-04-15 11:30:23 +03:00
e1d910f952 . 2019-04-13 12:04:23 +03:00
ef7331d803 [x2t] Add MoveFromRangeStart to Editor.bin in all levels(body, p ...) 2019-04-12 19:01:29 +03:00
5bb3ca6aff Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-04-12 18:38:53 +03:00
bae655ba49 GetTickCount on MacOS 2019-04-12 18:38:42 +03:00
e4b4949471 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-04-12 18:32:21 +03:00
2bfcfbf21c . 2019-04-12 18:31:41 +03:00
1266382747 . 2019-04-12 14:17:34 +03:00
287059a891 x2t - fix users files 2019-04-11 19:54:04 +03:00
966809a8f2 x2t - bin - read/write activeX(convert to control) 2019-04-11 17:15:29 +03:00
d8f8720d05 [x2t] Fix writing to Editor.bin. For bug 40914. 2019-04-11 16:31:55 +03:00
aa8471b024 [x2t] Fix reading from Editor.bin 2019-04-08 19:52:54 +03:00
27c9b40ad3 [ios][x2t] fixed build 2019-04-05 11:53:33 +03:00
699eb731b4 x2t - bin - form controls read/write 2019-04-04 20:02:26 +03:00
0eb032a281 . 2019-04-04 15:38:02 +03:00
f89174ded5 . 2019-04-04 14:02:02 +03:00
ff1d53637a x2t - bin - writing xlsx controls 2019-04-02 18:44:10 +03:00
e825b4359f Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-04-02 17:14:46 +03:00
d11b74007d . 2019-04-02 12:16:22 +03:00
45d5f3b130 . 2019-04-01 18:48:43 +03:00
25022ceecc XlsxFormat - ctrlProps 2019-04-01 18:25:53 +03:00
1a7476e465 x2t - XlsxFormat - fix bug #40316 - queryTables, connections, dataValidations 2019-03-31 17:19:47 +03:00
0edc2729e8 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-28 12:23:48 +03:00
d898f0ef2f OdfFormatW - ... 2019-03-27 18:35:33 +03:00
d51f004b11 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-27 13:49:34 +03:00
c645ed6aeb OdfFormatW - ... 2019-03-27 13:46:53 +03:00
79aa50d712 [x2t] Add OutlineLevelCol, OutlineLevelRow to Editor.bin 2019-03-25 19:56:24 +03:00
3dcb378de7 . 2019-03-25 19:24:44 +03:00
87c4ebe1d4 x2t - ... 2019-03-25 16:18:54 +03:00
fdef699b9b [ios][x2t] fixed build 2019-03-25 15:14:24 +03:00
498d58e856 x2t - ... 2019-03-25 13:50:29 +03:00
441aa277e3 XlsFormat - fixbug #40932 2019-03-25 13:15:18 +03:00
e8c314e535 . 2019-03-21 13:54:38 +03:00
12c8cf112a . 2019-03-21 13:51:57 +03:00
c9fb5cbe4d x2t - ... 2019-03-21 13:09:52 +03:00
8573513168 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-20 18:53:57 +03:00
4e337b5ef1 XlsFormat - fix user file 2019-03-20 18:49:38 +03:00
7e0e30d00f [x2t] Fix xlsx->Editor.bin conversion with invalid cell refs
<x:c r="2:1" instead of "B1"
2019-03-20 14:00:05 +03:00
72c4727a1e XlsFormat - fix bug #40895 2019-03-20 12:54:00 +03:00
29c197f383 XlsFormat - fix bug #40879 2019-03-19 19:49:40 +03:00
c07bd58bda XlsFormat -... 2019-03-18 19:58:20 +03:00
ae9a7f7fad [zlib] Fix 7-zip Warning: Headers error
Problem in header field: "last mod file date".
tm_sec = tm_min = tm_hour = tm_mday = tm_mon = tm_year = 0; is considered as 0 Jan 1980 (0x00200000 in file)
default value of tm_mon should be -1 (zip64local_TmzDateToDosDate tm_mon+1)
2019-03-15 19:26:57 +03:00
1157d6f97f . 2019-03-15 17:27:25 +03:00
5483547ee7 . 2019-03-15 15:47:26 +03:00
b9608771a9 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-15 14:51:35 +03:00
b3d219ef58 . 2019-03-15 14:50:29 +03:00
46a6e35a35 . 2019-03-15 14:48:53 +03:00
cfea717d20 XlsxFormat - dataValidation (+x14) 2019-03-14 19:53:11 +03:00
ae45b240a3 XlsFormat - ... 2019-03-14 19:44:37 +03:00
0ec79f2c2d . 2019-03-14 13:46:42 +03:00
6f0d22c3a4 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-14 12:06:08 +03:00
8d074cadf8 OdfFormatReader - ... 2019-03-14 12:04:44 +03:00
4a3b56d0d5 OdfFormatReader - .. 2019-03-14 12:03:22 +03:00
195e9079db Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-13 19:09:19 +03:00
8e8fd1096f . 2019-03-13 19:07:50 +03:00
b60811fd0d DocxFormat - read/write ooxml chart_ex 2019-03-13 16:30:09 +03:00
9eb82fa85e DocFormatReader - fix bug #40841 2019-03-13 14:06:10 +03:00
6d6cbd51c3 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-12 15:50:06 +03:00
9e0ff699aa . 2019-03-12 15:48:57 +03:00
9c1b107998 Merge remote-tracking branch 'origin/release/v5.3.0' into develop 2019-03-07 18:31:50 +03:00
c0d38c97f8 DocFormat - fix bug #40798 2019-03-07 18:30:28 +03:00
f2e003b12c [ios][pe] spellcheck 2019-03-07 18:15:22 +03:00
ee43592691 OdfFormatReader - chart user shapes from odf chart group 2019-03-06 19:02:38 +03:00
a1b2979f0f . 2019-03-05 18:46:37 +03:00
00328e88b2 [ios] spellcheck 2019-03-05 17:27:02 +03:00
ed2878a8cc . 2019-03-05 12:14:31 +03:00
bc18304827 OdfFormatReader .. 2019-03-04 12:25:20 +03:00
8d59eeabd5 . 2019-03-04 11:52:21 +03:00
df894c0193 Fix build 2019-03-01 13:11:27 +03:00
655c393a1b Add videoplayerlib 2019-03-01 12:23:08 +03:00
06b25e1cc6 . 2019-02-28 19:54:49 +03:00
e4ed9cade7 [x2t] Fix convertion to json 2019-02-28 18:02:48 +03:00
47dc96ba3c [ios][x2t] up formats 2019-02-28 17:32:20 +03:00
3c4154b3ac x2t - refactoring for build 2019-02-28 16:56:37 +03:00
455c8b3836 [ios][x2t] up formats 2019-02-28 15:08:17 +03:00
a9252192e8 x2t - fix bug #40731 2019-02-28 11:52:08 +03:00
e31f101021 x2t - refactoring build 2019-02-27 16:11:08 +03:00
f34660291a Add param to base.pri 2019-02-27 15:53:21 +03:00
cebfe04802 . 2019-02-27 13:10:46 +03:00
746490cea1 . 2019-02-27 12:55:30 +03:00
18df04b508 [ios][x2t] up formats 2019-02-27 12:01:43 +03:00
0bd1fb972f OdfFormatWriter - group color to shapes 2019-02-27 11:06:46 +03:00
7b92c7d079 [ios][x2t] up formats 2019-02-26 19:42:39 +03:00
7e3aebe79c split docx format build 2019-02-25 16:49:56 +03:00
34fc112d0e DocFormat - fix user file 2019-02-25 14:22:42 +03:00
2d219d5a74 PptxFormat - fix bug #40690 2019-02-22 16:44:47 +03:00
9d30e3ecab XlsxFormat - connections & query tables 2019-02-22 16:44:06 +03:00
c6de9b9e52 [x2t] Add GradientFill to Editor.bin 2019-02-22 16:04:40 +03:00
affc65c679 [ios][x2t] up formats 2019-02-21 17:34:38 +03:00
2cff8d9804 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-02-21 14:58:47 +03:00
28f8de794f . 2019-02-21 14:58:36 +03:00
daac90f8dc OdfFormatWriter - fix bullet char 2019-02-21 14:57:11 +03:00
30adbb0a24 . 2019-02-21 14:53:21 +03:00
94e59cfc82 [ios][x2t] up formats 2019-02-20 18:59:27 +03:00
9794d714d3 OdfFormat -fix table content 2019-02-20 16:07:37 +03:00
8d80005bab . 2019-02-19 19:46:37 +03:00
a4d22be862 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-02-19 14:26:12 +03:00
3f615c2ece XlsxFormat - condit.format ext with dxf 2019-02-19 14:24:47 +03:00
95e1a1edf9 [x2t] Fix typo 2019-02-19 12:06:13 +03:00
f7f9346286 Enable curl/wget external downloaders in linux/ (remove dependency to libcurl by default) 2019-02-19 11:35:56 +03:00
c0c6baf636 XlsxFormat - read/write iconSet ext 2019-02-18 19:24:00 +03:00
ccbc044f11 . 2019-02-18 17:38:05 +03:00
a8668df5fd XlsxFormat - read/write dataBar ext 2019-02-18 12:52:55 +03:00
cc228f3393 XlsxFormat - read/write ext conditional formating 2019-02-18 11:25:09 +03:00
19904acd30 XlsFormat - fix bug #40601 2019-02-15 18:02:02 +03:00
30d175144a . 2019-02-15 11:14:23 +03:00
acf15abe41 XlsxFormat - add threaded comments 2019-02-13 18:38:25 +03:00
5a7fc7f548 Skip build error for tests 2019-02-13 16:11:50 +03:00
e7326556e0 PptFormat - fix bug #40393 2019-02-13 14:29:21 +03:00
c589d8fe8a [ios][x2t] up formats 2019-02-13 13:59:04 +03:00
a28e8f1357 [ios][x2t] up formats 2019-02-13 13:48:07 +03:00
8b7bb944bc Rework GM_Compatible mode, fix bug with flipped images, fix bug with storing matrix transform for the clip 2019-02-12 17:51:05 +03:00
14ee946069 . 2019-02-12 17:30:58 +03:00
7aebdd8ec5 . 2019-02-12 17:15:07 +03:00
977baafc03 x2t - fix bug #40531 2019-02-12 16:22:41 +03:00
31b854bc70 [x2t] Add decimalSymbol, listSeparator to Editor.bin 2019-02-12 12:20:47 +03:00
564b7f9c29 v5.2.8 2019-02-05 16:23:16 +03:00
1119 changed files with 111586 additions and 61891 deletions

9
.gitignore vendored
View File

@ -5,11 +5,14 @@ Common/boost_1_58_0
Common/3dParty/boost/boost_1_58_0
Common/3dParty/boost/ios
Common/3dParty/boost/osx
Common/3dParty/icu/icu
Common/3dParty/icu/win_64
Common/3dParty/icu/win_32
Common/3dParty/icu/linux_64
Common/3dParty/icu/linux_32
Common/3dParty/icu/mac_64
Common/3dParty/icu/ios
Common/3dParty/icu/mac-build
Common/3dParty/cef/win_64
Common/3dParty/cef/win_32
Common/3dParty/cef/linux_64
@ -44,6 +47,7 @@ Common/3dParty/openssl/openssl
Thumbs.db
*.xcuserstate
*.xcuserdatad
**/Makefile.*
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2.idl
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2.tlb
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2.h
@ -51,7 +55,6 @@ ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_i.c
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_p.c
ASCOfficeXlsFile2/win32/dlldata.c
OfficeUtils/win32/OfficeUtilsLib/OfficeUtilsLib/ReadMe.txt
X2tConverter/**/Makefile.*
X2tConverter/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/Makefile
X2tConverter/Common/DocxFormat/DocxFormatLib/Makefile
*.7z
@ -63,4 +66,6 @@ X2tConverter/Common/DocxFormat/DocxFormatLib/Makefile
*.zip
*.tar.gz
**/*.build/
*.dat
*.txt
*.log

View File

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

View File

@ -641,7 +641,7 @@ namespace DocFileFormat
}
}
else
{
{
std::string sCodePage;
std::map<int, std::string>::const_iterator pFind = NSUnicodeConverter::mapEncodingsICU.find(code_page);
if (pFind != NSUnicodeConverter::mapEncodingsICU.end())
@ -653,7 +653,7 @@ namespace DocFileFormat
sCodePage = "CP1250"/* + std::to_string(code_page)*/;
NSUnicodeConverter::CUnicodeConverter oConverter;
std::wstring unicode_string = oConverter.toUnicode((char*)bytes, size, sCodePage.c_str());
std::wstring unicode_string = oConverter.toUnicode((char*)bytes, (unsigned int)size, sCodePage.c_str());
for (size_t i = 0; i < unicode_string.size(); i++)
{
@ -769,12 +769,18 @@ namespace DocFileFormat
return bytes;
}
static inline std::wstring IntToWideString(int value)
static inline std::wstring IntToWideString(unsigned int value)
{
return (std::to_wstring(value));
}
static inline std::wstring IntToWideString(int value)
{
return (std::to_wstring(value));
}
static inline std::wstring SizeTToWideString(size_t value)
{
return (std::to_wstring((unsigned int)value));
}
static inline std::wstring DoubleToWideString(double value)
{
std::wstringstream src;

View File

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

View File

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

View File

@ -32,6 +32,7 @@
#pragma once
#include "ByteStructure.h"
#include "DateAndTime.h"
namespace DocFileFormat
{
@ -46,7 +47,7 @@ namespace DocFileFormat
return (nWordVersion > 0) ? STRUCTURE_SIZE_OLD : STRUCTURE_SIZE;
}
AnnotationReferenceDescriptor() : m_AuthorIndex(0), m_BookmarkId(0)
AnnotationReferenceDescriptor() : m_AuthorIndex(0), m_BookmarkId(0), m_CommentId(-1)
{
}
@ -59,32 +60,28 @@ namespace DocFileFormat
std::wstring m_UserInitials;
unsigned short m_AuthorIndex;
int m_BookmarkId;
int m_CommentId;
};
class AnnotationReferenceExDescriptor: public ByteStructure
class AnnotationReferenceExDescriptors
{
public:
static const int STRUCTURE_SIZE = 18;
static const int STRUCTURE_SIZE_OLD = 0;
AnnotationReferenceExDescriptors(size_t count, POLE::Stream* stream, unsigned int fc, unsigned int lcb);
static const int GetSize(int nWordVersion)
{
return (nWordVersion > 0) ? STRUCTURE_SIZE_OLD : STRUCTURE_SIZE;
}
AnnotationReferenceExDescriptor() : m_nDTTM(0), m_nDepth(0), m_nDiatrdParent(0), m_fInkAtn(false)
virtual ~AnnotationReferenceExDescriptors()
{
}
virtual ~AnnotationReferenceExDescriptor()
//virtual ByteStructure* ConstructObject( VirtualStreamReader* reader, int length );
struct _desc
{
}
DateAndTime nDTTM;
unsigned int nDepth = 0;
int nDiatrdParent = 0;
bool fInkAtn = false;
};
virtual ByteStructure* ConstructObject( VirtualStreamReader* reader, int length );
unsigned int m_nDTTM;
unsigned int m_nDepth;
unsigned int m_nDiatrdParent;
bool m_fInkAtn;
std::vector<_desc> m_ReferencesEx;
};
}

View File

@ -85,9 +85,11 @@ namespace DocFileFormat
if (author_str)
{
XMLTools::XMLAttribute author( L"w:author", FormatUtils::XmlEncode(*author_str));
XMLTools::XMLAttribute author( L"w:author", FormatUtils::XmlEncode(*author_str));
rPrChange.AppendAttribute( author );
}
XMLTools::XMLAttribute date( L"w:date", _revisionData->Dttm.getString());
rPrChange.AppendAttribute( date );
//convert revision stack
convertSprms( _revisionData->Changes, &rPrChange );

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -61,7 +61,7 @@ namespace DocFileFormat
DocumentMapping::DocumentMapping(ConversionContext* context, XMLTools::CStringXmlWriter* writer, IMapping* caller):_skipRuns(0), _lastValidPapx(NULL), _lastValidSepx(NULL),
AbstractOpenXmlMapping(writer), _sectionNr(0), _footnoteNr(0), _endnoteNr(0),
_commentNr(0), _caller(caller)
_commentNr(1), _caller(caller)
{
m_document = NULL;
m_context = context;
@ -217,6 +217,11 @@ namespace DocFileFormat
// start paragraph
m_pXmlWriter->WriteNodeBegin(L"w:p", true);
if (false == _paraId.empty())
{
m_pXmlWriter->WriteAttribute(L"w14:paraId", _paraId);
}
writeParagraphRsid(papx);
// ----------- check for section properties
@ -369,7 +374,7 @@ namespace DocFileFormat
if (DocFileFormat::sprmPRsid == iter->OpCode)
{
std::wstring id = FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize), L"%08x");
std::wstring id = FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize), L"%08X");
m_context->AddRsid(id);
m_pXmlWriter->WriteAttribute(L"w:rsidP", id);
@ -406,8 +411,8 @@ namespace DocFileFormat
//if it's a inserted run
m_pXmlWriter->WriteNodeBegin(L"w:ins", true);
m_pXmlWriter->WriteAttribute(L"w:author", FormatUtils::XmlEncode(*author));
m_pXmlWriter->WriteAttribute(L"w:date", FormatUtils::XmlEncode(rev.Dttm.getString()));
m_pXmlWriter->WriteNodeEnd(L"", true, false);
//rev.Dttm.Convert(new DateMapping(m_pXmlWriter));
}
//start run
@ -416,21 +421,21 @@ namespace DocFileFormat
//append rsids
if (0 != rev.Rsid)
{
std::wstring rsid = FormatUtils::IntToFormattedWideString(rev.Rsid, L"%08x");
std::wstring rsid = FormatUtils::IntToFormattedWideString(rev.Rsid, L"%08X");
m_pXmlWriter->WriteAttribute(L"w:rsidR", rsid);
m_context->AddRsid(rsid);
}
if (0 != rev.RsidDel)
{
std::wstring rsidDel = FormatUtils::IntToFormattedWideString(rev.RsidDel, L"%08x");
std::wstring rsidDel = FormatUtils::IntToFormattedWideString(rev.RsidDel, L"%08X");
m_pXmlWriter->WriteAttribute(L"w:rsidDel", rsidDel);
m_context->AddRsid(rsidDel);
}
if (0 != rev.RsidProp)
{
std::wstring rsidProp = FormatUtils::IntToFormattedWideString(rev.RsidProp, L"%08x");
std::wstring rsidProp = FormatUtils::IntToFormattedWideString(rev.RsidProp, L"%08X");
m_pXmlWriter->WriteAttribute(L"w:rsidRPr", rsidProp);
m_context->AddRsid(rsidProp);
}
@ -716,7 +721,7 @@ namespace DocFileFormat
RELEASEOBJECT( chpxs );
}
}
oleWriter.WriteString( _lastOLEObject );
oleWriter.WriteString( _lastOLEObject ); _lastOLEObject.clear();
oleWriter.WriteNodeEnd( L"w:object" );
if (!oVmlMapper.m_isEmbedded && oVmlMapper.m_isEquation)
@ -800,8 +805,9 @@ namespace DocFileFormat
}
}
XMLTools::XMLElement elem(L"w:br");
elem.AppendAttribute(L"w:type", L"textWrapping");
elem.AppendAttribute(L"w:clear", L"all");
//СЗ в МРФ Техноград о предоставлении ТП 1 квартал 2019_MO_Q31.doc
//elem.AppendAttribute(L"w:type", L"textWrapping");
//elem.AppendAttribute(L"w:clear", L"all");
m_pXmlWriter->WriteString(elem.GetXMLString());
}
@ -892,12 +898,16 @@ namespace DocFileFormat
}
else if ((TextMark::Symbol == code) && fSpec)
{
writeNotesReferences(cp);//for word95 & non-automatic notes
Symbol s = getSymbol( chpx );
//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);
//<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);
}
else if ((TextMark::DrawnObject == code) && fSpec)
{
@ -912,6 +922,7 @@ namespace DocFileFormat
pSpa = static_cast<Spa*>(m_document->OfficeDrawingPlexHeader->GetStruct(headerCp));
}
bool bPicture = false;
if (pSpa)
{
PictureDescriptor pictDiscr(chpx, m_document->WordDocumentStream, 0x7fffffff, m_document->nWordVersion);
@ -925,6 +936,8 @@ namespace DocFileFormat
pShape->Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (L"w:pict");
bPicture = true;
}
if (!pSpa->primitives.empty())
@ -933,8 +946,13 @@ namespace DocFileFormat
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, &pictDiscr, _caller);
pSpa->primitives.Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (L"w:pict");
bPicture = true;
}
}
if ((false == _fieldLevels.empty()) && (_fieldLevels.back().bSeparate))
_fieldLevels.back().bResult = bPicture;
}
else if (TextMark::Picture == code && fSpec)
{
@ -1004,49 +1022,30 @@ namespace DocFileFormat
oPicture.shapeContainer->Convert(&oVmlMapper);
}
pictWriter.WriteNodeEnd (L"w:pict");
pictWriter.WriteNodeEnd (L"w:pict");
if (!bFormula)
m_pXmlWriter->WriteString(pictWriter.GetXmlString());
{
if (false == _fieldLevels.empty())
{
if (_fieldLevels.back().bSeparate && !_fieldLevels.back().bResult) //ege15.doc
{
m_pXmlWriter->WriteString(pictWriter.GetXmlString());
_fieldLevels.back().bResult = true;
}
}
else
{
m_pXmlWriter->WriteString(pictWriter.GetXmlString());
}
}
}
}
}
else if ((TextMark::AutoNumberedFootnoteReference == code) && fSpec)
{
if ((m_document->FootnoteReferenceCharactersPlex != NULL) && (m_document->FootnoteReferenceCharactersPlex->IsCpExists(cp)))
{
m_pXmlWriter->WriteNodeBegin( L"w:footnoteReference", true );
FootnoteDescriptor* desc = dynamic_cast<FootnoteDescriptor*>(m_document->FootnoteReferenceCharactersPlex->Elements[_footnoteNr]);
if (desc && desc->aFtnIdx == 0)
{
m_pXmlWriter->WriteAttribute( L"w:customMarkFollows", L"1");
}
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString(_footnoteNr++ ) );
m_pXmlWriter->WriteNodeEnd( L"", true );
}
else if ((m_document->IndividualFootnotesPlex != NULL) && (m_document->IndividualFootnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpText)))
{
m_pXmlWriter->WriteNodeBegin( L"w:footnoteRef", true );
m_pXmlWriter->WriteNodeEnd( L"", true );
}
else if ((m_document->EndnoteReferenceCharactersPlex != NULL) && (m_document->EndnoteReferenceCharactersPlex->IsCpExists(cp)))
{
m_pXmlWriter->WriteNodeBegin( L"w:endnoteReference", true );
EndnoteDescriptor* desc = dynamic_cast<EndnoteDescriptor*>(m_document->EndnoteReferenceCharactersPlex->Elements[_endnoteNr]);
if (desc && desc->aEndIdx == 0)
{
m_pXmlWriter->WriteAttribute( L"w:customMarkFollows", L"1");
}
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString(_endnoteNr++ ));
m_pXmlWriter->WriteNodeEnd( L"", true );
}
else if ((m_document->IndividualEndnotesPlex != NULL) &&
(m_document->IndividualEndnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpAtn - m_document->FIB->m_RgLw97.ccpHdr - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpText)))
{
m_pXmlWriter->WriteNodeBegin( L"w:endnoteRef", true );
m_pXmlWriter->WriteNodeEnd( L"", true );
}
writeNotesReferences(cp);
}
else if (TextMark::AnnotationReference == code)
{
@ -1055,15 +1054,44 @@ namespace DocFileFormat
m_pXmlWriter->WriteNodeBegin( L"w:annotationRef", true );
m_pXmlWriter->WriteNodeEnd( L"", true );
}
else if ((m_document->AnnotationsReferencePlex) && (_commentNr <= m_document->AnnotationsReferencePlex->Elements.size()))
else if (m_document->AnnotationsReferencePlex)
{
m_pXmlWriter->WriteNodeBegin( L"w:commentReference", true );
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( _commentNr++ ));
AnnotationReferenceDescriptor* atrdPre10 = dynamic_cast<AnnotationReferenceDescriptor*>( m_document->AnnotationsReferencePlex->GetStruct(cp));
if (atrdPre10)
{
if (atrdPre10->m_CommentId < 0)
{
if (atrdPre10->m_BookmarkId < 0)
{
atrdPre10->m_CommentId = _commentNr++;
}
else
{
std::map<int, int>::iterator pFind = m_document->mapCommentsBookmarks.find(atrdPre10->m_BookmarkId);
if (pFind == m_document->mapCommentsBookmarks.end())
{
atrdPre10->m_CommentId = _commentNr++;
m_document->mapCommentsBookmarks.insert(std::make_pair(atrdPre10->m_BookmarkId, atrdPre10->m_CommentId));
}
else
{
atrdPre10->m_CommentId = pFind->second;
}
}
}
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString(atrdPre10->m_CommentId));
}
m_pXmlWriter->WriteNodeEnd( L"", true );
}
}
else if (!FormatUtils::IsControlSymbol(c) && ((int)c != 0xFFFF))
{
writeNotesReferences(cp);//for word95 & non-automatic notes
text += FormatUtils::GetXMLSymbol(c);
}
@ -1349,6 +1377,7 @@ namespace DocFileFormat
fEndNestingLevel = ( iter->Arguments[0] == 1 ) ? (true) : (false);
}break;
case sprmOldPFInTable:
case sprmPItap:
{
iTap_current = FormatUtils::BytesToUInt32( iter->Arguments, 0, iter->argumentsSize );
@ -1389,7 +1418,7 @@ namespace DocFileFormat
}
}
}
if (nestingLevel > 1 && fEndNestingLevel && !boundaries.empty())
if (nestingLevel != iTap_current && fEndNestingLevel && !boundaries.empty())
break;
//get the next papx
papx = findValidPapx( fcRowEnd );
@ -1735,7 +1764,51 @@ namespace DocFileFormat
return cpCellEnd;
}
bool DocumentMapping::writeNotesReferences(int cp)
{
if ((m_document->FootnoteReferenceCharactersPlex != NULL) && (m_document->FootnoteReferenceCharactersPlex->IsCpExists(cp)))
{
FootnoteDescriptor* desc = dynamic_cast<FootnoteDescriptor*>(m_document->FootnoteReferenceCharactersPlex->Elements[_footnoteNr]);
if ((desc) && (false == desc->bUsed))
{
desc->bUsed = true;
m_pXmlWriter->WriteNodeBegin( L"w:footnoteReference", true );
if (desc->aFtnIdx == 0)
{
m_pXmlWriter->WriteAttribute( L"w:customMarkFollows", L"1");
}
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString(_footnoteNr++ ) );
m_pXmlWriter->WriteNodeEnd( L"", true );
}
}
else if ((m_document->IndividualFootnotesPlex != NULL) && (m_document->IndividualFootnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpText)))
{
m_pXmlWriter->WriteNodeBegin( L"w:footnoteRef", true );
m_pXmlWriter->WriteNodeEnd( L"", true );
}
else if ((m_document->EndnoteReferenceCharactersPlex != NULL) && (m_document->EndnoteReferenceCharactersPlex->IsCpExists(cp)))
{
EndnoteDescriptor* desc = dynamic_cast<EndnoteDescriptor*>(m_document->EndnoteReferenceCharactersPlex->Elements[_endnoteNr]);
if ((desc) && (false == desc->bUsed))
{
desc->bUsed = true;
m_pXmlWriter->WriteNodeBegin( L"w:endnoteReference", true );
if (desc->aEndIdx == 0)
{
m_pXmlWriter->WriteAttribute( L"w:customMarkFollows", L"1");
}
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString(_endnoteNr++ ));
m_pXmlWriter->WriteNodeEnd( L"", true );
}
}
else if ((m_document->IndividualEndnotesPlex != NULL) &&
(m_document->IndividualEndnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpAtn - m_document->FIB->m_RgLw97.ccpHdr - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpText)))
{
m_pXmlWriter->WriteNodeBegin( L"w:endnoteRef", true );
m_pXmlWriter->WriteNodeEnd( L"", true );
}
return true;
}
bool DocumentMapping::writeBookmarks(int cp)
{
bool result = true;
@ -1762,16 +1835,32 @@ namespace DocFileFormat
for (size_t i = 0; i < m_document->AnnotStartEndCPs.size(); i++)
{
if (m_document->AnnotStartEndCPs[i].first == cp)
if (m_document->AnnotStartEndCPs[i].start == cp)
{
result = writeAnnotationStart(i + 1);
_commentNr = i + 1;
int index = -1;
std::map<int, int>::iterator pFind = m_document->mapCommentsBookmarks.find(m_document->AnnotStartEndCPs[i].bookmarkId);
if (pFind == m_document->mapCommentsBookmarks.end())
{
index = _commentNr++;
m_document->mapCommentsBookmarks.insert(std::make_pair(m_document->AnnotStartEndCPs[i].bookmarkId, index ));
}
else index = pFind->second;
result = writeAnnotationStart(index);
}
if (m_document->AnnotStartEndCPs[i].second == cp)
if (m_document->AnnotStartEndCPs[i].end == cp)
{
result = writeAnnotationEnd(i + 1);
_commentNr = i + 1;
int index = -1;
std::map<int, int>::iterator pFind = m_document->mapCommentsBookmarks.find(m_document->AnnotStartEndCPs[i].bookmarkId);
if (pFind == m_document->mapCommentsBookmarks.end())
{
index = _commentNr++;
m_document->mapCommentsBookmarks.insert(std::make_pair(m_document->AnnotStartEndCPs[i].bookmarkId, index ));
}
else index = pFind->second;
result = writeAnnotationEnd(index);
}
}
@ -1878,7 +1967,7 @@ namespace DocFileFormat
FontFamilyName* ffn = static_cast<FontFamilyName*>( m_document->FontTable->operator [] ( fontIndex ) );
ret.FontName = ffn->xszFtn;
ret.HexValue = FormatUtils::IntToFormattedWideString( code, L"%04x" );
ret.HexValue = FormatUtils::IntToFormattedWideString( code, L"%04X" );
break;
}

View File

@ -121,6 +121,8 @@ namespace DocFileFormat
bool writeBookmarkStart ( short id );
bool writeBookmarkEnd ( short id );
bool writeNotesReferences(int cp);
bool writeAnnotations ( int cp );
bool writeAnnotationStart( short id );
bool writeAnnotationEnd ( short id );
@ -156,11 +158,14 @@ namespace DocFileFormat
std::wstring _writeAfterRun;
std::wstring _lastOLEObject;
int _cacheListNum;
std::wstring _paraId;
struct fieldLevels
{
bool bBegin = false;
bool bSeparate = false;
bool bResult = false;
//bool bInstrText = false;
bool bEnd = false;
};

View File

@ -40,7 +40,7 @@ namespace DocFileFormat
public:
static const int STRUCTURE_SIZE = 2;
EndnoteDescriptor(): aEndIdx(0) {}
EndnoteDescriptor(): aEndIdx(0), bUsed(false) {}
virtual ~EndnoteDescriptor()
{
@ -54,6 +54,7 @@ namespace DocFileFormat
return static_cast<ByteStructure*>( newObject );
}
bool bUsed;
short aEndIdx;
};
}

View File

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

View File

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

View File

@ -41,7 +41,7 @@ namespace DocFileFormat
public:
static const int STRUCTURE_SIZE = 2;
FootnoteDescriptor() : aFtnIdx(0) {}
FootnoteDescriptor() : aFtnIdx(0), bUsed(false) {}
virtual ~FootnoteDescriptor()
{
@ -56,5 +56,6 @@ namespace DocFileFormat
}
short aFtnIdx;
bool bUsed;
};
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -92,12 +92,12 @@ namespace DocFileFormat
{
//start abstractNum
m_pXmlWriter->WriteNodeBegin( L"w:abstractNum", TRUE );
m_pXmlWriter->WriteAttribute( L"w:abstractNumId", FormatUtils::IntToWideString( i /*+ 1 */));
m_pXmlWriter->WriteAttribute( L"w:abstractNumId", FormatUtils::SizeTToWideString( i /*+ 1 */));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
//nsid
m_pXmlWriter->WriteNodeBegin( L"w:nsid", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( rglst->listData[i]->lsid, L"%08x" ));
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( rglst->listData[i]->lsid, L"%08X" ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
//multiLevelType
@ -120,7 +120,7 @@ namespace DocFileFormat
//template
m_pXmlWriter->WriteNodeBegin( L"w:tmpl", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( rglst->listData[i]->tplc, L"%08x"));
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( rglst->listData[i]->tplc, L"%08X"));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
// writes the levels
@ -140,7 +140,7 @@ namespace DocFileFormat
{
//start abstractNum
m_pXmlWriter->WriteNodeBegin( L"w:abstractNum", TRUE );
m_pXmlWriter->WriteAttribute( L"w:abstractNumId", FormatUtils::IntToWideString( rglst->listNumbering[i]->id ));
m_pXmlWriter->WriteAttribute( L"w:abstractNumId", FormatUtils::SizeTToWideString( rglst->listNumbering[i]->id ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
////nsid
@ -169,7 +169,7 @@ namespace DocFileFormat
//start num
m_pXmlWriter->WriteNodeBegin( L"w:num", TRUE );
m_pXmlWriter->WriteAttribute( L"w:numId", FormatUtils::IntToWideString(i + 1));
m_pXmlWriter->WriteAttribute( L"w:numId", FormatUtils::SizeTToWideString(i + 1));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
int index = FindIndexbyId( rglst->listData, lfo->lsid );
@ -205,12 +205,12 @@ namespace DocFileFormat
for (size_t i = 0; i < rglst->listNumbering.size(); ++i)
{
m_pXmlWriter->WriteNodeBegin( L"w:num", TRUE );
m_pXmlWriter->WriteAttribute( L"w:numId", FormatUtils::IntToWideString(rglst->listNumbering[i]->id));
m_pXmlWriter->WriteAttribute( L"w:numId", FormatUtils::SizeTToWideString(rglst->listNumbering[i]->id));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:abstractNumId", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString( rglst->listNumbering[i]->id ));
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::SizeTToWideString( rglst->listNumbering[i]->id ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
m_pXmlWriter->WriteNodeEnd(L"w:num");
@ -285,7 +285,7 @@ namespace DocFileFormat
newResult = find_if((result + 1), lvl->xst.end(), &NumberingMapping::IsPlaceholder);
ret += L"%";
ret += FormatUtils::IntToWideString(*result + 1);
ret += FormatUtils::SizeTToWideString(*result + 1);
ret += std::wstring((result + 1), newResult);
result = newResult;
}
@ -540,17 +540,24 @@ namespace DocFileFormat
m_pXmlWriter->WriteNodeEnd(L"w:pPr");
// rPr
m_pXmlWriter->WriteNodeBegin( L"w:rPr", FALSE );
if (!fontFamily.empty())
if (false == lvl->rPr.empty())
{
m_pXmlWriter->WriteNodeBegin( L"w:rFonts", TRUE );
// w:hint="default"
m_pXmlWriter->WriteAttribute(L"w:hAnsi",fontFamily);
m_pXmlWriter->WriteAttribute(L"w:ascii",fontFamily);
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
m_pXmlWriter->WriteString( lvl->rPr );
}
else
{
m_pXmlWriter->WriteNodeBegin( L"w:rPr", FALSE );
if (!fontFamily.empty())
{
m_pXmlWriter->WriteNodeBegin( L"w:rFonts", TRUE );
// w:hint="default"
m_pXmlWriter->WriteAttribute(L"w:hAnsi", fontFamily);
m_pXmlWriter->WriteAttribute(L"w:ascii", fontFamily);
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
}
m_pXmlWriter->WriteNodeEnd(L"w:rPr");
}
m_pXmlWriter->WriteNodeEnd(L"w:rPr");
m_pXmlWriter->WriteNodeEnd(L"w:lvl");
}
@ -702,7 +709,7 @@ namespace DocFileFormat
}
}
if (isPictureBullet)
if (isPictureBullet && false == m_document->PictureBulletsCPsMap.empty())
{
m_pXmlWriter->WriteNodeBegin(L"w:lvlPicBulletId",TRUE);
m_pXmlWriter->WriteAttribute(L"w:val",FormatUtils::IntToWideString(index));

View File

@ -89,7 +89,7 @@ namespace DocFileFormat
GroupContainer* group = static_cast<GroupContainer*>(groupChild);
if (group)
{
group->Index = i;
group->Index = (int)i;
}
}
else if (ShapeContainer::TYPE_CODE_0xF004 == groupChild->TypeCode)

View File

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

View File

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

View File

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

View File

@ -85,19 +85,19 @@ namespace DocFileFormat
struct ImageFileStructure
{
ImageFileStructure()
ImageFileStructure(const std::wstring& _ext, boost::shared_array<unsigned char> _data, unsigned int _size, Global::BlipType _blipType = Global::msoblipUNKNOWN) : ext(_ext), data(_data), size(_size), blipType(_blipType)
{
}
ImageFileStructure(const std::wstring& _ext, const std::vector<unsigned char>& _data, Global::BlipType _blipType = Global::msoblipUNKNOWN) : ext(_ext), data(_data), blipType(_blipType)
ImageFileStructure(const std::wstring& _ext, unsigned char* _data, unsigned int _size, Global::BlipType _blipType = Global::msoblipUNKNOWN) : ext(_ext), size(_size), blipType(_blipType)
{
data = boost::shared_array<unsigned char>(new unsigned char[size]);
memcpy(data.get(), _data, size);
}
std::wstring ext;
std::vector<unsigned char> data;
Global::BlipType blipType;
std::wstring ext;
boost::shared_array<unsigned char> data;
unsigned int size;
Global::BlipType blipType;
};
struct OleObjectFileStructure
@ -176,6 +176,7 @@ namespace DocFileFormat
int RegisterFootnotes();
int RegisterEndnotes();
int RegisterComments();
int RegisterCommentsExtended();
int RegisterImage ( const IMapping* mapping, Global::BlipType blipType );
int RegisterHyperlink ( const IMapping* mapping, const std::wstring& link);
int RegisterOLEObject ( const IMapping* mapping, const std::wstring& objectType );

View File

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

View File

@ -33,6 +33,8 @@
#include "PictureDescriptor.h"
#include "OfficeDrawing/MetafilePictBlip.h"
#include "../../DesktopEditor/raster/BgraFrame.h"
#ifndef MM_ISOTROPIC
#define MM_ISOTROPIC 7
#endif
@ -41,6 +43,122 @@
#define MM_ANISOTROPIC 8
#endif
namespace ImageHelper
{
Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, std::wstring& file_name)//without ext
{
Global::_BlipType result = Global::msoblipERROR;
CBgraFrame oFrame;
int offset = 0, biSizeImage = 0;
__BITMAPINFOHEADER * header = (__BITMAPINFOHEADER*)data;
if (!header) return result;
result = Global::msoblipDIB;
if (header->biWidth > 100000 || header->biHeight > 100000 || header->biSize != 40)
{
__BITMAPCOREHEADER * header_core = (__BITMAPCOREHEADER *)data;
if (header_core->bcSize != 12)
{
result = Global::msoblipWMF;
}
else
{
offset = 12; //sizeof(BITMAPCOREHEADER)
oFrame.put_Height (header_core->bcHeight );
oFrame.put_Width (header_core->bcWidth );
int sz_bitmap = header_core->bcHeight * header_core->bcWidth * header_core->bcBitCount/ 8;
//if (header_core->bcWidth % 2 != 0 && sz_bitmap < size - offset)
// header_core->bcWidth++;
///???? todooo непонятно .. в biff5 нужно флипать картинку, в biff8 не ясно ( -
int stride = -(size - offset) / header_core->bcHeight;
oFrame.put_Stride (stride/*header_core->bcBitCount * header_core->bcWidth /8 */);
biSizeImage = size - offset;
if (-stride >= header_core->bcWidth && header_core->bcBitCount >=24 )
{
result = Global::msoblipPNG;
}
}
}
else
{
offset = 40; //sizeof(BITMAPINFOHEADER)
oFrame.put_Height (header->biHeight );
oFrame.put_Width (header->biWidth );
int sz_bitmap = header->biHeight * header->biWidth * header->biBitCount/ 8;
//if (header->biWidth % 2 != 0 && sz_bitmap < size -offset)
// header->biWidth++;
if (header->biClrUsed > 0)
{
oFrame.put_Palette((unsigned char*)data + offset, header->biClrUsed);
offset += header->biClrUsed * 4;
}
int stride = -(size - offset) / header->biHeight;
if (-stride >= header->biWidth/* && header->biBitCount >= 24*/)
{
result = Global::msoblipPNG;
}
oFrame.put_Stride(stride);
biSizeImage = header->biSizeImage > 0 ? header->biSizeImage : (size - offset);
}
//------------------------------------------------------------------------------------------
if (result == Global::msoblipPNG)
{
oFrame.put_Data((unsigned char*)data + offset);
file_name += L".png";
if (!oFrame.SaveFile(file_name, 4/*CXIMAGE_FORMAT_PNG*/))
{
result = Global::msoblipDIB;
}
oFrame.put_Data(NULL);
}
else if (result == Global::msoblipWMF)
{
file_name += L".wmf";
NSFile::CFileBinary file;
if (file.CreateFileW(file_name))
{
file.WriteFile((BYTE*)data, size);
file.CloseFile();
}
}
if (biSizeImage > 0 && result == Global::msoblipDIB)
{
file_name += L".bmp";
NSFile::CFileBinary file;
if (file.CreateFileW(file_name))
{
_UINT16 vtType = 0x4D42; file.WriteFile((BYTE*)&vtType, 2);
_UINT32 dwLen = biSizeImage; file.WriteFile((BYTE*)&dwLen, 4);
_UINT32 dwRes = 0; file.WriteFile((BYTE*)&dwRes, 4);
_UINT32 dwOffset = 2; file.WriteFile((BYTE*)&dwOffset, 4);
file.WriteFile((BYTE*)data, size);
file.CloseFile();
}
}
return result;
}
}
namespace DocFileFormat
{
/// Parses the CHPX for a fcPic an loads the PictureDescriptor at this offset

View File

@ -134,3 +134,34 @@ namespace DocFileFormat
int embeddedDataSize;
};
}
namespace ImageHelper
{
struct __BITMAPINFOHEADER
{
_UINT32 biSize;
_INT32 biWidth;
_INT32 biHeight;
_UINT16 biPlanes;
_UINT16 biBitCount;
_UINT32 biCompression;
_UINT32 biSizeImage;
_INT32 biXPelsPerMeter;
_INT32 biYPelsPerMeter;
_UINT32 biClrUsed;
_UINT32 biClrImportant;
};
struct __BITMAPCOREHEADER
{
_UINT32 bcSize; /* used to get to color table */
_UINT16 bcWidth;
_UINT16 bcHeight;
_UINT16 bcPlanes;
_UINT16 bcBitCount;
};
Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, std::wstring& file_name);
}

View File

@ -259,6 +259,12 @@ namespace DocFileFormat
//compatibility settings
m_oXmlWriter.WriteNodeBegin( L"w:compat" );
m_oXmlWriter.WriteNodeBegin( L"w:compatSetting", TRUE);
m_oXmlWriter.WriteAttribute( L"w:name", L"compatibilityMode" );
m_oXmlWriter.WriteAttribute( L"w:uri", L"http://schemas.microsoft.com/office/word" );
m_oXmlWriter.WriteAttribute( L"w:val", L"11" );
m_oXmlWriter.WriteNodeEnd( L"", TRUE );
//some settings must always be written
if ( dop->fUseNormalStyleForList )

View File

@ -55,32 +55,45 @@ namespace DocFileFormat
std::vector<ByteStructure*> Data;
std::vector<unsigned char*> DataExtra;
int code_page;
public:
virtual ~StringTable()
{
for ( std::vector<ByteStructure*>::iterator iter = this->Data.begin(); iter != this->Data.end(); iter++ )
for ( size_t i = 0; i < this->Data.size(); ++i )
{
RELEASEOBJECT( *iter );
RELEASEOBJECT( this->Data[i] );
if (false == this->DataExtra.empty())
{
if (this->DataExtra[i])
{
delete []this->DataExtra[i];
this->DataExtra[i] = NULL;
}
}
}
}
StringTable( VirtualStreamReader *reader, int code_page_ ):
code_page(code_page_), fExtend(false), cbData(0), cbExtra(0)
code_page(code_page_), fExtend(false), cbData(0), cbExtra(0), DataExtra(NULL)
{
parse( reader, (unsigned int)reader->GetPosition() );
parse( reader, (unsigned int)reader->GetPosition(), 0, false );
}
StringTable( POLE::Stream* tableStream, unsigned int fc, unsigned int lcb, int nWordVersion ) :
code_page(1250), fExtend(false), cbData(0), cbExtra(0)
StringTable( POLE::Stream* tableStream, unsigned int fc, unsigned int lcb, int nWordVersion, bool bReadExta = false) :
code_page(1250), fExtend(false), cbData(0), cbExtra(0), DataExtra(NULL)
{
if ( lcb > 0 )
{
VirtualStreamReader reader( tableStream, fc, nWordVersion);
parse( &reader, fc, lcb ) ;
parse( &reader, fc, lcb, bReadExta ) ;
}
}
std::vector<unsigned char*> & getDataExtra() {return DataExtra;}
unsigned short getDataExtraSize() {return cbExtra;}
ByteStructure* operator [] ( size_t index ) const
{
@ -96,7 +109,7 @@ namespace DocFileFormat
private:
void parse( VirtualStreamReader *reader, unsigned int fc, unsigned int lcb = 0 )
void parse( VirtualStreamReader *reader, unsigned int fc, unsigned int lcb = 0, bool bReadExta = false )
{
if ( reader == NULL ) return;
if (fc > reader->GetSize()) return;
@ -191,8 +204,15 @@ namespace DocFileFormat
reader->Seek( (int)( posBeforeType + cbData ), 0/*STREAM_SEEK_SET */);
reader->ReadBytes( cbExtra, false );//skip the extra unsigned char
if (bReadExta)
{
unsigned char* pData = reader->ReadBytes( cbExtra, true );
DataExtra.push_back(pData);
}
else
{
reader->ReadBytes( cbExtra, false );
}
}
}
};

View File

@ -75,7 +75,7 @@ namespace DocFileFormat
void TableCellPropertiesMapping::Apply (IVisitable* visited)
{
TablePropertyExceptions* tapx = static_cast<TablePropertyExceptions*>(visited);
int nComputedCellWidth = 0;
int nComputedCellWidth = 0, nComputedCellWidths = 0;
_gridSpan = 0;
_bCoverCell = false;
@ -164,7 +164,11 @@ namespace DocFileFormat
else
{
_gridSpan = 1;
nComputedCellWidth += tdef.rgdxaCenter[ _cellIndex + 1] - tdef.rgdxaCenter[ _cellIndex ] ;
nComputedCellWidths += (tdef.rgdxaCenter[ _cellIndex + 1] - tdef.rgdxaCenter[ 0 ]);
nComputedCellWidth += tdef.rgTc80[ _cellIndex].wWidth > 1 ? tdef.rgTc80[ _cellIndex].wWidth : (tdef.rgdxaCenter[ _cellIndex + 1] - tdef.rgdxaCenter[ _cellIndex ]);
//Технические_Требования_1_287_ДИТ.DOC
}
if (!IsTableBordersDefined(tapx->grpprl))
@ -348,19 +352,22 @@ namespace DocFileFormat
tcW.AppendAttribute( tcWVal );
_tcPr->AppendChild( tcW );
int nComputedCellWidthsGrid = 0;
if ( _gridSpan == 1 && ( _gridIndex < (int)_grid->size() ) && ( nComputedCellWidth > _grid->at( _gridIndex ) ) )
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
int w = _grid->at( _gridIndex );
for ( size_t i = _gridIndex + 1; i < _grid->size(); i++ )
{
_gridSpan++;
w += _grid->at( i );
nComputedCellWidthsGrid += _grid->at( i );
if ( w >= nComputedCellWidth )
if ( nComputedCellWidthsGrid >= nComputedCellWidths )
{
break;
}

View File

@ -67,7 +67,7 @@ namespace DocFileFormat
XMLTools::XMLAttribute layoutType ( L"w:type", L"fixed");
bool bLayoutFixed = true;
short tblIndent = 0;
_CP_OPT(short) tblIndent;
short gabHalf = 0;
short marginLeft = 0;
short marginRight = 0;
@ -98,8 +98,7 @@ namespace DocFileFormat
//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 = FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
tblIndent += gabHalf;
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
@ -404,11 +403,11 @@ namespace DocFileFormat
}
//indent
if ( tblIndent != 0 )
if ( tblIndent )
{
XMLTools::XMLElement tblInd( L"w:tblInd");
XMLTools::XMLAttribute tblIndW( L"w:w", FormatUtils::IntToWideString( tblIndent ) );
XMLTools::XMLAttribute tblIndW( L"w:w", FormatUtils::IntToWideString( *tblIndent ) );
tblInd.AppendAttribute( tblIndW );
XMLTools::XMLAttribute tblIndType( L"w:type", L"dxa");

View File

@ -220,15 +220,12 @@ namespace DocFileFormat
return res;
}
//---------------------------------------------------------------
void VMLPictureMapping::appendStyleProperty(std::wstring* b, const std::wstring& propName, const std::wstring& propValue) const
void VMLPictureMapping::appendStyleProperty(std::wstring& style, const std::wstring& propName, const std::wstring& propValue) const
{
if ( b != NULL )
{
b->operator += ( propName );
b->operator += ( L":" );
b->operator += ( propValue );
b->operator +=( L";" );
}
style += ( propName );
style += ( L":" );
style += ( propValue );
style +=( L";" );
}
VMLPictureMapping::VMLPictureMapping(ConversionContext* ctx, XMLTools::CStringXmlWriter* writer, bool olePreview, IMapping* caller, bool isInlinePicture) : PropertiesMapping(writer)
@ -295,6 +292,7 @@ namespace DocFileFormat
type.Convert( vmlShapeTypeMapping );
RELEASEOBJECT( vmlShapeTypeMapping );
}
else if (pict->embeddedData)
{
@ -338,7 +336,7 @@ namespace DocFileFormat
}
}
}break;
case metroBlob:
case ODRAW::metroBlob:
{//встроенная неведомая хуйня
ODRAW::MetroBlob* blob = dynamic_cast<ODRAW::MetroBlob*>(iter.get());
if (blob)
@ -352,28 +350,28 @@ namespace DocFileFormat
}
}break;
//BORDERS
case borderBottomColor:
case ODRAW::borderBottomColor:
if (!pict->brcBottom)
{
RGBColor bottomColor( (int)iter->op, RedFirst );
m_pXmlWriter->WriteAttribute( L"o:borderbottomcolor", L"#" + bottomColor.SixDigitHexCode);
}
break;
case borderLeftColor:
case ODRAW::borderLeftColor:
if (!pict->brcLeft)
{
RGBColor leftColor( (int)iter->op, RedFirst );
m_pXmlWriter->WriteAttribute( L"o:borderleftcolor", L"#" + leftColor.SixDigitHexCode);
}
break;
case borderRightColor:
case ODRAW::borderRightColor:
if (!pict->brcRight)
{
RGBColor rightColor( (int)iter->op, RedFirst );
m_pXmlWriter->WriteAttribute( L"o:borderrightcolor", L"#" + rightColor.SixDigitHexCode);
}
break;
case borderTopColor:
case ODRAW::borderTopColor:
if (!pict->brcTop)
{
RGBColor topColor( (int)iter->op, RedFirst );
@ -381,28 +379,28 @@ namespace DocFileFormat
}
break;
//CROPPING
case cropFromBottom:
case ODRAW::cropFromBottom:
{
//cast to signed integer
int cropBottom = (int)iter->op;
appendValueAttribute(m_imageData, L"cropbottom", FormatUtils::IntToWideString( cropBottom ) + L"f" );
}
break;
case cropFromLeft:
case ODRAW::cropFromLeft:
{
//cast to signed integer
int cropLeft = (int)iter->op;
appendValueAttribute(m_imageData, L"cropleft", FormatUtils::IntToWideString( cropLeft ) + L"f" );
}
break;
case cropFromRight:
case ODRAW::cropFromRight:
{
//cast to signed integer
int cropRight = (int)iter->op;
appendValueAttribute(m_imageData, L"cropright", FormatUtils::IntToWideString( cropRight ) + L"f" );
}
break;
case cropFromTop:
case ODRAW::cropFromTop:
{
//cast to signed integer
int cropTop = (int)iter->op;
@ -410,7 +408,7 @@ namespace DocFileFormat
}
break;
//------------------------------------------------------------
case PropertyId_rotation:
case ODRAW::ePropertyId_rotation:
{
double dAngle = (double)((int)iter->op) / 65535.0;
@ -420,32 +418,32 @@ namespace DocFileFormat
std::wstring v = strHeight;
strHeight = strWidth; strWidth = v;
appendStyleProperty(&strStyle, L"rotation", FormatUtils::DoubleToWideString(dAngle));
appendStyleProperty(strStyle, L"rotation", FormatUtils::DoubleToWideString(dAngle));
}break;
case posh:
case ODRAW::posh:
{
appendStyleProperty(&strStyle, L"mso-position-horizontal", VMLShapeMapping::mapHorizontalPosition((PositionHorizontal)iter->op));
appendStyleProperty(strStyle, L"mso-position-horizontal", VMLShapeMapping::mapHorizontalPosition((PositionHorizontal)iter->op));
}break;
case posrelh:
case ODRAW::posrelh:
{
appendStyleProperty(&strStyle, L"mso-position-horizontal-relative", VMLShapeMapping::mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op));
appendStyleProperty(strStyle, L"mso-position-horizontal-relative", VMLShapeMapping::mapHorizontalPositionRelative((PositionHorizontalRelative)iter->op));
}break;
case posv:
case ODRAW::posv:
{
appendStyleProperty(&strStyle, L"mso-position-vertical", VMLShapeMapping::mapVerticalPosition((PositionVertical)iter->op));
appendStyleProperty(strStyle, L"mso-position-vertical", VMLShapeMapping::mapVerticalPosition((PositionVertical)iter->op));
}break;
case posrelv:
case ODRAW::posrelv:
{
appendStyleProperty(&strStyle, L"mso-position-vertical-relative", VMLShapeMapping::mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
appendStyleProperty(strStyle, L"mso-position-vertical-relative", VMLShapeMapping::mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
}break;
case groupShapeBooleans:
case ODRAW::groupShapeBooleanProperties:
{
ODRAW::GroupShapeBooleanProperties* booleans = dynamic_cast<ODRAW::GroupShapeBooleanProperties*>(iter.get());
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)
//{
@ -454,7 +452,7 @@ namespace DocFileFormat
if (booleans->fHidden && booleans->fUsefHidden)
{
appendStyleProperty(&strStyle, L"visibility", L"hidden");
appendStyleProperty(strStyle, L"visibility", L"hidden");
}
}break;
default:
@ -499,7 +497,8 @@ namespace DocFileFormat
appendValueAttribute(m_imageData, L"o:title", L"" );
m_pXmlWriter->WriteString(m_imageData->GetXMLString());
}
else
m_isPictureBroken = true;
{//borders
writePictureBorder( L"bordertop", pict->brcTop );
@ -558,10 +557,10 @@ namespace DocFileFormat
pict->embeddedDataSize += lLenHeader;
delete []pict->embeddedData;
pict->embeddedData = newData;
}
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(Global::msoblipDIB),
std::vector<unsigned char>(pict->embeddedData, (pict->embeddedData + pict->embeddedDataSize)), Global::msoblipDIB));
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(btWin32),
pict->embeddedData, pict->embeddedDataSize, btWin32));
m_nImageId = m_context->_docx->RegisterImage(m_caller, btWin32);
result = true;
@ -578,26 +577,42 @@ namespace DocFileFormat
if (metaBlip)
{//decompress inside MetafilePictBlip
unsigned char *newData = NULL;
int newDataSize = metaBlip->oMetaFile.ToBuffer(newData);
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlipEntry->btWin32), std::vector<unsigned char>(newData, (newData + newDataSize))));
RELEASEARRAYOBJECTS(newData);
}
}
break;
unsigned int newDataSize = metaBlip->oMetaFile.ToBuffer(newData);
boost::shared_array<unsigned char> arData(newData);
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlipEntry->btWin32), arData, newDataSize));
}
}break;
case Global::msoblipDIB:
{//user_manual_v52.doc
BitmapBlip* bitBlip = static_cast<BitmapBlip*>(oBlipEntry->Blip);
if (bitBlip)
{
std::wstring file_name = m_context->_doc->m_sTempFolder + FILE_SEPARATOR_STR + L"tmp_image";
oBlipEntry->btWin32 = ImageHelper::SaveImageToFileFromDIB(bitBlip->m_pvBits, bitBlip->pvBitsSize, file_name);
unsigned char* pData = NULL;
DWORD nData = 0;
if (NSFile::CFileBinary::ReadAllBytes(file_name, &pData, nData))
{
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlipEntry->btWin32),
boost::shared_array<unsigned char>(pData), nData, oBlipEntry->btWin32));
break;
}
}
}
case Global::msoblipJPEG:
case Global::msoblipCMYKJPEG:
case Global::msoblipPNG:
case Global::msoblipTIFF:
case Global::msoblipDIB:
{
BitmapBlip* bitBlip = static_cast<BitmapBlip*>(oBlipEntry->Blip);
if (bitBlip)
{
m_context->_docx->ImagesList.push_back(ImageFileStructure(GetTargetExt(oBlipEntry->btWin32),
std::vector<unsigned char>(bitBlip->m_pvBits, (bitBlip->m_pvBits + bitBlip->pvBitsSize)), oBlipEntry->btWin32));
bitBlip->m_pvBits, bitBlip->pvBitsSize, oBlipEntry->btWin32));
}
}break;

View File

@ -56,7 +56,7 @@ namespace DocFileFormat
private:
/// Writes a border element
void writePictureBorder (const std::wstring & name, const BorderCode* brc);
void appendStyleProperty( std::wstring* b, const std::wstring& propName, const std::wstring& propValue ) const;
void appendStyleProperty( std::wstring& style, const std::wstring& propName, const std::wstring& propValue ) const;
bool ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString );
bool ParseEmbeddedBlob(const std::string & xmlString, std::wstring & newXmlString);
std::wstring GetShapeID(const Shape* pShape) const;
@ -74,6 +74,7 @@ namespace DocFileFormat
bool m_isBullete;
bool m_isEquation;
bool m_isEmbedded;
bool m_isPictureBroken;
std::string m_embeddedData;
std::wstring m_equationXml;
std::wstring m_blobXml;

File diff suppressed because it is too large Load Diff

View File

@ -67,6 +67,7 @@ namespace DocFileFormat
static std::wstring mapHorizontalPositionRelative(int hRel );
bool m_isBullete;
bool m_isPictureBroken;
std::wstring m_shapeId;
private:
@ -79,18 +80,19 @@ namespace DocFileFormat
void WriteShape (const ShapeContainer* pContainer);
std::wstring GenShapeId(const Shape* pShape) const;
bool copyPicture( const BlipStoreEntry* bse );
bool copyPicture( BlipStoreEntry* bse );
std::wstring GetTargetExt( Global::BlipType _type ) const;
void AppendDimensionToStyle ( std::wstring* style, const PictureDescriptor* pict, bool twistDimensions ) const;
void AppendDimensionToStyle ( std::wstring* style, const Spa* pSpa, bool twistDimensions ) const;
void AppendDimensionToStyle ( std::wstring* style, const ChildAnchor* anchor, bool twistDimensions ) const;
void appendStyleProperty ( std::wstring* b, const std::wstring& propName, const std::wstring& propValue ) const;
void AppendDimensionToStyle ( std::wstring& style, const PictureDescriptor* pict, bool twistDimensions ) const;
void AppendDimensionToStyle ( std::wstring& style, const Spa* pSpa, bool twistDimensions ) const;
void AppendDimensionToStyle ( std::wstring& style, const ChildAnchor* anchor, bool twistDimensions ) const;
void appendStyleProperty ( std::wstring& style, const std::wstring& propName, const std::wstring& propValue ) const;
void appendStylePropertyFirst( std::wstring& style, const std::wstring& propName, const std::wstring& propValue ) const;
std::wstring getTextboxAnchor( unsigned int anchor ) const;
std::wstring buildStyle ( const Shape* shape, const ChildAnchor* anchor, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex ) const;
void AppendOptionsToStyle ( std::wstring* style, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex ) const;
std::wstring buildStyle ( const Shape* shape, const ChildAnchor* anchor, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex, bool &twistDimensions) const;
void AppendOptionsToStyle ( std::wstring& style, const std::vector<ODRAW::OfficeArtFOPTEPtr>& options, int zIndex ) const;
int UpdateFromGuides(const int val) const;
@ -110,8 +112,8 @@ namespace DocFileFormat
void WriteEndShapeNode (const Shape* pShape);
std::wstring GetShapeID (const Shape* pShape) const;
std::wstring GetLineFrom (const ChildAnchor* pAnchor) const;
std::wstring GetLineTo (const ChildAnchor* pAnchor) const;
std::wstring GetLineFrom (const ChildAnchor* pAnchor, bool twistDimensions) const;
std::wstring GetLineTo (const ChildAnchor* pAnchor, bool twistDimensions) const;
std::wstring GetWrapCoords ( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
std::vector<std::wstring> GetTextRectangles ( const ODRAW::OfficeArtFOPTEPtr& pOpt ) const;
@ -122,7 +124,7 @@ namespace DocFileFormat
int m_nAdjValues[8];
std::vector<ODRAW::MSOSG> m_arrGuides;
bool m_isInlineShape;
mutable bool m_isInlineShape;
Spa* m_pSpa;
IMapping* m_pCaller;
BlipStoreContainer* m_pBlipStore;

View File

@ -173,12 +173,16 @@ namespace DocFileFormat
//Lock ???
ODRAW::ProtectionBooleanProperties *prot = dynamic_cast<ODRAW::ProtectionBooleanProperties*>(pShape->Lock.get());
if ((prot) && (prot->fUsefLockAspectRatio && prot->fLockAspectRatio))
if ((prot) && (prot->fUsefLockAspectRatio))
{
appendValueAttribute( _lock, L"aspectratio", L"t" );
appendValueAttribute( _lock, L"aspectratio", prot->fLockAspectRatio ? L"t" : L"f" );
}
else
{
appendValueAttribute( _lock, L"aspectratio", L"t");
}
if ( _lock->GetAttributeCount() > 1 )
if ( _lock->GetAttributeCount() > 0 )
{
m_pXmlWriter->WriteString( _lock->GetXMLString() );
}

View File

@ -33,6 +33,7 @@
#include "WordDocument.h"
#include "../../Common/OfficeFileErrorDescription.h"
#include "../../Common/MS-LCID.h"
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/SummaryInformation.h"
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Binary/CFStream.h"
@ -79,13 +80,13 @@ namespace DocFileFormat
254, 437,//PC 437
255, 850//OEM
};
WordDocument::WordDocument (const ProgressCallback* pCallFunc, const std::wstring & sTempFolder ) :
WordDocument::WordDocument (const ProgressCallback* pCallFunc, const std::wstring & sTempFolder, const int userLCID) :
m_PieceTable(NULL), WordDocumentStream(NULL), TableStream(NULL), DataStream(NULL), FIB(NULL),
Text(NULL), RevisionAuthorTable(NULL), FontTable(NULL), BookmarkNames(NULL), AutoTextNames(NULL),
IndividualFootnotesPlex(NULL), FootnoteReferenceCharactersPlex(NULL), IndividualEndnotesPlex(NULL),
EndnoteReferenceCharactersPlex(NULL), FieldsPlex(NULL), FootnoteDocumentFieldsPlex(NULL),
EndnoteDocumentFieldsPlex(NULL), HeadersAndFootersDocumentFieldsPlex(NULL), HeaderStoriesPlex(NULL),
AnnotationsReferencePlex(NULL), AnnotationsReferenceExPlex(NULL), IndividualCommentsPlex(NULL), TextboxBreakPlex(NULL), TextboxBreakPlexHeader(NULL),
EndnoteDocumentFieldsPlex(NULL), HeadersAndFootersDocumentFieldsPlex(NULL), HeaderStoriesPlex(NULL), AnnotationsFieldsPlex(NULL),
AnnotationsReferencePlex(NULL), AnnotationsReferencesEx(NULL), IndividualCommentsPlex(NULL), TextboxBreakPlex(NULL), TextboxBreakPlexHeader(NULL),
TextboxIndividualPlex(NULL),AssocNames(NULL), BookmarkAnnotNames(NULL), Captions(NULL), AutoCaptions(NULL), ListPlex(NULL),
OfficeDrawingPlex(NULL), OfficeDrawingPlexHeader(NULL), SectionPlex(NULL), BookmarkStartPlex(NULL), BookmarkEndPlex(NULL),
AutoTextPlex(NULL), AllPapxFkps(NULL), AllChpxFkps(NULL), AllPapx(NULL), AllPapxVector(NULL), AllSepx(NULL), Styles(NULL), listTable(NULL),
@ -94,6 +95,7 @@ namespace DocFileFormat
{
m_pCallFunc = pCallFunc;
m_sTempFolder = sTempFolder;
m_nUserLCID = userLCID;
m_pStorage = NULL;
officeArtContent = NULL;
@ -276,6 +278,17 @@ namespace DocFileFormat
}
FIB->m_CodePage = nDocumentCodePage;
if (!bDocumentCodePage && m_nUserLCID > 0)
{
int user_codepage = msLCID2DefCodePage(m_nUserLCID);
if (user_codepage > 0)
{
bDocumentCodePage = true;
nDocumentCodePage = user_codepage;
}
}
//-------------------------------------------------------------------------------------------------
try
{
@ -297,10 +310,11 @@ namespace DocFileFormat
BookmarkNames = new StringTable<WideString> (TableStream, FIB->m_FibWord97.fcSttbfBkmk, FIB->m_FibWord97.lcbSttbfBkmk, nWordVersion);
AutoTextNames = new StringTable<WideString> (TableStream, FIB->m_FibWord97.fcSttbfGlsy, FIB->m_FibWord97.lcbSttbfGlsy, nWordVersion);
AssocNames = new StringTable<WideString> (TableStream, FIB->m_FibWord97.fcSttbfAssoc, FIB->m_FibWord97.lcbSttbfAssoc, nWordVersion);
BookmarkAnnotNames = new StringTable<WideString> (TableStream, FIB->m_FibWord97.fcSttbfAtnBkmk, FIB->m_FibWord97.lcbSttbfAtnBkmk, nWordVersion);
Captions = new StringTable<WideString> (TableStream, FIB->m_FibWord97.fcSttbfCaption, FIB->m_FibWord97.lcbSttbfCaption, nWordVersion);
AutoCaptions = new StringTable<WideString> (TableStream, FIB->m_FibWord97.fcSttbfAutoCaption, FIB->m_FibWord97.lcbSttbfAutoCaption, nWordVersion);
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);
@ -344,16 +358,17 @@ namespace DocFileFormat
IndividualCommentsPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfandTxt, FIB->m_FibWord97.lcbPlcfandTxt, nWordVersion);
}
if (FIB->m_FibWord2002.lcbAtrdExtra > 0)
if (FIB->m_FibWord2002.lcbAtrdExtra > 0 && AnnotationsReferencePlex)
{
AnnotationsReferenceExPlex = new Plex<AnnotationReferenceExDescriptor>(AnnotationReferenceExDescriptor::GetSize(nWordVersion), TableStream, FIB->m_FibWord2002.fcAtrdExtra, FIB->m_FibWord2002.lcbAtrdExtra, nWordVersion);
size_t count = AnnotationsReferencePlex->Elements.size();
AnnotationsReferencesEx = new AnnotationReferenceExDescriptors(count, TableStream, FIB->m_FibWord2002.fcAtrdExtra, FIB->m_FibWord2002.lcbAtrdExtra);
}
OfficeDrawingPlex = new Plex<Spa> (Spa::GetSize(nWordVersion), TableStream, FIB->m_FibWord97.fcPlcSpaMom, FIB->m_FibWord97.lcbPlcSpaMom, nWordVersion);
OfficeDrawingPlexHeader = new Plex<Spa> (Spa::GetSize(nWordVersion), TableStream, FIB->m_FibWord97.fcPlcSpaHdr, FIB->m_FibWord97.lcbPlcSpaHdr, nWordVersion);
TextboxIndividualPlex = new Plex<FTXBXS> (FTXBXS::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcftxbxTxt, FIB->m_FibWord97.lcbPlcftxbxTxt, nWordVersion);
SectionPlex = new Plex<SectionDescriptor> (SectionDescriptor::GetSize(nWordVersion), TableStream, FIB->m_FibWord97.fcPlcfSed, FIB->m_FibWord97.lcbPlcfSed, nWordVersion);
SectionPlex = new Plex<SectionDescriptor> (SectionDescriptor::GetSize(nWordVersion), TableStream, FIB->m_FibWord97.fcPlcfSed,FIB->m_FibWord97.lcbPlcfSed, nWordVersion);
BookmarkStartPlex = new Plex<BookmarkFirst> (BookmarkFirst::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBkf, FIB->m_FibWord97.lcbPlcfBkf, nWordVersion);
BookmarkEndPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBkl, FIB->m_FibWord97.lcbPlcfBkl, nWordVersion);
@ -361,36 +376,50 @@ namespace DocFileFormat
TextboxBreakPlex = new Plex<Tbkd> (Tbkd::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfTxbxBkd, FIB->m_FibWord97.lcbPlcfTxbxBkd, nWordVersion);
TextboxBreakPlexHeader = new Plex<Tbkd> (Tbkd::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfTxbxHdrBkd, FIB->m_FibWord97.lcbPlcfTxbxHdrBkd, nWordVersion);
AnnotStartPlex = new Plex<BookmarkFirst> (BookmarkFirst::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfAtnBkf, FIB->m_FibWord97.lcbPlcfAtnBkf, nWordVersion);
AnnotStartPlex = new Plex<BookmarkFirst> (BookmarkFirst::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfAtnBkf, FIB->m_FibWord97.lcbPlcfAtnBkf, nWordVersion);
AnnotEndPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfAtnBkl, FIB->m_FibWord97.lcbPlcfAtnBkl, nWordVersion);
for (size_t i = 0; i < BookmarkStartPlex->Elements.size(); ++i)
{
BookmarkFirst* pBookmark = static_cast<BookmarkFirst*>(BookmarkStartPlex->Elements[i]);
BookmarkFirst* pBookmark = static_cast<BookmarkFirst*>(BookmarkStartPlex->Elements[i]);
if (pBookmark)
{
BookmarkStartEndCPs.push_back(std::make_pair(BookmarkStartPlex->CharacterPositions[i], BookmarkEndPlex->CharacterPositions[pBookmark->GetIndex()]));
}
}
std::vector<unsigned char*> & bookmarks = BookmarkAnnotNames->getDataExtra();
for (size_t i = 0; AnnotStartPlex && i < AnnotStartPlex->Elements.size(); ++i)
{
BookmarkFirst* pBookmark = static_cast<BookmarkFirst*>(AnnotStartPlex->Elements[i]);
if (pBookmark)
{
short ind = pBookmark->GetIndex();
if (i < AnnotStartPlex->CharacterPositions.size() -1 )
short bmc = *((short*)bookmarks[i]); //0x0100 always тут
_UINT32 lTag = *((_UINT32*)(bookmarks[i] + 2));
if (i < AnnotStartPlex->CharacterPositions.size() - 1 )
{
AnnotStartEndCPs.push_back(std::make_pair(AnnotStartPlex->CharacterPositions[i], AnnotEndPlex->CharacterPositions[i + 1]));
_annotStartEnd ann;
ann.start = AnnotStartPlex->CharacterPositions[i];
ann.end = AnnotEndPlex->CharacterPositions[i/* + 1*/];
ann.bookmarkId = lTag;
AnnotStartEndCPs.push_back(ann);
}
}
}
AutoTextPlex = new Plex<EmptyStructure>(EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfGlsy, FIB->m_FibWord97.lcbPlcfGlsy, nWordVersion);
FieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldMom, FIB->m_FibWord97.lcbPlcfFldMom, nWordVersion);
FootnoteDocumentFieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldFtn, FIB->m_FibWord97.lcbPlcfFldFtn, nWordVersion);
EndnoteDocumentFieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldEdn, FIB->m_FibWord97.lcbPlcfFldEdn, nWordVersion);
HeadersAndFootersDocumentFieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldHdr, FIB->m_FibWord97.lcbPlcfFldHdr, nWordVersion);
AnnotationsFieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldAtn, FIB->m_FibWord97.lcbPlcfFldAtn, nWordVersion);
ListPlex = new Plex<ListNumCache> (ListNumCache::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBteLvc, FIB->m_FibWord97.lcbPlcfBteLvc, nWordVersion);
if (m_pCallFunc)
@ -850,7 +879,6 @@ namespace DocFileFormat
RELEASEOBJECT(AllSepx);
}
RELEASEOBJECT(Text);
RELEASEOBJECT(m_PieceTable);
@ -872,10 +900,11 @@ namespace DocFileFormat
RELEASEOBJECT(FootnoteDocumentFieldsPlex);
RELEASEOBJECT(EndnoteDocumentFieldsPlex);
RELEASEOBJECT(HeadersAndFootersDocumentFieldsPlex);
RELEASEOBJECT(AnnotationsFieldsPlex);
RELEASEOBJECT(HeaderStoriesPlex);
RELEASEOBJECT(IndividualCommentsPlex);
RELEASEOBJECT(AnnotationsReferencePlex);
RELEASEOBJECT(AnnotationsReferenceExPlex);
RELEASEOBJECT(AnnotationsReferencesEx);
RELEASEOBJECT(TextboxBreakPlex);
RELEASEOBJECT(TextboxBreakPlexHeader);
RELEASEOBJECT(OfficeDrawingPlex);

View File

@ -92,7 +92,7 @@ namespace DocFileFormat
public:
WordDocument (const ProgressCallback* pCallFunc, const std::wstring & tempFolder );
WordDocument (const ProgressCallback* pCallFunc, const std::wstring & tempFolder, const int userLCID);
virtual ~WordDocument();
_UINT32 LoadDocument(const std::wstring & fileName, const std::wstring & password);
@ -153,6 +153,7 @@ namespace DocFileFormat
std::wstring m_sPassword;
std::wstring m_sTempFolder;
std::wstring m_sTempDecryptFileName;
int m_nUserLCID;
const ProgressCallback* m_pCallFunc;
@ -171,8 +172,15 @@ namespace DocFileFormat
std::map<int, int> PictureBulletsCPsMap;
struct _annotStartEnd
{
int start;
int end;
_UINT32 bookmarkId;
};
std::vector<std::pair<int, int>> BookmarkStartEndCPs;
std::vector<std::pair<int, int>> AnnotStartEndCPs;
std::vector<_annotStartEnd> AnnotStartEndCPs;
std::map<int, int> mapCommentsBookmarks;
FileInformationBlock * FIB;
StyleSheet * Styles; // The style sheet of the document
@ -211,7 +219,7 @@ namespace DocFileFormat
Plex<Spa> *OfficeDrawingPlex;
Plex<Spa> *OfficeDrawingPlexHeader;
Plex<SectionDescriptor> *SectionPlex; // A Plex containing all section descriptors
Plex<SectionDescriptor> *SectionPlex;
Plex<BookmarkFirst> *BookmarkStartPlex;
Plex<EmptyStructure> *BookmarkEndPlex;
@ -224,10 +232,11 @@ namespace DocFileFormat
Plex<FieldCharacter> *FootnoteDocumentFieldsPlex;
Plex<FieldCharacter> *EndnoteDocumentFieldsPlex;
Plex<FieldCharacter> *HeadersAndFootersDocumentFieldsPlex;
Plex<FieldCharacter> *AnnotationsFieldsPlex;
Plex<AnnotationReferenceDescriptor> *AnnotationsReferencePlex;
Plex<AnnotationReferenceExDescriptor> *AnnotationsReferenceExPlex;
Plex<EmptyStructure> *AutoTextPlex;
// Each character position specifies the beginning of a range of text that constitutes the contents of an AutoText item
AnnotationReferenceExDescriptors *AnnotationsReferencesEx;
};
}

View File

@ -32,7 +32,6 @@
#include "WordprocessingDocument.h"
#include "../../DesktopEditor/raster/BgraFrame.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../../DesktopEditor/common/SystemUtils.h"
@ -40,143 +39,10 @@
#include "../../Common/DocxFormat/Source/DocxFormat/Core.h"
#include "../../Common/DocxFormat/Source/DocxFormat/ContentTypes.h"
namespace ImageHelper
{
struct __BITMAPINFOHEADER
{
_UINT32 biSize;
_INT32 biWidth;
_INT32 biHeight;
_UINT16 biPlanes;
_UINT16 biBitCount;
_UINT32 biCompression;
_UINT32 biSizeImage;
_INT32 biXPelsPerMeter;
_INT32 biYPelsPerMeter;
_UINT32 biClrUsed;
_UINT32 biClrImportant;
};
struct __BITMAPCOREHEADER
{
_UINT32 bcSize; /* used to get to color table */
_UINT16 bcWidth;
_UINT16 bcHeight;
_UINT16 bcPlanes;
_UINT16 bcBitCount;
};
inline Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, const std::wstring& file_name)//without ext
{
Global::_BlipType result = Global::msoblipERROR;
CBgraFrame oFrame;
int offset = 0, biSizeImage = 0;
__BITMAPINFOHEADER * header = (__BITMAPINFOHEADER*)data;
if (!header) return result;
result = Global::msoblipDIB;
if (header->biWidth > 100000 || header->biHeight > 100000 || header->biSize != 40)
{
__BITMAPCOREHEADER * header_core = (__BITMAPCOREHEADER *)data;
if (header_core->bcSize != 12)
{
result = Global::msoblipWMF;
}
else
{
offset = 12; //sizeof(BITMAPCOREHEADER)
oFrame.put_Height (header_core->bcHeight );
oFrame.put_Width (header_core->bcWidth );
int sz_bitmap = header_core->bcHeight * header_core->bcWidth * header_core->bcBitCount/ 8;
//if (header_core->bcWidth % 2 != 0 && sz_bitmap < size - offset)
// header_core->bcWidth++;
///???? todooo непонятно .. в biff5 нужно флипать картинку, в biff8 не ясно ( -
int stride = -(size - offset) / header_core->bcHeight;
oFrame.put_Stride (stride/*header_core->bcBitCount * header_core->bcWidth /8 */);
biSizeImage = size - offset;
if (-stride >= header_core->bcWidth && header_core->bcBitCount >=24 )
{
result = Global::msoblipPNG;
}
}
}
else
{
offset = 40; //sizeof(BITMAPINFOHEADER)
oFrame.put_Height (header->biHeight );
oFrame.put_Width (header->biWidth );
int sz_bitmap = header->biHeight * header->biWidth * header->biBitCount/ 8;
//if (header->biWidth % 2 != 0 && sz_bitmap < size -offset)
// header->biWidth++;
int stride = -(size - offset) / header->biHeight;
if (-stride >= header->biWidth && header->biBitCount >= 24)
{
result = Global::msoblipPNG;
}
oFrame.put_Stride (stride/*header->biBitCount * header->biWidth /8*/);
biSizeImage = header->biSizeImage > 0 ? header->biSizeImage : (size - offset);
}
//------------------------------------------------------------------------------------------
if (result == Global::msoblipPNG)
{
oFrame.put_Data((unsigned char*)data + offset);
if (!oFrame.SaveFile(file_name + L".png", 4/*CXIMAGE_FORMAT_PNG*/))
result = Global::msoblipERROR;
oFrame.put_Data(NULL);
}
else if (result == Global::msoblipWMF)
{
NSFile::CFileBinary file;
if (file.CreateFileW(file_name + L".wmf"))
{
file.WriteFile((BYTE*)data, size);
file.CloseFile();
}
}
else if (biSizeImage > 0)
{
NSFile::CFileBinary file;
if (file.CreateFileW(file_name + L".bmp"))
{
_UINT16 vtType = 0x4D42; file.WriteFile((BYTE*)&vtType, 2);
_UINT32 dwLen = biSizeImage; file.WriteFile((BYTE*)&dwLen, 4);
_UINT32 dwRes = 0; file.WriteFile((BYTE*)&dwRes, 4);
_UINT32 dwOffset = 2; file.WriteFile((BYTE*)&dwOffset, 4);
file.WriteFile((BYTE*)data, size);
file.CloseFile();
}
}
return result;
}
}
namespace DocFileFormat
{
WordprocessingDocument::WordprocessingDocument(const std::wstring & _pathOutput, const WordDocument* _docFile) :
OpenXmlPackage( _docFile ),
FontTableXML( L"" ), DocumentXML( L"" ),
StyleSheetXML( L"" ), FootnotesXML ( L"" ), NumberingXML( L"" ),
CommentsXML( L"" ), SettingsXML( L"" ), CommandTableXML ( L"" )
OpenXmlPackage( _docFile )
{
m_strOutputPath = _pathOutput;
}
@ -262,6 +128,7 @@ namespace DocFileFormat
SaveToFile(pathWord, std::wstring( L"endnotes.xml" ), EndnotesXML );
SaveToFile(pathWord, std::wstring( L"numbering.xml" ), NumberingXML );
SaveToFile(pathWord, std::wstring( L"comments.xml" ), CommentsXML );
SaveToFile(pathWord, std::wstring( L"commentsExtended.xml"),CommentsExtendedXML );
SaveToFile(pathWord, std::wstring( L"settings.xml" ), SettingsXML );
SaveToFile(pathWord, std::wstring( L"customizations.xml" ), CommandTableXML );
@ -275,24 +142,7 @@ namespace DocFileFormat
for (std::list<ImageFileStructure>::iterator iter = ImagesList.begin(); iter != ImagesList.end(); ++iter)
{
unsigned char* bytes = NULL;
bytes = new unsigned char[iter->data.size()];
if (bytes)
{
copy(iter->data.begin(), iter->data.end(), bytes);
if (Global::msoblipDIB == iter->blipType)
{//user_manual_v52.doc
std::wstring file_name = pathMedia + FILE_SEPARATOR_STR + L"image" + FormatUtils::IntToWideString(i++);
iter->blipType = ImageHelper::SaveImageToFileFromDIB(bytes, iter->data.size(), file_name);
}
else
{
SaveToFile(pathMedia, std::wstring(L"image" ) + FormatUtils::IntToWideString(i++) + iter->ext, (void*)bytes, (unsigned int)iter->data.size());
}
RELEASEARRAYOBJECTS(bytes);
}
SaveToFile(pathMedia, std::wstring(L"image" ) + FormatUtils::IntToWideString(i++) + iter->ext, (void*)iter->data.get(), iter->size);
}
}

View File

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

View File

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

View File

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

View File

@ -29,9 +29,6 @@
6967B4D41E27C52700A129E2 /* ListTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4271E27C52700A129E2 /* ListTable.cpp */; };
6967B4D51E27C52700A129E2 /* MainDocumentMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4291E27C52700A129E2 /* MainDocumentMapping.cpp */; };
6967B4D61E27C52700A129E2 /* NumberingMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B42C1E27C52700A129E2 /* NumberingMapping.cpp */; };
6967B4D71E27C52700A129E2 /* Record.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4471E27C52700A129E2 /* Record.cpp */; };
6967B4D81E27C52700A129E2 /* RecordFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4491E27C52700A129E2 /* RecordFactory.cpp */; };
6967B4D91E27C52700A129E2 /* ShapeTypeFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4511E27C52700A129E2 /* ShapeTypeFactory.cpp */; };
6967B4DA1E27C52700A129E2 /* OleObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B47A1E27C52700A129E2 /* OleObject.cpp */; };
6967B4DB1E27C52700A129E2 /* OpenXmlPackage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B47D1E27C52700A129E2 /* OpenXmlPackage.cpp */; };
6967B4DC1E27C52700A129E2 /* ParagraphHeight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B47F1E27C52700A129E2 /* ParagraphHeight.cpp */; };
@ -60,6 +57,9 @@
6967B4F31E27C52700A129E2 /* VMLShapeTypeMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4BC1E27C52700A129E2 /* VMLShapeTypeMapping.cpp */; };
6967B4F41E27C52700A129E2 /* WordDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4BF1E27C52700A129E2 /* WordDocument.cpp */; };
6967B4F51E27C52700A129E2 /* WordprocessingDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4C11E27C52700A129E2 /* WordprocessingDocument.cpp */; };
8A1BC15322DF34920084799E /* ShapeTypeFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A1BC11622DF34900084799E /* ShapeTypeFactory.cpp */; };
8A1BC15422DF34920084799E /* Record.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A1BC14922DF34920084799E /* Record.cpp */; };
8A1BC15522DF34920084799E /* RecordFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A1BC15222DF34920084799E /* RecordFactory.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@ -166,79 +166,6 @@
6967B42C1E27C52700A129E2 /* NumberingMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NumberingMapping.cpp; sourceTree = "<group>"; };
6967B42D1E27C52700A129E2 /* NumberingMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberingMapping.h; sourceTree = "<group>"; };
6967B42E1E27C52700A129E2 /* OfficeArtContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OfficeArtContent.h; sourceTree = "<group>"; };
6967B4301E27C52700A129E2 /* BitmapBlip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapBlip.h; sourceTree = "<group>"; };
6967B4311E27C52700A129E2 /* BlipStoreContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlipStoreContainer.h; sourceTree = "<group>"; };
6967B4321E27C52700A129E2 /* BlipStoreEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlipStoreEntry.h; sourceTree = "<group>"; };
6967B4331E27C52700A129E2 /* ChildAnchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildAnchor.h; sourceTree = "<group>"; };
6967B4341E27C52700A129E2 /* ClientAnchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientAnchor.h; sourceTree = "<group>"; };
6967B4351E27C52700A129E2 /* ClientData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientData.h; sourceTree = "<group>"; };
6967B4361E27C52700A129E2 /* DiagramBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagramBooleanProperties.h; sourceTree = "<group>"; };
6967B4371E27C52700A129E2 /* DrawingContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingContainer.h; sourceTree = "<group>"; };
6967B4381E27C52700A129E2 /* DrawingGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingGroup.h; sourceTree = "<group>"; };
6967B4391E27C52700A129E2 /* DrawingGroupRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingGroupRecord.h; sourceTree = "<group>"; };
6967B43A1E27C52700A129E2 /* DrawingRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingRecord.h; sourceTree = "<group>"; };
6967B43B1E27C52700A129E2 /* FillStyleBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FillStyleBooleanProperties.h; sourceTree = "<group>"; };
6967B43C1E27C52700A129E2 /* GeometryBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeometryBooleanProperties.h; sourceTree = "<group>"; };
6967B43D1E27C52700A129E2 /* GeometryTextBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeometryTextBooleanProperties.h; sourceTree = "<group>"; };
6967B43E1E27C52700A129E2 /* GroupContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupContainer.h; sourceTree = "<group>"; };
6967B43F1E27C52700A129E2 /* GroupShapeBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupShapeBooleanProperties.h; sourceTree = "<group>"; };
6967B4401E27C52700A129E2 /* GroupShapeRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupShapeRecord.h; sourceTree = "<group>"; };
6967B4411E27C52700A129E2 /* LineStyleBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineStyleBooleanProperties.h; sourceTree = "<group>"; };
6967B4421E27C52700A129E2 /* MetafilePictBlip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MetafilePictBlip.h; sourceTree = "<group>"; };
6967B4431E27C52700A129E2 /* OfficeArtClientTextbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OfficeArtClientTextbox.h; sourceTree = "<group>"; };
6967B4441E27C52700A129E2 /* PathParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathParser.h; sourceTree = "<group>"; };
6967B4451E27C52700A129E2 /* PathSegment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathSegment.h; sourceTree = "<group>"; };
6967B4461E27C52700A129E2 /* ProtectionBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtectionBooleanProperties.h; sourceTree = "<group>"; };
6967B4471E27C52700A129E2 /* Record.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Record.cpp; sourceTree = "<group>"; };
6967B4481E27C52700A129E2 /* Record.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Record.h; sourceTree = "<group>"; };
6967B4491E27C52700A129E2 /* RecordFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RecordFactory.cpp; sourceTree = "<group>"; };
6967B44A1E27C52700A129E2 /* RecordFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecordFactory.h; sourceTree = "<group>"; };
6967B44B1E27C52700A129E2 /* RegularContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegularContainer.h; sourceTree = "<group>"; };
6967B44C1E27C52700A129E2 /* ShadowStyleBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowStyleBooleanProperties.h; sourceTree = "<group>"; };
6967B44D1E27C52700A129E2 /* Shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shape.h; sourceTree = "<group>"; };
6967B44E1E27C52700A129E2 /* ShapeContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeContainer.h; sourceTree = "<group>"; };
6967B44F1E27C52700A129E2 /* ShapeOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeOptions.h; sourceTree = "<group>"; };
6967B4501E27C52700A129E2 /* ShapeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeType.h; sourceTree = "<group>"; };
6967B4511E27C52700A129E2 /* ShapeTypeFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShapeTypeFactory.cpp; sourceTree = "<group>"; };
6967B4521E27C52700A129E2 /* ShapeTypeFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeTypeFactory.h; sourceTree = "<group>"; };
6967B4541E27C52700A129E2 /* ArcType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArcType.h; sourceTree = "<group>"; };
6967B4551E27C52700A129E2 /* ArrowType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrowType.h; sourceTree = "<group>"; };
6967B4561E27C52700A129E2 /* BevelType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BevelType.h; sourceTree = "<group>"; };
6967B4571E27C52700A129E2 /* BlockArcType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockArcType.h; sourceTree = "<group>"; };
6967B4581E27C52700A129E2 /* BracketsType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BracketsType.h; sourceTree = "<group>"; };
6967B4591E27C52700A129E2 /* CalloutsType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalloutsType.h; sourceTree = "<group>"; };
6967B45A1E27C52700A129E2 /* CanType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanType.h; sourceTree = "<group>"; };
6967B45B1E27C52700A129E2 /* Connector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Connector.h; sourceTree = "<group>"; };
6967B45C1E27C52700A129E2 /* CubeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CubeType.h; sourceTree = "<group>"; };
6967B45D1E27C52700A129E2 /* DiamondType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiamondType.h; sourceTree = "<group>"; };
6967B45E1E27C52700A129E2 /* DonutType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DonutType.h; sourceTree = "<group>"; };
6967B45F1E27C52700A129E2 /* FlowChartType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlowChartType.h; sourceTree = "<group>"; };
6967B4601E27C52700A129E2 /* FoldedCornerlType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoldedCornerlType.h; sourceTree = "<group>"; };
6967B4611E27C52700A129E2 /* HeartType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeartType.h; sourceTree = "<group>"; };
6967B4621E27C52700A129E2 /* HexagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HexagonType.h; sourceTree = "<group>"; };
6967B4631E27C52700A129E2 /* IsoscelesTriangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IsoscelesTriangleType.h; sourceTree = "<group>"; };
6967B4641E27C52700A129E2 /* LightningBoltType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LightningBoltType.h; sourceTree = "<group>"; };
6967B4651E27C52700A129E2 /* LineType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineType.h; sourceTree = "<group>"; };
6967B4661E27C52700A129E2 /* MoonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoonType.h; sourceTree = "<group>"; };
6967B4671E27C52700A129E2 /* NoSmokingType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoSmokingType.h; sourceTree = "<group>"; };
6967B4681E27C52700A129E2 /* OctagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OctagonType.h; sourceTree = "<group>"; };
6967B4691E27C52700A129E2 /* OvalType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OvalType.h; sourceTree = "<group>"; };
6967B46A1E27C52700A129E2 /* ParallelogramType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallelogramType.h; sourceTree = "<group>"; };
6967B46B1E27C52700A129E2 /* PentagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PentagonType.h; sourceTree = "<group>"; };
6967B46C1E27C52700A129E2 /* PictureFrameType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureFrameType.h; sourceTree = "<group>"; };
6967B46D1E27C52700A129E2 /* PlaqueType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaqueType.h; sourceTree = "<group>"; };
6967B46E1E27C52700A129E2 /* PlusType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlusType.h; sourceTree = "<group>"; };
6967B46F1E27C52700A129E2 /* RectangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RectangleType.h; sourceTree = "<group>"; };
6967B4701E27C52700A129E2 /* RightTriangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightTriangleType.h; sourceTree = "<group>"; };
6967B4711E27C52700A129E2 /* RoundedRectangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedRectangleType.h; sourceTree = "<group>"; };
6967B4721E27C52700A129E2 /* SmileyFaceType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmileyFaceType.h; sourceTree = "<group>"; };
6967B4731E27C52700A129E2 /* StarType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarType.h; sourceTree = "<group>"; };
6967B4741E27C52700A129E2 /* SunType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SunType.h; sourceTree = "<group>"; };
6967B4751E27C52700A129E2 /* TextboxType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextboxType.h; sourceTree = "<group>"; };
6967B4761E27C52700A129E2 /* TrapezoidType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrapezoidType.h; sourceTree = "<group>"; };
6967B4771E27C52700A129E2 /* WordArtText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordArtText.h; sourceTree = "<group>"; };
6967B4781E27C52700A129E2 /* SplitMenuColorContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplitMenuColorContainer.h; sourceTree = "<group>"; };
6967B4791E27C52700A129E2 /* UnknownRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnknownRecord.h; sourceTree = "<group>"; };
6967B47A1E27C52700A129E2 /* OleObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OleObject.cpp; sourceTree = "<group>"; };
6967B47B1E27C52700A129E2 /* OleObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OleObject.h; sourceTree = "<group>"; };
6967B47C1E27C52700A129E2 /* OleObjectMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OleObjectMapping.h; sourceTree = "<group>"; };
@ -312,6 +239,71 @@
6967B4C01E27C52700A129E2 /* WordDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordDocument.h; sourceTree = "<group>"; };
6967B4C11E27C52700A129E2 /* WordprocessingDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WordprocessingDocument.cpp; sourceTree = "<group>"; };
6967B4C21E27C52700A129E2 /* WordprocessingDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordprocessingDocument.h; sourceTree = "<group>"; };
8A1BC11122DF348F0084799E /* ClientAnchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientAnchor.h; sourceTree = "<group>"; };
8A1BC11222DF34900084799E /* ShapeTypeFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeTypeFactory.h; sourceTree = "<group>"; };
8A1BC11322DF34900084799E /* OfficeArtClientTextbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OfficeArtClientTextbox.h; sourceTree = "<group>"; };
8A1BC11422DF34900084799E /* DiagramBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagramBooleanProperties.h; sourceTree = "<group>"; };
8A1BC11522DF34900084799E /* MetafilePictBlip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MetafilePictBlip.h; sourceTree = "<group>"; };
8A1BC11622DF34900084799E /* ShapeTypeFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShapeTypeFactory.cpp; sourceTree = "<group>"; };
8A1BC11722DF34900084799E /* DrawingContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingContainer.h; sourceTree = "<group>"; };
8A1BC11822DF34900084799E /* UnknownRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnknownRecord.h; sourceTree = "<group>"; };
8A1BC11922DF34900084799E /* Record.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Record.h; sourceTree = "<group>"; };
8A1BC11A22DF34900084799E /* BitmapBlip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapBlip.h; sourceTree = "<group>"; };
8A1BC11B22DF34910084799E /* OfficeArtFRITContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OfficeArtFRITContainer.h; sourceTree = "<group>"; };
8A1BC11C22DF34910084799E /* DrawingGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingGroup.h; sourceTree = "<group>"; };
8A1BC11D22DF34910084799E /* ShapeContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeContainer.h; sourceTree = "<group>"; };
8A1BC11E22DF34910084799E /* ShapeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeType.h; sourceTree = "<group>"; };
8A1BC12022DF34910084799E /* PlaqueType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaqueType.h; sourceTree = "<group>"; };
8A1BC12122DF34910084799E /* CubeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CubeType.h; sourceTree = "<group>"; };
8A1BC12222DF34910084799E /* LightningBoltType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LightningBoltType.h; sourceTree = "<group>"; };
8A1BC12322DF34910084799E /* OvalType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OvalType.h; sourceTree = "<group>"; };
8A1BC12422DF34910084799E /* CalloutsType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalloutsType.h; sourceTree = "<group>"; };
8A1BC12522DF34910084799E /* TextboxType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextboxType.h; sourceTree = "<group>"; };
8A1BC12622DF34910084799E /* HexagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HexagonType.h; sourceTree = "<group>"; };
8A1BC12722DF34910084799E /* NoSmokingType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoSmokingType.h; sourceTree = "<group>"; };
8A1BC12822DF34910084799E /* OctagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OctagonType.h; sourceTree = "<group>"; };
8A1BC12922DF34910084799E /* ArcType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArcType.h; sourceTree = "<group>"; };
8A1BC12A22DF34910084799E /* CanType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanType.h; sourceTree = "<group>"; };
8A1BC12B22DF34910084799E /* PictureFrameType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureFrameType.h; sourceTree = "<group>"; };
8A1BC12C22DF34910084799E /* BevelType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BevelType.h; sourceTree = "<group>"; };
8A1BC12D22DF34910084799E /* MoonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoonType.h; sourceTree = "<group>"; };
8A1BC12E22DF34910084799E /* FoldedCornerlType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoldedCornerlType.h; sourceTree = "<group>"; };
8A1BC12F22DF34910084799E /* PentagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PentagonType.h; sourceTree = "<group>"; };
8A1BC13022DF34910084799E /* BracketsType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BracketsType.h; sourceTree = "<group>"; };
8A1BC13122DF34910084799E /* IsoscelesTriangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IsoscelesTriangleType.h; sourceTree = "<group>"; };
8A1BC13222DF34910084799E /* StarType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarType.h; sourceTree = "<group>"; };
8A1BC13322DF34910084799E /* DonutType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DonutType.h; sourceTree = "<group>"; };
8A1BC13422DF34910084799E /* RectangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RectangleType.h; sourceTree = "<group>"; };
8A1BC13522DF34910084799E /* TrapezoidType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrapezoidType.h; sourceTree = "<group>"; };
8A1BC13622DF34910084799E /* ArrowType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrowType.h; sourceTree = "<group>"; };
8A1BC13722DF34910084799E /* SmileyFaceType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmileyFaceType.h; sourceTree = "<group>"; };
8A1BC13822DF34910084799E /* PlusType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlusType.h; sourceTree = "<group>"; };
8A1BC13922DF34910084799E /* RightTriangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightTriangleType.h; sourceTree = "<group>"; };
8A1BC13A22DF34910084799E /* HeartType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeartType.h; sourceTree = "<group>"; };
8A1BC13B22DF34910084799E /* SunType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SunType.h; sourceTree = "<group>"; };
8A1BC13C22DF34910084799E /* Connector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Connector.h; sourceTree = "<group>"; };
8A1BC13D22DF34910084799E /* RoundedRectangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedRectangleType.h; sourceTree = "<group>"; };
8A1BC13E22DF34910084799E /* BlockArcType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockArcType.h; sourceTree = "<group>"; };
8A1BC13F22DF34910084799E /* WordArtText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordArtText.h; sourceTree = "<group>"; };
8A1BC14022DF34910084799E /* FlowChartType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlowChartType.h; sourceTree = "<group>"; };
8A1BC14122DF34910084799E /* LineType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineType.h; sourceTree = "<group>"; };
8A1BC14222DF34910084799E /* DiamondType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiamondType.h; sourceTree = "<group>"; };
8A1BC14322DF34910084799E /* ParallelogramType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallelogramType.h; sourceTree = "<group>"; };
8A1BC14422DF34910084799E /* ClientData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientData.h; sourceTree = "<group>"; };
8A1BC14522DF34910084799E /* GroupShapeRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupShapeRecord.h; sourceTree = "<group>"; };
8A1BC14622DF34910084799E /* Shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shape.h; sourceTree = "<group>"; };
8A1BC14722DF34910084799E /* BlipStoreEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlipStoreEntry.h; sourceTree = "<group>"; };
8A1BC14822DF34920084799E /* DrawingGroupRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingGroupRecord.h; sourceTree = "<group>"; };
8A1BC14922DF34920084799E /* Record.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Record.cpp; sourceTree = "<group>"; };
8A1BC14A22DF34920084799E /* SplitMenuColorContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplitMenuColorContainer.h; sourceTree = "<group>"; };
8A1BC14B22DF34920084799E /* ShapeOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeOptions.h; sourceTree = "<group>"; };
8A1BC14C22DF34920084799E /* RegularContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegularContainer.h; sourceTree = "<group>"; };
8A1BC14D22DF34920084799E /* BlipStoreContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlipStoreContainer.h; sourceTree = "<group>"; };
8A1BC14E22DF34920084799E /* RecordFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecordFactory.h; sourceTree = "<group>"; };
8A1BC14F22DF34920084799E /* DrawingRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingRecord.h; sourceTree = "<group>"; };
8A1BC15022DF34920084799E /* GroupContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupContainer.h; sourceTree = "<group>"; };
8A1BC15122DF34920084799E /* ChildAnchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildAnchor.h; sourceTree = "<group>"; };
8A1BC15222DF34920084799E /* RecordFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RecordFactory.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -541,87 +533,79 @@
6967B42F1E27C52700A129E2 /* OfficeDrawing */ = {
isa = PBXGroup;
children = (
6967B4301E27C52700A129E2 /* BitmapBlip.h */,
6967B4311E27C52700A129E2 /* BlipStoreContainer.h */,
6967B4321E27C52700A129E2 /* BlipStoreEntry.h */,
6967B4331E27C52700A129E2 /* ChildAnchor.h */,
6967B4341E27C52700A129E2 /* ClientAnchor.h */,
6967B4351E27C52700A129E2 /* ClientData.h */,
6967B4361E27C52700A129E2 /* DiagramBooleanProperties.h */,
6967B4371E27C52700A129E2 /* DrawingContainer.h */,
6967B4381E27C52700A129E2 /* DrawingGroup.h */,
6967B4391E27C52700A129E2 /* DrawingGroupRecord.h */,
6967B43A1E27C52700A129E2 /* DrawingRecord.h */,
6967B43B1E27C52700A129E2 /* FillStyleBooleanProperties.h */,
6967B43C1E27C52700A129E2 /* GeometryBooleanProperties.h */,
6967B43D1E27C52700A129E2 /* GeometryTextBooleanProperties.h */,
6967B43E1E27C52700A129E2 /* GroupContainer.h */,
6967B43F1E27C52700A129E2 /* GroupShapeBooleanProperties.h */,
6967B4401E27C52700A129E2 /* GroupShapeRecord.h */,
6967B4411E27C52700A129E2 /* LineStyleBooleanProperties.h */,
6967B4421E27C52700A129E2 /* MetafilePictBlip.h */,
6967B4431E27C52700A129E2 /* OfficeArtClientTextbox.h */,
6967B4441E27C52700A129E2 /* PathParser.h */,
6967B4451E27C52700A129E2 /* PathSegment.h */,
6967B4461E27C52700A129E2 /* ProtectionBooleanProperties.h */,
6967B4471E27C52700A129E2 /* Record.cpp */,
6967B4481E27C52700A129E2 /* Record.h */,
6967B4491E27C52700A129E2 /* RecordFactory.cpp */,
6967B44A1E27C52700A129E2 /* RecordFactory.h */,
6967B44B1E27C52700A129E2 /* RegularContainer.h */,
6967B44C1E27C52700A129E2 /* ShadowStyleBooleanProperties.h */,
6967B44D1E27C52700A129E2 /* Shape.h */,
6967B44E1E27C52700A129E2 /* ShapeContainer.h */,
6967B44F1E27C52700A129E2 /* ShapeOptions.h */,
6967B4501E27C52700A129E2 /* ShapeType.h */,
6967B4511E27C52700A129E2 /* ShapeTypeFactory.cpp */,
6967B4521E27C52700A129E2 /* ShapeTypeFactory.h */,
6967B4531E27C52700A129E2 /* Shapetypes */,
6967B4781E27C52700A129E2 /* SplitMenuColorContainer.h */,
6967B4791E27C52700A129E2 /* UnknownRecord.h */,
8A1BC11A22DF34900084799E /* BitmapBlip.h */,
8A1BC14D22DF34920084799E /* BlipStoreContainer.h */,
8A1BC14722DF34910084799E /* BlipStoreEntry.h */,
8A1BC15122DF34920084799E /* ChildAnchor.h */,
8A1BC11122DF348F0084799E /* ClientAnchor.h */,
8A1BC14422DF34910084799E /* ClientData.h */,
8A1BC11422DF34900084799E /* DiagramBooleanProperties.h */,
8A1BC11722DF34900084799E /* DrawingContainer.h */,
8A1BC11C22DF34910084799E /* DrawingGroup.h */,
8A1BC14822DF34920084799E /* DrawingGroupRecord.h */,
8A1BC14F22DF34920084799E /* DrawingRecord.h */,
8A1BC15022DF34920084799E /* GroupContainer.h */,
8A1BC14522DF34910084799E /* GroupShapeRecord.h */,
8A1BC11522DF34900084799E /* MetafilePictBlip.h */,
8A1BC11322DF34900084799E /* OfficeArtClientTextbox.h */,
8A1BC11B22DF34910084799E /* OfficeArtFRITContainer.h */,
8A1BC14922DF34920084799E /* Record.cpp */,
8A1BC11922DF34900084799E /* Record.h */,
8A1BC15222DF34920084799E /* RecordFactory.cpp */,
8A1BC14E22DF34920084799E /* RecordFactory.h */,
8A1BC14C22DF34920084799E /* RegularContainer.h */,
8A1BC14622DF34910084799E /* Shape.h */,
8A1BC11D22DF34910084799E /* ShapeContainer.h */,
8A1BC14B22DF34920084799E /* ShapeOptions.h */,
8A1BC11E22DF34910084799E /* ShapeType.h */,
8A1BC11622DF34900084799E /* ShapeTypeFactory.cpp */,
8A1BC11222DF34900084799E /* ShapeTypeFactory.h */,
8A1BC11F22DF34910084799E /* Shapetypes */,
8A1BC14A22DF34920084799E /* SplitMenuColorContainer.h */,
8A1BC11822DF34900084799E /* UnknownRecord.h */,
);
path = OfficeDrawing;
sourceTree = "<group>";
};
6967B4531E27C52700A129E2 /* Shapetypes */ = {
8A1BC11F22DF34910084799E /* Shapetypes */ = {
isa = PBXGroup;
children = (
6967B4541E27C52700A129E2 /* ArcType.h */,
6967B4551E27C52700A129E2 /* ArrowType.h */,
6967B4561E27C52700A129E2 /* BevelType.h */,
6967B4571E27C52700A129E2 /* BlockArcType.h */,
6967B4581E27C52700A129E2 /* BracketsType.h */,
6967B4591E27C52700A129E2 /* CalloutsType.h */,
6967B45A1E27C52700A129E2 /* CanType.h */,
6967B45B1E27C52700A129E2 /* Connector.h */,
6967B45C1E27C52700A129E2 /* CubeType.h */,
6967B45D1E27C52700A129E2 /* DiamondType.h */,
6967B45E1E27C52700A129E2 /* DonutType.h */,
6967B45F1E27C52700A129E2 /* FlowChartType.h */,
6967B4601E27C52700A129E2 /* FoldedCornerlType.h */,
6967B4611E27C52700A129E2 /* HeartType.h */,
6967B4621E27C52700A129E2 /* HexagonType.h */,
6967B4631E27C52700A129E2 /* IsoscelesTriangleType.h */,
6967B4641E27C52700A129E2 /* LightningBoltType.h */,
6967B4651E27C52700A129E2 /* LineType.h */,
6967B4661E27C52700A129E2 /* MoonType.h */,
6967B4671E27C52700A129E2 /* NoSmokingType.h */,
6967B4681E27C52700A129E2 /* OctagonType.h */,
6967B4691E27C52700A129E2 /* OvalType.h */,
6967B46A1E27C52700A129E2 /* ParallelogramType.h */,
6967B46B1E27C52700A129E2 /* PentagonType.h */,
6967B46C1E27C52700A129E2 /* PictureFrameType.h */,
6967B46D1E27C52700A129E2 /* PlaqueType.h */,
6967B46E1E27C52700A129E2 /* PlusType.h */,
6967B46F1E27C52700A129E2 /* RectangleType.h */,
6967B4701E27C52700A129E2 /* RightTriangleType.h */,
6967B4711E27C52700A129E2 /* RoundedRectangleType.h */,
6967B4721E27C52700A129E2 /* SmileyFaceType.h */,
6967B4731E27C52700A129E2 /* StarType.h */,
6967B4741E27C52700A129E2 /* SunType.h */,
6967B4751E27C52700A129E2 /* TextboxType.h */,
6967B4761E27C52700A129E2 /* TrapezoidType.h */,
6967B4771E27C52700A129E2 /* WordArtText.h */,
8A1BC12022DF34910084799E /* PlaqueType.h */,
8A1BC12122DF34910084799E /* CubeType.h */,
8A1BC12222DF34910084799E /* LightningBoltType.h */,
8A1BC12322DF34910084799E /* OvalType.h */,
8A1BC12422DF34910084799E /* CalloutsType.h */,
8A1BC12522DF34910084799E /* TextboxType.h */,
8A1BC12622DF34910084799E /* HexagonType.h */,
8A1BC12722DF34910084799E /* NoSmokingType.h */,
8A1BC12822DF34910084799E /* OctagonType.h */,
8A1BC12922DF34910084799E /* ArcType.h */,
8A1BC12A22DF34910084799E /* CanType.h */,
8A1BC12B22DF34910084799E /* PictureFrameType.h */,
8A1BC12C22DF34910084799E /* BevelType.h */,
8A1BC12D22DF34910084799E /* MoonType.h */,
8A1BC12E22DF34910084799E /* FoldedCornerlType.h */,
8A1BC12F22DF34910084799E /* PentagonType.h */,
8A1BC13022DF34910084799E /* BracketsType.h */,
8A1BC13122DF34910084799E /* IsoscelesTriangleType.h */,
8A1BC13222DF34910084799E /* StarType.h */,
8A1BC13322DF34910084799E /* DonutType.h */,
8A1BC13422DF34910084799E /* RectangleType.h */,
8A1BC13522DF34910084799E /* TrapezoidType.h */,
8A1BC13622DF34910084799E /* ArrowType.h */,
8A1BC13722DF34910084799E /* SmileyFaceType.h */,
8A1BC13822DF34910084799E /* PlusType.h */,
8A1BC13922DF34910084799E /* RightTriangleType.h */,
8A1BC13A22DF34910084799E /* HeartType.h */,
8A1BC13B22DF34910084799E /* SunType.h */,
8A1BC13C22DF34910084799E /* Connector.h */,
8A1BC13D22DF34910084799E /* RoundedRectangleType.h */,
8A1BC13E22DF34910084799E /* BlockArcType.h */,
8A1BC13F22DF34910084799E /* WordArtText.h */,
8A1BC14022DF34910084799E /* FlowChartType.h */,
8A1BC14122DF34910084799E /* LineType.h */,
8A1BC14222DF34910084799E /* DiamondType.h */,
8A1BC14322DF34910084799E /* ParallelogramType.h */,
);
path = Shapetypes;
sourceTree = "<group>";
@ -667,6 +651,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 6967B2E21E27C23A00A129E2;
@ -687,7 +672,6 @@
6967B4D11E27C52700A129E2 /* LanguageIdMapping.cpp in Sources */,
6967B4E61E27C52700A129E2 /* SinglePropertyModifier.cpp in Sources */,
6967B4C91E27C52700A129E2 /* EncryptionHeader.cpp in Sources */,
6967B4D71E27C52700A129E2 /* Record.cpp in Sources */,
6967B4ED1E27C52700A129E2 /* TableMapping.cpp in Sources */,
6967B4F31E27C52700A129E2 /* VMLShapeTypeMapping.cpp in Sources */,
6967B4E31E27C52700A129E2 /* RevisionData.cpp in Sources */,
@ -699,18 +683,18 @@
6967B4E21E27C52700A129E2 /* PropertyExceptions.cpp in Sources */,
6967B4C31E27C52700A129E2 /* AnnotationReferenceDescriptor.cpp in Sources */,
6967B4D31E27C52700A129E2 /* ListLevel.cpp in Sources */,
8A1BC15322DF34920084799E /* ShapeTypeFactory.cpp in Sources */,
6967B4CB1E27C52700A129E2 /* FontTableMapping.cpp in Sources */,
6967B4EC1E27C52700A129E2 /* TableCellPropertiesMapping.cpp in Sources */,
6967B4D81E27C52700A129E2 /* RecordFactory.cpp in Sources */,
6967B4C61E27C52700A129E2 /* DocumentMapping.cpp in Sources */,
6967B4CA1E27C52700A129E2 /* FontFamilyName.cpp in Sources */,
6967B4F21E27C52700A129E2 /* VMLShapeMapping.cpp in Sources */,
6967B4C71E27C52700A129E2 /* DocumentProperties.cpp in Sources */,
6967B4EF1E27C52700A129E2 /* TableRowPropertiesMapping.cpp in Sources */,
8A1BC15422DF34920084799E /* Record.cpp in Sources */,
6967B4E01E27C52700A129E2 /* PieceTable.cpp in Sources */,
6967B4E81E27C52700A129E2 /* StyleSheet.cpp in Sources */,
6967B4EA1E27C52700A129E2 /* StyleSheetInformation.cpp in Sources */,
6967B4D91E27C52700A129E2 /* ShapeTypeFactory.cpp in Sources */,
6967B4D01E27C52700A129E2 /* HeaderMapping.cpp in Sources */,
6967B4DA1E27C52700A129E2 /* OleObject.cpp in Sources */,
6967B4D61E27C52700A129E2 /* NumberingMapping.cpp in Sources */,
@ -724,6 +708,7 @@
6967B4C51E27C52700A129E2 /* Converter.cpp in Sources */,
6967B4E91E27C52700A129E2 /* StyleSheetDescription.cpp in Sources */,
6967B4E41E27C52700A129E2 /* SectionPropertiesMapping.cpp in Sources */,
8A1BC15522DF34920084799E /* RecordFactory.cpp in Sources */,
6967B4EE1E27C52700A129E2 /* TablePropertiesMapping.cpp in Sources */,
6967B4D51E27C52700A129E2 /* MainDocumentMapping.cpp in Sources */,
6967B4E51E27C52700A129E2 /* SettingsMapping.cpp in Sources */,
@ -835,16 +820,6 @@
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = 2WH24U26GJ;
GCC_PREPROCESSOR_DEFINITIONS = (
UNICODE,
_UNICODE,
_USE_XMLLITE_READER_,
USE_LITE_READER,
USE_ATL_CSTRING,
_USE_LIBXML2_READER_,
LIBXML_READER_ENABLED,
_IOS,
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
@ -866,16 +841,6 @@
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = 2WH24U26GJ;
GCC_PREPROCESSOR_DEFINITIONS = (
UNICODE,
_UNICODE,
_USE_XMLLITE_READER_,
USE_LITE_READER,
USE_ATL_CSTRING,
_USE_LIBXML2_READER_,
LIBXML_READER_ENABLED,
_IOS,
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,

View File

@ -2,20 +2,17 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatLib", "..\DocFormatLib\Win32\DocFormatLib.vcproj", "{C5371405-338F-4B70-83BD-2A5CDF64F383}"
ProjectSection(ProjectDependencies) = postProject
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C}
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsFormat", "..\..\ASCOfficeXlsFile2\source\win32\XlsFormat.vcproj", "{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatTest", "DocFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
ProjectSection(ProjectDependencies) = postProject
{C5371405-338F-4B70-83BD-2A5CDF64F383} = {C5371405-338F-4B70-83BD-2A5CDF64F383}
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF} = {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C}
{C5371405-338F-4B70-83BD-2A5CDF64F383} = {C5371405-338F-4B70-83BD-2A5CDF64F383}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\..\Common\DocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"

View File

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

View File

@ -45,7 +45,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../DesktopEditor/xml/build/vs2005;../../DesktopEditor/xml/libxml2/include;../../DesktopEditor/freetype-2.5.2/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS;DONT_USED_EXTRA_LIBRARY"
MinimalRebuild="false"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -345,6 +345,14 @@
RelativePath="..\..\DesktopEditor\common\Base64.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Writer\BinaryReader.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Reader\BinaryWriter.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\BinWriter\BinWriters.cpp"
>

View File

@ -41,6 +41,8 @@ namespace Writers
static std::wstring g_string_comment_End = _T("</w:comments>");
static std::wstring g_string_commentExt_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w15:commentsEx xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\">");
static std::wstring g_string_commentExt_End = _T("</w15:commentsEx>");
static std::wstring g_string_commentsIds_Start = _T("<w16cid:commentsIds mc:Ignorable=\"w16cid\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:w16cid=\"http://schemas.microsoft.com/office/word/2016/wordml/cid\">");
static std::wstring g_string_commentsIds_End = _T("</w16cid:commentsIds>");
static std::wstring g_string_people_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w15:people xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\">");
static std::wstring g_string_people_End = _T("</w15:people>");
@ -50,21 +52,25 @@ namespace Writers
public:
std::wstring m_sComment;
std::wstring m_sCommentExt;
std::wstring m_sCommentsIds;
std::wstring m_sPeople;
std::wstring m_sDocumentComment;
std::wstring m_sDocumentCommentExt;
std::wstring m_sDocumentCommentsIds;
std::wstring m_sDocumentPeople;
CommentsWriter(std::wstring sDir) : m_sDir(sDir)
{
}
void setElements(std::wstring& sComment, std::wstring& sCommentExt, std::wstring& sPeople, std::wstring& sDocumentComment, std::wstring& sDocumentCommentExt, std::wstring& sDocumentPeople)
void setElements(std::wstring& sComment, std::wstring& sCommentExt, std::wstring& sCommentsIds, std::wstring& sPeople, std::wstring& sDocumentComment, std::wstring& sDocumentCommentExt, std::wstring& sDocumentCommentsIds, std::wstring& sDocumentPeople)
{
m_sComment = sComment;
m_sCommentExt = sCommentExt;
m_sCommentsIds = sCommentsIds;
m_sPeople = sPeople;
m_sDocumentComment = sDocumentComment;
m_sDocumentCommentExt = sDocumentCommentExt;
m_sDocumentCommentsIds = sDocumentCommentsIds;
m_sDocumentPeople = sDocumentPeople;
}
void Write()
@ -90,6 +96,15 @@ namespace Writers
oFile.WriteStringUTF8(g_string_commentExt_End);
oFile.CloseFile();
}
if(false == m_sCommentsIds.empty())
{
NSFile::CFileBinary oFile;
oFile.CreateFileW(sDir + OOX::FileTypes::CommentsIds.DefaultFileName().GetPath());
oFile.WriteStringUTF8(g_string_commentsIds_Start);
oFile.WriteStringUTF8(m_sCommentsIds);
oFile.WriteStringUTF8(g_string_commentsIds_End);
oFile.CloseFile();
}
if(false == m_sPeople.empty())
{
NSFile::CFileBinary oFile;
@ -120,6 +135,15 @@ namespace Writers
oFile.WriteStringUTF8(g_string_commentExt_End);
oFile.CloseFile();
}
if(false == m_sDocumentCommentsIds.empty())
{
NSFile::CFileBinary oFile;
oFile.CreateFileW(sDir + OOX::FileTypes::DocumentCommentsIds.DefaultFileName().GetPath());
oFile.WriteStringUTF8(g_string_commentsIds_Start);
oFile.WriteStringUTF8(m_sDocumentCommentsIds);
oFile.WriteStringUTF8(g_string_commentsIds_End);
oFile.CloseFile();
}
if(false == m_sDocumentPeople.empty())
{
NSFile::CFileBinary oFile;

View File

@ -29,10 +29,13 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef READER_CLASSES
#define READER_CLASSES
#include "../../Common/DocxFormat/Source/XML/Utils.h"
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_Word.h"
#include <boost/algorithm/string.hpp>
@ -60,6 +63,8 @@ public:
std::wstring pgBorders;
std::wstring footnotePr;
std::wstring endnotePr;
bool RtlGutter;
long Gutter;
bool bW;
bool bH;
@ -74,6 +79,8 @@ public:
bool bEvenAndOddHeaders;
bool bSectionType;
bool bPageNumStart;
bool bRtlGutter;
bool bGutter;
SectPr()
{
sHeaderFooterReference = _T("");
@ -92,6 +99,7 @@ public:
bEvenAndOddHeaders = false;
bSectionType = false;
bPageNumStart = false;
bRtlGutter = false;
}
std::wstring Write()
{
@ -150,7 +158,9 @@ public:
sRes += L" w:header=\"" + std::to_wstring(Header) + L"\"";
if(bFooter)
sRes += L" w:footer=\"" + std::to_wstring(Footer) + L"\"";
sRes += L" w:gutter=\"0\"/>";
if(bGutter)
sRes += L" w:gutter=\"" + std::to_wstring(Gutter) + L"\"";
sRes += L"/>";
}
if(!pgBorders.empty())
sRes += pgBorders;
@ -158,6 +168,14 @@ public:
if(bPageNumStart)
sRes += L"<w:pgNumType w:start=\"" + std::to_wstring(PageNumStart) + L"\"/>";
if(bRtlGutter)
{
if(RtlGutter)
sRes += L"<w:rtlGutter/>";
else
sRes += L"<w:rtlGutter w:val=\"0\"/>";
}
if(!cols.empty())
sRes += cols;
sRes += L"<w:docGrid w:linePitch=\"360\"/>";
@ -422,13 +440,12 @@ public:
class Tab
{
public:
BYTE Val;
SimpleTypes::CTabJc<> Val;
long Pos;
BYTE Leader;
bool bLeader;
Tab()
{
Val = shd_Nil;
Pos = 0;
bLeader = false;
}
@ -671,8 +688,8 @@ public:
{
if(DStrikeout)
pCStringWriter->WriteString(L"<w:dstrike/>");
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(L"<w:dstrike w:val=\"false\"/>");
//else if(false == bDoNotWriteNullProp)
// pCStringWriter->WriteString(L"<w:dstrike w:val=\"false\"/>");
}
if(bVanish)
{
@ -1389,7 +1406,9 @@ class docLvl
public:
long ILvl;
long Format;
std::wstring sFormat;
BYTE Jc;
std::wstring sJc;
std::vector<docLvlText*> Text;
long Restart;
long Start;
@ -1474,19 +1493,34 @@ public:
{
oWriter.WriteString(L"<w:start w:val=\"" + std::to_wstring(Start) + L"\"/>");
}
if(bFormat)
if(!sFormat.empty())
{
oWriter.WriteString(sFormat);
}
else if(bFormat)
{
std::wstring sFormat;
switch(Format)
{
case numbering_numfmt_None:sFormat = _T("none");break;
case numbering_numfmt_Bullet:sFormat = _T("bullet");break;
case numbering_numfmt_Decimal:sFormat = _T("decimal");break;
case numbering_numfmt_LowerRoman:sFormat = _T("lowerRoman");break;
case numbering_numfmt_UpperRoman:sFormat = _T("upperRoman");break;
case numbering_numfmt_LowerLetter:sFormat = _T("lowerLetter");break;
case numbering_numfmt_UpperLetter:sFormat = _T("upperLetter");break;
case numbering_numfmt_DecimalZero:sFormat = _T("decimalZero");break;
case numbering_numfmt_None: sFormat = L"none"; break;
case numbering_numfmt_Bullet: sFormat = L"bullet"; break;
case numbering_numfmt_Decimal: sFormat = L"decimal"; break;
case numbering_numfmt_LowerRoman: sFormat = L"lowerRoman"; break;
case numbering_numfmt_UpperRoman: sFormat = L"upperRoman"; break;
case numbering_numfmt_LowerLetter: sFormat = L"lowerLetter"; break;
case numbering_numfmt_UpperLetter: sFormat = L"upperLetter"; break;
case numbering_numfmt_DecimalZero: sFormat = L"decimalZero"; break;
default:
{
Format -= 0x2008;
if (Format >= 0)
{
SimpleTypes::CNumberFormat<> numFormat;
numFormat.SetValue((SimpleTypes::ENumberFormat)Format);
sFormat = numFormat.ToString();
}
}break;
}
if(!sFormat.empty())
{
@ -1571,19 +1605,23 @@ public:
}
oWriter.WriteString(L"/>");
}
if(bJc)
if(!sJc.empty())
{
std::wstring sJc;
oWriter.WriteString(sJc);
}
else if(bJc)
{
std::wstring sJcType;
switch(Jc)
{
case align_Right:sJc = _T("right");break;
case align_Left:sJc = _T("left");break;
case align_Center:sJc = _T("center");break;
case align_Justify:sJc = _T("distribute");break;
case align_Right:sJcType = _T("right");break;
case align_Left:sJcType = _T("left");break;
case align_Center:sJcType = _T("center");break;
case align_Justify:sJcType = _T("distribute");break;
}
if(!sJc.empty())
if(!sJcType.empty())
{
oWriter.WriteString(L"<w:lvlJc w:val=\"" + sJc + L"\"/>");
oWriter.WriteString(L"<w:lvlJc w:val=\"" + sJcType + L"\"/>");
}
}
if(bParaPr)
@ -1874,10 +1912,13 @@ public:
int IdOpen;
int IdFormat;
std::wstring UserName;
std::wstring Initials;
std::wstring UserId;
std::wstring ProviderId;
std::wstring Date;
std::wstring OOData;
bool Solved;
unsigned int DurableId;
std::wstring Text;
std::wstring m_sParaId;
std::wstring m_sParaIdParent;
@ -1886,12 +1927,14 @@ public:
bool bIdOpen;
bool bIdFormat;
bool bSolved;
bool bDurableId;
public:
CComment(IdCounter& oParaIdCounter, IdCounter& oFormatIdCounter):m_oParaIdCounter(oParaIdCounter),m_oFormatIdCounter(oFormatIdCounter)
{
bIdOpen = false;
bIdFormat = false;
bSolved = false;
bDurableId = false;
}
~CComment()
{
@ -1928,15 +1971,6 @@ public:
}
return sRes;
}
std::wstring writeTemplates(bool isExt)
{
std::wstring sRes;
sRes += isExt ? writeContentExt(this) : writeContent(this);
for(size_t i = 0; i < replies.size(); ++i)
sRes += isExt ? writeContentExt(replies[i]) : writeContent(replies[i]);
return sRes;
}
static std::wstring writeRef(CComment* pComment, const std::wstring& sBefore, const std::wstring& sRef, const std::wstring& sAfter)
{
std::wstring sRes;
@ -1950,7 +1984,7 @@ public:
sRes += (sAfter);
return sRes;
}
static bool writeContentWritePart(CComment* pComment, std::wstring& sText, int nPrevIndex, int nCurIndex, bool bFirst, std::wstring& sRes)
static void writeContentWritePart(CComment* pComment, std::wstring& sText, int nPrevIndex, int nCurIndex, std::wstring& sRes)
{
std::wstring sPart;
if(nPrevIndex < nCurIndex)
@ -1958,17 +1992,11 @@ public:
int nId = pComment->m_oParaIdCounter.getNextId();
std::wstring sId = XmlUtils::IntToString(nId, L"%08X");
if(bFirst)
{
bFirst = false;
pComment->m_sParaId = sId;
}
sRes += L"<w:p w14:paraId=\"" + sId + L"\" w14:textId=\"" + sId + L"\">";
pComment->m_sParaId = XmlUtils::IntToString(nId, L"%08X");
sRes += L"<w:p w14:paraId=\"" + pComment->m_sParaId + L"\" w14:textId=\"" + pComment->m_sParaId + L"\">";
sRes += L"<w:pPr><w:spacing w:line=\"240\" w:after=\"0\" w:lineRule=\"auto\" w:before=\"0\"/><w:ind w:firstLine=\"0\" w:left=\"0\" w:right=\"0\"/><w:jc w:val=\"left\"/></w:pPr><w:r><w:rPr><w:rFonts w:eastAsia=\"Arial\" w:ascii=\"Arial\" w:hAnsi=\"Arial\" w:cs=\"Arial\"/><w:sz w:val=\"22\"/></w:rPr><w:t xml:space=\"preserve\">";
sRes += sPart;
sRes += L"</w:t></w:r></w:p>";
return bFirst;
}
static std::wstring writeContent(CComment* pComment)
{
@ -1979,22 +2007,12 @@ public:
pComment->IdFormat = pComment->m_oFormatIdCounter.getNextId();
}
sRes += L"<w:comment w:id=\"" + std::to_wstring(pComment->IdFormat) + L"\"";
std::wstring sInitials;
if(false == pComment->UserName.empty())
{
std::wstring sUserName = XmlUtils::EncodeXmlString(pComment->UserName);
sRes += L" w:author=\"";
sRes += (sUserName);
sRes += L"\"";
//делаем initials
std::vector<std::wstring> arSplit;
boost::algorithm::split(arSplit, pComment->UserName, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
for (size_t i = 0; i < arSplit.size(); i++)
{
sInitials += arSplit[i][0];
}
sRes += L"\"";
}
if(false == pComment->Date.empty())
{
@ -2010,11 +2028,10 @@ public:
sRes += sData;
sRes += L"\"";
}
if(false == sInitials.empty())
if(false == pComment->Initials.empty())
{
sInitials = XmlUtils::EncodeXmlString(sInitials);
sRes += L" w:initials=\"";
sRes += sInitials;
sRes += XmlUtils::EncodeXmlString(pComment->Initials);
sRes += L"\"";
}
sRes += L">";
@ -2022,18 +2039,17 @@ public:
XmlUtils::replace_all(sText, L"\r", L"");
bool bFirst = true;
int nPrevIndex = 0;
for (int i = 0; i < (int)sText.length(); i++)
{
wchar_t cToken = sText[i];
if('\n' == cToken)
{
bFirst = writeContentWritePart(pComment, sText, nPrevIndex, i, bFirst, sRes);
writeContentWritePart(pComment, sText, nPrevIndex, i, sRes);
nPrevIndex = i + 1;
}
}
writeContentWritePart(pComment, sText, nPrevIndex, (int)sText.length(), bFirst, sRes);
writeContentWritePart(pComment, sText, nPrevIndex, (int)sText.length(), sRes);
sRes += L"</w:comment>";
return sRes;
}
@ -2056,18 +2072,32 @@ w15:paraIdParent=\"" + pComment->m_sParaIdParent + L"\" w15:done=\"" + sDone + L
}
return sRes;
}
static std::wstring writeContentsIds(CComment* pComment)
{
std::wstring sRes;
if(!pComment->m_sParaId.empty() && pComment->bDurableId)
{
sRes += L"<w16cid:commentId w16cid:paraId=\"" + pComment->m_sParaId + L"\" w16cid:durableId=\"" + XmlUtils::IntToString(pComment->DurableId, L"%08X") + L"\"/>";
}
return sRes;
}
static std::wstring writePeople(CComment* pComment)
{
std::wstring sRes;
if(false == pComment->UserName.empty() && false == pComment->UserId.empty())
if(false == pComment->UserName.empty())
{
std::wstring sUserName = XmlUtils::EncodeXmlString(pComment->UserName);
std::wstring sUserId = XmlUtils::EncodeXmlString(pComment->UserId);
sRes += L"<w15:person w15:author=\"";
sRes += sUserName;
sRes += L"\"><w15:presenceInfo w15:providerId=\"Teamlab\" w15:userId=\"";
sRes += sUserId;
sRes += L"\"/></w15:person>";
sRes += XmlUtils::EncodeXmlString(pComment->UserName);
sRes += L"\">";
if(!pComment->ProviderId.empty() && !pComment->UserId.empty())
{
sRes += L"<w15:presenceInfo w15:providerId=\"";
sRes += XmlUtils::EncodeXmlString(pComment->ProviderId);
sRes += L"\" w15:userId=\"";
sRes += XmlUtils::EncodeXmlString(pComment->UserId);
sRes += L"\"/>";
}
sRes += L"</w15:person>";
}
return sRes;
}
@ -2123,7 +2153,9 @@ public:
std::wstring sRes;
for (boost::unordered_map<int, CComment*>::const_iterator it = m_mapComments.begin(); it != m_mapComments.end(); ++it)
{
sRes += it->second->writeTemplates(false);
sRes += CComment::writeContent(it->second);
for(size_t i = 0; i < it->second->replies.size(); ++i)
sRes += CComment::writeContent(it->second->replies[i]);
}
return sRes;
}
@ -2132,7 +2164,20 @@ public:
std::wstring sRes;
for (boost::unordered_map<int, CComment*>::const_iterator it = m_mapComments.begin(); it != m_mapComments.end(); ++it)
{
sRes += it->second->writeTemplates(true);
sRes += CComment::writeContentExt(it->second);
for(size_t i = 0; i < it->second->replies.size(); ++i)
sRes += CComment::writeContentExt(it->second->replies[i]);
}
return sRes;
}
std::wstring writeContentsIds()
{
std::wstring sRes;
for (boost::unordered_map<int, CComment*>::const_iterator it = m_mapComments.begin(); it != m_mapComments.end(); ++it)
{
sRes += CComment::writeContentsIds(it->second);
for(size_t i = 0; i < it->second->replies.size(); ++i)
sRes += CComment::writeContentsIds(it->second->replies[i]);
}
return sRes;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -37,14 +37,14 @@
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:compat><w:compatSetting w:name=\"compatibilityMode\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"15\"/><w:compatSetting w:name=\"overrideTableStyleFontSizeAndJustification\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"enableOpenTypeFeatures\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"doNotFlipMirrorIndents\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/></w:compat><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><w:decimalSymbol w:val=\".\"/><w:listSeparator w:val=\",\"/>");
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;
std::wstring m_sDir;
NSStringUtils::CStringBuilder m_oSettingWriter;
HeaderFooterWriter& m_oHeaderFooterWriter;
public:
SettingWriter(std::wstring sDir, HeaderFooterWriter& oHeaderFooterWriter):m_sDir(sDir),m_oHeaderFooterWriter(oHeaderFooterWriter)
{

View File

@ -34,8 +34,9 @@
#include "BinReaderWriterDefines.h"
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_OMath.h"
#include "../../Common/DocxFormat/Source/MathEquation/OutputDev.h"
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_OMath.h"
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_Shared.h"
#include <stack>
namespace MathEquation

View File

@ -36,9 +36,6 @@ namespace BinDocxRW
{
const double eps = 0.001;
const int shd_Clear = 0;
const int shd_Nil = 1;
const int g_tabtype_left = 0;
const int g_tabtype_right = 1;
const int g_tabtype_center = 2;
@ -173,7 +170,7 @@ extern int g_nCurFormatVersion;
AbstractNum_Lvls = 4,
Lvl = 5,
lvl_Format = 6,//deprecated (instead use lvl_NumFmt)
lvl_Jc = 7,
lvl_Jc_deprecated = 7,//deprecated
lvl_LvlText = 8,
lvl_LvlTextItem = 9,
lvl_LvlTextItemText = 10,
@ -202,7 +199,8 @@ extern int g_nCurFormatVersion;
LvlLegacy = 33,
Legacy = 34,
LegacyIndent = 35,
LegacySpace = 36
LegacySpace = 36,
lvl_Jc = 37
};}
namespace c_oSerOtherTableTypes{enum c_oSerOtherTableTypes
{
@ -345,7 +343,7 @@ extern int g_nCurFormatVersion;
Tab = 17,
Tab_Item = 18,
Tab_Item_Pos = 19,
Tab_Item_Val = 20,
Tab_Item_Val_deprecated = 20,
ParaStyle = 21,
numPr = 22,
numPr_lvl = 23,
@ -367,7 +365,8 @@ extern int g_nCurFormatVersion;
Spacing_LineTwips = 39,
Spacing_BeforeTwips = 40,
Spacing_AfterTwips = 41,
Tab_Item_PosTwips = 42
Tab_Item_PosTwips = 42,
Tab_Item_Val = 43
};}
namespace c_oSerProp_rPrType{enum c_oSerProp_rPrType
{
@ -467,7 +466,8 @@ extern int g_nCurFormatVersion;
cols = 8,
pgBorders = 9,
footnotePr = 10,
endnotePr = 11
endnotePr = 11,
rtlGutter = 12
};}
namespace c_oSerProp_secPrSettingsType{enum c_oSerProp_secPrSettingsType
{
@ -506,7 +506,8 @@ extern int g_nCurFormatVersion;
JsaProject = 22,
BookmarkStart = 23,
BookmarkEnd = 24,
MRun = 25
MRun = 25,
AltChunk = 26
};}
namespace c_oSerDocTableType{enum c_oSerDocTableType
{
@ -524,7 +525,11 @@ extern int g_nCurFormatVersion;
Sdt = 10,
BookmarkStart = 11,
BookmarkEnd = 12,
tblGrid_ItemTwips = 13
tblGrid_ItemTwips = 13,
MoveFromRangeStart = 14,
MoveFromRangeEnd = 15,
MoveToRangeStart = 16,
MoveToRangeEnd = 17
};}
namespace c_oSerRunType{enum c_oSerRunType
{
@ -778,7 +783,8 @@ extern int g_nCurFormatVersion;
RightTwips = 8,
BottomTwips = 9,
HeaderTwips = 10,
FooterTwips = 11
FooterTwips = 11,
GutterTwips = 12
};}
namespace c_oSer_ColorType{enum c_oSer_ColorType
{
@ -797,7 +803,9 @@ extern int g_nCurFormatVersion;
QuoteText = 7,
Solved = 8,
Replies = 9,
OOData = 10
OOData = 10,
DurableId = 11,
ProviderId = 12
};}
namespace c_oSer_SettingsType{enum c_oSer_SettingsType
{
@ -810,7 +818,15 @@ extern int g_nCurFormatVersion;
SdtGlobalColor = 6,
SdtGlobalShowHighlight = 7,
Compat = 8,
DefaultTabStopTwips = 9
DefaultTabStopTwips = 9,
DecimalSymbol = 10,
ListSeparator = 11,
GutterAtTop = 12,
MirrorMargins = 13,
PrintTwoOnOne = 14,
BookFoldPrinting = 15,
BookFoldPrintingSheets = 16,
BookFoldRevPrinting = 17
};}
namespace c_oSer_MathPrType{enum c_oSer_SettingsType
{
@ -977,7 +993,11 @@ extern int g_nCurFormatVersion;
columnbreak = 64,
ARPr = 65,
BookmarkStart = 66,
BookmarkEnd = 67
BookmarkEnd = 67,
MoveFromRangeStart = 68,
MoveFromRangeEnd = 69,
MoveToRangeStart = 70,
MoveToRangeEnd = 71
};}
namespace c_oSer_FramePrType{ enum c_oSer_FramePrType
{
@ -1148,7 +1168,13 @@ extern int g_nCurFormatVersion;
Temporary = 34,
MultiLine = 35,
Appearance = 36,
Color = 37
Color = 37,
Checkbox = 38,
CheckboxChecked = 39,
CheckboxCheckedFont = 40,
CheckboxCheckedVal = 41,
CheckboxUncheckedFont = 42,
CheckboxUncheckedVal = 43
};}
namespace c_oSerFFData{enum c_oSerFFData
{
@ -1202,7 +1228,10 @@ extern int g_nCurFormatVersion;
CompatSetting = 0,
CompatName = 1,
CompatUri = 2,
CompatValue = 3
CompatValue = 3,
Flags1 = 4,
Flags2 = 5,
Flags3 = 6
};}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -187,7 +187,7 @@ namespace BinXlsxRW{
{
OOX::Spreadsheet::CText* pText = new OOX::Spreadsheet::CText();
pText->m_sText = aSharedStrings[i];
if(std::wstring::npos == pText->m_sText.find(_T(" ")))
if(std::wstring::npos != pText->m_sText.find(_T(" ")))
{
pText->m_oSpace.Init();
pText->m_oSpace->SetValue(SimpleTypes::xmlspacePreserve);
@ -277,13 +277,20 @@ namespace BinXlsxRW{
pTable->m_oTable->m_oTableStyleInfo->m_oShowColumnStripes.Init();
pTable->m_oTable->m_oTableStyleInfo->m_oShowColumnStripes->FromBool(false);
pTable->m_oTable->m_oTableColumns.Init();
for(size_t i = 0; i < m_aTableNames.size(); ++i)
{
OOX::Spreadsheet::CTableColumn* pTableColumn = new OOX::Spreadsheet::CTableColumn();
pTableColumn->m_oId.Init();
pTableColumn->m_oId->SetValue((unsigned int)i + 1);
pTableColumn->m_oName.Init();
pTableColumn->m_oName->append(m_aTableNames[i]);
if (!pTableColumn->m_oId.IsInit())
{
pTableColumn->m_oId.Init();
pTableColumn->m_oId->SetValue((unsigned int)i + 1);
}
if (!pTableColumn->m_oName.IsInit())
{
pTableColumn->m_oName = m_aTableNames[i];
}
pTable->m_oTable->m_oTableColumns->m_arrItems.push_back(pTableColumn);
}
pTable->m_oTable->m_oTableColumns->m_oCount.Init();

View File

@ -30,15 +30,20 @@
*
*/
#include "DocxSerializer.h"
#include "../BinWriter/BinWriters.h"
#include "../BinReader/Readers.h"
#include "../../ASCOfficePPTXFile/ASCOfficeDrawingConverter.h"
#include "../../ASCOfficePPTXFile/Editor/FontPicker.h"
#include "FontProcessor.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../../DesktopEditor/common/File.h"
#include "../../DesktopEditor/common/Path.h"
#include "../../DesktopEditor/common/SystemUtils.h"
#include "../BinWriter/BinWriters.h"
#include "../BinReader/Readers.h"
#include "../../ASCOfficePPTXFile/Editor/FontPicker.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../Common/DocxFormat/Source/DocxFormat/App.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Core.h"

View File

@ -32,6 +32,8 @@ SOURCES += \
../../XlsxSerializerCom/Reader/ChartFromToBinary.cpp \
../../XlsxSerializerCom/Reader/CommonWriter.cpp \
../../XlsxSerializerCom/Reader/CSVReader.cpp \
../../XlsxSerializerCom/Reader/BinaryWriter.cpp \
../../XlsxSerializerCom/Writer/BinaryReader.cpp \
../../XlsxSerializerCom/Writer/CSVWriter.cpp \
../../OfficeCryptReader/source/ECMACryptFile.cpp \
../../OfficeCryptReader/source/CryptTransform.cpp \

View File

@ -55,6 +55,8 @@
8A404FD5208A01CE00F2D5CF /* FileDownloader_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */; };
8AB24BFD213004E400E80DDD /* CustormXmlWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AB24BFB213004E300E80DDD /* CustormXmlWriter.cpp */; };
8AB24BFE213004E400E80DDD /* CustormXmlWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB24BFC213004E300E80DDD /* CustormXmlWriter.h */; };
8AE10E6E222824F400A542DE /* BinaryWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AE10E6D222824F400A542DE /* BinaryWriter.cpp */; };
8AE10E702228251000A542DE /* BinaryReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AE10E6F2228251000A542DE /* BinaryReader.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -107,6 +109,8 @@
8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileDownloader_private.h; path = ../../../Common/FileDownloader/FileDownloader_private.h; sourceTree = "<group>"; };
8AB24BFB213004E300E80DDD /* CustormXmlWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustormXmlWriter.cpp; sourceTree = "<group>"; };
8AB24BFC213004E300E80DDD /* CustormXmlWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustormXmlWriter.h; sourceTree = "<group>"; };
8AE10E6D222824F400A542DE /* BinaryWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BinaryWriter.cpp; sourceTree = "<group>"; };
8AE10E6F2228251000A542DE /* BinaryReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BinaryReader.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -215,6 +219,7 @@
isa = PBXGroup;
children = (
17E17F211AC4549B00BEA2EA /* BinaryWriter.h */,
8AE10E6D222824F400A542DE /* BinaryWriter.cpp */,
17E17F221AC4549B00BEA2EA /* ChartFromToBinary.cpp */,
17E17F231AC4549B00BEA2EA /* ChartFromToBinary.h */,
17E17F241AC4549B00BEA2EA /* CommonWriter.cpp */,
@ -230,6 +235,7 @@
children = (
17E17F2D1AC4549B00BEA2EA /* BinaryCommonReader.h */,
17E17F2E1AC4549B00BEA2EA /* BinaryReader.h */,
8AE10E6F2228251000A542DE /* BinaryReader.cpp */,
17E17F2F1AC4549B00BEA2EA /* CSVWriter.cpp */,
17E17F301AC4549B00BEA2EA /* CSVWriter.h */,
);
@ -336,6 +342,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
);
mainGroup = 17E17ED31AC453F800BEA2EA;
@ -362,11 +369,13 @@
17C1FE9B1ACC42C4006B99B3 /* CSVWriter.cpp in Sources */,
69414A301CB51666003E771B /* ChartWriter.cpp in Sources */,
6967917E1D9E8AEE002CA4BA /* BinWriters.cpp in Sources */,
8AE10E702228251000A542DE /* BinaryReader.cpp in Sources */,
69BBDF251F0B8AAC00EB1BF7 /* FileDownloader_mac.mm in Sources */,
17C1FE9C1ACC42C4006B99B3 /* XlsxSerializer.cpp in Sources */,
690FE0851E9BBD68004B26D0 /* Readers.cpp in Sources */,
17C1FE9D1ACC42C4006B99B3 /* FontProcessor.cpp in Sources */,
8A404FD3208A01AF00F2D5CF /* FileDownloader.cpp in Sources */,
8AE10E6E222824F400A542DE /* BinaryWriter.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -376,7 +385,7 @@
17C1FEC01ACC42C4006B99B3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ENABLE_BITCODE = NO;
ENABLE_BITCODE = YES;
EXECUTABLE_PREFIX = lib;
GCC_ENABLE_CPP_EXCEPTIONS = YES;
GCC_ENABLE_CPP_RTTI = YES;
@ -408,7 +417,7 @@
17C1FEC11ACC42C4006B99B3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ENABLE_BITCODE = NO;
ENABLE_BITCODE = YES;
EXECUTABLE_PREFIX = lib;
GCC_ENABLE_CPP_EXCEPTIONS = YES;
GCC_ENABLE_CPP_RTTI = YES;

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -14,8 +14,8 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17E17EDB1AC453F800BEA2EA"
BuildableName = "libASCOfficeDocxFile2Lib.a"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
@ -23,27 +23,30 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17E17EDB1AC453F800BEA2EA"
BuildableName = "libASCOfficeDocxFile2Lib.a"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
@ -52,16 +55,16 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17E17EDB1AC453F800BEA2EA"
BuildableName = "libASCOfficeDocxFile2Lib.a"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>

View File

@ -92,8 +92,9 @@ public:
std::wstring convert_conditional_formula(std::wstring const & expr);
// Лист1!$A$1 -> $Лист1.$A$1
std::wstring convert_named_ref (std::wstring const & expr);
std::wstring convert_named_ref(std::wstring const & expr);
std::wstring convert_named_formula(std::wstring const & expr);
bool is_simple_ref(std::wstring const & expr);
std::wstring get_table_name();

View File

@ -122,27 +122,64 @@ namespace formulasconvert {
XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
XmlUtils::replace_all( expr, L"SCOBCAOUT", L")");
XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
//XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
//XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
XmlUtils::replace_all( expr, L"PROBEL", L" ");
XmlUtils::replace_all( expr, L"APOSTROF", L"'");
XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
//XmlUtils::replace_all( expr, L"APOSTROF", L"'");
//XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
}
static void replace_tmp(std::wstring &expr)
{
XmlUtils::replace_all( expr, L".", L"ТОСHKA");
XmlUtils::replace_all( expr, L"!", L"VOSKL");
// XmlUtils::replace_all( expr, L".", L"ТОСHKA");
// XmlUtils::replace_all( expr, L"!", L"VOSKL");
XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
// XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
// XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
//XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
//XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
XmlUtils::replace_all( expr, L" ", L"PROBEL");
// XmlUtils::replace_all( expr, L"'", L"APOSTROF");
// XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
// //XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
// //XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
//
// XmlUtils::replace_all( expr, L" ", L"PROBEL");
//// XmlUtils::replace_all( expr, L"'", L"APOSTROF");
//// XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
std::wstring result;
size_t pos = 0, size = expr.length();
while(pos < size)
{
switch(expr[pos])
{
case '.':
{
result += L"ТОСHKA";
}break;
case '!':
{
result += L"VOSKL";
}break;
case '(':
{
result += L"SCOBCAIN";
}break;
case ')':
{
result += L"SCOBCAOUT";
}break;
case ' ':
{
result += L"PROBEL";
}break;
default:
{
result += expr[pos];
}break;
}
pos++;
}
expr = result;
}
static std::wstring convert_scobci(boost::wsmatch const & what)
{
@ -210,25 +247,41 @@ namespace formulasconvert {
bool odf2oox_converter::Impl::find_first_last_ref(std::wstring const & expr, std::wstring & table,std::wstring & ref_first,std::wstring & ref_last)
{
std::wstring workstr = expr;
workstr = boost::regex_replace(
workstr,
boost::wregex(L"('.*?')|(\".*?\")"),
&convert_scobci, boost::match_default | boost::format_all);
std::vector< std::wstring > splitted;
boost::algorithm::split(splitted, expr, boost::algorithm::is_any_of(L".:"), boost::algorithm::token_compress_on);
boost::algorithm::split(splitted, workstr, boost::algorithm::is_any_of(L".:"), boost::algorithm::token_compress_on);
bool res = false;
if (splitted.size() == 2)
{
table = splitted[0];
ref_first = splitted[1];
ref_last = splitted[1];
res = true;
}
if (splitted.size() == 3)
{
table = splitted[0];
ref_first = splitted[1];
ref_last = splitted[2];
return true;
res = true;
}
if (splitted.size() == 4)
{
table = splitted[0];
ref_first = splitted[1];
ref_last = splitted[3];
return true;
res = true;
}
return false;
replace_tmp_back( table );
return res;
}
bool odf2oox_converter::Impl::find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref)

View File

@ -133,34 +133,202 @@ public:
}
static void oox_replace_tmp_back(std::wstring &expr)
{
XmlUtils::replace_all( expr, L"ТОСHKA", L".");
XmlUtils::replace_all( expr, L"VOSKL", L"!");
std::wstring result;
XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
XmlUtils::replace_all( expr, L"SCOBCAOUT", L")");
size_t pos = 0, size = expr.length();
XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
XmlUtils::replace_all( expr, L"PROBEL", L" ");
XmlUtils::replace_all( expr, L"APOSTROF", L"'");
XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
while(pos < size)
{
if (pos + 5 >= size)
{
result += expr[pos++];
continue;
}
switch(expr[pos])
{
case 'M':
{
if ((pos + 5 < size) && (expr.substr(pos, 5) == L"MINYS"))
{
result += L"-"; pos += 5;
}
else
{
result += expr[pos++];
}
}break;
case 'T':
{
if ((pos + 6 < size) && (expr.substr(pos, 6) == L"ТОСHKA"))
{
result += L"."; pos += 6;
}
else
{
result += expr[pos++];
}
}break;
case 'V':
{
if ((pos + 5 < size) && (expr.substr(pos, 5) == L"VOSKL"))
{
result += L"!"; pos += 5;
}
else
{
result += expr[pos++];
}
}break;
case 'S':
{
if ((pos + 8 < size) && (expr.substr(pos, 8) == L"SCOBCAIN"))
{
result += L"("; pos += 8;
}
else if ((pos + 9 < size) && (expr.substr(pos, 9) == L"SCOBCAOUT"))
{
result += L")"; pos += 9;
}
else
{
result += expr[pos++];
}
}break;
case 'K':
{
if ((pos + 9 < size) && (expr.substr(pos, 9) == L"KVADRATIN"))
{
result += L"["; pos += 9;
}
else if ((pos + 10 < size) && (expr.substr(pos, 10) == L"KVADRATOUT"))
{
result += L"]"; pos += 10;
}
else if ((pos + 8 < size) && (expr.substr(pos, 8) == L"KAVYCHKA"))
{
result += L"\""; pos += 8;
}
else
{
result += expr[pos++];
}
}break;
case 'P':
{
if ((pos + 6 < size) && (expr.substr(pos, 6) == L"PROBEL"))
{
result += L" "; pos += 6;
}
else
{
result += expr[pos++];
}
}break;
case 'A':
{
if ((pos + 8 < size) && (expr.substr(pos, 8) == L"APOSTROF"))
{
result += L"'"; pos += 8;
}
else
{
result += expr[pos++];
}
}break;
default:
{
result += expr[pos++];
}break;
}
}
expr = result;
//XmlUtils::replace_all( expr, L"MINYS", L"-");
//XmlUtils::replace_all( expr, L"ТОСHKA", L".");
//XmlUtils::replace_all( expr, L"VOSKL", L"!");
//XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
//XmlUtils::replace_all( expr, L"SCOBCAOUT", L")");
//XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
//XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
//
//XmlUtils::replace_all( expr, L"PROBEL", L" ");
//XmlUtils::replace_all( expr, L"APOSTROF", L"'");
//XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
}
static void oox_replace_tmp(std::wstring &expr)
{
XmlUtils::replace_all( expr, L".", L"ТОСHKA");
XmlUtils::replace_all( expr, L"!", L"VOSKL");
std::wstring result;
XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
size_t pos = 0, size = expr.length();
XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
XmlUtils::replace_all( expr, L" ", L"PROBEL");
XmlUtils::replace_all( expr, L"'", L"APOSTROF");
XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
while(pos < size)
{
switch(expr[pos])
{
case '-':
{
result += L"MINYS";
}break;
case '.':
{
result += L"ТОСHKA";
}break;
case '!':
{
result += L"VOSKL";
}break;
case '(':
{
result += L"SCOBCAIN";
}break;
case ')':
{
result += L"SCOBCAOUT";
}break;
case '[':
{
result += L"KVADRATIN";
}break;
case ']':
{
result += L"KVADRATOUT";
}break;
case ' ':
{
result += L"PROBEL";
}break;
case '\'':
{
result += L"APOSTROF";
}break;
case '\"':
{
result += L"KAVYCHKA";
}break;
default:
{
result += expr[pos];
}break;
}
pos++;
}
expr = result;
//XmlUtils::replace_all( expr, L"-", L"MINYS");
//XmlUtils::replace_all( expr, L".", L"ТОСHKA");
//XmlUtils::replace_all( expr, L"!", L"VOSKL");
//XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
//XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
//XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
//XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
//
//XmlUtils::replace_all( expr, L" ", L"PROBEL");
//XmlUtils::replace_all( expr, L"'", L"APOSTROF");
//XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
}
static bool is_forbidden1(const std::wstring & formula)
@ -174,6 +342,7 @@ public:
}
void replace_named_ref(std::wstring & expr);
void replace_named_formula(std::wstring & expr);
bool is_simple_ref(std::wstring const & expr);
static bool isFindBaseCell_;
@ -188,14 +357,14 @@ void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr, bool bSele
if ((0 == expr.find(L"KAVYCHKA")) && (expr.length() - 8 == expr.rfind(L"KAVYCHKA") ))
return;
boost::wregex re(L"([:$!])+");
boost::wregex re(L"(([:$!])+)|(\\S+\\d+)");
boost::wsmatch result;
bool b = boost::regex_search(expr, result, re);
if (b)
{
boost::wregex re1(L"(\\$?[^\']+\\!)?([\\w^0-9$]*\\d*)\\:?([\\w^0-9$]*\\d*)?");
boost::wregex re1(L"(\\$?[^\\']+\\!)?([a-zA-Z$]+\\d*)(\\:[a-zA-Z$]+\\d*)?");
// $ Sheet2 ! $ A1 : $ B5
// $ Sheet2 ! $ A : $ A
// $ Sheet2 ! $ 1 : $ 1
@ -216,6 +385,78 @@ void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr, bool bSele
return;
}
size_t getColAddressInv(const std::wstring & a_)
{
std::wstring a = a_;
::boost::algorithm::to_upper(a);
static const size_t r = (L'Z' - L'A' + 1);
size_t mul = 1;
bool f = true;
size_t res = 0;
for (int i = a.length() - 1; i >= 0; i--)
{
size_t v = a[i] - L'A';
if (f)
f = false;
else
v += 1;
res += v * mul;
mul *= r;
}
return res;
}
size_t getRowAdderssInv(const std::wstring & a_)
{
int sz = a_.length();
if (a_.length()>0)
{
return boost::lexical_cast<size_t>(a_)-1;
}
else
return 0;
}
void splitCellAddress(const std::wstring & a_, std::wstring & col, std::wstring & row)
{
std::wstring a = a_;
std::reverse(a.begin(), a.end());
::XmlUtils::replace_all( a, L"$", L"");
//::XmlUtils::replace_all( a, L"'", L"");
::boost::algorithm::to_upper(a);
for (size_t i = 0; i < a.length(); i++)
{
if (a[i] >= L'0' && a[i] <= L'9')
row += a[i];
else
col += a[i];
}
std::reverse(col.begin(), col.end());
std::reverse(row.begin(), row.end());
}
void getCellAddressInv(const std::wstring & a_, int & col, int & row)
{
std::wstring colStr=L"", rowStr=L"";
splitCellAddress(a_, colStr, rowStr);
col = getColAddressInv(colStr);
row = getRowAdderssInv(rowStr);
if (col > 16384) col= -1;
}
bool IsRefPresent(const std::wstring& ref_test)
{
int col = -1, row = -1;
getCellAddressInv(ref_test, col, row);
if (col >= 0 && row >=0) return true;
return false;
}
std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmatch const & what)
{
const size_t sz = what.size();
@ -238,12 +479,27 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmat
if (isFindBaseCell_ && table_name_.empty() && !sheet.empty())
{
table_name_ = sheet + L".$A$1";
table_name_ = L"$" + sheet + L".$A$1";
}
if (!sheet.empty() && (std::wstring::npos != c1.find(L"$"))) sheet = L"$" + sheet;
if (!c2.empty() && c2.substr(0, 1) == L":")
c2 = c2.substr(1);
s = L"[" + sheet + L"." + c1 + (c2.empty() ? L"" : (L":" + sheet + L"." + c2)) + std::wstring(L"]");
bool bRefPresent = true;
if (sheet.empty() && c2.empty())
{
bRefPresent = IsRefPresent(c1);
}
if (bRefPresent)
{
s = L"[" + sheet + L"." + c1 + (c2.empty() ? L"" : (L":" + sheet + L"." + c2)) + std::wstring(L"]");
}
else
{
s = c1;
}
}
return s;
}
@ -281,10 +537,12 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater2(boost::wsmat
if (isFindBaseCell_ && table_name_.empty() && !sheet.empty())
{
table_name_ = sheet + L".$A$1";
table_name_ = L"$" + sheet + L".$A$1";
}
if (!sheet.empty() && (std::wstring::npos != c1.find(L"$"))) sheet = L"$" + sheet;
if (!c2.empty() && c2.substr(0, 1) == L":")
c2 = c2.substr(1);
s = sheet + L"." + c1 + (c2.empty() ? L"" : (L":" + sheet + L"." + c2)) + std::wstring(L"");
}
@ -310,6 +568,19 @@ void oox2odf_converter::Impl::replace_named_formula(std::wstring & expr)
expr = convert_formula(expr);
isFindBaseCell_ = false;
}
bool oox2odf_converter::Impl::is_simple_ref(std::wstring const & expr)
{
if (expr.find(L"(") != std::wstring::npos) return false;
if (expr.find(L" ") != std::wstring::npos) return false;
if (expr.find(L";") != std::wstring::npos) return false;
boost::wsmatch match;
if (boost::regex_search(expr, match, boost::wregex(L"([\\w]+\\!)?\\$?[a-zA-Z]+\\$?\\d+(\\:\\$?[a-zA-Z]+\\$?\\d+)?")))
{
return true;
}
return false;
}
void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
{
@ -644,6 +915,11 @@ std::wstring oox2odf_converter::convert_named_formula(const std::wstring& expr)
impl_->replace_named_formula(workstr);
return workstr;
}
bool oox2odf_converter::is_simple_ref(std::wstring const & expr)
{
return impl_->is_simple_ref(expr);
}
std::wstring oox2odf_converter::get_table_name()
{
return impl_->table_name_;
@ -665,67 +941,6 @@ std::wstring oox2odf_converter::convert_spacechar(std::wstring expr)
}
return expr;
}
size_t getColAddressInv(const std::wstring & a_)
{
std::wstring a = a_;
::boost::algorithm::to_upper(a);
static const size_t r = (L'Z' - L'A' + 1);
size_t mul = 1;
bool f = true;
size_t res = 0;
for (int i = a.length() - 1; i >= 0; i--)
{
size_t v = a[i] - L'A';
if (f)
f = false;
else
v += 1;
res += v * mul;
mul *= r;
}
return res;
}
size_t getRowAdderssInv(const std::wstring & a_)
{
int sz = a_.length();
if (a_.length()>0)
{
return boost::lexical_cast<size_t>(a_)-1;
}
else
return 0;
}
void splitCellAddress(const std::wstring & a_, std::wstring & col, std::wstring & row)
{
std::wstring a = a_;
std::reverse(a.begin(), a.end());
::XmlUtils::replace_all( a, L"$", L"");
//::XmlUtils::replace_all( a, L"'", L"");
::boost::algorithm::to_upper(a);
for (size_t i = 0; i < a.length(); i++)
{
if (a[i] >= L'0' && a[i] <= L'9')
row += a[i];
else
col += a[i];
}
std::reverse(col.begin(), col.end());
std::reverse(row.begin(), row.end());
}
void getCellAddressInv(const std::wstring & a_, int & col, int & row)
{
std::wstring colStr=L"", rowStr=L"";
splitCellAddress(a_, colStr, rowStr);
col = getColAddressInv(colStr);
row = getRowAdderssInv(rowStr);
}
int oox2odf_converter::get_count_value_points(std::wstring expr)
{
int count =0;

View File

@ -63,8 +63,9 @@ public:
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_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;
};

View File

@ -39,7 +39,8 @@ enum ElementType
typeNone = 0,
type_AbstractXml,
typeTextText = 1000,
typeTextTextElement = 1000,
typeTextText,
typeTextS,
typeTextTab,
typeTextLineBreak,
@ -237,6 +238,9 @@ enum ElementType
typeStyleListLevelProperties,
typeStyleListLevelLabelAlignment,
typeTextOutlineStyle,
typeTextOutlineLevelStyle,
typeStyleTabStop,
typeStyleTabStops,
typeStyleDropCap,
@ -247,6 +251,7 @@ enum ElementType
typeStyleTableColumnProperties,
typeStyleTableRowProperties,
typeStyleTableCellProperties,
typeStyleHeaderFooter,
typeStyleHeader,
typeStyleFooter,
typeStyleHeaderFirst,
@ -468,6 +473,7 @@ enum ElementType
typeDrawHandle,
typeDrawEquation,
typeDrawEnhancedGeometry,
typeDrawGluePoint,
typeDr3dScene,
typeDr3dLight,
@ -506,6 +512,7 @@ enum ElementType
typeFormTime,
typeFormValueRange,
typeFormItem,
typeFormOption,
typeDrawPage,
typePresentationFooterDecl,
@ -533,7 +540,10 @@ enum ElementType
typeOfficeAnnotation,
typeOfficeAnnotationStart,
typeOfficeAnnotationEnd,
typeStyleRegion,
typeStyleRegionLeft,
typeStyleRegionCenter,
typeStyleRegionRight,
typeOfficeScripts,
typeOfficeScript,
typeOfficePresentation,
@ -589,8 +599,6 @@ enum ElementType
typeChartRegressionCurve,
typeChartEquation,
typeStyleRegionCenter,
typeStyleRegionRight,
typeStyleChartProperties,
typeCalcextColorScaleEntry,

View File

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

View File

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

View File

@ -82,6 +82,11 @@ bool read_doc_element::read_sax( xml::sax * Reader )
}
break;
case xml::typeWhitespace:
{
const std::wstring value = Reader->value();
add_space(value);
}
break;
case xml::typeText:
{
const std::wstring value = Reader->value();

View File

@ -47,6 +47,7 @@
#include "../odf/style_graphic_properties.h"
#include "docx_package.h"
#include "xlsx_package.h"
#include "oox_rels.h"
#include "logging.h"
@ -130,7 +131,7 @@ text_tracked_context::_state & text_tracked_context::get_tracked_change(std::wst
}
//----------------------------------------------------------------------------------------------------------------
docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfDocument) :
docx_conversion_context::docx_conversion_context(odf_reader::odf_document * _odf_document) :
last_dump_page_properties_ (true),
next_dump_page_properties_ (false),
page_break_ (false),
@ -143,19 +144,22 @@ docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfD
text_tracked_context_ (*this),
table_context_ (*this),
output_document_ (NULL),
process_note_ (noNote),
current_process_note_ (noNote),
new_list_style_number_ (0),
current_margin_left_ (0),
current_outline_level_ (-1),
is_rtl_ (false),
is_delete_text_ (false),
delayed_converting_ (false),
process_headers_footers_ (false),
process_comment_ (false),
mediaitems_ (OdfDocument->get_folder() ),
math_context_ (OdfDocument->odf_context().fontContainer(), false),
odf_document_ (OdfDocument)
current_process_comment_ (false),
odf_document_ (_odf_document),
math_context_ (_odf_document->odf_context().fontContainer(), false)
{
streams_man_ = streams_man::create(temp_stream_);
mediaitems_ = boost::make_shared<mediaitems>(odf_document_->get_folder());
chart_drawing_handle_ = boost::make_shared<xlsx_drawing_context_handle>(mediaitems_);
streams_man_ = streams_man::create(temp_stream_);
}
docx_conversion_context::~docx_conversion_context()
{
@ -166,7 +170,7 @@ void docx_conversion_context::set_output_document(package::docx_document * docum
}
void docx_conversion_context::set_font_directory(std::wstring pathFonts)
{
mediaitems_.set_font_directory(pathFonts);
mediaitems_->set_font_directory(pathFonts);
}
std::wstring styles_map::get(const std::wstring & Name, odf_types::style_family::type Type)
{
@ -194,7 +198,30 @@ std::wstring styles_map::name(const std::wstring & Name, odf_types::style_family
}
void docx_conversion_context::add_element_to_run(std::wstring parenStyleId)
{
if (!state_.in_run_)
if(false == current_process_comment_)
{
for (size_t i = 0; i < get_comments_context().ref_start_.size(); i++)
{
output_stream() << L"<w:commentRangeStart w:id=\"" << get_comments_context().ref_start_[i] << L"\"/>";
}
get_comments_context().ref_start_.clear();
if (false == get_comments_context().ref_end_.empty())
{
for (size_t i = 0; i < get_comments_context().ref_end_.size(); i++)
{
output_stream()<< L"<w:commentRangeEnd w:id=\"" << get_comments_context().ref_end_[i] << L"\"/>";
}
for (size_t i = 0; i < get_comments_context().ref_end_.size(); i++)
{
output_stream()<< L"<w:commentReference w:id=\"" << get_comments_context().ref_end_[i] << L"\"/>";
}
get_comments_context().ref_end_.clear();
}
}
if (!state_.in_run_)
{
state_.in_run_ = true;
output_stream() << L"<w:r>";
@ -237,6 +264,20 @@ void docx_conversion_context::finish_paragraph()
{
end_changes();
if (false == current_process_comment_ && false == get_comments_context().ref_end_.empty())
{
for (size_t i = 0; i < get_comments_context().ref_end_.size(); i++)
{
output_stream()<< L"<w:commentRangeEnd w:id=\"" << get_comments_context().ref_end_[i] << L"\"/>";
}
for (size_t i = 0; i < get_comments_context().ref_end_.size(); i++)
{
output_stream()<< L"<w:commentReference w:id=\"" << get_comments_context().ref_end_[i] << L"\"/>";
}
get_comments_context().ref_end_.clear();
}
output_stream() << L"</w:p>";
}
@ -250,23 +291,17 @@ void docx_conversion_context::finish_run()
{
if (false == state_.in_run_) return;
if (get_comments_context().state() == 4)
if (false == current_process_comment_)
{
output_stream()<< L"<w:commentReference w:id=\"" << get_comments_context().current_id() << L"\"/>";
get_comments_context().state(0);
for (size_t i = 0; i < get_comments_context().ref_.size(); i++)
{
output_stream()<< L"<w:commentReference w:id=\"" << get_comments_context().ref_[i] << L"\"/>";
}
get_comments_context().ref_.clear();
}
output_stream() << L"</w:r>";
state_.in_run_ = false;
if (get_comments_context().state() == 2)
{
output_stream()<< L"<w:commentRangeEnd w:id=\"" << get_comments_context().current_id() << L"\"/>";
add_element_to_run();
output_stream()<< L"<w:commentReference w:id=\"" << get_comments_context().current_id() << L"\"/>";
get_comments_context().state(0);
finish_run();
}
}
void docx_conversion_context::start_math_formula()
{
@ -369,6 +404,9 @@ void docx_conversion_context::start_index_content()
sInstrText += L" \\n "+ std::to_wstring(table_content_context_.min_outline_level) + L"-" +
std::to_wstring(table_content_context_.max_outline_level);
}
else if (table_content_context_.type_table_content == 1)
sInstrText += L" \\o";
if (false == table_content_context_.outline_level_styles.empty())
{
sInstrText += L" \\t \"";
@ -602,12 +640,7 @@ void docx_conversion_context::back_context_state()
void docx_conversion_context::add_new_run(std::wstring parentStyleId)
{
finish_run();
if (get_comments_context().state() == 1 ||
get_comments_context().state() == 4)//??? comment in run
{
output_stream() << L"<w:commentRangeStart w:id=\"" << get_comments_context().current_id() << L"\" />";
get_comments_context().state(2);//active
}
add_element_to_run(parentStyleId);
}
@ -615,9 +648,9 @@ std::wstring docx_conversion_context::add_hyperlink(const std::wstring & href, b
{
hyperlinks::_type_place type = hyperlinks::document_place;
if (process_comment_ == true) type = hyperlinks::comment_place;
else if (process_note_ == footNote || process_note_ == footNoteRefSet) type = hyperlinks::footnote_place;
else if (process_note_ == endNote || process_note_ == endNoteRefSet ) type = hyperlinks::endnote_place;
if (current_process_comment_ == true) type = hyperlinks::comment_place;
else if (current_process_note_ == footNote || current_process_note_ == footNoteRefSet) type = hyperlinks::footnote_place;
else if (current_process_note_ == endNote || current_process_note_ == endNoteRefSet ) type = hyperlinks::endnote_place;
std::wstring href_correct = xml::utils::replace_text_to_xml(href);
XmlUtils::replace_all( href_correct, L" .", L".");//1 (130).odt
@ -681,11 +714,14 @@ void docx_conversion_context::end_document()
{
output_stream() << L"</w:document>";
output_document_->get_word_files().set_document ( package::simple_element::create(L"document.xml", document_xml_.str()) );
output_document_->get_word_files().set_document ( package::simple_element::create(L"document.xml", document_xml_.str()) );
output_document_->get_word_files().set_settings ( package::simple_element::create(L"settings.xml", dump_settings_document()));
output_document_->get_word_files().set_media ( mediaitems_);
output_document_->get_word_files().set_comments ( comments_context_);
output_document_->get_word_files().set_headers_footers( headers_footers_);
output_document_->get_word_files().set_headers_footers( headers_footers_);
package::xl_drawings_ptr drawings = package::xl_drawings::create(chart_drawing_handle_->content(), chart_drawing_handle_->content_vml());
output_document_->get_word_files().set_drawings(drawings);
package::content_types_file & content_file_ = output_document_->get_content_types_file();
content_file_.set_media( mediaitems_);
@ -810,6 +846,16 @@ std::wstring docx_conversion_context::dump_settings_document()
{
CP_XML_NODE(L"w:mirrorMargins");
}
CP_XML_NODE(L"w:compat")
{
CP_XML_NODE(L"w:compatSetting")
{
CP_XML_ATTR(L"w:name", L"compatibilityMode" );
CP_XML_ATTR(L"w:uri", L"http://schemas.microsoft.com/office/word" );
CP_XML_ATTR(L"w:val", L"15" );
}
}
}
}
return output.str();
@ -908,28 +954,44 @@ mc:Ignorable=\"w14 wp14\">";
std::vector<int> numIds;
odf_reader::list_style_container::instances_array & arListStyles = list_styles.instances();
for (size_t i = 0; i < arListStyles.size(); i++)
{
odf_reader::office_element_ptr_array & content = arListStyles[i]->get_text_list_style()->get_content();
{
odf_reader::office_element_ptr_array & content = arListStyles[i]->get_text_list_style()->content_;
if (content.size() < 1)
if (content.empty())
continue;
const int abstractNumId = list_styles.id_by_name(arListStyles[i]->get_style_name());
numIds.push_back(abstractNumId);
strm << L"<w:abstractNum w:abstractNumId=\"" << abstractNumId << "\">";
numIds.push_back(abstractNumId);
for (size_t j = 0; j < (std::min)( content.size(), (size_t)9); j++)
{
start_text_list_style(arListStyles[i]->get_text_list_style()->get_style_name());
content[j]->docx_convert(*this);
// TODO
start_text_list_style(arListStyles[i]->get_text_list_style()->attr_.style_name_);
content[j]->docx_convert(*this);
end_text_list_style();
}
strm << L"</w:abstractNum>";
}
}
if (list_styles.outline_style())
{
const int abstractNumId = list_styles.id_outline();
numIds.push_back(abstractNumId);
strm << L"<w:abstractNum w:abstractNumId=\"" << abstractNumId << "\">";
for (size_t j = 0; j < (std::min)( list_styles.outline_style()->content_.size(), (size_t)9); j++)
{
start_text_list_style(L"Outline");
list_styles.outline_style()->content_[j]->docx_convert(*this);
end_text_list_style();
}
strm << L"</w:abstractNum>";
}
for (size_t i = 0; i < numIds.size(); i++)
{
@ -1067,7 +1129,7 @@ void docx_conversion_context::process_styles()
const std::wstring displayName = StyleDisplayName(arStyles[i]->name(), arStyles[i]->display_name(), arStyles[i]->type());
_Wostream << L"<w:name w:val=\"" << displayName << L"\"/>";
_Wostream << L"<w:name w:val=\"" << XmlUtils::EncodeXmlString(displayName) << L"\"/>";
if (odf_reader::style_instance * baseOn = arStyles[i]->parent())
{
@ -1341,6 +1403,7 @@ void docx_conversion_context::end_automatic_style()
in_automatic_style_ = false;
automatic_parent_style_.clear();
tabs_context_.clear();
current_outline_level_ = -1;
}
bool docx_conversion_context::in_automatic_style()
@ -1459,7 +1522,7 @@ void docx_conversion_context::end_text_list_style()
text_list_style_name_ = L"";
}
const std::wstring & docx_conversion_context::get_text_list_style_name()
std::wstring docx_conversion_context::get_text_list_style_name()
{
return text_list_style_name_;
}
@ -1485,9 +1548,9 @@ void docx_conversion_context::end_list()
list_style_stack_.pop_back();
}
const std::wstring docx_conversion_context::current_list_style() const
std::wstring docx_conversion_context::current_list_style()
{
if (!list_style_stack_.empty())
if (false == list_style_stack_.empty())
return list_style_stack_.back();
else
return L"";
@ -1503,7 +1566,8 @@ void docx_conversion_context::start_list_item(bool restart)
list_style_renames_[curStyleName] = newStyleName;
odf_reader::list_style_container & lists = root()->odf_context().listStyleContainer();
odf_reader::text_list_style * curStyle = lists.list_style_by_name(curStyleName);
odf_reader::text_list_style * curStyle = lists.list_style_by_name(curStyleName);
lists.add_list_style(curStyle, newStyleName);
end_list();
start_list(newStyleName);
@ -1540,6 +1604,92 @@ int docx_conversion_context::process_text_attr(odf_reader::text::paragraph_attrs
push_text_properties(styleContent->get_style_text_properties());
return 1;
}
int docx_conversion_context::process_paragraph_style(const std::wstring & style_name)
{
if (style_name.empty()) return 0;
if (odf_reader::style_instance * styleInst =
root()->odf_context().styleContainer().style_by_name(style_name, odf_types::style_family::Paragraph, process_headers_footers_))
{
double font_size = odf_reader::text_format_properties_content::process_font_size_impl(odf_types::font_size(odf_types::percent(100.0)), styleInst);
if (font_size > 0) current_fontSize.push_back(font_size);
process_page_break_after(styleInst);
if (styleInst->is_automatic())
{
if (odf_reader::style_content * styleContent = styleInst->content())
{
std::wstring id;
//office_element_ptr parent_tab_stops_;
if (const odf_reader::style_instance * parentStyleContent = styleInst->parent())
{
std::wstring parent_name = parentStyleContent->name();
id = styles_map_.get( parent_name, parentStyleContent->type() );
if (in_table_content_ && table_content_context_.empty_current_table_content_level_index())
{
table_content_context_.set_current_level(parent_name);
}
}
start_automatic_style(id);
calc_tab_stops(styleInst, get_tabs_context());
//вытаскивает rtl c цепочки стилей !! - просто прописать в наследуемом НЕЛЬЗЯ !!
odf_reader::paragraph_format_properties properties = odf_reader::calc_paragraph_properties_content(styleInst);
if (properties.style_writing_mode_)
{
odf_types::writing_mode::type type = properties.style_writing_mode_->get_type();
switch(type)
{
case odf_types::writing_mode::RlTb:
case odf_types::writing_mode::TbRl:
case odf_types::writing_mode::Rl:
set_rtl(true);
break;
default:
set_rtl(false);
}
}
styleContent->docx_convert(*this);
end_automatic_style();
//push_text_properties(styleContent->get_style_text_properties());
return 1;
}
}
else
{
const std::wstring id = styles_map_.get( styleInst->name(), styleInst->type() );
output_stream() << L"<w:pPr>";
output_stream() << L"<w:pStyle w:val=\"" << id << L"\" />";
if (!get_text_tracked_context().dumpPPr_.empty())
{
output_stream() << get_text_tracked_context().dumpPPr_;
get_text_tracked_context().dumpPPr_.clear();
}
serialize_list_properties(output_stream());
if (!get_text_tracked_context().dumpRPrInsDel_.empty())
{
output_stream() << L"<w:rPr>";
output_stream() << get_text_tracked_context().dumpRPrInsDel_;
get_text_tracked_context().dumpRPrInsDel_.clear();
output_stream() << L"</w:rPr>";
}
output_stream() << L"</w:pPr>";
return 2;
}
}
return 0;
}
int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_attrs *Attr)
{
if (!Attr) return 0;
@ -1560,19 +1710,24 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
if (odf_reader::style_instance * styleInst =
root()->odf_context().styleContainer().style_by_name(Attr->text_style_name_, odf_types::style_family::Paragraph, process_headers_footers_)
)
{
process_page_break_after(styleInst);
{
double font_size = odf_reader::text_format_properties_content::process_font_size_impl(odf_types::font_size(odf_types::percent(100.0)), styleInst);
if (font_size > 0) current_fontSize.push_back(font_size);
_CP_OPT(int) outline_level = calc_outline_level(Attr->outline_level_, styleInst);
process_page_break_after(styleInst);
if (styleInst->is_automatic())
{
if (odf_reader::style_content * styleContent = styleInst->content())
{
std::wstring id;
{
if (odf_reader::style_content * styleContent = styleInst->content())
{
std::wstring id;
//office_element_ptr parent_tab_stops_;
if (const odf_reader::style_instance * parentStyleContent = styleInst->parent())
if (const odf_reader::style_instance * parentStyleContent = styleInst->parent())
{
std::wstring parent_name = parentStyleContent->name();
id = styles_map_.get( parent_name, parentStyleContent->type() );
id = styles_map_.get( parent_name, parentStyleContent->type() );
if (in_table_content_ && table_content_context_.empty_current_table_content_level_index())
{
@ -1580,7 +1735,7 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
}
}
start_automatic_style(id);
start_automatic_style(id);
calc_tab_stops(styleInst, get_tabs_context());
@ -1600,17 +1755,18 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
set_rtl(false);
}
}
set_margin_left(properties.fo_margin_left_? 20.0 * properties.fo_margin_left_->get_length().get_value_unit(odf_types::length::pt) : 0);
get_styles_context().start_process_style(styleInst);
styleContent->docx_convert(*this);
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
if (outline_level)
{
std::wstringstream & _pPr = get_styles_context().paragraph_nodes();
_pPr << L"<w:outlineLvl w:val=\"" << *Attr->outline_level_ - 1 << L"\"/>";
}
set_outline_level(*outline_level);
}
styleContent->docx_convert(*this);
get_styles_context().end_process_style();
end_automatic_style();
push_text_properties(styleContent->get_style_text_properties());
push_text_properties(styleContent->get_style_text_properties());
if (!get_section_context().dump_.empty()
&& !get_table_context().in_table()
@ -1626,10 +1782,13 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
output_stream() << L"</w:pPr>";
finish_paragraph();
start_paragraph();
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
//process_paragraph_style(Context.get_current_paragraph_style()); ??
//if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
if (outline_level)
{
output_stream() << L"<w:pPr>";
output_stream() << L"<w:outlineLvl w:val=\"" << *Attr->outline_level_ - 1 << L"\"/>";
output_stream() << L"<w:outlineLvl w:val=\"" << *outline_level << L"\"/>";
output_stream() << L"</w:pPr>";
}
}
@ -1637,66 +1796,77 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
{
output_stream() << get_section_context().dump_;
get_section_context().dump_.clear();
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
//if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
if (outline_level)
{
output_stream() << L"<w:outlineLvl w:val=\"" << *Attr->outline_level_ - 1 << L"\"/>";
output_stream() << L"<w:outlineLvl w:val=\"" << *outline_level << L"\"/>";
}
output_stream() << L"</w:pPr>";
}
}
return 1;
}
}
else
{
const std::wstring id = styles_map_.get( styleInst->name(), styleInst->type() );
output_stream() << L"<w:pPr>";
//todooo причесать
if (!get_section_context().dump_.empty()
&& !get_table_context().in_table()
&& (get_process_note() == oox::docx_conversion_context::noNote)
&& !in_drawing)
}
}
else
{
const std::wstring id = styles_map_.get( styleInst->name(), styleInst->type() );
output_stream() << L"<w:pPr>";
//todooo причесать
if (!get_section_context().dump_.empty()
&& !get_table_context().in_table()
&& (get_process_note() == oox::docx_conversion_context::noNote)
&& !in_drawing)
{
if (is_paragraph_header() )
{
if (is_paragraph_header() )
{
output_stream() << get_section_context().dump_;
get_section_context().dump_.clear();
output_stream() << get_section_context().dump_;
get_section_context().dump_.clear();
output_stream() << L"</w:pPr>";
finish_paragraph();
start_paragraph();
output_stream() << L"<w:pPr>";
}
else
{
output_stream() << get_section_context().dump_;
get_section_context().dump_.clear();
}
output_stream() << L"</w:pPr>";
finish_paragraph();
start_paragraph();
output_stream() << L"<w:pPr>";
}
output_stream() << L"<w:pStyle w:val=\"" << id << L"\" />";
if (!get_text_tracked_context().dumpPPr_.empty())
else
{
output_stream() << get_text_tracked_context().dumpPPr_;
get_text_tracked_context().dumpPPr_.clear();
output_stream() << get_section_context().dump_;
get_section_context().dump_.clear();
}
}
serialize_list_properties(output_stream());
output_stream() << L"<w:pStyle w:val=\"" << id << L"\" />";
if (!get_text_tracked_context().dumpPPr_.empty())
{
output_stream() << get_text_tracked_context().dumpPPr_;
get_text_tracked_context().dumpPPr_.clear();
}
serialize_list_properties(output_stream());
//if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
if (outline_level)
{
odf_reader::list_style_container & list_styles = root()->odf_context().listStyleContainer();
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
if (list_style_stack_.empty() && list_styles.outline_style())
{
output_stream() << L"<w:outlineLvl w:val=\"" << *Attr->outline_level_ - 1 << L"\" />";
}
output_stream() << L"<w:numPr>";
output_stream() << L"<w:ilvl w:val=\"" << *outline_level - 1 << L"\"/>";
output_stream() << L"<w:numId w:val=\"" << list_styles.id_outline() << L"\"/>";
output_stream() << L"</w:numPr>";
}
output_stream() << L"<w:outlineLvl w:val=\"" << *outline_level << L"\"/>";
}
if (!get_text_tracked_context().dumpRPrInsDel_.empty())
{
output_stream() << L"<w:rPr>";
output_stream() << get_text_tracked_context().dumpRPrInsDel_;
get_text_tracked_context().dumpRPrInsDel_.clear();
output_stream() << L"</w:rPr>";
}
output_stream() << L"</w:pPr>";
if (!get_text_tracked_context().dumpRPrInsDel_.empty())
{
output_stream() << L"<w:rPr>";
output_stream() << get_text_tracked_context().dumpRPrInsDel_;
get_text_tracked_context().dumpRPrInsDel_.clear();
output_stream() << L"</w:rPr>";
}
output_stream() << L"</w:pPr>";
return 2;
}
}
@ -1747,28 +1917,27 @@ void docx_conversion_context::process_page_break_after(const odf_reader::style_i
}
void docx_conversion_context::serialize_list_properties(std::wostream & strm)
{
if (!list_style_stack_.empty())
if (list_style_stack_.empty()) return;
if (first_element_list_item_)
{
if (first_element_list_item_)
{
const int id = root()->odf_context().listStyleContainer().id_by_name( current_list_style() );
const int id = root()->odf_context().listStyleContainer().id_by_name( current_list_style() );
CP_XML_WRITER(strm)
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"w:numPr")
{
CP_XML_NODE(L"w:numPr")
CP_XML_NODE(L"w:ilvl")
{
CP_XML_NODE(L"w:ilvl")
{
CP_XML_ATTR(L"w:val", (list_style_stack_.size() - 1));
}
CP_XML_NODE(L"w:numId")
{
CP_XML_ATTR(L"w:val", id );
}
CP_XML_ATTR(L"w:val", (list_style_stack_.size() - 1));
}
CP_XML_NODE(L"w:numId")
{
CP_XML_ATTR(L"w:val", id );
}
}
first_element_list_item_ = false;
}
}
first_element_list_item_ = false;
}
}
@ -1824,7 +1993,7 @@ namespace
//слить если есть mediaitems, добавить релсы и обнулить их для основного документа.
rels internal_rels;
Context.get_mediaitems().dump_rels(internal_rels);
Context.get_mediaitems()->dump_rels(internal_rels);
Context.dump_hyperlinks(internal_rels, hyperlinks::document_place);
Context.get_headers_footers().add(styleName, dbgStr, type, internal_rels);
@ -1934,12 +2103,12 @@ void notes_context::dump_rels(rels & Rels) const
void docx_conversion_context::add_note_reference ()
{
if (process_note_ == footNote || process_note_ == endNote)
if (current_process_note_ == footNote || current_process_note_ == endNote)
{
add_element_to_run(_T(""));
output_stream() << ((process_note_ == footNote) ? L"<w:footnoteRef />" : L"<w:endnoteRef />");
output_stream() << ((current_process_note_ == footNote) ? L"<w:footnoteRef />" : L"<w:endnoteRef />");
finish_run();
process_note_ = (NoteType) (process_note_ + 1); //add ref set
current_process_note_ = (NoteType) (current_process_note_ + 1); //add ref set
}
}
@ -1988,7 +2157,7 @@ void docx_conversion_context::start_text_changes (const std::wstring &id)
void docx_conversion_context::start_changes()
{
if (map_current_changes_.empty()) return;
if (process_comment_) return;
if (current_process_comment_) return;
text_tracked_context_.dumpPPr_.clear();
text_tracked_context_.dumpRPr_.clear();
@ -2087,7 +2256,7 @@ void docx_conversion_context::start_changes()
void docx_conversion_context::end_changes()
{
if (process_comment_) return;
if (current_process_comment_) return;
for (map_changes_iterator it = map_current_changes_.begin(); it != map_current_changes_.end(); ++it)
{

View File

@ -42,6 +42,7 @@
#include "docx_table_context.h"
#include "oox_conversion_context.h"
#include "oox_chart_context.h"
#include "xlsx_drawing_context.h"
#include "headers_footers.h"
#include "hyperlinks.h"
@ -474,42 +475,56 @@ private:
class comments_context : boost::noncopyable
{
public:
comments_context() : state_(0) {}
comments_context(){}
struct _comment_desc
{
_comment_desc(const std::wstring & c, int _id, const std::wstring & a, const std::wstring & d) :
content(c), id(_id), author(a), date(d)
{}
std::wstring content;
int id;
std::wstring date;
std::wstring author;
std::wstring initials;
};
void start_comment(const std::wstring & content, const std::wstring & author, const std::wstring & date, bool inRun = false)
void end_comment(const std::wstring & name)
{
std::map<std::wstring, int>::iterator pFind = comments_map_.find(name);
if (pFind != comments_map_.end())
{
ref_end_.push_back(pFind->second);
}
}
void start_comment(const std::wstring & content, const std::wstring & author, const std::wstring & date, _CP_OPT(std::wstring) name)
{
int id = comments_.size() + 1;
_comment_desc new_comment={content, id, date, author};
_comment_desc new_comment(content, id, author, date);
if ((name) && (false == name->empty()))
{
comments_map_.insert(std::make_pair(*name, id));
ref_start_.push_back(id);
}
else
{
ref_.push_back(id);
}
comments_.push_back(new_comment);
state_ = inRun ? 4 : 1;
}
int current_id()
{
if (comments_.size()>0 && state_ >0 )return comments_.back().id;
else return -1; //not set
}
void state(int state) {state_ = state;}
int state(){return state_;}
rels& get_rels(){return internal_rels_;}
std::vector<_comment_desc> comments_;
std::vector<_comment_desc> comments_;
std::vector<int> ref_start_;
std::vector<int> ref_end_;
std::vector<int> ref_;
private:
int state_;
rels internal_rels_;//это для гиперлинков или медиа в комментариях
std::map<std::wstring, int> comments_map_;
};
class text_tracked_context
{
public:
@ -734,7 +749,7 @@ class docx_conversion_context : boost::noncopyable
public:
enum NoteType { noNote, footNote, footNoteRefSet, endNote, endNoteRefSet };
docx_conversion_context(odf_reader::odf_document * OdfDocument);
docx_conversion_context(odf_reader::odf_document * _odf_document);
~docx_conversion_context();
void set_output_document (package::docx_document * document);
@ -829,6 +844,7 @@ public:
bool process_page_properties(std::wostream & strm);
void process_section (std::wostream & strm, odf_reader::style_columns * columns = NULL);
int process_paragraph_style (const std::wstring & style_name);
int process_paragraph_attr (odf_reader::text::paragraph_attrs *attr);
int process_text_attr (odf_reader::text::paragraph_attrs *Attr);
void process_page_break_after(const odf_reader::style_instance *styleInst);
@ -872,8 +888,8 @@ public:
void start_text_list_style (const std::wstring & StyleName);
void end_text_list_style ();
const std::wstring & get_text_list_style_name();
const std::wstring current_list_style () const;
std::wstring get_text_list_style_name();
std::wstring current_list_style();
void start_list (const std::wstring & StyleName, bool Continue = false);
void end_list ();
@ -887,7 +903,7 @@ public:
styles_map * get_style_map() { return &styles_map_; }
mediaitems & get_mediaitems() {return mediaitems_;}
mediaitems_ptr & get_mediaitems() {return mediaitems_;}
styles_context & get_styles_context() { return styles_context_; }
drawing_context & get_drawing_context() { return drawing_context_; }
comments_context & get_comments_context() { return comments_context_; }
@ -897,8 +913,9 @@ public:
text_tracked_context& get_text_tracked_context(){ return text_tracked_context_; }
forms_context & get_forms_context() { return forms_context_; }
tabs_context & get_tabs_context() { return tabs_context_;}
table_content_context & get_table_content_context() { return table_content_context_;}
table_content_context & get_table_content_context() { return table_content_context_;}
xlsx_drawing_context_handle_ptr & get_chart_drawing_handle() { return chart_drawing_handle_;}
void set_drawing_text_props (const std::wstring &props);
@ -910,24 +927,33 @@ public:
StreamsManPtr get_stream_man() const { return streams_man_; }
void set_stream_man(StreamsManPtr Sm) { streams_man_ = Sm; }
void set_rtl(bool val) { is_rtl_ = val; }
bool get_rtl() const {return is_rtl_;}
void set_rtl(bool val) { is_rtl_ = val; }
bool get_rtl() const {return is_rtl_;}
void set_margin_left(int val) {current_margin_left_ = val;}
int get_margin_left() {return current_margin_left_;}
double get_current_fontSize() {return current_fontSize.empty() ? 0 : current_fontSize.back();}
void pop_current_fontSize() {if (!current_fontSize.empty()) current_fontSize.pop_back();}
void set_outline_level(int val) {current_outline_level_ = val;}
int get_outline_level() {return current_outline_level_;}
void set_process_note (NoteType Val) { process_note_ = Val; }
NoteType get_process_note () const { return process_note_; }
void set_process_note (NoteType Val) { current_process_note_ = Val; }
NoteType get_process_note () const { return current_process_note_; }
void add_note_reference ();
void start_paragraph_style(const std::wstring& style_name) {paragraph_style_stack_.push_back(style_name);}
void end_paragraph_style() { if (!paragraph_style_stack_.empty()) paragraph_style_stack_.pop_back();}
std::wstring get_current_paragraph_style() {return paragraph_style_stack_.empty() ? L"" : paragraph_style_stack_.back();}
oox_chart_context & current_chart();
void start_chart(std::wstring name);
void end_chart ();
void start_comment () {process_comment_ = true;}
void end_comment () {process_comment_ = false;}
bool process_comment_;
void start_comment_content () {current_process_comment_ = true;}
void end_comment_content () {current_process_comment_ = false;}
void start_comment(const std::wstring & content, const std::wstring & author, const std::wstring & date, _CP_OPT(std::wstring) name);
void end_comment(const std::wstring & name);
void start_math_formula ();
void end_math_formula ();
@ -945,7 +971,7 @@ public:
headers_footers & get_headers_footers() { return headers_footers_; }
header_footer_context & get_header_footer_context() { return header_footer_context_; }
drop_cap_context & get_drop_cap_context() {return drop_cap_context_;}
drop_cap_context & get_drop_cap_context() { return drop_cap_context_; }
styles_map styles_map_;
bool process_headers_footers_;
@ -956,6 +982,7 @@ public:
void end_changes();
void add_jsaProject(const std::string &content);
private:
struct _context_state
@ -982,6 +1009,8 @@ private:
std::wstringstream settings_xml_;
std::wstringstream meta_xml_;
xlsx_drawing_context_handle_ptr chart_drawing_handle_;
styles_context styles_context_;
math_context math_context_;
drawing_context drawing_context_;
@ -1004,18 +1033,18 @@ private:
std::vector<odf_reader::_property> settings_properties_;
hyperlinks hyperlinks_;
mediaitems mediaitems_;
mediaitems_ptr mediaitems_;
std::vector<oox_chart_context_ptr> charts_;
headers_footers headers_footers_;
std::wstring automatic_parent_style_;
std::wstring current_master_page_name_;
std::wstring text_list_style_name_;
std::vector<std::wstring> list_style_stack_;
std::vector<std::wstring> fields_names_stack_;
std::wstring automatic_parent_style_;
std::wstring current_master_page_name_;
std::wstring text_list_style_name_;
std::vector<std::wstring> paragraph_style_stack_;
std::vector<std::wstring> list_style_stack_;
std::vector<std::wstring> fields_names_stack_;
bool first_element_list_item_;
bool first_element_list_item_;
bool page_break_after_;
bool page_break_before_;
@ -1029,10 +1058,13 @@ private:
bool is_delete_text_;
bool is_rtl_; // right-to-left
std::wstring current_alphabetic_index_;
int current_margin_left_;
int new_list_style_number_; // счетчик для нумерации имен созданных в процессе конвертации стилей
NoteType process_note_;
NoteType current_process_note_;
bool current_process_comment_;
std::vector<double> current_fontSize;
std::wstring current_alphabetic_index_;
int current_margin_left_;
int current_outline_level_;
int new_list_style_number_; // счетчик для нумерации имен созданных в процессе конвертации стилей
std::vector<odf_reader::office_element*> delayed_elements_;

View File

@ -114,7 +114,7 @@ void serialize_wrap_extent(std::wostream & strm, _docx_drawing const & val)
if (odf_reader::GetProperty(val.additional,L"border_width_top",iVal)) CP_XML_ATTR(L"t",iVal.get());
if (odf_reader::GetProperty(val.additional,L"border_width_right",iVal)) CP_XML_ATTR(L"r",iVal.get());
if (odf_reader::GetProperty(val.additional,L"border_width_bottom",iVal)) CP_XML_ATTR(L"b",iVal.get());
}
}
}break;
default:
serialize_null_extent( strm);
@ -151,7 +151,7 @@ void serialize_wrap(std::wostream & strm, _docx_drawing const & val)
break;
case odf_types::style_wrap::Left:
case odf_types::style_wrap::Right:
case odf_types::style_wrap::Dynamic:
case odf_types::style_wrap::Dynamic: //Présentation_de_tib.odt
serialize_wrap_square(strm, val);
break;
case odf_types::style_wrap::RunThrough:
@ -232,6 +232,7 @@ void docx_serialize_image_child(std::wostream & strm, _docx_drawing & val)
}
oox_serialize_ln(CP_XML_STREAM(), val.additional);
oox_serialize_effects(CP_XML_STREAM(), val.additional);
}
}
}
@ -267,6 +268,7 @@ void docx_serialize_shape_child(std::wostream & strm, _docx_drawing & val)
val.serialize_shape (CP_XML_STREAM());
oox_serialize_ln(CP_XML_STREAM(), val.additional);
oox_serialize_effects(CP_XML_STREAM(), val.additional);
}
val.serialize_text(CP_XML_STREAM());
}

View File

@ -102,7 +102,11 @@ void word_files::write(const std::wstring & RootPath)
{
embeddings_->write( path );
}
if (drawings_)
{
drawings_->set_main_document(get_main_document());
drawings_->write( path );
}
if (headers_footers_)
{
headers_footers_->write( path );
@ -140,22 +144,22 @@ void word_files::write(const std::wstring & RootPath)
void word_files::update_rels(docx_conversion_context & Context)
{
Context.get_mediaitems().dump_rels(rels_files_.get_rel_file()->get_rels());
Context.get_mediaitems()->dump_rels(rels_files_.get_rel_file()->get_rels());
Context.dump_hyperlinks (rels_files_.get_rel_file()->get_rels(), hyperlinks::document_place);
Context.dump_headers_footers(rels_files_.get_rel_file()->get_rels());
Context.dump_notes (rels_files_.get_rel_file()->get_rels());
}
void word_files::set_media(mediaitems & _Mediaitems)
void word_files::set_media(mediaitems_ptr & _mediaitems)
{
if (_Mediaitems.count_image + _Mediaitems.count_media > 0)
if (_mediaitems->count_image + _mediaitems->count_media > 0)
{
media_ = element_ptr( new media(_Mediaitems, _Mediaitems.applicationFonts()) );
media_ = element_ptr( new media(_mediaitems, _mediaitems->applicationFonts()) );
}
if (_Mediaitems.count_object > 0)
if (_mediaitems->count_object > 0)
{
embeddings_ = element_ptr( new embeddings(_Mediaitems) );
embeddings_ = element_ptr( new embeddings(_mediaitems) );
embeddings_->set_main_document( get_main_document() );
}
}
@ -195,6 +199,10 @@ void word_files::add_jsaProject(const std::string &content)
{
jsaProject_ = package::simple_element::create(L"jsaProject.bin", content);
}
void word_files::set_drawings(element_ptr Element)
{
drawings_ = Element;
}
void word_files::set_headers_footers(headers_footers & HeadersFooters)
{
headers_footers_elements * elm = new headers_footers_elements(HeadersFooters);

View File

@ -137,10 +137,11 @@ public:
void set_numbering (element_ptr Element);
void set_settings (element_ptr Element);
bool has_numbering ();
void set_media (mediaitems & mediaitems_);
void set_media (mediaitems_ptr & mediaitems_);
void set_headers_footers(headers_footers & HeadersFooters);
void set_notes (notes_context & notesContext);
void set_comments (comments_context & commentsContext);
void set_drawings (element_ptr Element);
void add_charts(chart_content_ptr chart);
void add_jsaProject(const std::string &content);
@ -163,6 +164,7 @@ private:
element_ptr settings_;
element_ptr comments_;
element_ptr jsaProject_;
element_ptr drawings_;
};

View File

@ -62,6 +62,9 @@ struct drawing_object_description
double anchor_x_;
double anchor_y_;
_CP_OPT(_INT32) owner_cx_;
_CP_OPT(_INT32) owner_cy_;
_action_desc action_;
std::vector<_hlink_desc> hlinks_;

View File

@ -38,8 +38,9 @@
#include "oox_rels.h"
namespace cpdoccore {
namespace odf_reader {
class header_footer_impl;
namespace odf_reader
{
class header_footer_impl;
}
namespace oox {

View File

@ -73,7 +73,7 @@ std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName,
//if (FALSE == (hr = pFontManager->LoadString2( std::to_wstring(i), 0, 0)))
// return std::pair<float, float>(7,8);
if (FALSE == (hr = pFontManager->LoadString2( L"xxxxx" , 0, 0)))
if (FALSE == (hr = pFontManager->LoadString2( L"0123456789abcdefghijklmnopqrstuvwxyz" , 0, 0)))
return std::pair<float, float>(7,8);
TBBox box;
@ -96,7 +96,7 @@ std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName,
if (box.fMaxY - box.fMinY < minHeight) minHeight = box.fMaxY - box.fMinY;
}
double width = (minWidth + 2 * maxWidth) /3. /5.;
double width = (minWidth + 2 * maxWidth) /36. /3.;
return std::pair<float, float>(width, maxHeight);
}

View File

@ -101,6 +101,7 @@ void mediaitems::set_font_directory(std::wstring pathFonts)
if (applicationFonts_)
applicationFonts_->InitializeFromFolder(pathFonts);
}
std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, bool & isInternal)
{
std::wstring ref;
@ -193,7 +194,14 @@ std::wstring mediaitems::detectImageFileExtension(const std::wstring &fileName)
CImageFileFormatChecker image_checker;
sExt = image_checker.DetectFormatByData(buffer, buffer_size);
if (!sExt.empty()) sExt = std::wstring(L".") + sExt;
if (sExt.empty())
{
size_t n = fileName.rfind(L".");
if (n != std::wstring::npos)
sExt = XmlUtils::GetLower(fileName.substr(n));
}
else sExt = std::wstring(L".") + sExt;
}
return XmlUtils::GetLower(sExt);
}
@ -329,6 +337,10 @@ void mediaitems::dump_rels(rels & Rels)
{
for (size_t i = 0; i < items_.size(); i++)
{
if ( items_[i].type == typeUnknown ) continue;
if ( items_[i].type == typeShape ) continue;
if ( items_[i].type == typeGroupShape ) continue;
if (items_[i].count_used >= items_[i].count_add) continue; // уже использовали этот релс выше(колонтитул ....)
Rels.add( relationship(
@ -338,7 +350,7 @@ void mediaitems::dump_rels(rels & Rels)
items_[i].mediaInternal ? L"" : L"External" )
);
items_[i].count_used++;
}
}
}

View File

@ -123,19 +123,21 @@ public:
if (sExt == L"wmv") return typeVideo;
if (sExt == L"avi") return typeVideo;
if (sExt == L"wmv") return typeVideo;
if (sExt == L"wma") return typeAudio;
if (sExt == L"wav") return typeAudio;
if (sExt == L"mp3") return typeAudio;
if (sExt == L"m4a") return typeAudio;
if (sExt == L"m4v") return typeVideo;
if (sExt == L"mp4") return typeVideo;
if (sExt == L"mov") return typeVideo;
if (sExt == L"mkv") return typeVideo;
if (sExt == L"webm") return typeVideo;
if (sExt == L"wmv") return typeVideo;
if (sExt == L"wma") return typeAudio;
if (sExt == L"wav") return typeAudio;
if (sExt == L"mp3") return typeAudio;
if (sExt == L"m4a") return typeAudio;
return typeMedia;
}
private:
std::wstring create_file_name (const std::wstring & uri, RelsType type, bool & isInternal, size_t Num);
std::wstring detectImageFileExtension (const std::wstring &fileName);
@ -146,6 +148,7 @@ private:
NSFonts::IApplicationFonts *applicationFonts_;
};
typedef _CP_PTR(mediaitems) mediaitems_ptr;
}
}

View File

@ -122,6 +122,7 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
oox_chart_shape shape;
_CP_OPT(bool) boolVal;
_CP_OPT(std::wstring) strVal;
_CP_OPT(double) doubleVal;
oox_title title;
title.set_content(content_.title_);//todo нужно задать понармальному layout
@ -146,7 +147,23 @@ void oox_axis_content::oox_serialize_content(std::wostream & _Wostream)
CP_XML_ATTR(L"val", "minMax");//default
}
}
odf_reader::GetProperty(content_.properties_,L"logarithmic",boolVal);
odf_reader::GetProperty(content_.properties_,L"maximum", doubleVal);
if (doubleVal)
{
CP_XML_NODE(L"c:max")
{
CP_XML_ATTR(L"val", *doubleVal);
}
}
odf_reader::GetProperty(content_.properties_,L"minimum", doubleVal);
if (doubleVal)
{
CP_XML_NODE(L"c:min")
{
CP_XML_ATTR(L"val", *doubleVal);
}
}
odf_reader::GetProperty(content_.properties_,L"logarithmic", boolVal);
if ((boolVal == true) && (boolVal.get()==true))
{
CP_XML_NODE(L"c:logBase")

View File

@ -53,7 +53,7 @@ public:
std::wstring drawingId_;
};
oox_chart_context::oox_chart_context(mediaitems & m, std::wstring name) :
oox_chart_context::oox_chart_context(mediaitems_ptr & m, std::wstring name) :
impl_(new oox_chart_context::Impl( name)), mediaitems_(m)
{
@ -65,7 +65,7 @@ void oox_chart_context::reset_fill(oox::_oox_fill &f)
{
bool isInternal = true;
std::wstring ref;
f.bitmap->rId = mediaitems_.add_or_find(f.bitmap->xlink_href_, typeImage, isInternal, ref);
f.bitmap->rId = mediaitems_->add_or_find(f.bitmap->xlink_href_, typeImage, isInternal, ref);
rels_.push_back(_rel(isInternal, f.bitmap->rId, ref, typeImage));
}
@ -75,9 +75,15 @@ void oox_chart_context::set_externalData(const std::wstring & href)
bool isInternal = true;
std::wstring href_out;
externalDataId_ = mediaitems_.add_or_find(href, typeMsObject, isInternal, href_out);
externalDataId_ = mediaitems_->add_or_find(href, typeMsObject, isInternal, href_out);
rels_.push_back(_rel(isInternal, externalDataId_, href_out, typeMsObject));
}
void oox_chart_context::set_userShapes(std::pair<std::wstring, std::wstring> &link)
{
bool isInternal = true;
userShapesId_ = link.second;
rels_.push_back(_rel(isInternal, userShapesId_, link.first, typeChartUserShapes));
}
std::wostream & oox_chart_context::chartData()
{
return impl_->chartData_;
@ -116,6 +122,15 @@ void oox_chart_context::dump_rels(rels & Rels)
(r.is_internal ? L"" : L"External"))
);
}
else if (r.type == typeChartUserShapes)
{
Rels.add(relationship(
r.rid,
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartUserShapes",
r.is_internal ? std::wstring(L"../drawings/") + r.ref : r.ref,
(r.is_internal ? L"" : L"External"))
);
}
}
}
@ -154,6 +169,7 @@ void oox_chart_context::serialize(std::wostream & strm)
{
if (plot_area_.current_chart_->is3D_)
{
plot_area_.oox_serialize_view3D(CP_XML_STREAM());
//CP_XML_NODE(L"c:view3D");
CP_XML_NODE(L"c:floor");
CP_XML_NODE(L"c:backWall");
@ -226,6 +242,13 @@ void oox_chart_context::serialize(std::wostream & strm)
}
}
}
if (userShapesId_.empty() == false)
{
CP_XML_NODE(L"c:userShapes")
{
CP_XML_ATTR(L"r:id", userShapesId_);
}
}
}
}
}

View File

@ -53,7 +53,7 @@ typedef _CP_PTR(oox_chart_context) oox_chart_context_ptr;
class oox_chart_context
{
public:
oox_chart_context(mediaitems & mediaitems_, std::wstring name);
oox_chart_context(mediaitems_ptr & mediaitems_, std::wstring name);
~oox_chart_context();
std::wostream & chartData();
@ -83,6 +83,8 @@ public:
}
}
void set_externalData(const std::wstring & href);
void set_userShapes(std::pair<std::wstring, std::wstring> &link);
void add_chart(int type)
{
plot_area_.add_chart(type);
@ -116,10 +118,11 @@ public:
graphic_properties_= prop;
fill_ = fill;
}
void set_plot_area_properties(std::vector<odf_reader::_property> & prop, _oox_fill &fill)
void set_plot_area_properties(std::vector<odf_reader::_property> & prop, std::vector<odf_reader::_property> & prop_3d, _oox_fill &fill)
{
reset_fill(fill);
plot_area_.properties_ = prop;
plot_area_.properties_3d_ = prop_3d;
plot_area_.fill_ = fill;
}
@ -128,7 +131,7 @@ private:
class Impl;
_CP_SCOPED_PTR(Impl) impl_;
mediaitems &mediaitems_;
mediaitems_ptr mediaitems_;
std::vector<_rel> rels_;
cpdoccore::oox::oox_title title_;
@ -137,6 +140,7 @@ private:
std::wstring pivot_source_;
std::wstring externalDataId_;
std::wstring userShapesId_;
std::vector<odf_reader::_property> graphic_properties_;
_oox_fill fill_;

View File

@ -59,12 +59,19 @@ oox_chart_series::oox_chart_series()
bLocalTable_ = false;
labelPosEnabled_ = true;
}
void oox_chart_series::setName(std::wstring &value)
void oox_chart_series::setName(const std::wstring &value)
{
name_=value;
name_ = value;
}
void oox_chart_series::setLabels(const std::wstring &formula, std::vector<std::wstring> & cash)
{
formulasconvert::odf2oox_converter converter;
void oox_chart_series::setFormula(int ind, std::wstring &value, std::wstring & formatCode, bool link_to_source)
label_.present = true;
label_.formula = converter.convert_chart_distance(formula);
label_.str_cache = cash;
}
void oox_chart_series::setFormula(int ind, const std::wstring &value, const std::wstring & formatCode, bool link_to_source)
{
formulasconvert::odf2oox_converter converter;
@ -137,6 +144,7 @@ void oox_chart_series::parse_properties()
data_labels_->set_position(*intVal);
}
}
void oox_chart_series::setValues(int ind, std::vector<std::wstring> & values)
{
values_[ind].present = true;
@ -215,6 +223,44 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
shape.set(content_.graphic_properties_, content_.fill_);
shape.oox_serialize(_Wostream);
if (label_.present)
{
CP_XML_NODE(L"c:tx")
{
CP_XML_NODE(L"c:strRef")
{
if (!label_.formula.empty())
{
CP_XML_NODE(L"c:f")
{
CP_XML_STREAM() << label_.formula;
}
}
if (false == label_.str_cache.empty())
{
CP_XML_NODE(L"c:strCache")
{
CP_XML_NODE(L"c:ptCount")
{
CP_XML_ATTR(L"val", label_.str_cache.size());
}
for (size_t i = 0; i < label_.str_cache.size(); i++)
{
CP_XML_NODE(L"c:pt")
{
CP_XML_ATTR(L"idx", i);
CP_XML_NODE(L"c:v")
{
CP_XML_STREAM() << label_.str_cache[i];
}
}
}
}
}
}
}
}
for (int i = 0; i < 5; i++)
{
if (values_[i].present)

View File

@ -56,17 +56,20 @@ public:
virtual void oox_serialize(std::wostream & _Wostream) = 0;
bool labelPosEnabled_;
_oox_chart_values values_[5]; //cat(labels), common, x, y, bubble,
_oox_chart_values values_[5]; //cat, common, x, y, bubble,
_oox_strRef label_; //tx (Series Text) §21.2.2.215
int id_;
std::wstring name_; //tx (Series Text) §21.2.2.215
std::wstring name_;
int iSymbolMarkerType_;
bool bLocalTable_;
_CP_OPT(oox_data_labels) data_labels_;
void setName(std::wstring &value);
void setName(const std::wstring &value);
void setFormula (int ind, std::wstring & value, std::wstring & formatCode, bool link_to_source);
void setFormula (int ind, const std::wstring & value, const std::wstring & formatCode, bool link_to_source);
void setValues (int ind, std::vector<std::wstring> & values);
void setLabels (const std::wstring &formula, std::vector<std::wstring> & values);
void parse_properties();
void set_cache_only (bool val);

View File

@ -55,21 +55,21 @@ struct _oox_numLit
struct _oox_strRef
{
bool present;
bool present = false;
std::wstring formula;
int str_cache_count;
int str_cache_count = 0;
std::vector<std::wstring> str_cache;
};
struct _oox_numRef
{
bool present;
bool present = false;
std::wstring formula;
std::wstring formatCode;
bool link_to_source;
int num_cache_count;
bool link_to_source = false;
int num_cache_count = 0;
std::vector<std::wstring> num_cache;
};

View File

@ -99,17 +99,23 @@ void tabs_context::reset()
odf_reader::style_tab_stop *tab_stop = dynamic_cast<odf_reader::style_tab_stop*>(tabs[i].get());
if (tab_stop)
{
clear_tabs.insert(std::make_pair(tab_stop->style_position_.get_value(), tabs[i]));
double pos = tab_stop->margin_left + tab_stop->style_position_.get_value_unit(odf_types::length::pt);
clear_tabs.insert(std::make_pair((int)pos, tabs[i]));
}
}
tabs.clear();
}
void tabs_context::add(const odf_reader::office_element_ptr & element)
void tabs_context::add(const odf_reader::office_element_ptr & element, double margin_left)
{
odf_reader::style_tab_stop *tab_stop = dynamic_cast<odf_reader::style_tab_stop*>(element.get());
if (tab_stop)
{
std::map<double, odf_reader::office_element_ptr>::iterator pFind = clear_tabs.find(tab_stop->style_position_.get_value());
tab_stop->margin_left = margin_left;
double pos = margin_left + tab_stop->style_position_.get_value_unit(odf_types::length::pt);
std::map<int, odf_reader::office_element_ptr>::iterator pFind = clear_tabs.find((int)pos);
if (pFind != clear_tabs.end())
{
@ -126,7 +132,7 @@ void tabs_context::docx_convert(oox::docx_conversion_context & Context)
_pPr << L"<w:tabs>";
for (std::map<double, odf_reader::office_element_ptr>::iterator it = clear_tabs.begin(); it != clear_tabs.end(); ++it)
for (std::map<int, odf_reader::office_element_ptr>::iterator it = clear_tabs.begin(); it != clear_tabs.end(); ++it)
{
odf_reader::style_tab_stop * tab_stop = dynamic_cast<odf_reader::style_tab_stop*>(it->second.get());
tab_stop->docx_convert(Context, true);

View File

@ -110,7 +110,7 @@ class tabs_context : boost::noncopyable
public:
std::vector<odf_reader::office_element_ptr> tabs;
std::map<double, odf_reader::office_element_ptr> clear_tabs;
std::map<int, odf_reader::office_element_ptr> clear_tabs;
void clear()
{
@ -120,7 +120,7 @@ public:
void reset();
void add(const odf_reader::office_element_ptr & element);
void add(const odf_reader::office_element_ptr & element, double margin_left);
void docx_convert(oox::docx_conversion_context & Context);
};
class styles_context : boost::noncopyable

View File

@ -131,6 +131,76 @@ static const std::wstring _ooxDashStyle[]=
L"dashDot",
L"sysDashDotDot"
};
static const std::wstring _vmlDashStyle[]=
{
L"none",
L"solid",
L"dot",
L"dash",
L"dash",
L"dashdot",
L"shortdashdotdot"
};
void oox_serialize_effects(std::wostream & strm, const std::vector<odf_reader::_property> & prop)
{
_CP_OPT(bool) bShadow;
_CP_OPT(std::wstring) strShadowColor;
_CP_OPT(double) dShadowOpacity;
_CP_OPT(double) dShadowOffsetX;
_CP_OPT(double) dShadowOffsetY;
odf_reader::GetProperty(prop, L"shadow", bShadow);
odf_reader::GetProperty(prop, L"shadow-color", strShadowColor);
odf_reader::GetProperty(prop, L"shadow-opacity", dShadowOpacity);
odf_reader::GetProperty(prop, L"shadow-offset-x", dShadowOffsetX);
odf_reader::GetProperty(prop, L"shadow-offset-y", dShadowOffsetY);
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"a:effectLst")
{
if ((bShadow) && (*bShadow))
{
CP_XML_NODE(L"a:outerShdw")
{
//CP_XML_ATTR(L"blurRad", 0);
double offsetX = dShadowOffsetX.get_value_or(0);
double offsetY = dShadowOffsetY.get_value_or(0);
double dist = sqrt(offsetX * offsetX + offsetY * offsetY);
double dir = (offsetX > 0 ? atan(offsetY / offsetX) : 0) * 180. / 3.1415926;
CP_XML_ATTR(L"dist", (int)(dist));
CP_XML_ATTR(L"dir", (int)(dir * 60000));
CP_XML_ATTR(L"rotWithShape", L"0");
CP_XML_ATTR(L"algn", L"tl");
CP_XML_NODE(L"a:srgbClr")
{
if (strShadowColor)
{
CP_XML_ATTR(L"val", *strShadowColor);
}
else
{
CP_XML_ATTR(L"val", L"000000");
}
if (dShadowOpacity)
{
CP_XML_NODE(L"a:alpha")
{
CP_XML_ATTR(L"val", *dShadowOpacity * 1000);
}
}
}
}
}
}
}
}
void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_property> & prop, bool always_draw, const std::wstring &ns)
{
@ -152,7 +222,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
odf_reader::GetProperty(prop, L"stroke" , iStroke);
odf_reader::GetProperty(prop, L"stroke-width" , dStrokeWidth);
odf_reader::GetProperty(prop, L"stroke-opacity" , dStrokeOpacity);
if ((!strStrokeColor && !iStroke && !dStrokeWidth) && !always_draw)return;
CP_XML_WRITER(strm)
@ -190,7 +260,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
CP_XML_NODE(ns + L":srgbClr")
{
CP_XML_ATTR2(ns_att + L"val",color);
CP_XML_ATTR2(ns_att + L"val", color);
if (dStrokeOpacity)
{
@ -224,6 +294,102 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
}
}
}
void vml_serialize_text(std::wostream & strm, const std::vector<odf_reader::_property> & prop)
{
_CP_OPT(std::wstring) strTextContent;
odf_reader::GetProperty(prop, L"text-content", strTextContent);
CP_XML_WRITER(strm)
{
if (strTextContent)
{
CP_XML_NODE(L"v:textbox")
{
CP_XML_ATTR(L"style", L"mso-direction-alt:auto");
CP_XML_ATTR(L"o:singleclick", L"f");
CP_XML_NODE(L"div")
{
CP_XML_ATTR(L"style", L"text-align:left");
CP_XML_NODE(L"font")
{
CP_XML_ATTR(L"face", L"Segoe UI");
CP_XML_ATTR(L"size", L"160");
CP_XML_ATTR(L"color", L"#000000");
const std::wstring & test_string = strTextContent.get();
CP_XML_STREAM() << test_string;
}
}
}
}
}
}
void vml_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_property> & prop)
{
_CP_OPT(std::wstring) strStrokeColor;
_CP_OPT(int) iStroke;
_CP_OPT(double) dStrokeWidth;
_CP_OPT(double) dStrokeOpacity;
_CP_OPT(bool) bWordArt;
odf_reader::GetProperty(prop, L"wordArt", bWordArt);
odf_reader::GetProperty(prop, L"stroke-color" , strStrokeColor);
odf_reader::GetProperty(prop, L"stroke" , iStroke);
odf_reader::GetProperty(prop, L"stroke-width" , dStrokeWidth);
odf_reader::GetProperty(prop, L"stroke-opacity" , dStrokeOpacity);
if (!strStrokeColor && !iStroke && !dStrokeWidth) return;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"v:stroke")
{
std::wstring color, dash_style ;
if (strStrokeColor) color = *strStrokeColor;
if (iStroke)
{
if (iStroke.get() != 0 ) dash_style = _vmlDashStyle[iStroke.get()];
}
if ((dStrokeWidth) && (*dStrokeWidth >= 0))
{
int val = dStrokeWidth.get() * 12700; //in emu (1 pt = 12700)
if (val < 10) val = 12700;
CP_XML_ATTR(L"weight", val);
}
if (false == color.empty())
{
CP_XML_ATTR(L"color", L"#" + color);
}
if (!dash_style.empty() && dash_style != L"solid")
{
CP_XML_ATTR(L"dashstyle", dash_style);
}
//odf_reader::GetProperty(prop,L"marker-start", strVal);
//if (strVal)
//{
//}
//odf_reader::GetProperty(prop,L"marker-end",strVal);
//if (strVal)
//{
//}
CP_XML_ATTR(L"startarrow", L"block");
CP_XML_ATTR(L"startarrowwidth", L"medium");
CP_XML_ATTR(L"startarrowlength", L"medium");
CP_XML_ATTR(L"joinstyle", L"round");
CP_XML_ATTR(L"endcap", L"flat");
}
}
}
void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_property> & prop, const std::wstring & shapeGeomPreset, const std::wstring &ns)
{
std::wstring ns_att = (ns == L"a" ? L"" : ns + L":");
@ -375,7 +541,7 @@ void _oox_drawing::serialize_bodyPr(std::wostream & strm, const std::wstring & n
{
CP_XML_NODE(L"a:spAutoFit");
}
if ((bFitToSize) && (*bFitToSize))
else if ((bFitToSize) && (*bFitToSize))
{
CP_XML_NODE(L"a:normAutofit");
//{

View File

@ -83,7 +83,7 @@ namespace oox {
class _oox_drawing
{
public:
_oox_drawing() : type(typeUnknown), id(0), x(0), y(0), cx(0), cy(0), sub_type(0), inGroup(false), lined(false), connector(false), name(L"object"), extExternal(false)
_oox_drawing() : type(typeUnknown), id(0), x(0), y(0), cx(0), cy(0), sub_type(0), hidden(false), inGroup(false), lined(false), connector(false), name(L"object"), extExternal(false)
{
}
RelsType type;
@ -92,6 +92,7 @@ namespace oox {
size_t id;
bool lined;
bool connector;
bool hidden;
std::wstring name;
int sub_type; //odf
@ -123,7 +124,10 @@ namespace oox {
void oox_serialize_ln (std::wostream & strm, const std::vector<odf_reader::_property> & val, bool always_draw = false, const std::wstring &ns = L"a");
void oox_serialize_aLst (std::wostream & strm, const std::vector<odf_reader::_property> & val, const std::wstring & shapeGeomPreset, const std::wstring &ns = L"a");
void oox_serialize_action (std::wostream & strm, const _action_desc & val);
void oox_serialize_effects (std::wostream & strm, const std::vector<odf_reader::_property> & val);
void vml_serialize_ln (std::wostream & strm, const std::vector<odf_reader::_property> & val);
void vml_serialize_text (std::wostream & strm, const std::vector<odf_reader::_property> & val);
}
}

View File

@ -245,7 +245,7 @@ void vml_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val)
{
if (!val.gradient->colors.empty())
{
CP_XML_ATTR(L"color2", val.gradient->colors[val.gradient->colors.size() - 1].color_ref);
CP_XML_ATTR(L"color2", L"#" + val.gradient->colors[val.gradient->colors.size() - 1].color_ref);
std::wstring colors_value;
for (size_t i = 0; i < val.gradient->colors.size(); i++)
@ -404,6 +404,27 @@ void vml_serialize_background (std::wostream & strm, const _oox_fill & val, cons
}
}
void vml_serialize_fill (std::wostream & strm, const _oox_fill & val)
{
switch (val.type)
{
case 0:
break;
case 1:
vml_serialize_solid_fill(strm, val);
break;
case 2:
vml_serialize_bitmap_fill(strm, val);
break;
case 3:
vml_serialize_gradient_fill(strm, val);
break;
case 4:
//vml_serialize_hatch_fill(strm, val);
break;
}
}
void oox_serialize_fill (std::wostream & strm, const _oox_fill & val, const std::wstring &ns)
{
switch (val.type)

View File

@ -154,5 +154,6 @@ namespace oox {
void oox_serialize_bitmap_fill (std::wostream & strm, const _oox_fill & val, const std::wstring &ns = L"a");
void oox_serialize_fill (std::wostream & strm, const _oox_fill & val, const std::wstring &ns = L"a");
void vml_serialize_fill (std::wostream & strm, const _oox_fill & val);
}
}

View File

@ -75,6 +75,7 @@ static std::wstring get_mime_type(const std::wstring & extension)
else if (L"tiff" == extension) return L"image/x-tiff";
else if (L"pdf" == extension) return L"application/pdf";
else if (L"bmp" == extension) return L"image/bmp";
else if (L"wdp" == extension) return L"image/vnd.ms-photo";
else if (L"wav" == extension) return L"audio/wav";
else if (L"mp3" == extension) return L"audio/mpeg";
@ -93,6 +94,8 @@ static std::wstring get_mime_type(const std::wstring & extension)
else if (L"xlsx" == extension) return L"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
else if (L"docx" == extension) return L"application/vnd.openxmlformats-officedocument.wordprocessingml.document";
else if (L"doc" == extension) return L"application/msword";
else if (L"vsd" == extension) return L"application/vnd.visio";
else if (L"vsdx" == extension) return L"application/vnd.ms-visio.drawing";
else return L"application/octet-stream";
@ -172,6 +175,26 @@ bool content_types_file::add_or_find_override(const std::wstring & fileName)
return true;
}
void content_types_file::set_media(mediaitems_ptr & _Mediaitems)
{
std::vector<mediaitems::item> & items_ = _Mediaitems->items();
for (size_t i = 0; i < items_.size(); i++)
{
if ((items_[i].type == typeImage ||
items_[i].type == typeMedia ||
items_[i].type == typeVideo ||
items_[i].type == typeAudio) && items_[i].mediaInternal)
{
int n = items_[i].outputName.rfind(L".");
if (n > 0)
{
add_or_find_default(items_[i].outputName.substr(n + 1, items_[i].outputName.length() - n));
}
}
}
}
void content_types_file::set_media(mediaitems & _Mediaitems)
{
@ -348,7 +371,7 @@ void docProps_files::write(const std::wstring & RootPath)
////////////
media::media(mediaitems & _Mediaitems, NSFonts::IApplicationFonts *pAppFonts) : mediaitems_(_Mediaitems), appFonts_(pAppFonts)
media::media(mediaitems_ptr & _mediaitems, NSFonts::IApplicationFonts *pAppFonts) : mediaItems_(_mediaitems), appFonts_(pAppFonts)
{
}
@ -357,7 +380,8 @@ void media::write(const std::wstring & RootPath)
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"media";
NSDirectory::CreateDirectory(path.c_str());
mediaitems::items_array & items = mediaitems_.items();
mediaitems::items_array & items = mediaItems_->items();
for (size_t i = 0; i < items.size(); i++ )
{
if (items[i].mediaInternal && items[i].valid && ( items[i].type == typeImage ||
@ -380,7 +404,7 @@ void media::write(const std::wstring & RootPath)
}
//------------------------------------------------------------------------------------------------------------
charts::charts(mediaitems & _ChartsItems) : chartsitems_(_ChartsItems)
charts::charts(mediaitems_ptr & _chartsItems) : chartsItems_(_chartsItems)
{
}
@ -389,7 +413,7 @@ void charts::write(const std::wstring & RootPath)
}
//--------------------------------------------------------------------------------------------------------------
embeddings::embeddings(mediaitems & _EmbeddingsItems) : embeddingsitems_(_EmbeddingsItems)
embeddings::embeddings(mediaitems_ptr & _EmbeddingsItems) : embeddingsItems_(_EmbeddingsItems)
{
}
void embeddings::write(const std::wstring & RootPath)
@ -399,7 +423,8 @@ void embeddings::write(const std::wstring & RootPath)
content_types_file & content_types = get_main_document()->get_content_types_file();
mediaitems::items_array & items = embeddingsitems_.items();
mediaitems::items_array & items = embeddingsItems_->items();
for (size_t i = 0; i < items.size(); i++ )
{
if ( items[i].mediaInternal && items[i].valid &&

View File

@ -51,6 +51,7 @@ namespace cpdoccore {
namespace oox {
class mediaitems;
typedef _CP_PTR(mediaitems) mediaitems_ptr;
namespace package {
@ -81,16 +82,17 @@ inline element::~element()
class content_types_file : public element
{
public:
content_types_file ();
void write (const std::wstring & RootPath);
bool add_or_find_default (const std::wstring & extension);
bool add_or_find_override(const std::wstring & fileName);
void set_media (mediaitems & _Mediaitems);
content_type * content ();
content_types_file ();
void write (const std::wstring & RootPath);
bool add_or_find_default (const std::wstring & extension);
bool add_or_find_override(const std::wstring & fileName);
void set_media (mediaitems & _Mediaitems);
void set_media (mediaitems_ptr & _Mediaitems);
content_type* content ();
private:
content_type content_type_content_;
std::wstring filename_;
std::wstring filename_;
};
class simple_element;
@ -189,8 +191,8 @@ public:
std::wstring str() { return content_.str(); }
static _CP_PTR(chart_content) create();
private:
std::wstringstream content_;
rels_file_ptr rels_;
std::wstringstream content_;
rels_file_ptr rels_;
};
//------------------------------------------------------------------------
class document : public element
@ -228,39 +230,39 @@ private:
class media : public element
{
public:
media(mediaitems & _Mediaitems, NSFonts::IApplicationFonts *pAppFonts);
media(mediaitems_ptr & _mediaItems, NSFonts::IApplicationFonts *pAppFonts);
public:
virtual void write(const std::wstring & RootPath);
private:
mediaitems & mediaitems_;
NSFonts::IApplicationFonts * appFonts_;
mediaitems_ptr mediaItems_;
NSFonts::IApplicationFonts* appFonts_;
};
class charts : public element
{
public:
charts(mediaitems & _ChartsItems);
charts(mediaitems_ptr & _chartsItems);
public:
virtual void write(const std::wstring & RootPath);
private:
mediaitems & chartsitems_;
mediaitems_ptr chartsItems_;
};
class embeddings : public element
{
public:
embeddings(mediaitems & _EmbeddingsItems);
embeddings(mediaitems_ptr & _embeddingsItems);
public:
virtual void write(const std::wstring & RootPath);
private:
mediaitems & embeddingsitems_;
mediaitems_ptr embeddingsItems_;
};
} // namespace package

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