mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Compare commits
999 Commits
core-windo
...
core-win-6
| Author | SHA1 | Date | |
|---|---|---|---|
| d9986d09cd | |||
| bd67f4bf1c | |||
| 475bfaf93d | |||
| 1a8af4d8ed | |||
| cdf8dc7a4c | |||
| d71552bddd | |||
| 548c5ab608 | |||
| 6a01384023 | |||
| d70f36e36d | |||
| f65984f079 | |||
| 5b48a7a330 | |||
| 1496aece57 | |||
| 60cf51ad0d | |||
| 8e7231b322 | |||
| 2b339b6842 | |||
| fb0dbfc231 | |||
| 756613e883 | |||
| ede03fafea | |||
| bdec91bfd5 | |||
| 260c2edd21 | |||
| 3eeec8fc67 | |||
| ba6c7e8151 | |||
| 41a213491e | |||
| b599a6bc43 | |||
| a0fd139027 | |||
| 48852bc618 | |||
| 20b781cb7e | |||
| 704b3b709f | |||
| e4674915c2 | |||
| 51fe936e5f | |||
| d8b177411f | |||
| 717b628055 | |||
| e4f94646b6 | |||
| dcec7447e4 | |||
| 5f12552f78 | |||
| d293769c1f | |||
| b45e772a50 | |||
| fdb7716abc | |||
| f72d6dfe0e | |||
| 23029a6a92 | |||
| eda8e4d13f | |||
| 64f578e59f | |||
| 16c57b50cc | |||
| 83c0ba9dab | |||
| a2443dadeb | |||
| 789bb1d4b3 | |||
| 4138ae5ce2 | |||
| 239b5dbf11 | |||
| c046776b9c | |||
| 055a02570b | |||
| e7bbbec0de | |||
| 1e2e5996f3 | |||
| 875717acd4 | |||
| 033feeaf9d | |||
| de336e5f96 | |||
| 82b3dbdae6 | |||
| d1227f7759 | |||
| 4d134387f9 | |||
| 3f8600dfb7 | |||
| 511f043d63 | |||
| 69a41343c2 | |||
| 578327bab6 | |||
| 52908908a5 | |||
| 24d9b99a44 | |||
| dce58b628f | |||
| f42cb4580c | |||
| 52777e36cb | |||
| 7b7e9f3e6e | |||
| d39fa156e7 | |||
| 48bf40919c | |||
| fd53a987be | |||
| b4d298542a | |||
| bae854027b | |||
| 9723c379dd | |||
| e8d8b2e56c | |||
| adb84b0f05 | |||
| a4ee30d031 | |||
| e05194b277 | |||
| 21f7f6ed5b | |||
| 80863ae25b | |||
| 07562a9582 | |||
| 6da196e426 | |||
| d220cc8c79 | |||
| f53c3d9f50 | |||
| fa98f22e3d | |||
| e01c09bcc9 | |||
| 069544bf6c | |||
| b0f0f656af | |||
| 99191e65b0 | |||
| fb41720817 | |||
| 406c290be4 | |||
| 5ae4d7f819 | |||
| e69c1677b2 | |||
| 4d836c180a | |||
| e08b6542d4 | |||
| e1340c63ec | |||
| 4b122c0b94 | |||
| 867438833b | |||
| 8b80aa94b7 | |||
| f960fc60bb | |||
| 64213746b0 | |||
| 09941c67ac | |||
| c2605bb582 | |||
| ab2703c825 | |||
| 08ce8cb3f5 | |||
| 5efe043ab3 | |||
| f2af1ccd36 | |||
| 113d5b4ca3 | |||
| d3461dd3cb | |||
| e95a0fb765 | |||
| c5ce1e27e4 | |||
| 7ecc7fa1df | |||
| c46cd9e6e5 | |||
| e299e59d11 | |||
| 1e0f4d6fdb | |||
| 4dae8f50fa | |||
| 9cc5ed1db0 | |||
| 6d1dd9c420 | |||
| a038e1562f | |||
| 549e3dc579 | |||
| 8440b18223 | |||
| 9c7a03fdc5 | |||
| 9272b27a69 | |||
| ef57330a79 | |||
| d35619eeae | |||
| b38c552cc5 | |||
| 1b91ee579c | |||
| 337c92e522 | |||
| 8fe1eb7525 | |||
| 1deb2a6905 | |||
| 470eddf2b1 | |||
| 69a787411c | |||
| 22f986295f | |||
| 86d2bde83b | |||
| 07041d60f6 | |||
| a5466ab740 | |||
| dfd54ff53f | |||
| 6ec7d77e19 | |||
| 3813be21c7 | |||
| 356ccba104 | |||
| 68c8c0cb29 | |||
| 3044d1122a | |||
| fb00ba7ecb | |||
| ab0c5703a5 | |||
| e22b63347f | |||
| 9dd115ec56 | |||
| 438ba3aded | |||
| 29b002ca80 | |||
| 34083d996b | |||
| 244d549cf8 | |||
| ef96571879 | |||
| 7a27150de6 | |||
| 2197fddb7b | |||
| d31344d7d3 | |||
| f7617b42cb | |||
| 8312cce2c3 | |||
| dc89e1d484 | |||
| 17f4903347 | |||
| ebdfb2f785 | |||
| ec2901bf48 | |||
| f9e87624c0 | |||
| 5f0e6349cc | |||
| 3bdf44b8c7 | |||
| d586698025 | |||
| eb6fb03ca5 | |||
| ad40f51dee | |||
| 5e60456fc1 | |||
| 1f9e3f4fd8 | |||
| 334620cd5a | |||
| 4a5fca5ccf | |||
| 828df16fe5 | |||
| 66dae03919 | |||
| 114a01f364 | |||
| 2ddaf33156 | |||
| 1af37af850 | |||
| b58026ea66 | |||
| 09a8a6794a | |||
| 941cbe4f9b | |||
| 668d0c2abf | |||
| 66db5b09e6 | |||
| e7dae4b381 | |||
| 7dbbacf336 | |||
| f43a0bbfe2 | |||
| 746c228261 | |||
| d8c7d41462 | |||
| 4a9abce180 | |||
| a78711a19c | |||
| b69051a5b4 | |||
| 04e4f1adae | |||
| 6e15370af2 | |||
| 57465b60bf | |||
| 24d58fe189 | |||
| 56bb39f716 | |||
| 60bcca0090 | |||
| 92ce863bdf | |||
| 48d4b72d4b | |||
| 85de7ec7a6 | |||
| 9e6d4950c2 | |||
| cb4befa078 | |||
| ac1292a17a | |||
| 007a984c36 | |||
| d3d3180402 | |||
| fa9c096f3c | |||
| e1ec9d942e | |||
| 4acaa75b06 | |||
| 431115ef48 | |||
| 2d66d9902e | |||
| 206dd12a47 | |||
| e8d3059fe8 | |||
| f624f731de | |||
| ed373b7e2d | |||
| a67eb5644d | |||
| 5040220d82 | |||
| 4f0b889f04 | |||
| c94768902b | |||
| f575947c03 | |||
| 16bdbafa75 | |||
| 089871d3ae | |||
| 765677d952 | |||
| 6afc38c899 | |||
| a43639587f | |||
| 46d022388d | |||
| 31363e8f83 | |||
| e1286e4b73 | |||
| 0366bcb341 | |||
| 452f717e0e | |||
| ab3add9577 | |||
| 54939bca61 | |||
| 7ccde9c777 | |||
| 6bdfa26c7e | |||
| a5bae64959 | |||
| 4d04a0d649 | |||
| fb7af5b902 | |||
| 77172fb39c | |||
| 78ecdc676c | |||
| bbccdf009b | |||
| 4b26066377 | |||
| 8742163d51 | |||
| 212753f831 | |||
| 903236d890 | |||
| 15bd732b22 | |||
| 3e86bf7644 | |||
| d6cd7c30f5 | |||
| 89b384abfe | |||
| f54baf3aa8 | |||
| b2184f7167 | |||
| 3a10eabfe9 | |||
| f9e80f3602 | |||
| 80b1e5e886 | |||
| d1a7800f36 | |||
| e223ffd0db | |||
| b140f4b521 | |||
| 2d570818be | |||
| 1462f08825 | |||
| 92fb4ac40b | |||
| 2bf55b7c8b | |||
| cf2159cd54 | |||
| decfeec7a1 | |||
| 50f47caea9 | |||
| 89cd81ecfd | |||
| 8df6286e80 | |||
| e947c91a7b | |||
| ef53ac4c63 | |||
| f50dd716ad | |||
| 54d0260ea2 | |||
| 2577365e08 | |||
| 792a722063 | |||
| 00df026108 | |||
| 56a4e80c83 | |||
| a7a78a09c1 | |||
| 6f93eeae69 | |||
| be45d169d7 | |||
| 0fc749f839 | |||
| 03267ba2ec | |||
| b0adc188a2 | |||
| 048fbc4b18 | |||
| c0a061f2cb | |||
| 0296a6ef33 | |||
| dcee112745 | |||
| 65709f9cc2 | |||
| bf5c41b9a0 | |||
| 66b45dba7c | |||
| 65e7372cf7 | |||
| 2ce5708599 | |||
| 1ea27ad7f8 | |||
| 48d94d24eb | |||
| f5c569ab2a | |||
| 2e61fcfdd9 | |||
| 3df883cbe8 | |||
| 0ed3f740b7 | |||
| af2e76aea6 | |||
| 6593230d48 | |||
| e02c72b564 | |||
| c2964f92af | |||
| 15fb3a4f4e | |||
| cff1836571 | |||
| cb57db3c8a | |||
| d22fb105b6 | |||
| 89aba918bc | |||
| 47c1e6f637 | |||
| f5284c967b | |||
| d465e29a0f | |||
| f43ef621cb | |||
| 2f9a8eb77f | |||
| a70087e1f2 | |||
| c3da9a66a1 | |||
| f907a90be7 | |||
| f65a27cf86 | |||
| ed59c2b998 | |||
| 925bca7149 | |||
| c9f2315186 | |||
| 5818f4997b | |||
| 691042c507 | |||
| d8f34224ca | |||
| dfe4541f43 | |||
| 3fa3a52c89 | |||
| 665783a6c5 | |||
| 0b15c31487 | |||
| 44fdbf6df4 | |||
| 582fce4ca1 | |||
| bde723c5cb | |||
| 97fb316248 | |||
| a607282285 | |||
| 62ea2bbc46 | |||
| 4071fa315b | |||
| 82eae7fc3e | |||
| 8efed345b0 | |||
| f5dcb1bed7 | |||
| 89ce79dafc | |||
| 6b4695fc3a | |||
| bed884007c | |||
| 1aa0b03901 | |||
| e2ada4ca61 | |||
| d87649f08e | |||
| 3982ac06d2 | |||
| 0a5d0af882 | |||
| 08e97b4a68 | |||
| c4447d7396 | |||
| c55af15ccd | |||
| 333d2fdbf0 | |||
| a2bbb1640c | |||
| 7388bf871f | |||
| 493238d656 | |||
| ea8dc009c9 | |||
| 9ade820313 | |||
| 358c1613ad | |||
| b3a83ad699 | |||
| 8d4e78ed40 | |||
| bde2c73f64 | |||
| 66fe9e6447 | |||
| f6d745cd25 | |||
| 002d30454c | |||
| ae2e9a5f26 | |||
| c985d1e0a2 | |||
| 5aaf90ebf2 | |||
| ebb9c89a0a | |||
| c4765e9f2e | |||
| 3ff5233ea4 | |||
| 4c7ab6e616 | |||
| a88ad0c279 | |||
| cf5458c761 | |||
| 9115edbd78 | |||
| 3f18f96171 | |||
| 8a75916944 | |||
| da45eb4f33 | |||
| 59d75ed148 | |||
| ccc4d751d0 | |||
| a020d3dbf9 | |||
| 7852b7fbe8 | |||
| a64fd8792d | |||
| 32448298a3 | |||
| b3384f1466 | |||
| 93274395a9 | |||
| 2726e14445 | |||
| 75e32a1562 | |||
| 8c2637b89c | |||
| ef389872df | |||
| 6fc611fdfc | |||
| 0cabb63336 | |||
| f501bf7930 | |||
| 7b617dc9e9 | |||
| 245f989ae3 | |||
| 429729b979 | |||
| d709652992 | |||
| 776d799fd2 | |||
| a975cb8261 | |||
| c932b5af26 | |||
| 423e8dda86 | |||
| afcf6b079e | |||
| 3ed2224f93 | |||
| 5307855120 | |||
| 3c9a91af45 | |||
| 9f06f94c93 | |||
| 4954ef2934 | |||
| 721e8800f1 | |||
| ef8e5cab6d | |||
| 028e58ad51 | |||
| 424e0e34cc | |||
| d8988cd101 | |||
| 440a884c0a | |||
| 449bab1a70 | |||
| c1e5e33691 | |||
| 8c7515443a | |||
| 1d16f4ab8f | |||
| 122a5cd056 | |||
| b0994759e7 | |||
| 118f1c5736 | |||
| b65703ceb1 | |||
| c08c960c96 | |||
| 02ece25af8 | |||
| 435a27f6d9 | |||
| 85ea22048a | |||
| 87ae0b38fa | |||
| b93d463469 | |||
| 0aa59b0d92 | |||
| 3dbcce8c36 | |||
| cc9459359f | |||
| 465e70759b | |||
| 9f6c833af5 | |||
| f4d16b0d61 | |||
| 398dc42bb2 | |||
| 69b4a09475 | |||
| ab360be66a | |||
| 98285c225d | |||
| bab6e40c2b | |||
| 539cb2f355 | |||
| 64d6c3c872 | |||
| 7c9be7e2eb | |||
| bad2992903 | |||
| d405cd4e83 | |||
| f632855006 | |||
| 48641d5bde | |||
| d88ae6d3f4 | |||
| e9ad1202ff | |||
| 1fc9280ab3 | |||
| 9e639ec68f | |||
| 28ebf5aaa6 | |||
| 8f5967356d | |||
| bc7d73667d | |||
| a434ae2cc4 | |||
| 7e52ebca48 | |||
| 4925b47002 | |||
| afdaacb226 | |||
| 9f98f07f23 | |||
| 9e1a0e365f | |||
| 39e2b69b8e | |||
| 58c00745a7 | |||
| 4015e8ba4d | |||
| 276af55699 | |||
| ebdfcbd7ee | |||
| 867c09c85d | |||
| cd12777c68 | |||
| 0708c1f45a | |||
| ee577e629a | |||
| f230dc2555 | |||
| 11c9d74e68 | |||
| d61a955c38 | |||
| acfb96e3c3 | |||
| d2e3cc47f2 | |||
| 4f2f164af9 | |||
| 8addd6cb04 | |||
| 92cda5bc80 | |||
| 1a377d8738 | |||
| ed3e107db5 | |||
| 64d8c659bc | |||
| 3debba45b8 | |||
| b8ad1797f0 | |||
| 48587f55b3 | |||
| a505ae391d | |||
| c389801937 | |||
| 24214cb561 | |||
| b19191b286 | |||
| 77f8ab6875 | |||
| 6fc6f9ead3 | |||
| 270c1fa2ac | |||
| f76a03fab8 | |||
| 09e6d3f760 | |||
| 90d8055bcb | |||
| 01ba3b4182 | |||
| ddb67584b8 | |||
| 38ce5586bb | |||
| f6d9ce83f0 | |||
| 03edd40850 | |||
| 9ff87b3c6b | |||
| 645cbef1ef | |||
| 02238f7eea | |||
| 907e00a3ac | |||
| 2470bfd335 | |||
| 3ae52bd221 | |||
| 227d4f18d6 | |||
| 36bdbad685 | |||
| 525b828540 | |||
| f64ee80a1a | |||
| f6402813c4 | |||
| 224ac7d6e2 | |||
| 2e2bd8989d | |||
| 8f434efb95 | |||
| 244dafb02b | |||
| 149a1bdbd5 | |||
| a79d9041bc | |||
| 3954c42602 | |||
| 29dc0aee32 | |||
| d805972d6d | |||
| 549d5a46a6 | |||
| 9e867be756 | |||
| 771bf2d55c | |||
| 3c58cd96fc | |||
| e50864fa98 | |||
| c8c0924c74 | |||
| af732e4e85 | |||
| 47ffdae8cc | |||
| fd5870083b | |||
| 5ba62cb25d | |||
| 79e0588544 | |||
| a3d08cfc35 | |||
| 5caccb284a | |||
| ce19969b52 | |||
| 0f91dc392e | |||
| e9805cef30 | |||
| e3e05eb2db | |||
| c09f17cffb | |||
| ce73dd5987 | |||
| 77df8aacb9 | |||
| ce45b2802f | |||
| 7886018d6f | |||
| 5b5cb4188e | |||
| f797af5f17 | |||
| 055977535e | |||
| 6ab24f10f0 | |||
| 12a03da231 | |||
| cb7088979a | |||
| 1fb1fc6c97 | |||
| e633c3c5d1 | |||
| 0f04de34b1 | |||
| 3f8c2c293a | |||
| 2c97e743da | |||
| 2c83860c04 | |||
| c64b624de2 | |||
| 5e3990937d | |||
| 21744c1607 | |||
| 0892e2549f | |||
| cff6f305d4 | |||
| 5060071227 | |||
| d64109eaa4 | |||
| ec064bbd50 | |||
| baf952a151 | |||
| 0dd36c5e6a | |||
| 474404a8f9 | |||
| f2f6483b6f | |||
| c30161dbd0 | |||
| ec4f4fe476 | |||
| 634509ae28 | |||
| 1244048c50 | |||
| a62b69fb31 | |||
| 5eb36efb63 | |||
| fb8c4231b0 | |||
| 9774d1de46 | |||
| f5b141eeee | |||
| 1e47dc1111 | |||
| d3f4a2127d | |||
| 4d5f328c30 | |||
| b18cd44cf6 | |||
| 6705045dd4 | |||
| 533bc2c250 | |||
| 85226c0821 | |||
| fecefb672d | |||
| f91e030836 | |||
| d0591483bc | |||
| 729f9f246f | |||
| 17a6ba735b | |||
| de22fb4737 | |||
| 8197fb8900 | |||
| 751774419e | |||
| 8278609f10 | |||
| 445eedc7a3 | |||
| ed7661b93c | |||
| a17a04298a | |||
| f7ba686f0c | |||
| c41385e1ae | |||
| f582a9b690 | |||
| b36c2dbaf9 | |||
| 10b9e9e5e8 | |||
| 1beb5440f9 | |||
| 9a9ba4cc62 | |||
| 5b4c6363bb | |||
| 2026d064ef | |||
| 42257ca447 | |||
| 6f2fdcd971 | |||
| 9b4b7a26fd | |||
| 4d688b3922 | |||
| be8d427e26 | |||
| 7e0749ddda | |||
| 9f2324d208 | |||
| 6e258b85d7 | |||
| 24e55018a0 | |||
| 2352ae5d88 | |||
| 2cba43e6f3 | |||
| abcf8d0246 | |||
| c18b955467 | |||
| 7896b75001 | |||
| 7d188b2213 | |||
| 79ead484cc | |||
| be65f18a0e | |||
| 60f61109a1 | |||
| 4201bcecc6 | |||
| 7b7bfbc5dd | |||
| a70255e500 | |||
| 7e9dede9b3 | |||
| 9b7ad03465 | |||
| 3162bb0bfe | |||
| ec95648c43 | |||
| 72ac11ac07 | |||
| f70ea2b74f | |||
| db834666ba | |||
| 6ed0e13178 | |||
| 446e519110 | |||
| fb1fc01963 | |||
| 4651ae1bbb | |||
| 18606e23c6 | |||
| ed6d070d1f | |||
| f00cecbcaf | |||
| c9aee26fd6 | |||
| 32d3c0e65c | |||
| 33aeef2c02 | |||
| 7c97941acc | |||
| 01a4cd2289 | |||
| 202b58fb10 | |||
| b221150797 | |||
| 2084587e9a | |||
| 8332c28ac2 | |||
| 435a11d75c | |||
| 9a5329f5d6 | |||
| 8eecbf5fa5 | |||
| 9e1773df65 | |||
| 39e4140524 | |||
| bd90de857e | |||
| 57f2ec7b96 | |||
| 634098a6fa | |||
| bdbf208f6c | |||
| a652f5d73f | |||
| 1602843aa6 | |||
| cdb7fb8ea6 | |||
| 6387e9fa69 | |||
| 4e8097c93d | |||
| 65254b57b2 | |||
| 95899e23a8 | |||
| 5c8757d346 | |||
| 234e19d68a | |||
| 62145b7204 | |||
| 8bcc6d1501 | |||
| 09ef46f333 | |||
| 1839350526 | |||
| d7587e91b1 | |||
| 7b0a342cf9 | |||
| 3d01b0782e | |||
| fecfcfa7d2 | |||
| 29b5fa513a | |||
| f9a19badbf | |||
| d2630ea73c | |||
| a4a58c4782 | |||
| 29a3d80071 | |||
| 598bb419c0 | |||
| 087da9d2ce | |||
| c505aced48 | |||
| 959d5e5fcd | |||
| 8ee0cf4b2c | |||
| 426342074e | |||
| d2c092fe62 | |||
| a336917338 | |||
| 8925ddeee5 | |||
| 84824631b2 | |||
| dc3ecb1fc0 | |||
| 266cef8c49 | |||
| a5e821cd21 | |||
| cb5d92334e | |||
| f6dbc6b9f0 | |||
| c2c6430495 | |||
| 9ecf5b7834 | |||
| 1d003863dd | |||
| 774561bd00 | |||
| d356a305b9 | |||
| 95c472c15c | |||
| 2dbec241f7 | |||
| f3c66cab50 | |||
| 11e6fc3e06 | |||
| cdf8c0a11b | |||
| ae29cebe35 | |||
| e933a1fb42 | |||
| 5a3f98c502 | |||
| 8677540a82 | |||
| f4ceac5b2b | |||
| 61be4ea100 | |||
| 51c6ce2ba2 | |||
| e13bc44198 | |||
| 56cefcb1be | |||
| 6f860c17e3 | |||
| fb9edc4f81 | |||
| 4eb0a73f3c | |||
| 7929d798c8 | |||
| 4c3d8ca059 | |||
| ad74a8ea6b | |||
| f50dda7c31 | |||
| f78a805fa3 | |||
| bc177269a9 | |||
| 84cab29276 | |||
| d7c7584b4d | |||
| 1346072ab2 | |||
| 3b6b463b1b | |||
| a75daf9d90 | |||
| dc81f97bac | |||
| d194249ffb | |||
| 4ec04c31c5 | |||
| 8774035be9 | |||
| 8cec4ce82e | |||
| 17e46a2c99 | |||
| c5ffcd4b44 | |||
| 51c77c3a85 | |||
| 4326a7d258 | |||
| 38813fd105 | |||
| 19960fa3b5 | |||
| 32121d6d3b | |||
| 2dcef22681 | |||
| ee5a56183e | |||
| b90e3a3cd1 | |||
| f074d1252b | |||
| 30f07d3aa4 | |||
| d27b7b2f56 | |||
| 1dbf3e83ad | |||
| a5f70c9740 | |||
| ab72c8973d | |||
| a204c576ad | |||
| 4a7d40d3fb | |||
| 4f5fb86f87 | |||
| f7f2629e9d | |||
| 048c2fd034 | |||
| 3299c47858 | |||
| 8977e2c792 | |||
| 089e7d3230 | |||
| bd5863a02d | |||
| e0296d5a9a | |||
| e26cf3bf39 | |||
| 8525a1e9f0 | |||
| 2e8c83a668 | |||
| e857496565 | |||
| 143f65ae5a | |||
| f89d75ae92 | |||
| 403507206d | |||
| 7f6431700c | |||
| 7977bcf069 | |||
| 32ad6b46e2 | |||
| bf6bfce051 | |||
| 805c24ff1a | |||
| 2c4bb7c808 | |||
| 15a711396f | |||
| 3d8403346b | |||
| 5700503efe | |||
| d01b1e7d41 | |||
| 584cc6ab80 | |||
| 4b727edde8 | |||
| 9d10c4ddce | |||
| d5026d014d | |||
| ac0b7e4e22 | |||
| 623fe25415 | |||
| c4c9d50aae | |||
| 5d8dda02ec | |||
| bc3461147d | |||
| 80d4e6057b | |||
| 2dc5c2916a | |||
| 5f9631a3c5 | |||
| ef7df69036 | |||
| b3961994d2 | |||
| 927a847607 | |||
| 674cc6c1a2 | |||
| 5d77cf9473 | |||
| 512dad1d24 | |||
| 3d684934f1 | |||
| dd6ac185fb | |||
| 9825b6e32e | |||
| 653008ebfc | |||
| 236e93aa9c | |||
| 164c7faf94 | |||
| 4c07ddbcc7 | |||
| 7be543c3a6 | |||
| ccb47b0bda | |||
| 8aefacd411 | |||
| 6cd5fbcaca | |||
| 7c964b3f9c | |||
| 8c43c781bd | |||
| 7496de06f0 | |||
| fdd443a2d7 | |||
| 037c4046eb | |||
| 4e5ac14ca9 | |||
| dedf74b366 | |||
| 6f2eef1137 | |||
| 9a8d3edbef | |||
| 305ebda78d | |||
| 114050c23e | |||
| 7eee0755bf | |||
| c329f29e9a | |||
| 0f3a02ca7c | |||
| 62d4860873 | |||
| 21666ee309 | |||
| 47ff766e4e | |||
| 50cbc671b3 | |||
| f2d3390bd4 | |||
| fb5af12d7a | |||
| 63655a97e9 | |||
| fdf032d9f8 | |||
| 3b85b58558 | |||
| 00f1f40a1e | |||
| 46c05a4c27 | |||
| f3a510bd58 | |||
| 45231b822c | |||
| e0591675d2 | |||
| 67a849f110 | |||
| 15800296f7 | |||
| 52fe741f9a | |||
| b3ee693890 | |||
| 8c2e1738ea | |||
| bf33aed853 | |||
| 5869c7a02e | |||
| bbd429a994 | |||
| f4d636539e | |||
| 92e02257d7 | |||
| d2046d7ccb | |||
| 7bc35a157a | |||
| 903245e8a7 | |||
| 25ee9c3c1c | |||
| 9ead40d279 | |||
| e097379c21 | |||
| f86579d601 | |||
| de7511f243 | |||
| 9a68a75f70 | |||
| e04388aa32 | |||
| cee61e7a92 | |||
| 48185ed4e9 | |||
| 7bea086784 | |||
| 774f9c42cb | |||
| 10964d32e6 | |||
| da2493ed3b | |||
| 0a183f3505 | |||
| ac6cc1ec24 | |||
| a1846da0da | |||
| 0bd10c28ac | |||
| 2367cee329 | |||
| 288d89301a | |||
| 4d519e8f26 | |||
| 1bd2c0b852 | |||
| 82b0f4bce8 | |||
| 5635239274 | |||
| 1f979fc4cc | |||
| 80c4a65147 | |||
| 4fda6101eb | |||
| 99822fb597 | |||
| f1d9c12f07 | |||
| 30ef5a9de4 | |||
| 765ca861fb | |||
| 99570b3b86 | |||
| d9c6759108 | |||
| b82a8c6b9b | |||
| d76b1897aa | |||
| 857b79ee23 | |||
| ecba12b29f | |||
| efc48ab44c | |||
| 5f0620ed90 | |||
| 150ff1fae2 | |||
| dd1b9ca9be | |||
| c6ed59a742 | |||
| 1d3315711e | |||
| 46ddcff040 | |||
| a044b262e4 | |||
| 51b0e715a1 | |||
| 1cdeefb576 | |||
| db9aeb40bb | |||
| 8a41f0c716 | |||
| 4be5a491da | |||
| 4b4d4ebc54 | |||
| b132ea266a | |||
| e20e061330 | |||
| fc97b32d18 | |||
| a63aa93092 | |||
| 91cb5e895b | |||
| 16d233da47 | |||
| 69e8a6501e | |||
| dac6ae2e48 | |||
| 9f145333f8 | |||
| c8c5b82924 | |||
| 2e99efeeb6 | |||
| c4492f2cd2 | |||
| 41da15d8cf | |||
| ea3db6936c | |||
| 0928e7d787 | |||
| 2d3040aba2 | |||
| ce590a4a61 | |||
| e899647453 | |||
| fe1553f8da | |||
| 04d197375c | |||
| d2f1022b5a | |||
| 0265162cb9 | |||
| 9be4d6ca0e | |||
| 9e9da20450 | |||
| 082fd814af | |||
| 39cd23d7c0 | |||
| 78b051c999 | |||
| 2836fee493 | |||
| 6e409d2f7e | |||
| 3e698b8579 | |||
| 95e32f00d0 | |||
| 61c632ce55 | |||
| a0b93fd1b2 | |||
| 0b096a4c46 | |||
| a97518359a | |||
| 96cea25bca | |||
| 1a57f62773 | |||
| 9d1f83b1ce | |||
| 6653e8ef82 | |||
| fd121841a9 | |||
| 00255297c8 | |||
| 74a0fd2928 | |||
| ce7487a14d | |||
| 95d9d8bc8e | |||
| dce0b43c11 | |||
| d7a981a84e | |||
| bb52ddba2b | |||
| a82814d565 | |||
| bab37e1634 | |||
| 06dea5685a | |||
| 105a23d5bc | |||
| ef76c80014 | |||
| bb6e95ce20 | |||
| 69d9823847 | |||
| fb10c56bd3 | |||
| 4f24ed375e | |||
| 036c3b3740 | |||
| dddaeb3eeb | |||
| f75b0704a7 | |||
| baefae258b | |||
| 4f46ac6e69 | |||
| f634d1cfe5 | |||
| a810253b22 | |||
| 05e42b1908 | |||
| 4ea7f5f9ed | |||
| 50a1f3f5a7 | |||
| 2710cabdc9 | |||
| 1d55b1223c | |||
| ac959e32af | |||
| 1c2524f5fb | |||
| c0e4b02138 | |||
| eb29cee9ad | |||
| 5720891452 | |||
| 96f7cd9017 | |||
| c7ef8e9b1d | |||
| 1a2f9afac7 | |||
| 2c945b7166 | |||
| e49deaaf64 | |||
| 3edb12499c | |||
| 52c3f9bdb1 | |||
| 1e53b26704 | |||
| 8ac5180992 | |||
| 8cdf491178 | |||
| c5c64cb6c2 | |||
| 86000ee48f | |||
| 652fc292af | |||
| ef69fc4b34 | |||
| 6e3b7b1146 | |||
| 2ff5bd5910 | |||
| 01528516dd | |||
| 95dcf3661f | |||
| 717d91a192 | |||
| 3dd4dda2e3 | |||
| 24dc35546f | |||
| fc2707f0b5 | |||
| ea5ebe720b | |||
| cdead54f4a | |||
| 29ae0bdc38 | |||
| 502243103b | |||
| c668288308 | |||
| 39257334e4 | |||
| 48f95bd9f2 | |||
| f925e5cae9 | |||
| 80d95d41c5 | |||
| 42fb658349 | |||
| d500cbc615 | |||
| 470d57aec2 | |||
| 635a5d232a | |||
| 6fa18eb20d | |||
| 435bb02de3 | |||
| a84425b49f | |||
| 250a6e5a06 | |||
| 82dc7ab444 | |||
| 51c8ab5499 | |||
| 4176176e2b | |||
| 34d03c743e | |||
| 4cf55208b1 | |||
| fe1d48635b | |||
| db20232095 | |||
| 56ecea3ffc | |||
| 59599289af | |||
| d95c93abb2 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -20,6 +20,7 @@ Common/3dParty/v8/win_32
|
||||
Common/3dParty/v8/linux_64
|
||||
Common/3dParty/v8/linux_32
|
||||
Common/3dParty/v8/mac_64
|
||||
Common/3dParty/openssl/openssl
|
||||
**/core_build
|
||||
**/Release
|
||||
**/Debug
|
||||
@ -43,3 +44,7 @@ OfficeUtils/win32/OfficeUtilsLib/OfficeUtilsLib/ReadMe.txt
|
||||
*.pdb
|
||||
*.tlb
|
||||
*.idb
|
||||
**/.hg
|
||||
*.zip
|
||||
*.tar.gz
|
||||
**/*.build/
|
||||
|
||||
15
.travis.yml
15
.travis.yml
@ -1 +1,14 @@
|
||||
language: cpp
|
||||
language: cpp
|
||||
compiler: gcc
|
||||
dist: trusty
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- p7zip-full
|
||||
script:
|
||||
- exit 0
|
||||
# Build fails anyway. See explanation in
|
||||
# https://github.com/ONLYOFFICE/core/pull/29#issuecomment-306773327
|
||||
- cd Common/3dParty && ./make.sh
|
||||
- cd ../../
|
||||
- make
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -58,7 +58,7 @@
|
||||
|
||||
#include <boost/format.hpp>
|
||||
|
||||
namespace DocFormatUtils
|
||||
namespace DocFileFormat
|
||||
{
|
||||
typedef unsigned char Bool8;
|
||||
typedef unsigned short Bool16;
|
||||
@ -125,7 +125,7 @@ namespace DocFormatUtils
|
||||
|
||||
if(bDeleteNoUnicode)
|
||||
{
|
||||
for(size_t pos = 0; pos != data.size(); ++pos)
|
||||
for(size_t pos = 0; pos < data.size(); ++pos)
|
||||
{
|
||||
switch(data[pos])
|
||||
{
|
||||
@ -157,7 +157,7 @@ namespace DocFormatUtils
|
||||
}
|
||||
else
|
||||
{
|
||||
for(size_t pos = 0; pos != data.size(); ++pos)
|
||||
for(size_t pos = 0; pos < data.size(); ++pos)
|
||||
{
|
||||
switch(data[pos])
|
||||
{
|
||||
@ -166,6 +166,8 @@ namespace DocFormatUtils
|
||||
case '\'': buffer.append(L"'"); break;
|
||||
case '<': buffer.append(L"<"); break;
|
||||
case '>': buffer.append(L">"); break;
|
||||
case '\0':
|
||||
return buffer;
|
||||
default: buffer.append(&data[pos], 1); break;
|
||||
}
|
||||
}
|
||||
@ -499,10 +501,11 @@ namespace DocFormatUtils
|
||||
|
||||
facet.widen((char*)bytes, (char*)bytes + size, &result[0]);
|
||||
|
||||
for (long i=0; i < result.length(); i++)
|
||||
for (size_t i=0; i < result.length(); i++)
|
||||
{
|
||||
STLCollection->push_back(result[i]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class T> static bool GetSTLCollectionFromUtf8( T *STLCollection, unsigned char *bytes, int size)
|
||||
@ -533,7 +536,7 @@ namespace DocFormatUtils
|
||||
delete [] pStrUtf16;
|
||||
return GetSTLCollectionFromLocale(STLCollection, bytes,size);
|
||||
}
|
||||
for (long i=0; i < nLength; i++)
|
||||
for (unsigned int i = 0; i < nLength; i++)
|
||||
{
|
||||
STLCollection->push_back(pStrUtf16[i]);
|
||||
}
|
||||
@ -563,7 +566,7 @@ namespace DocFormatUtils
|
||||
delete [] pStrUtf32;
|
||||
return GetSTLCollectionFromLocale(STLCollection, bytes, size);
|
||||
}
|
||||
for (long i=0; i < nLength; i++)
|
||||
for (unsigned int i = 0; i < nLength; i++)
|
||||
{
|
||||
STLCollection->push_back(pStrUtf32[i]);
|
||||
}
|
||||
@ -649,7 +652,7 @@ namespace DocFormatUtils
|
||||
NSUnicodeConverter::CUnicodeConverter oConverter;
|
||||
std::wstring unicode_string = oConverter.toUnicode((char*)bytes, size, sCodePage.c_str());
|
||||
|
||||
for (long i=0; i < unicode_string.size(); i++)
|
||||
for (size_t i = 0; i < unicode_string.size(); i++)
|
||||
{
|
||||
STLCollection->push_back(unicode_string[i]);
|
||||
}
|
||||
@ -766,18 +769,12 @@ namespace DocFormatUtils
|
||||
|
||||
static inline std::wstring IntToWideString(int value)
|
||||
{
|
||||
#if defined(_WIN32) || defined (_WIN64)
|
||||
wchar_t buff[33] ={};
|
||||
_itow(value, buff, 10);
|
||||
return std::wstring(buff);
|
||||
#else
|
||||
return (std::to_wstring(value));
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline std::wstring DoubleToWideString(double value)
|
||||
{
|
||||
std::wstringstream src;
|
||||
|
||||
std::wstringstream src;
|
||||
src << value;
|
||||
|
||||
return std::wstring(src.str());
|
||||
@ -785,8 +782,7 @@ namespace DocFormatUtils
|
||||
|
||||
static inline std::string DoubleToString(double value)
|
||||
{
|
||||
std::stringstream src;
|
||||
|
||||
std::stringstream src;
|
||||
src << value;
|
||||
|
||||
return std::string(src.str());
|
||||
@ -813,36 +809,16 @@ namespace DocFormatUtils
|
||||
|
||||
static inline std::wstring IntToFormattedWideString( int value, const wchar_t* format )
|
||||
{
|
||||
// const int size = 33;
|
||||
|
||||
// wchar_t strValue[size] = L"\0";
|
||||
|
||||
if ( format == NULL ) return L"";
|
||||
// swprintf_s( strValue, size, format, value );
|
||||
//// }
|
||||
// CString format_str;
|
||||
// format_str.Format(format , value);
|
||||
|
||||
std::wstringstream sstream;
|
||||
sstream << boost::wformat(format) % value;
|
||||
return sstream.str();
|
||||
//return string2std_string( format_str );
|
||||
}
|
||||
|
||||
static inline std::wstring DoubleToFormattedWideString( double value, wchar_t* format )
|
||||
{
|
||||
if ( format == NULL ) return L"";
|
||||
//std::wstring wstr;
|
||||
|
||||
//if ( format != NULL )
|
||||
//{
|
||||
// CString strValue;
|
||||
// strValue.Format(format, value);
|
||||
|
||||
// wstr = string2std_string( strValue );
|
||||
//}
|
||||
|
||||
//return wstr;
|
||||
std::wstringstream sstream;
|
||||
sstream << boost::wformat(format) % value;
|
||||
return sstream.str();
|
||||
@ -987,4 +963,3 @@ namespace DocFormatUtils
|
||||
};
|
||||
}
|
||||
|
||||
using namespace DocFormatUtils;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -57,11 +57,11 @@ namespace XMLTools
|
||||
class XMLAttribute
|
||||
========================================================================================================*/
|
||||
|
||||
template <class T> class XMLAttribute
|
||||
class XMLAttribute
|
||||
{
|
||||
private:
|
||||
std::basic_string<T> m_Name;
|
||||
std::basic_string<T> m_Value;
|
||||
std::wstring m_Name;
|
||||
std::wstring m_Value;
|
||||
|
||||
public:
|
||||
|
||||
@ -69,56 +69,40 @@ namespace XMLTools
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
XMLAttribute( const T* name ) : m_Name(name)
|
||||
XMLAttribute( const std::wstring & name ) : m_Name(name)
|
||||
{
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
XMLAttribute( const T* name, const T* value ) : m_Name(name), m_Value(value)
|
||||
XMLAttribute( const std::wstring & name, const std::wstring & value ) : m_Name(name), m_Value(value)
|
||||
{
|
||||
}
|
||||
~XMLAttribute()
|
||||
{
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
~XMLAttribute()
|
||||
void SetValue( const std::wstring & value )
|
||||
{
|
||||
m_Value = std::wstring( value );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void SetValue( const T* value )
|
||||
{
|
||||
m_Value = std::basic_string<T>( value );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
std::basic_string<T> GetName() const
|
||||
std::wstring GetName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
std::basic_string<T> GetValue() const
|
||||
std::wstring GetValue() const
|
||||
{
|
||||
return m_Value;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
std::basic_string<T> GetXMLString()
|
||||
std::wstring GetXMLString()
|
||||
{
|
||||
std::basic_string<T> xmlString( L"" );
|
||||
std::wstring xmlString( L"" );
|
||||
|
||||
xmlString += m_Name;
|
||||
xmlString += std::basic_string<T>( L"=\"" );
|
||||
xmlString += std::wstring( L"=\"" );
|
||||
xmlString += m_Value;
|
||||
xmlString += std::basic_string<T>( L"\"" );
|
||||
xmlString += std::wstring( L"\"" );
|
||||
|
||||
return xmlString;
|
||||
}
|
||||
@ -128,86 +112,63 @@ namespace XMLTools
|
||||
class XMLElement
|
||||
========================================================================================================*/
|
||||
|
||||
template <class T> class XMLElement
|
||||
class XMLElement
|
||||
{
|
||||
typedef std::pair< std::basic_string<T>, std::basic_string<T> > AttributeValuePair;
|
||||
typedef std::pair< std::wstring, std::wstring> AttributeValuePair;
|
||||
|
||||
private:
|
||||
std::basic_string<T> m_Name;
|
||||
std::basic_string<T> m_ElementText;
|
||||
std::map<std::basic_string<T>, std::basic_string<T>> m_AttributeMap;
|
||||
std::map<std::basic_string<T>, int> m_ChildMap; //for uniq
|
||||
std::list<XMLElement<T>> m_Elements;
|
||||
std::wstring m_Name;
|
||||
std::wstring m_ElementText;
|
||||
std::map<std::wstring, std::wstring> m_AttributeMap;
|
||||
std::map<std::wstring, int> m_ChildMap; //for uniq
|
||||
std::list<XMLElement> m_Elements;
|
||||
|
||||
typedef typename std::list<XMLElement<T>>::iterator ElementsIterator;
|
||||
typedef typename std::list<XMLElement<T>>::const_iterator ElementsIteratorConst;
|
||||
typedef std::list<XMLElement>::iterator ElementsIterator;
|
||||
typedef std::list<XMLElement>::const_iterator ElementsIteratorConst;
|
||||
|
||||
typedef typename std::map<std::basic_string<T>, std::basic_string<T>>::iterator AttMapIterator;
|
||||
typedef typename std::map<std::basic_string<T>, std::basic_string<T>>::const_iterator AttMapIteratorConst;
|
||||
typedef std::map<std::wstring, std::wstring>::iterator AttMapIterator;
|
||||
typedef std::map<std::wstring, std::wstring>::const_iterator AttMapIteratorConst;
|
||||
|
||||
public:
|
||||
|
||||
XMLElement()
|
||||
XMLElement() {}
|
||||
|
||||
XMLElement( const std::wstring & name ) : m_Name(name)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
XMLElement( const T* name ) : m_Name(name)
|
||||
XMLElement( const std::wstring & prefix, const std::wstring & localName ) :
|
||||
m_Name( std::wstring( prefix ) + std::wstring( L":" ) + std::wstring( localName ) ), m_ElementText( L"" )
|
||||
{
|
||||
|
||||
}
|
||||
~XMLElement() {}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
XMLElement( const T* prefix, const T* localName ) : m_Name( std::basic_string<T>( prefix ) + std::basic_string<T>( L":" ) + std::basic_string<T>( localName ) ), m_ElementText( L"" )
|
||||
void AppendText( const std::wstring & text )
|
||||
{
|
||||
|
||||
m_ElementText = std::wstring( text );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
~XMLElement()
|
||||
void AppendTextSymbol( const wchar_t symbol )
|
||||
{
|
||||
|
||||
m_ElementText += std::wstring( &symbol );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void AppendText( const T* text )
|
||||
{
|
||||
m_ElementText = std::basic_string<T>( text );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void AppendTextSymbol( const T symbol )
|
||||
{
|
||||
m_ElementText += std::basic_string<T>( &symbol );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void AppendAttribute( const XMLAttribute<T>& attribute )
|
||||
void AppendAttribute( const XMLAttribute& attribute )
|
||||
{
|
||||
AttributeValuePair p( attribute.GetName(), attribute.GetValue() );
|
||||
|
||||
m_AttributeMap.insert( p );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void AppendAttribute( const T* name, const T* value )
|
||||
void AppendAttribute( const std::wstring & name, const std::wstring & value )
|
||||
{
|
||||
AttributeValuePair p( std::basic_string<T>( const_cast<T*>( name ) ), std::basic_string<T>( const_cast<T*>( value ) ) );
|
||||
AttributeValuePair p( name , value );
|
||||
|
||||
m_AttributeMap.insert( p );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void AppendChild( const XMLElement<T>& element, bool uniq = false)
|
||||
void AppendChild( const XMLElement& element, bool uniq = false)
|
||||
{
|
||||
if (m_ChildMap.find(element.GetName()) != m_ChildMap.end())
|
||||
{
|
||||
@ -215,21 +176,17 @@ namespace XMLTools
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ChildMap.insert(m_ChildMap.end(), std::pair<std::basic_string<T>, int>(element.GetName(), 0));
|
||||
m_ChildMap.insert(m_ChildMap.end(), std::pair<std::wstring, int>(element.GetName(), 0));
|
||||
}
|
||||
m_Elements.push_back( element );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void RemoveChild( const XMLElement<T>& element )
|
||||
void RemoveChild( const XMLElement& element )
|
||||
{
|
||||
m_Elements.remove( element );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
bool FindChild( const XMLElement<T>& element )
|
||||
bool FindChild( const XMLElement& element )
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@ -246,15 +203,13 @@ namespace XMLTools
|
||||
return result;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
bool FindChildByName( const T* elementName ) const
|
||||
bool FindChildByName( const std::wstring & elementName ) const
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
for ( ElementsIterator iter = m_Elements.begin(); iter != m_Elements.end(); iter++ )
|
||||
for ( ElementsIteratorConst iter = m_Elements.begin(); iter != m_Elements.end(); iter++ )
|
||||
{
|
||||
if ( iter->m_Name == std::basic_string<T>( elementName ) )
|
||||
if ( iter->m_Name == std::wstring( elementName ) )
|
||||
{
|
||||
result = true;
|
||||
|
||||
@ -265,9 +220,7 @@ namespace XMLTools
|
||||
return result;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
bool RemoveChildByName( const std::basic_string<T>& elementName )
|
||||
bool RemoveChildByName( const std::wstring& elementName )
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@ -286,9 +239,7 @@ namespace XMLTools
|
||||
return result;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
bool operator == ( const XMLElement<T>& element ) const
|
||||
bool operator == ( const XMLElement& element ) const
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@ -319,7 +270,7 @@ namespace XMLTools
|
||||
}
|
||||
else
|
||||
{
|
||||
ElementsIteratorConst thisIter = m_Elements.begin();
|
||||
ElementsIteratorConst thisIter = m_Elements.begin();
|
||||
ElementsIteratorConst elementIter = element.m_Elements.begin();
|
||||
|
||||
for ( ; thisIter != m_Elements.end(); thisIter++, elementIter++ )
|
||||
@ -336,34 +287,34 @@ namespace XMLTools
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
std::basic_string<T> GetName() const
|
||||
std::wstring GetName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
std::basic_string<T> GetXMLString()
|
||||
std::wstring GetXMLString()
|
||||
{
|
||||
std::basic_string<T> xmlString( L"");
|
||||
std::wstring xmlString( L"");
|
||||
|
||||
bool bIsNameExists = ( m_Name != std::basic_string<T>( L"") );
|
||||
bool bIsTextExists = ( m_ElementText != std::basic_string<T>( L"") );
|
||||
bool bIsNameExists = ( m_Name != std::wstring( L"") );
|
||||
bool bIsTextExists = ( m_ElementText != std::wstring( L"") );
|
||||
|
||||
if ( bIsNameExists )
|
||||
{
|
||||
xmlString += std::basic_string<T>( L"<" ) + m_Name;
|
||||
xmlString += std::wstring( L"<" ) + m_Name;
|
||||
}
|
||||
|
||||
if ( ( bIsNameExists ) && ( m_AttributeMap.size() > 0 ) )
|
||||
{
|
||||
for ( AttMapIterator iter = m_AttributeMap.begin(); iter != m_AttributeMap.end(); iter++ )
|
||||
{
|
||||
xmlString += std::basic_string<T>( L" " );
|
||||
xmlString += std::wstring( L" " );
|
||||
xmlString += iter->first;
|
||||
xmlString += std::basic_string<T>( L"=\"" );
|
||||
xmlString += std::wstring( L"=\"" );
|
||||
xmlString += iter->second;
|
||||
xmlString += std::basic_string<T>( L"\"" );
|
||||
xmlString += std::wstring( L"\"" );
|
||||
}
|
||||
}
|
||||
|
||||
@ -371,7 +322,7 @@ namespace XMLTools
|
||||
{
|
||||
if ( bIsNameExists )
|
||||
{
|
||||
xmlString += std::basic_string<T>( L">" );
|
||||
xmlString += std::wstring( L">" );
|
||||
}
|
||||
|
||||
for ( ElementsIterator iter = m_Elements.begin(); iter != m_Elements.end(); iter++ )
|
||||
@ -386,16 +337,16 @@ namespace XMLTools
|
||||
|
||||
if ( bIsNameExists )
|
||||
{
|
||||
xmlString += std::basic_string<T>( L"</" );
|
||||
xmlString += std::wstring( L"</" );
|
||||
xmlString += m_Name;
|
||||
xmlString += std::basic_string<T>( L">" );
|
||||
xmlString += std::wstring( L">" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( bIsNameExists )
|
||||
{
|
||||
xmlString += std::basic_string<T>( L"/>" );
|
||||
xmlString += std::wstring( L"/>" );
|
||||
}
|
||||
}
|
||||
|
||||
@ -442,7 +393,7 @@ namespace XMLTools
|
||||
else
|
||||
{
|
||||
std::string s(m_str.begin(), m_str.end());
|
||||
file.WriteFile((unsigned char*)s.c_str(), s.length());
|
||||
file.WriteFile((unsigned char*)s.c_str(), (DWORD)s.length());
|
||||
}
|
||||
file.CloseFile();
|
||||
return true;
|
||||
@ -455,34 +406,12 @@ namespace XMLTools
|
||||
|
||||
void WriteInteger(int Value, int Base = 10)
|
||||
{
|
||||
#if defined(_WIN32) || defined (_WIN64)
|
||||
wchar_t buff[33] ={};
|
||||
_itow(Value, buff, Base);
|
||||
m_str += std::wstring(buff);
|
||||
#else
|
||||
m_str += std::to_wstring(Value);
|
||||
#endif
|
||||
}
|
||||
|
||||
void WriteDouble(double Value)
|
||||
{
|
||||
#if defined(_WIN32) || defined (_WIN64)
|
||||
int *dec = NULL, *sign = NULL;
|
||||
char *str = _fcvt( Value , 4, dec, sign);
|
||||
|
||||
if (str)
|
||||
{
|
||||
std::string sA(str);
|
||||
delete []str;
|
||||
m_str += std::wstring(sA.begin(), sA.end());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_str += L"0";
|
||||
}
|
||||
#else
|
||||
m_str += std::to_wstring(Value);
|
||||
#endif
|
||||
}
|
||||
void WriteBoolean(bool Value)
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -76,4 +76,4 @@ namespace DocFileFormat
|
||||
|
||||
return static_cast<ByteStructure*>(newObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -38,7 +38,7 @@ namespace DocFileFormat
|
||||
: PropertiesMapping( writer ), _isRunStyleNeeded(isRunStyleNeeded), _isOwnRPr(true), _isRTL(false)
|
||||
{
|
||||
_doc = doc;
|
||||
_rPr = new XMLTools::XMLElement<wchar_t>( _T( "w:rPr" ) );
|
||||
_rPr = new XMLTools::XMLElement( L"w:rPr");
|
||||
_revisionData = rev;
|
||||
_currentPapx = currentPapx;
|
||||
_styleChpx = styleChpx;
|
||||
@ -46,7 +46,7 @@ namespace DocFileFormat
|
||||
_webHidden = false;
|
||||
}
|
||||
|
||||
CharacterPropertiesMapping::CharacterPropertiesMapping( XMLTools::XMLElement<wchar_t>* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded )
|
||||
CharacterPropertiesMapping::CharacterPropertiesMapping( XMLTools::XMLElement* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded )
|
||||
: PropertiesMapping( NULL ), _isRunStyleNeeded(isRunStyleNeeded), _isOwnRPr(false), _isRTL(false)
|
||||
{
|
||||
_doc = doc;
|
||||
@ -77,7 +77,7 @@ namespace DocFileFormat
|
||||
// apend revision changes
|
||||
if (_revisionData->Type == Changed)
|
||||
{
|
||||
XMLTools::XMLElement<wchar_t> rPrChange( _T( "w:rPrChange" ) );
|
||||
XMLTools::XMLElement rPrChange( L"w:rPrChange");
|
||||
|
||||
//todooo date - _revisionData->Dttm.Convert( new DateMapping( rPrChange ) );
|
||||
|
||||
@ -85,7 +85,7 @@ namespace DocFileFormat
|
||||
|
||||
if (author_str)
|
||||
{
|
||||
XMLTools::XMLAttribute<wchar_t> author( _T( "w:author" ), FormatUtils::XmlEncode(*author_str).c_str());
|
||||
XMLTools::XMLAttribute author( L"w:author", FormatUtils::XmlEncode(*author_str));
|
||||
rPrChange.AppendAttribute( author );
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ namespace DocFileFormat
|
||||
//write properties
|
||||
if ( ( m_pXmlWriter != NULL ) && ( ( _rPr->GetChildCount() > 0 ) || ( _rPr->GetAttributeCount() > 0 ) ) )
|
||||
{
|
||||
m_pXmlWriter->WriteString( _rPr->GetXMLString().c_str() );
|
||||
m_pXmlWriter->WriteString( _rPr->GetXMLString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ namespace DocFileFormat
|
||||
{
|
||||
//Todo сделать определение симольного шрифта через fontManager
|
||||
//Заглушка под Google Docs, они пишут bullet в Arial
|
||||
if (-1 != m_sAsciiFont.find (_T("Arial")) && -1 != m_sEastAsiaFont.find (_T("Arial")) && -1 != m_shAnsiFont.find (_T("Arial")))
|
||||
if (-1 != m_sAsciiFont.find (L"Arial") && -1 != m_sEastAsiaFont.find (L"Arial") && -1 != m_shAnsiFont.find (L"Arial"))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -116,16 +116,16 @@ namespace DocFileFormat
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void CharacterPropertiesMapping::convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement<wchar_t>* parent )
|
||||
void CharacterPropertiesMapping::convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent )
|
||||
{
|
||||
XMLTools::XMLElement<wchar_t> * rFonts = new XMLTools::XMLElement<wchar_t> ( _T( "w:rFonts" ) );
|
||||
XMLTools::XMLElement<wchar_t> * color = new XMLTools::XMLElement<wchar_t> ( _T( "w:color" ) );
|
||||
XMLTools::XMLAttribute<wchar_t> * colorVal = new XMLTools::XMLAttribute<wchar_t> ( _T( "w:val" ) );
|
||||
XMLTools::XMLElement<wchar_t> * lang = new XMLTools::XMLElement<wchar_t> ( _T( "w:lang" ) );
|
||||
XMLTools::XMLElement * rFonts = new XMLTools::XMLElement ( L"w:rFonts" );
|
||||
XMLTools::XMLElement * color = new XMLTools::XMLElement ( L"w:color" );
|
||||
XMLTools::XMLAttribute * colorVal = new XMLTools::XMLAttribute ( L"w:val" );
|
||||
XMLTools::XMLElement * lang = new XMLTools::XMLElement ( L"w:lang" );
|
||||
|
||||
if (_webHidden)
|
||||
{
|
||||
XMLTools::XMLElement<wchar_t> * webHidden = new XMLTools::XMLElement<wchar_t> ( _T( "w:webHidden" ) );
|
||||
XMLTools::XMLElement * webHidden = new XMLTools::XMLElement ( L"w:webHidden" );
|
||||
parent->AppendChild( *webHidden );
|
||||
RELEASEOBJECT( webHidden );
|
||||
}
|
||||
@ -144,95 +144,96 @@ namespace DocFileFormat
|
||||
_currentIstd = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
if (_currentIstd < _doc->Styles->Styles->size())
|
||||
{
|
||||
appendValueElement( parent, _T( "rStyle" ), StyleSheetMapping::MakeStyleId( _doc->Styles->Styles->at( _currentIstd ) ).c_str(), true );
|
||||
appendValueElement( parent, L"rStyle", StyleSheetMapping::MakeStyleId( _doc->Styles->Styles->at( _currentIstd ) ), true );
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
||||
case sprmCFBiDi :
|
||||
appendFlagElement( parent, *iter, _T( "rtl" ), true );
|
||||
appendFlagElement( parent, *iter, L"rtl", true );
|
||||
_isRTL = true;
|
||||
break;
|
||||
|
||||
case sprmOldCFBold :
|
||||
case sprmCFBold :
|
||||
appendFlagElement( parent, *iter, _T( "b" ), true );
|
||||
appendFlagElement( parent, *iter, L"b", true );
|
||||
break;
|
||||
|
||||
case sprmCFBoldBi :
|
||||
appendFlagElement( parent, *iter, _T( "bCs" ), true );
|
||||
appendFlagElement( parent, *iter, L"bCs", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFCaps :
|
||||
case sprmCFCaps :
|
||||
appendFlagElement( parent, *iter, _T( "caps" ), true );
|
||||
appendFlagElement( parent, *iter, L"caps", true );
|
||||
break;
|
||||
|
||||
case sprmCFComplexScripts :
|
||||
appendFlagElement( parent, *iter, _T( "cs" ), true );
|
||||
appendFlagElement( parent, *iter, L"cs", true );
|
||||
break;
|
||||
|
||||
case sprmCFDStrike :
|
||||
appendFlagElement( parent, *iter, _T( "dstrike" ), true );
|
||||
appendFlagElement( parent, *iter, L"dstrike", true );
|
||||
break;
|
||||
|
||||
case sprmCFEmboss :
|
||||
appendFlagElement( parent, *iter, _T( "emboss" ), true );
|
||||
appendFlagElement( parent, *iter, L"emboss", true );
|
||||
break;
|
||||
|
||||
case sprmCFImprint :
|
||||
appendFlagElement( parent, *iter, _T( "imprint" ), true );
|
||||
appendFlagElement( parent, *iter, L"imprint", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFItalic :
|
||||
case sprmCFItalic :
|
||||
appendFlagElement( parent, *iter, _T( "i" ), true );
|
||||
appendFlagElement( parent, *iter, L"i", true );
|
||||
break;
|
||||
|
||||
case sprmCFItalicBi:
|
||||
appendFlagElement( parent, *iter, _T( "iCs" ), true );
|
||||
appendFlagElement( parent, *iter, L"iCs", true );
|
||||
break;
|
||||
|
||||
case 0x0875:
|
||||
appendFlagElement( parent, *iter, _T( "noProof" ), true );
|
||||
appendFlagElement( parent, *iter, L"noProof", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFOutline:
|
||||
case sprmCFOutline:
|
||||
appendFlagElement( parent, *iter, _T( "outline" ), true );
|
||||
appendFlagElement( parent, *iter, L"outline", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFShadow:
|
||||
case sprmCFShadow:
|
||||
appendFlagElement( parent, *iter, _T( "shadow" ), true );
|
||||
appendFlagElement( parent, *iter, L"shadow", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFSmallCaps:
|
||||
case sprmCFSmallCaps:
|
||||
appendFlagElement( parent, *iter, _T( "smallCaps" ), true );
|
||||
appendFlagElement( parent, *iter, L"smallCaps", true );
|
||||
break;
|
||||
|
||||
case sprmCFSpecVanish:
|
||||
appendFlagElement( parent, *iter, _T( "specVanish" ), true );
|
||||
appendFlagElement( parent, *iter, L"specVanish", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFStrike:
|
||||
case sprmCFStrike:
|
||||
appendFlagElement( parent, *iter, _T( "strike" ), true );
|
||||
appendFlagElement( parent, *iter, L"strike", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFVanish:
|
||||
case sprmCFVanish:
|
||||
appendFlagElement( parent, *iter, _T( "vanish" ), true );
|
||||
appendFlagElement( parent, *iter, L"vanish", true );
|
||||
break;
|
||||
|
||||
case 0x0811:
|
||||
appendFlagElement( parent, *iter, _T( "webHidden" ), true );
|
||||
appendFlagElement( parent, *iter, L"webHidden", true );
|
||||
break;
|
||||
|
||||
case sprmOldCIss:
|
||||
case sprmCIss:
|
||||
appendValueElement( parent, _T( "vertAlign" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ).c_str(), true );
|
||||
if (iter->argumentsSize > 0 && iter->Arguments[0] < 3) //Metaevan.doc
|
||||
appendValueElement( parent, L"vertAlign", FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ), true );
|
||||
break;
|
||||
|
||||
case sprmCRgLid0_80:
|
||||
@ -274,7 +275,7 @@ namespace DocFileFormat
|
||||
case sprmCBrc80:
|
||||
case sprmCBrc:
|
||||
{ //borders
|
||||
XMLTools::XMLElement<wchar_t> bdr( _T( "w:bdr" ) );
|
||||
XMLTools::XMLElement bdr( L"w:bdr" );
|
||||
BorderCode bc( iter->Arguments, iter->argumentsSize );
|
||||
appendBorderAttributes( &bc, &bdr );
|
||||
parent->AppendChild( bdr );
|
||||
@ -292,7 +293,7 @@ namespace DocFileFormat
|
||||
case sprmCIco:
|
||||
case sprmCIcoBi:
|
||||
{//color
|
||||
colorVal->SetValue( FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ).c_str() );
|
||||
colorVal->SetValue( FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ));
|
||||
}break;
|
||||
|
||||
case sprmCCv:
|
||||
@ -300,30 +301,27 @@ namespace DocFileFormat
|
||||
std::wstringstream sstream;
|
||||
|
||||
sstream << boost::wformat(L"%02x%02x%02x") % iter->Arguments[0] % /*G*/iter->Arguments[1] % /*B*/iter->Arguments[2];
|
||||
colorVal->SetValue(sstream.str().c_str());
|
||||
//CString rgbColor;
|
||||
//rgbColor.Format( _T( "%02x%02x%02x" ), /*R*/iter->Arguments[0], /*G*/iter->Arguments[1], /*B*/iter->Arguments[2] );
|
||||
//colorVal->SetValue( rgbColor.GetString() );
|
||||
colorVal->SetValue(sstream.str());
|
||||
}break;
|
||||
|
||||
case sprmCOldHighlight:
|
||||
{
|
||||
appendValueElement( parent, _T( "highlight" ), FormatUtils::MapValueToWideString( iter->Arguments[1], &Global::ColorIdentifier[0][0], 17, 12 ).c_str(), true );
|
||||
appendValueElement( parent, L"highlight", FormatUtils::MapValueToWideString( iter->Arguments[1], &Global::ColorIdentifier[0][0], 17, 12 ), true );
|
||||
}break;
|
||||
case sprmCHighlight:
|
||||
{
|
||||
appendValueElement( parent, _T( "highlight" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ).c_str(), true );
|
||||
appendValueElement( parent, L"highlight", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ), true );
|
||||
}break;
|
||||
|
||||
case sprmOldCDxaSpace:
|
||||
case sprmCDxaSpace:
|
||||
{
|
||||
appendValueElement( parent, _T( "spacing" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
|
||||
appendValueElement( parent, L"spacing", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
}break;
|
||||
|
||||
case sprmCFtcBi :
|
||||
{//default from FontTable
|
||||
SHORT nIndex = FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize);
|
||||
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 ) );
|
||||
@ -334,21 +332,21 @@ namespace DocFileFormat
|
||||
|
||||
case sprmCHpsBi :
|
||||
{
|
||||
appendValueElement( parent, _T( "szCs" ),
|
||||
FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
|
||||
appendValueElement( parent, L"szCs",
|
||||
FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
}
|
||||
break;
|
||||
// Font Size in points (2~3276) default 20-half-points
|
||||
case sprmOldCHps :
|
||||
{
|
||||
appendValueElement (parent, _T( "sz" ),
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUChar (iter->Arguments, 0, iter->argumentsSize) ).c_str(),
|
||||
appendValueElement (parent, L"sz",
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUChar (iter->Arguments, 0, iter->argumentsSize) ),
|
||||
true );
|
||||
}break;
|
||||
case sprmCHps :
|
||||
{
|
||||
appendValueElement (parent, _T( "sz" ),
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize) ).c_str(), true );
|
||||
appendValueElement (parent, L"sz",
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize) ), true );
|
||||
}break;
|
||||
|
||||
case sprmCMajority :
|
||||
@ -358,31 +356,31 @@ namespace DocFileFormat
|
||||
case sprmOldCHpsPos:
|
||||
{ // The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
|
||||
short nVertPos = FormatUtils::BytesToUChar(iter->Arguments, 0, iter->argumentsSize);
|
||||
appendValueElement (parent, _T("position"), nVertPos, true);
|
||||
appendValueElement (parent, L"position", nVertPos, true);
|
||||
}break;
|
||||
case sprmCHpsPos:
|
||||
{ // The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
|
||||
short nVertPos = FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
appendValueElement (parent, _T("position"), nVertPos, true);
|
||||
appendValueElement (parent, L"position", nVertPos, true);
|
||||
}break;
|
||||
|
||||
case sprmOldCHpsKern:
|
||||
case sprmCHpsKern:
|
||||
{
|
||||
appendValueElement( parent, _T( "kern" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
|
||||
appendValueElement( parent, L"kern", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
}break;
|
||||
|
||||
case sprmOldCFtc:
|
||||
case sprmCRgFtc0:
|
||||
{ // font family
|
||||
int nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
size_t nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
|
||||
if( nIndex < _doc->FontTable->Data.size() )
|
||||
{
|
||||
XMLTools::XMLAttribute<wchar_t>* ascii = new XMLTools::XMLAttribute<wchar_t>( _T( "w:ascii" ) );
|
||||
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( L"w:ascii" );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
m_sAsciiFont = ffn->xszFtn;
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sAsciiFont).c_str() );
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sAsciiFont, true));
|
||||
rFonts->AppendAttribute( *ascii );
|
||||
RELEASEOBJECT( ascii );
|
||||
}
|
||||
@ -390,13 +388,14 @@ namespace DocFileFormat
|
||||
|
||||
case sprmCRgFtc1:
|
||||
{
|
||||
int 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() )
|
||||
{
|
||||
XMLTools::XMLAttribute<wchar_t>* eastAsia = new XMLTools::XMLAttribute<wchar_t>( _T( "w:eastAsia" ) );
|
||||
XMLTools::XMLAttribute* eastAsia = new XMLTools::XMLAttribute( L"w:eastAsia" );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
m_sEastAsiaFont = ffn->xszFtn;
|
||||
eastAsia->SetValue( FormatUtils::XmlEncode(m_sEastAsiaFont).c_str() );
|
||||
eastAsia->SetValue( FormatUtils::XmlEncode(m_sEastAsiaFont));
|
||||
rFonts->AppendAttribute( *eastAsia );
|
||||
RELEASEOBJECT( eastAsia );
|
||||
}
|
||||
@ -405,13 +404,14 @@ namespace DocFileFormat
|
||||
|
||||
case sprmCRgFtc2:
|
||||
{
|
||||
int 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() )
|
||||
{
|
||||
XMLTools::XMLAttribute<wchar_t>* ansi = new XMLTools::XMLAttribute<wchar_t>( _T( "w:hAnsi" ) );
|
||||
XMLTools::XMLAttribute* ansi = new XMLTools::XMLAttribute( L"w:hAnsi" );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
m_shAnsiFont = ffn->xszFtn;
|
||||
ansi->SetValue( FormatUtils::XmlEncode(m_shAnsiFont).c_str() );
|
||||
ansi->SetValue( FormatUtils::XmlEncode(m_shAnsiFont));
|
||||
rFonts->AppendAttribute( *ansi );
|
||||
RELEASEOBJECT( ansi );
|
||||
}
|
||||
@ -420,18 +420,18 @@ namespace DocFileFormat
|
||||
case sprmOldCKul:
|
||||
case sprmCKul:
|
||||
{ //Underlining
|
||||
appendValueElement( parent, _T( "u" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::UnderlineCode[0][0], 56, 16 ).c_str(), true );
|
||||
appendValueElement( parent, L"u", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::UnderlineCode[0][0], 56, 16 ), true );
|
||||
}
|
||||
break;
|
||||
|
||||
case sprmCCharScale:
|
||||
{ //char width
|
||||
appendValueElement( parent, _T( "w" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
|
||||
appendValueElement( parent, L"w", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
}break;
|
||||
|
||||
case sprmCSfxText:
|
||||
{ //animation
|
||||
appendValueElement( parent, _T( "effect" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::TextAnimation[0][0], 7, 16 ).c_str(), true );
|
||||
appendValueElement( parent, L"effect", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::TextAnimation[0][0], 7, 16 ), true );
|
||||
}break;
|
||||
|
||||
case sprmCIdctHint:
|
||||
@ -485,8 +485,8 @@ namespace DocFileFormat
|
||||
|
||||
if (!m_sDefaultFont.empty() && m_sAsciiFont.empty() && m_sEastAsiaFont.empty() && m_shAnsiFont.empty())
|
||||
{//????
|
||||
XMLTools::XMLAttribute<wchar_t>* ascii = new XMLTools::XMLAttribute<wchar_t>( _T( "w:ascii" ) );
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sDefaultFont).c_str() );
|
||||
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( L"w:ascii" );
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sDefaultFont));
|
||||
//rFonts->AppendAttribute( *ascii );
|
||||
RELEASEOBJECT( ascii );
|
||||
}
|
||||
@ -504,7 +504,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//append color
|
||||
if ( colorVal->GetValue() != _T( "" ) )
|
||||
if ( colorVal->GetValue() != L"")
|
||||
{
|
||||
color->AppendAttribute( *colorVal );
|
||||
parent->AppendChild( *color );
|
||||
@ -520,14 +520,14 @@ namespace DocFileFormat
|
||||
|
||||
/// CHPX flags are special flags because the can be 0,1,128 and 129,
|
||||
/// so this method overrides the appendFlagElement method.
|
||||
void CharacterPropertiesMapping::appendFlagElement( XMLTools::XMLElement<wchar_t>* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique )
|
||||
void CharacterPropertiesMapping::appendFlagElement( XMLTools::XMLElement* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique )
|
||||
{
|
||||
unsigned char flag = sprm.Arguments[0];
|
||||
|
||||
if( flag != 128 )
|
||||
{
|
||||
XMLTools::XMLElement<wchar_t>* ele = new XMLTools::XMLElement<wchar_t>( _T( "w" ), elementName );
|
||||
XMLTools::XMLAttribute<wchar_t>* val = new XMLTools::XMLAttribute<wchar_t>( _T( "w:val" ) );
|
||||
XMLTools::XMLElement* ele = new XMLTools::XMLElement( L"w", elementName );
|
||||
XMLTools::XMLAttribute* val = new XMLTools::XMLAttribute( L"w:val" );
|
||||
|
||||
if ( unique )
|
||||
{
|
||||
@ -536,7 +536,7 @@ namespace DocFileFormat
|
||||
|
||||
if ( flag == 0 )
|
||||
{
|
||||
val->SetValue( _T( "false" ) );
|
||||
val->SetValue( L"false" );
|
||||
ele->AppendAttribute( *val );
|
||||
node->AppendChild( *ele );
|
||||
}
|
||||
@ -579,7 +579,7 @@ namespace DocFileFormat
|
||||
//invert it
|
||||
if ( stylesVal )
|
||||
{
|
||||
val->SetValue( _T( "false" ) );
|
||||
val->SetValue( L"false" );
|
||||
ele->AppendAttribute( *val );
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -55,7 +55,7 @@ namespace DocFileFormat
|
||||
{
|
||||
public:
|
||||
CharacterPropertiesMapping( XMLTools::CStringXmlWriter* writer, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded = true );
|
||||
CharacterPropertiesMapping( XMLTools::XMLElement<wchar_t>* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded = true );
|
||||
CharacterPropertiesMapping( XMLTools::XMLElement* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded = true );
|
||||
virtual ~CharacterPropertiesMapping();
|
||||
void Apply( IVisitable* chpx );
|
||||
bool CheckIsSymbolFont();
|
||||
@ -63,7 +63,7 @@ namespace DocFileFormat
|
||||
bool _webHidden;
|
||||
bool _isRTL;
|
||||
private:
|
||||
void convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement<wchar_t>* parent );
|
||||
void convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent );
|
||||
std::list<CharacterPropertyExceptions*> buildHierarchy( const StyleSheet* styleSheet, unsigned short istdStart );
|
||||
bool applyToggleHierachy( const SinglePropertyModifier& sprm );
|
||||
bool toogleValue( bool currentValue, unsigned char toggle );
|
||||
@ -71,13 +71,13 @@ namespace DocFileFormat
|
||||
protected:
|
||||
/// CHPX flags are special flags because the can be 0,1,128 and 129,
|
||||
/// so this method overrides the appendFlagElement method.
|
||||
virtual void appendFlagElement( XMLTools::XMLElement<wchar_t>* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique );
|
||||
virtual void appendFlagElement( XMLTools::XMLElement* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique );
|
||||
|
||||
private:
|
||||
XMLTools::CStringXmlWriter pRunPr;
|
||||
|
||||
WordDocument* _doc;
|
||||
XMLTools::XMLElement<wchar_t>* _rPr;
|
||||
XMLTools::XMLElement* _rPr;
|
||||
unsigned short _currentIstd;
|
||||
RevisionData* _revisionData;
|
||||
bool _styleChpx;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -54,29 +54,29 @@ namespace DocFileFormat
|
||||
|
||||
int index = 0;
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:comments" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:comments", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
int cp = m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr;
|
||||
|
||||
size_t count = m_document->AnnotationsReferencePlex->Elements.size();
|
||||
for (unsigned int i = 0; i < count; ++i)
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
AnnotationReferenceDescriptor* atrdPre10 = static_cast<AnnotationReferenceDescriptor*>(m_document->AnnotationsReferencePlex->Elements[index]);
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:comment" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( index ).c_str() );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:author" ),
|
||||
FormatUtils::XmlEncode(m_document->AnnotationOwners->at( atrdPre10->GetAuthorIndex() ) ).c_str());
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:initials" ), atrdPre10->GetUserInitials().c_str() );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:comment", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( index + 1 ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:author",
|
||||
FormatUtils::XmlEncode(m_document->AnnotationOwners->at( atrdPre10->GetAuthorIndex() ) ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:initials", atrdPre10->GetUserInitials());
|
||||
|
||||
//!!!TODO!!!
|
||||
/*//ATRDpost10 is optional and not saved in all files
|
||||
@ -87,7 +87,7 @@ namespace DocFileFormat
|
||||
atrdPost10.Date.Convert(new DateMapping(_writer));
|
||||
}*/
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
while ( ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpHdr ) < (*m_document->IndividualCommentsPlex)[index + 1] )
|
||||
{
|
||||
@ -111,12 +111,12 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T( "w:comment" ));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:comment" );
|
||||
|
||||
++index;
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:comments" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:comments" );
|
||||
m_context->_docx->CommentsXML = std::wstring(m_pXmlWriter->GetXmlString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -33,138 +33,137 @@
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include <tchar.h>
|
||||
#else
|
||||
#include "../../DesktopEditor/common/ASCVariant.h"
|
||||
#include "../../Common/DocxFormat/Source/Base/ASCString.h"
|
||||
#endif
|
||||
#include <string>
|
||||
|
||||
#include "../../DesktopEditor/common/ASCVariant.h"
|
||||
|
||||
namespace OpenXmlContentTypes
|
||||
{
|
||||
// default content types
|
||||
static const TCHAR* Xml = _T("application/xml");
|
||||
static const wchar_t* Xml = L"application/xml";
|
||||
|
||||
// package content types
|
||||
static const TCHAR* Relationships = _T("application/vnd.openxmlformats-package.relationships+xml");
|
||||
static const wchar_t* Relationships = L"application/vnd.openxmlformats-package.relationships+xml";
|
||||
|
||||
static const TCHAR* CoreProperties = _T("application/vnd.openxmlformats-package.core-properties+xml");
|
||||
static const wchar_t* CoreProperties = L"application/vnd.openxmlformats-package.core-properties+xml";
|
||||
|
||||
// general office document content types
|
||||
static const TCHAR* ExtendedProperties = _T("application/vnd.openxmlformats-officedocument.extended-properties+xml");
|
||||
static const TCHAR* Theme = _T("application/vnd.openxmlformats-officedocument.theme+xml");
|
||||
static const wchar_t* ExtendedProperties = L"application/vnd.openxmlformats-officedocument.extended-properties+xml";
|
||||
static const wchar_t* Theme = L"application/vnd.openxmlformats-officedocument.theme+xml";
|
||||
|
||||
static const TCHAR* CustomXmlProperties = _T("application/vnd.openxmlformats-officedocument.customXmlProperties+xml");
|
||||
static const wchar_t* CustomXmlProperties = L"application/vnd.openxmlformats-officedocument.customXmlProperties+xml";
|
||||
|
||||
static const TCHAR* OleObject = _T("application/vnd.openxmlformats-officedocument.oleObject");
|
||||
static const TCHAR* Vml = _T("application/vnd.openxmlformats-officedocument.vmlDrawing");
|
||||
static const TCHAR* Drawing = _T("application/vnd.openxmlformats-officedocument.drawing+xml");
|
||||
static const wchar_t* OleObject = L"application/vnd.openxmlformats-officedocument.oleObject";
|
||||
static const wchar_t* Vml = L"application/vnd.openxmlformats-officedocument.vmlDrawing";
|
||||
static const wchar_t* Drawing = L"application/vnd.openxmlformats-officedocument.drawing+xml";
|
||||
|
||||
static const TCHAR* MSWordDocx = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
|
||||
static const wchar_t* MSWordDocx = L"application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
||||
|
||||
static const TCHAR* MSExcel = _T("application/vnd.ms-excel");
|
||||
static const TCHAR* MSWord = _T("application/msword");
|
||||
static const TCHAR* MSPowerpoint = _T("application/vnd.ms-powerpoint");
|
||||
static const wchar_t* MSExcel = L"application/vnd.ms-excel";
|
||||
static const wchar_t* MSWord = L"application/msword";
|
||||
static const wchar_t* MSPowerpoint = L"application/vnd.ms-powerpoint";
|
||||
|
||||
static const TCHAR* Emf = _T("image/x-emf");
|
||||
static const TCHAR* Jpeg = _T("image/jpeg");
|
||||
static const TCHAR* Png = _T("image/png");
|
||||
static const TCHAR* Tiff = _T("image/tiff");
|
||||
static const TCHAR* Wmf = _T("image/x-wmf");
|
||||
static const TCHAR* Bmp = _T("image/bmp");
|
||||
static const wchar_t* Emf = L"image/x-emf";
|
||||
static const wchar_t* Jpeg = L"image/jpeg";
|
||||
static const wchar_t* Png = L"image/png";
|
||||
static const wchar_t* Tiff = L"image/tiff";
|
||||
static const wchar_t* Wmf = L"image/x-wmf";
|
||||
static const wchar_t* Bmp = L"image/bmp";
|
||||
}
|
||||
|
||||
namespace WordprocessingMLContentTypes
|
||||
{
|
||||
// WordprocessingML content types
|
||||
static const TCHAR* MainDocument = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml");
|
||||
static const TCHAR* MainDocumentMacro = _T("application/vnd.ms-word.document.macroEnabled.main+xml");
|
||||
static const TCHAR* MainDocumentTemplate = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml");
|
||||
static const TCHAR* MainDocumentMacroTemplate = _T("application/vnd.ms-word.template.macroEnabledTemplate.main+xml");
|
||||
static const wchar_t* MainDocument = L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml";
|
||||
static const wchar_t* MainDocumentMacro = L"application/vnd.ms-word.document.macroEnabled.main+xml";
|
||||
static const wchar_t* MainDocumentTemplate = L"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml";
|
||||
static const wchar_t* MainDocumentMacroTemplate = L"application/vnd.ms-word.template.macroEnabledTemplate.main+xml";
|
||||
|
||||
static const TCHAR* Styles = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml");
|
||||
static const TCHAR* Numbering = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml");
|
||||
static const TCHAR* FontTable = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml");
|
||||
static const TCHAR* WebSettings = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml");
|
||||
static const TCHAR* Settings = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml");
|
||||
static const wchar_t* Styles = L"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";
|
||||
static const wchar_t* Numbering = L"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml";
|
||||
static const wchar_t* FontTable = L"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml";
|
||||
static const wchar_t* WebSettings = L"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml";
|
||||
static const wchar_t* Settings = L"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";
|
||||
|
||||
static const TCHAR* Comments = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml");
|
||||
static const wchar_t* Comments = L"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml";
|
||||
|
||||
static const TCHAR* Footnotes = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml");
|
||||
static const TCHAR* Endnotes = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml");
|
||||
static const wchar_t* Footnotes = L"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml";
|
||||
static const wchar_t* Endnotes = L"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml";
|
||||
|
||||
static const TCHAR* Header = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml");
|
||||
static const TCHAR* Footer = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml");
|
||||
static const wchar_t* Header = L"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml";
|
||||
static const wchar_t* Footer = L"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml";
|
||||
|
||||
static const TCHAR* Glossary = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml");
|
||||
static const wchar_t* Glossary = L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml";
|
||||
}
|
||||
|
||||
namespace MicrosoftWordContentTypes
|
||||
{
|
||||
static const TCHAR* KeyMapCustomization = _T("application/vnd.ms-word.keyMapCustomizations+xml");
|
||||
static const TCHAR* VbaProject = _T("application/vnd.ms-office.vbaProject");
|
||||
static const TCHAR* VbaData = _T("application/vnd.ms-word.vbaData+xml");
|
||||
static const TCHAR* Toolbars = _T("application/vnd.ms-word.attachedToolbars");
|
||||
static const wchar_t* KeyMapCustomization = L"application/vnd.ms-word.keyMapCustomizations+xml";
|
||||
static const wchar_t* VbaProject = L"application/vnd.ms-office.vbaProject";
|
||||
static const wchar_t* VbaData = L"application/vnd.ms-word.vbaData+xml";
|
||||
static const wchar_t* Toolbars = L"application/vnd.ms-word.attachedToolbars";
|
||||
}
|
||||
|
||||
namespace OpenXmlNamespaces
|
||||
{
|
||||
// package namespaces
|
||||
static const TCHAR* ContentTypes = _T("http://schemas.openxmlformats.org/package/2006/content-types");
|
||||
static const TCHAR* RelationshipsPackage = _T("http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
static const TCHAR* Relationships = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
static const wchar_t* ContentTypes = L"http://schemas.openxmlformats.org/package/2006/content-types";
|
||||
static const wchar_t* RelationshipsPackage = L"http://schemas.openxmlformats.org/package/2006/relationships";
|
||||
static const wchar_t* Relationships = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
||||
|
||||
// Drawing ML namespaces
|
||||
static const TCHAR* DrawingML = _T("http://schemas.openxmlformats.org/drawingml/2006/main");
|
||||
static const TCHAR* DrawingMLPicture = _T("http://schemas.openxmlformats.org/drawingml/2006/picture");
|
||||
static const wchar_t* DrawingML = L"http://schemas.openxmlformats.org/drawingml/2006/main";
|
||||
static const wchar_t* DrawingMLPicture = L"http://schemas.openxmlformats.org/drawingml/2006/picture";
|
||||
|
||||
// WordprocessingML namespaces
|
||||
static const TCHAR* WordprocessingML = _T("http://schemas.openxmlformats.org/wordprocessingml/2006/main");
|
||||
static const TCHAR* WordprocessingDrawingML = _T("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
|
||||
static const TCHAR* VectorML = _T("urn:schemas-microsoft-com:vml");
|
||||
static const TCHAR* MicrosoftWordML = _T("http://schemas.microsoft.com/office/word/2006/wordml");
|
||||
static const wchar_t* WordprocessingML = L"http://schemas.openxmlformats.org/wordprocessingml/2006/main";
|
||||
static const wchar_t* WordprocessingDrawingML = L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing";
|
||||
static const wchar_t* VectorML = L"urn:schemas-microsoft-com:vml";
|
||||
static const wchar_t* MicrosoftWordML = L"http://schemas.microsoft.com/office/word/2006/wordml";
|
||||
|
||||
// PresentationML namespaces
|
||||
static const TCHAR* PresentationML = _T("http://schemas.openxmlformats.org/presentationml/2006/main");
|
||||
static const wchar_t* PresentationML = L"http://schemas.openxmlformats.org/presentationml/2006/main";
|
||||
|
||||
// SpreadsheetML Namespaces
|
||||
static const TCHAR* SharedStringML = _T("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
static const TCHAR* WorkBookML = _T("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
static const TCHAR* StylesML = _T("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
static const wchar_t* SharedStringML = L"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
|
||||
static const wchar_t* WorkBookML = L"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
|
||||
static const wchar_t* StylesML = L"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
|
||||
|
||||
//Office
|
||||
static const TCHAR* Office = _T("urn:schemas-microsoft-com:office:office");
|
||||
static const TCHAR* OfficeWord = _T("urn:schemas-microsoft-com:office:word");
|
||||
static const wchar_t* Office = L"urn:schemas-microsoft-com:office:office";
|
||||
static const wchar_t* OfficeWord = L"urn:schemas-microsoft-com:office:word";
|
||||
}
|
||||
|
||||
namespace OpenXmlRelationshipTypes
|
||||
{
|
||||
static const TCHAR* CoreProperties = _T("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties");
|
||||
static const TCHAR* ExtendedProperties = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties");
|
||||
static const wchar_t* CoreProperties = L"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";
|
||||
static const wchar_t* ExtendedProperties = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";
|
||||
|
||||
static const TCHAR* Theme = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme");
|
||||
static const TCHAR* OfficeDocument = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument");
|
||||
static const TCHAR* Styles = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles");
|
||||
static const TCHAR* FontTable = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable");
|
||||
static const TCHAR* Numbering = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering");
|
||||
static const TCHAR* WebSettings = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings");
|
||||
static const TCHAR* Settings = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings");
|
||||
static const TCHAR* CustomXml = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml");
|
||||
static const TCHAR* CustomXmlProperties = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps");
|
||||
static const TCHAR* Comments = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments");
|
||||
static const TCHAR* Footnotes = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes");
|
||||
static const TCHAR* Endnotes = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes");
|
||||
static const TCHAR* Header = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/header");
|
||||
static const TCHAR* Footer = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer");
|
||||
static const TCHAR* Image = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image");
|
||||
static const TCHAR* OleObject = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject");
|
||||
static const TCHAR* GlossaryDocument = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument");
|
||||
static const TCHAR* Package = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
|
||||
static const wchar_t* Theme = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
|
||||
static const wchar_t* OfficeDocument = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
|
||||
static const wchar_t* Styles = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";
|
||||
static const wchar_t* FontTable = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";
|
||||
static const wchar_t* Numbering = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering";
|
||||
static const wchar_t* WebSettings = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings";
|
||||
static const wchar_t* Settings = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings";
|
||||
static const wchar_t* CustomXml = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml";
|
||||
static const wchar_t* CustomXmlProperties = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps";
|
||||
static const wchar_t* Comments = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
|
||||
static const wchar_t* Footnotes = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes";
|
||||
static const wchar_t* Endnotes = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes";
|
||||
static const wchar_t* Header = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";
|
||||
static const wchar_t* Footer = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";
|
||||
static const wchar_t* Image = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
|
||||
static const wchar_t* OleObject = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
|
||||
static const wchar_t* GlossaryDocument = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument";
|
||||
static const wchar_t* Package = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
|
||||
static const wchar_t* VbaProject = L"http://schemas.microsoft.com/office/2006/relationships/vbaProject";
|
||||
}
|
||||
|
||||
namespace MicrosoftWordRelationshipTypes
|
||||
{
|
||||
static const TCHAR* KeyMapCustomizations = _T("http://schemas.microsoft.com/office/2006/relationships/keyMapCustomizations");
|
||||
static const TCHAR* VbaProject = _T("http://schemas.microsoft.com/office/2006/relationships/vbaProject");
|
||||
static const TCHAR* VbaData = _T("http://schemas.microsoft.com/office/2006/relationships/wordVbaData");
|
||||
static const TCHAR* Toolbars = _T("http://schemas.microsoft.com/office/2006/relationships/attachedToolbars");
|
||||
static const wchar_t* KeyMapCustomizations = L"http://schemas.microsoft.com/office/2006/relationships/keyMapCustomizations";
|
||||
static const wchar_t* VbaProject = L"http://schemas.microsoft.com/office/2006/relationships/vbaProject";
|
||||
static const wchar_t* VbaData = L"http://schemas.microsoft.com/office/2006/relationships/wordVbaData";
|
||||
static const wchar_t* Toolbars = L"http://schemas.microsoft.com/office/2006/relationships/attachedToolbars";
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -65,7 +65,7 @@ namespace DocFileFormat
|
||||
{
|
||||
ConversionContext context( doc, docx );
|
||||
|
||||
//Write styles.xml
|
||||
//Write styles.xml
|
||||
if (doc->Styles)
|
||||
{
|
||||
StyleSheetMapping styleSheetMapping( &context );
|
||||
@ -88,9 +88,7 @@ namespace DocFileFormat
|
||||
return S_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Write numbering.xml
|
||||
//Write numbering.xml
|
||||
if (doc->listTable)
|
||||
{
|
||||
NumberingMapping numberingMapping( &context );
|
||||
@ -110,7 +108,7 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
//Write fontTable.xml
|
||||
//Write fontTable.xml
|
||||
if (doc->FontTable)
|
||||
{
|
||||
FontTableMapping fontTableMapping( &context );
|
||||
@ -130,7 +128,7 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
//write the footnotes
|
||||
//write the footnotes
|
||||
FootnotesMapping footnotesMapping( &context );
|
||||
doc->Convert( &footnotesMapping );
|
||||
|
||||
@ -147,7 +145,7 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
//write the endnotes
|
||||
//write the endnotes
|
||||
EndnotesMapping endnotesMapping( &context );
|
||||
doc->Convert( &endnotesMapping );
|
||||
|
||||
@ -164,7 +162,7 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
//write the comments
|
||||
//write the comments
|
||||
CommentsMapping commentsMapping( &context );
|
||||
doc->Convert( &commentsMapping );
|
||||
|
||||
@ -181,13 +179,13 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
//write settings.xml at last because of the rsid list
|
||||
//write settings.xml at last because of the rsid list
|
||||
if (doc->DocProperties)
|
||||
{
|
||||
SettingsMapping settingsMapping( &context );
|
||||
doc->DocProperties->Convert( &settingsMapping );
|
||||
}
|
||||
|
||||
|
||||
if ( progress != NULL )
|
||||
{
|
||||
progress->OnProgress( progress->caller, DOC_ONPROGRESSEVENT_ID, 975000 );
|
||||
@ -204,7 +202,7 @@ namespace DocFileFormat
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
long Converter::LoadAndConvert(const std::wstring& strSrcFile, const std::wstring& strDstDirectory, const std::wstring& password, const ProgressCallback* progress)
|
||||
long Converter::LoadAndConvert(const std::wstring& strSrcFile, const std::wstring& strDstDirectory, const std::wstring& password, const ProgressCallback* progress, bool &bMacros)
|
||||
{
|
||||
long result = S_FALSE;
|
||||
|
||||
@ -219,7 +217,7 @@ namespace DocFileFormat
|
||||
|
||||
if (result == S_OK)
|
||||
{
|
||||
docx.SaveDocument();
|
||||
docx.SaveDocument(bMacros);
|
||||
|
||||
if (progress)progress->OnProgress(progress->caller, DOC_ONPROGRESSEVENT_ID, 1000000);
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -48,7 +48,7 @@ namespace DocFileFormat
|
||||
|
||||
std::wstring m_sTempFolder;
|
||||
|
||||
long LoadAndConvert(const std::wstring & strSrcFile, const std::wstring & strDstDirectory, const std::wstring & password, const ProgressCallback* progress);
|
||||
long LoadAndConvert(const std::wstring & strSrcFile, const std::wstring & strDstDirectory, const std::wstring & password, const ProgressCallback* progress, bool &bMacros);
|
||||
|
||||
private:
|
||||
long Convert(WordDocument* doc, WordprocessingDocument* docx, const ProgressCallback* progress);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -48,6 +48,8 @@
|
||||
#include "OleObjectMapping.h"
|
||||
#include "ConversionContext.h"
|
||||
#include "IMapping.h"
|
||||
#include "FormFieldData.h"
|
||||
#include "FormFieldDataMapping.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
@ -70,68 +72,75 @@ namespace DocFileFormat
|
||||
public:
|
||||
DocumentMapping(ConversionContext* context, IMapping* caller);
|
||||
DocumentMapping(ConversionContext* context, XMLTools::CStringXmlWriter* writer, IMapping* caller);
|
||||
|
||||
virtual ~DocumentMapping();
|
||||
virtual void Apply( IVisitable* visited ) = 0;
|
||||
|
||||
//--------------------------------- 4571833.doc
|
||||
std::wstring m_shapeIdOwner;
|
||||
std::wstring getOLEObject() { return _lastOLEObject; }
|
||||
protected:
|
||||
|
||||
/// Looks into the section table to find out if this CP is the current of a section
|
||||
int getCurrentSection(int cp);
|
||||
/// Looks into the section table to find out if this CP is the end of a section
|
||||
bool isSectionEnd( int cp );
|
||||
/// Writes a Paragraph that starts at the given cp and
|
||||
/// ends at the next paragraph end mark or section end mark
|
||||
int getListNumCache (int fc, int fc_end);
|
||||
int getCurrentSection (int cp);
|
||||
//---------------------------------
|
||||
bool isSectionEnd ( int cp );
|
||||
// Writes a Paragraph that starts at the given cp and
|
||||
// ends at the next paragraph end mark or section end mark
|
||||
int writeParagraph( int cp );
|
||||
/// Writes a Paragraph that starts at the given cpStart and
|
||||
/// ends at the given cpEnd
|
||||
// Writes a Paragraph that starts at the given cpStart and
|
||||
// ends at the given cpEnd
|
||||
int writeParagraph( int initialCp, int cpEnd, bool sectionEnd, bool lastBad = false );
|
||||
/// Writes a Paragraph RSID
|
||||
// Writes a Paragraph RSID
|
||||
void writeParagraphRsid( const ParagraphPropertyExceptions* papx );
|
||||
/// Writes a run with the given characters and CHPX
|
||||
// Writes a run with the given characters and CHPX
|
||||
int writeRun( std::vector<wchar_t>* chars, CharacterPropertyExceptions* chpx, int initialCp );
|
||||
/// Writes the given text to the document
|
||||
// Writes the given text to the document
|
||||
int writeText ( std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText );
|
||||
void writeTextElement ( const std::wstring& text, const std::wstring& textType );
|
||||
void writeTextStart ( const std::wstring& textType, bool preserve_space);
|
||||
void writeTextEnd ( const std::wstring& textType );
|
||||
|
||||
int writeText( std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText );
|
||||
void writeTextElement( const std::wstring& text, const std::wstring& textType );
|
||||
void writeTextStart( const std::wstring& textType, bool preserve_space);
|
||||
void writeTextEnd( const std::wstring& textType );
|
||||
|
||||
/// Searches for bookmarks in the list of characters.
|
||||
std::vector<int> searchBookmarks( std::vector<wchar_t>* chars, int initialCp );
|
||||
std::vector<int> searchAnnot(std::vector<wchar_t>* chars, int initialCp);
|
||||
|
||||
ParagraphPropertyExceptions* findValidPapx( int fc );
|
||||
/// Splits a list of characters into several lists
|
||||
// Splits a list of characters into several lists
|
||||
std::list<std::vector<wchar_t> >* splitCharList( std::vector<wchar_t>* chars, std::vector<int>* splitIndices );
|
||||
/// Writes the table starts at the given cp value
|
||||
int writeTable( int initialCp, unsigned int nestingLevel );
|
||||
/// Builds a list that contains the width of the several columns of the table.
|
||||
std::vector<short>* buildTableGrid( int initialCp, unsigned int nestingLevel );
|
||||
/// Finds the FC of the next row end mark.
|
||||
int findRowEndFc( int initialCp, int& rowEndCp, unsigned int nestingLevel );
|
||||
/// Finds the FC of the next row end mark.
|
||||
int findRowEndFc( int initialCp, unsigned int nestingLevel );
|
||||
/// Writes the table row that starts at the given cp value and ends at the next row end mark
|
||||
int writeTableRow( int initialCp, std::vector<short>* grid, unsigned int nestingLevel );
|
||||
/// Writes the table cell that starts at the given cp value and ends at the next cell end mark
|
||||
int writeTableCell( int initialCp, TablePropertyExceptions* tapx, std::vector<short>* grid, int& gridIndex, int cellIndex, unsigned int nestingLevel );
|
||||
int findCellEndCp( int initialCp, unsigned int nestingLevel );
|
||||
bool writeBookmarks( int cp );
|
||||
bool writeBookmarkStart( short id );
|
||||
bool writeBookmarkEnd( short id );
|
||||
/// Checks if the CHPX is special
|
||||
// Writes the table starts at the given cp value
|
||||
int writeTable ( int initialCp, unsigned int nestingLevel );
|
||||
// Builds a list that contains the width of the several columns of the table.
|
||||
bool buildTableGrid( int initialCp, unsigned int nestingLevel, std::vector<short>& grid, std::vector<short>& grid_write );
|
||||
// Finds the FC of the next row end mark.
|
||||
int findRowEndFc ( int initialCp, int& rowEndCp, unsigned int nestingLevel );
|
||||
// Finds the FC of the next row end mark.
|
||||
int findRowEndFc ( int initialCp, unsigned int nestingLevel );
|
||||
// Writes the table row that starts at the given cp value and ends at the next row end mark
|
||||
int writeTableRow ( int initialCp, std::vector<short>* grid, std::vector<short>* grid_write, unsigned int nestingLevel );
|
||||
// Writes the table cell that starts at the given cp value and ends at the next cell end mark
|
||||
int writeTableCell ( int initialCp, TablePropertyExceptions* tapx, std::vector<short>* grid, std::vector<short>* grid_write, int& gridIndex, int cellIndex, unsigned int nestingLevel );
|
||||
int findCellEndCp ( int initialCp, unsigned int nestingLevel );
|
||||
|
||||
bool writeBookmarks ( int cp );
|
||||
bool writeBookmarkStart ( short id );
|
||||
bool writeBookmarkEnd ( short id );
|
||||
|
||||
bool writeAnnotations ( int cp );
|
||||
bool writeAnnotationStart( short id );
|
||||
bool writeAnnotationEnd ( short id );
|
||||
// Checks if the CHPX is special
|
||||
bool isSpecial( CharacterPropertyExceptions* chpx );
|
||||
/// Finds the SEPX that is valid for the given CP.
|
||||
// Finds the SEPX that is valid for the given CP.
|
||||
SectionPropertyExceptions* findValidSepx( int cp );
|
||||
/// Searches the given vector for the next FieldEnd character.
|
||||
// Searches the given vector for the next FieldEnd character.
|
||||
int searchNextTextMark( std::vector<wchar_t>* chars, int initialCp, wchar_t mark );
|
||||
|
||||
private:
|
||||
Symbol getSymbol( const CharacterPropertyExceptions* chpx );
|
||||
Symbol getSymbol ( const CharacterPropertyExceptions* chpx );
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
bool m_bInternalXmlWriter;
|
||||
|
||||
protected:
|
||||
|
||||
WordDocument* m_document;
|
||||
ConversionContext* m_context;
|
||||
|
||||
IMapping* _caller;
|
||||
|
||||
ParagraphPropertyExceptions* _lastValidPapx;
|
||||
@ -149,5 +158,7 @@ namespace DocFileFormat
|
||||
bool _writeWebHidden;
|
||||
unsigned int _fldCharCounter;
|
||||
std::wstring _writeAfterRun;
|
||||
std::wstring _lastOLEObject;
|
||||
int _cacheListNum;
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -43,7 +43,8 @@ namespace DocFileFormat
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
WordDocumentProperties::WordDocumentProperties(FileInformationBlock* fib, POLE::Stream* tableStream) : doptypography(NULL), dogrid(NULL), asumyi(NULL)
|
||||
WordDocumentProperties::WordDocumentProperties(FileInformationBlock* fib, POLE::Stream* tableStream) :
|
||||
doptypography(NULL), dogrid(NULL), asumyi(NULL), bDisplayBackgroundShape(false)
|
||||
{
|
||||
Initialize();
|
||||
|
||||
@ -226,7 +227,7 @@ namespace DocFileFormat
|
||||
dywDispPag = FormatUtils::BytesToInt16( bytes, 498, size );
|
||||
|
||||
//WORD 2000, 2002, 2003 PART
|
||||
if ( size > 500 )
|
||||
if ( size > 500/* && fib->m_FibNew.nFibNew > Fib1997*/)
|
||||
{
|
||||
ilvlLastBulletMain = bytes[500];
|
||||
ilvlLastNumberMain = bytes[501];
|
||||
@ -266,138 +267,158 @@ namespace DocFileFormat
|
||||
fDntULTrlSpc = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 14 );
|
||||
fDntBlnSbDbWid = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 15 );
|
||||
fSuppressTopSpacingMac5 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 16 );
|
||||
fTruncDxaExpand = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 17 );
|
||||
fPrintBodyBeforeHdr = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 18 );
|
||||
fNoLeading = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 19 );
|
||||
fMakeSpaceForUL = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 20 );
|
||||
fMWSmallCaps = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 21 );
|
||||
f2ptExtLeadingOnly = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 22 );
|
||||
fTruncFontHeight = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 23 );
|
||||
fSubOnSize = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 24 );
|
||||
fLineWrapLikeWord6 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 25 );
|
||||
fWW6BorderRules = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 26 );
|
||||
fExactOnTop = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 27 );
|
||||
fExtraAfter = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 28 );
|
||||
fWPSpace = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 29 );
|
||||
fWPJust = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 30 );
|
||||
fPrintMet = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 31 );
|
||||
fTruncDxaExpand = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 17 );
|
||||
fPrintBodyBeforeHdr = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 18 );
|
||||
fNoLeading = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 19 );
|
||||
fMakeSpaceForUL = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 20 );
|
||||
fMWSmallCaps = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 21 );
|
||||
f2ptExtLeadingOnly = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 22 );
|
||||
fTruncFontHeight = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 23 );
|
||||
fSubOnSize = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 24 );
|
||||
fLineWrapLikeWord6 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 25 );
|
||||
fWW6BorderRules = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 26 );
|
||||
fExactOnTop = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 27 );
|
||||
fExtraAfter = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 28 );
|
||||
fWPSpace = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 29 );
|
||||
fWPJust = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 30 );
|
||||
fPrintMet = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 31 );
|
||||
|
||||
//split bytes 512,513,514,515 into bits
|
||||
fSpLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 0 );
|
||||
fFtnLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 1 );
|
||||
fDontUseHTMLParagraphAutoSpacing = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 2 );
|
||||
fDontAdjustLineHeightInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 3 );
|
||||
fForgetLastTabAlign = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 4 );
|
||||
fUseAutoSpaceForFullWidthAlpha = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 5 );
|
||||
fAlignTablesRowByRow = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 6 );
|
||||
fLayoutRawTableWidth = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 7 );
|
||||
fLayoutTableRowsApart = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 8 );
|
||||
fUserWord97LineBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 9 );
|
||||
fDontBreakWrappedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 10 );
|
||||
fDontSnapToGridInCell = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 11 );
|
||||
fDontAllowFieldEndSelect = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 12 );
|
||||
fApplyBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 13 );
|
||||
fDontWrapTextWithPunct = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 14 );
|
||||
fDontUseAsianBreakRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 15 );
|
||||
fUseWord2002TableStyleRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 16 );
|
||||
fGrowAutofit = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 17 );
|
||||
fUseNormalStyleForList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 18 );
|
||||
fDontUseIndentAsNumberingTabStop = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 19 );
|
||||
fFELineBreak11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 20 );
|
||||
fAllowSpaceOfSameStyleInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 21 );
|
||||
fWW11IndentRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 22 );
|
||||
fDontAutofitConstrainedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 23 );
|
||||
fAutofitLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 24 );
|
||||
fUnderlineTabInNumList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 25 );
|
||||
fHangulWidthLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 26 );
|
||||
fSplitPgBreakAndParaMark = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 27 );
|
||||
fDontVertAlignCellWithSp = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 28 );
|
||||
fDontBreakConstrainedForcedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 29 );
|
||||
fDontVertAlignInTxbx = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 30 );
|
||||
fWord11KerningPairs = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 31 );
|
||||
fCachedColBalance = FormatUtils::GetBitFromBytes( ( bytes + 516 ), 4, 0 );
|
||||
//split bytes 512,513,514,515 into bits
|
||||
fSpLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 0 );
|
||||
fFtnLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 1 );
|
||||
fDontUseHTMLParagraphAutoSpacing = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 2 );
|
||||
fDontAdjustLineHeightInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 3 );
|
||||
fForgetLastTabAlign = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 4 );
|
||||
fUseAutoSpaceForFullWidthAlpha = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 5 );
|
||||
fAlignTablesRowByRow = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 6 );
|
||||
fLayoutRawTableWidth = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 7 );
|
||||
fLayoutTableRowsApart = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 8 );
|
||||
fUserWord97LineBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 9 );
|
||||
fDontBreakWrappedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 10 );
|
||||
fDontSnapToGridInCell = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 11 );
|
||||
fDontAllowFieldEndSelect = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 12 );
|
||||
fApplyBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 13 );
|
||||
fDontWrapTextWithPunct = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 14 );
|
||||
fDontUseAsianBreakRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 15 );
|
||||
fUseWord2002TableStyleRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 16 );
|
||||
fGrowAutofit = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 17 );
|
||||
fUseNormalStyleForList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 18 );
|
||||
fDontUseIndentAsNumberingTabStop = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 19 );
|
||||
fFELineBreak11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 20 );
|
||||
fAllowSpaceOfSameStyleInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 21 );
|
||||
fWW11IndentRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 22 );
|
||||
fDontAutofitConstrainedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 23 );
|
||||
fAutofitLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 24 );
|
||||
fUnderlineTabInNumList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 25 );
|
||||
fHangulWidthLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 26 );
|
||||
fSplitPgBreakAndParaMark = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 27 );
|
||||
fDontVertAlignCellWithSp = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 28 );
|
||||
fDontBreakConstrainedForcedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 29 );
|
||||
fDontVertAlignInTxbx = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 30 );
|
||||
fWord11KerningPairs = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 31 );
|
||||
|
||||
fCachedColBalance = FormatUtils::GetBitFromBytes( ( bytes + 516 ), 4, 0 );
|
||||
|
||||
//bytes 517-539 are unused
|
||||
//bytes 517-539 are unused
|
||||
|
||||
verCompatPreW10 = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 540 ), 4, 0, 16 );
|
||||
fNoMargPgvwSaved = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 16 );
|
||||
fNoMargPgvWPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 17 );
|
||||
fWebViewPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 18 );
|
||||
fSeeDrawingsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 19 );
|
||||
fBulletProofed = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 20 );
|
||||
fCorrupted = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 21 );
|
||||
fSaveUim = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 22 );
|
||||
fFilterPrivacy = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 23 );
|
||||
fInFReplaceNoRM = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 24 );
|
||||
fSeenRepairs = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 25 );
|
||||
fHasXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 26 );
|
||||
fSeeScriptAnchorsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 27 );
|
||||
fValidateXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 28 );
|
||||
fSaveIfInvalidXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 29 );
|
||||
fShowXMLErrors = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 30 );
|
||||
fAlwaysMergeEmptyNamespace = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 31 );
|
||||
verCompatPreW10 = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 540 ), 4, 0, 16 );
|
||||
fNoMargPgvwSaved = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 16 );
|
||||
fNoMargPgvWPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 17 );
|
||||
fWebViewPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 18 );
|
||||
fSeeDrawingsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 19 );
|
||||
fBulletProofed = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 20 );
|
||||
fCorrupted = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 21 );
|
||||
fSaveUim = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 22 );
|
||||
fFilterPrivacy = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 23 );
|
||||
fInFReplaceNoRM = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 24 );
|
||||
fSeenRepairs = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 25 );
|
||||
fHasXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 26 );
|
||||
fSeeScriptAnchorsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 27 );
|
||||
fValidateXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 28 );
|
||||
fSaveIfInvalidXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 29 );
|
||||
fShowXMLErrors = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 30 );
|
||||
fAlwaysMergeEmptyNamespace = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 31 );
|
||||
|
||||
if ( size > 544/* && fib->m_FibNew.nFibNew > Fib2000*/)
|
||||
{
|
||||
cpMaxListCacheMainDoc = FormatUtils::BytesToInt32( bytes, 544, size ); //unused
|
||||
|
||||
cpMaxListCacheMainDoc = FormatUtils::BytesToInt32( bytes, 544, size );
|
||||
//split bytes 548,549 into bits
|
||||
fDoNotEmbedSystemFont = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 0 );
|
||||
fWordCompact = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 1 );
|
||||
fLiveRecover = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 2 );
|
||||
fEmbedFactoids = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 3 );
|
||||
fFactoidXML = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 4 );
|
||||
fFactoidAllDone = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 5 );
|
||||
fFolioPrint = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 6 );
|
||||
fReverseFolio = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 7 );
|
||||
iTextLineEnding = (short)FormatUtils::GetUIntFromBytesBits( ( bytes + 548 ), 2, 8, 3 );
|
||||
fHideFcc = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 11 );
|
||||
fAcetateShowMarkup = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 12 );
|
||||
fAcetateShowAtn = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 13 );
|
||||
fAcetateShowInsDel = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 14 );
|
||||
fAcetateShowProps = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 15 );
|
||||
|
||||
//split bytes 548,549 into bits
|
||||
fDoNotEmbedSystemFont = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 0 );
|
||||
fWordCompact = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 1 );
|
||||
fLiveRecover = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 2 );
|
||||
fEmbedFactoids = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 3 );
|
||||
fFactoidXML = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 4 );
|
||||
fFactoidAllDone = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 5 );
|
||||
fFolioPrint = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 6 );
|
||||
fReverseFolio = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 7 );
|
||||
iTextLineEnding = (short)FormatUtils::GetUIntFromBytesBits( ( bytes + 548 ), 2, 8, 3 );
|
||||
fHideFcc = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 11 );
|
||||
fAcetateShowMarkup = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 12 );
|
||||
fAcetateShowAtn = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 13 );
|
||||
fAcetateShowInsDel = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 14 );
|
||||
fAcetateShowProps = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 15 );
|
||||
istdTableDflt = FormatUtils::BytesToUInt16( bytes, 550, size );
|
||||
verCompat = FormatUtils::BytesToUInt16( bytes, 552, size );
|
||||
grfFmtFilter = FormatUtils::BytesToUInt16( bytes, 554, size );
|
||||
iFolioPages = FormatUtils::BytesToInt16 ( bytes, 556, size );
|
||||
cpgText = FormatUtils::BytesToUInt16( bytes, 558, size );
|
||||
cpMinRMText = FormatUtils::BytesToInt32 ( bytes, 560, size );
|
||||
cpMinRMFtn = FormatUtils::BytesToInt32 ( bytes, 564, size );
|
||||
cpMinRMHdd = FormatUtils::BytesToInt32 ( bytes, 568, size );
|
||||
cpMinRMAtn = FormatUtils::BytesToInt32 ( bytes, 572, size );
|
||||
cpMinRMEdn = FormatUtils::BytesToInt32 ( bytes, 576, size );
|
||||
cpMinRMTxbx = FormatUtils::BytesToInt32 ( bytes, 580, size );
|
||||
cpMinRMHdrTxbx = FormatUtils::BytesToInt32 ( bytes, 584, size );
|
||||
rsidRoot = FormatUtils::BytesToInt32 ( bytes, 588, size );
|
||||
//unused 2
|
||||
|
||||
istdTableDflt = FormatUtils::BytesToUInt16( bytes, 550, size );
|
||||
verCompat = FormatUtils::BytesToUInt16( bytes, 552, size );
|
||||
grfFmtFilter = FormatUtils::BytesToUInt16( bytes, 554, size );
|
||||
iFolioPages = FormatUtils::BytesToInt16( bytes, 556, size );
|
||||
cpgText = FormatUtils::BytesToUInt16( bytes, 558, size );
|
||||
cpMinRMText = FormatUtils::BytesToInt32( bytes, 560, size );
|
||||
cpMinRMFtn = FormatUtils::BytesToInt32( bytes, 564, size );
|
||||
cpMinRMHdd = FormatUtils::BytesToInt32( bytes, 568, size );
|
||||
cpMinRMAtn = FormatUtils::BytesToInt32( bytes, 572, size );
|
||||
cpMinRMEdn = FormatUtils::BytesToInt32( bytes, 576, size );
|
||||
cpMinRMTxbx = FormatUtils::BytesToInt32( bytes, 580, size );
|
||||
cpMinRMHdrTxbx = FormatUtils::BytesToInt32( bytes, 584, size );
|
||||
rsidRoot = FormatUtils::BytesToInt32( bytes, 588, size );
|
||||
if ( size > 594/* && fib->m_FibNew.nFibNew > Fib2002*/)
|
||||
{
|
||||
//split bytes 592,593,594,595 into bits
|
||||
fTreatLockAtnAsReadOnly = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 0 );
|
||||
fStyleLock = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 1 );
|
||||
fAutoFmtOverride = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 2 );
|
||||
fRemoveWordML = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 3 );
|
||||
fApplyCustomXForm = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 4 );
|
||||
fStyeLockEnforced = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 5 );
|
||||
fFakeLockAtn = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 6 );
|
||||
fIgnoreMixedContent = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 7 );
|
||||
fShowPlaceholderText = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 8 );
|
||||
grf = FormatUtils::GetUIntFromBytesBits( ( bytes + 592 ), 4, 9, 23 );
|
||||
|
||||
if ( size == 610 )
|
||||
{
|
||||
//split bytes 592,593,594,595 into bits
|
||||
fTreatLockAtnAsReadOnly = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 0 );
|
||||
fStyleLock = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 1 );
|
||||
fAutoFmtOverride = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 2 );
|
||||
fRemoveWordML = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 3 );
|
||||
fApplyCustomXForm = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 4 );
|
||||
fStyeLockEnforced = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 5 );
|
||||
fFakeLockAtn = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 6 );
|
||||
fIgnoreMixedContent = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 7 );
|
||||
fShowPlaceholderText = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 8 );
|
||||
grf = FormatUtils::GetUIntFromBytesBits( ( bytes + 592 ), 4, 9, 23 );
|
||||
//split bytes 596 and 597 into bits
|
||||
fReadingModeInkLockDown = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 0 );
|
||||
fAcetateShowInkAtn = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 1 );
|
||||
fFilterDttm = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 2 );
|
||||
fEnforceDocProt = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 3 );
|
||||
iDocProtCur = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 596 ), 2, 4, 3 );
|
||||
fDispBkSpSaved = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 7 );
|
||||
|
||||
//split bytes 596 and 597 into bits
|
||||
fReadingModeInkLockDown = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 0 );
|
||||
fAcetateShowInkAtn = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 1 );
|
||||
fFilterDttm = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 2 );
|
||||
fEnforceDocProt = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 3 );
|
||||
iDocProtCur = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 596 ), 2, 4, 3 );
|
||||
fDispBkSpSaved = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 7 );
|
||||
|
||||
dxaPageLock = FormatUtils::BytesToInt16( bytes, 598, size );
|
||||
dyaPageLock = FormatUtils::BytesToInt16( bytes, 600, size );
|
||||
pctFontLock = FormatUtils::BytesToInt32( bytes, 602, size );
|
||||
grfitbid = bytes[606];
|
||||
//unsigned char 607 is unused
|
||||
ilfoMacAtCleanup = FormatUtils::BytesToUInt16( bytes, 608, size );
|
||||
}
|
||||
dxaPageLock = FormatUtils::BytesToInt16( bytes, 598, size );
|
||||
dyaPageLock = FormatUtils::BytesToInt16( bytes, 600, size );
|
||||
pctFontLock = FormatUtils::BytesToInt32( bytes, 602, size );
|
||||
grfitbid = bytes[606];
|
||||
//unsigned char 607 is unused
|
||||
ilfoMacAtCleanup = FormatUtils::BytesToUInt16( bytes, 608, size );
|
||||
|
||||
if ( size > 616/* && fib->m_FibNew.nFibNew > Fib2003*/)
|
||||
{
|
||||
//4 bytes reserved
|
||||
bool fRMTrackFormatting = FormatUtils::GetBitFromBytes( ( bytes + 620 ), 2, 0 );
|
||||
bool fRMTrackMoves = FormatUtils::GetBitFromBytes( ( bytes + 620 ), 2, 1 );
|
||||
//dopMth = 34 bytes from 624 = 658
|
||||
|
||||
if ( size > 674/* && fib->m_FibNew.nFibNew > Fib2007*/)
|
||||
{
|
||||
if ( size > 690/* && fib->m_FibNew.nFibNew > Fib2010*/)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -54,6 +54,7 @@ namespace DocFileFormat
|
||||
|
||||
friend class SettingsMapping;
|
||||
|
||||
bool bDisplayBackgroundShape;
|
||||
private:
|
||||
// True when facing pages should be printed
|
||||
bool fFacingPages;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -33,7 +33,6 @@
|
||||
#include "DrawingPrimitives.h"
|
||||
#include "VirtualStreamReader.h"
|
||||
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
DrawingPrimitive * DrawingPrimitive::Create(VirtualStreamReader* reader, int length, short dpk)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -133,14 +133,25 @@ namespace DocFileFormat
|
||||
pos = tStream.GetPosition();
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
crypt_data_aes.hashAlgorithm = CRYPT_METHOD::SHA1; //by AlgIDHash -> 0x0000 || 0x8004
|
||||
crypt_data_aes.spinCount = 50000;
|
||||
switch(AlgIDHash)
|
||||
{
|
||||
case 0x8003: crypt_data_aes.hashAlgorithm = CRYPT_METHOD::MD5; break;
|
||||
case 0x0000:
|
||||
case 0x8004: crypt_data_aes.hashAlgorithm = CRYPT_METHOD::SHA1; break;
|
||||
}
|
||||
crypt_data_aes.spinCount = 0;
|
||||
|
||||
switch(AlgID)
|
||||
{
|
||||
case 0x0000:
|
||||
if (fAES) crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB;
|
||||
if (fCryptoAPI) crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::RC4;
|
||||
crypt_data_aes.keySize = KeySize / 8;
|
||||
case 0x6801:
|
||||
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::RC4;
|
||||
crypt_data_aes.keySize = KeySize / 8;
|
||||
|
||||
if (crypt_data_aes.keySize == 0) crypt_data_aes.keySize = 5; // 40 bit
|
||||
break;
|
||||
case 0x660E:
|
||||
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB;
|
||||
@ -156,16 +167,11 @@ namespace DocFileFormat
|
||||
break;
|
||||
}
|
||||
|
||||
switch(ProviderType)
|
||||
{
|
||||
case 0x0001: crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::RC4; break;
|
||||
case 0x0018: crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB; break;
|
||||
}
|
||||
|
||||
|
||||
//switch(ProviderType)
|
||||
//{
|
||||
// case 0x0001: crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::RC4; break;
|
||||
// case 0x0018: crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB; break;
|
||||
//}
|
||||
}
|
||||
|
||||
//RELEASEARRAYOBJECTS( bytes );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -50,8 +50,8 @@ namespace DocFileFormat
|
||||
|
||||
EncryptionHeader( FileInformationBlock* fib, POLE::Stream* tableStream );
|
||||
private:
|
||||
CRYPT::CryptRC4Data crypt_data_rc4;
|
||||
CRYPT::ECMADecryptor::_cryptData crypt_data_aes;
|
||||
bool bStandard;
|
||||
CRYPT::_rc4CryptData crypt_data_rc4;
|
||||
CRYPT::_ecmaCryptData crypt_data_aes;
|
||||
bool bStandard;
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -54,24 +54,24 @@ namespace DocFileFormat
|
||||
|
||||
int id = 0;
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:endnotes" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:endnotes", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
int cp = ( m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr + m_document->FIB->m_RgLw97.ccpAtn );
|
||||
|
||||
while ( cp <= ( m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr + m_document->FIB->m_RgLw97.ccpAtn + m_document->FIB->m_RgLw97.ccpEdn - 2 ) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:endnote" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( id ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:endnote", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( id ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
while ( ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpHdr - m_document->FIB->m_RgLw97.ccpAtn ) < (*m_document->IndividualEndnotesPlex)[id + 1] )
|
||||
{
|
||||
@ -95,14 +95,14 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:endnote" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:endnote");
|
||||
id++;
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:endnotes" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:endnotes");
|
||||
|
||||
m_context->_docx->EndnotesXML = std::wstring( m_pXmlWriter->GetXmlString() );
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -49,39 +49,46 @@ namespace DocFileFormat
|
||||
unsigned char fNested:1;
|
||||
unsigned char fHasSep:1;
|
||||
};
|
||||
|
||||
public:
|
||||
static const int STRUCTURE_SIZE = 2;
|
||||
|
||||
FieldCharacter():
|
||||
fldch(0), grffld(0)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~FieldCharacter()
|
||||
{
|
||||
}
|
||||
FieldCharacter() : fldch(0), grffld(0) {}
|
||||
virtual ~FieldCharacter() {}
|
||||
|
||||
virtual ByteStructure* ConstructObject (VirtualStreamReader* pReader, int length)
|
||||
{
|
||||
FieldCharacter* pFldChar = new FieldCharacter();
|
||||
FieldCharacter* pFldChar = new FieldCharacter();
|
||||
if (pFldChar)
|
||||
{
|
||||
pFldChar->fldch = pReader->ReadByte();
|
||||
pFldChar->grffld = pReader->ReadByte();
|
||||
|
||||
#ifdef _DEBUG
|
||||
grffldEnd* __grffldEnd = (grffldEnd*)(&pFldChar->grffld);
|
||||
int dbg = 0;
|
||||
#endif
|
||||
pFldChar->fldch = pReader->ReadByte();
|
||||
pFldChar->grffld = pReader->ReadByte();
|
||||
}
|
||||
|
||||
return static_cast<ByteStructure*>(pFldChar);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
unsigned char fldch;
|
||||
unsigned char grffld;
|
||||
};
|
||||
|
||||
class ListNumCache: public ByteStructure
|
||||
{
|
||||
public:
|
||||
static const int STRUCTURE_SIZE = 4;
|
||||
|
||||
ListNumCache() : value(-1) {}
|
||||
virtual ~ListNumCache() {}
|
||||
|
||||
virtual ByteStructure* ConstructObject (VirtualStreamReader* pReader, int length)
|
||||
{
|
||||
ListNumCache* pList = new ListNumCache();
|
||||
if (pList)
|
||||
{
|
||||
pList->value = pReader->ReadInt32();
|
||||
}
|
||||
|
||||
return static_cast<ByteStructure*>(pList);
|
||||
}
|
||||
|
||||
int value;
|
||||
};
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -507,9 +507,9 @@ namespace DocFileFormat
|
||||
class FileInformationBlock
|
||||
{
|
||||
public:
|
||||
bool m_bOlderVersion;
|
||||
int m_CodePage;
|
||||
FibBase m_FibBase;
|
||||
bool m_bOlderVersion;
|
||||
int m_CodePage;
|
||||
FibBase m_FibBase;
|
||||
|
||||
RgW97 m_RgW97;
|
||||
RgLw97 m_RgLw97;
|
||||
@ -1162,6 +1162,8 @@ namespace DocFileFormat
|
||||
{
|
||||
//Read the FibRgCswNew
|
||||
m_FibNew.nFibNew = (FibVersion)reader.ReadUInt16();
|
||||
|
||||
if (m_FibNew.nFibNew == 0) m_FibNew.nFibNew = Fib1997;
|
||||
m_FibNew.cQuickSavesNew = reader.ReadUInt16();
|
||||
}
|
||||
}
|
||||
@ -1187,9 +1189,9 @@ namespace DocFileFormat
|
||||
m_FibBase.fDot = FormatUtils::BitmaskToBool((int)flag16, 0x0001);
|
||||
m_FibBase.fGlsy = FormatUtils::BitmaskToBool((int)flag16, 0x0002);
|
||||
m_FibBase.fComplex = FormatUtils::BitmaskToBool((int)flag16, 0x0002);
|
||||
m_FibBase.fHasPic = FormatUtils::BitmaskToBool((int)flag16, 0x0008);
|
||||
m_FibBase.cQuickSaves = (WORD)(((int)flag16 & 0x00F0) >> 4);
|
||||
m_FibBase.fEncrypted = FormatUtils::BitmaskToBool((int)flag16, 0x0100);
|
||||
m_FibBase.fHasPic = FormatUtils::BitmaskToBool((int)flag16, 0x0008);
|
||||
m_FibBase.cQuickSaves = (WORD)(((int)flag16 & 0x00F0) >> 4);
|
||||
m_FibBase.fEncrypted = FormatUtils::BitmaskToBool((int)flag16, 0x0100);
|
||||
m_FibBase.fWhichTblStm = FormatUtils::BitmaskToBool((int)flag16, 0x0200);
|
||||
m_FibBase.fReadOnlyRecommended = FormatUtils::BitmaskToBool((int)flag16, 0x0400);
|
||||
m_FibBase.fWriteReservation = FormatUtils::BitmaskToBool((int)flag16, 0x0800);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -54,87 +54,92 @@ namespace DocFileFormat
|
||||
|
||||
this->_ctx->_docx->RegisterFontTable();
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:fonts" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fonts", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
int sz_fonts = table->Data.size();
|
||||
int sz_fonts = table->Data.size();
|
||||
int users_fonts = 0;
|
||||
|
||||
for ( std::vector<ByteStructure*>::iterator iter = table->Data.begin(); iter != table->Data.end(); iter++ )
|
||||
{
|
||||
FontFamilyName* font = dynamic_cast<FontFamilyName*>( *iter );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:font" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:name" ), FormatUtils::XmlEncode(font->xszFtn, true).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:font", TRUE );
|
||||
|
||||
std::wstring name_ = FormatUtils::XmlEncode(font->xszFtn, true);
|
||||
if (name_.empty())
|
||||
name_ = L"UserFont_" + std::to_wstring(++users_fonts);
|
||||
m_pXmlWriter->WriteAttribute( L"w:name", name_);
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
//alternative name
|
||||
if ( ( font->xszAlt != std::wstring( _T( "" ) ) ) && ( font->xszAlt.length() > 0 ) )
|
||||
if ( ( font->xszAlt != std::wstring( L"" ) ) && ( font->xszAlt.length() > 0 ) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:altName" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::XmlEncode(font->xszAlt, true).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:altName" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:altName", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(font->xszAlt, true));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:altName" );
|
||||
}
|
||||
|
||||
//charset
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:charset" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( font->chs, _T( "%02x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:charset" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:charset", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( font->chs, L"%02x" ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:charset" );
|
||||
|
||||
//font family
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:family"), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString( font->ff, &FontFamily[0][0], 6, 11 ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:family" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:family", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString( font->ff, &FontFamily[0][0], 6, 11 ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:family" );
|
||||
|
||||
//panose
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:panose1"), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:panose1", TRUE );
|
||||
|
||||
std::wstring wstr( _T( "" ) );
|
||||
std::wstring wstr( L"" );
|
||||
|
||||
for ( unsigned int i = 0; i < font->panoseSize; i++ )
|
||||
{
|
||||
wstr += FormatUtils::IntToFormattedWideString( font->panose[i], _T( "%02x" ) );
|
||||
wstr += FormatUtils::IntToFormattedWideString( font->panose[i], L"%02x" );
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), wstr.c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:panose1" ) );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", wstr);
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:panose1" );
|
||||
|
||||
//pitch
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:pitch"), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString( font->prq, &FontPitch[0][0], 3, 9 ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:pitch" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:pitch", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString( font->prq, &FontPitch[0][0], 3, 9 ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:pitch" );
|
||||
|
||||
//truetype
|
||||
if ( !font->fTrueType )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:notTrueType"), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "true" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:notTrueType" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:notTrueType", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", L"true" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:notTrueType" );
|
||||
}
|
||||
|
||||
//font signature
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:sig"), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:usb0" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield0, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:usb1" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield1, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:usb2" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield2, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:usb3" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield3, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:csb0" ), FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield0, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:csb1" ), FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield1, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:sig" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:sig", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:usb0", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield0, L"%08x" ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:usb1", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield1, L"%08x" ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:usb2", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield2, L"%08x" ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:usb3", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield3, L"%08x" ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:csb0", FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield0, L"%08x" ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:csb1", FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield1, L"%08x" ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:sig" );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:font" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:font" );
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T("w:fonts") );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:fonts");
|
||||
|
||||
this->_ctx->_docx->FontTableXML = std::wstring( m_pXmlWriter->GetXmlString() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -42,19 +42,19 @@ namespace DocFileFormat
|
||||
{
|
||||
static const wchar_t FontFamily[6][11] =
|
||||
{
|
||||
_T( "auto" ),
|
||||
_T( "roman" ),
|
||||
_T( "swiss" ),
|
||||
_T( "modern" ),
|
||||
_T( "script" ),
|
||||
_T( "decorative" )
|
||||
L"auto",
|
||||
L"roman",
|
||||
L"swiss",
|
||||
L"modern",
|
||||
L"script",
|
||||
L"decorative"
|
||||
};
|
||||
|
||||
static const wchar_t FontPitch[3][9] =
|
||||
{
|
||||
_T( "default" ),
|
||||
_T( "fixed" ),
|
||||
_T( "variable" )
|
||||
L"default",
|
||||
L"fixed",
|
||||
L"variable"
|
||||
};
|
||||
|
||||
class FontTableMapping: public AbstractOpenXmlMapping, public IMapping
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -45,16 +45,16 @@ namespace DocFileFormat
|
||||
m_document = static_cast<WordDocument*>( visited );
|
||||
|
||||
//start the document
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:ftr" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:ftr", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
//convert the footer text
|
||||
_lastValidPapx = (*(m_document->AllPapxFkps->begin()))->grppapx[0];
|
||||
@ -77,9 +77,14 @@ namespace DocFileFormat
|
||||
{
|
||||
//this PAPX is for a table
|
||||
//cp = writeTable( cp, tai.iTap );
|
||||
int start_table_cp = cp;
|
||||
|
||||
Table table( this, cp, ( ( tai.iTap > 0 ) ? ( 1 ) : ( 0 ) ) );
|
||||
table.Convert( this );
|
||||
cp = table.GetCPEnd();
|
||||
|
||||
if (cp == start_table_cp)
|
||||
cp++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -88,8 +93,8 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:ftr" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:ftr" );
|
||||
|
||||
m_context->_docx->FooterXMLList.push_back( std::wstring( m_pXmlWriter->GetXmlString() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -54,27 +54,29 @@ namespace DocFileFormat
|
||||
|
||||
int id = 0;
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:footnotes" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:footnotes", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
int cp = m_document->FIB->m_RgLw97.ccpText;
|
||||
|
||||
while ( cp <= ( m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn - 2 ) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:footnote" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( id ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:footnote", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( id ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
while ( ( cp - m_document->FIB->m_RgLw97.ccpText ) < (*m_document->IndividualFootnotesPlex)[id + 1] )
|
||||
{
|
||||
int cpStart = cp;
|
||||
|
||||
int fc = m_document->FindFileCharPos(cp);
|
||||
if (fc < 0) break;
|
||||
|
||||
@ -93,16 +95,18 @@ namespace DocFileFormat
|
||||
//this PAPX is for a normal paragraph
|
||||
cp = writeParagraph( cp );
|
||||
}
|
||||
while (cp <= cpStart) //conv_fQioC665ib4ngHkDGY4__docx.doc
|
||||
cp++;
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:footnote" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:footnote");
|
||||
id++;
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:footnotes" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:footnotes");
|
||||
|
||||
m_context->_docx->FootnotesXML = std::wstring(m_pXmlWriter->GetXmlString());
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
170
ASCOfficeDocFile/DocDocxConverter/FormFieldData.cpp
Normal file
170
ASCOfficeDocFile/DocDocxConverter/FormFieldData.cpp
Normal file
@ -0,0 +1,170 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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 "FormFieldData.h"
|
||||
#include "../../Common/DocxFormat/Source/Base/unicode_util.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
std::wstring readXstz(VirtualStreamReader *reader)
|
||||
{
|
||||
if (!reader) return L"";
|
||||
|
||||
unsigned short flags, cch, chTerm;
|
||||
|
||||
cch = reader->ReadUInt16();
|
||||
|
||||
std::wstring ret;
|
||||
|
||||
if (cch > 0)
|
||||
{
|
||||
std::shared_ptr<unsigned char>data = std::shared_ptr<unsigned char>(reader->ReadBytes(cch * 2, true));
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
ret = std::wstring((wchar_t*)data.get(), cch );
|
||||
#else
|
||||
ret = convertUtf16ToWString((UTF16*)data.get(), cch );
|
||||
#endif
|
||||
}
|
||||
chTerm = reader->ReadUInt16();
|
||||
|
||||
return ret;
|
||||
};
|
||||
void FormFieldData::_HFD::read(VirtualStreamReader *reader)
|
||||
{
|
||||
if (!reader) return;
|
||||
}
|
||||
void FormFieldData::_FFData::read(VirtualStreamReader *reader)
|
||||
{
|
||||
if (!reader) return;
|
||||
|
||||
bExist = true;
|
||||
|
||||
unsigned short flags;
|
||||
|
||||
version = reader->ReadUInt32();
|
||||
flags = reader->ReadUInt16();
|
||||
|
||||
iType = GETBITS(flags, 0, 1);
|
||||
iRes = GETBITS(flags, 2, 6);
|
||||
fOwnHelp = GETBIT(flags, 7);
|
||||
fOwnStat = GETBIT(flags, 8);
|
||||
fProt = GETBIT(flags, 9);
|
||||
iSize = GETBIT(flags, 10);
|
||||
iTypeTxt = GETBITS(flags, 11, 13);
|
||||
fRecalc = GETBIT(flags, 14);
|
||||
fHasListBox = GETBIT(flags, 15);
|
||||
|
||||
cch_field = reader->ReadUInt16();
|
||||
hps = reader->ReadUInt16();
|
||||
|
||||
xstzName = readXstz(reader);
|
||||
xstzTextDef = readXstz(reader);
|
||||
|
||||
wDef = reader->ReadUInt16();
|
||||
|
||||
xstzTextFormat = readXstz(reader);
|
||||
xstzHelpText = readXstz(reader);
|
||||
xstzStatText = readXstz(reader);
|
||||
xstzEntryMcr = readXstz(reader);
|
||||
xstzExitMcr = readXstz(reader);
|
||||
}
|
||||
FormFieldData::FormFieldData( int type, const CharacterPropertyExceptions* chpx, POLE::Stream* stream, bool bOlderVersion_ )
|
||||
{
|
||||
binary_data_size = 0;
|
||||
|
||||
if (!chpx) return;
|
||||
|
||||
int fc = -1;
|
||||
bool bNilPICFAndBinData = false;
|
||||
|
||||
for ( std::list<SinglePropertyModifier>::iterator iter = chpx->grpprl->begin(); iter != chpx->grpprl->end(); iter++ )
|
||||
{
|
||||
switch ( iter->OpCode)
|
||||
{
|
||||
case sprmCFSpec:
|
||||
{
|
||||
}
|
||||
break;
|
||||
case sprmCFFldVanish:
|
||||
{
|
||||
}
|
||||
break;
|
||||
case sprmCPicLocation:
|
||||
{
|
||||
fc = FormatUtils::BytesToInt32( iter->Arguments, 0, iter->argumentsSize );
|
||||
}
|
||||
break;
|
||||
case sprmCRsidText:
|
||||
{
|
||||
rsid = FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize), L"%08x");
|
||||
}
|
||||
break;
|
||||
case sprmCFData:
|
||||
{
|
||||
bNilPICFAndBinData = true; // or bPICFAndOfficeArtData - shape, pic, ole
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fc >= 0 && bNilPICFAndBinData)
|
||||
{
|
||||
VirtualStreamReader reader(stream, fc, bOlderVersion_);
|
||||
|
||||
int sz_stream = reader.GetSize();
|
||||
|
||||
int lcb = reader.ReadUInt32();
|
||||
int cbHeader = reader.ReadUInt16();
|
||||
|
||||
if (cbHeader != 0x44) return;
|
||||
|
||||
//ignored
|
||||
reader.ReadBytes(62, false);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case 1:
|
||||
HFD.read(&reader);
|
||||
case 2:
|
||||
FFData.read(&reader);
|
||||
break;
|
||||
default:
|
||||
binary_data_size = lcb - cbHeader;
|
||||
binary_data = std::shared_ptr<unsigned char>(reader.ReadBytes(binary_data_size, true));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
126
ASCOfficeDocFile/DocDocxConverter/FormFieldData.h
Normal file
126
ASCOfficeDocFile/DocDocxConverter/FormFieldData.h
Normal file
@ -0,0 +1,126 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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 "IVisitable.h"
|
||||
#include "CharacterPropertyExceptions.h"
|
||||
#include "StructuredStorageReader.h"
|
||||
#include "VirtualStreamReader.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
class FormFieldData : public IVisitable
|
||||
{
|
||||
public:
|
||||
|
||||
struct _HFD
|
||||
{
|
||||
bool bExist = false;
|
||||
|
||||
bool fNew = false;
|
||||
bool fNoHist = false;
|
||||
bool fImageMap = false;
|
||||
bool fLocation = false;
|
||||
bool fTooltip = false;
|
||||
|
||||
std::wstring clsid;
|
||||
|
||||
_UINT32 streamVersion = 0;
|
||||
bool hlstmfHasMoniker = false;
|
||||
bool hlstmfIsAbsolute = false;
|
||||
bool hlstmfSiteGaveDisplayName = false;
|
||||
bool hlstmfHasLocationStr = false;
|
||||
bool hlstmfHasDisplayName = false;
|
||||
bool hlstmfHasGUID = false;
|
||||
bool hlstmfHasCreationTime = false;
|
||||
bool hlstmfHasFrameName = false;
|
||||
bool hlstmfMonikerSavedAsStr = false;
|
||||
bool hlstmfAbsFromGetdataRel = false;
|
||||
|
||||
std::wstring displayName;
|
||||
std::wstring targetFrameName;
|
||||
std::wstring moniker;
|
||||
|
||||
std::wstring oleMoniker_clsid;
|
||||
std::wstring oleMoniker_data;
|
||||
std::wstring location;
|
||||
|
||||
std::wstring guid;
|
||||
_UINT64 fileTime = 0;
|
||||
|
||||
void read(VirtualStreamReader* reader);
|
||||
};
|
||||
struct _FFData
|
||||
{
|
||||
bool bExist = false;
|
||||
_UINT32 version = 0;
|
||||
|
||||
unsigned char iType = 0;
|
||||
unsigned char iRes = 0;
|
||||
bool fOwnHelp = false;
|
||||
bool fOwnStat = false;
|
||||
bool fProt = false;
|
||||
bool iSize = false;
|
||||
unsigned char iTypeTxt = 0;
|
||||
bool fRecalc = false;
|
||||
bool fHasListBox = false;
|
||||
|
||||
unsigned short cch_field = 0;
|
||||
unsigned short hps = 0;
|
||||
std::wstring xstzName;
|
||||
std::wstring xstzTextDef;
|
||||
unsigned short wDef = 0;
|
||||
std::wstring xstzTextFormat;
|
||||
std::wstring xstzHelpText;
|
||||
std::wstring xstzStatText;
|
||||
std::wstring xstzEntryMcr;
|
||||
std::wstring xstzExitMcr;
|
||||
|
||||
//STTB hsttbDropList;
|
||||
void read(VirtualStreamReader* reader);
|
||||
};
|
||||
FormFieldData( int type, const CharacterPropertyExceptions* chpx, POLE::Stream* stream, bool bOlderVersion );
|
||||
virtual ~FormFieldData() {}
|
||||
private:
|
||||
friend class FormFieldDataMapping;
|
||||
|
||||
std::wstring name;
|
||||
std::wstring rsid;
|
||||
|
||||
_FFData FFData;
|
||||
_HFD HFD;
|
||||
|
||||
std::shared_ptr<unsigned char> binary_data;
|
||||
int binary_data_size;
|
||||
|
||||
};
|
||||
}
|
||||
87
ASCOfficeDocFile/DocDocxConverter/FormFieldDataMapping.h
Normal file
87
ASCOfficeDocFile/DocDocxConverter/FormFieldDataMapping.h
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* 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 Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* 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 "ConversionContext.h"
|
||||
#include "FormFieldData.h"
|
||||
|
||||
#include "AbstractOpenXmlMapping.h"
|
||||
#include "IMapping.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
class FormFieldDataMapping: public AbstractOpenXmlMapping, public IMapping
|
||||
{
|
||||
public:
|
||||
FormFieldDataMapping(XMLTools::CStringXmlWriter* writer, ConversionContext* context, IMapping* caller)
|
||||
: AbstractOpenXmlMapping(writer), m_context(NULL),_caller(NULL)
|
||||
{
|
||||
m_context = context;
|
||||
_caller = caller;
|
||||
}
|
||||
|
||||
virtual void Apply(IVisitable* visited)
|
||||
{
|
||||
FormFieldData* ffData = static_cast<FormFieldData*>(visited);
|
||||
|
||||
if ( ffData == NULL ) return;
|
||||
|
||||
if (ffData->FFData.bExist)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:ffData");
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:name", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val", ffData->FFData.xstzName);
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:name", true, true );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:calcOnExit", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val", ffData->FFData.fRecalc);
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:calcOnExit", true, true );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:textInput");
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:maxLength", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val", ffData->FFData.cch_field);
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:maxLength", true, true );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:textInput" );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:ffData" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
ConversionContext* m_context;
|
||||
IMapping* _caller;
|
||||
};
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -45,16 +45,16 @@ namespace DocFileFormat
|
||||
m_document = static_cast<WordDocument*>( visited );
|
||||
|
||||
//start the document
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:hdr" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:hdr", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
//convert the header text
|
||||
_lastValidPapx = (*(m_document->AllPapxFkps->begin()))->grppapx[0];
|
||||
@ -88,8 +88,8 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:hdr" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:hdr");
|
||||
|
||||
m_context->_docx->HeaderXMLList.push_back( std::wstring( m_pXmlWriter->GetXmlString() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -33,6 +33,9 @@
|
||||
|
||||
#include "IMapping.h"
|
||||
|
||||
#define GETBITS(from, numL, numH) ((from & (((1 << (numH - numL + 1)) - 1) << numL)) >> numL)
|
||||
#define GETBIT(from, num) ((from & (1 << num)) != 0)
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
class IVisitable
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -40,7 +40,7 @@ namespace DocFileFormat
|
||||
_type = type;
|
||||
}
|
||||
|
||||
LanguageIdMapping::LanguageIdMapping (XMLTools::XMLElement<wchar_t>* parentElement, LanguageType type) : PropertiesMapping(NULL)
|
||||
LanguageIdMapping::LanguageIdMapping (XMLTools::XMLElement* parentElement, LanguageType type) : PropertiesMapping(NULL)
|
||||
{
|
||||
_parent = parentElement;
|
||||
_type = type;
|
||||
@ -59,31 +59,31 @@ namespace DocFileFormat
|
||||
{
|
||||
std::wstring langcode = getLanguageCode( dynamic_cast<LanguageId*>( lid ) );
|
||||
|
||||
XMLTools::XMLAttribute<wchar_t>* att = NULL;
|
||||
XMLTools::XMLAttribute* att = NULL;
|
||||
|
||||
switch ( _type )
|
||||
{
|
||||
case Default:
|
||||
{
|
||||
att = new XMLTools::XMLAttribute<wchar_t>( L"w:val", langcode.c_str() );
|
||||
att = new XMLTools::XMLAttribute( L"w:val", langcode);
|
||||
}
|
||||
break;
|
||||
|
||||
case EastAsian:
|
||||
{
|
||||
att = new XMLTools::XMLAttribute<wchar_t>( L"w:eastAsia", langcode.c_str() );
|
||||
att = new XMLTools::XMLAttribute( L"w:eastAsia", langcode);
|
||||
}
|
||||
break;
|
||||
|
||||
case Complex:
|
||||
{
|
||||
att = new XMLTools::XMLAttribute<wchar_t>( L"w:bidi", langcode.c_str() );
|
||||
att = new XMLTools::XMLAttribute( L"w:bidi", langcode);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
att = new XMLTools::XMLAttribute<wchar_t>( L"w:val", langcode.c_str() );
|
||||
att = new XMLTools::XMLAttribute( L"w:val", langcode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -91,7 +91,7 @@ namespace DocFileFormat
|
||||
if (m_pXmlWriter)
|
||||
{
|
||||
// !!!TODO!!!
|
||||
m_pXmlWriter->WriteString( att->GetXMLString().c_str() );
|
||||
m_pXmlWriter->WriteString( att->GetXMLString());
|
||||
}
|
||||
else if ( _parent != NULL )
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -49,14 +49,14 @@ namespace DocFileFormat
|
||||
{
|
||||
public:
|
||||
LanguageIdMapping( XMLTools::CStringXmlWriter* writer, LanguageType type );
|
||||
LanguageIdMapping( XMLTools::XMLElement<wchar_t>* parentElement, LanguageType type );
|
||||
LanguageIdMapping( XMLTools::XMLElement* parentElement, LanguageType type );
|
||||
virtual ~LanguageIdMapping();
|
||||
void Apply( IVisitable* lid );
|
||||
|
||||
static std::wstring getLanguageCode( LanguageId* lid );
|
||||
|
||||
private:
|
||||
LanguageType _type;
|
||||
XMLTools::XMLElement<wchar_t>* _parent;
|
||||
LanguageType _type;
|
||||
XMLTools::XMLElement* _parent;
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -50,36 +50,49 @@ namespace DocFileFormat
|
||||
void MainDocumentMapping::Apply(IVisitable* visited)
|
||||
{
|
||||
m_document = static_cast<WordDocument*>(visited);
|
||||
m_context->_docx->RegisterDocument();
|
||||
|
||||
|
||||
// Header
|
||||
m_pXmlWriter->WriteNodeBegin(_T("?xml version=\"1.0\" encoding=\"UTF-8\"?"));
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:document"), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin(L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:document", TRUE );
|
||||
|
||||
// Namespaces
|
||||
m_pXmlWriter->WriteAttribute(_T("xmlns:w"), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute(_T("xmlns:v"), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute(_T("xmlns:o"), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute(_T("xmlns:w10"), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute(_T("xmlns:r"), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteAttribute(_T("xmlns:m"), _T("http://schemas.openxmlformats.org/officeDocument/2006/math"));
|
||||
m_pXmlWriter->WriteAttribute(L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute(L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute(L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute(L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute(L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteAttribute(L"xmlns:m", L"http://schemas.openxmlformats.org/officeDocument/2006/math");
|
||||
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpc"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:mc"), _T("http://schemas.openxmlformats.org/markup-compatibility/2006"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wp14"),_T("http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wp"), _T("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:w14"), _T("http://schemas.microsoft.com/office/word/2010/wordml"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpg"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpi"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingInk"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wne"), _T("http://schemas.microsoft.com/office/word/2006/wordml"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wps"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingShape"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("mc:Ignorable"), _T("w14 wp14"));
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wpc", L"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wp14", L"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wp", L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:w14", L"http://schemas.microsoft.com/office/word/2010/wordml");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wpg", L"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wpi", L"http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wne", L"http://schemas.microsoft.com/office/word/2006/wordml");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wps", L"http://schemas.microsoft.com/office/word/2010/wordprocessingShape");
|
||||
//m_pXmlWriter->WriteAttribute(L"mc:Ignorable", L"w14 wp14");
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:body"), FALSE );
|
||||
if ((m_document->GetOfficeArt()) && (m_document->GetOfficeArt()->GetShapeBackgound()))
|
||||
{
|
||||
m_document->DocProperties->bDisplayBackgroundShape = true;
|
||||
ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeBackgound();
|
||||
|
||||
// Convert the document
|
||||
m_pXmlWriter->WriteNodeBegin ( L"w:background", TRUE);
|
||||
m_pXmlWriter->WriteAttribute ( L"w:color", L"FFFFFF");
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, NULL, NULL, _caller);
|
||||
pShape->Convert(&oVmlWriter);
|
||||
m_pXmlWriter->WriteNodeEnd (L"w:background");
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:body", FALSE );
|
||||
|
||||
// Convert the document
|
||||
_lastValidPapx = NULL;
|
||||
if (m_document->AllPapxFkps->empty() == false)
|
||||
{
|
||||
@ -110,11 +123,14 @@ namespace DocFileFormat
|
||||
TableInfo tai(papx);
|
||||
if (tai.fInTable)
|
||||
{
|
||||
int cpStart = cp;
|
||||
//this PAPX is for a table
|
||||
//cp = writeTable( cp, tai.iTap );
|
||||
Table table( this, cp, ( ( tai.iTap > 0 ) ? ( 1 ) : ( 0 ) ) );
|
||||
table.Convert(this);
|
||||
cp = table.GetCPEnd();
|
||||
while (cp <= cpStart) //conv_eznHsm8em2unSv6_2QE__docx.doc
|
||||
cp++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -175,8 +191,8 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:body" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:document" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:body" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:document" );
|
||||
|
||||
m_context->_docx->DocumentXML = std::wstring(m_pXmlWriter->GetXmlString());
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -72,7 +72,7 @@ public:
|
||||
|
||||
if (m_Data)
|
||||
{
|
||||
rdUShort = FormatUtils::BytesToUInt16 (m_Data, m_Position, m_Size);
|
||||
rdUShort = DocFileFormat::FormatUtils::BytesToUInt16 (m_Data, m_Position, m_Size);
|
||||
m_Position += sizeof(rdUShort);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ public:
|
||||
|
||||
if (m_Data)
|
||||
{
|
||||
rdShort = FormatUtils::BytesToInt16 (m_Data, m_Position, m_Size);
|
||||
rdShort = DocFileFormat::FormatUtils::BytesToInt16 (m_Data, m_Position, m_Size);
|
||||
m_Position += sizeof(rdShort);
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ public:
|
||||
|
||||
if (m_Data)
|
||||
{
|
||||
rdInt = FormatUtils::BytesToInt32 (m_Data, m_Position, m_Size);
|
||||
rdInt = DocFileFormat::FormatUtils::BytesToInt32 (m_Data, m_Position, m_Size);
|
||||
m_Position += sizeof(rdInt);
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ public:
|
||||
|
||||
if (m_Data )
|
||||
{
|
||||
rdUInt = FormatUtils::BytesToUInt32 (m_Data, m_Position, m_Size);
|
||||
rdUInt = DocFileFormat::FormatUtils::BytesToUInt32 (m_Data, m_Position, m_Size);
|
||||
m_Position += sizeof(rdUInt);
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -63,17 +63,17 @@ namespace DocFileFormat
|
||||
m_xmldocument->RegisterNumbering();
|
||||
|
||||
//start the document
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:numbering" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:numbering", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
PictureBulletsMapping();
|
||||
|
||||
@ -82,37 +82,37 @@ namespace DocFileFormat
|
||||
for (std::list<ListData*>::iterator iter = rglst->listData.begin(); iter != rglst->listData.end(); ++iter, ++i)
|
||||
{
|
||||
//start abstractNum
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:abstractNum" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:abstractNumId" ), FormatUtils::IntToWideString( i ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:abstractNum", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:abstractNumId", FormatUtils::IntToWideString( i ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
//nsid
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:nsid" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( (*iter)->lsid, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:nsid", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( (*iter)->lsid, L"%08x" ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
//multiLevelType
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:multiLevelType" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:multiLevelType", TRUE );
|
||||
|
||||
if ( (*iter)->fHybrid )
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "hybridMultilevel" ) );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", L"hybridMultilevel" );
|
||||
}
|
||||
else if ( (*iter)->fSimpleList )
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "singleLevel" ) );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", L"singleLevel" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "multilevel" ) );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", L"multilevel" );
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
//template
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:tmpl" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( (*iter)->tplc, _T( "%08x" ) ).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:tmpl", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( (*iter)->tplc, L"%08x"));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
// writes the levels
|
||||
size_t length = (*iter)->rglvl->size();
|
||||
@ -124,33 +124,33 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//end abstractNum
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:abstractNum" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:abstractNum" );
|
||||
}
|
||||
//write old style numbering (сложносоставных не сущестует)
|
||||
for (std::list<NumberingDescriptor>::iterator iter = rglst->listNumbering.begin(); iter != rglst->listNumbering.end(); ++iter, ++i)
|
||||
{
|
||||
//start abstractNum
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:abstractNum" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:abstractNumId" ), FormatUtils::IntToWideString( i ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:abstractNum", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:abstractNumId", FormatUtils::IntToWideString( i ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
////nsid
|
||||
//m_pXmlWriter->WriteNodeBegin( _T( "w:nsid" ), TRUE );
|
||||
//m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( (*iter)->lsid, _T( "%08x" ) ).c_str() );
|
||||
//m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
//m_pXmlWriter->WriteNodeBegin( L"w:nsid", TRUE );
|
||||
//m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( (*iter)->lsid, L"%08x" ) ));
|
||||
//m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
//multiLevelType
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:multiLevelType" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:multiLevelType", TRUE );
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "singleLevel" ) );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", L"singleLevel" );
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
LevelMapping(*iter, 0);
|
||||
|
||||
//end abstractNum
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:abstractNum" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:abstractNum" );
|
||||
}
|
||||
|
||||
//write the overrides
|
||||
@ -159,36 +159,36 @@ namespace DocFileFormat
|
||||
ListFormatOverride* lfo = m_document->listFormatOverrideTable->at(i);
|
||||
|
||||
//start num
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:num" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:numId" ), FormatUtils::IntToWideString(i + 1).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:num", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:numId", FormatUtils::IntToWideString(i + 1));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
int index = FindIndexbyId( rglst->listData, lfo->lsid );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:abstractNumId" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString( index ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:abstractNumId", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString( index ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
for (std::vector<ListFormatOverrideLevel*>::const_iterator iter = lfo->rgLfoLvl.begin(); iter != lfo->rgLfoLvl.end(); ++iter)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:lvlOverride" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:lvlOverride", TRUE );
|
||||
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:ilvl" ), FormatUtils::IntToWideString( (*iter)->ilvl ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:ilvl", FormatUtils::IntToWideString( (*iter)->ilvl ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
if ( ( (*iter)->fStartAt ) && ( !(*iter)->fFormatting ) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:startOverride" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString( (*iter)->iStartAt ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:startOverride", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString( (*iter)->iStartAt ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
}
|
||||
|
||||
LevelMapping((*iter)->lvl, 0, ListData::ISTD_NIL);
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:lvlOverride"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:lvlOverride");
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T( "w:num"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:num");
|
||||
}
|
||||
|
||||
if (m_document->listFormatOverrideTable->empty() && !rglst->listNumbering.empty())
|
||||
@ -196,20 +196,20 @@ namespace DocFileFormat
|
||||
i = 0;
|
||||
for (std::list<NumberingDescriptor>::iterator iter = rglst->listNumbering.begin(); iter != rglst->listNumbering.end(); ++iter, ++i)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:num" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:numId" ), FormatUtils::IntToWideString(i+1).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:num", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:numId", FormatUtils::IntToWideString(i+1));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:abstractNumId" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString( i ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:abstractNumId", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString( i ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T( "w:num"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:num");
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:numbering"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:numbering");
|
||||
|
||||
m_xmldocument->NumberingXML = std::wstring(m_pXmlWriter->GetXmlString());
|
||||
}
|
||||
@ -255,8 +255,10 @@ namespace DocFileFormat
|
||||
|
||||
if (!FormatUtils::IsControlSymbol(xchBullet))
|
||||
{
|
||||
ret.push_back(lvl->xst[0]);
|
||||
ret.push_back(L'\0');
|
||||
ret.push_back(lvl->xst[0]);//??? xchBullet
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -275,7 +277,7 @@ namespace DocFileFormat
|
||||
{
|
||||
newResult = find_if((result + 1), lvl->xst.end(), &NumberingMapping::IsPlaceholder);
|
||||
|
||||
ret += _T( "%" );
|
||||
ret += L"%";
|
||||
ret += FormatUtils::IntToWideString(*result + 1);
|
||||
ret += std::wstring((result + 1), newResult);
|
||||
result = newResult;
|
||||
@ -305,13 +307,11 @@ namespace DocFileFormat
|
||||
if (!FormatUtils::IsControlSymbol(xchBullet))
|
||||
{
|
||||
ret.push_back(lvl.xst[0]);
|
||||
ret.push_back(L'\0');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.push_back(L'\xF0B7');
|
||||
ret.push_back(L'\0');
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -319,7 +319,7 @@ namespace DocFileFormat
|
||||
std::wstring strBefore = lvl.xst.substr(0, Before);
|
||||
std::wstring strAfter = lvl.xst.substr(Before, After);
|
||||
|
||||
ret = strBefore + _T( "%1" ) + strAfter ;
|
||||
ret = strBefore + L"%1" + strAfter ;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -342,134 +342,134 @@ namespace DocFileFormat
|
||||
{
|
||||
if (bOlderVersion && nfc > 5)
|
||||
{
|
||||
if (nfc == 0xff) return std::wstring( _T( "bullet" ) );
|
||||
else return std::wstring( _T( "none" ) );
|
||||
if (nfc == 0xff) return std::wstring( L"bullet");
|
||||
else return std::wstring( L"none");
|
||||
}
|
||||
|
||||
switch ( nfc )
|
||||
{
|
||||
case 0:
|
||||
return std::wstring( _T( "decimal" ) );
|
||||
return std::wstring( L"decimal" );
|
||||
case 1:
|
||||
return std::wstring( _T( "upperRoman" ) );
|
||||
return std::wstring( L"upperRoman" );
|
||||
case 2:
|
||||
return std::wstring( _T( "lowerRoman" ) );
|
||||
return std::wstring( L"lowerRoman" );
|
||||
case 3:
|
||||
return std::wstring( _T( "upperLetter" ) );
|
||||
return std::wstring( L"upperLetter");
|
||||
case 4:
|
||||
return std::wstring( _T( "lowerLetter" ) );
|
||||
return std::wstring( L"lowerLetter");
|
||||
case 5:
|
||||
return std::wstring( _T( "ordinal" ) );
|
||||
return std::wstring( L"ordinal" );
|
||||
case 6:
|
||||
return std::wstring( _T( "cardinalText" ) );
|
||||
return std::wstring( L"cardinalText" );
|
||||
case 7:
|
||||
return std::wstring( _T( "ordinalText" ) );
|
||||
return std::wstring( L"ordinalText" );
|
||||
case 8:
|
||||
return std::wstring( _T( "hex" ) );
|
||||
return std::wstring( L"hex" );
|
||||
case 9:
|
||||
return std::wstring( _T( "chicago" ) );
|
||||
return std::wstring( L"chicago" );
|
||||
case 10:
|
||||
return std::wstring( _T( "ideographDigital" ) );
|
||||
return std::wstring( L"ideographDigital" );
|
||||
case 11:
|
||||
return std::wstring( _T( "japaneseCounting" ) );
|
||||
return std::wstring( L"japaneseCounting" );
|
||||
case 12:
|
||||
return std::wstring( _T( "aiueo" ) );
|
||||
return std::wstring( L"aiueo" );
|
||||
case 13:
|
||||
return std::wstring( _T( "iroha" ) );
|
||||
return std::wstring( L"iroha" );
|
||||
case 14:
|
||||
return std::wstring( _T( "decimalFullWidth" ) );
|
||||
return std::wstring( L"decimalFullWidth" );
|
||||
case 15:
|
||||
return std::wstring( _T( "decimalHalfWidth" ) );
|
||||
return std::wstring( L"decimalHalfWidth" );
|
||||
case 16:
|
||||
return std::wstring( _T( "japaneseLegal" ) );
|
||||
return std::wstring( L"japaneseLegal" );
|
||||
case 17:
|
||||
return std::wstring( _T( "japaneseDigitalTenThousand" ) );
|
||||
return std::wstring( L"japaneseDigitalTenThousand" );
|
||||
case 18:
|
||||
return std::wstring( _T( "decimalEnclosedCircle" ) );
|
||||
return std::wstring( L"decimalEnclosedCircle" );
|
||||
case 19:
|
||||
return std::wstring( _T( "decimalFullWidth2" ) );
|
||||
return std::wstring( L"decimalFullWidth2" );
|
||||
case 20:
|
||||
return std::wstring( _T( "aiueoFullWidth" ) );
|
||||
return std::wstring( L"aiueoFullWidth" );
|
||||
case 21:
|
||||
return std::wstring( _T( "irohaFullWidth" ) );
|
||||
return std::wstring( L"irohaFullWidth" );
|
||||
case 22:
|
||||
return std::wstring( _T( "decimalZero" ) );
|
||||
return std::wstring( L"decimalZero" );
|
||||
case 23:
|
||||
return std::wstring( _T( "bullet" ) );
|
||||
return std::wstring( L"bullet" );
|
||||
case 24:
|
||||
return std::wstring( _T( "ganada" ) );
|
||||
return std::wstring( L"ganada" );
|
||||
case 25:
|
||||
return std::wstring( _T( "chosung" ) );
|
||||
return std::wstring( L"chosung" );
|
||||
case 26:
|
||||
return std::wstring( _T( "decimalEnclosedFullstop" ) );
|
||||
return std::wstring( L"decimalEnclosedFullstop" );
|
||||
case 27:
|
||||
return std::wstring( _T( "decimalEnclosedParen" ) );
|
||||
return std::wstring( L"decimalEnclosedParen" );
|
||||
case 28:
|
||||
return std::wstring( _T( "decimalEnclosedCircleChinese" ) );
|
||||
return std::wstring( L"decimalEnclosedCircleChinese" );
|
||||
case 29:
|
||||
return std::wstring( _T( "ideographEnclosedCircle" ) );
|
||||
return std::wstring( L"ideographEnclosedCircle" );
|
||||
case 30:
|
||||
return std::wstring( _T( "ideographTraditional" ) );
|
||||
return std::wstring( L"ideographTraditional" );
|
||||
case 31:
|
||||
return std::wstring( _T( "ideographZodiac" ) );
|
||||
return std::wstring( L"ideographZodiac" );
|
||||
case 32:
|
||||
return std::wstring( _T( "ideographZodiacTraditional" ) );
|
||||
return std::wstring( L"ideographZodiacTraditional" );
|
||||
case 33:
|
||||
return std::wstring( _T( "taiwaneseCounting" ) );
|
||||
return std::wstring( L"taiwaneseCounting" );
|
||||
case 34:
|
||||
return std::wstring( _T( "ideographLegalTraditional" ) );
|
||||
return std::wstring( L"ideographLegalTraditional" );
|
||||
case 35:
|
||||
return std::wstring( _T( "taiwaneseCountingThousand" ) );
|
||||
return std::wstring( L"taiwaneseCountingThousand" );
|
||||
case 36:
|
||||
return std::wstring( _T( "taiwaneseDigital" ) );
|
||||
return std::wstring( L"taiwaneseDigital" );
|
||||
case 37:
|
||||
return std::wstring( _T( "chineseCounting" ) );
|
||||
return std::wstring( L"chineseCounting" );
|
||||
case 38:
|
||||
return std::wstring( _T( "chineseLegalSimplified" ) );
|
||||
return std::wstring( L"chineseLegalSimplified" );
|
||||
case 39:
|
||||
return std::wstring( _T( "chineseCountingThousand" ) );
|
||||
return std::wstring( L"chineseCountingThousand" );
|
||||
case 40:
|
||||
return std::wstring( _T( "koreanDigital" ) );
|
||||
return std::wstring( L"koreanDigital" );
|
||||
case 41:
|
||||
return std::wstring( _T( "koreanCounting" ) );
|
||||
return std::wstring( L"koreanCounting" );
|
||||
case 42:
|
||||
return std::wstring( _T( "koreanLegal" ) );
|
||||
return std::wstring( L"koreanLegal" );
|
||||
case 43:
|
||||
return std::wstring( _T( "koreanDigital2" ) );
|
||||
return std::wstring( L"koreanDigital2" );
|
||||
case 44:
|
||||
return std::wstring( _T( "vietnameseCounting" ) );
|
||||
return std::wstring( L"vietnameseCounting" );
|
||||
case 45:
|
||||
return std::wstring( _T( "russianLower" ) );
|
||||
return std::wstring( L"russianLower" );
|
||||
case 46:
|
||||
return std::wstring( _T( "russianUpper" ) );
|
||||
return std::wstring( L"russianUpper" );
|
||||
case 47:
|
||||
return std::wstring( _T( "none" ) );
|
||||
return std::wstring( L"none" );
|
||||
case 48:
|
||||
return std::wstring( _T( "numberInDash" ) );
|
||||
return std::wstring( L"numberInDash" );
|
||||
case 49:
|
||||
return std::wstring( _T( "hebrew1" ) );
|
||||
return std::wstring( L"hebrew1" );
|
||||
case 50:
|
||||
return std::wstring( _T( "hebrew2" ) );
|
||||
return std::wstring( L"hebrew2" );
|
||||
case 51:
|
||||
return std::wstring( _T( "arabicAlpha" ) );
|
||||
return std::wstring( L"arabicAlpha" );
|
||||
case 52:
|
||||
return std::wstring( _T( "arabicAbjad" ) );
|
||||
return std::wstring( L"arabicAbjad" );
|
||||
case 53:
|
||||
return std::wstring( _T( "hindiVowels" ) );
|
||||
return std::wstring( L"hindiVowels" );
|
||||
case 54:
|
||||
return std::wstring( _T( "hindiConsonants" ) );
|
||||
return std::wstring( L"hindiConsonants" );
|
||||
case 55:
|
||||
return std::wstring( _T( "hindiNumbers" ) );
|
||||
return std::wstring( L"hindiNumbers" );
|
||||
case 56:
|
||||
return std::wstring( _T( "hindiCounting" ) );
|
||||
return std::wstring( L"hindiCounting" );
|
||||
case 57:
|
||||
return std::wstring( _T( "thaiLetters" ) );
|
||||
return std::wstring( L"thaiLetters" );
|
||||
case 58:
|
||||
return std::wstring( _T( "thaiNumbers" ) );
|
||||
return std::wstring( L"thaiNumbers" );
|
||||
case 59:
|
||||
return std::wstring( _T( "thaiCounting" ) );
|
||||
return std::wstring( L"thaiCounting" );
|
||||
default:
|
||||
return std::wstring( _T( "decimal" ) );
|
||||
return std::wstring( L"decimal" );
|
||||
}
|
||||
}
|
||||
|
||||
@ -486,22 +486,22 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:lvl" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:ilvl" ), FormatUtils::IntToWideString(level).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:lvl", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:ilvl", FormatUtils::IntToWideString(level));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:start" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString(lvl.iStartAt).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:start", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString(lvl.iStartAt));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:numFmt" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), GetNumberFormatWideString(lvl.nfc, true).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:numFmt", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", GetNumberFormatWideString(lvl.nfc, true));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
//// suffix
|
||||
// m_pXmlWriter->WriteNodeBegin( _T( "w:suff" ), TRUE );
|
||||
// m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString(lvl.ixchFollow, &FollowingCharMap[0][0], 3, 8).c_str());
|
||||
// m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
// m_pXmlWriter->WriteNodeBegin( L"w:suff", TRUE );
|
||||
// m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString(lvl.ixchFollow, &FollowingCharMap[0][0], 3, 8));
|
||||
// m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
// Number level text
|
||||
std::wstring lvlText = GetLvlText(lvl, isSymbol, lvl.cbTextBefore, lvl.cbTextAfter);
|
||||
@ -515,33 +515,33 @@ namespace DocFileFormat
|
||||
//}
|
||||
if (!lvlText.empty())
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:lvlText"), TRUE);
|
||||
m_pXmlWriter->WriteAttribute(_T("w:val"), lvlText.c_str());
|
||||
m_pXmlWriter->WriteNodeEnd(_T( ""), TRUE);
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:lvlText",TRUE);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val",lvlText);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", TRUE);
|
||||
}
|
||||
|
||||
// jc
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:lvlJc" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString(lvl.jc, &LevelJustificationMap[0][0], 3, 7).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:lvlJc", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString(lvl.jc, &LevelJustificationMap[0][0], 3, 7));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
// pPr
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:pPr" ), FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:pPr"));
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:pPr", FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:pPr");
|
||||
|
||||
// rPr
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:rPr" ), FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:rPr", FALSE );
|
||||
|
||||
if (!fontFamily.empty())
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:rFonts" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:rFonts", TRUE );
|
||||
// w:hint="default"
|
||||
m_pXmlWriter->WriteAttribute(_T("w:hAnsi"), fontFamily.c_str());
|
||||
m_pXmlWriter->WriteAttribute(_T("w:ascii"), fontFamily.c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute(L"w:hAnsi",fontFamily);
|
||||
m_pXmlWriter->WriteAttribute(L"w:ascii",fontFamily);
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
}
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:rPr"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:rPr");
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:lvl"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:lvl");
|
||||
}
|
||||
|
||||
void NumberingMapping::LevelMapping(const ListLevel* lvl, unsigned int level, short styleIndex)
|
||||
@ -556,58 +556,58 @@ namespace DocFileFormat
|
||||
|
||||
// Проверяем шрифт
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:lvl" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:ilvl" ), FormatUtils::IntToWideString(level).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:lvl", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:ilvl", FormatUtils::IntToWideString(level));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
// starts at
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:start" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString(lvl->iStartAt).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:start", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString(lvl->iStartAt));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
// number format
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:numFmt" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), GetNumberFormatWideString(lvl->nfc).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:numFmt", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", GetNumberFormatWideString(lvl->nfc));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
// suffix
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:suff" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString(lvl->ixchFollow, &FollowingCharMap[0][0], 3, 8).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:suff", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString(lvl->ixchFollow, &FollowingCharMap[0][0], 3, 8));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
// style
|
||||
// The style id is used for a reverse reference.
|
||||
// It can happen that the reference points to the wrong style.
|
||||
|
||||
if (styleIndex != ListData::ISTD_NIL)
|
||||
if (styleIndex != ListData::ISTD_NIL && styleIndex < m_document->Styles->Styles->size())
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:pStyle" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::XmlEncode(StyleSheetMapping::MakeStyleId(m_document->Styles->Styles->at(styleIndex))).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:pStyle", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(StyleSheetMapping::MakeStyleId(m_document->Styles->Styles->at(styleIndex))));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
}
|
||||
|
||||
// Number level text
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:lvlText"), TRUE);
|
||||
m_pXmlWriter->WriteAttribute(_T("w:val"), GetLvlText(lvl, cpMapping.CheckIsSymbolFont()).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd(_T( ""), TRUE);
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:lvlText",TRUE);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val",GetLvlText(lvl, cpMapping.CheckIsSymbolFont()));
|
||||
m_pXmlWriter->WriteNodeEnd(L"",TRUE);
|
||||
|
||||
WriteLevelPictureBullet(lvl->grpprlChpx);
|
||||
|
||||
// legacy
|
||||
if (lvl->fWord6)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:legacy" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:legacy" ), _T( "1" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:legacy", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:legacy", L"1" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
}
|
||||
// jc
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:lvlJc" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString(lvl->jc, &LevelJustificationMap[0][0], 3, 7).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:lvlJc", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString(lvl->jc, &LevelJustificationMap[0][0], 3, 7));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
// pPr
|
||||
bool isBidi = false;
|
||||
ParagraphPropertiesMapping oppMapping(m_pXmlWriter, m_context, m_document, NULL, isBidi);
|
||||
@ -617,7 +617,7 @@ namespace DocFileFormat
|
||||
|
||||
m_pXmlWriter->WriteString(oWriterTemp.GetXmlString());
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:lvl"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:lvl");
|
||||
}
|
||||
|
||||
void NumberingMapping::PictureBulletsMapping()
|
||||
@ -637,10 +637,10 @@ namespace DocFileFormat
|
||||
|
||||
if ((pict.mfp.mm > 98) && (pict.shapeContainer != NULL))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:numPicBullet" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:numPicBulletId" ), FormatUtils::IntToWideString( iter->first ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:pict" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:numPicBullet", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:numPicBulletId", FormatUtils::IntToWideString( iter->first ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:pict" );
|
||||
|
||||
//inline picture + bullete props
|
||||
if (pict.blipStoreEntry != NULL)
|
||||
@ -657,8 +657,8 @@ namespace DocFileFormat
|
||||
pict.shapeContainer->Convert(&oShape);
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:pict"));
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:numPicBullet"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:pict");
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:numPicBullet");
|
||||
}
|
||||
}
|
||||
|
||||
@ -670,7 +670,7 @@ namespace DocFileFormat
|
||||
{
|
||||
if (grpprlChpx)
|
||||
{
|
||||
unsigned int cp = 0;
|
||||
unsigned int index = 0;
|
||||
bool isPictureBullet = false;
|
||||
|
||||
for (std::list<SinglePropertyModifier>::const_iterator iter = grpprlChpx->grpprl->begin(); iter != grpprlChpx->grpprl->end(); ++iter)
|
||||
@ -679,7 +679,7 @@ namespace DocFileFormat
|
||||
{
|
||||
case sprmCPbiIBullet:
|
||||
{
|
||||
cp = FormatUtils::BytesToUInt32(iter->Arguments, 0, iter->argumentsSize);
|
||||
index = FormatUtils::BytesToUInt32(iter->Arguments, 0, iter->argumentsSize);
|
||||
}break;
|
||||
|
||||
case sprmCPbiGrf:
|
||||
@ -691,10 +691,10 @@ namespace DocFileFormat
|
||||
|
||||
if (isPictureBullet)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:lvlPicBulletId"), TRUE);
|
||||
m_pXmlWriter->WriteAttribute(_T("w:val"), FormatUtils::IntToWideString(cp).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE);
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:lvlPicBulletId",TRUE);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val",FormatUtils::IntToWideString(index));
|
||||
m_pXmlWriter->WriteNodeEnd(L"",TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -52,9 +52,9 @@ namespace DocFileFormat
|
||||
|
||||
static const wchar_t LevelJustificationMap[3][7] =
|
||||
{
|
||||
_T("left"),
|
||||
_T("center"),
|
||||
_T("right")
|
||||
L"left",
|
||||
L"center",
|
||||
L"right"
|
||||
};
|
||||
|
||||
class NumberingMapping: public AbstractOpenXmlMapping, public IMapping
|
||||
@ -89,4 +89,4 @@ namespace DocFileFormat
|
||||
WordDocument* m_document;
|
||||
WordprocessingDocument* m_xmldocument;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -34,6 +34,7 @@
|
||||
#include "OfficeDrawing/RecordFactory.h"
|
||||
|
||||
#include "OfficeDrawing/DrawingContainer.h"
|
||||
#include "OfficeDrawing/DrawingRecord.h"
|
||||
#include "OfficeDrawing/DrawingGroup.h"
|
||||
#include "OfficeDrawing/GroupContainer.h"
|
||||
#include "OfficeDrawing/Shape.h"
|
||||
@ -57,7 +58,7 @@ namespace DocFileFormat
|
||||
|
||||
public:
|
||||
|
||||
OfficeArtContent (const FileInformationBlock* pFIB, POLE::Stream* pStream): m_pDrawingGroupData(NULL)
|
||||
OfficeArtContent (const FileInformationBlock* pFIB, POLE::Stream* pStream): m_pDrawingGroupData(NULL), m_pBackgroud(NULL)
|
||||
{
|
||||
VirtualStreamReader oStearmReader(pStream, 0 , pFIB->m_bOlderVersion);
|
||||
|
||||
@ -87,15 +88,23 @@ namespace DocFileFormat
|
||||
{
|
||||
// the child is a subgroup
|
||||
GroupContainer* group = static_cast<GroupContainer*>(groupChild);
|
||||
group->Index = i;
|
||||
drawing.container->Children[i] = group;
|
||||
if (group)
|
||||
{
|
||||
group->Index = i;
|
||||
}
|
||||
}
|
||||
else if (ShapeContainer::TYPE_CODE_0xF004 == groupChild->TypeCode)
|
||||
{
|
||||
// the child is a shape
|
||||
ShapeContainer* shape = static_cast<ShapeContainer*>(groupChild);
|
||||
shape->Index = i;
|
||||
drawing.container->Children[i] = shape;
|
||||
if (shape)
|
||||
{
|
||||
shape->Index = i;
|
||||
if (shape->isBackground())
|
||||
{
|
||||
m_pBackgroud = shape;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -112,7 +121,10 @@ namespace DocFileFormat
|
||||
for ( std::list<OfficeArtWordDrawing>::iterator iter = m_arrDrawings.begin(); iter != m_arrDrawings.end(); ++iter)
|
||||
RELEASEOBJECT(iter->container);
|
||||
}
|
||||
|
||||
inline ShapeContainer* GetShapeBackgound()
|
||||
{
|
||||
return m_pBackgroud;
|
||||
}
|
||||
inline ShapeContainer* GetShapeContainer (int spid)
|
||||
{
|
||||
ShapeContainer* ret = NULL;
|
||||
@ -138,7 +150,6 @@ namespace DocFileFormat
|
||||
if (shape->GetShapeID() == spid)
|
||||
{
|
||||
ret = container;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -150,7 +161,7 @@ namespace DocFileFormat
|
||||
|
||||
if (shape->GetShapeID() == spid)
|
||||
{
|
||||
ret = container;
|
||||
ret = container;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -174,7 +185,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
ShapeContainer* m_pBackgroud;
|
||||
DrawingGroup* m_pDrawingGroupData;
|
||||
std::list<OfficeArtWordDrawing> m_arrDrawings;
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -60,7 +60,7 @@ namespace DocFileFormat
|
||||
_size.cx = Right - Left;
|
||||
_size.cy = Bottom - Top;
|
||||
|
||||
rcgBounds = DocFormatUtils::Rectangle (_point, _size);
|
||||
rcgBounds = DocFileFormat::Rectangle (_point, _size);
|
||||
}
|
||||
|
||||
virtual ~ChildAnchor()
|
||||
@ -75,7 +75,7 @@ namespace DocFileFormat
|
||||
public:
|
||||
|
||||
/// Rectangle that describes the bounds of the anchor
|
||||
DocFormatUtils::Rectangle rcgBounds;
|
||||
DocFileFormat::Rectangle rcgBounds;
|
||||
int Left;
|
||||
int Top;
|
||||
int Right;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user