Compare commits

..

278 Commits

Author SHA1 Message Date
3d71c4e609 Fix bug 59175 2022-09-29 19:50:17 +03:00
65a203838b fix buid 2022-09-28 14:21:14 +03:00
8301f402c5 Merge pull request #1042 from ONLYOFFICE/fix/bug59153
Fix bug 59153
2022-09-27 11:43:29 +03:00
caab9eae47 Fix bug 59119 2022-09-27 11:34:54 +03:00
f5282fdc98 Fix bug 59153 2022-09-27 10:10:00 +03:00
d560fcc0a8 fix buid 2022-09-27 09:51:49 +03:00
9ca7cc5008 Merge pull request #1041 from ONLYOFFICE/fix/v.7.2-fix-bugs
Fix/v.7.2 fix bugs
2022-09-26 16:08:37 +03:00
56c3301e54 for bug #59118 2022-09-23 17:57:49 +03:00
23bf5cb929 Merge branch 'feature/v7.2-controls' into fix/v.7.2-fix-bugs 2022-09-23 17:56:19 +03:00
0b1c7f2642 fix viewProps presentation 2022-09-22 15:22:58 +03:00
b0d0186dd4 Merge branch release/v7.2.0 into master 2022-09-22 12:17:40 +00:00
d72d114f19 fix bug #59118
refactoring
2022-09-22 00:43:51 +03:00
a0cf3f13c3 Merge remote-tracking branch 'origin/fix/v7.2.0-ppt-2' into fix/v.7.2-fix-bugs 2022-09-21 10:34:33 +03:00
d400135f60 Merge branch 'fix/v7.2.0-fix-bugs' into fix/v.7.2-fix-bugs 2022-09-21 10:33:22 +03:00
856933b884 fix bug #59108 2022-09-20 20:12:44 +03:00
eab909f76b fix bug #59106 2022-09-20 19:30:00 +03:00
30799c7b8c fix bug #59074 2022-09-20 17:00:33 +03:00
c3246cf089 fix charset == 128 2022-09-19 18:41:14 +03:00
8032ffa3fd fix bug #59071 2022-09-19 14:18:28 +03:00
a6e490f70a fix bug #59070 2022-09-19 14:18:28 +03:00
e72ad2def4 For bug 59079 2022-09-16 22:41:48 +03:00
cfce809885 For bug 58435 2022-09-16 21:35:03 +03:00
760242fa4d fix bug #58814 2022-09-16 08:46:57 +03:00
c257b901ac Fix bug 59046 2022-09-15 17:47:23 +03:00
1873515006 Fix bug 58096 2022-09-15 16:33:08 +03:00
cb76784260 fix bug #59002 2022-09-15 13:24:16 +03:00
4982e1e1ed Merge pull request #1036 from ONLYOFFICE/fix/bug59036
Fix bug 59036
2022-09-14 19:05:28 +03:00
c087e9e9e4 Fix bug 59036
fix string path offset
2022-09-14 18:40:23 +03:00
4dae14c0b0 Merge pull request #1034 from ONLYOFFICE/fix/meta2
Fix temp files
2022-09-14 15:51:10 +03:00
798c8ee702 Fix temp files 2022-09-14 15:04:31 +03:00
f6974d1064 Merge pull request #1033 from ONLYOFFICE/fix/v7.2.0-fix-bugs
Fix/v7.2.0 fix bugs
2022-09-14 10:35:38 +03:00
78289248c8 . 2022-09-14 10:25:32 +03:00
bdbe8e811c Merge remote-tracking branch 'origin/fix/v7.2.0-ppt-2' into fix/v7.2.0-fix-bugs 2022-09-14 10:22:26 +03:00
5a0c45a87d for bug #57526 2022-09-14 10:19:37 +03:00
13316ce210 fix bug #59012 2022-09-13 18:14:45 +03:00
fb5ae0133c fix bug #58967 2022-09-13 15:55:08 +03:00
3c7cf1b061 fix bug #58982
refactoring & fix other bugs spreadsheet 2003 xml
2022-09-13 11:25:15 +03:00
31064ad4f2 Merge pull request #1031 from ONLYOFFICE/fix/bug58612
Fix bug 58612
2022-09-12 17:13:19 +03:00
579ac545a2 Fix bug 58612 2022-09-12 17:07:28 +03:00
f5c983c280 Merge pull request #1027 from ONLYOFFICE/fix/bug56130
Fix bug 56130
2022-09-12 13:03:39 +03:00
39cedff4ef Fix build 2022-09-12 12:56:50 +03:00
d22975e7e6 Add file to js module 2022-09-12 12:41:14 +03:00
5dceb4b7db Refactoring 2022-09-12 12:38:00 +03:00
226a04adb6 Refacroting 2022-09-12 12:31:22 +03:00
8e055fba82 Gradient in svg as raster (x2t) 2022-09-12 10:03:42 +03:00
108ff55a61 fix pictureBrightness 2022-09-09 18:13:16 +03:00
eaa3aa0e96 fix bug #58841 2022-09-09 17:56:58 +03:00
42ce6f11a5 Merge pull request #1029 from ONLYOFFICE/fix/bug58397
Fix bug #58397
2022-09-09 16:59:58 +03:00
d1d2a13ea0 Add patch to harfbuzz 2022-09-09 16:15:15 +03:00
d82cca8f9f fix bug #58965 2022-09-09 15:35:52 +03:00
99c2f645f4 fix SetCMapMemory 2022-09-09 12:16:46 +03:00
c7d7063297 fix bug #58924 2022-09-09 12:16:08 +03:00
4ee24be05f fix 2022-09-09 11:40:31 +03:00
7c913592fd add GetBaseCidToUnicode 2022-09-09 11:37:16 +03:00
cf16340335 Fix build with vlc 2022-09-08 20:14:14 +03:00
ed30c40f93 Fix bug #58397 2022-09-08 19:49:46 +03:00
34b5b7c973 fix 2022-09-08 18:36:46 +03:00
5333ce006d Merge pull request #1026 from ONLYOFFICE/fix/bug58267
Fix bug #58267
2022-09-08 17:22:33 +03:00
438989724f Merge pull request #1025 from ONLYOFFICE/fix/CssScale
Fix bug #56078
2022-09-08 17:20:26 +03:00
b2c308fc71 Fix bug #58267 2022-09-08 17:07:55 +03:00
70f2a11c75 fix bug #58908 2022-09-08 16:24:11 +03:00
1475162206 controls(activeX) presentation 2022-09-08 13:49:47 +03:00
211ca6c9f7 fix drawingfile build 2022-09-07 18:41:01 +03:00
1b5ec0a65c fix bug #58918 2022-09-07 15:01:54 +03:00
c80406cee4 . 2022-09-07 14:29:08 +03:00
3a582632f2 fix bug #58766 2022-09-07 13:45:47 +03:00
0cadeb36da Merge pull request #1023 from ONLYOFFICE/fix/v7.2.0-fix-bugs
Fix/v7.2.0 fix bugs
2022-09-07 10:08:06 +03:00
594737c899 fix bug #58728 2022-09-07 10:07:17 +03:00
238fc8969d Fix hatches in svg (x2t: wmf/emf => svg) 2022-09-06 20:59:01 +03:00
1878b8fc33 add cidToUnicode files 2022-09-06 18:00:49 +03:00
e82fd3c949 Merge pull request #1022 from ONLYOFFICE/fix/metafile
Fix bug #55408
2022-09-06 16:22:37 +03:00
12b733c7ee Fix bug #55408 2022-09-06 16:19:29 +03:00
482a9565eb fix bug #58372 2022-09-06 13:32:59 +03:00
636389cf04 Merge pull request #1021 from ONLYOFFICE/fix/v7.2.0-fix-bugs
Fix/v7.2.0 fix bugs
2022-09-05 22:08:20 +03:00
05d0e8980f fix bug #58782 2022-09-05 22:07:50 +03:00
be0cbaf0a2 fix bug #58814 2022-09-05 21:24:37 +03:00
9a07b8d4b2 Merge pull request #1020 from ONLYOFFICE/fix/v7.2.0-fix-bugs
fix bug #57527
2022-09-05 18:40:23 +03:00
1fc91b3a3c fix bug #57527 2022-09-05 18:39:00 +03:00
ac3481ca16 For bug 26503 2022-09-05 18:31:37 +03:00
d4a6acac39 Merge pull request #1019 from ONLYOFFICE/fix/bug57713
Fixing bugs in metafile conversion
2022-09-05 17:29:59 +03:00
35c93fcbe9 Added a condition for the size of the embedded metafile 2022-09-05 17:03:13 +03:00
dfcacb08c7 Fixed a bug of incomplete reading of the embedded metafile 2022-09-05 16:31:38 +03:00
00b306a24c Fixed a bug with missing circles due to negative width/height 2022-09-02 19:36:03 +03:00
bb287c0ccc Fix bug #57713 2022-09-02 19:35:11 +03:00
e43158c3c7 Merge pull request #1016 from ONLYOFFICE/feature/docx_renderer
Feature/docx renderer
2022-09-02 17:33:22 +03:00
722e3d307c Added merging properties of the same object (drawPath). 2022-09-02 17:23:43 +03:00
c1bda3059d Merge pull request #1014 from ONLYOFFICE/fix/CFontManager-GetStringPath
fix offset in GetStringPath in fontengine
2022-09-02 17:09:54 +03:00
52269454c6 fix bug #58845 2022-09-02 17:06:08 +03:00
ee27029c26 Merge pull request #1015 from ONLYOFFICE/fix/bug58829
Fix bug 58829
2022-09-02 16:46:11 +03:00
c87c8f2b4f Fix bug 58829 2022-09-02 16:35:05 +03:00
3ed7ceb243 fix bug #58814 2022-09-02 16:22:49 +03:00
49e361476d Fix previous commit 2022-09-02 12:33:44 +03:00
029ea786ef Fix bug 58787 2022-09-02 12:31:26 +03:00
3159d88bca fix bug #58822 2022-09-02 10:37:59 +03:00
ac6c9e0d0b fix new chart 2022-09-02 09:14:22 +03:00
7c34ac7533 fix offset 2022-09-02 09:14:17 +03:00
928f64d821 Some optimizations... 2. 2022-09-02 08:59:26 +03:00
697c63f74e Fix bug #56078 2022-09-01 18:48:20 +03:00
fd8bc44647 fix bug #58768 2022-09-01 18:19:47 +03:00
1f61877c5f Merge pull request #1012 from ONLYOFFICE/feature/api-descriptions-updates
Api descriptions updates
2022-09-01 13:37:53 +03:00
9fbba9f2a8 small fix 2022-09-01 13:37:10 +03:00
1ef57ca394 fix offset in GetStringPath in fontengine 2022-09-01 13:13:27 +03:00
8c1853c65d updated the .Net wrapper api 2022-09-01 13:04:38 +03:00
165990c135 Fix work with uncontexted primitives 2022-09-01 11:51:44 +03:00
0fff666352 fix buid 2022-09-01 08:44:16 +03:00
7fc15de8ce Merge pull request #1011 from ONLYOFFICE/fix/metafile
Fixing bugs in metafile conversion
2022-09-01 00:11:57 +03:00
597326bddc Refactoring 2022-09-01 00:09:21 +03:00
4caed2c4cd Fix bug 58767 2022-08-31 21:51:39 +03:00
3025d2281e fix bug #58812 2022-08-31 21:27:53 +03:00
5176d58940 fix bug #58815 2022-08-31 20:47:31 +03:00
2f6aebcad5 fix bug #58676 2022-08-31 20:20:40 +03:00
f6b0d35e6e fiix bug #58777 2022-08-31 20:18:20 +03:00
c63c4ea729 For bug #58397 2022-08-31 18:29:58 +03:00
0df69b205a test pdf/Resources with external fonts 2022-08-31 17:59:31 +03:00
52621c8bc7 Add ASC_MENU_EVENT_TYPE_CHANGE_MOBILE_MODE 2022-08-31 14:07:38 +03:00
bafc91dd67 fix bug #58732 2022-08-31 13:22:43 +03:00
beaa3b4494 Some optimizations... 2022-08-30 23:30:28 +03:00
1c8f05e0ce Fix the problem with read/write format parameter for combo box 2022-08-30 23:10:11 +03:00
0dfbf40855 Move complexFormPr parameter to correct place
Fix the problem with reading text form format from binary, also implement read/write to binary complexFormPr
2022-08-30 22:59:25 +03:00
d596a09c3f updated the c++ builder wrapper api 2022-08-30 17:33:55 +03:00
27ea7c9ffc fix bug #58769 2022-08-30 13:17:47 +03:00
b5197ee222 Increased code security 2022-08-29 19:01:55 +03:00
457cfc29ed Fixed bug #58407 2022-08-29 19:00:09 +03:00
979f303d57 Merge branch 'release/v7.2.0' of https://github.com/ONLYOFFICE/core into release/v7.2.0 2022-08-29 16:44:06 +03:00
fd3bfc0f5d Refactoring 2022-08-29 16:41:35 +03:00
fe1e498125 Fix bug #47325 2022-08-29 15:54:20 +03:00
0c2b6c7ac9 Refactoring 2022-08-29 14:56:30 +03:00
0b510a8d93 Fix bug #58400 2022-08-29 14:56:08 +03:00
784fd18470 Fix bug #58365, #55408, #58166, #58150 2022-08-29 13:39:34 +03:00
c5bee8701d Add read/write symbols of text form format 2022-08-29 13:29:21 +03:00
b4e130c4d7 Fix constants and name of attributes 2022-08-29 11:55:05 +03:00
ecb60a3452 fix bug #58708 2022-08-29 11:52:39 +03:00
70cfa996d1 fix bug #58707 2022-08-26 21:11:27 +03:00
18289bfdb4 TextFormFormat->comboBox 2022-08-26 20:22:40 +03:00
43fcaadcb1 fix bug #58699 2022-08-26 20:22:01 +03:00
6b82644d77 Add support --x2t-debug mode 2022-08-26 13:23:27 +03:00
d3914f513b [x2t] Remove extra space 2022-08-26 00:00:19 +03:00
5c202eece6 Fix big metafiles 2022-08-25 15:53:33 +03:00
bd32484a1e Merge branch 'release/v7.2.0' of https://github.com/ONLYOFFICE/core into release/v7.2.0 2022-08-25 14:50:50 +03:00
b4ae30d5b2 Fix bug 58216 2022-08-25 14:47:28 +03:00
1ff71c824c TextFormPrComplex 2022-08-25 12:49:19 +03:00
7482463667 Fix compile module 2022-08-25 12:26:09 +03:00
d0cda627dd . 2022-08-25 11:13:29 +03:00
7df0bcea7f TextFormPrFormat 2022-08-25 10:55:06 +03:00
43429aa84b Fix xp build 2022-08-24 17:44:51 +03:00
b19bce8d30 Refactoring 2022-08-24 13:34:01 +03:00
be8771f21b Merge pull request #1001 from ONLYOFFICE/fix/bug36412
Fix bug 36412, 55591
2022-08-24 13:31:48 +03:00
91af8c2b62 fix bug #58677 2022-08-24 12:31:20 +03:00
9917f7907d fix bug #58613 2022-08-24 12:21:06 +03:00
65d6a6f56d fix bug #58624 2022-08-24 11:34:01 +03:00
7e79a38520 Merge pull request #1008 from ONLYOFFICE/fix/bug58584
Fix bug 58584
2022-08-24 11:09:30 +03:00
55eb92bfc1 Merge pull request #1009 from ONLYOFFICE/fix/bug58096
Fix bug 58096
2022-08-24 10:59:23 +03:00
bc8a66ccd7 Fix compile 2022-08-24 08:34:15 +03:00
d0f7c93970 Merge pull request #1010 from ONLYOFFICE/feature/docx_renderer
Feature/docx renderer
2022-08-23 22:06:27 +03:00
fcf2742de3 Merge branch 'feature/docx_renderer' into 'release/v7.2.0' 2022-08-23 18:57:50 +03:00
8985173d4d Fix bug 58559 2022-08-23 16:58:42 +03:00
a1b4f43735 Some fixes... 5 2022-08-23 11:28:48 +03:00
546a3e8a6c Refactoring. SetProperty("--work-directory", ...) automatically, if DocBuilder::Initialize was called with directory 2022-08-23 10:32:22 +03:00
7a068930a8 Fix memory leak (jscontext) 2022-08-22 19:04:21 +03:00
fdbc9334ca Fix bug 58587 2022-08-22 16:09:49 +03:00
d04e2158ca Fix bug 58554 2022-08-19 19:55:56 +03:00
7abf16abe3 fix bug #58602 2022-08-19 16:00:10 +03:00
537eaf52fa Merge branch 'release/v7.2.0' of https://github.com/ONLYOFFICE/core into release/v7.2.0 2022-08-19 15:43:07 +03:00
94ea9c6d87 Fix bug 58382 2022-08-19 15:42:00 +03:00
2d7a8a5b75 for bug #56669 2022-08-19 12:48:04 +03:00
34407c4a1c fix dTfs 2022-08-18 18:18:07 +03:00
dd85d4263e Support pdf/xps/djvu when test with ST 2022-08-18 18:09:16 +03:00
8f534e9bff Removed some smart pointers. 2022-08-18 17:31:19 +03:00
2f15678363 Add support new sign algs 2022-08-18 16:25:59 +03:00
a51a953d83 Crash fixed 2022-08-18 14:37:09 +03:00
236667333c fix bug #56669 2022-08-18 14:21:48 +03:00
8d42cf008d Fix bug 58584 2022-08-18 14:11:24 +03:00
f422a6ed01 fix bug #58546 2022-08-18 11:34:59 +03:00
8962897eb7 Fix compile with vs2015 & gcc4.8 2022-08-18 00:49:27 +03:00
f99a3f9d74 Refactoring. Added smart pointers. 2022-08-17 15:08:41 +03:00
b908cb4d85 for bug #57467 2022-08-17 11:05:14 +03:00
8f5d21945d Fix build 2022-08-17 08:18:44 +03:00
d19d447532 Fix build 2022-08-16 21:29:34 +03:00
f40e1997c9 Fix bug 58096 2022-08-16 18:51:25 +03:00
344fe41905 fix build #57467 2022-08-16 16:08:25 +03:00
c46aa7a777 Correct build with vlc 2022-08-16 12:04:37 +03:00
ce2fb1d062 fix build 2022-08-16 10:35:47 +03:00
4f3879ae71 Implement toXml function for PdfReader 2022-08-16 02:49:51 +03:00
5e2e67db6e Add .net wrapper for builder 2022-08-15 18:21:18 +03:00
a6968ce575 Added merging conts in lines and paragraphs. 2022-08-15 17:48:23 +03:00
562e6a1bf5 for bug #58515 2022-08-15 11:39:52 +03:00
15a3df0c50 fix embedded in embedded media 2022-08-15 08:50:15 +03:00
1035103910 fix test projects 2022-08-15 08:49:47 +03:00
17e3a5d5cc Fix memory leak 2022-08-12 16:44:30 +03:00
90f659326b Fix bug with base64 images 2022-08-12 16:27:37 +03:00
aadd92f861 fix bug #58324 2022-08-12 15:40:54 +03:00
e2d192a67d fix bug #58281 2022-08-12 14:01:41 +03:00
8e4b9bd04f Refactoring 2022-08-12 13:48:32 +03:00
d3db4b428f fix bug #58324 2022-08-12 13:10:26 +03:00
71afd00742 fix bug #58454 2022-08-12 09:27:46 +03:00
5010aa346d Add support additional params 2022-08-11 22:08:55 +03:00
8ecbc5b505 Add param for convertions with origin format 2022-08-11 21:57:57 +03:00
474242d241 Refactoring convert to pdf/image from doctrenderer commands. 2022-08-11 20:45:06 +03:00
96fa62ac80 Added CFontStyle and StyleManager. 2022-08-11 12:08:58 +03:00
818d813b98 ffix bug #58484 2022-08-11 12:03:37 +03:00
1429fd87c2 Add IsObject realization 2022-08-10 18:51:48 +03:00
b542bae8fc Revert INCLUDEPATH 2022-08-10 16:24:04 +03:00
9a6e7e2dc3 Remove extra iamge formats 2022-08-10 15:30:05 +03:00
cede0396c5 fix bug #58468 2022-08-10 10:33:19 +03:00
b78ad9e751 Fix bugs 2022-08-09 21:52:48 +03:00
b9bfc60806 Merge pull request #1006 from ONLYOFFICE/feature/api-descriptions
Api descriptions
2022-08-09 14:06:53 +03:00
88b73c18a2 small fix 2022-08-09 14:06:08 +03:00
d75f7675d5 updated api descriptions for new docbuilder classes and methods 2022-08-09 11:59:01 +03:00
23d217004f fix bug #58428 2022-08-09 10:33:49 +03:00
00de3e3d37 fix bug #58424 2022-08-09 09:55:10 +03:00
7ae49de02a Fix mac build 2022-08-09 09:48:26 +03:00
f93c317e7a Refactoring 2022-08-08 18:59:42 +03:00
e258e9ba63 Merge pull request #1005 from ONLYOFFICE/fix/metafile_to_svg
Fix/metafile to svg
2022-08-08 18:45:51 +03:00
c8b6532510 Refactoring 2022-08-08 18:44:12 +03:00
81e6c62c5a fix bug #58243 2022-08-08 18:09:52 +03:00
289fbd68b6 Developing image module 2022-08-08 17:47:31 +03:00
82b0045a98 Added reading metafile from buffer and saving svg conversion to string 2022-08-08 17:36:52 +03:00
8690a92afd Refactoring image (inside zlib) module 2022-08-08 16:17:47 +03:00
6033e40cc9 Fix mac build 2022-08-08 14:24:35 +03:00
99f7544762 Removed excess fill 2022-08-08 12:17:36 +03:00
c58e69f4d1 Fixed going beyond range 2022-08-08 12:17:12 +03:00
aff18b27d1 fix bug #58385 2022-08-08 12:08:16 +03:00
223a26df7f Merge pull request #1004 from ONLYOFFICE/feature/docx_renderer
Feature/docx renderer
2022-08-07 21:39:49 +03:00
c01c52da81 Merge pull request #1003 from ONLYOFFICE/release/v7.2.0
Release/v7.2.0
2022-08-07 21:22:54 +03:00
1f6b4b23e0 Fix build 2022-08-06 16:40:32 +03:00
3e7732e2b2 Fix build 2022-08-06 16:11:22 +03:00
6a8c6827a0 Fix build 2022-08-06 15:27:59 +03:00
1f6707479e Added text effects recognition: Emboss, Engrave, Outline + Shadow. 2022-08-06 14:51:53 +03:00
a2eccad79e Some fixes... 4 2022-08-06 14:51:53 +03:00
8bc6926391 Some fixes... 3 2022-08-06 14:51:53 +03:00
01636d6f32 Pictures now use the shape format. 2022-08-06 14:51:53 +03:00
19e4bb58e5 Added text effects recognition: Emboss, Engrave, Outline + Shadow. 2022-08-06 07:09:59 +03:00
2bcb58703c Merge pull request #1002 from ONLYOFFICE/feature/imagesModule
Feature/images module
2022-08-05 17:06:04 +03:00
92033834cd Prepare for js module 2022-08-05 16:58:49 +03:00
e05b881856 Refactoring 2022-08-05 15:05:59 +03:00
e370c81b3b Refactoring 2022-08-05 13:14:14 +03:00
446f47a5e8 Merge pull request #1000 from ONLYOFFICE/fix/pdf-font
Fix pdf bugs
2022-08-05 12:12:49 +03:00
6724f57810 Fix bug 36412, 55591
partially 58084
2022-08-05 12:10:59 +03:00
cb4d5363f4 fix 2022-08-05 12:00:23 +03:00
f4dc89c7fe revert diffenet bugs 2022-08-05 11:59:23 +03:00
5594f48bdc Some fixes... 4 2022-08-05 06:59:28 +03:00
f0a65c6553 Refactoring 2022-08-04 19:51:59 +03:00
92119b07b7 Refactoring 2022-08-04 19:37:10 +03:00
bb66fe9fc5 Refactoring graphics project 2022-08-04 19:18:14 +03:00
3807ac3bc2 Fix bugs 36412, 55591
partially 58084
2022-08-04 17:28:07 +03:00
08ef7e79a2 Fix linux compile 2022-08-04 13:28:19 +03:00
1308f051e5 Add missed file 2022-08-04 12:52:24 +03:00
1aeaa320a9 Refactoring builder test example 2022-08-04 12:24:13 +03:00
244ee7a2bd create stroke with gradient fill 2022-08-03 18:49:24 +03:00
0469fe7b59 Refactoring 2022-08-03 18:43:51 +03:00
9977c2f4c2 Merge branch 'feature/metafile2svg' into feature/imagesModule 2022-08-03 17:46:41 +03:00
0b1fa41c21 [x2t] For bug 57318 2022-08-03 17:44:09 +03:00
bf1bcd40a2 Add test 2022-08-03 17:18:42 +03:00
c1493bf1f4 Merge branch 'feature/metafile_to_svg' into feature/imagesModule 2022-08-03 12:20:34 +03:00
d7f080283b Merge pull request #997 from ONLYOFFICE/metafile2
Refactoring
2022-08-03 11:46:42 +03:00
6d0da9364c Fix spaces 2022-08-03 11:42:48 +03:00
981f48c49e Fix spaces 2022-08-03 11:38:49 +03:00
a378aa92b1 Fix spaces 2022-08-03 11:29:22 +03:00
3fdefb4952 Refactoring 2022-08-02 20:37:07 +03:00
bbeccbca46 fix not CID Font, create updateBlendMode 2022-08-02 18:35:20 +03:00
549b8353e9 Developing 2022-08-02 17:40:35 +03:00
d517e8cf2a test not CID Font in pdf 2022-08-01 18:36:36 +03:00
f640bef308 Some fixes... 3 2022-07-29 07:53:45 +03:00
7cf83f1d85 Pictures now use the shape format. 2022-07-26 14:25:17 +03:00
d4a4e91d5a Merge branch hotfix/v7.1.1 into master 2022-07-11 08:58:59 +00:00
ee60028d7c Limiting the use of the file system 2022-06-21 09:29:21 +03:00
d43e0a4bc8 Limited use of FontManager 2022-06-15 20:06:28 +03:00
49a39cbd80 The work with the pictures was transferred to memory 2022-06-14 21:17:33 +03:00
399821046f Removed the use of CFontManager 2022-06-10 17:52:18 +03:00
47bcde4efe Remove extra file 2022-06-10 17:09:34 +03:00
583f907dd3 Fixing bugs 2022-06-09 16:00:47 +03:00
a9c99b5fb1 Elimination of defects 2022-06-08 18:55:30 +03:00
c2654f2a3d Added conversion of WMV format to SVG 2022-06-07 20:41:52 +03:00
b8d0b5df96 refactoring the WMF conversion code 2022-06-06 16:31:32 +03:00
c7accbd1fb Improved EMF to SVG conversion 2022-06-02 19:49:55 +03:00
345565349f Improved EMF to SVG conversion 2022-06-01 19:48:02 +03:00
44647e33fb Expanded the possibilities of converting a metafile to SVG 2022-05-31 18:56:39 +03:00
5c8132d476 Added the ability to convert Emf to Svg 2022-05-25 19:23:16 +03:00
466 changed files with 50746 additions and 37238 deletions

