mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Compare commits
577 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da3a6b3189 | |||
| 81e03f64db | |||
| 0aed94b748 | |||
| 5af4ebba9e | |||
| a8f0c12d0f | |||
| e5351899c5 | |||
| fa094e152c | |||
| a69bff9e4e | |||
| 9b5fbdfa96 | |||
| 55f026bac4 | |||
| 63b2ddfff3 | |||
| 0cad3436fd | |||
| 8aa54ed2e2 | |||
| efb1511c59 | |||
| 34e9d98bee | |||
| b25c3d3022 | |||
| 2de73e8c02 | |||
| fb04ac8a69 | |||
| a4b767303d | |||
| 4b86a6384b | |||
| 889721fd7e | |||
| 1df71c6504 | |||
| f354046cc5 | |||
| b27a36246d | |||
| 74615f508e | |||
| 204696035d | |||
| cbd5d75532 | |||
| 26be4d9b20 | |||
| 6c146707f0 | |||
| cd0c129afb | |||
| 083304c9a3 | |||
| 89fac276c1 | |||
| d322c08d98 | |||
| e175b310f5 | |||
| fe5f52b7c2 | |||
| 7df8eacf0e | |||
| 3d71c4e609 | |||
| 65a203838b | |||
| 8301f402c5 | |||
| caab9eae47 | |||
| f5282fdc98 | |||
| d560fcc0a8 | |||
| 9ca7cc5008 | |||
| 56c3301e54 | |||
| 23bf5cb929 | |||
| 0b1c7f2642 | |||
| b0d0186dd4 | |||
| d72d114f19 | |||
| a0cf3f13c3 | |||
| d400135f60 | |||
| 856933b884 | |||
| eab909f76b | |||
| 30799c7b8c | |||
| c3246cf089 | |||
| 8032ffa3fd | |||
| a6e490f70a | |||
| e72ad2def4 | |||
| cfce809885 | |||
| 760242fa4d | |||
| c257b901ac | |||
| 1873515006 | |||
| cb76784260 | |||
| 4982e1e1ed | |||
| c087e9e9e4 | |||
| 4dae14c0b0 | |||
| 798c8ee702 | |||
| f6974d1064 | |||
| 78289248c8 | |||
| bdbe8e811c | |||
| 5a0c45a87d | |||
| 13316ce210 | |||
| fb5ae0133c | |||
| 3c7cf1b061 | |||
| 31064ad4f2 | |||
| 579ac545a2 | |||
| f5c983c280 | |||
| 39cedff4ef | |||
| d22975e7e6 | |||
| 5dceb4b7db | |||
| 226a04adb6 | |||
| 8e055fba82 | |||
| 108ff55a61 | |||
| eaa3aa0e96 | |||
| 42ce6f11a5 | |||
| d1d2a13ea0 | |||
| d82cca8f9f | |||
| 99c2f645f4 | |||
| c7d7063297 | |||
| 4ee24be05f | |||
| 7c913592fd | |||
| cf16340335 | |||
| ed30c40f93 | |||
| 34b5b7c973 | |||
| 5333ce006d | |||
| 438989724f | |||
| b2c308fc71 | |||
| 70f2a11c75 | |||
| 1475162206 | |||
| 211ca6c9f7 | |||
| 1b5ec0a65c | |||
| c80406cee4 | |||
| 3a582632f2 | |||
| 0cadeb36da | |||
| 594737c899 | |||
| 238fc8969d | |||
| 1878b8fc33 | |||
| e82fd3c949 | |||
| 12b733c7ee | |||
| 482a9565eb | |||
| 636389cf04 | |||
| 05d0e8980f | |||
| be0cbaf0a2 | |||
| 9a07b8d4b2 | |||
| 1fc91b3a3c | |||
| ac3481ca16 | |||
| d4a6acac39 | |||
| 35c93fcbe9 | |||
| dfcacb08c7 | |||
| 00b306a24c | |||
| bb287c0ccc | |||
| e43158c3c7 | |||
| 722e3d307c | |||
| c1bda3059d | |||
| 52269454c6 | |||
| ee27029c26 | |||
| c87c8f2b4f | |||
| 3ed7ceb243 | |||
| 49e361476d | |||
| 029ea786ef | |||
| 3159d88bca | |||
| ac6c9e0d0b | |||
| 7c34ac7533 | |||
| 928f64d821 | |||
| 697c63f74e | |||
| fd8bc44647 | |||
| 1f61877c5f | |||
| 9fbba9f2a8 | |||
| 1ef57ca394 | |||
| 8c1853c65d | |||
| 165990c135 | |||
| 0fff666352 | |||
| 7fc15de8ce | |||
| 597326bddc | |||
| 4caed2c4cd | |||
| 3025d2281e | |||
| 5176d58940 | |||
| 2f6aebcad5 | |||
| f6b0d35e6e | |||
| c63c4ea729 | |||
| 0df69b205a | |||
| 52621c8bc7 | |||
| bafc91dd67 | |||
| beaa3b4494 | |||
| 1c8f05e0ce | |||
| 0dfbf40855 | |||
| d596a09c3f | |||
| 27ea7c9ffc | |||
| b5197ee222 | |||
| 457cfc29ed | |||
| 979f303d57 | |||
| fd3bfc0f5d | |||
| fe1e498125 | |||
| 0c2b6c7ac9 | |||
| 0b510a8d93 | |||
| 784fd18470 | |||
| c5bee8701d | |||
| b4e130c4d7 | |||
| ecb60a3452 | |||
| 70cfa996d1 | |||
| 18289bfdb4 | |||
| 43fcaadcb1 | |||
| 6b82644d77 | |||
| d3914f513b | |||
| 5c202eece6 | |||
| bd32484a1e | |||
| b4ae30d5b2 | |||
| 1ff71c824c | |||
| 7482463667 | |||
| d0cda627dd | |||
| 7df0bcea7f | |||
| 43429aa84b | |||
| b19bce8d30 | |||
| be8771f21b | |||
| 91af8c2b62 | |||
| 9917f7907d | |||
| 65d6a6f56d | |||
| 7e79a38520 | |||
| 55eb92bfc1 | |||
| bc8a66ccd7 | |||
| d0f7c93970 | |||
| fcf2742de3 | |||
| 8985173d4d | |||
| a1b4f43735 | |||
| 546a3e8a6c | |||
| 7a068930a8 | |||
| fdbc9334ca | |||
| d04e2158ca | |||
| 7abf16abe3 | |||
| 537eaf52fa | |||
| 94ea9c6d87 | |||
| 2d7a8a5b75 | |||
| 34407c4a1c | |||
| dd85d4263e | |||
| 8f534e9bff | |||
| 2f15678363 | |||
| a51a953d83 | |||
| 236667333c | |||
| 8d42cf008d | |||
| f422a6ed01 | |||
| 8962897eb7 | |||
| f99a3f9d74 | |||
| b908cb4d85 | |||
| 8f5d21945d | |||
| d19d447532 | |||
| f40e1997c9 | |||
| 344fe41905 | |||
| c46aa7a777 | |||
| ce2fb1d062 | |||
| 4f3879ae71 | |||
| 5e2e67db6e | |||
| a6968ce575 | |||
| 562e6a1bf5 | |||
| 15a3df0c50 | |||
| 1035103910 | |||
| 17e3a5d5cc | |||
| 90f659326b | |||
| aadd92f861 | |||
| e2d192a67d | |||
| 8e4b9bd04f | |||
| d3db4b428f | |||
| 71afd00742 | |||
| 5010aa346d | |||
| 8ecbc5b505 | |||
| 474242d241 | |||
| 96fa62ac80 | |||
| 818d813b98 | |||
| 1429fd87c2 | |||
| b542bae8fc | |||
| 9a6e7e2dc3 | |||
| cede0396c5 | |||
| b78ad9e751 | |||
| b9bfc60806 | |||
| 88b73c18a2 | |||
| d75f7675d5 | |||
| 23d217004f | |||
| 00de3e3d37 | |||
| 7ae49de02a | |||
| f93c317e7a | |||
| e258e9ba63 | |||
| c8b6532510 | |||
| 81e6c62c5a | |||
| 289fbd68b6 | |||
| 82b0045a98 | |||
| 8690a92afd | |||
| 6033e40cc9 | |||
| 99f7544762 | |||
| c58e69f4d1 | |||
| aff18b27d1 | |||
| 223a26df7f | |||
| c01c52da81 | |||
| 1f6b4b23e0 | |||
| 3e7732e2b2 | |||
| 6a8c6827a0 | |||
| 1f6707479e | |||
| a2eccad79e | |||
| 8bc6926391 | |||
| 01636d6f32 | |||
| 19e4bb58e5 | |||
| 2bcb58703c | |||
| 92033834cd | |||
| e05b881856 | |||
| e370c81b3b | |||
| 446f47a5e8 | |||
| 6724f57810 | |||
| cb4d5363f4 | |||
| f4dc89c7fe | |||
| 5594f48bdc | |||
| f0a65c6553 | |||
| 92119b07b7 | |||
| bb66fe9fc5 | |||
| 3807ac3bc2 | |||
| 08ef7e79a2 | |||
| 1308f051e5 | |||
| 1aeaa320a9 | |||
| 244ee7a2bd | |||
| 0469fe7b59 | |||
| 9977c2f4c2 | |||
| 0b1fa41c21 | |||
| bf1bcd40a2 | |||
| c1493bf1f4 | |||
| d7f080283b | |||
| 6d0da9364c | |||
| 981f48c49e | |||
| a378aa92b1 | |||
| 3fdefb4952 | |||
| bbeccbca46 | |||
| 549b8353e9 | |||
| 8ea92919c0 | |||
| 8c12c53e6e | |||
| a1b56ad817 | |||
| 63feee4774 | |||
| d517e8cf2a | |||
| ed87cc0047 | |||
| 289575b9cd | |||
| 4213824325 | |||
| 995b87e3bc | |||
| 75804f709e | |||
| 2e820186b5 | |||
| 31158a5f5b | |||
| 536337f50d | |||
| ad75893298 | |||
| 7375130f0f | |||
| 387f411ae0 | |||
| 2ed60fea2b | |||
| f9651c90ee | |||
| ab4ac2b7c0 | |||
| 1736e169cf | |||
| f640bef308 | |||
| 03fc3a4426 | |||
| 315204b20d | |||
| 6a099ce6d4 | |||
| 9fbda8fb64 | |||
| e59dba4519 | |||
| 95c844630e | |||
| c5c6d3d5dd | |||
| 7a6c2b058d | |||
| 2281e35cda | |||
| 2cf3c85d67 | |||
| cb77881c6a | |||
| d53184868d | |||
| 95b84f314f | |||
| e7b960c74d | |||
| 0a65c6b5f4 | |||
| ebbbfe51a5 | |||
| 7cf83f1d85 | |||
| 9a3fa3ef2a | |||
| 469c077079 | |||
| 31b326da5a | |||
| 162b520374 | |||
| 803d216e53 | |||
| 2703621d01 | |||
| 38709cbc15 | |||
| 380a4c2e1a | |||
| 52c72bf6a2 | |||
| d8f57d3b9b | |||
| 8a5af04247 | |||
| 4347807ca1 | |||
| 1b835cde13 | |||
| 3b5673220e | |||
| 877efea69d | |||
| db6c71a1e6 | |||
| 6e000bf3f4 | |||
| fcaf871c48 | |||
| 61d953d370 | |||
| 33f065f649 | |||
| 072b887a21 | |||
| e0e4d2f6cb | |||
| 24e08cee67 | |||
| c2ba4614d4 | |||
| ae7fa7d1aa | |||
| 31ccfafc84 | |||
| 816d91b328 | |||
| 2f82b50cfc | |||
| de49cc012f | |||
| 09370f1dcc | |||
| 13a192b77b | |||
| 6b194a1e97 | |||
| 235bd4af94 | |||
| 65d502d36f | |||
| 0a26bab1a2 | |||
| 4d538e3439 | |||
| ae8807041e | |||
| ba0359e3d1 | |||
| e664bc77a0 | |||
| fbf77242de | |||
| 54b3fc1866 | |||
| e49f1a481c | |||
| 76bcd744e0 | |||
| 1f9078d5fb | |||
| dab91f313e | |||
| 34c4fbee25 | |||
| d152746a58 | |||
| 66dbc15f86 | |||
| f9876cfaf5 | |||
| fed80cf2fa | |||
| 68e5ceb928 | |||
| 39fd527e89 | |||
| b27a22038a | |||
| b6ec92a557 | |||
| 5c44484c24 | |||
| 03a278a5f1 | |||
| 18a9a92f4e | |||
| 52728d1ef1 | |||
| d4a4e91d5a | |||
| 51ca6f0ef2 | |||
| 5d97b35ba4 | |||
| 2bdc1e4a6d | |||
| 787379808e | |||
| 9a658a2818 | |||
| 079d80adcb | |||
| 8ec5685786 | |||
| 769ab7b238 | |||
| eae4921ccd | |||
| 2a28ba7060 | |||
| eaabba0860 | |||
| f892022232 | |||
| 3ab0a4ee5e | |||
| dfa93c344c | |||
| adfc2ef30d | |||
| f8549eaa13 | |||
| fc280b1cd6 | |||
| 6438c9a88a | |||
| 302b575f29 | |||
| e1c87770bd | |||
| b5d9d81704 | |||
| dc92a8c07f | |||
| b3b7b82dda | |||
| fc8784c540 | |||
| f290275406 | |||
| 17fe15948a | |||
| 6957bc3eba | |||
| 38f11a9f4a | |||
| ea43991901 | |||
| a469bad6e3 | |||
| 51781066b6 | |||
| 393baf5265 | |||
| aa6dd092f7 | |||
| 00e47257e1 | |||
| 01911afb0f | |||
| fe3e7357d5 | |||
| 541c90eacf | |||
| 4641c135e7 | |||
| 5c403b39eb | |||
| 1ba6c9b73f | |||
| 2ede1b0d65 | |||
| 3e5c005714 | |||
| 217c5157e1 | |||
| 6783e79c15 | |||
| 7f3a658611 | |||
| 25a10fb642 | |||
| 96a6cadc66 | |||
| 189cb94892 | |||
| 974b0cc984 | |||
| a202a87a67 | |||
| 7e33da3883 | |||
| 35cb3fec1f | |||
| 1ba89fb865 | |||
| 600ebb2669 | |||
| ed64dba0ad | |||
| 97d699156e | |||
| b59980bd62 | |||
| c3bddd9e5d | |||
| 6f3776d5ad | |||
| 7e5421862b | |||
| 599e2d0d8b | |||
| 964c75126e | |||
| ee60028d7c | |||
| c7fc617a21 | |||
| d43e0a4bc8 | |||
| 49a39cbd80 | |||
| 399821046f | |||
| 47bcde4efe | |||
| 213b4ddf64 | |||
| 0f71d4e2af | |||
| fd08ef00c3 | |||
| 85d7b5063e | |||
| 4c7cbbe184 | |||
| 97ca849c85 | |||
| 334d61559b | |||
| 607c9b57f7 | |||
| ce06cd0c4c | |||
| 583f907dd3 | |||
| a9c99b5fb1 | |||
| e5e30596f0 | |||
| d733569179 | |||
| c2654f2a3d | |||
| 43b611e39e | |||
| b8d0b5df96 | |||
| d12680c027 | |||
| e8d1e2d246 | |||
| c7accbd1fb | |||
| 39337c4bf2 | |||
| 345565349f | |||
| 57b89540f7 | |||
| 50f5752b95 | |||
| 44647e33fb | |||
| d6141591ed | |||
| 0af7c8b984 | |||
| e3e027e663 | |||
| 170686840c | |||
| 89a787fc32 | |||
| 56bec09bfd | |||
| 341d7a0b55 | |||
| c549d52123 | |||
| e6c7efc0d5 | |||
| 8c69e55bdd | |||
| 77a07b09a5 | |||
| 282a6b50a5 | |||
| 02fe14ffe3 | |||
| 0c1659cf48 | |||
| 5c8132d476 | |||
| 1627332a20 | |||
| 23d0b0e194 | |||
| 0e490d791a | |||
| 2f11ac944d | |||
| 49f766a593 | |||
| 0be13c04ce | |||
| 0cdbdefeb2 | |||
| 7f863a7b6a | |||
| d8cbbf4c2f | |||
| 930e76f8a9 | |||
| 9bee310052 | |||
| f76ede5078 | |||
| 22fd371f3f | |||
| de5447c4a3 | |||
| 989935db24 | |||
| f9791c3825 | |||
| 4cdd59d70d | |||
| ec4fcf4d7a | |||
| e1949a4cf3 | |||
| 6ec88fceba | |||
| 9d50ad16ff | |||
| 42dc1645a9 | |||
| 5ffd7e9537 | |||
| 2cc6ed350c | |||
| 37fc76e4da | |||
| 4b1be35195 | |||
| 2498d81922 | |||
| 77f3429df9 | |||
| 4f90a015a9 | |||
| 9dd175bb82 | |||
| f2dd9d1a5f | |||
| 9220b65861 | |||
| a7a4a48a2c | |||
| d67b672a0c | |||
| 441ec10b5f | |||
| 240a553c55 | |||
| d43563fa75 | |||
| ecc44c6cec | |||
| a86ed9ee33 | |||
| 0ec2180022 | |||
| 346744aa02 | |||
| 128118003b | |||
| 02fa4142a7 | |||
| 4decd0c631 | |||
| 54a3b6efd6 | |||
| e7a62ee9d4 | |||
| b81a43d6bb | |||
| 5f434e77db | |||
| b52180ff9a | |||
| 7f6d3186cf | |||
| 2316968096 | |||
| 59924c4b4e | |||
| 9bfe8762ff | |||
| 046cbc06cf | |||
| b05605a24b | |||
| eeb757f5a4 | |||
| 70277f26bd | |||
| cd34915ef9 | |||
| 984e343ae1 | |||
| beb86b072c | |||
| 40b53144a8 | |||
| 5920ff19d1 | |||
| 45f5ba45f7 | |||
| 32464079da | |||
| 5e24200521 | |||
| e5aceb9b8c | |||
| e5b9dfca5d | |||
| 7e0613e2e9 | |||
| 4f5567cf3c | |||
| 31af7b633d | |||
| 9649851e31 | |||
| 0c96caff02 | |||
| 9057ea652b | |||
| 8e1d208ac2 | |||
| 75bb782da7 | |||
| f9103ee77c |
2
.gitignore
vendored
2
.gitignore
vendored
@ -39,4 +39,6 @@ Thumbs.db
|
||||
|
||||
*.opendb
|
||||
|
||||
.vs
|
||||
|
||||
DesktopEditor/fontengine/js/common/freetype-2.10.4
|
||||
|
||||
@ -323,7 +323,14 @@ namespace DocFileFormat
|
||||
{
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>(_doc->FontTable->operator [] (nIndex));
|
||||
if (ffn)
|
||||
m_sDefaultFont = ffn->xszFtn;
|
||||
{
|
||||
m_sCsFont = ffn->xszFtn;
|
||||
|
||||
XMLTools::XMLAttribute* cs = new XMLTools::XMLAttribute(L"w:cs");
|
||||
cs->SetValue(FormatUtils::XmlEncode(m_sCsFont, true));
|
||||
rFonts->AppendAttribute(*cs);
|
||||
RELEASEOBJECT(cs);
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case sprmCHpsBi:
|
||||
@ -432,7 +439,7 @@ namespace DocFileFormat
|
||||
}break;
|
||||
case 2:
|
||||
{
|
||||
hint.SetValue(L"eastAsia");
|
||||
hint.SetValue(L"cs");
|
||||
rFonts->AppendAttribute(hint);
|
||||
}break;
|
||||
case 0: break; // default
|
||||
@ -482,28 +489,14 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_sDefaultFont.empty() && m_sAsciiFont.empty() && m_sEastAsiaFont.empty() && m_shAnsiFont.empty())
|
||||
{//????
|
||||
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( L"w:ascii" );
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sDefaultFont));
|
||||
//rFonts->AppendAttribute( *ascii );
|
||||
RELEASEOBJECT( ascii );
|
||||
}
|
||||
|
||||
//apend lang
|
||||
if ( lang->GetAttributeCount() > 0 )
|
||||
{
|
||||
parent->AppendChild( *lang );
|
||||
}
|
||||
|
||||
//append fonts
|
||||
if ( rFonts->GetAttributeCount() > 0 )
|
||||
{
|
||||
parent->AppendChild( *rFonts );
|
||||
}
|
||||
|
||||
//append color
|
||||
if ( colorVal->GetValue() != L"")
|
||||
{
|
||||
color->AppendAttribute( *colorVal );
|
||||
|
||||
@ -88,10 +88,9 @@ namespace DocFileFormat
|
||||
bool _isRunStyleNeeded;
|
||||
bool _isOwnRPr;
|
||||
|
||||
std::wstring m_sDefaultFont;
|
||||
|
||||
std::wstring m_sAsciiFont;
|
||||
std::wstring m_sEastAsiaFont;
|
||||
std::wstring m_shAnsiFont;
|
||||
std::wstring m_sCsFont;
|
||||
};
|
||||
}
|
||||
|
||||
@ -1905,7 +1905,7 @@ namespace DocFileFormat
|
||||
XMLTools::XMLElement bookmarkElem(L"w:bookmarkStart");
|
||||
|
||||
bookmarkElem.AppendAttribute(L"w:id", FormatUtils::IntToWideString(id));
|
||||
bookmarkElem.AppendAttribute(L"w:name", *bookmarkName);
|
||||
bookmarkElem.AppendAttribute(L"w:name", XmlUtils::EncodeXmlString(*bookmarkName));
|
||||
|
||||
m_pXmlWriter->WriteString(bookmarkElem.GetXMLString());
|
||||
|
||||
|
||||
@ -53,14 +53,12 @@ namespace DocFileFormat
|
||||
this->Fractional = fractional;
|
||||
}
|
||||
|
||||
FixedPointNumber( unsigned int value )
|
||||
FixedPointNumber( _UINT32 value )
|
||||
{
|
||||
unsigned char* bytes = FormatUtils::GetBytes( value );
|
||||
unsigned short* bytes = (unsigned short*)(&value);
|
||||
|
||||
this->Integral = FormatUtils::BytesToUInt16( bytes, 0, sizeof(value) );
|
||||
this->Fractional = FormatUtils::BytesToUInt16( bytes, 2, sizeof(value) );
|
||||
|
||||
RELEASEARRAYOBJECTS( bytes );
|
||||
this->Integral = bytes[0];
|
||||
this->Fractional = bytes[1];
|
||||
}
|
||||
|
||||
FixedPointNumber( const unsigned char* bytes, unsigned int size )
|
||||
|
||||
@ -588,9 +588,19 @@ namespace DocFileFormat
|
||||
}
|
||||
}break;
|
||||
case sprmPWHeightAbs:
|
||||
appendValueAttribute( _framePr, L"w:h", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
|
||||
break;
|
||||
|
||||
{
|
||||
unsigned short val = FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
unsigned short DyaHeightAbs = GETBITS(val, 0, 14);
|
||||
bool fMinHeight = GETBIT(val, 15);
|
||||
if ( DyaHeightAbs > 0)
|
||||
appendValueAttribute(_framePr, L"w:h", DyaHeightAbs);
|
||||
if (fMinHeight)
|
||||
appendValueAttribute(_framePr, L"w:hRule", L"atLeast");
|
||||
else if (DyaHeightAbs == 0)
|
||||
appendValueAttribute(_framePr, L"w:hRule", L"auto");
|
||||
else
|
||||
appendValueAttribute(_framePr, L"w:hRule", L"exact");
|
||||
}break;
|
||||
case sprmOldPDxaWidth:
|
||||
case sprmPDxaWidth:
|
||||
appendValueAttribute( _framePr, L"w:w", FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) );
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "PropertiesMapping.h"
|
||||
#include "RGBColor.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
|
||||
@ -35,7 +35,6 @@
|
||||
|
||||
#include "Global.h"
|
||||
#include "BorderCode.h"
|
||||
#include "RGBColor.h"
|
||||
#include "ShadingDescriptor.h"
|
||||
#include "SinglePropertyModifier.h"
|
||||
|
||||
|
||||
@ -31,9 +31,8 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../../DesktopEditor/common/Types.h"
|
||||
|
||||
#include <sstream>
|
||||
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
#include <boost/format.hpp>
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
@ -55,9 +54,13 @@ namespace DocFileFormat
|
||||
std::wstring SixDigitHexCode;
|
||||
std::wstring EightDigitHexCode;
|
||||
|
||||
RGBColor( int cv, ByteOrder order )
|
||||
RGBColor( _UINT32 cv, ByteOrder order )
|
||||
{
|
||||
unsigned char* bytes = FormatUtils::GetBytes( cv );
|
||||
unsigned char bytes[4];
|
||||
bytes[0] = cv & 0x000000FF;
|
||||
bytes[1] = (cv >> 8) & 0x000000FF;
|
||||
bytes[2] = (cv >> 16) & 0x000000FF;
|
||||
bytes[3] = (cv >> 24) & 0x000000FF;
|
||||
|
||||
std::wstringstream rgbColor6, rgbColor8;
|
||||
|
||||
@ -68,8 +71,8 @@ namespace DocFileFormat
|
||||
this->Blue = bytes[2];
|
||||
this->Alpha = bytes[3];
|
||||
|
||||
rgbColor6 << boost::wformat( L"%02x%02x%02x" ) % /*R*/this->Red % /*G*/this->Green % /*B*/this->Blue;
|
||||
rgbColor8 << boost::wformat( L"%02x%02x%02x%02x" ) % /*R*/this->Red % /*G*/this->Green % /*B*/this->Blue % /*A*/this->Alpha;
|
||||
rgbColor6 << boost::wformat( L"%02x%02x%02x" ) % Red % Green % Blue;
|
||||
rgbColor8 << boost::wformat( L"%02x%02x%02x%02x" ) % Red % Green % Blue % Alpha;
|
||||
|
||||
SixDigitHexCode = rgbColor6.str();
|
||||
EightDigitHexCode = rgbColor8.str();
|
||||
@ -81,14 +84,12 @@ namespace DocFileFormat
|
||||
this->Blue = bytes[0];
|
||||
this->Alpha = bytes[3];
|
||||
|
||||
rgbColor6 << boost::wformat( L"%02x%02x%02x" ) % /*R*/this->Red % /*G*/this->Green % /*B*/this->Blue;
|
||||
rgbColor8 << boost::wformat( L"%02x%02x%02x%02x" ) % /*R*/this->Red % /*G*/this->Green % /*B*/this->Blue % /*A*/this->Alpha;
|
||||
rgbColor6 << boost::wformat( L"%02x%02x%02x" ) % Red % Green % Blue;
|
||||
rgbColor8 << boost::wformat( L"%02x%02x%02x%02x" ) % Red % Green % Blue % Alpha;
|
||||
|
||||
SixDigitHexCode = rgbColor6.str();
|
||||
EightDigitHexCode = rgbColor8.str();
|
||||
}
|
||||
|
||||
RELEASEARRAYOBJECTS( bytes );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -46,8 +46,8 @@ namespace DocFileFormat
|
||||
fNoHtmlExport(false),
|
||||
fSemiHidden(false),
|
||||
fLocked(false),
|
||||
fInternalUse(false),
|
||||
stk(paragraph_style),
|
||||
fInternalUse(false), fUnhideWhenUsed(false),
|
||||
stk(paragraph_style), uiPriority(0), fQFormat(false),
|
||||
istdBase(0xffffff), cupx (0), istdNext(0xffffff), bchUpe(0)
|
||||
{
|
||||
|
||||
@ -74,16 +74,14 @@ namespace DocFileFormat
|
||||
fSemiHidden(false),
|
||||
fLocked(false),
|
||||
fInternalUse(false),
|
||||
stk(paragraph_style),
|
||||
stk(paragraph_style), uiPriority(0), fQFormat(false),
|
||||
istdBase(0xffffff), cupx (0), istdNext(0xffffff), bchUpe(0)
|
||||
{
|
||||
//parsing the base (fix part)
|
||||
//parsing the base (fix part)
|
||||
|
||||
if ( cbStdBase >= 2 )
|
||||
{
|
||||
//sti
|
||||
sti = (StyleIdentifier)FormatUtils::GetUIntFromBytesBits( bytes, size, 0, 12 );
|
||||
//flags
|
||||
fScratch = FormatUtils::GetBitFromBytes( bytes, size, 12 );
|
||||
fInvalHeight = FormatUtils::GetBitFromBytes( bytes, size, 13 );
|
||||
fHasUpe = FormatUtils::GetBitFromBytes( bytes, size, 14 );
|
||||
@ -92,29 +90,20 @@ namespace DocFileFormat
|
||||
|
||||
if ( cbStdBase >= 4 )
|
||||
{
|
||||
//stk
|
||||
stk = (StyleKind)FormatUtils::GetUIntFromBytesBits( bytes, size, 16, 4 );
|
||||
//istdBase
|
||||
istdBase = FormatUtils::GetUIntFromBytesBits( bytes, size, 20, 12 );
|
||||
}
|
||||
|
||||
if ( cbStdBase >= 6 )
|
||||
{
|
||||
//cupx
|
||||
cupx = (unsigned short)FormatUtils::GetUIntFromBytesBits( bytes, size, 32, 4 );
|
||||
//istdNext
|
||||
istdNext = FormatUtils::GetUIntFromBytesBits( bytes, size, 36, 12 );
|
||||
}
|
||||
|
||||
if ( cbStdBase >= 8 )
|
||||
{
|
||||
//bchUpe
|
||||
bchUpe = (unsigned short)FormatUtils::GetUIntFromBytesBits( bytes, size, 48, 16 );
|
||||
}
|
||||
|
||||
if ( cbStdBase >= 10 )
|
||||
{
|
||||
//flags
|
||||
fAutoRedef = FormatUtils::GetBitFromBytes( bytes, size, 64 );
|
||||
fHidden = FormatUtils::GetBitFromBytes( bytes, size, 65 );
|
||||
f97LidsSet = FormatUtils::GetBitFromBytes( bytes, size, 66 );
|
||||
@ -126,21 +115,20 @@ namespace DocFileFormat
|
||||
fSemiHidden = FormatUtils::GetBitFromBytes( bytes, size, 72 );
|
||||
fLocked = FormatUtils::GetBitFromBytes( bytes, size, 73 );
|
||||
fInternalUse = FormatUtils::GetBitFromBytes( bytes, size, 74 );
|
||||
fUnhideWhenUsed = FormatUtils::GetBitFromBytes(bytes, size, 75);
|
||||
fQFormat = FormatUtils::GetBitFromBytes(bytes, size, 76);
|
||||
//fReserved 3 bits
|
||||
}
|
||||
if ( cbStdBase == 0x0012)
|
||||
{//StdfPost2000
|
||||
istdLink = FormatUtils::GetUIntFromBytesBits( bytes, size, 80, 12 );
|
||||
fHasOriginalStyle = FormatUtils::GetBitFromBytes( bytes, size, 92 );
|
||||
short fSpare = FormatUtils::GetUIntFromBytesBits(bytes, size, 93, 3); //ignored
|
||||
rsid = FormatUtils::GetUIntFromBytesBits( bytes, size, 96, 32 );
|
||||
iftcHtml = FormatUtils::GetUIntFromBytesBits(bytes, size, 128, 3);
|
||||
uiPriority = FormatUtils::GetUIntFromBytesBits(bytes, size, 132, 12);
|
||||
}
|
||||
|
||||
if ( cbStdBase >= 12 )
|
||||
{
|
||||
//istdLink
|
||||
istdLink = FormatUtils::GetUIntFromBytesBits( bytes, size, 80, 12 );
|
||||
//fHasOriginalStyle
|
||||
fHasOriginalStyle = FormatUtils::GetBitFromBytes( bytes, size, 92 );
|
||||
}
|
||||
|
||||
if ( cbStdBase >= 16 )
|
||||
{
|
||||
//rsid
|
||||
rsid = FormatUtils::GetUIntFromBytesBits( bytes, size, 96, 32 );
|
||||
}
|
||||
//parsing the variable part
|
||||
unsigned char *name = NULL;
|
||||
unsigned char characterCount = bytes[cbStdBase];
|
||||
|
||||
@ -449,6 +449,9 @@ namespace DocFileFormat
|
||||
/// A StyleSheetDescription can have a TAPX.
|
||||
/// If the style doesn't modify table properties, tapx is null.
|
||||
TablePropertyExceptions* tapx;
|
||||
bool fQFormat;
|
||||
bool fUnhideWhenUsed;
|
||||
unsigned int uiPriority;
|
||||
|
||||
/// Creates an empty STD object
|
||||
StyleSheetDescription();
|
||||
|
||||
@ -66,13 +66,19 @@ namespace DocFileFormat
|
||||
// not all stylesheet contain latent styles
|
||||
if ( size > 20 )
|
||||
{
|
||||
cbLSD = FormatUtils::BytesToUInt16 ( bytes, 20, size );
|
||||
cbLSD = FormatUtils::BytesToUInt16 ( bytes, 20, size );
|
||||
|
||||
for ( int i = 0; i < stiMaxWhenSaved; ++i)
|
||||
{
|
||||
unsigned int iLSD = FormatUtils::BytesToUInt32 ( bytes, ( 22 + (i * cbLSD) ), size );
|
||||
LSD lsd = *(LSD*)&iLSD;
|
||||
|
||||
_UINT32 iLSD = FormatUtils::BytesToUInt32 ( bytes, ( 22 + (i * cbLSD) ), size );
|
||||
|
||||
LSD lsd;
|
||||
lsd.fLocked = GETBIT(iLSD, 0);
|
||||
lsd.fSemiHidden = GETBIT(iLSD, 1);
|
||||
lsd.fUnhideWhenUsed = GETBIT(iLSD, 2);
|
||||
lsd.fQFormat = GETBIT(iLSD, 3);
|
||||
lsd.iPriority = GETBITS(iLSD, 4, 15);
|
||||
lsd.fReserved = GETBITS(iLSD, 16, 31);
|
||||
mpstilsd.push_back( lsd );
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,22 +35,15 @@
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
/*
|
||||
typedef struct _LatentStyleData
|
||||
struct LSD
|
||||
{
|
||||
unsigned int grflsd;
|
||||
bool fLocked;
|
||||
} LatentStyleData;
|
||||
*/
|
||||
struct LSD
|
||||
{
|
||||
unsigned int fLocked : 1;
|
||||
unsigned int fSemiHidden : 1;
|
||||
unsigned int fUnhideWhenUsed : 1;
|
||||
unsigned int fQFormat : 1;
|
||||
unsigned int iPriority : 12;
|
||||
unsigned int fReserved : 16;
|
||||
};
|
||||
bool fLocked = false;
|
||||
bool fSemiHidden = false;
|
||||
bool fUnhideWhenUsed = false;
|
||||
bool fQFormat = false;
|
||||
unsigned short iPriority = 0;
|
||||
unsigned short fReserved = 0;
|
||||
};
|
||||
|
||||
|
||||
class StyleSheetInformation
|
||||
|
||||
@ -42,6 +42,9 @@ namespace DocFileFormat
|
||||
{
|
||||
_ctx = ctx;
|
||||
m_document = _ctx->_doc;
|
||||
|
||||
for (size_t i = 0; i < 157; ++i)
|
||||
mapCheckReservedNames.insert(std::make_pair(StyleIdentifierMap[i], 0));
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
@ -83,7 +86,7 @@ namespace DocFileFormat
|
||||
{
|
||||
if ( *iter != NULL )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:style", TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:style", true);
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"w:type", FormatUtils::MapValueToWideString( (*iter)->stk, &StyleKindMap[0][0], 5, 10 ));
|
||||
|
||||
@ -95,70 +98,90 @@ namespace DocFileFormat
|
||||
}*/
|
||||
|
||||
m_pXmlWriter->WriteAttribute( L"w:styleId", FormatUtils::XmlEncode(MakeStyleId( *iter )));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true, false );
|
||||
|
||||
// <w:name val="" />
|
||||
std::wstring sName = FormatUtils::XmlEncode(getStyleName(*iter), true);
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:name", TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:name", true);
|
||||
if ((*iter)->sti == StyleIdentifier::Normal)
|
||||
m_pXmlWriter->WriteAttribute(L"w:val", L"Normal");
|
||||
else
|
||||
m_pXmlWriter->WriteAttribute(L"w:val", sName);
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true);
|
||||
|
||||
if ((*iter)->sti == StyleIdentifier::Normal) // ??? < sti < 159
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:aliases", TRUE);
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:aliases", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val", sName);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", TRUE);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
|
||||
// <w:basedOn val="" />
|
||||
if ( ( (*iter)->istdBase != 4095 ) && ( (*iter)->istdBase < sheet->Styles->size() ) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:basedOn", TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:basedOn", true);
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(MakeStyleId( sheet->Styles->at( (*iter)->istdBase ) )));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true);
|
||||
}
|
||||
|
||||
// <w:next val="" />
|
||||
if ( (*iter)->istdNext < sheet->Styles->size() )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:next", TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:next", true);
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(MakeStyleId( sheet->Styles->at( (*iter)->istdNext ) )));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true);
|
||||
}
|
||||
|
||||
// <w:link val="" />
|
||||
if ( (*iter)->istdLink < sheet->Styles->size() )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:link", TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:link", true);
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(MakeStyleId( sheet->Styles->at( (*iter)->istdLink ) )));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
}
|
||||
|
||||
// <w:locked/>
|
||||
if ( (*iter)->fLocked )
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true);
|
||||
}
|
||||
if ((*iter)->fAutoRedef)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:locked" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:locked" );
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:autoRedefine", true);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
|
||||
// <w:hidden/>
|
||||
if ( (*iter)->fHidden )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:hidden" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:hidden" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:hidden", true);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
if ((*iter)->uiPriority > 0)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:uiPriority", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val", std::to_wstring((*iter)->uiPriority));
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
if ((*iter)->fQFormat)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:qFormat", true);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
|
||||
// <w:semiHidden/>
|
||||
if ( (*iter)->fSemiHidden )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:semiHidden" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:semiHidden" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:semiHidden", true);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
|
||||
//write paragraph properties
|
||||
if ((*iter)->fUnhideWhenUsed)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:unhideWhenUsed", true);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
if ((*iter)->fLocked)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:locked", true);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
if ((*iter)->rsid > 0)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:rsid", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val", FormatUtils::IntToFormattedWideString((*iter)->rsid, L"%08X"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
//write paragraph properties
|
||||
if ( (*iter)->papx != NULL )
|
||||
{
|
||||
bool isBidi = false;
|
||||
@ -167,7 +190,7 @@ namespace DocFileFormat
|
||||
RELEASEOBJECT( ppMappingnew );
|
||||
}
|
||||
|
||||
//write character properties
|
||||
//write character properties
|
||||
if ( (*iter)->chpx != NULL )
|
||||
{
|
||||
RevisionData rev;
|
||||
@ -176,8 +199,7 @@ namespace DocFileFormat
|
||||
(*iter)->chpx->Convert( cpMapping );
|
||||
RELEASEOBJECT( cpMapping );
|
||||
}
|
||||
|
||||
//write table properties
|
||||
//write table properties
|
||||
if ( (*iter)->tapx != NULL )
|
||||
{
|
||||
std::vector<short> tableGrid;
|
||||
@ -185,7 +207,6 @@ namespace DocFileFormat
|
||||
(*iter)->tapx->Convert( tpMapping );
|
||||
RELEASEOBJECT( tpMapping );
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:style" );
|
||||
}
|
||||
}
|
||||
@ -322,11 +343,14 @@ namespace DocFileFormat
|
||||
}
|
||||
else
|
||||
{
|
||||
//if no identifier is set, use the unique id.
|
||||
std::map<std::wstring, std::wstring>::const_iterator findResult = m_mapStyleId.find(name);
|
||||
if (mapCheckReservedNames.find(name) != mapCheckReservedNames.end())
|
||||
{
|
||||
name += L"1";
|
||||
}
|
||||
if( findResult != m_mapStyleId.end() )
|
||||
{
|
||||
id = findResult->second;
|
||||
id = findResult->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -59,6 +59,7 @@ namespace DocFileFormat
|
||||
virtual ~StyleSheetMapping();
|
||||
|
||||
private:
|
||||
std::map<std::wstring, char> mapCheckReservedNames;
|
||||
void writeRunDefaults( StyleSheet* sheet );
|
||||
void writeParagraphDefaults( StyleSheet* sheet );
|
||||
/// Chooses the correct style name.
|
||||
|
||||
@ -426,8 +426,11 @@ void TablePropertiesMapping::Apply(IVisitable* visited)
|
||||
for (size_t i = 0; i < _grid->size(); i++)
|
||||
{
|
||||
XMLTools::XMLElement gridCol(L"w:gridCol");
|
||||
XMLTools::XMLAttribute gridColW(L"w:w", FormatUtils::IntToWideString(_grid->at(i)));
|
||||
gridCol.AppendAttribute(gridColW);
|
||||
if (_grid->at(i) > 0)
|
||||
{
|
||||
XMLTools::XMLAttribute gridColW(L"w:w", FormatUtils::IntToWideString(_grid->at(i)));
|
||||
gridCol.AppendAttribute(gridColW);
|
||||
}
|
||||
_tblGrid->AppendChild(gridCol);
|
||||
}
|
||||
|
||||
|
||||
@ -210,7 +210,7 @@ namespace DocFileFormat
|
||||
}
|
||||
if (brcBottom)
|
||||
{
|
||||
XMLTools::XMLElement border(L"w:left");
|
||||
XMLTools::XMLElement border(L"w:bottom");
|
||||
appendBorderAttributes(brcBottom.get(), &border);
|
||||
addOrSetBorder(_tblBorders, &border);
|
||||
}
|
||||
|
||||
@ -354,29 +354,37 @@ namespace DocFileFormat
|
||||
case ODRAW::borderBottomColor:
|
||||
if (!pict->brcBottom)
|
||||
{
|
||||
RGBColor bottomColor((int)iter->op, RedFirst);
|
||||
m_pXmlWriter->WriteAttribute(L"o:borderbottomcolor", L"#" + bottomColor.SixDigitHexCode);
|
||||
ODRAW::OfficeArtCOLORREF bottomColor((_UINT32)iter->op);
|
||||
m_context->_doc->CorrectColor(bottomColor);
|
||||
if (false == bottomColor.sColorRGB.empty())
|
||||
m_pXmlWriter->WriteAttribute(L"o:borderbottomcolor", L"#" + bottomColor.sColorRGB);
|
||||
}
|
||||
break;
|
||||
case ODRAW::borderLeftColor:
|
||||
if (!pict->brcLeft)
|
||||
{
|
||||
RGBColor leftColor((int)iter->op, RedFirst);
|
||||
m_pXmlWriter->WriteAttribute(L"o:borderleftcolor", L"#" + leftColor.SixDigitHexCode);
|
||||
ODRAW::OfficeArtCOLORREF leftColor((_UINT32)iter->op);
|
||||
m_context->_doc->CorrectColor(leftColor);
|
||||
if (false == leftColor.sColorRGB.empty())
|
||||
m_pXmlWriter->WriteAttribute(L"o:borderleftcolor", L"#" + leftColor.sColorRGB);
|
||||
}
|
||||
break;
|
||||
case ODRAW::borderRightColor:
|
||||
if (!pict->brcRight)
|
||||
{
|
||||
RGBColor rightColor((int)iter->op, RedFirst);
|
||||
m_pXmlWriter->WriteAttribute(L"o:borderrightcolor", L"#" + rightColor.SixDigitHexCode);
|
||||
ODRAW::OfficeArtCOLORREF rightColor((_UINT32)iter->op);
|
||||
m_context->_doc->CorrectColor(rightColor);
|
||||
if (false == rightColor.sColorRGB.empty())
|
||||
m_pXmlWriter->WriteAttribute(L"o:borderrightcolor", L"#" + rightColor.sColorRGB);
|
||||
}
|
||||
break;
|
||||
case ODRAW::borderTopColor:
|
||||
if (!pict->brcTop)
|
||||
{
|
||||
RGBColor topColor((int)iter->op, RedFirst);
|
||||
m_pXmlWriter->WriteAttribute(L"o:bordertopcolor", L"#" + topColor.SixDigitHexCode);
|
||||
ODRAW::OfficeArtCOLORREF topColor((_UINT32)iter->op);
|
||||
m_context->_doc->CorrectColor(topColor);
|
||||
if (false == topColor.sColorRGB.empty())
|
||||
m_pXmlWriter->WriteAttribute(L"o:bordertopcolor", L"#" + topColor.sColorRGB);
|
||||
}
|
||||
break;
|
||||
//CROPPING
|
||||
|
||||
@ -482,9 +482,10 @@ namespace DocFileFormat
|
||||
// LINE
|
||||
case ODRAW::lineColor:
|
||||
{
|
||||
RGBColor lineColor((int)iter->op, RedFirst);
|
||||
if (!pShape->fBackground)
|
||||
m_pXmlWriter->WriteAttribute(L"strokecolor", (std::wstring(L"#") + lineColor.SixDigitHexCode));
|
||||
ODRAW::OfficeArtCOLORREF lineColor((_UINT32)iter->op);
|
||||
m_context->_doc->CorrectColor(lineColor);
|
||||
if (false == lineColor.sColorRGB.empty() && !pShape->fBackground)
|
||||
m_pXmlWriter->WriteAttribute(L"strokecolor", (std::wstring(L"#") + lineColor.sColorRGB));
|
||||
}break;
|
||||
case ODRAW::lineWidth:
|
||||
{
|
||||
@ -544,13 +545,18 @@ namespace DocFileFormat
|
||||
// FILL
|
||||
case ODRAW::fillColor:
|
||||
{
|
||||
RGBColor fillColor((int)iter->op, RedFirst);
|
||||
m_pXmlWriter->WriteAttribute(L"fillcolor", (std::wstring(L"#") + fillColor.SixDigitHexCode));
|
||||
ODRAW::OfficeArtCOLORREF fillColor((_UINT32)iter->op);
|
||||
m_context->_doc->CorrectColor(fillColor);
|
||||
if (false == fillColor.sColorRGB.empty())
|
||||
m_pXmlWriter->WriteAttribute(L"fillcolor", (std::wstring(L"#") + fillColor.sColorRGB));
|
||||
}break;
|
||||
case ODRAW::fillBackColor:
|
||||
{
|
||||
RGBColor fillBackColor((int)iter->op, RedFirst);
|
||||
appendValueAttribute(&m_fill, L"color2", (std::wstring(L"#") + fillBackColor.SixDigitHexCode));
|
||||
ODRAW::OfficeArtCOLORREF fillBackColor((_UINT32)iter->op);
|
||||
m_context->_doc->CorrectColor(fillBackColor);
|
||||
|
||||
if (false == fillBackColor.sColorRGB.empty())
|
||||
appendValueAttribute(&m_fill, L"color2", (std::wstring(L"#") + fillBackColor.sColorRGB));
|
||||
}break;
|
||||
case ODRAW::fillAngle:
|
||||
{
|
||||
@ -623,8 +629,10 @@ namespace DocFileFormat
|
||||
|
||||
case ODRAW::shadowColor:
|
||||
{
|
||||
RGBColor shadowColor((int)iter->op, RedFirst);
|
||||
appendValueAttribute(&m_shadow, L"color", (std::wstring(L"#") + shadowColor.SixDigitHexCode));
|
||||
ODRAW::OfficeArtCOLORREF shadowColor((_UINT32)iter->op);
|
||||
m_context->_doc->CorrectColor(shadowColor);
|
||||
if (false == shadowColor.sColorRGB.empty())
|
||||
appendValueAttribute(&m_shadow, L"color", (std::wstring(L"#") + shadowColor.sColorRGB));
|
||||
}break;
|
||||
case ODRAW::shadowOffsetX:
|
||||
{
|
||||
|
||||
@ -40,7 +40,6 @@
|
||||
#include "VMLShapeTypeMapping.h"
|
||||
#include "TwipsValue.h"
|
||||
#include "EmuValue.h"
|
||||
#include "RGBColor.h"
|
||||
#include "FixedPointNumber.h"
|
||||
|
||||
#include "OfficeDrawing/BlipStoreContainer.h"
|
||||
|
||||
@ -1005,5 +1005,119 @@ namespace DocFileFormat
|
||||
return encodingChars;
|
||||
}
|
||||
}
|
||||
void WordDocument::CorrectColor(ODRAW::OfficeArtCOLORREF & color)
|
||||
{
|
||||
#if 0
|
||||
if (false == color.sColorRGB.empty()) return;
|
||||
|
||||
if (color.fSysIndex)
|
||||
{
|
||||
oox::_color sys_color;
|
||||
_UINT32 nColorCode = color.index;
|
||||
|
||||
unsigned short nParameter = (unsigned short)((nColorCode >> 16) & 0x00ff); // the HiByte of nParameter is not zero, an exclusive AND is helping :o
|
||||
unsigned short nFunctionBits = (unsigned short)((nColorCode & 0x00000f00) >> 8);
|
||||
unsigned short nAdditionalFlags = (unsigned short)((nColorCode & 0x0000f000) >> 8);
|
||||
unsigned short nColorIndex = (unsigned short)(nColorCode & 0x00ff);
|
||||
unsigned short nPropColor = 0;
|
||||
|
||||
_UINT32 systemColors[25] =
|
||||
{
|
||||
0xc0c0c0, 0x008080, 0x000080, 0x808080, 0xc0c0c0, 0xffffff, 0x000000,
|
||||
0x000000, 0x000000, 0xffffff, 0xc0c0c0, 0xc0c0c0, 0x808080, 0x000080,
|
||||
0xffffff, 0xc0c0c0, 0x808080, 0x808080, 0x000000, 0xc0c0c0, 0xffffff,
|
||||
0x000000, 0xc0c0c0, 0x000000, 0xffffc0
|
||||
};
|
||||
|
||||
if (nColorIndex < 25)
|
||||
{
|
||||
sys_color.SetRGB((unsigned char)(systemColors[nColorIndex]>>16), (unsigned char)(systemColors[nColorIndex]>>8), (unsigned char)(systemColors[nColorIndex]));
|
||||
}
|
||||
else return;
|
||||
|
||||
if (nAdditionalFlags & 0x80) // make color gray
|
||||
{
|
||||
BYTE nZwi = 0x7f;//= aColor.GetLuminance();
|
||||
sys_color.SetRGB(nZwi, nZwi, nZwi);
|
||||
}
|
||||
switch (nFunctionBits)
|
||||
{
|
||||
case 0x01: // darken color by parameter
|
||||
{
|
||||
BYTE R = static_cast<BYTE> ((nParameter * sys_color.GetR()) >> 8);
|
||||
BYTE G = static_cast<BYTE> ((nParameter * sys_color.GetG()) >> 8);
|
||||
BYTE B = static_cast<BYTE> ((nParameter * sys_color.GetB()) >> 8);
|
||||
|
||||
sys_color.SetRGB(R, G, B);
|
||||
}
|
||||
break;
|
||||
case 0x02: // lighten color by parameter
|
||||
{
|
||||
unsigned short nInvParameter = (0x00ff - nParameter) * 0xff;
|
||||
BYTE R = static_cast<BYTE>((nInvParameter + (nParameter * sys_color.GetR())) >> 8);
|
||||
BYTE G = static_cast<BYTE>((nInvParameter + (nParameter * sys_color.GetG())) >> 8);
|
||||
BYTE B = static_cast<BYTE>((nInvParameter + (nParameter * sys_color.GetB())) >> 8);
|
||||
|
||||
sys_color.SetRGB(R, G, B);
|
||||
}break;
|
||||
case 0x03: // add grey level RGB(p,p,p)
|
||||
{
|
||||
short nR = (short)sys_color.GetR() + (short)nParameter;
|
||||
short nG = (short)sys_color.GetG() + (short)nParameter;
|
||||
short nB = (short)sys_color.GetB() + (short)nParameter;
|
||||
|
||||
if (nR > 0x00ff) nR = 0x00ff;
|
||||
if (nG > 0x00ff) nG = 0x00ff;
|
||||
if (nB > 0x00ff) nB = 0x00ff;
|
||||
|
||||
sys_color.SetRGB((BYTE)nR, (BYTE)nG, (BYTE)nB);
|
||||
}break;
|
||||
case 0x04: // substract grey level RGB(p,p,p)
|
||||
{
|
||||
short nR = (short)sys_color.GetR() - (short)nParameter;
|
||||
short nG = (short)sys_color.GetG() - (short)nParameter;
|
||||
short nB = (short)sys_color.GetB() - (short)nParameter;
|
||||
if (nR < 0) nR = 0;
|
||||
if (nG < 0) nG = 0;
|
||||
if (nB < 0) nB = 0;
|
||||
sys_color.SetRGB((BYTE)nR, (BYTE)nG, (BYTE)nB);
|
||||
} break;
|
||||
case 0x05: // substract from gray level RGB(p,p,p)
|
||||
{
|
||||
short nR = (short)nParameter - (short)sys_color.GetR();
|
||||
short nG = (short)nParameter - (short)sys_color.GetG();
|
||||
short nB = (short)nParameter - (short)sys_color.GetB();
|
||||
if (nR < 0) nR = 0;
|
||||
if (nG < 0) nG = 0;
|
||||
if (nB < 0) nB = 0;
|
||||
sys_color.SetRGB((BYTE)nR, (BYTE)nG, (BYTE)nB);
|
||||
}break;
|
||||
case 0x06: // per component: black if < p, white if >= p
|
||||
{
|
||||
BYTE R = sys_color.GetR() < nParameter ? 0x00 : 0xff;
|
||||
BYTE G = sys_color.GetG() < nParameter ? 0x00 : 0xff;
|
||||
BYTE B = sys_color.GetB() < nParameter ? 0x00 : 0xff;
|
||||
|
||||
sys_color.SetRGB(R, G, B);
|
||||
}break;
|
||||
}
|
||||
if (nAdditionalFlags & 0x40) // top-bit invert
|
||||
sys_color.SetRGB(sys_color.GetR() ^ 0x80, sys_color.GetG() ^ 0x80, sys_color.GetB() ^ 0x80);
|
||||
|
||||
if (nAdditionalFlags & 0x20) // invert color
|
||||
sys_color.SetRGB(0xff - sys_color.GetR(), 0xff - sys_color.GetG(), 0xff - sys_color.GetB());
|
||||
|
||||
color.sColorRGB = sys_color.sRGB;
|
||||
}
|
||||
//else if (color.fPaletteIndex)
|
||||
//{
|
||||
// std::map<int, std::wstring>::iterator it = colors_palette.find(color.index);
|
||||
// if (it != colors_palette.end())
|
||||
// {
|
||||
// color.sColorRGB = it->second;
|
||||
// }
|
||||
//}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -236,6 +236,7 @@ namespace DocFileFormat
|
||||
Plex<EmptyStructure> *AutoTextPlex;
|
||||
|
||||
AnnotationReferenceExDescriptors *AnnotationsReferencesEx;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void CorrectColor(ODRAW::OfficeArtCOLORREF & color);
|
||||
};
|
||||
}
|
||||
|
||||
@ -96,15 +96,13 @@ namespace DocFileFormat
|
||||
std::wstring sApplication = NSSystemUtils::GetEnvVariable(NSSystemUtils::gc_EnvApplicationName);
|
||||
if (sApplication.empty())
|
||||
sApplication = NSSystemUtils::gc_EnvApplicationNameDefault;
|
||||
pApp->SetApplication(sApplication);
|
||||
|
||||
#if defined(INTVER)
|
||||
pApp->SetAppVersion(VALUE2STR(INTVER));
|
||||
std::string s = VALUE2STR(INTVER);
|
||||
sApplication += L"/" + std::wstring(s.begin(), s.end());
|
||||
#endif
|
||||
pApp->SetDocSecurity(0);
|
||||
pApp->SetScaleCrop(false);
|
||||
pApp->SetLinksUpToDate(false);
|
||||
pApp->SetSharedDoc(false);
|
||||
pApp->SetHyperlinksChanged(false);
|
||||
pApp->m_sApplication = sApplication;
|
||||
pApp->SetDefaults();
|
||||
|
||||
pApp->write(pathDocProps + FILE_SEPARATOR_STR + L"app.xml", DocProps, oContentTypes);
|
||||
delete pApp;
|
||||
|
||||
@ -80,6 +80,8 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IncludePath>..\..\..\Common\3dParty\boost\build\win_32\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
<LibraryPath>..\..\..\Common\3dParty\boost\build\win_32\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
@ -121,6 +123,7 @@
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
||||
@ -69,6 +69,41 @@ namespace Writers
|
||||
|
||||
arItems.push_back(std::make_pair(sCustomXmlFilename, bGlossaryMode));
|
||||
}
|
||||
void CustomXmlWriter::WriteCustomA(const std::wstring& sCustomXmlPropertiesContent, const std::string& sCustomXmlContent, bool bGlossaryMode)
|
||||
{
|
||||
m_nCount++;
|
||||
|
||||
std::wstring sCustomXmlDir = m_sDir + FILE_SEPARATOR_STR;
|
||||
sCustomXmlDir += OOX::FileTypes::CustomXml.DefaultDirectory().GetPath();
|
||||
|
||||
std::wstring sCustomXmlRelsDir = sCustomXmlDir + FILE_SEPARATOR_STR + L"_rels";
|
||||
|
||||
std::wstring sCustomXMLPropsFilename = OOX::FileTypes::CustomXmlProps.DefaultFileName().GetBasename();
|
||||
sCustomXMLPropsFilename += std::to_wstring(m_nCount) + OOX::FileTypes::CustomXmlProps.DefaultFileName().GetExtention();
|
||||
|
||||
NSFile::CFileBinary::SaveToFile(sCustomXmlDir + FILE_SEPARATOR_STR + sCustomXMLPropsFilename, sCustomXmlPropertiesContent);
|
||||
OOX::CContentTypes& oContentTypes = *m_pDrawingConverter->GetContentTypes();
|
||||
oContentTypes.Registration(OOX::FileTypes::CustomXmlProps.OverrideType(), OOX::FileTypes::CustomXml.DefaultDirectory(), sCustomXMLPropsFilename);
|
||||
|
||||
std::wstring sCustomXmlFilename;
|
||||
sCustomXmlFilename = OOX::FileTypes::CustomXml.DefaultFileName().GetBasename() + std::to_wstring(m_nCount);
|
||||
sCustomXmlFilename += OOX::FileTypes::CustomXml.DefaultFileName().GetExtention();
|
||||
|
||||
NSFile::CFileBinary oFile;
|
||||
if (true == oFile.CreateFileW(sCustomXmlDir + FILE_SEPARATOR_STR + sCustomXmlFilename))
|
||||
{
|
||||
if (false == sCustomXmlContent.empty())
|
||||
oFile.WriteFile((BYTE*)sCustomXmlContent.c_str(), sCustomXmlContent.length());
|
||||
oFile.CloseFile();
|
||||
}
|
||||
|
||||
m_pDrawingConverter->SetDstContentRels();
|
||||
unsigned int lId;
|
||||
m_pDrawingConverter->WriteRels(OOX::FileTypes::CustomXmlProps.RelationType(), sCustomXMLPropsFilename, L"", &lId);
|
||||
m_pDrawingConverter->SaveDstContentRels(sCustomXmlRelsDir + FILE_SEPARATOR_STR + sCustomXmlFilename + L".rels");
|
||||
|
||||
arItems.push_back(std::make_pair(sCustomXmlFilename, bGlossaryMode));
|
||||
}
|
||||
void CustomXmlWriter::WriteCustomSettings(const std::wstring& sUrl, const std::wstring& sXml, bool bGlossaryMode)
|
||||
{
|
||||
m_nCount++;
|
||||
|
||||
@ -52,6 +52,7 @@ namespace Writers
|
||||
|
||||
void WriteCustomSettings(const std::wstring& sUrl, const std::wstring& sXml, bool bGlossaryMode);
|
||||
void WriteCustom(const std::wstring& sCustomXmlPropertiesContent, const std::wstring& sCustomXmlContents, bool bGlossaryMode);
|
||||
void WriteCustomA(const std::wstring& sCustomXmlPropertiesContent, const std::string& sCustomXmlContents, bool bGlossaryMode);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -815,7 +815,7 @@ int Binary_rPrReader::ReadContent(BYTE type, long length, void* poResult)
|
||||
case c_oSerProp_rPrType::MoveTo:
|
||||
{
|
||||
pRPr->m_oMoveTo.Init();
|
||||
oBinary_CommonReader2.ReadTrackRevision2(length, pRPr->m_oMoveFrom.GetPointer());
|
||||
oBinary_CommonReader2.ReadTrackRevision2(length, pRPr->m_oMoveTo.GetPointer());
|
||||
}break;
|
||||
case c_oSerProp_rPrType::rPrChange:
|
||||
{
|
||||
@ -1185,7 +1185,7 @@ int Binary_pPrReader::ReadInd(BYTE type, long length, void* poResult)
|
||||
long nIndFirstLine = SerializeCommon::Round(dIndFirstLine * g_dKoef_mm_to_twips);
|
||||
std::wstring sIndFirstLine;
|
||||
if(nIndFirstLine >= 0)
|
||||
sIndFirstLine = L" w:firstLine =\"" + std::to_wstring(nIndFirstLine) + L"\"";
|
||||
sIndFirstLine = L" w:firstLine=\"" + std::to_wstring(nIndFirstLine) + L"\"";
|
||||
else
|
||||
sIndFirstLine = L" w:hanging=\"" + std::to_wstring(-nIndFirstLine) + L"\"";
|
||||
pCStringWriter->WriteString(sIndFirstLine);
|
||||
@ -1196,7 +1196,7 @@ int Binary_pPrReader::ReadInd(BYTE type, long length, void* poResult)
|
||||
long nIndFirstLine = m_oBufferedStream.GetLong();
|
||||
std::wstring sIndFirstLine;
|
||||
if(nIndFirstLine >= 0)
|
||||
sIndFirstLine = L" w:firstLine =\"" + std::to_wstring(nIndFirstLine) + L"\"";
|
||||
sIndFirstLine = L" w:firstLine=\"" + std::to_wstring(nIndFirstLine) + L"\"";
|
||||
else
|
||||
sIndFirstLine = L" w:hanging=\"" + std::to_wstring(-nIndFirstLine) + L"\"";
|
||||
pCStringWriter->WriteString(sIndFirstLine);
|
||||
@ -3601,7 +3601,14 @@ int Binary_CustomsTableReader::ReadCustom(BYTE type, long length, void* poResult
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
READ1_DEF(length, res, this->ReadCustomContent, &oCustomXmlProps);
|
||||
|
||||
m_oFileWriter.m_oCustomXmlWriter.WriteCustom(oCustomXmlProps.toXML(), oCustomXmlProps.m_oCustomXmlContent, m_oFileWriter.m_bGlossaryMode);
|
||||
if (false == oCustomXmlProps.m_oCustomXmlContentA.empty())
|
||||
{
|
||||
m_oFileWriter.m_oCustomXmlWriter.WriteCustomA(oCustomXmlProps.toXML(), oCustomXmlProps.m_oCustomXmlContentA, m_oFileWriter.m_bGlossaryMode);
|
||||
}
|
||||
else if (false == oCustomXmlProps.m_oCustomXmlContent.empty())
|
||||
{
|
||||
m_oFileWriter.m_oCustomXmlWriter.WriteCustom(oCustomXmlProps.toXML(), oCustomXmlProps.m_oCustomXmlContent, m_oFileWriter.m_bGlossaryMode);
|
||||
}
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
@ -8267,7 +8274,12 @@ int Binary_DocumentTableReader::Read_tblGrid(BYTE type, long length, void* poRes
|
||||
}
|
||||
else if( c_oSerDocTableType::tblGrid_ItemTwips == type )
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:gridCol w:w=\"" + std::to_wstring(m_oBufferedStream.GetLong())+ L"\"/>");
|
||||
int ngridCol = m_oBufferedStream.GetLong();
|
||||
|
||||
if (ngridCol > 0)
|
||||
pCStringWriter->WriteString(L"<w:gridCol w:w=\"" + std::to_wstring(ngridCol)+ L"\"/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:gridCol/>");
|
||||
}
|
||||
else if( c_oSerDocTableType::tblGridChange == type )
|
||||
{
|
||||
@ -8781,8 +8793,7 @@ int Binary_DocumentTableReader::ReadEmbedded(BYTE type, long length, void* poRes
|
||||
|
||||
int id = m_oFileWriter.m_oChartWriter.nEmbeddedCount++;
|
||||
|
||||
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(id + 1) + L".xlsx";
|
||||
BinXlsxRW::SaveParams oSaveParams(strDstEmbeddedTempDrawingPath, strDstEmbeddedTempEmbeddingsPath, strDstEmbeddedTempThemePath, m_oFileWriter.m_pDrawingConverter->GetContentTypes());//???
|
||||
BinXlsxRW::SaveParams oSaveParams(strDstEmbeddedTempDrawingPath, strDstEmbeddedTempEmbeddingsPath, strDstEmbeddedTempThemePath, m_oFileWriter.m_pDrawingConverter->GetContentTypes(), NULL, true);
|
||||
|
||||
OOX::Spreadsheet::CXlsx oXlsx;
|
||||
|
||||
@ -8793,12 +8804,15 @@ int Binary_DocumentTableReader::ReadEmbedded(BYTE type, long length, void* poRes
|
||||
|
||||
oXlsx.Write(strDstEmbeddedTemp, *oSaveParams.pContentTypes);
|
||||
|
||||
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(id + 1) + (oSaveParams.bMacroEnabled ? L".xlsm" : L".xlsx");
|
||||
COfficeUtils oOfficeUtils(NULL);
|
||||
oOfficeUtils.CompressFileOrDirectory(strDstEmbeddedTemp, strDstEmbedded + FILE_SEPARATOR_STR + sXlsxFilename, true);
|
||||
|
||||
std::wstring sEmbWorksheetRelsName = L"embeddings/" + sXlsxFilename;
|
||||
std::wstring bstrEmbWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(bstrEmbWorksheetRelType, sEmbWorksheetRelsName, std::wstring(), &pDrawingProperty->nObjectId);
|
||||
std::wstring sEmbWorksheetRelType = oSaveParams.bMacroEnabled ? OOX::FileTypes::MicrosoftOfficeExcelMacro_EnabledWorksheet.RelationType() :
|
||||
OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
|
||||
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(sEmbWorksheetRelType, sEmbWorksheetRelsName, std::wstring(), &pDrawingProperty->nObjectId);
|
||||
|
||||
NSDirectory::DeleteDirectory(strDstEmbeddedTemp);
|
||||
}
|
||||
@ -9360,6 +9374,11 @@ int Binary_DocumentTableReader::ReadSdtPr(BYTE type, long length, void* poResult
|
||||
pSdtPr->m_oPicture.Init();
|
||||
READ1_DEF(length, res, this->ReadSdtPicture, pSdtPr->m_oPicture.GetPointer());
|
||||
}
|
||||
else if (c_oSerSdt::ComplexFormPr == type)
|
||||
{
|
||||
pSdtPr->m_oComplexFormPr.Init();
|
||||
READ1_DEF(length, res, this->ReadSdtComplexFormPr, pSdtPr->m_oComplexFormPr.GetPointer());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -9419,11 +9438,17 @@ int Binary_DocumentTableReader::ReadSdtComboBox(BYTE type, long length, void* po
|
||||
pSdtComboBox->m_sLastValue.Init();
|
||||
pSdtComboBox->m_sLastValue->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if (c_oSerSdt::TextFormPrFormat == type)
|
||||
{
|
||||
pSdtComboBox->m_oFormat.Init();
|
||||
READ1_DEF(length, res, this->ReadSdtTextFormPrFormat, pSdtComboBox->m_oFormat.GetPointer());
|
||||
}
|
||||
else if (c_oSerSdt::SdtListItem == type)
|
||||
{
|
||||
ComplexTypes::Word::CSdtListItem* pSdtListItem = new ComplexTypes::Word::CSdtListItem();
|
||||
READ1_DEF(length, res, this->ReadSdtListItem, pSdtListItem);
|
||||
pSdtComboBox->m_arrListItem.push_back(pSdtListItem); }
|
||||
pSdtComboBox->m_arrListItem.push_back(pSdtListItem);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -9634,6 +9659,46 @@ int Binary_DocumentTableReader::ReadSdtTextFormPr(BYTE type, long length, void*
|
||||
{
|
||||
pTextFormPr->m_oMultiLine = m_oBufferedStream.GetBool();
|
||||
}
|
||||
else if (c_oSerSdt::TextFormPrFormat == type)
|
||||
{
|
||||
pTextFormPr->m_oFormat.Init();
|
||||
READ1_DEF(length, res, this->ReadSdtTextFormPrFormat, pTextFormPr->m_oFormat.GetPointer());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int Binary_DocumentTableReader::ReadSdtComplexFormPr(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = 0;
|
||||
OOX::Logic::CComplexFormPr* pComplexForm = static_cast<OOX::Logic::CComplexFormPr*>(poResult);
|
||||
if (c_oSerSdt::ComplexFormPrType == type)
|
||||
{
|
||||
pComplexForm->m_oType.Init();
|
||||
pComplexForm->m_oType->SetValueFromByte(m_oBufferedStream.GetLong());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
|
||||
return res;
|
||||
}
|
||||
int Binary_DocumentTableReader::ReadSdtTextFormPrFormat(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = 0;
|
||||
ComplexTypes::Word::CTextFormFormat* pFormat = static_cast<ComplexTypes::Word::CTextFormFormat*>(poResult);
|
||||
if (c_oSerSdt::TextFormPrFormatType == type)
|
||||
{
|
||||
pFormat->m_oType.Init();
|
||||
pFormat->m_oType->SetValueFromByte(m_oBufferedStream.GetChar());
|
||||
}
|
||||
else if (c_oSerSdt::TextFormPrFormatVal == type)
|
||||
{
|
||||
pFormat->m_oVal = m_oBufferedStream.GetString3(length);
|
||||
}
|
||||
else if (c_oSerSdt::TextFormPrFormatSymbols == type)
|
||||
{
|
||||
pFormat->m_oSymbols = m_oBufferedStream.GetString3(length);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -9984,6 +10049,7 @@ int BinaryFileReader::ReadMainTable()
|
||||
}break;
|
||||
case c_oSerTableTypes::VbaProject:
|
||||
{
|
||||
m_bMacroRead = true;
|
||||
m_oBufferedStream.Skip(1); //skip type
|
||||
if (m_bMacro)
|
||||
{
|
||||
|
||||
@ -479,7 +479,9 @@ public:
|
||||
int ReadSdtFormPr(BYTE type, long length, void* poResult);
|
||||
int ReadSdtTextFormPr(BYTE type, long length, void* poResult);
|
||||
int ReadSdtTextFormPrComb(BYTE type, long length, void* poResult);
|
||||
int ReadSdtTextFormPrFormat(BYTE type, long length, void* poResult);
|
||||
int ReadSdtPicture(BYTE type, long length, void* poResult);
|
||||
int ReadSdtComplexFormPr(BYTE type, long length, void* poResult);
|
||||
};
|
||||
class Binary_NotesTableReader : public Binary_CommonReader
|
||||
{
|
||||
@ -500,8 +502,9 @@ private:
|
||||
NSBinPptxRW::CBinaryFileReader& m_oBufferedStream;
|
||||
Writers::FileWriter& m_oFileWriter;
|
||||
std::wstring m_sFileInDir;
|
||||
bool m_bMacro;
|
||||
public:
|
||||
bool m_bMacro = false;
|
||||
bool m_bMacroRead = false;
|
||||
public:
|
||||
BinaryFileReader(std::wstring& sFileInDir, NSBinPptxRW::CBinaryFileReader& oBufferedStream, Writers::FileWriter& oFileWriter, bool bMacro = false);
|
||||
int ReadFile();
|
||||
int ReadMainTable();
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1252,6 +1252,7 @@ extern int g_nCurFormatVersion;
|
||||
TextFormPrCombBorder = 56,
|
||||
TextFormPrAutoFit = 57,
|
||||
TextFormPrMultiLine = 58,
|
||||
TextFormPrFormat = 59,
|
||||
PictureFormPr = 60,
|
||||
PictureFormPrScaleFlag = 61,
|
||||
PictureFormPrLockProportions = 62,
|
||||
@ -1260,7 +1261,12 @@ extern int g_nCurFormatVersion;
|
||||
PictureFormPrShiftY = 65,
|
||||
FormPrBorder = 70,
|
||||
FormPrShd = 71,
|
||||
TextFormPrCombWRule = 72
|
||||
TextFormPrCombWRule = 72,
|
||||
TextFormPrFormatType = 80,
|
||||
TextFormPrFormatVal = 81,
|
||||
TextFormPrFormatSymbols = 82,
|
||||
ComplexFormPr = 90,
|
||||
ComplexFormPrType = 91
|
||||
};}
|
||||
namespace c_oSerFFData{enum c_oSerFFData
|
||||
{
|
||||
|
||||
@ -1581,7 +1581,7 @@ void Binary_pPrWriter::WritePageMargin(OOX::Logic::CSectionProperty* pSectPr)
|
||||
void Binary_pPrWriter::WriteHeaderFooter(OOX::Logic::CSectionProperty* pSectPr, std::vector<ComplexTypes::Word::CHdrFtrRef*>& aRefs, bool bHdr)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
for(size_t i = 0, length = aRefs.size(); i < length; ++i)
|
||||
for (size_t i = 0, length = aRefs.size(); i < length; ++i)
|
||||
{
|
||||
const ComplexTypes::Word::CHdrFtrRef& oRef = *aRefs[i];
|
||||
if( oRef.m_oType.IsInit() && oRef.m_oId.IsInit())
|
||||
@ -1589,25 +1589,12 @@ void Binary_pPrWriter::WriteHeaderFooter(OOX::Logic::CSectionProperty* pSectPr,
|
||||
int nIndex = 0;
|
||||
OOX::CHdrFtr* pHdrFtr = NULL;
|
||||
|
||||
OOX::CDocxFlat *docx_flat = dynamic_cast<OOX::CDocxFlat*>(m_oBinaryHeaderFooterTableWriter->m_oParamsWriter.m_pMain);
|
||||
smart_ptr<OOX::File> oFile = m_oBinaryHeaderFooterTableWriter->m_oDocumentRelsWriter->Find(oRef.m_oId->GetValue());
|
||||
if (oFile.IsInit() && (OOX::FileTypes::Header == oFile->type() || OOX::FileTypes::Footer == oFile->type()))
|
||||
{
|
||||
pHdrFtr = (OOX::CHdrFtr*)oFile.GetPointer();
|
||||
}
|
||||
|
||||
if (docx_flat)
|
||||
{
|
||||
std::map<std::wstring, OOX::CHdrFtr*>::iterator pFind = docx_flat->m_mapHeadersFooters.find(oRef.m_oId->GetValue());
|
||||
if (pFind != docx_flat->m_mapHeadersFooters.end())
|
||||
{
|
||||
pHdrFtr = pFind->second;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
smart_ptr<OOX::File> oFile = m_oBinaryHeaderFooterTableWriter->m_oDocumentRelsWriter->Find(oRef.m_oId->GetValue());
|
||||
if (oFile.IsInit() && (OOX::FileTypes::Header == oFile->type() || OOX::FileTypes::Footer == oFile->type()))
|
||||
{
|
||||
pHdrFtr = (OOX::CHdrFtr*)oFile.GetPointer();
|
||||
}
|
||||
}
|
||||
|
||||
if (pHdrFtr)
|
||||
{
|
||||
if(bHdr)
|
||||
@ -7739,7 +7726,13 @@ void BinaryDocumentTableWriter::WriteSdtPr(const OOX::Logic::CSdtPr& oStdPr)
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::PictureFormPr);
|
||||
WriteSdtPicture(oStdPr.m_oPicture.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
if (oStdPr.m_oComplexFormPr.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::ComplexFormPr);
|
||||
WriteSdtComplexFormPr(oStdPr.m_oComplexFormPr.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void BinaryDocumentTableWriter::WriteSdtPicture(const OOX::Logic::CSdtPicture& oSdtPicture)
|
||||
{
|
||||
@ -7775,6 +7768,16 @@ void BinaryDocumentTableWriter::WriteSdtPicture(const OOX::Logic::CSdtPicture& o
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void BinaryDocumentTableWriter::WriteSdtComplexFormPr(const OOX::Logic::CComplexFormPr& oComplexFormPr)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if (oComplexFormPr.m_oType.IsInit() && !oComplexFormPr.m_oType->IsDefaultValue())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::ComplexFormPrType);
|
||||
m_oBcw.m_oStream.WriteLONG(oComplexFormPr.m_oType->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void BinaryDocumentTableWriter::WriteSdtCheckBox(const OOX::Logic::CSdtCheckBox& oSdtCheckBox)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
@ -7830,6 +7833,12 @@ void BinaryDocumentTableWriter::WriteSdtComboBox(const OOX::Logic::CSdtComboBox&
|
||||
m_oBcw.m_oStream.WriteStringW3(oSdtComboBox.m_sLastValue.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (oSdtComboBox.m_oFormat.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrFormat);
|
||||
WriteSdtTextFormPrFormat(oSdtComboBox.m_oFormat.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
for(size_t i = 0; i < oSdtComboBox.m_arrListItem.size(); ++i)
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::SdtListItem);
|
||||
@ -8020,6 +8029,34 @@ void BinaryDocumentTableWriter::WriteSdtTextFormPr(const OOX::Logic::CTextFormPr
|
||||
m_oBcw.m_oStream.WriteBOOL(oTextFormPr.m_oMultiLine.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (oTextFormPr.m_oFormat.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrFormat);
|
||||
WriteSdtTextFormPrFormat(oTextFormPr.m_oFormat.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void BinaryDocumentTableWriter::WriteSdtTextFormPrFormat(const ComplexTypes::Word::CTextFormFormat& oFormat)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if (oFormat.m_oType.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrFormatType);
|
||||
m_oBcw.m_oStream.WriteBYTE((BYTE)oFormat.m_oType->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (oFormat.m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrFormatVal);
|
||||
m_oBcw.m_oStream.WriteStringW3(oFormat.m_oVal.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (oFormat.m_oSymbols.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TextFormPrFormatSymbols);
|
||||
m_oBcw.m_oStream.WriteStringW3(oFormat.m_oSymbols.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void BinaryDocumentTableWriter::WriteSdtTextFormPrComb(const ComplexTypes::Word::CComb& oComb)
|
||||
{
|
||||
@ -9251,7 +9288,7 @@ void BinaryFileWriter::intoBindoc(const std::wstring& sDir)
|
||||
if ((pDocxFlat) && (pDocxFlat->m_pDocument.IsInit()))
|
||||
{
|
||||
pDocument = pDocxFlat->m_pDocument.GetPointer();
|
||||
pComments = &pDocxFlat->m_oComments;
|
||||
pComments = pDocxFlat->m_pComments.GetPointer();
|
||||
|
||||
m_oParamsWriter.m_pSettings = pDocxFlat->m_pSettings.GetPointer();
|
||||
m_oParamsWriter.m_pStyles = pDocxFlat->m_pStyles.GetPointer();
|
||||
@ -9378,7 +9415,7 @@ void BinaryFileWriter::intoBindoc(const std::wstring& sDir)
|
||||
}
|
||||
else if (pDocxFlat)
|
||||
{
|
||||
oBinaryDocumentTableWriter.pBackground = dynamic_cast<OOX::WritingElement*>(pDocxFlat->m_oBgPict.GetPointer());
|
||||
oBinaryDocumentTableWriter.pBackground = dynamic_cast<OOX::WritingElement*>(pDocxFlat->m_pBgPict.GetPointer());
|
||||
}
|
||||
|
||||
// Write content
|
||||
|
||||
@ -48,6 +48,8 @@
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/HeaderFooter.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/App.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Core.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Footnote.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Endnote.h"
|
||||
|
||||
namespace NSBinPptxRW
|
||||
{
|
||||
@ -501,7 +503,9 @@ namespace BinDocxRW
|
||||
void WriteSdtFormPr(const OOX::Logic::CFormPr& oFormPr);
|
||||
void WriteSdtTextFormPr(const OOX::Logic::CTextFormPr& oTextFormPr);
|
||||
void WriteSdtTextFormPrComb(const ComplexTypes::Word::CComb& oComb);
|
||||
void WriteSdtTextFormPrFormat(const ComplexTypes::Word::CTextFormFormat& oFormat);
|
||||
void WriteSdtPicture(const OOX::Logic::CSdtPicture& oSdtPicture);
|
||||
void WriteSdtComplexFormPr(const OOX::Logic::CComplexFormPr& oComplexFormPr);
|
||||
};
|
||||
class BinaryCustomsTableWriter
|
||||
{
|
||||
|
||||
@ -48,6 +48,8 @@
|
||||
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/App.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Core.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Endnote.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Footnote.h"
|
||||
|
||||
int BinDocxRW::g_nCurFormatVersion = 0;
|
||||
|
||||
@ -610,3 +612,32 @@ bool BinDocxRW::CDocxSerializer::unpackageFile(const std::wstring& sSrcFileName,
|
||||
|
||||
return file.unpackage(sSrcFileName, sDstPath);
|
||||
}
|
||||
bool BinDocxRW::CDocxSerializer::convertFlat(const std::wstring& sSrcFileName, const std::wstring& sDstPath)
|
||||
{
|
||||
OOX::CDocxFlat docxflat(sSrcFileName);
|
||||
|
||||
if (false == docxflat.m_pDocument.IsInit())
|
||||
return false;
|
||||
|
||||
OOX::CDocx docx;
|
||||
|
||||
if (docxflat.m_pDocument.IsInit())
|
||||
{
|
||||
NSCommon::smart_ptr<OOX::File> file = docxflat.m_pDocument.GetPointer(); file.AddRef();
|
||||
docx.Add(file);
|
||||
docx.m_oMain.document = docxflat.m_pDocument.GetPointer();
|
||||
}
|
||||
if (docxflat.m_pApp.IsInit())
|
||||
{
|
||||
NSCommon::smart_ptr<OOX::File> file(docxflat.m_pApp.GetPointer()); file.AddRef();
|
||||
docx.Add(file);
|
||||
}
|
||||
if (docxflat.m_pCore.IsInit())
|
||||
{
|
||||
NSCommon::smart_ptr<OOX::File> file(docxflat.m_pCore.GetPointer()); file.AddRef();
|
||||
docx.Add(file);
|
||||
}
|
||||
//docxflat.m_oBgPict.GetPointer();
|
||||
|
||||
return docx.Write(sDstPath);
|
||||
}
|
||||
|
||||
@ -66,6 +66,7 @@ namespace BinDocxRW
|
||||
bool saveToFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sTempPath);
|
||||
|
||||
bool unpackageFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath);
|
||||
bool convertFlat(const std::wstring& sSrcFileName, const std::wstring& sDstPath);
|
||||
|
||||
bool CreateDocxFolders(std::wstring strDirectory, std::wstring& sThemePath, std::wstring& sMediaPath, std::wstring& sEmbedPath);
|
||||
|
||||
|
||||
@ -94,6 +94,7 @@ namespace BinXlsxRW{
|
||||
|
||||
oDrawingConverter.SetMediaDstPath(sMediaDir);
|
||||
oDrawingConverter.SetEmbedDstPath(sEmbedDir);
|
||||
oDrawingConverter.SetTempPath(m_sTempDir);
|
||||
|
||||
BinXlsxRW::BinaryFileReader oBinaryFileReader;
|
||||
return oBinaryFileReader.ReadFile(sSrcFileName, sDstPath, &oDrawingConverter, sXMLOptions, m_bIsMacro);
|
||||
@ -147,7 +148,8 @@ namespace BinXlsxRW{
|
||||
|
||||
oDrawingConverter.SetDstPath(sDstPath + FILE_SEPARATOR_STR + L"xl");
|
||||
oDrawingConverter.SetSrcPath(strFileInDir, 2);
|
||||
|
||||
oDrawingConverter.SetFontDir(m_sFontDir);
|
||||
|
||||
BinXlsxRW::BinaryFileReader oBinaryFileReader;
|
||||
return oBinaryFileReader.Xml2Xlsx(sSrcFileName, sDstPath, &oDrawingConverter, sXMLOptions, m_bIsMacro);
|
||||
}
|
||||
@ -181,7 +183,7 @@ namespace BinXlsxRW{
|
||||
|
||||
std::wstring sFileName;
|
||||
|
||||
BinXlsxRW::SaveParams oSaveParams(sDrawingsPath, sEmbedingPath, sThemePath, m_pExternalDrawingConverter->GetContentTypes());
|
||||
BinXlsxRW::SaveParams oSaveParams(sDrawingsPath, sEmbedingPath, sThemePath, m_pExternalDrawingConverter->GetContentTypes(), NULL, true);
|
||||
BinXlsxRW::BinaryChartReader oBinaryChartReader(*pReader, oSaveParams, m_pExternalDrawingConverter);
|
||||
|
||||
bool bResult = false;
|
||||
@ -200,6 +202,8 @@ namespace BinXlsxRW{
|
||||
|
||||
if (bResult && pReader->m_nDocumentType != XMLWRITER_DOC_TYPE_XLSX && !sEmbedingPath.empty() && !bXlsxPresent)
|
||||
{
|
||||
oSaveParams.bMacroEnabled = false;
|
||||
|
||||
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(pReader->m_nCountEmbedded) + L".xlsx";
|
||||
std::wstring sXlsxPath = sEmbedingPath + FILE_SEPARATOR_STR + sXlsxFilename;
|
||||
|
||||
@ -211,8 +215,9 @@ namespace BinXlsxRW{
|
||||
|
||||
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
|
||||
unsigned int rId;
|
||||
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
|
||||
m_pExternalDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rId);
|
||||
std::wstring sChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
|
||||
|
||||
m_pExternalDrawingConverter->WriteRels(sChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rId);
|
||||
|
||||
chart_file->m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData();
|
||||
chart_file->m_oChartSpace.m_externalData->m_id = new std::wstring();
|
||||
@ -257,7 +262,11 @@ namespace BinXlsxRW{
|
||||
}
|
||||
return bResult;
|
||||
}
|
||||
void CXlsxSerializer::setFontDir(const std::wstring& sFontDir)
|
||||
void CXlsxSerializer::setTempDir(const std::wstring& sTempDir)
|
||||
{
|
||||
m_sTempDir = sTempDir;
|
||||
}
|
||||
void CXlsxSerializer::setFontDir(const std::wstring& sFontDir)
|
||||
{
|
||||
m_sFontDir = sFontDir;
|
||||
}
|
||||
|
||||
@ -51,6 +51,7 @@ namespace BinXlsxRW {
|
||||
class CXlsxSerializer
|
||||
{
|
||||
private:
|
||||
std::wstring m_sTempDir;
|
||||
std::wstring m_sFontDir;
|
||||
std::wstring m_sEmbeddedFontsDir;
|
||||
NSBinPptxRW::CDrawingConverter* m_pExternalDrawingConverter;
|
||||
@ -65,6 +66,7 @@ namespace BinXlsxRW {
|
||||
//------------------------------------------------
|
||||
static void CreateXlsxFolders (const std::wstring& sXmlOptions, const std::wstring& sDstPath, std::wstring& sMediaPath, std::wstring& sEmbedPath);
|
||||
|
||||
void setTempDir (const std::wstring& sTempDir);
|
||||
void setFontDir (const std::wstring& sFontDir);
|
||||
void setEmbeddedFontsDir(const std::wstring& sEmbeddedFontsDir);
|
||||
void setDrawingConverter(NSBinPptxRW::CDrawingConverter* pDrawingConverter);
|
||||
|
||||
@ -159,7 +159,7 @@ public:
|
||||
}break;
|
||||
case 'T':
|
||||
{
|
||||
if ((pos + 6 <= size) && (expr.substr(pos, 6) == L"ТОСHKA"))
|
||||
if ((pos + 6 <= size) && (expr.substr(pos, 6) == L"TОСHKA"))
|
||||
{
|
||||
result += L"."; pos += 6;
|
||||
}
|
||||
@ -230,6 +230,21 @@ public:
|
||||
{
|
||||
result += L"'"; pos += 8;
|
||||
}
|
||||
else if ((pos + 8 <= size) && (expr.substr(pos, 8) == L"APERSAND"))
|
||||
{
|
||||
result += L"&"; pos += 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += expr[pos++];
|
||||
}
|
||||
}break;
|
||||
case 'Z':
|
||||
{
|
||||
if ((pos + 9 <= size) && (expr.substr(pos, 9) == L"ZAPYATAYA"))
|
||||
{
|
||||
result += L","; pos += 9;
|
||||
}
|
||||
else
|
||||
{
|
||||
result += expr[pos++];
|
||||
@ -243,7 +258,7 @@ public:
|
||||
}
|
||||
expr = result;
|
||||
//XmlUtils::replace_all( expr, L"MINYS", L"-");
|
||||
//XmlUtils::replace_all( expr, L"ТОСHKA", L".");
|
||||
//XmlUtils::replace_all( expr, L"TОСHKA", L".");
|
||||
//XmlUtils::replace_all( expr, L"VOSKL", L"!");
|
||||
|
||||
//XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
|
||||
@ -273,7 +288,11 @@ public:
|
||||
}break;
|
||||
case '.':
|
||||
{
|
||||
result += L"ТОСHKA";
|
||||
result += L"TОСHKA";
|
||||
}break;
|
||||
case ',':
|
||||
{
|
||||
result += L"ZAPYATAYA";
|
||||
}break;
|
||||
case '!':
|
||||
{
|
||||
@ -307,6 +326,10 @@ public:
|
||||
{
|
||||
result += L"KAVYCHKA";
|
||||
}break;
|
||||
case '&':
|
||||
{
|
||||
result += L"APERSAND";
|
||||
}break;
|
||||
default:
|
||||
{
|
||||
result += expr[pos];
|
||||
@ -317,7 +340,7 @@ public:
|
||||
expr = result;
|
||||
|
||||
//XmlUtils::replace_all( expr, L"-", L"MINYS");
|
||||
//XmlUtils::replace_all( expr, L".", L"ТОСHKA");
|
||||
//XmlUtils::replace_all( expr, L".", L"TОСHKA");
|
||||
//XmlUtils::replace_all( expr, L"!", L"VOSKL");
|
||||
|
||||
//XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
|
||||
@ -648,6 +671,7 @@ void oox2odf_converter::Impl::replace_semicolons(std::wstring& expr)
|
||||
// boost::match_default | boost::format_all);
|
||||
// expr = res;
|
||||
//}
|
||||
|
||||
// заменить вертикальную черту во всех вхождениях в фигурных скобках, но не внутри строк
|
||||
void oox2odf_converter::Impl::replace_vertical(std::wstring& expr)
|
||||
{
|
||||
@ -804,6 +828,7 @@ std::wstring oox2odf_converter::Impl::convert_conditional_formula(const std::wst
|
||||
|
||||
}
|
||||
|
||||
XmlUtils::replace_all(res, L"&", L"&");
|
||||
oox_replace_tmp_back( res);
|
||||
|
||||
replace_vertical(res);
|
||||
|
||||
@ -569,7 +569,8 @@ enum ElementType
|
||||
|
||||
typeScriptEventListener,
|
||||
|
||||
typeNumberNumberStyle,
|
||||
typeNumberBaseStyle,
|
||||
typeNumberNumberStyle,
|
||||
typeNumberDataStyle,
|
||||
typeNumberText,
|
||||
typeNumberNumber,
|
||||
|
||||
@ -37,6 +37,8 @@
|
||||
#include <stack>
|
||||
#include <cassert>
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
|
||||
@ -320,7 +322,7 @@ typedef xml::writer::element<wchar_t> xml_element;
|
||||
|
||||
|
||||
#define CP_XML_ATTR_OPT(NAME, VAL) if (VAL)CP_XML_ATTR(NAME, (*VAL))
|
||||
#define CP_XML_ATTR_OPT_ENCODE_STRING(NAME, STR) if (STR)CP_XML_ATTR(NAME, XmlUtils::EncodeXmlString(XmlUtils::EncodeXmlString(*STR)))
|
||||
#define CP_XML_ATTR_OPT_ENCODE_STRING(NAME, STR) if (STR)CP_XML_ATTR(NAME, XmlUtils::EncodeXmlString(*STR))
|
||||
|
||||
#define CP_XML_NODE_SIMPLE() std::wstring NS_NAME = std::wstring(ns) + std::wstring(L":") + std::wstring(name); CP_XML_NODE(NS_NAME)
|
||||
|
||||
|
||||
@ -123,7 +123,7 @@ void content_types_file::write(const std::wstring & RootPath)
|
||||
content_type_content_.xml_to_stream(resStream);
|
||||
std::wstring res = resStream.str();
|
||||
|
||||
simple_element elm(filename_, resStream.str());
|
||||
simple_element elm(filename_, res);
|
||||
elm.write(RootPath);
|
||||
}
|
||||
|
||||
|
||||
@ -69,11 +69,11 @@ class slide_content : noncopyable
|
||||
{
|
||||
public:
|
||||
slide_content();
|
||||
std::wostream & content() { return content_; }
|
||||
std::wstringstream & content() { return content_; }
|
||||
void add_rel(relationship const & r);
|
||||
void add_rels(rels & r);
|
||||
rels_file_ptr get_rel_file() { return rels_; }
|
||||
std::wstring str() { return content_.str(); }
|
||||
std::wstring str() { return content_.str(); }
|
||||
|
||||
static _CP_PTR(slide_content) create();
|
||||
|
||||
|
||||
@ -172,13 +172,13 @@ void pptx_text_context::Impl::start_paragraph(const std::wstring & styleName)
|
||||
{
|
||||
if (paragraphs_cout_++ > 0)
|
||||
{
|
||||
if (in_list_ == false || in_comment == true)
|
||||
{
|
||||
// конец предыдущего абзаца и начало следующего
|
||||
//text_ << L" ";
|
||||
text_ << L"\n";
|
||||
}
|
||||
else/* (paragraph_style_name_ != styleName)*/
|
||||
//if (in_list_ == false || in_comment == true)
|
||||
//{
|
||||
//// конец предыдущего абзаца и начало следующего
|
||||
////text_ << L" ";
|
||||
// text_ << L"\n";
|
||||
//}
|
||||
//else/* (paragraph_style_name_ != styleName)*/
|
||||
{
|
||||
dump_paragraph();
|
||||
}
|
||||
|
||||
@ -50,6 +50,8 @@ public:
|
||||
// добавить условный формат числа
|
||||
void add_format(std::wstring const & condition, std::wstring const & format);
|
||||
|
||||
std::wstring name;
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
_CP_SCOPED_PTR(Impl) impl_;
|
||||
|
||||
@ -33,9 +33,9 @@
|
||||
#include "xlsx_defined_names.h"
|
||||
|
||||
#include <vector>
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
|
||||
#include "../../formulasconvert/formulasconvert.h"
|
||||
#include "../../include/xml/simple_xml_writer.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
@ -75,7 +75,7 @@ public:
|
||||
{
|
||||
CP_XML_NODE(L"definedName")
|
||||
{
|
||||
CP_XML_ATTR(L"name", content_[i].name);
|
||||
CP_XML_ATTR(L"name", XmlUtils::EncodeXmlString(content_[i].name));
|
||||
|
||||
if (content_[i].tableId >= 0)
|
||||
{
|
||||
@ -84,11 +84,11 @@ public:
|
||||
|
||||
if ( content_[i].ref.find(L"#REF!") != std::wstring::npos )
|
||||
{
|
||||
CP_XML_ATTR(L"comment", content_[i].ref);
|
||||
CP_XML_ATTR(L"comment", XmlUtils::EncodeXmlString(content_[i].ref));
|
||||
CP_XML_CONTENT(L"#REF!");
|
||||
}
|
||||
else
|
||||
CP_XML_CONTENT(content_[i].ref);
|
||||
CP_XML_CONTENT(XmlUtils::EncodeXmlString(content_[i].ref));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,9 +118,10 @@ std::wstring num_format_context::get_last_time_format() const
|
||||
{
|
||||
return impl_->last_time_format_;
|
||||
}
|
||||
void num_format_context::start_complex_format()
|
||||
void num_format_context::start_complex_format(std::wstring const & name)
|
||||
{
|
||||
impl2_->complex_number_format_.reset();
|
||||
impl2_->complex_number_format_.name = name;
|
||||
}
|
||||
odf_types::office_value_type::type num_format_context::type() const
|
||||
{
|
||||
@ -138,7 +139,20 @@ void num_format_context::add_format(std::wstring const & cond, std::wstring cons
|
||||
void num_format_context::end_complex_format()
|
||||
{
|
||||
impl_->last_format_ = impl2_->complex_number_format_.result_value();
|
||||
}
|
||||
|
||||
mapFormats.insert(std::make_pair(impl2_->complex_number_format_.name, std::make_pair(impl_->type_.get_type(), impl_->last_format_)));
|
||||
}
|
||||
std::wstring num_format_context::find_complex_format(std::wstring const & name, odf_types::office_value_type::type & type)
|
||||
{
|
||||
std::map<std::wstring, std::pair<odf_types::office_value_type::type, std::wstring>>::iterator pFind = mapFormats.find(name);
|
||||
|
||||
if (pFind != mapFormats.end())
|
||||
{
|
||||
type = pFind->second.first;
|
||||
return pFind->second.second;
|
||||
}
|
||||
else
|
||||
return L"";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,7 +51,6 @@ public:
|
||||
num_format_context(odf_reader::odf_read_context & odfContext);
|
||||
~num_format_context();
|
||||
|
||||
public:
|
||||
void start_format(const std::wstring & style_name);
|
||||
std::wostream & output();
|
||||
void end_format();
|
||||
@ -63,16 +62,19 @@ public:
|
||||
odf_types::office_value_type::type type() const;
|
||||
void type(odf_types::office_value_type::type t);
|
||||
|
||||
void start_complex_format();
|
||||
void start_complex_format(std::wstring const & name);
|
||||
void add_format(std::wstring const & cond, std::wstring const & format);
|
||||
void end_complex_format();
|
||||
|
||||
std::wstring find_complex_format(std::wstring const & name, odf_types::office_value_type::type & type);
|
||||
|
||||
//std::wstring default_data_style(int type);
|
||||
odf_reader::odf_read_context & odf_context_;
|
||||
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
std::map<std::wstring, std::pair<odf_types::office_value_type::type, std::wstring>> mapFormats;
|
||||
|
||||
class Impl;
|
||||
_CP_SCOPED_PTR(Impl) impl_;
|
||||
|
||||
class Impl2;
|
||||
|
||||
@ -45,6 +45,29 @@ public:
|
||||
std::wstring name_;
|
||||
bool hidden_;
|
||||
|
||||
void clear()
|
||||
{
|
||||
cols_.clear();
|
||||
sheetFormat_.clear();
|
||||
sheetData_.clear();
|
||||
mergeCells_.clear();
|
||||
hyperlinks_.clear();
|
||||
comments_.clear();
|
||||
sort_.clear();
|
||||
tableParts_.clear();
|
||||
autofilter_.clear();
|
||||
conditionalFormatting_.clear();
|
||||
picture_background_.clear();
|
||||
dataValidations_.clear();
|
||||
dataValidationsX14_.clear();
|
||||
ole_objects_.clear();
|
||||
page_props_.clear();
|
||||
header_footer_.clear();
|
||||
controls_.clear();
|
||||
protection_.clear();
|
||||
breaks_.clear();
|
||||
}
|
||||
|
||||
std::wstringstream cols_;
|
||||
std::wstringstream sheetFormat_;
|
||||
std::wstringstream sheetData_;
|
||||
@ -202,11 +225,16 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
|
||||
CP_XML_NODE(L"sheetData")
|
||||
{
|
||||
CP_XML_STREAM() << impl_->sheetData_.str();
|
||||
if (impl_->sheetData_.rdbuf()->in_avail() != 0)
|
||||
{
|
||||
impl_->sheetData_.flush();
|
||||
CP_XML_STREAM() << impl_->sheetData_.rdbuf();
|
||||
}
|
||||
}
|
||||
if (!impl_->protection_.str().empty())
|
||||
std::wstring protect = impl_->protection_.str();
|
||||
if (false == protect.empty())
|
||||
{
|
||||
CP_XML_STREAM() << impl_->protection_.str();
|
||||
CP_XML_STREAM() << protect;
|
||||
}
|
||||
//оказывается порядок нахождения элементов важен !!! (для office 2010)
|
||||
//объединенные ячейки раньше чем гиперлинки !!!
|
||||
@ -220,11 +248,13 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_STREAM() << impl_->conditionalFormatting_.str();
|
||||
|
||||
CP_XML_STREAM() << impl_->dataValidations_.str();
|
||||
if (!impl_->hyperlinks_.str().empty())
|
||||
|
||||
std::wstring hyperlinks = impl_->hyperlinks_.str();
|
||||
if (false == hyperlinks.empty())
|
||||
{
|
||||
CP_XML_NODE(L"hyperlinks")
|
||||
{
|
||||
CP_XML_STREAM() << impl_->hyperlinks_.str();
|
||||
CP_XML_STREAM() << hyperlinks;
|
||||
}
|
||||
}
|
||||
CP_XML_STREAM() << impl_->page_props_.str();
|
||||
@ -248,30 +278,34 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_ATTR(L"r:id", impl_->vml_drawingId_);
|
||||
}
|
||||
}
|
||||
if (false == impl_->ole_objects_.str().empty())
|
||||
std::wstring oleObjects = impl_->ole_objects_.str();
|
||||
if (false == oleObjects.empty())
|
||||
{
|
||||
CP_XML_NODE(L"oleObjects")
|
||||
{
|
||||
CP_XML_STREAM() << impl_->ole_objects_.str();
|
||||
CP_XML_STREAM() << oleObjects;
|
||||
}
|
||||
}
|
||||
std::wstring controls = impl_->controls_.str();
|
||||
if (false == impl_->controls_.str().empty())
|
||||
{
|
||||
CP_XML_NODE(L"controls")
|
||||
{
|
||||
CP_XML_STREAM() << impl_->controls_.str();
|
||||
CP_XML_STREAM() << controls;
|
||||
}
|
||||
}
|
||||
if (false == impl_->tableParts_.str().empty())
|
||||
std::wstring tableParts = impl_->tableParts_.str();
|
||||
if (false == tableParts.empty())
|
||||
{
|
||||
CP_XML_NODE(L"tableParts")
|
||||
{
|
||||
CP_XML_STREAM() << impl_->tableParts_.str();
|
||||
CP_XML_STREAM() << tableParts;
|
||||
}
|
||||
}
|
||||
CP_XML_STREAM() << impl_->picture_background_.str();
|
||||
|
||||
if (false == impl_->dataValidationsX14_.str().empty())
|
||||
std::wstring dataValidations14 = impl_->dataValidationsX14_.str();
|
||||
if (false == dataValidations14.empty())
|
||||
{
|
||||
CP_XML_NODE(L"extLst")
|
||||
{
|
||||
@ -280,12 +314,13 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_ATTR(L"uri", L"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}");
|
||||
CP_XML_ATTR(L"xmlns:x14", L"http://schemas.microsoft.com/office/spreadsheetml/2009/9/main");
|
||||
|
||||
CP_XML_STREAM() << impl_->dataValidationsX14_.str();
|
||||
CP_XML_STREAM() << dataValidations14;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
impl_->clear();
|
||||
}
|
||||
|
||||
void xlsx_xml_worksheet::set_drawing_link(std::wstring const & fileName, std::wstring const & id)
|
||||
|
||||
@ -173,7 +173,7 @@ void sheets_files::write(const std::wstring & RootPath)
|
||||
|
||||
//item->get_rel_file()->write(path.string<std::wstring>());
|
||||
|
||||
package::simple_element(fileName, item->str()).write(path);
|
||||
package::simple_element(fileName, item->content().str()).write(path);
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------
|
||||
@ -375,7 +375,7 @@ void xl_pivot_cache_files::write(const std::wstring & RootPath)
|
||||
|
||||
contentTypes->add_override(std::wstring(L"/xl/pivotCache/") + fileNameD, kWSConTypeD);
|
||||
|
||||
package::simple_element(fileNameD, pivot_caches_[i]->str_d()).write(path);
|
||||
package::simple_element(fileNameD, pivot_caches_[i]->definitions().str()).write(path);
|
||||
|
||||
if (pivot_caches_[i]->get_rels().empty() == false)
|
||||
{
|
||||
@ -392,7 +392,7 @@ void xl_pivot_cache_files::write(const std::wstring & RootPath)
|
||||
const std::wstring fileRef = std::wstring(L"pivotCache/") + fileNameD;
|
||||
rels_->add(id, kWSRel, fileRef);
|
||||
}
|
||||
std::wstring content_records = pivot_caches_[i]->str_r();
|
||||
std::wstring content_records = pivot_caches_[i]->records().str();
|
||||
if (!content_records.empty())
|
||||
{
|
||||
const std::wstring fileNameR = std::wstring(L"pivotCacheRecords") + std::to_wstring(i + 1) + L".xml";
|
||||
|
||||
@ -57,13 +57,11 @@ class sheet_content : noncopyable
|
||||
{
|
||||
public:
|
||||
sheet_content();
|
||||
std::wostream & content() { return content_; }
|
||||
std::wstringstream & content() { return content_; }
|
||||
void add_rel(relationship const & r);
|
||||
void add_rels(rels & r);
|
||||
rels_file_ptr get_rel_file() { return rels_; }
|
||||
std::wstring str() { return content_.str(); }
|
||||
static _CP_PTR(sheet_content) create();
|
||||
|
||||
private:
|
||||
std::wstringstream content_;
|
||||
rels_file_ptr rels_;
|
||||
@ -79,13 +77,10 @@ public:
|
||||
pivot_cache_content();
|
||||
static _CP_PTR(pivot_cache_content) create();
|
||||
|
||||
std::wostream & definitions() { return definitions_; }
|
||||
std::wostream & records() { return records_; }
|
||||
std::wstringstream & definitions() { return definitions_; }
|
||||
std::wstringstream & records() { return records_; }
|
||||
rels & get_rels() { return definitions_rels_file_->get_rels(); }
|
||||
|
||||
std::wstring str_d() { return definitions_.str(); }
|
||||
std::wstring str_r() { return records_.str(); }
|
||||
|
||||
friend class xl_pivot_cache_files;
|
||||
private:
|
||||
std::wstringstream records_;
|
||||
|
||||
@ -236,20 +236,20 @@ double convertTime(int hours, int minutes, double sec)
|
||||
return v;
|
||||
}
|
||||
|
||||
bool parseDate(const std::wstring & Date, int & Year, int & Month, int & Day)
|
||||
bool parseDateTime(const std::wstring & DateTime, int & Year, int & Month, int & Day,
|
||||
_CP_OPT(int) & Hours, _CP_OPT(int) & Minutes, _CP_OPT(int) & Sec)
|
||||
{
|
||||
// for example, "1899-12-31T05:37:46.665696"
|
||||
try
|
||||
{
|
||||
boost::wregex r(L"([\\d]+)-([\\d]+)-([\\d]+)(?:T([\\d]+):([\\d]+):([\\d]+)(?:\\.([\\d]+))?)?");
|
||||
boost::match_results<std::wstring::const_iterator> res;
|
||||
if (boost::regex_match(Date, res, r))
|
||||
if (boost::regex_match(DateTime, res, r))
|
||||
{
|
||||
Year = boost::lexical_cast<int>(res[1].str());
|
||||
Month = boost::lexical_cast<int>(res[2].str());
|
||||
Day = boost::lexical_cast<int>(res[3].str());
|
||||
|
||||
int Hours, Minutes, Sec, FSec;
|
||||
if (res[4].matched)
|
||||
Hours = boost::lexical_cast<int>(res[4].str());
|
||||
|
||||
@ -260,7 +260,7 @@ bool parseDate(const std::wstring & Date, int & Year, int & Month, int & Day)
|
||||
Sec = boost::lexical_cast<int>(res[6].str());
|
||||
|
||||
if (res[7].matched)
|
||||
FSec = boost::lexical_cast<int>(res[7].str());
|
||||
int FSec = boost::lexical_cast<int>(res[7].str());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <boost/cstdint.hpp>
|
||||
|
||||
#include "../../include/CPOptional.h"
|
||||
#include "xlsx_cell_format.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
@ -57,9 +57,7 @@ bool parseBoolVal(const std::wstring & str);
|
||||
|
||||
std::wstring cellType2Str(XlsxCellType::type type);
|
||||
|
||||
|
||||
|
||||
bool parseDate(const std::wstring & Date, int & Year, int & Month, int & Day);
|
||||
bool parseDateTime(const std::wstring & DateTime, int & Y, int & M, int & D, _CP_OPT(int) & H, _CP_OPT(int) & Min, _CP_OPT(int) & S);
|
||||
bool parseTime(const std::wstring & Time, int & Hours, int & Minutes, double & seconds);
|
||||
boost::int64_t convertDate(int Year, int Month, int Day);
|
||||
double convertTime(int hours, int minutes, double sec);
|
||||
|
||||
@ -192,7 +192,7 @@ void xlsx_conversion_context::end_document()
|
||||
{
|
||||
CP_XML_NODE(L"sheet")
|
||||
{
|
||||
CP_XML_ATTR(L"name", sheet->name()); // office 2010 ! ограничение на длину имени !!!
|
||||
CP_XML_ATTR(L"name", XmlUtils::EncodeXmlString(sheet->name())); // office 2010 ! ограничение на длину имени !!!
|
||||
CP_XML_ATTR(L"sheetId", i + 1);
|
||||
CP_XML_ATTR(L"state", sheet->hidden() ? L"hidden" : L"visible");
|
||||
CP_XML_ATTR(L"r:id", id);
|
||||
|
||||
@ -646,34 +646,50 @@ void process_build_object::ApplyChartProperties(std::wstring style, std::vector<
|
||||
|
||||
if (false == data_style_name.empty())
|
||||
{
|
||||
office_element_ptr elm = number_styles_.find_by_style_name(data_style_name);
|
||||
number_style_base *number_style = dynamic_cast<number_style_base*>(elm.get());
|
||||
|
||||
if (number_style)
|
||||
office_value_type::type num_format_type = office_value_type::Custom;
|
||||
std::wstring num_format = num_format_context_.find_complex_format(data_style_name, num_format_type);
|
||||
|
||||
if (num_format.empty())
|
||||
{
|
||||
num_format_context_.start_complex_format();
|
||||
number_style->oox_convert(num_format_context_);
|
||||
num_format_context_.end_complex_format();
|
||||
|
||||
std::wstring num_format = num_format_context_.get_last_format();
|
||||
|
||||
_property p(L"num_format", num_format);
|
||||
propertiesOut.push_back(p);
|
||||
office_element_ptr elm = number_styles_.find_by_style_name(data_style_name);
|
||||
number_style_base *number_style = dynamic_cast<number_style_base*>(elm.get());
|
||||
|
||||
if (number_style)
|
||||
{
|
||||
num_format_context_.start_complex_format(data_style_name);
|
||||
number_style->oox_convert(num_format_context_);
|
||||
num_format_context_.end_complex_format();
|
||||
|
||||
num_format = num_format_context_.get_last_format();
|
||||
}
|
||||
}
|
||||
if (false == num_format.empty())
|
||||
{
|
||||
_property p(L"num_format", num_format);
|
||||
propertiesOut.push_back(p);
|
||||
}
|
||||
}
|
||||
if (false == percentage_data_style_name.empty())
|
||||
{
|
||||
office_element_ptr elm = number_styles_.find_by_style_name(percentage_data_style_name);
|
||||
number_style_base *number_style = dynamic_cast<number_style_base*>(elm.get());
|
||||
|
||||
if (number_style)
|
||||
office_value_type::type num_format_type = office_value_type::Percentage;
|
||||
std::wstring num_format = num_format_context_.find_complex_format(percentage_data_style_name, num_format_type);
|
||||
|
||||
if (num_format.empty())
|
||||
{
|
||||
office_element_ptr elm = number_styles_.find_by_style_name(percentage_data_style_name);
|
||||
number_style_base *number_style = dynamic_cast<number_style_base*>(elm.get());
|
||||
|
||||
if (number_style)
|
||||
{
|
||||
num_format_context_.start_complex_format(percentage_data_style_name);
|
||||
number_style->oox_convert(num_format_context_);
|
||||
num_format_context_.end_complex_format();
|
||||
|
||||
num_format = num_format_context_.get_last_format();
|
||||
}
|
||||
}
|
||||
if (false == num_format.empty())
|
||||
{
|
||||
num_format_context_.start_complex_format();
|
||||
number_style->oox_convert(num_format_context_);
|
||||
num_format_context_.end_complex_format();
|
||||
|
||||
std::wstring num_format = num_format_context_.get_last_format();
|
||||
|
||||
_property p(L"percentage_num_format", num_format);
|
||||
propertiesOut.push_back(p);
|
||||
}
|
||||
|
||||
@ -392,10 +392,10 @@ void common_xlink_attlist::apply_from(const common_xlink_attlist & Other)
|
||||
}
|
||||
void common_xlink_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"xlink:href", href_);
|
||||
CP_XML_ATTR_OPT(L"xlink:type", type_);
|
||||
CP_XML_ATTR_OPT(L"xlink:show", show_);
|
||||
CP_XML_ATTR_OPT(L"xlink:actuate", actuate_);
|
||||
CP_XML_ATTR_OPT_ENCODE_STRING(L"xlink:href", href_);
|
||||
CP_XML_ATTR_OPT(L"xlink:type", type_);
|
||||
CP_XML_ATTR_OPT(L"xlink:show", show_);
|
||||
CP_XML_ATTR_OPT(L"xlink:actuate", actuate_);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -444,7 +444,7 @@ void common_value_and_type_attlist::serialize(CP_ATTR_NODE)
|
||||
CP_XML_ATTR_OPT(L"office:date-value", office_date_value_);
|
||||
CP_XML_ATTR_OPT(L"office:time-value", office_time_value_);
|
||||
CP_XML_ATTR_OPT(L"office:boolean-value", office_boolean_value_);
|
||||
CP_XML_ATTR_OPT(L"office:string-value", office_string_value_);
|
||||
CP_XML_ATTR_OPT_ENCODE_STRING(L"office:string-value", office_string_value_);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@ -99,7 +99,7 @@ std::wstring presentation_class::get_type_ms()
|
||||
//res = L"subTitle";
|
||||
break;
|
||||
case graphic:
|
||||
res = L"dgm";
|
||||
res = L"body";
|
||||
break;
|
||||
case object:
|
||||
res = L"obj";
|
||||
|
||||
@ -863,8 +863,8 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
drawing->relativeHeight = L"2";
|
||||
drawing->behindDoc = L"0";
|
||||
|
||||
if (((drawing->styleWrap && drawing->styleWrap->get_type() == style_wrap::RunThrough) ||
|
||||
!drawing->styleWrap) && styleRunThrough && styleRunThrough->get_type() == run_through::Background)
|
||||
if (((drawing->styleWrap && drawing->styleWrap->get_type() == style_wrap::RunThrough) || !drawing->styleWrap)
|
||||
&& ((styleRunThrough && styleRunThrough->get_type() == run_through::Background) || !styleRunThrough))
|
||||
{
|
||||
drawing->behindDoc = L"1";
|
||||
if (!drawing->styleWrap)
|
||||
|
||||
@ -413,7 +413,7 @@ void format_number_number(
|
||||
strm << L"General";
|
||||
}
|
||||
|
||||
if (number_decimal_places_)
|
||||
if ((number_decimal_places_) && (*number_decimal_places_ > 0))
|
||||
{
|
||||
strm << L".";
|
||||
strm << std::wstring(*number_decimal_places_, L'0');
|
||||
|
||||
@ -175,7 +175,7 @@ void office_annotation::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
author = xml::utils::replace_text_to_xml(dynamic_cast<dc_creator * >(dc_creator_.get())->content_);
|
||||
}
|
||||
int col = Context.current_table_column() + 1; if (col < 0) col = 0;
|
||||
int col = Context.current_table_column(); if (col < 0) col = 0;
|
||||
int row = Context.current_table_row(); if (row < 0) row = 0;
|
||||
|
||||
std::wstring ref = oox::getCellAddress(col, row);
|
||||
|
||||
@ -241,18 +241,25 @@ void style_table_column_properties::docx_convert(oox::docx_conversion_context &
|
||||
double width = 0.5 + 20.0 * attlist_.style_column_width_->get_value_unit(length::pt) * kf_max_width_ms;
|
||||
|
||||
Context.get_table_context().add_column_width(width);
|
||||
strm << L"<w:gridCol w:w=\"" << (int)(width) << "\"/>";
|
||||
if (width > 0)
|
||||
strm << L"<w:gridCol w:w=\"" << (int)(width) << "\"/>";
|
||||
else
|
||||
strm << L"<w:gridCol/>";
|
||||
}
|
||||
else if ((attlist_.style_rel_column_width_) && (attlist_.style_rel_column_width_->get_unit() == length::rel))
|
||||
{
|
||||
double width = 0.5 + 20.0 * page_width * attlist_.style_rel_column_width_->get_value() / 65534.;
|
||||
|
||||
Context.get_table_context().add_column_width(width);
|
||||
strm << L"<w:gridCol w:w=\"" << (int)(width) << "\"/>";
|
||||
if (width > 0)
|
||||
strm << L"<w:gridCol w:w=\"" << (int)(width) << "\"/>";
|
||||
else
|
||||
strm << L"<w:gridCol/>";
|
||||
}
|
||||
else
|
||||
{
|
||||
Context.get_table_context().add_column_width(0);
|
||||
strm << L"<w:gridCol/>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -810,7 +810,7 @@ const wchar_t * table_content_validation::name = L"content-validation";
|
||||
|
||||
void table_content_validation::add_attributes(xml::attributes_wc_ptr const & Attributes)
|
||||
{
|
||||
CP_APPLY_ATTR(L"table:name", table_name_);
|
||||
CP_APPLY_ATTR(L"table:name", table_name_);
|
||||
CP_APPLY_ATTR(L"table:condition", table_condition_);
|
||||
CP_APPLY_ATTR(L"table:display-list", table_display_list_);
|
||||
CP_APPLY_ATTR(L"table:allowempty-cell", table_allowempty_cell_);
|
||||
|
||||
@ -461,11 +461,7 @@ double pixToSize(double pixels, double maxDigitSize)
|
||||
|
||||
return (int(( pixels /*/ 0.75*/ - 5)/ maxDigitSize * 100. + 0.5)) /100. * 0.9; // * 9525. * 72.0 / (360000.0 * 2.54);
|
||||
}
|
||||
double cmToChars (double cm)
|
||||
{
|
||||
double pt = cm * 28.34467120181406;
|
||||
return pt * 48. /(12.75 * 8.43 *2.);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
@ -552,8 +548,6 @@ void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
const double pixDpi = in_width * 96.;
|
||||
width = pixToSize(pixDpi, Context.getMaxDigitSize().first);
|
||||
|
||||
//const double width = cmToChars(prop->attlist_.style_column_width_->get_value_unit(length::cm));
|
||||
|
||||
// see ECMA-376 page 1768
|
||||
if (in_width > 0)
|
||||
CP_XML_ATTR(L"width", *width);
|
||||
@ -747,19 +741,23 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
if (false == data_style.empty())
|
||||
{
|
||||
office_element_ptr elm = odfContext.numberStyles().find_by_style_name(data_style);
|
||||
number_style_base *num_style = dynamic_cast<number_style_base*>(elm.get());
|
||||
|
||||
if (num_style)
|
||||
{
|
||||
Context.get_num_format_context().start_complex_format();
|
||||
num_style->oox_convert(Context.get_num_format_context());
|
||||
Context.get_num_format_context().end_complex_format();
|
||||
|
||||
num_format = Context.get_num_format_context().get_last_format();
|
||||
num_format = Context.get_num_format_context().find_complex_format(data_style, num_format_type);
|
||||
|
||||
num_format_type = Context.get_num_format_context().type();
|
||||
}
|
||||
if (num_format.empty())
|
||||
{
|
||||
office_element_ptr elm = odfContext.numberStyles().find_by_style_name(data_style);
|
||||
number_style_base *num_style = dynamic_cast<number_style_base*>(elm.get());
|
||||
|
||||
if (num_style)
|
||||
{
|
||||
Context.get_num_format_context().start_complex_format(data_style);
|
||||
num_style->oox_convert(Context.get_num_format_context());
|
||||
Context.get_num_format_context().end_complex_format();
|
||||
|
||||
num_format = Context.get_num_format_context().get_last_format();
|
||||
num_format_type = Context.get_num_format_context().type();
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------
|
||||
std::wstring number_val;
|
||||
@ -810,16 +808,29 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
if (attr.office_date_value_)
|
||||
{
|
||||
int y, m, d;
|
||||
if (oox::parseDate(attr.office_date_value_.get(), y, m, d))
|
||||
_CP_OPT(int) h, min, sec;
|
||||
if (oox::parseDateTime(attr.office_date_value_.get(), y, m, d, h, min, sec))
|
||||
{
|
||||
boost::int64_t intDate = oox::convertDate(y, m, d);
|
||||
_CP_OPT(double) dTime;
|
||||
if (h && min)
|
||||
{
|
||||
dTime = oox::convertTime(*h, *min, sec.get_value_or(0));
|
||||
}
|
||||
if (intDate > 0)
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(intDate);
|
||||
if (dTime)
|
||||
{
|
||||
number_val = XmlUtils::DoubleToString(*dTime + intDate);
|
||||
}
|
||||
else
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(intDate);
|
||||
}
|
||||
xlsx_value_type = oox::XlsxCellType::n;
|
||||
|
||||
if (num_format_type == office_value_type::Currency)
|
||||
{//тип формата данных из стиля не соответствует формату анных ячейки
|
||||
{//тип формата данных из стиля не соответствует формату данных ячейки
|
||||
num_format.clear();
|
||||
num_format_type = office_value_type::Date;
|
||||
}
|
||||
@ -1001,7 +1012,7 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
CP_XML_ATTR(L"t", L"array");
|
||||
CP_XML_ATTR(L"aca", false);
|
||||
}
|
||||
CP_XML_CONTENT(xlsxFormula);
|
||||
CP_XML_CONTENT(XmlUtils::EncodeXmlString(xlsxFormula));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1151,12 +1162,26 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte
|
||||
if (attr.office_date_value_)
|
||||
{
|
||||
int y, m, d;
|
||||
if (oox::parseDate(attr.office_date_value_.get(), y, m, d))
|
||||
_CP_OPT(int) h, min, s;
|
||||
if (oox::parseDateTime(attr.office_date_value_.get(), y, m, d, h, min, s))
|
||||
{
|
||||
boost::int64_t intDate = oox::convertDate(y, m, d);
|
||||
_CP_OPT(double) dTime;
|
||||
|
||||
if (h && min)
|
||||
{
|
||||
dTime = oox::convertTime(*h, *min, s.get_value_or(0));
|
||||
}
|
||||
if (intDate > 0)
|
||||
{
|
||||
number_val = boost::lexical_cast<std::wstring>(intDate);
|
||||
if (dTime)
|
||||
{
|
||||
number_val = XmlUtils::DoubleToString(*dTime + intDate);
|
||||
}
|
||||
else
|
||||
{
|
||||
number_val = std::to_wstring(intDate);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1195,17 +1220,22 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte
|
||||
|
||||
if (!data_style.empty())
|
||||
{
|
||||
office_element_ptr elm = odfContext.numberStyles().find_by_style_name(data_style);
|
||||
number_style_base *num_style = dynamic_cast<number_style_base*>(elm.get());
|
||||
|
||||
if (num_style)
|
||||
num_format = Context.get_num_format_context().find_complex_format(data_style, odf_value_type);
|
||||
|
||||
if (num_format.empty())
|
||||
{
|
||||
Context.get_num_format_context().start_complex_format();
|
||||
office_element_ptr elm = odfContext.numberStyles().find_by_style_name(data_style);
|
||||
number_style_base *num_style = dynamic_cast<number_style_base*>(elm.get());
|
||||
|
||||
if (num_style)
|
||||
{
|
||||
Context.get_num_format_context().start_complex_format(data_style);
|
||||
num_style->oox_convert(Context.get_num_format_context());
|
||||
Context.get_num_format_context().end_complex_format();
|
||||
|
||||
num_format = Context.get_num_format_context().get_last_format();
|
||||
}
|
||||
Context.get_num_format_context().end_complex_format();
|
||||
|
||||
num_format = Context.get_num_format_context().get_last_format();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
oox::xlsx_cell_format cellFormat;
|
||||
|
||||
@ -365,6 +365,16 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context, _CP_OPT(std
|
||||
}
|
||||
for (size_t i = index; i < content_.size(); i++)
|
||||
{
|
||||
if (content_[i]->get_type() == typeTextP)
|
||||
{//параграф в параграфе .... оО
|
||||
p *para_inside = dynamic_cast<p*>(content_[i].get());
|
||||
|
||||
for (size_t j = 0; (para_inside) && (j < para_inside->paragraph_.content_.size()); ++j)
|
||||
{
|
||||
para_inside->paragraph_.content_[j]->docx_convert(Context);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (Context.get_page_break())
|
||||
{
|
||||
if (Context.process_headers_footers_ == false)
|
||||
@ -2054,6 +2064,11 @@ void variable_get::docx_convert(oox::docx_conversion_context & Context)
|
||||
const wchar_t * variable_set::ns = L"text";
|
||||
const wchar_t * variable_set::name = L"variable-set";
|
||||
|
||||
void variable_set::add_text(const std::wstring & Text)
|
||||
{
|
||||
office_element_ptr elm = text::create(Text);
|
||||
content_.push_back(elm);
|
||||
}
|
||||
void variable_set::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"style:data-style-name", style_data_style_name_);
|
||||
@ -2066,7 +2081,31 @@ void variable_set::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
}
|
||||
void variable_set::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
Context.finish_run();
|
||||
|
||||
Context.output_stream() << L"<w:sdt>";
|
||||
Context.output_stream() << L"<w:sdtPr>";
|
||||
{
|
||||
Context.output_stream() << L"<w:id w:val=\"" + std::to_wstring(Context.get_drawing_context().get_current_shape_id()) + L"\"/>";
|
||||
if (name_)
|
||||
{
|
||||
Context.output_stream() << L"<w:placeholder/>";
|
||||
Context.output_stream() << L"<w:docPart w:val=\"" + xml::utils::replace_text_to_xml(*name_) + L"\"/>";
|
||||
}
|
||||
Context.output_stream() << L"<w:showingPlcHdr/>";
|
||||
Context.output_stream() << L"<w:text/>";
|
||||
}
|
||||
Context.output_stream() << L"</w:sdtPr>";
|
||||
Context.output_stream() << L"<w:sdtContent>";
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->docx_convert(Context);
|
||||
}
|
||||
}
|
||||
Context.finish_run();
|
||||
Context.output_stream() << L"</w:sdtContent>";
|
||||
Context.output_stream() << L"</w:sdt>";
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
const wchar_t * variable_decl::ns = L"text";
|
||||
|
||||
@ -864,16 +864,18 @@ public:
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_text(const std::wstring & Text);
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
|
||||
odf_types::common_value_and_type_attlist office_value_;
|
||||
_CP_OPT(std::wstring) office_formula_;
|
||||
odf_types::common_value_and_type_attlist office_value_;
|
||||
_CP_OPT(std::wstring) office_formula_;
|
||||
|
||||
_CP_OPT(std::wstring) style_data_style_name_;
|
||||
_CP_OPT(std::wstring) display_;
|
||||
_CP_OPT(std::wstring) name_;
|
||||
_CP_OPT(std::wstring) style_data_style_name_;
|
||||
_CP_OPT(std::wstring) display_;
|
||||
_CP_OPT(std::wstring) name_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(variable_set);
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -81,6 +81,8 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IncludePath>..\..\Common\3dParty\boost\build\win_32\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
<LibraryPath>..\..\Common\3dParty\boost\build\win_32\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(Platform)\$(Configuration)\</OutDir>
|
||||
@ -136,6 +138,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4311;4267;4996;4172;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)-static.lib</OutputFile>
|
||||
|
||||
@ -81,6 +81,8 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IncludePath>..\..\Common\3dParty\boost\build\win_32\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
<LibraryPath>..\..\Common\3dParty\boost\build\win_32\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(Platform)\$(Configuration)\</OutDir>
|
||||
@ -136,12 +138,14 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4311;4267;4996;4172;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName).lib</OutputFile>
|
||||
</Lib>
|
||||
<PostBuildEvent>
|
||||
<Command>D:\WORK\VersionControl.exe $(ProjectDir)\ASCOfficeOdfFile\version.h</Command>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
|
||||
@ -81,6 +81,8 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IncludePath>..\..\Common\3dParty\boost\build\win_32\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
<LibraryPath>..\..\Common\3dParty\boost\build\win_32\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(Platform)\$(Configuration)\</OutDir>
|
||||
@ -135,6 +137,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4311;4267;4996;4172;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)-static.lib</OutputFile>
|
||||
|
||||
@ -80,6 +80,8 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<IncludePath>..\..\Common\3dParty\boost\build\win_32\include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
|
||||
<LibraryPath>..\..\Common\3dParty\boost\build\win_32\lib;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);$(NETFXKitsDir)Lib\um\x86</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(Platform)\$(Configuration)\</OutDir>
|
||||
@ -124,6 +126,7 @@
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4311;4267;4996;4172;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName).lib</OutputFile>
|
||||
|
||||
@ -41,9 +41,9 @@ class abstract_xml : public office_element_impl<abstract_xml>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = type_AbstractXml;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
public:
|
||||
abstract_xml() {}
|
||||
|
||||
@ -132,7 +132,7 @@ void anim_transition_filter_attlist::serialize(CP_ATTR_NODE)
|
||||
}
|
||||
void anim_audio_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"xlink:href", xlink_href_);
|
||||
CP_XML_ATTR_OPT_ENCODE_STRING(L"xlink:href", xlink_href_);
|
||||
CP_XML_ATTR_OPT(L"anim:audio-level",anim_audio_level_);
|
||||
}
|
||||
const wchar_t * anim_transitionFilter::ns = L"anim";
|
||||
|
||||
@ -49,9 +49,9 @@ class anim_par : public office_element_impl<anim_par>//Параллельные
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeAnimPar;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
odf_types::common_anim_smil_attlist attlist_;
|
||||
office_element_ptr anim_par_;
|
||||
@ -70,9 +70,8 @@ class anim_seq : public office_element_impl<anim_seq>//Последовател
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeAnimSeq;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
static const ElementType type = typeAnimSeq;
|
||||
|
||||
odf_types::common_anim_smil_attlist attlist_;
|
||||
office_element_ptr_array anim_par_array_;
|
||||
@ -112,9 +111,9 @@ class anim_transitionFilter : public office_element_impl<anim_transitionFilter>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeAnimTransitionFilter;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child){}
|
||||
@ -131,9 +130,9 @@ class anim_audio : public office_element_impl<anim_audio>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeAnimAudio;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child){}
|
||||
|
||||
@ -56,9 +56,9 @@ void calcext_icon_set_attr::serialize(CP_ATTR_NODE)
|
||||
}
|
||||
void calcext_condition_attr::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"calcext:base-cell-address", calcext_base_cell_address_);
|
||||
CP_XML_ATTR_OPT(L"calcext:apply-style-name", calcext_apply_style_name_);
|
||||
CP_XML_ATTR_OPT(L"calcext:value", calcext_value_);
|
||||
CP_XML_ATTR_OPT_ENCODE_STRING(L"calcext:base-cell-address", calcext_base_cell_address_);
|
||||
CP_XML_ATTR_OPT(L"calcext:apply-style-name", calcext_apply_style_name_);
|
||||
CP_XML_ATTR_OPT_ENCODE_STRING(L"calcext:value", calcext_value_);
|
||||
}
|
||||
void calcext_date_is_attr::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
@ -216,7 +216,7 @@ void calcext_formatting_entry::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"calcext:value",calcext_value_);
|
||||
CP_XML_ATTR_OPT_ENCODE_STRING(L"calcext:value",calcext_value_);
|
||||
CP_XML_ATTR_OPT(L"calcext:type", calcext_type_);
|
||||
}
|
||||
}
|
||||
@ -233,7 +233,7 @@ void calcext_color_scale_entry::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"calcext:value", calcext_value_);
|
||||
CP_XML_ATTR_OPT_ENCODE_STRING(L"calcext:value", calcext_value_);
|
||||
CP_XML_ATTR_OPT(L"calcext:type", calcext_type_);
|
||||
CP_XML_ATTR_OPT(L"calcext:color", calcext_color_);
|
||||
}
|
||||
|
||||
@ -94,9 +94,9 @@ class calcext_color_scale_entry : public office_element_impl<calcext_color_scale
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeCalcextColorScaleEntry;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -116,9 +116,9 @@ class calcext_formatting_entry : public office_element_impl<calcext_formatting_e
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeCalcextFormattingEntry;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -137,9 +137,9 @@ class calcext_icon_set : public office_element_impl<calcext_icon_set>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeCalcextIconSet;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -158,9 +158,9 @@ class calcext_data_bar: public office_element_impl<calcext_data_bar>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeCalcextDataBar;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -178,9 +178,9 @@ class calcext_color_scale: public office_element_impl<calcext_color_scale>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeCalcextColorScale;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -197,9 +197,9 @@ class calcext_date_is: public office_element_impl<calcext_date_is>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeCalcextDateIs;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -216,9 +216,9 @@ class calcext_condition: public office_element_impl<calcext_condition>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeCalcextCondition;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -235,9 +235,9 @@ class calcext_conditional_format: public office_element_impl<calcext_conditional
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeCalcextConditionalFormat;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -258,9 +258,9 @@ class calcext_conditional_formats: public office_element_impl<calcext_conditiona
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeCalcextConditionalFormats;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
|
||||
@ -38,11 +38,6 @@
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include <xml/xmlchar.h>
|
||||
|
||||
#include <xml/attributes.h>
|
||||
|
||||
|
||||
#include "odf_conversion_context.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -48,10 +48,8 @@ class draw_base : public office_element_impl<draw_base>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeDrawBase;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
static const ElementType type = typeDrawBase;
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -62,7 +60,6 @@ public:
|
||||
odf_types::union_common_draw_attlists common_draw_attlists_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -67,9 +67,9 @@ class draw_image : public office_element_impl<draw_image>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeDrawImage;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -93,9 +93,9 @@ class draw_chart : public office_element_impl<draw_chart>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeDrawChart;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -118,9 +118,7 @@ class draw_frame : public draw_base
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeDrawFrame;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
static const ElementType type = typeDrawFrame;
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -148,9 +146,9 @@ class draw_g : public office_element_impl<draw_g>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeDrawG;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -183,9 +181,9 @@ class draw_text_box : public office_element_impl<draw_text_box>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeDrawTextBox;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -204,9 +202,9 @@ class draw_object : public office_element_impl<draw_object>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeDrawObject;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -225,9 +223,9 @@ class draw_object_ole : public office_element_impl<draw_object>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeDrawObjectOle;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -246,9 +244,9 @@ class draw_plugin : public office_element_impl<draw_plugin>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeDrawPlugin;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
|
||||
@ -68,9 +68,9 @@ class draw_page : public office_element_impl<draw_page>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeDrawPage;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -91,9 +91,9 @@ class presentation_footer_decl : public office_element_impl<presentation_footer_
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typePresentationFooterDecl;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -112,9 +112,9 @@ class presentation_date_time_decl : public office_element_impl<presentation_date
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typePresentationDateTimeDecl;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
_CP_OPT(std::wstring) presentation_name_;
|
||||
_CP_OPT(std::wstring) presentation_source_;
|
||||
@ -134,9 +134,9 @@ class presentation_notes : public office_element_impl<presentation_notes>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typePresentationNotes;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
|
||||
@ -46,7 +46,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawShape;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
virtual void serialize_attlist(CP_ATTR_NODE);
|
||||
@ -56,7 +56,7 @@ public:
|
||||
_CP_OPT(std::wstring) draw_id_;//используется для анимашек
|
||||
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
int sub_type_;
|
||||
|
||||
@ -79,7 +79,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawRect;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
@ -104,7 +104,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawEllipse;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
@ -120,7 +120,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawCircle;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
};
|
||||
@ -146,7 +146,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawLine;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
@ -172,7 +172,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawPath;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
@ -199,7 +199,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawPolygon;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
@ -219,7 +219,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawCustomShape;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -248,8 +248,8 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawEquation;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -294,8 +294,8 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawHandle;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -340,7 +340,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawEnhancedGeometry;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -361,7 +361,7 @@ public:
|
||||
|
||||
static int parsing(_CP_OPT(std::wstring) val);//todoooo наоборот
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_enhanced_geometry);
|
||||
@ -375,7 +375,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawCaption;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
};
|
||||
@ -399,7 +399,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawConnector;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
@ -418,7 +418,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawControl;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -442,7 +442,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDr3dScene;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -462,7 +462,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDr3dExtrude;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -479,7 +479,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDr3dRotate;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -494,9 +494,9 @@ class dr3d_light : public office_element_impl<dr3d_light>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeDr3dLight;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -519,7 +519,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDr3dCube;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -541,7 +541,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDr3dSphere;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -564,8 +564,8 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeDrawA;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
|
||||
@ -71,9 +71,9 @@ class style_header_footer_properties : public office_element_impl<style_header_f
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeStyleHeaderFooterProperties;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child)
|
||||
|
||||
@ -45,9 +45,9 @@ class text_number : public office_element_impl<text_number>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeTextNumber;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
public:
|
||||
text_number() {}
|
||||
@ -74,9 +74,9 @@ class text_list_item : public office_element_impl<text_list_item>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeTextListItem;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -110,9 +110,9 @@ class text_list_header : public office_element_impl<text_list_header>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeTextListHeader;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
|
||||
@ -41,10 +41,10 @@ class math_mstack : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMStack;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
|
||||
private:
|
||||
@ -65,10 +65,10 @@ class math_msrow : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMSRow;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -88,10 +88,10 @@ class math_msline : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMSLine;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -111,10 +111,10 @@ class math_mlongdiv : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMSLongDiv;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -134,10 +134,10 @@ class math_mscarries : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMSCarries;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -156,10 +156,10 @@ class math_msgroup : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMSGroup;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -179,11 +179,11 @@ class math_mscarry : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMSCarry;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element(const office_element_ptr & child_element);
|
||||
|
||||
@ -52,7 +52,7 @@ public:
|
||||
static const wchar_t * name;
|
||||
|
||||
static const ElementType type = typeMathElement;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name) {}
|
||||
virtual void add_child_element(const office_element_ptr & child_element) {}
|
||||
@ -60,8 +60,8 @@ public:
|
||||
virtual void serialize(std::wostream & _Wostream) {}
|
||||
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
friend class odf_document;
|
||||
};
|
||||
@ -72,10 +72,10 @@ class office_math : public office_element_impl<office_math>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMath;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
friend class odf_document;
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -94,11 +94,11 @@ class math_semantics : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMathSemantics;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element(const office_element_ptr & child_element);
|
||||
@ -116,14 +116,12 @@ class math_annotation : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMathAnnotation;
|
||||
|
||||
_CP_OPT(std::wstring) encoding_;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
private:
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element(const office_element_ptr & child_element);
|
||||
|
||||
@ -144,11 +142,11 @@ class math_annotation_xml : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMathAnnotationXml;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element(const office_element_ptr & child_element);
|
||||
|
||||
@ -49,13 +49,13 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMRow;
|
||||
|
||||
math_mrow();
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -73,11 +73,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMFrac;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
_CP_OPT(Bool) bevelled;
|
||||
private:
|
||||
@ -99,11 +99,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMSqrt;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -120,11 +120,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMRoot;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -141,11 +141,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMStyle;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
_CP_OPT(color) color_;
|
||||
|
||||
@ -169,10 +169,10 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMEnClose;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -189,11 +189,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMFenced;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -210,11 +210,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMPadded;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
@ -43,11 +43,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMSub;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -65,11 +65,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMSup;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -88,11 +88,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMSubSup;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -109,11 +109,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMNone;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -132,11 +132,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMPreScripts;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -151,11 +151,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMMultiScripts;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -174,11 +174,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMUnderOver;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -195,11 +195,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMOver;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
_CP_OPT(Bool) accent;
|
||||
private:
|
||||
@ -217,11 +217,11 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMUnder;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
@ -41,11 +41,11 @@ class math_mtable : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMTable;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -64,11 +64,11 @@ class math_malignmark : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMAlignMark;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -87,11 +87,11 @@ class math_maligngroup : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMAlignGroup;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -110,11 +110,11 @@ class math_mtd : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMTd;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -133,11 +133,11 @@ class math_mlabeledtr : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMLabelEdTr;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -156,11 +156,11 @@ class math_mtr : public office_math_element
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMTr;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
@ -44,7 +44,7 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMI;
|
||||
private:
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
@ -68,7 +68,7 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMO;
|
||||
|
||||
_CP_OPT(Bool) accent_;
|
||||
@ -97,7 +97,7 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMN;
|
||||
|
||||
|
||||
@ -123,7 +123,7 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMText;
|
||||
|
||||
|
||||
@ -149,7 +149,7 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMSpace;
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMS;
|
||||
|
||||
|
||||
@ -197,7 +197,7 @@ namespace cpdoccore {
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeMGlyph;
|
||||
|
||||
|
||||
|
||||
@ -49,6 +49,9 @@ namespace cpdoccore {
|
||||
using namespace odf_types;
|
||||
|
||||
namespace odf_writer {
|
||||
|
||||
const wchar_t * number_style_base::ns = L"number";
|
||||
const wchar_t * number_style_base::name = L"base-style";
|
||||
|
||||
std::wstring number_style_base::get_style_name() const
|
||||
{
|
||||
|
||||
@ -43,12 +43,13 @@
|
||||
namespace cpdoccore {
|
||||
namespace odf_writer {
|
||||
|
||||
class number_style_base : public office_element
|
||||
class number_style_base : public office_element_impl<number_style_base>
|
||||
{
|
||||
public:
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const ElementType type = typeNumberBaseStyle;
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child);
|
||||
|
||||
@ -71,10 +72,10 @@ class number_number_style : public number_style_base
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberNumberStyle;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & strm);
|
||||
|
||||
@ -87,10 +88,10 @@ class number_currency_style : public number_style_base
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberCurrencyStyle;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & strm);
|
||||
};
|
||||
@ -102,10 +103,10 @@ class number_text_style : public number_style_base
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberTextStyle;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & strm);
|
||||
};
|
||||
@ -117,10 +118,10 @@ class number_date_style : public number_style_base
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberDataStyle;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
|
||||
|
||||
virtual void serialize(std::wostream & strm);
|
||||
|
||||
@ -134,10 +135,8 @@ class number_percentage_style : public number_style_base
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberPercentageStyle;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
virtual void serialize(std::wostream & strm);
|
||||
};
|
||||
@ -149,11 +148,9 @@ class number_time_style : public number_style_base
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeNumberTimeStyle;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
CPDOCCORE_OFFICE_DOCUMENT_IMPL_NAME_FUNCS_
|
||||
|
||||
static const ElementType type = typeNumberTimeStyle;
|
||||
|
||||
_CP_OPT(bool) number_automatic_order_;
|
||||
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -166,9 +163,9 @@ class number_text : public office_element_impl<number_text>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberText;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
|
||||
@ -187,9 +184,9 @@ class number_number : public office_element_impl<number_number>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberNumber;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child);
|
||||
@ -215,9 +212,9 @@ class number_embedded_text : public office_element_impl<number_embedded_text>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberEmbeddedText;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -236,9 +233,9 @@ class number_scientific_number : public office_element_impl<number_scientific_nu
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberScientificNumber;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -263,9 +260,9 @@ class number_currency_symbol : public office_element_impl<number_currency_symbol
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberCurrencySymbol;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -286,9 +283,9 @@ class number_text_content : public office_element_impl<number_text_content>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberTextContent;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
|
||||
@ -306,9 +303,9 @@ class number_day_of_week : public office_element_impl<number_day_of_week>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberDayOfWeek;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -324,9 +321,9 @@ class number_quarter : public office_element_impl<number_quarter>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberQuarter;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -342,9 +339,9 @@ class number_day : public office_element_impl<number_day>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberDay;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -361,9 +358,9 @@ class number_month : public office_element_impl<number_month>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberMonth;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -381,9 +378,9 @@ class number_year : public office_element_impl<number_year>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberYear;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -399,9 +396,9 @@ class number_hours : public office_element_impl<number_hours>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberHours;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -417,9 +414,9 @@ class number_minutes : public office_element_impl<number_minutes>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberMinutes;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -435,9 +432,9 @@ class number_seconds : public office_element_impl<number_seconds>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberSeconds;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -454,9 +451,9 @@ class number_am_pm : public office_element_impl<number_am_pm>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberAmPm;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
@ -469,9 +466,9 @@ class number_fraction : public office_element_impl<number_fraction>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeNumberFraction;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void serialize(std::wostream & strm);
|
||||
|
||||
@ -49,14 +49,200 @@ namespace odf_writer
|
||||
{
|
||||
namespace package
|
||||
{
|
||||
std::string GetUtf8StringFromUnicode_4bytes(const wchar_t* pUnicodes, size_t lCount)
|
||||
{
|
||||
std::string res;
|
||||
res.resize(6 * lCount + 1);
|
||||
|
||||
BYTE* pData = (BYTE*)res.c_str();
|
||||
BYTE* pCodesCur = pData;
|
||||
|
||||
const wchar_t* pEnd = pUnicodes + lCount;
|
||||
const wchar_t* pCur = pUnicodes;
|
||||
|
||||
while (pCur < pEnd)
|
||||
{
|
||||
unsigned int code = (unsigned int)*pCur++;
|
||||
|
||||
if (code < 0x80)
|
||||
{
|
||||
*pCodesCur++ = (BYTE)code;
|
||||
}
|
||||
else if (code < 0x0800)
|
||||
{
|
||||
*pCodesCur++ = 0xC0 | (code >> 6);
|
||||
*pCodesCur++ = 0x80 | (code & 0x3F);
|
||||
}
|
||||
else if (code < 0x10000)
|
||||
{
|
||||
*pCodesCur++ = 0xE0 | (code >> 12);
|
||||
*pCodesCur++ = 0x80 | (code >> 6 & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code & 0x3F);
|
||||
}
|
||||
else if (code < 0x1FFFFF)
|
||||
{
|
||||
*pCodesCur++ = 0xF0 | (code >> 18);
|
||||
*pCodesCur++ = 0x80 | (code >> 12 & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code >> 6 & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code & 0x3F);
|
||||
}
|
||||
else if (code < 0x3FFFFFF)
|
||||
{
|
||||
*pCodesCur++ = 0xF8 | (code >> 24);
|
||||
*pCodesCur++ = 0x80 | (code >> 18 & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code >> 12 & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code >> 6 & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code & 0x3F);
|
||||
}
|
||||
else if (code < 0x7FFFFFFF)
|
||||
{
|
||||
*pCodesCur++ = 0xFC | (code >> 30);
|
||||
*pCodesCur++ = 0x80 | (code >> 24 & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code >> 18 & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code >> 12 & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code >> 6 & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code & 0x3F);
|
||||
}
|
||||
}
|
||||
*pCodesCur++ = 0;
|
||||
res.resize(pCodesCur - pData);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
std::string GetUtf8StringFromUnicode_2bytes(const wchar_t* pUnicodes, size_t lCount)
|
||||
{
|
||||
std::string res;
|
||||
res.resize(6 * lCount + 1);
|
||||
|
||||
BYTE* pData = (BYTE*)res.c_str();
|
||||
BYTE* pCodesCur = pData;
|
||||
|
||||
const wchar_t* pEnd = pUnicodes + lCount;
|
||||
const wchar_t* pCur = pUnicodes;
|
||||
|
||||
while (pCur < pEnd)
|
||||
{
|
||||
unsigned int code = (unsigned int)*pCur++;
|
||||
if (code >= 0xD800 && code <= 0xDFFF && pCur < pEnd)
|
||||
{
|
||||
code = 0x10000 + (((code & 0x3FF) << 10) | (0x03FF & *pCur++));
|
||||
}
|
||||
|
||||
if (code < 0x80)
|
||||
{
|
||||
*pCodesCur++ = (BYTE)code;
|
||||
}
|
||||
else if (code < 0x0800)
|
||||
{
|
||||
*pCodesCur++ = 0xC0 | (code >> 6);
|
||||
*pCodesCur++ = 0x80 | (code & 0x3F);
|
||||
}
|
||||
else if (code < 0x10000)
|
||||
{
|
||||
*pCodesCur++ = 0xE0 | (code >> 12);
|
||||
*pCodesCur++ = 0x80 | ((code >> 6) & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code & 0x3F);
|
||||
}
|
||||
else if (code < 0x1FFFFF)
|
||||
{
|
||||
*pCodesCur++ = 0xF0 | (code >> 18);
|
||||
*pCodesCur++ = 0x80 | ((code >> 12) & 0x3F);
|
||||
*pCodesCur++ = 0x80 | ((code >> 6) & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code & 0x3F);
|
||||
}
|
||||
else if (code < 0x3FFFFFF)
|
||||
{
|
||||
*pCodesCur++ = 0xF8 | (code >> 24);
|
||||
*pCodesCur++ = 0x80 | ((code >> 18) & 0x3F);
|
||||
*pCodesCur++ = 0x80 | ((code >> 12) & 0x3F);
|
||||
*pCodesCur++ = 0x80 | ((code >> 6) & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code & 0x3F);
|
||||
}
|
||||
else if (code < 0x7FFFFFFF)
|
||||
{
|
||||
*pCodesCur++ = 0xFC | (code >> 30);
|
||||
*pCodesCur++ = 0x80 | ((code >> 24) & 0x3F);
|
||||
*pCodesCur++ = 0x80 | ((code >> 18) & 0x3F);
|
||||
*pCodesCur++ = 0x80 | ((code >> 12) & 0x3F);
|
||||
*pCodesCur++ = 0x80 | ((code >> 6) & 0x3F);
|
||||
*pCodesCur++ = 0x80 | (code & 0x3F);
|
||||
}
|
||||
}
|
||||
*pCodesCur = 0;
|
||||
res.resize(pCodesCur - pData);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
std::string GetUtf8StringFromUnicode(const wchar_t* pUnicodes, size_t lCount)
|
||||
{
|
||||
if (sizeof(WCHAR) == 2)
|
||||
{
|
||||
return GetUtf8StringFromUnicode_2bytes(pUnicodes, lCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetUtf8StringFromUnicode_4bytes(pUnicodes, lCount);
|
||||
}
|
||||
}
|
||||
simple_element::simple_element(const std::wstring & FileName, const std::wstring & Content, bool utf8) : file_name_(FileName), utf8_(utf8)
|
||||
{
|
||||
if (utf8_)
|
||||
{
|
||||
content_utf8_ = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(Content);
|
||||
if (Content.length() > 10 * 1024 * 1024)
|
||||
{
|
||||
size_t pos = 0;
|
||||
while (pos < Content.length())
|
||||
{
|
||||
size_t sz = 2 * 1024 * 1024;
|
||||
if (sz + pos > Content.length())
|
||||
sz = Content.length() - pos;
|
||||
if (sz < 1)
|
||||
break;
|
||||
|
||||
content_utf8_ += NSFile::CUtf8Converter::GetUtf8StringFromUnicode2(Content.c_str() + pos, sz);
|
||||
|
||||
pos += sz;
|
||||
}
|
||||
}
|
||||
else
|
||||
content_utf8_ = NSFile::CUtf8Converter::GetUtf8StringFromUnicode2(Content.c_str(), Content.length());
|
||||
}else
|
||||
content_utf8_ = std::string( Content.begin(), Content.end());
|
||||
}
|
||||
simple_element::simple_element(const std::wstring & FileName, wchar_t* Content, size_t Size, bool utf8)
|
||||
{
|
||||
if (utf8_)
|
||||
{
|
||||
if (Size > 10 * 1024 * 1024)
|
||||
{
|
||||
size_t pos = 0;
|
||||
while (pos < Size)
|
||||
{
|
||||
size_t sz = 2 * 1024 * 1024;
|
||||
if (sz + pos > Size)
|
||||
sz = Size - pos;
|
||||
if (sz < 1)
|
||||
break;
|
||||
|
||||
content_utf8_ += NSFile::CUtf8Converter::GetUtf8StringFromUnicode2(Content + pos, sz);
|
||||
|
||||
pos += sz;
|
||||
}
|
||||
}
|
||||
else
|
||||
content_utf8_ = NSFile::CUtf8Converter::GetUtf8StringFromUnicode2(Content, Size);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring str(Content, Size);
|
||||
content_utf8_ = std::string(str.begin(), str.end());
|
||||
}
|
||||
}
|
||||
simple_element::simple_element(const std::wstring & FileName, std::basic_stringbuf<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>> & streambuf, size_t Size, bool utf8)
|
||||
{
|
||||
}
|
||||
simple_element::simple_element(const std::wstring & FileName, const std::string & Content) : file_name_(FileName), utf8_(false), content_utf8_(Content)
|
||||
{
|
||||
}
|
||||
@ -361,9 +547,11 @@ namespace odf_writer
|
||||
{
|
||||
if (false == bXmlRootNodeWrite)
|
||||
{
|
||||
if (content)
|
||||
if (content_)
|
||||
{
|
||||
simple_element elm(L"content.xml", content->content_str());
|
||||
simple_element elm(L"content.xml", content_->content_str());
|
||||
content_.reset();
|
||||
|
||||
elm.write(RootPath, add_padding);
|
||||
}
|
||||
}
|
||||
@ -375,46 +563,6 @@ namespace odf_writer
|
||||
{
|
||||
CP_XML_NODE(L"office:document-content")
|
||||
{
|
||||
//CP_XML_ATTR(L"xmlns:office", L"urn:oasis:names:tc:opendocument:xmlns:office:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:style", L"urn:oasis:names:tc:opendocument:xmlns:style:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:text", L"urn:oasis:names:tc:opendocument:xmlns:text:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:table", L"urn:oasis:names:tc:opendocument:xmlns:table:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:draw", L"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:fo", L"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:xlink", L"http://www.w3.org/1999/xlink" );
|
||||
//CP_XML_ATTR(L"xmlns:dc", L"http://purl.org/dc/elements/1.1/" );
|
||||
//CP_XML_ATTR(L"xmlns:meta", L"urn:oasis:names:tc:opendocument:xmlns:meta:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:number", L"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:presentation", L"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:svg", L"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
|
||||
//CP_XML_ATTR(L"xmlns:chart", L"urn:oasis:names:tc:opendocument:xmlns:chart:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:dr3d", L"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:math", L"http://www.w3.org/1998/Math/MathML" );
|
||||
//CP_XML_ATTR(L"xmlns:form", L"urn:oasis:names:tc:opendocument:xmlns:form:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:script", L"urn:oasis:names:tc:opendocument:xmlns:script:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:ooo", L"http://openoffice.org/2004/office" );
|
||||
//CP_XML_ATTR(L"xmlns:ooow", L"http://openoffice.org/2004/writer" );
|
||||
//CP_XML_ATTR(L"xmlns:oooc", L"http://openoffice.org/2004/calc" );
|
||||
//CP_XML_ATTR(L"xmlns:dom", L"http://www.w3.org/2001/xml-events" );
|
||||
//CP_XML_ATTR(L"xmlns:xforms", L"http://www.w3.org/2002/xforms");
|
||||
//CP_XML_ATTR(L"xmlns:xsd", L"http://www.w3.org/2001/XMLSchema" );
|
||||
//CP_XML_ATTR(L"xmlns:xsi", L"http://www.w3.org/2001/XMLSchema-instance" );
|
||||
//CP_XML_ATTR(L"xmlns:rpt", L"http://openoffice.org/2005/report" );
|
||||
//CP_XML_ATTR(L"xmlns:of", L"urn:oasis:names:tc:opendocument:xmlns:of:1.2" );
|
||||
//CP_XML_ATTR(L"xmlns:xhtml", L"http://www.w3.org/1999/xhtml" );
|
||||
//CP_XML_ATTR(L"xmlns:grddl", L"http://www.w3.org/2003/g/data-view#" );
|
||||
//CP_XML_ATTR(L"xmlns:officeooo", L"http://openoffice.org/2009/office" );
|
||||
//CP_XML_ATTR(L"xmlns:textooo", L"http://openoffice.org/2013/office" );
|
||||
//CP_XML_ATTR(L"xmlns:tableooo", L"http://openoffice.org/2009/table" );
|
||||
//CP_XML_ATTR(L"xmlns:drawooo", L"http://openoffice.org/2010/draw" );
|
||||
//CP_XML_ATTR(L"xmlns:chartooo", L"http://openoffice.org/2010/chart" );
|
||||
//CP_XML_ATTR(L"xmlns:smil", L"urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0");
|
||||
//CP_XML_ATTR(L"xmlns:anim", L"urn:oasis:names:tc:opendocument:xmlns:animation:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:calcext", L"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:field", L"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:formx", L"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:loext", L"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" );
|
||||
//CP_XML_ATTR(L"xmlns:css3t", L"http://www.w3.org/TR/css3-text/" );
|
||||
CP_XML_ATTR(L"xmlns:meta", L"urn:oasis:names:tc:opendocument:xmlns:meta:1.0");
|
||||
CP_XML_ATTR(L"xmlns:office", L"urn:oasis:names:tc:opendocument:xmlns:office:1.0");
|
||||
CP_XML_ATTR(L"xmlns:draw", L"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0");
|
||||
@ -457,19 +605,23 @@ namespace odf_writer
|
||||
CP_XML_ATTR(L"office:version", L"1.2");
|
||||
|
||||
|
||||
if (content)
|
||||
if ((content_) && (content_->styles_.rdbuf()->in_avail() != 0))
|
||||
{
|
||||
CP_XML_STREAM() << content->styles_str();
|
||||
content_->styles_.flush();
|
||||
CP_XML_STREAM() << content_->styles_.rdbuf();
|
||||
content_->styles_.clear();
|
||||
}
|
||||
CP_XML_NODE(L"office:body")
|
||||
{
|
||||
if (content)
|
||||
if ((content_) && (content_->content_.rdbuf()->in_avail() != 0))
|
||||
{
|
||||
CP_XML_STREAM() << content->content_str();
|
||||
content_->content_.flush();
|
||||
CP_XML_STREAM() << content_->content_.rdbuf();
|
||||
content_->content_.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
simple_element elm(L"content.xml", resStream.str());
|
||||
elm.write(RootPath, add_padding);
|
||||
}
|
||||
@ -523,14 +675,16 @@ namespace odf_writer
|
||||
CP_XML_ATTR(L"xmlns:css3t", L"http://www.w3.org/TR/css3-text/" );
|
||||
CP_XML_ATTR(L"office:version", L"1.2");
|
||||
|
||||
if (content_)
|
||||
if ((content_) && (content_->content().rdbuf()->in_avail() != 0))
|
||||
{
|
||||
CP_XML_STREAM() << content_->str();
|
||||
content_->content().flush();
|
||||
CP_XML_STREAM() << content_->content().rdbuf();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
content_.reset();
|
||||
|
||||
simple_element elm(L"styles.xml", resStream.str());
|
||||
elm.write(RootPath, add_padding);
|
||||
}
|
||||
@ -547,14 +701,16 @@ namespace odf_writer
|
||||
CP_XML_ATTR(L"xmlns:xlink", L"http://www.w3.org/1999/xlink" );
|
||||
CP_XML_ATTR(L"xmlns:office", L"urn:oasis:names:tc:opendocument:xmlns:office:1.0" );
|
||||
|
||||
if (content_)
|
||||
if ((content_) && (content_->content().rdbuf()->in_avail() != 0))
|
||||
{
|
||||
CP_XML_STREAM() << content_->str();
|
||||
content_->content().flush();
|
||||
CP_XML_STREAM() << content_->content().rdbuf();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
content_.reset();
|
||||
|
||||
simple_element elm(L"settings.xml", resStream.str());
|
||||
elm.write(RootPath, add_padding);
|
||||
}
|
||||
|
||||
@ -58,10 +58,8 @@ namespace odf_writer
|
||||
{
|
||||
public:
|
||||
content_simple(){}
|
||||
std::wostream & content() { return content_; }
|
||||
std::wstring str() { return content_.str(); }
|
||||
static _CP_PTR(content_simple) create();
|
||||
|
||||
std::wstringstream & content() { return content_;}
|
||||
private:
|
||||
std::wstringstream content_;
|
||||
};
|
||||
@ -72,6 +70,8 @@ namespace odf_writer
|
||||
class content_content : noncopyable
|
||||
{
|
||||
public:
|
||||
friend class content_file;
|
||||
|
||||
content_content(){}
|
||||
std::wostream & content() { return content_; }
|
||||
std::wostream & styles() { return styles_; }
|
||||
@ -103,6 +103,10 @@ namespace odf_writer
|
||||
simple_element(const std::wstring & FileName, const std::string & Content);
|
||||
simple_element(const std::wstring & FileName, const std::wstring & Content, bool utf8 = true);
|
||||
|
||||
simple_element(const std::wstring & FileName, wchar_t* Content, size_t Size, bool utf8 = true);
|
||||
|
||||
simple_element(const std::wstring & FileName, std::basic_stringbuf<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>> & streambuf, size_t Size, bool utf8 = true);
|
||||
|
||||
static element_ptr create(const std::wstring & FileName, const std::wstring & Content, bool utf8 = true);
|
||||
static element_ptr create(const std::wstring & FileName, const std::string & Content);
|
||||
|
||||
@ -126,10 +130,10 @@ namespace odf_writer
|
||||
private:
|
||||
bool bXmlRootNodeWrite = true;
|
||||
public:
|
||||
void set_content(content_content_ptr & c, bool bRootNode = true) { content = c; bXmlRootNodeWrite = bRootNode; }
|
||||
void set_content(content_content_ptr & c, bool bRootNode = true) { content_ = c; bXmlRootNodeWrite = bRootNode; }
|
||||
virtual void write(const std::wstring & RootPath, bool add_padding = false);
|
||||
|
||||
content_content_ptr content;
|
||||
content_content_ptr content_;
|
||||
};
|
||||
|
||||
class styles_file : public element
|
||||
|
||||
@ -89,10 +89,18 @@ odf_conversion_context::odf_conversion_context(_office_type_document type_, pack
|
||||
}
|
||||
odf_conversion_context::~odf_conversion_context()
|
||||
{
|
||||
output_document_ = NULL;
|
||||
|
||||
if (applicationFonts_)
|
||||
delete applicationFonts_;
|
||||
|
||||
for (size_t i = 0; i < objects_.size(); ++i)
|
||||
{
|
||||
if (objects_[i]) delete objects_[i];
|
||||
objects_[i] = NULL;
|
||||
}
|
||||
objects_.clear();
|
||||
}
|
||||
|
||||
void odf_conversion_context::set_fonts_directory(std::wstring pathFonts)
|
||||
{
|
||||
if (applicationFonts_)
|
||||
@ -130,14 +138,14 @@ double odf_conversion_context::convert_symbol_width(double val)
|
||||
odf_style_context* odf_conversion_context::styles_context()
|
||||
{
|
||||
if (!objects_.empty())
|
||||
return objects_[current_object_].style_context.get();
|
||||
return objects_[current_object_]->style_context.get();
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
odf_settings_context* odf_conversion_context::settings_context()
|
||||
{
|
||||
if (!objects_.empty())
|
||||
return objects_[current_object_].settings_context.get();
|
||||
return objects_[current_object_]->settings_context.get();
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
@ -159,22 +167,22 @@ odf_math_context* odf_conversion_context::math_context()
|
||||
|
||||
odf_number_styles_context* odf_conversion_context::numbers_styles_context()
|
||||
{
|
||||
if (objects_.size() > 0 && objects_[current_object_].style_context)
|
||||
return &(objects_[current_object_].style_context->numbers_styles());
|
||||
if (objects_.size() > 0 && objects_[current_object_]->style_context)
|
||||
return &(objects_[current_object_]->style_context->numbers_styles());
|
||||
else return NULL;
|
||||
}
|
||||
|
||||
_mediaitems* odf_conversion_context::mediaitems()
|
||||
{
|
||||
return &objects_[current_object_].mediaitems;
|
||||
return &objects_[current_object_]->mediaitems;
|
||||
}
|
||||
|
||||
void odf_conversion_context::end_document()
|
||||
{
|
||||
rels rels_;
|
||||
rels rels_;
|
||||
for (size_t i = 0; i < objects_.size(); i++)
|
||||
{
|
||||
_object & object = objects_[i];
|
||||
_object & object = *objects_[i];
|
||||
bool isRoot = (i == 0 ? true : false);
|
||||
|
||||
if (object.content == NULL)continue;
|
||||
@ -184,8 +192,8 @@ void odf_conversion_context::end_document()
|
||||
|
||||
package::content_content_ptr content_root_ = package::content_content::create();
|
||||
|
||||
if (objects_.back().scripts)
|
||||
objects_.back().scripts->serialize(content_root_->styles());
|
||||
if (objects_.back()->scripts)
|
||||
objects_.back()->scripts->serialize(content_root_->styles());
|
||||
|
||||
object.content->serialize(content_root_->content());
|
||||
|
||||
@ -245,15 +253,13 @@ void odf_conversion_context::end_document()
|
||||
|
||||
output_document_->add_object(package::element_ptr(object_files), isRoot);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
output_document_->set_rels(rels_);
|
||||
}
|
||||
void odf_conversion_context::start_chart()
|
||||
{
|
||||
create_object();
|
||||
create_element(L"office", L"chart", objects_.back().content, this, true);
|
||||
create_element(L"office", L"chart", objects_.back()->content, this, true);
|
||||
|
||||
chart_context_.set_styles_context(odf_conversion_context::styles_context());
|
||||
chart_context_.start_chart(get_current_object_element());
|
||||
@ -261,36 +267,39 @@ void odf_conversion_context::start_chart()
|
||||
void odf_conversion_context::start_spreadsheet()
|
||||
{
|
||||
create_object();
|
||||
create_element(L"office", L"spreadsheet", objects_.back().content, this, true);
|
||||
create_element(L"office", L"spreadsheet", objects_.back()->content, this, true);
|
||||
}
|
||||
void odf_conversion_context::start_text()
|
||||
{
|
||||
create_object();
|
||||
create_element(L"office", L"text", objects_.back().content, this, true);
|
||||
create_element(L"office", L"text", objects_.back()->content, this, true);
|
||||
}
|
||||
void odf_conversion_context::start_presentation()
|
||||
{
|
||||
create_object();
|
||||
create_element(L"office", L"presentation", objects_.back().content, this, true);
|
||||
create_element(L"office", L"presentation", objects_.back()->content, this, true);
|
||||
|
||||
create_element(L"office", L"scripts", objects_.back().scripts, this);
|
||||
create_element(L"office", L"scripts", objects_.back()->scripts, this);
|
||||
}
|
||||
void odf_conversion_context::create_object(bool bAddContentExt)
|
||||
{
|
||||
_object obj;
|
||||
|
||||
obj.content_ext = bAddContentExt;
|
||||
obj.style_context = boost::make_shared<odf_style_context>();
|
||||
obj.settings_context = boost::make_shared<odf_settings_context>();
|
||||
|
||||
obj.name = get_next_name_object();
|
||||
|
||||
obj.style_context->set_odf_context(this);
|
||||
obj.settings_context->set_odf_context(this);
|
||||
|
||||
objects_.push_back(obj);
|
||||
_object *obj = new _object();
|
||||
|
||||
current_object_ = objects_.size() - 1;
|
||||
if (obj)
|
||||
{
|
||||
obj->content_ext = bAddContentExt;
|
||||
obj->style_context = boost::make_shared<odf_style_context>();
|
||||
obj->settings_context = boost::make_shared<odf_settings_context>();
|
||||
|
||||
obj->name = get_next_name_object();
|
||||
|
||||
obj->style_context->set_odf_context(this);
|
||||
obj->settings_context->set_odf_context(this);
|
||||
|
||||
objects_.push_back(obj);
|
||||
|
||||
current_object_ = objects_.size() - 1;
|
||||
}
|
||||
}
|
||||
void odf_conversion_context::end_chart()
|
||||
{
|
||||
@ -312,7 +321,7 @@ bool odf_conversion_context::start_math()
|
||||
//имитация рисованного объекта - высота-ширина ????
|
||||
|
||||
create_object(false);
|
||||
create_element(L"math", L"math", objects_.back().content, this, true);
|
||||
create_element(L"math", L"math", objects_.back()->content, this, true);
|
||||
|
||||
math_context_.set_styles_context(odf_conversion_context::styles_context());
|
||||
math_context_.start_math(get_current_object_element());
|
||||
@ -368,7 +377,7 @@ office_element_ptr & odf_conversion_context::get_current_object_element()
|
||||
create_object();
|
||||
}
|
||||
|
||||
return objects_[current_object_].content;
|
||||
return objects_[current_object_]->content;
|
||||
}
|
||||
|
||||
std::wstring odf_conversion_context::get_next_name_object()
|
||||
@ -535,13 +544,13 @@ void odf_conversion_context::add_font(const std::wstring& font_name)
|
||||
{
|
||||
if (objects_.empty())return;
|
||||
|
||||
if (objects_[current_object_].mapFonts.find(font_name) == objects_[current_object_].mapFonts.end())
|
||||
if (objects_[current_object_]->mapFonts.find(font_name) == objects_[current_object_]->mapFonts.end())
|
||||
{
|
||||
objects_[current_object_].mapFonts.insert(std::make_pair(font_name, 1));
|
||||
objects_[current_object_]->mapFonts.insert(std::make_pair(font_name, 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
objects_[current_object_].mapFonts[font_name]++;
|
||||
objects_[current_object_]->mapFonts[font_name]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,7 +165,7 @@ private:
|
||||
|
||||
odf_element_state temporary_;
|
||||
|
||||
std::vector<_object> objects_;//"0" = root
|
||||
std::vector<_object*> objects_;//"0" = root
|
||||
|
||||
odf_chart_context chart_context_;
|
||||
odf_page_layout_context page_layout_context_;
|
||||
|
||||
@ -2215,6 +2215,9 @@ void odf_drawing_context::set_line_width(double pt)
|
||||
{
|
||||
if (!impl_->current_graphic_properties) return;
|
||||
|
||||
if (pt < 0.0001)
|
||||
impl_->current_graphic_properties->draw_stroke_ = line_style::None;
|
||||
|
||||
impl_->current_graphic_properties->svg_stroke_width_ = length(length(pt,length::pt).get_value_unit(length::cm), length::cm);
|
||||
}
|
||||
|
||||
|
||||
@ -425,7 +425,7 @@ office_element_ptr & odf_style_context::add_or_find(std::wstring name, style_fam
|
||||
if (oox_id >= 0 && style_state_list_[i]->style_oox_id_ == oox_id)
|
||||
return style_state_list_[i]->get_office_element();
|
||||
|
||||
if ((name.length() >=0 && style_state_list_[i]->odf_style_->get_name() == name)
|
||||
if ((name.length() >= 0 && style_state_list_[i]->odf_style_->get_name() == name)
|
||||
&& style_state_list_[i]->root_ == root) return style_state_list_[i]->get_office_element();
|
||||
//во избежания имена генерим уникальные (в принципе для root и остальных - можно одинаковые)
|
||||
}
|
||||
|
||||
@ -294,10 +294,10 @@ void odf_text_context::start_paragraph(office_element_ptr & elm, bool styled)
|
||||
}
|
||||
|
||||
text_p* p = dynamic_cast<text_p*>(elm.get());
|
||||
if (p) p->paragraph_.paragraph_attrs_.text_style_name_ = style_name;
|
||||
if (p) p->paragraph_attrs_.text_style_name_ = style_name;
|
||||
|
||||
text_h* h = dynamic_cast<text_h*>(elm.get());
|
||||
if (h) h->paragraph_.paragraph_attrs_.text_style_name_ = style_name;
|
||||
if (h) h->paragraph_attrs_.text_style_name_ = style_name;
|
||||
|
||||
style *style_ = dynamic_cast<style*>(style_elm.get());
|
||||
if (style_)
|
||||
@ -310,10 +310,10 @@ void odf_text_context::start_paragraph(office_element_ptr & elm, bool styled)
|
||||
else if (false == parent_paragraph_style_.empty())
|
||||
{
|
||||
text_p* p = dynamic_cast<text_p*>(elm.get());
|
||||
if (p)p->paragraph_.paragraph_attrs_.text_style_name_ = parent_paragraph_style_;
|
||||
if (p)p->paragraph_attrs_.text_style_name_ = parent_paragraph_style_;
|
||||
|
||||
text_h* h = dynamic_cast<text_h*>(elm.get());
|
||||
if (h)p->paragraph_.paragraph_attrs_.text_style_name_ = parent_paragraph_style_;
|
||||
if (h)p->paragraph_attrs_.text_style_name_ = parent_paragraph_style_;
|
||||
}
|
||||
if (paragraph_properties_ && need_break_)
|
||||
{
|
||||
@ -643,12 +643,12 @@ void odf_text_context::add_text_style(office_element_ptr & style_elm, std::wstri
|
||||
|
||||
if (text_p* p = dynamic_cast<text_p*>(current_level_.back().elm.get()))
|
||||
{
|
||||
p->paragraph_.paragraph_attrs_.text_style_name_ = style_name;
|
||||
p->paragraph_attrs_.text_style_name_ = style_name;
|
||||
}
|
||||
|
||||
if (text_h* h = dynamic_cast<text_h*>(current_level_.back().elm.get()))
|
||||
{
|
||||
h->paragraph_.paragraph_attrs_.text_style_name_ = style_name;
|
||||
h->paragraph_attrs_.text_style_name_ = style_name;
|
||||
}
|
||||
}
|
||||
|
||||
@ -709,8 +709,8 @@ void odf_text_context::save_property_break()
|
||||
current_level_[i].style_elm = style_->get_office_element();
|
||||
current_level_[i].style_name = style_->get_name();
|
||||
|
||||
if (p) p->paragraph_.paragraph_attrs_.text_style_name_ = current_level_[i].style_name;
|
||||
if (h) h->paragraph_.paragraph_attrs_.text_style_name_ = current_level_[i].style_name;
|
||||
if (p) p->paragraph_attrs_.text_style_name_ = current_level_[i].style_name;
|
||||
if (h) h->paragraph_attrs_.text_style_name_ = current_level_[i].style_name;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -424,7 +424,7 @@ void ods_table_context::set_data_validation_error(const std::wstring &title, con
|
||||
text_p *p = dynamic_cast<text_p*>(error_message->content_.back().get());
|
||||
if (p)
|
||||
{
|
||||
p->paragraph_.add_text(content);
|
||||
p->add_text(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -452,7 +452,7 @@ void ods_table_context::set_data_validation_promt(const std::wstring &title, con
|
||||
text_p *p = dynamic_cast<text_p*>(help_message->content_.back().get());
|
||||
if (p)
|
||||
{
|
||||
p->paragraph_.add_text(content);
|
||||
p->add_text(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -160,9 +160,6 @@ ods_table_state::ods_table_state(odf_conversion_context * Context, office_elemen
|
||||
|
||||
defaut_row_height_ = 9;
|
||||
defaut_column_width_ = 28.34467120181406 * 1.674;//
|
||||
|
||||
|
||||
cells_size_ = 0;
|
||||
}
|
||||
|
||||
void ods_table_state::set_table_name(std::wstring name)
|
||||
@ -498,17 +495,17 @@ void ods_table_state::set_row_height(double height)
|
||||
|
||||
bool ods_table_state::is_cell_hyperlink()
|
||||
{
|
||||
if ( cells_size_ < 1 )return false;
|
||||
if (cells_.empty())return false;
|
||||
return cells_.back().hyperlink_idx >= 0 ? true : false;
|
||||
}
|
||||
bool ods_table_state::is_cell_comment()
|
||||
{
|
||||
if ( cells_size_ < 1 )return false;
|
||||
if (cells_.empty())return false;
|
||||
return cells_.back().comment_idx >= 0 ? true : false;
|
||||
}
|
||||
bool ods_table_state::is_cell_data_validation()
|
||||
{
|
||||
if ( cells_size_ < 1 ) return false;
|
||||
if (cells_.empty()) return false;
|
||||
return cells_.back().data_validation_name.empty() ? true : false;
|
||||
}
|
||||
int ods_table_state::is_cell_hyperlink(int col, int row)
|
||||
@ -607,14 +604,14 @@ office_element_ptr & ods_table_state::current_row_element()
|
||||
}
|
||||
office_element_ptr & ods_table_state::current_cell_element()
|
||||
{
|
||||
if (cells_size_ > 0)
|
||||
if (false == cells_.empty())
|
||||
return cells_.back().elm;
|
||||
else
|
||||
throw;
|
||||
}
|
||||
ods_hyperlink_state & ods_table_state::current_hyperlink()
|
||||
{
|
||||
if ((cells_size_ > 0 && !hyperlinks_.empty()) && (cells_.back().hyperlink_idx >= 0) )
|
||||
if ((false == cells_.empty() && !hyperlinks_.empty()) && (cells_.back().hyperlink_idx >= 0) )
|
||||
{
|
||||
return hyperlinks_[cells_.back().hyperlink_idx];
|
||||
}
|
||||
@ -657,7 +654,6 @@ void ods_table_state::start_cell(office_element_ptr & elm, office_element_ptr &
|
||||
|
||||
current_table_column_ += state.repeated;
|
||||
cells_.push_back(state);
|
||||
cells_size_++;
|
||||
|
||||
if (current_covered_cols_ > 0 && covered_cell)
|
||||
current_covered_cols_--;
|
||||
@ -665,7 +661,7 @@ void ods_table_state::start_cell(office_element_ptr & elm, office_element_ptr &
|
||||
|
||||
void ods_table_state::set_cell_format_value(office_value_type::type value_type)
|
||||
{
|
||||
if (cells_size_ < 1)return;
|
||||
if (cells_.empty())return;
|
||||
if (value_type == office_value_type::Custom)return; //general .. need detect
|
||||
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
|
||||
@ -679,7 +675,7 @@ void ods_table_state::set_cell_format_value(office_value_type::type value_type)
|
||||
}
|
||||
void ods_table_state::set_cell_type(int type)
|
||||
{
|
||||
if (cells_size_ < 1)return;
|
||||
if (cells_.empty())return;
|
||||
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
|
||||
if (cell == NULL)return;
|
||||
@ -1270,7 +1266,7 @@ void ods_table_state::set_cell_text(odf_text_context* text_context, bool cash_va
|
||||
}
|
||||
void ods_table_state::set_cell_value(const std::wstring & value, bool need_cash)
|
||||
{
|
||||
if (cells_size_ < 1)return;
|
||||
if (cells_.empty())return;
|
||||
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
|
||||
if (cell == NULL)return;
|
||||
@ -1416,7 +1412,7 @@ void ods_table_state::end_cell_text()
|
||||
}
|
||||
void ods_table_state::end_cell()
|
||||
{
|
||||
if ( cells_size_ < 1)return;
|
||||
if (cells_.empty())return;
|
||||
|
||||
if (cells_.back().comment_idx >= 0)
|
||||
{
|
||||
@ -1434,6 +1430,10 @@ void ods_table_state::end_cell()
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
|
||||
if (cell)cell->attlist_.common_value_and_type_attlist_ = boost::none;
|
||||
}
|
||||
if (map_merged_cells.empty())
|
||||
{
|
||||
cells_.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
void ods_table_state::add_default_cell( int repeated)
|
||||
@ -1565,7 +1565,6 @@ void ods_table_state::add_default_cell( int repeated)
|
||||
state.comment_idx = comment_idx;
|
||||
|
||||
cells_.push_back(state);
|
||||
cells_size_++;
|
||||
|
||||
current_table_column_ += state.repeated;
|
||||
|
||||
@ -1667,6 +1666,13 @@ void ods_table_state::start_conditional_rule(int rule_type, _CP_OPT(unsigned int
|
||||
if (col.empty()) col = L".A";
|
||||
if (row.empty()) row = L"1";
|
||||
|
||||
if (std::wstring::npos != table.find(L" "))
|
||||
{
|
||||
if (table[0] != L'\'')
|
||||
{
|
||||
table = L"'" + table + L"'";
|
||||
}
|
||||
}
|
||||
condition->attr_.calcext_base_cell_address_ = table + col + row;
|
||||
}
|
||||
switch(rule_type)
|
||||
|
||||
@ -124,7 +124,9 @@ namespace utils
|
||||
|
||||
std::reverse(a.begin(), a.end());
|
||||
XmlUtils::replace_all( a, L"$", L"");
|
||||
XmlUtils::GetUpper(a);
|
||||
XmlUtils::replace_all( a, L"[", L"");
|
||||
XmlUtils::replace_all( a, L"]", L"");
|
||||
XmlUtils::GetUpper(a);
|
||||
|
||||
for (size_t i = 0; i < a.length(); i++)
|
||||
{
|
||||
@ -493,7 +495,6 @@ private:
|
||||
std::vector<office_element_ptr> current_level_;//постоянно меняющийся список уровней ("0-й элемент - сама таблица)
|
||||
|
||||
std::vector<ods_cell_state> cells_;
|
||||
long cells_size_;
|
||||
|
||||
std::vector<ods_hyperlink_state> hyperlinks_;
|
||||
std::map<unsigned int, ods_shared_formula_state> shared_formulas_;
|
||||
|
||||
@ -1325,7 +1325,8 @@ int odt_conversion_context::start_comment(int oox_comm_id)
|
||||
create_element(L"office", L"annotation", comm_elm, this);
|
||||
|
||||
comment_context_.start_comment(comm_elm, oox_comm_id);
|
||||
|
||||
|
||||
comm_state = 1;
|
||||
if (text_context()->current_level_.empty())
|
||||
{
|
||||
comm_state = 2;
|
||||
@ -1339,8 +1340,10 @@ int odt_conversion_context::start_comment(int oox_comm_id)
|
||||
|
||||
odf_element_state state(comm_elm, L"", office_element_ptr(), text_context()->current_level_.size());
|
||||
text_context()->current_level_.push_back(state);
|
||||
|
||||
return comm_state;
|
||||
}
|
||||
return comm_state;
|
||||
else return 0;
|
||||
}
|
||||
void odt_conversion_context::start_comment_content()
|
||||
{
|
||||
|
||||
@ -71,9 +71,9 @@ class dc_date : public office_element_impl<dc_date>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeDcDate;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element ( const office_element_ptr & child_element){}
|
||||
@ -92,9 +92,9 @@ class dc_creator : public office_element_impl<dc_creator>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeDcCreator;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -113,9 +113,9 @@ class office_annotation : public office_element_impl<office_annotation>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeOfficeAnnotation;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
@ -139,9 +139,9 @@ class office_annotation_end : public office_element_impl<office_annotation_end>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeOfficeAnnotationEnd;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element( const office_element_ptr & child_element){}
|
||||
@ -166,9 +166,9 @@ class officeooo_annotation : public office_element_impl<officeooo_annotation>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeOfficeAnnotation;
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
|
||||
@ -49,10 +49,10 @@ class office_body : public office_element_impl<office_body>
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
|
||||
static const ElementType type = typeOfficeBody;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE()
|
||||
|
||||
|
||||
office_element * content() { return content_.get(); }
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user