Compare commits

...

296 Commits

Author SHA1 Message Date
bf6bfce051 fix bug 34509 2017-03-24 20:02:11 +03:00
805c24ff1a fix bug 27498 2017-03-24 18:35:08 +03:00
2c4bb7c808 for bug 34498. ULong 2017-03-23 20:24:52 +03:00
15a711396f x2t xlsx outline level save/read in binary 2017-03-22 17:53:09 +03:00
3d8403346b fix added bug 34297 2017-03-20 17:42:00 +03:00
5700503efe fix build converter ios 2017-03-16 12:56:04 +03:00
d01b1e7d41 fix bug 33781 2017-03-15 13:28:49 +03:00
584cc6ab80 fix bug 34297 2017-03-11 18:47:30 +03:00
4b727edde8 . 2017-03-09 16:05:45 +03:00
9d10c4ddce Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2017-03-07 12:19:08 +03:00
d5026d014d . 2017-03-06 17:24:29 +03:00
ac0b7e4e22 fix bug 34019 2017-03-06 15:45:43 +03:00
623fe25415 fix 34229 2017-03-06 15:30:54 +03:00
c4c9d50aae fix bug 34222 2017-03-06 14:29:15 +03:00
5d8dda02ec pptx extended reading fix 2017-03-04 16:01:15 +03:00
bc3461147d fix pptx note slide default 2017-03-03 14:29:18 +03:00
80d4e6057b .. 2017-03-03 13:35:37 +03:00
2dc5c2916a .. 2017-03-03 13:28:16 +03:00
5f9631a3c5 .. 2017-03-02 13:14:27 +03:00
ef7df69036 linux build fix 2017-03-01 20:06:37 +03:00
b3961994d2 Pptx .. 2017-03-01 19:40:40 +03:00
927a847607 . 2017-03-01 18:14:33 +03:00
674cc6c1a2 fix doct->docx background page settings 2017-03-01 14:18:35 +03:00
5d77cf9473 add ../ path for dll path 2017-03-01 13:23:11 +03:00
512dad1d24 fix double write attribute in background 2017-02-28 20:02:54 +03:00
3d684934f1 fix ppt background
fix bug 34177
read attributes (from line props, shape props , effects, 3D) without namespace
2017-02-28 19:03:04 +03:00
dd6ac185fb fix - remove tmp pptx folder 2017-02-28 18:27:00 +03:00
9825b6e32e Error writing xlsx (wrong ConditionalFormatting place) 2017-02-27 20:27:31 +03:00
653008ebfc XlsxFormat (graphicFrame) 2017-02-27 18:26:50 +03:00
236e93aa9c add GlobalVariable 2017-02-27 16:46:17 +03:00
164c7faf94 ..fix previus 2017-02-27 12:35:49 +03:00
4c07ddbcc7 . 2017-02-26 22:22:46 +03:00
7be543c3a6 pptx format .. extended reading xml 2017-02-26 18:57:48 +03:00
ccb47b0bda . 2017-02-23 15:20:20 +03:00
8aefacd411 new chart witout office_drawing(faster...) 2017-02-22 19:57:15 +03:00
6cd5fbcaca . 2017-02-21 23:38:23 +03:00
7c964b3f9c .. 2017-02-21 19:17:24 +03:00
8c43c781bd fix build 2017-02-21 18:00:39 +03:00
7496de06f0 . 2017-02-21 13:19:21 +03:00
fdd443a2d7 . 2017-02-21 13:18:29 +03:00
037c4046eb PptxFormat - extending reading xml; sppr, txpr in chart without DrawingConverter 2017-02-21 11:32:31 +03:00
4e5ac14ca9 errors for builder (open/save) 2017-02-18 14:17:42 +03:00
dedf74b366 fix for build 2017-02-18 11:02:42 +03:00
6f2eef1137 .. 2017-02-17 16:42:49 +03:00
9a8d3edbef . 2017-02-17 16:33:19 +03:00
305ebda78d OfficeUtils - add sort for compress 2017-02-17 16:28:00 +03:00
114050c23e fix bug #33849 2017-02-16 19:26:50 +03:00
7eee0755bf RtfFormatReader - generate replacement text hyperlink if absent 2017-02-16 16:23:21 +03:00
c329f29e9a RtfFormatReader - fix hyperlink text 2017-02-16 15:49:08 +03:00
0f3a02ca7c . 2017-02-16 15:20:53 +03:00
62d4860873 pptx - extending reading xml 2017-02-16 15:08:53 +03:00
21666ee309 x2t verion up 2.0.3.440 2017-02-16 11:38:20 +03:00
47ff766e4e . 2017-02-15 11:36:04 +03:00
50cbc671b3 RtfFormatWriter - text in drawing shapes, ... 2017-02-13 20:11:52 +03:00
f2d3390bd4 RtfFormatWriter - fix custom shape path 2017-02-13 14:23:38 +03:00
fb5af12d7a OdfFormat - refactroing svg; RtfFormatWriter - add custom shapes 2017-02-12 15:38:51 +03:00
63655a97e9 .. 2017-02-11 15:32:29 +03:00
fdf032d9f8 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  RtfFormat - add office digital signatures
  bug with some jpeg
  x2t version up 2.0.3.438
  RtfFormat - fix croping image, ...
  RtfFormat - extended drawing
  fix bug #34016
  fix bug #34018
  fix bug 34011
  fix bug #33752 after refactoring
  fix convert oox group shape to vml group shape
  RtfFormatWriter - fix table cell width (auto)
  OdfFormat - Reader/Writer - background page (image, pattern, gradient)
  fix bug #33918
2017-02-10 18:16:27 +03:00
3b85b58558 up 2017-02-10 18:16:18 +03:00
00f1f40a1e RtfFormat - add office digital signatures 2017-02-10 18:09:48 +03:00
46c05a4c27 bug with some jpeg 2017-02-10 17:14:53 +03:00
f3a510bd58 x2t version up 2.0.3.438 2017-02-10 15:49:17 +03:00
45231b822c RtfFormat - fix croping image, ... 2017-02-10 15:02:00 +03:00
e0591675d2 RtfFormat - extended drawing 2017-02-09 17:20:02 +03:00
67a849f110 fix bug #34016 2017-02-09 14:24:31 +03:00
15800296f7 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2017-02-08 20:04:33 +03:00
52fe741f9a fix bug #34018 2017-02-08 20:03:38 +03:00
b3ee693890 fix bug 34011 2017-02-08 19:35:45 +03:00
8c2e1738ea fix bug #33752 after refactoring 2017-02-07 12:42:46 +03:00
bf33aed853 fix convert oox group shape to vml group shape 2017-02-06 20:07:58 +03:00
5869c7a02e RtfFormatWriter - fix table cell width (auto) 2017-02-06 13:55:01 +03:00
bbd429a994 OdfFormat - Reader/Writer - background page (image, pattern, gradient) 2017-02-05 15:57:17 +03:00
f4d636539e Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2017-02-03 18:34:43 +03:00
92e02257d7 fix bug #33918 2017-02-03 18:33:50 +03:00
d2046d7ccb add missed include 2017-02-03 18:15:57 +03:00
7bc35a157a Implemented case when the size of the masked image doesn't match to the size of the mask. 2017-02-03 18:02:28 +03:00
903245e8a7 fixed converter for iOS 2017-02-03 17:33:48 +03:00
25ee9c3c1c Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  x2t vesion up  2.0.3.435
  PDFReader: text clip
  .
  fix...
  .
  x2t version up
  DocxFormat - fix vml single geom position RtfFormat - read/write background page (solid, pattern, gradient, image)
2017-02-03 16:28:47 +03:00
9ead40d279 up header 2017-02-03 16:28:42 +03:00
e097379c21 x2t vesion up 2.0.3.435 2017-02-03 15:27:12 +03:00
f86579d601 PDFReader: text clip 2017-02-03 13:02:26 +03:00
de7511f243 . 2017-02-03 12:42:06 +03:00
9a68a75f70 fix... 2017-02-02 18:43:38 +03:00
e04388aa32 . 2017-02-02 16:53:20 +03:00
cee61e7a92 x2t version up 2017-02-02 16:31:02 +03:00
48185ed4e9 DocxFormat - fix vml single geom position
RtfFormat - read/write background page (solid, pattern, gradient, image)
2017-02-02 15:44:03 +03:00
7bea086784 Fixed bugs with reading pdf files. 2017-02-02 14:53:01 +03:00
774f9c42cb PDF bugs 2017-02-01 19:20:12 +03:00
10964d32e6 ... 2017-02-01 17:10:19 +03:00
da2493ed3b OdfFormatReader - fix math matrix 2017-02-01 16:15:32 +03:00
0a183f3505 fix bug #33886 2017-02-01 15:59:28 +03:00
ac6cc1ec24 pptx file with wrong rels 2017-02-01 15:05:08 +03:00
a1846da0da Merge tag 'v4.2.7' into develop
v4.2.7 v4.2.7
2017-02-01 12:49:34 +03:00
0bd10c28ac Merge branch 'hotfix/v4.2.7' 2017-02-01 12:49:29 +03:00
2367cee329 PptxFormat - fix user file with wrong rels 2017-01-31 19:59:20 +03:00
288d89301a fix bug 33801 2017-01-31 17:16:28 +03:00
4d519e8f26 x2t - version up, .. 2017-01-31 15:02:34 +03:00
1bd2c0b852 Merge branch 'hotfix/v4.2.7' into develop
fix bug 33867
2017-01-31 13:57:55 +03:00
82b0f4bce8 DiagramDrawing losing images 2017-01-31 13:50:16 +03:00
5635239274 fix crash on windows 2017-01-31 13:12:43 +03:00
1f979fc4cc . 2017-01-31 12:05:32 +03:00
80c4a65147 PptxFormat- fix convert oox drawing to vml drawing
RtfFormatWriter - convert oox drawing, convert smart art objects
2017-01-31 11:58:09 +03:00
4fda6101eb OdfFormatWriter - convert smart art 2017-01-28 18:38:46 +03:00
99822fb597 x2t ... fix after testing 2017-01-27 19:12:35 +03:00
f1d9c12f07 change encoding to utf8 2017-01-27 18:31:50 +03:00
30ef5a9de4 fix build converter 2017-01-27 17:54:00 +03:00
765ca861fb fix bug 33842 (corrupted xlsx->csv convertion) 2017-01-27 15:22:14 +03:00
99570b3b86 . 2017-01-26 19:51:12 +03:00
d9c6759108 OdfFormatWriter - convert smart art in spreadsheets, ... 2017-01-26 19:40:42 +03:00
b82a8c6b9b developing... 2017-01-26 15:20:54 +03:00
d76b1897aa save conditionalFormating to xlsx 2017-01-25 20:27:25 +03:00
857b79ee23 x2t - fix smart art 2017-01-25 19:51:47 +03:00
ecba12b29f x2t - delete unused files 2017-01-25 15:43:27 +03:00
efc48ab44c . 2017-01-25 13:04:02 +03:00
5f0620ed90 x2t - delete unused files 2017-01-25 13:01:18 +03:00
150ff1fae2 . 2017-01-24 23:01:52 +03:00
dd1b9ca9be ... 2017-01-24 18:44:46 +03:00
c6ed59a742 EmfFile - fix emf from users file xlsx 2017-01-24 18:34:04 +03:00
1d3315711e Merge branch 'hotfix/v.4.2.6' into develop 2017-01-24 11:56:02 +03:00
46ddcff040 .. 2017-01-24 11:10:53 +03:00
a044b262e4 . 2017-01-24 11:05:21 +03:00
51b0e715a1 . 2017-01-24 10:00:01 +03:00
1cdeefb576 restore file 2017-01-23 18:08:38 +03:00
db9aeb40bb .. 2017-01-23 17:33:55 +03:00
8a41f0c716 ............ 2017-01-23 17:32:29 +03:00
4be5a491da . 2017-01-23 00:49:58 +03:00
4b4d4ebc54 x2t checker - fix users file with crypt 2017-01-22 18:07:26 +03:00
b132ea266a .. 2017-01-22 17:48:55 +03:00
e20e061330 ... 2017-01-21 17:24:24 +03:00
fc97b32d18 x2t - smart art objects (move in pptx drawing); fix users file pptx with smart art 2017-01-20 20:08:06 +03:00
a63aa93092 XlsxFormat - fix users file with shape in VmlDrawing 2017-01-20 20:05:40 +03:00
91cb5e895b no message 2017-01-20 16:50:51 +03:00
16d233da47 no message 2017-01-20 16:49:43 +03:00
69e8a6501e open/save docx tblCaption,tblDescription and xlsx altText, altTextSummary 2017-01-20 13:49:03 +03:00
dac6ae2e48 x2t - PPTX format - refactoring 2017-01-19 18:22:13 +03:00
9f145333f8 x2t - remove libxml2 from DocxFormat 2017-01-19 15:40:02 +03:00
c8c5b82924 cashed scripts data scheme (may be disable) 2017-01-19 15:29:41 +03:00
2e99efeeb6 .. 2017-01-19 15:19:58 +03:00
c4492f2cd2 fix bug #33796 2017-01-19 14:04:54 +03:00
41da15d8cf .. 2017-01-19 12:10:21 +03:00
ea3db6936c . 2017-01-19 12:01:20 +03:00
0928e7d787 . 2017-01-19 11:30:58 +03:00
2d3040aba2 x2t - pptx format(refactoring common docxFormat), bug 33782(prepare) 2017-01-19 11:26:33 +03:00
ce590a4a61 fixed converter for iOS 2017-01-18 18:06:56 +03:00
e899647453 Recovered file 2017-01-17 18:43:52 +03:00
fe1553f8da Repared the removed file 2017-01-17 18:20:05 +03:00
04d197375c change license to 2017 2017-01-17 18:17:26 +03:00
d2f1022b5a fix defines 2017-01-17 13:25:27 +03:00
0265162cb9 . 2017-01-16 19:33:02 +03:00
9be4d6ca0e x2t linux build 2017-01-16 18:33:01 +03:00
9e9da20450 reset commit - remove bin2image 2017-01-16 17:41:40 +03:00
082fd814af . 2017-01-16 17:33:08 +03:00
39cd23d7c0 . 2017-01-16 17:30:05 +03:00
78b051c999 ... 2017-01-16 17:21:35 +03:00
2836fee493 Update ASCConverters.cpp
add bin2imageBase64 to generate thumbnail from pdf command in base64 format
2017-01-16 17:03:37 +03:00
6e409d2f7e images bug 2017-01-16 15:08:21 +03:00
3e698b8579 Merge tag 'v4.2.5' into develop
v4.2.5 v4.2.5
2017-01-16 14:59:44 +03:00
95e32f00d0 Merge branch 'hotfix/v4.2.5' 2017-01-16 14:59:40 +03:00
61c632ce55 Revert "add bin2image"
This reverts commit a97518359a.
2017-01-16 14:55:16 +03:00
a0b93fd1b2 . 2017-01-16 14:52:43 +03:00
0b096a4c46 add bin2image 2017-01-16 14:50:20 +03:00
a97518359a add bin2image 2017-01-16 14:28:38 +03:00
96cea25bca x2t version up 2017-01-16 11:09:55 +03:00
1a57f62773 x2t refactoring (delete AscString, ...) 2017-01-16 10:30:00 +03:00
9d1f83b1ce Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  miss dashDotDot in xlsx border style
2017-01-13 15:47:58 +03:00
6653e8ef82 fixed deployment target 2017-01-13 15:47:48 +03:00
fd121841a9 miss dashDotDot in xlsx border style 2017-01-13 15:40:47 +03:00
00255297c8 stable iOS converter 2017-01-13 12:15:39 +03:00
74a0fd2928 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  NSString: + stringWithUtf8Buffer method
2017-01-12 16:25:56 +03:00
ce7487a14d RtfFormatLib for iOS 2017-01-12 16:25:50 +03:00
95d9d8bc8e NSString: + stringWithUtf8Buffer method 2017-01-12 15:39:02 +03:00
dce0b43c11 HtmlFile for iOS 2017-01-12 14:47:42 +03:00
d7a981a84e PPTFileLib & TxtxXmlFileLib for iOS 2017-01-12 14:33:57 +03:00
bb52ddba2b coautoring events 2017-01-12 12:44:57 +03:00
a82814d565 count good changes detection error 2017-01-10 17:17:55 +03:00
bab37e1634 Merge tag 'staropramen' into develop
staropramen
2017-01-10 12:24:03 +03:00
06dea5685a Merge branch 'hotfix/staropramen' 2017-01-10 12:23:50 +03:00
105a23d5bc DocxRenderer (not worked) 2017-01-08 19:10:35 +03:00
ef76c80014 XlsFormat - fix errors fmt & old comments 2016-12-28 19:27:34 +03:00
bb6e95ce20 DocFormatReader - refactoring + fix errors 2016-12-27 19:32:09 +03:00
69d9823847 x2t - fix users files 2016-12-27 16:37:29 +03:00
fb10c56bd3 RtfFormatWriter - fix fields, XlsFormatReader - data valdation 2016-12-27 14:02:36 +03:00
4f24ed375e XlsFormatReader - dataValidations 2016-12-26 19:32:21 +03:00
036c3b3740 XlsFormatReader - decrypter ... 2016-12-26 15:01:48 +03:00
dddaeb3eeb previous commit bug 2016-12-26 12:04:59 +03:00
f75b0704a7 ... 2016-12-26 03:23:08 +03:00
baefae258b x2t refactoring qt projects .... 2016-12-25 23:46:39 +03:00
4f46ac6e69 .. 2016-12-25 23:23:15 +03:00
f634d1cfe5 x2t refactoring qt projects ... 2016-12-25 22:25:34 +03:00
a810253b22 opne/save drawing docPr 2016-12-24 18:00:48 +03:00
05e42b1908 write images to pdf bug 2016-12-24 15:21:37 +03:00
4ea7f5f9ed for docx background 2016-12-24 13:48:57 +03:00
50a1f3f5a7 x2t - refactoring qt projects 2016-12-23 19:54:30 +03:00
2710cabdc9 XlsFormatReader - delete unuseds, fix extended crypt, .. 2016-12-23 18:07:30 +03:00
1d55b1223c . 2016-12-23 18:06:18 +03:00
ac959e32af open/save ole object in a14 format xlsx 2016-12-23 16:00:57 +03:00
1c2524f5fb FontsGen - fix build 2016-12-23 14:38:15 +03:00
c0e4b02138 Merge tag 'v4.2.3' into develop
v4.2.3 v4.2.3
2016-12-23 14:22:08 +03:00
eb29cee9ad Merge branch 'hotfix/v4.2.3' 2016-12-23 14:22:04 +03:00
5720891452 macOS 10.11 2016-12-22 18:48:28 +03:00
96f7cd9017 . 2016-12-22 17:56:34 +03:00
c7ef8e9b1d . 2016-12-22 15:34:32 +03:00
1a2f9afac7 x2t linux build, version up 2016-12-22 15:12:06 +03:00
2c945b7166 x2t - refactoring (delete double conversions string) 2016-12-21 19:29:18 +03:00
e49deaaf64 Added dependency for HtmlFileInternal 2016-12-21 12:47:22 +03:00
3edb12499c Added UnicodeConverter dependency for AllFontGen 2016-12-20 19:46:31 +03:00
52c3f9bdb1 Added UnicodeConverter 2016-12-20 19:45:06 +03:00
1e53b26704 x2t -deleting atl relations 2016-12-20 17:55:49 +03:00
8ac5180992 DocxBin background documents ... 2016-12-20 14:24:55 +03:00
8cdf491178 DocxBin - add background document 2016-12-19 11:26:24 +03:00
c5c64cb6c2 XpsFile & DjVuFile - fix build 2016-12-16 17:26:20 +03:00
86000ee48f x2t 2.0.2.422 2016-12-16 12:33:28 +03:00
652fc292af DocFormatReader - same bugs fix 2016-12-16 12:28:17 +03:00
ef69fc4b34 Merge pull request #17 from ONLYOFFICE/hotfix/v4.2.3
Hotfix/v4.2.3
2016-12-16 12:25:59 +03:00
6e3b7b1146 thumbnail error with aspect 2016-12-16 12:17:10 +03:00
2ff5bd5910 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2016-12-16 10:57:41 +03:00
01528516dd HtmlRenderer -fix build 2016-12-16 10:56:49 +03:00
95dcf3661f Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2016-12-16 10:38:00 +03:00
717d91a192 . 2016-12-16 10:31:49 +03:00
3dd4dda2e3 DocFormatReader -ole ... 2016-12-15 18:12:41 +03:00
24dc35546f arguments to builder (JSON format) 2016-12-15 17:00:56 +03:00
fc2707f0b5 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2016-12-15 15:46:40 +03:00
ea5ebe720b DocFormatReader - another ole objects(pictureId) 2016-12-15 14:55:55 +03:00
cdead54f4a ios build converter 2016-12-15 13:36:00 +03:00
29ae0bdc38 . 2016-12-15 12:11:05 +03:00
502243103b Changed the build dependency 2016-12-15 11:41:45 +03:00
c668288308 . 2016-12-14 20:03:12 +03:00
39257334e4 x2t version up 2.0.2.401 2016-12-14 19:29:29 +03:00
48f95bd9f2 fix bug #33684 2016-12-14 19:22:00 +03:00
f925e5cae9 save zip if convert thumbnail with first=false 2016-12-14 18:51:03 +03:00
80d95d41c5 save to pdf (only first page support) 2016-12-14 16:56:56 +03:00
42fb658349 PdfReader/Writer linux build fix 2016-12-14 16:06:44 +03:00
d500cbc615 PdfReader/Writer windows build fix 2016-12-13 18:17:14 +03:00
470d57aec2 . 2016-12-13 17:25:02 +03:00
635a5d232a DocFormatReader - background page 2016-12-13 16:03:45 +03:00
6fa18eb20d add folders to search the system fonts 2016-12-13 10:48:48 +03:00
435bb02de3 Metfiles StarView - fix coding text (charsets) 2016-12-12 13:41:02 +03:00
a84425b49f x2t 2.0.2.420 2016-12-12 11:43:10 +03:00
250a6e5a06 OdfFormatReader - sheet/workbook views 2016-12-10 17:07:31 +03:00
82dc7ab444 OdfFormatReader - global settings for documents 2016-12-09 19:37:56 +03:00
51c8ab5499 add common method (GetFormatByExtension) 2016-12-09 18:28:33 +03:00
4176176e2b Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  OdfFormat - embedded office text (against text  box)
  .
  OdfFormatReader - presentation - support convert ole objects (and other embedded)