2
.gitignore vendored
View File

@ -39,4 +39,6 @@ Thumbs.db
*.opendb
.vs
DesktopEditor/fontengine/js/common/freetype-2.10.4

View File

@ -53,14 +53,12 @@ namespace DocFileFormat
this->Fractional = fractional;
}
FixedPointNumber( unsigned int value )
FixedPointNumber( _UINT32 value )
{
unsigned char* bytes = FormatUtils::GetBytes( value );
unsigned short* bytes = (unsigned short*)(&value);
this->Integral = FormatUtils::BytesToUInt16( bytes, 0, sizeof(value) );
this->Fractional = FormatUtils::BytesToUInt16( bytes, 2, sizeof(value) );
RELEASEARRAYOBJECTS( bytes );
this->Integral = bytes[0];
this->Fractional = bytes[1];
}
FixedPointNumber( const unsigned char* bytes, unsigned int size )

View File

@ -31,6 +31,7 @@
*/
#include "PropertiesMapping.h"
#include "RGBColor.h"
namespace DocFileFormat
{

View File

@ -35,7 +35,6 @@
#include "Global.h"
#include "BorderCode.h"
#include "RGBColor.h"
#include "ShadingDescriptor.h"
#include "SinglePropertyModifier.h"

View File

@ -31,9 +31,8 @@
*/
#pragma once
#include "../../DesktopEditor/common/Types.h"
#include <sstream>
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
#include <boost/format.hpp>
namespace DocFileFormat
{
@ -55,9 +54,13 @@ namespace DocFileFormat
std::wstring SixDigitHexCode;
std::wstring EightDigitHexCode;
RGBColor( int cv, ByteOrder order )
RGBColor( _UINT32 cv, ByteOrder order )
{
unsigned char* bytes = FormatUtils::GetBytes( cv );
unsigned char bytes[4];
bytes[0] = cv & 0x000000FF;
bytes[1] = (cv >> 8) & 0x000000FF;
bytes[2] = (cv >> 16) & 0x000000FF;
bytes[3] = (cv >> 24) & 0x000000FF;
std::wstringstream rgbColor6, rgbColor8;
@ -68,8 +71,8 @@ namespace DocFileFormat
this->Blue = bytes[2];
this->Alpha = bytes[3];
rgbColor6 << boost::wformat( L"%02x%02x%02x" ) % /*R*/this->Red % /*G*/this->Green % /*B*/this->Blue;
rgbColor8 << boost::wformat( L"%02x%02x%02x%02x" ) % /*R*/this->Red % /*G*/this->Green % /*B*/this->Blue % /*A*/this->Alpha;
rgbColor6 << boost::wformat( L"%02x%02x%02x" ) % Red % Green % Blue;
rgbColor8 << boost::wformat( L"%02x%02x%02x%02x" ) % Red % Green % Blue % Alpha;
SixDigitHexCode = rgbColor6.str();
EightDigitHexCode = rgbColor8.str();
@ -81,14 +84,12 @@ namespace DocFileFormat
this->Blue = bytes[0];
this->Alpha = bytes[3];
rgbColor6 << boost::wformat( L"%02x%02x%02x" ) % /*R*/this->Red % /*G*/this->Green % /*B*/this->Blue;
rgbColor8 << boost::wformat( L"%02x%02x%02x%02x" ) % /*R*/this->Red % /*G*/this->Green % /*B*/this->Blue % /*A*/this->Alpha;
rgbColor6 << boost::wformat( L"%02x%02x%02x" ) % Red % Green % Blue;
rgbColor8 << boost::wformat( L"%02x%02x%02x%02x" ) % Red % Green % Blue % Alpha;
SixDigitHexCode = rgbColor6.str();
EightDigitHexCode = rgbColor8.str();
}
RELEASEARRAYOBJECTS( bytes );
}
};
}

View File

@ -426,8 +426,11 @@ void TablePropertiesMapping::Apply(IVisitable* visited)
for (size_t i = 0; i < _grid->size(); i++)
{
XMLTools::XMLElement gridCol(L"w:gridCol");
XMLTools::XMLAttribute gridColW(L"w:w", FormatUtils::IntToWideString(_grid->at(i)));
gridCol.AppendAttribute(gridColW);
if (_grid->at(i) > 0)
{
XMLTools::XMLAttribute gridColW(L"w:w", FormatUtils::IntToWideString(_grid->at(i)));
gridCol.AppendAttribute(gridColW);
}
_tblGrid->AppendChild(gridCol);
}

View File

@ -210,7 +210,7 @@ namespace DocFileFormat
}
if (brcBottom)
{
XMLTools::XMLElement border(L"w:left");
XMLTools::XMLElement border(L"w:bottom");
appendBorderAttributes(brcBottom.get(), &border);
addOrSetBorder(_tblBorders, &border);
}

View File

@ -354,29 +354,37 @@ namespace DocFileFormat
case ODRAW::borderBottomColor:
if (!pict->brcBottom)
{
RGBColor bottomColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(L"o:borderbottomcolor", L"#" + bottomColor.SixDigitHexCode);
ODRAW::OfficeArtCOLORREF bottomColor((_UINT32)iter->op);
m_context->_doc->CorrectColor(bottomColor);
if (false == bottomColor.sColorRGB.empty())
m_pXmlWriter->WriteAttribute(L"o:borderbottomcolor", L"#" + bottomColor.sColorRGB);
}
break;
case ODRAW::borderLeftColor:
if (!pict->brcLeft)
{
RGBColor leftColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(L"o:borderleftcolor", L"#" + leftColor.SixDigitHexCode);
ODRAW::OfficeArtCOLORREF leftColor((_UINT32)iter->op);
m_context->_doc->CorrectColor(leftColor);
if (false == leftColor.sColorRGB.empty())
m_pXmlWriter->WriteAttribute(L"o:borderleftcolor", L"#" + leftColor.sColorRGB);
}
break;
case ODRAW::borderRightColor:
if (!pict->brcRight)
{
RGBColor rightColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(L"o:borderrightcolor", L"#" + rightColor.SixDigitHexCode);
ODRAW::OfficeArtCOLORREF rightColor((_UINT32)iter->op);
m_context->_doc->CorrectColor(rightColor);
if (false == rightColor.sColorRGB.empty())
m_pXmlWriter->WriteAttribute(L"o:borderrightcolor", L"#" + rightColor.sColorRGB);
}
break;
case ODRAW::borderTopColor:
if (!pict->brcTop)
{
RGBColor topColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(L"o:bordertopcolor", L"#" + topColor.SixDigitHexCode);
ODRAW::OfficeArtCOLORREF topColor((_UINT32)iter->op);
m_context->_doc->CorrectColor(topColor);
if (false == topColor.sColorRGB.empty())
m_pXmlWriter->WriteAttribute(L"o:bordertopcolor", L"#" + topColor.sColorRGB);
}
break;
//CROPPING

View File

@ -482,9 +482,10 @@ namespace DocFileFormat
// LINE
case ODRAW::lineColor:
{
RGBColor lineColor((int)iter->op, RedFirst);
if (!pShape->fBackground)
m_pXmlWriter->WriteAttribute(L"strokecolor", (std::wstring(L"#") + lineColor.SixDigitHexCode));
ODRAW::OfficeArtCOLORREF lineColor((_UINT32)iter->op);
m_context->_doc->CorrectColor(lineColor);
if (false == lineColor.sColorRGB.empty() && !pShape->fBackground)
m_pXmlWriter->WriteAttribute(L"strokecolor", (std::wstring(L"#") + lineColor.sColorRGB));
}break;
case ODRAW::lineWidth:
{
@ -544,13 +545,18 @@ namespace DocFileFormat
// FILL
case ODRAW::fillColor:
{
RGBColor fillColor((int)iter->op, RedFirst);
m_pXmlWriter->WriteAttribute(L"fillcolor", (std::wstring(L"#") + fillColor.SixDigitHexCode));
ODRAW::OfficeArtCOLORREF fillColor((_UINT32)iter->op);
m_context->_doc->CorrectColor(fillColor);
if (false == fillColor.sColorRGB.empty())
m_pXmlWriter->WriteAttribute(L"fillcolor", (std::wstring(L"#") + fillColor.sColorRGB));
}break;
case ODRAW::fillBackColor:
{
RGBColor fillBackColor((int)iter->op, RedFirst);
appendValueAttribute(&m_fill, L"color2", (std::wstring(L"#") + fillBackColor.SixDigitHexCode));
ODRAW::OfficeArtCOLORREF fillBackColor((_UINT32)iter->op);
m_context->_doc->CorrectColor(fillBackColor);
if (false == fillBackColor.sColorRGB.empty())
appendValueAttribute(&m_fill, L"color2", (std::wstring(L"#") + fillBackColor.sColorRGB));
}break;
case ODRAW::fillAngle:
{
@ -623,8 +629,10 @@ namespace DocFileFormat
case ODRAW::shadowColor:
{
RGBColor shadowColor((int)iter->op, RedFirst);
appendValueAttribute(&m_shadow, L"color", (std::wstring(L"#") + shadowColor.SixDigitHexCode));
ODRAW::OfficeArtCOLORREF shadowColor((_UINT32)iter->op);
m_context->_doc->CorrectColor(shadowColor);
if (false == shadowColor.sColorRGB.empty())
appendValueAttribute(&m_shadow, L"color", (std::wstring(L"#") + shadowColor.sColorRGB));
}break;
case ODRAW::shadowOffsetX:
{

View File

@ -40,7 +40,6 @@
#include "VMLShapeTypeMapping.h"
#include "TwipsValue.h"
#include "EmuValue.h"
#include "RGBColor.h"
#include "FixedPointNumber.h"
#include "OfficeDrawing/BlipStoreContainer.h"

View File

@ -1005,5 +1005,119 @@ namespace DocFileFormat
return encodingChars;
}
}
void WordDocument::CorrectColor(ODRAW::OfficeArtCOLORREF & color)
{
#if 0
if (false == color.sColorRGB.empty()) return;
if (color.fSysIndex)
{
oox::_color sys_color;
_UINT32 nColorCode = color.index;
unsigned short nParameter = (unsigned short)((nColorCode >> 16) & 0x00ff); // the HiByte of nParameter is not zero, an exclusive AND is helping :o
unsigned short nFunctionBits = (unsigned short)((nColorCode & 0x00000f00) >> 8);
unsigned short nAdditionalFlags = (unsigned short)((nColorCode & 0x0000f000) >> 8);
unsigned short nColorIndex = (unsigned short)(nColorCode & 0x00ff);
unsigned short nPropColor = 0;
_UINT32 systemColors[25] =
{
0xc0c0c0, 0x008080, 0x000080, 0x808080, 0xc0c0c0, 0xffffff, 0x000000,
0x000000, 0x000000, 0xffffff, 0xc0c0c0, 0xc0c0c0, 0x808080, 0x000080,
0xffffff, 0xc0c0c0, 0x808080, 0x808080, 0x000000, 0xc0c0c0, 0xffffff,
0x000000, 0xc0c0c0, 0x000000, 0xffffc0
};
if (nColorIndex < 25)
{
sys_color.SetRGB((unsigned char)(systemColors[nColorIndex]>>16), (unsigned char)(systemColors[nColorIndex]>>8), (unsigned char)(systemColors[nColorIndex]));
}
else return;
if (nAdditionalFlags & 0x80) // make color gray
{
BYTE nZwi = 0x7f;//= aColor.GetLuminance();
sys_color.SetRGB(nZwi, nZwi, nZwi);
}
switch (nFunctionBits)
{
case 0x01: // darken color by parameter
{
BYTE R = static_cast<BYTE> ((nParameter * sys_color.GetR()) >> 8);
BYTE G = static_cast<BYTE> ((nParameter * sys_color.GetG()) >> 8);
BYTE B = static_cast<BYTE> ((nParameter * sys_color.GetB()) >> 8);
sys_color.SetRGB(R, G, B);
}
break;
case 0x02: // lighten color by parameter
{
unsigned short nInvParameter = (0x00ff - nParameter) * 0xff;
BYTE R = static_cast<BYTE>((nInvParameter + (nParameter * sys_color.GetR())) >> 8);
BYTE G = static_cast<BYTE>((nInvParameter + (nParameter * sys_color.GetG())) >> 8);
BYTE B = static_cast<BYTE>((nInvParameter + (nParameter * sys_color.GetB())) >> 8);
sys_color.SetRGB(R, G, B);
}break;
case 0x03: // add grey level RGB(p,p,p)
{
short nR = (short)sys_color.GetR() + (short)nParameter;
short nG = (short)sys_color.GetG() + (short)nParameter;
short nB = (short)sys_color.GetB() + (short)nParameter;
if (nR > 0x00ff) nR = 0x00ff;
if (nG > 0x00ff) nG = 0x00ff;
if (nB > 0x00ff) nB = 0x00ff;
sys_color.SetRGB((BYTE)nR, (BYTE)nG, (BYTE)nB);
}break;
case 0x04: // substract grey level RGB(p,p,p)
{
short nR = (short)sys_color.GetR() - (short)nParameter;
short nG = (short)sys_color.GetG() - (short)nParameter;
short nB = (short)sys_color.GetB() - (short)nParameter;
if (nR < 0) nR = 0;
if (nG < 0) nG = 0;
if (nB < 0) nB = 0;
sys_color.SetRGB((BYTE)nR, (BYTE)nG, (BYTE)nB);
} break;
case 0x05: // substract from gray level RGB(p,p,p)
{
short nR = (short)nParameter - (short)sys_color.GetR();
short nG = (short)nParameter - (short)sys_color.GetG();
short nB = (short)nParameter - (short)sys_color.GetB();
if (nR < 0) nR = 0;
if (nG < 0) nG = 0;
if (nB < 0) nB = 0;
sys_color.SetRGB((BYTE)nR, (BYTE)nG, (BYTE)nB);
}break;
case 0x06: // per component: black if < p, white if >= p
{
BYTE R = sys_color.GetR() < nParameter ? 0x00 : 0xff;
BYTE G = sys_color.GetG() < nParameter ? 0x00 : 0xff;
BYTE B = sys_color.GetB() < nParameter ? 0x00 : 0xff;
sys_color.SetRGB(R, G, B);
}break;
}
if (nAdditionalFlags & 0x40) // top-bit invert
sys_color.SetRGB(sys_color.GetR() ^ 0x80, sys_color.GetG() ^ 0x80, sys_color.GetB() ^ 0x80);
if (nAdditionalFlags & 0x20) // invert color
sys_color.SetRGB(0xff - sys_color.GetR(), 0xff - sys_color.GetG(), 0xff - sys_color.GetB());
color.sColorRGB = sys_color.sRGB;
}
//else if (color.fPaletteIndex)
//{
// std::map<int, std::wstring>::iterator it = colors_palette.find(color.index);
// if (it != colors_palette.end())
// {
// color.sColorRGB = it->second;
// }
//}
#endif
}
}

