mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-11 02:16:02 +08:00
Compare commits
1011 Commits
core/devel
...
core-linux
| Author | SHA1 | Date | |
|---|---|---|---|
| 26a6a77b8d | |||
| 90aa7973ed | |||
| b2363c02c0 | |||
| 32b59120aa | |||
| 7186b56b64 | |||
| 6247490047 | |||
| f30e14c421 | |||
| e340a2af22 | |||
| 6a5cddf0ce | |||
| 312728fe9a | |||
| 182da130da | |||
| eb3ba8c42e | |||
| dec099b19b | |||
| 21762360ac | |||
| 563fe88842 | |||
| 0e085fbb13 | |||
| ed409e745a | |||
| 4bc58482b3 | |||
| 89ee039a05 | |||
| 5d5b1202c7 | |||
| c7646fd813 | |||
| b1d406b448 | |||
| ea37eab86e | |||
| d045609523 | |||
| 9336448ca9 | |||
| 5830e7824a | |||
| 821feb51b5 | |||
| 547979cd9b | |||
| c4481eb125 | |||
| ad0f2c89e0 | |||
| e15c75b6aa | |||
| b2fb7f0fe7 | |||
| 410e5ebd75 | |||
| 9c57088ef1 | |||
| 24230e12a3 | |||
| 2acef0d4a2 | |||
| aca5ffa36f | |||
| 4fc3726f37 | |||
| 2682e1fbac | |||
| f5c3ae779b | |||
| 068c60afa0 | |||
| 5b8ca5b417 | |||
| acfd12ea30 | |||
| a04b83cada | |||
| a7bf12c052 | |||
| 5c01b23dee | |||
| db11b75a2e | |||
| 2ba4c18cdf | |||
| b264f20f29 | |||
| 5e04ea62f7 | |||
| 3d1db63c0e | |||
| f124d18256 | |||
| 9bffb65dcb | |||
| 2fbcc3832f | |||
| 97b4311e95 | |||
| 228b3a52e9 | |||
| 2f2236646d | |||
| 30603d0561 | |||
| 933af771b7 | |||
| c04a537d69 | |||
| e49d78db47 | |||
| 99ec420ee5 | |||
| f764b034a1 | |||
| 73fe023460 | |||
| 242af3c80e | |||
| 7756e4b8bd | |||
| 56a1d1f627 | |||
| 11bd4ff61d | |||
| 93a06d7f86 | |||
| 76d2d429b7 | |||
| c6de37dbad | |||
| d022e669f0 | |||
| 184e79bae1 | |||
| e6581671c8 | |||
| e0a1c688bf | |||
| 9e0b301179 | |||
| 8680fb2e0e | |||
| c7c605a970 | |||
| 23d648d92d | |||
| b098c98dbb | |||
| b88726beaf | |||
| b2d3e5e194 | |||
| a8315efae0 | |||
| 3781cf6774 | |||
| 7e36d47991 | |||
| 419a01bd09 | |||
| 804a01cab3 | |||
| 931d6aa17c | |||
| 2861539949 | |||
| 281dad68fb | |||
| 04ba432cde | |||
| 61c943a3b2 | |||
| 9fdc7641b3 | |||
| 1029ee9101 | |||
| 9ef5bec2a5 | |||
| 93132eb8a0 | |||
| 9828c25e51 | |||
| db1204288b | |||
| 26c3d37be5 | |||
| 077ea08368 | |||
| 98eab74e97 | |||
| 2a7e88ca76 | |||
| 369596b860 | |||
| 15af8f561a | |||
| 58f8d13d71 | |||
| d6413057e2 | |||
| 008382213b | |||
| dd5b4a719b | |||
| 3d198bc211 | |||
| 05ff75eeb2 | |||
| 597414ea6b | |||
| 7f06ce7064 | |||
| adf39680b6 | |||
| ce77d478e3 | |||
| e1e14ae243 | |||
| 4f6e364225 | |||
| 26c02c5766 | |||
| 0d8c668f95 | |||
| 310cff0dfe | |||
| 7f6611ab21 | |||
| bb37e348f5 | |||
| 6b5e03df5e | |||
| d0e0109560 | |||
| dc33f7f197 | |||
| 85f4aa5679 | |||
| d2c5ea026f | |||
| 419ec7ed33 | |||
| 5f7d9eea02 | |||
| 709ee1942d | |||
| 5039cec847 | |||
| e59eff3a16 | |||
| 2206b3b366 | |||
| a2d37e8a22 | |||
| b13eba5f01 | |||
| a48058c7d5 | |||
| ab76aff379 | |||
| b8b8a14268 | |||
| e5ef749718 | |||
| 5d524369b8 | |||
| e78fc0befc | |||
| 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 | |||
| 2836fee493 | |||
| 0b096a4c46 |
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
|
||||
@ -58,7 +58,7 @@
|
||||
|
||||
#include <boost/format.hpp>
|
||||
|
||||
namespace DocFormatUtils
|
||||
namespace DocFileFormat
|
||||
{
|
||||
typedef unsigned char Bool8;
|
||||
typedef unsigned short Bool16;
|
||||
@ -501,7 +501,7 @@ 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]);
|
||||
}
|
||||
@ -536,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]);
|
||||
}
|
||||
@ -566,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]);
|
||||
}
|
||||
@ -652,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]);
|
||||
}
|
||||
@ -771,6 +771,7 @@ namespace DocFormatUtils
|
||||
{
|
||||
return (std::to_wstring(value));
|
||||
}
|
||||
|
||||
static inline std::wstring DoubleToWideString(double value)
|
||||
{
|
||||
std::wstringstream src;
|
||||
@ -962,4 +963,3 @@ namespace DocFormatUtils
|
||||
};
|
||||
}
|
||||
|
||||
using namespace DocFormatUtils;
|
||||
|
||||
@ -393,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;
|
||||
|
||||
@ -76,4 +76,4 @@ namespace DocFileFormat
|
||||
|
||||
return static_cast<ByteStructure*>(newObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -232,7 +232,8 @@ namespace DocFileFormat
|
||||
|
||||
case sprmOldCIss:
|
||||
case sprmCIss:
|
||||
appendValueElement( parent, L"vertAlign", FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ), 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:
|
||||
@ -320,7 +321,7 @@ namespace DocFileFormat
|
||||
|
||||
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 ) );
|
||||
@ -372,7 +373,7 @@ namespace DocFileFormat
|
||||
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() )
|
||||
{
|
||||
@ -387,7 +388,8 @@ 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* eastAsia = new XMLTools::XMLAttribute( L"w:eastAsia" );
|
||||
@ -402,7 +404,8 @@ 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* ansi = new XMLTools::XMLAttribute( L"w:hAnsi" );
|
||||
|
||||
@ -68,12 +68,12 @@ namespace DocFileFormat
|
||||
int cp = m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr;
|
||||
|
||||
size_t count = m_document->AnnotationsReferencePlex->Elements.size();
|
||||
for (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( L"w:comment", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( index ));
|
||||
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());
|
||||
|
||||
@ -69,8 +69,13 @@ namespace OpenXmlContentTypes
|
||||
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";
|
||||
static const wchar_t* Pcz = L"image/x-pcz";
|
||||
}
|
||||
namespace DocPrContentTypes
|
||||
{
|
||||
static const wchar_t* App = L"application/vnd.openxmlformats-officedocument.extended-properties+xml";
|
||||
static const wchar_t* Core = L"application/vnd.openxmlformats-package.core-properties+xml";
|
||||
}
|
||||
|
||||
namespace WordprocessingMLContentTypes
|
||||
{
|
||||
// WordprocessingML content types
|
||||
@ -136,7 +141,7 @@ namespace OpenXmlNamespaces
|
||||
|
||||
namespace OpenXmlRelationshipTypes
|
||||
{
|
||||
static const wchar_t* CoreProperties = L"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-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 wchar_t* Theme = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
|
||||
@ -157,6 +162,7 @@ namespace OpenXmlRelationshipTypes
|
||||
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
|
||||
|
||||
@ -47,30 +47,17 @@ namespace DocFileFormat
|
||||
|
||||
virtual ~ConversionContext()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Adds a new RSID to the set
|
||||
inline void AddRsid(const std::wstring& rsid)
|
||||
{
|
||||
if (AllRsids.find(rsid) == AllRsids.end())
|
||||
AllRsids.insert(rsid);
|
||||
}
|
||||
|
||||
inline WordDocument* GetDocument()
|
||||
{
|
||||
return _doc;
|
||||
}
|
||||
|
||||
inline WordprocessingDocument* GetXmlDocument()
|
||||
{
|
||||
return _docx;
|
||||
}
|
||||
|
||||
public:
|
||||
WordprocessingDocument* _docx;
|
||||
WordDocument* _doc;
|
||||
/// A set thta contains all revision ids.
|
||||
|
||||
std::set<std::wstring> AllRsids;
|
||||
};
|
||||
}
|
||||
@ -63,9 +63,17 @@ namespace DocFileFormat
|
||||
{
|
||||
long Converter::Convert(WordDocument* doc, WordprocessingDocument* docx, const ProgressCallback* progress)
|
||||
{
|
||||
if (!doc || !docx) return S_FALSE;
|
||||
|
||||
ConversionContext context( doc, docx );
|
||||
|
||||
//Write styles.xml
|
||||
//Write fontTable.xml
|
||||
if (doc->FontTable)
|
||||
{
|
||||
FontTableMapping fontTableMapping( &context );
|
||||
doc->FontTable->Convert( &fontTableMapping );
|
||||
}
|
||||
//Write styles.xml
|
||||
if (doc->Styles)
|
||||
{
|
||||
StyleSheetMapping styleSheetMapping( &context );
|
||||
@ -88,9 +96,7 @@ namespace DocFileFormat
|
||||
return S_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Write numbering.xml
|
||||
//Write numbering.xml
|
||||
if (doc->listTable)
|
||||
{
|
||||
NumberingMapping numberingMapping( &context );
|
||||
@ -109,14 +115,6 @@ namespace DocFileFormat
|
||||
return S_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//Write fontTable.xml
|
||||
if (doc->FontTable)
|
||||
{
|
||||
FontTableMapping fontTableMapping( &context );
|
||||
doc->FontTable->Convert( &fontTableMapping );
|
||||
}
|
||||
|
||||
if ( progress != NULL )
|
||||
{
|
||||
progress->OnProgress( progress->caller, DOC_ONPROGRESSEVENT_ID, 875000 );
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -88,7 +88,7 @@ namespace DocFileFormat
|
||||
int DocumentMapping::getCurrentSection(int cp)
|
||||
{
|
||||
//if cp is the last char of a section, the next section will start at cp +1
|
||||
int current = 0;
|
||||
size_t current = 0;
|
||||
|
||||
for (std::vector<int>::iterator iter = m_document->SectionPlex->CharacterPositions.begin() + 1; iter != m_document->SectionPlex->CharacterPositions.end(); ++iter)
|
||||
{
|
||||
@ -107,7 +107,7 @@ namespace DocFileFormat
|
||||
{
|
||||
if ( !m_document->ListPlex ) return -1;
|
||||
|
||||
for (int i = 1; i < m_document->ListPlex->CharacterPositions.size(); i++)
|
||||
for (size_t i = 1; i < m_document->ListPlex->CharacterPositions.size(); i++)
|
||||
{
|
||||
if ((fc >= m_document->ListPlex->CharacterPositions[i-1]) && (fc_end <= m_document->ListPlex->CharacterPositions[i]))
|
||||
{
|
||||
@ -290,17 +290,15 @@ namespace DocFileFormat
|
||||
std::vector<wchar_t>* chpxChars = m_document->GetChars(fcChpxStart, fcChpxEnd, cp);
|
||||
|
||||
//search for bookmarks in the chars
|
||||
std::vector<int> bookmarks = searchBookmarks(chpxChars, cp);
|
||||
|
||||
//if there are bookmarks in this run, split the run into several runs
|
||||
if (!bookmarks.empty())
|
||||
std::vector<int> annot = searchAnnot(chpxChars, cp);
|
||||
if (!annot.empty())
|
||||
{
|
||||
std::list<std::vector<wchar_t>>* runs = splitCharList(chpxChars, &bookmarks);
|
||||
std::list<std::vector<wchar_t>>* runs = splitCharList(chpxChars, &annot);
|
||||
if (runs)
|
||||
{
|
||||
for (std::list<std::vector<wchar_t> >::iterator iter = runs->begin(); iter != runs->end(); ++iter)
|
||||
{
|
||||
if (writeBookmarks(cp))
|
||||
if (writeAnnotations(cp))
|
||||
{
|
||||
cp = writeRun(&(*iter), *cpeIter, cp);
|
||||
}
|
||||
@ -311,7 +309,30 @@ namespace DocFileFormat
|
||||
}
|
||||
else
|
||||
{
|
||||
cp = writeRun(chpxChars, *cpeIter, cp);
|
||||
//search for bookmarks in the chars
|
||||
std::vector<int> bookmarks = searchBookmarks(chpxChars, cp);
|
||||
|
||||
//if there are bookmarks in this run, split the run into several runs
|
||||
if (!bookmarks.empty())
|
||||
{
|
||||
std::list<std::vector<wchar_t>>* runs = splitCharList(chpxChars, &bookmarks);
|
||||
if (runs)
|
||||
{
|
||||
for (std::list<std::vector<wchar_t> >::iterator iter = runs->begin(); iter != runs->end(); ++iter)
|
||||
{
|
||||
if (writeBookmarks(cp))
|
||||
{
|
||||
cp = writeRun(&(*iter), *cpeIter, cp);
|
||||
}
|
||||
}
|
||||
|
||||
RELEASEOBJECT(runs);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cp = writeRun(chpxChars, *cpeIter, cp);
|
||||
}
|
||||
}
|
||||
|
||||
RELEASEOBJECT(chpxChars);
|
||||
@ -361,7 +382,7 @@ namespace DocFileFormat
|
||||
int DocumentMapping::writeRun (std::vector<wchar_t>* chars, CharacterPropertyExceptions* chpx, int initialCp)
|
||||
{
|
||||
int cp = initialCp;
|
||||
int result_cp = cp + chars->size();
|
||||
int result_cp = cp + (int)chars->size();
|
||||
|
||||
if ((_skipRuns <= 0) && (chars->size() > 0))
|
||||
{
|
||||
@ -538,12 +559,12 @@ namespace DocFileFormat
|
||||
m_pXmlWriter->WriteString(elem.GetXMLString());
|
||||
}
|
||||
else if (TextMark::FieldBeginMark == code)
|
||||
{
|
||||
{//todooo в отдельный mapping
|
||||
int cpFieldStart = initialCp + i;
|
||||
int cpFieldEnd = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::FieldEndMark );
|
||||
|
||||
std::wstring f;
|
||||
if (cpFieldEnd < m_document->Text->size())
|
||||
if (cpFieldEnd < (int)m_document->Text->size())
|
||||
f = std::wstring( ( m_document->Text->begin() + cpFieldStart ), ( m_document->Text->begin() + cpFieldEnd + 1 ) );
|
||||
|
||||
std::wstring EMBED ( L" EMBED" );
|
||||
@ -578,20 +599,38 @@ namespace DocFileFormat
|
||||
|
||||
if ( bFORM )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar" , true );
|
||||
std::wstring FORMTEXT ( L" FORMTEXT" );
|
||||
std::wstring FORMCHECKBOX ( L" FORMCHECKBOX" );
|
||||
std::wstring FORMDROPDOWN ( L" FORMDROPDOWN" );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar" , true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType" , L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true, false );
|
||||
|
||||
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
|
||||
bool bFORMTEXT = search( f.begin(), f.end(), FORMTEXT.begin(), FORMTEXT.end()) != f.end();
|
||||
bool bFORMCHECKBOX = search( f.begin(), f.end(), FORMCHECKBOX.begin(), FORMCHECKBOX.end()) != f.end();
|
||||
bool bFORMDROPDOWN = search( f.begin(), f.end(), FORMDROPDOWN.begin(), FORMDROPDOWN.end()) != f.end();
|
||||
|
||||
/*if (cpPic < cpFieldEnd)
|
||||
if (bFORMTEXT || bFORMCHECKBOX || bFORMDROPDOWN)
|
||||
{
|
||||
int fcPic = _doc.PieceTable.FileCharacterPositions[cpPic];
|
||||
CharacterPropertyExceptions chpxPic = _doc.GetCharacterPropertyExceptions(fcPic, fcPic + 1)[0];
|
||||
NilPicfAndBinData npbd = new NilPicfAndBinData(chpxPic, _doc.DataStream);
|
||||
FormFieldData ffdata = new FormFieldData(npbd.binData);
|
||||
ffdata.Convert(new FormFieldDataMapping(m_pXmlWriter));
|
||||
}*/
|
||||
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
|
||||
if (cpPic < cpFieldEnd)
|
||||
{
|
||||
int fcPic = m_document->FindFileCharPos( cpPic );
|
||||
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fcPic, fcPic + 1);
|
||||
|
||||
if (chpxs)
|
||||
{
|
||||
CharacterPropertyExceptions* chpxSep = chpxs->front();
|
||||
|
||||
FormFieldData ffdata (2, chpxSep, m_document->DataStream, false);
|
||||
FormFieldDataMapping data_mapping(m_pXmlWriter, m_context, _caller);
|
||||
ffdata.Convert(&data_mapping);
|
||||
|
||||
RELEASEOBJECT( chpxs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:fldChar" );
|
||||
|
||||
@ -639,11 +678,11 @@ namespace DocFileFormat
|
||||
|
||||
if (search( f1.begin(), f1.end(), PAGEREF.begin(), PAGEREF.end()) != f1.end())
|
||||
{
|
||||
int d = f1.find(PAGEREF);
|
||||
int d = (int)f1.find(PAGEREF);
|
||||
|
||||
_writeWebHidden = true;
|
||||
std::wstring _writeTocLink =f1.substr(d + 9);
|
||||
d = _writeTocLink.find(L" ");
|
||||
d = (int)_writeTocLink.find(L" ");
|
||||
_writeTocLink = _writeTocLink.substr(0, d);
|
||||
|
||||
_writeAfterRun = std::wstring (L"<w:hyperlink w:anchor = \"");
|
||||
@ -788,6 +827,13 @@ namespace DocFileFormat
|
||||
{
|
||||
if (_fldCharCounter > 0)
|
||||
{
|
||||
if (_writeInstrText == true && !text.empty())
|
||||
{
|
||||
writeTextElement(text, textType);
|
||||
text.clear();
|
||||
}
|
||||
_writeInstrText = false;
|
||||
|
||||
XMLTools::XMLElement elem( L"w:fldChar" );
|
||||
elem.AppendAttribute( L"w:fldCharType", L"end" );
|
||||
|
||||
@ -811,10 +857,10 @@ namespace DocFileFormat
|
||||
{
|
||||
Symbol s = getSymbol( chpx );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:sym", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:font", FormatUtils::XmlEncode(s.FontName));
|
||||
m_pXmlWriter->WriteAttribute(L"w:char", FormatUtils::XmlEncode(s.HexValue));
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
//m_pXmlWriter->WriteNodeBegin(L"w:sym", true);
|
||||
//m_pXmlWriter->WriteAttribute(L"w:font", FormatUtils::XmlEncode(s.FontName));
|
||||
//m_pXmlWriter->WriteAttribute(L"w:char", FormatUtils::XmlEncode(s.HexValue));
|
||||
//m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
else if ((TextMark::DrawnObject == code) && fSpec)
|
||||
{
|
||||
@ -881,7 +927,7 @@ namespace DocFileFormat
|
||||
{
|
||||
int shape_type = oPicture.shapeContainer->getShapeType();
|
||||
|
||||
if (shape_type != msosptPictureFrame) picture = false;
|
||||
if (shape_type != msosptPictureFrame) picture = false;//шаблон 1.doc картинка в колонтитуле
|
||||
}
|
||||
|
||||
if (picture)
|
||||
@ -948,19 +994,17 @@ namespace DocFileFormat
|
||||
}
|
||||
else if (TextMark::AnnotationReference == code)
|
||||
{
|
||||
if (typeid(*this) != typeid(CommentsMapping))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:commentReference", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( _commentNr ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
else
|
||||
if (typeid(*this) == typeid(CommentsMapping))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:annotationRef", true );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:commentReference", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( _commentNr ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
|
||||
_commentNr++;
|
||||
}
|
||||
else if (!FormatUtils::IsControlSymbol(c) && ((int)c != 0xFFFF))
|
||||
{
|
||||
@ -1042,6 +1086,30 @@ namespace DocFileFormat
|
||||
|
||||
return ret;
|
||||
}
|
||||
// Searches for bookmarks in the list of characters.
|
||||
std::vector<int> DocumentMapping::searchAnnot(std::vector<wchar_t>* chars, int initialCp)
|
||||
{
|
||||
std::vector<int> ret;
|
||||
|
||||
if (m_document->AnnotStartPlex->IsValid())
|
||||
{
|
||||
int cp = initialCp;
|
||||
|
||||
size_t count = chars->size();
|
||||
|
||||
for (size_t i = 0; i < count; ++i)
|
||||
{
|
||||
if ((m_document->AnnotStartPlex->IsCpExists(cp)) || (m_document->AnnotEndPlex->IsCpExists(cp)))
|
||||
{
|
||||
ret.push_back(i);
|
||||
}
|
||||
|
||||
++cp;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
ParagraphPropertyExceptions* DocumentMapping::findValidPapx(int fc)
|
||||
{
|
||||
@ -1133,7 +1201,8 @@ namespace DocFileFormat
|
||||
TableInfo tai( papx );
|
||||
|
||||
//build the table grid
|
||||
std::vector<short>* grid = buildTableGrid( cp, nestingLevel );
|
||||
std::vector<short> grid, grid_write;
|
||||
buildTableGrid( cp, nestingLevel, grid, grid_write );
|
||||
|
||||
//find first row end
|
||||
int fcRowEnd = findRowEndFc( cp, nestingLevel );
|
||||
@ -1144,7 +1213,7 @@ namespace DocFileFormat
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:tbl" );
|
||||
|
||||
//Convert it
|
||||
TablePropertiesMapping *tpMapping = new TablePropertiesMapping( m_pXmlWriter, m_document->Styles, grid );
|
||||
TablePropertiesMapping *tpMapping = new TablePropertiesMapping( m_pXmlWriter, m_document->Styles, &grid, &grid_write );
|
||||
|
||||
row1Tapx.Convert( tpMapping );
|
||||
|
||||
@ -1157,7 +1226,7 @@ namespace DocFileFormat
|
||||
//only convert the cells with the given nesting level
|
||||
while ( tai.iTap == nestingLevel )
|
||||
{
|
||||
cp = writeTableRow( cp, grid, nestingLevel );
|
||||
cp = writeTableRow( cp, &grid, &grid_write, nestingLevel );
|
||||
//?fc = m_document->FindFileCharPos(cp );
|
||||
fc = m_document->m_PieceTable->FileCharacterPositions->operator []( cp );
|
||||
papx = findValidPapx( fc );
|
||||
@ -1170,7 +1239,7 @@ namespace DocFileFormat
|
||||
//convert until the end of table is reached
|
||||
while ( tai.fInTable )
|
||||
{
|
||||
cp = writeTableRow( cp, grid, nestingLevel );
|
||||
cp = writeTableRow( cp, &grid, &grid_write, nestingLevel );
|
||||
fc = m_document->FindFileCharPos( cp );
|
||||
|
||||
papx = findValidPapx( fc );
|
||||
@ -1181,18 +1250,16 @@ namespace DocFileFormat
|
||||
//close w:tbl
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:tbl" );
|
||||
|
||||
RELEASEOBJECT( grid );
|
||||
|
||||
return cp;
|
||||
}
|
||||
|
||||
// Builds a list that contains the width of the several columns of the table.
|
||||
std::vector<short>* DocumentMapping::buildTableGrid(int initialCp, unsigned int nestingLevel)
|
||||
bool DocumentMapping::buildTableGrid(int initialCp, unsigned int nestingLevel, std::vector<short>& grid, std::vector<short>& grid_write)
|
||||
{
|
||||
ParagraphPropertyExceptions* backup = _lastValidPapx;
|
||||
|
||||
std::vector<short> boundaries;
|
||||
std::vector<short>* grid = new std::vector<short>();
|
||||
std::vector<short> boundaries_all;
|
||||
|
||||
int cp = initialCp;
|
||||
int fc = m_document->FindFileCharPos( cp );
|
||||
@ -1209,25 +1276,43 @@ namespace DocFileFormat
|
||||
for ( std::list<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); iter != papx->grpprl->end(); iter++ )
|
||||
{
|
||||
//find the tDef SPRM
|
||||
if ( iter->OpCode == sprmTDefTable || iter->OpCode == sprmOldTDefTable)
|
||||
DWORD code = iter->OpCode;
|
||||
|
||||
switch(iter->OpCode)
|
||||
{
|
||||
case sprmTDefTable:
|
||||
case sprmOldTDefTable:
|
||||
{
|
||||
unsigned char itcMac = iter->Arguments[0];
|
||||
|
||||
for (int i = 0; i < itcMac; i++)
|
||||
while(boundaries.size() < itcMac + 1)
|
||||
boundaries.push_back(-0x7fff);
|
||||
|
||||
short boundary0 = -0x7fff;
|
||||
for (unsigned char i = 0; i < itcMac; i++)
|
||||
{
|
||||
short boundary1 = FormatUtils::BytesToInt16( iter->Arguments, 1 + ( i * 2 ), iter->argumentsSize );
|
||||
short boundary2 = FormatUtils::BytesToInt16( iter->Arguments, 1 + ( ( i + 1 ) * 2 ), iter->argumentsSize );
|
||||
|
||||
if ( find( boundaries.begin(), boundaries.end(), boundary1 ) == boundaries.end() )
|
||||
if (boundary2 - boundary1 > 1 && boundary1 - boundary0 > 1)
|
||||
{
|
||||
boundaries.push_back( boundary1 );
|
||||
if ( boundaries[i] == -0x7fff || boundaries[i+1] == -0x7fff)
|
||||
{
|
||||
boundaries[i] = boundary1;
|
||||
boundaries[i+1] = boundary2;
|
||||
}
|
||||
}
|
||||
if ( find( boundaries_all.begin(), boundaries_all.end(), boundary1 ) == boundaries_all.end() )
|
||||
{
|
||||
boundaries_all.push_back( boundary1 );
|
||||
}
|
||||
|
||||
short boundary2 = FormatUtils::BytesToInt16( iter->Arguments, 1 + ( ( i + 1 ) * 2 ), iter->argumentsSize );
|
||||
|
||||
if ( find( boundaries.begin(), boundaries.end(), boundary2 ) == boundaries.end() )
|
||||
if ( find( boundaries_all.begin(), boundaries_all.end(), boundary2 ) == boundaries_all.end() )
|
||||
{
|
||||
boundaries.push_back( boundary2 );
|
||||
boundaries_all.push_back( boundary2 );
|
||||
}
|
||||
boundary0 = boundary1;
|
||||
}break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1243,19 +1328,25 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//build the grid based on the boundaries
|
||||
sort( boundaries.begin(), boundaries.end() );
|
||||
sort( boundaries_all.begin(), boundaries_all.end() );
|
||||
|
||||
if ( !boundaries.empty() )
|
||||
{
|
||||
for ( unsigned int i = 0; i < ( boundaries.size() - 1 ); i++ )
|
||||
for ( size_t i = 0; i < ( boundaries.size() - 1 ); i++ )
|
||||
{
|
||||
grid->push_back( boundaries[i + 1] - boundaries[i] );
|
||||
grid_write.push_back( boundaries[i + 1] - boundaries[i] );
|
||||
}
|
||||
}
|
||||
if ( !boundaries_all.empty() )
|
||||
{
|
||||
for ( size_t i = 0; i < ( boundaries_all.size() - 1 ); i++ )
|
||||
{
|
||||
grid.push_back( boundaries_all[i + 1] - boundaries_all[i] );
|
||||
}
|
||||
}
|
||||
|
||||
_lastValidPapx = backup;
|
||||
|
||||
return grid;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Finds the FC of the next row end mark.
|
||||
@ -1375,7 +1466,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
/// Writes the table row that starts at the given cp value and ends at the next row end mark
|
||||
int DocumentMapping::writeTableRow(int initialCp, std::vector<short>* grid, unsigned int nestingLevel)
|
||||
int DocumentMapping::writeTableRow(int initialCp, std::vector<short>* grid, std::vector<short>* grid_write, unsigned int nestingLevel)
|
||||
{
|
||||
int cp = initialCp;
|
||||
int fc = m_document->FindFileCharPos( cp );
|
||||
@ -1405,7 +1496,7 @@ namespace DocFileFormat
|
||||
//Write until the first "inner trailer paragraph" is reached
|
||||
while ( !( ( m_document->Text->at( cp ) == TextMark::ParagraphEnd ) && ( tai.fInnerTtp ) ) && tai.fInTable )
|
||||
{
|
||||
cp = writeTableCell( cp, &tapx, grid, gridIndex, cellIndex, nestingLevel );
|
||||
cp = writeTableCell( cp, &tapx, grid, grid_write, gridIndex, cellIndex, nestingLevel );
|
||||
cellIndex++;
|
||||
|
||||
//each cell has it's own PAPX
|
||||
@ -1422,7 +1513,7 @@ namespace DocFileFormat
|
||||
while ( !( ( m_document->Text->at( cp ) == TextMark::CellOrRowMark ) && ( tai.fTtp ) )
|
||||
&& tai.fInTable )
|
||||
{
|
||||
cp = writeTableCell( cp, &tapx, grid, gridIndex, cellIndex, nestingLevel );
|
||||
cp = writeTableCell( cp, &tapx, grid, grid_write, gridIndex, cellIndex, nestingLevel );
|
||||
cellIndex++;
|
||||
|
||||
//each cell has it's own PAPX
|
||||
@ -1445,18 +1536,15 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
/// Writes the table cell that starts at the given cp value and ends at the next cell end mark
|
||||
int DocumentMapping::writeTableCell(int initialCp, TablePropertyExceptions* tapx, std::vector<short>* grid, int& gridIndex, int cellIndex, unsigned int nestingLevel )
|
||||
int DocumentMapping::writeTableCell(int initialCp, TablePropertyExceptions* tapx, std::vector<short>* grid, std::vector<short>* grid_write, int& gridIndex, int cellIndex, unsigned int nestingLevel )
|
||||
{
|
||||
int cp = initialCp;
|
||||
int cpCellEnd = findCellEndCp( initialCp, nestingLevel );
|
||||
|
||||
//start w:tc
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:tc" );
|
||||
|
||||
//find cell end
|
||||
int cpCellEnd = findCellEndCp( initialCp, nestingLevel );
|
||||
|
||||
//convert the properties
|
||||
TableCellPropertiesMapping* tcpMapping = new TableCellPropertiesMapping( m_pXmlWriter, grid, gridIndex, cellIndex );
|
||||
TableCellPropertiesMapping* tcpMapping = new TableCellPropertiesMapping( m_pXmlWriter, grid, grid_write, gridIndex, cellIndex );
|
||||
|
||||
if ( tapx != NULL )
|
||||
{
|
||||
@ -1540,7 +1628,6 @@ namespace DocFileFormat
|
||||
return cpCellEnd;
|
||||
}
|
||||
|
||||
//
|
||||
bool DocumentMapping::writeBookmarks(int cp)
|
||||
{
|
||||
bool result = true;
|
||||
@ -1561,7 +1648,27 @@ namespace DocFileFormat
|
||||
|
||||
return result;
|
||||
}
|
||||
bool DocumentMapping::writeAnnotations(int cp)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
for (size_t i = 0; i < m_document->AnnotStartEndCPs.size(); i++)
|
||||
{
|
||||
if (m_document->AnnotStartEndCPs[i].first == cp)
|
||||
{
|
||||
result = writeAnnotationStart(i + 1);
|
||||
_commentNr = i + 1;
|
||||
}
|
||||
|
||||
if (m_document->AnnotStartEndCPs[i].second == cp)
|
||||
{
|
||||
result = writeAnnotationEnd(i + 1);
|
||||
_commentNr = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
bool DocumentMapping::writeBookmarkStart(short id)
|
||||
{
|
||||
// write bookmark start
|
||||
@ -1585,8 +1692,6 @@ namespace DocFileFormat
|
||||
|
||||
bool DocumentMapping::writeBookmarkEnd(short id)
|
||||
{
|
||||
// write bookmark end
|
||||
|
||||
WideString* bookmarkName = static_cast<WideString*>( m_document->BookmarkNames->operator [] ( id ) );
|
||||
|
||||
if ( ( bookmarkName != NULL ) && ( *bookmarkName != L"_PictureBullets" ) )
|
||||
@ -1602,7 +1707,27 @@ namespace DocFileFormat
|
||||
|
||||
return false;
|
||||
}
|
||||
bool DocumentMapping::writeAnnotationStart(short id)
|
||||
{
|
||||
XMLTools::XMLElement bookmarkElem(L"w:commentRangeStart");
|
||||
|
||||
bookmarkElem.AppendAttribute(L"w:id", FormatUtils::IntToWideString(id));
|
||||
|
||||
m_pXmlWriter->WriteString(bookmarkElem.GetXMLString());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DocumentMapping::writeAnnotationEnd(short id)
|
||||
{
|
||||
XMLTools::XMLElement bookmarkElem( L"w:commentRangeEnd" );
|
||||
|
||||
bookmarkElem.AppendAttribute( L"w:id", FormatUtils::IntToWideString( id ));
|
||||
|
||||
m_pXmlWriter->WriteString( bookmarkElem.GetXMLString());
|
||||
|
||||
return true;
|
||||
}
|
||||
// Checks if the CHPX is special
|
||||
bool DocumentMapping::isSpecial(CharacterPropertyExceptions* chpx)
|
||||
{
|
||||
@ -1663,12 +1788,17 @@ namespace DocFileFormat
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( m_document->FontTable->operator [] ( fontIndex ) );
|
||||
|
||||
ret.FontName = ffn->xszFtn;
|
||||
ret.HexValue = L"f0" + FormatUtils::IntToFormattedWideString( code, L"%02x" );
|
||||
ret.HexValue = L"f0" + FormatUtils::IntToFormattedWideString( code, L"%02x" );//-123 - ShortToFormattedWideString
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret.HexValue.length() > 4)
|
||||
{
|
||||
ret.HexValue = ret.HexValue.substr(ret.HexValue.length() - 4, 4);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -48,6 +48,8 @@
|
||||
#include "OleObjectMapping.h"
|
||||
#include "ConversionContext.h"
|
||||
#include "IMapping.h"
|
||||
#include "FormFieldData.h"
|
||||
#include "FormFieldDataMapping.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
@ -99,28 +101,33 @@ namespace DocFileFormat
|
||||
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
|
||||
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 );
|
||||
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, unsigned int nestingLevel );
|
||||
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, int& gridIndex, int cellIndex, unsigned int nestingLevel );
|
||||
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.
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
#include "DrawingPrimitives.h"
|
||||
#include "VirtualStreamReader.h"
|
||||
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
DrawingPrimitive * DrawingPrimitive::Create(VirtualStreamReader* reader, int length, short dpk)
|
||||
|
||||
@ -35,137 +35,148 @@
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
EncryptionHeader::EncryptionHeader( FileInformationBlock* fib, POLE::Stream* tableStream )
|
||||
EncryptionHeader::EncryptionHeader( FileInformationBlock* fib, POLE::Stream* tableStream ) : bStandard(false), bXOR(false), bAES(false)
|
||||
{
|
||||
VirtualStreamReader tStream( tableStream, 0, fib->m_bOlderVersion);
|
||||
|
||||
if (fib->m_FibBase.fObfuscation)
|
||||
if (fib->m_FibBase.fObfuscation || fib->m_bOlderVersion)
|
||||
{
|
||||
//xor
|
||||
return;
|
||||
}
|
||||
unsigned short vMajor = tStream.ReadUInt16();
|
||||
unsigned short vMinor = tStream.ReadUInt16();
|
||||
|
||||
if(0x0001 == vMajor) // RC4 encryption header structure
|
||||
{// fib->m_FibBase.lKey == 52
|
||||
bStandard = true;
|
||||
|
||||
crypt_data_rc4.Salt.b1 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.Salt.b2 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.Salt.b3 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.Salt.b4 = tStream.ReadUInt32();
|
||||
bXOR = true;
|
||||
|
||||
crypt_data_rc4.EncryptedVerifier.b1 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.EncryptedVerifier.b2 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.EncryptedVerifier.b3 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.EncryptedVerifier.b4 = tStream.ReadUInt32();
|
||||
|
||||
crypt_data_rc4.EncryptedVerifierHash.b1 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.EncryptedVerifierHash.b2 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.EncryptedVerifierHash.b3 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.EncryptedVerifierHash.b4 = tStream.ReadUInt32();
|
||||
crypt_data_xor.key = fib->m_FibBase.lKey >> 16;
|
||||
crypt_data_xor.hash = fib->m_FibBase.lKey - (crypt_data_xor.key << 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
bStandard = false;
|
||||
crypt_data_aes.bAgile = false;
|
||||
unsigned short vMajor = tStream.ReadUInt16();
|
||||
unsigned short vMinor = tStream.ReadUInt16();
|
||||
|
||||
unsigned short flags = tStream.ReadUInt32();
|
||||
unsigned char *pDataRead = NULL;
|
||||
if(0x0001 == vMajor) // RC4 encryption header structure
|
||||
{// fib->m_FibBase.lKey == 52
|
||||
bStandard = true;
|
||||
|
||||
bool fCryptoAPI = GETBIT(flags, 1);
|
||||
bool fDocProps = GETBIT(flags, 2);
|
||||
bool fExternal = GETBIT(flags, 3);
|
||||
bool fAES = GETBIT(flags, 4);
|
||||
|
||||
//EncryptionHeader
|
||||
int HeaderSize = tStream.ReadUInt32();
|
||||
int Flags = tStream.ReadUInt32();
|
||||
int SizeExtra = tStream.ReadUInt32();
|
||||
int AlgID = tStream.ReadUInt32();
|
||||
int AlgIDHash = tStream.ReadUInt32();
|
||||
int KeySize = tStream.ReadUInt32();
|
||||
int ProviderType= tStream.ReadUInt32();
|
||||
int Reserved1 = tStream.ReadUInt32();
|
||||
int Reserved2 = tStream.ReadUInt32();
|
||||
|
||||
int pos = tStream.GetPosition();
|
||||
int size = tStream.GetSize();
|
||||
|
||||
std::vector<char> dataCSPName;
|
||||
while(pos < size - 1)
|
||||
crypt_data_rc4.Salt.b1 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.Salt.b2 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.Salt.b3 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.Salt.b4 = tStream.ReadUInt32();
|
||||
|
||||
crypt_data_rc4.EncryptedVerifier.b1 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.EncryptedVerifier.b2 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.EncryptedVerifier.b3 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.EncryptedVerifier.b4 = tStream.ReadUInt32();
|
||||
|
||||
crypt_data_rc4.EncryptedVerifierHash.b1 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.EncryptedVerifierHash.b2 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.EncryptedVerifierHash.b3 = tStream.ReadUInt32();
|
||||
crypt_data_rc4.EncryptedVerifierHash.b4 = tStream.ReadUInt32();
|
||||
}
|
||||
else
|
||||
{
|
||||
dataCSPName.push_back(tStream.ReadByte());
|
||||
dataCSPName.push_back(tStream.ReadByte());
|
||||
if (dataCSPName[dataCSPName.size() - 1] == 0 && dataCSPName[dataCSPName.size() - 2] == 0)
|
||||
bAES = true;
|
||||
crypt_data_aes.bAgile = false;
|
||||
|
||||
unsigned short flags = tStream.ReadUInt32();
|
||||
unsigned char *pDataRead = NULL;
|
||||
|
||||
bool fCryptoAPI = GETBIT(flags, 1);
|
||||
crypt_data_aes.fDocProps = GETBIT(flags, 2);
|
||||
bool fExternal = GETBIT(flags, 3);
|
||||
bool fAES = GETBIT(flags, 4);
|
||||
|
||||
//EncryptionHeader
|
||||
int HeaderSize = tStream.ReadUInt32();
|
||||
int Flags = tStream.ReadUInt32();
|
||||
int SizeExtra = tStream.ReadUInt32();
|
||||
int AlgID = tStream.ReadUInt32();
|
||||
int AlgIDHash = tStream.ReadUInt32();
|
||||
int KeySize = tStream.ReadUInt32();
|
||||
int ProviderType= tStream.ReadUInt32();
|
||||
int Reserved1 = tStream.ReadUInt32();
|
||||
int Reserved2 = tStream.ReadUInt32();
|
||||
|
||||
int pos = tStream.GetPosition();
|
||||
int size = tStream.GetSize();
|
||||
|
||||
std::vector<char> dataCSPName;
|
||||
while(pos < size - 1)
|
||||
{
|
||||
dataCSPName.push_back(tStream.ReadByte());
|
||||
dataCSPName.push_back(tStream.ReadByte());
|
||||
if (dataCSPName[dataCSPName.size() - 1] == 0 && dataCSPName[dataCSPName.size() - 2] == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
pos+=2;//unicode null-terminate string
|
||||
}
|
||||
//EncryptionVerifier
|
||||
crypt_data_aes.saltSize = tStream.ReadUInt32();
|
||||
pDataRead = tStream.ReadBytes(crypt_data_aes.saltSize, true);
|
||||
if (pDataRead)
|
||||
{
|
||||
crypt_data_aes.saltValue = std::string((char*)pDataRead, crypt_data_aes.saltSize);
|
||||
delete pDataRead;
|
||||
}
|
||||
|
||||
pDataRead = tStream.ReadBytes(0x10, true);
|
||||
if (pDataRead)
|
||||
{
|
||||
crypt_data_aes.encryptedVerifierInput = std::string((char*)pDataRead, 0x10);
|
||||
delete pDataRead;
|
||||
}
|
||||
|
||||
crypt_data_aes.hashSize = tStream.ReadUInt32();
|
||||
|
||||
int szEncryptedVerifierHash = (ProviderType == 0x0001) ? 0x14 : 0x20;
|
||||
pDataRead = tStream.ReadBytes(szEncryptedVerifierHash, true);
|
||||
if (pDataRead)
|
||||
{
|
||||
crypt_data_aes.encryptedVerifierValue = std::string((char*)pDataRead, szEncryptedVerifierHash);
|
||||
delete pDataRead;
|
||||
}
|
||||
|
||||
pos = tStream.GetPosition();
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
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;
|
||||
crypt_data_aes.keySize = 128 /8;
|
||||
break;
|
||||
case 0x660F:
|
||||
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB;
|
||||
crypt_data_aes.keySize = 192 /8;
|
||||
break;
|
||||
case 0x6610:
|
||||
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB;
|
||||
crypt_data_aes.keySize = 256 /8;
|
||||
break;
|
||||
}
|
||||
pos+=2;//unicode null-terminate string
|
||||
}
|
||||
//EncryptionVerifier
|
||||
crypt_data_aes.saltSize = tStream.ReadUInt32();
|
||||
pDataRead = tStream.ReadBytes(crypt_data_aes.saltSize, true);
|
||||
if (pDataRead)
|
||||
{
|
||||
crypt_data_aes.saltValue = std::string((char*)pDataRead, crypt_data_aes.saltSize);
|
||||
delete pDataRead;
|
||||
}
|
||||
|
||||
pDataRead = tStream.ReadBytes(0x10, true);
|
||||
if (pDataRead)
|
||||
{
|
||||
crypt_data_aes.encryptedVerifierInput = std::string((char*)pDataRead, 0x10);
|
||||
delete pDataRead;
|
||||
}
|
||||
|
||||
crypt_data_aes.hashSize = tStream.ReadUInt32();
|
||||
|
||||
int szEncryptedVerifierHash = (ProviderType == 0x0001) ? 0x14 : 0x20;
|
||||
pDataRead = tStream.ReadBytes(szEncryptedVerifierHash, true);
|
||||
if (pDataRead)
|
||||
{
|
||||
crypt_data_aes.encryptedVerifierValue = std::string((char*)pDataRead, szEncryptedVerifierHash);
|
||||
delete pDataRead;
|
||||
//switch(ProviderType)
|
||||
//{
|
||||
// case 0x0001: crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::RC4; break;
|
||||
// case 0x0018: crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB; break;
|
||||
//}
|
||||
}
|
||||
|
||||
pos = tStream.GetPosition();
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
crypt_data_aes.hashAlgorithm = CRYPT_METHOD::SHA1; //by AlgIDHash -> 0x0000 || 0x8004
|
||||
crypt_data_aes.spinCount = 50000;
|
||||
|
||||
switch(AlgID)
|
||||
{
|
||||
case 0x6801:
|
||||
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::RC4;
|
||||
crypt_data_aes.keySize = KeySize / 8;
|
||||
break;
|
||||
case 0x660E:
|
||||
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB;
|
||||
crypt_data_aes.keySize = 128 /8;
|
||||
break;
|
||||
case 0x660F:
|
||||
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB;
|
||||
crypt_data_aes.keySize = 192 /8;
|
||||
break;
|
||||
case 0x6610:
|
||||
crypt_data_aes.cipherAlgorithm = CRYPT_METHOD::AES_ECB;
|
||||
crypt_data_aes.keySize = 256 /8;
|
||||
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 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -50,8 +50,12 @@ 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;
|
||||
CRYPT::_xorCryptData crypt_data_xor;
|
||||
|
||||
bool bStandard;
|
||||
bool bXOR;
|
||||
bool bAES;
|
||||
};
|
||||
}
|
||||
|
||||
@ -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;
|
||||
@ -531,7 +531,6 @@ namespace DocFileFormat
|
||||
{
|
||||
if (m_FibBase.nFib > 0 && m_FibBase.nFib <= Fib1995)
|
||||
{
|
||||
m_RgLw97.cbMac = reader.ReadInt32();//32
|
||||
/*m_FibWord97.fcSpare0 = */reader.ReadInt32();
|
||||
/*m_FibWord97.fcSpare1 = */reader.ReadInt32();
|
||||
/*m_FibWord97.fcSpare2 = */reader.ReadInt32();
|
||||
@ -1189,9 +1188,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);
|
||||
@ -1220,9 +1219,12 @@ namespace DocFileFormat
|
||||
if (m_FibBase.nFib > Fib1995)
|
||||
csw = reader.ReadUInt16(); //32
|
||||
|
||||
if (m_FibBase.nFib > Fib1995 || m_FibBase.nFib == 0)
|
||||
{
|
||||
|
||||
if (m_FibBase.nFib > 0 && m_FibBase.nFib <= Fib1995)
|
||||
{
|
||||
m_RgLw97.cbMac = reader.ReadInt32();//32
|
||||
}
|
||||
else if (m_FibBase.nFib > Fib1995 || m_FibBase.nFib == 0)
|
||||
{
|
||||
//read the RgW97
|
||||
reader.ReadBytes( 26, false ); //34
|
||||
m_RgW97.lidFE = reader.ReadUInt16(); //60
|
||||
@ -1231,7 +1233,7 @@ namespace DocFileFormat
|
||||
|
||||
//read the RgLW97
|
||||
|
||||
m_RgLw97.cbMac = reader.ReadInt32(); //64
|
||||
m_RgLw97.cbMac = reader.ReadInt32(); //64
|
||||
}
|
||||
reset(reader);
|
||||
}
|
||||
|
||||
@ -48,7 +48,8 @@ namespace DocFileFormat
|
||||
|
||||
class FontFamilyName: public ByteStructure
|
||||
{
|
||||
friend class CharacterPropertiesMapping;
|
||||
friend class WordDocument;
|
||||
friend class CharacterPropertiesMapping;
|
||||
friend class DocumentMapping;
|
||||
friend class FontTableMapping;
|
||||
friend class StyleSheetMapping;
|
||||
|
||||
@ -34,32 +34,30 @@
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
FontTableMapping::FontTableMapping( ConversionContext* ctx ): AbstractOpenXmlMapping( new XMLTools::CStringXmlWriter() )
|
||||
FontTableMapping::FontTableMapping( ConversionContext* ctx ) : AbstractOpenXmlMapping( new XMLTools::CStringXmlWriter() )
|
||||
{
|
||||
_ctx = ctx;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
FontTableMapping::~FontTableMapping()
|
||||
{
|
||||
RELEASEOBJECT (m_pXmlWriter);
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void FontTableMapping::Apply( IVisitable* visited )
|
||||
{
|
||||
StringTable<FontFamilyName>* table = static_cast<StringTable<FontFamilyName>*>( visited );
|
||||
|
||||
this->_ctx->_docx->RegisterFontTable();
|
||||
_ctx->_docx->RegisterFontTable();
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fonts", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
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++ )
|
||||
@ -140,6 +138,6 @@ namespace DocFileFormat
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:fonts");
|
||||
|
||||
this->_ctx->_docx->FontTableXML = std::wstring( m_pXmlWriter->GetXmlString() );
|
||||
_ctx->_docx->FontTableXML = m_pXmlWriter->GetXmlString() ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,6 +75,8 @@ namespace DocFileFormat
|
||||
|
||||
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,6 +95,8 @@ namespace DocFileFormat
|
||||
//this PAPX is for a normal paragraph
|
||||
cp = writeParagraph( cp );
|
||||
}
|
||||
while (cp <= cpStart) //conv_fQioC665ib4ngHkDGY4__docx.doc
|
||||
cp++;
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:footnote");
|
||||
|
||||
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;
|
||||
};
|
||||
}
|
||||
@ -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
|
||||
|
||||
@ -50,8 +50,7 @@ namespace DocFileFormat
|
||||
void MainDocumentMapping::Apply(IVisitable* visited)
|
||||
{
|
||||
m_document = static_cast<WordDocument*>(visited);
|
||||
m_context->_docx->RegisterDocument();
|
||||
|
||||
|
||||
// Header
|
||||
m_pXmlWriter->WriteNodeBegin(L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:document", TRUE );
|
||||
@ -124,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
|
||||
{
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -38,8 +38,8 @@ namespace DocFileFormat
|
||||
{
|
||||
if (m_context)
|
||||
{
|
||||
m_document = m_context->GetDocument();
|
||||
m_xmldocument = m_context->GetXmlDocument();
|
||||
m_document = m_context->_doc;
|
||||
m_xmldocument = m_context->_docx;
|
||||
}
|
||||
}
|
||||
|
||||
@ -307,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
|
||||
@ -584,7 +582,7 @@ namespace DocFileFormat
|
||||
// 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( L"w:pStyle", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(StyleSheetMapping::MakeStyleId(m_document->Styles->Styles->at(styleIndex))));
|
||||
|
||||
@ -110,6 +110,11 @@ namespace DocFileFormat
|
||||
unused2 = Reader->ReadByte();
|
||||
unused3 = Reader->ReadByte();
|
||||
|
||||
if (btMacOS != btWin32)
|
||||
{
|
||||
btWin32 = btMacOS = (Global::BlipType)this->Instance;
|
||||
}
|
||||
|
||||
if (BodySize > 0x24)
|
||||
{
|
||||
Blip = RecordFactory::ReadRecord(Reader, 0);
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -41,23 +41,20 @@ namespace DocFileFormat
|
||||
|
||||
GeometryBooleanProperties(unsigned int op)
|
||||
{
|
||||
fFillOK = FormatUtils::BitmaskToBool (op, 0x1);
|
||||
fFillShadeShapeOK = FormatUtils::BitmaskToBool (op, 0x2);
|
||||
fGtextOK = FormatUtils::BitmaskToBool (op, 0x4);
|
||||
fLineOK = FormatUtils::BitmaskToBool (op, 0x8);
|
||||
f3DOK = FormatUtils::BitmaskToBool (op, 0x10);
|
||||
fShadowOK = FormatUtils::BitmaskToBool (op, 0x20);
|
||||
|
||||
fUsefFillOK = FormatUtils::BitmaskToBool (op, 0x10000);
|
||||
fUsefFillShadeShapeOK = FormatUtils::BitmaskToBool (op, 0x20000);
|
||||
fUsefGtextOK = FormatUtils::BitmaskToBool (op, 0x40000);
|
||||
fUsefLineOK = FormatUtils::BitmaskToBool (op, 0x80000);
|
||||
fUsef3DOK = FormatUtils::BitmaskToBool (op, 0x100000);
|
||||
fUsefShadowOK = FormatUtils::BitmaskToBool (op, 0x200000);
|
||||
fUsefShadowOK = GETBIT(op, 8);
|
||||
fUsef3DOK = GETBIT(op, 9);
|
||||
fUsefLineOK = GETBIT(op, 10);
|
||||
fUsefGtextOK = GETBIT(op, 11);
|
||||
fUsefFillShadeShapeOK = GETBIT(op, 12);
|
||||
fUsefFillOK = GETBIT(op, 13);
|
||||
|
||||
fShadowOK = GETBIT(op, 22);
|
||||
f3DOK = GETBIT(op, 23);
|
||||
fLineOK = GETBIT(op, 24);
|
||||
fGtextOK = GETBIT(op, 25);
|
||||
fFillShadeShapeOK = GETBIT(op, 26);
|
||||
fFillOK = GETBIT(op, 27);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
bool fFillOK;
|
||||
bool fFillShadeShapeOK;
|
||||
bool fGtextOK;
|
||||
|
||||
@ -64,7 +64,7 @@ namespace DocFileFormat
|
||||
oSize.cx = ( right - left );
|
||||
oSize.cy = ( bottom - top );
|
||||
|
||||
rcgBounds = DocFormatUtils::Rectangle(oPoint,oSize);
|
||||
rcgBounds = DocFileFormat::Rectangle(oPoint,oSize);
|
||||
}
|
||||
|
||||
virtual ~GroupShapeRecord()
|
||||
@ -77,6 +77,6 @@ namespace DocFileFormat
|
||||
return new GroupShapeRecord( _reader, bodySize, typeCode, version, instance );
|
||||
}
|
||||
|
||||
DocFormatUtils::Rectangle rcgBounds;
|
||||
DocFileFormat::Rectangle rcgBounds;
|
||||
};
|
||||
}
|
||||
|
||||
@ -192,14 +192,14 @@ public:
|
||||
{
|
||||
if (!bIsCompressed)
|
||||
{
|
||||
m_pMetaFile = pCompress;
|
||||
m_lMetaFileSize = lUncompressSize;
|
||||
m_pMetaFile = new BYTE[lCompressSize];
|
||||
m_lMetaFileSize = lCompressSize;
|
||||
memcpy(m_pMetaFile, pCompress, lCompressSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
ULONG lSize = lUncompressSize;
|
||||
m_pMetaFile = new BYTE[lUncompressSize];
|
||||
//bool bRes = NSZLib::Decompress(pCompress, (ULONG)lCompressSize, m_pMetaFile, lSize);
|
||||
|
||||
HRESULT res = S_OK;
|
||||
COfficeUtils* pOfficeUtils = new COfficeUtils(NULL);
|
||||
@ -250,10 +250,6 @@ public:
|
||||
{
|
||||
pFile->WriteFile((BYTE*)m_pMetaHeader, m_lMetaHeaderSize);
|
||||
}
|
||||
if (NULL != m_pMetaFile)
|
||||
{
|
||||
pFile->WriteFile((BYTE*)m_pMetaFile, m_lMetaFileSize);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -344,6 +340,8 @@ typedef enum _BlipCompression
|
||||
|
||||
if (typeCode == 0xf01b)
|
||||
{
|
||||
oMetaFile.m_sExtension = L".wmf";
|
||||
|
||||
WmfPlaceableFileHeader oWmfHeader = {};
|
||||
oMetaHeader.ToWMFHeader(&oWmfHeader);
|
||||
|
||||
@ -353,24 +351,12 @@ typedef enum _BlipCompression
|
||||
|
||||
oMetaFile.SetHeader(pMetaHeader, lLenHeader);
|
||||
}
|
||||
|
||||
if (typeCode == 0xf01c)
|
||||
{
|
||||
oMetaFile.m_sExtension = L".pcz";
|
||||
//decompress???
|
||||
}
|
||||
oMetaFile.SetData(m_pvBits, oMetaHeader.cbSave, oMetaHeader.cbSize, 0 == oMetaHeader.compression);
|
||||
|
||||
//if (pos < sz)
|
||||
//{
|
||||
// NSFile::CFileBinary oFile;
|
||||
|
||||
// if (oFile.CreateFile(L"d:\\blop.dat"))
|
||||
// {
|
||||
// BYTE * d = Reader->ReadBytes( sz - pos, true );
|
||||
// if (d)
|
||||
// {
|
||||
// oFile.WriteFile (d, sz - pos);
|
||||
// delete []d;
|
||||
// oFile.CloseFile();
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
virtual ~MetafilePictBlip()
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* (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 "RegularContainer.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
class OfficeArtFRITContainer: public RegularContainer
|
||||
{
|
||||
public:
|
||||
static const unsigned short TYPE_CODE_0xF118 = 0xF118;
|
||||
|
||||
OfficeArtFRITContainer () : RegularContainer()
|
||||
{
|
||||
}
|
||||
|
||||
OfficeArtFRITContainer (IBinaryReader* _reader, unsigned int size, unsigned int typeCode, unsigned int version, unsigned int instance) : RegularContainer (_reader, size, typeCode, version, instance)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~OfficeArtFRITContainer()
|
||||
{
|
||||
}
|
||||
|
||||
virtual Record* NewObject (IBinaryReader* _reader, unsigned int bodySize, unsigned int typeCode, unsigned int version, unsigned int instance)
|
||||
{
|
||||
return new OfficeArtFRITContainer( _reader, bodySize, typeCode, version, instance );
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -35,68 +35,49 @@
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
struct _guides
|
||||
{
|
||||
unsigned char type;
|
||||
|
||||
unsigned char param_type1;
|
||||
unsigned char param_type2;
|
||||
unsigned char param_type3;
|
||||
|
||||
WORD param1;
|
||||
WORD param2;
|
||||
WORD param3;
|
||||
};
|
||||
class PathParser
|
||||
{
|
||||
public:
|
||||
|
||||
PathParser (const unsigned char* pSegmentInfo, unsigned int pSegmentInfoSize, const unsigned char* pVertices, unsigned int pVerticesSize)
|
||||
PathParser (const unsigned char* pSegmentInfo, unsigned int pSegmentInfoSize, const unsigned char* pVertices, unsigned int pVerticesSize, std::vector<_guides> & guides)
|
||||
{
|
||||
|
||||
if ((pSegmentInfo != NULL) && (pSegmentInfoSize > 0))
|
||||
{
|
||||
int offset = 6;
|
||||
|
||||
unsigned short nElems = FormatUtils::BytesToUInt16(pSegmentInfo, 0, pSegmentInfoSize);
|
||||
unsigned short nElemsAlloc = FormatUtils::BytesToUInt16(pSegmentInfo, 2, pSegmentInfoSize);
|
||||
unsigned short cb = FormatUtils::BytesToUInt16(pSegmentInfo, 4, pSegmentInfoSize);
|
||||
|
||||
// видимо без шапки сразу пишутся все элементы
|
||||
bool headerIs = ((0xfff0 != cb) && (cb > 8) || nElems > nElemsAlloc);
|
||||
if (headerIs)
|
||||
{
|
||||
cb = 2;
|
||||
offset = 0;
|
||||
nElems = pSegmentInfoSize / 2;
|
||||
unsigned short cbElement = 4;
|
||||
|
||||
for (unsigned short i = 0; i < nElems; ++i)
|
||||
{
|
||||
PathSegment oSegment = PathSegment(FormatUtils::BytesToUInt16(pSegmentInfo + offset, (i * cb), pSegmentInfoSize));
|
||||
m_arSegments.push_back (oSegment);
|
||||
}
|
||||
}
|
||||
else
|
||||
int offset = 6;
|
||||
if (cb == 0xfff0)
|
||||
cbElement = 2;
|
||||
|
||||
if (nElems == 0)
|
||||
{
|
||||
if ((0xfff0 != cb) && (8 != cb) && (4 != cb) && (2 != cb))
|
||||
{
|
||||
cb = 0xfff0;
|
||||
offset = 0;
|
||||
nElems = pSegmentInfoSize / 2;
|
||||
}
|
||||
|
||||
if (0xfff0 == cb)
|
||||
{
|
||||
cb = 4;
|
||||
|
||||
for (unsigned short i = 0; i < nElems; ++i)
|
||||
{
|
||||
PathSegment oSegment = PathSegment(FormatUtils::BytesToUInt16(pSegmentInfo + offset, (i * cb), pSegmentInfoSize));
|
||||
m_arSegments.push_back (oSegment);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((2 != cb) && (1 != cb))
|
||||
cb = 8;
|
||||
|
||||
for (unsigned short i = 0; i < nElems; ++i)
|
||||
{
|
||||
PathSegment oSegment = PathSegment(FormatUtils::BytesToInt32(pSegmentInfo + offset, (i * cb), pSegmentInfoSize));
|
||||
m_arSegments.push_back (oSegment);
|
||||
}
|
||||
|
||||
if ((long)pSegmentInfoSize < (long)(cb*nElems)) // Есть несколько файлов с мусором вместо данных
|
||||
m_arSegments.clear();
|
||||
}
|
||||
nElems = (pSegmentInfoSize - offset) / cbElement;
|
||||
}
|
||||
for (unsigned short i = 0; i < nElems; ++i)
|
||||
{
|
||||
PathSegment oSegment = PathSegment(FormatUtils::BytesToInt32(pSegmentInfo + offset, (i * cbElement), pSegmentInfoSize - offset));
|
||||
m_arSegments.push_back (oSegment);
|
||||
}
|
||||
|
||||
if ((long)pSegmentInfoSize < (long)(cb * nElems)) // Есть несколько файлов с мусором вместо данных
|
||||
m_arSegments.clear();
|
||||
}
|
||||
|
||||
if ((NULL != pVertices) && (pVerticesSize > 0))
|
||||
@ -105,31 +86,54 @@ namespace DocFileFormat
|
||||
unsigned short nElemsAlloc = FormatUtils::BytesToUInt16(pVertices, 2, pVerticesSize);
|
||||
unsigned short cb = FormatUtils::BytesToUInt16(pVertices, 4, pVerticesSize);
|
||||
|
||||
if (0xfff0 == cb)
|
||||
{
|
||||
cb = 4;
|
||||
unsigned short cbElement = 4;
|
||||
|
||||
for (unsigned short i = 0; i < nElems; ++i)
|
||||
if (cb == 0xfff0)
|
||||
cbElement = 2;
|
||||
|
||||
int offset = 6;
|
||||
|
||||
for (unsigned short i = 0; i < nElems; ++i)
|
||||
{
|
||||
POINT point;
|
||||
if (cbElement == 4)
|
||||
{
|
||||
POINT point;
|
||||
|
||||
point.x = FormatUtils::BytesToInt16(pVertices + 6, (i * cb), pVerticesSize);
|
||||
point.y = FormatUtils::BytesToInt16(pVertices + 6, (i * cb) + (cb / 2), pVerticesSize);
|
||||
|
||||
m_arPoints.push_back(point);
|
||||
point.x = FormatUtils::BytesToInt32(pVertices + offset, 0, pVerticesSize - offset);
|
||||
point.y = FormatUtils::BytesToInt32(pVertices + offset + cbElement, 0 , pVerticesSize - offset);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned short i = 0; i < nElems; ++i)
|
||||
else
|
||||
{
|
||||
POINT point;
|
||||
|
||||
point.x = FormatUtils::BytesToInt32(pVertices + 6, (i * cb), pVerticesSize);
|
||||
point.y = FormatUtils::BytesToInt32(pVertices + 6, (i * cb) + (cb / 2), pVerticesSize);
|
||||
|
||||
m_arPoints.push_back(point);
|
||||
point.x = FormatUtils::BytesToInt16(pVertices + offset, 0, pVerticesSize - offset);
|
||||
point.y = FormatUtils::BytesToInt16(pVertices + offset + cbElement, 0 , pVerticesSize - offset);
|
||||
}
|
||||
offset += cbElement * 2;
|
||||
|
||||
LONG lMinF = (LONG)0x80000000;
|
||||
if (lMinF <= point.x)
|
||||
{
|
||||
int index = (DWORD)point.x - 0x80000000;
|
||||
if (index >= 0 && index < guides.size())
|
||||
{
|
||||
point.x = guides[index].param3;
|
||||
}
|
||||
}
|
||||
if (lMinF <= point.y)
|
||||
{
|
||||
int index = (DWORD)point.y - 0x80000000;
|
||||
if (index >= 0 && index < guides.size())
|
||||
{
|
||||
point.y = guides[index].param3;
|
||||
}
|
||||
}
|
||||
if ((size_t)point.y > 0xffff)
|
||||
{
|
||||
point.y &= 0xffff;
|
||||
}
|
||||
if ((size_t)point.x > 0xffff)
|
||||
{
|
||||
point.x &= 0xffff;
|
||||
}
|
||||
m_arPoints.push_back(point);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -163,104 +167,100 @@ namespace DocFileFormat
|
||||
std::vector<PathSegment>::const_iterator end = m_arSegments.end();
|
||||
for (std::vector<PathSegment>::const_iterator iter = m_arSegments.begin(); iter != end; ++iter, cc++)
|
||||
{
|
||||
try
|
||||
switch (iter->Type)
|
||||
{
|
||||
switch (iter->Type)
|
||||
case PathSegment::msopathLineTo:
|
||||
{
|
||||
case PathSegment::msopathLineTo:
|
||||
for (int i = 0; i < iter->Count; ++i)
|
||||
{
|
||||
for (int i = 0; i < iter->Count; ++i)
|
||||
if (valuePointer + 1 > (int)m_arPoints.size())
|
||||
{
|
||||
if (valuePointer >= (int)m_arPoints.size())
|
||||
{
|
||||
break;
|
||||
break;
|
||||
|
||||
strVmlPath += L"l";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[0].x);
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[0].y);
|
||||
|
||||
++valuePointer;
|
||||
|
||||
//break;
|
||||
}
|
||||
else
|
||||
{
|
||||
strVmlPath += L"l";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
|
||||
|
||||
++valuePointer;
|
||||
}
|
||||
strVmlPath += L"l";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[0].x);
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[0].y);
|
||||
|
||||
++valuePointer;
|
||||
|
||||
//break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case PathSegment::msopathCurveTo:
|
||||
{
|
||||
for (int i = 0; i < iter->Count; ++i)
|
||||
else
|
||||
{
|
||||
strVmlPath += L"c";
|
||||
strVmlPath += L"l";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 1].x );
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 1].y );
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 2].x );
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 2].y );
|
||||
valuePointer += 3;
|
||||
|
||||
++valuePointer;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case PathSegment::msopathMoveTo:
|
||||
case PathSegment::msopathCurveTo:
|
||||
{
|
||||
for (int i = 0; i < iter->Count; ++i)
|
||||
{
|
||||
strVmlPath += L"m";
|
||||
if (valuePointer + 3 > (int)m_arPoints.size())
|
||||
break;
|
||||
strVmlPath += L"c";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 1].x );
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 1].y );
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 2].x );
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer + 2].y );
|
||||
valuePointer += 3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case PathSegment::msopathMoveTo:
|
||||
{
|
||||
if (valuePointer < (int)m_arPoints.size())
|
||||
{
|
||||
strVmlPath += L"m";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].x );
|
||||
strVmlPath += L",";
|
||||
strVmlPath += FormatUtils::IntToWideString(m_arPoints[valuePointer].y );
|
||||
|
||||
++valuePointer;
|
||||
}
|
||||
break;
|
||||
|
||||
case PathSegment::msopathClose:
|
||||
{
|
||||
strVmlPath += L"x";
|
||||
}
|
||||
break;
|
||||
|
||||
case PathSegment::msopathEnd:
|
||||
{
|
||||
strVmlPath += L"e";
|
||||
}
|
||||
break;
|
||||
|
||||
case PathSegment::msopathEscape:
|
||||
{
|
||||
if (PathSegment::msopathEscapeNoFill == iter->EscapeCode)
|
||||
strVmlPath += L"nf";
|
||||
|
||||
if (PathSegment::msopathEscapeNoLine == iter->EscapeCode)
|
||||
strVmlPath += L"ns";
|
||||
}
|
||||
case PathSegment::msopathClientEscape:
|
||||
case PathSegment::msopathInvalid:
|
||||
{
|
||||
//ignore escape segments and invalid segments
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// Sometimes there are more Segments than available m_arPoints.
|
||||
// Accordingly to the spec this should never happen :)
|
||||
break;
|
||||
|
||||
case PathSegment::msopathClose:
|
||||
{
|
||||
strVmlPath += L"x";
|
||||
}
|
||||
break;
|
||||
|
||||
case PathSegment::msopathEnd:
|
||||
{
|
||||
strVmlPath += L"e";
|
||||
}
|
||||
break;
|
||||
|
||||
case PathSegment::msopathEscape:
|
||||
{
|
||||
if (PathSegment::msopathEscapeNoFill == iter->EscapeCode)
|
||||
strVmlPath += L"nf";
|
||||
|
||||
if (PathSegment::msopathEscapeNoLine == iter->EscapeCode)
|
||||
strVmlPath += L"ns";
|
||||
}
|
||||
case PathSegment::msopathClientEscape:
|
||||
case PathSegment::msopathInvalid:
|
||||
{
|
||||
//ignore escape segments and invalid segments
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,7 +71,6 @@ namespace DocFileFormat
|
||||
fUsefLockAgainstUngrouping = FormatUtils::BitmaskToBool(op,0x2000000);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
bool fLockAgainstGrouping;
|
||||
bool fLockAdjustHandles;
|
||||
|
||||
@ -50,6 +50,7 @@
|
||||
#include "GroupShapeRecord.h"
|
||||
#include "OfficeArtClientTextbox.h"
|
||||
#include "UnknownRecord.h"
|
||||
#include "OfficeArtFRITContainer.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
@ -135,6 +136,7 @@ namespace DocFileFormat
|
||||
case GroupContainer::TYPE_CODE_0xF003 : return new GroupContainer();
|
||||
case GroupShapeRecord::TYPE_CODE_0xF009 : return new GroupShapeRecord ();
|
||||
case OfficeArtClientTextbox::TYPE_CODE_0xF00D : return new OfficeArtClientTextbox ();
|
||||
case OfficeArtFRITContainer::TYPE_CODE_0xF118 : return new OfficeArtFRITContainer ();
|
||||
|
||||
default:
|
||||
return new UnknownRecord();
|
||||
|
||||
@ -63,8 +63,25 @@ namespace DocFileFormat
|
||||
Shape* sh = dynamic_cast<Shape*>( *iter );
|
||||
if (sh)
|
||||
{
|
||||
if (sh->shapeType) return sh->shapeType->GetTypeCode();
|
||||
else return 0;
|
||||
if (sh->shapeType)
|
||||
{
|
||||
return sh->shapeType->GetTypeCode();
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( std::vector<Record*>::const_iterator iter1 = this->Children.begin(); iter1 != this->Children.end(); iter1++ )
|
||||
{
|
||||
ShapeOptions* sh_options = dynamic_cast<ShapeOptions*>( *iter1 );
|
||||
if (sh_options)
|
||||
{
|
||||
if (sh_options->OptionsByID.end() != sh_options->OptionsByID.find(Pib))
|
||||
{
|
||||
return msosptPictureFrame;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -106,21 +123,20 @@ namespace DocFileFormat
|
||||
return new ShapeContainer( _reader, bodySize, typeCode, version, instance );
|
||||
}
|
||||
|
||||
std::list<OptionEntry> ExtractOptions() const
|
||||
std::vector<OptionEntryPtr> ExtractOptions() const
|
||||
{
|
||||
std::list<OptionEntry> ret;
|
||||
std::vector<OptionEntryPtr> ret;
|
||||
|
||||
//build the list of all option entries of this shape
|
||||
for ( std::vector<Record*>::const_iterator iter = this->Children.begin(); iter != this->Children.end(); iter++ )
|
||||
{
|
||||
ShapeOptions* opt = dynamic_cast<ShapeOptions*>( *iter );
|
||||
|
||||
if ( opt != NULL )
|
||||
if ( opt == NULL ) continue;
|
||||
|
||||
for ( size_t i = 0; i < opt->Options.size(); i++)
|
||||
{
|
||||
for ( std::vector<OptionEntry>::iterator oeIter = opt->Options.begin(); oeIter != opt->Options.end(); oeIter++ )
|
||||
{
|
||||
ret.push_back( *oeIter );
|
||||
}
|
||||
ret.push_back( opt->Options[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -49,15 +49,15 @@ namespace DocFileFormat
|
||||
PropertyId_fFlipH=63,
|
||||
|
||||
//Protection
|
||||
fLockAgainstUngrouping=118,
|
||||
fLockRotation=119,
|
||||
fLockAspectRatio=120,
|
||||
fLockPosition=121,
|
||||
fLockAgainstSelect=122,
|
||||
fLockCropping=123,
|
||||
fLockVertices=124,
|
||||
fLockText=125,
|
||||
fLockAdjustHandles=126,
|
||||
//fLockAgainstUngrouping=118,
|
||||
//fLockRotation=119,
|
||||
//fLockAspectRatio=120,
|
||||
//fLockPosition=121,
|
||||
//fLockAgainstSelect=122,
|
||||
//fLockCropping=123,
|
||||
//fLockVertices=124,
|
||||
//fLockText=125,
|
||||
//fLockAdjustHandles=126,
|
||||
protectionBooleans=127,
|
||||
|
||||
//Text
|
||||
@ -75,10 +75,7 @@ namespace DocFileFormat
|
||||
txdir=139,
|
||||
ccol=140,
|
||||
dzColMargin=141,
|
||||
fSelectText=187,
|
||||
fAutoTextMargin=188,
|
||||
fRotateText=189,
|
||||
fFitShapeToText=190,
|
||||
|
||||
textBooleanProperties=191,
|
||||
|
||||
//GeoText
|
||||
@ -89,21 +86,21 @@ namespace DocFileFormat
|
||||
gtextSpacing=196,
|
||||
gtextFont=197,
|
||||
gtextCSSFont=198,
|
||||
gtextFReverseRows=240,
|
||||
fGtext=241,
|
||||
gtextFVertical=242,
|
||||
gtextFKern=243,
|
||||
gtextFTight=244,
|
||||
gtextFStretch=245,
|
||||
gtextFShrinkFit=246,
|
||||
gtextFBestFit=247,
|
||||
gtextFNormalize=248,
|
||||
gtextFDxMeasure=249,
|
||||
gtextFBold=250,
|
||||
gtextFItalic=251,
|
||||
gtextFUnderline=252,
|
||||
gtextFShadow=253,
|
||||
gtextFSmallcaps=254,
|
||||
//gtextFReverseRows=240,
|
||||
//fGtext=241,
|
||||
//gtextFVertical=242,
|
||||
//gtextFKern=243,
|
||||
//gtextFTight=244,
|
||||
//gtextFStretch=245,
|
||||
//gtextFShrinkFit=246,
|
||||
//gtextFBestFit=247,
|
||||
//gtextFNormalize=248,
|
||||
//gtextFDxMeasure=249,
|
||||
//gtextFBold=250,
|
||||
//gtextFItalic=251,
|
||||
//gtextFUnderline=252,
|
||||
//gtextFShadow=253,
|
||||
//gtextFSmallcaps=254,
|
||||
geometryTextBooleanProperties=255,
|
||||
|
||||
//BLIP
|
||||
@ -128,10 +125,7 @@ namespace DocFileFormat
|
||||
movie=274,
|
||||
pictureRecolor=282,
|
||||
picturePreserveGrays=313,
|
||||
fRewind=314,
|
||||
fLooping=315,
|
||||
pictureGray=317,
|
||||
pictureBiLevel=318,
|
||||
|
||||
blipBooleanProperties=319,
|
||||
|
||||
//Geometry
|
||||
@ -161,12 +155,7 @@ namespace DocFileFormat
|
||||
pInscribe=343,
|
||||
cxk=344,
|
||||
pFragments=345,
|
||||
fColumnLineOK=377,
|
||||
fShadowOK=378,
|
||||
f3DOK=379,
|
||||
fLineOK=380,
|
||||
fGtextOK=381,
|
||||
fFillShadeShapeOK=382,
|
||||
|
||||
geometryBooleans=383,
|
||||
|
||||
//Fill Style
|
||||
@ -205,12 +194,6 @@ namespace DocFileFormat
|
||||
fillBackColorExt=418,
|
||||
fillBackColorExtMod=420,
|
||||
|
||||
fRecolorFillAsPicture=441,
|
||||
fUseShapeAnchor=442,
|
||||
fFilled=443,
|
||||
fHitTestFill=444,
|
||||
fillShape=445,
|
||||
fillUseRect=446,
|
||||
fillStyleBooleanProperties=447,
|
||||
|
||||
//Line Style
|
||||
@ -238,12 +221,7 @@ namespace DocFileFormat
|
||||
lineEndArrowLength=469,
|
||||
lineJoinStyle=470,
|
||||
lineEndCapStyle=471,
|
||||
fInsetPen=505,
|
||||
fInsetPenOK=506,
|
||||
fArrowheadsOK=507,
|
||||
fLine=508,
|
||||
fHitTestLine=509,
|
||||
lineFillShape=510,
|
||||
|
||||
lineStyleBooleans=511,
|
||||
|
||||
//Shadow Style
|
||||
@ -265,7 +243,7 @@ namespace DocFileFormat
|
||||
shadowWeight=527,
|
||||
shadowOriginX=528,
|
||||
shadowOriginY=529,
|
||||
fShadow=574,
|
||||
|
||||
shadowStyleBooleanProperties=575,
|
||||
|
||||
//Perspective Style
|
||||
@ -281,6 +259,7 @@ namespace DocFileFormat
|
||||
perspectiveWeight=585,
|
||||
perspectiveOriginX=586,
|
||||
perspectiveOriginY=587,
|
||||
|
||||
perspectiveStyleBooleanProperties=639,
|
||||
|
||||
//3D Object
|
||||
@ -293,9 +272,7 @@ namespace DocFileFormat
|
||||
c3DExtrudePlane=646,
|
||||
c3DExtrusionColor=647,
|
||||
c3DCrMod=648,
|
||||
f3D=700,
|
||||
fc3DMetallic=701,
|
||||
fc3DUseExtrusionColor=702,
|
||||
|
||||
threeDObjectBooleanProperties=703,
|
||||
|
||||
//3D Style
|
||||
@ -326,10 +303,7 @@ namespace DocFileFormat
|
||||
c3DFillY=728,
|
||||
c3DFillZ=729,
|
||||
c3DFillIntensity=730,
|
||||
fc3DConstrainRotation=763,
|
||||
fc3DRotationCenterAuto=764,
|
||||
fc3DParallel=765,
|
||||
fc3DKeyHarsh=766,
|
||||
|
||||
threeDStyleBooleanProperties=767,
|
||||
|
||||
//Shape
|
||||
@ -343,14 +317,7 @@ namespace DocFileFormat
|
||||
dgmNodeKind=778,
|
||||
dgmLayoutMRU=779,
|
||||
wzEquationXML=780,
|
||||
fPolicyLabel=822,
|
||||
fPolicyBarcode=823,
|
||||
fFlipHQFE5152=824,
|
||||
fFlipVQFE5152=825,
|
||||
fPreferRelativeResize=827,
|
||||
fLockShapeType=828,
|
||||
fInitiator=829,
|
||||
fDeleteAttachedObject=830,
|
||||
|
||||
shapeBooleans=831,
|
||||
|
||||
//Callout
|
||||
@ -410,16 +377,9 @@ namespace DocFileFormat
|
||||
wzAccessBlob=936,
|
||||
metroBlob=937,
|
||||
dhgt=938,
|
||||
fLayoutInCell=944,
|
||||
fIsBullet=945,
|
||||
fStandardHR=946,
|
||||
fNoshadeHR=947,
|
||||
fHorizRule=948,
|
||||
fUserDrawn=949,
|
||||
fAllowOverlap=950,
|
||||
fReallyHidden=951,
|
||||
fScriptAnchor=952,
|
||||
|
||||
groupShapeBooleans = 959,
|
||||
|
||||
relRotation = 964,
|
||||
|
||||
//Unknown HTML
|
||||
@ -568,18 +528,19 @@ namespace DocFileFormat
|
||||
|
||||
struct OptionEntry
|
||||
{
|
||||
OptionEntry() : pid(PropertyId_left), fBid(false), fComplex(false), op(0), opComplex(NULL)
|
||||
OptionEntry() : pid(PropertyId_left), fBid(false), fComplex(false), op(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
PropertyId pid;
|
||||
bool fBid;
|
||||
bool fComplex;
|
||||
unsigned int op;
|
||||
unsigned char* opComplex;
|
||||
std::shared_ptr<unsigned char> opComplex;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<OptionEntry> OptionEntryPtr;
|
||||
|
||||
class ShapeOptions: public Record
|
||||
{
|
||||
public:
|
||||
@ -587,8 +548,8 @@ namespace DocFileFormat
|
||||
static const unsigned short TYPE_CODE_0xF121 = 0xF121;
|
||||
static const unsigned short TYPE_CODE_0xF122 = 0xF122;
|
||||
|
||||
std::vector<OptionEntry> Options;
|
||||
std::map<PropertyId, OptionEntry> OptionsByID;
|
||||
std::vector<OptionEntryPtr> Options;
|
||||
std::map<PropertyId, OptionEntryPtr> OptionsByID;
|
||||
|
||||
ShapeOptions() : Record()
|
||||
{
|
||||
@ -596,50 +557,47 @@ namespace DocFileFormat
|
||||
|
||||
virtual ~ShapeOptions()
|
||||
{
|
||||
for (std::vector<OptionEntry>::iterator iter = Options.begin(); iter != Options.end(); ++iter)
|
||||
RELEASEARRAYOBJECTS( iter->opComplex );
|
||||
}
|
||||
|
||||
ShapeOptions (IBinaryReader* _reader, unsigned int size, unsigned int typeCode, unsigned int version, unsigned int instance) : Record (_reader, size, typeCode, version, instance)
|
||||
{
|
||||
long pos = Reader->GetPosition();
|
||||
|
||||
//instance is the count of properties stored in this record
|
||||
|
||||
OptionEntry entry;
|
||||
//parse the flags and the simple values
|
||||
for (unsigned int i = 0; i < instance; ++i)
|
||||
{
|
||||
OptionEntryPtr entry = std::shared_ptr<OptionEntry>(new OptionEntry());
|
||||
unsigned short flag = Reader->ReadUInt16();
|
||||
|
||||
entry.pid = (PropertyId)FormatUtils::BitmaskToInt (flag, 0x3FFF);
|
||||
entry.fBid = FormatUtils::BitmaskToBool (flag, 0x4000);
|
||||
entry.fComplex = FormatUtils::BitmaskToBool (flag, 0x8000);
|
||||
entry.op = Reader->ReadUInt32();
|
||||
entry->pid = (PropertyId)FormatUtils::BitmaskToInt (flag, 0x3FFF);
|
||||
entry->fBid = FormatUtils::BitmaskToBool (flag, 0x4000);
|
||||
entry->fComplex = FormatUtils::BitmaskToBool (flag, 0x8000);
|
||||
entry->op = Reader->ReadUInt32();
|
||||
|
||||
Options.push_back( entry );
|
||||
}
|
||||
|
||||
//parse the complex values
|
||||
//these values are stored directly at the end
|
||||
//of the OptionEntry arry, sorted by pid
|
||||
//parse the complex values & sorted by pid
|
||||
for (unsigned int i = 0; i < instance; ++i)
|
||||
{
|
||||
if (Options[i].fComplex)
|
||||
{
|
||||
int read_size = (int)Options[i].op + 6 ; //????
|
||||
//todooo !!!! проверить все остальные !! тут размер в зависимости от типа Complex!!!
|
||||
switch(Options[i].pid)
|
||||
{
|
||||
case PropertyId::gtextUNICODE:
|
||||
case PropertyId::gtextFont:
|
||||
read_size = (int)Options[i].op;
|
||||
break;
|
||||
}
|
||||
Options[i].opComplex = Reader->ReadBytes( read_size, true );
|
||||
if (Options[i]->fComplex && Options[i]->op > 0)
|
||||
{
|
||||
unsigned int size = Options[i]->op;
|
||||
|
||||
if (Options[i]->pid == 0x0145 ||
|
||||
Options[i]->pid == 0x0146 ||
|
||||
Options[i]->pid == 0x0197 ||
|
||||
Options[i]->pid == 0x0156 ||
|
||||
Options[i]->pid == 0x0155 ||
|
||||
Options[i]->pid == 0x0151 ||
|
||||
Options[i]->pid == 0x0152 ||
|
||||
Options[i]->pid == 0x0157 ||
|
||||
Options[i]->pid == 0x0158)//mso arrays
|
||||
size += 6;
|
||||
Options[i]->opComplex = std::shared_ptr<unsigned char>(Reader->ReadBytes( size, true ));
|
||||
}
|
||||
|
||||
OptionsByID.insert(std::pair<PropertyId, OptionEntry>(Options[i].pid, Options[i]));
|
||||
OptionsByID.insert(std::make_pair(Options[i]->pid, Options[i]));
|
||||
}
|
||||
|
||||
Reader->Seek(( pos + size ), 0/*STREAM_SEEK_SET*/);
|
||||
|
||||
@ -0,0 +1,92 @@
|
||||
/*
|
||||
* (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
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
class ThreeDStyleBooleanProperties
|
||||
{
|
||||
public:
|
||||
ThreeDStyleBooleanProperties(unsigned int op)
|
||||
{
|
||||
fUsefc3DConstrainRotation = GETBIT(op, 0);
|
||||
fUsefc3DRotationCenterAuto = GETBIT(op, 1);
|
||||
fUsefc3DParallel = GETBIT(op, 2);
|
||||
fUsefc3DKeyHarsh = GETBIT(op, 3);
|
||||
fUsefc3DFillHarsh = GETBIT(op, 4);
|
||||
|
||||
fc3DConstrainRotation = GETBIT(op, 16);
|
||||
fc3DRotationCenterAuto = GETBIT(op, 17);
|
||||
fc3DParallel = GETBIT(op, 18);
|
||||
fc3DKeyHarsh = GETBIT(op, 19);
|
||||
fc3DFillHarsh = GETBIT(op, 20);
|
||||
}
|
||||
bool fUsefc3DConstrainRotation;
|
||||
bool fUsefc3DRotationCenterAuto;
|
||||
bool fUsefc3DParallel;
|
||||
bool fUsefc3DKeyHarsh;
|
||||
bool fUsefc3DFillHarsh;
|
||||
|
||||
bool fc3DConstrainRotation;
|
||||
bool fc3DRotationCenterAuto;
|
||||
bool fc3DParallel;
|
||||
bool fc3DKeyHarsh;
|
||||
bool fc3DFillHarsh;
|
||||
};
|
||||
class ThreeDObjectBooleanProperties
|
||||
{
|
||||
public:
|
||||
ThreeDObjectBooleanProperties(unsigned int op)
|
||||
{
|
||||
fUsef3D = GETBIT(op, 0);
|
||||
fUsefc3DMetallic = GETBIT(op, 1);
|
||||
fUsefc3DUseExtrusionColor = GETBIT(op, 2);
|
||||
fUsefc3DLightFace = GETBIT(op, 3);
|
||||
|
||||
// 12 unused
|
||||
|
||||
f3D = GETBIT(op, 16);
|
||||
fc3DMetallic = GETBIT(op, 17);
|
||||
fc3DUseExtrusionColor = GETBIT(op, 18);
|
||||
fc3DLightFace = GETBIT(op, 19);
|
||||
}
|
||||
bool fUsef3D;
|
||||
bool fUsefc3DMetallic;
|
||||
bool fUsefc3DUseExtrusionColor;
|
||||
bool fUsefc3DLightFace;
|
||||
|
||||
bool f3D;
|
||||
bool fc3DMetallic;
|
||||
bool fc3DUseExtrusionColor;
|
||||
bool fc3DLightFace;
|
||||
};
|
||||
}
|
||||
@ -46,35 +46,35 @@ OleObject::OleObject( const CharacterPropertyExceptions* chpx, StructuredStorage
|
||||
|
||||
HRESULT res = S_OK;
|
||||
|
||||
POLE::Stream* ObjectPoolStorage = new POLE::Stream(oleStorage, "ObjectPool");
|
||||
POLE::Stream* ObjectPoolStorage = new POLE::Stream(oleStorage, L"ObjectPool");
|
||||
|
||||
if (ObjectPoolStorage)
|
||||
{
|
||||
ObjectId = getOleEntryName( chpx );
|
||||
|
||||
std::string sObjectId( ObjectId.begin(), ObjectId.end() );
|
||||
std::wstring sObjectId( ObjectId.begin(), ObjectId.end() );
|
||||
{
|
||||
std::string name = "ObjectPool/" + sObjectId + "/";
|
||||
processOleStream( name + "Ole" );
|
||||
std::wstring name = L"ObjectPool/" + sObjectId + L"/";
|
||||
processOleStream( name + L"Ole" );
|
||||
|
||||
if ( bLinked )
|
||||
{
|
||||
processLinkInfoStream( name + "LinkInfo" );
|
||||
processLinkInfoStream( name + L"LinkInfo" );
|
||||
}
|
||||
else
|
||||
{
|
||||
processCompObjStream( name + "CompObj" );
|
||||
processCompObjStream( name + L"CompObj" );
|
||||
}
|
||||
|
||||
processPICStream( name + "PIC" );
|
||||
processPICStream( name + L"PIC" );
|
||||
|
||||
processEquationNativeStream( name + "Equation Native" );
|
||||
processEquationNativeStream( name + L"Equation Native" );
|
||||
}
|
||||
delete ObjectPoolStorage;
|
||||
}
|
||||
}
|
||||
|
||||
void OleObject::processLinkInfoStream( const std::string& linkStream )
|
||||
void OleObject::processLinkInfoStream( const std::wstring& linkStream )
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -125,7 +125,7 @@ void OleObject::processLinkInfoStream( const std::string& linkStream )
|
||||
}
|
||||
}
|
||||
|
||||
void OleObject::processEquationNativeStream( const std::string& eqStream )
|
||||
void OleObject::processEquationNativeStream( const std::wstring& eqStream )
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -156,7 +156,7 @@ void OleObject::processEquationNativeStream( const std::string& eqStream )
|
||||
}
|
||||
}
|
||||
|
||||
void OleObject::processPICStream( const std::string& picStream )
|
||||
void OleObject::processPICStream( const std::wstring& picStream )
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -191,7 +191,7 @@ void OleObject::processPICStream( const std::string& picStream )
|
||||
}
|
||||
}
|
||||
|
||||
void OleObject::processCompObjStream( const std::string& compStream )
|
||||
void OleObject::processCompObjStream( const std::wstring& compStream )
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -206,11 +206,11 @@ void OleObject::processCompObjStream( const std::string& compStream )
|
||||
//skip the CompObjHeader
|
||||
reader.ReadBytes( 28, false );
|
||||
|
||||
int sz_obj = reader.GetSize() - reader.GetPosition();
|
||||
unsigned int sz_obj = reader.GetSize() - reader.GetPosition();
|
||||
|
||||
if (sz_obj > 4)
|
||||
{
|
||||
UserType = reader.ReadLengthPrefixedAnsiString(sz_obj);
|
||||
UserType = reader.ReadLengthPrefixedAnsiString(sz_obj);
|
||||
|
||||
sz_obj = reader.GetSize() - reader.GetPosition();
|
||||
if (sz_obj > 4)
|
||||
@ -218,7 +218,7 @@ void OleObject::processCompObjStream( const std::string& compStream )
|
||||
|
||||
sz_obj = reader.GetSize() - reader.GetPosition();
|
||||
if (sz_obj > 4)
|
||||
Program = reader.ReadLengthPrefixedAnsiString(sz_obj);
|
||||
Program = reader.ReadLengthPrefixedAnsiString(sz_obj);
|
||||
}
|
||||
delete pCompStream;
|
||||
}
|
||||
@ -228,7 +228,7 @@ void OleObject::processCompObjStream( const std::string& compStream )
|
||||
}
|
||||
}
|
||||
|
||||
void OleObject::processOleStream( const std::string& oleStreamName )
|
||||
void OleObject::processOleStream( const std::wstring& oleStreamName )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@ -74,11 +74,11 @@ namespace DocFileFormat
|
||||
private:
|
||||
POLE::Storage *oleStorage;
|
||||
|
||||
void processLinkInfoStream ( const std::string& linkStream );
|
||||
void processEquationNativeStream( const std::string& eqStream );
|
||||
void processPICStream ( const std::string& picStream );
|
||||
void processCompObjStream ( const std::string& compStream );
|
||||
void processOleStream ( const std::string& oleStreamName );
|
||||
void processLinkInfoStream ( const std::wstring& linkStream );
|
||||
void processEquationNativeStream( const std::wstring& eqStream );
|
||||
void processPICStream ( const std::wstring& picStream );
|
||||
void processCompObjStream ( const std::wstring& compStream );
|
||||
void processOleStream ( const std::wstring& oleStreamName );
|
||||
|
||||
std::wstring getOleEntryName ( const CharacterPropertyExceptions* chpx );
|
||||
};
|
||||
|
||||
@ -66,25 +66,23 @@ namespace DocFileFormat
|
||||
ole->Program = L"Word.Document";
|
||||
}
|
||||
m_pXmlWriter->WriteNodeBegin( L"o:OLEObject", TRUE );
|
||||
|
||||
int relID = -1;
|
||||
|
||||
if ( ole->bLinked )
|
||||
{
|
||||
int relID = m_context->_docx->RegisterExternalOLEObject(_caller, ole->ClipboardFormat, ole->Link);
|
||||
relID = m_context->_docx->RegisterExternalOLEObject(_caller, ole->ClipboardFormat, ole->Link);
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"r:id", ( std::wstring( L"rId" ) + FormatUtils::IntToWideString( relID ) ));
|
||||
m_pXmlWriter->WriteAttribute( L"Type", L"Link" );
|
||||
m_pXmlWriter->WriteAttribute( L"UpdateMode", ole->UpdateMode);
|
||||
}
|
||||
else
|
||||
{
|
||||
int relID = -1;
|
||||
|
||||
{
|
||||
if (ole->isEmbedded)
|
||||
relID = m_context->_docx->RegisterPackage(_caller, ole->ClipboardFormat);
|
||||
else
|
||||
relID = m_context->_docx->RegisterOLEObject(_caller, ole->ClipboardFormat);
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"r:id", L"rId"+ FormatUtils::IntToWideString( relID ) );
|
||||
m_pXmlWriter->WriteAttribute( L"Type", L"Embed" );
|
||||
|
||||
copyEmbeddedObject( ole );
|
||||
@ -94,7 +92,8 @@ namespace DocFileFormat
|
||||
m_pXmlWriter->WriteAttribute( L"ShapeID", _shapeId);
|
||||
m_pXmlWriter->WriteAttribute( L"DrawAspect", L"Content" );
|
||||
m_pXmlWriter->WriteAttribute( L"ObjectID", ole->ObjectId);
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"r:id", L"rId"+ FormatUtils::IntToWideString( relID ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"o:OLEObject" );
|
||||
}
|
||||
|
||||
@ -43,6 +43,7 @@
|
||||
#include "MainDocumentMapping.h"
|
||||
#include "OleObjectMapping.h"
|
||||
#include "VMLPictureMapping.h"
|
||||
#include "FormFieldDataMapping.h"
|
||||
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
#include "../../DesktopEditor/common/Directory.h"
|
||||
@ -63,6 +64,8 @@ namespace DocFileFormat
|
||||
DocumentContentTypesFile._defaultTypes.insert( make_pair( L"xml", std::wstring( OpenXmlContentTypes::Xml ) ) );
|
||||
|
||||
MainRelationshipsFile.Relationships.push_back( Relationship( std::wstring( L"rId1"), OpenXmlRelationshipTypes::OfficeDocument, L"word/document.xml") );
|
||||
MainRelationshipsFile.Relationships.push_back( Relationship( std::wstring( L"rId2"), OpenXmlRelationshipTypes::CoreProperties, L"docProps/core.xml") );
|
||||
MainRelationshipsFile.Relationships.push_back( Relationship( std::wstring( L"rId3"), OpenXmlRelationshipTypes::ExtendedProperties, L"docProps/app.xml") );
|
||||
}
|
||||
|
||||
|
||||
@ -73,7 +76,6 @@ namespace DocFileFormat
|
||||
|
||||
NSDirectory::CreateDirectory( m_strOutputPath + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR + L"_rels" );
|
||||
|
||||
|
||||
WriteRelsFile( DocumentRelationshipsFile );
|
||||
|
||||
WriteRelsFile( FootnotesRelationshipsFile );
|
||||
@ -137,15 +139,17 @@ namespace DocFileFormat
|
||||
{
|
||||
NSFile::CFileBinary file;
|
||||
file.CreateFileW(fileName);
|
||||
file.WriteFile((BYTE*)data.c_str(), data.size());
|
||||
file.WriteFile((BYTE*)data.c_str(), (_UINT32)data.size());
|
||||
file.CloseFile();
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT OpenXmlPackage::SaveOLEObject( const std::wstring& fileName, const OleObjectFileStructure& oleObjectFileStructure )
|
||||
{
|
||||
if (docFile == NULL) return S_FALSE;
|
||||
|
||||
POLE::Storage *storageOut = new POLE::Storage(fileName.c_str());
|
||||
if (storageOut == NULL) return S_FALSE;
|
||||
|
||||
if (storageOut == NULL || docFile == NULL) return S_FALSE;
|
||||
if (storageOut->open(true, true)==false)
|
||||
{
|
||||
delete storageOut;
|
||||
@ -155,22 +159,27 @@ namespace DocFileFormat
|
||||
POLE::Storage *storageInp = docFile->GetStorage()->GetStorage();
|
||||
|
||||
{
|
||||
std::string id(oleObjectFileStructure.objectID.begin(),oleObjectFileStructure.objectID.end());
|
||||
|
||||
POLE::Stream* oleStorage = new POLE::Stream(storageInp, id);
|
||||
POLE::Stream* oleStorage = new POLE::Stream(storageInp, oleObjectFileStructure.objectID);
|
||||
|
||||
if (oleStorage)
|
||||
{
|
||||
std::string path = "ObjectPool/" + id;
|
||||
std::list<std::string> entries = storageInp->entries(path);
|
||||
for (std::list<std::string>::iterator it = entries.begin(); it != entries.end(); it++)
|
||||
std::wstring path = L"ObjectPool/" + oleObjectFileStructure.objectID;
|
||||
|
||||
std::list<std::wstring> entries = storageInp->entries_with_prefix(path);
|
||||
for (std::list<std::wstring>::iterator it = entries.begin(); it != entries.end(); ++it)
|
||||
{
|
||||
POLE::Stream *stream_inp = new POLE::Stream(storageInp, path + "/"+ (*it));
|
||||
std::wstring stream_name_open = (*it);
|
||||
std::wstring stream_name_create = (*it);
|
||||
|
||||
if (stream_name_open[0] < 32)
|
||||
stream_name_open = stream_name_open.substr(1);
|
||||
|
||||
POLE::Stream *stream_inp = new POLE::Stream(storageInp, path + L"/"+ stream_name_open);
|
||||
if (stream_inp == NULL)continue;
|
||||
|
||||
int size = stream_inp->size();
|
||||
POLE::uint64 size = stream_inp->size();
|
||||
|
||||
POLE::Stream *stream_out = new POLE::Stream(storageOut, *it, true, size);
|
||||
POLE::Stream *stream_out = new POLE::Stream(storageOut, stream_name_create, true, size);
|
||||
|
||||
if (stream_out)
|
||||
{
|
||||
@ -194,12 +203,23 @@ namespace DocFileFormat
|
||||
delete storageOut;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
int OpenXmlPackage::RegisterDocument()
|
||||
void OpenXmlPackage::RegisterDocPr()
|
||||
{
|
||||
return AddPart( L"word", L"document.xml", WordprocessingMLContentTypes::MainDocument, L"");
|
||||
AddPart( L"docProps", L"app.xml", DocPrContentTypes::App, L"");
|
||||
AddPart( L"docProps", L"core.xml", DocPrContentTypes::Core, L"");
|
||||
}
|
||||
void OpenXmlPackage::RegisterDocument()
|
||||
{
|
||||
AddPart( L"word", L"document.xml", WordprocessingMLContentTypes::MainDocument, L"");
|
||||
}
|
||||
void OpenXmlPackage::RegisterDocumentMacros()
|
||||
{
|
||||
AddPart( L"word", L"document.xml", WordprocessingMLContentTypes::MainDocumentMacro, L"");
|
||||
}
|
||||
int OpenXmlPackage::RegisterVbaProject()
|
||||
{
|
||||
return AddPart( L"word", L"vbaProject.bin", MicrosoftWordContentTypes::VbaProject, OpenXmlRelationshipTypes::VbaProject );
|
||||
}
|
||||
|
||||
int OpenXmlPackage::RegisterFontTable()
|
||||
{
|
||||
return AddPart( L"word", L"fontTable.xml", WordprocessingMLContentTypes::FontTable, OpenXmlRelationshipTypes::FontTable );
|
||||
|
||||
@ -118,6 +118,8 @@ namespace DocFileFormat
|
||||
|
||||
class OpenXmlPackage
|
||||
{
|
||||
public:
|
||||
const WordDocument* docFile;
|
||||
private:
|
||||
ContentTypesFile DocumentContentTypesFile;
|
||||
RelationshipsFile MainRelationshipsFile;
|
||||
@ -137,8 +139,6 @@ namespace DocFileFormat
|
||||
int _footerCounter;
|
||||
int _oleCounter;
|
||||
|
||||
const WordDocument* docFile;
|
||||
|
||||
int AddHeaderPart( const std::wstring& fileName, const std::wstring& relationshipType = L"", const std::wstring& targetMode = L"" );
|
||||
int AddFooterPart( const std::wstring& fileName, const std::wstring& relationshipType = L"", const std::wstring& targetMode = L"" );
|
||||
int AddFootnotesPart( const std::wstring& fileName, const std::wstring& relationshipType = L"", const std::wstring& targetMode = L"" );
|
||||
@ -165,7 +165,9 @@ namespace DocFileFormat
|
||||
HRESULT SaveOLEObject ( const std::wstring& fileName, const OleObjectFileStructure& oleObjectFileStructure );
|
||||
HRESULT SaveEmbeddedObject ( const std::wstring& fileName, const std::string& data );
|
||||
|
||||
int RegisterDocument();
|
||||
void RegisterDocPr();
|
||||
void RegisterDocument();
|
||||
void RegisterDocumentMacros();
|
||||
int RegisterFontTable();
|
||||
int RegisterNumbering();
|
||||
int RegisterSettings();
|
||||
@ -179,5 +181,6 @@ namespace DocFileFormat
|
||||
int RegisterOLEObject ( const IMapping* mapping, const std::wstring& objectType );
|
||||
int RegisterPackage ( const IMapping* mapping, const std::wstring& objectType);
|
||||
int RegisterExternalOLEObject( const IMapping* mapping, const std::wstring& objectType, const std::wstring& uri );
|
||||
int RegisterVbaProject();
|
||||
};
|
||||
}
|
||||
|
||||
@ -154,7 +154,7 @@ namespace DocFileFormat
|
||||
|
||||
case sprmPFBiDi:
|
||||
{
|
||||
bool val = iter->argumentsSize > 0 ? iter->Arguments[0] : true;
|
||||
bool val = iter->argumentsSize > 0 ? (iter->Arguments[0] != 0) : true;
|
||||
appendFlagElement( _pPr, *iter, L"bidi", val);
|
||||
_isBidi = val;
|
||||
}break;
|
||||
@ -427,7 +427,7 @@ namespace DocFileFormat
|
||||
if (m_document->listTable)
|
||||
{
|
||||
m_document->listTable->appendNumbering( desc );
|
||||
short numId = m_document->listTable->listNumbering.size();
|
||||
short numId = static_cast<short>(m_document->listTable->listNumbering.size());
|
||||
appendValueElement( &numPr, L"numId", numId, true );
|
||||
}
|
||||
}break;
|
||||
@ -485,7 +485,7 @@ namespace DocFileFormat
|
||||
{
|
||||
XMLTools::XMLElement tabs( L"w:tabs" );
|
||||
|
||||
int pos = 0;
|
||||
unsigned int pos = 0;
|
||||
|
||||
//read the removed tabs
|
||||
unsigned char itbdDelMax = iter->Arguments[pos];
|
||||
|
||||
@ -462,57 +462,60 @@ namespace DocFileFormat
|
||||
|
||||
void PropertiesMapping::appendShading( XMLTools::XMLElement* parent, const ShadingDescriptor& desc )
|
||||
{
|
||||
std::wstring pattern = getShadingPattern( desc );
|
||||
if ( ( parent != NULL ) && ( desc.shadingSpecialValue == shadingSpecialValueNormal ))
|
||||
{
|
||||
XMLTools::XMLElement shd( L"w:shd" );
|
||||
|
||||
//fill color
|
||||
XMLTools::XMLAttribute fill( L"w:fill" );
|
||||
|
||||
if ( desc.shadingType == shadingTypeShd )
|
||||
{
|
||||
if ( desc.cvBackAuto )
|
||||
{
|
||||
fill.SetValue( L"auto" );
|
||||
}
|
||||
else
|
||||
{
|
||||
fill.SetValue( RGBColor( (int)desc.cvBack, RedLast ).SixDigitHexCode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fill.SetValue( FormatUtils::MapValueToWideString( desc.icoBack, &Global::ColorIdentifier[0][0], 17, 12 ));
|
||||
}
|
||||
|
||||
shd.AppendAttribute( fill );
|
||||
|
||||
//foreground color
|
||||
XMLTools::XMLAttribute color( L"w:color" );
|
||||
|
||||
if ( desc.shadingType == shadingTypeShd )
|
||||
{
|
||||
if ( desc.cvForeAuto )
|
||||
{
|
||||
color.SetValue( L"auto" );
|
||||
}
|
||||
else
|
||||
{
|
||||
color.SetValue( RGBColor( (int)desc.cvFore, RedLast ).SixDigitHexCode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
color.SetValue( FormatUtils::MapValueToWideString( desc.icoFore, &Global::ColorIdentifier[0][0], 17, 12 ));
|
||||
}
|
||||
|
||||
shd.AppendAttribute( color );
|
||||
|
||||
//pattern
|
||||
XMLTools::XMLAttribute val( L"w:val" );
|
||||
val.SetValue( getShadingPattern( desc ));
|
||||
val.SetValue( pattern);
|
||||
shd.AppendAttribute( val );
|
||||
|
||||
if (pattern != L"nil")
|
||||
{
|
||||
//fill color
|
||||
XMLTools::XMLAttribute fill( L"w:fill" );
|
||||
|
||||
if ( desc.shadingType == shadingTypeShd )
|
||||
{
|
||||
if ( desc.cvBackAuto )
|
||||
{
|
||||
fill.SetValue( L"auto" );
|
||||
}
|
||||
else
|
||||
{
|
||||
fill.SetValue( RGBColor( (int)desc.cvBack, RedLast ).SixDigitHexCode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fill.SetValue( FormatUtils::MapValueToWideString( desc.icoBack, &Global::ColorIdentifier[0][0], 17, 12 ));
|
||||
}
|
||||
|
||||
shd.AppendAttribute( fill );
|
||||
|
||||
//foreground color
|
||||
XMLTools::XMLAttribute color( L"w:color" );
|
||||
|
||||
if ( desc.shadingType == shadingTypeShd )
|
||||
{
|
||||
if ( desc.cvForeAuto )
|
||||
{
|
||||
color.SetValue( L"auto" );
|
||||
}
|
||||
else
|
||||
{
|
||||
color.SetValue( RGBColor( (int)desc.cvFore, RedLast ).SixDigitHexCode);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
color.SetValue( FormatUtils::MapValueToWideString( desc.icoFore, &Global::ColorIdentifier[0][0], 17, 12 ));
|
||||
}
|
||||
|
||||
shd.AppendAttribute( color );
|
||||
}
|
||||
parent->RemoveChildByName( L"w:shd" );
|
||||
parent->AppendChild( shd );
|
||||
}
|
||||
|
||||
@ -40,19 +40,13 @@ namespace DocFileFormat
|
||||
RELEASEOBJECT( Changes );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
RevisionData::RevisionData():
|
||||
Dttm(), Isbt(0), Type(NoRevision), Changes(NULL), RsidDel(0), RsidProp(0), Rsid(0)
|
||||
{
|
||||
this->Changes = new std::list<SinglePropertyModifier>();
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
/// Collects the revision data of a CHPX
|
||||
RevisionData::RevisionData( CharacterPropertyExceptions* chpx ):
|
||||
Dttm(), Isbt(0), Type(NoRevision), Changes(NULL), RsidDel(0), RsidProp(0), Rsid(0)
|
||||
RevisionData::RevisionData( CharacterPropertyExceptions* chpx ) : Dttm(), Isbt(0), Type(NoRevision), Changes(NULL), RsidDel(0), RsidProp(0), Rsid(0)
|
||||
{
|
||||
bool collectRevisionData = true;
|
||||
this->Changes = new std::list<SinglePropertyModifier>();
|
||||
|
||||
@ -174,9 +174,9 @@ namespace DocFileFormat
|
||||
//it's a Word 97 SPRM
|
||||
short val = FormatUtils::BytesToInt16(bytes, 0, size);
|
||||
|
||||
icoFore = (val & 0x1F);
|
||||
icoBack = ((val >> 5) & 0x1F);
|
||||
ipat = (ShadingPattern) ((val >> 10) & 0x3F);
|
||||
icoFore = GETBITS(val, 0, 4);
|
||||
icoBack = GETBITS(val, 5, 9);
|
||||
ipat = (ShadingPattern) GETBITS(val, 10, 15);
|
||||
|
||||
shadingType = shadingTypeShd80;
|
||||
|
||||
@ -209,7 +209,7 @@ namespace DocFileFormat
|
||||
else if (0x0F == icoFore) { cvFore = RGB2 (0x80, 0x80, 0x80); }
|
||||
else if (0x10 == icoFore) { cvFore = RGB2 (0xC0, 0xC0, 0xC0); }
|
||||
|
||||
if (0x00 == icoBack) { cvBack = RGB2 (0x00, 0x00, 0x00); cvBackAuto = true; }
|
||||
if (0x00 == icoBack) { cvBack = RGB2 (0xFF, 0xFF, 0xFF); cvBackAuto = true; }
|
||||
else if (0x01 == icoBack) { cvBack = RGB2 (0x00, 0x00, 0x00); }
|
||||
else if (0x02 == icoBack) { cvBack = RGB2 (0x00, 0x00, 0xFF); }
|
||||
else if (0x03 == icoBack) { cvBack = RGB2 (0x00, 0xFF, 0xFF); }
|
||||
|
||||
@ -41,7 +41,7 @@ namespace DocFileFormat
|
||||
{
|
||||
TC80()
|
||||
{
|
||||
horzMerge = wWidth = 0;
|
||||
wWidth = horzMerge =0;
|
||||
|
||||
textFlow = Global::lrTb;
|
||||
vertMerge = Global::fvmClear;
|
||||
@ -95,13 +95,14 @@ namespace DocFileFormat
|
||||
int pointer = 1;
|
||||
|
||||
// rgdxaCenter
|
||||
|
||||
for (int i = 0; i < numberOfColumns + 1; ++i)
|
||||
{
|
||||
rgdxaCenter.push_back(FormatUtils::BytesToInt16(bytes, pointer, size));
|
||||
int pos = FormatUtils::BytesToInt16(bytes, pointer, size);
|
||||
rgdxaCenter.push_back(pos);
|
||||
pointer += 2;
|
||||
}
|
||||
|
||||
|
||||
// rgTc80
|
||||
|
||||
for (int i = 0; i < numberOfColumns; ++i)
|
||||
|
||||
@ -41,6 +41,7 @@ namespace DocFileFormat
|
||||
{
|
||||
template<class T> class StringTable: public IVisitable
|
||||
{
|
||||
friend class WordDocument;
|
||||
friend class CharacterPropertiesMapping;
|
||||
friend class FontTableMapping;
|
||||
friend class StyleSheetMapping;
|
||||
@ -81,7 +82,7 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
ByteStructure* operator [] ( unsigned int index ) const
|
||||
ByteStructure* operator [] ( size_t index ) const
|
||||
{
|
||||
if ( index < this->Data.size() )
|
||||
{
|
||||
|
||||
@ -42,7 +42,6 @@ namespace DocFileFormat
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
~StructuredStorageReader()
|
||||
{
|
||||
if(m_pStorage)
|
||||
@ -62,12 +61,18 @@ namespace DocFileFormat
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetStream (const char *path, POLE::Stream** ppStream)
|
||||
bool isDirectory( const std::wstring& name )
|
||||
{
|
||||
if (( m_pStorage != NULL ) && ( path != NULL ))
|
||||
if (!m_pStorage) return false;
|
||||
|
||||
return m_pStorage->isDirectory(name);
|
||||
}
|
||||
|
||||
bool GetStream (const std::wstring & path, POLE::Stream** ppStream)
|
||||
{
|
||||
if (( m_pStorage != NULL ) && ( !path.empty() ))
|
||||
{
|
||||
*ppStream = new POLE::Stream(m_pStorage, path);
|
||||
*ppStream = new POLE::Stream(m_pStorage, path.c_str());
|
||||
}
|
||||
if ((*ppStream) && ((*ppStream)->size() > 0))
|
||||
return true;
|
||||
@ -79,8 +84,78 @@ namespace DocFileFormat
|
||||
{
|
||||
return m_pStorage;
|
||||
}
|
||||
|
||||
void copy( int indent, std::wstring path, POLE::Storage * storageOut, bool withRoot = true)
|
||||
{
|
||||
std::list<std::wstring> entries, entries_sort;
|
||||
entries = m_pStorage->entries_with_prefix( path );
|
||||
|
||||
for( std::list<std::wstring>::iterator it = entries.begin(); it != entries.end(); ++it )
|
||||
{
|
||||
std::wstring name = *it;
|
||||
std::wstring fullname = path + name;
|
||||
|
||||
if( m_pStorage->isDirectory( fullname ) )
|
||||
{
|
||||
entries_sort.push_back(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
entries_sort.push_front(name);
|
||||
}
|
||||
}
|
||||
//for( std::list<std::string>::iterator it = entries.begin(); it != entries.end(); ++it )
|
||||
for( std::list<std::wstring>::iterator it = entries_sort.begin(); it != entries_sort.end(); ++it )
|
||||
{
|
||||
std::wstring name = *it;
|
||||
std::wstring fullname = path + name;
|
||||
|
||||
if( m_pStorage->isDirectory( fullname ) )
|
||||
{
|
||||
copy( indent + 1, fullname + L"/", storageOut, withRoot );
|
||||
}
|
||||
else
|
||||
{
|
||||
copy_stream(fullname, storageOut, withRoot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
void copy_stream(std::wstring streamName, POLE::Storage * storageOut, bool withRoot = true)
|
||||
{
|
||||
POLE::Stream *stream = new POLE::Stream(m_pStorage, streamName);
|
||||
if (!stream) return;
|
||||
|
||||
stream->seek(0);
|
||||
POLE::int64 size_stream = stream->size();
|
||||
|
||||
if (withRoot == false)
|
||||
{
|
||||
int pos = (int)streamName.find(L"/");
|
||||
if (pos >= 0)
|
||||
streamName = streamName.substr(pos + 1);
|
||||
}
|
||||
|
||||
POLE::Stream *streamNew = new POLE::Stream(storageOut, streamName, true, size_stream);
|
||||
if (!streamNew) return;
|
||||
|
||||
unsigned char* data_stream = new unsigned char[size_stream];
|
||||
if (data_stream)
|
||||
{
|
||||
stream->read(data_stream, size_stream);
|
||||
|
||||
streamNew->write(data_stream, size_stream);
|
||||
|
||||
delete []data_stream;
|
||||
data_stream = NULL;
|
||||
}
|
||||
|
||||
streamNew->flush();
|
||||
|
||||
delete streamNew;
|
||||
delete stream;
|
||||
}
|
||||
|
||||
POLE::Storage* m_pStorage;
|
||||
};
|
||||
|
||||
@ -171,7 +171,7 @@ namespace DocFileFormat
|
||||
if ( (*iter)->tapx != NULL )
|
||||
{
|
||||
std::vector<short> tableGrid;
|
||||
TablePropertiesMapping* tpMapping = new TablePropertiesMapping (m_pXmlWriter, sheet, &tableGrid, false);
|
||||
TablePropertiesMapping* tpMapping = new TablePropertiesMapping (m_pXmlWriter, sheet, &tableGrid, NULL, false);
|
||||
(*iter)->tapx->Convert( tpMapping );
|
||||
RELEASEOBJECT( tpMapping );
|
||||
}
|
||||
|
||||
@ -35,13 +35,13 @@
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
TableCellPropertiesMapping::TableCellPropertiesMapping (XMLTools::CStringXmlWriter* pWriter, const std::vector<short>* tableGrid, int gridIndex, int cellIndex) :
|
||||
TableCellPropertiesMapping::TableCellPropertiesMapping (XMLTools::CStringXmlWriter* pWriter, const std::vector<short>* grid, const std::vector<short>* grid_write, int gridIndex, int cellIndex) :
|
||||
PropertiesMapping(pWriter)
|
||||
{
|
||||
_width = 0;
|
||||
|
||||
_gridIndex = gridIndex;
|
||||
_grid = tableGrid;
|
||||
_grid = grid;
|
||||
_cellIndex = cellIndex;
|
||||
|
||||
_brcTop = NULL;
|
||||
@ -75,6 +75,8 @@ namespace DocFileFormat
|
||||
TablePropertyExceptions* tapx = static_cast<TablePropertyExceptions*>(visited);
|
||||
int nComputedCellWidth = 0;
|
||||
|
||||
_gridSpan = 1;
|
||||
|
||||
std::list<SinglePropertyModifier>::const_reverse_iterator rend = tapx->grpprl->rend();
|
||||
for (std::list<SinglePropertyModifier>::const_reverse_iterator iter = tapx->grpprl->rbegin(); iter != rend; ++iter)
|
||||
{
|
||||
@ -87,7 +89,7 @@ namespace DocFileFormat
|
||||
int cc = tdef.numberOfColumns;
|
||||
|
||||
_tGrid = tdef.rgdxaCenter;
|
||||
_tcDef = tdef.rgTc80[(std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1)]; // NOTE: fix for crash
|
||||
_tcDef = tdef.rgTc80[(std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1)];
|
||||
|
||||
appendValueElement( _tcPr, L"textDirection", FormatUtils::MapValueToWideString( _tcDef.textFlow, &Global::TextFlowMap[0][0], 6, 6 ), false );
|
||||
|
||||
@ -111,13 +113,19 @@ namespace DocFileFormat
|
||||
{
|
||||
appendValueElement( _tcPr, L"noWrap", L"", true );
|
||||
}
|
||||
|
||||
nComputedCellWidth = (short)( tdef.rgdxaCenter[(size_t)(std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1) + 1] -
|
||||
tdef.rgdxaCenter[(std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1)] ); // NOTE: fix for crash
|
||||
int ind = (std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1);
|
||||
int ind1 = ind;
|
||||
while (ind1 < tdef.rgdxaCenter.size() - 1)
|
||||
{
|
||||
int sz = tdef.rgdxaCenter[ ind1 + 1] - tdef.rgdxaCenter[ ind1 ] ;
|
||||
if (sz > 1)
|
||||
break;
|
||||
ind1++;
|
||||
}
|
||||
nComputedCellWidth = tdef.rgdxaCenter[ ind1 + 1] - tdef.rgdxaCenter[ ind ] ;
|
||||
|
||||
if (!IsTableBordersDefined(tapx->grpprl))
|
||||
{ //borders
|
||||
|
||||
{
|
||||
RELEASEOBJECT(_brcTop);
|
||||
_brcTop = new BorderCode(*_tcDef.brcTop);
|
||||
|
||||
@ -134,8 +142,7 @@ namespace DocFileFormat
|
||||
break;
|
||||
|
||||
case sprmTCellPadding:
|
||||
{ //margins
|
||||
|
||||
{
|
||||
unsigned char first = iter->Arguments[0];
|
||||
unsigned char lim = iter->Arguments[1];
|
||||
unsigned char ftsMargin = iter->Arguments[3];
|
||||
@ -165,7 +172,6 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case sprmTDefTableShd80:
|
||||
{
|
||||
if (!tapx->IsSkipShading97()) // если такой операнд единственный то учитываем его, иначе скипаем его
|
||||
@ -270,24 +276,23 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
//width
|
||||
XMLTools::XMLElement tcW ( L"w:tcW" );
|
||||
XMLTools::XMLAttribute tcWType ( L"w:type", FormatUtils::MapValueToWideString( _ftsWidth, &Global::CellWidthTypeMap[0][0], 4, 5 ) );
|
||||
XMLTools::XMLAttribute tcWVal ( L"w:w", FormatUtils::IntToWideString( _width ) );
|
||||
XMLTools::XMLElement tcW ( L"w:tcW" );
|
||||
|
||||
|
||||
tcW.AppendAttribute( tcWType );
|
||||
XMLTools::XMLAttribute tcWVal ( L"w:w", FormatUtils::IntToWideString( _width > 1 ? _width : nComputedCellWidth) );
|
||||
XMLTools::XMLAttribute tcWType ( L"w:type", _width > 1 ? FormatUtils::MapValueToWideString( _ftsWidth, &Global::CellWidthTypeMap[0][0], 4, 5 ) : L"dxa" );
|
||||
|
||||
tcW.AppendAttribute( tcWType );
|
||||
tcW.AppendAttribute( tcWVal );
|
||||
_tcPr->AppendChild( tcW );
|
||||
|
||||
//grid span
|
||||
_gridSpan = 1;
|
||||
|
||||
if ( ( _gridIndex < (int)_grid->size() ) && ( nComputedCellWidth > _grid->at( _gridIndex ) ) )
|
||||
{
|
||||
//check the number of merged cells
|
||||
int w = _grid->at( _gridIndex );
|
||||
|
||||
for ( unsigned int i = _gridIndex + 1; i < _grid->size(); i++ )
|
||||
for ( size_t i = _gridIndex + 1; i < _grid->size(); i++ )
|
||||
{
|
||||
_gridSpan++;
|
||||
|
||||
@ -349,7 +354,7 @@ namespace DocFileFormat
|
||||
|
||||
void TableCellPropertiesMapping::apppendCellShading (unsigned char* sprmArg, int size, int cellIndex)
|
||||
{
|
||||
if (sprmArg)
|
||||
if (sprmArg && cellIndex >= 0)
|
||||
{
|
||||
//shading descriptor can have 10 bytes (Word 2000) or 2 bytes (Word 97)
|
||||
int shdLength = 2;
|
||||
|
||||
@ -58,7 +58,7 @@ namespace DocFileFormat
|
||||
public:
|
||||
|
||||
virtual ~TableCellPropertiesMapping();
|
||||
TableCellPropertiesMapping (XMLTools::CStringXmlWriter* pWriter, const std::vector<short>* tableGrid, int gridIndex, int cellIndex);
|
||||
TableCellPropertiesMapping (XMLTools::CStringXmlWriter* pWriter, const std::vector<short>* grid, const std::vector<short>* grid_write, int gridIndex, int cellIndex);
|
||||
virtual void Apply( IVisitable* visited );
|
||||
|
||||
inline int GetGridSpan() const
|
||||
@ -71,9 +71,7 @@ namespace DocFileFormat
|
||||
void apppendCellShading (unsigned char* sprmArg, int size, int cellIndex);
|
||||
bool IsTableBordersDefined (const std::list<SinglePropertyModifier>* grpprl) const;
|
||||
bool IsTableCellWidthDefined (const std::list<SinglePropertyModifier>* grpprl) const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
int _gridIndex;
|
||||
int _cellIndex;
|
||||
|
||||
@ -93,7 +91,6 @@ namespace DocFileFormat
|
||||
BorderCode* _brcRight;
|
||||
BorderCode* _brcBottom;
|
||||
|
||||
/// The grind span of this cell
|
||||
int _gridSpan;
|
||||
int _gridSpan;
|
||||
};
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ namespace DocFileFormat
|
||||
cellElements.clear();
|
||||
}
|
||||
|
||||
void TableCell::Convert(IMapping* mapping, TablePropertyExceptions* tapx, const std::vector<short>* grid, int& gridIndex, int nCellIndex)
|
||||
void TableCell::Convert(IMapping* mapping, TablePropertyExceptions* tapx, const std::vector<short>* grid, const std::vector<short>* grid_write, int& gridIndex, int nCellIndex)
|
||||
{
|
||||
if (NULL != mapping)
|
||||
{
|
||||
@ -116,14 +116,14 @@ namespace DocFileFormat
|
||||
ParagraphPropertyExceptions* papxBackup = documentMapping->_lastValidPapx;
|
||||
SectionPropertyExceptions* sepxBackup = documentMapping->_lastValidSepx;
|
||||
|
||||
//start w:tc
|
||||
documentMapping->GetXMLWriter()->WriteNodeBegin( L"w:tc" );
|
||||
|
||||
//find cell end
|
||||
//find cell end
|
||||
int cpCellEnd = documentMapping->findCellEndCp(cp, depth);
|
||||
|
||||
//convert the properties
|
||||
TableCellPropertiesMapping tcpMapping(documentMapping->GetXMLWriter(), grid, gridIndex, nCellIndex);
|
||||
//start w:tc
|
||||
documentMapping->GetXMLWriter()->WriteNodeBegin( L"w:tc" );
|
||||
|
||||
//convert the properties
|
||||
TableCellPropertiesMapping tcpMapping(documentMapping->GetXMLWriter(), grid, grid_write, gridIndex, nCellIndex);
|
||||
|
||||
if ( tapx != NULL )
|
||||
{
|
||||
@ -140,7 +140,7 @@ namespace DocFileFormat
|
||||
(*iter)->Convert( mapping );
|
||||
}
|
||||
|
||||
//end w:tc
|
||||
//end w:tc
|
||||
documentMapping->GetXMLWriter()->WriteNodeEnd( L"w:tc" );
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ namespace DocFileFormat
|
||||
cells.clear();
|
||||
}
|
||||
|
||||
void TableRow::Convert(IMapping* mapping, const std::vector<short>* grid)
|
||||
void TableRow::Convert(IMapping* mapping, const std::vector<short>* grid, const std::vector<short>* grid_write)
|
||||
{
|
||||
if ( mapping != NULL )
|
||||
{
|
||||
@ -234,7 +234,7 @@ namespace DocFileFormat
|
||||
{
|
||||
for ( std::list<TableCell>::iterator iter = cells.begin(); iter != cells.end(); iter++ )
|
||||
{
|
||||
iter->Convert( mapping, &tapx, grid, gridIndex, nCellIndex++ );
|
||||
iter->Convert( mapping, &tapx, grid, grid_write, gridIndex, nCellIndex++);
|
||||
}
|
||||
}
|
||||
|
||||
@ -516,7 +516,8 @@ namespace DocFileFormat
|
||||
SectionPropertyExceptions* sepxBackup = documentMapping->_lastValidSepx;
|
||||
|
||||
//build the table grid
|
||||
std::vector<short>* grid = documentMapping->buildTableGrid( cpStart, depth );
|
||||
std::vector<short> grid, grid_write;
|
||||
documentMapping->buildTableGrid( cpStart, depth, grid, grid_write );
|
||||
|
||||
//find first row end
|
||||
int fcRowEnd = documentMapping->findRowEndFc( cpStart, depth );
|
||||
@ -529,7 +530,7 @@ namespace DocFileFormat
|
||||
documentMapping->GetXMLWriter()->WriteNodeBegin( L"w:tbl" );
|
||||
|
||||
//Convert it
|
||||
TablePropertiesMapping tpMapping( documentMapping->GetXMLWriter(), documentMapping->m_document->Styles, grid );
|
||||
TablePropertiesMapping tpMapping( documentMapping->GetXMLWriter(), documentMapping->m_document->Styles, &grid, &grid_write );
|
||||
|
||||
row1Tapx.Convert( &tpMapping );
|
||||
|
||||
@ -538,13 +539,12 @@ namespace DocFileFormat
|
||||
|
||||
for ( std::list<TableRow>::iterator iter = rows.begin(); iter != rows.end(); iter++ )
|
||||
{
|
||||
iter->Convert( mapping, grid );
|
||||
iter->Convert( mapping, &grid, &grid_write );
|
||||
}
|
||||
|
||||
//close w:tbl
|
||||
documentMapping->GetXMLWriter()->WriteNodeEnd( L"w:tbl" );
|
||||
|
||||
RELEASEOBJECT( grid );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ namespace DocFileFormat
|
||||
void AddItem( const ITableCellElement& _tableCellElement );
|
||||
bool IsEmpty() const;
|
||||
void Clear();
|
||||
void Convert( IMapping* mapping, TablePropertyExceptions* tapx, const std::vector<short>* grid, int& gridIndex, int cellIndex );
|
||||
void Convert( IMapping* mapping, TablePropertyExceptions* tapx, const std::vector<short>* grid, const std::vector<short>* grid_write, int& gridIndex, int cellIndex );
|
||||
~TableCell();
|
||||
|
||||
private:
|
||||
@ -81,7 +81,7 @@ namespace DocFileFormat
|
||||
void AddCell( const TableCell& _tableCell );
|
||||
bool IsEmpty() const;
|
||||
void Clear();
|
||||
void Convert( IMapping* mapping, const std::vector<short>* grid );
|
||||
void Convert( IMapping* mapping, const std::vector<short>* grid, const std::vector<short>* grid_write );
|
||||
~TableRow();
|
||||
|
||||
private:
|
||||
|
||||
@ -34,15 +34,13 @@
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
TablePropertiesMapping::TablePropertiesMapping (XMLTools::CStringXmlWriter* pWriter, StyleSheet* styles, std::vector<short>* grid, bool isTableStyleNeeded ):
|
||||
PropertiesMapping(pWriter), _tblPr(NULL), _tblGrid(NULL), _tblBorders(NULL), _grid(NULL),
|
||||
brcLeft(NULL), brcTop(NULL), brcBottom(NULL), brcRight(NULL), brcHorz(NULL), brcVert(NULL), _styles(NULL),
|
||||
TablePropertiesMapping::TablePropertiesMapping (XMLTools::CStringXmlWriter* pWriter, StyleSheet* styles, std::vector<short>* grid, std::vector<short>* grid_write, bool isTableStyleNeeded ):
|
||||
PropertiesMapping(pWriter), _tblPr(NULL), _tblGrid(NULL), _tblBorders(NULL), _grid(grid), _grid_write(grid_write),
|
||||
brcLeft(NULL), brcTop(NULL), brcBottom(NULL), brcRight(NULL), brcHorz(NULL), brcVert(NULL), _styles(styles),
|
||||
_isTableStyleNeeded(isTableStyleNeeded)
|
||||
{
|
||||
_styles = styles;
|
||||
_tblPr = new XMLTools::XMLElement( L"w:tblPr");
|
||||
_tblBorders = new XMLTools::XMLElement( L"w:tblBorders");
|
||||
_grid = grid;
|
||||
}
|
||||
TablePropertiesMapping::~TablePropertiesMapping()
|
||||
{
|
||||
@ -74,6 +72,9 @@ namespace DocFileFormat
|
||||
short marginLeft = 0;
|
||||
short marginRight = 0;
|
||||
|
||||
BYTE itcFirst = 0;
|
||||
BYTE itcLim = 0;
|
||||
|
||||
for ( std::list<SinglePropertyModifier>::iterator iter = tapx->grpprl->begin(); iter != tapx->grpprl->end(); iter++ )
|
||||
{
|
||||
switch( iter->OpCode )
|
||||
@ -120,7 +121,15 @@ namespace DocFileFormat
|
||||
_tblPr->AppendChild( tblW );
|
||||
}
|
||||
break;
|
||||
case sprmTMerge:
|
||||
{
|
||||
itcFirst = iter->Arguments[0];
|
||||
itcLim = iter->Arguments[1];
|
||||
}break;
|
||||
case sprmTSplit:
|
||||
{
|
||||
|
||||
}break;
|
||||
case sprmOldTJc:
|
||||
case sprmTJc:
|
||||
case sprmTJcRow:
|
||||
@ -144,7 +153,7 @@ namespace DocFileFormat
|
||||
|
||||
if ( _isTableStyleNeeded )
|
||||
{
|
||||
int ind = FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
size_t ind = FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
|
||||
std::wstring id = ind < _styles->Styles->size() ? StyleSheetMapping::MakeStyleId( _styles->Styles->at( ind ) ) : L"";
|
||||
|
||||
@ -486,9 +495,9 @@ namespace DocFileFormat
|
||||
bWriteGridCol = true;
|
||||
else
|
||||
{
|
||||
for ( unsigned int i = 0, nSize = _grid->size(); i < nSize; i++ )
|
||||
for ( size_t i = 0, nSize = _grid_write->size(); i < nSize; i++ )
|
||||
{
|
||||
if(_grid->at(i) % DocFormatUtils::gc_nZeroWidth != 0)
|
||||
if(_grid->at(i) % DocFileFormat::gc_nZeroWidth != 0)
|
||||
{
|
||||
bWriteGridCol = true;
|
||||
break;
|
||||
@ -497,10 +506,10 @@ namespace DocFileFormat
|
||||
}
|
||||
if(true == bWriteGridCol)
|
||||
{
|
||||
for ( unsigned int i = 0; i < _grid->size(); i++ )
|
||||
for ( size_t i = 0; i < _grid_write->size(); i++ )
|
||||
{
|
||||
XMLTools::XMLElement gridCol( L"w:gridCol");
|
||||
XMLTools::XMLAttribute gridColW( L"w:w", FormatUtils::IntToWideString( _grid->at( i ) ) );
|
||||
XMLTools::XMLAttribute gridColW( L"w:w", FormatUtils::IntToWideString( _grid_write->at( i ) ) );
|
||||
gridCol.AppendAttribute( gridColW );
|
||||
_tblGrid->AppendChild( gridCol );
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ namespace DocFileFormat
|
||||
class TablePropertiesMapping: public PropertiesMapping, public IMapping
|
||||
{
|
||||
public:
|
||||
TablePropertiesMapping( XMLTools::CStringXmlWriter* writer, StyleSheet* styles, std::vector<short>* grid, bool isTableStyleNeeded = true );
|
||||
TablePropertiesMapping( XMLTools::CStringXmlWriter* writer, StyleSheet* styles, std::vector<short>* grid, std::vector<short>* grid_write, bool isTableStyleNeeded = true );
|
||||
virtual ~TablePropertiesMapping();
|
||||
void Apply( IVisitable* visited );
|
||||
|
||||
@ -83,6 +83,7 @@ namespace DocFileFormat
|
||||
|
||||
StyleSheet* _styles;
|
||||
std::vector<short>* _grid;
|
||||
std::vector<short>* _grid_write;
|
||||
|
||||
BorderCode* brcLeft;
|
||||
BorderCode* brcTop;
|
||||
|
||||
@ -62,8 +62,9 @@ namespace DocFileFormat
|
||||
|
||||
for (std::list<SinglePropertyModifier>::iterator oSpmIter = papx->grpprl->begin(); oSpmIter != papx->grpprl->end(); ++oSpmIter)
|
||||
{
|
||||
if (oSpmIter->OpCode == sprmTDefTableShd || oSpmIter->OpCode == sprmTDefTableShd2nd ||
|
||||
oSpmIter->OpCode == sprmTDefTableShd2nd || oSpmIter->OpCode == sprmTDefTableShd3rd)
|
||||
if (oSpmIter->OpCode == sprmTDefTableShd ||
|
||||
oSpmIter->OpCode == sprmTDefTableShd2nd ||
|
||||
oSpmIter->OpCode == sprmTDefTableShd3rd)
|
||||
{
|
||||
m_bSkipShading97 = TRUE;
|
||||
}
|
||||
|
||||
@ -44,6 +44,8 @@
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
#include "../../DesktopEditor/raster/BgraFrame.h"
|
||||
|
||||
using namespace DocFileFormat;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
DWORD iType; // Record type EMR_HEADER
|
||||
@ -71,26 +73,26 @@ namespace DocFileFormat
|
||||
{
|
||||
struct __BITMAPINFOHEADER
|
||||
{
|
||||
DWORD biSize;
|
||||
LONG biWidth;
|
||||
LONG biHeight;
|
||||
WORD biPlanes;
|
||||
WORD biBitCount;
|
||||
DWORD biCompression;
|
||||
DWORD biSizeImage;
|
||||
LONG biXPelsPerMeter;
|
||||
LONG biYPelsPerMeter;
|
||||
DWORD biClrUsed;
|
||||
DWORD biClrImportant;
|
||||
_UINT32 biSize;
|
||||
_INT32 biWidth;
|
||||
_INT32 biHeight;
|
||||
_UINT16 biPlanes;
|
||||
_UINT16 biBitCount;
|
||||
_UINT32 biCompression;
|
||||
_UINT32 biSizeImage;
|
||||
_INT32 biXPelsPerMeter;
|
||||
_INT32 biYPelsPerMeter;
|
||||
_UINT32 biClrUsed;
|
||||
_UINT32 biClrImportant;
|
||||
};
|
||||
|
||||
struct __BITMAPCOREHEADER
|
||||
{
|
||||
DWORD bcSize; /* used to get to color table */
|
||||
WORD bcWidth;
|
||||
WORD bcHeight;
|
||||
WORD bcPlanes;
|
||||
WORD bcBitCount;
|
||||
_UINT32 bcSize; /* used to get to color table */
|
||||
_UINT16 bcWidth;
|
||||
_UINT16 bcHeight;
|
||||
_UINT16 bcPlanes;
|
||||
_UINT16 bcBitCount;
|
||||
};
|
||||
Global::BlipType GetFormatPict(unsigned char* data, int size)
|
||||
{
|
||||
@ -136,47 +138,53 @@ namespace DocFileFormat
|
||||
}
|
||||
return btWin32;
|
||||
}
|
||||
bool ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString)
|
||||
bool VMLPictureMapping::ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString)
|
||||
{
|
||||
newXmlString.clear();
|
||||
std::wstring sTempXmlFile = NSDirectory::CreateTempFileWithUniqueName(
|
||||
NSDirectory::GetTempPath(), L"emb");
|
||||
|
||||
sTempXmlFile += L".xml";
|
||||
|
||||
std::wstring sTempFolder = m_ctx->_doc->m_sTempFolder;
|
||||
if (sTempFolder.empty())
|
||||
{
|
||||
sTempFolder = NSFile::CFileBinary::GetTempPath();
|
||||
}
|
||||
|
||||
std::wstring sTempXmlFile = NSDirectory::CreateTempFileWithUniqueName(sTempFolder, L"emb");
|
||||
|
||||
NSFile::CFileBinary file;
|
||||
file.CreateFileW(sTempXmlFile);
|
||||
file.WriteFile((BYTE*)xmlString.c_str(), xmlString.size());
|
||||
file.CloseFile();
|
||||
|
||||
OOX::CPath path(sTempXmlFile);
|
||||
OOX::CDocument docEmbedded(path, path);
|
||||
OOX::CDocument docEmbedded(NULL, path, path);
|
||||
|
||||
bool res = false;
|
||||
for (int i = 0 ; i < docEmbedded.m_arrItems.size(); i++)
|
||||
for (std::vector<OOX::WritingElement*>::iterator it = docEmbedded.m_arrItems.begin(); it != docEmbedded.m_arrItems.end(); ++it)
|
||||
{
|
||||
if (docEmbedded.m_arrItems[i]->getType() == OOX::et_w_p)
|
||||
if ((*it)->getType() == OOX::et_w_p)
|
||||
{
|
||||
OOX::Logic::CParagraph *paragraph = dynamic_cast<OOX::Logic::CParagraph *>(docEmbedded.m_arrItems[i]);
|
||||
OOX::Logic::CParagraph *paragraph = dynamic_cast<OOX::Logic::CParagraph *>(*it);
|
||||
|
||||
for (int j = 0; (paragraph) && (j < paragraph->m_arrItems.size()); j++)
|
||||
for (std::vector<OOX::WritingElement*>::iterator jt = paragraph->m_arrItems.begin();
|
||||
(paragraph) && (jt != paragraph->m_arrItems.end()); jt++)
|
||||
{
|
||||
if (paragraph->m_arrItems[j]->getType() == OOX::et_m_oMath)
|
||||
if ((*jt)->getType() == OOX::et_m_oMath)
|
||||
{
|
||||
res = true;
|
||||
newXmlString = paragraph->m_arrItems[j]->toXML();
|
||||
newXmlString = (*jt)->toXML();
|
||||
break;
|
||||
}
|
||||
else if (paragraph->m_arrItems[j]->getType() == OOX::et_m_oMathPara)
|
||||
else if ((*jt)->getType() == OOX::et_m_oMathPara)
|
||||
{
|
||||
OOX::Logic::COMathPara *mathPara = dynamic_cast<OOX::Logic::COMathPara *>(paragraph->m_arrItems[j]);
|
||||
OOX::Logic::COMathPara *mathPara = dynamic_cast<OOX::Logic::COMathPara *>(*jt);
|
||||
|
||||
for (int k = 0; (mathPara) && (k < mathPara->m_arrItems.size()); k++)
|
||||
for (std::vector<OOX::WritingElement*>::iterator kt = mathPara->m_arrItems.begin();
|
||||
(mathPara) && (kt != mathPara->m_arrItems.end()); kt++)
|
||||
{
|
||||
if (mathPara->m_arrItems[k]->getType() == OOX::et_m_oMath)
|
||||
if ((*kt)->getType() == OOX::et_m_oMath)
|
||||
{
|
||||
res = true;
|
||||
newXmlString = mathPara->m_arrItems[k]->toXML();
|
||||
newXmlString = (*kt)->toXML();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -186,6 +194,7 @@ namespace DocFileFormat
|
||||
if (res) break;
|
||||
}
|
||||
}
|
||||
NSFile::CFileBinary::Remove(sTempXmlFile);
|
||||
return res;
|
||||
}
|
||||
//---------------------------------------------------------------
|
||||
@ -236,7 +245,7 @@ namespace DocFileFormat
|
||||
std::wstring strHeight = FormatUtils::DoubleToWideString( height.ToPoints() );
|
||||
std::wstring strStyle;
|
||||
|
||||
std::list<OptionEntry> options;
|
||||
std::vector<OptionEntryPtr> options;
|
||||
|
||||
PictureFrameType type;
|
||||
if ((pict->shapeContainer || pict->blipStoreEntry) && pict->shapeContainer->Children.size() > 0)
|
||||
@ -258,7 +267,6 @@ namespace DocFileFormat
|
||||
}
|
||||
m_pXmlWriter->WriteNodeBegin( L"v:shape", true );
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"type", std::wstring( L"#" + VMLShapeTypeMapping::GenerateTypeId(&type)));
|
||||
|
||||
count_vml_objects++;
|
||||
|
||||
@ -266,20 +274,14 @@ namespace DocFileFormat
|
||||
m_shapeId = L"_x0000_s" + FormatUtils::IntToWideString(1024 + count_vml_objects);
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"id", m_shapeId);
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"type", std::wstring( L"#" + VMLShapeTypeMapping::GenerateTypeId(&type)));
|
||||
|
||||
if (m_isOlePreview)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"o:ole", L"" );
|
||||
}
|
||||
else if (m_isBullete)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"o:bullet", L"1" );
|
||||
}
|
||||
//todooo oбъединить с shape_mapping
|
||||
|
||||
std::list<OptionEntry>::iterator end = options.end();
|
||||
for (std::list<OptionEntry>::iterator iter = options.begin(); iter != end; ++iter)
|
||||
for (size_t i = 0; i < options.size(); i++)
|
||||
{
|
||||
OptionEntryPtr & iter = options[i];
|
||||
switch ( iter->pid )
|
||||
{
|
||||
case wzEquationXML:
|
||||
@ -287,7 +289,7 @@ namespace DocFileFormat
|
||||
m_isEquation = true;
|
||||
m_isEmbedded = true;
|
||||
|
||||
m_embeddedData = std::string((char*)iter->opComplex, iter->op);
|
||||
m_embeddedData = std::string((char*)iter->opComplex.get(), iter->op);
|
||||
|
||||
if (ParseEmbeddedEquation( m_embeddedData, m_equationXml))
|
||||
{
|
||||
@ -297,8 +299,13 @@ namespace DocFileFormat
|
||||
case metroBlob:
|
||||
{
|
||||
//встроенная неведомая хуйня
|
||||
m_isEmbedded = true;
|
||||
m_embeddedData = std::string((char*)iter->opComplex, iter->op);
|
||||
m_isEmbedded = true;
|
||||
m_embeddedData = std::string((char*)iter->opComplex.get(), iter->op);
|
||||
|
||||
//if (ParseEmbeddedBlob( m_embeddedData, m_blobXml)) // todoooo
|
||||
//{
|
||||
// m_isEmbedded = false;
|
||||
//}
|
||||
}break;
|
||||
//BORDERS
|
||||
case borderBottomColor:
|
||||
@ -409,6 +416,15 @@ namespace DocFileFormat
|
||||
strStyle += L"width:" + strWidth + L"pt;" + L"height:" + strHeight + L"pt;";
|
||||
m_pXmlWriter->WriteAttribute( L"style", strStyle);
|
||||
|
||||
if (m_isOlePreview)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"o:ole", L"t" );
|
||||
}
|
||||
else if (m_isBullete)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"o:bullet", L"1" );
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
if (CopyPicture(pict))
|
||||
@ -486,6 +502,7 @@ namespace DocFileFormat
|
||||
{
|
||||
case Global::msoblipEMF:
|
||||
case Global::msoblipWMF:
|
||||
case Global::msoblipPICT:
|
||||
{
|
||||
MetafilePictBlip* metaBlip = static_cast<MetafilePictBlip*>(oBlipEntry->Blip);
|
||||
if (metaBlip)
|
||||
@ -553,6 +570,9 @@ namespace DocFileFormat
|
||||
case Global::msoblipWMF:
|
||||
return std::wstring(L".wmf");
|
||||
|
||||
case Global::msoblipPICT:
|
||||
return std::wstring(L".pcz");
|
||||
|
||||
default:
|
||||
return std::wstring(L".png");
|
||||
}
|
||||
@ -587,6 +607,9 @@ namespace DocFileFormat
|
||||
case Global::msoblipWMF:
|
||||
return std::wstring(OpenXmlContentTypes::Wmf);
|
||||
|
||||
case Global::msoblipPICT:
|
||||
return std::wstring(OpenXmlContentTypes::Pcz);
|
||||
|
||||
case Global::msoblipDIB:
|
||||
return std::wstring(OpenXmlContentTypes::Bmp);
|
||||
|
||||
|
||||
@ -46,7 +46,6 @@ namespace DocFileFormat
|
||||
{
|
||||
class OleObject;
|
||||
|
||||
bool ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString );
|
||||
|
||||
class VMLPictureMapping: public PropertiesMapping, public IMapping
|
||||
{
|
||||
@ -58,6 +57,7 @@ namespace DocFileFormat
|
||||
/// Writes a border element
|
||||
void writePictureBorder (const std::wstring & name, const BorderCode* brc);
|
||||
void appendStyleProperty( std::wstring* b, const std::wstring& propName, const std::wstring& propValue ) const;
|
||||
bool ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString );
|
||||
protected:
|
||||
/// Copies the picture from the binary stream to the zip archive
|
||||
/// and creates the relationships for the image.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -73,21 +73,14 @@ namespace DocFileFormat
|
||||
private:
|
||||
|
||||
void ApplyPrimitives (DrawingPrimitives * primitives );
|
||||
int ApplyPrimitive (DrawingPrimitives * primitives, int index);
|
||||
size_t ApplyPrimitive (DrawingPrimitives * primitives, size_t index);
|
||||
|
||||
void WritePrimitiveProps(DrawingPrimitive * primitive, bool root);
|
||||
|
||||
// Converts a group of shapes
|
||||
void WriteGroup(const GroupContainer* pContainer);
|
||||
// Converts a single shape
|
||||
void WriteShape (const ShapeContainer* pContainer);
|
||||
|
||||
/// Generates a string id for the given shape
|
||||
std::wstring GenShapeId(const Shape* pShape) const;
|
||||
/// Build the VML wrapcoords string for a given pWrapPolygonVertices
|
||||
std::wstring getWrapCoords( const OptionEntry& pWrapPolygonVertices ) const;
|
||||
/// Copies the picture from the binary stream to the zip archive
|
||||
/// and creates the relationships for the image.
|
||||
bool copyPicture( const BlipStoreEntry* bse );
|
||||
std::wstring GetTargetExt( Global::BlipType _type ) const;
|
||||
|
||||
@ -98,21 +91,22 @@ namespace DocFileFormat
|
||||
|
||||
std::wstring getTextboxAnchor( unsigned int anchor ) const;
|
||||
|
||||
void AppendOptionsToStyle( std::wstring* style, const std::list<OptionEntry>& options, int zIndex ) const;
|
||||
std::wstring buildStyle ( const Shape* shape, const ChildAnchor* anchor, const std::vector<OptionEntryPtr>& options, int zIndex ) const;
|
||||
void AppendOptionsToStyle ( std::wstring* style, const std::vector<OptionEntryPtr>& options, int zIndex ) const;
|
||||
|
||||
std::wstring buildStyle ( const Shape* shape, const ChildAnchor* anchor, const std::list<OptionEntry>& options, int zIndex ) const;
|
||||
int UpdateFromGuides(const int val) const;
|
||||
|
||||
std::wstring getLineStyle ( unsigned int p ) const;
|
||||
std::wstring getArrowStyle ( unsigned int op ) const;
|
||||
std::wstring getArrowLength ( unsigned int op ) const;
|
||||
std::wstring getArrowWidth ( unsigned int op ) const;
|
||||
std::wstring getFillMethod ( unsigned int p ) const;
|
||||
std::wstring getFillColorString( const unsigned char* p, unsigned int size ) const;
|
||||
/// Returns the OpenXML fill type of a fill effect
|
||||
|
||||
std::wstring getFillType ( unsigned int p ) const;
|
||||
std::wstring getShadowType ( unsigned int p ) const;
|
||||
/// Returns the OpenXML wrap type of the shape
|
||||
|
||||
std::wstring getWrapType (const Spa* pSpa) const;
|
||||
std::wstring ParsePath (const std::list<OptionEntry>& options) const;
|
||||
|
||||
void WriteBeginShapeNode (const Shape* pShape);
|
||||
void WriteEndShapeNode (const Shape* pShape);
|
||||
@ -121,9 +115,15 @@ namespace DocFileFormat
|
||||
std::wstring GetLineFrom (const ChildAnchor* pAnchor) const;
|
||||
std::wstring GetLineTo (const ChildAnchor* pAnchor) const;
|
||||
|
||||
std::vector<std::wstring> GetTextRectangles(const OptionEntry& inscribe) const;
|
||||
std::wstring GetWrapCoords ( const OptionEntryPtr& pOpt ) const;
|
||||
std::vector<std::wstring> GetTextRectangles ( const OptionEntryPtr& pOpt ) const;
|
||||
std::wstring GetConnectAngles ( const OptionEntryPtr& pOpt ) const;
|
||||
std::wstring GetConnectLocs ( const OptionEntryPtr& pOpt ) const;
|
||||
void GetGuides ( const OptionEntryPtr& pOpt );
|
||||
|
||||
private:
|
||||
int m_nAdjValues[8];
|
||||
std::vector<_guides> m_arrGuides;
|
||||
|
||||
bool m_isInlineShape;
|
||||
Spa* m_pSpa;
|
||||
IMapping* m_pCaller;
|
||||
|
||||
@ -134,10 +134,11 @@ namespace DocFileFormat
|
||||
|
||||
// Path
|
||||
m_pXmlWriter->WriteNodeBegin( L"v:path", true );
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"o:extrusionok", L"f");
|
||||
|
||||
if (_isInlineShape)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"o:extrusionok", L"f");
|
||||
m_pXmlWriter->WriteAttribute( L"gradientshapeok", L"t" );
|
||||
m_pXmlWriter->WriteAttribute( L"o:connecttype", L"rect" );
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ public:
|
||||
if (position + count > stream->size())
|
||||
{
|
||||
if (position > stream->size()) count = 0;
|
||||
else count = stream->size() - position;
|
||||
else count = (unsigned int)(stream->size() - position);
|
||||
}
|
||||
rdBytes = new unsigned char[count];
|
||||
}
|
||||
@ -152,7 +152,7 @@ public:
|
||||
|
||||
virtual unsigned long GetPosition() const
|
||||
{
|
||||
return this->position;
|
||||
return (unsigned long)this->position;
|
||||
}
|
||||
|
||||
virtual unsigned long GetSize() const
|
||||
@ -161,7 +161,7 @@ public:
|
||||
|
||||
if ( stream != NULL )
|
||||
{
|
||||
size = stream->size();
|
||||
size = (unsigned long)stream->size();
|
||||
}
|
||||
|
||||
return size;
|
||||
@ -197,20 +197,20 @@ public:
|
||||
int cchSize = 1;
|
||||
cch = ReadBytes( cchSize, true );
|
||||
|
||||
int xstzSize = FormatUtils::BytesToUChar( cch, 0, cchSize ) * 1;
|
||||
int xstzSize = DocFileFormat::FormatUtils::BytesToUChar( cch, 0, cchSize ) * 1;
|
||||
xstz = ReadBytes(xstzSize, true);
|
||||
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_WINDOWS_1250 );
|
||||
DocFileFormat::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_WINDOWS_1250 );
|
||||
}
|
||||
else
|
||||
{
|
||||
int cchSize = 2;
|
||||
cch = ReadBytes( cchSize, true );
|
||||
|
||||
int xstzSize = FormatUtils::BytesToInt16( cch, 0, cchSize ) * 2;
|
||||
int xstzSize = DocFileFormat::FormatUtils::BytesToInt16( cch, 0, cchSize ) * 2;
|
||||
xstz = ReadBytes(xstzSize, true);
|
||||
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_UTF16 );
|
||||
DocFileFormat::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &wstrResult, xstz, xstzSize, ENCODING_UTF16 );
|
||||
}
|
||||
|
||||
RELEASEARRAYOBJECTS(xstz);
|
||||
@ -234,7 +234,7 @@ public:
|
||||
//dont read the terminating zero
|
||||
unsigned char* stringBytes = ReadBytes( ( cch * 2 ), true );
|
||||
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( ( cch * 2 ) - 2 ), ENCODING_UTF16 );
|
||||
DocFileFormat::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( ( cch * 2 ) - 2 ), ENCODING_UTF16 );
|
||||
|
||||
RELEASEARRAYOBJECTS( stringBytes );
|
||||
}
|
||||
@ -246,7 +246,7 @@ public:
|
||||
/// The string must have the following structure:
|
||||
/// unsigned char 1-4: Character count (cch)
|
||||
/// unsigned char 5-cch+4: ANSI characters terminated by \0
|
||||
std::wstring ReadLengthPrefixedAnsiString(int max_size)
|
||||
std::wstring ReadLengthPrefixedAnsiString(unsigned int max_size)
|
||||
{
|
||||
std::wstring result;
|
||||
|
||||
@ -257,8 +257,8 @@ public:
|
||||
if (cch > max_size)
|
||||
{
|
||||
//error ... skip to 0
|
||||
int pos_orinal = GetPosition();
|
||||
int pos = 0;
|
||||
unsigned int pos_orinal = GetPosition();
|
||||
unsigned int pos = 0;
|
||||
|
||||
stringBytes = ReadBytes( max_size, true );
|
||||
|
||||
@ -278,7 +278,7 @@ public:
|
||||
//dont read the terminating zero
|
||||
stringBytes = ReadBytes( cch, true );
|
||||
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( cch - 1 ), ENCODING_WINDOWS_1250);
|
||||
DocFileFormat::FormatUtils::GetSTLCollectionFromBytes<std::wstring>( &result, stringBytes, ( cch - 1 ), ENCODING_WINDOWS_1250);
|
||||
|
||||
}
|
||||
RELEASEARRAYOBJECTS( stringBytes );
|
||||
|
||||
@ -40,8 +40,45 @@
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
#include "../../DesktopEditor/common/Directory.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
static const int aCodePages[][2] = {
|
||||
//charset codepage
|
||||
0, 1252, //ANSI
|
||||
1, 0,//Default
|
||||
2, 42,//Symbol
|
||||
77, 10000,//Mac Roman
|
||||
78, 10001,//Mac Shift Jis
|
||||
79, 10003,//Mac Hangul
|
||||
80, 10008,//Mac GB2312
|
||||
81, 10002,//Mac Big5
|
||||
83, 10005,//Mac Hebrew
|
||||
84, 10004,//Mac Arabic
|
||||
85, 10006,//Mac Greek
|
||||
86, 10081,//Mac Turkish
|
||||
87, 10021,//Mac Thai
|
||||
88, 10029,//Mac East Europe
|
||||
89, 10007,//Mac Russian
|
||||
128, 932,//Shift JIS
|
||||
129, 949,//Hangul
|
||||
130, 1361,//Johab
|
||||
134, 936,//GB2312
|
||||
136, 950,//Big5
|
||||
238, 1250,//Greek
|
||||
161, 1253,//Greek
|
||||
162, 1254,//Turkish
|
||||
163, 1258,//Vietnamese
|
||||
177, 1255,//Hebrew
|
||||
178, 1256, //Arabic
|
||||
186, 1257,//Baltic
|
||||
204, 1251,//Russian
|
||||
222, 874,//Thai
|
||||
238, 1250,//Eastern European
|
||||
254, 437,//PC 437
|
||||
255, 850//OEM
|
||||
};
|
||||
WordDocument::WordDocument (const ProgressCallback* pCallFunc, const std::wstring & sTempFolder ) :
|
||||
m_PieceTable(NULL), WordDocumentStream(NULL), TableStream(NULL), DataStream(NULL), FIB(NULL),
|
||||
Text(NULL), RevisionAuthorTable(NULL), FontTable(NULL), BookmarkNames(NULL), AutoTextNames(NULL),
|
||||
@ -52,14 +89,18 @@ namespace DocFileFormat
|
||||
TextboxIndividualPlex(NULL),AssocNames(NULL), BookmarkAnnotNames(NULL), Captions(NULL), AutoCaptions(NULL), ListPlex(NULL),
|
||||
OfficeDrawingPlex(NULL), OfficeDrawingPlexHeader(NULL), SectionPlex(NULL), BookmarkStartPlex(NULL), BookmarkEndPlex(NULL),
|
||||
AutoTextPlex(NULL), AllPapxFkps(NULL), AllChpxFkps(NULL), AllPapx(NULL), AllPapxVector(NULL), AllSepx(NULL), Styles(NULL), listTable(NULL),
|
||||
AnnotationOwners(NULL), DocProperties(NULL), listFormatOverrideTable(NULL), headerAndFooterTable(NULL), encryptionHeader(NULL)
|
||||
AnnotationOwners(NULL), DocProperties(NULL), listFormatOverrideTable(NULL), headerAndFooterTable(NULL),
|
||||
AnnotStartPlex(NULL), AnnotEndPlex(NULL), encryptionHeader(NULL)
|
||||
{
|
||||
m_pCallFunc = pCallFunc;
|
||||
m_sTempFolder = sTempFolder;
|
||||
m_pCallFunc = pCallFunc;
|
||||
m_sTempFolder = sTempFolder;
|
||||
|
||||
m_pStorage = NULL;
|
||||
officeArtContent = NULL;
|
||||
bOlderVersion = false;
|
||||
m_pStorage = NULL;
|
||||
officeArtContent = NULL;
|
||||
bOlderVersion = false;
|
||||
|
||||
bDocumentCodePage = false;
|
||||
nDocumentCodePage = ENCODING_WINDOWS_1250;
|
||||
}
|
||||
|
||||
WordDocument::~WordDocument()
|
||||
@ -94,7 +135,7 @@ namespace DocFileFormat
|
||||
return AVS_ERROR_FILEFORMAT;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
if (m_pStorage->GetStream ("WordDocument", &WordDocumentStream) == false)
|
||||
if (m_pStorage->GetStream (L"WordDocument", &WordDocumentStream) == false)
|
||||
{
|
||||
Clear();
|
||||
return AVS_ERROR_FILEFORMAT;
|
||||
@ -120,26 +161,39 @@ namespace DocFileFormat
|
||||
|
||||
if (FIB->m_FibBase.fWhichTblStm)
|
||||
{
|
||||
if (!m_pStorage->GetStream ("1Table", &TableStream))
|
||||
if (!m_pStorage->GetStream (L"1Table", &TableStream))
|
||||
{
|
||||
res = m_pStorage->GetStream ("0Table", &TableStream);
|
||||
res = m_pStorage->GetStream (L"0Table", &TableStream);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!m_pStorage->GetStream ("0Table", &TableStream))
|
||||
if (!m_pStorage->GetStream (L"0Table", &TableStream))
|
||||
{
|
||||
res = m_pStorage->GetStream ("1Table", &TableStream);
|
||||
res = m_pStorage->GetStream (L"1Table", &TableStream);
|
||||
}
|
||||
}
|
||||
|
||||
if (FIB->m_FibBase.fEncrypted && !FIB->m_bOlderVersion)
|
||||
if (FIB->m_FibBase.fEncrypted)
|
||||
{
|
||||
encryptionHeader = new EncryptionHeader (FIB, TableStream);
|
||||
encryptionHeader = new EncryptionHeader (FIB, TableStream);
|
||||
|
||||
if (encryptionHeader->bStandard)
|
||||
if (encryptionHeader->bXOR)
|
||||
{
|
||||
CRYPT::RC4Decryptor Decryptor(encryptionHeader->crypt_data_rc4, m_sPassword, 1);
|
||||
CRYPT::XORDecryptor Decryptor(1, encryptionHeader->crypt_data_xor.key, encryptionHeader->crypt_data_xor.hash, m_sPassword);
|
||||
|
||||
if (Decryptor.IsVerify() == false)
|
||||
{
|
||||
Clear();
|
||||
|
||||
if (m_sPassword.empty() ) return AVS_ERROR_DRM;
|
||||
else return AVS_ERROR_PASSWORD;
|
||||
}
|
||||
if (DecryptOfficeFile(&Decryptor) == false) return AVS_ERROR_DRM;
|
||||
}
|
||||
else if (encryptionHeader->bStandard)
|
||||
{
|
||||
CRYPT::RC4Decryptor Decryptor(encryptionHeader->crypt_data_rc4, m_sPassword);
|
||||
|
||||
if (Decryptor.IsVerify() == false)
|
||||
{
|
||||
@ -151,7 +205,7 @@ namespace DocFileFormat
|
||||
|
||||
if (DecryptOfficeFile(&Decryptor) == false) return AVS_ERROR_DRM;
|
||||
}
|
||||
else
|
||||
else if (encryptionHeader->bAES)
|
||||
{
|
||||
CRYPT::ECMADecryptor Decryptor;
|
||||
|
||||
@ -167,18 +221,15 @@ namespace DocFileFormat
|
||||
if (DecryptOfficeFile(&Decryptor) == false) return AVS_ERROR_DRM;
|
||||
}
|
||||
|
||||
FIB->reset(VirtualStreamReader(WordDocumentStream, 68, false));
|
||||
FIB->reset(VirtualStreamReader(WordDocumentStream, bOlderVersion ? 36 : 68, false));
|
||||
}
|
||||
else if (FIB->m_FibBase.fEncrypted) return AVS_ERROR_DRM;
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
POLE::Stream * Summary = NULL;
|
||||
POLE::Stream * DocSummary = NULL;
|
||||
|
||||
m_pStorage->GetStream ("SummaryInformation", &Summary);
|
||||
m_pStorage->GetStream ("DocumentSummaryInformation", &DocSummary);
|
||||
|
||||
document_code_page = ENCODING_WINDOWS_1250;
|
||||
m_pStorage->GetStream (L"SummaryInformation", &Summary);
|
||||
m_pStorage->GetStream (L"DocumentSummaryInformation", &DocSummary);
|
||||
|
||||
if ((Summary) && (Summary->size() > 0))
|
||||
{
|
||||
@ -187,7 +238,10 @@ namespace DocFileFormat
|
||||
int document_code_page1 = summary_info.GetCodePage(); //from software last open
|
||||
|
||||
if (document_code_page1 > 0)
|
||||
document_code_page = document_code_page1;
|
||||
{
|
||||
nDocumentCodePage = document_code_page1;
|
||||
bDocumentCodePage = true;
|
||||
}
|
||||
}
|
||||
if ((DocSummary) && (DocSummary->size() > 0))
|
||||
{
|
||||
@ -196,16 +250,22 @@ namespace DocFileFormat
|
||||
int document_code_page2 = doc_summary_info.GetCodePage();
|
||||
|
||||
if (document_code_page2 > 0)
|
||||
document_code_page = document_code_page2;
|
||||
{
|
||||
nDocumentCodePage = document_code_page2;
|
||||
bDocumentCodePage = true;
|
||||
}
|
||||
}
|
||||
if (!bOlderVersion)
|
||||
document_code_page = ENCODING_UTF16;
|
||||
{
|
||||
nDocumentCodePage = ENCODING_UTF16;
|
||||
bDocumentCodePage = true;
|
||||
}
|
||||
|
||||
FIB->m_CodePage = document_code_page;
|
||||
FIB->m_CodePage = nDocumentCodePage;
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
try
|
||||
{
|
||||
m_pStorage->GetStream ("Data", &DataStream);
|
||||
m_pStorage->GetStream (L"Data", &DataStream);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
@ -215,7 +275,7 @@ namespace DocFileFormat
|
||||
if (TableStream->size() < 1 && bOlderVersion)
|
||||
{
|
||||
RELEASEOBJECT(TableStream);
|
||||
m_pStorage->GetStream ("WordDocument", &TableStream);
|
||||
m_pStorage->GetStream (L"WordDocument", &TableStream);
|
||||
}
|
||||
|
||||
RevisionAuthorTable = new StringTable<WideString> (TableStream, FIB->m_FibWord97.fcSttbfRMark, FIB->m_FibWord97.lcbSttbfRMark, bOlderVersion);
|
||||
@ -275,12 +335,17 @@ namespace DocFileFormat
|
||||
TextboxIndividualPlex = new Plex<FTXBXS> (FTXBXS::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcftxbxTxt, FIB->m_FibWord97.lcbPlcftxbxTxt, bOlderVersion);
|
||||
|
||||
SectionPlex = new Plex<SectionDescriptor> (SectionDescriptor::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfSed, FIB->m_FibWord97.lcbPlcfSed, bOlderVersion);
|
||||
|
||||
BookmarkStartPlex = new Plex<BookmarkFirst> (BookmarkFirst::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBkf, FIB->m_FibWord97.lcbPlcfBkf, bOlderVersion);
|
||||
BookmarkEndPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfBkl, FIB->m_FibWord97.lcbPlcfBkl, bOlderVersion);
|
||||
|
||||
TextboxBreakPlex = new Plex<Tbkd> (Tbkd::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfTxbxBkd, FIB->m_FibWord97.lcbPlcfTxbxBkd, bOlderVersion);
|
||||
TextboxBreakPlexHeader = new Plex<Tbkd> (Tbkd::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfTxbxHdrBkd, FIB->m_FibWord97.lcbPlcfTxbxHdrBkd, bOlderVersion);
|
||||
|
||||
AnnotStartPlex = new Plex<BookmarkFirst> (BookmarkFirst::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfAtnBkf, FIB->m_FibWord97.lcbPlcfAtnBkf, bOlderVersion);
|
||||
AnnotEndPlex = new Plex<EmptyStructure> (EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfAtnBkl, FIB->m_FibWord97.lcbPlcfAtnBkl, bOlderVersion);
|
||||
|
||||
|
||||
for (size_t i = 0; i < BookmarkStartPlex->Elements.size(); ++i)
|
||||
{
|
||||
BookmarkFirst* pBookmark = static_cast<BookmarkFirst*>(BookmarkStartPlex->Elements[i]);
|
||||
@ -289,7 +354,14 @@ namespace DocFileFormat
|
||||
BookmarkStartEndCPs.push_back(std::make_pair(BookmarkStartPlex->CharacterPositions[i], BookmarkEndPlex->CharacterPositions[pBookmark->GetIndex()]));
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < AnnotStartPlex->Elements.size(); ++i)
|
||||
{
|
||||
BookmarkFirst* pBookmark = static_cast<BookmarkFirst*>(AnnotStartPlex->Elements[i]);
|
||||
if (pBookmark)
|
||||
{
|
||||
AnnotStartEndCPs.push_back(std::make_pair(AnnotStartPlex->CharacterPositions[i], AnnotEndPlex->CharacterPositions[pBookmark->GetIndex()]));
|
||||
}
|
||||
}
|
||||
AutoTextPlex = new Plex<EmptyStructure>(EmptyStructure::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfGlsy, FIB->m_FibWord97.lcbPlcfGlsy, bOlderVersion);
|
||||
FieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldMom, FIB->m_FibWord97.lcbPlcfFldMom, bOlderVersion);
|
||||
FootnoteDocumentFieldsPlex = new Plex<FieldCharacter>(FieldCharacter::STRUCTURE_SIZE, TableStream, FIB->m_FibWord97.fcPlcfFldFtn, FIB->m_FibWord97.lcbPlcfFldFtn, bOlderVersion);
|
||||
@ -340,6 +412,31 @@ namespace DocFileFormat
|
||||
return AVS_ERROR_FILEFORMAT;
|
||||
}
|
||||
}
|
||||
if (!bDocumentCodePage && FontTable)
|
||||
{
|
||||
std::unordered_map<int, int> fonts_charsets;
|
||||
|
||||
for ( std::vector<ByteStructure*>::iterator iter = FontTable->Data.begin();!bDocumentCodePage && iter != FontTable->Data.end(); iter++ )
|
||||
{
|
||||
FontFamilyName* font = dynamic_cast<FontFamilyName*>( *iter );
|
||||
if (!font) continue;
|
||||
|
||||
if (fonts_charsets.find(font->chs) == fonts_charsets.end())
|
||||
{
|
||||
fonts_charsets.insert(std::make_pair(font->chs, font->ff));
|
||||
|
||||
for (int i = 0 ; i < sizeof(aCodePages) / 2; i++)
|
||||
{
|
||||
if (aCodePages[i][0] == font->chs && font->chs != 0)
|
||||
{
|
||||
nDocumentCodePage = aCodePages[i][1];
|
||||
bDocumentCodePage = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (FIB->m_FibWord97.lcbClx > 0)
|
||||
{
|
||||
@ -358,7 +455,7 @@ namespace DocFileFormat
|
||||
WordDocumentStream->read (bytes, cb);
|
||||
|
||||
Text = new std::vector<wchar_t>();
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::vector<wchar_t> >(Text, bytes, cb, document_code_page);
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::vector<wchar_t> >(Text, bytes, cb, nDocumentCodePage);
|
||||
|
||||
RELEASEARRAYOBJECTS(bytes);
|
||||
}
|
||||
@ -470,23 +567,28 @@ namespace DocFileFormat
|
||||
delete storageOut;
|
||||
return false;
|
||||
}
|
||||
std::list<std::string> listStream = storageIn->entries();
|
||||
DecryptStream( 0, L"/", storageIn, storageOut, Decryptor);
|
||||
|
||||
for (std::list<std::string>::iterator it = listStream.begin(); it != listStream.end(); it++)
|
||||
{
|
||||
if (storageIn->isDirectory(*it))
|
||||
{
|
||||
std::list<std::string> list_entry = storageIn->GetAllStreams(*it);
|
||||
|
||||
for (std::list<std::string>::iterator it2 = list_entry.begin(); it2 != list_entry.end(); it2++)
|
||||
{
|
||||
DecryptStream(Decryptor, *it2, storageIn, storageOut);
|
||||
}
|
||||
}
|
||||
else
|
||||
DecryptStream(Decryptor, *it, storageIn, storageOut);
|
||||
//std::list<std::string> listStream = storageIn->entries();
|
||||
|
||||
//for (std::list<std::string>::iterator it = listStream.begin(); it != listStream.end(); ++it)
|
||||
//{
|
||||
// if (storageIn->isDirectory(*it))
|
||||
// {
|
||||
// std::list<std::string> list_entry = storageIn->GetAllStreams(*it);
|
||||
//
|
||||
// for (std::list<std::string>::iterator it2 = list_entry.begin(); it2 != list_entry.end(); it2++)
|
||||
// {
|
||||
// DecryptStream(Decryptor, *it2, storageIn, storageOut);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// DecryptStream(Decryptor, *it, storageIn, storageOut);
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
}
|
||||
storageOut->close();
|
||||
delete storageOut;
|
||||
|
||||
@ -496,52 +598,115 @@ namespace DocFileFormat
|
||||
|
||||
m_pStorage->SetFile(m_sTempDecryptFileName.c_str());
|
||||
|
||||
if (m_pStorage->GetStream ("WordDocument", &WordDocumentStream) == false) return false;
|
||||
if (m_pStorage->GetStream (L"WordDocument", &WordDocumentStream) == false) return false;
|
||||
|
||||
if (FIB->m_FibBase.fWhichTblStm)
|
||||
{
|
||||
if (!m_pStorage->GetStream ("1Table", &TableStream)) m_pStorage->GetStream ("0Table", &TableStream);
|
||||
if (!m_pStorage->GetStream (L"1Table", &TableStream)) m_pStorage->GetStream (L"0Table", &TableStream);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!m_pStorage->GetStream ("0Table", &TableStream)) m_pStorage->GetStream ("1Table", &TableStream);
|
||||
if (!m_pStorage->GetStream (L"0Table", &TableStream)) m_pStorage->GetStream (L"1Table", &TableStream);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool WordDocument::DecryptStream(CRYPT::Decryptor* Decryptor, std::string streamName, POLE::Storage * storageIn, POLE::Storage * storageOut)
|
||||
void WordDocument::DecryptStream( int level, std::wstring path, POLE::Storage * storageIn, POLE::Storage * storageOut, CRYPT::Decryptor* Decryptor)
|
||||
{
|
||||
POLE::Stream *stream = new POLE::Stream(storageIn, streamName);
|
||||
std::list<std::wstring> entries, entries_files, entries_dir;
|
||||
entries = storageIn->entries_with_prefix( path );
|
||||
|
||||
for( std::list<std::wstring>::iterator it = entries.begin(); it != entries.end(); ++it )
|
||||
{
|
||||
std::wstring name = *it;
|
||||
std::wstring fullname = path + name;
|
||||
|
||||
if( storageIn->isDirectory( fullname ) )
|
||||
{
|
||||
entries_dir.push_back(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
entries_files.push_front(name);
|
||||
}
|
||||
}
|
||||
for( std::list<std::wstring>::iterator it = entries_dir.begin(); it != entries_dir.end(); ++it )
|
||||
{
|
||||
std::wstring fullname = path + *it;
|
||||
|
||||
DecryptStream( level + 1, fullname + L"/", storageIn, storageOut, Decryptor );
|
||||
|
||||
}
|
||||
//if (bSortFiles)
|
||||
entries_files.sort();
|
||||
|
||||
for( std::list<std::wstring>::iterator it = entries_files.begin(); it != entries_files.end(); ++it )
|
||||
{
|
||||
std::wstring fullname_create = path + *it;
|
||||
|
||||
if (it->at(0) < 32)
|
||||
{
|
||||
*it = it->substr(1); // without prefix
|
||||
}
|
||||
std::wstring fullname_open = path + *it;
|
||||
|
||||
bool bDecrypt = false;
|
||||
|
||||
if ( std::wstring::npos != fullname_open.find(L"WordDocument") ||
|
||||
std::wstring::npos != fullname_open.find(L"Data") ||
|
||||
std::wstring::npos != fullname_open.find(L"Table") ||
|
||||
(std::wstring::npos != fullname_open.find(L"SummaryInformation") &&
|
||||
encryptionHeader->bAES && encryptionHeader->crypt_data_aes.fDocProps)
|
||||
)
|
||||
{
|
||||
bDecrypt = true;
|
||||
}
|
||||
DecryptStream(fullname_open, storageIn, fullname_create, storageOut, Decryptor, bDecrypt);
|
||||
}
|
||||
}
|
||||
bool WordDocument::DecryptStream(std::wstring streamName_open, POLE::Storage * storageIn, std::wstring streamName_create, POLE::Storage * storageOut, CRYPT::Decryptor* Decryptor, bool bDecrypt)
|
||||
{
|
||||
POLE::Stream *stream = new POLE::Stream(storageIn, streamName_open);
|
||||
if (!stream) return false;
|
||||
|
||||
stream->seek(0);
|
||||
int sz_stream = stream->size();
|
||||
POLE::uint64 size_stream = stream->size();
|
||||
|
||||
POLE::Stream *streamNew = new POLE::Stream(storageOut, streamName, true, sz_stream);
|
||||
POLE::Stream *streamNew = new POLE::Stream(storageOut, streamName_create, true, size_stream);
|
||||
if (!streamNew) return false;
|
||||
|
||||
unsigned char* data_stream = new unsigned char[sz_stream];
|
||||
stream->read(data_stream, sz_stream);
|
||||
unsigned char* data_stream = new unsigned char[size_stream];
|
||||
stream->read(data_stream, size_stream);
|
||||
|
||||
unsigned char* data_store = NULL;
|
||||
int sz_data_store = 0;
|
||||
int size_data_store = 0;
|
||||
|
||||
if ("WordDocument" == streamName)
|
||||
if ( std::wstring::npos != streamName_open.find(L"WordDocument") )
|
||||
{
|
||||
sz_data_store = 68;
|
||||
data_store = new unsigned char[sz_data_store];
|
||||
size_data_store = bOlderVersion ? 36 : 68;
|
||||
data_store = new unsigned char[size_data_store];
|
||||
}
|
||||
|
||||
if (data_store)
|
||||
memcpy(data_store, data_stream, sz_data_store);
|
||||
memcpy(data_store, data_stream, size_data_store);
|
||||
|
||||
Decryptor->Decrypt((char*)data_stream, sz_stream, 0);
|
||||
size_t size_block = 0x200;
|
||||
unsigned long block = 0;
|
||||
|
||||
for (POLE::uint64 pos = /*bOlderVersion ? size_data_store :*/ 0; pos < size_stream; pos += size_block, block++)
|
||||
{
|
||||
if (pos + size_block > size_stream)
|
||||
size_block = size_stream - pos;
|
||||
|
||||
if (bDecrypt)
|
||||
{
|
||||
Decryptor->Decrypt((char*)data_stream + pos, size_block, block);
|
||||
}
|
||||
}
|
||||
|
||||
if (data_store)
|
||||
memcpy(data_stream, data_store, sz_data_store);
|
||||
memcpy(data_stream, data_store, size_data_store);
|
||||
|
||||
streamNew->write(data_stream, sz_stream);
|
||||
streamNew->write(data_stream, size_stream);
|
||||
|
||||
RELEASEARRAYOBJECTS(data_store);
|
||||
RELEASEARRAYOBJECTS(data_stream);
|
||||
@ -622,6 +787,8 @@ namespace DocFileFormat
|
||||
RELEASEOBJECT(SectionPlex);
|
||||
RELEASEOBJECT(BookmarkStartPlex);
|
||||
RELEASEOBJECT(BookmarkEndPlex);
|
||||
RELEASEOBJECT(AnnotStartPlex);
|
||||
RELEASEOBJECT(AnnotEndPlex);
|
||||
RELEASEOBJECT(AutoTextPlex);
|
||||
RELEASEOBJECT(ListPlex);
|
||||
RELEASEOBJECT(Styles);
|
||||
|
||||
@ -69,7 +69,6 @@ namespace DocFileFormat
|
||||
{
|
||||
class WordDocument: public IVisitable
|
||||
{
|
||||
/*Mapping classes with direct access to the Word Document.*/
|
||||
friend class FootnotesMapping;
|
||||
friend class EndnotesMapping;
|
||||
friend class CommentsMapping;
|
||||
@ -86,6 +85,7 @@ namespace DocFileFormat
|
||||
friend class Table;
|
||||
friend class TableRow;
|
||||
friend class VMLShapeMapping;
|
||||
friend class VMLPictureMapping;
|
||||
friend class OpenXmlPackage;
|
||||
friend class TextboxMapping;
|
||||
|
||||
@ -97,17 +97,19 @@ namespace DocFileFormat
|
||||
long LoadDocument (const std::wstring & fileName, const std::wstring & password);
|
||||
|
||||
bool bOlderVersion;
|
||||
int document_code_page;
|
||||
|
||||
private:
|
||||
bool DecryptOfficeFile (CRYPT::Decryptor* Decryptor);
|
||||
bool DecryptStream (CRYPT::Decryptor* Decryptor, std::string streamName, POLE::Storage * storageIn, POLE::Storage * storageOut);
|
||||
|
||||
int nDocumentCodePage;
|
||||
bool bDocumentCodePage;
|
||||
|
||||
inline StructuredStorageReader* GetStorage() const
|
||||
{
|
||||
return m_pStorage;
|
||||
}
|
||||
|
||||
private:
|
||||
bool DecryptOfficeFile (CRYPT::Decryptor* Decryptor);
|
||||
|
||||
bool DecryptStream (std::wstring streamName_open, POLE::Storage * storageIn, std::wstring streamName_create, POLE::Storage * storageOut, CRYPT::Decryptor* Decryptor, bool bDecrypt);
|
||||
void DecryptStream (int level, std::wstring streamName, POLE::Storage * storageIn, POLE::Storage * storageOut, CRYPT::Decryptor* Decryptor);
|
||||
|
||||
inline OfficeArtContent* GetOfficeArt ()
|
||||
{
|
||||
return officeArtContent;
|
||||
@ -160,7 +162,9 @@ namespace DocFileFormat
|
||||
std::vector<int> * AllPapxVector;// A vector to quick find in AllPapx
|
||||
|
||||
std::map<int, int> PictureBulletsCPsMap;
|
||||
|
||||
std::vector<std::pair<int, int>> BookmarkStartEndCPs;
|
||||
std::vector<std::pair<int, int>> AnnotStartEndCPs;
|
||||
|
||||
FileInformationBlock * FIB;
|
||||
StyleSheet * Styles; // The style sheet of the document
|
||||
@ -202,7 +206,10 @@ namespace DocFileFormat
|
||||
Plex<SectionDescriptor> *SectionPlex; // A Plex containing all section descriptors
|
||||
|
||||
Plex<BookmarkFirst> *BookmarkStartPlex;
|
||||
Plex<EmptyStructure> *BookmarkEndPlex;
|
||||
Plex<EmptyStructure> *BookmarkEndPlex;
|
||||
|
||||
Plex<BookmarkFirst> *AnnotStartPlex;
|
||||
Plex<EmptyStructure> *AnnotEndPlex;
|
||||
|
||||
Plex<ListNumCache> *ListPlex;
|
||||
Plex<FieldCharacter> *FieldsPlex;
|
||||
|
||||
@ -35,31 +35,35 @@
|
||||
#include "../../DesktopEditor/raster/BgraFrame.h"
|
||||
#include "../../DesktopEditor/common/Directory.h"
|
||||
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/App.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Core.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/ContentTypes.h"
|
||||
|
||||
namespace ImageHelper
|
||||
{
|
||||
struct __BITMAPINFOHEADER
|
||||
{
|
||||
DWORD biSize;
|
||||
LONG biWidth;
|
||||
LONG biHeight;
|
||||
WORD biPlanes;
|
||||
WORD biBitCount;
|
||||
DWORD biCompression;
|
||||
DWORD biSizeImage;
|
||||
LONG biXPelsPerMeter;
|
||||
LONG biYPelsPerMeter;
|
||||
DWORD biClrUsed;
|
||||
DWORD biClrImportant;
|
||||
};
|
||||
struct __BITMAPINFOHEADER
|
||||
{
|
||||
_UINT32 biSize;
|
||||
_INT32 biWidth;
|
||||
_INT32 biHeight;
|
||||
_UINT16 biPlanes;
|
||||
_UINT16 biBitCount;
|
||||
_UINT32 biCompression;
|
||||
_UINT32 biSizeImage;
|
||||
_INT32 biXPelsPerMeter;
|
||||
_INT32 biYPelsPerMeter;
|
||||
_UINT32 biClrUsed;
|
||||
_UINT32 biClrImportant;
|
||||
};
|
||||
|
||||
struct __BITMAPCOREHEADER
|
||||
{
|
||||
DWORD bcSize; /* used to get to color table */
|
||||
WORD bcWidth;
|
||||
WORD bcHeight;
|
||||
WORD bcPlanes;
|
||||
WORD bcBitCount;
|
||||
};
|
||||
struct __BITMAPCOREHEADER
|
||||
{
|
||||
_UINT32 bcSize; /* used to get to color table */
|
||||
_UINT16 bcWidth;
|
||||
_UINT16 bcHeight;
|
||||
_UINT16 bcPlanes;
|
||||
_UINT16 bcBitCount;
|
||||
};
|
||||
|
||||
inline Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, const std::wstring& file_name)//without ext
|
||||
{
|
||||
@ -71,7 +75,7 @@ namespace ImageHelper
|
||||
__BITMAPINFOHEADER * header = (__BITMAPINFOHEADER*)data;
|
||||
if (!header) return result;
|
||||
|
||||
result == Global::msoblipDIB;
|
||||
result = Global::msoblipDIB;
|
||||
|
||||
if (header->biWidth > 100000 || header->biHeight > 100000 || header->biSize != 40)
|
||||
{
|
||||
@ -152,10 +156,10 @@ namespace ImageHelper
|
||||
NSFile::CFileBinary file;
|
||||
if (file.CreateFileW(file_name + L".bmp"))
|
||||
{
|
||||
WORD vtType = 0x4D42; file.WriteFile((BYTE*)&vtType, 2);
|
||||
DWORD dwLen = biSizeImage; file.WriteFile((BYTE*)&dwLen, 4);
|
||||
DWORD dwRes = 0; file.WriteFile((BYTE*)&dwRes, 4);
|
||||
DWORD dwOffset = 2; file.WriteFile((BYTE*)&dwOffset, 4);
|
||||
_UINT16 vtType = 0x4D42; file.WriteFile((BYTE*)&vtType, 2);
|
||||
_UINT32 dwLen = biSizeImage; file.WriteFile((BYTE*)&dwLen, 4);
|
||||
_UINT32 dwRes = 0; file.WriteFile((BYTE*)&dwRes, 4);
|
||||
_UINT32 dwOffset = 2; file.WriteFile((BYTE*)&dwOffset, 4);
|
||||
|
||||
file.WriteFile((BYTE*)data, size);
|
||||
file.CloseFile();
|
||||
@ -180,12 +184,68 @@ namespace DocFileFormat
|
||||
{
|
||||
}
|
||||
|
||||
void WordprocessingDocument::SaveDocument()
|
||||
void WordprocessingDocument::SaveDocument(bool &bMacros)
|
||||
{
|
||||
std::wstring pathWord = m_strOutputPath + FILE_SEPARATOR_STR + L"word" ;
|
||||
//OOX::CPath pathWord = CString(m_strOutputPath) + FILE_SEPARATOR_STR + L"word" );
|
||||
//FileSystem::Directory::CreateDirectory( pathWord.GetPath() );
|
||||
NSDirectory::CreateDirectory( pathWord );
|
||||
std::wstring pathWord = m_strOutputPath + FILE_SEPARATOR_STR + L"word" ;
|
||||
NSDirectory::CreateDirectory( pathWord );
|
||||
|
||||
if (bMacros && docFile->GetStorage()->isDirectory(L"Macros"))
|
||||
{
|
||||
std::wstring sVbaProjectFile = pathWord + FILE_SEPARATOR_STR + L"vbaProject.bin";
|
||||
|
||||
POLE::Storage *storageVbaProject = new POLE::Storage(sVbaProjectFile.c_str());
|
||||
|
||||
if ((storageVbaProject) && (storageVbaProject->open(true, true)))
|
||||
{
|
||||
docFile->GetStorage()->copy(0, L"Macros/", storageVbaProject, false);
|
||||
|
||||
storageVbaProject->close();
|
||||
delete storageVbaProject;
|
||||
|
||||
RegisterDocumentMacros();
|
||||
RegisterVbaProject();
|
||||
//output_document->get_xl_files().add_vba_project();
|
||||
}
|
||||
else bMacros = false;
|
||||
}
|
||||
else
|
||||
bMacros = false;
|
||||
|
||||
if (!bMacros)
|
||||
{
|
||||
RegisterDocument();
|
||||
}
|
||||
OOX::CContentTypes oContentTypes;
|
||||
OOX::CPath pathDocProps = m_strOutputPath + FILE_SEPARATOR_STR + _T("docProps");
|
||||
NSDirectory::CreateDirectory(pathDocProps.GetPath());
|
||||
|
||||
OOX::CPath DocProps = std::wstring(_T("docProps"));
|
||||
|
||||
OOX::CApp* pApp = new OOX::CApp(NULL);
|
||||
if (pApp)
|
||||
{
|
||||
pApp->SetApplication(L"ONLYOFFICE");
|
||||
#if defined(INTVER)
|
||||
pApp->SetAppVersion(VALUE2STR(INTVER));
|
||||
#endif
|
||||
pApp->SetDocSecurity(0);
|
||||
pApp->SetScaleCrop(false);
|
||||
pApp->SetLinksUpToDate(false);
|
||||
pApp->SetSharedDoc(false);
|
||||
pApp->SetHyperlinksChanged(false);
|
||||
|
||||
pApp->write(pathDocProps + FILE_SEPARATOR_STR + _T("app.xml"), DocProps, oContentTypes);
|
||||
delete pApp;
|
||||
}
|
||||
OOX::CCore* pCore = new OOX::CCore(NULL);
|
||||
if (pCore)
|
||||
{
|
||||
pCore->SetCreator(_T(""));
|
||||
pCore->SetLastModifiedBy(_T(""));
|
||||
pCore->write(pathDocProps + FILE_SEPARATOR_STR + _T("core.xml"), DocProps, oContentTypes);
|
||||
delete pCore;
|
||||
}
|
||||
RegisterDocPr();
|
||||
|
||||
WritePackage();
|
||||
|
||||
@ -204,9 +264,7 @@ namespace DocFileFormat
|
||||
if (!ImagesList.empty())
|
||||
{
|
||||
std::wstring pathMedia = pathWord + FILE_SEPARATOR_STR + L"media";
|
||||
//OOX::CPath pathMedia = pathWord + FILE_SEPARATOR_STR + L"media";
|
||||
//FileSystem::Directory::CreateDirectory( pathMedia.GetPath() );
|
||||
|
||||
|
||||
NSDirectory::CreateDirectory(pathMedia);
|
||||
|
||||
int i = 1;
|
||||
@ -237,8 +295,6 @@ namespace DocFileFormat
|
||||
if (!OleObjectsList.empty())
|
||||
{
|
||||
std::wstring pathObjects = pathWord + FILE_SEPARATOR_STR + L"embeddings" ;
|
||||
//OOX::CPath pathObjects = pathWord + FILE_SEPARATOR_STR + L"embeddings" ;
|
||||
//FileSystem::Directory::CreateDirectory( pathObjects.GetPath());
|
||||
NSDirectory::CreateDirectory( pathObjects );
|
||||
|
||||
int i = 1;
|
||||
|
||||
@ -76,6 +76,7 @@ namespace DocFileFormat
|
||||
public:
|
||||
WordprocessingDocument(const std::wstring & _docxDirectory, const WordDocument* _docFile);
|
||||
virtual ~WordprocessingDocument();
|
||||
void SaveDocument();
|
||||
|
||||
void SaveDocument(bool &bMacros);
|
||||
};
|
||||
}
|
||||
@ -34,14 +34,14 @@
|
||||
#include "../DocDocxConverter/Converter.h"
|
||||
#include "../../OfficeUtils/src/OfficeUtils.h"
|
||||
|
||||
HRESULT COfficeDocFile::LoadFromFile(const std::wstring & docFile, const std::wstring & docxDirectory, const std::wstring & password, ProgressCallback *ffCallBack )
|
||||
HRESULT COfficeDocFile::LoadFromFile(const std::wstring & docFile, const std::wstring & docxDirectory, const std::wstring & password, bool &bMacros, ProgressCallback *ffCallBack)
|
||||
{
|
||||
HRESULT hr = S_FALSE;
|
||||
|
||||
DocFileFormat::Converter docToDocx;
|
||||
docToDocx.m_sTempFolder = m_sTempFolder;
|
||||
|
||||
hr= docToDocx.LoadAndConvert(docFile, docxDirectory, password, ffCallBack);
|
||||
hr= docToDocx.LoadAndConvert(docFile, docxDirectory, password, ffCallBack, bMacros);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ public:
|
||||
|
||||
std::wstring m_sTempFolder;
|
||||
|
||||
HRESULT LoadFromFile(const std::wstring & sSrcFileName, const std::wstring & sDstFileName, const std::wstring & password, ProgressCallback *ffCallBack = NULL);
|
||||
HRESULT LoadFromFile(const std::wstring & sSrcFileName, const std::wstring & sDstFileName, const std::wstring & password, bool &bMacros, ProgressCallback *ffCallBack = NULL);
|
||||
HRESULT SaveToFile(const std::wstring & sDstFileName, const std::wstring & sSrcFileName, ProgressCallback *ffCallBack = NULL);
|
||||
|
||||
};
|
||||
|
||||
@ -21,11 +21,9 @@ include($$PWD/../../../Common/3dParty/boost/boost.pri)
|
||||
|
||||
DEFINES += UNICODE \
|
||||
_UNICODE \
|
||||
_USE_XMLLITE_READER_ \
|
||||
USE_LITE_READER \
|
||||
USE_ATL_CSTRING \
|
||||
_USE_LIBXML2_READER_ \
|
||||
LIBXML_READER_ENABLED
|
||||
LIBXML_READER_ENABLED \
|
||||
DONT_WRITE_EMBEDDED_FONTS \
|
||||
|
||||
INCLUDEPATH += \
|
||||
../../../DesktopEditor/freetype-2.5.2/include \
|
||||
@ -94,6 +92,7 @@ SOURCES += \
|
||||
../../DocDocxConverter/VMLShapeTypeMapping.cpp \
|
||||
../../DocDocxConverter/WordDocument.cpp \
|
||||
../../DocDocxConverter/WordprocessingDocument.cpp \
|
||||
../../DocDocxConverter/FormFieldData.cpp \
|
||||
../../DocDocxConverter/OfficeDrawing/Record.cpp \
|
||||
../../DocDocxConverter/OfficeDrawing/RecordFactory.cpp \
|
||||
../../DocDocxConverter/OfficeDrawing/ShapeTypeFactory.cpp
|
||||
@ -236,6 +235,7 @@ HEADERS += \
|
||||
../../DocDocxConverter/OfficeDrawing/RecordFactory.h \
|
||||
../../DocDocxConverter/OfficeDrawing/RegularContainer.h \
|
||||
../../DocDocxConverter/OfficeDrawing/ShadowStyleBooleanProperties.h \
|
||||
../../DocDocxConverter/OfficeDrawing/threeDBooleanProperties.h \
|
||||
../../DocDocxConverter/OfficeDrawing/Shape.h \
|
||||
../../DocDocxConverter/OfficeDrawing/ShapeContainer.h \
|
||||
../../DocDocxConverter/OfficeDrawing/ShapeOptions.h \
|
||||
|
||||
@ -74,6 +74,7 @@
|
||||
#include "../../DocDocxConverter/VMLShapeTypeMapping.cpp"
|
||||
#include "../../DocDocxConverter/WordDocument.cpp"
|
||||
#include "../../DocDocxConverter/WordprocessingDocument.cpp"
|
||||
#include "../../DocDocxConverter/FormFieldData.cpp"
|
||||
#include "../../DocDocxConverter/OfficeDrawing/Record.cpp"
|
||||
#include "../../DocDocxConverter/OfficeDrawing/RecordFactory.cpp"
|
||||
#include "../../DocDocxConverter/OfficeDrawing/ShapeTypeFactory.cpp"
|
||||
|
||||
@ -44,14 +44,15 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;USE_ATL_CSTRINGS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
DisableSpecificWarnings="4005;4311;4312"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
@ -107,7 +108,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="C:\_WORK\trunk\ServerComponents\Common\DocxFormat\Source\XML\libxml2\XML\include"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions="_DEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@ -479,6 +480,14 @@
|
||||
RelativePath="..\..\DocDocxConverter\FormattedDiskPagePAPX.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DocDocxConverter\FormFieldData.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DocDocxConverter\FormFieldData.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DocDocxConverter\Global.h"
|
||||
>
|
||||
@ -886,6 +895,10 @@
|
||||
RelativePath="..\..\DocDocxConverter\OfficeDrawing\SplitMenuColorContainer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DocDocxConverter\OfficeDrawing\threeDBooleanProperties.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DocDocxConverter\OfficeDrawing\UnknownRecord.h"
|
||||
>
|
||||
@ -1090,6 +1103,10 @@
|
||||
RelativePath="..\..\DocDocxConverter\FootnotesMapping.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DocDocxConverter\FormFieldDataMapping.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DocDocxConverter\HeaderMapping.cpp"
|
||||
>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -29,18 +29,17 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
// DocFormatTest.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
#include "../DocFormatLib/DocFormatLib.h"
|
||||
|
||||
#include "../win32/ASCOfficeCriticalSection.h"
|
||||
#include <iostream>
|
||||
|
||||
#include "../../Common/DocxFormat/Source/Base/Base.h"
|
||||
#include "../../DesktopEditor/common/Directory.h"
|
||||
#include "../../OfficeUtils/src/OfficeUtils.h"
|
||||
|
||||
#include "../../DesktopEditor/common/Directory.h"
|
||||
#include "../DocFormatLib/DocFormatLib.h"
|
||||
|
||||
#include <string>
|
||||
#include <windows.h>
|
||||
#pragma comment(lib,"Shell32.lib")
|
||||
#pragma comment(lib,"Advapi32.lib")
|
||||
#pragma comment(lib,"Rpcrt4.lib")
|
||||
|
||||
#if defined(_WIN64)
|
||||
#pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib")
|
||||
@ -48,31 +47,68 @@
|
||||
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
|
||||
#endif
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
HRESULT convert_single(std::wstring srcFileName)
|
||||
{
|
||||
if (argc < 2) return 1;
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
std::wstring sSrcDoc = argv[1];
|
||||
std::wstring sDstDocx = argc > 2 ? argv[2] : sSrcDoc + L"-my.docx";
|
||||
|
||||
std::wstring outputDir = NSDirectory::GetFolderPath(sDstDocx);
|
||||
std::wstring outputDir = NSDirectory::GetFolderPath(srcFileName);
|
||||
std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
|
||||
std::wstring dstPath;
|
||||
|
||||
// doc->docx
|
||||
COfficeDocFile docFile;
|
||||
|
||||
docFile.m_sTempFolder = outputDir;
|
||||
|
||||
HRESULT hRes = docFile.LoadFromFile( sSrcDoc, dstTempPath, L"password", NULL);
|
||||
bool bMacros = true;
|
||||
HRESULT hRes = docFile.LoadFromFile( srcFileName, dstTempPath, L"password", bMacros, NULL);
|
||||
|
||||
if (bMacros)
|
||||
{
|
||||
dstPath = srcFileName + L"-my.docm";
|
||||
}
|
||||
else
|
||||
{
|
||||
dstPath = srcFileName + L"-my.docx";
|
||||
|
||||
}
|
||||
if (hRes == S_OK)
|
||||
{
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
hRes = oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), sDstDocx, -1);
|
||||
hRes = oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), dstPath, -1);
|
||||
}
|
||||
|
||||
FileSystem::Directory::DeleteDirectory(dstTempPath);
|
||||
NSDirectory::DeleteDirectory(dstTempPath);
|
||||
|
||||
return hRes;
|
||||
}
|
||||
|
||||
|
||||
HRESULT convert_directory(std::wstring pathName)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
std::vector<std::wstring> arFiles = NSDirectory::GetFiles(pathName, false);
|
||||
|
||||
for (size_t i = 0; i < arFiles.size(); i++)
|
||||
{
|
||||
convert_single(arFiles[i]);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
if (argc < 2) return 1;
|
||||
|
||||
HRESULT hr = -1;
|
||||
if (NSFile::CFileBinary::Exists(argv[1]))
|
||||
{
|
||||
hr = convert_single(argv[1]);
|
||||
}
|
||||
else if (NSDirectory::Exists(argv[1]))
|
||||
{
|
||||
hr = convert_directory(argv[1]);
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
@ -44,11 +44,11 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\..\..\Common\OfficeDrawing;"..\..\..\..\..\DesktopEditor\freetype-2.5.2\include";..\..\..\..\..\Common\OfficeDrawing\Shapes"
|
||||
AdditionalIncludeDirectories="../../DesktopEditor/xml/build/vs2005;../../DesktopEditor/xml/libxml2/include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ATL_CSTRINGS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
|
||||
MinimalRebuild="false"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
@ -67,7 +67,7 @@
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Urlmon.lib"
|
||||
LinkIncremental="1"
|
||||
IgnoreDefaultLibraryNames="LIBCMT.lib"
|
||||
IgnoreDefaultLibraryNames=""
|
||||
IgnoreEmbeddedIDL="true"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
@ -338,6 +338,70 @@
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Common"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\ASCOfficeDocxFile2\BinWriter\BinWriters.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\XlsxSerializerCom\Reader\ChartFromToBinary.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\ChartWriter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\XlsxSerializerCom\Common\Common.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\XlsxSerializerCom\Reader\CommonWriter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\XlsxSerializerCom\Reader\CSVReader.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\XlsxSerializerCom\Writer\CSVWriter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\DocxSerializer.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/bigobj
"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\FontProcessor.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ASCOfficeDocxFile2\BinReader\Readers.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\XlsxSerializer.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/bigobj"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\DocFormatTest.cpp"
|
||||
>
|
||||
@ -382,10 +446,26 @@
|
||||
RelativePath="..\..\Common\FileDownloader\FileDownloader_win.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\OfficeFileFormatChecker2.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\3dParty\pole\pole.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\UnicodeConverter\UnicodeConverter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DesktopEditor\xml\src\xmldom.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DesktopEditor\xml\src\xmllight.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,137 +0,0 @@
|
||||
/*
|
||||
* (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
|
||||
*
|
||||
*/
|
||||
|
||||
#include "BlipFactory.h"
|
||||
|
||||
namespace GdiPlusHelper
|
||||
{
|
||||
inline static int CompareStrings (const wchar_t* str1, const wchar_t* str2)
|
||||
{
|
||||
CString cstr1; cstr1 = str1;
|
||||
CString cstr2; cstr2 = str2;
|
||||
|
||||
if (cstr1 == cstr2)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
//inline static void GetEncoderCLSID (const wchar_t* pFormat, CLSID* pClsid)
|
||||
//{
|
||||
// // variables
|
||||
// UINT nEncoders = 0;
|
||||
// UINT nSize = 0;
|
||||
// Gdiplus::ImageCodecInfo* pImageCodecInfo = 0;
|
||||
|
||||
// // retrieve encoders info
|
||||
// Gdiplus::GetImageEncodersSize(&nEncoders, &nSize);
|
||||
|
||||
// // check for valid encoders
|
||||
// if (!nSize)
|
||||
// throw 0;
|
||||
|
||||
// // create encoders info structure of necessary size
|
||||
// pImageCodecInfo = (Gdiplus::ImageCodecInfo*)(malloc(nSize));
|
||||
|
||||
// // check for valid encoder
|
||||
// if (!pImageCodecInfo)
|
||||
// throw 0;
|
||||
|
||||
// // retrieve all encoders
|
||||
// Gdiplus::GetImageEncoders(nEncoders, nSize, pImageCodecInfo);
|
||||
|
||||
// // locate necessary encoder
|
||||
// for (UINT nEncoder = 0; nEncoder < nEncoders; ++nEncoder)
|
||||
// {
|
||||
// // compare MIME strings
|
||||
// if (CompareStrings(pImageCodecInfo[nEncoder].MimeType, pFormat) == 0)
|
||||
// {
|
||||
// // save CLSID
|
||||
// *pClsid = pImageCodecInfo[nEncoder].Clsid;
|
||||
|
||||
// // clear memory
|
||||
// free(pImageCodecInfo);
|
||||
|
||||
// // all ok
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // clear memory
|
||||
// free(pImageCodecInfo);
|
||||
|
||||
// // codec not found
|
||||
// throw 0;
|
||||
//}
|
||||
}
|
||||
|
||||
namespace OfficeArt
|
||||
{
|
||||
OfficeArtBlip* BlipFactory::GetBlipWithPngTransform()
|
||||
{
|
||||
//CString strTempPath;
|
||||
//if (::GetTempPath(_MAX_PATH, strTempPath.GetBuffer(_MAX_PATH)) != 0)
|
||||
// strTempPath.ReleaseBuffer();
|
||||
//else
|
||||
// strTempPath = _T(".");
|
||||
|
||||
//CString strTempFile;
|
||||
//if (::GetTempFileName(strTempPath, _T("file"), 0, strTempFile.GetBuffer(_MAX_PATH)) != 0)
|
||||
//{
|
||||
// CString tempFile; tempFile.Format (_T("%s%s"), strTempFile, _T(".png"));
|
||||
|
||||
// CGdiPlusInit m_oInitGdiplus;
|
||||
// if (m_oInitGdiplus.Init())
|
||||
// {
|
||||
// Gdiplus::Bitmap oBitmap (m_sFile.c_str());
|
||||
// if (Gdiplus::Ok == oBitmap.GetLastStatus())
|
||||
// {
|
||||
// CLSID guid;
|
||||
// GdiPlusHelper::GetEncoderCLSID (L"image/png", &guid);
|
||||
|
||||
// if (Gdiplus::Ok == oBitmap.Save (tempFile, &guid))
|
||||
// {
|
||||
// if (Gdiplus::Ok == oBitmap.GetLastStatus())
|
||||
// {
|
||||
// m_sFile = std::wstring (tempFile);
|
||||
// m_bDeleteFile = TRUE;
|
||||
|
||||
// return GetOfficeArtBlip();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@ -1,339 +0,0 @@
|
||||
/*
|
||||
* (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 <fstream>
|
||||
#include <string>
|
||||
|
||||
#include "OfficeArtBlipJPEG.h"
|
||||
#include "OfficeArtBlipPNG.h"
|
||||
#include "OfficeArtBlipEMF.h"
|
||||
#include "OfficeArtBlipWMF.h"
|
||||
#include "OfficeArtBlipTIFF.h"
|
||||
#include "OfficeArtFBSE.h"
|
||||
|
||||
#include "../../Common/MD4/md4.h"
|
||||
|
||||
#include "../../../ASCOfficeUtils/ASCOfficeUtilsLib/OfficeUtils.h"
|
||||
|
||||
|
||||
namespace OfficeArt
|
||||
{
|
||||
class BlipFactory
|
||||
{
|
||||
public:
|
||||
|
||||
BlipFactory () : m_bDeleteFile (FALSE)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
BlipFactory (std::wstring fileName) : m_bDeleteFile (FALSE)
|
||||
{
|
||||
m_sFile = std::wstring(fileName);
|
||||
}
|
||||
|
||||
~BlipFactory ()
|
||||
{
|
||||
if (m_bDeleteFile)
|
||||
{
|
||||
::DeleteFile (m_sFile.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
inline std::wstring GetFileNameExtension() const
|
||||
{
|
||||
std::wstring::size_type dotPosition = m_sFile.find_last_of( _T( '.' ) );
|
||||
static const std::wstring::size_type npos = -1;
|
||||
std::wstring extension;
|
||||
|
||||
if (dotPosition != npos)
|
||||
extension = std::wstring( ( m_sFile.begin() + dotPosition + 1 ), m_sFile.end() );
|
||||
|
||||
return extension;
|
||||
}
|
||||
|
||||
inline Enumerations::MSOBLIPTYPE GetBlipType() const
|
||||
{
|
||||
Enumerations::MSOBLIPTYPE blipType = Enumerations::msoblipUNKNOWN;
|
||||
|
||||
std::wstring extension = GetFileNameExtension();
|
||||
|
||||
if ( (extension == std::wstring(L"jpg")) || (extension == std::wstring(L"jpeg")) )
|
||||
{
|
||||
blipType = Enumerations::msoblipJPEG;
|
||||
}
|
||||
else if (extension == std::wstring(L"png") || extension == std::wstring(L"gif"))
|
||||
{
|
||||
blipType = Enumerations::msoblipPNG;
|
||||
}
|
||||
else if (extension == std::wstring(L"emf"))
|
||||
{
|
||||
blipType = Enumerations::msoblipEMF;
|
||||
}
|
||||
else if (extension == std::wstring(L"wmf"))
|
||||
{
|
||||
blipType = Enumerations::msoblipWMF;
|
||||
}
|
||||
else if (extension == std::wstring(L"tiff") || extension == std::wstring(L"tif"))
|
||||
{
|
||||
blipType = Enumerations::msoblipTIFF;
|
||||
}
|
||||
else if (extension == std::wstring(L"bmp"))
|
||||
{
|
||||
blipType = Enumerations::msoblipDIB;
|
||||
}
|
||||
|
||||
return blipType;
|
||||
}
|
||||
|
||||
inline OfficeArtBlip* GetOfficeArtBlip()
|
||||
{
|
||||
OfficeArtBlip* officeArtBlip = NULL;
|
||||
|
||||
if (!m_sFile.empty())
|
||||
{
|
||||
std::string xstr;
|
||||
|
||||
std::ifstream xfile(m_sFile.c_str(), std::ios::binary);
|
||||
|
||||
//узнаем размер файла, и выделяем память в строке
|
||||
xfile.seekg( 0, std::ios_base::end );
|
||||
xstr.resize( xfile.tellg() );
|
||||
xfile.seekg( 0, std::ios_base::beg );
|
||||
|
||||
//копируем данные
|
||||
xfile.read(const_cast<char*>( xstr.data() ), (std::streamsize)xstr.size());
|
||||
|
||||
if ( !xstr.empty() )
|
||||
{
|
||||
std::wstring extension = GetFileNameExtension();
|
||||
|
||||
if ( extension == std::wstring(L"gif")
|
||||
|| extension == std::wstring(L"bmp")
|
||||
|| extension == std::wstring(L"tiff")
|
||||
|| extension == std::wstring(L"tif") )
|
||||
{
|
||||
// MS WORD конвертит исходник в PNG формат ( UUID берет их исходника GIF файла )
|
||||
// MS WORD конвертит исходник в PNG формат ( UUID берет их исходника TIFF файла )
|
||||
// MS WORD конвертит исходник в PNG формат ( UUID берет их исходника BMP файла )
|
||||
|
||||
m_sOriginalData = xstr;
|
||||
officeArtBlip = GetBlipWithPngTransform();
|
||||
}
|
||||
else if ((extension == std::wstring(L"jpg")) || (extension == std::wstring(L"jpeg")))
|
||||
{
|
||||
MD4 md4Code((unsigned char*)xstr.data(), xstr.size());
|
||||
officeArtBlip = new OfficeArtBlipJPEG((unsigned char*)xstr.data(), xstr.size(), md4Code.GetMD4Bytes());
|
||||
}
|
||||
else if (extension == std::wstring(L"png"))
|
||||
{
|
||||
if (m_sOriginalData.length())
|
||||
{
|
||||
MD4 md4Code((unsigned char*)m_sOriginalData.data(), m_sOriginalData.size());
|
||||
officeArtBlip = new OfficeArtBlipPNG ((unsigned char*)m_sOriginalData.data(), m_sOriginalData.size(), md4Code.GetMD4Bytes());
|
||||
}
|
||||
else
|
||||
{
|
||||
MD4 md4Code((unsigned char*)xstr.data(), xstr.size());
|
||||
officeArtBlip = new OfficeArtBlipPNG ((unsigned char*)xstr.data(), xstr.size(), md4Code.GetMD4Bytes());
|
||||
}
|
||||
}
|
||||
else if (extension == std::wstring(L"emf"))
|
||||
{
|
||||
unsigned char* buffer = NULL;
|
||||
unsigned long comprLen = CompressImage( &buffer, (unsigned char*)xstr.data(), xstr.size());
|
||||
|
||||
if ( ( buffer != NULL ) && ( comprLen != 0 ) )
|
||||
{
|
||||
MD4 md4Code((unsigned char*)xstr.data(), xstr.size());
|
||||
|
||||
//!!!TODO!!!
|
||||
officeArtBlip = new OfficeArtBlipEMF( OfficeArtMetafileHeader( xstr.size(), RECT( 0, 0, 0, 0 ), POINT( 0, 0 ), comprLen, COMPRESSION_METHOD_DEFLATE ), buffer, md4Code.GetMD4Bytes() );
|
||||
|
||||
RELEASEARRAYOBJECTS (buffer);
|
||||
}
|
||||
}
|
||||
else if (extension == std::wstring(L"wmf"))
|
||||
{
|
||||
unsigned long comprLen = 0;
|
||||
unsigned char* buffer = NULL;
|
||||
|
||||
std::string metaPlaceableRecord;
|
||||
std::string wmfData;
|
||||
|
||||
metaPlaceableRecord.push_back( (char)0xD7 );
|
||||
metaPlaceableRecord.push_back( (char)0xCD );
|
||||
metaPlaceableRecord.push_back( (char)0xC6 );
|
||||
metaPlaceableRecord.push_back( (char)0x9A );
|
||||
|
||||
if ( equal( xstr.begin(), ( xstr.begin() + 4 ), metaPlaceableRecord.begin() ) )
|
||||
{
|
||||
wmfData.assign( ( xstr.begin() + 22 ), xstr.end() );
|
||||
}
|
||||
else
|
||||
{
|
||||
wmfData = xstr;
|
||||
}
|
||||
|
||||
comprLen = CompressImage( &buffer, (unsigned char*)wmfData.data(), wmfData.size() );
|
||||
|
||||
if ( ( buffer != NULL ) && ( comprLen != 0 ) )
|
||||
{
|
||||
MD4 md4Code( (unsigned char*)wmfData.data(), wmfData.size() );
|
||||
|
||||
// TODO : need fix
|
||||
|
||||
officeArtBlip = new OfficeArtBlipWMF( OfficeArtMetafileHeader( wmfData.size(), RECT( 0, 0, 0, 0 ), POINT( 0, 0 ), comprLen, COMPRESSION_METHOD_DEFLATE ), buffer, md4Code.GetMD4Bytes() );
|
||||
RELEASEARRAYOBJECTS (buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return officeArtBlip;
|
||||
}
|
||||
|
||||
inline std::vector<unsigned char> Get_rgbUid1 ()
|
||||
{
|
||||
if (!m_sFile.empty())
|
||||
{
|
||||
std::string xstr;
|
||||
|
||||
std::ifstream xfile(m_sFile.c_str(), std::ios::binary);
|
||||
|
||||
//узнаем размер файла, и выделяем память в строке
|
||||
xfile.seekg( 0, std::ios_base::end );
|
||||
xstr.resize( xfile.tellg() );
|
||||
xfile.seekg( 0, std::ios_base::beg );
|
||||
|
||||
//копируем данные
|
||||
xfile.read(const_cast<char*>(xstr.data()), (std::streamsize)xstr.size());
|
||||
|
||||
if ( !xstr.empty() )
|
||||
{
|
||||
std::wstring extension = GetFileNameExtension();
|
||||
|
||||
if ((extension == std::wstring(_T("jpg")))
|
||||
|| (extension == std::wstring(_T("jpeg")))
|
||||
|| (extension == std::wstring(_T("png")))
|
||||
|| (extension == std::wstring(_T("gif")))
|
||||
|| (extension == std::wstring(_T("tiff")))
|
||||
|| (extension == std::wstring(L"tif"))
|
||||
|| (extension == std::wstring(L"bmp")) )
|
||||
{
|
||||
MD4 MD4Code ((unsigned char*)xstr.data(), xstr.size());
|
||||
return MD4Code.GetMD4Bytes();
|
||||
}
|
||||
else if (extension == std::wstring(_T("emf")))
|
||||
{
|
||||
unsigned char* buffer = NULL;
|
||||
unsigned long comprLen = CompressImage (&buffer, (unsigned char*)xstr.data(), xstr.size());
|
||||
|
||||
if ( ( buffer != NULL ) && ( comprLen != 0 ) )
|
||||
{
|
||||
MD4 MD4Code ((unsigned char*)xstr.data(), xstr.size());
|
||||
RELEASEARRAYOBJECTS (buffer);
|
||||
|
||||
return MD4Code.GetMD4Bytes();
|
||||
}
|
||||
}
|
||||
else if (extension == std::wstring(_T("wmf")))
|
||||
{
|
||||
std::string metaPlaceableRecord;
|
||||
std::string wmfData;
|
||||
|
||||
metaPlaceableRecord.push_back((char)0xD7);
|
||||
metaPlaceableRecord.push_back((char)0xCD);
|
||||
metaPlaceableRecord.push_back((char)0xC6);
|
||||
metaPlaceableRecord.push_back((char)0x9A);
|
||||
|
||||
if ( equal( xstr.begin(), ( xstr.begin() + 4 ), metaPlaceableRecord.begin() ) )
|
||||
{
|
||||
wmfData.assign( ( xstr.begin() + 22 ), xstr.end() );
|
||||
}
|
||||
else
|
||||
{
|
||||
wmfData = xstr;
|
||||
}
|
||||
|
||||
unsigned char* buffer = NULL;
|
||||
unsigned long comprLen = CompressImage( &buffer, (unsigned char*)wmfData.data(), wmfData.size() );
|
||||
|
||||
if ( ( buffer != NULL ) && ( comprLen != 0 ) )
|
||||
{
|
||||
MD4 MD4Code ((unsigned char*)wmfData.data(), wmfData.size());
|
||||
RELEASEARRAYOBJECTS (buffer);
|
||||
|
||||
return MD4Code.GetMD4Bytes();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return std::vector<unsigned char> ();
|
||||
}
|
||||
|
||||
protected:
|
||||
inline unsigned long CompressImage (unsigned char** buffer, unsigned char* imageData, unsigned int imageSize) const
|
||||
{
|
||||
unsigned long comprLen = 0;
|
||||
|
||||
if ( ( buffer != NULL ) && ( imageData != NULL ) && ( imageSize != 0 ) )
|
||||
{
|
||||
comprLen = imageSize;
|
||||
*buffer = new unsigned char[comprLen];
|
||||
|
||||
HRESULT hr = S_OK;
|
||||
COfficeUtils* pOfficeUtils = new COfficeUtils(NULL);
|
||||
|
||||
if (pOfficeUtils)
|
||||
{
|
||||
pOfficeUtils->Compress(*buffer, &comprLen, imageData, imageSize, -1);
|
||||
|
||||
delete pOfficeUtils;
|
||||
pOfficeUtils = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return comprLen;
|
||||
}
|
||||
|
||||
OfficeArtBlip* GetBlipWithPngTransform ();
|
||||
|
||||
private:
|
||||
|
||||
std::wstring m_sFile;
|
||||
bool m_bDeleteFile;
|
||||
std::string m_sOriginalData;
|
||||
};
|
||||
}
|
||||
@ -1,377 +0,0 @@
|
||||
/*
|
||||
* (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
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "ShapeBuilder.h"
|
||||
|
||||
namespace ASCDocFileFormat
|
||||
{
|
||||
bool COArtBuilder::BuildShapeRun (const OOX::Logic::Pict& oPicture, CShapeRun& oOdbflRun)
|
||||
{
|
||||
if (oPicture.rect.is_init())
|
||||
{
|
||||
oOdbflRun = BuildOdbflRun <OOX::Logic::Rect> (oPicture.rect, CMapShape(OfficeArt::Enumerations::msosptRectangle));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (oPicture.oval.is_init())
|
||||
{
|
||||
oOdbflRun = BuildOdbflRun <OOX::Logic::Oval> (oPicture.oval, CMapShape(OfficeArt::Enumerations::msosptEllipse));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (oPicture.roundrect.is_init())
|
||||
{
|
||||
oOdbflRun = BuildOdbflRun <OOX::Logic::Roundrect> (oPicture.roundrect, CMapShape(OfficeArt::Enumerations::msosptRoundRectangle));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (oPicture.line.is_init())
|
||||
{
|
||||
oOdbflRun = BuildOdbflRun <OOX::Logic::Line> (oPicture.line, CMapShape(OfficeArt::Enumerations::msosptLine));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (oPicture.shape.is_init())
|
||||
{
|
||||
if (oPicture.shape->imageData.is_init())
|
||||
return FALSE;
|
||||
|
||||
oOdbflRun = BuildOdbflRun <OOX::Logic::Shape> (oPicture.shape, GetRefShape(oPicture));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool COArtBuilder::BuildImageRun (const OOX::Logic::Shape& oXml, const std::wstring& strFileName, Run& oRun)
|
||||
{
|
||||
COArtStorage* pStorage = COArtStorage::Instance();
|
||||
if (pStorage)
|
||||
{
|
||||
COArtImage* pImage = new COArtImage(strFileName, pStorage->GenID (m_nLocation));
|
||||
if (pImage)
|
||||
{
|
||||
CShapeRun oShapeRun (pImage, pImage->GetID(), pStorage->GetOffSetSpa(m_nLocation)); // смещение берем от предыдущего элемента
|
||||
oShapeRun.UpdateSizes (*oXml.style); // размеры
|
||||
oShapeRun.SetWrap (oXml.Wrap); // обтекание
|
||||
//oShapeRun.SetAnchor ((bool)(oXml.anchorlock.is_init()));
|
||||
oShapeRun.SetUseBehind (*oXml.style);
|
||||
|
||||
pImage->SetupFromStyleXml(oXml.style);
|
||||
|
||||
pStorage->AddImage (pImage, oShapeRun.GetSpa(), m_nLocation);
|
||||
|
||||
oRun.AddRunItem (oShapeRun);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
bool COArtBuilder::BuildImageRun (const OOX::Image& oXml, const OOX::Logic::Drawing& oXml2, Run& oRun)
|
||||
{
|
||||
COArtStorage* pStorage = COArtStorage::Instance();
|
||||
if (pStorage)
|
||||
{
|
||||
//COArtImage* pImage = new COArtImage(std::wstring(oXml.filename().GetPath()), pStorage->GenID (m_nLocation));
|
||||
COArtImage* pImage = new COArtImage(oXml.GetPath(), pStorage->GenID (m_nLocation));
|
||||
if (pImage)
|
||||
{
|
||||
CShapeRun oShapeRun (pImage, pImage->GetID(), pStorage->GetOffSetSpa(m_nLocation)); // смещение берем от предыдущего элемента
|
||||
((CImageSettings*)(pImage->GetSettings()))->SetWrapDist(oXml2.Inline);
|
||||
|
||||
pImage->SetRotationImage(oXml2);
|
||||
pImage->SetInternalFlipImage(oXml2);
|
||||
pImage->SetPositioningImage(oXml2);
|
||||
|
||||
oShapeRun.SetImageSize (oXml2);
|
||||
oShapeRun.SetImageWrap (oXml2.Inline->Wrap);
|
||||
oShapeRun.SetImageUseBehind (oXml2.Inline->BehindDoc);
|
||||
oShapeRun.UpdateAnchorPositionImage(oXml2);
|
||||
|
||||
pStorage->AddImage (pImage, oShapeRun.GetSpa(), m_nLocation);
|
||||
|
||||
oRun.AddRunItem (oShapeRun);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
CShapeRun COArtBuilder::BuildGroupRun (const OOX::Logic::Group& oXml, COArtGroup* pShape)
|
||||
{
|
||||
if (pShape)
|
||||
{
|
||||
COArtStorage* pStorage = COArtStorage::Instance();
|
||||
|
||||
CShapeRun oShapeRun (pShape, pShape->GetID(), pStorage->GetOffSetSpa(m_nLocation));
|
||||
oShapeRun.UpdateSizes (*oXml.style);
|
||||
//oShapeRun.SetWrap (oXmlShape.Wrap);
|
||||
//oShapeRun.SetAnchor ((bool)(oXmlShape.anchorlock.is_init()));
|
||||
//oShapeRun.SetUseBehind (*oXml.style);
|
||||
|
||||
if (FALSE == oShapeRun.IsInline())
|
||||
pStorage->AddGroup (pShape, oShapeRun.GetSpa(), m_nLocation);
|
||||
|
||||
return oShapeRun;
|
||||
}
|
||||
|
||||
return CShapeRun();
|
||||
}
|
||||
}
|
||||
|
||||
namespace ASCDocFileFormat
|
||||
{
|
||||
COArtShape* COArtBuilder::BuildOArtShape (const OOX::Logic::Shape& oXml, const OOX::Logic::Group& oXmlGroup)
|
||||
{
|
||||
COArtShape* pShape = InternalBuildOArtShape <OOX::Logic::Shape> (oXml,GetRefShape(oXml,oXmlGroup));
|
||||
if (pShape)
|
||||
{
|
||||
const OOX::Logic::ShapeStyle& oStyle = (*oXml.style);
|
||||
pShape->SetupFromStyleXml(oStyle);
|
||||
|
||||
Unit<int, Pt> nX (0);
|
||||
Unit<int, Pt> nY (0);
|
||||
|
||||
if (oStyle.leftTop.is_init())
|
||||
{
|
||||
nX = *oStyle.leftTop->X;
|
||||
nY = *oStyle.leftTop->Y;
|
||||
}
|
||||
|
||||
Unit<int, Pt> nWidth (*oStyle.Size->Width);
|
||||
Unit<int, Pt> nHeight (*oStyle.Size->Height);
|
||||
|
||||
pShape->SetChildeAnchorBounds (nX, nY, nWidth, nHeight, pShape->IsAngleBoundFlip());
|
||||
|
||||
if (pShape->IsTextureMode())
|
||||
{
|
||||
COArtStorage* storage = COArtStorage::Instance();
|
||||
if (storage)
|
||||
{
|
||||
storage->SaveBlipImage(pShape);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pShape;
|
||||
}
|
||||
|
||||
COArtShape* COArtBuilder::BuildOArtImage (const OOX::Logic::Shape& oXml, const std::wstring& strFileName)
|
||||
{
|
||||
if (0 == strFileName.length())
|
||||
return NULL;
|
||||
|
||||
COArtStorage* storage = COArtStorage::Instance();
|
||||
if (storage)
|
||||
{
|
||||
COArtImage* pImage = new COArtImage(strFileName, storage->GenID (m_nLocation));
|
||||
if (pImage)
|
||||
{
|
||||
const OOX::Logic::ShapeStyle& oStyle = (*oXml.style);
|
||||
|
||||
pImage->SetRotation(oStyle);
|
||||
pImage->SetInternalFlip(oStyle);
|
||||
pImage->SetHidden(oStyle);
|
||||
|
||||
Unit<int, Pt> nX (0);
|
||||
Unit<int, Pt> nY (0);
|
||||
|
||||
if (oStyle.leftTop.is_init())
|
||||
{
|
||||
nX = *oStyle.leftTop->X;
|
||||
nY = *oStyle.leftTop->Y;
|
||||
}
|
||||
|
||||
Unit<int, Pt> nWidth (*oStyle.Size->Width);
|
||||
Unit<int, Pt> nHeight (*oStyle.Size->Height);
|
||||
|
||||
pImage->SetChildeAnchorBounds (nX, nY, nWidth, nHeight, pImage->IsAngleBoundFlip());
|
||||
|
||||
storage->SaveBlipImage(pImage);
|
||||
|
||||
return pImage;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
namespace ASCDocFileFormat
|
||||
{
|
||||
template<class T> CShapeRun COArtBuilder::BuildOdbflRun (const T& oXmlShape, CMapShape& oInnerRef)
|
||||
{
|
||||
COArtShape* pShape = InternalBuildOArtShape <T> (oXmlShape,oInnerRef);
|
||||
if (pShape)
|
||||
{
|
||||
COArtStorage* pStorage = COArtStorage::Instance();
|
||||
|
||||
CShapeRun oShapeRun (pShape, pShape->GetID(), pStorage->GetOffSetSpa(m_nLocation)); // смещение берем от предыдущего элемента
|
||||
oShapeRun.UpdateSizes (*oXmlShape.style); // размеры
|
||||
oShapeRun.SetWrap (oXmlShape.Wrap); // обтекание
|
||||
oShapeRun.SetAnchor ((bool)(oXmlShape.anchorlock.is_init()));
|
||||
oShapeRun.SetUseBehind (*oXmlShape.style);
|
||||
oShapeRun.UpdateAnchorPosition (*oXmlShape.style);
|
||||
|
||||
if (typeid(T) == typeid(OOX::Logic::Line)) // для DOC файла точки начала и конца линии устанавливаются в структуре SPA
|
||||
{
|
||||
OOX::Logic::Line* pLine = (OOX::Logic::Line*)(&oXmlShape);
|
||||
if (pLine)
|
||||
{
|
||||
if (pLine->from.is_init() && pLine->to.is_init())
|
||||
{
|
||||
DOCX::CPointF oFrom(pLine->from);
|
||||
DOCX::CPointF oTo(pLine->to);
|
||||
|
||||
Spa& oSpa = oShapeRun.GetSpa();
|
||||
|
||||
oSpa.m_rca.left = oFrom.GetTX();
|
||||
oSpa.m_rca.top = oFrom.GetTY();
|
||||
oSpa.m_rca.right = oTo.GetTX();
|
||||
oSpa.m_rca.bottom = oTo.GetTY();
|
||||
|
||||
oSpa.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (oXmlShape.textbox.is_init()) // Привязка текста к автофигуры
|
||||
{
|
||||
m_pLastTbRef = pStorage->GenTbRef(m_nLocation);
|
||||
if (m_pLastTbRef)
|
||||
{
|
||||
pShape->SetTbRef(m_pLastTbRef);
|
||||
}
|
||||
}
|
||||
|
||||
if (FALSE == oShapeRun.IsInline())
|
||||
{
|
||||
pStorage->Add (pShape, oShapeRun.GetSpa(), m_nLocation);
|
||||
}
|
||||
|
||||
return oShapeRun;
|
||||
}
|
||||
|
||||
return CShapeRun();
|
||||
}
|
||||
|
||||
template<class T> COArtShape* COArtBuilder::InternalBuildOArtShape (const T& oXmlShape, CMapShape& oInnerRef)
|
||||
{
|
||||
COArtStorage* pStorage = COArtStorage::Instance();
|
||||
if (pStorage)
|
||||
{
|
||||
COArtShape* pShape = new COArtShape(pStorage->GenID (m_nLocation));
|
||||
if (pShape)
|
||||
{
|
||||
int nType = oInnerRef.m_nType;
|
||||
if (nType == OfficeArt::Enumerations::msosptTextStop) // пока не понятно что делать с такими фигурами
|
||||
nType = 0;
|
||||
|
||||
pShape->SetShapeType (nType);
|
||||
|
||||
if (pShape->GetSettings ())
|
||||
{
|
||||
// fill
|
||||
|
||||
if (oXmlShape.fillstyle.is_init())
|
||||
pShape->GetSettings ()->GetFillStyle().Read (oXmlShape.fillstyle);
|
||||
|
||||
// line
|
||||
|
||||
if (oXmlShape.linestyle.is_init())
|
||||
pShape->GetSettings ()->GetLineStyle().Read (oXmlShape.linestyle);
|
||||
|
||||
// shadow
|
||||
|
||||
if (oXmlShape.shadow.is_init())
|
||||
pShape->GetSettings ()->GetShadowStyle().Read (oXmlShape.shadow);
|
||||
|
||||
pShape->SetupFromStyleXml(oXmlShape.style);
|
||||
|
||||
if (0 == nType)
|
||||
{
|
||||
if (oInnerRef.m_strPath.length())
|
||||
pShape->GetSettings()->GetGeometryStyle().SetPath(oInnerRef.m_strPath, oInnerRef.m_strAdjustValues, oInnerRef.m_strFormulas);
|
||||
|
||||
if (oInnerRef.m_strCoordSize.length())
|
||||
pShape->GetSettings()->GetGeometryStyle().SetRightBottom(oInnerRef.m_strCoordSize);
|
||||
|
||||
if (oInnerRef.m_strConnection.length())
|
||||
pShape->GetSettings()->GetGeometryStyle().SetConnection(oInnerRef.m_strConnection);
|
||||
|
||||
if (oInnerRef.m_strSites.length())
|
||||
pShape->GetSettings()->GetGeometryStyle().SetSites(oInnerRef.m_strSites);
|
||||
|
||||
if (oInnerRef.m_strSitesDir.length())
|
||||
pShape->GetSettings()->GetGeometryStyle().SetSitesDir(oInnerRef.m_strSitesDir);
|
||||
|
||||
if (oInnerRef.m_textboxrect.length())
|
||||
pShape->GetSettings()->GetGeometryStyle().SetInscribe(oInnerRef.m_textboxrect);
|
||||
}
|
||||
|
||||
if (oInnerRef.m_strAdjustValues.length())
|
||||
pShape->GetSettings()->GetGeometryStyle().SetAdjustValues(oInnerRef.m_strAdjustValues);
|
||||
|
||||
if (typeid(T) == typeid(OOX::Logic::Roundrect)) // для DOC файла велична арки пишется в adjust свойство
|
||||
{
|
||||
OOX::Logic::Roundrect* roundrect = (OOX::Logic::Roundrect*)(&oXmlShape);
|
||||
if (roundrect)
|
||||
{
|
||||
if(roundrect->arcsize.is_init())
|
||||
{
|
||||
pShape->GetSettings()->GetGeometryStyle().SetAdjustValues(roundrect->arcsize, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pShape->GetSettings()->SetWrapDist (oXmlShape.style);
|
||||
}
|
||||
|
||||
// имеет место быть заливка картинкой
|
||||
|
||||
if (m_strTextureFile.length())
|
||||
{
|
||||
pShape->SetTextureFill(TRUE, m_strTextureFile);
|
||||
m_strTextureFile = L"";
|
||||
}
|
||||
|
||||
return pShape;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,169 +0,0 @@
|
||||
/*
|
||||
* (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
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "ShapePath.h"
|
||||
|
||||
namespace ASCDocFileFormat
|
||||
{
|
||||
LONG CFormula::Calculate(CFormulasManager* pManager)
|
||||
{
|
||||
if ((0 > m_lIndex) || (m_lIndex >= pManager->m_arResults.size()))
|
||||
return 0;
|
||||
if (0xFFFFFFFF != pManager->m_arResults[m_lIndex])
|
||||
{
|
||||
return pManager->m_arResults[m_lIndex];
|
||||
}
|
||||
|
||||
LONG lResult = 0;
|
||||
|
||||
LONG lGuidesCount = pManager->m_arFormulas.size();
|
||||
LONG lAdjCount = pManager->m_pAdjustments->size();
|
||||
|
||||
LONG a1 = m_lParam1;
|
||||
if (ptFormula == m_eType1)
|
||||
{
|
||||
a1 = (m_lParam1 >= lGuidesCount) ? 0 : pManager->m_arFormulas[m_lParam1].Calculate(pManager);
|
||||
}
|
||||
else if (ptAdjust == m_eType1)
|
||||
{
|
||||
a1 = (m_lParam1 >= lAdjCount) ? 0 : (*(pManager->m_pAdjustments))[m_lParam1];
|
||||
}
|
||||
|
||||
LONG b1 = m_lParam2;
|
||||
if (ptFormula == m_eType2)
|
||||
{
|
||||
b1 = (m_lParam2 >= lGuidesCount) ? 0 : pManager->m_arFormulas[m_lParam2].Calculate(pManager);
|
||||
}
|
||||
else if (ptAdjust == m_eType2)
|
||||
{
|
||||
b1 = (m_lParam2 >= lAdjCount) ? 0 : (*(pManager->m_pAdjustments))[m_lParam2];
|
||||
}
|
||||
|
||||
LONG c1 = m_lParam3;
|
||||
if (ptFormula == m_eType3)
|
||||
{
|
||||
c1 = (m_lParam3 >= lGuidesCount) ? 0 : pManager->m_arFormulas[m_lParam3].Calculate(pManager);
|
||||
}
|
||||
else if (ptAdjust == m_eType3)
|
||||
{
|
||||
c1 = (m_lParam3 >= lAdjCount) ? 0 : (*(pManager->m_pAdjustments))[m_lParam3];
|
||||
}
|
||||
|
||||
double a = (double)a1;
|
||||
double b = (double)b1;
|
||||
double c = (double)c1;
|
||||
|
||||
double dRes = 0.0;
|
||||
|
||||
try
|
||||
{
|
||||
// теперь нужно просто посчитать
|
||||
switch (m_eFormulaType)
|
||||
{
|
||||
case ftSum: { dRes = a + b - c; break; }
|
||||
case ftProduct: {
|
||||
if (0 == c)
|
||||
c = 1;
|
||||
|
||||
dRes = a * b / c;
|
||||
break;
|
||||
}
|
||||
case ftMid: { dRes = (a + b) / 2.0; break; }
|
||||
case ftAbsolute: { dRes = abs(a); break; }
|
||||
|
||||
case ftMin: { dRes = min(a, b); break; }
|
||||
case ftMax: { dRes = max(a, b); break; }
|
||||
case ftIf: { dRes = (a > 0) ? b : c; break; }
|
||||
case ftSqrt: { dRes = sqrt(a); break; }
|
||||
case ftMod: { dRes = sqrt(a*a + b*b + c*c); break; }
|
||||
|
||||
case ftSin: {
|
||||
//dRes = a * sin(b);
|
||||
//dRes = a * sin(b / pow2_16);
|
||||
dRes = a * sin(M_PI * b / (pow2_16 * 180));
|
||||
break;
|
||||
}
|
||||
case ftCos: {
|
||||
//dRes = a * cos(b);
|
||||
//dRes = a * cos(b / pow2_16);
|
||||
dRes = a * cos(M_PI * b / (pow2_16 * 180));
|
||||
break;
|
||||
}
|
||||
case ftTan: {
|
||||
//dRes = a * tan(b);
|
||||
dRes = a * tan(M_PI * b / (pow2_16 * 180));
|
||||
break;
|
||||
}
|
||||
case ftAtan2: {
|
||||
dRes = 180 * pow2_16 * atan2(b,a) / M_PI;
|
||||
break;
|
||||
}
|
||||
|
||||
case ftSinatan2: { dRes = a * sin(atan2(c,b)); break; }
|
||||
case ftCosatan2: { dRes = a * cos(atan2(c,b)); break; }
|
||||
|
||||
case ftSumangle: {
|
||||
//dRes = a + b - c;
|
||||
dRes = a + b * pow2_16 - c * pow2_16;
|
||||
|
||||
/*while (23592960 < dRes)
|
||||
{
|
||||
dRes -= 23592960;
|
||||
}
|
||||
while (-23592960 > dRes)
|
||||
{
|
||||
dRes += 23592960;
|
||||
}*/
|
||||
|
||||
break;
|
||||
}
|
||||
case ftEllipse: {
|
||||
if (0 == b)
|
||||
b = 1;
|
||||
dRes = c * sqrt(1-(a*a/(b*b)));
|
||||
break;
|
||||
}
|
||||
case ftVal: { dRes = a; break; }
|
||||
default: break;
|
||||
};
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
dRes = 0;
|
||||
}
|
||||
|
||||
lResult = (LONG)dRes;
|
||||
pManager->m_arResults[m_lIndex] = lResult;
|
||||
return lResult;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* (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
|
||||
*
|
||||
*/
|
||||
// AVSOfficeDocxFile2.cpp : Implementation of DLL Exports.
|
||||
#include "stdafx.h"
|
||||
#include "resource.h"
|
||||
|
||||
#include "DocxFile2.h"
|
||||
#include "XlsxFile2.h"
|
||||
#include "PptxFile.h"
|
||||
|
||||
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
|
||||
[ module(dll, uuid = "{A1EEE61A-FAA7-47af-B078-4E955623B9CA}",
|
||||
name = "ASCOfficeDocxFile2",
|
||||
helpstring = "ASCOfficeDocxFile2 1.0 Type Library",
|
||||
resource_name = "IDR_ASCOFFICEDOCXFILE2") ];
|
||||
@ -1,142 +0,0 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
#define COMPONENT_NAME "OfficeDocxFile2"
|
||||
#include "../Common/FileInfo.h"
|
||||
#include "version.h"
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "winres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Russian resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
|
||||
#pragma code_page(1251)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // Russian resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""winres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION INTVER
|
||||
PRODUCTVERSION INTVER
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", COMPANY_NAME
|
||||
VALUE "FileDescription", FILE_DESCRIPTION_ACTIVEX
|
||||
VALUE "FileVersion", STRVER
|
||||
VALUE "InternalName", COMPONENT_FILE_NAME_DLL
|
||||
VALUE "LegalCopyright", LEGAL_COPYRIGHT
|
||||
VALUE "OriginalFilename", COMPONENT_FILE_NAME_DLL
|
||||
VALUE "ProductName", FILE_DESCRIPTION_ACTIVEX
|
||||
VALUE "ProductVersion", STRVER
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// REGISTRY
|
||||
//
|
||||
|
||||
IDR_ASCOFFICEDOCXFILE2 REGISTRY "ASCOfficeDocxFile2.rgs"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_PROJNAME "ASCOfficeDocxFile2"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
HKCR
|
||||
{
|
||||
NoRemove AppID
|
||||
{
|
||||
'%APPID%' = s 'ASCOfficeDocxFile2'
|
||||
'ASCOfficeDocxFile2.DLL'
|
||||
{
|
||||
val AppID = s '%APPID%'
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30723.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeDocxFile2", "ASCOfficeDocxFile2.vcxproj", "{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\Common\DocxFormat\Projects\DocxFormat2005.vcxproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTXFormat", "..\ASCOfficePPTXFile\PPTXLib\PPTXFormat.vcxproj", "{36636678-AE25-4BE6-9A34-2561D1BCF302}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCHTMLRenderer", "..\ASCHTMLRenderer\ASCHTMLRendererLib.vcxproj", "{DC24710E-8DF2-4A7A-B7C3-2313E294143C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\Common\DocxFormat\Source\XML\libxml2\win_build\libxml2.vcxproj", "{21663823-DE45-479B-91D0-B4FEF4916EF0}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeUtilsLib", "..\ASCOfficeUtils\ASCOfficeUtilsLib\Win\ASCOfficeUtilsLib.vcxproj", "{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug|x64.Build.0 = Debug|x64
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release|Win32.Build.0 = Release|Win32
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release|x64.ActiveCfg = Release|x64
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release|x64.Build.0 = Release|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|x64.Build.0 = Debug|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.Build.0 = Release|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|x64.ActiveCfg = Release|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|x64.Build.0 = Release|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|x64.Build.0 = Debug|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|Win32.Build.0 = Release|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|x64.ActiveCfg = Release|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|x64.Build.0 = Release|x64
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|Win32.Build.0 = Release|Win32
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|x64.ActiveCfg = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.Build.0 = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.ActiveCfg = Release|Win32
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Debug|x64.Build.0 = Debug|x64
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Release|Win32.Build.0 = Release|Win32
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Release|x64.ActiveCfg = Release|x64
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
|
||||
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,681 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseASC|Win32">
|
||||
<Configuration>ReleaseASC</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseASC|x64">
|
||||
<Configuration>ReleaseASC</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseOpenSource|Win32">
|
||||
<Configuration>ReleaseOpenSource</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseOpenSource|x64">
|
||||
<Configuration>ReleaseOpenSource</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}</ProjectGuid>
|
||||
<RootNamespace>ASCOfficeDocxFile2</RootNamespace>
|
||||
<Keyword>AtlProj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfAtl>Static</UseOfAtl>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfAtl>Static</UseOfAtl>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfAtl>false</UseOfAtl>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<UseOfAtl>false</UseOfAtl>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfAtl>Static</UseOfAtl>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfAtl>Static</UseOfAtl>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfAtl>false</UseOfAtl>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<UseOfAtl>false</UseOfAtl>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<PreBuildEventUseInBuild>false</PreBuildEventUseInBuild>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<PreBuildEventUseInBuild>false</PreBuildEventUseInBuild>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
<IgnoreImportLibrary>true</IgnoreImportLibrary>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)ASCOfficeDocxFile2.tlb</TypeLibraryName>
|
||||
<HeaderFileName>DocxFile2.h</HeaderFileName>
|
||||
<DllDataFileName />
|
||||
<InterfaceIdentifierFileName>ASCOfficeDocxFile2_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>ASCOfficeDocxFile2_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\..\Common\DocxFormat\Source\XML\libxml2\XML\include;$(SolutionDir)\..\DesktopEditor\freetype-2.5.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;USE_AVSOFFICESTUDIO_XMLUTILS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<AdditionalOptions>/Zm1000 %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0419</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)ASCOfficeDocxFile2.dll</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/win_build/Release;$(SolutionDir)/../Common/DocxFormat/Lib/Debug;$(SolutionDir)/../SDK/lib/win_32/DEBUG;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<MergedIDLBaseFileName>_ASCOfficeDocxFile2.idl</MergedIDLBaseFileName>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(OutDir)ASCOfficeDocxFile2.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>graphics.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>Performing registration</Message>
|
||||
<Command>regsvr32 /s /c "$(TargetPath)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)ASCOfficeDocxFile2.tlb</TypeLibraryName>
|
||||
<HeaderFileName>DocxFile2.h</HeaderFileName>
|
||||
<DllDataFileName />
|
||||
<InterfaceIdentifierFileName>ASCOfficeDocxFile2_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>ASCOfficeDocxFile2_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/Zm1000 %(AdditionalOptions)</AdditionalOptions>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\..\Common\DocxFormat\Source\XML\libxml2\XML\include;$(SolutionDir)\..\DesktopEditor\freetype-2.5.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;USE_AVSOFFICESTUDIO_XMLUTILS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0419</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)ASCOfficeDocxFile2.dll</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/win_build/Release;$(SolutionDir)/../Common/DocxFormat/Lib/Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCMTD.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<MergedIDLBaseFileName>_ASCOfficeDocxFile2.idl</MergedIDLBaseFileName>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(OutDir)ASCOfficeDocxFile2.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>Performing registration</Message>
|
||||
<Command>regsvr32 /s /c "$(TargetPath)"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<PreBuildEvent>
|
||||
<Command>..\Redist\VersionControl.exe "$(ProjectDir)\version.h"</Command>
|
||||
</PreBuildEvent>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)ASCOfficeDocxFile2.tlb</TypeLibraryName>
|
||||
<HeaderFileName>DocxFile2.h</HeaderFileName>
|
||||
<DllDataFileName />
|
||||
<InterfaceIdentifierFileName>ASCOfficeDocxFile2_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>ASCOfficeDocxFile2_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/Zm1000 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\..\Common\DocxFormat\Source\XML\libxml2\XML\include;$(SolutionDir)\..\DesktopEditor\freetype-2.5.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;BUILD_CONFIG_FULL_VERSION;DONT_WRITE_EMBEDDED_FONTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0419</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>comsvcs.lib;comsuppw.lib;gdiplus.lib;graphics.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/win_build/Release;$(SolutionDir)/../Common/DocxFormat/Lib/Release;$(SolutionDir)/../SDK/lib/win_32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>LIBC.lib;LIBCMT;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<MergedIDLBaseFileName>_ASCOfficeDocxFile2.idl</MergedIDLBaseFileName>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(OutDir)ASCOfficeDocxFile2.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>Performing registration</Message>
|
||||
<Command>regsvr32 /s /c "$(TargetPath)"
|
||||
copy "$(TargetPath)" "$(SolutionDir)..\Redist"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>..\Redist\VersionControl.exe "$(ProjectDir)\version.h"</Command>
|
||||
</PreBuildEvent>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)ASCOfficeDocxFile2.tlb</TypeLibraryName>
|
||||
<HeaderFileName>DocxFile2.h</HeaderFileName>
|
||||
<DllDataFileName />
|
||||
<InterfaceIdentifierFileName>ASCOfficeDocxFile2_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>ASCOfficeDocxFile2_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/Zm1000 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)\..\Common\DocxFormat\Source\XML\libxml2\XML\include;$(SolutionDir)\..\DesktopEditor\freetype-2.5.2\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;BUILD_CONFIG_FULL_VERSION;DONT_WRITE_EMBEDDED_FONTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0419</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>comsvcs.lib;comsuppw.lib;gdiplus.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/win_build/Release;$(SolutionDir)/../Common/DocxFormat/Lib/Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>LIBC.lib;LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<MergedIDLBaseFileName>_ASCOfficeDocxFile2.idl</MergedIDLBaseFileName>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(OutDir)ASCOfficeDocxFile2.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>Performing registration</Message>
|
||||
<Command>regsvr32 /s /c "$(TargetPath)"
|
||||
copy "$(TargetPath)" "$(SolutionDir)..\Redist\x64"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|Win32'">
|
||||
<PreBuildEvent>
|
||||
<Command />
|
||||
</PreBuildEvent>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)ASCOfficeDocxFile2.tlb</TypeLibraryName>
|
||||
<HeaderFileName>DocxFile2.h</HeaderFileName>
|
||||
<DllDataFileName />
|
||||
<InterfaceIdentifierFileName>ASCOfficeDocxFile2_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>ASCOfficeDocxFile2_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/Zm1000 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects;$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects/Font/FreeType;$(SolutionDir)/../Common/DocxFormat/Source/DocxFormat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;USE_ATL_CSTRING;USE_AVSOFFICESTUDIO_XMLUTILS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;ASCBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0419</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>comsvcs.lib;comsuppw.lib;gdiplus.lib;DocxFormat.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)ASCOfficeDocxFile2.dll</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)/../Common/DocxFormat/Lib/Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>LIBC.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<MergedIDLBaseFileName>_ASCOfficeDocxFile2.idl</MergedIDLBaseFileName>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(OutDir)ASCOfficeDocxFile2.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>Performing registration</Message>
|
||||
<Command>regsvr32 /s /c "$(TargetPath)"
|
||||
copy "$(TargetPath)" "$(SolutionDir)..\..\..\..\ASC\Redist\ASCOfficeStudio"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command />
|
||||
</PreBuildEvent>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)ASCOfficeDocxFile2.tlb</TypeLibraryName>
|
||||
<HeaderFileName>DocxFile2.h</HeaderFileName>
|
||||
<DllDataFileName />
|
||||
<InterfaceIdentifierFileName>ASCOfficeDocxFile2_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>ASCOfficeDocxFile2_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/Zm1000 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects;$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects/Font/FreeType;$(SolutionDir)/../Common/DocxFormat/Source/DocxFormat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;USE_ATL_CSTRING;USE_AVSOFFICESTUDIO_XMLUTILS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;ASCBUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0419</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>comsvcs.lib;comsuppw.lib;gdiplus.lib;DocxFormat.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)ASCOfficeDocxFile2.dll</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)/../Common/DocxFormat/Lib/Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>LIBC.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<MergedIDLBaseFileName>_ASCOfficeDocxFile2.idl</MergedIDLBaseFileName>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(OutDir)ASCOfficeDocxFile2.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>Performing registration</Message>
|
||||
<Command>regsvr32 /s /c "$(TargetPath)"
|
||||
copy "$(TargetPath)" "$(SolutionDir)..\..\..\..\ASC\Redist\ASCOfficeStudio"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|Win32'">
|
||||
<PreBuildEvent>
|
||||
<Command />
|
||||
</PreBuildEvent>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)ASCOfficeDocxFile2.tlb</TypeLibraryName>
|
||||
<HeaderFileName>DocxFile2.h</HeaderFileName>
|
||||
<DllDataFileName />
|
||||
<InterfaceIdentifierFileName>ASCOfficeDocxFile2_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>ASCOfficeDocxFile2_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/Zm1000 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/XML/include;$(SolutionDir);$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects;$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects/Font/FreeType;$(SolutionDir)/../Common/DocxFormat/Source/DocxFormat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;USE_ATL_CSTRING;USE_AVSOFFICESTUDIO_XMLUTILS;BUILD_CONFIG_OPENSOURCE_VERSION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0419</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>comsvcs.lib;comsuppw.lib;gdiplus.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/win_build/Release;$(SolutionDir)/../Common/DocxFormat/Lib/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>LIBC.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<MergedIDLBaseFileName>_ASCOfficeDocxFile2.idl</MergedIDLBaseFileName>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(OutDir)ASCOfficeDocxFile2.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>copy to Redist</Message>
|
||||
<Command>copy "$(TargetPath)" "$(SolutionDir)..\Redist"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command />
|
||||
</PreBuildEvent>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
<GenerateStublessProxies>true</GenerateStublessProxies>
|
||||
<TypeLibraryName>$(IntDir)ASCOfficeDocxFile2.tlb</TypeLibraryName>
|
||||
<HeaderFileName>DocxFile2.h</HeaderFileName>
|
||||
<DllDataFileName />
|
||||
<InterfaceIdentifierFileName>ASCOfficeDocxFile2_i.c</InterfaceIdentifierFileName>
|
||||
<ProxyFileName>ASCOfficeDocxFile2_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalOptions>/Zm1000 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/XML/include;$(SolutionDir);$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects;$(SolutionDir)/../../AVSImageStudio3/AVSGraphics/Objects/Font/FreeType;$(SolutionDir)/../Common/DocxFormat/Source/DocxFormat;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_XMLLITE_READER_;USE_LITE_READER;USE_ATL_CSTRING;USE_AVSOFFICESTUDIO_XMLUTILS;BUILD_CONFIG_OPENSOURCE_VERSION;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0419</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>comsvcs.lib;comsuppw.lib;gdiplus.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
|
||||
<AdditionalLibraryDirectories>$(SolutionDir)/../Common/DocxFormat/Source/XML/libxml2/win_build/Release;$(SolutionDir)/../Common/DocxFormat/Lib/$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>LIBC.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
|
||||
<MergedIDLBaseFileName>_ASCOfficeDocxFile2.idl</MergedIDLBaseFileName>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(OutDir)ASCOfficeDocxFile2.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>copy to Redist</Message>
|
||||
<Command>copy "$(TargetPath)" "$(SolutionDir)..\Redist"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="ASCOfficeDocxFile2.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ASCOfficeDocxFile2.rgs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\XlsxSerializerCom\Common\Common.cpp" />
|
||||
<ClCompile Include="..\XlsxSerializerCom\Reader\ChartFromToBinary.cpp">
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\XlsxSerializerCom\Reader\CommonWriter.cpp">
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\XlsxSerializerCom\Reader\CSVReader.cpp" />
|
||||
<ClCompile Include="..\XlsxSerializerCom\Writer\CSVWriter.cpp">
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ASCOfficeDocxFile2.cpp">
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|Win32'">$(IntDir)</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|x64'">$(IntDir)</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|Win32'">$(IntDir)</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|x64'">$(IntDir)</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DocWrapper\DocxSerializer.cpp">
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DocWrapper\FontProcessor.cpp">
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DocWrapper\XlsxSerializer.cpp">
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)</ObjectFileName>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)</ObjectFileName>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|Win32'">Create</PrecompiledHeader>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|Win32'">$(IntDir)</ObjectFileName>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|x64'">Create</PrecompiledHeader>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseASC|x64'">$(IntDir)</ObjectFileName>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|Win32'">Create</PrecompiledHeader>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|Win32'">$(IntDir)</ObjectFileName>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|x64'">Create</PrecompiledHeader>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseOpenSource|x64'">$(IntDir)</ObjectFileName>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)</ObjectFileName>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)</ObjectFileName>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\XlsxSerializerCom\Common\BinReaderWriterDefines.h" />
|
||||
<ClInclude Include="..\XlsxSerializerCom\Common\Common.h" />
|
||||
<ClInclude Include="..\XlsxSerializerCom\Reader\BinaryWriter.h" />
|
||||
<ClInclude Include="..\XlsxSerializerCom\Reader\ChartFromToBinary.h" />
|
||||
<ClInclude Include="..\XlsxSerializerCom\Reader\CommonWriter.h" />
|
||||
<ClInclude Include="..\XlsxSerializerCom\Reader\CSVReader.h" />
|
||||
<ClInclude Include="..\XlsxSerializerCom\Writer\BinaryCommonReader.h" />
|
||||
<ClInclude Include="..\XlsxSerializerCom\Writer\BinaryReader.h" />
|
||||
<ClInclude Include="..\XlsxSerializerCom\Writer\CSVWriter.h" />
|
||||
<ClInclude Include="BinReader\ChartWriter.h" />
|
||||
<ClInclude Include="BinReader\CommentsWriter.h" />
|
||||
<ClInclude Include="BinReader\ContentTypesWriter.h" />
|
||||
<ClInclude Include="BinReader\DocumentRelsWriter.h" />
|
||||
<ClInclude Include="BinReader\DocumentWriter.h" />
|
||||
<ClInclude Include="BinReader\FileDownloader.h" />
|
||||
<ClInclude Include="BinReader\FileWriter.h" />
|
||||
<ClInclude Include="BinReader\fontTableWriter.h" />
|
||||
<ClInclude Include="BinReader\HeaderFooterWriter.h" />
|
||||
<ClInclude Include="BinReader\MediaWriter.h" />
|
||||
<ClInclude Include="BinReader\NumberingWriter.h" />
|
||||
<ClInclude Include="BinReader\ReaderClasses.h" />
|
||||
<ClInclude Include="BinReader\Readers.h" />
|
||||
<ClInclude Include="BinReader\SettingWriter.h" />
|
||||
<ClInclude Include="BinReader\StylesWriter.h" />
|
||||
<ClInclude Include="BinWriter\BinEquationWriter.h" />
|
||||
<ClInclude Include="BinWriter\BinReaderWriterDefines.h" />
|
||||
<ClInclude Include="BinWriter\BinWriters.h" />
|
||||
<ClInclude Include="DocWrapper\DocxSerializer.h" />
|
||||
<ClInclude Include="DocWrapper\FontProcessor.h" />
|
||||
<ClInclude Include="DocWrapper\XlsxSerializer.h" />
|
||||
<ClInclude Include="DocxFile2.h" />
|
||||
<ClInclude Include="PptxFile.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="version.h" />
|
||||
<ClInclude Include="XlsxFile2.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ASCHTMLRenderer\ASCHTMLRendererLib.vcxproj">
|
||||
<Project>{dc24710e-8df2-4a7a-b7c3-2313e294143c}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\ASCOfficePPTXFile\PPTXLib\PPTXFormat.vcxproj">
|
||||
<Project>{36636678-ae25-4be6-9a34-2561d1bcf302}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\ASCOfficeUtils\ASCOfficeUtilsLib\Win\ASCOfficeUtilsLib.vcxproj">
|
||||
<Project>{3f3cb5a1-bb01-49c1-9342-4a69e30f9ef6}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Common\DocxFormat\Projects\DocxFormat2005.vcxproj">
|
||||
<Project>{a100103a-353e-45e8-a9b8-90b87cc5c0b0}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Common\DocxFormat\Source\XML\libxml2\win_build\libxml2.vcxproj">
|
||||
<Project>{21663823-de45-479b-91d0-b4fef4916ef0}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@ -1,186 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="res">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="_">
|
||||
<UniqueIdentifier>{3710d9f5-676c-4632-a22d-632057708e84}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="DocWrapper">
|
||||
<UniqueIdentifier>{da428055-8b24-49ac-a8fd-fb7567370761}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="XLSX">
|
||||
<UniqueIdentifier>{2b0ee265-23a7-4758-b2e7-9f335c2932c6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="XLSX\Common">
|
||||
<UniqueIdentifier>{d3849c02-1f95-40b4-9885-3850ac887162}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="XLSX\Reader">
|
||||
<UniqueIdentifier>{6e356698-1762-48ec-aabe-e67cd986841e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="XLSX\Writer">
|
||||
<UniqueIdentifier>{a6d705d7-de56-4085-ad90-9a64fb2a6377}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="DOCX">
|
||||
<UniqueIdentifier>{819e4322-0635-4959-bee0-bd7258b92b82}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="DOCX\Reader">
|
||||
<UniqueIdentifier>{710f68a2-18f0-40c6-8e32-5474b8301127}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="DOCX\Reader\OOXWriter">
|
||||
<UniqueIdentifier>{fb8f2ef8-d3e2-4bae-a746-4dd375a45521}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="DOCX\Common">
|
||||
<UniqueIdentifier>{845568f5-8012-46bf-a6d7-63610040f153}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="DOCX\Writer">
|
||||
<UniqueIdentifier>{276e338e-bf55-47f1-8fd6-d73552eed0d4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="ASCOfficeDocxFile2.rc">
|
||||
<Filter>res</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ASCOfficeDocxFile2.rgs">
|
||||
<Filter>res</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="ASCOfficeDocxFile2.cpp">
|
||||
<Filter>_</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>_</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DocWrapper\FontProcessor.cpp">
|
||||
<Filter>DocWrapper</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DocWrapper\XlsxSerializer.cpp">
|
||||
<Filter>XLSX</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\XlsxSerializerCom\Common\Common.cpp">
|
||||
<Filter>XLSX\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\XlsxSerializerCom\Reader\CSVReader.cpp">
|
||||
<Filter>XLSX\Reader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\XlsxSerializerCom\Reader\ChartFromToBinary.cpp">
|
||||
<Filter>XLSX\Writer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\XlsxSerializerCom\Reader\CommonWriter.cpp">
|
||||
<Filter>XLSX\Writer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\XlsxSerializerCom\Writer\CSVWriter.cpp">
|
||||
<Filter>XLSX\Writer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="DocWrapper\DocxSerializer.cpp">
|
||||
<Filter>DOCX</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>_</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="version.h">
|
||||
<Filter>_</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DocWrapper\FontProcessor.h">
|
||||
<Filter>DocWrapper</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DocWrapper\XlsxSerializer.h">
|
||||
<Filter>XLSX</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\XlsxSerializerCom\Common\BinReaderWriterDefines.h">
|
||||
<Filter>XLSX\Common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\XlsxSerializerCom\Common\Common.h">
|
||||
<Filter>XLSX\Common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\XlsxSerializerCom\Writer\BinaryCommonReader.h">
|
||||
<Filter>XLSX\Reader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\XlsxSerializerCom\Writer\BinaryReader.h">
|
||||
<Filter>XLSX\Reader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\XlsxSerializerCom\Reader\CSVReader.h">
|
||||
<Filter>XLSX\Reader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\XlsxSerializerCom\Reader\BinaryWriter.h">
|
||||
<Filter>XLSX\Writer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\XlsxSerializerCom\Reader\ChartFromToBinary.h">
|
||||
<Filter>XLSX\Writer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\XlsxSerializerCom\Reader\CommonWriter.h">
|
||||
<Filter>XLSX\Writer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\XlsxSerializerCom\Writer\CSVWriter.h">
|
||||
<Filter>XLSX\Writer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DocWrapper\DocxSerializer.h">
|
||||
<Filter>DOCX</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\ReaderClasses.h">
|
||||
<Filter>DOCX\Reader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\Readers.h">
|
||||
<Filter>DOCX\Reader</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\ChartWriter.h">
|
||||
<Filter>DOCX\Reader\OOXWriter</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\CommentsWriter.h">
|
||||
<Filter>DOCX\Reader\OOXWriter</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\ContentTypesWriter.h">
|
||||
<Filter>DOCX\Reader\OOXWriter</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\DocumentRelsWriter.h">
|
||||
<Filter>DOCX\Reader\OOXWriter</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\DocumentWriter.h">
|
||||
<Filter>DOCX\Reader\OOXWriter</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\FileWriter.h">
|
||||
<Filter>DOCX\Reader\OOXWriter</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\fontTableWriter.h">
|
||||
<Filter>DOCX\Reader\OOXWriter</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\HeaderFooterWriter.h">
|
||||
<Filter>DOCX\Reader\OOXWriter</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\MediaWriter.h">
|
||||
<Filter>DOCX\Reader\OOXWriter</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\NumberingWriter.h">
|
||||
<Filter>DOCX\Reader\OOXWriter</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\SettingWriter.h">
|
||||
<Filter>DOCX\Reader\OOXWriter</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\StylesWriter.h">
|
||||
<Filter>DOCX\Reader\OOXWriter</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinReader\FileDownloader.h">
|
||||
<Filter>DOCX\Common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinWriter\BinEquationWriter.h">
|
||||
<Filter>DOCX\Writer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinWriter\BinReaderWriterDefines.h">
|
||||
<Filter>DOCX\Writer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BinWriter\BinWriters.h">
|
||||
<Filter>DOCX\Writer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DocxFile2.h" />
|
||||
<ClInclude Include="PptxFile.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="XlsxFile2.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -1,84 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30723.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeDocxFile2", "ASCOfficeDocxFile2.vcxproj", "{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C} = {DC24710E-8DF2-4A7A-B7C3-2313E294143C}
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6} = {3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\Common\DocxFormat\Projects\DocxFormat2005.vcxproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTXFormat", "..\ASCOfficePPTXFile\PPTXLib\PPTXFormat.vcxproj", "{36636678-AE25-4BE6-9A34-2561D1BCF302}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCHTMLRenderer", "..\ASCHTMLRenderer\ASCHTMLRendererLib.vcxproj", "{DC24710E-8DF2-4A7A-B7C3-2313E294143C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\Common\DocxFormat\Source\XML\libxml2\win_build\libxml2.vcxproj", "{21663823-DE45-479B-91D0-B4FEF4916EF0}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeUtilsLib", "..\ASCOfficeUtils\ASCOfficeUtilsLib\Win\ASCOfficeUtilsLib.vcxproj", "{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Debug|x64.Build.0 = Debug|x64
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release|Win32.Build.0 = Release|Win32
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release|x64.ActiveCfg = Release|x64
|
||||
{D02A88E6-5B2B-4A15-A4F6-C057F698FC53}.Release|x64.Build.0 = Release|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|x64.Build.0 = Debug|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.Build.0 = Release|Win32
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|x64.ActiveCfg = Release|x64
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|x64.Build.0 = Release|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Debug|x64.Build.0 = Debug|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|Win32.Build.0 = Release|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|x64.ActiveCfg = Release|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|x64.Build.0 = Release|x64
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|Win32.Build.0 = Release|Win32
|
||||
{DC24710E-8DF2-4A7A-B7C3-2313E294143C}.Release|x64.ActiveCfg = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.Build.0 = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.ActiveCfg = Release|Win32
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Debug|x64.Build.0 = Debug|x64
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Release|Win32.Build.0 = Release|Win32
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Release|x64.ActiveCfg = Release|x64
|
||||
{3F3CB5A1-BB01-49C1-9342-4A69E30F9EF6}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(DPCodeReviewSolutionGUID) = preSolution
|
||||
DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@ -38,80 +38,61 @@ namespace Writers
|
||||
{
|
||||
class ChartWriter
|
||||
{
|
||||
class ChartElem
|
||||
struct _chartElem
|
||||
{
|
||||
public:
|
||||
std::wstring content;
|
||||
std::wstring filename;
|
||||
int index;
|
||||
std::wstring content;
|
||||
std::wstring filename;
|
||||
int index;
|
||||
};
|
||||
std::vector<ChartElem*> m_aCharts;
|
||||
ContentTypesWriter& m_oContentTypesWriter;
|
||||
int nChartCount;
|
||||
std::vector<_chartElem> m_aCharts;
|
||||
public:
|
||||
std::wstring m_sDir;
|
||||
public:
|
||||
ChartWriter(std::wstring sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
|
||||
int nEmbeddedCount;
|
||||
|
||||
ChartWriter(std::wstring sDir) : m_sDir(sDir)
|
||||
{
|
||||
nChartCount = 0;
|
||||
nEmbeddedCount = 1000;
|
||||
}
|
||||
~ChartWriter()
|
||||
{
|
||||
for(int i = 0, length = m_aCharts.size(); i < length; ++i)
|
||||
{
|
||||
delete m_aCharts[i];
|
||||
}
|
||||
}
|
||||
bool IsEmpty()
|
||||
{
|
||||
return 0 == m_aCharts.size();
|
||||
}
|
||||
void Write()
|
||||
bool Write()
|
||||
{
|
||||
if(false == IsEmpty())
|
||||
if(IsEmpty()) return false;
|
||||
|
||||
OOX::CPath pathChartDir = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("charts");
|
||||
|
||||
for(size_t i = 0; i < m_aCharts.size(); ++i)
|
||||
{
|
||||
OOX::CPath pathChartDir = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("charts");
|
||||
NSDirectory::CreateDirectory(pathChartDir.GetPath());
|
||||
_chartElem & elem = m_aCharts[i];
|
||||
|
||||
for(int i = 0, length = m_aCharts.size(); i < length; ++i)
|
||||
{
|
||||
ChartElem* elem = m_aCharts[i];
|
||||
OOX::CPath filePath = pathChartDir + FILE_SEPARATOR_STR + elem.filename;
|
||||
|
||||
OOX::CPath filePath = pathChartDir + FILE_SEPARATOR_STR + elem->filename;
|
||||
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(filePath.GetPath());
|
||||
oFile.WriteStringUTF8(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n");
|
||||
oFile.WriteStringUTF8(elem->content);
|
||||
oFile.CloseFile();
|
||||
|
||||
//Content_Types
|
||||
std::wstring sRelPath = L"/word/charts/" + elem->filename;
|
||||
m_oContentTypesWriter.AddOverride(sRelPath, L"application/vnd.openxmlformats-officedocument.drawingml.chart+xml");
|
||||
}
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(filePath.GetPath());
|
||||
oFile.WriteStringUTF8(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n");
|
||||
oFile.WriteStringUTF8(elem.content);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
void AddChart(std::wstring& content, std::wstring& sRelsName, std::wstring& sFileName, int& index)
|
||||
void AddChart(std::wstring& content, std::wstring& sRelsName, std::wstring& sFileName, int index)
|
||||
{
|
||||
ChartElem* pChartElem = new ChartElem();
|
||||
pChartElem->content = content;
|
||||
pChartElem->index = nChartCount + 1;
|
||||
nChartCount++;
|
||||
pChartElem->filename = L"chart" + std::to_wstring(pChartElem->index) + L".xml";
|
||||
_chartElem oChartElem;
|
||||
|
||||
sRelsName = L"charts/" + pChartElem->filename;
|
||||
sFileName = pChartElem->filename;
|
||||
index = pChartElem->index;
|
||||
oChartElem.content = content;
|
||||
oChartElem.index = index;
|
||||
|
||||
oChartElem.filename = L"chart" + std::to_wstring(oChartElem.index) + L".xml";
|
||||
|
||||
sRelsName = L"charts/" + oChartElem.filename;
|
||||
sFileName = oChartElem.filename;
|
||||
|
||||
m_aCharts.push_back(pChartElem);
|
||||
}
|
||||
int getChartCount()
|
||||
{
|
||||
return nChartCount;
|
||||
}
|
||||
void setChartCount(int val)
|
||||
{
|
||||
nChartCount = val;
|
||||
m_aCharts.push_back(oChartElem);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -46,20 +46,19 @@ namespace Writers
|
||||
class CommentsWriter
|
||||
{
|
||||
std::wstring m_sDir;
|
||||
ContentTypesWriter& m_oContentTypesWriter;
|
||||
public:
|
||||
std::wstring m_sComment;
|
||||
std::wstring m_sCommentExt;
|
||||
std::wstring m_sPeople;
|
||||
public:
|
||||
CommentsWriter(std::wstring sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
|
||||
std::wstring m_sComment;
|
||||
std::wstring m_sCommentExt;
|
||||
std::wstring m_sPeople;
|
||||
|
||||
CommentsWriter(std::wstring sDir) : m_sDir(sDir)
|
||||
{
|
||||
}
|
||||
void setElements(std::wstring& sComment, std::wstring& sCommentExt, std::wstring& sPeople)
|
||||
{
|
||||
m_sComment = sComment;
|
||||
m_sCommentExt = sCommentExt;
|
||||
m_sPeople = sPeople;
|
||||
m_sComment = sComment;
|
||||
m_sCommentExt = sCommentExt;
|
||||
m_sPeople = sPeople;
|
||||
}
|
||||
void Write()
|
||||
{
|
||||
@ -67,42 +66,30 @@ namespace Writers
|
||||
{
|
||||
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("comments.xml");
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(filePath.GetPath());
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(filePath.GetPath());
|
||||
oFile.WriteStringUTF8(g_string_comment_Start);
|
||||
oFile.WriteStringUTF8(m_sComment);
|
||||
oFile.WriteStringUTF8(g_string_comment_End);
|
||||
oFile.CloseFile();
|
||||
|
||||
//Content_Types
|
||||
m_oContentTypesWriter.AddOverride(std::wstring(_T("/word/comments.xml")), std::wstring(_T("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml")));
|
||||
|
||||
//Rels
|
||||
//m_oDocumentRelsWriter.AddRels(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"), _T("comments.xml"));
|
||||
}
|
||||
if(false == m_sCommentExt.empty())
|
||||
{
|
||||
CFile oFile;
|
||||
oFile.CreateFile(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("commentsExtended.xml"));
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("commentsExtended.xml"));
|
||||
oFile.WriteStringUTF8(g_string_commentExt_Start);
|
||||
oFile.WriteStringUTF8(m_sCommentExt);
|
||||
oFile.WriteStringUTF8(g_string_commentExt_End);
|
||||
oFile.CloseFile();
|
||||
|
||||
//Content_Types
|
||||
m_oContentTypesWriter.AddOverride(std::wstring(_T("/word/commentsExtended.xml")), std::wstring(_T("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml")));
|
||||
}
|
||||
if(false == m_sPeople.empty())
|
||||
{
|
||||
CFile oFile;
|
||||
oFile.CreateFile(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("people.xml"));
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("people.xml"));
|
||||
oFile.WriteStringUTF8(g_string_people_Start);
|
||||
oFile.WriteStringUTF8(m_sPeople);
|
||||
oFile.WriteStringUTF8(g_string_people_End);
|
||||
oFile.CloseFile();
|
||||
|
||||
//Content_Types
|
||||
m_oContentTypesWriter.AddOverride(std::wstring(_T("/word/people.xml")), std::wstring(_T("application/vnd.openxmlformats-officedocument.wordprocessingml.people+xml")));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,80 +0,0 @@
|
||||
/*
|
||||
* (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
|
||||
*
|
||||
*/
|
||||
#ifndef CONTENT_TYPES_WRITER
|
||||
#define CONTENT_TYPES_WRITER
|
||||
|
||||
#include "../../XlsxSerializerCom/Common/Common.h"
|
||||
|
||||
namespace Writers
|
||||
{
|
||||
static std::wstring g_string_ct_Start = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">";
|
||||
static std::wstring g_string_ct_Ext = L"<Default Extension=\"bin\" ContentType=\"application/vnd.openxmlformats-officedocument.oleObject\"/><Default Extension=\"bmp\" ContentType=\"image/bmp\"/><Default Extension=\"jpg\" ContentType=\"image/jpeg\"/><Default Extension=\"jpeg\" ContentType=\"image/jpeg\"/><Default Extension=\"jpe\" ContentType=\"image/jpeg\"/><Default Extension=\"png\" ContentType=\"image/png\"/><Default Extension=\"gif\" ContentType=\"image/gif\"/><Default Extension=\"emf\" ContentType=\"image/x-emf\"/><Default Extension=\"wmf\" ContentType=\"image/x-wmf\"/><Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/><Default Extension=\"xml\" ContentType=\"application/xml\"/><Default Extension=\"xlsx\" ContentType=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"/>";
|
||||
static std::wstring g_string_ct_Override = L"<Override PartName=\"/word/document.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\"/><Override PartName=\"/word/styles.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml\"/><Override PartName=\"/word/settings.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml\"/><Override PartName=\"/word/webSettings.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml\"/><Override PartName=\"/word/fontTable.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml\"/><Override PartName=\"/word/theme/theme1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/><Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\"/><Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\"/>";
|
||||
static std::wstring g_string_ct_End = L"</Types>";
|
||||
|
||||
class ContentTypesWriter
|
||||
{
|
||||
XmlUtils::CStringWriter m_oWriter;
|
||||
std::wstring m_sDir;
|
||||
XmlUtils::CStringWriter m_oAdditional;
|
||||
public:
|
||||
ContentTypesWriter(std::wstring sDir) : m_sDir(sDir)
|
||||
{
|
||||
}
|
||||
void Write()
|
||||
{
|
||||
m_oWriter.WriteString(g_string_ct_Start);
|
||||
m_oWriter.WriteString(g_string_ct_Ext);
|
||||
m_oWriter.WriteString(g_string_ct_Override);
|
||||
m_oWriter.Write(m_oAdditional);
|
||||
m_oWriter.WriteString(g_string_ct_End);
|
||||
|
||||
OOX::CPath filePath = m_sDir + L"/[Content_Types].xml";
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(filePath.GetPath());
|
||||
|
||||
oFile.WriteStringUTF8(m_oWriter.GetData());
|
||||
oFile.CloseFile();
|
||||
}
|
||||
void AddOverride(const std::wstring& PartName, const std::wstring& ContentType)
|
||||
{
|
||||
std::wstring sOverride = L"<Override PartName=\"" + PartName+ L"\" ContentType=\"" + ContentType + L"\"/>";
|
||||
m_oAdditional.WriteString(sOverride);
|
||||
}
|
||||
void AddOverrideRaw(const std::wstring& sXml)
|
||||
{
|
||||
m_oAdditional.WriteString(sXml);
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif // #ifndef CONTENT_TYPES_WRITER
|
||||
@ -39,15 +39,16 @@ namespace Writers
|
||||
class DefaultThemeWriter
|
||||
{
|
||||
public:
|
||||
DefaultThemeWriter()
|
||||
std::wstring m_sContent;
|
||||
|
||||
DefaultThemeWriter( )
|
||||
{
|
||||
}
|
||||
void Write(std::wstring sThemeFilePath)
|
||||
{
|
||||
std::wstring s_Common;
|
||||
|
||||
s_Common = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?> \
|
||||
<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\"> \
|
||||
if (m_sContent.empty())
|
||||
{
|
||||
m_sContent = _T("<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\">\
|
||||
<a:themeElements> \
|
||||
<a:clrScheme name=\"Office\"> \
|
||||
<a:dk1> \
|
||||
@ -87,7 +88,7 @@ namespace Writers
|
||||
<a:srgbClr val=\"800080\"/> \
|
||||
</a:folHlink> \
|
||||
</a:clrScheme> ");
|
||||
s_Common +=
|
||||
m_sContent +=
|
||||
_T("<a:fontScheme name=\"Office\"> \
|
||||
<a:majorFont> \
|
||||
<a:latin typeface=\"Cambria\"/> \
|
||||
@ -158,7 +159,7 @@ s_Common +=
|
||||
<a:font script=\"Uigh\" typeface=\"Microsoft Uighur\"/> \
|
||||
</a:minorFont> \
|
||||
</a:fontScheme>");
|
||||
s_Common +=
|
||||
m_sContent +=
|
||||
_T("<a:fmtScheme name=\"Office\"> \
|
||||
<a:fillStyleLst> \
|
||||
<a:solidFill> \
|
||||
@ -329,13 +330,14 @@ s_Common +=
|
||||
<a:objectDefaults/> \
|
||||
<a:extraClrSchemeLst/> \
|
||||
</a:theme>");
|
||||
|
||||
}
|
||||
|
||||
OOX::CPath fileName = sThemeFilePath;
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(fileName.GetPath());
|
||||
oFile.WriteStringUTF8(s_Common);
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(fileName.GetPath());
|
||||
oFile.WriteStringUTF8(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
|
||||
oFile.WriteStringUTF8(m_sContent);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
};
|
||||
|
||||
@ -56,8 +56,8 @@ namespace Writers
|
||||
|
||||
OOX::CPath fileName = m_sDir + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR + _T(".rels");
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(fileName.GetPath());
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(fileName.GetPath());
|
||||
oFile.WriteStringUTF8(s_Common);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
|
||||
@ -33,35 +33,52 @@
|
||||
#define DOCUMENT_WRITER
|
||||
|
||||
#include "../../XlsxSerializerCom/Common/Common.h"
|
||||
#include "../BinWriter/BinReaderWriterDefines.h";
|
||||
#include "../BinWriter/BinReaderWriterDefines.h"
|
||||
|
||||
namespace Writers
|
||||
{
|
||||
class DocumentWriter : public ContentWriter
|
||||
{
|
||||
XmlUtils::CStringWriter m_oWriter;
|
||||
HeaderFooterWriter& m_oHeaderFooterWriter;
|
||||
HeaderFooterWriter& m_oHeaderFooterWriter;
|
||||
public:
|
||||
std::wstring m_sDir;
|
||||
public:
|
||||
DocumentWriter( std::wstring sDir, HeaderFooterWriter& oHeaderFooterWriter):m_sDir(sDir), m_oHeaderFooterWriter(oHeaderFooterWriter)
|
||||
std::wstring m_sDir;
|
||||
|
||||
DocumentWriter( std::wstring sDir, HeaderFooterWriter& oHeaderFooterWriter):m_sDir(sDir), m_oHeaderFooterWriter(oHeaderFooterWriter)
|
||||
{
|
||||
}
|
||||
void Write()
|
||||
{
|
||||
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + _T("word") +FILE_SEPARATOR_STR + _T("document.xml");
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(filePath.GetPath());
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(filePath.GetPath());
|
||||
oFile.WriteStringUTF8( std::wstring(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>")));
|
||||
oFile.WriteStringUTF8( std::wstring(_T("<w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">")));
|
||||
oFile.WriteStringUTF8( std::wstring(_T("<w:document \
|
||||
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
|
||||
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
|
||||
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
|
||||
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
|
||||
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
|
||||
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
|
||||
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
|
||||
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
|
||||
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
|
||||
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
|
||||
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
|
||||
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
|
||||
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
|
||||
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
|
||||
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
|
||||
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
|
||||
mc:Ignorable=\"w14 wp14\">")));
|
||||
|
||||
oFile.WriteStringUTF8(m_oBackground.GetData());
|
||||
|
||||
oFile.WriteStringUTF8( std::wstring(_T("<w:body>")));
|
||||
oFile.WriteStringUTF8(m_oContent.GetData());
|
||||
|
||||
oFile.WriteStringUTF8( std::wstring(_T("<w:sectPr >")));
|
||||
oFile.WriteStringUTF8( std::wstring(_T("<w:sectPr>")));
|
||||
oFile.WriteStringUTF8(WriteSectPrHdrFtr());
|
||||
oFile.WriteStringUTF8(m_oSecPr.GetData());
|
||||
oFile.WriteStringUTF8( std::wstring(_T("</w:sectPr>")));
|
||||
@ -78,7 +95,7 @@ namespace Writers
|
||||
if(BinDocxRW::g_nCurFormatVersion < 5)
|
||||
{
|
||||
bool bTitlePage = false;
|
||||
for(int i = 0, length = m_oHeaderFooterWriter.m_aHeaders.size(); i < length; ++i)
|
||||
for(size_t i = 0, length = m_oHeaderFooterWriter.m_aHeaders.size(); i < length; ++i)
|
||||
{
|
||||
HdrFtrItem* pHeader = m_oHeaderFooterWriter.m_aHeaders[i];
|
||||
if(false == pHeader->rId.empty())
|
||||
@ -98,7 +115,7 @@ namespace Writers
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = 0, length = m_oHeaderFooterWriter.m_aFooters.size(); i < length; ++i)
|
||||
for(size_t i = 0, length = m_oHeaderFooterWriter.m_aFooters.size(); i < length; ++i)
|
||||
{
|
||||
HdrFtrItem* pFooter = m_oHeaderFooterWriter.m_aFooters[i];
|
||||
if(false == pFooter->rId.empty())
|
||||
|
||||
@ -32,6 +32,9 @@
|
||||
#ifndef FILE_WRITER
|
||||
#define FILE_WRITER
|
||||
|
||||
#include "../../DesktopEditor/common/Path.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Media/VbaProject.h"
|
||||
|
||||
#include "NumberingWriter.h"
|
||||
#include "fontTableWriter.h"
|
||||
#include "HeaderFooterWriter.h"
|
||||
@ -45,19 +48,21 @@
|
||||
#include "webSettingsWriter.h"
|
||||
#include "DefaultThemeWriter.h"
|
||||
|
||||
namespace BinDocxRW {
|
||||
namespace BinDocxRW
|
||||
{
|
||||
class CComments;
|
||||
}
|
||||
|
||||
namespace NSBinPptxRW
|
||||
{
|
||||
class CDrawingConverter;
|
||||
}
|
||||
|
||||
namespace Writers
|
||||
{
|
||||
class FileWriter
|
||||
{
|
||||
public:
|
||||
NSBinPptxRW::CDrawingConverter* m_pDrawingConverter;
|
||||
std::wstring m_sThemePath;
|
||||
bool m_bSaveChartAsImg;
|
||||
|
||||
ContentTypesWriter m_oContentTypesWriter;
|
||||
public:
|
||||
FontTableWriter m_oFontTableWriter;
|
||||
DocumentWriter m_oDocumentWriter;
|
||||
MediaWriter m_oMediaWriter;
|
||||
@ -71,35 +76,59 @@ namespace Writers
|
||||
ChartWriter m_oChartWriter;
|
||||
DocumentRelsWriter m_oDocumentRelsWriter;
|
||||
WebSettingsWriter m_oWebSettingsWriter;
|
||||
DefaultThemeWriter m_oDefaultTheme;
|
||||
DefaultThemeWriter m_oTheme;
|
||||
|
||||
int m_nDocPrIndex;
|
||||
BinDocxRW::CComments* m_pComments;
|
||||
public:
|
||||
FileWriter(std::wstring sDirOutput,std::wstring sFontDir, bool bNoFontDir, int nVersion, bool bSaveChartAsImg, NSBinPptxRW::CDrawingConverter* pDrawingConverter, std::wstring sThemePath):
|
||||
m_pDrawingConverter(pDrawingConverter),m_sThemePath(sThemePath),m_bSaveChartAsImg(bSaveChartAsImg),
|
||||
m_oContentTypesWriter(sDirOutput), m_oFontTableWriter(sDirOutput, sFontDir, bNoFontDir),
|
||||
m_oHeaderFooterWriter(sDirOutput, m_oContentTypesWriter),
|
||||
m_oFootnotesWriter(sDirOutput, m_oContentTypesWriter),
|
||||
m_oEndnotesWriter(sDirOutput, m_oContentTypesWriter),
|
||||
m_oMediaWriter(sDirOutput),
|
||||
m_oStylesWriter(sDirOutput, nVersion),
|
||||
m_oNumberingWriter(sDirOutput, m_oContentTypesWriter),
|
||||
m_oDocumentWriter(sDirOutput, m_oHeaderFooterWriter),
|
||||
m_oSettingWriter(sDirOutput, m_oHeaderFooterWriter),
|
||||
m_oCommentsWriter(sDirOutput, m_oContentTypesWriter),
|
||||
m_oChartWriter(sDirOutput, m_oContentTypesWriter),
|
||||
m_oDocumentRelsWriter(sDirOutput),
|
||||
m_oWebSettingsWriter(sDirOutput),
|
||||
smart_ptr<OOX::VbaProject> m_pVbaProject;
|
||||
|
||||
NSBinPptxRW::CDrawingConverter* m_pDrawingConverter;
|
||||
bool m_bSaveChartAsImg;
|
||||
std::wstring m_sThemePath;
|
||||
int m_nDocPrIndex;
|
||||
BinDocxRW::CComments* m_pComments;
|
||||
|
||||
FileWriter (std::wstring sDirOutput,std::wstring sFontDir, bool bNoFontDir, int nVersion, bool bSaveChartAsImg, NSBinPptxRW::CDrawingConverter* pDrawingConverter, std::wstring sThemePath)
|
||||
: m_pDrawingConverter(pDrawingConverter), m_sThemePath(sThemePath), m_bSaveChartAsImg(bSaveChartAsImg),
|
||||
m_oFontTableWriter (sDirOutput, sFontDir, bNoFontDir),
|
||||
m_oHeaderFooterWriter (sDirOutput),
|
||||
m_oFootnotesWriter (sDirOutput),
|
||||
m_oEndnotesWriter (sDirOutput),
|
||||
m_oMediaWriter (sDirOutput),
|
||||
m_oStylesWriter (sDirOutput, nVersion),
|
||||
m_oNumberingWriter (sDirOutput),
|
||||
m_oDocumentWriter (sDirOutput, m_oHeaderFooterWriter),
|
||||
m_oSettingWriter (sDirOutput, m_oHeaderFooterWriter),
|
||||
m_oCommentsWriter (sDirOutput),
|
||||
m_oChartWriter (sDirOutput),
|
||||
m_oDocumentRelsWriter (sDirOutput),
|
||||
m_oWebSettingsWriter (sDirOutput),
|
||||
m_nDocPrIndex(0),
|
||||
m_pComments(NULL)
|
||||
{
|
||||
}
|
||||
public: int getNextDocPr()
|
||||
{
|
||||
m_nDocPrIndex++;
|
||||
return m_nDocPrIndex;
|
||||
}
|
||||
int getNextDocPr()
|
||||
{
|
||||
m_nDocPrIndex++;
|
||||
return m_nDocPrIndex;
|
||||
}
|
||||
|
||||
void Write()
|
||||
{
|
||||
m_oCommentsWriter.Write();
|
||||
m_oChartWriter.Write();
|
||||
m_oStylesWriter.Write();
|
||||
m_oNumberingWriter.Write();
|
||||
m_oFontTableWriter.Write();
|
||||
m_oHeaderFooterWriter.Write();
|
||||
m_oFootnotesWriter.Write();
|
||||
m_oEndnotesWriter.Write();
|
||||
//Setting пишем после HeaderFooter, чтобы заполнить evenAndOddHeaders
|
||||
m_oSettingWriter.Write();
|
||||
m_oWebSettingsWriter.Write();
|
||||
//Document пишем после HeaderFooter, чтобы заполнить sectPr
|
||||
m_oDocumentWriter.Write();
|
||||
//Rels и ContentTypes пишем в конце
|
||||
m_oDocumentRelsWriter.Write();
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif // #ifndef FILE_WRITER
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#define HEADER_FOOTER_WRITER
|
||||
|
||||
#include "../../XlsxSerializerCom/Common/Common.h"
|
||||
#include "../../Common/DocxFormat/Source/Common/SimpleTypes_Word.h"
|
||||
|
||||
namespace Writers
|
||||
{
|
||||
@ -54,51 +55,85 @@ namespace Writers
|
||||
{
|
||||
return m_sFilename.empty();
|
||||
}
|
||||
std::wstring m_sFilename;
|
||||
ContentWriter Header;
|
||||
std::wstring rId;
|
||||
SimpleTypes::EHdrFtr eType;
|
||||
std::wstring m_sFilename;
|
||||
ContentWriter Header;
|
||||
std::wstring rId;
|
||||
SimpleTypes::EHdrFtr eType;
|
||||
};
|
||||
static std::wstring g_string_hdr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:hdr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
|
||||
static std::wstring g_string_hdr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<w:hdr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
|
||||
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
|
||||
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
|
||||
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
|
||||
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
|
||||
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
|
||||
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
|
||||
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
|
||||
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
|
||||
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
|
||||
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
|
||||
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
|
||||
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
|
||||
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
|
||||
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
|
||||
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
|
||||
mc:Ignorable=\"w14 wp14\">");
|
||||
static std::wstring g_string_hdr_End = _T("</w:hdr>");
|
||||
|
||||
static std::wstring g_string_ftr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:ftr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
|
||||
static std::wstring g_string_ftr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
|
||||
<w:ftr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
|
||||
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
|
||||
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
|
||||
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
|
||||
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
|
||||
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
|
||||
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
|
||||
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
|
||||
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
|
||||
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
|
||||
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
|
||||
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
|
||||
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
|
||||
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
|
||||
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
|
||||
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
|
||||
mc:Ignorable=\"w14 wp14\">");
|
||||
static std::wstring g_string_ftr_End = _T("</w:ftr>");
|
||||
|
||||
static std::wstring g_string_footnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:footnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
|
||||
static std::wstring g_string_footnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:footnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" mc:Ignorable=\"w14 wp14\">");
|
||||
static std::wstring g_string_footnotes_End = _T("</w:footnotes>");
|
||||
|
||||
static std::wstring g_string_endnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:endnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
|
||||
static std::wstring g_string_endnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:endnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" mc:Ignorable=\"w14 wp14\">");
|
||||
static std::wstring g_string_endnotes_End = _T("</w:endnotes>");
|
||||
|
||||
class HeaderFooterWriter
|
||||
{
|
||||
std::wstring m_sDir;
|
||||
ContentTypesWriter& m_oContentTypesWriter;
|
||||
public:
|
||||
std::vector<HdrFtrItem*> m_aHeaders;
|
||||
std::vector<HdrFtrItem*> m_aFooters;
|
||||
public:
|
||||
HeaderFooterWriter( std::wstring sDir, ContentTypesWriter& oContentTypesWriter) : m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
|
||||
|
||||
HeaderFooterWriter( std::wstring sDir) : m_sDir(sDir)
|
||||
{
|
||||
}
|
||||
~HeaderFooterWriter()
|
||||
{
|
||||
for(int i = 0, length = m_aHeaders.size(); i < length; ++i)
|
||||
for(size_t i = 0, length = m_aHeaders.size(); i < length; ++i)
|
||||
delete m_aHeaders[i];
|
||||
m_aHeaders.clear();
|
||||
for(int i = 0, length = m_aFooters.size(); i < length; ++i)
|
||||
|
||||
for(size_t i = 0, length = m_aFooters.size(); i < length; ++i)
|
||||
delete m_aFooters[i];
|
||||
m_aFooters.clear();
|
||||
}
|
||||
void Write()
|
||||
{
|
||||
for(int i = 0, length = m_aHeaders.size(); i < length; ++i)
|
||||
for(size_t i = 0, length = m_aHeaders.size(); i < length; ++i)
|
||||
{
|
||||
HdrFtrItem* pHeader = m_aHeaders[i];
|
||||
WriteItem(_T("header"), pHeader->m_sFilename, pHeader->Header, true);
|
||||
}
|
||||
for(int i = 0, length = m_aFooters.size(); i < length; ++i)
|
||||
for(size_t i = 0, length = m_aFooters.size(); i < length; ++i)
|
||||
{
|
||||
HdrFtrItem* pFooter = m_aFooters[i];
|
||||
WriteItem(_T("footer"), pFooter->m_sFilename, pFooter->Header, false);
|
||||
@ -108,8 +143,8 @@ namespace Writers
|
||||
{
|
||||
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + sFilename;
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(filePath.GetPath());
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(filePath.GetPath());
|
||||
|
||||
if(bHeader)
|
||||
oFile.WriteStringUTF8(g_string_hdr_Start);
|
||||
@ -121,43 +156,33 @@ namespace Writers
|
||||
else
|
||||
oFile.WriteStringUTF8(g_string_ftr_End);
|
||||
oFile.CloseFile();
|
||||
|
||||
//Content_Types
|
||||
m_oContentTypesWriter.AddOverride(L"/word/" + sFilename, L"application/vnd.openxmlformats-officedocument.wordprocessingml." + sHeader + L"+xml");
|
||||
|
||||
//Rels
|
||||
//return m_oDocumentRelsWriter.AddRels(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/") + sHeader, sFilename);
|
||||
}
|
||||
};
|
||||
class FootnotesWriter
|
||||
{
|
||||
std::wstring m_sDir;
|
||||
ContentTypesWriter& m_oContentTypesWriter;
|
||||
public:
|
||||
ContentWriter m_oNotesWriter;
|
||||
FootnotesWriter( std::wstring sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
|
||||
|
||||
FootnotesWriter( std::wstring sDir ):m_sDir(sDir)
|
||||
{
|
||||
}
|
||||
void Write()
|
||||
{
|
||||
if(!IsEmpty())
|
||||
{
|
||||
std::wstring sFilename = getFilename();
|
||||
if(IsEmpty()) return;
|
||||
|
||||
std::wstring filePath = m_sDir + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR + sFilename;
|
||||
std::wstring sFilename = getFilename();
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(filePath);
|
||||
oFile.WriteStringUTF8(g_string_footnotes_Start);
|
||||
oFile.WriteStringUTF8(m_oNotesWriter.m_oContent.GetData());
|
||||
oFile.WriteStringUTF8(g_string_footnotes_End);
|
||||
oFile.CloseFile();
|
||||
std::wstring filePath = m_sDir + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR + sFilename;
|
||||
|
||||
//ContentType
|
||||
m_oContentTypesWriter.AddOverride(L"/word/" + sFilename, L"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml");
|
||||
}
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW (filePath);
|
||||
oFile.WriteStringUTF8 (g_string_footnotes_Start);
|
||||
oFile.WriteStringUTF8 (m_oNotesWriter.m_oContent.GetData());
|
||||
oFile.WriteStringUTF8 (g_string_footnotes_End);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
std::wstring getFilename()
|
||||
std::wstring getFilename()
|
||||
{
|
||||
return _T("footnotes.xml");
|
||||
}
|
||||
@ -168,33 +193,29 @@ namespace Writers
|
||||
};
|
||||
class EndnotesWriter
|
||||
{
|
||||
std::wstring m_sDir;
|
||||
ContentTypesWriter& m_oContentTypesWriter;
|
||||
std::wstring m_sDir;
|
||||
public:
|
||||
ContentWriter m_oNotesWriter;
|
||||
EndnotesWriter( std::wstring sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
|
||||
|
||||
EndnotesWriter( std::wstring sDir ) : m_sDir(sDir)
|
||||
{
|
||||
}
|
||||
void Write()
|
||||
{
|
||||
if(!IsEmpty())
|
||||
{
|
||||
std::wstring sFilename = getFilename();
|
||||
if(IsEmpty()) return;
|
||||
|
||||
std::wstring filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + sFilename;
|
||||
std::wstring sFilename = getFilename();
|
||||
|
||||
CFile oFile;
|
||||
oFile.CreateFile(filePath);
|
||||
oFile.WriteStringUTF8(g_string_endnotes_Start);
|
||||
oFile.WriteStringUTF8(m_oNotesWriter.m_oContent.GetData());
|
||||
oFile.WriteStringUTF8(g_string_endnotes_End);
|
||||
oFile.CloseFile();
|
||||
std::wstring filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + sFilename;
|
||||
|
||||
//ContentType
|
||||
m_oContentTypesWriter.AddOverride(_T("/word/") + sFilename, _T("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"));
|
||||
}
|
||||
NSFile::CFileBinary oFile;
|
||||
oFile.CreateFileW(filePath);
|
||||
oFile.WriteStringUTF8(g_string_endnotes_Start);
|
||||
oFile.WriteStringUTF8(m_oNotesWriter.m_oContent.GetData());
|
||||
oFile.WriteStringUTF8(g_string_endnotes_End);
|
||||
oFile.CloseFile();
|
||||
}
|
||||
std::wstring getFilename()
|
||||
std::wstring getFilename()
|
||||
{
|
||||
return _T("endnotes.xml");
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user