2016-12-09 18:11:24 +03:00
34d03c743e mobile-coautoring 2016-12-09 18:11:19 +03:00
4cf55208b1 OdfFormat - embedded office text (against text box) 2016-12-09 11:42:02 +03:00
fe1d48635b . 2016-12-08 19:47:49 +03:00
db20232095 OdfFormatReader - presentation - support convert ole objects (and other embedded) 2016-12-08 19:31:26 +03:00
56ecea3ffc Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  OdfFormatReader - spreadsheets - support convert ole objects (and other embedded)
  CONVERT_CORRUPTED
2016-12-08 18:06:13 +03:00
59599289af utils 2016-12-08 18:06:07 +03:00
d95c93abb2 OdfFormatReader - spreadsheets - support convert ole objects (and other embedded) 2016-12-08 14:51:12 +03:00
a9076bebd2 CONVERT_CORRUPTED 2016-12-07 20:04:11 +03:00
5157908b47 coach events 2016-12-07 17:20:51 +03:00
13b7306b99 . 2016-12-06 20:07:10 +03:00
b98a545d8c OdfFormatReader - ole embedded .... 2016-12-06 20:05:17 +03:00
ceb2c7863b Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2016-12-06 15:03:45 +03:00
26cedc30fa OdfFormatReader - embedded objects (ods in odt example) 2016-12-06 14:58:58 +03:00
c0f29521c4 Merge tag 'v4.2.1' into develop
v4.2.1
2016-12-06 14:52:30 +03:00
13d57361e4 Merge branch 'hotfix/v4.2.1' 2016-12-06 14:52:20 +03:00
1e04770e31 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  .
  DocFormatReader - fix users file
  Revert "DocFormatReader - users file fix"
  DocFormatReader - users file fix OdfFormatReader - fix alphabetic text index
  DocFormatReaer - users file fix OdfFormatReader - fix alphabetic text index
  Removed version number