View File

@ -236,6 +236,7 @@ namespace DocFileFormat
Plex<EmptyStructure> *AutoTextPlex;
AnnotationReferenceExDescriptors *AnnotationsReferencesEx;
//------------------------------------------------------------------------------
void CorrectColor(ODRAW::OfficeArtCOLORREF & color);
};
}

View File

@ -80,6 +80,8 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<IncludePath>..\..\..\Common\3dParty\boost\build\win_32\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<LibraryPath>..\..\..\Common\3dParty\boost\build\win_32\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
@ -121,6 +123,7 @@
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

View File

@ -1185,7 +1185,7 @@ int Binary_pPrReader::ReadInd(BYTE type, long length, void* poResult)
long nIndFirstLine = SerializeCommon::Round(dIndFirstLine * g_dKoef_mm_to_twips);
std::wstring sIndFirstLine;
if(nIndFirstLine >= 0)
sIndFirstLine = L" w:firstLine =\"" + std::to_wstring(nIndFirstLine) + L"\"";
sIndFirstLine = L" w:firstLine=\"" + std::to_wstring(nIndFirstLine) + L"\"";
else
sIndFirstLine = L" w:hanging=\"" + std::to_wstring(-nIndFirstLine) + L"\"";
pCStringWriter->WriteString(sIndFirstLine);
@ -1196,7 +1196,7 @@ int Binary_pPrReader::ReadInd(BYTE type, long length, void* poResult)
long nIndFirstLine = m_oBufferedStream.GetLong();
std::wstring sIndFirstLine;
if(nIndFirstLine >= 0)
sIndFirstLine = L" w:firstLine =\"" + std::to_wstring(nIndFirstLine) + L"\"";
sIndFirstLine = L" w:firstLine=\"" + std::to_wstring(nIndFirstLine) + L"\"";
else
sIndFirstLine = L" w:hanging=\"" + std::to_wstring(-nIndFirstLine) + L"\"";
pCStringWriter->WriteString(sIndFirstLine);
@ -8274,7 +8274,12 @@ int Binary_DocumentTableReader::Read_tblGrid(BYTE type, long length, void* poRes
}
else if( c_oSerDocTableType::tblGrid_ItemTwips == type )
{
pCStringWriter->WriteString(L"<w:gridCol w:w=\"" + std::to_wstring(m_oBufferedStream.GetLong())+ L"\"/>");
int ngridCol = m_oBufferedStream.GetLong();
if (ngridCol > 0)
pCStringWriter->WriteString(L"<w:gridCol w:w=\"" + std::to_wstring(ngridCol)+ L"\"/>");
else
pCStringWriter->WriteString(L"<w:gridCol/>");
}
else if( c_oSerDocTableType::tblGridChange == type )
{
@ -8788,8 +8793,7 @@ int Binary_DocumentTableReader::ReadEmbedded(BYTE type, long length, void* poRes
int id = m_oFileWriter.m_oChartWriter.nEmbeddedCount++;
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(id + 1) + L".xlsx";
BinXlsxRW::SaveParams oSaveParams(strDstEmbeddedTempDrawingPath, strDstEmbeddedTempEmbeddingsPath, strDstEmbeddedTempThemePath, m_oFileWriter.m_pDrawingConverter->GetContentTypes());//???
BinXlsxRW::SaveParams oSaveParams(strDstEmbeddedTempDrawingPath, strDstEmbeddedTempEmbeddingsPath, strDstEmbeddedTempThemePath, m_oFileWriter.m_pDrawingConverter->GetContentTypes(), NULL, true);
OOX::Spreadsheet::CXlsx oXlsx;
@ -8800,12 +8804,15 @@ int Binary_DocumentTableReader::ReadEmbedded(BYTE type, long length, void* poRes
oXlsx.Write(strDstEmbeddedTemp, *oSaveParams.pContentTypes);
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(id + 1) + (oSaveParams.bMacroEnabled ? L".xlsm" : L".xlsx");
COfficeUtils oOfficeUtils(NULL);
oOfficeUtils.CompressFileOrDirectory(strDstEmbeddedTemp, strDstEmbedded + FILE_SEPARATOR_STR + sXlsxFilename, true);
std::wstring sEmbWorksheetRelsName = L"embeddings/" + sXlsxFilename;
std::wstring bstrEmbWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
m_oFileWriter.m_pDrawingConverter->WriteRels(bstrEmbWorksheetRelType, sEmbWorksheetRelsName, std::wstring(), &pDrawingProperty->nObjectId);
std::wstring sEmbWorksheetRelType = oSaveParams.bMacroEnabled ? OOX::FileTypes::MicrosoftOfficeExcelMacro_EnabledWorksheet.RelationType() :
OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
m_oFileWriter.m_pDrawingConverter->WriteRels(sEmbWorksheetRelType, sEmbWorksheetRelsName, std::wstring(), &pDrawingProperty->nObjectId);
NSDirectory::DeleteDirectory(strDstEmbeddedTemp);
}
@ -9367,6 +9374,11 @@ int Binary_DocumentTableReader::ReadSdtPr(BYTE type, long length, void* poResult
pSdtPr->m_oPicture.Init();
READ1_DEF(length, res, this->ReadSdtPicture, pSdtPr->m_oPicture.GetPointer());
}
else if (c_oSerSdt::ComplexFormPr == type)
{
pSdtPr->m_oComplexFormPr.Init();
READ1_DEF(length, res, this->ReadSdtComplexFormPr, pSdtPr->m_oComplexFormPr.GetPointer());
}
else
res = c_oSerConstants::ReadUnknown;
return res;
@ -9426,11 +9438,17 @@ int Binary_DocumentTableReader::ReadSdtComboBox(BYTE type, long length, void* po
pSdtComboBox->m_sLastValue.Init();
pSdtComboBox->m_sLastValue->append(m_oBufferedStream.GetString3(length));
}
else if (c_oSerSdt::TextFormPrFormat == type)
{
pSdtComboBox->m_oFormat.Init();
READ1_DEF(length, res, this->ReadSdtTextFormPrFormat, pSdtComboBox->m_oFormat.GetPointer());
}
else if (c_oSerSdt::SdtListItem == type)
{
ComplexTypes::Word::CSdtListItem* pSdtListItem = new ComplexTypes::Word::CSdtListItem();
READ1_DEF(length, res, this->ReadSdtListItem, pSdtListItem);
pSdtComboBox->m_arrListItem.push_back(pSdtListItem); }
pSdtComboBox->m_arrListItem.push_back(pSdtListItem);
}
else
res = c_oSerConstants::ReadUnknown;
return res;
@ -9641,6 +9659,46 @@ int Binary_DocumentTableReader::ReadSdtTextFormPr(BYTE type, long length, void*
{
pTextFormPr->m_oMultiLine = m_oBufferedStream.GetBool();
}
else if (c_oSerSdt::TextFormPrFormat == type)
{
pTextFormPr->m_oFormat.Init();
READ1_DEF(length, res, this->ReadSdtTextFormPrFormat, pTextFormPr->m_oFormat.GetPointer());
}
else
res = c_oSerConstants::ReadUnknown;
return res;
}
int Binary_DocumentTableReader::ReadSdtComplexFormPr(BYTE type, long length, void* poResult)
{
int res = 0;
OOX::Logic::CComplexFormPr* pComplexForm = static_cast<OOX::Logic::CComplexFormPr*>(poResult);
if (c_oSerSdt::ComplexFormPrType == type)
{
pComplexForm->m_oType.Init();
pComplexForm->m_oType->SetValueFromByte(m_oBufferedStream.GetLong());
}
else
res = c_oSerConstants::ReadUnknown;
return res;
}
int Binary_DocumentTableReader::ReadSdtTextFormPrFormat(BYTE type, long length, void* poResult)
{
int res = 0;
ComplexTypes::Word::CTextFormFormat* pFormat = static_cast<ComplexTypes::Word::CTextFormFormat*>(poResult);
if (c_oSerSdt::TextFormPrFormatType == type)
{
pFormat->m_oType.Init();
pFormat->m_oType->SetValueFromByte(m_oBufferedStream.GetChar());
}
else if (c_oSerSdt::TextFormPrFormatVal == type)
{
pFormat->m_oVal = m_oBufferedStream.GetString3(length);
}
else if (c_oSerSdt::TextFormPrFormatSymbols == type)
{
pFormat->m_oSymbols = m_oBufferedStream.GetString3(length);
}
else
res = c_oSerConstants::ReadUnknown;
return res;
@ -9991,6 +10049,7 @@ int BinaryFileReader::ReadMainTable()
}break;
case c_oSerTableTypes::VbaProject:
{
m_bMacroRead = true;
m_oBufferedStream.Skip(1); //skip type
if (m_bMacro)
{

View File

@ -479,7 +479,9 @@ public:
int ReadSdtFormPr(BYTE type, long length, void* poResult);
int ReadSdtTextFormPr(BYTE type, long length, void* poResult);
int ReadSdtTextFormPrComb(BYTE type, long length, void* poResult);
int ReadSdtTextFormPrFormat(BYTE type, long length, void* poResult);
int ReadSdtPicture(BYTE type, long length, void* poResult);
int ReadSdtComplexFormPr(BYTE type, long length, void* poResult);
};
class Binary_NotesTableReader : public Binary_CommonReader
{
@ -500,8 +502,9 @@ private:
NSBinPptxRW::CBinaryFileReader& m_oBufferedStream;
Writers::FileWriter& m_oFileWriter;
std::wstring m_sFileInDir;
bool m_bMacro;
public:
bool m_bMacro = false;
bool m_bMacroRead = false;
public:
BinaryFileReader(std::wstring& sFileInDir, NSBinPptxRW::CBinaryFileReader& oBufferedStream, Writers::FileWriter& oFileWriter, bool bMacro = false);
int ReadFile();
int ReadMainTable();

File diff suppressed because one or more lines are too long

View File

@ -1252,6 +1252,7 @@ extern int g_nCurFormatVersion;
TextFormPrCombBorder = 56,
TextFormPrAutoFit = 57,
TextFormPrMultiLine = 58,
TextFormPrFormat = 59,
PictureFormPr = 60,
PictureFormPrScaleFlag = 61,
PictureFormPrLockProportions = 62,
@ -1260,7 +1261,12 @@ extern int g_nCurFormatVersion;
PictureFormPrShiftY = 65,
FormPrBorder = 70,
FormPrShd = 71,
TextFormPrCombWRule = 72
TextFormPrCombWRule = 72,
TextFormPrFormatType = 80,
TextFormPrFormatVal = 81,
TextFormPrFormatSymbols = 82,
ComplexFormPr = 90,
ComplexFormPrType = 91
};}
namespace c_oSerFFData{enum c_oSerFFData
{

View File

@ -7726,7 +7726,13 @@ void BinaryDocumentTableWriter::WriteSdtPr(const OOX::Logic::CSdtPr& oStdPr)
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::PictureFormPr);
WriteSdtPicture(oStdPr.m_oPicture.get());
m_oBcw.WriteItemEnd(nCurPos);
}
}
if (oStdPr.m_oComplexFormPr.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::ComplexFormPr);
WriteSdtComplexFormPr(oStdPr.m_oComplexFormPr.get());
m_oBcw.WriteItemEnd(nCurPos);
}
}
void BinaryDocumentTableWriter::WriteSdtPicture(const OOX::Logic::CSdtPicture& oSdtPicture)
{
@ -7762,6 +7768,16 @@ void BinaryDocumentTableWriter::WriteSdtPicture(const OOX::Logic::CSdtPicture& o
m_oBcw.WriteItemEnd(nCurPos);
}
}
void BinaryDocumentTableWriter::WriteSdtComplexFormPr(const OOX::Logic::CComplexFormPr& oComplexFormPr)
{
int nCurPos = 0;
if (oComplexFormPr.m_oType.IsInit() && !oComplexFormPr.m_oType->IsDefaultValue())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::ComplexFormPrType);
m_oBcw.m_oStream.WriteLONG(oComplexFormPr.m_oType->GetValue());
m_oBcw.WriteItemEnd(nCurPos);
}
}
void BinaryDocumentTableWriter::WriteSdtCheckBox(const OOX::Logic::CSdtCheckBox& oSdtCheckBox)
{
int nCurPos = 0;
@ -7817,6 +7833,12 @@ void BinaryDocumentTableWriter::WriteSdtComboBox(const OOX::Logic::CSdtComboBox&
m_oBcw.m_oStream.WriteStringW3(oSdtComboBox.m_sLastValue.get());
m_oBcw.WriteItemEnd(nCurPos);
}
if (oSdtComboBox.m_oFormat.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrFormat);
WriteSdtTextFormPrFormat(oSdtComboBox.m_oFormat.get());
m_oBcw.WriteItemEnd(nCurPos);
}
for(size_t i = 0; i < oSdtComboBox.m_arrListItem.size(); ++i)
{
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::SdtListItem);
@ -8007,6 +8029,34 @@ void BinaryDocumentTableWriter::WriteSdtTextFormPr(const OOX::Logic::CTextFormPr
m_oBcw.m_oStream.WriteBOOL(oTextFormPr.m_oMultiLine.get());
m_oBcw.WriteItemEnd(nCurPos);
}
if (oTextFormPr.m_oFormat.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrFormat);
WriteSdtTextFormPrFormat(oTextFormPr.m_oFormat.get());
m_oBcw.WriteItemEnd(nCurPos);
}
}
void BinaryDocumentTableWriter::WriteSdtTextFormPrFormat(const ComplexTypes::Word::CTextFormFormat& oFormat)
{
int nCurPos = 0;
if (oFormat.m_oType.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrFormatType);
m_oBcw.m_oStream.WriteBYTE((BYTE)oFormat.m_oType->GetValue());
m_oBcw.WriteItemEnd(nCurPos);
}
if (oFormat.m_oVal.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrFormatVal);
m_oBcw.m_oStream.WriteStringW3(oFormat.m_oVal.get());
m_oBcw.WriteItemEnd(nCurPos);
}
if (oFormat.m_oSymbols.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrFormatSymbols);
m_oBcw.m_oStream.WriteStringW3(oFormat.m_oSymbols.get());
m_oBcw.WriteItemEnd(nCurPos);
}
}
void BinaryDocumentTableWriter::WriteSdtTextFormPrComb(const ComplexTypes::Word::CComb& oComb)
{

View File

@ -503,7 +503,9 @@ namespace BinDocxRW
void WriteSdtFormPr(const OOX::Logic::CFormPr& oFormPr);
void WriteSdtTextFormPr(const OOX::Logic::CTextFormPr& oTextFormPr);
void WriteSdtTextFormPrComb(const ComplexTypes::Word::CComb& oComb);
void WriteSdtTextFormPrFormat(const ComplexTypes::Word::CTextFormFormat& oFormat);
void WriteSdtPicture(const OOX::Logic::CSdtPicture& oSdtPicture);
void WriteSdtComplexFormPr(const OOX::Logic::CComplexFormPr& oComplexFormPr);
};
class BinaryCustomsTableWriter
{

View File

@ -148,7 +148,8 @@ namespace BinXlsxRW{
oDrawingConverter.SetDstPath(sDstPath + FILE_SEPARATOR_STR + L"xl");
oDrawingConverter.SetSrcPath(strFileInDir, 2);
oDrawingConverter.SetFontDir(m_sFontDir);
BinXlsxRW::BinaryFileReader oBinaryFileReader;
return oBinaryFileReader.Xml2Xlsx(sSrcFileName, sDstPath, &oDrawingConverter, sXMLOptions, m_bIsMacro);
}
@ -182,7 +183,7 @@ namespace BinXlsxRW{
std::wstring sFileName;
BinXlsxRW::SaveParams oSaveParams(sDrawingsPath, sEmbedingPath, sThemePath, m_pExternalDrawingConverter->GetContentTypes());
BinXlsxRW::SaveParams oSaveParams(sDrawingsPath, sEmbedingPath, sThemePath, m_pExternalDrawingConverter->GetContentTypes(), NULL, true);
BinXlsxRW::BinaryChartReader oBinaryChartReader(*pReader, oSaveParams, m_pExternalDrawingConverter);
bool bResult = false;
@ -201,6 +202,8 @@ namespace BinXlsxRW{
if (bResult && pReader->m_nDocumentType != XMLWRITER_DOC_TYPE_XLSX && !sEmbedingPath.empty() && !bXlsxPresent)
{
oSaveParams.bMacroEnabled = false;
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(pReader->m_nCountEmbedded) + L".xlsx";
std::wstring sXlsxPath = sEmbedingPath + FILE_SEPARATOR_STR + sXlsxFilename;
@ -212,8 +215,9 @@ namespace BinXlsxRW{
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
unsigned int rId;
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
m_pExternalDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rId);
std::wstring sChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
m_pExternalDrawingConverter->WriteRels(sChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rId);
chart_file->m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData();
chart_file->m_oChartSpace.m_externalData->m_id = new std::wstring();

View File

@ -159,7 +159,7 @@ public:
}break;
case 'T':
{
if ((pos + 6 <= size) && (expr.substr(pos, 6) == L"ТОСHKA"))
if ((pos + 6 <= size) && (expr.substr(pos, 6) == L"TОСHKA"))
{
result += L"."; pos += 6;
}
@ -230,6 +230,21 @@ public:
{
result += L"'"; pos += 8;
}
else if ((pos + 8 <= size) && (expr.substr(pos, 8) == L"APERSAND"))
{
result += L"&"; pos += 8;
}
else
{
result += expr[pos++];
}
}break;
case 'Z':
{
if ((pos + 9 <= size) && (expr.substr(pos, 9) == L"ZAPYATAYA"))
{
result += L","; pos += 9;
}
else
{
result += expr[pos++];
@ -243,7 +258,7 @@ public:
}
expr = result;
//XmlUtils::replace_all( expr, L"MINYS", L"-");
//XmlUtils::replace_all( expr, L"ТОСHKA", L".");
//XmlUtils::replace_all( expr, L"TОСHKA", L".");
//XmlUtils::replace_all( expr, L"VOSKL", L"!");
//XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
@ -273,7 +288,11 @@ public:
}break;
case '.':
{
result += L"ТОСHKA";
result += L"TОСHKA";
}break;
case ',':
{
result += L"ZAPYATAYA";
}break;
case '!':
{
@ -307,6 +326,10 @@ public:
{
result += L"KAVYCHKA";
}break;
case '&':
{
result += L"APERSAND";
}break;
default:
{
result += expr[pos];
@ -317,7 +340,7 @@ public:
expr = result;
//XmlUtils::replace_all( expr, L"-", L"MINYS");
//XmlUtils::replace_all( expr, L".", L"ТОСHKA");
//XmlUtils::replace_all( expr, L".", L"TОСHKA");
//XmlUtils::replace_all( expr, L"!", L"VOSKL");
//XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
@ -648,6 +671,7 @@ void oox2odf_converter::Impl::replace_semicolons(std::wstring& expr)
// boost::match_default | boost::format_all);
// expr = res;
//}
// заменить вертикальную черту во всех вхождениях в фигурных скобках, но не внутри строк
void oox2odf_converter::Impl::replace_vertical(std::wstring& expr)
{
@ -804,6 +828,7 @@ std::wstring oox2odf_converter::Impl::convert_conditional_formula(const std::wst
}
XmlUtils::replace_all(res, L"&", L"&amp;");
oox_replace_tmp_back( res);
replace_vertical(res);

View File

@ -569,7 +569,8 @@ enum ElementType
typeScriptEventListener,
typeNumberNumberStyle,
typeNumberBaseStyle,
typeNumberNumberStyle,
typeNumberDataStyle,
typeNumberText,
typeNumberNumber,

View File

@ -37,6 +37,8 @@
#include <stack>
#include <cassert>
#include "../../../Common/DocxFormat/Source/XML/Utils.h"
namespace cpdoccore
{
@ -320,7 +322,7 @@ typedef xml::writer::element<wchar_t> xml_element;
#define CP_XML_ATTR_OPT(NAME, VAL) if (VAL)CP_XML_ATTR(NAME, (*VAL))
#define CP_XML_ATTR_OPT_ENCODE_STRING(NAME, STR) if (STR)CP_XML_ATTR(NAME, XmlUtils::EncodeXmlString(XmlUtils::EncodeXmlString(*STR)))
#define CP_XML_ATTR_OPT_ENCODE_STRING(NAME, STR) if (STR)CP_XML_ATTR(NAME, XmlUtils::EncodeXmlString(*STR))
#define CP_XML_NODE_SIMPLE() std::wstring NS_NAME = std::wstring(ns) + std::wstring(L":") + std::wstring(name); CP_XML_NODE(NS_NAME)

View File

@ -99,14 +99,14 @@ void pptx_xml_slide::write_to(std::wostream & strm)
{
CP_XML_ATTR(L"name", name());
CP_XML_STREAM() << strmBackground_.str();
CP_XML_STREAM() << strmBackground_.rdbuf();
CP_XML_NODE(L"p:spTree")
{
CP_XML_STREAM() << strmData_.str();
CP_XML_STREAM() << strmData_.rdbuf();
}
}
CP_XML_STREAM() << strmTiming_.str();
CP_XML_STREAM() << strmTiming_.rdbuf();
CP_XML_NODE(L"p:clrMapOvr")
{
CP_XML_NODE(L"a:masterClrMapping");
@ -165,7 +165,7 @@ void pptx_xml_slideLayout::write_to(std::wostream & strm)
{
CP_XML_NODE(L"p:spTree")
{
CP_XML_STREAM() << strmData_.str();
CP_XML_STREAM() << strmData_.rdbuf();
//в slideLayoutData_
//contentPart (Content Part) §19.3.1.14
@ -258,11 +258,11 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
CP_XML_NODE(L"p:cSld")
{
CP_XML_STREAM() << strmBackground_.str();
CP_XML_STREAM() << strmBackground_.rdbuf();
CP_XML_NODE(L"p:spTree")
{
CP_XML_STREAM() << strmData_.str();
CP_XML_STREAM() << strmData_.rdbuf();
}
}
CP_XML_NODE(L"p:clrMap")
@ -291,7 +291,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
}
}
}
CP_XML_STREAM() << strmDataExtra_.str();
CP_XML_STREAM() << strmDataExtra_.rdbuf();
CP_XML_NODE(L"p:txStyles")
{
CP_XML_NODE(L"p:titleStyle");
@ -324,17 +324,17 @@ void pptx_xml_theme::write_to(std::wostream & strm)
CP_XML_NODE(L"a:clrScheme")
{
CP_XML_ATTR(L"name", name_);
CP_XML_STREAM() << clrSchemeData_.str();
CP_XML_STREAM() << clrSchemeData_.rdbuf();
}
CP_XML_NODE(L"a:fontScheme")
{
CP_XML_ATTR(L"name", name_);
CP_XML_STREAM() << fontSchemeData_.str();
CP_XML_STREAM() << fontSchemeData_.rdbuf();
}
CP_XML_NODE(L"a:fmtScheme")
{
CP_XML_ATTR(L"name", name_);
CP_XML_STREAM() << fmtSchemeData_.str();
CP_XML_STREAM() << fmtSchemeData_.rdbuf();
}
}
}
@ -417,7 +417,7 @@ void pptx_xml_presentation::write_to(std::wostream & strm)
CP_XML_NODE(L"p:sldMasterIdLst")
{
CP_XML_STREAM() << slideMastersData_.str();
CP_XML_STREAM() << slideMastersData_.rdbuf();
}
std::wstring notesMaster = slideNotesMastersData_.str();
if (notesMaster.empty() == false)
@ -429,11 +429,11 @@ void pptx_xml_presentation::write_to(std::wostream & strm)
}
CP_XML_NODE(L"p:sldIdLst")
{
CP_XML_STREAM() << slidesData_.str();
CP_XML_STREAM() << slidesData_.rdbuf();
}
CP_XML_STREAM() << slidesProperties_.str();
CP_XML_STREAM() << slidesProperties_.rdbuf();
CP_XML_STREAM() << slidesNotesProperties_.str();
CP_XML_STREAM() << slidesNotesProperties_.rdbuf();
CP_XML_NODE(L"p:defaultTextStyle")//??
{
@ -491,11 +491,11 @@ void pptx_xml_slideNotes::write_to(std::wostream & strm)
CP_XML_NODE(L"p:cSld")
{
CP_XML_STREAM() << strmBackground_.str();
CP_XML_STREAM() << strmBackground_.rdbuf();
CP_XML_NODE(L"p:spTree")
{
CP_XML_STREAM() << strmData_.str();
CP_XML_STREAM() << strmData_.rdbuf();
}
}
CP_XML_NODE(L"p:clrMapOvr")
@ -563,11 +563,11 @@ void pptx_xml_slideNotesMaster::write_to(std::wostream & strm)
CP_XML_NODE(L"p:cSld")
{
CP_XML_STREAM() << strmBackground_.str();
CP_XML_STREAM() << strmBackground_.rdbuf();
CP_XML_NODE(L"p:spTree")
{
CP_XML_STREAM() << strmData_.str();
CP_XML_STREAM() << strmData_.rdbuf();
}
}
CP_XML_NODE(L"p:clrMap")

View File

@ -33,9 +33,9 @@
#include "xlsx_defined_names.h"
#include <vector>
#include "../../include/xml/simple_xml_writer.h"
#include "../../formulasconvert/formulasconvert.h"
#include "../../include/xml/simple_xml_writer.h"
namespace cpdoccore {
namespace oox {
@ -75,7 +75,7 @@ public:
{
CP_XML_NODE(L"definedName")
{
CP_XML_ATTR(L"name", content_[i].name);
CP_XML_ATTR(L"name", XmlUtils::EncodeXmlString(content_[i].name));
if (content_[i].tableId >= 0)
{
@ -84,11 +84,11 @@ public:
if ( content_[i].ref.find(L"#REF!") != std::wstring::npos )
{
CP_XML_ATTR(L"comment", content_[i].ref);
CP_XML_ATTR(L"comment", XmlUtils::EncodeXmlString(content_[i].ref));
CP_XML_CONTENT(L"#REF!");
}
else
CP_XML_CONTENT(content_[i].ref);
CP_XML_CONTENT(XmlUtils::EncodeXmlString(content_[i].ref));
}
}

View File

@ -45,6 +45,29 @@ public:
std::wstring name_;
bool hidden_;
void clear()
{
cols_.clear();
sheetFormat_.clear();
sheetData_.clear();
mergeCells_.clear();
hyperlinks_.clear();
comments_.clear();
sort_.clear();
tableParts_.clear();
autofilter_.clear();
conditionalFormatting_.clear();
picture_background_.clear();
dataValidations_.clear();
dataValidationsX14_.clear();
ole_objects_.clear();
page_props_.clear();
header_footer_.clear();
controls_.clear();
protection_.clear();
breaks_.clear();
}
std::wstringstream cols_;
std::wstringstream sheetFormat_;
std::wstringstream sheetData_;
@ -196,43 +219,44 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
CP_XML_ATTR(L"mc:Ignorable",L"x14ac");
CP_XML_ATTR(L"xmlns:x14ac", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac");
CP_XML_STREAM() << impl_->sheetFormat_.str();
CP_XML_STREAM() << impl_->sheetFormat_.rdbuf();
CP_XML_STREAM() << impl_->cols_.str();
CP_XML_STREAM() << impl_->cols_.rdbuf();
CP_XML_NODE(L"sheetData")
{
CP_XML_STREAM() << impl_->sheetData_.str();
impl_->sheetData_.flush();
CP_XML_STREAM() << impl_->sheetData_.rdbuf();
}
if (!impl_->protection_.str().empty())
{
CP_XML_STREAM() << impl_->protection_.str();
CP_XML_STREAM() << impl_->protection_.rdbuf();
}
//оказывается порядок нахождения элементов важен !!! (для office 2010)
//объединенные ячейки раньше чем гиперлинки !!!
CP_XML_STREAM() << impl_->autofilter_.str(); //автофильтры перед merge !!!
CP_XML_STREAM() << impl_->autofilter_.rdbuf(); //автофильтры перед merge !!!
CP_XML_STREAM() << impl_->mergeCells_.str();
CP_XML_STREAM() << impl_->mergeCells_.rdbuf();
CP_XML_STREAM() << impl_->sort_.str();
CP_XML_STREAM() << impl_->sort_.rdbuf();
CP_XML_STREAM() << impl_->conditionalFormatting_.str();
CP_XML_STREAM() << impl_->conditionalFormatting_.rdbuf();
CP_XML_STREAM() << impl_->dataValidations_.str();
CP_XML_STREAM() << impl_->dataValidations_.rdbuf();
if (!impl_->hyperlinks_.str().empty())
{
CP_XML_NODE(L"hyperlinks")
{
CP_XML_STREAM() << impl_->hyperlinks_.str();
CP_XML_STREAM() << impl_->hyperlinks_.rdbuf();
}
}
CP_XML_STREAM() << impl_->page_props_.str();
CP_XML_STREAM() << impl_->page_props_.rdbuf();
//props выше legacyDrawing !!
CP_XML_STREAM() << impl_->header_footer_.str();
CP_XML_STREAM() << impl_->header_footer_.rdbuf();
CP_XML_STREAM() << impl_->breaks_.str();
CP_XML_STREAM() << impl_->breaks_.rdbuf();
if (false == impl_->drawingId_.empty())
{
@ -252,21 +276,21 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
{
CP_XML_NODE(L"oleObjects")
{
CP_XML_STREAM() << impl_->ole_objects_.str();
CP_XML_STREAM() << impl_->ole_objects_.rdbuf();
}
}
if (false == impl_->controls_.str().empty())
{
CP_XML_NODE(L"controls")
{
CP_XML_STREAM() << impl_->controls_.str();
CP_XML_STREAM() << impl_->controls_.rdbuf();
}
}
if (false == impl_->tableParts_.str().empty())
{
CP_XML_NODE(L"tableParts")
{
CP_XML_STREAM() << impl_->tableParts_.str();
CP_XML_STREAM() << impl_->tableParts_.rdbuf();
}
}
CP_XML_STREAM() << impl_->picture_background_.str();
@ -280,12 +304,13 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
CP_XML_ATTR(L"uri", L"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}");
CP_XML_ATTR(L"xmlns:x14", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
CP_XML_STREAM() << impl_->dataValidationsX14_.str();
CP_XML_STREAM() << impl_->dataValidationsX14_.rdbuf();
}
}
}
}
}
impl_->clear();
}
void xlsx_xml_worksheet::set_drawing_link(std::wstring const & fileName, std::wstring const & id)

View File

@ -173,7 +173,7 @@ void sheets_files::write(const std::wstring & RootPath)
//item->get_rel_file()->write(path.string<std::wstring>());
package::simple_element(fileName, item->str()).write(path);
package::simple_element(fileName, item->content().str()).write(path);
}
}
//--------------------------------------------------------------------------------------------
@ -375,7 +375,7 @@ void xl_pivot_cache_files::write(const std::wstring & RootPath)
contentTypes->add_override(std::wstring(L"/xl/pivotCache/") + fileNameD, kWSConTypeD);
package::simple_element(fileNameD, pivot_caches_[i]->str_d()).write(path);
package::simple_element(fileNameD, pivot_caches_[i]->definitions().str()).write(path);
if (pivot_caches_[i]->get_rels().empty() == false)
{
@ -392,7 +392,7 @@ void xl_pivot_cache_files::write(const std::wstring & RootPath)
const std::wstring fileRef = std::wstring(L"pivotCache/") + fileNameD;
rels_->add(id, kWSRel, fileRef);
}
std::wstring content_records = pivot_caches_[i]->str_r();
std::wstring content_records = pivot_caches_[i]->records().str();
if (!content_records.empty())
{
const std::wstring fileNameR = std::wstring(L"pivotCacheRecords") + std::to_wstring(i + 1) + L".xml";

View File

@ -57,13 +57,11 @@ class sheet_content : noncopyable
{
public:
sheet_content();
std::wostream & content() { return content_; }
std::wstringstream & content() { return content_; }
void add_rel(relationship const & r);
void add_rels(rels & r);
rels_file_ptr get_rel_file() { return rels_; }
std::wstring str() { return content_.str(); }
static _CP_PTR(sheet_content) create();
private:
std::wstringstream content_;
rels_file_ptr rels_;
@ -79,13 +77,10 @@ public:
pivot_cache_content();
static _CP_PTR(pivot_cache_content) create();
std::wostream & definitions() { return definitions_; }
std::wostream & records() { return records_; }
std::wstringstream & definitions() { return definitions_; }
std::wstringstream & records() { return records_; }
rels & get_rels() { return definitions_rels_file_->get_rels(); }
std::wstring str_d() { return definitions_.str(); }
std::wstring str_r() { return records_.str(); }
friend class xl_pivot_cache_files;
private:
std::wstringstream records_;

View File

@ -236,20 +236,20 @@ double convertTime(int hours, int minutes, double sec)
return v;
}
bool parseDate(const std::wstring & Date, int & Year, int & Month, int & Day)
bool parseDateTime(const std::wstring & DateTime, int & Year, int & Month, int & Day,
_CP_OPT(int) & Hours, _CP_OPT(int) & Minutes, _CP_OPT(int) & Sec)
{
// for example, "1899-12-31T05:37:46.665696"
try
{
boost::wregex r(L"([\\d]+)-([\\d]+)-([\\d]+)(?:T([\\d]+):([\\d]+):([\\d]+)(?:\\.([\\d]+))?)?");
boost::match_results<std::wstring::const_iterator> res;
if (boost::regex_match(Date, res, r))
if (boost::regex_match(DateTime, res, r))
{
Year = boost::lexical_cast<int>(res[1].str());
Month = boost::lexical_cast<int>(res[2].str());
Day = boost::lexical_cast<int>(res[3].str());
int Hours, Minutes, Sec, FSec;
if (res[4].matched)
Hours = boost::lexical_cast<int>(res[4].str());
@ -260,7 +260,7 @@ bool parseDate(const std::wstring & Date, int & Year, int & Month, int & Day)
Sec = boost::lexical_cast<int>(res[6].str());
if (res[7].matched)
FSec = boost::lexical_cast<int>(res[7].str());
int FSec = boost::lexical_cast<int>(res[7].str());
return true;
}

View File

@ -33,7 +33,7 @@
#include <string>
#include <boost/cstdint.hpp>
#include "../../include/CPOptional.h"
#include "xlsx_cell_format.h"
namespace cpdoccore {
@ -57,9 +57,7 @@ bool parseBoolVal(const std::wstring & str);
std::wstring cellType2Str(XlsxCellType::type type);
bool parseDate(const std::wstring & Date, int & Year, int & Month, int & Day);
bool parseDateTime(const std::wstring & DateTime, int & Y, int & M, int & D, _CP_OPT(int) & H, _CP_OPT(int) & Min, _CP_OPT(int) & S);
bool parseTime(const std::wstring & Time, int & Hours, int & Minutes, double & seconds);
boost::int64_t convertDate(int Year, int Month, int Day);
double convertTime(int hours, int minutes, double sec);

View File

@ -192,7 +192,7 @@ void xlsx_conversion_context::end_document()
{
CP_XML_NODE(L"sheet")
{
CP_XML_ATTR(L"name", sheet->name()); // office 2010 ! ограничение на длину имени !!!
CP_XML_ATTR(L"name", XmlUtils::EncodeXmlString(sheet->name())); // office 2010 ! ограничение на длину имени !!!
CP_XML_ATTR(L"sheetId", i + 1);
CP_XML_ATTR(L"state", sheet->hidden() ? L"hidden" : L"visible");
CP_XML_ATTR(L"r:id", id);
@ -252,7 +252,7 @@ void xlsx_conversion_context::end_document()
CP_XML_NODE(L"sheets")
{
CP_XML_STREAM() << workbook_content.str();
CP_XML_STREAM() << workbook_content.rdbuf();
}
if (false == mapExternalLink_.empty())
{

View File

@ -392,10 +392,10 @@ void common_xlink_attlist::apply_from(const common_xlink_attlist & Other)
}
void common_xlink_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"xlink:href", href_);
CP_XML_ATTR_OPT(L"xlink:type", type_);
CP_XML_ATTR_OPT(L"xlink:show", show_);
CP_XML_ATTR_OPT(L"xlink:actuate", actuate_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"xlink:href", href_);
CP_XML_ATTR_OPT(L"xlink:type", type_);
CP_XML_ATTR_OPT(L"xlink:show", show_);
CP_XML_ATTR_OPT(L"xlink:actuate", actuate_);
}
//////////////////////////////////////////////////////////////////////////////////////////////////
@ -444,7 +444,7 @@ void common_value_and_type_attlist::serialize(CP_ATTR_NODE)
CP_XML_ATTR_OPT(L"office:date-value", office_date_value_);
CP_XML_ATTR_OPT(L"office:time-value", office_time_value_);
CP_XML_ATTR_OPT(L"office:boolean-value", office_boolean_value_);
CP_XML_ATTR_OPT(L"office:string-value", office_string_value_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"office:string-value", office_string_value_);
}
//////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -175,7 +175,7 @@ void office_annotation::xlsx_convert(oox::xlsx_conversion_context & Context)
{
author = xml::utils::replace_text_to_xml(dynamic_cast<dc_creator * >(dc_creator_.get())->content_);
}
int col = Context.current_table_column() + 1; if (col < 0) col = 0;
int col = Context.current_table_column(); if (col < 0) col = 0;
int row = Context.current_table_row(); if (row < 0) row = 0;
std::wstring ref = oox::getCellAddress(col, row);

View File

@ -241,18 +241,25 @@ void style_table_column_properties::docx_convert(oox::docx_conversion_context &
double width = 0.5 + 20.0 * attlist_.style_column_width_->get_value_unit(length::pt) * kf_max_width_ms;
Context.get_table_context().add_column_width(width);
strm << L"<w:gridCol w:w=\"" << (int)(width) << "\"/>";
if (width > 0)
strm << L"<w:gridCol w:w=\"" << (int)(width) << "\"/>";
else
strm << L"<w:gridCol/>";
}
else if ((attlist_.style_rel_column_width_) && (attlist_.style_rel_column_width_->get_unit() == length::rel))
{
double width = 0.5 + 20.0 * page_width * attlist_.style_rel_column_width_->get_value() / 65534.;
Context.get_table_context().add_column_width(width);
strm << L"<w:gridCol w:w=\"" << (int)(width) << "\"/>";
if (width > 0)
strm << L"<w:gridCol w:w=\"" << (int)(width) << "\"/>";
else
strm << L"<w:gridCol/>";
}
else
{
Context.get_table_context().add_column_width(0);
strm << L"<w:gridCol/>";
}
}

View File

@ -810,7 +810,7 @@ const wchar_t * table_content_validation::name = L"content-validation";
void table_content_validation::add_attributes(xml::attributes_wc_ptr const & Attributes)
{
CP_APPLY_ATTR(L"table:name", table_name_);
CP_APPLY_ATTR(L"table:name", table_name_);
CP_APPLY_ATTR(L"table:condition", table_condition_);
CP_APPLY_ATTR(L"table:display-list", table_display_list_);
CP_APPLY_ATTR(L"table:allowempty-cell", table_allowempty_cell_);

View File

@ -461,11 +461,7 @@ double pixToSize(double pixels, double maxDigitSize)
return (int(( pixels /*/ 0.75*/ - 5)/ maxDigitSize * 100. + 0.5)) /100. * 0.9; // * 9525. * 72.0 / (360000.0 * 2.54);
}
double cmToChars (double cm)
{
double pt = cm * 28.34467120181406;
return pt * 48. /(12.75 * 8.43 *2.);
}
}
void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context)
@ -552,8 +548,6 @@ void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context)
const double pixDpi = in_width * 96.;
width = pixToSize(pixDpi, Context.getMaxDigitSize().first);
//const double width = cmToChars(prop->attlist_.style_column_width_->get_value_unit(length::cm));
// see ECMA-376 page 1768
if (in_width > 0)
CP_XML_ATTR(L"width", *width);
@ -814,16 +808,29 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
if (attr.office_date_value_)
{
int y, m, d;
if (oox::parseDate(attr.office_date_value_.get(), y, m, d))
_CP_OPT(int) h, min, sec;
if (oox::parseDateTime(attr.office_date_value_.get(), y, m, d, h, min, sec))
{
boost::int64_t intDate = oox::convertDate(y, m, d);
_CP_OPT(double) dTime;
if (h && min)
{
dTime = oox::convertTime(*h, *min, sec.get_value_or(0));
}
if (intDate > 0)
{
number_val = boost::lexical_cast<std::wstring>(intDate);
if (dTime)
{
number_val = XmlUtils::DoubleToString(*dTime + intDate);
}
else
{
number_val = boost::lexical_cast<std::wstring>(intDate);
}
xlsx_value_type = oox::XlsxCellType::n;
if (num_format_type == office_value_type::Currency)
{//тип формата данных из стиля не соответствует формату анных ячейки
{//тип формата данных из стиля не соответствует формату данных ячейки
num_format.clear();
num_format_type = office_value_type::Date;
}
@ -1005,7 +1012,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
CP_XML_ATTR(L"t", L"array");
CP_XML_ATTR(L"aca", false);
}
CP_XML_CONTENT(xlsxFormula);
CP_XML_CONTENT(XmlUtils::EncodeXmlString(xlsxFormula));
}
}
}
@ -1155,12 +1162,26 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte
if (attr.office_date_value_)
{
int y, m, d;
if (oox::parseDate(attr.office_date_value_.get(), y, m, d))
_CP_OPT(int) h, min, s;
if (oox::parseDateTime(attr.office_date_value_.get(), y, m, d, h, min, s))
{
boost::int64_t intDate = oox::convertDate(y, m, d);
_CP_OPT(double) dTime;
if (h && min)
{
dTime = oox::convertTime(*h, *min, s.get_value_or(0));
}
if (intDate > 0)
{
number_val = boost::lexical_cast<std::wstring>(intDate);
if (dTime)
{
number_val = XmlUtils::DoubleToString(*dTime + intDate);
}
else
{
number_val = std::to_wstring(intDate);
}
}
else
{

View File

@ -365,6 +365,16 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context, _CP_OPT(std
}
for (size_t i = index; i < content_.size(); i++)
{
if (content_[i]->get_type() == typeTextP)
{//параграф в параграфе .... оО
p *para_inside = dynamic_cast<p*>(content_[i].get());
for (size_t j = 0; (para_inside) && (j < para_inside->paragraph_.content_.size()); ++j)
{
para_inside->paragraph_.content_[j]->docx_convert(Context);
}
continue;
}
if (Context.get_page_break())
{
if (Context.process_headers_footers_ == false)

View File

@ -81,6 +81,8 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<IncludePath>..\..\Common\3dParty\boost\build\win_32\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<LibraryPath>..\..\Common\3dParty\boost\build\win_32\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(Platform)\$(Configuration)\</OutDir>
@ -136,6 +138,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4311;4267;4996;4172;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)-static.lib</OutputFile>

View File

@ -81,6 +81,8 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<IncludePath>..\..\Common\3dParty\boost\build\win_32\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<LibraryPath>..\..\Common\3dParty\boost\build\win_32\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(Platform)\$(Configuration)\</OutDir>
@ -136,12 +138,14 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4311;4267;4996;4172;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName).lib</OutputFile>
</Lib>
<PostBuildEvent>
<Command>D:\WORK\VersionControl.exe $(ProjectDir)\ASCOfficeOdfFile\version.h</Command>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

View File

@ -81,6 +81,8 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<IncludePath>..\..\Common\3dParty\boost\build\win_32\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<LibraryPath>..\..\Common\3dParty\boost\build\win_32\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(Platform)\$(Configuration)\</OutDir>
@ -135,6 +137,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4311;4267;4996;4172;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName)-static.lib</OutputFile>

View File

@ -80,6 +80,8 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<IncludePath>..\..\Common\3dParty\boost\build\win_32\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
<LibraryPath>..\..\Common\3dParty\boost\build\win_32\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(Platform)\$(Configuration)\</OutDir>
@ -124,6 +126,7 @@
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4311;4267;4996;4172;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)$(ProjectName).lib</OutputFile>

View File

@ -41,9 +41,9 @@ class abstract_xml : public office_element_impl<abstract_xml>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = type_AbstractXml;
CPDOCCORE_DEFINE_VISITABLE()
public:
abstract_xml() {}

View File

@ -132,7 +132,7 @@ void anim_transition_filter_attlist::serialize(CP_ATTR_NODE)
}
void anim_audio_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"xlink:href", xlink_href_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"xlink:href", xlink_href_);
CP_XML_ATTR_OPT(L"anim:audio-level",anim_audio_level_);
}
const wchar_t * anim_transitionFilter::ns = L"anim";

View File

@ -49,9 +49,9 @@ class anim_par : public office_element_impl<anim_par>//Параллельные
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeAnimPar;
CPDOCCORE_DEFINE_VISITABLE();
odf_types::common_anim_smil_attlist attlist_;
office_element_ptr anim_par_;
@ -70,9 +70,8 @@ class anim_seq : public office_element_impl<anim_seq>//Последовател
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeAnimSeq;
CPDOCCORE_DEFINE_VISITABLE();
static const ElementType type = typeAnimSeq;
odf_types::common_anim_smil_attlist attlist_;
office_element_ptr_array anim_par_array_;
@ -112,9 +111,9 @@ class anim_transitionFilter : public office_element_impl<anim_transitionFilter>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeAnimTransitionFilter;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}
@ -131,9 +130,9 @@ class anim_audio : public office_element_impl<anim_audio>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeAnimAudio;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}

