mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-03-17 13:02:41 +08:00
Compare commits
1454 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e20801b45 | |||
| 8a2e46cb53 | |||
| 8df2390d9d | |||
| f5789d5059 | |||
| f97a7b1ea3 | |||
| 1a0ecb17a7 | |||
| bc447c4522 | |||
| bebdd90aa2 | |||
| 7d91973ddd | |||
| d98d1859b4 | |||
| 2e34600e01 | |||
| 4e4d69235d | |||
| 29125519d9 | |||
| 46c6efee45 | |||
| 690a614ba5 | |||
| b48e6d508d | |||
| 65a469ef92 | |||
| 41a4eedb63 | |||
| 19bec43364 | |||
| 21f134cf71 | |||
| 80b361fe7d | |||
| 32c752a71f | |||
| 1fe41b8b23 | |||
| 464aa7c8c4 | |||
| 9646ac25ae | |||
| b928936f2b | |||
| 69448ebba0 | |||
| 879715efe9 | |||
| 1bec6aacad | |||
| ac64868d4c | |||
| 23283244e9 | |||
| c4e6dea3a3 | |||
| ffd60188c2 | |||
| 0da5552fdf | |||
| 37acb4cfc2 | |||
| 7651a7e472 | |||
| ad51fa70e4 | |||
| 0a6b3efbbc | |||
| 58865ae153 | |||
| b620e1b6e4 | |||
| 2fb242b9bb | |||
| b763dd2e3c | |||
| b9bc3d0597 | |||
| d321366de7 | |||
| bb657dc536 | |||
| 3b581bf5e3 | |||
| 5bd69e0b73 | |||
| 5510223302 | |||
| 78b7fcd7ae | |||
| fee2eb653f | |||
| 8bc77fa710 | |||
| e111568c34 | |||
| 500a32a1dc | |||
| 5387175ed1 | |||
| 63a3da31a9 | |||
| 8555b7d5fe | |||
| 18de7c5da1 | |||
| 5e052325ea | |||
| ffebbbe0af | |||
| 03b25199d9 | |||
| 1569b58dab | |||
| a2614b0020 | |||
| 01d20d1b13 | |||
| f4c6818570 | |||
| 709ac68a97 | |||
| c6a4f83a9d | |||
| d7bd15b4e2 | |||
| 1937f47043 | |||
| f2b19e9701 | |||
| 9cbbca4712 | |||
| 319c9d3522 | |||
| a33cf2fc7f | |||
| 830aee3ae4 | |||
| 9ae72e5a74 | |||
| 92e3d6d3cc | |||
| a6fd52ae70 | |||
| 089f817962 | |||
| 97653a5be7 | |||
| 9c81eb5bd1 | |||
| 543c5a59d9 | |||
| 3517208b92 | |||
| 172308579a | |||
| 9860be4434 | |||
| 8ae061d50b | |||
| 00de58f59d | |||
| 98ad73ce7d | |||
| 7f12d47f7b | |||
| df1bac754b | |||
| be72b15872 | |||
| 700e91629d | |||
| 95e747e400 | |||
| 1ba4412bd4 | |||
| 6d69fc21d5 | |||
| 53a0196dea | |||
| 2e3e75a39c | |||
| 525f318e17 | |||
| a3d083e7bd | |||
| 2267f1bca2 | |||
| 85baa9afc7 | |||
| 8f97f55e67 | |||
| 19070ca5c9 | |||
| 32ac61f890 | |||
| ce2727862d | |||
| b1a044ba14 | |||
| eae2ef8d85 | |||
| 3599c01b97 | |||
| c76649d296 | |||
| 738568bf6d | |||
| b730fb350d | |||
| e147129642 | |||
| 3f097fa83c | |||
| 9a971f16dd | |||
| 272cbbb8b6 | |||
| 1d14056ebc | |||
| 39e06f668e | |||
| 150a76650e | |||
| 4016df7fc7 | |||
| 8422e3cd3b | |||
| 827fc16fbe | |||
| 9b2208b97d | |||
| 8a34dcf222 | |||
| 6aae00a6ee | |||
| 42acdac865 | |||
| 459313292e | |||
| 08612c0cd5 | |||
| 7c72b34986 | |||
| d396c8dc7e | |||
| 13ee681c22 | |||
| 3e1c28687a | |||
| 2625d6cd26 | |||
| dae64684b1 | |||
| 6db7f67972 | |||
| 561298b43c | |||
| 7c08b05fcd | |||
| dc9e6ffdd5 | |||
| b8e5f7d01b | |||
| 32841d6596 | |||
| 4d2830732f | |||
| c8d5ae5f52 | |||
| dbf5e2c0af | |||
| 981ce25bfc | |||
| 6eb4e89fe2 | |||
| 3d71a1a8ff | |||
| d9407f6534 | |||
| 6ec06a8342 | |||
| 0398c6a018 | |||
| 93d1688e13 | |||
| 72cde59fdb | |||
| 03bfb325cd | |||
| 06f7208e20 | |||
| 1dcaa7e5cb | |||
| fd3abeca46 | |||
| e9f1734f88 | |||
| c5b124790e | |||
| c8e8cd05fa | |||
| f60dd5b3c7 | |||
| 25b8ccfdbd | |||
| 34e6fdaf64 | |||
| f443771b12 | |||
| dad67014be | |||
| a8f61fa7f4 | |||
| 4c3f3ea607 | |||
| 05c7e09041 | |||
| 5e127f15e2 | |||
| 94bfcfc9a6 | |||
| 6738395c7f | |||
| d565300d25 | |||
| bb1534f674 | |||
| c3b585d811 | |||
| 08d23ee5bd | |||
| 9b5c287820 | |||
| c025475f8b | |||
| af50c8a956 | |||
| 668940e5bd | |||
| ff44478342 | |||
| e02a4cdfea | |||
| bafc119c9c | |||
| 4f4a3cc8fa | |||
| 891bcb87ce | |||
| 385f82cde6 | |||
| 46445c7772 | |||
| 52c3ac384e | |||
| 73864cf5f2 | |||
| 5adbcb151f | |||
| 64e9652941 | |||
| fdde20948b | |||
| 4ec1a1ec9d | |||
| b701cc43aa | |||
| 4a083fa784 | |||
| 657c45d9b4 | |||
| 6a31f998cb | |||
| b414fe2058 | |||
| 1f01c756de | |||
| 7be5253d15 | |||
| ec8fa5d6cc | |||
| a3ea929707 | |||
| 972a1eff53 | |||
| 43081b2a28 | |||
| 09c617010a | |||
| 186bfb4b89 | |||
| 8e3519236d | |||
| 53b78c1f84 | |||
| 1e8a9867fe | |||
| 67b71d296c | |||
| 512c7bba6c | |||
| 51c88417d6 | |||
| d05c4ae889 | |||
| fc936844bd | |||
| ced58f6cfa | |||
| ad53cd99c3 | |||
| dbcf20c3f4 | |||
| c691df5cac | |||
| 7515049b17 | |||
| 4c5ff20a07 | |||
| 38460e9163 | |||
| 882f47f6bc | |||
| 603fa295f4 | |||
| 55850f870c | |||
| 398c6a6aa3 | |||
| ce41b18a93 | |||
| 0922267efb | |||
| e7f34c71e4 | |||
| f455929de3 | |||
| e2a7eab89f | |||
| ef5e5e417a | |||
| 6e936ffafc | |||
| 66d7c464c4 | |||
| 4c8abba476 | |||
| 7a3be96e58 | |||
| 472073bdd1 | |||
| f01d10d49e | |||
| fcb820ce1d | |||
| e29057693e | |||
| c4bf58282c | |||
| 856183aab6 | |||
| 82da4217a2 | |||
| b8a0f9faae | |||
| 88d61afb97 | |||
| 564d76f041 | |||
| 3b6bb53335 | |||
| 1a39c5e01a | |||
| 8d31ec4b57 | |||
| dd998710d4 | |||
| 9d9e09e93c | |||
| 1fa69a32f3 | |||
| 1d91829136 | |||
| 1a3a76c379 | |||
| c5319eda0c | |||
| 2a8fcbf1d4 | |||
| 177a87cfb9 | |||
| 868fd15f74 | |||
| e8ac0d8eb0 | |||
| 8ba10ab8ba | |||
| 120057be57 | |||
| 6a543bb12d | |||
| efbaf157a2 | |||
| 8b015a7d04 | |||
| 9737d61f14 | |||
| 2249fef63f | |||
| a40275c659 | |||
| add329c8ea | |||
| a6e59cc6ff | |||
| 7e4f9f48cd | |||
| 993eb9809d | |||
| 660e7a8f4e | |||
| 103611fd74 | |||
| e3b54624c3 | |||
| 5ea2bc345c | |||
| 068868953f | |||
| 4973518a1f | |||
| 840caf8ba4 | |||
| a80642bfaf | |||
| 14801e3620 | |||
| bfadbbb73f | |||
| 01cff05f71 | |||
| 20bf33ca68 | |||
| 9a397e8882 | |||
| ff84f09478 | |||
| 4e7f35c108 | |||
| 923540e5b5 | |||
| 55428c64fb | |||
| 8bd724353e | |||
| f4e1082ab5 | |||
| d01a4f1c4d | |||
| f8be868a2b | |||
| 93fa98720c | |||
| 6b737f4b55 | |||
| a40242fb86 | |||
| 73845ec7fd | |||
| 7f0691ee09 | |||
| 4db485cc8a | |||
| a8e1f9117f | |||
| fc52fb3c17 | |||
| 8eb21889bf | |||
| 286eb3fe9a | |||
| e88f00c27d | |||
| 27ccd7d2d3 | |||
| 77dc170f13 | |||
| 258e4cda5a | |||
| ab2235f7cd | |||
| a2fc2fb9d6 | |||
| 96a3ac70ca | |||
| 61b5ad4e02 | |||
| 88435e51bb | |||
| 8c0843b218 | |||
| 5e7b33ba61 | |||
| d6d117c5dd | |||
| ded794244d | |||
| 5e8422be62 | |||
| b0fd733e95 | |||
| f201a55045 | |||
| d03f203553 | |||
| 1f24c4fbec | |||
| 22515b9f0c | |||
| 49eff29fac | |||
| e3faa6db48 | |||
| 54163e612a | |||
| bb9897acbf | |||
| e06edbc6fe | |||
| d05a7233db | |||
| efdc370ca2 | |||
| 1d9dc39390 | |||
| f5c5d1fb57 | |||
| c2c69d2a8e | |||
| 1e13179d78 | |||
| ff03e6c2a8 | |||
| 71e4ddb7b4 | |||
| c1532e8e1f | |||
| 468f5dd0b1 | |||
| a4be4bcc56 | |||
| fe19e83d1e | |||
| 1928974f0a | |||
| 9161d5d3fb | |||
| 2825342c14 | |||
| 4b2cc293cf | |||
| cd75c6e502 | |||
| 3de0f27479 | |||
| 9c6fa52d76 | |||
| 1406c5c781 | |||
| 224ba9144d | |||
| 35a3c4e803 | |||
| 96bdb12014 | |||
| 9a953c7182 | |||
| 4ca1ea0595 | |||
| 5b4d1d0bae | |||
| ac94da49fd | |||
| 6ac102569e | |||
| 8bb58c35cb | |||
| 1137a38594 | |||
| 6a3fad4a3a | |||
| 43c935b79e | |||
| 1ef9329036 | |||
| feb203abc2 | |||
| 9ae39513d3 | |||
| c8b91b8e61 | |||
| c23a0ee4a8 | |||
| a90b578e9c | |||
| 328395dfea | |||
| a5baf69f57 | |||
| 62445265e6 | |||
| a18d19b6f7 | |||
| 8ef62fd670 | |||
| 0852fc134e | |||
| 191669ea1a | |||
| af28e9d319 | |||
| 22b00f4354 | |||
| 5b3860103e | |||
| 2604226810 | |||
| 6c25c52a50 | |||
| 8c6b665fc5 | |||
| c4a767e038 | |||
| fa40db9ce2 | |||
| bca42bf3de | |||
| 4d1c217905 | |||
| 855245068c | |||
| 583c6b4944 | |||
| ede2accb1c | |||
| edf7e2b4f0 | |||
| 758f59303a | |||
| 12b710d212 | |||
| fec6f7b85f | |||
| 22d1811e94 | |||
| 8262f8802c | |||
| 715425185b | |||
| dd260234e4 | |||
| 613df67e27 | |||
| 06258d3c74 | |||
| af801f1dcc | |||
| 0cae25d1d5 | |||
| 988cbc406d | |||
| 1ec288eb9a | |||
| bb4cf4eebc | |||
| 750a9bde7e | |||
| ec2ddfb477 | |||
| a472fe382a | |||
| 91c065377f | |||
| f8df8a0afe | |||
| 4f3bd8b91b | |||
| fa56a45026 | |||
| 2259629dba | |||
| 9af13304d5 | |||
| 6f4bcbb548 | |||
| b5c502714c | |||
| 33d688543d | |||
| 7fe60af017 | |||
| 24ba23f132 | |||
| ef7d753e03 | |||
| 4cd39bbcbd | |||
| 5b08350475 | |||
| f847267c3c | |||
| c298122393 | |||
| 8c7a59ed39 | |||
| b5e3467cc3 | |||
| aa6f11ee62 | |||
| 4d10b801bb | |||
| e78dbed50d | |||
| 7b853f2136 | |||
| 2906945525 | |||
| 93fe2e8f50 | |||
| 1b7111bb03 | |||
| c2dd57e895 | |||
| 8534679f04 | |||
| 7c83535528 | |||
| db8a0b3a6f | |||
| 262fb3314c | |||
| 3e5f946338 | |||
| 17a7820d96 | |||
| 320befbc53 | |||
| e9d42264c0 | |||
| 5abab316fb | |||
| 5b17cf6da3 | |||
| 177a57e4ef | |||
| b4cd2f065d | |||
| 59d420543f | |||
| 6305ac3f20 | |||
| c701d480b8 | |||
| 195709f629 | |||
| 084ae03ddb | |||
| 4725acd2e7 | |||
| 609afe6de3 | |||
| 17ea6e66c8 | |||
| b8144ef394 | |||
| bb700daba1 | |||
| 444e82d520 | |||
| 5b9c2383cf | |||
| 908609c3f8 | |||
| b22eeeab9d | |||
| b625b724c7 | |||
| 54bb1e79d3 | |||
| 643dc749f2 | |||
| 4dd402f49a | |||
| f0aa7d3212 | |||
| 721e4ec5d8 | |||
| e632f0df3f | |||
| c371fea966 | |||
| bd63cc0d6b | |||
| 35a86586ab | |||
| 00fa7e7afe | |||
| e9535abe9f | |||
| dac870635f | |||
| 1c2a45aa98 | |||
| 743800155c | |||
| ee5fed4dbb | |||
| 444cdb6b9a | |||
| 894239a034 | |||
| b8091509f4 | |||
| 0239816790 | |||
| f0bda85e87 | |||
| 5a42572d79 | |||
| 8cd9dfaef4 | |||
| fa6b903edc | |||
| 747341f8eb | |||
| da48349248 | |||
| c83b1d9f67 | |||
| a7e4ced942 | |||
| e45a14e8df | |||
| 953a14ce13 | |||
| ee79088f92 | |||
| 422b462bb8 | |||
| 550039df32 | |||
| 1e2614ece9 | |||
| a4c2eff0de | |||
| b6d868a176 | |||
| 1b31dc3b72 | |||
| b47e7155ab | |||
| ca2d91a7f8 | |||
| 89d70ff2cb | |||
| e796ed7d72 | |||
| ebb375dfda | |||
| 7f30be5eba | |||
| 986a7783ab | |||
| 47be7419d2 | |||
| 6c1434724f | |||
| f6a0121f1a | |||
| c7b7bd928c | |||
| 7cce201567 | |||
| 5fe1188c5b | |||
| a95d7117c7 | |||
| b569af10a5 | |||
| cff91a5235 | |||
| 0aee8e6d53 | |||
| 00a18714e4 | |||
| aecf675627 | |||
| ee3898085c | |||
| 73e5c70e39 | |||
| 3694c008ea | |||
| 915e41e0ac | |||
| b0e9f2a255 | |||
| 1d7b17f149 | |||
| 45d3a1d490 | |||
| dc574f6606 | |||
| 70d591d505 | |||
| ea70fb9404 | |||
| c09f25b8d0 | |||
| 132c041182 | |||
| c886341ac1 | |||
| 45121fa2f8 | |||
| 526523c5a3 | |||
| 4fab74ffdd | |||
| 27a7c792b0 | |||
| d25a2a79d8 | |||
| 6ed6802123 | |||
| 76f4c5bfe3 | |||
| f9f887535f | |||
| f88b208a57 | |||
| 30025abbed | |||
| 84ac4f343d | |||
| 0773ad19e6 | |||
| c89a45e08b | |||
| d632fcc2a2 | |||
| b2087497ae | |||
| ece6f2a907 | |||
| e5472df42c | |||
| f395aa1257 | |||
| a326867444 | |||
| 732c29b2cb | |||
| 45c7f8b9f6 | |||
| 32f0be300a | |||
| 24fe803997 | |||
| 41eeaf8cd7 | |||
| daa7328a86 | |||
| bf656716ed | |||
| 372366adc0 | |||
| 6b4566fe9a | |||
| 59836490a3 | |||
| e82902f387 | |||
| 20760b8ce2 | |||
| 8ab7ddd5ca | |||
| 60cbfc54e8 | |||
| 32f755dc10 | |||
| 855fb66aef | |||
| 0064635fe7 | |||
| fb6142cb9d | |||
| 5e62690318 | |||
| 2750b471ba | |||
| 5d4dbb3eb5 | |||
| 08471d634f | |||
| 6a64a2849c | |||
| dfd40deb5c | |||
| bc28411096 | |||
| 2f330e16a6 | |||
| 4dbd3b05e9 | |||
| 4a93c91011 | |||
| d1dc39447d | |||
| 8f1b0db9ae | |||
| e1e54ae2da | |||
| d2e0712a92 | |||
| 43cb660f80 | |||
| 804d0822f2 | |||
| e32f76c8db | |||
| b339ea1866 | |||
| 18f53a9350 | |||
| 9d42b9d4f4 | |||
| 574fa40950 | |||
| 561dc7e8c5 | |||
| 1fe1155834 | |||
| 52ae479593 | |||
| 5940f95c3f | |||
| f188a48f48 | |||
| c8f4f52e4f | |||
| cdae42d897 | |||
| 291edf8319 | |||
| 53186e12d2 | |||
| 8c2534b572 | |||
| 896832f05c | |||
| 80c5e10c9d | |||
| 12a18a4e03 | |||
| 95bca8599a | |||
| 4e8df0bc79 | |||
| b49aa4413f | |||
| 03776dac88 | |||
| 2a3f16a4d8 | |||
| 26fbe3babf | |||
| e28e8b56b1 | |||
| 536b080451 | |||
| 952d16458c | |||
| 2dc6aa71de | |||
| 94f51bda81 | |||
| 6c056e4289 | |||
| 9e98968d04 | |||
| 56925eff71 | |||
| 012f04acd2 | |||
| 388b680547 | |||
| 4c7e16a33c | |||
| d997dae36c | |||
| 920adde65f | |||
| 7066a55813 | |||
| 6b24197cf1 | |||
| 209a3874c8 | |||
| abc74e21d0 | |||
| 42478ac950 | |||
| 7dfe4af359 | |||
| c066c24449 | |||
| 4a6d338a08 | |||
| a9cb8de197 | |||
| 683955bb5e | |||
| db2930ed33 | |||
| a763b497a2 | |||
| ed86945e14 | |||
| 5a4ca8479f | |||
| 694ea6abe4 | |||
| 9018e9a252 | |||
| 8bd6f45fb2 | |||
| a5c4cb9438 | |||
| e78b399810 | |||
| 53f53200df | |||
| f3f627572f | |||
| 916a84b041 | |||
| 1f0f8ae1b4 | |||
| db67132ce2 | |||
| 125110e805 | |||
| fb2b4b2797 | |||
| 539f1cab81 | |||
| 04e58e38f0 | |||
| 2194dd5899 | |||
| 2799b63869 | |||
| 6d94535ff8 | |||
| 8fa09793eb | |||
| 8f29d012a2 | |||
| 0a577290ba | |||
| 79d5bdd78b | |||
| 23dd433b20 | |||
| 194faf5eff | |||
| 8f9d36085b | |||
| 2342956bb1 | |||
| 892c415382 | |||
| 63ccb0fbee | |||
| 1136916768 | |||
| e6b69fe2f4 | |||
| 9ca2b70ee3 | |||
| 1f976ae79a | |||
| 79e57e8965 | |||
| 795a7fcb3b | |||
| 85a551fb63 | |||
| b9d6b59991 | |||
| 99ee15f65f | |||
| 487e9ae95a | |||
| d7521d04a7 | |||
| 6af132ab18 | |||
| f42c1df7a9 | |||
| c434d82807 | |||
| b694019e19 | |||
| e0185bd0c3 | |||
| e13683874a | |||
| 28ac386e08 | |||
| 4b9da896ab | |||
| 1870b3fba4 | |||
| fb079be1bd | |||
| fc342a90ee | |||
| 269855a862 | |||
| bdacbac1b2 | |||
| 88877241e3 | |||
| 6561216356 | |||
| 01a4770af4 | |||
| 874129f41c | |||
| 4e0cd2f9b0 | |||
| 64c361f806 | |||
| f2c9aec380 | |||
| 68582b65d1 | |||
| 2ef8b83da0 | |||
| 218b36ab8d | |||
| 8ebcbe8636 | |||
| 5b7deea769 | |||
| eb75805c88 | |||
| 26fea8bf52 | |||
| 44c5e23bc1 | |||
| b4f424737c | |||
| 9484e549b4 | |||
| 2e054bf9d9 | |||
| c75e65eb4c | |||
| 18c41a4846 | |||
| 61735c2790 | |||
| 461006b3b8 | |||
| e872a4c0ac | |||
| 5af2d1b472 | |||
| 6044929214 | |||
| 1175fd4150 | |||
| f293394cf4 | |||
| c0c11cf928 | |||
| ecbc73d33b | |||
| 4f9d22bcb0 | |||
| 7a261ba649 | |||
| 81d95a9108 | |||
| 57b46c22ef | |||
| 7ecfa52517 | |||
| 8de5e88469 | |||
| 7f8988278c | |||
| 26b2256fa8 | |||
| 67facf5e69 | |||
| 92e2385650 | |||
| ebec731098 | |||
| 2fdcd75eab | |||
| ccb5105ff7 | |||
| efeaf9b8d1 | |||
| 9e7d7a366d | |||
| af4a07d12f | |||
| a3b83ecace | |||
| 955025a3a1 | |||
| c0dd3db439 | |||
| afe1c7b341 | |||
| 6d53f5745b | |||
| b3d9d4cc6e | |||
| 03b10cb446 | |||
| 53fcb5e639 | |||
| b87dad75fc | |||
| 03a7332f8a | |||
| c8a848766d | |||
| d21ad2ae43 | |||
| e1ce3d8456 | |||
| 8b6c3c288b | |||
| 0f9433c7ce | |||
| 0275791b2c | |||
| dd474f72ea | |||
| 1b918413cb | |||
| eb2aada6d9 | |||
| 6dcf645e88 | |||
| f61bf56d14 | |||
| b78fca4290 | |||
| b6cc7c823a | |||
| da2bf87c2b | |||
| 15ed64791f | |||
| fc7751a4e3 | |||
| a98dc97e48 | |||
| 82dc397171 | |||
| 20e92bbf95 | |||
| a30e9ac37f | |||
| 09862cdd1c | |||
| 30ed03be15 | |||
| 005fea0701 | |||
| e0bd7f3e84 | |||
| abec57becd | |||
| cdc74ada43 | |||
| 281ee487cb | |||
| 02efc63109 | |||
| bdf1295693 | |||
| c3b8e90a3e | |||
| 8e0216281d | |||
| e721f6c942 | |||
| 20eb11bf3f | |||
| 9a4a9a805f | |||
| 74920d70b7 | |||
| 5a2b693092 | |||
| e2bae2e187 | |||
| 1c9b9d5e0f | |||
| 0d5b92520b | |||
| 809020965f | |||
| d612b64b4b | |||
| 7c15562236 | |||
| 2cd312f396 | |||
| 74a8455e13 | |||
| db83a36fc4 | |||
| 2f88cf34ea | |||
| d796de176c | |||
| d44da46e1e | |||
| 9d12314f22 | |||
| 2e83d4e9c8 | |||
| c352a057e8 | |||
| 8293a06d40 | |||
| 6b78d139ee | |||
| c95b3dd04b | |||
| 51c33e0701 | |||
| a707ded8b2 | |||
| 0756b8ff90 | |||
| a2d1a74e3d | |||
| 840d679e49 | |||
| 658d35739a | |||
| cbf727460b | |||
| 22d4592a1a | |||
| 446ef4d577 | |||
| 4aae8eabca | |||
| 53deeec405 | |||
| 6a77d1d1c6 | |||
| 6e789e0697 | |||
| f2db638138 | |||
| 5bbe04dd69 | |||
| 79087dda1e | |||
| 6d9778e913 | |||
| d7f98f26d0 | |||
| fc2cb5f533 | |||
| 995beaefa1 | |||
| b71f62fcad | |||
| 5388697b0c | |||
| 377f454872 | |||
| e3c6e9b3f9 | |||
| 82909e892f | |||
| 6133c11f38 | |||
| 25de0c763f | |||
| 941b9d0ec1 | |||
| 136d123ba2 | |||
| c036733ff8 | |||
| 9ac1a088b5 | |||
| 62289d1310 | |||
| a29d7cb8b3 | |||
| 8264f89be2 | |||
| 98f7b9d647 | |||
| 711d0017df | |||
| 6bf0f0faf3 | |||
| 021f9f64b4 | |||
| 925979c534 | |||
| b9c53b877c | |||
| a081b37d6d | |||
| 01107f5a07 | |||
| a324d9f8d9 | |||
| 72a48b656f | |||
| 9834392df8 | |||
| 9545a3e7f3 | |||
| 3428df7bac | |||
| d71477e8a3 | |||
| c100d54aa5 | |||
| 721fc5e7ac | |||
| cb0360008b | |||
| 31e0f5e177 | |||
| bf78be5e81 | |||
| ba1a0f7763 | |||
| f77fe887ae | |||
| b4c8269729 | |||
| 7b49631c73 | |||
| 57e5fea9cc | |||
| 046e0f7710 | |||
| 76d3b45fb8 | |||
| 3dba3a4d06 | |||
| 2b78a8b617 | |||
| c73bd8b904 | |||
| 3727b7391a | |||
| a3cab2d098 | |||
| 92d8d9ad05 | |||
| 9ce86699ed | |||
| c051240cd4 | |||
| 978d80e198 | |||
| ccd47865bd | |||
| 725b60245f | |||
| 23c427495b | |||
| cac9293d87 | |||
| 137d757631 | |||
| 06052da308 | |||
| 9cd8cb0662 | |||
| 3430f915d3 | |||
| f172cc86b3 | |||
| 22f6607545 | |||
| 95c96bbffc | |||
| f76bf0cee1 | |||
| 6ae8c69efa | |||
| c8ef152d08 | |||
| b058f017e0 | |||
| 04bb20a8e4 | |||
| 0ffc7ef04c | |||
| 9153cc678d | |||
| d9ca2f9e46 | |||
| 2b8e9009a9 | |||
| 853b22bf73 | |||
| 93ed14aba2 | |||
| ded9e12051 | |||
| f5e4369384 | |||
| 9134d0f087 | |||
| 9e6b88c920 | |||
| 21685704b6 | |||
| d4f7cc6d6f | |||
| 374af06be8 | |||
| 2a9ffc41b5 | |||
| cb84378637 | |||
| 8b42268d7e | |||
| 9c05b99951 | |||
| cad1004d28 | |||
| 0784a62e89 | |||
| 70dbebf727 | |||
| a22f0515e0 | |||
| d5087108d0 | |||
| 29822ad719 | |||
| b47c766b24 | |||
| 67bb9f18e6 | |||
| a33de97309 | |||
| c81c98f524 | |||
| 06079aa022 | |||
| 1e66105813 | |||
| 03dec3dcf6 | |||
| 707e610625 | |||
| 560b07f3ca | |||
| 3ca8446729 | |||
| aad0ec464f | |||
| 3bafd3f9f2 | |||
| 89a8a1d62a | |||
| 0e76a06c46 | |||
| 137d25cdbb | |||
| 29214ee77e | |||
| 3e922260d3 | |||
| a2c92066ba | |||
| b3530fa2dd | |||
| 3219de14ee | |||
| 8906ea6707 | |||
| a3f9832b4e | |||
| d8e9b2d2b4 | |||
| 67bd59e343 | |||
| 8b85428f82 | |||
| 99f44b62ed | |||
| ea6c30e2bd | |||
| 3e3aa0352d | |||
| 06c64fa222 | |||
| ebfa8da621 | |||
| 231daf9977 | |||
| 5645f15c58 | |||
| 70473c80a0 | |||
| 2f4ae5ebc8 | |||
| 95fc2c2e94 | |||
| 597155af11 | |||
| 69f2c29679 | |||
| e68fd292ba | |||
| b7129680c3 | |||
| b0062b6135 | |||
| 30d3472b62 | |||
| 48e3b820a3 | |||
| e845124498 | |||
| 72c2753cab | |||
| 5ff7ca9b4c | |||
| 5392788a72 | |||
| 0602d89de0 | |||
| 5d3c3ce818 | |||
| fc91e7b9ce | |||
| 1c5a0bd0f4 | |||
| a7cd1c1210 | |||
| 9ecc2410a6 | |||
| ebf2680335 | |||
| 0294266863 | |||
| be04ee38b7 | |||
| b73ef690bb | |||
| d5189a952a | |||
| 1535e5763d | |||
| 87af894198 | |||
| 3ecdbe6d64 | |||
| 28220bbde7 | |||
| f6908517e2 | |||
| 3cb19a4ceb | |||
| 433c5b1cfe | |||
| cb51dc3e40 | |||
| 6ff569edf7 | |||
| 1e9e2ab603 | |||
| d1aa2ebfe3 | |||
| 9701fa9807 | |||
| fc7d427407 | |||
| 0bee7b0aaa | |||
| 722ab2c2ca | |||
| b547c28e72 | |||
| 9ed5581b39 | |||
| 17b25167b1 | |||
| 1e922e4724 | |||
| 3c6096967b | |||
| ef99a5d92d | |||
| 94167f1954 | |||
| ada8f8beb8 | |||
| ea11a8c348 | |||
| 73362fd852 | |||
| b611a6b099 | |||
| e2c0d814bb | |||
| c3b7d3de8b | |||
| 0d20ab0378 | |||
| b89180a549 | |||
| 958e1fcadf | |||
| 0793519bb0 | |||
| f5332a8b59 | |||
| 92d916fa57 | |||
| d1b7b280c5 | |||
| c85774a897 | |||
| 113e15c391 | |||
| 2481578533 | |||
| 8950b3535a | |||
| b4701ac83c | |||
| 9e58de380e | |||
| df5140532d | |||
| 05c6260499 | |||
| 6dd1e80ce5 | |||
| 7588b592df | |||
| 533d04e8f3 | |||
| bf434987f9 | |||
| d5f8c4b474 | |||
| a81115d2f3 | |||
| 3618465853 | |||
| e20588a3da | |||
| fafa2023d1 | |||
| 32823bd55a | |||
| 37a851ef98 | |||
| 9099a04b2d | |||
| af246c553e | |||
| 42e515dfec | |||
| 15da75c473 | |||
| e90b2957a6 | |||
| 9d2d7e646a | |||
| b0f77fddf1 | |||
| 276bc48a24 | |||
| 9d475122e3 | |||
| 6f01769c4d | |||
| 6d4cb1ff4c | |||
| 5495def631 | |||
| a6a2243099 | |||
| 90172d03ef | |||
| 6f321fc0e3 | |||
| c8e2b18f35 | |||
| 7956395c7c | |||
| d5cbd33a59 | |||
| 25fb7daee9 | |||
| afbb6fe4ff | |||
| 03e2fa60fa | |||
| e0fcaae71e | |||
| efdc67e1ba | |||
| cb8f8c535c | |||
| ed9e6a83e6 | |||
| e9325f77e0 | |||
| 2ff6b62854 | |||
| 8e4750bb0b | |||
| 8dbe1da419 | |||
| c8cf662c1b | |||
| 4ff908701c | |||
| 81a1364ae0 | |||
| 57f1438949 | |||
| 45b6929dd4 | |||
| f66053508b | |||
| f29c812aa7 | |||
| b30b91ca6d | |||
| 82b11909f9 | |||
| 5bc07126a9 | |||
| 4836418528 | |||
| 4547a18aab | |||
| ed2f9e0035 | |||
| 20011c8647 | |||
| 1599d943f4 | |||
| b03b2a52bb | |||
| ad44fecc10 | |||
| 64b428a992 | |||
| 4c3ec3259c | |||
| 39f6dda5d8 | |||
| 3f73c12f83 | |||
| 5702a34d69 | |||
| 5487058744 | |||
| c75af891b2 | |||
| 3c1a598fd5 | |||
| d7c4ceba92 | |||
| 54e10c7b55 | |||
| 9327fce5ca | |||
| 0bd55565fe | |||
| 48121355f3 | |||
| d5d8c86e8e | |||
| 7569534cfd | |||
| e0fd7ff1f0 | |||
| d9217329eb | |||
| e3fa8c53bf | |||
| 4bb7f3cf83 | |||
| 26a677074c | |||
| 601f615a35 | |||
| c45b6034c7 | |||
| 2c2cfbe07d | |||
| 3f730897a0 | |||
| 792915bb3a | |||
| 5de83dc86a | |||
| 7d5eb31f25 | |||
| 5910bbfa5d | |||
| 6fd26cf0f7 | |||
| 4ec1830847 | |||
| ee81e468ab | |||
| fcd824042a | |||
| 0df0b9774d | |||
| b81c634800 | |||
| 1b9541b2b6 | |||
| a7ef272cb5 | |||
| bafa576191 | |||
| 461809134c | |||
| aade9540d0 | |||
| 93b55d7936 | |||
| faeac14054 | |||
| 6148c337d9 | |||
| a4fcd4919d | |||
| b7d6948081 | |||
| 8fda6f48ce | |||
| ad2023083f | |||
| e5e090f385 | |||
| 83bf58cb93 | |||
| 21a9296e85 | |||
| d4a083c6ba | |||
| 8a29a3e9e4 | |||
| 78e4a4e92b | |||
| 4ac1c8c928 | |||
| abed5269b2 | |||
| 0455514ea9 | |||
| 071c0e75c8 | |||
| c6823c617a | |||
| 5142761c85 | |||
| 950515f219 | |||
| a16921b2e9 | |||
| 9faf8bedd5 | |||
| 7a33ead400 | |||
| 1c6c5f982a | |||
| f5ef1dd683 | |||
| 59eb3cfea5 | |||
| 761ceab8d2 | |||
| f62f1dff83 | |||
| 9a4769eb47 | |||
| a2cf7ed13c | |||
| 1d97c0e61d | |||
| d2c8c14f8b | |||
| e67089c5b4 | |||
| fbe9ba88b9 | |||
| e75b9dd848 | |||
| a5c1351cde | |||
| 34a525e74d | |||
| bcc1801edb | |||
| 58e99cd2d4 | |||
| 905973fded | |||
| 709282dfd4 | |||
| f7c518d145 | |||
| 7779b864c1 | |||
| 717ebd02af | |||
| 4a5c027cf4 | |||
| e57b35c77e | |||
| a1caf0792d | |||
| 317d425ff2 | |||
| 84d0cef869 | |||
| b4d2bff379 | |||
| 99742dd7b3 | |||
| f0e7921347 | |||
| d152aabd82 | |||
| 35fb50c226 | |||
| 0c6c406cf5 | |||
| 0465a264aa | |||
| 7f8a98f290 | |||
| aaa24271e9 | |||
| c8ce35e4b9 | |||
| e4cf0cb61f | |||
| 934bbe2283 | |||
| cf3a73a548 | |||
| c86e6258af | |||
| c06c0ad088 | |||
| 7b12ef172a | |||
| 6cb75bc53a | |||
| 4ce8c56fc9 | |||
| 1034f66555 | |||
| 2627e2a7dd | |||
| 93209acab6 | |||
| 36dc01463f | |||
| f9730a4a6d | |||
| d4de820fa3 | |||
| 7b0bc5a059 | |||
| 96a8f54933 | |||
| 18a4775984 | |||
| 2dc8038257 | |||
| 8de9a7dd31 | |||
| 1e7c83a0e7 | |||
| ef7281f362 | |||
| 016a90610f | |||
| 2e3b5e6d39 | |||
| f862f962e0 | |||
| da76475a51 | |||
| 521053adf8 | |||
| a234671ad2 | |||
| 5214162718 | |||
| 2845b2ea4b | |||
| d652e3c32f | |||
| 974b66aa60 | |||
| 6fb07e8ae3 | |||
| 7ddc578d1f | |||
| 6ad4a538eb | |||
| f47f27890c | |||
| 319e390b87 | |||
| b589dafb48 | |||
| 3872501d7f | |||
| 6f33e529e5 | |||
| 9ec56fb323 | |||
| cf65ec1448 | |||
| 2f8e492fc6 | |||
| 18063bbbbf | |||
| 75866f2e86 | |||
| 9457fd7ac0 | |||
| 692890f75d | |||
| 5b3467290f | |||
| e711c7b993 | |||
| 25d3b69fde | |||
| db72b01e99 | |||
| e9e9a954ac | |||
| a7c1d6bf59 | |||
| 2e4486b49b | |||
| f7a1773105 | |||
| b9782ddb7c | |||
| 79283a087a | |||
| 7abae785cb | |||
| 132c979174 | |||
| 673df114cc | |||
| 33eb1a7ab7 | |||
| f8b730dbc8 | |||
| 406005815b | |||
| 72edf8e89d | |||
| 4c483e506e | |||
| 4fd0b0e461 | |||
| c309339666 | |||
| 3185ca0f36 | |||
| 5f96f5dbb7 | |||
| 2dadace9e0 | |||
| e6edae010a | |||
| 1b7b530906 | |||
| c7c25895c2 | |||
| da415dcbbd | |||
| bf2edb3776 | |||
| dd7010f2cd | |||
| cc7294cadb | |||
| 1f809a129d | |||
| edcdd0ab8e | |||
| da5a147393 | |||
| 321ca7e0ff | |||
| 04b9c9ae1d | |||
| 69d4a44b3c | |||
| 237fb15d19 | |||
| 124e90696c | |||
| d2ff657b81 | |||
| 8a39c5470e | |||
| 08d55a40ff | |||
| 1747439048 | |||
| 419d0ba99a | |||
| 39347207da | |||
| fe129f33ce | |||
| 2ed31b0b8a | |||
| 7b14e28ffa | |||
| 4c84e5f9a3 | |||
| b97006cda9 | |||
| 09d6d280a5 | |||
| a1b480b83e | |||
| 3a9cf26462 | |||
| 00db21d443 | |||
| dbc591ab44 | |||
| ebc9990f71 | |||
| 3a43362536 | |||
| c9144ea4c6 | |||
| 77ce9fbef3 | |||
| 2b29a23b26 | |||
| 38356d622a | |||
| b0c898b97e | |||
| ec13c73f03 | |||
| edb7bc2fc3 | |||
| dee8a6d37a | |||
| f2da4416ae | |||
| f72475b172 | |||
| 1af0a7845d | |||
| 01d753cfc3 | |||
| 64dcd1d0d7 | |||
| 5ddbe33783 | |||
| 8489f6e02b | |||
| 434a69f15a | |||
| 922810b157 | |||
| b24d16534d | |||
| 861833b792 | |||
| 0e666c8e17 | |||
| b9308428ed | |||
| 2ea9e20bd4 | |||
| c525b15de2 | |||
| 3fb32cc029 | |||
| 3f0bb334ed | |||
| 2573f77c96 | |||
| 6f91f99649 | |||
| b41613a67f | |||
| 806dc7f21b | |||
| abe4b20d46 | |||
| 2b79302d2b | |||
| 0574712c5c | |||
| 57774bb53e | |||
| 15d5213146 | |||
| 2c4d2af648 | |||
| 010c73675e | |||
| 6d958038cb | |||
| 4de761f624 | |||
| 1990eb70d4 | |||
| fe1d0e8f4c | |||
| a5c97f8b57 | |||
| ecd62f9fcc | |||
| 33b7f5ffb7 | |||
| c4e31235d5 | |||
| 729bdfd752 | |||
| 293805d0ef | |||
| 5255d356f3 | |||
| 03b0045ba9 | |||
| 01ed59348f | |||
| b82be5aac8 | |||
| 3e7519ff4f | |||
| 5bd661720d | |||
| 4039b87453 | |||
| f98ebcac7d | |||
| 7763f666fd | |||
| f71d111641 | |||
| 9dae8f2b66 | |||
| ea4f885923 | |||
| ba5b250faf | |||
| 2bd9e8adf1 | |||
| 0b40961549 | |||
| 26aa839648 | |||
| 0cf5cf0bfa | |||
| 9d84c6a435 | |||
| 06a5922b9d | |||
| 7e2e5c07c1 | |||
| 8f430b75c6 | |||
| 24b6e73b41 | |||
| d757c5c048 | |||
| beab3a36e1 | |||
| 4259d2d256 | |||
| 4e761e9f1d | |||
| 62e0ca27d1 | |||
| c74b034372 | |||
| cff1d0e2ac | |||
| 6a3b6ff05f | |||
| 48f23caff6 | |||
| 9bf8bf7c0f | |||
| 58dc38315a | |||
| 86d34b1341 | |||
| 77ee0a7aab | |||
| fa86ad2322 | |||
| 0d7983c905 | |||
| 242f4496e5 | |||
| 650268b474 | |||
| b97b0bfde3 | |||
| c2cb1fd828 | |||
| 420e2b8518 | |||
| 6369200c6e | |||
| dce5c3f1b0 | |||
| aad4c38574 | |||
| 72d9418fd5 | |||
| 1da52687ae | |||
| de80aa2e42 | |||
| 9f7f51fc82 | |||
| dee0cf0424 | |||
| 575339bdb8 | |||
| cac21d43ad | |||
| a7ee06aeca | |||
| 78e44be4d1 | |||
| 82fb489cdd | |||
| d3bcc73216 | |||
| de88587dde | |||
| 1b5766ac77 | |||
| ea281eb57c | |||
| 6676124c5b | |||
| 14e3951d7e | |||
| 99ce92b794 | |||
| 923cab1fc0 | |||
| 882ac192a2 | |||
| db72b90d3a | |||
| 7cc4bff37c | |||
| ca66431f14 | |||
| 2e549efa1b | |||
| e30806413a | |||
| c4cad9ced9 | |||
| f03e7cf2a9 | |||
| f6e2e91a4d | |||
| ee296ff09d | |||
| f7b3f95bcb | |||
| bea00062b4 | |||
| d586befe30 | |||
| 4269b2862f | |||
| ccda615144 | |||
| e142db5400 | |||
| 4d9e28ce09 | |||
| 7cb4914239 | |||
| ed498c296d | |||
| 27950b108b | |||
| 6a3ca43a1d | |||
| 08f303d73d | |||
| e1f905ffe0 | |||
| 290b677dbe | |||
| c1855bbf2a | |||
| 468b2bf877 | |||
| 5b88f73bf5 | |||
| b8f7f267ff | |||
| b8d663139b | |||
| b725ab4d75 | |||
| b683adb0ba | |||
| 17a84755ba | |||
| d58bd76f8c | |||
| d11c2e5b1b | |||
| 61f6422f4d | |||
| 3262b0e551 | |||
| c3ab05b40e | |||
| 8c3490eaf6 | |||
| 57cf4311a0 | |||
| e1d7bf74ba | |||
| 8f6a51a4f8 | |||
| 4748ad961b | |||
| a9131b0841 | |||
| 467360bc3e | |||
| 90ffc2be3b | |||
| 11bbb0880d | |||
| e69514a338 | |||
| 66eac90262 | |||
| 2ddefee334 | |||
| 456f25d9e1 | |||
| e447a428d0 | |||
| c52c2306c3 | |||
| 68c07a11d4 | |||
| b4b8c74fd7 | |||
| 908524ff2e | |||
| bfd8f52e5e | |||
| 40ef42f18d | |||
| 057514398c | |||
| 2f1975eca7 | |||
| 199325b458 | |||
| 7bb737e4ab | |||
| 4a381a013c | |||
| 795601e243 | |||
| e0f902ef50 | |||
| a8c605da58 | |||
| 1330c28758 | |||
| 06cbaa82f2 | |||
| bdd3cd0795 | |||
| bb6fc86e0a | |||
| 900d28e002 | |||
| d41904eab0 | |||
| 22063acc38 | |||
| b61ecc11ae | |||
| ded9f2cc6a | |||
| a7c136cdeb | |||
| d1e75447a0 | |||
| 5263677365 | |||
| de6d5de360 | |||
| 66478ba28e | |||
| c6ed595019 | |||
| 7dd98a564c | |||
| 19d2417ffe | |||
| da2d9f6ed3 | |||
| 6b0256ae4c | |||
| 5ca14e42a6 | |||
| d150c439d4 | |||
| 9952900ca8 | |||
| bc2f1a2c82 | |||
| ec1c5b278c | |||
| 207cb4e6dd | |||
| f01770ba3c | |||
| dc2236c664 | |||
| 112e2a866a | |||
| 8add25ef19 | |||
| 4863b89e62 | |||
| f63dcd82f4 | |||
| 25b35c542a | |||
| fc3060d2d0 | |||
| 8f4cbc5a5c | |||
| 34cd2d3e77 |
14
.gitignore
vendored
14
.gitignore
vendored
@ -26,3 +26,17 @@ Thumbs.db
|
||||
*.dat
|
||||
*.txt
|
||||
*.log
|
||||
|
||||
*.ipch
|
||||
*.ipch
|
||||
*.ipch
|
||||
|
||||
*.db-wal
|
||||
|
||||
*.db-shm
|
||||
|
||||
*.db
|
||||
|
||||
*.opendb
|
||||
|
||||
DesktopEditor/fontengine/js/common/freetype-2.10.4
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <list>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
@ -123,15 +123,15 @@ namespace XMLTools
|
||||
private:
|
||||
std::wstring m_Name;
|
||||
std::wstring m_ElementText;
|
||||
std::map<std::wstring, std::wstring> m_AttributeMap;
|
||||
std::map<std::wstring, int> m_ChildMap; //for uniq
|
||||
std::unordered_map<std::wstring, std::wstring> m_AttributeMap;
|
||||
std::unordered_map<std::wstring, int> m_ChildMap; //for uniq
|
||||
std::list<XMLElement> m_Elements;
|
||||
|
||||
typedef std::list<XMLElement>::iterator ElementsIterator;
|
||||
typedef std::list<XMLElement>::const_iterator ElementsIteratorConst;
|
||||
|
||||
typedef std::map<std::wstring, std::wstring>::iterator AttMapIterator;
|
||||
typedef std::map<std::wstring, std::wstring>::const_iterator AttMapIteratorConst;
|
||||
typedef std::unordered_map<std::wstring, std::wstring>::iterator AttMapIterator;
|
||||
typedef std::unordered_map<std::wstring, std::wstring>::const_iterator AttMapIteratorConst;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ namespace DocFileFormat
|
||||
|
||||
if (_webHidden)
|
||||
{
|
||||
XMLTools::XMLElement * webHidden = new XMLTools::XMLElement ( L"w:webHidden" );
|
||||
XMLTools::XMLElement *webHidden = new XMLTools::XMLElement ( L"w:webHidden" );
|
||||
parent->AppendChild( *webHidden );
|
||||
RELEASEOBJECT( webHidden );
|
||||
}
|
||||
@ -141,322 +141,308 @@ namespace DocFileFormat
|
||||
{
|
||||
int nProperty = 0; //for unknown test
|
||||
|
||||
switch ( (int)( iter->OpCode ) )
|
||||
switch ((int)(iter->OpCode))
|
||||
{
|
||||
case sprmOldCIstd :
|
||||
case sprmCIstd : // style id
|
||||
case sprmOldCIstd:
|
||||
case sprmCIstd: // style id
|
||||
{
|
||||
if (_isRunStyleNeeded && !_webHidden)
|
||||
{
|
||||
_currentIstd = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
_currentIstd = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
if (_currentIstd < _doc->Styles->Styles->size())
|
||||
{
|
||||
appendValueElement( parent, L"rStyle", StyleSheetMapping::MakeStyleId( _doc->Styles->Styles->at( _currentIstd ) ), true );
|
||||
appendValueElement(parent, L"rStyle", StyleSheetMapping::MakeStyleId(_doc->Styles->Styles->at(_currentIstd)), true);
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
||||
case sprmCFBiDi :
|
||||
appendFlagElement( parent, *iter, L"rtl", true );
|
||||
_isRTL = true;
|
||||
break;
|
||||
|
||||
case sprmOldCFBold :
|
||||
case sprmCFBold :
|
||||
appendFlagElement( parent, *iter, L"b", true );
|
||||
break;
|
||||
|
||||
case sprmCFBoldBi :
|
||||
appendFlagElement( parent, *iter, L"bCs", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFCaps :
|
||||
case sprmCFCaps :
|
||||
appendFlagElement( parent, *iter, L"caps", true );
|
||||
break;
|
||||
|
||||
case sprmCFComplexScripts :
|
||||
appendFlagElement( parent, *iter, L"cs", true );
|
||||
break;
|
||||
|
||||
case sprmCFDStrike :
|
||||
appendFlagElement( parent, *iter, L"dstrike", true );
|
||||
break;
|
||||
|
||||
case sprmCFEmboss :
|
||||
appendFlagElement( parent, *iter, L"emboss", true );
|
||||
break;
|
||||
|
||||
case sprmCFImprint :
|
||||
appendFlagElement( parent, *iter, L"imprint", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFItalic :
|
||||
case sprmCFItalic :
|
||||
appendFlagElement( parent, *iter, L"i", true );
|
||||
break;
|
||||
|
||||
case sprmCFItalicBi:
|
||||
appendFlagElement( parent, *iter, L"iCs", true );
|
||||
break;
|
||||
|
||||
case 0x0875:
|
||||
appendFlagElement( parent, *iter, L"noProof", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFOutline:
|
||||
case sprmCFOutline:
|
||||
appendFlagElement( parent, *iter, L"outline", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFShadow:
|
||||
case sprmCFShadow:
|
||||
appendFlagElement( parent, *iter, L"shadow", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFSmallCaps:
|
||||
case sprmCFSmallCaps:
|
||||
appendFlagElement( parent, *iter, L"smallCaps", true );
|
||||
break;
|
||||
|
||||
case sprmCFSpecVanish:
|
||||
appendFlagElement( parent, *iter, L"specVanish", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFStrike:
|
||||
case sprmCFStrike:
|
||||
appendFlagElement( parent, *iter, L"strike", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFVanish:
|
||||
case sprmCFVanish:
|
||||
appendFlagElement( parent, *iter, L"vanish", true );
|
||||
break;
|
||||
|
||||
case 0x0811:
|
||||
appendFlagElement( parent, *iter, L"webHidden", true );
|
||||
break;
|
||||
|
||||
case sprmOldCIss:
|
||||
case sprmCIss:
|
||||
if (iter->argumentsSize > 0 && iter->Arguments[0] < 3) //Metaevan.doc
|
||||
appendValueElement( parent, L"vertAlign", FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ), true );
|
||||
break;
|
||||
|
||||
case sprmCRgLid0_80:
|
||||
case sprmCRgLid0:
|
||||
}break;
|
||||
case sprmCFBiDi:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"rtl", true);
|
||||
_isRTL = true;
|
||||
}break;
|
||||
case sprmOldCFBold:
|
||||
case sprmCFBold:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"b", true);
|
||||
}break;
|
||||
case sprmCFBoldBi:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"bCs", true);
|
||||
}break;
|
||||
case sprmOldCFCaps:
|
||||
case sprmCFCaps:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"caps", true);
|
||||
}break;
|
||||
case sprmCFComplexScripts:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"cs", true);
|
||||
}break;
|
||||
case sprmCFDStrike:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"dstrike", true);
|
||||
}break;
|
||||
case sprmCFEmboss:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"emboss", true);
|
||||
}break;
|
||||
case sprmCFImprint:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"imprint", true);
|
||||
}break;
|
||||
case sprmOldCFItalic:
|
||||
case sprmCFItalic:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"i", true);
|
||||
}break;
|
||||
case sprmCFItalicBi:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"iCs", true);
|
||||
}break;
|
||||
case 0x0875:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"noProof", true);
|
||||
}break;
|
||||
case sprmOldCFOutline:
|
||||
case sprmCFOutline:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"outline", true);
|
||||
}break;
|
||||
case sprmOldCFShadow:
|
||||
case sprmCFShadow:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"shadow", true);
|
||||
}break;
|
||||
case sprmOldCFSmallCaps:
|
||||
case sprmCFSmallCaps:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"smallCaps", true);
|
||||
}break;
|
||||
case sprmCFSpecVanish:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"specVanish", true);
|
||||
}break;
|
||||
case sprmOldCFStrike:
|
||||
case sprmCFStrike:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"strike", true);
|
||||
}break;
|
||||
case sprmOldCFVanish:
|
||||
case sprmCFVanish:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"vanish", true);
|
||||
}break;
|
||||
case 0x0811:
|
||||
{
|
||||
appendFlagElement(parent, *iter, L"webHidden", true);
|
||||
}break;
|
||||
case sprmOldCIss:
|
||||
case sprmCIss:
|
||||
{
|
||||
if (iter->argumentsSize > 0 && iter->Arguments[0] < 3) //Metaevan.doc
|
||||
appendValueElement(parent, L"vertAlign", FormatUtils::MapValueToWideString(iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12), true);
|
||||
}break;
|
||||
case sprmCRgLid0_80:
|
||||
case sprmCRgLid0:
|
||||
{ //latin
|
||||
LanguageId langid( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
|
||||
LanguageId langid(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
|
||||
|
||||
LanguageIdMapping* langIDMapping = new LanguageIdMapping( lang, Default );
|
||||
LanguageIdMapping* langIDMapping = new LanguageIdMapping(lang, Default);
|
||||
|
||||
langid.Convert( langIDMapping );
|
||||
langid.Convert(langIDMapping);
|
||||
|
||||
RELEASEOBJECT( langIDMapping );
|
||||
}break;
|
||||
|
||||
case sprmOldCLid:
|
||||
case sprmCRgLid1_80:
|
||||
case sprmCRgLid1:
|
||||
RELEASEOBJECT(langIDMapping);
|
||||
}break;
|
||||
case sprmOldCLid:
|
||||
case sprmCRgLid1_80:
|
||||
case sprmCRgLid1:
|
||||
{ //east asia
|
||||
LanguageId langid( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
|
||||
LanguageId langid(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
|
||||
|
||||
LanguageIdMapping* langIDMapping = new LanguageIdMapping( lang, EastAsian );
|
||||
LanguageIdMapping* langIDMapping = new LanguageIdMapping(lang, EastAsian);
|
||||
|
||||
langid.Convert( langIDMapping );
|
||||
langid.Convert(langIDMapping);
|
||||
|
||||
RELEASEOBJECT( langIDMapping );
|
||||
RELEASEOBJECT(langIDMapping);
|
||||
}break;
|
||||
case sprmCLidBi:
|
||||
{
|
||||
LanguageId langid(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
|
||||
|
||||
case sprmCLidBi:
|
||||
{
|
||||
LanguageId langid( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
|
||||
LanguageIdMapping* langIDMapping = new LanguageIdMapping(lang, Complex);
|
||||
|
||||
LanguageIdMapping* langIDMapping = new LanguageIdMapping( lang, Complex );
|
||||
langid.Convert(langIDMapping);
|
||||
|
||||
langid.Convert( langIDMapping );
|
||||
|
||||
RELEASEOBJECT( langIDMapping );
|
||||
}break;
|
||||
|
||||
case sprmCBrc80:
|
||||
case sprmCBrc:
|
||||
RELEASEOBJECT(langIDMapping);
|
||||
}break;
|
||||
case sprmCBrc80:
|
||||
case sprmCBrc:
|
||||
{ //borders
|
||||
XMLTools::XMLElement bdr( L"w:bdr" );
|
||||
BorderCode bc( iter->Arguments, iter->argumentsSize );
|
||||
appendBorderAttributes( &bc, &bdr );
|
||||
parent->AppendChild( bdr );
|
||||
}break;
|
||||
|
||||
case sprmCShd80:
|
||||
case sprmCShd:
|
||||
{ //shading
|
||||
ShadingDescriptor desc( iter->Arguments, iter->argumentsSize );
|
||||
|
||||
appendShading( parent, desc );
|
||||
}break;
|
||||
|
||||
case sprmOldCIco:
|
||||
case sprmCIco:
|
||||
case sprmCIcoBi:
|
||||
{//color
|
||||
colorVal->SetValue( FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ));
|
||||
XMLTools::XMLElement bdr(L"w:bdr");
|
||||
BorderCode bc(iter->Arguments, iter->argumentsSize);
|
||||
appendBorderAttributes(&bc, &bdr);
|
||||
parent->AppendChild(bdr);
|
||||
}break;
|
||||
case sprmCShd80:
|
||||
case sprmCShd:
|
||||
{ //shading
|
||||
ShadingDescriptor desc(iter->Arguments, iter->argumentsSize);
|
||||
|
||||
case sprmCCv:
|
||||
appendShading(parent, desc);
|
||||
}break;
|
||||
case sprmOldCIco:
|
||||
case sprmCIco:
|
||||
case sprmCIcoBi:
|
||||
{//color
|
||||
colorVal->SetValue(FormatUtils::MapValueToWideString(iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12));
|
||||
}break;
|
||||
case sprmCCv:
|
||||
{
|
||||
std::wstringstream sstream;
|
||||
|
||||
sstream << boost::wformat(L"%02x%02x%02x") % iter->Arguments[0] % /*G*/iter->Arguments[1] % /*B*/iter->Arguments[2];
|
||||
colorVal->SetValue(sstream.str());
|
||||
}break;
|
||||
|
||||
case sprmCOldHighlight:
|
||||
{
|
||||
appendValueElement( parent, L"highlight", FormatUtils::MapValueToWideString( iter->Arguments[1], &Global::ColorNameIdentifier[0][0], 17, 12 ), true );
|
||||
}break;
|
||||
case sprmCHighlight:
|
||||
{
|
||||
appendValueElement( parent, L"highlight", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorNameIdentifier[0][0], 17, 12 ), true );
|
||||
}break;
|
||||
|
||||
case sprmOldCDxaSpace:
|
||||
case sprmCDxaSpace:
|
||||
{
|
||||
appendValueElement( parent, L"spacing", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
}break;
|
||||
|
||||
case sprmCFtcBi :
|
||||
case sprmCOldHighlight:
|
||||
{
|
||||
appendValueElement(parent, L"highlight", FormatUtils::MapValueToWideString(iter->Arguments[1], &Global::ColorNameIdentifier[0][0], 17, 12), true);
|
||||
}break;
|
||||
case sprmCHighlight:
|
||||
{
|
||||
appendValueElement(parent, L"highlight", FormatUtils::MapValueToWideString(iter->Arguments[0], &Global::ColorNameIdentifier[0][0], 17, 12), true);
|
||||
}break;
|
||||
case sprmOldCDxaSpace:
|
||||
case sprmCDxaSpace:
|
||||
{
|
||||
appendValueElement(parent, L"spacing", FormatUtils::IntToWideString(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize)), true);
|
||||
}break;
|
||||
case sprmCFtcBi:
|
||||
{//default from FontTable
|
||||
size_t nIndex = FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize);
|
||||
if( nIndex < _doc->FontTable->Data.size() )
|
||||
size_t nIndex = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
if (nIndex < _doc->FontTable->Data.size())
|
||||
{
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>(_doc->FontTable->operator [] (nIndex));
|
||||
if (ffn)
|
||||
m_sDefaultFont = ffn->xszFtn;
|
||||
}
|
||||
}break;
|
||||
|
||||
case sprmCHpsBi :
|
||||
case sprmCHpsBi:
|
||||
{
|
||||
appendValueElement( parent, L"szCs",
|
||||
FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
appendValueElement(parent, L"szCs",
|
||||
FormatUtils::IntToWideString(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize)), true);
|
||||
}
|
||||
break;
|
||||
// Font Size in points (2~3276) default 20-half-points
|
||||
case sprmOldCHps :
|
||||
// Font Size in points (2~3276) default 20-half-points
|
||||
case sprmOldCHps:
|
||||
{
|
||||
appendValueElement (parent, L"sz",
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUChar (iter->Arguments, 0, iter->argumentsSize) ),
|
||||
true );
|
||||
appendValueElement(parent, L"sz",
|
||||
FormatUtils::IntToWideString(FormatUtils::BytesToUChar(iter->Arguments, 0, iter->argumentsSize)),
|
||||
true);
|
||||
}break;
|
||||
case sprmCHps :
|
||||
{
|
||||
appendValueElement (parent, L"sz",
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize) ), true );
|
||||
case sprmCHps:
|
||||
{
|
||||
appendValueElement(parent, L"sz",
|
||||
FormatUtils::IntToWideString(FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize)), true);
|
||||
}break;
|
||||
|
||||
case sprmCMajority :
|
||||
case sprmCMajority:
|
||||
{ //for complex props
|
||||
}break;
|
||||
|
||||
case sprmOldCHpsPos:
|
||||
case sprmOldCHpsPos:
|
||||
{ // The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
|
||||
short nVertPos = FormatUtils::BytesToUChar(iter->Arguments, 0, iter->argumentsSize);
|
||||
appendValueElement (parent, L"position", nVertPos, true);
|
||||
appendValueElement(parent, L"position", nVertPos, true);
|
||||
}break;
|
||||
case sprmCHpsPos:
|
||||
case sprmCHpsPos:
|
||||
{ // The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
|
||||
short nVertPos = FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
appendValueElement (parent, L"position", nVertPos, true);
|
||||
appendValueElement(parent, L"position", nVertPos, true);
|
||||
}break;
|
||||
|
||||
case sprmOldCHpsKern:
|
||||
case sprmCHpsKern:
|
||||
case sprmOldCHpsKern:
|
||||
case sprmCHpsKern:
|
||||
{
|
||||
appendValueElement( parent, L"kern", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
appendValueElement(parent, L"kern", FormatUtils::IntToWideString(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize)), true);
|
||||
}break;
|
||||
|
||||
case sprmOldCFtc:
|
||||
case sprmCRgFtc0:
|
||||
case sprmOldCFtc:
|
||||
case sprmCRgFtc0:
|
||||
{ // font family
|
||||
size_t nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
|
||||
if( nIndex < _doc->FontTable->Data.size() )
|
||||
size_t nIndex = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
|
||||
if (nIndex < _doc->FontTable->Data.size())
|
||||
{
|
||||
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( L"w:ascii" );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute(L"w:ascii");
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>(_doc->FontTable->operator [] (nIndex));
|
||||
m_sAsciiFont = ffn->xszFtn;
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sAsciiFont, true));
|
||||
rFonts->AppendAttribute( *ascii );
|
||||
RELEASEOBJECT( ascii );
|
||||
ascii->SetValue(FormatUtils::XmlEncode(m_sAsciiFont, true));
|
||||
rFonts->AppendAttribute(*ascii);
|
||||
RELEASEOBJECT(ascii);
|
||||
}
|
||||
}break;
|
||||
|
||||
case sprmCRgFtc1:
|
||||
case sprmCRgFtc1:
|
||||
{
|
||||
size_t nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
size_t nIndex = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
|
||||
if( nIndex >= 0 && nIndex < _doc->FontTable->Data.size() )
|
||||
if (nIndex >= 0 && nIndex < _doc->FontTable->Data.size())
|
||||
{
|
||||
XMLTools::XMLAttribute* eastAsia = new XMLTools::XMLAttribute( L"w:eastAsia" );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
XMLTools::XMLAttribute* eastAsia = new XMLTools::XMLAttribute(L"w:eastAsia");
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>(_doc->FontTable->operator [] (nIndex));
|
||||
m_sEastAsiaFont = ffn->xszFtn;
|
||||
eastAsia->SetValue( FormatUtils::XmlEncode(m_sEastAsiaFont));
|
||||
rFonts->AppendAttribute( *eastAsia );
|
||||
RELEASEOBJECT( eastAsia );
|
||||
eastAsia->SetValue(FormatUtils::XmlEncode(m_sEastAsiaFont));
|
||||
rFonts->AppendAttribute(*eastAsia);
|
||||
RELEASEOBJECT(eastAsia);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case sprmCRgFtc2:
|
||||
case sprmCRgFtc2:
|
||||
{
|
||||
size_t nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
size_t nIndex = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
|
||||
if( nIndex>=0 && nIndex < _doc->FontTable->Data.size() )
|
||||
if (nIndex >= 0 && nIndex < _doc->FontTable->Data.size())
|
||||
{
|
||||
XMLTools::XMLAttribute* ansi = new XMLTools::XMLAttribute( L"w:hAnsi" );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
XMLTools::XMLAttribute* ansi = new XMLTools::XMLAttribute(L"w:hAnsi");
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>(_doc->FontTable->operator [] (nIndex));
|
||||
m_shAnsiFont = ffn->xszFtn;
|
||||
ansi->SetValue( FormatUtils::XmlEncode(m_shAnsiFont));
|
||||
rFonts->AppendAttribute( *ansi );
|
||||
RELEASEOBJECT( ansi );
|
||||
ansi->SetValue(FormatUtils::XmlEncode(m_shAnsiFont));
|
||||
rFonts->AppendAttribute(*ansi);
|
||||
RELEASEOBJECT(ansi);
|
||||
}
|
||||
}break;
|
||||
|
||||
case sprmOldCKul:
|
||||
case sprmCKul:
|
||||
}break;
|
||||
case sprmOldCKul:
|
||||
case sprmCKul:
|
||||
{ //Underlining
|
||||
appendValueElement( parent, L"u", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::UnderlineCode[0][0], 56, 16 ), true );
|
||||
appendValueElement(parent, L"u", FormatUtils::MapValueToWideString(iter->Arguments[0], &Global::UnderlineCode[0][0], 56, 16), true);
|
||||
}
|
||||
break;
|
||||
|
||||
case sprmCCharScale:
|
||||
break;
|
||||
case sprmCCharScale:
|
||||
{ //char width
|
||||
appendValueElement( parent, L"w", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
}break;
|
||||
|
||||
case sprmCSfxText:
|
||||
appendValueElement(parent, L"w", FormatUtils::IntToWideString(FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize)), true);
|
||||
}break;
|
||||
case sprmCSfxText:
|
||||
{ //animation
|
||||
appendValueElement( parent, L"effect", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::TextAnimation[0][0], 7, 16 ), true );
|
||||
}break;
|
||||
|
||||
case sprmCIdctHint:
|
||||
appendValueElement(parent, L"effect", FormatUtils::MapValueToWideString(iter->Arguments[0], &Global::TextAnimation[0][0], 7, 16), true);
|
||||
}break;
|
||||
case sprmCIdctHint:
|
||||
{
|
||||
switch(iter->Arguments[0])
|
||||
XMLTools::XMLAttribute hint(L"w:hint");
|
||||
switch (iter->Arguments[0])
|
||||
{
|
||||
case 0: break; // default
|
||||
case 1: break; // eastAsia
|
||||
case 2: break; // cs
|
||||
case 1:
|
||||
{
|
||||
hint.SetValue(L"eastAsia");
|
||||
rFonts->AppendAttribute(hint);
|
||||
}break;
|
||||
case 2:
|
||||
{
|
||||
hint.SetValue(L"eastAsia");
|
||||
rFonts->AppendAttribute(hint);
|
||||
}break;
|
||||
case 0: break; // default
|
||||
case 0xFF: break; //No ST_Hint equivalent
|
||||
}
|
||||
|
||||
}break;
|
||||
|
||||
case sprmCPbiIBullet:
|
||||
case sprmCPbiIBullet:
|
||||
{
|
||||
int nIndex = FormatUtils::BytesToInt32( iter->Arguments, 0, iter->argumentsSize );
|
||||
if (nIndex >=0)
|
||||
int nIndex = FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize);
|
||||
if (nIndex >= 0)
|
||||
{
|
||||
std::map<int, int>::iterator it = _doc->PictureBulletsCPsMap.find(nIndex);
|
||||
if (it != _doc->PictureBulletsCPsMap.end())
|
||||
@ -465,28 +451,34 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
||||
case sprmCPbiGrf:
|
||||
case sprmCPbiGrf:
|
||||
{
|
||||
//used picture bullet
|
||||
int val = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
int val = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
|
||||
}break;
|
||||
|
||||
case sprmCRsidProp:
|
||||
case sprmCRsidText:
|
||||
break;
|
||||
|
||||
default:
|
||||
if (iter->argumentsSize == 2)
|
||||
case sprmCRsidProp:
|
||||
case sprmCRsidText:
|
||||
break;
|
||||
case sprmCFUsePgsuSettings:
|
||||
{
|
||||
nProperty = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
}else
|
||||
if (iter->argumentsSize == 1)
|
||||
appendFlagElement(parent, *iter, L"snapToGrid", true);
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
nProperty = FormatUtils::BytesToUChar( iter->Arguments, 0, iter->argumentsSize );
|
||||
}
|
||||
break;
|
||||
switch (iter->argumentsSize)
|
||||
{
|
||||
case 1:
|
||||
nProperty = FormatUtils::BytesToUChar(iter->Arguments, 0, iter->argumentsSize);
|
||||
break;
|
||||
case 2:
|
||||
nProperty = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
break;
|
||||
case 4:
|
||||
nProperty = FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize);
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -544,7 +536,7 @@ namespace DocFileFormat
|
||||
|
||||
if ( flag == 0 )
|
||||
{
|
||||
val->SetValue( L"false" );
|
||||
val->SetValue( L"0" );
|
||||
ele->AppendAttribute( *val );
|
||||
node->AppendChild( *ele );
|
||||
}
|
||||
@ -587,7 +579,7 @@ namespace DocFileFormat
|
||||
//invert it
|
||||
if ( stylesVal )
|
||||
{
|
||||
val->SetValue( L"false" );
|
||||
val->SetValue( L"0" );
|
||||
ele->AppendAttribute( *val );
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,6 @@ namespace DocFileFormat
|
||||
{
|
||||
m_context->_docx->RegisterComments();
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:comments", TRUE );
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
@ -148,7 +147,6 @@ namespace DocFileFormat
|
||||
{
|
||||
m_context->_docx->RegisterCommentsExtended();
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin( L"w15:commentsEx", TRUE );
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
|
||||
@ -91,7 +91,6 @@ namespace DocFileFormat
|
||||
doc->listTable->Convert( &numberingMapping );
|
||||
}
|
||||
|
||||
|
||||
//write the footnotes
|
||||
FootnotesMapping footnotesMapping( &context );
|
||||
doc->Convert( &footnotesMapping );
|
||||
|
||||
@ -518,6 +518,7 @@ namespace DocFileFormat
|
||||
std::wstring PAGEREF ( L"PAGEREF" );
|
||||
std::wstring PAGE ( L"PAGE" );
|
||||
std::wstring SHAPE ( L"SHAPE" );
|
||||
std::wstring NREF ( L"NREF");
|
||||
|
||||
if (arField.empty() == false)
|
||||
f = arField[0];
|
||||
@ -538,8 +539,9 @@ namespace DocFileFormat
|
||||
bool bEquation = search( f.begin(), f.end(), Equation.begin(), Equation.end()) != f.end();
|
||||
bool bPAGE = search( f.begin(), f.end(), PAGE.begin(), PAGE.end()) != f.end();
|
||||
bool bTOC = search( f.begin(), f.end(), TOC.begin(), TOC.end()) != f.end();
|
||||
bool bSHAPE = search( f.begin(), f.end(), SHAPE.begin(), SHAPE.end()) != f.end();
|
||||
|
||||
bool bSHAPE = search( f.begin(), f.end(), SHAPE.begin(), SHAPE.end()) != f.end();
|
||||
bool bNREF = search( f.begin(), f.end(), NREF.begin(), NREF.end()) != f.end();
|
||||
|
||||
bool bPAGEREF = false;
|
||||
if (bHYPERLINK && arField.size() > 1)
|
||||
{
|
||||
@ -928,15 +930,15 @@ namespace DocFileFormat
|
||||
}
|
||||
else if ((TextMark::DrawnObject == code) && fSpec)
|
||||
{
|
||||
Spa* pSpa = NULL;
|
||||
Spa* pSpa = NULL;
|
||||
if (typeid(*this) == typeid(MainDocumentMapping))
|
||||
{
|
||||
pSpa = static_cast<Spa*>(m_document->OfficeDrawingPlex->GetStruct(cp));
|
||||
pSpa = static_cast<Spa*>(m_document->OfficeDrawingPlex->GetStruct(cp));
|
||||
}
|
||||
else if ((typeid(*this) == typeid(HeaderMapping) ) || ( typeid(*this) == typeid(FooterMapping)))
|
||||
{
|
||||
int headerCp = ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn );
|
||||
pSpa = static_cast<Spa*>(m_document->OfficeDrawingPlexHeader->GetStruct(headerCp));
|
||||
int headerCp = ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn );
|
||||
pSpa = static_cast<Spa*>(m_document->OfficeDrawingPlexHeader->GetStruct(headerCp));
|
||||
}
|
||||
|
||||
bool bPicture = false;
|
||||
@ -1310,7 +1312,7 @@ namespace DocFileFormat
|
||||
|
||||
TableInfo tai( papx, m_document->nWordVersion );
|
||||
|
||||
//build the table grid
|
||||
//build the table grid
|
||||
std::vector<short> grid;
|
||||
buildTableGrid( cp, nestingLevel, grid);
|
||||
|
||||
@ -1387,9 +1389,9 @@ namespace DocFileFormat
|
||||
|
||||
while ( tai.fInTable )
|
||||
{
|
||||
iTap_current = 1;
|
||||
fEndNestingLevel = false;
|
||||
|
||||
for ( std::list<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); iter != papx->grpprl->end(); iter++ )
|
||||
for ( std::list<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); !fEndNestingLevel && iter != papx->grpprl->end(); iter++ )
|
||||
{
|
||||
DWORD code = iter->OpCode;
|
||||
|
||||
@ -1398,7 +1400,7 @@ namespace DocFileFormat
|
||||
case sprmPFInnerTableCell:
|
||||
case sprmPFInnerTtp:
|
||||
{
|
||||
fEndNestingLevel = ( iter->Arguments[0] == 1 ) ? (true) : (false);
|
||||
fEndNestingLevel = ( iter->Arguments[0] == 1 && (nestingLevel == iTap_current)) ? (true) : (false);
|
||||
}break;
|
||||
|
||||
case sprmOldPFInTable:
|
||||
@ -1431,19 +1433,9 @@ namespace DocFileFormat
|
||||
boundary1 = FormatUtils::BytesToInt16( iter->Arguments + 1, i * 2 , iter->argumentsSize );
|
||||
boundary2 = FormatUtils::BytesToInt16( iter->Arguments + 1, ( i + 1 ) * 2, iter->argumentsSize );
|
||||
|
||||
//if (boundary1 < 0) boundary1 = 0;
|
||||
//if (boundary2 < 0) boundary2 = 0;
|
||||
|
||||
mapBoundaries.insert(std::make_pair(boundary1, 0));
|
||||
mapBoundaries.insert(std::make_pair(boundary2, 0));
|
||||
//AddBoundary(boundary1, boundary2, mapBoundaries);
|
||||
}
|
||||
if (max_boundary < boundary2)
|
||||
max_boundary = boundary2;
|
||||
|
||||
mapBoundaries.insert(std::make_pair(boundary2, 0));
|
||||
mapBoundaries.insert(std::make_pair(max_boundary, 0));
|
||||
//AddBoundary(boundary2, max_boundary, mapBoundaries);
|
||||
bPresent = true;
|
||||
}break;
|
||||
default:
|
||||
@ -1451,9 +1443,9 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nestingLevel != iTap_current && fEndNestingLevel && !mapBoundaries.empty())
|
||||
if ((nestingLevel != iTap_current || fEndNestingLevel) && !mapBoundaries.empty())
|
||||
break;
|
||||
//get the next papx
|
||||
//get the next papx
|
||||
papx = findValidPapx( fcRowEnd );
|
||||
tai = TableInfo( papx, m_document->nWordVersion );
|
||||
fcRowEnd = findRowEndFc( cp, cp, nestingLevel );
|
||||
@ -1473,7 +1465,7 @@ namespace DocFileFormat
|
||||
{
|
||||
int sz = it_next->first - it->first;
|
||||
if (sz > 2)
|
||||
grid.push_back( it_next->first - it->first );
|
||||
grid.push_back(it_next->first - it->first);
|
||||
}
|
||||
}
|
||||
_lastValidPapx = backup;
|
||||
|
||||
@ -444,40 +444,50 @@ namespace DocFileFormat
|
||||
rsidRoot = FormatUtils::BytesToInt32(bytes, 588, size);
|
||||
//unused 2
|
||||
|
||||
if (size > 594 && size > 609) //start && stop bound /* && fib->m_FibNew.nFibNew > Fib2002*/
|
||||
if (size > 594 && size > 609)
|
||||
{
|
||||
//split bytes 592,593,594,595 into bits
|
||||
fTreatLockAtnAsReadOnly = FormatUtils::GetBitFromBytes((bytes + 592), 4, 0);
|
||||
fStyleLock = FormatUtils::GetBitFromBytes((bytes + 592), 4, 1);
|
||||
fAutoFmtOverride = FormatUtils::GetBitFromBytes((bytes + 592), 4, 2);
|
||||
fRemoveWordML = FormatUtils::GetBitFromBytes((bytes + 592), 4, 3);
|
||||
fApplyCustomXForm = FormatUtils::GetBitFromBytes((bytes + 592), 4, 4);
|
||||
fStyeLockEnforced = FormatUtils::GetBitFromBytes((bytes + 592), 4, 5);
|
||||
fFakeLockAtn = FormatUtils::GetBitFromBytes((bytes + 592), 4, 6);
|
||||
fIgnoreMixedContent = FormatUtils::GetBitFromBytes((bytes + 592), 4, 7);
|
||||
fShowPlaceholderText = FormatUtils::GetBitFromBytes((bytes + 592), 4, 8);
|
||||
grf = FormatUtils::GetUIntFromBytesBits((bytes + 592), 4, 9, 23);
|
||||
const size_t dop2003_offset = 594;
|
||||
|
||||
//split bytes 596 and 597 into bits
|
||||
fReadingModeInkLockDown = FormatUtils::GetBitFromBytes((bytes + 596), 2, 0);
|
||||
fAcetateShowInkAtn = FormatUtils::GetBitFromBytes((bytes + 596), 2, 1);
|
||||
fFilterDttm = FormatUtils::GetBitFromBytes((bytes + 596), 2, 2);
|
||||
fEnforceDocProt = FormatUtils::GetBitFromBytes((bytes + 596), 2, 3);
|
||||
iDocProtCur = (unsigned short)FormatUtils::GetUIntFromBytesBits((bytes + 596), 2, 4, 3);
|
||||
fDispBkSpSaved = FormatUtils::GetBitFromBytes((bytes + 596), 2, 7);
|
||||
_UINT32 flags = FormatUtils::BytesToUInt32(bytes, dop2003_offset, size);
|
||||
fTreatLockAtnAsReadOnly = GETBIT(flags, 0);
|
||||
fStyleLock = GETBIT(flags, 1);
|
||||
fAutoFmtOverride = GETBIT(flags, 2);
|
||||
fRemoveWordML = GETBIT(flags, 3);
|
||||
fApplyCustomXForm = GETBIT(flags, 4);
|
||||
fStyeLockEnforced = GETBIT(flags, 5);
|
||||
fFakeLockAtn = GETBIT(flags, 6);
|
||||
fIgnoreMixedContent = GETBIT(flags, 7);
|
||||
fShowPlaceholderText = GETBIT(flags, 8);
|
||||
bool unused = GETBIT(flags, 9);
|
||||
fWord97Doc = GETBIT(flags, 10);
|
||||
fStyleLockTheme = GETBIT(flags, 11);
|
||||
fStyleLockQFSet = GETBIT(flags, 12);
|
||||
//empty = 19
|
||||
|
||||
dxaPageLock = FormatUtils::BytesToInt16(bytes, 598, size);
|
||||
dyaPageLock = FormatUtils::BytesToInt16(bytes, 600, size);
|
||||
pctFontLock = FormatUtils::BytesToInt32(bytes, 602, size);
|
||||
grfitbid = bytes[606];
|
||||
//unsigned char 607 is unused
|
||||
ilfoMacAtCleanup = FormatUtils::BytesToUInt16(bytes, 608, size);
|
||||
BYTE flags2 = bytes[dop2003_offset + 4];
|
||||
fReadingModeInkLockDown = GETBIT(flags2, 0);
|
||||
fAcetateShowInkAtn = GETBIT(flags2, 1);
|
||||
fFilterDttm = GETBIT(flags2, 2);
|
||||
fEnforceDocProt = GETBIT(flags2, 3);
|
||||
iDocProtCur = GETBITS(flags2, 4, 6);
|
||||
fDispBkSpSaved = GETBIT(flags2, 7);
|
||||
|
||||
//empty2 = 8
|
||||
dxaPageLock = FormatUtils::BytesToInt32(bytes, dop2003_offset + 6, size);
|
||||
dyaPageLock = FormatUtils::BytesToInt32(bytes, dop2003_offset + 10, size);
|
||||
pctFontLock = FormatUtils::BytesToInt32(bytes, dop2003_offset + 14, size);
|
||||
|
||||
grfitbid = bytes[dop2003_offset + 18];
|
||||
//empty3 = 8
|
||||
ilfoMacAtCleanup = FormatUtils::BytesToUInt16(bytes, dop2003_offset + 20, size);
|
||||
|
||||
if (size > 616 && size > 621) //start && stop bound /* && fib->m_FibNew.nFibNew > Fib2003*/
|
||||
{
|
||||
const size_t dop2007_offset = 616;
|
||||
|
||||
//4 bytes reserved
|
||||
bool fRMTrackFormatting = FormatUtils::GetBitFromBytes((bytes + 620), 2, 0);
|
||||
bool fRMTrackMoves = FormatUtils::GetBitFromBytes((bytes + 620), 2, 1);
|
||||
bool fRMTrackFormatting = FormatUtils::GetBitFromBytes((bytes + dop2007_offset + 4), 2, 0);
|
||||
bool fRMTrackMoves = FormatUtils::GetBitFromBytes((bytes + dop2007_offset + 4), 2, 1);
|
||||
//dopMth = 34 bytes from 624 = 658
|
||||
|
||||
if (size > 674/* && fib->m_FibNew.nFibNew > Fib2007*/)
|
||||
@ -799,13 +809,12 @@ namespace DocFileFormat
|
||||
fFakeLockAtn = false;
|
||||
fIgnoreMixedContent = false;
|
||||
fShowPlaceholderText = false;
|
||||
grf = 0;
|
||||
fReadingModeInkLockDown = false;
|
||||
fAcetateShowInkAtn = false;
|
||||
fFilterDttm = false;
|
||||
fEnforceDocProt = false;
|
||||
iDocProtCur = 0;
|
||||
fDispBkSpSaved = true;
|
||||
fDispBkSpSaved = false;
|
||||
dxaPageLock = 0;
|
||||
dyaPageLock = 0;
|
||||
pctFontLock = 0;
|
||||
|
||||
@ -570,7 +570,11 @@ namespace DocFileFormat
|
||||
bool fIgnoreMixedContent;
|
||||
// XML Option: Show placeholder text for all empty XML elements
|
||||
bool fShowPlaceholderText;
|
||||
unsigned int grf;
|
||||
|
||||
bool fWord97Doc = false;
|
||||
bool fStyleLockTheme = false;
|
||||
bool fStyleLockQFSet = false;
|
||||
|
||||
// Reading mode: ink lock down
|
||||
bool fReadingModeInkLockDown;
|
||||
// Track changes: Show ink annotations
|
||||
@ -587,9 +591,9 @@ namespace DocFileFormat
|
||||
unsigned short iDocProtCur;
|
||||
bool fDispBkSpSaved;
|
||||
// Reading Layout page size lockdown
|
||||
short dxaPageLock;
|
||||
int dxaPageLock;
|
||||
// Reading Layout page size lockdown
|
||||
short dyaPageLock;
|
||||
int dyaPageLock;
|
||||
// Reading Layout font lockdown
|
||||
int pctFontLock;
|
||||
unsigned char grfitbid;
|
||||
|
||||
@ -54,7 +54,6 @@ namespace DocFileFormat
|
||||
|
||||
int id = 0;
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:endnotes", TRUE );
|
||||
|
||||
//write namespaces
|
||||
|
||||
@ -52,7 +52,6 @@ namespace DocFileFormat
|
||||
|
||||
_ctx->_docx->RegisterFontTable();
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fonts", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
@ -45,7 +45,6 @@ namespace DocFileFormat
|
||||
m_document = static_cast<WordDocument*>( visited );
|
||||
|
||||
//start the document
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:ftr", TRUE );
|
||||
|
||||
//write namespaces
|
||||
|
||||
@ -54,7 +54,6 @@ namespace DocFileFormat
|
||||
|
||||
int id = 0;
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:footnotes", TRUE );
|
||||
|
||||
//write namespaces
|
||||
|
||||
@ -45,7 +45,6 @@ namespace DocFileFormat
|
||||
m_document = static_cast<WordDocument*>( visited );
|
||||
|
||||
//start the document
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:hdr", TRUE );
|
||||
|
||||
//write namespaces
|
||||
|
||||
@ -51,7 +51,6 @@ namespace DocFileFormat
|
||||
m_document = static_cast<WordDocument*>(visited);
|
||||
|
||||
// Header
|
||||
m_pXmlWriter->WriteNodeBegin(L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:document", TRUE );
|
||||
|
||||
// Namespaces
|
||||
|
||||
@ -197,6 +197,9 @@ public:
|
||||
|
||||
virtual int Seek (int offset, int origin = 0/*STREAM_SEEK_SET*/)
|
||||
{
|
||||
if (origin == 2) offset = m_Position + offset;
|
||||
if (origin == 1) offset = m_Size - offset;
|
||||
|
||||
if ( (m_Data != NULL) && (offset >= 0) && ((unsigned int)offset < m_Size) )
|
||||
return m_Position = offset;
|
||||
|
||||
|
||||
@ -63,7 +63,6 @@ namespace DocFileFormat
|
||||
m_xmldocument->RegisterNumbering();
|
||||
|
||||
//start the document
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:numbering", TRUE );
|
||||
|
||||
//write namespaces
|
||||
|
||||
@ -40,7 +40,7 @@ namespace DocFileFormat
|
||||
public:
|
||||
static const unsigned short TYPE_CODE_0xF00D = 0xF00D;
|
||||
|
||||
OfficeArtClientTextbox () : Record(), m_nIndex(0)
|
||||
OfficeArtClientTextbox () : Record()
|
||||
{
|
||||
|
||||
}
|
||||
@ -50,24 +50,15 @@ namespace DocFileFormat
|
||||
unsigned int number = Reader->ReadUInt16();
|
||||
m_nIndex = Reader->ReadUInt16();
|
||||
}
|
||||
|
||||
virtual ~OfficeArtClientTextbox()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
virtual Record* NewObject(IBinaryReader* reader, unsigned int bodySize, unsigned int typeCode, unsigned int version, unsigned int instance)
|
||||
{
|
||||
return new OfficeArtClientTextbox(reader, bodySize, typeCode, version, instance);
|
||||
}
|
||||
|
||||
inline int GetIndex ()
|
||||
{
|
||||
return m_nIndex;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
int m_nIndex;
|
||||
int m_nIndex = 0;
|
||||
};
|
||||
}
|
||||
@ -108,6 +108,8 @@ namespace DocFileFormat
|
||||
std::wstring pathFileName = outputDir + FILE_SEPARATOR_STR + fileName;
|
||||
if (file.CreateFileW(pathFileName))
|
||||
{
|
||||
std::string root = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
|
||||
file.WriteFile((BYTE*)root.c_str(), root.length());
|
||||
file.WriteStringUTF8(XMLContent);
|
||||
file.CloseFile();
|
||||
}
|
||||
@ -397,7 +399,6 @@ namespace DocFileFormat
|
||||
{
|
||||
XMLTools::CStringXmlWriter writer;
|
||||
|
||||
writer.WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
writer.WriteNodeBegin( L"Relationships", TRUE );
|
||||
|
||||
//write namespaces
|
||||
@ -433,7 +434,6 @@ namespace DocFileFormat
|
||||
XMLTools::CStringXmlWriter writer;
|
||||
|
||||
// write content types
|
||||
writer.WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
writer.WriteNodeBegin( L"Types", TRUE );
|
||||
|
||||
//write namespaces
|
||||
|
||||
@ -439,15 +439,15 @@ namespace DocFileFormat
|
||||
val.SetValue( getBorderType( brc->brcType ));
|
||||
border->AppendAttribute( val );
|
||||
|
||||
XMLTools::XMLAttribute color( L"w:color" );
|
||||
color.SetValue( RGBColor( brc->cv, RedFirst ).SixDigitHexCode);
|
||||
border->AppendAttribute( color );
|
||||
|
||||
XMLTools::XMLAttribute space( L"w:space" , FormatUtils::IntToWideString( brc->dptSpace ));
|
||||
border->AppendAttribute( space );
|
||||
|
||||
XMLTools::XMLAttribute sz( L"w:sz", FormatUtils::IntToWideString( brc->dptLineWidth ));
|
||||
border->AppendAttribute( sz );
|
||||
|
||||
XMLTools::XMLAttribute space( L"w:space" , FormatUtils::IntToWideString( brc->dptSpace ));
|
||||
border->AppendAttribute( space );
|
||||
|
||||
XMLTools::XMLAttribute color( L"w:color" );
|
||||
color.SetValue( RGBColor( brc->cv, RedFirst ).SixDigitHexCode);
|
||||
border->AppendAttribute( color );
|
||||
|
||||
if ( brc->fShadow )
|
||||
{
|
||||
|
||||
@ -108,7 +108,7 @@ namespace DocFileFormat
|
||||
switch (iter->OpCode)
|
||||
{
|
||||
case sprmOldSGprfIhdt:
|
||||
case sprmSGprfIhdt:
|
||||
//case sprmSGprfIhdt: //betesil_pl_it.doc
|
||||
{
|
||||
fHF = FormatUtils::BytesToUChar( iter->Arguments, 0, iter->argumentsSize );
|
||||
}break;
|
||||
@ -162,6 +162,7 @@ namespace DocFileFormat
|
||||
//MUST be ignored if the section does not have page number restart enabled.([MS-DOC] — v20101113. стр 152)
|
||||
bool bWasSprmSFPgnRestart = false;
|
||||
std::wstring wsSprmSPgnStart;
|
||||
int nProperty = 0; // for unknown
|
||||
|
||||
for (std::list<SinglePropertyModifier>::iterator iter = sepx->grpprl->begin(); iter != sepx->grpprl->end(); ++iter)
|
||||
{
|
||||
@ -474,9 +475,14 @@ namespace DocFileFormat
|
||||
break;
|
||||
|
||||
default:
|
||||
if (iter->argumentsSize == 2)
|
||||
{
|
||||
int sz = iter->argumentsSize;
|
||||
}break;
|
||||
nProperty = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
}
|
||||
else if (iter->argumentsSize == 1)
|
||||
{
|
||||
nProperty = FormatUtils::BytesToUChar(iter->Arguments, 0, iter->argumentsSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -76,7 +76,6 @@ namespace DocFileFormat
|
||||
_ctx->_docx->RegisterSettings();
|
||||
|
||||
//start w:settings
|
||||
m_oXmlWriter.WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_oXmlWriter.WriteNodeBegin( L"w:settings", TRUE );
|
||||
//write namespaces
|
||||
m_oXmlWriter.WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
|
||||
@ -60,7 +60,6 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
Spa();
|
||||
|
||||
virtual ~Spa();
|
||||
|
||||
virtual ByteStructure* ConstructObject(VirtualStreamReader* reader, int length);
|
||||
@ -68,7 +67,6 @@ namespace DocFileFormat
|
||||
{
|
||||
return spid;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
/// Shape Identifier. Used in conjunction with the office art data
|
||||
|
||||
@ -94,7 +94,7 @@ namespace DocFileFormat
|
||||
numberOfColumns = bytes[0];
|
||||
int pointer = 1;
|
||||
|
||||
// rgdxaCenter
|
||||
// rgdxaCenter
|
||||
for (int i = 0; i < numberOfColumns + 1; ++i)
|
||||
{
|
||||
int pos = FormatUtils::BytesToInt16(bytes, pointer, size);
|
||||
@ -103,7 +103,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
|
||||
// rgTc80
|
||||
// rgTc80
|
||||
|
||||
for (int i = 0; i < numberOfColumns; ++i)
|
||||
{
|
||||
@ -116,21 +116,21 @@ namespace DocFileFormat
|
||||
oTC80.ftsWidth = Global::dxa;
|
||||
oTC80.wWidth = 0;
|
||||
|
||||
oTC80.brcTop = new BorderCode();
|
||||
oTC80.brcLeft = new BorderCode();
|
||||
oTC80.brcBottom = new BorderCode();
|
||||
oTC80.brcRight = new BorderCode();
|
||||
|
||||
oTC80.brcTop = new BorderCode();
|
||||
oTC80.brcLeft = new BorderCode();
|
||||
oTC80.brcBottom = new BorderCode();
|
||||
oTC80.brcRight = new BorderCode();
|
||||
|
||||
rgTc80.push_back(oTC80);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TC80 tc;
|
||||
// the flags
|
||||
// the flags
|
||||
|
||||
unsigned short flags = FormatUtils::BytesToUInt16(bytes, pointer, size);
|
||||
unsigned short flags = FormatUtils::BytesToUInt16(bytes, pointer, size);
|
||||
|
||||
tc.horzMerge = (unsigned char)FormatUtils::BitmaskToInt((int)flags, 0x3);
|
||||
tc.textFlow = (Global::TextFlow)FormatUtils::BitmaskToInt((int)flags, 0x1C);
|
||||
@ -139,38 +139,26 @@ namespace DocFileFormat
|
||||
tc.ftsWidth = (Global::CellWidthType)FormatUtils::BitmaskToInt((int)flags, 0xE00);
|
||||
tc.fFitText = FormatUtils::BitmaskToBool(flags, 0x1000);
|
||||
tc.fNoWrap = FormatUtils::BitmaskToBool(flags, 0x2000);
|
||||
tc.fHideMark = FormatUtils::BitmaskToBool(flags, 0x4000);
|
||||
|
||||
tc.fHideMark = FormatUtils::BitmaskToBool(flags, 0x4000);
|
||||
|
||||
pointer += 2;
|
||||
|
||||
// cell width
|
||||
tc.wWidth = FormatUtils::BytesToInt16(bytes, pointer, size);
|
||||
pointer += 2;
|
||||
// cell width
|
||||
tc.wWidth = FormatUtils::BytesToInt16(bytes, pointer, size);
|
||||
pointer += 2;
|
||||
|
||||
const int borderCodeBytes = 4;
|
||||
|
||||
//border top
|
||||
unsigned char brcTopBytes[borderCodeBytes];
|
||||
memcpy(brcTopBytes, (bytes + pointer), borderCodeBytes);
|
||||
tc.brcTop = new BorderCode(brcTopBytes, borderCodeBytes);
|
||||
tc.brcTop = new BorderCode((bytes + pointer), borderCodeBytes);
|
||||
pointer += borderCodeBytes;
|
||||
|
||||
//border left
|
||||
unsigned char brcLeftBytes[borderCodeBytes];
|
||||
memcpy(brcLeftBytes, (bytes + pointer), borderCodeBytes);
|
||||
tc.brcLeft = new BorderCode(brcLeftBytes, borderCodeBytes);
|
||||
tc.brcLeft = new BorderCode((bytes + pointer), borderCodeBytes);
|
||||
pointer += borderCodeBytes;
|
||||
|
||||
//border bottom
|
||||
unsigned char brcBottomBytes[borderCodeBytes];
|
||||
memcpy(brcBottomBytes, (bytes + pointer), borderCodeBytes);
|
||||
tc.brcBottom = new BorderCode(brcBottomBytes, borderCodeBytes);
|
||||
tc.brcBottom = new BorderCode((bytes + pointer), borderCodeBytes);
|
||||
pointer += borderCodeBytes;
|
||||
|
||||
//border top
|
||||
unsigned char brcRightBytes[borderCodeBytes];
|
||||
memcpy(brcRightBytes, (bytes + pointer), borderCodeBytes);
|
||||
tc.brcRight = new BorderCode(brcRightBytes, borderCodeBytes);
|
||||
tc.brcRight = new BorderCode((bytes + pointer), borderCodeBytes);
|
||||
pointer += borderCodeBytes;
|
||||
|
||||
rgTc80.push_back(tc);
|
||||
|
||||
@ -140,7 +140,7 @@ namespace DocFileFormat
|
||||
POLE::Stream *streamNew = new POLE::Stream(storageOut, streamName, true, size_stream);
|
||||
if (!streamNew) return;
|
||||
|
||||
unsigned char* data_stream = new unsigned char[size_stream];
|
||||
unsigned char* data_stream = new unsigned char[(unsigned int)size_stream];
|
||||
if (data_stream)
|
||||
{
|
||||
stream->read(data_stream, size_stream);
|
||||
|
||||
@ -60,7 +60,6 @@ namespace DocFileFormat
|
||||
this->_ctx->_docx->RegisterStyleSheet();
|
||||
|
||||
//start the document
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:styles", TRUE );
|
||||
|
||||
//write namespaces
|
||||
@ -98,12 +97,23 @@ namespace DocFileFormat
|
||||
m_pXmlWriter->WriteAttribute( L"w:styleId", FormatUtils::XmlEncode(MakeStyleId( *iter )));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
// <w:name val="" />
|
||||
// <w:name val="" />
|
||||
std::wstring sName = FormatUtils::XmlEncode(getStyleName(*iter), true);
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:name", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(getStyleName( *iter ), true ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
if ((*iter)->sti == StyleIdentifier::Normal)
|
||||
m_pXmlWriter->WriteAttribute(L"w:val", L"Normal");
|
||||
else
|
||||
m_pXmlWriter->WriteAttribute(L"w:val", sName);
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
// <w:basedOn val="" />
|
||||
if ((*iter)->sti == StyleIdentifier::Normal) // ??? < sti < 159
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:aliases", TRUE);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val", sName);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", TRUE);
|
||||
}
|
||||
|
||||
// <w:basedOn val="" />
|
||||
if ( ( (*iter)->istdBase != 4095 ) && ( (*iter)->istdBase < sheet->Styles->size() ) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:basedOn", TRUE );
|
||||
@ -111,7 +121,7 @@ namespace DocFileFormat
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
}
|
||||
|
||||
// <w:next val="" />
|
||||
// <w:next val="" />
|
||||
if ( (*iter)->istdNext < sheet->Styles->size() )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:next", TRUE );
|
||||
@ -119,7 +129,7 @@ namespace DocFileFormat
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
}
|
||||
|
||||
// <w:link val="" />
|
||||
// <w:link val="" />
|
||||
if ( (*iter)->istdLink < sheet->Styles->size() )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:link", TRUE );
|
||||
|
||||
@ -63,10 +63,6 @@ namespace DocFileFormat
|
||||
RELEASEOBJECT(_tcPr);
|
||||
RELEASEOBJECT(_tcMar);
|
||||
RELEASEOBJECT(_tcBorders);
|
||||
RELEASEOBJECT(_brcTop);
|
||||
RELEASEOBJECT(_brcLeft);
|
||||
RELEASEOBJECT(_brcRight);
|
||||
RELEASEOBJECT(_brcBottom);
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,7 +93,6 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool bPresentDefTable = false;
|
||||
for (std::list<SinglePropertyModifier>::reverse_iterator iter = tapx->grpprl->rbegin(); iter != tapx->grpprl->rend(); ++iter)
|
||||
{
|
||||
@ -190,26 +185,17 @@ namespace DocFileFormat
|
||||
|
||||
if (!IsTableBordersDefined(tapx->grpprl))
|
||||
{
|
||||
RELEASEOBJECT(_brcTop);
|
||||
_brcTop = new BorderCode(*_tcDef.brcTop);
|
||||
|
||||
RELEASEOBJECT(_brcLeft);
|
||||
_brcLeft = new BorderCode(*_tcDef.brcLeft);
|
||||
|
||||
RELEASEOBJECT(_brcRight);
|
||||
_brcRight = new BorderCode(*_tcDef.brcRight);
|
||||
|
||||
RELEASEOBJECT(_brcBottom);
|
||||
_brcBottom = new BorderCode(*_tcDef.brcBottom);
|
||||
_brcTop = std::shared_ptr<BorderCode>(new BorderCode(*_tcDef.brcTop));
|
||||
_brcLeft = std::shared_ptr<BorderCode>(new BorderCode(*_tcDef.brcLeft));
|
||||
_brcRight = std::shared_ptr<BorderCode>(new BorderCode(*_tcDef.brcRight));
|
||||
_brcBottom = std::shared_ptr<BorderCode>(new BorderCode(*_tcDef.brcBottom));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case sprmTDxaCol:
|
||||
{
|
||||
}break;
|
||||
|
||||
case sprmTCellPadding:
|
||||
{
|
||||
unsigned char first = iter->Arguments[0];
|
||||
@ -248,10 +234,9 @@ namespace DocFileFormat
|
||||
apppendCellShading(iter->Arguments, iter->argumentsSize, _cellIndex);
|
||||
}
|
||||
}break;
|
||||
|
||||
case sprmOldTDefTableShd:
|
||||
case sprmTDefTableShd:
|
||||
{ // cell shading for cells 0-20
|
||||
{ // cell shading for cells 0-20
|
||||
apppendCellShading(iter->Arguments, iter->argumentsSize, _cellIndex);
|
||||
}break;
|
||||
|
||||
@ -259,14 +244,12 @@ namespace DocFileFormat
|
||||
{ // cell shading for cells 21-42
|
||||
apppendCellShading(iter->Arguments, iter->argumentsSize, (_cellIndex - 21));
|
||||
}break;
|
||||
|
||||
case sprmTDefTableShd3rd:
|
||||
{ // cell shading for cells 43-62
|
||||
apppendCellShading(iter->Arguments, iter->argumentsSize, (_cellIndex - 43));
|
||||
}break;
|
||||
|
||||
case sprmTCellWidth:
|
||||
{ //width
|
||||
{ //width
|
||||
unsigned char first = iter->Arguments[0];
|
||||
unsigned char lim = iter->Arguments[1];
|
||||
|
||||
@ -276,10 +259,9 @@ namespace DocFileFormat
|
||||
_width = FormatUtils::BytesToInt16(iter->Arguments, 3, iter->argumentsSize);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
break;
|
||||
case sprmTVertAlign:
|
||||
{ //vertical alignment
|
||||
{ //vertical alignment
|
||||
unsigned char first = iter->Arguments[0];
|
||||
unsigned char lim = iter->Arguments[1];
|
||||
|
||||
@ -289,7 +271,6 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case sprmTFitText:
|
||||
{ //Autofit
|
||||
unsigned char first = iter->Arguments[0];
|
||||
@ -301,10 +282,9 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case sprmOldTSetBrc:
|
||||
case sprmTSetBrc:
|
||||
{ //borders (cell definition)
|
||||
{ //borders (cell definition)
|
||||
unsigned char min = iter->Arguments[0];
|
||||
unsigned char max = iter->Arguments[1];
|
||||
|
||||
@ -318,35 +298,34 @@ namespace DocFileFormat
|
||||
|
||||
if( FormatUtils::BitmaskToBool( bordersToApply, 0x01 ) )
|
||||
{
|
||||
RELEASEOBJECT( _brcTop );
|
||||
_brcTop = new BorderCode( brcBytes, brcSize );
|
||||
_brcTop = std::shared_ptr<BorderCode>(new BorderCode( brcBytes, brcSize ));
|
||||
}
|
||||
|
||||
if( FormatUtils::BitmaskToBool( bordersToApply, 0x02 ) )
|
||||
{
|
||||
RELEASEOBJECT( _brcLeft );
|
||||
_brcLeft = new BorderCode( brcBytes, brcSize );
|
||||
_brcLeft = std::shared_ptr<BorderCode>(new BorderCode( brcBytes, brcSize ));
|
||||
}
|
||||
|
||||
if ( FormatUtils::BitmaskToBool( bordersToApply, 0x04 ) )
|
||||
{
|
||||
RELEASEOBJECT( _brcBottom );
|
||||
_brcBottom = new BorderCode( brcBytes, brcSize );
|
||||
_brcBottom = std::shared_ptr<BorderCode>(new BorderCode( brcBytes, brcSize ));
|
||||
}
|
||||
|
||||
if ( FormatUtils::BitmaskToBool( bordersToApply, 0x08 ) )
|
||||
{
|
||||
RELEASEOBJECT( _brcRight );
|
||||
_brcRight = new BorderCode( brcBytes, brcSize );
|
||||
_brcRight = std::shared_ptr<BorderCode>(new BorderCode( brcBytes, brcSize ));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (_gridSpan <= 1 && nComputedCellWidth > _width && _width > 1)
|
||||
int nComputedCellWidthsGrid = 0;
|
||||
|
||||
for (size_t ccc = 0; ccc < _grid->size() && ccc <= _gridIndex; ccc++)
|
||||
{
|
||||
nComputedCellWidthsGrid += _grid->at(ccc);
|
||||
}//zadost.doc
|
||||
if (_gridSpan <= 1 && nComputedCellWidth > _width/* && _width > 1*/ && nComputedCellWidths > nComputedCellWidthsGrid)
|
||||
{
|
||||
int width_current = 0;
|
||||
for (int i = _gridIndex; i < _grid->size(); i++)
|
||||
@ -359,22 +338,22 @@ namespace DocFileFormat
|
||||
_width = nComputedCellWidth;
|
||||
}
|
||||
|
||||
XMLTools::XMLElement tcW ( L"w:tcW" );
|
||||
XMLTools::XMLElement tcW ( L"w:tcW" );
|
||||
|
||||
if (_width > 1 || nComputedCellWidth > 0)
|
||||
{
|
||||
if (_ftsWidth == Global::CellWidthType::nil)
|
||||
_ftsWidth = Global::CellWidthType::dxa;
|
||||
}
|
||||
else _ftsWidth = Global::CellWidthType::Auto;
|
||||
|
||||
|
||||
XMLTools::XMLAttribute tcWVal ( L"w:w", FormatUtils::IntToWideString( _width > 1 ? _width : nComputedCellWidth) );
|
||||
XMLTools::XMLAttribute tcWType ( L"w:type", (_width > 1 || nComputedCellWidth > 0) ? FormatUtils::MapValueToWideString( _ftsWidth, &Global::CellWidthTypeMap[0][0], 4, 5 ) : L"auto");
|
||||
XMLTools::XMLAttribute tcWType ( L"w:type", FormatUtils::MapValueToWideString(_ftsWidth, &Global::CellWidthTypeMap[0][0], 4, 5 ));
|
||||
|
||||
tcW.AppendAttribute( tcWType );
|
||||
tcW.AppendAttribute( tcWVal );
|
||||
tcW.AppendAttribute( tcWType );
|
||||
_tcPr->AppendChild( tcW );
|
||||
|
||||
int nComputedCellWidthsGrid = 0;
|
||||
|
||||
for (size_t ccc = 0; ccc < _grid->size() && ccc <= _gridIndex; ccc++)
|
||||
{
|
||||
nComputedCellWidthsGrid += _grid->at(ccc);
|
||||
}
|
||||
if ( _gridSpan == 1 && ( _gridIndex < (int)_grid->size() ) && ( nComputedCellWidths > nComputedCellWidthsGrid ) )
|
||||
{
|
||||
//check the number of merged cells
|
||||
@ -405,28 +384,28 @@ namespace DocFileFormat
|
||||
if (_brcTop)
|
||||
{
|
||||
XMLTools::XMLElement topBorder( L"w:top" );
|
||||
appendBorderAttributes(_brcTop, &topBorder);
|
||||
appendBorderAttributes(_brcTop.get(), &topBorder);
|
||||
addOrSetBorder(_tcBorders, &topBorder );
|
||||
}
|
||||
|
||||
if (_brcLeft )
|
||||
{
|
||||
XMLTools::XMLElement leftBorder( L"w:left" );
|
||||
appendBorderAttributes(_brcLeft, &leftBorder);
|
||||
appendBorderAttributes(_brcLeft.get(), &leftBorder);
|
||||
addOrSetBorder(_tcBorders, &leftBorder);
|
||||
}
|
||||
|
||||
if (_brcBottom)
|
||||
{
|
||||
XMLTools::XMLElement bottomBorder( L"w:bottom" );
|
||||
appendBorderAttributes(_brcBottom, &bottomBorder);
|
||||
appendBorderAttributes(_brcBottom.get(), &bottomBorder);
|
||||
addOrSetBorder(_tcBorders, &bottomBorder);
|
||||
}
|
||||
|
||||
if (_brcRight)
|
||||
{
|
||||
XMLTools::XMLElement rightBorder( L"w:right" );
|
||||
appendBorderAttributes( _brcRight, &rightBorder );
|
||||
appendBorderAttributes( _brcRight.get(), &rightBorder );
|
||||
addOrSetBorder( _tcBorders, &rightBorder );
|
||||
}
|
||||
|
||||
|
||||
@ -87,15 +87,15 @@ namespace DocFileFormat
|
||||
const std::vector<short>* _grid;
|
||||
std::vector<short> _tGrid;
|
||||
|
||||
short _width;
|
||||
int _width;
|
||||
Global::CellWidthType _ftsWidth;
|
||||
TC80 _tcDef;
|
||||
unsigned int _depth;
|
||||
|
||||
BorderCode* _brcTop;
|
||||
BorderCode* _brcLeft;
|
||||
BorderCode* _brcRight;
|
||||
BorderCode* _brcBottom;
|
||||
std::shared_ptr<BorderCode> _brcLeft;
|
||||
std::shared_ptr<BorderCode> _brcTop;
|
||||
std::shared_ptr<BorderCode> _brcBottom;
|
||||
std::shared_ptr<BorderCode> _brcRight;
|
||||
|
||||
int _gridSpan;
|
||||
bool _bCoverCell;
|
||||
|
||||
@ -47,421 +47,390 @@ TablePropertiesMapping::~TablePropertiesMapping()
|
||||
RELEASEOBJECT (_tblPr);
|
||||
RELEASEOBJECT (_tblGrid);
|
||||
RELEASEOBJECT (_tblBorders);
|
||||
RELEASEOBJECT (brcLeft);
|
||||
RELEASEOBJECT (brcTop);
|
||||
RELEASEOBJECT (brcBottom);
|
||||
RELEASEOBJECT (brcRight);
|
||||
RELEASEOBJECT (brcHorz);
|
||||
RELEASEOBJECT (brcVert);
|
||||
}
|
||||
}
|
||||
namespace DocFileFormat
|
||||
|
||||
void TablePropertiesMapping::Apply(IVisitable* visited)
|
||||
{
|
||||
void TablePropertiesMapping::Apply(IVisitable* visited)
|
||||
TablePropertyExceptions* tapx = static_cast<TablePropertyExceptions*>(visited);
|
||||
|
||||
XMLTools::XMLElement tblCellMar(L"w:tblCellMar");
|
||||
XMLTools::XMLElement tblLayout(L"w:tblLayout");
|
||||
XMLTools::XMLElement tblpPr(L"w:tblpPr");
|
||||
XMLTools::XMLAttribute layoutType(L"w:type", L"fixed");
|
||||
|
||||
_CP_OPT(short) tblIndent;
|
||||
short gabHalf = 0;
|
||||
short marginLeft = 0;
|
||||
short marginRight = 0;
|
||||
|
||||
short cellSpacing = 0;
|
||||
|
||||
BYTE itcFirst = 0;
|
||||
BYTE itcLim = 0;
|
||||
|
||||
bool bTableW = false;
|
||||
|
||||
for (std::list<SinglePropertyModifier>::iterator iter = tapx->grpprl->begin(); iter != tapx->grpprl->end(); iter++)
|
||||
{
|
||||
TablePropertyExceptions* tapx = static_cast<TablePropertyExceptions*>( visited );
|
||||
|
||||
XMLTools::XMLElement tblCellMar ( L"w:tblCellMar");
|
||||
XMLTools::XMLElement tblLayout ( L"w:tblLayout");
|
||||
XMLTools::XMLElement tblpPr ( L"w:tblpPr");
|
||||
XMLTools::XMLAttribute layoutType ( L"w:type", L"fixed");
|
||||
|
||||
_CP_OPT(short) tblIndent;
|
||||
short gabHalf = 0;
|
||||
short marginLeft = 0;
|
||||
short marginRight = 0;
|
||||
|
||||
BYTE itcFirst = 0;
|
||||
BYTE itcLim = 0;
|
||||
|
||||
bool bTableW = false;
|
||||
|
||||
for ( std::list<SinglePropertyModifier>::iterator iter = tapx->grpprl->begin(); iter != tapx->grpprl->end(); iter++ )
|
||||
switch (iter->OpCode)
|
||||
{
|
||||
switch( iter->OpCode )
|
||||
case sprmOldTDxaGapHalf:
|
||||
case sprmTDxaGapHalf:
|
||||
{
|
||||
gabHalf = FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
}break;
|
||||
case sprmOldTDefTable:
|
||||
case sprmTDefTable:
|
||||
{
|
||||
//table definition
|
||||
SprmTDefTable tDef(iter->Arguments, iter->argumentsSize);
|
||||
//Workaround for retrieving the indent of the table:
|
||||
//In some files there is a indent but no sprmTWidthIndent is set.
|
||||
//For this cases we can calculate the indent of the table by getting the
|
||||
//first boundary of the TDef and adding the padding of the cells
|
||||
|
||||
tblIndent = gabHalf + FormatUtils::BytesToInt16(iter->Arguments, 1, iter->argumentsSize);
|
||||
//If there follows a real sprmTWidthIndent, this value will be overwritten
|
||||
|
||||
//tblIndent = (std::max)((int)tblIndent,0); //cerere.doc
|
||||
}break;
|
||||
case sprmTTableWidth:
|
||||
{
|
||||
//preferred table width
|
||||
unsigned char fts = iter->Arguments[0];
|
||||
short width = FormatUtils::BytesToInt16(iter->Arguments, 1, iter->argumentsSize);
|
||||
|
||||
XMLTools::XMLElement tblW(L"w:tblW");
|
||||
|
||||
XMLTools::XMLAttribute w(L"w:w", FormatUtils::IntToWideString(width));
|
||||
XMLTools::XMLAttribute type(L"w:type", FormatUtils::MapValueToWideString(fts, &WidthType[0][0], 4, 5));
|
||||
|
||||
tblW.AppendAttribute(type);
|
||||
tblW.AppendAttribute(w);
|
||||
|
||||
_tblPr->AppendChild(tblW);
|
||||
|
||||
bTableW = true;
|
||||
}break;
|
||||
case sprmTMerge:
|
||||
{
|
||||
itcFirst = iter->Arguments[0];
|
||||
itcLim = iter->Arguments[1];
|
||||
}break;
|
||||
case sprmTSplit:
|
||||
{
|
||||
|
||||
}break;
|
||||
case sprmOldTJc:
|
||||
case sprmTJc:
|
||||
case sprmTJcRow:
|
||||
{
|
||||
appendValueElement(_tblPr, L"jc", FormatUtils::MapValueToWideString(iter->Arguments[0], &Global::JustificationCode[0][0], 10, 15), true);
|
||||
}break;
|
||||
case sprmTWidthIndent:
|
||||
{
|
||||
tblIndent = FtsWWidth_Indent(iter->Arguments).wWidth;
|
||||
}break;
|
||||
case sprmTIstd:
|
||||
case sprmTIstdPermute:
|
||||
{
|
||||
if (_isTableStyleNeeded)
|
||||
{
|
||||
case sprmOldTDxaGapHalf:
|
||||
case sprmTDxaGapHalf:
|
||||
size_t ind = FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
|
||||
std::wstring id = ind < _styles->Styles->size() ? StyleSheetMapping::MakeStyleId(_styles->Styles->at(ind)) : L"";
|
||||
|
||||
if (id != std::wstring(L"TableNormal") && !id.empty())
|
||||
{
|
||||
gabHalf = FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
}break;
|
||||
case sprmOldTDefTable:
|
||||
case sprmTDefTable:
|
||||
{
|
||||
//table definition
|
||||
SprmTDefTable tDef( iter->Arguments, iter->argumentsSize );
|
||||
//Workaround for retrieving the indent of the table:
|
||||
//In some files there is a indent but no sprmTWidthIndent is set.
|
||||
//For this cases we can calculate the indent of the table by getting the
|
||||
//first boundary of the TDef and adding the padding of the cells
|
||||
|
||||
tblIndent = gabHalf + FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
|
||||
//If there follows a real sprmTWidthIndent, this value will be overwritten
|
||||
|
||||
//tblIndent = (std::max)((int)tblIndent,0); //cerere.doc
|
||||
}break;
|
||||
case sprmTTableWidth:
|
||||
{
|
||||
//preferred table width
|
||||
unsigned char fts = iter->Arguments[0];
|
||||
short width = FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
|
||||
|
||||
XMLTools::XMLElement tblW( L"w:tblW");
|
||||
|
||||
XMLTools::XMLAttribute w( L"w:w", FormatUtils::IntToWideString( width ) );
|
||||
XMLTools::XMLAttribute type( L"w:type", FormatUtils::MapValueToWideString( fts, &WidthType[0][0], 4, 5 ) );
|
||||
|
||||
tblW.AppendAttribute( type );
|
||||
tblW.AppendAttribute( w );
|
||||
|
||||
_tblPr->AppendChild( tblW );
|
||||
|
||||
bTableW = true;
|
||||
}break;
|
||||
case sprmTMerge:
|
||||
{
|
||||
itcFirst = iter->Arguments[0];
|
||||
itcLim = iter->Arguments[1];
|
||||
}break;
|
||||
case sprmTSplit:
|
||||
{
|
||||
|
||||
}break;
|
||||
case sprmOldTJc:
|
||||
case sprmTJc:
|
||||
case sprmTJcRow:
|
||||
{
|
||||
|
||||
appendValueElement( _tblPr, L"jc" , FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::JustificationCode[0][0], 10, 15 ), true );
|
||||
}break;
|
||||
case sprmTWidthIndent:
|
||||
{
|
||||
|
||||
tblIndent = FtsWWidth_Indent(iter->Arguments).wWidth;
|
||||
// tblIndent = FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
|
||||
}break;
|
||||
case sprmTIstd:
|
||||
case sprmTIstdPermute:
|
||||
{
|
||||
|
||||
if ( _isTableStyleNeeded )
|
||||
{
|
||||
size_t ind = FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
|
||||
std::wstring id = ind < _styles->Styles->size() ? StyleSheetMapping::MakeStyleId( _styles->Styles->at( ind ) ) : L"";
|
||||
|
||||
if( id != std::wstring( L"TableNormal") && !id.empty() )
|
||||
{
|
||||
appendValueElement( _tblPr, L"tblStyle", id, true );
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case sprmTFBiDi:
|
||||
case sprmTFBiDi90:
|
||||
{
|
||||
|
||||
appendValueElement( _tblPr, L"bidiVisual", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ), true );
|
||||
}break;
|
||||
case sprmOldTTlp:
|
||||
case sprmTTlp:
|
||||
{
|
||||
|
||||
appendValueElement( _tblPr, L"tblLook", FormatUtils::IntToFormattedWideString( FormatUtils::BytesToInt16( iter->Arguments, 2, iter->argumentsSize ), L"%04x" ), true );
|
||||
}break;
|
||||
case sprmTFAutofit:
|
||||
{
|
||||
if ( iter->Arguments[0] == 1 )
|
||||
{
|
||||
layoutType.SetValue( L"auto" );
|
||||
}
|
||||
}break;
|
||||
case sprmTCellPadding:
|
||||
case sprmTCellPaddingDefault:
|
||||
case sprmTCellPaddingOuter:
|
||||
{ //default cell padding (margin)
|
||||
|
||||
unsigned char grfbrc = iter->Arguments[2];
|
||||
short wMar = FormatUtils::BytesToInt16( iter->Arguments, 4, iter->argumentsSize );
|
||||
std::wstring strValue = FormatUtils::IntToWideString( wMar );
|
||||
|
||||
if ( FormatUtils::BitmaskToBool( (int)grfbrc, 0x01 ) )
|
||||
{
|
||||
appendDxaElement( &tblCellMar, L"top" , strValue, true );
|
||||
}
|
||||
|
||||
if ( FormatUtils::BitmaskToBool( (int)grfbrc, 0x02 ) )
|
||||
{
|
||||
marginLeft = wMar;
|
||||
}
|
||||
|
||||
if ( FormatUtils::BitmaskToBool( (int)grfbrc, 0x04 ) )
|
||||
{
|
||||
appendDxaElement( &tblCellMar, L"bottom", strValue, true );
|
||||
}
|
||||
|
||||
if ( FormatUtils::BitmaskToBool( (int)grfbrc, 0x08 ) )
|
||||
{
|
||||
marginRight = wMar;
|
||||
}
|
||||
}break;
|
||||
case sprmTCHorzBands:
|
||||
{
|
||||
|
||||
appendValueElement( _tblPr, L"tblStyleRowBandSize", iter->Arguments[0], true );
|
||||
}break;
|
||||
case sprmTCVertBands:
|
||||
{
|
||||
|
||||
appendValueElement( _tblPr, L"tblStyleColBandSize", iter->Arguments[0], true );
|
||||
}break;
|
||||
case sprmTFNoAllowOverlap:
|
||||
{
|
||||
std::wstring tblOverlapVal(L"overlap");
|
||||
|
||||
if ( iter->Arguments[0] )
|
||||
{
|
||||
tblOverlapVal = L"never";
|
||||
}
|
||||
|
||||
appendValueElement( _tblPr, L"tblOverlap", tblOverlapVal, true );
|
||||
}break;
|
||||
case sprmOldTSetShd :
|
||||
case sprmTSetShdTable :
|
||||
{
|
||||
|
||||
appendShading( _tblPr, ShadingDescriptor( iter->Arguments, iter->argumentsSize ) );
|
||||
}break;
|
||||
case sprmTTableBorders80:
|
||||
{
|
||||
const int size = 4;
|
||||
unsigned char brc80[size];
|
||||
|
||||
//top border
|
||||
memcpy( brc80, iter->Arguments, size );
|
||||
RELEASEOBJECT( brcTop );
|
||||
brcTop = new BorderCode( brc80, size );
|
||||
|
||||
//left
|
||||
memcpy( brc80, ( iter->Arguments + 4 ), size );
|
||||
RELEASEOBJECT( brcLeft );
|
||||
brcLeft = new BorderCode( brc80, size );
|
||||
|
||||
//bottom
|
||||
memcpy( brc80, ( iter->Arguments + 8 ), size );
|
||||
RELEASEOBJECT( brcBottom );
|
||||
brcBottom = new BorderCode( brc80, size );
|
||||
|
||||
//right
|
||||
memcpy( brc80, ( iter->Arguments + 12 ), size );
|
||||
RELEASEOBJECT( brcRight );
|
||||
brcRight = new BorderCode( brc80, size );
|
||||
|
||||
//inside H
|
||||
memcpy( brc80, ( iter->Arguments + 16 ), size );
|
||||
RELEASEOBJECT( brcHorz );
|
||||
brcHorz = new BorderCode( brc80, size );
|
||||
|
||||
//inside V
|
||||
memcpy( brc80, ( iter->Arguments + 20 ), size );
|
||||
RELEASEOBJECT( brcVert );
|
||||
brcVert = new BorderCode( brc80, size );
|
||||
}break;
|
||||
case sprmOldTTableBorders:
|
||||
case sprmTTableBorders:
|
||||
{
|
||||
const int size = 8;
|
||||
unsigned char brc[size];
|
||||
|
||||
//top border
|
||||
memcpy( brc, iter->Arguments, size );
|
||||
RELEASEOBJECT( brcTop );
|
||||
brcTop = new BorderCode( brc, size );
|
||||
|
||||
//left
|
||||
memcpy( brc, ( iter->Arguments + 8 ), size );
|
||||
RELEASEOBJECT( brcLeft );
|
||||
brcLeft = new BorderCode( brc, size );
|
||||
|
||||
//bottom
|
||||
memcpy( brc, ( iter->Arguments + 16 ), size );
|
||||
RELEASEOBJECT( brcBottom );
|
||||
brcBottom = new BorderCode( brc, size );
|
||||
|
||||
//right
|
||||
memcpy( brc, ( iter->Arguments + 24 ), size );
|
||||
RELEASEOBJECT( brcRight );
|
||||
brcRight = new BorderCode( brc, size );
|
||||
|
||||
//inside H
|
||||
memcpy( brc, ( iter->Arguments + 32 ), size );
|
||||
RELEASEOBJECT( brcHorz );
|
||||
brcHorz = new BorderCode( brc, size );
|
||||
|
||||
//inside V
|
||||
memcpy( brc, ( iter->Arguments + 40 ), size );
|
||||
RELEASEOBJECT( brcVert );
|
||||
brcVert = new BorderCode( brc, size );
|
||||
}break;
|
||||
case sprmTPc:
|
||||
{
|
||||
unsigned char flag = ( iter->Arguments[0] & 0x30 ) >> 4;
|
||||
|
||||
appendValueAttribute( &tblpPr, L"w:vertAnchor", FormatUtils::MapValueToWideString( flag, &Global::VerticalPositionCode[0][0], 4, 7 ) );
|
||||
|
||||
flag = ( iter->Arguments[0] & 0xC0 ) >> 6;
|
||||
|
||||
appendValueAttribute( &tblpPr, L"w:horzAnchor", FormatUtils::MapValueToWideString( flag, &Global::HorizontalPositionCode[0][0], 4, 7 ) );
|
||||
}break;
|
||||
case sprmTDxaFromText:
|
||||
{
|
||||
appendValueAttribute( &tblpPr, L"w:leftFromText", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
|
||||
}break;
|
||||
case sprmTDxaFromTextRight:
|
||||
{
|
||||
appendValueAttribute( &tblpPr, L"w:rightFromText", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
|
||||
}break;
|
||||
case sprmTDyaFromText:
|
||||
{
|
||||
appendValueAttribute( &tblpPr, L"w:topFromText", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
|
||||
}break;
|
||||
case sprmTDyaFromTextBottom:
|
||||
{
|
||||
appendValueAttribute( &tblpPr, L"w:bottomFromText", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
|
||||
}break;
|
||||
case sprmTDxaAbs:
|
||||
{
|
||||
appendValueAttribute( &tblpPr, L"w:tblpX", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
|
||||
}break;
|
||||
case sprmTDyaAbs:
|
||||
{
|
||||
appendValueAttribute( &tblpPr, L"w:tblpY", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
|
||||
}break;
|
||||
appendValueElement(_tblPr, L"tblStyle", id, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (false == bTableW)
|
||||
}break;
|
||||
case sprmTFBiDi:
|
||||
case sprmTFBiDi90:
|
||||
{
|
||||
XMLTools::XMLElement tblW( L"w:tblW");
|
||||
|
||||
XMLTools::XMLAttribute w( L"w:w", L"0");
|
||||
XMLTools::XMLAttribute type( L"w:type", L"auto" );
|
||||
|
||||
tblW.AppendAttribute( type );
|
||||
tblW.AppendAttribute( w );
|
||||
|
||||
_tblPr->AppendChild( tblW );
|
||||
}
|
||||
|
||||
//indent
|
||||
if ( tblIndent )
|
||||
appendValueElement(_tblPr, L"bidiVisual", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize), true);
|
||||
}break;
|
||||
case sprmOldTTlp:
|
||||
case sprmTTlp:
|
||||
{
|
||||
XMLTools::XMLElement tblInd( L"w:tblInd");
|
||||
|
||||
XMLTools::XMLAttribute tblIndW( L"w:w", FormatUtils::IntToWideString( *tblIndent ) );
|
||||
tblInd.AppendAttribute( tblIndW );
|
||||
|
||||
XMLTools::XMLAttribute tblIndType( L"w:type", L"dxa");
|
||||
tblInd.AppendAttribute( tblIndType );
|
||||
|
||||
_tblPr->AppendChild( tblInd );
|
||||
}
|
||||
|
||||
//append floating props
|
||||
if ( tblpPr.GetAttributeCount() > 0 )
|
||||
appendValueElement(_tblPr, L"tblLook", FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt16(iter->Arguments, 2, iter->argumentsSize), L"%04x"), true);
|
||||
}break;
|
||||
case sprmTFAutofit:
|
||||
{
|
||||
_tblPr->AppendChild( tblpPr );
|
||||
}
|
||||
|
||||
//set borders
|
||||
if ( brcTop != NULL )
|
||||
if (iter->Arguments[0] == 1)
|
||||
{
|
||||
layoutType.SetValue(L"auto");
|
||||
}
|
||||
}break;
|
||||
case sprmTCellSpacing:
|
||||
case sprmTCellSpacingDefault:
|
||||
{
|
||||
XMLTools::XMLElement topBorder( L"w:top");
|
||||
appendBorderAttributes( brcTop, &topBorder );
|
||||
addOrSetBorder( _tblBorders, &topBorder );
|
||||
}
|
||||
unsigned char grfbrc = iter->Arguments[2];
|
||||
short wSpc = FormatUtils::BytesToInt16(iter->Arguments, 4, iter->argumentsSize);
|
||||
std::wstring strValue = FormatUtils::IntToWideString(wSpc);
|
||||
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x01))
|
||||
{
|
||||
appendDxaElement(_tblPr, L"tblCellSpacing", strValue, true);
|
||||
}
|
||||
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x02))
|
||||
{
|
||||
cellSpacing = wSpc;
|
||||
}
|
||||
}break;
|
||||
case sprmTCellPadding:
|
||||
case sprmTCellPaddingDefault:
|
||||
case sprmTCellPaddingOuter:
|
||||
{//default cell padding (margin)
|
||||
unsigned char grfbrc = iter->Arguments[2];
|
||||
short wMar = FormatUtils::BytesToInt16(iter->Arguments, 4, iter->argumentsSize);
|
||||
std::wstring strValue = FormatUtils::IntToWideString(wMar);
|
||||
|
||||
if ( brcLeft != NULL )
|
||||
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x01))
|
||||
{
|
||||
appendDxaElement(&tblCellMar, L"top", strValue, true);
|
||||
}
|
||||
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x02))
|
||||
{
|
||||
marginLeft = wMar;
|
||||
}
|
||||
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x04))
|
||||
{
|
||||
appendDxaElement(&tblCellMar, L"bottom", strValue, true);
|
||||
}
|
||||
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x08))
|
||||
{
|
||||
marginRight = wMar;
|
||||
}
|
||||
}break;
|
||||
case sprmTCHorzBands:
|
||||
{
|
||||
XMLTools::XMLElement leftBorder( L"w:left");
|
||||
appendBorderAttributes( brcLeft, &leftBorder );
|
||||
addOrSetBorder( _tblBorders, &leftBorder );
|
||||
}
|
||||
|
||||
if ( brcBottom != NULL )
|
||||
appendValueElement(_tblPr, L"tblStyleRowBandSize", iter->Arguments[0], true);
|
||||
}break;
|
||||
case sprmTCVertBands:
|
||||
{
|
||||
XMLTools::XMLElement bottomBorder( L"w:bottom");
|
||||
appendBorderAttributes( brcBottom, &bottomBorder );
|
||||
addOrSetBorder( _tblBorders, &bottomBorder );
|
||||
}
|
||||
|
||||
if ( brcRight != NULL )
|
||||
appendValueElement(_tblPr, L"tblStyleColBandSize", iter->Arguments[0], true);
|
||||
}break;
|
||||
case sprmTFNoAllowOverlap:
|
||||
{
|
||||
XMLTools::XMLElement rightBorder( L"w:right");
|
||||
appendBorderAttributes( brcRight, &rightBorder );
|
||||
addOrSetBorder( _tblBorders, &rightBorder );
|
||||
}
|
||||
std::wstring tblOverlapVal(L"overlap");
|
||||
|
||||
if ( brcHorz != NULL )
|
||||
if (iter->Arguments[0])
|
||||
{
|
||||
tblOverlapVal = L"never";
|
||||
}
|
||||
|
||||
appendValueElement(_tblPr, L"tblOverlap", tblOverlapVal, true);
|
||||
}break;
|
||||
case sprmOldTSetShd:
|
||||
case sprmTSetShdTable:
|
||||
{
|
||||
XMLTools::XMLElement insideHBorder( L"w:insideH");
|
||||
appendBorderAttributes( brcHorz, &insideHBorder );
|
||||
addOrSetBorder( _tblBorders, &insideHBorder );
|
||||
}
|
||||
|
||||
if ( brcVert != NULL )
|
||||
appendShading(_tblPr, ShadingDescriptor(iter->Arguments, iter->argumentsSize));
|
||||
}break;
|
||||
case sprmTTableBorders80:
|
||||
{
|
||||
XMLTools::XMLElement insideVBorder( L"w:insideV");
|
||||
appendBorderAttributes( brcVert, &insideVBorder );
|
||||
addOrSetBorder( _tblBorders, &insideVBorder );
|
||||
}
|
||||
const int size = 4;
|
||||
unsigned char brc80[size];
|
||||
|
||||
if ( _tblBorders->GetChildCount() > 0 )
|
||||
memcpy(brc80, iter->Arguments, size);
|
||||
brcTop = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
|
||||
|
||||
memcpy(brc80, (iter->Arguments + 4), size);
|
||||
brcLeft = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
|
||||
|
||||
memcpy(brc80, (iter->Arguments + 8), size);
|
||||
brcBottom = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
|
||||
|
||||
memcpy(brc80, (iter->Arguments + 12), size);
|
||||
brcRight = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
|
||||
|
||||
memcpy(brc80, (iter->Arguments + 16), size);
|
||||
brcHorz = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
|
||||
|
||||
memcpy(brc80, (iter->Arguments + 20), size);
|
||||
brcVert = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
|
||||
}break;
|
||||
case sprmOldTTableBorders:
|
||||
case sprmTTableBorders:
|
||||
{
|
||||
_tblPr->AppendChild( *_tblBorders );
|
||||
}
|
||||
const int size = 8;
|
||||
unsigned char brc[size];
|
||||
|
||||
if (false == layoutType.GetValue().empty())
|
||||
memcpy(brc, iter->Arguments, size);
|
||||
brcTop = std::shared_ptr<BorderCode>(new BorderCode(brc, size));
|
||||
|
||||
memcpy(brc, (iter->Arguments + 8), size);
|
||||
brcLeft = std::shared_ptr<BorderCode>(new BorderCode(brc, size));
|
||||
|
||||
memcpy(brc, (iter->Arguments + 16), size);
|
||||
brcBottom = std::shared_ptr<BorderCode>(new BorderCode(brc, size));
|
||||
|
||||
memcpy(brc, (iter->Arguments + 24), size);
|
||||
brcRight = std::shared_ptr<BorderCode>(new BorderCode(brc, size));
|
||||
|
||||
memcpy(brc, (iter->Arguments + 32), size);
|
||||
brcHorz = std::shared_ptr<BorderCode>(new BorderCode(brc, size));
|
||||
|
||||
memcpy(brc, (iter->Arguments + 40), size);
|
||||
brcVert = std::shared_ptr<BorderCode>(new BorderCode(brc, size));
|
||||
}break;
|
||||
case sprmTPc:
|
||||
{
|
||||
tblLayout.AppendAttribute(layoutType);
|
||||
}
|
||||
_tblPr->AppendChild( tblLayout );
|
||||
unsigned char flag = (iter->Arguments[0] & 0x30) >> 4;
|
||||
|
||||
if ( ( marginLeft == 0 ) && ( gabHalf != 0 ) )
|
||||
appendValueAttribute(&tblpPr, L"w:vertAnchor", FormatUtils::MapValueToWideString(flag, &Global::VerticalPositionCode[0][0], 4, 7));
|
||||
|
||||
flag = (iter->Arguments[0] & 0xC0) >> 6;
|
||||
|
||||
appendValueAttribute(&tblpPr, L"w:horzAnchor", FormatUtils::MapValueToWideString(flag, &Global::HorizontalPositionCode[0][0], 4, 7));
|
||||
}break;
|
||||
case sprmTDxaFromText:
|
||||
{
|
||||
appendDxaElement( &tblCellMar, L"left", FormatUtils::IntToWideString( gabHalf ), true );
|
||||
}
|
||||
else
|
||||
appendValueAttribute(&tblpPr, L"w:leftFromText", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
|
||||
}break;
|
||||
case sprmTDxaFromTextRight:
|
||||
{
|
||||
appendDxaElement( &tblCellMar, L"left", FormatUtils::IntToWideString( marginLeft ), true );
|
||||
}
|
||||
|
||||
if ( ( marginRight == 0 ) && ( gabHalf != 0 ) )
|
||||
appendValueAttribute(&tblpPr, L"w:rightFromText", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
|
||||
}break;
|
||||
case sprmTDyaFromText:
|
||||
{
|
||||
appendDxaElement( &tblCellMar, L"right", FormatUtils::IntToWideString( gabHalf ), true );
|
||||
}
|
||||
else
|
||||
appendValueAttribute(&tblpPr, L"w:topFromText", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
|
||||
}break;
|
||||
case sprmTDyaFromTextBottom:
|
||||
{
|
||||
appendDxaElement( &tblCellMar, L"right", FormatUtils::IntToWideString( marginRight ), true );
|
||||
}
|
||||
|
||||
_tblPr->AppendChild( tblCellMar );
|
||||
|
||||
//write Properties
|
||||
if ( ( _tblPr->GetChildCount() > 0 ) || ( _tblPr->GetAttributeCount() > 0 ) )
|
||||
appendValueAttribute(&tblpPr, L"w:bottomFromText", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
|
||||
}break;
|
||||
case sprmTDxaAbs:
|
||||
{
|
||||
m_pXmlWriter->WriteString( _tblPr->GetXMLString() );
|
||||
}
|
||||
|
||||
//append the grid
|
||||
_tblGrid = new XMLTools::XMLElement( L"w:tblGrid");
|
||||
|
||||
for (size_t i = 0; i < _grid->size(); i++)
|
||||
appendValueAttribute(&tblpPr, L"w:tblpX", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
|
||||
}break;
|
||||
case sprmTDyaAbs:
|
||||
{
|
||||
XMLTools::XMLElement gridCol(L"w:gridCol");
|
||||
XMLTools::XMLAttribute gridColW(L"w:w", FormatUtils::IntToWideString(_grid->at(i)));
|
||||
gridCol.AppendAttribute(gridColW);
|
||||
_tblGrid->AppendChild(gridCol);
|
||||
appendValueAttribute(&tblpPr, L"w:tblpY", FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize));
|
||||
}break;
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteString( _tblGrid->GetXMLString() );
|
||||
}
|
||||
if (false == bTableW)
|
||||
{
|
||||
XMLTools::XMLElement tblW(L"w:tblW");
|
||||
|
||||
XMLTools::XMLAttribute w(L"w:w", L"0");
|
||||
XMLTools::XMLAttribute type(L"w:type", L"auto");
|
||||
|
||||
tblW.AppendAttribute(type);
|
||||
tblW.AppendAttribute(w);
|
||||
|
||||
_tblPr->AppendChild(tblW);
|
||||
}
|
||||
|
||||
if (tblIndent)
|
||||
{
|
||||
XMLTools::XMLElement tblInd(L"w:tblInd");
|
||||
|
||||
XMLTools::XMLAttribute tblIndW(L"w:w", FormatUtils::IntToWideString(*tblIndent));
|
||||
tblInd.AppendAttribute(tblIndW);
|
||||
|
||||
XMLTools::XMLAttribute tblIndType(L"w:type", L"dxa");
|
||||
tblInd.AppendAttribute(tblIndType);
|
||||
|
||||
_tblPr->AppendChild(tblInd);
|
||||
}
|
||||
|
||||
if (tblpPr.GetAttributeCount() > 0)
|
||||
{
|
||||
_tblPr->AppendChild(tblpPr);
|
||||
}
|
||||
|
||||
if (brcTop)
|
||||
{
|
||||
XMLTools::XMLElement topBorder(L"w:top");
|
||||
appendBorderAttributes(brcTop.get(), &topBorder);
|
||||
addOrSetBorder(_tblBorders, &topBorder);
|
||||
}
|
||||
|
||||
if (brcLeft)
|
||||
{
|
||||
XMLTools::XMLElement leftBorder(L"w:left");
|
||||
appendBorderAttributes(brcLeft.get(), &leftBorder);
|
||||
addOrSetBorder(_tblBorders, &leftBorder);
|
||||
}
|
||||
|
||||
if (brcBottom)
|
||||
{
|
||||
XMLTools::XMLElement bottomBorder(L"w:bottom");
|
||||
appendBorderAttributes(brcBottom.get(), &bottomBorder);
|
||||
addOrSetBorder(_tblBorders, &bottomBorder);
|
||||
}
|
||||
|
||||
if (brcRight)
|
||||
{
|
||||
XMLTools::XMLElement rightBorder(L"w:right");
|
||||
appendBorderAttributes(brcRight.get(), &rightBorder);
|
||||
addOrSetBorder(_tblBorders, &rightBorder);
|
||||
}
|
||||
|
||||
if (brcHorz)
|
||||
{
|
||||
XMLTools::XMLElement insideHBorder(L"w:insideH");
|
||||
appendBorderAttributes(brcHorz.get(), &insideHBorder);
|
||||
addOrSetBorder(_tblBorders, &insideHBorder);
|
||||
}
|
||||
|
||||
if (brcVert)
|
||||
{
|
||||
XMLTools::XMLElement insideVBorder(L"w:insideV");
|
||||
appendBorderAttributes(brcVert.get(), &insideVBorder);
|
||||
addOrSetBorder(_tblBorders, &insideVBorder);
|
||||
}
|
||||
|
||||
if (_tblBorders->GetChildCount() > 0)
|
||||
{
|
||||
_tblPr->AppendChild(*_tblBorders);
|
||||
}
|
||||
|
||||
if (false == layoutType.GetValue().empty())
|
||||
{
|
||||
tblLayout.AppendAttribute(layoutType);
|
||||
}
|
||||
_tblPr->AppendChild(tblLayout);
|
||||
|
||||
if ((marginLeft == 0) && (gabHalf != 0))
|
||||
{
|
||||
appendDxaElement(&tblCellMar, L"left", FormatUtils::IntToWideString(gabHalf), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
appendDxaElement(&tblCellMar, L"left", FormatUtils::IntToWideString(marginLeft), true);
|
||||
}
|
||||
|
||||
if ((marginRight == 0) && (gabHalf != 0))
|
||||
{
|
||||
appendDxaElement(&tblCellMar, L"right", FormatUtils::IntToWideString(gabHalf), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
appendDxaElement(&tblCellMar, L"right", FormatUtils::IntToWideString(marginRight), true);
|
||||
}
|
||||
|
||||
_tblPr->AppendChild(tblCellMar);
|
||||
|
||||
if ((_tblPr->GetChildCount() > 0) || (_tblPr->GetAttributeCount() > 0))
|
||||
{
|
||||
m_pXmlWriter->WriteString(_tblPr->GetXMLString());
|
||||
}
|
||||
|
||||
//append the grid
|
||||
_tblGrid = new XMLTools::XMLElement(L"w:tblGrid");
|
||||
|
||||
for (size_t i = 0; i < _grid->size(); i++)
|
||||
{
|
||||
XMLTools::XMLElement gridCol(L"w:gridCol");
|
||||
XMLTools::XMLAttribute gridColW(L"w:w", FormatUtils::IntToWideString(_grid->at(i)));
|
||||
gridCol.AppendAttribute(gridColW);
|
||||
_tblGrid->AppendChild(gridCol);
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteString(_tblGrid->GetXMLString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,12 +84,12 @@ namespace DocFileFormat
|
||||
StyleSheet* _styles;
|
||||
std::vector<short>* _grid;
|
||||
|
||||
BorderCode* brcLeft;
|
||||
BorderCode* brcTop;
|
||||
BorderCode* brcBottom;
|
||||
BorderCode* brcRight;
|
||||
BorderCode* brcHorz;
|
||||
BorderCode* brcVert;
|
||||
std::shared_ptr<BorderCode> brcLeft;
|
||||
std::shared_ptr<BorderCode> brcTop;
|
||||
std::shared_ptr<BorderCode> brcBottom;
|
||||
std::shared_ptr<BorderCode> brcRight;
|
||||
std::shared_ptr<BorderCode> brcHorz;
|
||||
std::shared_ptr<BorderCode> brcVert;
|
||||
|
||||
bool _isTableStyleNeeded;
|
||||
};
|
||||
|
||||
@ -53,6 +53,13 @@ namespace DocFileFormat
|
||||
{
|
||||
TablePropertyExceptions* tapx = static_cast<TablePropertyExceptions*>( visited );
|
||||
|
||||
std::shared_ptr<BorderCode> brcLeft;
|
||||
std::shared_ptr<BorderCode> brcTop;
|
||||
std::shared_ptr<BorderCode> brcBottom;
|
||||
std::shared_ptr<BorderCode> brcRight;
|
||||
std::shared_ptr<BorderCode> brcHorz;
|
||||
std::shared_ptr<BorderCode> brcVert;
|
||||
|
||||
//delete infos
|
||||
RevisionData rev( _rowEndChpx );
|
||||
|
||||
@ -84,7 +91,7 @@ namespace DocFileFormat
|
||||
}
|
||||
}break;
|
||||
case sprmTWidthAfter:
|
||||
{ //width after
|
||||
{ //width after
|
||||
XMLTools::XMLElement wAfter( L"w:wAfter" );
|
||||
XMLTools::XMLAttribute wAfterValue( L"w:w", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize ) ) );
|
||||
wAfter.AppendAttribute( wAfterValue );
|
||||
@ -94,7 +101,7 @@ namespace DocFileFormat
|
||||
_trPr->AppendChild( wAfter, true );
|
||||
}break;
|
||||
case sprmTWidthBefore:
|
||||
{ //width before
|
||||
{ //width before
|
||||
short before = FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
|
||||
|
||||
if ( before != 0 )
|
||||
@ -110,7 +117,7 @@ namespace DocFileFormat
|
||||
}break;
|
||||
case sprmOldTDyaRowHeight:
|
||||
case sprmTDyaRowHeight:
|
||||
{ //row height
|
||||
{ //row height
|
||||
XMLTools::XMLElement rowHeight( L"w:trHeight" );
|
||||
XMLTools::XMLAttribute rowHeightVal( L"w:val" );
|
||||
XMLTools::XMLAttribute rowHeightRule( L"w:hRule" );
|
||||
@ -142,113 +149,98 @@ namespace DocFileFormat
|
||||
case sprmOldTFCantSplit:
|
||||
case sprmTFCantSplit:
|
||||
case sprmTFCantSplit90:
|
||||
{ //can't split
|
||||
{ //can't split
|
||||
appendFlagElement( _trPr, *iter, L"cantSplit", true );
|
||||
}break;
|
||||
|
||||
//div id
|
||||
}break;
|
||||
case sprmTIpgp:// = PGPInfo.ipgpSelf (PGPInfo structure describes the border and margin properties)
|
||||
{ //div id
|
||||
}break;
|
||||
case sprmTCellSpacing:
|
||||
case sprmTCellSpacingDefault:
|
||||
{
|
||||
unsigned char grfbrc = iter->Arguments[2];
|
||||
short wSpc = FormatUtils::BytesToInt16(iter->Arguments, 4, iter->argumentsSize);
|
||||
std::wstring strValue = FormatUtils::IntToWideString(wSpc);
|
||||
if (FormatUtils::BitmaskToBool((int)grfbrc, 0x01))
|
||||
{
|
||||
appendDxaElement(_trPr, L"tblCellSpacing", strValue, true);
|
||||
}
|
||||
}break;
|
||||
case sprmTTableBorders80:
|
||||
{
|
||||
const int size = 4;
|
||||
unsigned char brc80[size];
|
||||
|
||||
memcpy(brc80, iter->Arguments, size);
|
||||
brcTop = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
|
||||
|
||||
memcpy(brc80, (iter->Arguments + 4), size);
|
||||
brcLeft = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
|
||||
|
||||
memcpy(brc80, (iter->Arguments + 8), size);
|
||||
brcBottom = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
|
||||
|
||||
memcpy(brc80, (iter->Arguments + 12), size);
|
||||
brcRight = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
|
||||
|
||||
memcpy(brc80, (iter->Arguments + 16), size);
|
||||
brcHorz = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
|
||||
|
||||
memcpy(brc80, (iter->Arguments + 20), size);
|
||||
brcVert = std::shared_ptr<BorderCode>(new BorderCode(brc80, size));
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
//borders 80 exceptions
|
||||
//case SinglePropertyModifier.OperationCode.sprmTTableBorders80:
|
||||
// unsigned char[] brc80 = new unsigned char[4];
|
||||
// //top border
|
||||
// Array.Copy(sprm.Arguments, 0, brc80, 0, 4);
|
||||
// brcTop = new BorderCode(brc80);
|
||||
// //left
|
||||
// Array.Copy(sprm.Arguments, 4, brc80, 0, 4);
|
||||
// brcLeft = new BorderCode(brc80);
|
||||
// //bottom
|
||||
// Array.Copy(sprm.Arguments, 8, brc80, 0, 4);
|
||||
// brcBottom = new BorderCode(brc80);
|
||||
// //right
|
||||
// Array.Copy(sprm.Arguments, 12, brc80, 0, 4);
|
||||
// brcRight = new BorderCode(brc80);
|
||||
// //inside H
|
||||
// Array.Copy(sprm.Arguments, 16, brc80, 0, 4);
|
||||
// brcHorz = new BorderCode(brc80);
|
||||
// //inside V
|
||||
// Array.Copy(sprm.Arguments, 20, brc80, 0, 4);
|
||||
// brcVert = new BorderCode(brc80);
|
||||
// break;
|
||||
|
||||
//border exceptions
|
||||
//case SinglePropertyModifier.OperationCode.sprmTTableBorders:
|
||||
// unsigned char[] brc = new unsigned char[8];
|
||||
// //top border
|
||||
// Array.Copy(sprm.Arguments, 0, brc, 0, 8);
|
||||
// brcTop = new BorderCode(brc);
|
||||
// //left
|
||||
// Array.Copy(sprm.Arguments, 8, brc, 0, 8);
|
||||
// brcLeft = new BorderCode(brc);
|
||||
// //bottom
|
||||
// Array.Copy(sprm.Arguments, 16, brc, 0, 8);
|
||||
// brcBottom = new BorderCode(brc);
|
||||
// //right
|
||||
// Array.Copy(sprm.Arguments, 24, brc, 0, 8);
|
||||
// brcRight = new BorderCode(brc);
|
||||
// //inside H
|
||||
// Array.Copy(sprm.Arguments, 32, brc, 0, 8);
|
||||
// brcHorz = new BorderCode(brc);
|
||||
// //inside V
|
||||
// Array.Copy(sprm.Arguments, 40, brc, 0, 8);
|
||||
// brcVert = new BorderCode(brc);
|
||||
// break;
|
||||
}
|
||||
}
|
||||
|
||||
//set borders
|
||||
//if (brcTop != null)
|
||||
//{
|
||||
// XmlNode topBorder = _nodeFactory.CreateNode(XmlNodeType.Element, "w", "top", OpenXmlNamespaces.WordprocessingML);
|
||||
// appendBorderAttributes(brcTop, topBorder);
|
||||
// addOrSetBorder(_tblBorders, topBorder);
|
||||
//}
|
||||
//if (brcLeft != null)
|
||||
//{
|
||||
// XmlNode leftBorder = _nodeFactory.CreateNode(XmlNodeType.Element, "w", "left", OpenXmlNamespaces.WordprocessingML);
|
||||
// appendBorderAttributes(brcLeft, leftBorder);
|
||||
// addOrSetBorder(_tblBorders, leftBorder);
|
||||
//}
|
||||
//if (brcBottom != null)
|
||||
//{
|
||||
// XmlNode bottomBorder = _nodeFactory.CreateNode(XmlNodeType.Element, "w", "bottom", OpenXmlNamespaces.WordprocessingML);
|
||||
// appendBorderAttributes(brcBottom, bottomBorder);
|
||||
// addOrSetBorder(_tblBorders, bottomBorder);
|
||||
//}
|
||||
//if (brcRight != null)
|
||||
//{
|
||||
// XmlNode rightBorder = _nodeFactory.CreateNode(XmlNodeType.Element, "w", "right", OpenXmlNamespaces.WordprocessingML);
|
||||
// appendBorderAttributes(brcRight, rightBorder);
|
||||
// addOrSetBorder(_tblBorders, rightBorder);
|
||||
//}
|
||||
//if (brcHorz != null)
|
||||
//{
|
||||
// XmlNode insideHBorder = _nodeFactory.CreateNode(XmlNodeType.Element, "w", "insideH", OpenXmlNamespaces.WordprocessingML);
|
||||
// appendBorderAttributes(brcHorz, insideHBorder);
|
||||
// addOrSetBorder(_tblBorders, insideHBorder);
|
||||
//}
|
||||
//if (brcVert != null)
|
||||
//{
|
||||
// XmlNode insideVBorder = _nodeFactory.CreateNode(XmlNodeType.Element, "w", "insideV", OpenXmlNamespaces.WordprocessingML);
|
||||
// appendBorderAttributes(brcVert, insideVBorder);
|
||||
// addOrSetBorder(_tblBorders, insideVBorder);
|
||||
//}
|
||||
//if (_tblBorders.ChildNodes.Count > 0)
|
||||
//{
|
||||
// _tblPrEx.AppendChild(_tblBorders);
|
||||
//}
|
||||
|
||||
//set exceptions
|
||||
XMLTools::XMLElement* _tblBorders = new XMLTools::XMLElement(L"w:tblBorders");
|
||||
if (brcTop)
|
||||
{
|
||||
XMLTools::XMLElement border(L"w:top");
|
||||
appendBorderAttributes(brcTop.get(), &border);
|
||||
addOrSetBorder(_tblBorders, &border);
|
||||
}
|
||||
if (brcLeft)
|
||||
{
|
||||
XMLTools::XMLElement border(L"w:left");
|
||||
appendBorderAttributes(brcLeft.get(), &border);
|
||||
addOrSetBorder(_tblBorders, &border);
|
||||
}
|
||||
if (brcBottom)
|
||||
{
|
||||
XMLTools::XMLElement border(L"w:left");
|
||||
appendBorderAttributes(brcBottom.get(), &border);
|
||||
addOrSetBorder(_tblBorders, &border);
|
||||
}
|
||||
if (brcRight)
|
||||
{
|
||||
XMLTools::XMLElement border(L"w:right");
|
||||
appendBorderAttributes(brcRight.get(), &border);
|
||||
addOrSetBorder(_tblBorders, &border);
|
||||
}
|
||||
if (brcHorz)
|
||||
{
|
||||
XMLTools::XMLElement border(L"w:insideH");
|
||||
appendBorderAttributes(brcHorz.get(), &border);
|
||||
addOrSetBorder(_tblBorders, &border);
|
||||
}
|
||||
if (brcVert)
|
||||
{
|
||||
XMLTools::XMLElement border(L"w:insideV");
|
||||
appendBorderAttributes(brcHorz.get(), &border);
|
||||
addOrSetBorder(_tblBorders, &border);
|
||||
}
|
||||
if (_tblBorders->GetChildCount() > 0)
|
||||
{
|
||||
_tblPrEx->AppendChild(*_tblBorders);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
if ( _tblPrEx->GetChildCount() > 0 )
|
||||
{
|
||||
_trPr->AppendChild( *(_tblPrEx) );
|
||||
m_pXmlWriter->WriteString(_tblPrEx->GetXMLString());
|
||||
}
|
||||
|
||||
//write Properties
|
||||
if ( ( _trPr->GetChildCount() > 0 ) || ( _trPr->GetAttributeCount() > 0 ) )
|
||||
{
|
||||
m_pXmlWriter->WriteString( _trPr->GetXMLString() );
|
||||
|
||||
@ -39,16 +39,16 @@ namespace DocFileFormat
|
||||
class Tbkd : public ByteStructure
|
||||
{
|
||||
public:
|
||||
friend class TextboxMapping;
|
||||
|
||||
static const int STRUCTURE_SIZE = 6;
|
||||
|
||||
Tbkd() : ipgd(0), itxbxs(0), dcpDepend(0), icol(0), fTableBreak(false), fColumnBreak(false), fMarked(false), fUnk(false), fTextOverflow(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
virtual ~Tbkd()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
virtual ByteStructure* ConstructObject (VirtualStreamReader* reader, int length)
|
||||
@ -72,7 +72,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
bool bUsed = false;
|
||||
/// Except in textbox BKD, index to PGD in plfpgd that describes the page this break is on
|
||||
short ipgd;
|
||||
/// In textbox BKD
|
||||
|
||||
@ -83,102 +83,102 @@ namespace DocFileFormat
|
||||
{
|
||||
m_document = static_cast<WordDocument*>(visited);
|
||||
|
||||
if (m_document)
|
||||
if (!m_document) return;
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin(L"v:textbox", true);
|
||||
if (m_dxTextLeft >= 0 && m_dyTextTop >= 0 && m_dxTextRight >= 0 && m_dyTextBottom >= 0)
|
||||
{
|
||||
//if (m_nTBIndex < m_document->TextboxBreakPlex->Elements.size())
|
||||
// return;
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin(L"v:textbox", true);
|
||||
if(m_dxTextLeft >= 0 && m_dyTextTop >= 0 && m_dxTextRight >= 0 && m_dyTextBottom >= 0)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"inset" , FormatUtils::DoubleToWideString(m_dxTextLeft) + L"pt," +
|
||||
FormatUtils::DoubleToWideString(m_dyTextTop) + L"pt," +
|
||||
FormatUtils::DoubleToWideString(m_dxTextRight) + L"pt," +
|
||||
FormatUtils::DoubleToWideString(m_dyTextBottom) + L"pt");
|
||||
}
|
||||
if (!m_sTextBoxStyle.empty())
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"style", m_sTextBoxStyle);
|
||||
}
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true, false );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:txbxContent" );
|
||||
|
||||
int cp = 0;
|
||||
int cpEnd = 0;
|
||||
Tbkd* bkd = NULL;
|
||||
|
||||
int txtbxSubdocStart =
|
||||
m_document->FIB->m_RgLw97.ccpText +
|
||||
m_document->FIB->m_RgLw97.ccpFtn +
|
||||
m_document->FIB->m_RgLw97.ccpHdr +
|
||||
m_document->FIB->m_RgLw97.ccpAtn +
|
||||
m_document->FIB->m_RgLw97.ccpEdn ;
|
||||
|
||||
if (typeid(*_caller) == typeid(MainDocumentMapping))
|
||||
{
|
||||
if (m_nTBIndex < m_document->TextboxBreakPlex->Elements.size() )//file(21).doc
|
||||
{
|
||||
bkd = static_cast<Tbkd*>(m_document->TextboxBreakPlex->Elements[m_nTBIndex]);
|
||||
}
|
||||
|
||||
if (m_nTBIndex + 1 < m_document->TextboxBreakPlex->CharacterPositions.size())
|
||||
{
|
||||
cp = txtbxSubdocStart + m_document->TextboxBreakPlex->CharacterPositions[m_nTBIndex];
|
||||
cpEnd = txtbxSubdocStart + m_document->TextboxBreakPlex->CharacterPositions[m_nTBIndex + 1];
|
||||
}
|
||||
else if (m_nTBIndex + 1 < m_document->TextboxIndividualPlex->CharacterPositions.size())
|
||||
{
|
||||
//todooo сделать чище
|
||||
cp = m_document->TextboxIndividualPlex->CharacterPositions[m_nTBIndex] + 2;
|
||||
cpEnd = m_document->TextboxIndividualPlex->CharacterPositions[m_nTBIndex + 1];
|
||||
}
|
||||
}
|
||||
else if ((typeid(*_caller) == typeid(HeaderMapping)) || (typeid(*_caller) == typeid(FooterMapping)))
|
||||
{
|
||||
txtbxSubdocStart += m_document->FIB->m_RgLw97.ccpTxbx;
|
||||
|
||||
bkd = static_cast<Tbkd*>(m_document->TextboxBreakPlexHeader->Elements[m_nTBIndex]);
|
||||
|
||||
cp = txtbxSubdocStart + m_document->TextboxBreakPlexHeader->CharacterPositions[m_nTBIndex];
|
||||
cpEnd = txtbxSubdocStart + m_document->TextboxBreakPlexHeader->CharacterPositions[m_nTBIndex + 1];
|
||||
}
|
||||
|
||||
_isTextBoxContent = true;
|
||||
|
||||
//convert the textbox text
|
||||
_lastValidPapx = (*(m_document->AllPapxFkps->begin()))->grppapx[0];
|
||||
|
||||
ParagraphPropertyExceptions* papx_prev = NULL;
|
||||
while (cp < cpEnd)
|
||||
{
|
||||
int fc = m_document->FindFileCharPos(cp);
|
||||
if (fc < 0) break;
|
||||
|
||||
ParagraphPropertyExceptions* papx = findValidPapx( fc );
|
||||
if (papx_prev && papx_prev == papx)//file(21).doc
|
||||
break;
|
||||
papx_prev = papx;
|
||||
|
||||
TableInfo tai( papx, m_document->nWordVersion );
|
||||
|
||||
if ( tai.fInTable )
|
||||
{
|
||||
//this PAPX is for a table
|
||||
Table table( this, cp, ( ( tai.iTap > 0 ) ? ( 1 ) : ( 0 ) ) );
|
||||
table.Convert( this );
|
||||
cp = table.GetCPEnd();
|
||||
}
|
||||
else
|
||||
{
|
||||
//this PAPX is for a normal paragraph
|
||||
cp = writeParagraph( cp, 0x7fffffff );
|
||||
}
|
||||
}
|
||||
_isTextBoxContent = false;
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:txbxContent" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"v:textbox" );
|
||||
m_pXmlWriter->WriteAttribute(L"inset", FormatUtils::DoubleToWideString(m_dxTextLeft) + L"pt," +
|
||||
FormatUtils::DoubleToWideString(m_dyTextTop) + L"pt," +
|
||||
FormatUtils::DoubleToWideString(m_dxTextRight) + L"pt," +
|
||||
FormatUtils::DoubleToWideString(m_dyTextBottom) + L"pt");
|
||||
}
|
||||
if (!m_sTextBoxStyle.empty())
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute(L"style", m_sTextBoxStyle);
|
||||
}
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true, false);
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:txbxContent");
|
||||
|
||||
int cpStart = 0;
|
||||
int cpEnd = 0;
|
||||
Tbkd* bkd = NULL;
|
||||
|
||||
int txtbxSubdocStart =
|
||||
m_document->FIB->m_RgLw97.ccpText +
|
||||
m_document->FIB->m_RgLw97.ccpFtn +
|
||||
m_document->FIB->m_RgLw97.ccpHdr +
|
||||
m_document->FIB->m_RgLw97.ccpAtn +
|
||||
m_document->FIB->m_RgLw97.ccpEdn;
|
||||
|
||||
if (typeid(*_caller) == typeid(MainDocumentMapping))
|
||||
{
|
||||
if (m_nTBIndex < m_document->TextboxBreakPlex->Elements.size())//file(21).doc
|
||||
{
|
||||
bkd = static_cast<Tbkd*>(m_document->TextboxBreakPlex->Elements[m_nTBIndex]);
|
||||
}
|
||||
|
||||
if (m_nTBIndex + 1 < m_document->TextboxIndividualPlex->CharacterPositions.size())
|
||||
{//Jukivka.doc
|
||||
cpStart = txtbxSubdocStart + m_document->TextboxIndividualPlex->CharacterPositions[m_nTBIndex];
|
||||
cpEnd = txtbxSubdocStart + m_document->TextboxIndividualPlex->CharacterPositions[m_nTBIndex + 1];
|
||||
}
|
||||
else if (m_nTBIndex + 1 < m_document->TextboxBreakPlex->CharacterPositions.size())
|
||||
{
|
||||
cpStart = txtbxSubdocStart + m_document->TextboxBreakPlex->CharacterPositions[m_nTBIndex];
|
||||
cpEnd = txtbxSubdocStart + m_document->TextboxBreakPlex->CharacterPositions[m_nTBIndex + 1];
|
||||
}
|
||||
|
||||
}
|
||||
else if ((typeid(*_caller) == typeid(HeaderMapping)) || (typeid(*_caller) == typeid(FooterMapping)))
|
||||
{
|
||||
txtbxSubdocStart += m_document->FIB->m_RgLw97.ccpTxbx;
|
||||
|
||||
bkd = static_cast<Tbkd*>(m_document->TextboxBreakPlexHeader->Elements[m_nTBIndex]);
|
||||
|
||||
cpStart = txtbxSubdocStart + m_document->TextboxBreakPlexHeader->CharacterPositions[m_nTBIndex];
|
||||
cpEnd = txtbxSubdocStart + m_document->TextboxBreakPlexHeader->CharacterPositions[m_nTBIndex + 1];
|
||||
}
|
||||
bool bUsed = bkd ? bkd->bUsed : false;
|
||||
_isTextBoxContent = true;
|
||||
|
||||
//convert the textbox text
|
||||
_lastValidPapx = (*(m_document->AllPapxFkps->begin()))->grppapx[0];
|
||||
|
||||
ParagraphPropertyExceptions* papx_prev = NULL;
|
||||
int cp = cpStart;
|
||||
while (cp < cpEnd && cp >= cpStart && !bUsed)
|
||||
{
|
||||
int fc = m_document->FindFileCharPos(cp);
|
||||
if (fc < 0) break;
|
||||
|
||||
ParagraphPropertyExceptions* papx = findValidPapx(fc);
|
||||
if (papx_prev && papx_prev == papx)//file(21).doc
|
||||
break;
|
||||
papx_prev = papx;
|
||||
|
||||
TableInfo tai(papx, m_document->nWordVersion);
|
||||
|
||||
if (tai.fInTable)
|
||||
{
|
||||
//this PAPX is for a table
|
||||
Table table(this, cp, ((tai.iTap > 0) ? (1) : (0)));
|
||||
table.Convert(this);
|
||||
cp = table.GetCPEnd();
|
||||
}
|
||||
else
|
||||
{
|
||||
//this PAPX is for a normal paragraph
|
||||
cp = writeParagraph(cp, 0x7fffffff);
|
||||
}
|
||||
}
|
||||
_isTextBoxContent = false;
|
||||
|
||||
if (bkd)
|
||||
bkd->bUsed = true;
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:txbxContent");
|
||||
m_pXmlWriter->WriteNodeEnd(L"v:textbox");
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,6 @@ namespace DocFileFormat
|
||||
class TextboxMapping : public DocumentMapping
|
||||
{
|
||||
public:
|
||||
|
||||
TextboxMapping(ConversionContext* ctx, int textboxIndex, XMLTools::CStringXmlWriter* writer, IMapping* caller);
|
||||
TextboxMapping(ConversionContext* ctx, XMLTools::CStringXmlWriter* writer, IMapping* caller);
|
||||
|
||||
|
||||
@ -319,7 +319,7 @@ namespace DocFileFormat
|
||||
for (size_t i = 0; i < options.size(); i++)
|
||||
{
|
||||
ODRAW::OfficeArtFOPTEPtr & iter = options[i];
|
||||
switch ( iter->opid )
|
||||
switch (iter->opid)
|
||||
{
|
||||
case wzEquationXML:
|
||||
{
|
||||
@ -328,10 +328,10 @@ namespace DocFileFormat
|
||||
{
|
||||
m_isEquation = true;
|
||||
m_isEmbedded = true;
|
||||
|
||||
|
||||
m_embeddedData = pXml->data;
|
||||
|
||||
if (ParseEmbeddedEquation( m_embeddedData, m_equationXml))
|
||||
if (ParseEmbeddedEquation(m_embeddedData, m_equationXml))
|
||||
{
|
||||
m_isEmbedded = false;
|
||||
}
|
||||
@ -341,74 +341,74 @@ namespace DocFileFormat
|
||||
{//встроенная неведомая хуйня
|
||||
ODRAW::MetroBlob* blob = dynamic_cast<ODRAW::MetroBlob*>(iter.get());
|
||||
if (blob)
|
||||
{
|
||||
m_isBlob = true;
|
||||
m_isEmbedded = true;
|
||||
{
|
||||
m_isBlob = true;
|
||||
m_isEmbedded = true;
|
||||
//if (ParseEmbeddedBlob( blob->data.first, blob->data.second)) // todoooo
|
||||
//{
|
||||
// m_isEmbedded = false;
|
||||
//}
|
||||
}
|
||||
}break;
|
||||
//BORDERS
|
||||
//BORDERS
|
||||
case ODRAW::borderBottomColor:
|
||||
if (!pict->brcBottom)
|
||||
{
|
||||
RGBColor bottomColor( (int)iter->op, RedFirst );
|
||||
m_pXmlWriter->WriteAttribute( L"o:borderbottomcolor", L"#" + bottomColor.SixDigitHexCode);
|
||||
RGBColor bottomColor((int)iter->op, RedFirst);
|
||||
m_pXmlWriter->WriteAttribute(L"o:borderbottomcolor", L"#" + bottomColor.SixDigitHexCode);
|
||||
}
|
||||
break;
|
||||
case ODRAW::borderLeftColor:
|
||||
if (!pict->brcLeft)
|
||||
{
|
||||
RGBColor leftColor( (int)iter->op, RedFirst );
|
||||
m_pXmlWriter->WriteAttribute( L"o:borderleftcolor", L"#" + leftColor.SixDigitHexCode);
|
||||
}
|
||||
{
|
||||
RGBColor leftColor((int)iter->op, RedFirst);
|
||||
m_pXmlWriter->WriteAttribute(L"o:borderleftcolor", L"#" + leftColor.SixDigitHexCode);
|
||||
}
|
||||
break;
|
||||
case ODRAW::borderRightColor:
|
||||
if (!pict->brcRight)
|
||||
{
|
||||
RGBColor rightColor( (int)iter->op, RedFirst );
|
||||
m_pXmlWriter->WriteAttribute( L"o:borderrightcolor", L"#" + rightColor.SixDigitHexCode);
|
||||
{
|
||||
RGBColor rightColor((int)iter->op, RedFirst);
|
||||
m_pXmlWriter->WriteAttribute(L"o:borderrightcolor", L"#" + rightColor.SixDigitHexCode);
|
||||
}
|
||||
break;
|
||||
case ODRAW::borderTopColor:
|
||||
if (!pict->brcTop)
|
||||
{
|
||||
RGBColor topColor( (int)iter->op, RedFirst );
|
||||
m_pXmlWriter->WriteAttribute( L"o:bordertopcolor", L"#" + topColor.SixDigitHexCode);
|
||||
RGBColor topColor((int)iter->op, RedFirst);
|
||||
m_pXmlWriter->WriteAttribute(L"o:bordertopcolor", L"#" + topColor.SixDigitHexCode);
|
||||
}
|
||||
break;
|
||||
//CROPPING
|
||||
//CROPPING
|
||||
case ODRAW::cropFromBottom:
|
||||
{
|
||||
{
|
||||
//cast to signed integer
|
||||
int cropBottom = (int)iter->op;
|
||||
appendValueAttribute(m_imageData, L"cropbottom", FormatUtils::IntToWideString( cropBottom ) + L"f" );
|
||||
appendValueAttribute(m_imageData, L"cropbottom", FormatUtils::IntToWideString(cropBottom) + L"f");
|
||||
}
|
||||
break;
|
||||
case ODRAW::cropFromLeft:
|
||||
{
|
||||
{
|
||||
//cast to signed integer
|
||||
int cropLeft = (int)iter->op;
|
||||
appendValueAttribute(m_imageData, L"cropleft", FormatUtils::IntToWideString( cropLeft ) + L"f" );
|
||||
appendValueAttribute(m_imageData, L"cropleft", FormatUtils::IntToWideString(cropLeft) + L"f");
|
||||
}
|
||||
break;
|
||||
case ODRAW::cropFromRight:
|
||||
{
|
||||
//cast to signed integer
|
||||
int cropRight = (int)iter->op;
|
||||
appendValueAttribute(m_imageData, L"cropright", FormatUtils::IntToWideString( cropRight ) + L"f" );
|
||||
appendValueAttribute(m_imageData, L"cropright", FormatUtils::IntToWideString(cropRight) + L"f");
|
||||
}
|
||||
break;
|
||||
case ODRAW::cropFromTop:
|
||||
{
|
||||
//cast to signed integer
|
||||
int cropTop = (int)iter->op;
|
||||
appendValueAttribute(m_imageData, L"croptop", FormatUtils::IntToWideString( cropTop ) + L"f" );
|
||||
appendValueAttribute(m_imageData, L"croptop", FormatUtils::IntToWideString(cropTop) + L"f");
|
||||
}
|
||||
break;
|
||||
//------------------------------------------------------------
|
||||
//------------------------------------------------------------
|
||||
case ODRAW::ePropertyId_rotation:
|
||||
{
|
||||
double dAngle = (double)((int)iter->op) / 65535.0;
|
||||
@ -436,8 +436,8 @@ namespace DocFileFormat
|
||||
}break;
|
||||
case ODRAW::posrelv:
|
||||
{
|
||||
if (false == m_inGroup)
|
||||
appendStyleProperty(strStyle, L"mso-position-vertical-relative", VMLShapeMapping::mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
|
||||
if (false == m_inGroup)
|
||||
appendStyleProperty(strStyle, L"mso-position-vertical-relative", VMLShapeMapping::mapVerticalPositionRelative((PositionVerticalRelative)iter->op));
|
||||
}break;
|
||||
case ODRAW::groupShapeBooleanProperties:
|
||||
{
|
||||
@ -446,7 +446,7 @@ namespace DocFileFormat
|
||||
if (booleans->fUsefBehindDocument && booleans->fBehindDocument)
|
||||
{
|
||||
//The shape is behind the text, so the z-index must be negative.
|
||||
appendStyleProperty(strStyle, L"z-index", L"-1" );
|
||||
appendStyleProperty(strStyle, L"z-index", L"-1");
|
||||
}
|
||||
//else if (!m_isInlinePicture)
|
||||
//{
|
||||
@ -458,8 +458,20 @@ namespace DocFileFormat
|
||||
appendStyleProperty(strStyle, L"visibility", L"hidden");
|
||||
}
|
||||
}break;
|
||||
case ODRAW::blipBooleanProperties:
|
||||
{
|
||||
ODRAW::BlipBooleanProperties * bools = (ODRAW::BlipBooleanProperties *)(iter.get());
|
||||
if (bools)
|
||||
{
|
||||
if (bools->fUsefPictureGray && bools->fPictureGray)
|
||||
appendValueAttribute(m_imageData, L"grayscale", L"t");
|
||||
if (bools->fUsefPictureBiLevel && bools->fPictureBiLevel)
|
||||
appendValueAttribute(m_imageData, L"bilevel", L"t");
|
||||
}
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
{
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@
|
||||
#include "../../DesktopEditor/common/StringExt.h"
|
||||
|
||||
#include "../Common/FormatUtils.h"
|
||||
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Logic/Biff_structures/ODRAW/OfficeArtFOPTE.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
@ -152,8 +153,8 @@ namespace DocFileFormat
|
||||
bool twistDimensions = false;
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"style", FormatUtils::XmlEncode(buildStyle(shape, anchor, options, container->Index, twistDimensions)));
|
||||
m_pXmlWriter->WriteAttribute( L"coordorigin", ( FormatUtils::IntToWideString(gsr->rcgBounds.topLeftAngle.x) + L"," + FormatUtils::IntToWideString( gsr->rcgBounds.topLeftAngle.y)));
|
||||
m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString(gsr->rcgBounds.size.cx) + L"," + FormatUtils::IntToWideString(gsr->rcgBounds.size.cy)));
|
||||
m_pXmlWriter->WriteAttribute( L"coordorigin", ( std::to_wstring(gsr->rcgBounds.topLeftAngle.x) + L"," + std::to_wstring( gsr->rcgBounds.topLeftAngle.y)));
|
||||
m_pXmlWriter->WriteAttribute( L"coordsize", ( std::to_wstring(gsr->rcgBounds.size.cx) + L"," + std::to_wstring(gsr->rcgBounds.size.cy)));
|
||||
|
||||
// Write wrap coords
|
||||
for (size_t i = 0; i < options.size(); i++)
|
||||
@ -251,7 +252,7 @@ namespace DocFileFormat
|
||||
if (m_shapeId.empty())
|
||||
{
|
||||
m_context->_doc->GetOfficeArt()->m_uLastShapeId++;
|
||||
m_shapeId = std::wstring(L"_x0000_s") + FormatUtils::IntToWideString(m_context->_doc->GetOfficeArt()->m_uLastShapeId);
|
||||
m_shapeId = std::wstring(L"_x0000_s") + std::to_wstring(m_context->_doc->GetOfficeArt()->m_uLastShapeId);
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteAttribute ( L"id", m_shapeId );
|
||||
@ -291,8 +292,8 @@ namespace DocFileFormat
|
||||
boost::optional<double> viewPointOriginY;
|
||||
boost::optional<double> ShadowOriginX;
|
||||
boost::optional<double> ShadowOriginY;
|
||||
boost::optional<unsigned int> xCoord;
|
||||
boost::optional<unsigned int> yCoord;
|
||||
boost::optional<size_t> xCoord;
|
||||
boost::optional<size_t> yCoord;
|
||||
|
||||
bool bStroked = true;
|
||||
bool bFilled = true;
|
||||
@ -312,6 +313,8 @@ namespace DocFileFormat
|
||||
int nAdjValues = 0;
|
||||
int nLTxID = -1;
|
||||
|
||||
int nProperty = 0;
|
||||
|
||||
std::wstring sTextboxStyle;
|
||||
|
||||
ODRAW::OfficeArtFOPTEPtr opSegmentInfo;
|
||||
@ -564,7 +567,7 @@ namespace DocFileFormat
|
||||
}break;
|
||||
case ODRAW::fillFocus:
|
||||
{
|
||||
appendValueAttribute(&m_fill, L"focus", (FormatUtils::IntToWideString(iter->op) + L"%"));
|
||||
appendValueAttribute(&m_fill, L"focus", (std::to_wstring(iter->op) + L"%"));
|
||||
appendValueAttribute(&m_fill, L"focusposition", L".5, .5");
|
||||
appendValueAttribute(&m_fill, L"focussize", L"");
|
||||
}break;
|
||||
@ -588,7 +591,7 @@ namespace DocFileFormat
|
||||
|
||||
if ((pFillBlip != NULL) && copyPicture(pFillBlip))
|
||||
{
|
||||
appendValueAttribute(&m_fill, L"r:id", std::wstring((L"rId") + FormatUtils::IntToWideString(m_nImageId)));
|
||||
appendValueAttribute(&m_fill, L"r:id", std::wstring((L"rId") + std::to_wstring(m_nImageId)));
|
||||
}
|
||||
|
||||
bPicturePresent = true;
|
||||
@ -679,7 +682,7 @@ namespace DocFileFormat
|
||||
BlipStoreEntry* oBlip = static_cast<BlipStoreEntry*>(m_pBlipStore->Children[index]);
|
||||
if (copyPicture(oBlip))
|
||||
{
|
||||
appendValueAttribute(&m_imagedata, L"r:id", (std::wstring(L"rId") + FormatUtils::IntToWideString(m_nImageId)));
|
||||
appendValueAttribute(&m_imagedata, L"r:id", (std::wstring(L"rId") + std::to_wstring(m_nImageId)));
|
||||
}
|
||||
}
|
||||
bPicturePresent = true;
|
||||
@ -698,43 +701,43 @@ namespace DocFileFormat
|
||||
}break;
|
||||
case ODRAW::pictureContrast:
|
||||
{
|
||||
appendValueAttribute(&m_imagedata, L"gain", (FormatUtils::IntToWideString(iter->op) + L"f"));
|
||||
appendValueAttribute(&m_imagedata, L"gain", (std::to_wstring(iter->op) + L"f"));
|
||||
}break;
|
||||
case ODRAW::pictureBrightness:
|
||||
{
|
||||
appendValueAttribute(&m_imagedata, L"blacklevel", (FormatUtils::IntToWideString(iter->op) + L"f"));
|
||||
appendValueAttribute(&m_imagedata, L"blacklevel", (std::to_wstring(iter->op) + L"f"));
|
||||
}break;
|
||||
case ODRAW::pictureGamma:
|
||||
{
|
||||
appendValueAttribute(&m_imagedata, L"gamma", (FormatUtils::IntToWideString(iter->op) + L"f"));
|
||||
appendValueAttribute(&m_imagedata, L"gamma", (std::to_wstring(iter->op) + L"f"));
|
||||
}break;
|
||||
//CROPPING
|
||||
case ODRAW::cropFromBottom:
|
||||
{
|
||||
//cast to signed integer
|
||||
int cropBottom = (int)iter->op;
|
||||
appendValueAttribute(&m_imagedata, L"cropbottom", FormatUtils::IntToWideString(cropBottom) + L"f");
|
||||
appendValueAttribute(&m_imagedata, L"cropbottom", std::to_wstring(cropBottom) + L"f");
|
||||
}
|
||||
break;
|
||||
case ODRAW::cropFromLeft:
|
||||
{
|
||||
//cast to signed integer
|
||||
int cropLeft = (int)iter->op;
|
||||
appendValueAttribute(&m_imagedata, L"cropleft", FormatUtils::IntToWideString(cropLeft) + L"f");
|
||||
appendValueAttribute(&m_imagedata, L"cropleft", std::to_wstring(cropLeft) + L"f");
|
||||
}
|
||||
break;
|
||||
case ODRAW::cropFromRight:
|
||||
{
|
||||
//cast to signed integer
|
||||
int cropRight = (int)iter->op;
|
||||
appendValueAttribute(&m_imagedata, L"cropright", FormatUtils::IntToWideString(cropRight) + L"f");
|
||||
appendValueAttribute(&m_imagedata, L"cropright", std::to_wstring(cropRight) + L"f");
|
||||
}
|
||||
break;
|
||||
case ODRAW::cropFromTop:
|
||||
{
|
||||
//cast to signed integer
|
||||
int cropTop = (int)iter->op;
|
||||
appendValueAttribute(&m_imagedata, L"croptop", FormatUtils::IntToWideString(cropTop) + L"f");
|
||||
appendValueAttribute(&m_imagedata, L"croptop", std::to_wstring(cropTop) + L"f");
|
||||
}
|
||||
break;
|
||||
// 3D STYLE
|
||||
@ -760,22 +763,22 @@ namespace DocFileFormat
|
||||
}break;
|
||||
case ODRAW::c3DAmbientIntensity:
|
||||
{
|
||||
std::wstring intens = FormatUtils::IntToWideString((int)iter->op) + L"f";
|
||||
std::wstring intens = std::to_wstring((int)iter->op) + L"f";
|
||||
appendValueAttribute(&m_3dstyle, L"brightness", intens);
|
||||
}break;
|
||||
case ODRAW::c3DSpecularAmt:
|
||||
{
|
||||
std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f";
|
||||
std::wstring amt = std::to_wstring((int)iter->op) + L"f";
|
||||
appendValueAttribute(&m_3dstyle, L"specularity", amt);
|
||||
}break;
|
||||
case ODRAW::c3DDiffuseAmt:
|
||||
{
|
||||
std::wstring amt = FormatUtils::IntToWideString((int)iter->op) + L"f";
|
||||
std::wstring amt = std::to_wstring((int)iter->op) + L"f";
|
||||
appendValueAttribute(&m_3dstyle, L"diffusity", amt);
|
||||
}break;
|
||||
case ODRAW::c3DKeyIntensity:
|
||||
{
|
||||
std::wstring amt = FormatUtils::IntToWideString((int)iter->op);
|
||||
std::wstring amt = std::to_wstring((int)iter->op);
|
||||
appendValueAttribute(&m_3dstyle, L"lightlevel", amt);
|
||||
}break;
|
||||
case ODRAW::c3DExtrusionColor:
|
||||
@ -841,6 +844,10 @@ namespace DocFileFormat
|
||||
break;
|
||||
}
|
||||
}break;
|
||||
case ODRAW::hspNext:
|
||||
{
|
||||
appendStyleProperty(sTextboxStyle, L"mso-next-textbox", std::wstring(L"_x0000_s") + std::to_wstring((unsigned int)iter->op));
|
||||
}break;
|
||||
case ODRAW::textBooleanProperties:
|
||||
{
|
||||
ODRAW::TextBooleanProperties *props = dynamic_cast<ODRAW::TextBooleanProperties*>(iter.get());
|
||||
@ -850,7 +857,6 @@ namespace DocFileFormat
|
||||
appendStyleProperty(sTextboxStyle, L"mso-fit-shape-to-text", L"t");
|
||||
}
|
||||
}break;
|
||||
|
||||
// Word Art
|
||||
case ODRAW::gtextUNICODE:
|
||||
{
|
||||
@ -870,18 +876,22 @@ namespace DocFileFormat
|
||||
}break;
|
||||
case ODRAW::gtextSize:
|
||||
{
|
||||
std::wstring fontSize = FormatUtils::IntToWideString(iter->op/65535);
|
||||
std::wstring fontSize = std::to_wstring(iter->op/65535);
|
||||
appendStyleProperty(m_textPathStyle, L"font-size", fontSize + L"pt");
|
||||
}break;
|
||||
case ODRAW::gtextSpacing:
|
||||
{
|
||||
std::wstring spacing = FormatUtils::IntToWideString(iter->op);
|
||||
std::wstring spacing = std::to_wstring(iter->op);
|
||||
appendStyleProperty(m_textPathStyle, L"v-text-spacing", spacing + L"f");
|
||||
}break;
|
||||
case ODRAW::geometryTextBooleanProperties:
|
||||
{
|
||||
ODRAW::GeometryTextBooleanProperties *props = dynamic_cast<ODRAW::GeometryTextBooleanProperties*>(iter.get());
|
||||
if (props->fUsegFBestFit && props->fBestFit)
|
||||
if (props->fUsegFShrinkFit && props->fShrinkFit && (props->fStretch || props->fUsegFStretch))
|
||||
{
|
||||
appendValueAttribute(&m_textpath, L"fitshape", L"t");
|
||||
}
|
||||
if (props->fUsegFBestFit && props->fBestFit && (!props->fStretch || !props->fUsegFStretch))
|
||||
{
|
||||
appendValueAttribute(&m_textpath, L"fitshape", L"t");
|
||||
}
|
||||
@ -909,7 +919,7 @@ namespace DocFileFormat
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
int val = iter->op;
|
||||
nProperty = iter->op;
|
||||
}break;
|
||||
}
|
||||
}
|
||||
@ -918,7 +928,7 @@ namespace DocFileFormat
|
||||
ODRAW::PSegmentInfo* pSI = dynamic_cast<ODRAW::PSegmentInfo*>(opSegmentInfo.get());
|
||||
if (pVP && pSI)
|
||||
{
|
||||
ODRAW::PathParser oParser (pSI->complex.data, pVP->complex.data, m_arrGuides);
|
||||
ODRAW::PathParser oParser (pSI->complex.data, pVP->complex.data, m_arrGuides, xCoord, yCoord);
|
||||
std::wstring path = oParser.GetVmlPath();
|
||||
|
||||
if (false == path.empty())
|
||||
@ -946,13 +956,13 @@ namespace DocFileFormat
|
||||
|
||||
if ( xCoord && yCoord )
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString( *xCoord ) + L"," + FormatUtils::IntToWideString( *yCoord ) ));
|
||||
m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::SizeTToWideString( *xCoord ) + L"," + FormatUtils::SizeTToWideString( *yCoord ) ));
|
||||
}
|
||||
|
||||
int nCode = 0;
|
||||
if (pShape->GetShapeType())
|
||||
{
|
||||
nCode = pShape->GetShapeType()->GetTypeCode();
|
||||
nCode = pShape->GetShapeType()->GetTypeCode();
|
||||
}
|
||||
|
||||
if (DocFileFormat::msosptRoundRectangle == nCode)
|
||||
@ -1036,17 +1046,17 @@ namespace DocFileFormat
|
||||
|
||||
if ( ViewPointX )
|
||||
{
|
||||
viewPoint += FormatUtils::IntToWideString( *ViewPointX ) + L"pt";
|
||||
viewPoint += std::to_wstring( *ViewPointX ) + L"pt";
|
||||
}
|
||||
viewPoint += L",";
|
||||
if ( ViewPointY)
|
||||
{
|
||||
viewPoint += FormatUtils::IntToWideString( *ViewPointY ) + L"pt";
|
||||
viewPoint += std::to_wstring( *ViewPointY ) + L"pt";
|
||||
}
|
||||
viewPoint += L",";
|
||||
if ( ViewPointZ)
|
||||
{
|
||||
viewPoint += FormatUtils::IntToWideString( *ViewPointZ ) + L"pt";
|
||||
viewPoint += std::to_wstring( *ViewPointZ ) + L"pt";
|
||||
}
|
||||
|
||||
appendValueAttribute(&m_3dstyle, L"viewpoint", viewPoint);
|
||||
@ -1158,8 +1168,8 @@ namespace DocFileFormat
|
||||
//Word appends a OfficeArtClientTextbox record to the container.
|
||||
//This record stores the index of the textbox.
|
||||
|
||||
int nIndex = pTextBox->GetIndex();
|
||||
if (nIndex)
|
||||
int nIndex = pTextBox->m_nIndex;
|
||||
if (nIndex > 0)
|
||||
{
|
||||
TextboxMapping textboxMapping(m_context, nIndex - 1, m_pXmlWriter, m_pCaller);
|
||||
textboxMapping.SetInset(ndxTextLeft, ndyTextTop, ndxTextRight, ndyTextBottom);
|
||||
@ -1170,12 +1180,6 @@ namespace DocFileFormat
|
||||
}
|
||||
else if( hasTextbox )
|
||||
{
|
||||
//Open Office textbox
|
||||
|
||||
//Open Office doesn't append a OfficeArtClientTextbox record to the container.
|
||||
//We don't know how Word gets the relation to the text, but we assume that the first textbox in the document
|
||||
//get the index 0, the second textbox gets the index 1 (and so on).
|
||||
|
||||
if (-1 != nLTxID)
|
||||
{
|
||||
TextboxMapping textboxMapping(m_context, nLTxID - 1, m_pXmlWriter, m_pCaller);
|
||||
@ -1290,7 +1294,7 @@ namespace DocFileFormat
|
||||
if (NULL != pShape)
|
||||
{
|
||||
strXmlAttr += std::wstring(L"_x0000_s");
|
||||
strXmlAttr += FormatUtils::IntToWideString(pShape->GetShapeID());
|
||||
strXmlAttr += std::to_wstring(pShape->GetShapeID());
|
||||
}
|
||||
|
||||
return strXmlAttr;
|
||||
@ -1317,9 +1321,9 @@ namespace DocFileFormat
|
||||
top = (bottom + pAnchor->rcgBounds.topLeftAngle.y) * 0.5 - (right - pAnchor->rcgBounds.topLeftAngle.x) * 0.5;
|
||||
}
|
||||
|
||||
strXmlFrom += FormatUtils::IntToWideString(left);
|
||||
strXmlFrom += std::to_wstring(left);
|
||||
strXmlFrom += L",";
|
||||
strXmlFrom += FormatUtils::IntToWideString(top);
|
||||
strXmlFrom += std::to_wstring(top);
|
||||
}
|
||||
else if (m_pSpa)
|
||||
{
|
||||
@ -1360,9 +1364,9 @@ namespace DocFileFormat
|
||||
right = left + pAnchor->rcgBounds.size.cy;
|
||||
bottom = top + pAnchor->rcgBounds.size.cx;
|
||||
}
|
||||
strXmlTo += FormatUtils::IntToWideString(right);
|
||||
strXmlTo += std::to_wstring(right);
|
||||
strXmlTo += L",";
|
||||
strXmlTo += FormatUtils::IntToWideString(bottom);
|
||||
strXmlTo += std::to_wstring(bottom);
|
||||
}
|
||||
else if (m_pSpa)
|
||||
{
|
||||
@ -1396,7 +1400,7 @@ namespace DocFileFormat
|
||||
|
||||
for (size_t i = 0; i < pWrapPolygonVertices->complex.data.size(); ++i)
|
||||
{
|
||||
coords += FormatUtils::IntToWideString(pWrapPolygonVertices->complex.data[i].x);
|
||||
coords += std::to_wstring(pWrapPolygonVertices->complex.data[i].x);
|
||||
coords += L",";
|
||||
coords += FormatUtils::IntToWideString(pWrapPolygonVertices->complex.data[i].y);
|
||||
coords += L",";
|
||||
@ -1598,19 +1602,19 @@ namespace DocFileFormat
|
||||
bounds.topLeftAngle.y = static_cast<LONG>(((anchor->Bottom + anchor->Top) * 0.5 - (anchor->Right - anchor->Left) * 0.5));
|
||||
}
|
||||
|
||||
appendStylePropertyFirst(style, L"top", FormatUtils::IntToWideString(bounds.topLeftAngle.y));
|
||||
appendStylePropertyFirst(style, L"left", FormatUtils::IntToWideString(bounds.topLeftAngle.x));
|
||||
appendStylePropertyFirst(style, L"top", std::to_wstring(bounds.topLeftAngle.y));
|
||||
appendStylePropertyFirst(style, L"left", std::to_wstring(bounds.topLeftAngle.x));
|
||||
appendStylePropertyFirst(style, L"position", L"absolute");
|
||||
|
||||
if (twistDimensions)
|
||||
{
|
||||
appendStylePropertyFirst(style, L"width", FormatUtils::IntToWideString(bounds.size.cy));
|
||||
appendStylePropertyFirst(style, L"height", FormatUtils::IntToWideString(bounds.size.cx));
|
||||
appendStylePropertyFirst(style, L"width", std::to_wstring(bounds.size.cy));
|
||||
appendStylePropertyFirst(style, L"height", std::to_wstring(bounds.size.cx));
|
||||
}
|
||||
else
|
||||
{
|
||||
appendStylePropertyFirst(style, L"width", FormatUtils::IntToWideString(bounds.size.cx));
|
||||
appendStylePropertyFirst(style, L"height", FormatUtils::IntToWideString(bounds.size.cy));
|
||||
appendStylePropertyFirst(style, L"width", std::to_wstring(bounds.size.cx));
|
||||
appendStylePropertyFirst(style, L"height", std::to_wstring(bounds.size.cy));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1713,7 +1717,7 @@ namespace DocFileFormat
|
||||
switch (val)
|
||||
{
|
||||
case 0: return L"square";
|
||||
//case 1: return L"ByPoints";
|
||||
case 1: return L"tight";
|
||||
case 2: return L"none";
|
||||
//case 3: return L"TopBottom";
|
||||
//case 3: return L"Through";
|
||||
@ -2039,9 +2043,9 @@ namespace DocFileFormat
|
||||
for (size_t i = 0; i < pColors->complex.data.size(); ++i)
|
||||
{
|
||||
if (pColors->complex.data[i].position.Fractional == 0)
|
||||
result += FormatUtils::IntToWideString(pColors->complex.data[i].position.Integral);
|
||||
result += std::to_wstring(pColors->complex.data[i].position.Integral);
|
||||
else
|
||||
result += FormatUtils::IntToWideString(pColors->complex.data[i].position.Fractional) +L"f";
|
||||
result += std::to_wstring(pColors->complex.data[i].position.Fractional) +L"f";
|
||||
|
||||
result += L" #";
|
||||
result += pColors->complex.data[i].color.sColorRGB;
|
||||
@ -2296,7 +2300,7 @@ namespace DocFileFormat
|
||||
|
||||
m_context->_doc->GetOfficeArt()->m_uLastShapeId++;
|
||||
|
||||
std::wstring strId = std::wstring(L"_x0000_s") + FormatUtils::IntToWideString(m_context->_doc->GetOfficeArt()->m_uLastShapeId);
|
||||
std::wstring strId = std::wstring(L"_x0000_s") + std::to_wstring(m_context->_doc->GetOfficeArt()->m_uLastShapeId);
|
||||
|
||||
//m_pXmlWriter->WriteAttribute ( L"id") , strId);
|
||||
m_pXmlWriter->WriteAttribute ( L"o:spid", strId);
|
||||
@ -2311,8 +2315,8 @@ namespace DocFileFormat
|
||||
TwipsValue x2( line->xaEnd );
|
||||
TwipsValue y2( line->yaEnd );
|
||||
|
||||
std::wstring strStart = FormatUtils::IntToWideString(line->xaStart + primitive->xa) + L"," + FormatUtils::IntToWideString(line->yaStart + primitive->ya);
|
||||
std::wstring strEnd = FormatUtils::IntToWideString(line->xaEnd + primitive->xa) + L"," + FormatUtils::IntToWideString(line->yaEnd + primitive->ya);
|
||||
std::wstring strStart = std::to_wstring(line->xaStart + primitive->xa) + L"," + std::to_wstring(line->yaStart + primitive->ya);
|
||||
std::wstring strEnd = std::to_wstring(line->xaEnd + primitive->xa) + L"," + std::to_wstring(line->yaEnd + primitive->ya);
|
||||
|
||||
m_pXmlWriter->WriteAttribute(L"from", strStart);
|
||||
m_pXmlWriter->WriteAttribute(L"to", strEnd);
|
||||
@ -2321,13 +2325,13 @@ namespace DocFileFormat
|
||||
{
|
||||
if (root)
|
||||
{
|
||||
//strStyle += L"left:" + FormatUtils::IntToWideString( x.ToPoints()) + L"pt;";
|
||||
//strStyle += L"top:" + FormatUtils::IntToWideString( y.ToPoints()) + L"pt;";
|
||||
strStyle += L"width:" + FormatUtils::IntToWideString( (int)w.ToPoints()) + L"pt;";
|
||||
strStyle += L"height:" + FormatUtils::IntToWideString( (int)h.ToPoints()) + L"pt;";
|
||||
//strStyle += L"left:" + std::to_wstring( x.ToPoints()) + L"pt;";
|
||||
//strStyle += L"top:" + std::to_wstring( y.ToPoints()) + L"pt;";
|
||||
strStyle += L"width:" + std::to_wstring( (int)w.ToPoints()) + L"pt;";
|
||||
strStyle += L"height:" + std::to_wstring( (int)h.ToPoints()) + L"pt;";
|
||||
|
||||
strStyle += L"margin-left:" + FormatUtils::IntToWideString( (int)x.ToPoints()) + L"pt;";
|
||||
strStyle += L"margin-top:" + FormatUtils::IntToWideString( (int)y.ToPoints()) + L"pt;";
|
||||
strStyle += L"margin-left:" + std::to_wstring( (int)x.ToPoints()) + L"pt;";
|
||||
strStyle += L"margin-top:" + std::to_wstring( (int)y.ToPoints()) + L"pt;";
|
||||
|
||||
if (false == m_inGroup)
|
||||
{
|
||||
@ -2343,18 +2347,18 @@ namespace DocFileFormat
|
||||
if (!yMargin.empty()) strStyle += L"mso-position-vertical-relative:" + yMargin;
|
||||
}
|
||||
|
||||
std::wstring strSize = FormatUtils::IntToWideString(primitive->dxa) + L"," + FormatUtils::IntToWideString(primitive->dya);
|
||||
std::wstring strOrigin = FormatUtils::IntToWideString(primitive->xa) + L"," + FormatUtils::IntToWideString(primitive->ya);
|
||||
std::wstring strSize = std::to_wstring(primitive->dxa) + L"," + std::to_wstring(primitive->dya);
|
||||
std::wstring strOrigin = std::to_wstring(primitive->xa) + L"," + std::to_wstring(primitive->ya);
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"coordsize", strSize);
|
||||
//m_pXmlWriter->WriteAttribute( L"coordorigin"), strOrigin);
|
||||
}
|
||||
else
|
||||
{
|
||||
strStyle += L"left:" + FormatUtils::IntToWideString( primitive->xa) + L";";
|
||||
strStyle += L"top:" + FormatUtils::IntToWideString( primitive->ya) + L";";
|
||||
strStyle += L"width:" + FormatUtils::IntToWideString( primitive->dxa) + L";";
|
||||
strStyle += L"height:" + FormatUtils::IntToWideString( primitive->dya) + L";";
|
||||
strStyle += L"left:" + std::to_wstring( primitive->xa) + L";";
|
||||
strStyle += L"top:" + std::to_wstring( primitive->ya) + L";";
|
||||
strStyle += L"width:" + std::to_wstring( primitive->dxa) + L";";
|
||||
strStyle += L"height:" + std::to_wstring( primitive->dya) + L";";
|
||||
}
|
||||
}
|
||||
if (primitive->fillPattern == 0)
|
||||
@ -2366,7 +2370,7 @@ namespace DocFileFormat
|
||||
}
|
||||
m_pXmlWriter->WriteAttribute( L"style", strStyle);
|
||||
|
||||
std::wstring strStrokeWeight = FormatUtils::IntToWideString(primitive->lineWeight / 20) + L"pt";
|
||||
std::wstring strStrokeWeight = std::to_wstring(primitive->lineWeight / 20) + L"pt";
|
||||
if (primitive->lineWeight > 20)
|
||||
m_pXmlWriter->WriteAttribute( L"strokeweight", strStrokeWeight);
|
||||
|
||||
@ -2387,7 +2391,7 @@ namespace DocFileFormat
|
||||
if (primitive->lineStyle > 1)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin(L"v:stroke", true );
|
||||
std::wstring strDashStyle = FormatUtils::IntToWideString(primitive->lineStyle) + L" 1";
|
||||
std::wstring strDashStyle = std::to_wstring(primitive->lineStyle) + L" 1";
|
||||
m_pXmlWriter->WriteAttribute( L"dashstyle", strDashStyle);
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true, false );
|
||||
m_pXmlWriter->WriteNodeEnd( L"v:stroke" );
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
#include "../../Common/OfficeFileErrorDescription.h"
|
||||
#include "../../Common/MS-LCID.h"
|
||||
|
||||
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/SummaryInformation.h"
|
||||
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Logic/SummaryInformationStream/PropertySetStream.h"
|
||||
#include "../../ASCOfficeXlsFile2/source/XlsFormat/Binary/CFStream.h"
|
||||
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
@ -240,17 +240,20 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
POLE::Stream * Summary = NULL;
|
||||
POLE::Stream * DocSummary = NULL;
|
||||
POLE::Stream * Summary = NULL;
|
||||
POLE::Stream * DocSummary = NULL;
|
||||
|
||||
m_pStorage->GetStream (L"SummaryInformation", &Summary);
|
||||
m_pStorage->GetStream (L"DocumentSummaryInformation", &DocSummary);
|
||||
|
||||
OLEPS::PropertySetStream summary_info;
|
||||
|
||||
if ((Summary) && (Summary->size() > 0))
|
||||
{
|
||||
XLS::CFStreamPtr stream = XLS::CFStreamPtr(new XLS::CFStream(Summary));
|
||||
OLEPS::SummaryInformation summary_info(stream);
|
||||
int document_code_page1 = summary_info.GetCodePage(); //from software last open
|
||||
XLS::CFStreamPtr stream = XLS::CFStreamPtr(new XLS::CFStream(Summary));
|
||||
summary_info.read(stream);
|
||||
|
||||
int document_code_page1 = summary_info.GetCodePage();
|
||||
|
||||
if (document_code_page1 > 0)
|
||||
{
|
||||
@ -261,8 +264,9 @@ namespace DocFileFormat
|
||||
if ((DocSummary) && (DocSummary->size() > 0))
|
||||
{
|
||||
XLS::CFStreamPtr stream = XLS::CFStreamPtr(new XLS::CFStream(DocSummary));
|
||||
OLEPS::SummaryInformation doc_summary_info(stream);
|
||||
int document_code_page2 = doc_summary_info.GetCodePage();
|
||||
summary_info.read(stream, true);
|
||||
|
||||
int document_code_page2 = summary_info.GetCodePage();
|
||||
|
||||
if (document_code_page2 > 0)
|
||||
{
|
||||
@ -288,6 +292,8 @@ namespace DocFileFormat
|
||||
nDocumentCodePage = user_codepage;
|
||||
}
|
||||
}
|
||||
m_sXmlApp = summary_info.GetApp();
|
||||
m_sXmlCore = summary_info.GetCore();
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
try
|
||||
{
|
||||
|
||||
@ -88,7 +88,7 @@ namespace DocFileFormat
|
||||
friend class OpenXmlPackage;
|
||||
friend class TextboxMapping;
|
||||
friend class SettingsMapping;
|
||||
|
||||
friend class WordprocessingDocument;
|
||||
public:
|
||||
|
||||
WordDocument (const std::wstring & tempFolder, const int userLCID);
|
||||
@ -153,6 +153,8 @@ namespace DocFileFormat
|
||||
std::wstring m_sTempFolder;
|
||||
std::wstring m_sTempDecryptFileName;
|
||||
int m_nUserLCID;
|
||||
std::wstring m_sXmlApp;
|
||||
std::wstring m_sXmlCore;
|
||||
|
||||
POLE::Stream * WordDocumentStream; // The stream "WordDocument"
|
||||
POLE::Stream * TableStream; // The stream "0Table" or "1Table"
|
||||
|
||||
@ -72,7 +72,6 @@ namespace DocFileFormat
|
||||
|
||||
RegisterDocumentMacros();
|
||||
RegisterVbaProject();
|
||||
//output_document->get_xl_files().add_vba_project();
|
||||
}
|
||||
else bMacros = false;
|
||||
}
|
||||
@ -84,54 +83,68 @@ namespace DocFileFormat
|
||||
RegisterDocument();
|
||||
}
|
||||
OOX::CContentTypes oContentTypes;
|
||||
OOX::CPath pathDocProps = m_strOutputPath + FILE_SEPARATOR_STR + _T("docProps");
|
||||
OOX::CPath pathDocProps = m_strOutputPath + FILE_SEPARATOR_STR + L"docProps";
|
||||
NSDirectory::CreateDirectory(pathDocProps.GetPath());
|
||||
|
||||
OOX::CPath DocProps = std::wstring(_T("docProps"));
|
||||
OOX::CPath DocProps = std::wstring(L"docProps");
|
||||
|
||||
OOX::CApp* pApp = new OOX::CApp(NULL);
|
||||
if (pApp)
|
||||
if (docFile->m_sXmlApp.empty())
|
||||
{
|
||||
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
|
||||
if (sApplication.empty())
|
||||
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
|
||||
pApp->SetApplication(sApplication);
|
||||
#if defined(INTVER)
|
||||
pApp->SetAppVersion(VALUE2STR(INTVER));
|
||||
#endif
|
||||
pApp->SetDocSecurity(0);
|
||||
pApp->SetScaleCrop(false);
|
||||
pApp->SetLinksUpToDate(false);
|
||||
pApp->SetSharedDoc(false);
|
||||
pApp->SetHyperlinksChanged(false);
|
||||
|
||||
pApp->write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, oContentTypes);
|
||||
delete pApp;
|
||||
}
|
||||
OOX::CCore* pCore = new OOX::CCore(NULL);
|
||||
if (pCore)
|
||||
OOX::CApp* pApp = new OOX::CApp(NULL);
|
||||
if (pApp)
|
||||
{
|
||||
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
|
||||
if (sApplication.empty())
|
||||
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
|
||||
pApp->SetApplication(sApplication);
|
||||
#if defined(INTVER)
|
||||
pApp->SetAppVersion(VALUE2STR(INTVER));
|
||||
#endif
|
||||
pApp->SetDocSecurity(0);
|
||||
pApp->SetScaleCrop(false);
|
||||
pApp->SetLinksUpToDate(false);
|
||||
pApp->SetSharedDoc(false);
|
||||
pApp->SetHyperlinksChanged(false);
|
||||
|
||||
pApp->write(pathDocProps + FILE_SEPARATOR_STR + L"app.xml", DocProps, oContentTypes);
|
||||
delete pApp;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pCore->SetCreator(_T(""));
|
||||
pCore->SetLastModifiedBy(_T(""));
|
||||
pCore->write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, oContentTypes);
|
||||
delete pCore;
|
||||
}
|
||||
SaveToFile(pathDocProps.GetPath(), L"app.xml", docFile->m_sXmlApp);
|
||||
}
|
||||
if (docFile->m_sXmlCore.empty())
|
||||
{
|
||||
OOX::CCore* pCore = new OOX::CCore(NULL);
|
||||
if (pCore)
|
||||
{
|
||||
pCore->SetCreator(L"");
|
||||
pCore->SetLastModifiedBy(L"");
|
||||
pCore->write(pathDocProps + FILE_SEPARATOR_STR + L"core.xml", DocProps, oContentTypes);
|
||||
delete pCore;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SaveToFile(pathDocProps.GetPath(), L"core.xml", docFile->m_sXmlCore);
|
||||
}
|
||||
RegisterDocPr();
|
||||
|
||||
WritePackage();
|
||||
|
||||
//Write main content. (word directory)
|
||||
|
||||
SaveToFile(pathWord, std::wstring( L"document.xml" ), DocumentXML );
|
||||
SaveToFile(pathWord, std::wstring( L"fontTable.xml" ), FontTableXML );
|
||||
SaveToFile(pathWord, std::wstring( L"styles.xml" ), StyleSheetXML );
|
||||
SaveToFile(pathWord, std::wstring( L"footnotes.xml" ), FootnotesXML );
|
||||
SaveToFile(pathWord, std::wstring( L"endnotes.xml" ), EndnotesXML );
|
||||
SaveToFile(pathWord, std::wstring( L"numbering.xml" ), NumberingXML );
|
||||
SaveToFile(pathWord, std::wstring( L"comments.xml" ), CommentsXML );
|
||||
SaveToFile(pathWord, std::wstring( L"commentsExtended.xml"),CommentsExtendedXML );
|
||||
SaveToFile(pathWord, std::wstring( L"settings.xml" ), SettingsXML );
|
||||
SaveToFile(pathWord, std::wstring( L"customizations.xml" ), CommandTableXML );
|
||||
SaveToFile(pathWord, L"document.xml", DocumentXML );
|
||||
SaveToFile(pathWord, L"fontTable.xml", FontTableXML );
|
||||
SaveToFile(pathWord, L"styles.xml", StyleSheetXML );
|
||||
SaveToFile(pathWord, L"footnotes.xml", FootnotesXML );
|
||||
SaveToFile(pathWord, L"endnotes.xml", EndnotesXML );
|
||||
SaveToFile(pathWord, L"numbering.xml", NumberingXML );
|
||||
SaveToFile(pathWord, L"comments.xml", CommentsXML );
|
||||
SaveToFile(pathWord, L"commentsExtended.xml", CommentsExtendedXML );
|
||||
SaveToFile(pathWord, L"settings.xml", SettingsXML );
|
||||
SaveToFile(pathWord, L"customizations.xml", CommandTableXML );
|
||||
|
||||
if (!ImagesList.empty())
|
||||
{
|
||||
@ -173,12 +186,12 @@ namespace DocFileFormat
|
||||
|
||||
for (std::list<std::wstring>::iterator iter = HeaderXMLList.begin(); iter != HeaderXMLList.end(); ++iter)
|
||||
{
|
||||
SaveToFile(pathWord, ( std::wstring( L"header" ) + FormatUtils::IntToWideString(++headersCount) + std::wstring( L".xml" ) ), *iter);
|
||||
SaveToFile(pathWord, ( L"header" + FormatUtils::IntToWideString(++headersCount) + L".xml"), *iter);
|
||||
}
|
||||
|
||||
for (std::list<std::wstring>::iterator iter = FooterXMLList.begin(); iter != FooterXMLList.end(); ++iter)
|
||||
{
|
||||
SaveToFile(pathWord, ( std::wstring( L"footer" ) + FormatUtils::IntToWideString(++footersCount) + std::wstring( L".xml" ) ), *iter);
|
||||
SaveToFile(pathWord, ( L"footer" + FormatUtils::IntToWideString(++footersCount) + L".xml" ), *iter);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
31
ASCOfficeDocFile/DocFormatLib/Win32/DocFormatLib.sln
Normal file
31
ASCOfficeDocFile/DocFormatLib/Win32/DocFormatLib.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31624.102
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatLib", "DocFormatLib.vcxproj", "{C5371405-338F-4B70-83BD-2A5CDF64F383}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Debug|x64.Build.0 = Debug|x64
|
||||
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Debug|x86.Build.0 = Debug|Win32
|
||||
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Release|x64.ActiveCfg = Release|x64
|
||||
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Release|x64.Build.0 = Release|x64
|
||||
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Release|x86.ActiveCfg = Release|Win32
|
||||
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3EDBED06-16E0-41A4-B58C-20C41B41BE20}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@ -68,12 +68,14 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IncludePath>D:\_Work\core\Common\3dParty\boost\build\win_32\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>D:\_Work\core\Common\3dParty\boost\build\win_32\lib;$(LibraryPath)</LibraryPath>
|
||||
<IncludePath>..\..\..\Common\3dParty\boost\build\win_32\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>..\..\..\Common\3dParty\boost\build\win_32\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<IncludePath>..\..\..\Common\3dParty\boost\build\win_64\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>..\..\..\Common\3dParty\boost\build\win_64\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
@ -86,7 +88,7 @@
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\DesktopEditor\freetype-2.5.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
@ -103,7 +105,7 @@
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
|
||||
162
ASCOfficeDocxFile2/BinReader/ReaderClasses.cpp
Normal file
162
ASCOfficeDocxFile2/BinReader/ReaderClasses.cpp
Normal file
@ -0,0 +1,162 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "ReaderClasses.h"
|
||||
|
||||
namespace BinDocxRW {
|
||||
TrackRevision::TrackRevision()
|
||||
{
|
||||
Id = NULL;
|
||||
vMerge = NULL;
|
||||
vMergeOrigin = NULL;
|
||||
RPr = NULL;
|
||||
PPr = NULL;
|
||||
sectPr = NULL;
|
||||
tblPr = NULL;
|
||||
tblGridChange = NULL;
|
||||
trPr = NULL;
|
||||
tcPr = NULL;
|
||||
content = NULL;
|
||||
contentRun = NULL;
|
||||
}
|
||||
TrackRevision::~TrackRevision()
|
||||
{
|
||||
RELEASEOBJECT(Id);
|
||||
RELEASEOBJECT(vMerge);
|
||||
RELEASEOBJECT(vMergeOrigin);
|
||||
RELEASEOBJECT(RPr);
|
||||
RELEASEOBJECT(PPr);
|
||||
RELEASEOBJECT(sectPr);
|
||||
RELEASEOBJECT(tblPr);
|
||||
RELEASEOBJECT(tblGridChange);
|
||||
RELEASEOBJECT(trPr);
|
||||
RELEASEOBJECT(tcPr);
|
||||
RELEASEOBJECT(content);
|
||||
RELEASEOBJECT(contentRun);
|
||||
}
|
||||
void TrackRevision::Write(NSStringUtils::CStringBuilder* pCStringWriter, std::wstring sName)
|
||||
{
|
||||
if (IsNoEmpty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<");
|
||||
pCStringWriter->WriteString(sName);
|
||||
if (NULL != Id)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:id=\"" + std::to_wstring(*Id) + L"\"");
|
||||
}
|
||||
if (!Author.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:author=\"");
|
||||
pCStringWriter->WriteEncodeXmlString(Author);
|
||||
pCStringWriter->WriteString(L"\"");
|
||||
}
|
||||
if (!Date.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:date=\"");
|
||||
pCStringWriter->WriteEncodeXmlString(Date);
|
||||
pCStringWriter->WriteString(L"\"");
|
||||
}
|
||||
if (!UserId.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L" oouserid=\"");
|
||||
pCStringWriter->WriteEncodeXmlString(UserId);
|
||||
pCStringWriter->WriteString(L"\"");
|
||||
}
|
||||
if (NULL != vMerge)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:vMerge=\"" + std::to_wstring(*vMerge) + L"\"");
|
||||
}
|
||||
if (NULL != vMergeOrigin)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:vMergeOrig=\"" + std::to_wstring(*vMergeOrigin) + L"\"");
|
||||
}
|
||||
if (NULL != RPr || NULL != PPr || NULL != sectPr || NULL != tblPr || NULL != tblGridChange || NULL != trPr || NULL != tcPr || NULL != content || NULL != contentRun)
|
||||
{
|
||||
pCStringWriter->WriteString(L">");
|
||||
if (NULL != RPr)
|
||||
{
|
||||
pCStringWriter->WriteString(RPr->toXML());
|
||||
}
|
||||
if (NULL != PPr)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:pPr>");
|
||||
pCStringWriter->Write(*PPr);
|
||||
pCStringWriter->WriteString(L"</w:pPr>");
|
||||
}
|
||||
if (NULL != sectPr)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:sectPr>");
|
||||
pCStringWriter->WriteString(sectPr->Write());
|
||||
pCStringWriter->WriteString(L"</w:sectPr>");
|
||||
}
|
||||
if (NULL != tblPr)
|
||||
{
|
||||
pCStringWriter->WriteString(tblPr->Write());
|
||||
}
|
||||
if (NULL != tblGridChange)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:tblGrid>");
|
||||
pCStringWriter->Write(*tblGridChange);
|
||||
pCStringWriter->WriteString(L"</w:tblGrid>");
|
||||
}
|
||||
if (NULL != trPr)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:trPr>");
|
||||
pCStringWriter->Write(*trPr);
|
||||
pCStringWriter->WriteString(L"</w:trPr>");
|
||||
}
|
||||
if (NULL != tcPr)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:tcPr>");
|
||||
pCStringWriter->Write(*tcPr);
|
||||
pCStringWriter->WriteString(L"</w:tcPr>");
|
||||
}
|
||||
if (NULL != content)
|
||||
{
|
||||
pCStringWriter->Write(*content);
|
||||
}
|
||||
if (NULL != contentRun)
|
||||
{
|
||||
pCStringWriter->Write(*contentRun);
|
||||
}
|
||||
|
||||
pCStringWriter->WriteString(L"</");
|
||||
pCStringWriter->WriteString(sName);
|
||||
pCStringWriter->WriteString(L">");
|
||||
}
|
||||
else
|
||||
{
|
||||
pCStringWriter->WriteString(L"/>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -34,9 +34,11 @@
|
||||
#include "HeaderFooterWriter.h"
|
||||
|
||||
#include "../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_Word.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Logic/RunProperty.h"
|
||||
#include "../BinWriter/BinReaderWriterDefines.h"
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
namespace BinDocxRW {
|
||||
|
||||
@ -400,431 +402,7 @@ class Tabs
|
||||
public:
|
||||
std::vector<Tab> m_aTabs;
|
||||
};
|
||||
class rPr
|
||||
{
|
||||
private:
|
||||
boost::unordered_map<std::wstring, int>& m_mapFonts;
|
||||
public:
|
||||
bool Bold;
|
||||
bool Italic;
|
||||
bool Underline;
|
||||
bool Strikeout;
|
||||
std::wstring FontAscii;
|
||||
std::wstring FontHAnsi;
|
||||
std::wstring FontAE;
|
||||
std::wstring FontCS;
|
||||
std::wstring FontAsciiTheme;
|
||||
std::wstring FontHAnsiTheme;
|
||||
std::wstring FontAETheme;
|
||||
std::wstring FontCSTheme;
|
||||
long FontSize;
|
||||
docRGB Color;
|
||||
BYTE VertAlign;
|
||||
docRGB HighLight;
|
||||
BYTE nHighLight;
|
||||
std::wstring Shd;
|
||||
std::wstring RStyle;
|
||||
long Spacing;
|
||||
bool DStrikeout;
|
||||
bool Caps;
|
||||
bool SmallCaps;
|
||||
long Position;
|
||||
BYTE FontHint;
|
||||
bool BoldCs;
|
||||
bool ItalicCs;
|
||||
long FontSizeCs;
|
||||
bool Cs;
|
||||
bool Rtl;
|
||||
std::wstring Lang;
|
||||
std::wstring LangBidi;
|
||||
std::wstring LangEA;
|
||||
CThemeColor ThemeColor;
|
||||
bool Vanish;
|
||||
std::wstring Outline;
|
||||
std::wstring Fill;
|
||||
std::wstring Del;
|
||||
std::wstring Ins;
|
||||
std::wstring MoveFrom;
|
||||
std::wstring MoveTo;
|
||||
std::wstring rPrChange;
|
||||
|
||||
bool bBold;
|
||||
bool bItalic;
|
||||
bool bUnderline;
|
||||
bool bStrikeout;
|
||||
bool bFontAscii;
|
||||
bool bFontHAnsi;
|
||||
bool bFontAE;
|
||||
bool bFontCS;
|
||||
bool bFontSize;
|
||||
bool bColor;
|
||||
bool bVertAlign;
|
||||
bool bShd;
|
||||
bool bRStyle;
|
||||
bool bSpacing;
|
||||
bool bDStrikeout;
|
||||
bool bCaps;
|
||||
bool bSmallCaps;
|
||||
bool bPosition;
|
||||
bool bFontHint;
|
||||
bool bBoldCs;
|
||||
bool bItalicCs;
|
||||
bool bFontSizeCs;
|
||||
bool bCs;
|
||||
bool bRtl;
|
||||
bool bLang;
|
||||
bool bLangBidi;
|
||||
bool bLangEA;
|
||||
bool bThemeColor;
|
||||
bool bVanish;
|
||||
|
||||
long CompressText;
|
||||
bool bDoNotWriteNullProp;
|
||||
public:
|
||||
rPr(boost::unordered_map<std::wstring, int>& mapFonts) : m_mapFonts(mapFonts)
|
||||
{
|
||||
Reset();
|
||||
|
||||
bDoNotWriteNullProp = false;
|
||||
}
|
||||
void Reset()
|
||||
{
|
||||
Bold = false;
|
||||
Italic = false;
|
||||
Underline = false;
|
||||
Strikeout = false;
|
||||
DStrikeout = false;
|
||||
Caps = false;
|
||||
SmallCaps = false;
|
||||
|
||||
bBold = false;
|
||||
bItalic = false;
|
||||
bUnderline = false;
|
||||
bStrikeout = false;
|
||||
bFontAscii = false;
|
||||
bFontHAnsi = false;
|
||||
bFontAE = false;
|
||||
bFontCS = false;
|
||||
bFontSize = false;
|
||||
bColor = false;
|
||||
bVertAlign = false;
|
||||
bShd = false;
|
||||
bRStyle = false;
|
||||
bSpacing = false;
|
||||
bDStrikeout = false;
|
||||
bCaps = false;
|
||||
bSmallCaps = false;
|
||||
bPosition = false;
|
||||
bFontHint = false;
|
||||
bBoldCs = false;
|
||||
bItalicCs = false;
|
||||
bFontSizeCs = false;
|
||||
bCs = false;
|
||||
bRtl = false;
|
||||
bLang = false;
|
||||
bLangBidi = false;
|
||||
bLangEA = false;
|
||||
bThemeColor = false;
|
||||
ThemeColor.Reset();
|
||||
bVanish = false;
|
||||
|
||||
nHighLight = 0; //not set
|
||||
Outline.clear();
|
||||
Fill.clear();
|
||||
Del.clear();
|
||||
Ins.clear();
|
||||
MoveFrom.clear();
|
||||
MoveTo.clear();
|
||||
rPrChange.clear();
|
||||
|
||||
CompressText = -1; //not set
|
||||
}
|
||||
bool IsNoEmpty()
|
||||
{
|
||||
return bBold || bItalic || bUnderline || bStrikeout || bFontAscii || bFontHAnsi || bFontAE || bFontCS || bFontSize || bColor || bVertAlign || nHighLight > 0 || bShd ||
|
||||
bRStyle || bSpacing || bDStrikeout || bCaps || bSmallCaps || bPosition || bFontHint || bBoldCs || bItalicCs || bFontSizeCs || bCs || bRtl || bLang || bLangBidi || bLangEA || bThemeColor || bVanish ||
|
||||
!Outline.empty() || !Fill.empty() || !Del.empty() || !Ins.empty() || !MoveFrom.empty() || !MoveTo.empty() || !rPrChange.empty() || !FontAsciiTheme.empty() || !FontHAnsiTheme.empty() || !FontAETheme.empty() || !FontCSTheme.empty();
|
||||
}
|
||||
void Write(NSStringUtils::CStringBuilder* pCStringWriter)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:rPr>");
|
||||
if(bRStyle)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:rStyle w:val=\"" + RStyle + L"\"/>");
|
||||
}
|
||||
if(bFontAscii || bFontHAnsi || bFontAE || bFontCS || bFontHint || !FontAsciiTheme.empty() || !FontHAnsiTheme.empty() || !FontAETheme.empty() || !FontCSTheme.empty())
|
||||
{
|
||||
std::wstring sFont = _T("<w:rFonts");
|
||||
if(bFontAscii)
|
||||
{
|
||||
sFont += L" w:ascii=\"" + FontAscii + L"\"";
|
||||
m_mapFonts[FontAscii] = 1;
|
||||
}
|
||||
if(bFontHAnsi)
|
||||
{
|
||||
sFont += L" w:hAnsi=\"" + FontHAnsi + L"\"";
|
||||
m_mapFonts[FontHAnsi] = 1;
|
||||
}
|
||||
if(bFontCS)
|
||||
{
|
||||
sFont += L" w:cs=\"" + FontCS + L"\"";
|
||||
m_mapFonts[FontCS] = 1;
|
||||
}
|
||||
if(bFontAE)
|
||||
{
|
||||
sFont += L" w:eastAsia=\"" + FontAE + L"\"";
|
||||
m_mapFonts[FontAE] = 1;
|
||||
}
|
||||
if(!FontAsciiTheme.empty())
|
||||
{
|
||||
sFont += L" w:asciiTheme=\"" + FontAsciiTheme + L"\"";
|
||||
}
|
||||
if(!FontHAnsiTheme.empty())
|
||||
{
|
||||
sFont += L" w:hAnsiTheme=\"" + FontHAnsiTheme + L"\"";
|
||||
}
|
||||
if(!FontAETheme.empty())
|
||||
{
|
||||
sFont += L" w:eastAsiaTheme=\"" + FontAETheme + L"\"";
|
||||
}
|
||||
if(!FontCSTheme.empty())
|
||||
{
|
||||
sFont += L" w:cstheme=\"" + FontCSTheme + L"\"";
|
||||
}
|
||||
if(bFontHint)
|
||||
{
|
||||
switch(FontHint)
|
||||
{
|
||||
case 0: sFont += L" w:hint=\"cs\""; break;
|
||||
case 2: sFont += L" w:hint=\"eastAsia\""; break;
|
||||
default:sFont += L" w:hint=\"default\""; break;
|
||||
}
|
||||
}
|
||||
sFont += _T("/>");
|
||||
pCStringWriter->WriteString(sFont);
|
||||
}
|
||||
if (CompressText >= 0 && CompressText <= 600)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:w w:val=\"" + std::to_wstring(CompressText) + L"\"/>");
|
||||
}
|
||||
if(bBold)
|
||||
{
|
||||
if(Bold)
|
||||
pCStringWriter->WriteString(L"<w:b/>");
|
||||
else if(false == bDoNotWriteNullProp)
|
||||
pCStringWriter->WriteString(L"<w:b w:val=\"false\"/>");
|
||||
}
|
||||
if(bBoldCs)
|
||||
{
|
||||
if(BoldCs)
|
||||
pCStringWriter->WriteString(L"<w:bCs/>");
|
||||
else if(false == bDoNotWriteNullProp)
|
||||
pCStringWriter->WriteString(L"<w:bCs w:val=\"false\"/>");
|
||||
}
|
||||
if(bItalic)
|
||||
{
|
||||
if(Italic)
|
||||
pCStringWriter->WriteString(L"<w:i/>");
|
||||
else if(false == bDoNotWriteNullProp)
|
||||
pCStringWriter->WriteString(L"<w:i w:val=\"false\"/>");
|
||||
}
|
||||
if(bItalicCs)
|
||||
{
|
||||
if(ItalicCs)
|
||||
pCStringWriter->WriteString(L"<w:iCs />");
|
||||
else if(false == bDoNotWriteNullProp)
|
||||
pCStringWriter->WriteString(L"<w:iCs w:val=\"false\"/>");
|
||||
}
|
||||
if(bCaps)
|
||||
{
|
||||
if(Caps)
|
||||
pCStringWriter->WriteString(L"<w:caps/>");
|
||||
else if(false == bDoNotWriteNullProp)
|
||||
pCStringWriter->WriteString(L"<w:caps w:val=\"false\"/>");
|
||||
}
|
||||
if(bSmallCaps)
|
||||
{
|
||||
if(SmallCaps)
|
||||
pCStringWriter->WriteString(L"<w:smallCaps/>");
|
||||
else if(false == bDoNotWriteNullProp)
|
||||
pCStringWriter->WriteString(L"<w:smallCaps w:val=\"false\"/>");
|
||||
}
|
||||
if(bStrikeout)
|
||||
{
|
||||
if(Strikeout)
|
||||
pCStringWriter->WriteString(L"<w:strike/>");
|
||||
else if(false == bDoNotWriteNullProp)
|
||||
pCStringWriter->WriteString(L"<w:strike w:val=\"false\"/>");
|
||||
}
|
||||
if(bDStrikeout)
|
||||
{
|
||||
if(DStrikeout)
|
||||
pCStringWriter->WriteString(L"<w:dstrike/>");
|
||||
//else if(false == bDoNotWriteNullProp)
|
||||
// pCStringWriter->WriteString(L"<w:dstrike w:val=\"false\"/>");
|
||||
}
|
||||
if(bVanish)
|
||||
{
|
||||
if(Vanish)
|
||||
pCStringWriter->WriteString(L"<w:vanish/>");
|
||||
else if(false == bDoNotWriteNullProp)
|
||||
pCStringWriter->WriteString(L"<w:vanish w:val=\"false\"/>");
|
||||
}
|
||||
if(bColor || (bThemeColor && ThemeColor.IsNoEmpty()))
|
||||
{
|
||||
std::wstring sColor(L"<w:color");
|
||||
if(bColor)
|
||||
sColor += L" w:val=\"" + Color.ToString() + L"\"";
|
||||
if(bThemeColor && ThemeColor.IsNoEmpty())
|
||||
{
|
||||
if(ThemeColor.Auto && !bColor)
|
||||
sColor += L" w:val=\"auto\"";
|
||||
if(ThemeColor.bColor)
|
||||
sColor += L" w:themeColor=\"" + ThemeColor.ToStringColor() + L"\"";
|
||||
if(ThemeColor.bTint)
|
||||
sColor += L" w:themeTint=\"" + ThemeColor.ToStringTint() + L"\"";
|
||||
if(ThemeColor.bShade)
|
||||
sColor += L" w:themeShade=\"" + ThemeColor.ToStringShade() + L"\"";
|
||||
}
|
||||
sColor += L"/>";
|
||||
pCStringWriter->WriteString(sColor);
|
||||
}
|
||||
if(bSpacing)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:spacing w:val=\"" + std::to_wstring(Spacing) + L"\"/>");
|
||||
}
|
||||
if(bPosition)
|
||||
{
|
||||
std::wstring sPosition = L"<w:position w:val=\"" + std::to_wstring(Position) + L"\"/>";
|
||||
pCStringWriter->WriteString(sPosition);
|
||||
}
|
||||
if(bFontSize)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:sz w:val=\"" + std::to_wstring(FontSize) + L"\"/>");
|
||||
}
|
||||
if(bFontSizeCs)
|
||||
{
|
||||
//if(false == bFontSize) - Sample Doc.docx
|
||||
// pCStringWriter->WriteString(L"<w:sz w:val=\"" + std::to_wstring(FontSizeCs) + L"\"/>");
|
||||
pCStringWriter->WriteString(L"<w:szCs w:val=\"" + std::to_wstring(FontSizeCs) + L"\"/>");
|
||||
}
|
||||
if(nHighLight > 0)
|
||||
{
|
||||
docRGB& H = HighLight;
|
||||
std::wstring sColor;
|
||||
if (nHighLight == 1)
|
||||
sColor = L"none";
|
||||
else if(0x00 == H.R && 0x00 == H.G && 0x00 == H.B )
|
||||
sColor = _T("black");
|
||||
else if(0x00 == H.R && 0x00 == H.G && 0xFF == H.B )
|
||||
sColor = _T("blue");
|
||||
else if(0x00 == H.R && 0xFF == H.G && 0xFF == H.B )
|
||||
sColor = _T("cyan");
|
||||
else if(0x00 == H.R && 0x00 == H.G && 0x8B == H.B )
|
||||
sColor = _T("darkBlue");
|
||||
else if(0x00 == H.R && 0x8B == H.G && 0x8B == H.B )
|
||||
sColor = _T("darkCyan");
|
||||
else if(0xA9 == H.R && 0xA9 == H.G && 0xA9 == H.B )
|
||||
sColor = _T("darkGray");
|
||||
else if(0x00 == H.R && 0x64 == H.G && 0x00 == H.B )
|
||||
sColor = _T("darkGreen");
|
||||
else if(0x80 == H.R && 0x00 == H.G && 0x80 == H.B )
|
||||
sColor = _T("darkMagenta");
|
||||
else if(0x8B == H.R && 0x00 == H.G && 0x00 == H.B )
|
||||
sColor = _T("darkRed");
|
||||
else if(0x80 == H.R && 0x80 == H.G && 0x00 == H.B )
|
||||
sColor = _T("darkYellow");
|
||||
else if(0x00 == H.R && 0xFF == H.G && 0x00 == H.B )
|
||||
sColor = _T("green");
|
||||
else if(0xD3 == H.R && 0xD3 == H.G && 0xD3 == H.B )
|
||||
sColor = _T("lightGray");
|
||||
else if(0xFF == H.R && 0x00 == H.G && 0xFF == H.B )
|
||||
sColor = _T("magenta");
|
||||
else if(0xFF == H.R && 0x00 == H.G && 0x00 == H.B )
|
||||
sColor = _T("red");
|
||||
else if(0xFF == H.R && 0xFF == H.G && 0xFF == H.B )
|
||||
sColor = _T("white");
|
||||
else if(0xFF == H.R && 0xFF == H.G && 0x00 == H.B )
|
||||
sColor = _T("yellow");
|
||||
if(!sColor.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:highlight w:val=\"" + sColor + L"\"/>");
|
||||
}
|
||||
else if(g_nCurFormatVersion < 5)
|
||||
{
|
||||
//добавляем как shading
|
||||
pCStringWriter->WriteString(L"<w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"" + H.ToString() + L"\"/>");
|
||||
}
|
||||
}
|
||||
if(bUnderline)
|
||||
{
|
||||
if(Underline)
|
||||
pCStringWriter->WriteString(L"<w:u w:val=\"single\"/>");
|
||||
else if(false == bDoNotWriteNullProp)
|
||||
pCStringWriter->WriteString(L"<w:u w:val=\"none\"/>");
|
||||
}
|
||||
if(bShd)
|
||||
pCStringWriter->WriteString(Shd);
|
||||
if(bVertAlign)
|
||||
{
|
||||
switch(VertAlign)
|
||||
{
|
||||
case vertalign_Baseline:
|
||||
if(false == bDoNotWriteNullProp)
|
||||
pCStringWriter->WriteString(L"<w:vertAlign w:val=\"baseline\"/>" );
|
||||
break;
|
||||
case vertalign_SuperScript:pCStringWriter->WriteString(L"<w:vertAlign w:val=\"superscript\"/>" );break;
|
||||
case vertalign_SubScript:pCStringWriter->WriteString(L"<w:vertAlign w:val=\"subscript\"/>" );break;
|
||||
}
|
||||
}
|
||||
if(bRtl)
|
||||
{
|
||||
if(Rtl)
|
||||
pCStringWriter->WriteString(L"<w:rtl/>");
|
||||
else if(false == bDoNotWriteNullProp)
|
||||
pCStringWriter->WriteString(L"<w:rtl w:val=\"false\"/>");
|
||||
}
|
||||
if(bCs)
|
||||
{
|
||||
if(Cs)
|
||||
pCStringWriter->WriteString(L"<w:cs/>");
|
||||
else if(false == bDoNotWriteNullProp)
|
||||
pCStringWriter->WriteString(L"<w:cs w:val=\"false\"/>");
|
||||
}
|
||||
if(bLang || bLangBidi || bLangEA)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:lang");
|
||||
if(bLang)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:val=\"" + Lang + L"\"");
|
||||
}
|
||||
if(bLangBidi)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:bidi=\"" + LangBidi + L"\"");
|
||||
}
|
||||
if(bLangEA)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:eastAsia=\"" + LangEA + L"\"");
|
||||
}
|
||||
pCStringWriter->WriteString(L"/>");
|
||||
}
|
||||
if (!Outline.empty())
|
||||
pCStringWriter->WriteString(Outline);
|
||||
if (!Fill.empty())
|
||||
pCStringWriter->WriteString(Fill);
|
||||
if (!Del.empty())
|
||||
pCStringWriter->WriteString(Del);
|
||||
if (!Ins.empty())
|
||||
pCStringWriter->WriteString(Ins);
|
||||
if (!MoveFrom.empty())
|
||||
pCStringWriter->WriteString(MoveFrom);
|
||||
if (!MoveTo.empty())
|
||||
pCStringWriter->WriteString(MoveTo);
|
||||
if (!rPrChange.empty())
|
||||
pCStringWriter->WriteString(rPrChange);
|
||||
pCStringWriter->WriteString(L"</w:rPr>");
|
||||
}
|
||||
};
|
||||
class docStyle
|
||||
{
|
||||
public:
|
||||
@ -2398,7 +1976,8 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
sXml += L"<wp:inline xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
|
||||
sXml += L"<wp:inline \
|
||||
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
|
||||
distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstring(Width) + L"\" cy=\"" + std::to_wstring(Height) + L"\"/>";
|
||||
}
|
||||
|
||||
@ -2470,15 +2049,19 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
|
||||
{
|
||||
sXml += L"<w:drawing>";
|
||||
}
|
||||
sXml += L"<wp:anchor xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\"\
|
||||
distT=\"" + std::to_wstring(emuDistT) +
|
||||
L"\" distB=\"" + std::to_wstring(emuDistB) +
|
||||
L"\" distL=\"" + std::to_wstring(emuDistL) +
|
||||
L"\" distR=\"" + std::to_wstring(emuDistR) +
|
||||
L"\" simplePos=\"" + std::to_wstring(nSimplePos) +
|
||||
L"\" relativeHeight=\"" + std::to_wstring(nRelativeHeight) +
|
||||
L"\" behindDoc=\"" + std::to_wstring(nBehindDoc) +
|
||||
L"\" locked=\"0\" layoutInCell=\"" + std::to_wstring(nLayoutInCell) + L"\" allowOverlap=\"1\">";
|
||||
sXml += L"<wp:anchor \
|
||||
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
|
||||
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
|
||||
distT=\"" + std::to_wstring(emuDistT) + L"\" \
|
||||
distB=\"" + std::to_wstring(emuDistB) + L"\" \
|
||||
distL=\"" + std::to_wstring(emuDistL) + L"\" \
|
||||
distR=\"" + std::to_wstring(emuDistR) + L"\" \
|
||||
simplePos=\"" + std::to_wstring(nSimplePos) + L"\" \
|
||||
relativeHeight=\"" + std::to_wstring(nRelativeHeight) + L"\" \
|
||||
behindDoc=\"" + std::to_wstring(nBehindDoc) + L"\" \
|
||||
locked=\"0\" \
|
||||
layoutInCell=\"" + std::to_wstring(nLayoutInCell) + L"\" \
|
||||
allowOverlap=\"1\">";
|
||||
|
||||
__int64 emuX = 0;
|
||||
if(bSimplePosX)
|
||||
@ -2687,6 +2270,7 @@ public:
|
||||
std::wstring TableCellSpacing;
|
||||
std::wstring Caption;
|
||||
std::wstring Description;
|
||||
std::wstring Overlap;
|
||||
bool IsEmpty()
|
||||
{
|
||||
return Jc.empty() && TableInd.empty() && TableW.empty() && TableCellMar.empty() && TableBorders.empty() && Shd.empty() && tblpPr.empty()&& Style.empty() && Look.empty() && tblPrChange.empty() && TableCellSpacing.empty() && RowBandSize.empty() && ColBandSize.empty();
|
||||
@ -2703,7 +2287,9 @@ public:
|
||||
sRes += (RowBandSize);
|
||||
if(!ColBandSize.empty())
|
||||
sRes += (ColBandSize);
|
||||
if(false == TableW.empty())
|
||||
if (!Overlap.empty())
|
||||
sRes += (Overlap);
|
||||
if(false == TableW.empty())
|
||||
sRes += (TableW);
|
||||
if(false == Jc.empty())
|
||||
sRes += (Jc);
|
||||
@ -3009,6 +2595,7 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class TrackRevision
|
||||
{
|
||||
public:
|
||||
@ -3019,7 +2606,8 @@ public:
|
||||
long* vMerge;
|
||||
long* vMergeOrigin;
|
||||
|
||||
rPr* RPr;
|
||||
OOX::Logic::CRunProperty* RPr;
|
||||
|
||||
NSStringUtils::CStringBuilder* PPr;
|
||||
SectPr* sectPr;
|
||||
CWiterTblPr* tblPr;
|
||||
@ -3028,36 +2616,8 @@ public:
|
||||
NSStringUtils::CStringBuilder* tcPr;
|
||||
NSStringUtils::CStringBuilder* content;
|
||||
NSStringUtils::CStringBuilder* contentRun;
|
||||
TrackRevision()
|
||||
{
|
||||
Id = NULL;
|
||||
vMerge = NULL;
|
||||
vMergeOrigin = NULL;
|
||||
RPr = NULL;
|
||||
PPr = NULL;
|
||||
sectPr = NULL;
|
||||
tblPr = NULL;
|
||||
tblGridChange = NULL;
|
||||
trPr = NULL;
|
||||
tcPr = NULL;
|
||||
content = NULL;
|
||||
contentRun = NULL;
|
||||
}
|
||||
~TrackRevision()
|
||||
{
|
||||
RELEASEOBJECT(Id);
|
||||
RELEASEOBJECT(vMerge);
|
||||
RELEASEOBJECT(vMergeOrigin);
|
||||
RELEASEOBJECT(RPr);
|
||||
RELEASEOBJECT(PPr);
|
||||
RELEASEOBJECT(sectPr);
|
||||
RELEASEOBJECT(tblPr);
|
||||
RELEASEOBJECT(tblGridChange);
|
||||
RELEASEOBJECT(trPr);
|
||||
RELEASEOBJECT(tcPr);
|
||||
RELEASEOBJECT(content);
|
||||
RELEASEOBJECT(contentRun);
|
||||
}
|
||||
TrackRevision();
|
||||
~TrackRevision();
|
||||
bool IsNoEmpty()
|
||||
{
|
||||
return !Author.empty() || !Date.empty() || NULL != Id;
|
||||
@ -3068,101 +2628,6 @@ public:
|
||||
Write(&writer, sName);
|
||||
return writer.GetData();
|
||||
}
|
||||
void Write(NSStringUtils::CStringBuilder* pCStringWriter, std::wstring sName)
|
||||
{
|
||||
if(IsNoEmpty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<");
|
||||
pCStringWriter->WriteString(sName);
|
||||
if(NULL != Id)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:id=\"" + std::to_wstring(*Id) + L"\"");
|
||||
}
|
||||
if(!Author.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:author=\"");
|
||||
pCStringWriter->WriteEncodeXmlString(Author);
|
||||
pCStringWriter->WriteString(L"\"");
|
||||
}
|
||||
if(!Date.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:date=\"");
|
||||
pCStringWriter->WriteEncodeXmlString(Date);
|
||||
pCStringWriter->WriteString(L"\"");
|
||||
}
|
||||
if(!UserId.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L" oouserid=\"");
|
||||
pCStringWriter->WriteEncodeXmlString(UserId);
|
||||
pCStringWriter->WriteString(L"\"");
|
||||
}
|
||||
if(NULL != vMerge)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:vMerge=\"" + std::to_wstring(*vMerge) + L"\"");
|
||||
}
|
||||
if(NULL != vMergeOrigin)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:vMergeOrig=\"" + std::to_wstring(*vMergeOrigin) + L"\"");
|
||||
}
|
||||
if(NULL != RPr || NULL != PPr || NULL != sectPr || NULL != tblPr || NULL != tblGridChange || NULL != trPr || NULL != tcPr || NULL != content|| NULL != contentRun)
|
||||
{
|
||||
pCStringWriter->WriteString(L">");
|
||||
if(NULL != RPr)
|
||||
{
|
||||
RPr->Write(pCStringWriter);
|
||||
}
|
||||
if(NULL != PPr)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:pPr>");
|
||||
pCStringWriter->Write(*PPr);
|
||||
pCStringWriter->WriteString(L"</w:pPr>");
|
||||
}
|
||||
if(NULL != sectPr)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:sectPr>");
|
||||
pCStringWriter->WriteString(sectPr->Write());
|
||||
pCStringWriter->WriteString(L"</w:sectPr>");
|
||||
}
|
||||
if(NULL != tblPr)
|
||||
{
|
||||
pCStringWriter->WriteString(tblPr->Write());
|
||||
}
|
||||
if(NULL != tblGridChange)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:tblGrid>");
|
||||
pCStringWriter->Write(*tblGridChange);
|
||||
pCStringWriter->WriteString(L"</w:tblGrid>");
|
||||
}
|
||||
if(NULL != trPr)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:trPr>");
|
||||
pCStringWriter->Write(*trPr);
|
||||
pCStringWriter->WriteString(L"</w:trPr>");
|
||||
}
|
||||
if(NULL != tcPr)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:tcPr>");
|
||||
pCStringWriter->Write(*tcPr);
|
||||
pCStringWriter->WriteString(L"</w:tcPr>");
|
||||
}
|
||||
if(NULL != content)
|
||||
{
|
||||
pCStringWriter->Write(*content);
|
||||
}
|
||||
if(NULL != contentRun)
|
||||
{
|
||||
pCStringWriter->Write(*contentRun);
|
||||
}
|
||||
|
||||
pCStringWriter->WriteString(L"</");
|
||||
pCStringWriter->WriteString(sName);
|
||||
pCStringWriter->WriteString(L" >");
|
||||
}
|
||||
else
|
||||
{
|
||||
pCStringWriter->WriteString(L" />");
|
||||
}
|
||||
}
|
||||
}
|
||||
void Write(NSStringUtils::CStringBuilder* pCStringWriter, std::wstring sName);
|
||||
};
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -60,9 +60,11 @@ public:
|
||||
void ReadThemeColor(int length, CThemeColor& oCThemeColor);
|
||||
int ReadThemeColorContent(BYTE type, long length, void* poResult);
|
||||
template<typename T> int ReadTrackRevision(long length, T* poResult);
|
||||
template<typename T> int ReadTrackRevision2(long length, T* poResult);
|
||||
int ReadShdComplexType(BYTE type, long length, void* poResult);
|
||||
private:
|
||||
template<typename T> int ReadTrackRevisionInner(BYTE type, long length, T* poResult);
|
||||
template<typename T> int ReadTrackRevisionInner2(BYTE type, long length, T* poResult);
|
||||
};
|
||||
class Binary_HdrFtrTableReader : public Binary_CommonReader
|
||||
{
|
||||
@ -85,11 +87,12 @@ class Binary_rPrReader : public Binary_CommonReader
|
||||
protected:
|
||||
Binary_CommonReader2 oBinary_CommonReader2;
|
||||
Writers::FileWriter& m_oFileWriter;
|
||||
boost::unordered_map<std::wstring, char>& m_mapFonts;
|
||||
public:
|
||||
Binary_rPrReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter);
|
||||
int Read(long stLen, void* poResult);
|
||||
int ReadContent(BYTE type, long length, void* poResult);
|
||||
int ReadrPrChange(BYTE type, long length, void* poResult);
|
||||
int ReadrPrChange2(BYTE type, long length, void* poResult);
|
||||
};
|
||||
class Binary_pPrReader : public Binary_CommonReader
|
||||
{
|
||||
@ -283,8 +286,8 @@ private:
|
||||
Binary_rPrReader oBinary_rPrReader;
|
||||
Binary_tblPrReader oBinary_tblPrReader;
|
||||
NSStringUtils::CStringBuilder* m_pCurWriter;
|
||||
rPr m_oCur_rPr;
|
||||
rPr m_oMath_rPr;
|
||||
OOX::Logic::CRunProperty m_oCur_rPr;
|
||||
OOX::Logic::CRunProperty m_oMath_rPr;
|
||||
NSStringUtils::CStringBuilder m_oCur_pPr;
|
||||
BYTE m_byteLastElemType;
|
||||
public:
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -43,11 +43,11 @@ namespace Writers
|
||||
class FontTableWriter
|
||||
{
|
||||
NSStringUtils::CStringBuilder m_oWriter;
|
||||
std::wstring m_sDir;
|
||||
NSFonts::IApplicationFonts* m_pApplicationFonts;
|
||||
NSFonts::IFontManager* m_pFontManager;
|
||||
std::wstring m_sDir;
|
||||
NSFonts::IApplicationFonts* m_pApplicationFonts;
|
||||
NSFonts::IFontManager* m_pFontManager;
|
||||
public:
|
||||
boost::unordered_map<std::wstring, int> m_mapFonts;
|
||||
boost::unordered_map<std::wstring, char> m_mapFonts;
|
||||
|
||||
FontTableWriter(std::wstring sDir, std::wstring sFontDir, bool bNoFontDir) : m_sDir(sDir)
|
||||
{
|
||||
@ -72,11 +72,11 @@ namespace Writers
|
||||
{
|
||||
m_oWriter.WriteString(g_string_ft_Start);
|
||||
|
||||
//Те шрифты которые всегда пишем в FontTable
|
||||
//Те шрифты которые всегда пишем в FontTable
|
||||
bool bCalibri = false;
|
||||
bool bTimes = false;
|
||||
bool bCambria = false;
|
||||
for (boost::unordered_map<std::wstring, int>::const_iterator it = m_mapFonts.begin(); it != m_mapFonts.end(); ++it)
|
||||
for (boost::unordered_map<std::wstring, char>::const_iterator it = m_mapFonts.begin(); it != m_mapFonts.end(); ++it)
|
||||
{
|
||||
const std::wstring& sFontName = it->first;
|
||||
if(_T("Calibri") == sFontName)
|
||||
|
||||
@ -304,7 +304,8 @@ extern int g_nCurFormatVersion;
|
||||
tblCaption = 17,
|
||||
tblDescription = 18,
|
||||
TableIndTwips = 19,
|
||||
TableCellSpacingTwips = 20
|
||||
TableCellSpacingTwips = 20,
|
||||
tblOverlap = 21
|
||||
};}
|
||||
namespace c_oSer_tblpPrType{enum c_oSer_tblpPrType
|
||||
{
|
||||
@ -417,7 +418,18 @@ extern int g_nCurFormatVersion;
|
||||
FontHAnsiTheme = 41,
|
||||
FontAETheme = 42,
|
||||
FontCSTheme = 43,
|
||||
CompressText = 44
|
||||
CompressText = 44,
|
||||
SnapToGrid = 45,
|
||||
Ligatures = 46,
|
||||
NumSpacing = 47,
|
||||
NumForm = 48,
|
||||
StylisticSets = 49,
|
||||
CntxtAlts = 50,
|
||||
ShadowExt = 51,
|
||||
Reflection = 52,
|
||||
Glow = 53,
|
||||
Props3d = 54,
|
||||
Scene3d = 55
|
||||
};}
|
||||
namespace c_oSerProp_rowPrType{enum c_oSerProp_rowPrType
|
||||
{
|
||||
@ -597,7 +609,10 @@ extern int g_nCurFormatVersion;
|
||||
arPr = 28,
|
||||
fldChar = 29,
|
||||
instrText = 30,
|
||||
delInstrText = 31
|
||||
delInstrText = 31,
|
||||
linebreakClearAll = 32,
|
||||
linebreakClearLeft = 33,
|
||||
linebreakClearRight = 34
|
||||
};}
|
||||
namespace c_oSerVbaProjectTypes{enum c_oSerVbaProjectType
|
||||
{
|
||||
@ -1157,7 +1172,8 @@ extern int g_nCurFormatVersion;
|
||||
Custom = 0,
|
||||
ItemId = 1,
|
||||
Uri = 2,
|
||||
Content = 3
|
||||
Content = 3,
|
||||
ContentA = 4
|
||||
};}
|
||||
namespace c_oSerApp{enum c_oSerApp
|
||||
{
|
||||
@ -1247,7 +1263,8 @@ extern int g_nCurFormatVersion;
|
||||
PictureFormPrShiftX = 64,
|
||||
PictureFormPrShiftY = 65,
|
||||
FormPrBorder = 70,
|
||||
FormPrShd = 71
|
||||
FormPrShd = 71,
|
||||
TextFormPrCombWRule = 72
|
||||
};}
|
||||
namespace c_oSerFFData{enum c_oSerFFData
|
||||
{
|
||||
|
||||
@ -309,13 +309,14 @@ void BinaryCommonWriter::WriteShd(const ComplexTypes::Word::CShading& Shd)
|
||||
if (false != Shd.m_oColor.IsInit())
|
||||
WriteColor(c_oSerShdType::Color, Shd.m_oColor.get());
|
||||
|
||||
WriteThemeColor(c_oSerShdType::ColorTheme, Shd.m_oFill, Shd.m_oThemeFill, Shd.m_oThemeFillTint, Shd.m_oThemeFillShade);
|
||||
WriteThemeColor(c_oSerShdType::ColorTheme, Shd.m_oColor, Shd.m_oThemeColor, Shd.m_oThemeTint, Shd.m_oThemeShade);
|
||||
|
||||
//Fill
|
||||
if (false != Shd.m_oFill.IsInit())
|
||||
WriteColor(c_oSerShdType::Fill, Shd.m_oFill.get());
|
||||
|
||||
WriteThemeColor(c_oSerShdType::FillTheme, Shd.m_oColor, Shd.m_oThemeColor, Shd.m_oThemeTint, Shd.m_oThemeShade);
|
||||
WriteThemeColor(c_oSerShdType::FillTheme, Shd.m_oFill, Shd.m_oThemeFill, Shd.m_oThemeFillTint, Shd.m_oThemeFillShade);
|
||||
|
||||
}
|
||||
void BinaryCommonWriter::WritePaddings(const nullable<SimpleTypes::CTwipsMeasure>& left, const nullable<SimpleTypes::CTwipsMeasure>& top,
|
||||
const nullable<SimpleTypes::CTwipsMeasure>& right, const nullable<SimpleTypes::CTwipsMeasure>& bottom)
|
||||
@ -511,7 +512,7 @@ void Binary_rPrWriter::Write_rPr(OOX::Logic::CRunProperty* rPr)
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::Underline);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBOOL(SimpleTypes::underlineNone != oU.m_oVal.get().GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(oU.m_oVal.get().GetValue());
|
||||
}
|
||||
}
|
||||
//Strikeout
|
||||
@ -742,13 +743,13 @@ void Binary_rPrWriter::Write_rPr(OOX::Logic::CRunProperty* rPr)
|
||||
}
|
||||
}
|
||||
//Vanish
|
||||
if (false != rPr->m_oVanish.IsInit())
|
||||
if (rPr->m_oVanish.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::Vanish);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBOOL(rPr->m_oVanish->m_oVal.ToBool());
|
||||
}
|
||||
if (false != rPr->m_oTextOutline.IsInit())
|
||||
if (rPr->m_oTextOutline.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::TextOutline);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
|
||||
@ -812,6 +813,81 @@ void Binary_rPrWriter::Write_rPr(OOX::Logic::CRunProperty* rPr)
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(rPr->m_oW->m_oVal->GetValue());
|
||||
}
|
||||
if (rPr->m_oSnapToGrid.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::SnapToGrid);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBOOL(rPr->m_oSnapToGrid->m_oVal.ToBool());
|
||||
}
|
||||
if (rPr->m_oLigatures.IsInit() && rPr->m_oLigatures->m_oVal.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::Ligatures);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE((BYTE)rPr->m_oLigatures->m_oVal->GetValue());
|
||||
}
|
||||
if (rPr->m_oNumSpacing.IsInit() && rPr->m_oNumSpacing->m_oVal.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::NumSpacing);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE((BYTE)rPr->m_oNumSpacing->m_oVal->GetValue());
|
||||
}
|
||||
if (rPr->m_oNumForm.IsInit() && rPr->m_oNumForm->m_oVal.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::NumForm);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE((BYTE)rPr->m_oNumForm->m_oVal->GetValue());
|
||||
}
|
||||
if (rPr->m_oCntxtAlts.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::CntxtAlts);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBOOL(rPr->m_oCntxtAlts->m_oVal.ToBool());
|
||||
}
|
||||
if (rPr->m_oShadowExt.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::ShadowExt);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
|
||||
int nCurPos = m_oBcw.WriteItemWithLengthStart();
|
||||
|
||||
m_oBcw.m_oStream.WriteRecord1(0, *rPr->m_oShadowExt);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if (rPr->m_oReflection.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::Reflection);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
|
||||
int nCurPos = m_oBcw.WriteItemWithLengthStart();
|
||||
|
||||
m_oBcw.m_oStream.WriteRecord1(0, *rPr->m_oReflection);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if (rPr->m_oGlow.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::Glow);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
|
||||
int nCurPos = m_oBcw.WriteItemWithLengthStart();
|
||||
|
||||
m_oBcw.m_oStream.WriteRecord1(0, *rPr->m_oGlow);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if (rPr->m_oProps3d.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::Props3d);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
|
||||
int nCurPos = m_oBcw.WriteItemWithLengthStart();
|
||||
|
||||
m_oBcw.m_oStream.WriteRecord1(0, *rPr->m_oProps3d);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if (rPr->m_oScene3d.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::Scene3d);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
|
||||
int nCurPos = m_oBcw.WriteItemWithLengthStart();
|
||||
|
||||
m_oBcw.m_oStream.WriteRecord1(0, *rPr->m_oScene3d);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void Binary_rPrWriter::Write_rPrChange(const OOX::Logic::CRPrChange& rPrChange)
|
||||
{
|
||||
@ -1936,6 +2012,12 @@ void Binary_tblPrWriter::WriteTblPr(OOX::Logic::CTableProperty* p_tblPr)
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_tblPrType::tblDescription);
|
||||
m_oBcw.m_oStream.WriteStringW(tblPr.m_oTblDescription->ToString2());
|
||||
}
|
||||
if (tblPr.m_oTblOverlap.IsInit() && tblPr.m_oTblOverlap->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_tblPrType::tblOverlap);
|
||||
m_oBcw.m_oStream.WriteBYTE((BYTE)tblPr.m_oTblOverlap->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void Binary_tblPrWriter::WriteTblMar(const OOX::Logic::CTblCellMar& cellMar)
|
||||
{
|
||||
@ -6051,7 +6133,17 @@ void BinaryDocumentTableWriter::WriteRunContent(std::vector<OOX::WritingElement*
|
||||
{
|
||||
case SimpleTypes::brtypeColumn: nBreakType = c_oSerRunType::columnbreak; break;
|
||||
case SimpleTypes::brtypePage: nBreakType = c_oSerRunType::pagebreak; break;
|
||||
case SimpleTypes::brtypeTextWrapping: nBreakType = c_oSerRunType::linebreak; break;
|
||||
case SimpleTypes::brtypeTextWrapping:
|
||||
{
|
||||
switch (pBr->m_oClear.GetValue())
|
||||
{
|
||||
case SimpleTypes::brclearAll: nBreakType = c_oSerRunType::linebreakClearAll; break;
|
||||
case SimpleTypes::brclearLeft: nBreakType = c_oSerRunType::linebreakClearLeft; break;
|
||||
case SimpleTypes::brclearRight: nBreakType = c_oSerRunType::linebreakClearRight; break;
|
||||
default: nBreakType = c_oSerRunType::linebreak; break;
|
||||
}
|
||||
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -6059,9 +6151,8 @@ void BinaryDocumentTableWriter::WriteRunContent(std::vector<OOX::WritingElement*
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(nBreakType);
|
||||
m_oBcw.m_oStream.WriteLONG(c_oSerPropLenType::Null);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case OOX::et_w_cr:
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::cr);
|
||||
@ -7956,6 +8047,12 @@ void BinaryDocumentTableWriter::WriteSdtTextFormPrComb(const ComplexTypes::Word:
|
||||
m_oBcw.m_oStream.WriteStringW3(oComb.m_oFont.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (oComb.m_oWRule.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrCombWRule);
|
||||
m_oBcw.m_oStream.WriteBYTE(oComb.m_oWRule->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8567,7 +8664,7 @@ void BinarySettingsTableWriter::WriteMathPr(const OOX::Logic::CMathPr &pMathPr)
|
||||
}
|
||||
void BinarySettingsTableWriter::WriteColorSchemeMapping(const PPTX::Logic::ClrMap& oColorSchemeMapping)
|
||||
{
|
||||
int re_index[] = {0, 1, 2, 3, 4, 5, 10, 11, 6, 7, 8, 9, 10, 11, 10, 6, 7};
|
||||
int re_index[] = {0, 1, 2, 3, 4, 5, 10, 11, 6, 7, 9, 8, 10, 11, 10, 6, 7};
|
||||
|
||||
int nCurPos = 0;
|
||||
|
||||
@ -9051,11 +9148,8 @@ void BinaryCustomsTableWriter::Write(OOX::CDocument* pDocument)
|
||||
}
|
||||
}
|
||||
|
||||
int nCurPos2 = m_oBcw.WriteItemStart(c_oSerCustoms::Content);
|
||||
|
||||
std::wstring sXml = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)pCustomXml->m_sXmlA.c_str(), pCustomXml->m_sXmlA.length());
|
||||
m_oBcw.m_oStream.WriteStringW3(sXml);
|
||||
|
||||
int nCurPos2 = m_oBcw.WriteItemStart(c_oSerCustoms::ContentA);
|
||||
m_oBcw.m_oStream.WriteStringA(pCustomXml->m_sXmlA);
|
||||
m_oBcw.WriteItemEnd(nCurPos2);
|
||||
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
@ -9310,6 +9404,9 @@ void BinaryFileWriter::intoBindoc(const std::wstring& sDir)
|
||||
m_oBcw.m_oStream.EndRecord();
|
||||
|
||||
this->WriteTableEnd(nCurPos);
|
||||
|
||||
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -578,40 +578,51 @@ namespace BinXlsxRW{
|
||||
//SharedStrings
|
||||
if(pCell->m_oValue.IsInit())
|
||||
{
|
||||
pCell->m_oType.Init();
|
||||
const std::wstring& val = pCell->m_oValue->m_sText;
|
||||
if(L"TRUE" == val || L"FALSE" == val)
|
||||
if (pCell->m_oType.IsInit())
|
||||
{
|
||||
pCell->m_oType->SetValue(SimpleTypes::Spreadsheet::celltypeBool);
|
||||
if(L"TRUE" == val)
|
||||
if (pCell->m_oType->GetValue() == SimpleTypes::Spreadsheet::celltypeSharedString)
|
||||
{
|
||||
pCell->m_oValue->m_sText = L"1";
|
||||
aSharedStrings.push_back(pCell->m_oValue->m_sText);
|
||||
pCell->m_oValue->m_sText = std::to_wstring(aSharedStrings.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pCell->m_oValue->m_sText = L"0";
|
||||
}
|
||||
}
|
||||
else if(L"#NULL!" == val || L"#DIV/0!" == val || L"#VALUE!" == val || L"#REF!" == val || L"#NAME?" == val || L"#NUM!" == val || L"#N/A" == val)
|
||||
{
|
||||
pCell->m_oType->SetValue(SimpleTypes::Spreadsheet::celltypeError);
|
||||
pCell->m_oValue->m_sText = val;
|
||||
}
|
||||
else
|
||||
{
|
||||
//как в CsvReader - подозрительный код
|
||||
WCHAR *pEndPtr;
|
||||
wcstod(val.c_str(), &pEndPtr);
|
||||
if (0 != *pEndPtr)
|
||||
pCell->m_oType.Init();
|
||||
const std::wstring& val = pCell->m_oValue->m_sText;
|
||||
if(L"TRUE" == val || L"FALSE" == val)
|
||||
{
|
||||
// Не число
|
||||
aSharedStrings.push_back(val);
|
||||
pCell->m_oType->SetValue(SimpleTypes::Spreadsheet::celltypeSharedString);
|
||||
pCell->m_oValue->m_sText = std::to_wstring((int)aSharedStrings.size() - 1);
|
||||
pCell->m_oType->SetValue(SimpleTypes::Spreadsheet::celltypeBool);
|
||||
if(L"TRUE" == val)
|
||||
{
|
||||
pCell->m_oValue->m_sText = L"1";
|
||||
}
|
||||
else
|
||||
{
|
||||
pCell->m_oValue->m_sText = L"0";
|
||||
}
|
||||
}
|
||||
else if(L"#NULL!" == val || L"#DIV/0!" == val || L"#VALUE!" == val || L"#REF!" == val || L"#NAME?" == val || L"#NUM!" == val || L"#N/A" == val)
|
||||
{
|
||||
pCell->m_oType->SetValue(SimpleTypes::Spreadsheet::celltypeError);
|
||||
pCell->m_oValue->m_sText = val;
|
||||
}
|
||||
else
|
||||
{
|
||||
pCell->m_oValue->m_sText = val;
|
||||
//как в CsvReader - подозрительный код
|
||||
WCHAR *pEndPtr;
|
||||
wcstod(val.c_str(), &pEndPtr);
|
||||
if (0 != *pEndPtr)
|
||||
{
|
||||
// Не число
|
||||
aSharedStrings.push_back(val);
|
||||
pCell->m_oType->SetValue(SimpleTypes::Spreadsheet::celltypeSharedString);
|
||||
pCell->m_oValue->m_sText = std::to_wstring((int)aSharedStrings.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pCell->m_oValue->m_sText = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -620,7 +631,7 @@ namespace BinXlsxRW{
|
||||
pWorksheet->m_oSheetData->m_arrItems.push_back(pRow);
|
||||
}
|
||||
}
|
||||
void ChartWriter::parseCell(const std::wstring& sheet, const int& nRow, const int& nCol, const std::wstring& val, std::wstring* format = NULL)
|
||||
void ChartWriter::parseCell(const std::wstring& sheet, const int& nRow, const int& nCol, const std::wstring& val, std::wstring* format = NULL, bool bAlwaysSharedString)
|
||||
{
|
||||
std::map<std::wstring, std::map<int, std::map<int, OOX::Spreadsheet::CCell*>*>*>::const_iterator itSheets = m_mapSheets.find(sheet);
|
||||
std::map<int, std::map<int, OOX::Spreadsheet::CCell*>*>* rows = NULL;
|
||||
@ -649,6 +660,12 @@ namespace BinXlsxRW{
|
||||
if(cells->find(nCol) == cells->end())
|
||||
{
|
||||
OOX::Spreadsheet::CCell* pNewCell = parseCreateCell(nRow, nCol, val, format);
|
||||
|
||||
if (bAlwaysSharedString)
|
||||
{
|
||||
pNewCell->m_oType.Init();
|
||||
pNewCell->m_oType->SetValue(SimpleTypes::Spreadsheet::ECellTypeType::celltypeSharedString);
|
||||
}
|
||||
cells->insert(std::make_pair(nCol, pNewCell));
|
||||
}
|
||||
}
|
||||
@ -707,14 +724,14 @@ namespace BinXlsxRW{
|
||||
{
|
||||
if(nCol1 > 1)
|
||||
{
|
||||
parseCell(sheetFrom, nRow1, nCol1 - 1, std::wstring(cRangeName), NULL);
|
||||
parseCell(sheetFrom, nRow1, nCol1 - 1, std::wstring(cRangeName), NULL, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(nRow1 > 1)
|
||||
{
|
||||
parseCell(sheetFrom, nRow1 - 1, nCol1, std::wstring(cRangeName), NULL);
|
||||
parseCell(sheetFrom, nRow1 - 1, nCol1, std::wstring(cRangeName), NULL, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -751,7 +768,7 @@ namespace BinXlsxRW{
|
||||
nRow = nRow1 + *val->m_idx;
|
||||
nCol = nCol1;
|
||||
}
|
||||
parseCell(sheetFrom, nRow, nCol, *val->m_v);
|
||||
parseCell(sheetFrom, nRow, nCol, *val->m_v, NULL, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ namespace BinXlsxRW {
|
||||
OOX::Spreadsheet::CWorksheet* toXlsxGetSheet(std::vector<OOX::Spreadsheet::CWorksheet*>& arWorksheets, std::map<std::wstring, OOX::Spreadsheet::CWorksheet*>& mapWorksheets, const std::wstring& sName);
|
||||
void toXlsxSheetdata(OOX::Spreadsheet::CWorksheet* pWorksheet, const std::map<int, std::map<int, OOX::Spreadsheet::CCell*>*>& rows, std::vector<std::wstring>& aSharedStrings);
|
||||
|
||||
void parseCell(const std::wstring& sheet, const int& nRow, const int& nCol, const std::wstring& val, std::wstring* format);
|
||||
void parseCell(const std::wstring& sheet, const int& nRow, const int& nCol, const std::wstring& val, std::wstring* format, bool bAlwaysSharedString = false);
|
||||
OOX::Spreadsheet::CCell* parseCreateCell(const int& nRow, const int& nCol, const std::wstring& val, std::wstring* format);
|
||||
void parseStrRef(const OOX::Spreadsheet::CT_StrRef* pStrRef, bool bUpdateRange, const wchar_t* cRangeName);
|
||||
void parseNumRef(const OOX::Spreadsheet::CT_NumRef* pNumRef, bool bUpdateRange, const wchar_t* cRangeName);
|
||||
|
||||
@ -14,6 +14,10 @@ include(../../Common/base.pri)
|
||||
#BOOST
|
||||
include($$PWD/../../Common/3dParty/boost/boost.pri)
|
||||
|
||||
INCLUDEPATH += ../../ASCOfficeXlsFile2/source/XlsFormat
|
||||
INCLUDEPATH += ../../ASCOfficeXlsFile2/source/Common
|
||||
INCLUDEPATH += ../../Common/DocxFormat/Source/XlsbFormat
|
||||
|
||||
DEFINES += UNICODE \
|
||||
_UNICODE \
|
||||
SOLUTION_ASCOFFICEDOCXFILE2 \
|
||||
@ -37,6 +41,7 @@ SOURCES += \
|
||||
../../XlsxSerializerCom/Writer/CSVWriter.cpp \
|
||||
../../OfficeCryptReader/source/ECMACryptFile.cpp \
|
||||
../../OfficeCryptReader/source/CryptTransform.cpp \
|
||||
../BinReader/ReaderClasses.cpp \
|
||||
../BinReader/Readers.cpp \
|
||||
../BinReader/CustomXmlWriter.cpp \
|
||||
../BinReader/FileWriter.cpp
|
||||
|
||||
@ -70,8 +70,8 @@
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>D:\_Work\core\Common\3dParty\boost\build\win_32\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>D:\_Work\core\Common\3dParty\boost\build\win_32\lib;$(LibraryPath)</LibraryPath>
|
||||
<IncludePath>../../Common\3dParty\boost\build\win_32\include;$(IncludePath)</IncludePath>
|
||||
<LibraryPath>../../Common\3dParty\boost\build\win_32\lib;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(Platform)\$(Configuration)\</OutDir>
|
||||
|
||||
@ -1,28 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Common">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\Common\OfficeFileFormatChecker.h">
|
||||
<Filter>Common</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\Common\OfficeFileFormatChecker2.cpp">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Common\3dParty\pole\pole.cpp">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="OdfFileTest.cpp">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Common\DocxFormat\Source\Base\unicode_util.cpp">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Common">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\Common\OfficeFileFormatChecker.h">
|
||||
<Filter>Common</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\Common\OfficeFileFormatChecker2.cpp">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Common\3dParty\pole\pole.cpp">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="OdfFileTest.cpp">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Common\DocxFormat\Source\Base\unicode_util.cpp">
|
||||
<Filter>Common</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -52,11 +52,11 @@ public:
|
||||
std::wstring convert(std::wstring const & expr);
|
||||
|
||||
// $Лист1.$A$1 -> Лист1!$A$1
|
||||
std::wstring convert_named_ref(std::wstring const & expr, bool withTableName = true, std::wstring separator = L" ");
|
||||
std::wstring convert_named_ref(std::wstring const & expr, bool withTableName = true, std::wstring separator = L" ", bool bAbsoluteAlways = false);
|
||||
std::wstring get_table_name();
|
||||
|
||||
//a-la convert without check formula
|
||||
std::wstring convert_named_expr(std::wstring const & expr, bool withTableName = true);
|
||||
std::wstring convert_named_expr(std::wstring const & expr, bool withTableName = true, bool bAbsoluteAlways = false);
|
||||
|
||||
//Sheet2.C3:Sheet2.C19 -> Sheet2!C3:C19
|
||||
std::wstring convert_chart_distance(std::wstring const & expr);
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
|
||||
#include"../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
#include "../src/docx/xlsxconversioncontext.h"
|
||||
#include "../src/docx/xlsx_utils.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace formulasconvert {
|
||||
@ -52,30 +53,43 @@ namespace formulasconvert {
|
||||
|
||||
void split_distance_by(const std::wstring& expr, const std::wstring& by, std::vector<std::wstring>& out);
|
||||
|
||||
void replace_cells_range(std::wstring& expr, bool withTableName);
|
||||
void replace_cells_range(std::wstring& expr, bool withTableName, bool bAbsoluteAlways = false);
|
||||
bool check_formula(std::wstring& expr);
|
||||
void replace_semicolons(std::wstring& expr);
|
||||
void replace_tilda(std::wstring& expr);
|
||||
void replace_vertical(std::wstring& expr);
|
||||
void replace_space(std::wstring& expr);
|
||||
void replace_apersand(std::wstring& expr);
|
||||
|
||||
std::wstring convert_named_ref(const std::wstring& expr, bool withTableName, std::wstring separator);
|
||||
std::wstring convert_named_expr(const std::wstring& expr, bool withTableName);
|
||||
std::wstring convert_named_ref(const std::wstring& expr, bool withTableName, std::wstring separator, bool bAbsoluteAlways);
|
||||
std::wstring convert_named_expr(const std::wstring& expr, bool withTableName, bool bAbsoluteAlways);
|
||||
|
||||
static std::wstring replace_named_ref_formater(boost::wsmatch const & what);
|
||||
static std::wstring replace_named_ref_formater1(boost::wsmatch const & what);
|
||||
//static std::wstring replace_cell_range_formater(boost::wsmatch const & what);
|
||||
|
||||
void replace_named_formula(std::wstring & expr, bool w = true);
|
||||
void replace_named_ref(std::wstring & expr, bool w = true);
|
||||
void replace_named_ref(std::wstring & expr, bool withTable = true, bool bAbsoluteAlways = false);
|
||||
|
||||
bool find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref);
|
||||
bool find_first_last_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref_first,std::wstring & ref_last);
|
||||
|
||||
static bool convert_with_TableName;
|
||||
static std::wstring table_name_;
|
||||
static bool convert_with_absolute;
|
||||
static bool convert_with_TableName;
|
||||
static std::wstring table_name_;
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
static std::wstring replace_apersand_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
return L"&";
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
else
|
||||
return L"";
|
||||
}
|
||||
static std::wstring replace_semicolons_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
@ -128,6 +142,7 @@ namespace formulasconvert {
|
||||
XmlUtils::replace_all( expr, L"PROBEL", L" ");
|
||||
//XmlUtils::replace_all( expr, L"APOSTROF", L"'");
|
||||
//XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
|
||||
XmlUtils::replace_all(expr, L"APERSAND", L"&");
|
||||
}
|
||||
static void replace_tmp(std::wstring &expr)
|
||||
{
|
||||
@ -172,6 +187,10 @@ namespace formulasconvert {
|
||||
{
|
||||
result += L"PROBEL";
|
||||
}break;
|
||||
case '&':
|
||||
{
|
||||
result += L"APERSAND";
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
result += expr[pos];
|
||||
@ -242,6 +261,7 @@ namespace formulasconvert {
|
||||
};
|
||||
bool odf2oox_converter::Impl::convert_with_TableName = true;
|
||||
std::wstring odf2oox_converter::Impl::table_name_ = L"";
|
||||
bool odf2oox_converter::Impl::convert_with_absolute = false;
|
||||
|
||||
std::unordered_map<std::wstring, int> &odf2oox_converter::Impl::mapExternalLink_ = oox::xlsx_conversion_context::mapExternalLink_;
|
||||
|
||||
@ -347,7 +367,6 @@ namespace formulasconvert {
|
||||
std::wstring ref2 = sz == 7 ? what[6].str() : what[5].str();
|
||||
|
||||
XmlUtils::replace_all( sheet1, L"$", L"");
|
||||
//XmlUtils::replace_all( sheet2, L"$", L"");
|
||||
|
||||
std::wstring result;
|
||||
|
||||
@ -381,6 +400,20 @@ namespace formulasconvert {
|
||||
}
|
||||
|
||||
table_name_ = sheet1;
|
||||
|
||||
if (convert_with_absolute)
|
||||
{
|
||||
size_t col = 0, row = 0;
|
||||
oox::getCellAddressInv(ref1, col, row);
|
||||
|
||||
ref1 = oox::getCellAddress(col, row, true);
|
||||
|
||||
if (false == ref2.empty())
|
||||
{
|
||||
oox::getCellAddressInv(ref2, col, row);
|
||||
ref2 = oox::getCellAddress(col, row, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (convert_with_TableName)
|
||||
{
|
||||
@ -413,13 +446,14 @@ namespace formulasconvert {
|
||||
// [Sheet2.A1:B5] -> Sheet2!A1:B5
|
||||
// [Sheet2.A1] -> Sheet2!A1
|
||||
// [$'Sheet2 A'.$B2] -> 'Sheet2 A'!$B2
|
||||
void odf2oox_converter::Impl::replace_cells_range(std::wstring& expr, bool withTableName)
|
||||
void odf2oox_converter::Impl::replace_cells_range(std::wstring& expr, bool withTableName, bool bAbsoluteAlways)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L"#REF !", L"#REF!");
|
||||
XmlUtils::replace_all( expr, L"#REF!#REF!", L"#REF!");
|
||||
XmlUtils::replace_all( expr, L"$#REF!$#REF!", L"#REF!");
|
||||
|
||||
convert_with_TableName = withTableName;
|
||||
convert_with_absolute = bAbsoluteAlways;
|
||||
|
||||
//boost::wregex complexRef(L"\\[(?:\'([^\']*)\'#){0,1}\\[{0,1}(?:\\$){0,1}([^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)(?::(\\${0,1}[^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)){0,1}\\]{0,1}");
|
||||
boost::wregex complexRef(L"(?:(?:(?:(?:\\[\'([^\']*)\'#)|(?:\'([^\']*)\'#\\[)))|(?:\\[))\
|
||||
@ -432,13 +466,14 @@ namespace formulasconvert {
|
||||
&replace_named_ref_formater,
|
||||
boost::match_default | boost::format_all);
|
||||
}
|
||||
void odf2oox_converter::Impl::replace_named_ref(std::wstring & expr, bool withTableName)
|
||||
void odf2oox_converter::Impl::replace_named_ref(std::wstring & expr, bool withTableName, bool bAbsoluteAlways)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L"#REF !", L"#REF!");
|
||||
XmlUtils::replace_all( expr, L"#REF!#REF!", L"#REF!");
|
||||
XmlUtils::replace_all( expr, L"$#REF!$#REF!", L"#REF!");
|
||||
|
||||
convert_with_TableName = withTableName;
|
||||
convert_with_absolute = bAbsoluteAlways;
|
||||
|
||||
//boost::wregex complexRef(L"\\${0,1}([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)(?::\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)){0,1}");
|
||||
boost::wregex complexRef(L"\\[{0,1}(?:\'([^\']*)\'#){0,1}\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)(?::\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)){0,1}\\]{0,1}");
|
||||
@ -495,6 +530,17 @@ namespace formulasconvert {
|
||||
|
||||
expr = res;
|
||||
}
|
||||
void odf2oox_converter::Impl::replace_apersand(std::wstring& expr)
|
||||
{
|
||||
const std::wstring res = boost::regex_replace(
|
||||
expr,
|
||||
//boost::wregex(L"(;)|(?:\".*?\")|(?:'.*?')"),
|
||||
boost::wregex(L"(&)|(\".*?\")|('.*?')"),
|
||||
&replace_apersand_formater,
|
||||
boost::match_default | boost::format_all);
|
||||
|
||||
expr = res;
|
||||
}
|
||||
// заменить вертикальную черту во всех вхождениях в фигурных скобках, но не внутри строк
|
||||
void odf2oox_converter::Impl::replace_vertical(std::wstring& expr)
|
||||
{
|
||||
@ -531,7 +577,8 @@ namespace formulasconvert {
|
||||
replace_semicolons (workstr);
|
||||
replace_tilda (workstr);
|
||||
replace_vertical (workstr);
|
||||
|
||||
replace_apersand (workstr);
|
||||
|
||||
if (isFormula)
|
||||
{
|
||||
XmlUtils::replace_all( workstr, L"FDIST(", L"_xlfn.F.DIST(");
|
||||
@ -585,8 +632,6 @@ namespace formulasconvert {
|
||||
boost::wregex(L"('.*?')|(\".*?\")"),
|
||||
&convert_scobci, boost::match_default | boost::format_all);
|
||||
|
||||
//распарсить по диапазонам - одф-пробел, ик-эль-запятая
|
||||
|
||||
std::vector<std::wstring> distance_inp;
|
||||
std::vector<std::wstring> distance_out;
|
||||
|
||||
@ -603,11 +648,18 @@ namespace formulasconvert {
|
||||
for (size_t j = 0; j < range.size(); j++)
|
||||
{
|
||||
const std::string::size_type colon = range[j].find('.');
|
||||
cells.push_back(range[j].substr(colon + 1));
|
||||
if (sheet.size() < 1)
|
||||
|
||||
if (colon != std::wstring::npos)
|
||||
{
|
||||
sheet = range[j].substr(0, colon);
|
||||
cells.push_back(range[j].substr(colon + 1));
|
||||
|
||||
if (sheet.empty())
|
||||
{
|
||||
sheet = range[j].substr(0, colon);
|
||||
}
|
||||
}
|
||||
else
|
||||
cells.push_back(range[j]);
|
||||
}
|
||||
std::wstring cells_out;
|
||||
for (size_t j = 0; j < cells.size(); j++)
|
||||
@ -621,7 +673,7 @@ namespace formulasconvert {
|
||||
sheet = L"'" + sheet + L"'";
|
||||
}
|
||||
|
||||
distance_out.push_back(sheet + L"!" + cells_out.substr(0, cells_out.size()-1));
|
||||
distance_out.push_back((sheet.empty() ? L"" : (sheet + L"!")) + cells_out.substr(0, cells_out.size() - 1));
|
||||
}
|
||||
std::wstring result;
|
||||
|
||||
@ -634,7 +686,7 @@ namespace formulasconvert {
|
||||
|
||||
return result.substr(0, result.size() - 1);// минус последняя лишняя запятая
|
||||
}
|
||||
std::wstring odf2oox_converter::Impl::convert_named_ref(const std::wstring& expr, bool withTableName, std::wstring separator)
|
||||
std::wstring odf2oox_converter::Impl::convert_named_ref(const std::wstring& expr, bool withTableName, std::wstring separator, bool bAbsoluteAlways)
|
||||
{
|
||||
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там
|
||||
|
||||
@ -645,7 +697,7 @@ namespace formulasconvert {
|
||||
boost::wregex(L"('.*?')|(\".*?\")"),
|
||||
&convert_scobci, boost::match_default | boost::format_all);
|
||||
|
||||
replace_named_ref(workstr, withTableName);
|
||||
replace_named_ref(workstr, withTableName, bAbsoluteAlways);
|
||||
|
||||
if (separator != L" ")
|
||||
{
|
||||
@ -660,7 +712,7 @@ namespace formulasconvert {
|
||||
}
|
||||
return workstr;
|
||||
}
|
||||
std::wstring odf2oox_converter::Impl::convert_named_expr(const std::wstring& expr, bool withTableName)
|
||||
std::wstring odf2oox_converter::Impl::convert_named_expr(const std::wstring& expr, bool withTableName, bool bAbsoluteAlways)
|
||||
{
|
||||
std::wstring workstr = expr;
|
||||
|
||||
@ -679,7 +731,7 @@ namespace formulasconvert {
|
||||
&convert_scobci, boost::match_default | boost::format_all);
|
||||
|
||||
|
||||
replace_cells_range(workstr, withTableName);
|
||||
replace_cells_range(workstr, withTableName, bAbsoluteAlways);
|
||||
replace_semicolons(workstr);
|
||||
replace_vertical(workstr);
|
||||
|
||||
@ -726,13 +778,13 @@ namespace formulasconvert {
|
||||
{
|
||||
return impl_->split_distance_by(expr, by, out);
|
||||
}
|
||||
std::wstring odf2oox_converter::convert_named_ref(const std::wstring& expr, bool withTableName, std::wstring separator)
|
||||
std::wstring odf2oox_converter::convert_named_ref(const std::wstring& expr, bool withTableName, std::wstring separator, bool bAbsoluteAlways)
|
||||
{
|
||||
return impl_->convert_named_ref(expr, withTableName, separator);
|
||||
return impl_->convert_named_ref(expr, withTableName, separator, bAbsoluteAlways);
|
||||
}
|
||||
std::wstring odf2oox_converter::convert_named_expr(const std::wstring& expr, bool withTableName)
|
||||
std::wstring odf2oox_converter::convert_named_expr(const std::wstring& expr, bool withTableName, bool bAbsoluteAlways)
|
||||
{
|
||||
return impl_->convert_named_expr(expr, withTableName);
|
||||
return impl_->convert_named_expr(expr, withTableName, bAbsoluteAlways);
|
||||
}
|
||||
|
||||
std::wstring odf2oox_converter::convert_ref(std::wstring const & expr)
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "../CPSharedPtr.h"
|
||||
#include "../xml/nodetype.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../CPOptional.h"
|
||||
#include "logging.h"
|
||||
#include "../logging.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace common {
|
||||
|
||||
@ -116,6 +116,7 @@ enum ElementType
|
||||
typeDcDescription,
|
||||
typeDcSubject,
|
||||
typeDcTitle,
|
||||
typeDcLanguage,
|
||||
|
||||
typeDrawA,
|
||||
|
||||
@ -449,6 +450,9 @@ enum ElementType
|
||||
typeOfficeMetaKeyword,
|
||||
typeOfficeMetaEditingCycles,
|
||||
typeOfficeMetaEditingDuration,
|
||||
typeOfficeMetaCommon,
|
||||
typeOfficeMetaInitialCreator,
|
||||
typeOfficeMetaTemplate,
|
||||
|
||||
typeDrawBase,
|
||||
typeDrawG,
|
||||
|
||||
@ -1,327 +1,330 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stack>
|
||||
#include <cassert>
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
|
||||
namespace xml
|
||||
{
|
||||
|
||||
namespace writer
|
||||
{
|
||||
|
||||
template <class T> struct chars { };
|
||||
|
||||
template <>
|
||||
struct chars<char>
|
||||
{
|
||||
static const char eq = '=';
|
||||
static const char quote = '\"';
|
||||
static const char space = ' ';
|
||||
static const char left_brocket = '<';
|
||||
static const char right_brocket = '>';
|
||||
static const char slash = '/';
|
||||
static const char colon = ':';
|
||||
static const char amp = '&';
|
||||
static const char apos = '\'';
|
||||
static const char * cdata_open() { return "<![CDATA["; }
|
||||
static const char * cdata_close() { return "]]>"; }
|
||||
static const char * amp_str(){ return "&"; }
|
||||
static const char * left_brocket_str() { return "<"; }
|
||||
static const char * right_brocket_str() { return ">"; }
|
||||
static const char * apos_str() { return "'"; }
|
||||
static const char * quote_str() { return """; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct chars<wchar_t>
|
||||
{
|
||||
static const wchar_t eq = L'=';
|
||||
static const wchar_t quote = L'\"';
|
||||
static const wchar_t space = L' ';
|
||||
static const wchar_t left_brocket = L'<';
|
||||
static const wchar_t right_brocket = L'>';
|
||||
static const wchar_t slash = L'/';
|
||||
static const wchar_t colon = L':';
|
||||
static const wchar_t amp = L'&';
|
||||
static const wchar_t apos = L'\'';
|
||||
static const wchar_t * cdata_open() { return L"<![CDATA["; }
|
||||
static const wchar_t * cdata_close() { return L"]]>"; }
|
||||
static const wchar_t * amp_str(){ return L"&"; }
|
||||
static const wchar_t * left_brocket_str() { return L"<"; }
|
||||
static const wchar_t * right_brocket_str() { return L">"; }
|
||||
static const wchar_t * apos_str() { return L"'"; }
|
||||
static const wchar_t * quote_str() { return L"""; }
|
||||
};
|
||||
|
||||
template <class V>
|
||||
class element;
|
||||
|
||||
//
|
||||
// xml::writer class
|
||||
//
|
||||
template <class T>
|
||||
class writer
|
||||
{
|
||||
public:
|
||||
// writer must be bound to an ostream
|
||||
writer(std::basic_ostream<T>& os, bool need_header = false) : level_(0), os_(os), need_header_(need_header) {}
|
||||
~writer(void) { assert(elements_.empty()); }
|
||||
|
||||
private:
|
||||
size_t level_;
|
||||
std::basic_ostream<T>& os_; // output stream
|
||||
bool need_header_; // have we written an XML header yet?
|
||||
std::stack<element<T>*> elements_; // stack of open element tags
|
||||
|
||||
|
||||
// write XML header, if necessary
|
||||
writer& header()
|
||||
{
|
||||
if (need_header_)
|
||||
{
|
||||
// TODO
|
||||
//os_ << "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
|
||||
need_header_ = false;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// write a single character to the output stream
|
||||
writer& putc(T c)
|
||||
{
|
||||
os_.put(c);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// write a string to the output stream
|
||||
writer& puts(const T* str) {
|
||||
os_ << str;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class V>
|
||||
friend class element;
|
||||
};
|
||||
|
||||
//
|
||||
// xml::element class
|
||||
//
|
||||
template <class T>
|
||||
class element
|
||||
{
|
||||
public:
|
||||
// create a new element tag, bound to an xml::writer
|
||||
element(writer<T>& wr, std::basic_string<T, std::char_traits<T>, std::allocator<T> > const & name) : wr_(wr), name_(name)
|
||||
{
|
||||
wr_.level_++;
|
||||
check_parent();
|
||||
wr_.header().putc('<').puts(name_.c_str());
|
||||
tagopen_ = true;
|
||||
wr_.elements_.push(this);
|
||||
}
|
||||
|
||||
// close the current element tag
|
||||
~element()
|
||||
{
|
||||
if (!wr_.elements_.empty() && wr_.elements_.top() == this)
|
||||
{
|
||||
wr_.elements_.pop();
|
||||
if (tagopen_)
|
||||
wr_.putc(chars<T>::slash)
|
||||
.putc(chars<T>::right_brocket);
|
||||
else
|
||||
wr_.putc(chars<T>::left_brocket)
|
||||
.putc(chars<T>::slash)
|
||||
.puts(name_.c_str())
|
||||
.putc(chars<T>::right_brocket);
|
||||
}
|
||||
wr_.level_--;
|
||||
}
|
||||
|
||||
// write an attribute for the current element
|
||||
element& attr(const T* name, const T* value)
|
||||
{
|
||||
assert(name != 0);
|
||||
assert(value != 0);
|
||||
assert(tagopen_);
|
||||
wr_.putc(chars<T>::space)
|
||||
.puts(name)
|
||||
.putc(chars<T>::eq)
|
||||
.putc(chars<T>::quote);
|
||||
qputs(value);
|
||||
wr_.putc(chars<T>::quote);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// attr() overload for std::string type
|
||||
element& attr(const T* name, const std::basic_string<T, std::char_traits<T>, std::allocator<T> >& value)
|
||||
{
|
||||
return attr(name, value.c_str());
|
||||
}
|
||||
|
||||
// attr() function template for all streamable types
|
||||
template <class V>
|
||||
element& attr(const T* name, V value)
|
||||
{
|
||||
std::basic_stringstream<T, std::char_traits<T>, std::allocator<T> > ss;
|
||||
ss << value;
|
||||
attr(name, ss.str());
|
||||
return *this;
|
||||
}
|
||||
|
||||
// write text content for the current element
|
||||
element& contents(const T* str)
|
||||
{
|
||||
assert(str != 0);
|
||||
check_parent();
|
||||
qputs(str);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// contents() overload for std::string type
|
||||
element& contents(const std::basic_string<T, std::char_traits<T>, std::allocator<T> >& str)
|
||||
{
|
||||
return contents(str.c_str());
|
||||
}
|
||||
|
||||
// contents() function template for all streamable types
|
||||
template <class V>
|
||||
element& contents(V value)
|
||||
{
|
||||
std::basic_stringstream<T, std::char_traits<T>, std::allocator<T> > ss;
|
||||
ss << value;
|
||||
contents(ss.str());
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::basic_ostream<T>& stream()
|
||||
{
|
||||
check_parent();
|
||||
return wr_.os_;
|
||||
}
|
||||
|
||||
// write CDATA section
|
||||
element& cdata(const T * str)
|
||||
{
|
||||
assert(str != 0);
|
||||
check_parent();
|
||||
wr_.puts(chars<T>::cdata_open());
|
||||
wr_.puts(str);
|
||||
wr_.puts(chars<T>::cdata_close());
|
||||
return *this;
|
||||
}
|
||||
|
||||
// cdata() overload for std::string type
|
||||
element& cdata(const std::basic_string<T, std::char_traits<T>, std::allocator<T> >& str)
|
||||
{
|
||||
return cdata(str.c_str());
|
||||
}
|
||||
|
||||
private:
|
||||
writer<T>& wr_; // bound XML writer
|
||||
//const T* name_; // name of current element
|
||||
const std::basic_string<T, std::char_traits<T>, std::allocator<T> > name_;
|
||||
bool tagopen_; // is the element tag for this element still open?
|
||||
|
||||
// write a string quoting characters which have meaning in xml
|
||||
element& qputs(const T* str)
|
||||
{
|
||||
for (; *str; ++str)
|
||||
{
|
||||
switch (*str)
|
||||
{
|
||||
case chars<T>::amp:
|
||||
wr_.puts(chars<T>::amp_str()); break;
|
||||
|
||||
case chars<T>::left_brocket:
|
||||
wr_.puts(chars<T>::left_brocket_str()); break;
|
||||
|
||||
case chars<T>::right_brocket:
|
||||
wr_.puts(chars<T>::right_brocket_str()); break;
|
||||
|
||||
case chars<T>::apos:
|
||||
wr_.puts(chars<T>::apos_str()); break;
|
||||
|
||||
case chars<T>::quote:
|
||||
wr_.puts(chars<T>::quote_str()); break;
|
||||
|
||||
default:
|
||||
wr_.putc(*str); break;
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// check to see if we have a parent tag which needs to be closed
|
||||
void check_parent()
|
||||
{
|
||||
if (!wr_.elements_.empty() && wr_.elements_.top()->tagopen_)
|
||||
{
|
||||
wr_.putc(chars<T>::right_brocket);
|
||||
wr_.elements_.top()->tagopen_ = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
typedef xml::writer::writer<wchar_t> xml_writer;
|
||||
typedef xml::writer::element<wchar_t> xml_element;
|
||||
|
||||
#define CP_XML_WRITER(STRM) if (bool _b_ = false) {} else for (xml_writer _xml_wr_((STRM));!_b_;_b_=true)
|
||||
#define CP_XML_NODE(NAME) if (bool _b_ = false) {} else for (xml_element _xml_node_(_xml_wr_, (NAME));!_b_;_b_=true)
|
||||
#define CP_XML_ATTR(NAME, VAL) _xml_node_.attr((NAME),(VAL))
|
||||
#define CP_XML_ATTR2(NAME, VAL) _xml_node_.attr((std::wstring(NAME).c_str()),(VAL))
|
||||
#define CP_XML_CONTENT(VAL) _xml_node_.contents((VAL))
|
||||
#define CP_XML_STREAM() _xml_node_.stream()
|
||||
|
||||
#define CP_GET_XML_NODE() _xml_node_
|
||||
|
||||
#define CP_ATTR_NODE xml_element & _xml_node_
|
||||
|
||||
|
||||
|
||||
#define CP_XML_ATTR_OPT(NAME, VAL) if (VAL)CP_XML_ATTR(NAME, (*VAL))
|
||||
|
||||
#define CP_XML_NODE_SIMPLE() std::wstring NS_NAME = std::wstring(ns) + std::wstring(L":") + std::wstring(name); CP_XML_NODE(NS_NAME)
|
||||
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2019
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||
* street, Riga, Latvia, EU, LV-1050.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stack>
|
||||
#include <cassert>
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
|
||||
namespace xml
|
||||
{
|
||||
|
||||
namespace writer
|
||||
{
|
||||
|
||||
template <class T> struct chars { };
|
||||
|
||||
template <>
|
||||
struct chars<char>
|
||||
{
|
||||
static const char eq = '=';
|
||||
static const char quote = '\"';
|
||||
static const char space = ' ';
|
||||
static const char left_brocket = '<';
|
||||
static const char right_brocket = '>';
|
||||
static const char slash = '/';
|
||||
static const char colon = ':';
|
||||
static const char amp = '&';
|
||||
static const char apos = '\'';
|
||||
static const char * cdata_open() { return "<![CDATA["; }
|
||||
static const char * cdata_close() { return "]]>"; }
|
||||
static const char * amp_str(){ return "&"; }
|
||||
static const char * left_brocket_str() { return "<"; }
|
||||
static const char * right_brocket_str() { return ">"; }
|
||||
static const char * apos_str() { return "'"; }
|
||||
static const char * quote_str() { return """; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct chars<wchar_t>
|
||||
{
|
||||
static const wchar_t eq = L'=';
|
||||
static const wchar_t quote = L'\"';
|
||||
static const wchar_t space = L' ';
|
||||
static const wchar_t left_brocket = L'<';
|
||||
static const wchar_t right_brocket = L'>';
|
||||
static const wchar_t slash = L'/';
|
||||
static const wchar_t colon = L':';
|
||||
static const wchar_t amp = L'&';
|
||||
static const wchar_t apos = L'\'';
|
||||
static const wchar_t * cdata_open() { return L"<![CDATA["; }
|
||||
static const wchar_t * cdata_close() { return L"]]>"; }
|
||||
static const wchar_t * amp_str(){ return L"&"/* L"&"*/; }
|
||||
static const wchar_t * left_brocket_str() { return L"<"; }
|
||||
static const wchar_t * right_brocket_str() { return L">"; }
|
||||
static const wchar_t * apos_str() { return L"'"; }
|
||||
static const wchar_t * quote_str() { return L"""; }
|
||||
};
|
||||
|
||||
template <class V>
|
||||
class element;
|
||||
|
||||
//
|
||||
// xml::writer class
|
||||
//
|
||||
template <class T>
|
||||
class writer
|
||||
{
|
||||
public:
|
||||
// writer must be bound to an ostream
|
||||
writer(std::basic_ostream<T>& os, bool need_header = false) : level_(0), os_(os), need_header_(need_header) {}
|
||||
~writer(void) { assert(elements_.empty()); }
|
||||
|
||||
private:
|
||||
size_t level_;
|
||||
std::basic_ostream<T>& os_; // output stream
|
||||
bool need_header_; // have we written an XML header yet?
|
||||
std::stack<element<T>*> elements_; // stack of open element tags
|
||||
|
||||
|
||||
// write XML header, if necessary
|
||||
writer& header()
|
||||
{
|
||||
if (need_header_)
|
||||
{
|
||||
// TODO
|
||||
//os_ << "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
|
||||
need_header_ = false;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// write a single character to the output stream
|
||||
writer& putc(T c)
|
||||
{
|
||||
os_.put(c);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// write a string to the output stream
|
||||
writer& puts(const T* str) {
|
||||
os_ << str;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class V>
|
||||
friend class element;
|
||||
};
|
||||
|
||||
//
|
||||
// xml::element class
|
||||
//
|
||||
template <class T>
|
||||
class element
|
||||
{
|
||||
public:
|
||||
// create a new element tag, bound to an xml::writer
|
||||
element(writer<T>& wr, std::basic_string<T, std::char_traits<T>, std::allocator<T> > const & name) : wr_(wr), name_(name)
|
||||
{
|
||||
wr_.level_++;
|
||||
check_parent();
|
||||
wr_.header().putc('<').puts(name_.c_str());
|
||||
tagopen_ = true;
|
||||
wr_.elements_.push(this);
|
||||
}
|
||||
|
||||
// close the current element tag
|
||||
~element()
|
||||
{
|
||||
if (!wr_.elements_.empty() && wr_.elements_.top() == this)
|
||||
{
|
||||
wr_.elements_.pop();
|
||||
if (tagopen_)
|
||||
wr_.putc(chars<T>::slash)
|
||||
.putc(chars<T>::right_brocket);
|
||||
else
|
||||
wr_.putc(chars<T>::left_brocket)
|
||||
.putc(chars<T>::slash)
|
||||
.puts(name_.c_str())
|
||||
.putc(chars<T>::right_brocket);
|
||||
}
|
||||
wr_.level_--;
|
||||
}
|
||||
|
||||
// write an attribute for the current element
|
||||
element& attr(const T* name, const T* value)
|
||||
{
|
||||
assert(name != 0);
|
||||
assert(value != 0);
|
||||
assert(tagopen_);
|
||||
wr_.putc(chars<T>::space)
|
||||
.puts(name)
|
||||
.putc(chars<T>::eq)
|
||||
.putc(chars<T>::quote);
|
||||
qputs(value);
|
||||
wr_.putc(chars<T>::quote);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// attr() overload for std::string type
|
||||
element& attr(const T* name, const std::basic_string<T, std::char_traits<T>, std::allocator<T> >& value)
|
||||
{
|
||||
return attr(name, value.c_str());
|
||||
}
|
||||
|
||||
// attr() function template for all streamable types
|
||||
template <class V>
|
||||
element& attr(const T* name, V value)
|
||||
{
|
||||
std::basic_stringstream<T, std::char_traits<T>, std::allocator<T> > ss;
|
||||
ss << value;
|
||||
attr(name, ss.str());
|
||||
return *this;
|
||||
}
|
||||
|
||||
// write text content for the current element
|
||||
element& contents(const T* str)
|
||||
{
|
||||
assert(str != 0);
|
||||
check_parent();
|
||||
qputs(str);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// contents() overload for std::string type
|
||||
element& contents(const std::basic_string<T, std::char_traits<T>, std::allocator<T> >& str)
|
||||
{
|
||||
return contents(str.c_str());
|
||||
}
|
||||
|
||||
// contents() function template for all streamable types
|
||||
template <class V>
|
||||
element& contents(V value)
|
||||
{
|
||||
std::basic_stringstream<T, std::char_traits<T>, std::allocator<T> > ss;
|
||||
ss << value;
|
||||
contents(ss.str());
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::basic_ostream<T>& stream()
|
||||
{
|
||||
check_parent();
|
||||
return wr_.os_;
|
||||
}
|
||||
|
||||
// write CDATA section
|
||||
element& cdata(const T * str)
|
||||
{
|
||||
assert(str != 0);
|
||||
check_parent();
|
||||
wr_.puts(chars<T>::cdata_open());
|
||||
wr_.puts(str);
|
||||
wr_.puts(chars<T>::cdata_close());
|
||||
return *this;
|
||||
}
|
||||
|
||||
// cdata() overload for std::string type
|
||||
element& cdata(const std::basic_string<T, std::char_traits<T>, std::allocator<T> >& str)
|
||||
{
|
||||
return cdata(str.c_str());
|
||||
}
|
||||
|
||||
private:
|
||||
writer<T>& wr_; // bound XML writer
|
||||
//const T* name_; // name of current element
|
||||
const std::basic_string<T, std::char_traits<T>, std::allocator<T> > name_;
|
||||
bool tagopen_; // is the element tag for this element still open?
|
||||
|
||||
// write a string quoting characters which have meaning in xml
|
||||
element& qputs(const T* str)
|
||||
{
|
||||
for (; *str; ++str)
|
||||
{
|
||||
switch (*str)
|
||||
{
|
||||
case chars<T>::amp:
|
||||
wr_.puts(chars<T>::amp_str()); break;
|
||||
|
||||
case chars<T>::left_brocket:
|
||||
wr_.puts(chars<T>::left_brocket_str()); break;
|
||||
|
||||
case chars<T>::right_brocket:
|
||||
wr_.puts(chars<T>::right_brocket_str()); break;
|
||||
|
||||
case chars<T>::apos:
|
||||
wr_.puts(chars<T>::apos_str()); break;
|
||||
|
||||
case chars<T>::quote:
|
||||
wr_.puts(chars<T>::quote_str()); break;
|
||||
|
||||
default:
|
||||
wr_.putc(*str); break;
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// check to see if we have a parent tag which needs to be closed
|
||||
void check_parent()
|
||||
{
|
||||
if (!wr_.elements_.empty() && wr_.elements_.top()->tagopen_)
|
||||
{
|
||||
wr_.putc(chars<T>::right_brocket);
|
||||
wr_.elements_.top()->tagopen_ = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
typedef xml::writer::writer<wchar_t> xml_writer;
|
||||
typedef xml::writer::element<wchar_t> xml_element;
|
||||
|
||||
#define CP_XML_WRITER(STRM) if (bool _b_ = false) {} else for (xml_writer _xml_wr_((STRM));!_b_;_b_=true)
|
||||
#define CP_XML_NODE(NAME) if (bool _b_ = false) {} else for (xml_element _xml_node_(_xml_wr_, (NAME));!_b_;_b_=true)
|
||||
#define CP_XML_ATTR(NAME, VAL) _xml_node_.attr((NAME),(VAL))
|
||||
#define CP_XML_ATTR2(NAME, VAL) _xml_node_.attr((std::wstring(NAME).c_str()),(VAL))
|
||||
#define CP_XML_CONTENT(VAL) _xml_node_.contents((VAL))
|
||||
#define CP_XML_STREAM() _xml_node_.stream()
|
||||
|
||||
#define CP_GET_XML_NODE() _xml_node_
|
||||
|
||||
#define CP_ATTR_NODE xml_element & _xml_node_
|
||||
|
||||
|
||||
#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_NODE_SIMPLE() std::wstring NS_NAME = std::wstring(ns) + std::wstring(L":") + std::wstring(name); CP_XML_NODE(NS_NAME)
|
||||
|
||||
#define CP_XML_NODE_SIMPLE_NONS() CP_XML_NODE(std::wstring(name))
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -223,6 +223,7 @@ SOURCES += \
|
||||
../src/odf/datatypes/drawangle.cpp \
|
||||
../src/odf/datatypes/timeperiod.cpp \
|
||||
../src/odf/datatypes/messagetype.cpp \
|
||||
../src/odf/datatypes/stylecellprotect.cpp \
|
||||
../src/docx/xlsx_conditionalFormatting.cpp \
|
||||
../src/docx/xlsx_dxfs.cpp \
|
||||
../src/docx/docx_content_type.cpp \
|
||||
@ -488,6 +489,7 @@ HEADERS += \
|
||||
../src/odf/datatypes/charttimeunit.h \
|
||||
../src/odf/datatypes/timeperiod.h \
|
||||
../src/odf/datatypes/messagetype.h \
|
||||
./src/odf/datatypes/stylecellprotect.h \
|
||||
../src/docx/docx_content_type.h \
|
||||
../src/docx/docx_conversion_context.h \
|
||||
../src/docx/docx_conversion_state.h \
|
||||
|
||||
@ -134,5 +134,6 @@
|
||||
#include "../src/odf/datatypes/styleprint.cpp"
|
||||
#include "../src/odf/datatypes/charttimeunit.cpp"
|
||||
#include "../src/odf/datatypes/drawangle.cpp"
|
||||
#include "../src/odf/datatypes/messagetype.cpp""
|
||||
#include "../src/odf/datatypes/timeperiod.cpp""
|
||||
#include "../src/odf/datatypes/messagetype.cpp"
|
||||
#include "../src/odf/datatypes/timeperiod.cpp"
|
||||
#include "../src/odf/datatypes/stylecellprotect.cpp"
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "conversionelement.h"
|
||||
#include "logging.h"
|
||||
#include "../include/logging.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -30,9 +30,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <xml/attributes.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
|
||||
#include "docx_content_type.h"
|
||||
#include "namespaces.h"
|
||||
|
||||
@ -33,7 +33,9 @@
|
||||
|
||||
#include <string>
|
||||
#include <iosfwd>
|
||||
#include <xml/xmlelement.h>
|
||||
#include <vector>
|
||||
|
||||
#include "../../include/xml/xmlelement.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -32,9 +32,9 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <xml/utils.h>
|
||||
#include <odf/odf_document.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../../include/xml/utils.h"
|
||||
#include "../../include/odf/odf_document.h"
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
|
||||
#include "docx_conversion_context.h"
|
||||
|
||||
@ -49,8 +49,9 @@
|
||||
#include "docx_package.h"
|
||||
#include "xlsx_package.h"
|
||||
#include "oox_rels.h"
|
||||
#include "logging.h"
|
||||
#include "../../include/logging.h"
|
||||
|
||||
#include "../../../DesktopEditor/common/SystemUtils.h"
|
||||
#include "../../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
#include "../../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
|
||||
@ -744,7 +745,10 @@ void docx_conversion_context::end_document()
|
||||
get_mediaitems()->dump_rels(notes_context_.endnotesRels(), oox::endnote_place);
|
||||
|
||||
output_document_->get_word_files().set_notes(notes_context_);
|
||||
////////////////////////
|
||||
|
||||
output_document_->get_docProps_files().set_app(package::simple_element::create(L"app.xml", dump_settings_app()));
|
||||
output_document_->get_docProps_files().set_core(package::simple_element::create(L"core.xml", dump_settings_core()));
|
||||
|
||||
for (size_t i = 0; i < charts_.size(); i++)
|
||||
{
|
||||
package::chart_content_ptr content = package::chart_content::create();
|
||||
@ -755,10 +759,7 @@ void docx_conversion_context::end_document()
|
||||
output_document_->get_word_files().add_charts(content);
|
||||
|
||||
}
|
||||
////////////////////////////////
|
||||
output_document_->get_word_files().update_rels(*this);
|
||||
/////////////////////////////////////
|
||||
|
||||
}
|
||||
void docx_conversion_context::dump_bibliography()
|
||||
{
|
||||
@ -814,12 +815,185 @@ void docx_conversion_context::dump_bibliography()
|
||||
const std::wstring sFileRef = std::wstring(L"../customXml/item") + std::to_wstring(id) + L".xml";
|
||||
|
||||
output_document_->get_word_files().add_rels(relationship(sRId, sRel, sFileRef));
|
||||
|
||||
}
|
||||
std::wstring docx_conversion_context::dump_settings_app()
|
||||
{
|
||||
std::wstringstream output;
|
||||
CP_XML_WRITER(output)
|
||||
{
|
||||
CP_XML_NODE(L"Properties")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties");
|
||||
CP_XML_ATTR(L"xmlns:vt", L"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes");
|
||||
|
||||
if (!odf_document_->odf_context().DocProps().template_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"Template")
|
||||
{
|
||||
CP_XML_STREAM() << odf_document_->odf_context().DocProps().template_;
|
||||
}
|
||||
}
|
||||
if (odf_document_->odf_context().DocProps().revision_)
|
||||
{
|
||||
CP_XML_NODE(L"TotalTime")
|
||||
{
|
||||
CP_XML_STREAM() << *odf_document_->odf_context().DocProps().revision_;
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"Application")
|
||||
{
|
||||
if (!odf_document_->odf_context().DocProps().application_.empty())
|
||||
{
|
||||
CP_XML_STREAM() << odf_document_->odf_context().DocProps().application_;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
|
||||
if (sApplication.empty())
|
||||
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
|
||||
CP_XML_STREAM() << sApplication;
|
||||
#if defined(INTVER)
|
||||
std::string s = VALUE2STR(INTVER);
|
||||
CP_XML_STREAM() << L"/" << std::wstring(s.begin(), s.end());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (odf_document_->odf_context().DocProps().page_count_)
|
||||
{
|
||||
CP_XML_NODE(L"Pages")
|
||||
{
|
||||
CP_XML_STREAM() << *odf_document_->odf_context().DocProps().page_count_;
|
||||
}
|
||||
}
|
||||
if (odf_document_->odf_context().DocProps().word_count_)
|
||||
{
|
||||
CP_XML_NODE(L"Words")
|
||||
{
|
||||
CP_XML_STREAM() << *odf_document_->odf_context().DocProps().word_count_;
|
||||
}
|
||||
}
|
||||
if (odf_document_->odf_context().DocProps().character_count_)
|
||||
{
|
||||
CP_XML_NODE(L"CharactersWithSpaces")
|
||||
{
|
||||
CP_XML_STREAM() << *odf_document_->odf_context().DocProps().character_count_;
|
||||
}
|
||||
}
|
||||
if (odf_document_->odf_context().DocProps().non_whitespace_character_count_)
|
||||
{
|
||||
CP_XML_NODE(L"Characters")
|
||||
{
|
||||
CP_XML_STREAM() << *odf_document_->odf_context().DocProps().non_whitespace_character_count_;
|
||||
}
|
||||
}
|
||||
if (odf_document_->odf_context().DocProps().paragraph_count_)
|
||||
{
|
||||
CP_XML_NODE(L"Paragraphs")
|
||||
{
|
||||
CP_XML_STREAM() << *odf_document_->odf_context().DocProps().paragraph_count_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return output.str();
|
||||
}
|
||||
std::wstring docx_conversion_context::dump_settings_core()
|
||||
{
|
||||
std::wstringstream output;
|
||||
|
||||
CP_XML_WRITER(output)
|
||||
{
|
||||
CP_XML_NODE(L"cp:coreProperties")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:cp", L"http://schemas.openxmlformats.org/package/2006/metadata/core-properties");
|
||||
CP_XML_ATTR(L"xmlns:xsi", L"http://www.w3.org/2001/XMLSchema-instance");
|
||||
CP_XML_ATTR(L"xmlns:dc", L"http://purl.org/dc/elements/1.1/");
|
||||
CP_XML_ATTR(L"xmlns:dcmitype", L"http://purl.org/dc/dcmitype/");
|
||||
CP_XML_ATTR(L"xmlns:dcterms", L"http://purl.org/dc/terms/");
|
||||
|
||||
if (!odf_document_->odf_context().DocProps().creation_date_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"dcterms:created")
|
||||
{
|
||||
CP_XML_ATTR(L"xsi:type", L"dcterms:W3CDTF");
|
||||
CP_XML_STREAM() << odf_document_->odf_context().DocProps().creation_date_;
|
||||
}
|
||||
}
|
||||
if (!odf_document_->odf_context().DocProps().dc_date_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"dcterms:modified")
|
||||
{
|
||||
CP_XML_ATTR(L"xsi:type", L"dcterms:W3CDTF");
|
||||
CP_XML_STREAM() << odf_document_->odf_context().DocProps().dc_date_;
|
||||
}
|
||||
}
|
||||
if (!odf_document_->odf_context().DocProps().dc_creator_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"dc:creator")
|
||||
{
|
||||
CP_XML_STREAM() << odf_document_->odf_context().DocProps().dc_creator_;
|
||||
}
|
||||
}
|
||||
if (!odf_document_->odf_context().DocProps().dc_title_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"dc:title")
|
||||
{
|
||||
CP_XML_STREAM() << odf_document_->odf_context().DocProps().dc_title_;
|
||||
}
|
||||
}
|
||||
if (!odf_document_->odf_context().DocProps().dc_subject_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"dc:subject")
|
||||
{
|
||||
CP_XML_STREAM() << odf_document_->odf_context().DocProps().dc_subject_;
|
||||
}
|
||||
}
|
||||
if (!odf_document_->odf_context().DocProps().dc_description_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"dc:description")
|
||||
{
|
||||
CP_XML_STREAM() << odf_document_->odf_context().DocProps().dc_description_;
|
||||
}
|
||||
}
|
||||
if (!odf_document_->odf_context().DocProps().dc_language_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"dc:language")
|
||||
{
|
||||
CP_XML_STREAM() << odf_document_->odf_context().DocProps().dc_language_;
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"cp:lastModifiedBy")
|
||||
{
|
||||
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
|
||||
if (sApplication.empty())
|
||||
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
|
||||
CP_XML_STREAM() << sApplication;
|
||||
#if defined(INTVER)
|
||||
std::string s = VALUE2STR(INTVER);
|
||||
CP_XML_STREAM() << L"/" << std::wstring(s.begin(), s.end());
|
||||
#endif
|
||||
}
|
||||
if (!odf_document_->odf_context().DocProps().keyword_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"cp:keywords")
|
||||
{
|
||||
CP_XML_STREAM() << odf_document_->odf_context().DocProps().keyword_;
|
||||
}
|
||||
}
|
||||
if (odf_document_->odf_context().DocProps().revision_)
|
||||
{
|
||||
CP_XML_NODE(L"cp:revision")
|
||||
{
|
||||
CP_XML_STREAM() << *odf_document_->odf_context().DocProps().revision_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return output.str();
|
||||
}
|
||||
std::wstring docx_conversion_context::dump_settings_document()
|
||||
{
|
||||
std::wstringstream output(L"");
|
||||
std::wstringstream output;
|
||||
CP_XML_WRITER(output)
|
||||
{
|
||||
CP_XML_NODE(L"w:settings")
|
||||
@ -1210,7 +1384,7 @@ void docx_conversion_context::start_process_style_content()
|
||||
styles_context_.start();
|
||||
}
|
||||
|
||||
void docx_conversion_context::process_section(std::wostream & strm, odf_reader::style_columns * columns)//from page layout
|
||||
void docx_conversion_context::process_section(std::wostream & strm, odf_reader::style_columns *columns_page)//from page layout
|
||||
{
|
||||
if (root()->odf_context().pageLayoutContainer().linenumbering())
|
||||
{
|
||||
@ -1222,7 +1396,8 @@ void docx_conversion_context::process_section(std::wostream & strm, odf_reader::
|
||||
|
||||
oox::section_context::_section & section = get_section_context().get_last();
|
||||
|
||||
if (!columns)
|
||||
odf_reader::style_columns *columns = columns_page;
|
||||
//if (!columns)
|
||||
{
|
||||
if (const odf_reader::style_instance * secStyle = root()->odf_context().styleContainer().style_by_name(section.style_, odf_types::style_family::Section, process_headers_footers_))
|
||||
{
|
||||
@ -1279,20 +1454,35 @@ void docx_conversion_context::process_section(std::wostream & strm, odf_reader::
|
||||
}
|
||||
for (size_t i = 0; page_width > 0, i < columns->style_columns_.size(); i++)
|
||||
{
|
||||
odf_reader::style_column * col = dynamic_cast<odf_reader::style_column*>( columns->style_columns_[i].get());
|
||||
odf_reader::style_column *col = dynamic_cast<odf_reader::style_column*>( columns->style_columns_[i].get());
|
||||
if (!col) continue;
|
||||
|
||||
double width = page_width * (col->style_rel_width_ ? col->style_rel_width_->get_value() / 65535. : 0);
|
||||
|
||||
double space = col->fo_end_indent_ ? col->fo_end_indent_->get_value_unit(odf_types::length::pt) : 0;
|
||||
|
||||
if (i < columns->style_columns_.size() - 1)
|
||||
double percent = col->style_rel_width_ ? col->style_rel_width_->get_value() : 0;
|
||||
if (percent > 0x7FFE)
|
||||
{
|
||||
col = dynamic_cast<odf_reader::style_column*>( columns->style_columns_[i + 1].get());
|
||||
space += col->fo_start_indent_ ? col->fo_start_indent_->get_value_unit(odf_types::length::pt) : 0;
|
||||
//auto
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (percent > 1000.) percent /= 100.;
|
||||
|
||||
double width = page_width * percent / 100.;
|
||||
|
||||
double space_end = col->fo_end_indent_ ? col->fo_end_indent_->get_value_unit(odf_types::length::pt) : 0;
|
||||
double space_start = col->fo_start_indent_ ? col->fo_start_indent_->get_value_unit(odf_types::length::pt) : 0;
|
||||
|
||||
width -= space_end;
|
||||
width -= space_start;
|
||||
|
||||
if (i < columns->style_columns_.size() - 1)
|
||||
{
|
||||
col = dynamic_cast<odf_reader::style_column*>(columns->style_columns_[i + 1].get());
|
||||
space_start = col->fo_start_indent_ ? col->fo_start_indent_->get_value_unit(odf_types::length::pt) : 0;
|
||||
}
|
||||
|
||||
width_space.push_back(std::make_pair(width, space_start + space_end));
|
||||
}
|
||||
|
||||
width_space.push_back(std::make_pair(width, space));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1467,12 +1657,12 @@ odf_reader::style_text_properties_ptr docx_conversion_context::current_text_prop
|
||||
return cur;
|
||||
}
|
||||
|
||||
void docx_conversion_context::set_page_break_after(bool val)
|
||||
void docx_conversion_context::set_page_break_after(int val)
|
||||
{
|
||||
page_break_after_ = val;
|
||||
}
|
||||
|
||||
bool docx_conversion_context::get_page_break_after()
|
||||
int docx_conversion_context::get_page_break_after()
|
||||
{
|
||||
return page_break_after_ ;
|
||||
}
|
||||
@ -1484,12 +1674,12 @@ bool docx_conversion_context::get_page_break()
|
||||
{
|
||||
return page_break_;
|
||||
}
|
||||
void docx_conversion_context::set_page_break_before(bool val)
|
||||
void docx_conversion_context::set_page_break_before(int val)
|
||||
{
|
||||
page_break_before_ = val;
|
||||
}
|
||||
|
||||
bool docx_conversion_context::get_page_break_before()
|
||||
int docx_conversion_context::get_page_break_before()
|
||||
{
|
||||
return page_break_before_;
|
||||
}
|
||||
@ -1937,15 +2127,8 @@ void docx_conversion_context::process_page_break_after(const odf_reader::style_i
|
||||
_CP_OPT(odf_types::fo_break) fo_break_val = inst->content()->get_style_paragraph_properties()->content_.fo_break_after_;
|
||||
if (fo_break_val)
|
||||
{
|
||||
if (fo_break_val->get_type() == odf_types::fo_break::Page)
|
||||
{
|
||||
set_page_break_after(true);
|
||||
break;
|
||||
}
|
||||
else if (fo_break_val->get_type() == odf_types::fo_break::Auto)
|
||||
{
|
||||
break;
|
||||
}
|
||||
set_page_break_after(fo_break_val->get_type());
|
||||
break;
|
||||
}
|
||||
}
|
||||
inst = inst->parent();
|
||||
@ -2185,35 +2368,42 @@ void docx_conversion_context::start_text_changes (const std::wstring &id)
|
||||
|
||||
map_current_changes_.insert(std::pair<std::wstring, text_tracked_context::_state> (id, state_add));
|
||||
|
||||
if (state_.in_paragraph_ && ( state_add.type == 1 || state_add.type == 2 ))
|
||||
if ( state_add.type == 1 || state_add.type == 2 )
|
||||
{
|
||||
map_changes_iterator it = map_current_changes_.find(id);
|
||||
text_tracked_context::_state &state = it->second;
|
||||
|
||||
std::wstring format_change = L" w:date=\"" + state.date + L"\"" +
|
||||
L" w:author=\"" + state.author + L"\"" ;
|
||||
|
||||
finish_run();
|
||||
state.active = true;
|
||||
state.in_drawing = get_drawing_state_content();
|
||||
|
||||
if (state.type == 1)
|
||||
if (state_.in_paragraph_)
|
||||
{
|
||||
std::wstring format_change = L" w:date=\"" + state.date + L"\"" +
|
||||
L" w:author=\"" + state.author + L"\"";
|
||||
|
||||
output_stream() << L"<w:ins" << format_change << L" w:id=\"" << std::to_wstring(current_id_changes++) << L"\">";
|
||||
}
|
||||
|
||||
if (state.type == 2)
|
||||
{
|
||||
for (size_t i = 0 ; i < state.content.size(); i++)
|
||||
finish_run();
|
||||
state.active = true;
|
||||
state.in_drawing = get_drawing_state_content();
|
||||
|
||||
if (state.type == 1)
|
||||
{
|
||||
output_stream() << L"<w:del" << format_change << L" w:id=\"" << std::to_wstring(current_id_changes++) << L"\">";
|
||||
|
||||
output_stream() << state.content[i];
|
||||
|
||||
output_stream() << L"</w:del>";
|
||||
output_stream() << L"<w:ins" << format_change << L" w:id=\"" << std::to_wstring(current_id_changes++) << L"\">";
|
||||
}
|
||||
map_current_changes_.erase(it);
|
||||
|
||||
if (state.type == 2)
|
||||
{
|
||||
for (size_t i = 0; i < state.content.size(); i++)
|
||||
{
|
||||
output_stream() << L"<w:del" << format_change << L" w:id=\"" << std::to_wstring(current_id_changes++) << L"\">";
|
||||
|
||||
output_stream() << state.content[i];
|
||||
|
||||
output_stream() << L"</w:del>";
|
||||
}
|
||||
map_current_changes_.erase(it);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
state.in_drawing = get_drawing_state_content();
|
||||
state.out_active = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2240,87 +2430,104 @@ void docx_conversion_context::start_changes()
|
||||
change_attr += L" w:date=\"" + state.date + L"\"";
|
||||
change_attr += L" w:author=\"" + state.author + L"\"";
|
||||
change_attr += L" w:id=\"" + std::to_wstring(current_id_changes++) + L"\"";
|
||||
|
||||
if (state.type == 1)
|
||||
|
||||
if (state.out_active)
|
||||
{
|
||||
text_tracked_context_.dumpRPrInsDel_ = L"<w:ins" + change_attr + L"/>";
|
||||
}
|
||||
|
||||
if (state.type == 2)
|
||||
{
|
||||
text_tracked_context_.dumpRPrInsDel_ = L"<w:del" + change_attr + L"/>";
|
||||
}
|
||||
|
||||
if (state.type == 3 && false == state.style_name.empty())
|
||||
{
|
||||
odf_reader::style_instance * styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Paragraph, false);
|
||||
if (styleInst)
|
||||
if (state.type == 1)
|
||||
{
|
||||
odf_reader::style_paragraph_properties * props = styleInst->content()->get_style_paragraph_properties();
|
||||
odf_reader::style_text_properties * props_text = styleInst->content()->get_style_text_properties();
|
||||
|
||||
text_tracked_context_.dumpPPr_ += L"<w:pPrChange" + change_attr;
|
||||
|
||||
if (props)
|
||||
{
|
||||
props->docx_convert(*this);
|
||||
text_tracked_context_.dumpPPr_ += get_styles_context().paragraph_attr().str();
|
||||
}
|
||||
text_tracked_context_.dumpPPr_ += L">";
|
||||
|
||||
if (props) text_tracked_context_.dumpPPr_ += get_styles_context().paragraph_nodes().str();
|
||||
if (props_text)
|
||||
{
|
||||
props_text->docx_convert(*this);
|
||||
|
||||
text_tracked_context_.dumpPPr_ += L"<w:rPr>";
|
||||
text_tracked_context_.dumpPPr_ += get_styles_context().text_style().str();
|
||||
text_tracked_context_.dumpPPr_ += L"</w:rPr>";
|
||||
}
|
||||
text_tracked_context_.dumpPPr_ += L"</w:pPrChange>";
|
||||
output_stream() << L"<w:ins" + change_attr + L">";
|
||||
state.active = true;
|
||||
}
|
||||
else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Text, false))
|
||||
|
||||
if (state.type == 2)
|
||||
{
|
||||
text_tracked_context_.dumpRPr_ = L"<w:rPrChange" + change_attr + L">";
|
||||
odf_reader::style_text_properties * props = NULL;
|
||||
props = styleInst->content()->get_style_text_properties();
|
||||
if (props)
|
||||
{
|
||||
props->docx_convert(*this);
|
||||
text_tracked_context_.dumpRPr_ += get_styles_context().text_style().str();
|
||||
}
|
||||
text_tracked_context_.dumpRPr_ += L"</w:rPrChange>";
|
||||
}
|
||||
else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Table, false))
|
||||
{
|
||||
text_tracked_context_.dumpTblPr_ = L"<w:TblPrChange" + change_attr + L">";
|
||||
odf_reader::style_table_properties * props = styleInst->content()->get_style_table_properties();
|
||||
odf_reader::style_table_cell_properties * props_cell = styleInst->content()->get_style_table_cell_properties();
|
||||
if (props)
|
||||
{
|
||||
props->docx_convert(*this);
|
||||
text_tracked_context_.dumpTblPr_ += get_styles_context().table_style().str();
|
||||
}
|
||||
text_tracked_context_.dumpTblPr_ += L"</w:TblPrChange>";
|
||||
}
|
||||
else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::TableCell, false))
|
||||
{
|
||||
text_tracked_context_.dumpTcPr_ = L"<w:TcPrChange" + change_attr + L">";
|
||||
odf_reader::style_table_cell_properties * props = styleInst->content()->get_style_table_cell_properties();
|
||||
if (props)
|
||||
{
|
||||
props->docx_convert(*this);
|
||||
text_tracked_context_.dumpTcPr_ += get_styles_context().table_style().str();
|
||||
}
|
||||
text_tracked_context_.dumpTcPr_ += L"</w:TcPrChange>";
|
||||
output_stream() << L"<w:del" + change_attr + L">";
|
||||
state.active = true;
|
||||
}
|
||||
}
|
||||
else if (state.type == 3 && state.style_name.empty())
|
||||
else
|
||||
{
|
||||
if (state_.in_run_)
|
||||
text_tracked_context_.dumpRPr_ += L"<w:rPrChange" + change_attr + L"/>";
|
||||
else
|
||||
text_tracked_context_.dumpPPr_ += L"<w:pPrChange" + change_attr + L"/>";
|
||||
if (state.type == 1)
|
||||
{
|
||||
text_tracked_context_.dumpRPrInsDel_ = L"<w:ins" + change_attr + L"/>";
|
||||
}
|
||||
|
||||
if (state.type == 2)
|
||||
{
|
||||
text_tracked_context_.dumpRPrInsDel_ = L"<w:del" + change_attr + L"/>";
|
||||
}
|
||||
|
||||
if (state.type == 3 && false == state.style_name.empty())
|
||||
{
|
||||
odf_reader::style_instance * styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Paragraph, false);
|
||||
if (styleInst)
|
||||
{
|
||||
odf_reader::style_paragraph_properties * props = styleInst->content()->get_style_paragraph_properties();
|
||||
odf_reader::style_text_properties * props_text = styleInst->content()->get_style_text_properties();
|
||||
|
||||
text_tracked_context_.dumpPPr_ += L"<w:pPrChange" + change_attr;
|
||||
|
||||
if (props)
|
||||
{
|
||||
props->docx_convert(*this);
|
||||
text_tracked_context_.dumpPPr_ += get_styles_context().paragraph_attr().str();
|
||||
}
|
||||
text_tracked_context_.dumpPPr_ += L">";
|
||||
|
||||
if (props) text_tracked_context_.dumpPPr_ += get_styles_context().paragraph_nodes().str();
|
||||
if (props_text)
|
||||
{
|
||||
props_text->docx_convert(*this);
|
||||
|
||||
text_tracked_context_.dumpPPr_ += L"<w:rPr>";
|
||||
text_tracked_context_.dumpPPr_ += get_styles_context().text_style().str();
|
||||
text_tracked_context_.dumpPPr_ += L"</w:rPr>";
|
||||
}
|
||||
text_tracked_context_.dumpPPr_ += L"</w:pPrChange>";
|
||||
}
|
||||
else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Text, false))
|
||||
{
|
||||
text_tracked_context_.dumpRPr_ = L"<w:rPrChange" + change_attr + L">";
|
||||
odf_reader::style_text_properties * props = NULL;
|
||||
props = styleInst->content()->get_style_text_properties();
|
||||
if (props)
|
||||
{
|
||||
props->docx_convert(*this);
|
||||
text_tracked_context_.dumpRPr_ += get_styles_context().text_style().str();
|
||||
}
|
||||
text_tracked_context_.dumpRPr_ += L"</w:rPrChange>";
|
||||
}
|
||||
else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::Table, false))
|
||||
{
|
||||
text_tracked_context_.dumpTblPr_ = L"<w:TblPrChange" + change_attr + L">";
|
||||
odf_reader::style_table_properties * props = styleInst->content()->get_style_table_properties();
|
||||
odf_reader::style_table_cell_properties * props_cell = styleInst->content()->get_style_table_cell_properties();
|
||||
if (props)
|
||||
{
|
||||
props->docx_convert(*this);
|
||||
text_tracked_context_.dumpTblPr_ += get_styles_context().table_style().str();
|
||||
}
|
||||
text_tracked_context_.dumpTblPr_ += L"</w:TblPrChange>";
|
||||
}
|
||||
else if (styleInst = root()->odf_context().styleContainer().style_by_name(state.style_name, odf_types::style_family::TableCell, false))
|
||||
{
|
||||
text_tracked_context_.dumpTcPr_ = L"<w:TcPrChange" + change_attr + L">";
|
||||
odf_reader::style_table_cell_properties * props = styleInst->content()->get_style_table_cell_properties();
|
||||
if (props)
|
||||
{
|
||||
props->docx_convert(*this);
|
||||
text_tracked_context_.dumpTcPr_ += get_styles_context().table_style().str();
|
||||
}
|
||||
text_tracked_context_.dumpTcPr_ += L"</w:TcPrChange>";
|
||||
}
|
||||
}
|
||||
else if (state.type == 3 && state.style_name.empty())
|
||||
{
|
||||
if (state_.in_run_)
|
||||
text_tracked_context_.dumpRPr_ += L"<w:rPrChange" + change_attr + L"/>";
|
||||
else
|
||||
text_tracked_context_.dumpPPr_ += L"<w:pPrChange" + change_attr + L"/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -523,9 +523,11 @@ public:
|
||||
std::vector<std::wstring> content; //delete elements
|
||||
bool active = false;
|
||||
bool in_drawing = false;
|
||||
|
||||
bool out_active = false;
|
||||
|
||||
void clear()
|
||||
{
|
||||
out_active = false;
|
||||
type = 0;
|
||||
id.clear();
|
||||
author.clear();
|
||||
@ -793,12 +795,17 @@ public:
|
||||
_rels_type_place get_type_place();
|
||||
|
||||
void dump_bibliography();
|
||||
|
||||
std::wstring dump_settings_document();
|
||||
std::wstring dump_settings_app();
|
||||
std::wstring dump_settings_core();
|
||||
|
||||
bool next_dump_page_properties_;
|
||||
bool next_dump_section_;
|
||||
bool last_dump_page_properties_;
|
||||
|
||||
int nFormFieldId_ = 0;
|
||||
|
||||
odf_reader::odf_document *root()
|
||||
{
|
||||
return odf_document_;
|
||||
@ -853,11 +860,11 @@ public:
|
||||
|
||||
odf_reader::style_text_properties_ptr current_text_properties();
|
||||
|
||||
void set_page_break_after(bool val);
|
||||
bool get_page_break_after();
|
||||
void set_page_break_after(int val);
|
||||
int get_page_break_after();
|
||||
|
||||
void set_page_break_before(bool val);
|
||||
bool get_page_break_before();
|
||||
void set_page_break_before(int val);
|
||||
int get_page_break_before();
|
||||
|
||||
void set_page_break (bool val);
|
||||
bool get_page_break ();
|
||||
@ -994,7 +1001,7 @@ private:
|
||||
std::vector< const odf_reader::style_text_properties*> text_properties_stack_;
|
||||
}state_;
|
||||
std::vector<_context_state> keep_state_;
|
||||
|
||||
//---------------------------------------------------------
|
||||
std::wstringstream document_xml_;
|
||||
std::wstringstream styles_xml_;
|
||||
std::wstringstream fontTable_xml_;
|
||||
@ -1006,7 +1013,7 @@ private:
|
||||
std::wstringstream header_xml_;
|
||||
std::wstringstream settings_xml_;
|
||||
std::wstringstream meta_xml_;
|
||||
|
||||
//--------------------------------------------------------------
|
||||
xlsx_drawing_context_handle_ptr chart_drawing_handle_;
|
||||
|
||||
styles_context styles_context_;
|
||||
@ -1044,8 +1051,8 @@ private:
|
||||
|
||||
bool first_element_list_item_;
|
||||
|
||||
bool page_break_after_;
|
||||
bool page_break_before_;
|
||||
int page_break_after_; // 0 = false, 1 - column, 2 -page
|
||||
int page_break_before_;
|
||||
bool page_break_;
|
||||
|
||||
bool in_automatic_style_;
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "docx_drawing.h"
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
#include "../odf/datatypes/custom_shape_types_convert.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -33,9 +33,6 @@
|
||||
|
||||
#include <iosfwd>
|
||||
#include <iostream>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/attributes.h>
|
||||
|
||||
#include "oox_drawing.h"
|
||||
#include "mediaitems.h"
|
||||
|
||||
@ -509,7 +509,7 @@ docx_document::docx_document()
|
||||
relationship(L"rId3", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", L"word/document.xml" )
|
||||
);
|
||||
|
||||
rels_files_.add_rel_file( relFile );
|
||||
get_rels_files().add_rel_file( relFile );
|
||||
|
||||
}
|
||||
int docx_document::add_customXml(customXml_content_ptr customXml)
|
||||
@ -523,10 +523,10 @@ void docx_document::write(const std::wstring & RootPath)
|
||||
content_type_file_.content()->get_override().push_back( override_content_type(L"/word/numbering.xml",
|
||||
L"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml") );
|
||||
}
|
||||
customXml_files_.write (RootPath);
|
||||
word_files_.write (RootPath);
|
||||
rels_files_.write (RootPath);
|
||||
docProps_files_.write (RootPath);
|
||||
customXml_files_.write (RootPath);
|
||||
word_files_.write (RootPath);
|
||||
get_rels_files().write (RootPath);
|
||||
get_docProps_files().write (RootPath);
|
||||
content_type_file_.write(RootPath);
|
||||
}
|
||||
|
||||
|
||||
@ -34,8 +34,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <CPSharedPtr.h>
|
||||
|
||||
#include "oox_rels.h"
|
||||
#include "docx_content_type.h"
|
||||
#include "oox_package.h"
|
||||
@ -136,7 +134,7 @@ public:
|
||||
void set_fontTable (element_ptr Element);
|
||||
void set_numbering (element_ptr Element);
|
||||
void set_settings (element_ptr Element);
|
||||
bool has_numbering ();
|
||||
bool has_numbering ();
|
||||
void set_media (mediaitems_ptr & mediaitems_);
|
||||
void set_headers_footers(headers_footers & HeadersFooters);
|
||||
void set_notes (notes_context & notesContext);
|
||||
@ -185,8 +183,6 @@ private:
|
||||
docx_content_types_file content_type_file_;
|
||||
word_files word_files_;
|
||||
customXml_files customXml_files_;
|
||||
rels_files rels_files_;
|
||||
docProps_files docProps_files_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -29,11 +29,12 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include <iostream>
|
||||
|
||||
#include "docx_conversion_context.h"
|
||||
#include "logging.h"
|
||||
#include <iostream>
|
||||
#include <odf/odf_document.h>
|
||||
|
||||
#include "../../include/logging.h"
|
||||
#include "../../include/odf/odf_document.h"
|
||||
#include "../odf/odfcontext.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -46,7 +46,12 @@ struct _rect
|
||||
double x;
|
||||
double y;
|
||||
};
|
||||
|
||||
enum _anchor_rel
|
||||
{
|
||||
anchor_none = 0,
|
||||
anchor_start = 1,
|
||||
anchor_end = 2
|
||||
};
|
||||
struct drawing_object_description
|
||||
{
|
||||
bool bNotes_;
|
||||
@ -58,6 +63,7 @@ struct drawing_object_description
|
||||
|
||||
_CP_OPT(_rect) svg_rect_;
|
||||
|
||||
_anchor_rel anchor_rel_;
|
||||
std::wstring anchor_;
|
||||
double anchor_x_;
|
||||
double anchor_y_;
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
#include "hyperlinks.h"
|
||||
|
||||
#include <xml/utils.h>
|
||||
#include "../../include/xml/utils.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#include "measuredigits.h"
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <logging.h>
|
||||
|
||||
#include "../../include/logging.h"
|
||||
#include "../../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -34,14 +34,14 @@
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
#include <xml/utils.h>
|
||||
#include "../../include/xml/utils.h"
|
||||
|
||||
#include "../../Common/DocxFormat/Source/Base/Base.h"
|
||||
#include "../../Common/DocxFormat/Source/SystemUtility/File.h"
|
||||
#include "../../../Common/DocxFormat/Source/Base/Base.h"
|
||||
#include "../../../Common/DocxFormat/Source/SystemUtility/File.h"
|
||||
|
||||
#include "../../DesktopEditor/common/Directory.h"
|
||||
#include "../../DesktopEditor/raster/ImageFileFormatChecker.h"
|
||||
#include "../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
#include "../../../DesktopEditor/common/Directory.h"
|
||||
#include "../../../DesktopEditor/raster/ImageFileFormatChecker.h"
|
||||
#include "../../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -30,10 +30,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
|
||||
#include "oox_chart_axis.h"
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "oox_title.h"
|
||||
#include "oox_chart_shape.h"
|
||||
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <CPOptional.h>
|
||||
#include <CPSharedPtr.h>
|
||||
#include "../../include/CPOptional.h"
|
||||
#include "../../include/CPSharedPtr.h"
|
||||
|
||||
#include "oox_chart_shape.h"
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
|
||||
#include "oox_rels.h"
|
||||
#include "oox_chart_context.h"
|
||||
|
||||
@ -32,10 +32,10 @@
|
||||
#pragma once
|
||||
#include "oox_package.h"
|
||||
|
||||
#include <CPNoncopyable.h>
|
||||
#include "../../include/CPNoncopyable.h"
|
||||
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPSharedPtr.h>
|
||||
#include "../../include/CPScopedPtr.h"
|
||||
#include "../../include/CPSharedPtr.h"
|
||||
|
||||
#include "oox_title.h"
|
||||
#include "oox_plot_area.h"
|
||||
@ -75,9 +75,12 @@ public:
|
||||
}
|
||||
void set_3D_chart(bool val)
|
||||
{
|
||||
for (size_t i = 0 ; i < plot_area_.charts_.size(); i++)
|
||||
for (size_t i = 0 ; i < plot_area_.charts_.size(); ++i)
|
||||
{
|
||||
plot_area_.charts_[i]->is3D_ = val;
|
||||
|
||||
for (size_t j = 0; j < plot_area_.charts_[i]->series_.size(); ++j)
|
||||
plot_area_.charts_[i]->series_[j]->is3D_ = val;
|
||||
}
|
||||
}
|
||||
void set_externalData(const std::wstring & href);
|
||||
|
||||
@ -32,11 +32,9 @@
|
||||
|
||||
|
||||
#include <boost/functional.hpp>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
|
||||
#include "oox_chart_legend.h"
|
||||
|
||||
#include "oox_chart_shape.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include "../../include/CPOptional.h"
|
||||
#include "../../include/CPScopedPtr.h"
|
||||
|
||||
#include "oox_layout.h"
|
||||
|
||||
|
||||
@ -34,13 +34,13 @@
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
#include "../odf/style_text_properties.h"
|
||||
|
||||
#include "xlsx_utils.h"
|
||||
|
||||
#include "oox_chart_series.h"
|
||||
#include "../formulasconvert/formulasconvert.h"
|
||||
#include "../../formulasconvert/formulasconvert.h"
|
||||
|
||||
#include "oox_chart_shape.h"
|
||||
|
||||
@ -58,6 +58,7 @@ oox_chart_series::oox_chart_series()
|
||||
iSymbolMarkerType_ = 0;
|
||||
bCacheOnly_ = false;
|
||||
labelPosEnabled_ = true;
|
||||
is3D_ = false;
|
||||
}
|
||||
void oox_chart_series::setName(const std::wstring &value)
|
||||
{
|
||||
@ -571,10 +572,30 @@ void oox_bar_series::oox_serialize(std::wostream & _Wostream)
|
||||
CP_XML_NODE(L"c:ser")
|
||||
{
|
||||
oox_serialize_common(CP_XML_STREAM());
|
||||
|
||||
if (is3D_)
|
||||
{
|
||||
CP_XML_NODE(L"c:shape")
|
||||
{
|
||||
switch (iSolidType.get_value_or(0))
|
||||
{
|
||||
case 1: CP_XML_ATTR(L"val", L"cylinder"); break;
|
||||
case 2: CP_XML_ATTR(L"val", L"cone"); break;
|
||||
case 3: CP_XML_ATTR(L"val", L"pyramid"); break;
|
||||
case 0:
|
||||
default: CP_XML_ATTR(L"val", L"box"); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void oox_bar_series::set_properties(std::vector<odf_reader::_property> g)
|
||||
{
|
||||
oox_chart_series::set_properties(g);
|
||||
|
||||
odf_reader::GetProperty(g, L"solid-type", iSolidType);
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
_CP_PTR(oox_chart_series) oox_line_series::create()
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <CPOptional.h>
|
||||
|
||||
#include "../odf/chart_objects.h"
|
||||
|
||||
#include "oox_chart_values.h"
|
||||
@ -55,6 +55,8 @@ public:
|
||||
|
||||
virtual void oox_serialize(std::wostream & _Wostream) = 0;
|
||||
|
||||
bool is3D_;
|
||||
|
||||
bool labelPosEnabled_;
|
||||
_oox_chart_values values_[5]; //cat, common, x, y, bubble,
|
||||
|
||||
@ -78,6 +80,8 @@ public:
|
||||
|
||||
odf_reader::chart::series content_;
|
||||
|
||||
virtual void set_properties(std::vector<odf_reader::_property> g) {}
|
||||
|
||||
//extLst (Chart Extensibility) §21.2.2.64
|
||||
//idx (Index) §21.2.2.84
|
||||
//order (Order) §21.2.2.128
|
||||
@ -95,7 +99,11 @@ public:
|
||||
|
||||
static oox_series_ptr create();
|
||||
|
||||
virtual void set_properties(std::vector<odf_reader::_property> g);
|
||||
|
||||
virtual void oox_serialize(std::wostream & _Wostream);
|
||||
|
||||
_CP_OPT(int) iSolidType;
|
||||
};
|
||||
//cat (Category Axis Data) §21.2.2.24
|
||||
//errBars (Error Bars) §21.2.2.55
|
||||
|
||||
@ -30,8 +30,7 @@
|
||||
*
|
||||
*/
|
||||
#include <boost/functional.hpp>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
|
||||
#include "oox_chart_shape.h"
|
||||
#include "oox_drawing.h"
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include "../../include/CPOptional.h"
|
||||
#include "../../include/CPScopedPtr.h"
|
||||
|
||||
#include "../odf/chart_objects.h"
|
||||
#include "oox_drawing_fills.h"
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <CPOptional.h>
|
||||
#include "../../include/CPOptional.h"
|
||||
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -33,9 +33,9 @@
|
||||
#include "oox_conversion_context.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <xml/utils.h>
|
||||
#include <odf/odf_document.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../../include/xml/utils.h"
|
||||
#include "../../include/odf/odf_document.h"
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
|
||||
#include "../odf/odfcontext.h"
|
||||
#include "../odf/style_text_properties.h"
|
||||
@ -44,7 +44,7 @@
|
||||
namespace cpdoccore {
|
||||
namespace oox
|
||||
{
|
||||
void forms_context::start_element (int type)
|
||||
void forms_context::start_element (_form_type type)
|
||||
{
|
||||
current_state_.clear();
|
||||
|
||||
|
||||
@ -60,15 +60,32 @@ namespace odf_reader
|
||||
typedef boost::shared_ptr<office_element> office_element_ptr;
|
||||
};
|
||||
|
||||
namespace oox {
|
||||
namespace oox
|
||||
{
|
||||
enum _form_type
|
||||
{
|
||||
formNone = 0,
|
||||
formButton = 1,
|
||||
formLabel = 2,
|
||||
formCheckbox = 3,
|
||||
formCombobox = 4,
|
||||
formListbox = 5,
|
||||
formDateTime = 6,
|
||||
formSpin = 7,
|
||||
formScroll = 8,
|
||||
formFrame = 9,
|
||||
formImage = 10,
|
||||
formText = 11
|
||||
};
|
||||
class forms_context
|
||||
{
|
||||
public:
|
||||
|
||||
struct _state
|
||||
{
|
||||
std::wstring id;
|
||||
std::wstring name;
|
||||
int type = 0; //enum?
|
||||
_form_type type;
|
||||
std::wstring label;
|
||||
std::wstring uuid;
|
||||
std::wstring value;
|
||||
@ -78,7 +95,7 @@ public:
|
||||
|
||||
void clear()
|
||||
{
|
||||
type = 0;
|
||||
type = formNone;
|
||||
id.clear();
|
||||
name.clear();
|
||||
label.clear();
|
||||
@ -90,7 +107,7 @@ public:
|
||||
};
|
||||
forms_context(){}
|
||||
|
||||
void start_element (int type);
|
||||
void start_element (_form_type type);
|
||||
void set_id (const std::wstring& id);
|
||||
void set_name (const std::wstring& name);
|
||||
void set_label (const std::wstring& label);
|
||||
|
||||
@ -29,10 +29,7 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <CPOptional.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
|
||||
#include "oox_data_labels.h"
|
||||
#include "oox_chart_shape.h"
|
||||
|
||||
@ -36,9 +36,9 @@
|
||||
#include <vector>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include <CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <xml/attributes.h>
|
||||
#include "../../include/CPOptional.h"
|
||||
#include "../../include/CPScopedPtr.h"
|
||||
#include "../../include/xml/attributes.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
|
||||
@ -33,8 +33,7 @@
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include "oox_drawing.h"
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
#include "../odf/datatypes/custom_shape_types_convert.h"
|
||||
|
||||
using namespace cpdoccore;
|
||||
|
||||
@ -33,9 +33,6 @@
|
||||
|
||||
#include <iosfwd>
|
||||
#include <iostream>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/attributes.h>
|
||||
|
||||
#include "mediaitems.h"
|
||||
#include "oox_drawing_fills.h"
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
#include "oox_drawing_fills.h"
|
||||
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -32,12 +32,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <CPOptional.h>
|
||||
#include <CPSharedPtr.h>
|
||||
|
||||
#include "../odf/datatypes/lengthorpercent.h"
|
||||
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
|
||||
#include "oox_layout.h"
|
||||
#include <boost/functional.hpp>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
#include "../odf/style_text_properties.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -32,8 +32,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
|
||||
#include "../odf/chart_objects.h"
|
||||
|
||||
|
||||
@ -34,14 +34,14 @@
|
||||
|
||||
#include <boost/ref.hpp>
|
||||
|
||||
#include <utf8cpp/utf8.h>
|
||||
#include "../../include/utf8cpp/utf8.h"
|
||||
|
||||
#include "mediaitems.h"
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
#include "../../DesktopEditor/common/SystemUtils.h"
|
||||
#include "../../DesktopEditor/graphics/pro/Image.h"
|
||||
#include "../../DesktopEditor/raster/ImageFileFormatChecker.h"
|
||||
#include "../../Common/DocxFormat/Source/Base/Base.h"
|
||||
#include "../../../DesktopEditor/common/File.h"
|
||||
#include "../../../DesktopEditor/common/SystemUtils.h"
|
||||
#include "../../../DesktopEditor/graphics/pro/Image.h"
|
||||
#include "../../../DesktopEditor/raster/ImageFileFormatChecker.h"
|
||||
#include "../../../Common/DocxFormat/Source/Base/Base.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
@ -312,8 +312,11 @@ simple_element_ptr simple_element::create(const std::wstring & FileName, const s
|
||||
return boost::make_shared<simple_element>(FileName, Content);
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
docProps_files::docProps_files()
|
||||
{
|
||||
|
||||
void core_file::write(const std::wstring & RootPath)
|
||||
}
|
||||
std::wstring docProps_files::create_core()
|
||||
{
|
||||
std::wstringstream resStream;
|
||||
|
||||
@ -321,16 +324,13 @@ void core_file::write(const std::wstring & RootPath)
|
||||
L"xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" "
|
||||
L"xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" >";
|
||||
|
||||
//resStream << L"<dc:creator>ONLYOFFICE</dc:creator>";
|
||||
//resStream << L"<cp:lastModifiedBy>ONLYOFFICE</cp:lastModifiedBy>";
|
||||
resStream << L"<cp:revision>1</cp:revision>";
|
||||
resStream << L"</cp:coreProperties>";
|
||||
|
||||
simple_element elm(L"core.xml", resStream.str());
|
||||
elm.write(RootPath);
|
||||
return resStream.str();
|
||||
}
|
||||
|
||||
void app_file::write(const std::wstring & RootPath)
|
||||
std::wstring docProps_files::create_app()
|
||||
{
|
||||
std::wstringstream resStream;
|
||||
|
||||
@ -348,33 +348,31 @@ void app_file::write(const std::wstring & RootPath)
|
||||
#endif
|
||||
resStream << L"</Application></Properties>";
|
||||
|
||||
simple_element elm(L"app.xml", resStream.str());
|
||||
elm.write(RootPath);
|
||||
return resStream.str();
|
||||
}
|
||||
|
||||
////////////
|
||||
|
||||
docProps_files::docProps_files()
|
||||
void docProps_files::set_app(element_ptr Element)
|
||||
{
|
||||
|
||||
app_ = Element;
|
||||
}
|
||||
void docProps_files::set_core(element_ptr Element)
|
||||
{
|
||||
core_ = Element;
|
||||
}
|
||||
|
||||
void docProps_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"docProps";
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
core_.write(path);
|
||||
app_.write(path);
|
||||
if (!core_) core_ = simple_element::create(L"core.xml", create_core());
|
||||
if (!app_) app_ = simple_element::create(L"app.xml", create_app());
|
||||
|
||||
core_->write(path);
|
||||
app_->write(path);
|
||||
}
|
||||
|
||||
////////////
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
media::media(mediaitems_ptr & _mediaitems, NSFonts::IApplicationFonts *pAppFonts) : mediaItems_(_mediaitems), appFonts_(pAppFonts)
|
||||
{
|
||||
}
|
||||
|
||||
void media::write(const std::wstring & RootPath)
|
||||
{
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"media";
|
||||
|
||||
@ -29,12 +29,13 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#ifndef _CPDOCCORE_OOX_PACKAGE_H_75f74d15
|
||||
#define _CPDOCCORE_OOX_PACKAGE_H_75f74d15
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <CPSharedPtr.h>
|
||||
#include <CPNoncopyable.h>
|
||||
|
||||
#include "../../include/CPSharedPtr.h"
|
||||
#include "../../include/CPNoncopyable.h"
|
||||
#include "../../include/CPOptional.h"
|
||||
|
||||
#include "docx_content_type.h"
|
||||
#include "oox_rels.h"
|
||||
@ -192,39 +193,35 @@ public:
|
||||
static _CP_PTR(chart_content) create();
|
||||
private:
|
||||
std::wstringstream content_;
|
||||
rels_file_ptr rels_;
|
||||
rels_file_ptr rels_;
|
||||
};
|
||||
//------------------------------------------------------------------------
|
||||
class document : public element
|
||||
{
|
||||
public:
|
||||
virtual content_types_file & get_content_types_file() = 0;
|
||||
};
|
||||
|
||||
class core_file : public element
|
||||
{
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
};
|
||||
|
||||
class app_file : public element
|
||||
{
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
};
|
||||
|
||||
class docProps_files : public element
|
||||
{
|
||||
public:
|
||||
docProps_files();
|
||||
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
void set_app(element_ptr Element);
|
||||
void set_core(element_ptr Element);
|
||||
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
private:
|
||||
core_file core_;
|
||||
app_file app_;
|
||||
std::wstring create_app();
|
||||
std::wstring create_core();
|
||||
|
||||
element_ptr core_;
|
||||
element_ptr app_;
|
||||
};
|
||||
class document : public element
|
||||
{
|
||||
public:
|
||||
virtual content_types_file & get_content_types_file() = 0;
|
||||
docProps_files & get_docProps_files() { return docProps_files_; }
|
||||
rels_files & get_rels_files() { return rels_files_; }
|
||||
private:
|
||||
docProps_files docProps_files_;
|
||||
rels_files rels_files_;
|
||||
};
|
||||
|
||||
class media : public element
|
||||
@ -269,4 +266,3 @@ private:
|
||||
} // namespace oox
|
||||
} // namespace cpdoccore
|
||||
|
||||
#endif
|
||||
|
||||
@ -33,14 +33,15 @@
|
||||
#include "oox_plot_area.h"
|
||||
|
||||
#include <random>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include "../odf/style_text_properties.h"
|
||||
|
||||
#include "oox_chart_shape.h"
|
||||
#include "../../ASCOfficeOdfFile/src/odf/datatypes/chartclass.h"
|
||||
|
||||
#include "../odf/datatypes/chartclass.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -32,8 +32,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
|
||||
#include "oox_types_chart.h"
|
||||
#include "oox_chart_axis.h"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user