2016-12-05 17:38:07 +03:00
6666ba0236 insert images in collaboration mode 2016-12-05 17:37:59 +03:00
e6c334199f DocFormatReader - fix users file 2016-12-05 15:51:49 +03:00
6d75b03cc0 . 2016-12-05 15:48:23 +03:00
303b62c2a1 DocFormatReader - fix users file 2016-12-05 15:48:04 +03:00
5109acb888 Revert "DocFormatReader - users file fix"
This reverts commit cbc4a5d334.
2016-12-05 15:46:36 +03:00
cbc4a5d334 DocFormatReader - users file fix
OdfFormatReader - fix alphabetic text index
2016-12-05 15:46:05 +03:00
a639fc9eaf Revert "Merge branch 'develop' into hotfix/v4.2.1"
This reverts commit 9cc54393a0, reversing
changes made to 29b4a10435.
2016-12-05 15:37:35 +03:00
9cc54393a0 Merge branch 'develop' into hotfix/v4.2.1 2016-12-05 15:31:00 +03:00
16386f4b5c DocFormatReaer - users file fix
OdfFormatReader - fix alphabetic text index
2016-12-05 15:17:40 +03:00
149c0ae72a Merge tag 'v4.2.0' into develop
v4.2.0 v4.2.0
2016-12-05 11:39:08 +03:00
29b4a10435 Merge branch 'release/v4.2.0' 2016-12-05 11:39:06 +03:00
1cf9401e0a Removed version number 2016-12-02 18:43:51 +03:00
c6a05e493f OdfFormatReader - .. 2016-12-01 20:06:19 +03:00
82e82971d0 Changed architecture detection for linux and macos 2016-12-01 18:00:15 +03:00
4b8c2b4f6d Update Makefile 2016-12-01 16:09:25 +03:00
a7e3158c06 Merge branch 'release/v4.2.0' into develop 2016-11-30 16:18:25 +03:00
329077caaf . 2016-11-30 14:20:09 +03:00
b75495c4ba write tableStyle without tableStyleElement 2016-11-30 12:21:01 +03:00
807eace056 . 2016-11-30 12:03:55 +03:00
cfdc8c9051 x2t version up 2.0.2.417 2016-11-29 19:39:27 +03:00
da18ecd89c OdfFormatReader - fix same small bags 2016-11-29 19:35:08 +03:00
7ae68b53db OdfFormatReader - fix same small bags 2016-11-29 16:55:22 +03:00
57bd7a0d93 for bug 33110 2016-11-29 16:46:23 +03:00
daba1ad2a3 DocFormatReader - fix bug #33397 2016-11-29 14:38:57 +03:00
755ea97af8 OdfFormatReader - fix same bugs 2016-11-28 19:20:53 +03:00
0f9669aa2b x2t version up 2.0.2.415 2016-11-28 11:07:18 +03:00
71aabb5f3f OdfFormatReader - fix bugs in track changes 2016-11-28 10:19:08 +03:00
18a963231a PPTFormatReader - shape convert fix 2016-11-27 17:09:36 +03:00
e3d6d370f7 Update Makefile 2016-11-26 11:30:39 +03:00
b06681bd97 OdfFormatReader - fix mac build, ... 2016-11-25 18:37:01 +03:00
ab4412155d Switched build sequence for the all target
It done in hope to escape double building the libraries.
2016-11-25 18:13:53 +03:00
49939a7f19 build error (macOS, clang) 2016-11-25 18:00:33 +03:00
e690aa0c53 . 2016-11-25 16:01:03 +03:00
bb4483fd7d Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  OdfFormatReader - fix errors ...
2016-11-25 12:08:47 +03:00
b93c7a2620 mobile-coautoring 2016-11-25 12:08:42 +03:00
f37394db00 OdfFormatReader - fix errors content 2016-11-24 18:29:51 +03:00
42c94d5cd0 OdfFormatReader - fix errors ... 2016-11-24 18:23:41 +03:00
41b3c6fb16 mobile-coautoring 2016-11-24 16:54:01 +03:00
9215 changed files with 110229 additions and 967814 deletions

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -125,7 +125,7 @@ namespace DocFormatUtils
if(bDeleteNoUnicode)
{
for(size_t pos = 0; pos != data.size(); ++pos)
for(size_t pos = 0; pos < data.size(); ++pos)
{
switch(data[pos])
{
@ -157,7 +157,7 @@ namespace DocFormatUtils
}
else
{
for(size_t pos = 0; pos != data.size(); ++pos)
for(size_t pos = 0; pos < data.size(); ++pos)
{
switch(data[pos])
{
@ -166,6 +166,8 @@ namespace DocFormatUtils
case '\'': buffer.append(L"&apos;"); break;
case '<': buffer.append(L"&lt;"); break;
case '>': buffer.append(L"&gt;"); break;
case '\0':
return buffer;
default: buffer.append(&data[pos], 1); break;
}
}
@ -503,6 +505,7 @@ namespace DocFormatUtils
{
STLCollection->push_back(result[i]);
}
return true;
}
template<class T> static bool GetSTLCollectionFromUtf8( T *STLCollection, unsigned char *bytes, int size)
@ -766,18 +769,12 @@ namespace DocFormatUtils
static inline std::wstring IntToWideString(int value)
{
#if defined(_WIN32) || defined (_WIN64)
wchar_t buff[33] ={};
_itow(value, buff, 10);
return std::wstring(buff);
#else
return (std::to_wstring(value));
#endif
}
static inline std::wstring DoubleToWideString(double value)
{
std::wstringstream src;
std::wstringstream src;
src << value;
return std::wstring(src.str());
@ -785,8 +782,7 @@ namespace DocFormatUtils
static inline std::string DoubleToString(double value)
{
std::stringstream src;
std::stringstream src;
src << value;
return std::string(src.str());
@ -813,36 +809,16 @@ namespace DocFormatUtils
static inline std::wstring IntToFormattedWideString( int value, const wchar_t* format )
{
// const int size = 33;
// wchar_t strValue[size] = L"\0";
if ( format == NULL ) return L"";
// swprintf_s( strValue, size, format, value );
//// }
// CString format_str;
// format_str.Format(format , value);
std::wstringstream sstream;
sstream << boost::wformat(format) % value;
return sstream.str();
//return string2std_string( format_str );
}
static inline std::wstring DoubleToFormattedWideString( double value, wchar_t* format )
{
if ( format == NULL ) return L"";
//std::wstring wstr;
//if ( format != NULL )
//{
// CString strValue;
// strValue.Format(format, value);
// wstr = string2std_string( strValue );
//}
//return wstr;
std::wstringstream sstream;
sstream << boost::wformat(format) % value;
return sstream.str();

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -57,11 +57,11 @@ namespace XMLTools
class XMLAttribute
========================================================================================================*/
template <class T> class XMLAttribute
class XMLAttribute
{
private:
std::basic_string<T> m_Name;
std::basic_string<T> m_Value;
std::wstring m_Name;
std::wstring m_Value;
public:
@ -69,56 +69,40 @@ namespace XMLTools
{
}
/*========================================================================================================*/
XMLAttribute( const T* name ) : m_Name(name)
XMLAttribute( const std::wstring & name ) : m_Name(name)
{
}
/*========================================================================================================*/
XMLAttribute( const T* name, const T* value ) : m_Name(name), m_Value(value)
XMLAttribute( const std::wstring & name, const std::wstring & value ) : m_Name(name), m_Value(value)
{
}
~XMLAttribute()
{
}
/*========================================================================================================*/
~XMLAttribute()
void SetValue( const std::wstring & value )
{
m_Value = std::wstring( value );
}
/*========================================================================================================*/
void SetValue( const T* value )
{
m_Value = std::basic_string<T>( value );
}
/*========================================================================================================*/
std::basic_string<T> GetName() const
std::wstring GetName() const
{
return m_Name;
}
/*========================================================================================================*/
std::basic_string<T> GetValue() const
std::wstring GetValue() const
{
return m_Value;
}
/*========================================================================================================*/
std::basic_string<T> GetXMLString()
std::wstring GetXMLString()
{
std::basic_string<T> xmlString( L"" );
std::wstring xmlString( L"" );
xmlString += m_Name;
xmlString += std::basic_string<T>( L"=\"" );
xmlString += std::wstring( L"=\"" );
xmlString += m_Value;
xmlString += std::basic_string<T>( L"\"" );
xmlString += std::wstring( L"\"" );
return xmlString;
}
@ -128,86 +112,63 @@ namespace XMLTools
class XMLElement
========================================================================================================*/
template <class T> class XMLElement
class XMLElement
{
typedef std::pair< std::basic_string<T>, std::basic_string<T> > AttributeValuePair;
typedef std::pair< std::wstring, std::wstring> AttributeValuePair;
private:
std::basic_string<T> m_Name;
std::basic_string<T> m_ElementText;
std::map<std::basic_string<T>, std::basic_string<T>> m_AttributeMap;
std::map<std::basic_string<T>, int> m_ChildMap; //for uniq
std::list<XMLElement<T>> m_Elements;
std::wstring m_Name;
std::wstring m_ElementText;
std::map<std::wstring, std::wstring> m_AttributeMap;
std::map<std::wstring, int> m_ChildMap; //for uniq
std::list<XMLElement> m_Elements;
typedef typename std::list<XMLElement<T>>::iterator ElementsIterator;
typedef typename std::list<XMLElement<T>>::const_iterator ElementsIteratorConst;
typedef std::list<XMLElement>::iterator ElementsIterator;
typedef std::list<XMLElement>::const_iterator ElementsIteratorConst;
typedef typename std::map<std::basic_string<T>, std::basic_string<T>>::iterator AttMapIterator;
typedef typename std::map<std::basic_string<T>, std::basic_string<T>>::const_iterator AttMapIteratorConst;
typedef std::map<std::wstring, std::wstring>::iterator AttMapIterator;
typedef std::map<std::wstring, std::wstring>::const_iterator AttMapIteratorConst;
public:
XMLElement()
XMLElement() {}
XMLElement( const std::wstring & name ) : m_Name(name)
{
}
/*========================================================================================================*/
XMLElement( const T* name ) : m_Name(name)
XMLElement( const std::wstring & prefix, const std::wstring & localName ) :
m_Name( std::wstring( prefix ) + std::wstring( L":" ) + std::wstring( localName ) ), m_ElementText( L"" )
{
}
~XMLElement() {}
/*========================================================================================================*/
XMLElement( const T* prefix, const T* localName ) : m_Name( std::basic_string<T>( prefix ) + std::basic_string<T>( L":" ) + std::basic_string<T>( localName ) ), m_ElementText( L"" )
void AppendText( const std::wstring & text )
{
m_ElementText = std::wstring( text );
}
/*========================================================================================================*/
~XMLElement()
void AppendTextSymbol( const wchar_t symbol )
{
m_ElementText += std::wstring( &symbol );
}
/*========================================================================================================*/
void AppendText( const T* text )
{
m_ElementText = std::basic_string<T>( text );
}
/*========================================================================================================*/
void AppendTextSymbol( const T symbol )
{
m_ElementText += std::basic_string<T>( &symbol );
}
/*========================================================================================================*/
void AppendAttribute( const XMLAttribute<T>& attribute )
void AppendAttribute( const XMLAttribute& attribute )
{
AttributeValuePair p( attribute.GetName(), attribute.GetValue() );
m_AttributeMap.insert( p );
}
/*========================================================================================================*/
void AppendAttribute( const T* name, const T* value )
void AppendAttribute( const std::wstring & name, const std::wstring & value )
{
AttributeValuePair p( std::basic_string<T>( const_cast<T*>( name ) ), std::basic_string<T>( const_cast<T*>( value ) ) );
AttributeValuePair p( name , value );
m_AttributeMap.insert( p );
}
/*========================================================================================================*/
void AppendChild( const XMLElement<T>& element, bool uniq = false)
void AppendChild( const XMLElement& element, bool uniq = false)
{
if (m_ChildMap.find(element.GetName()) != m_ChildMap.end())
{
@ -215,21 +176,17 @@ namespace XMLTools
}
else
{
m_ChildMap.insert(m_ChildMap.end(), std::pair<std::basic_string<T>, int>(element.GetName(), 0));
m_ChildMap.insert(m_ChildMap.end(), std::pair<std::wstring, int>(element.GetName(), 0));
}
m_Elements.push_back( element );
}
/*========================================================================================================*/
void RemoveChild( const XMLElement<T>& element )
void RemoveChild( const XMLElement& element )
{
m_Elements.remove( element );
}
/*========================================================================================================*/
bool FindChild( const XMLElement<T>& element )
bool FindChild( const XMLElement& element )
{
bool result = false;
@ -246,15 +203,13 @@ namespace XMLTools
return result;
}
/*========================================================================================================*/
bool FindChildByName( const T* elementName ) const
bool FindChildByName( const std::wstring & elementName ) const
{
bool result = false;
for ( ElementsIterator iter = m_Elements.begin(); iter != m_Elements.end(); iter++ )
for ( ElementsIteratorConst iter = m_Elements.begin(); iter != m_Elements.end(); iter++ )
{
if ( iter->m_Name == std::basic_string<T>( elementName ) )
if ( iter->m_Name == std::wstring( elementName ) )
{
result = true;
@ -265,9 +220,7 @@ namespace XMLTools
return result;
}
/*========================================================================================================*/
bool RemoveChildByName( const std::basic_string<T>& elementName )
bool RemoveChildByName( const std::wstring& elementName )
{
bool result = false;
@ -286,9 +239,7 @@ namespace XMLTools
return result;
}
/*========================================================================================================*/
bool operator == ( const XMLElement<T>& element ) const
bool operator == ( const XMLElement& element ) const
{
bool result = false;
@ -319,7 +270,7 @@ namespace XMLTools
}
else
{
ElementsIteratorConst thisIter = m_Elements.begin();
ElementsIteratorConst thisIter = m_Elements.begin();
ElementsIteratorConst elementIter = element.m_Elements.begin();
for ( ; thisIter != m_Elements.end(); thisIter++, elementIter++ )
@ -336,34 +287,34 @@ namespace XMLTools
/*========================================================================================================*/
std::basic_string<T> GetName() const
std::wstring GetName() const
{
return m_Name;
}
/*========================================================================================================*/
std::basic_string<T> GetXMLString()
std::wstring GetXMLString()
{
std::basic_string<T> xmlString( L"");
std::wstring xmlString( L"");
bool bIsNameExists = ( m_Name != std::basic_string<T>( L"") );
bool bIsTextExists = ( m_ElementText != std::basic_string<T>( L"") );
bool bIsNameExists = ( m_Name != std::wstring( L"") );
bool bIsTextExists = ( m_ElementText != std::wstring( L"") );
if ( bIsNameExists )
{
xmlString += std::basic_string<T>( L"<" ) + m_Name;
xmlString += std::wstring( L"<" ) + m_Name;
}
if ( ( bIsNameExists ) && ( m_AttributeMap.size() > 0 ) )
{
for ( AttMapIterator iter = m_AttributeMap.begin(); iter != m_AttributeMap.end(); iter++ )
{
xmlString += std::basic_string<T>( L" " );
xmlString += std::wstring( L" " );
xmlString += iter->first;
xmlString += std::basic_string<T>( L"=\"" );
xmlString += std::wstring( L"=\"" );
xmlString += iter->second;
xmlString += std::basic_string<T>( L"\"" );
xmlString += std::wstring( L"\"" );
}
}
@ -371,7 +322,7 @@ namespace XMLTools
{
if ( bIsNameExists )
{
xmlString += std::basic_string<T>( L">" );
xmlString += std::wstring( L">" );
}
for ( ElementsIterator iter = m_Elements.begin(); iter != m_Elements.end(); iter++ )
@ -386,16 +337,16 @@ namespace XMLTools
if ( bIsNameExists )
{
xmlString += std::basic_string<T>( L"</" );
xmlString += std::wstring( L"</" );
xmlString += m_Name;
xmlString += std::basic_string<T>( L">" );
xmlString += std::wstring( L">" );
}
}
else
{
if ( bIsNameExists )
{
xmlString += std::basic_string<T>( L"/>" );
xmlString += std::wstring( L"/>" );
}
}
@ -455,34 +406,12 @@ namespace XMLTools
void WriteInteger(int Value, int Base = 10)
{
#if defined(_WIN32) || defined (_WIN64)
wchar_t buff[33] ={};
_itow(Value, buff, Base);
m_str += std::wstring(buff);
#else
m_str += std::to_wstring(Value);
#endif
}
void WriteDouble(double Value)
{
#if defined(_WIN32) || defined (_WIN64)
int *dec = NULL, *sign = NULL;
char *str = _fcvt( Value , 4, dec, sign);
if (str)
{
std::string sA(str);
delete []str;
m_str += std::wstring(sA.begin(), sA.end());
}
else
{
m_str += L"0";
}
#else
m_str += std::to_wstring(Value);
#endif
}
void WriteBoolean(bool Value)
{

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -38,7 +38,7 @@ namespace DocFileFormat
: PropertiesMapping( writer ), _isRunStyleNeeded(isRunStyleNeeded), _isOwnRPr(true), _isRTL(false)
{
_doc = doc;
_rPr = new XMLTools::XMLElement<wchar_t>( _T( "w:rPr" ) );
_rPr = new XMLTools::XMLElement( L"w:rPr");
_revisionData = rev;
_currentPapx = currentPapx;
_styleChpx = styleChpx;
@ -46,7 +46,7 @@ namespace DocFileFormat
_webHidden = false;
}
CharacterPropertiesMapping::CharacterPropertiesMapping( XMLTools::XMLElement<wchar_t>* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded )
CharacterPropertiesMapping::CharacterPropertiesMapping( XMLTools::XMLElement* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded )
: PropertiesMapping( NULL ), _isRunStyleNeeded(isRunStyleNeeded), _isOwnRPr(false), _isRTL(false)
{
_doc = doc;
@ -77,7 +77,7 @@ namespace DocFileFormat
// apend revision changes
if (_revisionData->Type == Changed)
{
XMLTools::XMLElement<wchar_t> rPrChange( _T( "w:rPrChange" ) );
XMLTools::XMLElement rPrChange( L"w:rPrChange");
//todooo date - _revisionData->Dttm.Convert( new DateMapping( rPrChange ) );
@ -85,7 +85,7 @@ namespace DocFileFormat
if (author_str)
{
XMLTools::XMLAttribute<wchar_t> author( _T( "w:author" ), FormatUtils::XmlEncode(*author_str).c_str());
XMLTools::XMLAttribute author( L"w:author", FormatUtils::XmlEncode(*author_str));
rPrChange.AppendAttribute( author );
}
@ -98,7 +98,7 @@ namespace DocFileFormat
//write properties
if ( ( m_pXmlWriter != NULL ) && ( ( _rPr->GetChildCount() > 0 ) || ( _rPr->GetAttributeCount() > 0 ) ) )
{
m_pXmlWriter->WriteString( _rPr->GetXMLString().c_str() );
m_pXmlWriter->WriteString( _rPr->GetXMLString());
}
}
@ -108,7 +108,7 @@ namespace DocFileFormat
{
//Todo сделать определение симольного шрифта через fontManager
//Заглушка под Google Docs, они пишут bullet в Arial
if (-1 != m_sAsciiFont.find (_T("Arial")) && -1 != m_sEastAsiaFont.find (_T("Arial")) && -1 != m_shAnsiFont.find (_T("Arial")))
if (-1 != m_sAsciiFont.find (L"Arial") && -1 != m_sEastAsiaFont.find (L"Arial") && -1 != m_shAnsiFont.find (L"Arial"))
return false;
return true;
@ -116,16 +116,16 @@ namespace DocFileFormat
/*========================================================================================================*/
void CharacterPropertiesMapping::convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement<wchar_t>* parent )
void CharacterPropertiesMapping::convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent )
{
XMLTools::XMLElement<wchar_t> * rFonts = new XMLTools::XMLElement<wchar_t> ( _T( "w:rFonts" ) );
XMLTools::XMLElement<wchar_t> * color = new XMLTools::XMLElement<wchar_t> ( _T( "w:color" ) );
XMLTools::XMLAttribute<wchar_t> * colorVal = new XMLTools::XMLAttribute<wchar_t> ( _T( "w:val" ) );
XMLTools::XMLElement<wchar_t> * lang = new XMLTools::XMLElement<wchar_t> ( _T( "w:lang" ) );
XMLTools::XMLElement * rFonts = new XMLTools::XMLElement ( L"w:rFonts" );
XMLTools::XMLElement * color = new XMLTools::XMLElement ( L"w:color" );
XMLTools::XMLAttribute * colorVal = new XMLTools::XMLAttribute ( L"w:val" );
XMLTools::XMLElement * lang = new XMLTools::XMLElement ( L"w:lang" );
if (_webHidden)
{
XMLTools::XMLElement<wchar_t> * webHidden = new XMLTools::XMLElement<wchar_t> ( _T( "w:webHidden" ) );
XMLTools::XMLElement * webHidden = new XMLTools::XMLElement ( L"w:webHidden" );
parent->AppendChild( *webHidden );
RELEASEOBJECT( webHidden );
}
@ -144,95 +144,96 @@ namespace DocFileFormat
_currentIstd = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
if (_currentIstd < _doc->Styles->Styles->size())
{
appendValueElement( parent, _T( "rStyle" ), StyleSheetMapping::MakeStyleId( _doc->Styles->Styles->at( _currentIstd ) ).c_str(), true );
appendValueElement( parent, L"rStyle", StyleSheetMapping::MakeStyleId( _doc->Styles->Styles->at( _currentIstd ) ), true );
}
}
}break;
case sprmCFBiDi :
appendFlagElement( parent, *iter, _T( "rtl" ), true );
appendFlagElement( parent, *iter, L"rtl", true );
_isRTL = true;
break;
case sprmOldCFBold :
case sprmCFBold :
appendFlagElement( parent, *iter, _T( "b" ), true );
appendFlagElement( parent, *iter, L"b", true );
break;
case sprmCFBoldBi :
appendFlagElement( parent, *iter, _T( "bCs" ), true );
appendFlagElement( parent, *iter, L"bCs", true );
break;
case sprmOldCFCaps :
case sprmCFCaps :
appendFlagElement( parent, *iter, _T( "caps" ), true );
appendFlagElement( parent, *iter, L"caps", true );
break;
case sprmCFComplexScripts :
appendFlagElement( parent, *iter, _T( "cs" ), true );
appendFlagElement( parent, *iter, L"cs", true );
break;
case sprmCFDStrike :
appendFlagElement( parent, *iter, _T( "dstrike" ), true );
appendFlagElement( parent, *iter, L"dstrike", true );
break;
case sprmCFEmboss :
appendFlagElement( parent, *iter, _T( "emboss" ), true );
appendFlagElement( parent, *iter, L"emboss", true );
break;
case sprmCFImprint :
appendFlagElement( parent, *iter, _T( "imprint" ), true );
appendFlagElement( parent, *iter, L"imprint", true );
break;
case sprmOldCFItalic :
case sprmCFItalic :
appendFlagElement( parent, *iter, _T( "i" ), true );
appendFlagElement( parent, *iter, L"i", true );
break;
case sprmCFItalicBi:
appendFlagElement( parent, *iter, _T( "iCs" ), true );
appendFlagElement( parent, *iter, L"iCs", true );
break;
case 0x0875:
appendFlagElement( parent, *iter, _T( "noProof" ), true );
appendFlagElement( parent, *iter, L"noProof", true );
break;
case sprmOldCFOutline:
case sprmCFOutline:
appendFlagElement( parent, *iter, _T( "outline" ), true );
appendFlagElement( parent, *iter, L"outline", true );
break;
case sprmOldCFShadow:
case sprmCFShadow:
appendFlagElement( parent, *iter, _T( "shadow" ), true );
appendFlagElement( parent, *iter, L"shadow", true );
break;
case sprmOldCFSmallCaps:
case sprmCFSmallCaps:
appendFlagElement( parent, *iter, _T( "smallCaps" ), true );
appendFlagElement( parent, *iter, L"smallCaps", true );
break;
case sprmCFSpecVanish:
appendFlagElement( parent, *iter, _T( "specVanish" ), true );
appendFlagElement( parent, *iter, L"specVanish", true );
break;
case sprmOldCFStrike:
case sprmCFStrike:
appendFlagElement( parent, *iter, _T( "strike" ), true );
appendFlagElement( parent, *iter, L"strike", true );
break;
case sprmOldCFVanish:
case sprmCFVanish:
appendFlagElement( parent, *iter, _T( "vanish" ), true );
appendFlagElement( parent, *iter, L"vanish", true );
break;
case 0x0811:
appendFlagElement( parent, *iter, _T( "webHidden" ), true );
appendFlagElement( parent, *iter, L"webHidden", true );
break;
case sprmOldCIss:
case sprmCIss:
appendValueElement( parent, _T( "vertAlign" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ).c_str(), true );
if (iter->argumentsSize > 0 && iter->Arguments[0] < 3) //Metaevan.doc
appendValueElement( parent, L"vertAlign", FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ), true );
break;
case sprmCRgLid0_80:
@ -274,7 +275,7 @@ namespace DocFileFormat
case sprmCBrc80:
case sprmCBrc:
{ //borders
XMLTools::XMLElement<wchar_t> bdr( _T( "w:bdr" ) );
XMLTools::XMLElement bdr( L"w:bdr" );
BorderCode bc( iter->Arguments, iter->argumentsSize );
appendBorderAttributes( &bc, &bdr );
parent->AppendChild( bdr );
@ -292,7 +293,7 @@ namespace DocFileFormat
case sprmCIco:
case sprmCIcoBi:
{//color
colorVal->SetValue( FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ).c_str() );
colorVal->SetValue( FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ));
}break;
case sprmCCv:
@ -300,25 +301,22 @@ namespace DocFileFormat
std::wstringstream sstream;
sstream << boost::wformat(L"%02x%02x%02x") % iter->Arguments[0] % /*G*/iter->Arguments[1] % /*B*/iter->Arguments[2];
colorVal->SetValue(sstream.str().c_str());
//CString rgbColor;
//rgbColor.Format( _T( "%02x%02x%02x" ), /*R*/iter->Arguments[0], /*G*/iter->Arguments[1], /*B*/iter->Arguments[2] );
//colorVal->SetValue( rgbColor.GetString() );
colorVal->SetValue(sstream.str());
}break;
case sprmCOldHighlight:
{
appendValueElement( parent, _T( "highlight" ), FormatUtils::MapValueToWideString( iter->Arguments[1], &Global::ColorIdentifier[0][0], 17, 12 ).c_str(), true );
appendValueElement( parent, L"highlight", FormatUtils::MapValueToWideString( iter->Arguments[1], &Global::ColorIdentifier[0][0], 17, 12 ), true );
}break;
case sprmCHighlight:
{
appendValueElement( parent, _T( "highlight" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ).c_str(), true );
appendValueElement( parent, L"highlight", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ), true );
}break;
case sprmOldCDxaSpace:
case sprmCDxaSpace:
{
appendValueElement( parent, _T( "spacing" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
appendValueElement( parent, L"spacing", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
}break;
case sprmCFtcBi :
@ -334,21 +332,21 @@ namespace DocFileFormat
case sprmCHpsBi :
{
appendValueElement( parent, _T( "szCs" ),
FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
appendValueElement( parent, L"szCs",
FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
}
break;
// Font Size in points (2~3276) default 20-half-points
case sprmOldCHps :
{
appendValueElement (parent, _T( "sz" ),
FormatUtils::IntToWideString (FormatUtils::BytesToUChar (iter->Arguments, 0, iter->argumentsSize) ).c_str(),
appendValueElement (parent, L"sz",
FormatUtils::IntToWideString (FormatUtils::BytesToUChar (iter->Arguments, 0, iter->argumentsSize) ),
true );
}break;
case sprmCHps :
{
appendValueElement (parent, _T( "sz" ),
FormatUtils::IntToWideString (FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize) ).c_str(), true );
appendValueElement (parent, L"sz",
FormatUtils::IntToWideString (FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize) ), true );
}break;
case sprmCMajority :
@ -358,18 +356,18 @@ namespace DocFileFormat
case sprmOldCHpsPos:
{ // The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
short nVertPos = FormatUtils::BytesToUChar(iter->Arguments, 0, iter->argumentsSize);
appendValueElement (parent, _T("position"), nVertPos, true);
appendValueElement (parent, L"position", nVertPos, true);
}break;
case sprmCHpsPos:
{ // The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
short nVertPos = FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize);
appendValueElement (parent, _T("position"), nVertPos, true);
appendValueElement (parent, L"position", nVertPos, true);
}break;
case sprmOldCHpsKern:
case sprmCHpsKern:
{
appendValueElement( parent, _T( "kern" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
appendValueElement( parent, L"kern", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
}break;
case sprmOldCFtc:
@ -379,10 +377,10 @@ namespace DocFileFormat
if( nIndex < _doc->FontTable->Data.size() )
{
XMLTools::XMLAttribute<wchar_t>* ascii = new XMLTools::XMLAttribute<wchar_t>( _T( "w:ascii" ) );
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( L"w:ascii" );
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
m_sAsciiFont = ffn->xszFtn;
ascii->SetValue( FormatUtils::XmlEncode(m_sAsciiFont).c_str() );
ascii->SetValue( FormatUtils::XmlEncode(m_sAsciiFont, true));
rFonts->AppendAttribute( *ascii );
RELEASEOBJECT( ascii );
}
@ -393,10 +391,10 @@ namespace DocFileFormat
int nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
if( nIndex >= 0 && nIndex < _doc->FontTable->Data.size() )
{
XMLTools::XMLAttribute<wchar_t>* eastAsia = new XMLTools::XMLAttribute<wchar_t>( _T( "w:eastAsia" ) );
XMLTools::XMLAttribute* eastAsia = new XMLTools::XMLAttribute( L"w:eastAsia" );
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
m_sEastAsiaFont = ffn->xszFtn;
eastAsia->SetValue( FormatUtils::XmlEncode(m_sEastAsiaFont).c_str() );
eastAsia->SetValue( FormatUtils::XmlEncode(m_sEastAsiaFont));
rFonts->AppendAttribute( *eastAsia );
RELEASEOBJECT( eastAsia );
}
@ -408,10 +406,10 @@ namespace DocFileFormat
int nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
if( nIndex>=0 && nIndex < _doc->FontTable->Data.size() )
{
XMLTools::XMLAttribute<wchar_t>* ansi = new XMLTools::XMLAttribute<wchar_t>( _T( "w:hAnsi" ) );
XMLTools::XMLAttribute* ansi = new XMLTools::XMLAttribute( L"w:hAnsi" );
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
m_shAnsiFont = ffn->xszFtn;
ansi->SetValue( FormatUtils::XmlEncode(m_shAnsiFont).c_str() );
ansi->SetValue( FormatUtils::XmlEncode(m_shAnsiFont));
rFonts->AppendAttribute( *ansi );
RELEASEOBJECT( ansi );
}
@ -420,18 +418,18 @@ namespace DocFileFormat
case sprmOldCKul:
case sprmCKul:
{ //Underlining
appendValueElement( parent, _T( "u" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::UnderlineCode[0][0], 56, 16 ).c_str(), true );
appendValueElement( parent, L"u", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::UnderlineCode[0][0], 56, 16 ), true );
}
break;
case sprmCCharScale:
{ //char width
appendValueElement( parent, _T( "w" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
appendValueElement( parent, L"w", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
}break;
case sprmCSfxText:
{ //animation
appendValueElement( parent, _T( "effect" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::TextAnimation[0][0], 7, 16 ).c_str(), true );
appendValueElement( parent, L"effect", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::TextAnimation[0][0], 7, 16 ), true );
}break;
case sprmCIdctHint:
@ -485,8 +483,8 @@ namespace DocFileFormat
if (!m_sDefaultFont.empty() && m_sAsciiFont.empty() && m_sEastAsiaFont.empty() && m_shAnsiFont.empty())
{//????
XMLTools::XMLAttribute<wchar_t>* ascii = new XMLTools::XMLAttribute<wchar_t>( _T( "w:ascii" ) );
ascii->SetValue( FormatUtils::XmlEncode(m_sDefaultFont).c_str() );
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( L"w:ascii" );
ascii->SetValue( FormatUtils::XmlEncode(m_sDefaultFont));
//rFonts->AppendAttribute( *ascii );
RELEASEOBJECT( ascii );
}
@ -504,7 +502,7 @@ namespace DocFileFormat
}
//append color
if ( colorVal->GetValue() != _T( "" ) )
if ( colorVal->GetValue() != L"")
{
color->AppendAttribute( *colorVal );
parent->AppendChild( *color );
@ -520,14 +518,14 @@ namespace DocFileFormat
/// CHPX flags are special flags because the can be 0,1,128 and 129,
/// so this method overrides the appendFlagElement method.
void CharacterPropertiesMapping::appendFlagElement( XMLTools::XMLElement<wchar_t>* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique )
void CharacterPropertiesMapping::appendFlagElement( XMLTools::XMLElement* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique )
{
unsigned char flag = sprm.Arguments[0];
if( flag != 128 )
{
XMLTools::XMLElement<wchar_t>* ele = new XMLTools::XMLElement<wchar_t>( _T( "w" ), elementName );
XMLTools::XMLAttribute<wchar_t>* val = new XMLTools::XMLAttribute<wchar_t>( _T( "w:val" ) );
XMLTools::XMLElement* ele = new XMLTools::XMLElement( L"w", elementName );
XMLTools::XMLAttribute* val = new XMLTools::XMLAttribute( L"w:val" );
if ( unique )
{
@ -536,7 +534,7 @@ namespace DocFileFormat
if ( flag == 0 )
{
val->SetValue( _T( "false" ) );
val->SetValue( L"false" );
ele->AppendAttribute( *val );
node->AppendChild( *ele );
}
@ -579,7 +577,7 @@ namespace DocFileFormat
//invert it
if ( stylesVal )
{
val->SetValue( _T( "false" ) );
val->SetValue( L"false" );
ele->AppendAttribute( *val );
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -55,7 +55,7 @@ namespace DocFileFormat
{
public:
CharacterPropertiesMapping( XMLTools::CStringXmlWriter* writer, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded = true );
CharacterPropertiesMapping( XMLTools::XMLElement<wchar_t>* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded = true );
CharacterPropertiesMapping( XMLTools::XMLElement* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded = true );
virtual ~CharacterPropertiesMapping();
void Apply( IVisitable* chpx );
bool CheckIsSymbolFont();
@ -63,7 +63,7 @@ namespace DocFileFormat
bool _webHidden;
bool _isRTL;
private:
void convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement<wchar_t>* parent );
void convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent );
std::list<CharacterPropertyExceptions*> buildHierarchy( const StyleSheet* styleSheet, unsigned short istdStart );
bool applyToggleHierachy( const SinglePropertyModifier& sprm );
bool toogleValue( bool currentValue, unsigned char toggle );
@ -71,13 +71,13 @@ namespace DocFileFormat
protected:
/// CHPX flags are special flags because the can be 0,1,128 and 129,
/// so this method overrides the appendFlagElement method.
virtual void appendFlagElement( XMLTools::XMLElement<wchar_t>* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique );
virtual void appendFlagElement( XMLTools::XMLElement* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique );
private:
XMLTools::CStringXmlWriter pRunPr;
WordDocument* _doc;
XMLTools::XMLElement<wchar_t>* _rPr;
XMLTools::XMLElement* _rPr;
unsigned short _currentIstd;
RevisionData* _revisionData;
bool _styleChpx;

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -54,16 +54,16 @@ namespace DocFileFormat
int index = 0;
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:comments" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
m_pXmlWriter->WriteNodeBegin( L"w:comments", TRUE );
//write namespaces
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
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->WriteNodeEnd( L"", TRUE, FALSE );
int cp = m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr;
@ -72,11 +72,11 @@ namespace DocFileFormat
{
AnnotationReferenceDescriptor* atrdPre10 = static_cast<AnnotationReferenceDescriptor*>(m_document->AnnotationsReferencePlex->Elements[index]);
m_pXmlWriter->WriteNodeBegin( _T( "w:comment" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( index ).c_str() );
m_pXmlWriter->WriteAttribute( _T( "w:author" ),
FormatUtils::XmlEncode(m_document->AnnotationOwners->at( atrdPre10->GetAuthorIndex() ) ).c_str());
m_pXmlWriter->WriteAttribute( _T( "w:initials" ), atrdPre10->GetUserInitials().c_str() );
m_pXmlWriter->WriteNodeBegin( L"w:comment", TRUE );
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( index ));
m_pXmlWriter->WriteAttribute( L"w:author",
FormatUtils::XmlEncode(m_document->AnnotationOwners->at( atrdPre10->GetAuthorIndex() ) ));
m_pXmlWriter->WriteAttribute( L"w:initials", atrdPre10->GetUserInitials());
//!!!TODO!!!
/*//ATRDpost10 is optional and not saved in all files
@ -87,7 +87,7 @@ namespace DocFileFormat
atrdPost10.Date.Convert(new DateMapping(_writer));
}*/
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
while ( ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpHdr ) < (*m_document->IndividualCommentsPlex)[index + 1] )
{
@ -111,12 +111,12 @@ namespace DocFileFormat
}
}
m_pXmlWriter->WriteNodeEnd(_T( "w:comment" ));
m_pXmlWriter->WriteNodeEnd(L"w:comment" );
++index;
}
m_pXmlWriter->WriteNodeEnd( _T( "w:comments" ) );
m_pXmlWriter->WriteNodeEnd( L"w:comments" );
m_context->_docx->CommentsXML = std::wstring(m_pXmlWriter->GetXmlString());
}
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -33,138 +33,136 @@
#if defined(_WIN32) || defined(_WIN64)
#include <tchar.h>
#else
#include "../../DesktopEditor/common/ASCVariant.h"
#include "../../Common/DocxFormat/Source/Base/ASCString.h"
#endif
#include <string>
#include "../../DesktopEditor/common/ASCVariant.h"
namespace OpenXmlContentTypes
{
// default content types
static const TCHAR* Xml = _T("application/xml");
static const wchar_t* Xml = L"application/xml";
// package content types
static const TCHAR* Relationships = _T("application/vnd.openxmlformats-package.relationships+xml");
static const wchar_t* Relationships = L"application/vnd.openxmlformats-package.relationships+xml";
static const TCHAR* CoreProperties = _T("application/vnd.openxmlformats-package.core-properties+xml");
static const wchar_t* CoreProperties = L"application/vnd.openxmlformats-package.core-properties+xml";
// general office document content types
static const TCHAR* ExtendedProperties = _T("application/vnd.openxmlformats-officedocument.extended-properties+xml");
static const TCHAR* Theme = _T("application/vnd.openxmlformats-officedocument.theme+xml");
static const wchar_t* ExtendedProperties = L"application/vnd.openxmlformats-officedocument.extended-properties+xml";
static const wchar_t* Theme = L"application/vnd.openxmlformats-officedocument.theme+xml";
static const TCHAR* CustomXmlProperties = _T("application/vnd.openxmlformats-officedocument.customXmlProperties+xml");
static const wchar_t* CustomXmlProperties = L"application/vnd.openxmlformats-officedocument.customXmlProperties+xml";
static const TCHAR* OleObject = _T("application/vnd.openxmlformats-officedocument.oleObject");
static const TCHAR* Vml = _T("application/vnd.openxmlformats-officedocument.vmlDrawing");
static const TCHAR* Drawing = _T("application/vnd.openxmlformats-officedocument.drawing+xml");
static const wchar_t* OleObject = L"application/vnd.openxmlformats-officedocument.oleObject";
static const wchar_t* Vml = L"application/vnd.openxmlformats-officedocument.vmlDrawing";
static const wchar_t* Drawing = L"application/vnd.openxmlformats-officedocument.drawing+xml";
static const TCHAR* MSWordDocx = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
static const wchar_t* MSWordDocx = L"application/vnd.openxmlformats-officedocument.wordprocessingml.document";
static const TCHAR* MSExcel = _T("application/vnd.ms-excel");
static const TCHAR* MSWord = _T("application/msword");
static const TCHAR* MSPowerpoint = _T("application/vnd.ms-powerpoint");
static const wchar_t* MSExcel = L"application/vnd.ms-excel";
static const wchar_t* MSWord = L"application/msword";
static const wchar_t* MSPowerpoint = L"application/vnd.ms-powerpoint";
static const TCHAR* Emf = _T("image/x-emf");
static const TCHAR* Jpeg = _T("image/jpeg");
static const TCHAR* Png = _T("image/png");
static const TCHAR* Tiff = _T("image/tiff");
static const TCHAR* Wmf = _T("image/x-wmf");
static const TCHAR* Bmp = _T("image/bmp");
static const wchar_t* Emf = L"image/x-emf";
static const wchar_t* Jpeg = L"image/jpeg";
static const wchar_t* Png = L"image/png";
static const wchar_t* Tiff = L"image/tiff";
static const wchar_t* Wmf = L"image/x-wmf";
static const wchar_t* Bmp = L"image/bmp";
}
namespace WordprocessingMLContentTypes
{
// WordprocessingML content types
static const TCHAR* MainDocument = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml");
static const TCHAR* MainDocumentMacro = _T("application/vnd.ms-word.document.macroEnabled.main+xml");
static const TCHAR* MainDocumentTemplate = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml");
static const TCHAR* MainDocumentMacroTemplate = _T("application/vnd.ms-word.template.macroEnabledTemplate.main+xml");
static const wchar_t* MainDocument = L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml";
static const wchar_t* MainDocumentMacro = L"application/vnd.ms-word.document.macroEnabled.main+xml";
static const wchar_t* MainDocumentTemplate = L"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml";
static const wchar_t* MainDocumentMacroTemplate = L"application/vnd.ms-word.template.macroEnabledTemplate.main+xml";
static const TCHAR* Styles = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml");
static const TCHAR* Numbering = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml");
static const TCHAR* FontTable = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml");
static const TCHAR* WebSettings = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml");
static const TCHAR* Settings = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml");
static const wchar_t* Styles = L"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";
static const wchar_t* Numbering = L"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml";
static const wchar_t* FontTable = L"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml";
static const wchar_t* WebSettings = L"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml";
static const wchar_t* Settings = L"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";
static const TCHAR* Comments = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml");
static const wchar_t* Comments = L"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml";
static const TCHAR* Footnotes = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml");
static const TCHAR* Endnotes = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+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";
static const TCHAR* Header = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml");
static const TCHAR* Footer = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml");
static const wchar_t* Header = L"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml";
static const wchar_t* Footer = L"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml";
static const TCHAR* Glossary = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml");
static const wchar_t* Glossary = L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml";
}
namespace MicrosoftWordContentTypes
{
static const TCHAR* KeyMapCustomization = _T("application/vnd.ms-word.keyMapCustomizations+xml");
static const TCHAR* VbaProject = _T("application/vnd.ms-office.vbaProject");
static const TCHAR* VbaData = _T("application/vnd.ms-word.vbaData+xml");
static const TCHAR* Toolbars = _T("application/vnd.ms-word.attachedToolbars");
static const wchar_t* KeyMapCustomization = L"application/vnd.ms-word.keyMapCustomizations+xml";
static const wchar_t* VbaProject = L"application/vnd.ms-office.vbaProject";
static const wchar_t* VbaData = L"application/vnd.ms-word.vbaData+xml";
static const wchar_t* Toolbars = L"application/vnd.ms-word.attachedToolbars";
}
namespace OpenXmlNamespaces
{
// package namespaces
static const TCHAR* ContentTypes = _T("http://schemas.openxmlformats.org/package/2006/content-types");
static const TCHAR* RelationshipsPackage = _T("http://schemas.openxmlformats.org/package/2006/relationships");
static const TCHAR* Relationships = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships");
static const wchar_t* ContentTypes = L"http://schemas.openxmlformats.org/package/2006/content-types";
static const wchar_t* RelationshipsPackage = L"http://schemas.openxmlformats.org/package/2006/relationships";
static const wchar_t* Relationships = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships";
// Drawing ML namespaces
static const TCHAR* DrawingML = _T("http://schemas.openxmlformats.org/drawingml/2006/main");
static const TCHAR* DrawingMLPicture = _T("http://schemas.openxmlformats.org/drawingml/2006/picture");
static const wchar_t* DrawingML = L"http://schemas.openxmlformats.org/drawingml/2006/main";
static const wchar_t* DrawingMLPicture = L"http://schemas.openxmlformats.org/drawingml/2006/picture";
// WordprocessingML namespaces
static const TCHAR* WordprocessingML = _T("http://schemas.openxmlformats.org/wordprocessingml/2006/main");
static const TCHAR* WordprocessingDrawingML = _T("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
static const TCHAR* VectorML = _T("urn:schemas-microsoft-com:vml");
static const TCHAR* MicrosoftWordML = _T("http://schemas.microsoft.com/office/word/2006/wordml");
static const wchar_t* WordprocessingML = L"http://schemas.openxmlformats.org/wordprocessingml/2006/main";
static const wchar_t* WordprocessingDrawingML = L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing";
static const wchar_t* VectorML = L"urn:schemas-microsoft-com:vml";
static const wchar_t* MicrosoftWordML = L"http://schemas.microsoft.com/office/word/2006/wordml";
// PresentationML namespaces
static const TCHAR* PresentationML = _T("http://schemas.openxmlformats.org/presentationml/2006/main");
static const wchar_t* PresentationML = L"http://schemas.openxmlformats.org/presentationml/2006/main";
// SpreadsheetML Namespaces
static const TCHAR* SharedStringML = _T("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
static const TCHAR* WorkBookML = _T("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
static const TCHAR* StylesML = _T("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
static const wchar_t* SharedStringML = L"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
static const wchar_t* WorkBookML = L"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
static const wchar_t* StylesML = L"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
//Office
static const TCHAR* Office = _T("urn:schemas-microsoft-com:office:office");
static const TCHAR* OfficeWord = _T("urn:schemas-microsoft-com:office:word");
static const wchar_t* Office = L"urn:schemas-microsoft-com:office:office";
static const wchar_t* OfficeWord = L"urn:schemas-microsoft-com:office:word";
}
namespace OpenXmlRelationshipTypes
{
static const TCHAR* CoreProperties = _T("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties");
static const TCHAR* ExtendedProperties = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties");
static const wchar_t* CoreProperties = L"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";
static const wchar_t* ExtendedProperties = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";
static const TCHAR* Theme = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme");
static const TCHAR* OfficeDocument = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument");
static const TCHAR* Styles = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles");
static const TCHAR* FontTable = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable");
static const TCHAR* Numbering = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering");
static const TCHAR* WebSettings = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings");
static const TCHAR* Settings = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings");
static const TCHAR* CustomXml = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml");
static const TCHAR* CustomXmlProperties = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps");
static const TCHAR* Comments = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments");
static const TCHAR* Footnotes = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes");
static const TCHAR* Endnotes = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes");
static const TCHAR* Header = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/header");
static const TCHAR* Footer = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer");
static const TCHAR* Image = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image");
static const TCHAR* OleObject = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject");
static const TCHAR* GlossaryDocument = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument");
static const TCHAR* Package = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
static const wchar_t* Theme = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
static const wchar_t* OfficeDocument = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
static const wchar_t* Styles = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";
static const wchar_t* FontTable = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";
static const wchar_t* Numbering = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering";
static const wchar_t* WebSettings = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings";
static const wchar_t* Settings = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings";
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* 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";
static const wchar_t* Footer = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";
static const wchar_t* Image = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
static const wchar_t* OleObject = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
static const wchar_t* GlossaryDocument = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument";
static const wchar_t* Package = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
}
namespace MicrosoftWordRelationshipTypes
{
static const TCHAR* KeyMapCustomizations = _T("http://schemas.microsoft.com/office/2006/relationships/keyMapCustomizations");
static const TCHAR* VbaProject = _T("http://schemas.microsoft.com/office/2006/relationships/vbaProject");
static const TCHAR* VbaData = _T("http://schemas.microsoft.com/office/2006/relationships/wordVbaData");
static const TCHAR* Toolbars = _T("http://schemas.microsoft.com/office/2006/relationships/attachedToolbars");
static const wchar_t* KeyMapCustomizations = L"http://schemas.microsoft.com/office/2006/relationships/keyMapCustomizations";
static const wchar_t* VbaProject = L"http://schemas.microsoft.com/office/2006/relationships/vbaProject";
static const wchar_t* VbaData = L"http://schemas.microsoft.com/office/2006/relationships/wordVbaData";
static const wchar_t* Toolbars = L"http://schemas.microsoft.com/office/2006/relationships/attachedToolbars";
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -41,7 +41,7 @@
namespace DocFileFormat
{
DocumentMapping::DocumentMapping(ConversionContext* context, IMapping* caller):_skipRuns(0), _lastValidPapx(NULL), _lastValidSepx(NULL), _writeInstrText(false),
DocumentMapping::DocumentMapping(ConversionContext* context, IMapping* caller) : _skipRuns(0), _lastValidPapx(NULL), _lastValidSepx(NULL),
_fldCharCounter(0), AbstractOpenXmlMapping( new XMLTools::CStringXmlWriter() ), _sectionNr(0), _footnoteNr(0),
_endnoteNr(0), _commentNr(0), _caller(caller)
{
@ -53,6 +53,10 @@ namespace DocFileFormat
_writeInstrText = false;
_isSectionPageBreak = 0;
_isTextBoxContent = false;
//--------------------------------------------
_embeddedObject = false;
_writeInstrText = false;
}
DocumentMapping::DocumentMapping(ConversionContext* context, XMLTools::CStringXmlWriter* writer, IMapping* caller):_skipRuns(0), _lastValidPapx(NULL), _lastValidSepx(NULL), _writeInstrText(false),
@ -67,6 +71,9 @@ namespace DocFileFormat
_writeInstrText = false;
_isSectionPageBreak = 0;
_isTextBoxContent = false;
_embeddedObject = false;
_cacheListNum = -1;
}
DocumentMapping::~DocumentMapping()
@ -76,12 +83,8 @@ namespace DocFileFormat
RELEASEOBJECT(m_pXmlWriter);
}
}
}
namespace DocFileFormat
{
// Looks into the section table to find out if this CP is the end & current of a sections
int DocumentMapping::getCurrentSection(int cp)
{
//if cp is the last char of a section, the next section will start at cp +1
@ -100,6 +103,22 @@ namespace DocFileFormat
return m_document->SectionPlex->CharacterPositions[current + 1];
}
int DocumentMapping::getListNumCache(int fc, int fc_end)
{
if ( !m_document->ListPlex ) return -1;
for (int i = 1; i < m_document->ListPlex->CharacterPositions.size(); i++)
{
if ((fc >= m_document->ListPlex->CharacterPositions[i-1]) && (fc_end <= m_document->ListPlex->CharacterPositions[i]))
{
ListNumCache* listNum = dynamic_cast<ListNumCache*> (m_document->ListPlex->Elements[i-1]);
return listNum->value;
}
}
return -1;
}
bool DocumentMapping::isSectionEnd(int cp)
{
bool result = false;
@ -175,8 +194,8 @@ namespace DocFileFormat
// get all CHPX between these boundaries to determine the count of runs
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fc, fcEnd);
std::vector<int>* chpxFcs = m_document->GetFileCharacterPositions(fc, fcEnd);
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fc, fcEnd);
std::vector<int>* chpxFcs = m_document->GetFileCharacterPositions(fc, fcEnd);
CharacterPropertyExceptions* paraEndChpx = NULL;
@ -193,7 +212,7 @@ namespace DocFileFormat
// start paragraph
m_pXmlWriter->WriteNodeBegin(_T("w:p"), TRUE);
m_pXmlWriter->WriteNodeBegin(L"w:p", true);
writeParagraphRsid(papx);
// ----------- check for section properties
@ -203,8 +222,8 @@ namespace DocFileFormat
{
isBidi = currentSection->isBidi;
}
//-----------------------------------------------------------
//_cacheListNum = getListNumCache(fc, fcEnd);
_isSectionPageBreak = 0;
if (sectionEnd)
{
@ -301,12 +320,12 @@ namespace DocFileFormat
}
//end paragraph
m_pXmlWriter->WriteNodeEnd(_T("w:p"));
m_pXmlWriter->WriteNodeEnd(L"w:p");
}
else
{
//end paragraph
m_pXmlWriter->WriteNodeEnd(_T("w:p"));
m_pXmlWriter->WriteNodeEnd(L"w:p");
}
RELEASEOBJECT(chpxFcs);
@ -325,16 +344,16 @@ namespace DocFileFormat
if (DocFileFormat::sprmPRsid == iter->OpCode)
{
std::wstring id = FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize), _T("%08x"));
std::wstring id = FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize), L"%08x");
m_context->AddRsid(id);
m_pXmlWriter->WriteAttribute(_T("w:rsidP"), id.c_str());
m_pXmlWriter->WriteAttribute(L"w:rsidP", id);
break;
}
}
}
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE, FALSE);
m_pXmlWriter->WriteNodeEnd(L"", true, false);
}
// Writes a run with the given characters and CHPX
@ -351,47 +370,47 @@ namespace DocFileFormat
if (Deleted == rev.Type)
{
//If it's a deleted run
m_pXmlWriter->WriteNodeBegin(_T("w:del"), TRUE);
m_pXmlWriter->WriteAttribute(_T("w:author"), _T("[b2x: could not retrieve author]"));
m_pXmlWriter->WriteAttribute(_T("w:date"), _T("[b2x: could not retrieve date]"));
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE, FALSE);
m_pXmlWriter->WriteNodeBegin(L"w:del", true);
m_pXmlWriter->WriteAttribute(L"w:author", L"[b2x: could not retrieve author]");
m_pXmlWriter->WriteAttribute(L"w:date", L"[b2x: could not retrieve date]");
m_pXmlWriter->WriteNodeEnd(L"", true, false);
}
else if ( rev.Type == Inserted )
{
WideString* author = dynamic_cast<WideString*>(m_document->RevisionAuthorTable->operator[](rev.Isbt));
//if it's a inserted run
m_pXmlWriter->WriteNodeBegin(_T("w:ins"), TRUE);
m_pXmlWriter->WriteAttribute(_T("w:author"), FormatUtils::XmlEncode(*author).c_str());
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE, FALSE);
m_pXmlWriter->WriteNodeBegin(L"w:ins", true);
m_pXmlWriter->WriteAttribute(L"w:author", FormatUtils::XmlEncode(*author));
m_pXmlWriter->WriteNodeEnd(L"", true, false);
//rev.Dttm.Convert(new DateMapping(m_pXmlWriter));
}
//start run
m_pXmlWriter->WriteNodeBegin(_T("w:r"), TRUE);
m_pXmlWriter->WriteNodeBegin(L"w:r", true);
//append rsids
if (0 != rev.Rsid)
{
std::wstring rsid = FormatUtils::IntToFormattedWideString(rev.Rsid, _T("%08x"));
m_pXmlWriter->WriteAttribute(_T("w:rsidR"), rsid.c_str());
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, _T("%08x"));
m_pXmlWriter->WriteAttribute(_T("w:rsidDel"), rsidDel.c_str());
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, _T("%08x"));
m_pXmlWriter->WriteAttribute(_T("w:rsidRPr"), rsidProp.c_str());
std::wstring rsidProp = FormatUtils::IntToFormattedWideString(rev.RsidProp, L"%08x");
m_pXmlWriter->WriteAttribute(L"w:rsidRPr", rsidProp);
m_context->AddRsid(rsidProp);
}
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE, FALSE);
m_pXmlWriter->WriteNodeEnd(L"", true, false);
/// <w:rPr>
CharacterPropertiesMapping* rPr = new CharacterPropertiesMapping(m_pXmlWriter, m_document, &rev, _lastValidPapx, false);
@ -415,20 +434,20 @@ namespace DocFileFormat
}
//end run
m_pXmlWriter->WriteNodeEnd(_T("w:r"));
m_pXmlWriter->WriteNodeEnd(L"w:r");
if (Deleted == rev.Type)
{
m_pXmlWriter->WriteNodeEnd(_T("w:del"));
m_pXmlWriter->WriteNodeEnd(L"w:del");
}
else if (Inserted == rev.Type)
{
m_pXmlWriter->WriteNodeEnd(_T("w:ins"));
m_pXmlWriter->WriteNodeEnd(L"w:ins");
}
if (!_writeAfterRun.empty())
{
m_pXmlWriter->WriteString(_writeAfterRun.c_str());
m_pXmlWriter->WriteString(_writeAfterRun);
_writeAfterRun.clear();
}
}
@ -449,16 +468,16 @@ namespace DocFileFormat
//detect text type
std::wstring textType = _T( "t" );
std::wstring textType = L"t";
std::wstring text;
if (writeDeletedText)
{
textType = std::wstring(_T("delText"));
textType = std::wstring(L"delText");
}
else if (_writeInstrText)
{
textType = std::wstring(_T("instrText"));
textType = std::wstring(L"instrText");
}
//write text
@ -472,9 +491,9 @@ namespace DocFileFormat
text.clear();
XMLTools::XMLElement<wchar_t> elem(_T("w:tab"));
XMLTools::XMLElement elem(L"w:tab");
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
m_pXmlWriter->WriteString(elem.GetXMLString());
}
else if (TextMark::HardLineBreak == code)
{
@ -482,11 +501,11 @@ namespace DocFileFormat
text.clear();
XMLTools::XMLElement<wchar_t> elem(_T("w:br"));
elem.AppendAttribute(_T("w:type"), _T("textWrapping"));
elem.AppendAttribute(_T("w:clear"), _T("all"));
XMLTools::XMLElement elem(L"w:br");
elem.AppendAttribute(L"w:type", L"textWrapping");
elem.AppendAttribute(L"w:clear", L"all");
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
m_pXmlWriter->WriteString(elem.GetXMLString());
}
else if (TextMark::ParagraphEnd == code)
{
@ -501,10 +520,10 @@ namespace DocFileFormat
text.clear();
XMLTools::XMLElement<wchar_t> elem(_T("w:br"));
elem.AppendAttribute(_T("w:type"), _T("page"));
XMLTools::XMLElement elem(L"w:br");
elem.AppendAttribute(L"w:type", L"page");
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
m_pXmlWriter->WriteString(elem.GetXMLString());
}
}
else if (TextMark::ColumnBreak == code)
@ -513,10 +532,10 @@ namespace DocFileFormat
text.clear();
XMLTools::XMLElement<wchar_t> elem(_T("w:br"));
elem.AppendAttribute(_T("w:type"), _T("column"));
XMLTools::XMLElement elem(L"w:br");
elem.AppendAttribute(L"w:type", L"column");
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
m_pXmlWriter->WriteString(elem.GetXMLString());
}
else if (TextMark::FieldBeginMark == code)
{
@ -527,21 +546,21 @@ namespace DocFileFormat
if (cpFieldEnd < m_document->Text->size())
f = std::wstring( ( m_document->Text->begin() + cpFieldStart ), ( m_document->Text->begin() + cpFieldEnd + 1 ) );
std::wstring EMBED ( _T( " EMBED" ) );
std::wstring LINK ( _T( " LINK" ) );
std::wstring FORM ( _T( " FORM" ) );
std::wstring Excel ( _T( " Excel" ) );
std::wstring Word ( _T( " Word" ) );
std::wstring opendocument(_T( " opendocument" ) );
std::wstring Equation ( _T( " Equation" ) ) ;
std::wstring MERGEFORMAT( _T( " MERGEFORMAT" ) );
std::wstring QUOTE ( _T( " QUOTE" ) );
std::wstring chart ( _T( "Chart" ) );
std::wstring PBrush ( _T( " PBrush" ) );
std::wstring TOC ( _T( " TOC" ) );
std::wstring HYPERLINK ( _T( " HYPERLINK" ) );
std::wstring PAGEREF ( _T( " PAGEREF" ) );
std::wstring PAGE ( _T( "PAGE" ) );
std::wstring EMBED ( L" EMBED" );
std::wstring LINK ( L" LINK" );
std::wstring FORM ( L" FORM" );
std::wstring Excel ( L" Excel" );
std::wstring Word ( L" Word" );
std::wstring opendocument(L" opendocument" );
std::wstring Equation ( L" Equation" );
std::wstring MERGEFORMAT( L" MERGEFORMAT" );
std::wstring QUOTE ( L" QUOTE" );
std::wstring chart ( L"Chart" );
std::wstring PBrush ( L" PBrush" );
std::wstring TOC ( L" TOC" );
std::wstring HYPERLINK ( L" HYPERLINK" );
std::wstring PAGEREF ( L" PAGEREF" );
std::wstring PAGE ( L"PAGE" );
bool bChart = search( f.begin(), f.end(), chart.begin(), chart.end()) != f.end();
bool bEMBED = search( f.begin(), f.end(), EMBED.begin(), EMBED.end()) != f.end();
@ -559,9 +578,9 @@ namespace DocFileFormat
if ( bFORM )
{
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:fldChar" , true );
m_pXmlWriter->WriteAttribute( L"w:fldCharType" , L"begin" );
m_pXmlWriter->WriteNodeEnd( L"", true, false );
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
@ -574,7 +593,7 @@ namespace DocFileFormat
ffdata.Convert(new FormFieldDataMapping(m_pXmlWriter));
}*/
m_pXmlWriter->WriteNodeEnd( _T( "w:fldChar" ) );
m_pXmlWriter->WriteNodeEnd( L"w:fldChar" );
_writeInstrText = true;
@ -584,13 +603,13 @@ namespace DocFileFormat
&&
( ( bEMBED || bLINK ) && bChart) )
{
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:fldChar", true );
m_pXmlWriter->WriteAttribute( L"w:fldCharType", L"begin" );
m_pXmlWriter->WriteNodeEnd( L"", true, false );
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
m_pXmlWriter->WriteNodeEnd( _T( "w:fldChar" ) );
m_pXmlWriter->WriteNodeEnd( L"w:fldChar" );
_writeInstrText = true;
@ -603,9 +622,9 @@ namespace DocFileFormat
if ((search( f.begin(), f.end(), TOC.begin(), TOC.end()) != f.end()) || bPAGE)
{
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:fldChar", true );
m_pXmlWriter->WriteAttribute( L"w:fldCharType", L"begin" );
m_pXmlWriter->WriteNodeEnd( L"", true );
_writeInstrText = true;
_fldCharCounter++;
@ -624,18 +643,18 @@ namespace DocFileFormat
_writeWebHidden = true;
std::wstring _writeTocLink =f1.substr(d + 9);
d = _writeTocLink.find(_T(" "));
d = _writeTocLink.find(L" ");
_writeTocLink = _writeTocLink.substr(0, d);
_writeAfterRun = std::wstring (_T("<w:hyperlink w:anchor = \""));
_writeAfterRun = std::wstring (L"<w:hyperlink w:anchor = \"");
_writeAfterRun += _writeTocLink;
_writeAfterRun += std::wstring (_T("\" w:history=\"1\">"));
_writeAfterRun += std::wstring (L"\" w:history=\"1\">");
//if (_writeInstrText == true)
//{
// m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), TRUE );
// m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "separate" ) );
// m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
// m_pXmlWriter->WriteNodeBegin( L"w:fldChar" ), true );
// m_pXmlWriter->WriteAttribute( L"w:fldCharType" ), L"separate" );
// m_pXmlWriter->WriteNodeEnd( L"" ), true );
//}
_writeInstrText = false;
@ -643,13 +662,13 @@ namespace DocFileFormat
}
cpFieldSep1 = cpFieldSep2;
}
_skipRuns = 5;
_skipRuns = 5; //with separator
}
}
else if ( bEMBED || bLINK || bQUOTE)
{
int cpPic = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::Picture);
int cpFieldSep = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::FieldSeparator);
int cpPic = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::Picture);
int cpFieldSep = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::FieldSeparator);
if (cpPic < cpFieldEnd)
{
@ -666,31 +685,38 @@ namespace DocFileFormat
chpxObj->Convert(rPr);
RELEASEOBJECT(rPr);
}
XMLTools::CStringXmlWriter OleWriter;
VMLPictureMapping oVmlMapper (m_context, &OleWriter, true, _caller);
XMLTools::CStringXmlWriter oleWriter;
XMLTools::CStringXmlWriter oleObjectWriter;
VMLPictureMapping oVmlMapper (m_context, &oleWriter, true, _caller);
if (!m_shapeIdOwner.empty()) //4571833.doc
oVmlMapper.m_shapeId = m_shapeIdOwner;
if (m_document->bOlderVersion)
{
OleObject ole ( chpxObj, m_document->GetStorage(), m_document->bOlderVersion);
OleWriter.WriteNodeBegin (_T( "w:object" ), TRUE);
OleWriter.WriteAttribute( _T( "w:dxaOrig" ), FormatUtils::IntToWideString( ( ole.pictureDesciptor.dxaGoal + ole.pictureDesciptor.dxaOrigin ) ).c_str() );
OleWriter.WriteAttribute( _T( "w:dyaOrig" ), FormatUtils::IntToWideString( ( ole.pictureDesciptor.dyaGoal + ole.pictureDesciptor.dyaOrigin ) ).c_str() );
OleWriter.WriteNodeEnd( _T( "" ), TRUE, FALSE );
oleWriter.WriteNodeBegin (L"w:object", true);
oleWriter.WriteAttribute( L"w:dxaOrig", FormatUtils::IntToWideString( ( ole.pictureDesciptor.dxaGoal + ole.pictureDesciptor.dxaOrigin ) ));
oleWriter.WriteAttribute( L"w:dyaOrig", FormatUtils::IntToWideString( ( ole.pictureDesciptor.dyaGoal + ole.pictureDesciptor.dyaOrigin ) ));
oleWriter.WriteNodeEnd( L"", true, false );
ole.pictureDesciptor.Convert(&oVmlMapper);
OleObjectMapping oleObjectMapping( &OleWriter, m_context, &ole.pictureDesciptor, _caller, oVmlMapper.GetShapeId() );
OleObjectMapping oleObjectMapping( &oleObjectWriter, m_context, &ole.pictureDesciptor, _caller, oVmlMapper.m_shapeId);
ole.Convert( &oleObjectMapping );
_lastOLEObject = oleObjectWriter.GetXmlString();
}
else
{
PictureDescriptor pic(chpxObj, m_document->DataStream, 0x7fffffff, m_document->bOlderVersion);
OleWriter.WriteNodeBegin (_T( "w:object" ), TRUE);
OleWriter.WriteAttribute( _T( "w:dxaOrig" ), FormatUtils::IntToWideString( ( pic.dxaGoal + pic.dxaOrigin ) ).c_str() );
OleWriter.WriteAttribute( _T( "w:dyaOrig" ), FormatUtils::IntToWideString( ( pic.dyaGoal + pic.dyaOrigin ) ).c_str() );
OleWriter.WriteNodeEnd( _T( "" ), TRUE, FALSE );
oleWriter.WriteNodeBegin (L"w:object", true);
oleWriter.WriteAttribute( L"w:dxaOrig", FormatUtils::IntToWideString( ( pic.dxaGoal + pic.dxaOrigin ) ) );
oleWriter.WriteAttribute( L"w:dyaOrig", FormatUtils::IntToWideString( ( pic.dyaGoal + pic.dyaOrigin ) ) );
oleWriter.WriteNodeEnd( L"", true, false );
pic.Convert(&oVmlMapper);
RELEASEOBJECT(chpxs);
@ -704,7 +730,7 @@ namespace DocFileFormat
CharacterPropertyExceptions* chpxSep = chpxs->front();
OleObject ole ( chpxSep, m_document->GetStorage(), m_document->bOlderVersion);
OleObjectMapping oleObjectMapping( &OleWriter, m_context, &pic, _caller, oVmlMapper.GetShapeId() );
OleObjectMapping oleObjectMapping( &oleObjectWriter, m_context, &pic, _caller, oVmlMapper.m_shapeId );
if (oVmlMapper.m_isEmbedded)
{
@ -713,38 +739,35 @@ namespace DocFileFormat
ole.emeddedData = oVmlMapper.m_embeddedData;
}
ole.Convert( &oleObjectMapping );
_lastOLEObject = oleObjectWriter.GetXmlString();
RELEASEOBJECT( chpxs );
}
}
OleWriter.WriteNodeEnd( _T( "w:object" ) );
oleWriter.WriteString( _lastOLEObject );
oleWriter.WriteNodeEnd( L"w:object" );
if (!oVmlMapper.m_isEmbedded && oVmlMapper.m_isEquation)
{
//нельзя в Run писать oMath
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml.c_str());
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml);
_writeAfterRun = oVmlMapper.m_equationXml;
}
else
{
m_pXmlWriter->WriteString(OleWriter.GetXmlString());
m_pXmlWriter->WriteString(oleWriter.GetXmlString());
}
}
if (bEMBED)
{
//Приложения_011015.doc(9 стр) ellipt_eq.doc конфликтные
cp = cpFieldEnd;
_skipRuns = 3;
}
else
_skipRuns = 5;
_skipRuns = 3;
_embeddedObject = true;
}
else
{
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:fldChar", true );
m_pXmlWriter->WriteAttribute( L"w:fldCharType", L"begin" );
m_pXmlWriter->WriteNodeEnd( L"", true );
_writeInstrText = true;
_fldCharCounter++;
@ -754,26 +777,27 @@ namespace DocFileFormat
{
if (_fldCharCounter > 0)
{
XMLTools::XMLElement<wchar_t> elem( _T( "w:fldChar" ) );
elem.AppendAttribute( _T( "w:fldCharType" ), _T( "separate" ) );
XMLTools::XMLElement elem( L"w:fldChar" );
elem.AppendAttribute( L"w:fldCharType", L"separate" );
m_pXmlWriter->WriteString( elem.GetXMLString().c_str() );
m_pXmlWriter->WriteString( elem.GetXMLString() );
}
if (_embeddedObject) _skipRuns += 2;
}
else if (TextMark::FieldEndMark == code)
{
if (_fldCharCounter > 0)
{
XMLTools::XMLElement<wchar_t> elem( _T( "w:fldChar" ) );
elem.AppendAttribute( _T( "w:fldCharType" ), _T( "end" ) );
XMLTools::XMLElement elem( L"w:fldChar" );
elem.AppendAttribute( L"w:fldCharType", L"end" );
m_pXmlWriter->WriteString( elem.GetXMLString().c_str() );
m_pXmlWriter->WriteString( elem.GetXMLString());
_fldCharCounter--;
}
if (_writeWebHidden)
{
_writeAfterRun = std::wstring (_T("</w:hyperlink>"));
_writeAfterRun = std::wstring (L"</w:hyperlink>");
}
_writeWebHidden = false;
@ -781,15 +805,16 @@ namespace DocFileFormat
{
_writeInstrText = false;
}
_embeddedObject = false;
}
else if ((TextMark::Symbol == code) && fSpec)
{
Symbol s = getSymbol( chpx );
m_pXmlWriter->WriteNodeBegin(_T("w:sym"), TRUE);
m_pXmlWriter->WriteAttribute(_T("w:font"), FormatUtils::XmlEncode(s.FontName).c_str());
m_pXmlWriter->WriteAttribute(_T("w:char"), FormatUtils::XmlEncode(s.HexValue).c_str());
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE);
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)
{
@ -806,22 +831,25 @@ namespace DocFileFormat
if (pSpa)
{
PictureDescriptor pictDiscr(chpx, m_document->WordDocumentStream, 0x7fffffff, m_document->bOlderVersion);
ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeContainer(pSpa->GetShapeID());
if (pShape)
{
m_pXmlWriter->WriteNodeBegin (_T("w:pict"));
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, NULL, _caller);
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, &pictDiscr, _caller);
m_pXmlWriter->WriteNodeBegin (L"w:pict");
pShape->Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (_T("w:pict"));
m_pXmlWriter->WriteNodeEnd (L"w:pict");
}
if (!pSpa->primitives.empty())
{
m_pXmlWriter->WriteNodeBegin (_T("w:pict"));
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, NULL, _caller);
m_pXmlWriter->WriteNodeBegin (L"w:pict");
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, &pictDiscr, _caller);
pSpa->primitives.Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (_T("w:pict"));
m_pXmlWriter->WriteNodeEnd (L"w:pict");
}
}
}
@ -833,19 +861,19 @@ namespace DocFileFormat
if (oPicture.embeddedData && oPicture.embeddedDataSize > 0)
{
m_pXmlWriter->WriteNodeBegin (_T("w:pict"));
m_pXmlWriter->WriteNodeBegin (L"w:pict");
VMLPictureMapping oVmlMapper(m_context, m_pXmlWriter, false, _caller, isInline);
oPicture.Convert (&oVmlMapper);
m_pXmlWriter->WriteNodeEnd (_T("w:pict"));
m_pXmlWriter->WriteNodeEnd (L"w:pict");
}
else if ((oPicture.mfp.mm > 98) && (NULL != oPicture.shapeContainer))
{
bool bFormula = false;
XMLTools::CStringXmlWriter pictWriter;
pictWriter.WriteNodeBegin (_T("w:pict"));
pictWriter.WriteNodeBegin (L"w:pict");
bool picture = true;
@ -864,7 +892,7 @@ namespace DocFileFormat
if (oVmlMapper.m_isEmbedded)
{
OleObject ole ( chpx, m_document->GetStorage(), m_document->bOlderVersion);
OleObjectMapping oleObjectMapping( &pictWriter, m_context, &oPicture, _caller, oVmlMapper.GetShapeId() );
OleObjectMapping oleObjectMapping( &pictWriter, m_context, &oPicture, _caller, oVmlMapper.m_shapeId );
ole.isEquation = oVmlMapper.m_isEquation;
ole.isEmbedded = oVmlMapper.m_isEmbedded;
@ -875,7 +903,7 @@ namespace DocFileFormat
else if (oVmlMapper.m_isEquation)
{
//нельзя в Run писать oMath
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml.c_str());
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml);
_writeAfterRun = oVmlMapper.m_equationXml;
bFormula = true;
}
@ -885,7 +913,7 @@ namespace DocFileFormat
oPicture.shapeContainer->Convert(&oVmlMapper);
}
pictWriter.WriteNodeEnd (_T("w:pict"));
pictWriter.WriteNodeEnd (L"w:pict");
if (!bFormula)
m_pXmlWriter->WriteString(pictWriter.GetXmlString());
@ -896,40 +924,40 @@ namespace DocFileFormat
{
if ((m_document->FootnoteReferenceCharactersPlex != NULL) && (m_document->FootnoteReferenceCharactersPlex->IsCpExists(cp)))
{
m_pXmlWriter->WriteNodeBegin( _T( "w:footnoteReference" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString(_footnoteNr++ ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:footnoteReference", true );
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( _T( "w:footnoteRef" ), TRUE );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
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( _T( "w:endnoteReference" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString(_endnoteNr++ ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:endnoteReference", true );
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( _T( "w:endnoteRef" ), TRUE );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:endnoteRef", true );
m_pXmlWriter->WriteNodeEnd( L"", true );
}
}
else if (TextMark::AnnotationReference == code)
{
if (typeid(*this) != typeid(CommentsMapping))
{
m_pXmlWriter->WriteNodeBegin( _T( "w:commentReference" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( _commentNr ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:commentReference", true );
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( _commentNr ));
m_pXmlWriter->WriteNodeEnd( L"", true );
}
else
{
m_pXmlWriter->WriteNodeBegin( _T( "w:annotationRef" ), TRUE );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:annotationRef", true );
m_pXmlWriter->WriteNodeEnd( L"", true );
}
_commentNr++;
@ -944,11 +972,11 @@ namespace DocFileFormat
if (!text.empty())
{
//bool preserve_space = (text.find(_T("\x20")) != text.npos) ? true : false;
//bool preserve_space = (text.find(L"\x20")) != text.npos) ? true : false;
writeTextStart(textType, true/*preserve_space*/);
m_pXmlWriter->WriteString(text.c_str());
m_pXmlWriter->WriteString(text);
writeTextEnd(textType);
}
@ -959,13 +987,13 @@ namespace DocFileFormat
{
if ( !text.empty() )
{
bool preserve_space = true;//(text.find(_T("\x20")) != text.npos) ? true : false;
if (textType == _T("instrText"))
bool preserve_space = true;//(text.find(L"\x20")) != text.npos) ? true : false;
if (textType == L"instrText")
preserve_space = false;
writeTextStart( textType, preserve_space );
m_pXmlWriter->WriteString( text.c_str() );
m_pXmlWriter->WriteString( text);
writeTextEnd( textType );
}
@ -973,21 +1001,21 @@ namespace DocFileFormat
void DocumentMapping::writeTextStart(const std::wstring& textType, bool preserve_space)
{
std::wstring str = ( std::wstring( _T( "w:" ) ) + textType );
std::wstring str = ( L"w:" + textType );
m_pXmlWriter->WriteNodeBegin( str.c_str(), TRUE );
m_pXmlWriter->WriteNodeBegin( str, true );
if (preserve_space)
{
m_pXmlWriter->WriteAttribute( _T( "xml:space" ), _T( "preserve" ) );
m_pXmlWriter->WriteAttribute( L"xml:space", L"preserve" );
}
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"", true, false );
}
void DocumentMapping::writeTextEnd(const std::wstring& textType)
{
std::wstring str = ( std::wstring( _T( "w:" ) ) + textType );
std::wstring str = ( std::wstring( L"w:" ) + textType );
m_pXmlWriter->WriteNodeEnd( str.c_str() );
m_pXmlWriter->WriteNodeEnd( str );
}
// Searches for bookmarks in the list of characters.
@ -1113,7 +1141,7 @@ namespace DocFileFormat
TablePropertyExceptions row1Tapx( findValidPapx( fcRowEnd ), m_document->DataStream, m_document->bOlderVersion);
//start table
m_pXmlWriter->WriteNodeBegin( _T( "w:tbl" ) );
m_pXmlWriter->WriteNodeBegin( L"w:tbl" );
//Convert it
TablePropertiesMapping *tpMapping = new TablePropertiesMapping( m_pXmlWriter, m_document->Styles, grid );
@ -1151,7 +1179,7 @@ namespace DocFileFormat
}
//close w:tbl
m_pXmlWriter->WriteNodeEnd( _T( "w:tbl" ) );
m_pXmlWriter->WriteNodeEnd( L"w:tbl" );
RELEASEOBJECT( grid );
@ -1356,7 +1384,7 @@ namespace DocFileFormat
TableInfo tai( papx );
//start w:tr
m_pXmlWriter->WriteNodeBegin( _T( "w:tr" ) );
m_pXmlWriter->WriteNodeBegin( L"w:tr" );
//convert the properties
int fcRowEnd = findRowEndFc( cp, nestingLevel );
@ -1406,7 +1434,7 @@ namespace DocFileFormat
}
//end w:tr
m_pXmlWriter->WriteNodeEnd( _T( "w:tr" ) );
m_pXmlWriter->WriteNodeEnd( L"w:tr" );
//skip the row end mark
cp++;
@ -1422,7 +1450,7 @@ namespace DocFileFormat
int cp = initialCp;
//start w:tc
m_pXmlWriter->WriteNodeBegin( _T( "w:tc" ) );
m_pXmlWriter->WriteNodeBegin( L"w:tc" );
//find cell end
int cpCellEnd = findCellEndCp( initialCp, nestingLevel );
@ -1459,8 +1487,8 @@ namespace DocFileFormat
//after a inner table must be at least one paragraph
/*if ( cp >= cpCellEnd )
{
m_pXmlWriter->WriteNodeBegin( _T( "w:p" ) );
m_pXmlWriter->WriteNodeEnd( _T( "w:p" ) );
m_pXmlWriter->WriteNodeBegin( L"w:p" );
m_pXmlWriter->WriteNodeEnd( L"w:p" );
}*/
}
else
@ -1471,7 +1499,7 @@ namespace DocFileFormat
}
//end w:tc
m_pXmlWriter->WriteNodeEnd( _T( "w:tc" ) );
m_pXmlWriter->WriteNodeEnd( L"w:tc" );
return cp;
}
@ -1540,14 +1568,14 @@ namespace DocFileFormat
WideString* bookmarkName = static_cast<WideString*>(m_document->BookmarkNames->operator [](id));
if ((bookmarkName != NULL) && (*bookmarkName != _T("_PictureBullets")))
if ((bookmarkName != NULL) && (*bookmarkName != L"_PictureBullets"))
{
XMLTools::XMLElement<wchar_t> bookmarkElem(_T("w:bookmarkStart"));
XMLTools::XMLElement bookmarkElem(L"w:bookmarkStart");
bookmarkElem.AppendAttribute(_T("w:id"), FormatUtils::IntToWideString(id).c_str());
bookmarkElem.AppendAttribute(_T("w:name"), bookmarkName->c_str());
bookmarkElem.AppendAttribute(L"w:id", FormatUtils::IntToWideString(id));
bookmarkElem.AppendAttribute(L"w:name", *bookmarkName);
m_pXmlWriter->WriteString(bookmarkElem.GetXMLString().c_str());
m_pXmlWriter->WriteString(bookmarkElem.GetXMLString());
return true;
}
@ -1561,13 +1589,13 @@ namespace DocFileFormat
WideString* bookmarkName = static_cast<WideString*>( m_document->BookmarkNames->operator [] ( id ) );
if ( ( bookmarkName != NULL ) && ( *bookmarkName != _T( "_PictureBullets" ) ) )
if ( ( bookmarkName != NULL ) && ( *bookmarkName != L"_PictureBullets" ) )
{
XMLTools::XMLElement<wchar_t> bookmarkElem( _T( "w:bookmarkEnd" ) );
XMLTools::XMLElement bookmarkElem( L"w:bookmarkEnd" );
bookmarkElem.AppendAttribute( _T( "w:id" ), FormatUtils::IntToWideString( id ).c_str() );
bookmarkElem.AppendAttribute( L"w:id", FormatUtils::IntToWideString( id ));
m_pXmlWriter->WriteString( bookmarkElem.GetXMLString().c_str() );
m_pXmlWriter->WriteString( bookmarkElem.GetXMLString());
return true;
}
@ -1622,7 +1650,7 @@ namespace DocFileFormat
FontFamilyName* ffn = static_cast<FontFamilyName*>( m_document->FontTable->operator [] ( fontIndex ) );
ret.FontName = ffn->xszFtn;
ret.HexValue = FormatUtils::IntToFormattedWideString( code, _T( "%04x" ) );
ret.HexValue = FormatUtils::IntToFormattedWideString( code, L"%04x" );
break;
}
@ -1635,7 +1663,7 @@ namespace DocFileFormat
FontFamilyName* ffn = static_cast<FontFamilyName*>( m_document->FontTable->operator [] ( fontIndex ) );
ret.FontName = ffn->xszFtn;
ret.HexValue = L"f0" + FormatUtils::IntToFormattedWideString( code, _T( "%02x" ) );
ret.HexValue = L"f0" + FormatUtils::IntToFormattedWideString( code, L"%02x" );
break;
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -70,73 +70,76 @@ namespace DocFileFormat
public:
DocumentMapping(ConversionContext* context, IMapping* caller);
DocumentMapping(ConversionContext* context, XMLTools::CStringXmlWriter* writer, IMapping* caller);
virtual ~DocumentMapping();
virtual void Apply( IVisitable* visited ) = 0;
//--------------------------------- 4571833.doc
std::wstring m_shapeIdOwner;
std::wstring getOLEObject() { return _lastOLEObject; }
protected:
/// Looks into the section table to find out if this CP is the current of a section
int getCurrentSection(int cp);
/// Looks into the section table to find out if this CP is the end of a section
bool isSectionEnd( int cp );
/// Writes a Paragraph that starts at the given cp and
/// ends at the next paragraph end mark or section end mark
int getListNumCache (int fc, int fc_end);
int getCurrentSection (int cp);
//---------------------------------
bool isSectionEnd ( int cp );
// Writes a Paragraph that starts at the given cp and
// ends at the next paragraph end mark or section end mark
int writeParagraph( int cp );
/// Writes a Paragraph that starts at the given cpStart and
/// ends at the given cpEnd
// Writes a Paragraph that starts at the given cpStart and
// ends at the given cpEnd
int writeParagraph( int initialCp, int cpEnd, bool sectionEnd, bool lastBad = false );
/// Writes a Paragraph RSID
// Writes a Paragraph RSID
void writeParagraphRsid( const ParagraphPropertyExceptions* papx );
/// Writes a run with the given characters and CHPX
// Writes a run with the given characters and CHPX
int writeRun( std::vector<wchar_t>* chars, CharacterPropertyExceptions* chpx, int initialCp );
/// Writes the given text to the document
// Writes the given text to the document
int writeText ( std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText );
void writeTextElement ( const std::wstring& text, const std::wstring& textType );
void writeTextStart ( const std::wstring& textType, bool preserve_space);
void writeTextEnd ( const std::wstring& textType );
int writeText( std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText );
void writeTextElement( const std::wstring& text, const std::wstring& textType );
void writeTextStart( const std::wstring& textType, bool preserve_space);
void writeTextEnd( const std::wstring& textType );
/// Searches for bookmarks in the list of characters.
// Searches for bookmarks in the list of characters.
std::vector<int> searchBookmarks( std::vector<wchar_t>* chars, int initialCp );
ParagraphPropertyExceptions* findValidPapx( int fc );
/// Splits a list of characters into several lists
// Splits a list of characters into several lists
std::list<std::vector<wchar_t> >* splitCharList( std::vector<wchar_t>* chars, std::vector<int>* splitIndices );
/// Writes the table starts at the given cp value
int writeTable( int initialCp, unsigned int nestingLevel );
/// Builds a list that contains the width of the several columns of the table.
// Writes the table starts at the given cp value
int writeTable ( int initialCp, unsigned int nestingLevel );
// Builds a list that contains the width of the several columns of the table.
std::vector<short>* buildTableGrid( int initialCp, unsigned int nestingLevel );
/// Finds the FC of the next row end mark.
int findRowEndFc( int initialCp, int& rowEndCp, unsigned int nestingLevel );
/// Finds the FC of the next row end mark.
int findRowEndFc( int initialCp, unsigned int nestingLevel );
/// Writes the table row that starts at the given cp value and ends at the next row end mark
int writeTableRow( int initialCp, std::vector<short>* grid, unsigned int nestingLevel );
/// Writes the table cell that starts at the given cp value and ends at the next cell end mark
int writeTableCell( int initialCp, TablePropertyExceptions* tapx, std::vector<short>* grid, int& gridIndex, int cellIndex, unsigned int nestingLevel );
int findCellEndCp( int initialCp, unsigned int nestingLevel );
bool writeBookmarks( int cp );
bool writeBookmarkStart( short id );
bool writeBookmarkEnd( short id );
/// Checks if the CHPX is special
// Finds the FC of the next row end mark.
int findRowEndFc ( int initialCp, int& rowEndCp, unsigned int nestingLevel );
// Finds the FC of the next row end mark.
int findRowEndFc ( int initialCp, unsigned int nestingLevel );
// Writes the table row that starts at the given cp value and ends at the next row end mark
int writeTableRow ( int initialCp, std::vector<short>* grid, unsigned int nestingLevel );
// Writes the table cell that starts at the given cp value and ends at the next cell end mark
int writeTableCell ( int initialCp, TablePropertyExceptions* tapx, std::vector<short>* grid, int& gridIndex, int cellIndex, unsigned int nestingLevel );
int findCellEndCp ( int initialCp, unsigned int nestingLevel );
bool writeBookmarks ( int cp );
bool writeBookmarkStart ( short id );
bool writeBookmarkEnd ( short id );
// Checks if the CHPX is special
bool isSpecial( CharacterPropertyExceptions* chpx );
/// Finds the SEPX that is valid for the given CP.
// Finds the SEPX that is valid for the given CP.
SectionPropertyExceptions* findValidSepx( int cp );
/// Searches the given vector for the next FieldEnd character.
// Searches the given vector for the next FieldEnd character.
int searchNextTextMark( std::vector<wchar_t>* chars, int initialCp, wchar_t mark );
private:
Symbol getSymbol( const CharacterPropertyExceptions* chpx );
Symbol getSymbol ( const CharacterPropertyExceptions* chpx );
//----------------------------------------------------------------------------------------------------------------------
bool m_bInternalXmlWriter;
protected:
WordDocument* m_document;
ConversionContext* m_context;
IMapping* _caller;
ParagraphPropertyExceptions* _lastValidPapx;
SectionPropertyExceptions* _lastValidSepx;
bool _embeddedObject;
int _skipRuns;
int _sectionNr;
int _footnoteNr;
@ -148,5 +151,7 @@ namespace DocFileFormat
bool _writeWebHidden;
unsigned int _fldCharCounter;
std::wstring _writeAfterRun;
std::wstring _lastOLEObject;
int _cacheListNum;
};
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -43,7 +43,8 @@ namespace DocFileFormat
/*========================================================================================================*/
WordDocumentProperties::WordDocumentProperties(FileInformationBlock* fib, POLE::Stream* tableStream) : doptypography(NULL), dogrid(NULL), asumyi(NULL)
WordDocumentProperties::WordDocumentProperties(FileInformationBlock* fib, POLE::Stream* tableStream) :
doptypography(NULL), dogrid(NULL), asumyi(NULL), bDisplayBackgroundShape(false)
{
Initialize();
@ -226,7 +227,7 @@ namespace DocFileFormat
dywDispPag = FormatUtils::BytesToInt16( bytes, 498, size );
//WORD 2000, 2002, 2003 PART
if ( size > 500 )
if ( size > 500/* && fib->m_FibNew.nFibNew > Fib1997*/)
{
ilvlLastBulletMain = bytes[500];
ilvlLastNumberMain = bytes[501];
@ -266,138 +267,158 @@ namespace DocFileFormat
fDntULTrlSpc = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 14 );
fDntBlnSbDbWid = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 15 );
fSuppressTopSpacingMac5 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 16 );
fTruncDxaExpand = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 17 );
fPrintBodyBeforeHdr = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 18 );
fNoLeading = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 19 );
fMakeSpaceForUL = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 20 );
fMWSmallCaps = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 21 );
f2ptExtLeadingOnly = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 22 );
fTruncFontHeight = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 23 );
fSubOnSize = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 24 );
fLineWrapLikeWord6 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 25 );
fWW6BorderRules = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 26 );
fExactOnTop = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 27 );
fExtraAfter = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 28 );
fWPSpace = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 29 );
fWPJust = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 30 );
fPrintMet = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 31 );
fTruncDxaExpand = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 17 );
fPrintBodyBeforeHdr = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 18 );
fNoLeading = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 19 );
fMakeSpaceForUL = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 20 );
fMWSmallCaps = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 21 );
f2ptExtLeadingOnly = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 22 );
fTruncFontHeight = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 23 );
fSubOnSize = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 24 );
fLineWrapLikeWord6 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 25 );
fWW6BorderRules = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 26 );
fExactOnTop = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 27 );
fExtraAfter = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 28 );
fWPSpace = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 29 );
fWPJust = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 30 );
fPrintMet = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 31 );
//split bytes 512,513,514,515 into bits
fSpLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 0 );
fFtnLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 1 );
fDontUseHTMLParagraphAutoSpacing = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 2 );
fDontAdjustLineHeightInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 3 );
fForgetLastTabAlign = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 4 );
fUseAutoSpaceForFullWidthAlpha = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 5 );
fAlignTablesRowByRow = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 6 );
fLayoutRawTableWidth = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 7 );
fLayoutTableRowsApart = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 8 );
fUserWord97LineBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 9 );
fDontBreakWrappedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 10 );
fDontSnapToGridInCell = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 11 );
fDontAllowFieldEndSelect = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 12 );
fApplyBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 13 );
fDontWrapTextWithPunct = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 14 );
fDontUseAsianBreakRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 15 );
fUseWord2002TableStyleRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 16 );
fGrowAutofit = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 17 );
fUseNormalStyleForList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 18 );
fDontUseIndentAsNumberingTabStop = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 19 );
fFELineBreak11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 20 );
fAllowSpaceOfSameStyleInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 21 );
fWW11IndentRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 22 );
fDontAutofitConstrainedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 23 );
fAutofitLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 24 );
fUnderlineTabInNumList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 25 );
fHangulWidthLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 26 );
fSplitPgBreakAndParaMark = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 27 );
fDontVertAlignCellWithSp = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 28 );
fDontBreakConstrainedForcedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 29 );
fDontVertAlignInTxbx = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 30 );
fWord11KerningPairs = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 31 );
fCachedColBalance = FormatUtils::GetBitFromBytes( ( bytes + 516 ), 4, 0 );
//split bytes 512,513,514,515 into bits
fSpLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 0 );
fFtnLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 1 );
fDontUseHTMLParagraphAutoSpacing = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 2 );
fDontAdjustLineHeightInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 3 );
fForgetLastTabAlign = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 4 );
fUseAutoSpaceForFullWidthAlpha = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 5 );
fAlignTablesRowByRow = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 6 );
fLayoutRawTableWidth = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 7 );
fLayoutTableRowsApart = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 8 );
fUserWord97LineBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 9 );
fDontBreakWrappedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 10 );
fDontSnapToGridInCell = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 11 );
fDontAllowFieldEndSelect = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 12 );
fApplyBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 13 );
fDontWrapTextWithPunct = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 14 );
fDontUseAsianBreakRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 15 );
fUseWord2002TableStyleRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 16 );
fGrowAutofit = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 17 );
fUseNormalStyleForList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 18 );
fDontUseIndentAsNumberingTabStop = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 19 );
fFELineBreak11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 20 );
fAllowSpaceOfSameStyleInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 21 );
fWW11IndentRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 22 );
fDontAutofitConstrainedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 23 );
fAutofitLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 24 );
fUnderlineTabInNumList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 25 );
fHangulWidthLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 26 );
fSplitPgBreakAndParaMark = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 27 );
fDontVertAlignCellWithSp = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 28 );
fDontBreakConstrainedForcedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 29 );
fDontVertAlignInTxbx = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 30 );
fWord11KerningPairs = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 31 );
fCachedColBalance = FormatUtils::GetBitFromBytes( ( bytes + 516 ), 4, 0 );
//bytes 517-539 are unused
//bytes 517-539 are unused
verCompatPreW10 = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 540 ), 4, 0, 16 );
fNoMargPgvwSaved = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 16 );
fNoMargPgvWPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 17 );
fWebViewPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 18 );
fSeeDrawingsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 19 );
fBulletProofed = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 20 );
fCorrupted = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 21 );
fSaveUim = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 22 );
fFilterPrivacy = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 23 );
fInFReplaceNoRM = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 24 );
fSeenRepairs = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 25 );
fHasXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 26 );
fSeeScriptAnchorsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 27 );
fValidateXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 28 );
fSaveIfInvalidXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 29 );
fShowXMLErrors = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 30 );
fAlwaysMergeEmptyNamespace = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 31 );
verCompatPreW10 = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 540 ), 4, 0, 16 );
fNoMargPgvwSaved = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 16 );
fNoMargPgvWPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 17 );
fWebViewPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 18 );
fSeeDrawingsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 19 );
fBulletProofed = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 20 );
fCorrupted = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 21 );
fSaveUim = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 22 );
fFilterPrivacy = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 23 );
fInFReplaceNoRM = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 24 );
fSeenRepairs = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 25 );
fHasXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 26 );
fSeeScriptAnchorsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 27 );
fValidateXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 28 );
fSaveIfInvalidXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 29 );
fShowXMLErrors = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 30 );
fAlwaysMergeEmptyNamespace = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 31 );
if ( size > 544/* && fib->m_FibNew.nFibNew > Fib2000*/)
{
cpMaxListCacheMainDoc = FormatUtils::BytesToInt32( bytes, 544, size ); //unused
cpMaxListCacheMainDoc = FormatUtils::BytesToInt32( bytes, 544, size );
//split bytes 548,549 into bits
fDoNotEmbedSystemFont = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 0 );
fWordCompact = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 1 );
fLiveRecover = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 2 );
fEmbedFactoids = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 3 );
fFactoidXML = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 4 );
fFactoidAllDone = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 5 );
fFolioPrint = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 6 );
fReverseFolio = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 7 );
iTextLineEnding = (short)FormatUtils::GetUIntFromBytesBits( ( bytes + 548 ), 2, 8, 3 );
fHideFcc = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 11 );
fAcetateShowMarkup = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 12 );
fAcetateShowAtn = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 13 );
fAcetateShowInsDel = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 14 );
fAcetateShowProps = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 15 );
//split bytes 548,549 into bits
fDoNotEmbedSystemFont = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 0 );
fWordCompact = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 1 );
fLiveRecover = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 2 );
fEmbedFactoids = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 3 );
fFactoidXML = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 4 );
fFactoidAllDone = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 5 );
fFolioPrint = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 6 );
fReverseFolio = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 7 );
iTextLineEnding = (short)FormatUtils::GetUIntFromBytesBits( ( bytes + 548 ), 2, 8, 3 );
fHideFcc = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 11 );
fAcetateShowMarkup = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 12 );
fAcetateShowAtn = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 13 );
fAcetateShowInsDel = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 14 );
fAcetateShowProps = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 15 );
istdTableDflt = FormatUtils::BytesToUInt16( bytes, 550, size );
verCompat = FormatUtils::BytesToUInt16( bytes, 552, size );
grfFmtFilter = FormatUtils::BytesToUInt16( bytes, 554, size );
iFolioPages = FormatUtils::BytesToInt16 ( bytes, 556, size );
cpgText = FormatUtils::BytesToUInt16( bytes, 558, size );
cpMinRMText = FormatUtils::BytesToInt32 ( bytes, 560, size );
cpMinRMFtn = FormatUtils::BytesToInt32 ( bytes, 564, size );
cpMinRMHdd = FormatUtils::BytesToInt32 ( bytes, 568, size );
cpMinRMAtn = FormatUtils::BytesToInt32 ( bytes, 572, size );
cpMinRMEdn = FormatUtils::BytesToInt32 ( bytes, 576, size );
cpMinRMTxbx = FormatUtils::BytesToInt32 ( bytes, 580, size );
cpMinRMHdrTxbx = FormatUtils::BytesToInt32 ( bytes, 584, size );
rsidRoot = FormatUtils::BytesToInt32 ( bytes, 588, size );
//unused 2
istdTableDflt = FormatUtils::BytesToUInt16( bytes, 550, size );
verCompat = FormatUtils::BytesToUInt16( bytes, 552, size );
grfFmtFilter = FormatUtils::BytesToUInt16( bytes, 554, size );
iFolioPages = FormatUtils::BytesToInt16( bytes, 556, size );
cpgText = FormatUtils::BytesToUInt16( bytes, 558, size );
cpMinRMText = FormatUtils::BytesToInt32( bytes, 560, size );
cpMinRMFtn = FormatUtils::BytesToInt32( bytes, 564, size );
cpMinRMHdd = FormatUtils::BytesToInt32( bytes, 568, size );
cpMinRMAtn = FormatUtils::BytesToInt32( bytes, 572, size );
cpMinRMEdn = FormatUtils::BytesToInt32( bytes, 576, size );
cpMinRMTxbx = FormatUtils::BytesToInt32( bytes, 580, size );
cpMinRMHdrTxbx = FormatUtils::BytesToInt32( bytes, 584, size );
rsidRoot = FormatUtils::BytesToInt32( bytes, 588, size );
if ( size > 594/* && fib->m_FibNew.nFibNew > Fib2002*/)
{
//split bytes 592,593,594,595 into bits
fTreatLockAtnAsReadOnly = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 0 );
fStyleLock = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 1 );
fAutoFmtOverride = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 2 );
fRemoveWordML = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 3 );
fApplyCustomXForm = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 4 );
fStyeLockEnforced = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 5 );
fFakeLockAtn = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 6 );
fIgnoreMixedContent = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 7 );
fShowPlaceholderText = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 8 );
grf = FormatUtils::GetUIntFromBytesBits( ( bytes + 592 ), 4, 9, 23 );
if ( size == 610 )
{
//split bytes 592,593,594,595 into bits
fTreatLockAtnAsReadOnly = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 0 );
fStyleLock = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 1 );
fAutoFmtOverride = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 2 );
fRemoveWordML = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 3 );
fApplyCustomXForm = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 4 );
fStyeLockEnforced = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 5 );
fFakeLockAtn = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 6 );
fIgnoreMixedContent = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 7 );
fShowPlaceholderText = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 8 );
grf = FormatUtils::GetUIntFromBytesBits( ( bytes + 592 ), 4, 9, 23 );
//split bytes 596 and 597 into bits
fReadingModeInkLockDown = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 0 );
fAcetateShowInkAtn = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 1 );
fFilterDttm = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 2 );
fEnforceDocProt = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 3 );
iDocProtCur = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 596 ), 2, 4, 3 );
fDispBkSpSaved = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 7 );
//split bytes 596 and 597 into bits
fReadingModeInkLockDown = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 0 );
fAcetateShowInkAtn = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 1 );
fFilterDttm = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 2 );
fEnforceDocProt = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 3 );
iDocProtCur = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 596 ), 2, 4, 3 );
fDispBkSpSaved = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 7 );
dxaPageLock = FormatUtils::BytesToInt16( bytes, 598, size );
dyaPageLock = FormatUtils::BytesToInt16( bytes, 600, size );
pctFontLock = FormatUtils::BytesToInt32( bytes, 602, size );
grfitbid = bytes[606];
//unsigned char 607 is unused
ilfoMacAtCleanup = FormatUtils::BytesToUInt16( bytes, 608, size );
}
dxaPageLock = FormatUtils::BytesToInt16( bytes, 598, size );
dyaPageLock = FormatUtils::BytesToInt16( bytes, 600, size );
pctFontLock = FormatUtils::BytesToInt32( bytes, 602, size );
grfitbid = bytes[606];
//unsigned char 607 is unused
ilfoMacAtCleanup = FormatUtils::BytesToUInt16( bytes, 608, size );
if ( size > 616/* && fib->m_FibNew.nFibNew > Fib2003*/)
{
//4 bytes reserved
bool fRMTrackFormatting = FormatUtils::GetBitFromBytes( ( bytes + 620 ), 2, 0 );
bool fRMTrackMoves = FormatUtils::GetBitFromBytes( ( bytes + 620 ), 2, 1 );
//dopMth = 34 bytes from 624 = 658
if ( size > 674/* && fib->m_FibNew.nFibNew > Fib2007*/)
{
if ( size > 690/* && fib->m_FibNew.nFibNew > Fib2010*/)
{
}
}
}
}
}
}
}
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -54,6 +54,7 @@ namespace DocFileFormat
friend class SettingsMapping;
bool bDisplayBackgroundShape;
private:
// True when facing pages should be printed
bool fFacingPages;

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -54,24 +54,24 @@ namespace DocFileFormat
int id = 0;
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:endnotes" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
m_pXmlWriter->WriteNodeBegin( L"w:endnotes", TRUE );
//write namespaces
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
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->WriteNodeEnd( L"", TRUE, FALSE );
int cp = ( m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr + m_document->FIB->m_RgLw97.ccpAtn );
while ( cp <= ( m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr + m_document->FIB->m_RgLw97.ccpAtn + m_document->FIB->m_RgLw97.ccpEdn - 2 ) )
{
m_pXmlWriter->WriteNodeBegin( _T( "w:endnote" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( id ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:endnote", TRUE );
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( id ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
while ( ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpHdr - m_document->FIB->m_RgLw97.ccpAtn ) < (*m_document->IndividualEndnotesPlex)[id + 1] )
{
@ -95,14 +95,14 @@ namespace DocFileFormat
}
}
m_pXmlWriter->WriteNodeEnd( _T( "w:endnote" ) );
m_pXmlWriter->WriteNodeEnd( L"w:endnote");
id++;
}
m_pXmlWriter->WriteNodeEnd( _T( "w:endnotes" ) );
m_pXmlWriter->WriteNodeEnd( L"w:endnotes");
m_context->_docx->EndnotesXML = std::wstring( m_pXmlWriter->GetXmlString() );
}
}
};
}
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -49,39 +49,46 @@ namespace DocFileFormat
unsigned char fNested:1;
unsigned char fHasSep:1;
};
public:
static const int STRUCTURE_SIZE = 2;
FieldCharacter():
fldch(0), grffld(0)
{
}
virtual ~FieldCharacter()
{
}
FieldCharacter() : fldch(0), grffld(0) {}
virtual ~FieldCharacter() {}
virtual ByteStructure* ConstructObject (VirtualStreamReader* pReader, int length)
{
FieldCharacter* pFldChar = new FieldCharacter();
FieldCharacter* pFldChar = new FieldCharacter();
if (pFldChar)
{
pFldChar->fldch = pReader->ReadByte();
pFldChar->grffld = pReader->ReadByte();
#ifdef _DEBUG
grffldEnd* __grffldEnd = (grffldEnd*)(&pFldChar->grffld);
int dbg = 0;
#endif
pFldChar->fldch = pReader->ReadByte();
pFldChar->grffld = pReader->ReadByte();
}
return static_cast<ByteStructure*>(pFldChar);
}
private:
unsigned char fldch;
unsigned char grffld;
};
class ListNumCache: public ByteStructure
{
public:
static const int STRUCTURE_SIZE = 4;
ListNumCache() : value(-1) {}
virtual ~ListNumCache() {}
virtual ByteStructure* ConstructObject (VirtualStreamReader* pReader, int length)
{
ListNumCache* pList = new ListNumCache();
if (pList)
{
pList->value = pReader->ReadInt32();
}
return static_cast<ByteStructure*>(pList);
}
int value;
};
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -1162,6 +1162,8 @@ namespace DocFileFormat
{
//Read the FibRgCswNew
m_FibNew.nFibNew = (FibVersion)reader.ReadUInt16();
if (m_FibNew.nFibNew == 0) m_FibNew.nFibNew = Fib1997;
m_FibNew.cQuickSavesNew = reader.ReadUInt16();
}
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -54,87 +54,92 @@ namespace DocFileFormat
this->_ctx->_docx->RegisterFontTable();
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:fonts" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
m_pXmlWriter->WriteNodeBegin( L"w:fonts", TRUE );
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
int sz_fonts = table->Data.size();
int sz_fonts = table->Data.size();
int users_fonts = 0;
for ( std::vector<ByteStructure*>::iterator iter = table->Data.begin(); iter != table->Data.end(); iter++ )
{
FontFamilyName* font = dynamic_cast<FontFamilyName*>( *iter );
m_pXmlWriter->WriteNodeBegin( _T( "w:font" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:name" ), FormatUtils::XmlEncode(font->xszFtn, true).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:font", TRUE );
std::wstring name_ = FormatUtils::XmlEncode(font->xszFtn, true);
if (name_.empty())
name_ = L"UserFont_" + std::to_wstring(++users_fonts);
m_pXmlWriter->WriteAttribute( L"w:name", name_);
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
//alternative name
if ( ( font->xszAlt != std::wstring( _T( "" ) ) ) && ( font->xszAlt.length() > 0 ) )
if ( ( font->xszAlt != std::wstring( L"" ) ) && ( font->xszAlt.length() > 0 ) )
{
m_pXmlWriter->WriteNodeBegin( _T( "w:altName" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::XmlEncode(font->xszAlt, true).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:altName" ) );
m_pXmlWriter->WriteNodeBegin( L"w:altName", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(font->xszAlt, true));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:altName" );
}
//charset
m_pXmlWriter->WriteNodeBegin( _T("w:charset" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( font->chs, _T( "%02x" ) ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:charset" ) );
m_pXmlWriter->WriteNodeBegin( L"w:charset", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( font->chs, L"%02x" ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:charset" );
//font family
m_pXmlWriter->WriteNodeBegin( _T("w:family"), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString( font->ff, &FontFamily[0][0], 6, 11 ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:family" ) );
m_pXmlWriter->WriteNodeBegin( L"w:family", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString( font->ff, &FontFamily[0][0], 6, 11 ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:family" );
//panose
m_pXmlWriter->WriteNodeBegin( _T("w:panose1"), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:panose1", TRUE );
std::wstring wstr( _T( "" ) );
std::wstring wstr( L"" );
for ( unsigned int i = 0; i < font->panoseSize; i++ )
{
wstr += FormatUtils::IntToFormattedWideString( font->panose[i], _T( "%02x" ) );
wstr += FormatUtils::IntToFormattedWideString( font->panose[i], L"%02x" );
}
m_pXmlWriter->WriteAttribute( _T( "w:val" ), wstr.c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:panose1" ) );
m_pXmlWriter->WriteAttribute( L"w:val", wstr);
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:panose1" );
//pitch
m_pXmlWriter->WriteNodeBegin( _T("w:pitch"), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString( font->prq, &FontPitch[0][0], 3, 9 ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:pitch" ) );
m_pXmlWriter->WriteNodeBegin( L"w:pitch", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString( font->prq, &FontPitch[0][0], 3, 9 ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:pitch" );
//truetype
if ( !font->fTrueType )
{
m_pXmlWriter->WriteNodeBegin( _T("w:notTrueType"), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "true" ) );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:notTrueType" ) );
m_pXmlWriter->WriteNodeBegin( L"w:notTrueType", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", L"true" );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:notTrueType" );
}
//font signature
m_pXmlWriter->WriteNodeBegin( _T("w:sig"), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:usb0" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield0, _T( "%08x" ) ).c_str() );
m_pXmlWriter->WriteAttribute( _T( "w:usb1" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield1, _T( "%08x" ) ).c_str() );
m_pXmlWriter->WriteAttribute( _T( "w:usb2" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield2, _T( "%08x" ) ).c_str() );
m_pXmlWriter->WriteAttribute( _T( "w:usb3" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield3, _T( "%08x" ) ).c_str() );
m_pXmlWriter->WriteAttribute( _T( "w:csb0" ), FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield0, _T( "%08x" ) ).c_str() );
m_pXmlWriter->WriteAttribute( _T( "w:csb1" ), FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield1, _T( "%08x" ) ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( _T( "w:sig" ) );
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->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"w:sig" );
m_pXmlWriter->WriteNodeEnd( _T( "w:font" ) );
m_pXmlWriter->WriteNodeEnd( L"w:font" );
}
m_pXmlWriter->WriteNodeEnd( _T("w:fonts") );
m_pXmlWriter->WriteNodeEnd( L"w:fonts");
this->_ctx->_docx->FontTableXML = std::wstring( m_pXmlWriter->GetXmlString() );
}
}
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -42,19 +42,19 @@ namespace DocFileFormat
{
static const wchar_t FontFamily[6][11] =
{
_T( "auto" ),
_T( "roman" ),
_T( "swiss" ),
_T( "modern" ),
_T( "script" ),
_T( "decorative" )
L"auto",
L"roman",
L"swiss",
L"modern",
L"script",
L"decorative"
};
static const wchar_t FontPitch[3][9] =
{
_T( "default" ),
_T( "fixed" ),
_T( "variable" )
L"default",
L"fixed",
L"variable"
};
class FontTableMapping: public AbstractOpenXmlMapping, public IMapping

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -45,16 +45,16 @@ namespace DocFileFormat
m_document = static_cast<WordDocument*>( visited );
//start the document
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:ftr" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
m_pXmlWriter->WriteNodeBegin( L"w:ftr", TRUE );
//write namespaces
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
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->WriteNodeEnd( L"", TRUE, FALSE );
//convert the footer text
_lastValidPapx = (*(m_document->AllPapxFkps->begin()))->grppapx[0];
@ -77,9 +77,14 @@ namespace DocFileFormat
{
//this PAPX is for a table
//cp = writeTable( cp, tai.iTap );
int start_table_cp = cp;
Table table( this, cp, ( ( tai.iTap > 0 ) ? ( 1 ) : ( 0 ) ) );
table.Convert( this );
cp = table.GetCPEnd();
if (cp == start_table_cp)
cp++;
}
else
{
@ -88,8 +93,8 @@ namespace DocFileFormat
}
}
m_pXmlWriter->WriteNodeEnd( _T( "w:ftr" ) );
m_pXmlWriter->WriteNodeEnd( L"w:ftr" );
m_context->_docx->FooterXMLList.push_back( std::wstring( m_pXmlWriter->GetXmlString() ) );
}
}
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -54,24 +54,24 @@ namespace DocFileFormat
int id = 0;
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:footnotes" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
m_pXmlWriter->WriteNodeBegin( L"w:footnotes", TRUE );
//write namespaces
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
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->WriteNodeEnd( L"", TRUE, FALSE );
int cp = m_document->FIB->m_RgLw97.ccpText;
while ( cp <= ( m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn - 2 ) )
{
m_pXmlWriter->WriteNodeBegin( _T( "w:footnote" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( id ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:footnote", TRUE );
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( id ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
while ( ( cp - m_document->FIB->m_RgLw97.ccpText ) < (*m_document->IndividualFootnotesPlex)[id + 1] )
{
@ -95,14 +95,14 @@ namespace DocFileFormat
}
}
m_pXmlWriter->WriteNodeEnd( _T( "w:footnote" ) );
m_pXmlWriter->WriteNodeEnd( L"w:footnote");
id++;
}
m_pXmlWriter->WriteNodeEnd( _T( "w:footnotes" ) );
m_pXmlWriter->WriteNodeEnd( L"w:footnotes");
m_context->_docx->FootnotesXML = std::wstring(m_pXmlWriter->GetXmlString());
}
}
};
}
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -45,16 +45,16 @@ namespace DocFileFormat
m_document = static_cast<WordDocument*>( visited );
//start the document
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:hdr" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
m_pXmlWriter->WriteNodeBegin( L"w:hdr", TRUE );
//write namespaces
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
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->WriteNodeEnd( L"", TRUE, FALSE );
//convert the header text
_lastValidPapx = (*(m_document->AllPapxFkps->begin()))->grppapx[0];
@ -88,8 +88,8 @@ namespace DocFileFormat
}
}
m_pXmlWriter->WriteNodeEnd( _T( "w:hdr" ) );
m_pXmlWriter->WriteNodeEnd( L"w:hdr");
m_context->_docx->HeaderXMLList.push_back( std::wstring( m_pXmlWriter->GetXmlString() ) );
}
}
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -40,7 +40,7 @@ namespace DocFileFormat
_type = type;
}
LanguageIdMapping::LanguageIdMapping (XMLTools::XMLElement<wchar_t>* parentElement, LanguageType type) : PropertiesMapping(NULL)
LanguageIdMapping::LanguageIdMapping (XMLTools::XMLElement* parentElement, LanguageType type) : PropertiesMapping(NULL)
{
_parent = parentElement;
_type = type;
@ -59,31 +59,31 @@ namespace DocFileFormat
{
std::wstring langcode = getLanguageCode( dynamic_cast<LanguageId*>( lid ) );
XMLTools::XMLAttribute<wchar_t>* att = NULL;
XMLTools::XMLAttribute* att = NULL;
switch ( _type )
{
case Default:
{
att = new XMLTools::XMLAttribute<wchar_t>( L"w:val", langcode.c_str() );
att = new XMLTools::XMLAttribute( L"w:val", langcode);
}
break;
case EastAsian:
{
att = new XMLTools::XMLAttribute<wchar_t>( L"w:eastAsia", langcode.c_str() );
att = new XMLTools::XMLAttribute( L"w:eastAsia", langcode);
}
break;
case Complex:
{
att = new XMLTools::XMLAttribute<wchar_t>( L"w:bidi", langcode.c_str() );
att = new XMLTools::XMLAttribute( L"w:bidi", langcode);
}
break;
default:
{
att = new XMLTools::XMLAttribute<wchar_t>( L"w:val", langcode.c_str() );
att = new XMLTools::XMLAttribute( L"w:val", langcode);
}
break;
}
@ -91,7 +91,7 @@ namespace DocFileFormat
if (m_pXmlWriter)
{
// !!!TODO!!!
m_pXmlWriter->WriteString( att->GetXMLString().c_str() );
m_pXmlWriter->WriteString( att->GetXMLString());
}
else if ( _parent != NULL )
{

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -49,14 +49,14 @@ namespace DocFileFormat
{
public:
LanguageIdMapping( XMLTools::CStringXmlWriter* writer, LanguageType type );
LanguageIdMapping( XMLTools::XMLElement<wchar_t>* parentElement, LanguageType type );
LanguageIdMapping( XMLTools::XMLElement* parentElement, LanguageType type );
virtual ~LanguageIdMapping();
void Apply( IVisitable* lid );
static std::wstring getLanguageCode( LanguageId* lid );
private:
LanguageType _type;
XMLTools::XMLElement<wchar_t>* _parent;
LanguageType _type;
XMLTools::XMLElement* _parent;
};
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -53,33 +53,47 @@ namespace DocFileFormat
m_context->_docx->RegisterDocument();
// Header
m_pXmlWriter->WriteNodeBegin(_T("?xml version=\"1.0\" encoding=\"UTF-8\"?"));
m_pXmlWriter->WriteNodeBegin(_T("w:document"), TRUE );
m_pXmlWriter->WriteNodeBegin(L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
m_pXmlWriter->WriteNodeBegin(L"w:document", TRUE );
// Namespaces
m_pXmlWriter->WriteAttribute(_T("xmlns:w"), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute(_T("xmlns:v"), OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute(_T("xmlns:o"), OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute(_T("xmlns:w10"), OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute(_T("xmlns:r"), OpenXmlNamespaces::Relationships );
m_pXmlWriter->WriteAttribute(_T("xmlns:m"), _T("http://schemas.openxmlformats.org/officeDocument/2006/math"));
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:m", L"http://schemas.openxmlformats.org/officeDocument/2006/math");
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpc"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:mc"), _T("http://schemas.openxmlformats.org/markup-compatibility/2006"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:wp14"),_T("http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:wp"), _T("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:w14"), _T("http://schemas.microsoft.com/office/word/2010/wordml"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpg"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpi"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingInk"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:wne"), _T("http://schemas.microsoft.com/office/word/2006/wordml"));
//m_pXmlWriter->WriteAttribute(_T("xmlns:wps"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingShape"));
//m_pXmlWriter->WriteAttribute(_T("mc:Ignorable"), _T("w14 wp14"));
//m_pXmlWriter->WriteAttribute(L"xmlns:wpc", L"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
//m_pXmlWriter->WriteAttribute(L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006");
//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: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 wp14");
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( _T("w:body"), FALSE );
if ((m_document->GetOfficeArt()) && (m_document->GetOfficeArt()->GetShapeBackgound()))
{
m_document->DocProperties->bDisplayBackgroundShape = true;
ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeBackgound();
// Convert the document
m_pXmlWriter->WriteNodeBegin ( L"w:background", TRUE);
m_pXmlWriter->WriteAttribute ( L"w:color", L"FFFFFF");
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, NULL, NULL, _caller);
pShape->Convert(&oVmlWriter);
m_pXmlWriter->WriteNodeEnd (L"w:background");
}
m_pXmlWriter->WriteNodeBegin( L"w:body", FALSE );
// Convert the document
_lastValidPapx = NULL;
if (m_document->AllPapxFkps->empty() == false)
{
@ -175,8 +189,8 @@ namespace DocFileFormat
}
}
m_pXmlWriter->WriteNodeEnd( _T( "w:body" ) );
m_pXmlWriter->WriteNodeEnd( _T( "w:document" ) );
m_pXmlWriter->WriteNodeEnd( L"w:body" );
m_pXmlWriter->WriteNodeEnd( L"w:document" );
m_context->_docx->DocumentXML = std::wstring(m_pXmlWriter->GetXmlString());
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -63,17 +63,17 @@ namespace DocFileFormat
m_xmldocument->RegisterNumbering();
//start the document
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
m_pXmlWriter->WriteNodeBegin( _T( "w:numbering" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
m_pXmlWriter->WriteNodeBegin( L"w:numbering", TRUE );
//write namespaces
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
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->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
PictureBulletsMapping();
@ -82,37 +82,37 @@ namespace DocFileFormat
for (std::list<ListData*>::iterator iter = rglst->listData.begin(); iter != rglst->listData.end(); ++iter, ++i)
{
//start abstractNum
m_pXmlWriter->WriteNodeBegin( _T( "w:abstractNum" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:abstractNumId" ), FormatUtils::IntToWideString( i ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:abstractNum", TRUE );
m_pXmlWriter->WriteAttribute( L"w:abstractNumId", FormatUtils::IntToWideString( i ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
//nsid
m_pXmlWriter->WriteNodeBegin( _T( "w:nsid" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( (*iter)->lsid, _T( "%08x" ) ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:nsid", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( (*iter)->lsid, L"%08x" ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
//multiLevelType
m_pXmlWriter->WriteNodeBegin( _T( "w:multiLevelType" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:multiLevelType", TRUE );
if ( (*iter)->fHybrid )
{
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "hybridMultilevel" ) );
m_pXmlWriter->WriteAttribute( L"w:val", L"hybridMultilevel" );
}
else if ( (*iter)->fSimpleList )
{
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "singleLevel" ) );
m_pXmlWriter->WriteAttribute( L"w:val", L"singleLevel" );
}
else
{
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "multilevel" ) );
m_pXmlWriter->WriteAttribute( L"w:val", L"multilevel" );
}
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
//template
m_pXmlWriter->WriteNodeBegin( _T( "w:tmpl" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( (*iter)->tplc, _T( "%08x" ) ).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:tmpl", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( (*iter)->tplc, L"%08x"));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
// writes the levels
size_t length = (*iter)->rglvl->size();
@ -124,33 +124,33 @@ namespace DocFileFormat
}
//end abstractNum
m_pXmlWriter->WriteNodeEnd( _T( "w:abstractNum" ) );
m_pXmlWriter->WriteNodeEnd( L"w:abstractNum" );
}
//write old style numbering (сложносоставных не сущестует)
for (std::list<NumberingDescriptor>::iterator iter = rglst->listNumbering.begin(); iter != rglst->listNumbering.end(); ++iter, ++i)
{
//start abstractNum
m_pXmlWriter->WriteNodeBegin( _T( "w:abstractNum" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:abstractNumId" ), FormatUtils::IntToWideString( i ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:abstractNum", TRUE );
m_pXmlWriter->WriteAttribute( L"w:abstractNumId", FormatUtils::IntToWideString( i ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
////nsid
//m_pXmlWriter->WriteNodeBegin( _T( "w:nsid" ), TRUE );
//m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( (*iter)->lsid, _T( "%08x" ) ).c_str() );
//m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
//m_pXmlWriter->WriteNodeBegin( L"w:nsid", TRUE );
//m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( (*iter)->lsid, L"%08x" ) ));
//m_pXmlWriter->WriteNodeEnd( L"", TRUE );
//multiLevelType
m_pXmlWriter->WriteNodeBegin( _T( "w:multiLevelType" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:multiLevelType", TRUE );
{
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "singleLevel" ) );
m_pXmlWriter->WriteAttribute( L"w:val", L"singleLevel" );
}
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
LevelMapping(*iter, 0);
//end abstractNum
m_pXmlWriter->WriteNodeEnd( _T( "w:abstractNum" ) );
m_pXmlWriter->WriteNodeEnd( L"w:abstractNum" );
}
//write the overrides
@ -159,36 +159,36 @@ namespace DocFileFormat
ListFormatOverride* lfo = m_document->listFormatOverrideTable->at(i);
//start num
m_pXmlWriter->WriteNodeBegin( _T( "w:num" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:numId" ), FormatUtils::IntToWideString(i + 1).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:num", TRUE );
m_pXmlWriter->WriteAttribute( L"w:numId", FormatUtils::IntToWideString(i + 1));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
int index = FindIndexbyId( rglst->listData, lfo->lsid );
m_pXmlWriter->WriteNodeBegin( _T( "w:abstractNumId" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString( index ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:abstractNumId", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString( index ) );
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
for (std::vector<ListFormatOverrideLevel*>::const_iterator iter = lfo->rgLfoLvl.begin(); iter != lfo->rgLfoLvl.end(); ++iter)
{
m_pXmlWriter->WriteNodeBegin( _T( "w:lvlOverride" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:lvlOverride", TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:ilvl" ), FormatUtils::IntToWideString( (*iter)->ilvl ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteAttribute( L"w:ilvl", FormatUtils::IntToWideString( (*iter)->ilvl ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
if ( ( (*iter)->fStartAt ) && ( !(*iter)->fFormatting ) )
{
m_pXmlWriter->WriteNodeBegin( _T( "w:startOverride" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString( (*iter)->iStartAt ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:startOverride", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString( (*iter)->iStartAt ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
}
LevelMapping((*iter)->lvl, 0, ListData::ISTD_NIL);
m_pXmlWriter->WriteNodeEnd(_T("w:lvlOverride"));
m_pXmlWriter->WriteNodeEnd(L"w:lvlOverride");
}
m_pXmlWriter->WriteNodeEnd(_T( "w:num"));
m_pXmlWriter->WriteNodeEnd(L"w:num");
}
if (m_document->listFormatOverrideTable->empty() && !rglst->listNumbering.empty())
@ -196,20 +196,20 @@ namespace DocFileFormat
i = 0;
for (std::list<NumberingDescriptor>::iterator iter = rglst->listNumbering.begin(); iter != rglst->listNumbering.end(); ++iter, ++i)
{
m_pXmlWriter->WriteNodeBegin( _T( "w:num" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:numId" ), FormatUtils::IntToWideString(i+1).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:num", TRUE );
m_pXmlWriter->WriteAttribute( L"w:numId", FormatUtils::IntToWideString(i+1));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( _T( "w:abstractNumId" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString( i ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:abstractNumId", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString( i ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
m_pXmlWriter->WriteNodeEnd(_T( "w:num"));
m_pXmlWriter->WriteNodeEnd(L"w:num");
}
}
m_pXmlWriter->WriteNodeEnd(_T("w:numbering"));
m_pXmlWriter->WriteNodeEnd(L"w:numbering");
m_xmldocument->NumberingXML = std::wstring(m_pXmlWriter->GetXmlString());
}
@ -255,8 +255,10 @@ namespace DocFileFormat
if (!FormatUtils::IsControlSymbol(xchBullet))
{
ret.push_back(lvl->xst[0]);
ret.push_back(L'\0');
ret.push_back(lvl->xst[0]);//??? xchBullet
}
else
{
}
}
}
@ -275,7 +277,7 @@ namespace DocFileFormat
{
newResult = find_if((result + 1), lvl->xst.end(), &NumberingMapping::IsPlaceholder);
ret += _T( "%" );
ret += L"%";
ret += FormatUtils::IntToWideString(*result + 1);
ret += std::wstring((result + 1), newResult);
result = newResult;
@ -305,13 +307,11 @@ namespace DocFileFormat
if (!FormatUtils::IsControlSymbol(xchBullet))
{
ret.push_back(lvl.xst[0]);
ret.push_back(L'\0');
}
}
else
{
ret.push_back(L'\xF0B7');
ret.push_back(L'\0');
}
}
else
@ -319,7 +319,7 @@ namespace DocFileFormat
std::wstring strBefore = lvl.xst.substr(0, Before);
std::wstring strAfter = lvl.xst.substr(Before, After);
ret = strBefore + _T( "%1" ) + strAfter ;
ret = strBefore + L"%1" + strAfter ;
}
return ret;
@ -342,134 +342,134 @@ namespace DocFileFormat
{
if (bOlderVersion && nfc > 5)
{
if (nfc == 0xff) return std::wstring( _T( "bullet" ) );
else return std::wstring( _T( "none" ) );
if (nfc == 0xff) return std::wstring( L"bullet");
else return std::wstring( L"none");
}
switch ( nfc )
{
case 0:
return std::wstring( _T( "decimal" ) );
return std::wstring( L"decimal" );
case 1:
return std::wstring( _T( "upperRoman" ) );
return std::wstring( L"upperRoman" );
case 2:
return std::wstring( _T( "lowerRoman" ) );
return std::wstring( L"lowerRoman" );
case 3:
return std::wstring( _T( "upperLetter" ) );
return std::wstring( L"upperLetter");
case 4:
return std::wstring( _T( "lowerLetter" ) );
return std::wstring( L"lowerLetter");
case 5:
return std::wstring( _T( "ordinal" ) );
return std::wstring( L"ordinal" );
case 6:
return std::wstring( _T( "cardinalText" ) );
return std::wstring( L"cardinalText" );
case 7:
return std::wstring( _T( "ordinalText" ) );
return std::wstring( L"ordinalText" );
case 8:
return std::wstring( _T( "hex" ) );
return std::wstring( L"hex" );
case 9:
return std::wstring( _T( "chicago" ) );
return std::wstring( L"chicago" );
case 10:
return std::wstring( _T( "ideographDigital" ) );
return std::wstring( L"ideographDigital" );
case 11:
return std::wstring( _T( "japaneseCounting" ) );
return std::wstring( L"japaneseCounting" );
case 12:
return std::wstring( _T( "aiueo" ) );
return std::wstring( L"aiueo" );
case 13:
return std::wstring( _T( "iroha" ) );
return std::wstring( L"iroha" );
case 14:
return std::wstring( _T( "decimalFullWidth" ) );
return std::wstring( L"decimalFullWidth" );
case 15:
return std::wstring( _T( "decimalHalfWidth" ) );
return std::wstring( L"decimalHalfWidth" );
case 16:
return std::wstring( _T( "japaneseLegal" ) );
return std::wstring( L"japaneseLegal" );
case 17:
return std::wstring( _T( "japaneseDigitalTenThousand" ) );
return std::wstring( L"japaneseDigitalTenThousand" );
case 18:
return std::wstring( _T( "decimalEnclosedCircle" ) );
return std::wstring( L"decimalEnclosedCircle" );
case 19:
return std::wstring( _T( "decimalFullWidth2" ) );
return std::wstring( L"decimalFullWidth2" );
case 20:
return std::wstring( _T( "aiueoFullWidth" ) );
return std::wstring( L"aiueoFullWidth" );
case 21:
return std::wstring( _T( "irohaFullWidth" ) );
return std::wstring( L"irohaFullWidth" );
case 22:
return std::wstring( _T( "decimalZero" ) );
return std::wstring( L"decimalZero" );
case 23:
return std::wstring( _T( "bullet" ) );
return std::wstring( L"bullet" );
case 24:
return std::wstring( _T( "ganada" ) );
return std::wstring( L"ganada" );
case 25:
return std::wstring( _T( "chosung" ) );
return std::wstring( L"chosung" );
case 26:
return std::wstring( _T( "decimalEnclosedFullstop" ) );
return std::wstring( L"decimalEnclosedFullstop" );
case 27:
return std::wstring( _T( "decimalEnclosedParen" ) );
return std::wstring( L"decimalEnclosedParen" );
case 28:
return std::wstring( _T( "decimalEnclosedCircleChinese" ) );
return std::wstring( L"decimalEnclosedCircleChinese" );
case 29:
return std::wstring( _T( "ideographEnclosedCircle" ) );
return std::wstring( L"ideographEnclosedCircle" );
case 30:
return std::wstring( _T( "ideographTraditional" ) );
return std::wstring( L"ideographTraditional" );
case 31:
return std::wstring( _T( "ideographZodiac" ) );
return std::wstring( L"ideographZodiac" );
case 32:
return std::wstring( _T( "ideographZodiacTraditional" ) );
return std::wstring( L"ideographZodiacTraditional" );
case 33:
return std::wstring( _T( "taiwaneseCounting" ) );
return std::wstring( L"taiwaneseCounting" );
case 34:
return std::wstring( _T( "ideographLegalTraditional" ) );
return std::wstring( L"ideographLegalTraditional" );
case 35:
return std::wstring( _T( "taiwaneseCountingThousand" ) );
return std::wstring( L"taiwaneseCountingThousand" );
case 36:
return std::wstring( _T( "taiwaneseDigital" ) );
return std::wstring( L"taiwaneseDigital" );
case 37:
return std::wstring( _T( "chineseCounting" ) );
return std::wstring( L"chineseCounting" );
case 38:
return std::wstring( _T( "chineseLegalSimplified" ) );
return std::wstring( L"chineseLegalSimplified" );
case 39:
return std::wstring( _T( "chineseCountingThousand" ) );
return std::wstring( L"chineseCountingThousand" );
case 40:
return std::wstring( _T( "koreanDigital" ) );
return std::wstring( L"koreanDigital" );
case 41:
return std::wstring( _T( "koreanCounting" ) );
return std::wstring( L"koreanCounting" );
case 42:
return std::wstring( _T( "koreanLegal" ) );
return std::wstring( L"koreanLegal" );
case 43:
return std::wstring( _T( "koreanDigital2" ) );
return std::wstring( L"koreanDigital2" );
case 44:
return std::wstring( _T( "vietnameseCounting" ) );
return std::wstring( L"vietnameseCounting" );
case 45:
return std::wstring( _T( "russianLower" ) );
return std::wstring( L"russianLower" );
case 46:
return std::wstring( _T( "russianUpper" ) );
return std::wstring( L"russianUpper" );
case 47:
return std::wstring( _T( "none" ) );
return std::wstring( L"none" );
case 48:
return std::wstring( _T( "numberInDash" ) );
return std::wstring( L"numberInDash" );
case 49:
return std::wstring( _T( "hebrew1" ) );
return std::wstring( L"hebrew1" );
case 50:
return std::wstring( _T( "hebrew2" ) );
return std::wstring( L"hebrew2" );
case 51:
return std::wstring( _T( "arabicAlpha" ) );
return std::wstring( L"arabicAlpha" );
case 52:
return std::wstring( _T( "arabicAbjad" ) );
return std::wstring( L"arabicAbjad" );
case 53:
return std::wstring( _T( "hindiVowels" ) );
return std::wstring( L"hindiVowels" );
case 54:
return std::wstring( _T( "hindiConsonants" ) );
return std::wstring( L"hindiConsonants" );
case 55:
return std::wstring( _T( "hindiNumbers" ) );
return std::wstring( L"hindiNumbers" );
case 56:
return std::wstring( _T( "hindiCounting" ) );
return std::wstring( L"hindiCounting" );
case 57:
return std::wstring( _T( "thaiLetters" ) );
return std::wstring( L"thaiLetters" );
case 58:
return std::wstring( _T( "thaiNumbers" ) );
return std::wstring( L"thaiNumbers" );
case 59:
return std::wstring( _T( "thaiCounting" ) );
return std::wstring( L"thaiCounting" );
default:
return std::wstring( _T( "decimal" ) );
return std::wstring( L"decimal" );
}
}
@ -486,22 +486,22 @@ namespace DocFileFormat
}
//--------------------------------------------------------------------------------
m_pXmlWriter->WriteNodeBegin( _T( "w:lvl" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:ilvl" ), FormatUtils::IntToWideString(level).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:lvl", TRUE );
m_pXmlWriter->WriteAttribute( L"w:ilvl", FormatUtils::IntToWideString(level));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( _T( "w:start" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString(lvl.iStartAt).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:start", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString(lvl.iStartAt));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
m_pXmlWriter->WriteNodeBegin( _T( "w:numFmt" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), GetNumberFormatWideString(lvl.nfc, true).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:numFmt", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", GetNumberFormatWideString(lvl.nfc, true));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
//// suffix
// m_pXmlWriter->WriteNodeBegin( _T( "w:suff" ), TRUE );
// m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString(lvl.ixchFollow, &FollowingCharMap[0][0], 3, 8).c_str());
// m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
// m_pXmlWriter->WriteNodeBegin( L"w:suff", TRUE );
// m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString(lvl.ixchFollow, &FollowingCharMap[0][0], 3, 8));
// m_pXmlWriter->WriteNodeEnd( L"", TRUE );
// Number level text
std::wstring lvlText = GetLvlText(lvl, isSymbol, lvl.cbTextBefore, lvl.cbTextAfter);
@ -515,33 +515,33 @@ namespace DocFileFormat
//}
if (!lvlText.empty())
{
m_pXmlWriter->WriteNodeBegin(_T("w:lvlText"), TRUE);
m_pXmlWriter->WriteAttribute(_T("w:val"), lvlText.c_str());
m_pXmlWriter->WriteNodeEnd(_T( ""), TRUE);
m_pXmlWriter->WriteNodeBegin(L"w:lvlText",TRUE);
m_pXmlWriter->WriteAttribute(L"w:val",lvlText);
m_pXmlWriter->WriteNodeEnd(L"", TRUE);
}
// jc
m_pXmlWriter->WriteNodeBegin( _T( "w:lvlJc" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString(lvl.jc, &LevelJustificationMap[0][0], 3, 7).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:lvlJc", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString(lvl.jc, &LevelJustificationMap[0][0], 3, 7));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
// pPr
m_pXmlWriter->WriteNodeBegin( _T( "w:pPr" ), FALSE );
m_pXmlWriter->WriteNodeEnd(_T("w:pPr"));
m_pXmlWriter->WriteNodeBegin( L"w:pPr", FALSE );
m_pXmlWriter->WriteNodeEnd(L"w:pPr");
// rPr
m_pXmlWriter->WriteNodeBegin( _T( "w:rPr" ), FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:rPr", FALSE );
if (!fontFamily.empty())
{
m_pXmlWriter->WriteNodeBegin( _T( "w:rFonts" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:rFonts", TRUE );
// w:hint="default"
m_pXmlWriter->WriteAttribute(_T("w:hAnsi"), fontFamily.c_str());
m_pXmlWriter->WriteAttribute(_T("w:ascii"), fontFamily.c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteAttribute(L"w:hAnsi",fontFamily);
m_pXmlWriter->WriteAttribute(L"w:ascii",fontFamily);
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
}
m_pXmlWriter->WriteNodeEnd(_T("w:rPr"));
m_pXmlWriter->WriteNodeEnd(L"w:rPr");
m_pXmlWriter->WriteNodeEnd(_T("w:lvl"));
m_pXmlWriter->WriteNodeEnd(L"w:lvl");
}
void NumberingMapping::LevelMapping(const ListLevel* lvl, unsigned int level, short styleIndex)
@ -556,27 +556,27 @@ namespace DocFileFormat
// Проверяем шрифт
m_pXmlWriter->WriteNodeBegin( _T( "w:lvl" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:ilvl" ), FormatUtils::IntToWideString(level).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:lvl", TRUE );
m_pXmlWriter->WriteAttribute( L"w:ilvl", FormatUtils::IntToWideString(level));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
// starts at
m_pXmlWriter->WriteNodeBegin( _T( "w:start" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString(lvl->iStartAt).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:start", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString(lvl->iStartAt));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
// number format
m_pXmlWriter->WriteNodeBegin( _T( "w:numFmt" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), GetNumberFormatWideString(lvl->nfc).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:numFmt", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", GetNumberFormatWideString(lvl->nfc));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
// suffix
m_pXmlWriter->WriteNodeBegin( _T( "w:suff" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString(lvl->ixchFollow, &FollowingCharMap[0][0], 3, 8).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:suff", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString(lvl->ixchFollow, &FollowingCharMap[0][0], 3, 8));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
// style
// The style id is used for a reverse reference.
@ -584,30 +584,30 @@ namespace DocFileFormat
if (styleIndex != ListData::ISTD_NIL)
{
m_pXmlWriter->WriteNodeBegin( _T( "w:pStyle" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::XmlEncode(StyleSheetMapping::MakeStyleId(m_document->Styles->Styles->at(styleIndex))).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:pStyle", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(StyleSheetMapping::MakeStyleId(m_document->Styles->Styles->at(styleIndex))));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
}
// Number level text
m_pXmlWriter->WriteNodeBegin(_T("w:lvlText"), TRUE);
m_pXmlWriter->WriteAttribute(_T("w:val"), GetLvlText(lvl, cpMapping.CheckIsSymbolFont()).c_str());
m_pXmlWriter->WriteNodeEnd(_T( ""), TRUE);
m_pXmlWriter->WriteNodeBegin(L"w:lvlText",TRUE);
m_pXmlWriter->WriteAttribute(L"w:val",GetLvlText(lvl, cpMapping.CheckIsSymbolFont()));
m_pXmlWriter->WriteNodeEnd(L"",TRUE);
WriteLevelPictureBullet(lvl->grpprlChpx);
// legacy
if (lvl->fWord6)
{
m_pXmlWriter->WriteNodeBegin( _T( "w:legacy" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:legacy" ), _T( "1" ) );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:legacy", TRUE );
m_pXmlWriter->WriteAttribute( L"w:legacy", L"1" );
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
}
// jc
m_pXmlWriter->WriteNodeBegin( _T( "w:lvlJc" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString(lvl->jc, &LevelJustificationMap[0][0], 3, 7).c_str());
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
m_pXmlWriter->WriteNodeBegin( L"w:lvlJc", TRUE );
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString(lvl->jc, &LevelJustificationMap[0][0], 3, 7));
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
// pPr
bool isBidi = false;
ParagraphPropertiesMapping oppMapping(m_pXmlWriter, m_context, m_document, NULL, isBidi);
@ -617,7 +617,7 @@ namespace DocFileFormat
m_pXmlWriter->WriteString(oWriterTemp.GetXmlString());
m_pXmlWriter->WriteNodeEnd(_T("w:lvl"));
m_pXmlWriter->WriteNodeEnd(L"w:lvl");
}
void NumberingMapping::PictureBulletsMapping()
@ -637,10 +637,10 @@ namespace DocFileFormat
if ((pict.mfp.mm > 98) && (pict.shapeContainer != NULL))
{
m_pXmlWriter->WriteNodeBegin( _T( "w:numPicBullet" ), TRUE );
m_pXmlWriter->WriteAttribute( _T( "w:numPicBulletId" ), FormatUtils::IntToWideString( iter->first ).c_str() );
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( _T( "w:pict" ) );
m_pXmlWriter->WriteNodeBegin( L"w:numPicBullet", TRUE );
m_pXmlWriter->WriteAttribute( L"w:numPicBulletId", FormatUtils::IntToWideString( iter->first ));
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
m_pXmlWriter->WriteNodeBegin( L"w:pict" );
//inline picture + bullete props
if (pict.blipStoreEntry != NULL)
@ -657,8 +657,8 @@ namespace DocFileFormat
pict.shapeContainer->Convert(&oShape);
}
m_pXmlWriter->WriteNodeEnd(_T("w:pict"));
m_pXmlWriter->WriteNodeEnd(_T("w:numPicBullet"));
m_pXmlWriter->WriteNodeEnd(L"w:pict");
m_pXmlWriter->WriteNodeEnd(L"w:numPicBullet");
}
}
@ -670,7 +670,7 @@ namespace DocFileFormat
{
if (grpprlChpx)
{
unsigned int cp = 0;
unsigned int index = 0;
bool isPictureBullet = false;
for (std::list<SinglePropertyModifier>::const_iterator iter = grpprlChpx->grpprl->begin(); iter != grpprlChpx->grpprl->end(); ++iter)
@ -679,7 +679,7 @@ namespace DocFileFormat
{
case sprmCPbiIBullet:
{
cp = FormatUtils::BytesToUInt32(iter->Arguments, 0, iter->argumentsSize);
index = FormatUtils::BytesToUInt32(iter->Arguments, 0, iter->argumentsSize);
}break;
case sprmCPbiGrf:
@ -691,10 +691,10 @@ namespace DocFileFormat
if (isPictureBullet)
{
m_pXmlWriter->WriteNodeBegin(_T("w:lvlPicBulletId"), TRUE);
m_pXmlWriter->WriteAttribute(_T("w:val"), FormatUtils::IntToWideString(cp).c_str());
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE);
m_pXmlWriter->WriteNodeBegin(L"w:lvlPicBulletId",TRUE);
m_pXmlWriter->WriteAttribute(L"w:val",FormatUtils::IntToWideString(index));
m_pXmlWriter->WriteNodeEnd(L"",TRUE);
}
}
}
}
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -52,9 +52,9 @@ namespace DocFileFormat
static const wchar_t LevelJustificationMap[3][7] =
{
_T("left"),
_T("center"),
_T("right")
L"left",
L"center",
L"right"
};
class NumberingMapping: public AbstractOpenXmlMapping, public IMapping
@ -89,4 +89,4 @@ namespace DocFileFormat
WordDocument* m_document;
WordprocessingDocument* m_xmldocument;
};
}
}

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -34,6 +34,7 @@
#include "OfficeDrawing/RecordFactory.h"
#include "OfficeDrawing/DrawingContainer.h"
#include "OfficeDrawing/DrawingRecord.h"
#include "OfficeDrawing/DrawingGroup.h"
#include "OfficeDrawing/GroupContainer.h"
#include "OfficeDrawing/Shape.h"
@ -57,7 +58,7 @@ namespace DocFileFormat
public:
OfficeArtContent (const FileInformationBlock* pFIB, POLE::Stream* pStream): m_pDrawingGroupData(NULL)
OfficeArtContent (const FileInformationBlock* pFIB, POLE::Stream* pStream): m_pDrawingGroupData(NULL), m_pBackgroud(NULL)
{
VirtualStreamReader oStearmReader(pStream, 0 , pFIB->m_bOlderVersion);
@ -87,15 +88,23 @@ namespace DocFileFormat
{
// the child is a subgroup
GroupContainer* group = static_cast<GroupContainer*>(groupChild);
group->Index = i;
drawing.container->Children[i] = group;
if (group)
{
group->Index = i;
}
}
else if (ShapeContainer::TYPE_CODE_0xF004 == groupChild->TypeCode)
{
// the child is a shape
ShapeContainer* shape = static_cast<ShapeContainer*>(groupChild);
shape->Index = i;
drawing.container->Children[i] = shape;
if (shape)
{
shape->Index = i;
if (shape->isBackground())
{
m_pBackgroud = shape;
}
}
}
}
}
@ -112,7 +121,10 @@ namespace DocFileFormat
for ( std::list<OfficeArtWordDrawing>::iterator iter = m_arrDrawings.begin(); iter != m_arrDrawings.end(); ++iter)
RELEASEOBJECT(iter->container);
}
inline ShapeContainer* GetShapeBackgound()
{
return m_pBackgroud;
}
inline ShapeContainer* GetShapeContainer (int spid)
{
ShapeContainer* ret = NULL;
@ -138,7 +150,6 @@ namespace DocFileFormat
if (shape->GetShapeID() == spid)
{
ret = container;
break;
}
}
@ -150,7 +161,7 @@ namespace DocFileFormat
if (shape->GetShapeID() == spid)
{
ret = container;
ret = container;
break;
}
}
@ -174,7 +185,7 @@ namespace DocFileFormat
}
private:
ShapeContainer* m_pBackgroud;
DrawingGroup* m_pDrawingGroupData;
std::list<OfficeArtWordDrawing> m_arrDrawings;
};

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
@ -39,11 +39,9 @@ namespace DocFileFormat
{
public:
static const unsigned short TYPE_CODE_0xF008 = 0xF008;
/// The number of shapes in this drawing
unsigned int csp;
/// The last MSOSPID given to an SP in this DG
int spidCur;
unsigned int csp; // The number of shapes in this drawing
int spidCur; // The last MSOSPID given to an SP in this DG
DrawingRecord():
Record(), csp(0), spidCur(0)
@ -53,8 +51,8 @@ namespace DocFileFormat
DrawingRecord( IBinaryReader* _reader, unsigned int size, unsigned int typeCode, unsigned int version, unsigned int instance ):
Record( _reader, size, typeCode, version, instance )
{
this->csp = this->Reader->ReadUInt32();
this->spidCur = this->Reader->ReadInt32();
csp = Reader->ReadUInt32();
spidCur = Reader->ReadInt32();
}
virtual ~DrawingRecord()

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

View File

@ -1,5 +1,5 @@
/*
* (c) Copyright Ascensio System SIA 2010-2016
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)

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