View File

@ -56,9 +56,9 @@ void calcext_icon_set_attr::serialize(CP_ATTR_NODE)
}
void calcext_condition_attr::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"calcext:base-cell-address", calcext_base_cell_address_);
CP_XML_ATTR_OPT(L"calcext:apply-style-name", calcext_apply_style_name_);
CP_XML_ATTR_OPT(L"calcext:value", calcext_value_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"calcext:base-cell-address", calcext_base_cell_address_);
CP_XML_ATTR_OPT(L"calcext:apply-style-name", calcext_apply_style_name_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"calcext:value", calcext_value_);
}
void calcext_date_is_attr::serialize(CP_ATTR_NODE)
{
@ -216,7 +216,7 @@ void calcext_formatting_entry::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"calcext:value",calcext_value_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"calcext:value",calcext_value_);
CP_XML_ATTR_OPT(L"calcext:type", calcext_type_);
}
}
@ -233,7 +233,7 @@ void calcext_color_scale_entry::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"calcext:value", calcext_value_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"calcext:value", calcext_value_);
CP_XML_ATTR_OPT(L"calcext:type", calcext_type_);
CP_XML_ATTR_OPT(L"calcext:color", calcext_color_);
}

View File

@ -94,9 +94,9 @@ class calcext_color_scale_entry : public office_element_impl<calcext_color_scale
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextColorScaleEntry;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -116,9 +116,9 @@ class calcext_formatting_entry : public office_element_impl<calcext_formatting_e
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextFormattingEntry;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -137,9 +137,9 @@ class calcext_icon_set : public office_element_impl<calcext_icon_set>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextIconSet;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -158,9 +158,9 @@ class calcext_data_bar: public office_element_impl<calcext_data_bar>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextDataBar;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -178,9 +178,9 @@ class calcext_color_scale: public office_element_impl<calcext_color_scale>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextColorScale;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -197,9 +197,9 @@ class calcext_date_is: public office_element_impl<calcext_date_is>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextDateIs;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -216,9 +216,9 @@ class calcext_condition: public office_element_impl<calcext_condition>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextCondition;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -235,9 +235,9 @@ class calcext_conditional_format: public office_element_impl<calcext_conditional
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextConditionalFormat;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -258,9 +258,9 @@ class calcext_conditional_formats: public office_element_impl<calcext_conditiona
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeCalcextConditionalFormats;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -38,11 +38,6 @@
#include <boost/algorithm/string.hpp>
#include <xml/xmlchar.h>
#include <xml/attributes.h>
#include "odf_conversion_context.h"
namespace cpdoccore {

View File

@ -48,10 +48,8 @@ class draw_base : public office_element_impl<draw_base>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawBase;
CPDOCCORE_DEFINE_VISITABLE()
static const ElementType type = typeDrawBase;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -62,7 +60,6 @@ public:
odf_types::union_common_draw_attlists common_draw_attlists_;
office_element_ptr_array content_;
};
}

