mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-11 02:16:02 +08:00
Compare commits
371 Commits
core/devel
...
core/devel
| Author | SHA1 | Date | |
|---|---|---|---|
| b18cd44cf6 | |||
| 6705045dd4 | |||
| 533bc2c250 | |||
| 85226c0821 | |||
| fecefb672d | |||
| f91e030836 | |||
| d0591483bc | |||
| 729f9f246f | |||
| 17a6ba735b | |||
| de22fb4737 | |||
| 751774419e | |||
| 8278609f10 | |||
| 445eedc7a3 | |||
| ed7661b93c | |||
| a17a04298a | |||
| f7ba686f0c | |||
| c41385e1ae | |||
| f582a9b690 | |||
| b36c2dbaf9 | |||
| 10b9e9e5e8 | |||
| 1beb5440f9 | |||
| 9a9ba4cc62 | |||
| 5b4c6363bb | |||
| 2026d064ef | |||
| 42257ca447 | |||
| 6f2fdcd971 | |||
| 9b4b7a26fd | |||
| 4d688b3922 | |||
| be8d427e26 | |||
| 7e0749ddda | |||
| 9f2324d208 | |||
| 6e258b85d7 | |||
| 24e55018a0 | |||
| 2352ae5d88 | |||
| 2cba43e6f3 | |||
| abcf8d0246 | |||
| c18b955467 | |||
| 7896b75001 | |||
| 7d188b2213 | |||
| 79ead484cc | |||
| be65f18a0e | |||
| 60f61109a1 | |||
| 4201bcecc6 | |||
| 7b7bfbc5dd | |||
| a70255e500 | |||
| 7e9dede9b3 | |||
| 9b7ad03465 | |||
| 3162bb0bfe | |||
| ec95648c43 | |||
| 72ac11ac07 | |||
| f70ea2b74f | |||
| db834666ba | |||
| 6ed0e13178 | |||
| 446e519110 | |||
| fb1fc01963 | |||
| 4651ae1bbb | |||
| 18606e23c6 | |||
| ed6d070d1f | |||
| f00cecbcaf | |||
| c9aee26fd6 | |||
| 32d3c0e65c | |||
| 33aeef2c02 | |||
| 7c97941acc | |||
| 01a4cd2289 | |||
| 202b58fb10 | |||
| b221150797 | |||
| 2084587e9a | |||
| 8332c28ac2 | |||
| 435a11d75c | |||
| 9a5329f5d6 | |||
| 8eecbf5fa5 | |||
| 9e1773df65 | |||
| 39e4140524 | |||
| bd90de857e | |||
| 57f2ec7b96 | |||
| 634098a6fa | |||
| bdbf208f6c | |||
| a652f5d73f | |||
| 1602843aa6 | |||
| cdb7fb8ea6 | |||
| 6387e9fa69 | |||
| 4e8097c93d | |||
| 65254b57b2 | |||
| 95899e23a8 | |||
| 5c8757d346 | |||
| 234e19d68a | |||
| 62145b7204 | |||
| 8bcc6d1501 | |||
| 09ef46f333 | |||
| 1839350526 | |||
| d7587e91b1 | |||
| 7b0a342cf9 | |||
| 3d01b0782e | |||
| fecfcfa7d2 | |||
| 29b5fa513a | |||
| f9a19badbf | |||
| d2630ea73c | |||
| a4a58c4782 | |||
| 29a3d80071 | |||
| 598bb419c0 | |||
| 087da9d2ce | |||
| c505aced48 | |||
| 959d5e5fcd | |||
| 8ee0cf4b2c | |||
| 426342074e | |||
| d2c092fe62 | |||
| a336917338 | |||
| 8925ddeee5 | |||
| 84824631b2 | |||
| dc3ecb1fc0 | |||
| 266cef8c49 | |||
| a5e821cd21 | |||
| cb5d92334e | |||
| f6dbc6b9f0 | |||
| c2c6430495 | |||
| 9ecf5b7834 | |||
| 1d003863dd | |||
| 774561bd00 | |||
| d356a305b9 | |||
| 95c472c15c | |||
| 2dbec241f7 | |||
| f3c66cab50 | |||
| 11e6fc3e06 | |||
| cdf8c0a11b | |||
| ae29cebe35 | |||
| e933a1fb42 | |||
| 5a3f98c502 | |||
| 8677540a82 | |||
| f4ceac5b2b | |||
| 61be4ea100 | |||
| 51c6ce2ba2 | |||
| e13bc44198 | |||
| 56cefcb1be | |||
| 6f860c17e3 | |||
| fb9edc4f81 | |||
| 4eb0a73f3c | |||
| 7929d798c8 | |||
| 4c3d8ca059 | |||
| ad74a8ea6b | |||
| f50dda7c31 | |||
| f78a805fa3 | |||
| bc177269a9 | |||
| 84cab29276 | |||
| d7c7584b4d | |||
| 1346072ab2 | |||
| 3b6b463b1b | |||
| a75daf9d90 | |||
| dc81f97bac | |||
| d194249ffb | |||
| 4ec04c31c5 | |||
| 8774035be9 | |||
| 8cec4ce82e | |||
| 17e46a2c99 | |||
| c5ffcd4b44 | |||
| 51c77c3a85 | |||
| 4326a7d258 | |||
| 38813fd105 | |||
| 19960fa3b5 | |||
| 32121d6d3b | |||
| 2dcef22681 | |||
| ee5a56183e | |||
| b90e3a3cd1 | |||
| f074d1252b | |||
| 30f07d3aa4 | |||
| d27b7b2f56 | |||
| 1dbf3e83ad | |||
| a5f70c9740 | |||
| ab72c8973d | |||
| a204c576ad | |||
| 4a7d40d3fb | |||
| 4f5fb86f87 | |||
| f7f2629e9d | |||
| 048c2fd034 | |||
| 3299c47858 | |||
| 8977e2c792 | |||
| 089e7d3230 | |||
| bd5863a02d | |||
| e0296d5a9a | |||
| e26cf3bf39 | |||
| 8525a1e9f0 | |||
| 2e8c83a668 | |||
| e857496565 | |||
| 143f65ae5a | |||
| f89d75ae92 | |||
| 403507206d | |||
| 7f6431700c | |||
| 7977bcf069 | |||
| 32ad6b46e2 | |||
| bf6bfce051 | |||
| 805c24ff1a | |||
| 2c4bb7c808 | |||
| 15a711396f | |||
| 3d8403346b | |||
| 5700503efe | |||
| d01b1e7d41 | |||
| 584cc6ab80 | |||
| 4b727edde8 | |||
| 9d10c4ddce | |||
| d5026d014d | |||
| ac0b7e4e22 | |||
| 623fe25415 | |||
| c4c9d50aae | |||
| 5d8dda02ec | |||
| bc3461147d | |||
| 80d4e6057b | |||
| 2dc5c2916a | |||
| 5f9631a3c5 | |||
| ef7df69036 | |||
| b3961994d2 | |||
| 927a847607 | |||
| 674cc6c1a2 | |||
| 5d77cf9473 | |||
| 512dad1d24 | |||
| 3d684934f1 | |||
| dd6ac185fb | |||
| 9825b6e32e | |||
| 653008ebfc | |||
| 236e93aa9c | |||
| 164c7faf94 | |||
| 4c07ddbcc7 | |||
| 7be543c3a6 | |||
| ccb47b0bda | |||
| 8aefacd411 | |||
| 6cd5fbcaca | |||
| 7c964b3f9c | |||
| 8c43c781bd | |||
| 7496de06f0 | |||
| fdd443a2d7 | |||
| 037c4046eb | |||
| 4e5ac14ca9 | |||
| dedf74b366 | |||
| 6f2eef1137 | |||
| 9a8d3edbef | |||
| 305ebda78d | |||
| 114050c23e | |||
| 7eee0755bf | |||
| c329f29e9a | |||
| 0f3a02ca7c | |||
| 62d4860873 | |||
| 21666ee309 | |||
| 47ff766e4e | |||
| 50cbc671b3 | |||
| f2d3390bd4 | |||
| fb5af12d7a | |||
| 63655a97e9 | |||
| fdf032d9f8 | |||
| 3b85b58558 | |||
| 00f1f40a1e | |||
| 46c05a4c27 | |||
| f3a510bd58 | |||
| 45231b822c | |||
| e0591675d2 | |||
| 67a849f110 | |||
| 15800296f7 | |||
| 52fe741f9a | |||
| b3ee693890 | |||
| 8c2e1738ea | |||
| bf33aed853 | |||
| 5869c7a02e | |||
| bbd429a994 | |||
| f4d636539e | |||
| 92e02257d7 | |||
| d2046d7ccb | |||
| 7bc35a157a | |||
| 903245e8a7 | |||
| 25ee9c3c1c | |||
| 9ead40d279 | |||
| e097379c21 | |||
| f86579d601 | |||
| de7511f243 | |||
| 9a68a75f70 | |||
| e04388aa32 | |||
| cee61e7a92 | |||
| 48185ed4e9 | |||
| 7bea086784 | |||
| 774f9c42cb | |||
| 10964d32e6 | |||
| da2493ed3b | |||
| 0a183f3505 | |||
| ac6cc1ec24 | |||
| a1846da0da | |||
| 0bd10c28ac | |||
| 2367cee329 | |||
| 288d89301a | |||
| 4d519e8f26 | |||
| 1bd2c0b852 | |||
| 82b0f4bce8 | |||
| 5635239274 | |||
| 1f979fc4cc | |||
| 80c4a65147 | |||
| 4fda6101eb | |||
| 99822fb597 | |||
| f1d9c12f07 | |||
| 30ef5a9de4 | |||
| 765ca861fb | |||
| 99570b3b86 | |||
| d9c6759108 | |||
| b82a8c6b9b | |||
| d76b1897aa | |||
| 857b79ee23 | |||
| ecba12b29f | |||
| efc48ab44c | |||
| 5f0620ed90 | |||
| 150ff1fae2 | |||
| dd1b9ca9be | |||
| c6ed59a742 | |||
| 1d3315711e | |||
| 46ddcff040 | |||
| a044b262e4 | |||
| 51b0e715a1 | |||
| 1cdeefb576 | |||
| db9aeb40bb | |||
| 8a41f0c716 | |||
| 4be5a491da | |||
| 4b4d4ebc54 | |||
| b132ea266a | |||
| e20e061330 | |||
| fc97b32d18 | |||
| a63aa93092 | |||
| 91cb5e895b | |||
| 16d233da47 | |||
| 69e8a6501e | |||
| dac6ae2e48 | |||
| 9f145333f8 | |||
| c8c5b82924 | |||
| 2e99efeeb6 | |||
| c4492f2cd2 | |||
| 41da15d8cf | |||
| ea3db6936c | |||
| 0928e7d787 | |||
| 2d3040aba2 | |||
| ce590a4a61 | |||
| e899647453 | |||
| fe1553f8da | |||
| 04d197375c | |||
| d2f1022b5a | |||
| 0265162cb9 | |||
| 9be4d6ca0e | |||
| 9e9da20450 | |||
| 082fd814af | |||
| 39cd23d7c0 | |||
| 78b051c999 | |||
| 2836fee493 | |||
| 6e409d2f7e | |||
| 3e698b8579 | |||
| 95e32f00d0 | |||
| 61c632ce55 | |||
| a0b93fd1b2 | |||
| 0b096a4c46 | |||
| a97518359a | |||
| 96cea25bca | |||
| 1a57f62773 | |||
| 9d1f83b1ce | |||
| 6653e8ef82 | |||
| fd121841a9 | |||
| 00255297c8 | |||
| 74a0fd2928 | |||
| ce7487a14d | |||
| 95d9d8bc8e | |||
| dce0b43c11 | |||
| d7a981a84e | |||
| bb52ddba2b | |||
| a82814d565 | |||
| bab37e1634 | |||
| 06dea5685a | |||
| 105a23d5bc | |||
| ef76c80014 | |||
| bb6e95ce20 | |||
| 69d9823847 | |||
| ef69fc4b34 | |||
| f925e5cae9 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -43,3 +43,4 @@ OfficeUtils/win32/OfficeUtilsLib/OfficeUtilsLib/ReadMe.txt
|
||||
*.pdb
|
||||
*.tlb
|
||||
*.idb
|
||||
**/.hg
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -125,7 +125,7 @@ namespace DocFormatUtils
|
||||
|
||||
if(bDeleteNoUnicode)
|
||||
{
|
||||
for(size_t pos = 0; pos != data.size(); ++pos)
|
||||
for(size_t pos = 0; pos < data.size(); ++pos)
|
||||
{
|
||||
switch(data[pos])
|
||||
{
|
||||
@ -157,7 +157,7 @@ namespace DocFormatUtils
|
||||
}
|
||||
else
|
||||
{
|
||||
for(size_t pos = 0; pos != data.size(); ++pos)
|
||||
for(size_t pos = 0; pos < data.size(); ++pos)
|
||||
{
|
||||
switch(data[pos])
|
||||
{
|
||||
@ -166,6 +166,8 @@ namespace DocFormatUtils
|
||||
case '\'': buffer.append(L"'"); break;
|
||||
case '<': buffer.append(L"<"); break;
|
||||
case '>': buffer.append(L">"); break;
|
||||
case '\0':
|
||||
return buffer;
|
||||
default: buffer.append(&data[pos], 1); break;
|
||||
}
|
||||
}
|
||||
@ -503,6 +505,7 @@ namespace DocFormatUtils
|
||||
{
|
||||
STLCollection->push_back(result[i]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class T> static bool GetSTLCollectionFromUtf8( T *STLCollection, unsigned char *bytes, int size)
|
||||
@ -768,6 +771,7 @@ namespace DocFormatUtils
|
||||
{
|
||||
return (std::to_wstring(value));
|
||||
}
|
||||
|
||||
static inline std::wstring DoubleToWideString(double value)
|
||||
{
|
||||
std::wstringstream src;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -406,34 +406,12 @@ namespace XMLTools
|
||||
|
||||
void WriteInteger(int Value, int Base = 10)
|
||||
{
|
||||
#if defined(_WIN32) || defined (_WIN64)
|
||||
wchar_t buff[33] ={};
|
||||
_itow(Value, buff, Base);
|
||||
m_str += std::wstring(buff);
|
||||
#else
|
||||
m_str += std::to_wstring(Value);
|
||||
#endif
|
||||
}
|
||||
|
||||
void WriteDouble(double Value)
|
||||
{
|
||||
#if defined(_WIN32) || defined (_WIN64)
|
||||
int *dec = NULL, *sign = NULL;
|
||||
char *str = _fcvt( Value , 4, dec, sign);
|
||||
|
||||
if (str)
|
||||
{
|
||||
std::string sA(str);
|
||||
delete []str;
|
||||
m_str += std::wstring(sA.begin(), sA.end());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_str += L"0";
|
||||
}
|
||||
#else
|
||||
m_str += std::to_wstring(Value);
|
||||
#endif
|
||||
}
|
||||
void WriteBoolean(bool Value)
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -38,7 +38,7 @@ namespace DocFileFormat
|
||||
: PropertiesMapping( writer ), _isRunStyleNeeded(isRunStyleNeeded), _isOwnRPr(true), _isRTL(false)
|
||||
{
|
||||
_doc = doc;
|
||||
_rPr = new XMLTools::XMLElement( _T( "w:rPr" ) );
|
||||
_rPr = new XMLTools::XMLElement( L"w:rPr");
|
||||
_revisionData = rev;
|
||||
_currentPapx = currentPapx;
|
||||
_styleChpx = styleChpx;
|
||||
@ -77,7 +77,7 @@ namespace DocFileFormat
|
||||
// apend revision changes
|
||||
if (_revisionData->Type == Changed)
|
||||
{
|
||||
XMLTools::XMLElement rPrChange( _T( "w:rPrChange" ) );
|
||||
XMLTools::XMLElement rPrChange( L"w:rPrChange");
|
||||
|
||||
//todooo date - _revisionData->Dttm.Convert( new DateMapping( rPrChange ) );
|
||||
|
||||
@ -85,7 +85,7 @@ namespace DocFileFormat
|
||||
|
||||
if (author_str)
|
||||
{
|
||||
XMLTools::XMLAttribute author( _T( "w:author" ), FormatUtils::XmlEncode(*author_str).c_str());
|
||||
XMLTools::XMLAttribute author( L"w:author", FormatUtils::XmlEncode(*author_str));
|
||||
rPrChange.AppendAttribute( author );
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ namespace DocFileFormat
|
||||
//write properties
|
||||
if ( ( m_pXmlWriter != NULL ) && ( ( _rPr->GetChildCount() > 0 ) || ( _rPr->GetAttributeCount() > 0 ) ) )
|
||||
{
|
||||
m_pXmlWriter->WriteString( _rPr->GetXMLString().c_str() );
|
||||
m_pXmlWriter->WriteString( _rPr->GetXMLString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ namespace DocFileFormat
|
||||
{
|
||||
//Todo сделать определение симольного шрифта через fontManager
|
||||
//Заглушка под Google Docs, они пишут bullet в Arial
|
||||
if (-1 != m_sAsciiFont.find (_T("Arial")) && -1 != m_sEastAsiaFont.find (_T("Arial")) && -1 != m_shAnsiFont.find (_T("Arial")))
|
||||
if (-1 != m_sAsciiFont.find (L"Arial") && -1 != m_sEastAsiaFont.find (L"Arial") && -1 != m_shAnsiFont.find (L"Arial"))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -118,14 +118,14 @@ namespace DocFileFormat
|
||||
|
||||
void CharacterPropertiesMapping::convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent )
|
||||
{
|
||||
XMLTools::XMLElement * rFonts = new XMLTools::XMLElement ( _T( "w:rFonts" ) );
|
||||
XMLTools::XMLElement * color = new XMLTools::XMLElement ( _T( "w:color" ) );
|
||||
XMLTools::XMLAttribute * colorVal = new XMLTools::XMLAttribute ( _T( "w:val" ) );
|
||||
XMLTools::XMLElement * lang = new XMLTools::XMLElement ( _T( "w:lang" ) );
|
||||
XMLTools::XMLElement * rFonts = new XMLTools::XMLElement ( L"w:rFonts" );
|
||||
XMLTools::XMLElement * color = new XMLTools::XMLElement ( L"w:color" );
|
||||
XMLTools::XMLAttribute * colorVal = new XMLTools::XMLAttribute ( L"w:val" );
|
||||
XMLTools::XMLElement * lang = new XMLTools::XMLElement ( L"w:lang" );
|
||||
|
||||
if (_webHidden)
|
||||
{
|
||||
XMLTools::XMLElement * webHidden = new XMLTools::XMLElement ( _T( "w:webHidden" ) );
|
||||
XMLTools::XMLElement * webHidden = new XMLTools::XMLElement ( L"w:webHidden" );
|
||||
parent->AppendChild( *webHidden );
|
||||
RELEASEOBJECT( webHidden );
|
||||
}
|
||||
@ -144,95 +144,96 @@ namespace DocFileFormat
|
||||
_currentIstd = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
if (_currentIstd < _doc->Styles->Styles->size())
|
||||
{
|
||||
appendValueElement( parent, _T( "rStyle" ), StyleSheetMapping::MakeStyleId( _doc->Styles->Styles->at( _currentIstd ) ).c_str(), true );
|
||||
appendValueElement( parent, L"rStyle", StyleSheetMapping::MakeStyleId( _doc->Styles->Styles->at( _currentIstd ) ), true );
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
||||
case sprmCFBiDi :
|
||||
appendFlagElement( parent, *iter, _T( "rtl" ), true );
|
||||
appendFlagElement( parent, *iter, L"rtl", true );
|
||||
_isRTL = true;
|
||||
break;
|
||||
|
||||
case sprmOldCFBold :
|
||||
case sprmCFBold :
|
||||
appendFlagElement( parent, *iter, _T( "b" ), true );
|
||||
appendFlagElement( parent, *iter, L"b", true );
|
||||
break;
|
||||
|
||||
case sprmCFBoldBi :
|
||||
appendFlagElement( parent, *iter, _T( "bCs" ), true );
|
||||
appendFlagElement( parent, *iter, L"bCs", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFCaps :
|
||||
case sprmCFCaps :
|
||||
appendFlagElement( parent, *iter, _T( "caps" ), true );
|
||||
appendFlagElement( parent, *iter, L"caps", true );
|
||||
break;
|
||||
|
||||
case sprmCFComplexScripts :
|
||||
appendFlagElement( parent, *iter, _T( "cs" ), true );
|
||||
appendFlagElement( parent, *iter, L"cs", true );
|
||||
break;
|
||||
|
||||
case sprmCFDStrike :
|
||||
appendFlagElement( parent, *iter, _T( "dstrike" ), true );
|
||||
appendFlagElement( parent, *iter, L"dstrike", true );
|
||||
break;
|
||||
|
||||
case sprmCFEmboss :
|
||||
appendFlagElement( parent, *iter, _T( "emboss" ), true );
|
||||
appendFlagElement( parent, *iter, L"emboss", true );
|
||||
break;
|
||||
|
||||
case sprmCFImprint :
|
||||
appendFlagElement( parent, *iter, _T( "imprint" ), true );
|
||||
appendFlagElement( parent, *iter, L"imprint", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFItalic :
|
||||
case sprmCFItalic :
|
||||
appendFlagElement( parent, *iter, _T( "i" ), true );
|
||||
appendFlagElement( parent, *iter, L"i", true );
|
||||
break;
|
||||
|
||||
case sprmCFItalicBi:
|
||||
appendFlagElement( parent, *iter, _T( "iCs" ), true );
|
||||
appendFlagElement( parent, *iter, L"iCs", true );
|
||||
break;
|
||||
|
||||
case 0x0875:
|
||||
appendFlagElement( parent, *iter, _T( "noProof" ), true );
|
||||
appendFlagElement( parent, *iter, L"noProof", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFOutline:
|
||||
case sprmCFOutline:
|
||||
appendFlagElement( parent, *iter, _T( "outline" ), true );
|
||||
appendFlagElement( parent, *iter, L"outline", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFShadow:
|
||||
case sprmCFShadow:
|
||||
appendFlagElement( parent, *iter, _T( "shadow" ), true );
|
||||
appendFlagElement( parent, *iter, L"shadow", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFSmallCaps:
|
||||
case sprmCFSmallCaps:
|
||||
appendFlagElement( parent, *iter, _T( "smallCaps" ), true );
|
||||
appendFlagElement( parent, *iter, L"smallCaps", true );
|
||||
break;
|
||||
|
||||
case sprmCFSpecVanish:
|
||||
appendFlagElement( parent, *iter, _T( "specVanish" ), true );
|
||||
appendFlagElement( parent, *iter, L"specVanish", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFStrike:
|
||||
case sprmCFStrike:
|
||||
appendFlagElement( parent, *iter, _T( "strike" ), true );
|
||||
appendFlagElement( parent, *iter, L"strike", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFVanish:
|
||||
case sprmCFVanish:
|
||||
appendFlagElement( parent, *iter, _T( "vanish" ), true );
|
||||
appendFlagElement( parent, *iter, L"vanish", true );
|
||||
break;
|
||||
|
||||
case 0x0811:
|
||||
appendFlagElement( parent, *iter, _T( "webHidden" ), true );
|
||||
appendFlagElement( parent, *iter, L"webHidden", true );
|
||||
break;
|
||||
|
||||
case sprmOldCIss:
|
||||
case sprmCIss:
|
||||
appendValueElement( parent, _T( "vertAlign" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ).c_str(), true );
|
||||
if (iter->argumentsSize > 0 && iter->Arguments[0] < 3) //Metaevan.doc
|
||||
appendValueElement( parent, L"vertAlign", FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ), true );
|
||||
break;
|
||||
|
||||
case sprmCRgLid0_80:
|
||||
@ -274,7 +275,7 @@ namespace DocFileFormat
|
||||
case sprmCBrc80:
|
||||
case sprmCBrc:
|
||||
{ //borders
|
||||
XMLTools::XMLElement bdr( _T( "w:bdr" ) );
|
||||
XMLTools::XMLElement bdr( L"w:bdr" );
|
||||
BorderCode bc( iter->Arguments, iter->argumentsSize );
|
||||
appendBorderAttributes( &bc, &bdr );
|
||||
parent->AppendChild( bdr );
|
||||
@ -292,7 +293,7 @@ namespace DocFileFormat
|
||||
case sprmCIco:
|
||||
case sprmCIcoBi:
|
||||
{//color
|
||||
colorVal->SetValue( FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ).c_str() );
|
||||
colorVal->SetValue( FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ));
|
||||
}break;
|
||||
|
||||
case sprmCCv:
|
||||
@ -305,17 +306,17 @@ namespace DocFileFormat
|
||||
|
||||
case sprmCOldHighlight:
|
||||
{
|
||||
appendValueElement( parent, _T( "highlight" ), FormatUtils::MapValueToWideString( iter->Arguments[1], &Global::ColorIdentifier[0][0], 17, 12 ).c_str(), true );
|
||||
appendValueElement( parent, L"highlight", FormatUtils::MapValueToWideString( iter->Arguments[1], &Global::ColorIdentifier[0][0], 17, 12 ), true );
|
||||
}break;
|
||||
case sprmCHighlight:
|
||||
{
|
||||
appendValueElement( parent, _T( "highlight" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ).c_str(), true );
|
||||
appendValueElement( parent, L"highlight", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ), true );
|
||||
}break;
|
||||
|
||||
case sprmOldCDxaSpace:
|
||||
case sprmCDxaSpace:
|
||||
{
|
||||
appendValueElement( parent, _T( "spacing" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
|
||||
appendValueElement( parent, L"spacing", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
}break;
|
||||
|
||||
case sprmCFtcBi :
|
||||
@ -331,21 +332,21 @@ namespace DocFileFormat
|
||||
|
||||
case sprmCHpsBi :
|
||||
{
|
||||
appendValueElement( parent, _T( "szCs" ),
|
||||
FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
|
||||
appendValueElement( parent, L"szCs",
|
||||
FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
}
|
||||
break;
|
||||
// Font Size in points (2~3276) default 20-half-points
|
||||
case sprmOldCHps :
|
||||
{
|
||||
appendValueElement (parent, _T( "sz" ),
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUChar (iter->Arguments, 0, iter->argumentsSize) ).c_str(),
|
||||
appendValueElement (parent, L"sz",
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUChar (iter->Arguments, 0, iter->argumentsSize) ),
|
||||
true );
|
||||
}break;
|
||||
case sprmCHps :
|
||||
{
|
||||
appendValueElement (parent, _T( "sz" ),
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize) ).c_str(), true );
|
||||
appendValueElement (parent, L"sz",
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize) ), true );
|
||||
}break;
|
||||
|
||||
case sprmCMajority :
|
||||
@ -355,18 +356,18 @@ namespace DocFileFormat
|
||||
case sprmOldCHpsPos:
|
||||
{ // The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
|
||||
short nVertPos = FormatUtils::BytesToUChar(iter->Arguments, 0, iter->argumentsSize);
|
||||
appendValueElement (parent, _T("position"), nVertPos, true);
|
||||
appendValueElement (parent, L"position", nVertPos, true);
|
||||
}break;
|
||||
case sprmCHpsPos:
|
||||
{ // The vertical position, in half-points, of text relative to the normal position. (MUST be between -3168 and 3168)
|
||||
short nVertPos = FormatUtils::BytesToInt16(iter->Arguments, 0, iter->argumentsSize);
|
||||
appendValueElement (parent, _T("position"), nVertPos, true);
|
||||
appendValueElement (parent, L"position", nVertPos, true);
|
||||
}break;
|
||||
|
||||
case sprmOldCHpsKern:
|
||||
case sprmCHpsKern:
|
||||
{
|
||||
appendValueElement( parent, _T( "kern" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
|
||||
appendValueElement( parent, L"kern", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
}break;
|
||||
|
||||
case sprmOldCFtc:
|
||||
@ -376,10 +377,10 @@ namespace DocFileFormat
|
||||
|
||||
if( nIndex < _doc->FontTable->Data.size() )
|
||||
{
|
||||
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( _T( "w:ascii" ) );
|
||||
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( L"w:ascii" );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
m_sAsciiFont = ffn->xszFtn;
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sAsciiFont).c_str() );
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sAsciiFont, true));
|
||||
rFonts->AppendAttribute( *ascii );
|
||||
RELEASEOBJECT( ascii );
|
||||
}
|
||||
@ -390,10 +391,10 @@ namespace DocFileFormat
|
||||
int nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
if( nIndex >= 0 && nIndex < _doc->FontTable->Data.size() )
|
||||
{
|
||||
XMLTools::XMLAttribute* eastAsia = new XMLTools::XMLAttribute( _T( "w:eastAsia" ) );
|
||||
XMLTools::XMLAttribute* eastAsia = new XMLTools::XMLAttribute( L"w:eastAsia" );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
m_sEastAsiaFont = ffn->xszFtn;
|
||||
eastAsia->SetValue( FormatUtils::XmlEncode(m_sEastAsiaFont).c_str() );
|
||||
eastAsia->SetValue( FormatUtils::XmlEncode(m_sEastAsiaFont));
|
||||
rFonts->AppendAttribute( *eastAsia );
|
||||
RELEASEOBJECT( eastAsia );
|
||||
}
|
||||
@ -405,10 +406,10 @@ namespace DocFileFormat
|
||||
int nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
if( nIndex>=0 && nIndex < _doc->FontTable->Data.size() )
|
||||
{
|
||||
XMLTools::XMLAttribute* ansi = new XMLTools::XMLAttribute( _T( "w:hAnsi" ) );
|
||||
XMLTools::XMLAttribute* ansi = new XMLTools::XMLAttribute( L"w:hAnsi" );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
m_shAnsiFont = ffn->xszFtn;
|
||||
ansi->SetValue( FormatUtils::XmlEncode(m_shAnsiFont).c_str() );
|
||||
ansi->SetValue( FormatUtils::XmlEncode(m_shAnsiFont));
|
||||
rFonts->AppendAttribute( *ansi );
|
||||
RELEASEOBJECT( ansi );
|
||||
}
|
||||
@ -417,18 +418,18 @@ namespace DocFileFormat
|
||||
case sprmOldCKul:
|
||||
case sprmCKul:
|
||||
{ //Underlining
|
||||
appendValueElement( parent, _T( "u" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::UnderlineCode[0][0], 56, 16 ).c_str(), true );
|
||||
appendValueElement( parent, L"u", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::UnderlineCode[0][0], 56, 16 ), true );
|
||||
}
|
||||
break;
|
||||
|
||||
case sprmCCharScale:
|
||||
{ //char width
|
||||
appendValueElement( parent, _T( "w" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
|
||||
appendValueElement( parent, L"w", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
}break;
|
||||
|
||||
case sprmCSfxText:
|
||||
{ //animation
|
||||
appendValueElement( parent, _T( "effect" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::TextAnimation[0][0], 7, 16 ).c_str(), true );
|
||||
appendValueElement( parent, L"effect", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::TextAnimation[0][0], 7, 16 ), true );
|
||||
}break;
|
||||
|
||||
case sprmCIdctHint:
|
||||
@ -482,8 +483,8 @@ namespace DocFileFormat
|
||||
|
||||
if (!m_sDefaultFont.empty() && m_sAsciiFont.empty() && m_sEastAsiaFont.empty() && m_shAnsiFont.empty())
|
||||
{//????
|
||||
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( _T( "w:ascii" ) );
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sDefaultFont).c_str() );
|
||||
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( L"w:ascii" );
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sDefaultFont));
|
||||
//rFonts->AppendAttribute( *ascii );
|
||||
RELEASEOBJECT( ascii );
|
||||
}
|
||||
@ -501,7 +502,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//append color
|
||||
if ( colorVal->GetValue() != _T( "" ) )
|
||||
if ( colorVal->GetValue() != L"")
|
||||
{
|
||||
color->AppendAttribute( *colorVal );
|
||||
parent->AppendChild( *color );
|
||||
@ -523,8 +524,8 @@ namespace DocFileFormat
|
||||
|
||||
if( flag != 128 )
|
||||
{
|
||||
XMLTools::XMLElement* ele = new XMLTools::XMLElement( _T( "w" ), elementName );
|
||||
XMLTools::XMLAttribute* val = new XMLTools::XMLAttribute( _T( "w:val" ) );
|
||||
XMLTools::XMLElement* ele = new XMLTools::XMLElement( L"w", elementName );
|
||||
XMLTools::XMLAttribute* val = new XMLTools::XMLAttribute( L"w:val" );
|
||||
|
||||
if ( unique )
|
||||
{
|
||||
@ -533,7 +534,7 @@ namespace DocFileFormat
|
||||
|
||||
if ( flag == 0 )
|
||||
{
|
||||
val->SetValue( _T( "false" ) );
|
||||
val->SetValue( L"false" );
|
||||
ele->AppendAttribute( *val );
|
||||
node->AppendChild( *ele );
|
||||
}
|
||||
@ -576,7 +577,7 @@ namespace DocFileFormat
|
||||
//invert it
|
||||
if ( stylesVal )
|
||||
{
|
||||
val->SetValue( _T( "false" ) );
|
||||
val->SetValue( L"false" );
|
||||
ele->AppendAttribute( *val );
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -54,16 +54,16 @@ namespace DocFileFormat
|
||||
|
||||
int index = 0;
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:comments" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:comments", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
int cp = m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr;
|
||||
|
||||
@ -72,11 +72,11 @@ namespace DocFileFormat
|
||||
{
|
||||
AnnotationReferenceDescriptor* atrdPre10 = static_cast<AnnotationReferenceDescriptor*>(m_document->AnnotationsReferencePlex->Elements[index]);
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:comment" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( index ).c_str() );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:author" ),
|
||||
FormatUtils::XmlEncode(m_document->AnnotationOwners->at( atrdPre10->GetAuthorIndex() ) ).c_str());
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:initials" ), atrdPre10->GetUserInitials().c_str() );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:comment", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( index ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:author",
|
||||
FormatUtils::XmlEncode(m_document->AnnotationOwners->at( atrdPre10->GetAuthorIndex() ) ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:initials", atrdPre10->GetUserInitials());
|
||||
|
||||
//!!!TODO!!!
|
||||
/*//ATRDpost10 is optional and not saved in all files
|
||||
@ -87,7 +87,7 @@ namespace DocFileFormat
|
||||
atrdPost10.Date.Convert(new DateMapping(_writer));
|
||||
}*/
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
while ( ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpHdr ) < (*m_document->IndividualCommentsPlex)[index + 1] )
|
||||
{
|
||||
@ -111,12 +111,12 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T( "w:comment" ));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:comment" );
|
||||
|
||||
++index;
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:comments" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:comments" );
|
||||
m_context->_docx->CommentsXML = std::wstring(m_pXmlWriter->GetXmlString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -40,129 +40,129 @@
|
||||
namespace OpenXmlContentTypes
|
||||
{
|
||||
// default content types
|
||||
static const TCHAR* Xml = _T("application/xml");
|
||||
static const wchar_t* Xml = L"application/xml";
|
||||
|
||||
// package content types
|
||||
static const TCHAR* Relationships = _T("application/vnd.openxmlformats-package.relationships+xml");
|
||||
static const wchar_t* Relationships = L"application/vnd.openxmlformats-package.relationships+xml";
|
||||
|
||||
static const TCHAR* CoreProperties = _T("application/vnd.openxmlformats-package.core-properties+xml");
|
||||
static const wchar_t* CoreProperties = L"application/vnd.openxmlformats-package.core-properties+xml";
|
||||
|
||||
// general office document content types
|
||||
static const TCHAR* ExtendedProperties = _T("application/vnd.openxmlformats-officedocument.extended-properties+xml");
|
||||
static const TCHAR* Theme = _T("application/vnd.openxmlformats-officedocument.theme+xml");
|
||||
static const wchar_t* ExtendedProperties = L"application/vnd.openxmlformats-officedocument.extended-properties+xml";
|
||||
static const wchar_t* Theme = L"application/vnd.openxmlformats-officedocument.theme+xml";
|
||||
|
||||
static const TCHAR* CustomXmlProperties = _T("application/vnd.openxmlformats-officedocument.customXmlProperties+xml");
|
||||
static const wchar_t* CustomXmlProperties = L"application/vnd.openxmlformats-officedocument.customXmlProperties+xml";
|
||||
|
||||
static const TCHAR* OleObject = _T("application/vnd.openxmlformats-officedocument.oleObject");
|
||||
static const TCHAR* Vml = _T("application/vnd.openxmlformats-officedocument.vmlDrawing");
|
||||
static const TCHAR* Drawing = _T("application/vnd.openxmlformats-officedocument.drawing+xml");
|
||||
static const wchar_t* OleObject = L"application/vnd.openxmlformats-officedocument.oleObject";
|
||||
static const wchar_t* Vml = L"application/vnd.openxmlformats-officedocument.vmlDrawing";
|
||||
static const wchar_t* Drawing = L"application/vnd.openxmlformats-officedocument.drawing+xml";
|
||||
|
||||
static const TCHAR* MSWordDocx = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
|
||||
static const wchar_t* MSWordDocx = L"application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
||||
|
||||
static const TCHAR* MSExcel = _T("application/vnd.ms-excel");
|
||||
static const TCHAR* MSWord = _T("application/msword");
|
||||
static const TCHAR* MSPowerpoint = _T("application/vnd.ms-powerpoint");
|
||||
static const wchar_t* MSExcel = L"application/vnd.ms-excel";
|
||||
static const wchar_t* MSWord = L"application/msword";
|
||||
static const wchar_t* MSPowerpoint = L"application/vnd.ms-powerpoint";
|
||||
|
||||
static const TCHAR* Emf = _T("image/x-emf");
|
||||
static const TCHAR* Jpeg = _T("image/jpeg");
|
||||
static const TCHAR* Png = _T("image/png");
|
||||
static const TCHAR* Tiff = _T("image/tiff");
|
||||
static const TCHAR* Wmf = _T("image/x-wmf");
|
||||
static const TCHAR* Bmp = _T("image/bmp");
|
||||
static const wchar_t* Emf = L"image/x-emf";
|
||||
static const wchar_t* Jpeg = L"image/jpeg";
|
||||
static const wchar_t* Png = L"image/png";
|
||||
static const wchar_t* Tiff = L"image/tiff";
|
||||
static const wchar_t* Wmf = L"image/x-wmf";
|
||||
static const wchar_t* Bmp = L"image/bmp";
|
||||
}
|
||||
|
||||
namespace WordprocessingMLContentTypes
|
||||
{
|
||||
// WordprocessingML content types
|
||||
static const TCHAR* MainDocument = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml");
|
||||
static const TCHAR* MainDocumentMacro = _T("application/vnd.ms-word.document.macroEnabled.main+xml");
|
||||
static const TCHAR* MainDocumentTemplate = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml");
|
||||
static const TCHAR* MainDocumentMacroTemplate = _T("application/vnd.ms-word.template.macroEnabledTemplate.main+xml");
|
||||
static const wchar_t* MainDocument = L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml";
|
||||
static const wchar_t* MainDocumentMacro = L"application/vnd.ms-word.document.macroEnabled.main+xml";
|
||||
static const wchar_t* MainDocumentTemplate = L"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml";
|
||||
static const wchar_t* MainDocumentMacroTemplate = L"application/vnd.ms-word.template.macroEnabledTemplate.main+xml";
|
||||
|
||||
static const TCHAR* Styles = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml");
|
||||
static const TCHAR* Numbering = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml");
|
||||
static const TCHAR* FontTable = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml");
|
||||
static const TCHAR* WebSettings = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml");
|
||||
static const TCHAR* Settings = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml");
|
||||
static const wchar_t* Styles = L"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";
|
||||
static const wchar_t* Numbering = L"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml";
|
||||
static const wchar_t* FontTable = L"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml";
|
||||
static const wchar_t* WebSettings = L"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml";
|
||||
static const wchar_t* Settings = L"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";
|
||||
|
||||
static const TCHAR* Comments = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml");
|
||||
static const wchar_t* Comments = L"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml";
|
||||
|
||||
static const TCHAR* Footnotes = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml");
|
||||
static const TCHAR* Endnotes = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml");
|
||||
static const wchar_t* Footnotes = L"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml";
|
||||
static const wchar_t* Endnotes = L"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml";
|
||||
|
||||
static const TCHAR* Header = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml");
|
||||
static const TCHAR* Footer = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml");
|
||||
static const wchar_t* Header = L"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml";
|
||||
static const wchar_t* Footer = L"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml";
|
||||
|
||||
static const TCHAR* Glossary = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml");
|
||||
static const wchar_t* Glossary = L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml";
|
||||
}
|
||||
|
||||
namespace MicrosoftWordContentTypes
|
||||
{
|
||||
static const TCHAR* KeyMapCustomization = _T("application/vnd.ms-word.keyMapCustomizations+xml");
|
||||
static const TCHAR* VbaProject = _T("application/vnd.ms-office.vbaProject");
|
||||
static const TCHAR* VbaData = _T("application/vnd.ms-word.vbaData+xml");
|
||||
static const TCHAR* Toolbars = _T("application/vnd.ms-word.attachedToolbars");
|
||||
static const wchar_t* KeyMapCustomization = L"application/vnd.ms-word.keyMapCustomizations+xml";
|
||||
static const wchar_t* VbaProject = L"application/vnd.ms-office.vbaProject";
|
||||
static const wchar_t* VbaData = L"application/vnd.ms-word.vbaData+xml";
|
||||
static const wchar_t* Toolbars = L"application/vnd.ms-word.attachedToolbars";
|
||||
}
|
||||
|
||||
namespace OpenXmlNamespaces
|
||||
{
|
||||
// package namespaces
|
||||
static const TCHAR* ContentTypes = _T("http://schemas.openxmlformats.org/package/2006/content-types");
|
||||
static const TCHAR* RelationshipsPackage = _T("http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
static const TCHAR* Relationships = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
static const wchar_t* ContentTypes = L"http://schemas.openxmlformats.org/package/2006/content-types";
|
||||
static const wchar_t* RelationshipsPackage = L"http://schemas.openxmlformats.org/package/2006/relationships";
|
||||
static const wchar_t* Relationships = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
||||
|
||||
// Drawing ML namespaces
|
||||
static const TCHAR* DrawingML = _T("http://schemas.openxmlformats.org/drawingml/2006/main");
|
||||
static const TCHAR* DrawingMLPicture = _T("http://schemas.openxmlformats.org/drawingml/2006/picture");
|
||||
static const wchar_t* DrawingML = L"http://schemas.openxmlformats.org/drawingml/2006/main";
|
||||
static const wchar_t* DrawingMLPicture = L"http://schemas.openxmlformats.org/drawingml/2006/picture";
|
||||
|
||||
// WordprocessingML namespaces
|
||||
static const TCHAR* WordprocessingML = _T("http://schemas.openxmlformats.org/wordprocessingml/2006/main");
|
||||
static const TCHAR* WordprocessingDrawingML = _T("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
|
||||
static const TCHAR* VectorML = _T("urn:schemas-microsoft-com:vml");
|
||||
static const TCHAR* MicrosoftWordML = _T("http://schemas.microsoft.com/office/word/2006/wordml");
|
||||
static const wchar_t* WordprocessingML = L"http://schemas.openxmlformats.org/wordprocessingml/2006/main";
|
||||
static const wchar_t* WordprocessingDrawingML = L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing";
|
||||
static const wchar_t* VectorML = L"urn:schemas-microsoft-com:vml";
|
||||
static const wchar_t* MicrosoftWordML = L"http://schemas.microsoft.com/office/word/2006/wordml";
|
||||
|
||||
// PresentationML namespaces
|
||||
static const TCHAR* PresentationML = _T("http://schemas.openxmlformats.org/presentationml/2006/main");
|
||||
static const wchar_t* PresentationML = L"http://schemas.openxmlformats.org/presentationml/2006/main";
|
||||
|
||||
// SpreadsheetML Namespaces
|
||||
static const TCHAR* SharedStringML = _T("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
static const TCHAR* WorkBookML = _T("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
static const TCHAR* StylesML = _T("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
static const wchar_t* SharedStringML = L"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
|
||||
static const wchar_t* WorkBookML = L"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
|
||||
static const wchar_t* StylesML = L"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
|
||||
|
||||
//Office
|
||||
static const TCHAR* Office = _T("urn:schemas-microsoft-com:office:office");
|
||||
static const TCHAR* OfficeWord = _T("urn:schemas-microsoft-com:office:word");
|
||||
static const wchar_t* Office = L"urn:schemas-microsoft-com:office:office";
|
||||
static const wchar_t* OfficeWord = L"urn:schemas-microsoft-com:office:word";
|
||||
}
|
||||
|
||||
namespace OpenXmlRelationshipTypes
|
||||
{
|
||||
static const TCHAR* CoreProperties = _T("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties");
|
||||
static const TCHAR* ExtendedProperties = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties");
|
||||
static const wchar_t* CoreProperties = L"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";
|
||||
static const wchar_t* ExtendedProperties = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";
|
||||
|
||||
static const TCHAR* Theme = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme");
|
||||
static const TCHAR* OfficeDocument = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument");
|
||||
static const TCHAR* Styles = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles");
|
||||
static const TCHAR* FontTable = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable");
|
||||
static const TCHAR* Numbering = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering");
|
||||
static const TCHAR* WebSettings = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings");
|
||||
static const TCHAR* Settings = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings");
|
||||
static const TCHAR* CustomXml = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml");
|
||||
static const TCHAR* CustomXmlProperties = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps");
|
||||
static const TCHAR* Comments = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments");
|
||||
static const TCHAR* Footnotes = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes");
|
||||
static const TCHAR* Endnotes = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes");
|
||||
static const TCHAR* Header = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/header");
|
||||
static const TCHAR* Footer = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer");
|
||||
static const TCHAR* Image = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image");
|
||||
static const TCHAR* OleObject = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject");
|
||||
static const TCHAR* GlossaryDocument = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument");
|
||||
static const TCHAR* Package = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
|
||||
static const wchar_t* Theme = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
|
||||
static const wchar_t* OfficeDocument = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
|
||||
static const wchar_t* Styles = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";
|
||||
static const wchar_t* FontTable = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";
|
||||
static const wchar_t* Numbering = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering";
|
||||
static const wchar_t* WebSettings = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings";
|
||||
static const wchar_t* Settings = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings";
|
||||
static const wchar_t* CustomXml = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml";
|
||||
static const wchar_t* CustomXmlProperties = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps";
|
||||
static const wchar_t* Comments = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
|
||||
static const wchar_t* Footnotes = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes";
|
||||
static const wchar_t* Endnotes = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes";
|
||||
static const wchar_t* Header = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";
|
||||
static const wchar_t* Footer = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";
|
||||
static const wchar_t* Image = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
|
||||
static const wchar_t* OleObject = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
|
||||
static const wchar_t* GlossaryDocument = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument";
|
||||
static const wchar_t* Package = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
|
||||
}
|
||||
|
||||
namespace MicrosoftWordRelationshipTypes
|
||||
{
|
||||
static const TCHAR* KeyMapCustomizations = _T("http://schemas.microsoft.com/office/2006/relationships/keyMapCustomizations");
|
||||
static const TCHAR* VbaProject = _T("http://schemas.microsoft.com/office/2006/relationships/vbaProject");
|
||||
static const TCHAR* VbaData = _T("http://schemas.microsoft.com/office/2006/relationships/wordVbaData");
|
||||
static const TCHAR* Toolbars = _T("http://schemas.microsoft.com/office/2006/relationships/attachedToolbars");
|
||||
static const wchar_t* KeyMapCustomizations = L"http://schemas.microsoft.com/office/2006/relationships/keyMapCustomizations";
|
||||
static const wchar_t* VbaProject = L"http://schemas.microsoft.com/office/2006/relationships/vbaProject";
|
||||
static const wchar_t* VbaData = L"http://schemas.microsoft.com/office/2006/relationships/wordVbaData";
|
||||
static const wchar_t* Toolbars = L"http://schemas.microsoft.com/office/2006/relationships/attachedToolbars";
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -212,7 +212,7 @@ namespace DocFileFormat
|
||||
|
||||
// start paragraph
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:p"), true);
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:p", true);
|
||||
writeParagraphRsid(papx);
|
||||
|
||||
// ----------- check for section properties
|
||||
@ -320,12 +320,12 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//end paragraph
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:p"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:p");
|
||||
}
|
||||
else
|
||||
{
|
||||
//end paragraph
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:p"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:p");
|
||||
}
|
||||
|
||||
RELEASEOBJECT(chpxFcs);
|
||||
@ -344,16 +344,16 @@ namespace DocFileFormat
|
||||
|
||||
if (DocFileFormat::sprmPRsid == iter->OpCode)
|
||||
{
|
||||
std::wstring id = FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize), _T("%08x"));
|
||||
std::wstring id = FormatUtils::IntToFormattedWideString(FormatUtils::BytesToInt32(iter->Arguments, 0, iter->argumentsSize), L"%08x");
|
||||
m_context->AddRsid(id);
|
||||
m_pXmlWriter->WriteAttribute(_T("w:rsidP"), id.c_str());
|
||||
m_pXmlWriter->WriteAttribute(L"w:rsidP", id);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T(""), true, false);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true, false);
|
||||
}
|
||||
|
||||
// Writes a run with the given characters and CHPX
|
||||
@ -370,47 +370,47 @@ namespace DocFileFormat
|
||||
if (Deleted == rev.Type)
|
||||
{
|
||||
//If it's a deleted run
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:del"), true);
|
||||
m_pXmlWriter->WriteAttribute(_T("w:author"), _T("[b2x: could not retrieve author]"));
|
||||
m_pXmlWriter->WriteAttribute(_T("w:date"), _T("[b2x: could not retrieve date]"));
|
||||
m_pXmlWriter->WriteNodeEnd(_T(""), true, false);
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:del", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:author", L"[b2x: could not retrieve author]");
|
||||
m_pXmlWriter->WriteAttribute(L"w:date", L"[b2x: could not retrieve date]");
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true, false);
|
||||
}
|
||||
else if ( rev.Type == Inserted )
|
||||
{
|
||||
WideString* author = dynamic_cast<WideString*>(m_document->RevisionAuthorTable->operator[](rev.Isbt));
|
||||
//if it's a inserted run
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:ins"), true);
|
||||
m_pXmlWriter->WriteAttribute(_T("w:author"), FormatUtils::XmlEncode(*author).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd(_T(""), true, false);
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:ins", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:author", FormatUtils::XmlEncode(*author));
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true, false);
|
||||
//rev.Dttm.Convert(new DateMapping(m_pXmlWriter));
|
||||
}
|
||||
|
||||
//start run
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:r"), true);
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:r", true);
|
||||
|
||||
//append rsids
|
||||
if (0 != rev.Rsid)
|
||||
{
|
||||
std::wstring rsid = FormatUtils::IntToFormattedWideString(rev.Rsid, _T("%08x"));
|
||||
m_pXmlWriter->WriteAttribute(_T("w:rsidR"), rsid.c_str());
|
||||
std::wstring rsid = FormatUtils::IntToFormattedWideString(rev.Rsid, L"%08x");
|
||||
m_pXmlWriter->WriteAttribute(L"w:rsidR", rsid);
|
||||
m_context->AddRsid(rsid);
|
||||
}
|
||||
|
||||
if (0 != rev.RsidDel)
|
||||
{
|
||||
std::wstring rsidDel = FormatUtils::IntToFormattedWideString(rev.RsidDel, _T("%08x"));
|
||||
m_pXmlWriter->WriteAttribute(_T("w:rsidDel"), rsidDel.c_str());
|
||||
std::wstring rsidDel = FormatUtils::IntToFormattedWideString(rev.RsidDel, L"%08x");
|
||||
m_pXmlWriter->WriteAttribute(L"w:rsidDel", rsidDel);
|
||||
m_context->AddRsid(rsidDel);
|
||||
}
|
||||
|
||||
if (0 != rev.RsidProp)
|
||||
{
|
||||
std::wstring rsidProp = FormatUtils::IntToFormattedWideString(rev.RsidProp, _T("%08x"));
|
||||
m_pXmlWriter->WriteAttribute(_T("w:rsidRPr"), rsidProp.c_str());
|
||||
std::wstring rsidProp = FormatUtils::IntToFormattedWideString(rev.RsidProp, L"%08x");
|
||||
m_pXmlWriter->WriteAttribute(L"w:rsidRPr", rsidProp);
|
||||
m_context->AddRsid(rsidProp);
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T(""), true, false);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true, false);
|
||||
|
||||
/// <w:rPr>
|
||||
CharacterPropertiesMapping* rPr = new CharacterPropertiesMapping(m_pXmlWriter, m_document, &rev, _lastValidPapx, false);
|
||||
@ -434,20 +434,20 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//end run
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:r"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:r");
|
||||
|
||||
if (Deleted == rev.Type)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:del"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:del");
|
||||
}
|
||||
else if (Inserted == rev.Type)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:ins"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:ins");
|
||||
}
|
||||
|
||||
if (!_writeAfterRun.empty())
|
||||
{
|
||||
m_pXmlWriter->WriteString(_writeAfterRun.c_str());
|
||||
m_pXmlWriter->WriteString(_writeAfterRun);
|
||||
_writeAfterRun.clear();
|
||||
}
|
||||
}
|
||||
@ -468,16 +468,16 @@ namespace DocFileFormat
|
||||
|
||||
//detect text type
|
||||
|
||||
std::wstring textType = _T( "t" );
|
||||
std::wstring textType = L"t";
|
||||
std::wstring text;
|
||||
|
||||
if (writeDeletedText)
|
||||
{
|
||||
textType = std::wstring(_T("delText"));
|
||||
textType = std::wstring(L"delText");
|
||||
}
|
||||
else if (_writeInstrText)
|
||||
{
|
||||
textType = std::wstring(_T("instrText"));
|
||||
textType = std::wstring(L"instrText");
|
||||
}
|
||||
|
||||
//write text
|
||||
@ -491,9 +491,9 @@ namespace DocFileFormat
|
||||
|
||||
text.clear();
|
||||
|
||||
XMLTools::XMLElement elem(_T("w:tab"));
|
||||
XMLTools::XMLElement elem(L"w:tab");
|
||||
|
||||
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
|
||||
m_pXmlWriter->WriteString(elem.GetXMLString());
|
||||
}
|
||||
else if (TextMark::HardLineBreak == code)
|
||||
{
|
||||
@ -501,11 +501,11 @@ namespace DocFileFormat
|
||||
|
||||
text.clear();
|
||||
|
||||
XMLTools::XMLElement elem(_T("w:br"));
|
||||
elem.AppendAttribute(_T("w:type"), _T("textWrapping"));
|
||||
elem.AppendAttribute(_T("w:clear"), _T("all"));
|
||||
XMLTools::XMLElement elem(L"w:br");
|
||||
elem.AppendAttribute(L"w:type", L"textWrapping");
|
||||
elem.AppendAttribute(L"w:clear", L"all");
|
||||
|
||||
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
|
||||
m_pXmlWriter->WriteString(elem.GetXMLString());
|
||||
}
|
||||
else if (TextMark::ParagraphEnd == code)
|
||||
{
|
||||
@ -520,10 +520,10 @@ namespace DocFileFormat
|
||||
|
||||
text.clear();
|
||||
|
||||
XMLTools::XMLElement elem(_T("w:br"));
|
||||
elem.AppendAttribute(_T("w:type"), _T("page"));
|
||||
XMLTools::XMLElement elem(L"w:br");
|
||||
elem.AppendAttribute(L"w:type", L"page");
|
||||
|
||||
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
|
||||
m_pXmlWriter->WriteString(elem.GetXMLString());
|
||||
}
|
||||
}
|
||||
else if (TextMark::ColumnBreak == code)
|
||||
@ -532,10 +532,10 @@ namespace DocFileFormat
|
||||
|
||||
text.clear();
|
||||
|
||||
XMLTools::XMLElement elem(_T("w:br"));
|
||||
elem.AppendAttribute(_T("w:type"), _T("column"));
|
||||
XMLTools::XMLElement elem(L"w:br");
|
||||
elem.AppendAttribute(L"w:type", L"column");
|
||||
|
||||
m_pXmlWriter->WriteString(elem.GetXMLString().c_str());
|
||||
m_pXmlWriter->WriteString(elem.GetXMLString());
|
||||
}
|
||||
else if (TextMark::FieldBeginMark == code)
|
||||
{
|
||||
@ -546,21 +546,21 @@ namespace DocFileFormat
|
||||
if (cpFieldEnd < m_document->Text->size())
|
||||
f = std::wstring( ( m_document->Text->begin() + cpFieldStart ), ( m_document->Text->begin() + cpFieldEnd + 1 ) );
|
||||
|
||||
std::wstring EMBED ( _T( " EMBED" ) );
|
||||
std::wstring LINK ( _T( " LINK" ) );
|
||||
std::wstring FORM ( _T( " FORM" ) );
|
||||
std::wstring Excel ( _T( " Excel" ) );
|
||||
std::wstring Word ( _T( " Word" ) );
|
||||
std::wstring opendocument(_T( " opendocument" ) );
|
||||
std::wstring Equation ( _T( " Equation" ) ) ;
|
||||
std::wstring MERGEFORMAT( _T( " MERGEFORMAT" ) );
|
||||
std::wstring QUOTE ( _T( " QUOTE" ) );
|
||||
std::wstring chart ( _T( "Chart" ) );
|
||||
std::wstring PBrush ( _T( " PBrush" ) );
|
||||
std::wstring TOC ( _T( " TOC" ) );
|
||||
std::wstring HYPERLINK ( _T( " HYPERLINK" ) );
|
||||
std::wstring PAGEREF ( _T( " PAGEREF" ) );
|
||||
std::wstring PAGE ( _T( "PAGE" ) );
|
||||
std::wstring EMBED ( L" EMBED" );
|
||||
std::wstring LINK ( L" LINK" );
|
||||
std::wstring FORM ( L" FORM" );
|
||||
std::wstring Excel ( L" Excel" );
|
||||
std::wstring Word ( L" Word" );
|
||||
std::wstring opendocument(L" opendocument" );
|
||||
std::wstring Equation ( L" Equation" );
|
||||
std::wstring MERGEFORMAT( L" MERGEFORMAT" );
|
||||
std::wstring QUOTE ( L" QUOTE" );
|
||||
std::wstring chart ( L"Chart" );
|
||||
std::wstring PBrush ( L" PBrush" );
|
||||
std::wstring TOC ( L" TOC" );
|
||||
std::wstring HYPERLINK ( L" HYPERLINK" );
|
||||
std::wstring PAGEREF ( L" PAGEREF" );
|
||||
std::wstring PAGE ( L"PAGE" );
|
||||
|
||||
bool bChart = search( f.begin(), f.end(), chart.begin(), chart.end()) != f.end();
|
||||
bool bEMBED = search( f.begin(), f.end(), EMBED.begin(), EMBED.end()) != f.end();
|
||||
@ -578,9 +578,9 @@ namespace DocFileFormat
|
||||
|
||||
if ( bFORM )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), true );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), true, false );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar" , true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType" , L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true, false );
|
||||
|
||||
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
|
||||
|
||||
@ -593,7 +593,7 @@ namespace DocFileFormat
|
||||
ffdata.Convert(new FormFieldDataMapping(m_pXmlWriter));
|
||||
}*/
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:fldChar" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:fldChar" );
|
||||
|
||||
_writeInstrText = true;
|
||||
|
||||
@ -603,13 +603,13 @@ namespace DocFileFormat
|
||||
&&
|
||||
( ( bEMBED || bLINK ) && bChart) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), true );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), true, false );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType", L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true, false );
|
||||
|
||||
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:fldChar" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:fldChar" );
|
||||
|
||||
_writeInstrText = true;
|
||||
|
||||
@ -622,9 +622,9 @@ namespace DocFileFormat
|
||||
|
||||
if ((search( f.begin(), f.end(), TOC.begin(), TOC.end()) != f.end()) || bPAGE)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), true );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType", L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
|
||||
_writeInstrText = true;
|
||||
_fldCharCounter++;
|
||||
@ -643,18 +643,18 @@ namespace DocFileFormat
|
||||
|
||||
_writeWebHidden = true;
|
||||
std::wstring _writeTocLink =f1.substr(d + 9);
|
||||
d = _writeTocLink.find(_T(" "));
|
||||
d = _writeTocLink.find(L" ");
|
||||
_writeTocLink = _writeTocLink.substr(0, d);
|
||||
|
||||
_writeAfterRun = std::wstring (_T("<w:hyperlink w:anchor = \""));
|
||||
_writeAfterRun = std::wstring (L"<w:hyperlink w:anchor = \"");
|
||||
_writeAfterRun += _writeTocLink;
|
||||
_writeAfterRun += std::wstring (_T("\" w:history=\"1\">"));
|
||||
_writeAfterRun += std::wstring (L"\" w:history=\"1\">");
|
||||
|
||||
//if (_writeInstrText == true)
|
||||
//{
|
||||
// m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), true );
|
||||
// m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "separate" ) );
|
||||
// m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
|
||||
// m_pXmlWriter->WriteNodeBegin( L"w:fldChar" ), true );
|
||||
// m_pXmlWriter->WriteAttribute( L"w:fldCharType" ), L"separate" );
|
||||
// m_pXmlWriter->WriteNodeEnd( L"" ), true );
|
||||
//}
|
||||
_writeInstrText = false;
|
||||
|
||||
@ -697,10 +697,10 @@ namespace DocFileFormat
|
||||
{
|
||||
OleObject ole ( chpxObj, m_document->GetStorage(), m_document->bOlderVersion);
|
||||
|
||||
oleWriter.WriteNodeBegin (_T( "w:object" ), true);
|
||||
oleWriter.WriteAttribute( _T( "w:dxaOrig" ), FormatUtils::IntToWideString( ( ole.pictureDesciptor.dxaGoal + ole.pictureDesciptor.dxaOrigin ) ).c_str() );
|
||||
oleWriter.WriteAttribute( _T( "w:dyaOrig" ), FormatUtils::IntToWideString( ( ole.pictureDesciptor.dyaGoal + ole.pictureDesciptor.dyaOrigin ) ).c_str() );
|
||||
oleWriter.WriteNodeEnd( _T( "" ), true, false );
|
||||
oleWriter.WriteNodeBegin (L"w:object", true);
|
||||
oleWriter.WriteAttribute( L"w:dxaOrig", FormatUtils::IntToWideString( ( ole.pictureDesciptor.dxaGoal + ole.pictureDesciptor.dxaOrigin ) ));
|
||||
oleWriter.WriteAttribute( L"w:dyaOrig", FormatUtils::IntToWideString( ( ole.pictureDesciptor.dyaGoal + ole.pictureDesciptor.dyaOrigin ) ));
|
||||
oleWriter.WriteNodeEnd( L"", true, false );
|
||||
|
||||
ole.pictureDesciptor.Convert(&oVmlMapper);
|
||||
OleObjectMapping oleObjectMapping( &oleObjectWriter, m_context, &ole.pictureDesciptor, _caller, oVmlMapper.m_shapeId);
|
||||
@ -713,10 +713,10 @@ namespace DocFileFormat
|
||||
{
|
||||
PictureDescriptor pic(chpxObj, m_document->DataStream, 0x7fffffff, m_document->bOlderVersion);
|
||||
|
||||
oleWriter.WriteNodeBegin (_T( "w:object" ), true);
|
||||
oleWriter.WriteAttribute( _T( "w:dxaOrig" ), FormatUtils::IntToWideString( ( pic.dxaGoal + pic.dxaOrigin ) ).c_str() );
|
||||
oleWriter.WriteAttribute( _T( "w:dyaOrig" ), FormatUtils::IntToWideString( ( pic.dyaGoal + pic.dyaOrigin ) ).c_str() );
|
||||
oleWriter.WriteNodeEnd( _T( "" ), true, false );
|
||||
oleWriter.WriteNodeBegin (L"w:object", true);
|
||||
oleWriter.WriteAttribute( L"w:dxaOrig", FormatUtils::IntToWideString( ( pic.dxaGoal + pic.dxaOrigin ) ) );
|
||||
oleWriter.WriteAttribute( L"w:dyaOrig", FormatUtils::IntToWideString( ( pic.dyaGoal + pic.dyaOrigin ) ) );
|
||||
oleWriter.WriteNodeEnd( L"", true, false );
|
||||
|
||||
pic.Convert(&oVmlMapper);
|
||||
RELEASEOBJECT(chpxs);
|
||||
@ -746,12 +746,12 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
oleWriter.WriteString( _lastOLEObject );
|
||||
oleWriter.WriteNodeEnd( _T( "w:object" ) );
|
||||
oleWriter.WriteNodeEnd( L"w:object" );
|
||||
|
||||
if (!oVmlMapper.m_isEmbedded && oVmlMapper.m_isEquation)
|
||||
{
|
||||
//нельзя в Run писать oMath
|
||||
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml.c_str());
|
||||
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml);
|
||||
_writeAfterRun = oVmlMapper.m_equationXml;
|
||||
}
|
||||
else
|
||||
@ -765,9 +765,9 @@ namespace DocFileFormat
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:fldChar" ), true );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:fldCharType" ), _T( "begin" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType", L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
|
||||
_writeInstrText = true;
|
||||
_fldCharCounter++;
|
||||
@ -777,10 +777,10 @@ namespace DocFileFormat
|
||||
{
|
||||
if (_fldCharCounter > 0)
|
||||
{
|
||||
XMLTools::XMLElement elem( _T( "w:fldChar" ) );
|
||||
elem.AppendAttribute( _T( "w:fldCharType" ), _T( "separate" ) );
|
||||
XMLTools::XMLElement elem( L"w:fldChar" );
|
||||
elem.AppendAttribute( L"w:fldCharType", L"separate" );
|
||||
|
||||
m_pXmlWriter->WriteString( elem.GetXMLString().c_str() );
|
||||
m_pXmlWriter->WriteString( elem.GetXMLString() );
|
||||
}
|
||||
if (_embeddedObject) _skipRuns += 2;
|
||||
}
|
||||
@ -788,16 +788,16 @@ namespace DocFileFormat
|
||||
{
|
||||
if (_fldCharCounter > 0)
|
||||
{
|
||||
XMLTools::XMLElement elem( _T( "w:fldChar" ) );
|
||||
elem.AppendAttribute( _T( "w:fldCharType" ), _T( "end" ) );
|
||||
XMLTools::XMLElement elem( L"w:fldChar" );
|
||||
elem.AppendAttribute( L"w:fldCharType", L"end" );
|
||||
|
||||
m_pXmlWriter->WriteString( elem.GetXMLString().c_str() );
|
||||
m_pXmlWriter->WriteString( elem.GetXMLString());
|
||||
|
||||
_fldCharCounter--;
|
||||
}
|
||||
if (_writeWebHidden)
|
||||
{
|
||||
_writeAfterRun = std::wstring (_T("</w:hyperlink>"));
|
||||
_writeAfterRun = std::wstring (L"</w:hyperlink>");
|
||||
}
|
||||
_writeWebHidden = false;
|
||||
|
||||
@ -811,10 +811,10 @@ namespace DocFileFormat
|
||||
{
|
||||
Symbol s = getSymbol( chpx );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:sym"), true);
|
||||
m_pXmlWriter->WriteAttribute(_T("w:font"), FormatUtils::XmlEncode(s.FontName).c_str());
|
||||
m_pXmlWriter->WriteAttribute(_T("w:char"), FormatUtils::XmlEncode(s.HexValue).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd(_T(""), true);
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:sym", true);
|
||||
m_pXmlWriter->WriteAttribute(L"w:font", FormatUtils::XmlEncode(s.FontName));
|
||||
m_pXmlWriter->WriteAttribute(L"w:char", FormatUtils::XmlEncode(s.HexValue));
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
else if ((TextMark::DrawnObject == code) && fSpec)
|
||||
{
|
||||
@ -846,10 +846,10 @@ namespace DocFileFormat
|
||||
|
||||
if (!pSpa->primitives.empty())
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin (_T("w:pict"));
|
||||
m_pXmlWriter->WriteNodeBegin (L"w:pict");
|
||||
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, &pictDiscr, _caller);
|
||||
pSpa->primitives.Convert(&oVmlWriter);
|
||||
m_pXmlWriter->WriteNodeEnd (_T("w:pict"));
|
||||
m_pXmlWriter->WriteNodeEnd (L"w:pict");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -861,19 +861,19 @@ namespace DocFileFormat
|
||||
|
||||
if (oPicture.embeddedData && oPicture.embeddedDataSize > 0)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin (_T("w:pict"));
|
||||
m_pXmlWriter->WriteNodeBegin (L"w:pict");
|
||||
|
||||
VMLPictureMapping oVmlMapper(m_context, m_pXmlWriter, false, _caller, isInline);
|
||||
oPicture.Convert (&oVmlMapper);
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd (_T("w:pict"));
|
||||
m_pXmlWriter->WriteNodeEnd (L"w:pict");
|
||||
}
|
||||
else if ((oPicture.mfp.mm > 98) && (NULL != oPicture.shapeContainer))
|
||||
{
|
||||
bool bFormula = false;
|
||||
|
||||
XMLTools::CStringXmlWriter pictWriter;
|
||||
pictWriter.WriteNodeBegin (_T("w:pict"));
|
||||
pictWriter.WriteNodeBegin (L"w:pict");
|
||||
|
||||
bool picture = true;
|
||||
|
||||
@ -903,7 +903,7 @@ namespace DocFileFormat
|
||||
else if (oVmlMapper.m_isEquation)
|
||||
{
|
||||
//нельзя в Run писать oMath
|
||||
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml.c_str());
|
||||
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml);
|
||||
_writeAfterRun = oVmlMapper.m_equationXml;
|
||||
bFormula = true;
|
||||
}
|
||||
@ -913,7 +913,7 @@ namespace DocFileFormat
|
||||
oPicture.shapeContainer->Convert(&oVmlMapper);
|
||||
}
|
||||
|
||||
pictWriter.WriteNodeEnd (_T("w:pict"));
|
||||
pictWriter.WriteNodeEnd (L"w:pict");
|
||||
|
||||
if (!bFormula)
|
||||
m_pXmlWriter->WriteString(pictWriter.GetXmlString());
|
||||
@ -924,40 +924,40 @@ namespace DocFileFormat
|
||||
{
|
||||
if ((m_document->FootnoteReferenceCharactersPlex != NULL) && (m_document->FootnoteReferenceCharactersPlex->IsCpExists(cp)))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:footnoteReference" ), true );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString(_footnoteNr++ ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:footnoteReference", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString(_footnoteNr++ ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
else if ((m_document->IndividualFootnotesPlex != NULL) && (m_document->IndividualFootnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpText)))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:footnoteRef" ), true );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:footnoteRef", true );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
else if ((m_document->EndnoteReferenceCharactersPlex != NULL) && (m_document->EndnoteReferenceCharactersPlex->IsCpExists(cp)))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:endnoteReference" ), true );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString(_endnoteNr++ ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:endnoteReference", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString(_endnoteNr++ ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
else if ((m_document->IndividualEndnotesPlex != NULL) &&
|
||||
(m_document->IndividualEndnotesPlex->IsCpExists(cp - m_document->FIB->m_RgLw97.ccpAtn - m_document->FIB->m_RgLw97.ccpHdr - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpText)))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:endnoteRef" ), true );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:endnoteRef", true );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
}
|
||||
else if (TextMark::AnnotationReference == code)
|
||||
{
|
||||
if (typeid(*this) != typeid(CommentsMapping))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:commentReference" ), true );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( _commentNr ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:commentReference", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( _commentNr ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:annotationRef" ), true );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), true );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:annotationRef", true );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
}
|
||||
|
||||
_commentNr++;
|
||||
@ -972,11 +972,11 @@ namespace DocFileFormat
|
||||
|
||||
if (!text.empty())
|
||||
{
|
||||
//bool preserve_space = (text.find(_T("\x20")) != text.npos) ? true : false;
|
||||
//bool preserve_space = (text.find(L"\x20")) != text.npos) ? true : false;
|
||||
|
||||
writeTextStart(textType, true/*preserve_space*/);
|
||||
|
||||
m_pXmlWriter->WriteString(text.c_str());
|
||||
m_pXmlWriter->WriteString(text);
|
||||
|
||||
writeTextEnd(textType);
|
||||
}
|
||||
@ -987,13 +987,13 @@ namespace DocFileFormat
|
||||
{
|
||||
if ( !text.empty() )
|
||||
{
|
||||
bool preserve_space = true;//(text.find(_T("\x20")) != text.npos) ? true : false;
|
||||
if (textType == _T("instrText"))
|
||||
bool preserve_space = true;//(text.find(L"\x20")) != text.npos) ? true : false;
|
||||
if (textType == L"instrText")
|
||||
preserve_space = false;
|
||||
|
||||
writeTextStart( textType, preserve_space );
|
||||
|
||||
m_pXmlWriter->WriteString( text.c_str() );
|
||||
m_pXmlWriter->WriteString( text);
|
||||
|
||||
writeTextEnd( textType );
|
||||
}
|
||||
@ -1001,21 +1001,21 @@ namespace DocFileFormat
|
||||
|
||||
void DocumentMapping::writeTextStart(const std::wstring& textType, bool preserve_space)
|
||||
{
|
||||
std::wstring str = ( std::wstring( _T( "w:" ) ) + textType );
|
||||
std::wstring str = ( L"w:" + textType );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( str.c_str(), true );
|
||||
m_pXmlWriter->WriteNodeBegin( str, true );
|
||||
if (preserve_space)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( _T( "xml:space" ), _T( "preserve" ) );
|
||||
m_pXmlWriter->WriteAttribute( L"xml:space", L"preserve" );
|
||||
}
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), true, false );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true, false );
|
||||
}
|
||||
|
||||
void DocumentMapping::writeTextEnd(const std::wstring& textType)
|
||||
{
|
||||
std::wstring str = ( std::wstring( _T( "w:" ) ) + textType );
|
||||
std::wstring str = ( std::wstring( L"w:" ) + textType );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( str.c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( str );
|
||||
}
|
||||
|
||||
// Searches for bookmarks in the list of characters.
|
||||
@ -1141,7 +1141,7 @@ namespace DocFileFormat
|
||||
TablePropertyExceptions row1Tapx( findValidPapx( fcRowEnd ), m_document->DataStream, m_document->bOlderVersion);
|
||||
|
||||
//start table
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:tbl" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:tbl" );
|
||||
|
||||
//Convert it
|
||||
TablePropertiesMapping *tpMapping = new TablePropertiesMapping( m_pXmlWriter, m_document->Styles, grid );
|
||||
@ -1179,7 +1179,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//close w:tbl
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:tbl" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:tbl" );
|
||||
|
||||
RELEASEOBJECT( grid );
|
||||
|
||||
@ -1384,7 +1384,7 @@ namespace DocFileFormat
|
||||
TableInfo tai( papx );
|
||||
|
||||
//start w:tr
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:tr" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:tr" );
|
||||
|
||||
//convert the properties
|
||||
int fcRowEnd = findRowEndFc( cp, nestingLevel );
|
||||
@ -1434,7 +1434,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//end w:tr
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:tr" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:tr" );
|
||||
|
||||
//skip the row end mark
|
||||
cp++;
|
||||
@ -1450,7 +1450,7 @@ namespace DocFileFormat
|
||||
int cp = initialCp;
|
||||
|
||||
//start w:tc
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:tc" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:tc" );
|
||||
|
||||
//find cell end
|
||||
int cpCellEnd = findCellEndCp( initialCp, nestingLevel );
|
||||
@ -1487,8 +1487,8 @@ namespace DocFileFormat
|
||||
//after a inner table must be at least one paragraph
|
||||
/*if ( cp >= cpCellEnd )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:p" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:p" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:p" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:p" );
|
||||
}*/
|
||||
}
|
||||
else
|
||||
@ -1499,7 +1499,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//end w:tc
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:tc" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:tc" );
|
||||
|
||||
return cp;
|
||||
}
|
||||
@ -1568,14 +1568,14 @@ namespace DocFileFormat
|
||||
|
||||
WideString* bookmarkName = static_cast<WideString*>(m_document->BookmarkNames->operator [](id));
|
||||
|
||||
if ((bookmarkName != NULL) && (*bookmarkName != _T("_PictureBullets")))
|
||||
if ((bookmarkName != NULL) && (*bookmarkName != L"_PictureBullets"))
|
||||
{
|
||||
XMLTools::XMLElement bookmarkElem(_T("w:bookmarkStart"));
|
||||
XMLTools::XMLElement bookmarkElem(L"w:bookmarkStart");
|
||||
|
||||
bookmarkElem.AppendAttribute(_T("w:id"), FormatUtils::IntToWideString(id).c_str());
|
||||
bookmarkElem.AppendAttribute(_T("w:name"), bookmarkName->c_str());
|
||||
bookmarkElem.AppendAttribute(L"w:id", FormatUtils::IntToWideString(id));
|
||||
bookmarkElem.AppendAttribute(L"w:name", *bookmarkName);
|
||||
|
||||
m_pXmlWriter->WriteString(bookmarkElem.GetXMLString().c_str());
|
||||
m_pXmlWriter->WriteString(bookmarkElem.GetXMLString());
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1589,13 +1589,13 @@ namespace DocFileFormat
|
||||
|
||||
WideString* bookmarkName = static_cast<WideString*>( m_document->BookmarkNames->operator [] ( id ) );
|
||||
|
||||
if ( ( bookmarkName != NULL ) && ( *bookmarkName != _T( "_PictureBullets" ) ) )
|
||||
if ( ( bookmarkName != NULL ) && ( *bookmarkName != L"_PictureBullets" ) )
|
||||
{
|
||||
XMLTools::XMLElement bookmarkElem( _T( "w:bookmarkEnd" ) );
|
||||
XMLTools::XMLElement bookmarkElem( L"w:bookmarkEnd" );
|
||||
|
||||
bookmarkElem.AppendAttribute( _T( "w:id" ), FormatUtils::IntToWideString( id ).c_str() );
|
||||
bookmarkElem.AppendAttribute( L"w:id", FormatUtils::IntToWideString( id ));
|
||||
|
||||
m_pXmlWriter->WriteString( bookmarkElem.GetXMLString().c_str() );
|
||||
m_pXmlWriter->WriteString( bookmarkElem.GetXMLString());
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1650,7 +1650,7 @@ namespace DocFileFormat
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( m_document->FontTable->operator [] ( fontIndex ) );
|
||||
|
||||
ret.FontName = ffn->xszFtn;
|
||||
ret.HexValue = FormatUtils::IntToFormattedWideString( code, _T( "%04x" ) );
|
||||
ret.HexValue = FormatUtils::IntToFormattedWideString( code, L"%04x" );
|
||||
|
||||
break;
|
||||
}
|
||||
@ -1663,7 +1663,7 @@ namespace DocFileFormat
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( m_document->FontTable->operator [] ( fontIndex ) );
|
||||
|
||||
ret.FontName = ffn->xszFtn;
|
||||
ret.HexValue = L"f0" + FormatUtils::IntToFormattedWideString( code, _T( "%02x" ) );
|
||||
ret.HexValue = L"f0" + FormatUtils::IntToFormattedWideString( code, L"%02x" );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -50,8 +50,8 @@ namespace DocFileFormat
|
||||
|
||||
EncryptionHeader( FileInformationBlock* fib, POLE::Stream* tableStream );
|
||||
private:
|
||||
CRYPT::CryptRC4Data crypt_data_rc4;
|
||||
CRYPT::ECMADecryptor::_cryptData crypt_data_aes;
|
||||
bool bStandard;
|
||||
CRYPT::_rc4CryptData crypt_data_rc4;
|
||||
CRYPT::_ecmaCryptData crypt_data_aes;
|
||||
bool bStandard;
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -54,24 +54,24 @@ namespace DocFileFormat
|
||||
|
||||
int id = 0;
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:endnotes" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:endnotes", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
int cp = ( m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr + m_document->FIB->m_RgLw97.ccpAtn );
|
||||
|
||||
while ( cp <= ( m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn + m_document->FIB->m_RgLw97.ccpHdr + m_document->FIB->m_RgLw97.ccpAtn + m_document->FIB->m_RgLw97.ccpEdn - 2 ) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:endnote" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( id ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:endnote", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( id ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
while ( ( cp - m_document->FIB->m_RgLw97.ccpText - m_document->FIB->m_RgLw97.ccpFtn - m_document->FIB->m_RgLw97.ccpHdr - m_document->FIB->m_RgLw97.ccpAtn ) < (*m_document->IndividualEndnotesPlex)[id + 1] )
|
||||
{
|
||||
@ -95,14 +95,14 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:endnote" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:endnote");
|
||||
id++;
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:endnotes" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:endnotes");
|
||||
|
||||
m_context->_docx->EndnotesXML = std::wstring( m_pXmlWriter->GetXmlString() );
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -54,87 +54,92 @@ namespace DocFileFormat
|
||||
|
||||
this->_ctx->_docx->RegisterFontTable();
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:fonts" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fonts", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
int sz_fonts = table->Data.size();
|
||||
int sz_fonts = table->Data.size();
|
||||
int users_fonts = 0;
|
||||
|
||||
for ( std::vector<ByteStructure*>::iterator iter = table->Data.begin(); iter != table->Data.end(); iter++ )
|
||||
{
|
||||
FontFamilyName* font = dynamic_cast<FontFamilyName*>( *iter );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:font" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:name" ), FormatUtils::XmlEncode(font->xszFtn, true).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:font", TRUE );
|
||||
|
||||
std::wstring name_ = FormatUtils::XmlEncode(font->xszFtn, true);
|
||||
if (name_.empty())
|
||||
name_ = L"UserFont_" + std::to_wstring(++users_fonts);
|
||||
m_pXmlWriter->WriteAttribute( L"w:name", name_);
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
//alternative name
|
||||
if ( ( font->xszAlt != std::wstring( _T( "" ) ) ) && ( font->xszAlt.length() > 0 ) )
|
||||
if ( ( font->xszAlt != std::wstring( L"" ) ) && ( font->xszAlt.length() > 0 ) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:altName" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::XmlEncode(font->xszAlt, true).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:altName" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:altName", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(font->xszAlt, true));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:altName" );
|
||||
}
|
||||
|
||||
//charset
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:charset" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( font->chs, _T( "%02x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:charset" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:charset", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( font->chs, L"%02x" ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:charset" );
|
||||
|
||||
//font family
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:family"), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString( font->ff, &FontFamily[0][0], 6, 11 ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:family" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:family", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString( font->ff, &FontFamily[0][0], 6, 11 ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:family" );
|
||||
|
||||
//panose
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:panose1"), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:panose1", TRUE );
|
||||
|
||||
std::wstring wstr( _T( "" ) );
|
||||
std::wstring wstr( L"" );
|
||||
|
||||
for ( unsigned int i = 0; i < font->panoseSize; i++ )
|
||||
{
|
||||
wstr += FormatUtils::IntToFormattedWideString( font->panose[i], _T( "%02x" ) );
|
||||
wstr += FormatUtils::IntToFormattedWideString( font->panose[i], L"%02x" );
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), wstr.c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:panose1" ) );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", wstr);
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:panose1" );
|
||||
|
||||
//pitch
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:pitch"), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString( font->prq, &FontPitch[0][0], 3, 9 ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:pitch" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:pitch", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString( font->prq, &FontPitch[0][0], 3, 9 ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:pitch" );
|
||||
|
||||
//truetype
|
||||
if ( !font->fTrueType )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:notTrueType"), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "true" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:notTrueType" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:notTrueType", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", L"true" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:notTrueType" );
|
||||
}
|
||||
|
||||
//font signature
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:sig"), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:usb0" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield0, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:usb1" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield1, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:usb2" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield2, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:usb3" ), FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield3, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:csb0" ), FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield0, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:csb1" ), FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield1, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:sig" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:sig", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:usb0", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield0, L"%08x" ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:usb1", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield1, L"%08x" ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:usb2", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield2, L"%08x" ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:usb3", FormatUtils::IntToFormattedWideString( font->fs.UnicodeSubsetBitfield3, L"%08x" ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:csb0", FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield0, L"%08x" ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:csb1", FormatUtils::IntToFormattedWideString( font->fs.CodePageBitfield1, L"%08x" ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:sig" );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:font" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:font" );
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T("w:fonts") );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:fonts");
|
||||
|
||||
this->_ctx->_docx->FontTableXML = std::wstring( m_pXmlWriter->GetXmlString() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -42,19 +42,19 @@ namespace DocFileFormat
|
||||
{
|
||||
static const wchar_t FontFamily[6][11] =
|
||||
{
|
||||
_T( "auto" ),
|
||||
_T( "roman" ),
|
||||
_T( "swiss" ),
|
||||
_T( "modern" ),
|
||||
_T( "script" ),
|
||||
_T( "decorative" )
|
||||
L"auto",
|
||||
L"roman",
|
||||
L"swiss",
|
||||
L"modern",
|
||||
L"script",
|
||||
L"decorative"
|
||||
};
|
||||
|
||||
static const wchar_t FontPitch[3][9] =
|
||||
{
|
||||
_T( "default" ),
|
||||
_T( "fixed" ),
|
||||
_T( "variable" )
|
||||
L"default",
|
||||
L"fixed",
|
||||
L"variable"
|
||||
};
|
||||
|
||||
class FontTableMapping: public AbstractOpenXmlMapping, public IMapping
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -45,16 +45,16 @@ namespace DocFileFormat
|
||||
m_document = static_cast<WordDocument*>( visited );
|
||||
|
||||
//start the document
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:ftr" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:ftr", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
//convert the footer text
|
||||
_lastValidPapx = (*(m_document->AllPapxFkps->begin()))->grppapx[0];
|
||||
@ -77,9 +77,14 @@ namespace DocFileFormat
|
||||
{
|
||||
//this PAPX is for a table
|
||||
//cp = writeTable( cp, tai.iTap );
|
||||
int start_table_cp = cp;
|
||||
|
||||
Table table( this, cp, ( ( tai.iTap > 0 ) ? ( 1 ) : ( 0 ) ) );
|
||||
table.Convert( this );
|
||||
cp = table.GetCPEnd();
|
||||
|
||||
if (cp == start_table_cp)
|
||||
cp++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -88,8 +93,8 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:ftr" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:ftr" );
|
||||
|
||||
m_context->_docx->FooterXMLList.push_back( std::wstring( m_pXmlWriter->GetXmlString() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -54,24 +54,24 @@ namespace DocFileFormat
|
||||
|
||||
int id = 0;
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:footnotes" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:footnotes", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
int cp = m_document->FIB->m_RgLw97.ccpText;
|
||||
|
||||
while ( cp <= ( m_document->FIB->m_RgLw97.ccpText + m_document->FIB->m_RgLw97.ccpFtn - 2 ) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:footnote" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:id" ), FormatUtils::IntToWideString( id ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:footnote", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( id ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
while ( ( cp - m_document->FIB->m_RgLw97.ccpText ) < (*m_document->IndividualFootnotesPlex)[id + 1] )
|
||||
{
|
||||
@ -95,14 +95,14 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:footnote" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:footnote");
|
||||
id++;
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:footnotes" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:footnotes");
|
||||
|
||||
m_context->_docx->FootnotesXML = std::wstring(m_pXmlWriter->GetXmlString());
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -45,16 +45,16 @@ namespace DocFileFormat
|
||||
m_document = static_cast<WordDocument*>( visited );
|
||||
|
||||
//start the document
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:hdr" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:hdr", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
//convert the header text
|
||||
_lastValidPapx = (*(m_document->AllPapxFkps->begin()))->grppapx[0];
|
||||
@ -88,8 +88,8 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:hdr" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:hdr");
|
||||
|
||||
m_context->_docx->HeaderXMLList.push_back( std::wstring( m_pXmlWriter->GetXmlString() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -65,25 +65,25 @@ namespace DocFileFormat
|
||||
{
|
||||
case Default:
|
||||
{
|
||||
att = new XMLTools::XMLAttribute( L"w:val", langcode.c_str() );
|
||||
att = new XMLTools::XMLAttribute( L"w:val", langcode);
|
||||
}
|
||||
break;
|
||||
|
||||
case EastAsian:
|
||||
{
|
||||
att = new XMLTools::XMLAttribute( L"w:eastAsia", langcode.c_str() );
|
||||
att = new XMLTools::XMLAttribute( L"w:eastAsia", langcode);
|
||||
}
|
||||
break;
|
||||
|
||||
case Complex:
|
||||
{
|
||||
att = new XMLTools::XMLAttribute( L"w:bidi", langcode.c_str() );
|
||||
att = new XMLTools::XMLAttribute( L"w:bidi", langcode);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
att = new XMLTools::XMLAttribute( L"w:val", langcode.c_str() );
|
||||
att = new XMLTools::XMLAttribute( L"w:val", langcode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -91,7 +91,7 @@ namespace DocFileFormat
|
||||
if (m_pXmlWriter)
|
||||
{
|
||||
// !!!TODO!!!
|
||||
m_pXmlWriter->WriteString( att->GetXMLString().c_str() );
|
||||
m_pXmlWriter->WriteString( att->GetXMLString());
|
||||
}
|
||||
else if ( _parent != NULL )
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -63,17 +63,17 @@ namespace DocFileFormat
|
||||
m_xmldocument->RegisterNumbering();
|
||||
|
||||
//start the document
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "?xml version=\"1.0\" encoding=\"UTF-8\"?" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:numbering" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:numbering", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w" ), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:v" ), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:o" ), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:w10" ), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( _T( "xmlns:r" ), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute( L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
PictureBulletsMapping();
|
||||
|
||||
@ -82,37 +82,37 @@ namespace DocFileFormat
|
||||
for (std::list<ListData*>::iterator iter = rglst->listData.begin(); iter != rglst->listData.end(); ++iter, ++i)
|
||||
{
|
||||
//start abstractNum
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:abstractNum" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:abstractNumId" ), FormatUtils::IntToWideString( i ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:abstractNum", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:abstractNumId", FormatUtils::IntToWideString( i ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
//nsid
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:nsid" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( (*iter)->lsid, _T( "%08x" ) ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:nsid", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( (*iter)->lsid, L"%08x" ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
//multiLevelType
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:multiLevelType" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:multiLevelType", TRUE );
|
||||
|
||||
if ( (*iter)->fHybrid )
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "hybridMultilevel" ) );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", L"hybridMultilevel" );
|
||||
}
|
||||
else if ( (*iter)->fSimpleList )
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "singleLevel" ) );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", L"singleLevel" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "multilevel" ) );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", L"multilevel" );
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
//template
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:tmpl" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( (*iter)->tplc, _T( "%08x" ) ).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:tmpl", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( (*iter)->tplc, L"%08x"));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
// writes the levels
|
||||
size_t length = (*iter)->rglvl->size();
|
||||
@ -124,33 +124,33 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//end abstractNum
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:abstractNum" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:abstractNum" );
|
||||
}
|
||||
//write old style numbering (сложносоставных не сущестует)
|
||||
for (std::list<NumberingDescriptor>::iterator iter = rglst->listNumbering.begin(); iter != rglst->listNumbering.end(); ++iter, ++i)
|
||||
{
|
||||
//start abstractNum
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:abstractNum" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:abstractNumId" ), FormatUtils::IntToWideString( i ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:abstractNum", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:abstractNumId", FormatUtils::IntToWideString( i ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
////nsid
|
||||
//m_pXmlWriter->WriteNodeBegin( _T( "w:nsid" ), TRUE );
|
||||
//m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToFormattedWideString( (*iter)->lsid, _T( "%08x" ) ).c_str() );
|
||||
//m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
//m_pXmlWriter->WriteNodeBegin( L"w:nsid", TRUE );
|
||||
//m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToFormattedWideString( (*iter)->lsid, L"%08x" ) ));
|
||||
//m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
//multiLevelType
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:multiLevelType" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:multiLevelType", TRUE );
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), _T( "singleLevel" ) );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", L"singleLevel" );
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
LevelMapping(*iter, 0);
|
||||
|
||||
//end abstractNum
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:abstractNum" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:abstractNum" );
|
||||
}
|
||||
|
||||
//write the overrides
|
||||
@ -159,36 +159,36 @@ namespace DocFileFormat
|
||||
ListFormatOverride* lfo = m_document->listFormatOverrideTable->at(i);
|
||||
|
||||
//start num
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:num" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:numId" ), FormatUtils::IntToWideString(i + 1).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:num", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:numId", FormatUtils::IntToWideString(i + 1));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
int index = FindIndexbyId( rglst->listData, lfo->lsid );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:abstractNumId" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString( index ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:abstractNumId", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString( index ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
for (std::vector<ListFormatOverrideLevel*>::const_iterator iter = lfo->rgLfoLvl.begin(); iter != lfo->rgLfoLvl.end(); ++iter)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:lvlOverride" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:lvlOverride", TRUE );
|
||||
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:ilvl" ), FormatUtils::IntToWideString( (*iter)->ilvl ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:ilvl", FormatUtils::IntToWideString( (*iter)->ilvl ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
if ( ( (*iter)->fStartAt ) && ( !(*iter)->fFormatting ) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:startOverride" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString( (*iter)->iStartAt ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:startOverride", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString( (*iter)->iStartAt ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
}
|
||||
|
||||
LevelMapping((*iter)->lvl, 0, ListData::ISTD_NIL);
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:lvlOverride"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:lvlOverride");
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T( "w:num"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:num");
|
||||
}
|
||||
|
||||
if (m_document->listFormatOverrideTable->empty() && !rglst->listNumbering.empty())
|
||||
@ -196,20 +196,20 @@ namespace DocFileFormat
|
||||
i = 0;
|
||||
for (std::list<NumberingDescriptor>::iterator iter = rglst->listNumbering.begin(); iter != rglst->listNumbering.end(); ++iter, ++i)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:num" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:numId" ), FormatUtils::IntToWideString(i+1).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:num", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:numId", FormatUtils::IntToWideString(i+1));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:abstractNumId" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString( i ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:abstractNumId", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString( i ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T( "w:num"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:num");
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:numbering"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:numbering");
|
||||
|
||||
m_xmldocument->NumberingXML = std::wstring(m_pXmlWriter->GetXmlString());
|
||||
}
|
||||
@ -255,8 +255,10 @@ namespace DocFileFormat
|
||||
|
||||
if (!FormatUtils::IsControlSymbol(xchBullet))
|
||||
{
|
||||
ret.push_back(lvl->xst[0]);
|
||||
ret.push_back(L'\0');
|
||||
ret.push_back(lvl->xst[0]);//??? xchBullet
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -275,7 +277,7 @@ namespace DocFileFormat
|
||||
{
|
||||
newResult = find_if((result + 1), lvl->xst.end(), &NumberingMapping::IsPlaceholder);
|
||||
|
||||
ret += _T( "%" );
|
||||
ret += L"%";
|
||||
ret += FormatUtils::IntToWideString(*result + 1);
|
||||
ret += std::wstring((result + 1), newResult);
|
||||
result = newResult;
|
||||
@ -305,13 +307,11 @@ namespace DocFileFormat
|
||||
if (!FormatUtils::IsControlSymbol(xchBullet))
|
||||
{
|
||||
ret.push_back(lvl.xst[0]);
|
||||
ret.push_back(L'\0');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret.push_back(L'\xF0B7');
|
||||
ret.push_back(L'\0');
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -319,7 +319,7 @@ namespace DocFileFormat
|
||||
std::wstring strBefore = lvl.xst.substr(0, Before);
|
||||
std::wstring strAfter = lvl.xst.substr(Before, After);
|
||||
|
||||
ret = strBefore + _T( "%1" ) + strAfter ;
|
||||
ret = strBefore + L"%1" + strAfter ;
|
||||
}
|
||||
|
||||
return ret;
|
||||
@ -342,134 +342,134 @@ namespace DocFileFormat
|
||||
{
|
||||
if (bOlderVersion && nfc > 5)
|
||||
{
|
||||
if (nfc == 0xff) return std::wstring( _T( "bullet" ) );
|
||||
else return std::wstring( _T( "none" ) );
|
||||
if (nfc == 0xff) return std::wstring( L"bullet");
|
||||
else return std::wstring( L"none");
|
||||
}
|
||||
|
||||
switch ( nfc )
|
||||
{
|
||||
case 0:
|
||||
return std::wstring( _T( "decimal" ) );
|
||||
return std::wstring( L"decimal" );
|
||||
case 1:
|
||||
return std::wstring( _T( "upperRoman" ) );
|
||||
return std::wstring( L"upperRoman" );
|
||||
case 2:
|
||||
return std::wstring( _T( "lowerRoman" ) );
|
||||
return std::wstring( L"lowerRoman" );
|
||||
case 3:
|
||||
return std::wstring( _T( "upperLetter" ) );
|
||||
return std::wstring( L"upperLetter");
|
||||
case 4:
|
||||
return std::wstring( _T( "lowerLetter" ) );
|
||||
return std::wstring( L"lowerLetter");
|
||||
case 5:
|
||||
return std::wstring( _T( "ordinal" ) );
|
||||
return std::wstring( L"ordinal" );
|
||||
case 6:
|
||||
return std::wstring( _T( "cardinalText" ) );
|
||||
return std::wstring( L"cardinalText" );
|
||||
case 7:
|
||||
return std::wstring( _T( "ordinalText" ) );
|
||||
return std::wstring( L"ordinalText" );
|
||||
case 8:
|
||||
return std::wstring( _T( "hex" ) );
|
||||
return std::wstring( L"hex" );
|
||||
case 9:
|
||||
return std::wstring( _T( "chicago" ) );
|
||||
return std::wstring( L"chicago" );
|
||||
case 10:
|
||||
return std::wstring( _T( "ideographDigital" ) );
|
||||
return std::wstring( L"ideographDigital" );
|
||||
case 11:
|
||||
return std::wstring( _T( "japaneseCounting" ) );
|
||||
return std::wstring( L"japaneseCounting" );
|
||||
case 12:
|
||||
return std::wstring( _T( "aiueo" ) );
|
||||
return std::wstring( L"aiueo" );
|
||||
case 13:
|
||||
return std::wstring( _T( "iroha" ) );
|
||||
return std::wstring( L"iroha" );
|
||||
case 14:
|
||||
return std::wstring( _T( "decimalFullWidth" ) );
|
||||
return std::wstring( L"decimalFullWidth" );
|
||||
case 15:
|
||||
return std::wstring( _T( "decimalHalfWidth" ) );
|
||||
return std::wstring( L"decimalHalfWidth" );
|
||||
case 16:
|
||||
return std::wstring( _T( "japaneseLegal" ) );
|
||||
return std::wstring( L"japaneseLegal" );
|
||||
case 17:
|
||||
return std::wstring( _T( "japaneseDigitalTenThousand" ) );
|
||||
return std::wstring( L"japaneseDigitalTenThousand" );
|
||||
case 18:
|
||||
return std::wstring( _T( "decimalEnclosedCircle" ) );
|
||||
return std::wstring( L"decimalEnclosedCircle" );
|
||||
case 19:
|
||||
return std::wstring( _T( "decimalFullWidth2" ) );
|
||||
return std::wstring( L"decimalFullWidth2" );
|
||||
case 20:
|
||||
return std::wstring( _T( "aiueoFullWidth" ) );
|
||||
return std::wstring( L"aiueoFullWidth" );
|
||||
case 21:
|
||||
return std::wstring( _T( "irohaFullWidth" ) );
|
||||
return std::wstring( L"irohaFullWidth" );
|
||||
case 22:
|
||||
return std::wstring( _T( "decimalZero" ) );
|
||||
return std::wstring( L"decimalZero" );
|
||||
case 23:
|
||||
return std::wstring( _T( "bullet" ) );
|
||||
return std::wstring( L"bullet" );
|
||||
case 24:
|
||||
return std::wstring( _T( "ganada" ) );
|
||||
return std::wstring( L"ganada" );
|
||||
case 25:
|
||||
return std::wstring( _T( "chosung" ) );
|
||||
return std::wstring( L"chosung" );
|
||||
case 26:
|
||||
return std::wstring( _T( "decimalEnclosedFullstop" ) );
|
||||
return std::wstring( L"decimalEnclosedFullstop" );
|
||||
case 27:
|
||||
return std::wstring( _T( "decimalEnclosedParen" ) );
|
||||
return std::wstring( L"decimalEnclosedParen" );
|
||||
case 28:
|
||||
return std::wstring( _T( "decimalEnclosedCircleChinese" ) );
|
||||
return std::wstring( L"decimalEnclosedCircleChinese" );
|
||||
case 29:
|
||||
return std::wstring( _T( "ideographEnclosedCircle" ) );
|
||||
return std::wstring( L"ideographEnclosedCircle" );
|
||||
case 30:
|
||||
return std::wstring( _T( "ideographTraditional" ) );
|
||||
return std::wstring( L"ideographTraditional" );
|
||||
case 31:
|
||||
return std::wstring( _T( "ideographZodiac" ) );
|
||||
return std::wstring( L"ideographZodiac" );
|
||||
case 32:
|
||||
return std::wstring( _T( "ideographZodiacTraditional" ) );
|
||||
return std::wstring( L"ideographZodiacTraditional" );
|
||||
case 33:
|
||||
return std::wstring( _T( "taiwaneseCounting" ) );
|
||||
return std::wstring( L"taiwaneseCounting" );
|
||||
case 34:
|
||||
return std::wstring( _T( "ideographLegalTraditional" ) );
|
||||
return std::wstring( L"ideographLegalTraditional" );
|
||||
case 35:
|
||||
return std::wstring( _T( "taiwaneseCountingThousand" ) );
|
||||
return std::wstring( L"taiwaneseCountingThousand" );
|
||||
case 36:
|
||||
return std::wstring( _T( "taiwaneseDigital" ) );
|
||||
return std::wstring( L"taiwaneseDigital" );
|
||||
case 37:
|
||||
return std::wstring( _T( "chineseCounting" ) );
|
||||
return std::wstring( L"chineseCounting" );
|
||||
case 38:
|
||||
return std::wstring( _T( "chineseLegalSimplified" ) );
|
||||
return std::wstring( L"chineseLegalSimplified" );
|
||||
case 39:
|
||||
return std::wstring( _T( "chineseCountingThousand" ) );
|
||||
return std::wstring( L"chineseCountingThousand" );
|
||||
case 40:
|
||||
return std::wstring( _T( "koreanDigital" ) );
|
||||
return std::wstring( L"koreanDigital" );
|
||||
case 41:
|
||||
return std::wstring( _T( "koreanCounting" ) );
|
||||
return std::wstring( L"koreanCounting" );
|
||||
case 42:
|
||||
return std::wstring( _T( "koreanLegal" ) );
|
||||
return std::wstring( L"koreanLegal" );
|
||||
case 43:
|
||||
return std::wstring( _T( "koreanDigital2" ) );
|
||||
return std::wstring( L"koreanDigital2" );
|
||||
case 44:
|
||||
return std::wstring( _T( "vietnameseCounting" ) );
|
||||
return std::wstring( L"vietnameseCounting" );
|
||||
case 45:
|
||||
return std::wstring( _T( "russianLower" ) );
|
||||
return std::wstring( L"russianLower" );
|
||||
case 46:
|
||||
return std::wstring( _T( "russianUpper" ) );
|
||||
return std::wstring( L"russianUpper" );
|
||||
case 47:
|
||||
return std::wstring( _T( "none" ) );
|
||||
return std::wstring( L"none" );
|
||||
case 48:
|
||||
return std::wstring( _T( "numberInDash" ) );
|
||||
return std::wstring( L"numberInDash" );
|
||||
case 49:
|
||||
return std::wstring( _T( "hebrew1" ) );
|
||||
return std::wstring( L"hebrew1" );
|
||||
case 50:
|
||||
return std::wstring( _T( "hebrew2" ) );
|
||||
return std::wstring( L"hebrew2" );
|
||||
case 51:
|
||||
return std::wstring( _T( "arabicAlpha" ) );
|
||||
return std::wstring( L"arabicAlpha" );
|
||||
case 52:
|
||||
return std::wstring( _T( "arabicAbjad" ) );
|
||||
return std::wstring( L"arabicAbjad" );
|
||||
case 53:
|
||||
return std::wstring( _T( "hindiVowels" ) );
|
||||
return std::wstring( L"hindiVowels" );
|
||||
case 54:
|
||||
return std::wstring( _T( "hindiConsonants" ) );
|
||||
return std::wstring( L"hindiConsonants" );
|
||||
case 55:
|
||||
return std::wstring( _T( "hindiNumbers" ) );
|
||||
return std::wstring( L"hindiNumbers" );
|
||||
case 56:
|
||||
return std::wstring( _T( "hindiCounting" ) );
|
||||
return std::wstring( L"hindiCounting" );
|
||||
case 57:
|
||||
return std::wstring( _T( "thaiLetters" ) );
|
||||
return std::wstring( L"thaiLetters" );
|
||||
case 58:
|
||||
return std::wstring( _T( "thaiNumbers" ) );
|
||||
return std::wstring( L"thaiNumbers" );
|
||||
case 59:
|
||||
return std::wstring( _T( "thaiCounting" ) );
|
||||
return std::wstring( L"thaiCounting" );
|
||||
default:
|
||||
return std::wstring( _T( "decimal" ) );
|
||||
return std::wstring( L"decimal" );
|
||||
}
|
||||
}
|
||||
|
||||
@ -486,22 +486,22 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:lvl" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:ilvl" ), FormatUtils::IntToWideString(level).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:lvl", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:ilvl", FormatUtils::IntToWideString(level));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:start" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString(lvl.iStartAt).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:start", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString(lvl.iStartAt));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:numFmt" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), GetNumberFormatWideString(lvl.nfc, true).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:numFmt", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", GetNumberFormatWideString(lvl.nfc, true));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
//// suffix
|
||||
// m_pXmlWriter->WriteNodeBegin( _T( "w:suff" ), TRUE );
|
||||
// m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString(lvl.ixchFollow, &FollowingCharMap[0][0], 3, 8).c_str());
|
||||
// m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
// m_pXmlWriter->WriteNodeBegin( L"w:suff", TRUE );
|
||||
// m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString(lvl.ixchFollow, &FollowingCharMap[0][0], 3, 8));
|
||||
// m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
// Number level text
|
||||
std::wstring lvlText = GetLvlText(lvl, isSymbol, lvl.cbTextBefore, lvl.cbTextAfter);
|
||||
@ -515,33 +515,33 @@ namespace DocFileFormat
|
||||
//}
|
||||
if (!lvlText.empty())
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:lvlText"), TRUE);
|
||||
m_pXmlWriter->WriteAttribute(_T("w:val"), lvlText.c_str());
|
||||
m_pXmlWriter->WriteNodeEnd(_T( ""), TRUE);
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:lvlText",TRUE);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val",lvlText);
|
||||
m_pXmlWriter->WriteNodeEnd(L"", TRUE);
|
||||
}
|
||||
|
||||
// jc
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:lvlJc" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString(lvl.jc, &LevelJustificationMap[0][0], 3, 7).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:lvlJc", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString(lvl.jc, &LevelJustificationMap[0][0], 3, 7));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
// pPr
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:pPr" ), FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:pPr"));
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:pPr", FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:pPr");
|
||||
|
||||
// rPr
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:rPr" ), FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:rPr", FALSE );
|
||||
|
||||
if (!fontFamily.empty())
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:rFonts" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:rFonts", TRUE );
|
||||
// w:hint="default"
|
||||
m_pXmlWriter->WriteAttribute(_T("w:hAnsi"), fontFamily.c_str());
|
||||
m_pXmlWriter->WriteAttribute(_T("w:ascii"), fontFamily.c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute(L"w:hAnsi",fontFamily);
|
||||
m_pXmlWriter->WriteAttribute(L"w:ascii",fontFamily);
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
}
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:rPr"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:rPr");
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:lvl"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:lvl");
|
||||
}
|
||||
|
||||
void NumberingMapping::LevelMapping(const ListLevel* lvl, unsigned int level, short styleIndex)
|
||||
@ -556,27 +556,27 @@ namespace DocFileFormat
|
||||
|
||||
// Проверяем шрифт
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:lvl" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:ilvl" ), FormatUtils::IntToWideString(level).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:lvl", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:ilvl", FormatUtils::IntToWideString(level));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
// starts at
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:start" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::IntToWideString(lvl->iStartAt).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:start", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::IntToWideString(lvl->iStartAt));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
// number format
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:numFmt" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), GetNumberFormatWideString(lvl->nfc).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:numFmt", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", GetNumberFormatWideString(lvl->nfc));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
// suffix
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:suff" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString(lvl->ixchFollow, &FollowingCharMap[0][0], 3, 8).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:suff", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString(lvl->ixchFollow, &FollowingCharMap[0][0], 3, 8));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
|
||||
// style
|
||||
// The style id is used for a reverse reference.
|
||||
@ -584,30 +584,30 @@ namespace DocFileFormat
|
||||
|
||||
if (styleIndex != ListData::ISTD_NIL)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:pStyle" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::XmlEncode(StyleSheetMapping::MakeStyleId(m_document->Styles->Styles->at(styleIndex))).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:pStyle", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::XmlEncode(StyleSheetMapping::MakeStyleId(m_document->Styles->Styles->at(styleIndex))));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
}
|
||||
|
||||
// Number level text
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:lvlText"), TRUE);
|
||||
m_pXmlWriter->WriteAttribute(_T("w:val"), GetLvlText(lvl, cpMapping.CheckIsSymbolFont()).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd(_T( ""), TRUE);
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:lvlText",TRUE);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val",GetLvlText(lvl, cpMapping.CheckIsSymbolFont()));
|
||||
m_pXmlWriter->WriteNodeEnd(L"",TRUE);
|
||||
|
||||
WriteLevelPictureBullet(lvl->grpprlChpx);
|
||||
|
||||
// legacy
|
||||
if (lvl->fWord6)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:legacy" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:legacy" ), _T( "1" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:legacy", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:legacy", L"1" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
}
|
||||
// jc
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:lvlJc" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:val" ), FormatUtils::MapValueToWideString(lvl->jc, &LevelJustificationMap[0][0], 3, 7).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:lvlJc", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:val", FormatUtils::MapValueToWideString(lvl->jc, &LevelJustificationMap[0][0], 3, 7));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE );
|
||||
// pPr
|
||||
bool isBidi = false;
|
||||
ParagraphPropertiesMapping oppMapping(m_pXmlWriter, m_context, m_document, NULL, isBidi);
|
||||
@ -617,7 +617,7 @@ namespace DocFileFormat
|
||||
|
||||
m_pXmlWriter->WriteString(oWriterTemp.GetXmlString());
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:lvl"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:lvl");
|
||||
}
|
||||
|
||||
void NumberingMapping::PictureBulletsMapping()
|
||||
@ -637,10 +637,10 @@ namespace DocFileFormat
|
||||
|
||||
if ((pict.mfp.mm > 98) && (pict.shapeContainer != NULL))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:numPicBullet" ), TRUE );
|
||||
m_pXmlWriter->WriteAttribute( _T( "w:numPicBulletId" ), FormatUtils::IntToWideString( iter->first ).c_str() );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( _T( "w:pict" ) );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:numPicBullet", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:numPicBulletId", FormatUtils::IntToWideString( iter->first ));
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:pict" );
|
||||
|
||||
//inline picture + bullete props
|
||||
if (pict.blipStoreEntry != NULL)
|
||||
@ -657,8 +657,8 @@ namespace DocFileFormat
|
||||
pict.shapeContainer->Convert(&oShape);
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:pict"));
|
||||
m_pXmlWriter->WriteNodeEnd(_T("w:numPicBullet"));
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:pict");
|
||||
m_pXmlWriter->WriteNodeEnd(L"w:numPicBullet");
|
||||
}
|
||||
}
|
||||
|
||||
@ -670,7 +670,7 @@ namespace DocFileFormat
|
||||
{
|
||||
if (grpprlChpx)
|
||||
{
|
||||
unsigned int cp = 0;
|
||||
unsigned int index = 0;
|
||||
bool isPictureBullet = false;
|
||||
|
||||
for (std::list<SinglePropertyModifier>::const_iterator iter = grpprlChpx->grpprl->begin(); iter != grpprlChpx->grpprl->end(); ++iter)
|
||||
@ -679,7 +679,7 @@ namespace DocFileFormat
|
||||
{
|
||||
case sprmCPbiIBullet:
|
||||
{
|
||||
cp = FormatUtils::BytesToUInt32(iter->Arguments, 0, iter->argumentsSize);
|
||||
index = FormatUtils::BytesToUInt32(iter->Arguments, 0, iter->argumentsSize);
|
||||
}break;
|
||||
|
||||
case sprmCPbiGrf:
|
||||
@ -691,10 +691,10 @@ namespace DocFileFormat
|
||||
|
||||
if (isPictureBullet)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:lvlPicBulletId"), TRUE);
|
||||
m_pXmlWriter->WriteAttribute(_T("w:val"), FormatUtils::IntToWideString(cp).c_str());
|
||||
m_pXmlWriter->WriteNodeEnd(_T(""), TRUE);
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:lvlPicBulletId",TRUE);
|
||||
m_pXmlWriter->WriteAttribute(L"w:val",FormatUtils::IntToWideString(index));
|
||||
m_pXmlWriter->WriteNodeEnd(L"",TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -52,9 +52,9 @@ namespace DocFileFormat
|
||||
|
||||
static const wchar_t LevelJustificationMap[3][7] =
|
||||
{
|
||||
_T("left"),
|
||||
_T("center"),
|
||||
_T("right")
|
||||
L"left",
|
||||
L"center",
|
||||
L"right"
|
||||
};
|
||||
|
||||
class NumberingMapping: public AbstractOpenXmlMapping, public IMapping
|
||||
@ -89,4 +89,4 @@ namespace DocFileFormat
|
||||
WordDocument* m_document;
|
||||
WordprocessingDocument* m_xmldocument;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user