View File

@ -67,9 +67,9 @@ class draw_image : public office_element_impl<draw_image>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawImage;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -93,9 +93,9 @@ class draw_chart : public office_element_impl<draw_chart>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawChart;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -118,9 +118,7 @@ class draw_frame : public draw_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawFrame;
CPDOCCORE_DEFINE_VISITABLE()
static const ElementType type = typeDrawFrame;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -148,9 +146,9 @@ class draw_g : public office_element_impl<draw_g>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawG;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -183,9 +181,9 @@ class draw_text_box : public office_element_impl<draw_text_box>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawTextBox;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -204,9 +202,9 @@ class draw_object : public office_element_impl<draw_object>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawObject;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -225,9 +223,9 @@ class draw_object_ole : public office_element_impl<draw_object>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawObjectOle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -246,9 +244,9 @@ class draw_plugin : public office_element_impl<draw_plugin>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawPlugin;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -68,9 +68,9 @@ class draw_page : public office_element_impl<draw_page>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDrawPage;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -91,9 +91,9 @@ class presentation_footer_decl : public office_element_impl<presentation_footer_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typePresentationFooterDecl;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -112,9 +112,9 @@ class presentation_date_time_decl : public office_element_impl<presentation_date
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typePresentationDateTimeDecl;
CPDOCCORE_DEFINE_VISITABLE();
_CP_OPT(std::wstring) presentation_name_;
_CP_OPT(std::wstring) presentation_source_;
@ -134,9 +134,9 @@ class presentation_notes : public office_element_impl<presentation_notes>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typePresentationNotes;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -46,7 +46,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawShape;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
virtual void serialize_attlist(CP_ATTR_NODE);
@ -56,7 +56,7 @@ public:
_CP_OPT(std::wstring) draw_id_;//используется для анимашек
CPDOCCORE_DEFINE_VISITABLE();
int sub_type_;
@ -79,7 +79,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawRect;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
@ -104,7 +104,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawEllipse;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
@ -120,7 +120,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawCircle;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
};
@ -146,7 +146,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawLine;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
@ -172,7 +172,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawPath;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
@ -199,7 +199,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawPolygon;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
@ -219,7 +219,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawCustomShape;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
virtual void add_child_element( const office_element_ptr & child_element);
@ -248,8 +248,8 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawEquation;
static const xml::NodeType xml_type = xml::typeElement;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -294,8 +294,8 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawHandle;
static const xml::NodeType xml_type = xml::typeElement;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -340,7 +340,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawEnhancedGeometry;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -361,7 +361,7 @@ public:
static int parsing(_CP_OPT(std::wstring) val);//todoooo наоборот
CPDOCCORE_DEFINE_VISITABLE();
};
CP_REGISTER_OFFICE_ELEMENT2(draw_enhanced_geometry);
@ -375,7 +375,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawCaption;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
};
@ -399,7 +399,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawConnector;
static const xml::NodeType xml_type = xml::typeElement;
virtual void serialize(std::wostream & _Wostream);
@ -418,7 +418,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawControl;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -442,7 +442,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDr3dScene;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -462,7 +462,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDr3dExtrude;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -479,7 +479,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDr3dRotate;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -494,9 +494,9 @@ class dr3d_light : public office_element_impl<dr3d_light>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDr3dLight;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -519,7 +519,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDr3dCube;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -541,7 +541,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeDr3dSphere;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -564,8 +564,8 @@ public:
static const wchar_t * name;
static const ElementType type = typeDrawA;
static const xml::NodeType xml_type = xml::typeElement;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -71,9 +71,9 @@ class style_header_footer_properties : public office_element_impl<style_header_f
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleHeaderFooterProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child)

View File

@ -45,9 +45,9 @@ class text_number : public office_element_impl<text_number>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextNumber;
CPDOCCORE_DEFINE_VISITABLE()
public:
text_number() {}
@ -74,9 +74,9 @@ class text_list_item : public office_element_impl<text_list_item>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListItem;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -110,9 +110,9 @@ class text_list_header : public office_element_impl<text_list_header>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListHeader;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -41,10 +41,10 @@ class math_mstack : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMStack;
CPDOCCORE_DEFINE_VISITABLE();
private:
@ -65,10 +65,10 @@ class math_msrow : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSRow;
CPDOCCORE_DEFINE_VISITABLE();
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -88,10 +88,10 @@ class math_msline : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSLine;
CPDOCCORE_DEFINE_VISITABLE();
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -111,10 +111,10 @@ class math_mlongdiv : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSLongDiv;
CPDOCCORE_DEFINE_VISITABLE();
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -134,10 +134,10 @@ class math_mscarries : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSCarries;
CPDOCCORE_DEFINE_VISITABLE();
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -156,10 +156,10 @@ class math_msgroup : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSGroup;
CPDOCCORE_DEFINE_VISITABLE();
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -179,11 +179,11 @@ class math_mscarry : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSCarry;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element(const office_element_ptr & child_element);

View File

@ -52,7 +52,7 @@ public:
static const wchar_t * name;
static const ElementType type = typeMathElement;
static const xml::NodeType xml_type = xml::typeElement;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name) {}
virtual void add_child_element(const office_element_ptr & child_element) {}
@ -60,8 +60,8 @@ public:
virtual void serialize(std::wostream & _Wostream) {}
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
friend class odf_document;
};
@ -72,10 +72,10 @@ class office_math : public office_element_impl<office_math>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMath;
CPDOCCORE_DEFINE_VISITABLE();
friend class odf_document;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -94,11 +94,11 @@ class math_semantics : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMathSemantics;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element(const office_element_ptr & child_element);
@ -116,14 +116,12 @@ class math_annotation : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMathAnnotation;
_CP_OPT(std::wstring) encoding_;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element(const office_element_ptr & child_element);
@ -144,11 +142,11 @@ class math_annotation_xml : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMathAnnotationXml;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element(const office_element_ptr & child_element);

View File

@ -49,13 +49,13 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMRow;
math_mrow();
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -73,11 +73,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMFrac;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
_CP_OPT(Bool) bevelled;
private:
@ -99,11 +99,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSqrt;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -120,11 +120,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMRoot;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -141,11 +141,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMStyle;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
_CP_OPT(color) color_;
@ -169,10 +169,10 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMEnClose;
CPDOCCORE_DEFINE_VISITABLE();
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -189,11 +189,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMFenced;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -210,11 +210,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMPadded;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);

View File

@ -43,11 +43,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSub;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -65,11 +65,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSup;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -88,11 +88,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSubSup;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -109,11 +109,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMNone;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -132,11 +132,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMPreScripts;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -151,11 +151,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMMultiScripts;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -174,11 +174,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMUnderOver;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -195,11 +195,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMOver;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
_CP_OPT(Bool) accent;
private:
@ -217,11 +217,11 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMUnder;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);

View File

@ -41,11 +41,11 @@ class math_mtable : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMTable;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -64,11 +64,11 @@ class math_malignmark : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMAlignMark;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -87,11 +87,11 @@ class math_maligngroup : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMAlignGroup;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -110,11 +110,11 @@ class math_mtd : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMTd;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -133,11 +133,11 @@ class math_mlabeledtr : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMLabelEdTr;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -156,11 +156,11 @@ class math_mtr : public office_math_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMTr;
CPDOCCORE_DEFINE_VISITABLE();
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);

View File

@ -44,7 +44,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMI;
private:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -68,7 +68,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMO;
_CP_OPT(Bool) accent_;
@ -97,7 +97,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMN;
@ -123,7 +123,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMText;
@ -149,7 +149,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMSpace;
@ -173,7 +173,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMS;
@ -197,7 +197,7 @@ namespace cpdoccore {
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeMGlyph;

View File

@ -49,6 +49,9 @@ namespace cpdoccore {
using namespace odf_types;
namespace odf_writer {
const wchar_t * number_style_base::ns = L"number";
const wchar_t * number_style_base::name = L"base-style";
std::wstring number_style_base::get_style_name() const
{

View File

@ -43,12 +43,13 @@
namespace cpdoccore {
namespace odf_writer {
class number_style_base : public office_element
class number_style_base : public office_element_impl<number_style_base>
{
public:
CPDOCCORE_DEFINE_VISITABLE()
static const wchar_t * ns;
static const wchar_t * name;
static const ElementType type = typeNumberBaseStyle;
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -71,10 +72,10 @@ class number_number_style : public number_style_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberNumberStyle;
CPDOCCORE_DEFINE_VISITABLE()
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
virtual void serialize(std::wostream & strm);
@ -87,10 +88,10 @@ class number_currency_style : public number_style_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberCurrencyStyle;
CPDOCCORE_DEFINE_VISITABLE()
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
virtual void serialize(std::wostream & strm);
};
@ -102,10 +103,10 @@ class number_text_style : public number_style_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberTextStyle;
CPDOCCORE_DEFINE_VISITABLE()
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
virtual void serialize(std::wostream & strm);
};
@ -117,10 +118,10 @@ class number_date_style : public number_style_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberDataStyle;
CPDOCCORE_DEFINE_VISITABLE()
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
virtual void serialize(std::wostream & strm);
@ -134,10 +135,8 @@ class number_percentage_style : public number_style_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberPercentageStyle;
CPDOCCORE_DEFINE_VISITABLE()
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
virtual void serialize(std::wostream & strm);
};
@ -149,11 +148,9 @@ class number_time_style : public number_style_base
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberTimeStyle;
CPDOCCORE_DEFINE_VISITABLE()
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
static const ElementType type = typeNumberTimeStyle;
_CP_OPT(bool) number_automatic_order_;
virtual void serialize(std::wostream & strm);
@ -166,9 +163,9 @@ class number_text : public office_element_impl<number_text>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberText;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
@ -187,9 +184,9 @@ class number_number : public office_element_impl<number_number>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberNumber;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -215,9 +212,9 @@ class number_embedded_text : public office_element_impl<number_embedded_text>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberEmbeddedText;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -236,9 +233,9 @@ class number_scientific_number : public office_element_impl<number_scientific_nu
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberScientificNumber;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -263,9 +260,9 @@ class number_currency_symbol : public office_element_impl<number_currency_symbol
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberCurrencySymbol;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -286,9 +283,9 @@ class number_text_content : public office_element_impl<number_text_content>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberTextContent;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
@ -306,9 +303,9 @@ class number_day_of_week : public office_element_impl<number_day_of_week>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberDayOfWeek;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -324,9 +321,9 @@ class number_quarter : public office_element_impl<number_quarter>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberQuarter;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -342,9 +339,9 @@ class number_day : public office_element_impl<number_day>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberDay;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -361,9 +358,9 @@ class number_month : public office_element_impl<number_month>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberMonth;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -381,9 +378,9 @@ class number_year : public office_element_impl<number_year>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberYear;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -399,9 +396,9 @@ class number_hours : public office_element_impl<number_hours>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberHours;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -417,9 +414,9 @@ class number_minutes : public office_element_impl<number_minutes>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberMinutes;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -435,9 +432,9 @@ class number_seconds : public office_element_impl<number_seconds>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberSeconds;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -454,9 +451,9 @@ class number_am_pm : public office_element_impl<number_am_pm>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberAmPm;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);
@ -469,9 +466,9 @@ class number_fraction : public office_element_impl<number_fraction>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeNumberFraction;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void serialize(std::wostream & strm);

View File

@ -49,14 +49,200 @@ namespace odf_writer
{
namespace package
{
std::string GetUtf8StringFromUnicode_4bytes(const wchar_t* pUnicodes, size_t lCount)
{
std::string res;
res.resize(6 * lCount + 1);
BYTE* pData = (BYTE*)res.c_str();
BYTE* pCodesCur = pData;
const wchar_t* pEnd = pUnicodes + lCount;
const wchar_t* pCur = pUnicodes;
while (pCur < pEnd)
{
unsigned int code = (unsigned int)*pCur++;
if (code < 0x80)
{
*pCodesCur++ = (BYTE)code;
}
else if (code < 0x0800)
{
*pCodesCur++ = 0xC0 | (code >> 6);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x10000)
{
*pCodesCur++ = 0xE0 | (code >> 12);
*pCodesCur++ = 0x80 | (code >> 6 & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x1FFFFF)
{
*pCodesCur++ = 0xF0 | (code >> 18);
*pCodesCur++ = 0x80 | (code >> 12 & 0x3F);
*pCodesCur++ = 0x80 | (code >> 6 & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x3FFFFFF)
{
*pCodesCur++ = 0xF8 | (code >> 24);
*pCodesCur++ = 0x80 | (code >> 18 & 0x3F);
*pCodesCur++ = 0x80 | (code >> 12 & 0x3F);
*pCodesCur++ = 0x80 | (code >> 6 & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x7FFFFFFF)
{
*pCodesCur++ = 0xFC | (code >> 30);
*pCodesCur++ = 0x80 | (code >> 24 & 0x3F);
*pCodesCur++ = 0x80 | (code >> 18 & 0x3F);
*pCodesCur++ = 0x80 | (code >> 12 & 0x3F);
*pCodesCur++ = 0x80 | (code >> 6 & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
}
*pCodesCur++ = 0;
res.resize(pCodesCur - pData);
return res;
}
std::string GetUtf8StringFromUnicode_2bytes(const wchar_t* pUnicodes, size_t lCount)
{
std::string res;
res.resize(6 * lCount + 1);
BYTE* pData = (BYTE*)res.c_str();
BYTE* pCodesCur = pData;
const wchar_t* pEnd = pUnicodes + lCount;
const wchar_t* pCur = pUnicodes;
while (pCur < pEnd)
{
unsigned int code = (unsigned int)*pCur++;
if (code >= 0xD800 && code <= 0xDFFF && pCur < pEnd)
{
code = 0x10000 + (((code & 0x3FF) << 10) | (0x03FF & *pCur++));
}
if (code < 0x80)
{
*pCodesCur++ = (BYTE)code;
}
else if (code < 0x0800)
{
*pCodesCur++ = 0xC0 | (code >> 6);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x10000)
{
*pCodesCur++ = 0xE0 | (code >> 12);
*pCodesCur++ = 0x80 | ((code >> 6) & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x1FFFFF)
{
*pCodesCur++ = 0xF0 | (code >> 18);
*pCodesCur++ = 0x80 | ((code >> 12) & 0x3F);
*pCodesCur++ = 0x80 | ((code >> 6) & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x3FFFFFF)
{
*pCodesCur++ = 0xF8 | (code >> 24);
*pCodesCur++ = 0x80 | ((code >> 18) & 0x3F);
*pCodesCur++ = 0x80 | ((code >> 12) & 0x3F);
*pCodesCur++ = 0x80 | ((code >> 6) & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
else if (code < 0x7FFFFFFF)
{
*pCodesCur++ = 0xFC | (code >> 30);
*pCodesCur++ = 0x80 | ((code >> 24) & 0x3F);
*pCodesCur++ = 0x80 | ((code >> 18) & 0x3F);
*pCodesCur++ = 0x80 | ((code >> 12) & 0x3F);
*pCodesCur++ = 0x80 | ((code >> 6) & 0x3F);
*pCodesCur++ = 0x80 | (code & 0x3F);
}
}
*pCodesCur = 0;
res.resize(pCodesCur - pData);
return res;
}
std::string GetUtf8StringFromUnicode(const wchar_t* pUnicodes, size_t lCount)
{
if (sizeof(WCHAR) == 2)
{
return GetUtf8StringFromUnicode_2bytes(pUnicodes, lCount);
}
else
{
return GetUtf8StringFromUnicode_4bytes(pUnicodes, lCount);
}
}
simple_element::simple_element(const std::wstring & FileName, const std::wstring & Content, bool utf8) : file_name_(FileName), utf8_(utf8)
{
if (utf8_)
{
content_utf8_ = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(Content);
if (Content.length() > 10 * 1024 * 1024)
{
size_t pos = 0;
while (pos < Content.length())
{
size_t sz = 2 * 1024 * 1024;
if (sz + pos > Content.length())
sz = Content.length() - pos;
if (sz < 1)
break;
content_utf8_ += GetUtf8StringFromUnicode(Content.c_str() + pos, sz);
pos += sz;
}
}
else
content_utf8_ = GetUtf8StringFromUnicode(Content.c_str(), Content.length());
}else
content_utf8_ = std::string( Content.begin(), Content.end());
}
simple_element::simple_element(const std::wstring & FileName, wchar_t* Content, size_t Size, bool utf8)
{
if (utf8_)
{
if (Size > 10 * 1024 * 1024)
{
size_t pos = 0;
while (pos < Size)
{
size_t sz = 2 * 1024 * 1024;
if (sz + pos > Size)
sz = Size - pos;
if (sz < 1)
break;
content_utf8_ += GetUtf8StringFromUnicode(Content + pos, sz);
pos += sz;
}
}
else
content_utf8_ = GetUtf8StringFromUnicode(Content, Size);
}
else
{
std::wstring str(Content, Size);
content_utf8_ = std::string(str.begin(), str.end());
}
}
simple_element::simple_element(const std::wstring & FileName, std::basic_stringbuf<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>> & streambuf, size_t Size, bool utf8)
{
}
simple_element::simple_element(const std::wstring & FileName, const std::string & Content) : file_name_(FileName), utf8_(false), content_utf8_(Content)
{
}
@ -361,9 +547,11 @@ namespace odf_writer
{
if (false == bXmlRootNodeWrite)
{
if (content)
if (content_)
{
simple_element elm(L"content.xml", content->content_str());
simple_element elm(L"content.xml", content_->content_str());
content_.reset();
elm.write(RootPath, add_padding);
}
}
@ -375,46 +563,6 @@ namespace odf_writer
{
CP_XML_NODE(L"office:document-content")
{
//CP_XML_ATTR(L"xmlns:office", L"urn:oasis:names:tc:opendocument:xmlns:office:1.0" );
//CP_XML_ATTR(L"xmlns:style", L"urn:oasis:names:tc:opendocument:xmlns:style:1.0" );
//CP_XML_ATTR(L"xmlns:text", L"urn:oasis:names:tc:opendocument:xmlns:text:1.0" );
//CP_XML_ATTR(L"xmlns:table", L"urn:oasis:names:tc:opendocument:xmlns:table:1.0" );
//CP_XML_ATTR(L"xmlns:draw", L"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" );
//CP_XML_ATTR(L"xmlns:fo", L"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" );
//CP_XML_ATTR(L"xmlns:xlink", L"http://www.w3.org/1999/xlink" );
//CP_XML_ATTR(L"xmlns:dc", L"http://purl.org/dc/elements/1.1/" );
//CP_XML_ATTR(L"xmlns:meta", L"urn:oasis:names:tc:opendocument:xmlns:meta:1.0" );
//CP_XML_ATTR(L"xmlns:number", L"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" );
//CP_XML_ATTR(L"xmlns:presentation", L"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" );
//CP_XML_ATTR(L"xmlns:svg", L"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
//CP_XML_ATTR(L"xmlns:chart", L"urn:oasis:names:tc:opendocument:xmlns:chart:1.0" );
//CP_XML_ATTR(L"xmlns:dr3d", L"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" );
//CP_XML_ATTR(L"xmlns:math", L"http://www.w3.org/1998/Math/MathML" );
//CP_XML_ATTR(L"xmlns:form", L"urn:oasis:names:tc:opendocument:xmlns:form:1.0" );
//CP_XML_ATTR(L"xmlns:script", L"urn:oasis:names:tc:opendocument:xmlns:script:1.0" );
//CP_XML_ATTR(L"xmlns:ooo", L"http://openoffice.org/2004/office" );
//CP_XML_ATTR(L"xmlns:ooow", L"http://openoffice.org/2004/writer" );
//CP_XML_ATTR(L"xmlns:oooc", L"http://openoffice.org/2004/calc" );
//CP_XML_ATTR(L"xmlns:dom", L"http://www.w3.org/2001/xml-events" );
//CP_XML_ATTR(L"xmlns:xforms", L"http://www.w3.org/2002/xforms");
//CP_XML_ATTR(L"xmlns:xsd", L"http://www.w3.org/2001/XMLSchema" );
//CP_XML_ATTR(L"xmlns:xsi", L"http://www.w3.org/2001/XMLSchema-instance" );
//CP_XML_ATTR(L"xmlns:rpt", L"http://openoffice.org/2005/report" );
//CP_XML_ATTR(L"xmlns:of", L"urn:oasis:names:tc:opendocument:xmlns:of:1.2" );
//CP_XML_ATTR(L"xmlns:xhtml", L"http://www.w3.org/1999/xhtml" );
//CP_XML_ATTR(L"xmlns:grddl", L"http://www.w3.org/2003/g/data-view#" );
//CP_XML_ATTR(L"xmlns:officeooo", L"http://openoffice.org/2009/office" );
//CP_XML_ATTR(L"xmlns:textooo", L"http://openoffice.org/2013/office" );
//CP_XML_ATTR(L"xmlns:tableooo", L"http://openoffice.org/2009/table" );
//CP_XML_ATTR(L"xmlns:drawooo", L"http://openoffice.org/2010/draw" );
//CP_XML_ATTR(L"xmlns:chartooo", L"http://openoffice.org/2010/chart" );
//CP_XML_ATTR(L"xmlns:smil", L"urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0");
//CP_XML_ATTR(L"xmlns:anim", L"urn:oasis:names:tc:opendocument:xmlns:animation:1.0" );
//CP_XML_ATTR(L"xmlns:calcext", L"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" );
//CP_XML_ATTR(L"xmlns:field", L"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" );
//CP_XML_ATTR(L"xmlns:formx", L"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" );
//CP_XML_ATTR(L"xmlns:loext", L"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" );
//CP_XML_ATTR(L"xmlns:css3t", L"http://www.w3.org/TR/css3-text/" );
CP_XML_ATTR(L"xmlns:meta", L"urn:oasis:names:tc:opendocument:xmlns:meta:1.0");
CP_XML_ATTR(L"xmlns:office", L"urn:oasis:names:tc:opendocument:xmlns:office:1.0");
CP_XML_ATTR(L"xmlns:draw", L"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0");
@ -457,19 +605,25 @@ namespace odf_writer
CP_XML_ATTR(L"office:version", L"1.2");
if (content)
if (content_)
{
CP_XML_STREAM() << content->styles_str();
content_->styles_.flush();
CP_XML_STREAM() << content_->styles_.rdbuf();
content_->styles_.clear();
}
CP_XML_NODE(L"office:body")
{
if (content)
if (content_)
{
CP_XML_STREAM() << content->content_str();
content_->content_.flush();
CP_XML_STREAM() << content_->content_.rdbuf();
content_->content_.clear();
}
}
}
}
resStream.flush();
simple_element elm(L"content.xml", resStream.str());
elm.write(RootPath, add_padding);
}
@ -525,12 +679,13 @@ namespace odf_writer
if (content_)
{
CP_XML_STREAM() << content_->str();
CP_XML_STREAM() << content_->content().rdbuf();
}
}
}
content_.reset();
simple_element elm(L"styles.xml", resStream.str());
elm.write(RootPath, add_padding);
}
@ -549,12 +704,13 @@ namespace odf_writer
if (content_)
{
CP_XML_STREAM() << content_->str();
CP_XML_STREAM() << content_->content().rdbuf();
}
}
}
content_.reset();
simple_element elm(L"settings.xml", resStream.str());
elm.write(RootPath, add_padding);
}

View File

@ -58,10 +58,8 @@ namespace odf_writer
{
public:
content_simple(){}
std::wostream & content() { return content_; }
std::wstring str() { return content_.str(); }
static _CP_PTR(content_simple) create();
std::wstringstream & content() { return content_;}
private:
std::wstringstream content_;
};
@ -72,6 +70,8 @@ namespace odf_writer
class content_content : noncopyable
{
public:
friend class content_file;
content_content(){}
std::wostream & content() { return content_; }
std::wostream & styles() { return styles_; }
@ -103,6 +103,10 @@ namespace odf_writer
simple_element(const std::wstring & FileName, const std::string & Content);
simple_element(const std::wstring & FileName, const std::wstring & Content, bool utf8 = true);
simple_element(const std::wstring & FileName, wchar_t* Content, size_t Size, bool utf8 = true);
simple_element(const std::wstring & FileName, std::basic_stringbuf<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>> & streambuf, size_t Size, bool utf8 = true);
static element_ptr create(const std::wstring & FileName, const std::wstring & Content, bool utf8 = true);
static element_ptr create(const std::wstring & FileName, const std::string & Content);
@ -126,10 +130,10 @@ namespace odf_writer
private:
bool bXmlRootNodeWrite = true;
public:
void set_content(content_content_ptr & c, bool bRootNode = true) { content = c; bXmlRootNodeWrite = bRootNode; }
void set_content(content_content_ptr & c, bool bRootNode = true) { content_ = c; bXmlRootNodeWrite = bRootNode; }
virtual void write(const std::wstring & RootPath, bool add_padding = false);
content_content_ptr content;
content_content_ptr content_;
};
class styles_file : public element

View File

@ -89,10 +89,18 @@ odf_conversion_context::odf_conversion_context(_office_type_document type_, pack
}
odf_conversion_context::~odf_conversion_context()
{
output_document_ = NULL;
if (applicationFonts_)
delete applicationFonts_;
for (size_t i = 0; i < objects_.size(); ++i)
{
if (objects_[i]) delete objects_[i];
objects_[i] = NULL;
}
objects_.clear();
}
void odf_conversion_context::set_fonts_directory(std::wstring pathFonts)
{
if (applicationFonts_)
@ -130,14 +138,14 @@ double odf_conversion_context::convert_symbol_width(double val)
odf_style_context* odf_conversion_context::styles_context()
{
if (!objects_.empty())
return objects_[current_object_].style_context.get();
return objects_[current_object_]->style_context.get();
else
return NULL;
}
odf_settings_context* odf_conversion_context::settings_context()
{
if (!objects_.empty())
return objects_[current_object_].settings_context.get();
return objects_[current_object_]->settings_context.get();
else
return NULL;
}
@ -159,22 +167,22 @@ odf_math_context* odf_conversion_context::math_context()
odf_number_styles_context* odf_conversion_context::numbers_styles_context()
{
if (objects_.size() > 0 && objects_[current_object_].style_context)
return &(objects_[current_object_].style_context->numbers_styles());
if (objects_.size() > 0 && objects_[current_object_]->style_context)
return &(objects_[current_object_]->style_context->numbers_styles());
else return NULL;
}
_mediaitems* odf_conversion_context::mediaitems()
{
return &objects_[current_object_].mediaitems;
return &objects_[current_object_]->mediaitems;
}
void odf_conversion_context::end_document()
{
rels rels_;
rels rels_;
for (size_t i = 0; i < objects_.size(); i++)
{
_object & object = objects_[i];
_object & object = *objects_[i];
bool isRoot = (i == 0 ? true : false);
if (object.content == NULL)continue;
@ -184,8 +192,8 @@ void odf_conversion_context::end_document()
package::content_content_ptr content_root_ = package::content_content::create();
if (objects_.back().scripts)
objects_.back().scripts->serialize(content_root_->styles());
if (objects_.back()->scripts)
objects_.back()->scripts->serialize(content_root_->styles());
object.content->serialize(content_root_->content());
@ -245,15 +253,13 @@ void odf_conversion_context::end_document()
output_document_->add_object(package::element_ptr(object_files), isRoot);
}
}
output_document_->set_rels(rels_);
}
void odf_conversion_context::start_chart()
{
create_object();
create_element(L"office", L"chart", objects_.back().content, this, true);
create_element(L"office", L"chart", objects_.back()->content, this, true);
chart_context_.set_styles_context(odf_conversion_context::styles_context());
chart_context_.start_chart(get_current_object_element());
@ -261,36 +267,39 @@ void odf_conversion_context::start_chart()
void odf_conversion_context::start_spreadsheet()
{
create_object();
create_element(L"office", L"spreadsheet", objects_.back().content, this, true);
create_element(L"office", L"spreadsheet", objects_.back()->content, this, true);
}
void odf_conversion_context::start_text()
{
create_object();
create_element(L"office", L"text", objects_.back().content, this, true);
create_element(L"office", L"text", objects_.back()->content, this, true);
}
void odf_conversion_context::start_presentation()
{
create_object();
create_element(L"office", L"presentation", objects_.back().content, this, true);
create_element(L"office", L"presentation", objects_.back()->content, this, true);
create_element(L"office", L"scripts", objects_.back().scripts, this);
create_element(L"office", L"scripts", objects_.back()->scripts, this);
}
void odf_conversion_context::create_object(bool bAddContentExt)
{
_object obj;
obj.content_ext = bAddContentExt;
obj.style_context = boost::make_shared<odf_style_context>();
obj.settings_context = boost::make_shared<odf_settings_context>();
obj.name = get_next_name_object();
obj.style_context->set_odf_context(this);
obj.settings_context->set_odf_context(this);
objects_.push_back(obj);
_object *obj = new _object();
current_object_ = objects_.size() - 1;
if (obj)
{
obj->content_ext = bAddContentExt;
obj->style_context = boost::make_shared<odf_style_context>();
obj->settings_context = boost::make_shared<odf_settings_context>();
obj->name = get_next_name_object();
obj->style_context->set_odf_context(this);
obj->settings_context->set_odf_context(this);
objects_.push_back(obj);
current_object_ = objects_.size() - 1;
}
}
void odf_conversion_context::end_chart()
{
@ -312,7 +321,7 @@ bool odf_conversion_context::start_math()
//имитация рисованного объекта - высота-ширина ????
create_object(false);
create_element(L"math", L"math", objects_.back().content, this, true);
create_element(L"math", L"math", objects_.back()->content, this, true);
math_context_.set_styles_context(odf_conversion_context::styles_context());
math_context_.start_math(get_current_object_element());
@ -368,7 +377,7 @@ office_element_ptr & odf_conversion_context::get_current_object_element()
create_object();
}
return objects_[current_object_].content;
return objects_[current_object_]->content;
}
std::wstring odf_conversion_context::get_next_name_object()
@ -535,13 +544,13 @@ void odf_conversion_context::add_font(const std::wstring& font_name)
{
if (objects_.empty())return;
if (objects_[current_object_].mapFonts.find(font_name) == objects_[current_object_].mapFonts.end())
if (objects_[current_object_]->mapFonts.find(font_name) == objects_[current_object_]->mapFonts.end())
{
objects_[current_object_].mapFonts.insert(std::make_pair(font_name, 1));
objects_[current_object_]->mapFonts.insert(std::make_pair(font_name, 1));
}
else
{
objects_[current_object_].mapFonts[font_name]++;
objects_[current_object_]->mapFonts[font_name]++;
}
}
}

View File

@ -165,7 +165,7 @@ private:
odf_element_state temporary_;
std::vector<_object> objects_;//"0" = root
std::vector<_object*> objects_;//"0" = root
odf_chart_context chart_context_;
odf_page_layout_context page_layout_context_;

View File

@ -425,7 +425,7 @@ office_element_ptr & odf_style_context::add_or_find(std::wstring name, style_fam
if (oox_id >= 0 && style_state_list_[i]->style_oox_id_ == oox_id)
return style_state_list_[i]->get_office_element();
if ((name.length() >=0 && style_state_list_[i]->odf_style_->get_name() == name)
if ((name.length() >= 0 && style_state_list_[i]->odf_style_->get_name() == name)
&& style_state_list_[i]->root_ == root) return style_state_list_[i]->get_office_element();
//во избежания имена генерим уникальные (в принципе для root и остальных - можно одинаковые)
}

View File

@ -160,9 +160,6 @@ ods_table_state::ods_table_state(odf_conversion_context * Context, office_elemen
defaut_row_height_ = 9;
defaut_column_width_ = 28.34467120181406 * 1.674;//
cells_size_ = 0;
}
void ods_table_state::set_table_name(std::wstring name)
@ -498,17 +495,17 @@ void ods_table_state::set_row_height(double height)
bool ods_table_state::is_cell_hyperlink()
{
if ( cells_size_ < 1 )return false;
if (cells_.empty())return false;
return cells_.back().hyperlink_idx >= 0 ? true : false;
}
bool ods_table_state::is_cell_comment()
{
if ( cells_size_ < 1 )return false;
if (cells_.empty())return false;
return cells_.back().comment_idx >= 0 ? true : false;
}
bool ods_table_state::is_cell_data_validation()
{
if ( cells_size_ < 1 ) return false;
if (cells_.empty()) return false;
return cells_.back().data_validation_name.empty() ? true : false;
}
int ods_table_state::is_cell_hyperlink(int col, int row)
@ -607,14 +604,14 @@ office_element_ptr & ods_table_state::current_row_element()
}
office_element_ptr & ods_table_state::current_cell_element()
{
if (cells_size_ > 0)
if (false == cells_.empty())
return cells_.back().elm;
else
throw;
}
ods_hyperlink_state & ods_table_state::current_hyperlink()
{
if ((cells_size_ > 0 && !hyperlinks_.empty()) && (cells_.back().hyperlink_idx >= 0) )
if ((false == cells_.empty() && !hyperlinks_.empty()) && (cells_.back().hyperlink_idx >= 0) )
{
return hyperlinks_[cells_.back().hyperlink_idx];
}
@ -657,7 +654,6 @@ void ods_table_state::start_cell(office_element_ptr & elm, office_element_ptr &
current_table_column_ += state.repeated;
cells_.push_back(state);
cells_size_++;
if (current_covered_cols_ > 0 && covered_cell)
current_covered_cols_--;
@ -665,7 +661,7 @@ void ods_table_state::start_cell(office_element_ptr & elm, office_element_ptr &
void ods_table_state::set_cell_format_value(office_value_type::type value_type)
{
if (cells_size_ < 1)return;
if (cells_.empty())return;
if (value_type == office_value_type::Custom)return; //general .. need detect
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
@ -679,7 +675,7 @@ void ods_table_state::set_cell_format_value(office_value_type::type value_type)
}
void ods_table_state::set_cell_type(int type)
{
if (cells_size_ < 1)return;
if (cells_.empty())return;
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
if (cell == NULL)return;
@ -1270,7 +1266,7 @@ void ods_table_state::set_cell_text(odf_text_context* text_context, bool cash_va
}
void ods_table_state::set_cell_value(const std::wstring & value, bool need_cash)
{
if (cells_size_ < 1)return;
if (cells_.empty())return;
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
if (cell == NULL)return;
@ -1416,7 +1412,7 @@ void ods_table_state::end_cell_text()
}
void ods_table_state::end_cell()
{
if ( cells_size_ < 1)return;
if (cells_.empty())return;
if (cells_.back().comment_idx >= 0)
{
@ -1434,6 +1430,10 @@ void ods_table_state::end_cell()
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
if (cell)cell->attlist_.common_value_and_type_attlist_ = boost::none;
}
if (map_merged_cells.empty())
{
cells_.pop_back();
}
}
void ods_table_state::add_default_cell( int repeated)
@ -1565,7 +1565,6 @@ void ods_table_state::add_default_cell( int repeated)
state.comment_idx = comment_idx;
cells_.push_back(state);
cells_size_++;
current_table_column_ += state.repeated;
@ -1667,6 +1666,13 @@ void ods_table_state::start_conditional_rule(int rule_type, _CP_OPT(unsigned int
if (col.empty()) col = L".A";
if (row.empty()) row = L"1";
if (std::wstring::npos != table.find(L" "))
{
if (table[0] != L'\'')
{
table = L"'" + table + L"'";
}
}
condition->attr_.calcext_base_cell_address_ = table + col + row;
}
switch(rule_type)

View File

@ -124,7 +124,9 @@ namespace utils
std::reverse(a.begin(), a.end());
XmlUtils::replace_all( a, L"$", L"");
XmlUtils::GetUpper(a);
XmlUtils::replace_all( a, L"[", L"");
XmlUtils::replace_all( a, L"]", L"");
XmlUtils::GetUpper(a);
for (size_t i = 0; i < a.length(); i++)
{
@ -493,7 +495,6 @@ private:
std::vector<office_element_ptr> current_level_;//постоянно меняющийся список уровней ("0-й элемент - сама таблица)
std::vector<ods_cell_state> cells_;
long cells_size_;
std::vector<ods_hyperlink_state> hyperlinks_;
std::map<unsigned int, ods_shared_formula_state> shared_formulas_;

View File

@ -1325,7 +1325,8 @@ int odt_conversion_context::start_comment(int oox_comm_id)
create_element(L"office", L"annotation", comm_elm, this);
comment_context_.start_comment(comm_elm, oox_comm_id);
comm_state = 1;
if (text_context()->current_level_.empty())
{
comm_state = 2;
@ -1339,8 +1340,10 @@ int odt_conversion_context::start_comment(int oox_comm_id)
odf_element_state state(comm_elm, L"", office_element_ptr(), text_context()->current_level_.size());
text_context()->current_level_.push_back(state);
return comm_state;
}
return comm_state;
else return 0;
}
void odt_conversion_context::start_comment_content()
{

View File

@ -71,9 +71,9 @@ class dc_date : public office_element_impl<dc_date>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDcDate;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element ( const office_element_ptr & child_element){}
@ -92,9 +92,9 @@ class dc_creator : public office_element_impl<dc_creator>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeDcCreator;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -113,9 +113,9 @@ class office_annotation : public office_element_impl<office_annotation>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeAnnotation;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -139,9 +139,9 @@ class office_annotation_end : public office_element_impl<office_annotation_end>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeAnnotationEnd;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -166,9 +166,9 @@ class officeooo_annotation : public office_element_impl<officeooo_annotation>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeAnnotation;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -49,10 +49,10 @@ class office_body : public office_element_impl<office_body>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeBody;
CPDOCCORE_DEFINE_VISITABLE()
office_element * content() { return content_.get(); }

View File

@ -51,9 +51,9 @@ class office_chart : public office_element_impl<office_chart>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeChart;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -93,9 +93,9 @@ class chart_chart : public office_element_impl<chart_chart>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartChart;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -124,9 +124,9 @@ class chart_title : public office_element_impl<chart_title>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartTitle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -144,9 +144,9 @@ class chart_subtitle : public office_element_impl<chart_subtitle>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartSubtitle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -165,9 +165,9 @@ class chart_footer : public office_element_impl<chart_footer>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartFooter;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -203,9 +203,9 @@ class chart_legend : public office_element_impl<chart_legend>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartLegend;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -239,9 +239,9 @@ class chart_plot_area : public office_element_impl<chart_plot_area>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartPlotArea;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -269,9 +269,9 @@ class chart_wall : public office_element_impl<chart_wall>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartWall;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -290,9 +290,9 @@ class chart_floor : public office_element_impl<chart_floor>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartFloor;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -321,9 +321,9 @@ class chart_axis : public office_element_impl<chart_axis>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartAxis;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -352,9 +352,9 @@ class chart_grid : public office_element_impl<chart_grid>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartGrid;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -372,9 +372,9 @@ class chart_categories : public office_element_impl<chart_categories>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartCategories;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -405,9 +405,9 @@ class chart_series : public office_element_impl<chart_series>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartSeries;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -425,9 +425,9 @@ class chart_domain : public office_element_impl<chart_domain>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartDomain;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -454,9 +454,9 @@ class chart_data_point : public office_element_impl<chart_data_point>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartDataPoint;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -474,9 +474,9 @@ class chart_mean_value : public office_element_impl<chart_mean_value>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartMeanValue;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -493,9 +493,9 @@ class chart_error_indicator : public office_element_impl<chart_error_indicator>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartErrorIndicator;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -511,9 +511,9 @@ class chart_equation : public office_element_impl<chart_equation>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartEquation;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}//???
virtual void add_child_element( const office_element_ptr & child_element){}//???
@ -531,9 +531,9 @@ class chart_regression_curve : public office_element_impl<chart_regression_curve
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartRegressionCurve;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -552,9 +552,9 @@ class chart_stock_gain_marker : public office_element_impl<chart_stock_gain_mark
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartStockGainMarker;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -573,9 +573,9 @@ class chart_stock_loss_marker : public office_element_impl<chart_stock_loss_mark
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartStockLossMarker;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -594,9 +594,9 @@ class chart_stock_range_line : public office_element_impl<chart_stock_range_line
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartStockRangeLine;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -615,9 +615,9 @@ class chart_date_scale : public office_element_impl<chart_date_scale>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeChartDateScale;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}

View File

@ -51,9 +51,9 @@ class manifest_encryption_data : public office_element_impl<manifest_encryption_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeManifestEncryptionData;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -76,9 +76,9 @@ class manifest_algorithm : public office_element_impl<manifest_algorithm>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeManifestAlgorithm;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -96,9 +96,9 @@ class manifest_key_derivation : public office_element_impl<manifest_key_derivati
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeManifestKeyDerivation;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -118,9 +118,9 @@ class manifest_start_key_generation : public office_element_impl<manifest_start_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeManifestStartKeyGeneration;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}

View File

@ -32,17 +32,12 @@
#pragma once
#include <vector>
#include <boost/algorithm/string/replace.hpp>
#include <CPOptional.h>
#include <CPSharedPtr.h>
#include <CPWeakPtr.h>
#include <xml/xmlelement.h>
#include <xml/attributes.h>
#include <logging.h>
#include <boost/noncopyable.hpp>
#include <odf/odf_elements_type.h>
#include "visitor.h"
namespace cpdoccore {
namespace odf_writer {
@ -51,17 +46,18 @@ class odf_conversion_context;
class office_element;
typedef shared_ptr<office_element>::Type office_element_ptr;
typedef weak_ptr<office_element>::Type office_element_weak_ptr;
typedef std::vector<office_element_ptr> office_element_ptr_array;
class office_element : public xml::element<wchar_t>, public base_visitable, boost::noncopyable
class office_element : boost::noncopyable
{
public:
office_element() : context_(NULL) {}
virtual ElementType get_type() const = 0;
virtual ~office_element() = 0;
virtual const wchar_t * get_ns() const = 0;
virtual const wchar_t * get_name() const = 0;
virtual ElementType get_type() const = 0;
virtual void serialize(std::wostream & _Wostream) = 0 ;
void setContext(odf_conversion_context * Context) { context_ = Context; }
@ -77,62 +73,39 @@ public:
////////////////////////
virtual std::wostream & serialize(std::wostream & _Wostream) const
{
_CP_LOG << L"[warning] use base text_to_stream\n";
return _Wostream;
}
virtual std::wostream & xml_to_stream(std::wostream & _Wostream) const
{
_CP_LOG << L"[warning] use base xml_to_stream\n";
_CP_LOG << L"[warning] use base serialize\n";
return _Wostream;
}
virtual std::wostream & text_to_stream(std::wostream & _Wostream, bool bXmlEncode = true) const
{
_CP_LOG << L"[warning] use base text_to_stream\n";
return _Wostream;
}
private:
bool is_root_;
odf_conversion_context * context_;
};
#define CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_ public:\
virtual const wchar_t * get_ns() const { return ns; }\
virtual const wchar_t * get_name() const { return name; }\
virtual xml::NodeType get_xml_type() const { return xml_type; }\
virtual ElementType get_type() const { return type; }
inline office_element::~office_element()
{
}
/// \class office_element_impl
template <class Element>
class office_element_impl : public virtual office_element
{
// xml::element impl
public:
virtual const wchar_t * get_ns() const
{
return Element::ns;
}
}
virtual const wchar_t * get_name() const
{
return Element::name;
}
virtual xml::NodeType get_xml_type() const
{
return Element::xml_type;
}
virtual void add_child_element( const office_element_ptr & child)
{
_CP_LOG << L"Non add child in " << Element::ns << L":" << Element::name << std::endl;
}
private:
// office_element impl
public:
virtual ElementType get_type() const
{
return Element::type;

View File

@ -32,7 +32,7 @@
#include "office_elements_create.h"
#include <iostream>
#include <sstream>
#include "logging.h"
namespace cpdoccore {
@ -111,13 +111,12 @@ void not_applicable_element(const std::wstring & Current,const std::wstring & Ns
#endif
}
void not_applicable_element(const office_element * CurrentElm, const std::wstring & Ns, const std::wstring & Name)
{
std::wstringstream ss;
if (CurrentElm)
ss << CurrentElm->get_ns() << L":" << CurrentElm->get_name();
not_applicable_element(ss.str(), Ns, Name);
std::wstringstream ss;
if (CurrentElm)
ss << CurrentElm->get_ns() << L":" << CurrentElm->get_name();
not_applicable_element(ss.str(), Ns, Name);
}
bool create_element(const std::wstring & Ns,

View File

@ -48,9 +48,9 @@ class office_event_listeners : public office_element_impl<office_event_listeners
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeEventListeners;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -84,9 +84,9 @@ class presentation_event_listener : public office_element_impl<presentation_even
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typePresentationEventListener;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -107,9 +107,9 @@ class script_event_listener : public office_element_impl<presentation_event_list
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeScriptEventListener;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -54,9 +54,9 @@ class office_forms : public office_element_impl<office_forms>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeForms;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -76,9 +76,9 @@ class form_form : public office_element_impl<form_form>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormForm;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -124,9 +124,9 @@ class form_properties : public office_element_impl<form_properties>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormProperties;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -143,9 +143,9 @@ class form_property : public office_element_impl<form_property>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormProperty;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -163,9 +163,9 @@ class form_list_property : public office_element_impl<form_list_property>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormListProperty;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -185,9 +185,9 @@ class form_list_value : public office_element_impl<form_list_value>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormListValue;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -205,7 +205,7 @@ public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormElement;
form_element() {}
@ -245,9 +245,9 @@ class form_button : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormButton;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
@ -272,9 +272,9 @@ class form_image_frame : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormImageFrame;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
@ -288,9 +288,9 @@ class form_text : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormText;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
@ -308,9 +308,9 @@ class form_textarea : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormTextarea;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
@ -327,9 +327,9 @@ class form_fixed_text : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormFixedText;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
};
@ -341,9 +341,9 @@ class form_checkbox : public form_text
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormCheckbox;
CPDOCCORE_DEFINE_VISITABLE();
form_checkbox() : current_state_(false), image_position_(L"center") {}
virtual void serialize(std::wostream & _Wostream);
@ -362,9 +362,9 @@ class form_radio : public form_checkbox
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormRadio;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
};
@ -376,9 +376,9 @@ class form_combobox : public form_text
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormCombobox;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -402,9 +402,9 @@ class form_listbox : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormListbox;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -434,9 +434,9 @@ class form_date : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormDate;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
};
@ -450,9 +450,9 @@ public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormValueRange;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
@ -471,9 +471,9 @@ class form_frame : public form_element
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormFrame;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & _Wostream);
};
@ -485,9 +485,9 @@ class form_item : public office_element_impl<form_item>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeFormItem;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}

View File

@ -46,9 +46,9 @@ class office_presentation : public office_element_impl<office_presentation>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficePresentation;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -46,9 +46,9 @@ class office_scripts : public office_element_impl<office_scripts>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeScripts;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -68,9 +68,9 @@ class office_script : public office_element_impl<office_script>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeScript;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -84,7 +84,7 @@ void settings_config_item_set::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR( L"config:name", config_name_);
CP_XML_ATTR( L"config:name", XmlUtils::EncodeXmlString(config_name_));
for (size_t i = 0; i < content_.size(); i++)
{
@ -114,10 +114,10 @@ void settings_config_item::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR( L"config:name", config_name_);
CP_XML_ATTR( L"config:name", XmlUtils::EncodeXmlString(config_name_));
CP_XML_ATTR( L"config:type", config_type_);
CP_XML_STREAM() << content_;
CP_XML_STREAM() << XmlUtils::EncodeXmlString(content_);
}
}
}
@ -141,7 +141,7 @@ void settings_config_item_map_indexed::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT( L"config:name", config_name_);
CP_XML_ATTR_OPT_ENCODE_STRING( L"config:name", config_name_);
for (size_t i = 0; i < content_.size(); i++)
{
@ -170,7 +170,7 @@ void settings_config_item_map_named::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT( L"config:name", config_name_);
CP_XML_ATTR_OPT_ENCODE_STRING( L"config:name", config_name_);
for (size_t i = 0; i < content_.size(); i++)
{
@ -199,7 +199,7 @@ void settings_config_item_map_entry::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT( L"config:name", config_name_);
CP_XML_ATTR_OPT_ENCODE_STRING( L"config:name", config_name_);
for (size_t i = 0; i < content_.size(); i++)
{

View File

@ -49,9 +49,9 @@ class office_settings : public office_element_impl<office_settings>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSettings;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -69,9 +69,9 @@ class settings_config_item_set : public office_element_impl<settings_config_item
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSettingsConfigItemSet;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -89,9 +89,9 @@ class settings_config_item : public office_element_impl<settings_config_item>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSettingsConfigItem;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -110,9 +110,9 @@ class settings_config_item_map_indexed : public office_element_impl<settings_con
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSettingsConfigItemMapIndexed;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -130,9 +130,9 @@ class settings_config_item_map_named : public office_element_impl<settings_confi
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSettingsConfigItemMapNamed;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -150,9 +150,9 @@ class settings_config_item_map_entry : public office_element_impl<settings_confi
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSettingsConfigItemMapEntry;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -46,6 +46,16 @@ namespace odf_writer {
const wchar_t * office_spreadsheet::ns = L"office";
const wchar_t * office_spreadsheet::name = L"spreadsheet";
office_spreadsheet::~office_spreadsheet()
{
named_expressions_.reset();
database_ranges_.reset();
data_pilot_tables_.reset();
content_validations_.reset();
forms_.reset();
content_.clear();
}
void office_spreadsheet::create_child_element(const std::wstring & Ns, const std::wstring & Name)
{
if CP_CHECK_NAME(L"office", L"forms")

View File

@ -46,11 +46,13 @@ namespace odf_writer {
class office_spreadsheet : public office_element_impl<office_spreadsheet>
{
public:
office_spreadsheet() {}
virtual ~office_spreadsheet();
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeSpreadsheet;
CPDOCCORE_DEFINE_VISITABLE()
static const ElementType type = typeOfficeSpreadsheet;
office_element_ptr_array & getContent(){return content_;}

View File

@ -58,9 +58,9 @@ class office_text : public office_element_impl<office_text>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeText;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -94,9 +94,9 @@ class office_change_info : public office_element_impl<office_change_info>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeChangeInfo;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

View File

@ -80,7 +80,7 @@ std::wostream & text_text::text_to_stream(std::wostream & _Wostream) const
void text_text::serialize(std::wostream & _Wostream)
{
_Wostream << xml::utils::replace_text_to_xml( text_ );
_Wostream << xml::utils::replace_text_to_xml( text_ , true);
}
void text_text::add_text(const std::wstring & Text)
@ -954,7 +954,7 @@ void text_toc_mark::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"text:string-value", string_value_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"text:string-value", string_value_);
CP_XML_ATTR_OPT(L"text:outline-level", outline_level_);
}
}
@ -972,7 +972,7 @@ void text_alphabetical_index_mark_start::serialize(std::wostream & _Wostream)
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR (L"text:id", id_);
CP_XML_ATTR_OPT (L"text:string-value-phonetic", string_value_phonetic_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"text:string-value-phonetic", string_value_phonetic_);
CP_XML_ATTR_OPT (L"text:key1", key1_);
CP_XML_ATTR_OPT (L"text:key1-phonetic", key1_phonetic_);
CP_XML_ATTR_OPT (L"text:key2", key2_);
@ -1009,7 +1009,7 @@ void text_alphabetical_index_mark::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT (L"text:string-value-phonetic", string_value_phonetic_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"text:string-value-phonetic", string_value_phonetic_);
CP_XML_ATTR_OPT (L"text:key1", key1_);
CP_XML_ATTR_OPT (L"text:key1-phonetic", key1_phonetic_);
CP_XML_ATTR_OPT (L"text:key2", key2_);

View File

@ -58,9 +58,7 @@ public:
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeText;
static const ElementType type = typeTextText;
CPDOCCORE_DEFINE_VISITABLE();
static const ElementType type = typeTextText;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -86,9 +84,9 @@ class text_s : public office_element_impl<text_s>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextS;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -110,9 +108,9 @@ class text_tab : public office_element_impl<text_tab>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTab;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -136,9 +134,9 @@ class text_line_break : public office_element_impl<text_line_break>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextLineBreak;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -158,9 +156,9 @@ class text_bookmark : public office_element_impl<text_bookmark>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextBookmark;
CPDOCCORE_DEFINE_VISITABLE();
public:
@ -184,9 +182,9 @@ class text_bookmark_start : public office_element_impl<text_bookmark_start>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextBookmarkStart;
CPDOCCORE_DEFINE_VISITABLE();
public:
text_bookmark_start() {}
@ -209,9 +207,9 @@ class text_bookmark_end : public office_element_impl<text_bookmark_end>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextBookmarkEnd;
CPDOCCORE_DEFINE_VISITABLE();
public:
text_bookmark_end() {} ;
@ -234,9 +232,9 @@ class text_reference_mark : public office_element_impl<text_reference_mark>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextReferenceMark;
CPDOCCORE_DEFINE_VISITABLE();
public:
text_reference_mark() {};
@ -259,9 +257,9 @@ class text_reference_mark_start : public office_element_impl<text_reference_mark
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextReferenceMarkStart;
CPDOCCORE_DEFINE_VISITABLE();
public:
text_reference_mark_start() {}
@ -284,9 +282,9 @@ class text_reference_mark_end : public office_element_impl<text_reference_mark_e
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextReferenceMarkEnd;
CPDOCCORE_DEFINE_VISITABLE();
public:
text_reference_mark_end() {};
@ -309,9 +307,9 @@ class text_span : public office_element_impl<text_span>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSpan;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -338,9 +336,9 @@ class text_a : public office_element_impl<text_a>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextA;
CPDOCCORE_DEFINE_VISITABLE();
public:
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -372,9 +370,9 @@ class text_note_citation : public office_element_impl<text_note_citation>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextNoteCitation;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -398,9 +396,9 @@ class text_note_body : public office_element_impl<text_note_body>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextNoteBody;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -424,9 +422,9 @@ class text_note : public office_element_impl<text_note>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextNote;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -454,9 +452,9 @@ class text_ruby : public office_element_impl<text_ruby>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextRuby;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -491,9 +489,9 @@ class text_title : public office_element_impl<text_title>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTitle;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -516,9 +514,9 @@ class text_placeholder : public office_element_impl<text_placeholder>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextPlaceholder;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -539,9 +537,9 @@ class text_page_number: public office_element_impl<text_page_number>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextPageNumber;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -568,9 +566,9 @@ class text_page_count : public office_element_impl<text_page_count>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextPageCount;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -592,9 +590,9 @@ class text_date : public office_element_impl<text_date>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextDate;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -619,9 +617,9 @@ class text_time : public office_element_impl<text_time>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTime;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -646,9 +644,9 @@ class text_file_name : public office_element_impl<text_file_name>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextFileName;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element ( const office_element_ptr & child_element);
@ -670,9 +668,9 @@ class text_sequence : public office_element_impl<text_sequence>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSequence;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -698,9 +696,9 @@ class text_text_input : public office_element_impl<text_text_input>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTextInput;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -720,9 +718,9 @@ class text_sheet_name : public office_element_impl<text_sheet_name>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSheetName;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -742,9 +740,9 @@ class presentation_footer : public office_element_impl<presentation_footer>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typePresentationFooter;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -760,9 +758,9 @@ class presentation_date_time: public office_element_impl<presentation_date_time>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typePresentationDateTime;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child_element){}
@ -778,9 +776,9 @@ class text_toc_mark_start : public office_element_impl<text_toc_mark_start>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTocMarkStart;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element ( const office_element_ptr & child_element){}
@ -799,9 +797,9 @@ class text_toc_mark_end : public office_element_impl<text_toc_mark_end>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTocMarkEnd;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element ( const office_element_ptr & child_element){}
@ -819,9 +817,9 @@ class text_toc_mark : public office_element_impl<text_toc_mark>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextTocMark;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element ( const office_element_ptr & child_element){}
@ -840,9 +838,9 @@ class text_alphabetical_index_mark_start : public office_element_impl<text_alpha
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextAlphabeticalIndexMarkStart;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element ( const office_element_ptr & child_element){}
@ -866,9 +864,9 @@ class text_alphabetical_index_mark_end : public office_element_impl<text_alphabe
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextAlphabeticalIndexMarkEnd;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element ( const office_element_ptr & child_element){}
@ -886,9 +884,9 @@ class text_alphabetical_index_mark : public office_element_impl<text_alphabetica
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextAlphabeticalIndexMark;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element ( const office_element_ptr & child_element){}
@ -912,10 +910,10 @@ class text_bibliography_mark : public office_element_impl<text_bibliography_mark
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextBibliographyMark;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element ( const office_element_ptr & child_element){}
@ -962,9 +960,9 @@ class text_sequence_ref : public office_element_impl<text_sequence_ref>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextSequenceRef;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element ( const office_element_ptr & child_element){}
@ -985,9 +983,9 @@ class text_drop_down : public office_element_impl<text_drop_down>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextDropDown;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element ( const office_element_ptr & child_element);
@ -1009,9 +1007,9 @@ class text_label : public office_element_impl<text_label>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextLabel;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element (const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element ( const office_element_ptr & child_element){}

View File

@ -129,10 +129,10 @@ class style_chart_properties : public office_element_impl<style_chart_properties
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleChartProperties;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}

View File

@ -148,10 +148,10 @@ class style_graphic_properties : public office_element_impl<style_graphic_proper
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleGraphicPropertis;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}
@ -169,10 +169,10 @@ class loext_graphic_properties : public office_element_impl<loext_graphic_proper
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleGraphicPropertis;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}

View File

@ -48,9 +48,9 @@ class style_map : public office_element_impl<style_map>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleMap;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm){}

View File

@ -122,9 +122,9 @@ class style_page_layout_properties : public office_element_impl<style_page_layou
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStylePageLayout;
CPDOCCORE_DEFINE_VISITABLE()
style_page_layout_properties() { }

View File

@ -80,10 +80,10 @@ class style_tab_stop : public office_element_impl<style_tab_stop>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTabStop;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}
@ -111,10 +111,10 @@ class style_tab_stops : public office_element_impl<style_tab_stops>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTabStops;
CPDOCCORE_DEFINE_VISITABLE()
size_t size() const { return style_tab_stops_.size(); }
@ -134,10 +134,10 @@ class style_drop_cap : public office_element_impl<style_drop_cap>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDropCap;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}
@ -159,10 +159,10 @@ class style_background_image : public office_element_impl<style_background_image
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleBackgroundImage;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}
@ -264,10 +264,10 @@ class style_paragraph_properties : public office_element_impl<style_paragraph_pr
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleParagraphProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);

View File

@ -53,10 +53,10 @@ class presentation_placeholder : public office_element_impl<presentation_placeho
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStylePresentationPlaceholder;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}
@ -80,10 +80,10 @@ class presentation_sound : public office_element_impl<presentation_sound>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStylePresentationSound;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}
@ -135,10 +135,10 @@ class style_drawing_page_properties : public office_element_impl<style_drawing_p
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawingPageProperties;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
virtual void add_child_element( const office_element_ptr & child){}

View File

@ -51,9 +51,9 @@ class style_columns : public office_element_impl<style_columns>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleColumns;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -76,9 +76,9 @@ class style_column : public office_element_impl<style_column>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleColumn;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child){}
@ -100,9 +100,9 @@ class style_column_sep : public office_element_impl<style_column_sep>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleColumnSep;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child){}
@ -124,9 +124,9 @@ class style_section_properties : public office_element_impl<style_section_proper
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleSectionProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);

View File

@ -97,10 +97,10 @@ class style_table_properties : public office_element_impl<style_table_properties
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTableProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child){}
@ -134,10 +134,10 @@ class style_table_column_properties : public office_element_impl<style_table_col
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTableColumnProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
@ -168,10 +168,10 @@ class style_table_row_properties : public office_element_impl<style_table_row_pr
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTableRowProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
@ -236,10 +236,10 @@ class style_table_cell_properties : public office_element_impl<style_table_cell_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTableCellProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);

View File

@ -202,10 +202,10 @@ class style_text_properties : public office_element_impl<style_text_properties>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleTextProperties;
CPDOCCORE_DEFINE_VISITABLE()
void apply_from(const style_text_properties * Other);

View File

@ -481,7 +481,7 @@ void style::serialize(std::wostream & strm)
CP_XML_ATTR_OPT(L"style:master-page-name", style_master_page_name_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"style:display-name", style_display_name_);
CP_XML_ATTR(L"style:family", style_family_);
CP_XML_ATTR(L"style:name", style_name_);
CP_XML_ATTR(L"style:name", XmlUtils::EncodeXmlString(style_name_));
content_.serialize(CP_XML_STREAM());
}

View File

@ -135,9 +135,9 @@ class default_style : public office_element_impl<default_style>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDefaultStyle;
CPDOCCORE_DEFINE_VISITABLE()
default_style() : content_(getContext()) {}
@ -160,10 +160,10 @@ class draw_gradient : public office_element_impl<draw_gradient>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawGradient;
CPDOCCORE_DEFINE_VISITABLE()
std::wstring get_style_name(){return draw_name_.get_value_or(L"");}
@ -195,10 +195,10 @@ class draw_hatch : public office_element_impl<draw_hatch>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawHatch;
CPDOCCORE_DEFINE_VISITABLE()
std::wstring get_style_name(){return draw_name_.get_value_or(L"");}
@ -222,10 +222,10 @@ class draw_opacity : public office_element_impl<draw_opacity>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawOpacity;
CPDOCCORE_DEFINE_VISITABLE()
std::wstring get_style_name(){return draw_name_.get_value_or(L"");}
@ -255,10 +255,10 @@ class draw_layer : public office_element_impl<draw_layer>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawLayer;
CPDOCCORE_DEFINE_VISITABLE()
_CP_OPT(std::wstring) draw_name_;
@ -273,10 +273,10 @@ class draw_layer_set : public office_element_impl<draw_layer_set>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawLayerSet;
CPDOCCORE_DEFINE_VISITABLE()
office_element_ptr_array content_;
@ -293,10 +293,10 @@ class draw_fill_image : public office_element_impl<draw_fill_image>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawFillImage;
CPDOCCORE_DEFINE_VISITABLE()
std::wstring get_style_name(){return draw_name_.get_value_or(L"");}
@ -316,10 +316,10 @@ class draw_marker : public office_element_impl<draw_marker>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleDrawMarker;
CPDOCCORE_DEFINE_VISITABLE()
std::wstring get_style_name(){return draw_name_.get_value_or(L"");}
@ -346,9 +346,9 @@ class style : public office_element_impl<style>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleStyle;
CPDOCCORE_DEFINE_VISITABLE()
style() : content_(getContext()) {}
@ -436,9 +436,9 @@ class office_automatic_styles : public office_element_impl<office_automatic_styl
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeAutomaticStyles;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -457,9 +457,9 @@ class office_master_styles : public office_element_impl<office_master_styles>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeMasterStyles;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -500,9 +500,9 @@ class style_master_page: public office_element_impl<style_master_page>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleMasterPage;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -536,9 +536,9 @@ class office_styles : public office_element_impl<office_styles>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeStyles;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -586,9 +586,9 @@ class style_header : public office_element_impl<style_header>, public header_foo
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleHeader;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -606,9 +606,9 @@ class style_footer : public office_element_impl<style_footer>, public header_foo
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleFooter;
CPDOCCORE_DEFINE_VISITABLE()
virtual void serialize(std::wostream & strm);
@ -627,9 +627,9 @@ class style_header_first : public office_element_impl<style_header_first>, publi
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleHeaderFirst;
CPDOCCORE_DEFINE_VISITABLE()
virtual void serialize(std::wostream & strm);
@ -647,9 +647,9 @@ class style_footer_first : public office_element_impl<style_footer_first>, publi
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleFooterFirst;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -667,9 +667,9 @@ class style_header_left : public office_element_impl<style_header_left>, public
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleHeaderLeft;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -687,9 +687,9 @@ class style_footer_left : public office_element_impl<style_footer_left>, public
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleFooterLeft;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -718,9 +718,9 @@ class style_header_style : public office_element_impl<style_header_style>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleHeaderStyle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -739,9 +739,9 @@ class style_footer_style : public office_element_impl<style_footer_style>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleFooterStyle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -759,9 +759,9 @@ class style_page_layout : public office_element_impl<style_page_layout>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStylePageLayout;
CPDOCCORE_DEFINE_VISITABLE()
style_page_layout_attlist style_page_layout_attlist_;
@ -799,9 +799,9 @@ class style_footnote_sep : public office_element_impl<style_footnote_sep>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleFootnoteSep;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
@ -818,9 +818,9 @@ class text_notes_configuration : public office_element_impl<text_notes_configura
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextNotesConfiguration;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm){}
@ -847,9 +847,9 @@ class text_linenumbering_configuration : public office_element_impl<text_linenum
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextLinenumberingConfiguration;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void serialize(std::wostream & strm);
@ -874,9 +874,9 @@ class text_linenumbering_separator : public office_element_impl<text_linenumberi
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextLinenumberingSeparator;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name) {}
virtual void serialize(std::wostream & strm);
@ -894,9 +894,9 @@ class style_presentation_page_layout : public office_element_impl<style_presenta
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStylePresentationPageLayout;
CPDOCCORE_DEFINE_VISITABLE()
virtual void serialize(std::wostream & strm);
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name);
@ -918,10 +918,10 @@ class style_font_face : public office_element_impl<style_font_face>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleFontFace;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & strm);
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name){}
@ -981,10 +981,10 @@ class office_font_face_decls : public office_element_impl<office_font_face_decls
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeOfficeFontFaceDecls;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & strm);
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name);
@ -1001,9 +1001,9 @@ class style_region_left : public office_element_impl<style_region_left>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleRegionLeft;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & strm);
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name);
@ -1020,9 +1020,9 @@ class style_region_right : public office_element_impl<style_region_right>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleRegionRight;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & strm);
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name);
@ -1041,9 +1041,9 @@ class style_region_center : public office_element_impl<style_region_center>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleRegionCenter;
CPDOCCORE_DEFINE_VISITABLE();
virtual void serialize(std::wostream & strm);
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name);

View File

@ -65,9 +65,9 @@ class text_list_style : public office_element_impl<text_list_style>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListStyle;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -117,9 +117,9 @@ class style_list_level_properties : public office_element_impl<style_list_level_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleListLevelProperties;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -151,9 +151,9 @@ class style_list_level_label_alignment : public office_element_impl<style_list_l
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeStyleListLevelLabelAlignment;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -179,9 +179,9 @@ class text_list_level_style_number : public office_element_impl<text_list_level_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListLevelStyleNumber;
CPDOCCORE_DEFINE_VISITABLE()
office_element_ptr style_list_level_properties_;
@ -220,9 +220,9 @@ class text_list_level_style_bullet : public office_element_impl<text_list_level_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListLevelStyleBullet;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -254,9 +254,9 @@ class text_list_level_style_image : public office_element_impl<text_list_level_s
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextListLevelStyleImage;
CPDOCCORE_DEFINE_VISITABLE()
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child);
@ -276,9 +276,9 @@ class text_outline_style : public office_element_impl<text_outline_style>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextOutlineStyle;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element(const office_element_ptr & child);
@ -296,9 +296,9 @@ class text_outline_level_style : public office_element_impl<text_outline_level_s
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTextOutlineLevelStyle;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element(const office_element_ptr & child);

View File

@ -50,18 +50,18 @@ using xml::xml_char_wc;
void table_table_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT( L"table:name", table_name_);
CP_XML_ATTR_OPT( L"table:style-name", table_style_name_);
CP_XML_ATTR_OPT( L"table:template-name", table_template_name_);
CP_XML_ATTR_OPT_ENCODE_STRING( L"table:name", table_name_);
CP_XML_ATTR_OPT( L"table:style-name", table_style_name_);
CP_XML_ATTR_OPT_ENCODE_STRING( L"table:template-name", table_template_name_);
if (table_protected_ && table_protected_->get())
{
CP_XML_ATTR_OPT( L"table:protected", table_protected_);
CP_XML_ATTR_OPT( L"table:protection-key", table_protection_key_);
CP_XML_ATTR_OPT( L"table:protection-digest-algorithm", table_protection_key_digest_algorithm_);
CP_XML_ATTR_OPT( L"table:protected", table_protected_);
CP_XML_ATTR_OPT( L"table:protection-key", table_protection_key_);
CP_XML_ATTR_OPT( L"table:protection-digest-algorithm", table_protection_key_digest_algorithm_);
}
CP_XML_ATTR_OPT( L"table:print-ranges", table_print_ranges_);
CP_XML_ATTR_OPT_ENCODE_STRING( L"table:print-ranges", table_print_ranges_);
}
void table_table_row_attlist::serialize(CP_ATTR_NODE)
{
@ -81,7 +81,7 @@ void table_table_cell_attlist::serialize(CP_ATTR_NODE)
}
CP_XML_ATTR_OPT(L"table:style-name", table_style_name_);
CP_XML_ATTR_OPT(L"table:content-validation-name", table_content_validation_name_);
CP_XML_ATTR_OPT(L"table:formula", table_formula_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:formula", table_formula_);
if (common_value_and_type_attlist_)
common_value_and_type_attlist_->serialize(CP_GET_XML_NODE());
@ -99,7 +99,7 @@ void table_table_cell_attlist_extra::serialize(CP_ATTR_NODE)
void table_table_source_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR(L"table:mode", table_mode_ );
CP_XML_ATTR_OPT(L"table:table-name", table_table_name_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:table-name", table_table_name_);
}
void table_linked_source_attlist::serialize(CP_ATTR_NODE)
@ -417,8 +417,8 @@ void table_columns::serialize(std::wostream & strm)
// table-columns-no-group
//////////////////////////////////////////////////////////////////////////////////////////////////
//const wchar_t * table_columns_no_group::ns = L"table";
//const wchar_t * table_columns_no_group::name = L"table-columns";
const wchar_t * table_columns_no_group::ns = L"table";
const wchar_t * table_columns_no_group::name = L"table-columns";
table_columns_no_group::table_columns_no_group(odf_conversion_context * _Context) : was_header_(false)
{
Context = _Context;
@ -998,11 +998,11 @@ void table_content_validation::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
CP_XML_ATTR_OPT(L"table:name", table_name_);
CP_XML_ATTR_OPT(L"table:condition", table_condition_);
CP_XML_ATTR_OPT(L"table:display-list", table_display_list_);
CP_XML_ATTR_OPT(L"table:allow-empty-cell", table_allowempty_cell_);
CP_XML_ATTR_OPT(L"table:base-cell-address", table_base_cell_address_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:name", table_name_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:condition", table_condition_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:display-list", table_display_list_);
CP_XML_ATTR_OPT(L"table:allow-empty-cell", table_allowempty_cell_);
CP_XML_ATTR_OPT_ENCODE_STRING(L"table:base-cell-address", table_base_cell_address_);
for (size_t i = 0; i < content_.size(); i++)
{

View File

@ -157,10 +157,10 @@ class table_table_protection : public office_element_impl<table_table_protection
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableProtection;
CPDOCCORE_DEFINE_VISITABLE();
table_table_protection() : select_protected_cells(true), select_unprotected_cells(true) {}
@ -188,10 +188,10 @@ class table_table_source : public office_element_impl<table_table_source>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableSource;
CPDOCCORE_DEFINE_VISITABLE();
table_table_source_attlist table_table_source_attlist_;
table_linked_source_attlist table_linked_source_attlist_;
@ -221,19 +221,14 @@ public:
};
//-----------------------------------------------------------------------------------------------------
class table_columns_no_group: public office_element
class table_columns_no_group : public office_element_impl<table_columns_no_group>
{
public:
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_;
const wchar_t * ns;
const wchar_t * name;
xml::NodeType xml_type;
ElementType type;
static const wchar_t * ns;
static const wchar_t * name;
static const ElementType type = typeTableTableColumnNoGroup;
CPDOCCORE_DEFINE_VISITABLE();
public:
table_columns_no_group(odf_conversion_context * _Context);
table_columns_no_group(odf_conversion_context * _Context);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name/*, odf_conversion_context * Context*/);
virtual void add_child_element( const office_element_ptr & child_element);
@ -250,8 +245,7 @@ public:
table_columns table_columns_2_;
private:
odf_conversion_context * Context;
odf_conversion_context * Context;
};
//-----------------------------------------------------------------------------------------------------
@ -292,10 +286,10 @@ class table_table_column : public office_element_impl<table_table_column>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableColumn;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -315,10 +309,10 @@ class table_table_columns : public office_element_impl<table_table_columns>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableColumns;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -337,10 +331,10 @@ class table_table_header_columns : public office_element_impl<table_table_header
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableHeaderColumns;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -370,10 +364,8 @@ class table_table_column_group : public office_element_impl<table_table_column_g
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableColumnGroup;
CPDOCCORE_DEFINE_VISITABLE();
static const ElementType type = typeTableTableColumnGroup;
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -397,10 +389,10 @@ class table_table_row : public office_element_impl<table_table_row>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableRow;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -435,10 +427,10 @@ class table_table_cell : public office_element_impl<table_table_cell>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableCell;
CPDOCCORE_DEFINE_VISITABLE();
table_table_cell() { }
@ -461,10 +453,10 @@ class table_covered_table_cell : public office_element_impl<table_covered_table_
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableCoveredTableCell;
CPDOCCORE_DEFINE_VISITABLE();
table_covered_table_cell() {empty_ = true; }
@ -487,10 +479,10 @@ class table_table_rows : public office_element_impl<table_table_rows>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableRows;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -513,10 +505,10 @@ class table_table_header_rows : public office_element_impl<table_table_header_ro
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableHeaderRows;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -543,20 +535,16 @@ public:
};
//-----------------------------------------------------------------------------------------------------
class table_rows_no_group : public office_element
class table_rows_no_group : public office_element_impl<table_rows_no_group>
{
public:
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_;
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableRowNoGroup;
static _CP_PTR(table_rows_no_group) create(odf_conversion_context * Context);
CPDOCCORE_DEFINE_VISITABLE();
public:
table_rows_no_group(odf_conversion_context * Context);
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
@ -609,10 +597,10 @@ class table_table_row_group : public office_element_impl<table_table_row_group>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTableRowGroup;
CPDOCCORE_DEFINE_VISITABLE();
table_table_row_group()
{
@ -635,10 +623,10 @@ class table_table : public office_element_impl<table_table>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableTable;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -669,10 +657,10 @@ class table_shapes : public office_element_impl<table_shapes>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableShapes;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -690,10 +678,10 @@ class table_content_validations : public office_element_impl<table_content_valid
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableContentValidations;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -711,10 +699,10 @@ class table_content_validation : public office_element_impl<table_content_valida
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableContentValidation;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -737,10 +725,10 @@ class table_error_message : public office_element_impl<table_error_message>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableErrorMassage;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);
@ -761,10 +749,10 @@ class table_help_message : public office_element_impl<table_help_message>
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableHelpMassage;
CPDOCCORE_DEFINE_VISITABLE();
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( const office_element_ptr & child_element);

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