mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-11 02:16:02 +08:00
Compare commits
348 Commits
core-windo
...
core/devel
| Author | SHA1 | Date | |
|---|---|---|---|
| dc3ecb1fc0 | |||
| 266cef8c49 | |||
| a5e821cd21 | |||
| cb5d92334e | |||
| f6dbc6b9f0 | |||
| c2c6430495 | |||
| 9ecf5b7834 | |||
| 1d003863dd | |||
| 774561bd00 | |||
| d356a305b9 | |||
| 2dbec241f7 | |||
| f3c66cab50 | |||
| 11e6fc3e06 | |||
| cdf8c0a11b | |||
| ae29cebe35 | |||
| e933a1fb42 | |||
| 5a3f98c502 | |||
| 8677540a82 | |||
| f4ceac5b2b | |||
| 61be4ea100 | |||
| 51c6ce2ba2 | |||
| e13bc44198 | |||
| 56cefcb1be | |||
| 6f860c17e3 | |||
| fb9edc4f81 | |||
| 4eb0a73f3c | |||
| 7929d798c8 | |||
| 4c3d8ca059 | |||
| ad74a8ea6b | |||
| f50dda7c31 | |||
| f78a805fa3 | |||
| bc177269a9 | |||
| 84cab29276 | |||
| d7c7584b4d | |||
| 1346072ab2 | |||
| 3b6b463b1b | |||
| a75daf9d90 | |||
| dc81f97bac | |||
| d194249ffb | |||
| 4ec04c31c5 | |||
| 8774035be9 | |||
| 8cec4ce82e | |||
| 17e46a2c99 | |||
| c5ffcd4b44 | |||
| 51c77c3a85 | |||
| 4326a7d258 | |||
| 38813fd105 | |||
| 19960fa3b5 | |||
| 32121d6d3b | |||
| 2dcef22681 | |||
| ee5a56183e | |||
| b90e3a3cd1 | |||
| f074d1252b | |||
| 30f07d3aa4 | |||
| d27b7b2f56 | |||
| 1dbf3e83ad | |||
| a5f70c9740 | |||
| ab72c8973d | |||
| a204c576ad | |||
| 4a7d40d3fb | |||
| 4f5fb86f87 | |||
| f7f2629e9d | |||
| 048c2fd034 | |||
| 3299c47858 | |||
| 8977e2c792 | |||
| 089e7d3230 | |||
| bd5863a02d | |||
| e0296d5a9a | |||
| e26cf3bf39 | |||
| 8525a1e9f0 | |||
| 2e8c83a668 | |||
| e857496565 | |||
| 143f65ae5a | |||
| f89d75ae92 | |||
| 403507206d | |||
| 7f6431700c | |||
| 7977bcf069 | |||
| 32ad6b46e2 | |||
| bf6bfce051 | |||
| 805c24ff1a | |||
| 2c4bb7c808 | |||
| 15a711396f | |||
| 3d8403346b | |||
| 5700503efe | |||
| d01b1e7d41 | |||
| 584cc6ab80 | |||
| 4b727edde8 | |||
| 9d10c4ddce | |||
| d5026d014d | |||
| ac0b7e4e22 | |||
| 623fe25415 | |||
| c4c9d50aae | |||
| 5d8dda02ec | |||
| bc3461147d | |||
| 80d4e6057b | |||
| 2dc5c2916a | |||
| 5f9631a3c5 | |||
| ef7df69036 | |||
| b3961994d2 | |||
| 927a847607 | |||
| 674cc6c1a2 | |||
| 5d77cf9473 | |||
| 512dad1d24 | |||
| 3d684934f1 | |||
| dd6ac185fb | |||
| 9825b6e32e | |||
| 653008ebfc | |||
| 236e93aa9c | |||
| 164c7faf94 | |||
| 4c07ddbcc7 | |||
| 7be543c3a6 | |||
| ccb47b0bda | |||
| 8aefacd411 | |||
| 6cd5fbcaca | |||
| 7c964b3f9c | |||
| 8c43c781bd | |||
| 7496de06f0 | |||
| fdd443a2d7 | |||
| 037c4046eb | |||
| 4e5ac14ca9 | |||
| dedf74b366 | |||
| 6f2eef1137 | |||
| 9a8d3edbef | |||
| 305ebda78d | |||
| 114050c23e | |||
| 7eee0755bf | |||
| c329f29e9a | |||
| 0f3a02ca7c | |||
| 62d4860873 | |||
| 21666ee309 | |||
| 47ff766e4e | |||
| 50cbc671b3 | |||
| f2d3390bd4 | |||
| fb5af12d7a | |||
| 63655a97e9 | |||
| fdf032d9f8 | |||
| 3b85b58558 | |||
| 00f1f40a1e | |||
| 46c05a4c27 | |||
| f3a510bd58 | |||
| 45231b822c | |||
| e0591675d2 | |||
| 67a849f110 | |||
| 15800296f7 | |||
| 52fe741f9a | |||
| b3ee693890 | |||
| 8c2e1738ea | |||
| bf33aed853 | |||
| 5869c7a02e | |||
| bbd429a994 | |||
| f4d636539e | |||
| 92e02257d7 | |||
| d2046d7ccb | |||
| 7bc35a157a | |||
| 903245e8a7 | |||
| 25ee9c3c1c | |||
| 9ead40d279 | |||
| e097379c21 | |||
| f86579d601 | |||
| de7511f243 | |||
| 9a68a75f70 | |||
| e04388aa32 | |||
| cee61e7a92 | |||
| 48185ed4e9 | |||
| 7bea086784 | |||
| 774f9c42cb | |||
| 10964d32e6 | |||
| da2493ed3b | |||
| 0a183f3505 | |||
| ac6cc1ec24 | |||
| a1846da0da | |||
| 0bd10c28ac | |||
| 2367cee329 | |||
| 288d89301a | |||
| 4d519e8f26 | |||
| 1bd2c0b852 | |||
| 82b0f4bce8 | |||
| 5635239274 | |||
| 1f979fc4cc | |||
| 80c4a65147 | |||
| 4fda6101eb | |||
| 99822fb597 | |||
| f1d9c12f07 | |||
| 30ef5a9de4 | |||
| 765ca861fb | |||
| 99570b3b86 | |||
| d9c6759108 | |||
| b82a8c6b9b | |||
| d76b1897aa | |||
| 857b79ee23 | |||
| ecba12b29f | |||
| efc48ab44c | |||
| 5f0620ed90 | |||
| 150ff1fae2 | |||
| dd1b9ca9be | |||
| c6ed59a742 | |||
| 1d3315711e | |||
| 46ddcff040 | |||
| a044b262e4 | |||
| 51b0e715a1 | |||
| 1cdeefb576 | |||
| db9aeb40bb | |||
| 8a41f0c716 | |||
| 4be5a491da | |||
| 4b4d4ebc54 | |||
| b132ea266a | |||
| e20e061330 | |||
| fc97b32d18 | |||
| a63aa93092 | |||
| 91cb5e895b | |||
| 16d233da47 | |||
| 69e8a6501e | |||
| dac6ae2e48 | |||
| 9f145333f8 | |||
| c8c5b82924 | |||
| 2e99efeeb6 | |||
| c4492f2cd2 | |||
| 41da15d8cf | |||
| ea3db6936c | |||
| 0928e7d787 | |||
| 2d3040aba2 | |||
| ce590a4a61 | |||
| e899647453 | |||
| fe1553f8da | |||
| 04d197375c | |||
| d2f1022b5a | |||
| 0265162cb9 | |||
| 9be4d6ca0e | |||
| 9e9da20450 | |||
| 082fd814af | |||
| 39cd23d7c0 | |||
| 78b051c999 | |||
| 2836fee493 | |||
| 6e409d2f7e | |||
| 3e698b8579 | |||
| 95e32f00d0 | |||
| 61c632ce55 | |||
| a0b93fd1b2 | |||
| 0b096a4c46 | |||
| a97518359a | |||
| 96cea25bca | |||
| 1a57f62773 | |||
| 9d1f83b1ce | |||
| 6653e8ef82 | |||
| fd121841a9 | |||
| 00255297c8 | |||
| 74a0fd2928 | |||
| ce7487a14d | |||
| 95d9d8bc8e | |||
| dce0b43c11 | |||
| d7a981a84e | |||
| bb52ddba2b | |||
| a82814d565 | |||
| bab37e1634 | |||
| 06dea5685a | |||
| 105a23d5bc | |||
| ef76c80014 | |||
| bb6e95ce20 | |||
| 69d9823847 | |||
| fb10c56bd3 | |||
| 4f24ed375e | |||
| 036c3b3740 | |||
| dddaeb3eeb | |||
| f75b0704a7 | |||
| baefae258b | |||
| 4f46ac6e69 | |||
| f634d1cfe5 | |||
| a810253b22 | |||
| 05e42b1908 | |||
| 4ea7f5f9ed | |||
| 50a1f3f5a7 | |||
| 2710cabdc9 | |||
| 1d55b1223c | |||
| ac959e32af | |||
| 1c2524f5fb | |||
| c0e4b02138 | |||
| eb29cee9ad | |||
| 5720891452 | |||
| 96f7cd9017 | |||
| c7ef8e9b1d | |||
| 1a2f9afac7 | |||
| 2c945b7166 | |||
| e49deaaf64 | |||
| 3edb12499c | |||
| 52c3f9bdb1 | |||
| 1e53b26704 | |||
| 8ac5180992 | |||
| 8cdf491178 | |||
| c5c64cb6c2 | |||
| 86000ee48f | |||
| 652fc292af | |||
| ef69fc4b34 | |||
| 6e3b7b1146 | |||
| 2ff5bd5910 | |||
| 01528516dd | |||
| 95dcf3661f | |||
| 717d91a192 | |||
| 3dd4dda2e3 | |||
| 24dc35546f | |||
| fc2707f0b5 | |||
| ea5ebe720b | |||
| cdead54f4a | |||
| 29ae0bdc38 | |||
| 502243103b | |||
| c668288308 | |||
| 39257334e4 | |||
| 48f95bd9f2 | |||
| f925e5cae9 | |||
| 80d95d41c5 | |||
| 42fb658349 | |||
| d500cbc615 | |||
| 470d57aec2 | |||
| 635a5d232a | |||
| 6fa18eb20d | |||
| 435bb02de3 | |||
| a84425b49f | |||
| 250a6e5a06 | |||
| 82dc7ab444 | |||
| 51c8ab5499 | |||
| 4176176e2b | |||
| 34d03c743e | |||
| 4cf55208b1 | |||
| fe1d48635b | |||
| db20232095 | |||
| 56ecea3ffc | |||
| 59599289af | |||
| d95c93abb2 | |||
| a9076bebd2 | |||
| 5157908b47 | |||
| 13b7306b99 | |||
| b98a545d8c | |||
| ceb2c7863b | |||
| 26cedc30fa | |||
| c0f29521c4 | |||
| 13d57361e4 | |||
| 1e04770e31 | |||
| 6666ba0236 | |||
| e6c334199f | |||
| 6d75b03cc0 | |||
| 303b62c2a1 | |||
| 5109acb888 | |||
| cbc4a5d334 | |||
| a639fc9eaf | |||
| 9cc54393a0 | |||
| 16386f4b5c | |||
| 149c0ae72a | |||
| 29b4a10435 | |||
| 1cf9401e0a |
@ -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)
|
||||
@ -766,18 +769,12 @@ namespace DocFormatUtils
|
||||
|
||||
static inline std::wstring IntToWideString(int value)
|
||||
{
|
||||
#if defined(_WIN32) || defined (_WIN64)
|
||||
wchar_t buff[33] ={};
|
||||
_itow(value, buff, 10);
|
||||
return std::wstring(buff);
|
||||
#else
|
||||
return (std::to_wstring(value));
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline std::wstring DoubleToWideString(double value)
|
||||
{
|
||||
std::wstringstream src;
|
||||
|
||||
std::wstringstream src;
|
||||
src << value;
|
||||
|
||||
return std::wstring(src.str());
|
||||
@ -785,8 +782,7 @@ namespace DocFormatUtils
|
||||
|
||||
static inline std::string DoubleToString(double value)
|
||||
{
|
||||
std::stringstream src;
|
||||
|
||||
std::stringstream src;
|
||||
src << value;
|
||||
|
||||
return std::string(src.str());
|
||||
@ -813,36 +809,16 @@ namespace DocFormatUtils
|
||||
|
||||
static inline std::wstring IntToFormattedWideString( int value, const wchar_t* format )
|
||||
{
|
||||
// const int size = 33;
|
||||
|
||||
// wchar_t strValue[size] = L"\0";
|
||||
|
||||
if ( format == NULL ) return L"";
|
||||
// swprintf_s( strValue, size, format, value );
|
||||
//// }
|
||||
// CString format_str;
|
||||
// format_str.Format(format , value);
|
||||
|
||||
std::wstringstream sstream;
|
||||
sstream << boost::wformat(format) % value;
|
||||
return sstream.str();
|
||||
//return string2std_string( format_str );
|
||||
}
|
||||
|
||||
static inline std::wstring DoubleToFormattedWideString( double value, wchar_t* format )
|
||||
{
|
||||
if ( format == NULL ) return L"";
|
||||
//std::wstring wstr;
|
||||
|
||||
//if ( format != NULL )
|
||||
//{
|
||||
// CString strValue;
|
||||
// strValue.Format(format, value);
|
||||
|
||||
// wstr = string2std_string( strValue );
|
||||
//}
|
||||
|
||||
//return wstr;
|
||||
std::wstringstream sstream;
|
||||
sstream << boost::wformat(format) % value;
|
||||
return sstream.str();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -57,11 +57,11 @@ namespace XMLTools
|
||||
class XMLAttribute
|
||||
========================================================================================================*/
|
||||
|
||||
template <class T> class XMLAttribute
|
||||
class XMLAttribute
|
||||
{
|
||||
private:
|
||||
std::basic_string<T> m_Name;
|
||||
std::basic_string<T> m_Value;
|
||||
std::wstring m_Name;
|
||||
std::wstring m_Value;
|
||||
|
||||
public:
|
||||
|
||||
@ -69,56 +69,40 @@ namespace XMLTools
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
XMLAttribute( const T* name ) : m_Name(name)
|
||||
XMLAttribute( const std::wstring & name ) : m_Name(name)
|
||||
{
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
XMLAttribute( const T* name, const T* value ) : m_Name(name), m_Value(value)
|
||||
XMLAttribute( const std::wstring & name, const std::wstring & value ) : m_Name(name), m_Value(value)
|
||||
{
|
||||
}
|
||||
~XMLAttribute()
|
||||
{
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
~XMLAttribute()
|
||||
void SetValue( const std::wstring & value )
|
||||
{
|
||||
m_Value = std::wstring( value );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void SetValue( const T* value )
|
||||
{
|
||||
m_Value = std::basic_string<T>( value );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
std::basic_string<T> GetName() const
|
||||
std::wstring GetName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
std::basic_string<T> GetValue() const
|
||||
std::wstring GetValue() const
|
||||
{
|
||||
return m_Value;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
std::basic_string<T> GetXMLString()
|
||||
std::wstring GetXMLString()
|
||||
{
|
||||
std::basic_string<T> xmlString( L"" );
|
||||
std::wstring xmlString( L"" );
|
||||
|
||||
xmlString += m_Name;
|
||||
xmlString += std::basic_string<T>( L"=\"" );
|
||||
xmlString += std::wstring( L"=\"" );
|
||||
xmlString += m_Value;
|
||||
xmlString += std::basic_string<T>( L"\"" );
|
||||
xmlString += std::wstring( L"\"" );
|
||||
|
||||
return xmlString;
|
||||
}
|
||||
@ -128,86 +112,63 @@ namespace XMLTools
|
||||
class XMLElement
|
||||
========================================================================================================*/
|
||||
|
||||
template <class T> class XMLElement
|
||||
class XMLElement
|
||||
{
|
||||
typedef std::pair< std::basic_string<T>, std::basic_string<T> > AttributeValuePair;
|
||||
typedef std::pair< std::wstring, std::wstring> AttributeValuePair;
|
||||
|
||||
private:
|
||||
std::basic_string<T> m_Name;
|
||||
std::basic_string<T> m_ElementText;
|
||||
std::map<std::basic_string<T>, std::basic_string<T>> m_AttributeMap;
|
||||
std::map<std::basic_string<T>, int> m_ChildMap; //for uniq
|
||||
std::list<XMLElement<T>> m_Elements;
|
||||
std::wstring m_Name;
|
||||
std::wstring m_ElementText;
|
||||
std::map<std::wstring, std::wstring> m_AttributeMap;
|
||||
std::map<std::wstring, int> m_ChildMap; //for uniq
|
||||
std::list<XMLElement> m_Elements;
|
||||
|
||||
typedef typename std::list<XMLElement<T>>::iterator ElementsIterator;
|
||||
typedef typename std::list<XMLElement<T>>::const_iterator ElementsIteratorConst;
|
||||
typedef std::list<XMLElement>::iterator ElementsIterator;
|
||||
typedef std::list<XMLElement>::const_iterator ElementsIteratorConst;
|
||||
|
||||
typedef typename std::map<std::basic_string<T>, std::basic_string<T>>::iterator AttMapIterator;
|
||||
typedef typename std::map<std::basic_string<T>, std::basic_string<T>>::const_iterator AttMapIteratorConst;
|
||||
typedef std::map<std::wstring, std::wstring>::iterator AttMapIterator;
|
||||
typedef std::map<std::wstring, std::wstring>::const_iterator AttMapIteratorConst;
|
||||
|
||||
public:
|
||||
|
||||
XMLElement()
|
||||
XMLElement() {}
|
||||
|
||||
XMLElement( const std::wstring & name ) : m_Name(name)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
XMLElement( const T* name ) : m_Name(name)
|
||||
XMLElement( const std::wstring & prefix, const std::wstring & localName ) :
|
||||
m_Name( std::wstring( prefix ) + std::wstring( L":" ) + std::wstring( localName ) ), m_ElementText( L"" )
|
||||
{
|
||||
|
||||
}
|
||||
~XMLElement() {}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
XMLElement( const T* prefix, const T* localName ) : m_Name( std::basic_string<T>( prefix ) + std::basic_string<T>( L":" ) + std::basic_string<T>( localName ) ), m_ElementText( L"" )
|
||||
void AppendText( const std::wstring & text )
|
||||
{
|
||||
|
||||
m_ElementText = std::wstring( text );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
~XMLElement()
|
||||
void AppendTextSymbol( const wchar_t symbol )
|
||||
{
|
||||
|
||||
m_ElementText += std::wstring( &symbol );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void AppendText( const T* text )
|
||||
{
|
||||
m_ElementText = std::basic_string<T>( text );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void AppendTextSymbol( const T symbol )
|
||||
{
|
||||
m_ElementText += std::basic_string<T>( &symbol );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void AppendAttribute( const XMLAttribute<T>& attribute )
|
||||
void AppendAttribute( const XMLAttribute& attribute )
|
||||
{
|
||||
AttributeValuePair p( attribute.GetName(), attribute.GetValue() );
|
||||
|
||||
m_AttributeMap.insert( p );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void AppendAttribute( const T* name, const T* value )
|
||||
void AppendAttribute( const std::wstring & name, const std::wstring & value )
|
||||
{
|
||||
AttributeValuePair p( std::basic_string<T>( const_cast<T*>( name ) ), std::basic_string<T>( const_cast<T*>( value ) ) );
|
||||
AttributeValuePair p( name , value );
|
||||
|
||||
m_AttributeMap.insert( p );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void AppendChild( const XMLElement<T>& element, bool uniq = false)
|
||||
void AppendChild( const XMLElement& element, bool uniq = false)
|
||||
{
|
||||
if (m_ChildMap.find(element.GetName()) != m_ChildMap.end())
|
||||
{
|
||||
@ -215,21 +176,17 @@ namespace XMLTools
|
||||
}
|
||||
else
|
||||
{
|
||||
m_ChildMap.insert(m_ChildMap.end(), std::pair<std::basic_string<T>, int>(element.GetName(), 0));
|
||||
m_ChildMap.insert(m_ChildMap.end(), std::pair<std::wstring, int>(element.GetName(), 0));
|
||||
}
|
||||
m_Elements.push_back( element );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void RemoveChild( const XMLElement<T>& element )
|
||||
void RemoveChild( const XMLElement& element )
|
||||
{
|
||||
m_Elements.remove( element );
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
bool FindChild( const XMLElement<T>& element )
|
||||
bool FindChild( const XMLElement& element )
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@ -246,15 +203,13 @@ namespace XMLTools
|
||||
return result;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
bool FindChildByName( const T* elementName ) const
|
||||
bool FindChildByName( const std::wstring & elementName ) const
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
for ( ElementsIterator iter = m_Elements.begin(); iter != m_Elements.end(); iter++ )
|
||||
for ( ElementsIteratorConst iter = m_Elements.begin(); iter != m_Elements.end(); iter++ )
|
||||
{
|
||||
if ( iter->m_Name == std::basic_string<T>( elementName ) )
|
||||
if ( iter->m_Name == std::wstring( elementName ) )
|
||||
{
|
||||
result = true;
|
||||
|
||||
@ -265,9 +220,7 @@ namespace XMLTools
|
||||
return result;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
bool RemoveChildByName( const std::basic_string<T>& elementName )
|
||||
bool RemoveChildByName( const std::wstring& elementName )
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@ -286,9 +239,7 @@ namespace XMLTools
|
||||
return result;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
bool operator == ( const XMLElement<T>& element ) const
|
||||
bool operator == ( const XMLElement& element ) const
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@ -319,7 +270,7 @@ namespace XMLTools
|
||||
}
|
||||
else
|
||||
{
|
||||
ElementsIteratorConst thisIter = m_Elements.begin();
|
||||
ElementsIteratorConst thisIter = m_Elements.begin();
|
||||
ElementsIteratorConst elementIter = element.m_Elements.begin();
|
||||
|
||||
for ( ; thisIter != m_Elements.end(); thisIter++, elementIter++ )
|
||||
@ -336,34 +287,34 @@ namespace XMLTools
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
std::basic_string<T> GetName() const
|
||||
std::wstring GetName() const
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
std::basic_string<T> GetXMLString()
|
||||
std::wstring GetXMLString()
|
||||
{
|
||||
std::basic_string<T> xmlString( L"");
|
||||
std::wstring xmlString( L"");
|
||||
|
||||
bool bIsNameExists = ( m_Name != std::basic_string<T>( L"") );
|
||||
bool bIsTextExists = ( m_ElementText != std::basic_string<T>( L"") );
|
||||
bool bIsNameExists = ( m_Name != std::wstring( L"") );
|
||||
bool bIsTextExists = ( m_ElementText != std::wstring( L"") );
|
||||
|
||||
if ( bIsNameExists )
|
||||
{
|
||||
xmlString += std::basic_string<T>( L"<" ) + m_Name;
|
||||
xmlString += std::wstring( L"<" ) + m_Name;
|
||||
}
|
||||
|
||||
if ( ( bIsNameExists ) && ( m_AttributeMap.size() > 0 ) )
|
||||
{
|
||||
for ( AttMapIterator iter = m_AttributeMap.begin(); iter != m_AttributeMap.end(); iter++ )
|
||||
{
|
||||
xmlString += std::basic_string<T>( L" " );
|
||||
xmlString += std::wstring( L" " );
|
||||
xmlString += iter->first;
|
||||
xmlString += std::basic_string<T>( L"=\"" );
|
||||
xmlString += std::wstring( L"=\"" );
|
||||
xmlString += iter->second;
|
||||
xmlString += std::basic_string<T>( L"\"" );
|
||||
xmlString += std::wstring( L"\"" );
|
||||
}
|
||||
}
|
||||
|
||||
@ -371,7 +322,7 @@ namespace XMLTools
|
||||
{
|
||||
if ( bIsNameExists )
|
||||
{
|
||||
xmlString += std::basic_string<T>( L">" );
|
||||
xmlString += std::wstring( L">" );
|
||||
}
|
||||
|
||||
for ( ElementsIterator iter = m_Elements.begin(); iter != m_Elements.end(); iter++ )
|
||||
@ -386,16 +337,16 @@ namespace XMLTools
|
||||
|
||||
if ( bIsNameExists )
|
||||
{
|
||||
xmlString += std::basic_string<T>( L"</" );
|
||||
xmlString += std::wstring( L"</" );
|
||||
xmlString += m_Name;
|
||||
xmlString += std::basic_string<T>( L">" );
|
||||
xmlString += std::wstring( L">" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( bIsNameExists )
|
||||
{
|
||||
xmlString += std::basic_string<T>( L"/>" );
|
||||
xmlString += std::wstring( L"/>" );
|
||||
}
|
||||
}
|
||||
|
||||
@ -455,34 +406,12 @@ namespace XMLTools
|
||||
|
||||
void WriteInteger(int Value, int Base = 10)
|
||||
{
|
||||
#if defined(_WIN32) || defined (_WIN64)
|
||||
wchar_t buff[33] ={};
|
||||
_itow(Value, buff, Base);
|
||||
m_str += std::wstring(buff);
|
||||
#else
|
||||
m_str += std::to_wstring(Value);
|
||||
#endif
|
||||
}
|
||||
|
||||
void WriteDouble(double Value)
|
||||
{
|
||||
#if defined(_WIN32) || defined (_WIN64)
|
||||
int *dec = NULL, *sign = NULL;
|
||||
char *str = _fcvt( Value , 4, dec, sign);
|
||||
|
||||
if (str)
|
||||
{
|
||||
std::string sA(str);
|
||||
delete []str;
|
||||
m_str += std::wstring(sA.begin(), sA.end());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_str += L"0";
|
||||
}
|
||||
#else
|
||||
m_str += std::to_wstring(Value);
|
||||
#endif
|
||||
}
|
||||
void WriteBoolean(bool Value)
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -38,7 +38,7 @@ namespace DocFileFormat
|
||||
: PropertiesMapping( writer ), _isRunStyleNeeded(isRunStyleNeeded), _isOwnRPr(true), _isRTL(false)
|
||||
{
|
||||
_doc = doc;
|
||||
_rPr = new XMLTools::XMLElement<wchar_t>( _T( "w:rPr" ) );
|
||||
_rPr = new XMLTools::XMLElement( L"w:rPr");
|
||||
_revisionData = rev;
|
||||
_currentPapx = currentPapx;
|
||||
_styleChpx = styleChpx;
|
||||
@ -46,7 +46,7 @@ namespace DocFileFormat
|
||||
_webHidden = false;
|
||||
}
|
||||
|
||||
CharacterPropertiesMapping::CharacterPropertiesMapping( XMLTools::XMLElement<wchar_t>* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded )
|
||||
CharacterPropertiesMapping::CharacterPropertiesMapping( XMLTools::XMLElement* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded )
|
||||
: PropertiesMapping( NULL ), _isRunStyleNeeded(isRunStyleNeeded), _isOwnRPr(false), _isRTL(false)
|
||||
{
|
||||
_doc = doc;
|
||||
@ -77,7 +77,7 @@ namespace DocFileFormat
|
||||
// apend revision changes
|
||||
if (_revisionData->Type == Changed)
|
||||
{
|
||||
XMLTools::XMLElement<wchar_t> rPrChange( _T( "w:rPrChange" ) );
|
||||
XMLTools::XMLElement rPrChange( L"w:rPrChange");
|
||||
|
||||
//todooo date - _revisionData->Dttm.Convert( new DateMapping( rPrChange ) );
|
||||
|
||||
@ -85,7 +85,7 @@ namespace DocFileFormat
|
||||
|
||||
if (author_str)
|
||||
{
|
||||
XMLTools::XMLAttribute<wchar_t> author( _T( "w:author" ), FormatUtils::XmlEncode(*author_str).c_str());
|
||||
XMLTools::XMLAttribute author( L"w:author", FormatUtils::XmlEncode(*author_str));
|
||||
rPrChange.AppendAttribute( author );
|
||||
}
|
||||
|
||||
@ -98,7 +98,7 @@ namespace DocFileFormat
|
||||
//write properties
|
||||
if ( ( m_pXmlWriter != NULL ) && ( ( _rPr->GetChildCount() > 0 ) || ( _rPr->GetAttributeCount() > 0 ) ) )
|
||||
{
|
||||
m_pXmlWriter->WriteString( _rPr->GetXMLString().c_str() );
|
||||
m_pXmlWriter->WriteString( _rPr->GetXMLString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ namespace DocFileFormat
|
||||
{
|
||||
//Todo сделать определение симольного шрифта через fontManager
|
||||
//Заглушка под Google Docs, они пишут bullet в Arial
|
||||
if (-1 != m_sAsciiFont.find (_T("Arial")) && -1 != m_sEastAsiaFont.find (_T("Arial")) && -1 != m_shAnsiFont.find (_T("Arial")))
|
||||
if (-1 != m_sAsciiFont.find (L"Arial") && -1 != m_sEastAsiaFont.find (L"Arial") && -1 != m_shAnsiFont.find (L"Arial"))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@ -116,16 +116,16 @@ namespace DocFileFormat
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
void CharacterPropertiesMapping::convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement<wchar_t>* parent )
|
||||
void CharacterPropertiesMapping::convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent )
|
||||
{
|
||||
XMLTools::XMLElement<wchar_t> * rFonts = new XMLTools::XMLElement<wchar_t> ( _T( "w:rFonts" ) );
|
||||
XMLTools::XMLElement<wchar_t> * color = new XMLTools::XMLElement<wchar_t> ( _T( "w:color" ) );
|
||||
XMLTools::XMLAttribute<wchar_t> * colorVal = new XMLTools::XMLAttribute<wchar_t> ( _T( "w:val" ) );
|
||||
XMLTools::XMLElement<wchar_t> * lang = new XMLTools::XMLElement<wchar_t> ( _T( "w:lang" ) );
|
||||
XMLTools::XMLElement * rFonts = new XMLTools::XMLElement ( L"w:rFonts" );
|
||||
XMLTools::XMLElement * color = new XMLTools::XMLElement ( L"w:color" );
|
||||
XMLTools::XMLAttribute * colorVal = new XMLTools::XMLAttribute ( L"w:val" );
|
||||
XMLTools::XMLElement * lang = new XMLTools::XMLElement ( L"w:lang" );
|
||||
|
||||
if (_webHidden)
|
||||
{
|
||||
XMLTools::XMLElement<wchar_t> * webHidden = new XMLTools::XMLElement<wchar_t> ( _T( "w:webHidden" ) );
|
||||
XMLTools::XMLElement * webHidden = new XMLTools::XMLElement ( L"w:webHidden" );
|
||||
parent->AppendChild( *webHidden );
|
||||
RELEASEOBJECT( webHidden );
|
||||
}
|
||||
@ -144,95 +144,96 @@ namespace DocFileFormat
|
||||
_currentIstd = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
if (_currentIstd < _doc->Styles->Styles->size())
|
||||
{
|
||||
appendValueElement( parent, _T( "rStyle" ), StyleSheetMapping::MakeStyleId( _doc->Styles->Styles->at( _currentIstd ) ).c_str(), true );
|
||||
appendValueElement( parent, L"rStyle", StyleSheetMapping::MakeStyleId( _doc->Styles->Styles->at( _currentIstd ) ), true );
|
||||
}
|
||||
}
|
||||
}break;
|
||||
|
||||
case sprmCFBiDi :
|
||||
appendFlagElement( parent, *iter, _T( "rtl" ), true );
|
||||
appendFlagElement( parent, *iter, L"rtl", true );
|
||||
_isRTL = true;
|
||||
break;
|
||||
|
||||
case sprmOldCFBold :
|
||||
case sprmCFBold :
|
||||
appendFlagElement( parent, *iter, _T( "b" ), true );
|
||||
appendFlagElement( parent, *iter, L"b", true );
|
||||
break;
|
||||
|
||||
case sprmCFBoldBi :
|
||||
appendFlagElement( parent, *iter, _T( "bCs" ), true );
|
||||
appendFlagElement( parent, *iter, L"bCs", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFCaps :
|
||||
case sprmCFCaps :
|
||||
appendFlagElement( parent, *iter, _T( "caps" ), true );
|
||||
appendFlagElement( parent, *iter, L"caps", true );
|
||||
break;
|
||||
|
||||
case sprmCFComplexScripts :
|
||||
appendFlagElement( parent, *iter, _T( "cs" ), true );
|
||||
appendFlagElement( parent, *iter, L"cs", true );
|
||||
break;
|
||||
|
||||
case sprmCFDStrike :
|
||||
appendFlagElement( parent, *iter, _T( "dstrike" ), true );
|
||||
appendFlagElement( parent, *iter, L"dstrike", true );
|
||||
break;
|
||||
|
||||
case sprmCFEmboss :
|
||||
appendFlagElement( parent, *iter, _T( "emboss" ), true );
|
||||
appendFlagElement( parent, *iter, L"emboss", true );
|
||||
break;
|
||||
|
||||
case sprmCFImprint :
|
||||
appendFlagElement( parent, *iter, _T( "imprint" ), true );
|
||||
appendFlagElement( parent, *iter, L"imprint", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFItalic :
|
||||
case sprmCFItalic :
|
||||
appendFlagElement( parent, *iter, _T( "i" ), true );
|
||||
appendFlagElement( parent, *iter, L"i", true );
|
||||
break;
|
||||
|
||||
case sprmCFItalicBi:
|
||||
appendFlagElement( parent, *iter, _T( "iCs" ), true );
|
||||
appendFlagElement( parent, *iter, L"iCs", true );
|
||||
break;
|
||||
|
||||
case 0x0875:
|
||||
appendFlagElement( parent, *iter, _T( "noProof" ), true );
|
||||
appendFlagElement( parent, *iter, L"noProof", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFOutline:
|
||||
case sprmCFOutline:
|
||||
appendFlagElement( parent, *iter, _T( "outline" ), true );
|
||||
appendFlagElement( parent, *iter, L"outline", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFShadow:
|
||||
case sprmCFShadow:
|
||||
appendFlagElement( parent, *iter, _T( "shadow" ), true );
|
||||
appendFlagElement( parent, *iter, L"shadow", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFSmallCaps:
|
||||
case sprmCFSmallCaps:
|
||||
appendFlagElement( parent, *iter, _T( "smallCaps" ), true );
|
||||
appendFlagElement( parent, *iter, L"smallCaps", true );
|
||||
break;
|
||||
|
||||
case sprmCFSpecVanish:
|
||||
appendFlagElement( parent, *iter, _T( "specVanish" ), true );
|
||||
appendFlagElement( parent, *iter, L"specVanish", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFStrike:
|
||||
case sprmCFStrike:
|
||||
appendFlagElement( parent, *iter, _T( "strike" ), true );
|
||||
appendFlagElement( parent, *iter, L"strike", true );
|
||||
break;
|
||||
|
||||
case sprmOldCFVanish:
|
||||
case sprmCFVanish:
|
||||
appendFlagElement( parent, *iter, _T( "vanish" ), true );
|
||||
appendFlagElement( parent, *iter, L"vanish", true );
|
||||
break;
|
||||
|
||||
case 0x0811:
|
||||
appendFlagElement( parent, *iter, _T( "webHidden" ), true );
|
||||
appendFlagElement( parent, *iter, L"webHidden", true );
|
||||
break;
|
||||
|
||||
case sprmOldCIss:
|
||||
case sprmCIss:
|
||||
appendValueElement( parent, _T( "vertAlign" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ).c_str(), true );
|
||||
if (iter->argumentsSize > 0 && iter->Arguments[0] < 3) //Metaevan.doc
|
||||
appendValueElement( parent, L"vertAlign", FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ), true );
|
||||
break;
|
||||
|
||||
case sprmCRgLid0_80:
|
||||
@ -274,7 +275,7 @@ namespace DocFileFormat
|
||||
case sprmCBrc80:
|
||||
case sprmCBrc:
|
||||
{ //borders
|
||||
XMLTools::XMLElement<wchar_t> bdr( _T( "w:bdr" ) );
|
||||
XMLTools::XMLElement bdr( L"w:bdr" );
|
||||
BorderCode bc( iter->Arguments, iter->argumentsSize );
|
||||
appendBorderAttributes( &bc, &bdr );
|
||||
parent->AppendChild( bdr );
|
||||
@ -292,7 +293,7 @@ namespace DocFileFormat
|
||||
case sprmCIco:
|
||||
case sprmCIcoBi:
|
||||
{//color
|
||||
colorVal->SetValue( FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ).c_str() );
|
||||
colorVal->SetValue( FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ));
|
||||
}break;
|
||||
|
||||
case sprmCCv:
|
||||
@ -300,25 +301,22 @@ namespace DocFileFormat
|
||||
std::wstringstream sstream;
|
||||
|
||||
sstream << boost::wformat(L"%02x%02x%02x") % iter->Arguments[0] % /*G*/iter->Arguments[1] % /*B*/iter->Arguments[2];
|
||||
colorVal->SetValue(sstream.str().c_str());
|
||||
//CString rgbColor;
|
||||
//rgbColor.Format( _T( "%02x%02x%02x" ), /*R*/iter->Arguments[0], /*G*/iter->Arguments[1], /*B*/iter->Arguments[2] );
|
||||
//colorVal->SetValue( rgbColor.GetString() );
|
||||
colorVal->SetValue(sstream.str());
|
||||
}break;
|
||||
|
||||
case sprmCOldHighlight:
|
||||
{
|
||||
appendValueElement( parent, _T( "highlight" ), FormatUtils::MapValueToWideString( iter->Arguments[1], &Global::ColorIdentifier[0][0], 17, 12 ).c_str(), true );
|
||||
appendValueElement( parent, L"highlight", FormatUtils::MapValueToWideString( iter->Arguments[1], &Global::ColorIdentifier[0][0], 17, 12 ), true );
|
||||
}break;
|
||||
case sprmCHighlight:
|
||||
{
|
||||
appendValueElement( parent, _T( "highlight" ), FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ).c_str(), true );
|
||||
appendValueElement( parent, L"highlight", FormatUtils::MapValueToWideString( iter->Arguments[0], &Global::ColorIdentifier[0][0], 17, 12 ), true );
|
||||
}break;
|
||||
|
||||
case sprmOldCDxaSpace:
|
||||
case sprmCDxaSpace:
|
||||
{
|
||||
appendValueElement( parent, _T( "spacing" ), FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
|
||||
appendValueElement( parent, L"spacing", FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
}break;
|
||||
|
||||
case sprmCFtcBi :
|
||||
@ -334,21 +332,21 @@ namespace DocFileFormat
|
||||
|
||||
case sprmCHpsBi :
|
||||
{
|
||||
appendValueElement( parent, _T( "szCs" ),
|
||||
FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ).c_str(), true );
|
||||
appendValueElement( parent, L"szCs",
|
||||
FormatUtils::IntToWideString( FormatUtils::BytesToInt16( iter->Arguments, 0, iter->argumentsSize ) ), true );
|
||||
}
|
||||
break;
|
||||
// Font Size in points (2~3276) default 20-half-points
|
||||
case sprmOldCHps :
|
||||
{
|
||||
appendValueElement (parent, _T( "sz" ),
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUChar (iter->Arguments, 0, iter->argumentsSize) ).c_str(),
|
||||
appendValueElement (parent, L"sz",
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUChar (iter->Arguments, 0, iter->argumentsSize) ),
|
||||
true );
|
||||
}break;
|
||||
case sprmCHps :
|
||||
{
|
||||
appendValueElement (parent, _T( "sz" ),
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize) ).c_str(), true );
|
||||
appendValueElement (parent, L"sz",
|
||||
FormatUtils::IntToWideString (FormatUtils::BytesToUInt16 (iter->Arguments, 0, iter->argumentsSize) ), true );
|
||||
}break;
|
||||
|
||||
case sprmCMajority :
|
||||
@ -358,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:
|
||||
@ -379,10 +377,10 @@ namespace DocFileFormat
|
||||
|
||||
if( nIndex < _doc->FontTable->Data.size() )
|
||||
{
|
||||
XMLTools::XMLAttribute<wchar_t>* ascii = new XMLTools::XMLAttribute<wchar_t>( _T( "w:ascii" ) );
|
||||
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( L"w:ascii" );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
m_sAsciiFont = ffn->xszFtn;
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sAsciiFont).c_str() );
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sAsciiFont, true));
|
||||
rFonts->AppendAttribute( *ascii );
|
||||
RELEASEOBJECT( ascii );
|
||||
}
|
||||
@ -393,10 +391,10 @@ namespace DocFileFormat
|
||||
int nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
if( nIndex >= 0 && nIndex < _doc->FontTable->Data.size() )
|
||||
{
|
||||
XMLTools::XMLAttribute<wchar_t>* eastAsia = new XMLTools::XMLAttribute<wchar_t>( _T( "w:eastAsia" ) );
|
||||
XMLTools::XMLAttribute* eastAsia = new XMLTools::XMLAttribute( L"w:eastAsia" );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
m_sEastAsiaFont = ffn->xszFtn;
|
||||
eastAsia->SetValue( FormatUtils::XmlEncode(m_sEastAsiaFont).c_str() );
|
||||
eastAsia->SetValue( FormatUtils::XmlEncode(m_sEastAsiaFont));
|
||||
rFonts->AppendAttribute( *eastAsia );
|
||||
RELEASEOBJECT( eastAsia );
|
||||
}
|
||||
@ -408,10 +406,10 @@ namespace DocFileFormat
|
||||
int nIndex = FormatUtils::BytesToUInt16( iter->Arguments, 0, iter->argumentsSize );
|
||||
if( nIndex>=0 && nIndex < _doc->FontTable->Data.size() )
|
||||
{
|
||||
XMLTools::XMLAttribute<wchar_t>* ansi = new XMLTools::XMLAttribute<wchar_t>( _T( "w:hAnsi" ) );
|
||||
XMLTools::XMLAttribute* ansi = new XMLTools::XMLAttribute( L"w:hAnsi" );
|
||||
FontFamilyName* ffn = static_cast<FontFamilyName*>( _doc->FontTable->operator [] ( nIndex ) );
|
||||
m_shAnsiFont = ffn->xszFtn;
|
||||
ansi->SetValue( FormatUtils::XmlEncode(m_shAnsiFont).c_str() );
|
||||
ansi->SetValue( FormatUtils::XmlEncode(m_shAnsiFont));
|
||||
rFonts->AppendAttribute( *ansi );
|
||||
RELEASEOBJECT( ansi );
|
||||
}
|
||||
@ -420,18 +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:
|
||||
@ -485,8 +483,8 @@ namespace DocFileFormat
|
||||
|
||||
if (!m_sDefaultFont.empty() && m_sAsciiFont.empty() && m_sEastAsiaFont.empty() && m_shAnsiFont.empty())
|
||||
{//????
|
||||
XMLTools::XMLAttribute<wchar_t>* ascii = new XMLTools::XMLAttribute<wchar_t>( _T( "w:ascii" ) );
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sDefaultFont).c_str() );
|
||||
XMLTools::XMLAttribute* ascii = new XMLTools::XMLAttribute( L"w:ascii" );
|
||||
ascii->SetValue( FormatUtils::XmlEncode(m_sDefaultFont));
|
||||
//rFonts->AppendAttribute( *ascii );
|
||||
RELEASEOBJECT( ascii );
|
||||
}
|
||||
@ -504,7 +502,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//append color
|
||||
if ( colorVal->GetValue() != _T( "" ) )
|
||||
if ( colorVal->GetValue() != L"")
|
||||
{
|
||||
color->AppendAttribute( *colorVal );
|
||||
parent->AppendChild( *color );
|
||||
@ -520,14 +518,14 @@ namespace DocFileFormat
|
||||
|
||||
/// CHPX flags are special flags because the can be 0,1,128 and 129,
|
||||
/// so this method overrides the appendFlagElement method.
|
||||
void CharacterPropertiesMapping::appendFlagElement( XMLTools::XMLElement<wchar_t>* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique )
|
||||
void CharacterPropertiesMapping::appendFlagElement( XMLTools::XMLElement* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique )
|
||||
{
|
||||
unsigned char flag = sprm.Arguments[0];
|
||||
|
||||
if( flag != 128 )
|
||||
{
|
||||
XMLTools::XMLElement<wchar_t>* ele = new XMLTools::XMLElement<wchar_t>( _T( "w" ), elementName );
|
||||
XMLTools::XMLAttribute<wchar_t>* val = new XMLTools::XMLAttribute<wchar_t>( _T( "w:val" ) );
|
||||
XMLTools::XMLElement* ele = new XMLTools::XMLElement( L"w", elementName );
|
||||
XMLTools::XMLAttribute* val = new XMLTools::XMLAttribute( L"w:val" );
|
||||
|
||||
if ( unique )
|
||||
{
|
||||
@ -536,7 +534,7 @@ namespace DocFileFormat
|
||||
|
||||
if ( flag == 0 )
|
||||
{
|
||||
val->SetValue( _T( "false" ) );
|
||||
val->SetValue( L"false" );
|
||||
ele->AppendAttribute( *val );
|
||||
node->AppendChild( *ele );
|
||||
}
|
||||
@ -579,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)
|
||||
@ -55,7 +55,7 @@ namespace DocFileFormat
|
||||
{
|
||||
public:
|
||||
CharacterPropertiesMapping( XMLTools::CStringXmlWriter* writer, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded = true );
|
||||
CharacterPropertiesMapping( XMLTools::XMLElement<wchar_t>* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded = true );
|
||||
CharacterPropertiesMapping( XMLTools::XMLElement* rPr, WordDocument* doc, RevisionData* rev, ParagraphPropertyExceptions* currentPapx, bool styleChpx, bool isRunStyleNeeded = true );
|
||||
virtual ~CharacterPropertiesMapping();
|
||||
void Apply( IVisitable* chpx );
|
||||
bool CheckIsSymbolFont();
|
||||
@ -63,7 +63,7 @@ namespace DocFileFormat
|
||||
bool _webHidden;
|
||||
bool _isRTL;
|
||||
private:
|
||||
void convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement<wchar_t>* parent );
|
||||
void convertSprms( std::list<SinglePropertyModifier>* sprms, XMLTools::XMLElement* parent );
|
||||
std::list<CharacterPropertyExceptions*> buildHierarchy( const StyleSheet* styleSheet, unsigned short istdStart );
|
||||
bool applyToggleHierachy( const SinglePropertyModifier& sprm );
|
||||
bool toogleValue( bool currentValue, unsigned char toggle );
|
||||
@ -71,13 +71,13 @@ namespace DocFileFormat
|
||||
protected:
|
||||
/// CHPX flags are special flags because the can be 0,1,128 and 129,
|
||||
/// so this method overrides the appendFlagElement method.
|
||||
virtual void appendFlagElement( XMLTools::XMLElement<wchar_t>* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique );
|
||||
virtual void appendFlagElement( XMLTools::XMLElement* node, const SinglePropertyModifier& sprm, const wchar_t* elementName, bool unique );
|
||||
|
||||
private:
|
||||
XMLTools::CStringXmlWriter pRunPr;
|
||||
|
||||
WordDocument* _doc;
|
||||
XMLTools::XMLElement<wchar_t>* _rPr;
|
||||
XMLTools::XMLElement* _rPr;
|
||||
unsigned short _currentIstd;
|
||||
RevisionData* _revisionData;
|
||||
bool _styleChpx;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -54,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)
|
||||
@ -33,138 +33,136 @@
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include <tchar.h>
|
||||
#else
|
||||
#include "../../DesktopEditor/common/ASCVariant.h"
|
||||
#include "../../Common/DocxFormat/Source/Base/ASCString.h"
|
||||
#endif
|
||||
#include <string>
|
||||
|
||||
#include "../../DesktopEditor/common/ASCVariant.h"
|
||||
|
||||
namespace OpenXmlContentTypes
|
||||
{
|
||||
// default content types
|
||||
static const TCHAR* Xml = _T("application/xml");
|
||||
static const wchar_t* Xml = L"application/xml";
|
||||
|
||||
// package content types
|
||||
static const TCHAR* Relationships = _T("application/vnd.openxmlformats-package.relationships+xml");
|
||||
static const wchar_t* Relationships = L"application/vnd.openxmlformats-package.relationships+xml";
|
||||
|
||||
static const TCHAR* CoreProperties = _T("application/vnd.openxmlformats-package.core-properties+xml");
|
||||
static const wchar_t* CoreProperties = L"application/vnd.openxmlformats-package.core-properties+xml";
|
||||
|
||||
// general office document content types
|
||||
static const TCHAR* ExtendedProperties = _T("application/vnd.openxmlformats-officedocument.extended-properties+xml");
|
||||
static const TCHAR* Theme = _T("application/vnd.openxmlformats-officedocument.theme+xml");
|
||||
static const wchar_t* ExtendedProperties = L"application/vnd.openxmlformats-officedocument.extended-properties+xml";
|
||||
static const wchar_t* Theme = L"application/vnd.openxmlformats-officedocument.theme+xml";
|
||||
|
||||
static const TCHAR* CustomXmlProperties = _T("application/vnd.openxmlformats-officedocument.customXmlProperties+xml");
|
||||
static const wchar_t* CustomXmlProperties = L"application/vnd.openxmlformats-officedocument.customXmlProperties+xml";
|
||||
|
||||
static const TCHAR* OleObject = _T("application/vnd.openxmlformats-officedocument.oleObject");
|
||||
static const TCHAR* Vml = _T("application/vnd.openxmlformats-officedocument.vmlDrawing");
|
||||
static const TCHAR* Drawing = _T("application/vnd.openxmlformats-officedocument.drawing+xml");
|
||||
static const wchar_t* OleObject = L"application/vnd.openxmlformats-officedocument.oleObject";
|
||||
static const wchar_t* Vml = L"application/vnd.openxmlformats-officedocument.vmlDrawing";
|
||||
static const wchar_t* Drawing = L"application/vnd.openxmlformats-officedocument.drawing+xml";
|
||||
|
||||
static const TCHAR* MSWordDocx = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
|
||||
static const wchar_t* MSWordDocx = L"application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
||||
|
||||
static const TCHAR* MSExcel = _T("application/vnd.ms-excel");
|
||||
static const TCHAR* MSWord = _T("application/msword");
|
||||
static const TCHAR* MSPowerpoint = _T("application/vnd.ms-powerpoint");
|
||||
static const wchar_t* MSExcel = L"application/vnd.ms-excel";
|
||||
static const wchar_t* MSWord = L"application/msword";
|
||||
static const wchar_t* MSPowerpoint = L"application/vnd.ms-powerpoint";
|
||||
|
||||
static const TCHAR* Emf = _T("image/x-emf");
|
||||
static const TCHAR* Jpeg = _T("image/jpeg");
|
||||
static const TCHAR* Png = _T("image/png");
|
||||
static const TCHAR* Tiff = _T("image/tiff");
|
||||
static const TCHAR* Wmf = _T("image/x-wmf");
|
||||
static const TCHAR* Bmp = _T("image/bmp");
|
||||
static const wchar_t* Emf = L"image/x-emf";
|
||||
static const wchar_t* Jpeg = L"image/jpeg";
|
||||
static const wchar_t* Png = L"image/png";
|
||||
static const wchar_t* Tiff = L"image/tiff";
|
||||
static const wchar_t* Wmf = L"image/x-wmf";
|
||||
static const wchar_t* Bmp = L"image/bmp";
|
||||
}
|
||||
|
||||
namespace WordprocessingMLContentTypes
|
||||
{
|
||||
// WordprocessingML content types
|
||||
static const TCHAR* MainDocument = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml");
|
||||
static const TCHAR* MainDocumentMacro = _T("application/vnd.ms-word.document.macroEnabled.main+xml");
|
||||
static const TCHAR* MainDocumentTemplate = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml");
|
||||
static const TCHAR* MainDocumentMacroTemplate = _T("application/vnd.ms-word.template.macroEnabledTemplate.main+xml");
|
||||
static const wchar_t* MainDocument = L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml";
|
||||
static const wchar_t* MainDocumentMacro = L"application/vnd.ms-word.document.macroEnabled.main+xml";
|
||||
static const wchar_t* MainDocumentTemplate = L"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml";
|
||||
static const wchar_t* MainDocumentMacroTemplate = L"application/vnd.ms-word.template.macroEnabledTemplate.main+xml";
|
||||
|
||||
static const TCHAR* Styles = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml");
|
||||
static const TCHAR* Numbering = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml");
|
||||
static const TCHAR* FontTable = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml");
|
||||
static const TCHAR* WebSettings = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml");
|
||||
static const TCHAR* Settings = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml");
|
||||
static const wchar_t* Styles = L"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml";
|
||||
static const wchar_t* Numbering = L"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml";
|
||||
static const wchar_t* FontTable = L"application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml";
|
||||
static const wchar_t* WebSettings = L"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml";
|
||||
static const wchar_t* Settings = L"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";
|
||||
|
||||
static const TCHAR* Comments = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml");
|
||||
static const wchar_t* Comments = L"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml";
|
||||
|
||||
static const TCHAR* Footnotes = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml");
|
||||
static const TCHAR* Endnotes = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml");
|
||||
static const wchar_t* Footnotes = L"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml";
|
||||
static const wchar_t* Endnotes = L"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml";
|
||||
|
||||
static const TCHAR* Header = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml");
|
||||
static const TCHAR* Footer = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml");
|
||||
static const wchar_t* Header = L"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml";
|
||||
static const wchar_t* Footer = L"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml";
|
||||
|
||||
static const TCHAR* Glossary = _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml");
|
||||
static const wchar_t* Glossary = L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml";
|
||||
}
|
||||
|
||||
namespace MicrosoftWordContentTypes
|
||||
{
|
||||
static const TCHAR* KeyMapCustomization = _T("application/vnd.ms-word.keyMapCustomizations+xml");
|
||||
static const TCHAR* VbaProject = _T("application/vnd.ms-office.vbaProject");
|
||||
static const TCHAR* VbaData = _T("application/vnd.ms-word.vbaData+xml");
|
||||
static const TCHAR* Toolbars = _T("application/vnd.ms-word.attachedToolbars");
|
||||
static const wchar_t* KeyMapCustomization = L"application/vnd.ms-word.keyMapCustomizations+xml";
|
||||
static const wchar_t* VbaProject = L"application/vnd.ms-office.vbaProject";
|
||||
static const wchar_t* VbaData = L"application/vnd.ms-word.vbaData+xml";
|
||||
static const wchar_t* Toolbars = L"application/vnd.ms-word.attachedToolbars";
|
||||
}
|
||||
|
||||
namespace OpenXmlNamespaces
|
||||
{
|
||||
// package namespaces
|
||||
static const TCHAR* ContentTypes = _T("http://schemas.openxmlformats.org/package/2006/content-types");
|
||||
static const TCHAR* RelationshipsPackage = _T("http://schemas.openxmlformats.org/package/2006/relationships");
|
||||
static const TCHAR* Relationships = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
static const wchar_t* ContentTypes = L"http://schemas.openxmlformats.org/package/2006/content-types";
|
||||
static const wchar_t* RelationshipsPackage = L"http://schemas.openxmlformats.org/package/2006/relationships";
|
||||
static const wchar_t* Relationships = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships";
|
||||
|
||||
// Drawing ML namespaces
|
||||
static const TCHAR* DrawingML = _T("http://schemas.openxmlformats.org/drawingml/2006/main");
|
||||
static const TCHAR* DrawingMLPicture = _T("http://schemas.openxmlformats.org/drawingml/2006/picture");
|
||||
static const wchar_t* DrawingML = L"http://schemas.openxmlformats.org/drawingml/2006/main";
|
||||
static const wchar_t* DrawingMLPicture = L"http://schemas.openxmlformats.org/drawingml/2006/picture";
|
||||
|
||||
// WordprocessingML namespaces
|
||||
static const TCHAR* WordprocessingML = _T("http://schemas.openxmlformats.org/wordprocessingml/2006/main");
|
||||
static const TCHAR* WordprocessingDrawingML = _T("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
|
||||
static const TCHAR* VectorML = _T("urn:schemas-microsoft-com:vml");
|
||||
static const TCHAR* MicrosoftWordML = _T("http://schemas.microsoft.com/office/word/2006/wordml");
|
||||
static const wchar_t* WordprocessingML = L"http://schemas.openxmlformats.org/wordprocessingml/2006/main";
|
||||
static const wchar_t* WordprocessingDrawingML = L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing";
|
||||
static const wchar_t* VectorML = L"urn:schemas-microsoft-com:vml";
|
||||
static const wchar_t* MicrosoftWordML = L"http://schemas.microsoft.com/office/word/2006/wordml";
|
||||
|
||||
// PresentationML namespaces
|
||||
static const TCHAR* PresentationML = _T("http://schemas.openxmlformats.org/presentationml/2006/main");
|
||||
static const wchar_t* PresentationML = L"http://schemas.openxmlformats.org/presentationml/2006/main";
|
||||
|
||||
// SpreadsheetML Namespaces
|
||||
static const TCHAR* SharedStringML = _T("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
static const TCHAR* WorkBookML = _T("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
static const TCHAR* StylesML = _T("http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
static const wchar_t* SharedStringML = L"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
|
||||
static const wchar_t* WorkBookML = L"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
|
||||
static const wchar_t* StylesML = L"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
|
||||
|
||||
//Office
|
||||
static const TCHAR* Office = _T("urn:schemas-microsoft-com:office:office");
|
||||
static const TCHAR* OfficeWord = _T("urn:schemas-microsoft-com:office:word");
|
||||
static const wchar_t* Office = L"urn:schemas-microsoft-com:office:office";
|
||||
static const wchar_t* OfficeWord = L"urn:schemas-microsoft-com:office:word";
|
||||
}
|
||||
|
||||
namespace OpenXmlRelationshipTypes
|
||||
{
|
||||
static const TCHAR* CoreProperties = _T("http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties");
|
||||
static const TCHAR* ExtendedProperties = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties");
|
||||
static const wchar_t* CoreProperties = L"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties";
|
||||
static const wchar_t* ExtendedProperties = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";
|
||||
|
||||
static const TCHAR* Theme = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme");
|
||||
static const TCHAR* OfficeDocument = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument");
|
||||
static const TCHAR* Styles = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles");
|
||||
static const TCHAR* FontTable = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable");
|
||||
static const TCHAR* Numbering = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering");
|
||||
static const TCHAR* WebSettings = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings");
|
||||
static const TCHAR* Settings = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings");
|
||||
static const TCHAR* CustomXml = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml");
|
||||
static const TCHAR* CustomXmlProperties = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps");
|
||||
static const TCHAR* Comments = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments");
|
||||
static const TCHAR* Footnotes = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes");
|
||||
static const TCHAR* Endnotes = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes");
|
||||
static const TCHAR* Header = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/header");
|
||||
static const TCHAR* Footer = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer");
|
||||
static const TCHAR* Image = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image");
|
||||
static const TCHAR* OleObject = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject");
|
||||
static const TCHAR* GlossaryDocument = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument");
|
||||
static const TCHAR* Package = _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/package");
|
||||
static const wchar_t* Theme = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
|
||||
static const wchar_t* OfficeDocument = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
|
||||
static const wchar_t* Styles = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles";
|
||||
static const wchar_t* FontTable = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable";
|
||||
static const wchar_t* Numbering = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering";
|
||||
static const wchar_t* WebSettings = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings";
|
||||
static const wchar_t* Settings = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings";
|
||||
static const wchar_t* CustomXml = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml";
|
||||
static const wchar_t* CustomXmlProperties = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps";
|
||||
static const wchar_t* Comments = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
|
||||
static const wchar_t* Footnotes = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes";
|
||||
static const wchar_t* Endnotes = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes";
|
||||
static const wchar_t* Header = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";
|
||||
static const wchar_t* Footer = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";
|
||||
static const wchar_t* Image = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
|
||||
static const wchar_t* OleObject = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
|
||||
static const wchar_t* GlossaryDocument = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/glossaryDocument";
|
||||
static const wchar_t* Package = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
|
||||
}
|
||||
|
||||
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)
|
||||
@ -72,6 +72,8 @@ namespace DocFileFormat
|
||||
_isSectionPageBreak = 0;
|
||||
_isTextBoxContent = false;
|
||||
_embeddedObject = false;
|
||||
|
||||
_cacheListNum = -1;
|
||||
}
|
||||
|
||||
DocumentMapping::~DocumentMapping()
|
||||
@ -81,12 +83,8 @@ namespace DocFileFormat
|
||||
RELEASEOBJECT(m_pXmlWriter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
// Looks into the section table to find out if this CP is the end & current of a sections
|
||||
|
||||
int DocumentMapping::getCurrentSection(int cp)
|
||||
{
|
||||
//if cp is the last char of a section, the next section will start at cp +1
|
||||
@ -105,6 +103,22 @@ namespace DocFileFormat
|
||||
|
||||
return m_document->SectionPlex->CharacterPositions[current + 1];
|
||||
}
|
||||
int DocumentMapping::getListNumCache(int fc, int fc_end)
|
||||
{
|
||||
if ( !m_document->ListPlex ) return -1;
|
||||
|
||||
for (int i = 1; i < m_document->ListPlex->CharacterPositions.size(); i++)
|
||||
{
|
||||
if ((fc >= m_document->ListPlex->CharacterPositions[i-1]) && (fc_end <= m_document->ListPlex->CharacterPositions[i]))
|
||||
{
|
||||
ListNumCache* listNum = dynamic_cast<ListNumCache*> (m_document->ListPlex->Elements[i-1]);
|
||||
|
||||
return listNum->value;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
bool DocumentMapping::isSectionEnd(int cp)
|
||||
{
|
||||
bool result = false;
|
||||
@ -180,8 +194,8 @@ namespace DocFileFormat
|
||||
|
||||
// get all CHPX between these boundaries to determine the count of runs
|
||||
|
||||
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fc, fcEnd);
|
||||
std::vector<int>* chpxFcs = m_document->GetFileCharacterPositions(fc, fcEnd);
|
||||
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fc, fcEnd);
|
||||
std::vector<int>* chpxFcs = m_document->GetFileCharacterPositions(fc, fcEnd);
|
||||
|
||||
CharacterPropertyExceptions* paraEndChpx = NULL;
|
||||
|
||||
@ -198,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
|
||||
@ -208,8 +222,8 @@ namespace DocFileFormat
|
||||
{
|
||||
isBidi = currentSection->isBidi;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
//_cacheListNum = getListNumCache(fc, fcEnd);
|
||||
_isSectionPageBreak = 0;
|
||||
if (sectionEnd)
|
||||
{
|
||||
@ -306,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);
|
||||
@ -330,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
|
||||
@ -356,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);
|
||||
@ -420,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();
|
||||
}
|
||||
}
|
||||
@ -454,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
|
||||
@ -477,9 +491,9 @@ namespace DocFileFormat
|
||||
|
||||
text.clear();
|
||||
|
||||
XMLTools::XMLElement<wchar_t> 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)
|
||||
{
|
||||
@ -487,11 +501,11 @@ namespace DocFileFormat
|
||||
|
||||
text.clear();
|
||||
|
||||
XMLTools::XMLElement<wchar_t> 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)
|
||||
{
|
||||
@ -506,10 +520,10 @@ namespace DocFileFormat
|
||||
|
||||
text.clear();
|
||||
|
||||
XMLTools::XMLElement<wchar_t> 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)
|
||||
@ -518,10 +532,10 @@ namespace DocFileFormat
|
||||
|
||||
text.clear();
|
||||
|
||||
XMLTools::XMLElement<wchar_t> 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)
|
||||
{
|
||||
@ -532,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();
|
||||
@ -564,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 );
|
||||
|
||||
@ -579,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;
|
||||
|
||||
@ -589,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;
|
||||
|
||||
@ -608,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++;
|
||||
@ -629,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;
|
||||
|
||||
@ -671,31 +685,38 @@ namespace DocFileFormat
|
||||
chpxObj->Convert(rPr);
|
||||
RELEASEOBJECT(rPr);
|
||||
}
|
||||
XMLTools::CStringXmlWriter OleWriter;
|
||||
VMLPictureMapping oVmlMapper (m_context, &OleWriter, true, _caller);
|
||||
XMLTools::CStringXmlWriter oleWriter;
|
||||
XMLTools::CStringXmlWriter oleObjectWriter;
|
||||
|
||||
VMLPictureMapping oVmlMapper (m_context, &oleWriter, true, _caller);
|
||||
|
||||
if (!m_shapeIdOwner.empty()) //4571833.doc
|
||||
oVmlMapper.m_shapeId = m_shapeIdOwner;
|
||||
|
||||
if (m_document->bOlderVersion)
|
||||
{
|
||||
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( &OleWriter, m_context, &ole.pictureDesciptor, _caller, oVmlMapper.GetShapeId() );
|
||||
OleObjectMapping oleObjectMapping( &oleObjectWriter, m_context, &ole.pictureDesciptor, _caller, oVmlMapper.m_shapeId);
|
||||
|
||||
ole.Convert( &oleObjectMapping );
|
||||
|
||||
_lastOLEObject = oleObjectWriter.GetXmlString();
|
||||
}
|
||||
else
|
||||
{
|
||||
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);
|
||||
@ -709,7 +730,7 @@ namespace DocFileFormat
|
||||
CharacterPropertyExceptions* chpxSep = chpxs->front();
|
||||
|
||||
OleObject ole ( chpxSep, m_document->GetStorage(), m_document->bOlderVersion);
|
||||
OleObjectMapping oleObjectMapping( &OleWriter, m_context, &pic, _caller, oVmlMapper.GetShapeId() );
|
||||
OleObjectMapping oleObjectMapping( &oleObjectWriter, m_context, &pic, _caller, oVmlMapper.m_shapeId );
|
||||
|
||||
if (oVmlMapper.m_isEmbedded)
|
||||
{
|
||||
@ -718,21 +739,24 @@ namespace DocFileFormat
|
||||
ole.emeddedData = oVmlMapper.m_embeddedData;
|
||||
}
|
||||
ole.Convert( &oleObjectMapping );
|
||||
|
||||
_lastOLEObject = oleObjectWriter.GetXmlString();
|
||||
|
||||
RELEASEOBJECT( chpxs );
|
||||
}
|
||||
}
|
||||
OleWriter.WriteNodeEnd( _T( "w:object" ) );
|
||||
oleWriter.WriteString( _lastOLEObject );
|
||||
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
|
||||
{
|
||||
m_pXmlWriter->WriteString(OleWriter.GetXmlString());
|
||||
m_pXmlWriter->WriteString(oleWriter.GetXmlString());
|
||||
}
|
||||
}
|
||||
|
||||
@ -741,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++;
|
||||
@ -753,10 +777,10 @@ namespace DocFileFormat
|
||||
{
|
||||
if (_fldCharCounter > 0)
|
||||
{
|
||||
XMLTools::XMLElement<wchar_t> 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;
|
||||
}
|
||||
@ -764,16 +788,16 @@ namespace DocFileFormat
|
||||
{
|
||||
if (_fldCharCounter > 0)
|
||||
{
|
||||
XMLTools::XMLElement<wchar_t> 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;
|
||||
|
||||
@ -787,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)
|
||||
{
|
||||
@ -807,22 +831,25 @@ namespace DocFileFormat
|
||||
|
||||
if (pSpa)
|
||||
{
|
||||
PictureDescriptor pictDiscr(chpx, m_document->WordDocumentStream, 0x7fffffff, m_document->bOlderVersion);
|
||||
ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeContainer(pSpa->GetShapeID());
|
||||
|
||||
if (pShape)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin (_T("w:pict"));
|
||||
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, NULL, _caller);
|
||||
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, &pictDiscr, _caller);
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin (L"w:pict");
|
||||
|
||||
pShape->Convert(&oVmlWriter);
|
||||
m_pXmlWriter->WriteNodeEnd (_T("w:pict"));
|
||||
m_pXmlWriter->WriteNodeEnd (L"w:pict");
|
||||
}
|
||||
|
||||
if (!pSpa->primitives.empty())
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin (_T("w:pict"));
|
||||
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, pSpa, NULL, _caller);
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -834,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;
|
||||
|
||||
@ -865,7 +892,7 @@ namespace DocFileFormat
|
||||
if (oVmlMapper.m_isEmbedded)
|
||||
{
|
||||
OleObject ole ( chpx, m_document->GetStorage(), m_document->bOlderVersion);
|
||||
OleObjectMapping oleObjectMapping( &pictWriter, m_context, &oPicture, _caller, oVmlMapper.GetShapeId() );
|
||||
OleObjectMapping oleObjectMapping( &pictWriter, m_context, &oPicture, _caller, oVmlMapper.m_shapeId );
|
||||
|
||||
ole.isEquation = oVmlMapper.m_isEquation;
|
||||
ole.isEmbedded = oVmlMapper.m_isEmbedded;
|
||||
@ -876,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;
|
||||
}
|
||||
@ -886,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());
|
||||
@ -897,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++;
|
||||
@ -945,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);
|
||||
}
|
||||
@ -960,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 );
|
||||
}
|
||||
@ -974,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.
|
||||
@ -1114,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 );
|
||||
@ -1152,7 +1179,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//close w:tbl
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:tbl" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:tbl" );
|
||||
|
||||
RELEASEOBJECT( grid );
|
||||
|
||||
@ -1357,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 );
|
||||
@ -1407,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++;
|
||||
@ -1423,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 );
|
||||
@ -1460,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
|
||||
@ -1472,7 +1499,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//end w:tc
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:tc" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:tc" );
|
||||
|
||||
return cp;
|
||||
}
|
||||
@ -1541,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<wchar_t> 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;
|
||||
}
|
||||
@ -1562,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<wchar_t> 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;
|
||||
}
|
||||
@ -1623,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;
|
||||
}
|
||||
@ -1636,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)
|
||||
@ -70,68 +70,70 @@ namespace DocFileFormat
|
||||
public:
|
||||
DocumentMapping(ConversionContext* context, IMapping* caller);
|
||||
DocumentMapping(ConversionContext* context, XMLTools::CStringXmlWriter* writer, IMapping* caller);
|
||||
|
||||
virtual ~DocumentMapping();
|
||||
virtual void Apply( IVisitable* visited ) = 0;
|
||||
|
||||
//--------------------------------- 4571833.doc
|
||||
std::wstring m_shapeIdOwner;
|
||||
std::wstring getOLEObject() { return _lastOLEObject; }
|
||||
protected:
|
||||
|
||||
/// Looks into the section table to find out if this CP is the current of a section
|
||||
int getCurrentSection(int cp);
|
||||
/// Looks into the section table to find out if this CP is the end of a section
|
||||
bool isSectionEnd( int cp );
|
||||
/// Writes a Paragraph that starts at the given cp and
|
||||
/// ends at the next paragraph end mark or section end mark
|
||||
int getListNumCache (int fc, int fc_end);
|
||||
int getCurrentSection (int cp);
|
||||
//---------------------------------
|
||||
bool isSectionEnd ( int cp );
|
||||
// Writes a Paragraph that starts at the given cp and
|
||||
// ends at the next paragraph end mark or section end mark
|
||||
int writeParagraph( int cp );
|
||||
/// Writes a Paragraph that starts at the given cpStart and
|
||||
/// ends at the given cpEnd
|
||||
// Writes a Paragraph that starts at the given cpStart and
|
||||
// ends at the given cpEnd
|
||||
int writeParagraph( int initialCp, int cpEnd, bool sectionEnd, bool lastBad = false );
|
||||
/// Writes a Paragraph RSID
|
||||
// Writes a Paragraph RSID
|
||||
void writeParagraphRsid( const ParagraphPropertyExceptions* papx );
|
||||
/// Writes a run with the given characters and CHPX
|
||||
// Writes a run with the given characters and CHPX
|
||||
int writeRun( std::vector<wchar_t>* chars, CharacterPropertyExceptions* chpx, int initialCp );
|
||||
/// Writes the given text to the document
|
||||
// Writes the given text to the document
|
||||
int writeText ( std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText );
|
||||
void writeTextElement ( const std::wstring& text, const std::wstring& textType );
|
||||
void writeTextStart ( const std::wstring& textType, bool preserve_space);
|
||||
void writeTextEnd ( const std::wstring& textType );
|
||||
|
||||
int writeText( std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText );
|
||||
void writeTextElement( const std::wstring& text, const std::wstring& textType );
|
||||
void writeTextStart( const std::wstring& textType, bool preserve_space);
|
||||
void writeTextEnd( const std::wstring& textType );
|
||||
|
||||
/// Searches for bookmarks in the list of characters.
|
||||
// Searches for bookmarks in the list of characters.
|
||||
std::vector<int> searchBookmarks( std::vector<wchar_t>* chars, int initialCp );
|
||||
ParagraphPropertyExceptions* findValidPapx( int fc );
|
||||
/// Splits a list of characters into several lists
|
||||
// Splits a list of characters into several lists
|
||||
std::list<std::vector<wchar_t> >* splitCharList( std::vector<wchar_t>* chars, std::vector<int>* splitIndices );
|
||||
/// Writes the table starts at the given cp value
|
||||
int writeTable( int initialCp, unsigned int nestingLevel );
|
||||
/// Builds a list that contains the width of the several columns of the table.
|
||||
// Writes the table starts at the given cp value
|
||||
int writeTable ( int initialCp, unsigned int nestingLevel );
|
||||
// Builds a list that contains the width of the several columns of the table.
|
||||
std::vector<short>* buildTableGrid( int initialCp, unsigned int nestingLevel );
|
||||
/// Finds the FC of the next row end mark.
|
||||
int findRowEndFc( int initialCp, int& rowEndCp, unsigned int nestingLevel );
|
||||
/// Finds the FC of the next row end mark.
|
||||
int findRowEndFc( int initialCp, unsigned int nestingLevel );
|
||||
/// Writes the table row that starts at the given cp value and ends at the next row end mark
|
||||
int writeTableRow( int initialCp, std::vector<short>* grid, unsigned int nestingLevel );
|
||||
/// Writes the table cell that starts at the given cp value and ends at the next cell end mark
|
||||
int writeTableCell( int initialCp, TablePropertyExceptions* tapx, std::vector<short>* grid, int& gridIndex, int cellIndex, unsigned int nestingLevel );
|
||||
int findCellEndCp( int initialCp, unsigned int nestingLevel );
|
||||
bool writeBookmarks( int cp );
|
||||
bool writeBookmarkStart( short id );
|
||||
bool writeBookmarkEnd( short id );
|
||||
/// Checks if the CHPX is special
|
||||
// Finds the FC of the next row end mark.
|
||||
int findRowEndFc ( int initialCp, int& rowEndCp, unsigned int nestingLevel );
|
||||
// Finds the FC of the next row end mark.
|
||||
int findRowEndFc ( int initialCp, unsigned int nestingLevel );
|
||||
// Writes the table row that starts at the given cp value and ends at the next row end mark
|
||||
int writeTableRow ( int initialCp, std::vector<short>* grid, unsigned int nestingLevel );
|
||||
// Writes the table cell that starts at the given cp value and ends at the next cell end mark
|
||||
int writeTableCell ( int initialCp, TablePropertyExceptions* tapx, std::vector<short>* grid, int& gridIndex, int cellIndex, unsigned int nestingLevel );
|
||||
int findCellEndCp ( int initialCp, unsigned int nestingLevel );
|
||||
|
||||
bool writeBookmarks ( int cp );
|
||||
bool writeBookmarkStart ( short id );
|
||||
bool writeBookmarkEnd ( short id );
|
||||
// Checks if the CHPX is special
|
||||
bool isSpecial( CharacterPropertyExceptions* chpx );
|
||||
/// Finds the SEPX that is valid for the given CP.
|
||||
// Finds the SEPX that is valid for the given CP.
|
||||
SectionPropertyExceptions* findValidSepx( int cp );
|
||||
/// Searches the given vector for the next FieldEnd character.
|
||||
// Searches the given vector for the next FieldEnd character.
|
||||
int searchNextTextMark( std::vector<wchar_t>* chars, int initialCp, wchar_t mark );
|
||||
|
||||
private:
|
||||
Symbol getSymbol( const CharacterPropertyExceptions* chpx );
|
||||
Symbol getSymbol ( const CharacterPropertyExceptions* chpx );
|
||||
//----------------------------------------------------------------------------------------------------------------------
|
||||
bool m_bInternalXmlWriter;
|
||||
|
||||
protected:
|
||||
|
||||
WordDocument* m_document;
|
||||
ConversionContext* m_context;
|
||||
|
||||
IMapping* _caller;
|
||||
|
||||
ParagraphPropertyExceptions* _lastValidPapx;
|
||||
@ -149,5 +151,7 @@ namespace DocFileFormat
|
||||
bool _writeWebHidden;
|
||||
unsigned int _fldCharCounter;
|
||||
std::wstring _writeAfterRun;
|
||||
std::wstring _lastOLEObject;
|
||||
int _cacheListNum;
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -43,7 +43,8 @@ namespace DocFileFormat
|
||||
|
||||
/*========================================================================================================*/
|
||||
|
||||
WordDocumentProperties::WordDocumentProperties(FileInformationBlock* fib, POLE::Stream* tableStream) : doptypography(NULL), dogrid(NULL), asumyi(NULL)
|
||||
WordDocumentProperties::WordDocumentProperties(FileInformationBlock* fib, POLE::Stream* tableStream) :
|
||||
doptypography(NULL), dogrid(NULL), asumyi(NULL), bDisplayBackgroundShape(false)
|
||||
{
|
||||
Initialize();
|
||||
|
||||
@ -226,7 +227,7 @@ namespace DocFileFormat
|
||||
dywDispPag = FormatUtils::BytesToInt16( bytes, 498, size );
|
||||
|
||||
//WORD 2000, 2002, 2003 PART
|
||||
if ( size > 500 )
|
||||
if ( size > 500/* && fib->m_FibNew.nFibNew > Fib1997*/)
|
||||
{
|
||||
ilvlLastBulletMain = bytes[500];
|
||||
ilvlLastNumberMain = bytes[501];
|
||||
@ -266,138 +267,158 @@ namespace DocFileFormat
|
||||
fDntULTrlSpc = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 14 );
|
||||
fDntBlnSbDbWid = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 15 );
|
||||
fSuppressTopSpacingMac5 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 16 );
|
||||
fTruncDxaExpand = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 17 );
|
||||
fPrintBodyBeforeHdr = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 18 );
|
||||
fNoLeading = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 19 );
|
||||
fMakeSpaceForUL = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 20 );
|
||||
fMWSmallCaps = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 21 );
|
||||
f2ptExtLeadingOnly = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 22 );
|
||||
fTruncFontHeight = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 23 );
|
||||
fSubOnSize = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 24 );
|
||||
fLineWrapLikeWord6 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 25 );
|
||||
fWW6BorderRules = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 26 );
|
||||
fExactOnTop = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 27 );
|
||||
fExtraAfter = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 28 );
|
||||
fWPSpace = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 29 );
|
||||
fWPJust = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 30 );
|
||||
fPrintMet = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 31 );
|
||||
fTruncDxaExpand = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 17 );
|
||||
fPrintBodyBeforeHdr = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 18 );
|
||||
fNoLeading = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 19 );
|
||||
fMakeSpaceForUL = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 20 );
|
||||
fMWSmallCaps = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 21 );
|
||||
f2ptExtLeadingOnly = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 22 );
|
||||
fTruncFontHeight = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 23 );
|
||||
fSubOnSize = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 24 );
|
||||
fLineWrapLikeWord6 = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 25 );
|
||||
fWW6BorderRules = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 26 );
|
||||
fExactOnTop = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 27 );
|
||||
fExtraAfter = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 28 );
|
||||
fWPSpace = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 29 );
|
||||
fWPJust = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 30 );
|
||||
fPrintMet = FormatUtils::GetBitFromBytes( ( bytes + 508 ), 4, 31 );
|
||||
|
||||
//split bytes 512,513,514,515 into bits
|
||||
fSpLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 0 );
|
||||
fFtnLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 1 );
|
||||
fDontUseHTMLParagraphAutoSpacing = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 2 );
|
||||
fDontAdjustLineHeightInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 3 );
|
||||
fForgetLastTabAlign = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 4 );
|
||||
fUseAutoSpaceForFullWidthAlpha = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 5 );
|
||||
fAlignTablesRowByRow = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 6 );
|
||||
fLayoutRawTableWidth = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 7 );
|
||||
fLayoutTableRowsApart = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 8 );
|
||||
fUserWord97LineBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 9 );
|
||||
fDontBreakWrappedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 10 );
|
||||
fDontSnapToGridInCell = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 11 );
|
||||
fDontAllowFieldEndSelect = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 12 );
|
||||
fApplyBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 13 );
|
||||
fDontWrapTextWithPunct = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 14 );
|
||||
fDontUseAsianBreakRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 15 );
|
||||
fUseWord2002TableStyleRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 16 );
|
||||
fGrowAutofit = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 17 );
|
||||
fUseNormalStyleForList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 18 );
|
||||
fDontUseIndentAsNumberingTabStop = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 19 );
|
||||
fFELineBreak11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 20 );
|
||||
fAllowSpaceOfSameStyleInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 21 );
|
||||
fWW11IndentRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 22 );
|
||||
fDontAutofitConstrainedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 23 );
|
||||
fAutofitLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 24 );
|
||||
fUnderlineTabInNumList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 25 );
|
||||
fHangulWidthLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 26 );
|
||||
fSplitPgBreakAndParaMark = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 27 );
|
||||
fDontVertAlignCellWithSp = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 28 );
|
||||
fDontBreakConstrainedForcedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 29 );
|
||||
fDontVertAlignInTxbx = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 30 );
|
||||
fWord11KerningPairs = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 31 );
|
||||
fCachedColBalance = FormatUtils::GetBitFromBytes( ( bytes + 516 ), 4, 0 );
|
||||
//split bytes 512,513,514,515 into bits
|
||||
fSpLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 0 );
|
||||
fFtnLayoutLikeWW8 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 1 );
|
||||
fDontUseHTMLParagraphAutoSpacing = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 2 );
|
||||
fDontAdjustLineHeightInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 3 );
|
||||
fForgetLastTabAlign = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 4 );
|
||||
fUseAutoSpaceForFullWidthAlpha = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 5 );
|
||||
fAlignTablesRowByRow = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 6 );
|
||||
fLayoutRawTableWidth = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 7 );
|
||||
fLayoutTableRowsApart = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 8 );
|
||||
fUserWord97LineBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 9 );
|
||||
fDontBreakWrappedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 10 );
|
||||
fDontSnapToGridInCell = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 11 );
|
||||
fDontAllowFieldEndSelect = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 12 );
|
||||
fApplyBreakingRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 13 );
|
||||
fDontWrapTextWithPunct = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 14 );
|
||||
fDontUseAsianBreakRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 15 );
|
||||
fUseWord2002TableStyleRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 16 );
|
||||
fGrowAutofit = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 17 );
|
||||
fUseNormalStyleForList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 18 );
|
||||
fDontUseIndentAsNumberingTabStop = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 19 );
|
||||
fFELineBreak11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 20 );
|
||||
fAllowSpaceOfSameStyleInTable = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 21 );
|
||||
fWW11IndentRules = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 22 );
|
||||
fDontAutofitConstrainedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 23 );
|
||||
fAutofitLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 24 );
|
||||
fUnderlineTabInNumList = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 25 );
|
||||
fHangulWidthLikeWW11 = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 26 );
|
||||
fSplitPgBreakAndParaMark = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 27 );
|
||||
fDontVertAlignCellWithSp = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 28 );
|
||||
fDontBreakConstrainedForcedTables = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 29 );
|
||||
fDontVertAlignInTxbx = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 30 );
|
||||
fWord11KerningPairs = FormatUtils::GetBitFromBytes( ( bytes + 512 ), 4, 31 );
|
||||
|
||||
fCachedColBalance = FormatUtils::GetBitFromBytes( ( bytes + 516 ), 4, 0 );
|
||||
|
||||
//bytes 517-539 are unused
|
||||
//bytes 517-539 are unused
|
||||
|
||||
verCompatPreW10 = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 540 ), 4, 0, 16 );
|
||||
fNoMargPgvwSaved = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 16 );
|
||||
fNoMargPgvWPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 17 );
|
||||
fWebViewPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 18 );
|
||||
fSeeDrawingsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 19 );
|
||||
fBulletProofed = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 20 );
|
||||
fCorrupted = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 21 );
|
||||
fSaveUim = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 22 );
|
||||
fFilterPrivacy = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 23 );
|
||||
fInFReplaceNoRM = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 24 );
|
||||
fSeenRepairs = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 25 );
|
||||
fHasXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 26 );
|
||||
fSeeScriptAnchorsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 27 );
|
||||
fValidateXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 28 );
|
||||
fSaveIfInvalidXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 29 );
|
||||
fShowXMLErrors = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 30 );
|
||||
fAlwaysMergeEmptyNamespace = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 31 );
|
||||
verCompatPreW10 = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 540 ), 4, 0, 16 );
|
||||
fNoMargPgvwSaved = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 16 );
|
||||
fNoMargPgvWPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 17 );
|
||||
fWebViewPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 18 );
|
||||
fSeeDrawingsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 19 );
|
||||
fBulletProofed = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 20 );
|
||||
fCorrupted = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 21 );
|
||||
fSaveUim = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 22 );
|
||||
fFilterPrivacy = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 23 );
|
||||
fInFReplaceNoRM = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 24 );
|
||||
fSeenRepairs = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 25 );
|
||||
fHasXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 26 );
|
||||
fSeeScriptAnchorsPag = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 27 );
|
||||
fValidateXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 28 );
|
||||
fSaveIfInvalidXML = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 29 );
|
||||
fShowXMLErrors = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 30 );
|
||||
fAlwaysMergeEmptyNamespace = FormatUtils::GetBitFromBytes( ( bytes + 540 ), 4, 31 );
|
||||
|
||||
if ( size > 544/* && fib->m_FibNew.nFibNew > Fib2000*/)
|
||||
{
|
||||
cpMaxListCacheMainDoc = FormatUtils::BytesToInt32( bytes, 544, size ); //unused
|
||||
|
||||
cpMaxListCacheMainDoc = FormatUtils::BytesToInt32( bytes, 544, size );
|
||||
//split bytes 548,549 into bits
|
||||
fDoNotEmbedSystemFont = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 0 );
|
||||
fWordCompact = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 1 );
|
||||
fLiveRecover = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 2 );
|
||||
fEmbedFactoids = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 3 );
|
||||
fFactoidXML = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 4 );
|
||||
fFactoidAllDone = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 5 );
|
||||
fFolioPrint = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 6 );
|
||||
fReverseFolio = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 7 );
|
||||
iTextLineEnding = (short)FormatUtils::GetUIntFromBytesBits( ( bytes + 548 ), 2, 8, 3 );
|
||||
fHideFcc = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 11 );
|
||||
fAcetateShowMarkup = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 12 );
|
||||
fAcetateShowAtn = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 13 );
|
||||
fAcetateShowInsDel = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 14 );
|
||||
fAcetateShowProps = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 15 );
|
||||
|
||||
//split bytes 548,549 into bits
|
||||
fDoNotEmbedSystemFont = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 0 );
|
||||
fWordCompact = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 1 );
|
||||
fLiveRecover = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 2 );
|
||||
fEmbedFactoids = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 3 );
|
||||
fFactoidXML = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 4 );
|
||||
fFactoidAllDone = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 5 );
|
||||
fFolioPrint = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 6 );
|
||||
fReverseFolio = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 7 );
|
||||
iTextLineEnding = (short)FormatUtils::GetUIntFromBytesBits( ( bytes + 548 ), 2, 8, 3 );
|
||||
fHideFcc = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 11 );
|
||||
fAcetateShowMarkup = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 12 );
|
||||
fAcetateShowAtn = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 13 );
|
||||
fAcetateShowInsDel = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 14 );
|
||||
fAcetateShowProps = FormatUtils::GetBitFromBytes( ( bytes + 548 ), 2, 15 );
|
||||
istdTableDflt = FormatUtils::BytesToUInt16( bytes, 550, size );
|
||||
verCompat = FormatUtils::BytesToUInt16( bytes, 552, size );
|
||||
grfFmtFilter = FormatUtils::BytesToUInt16( bytes, 554, size );
|
||||
iFolioPages = FormatUtils::BytesToInt16 ( bytes, 556, size );
|
||||
cpgText = FormatUtils::BytesToUInt16( bytes, 558, size );
|
||||
cpMinRMText = FormatUtils::BytesToInt32 ( bytes, 560, size );
|
||||
cpMinRMFtn = FormatUtils::BytesToInt32 ( bytes, 564, size );
|
||||
cpMinRMHdd = FormatUtils::BytesToInt32 ( bytes, 568, size );
|
||||
cpMinRMAtn = FormatUtils::BytesToInt32 ( bytes, 572, size );
|
||||
cpMinRMEdn = FormatUtils::BytesToInt32 ( bytes, 576, size );
|
||||
cpMinRMTxbx = FormatUtils::BytesToInt32 ( bytes, 580, size );
|
||||
cpMinRMHdrTxbx = FormatUtils::BytesToInt32 ( bytes, 584, size );
|
||||
rsidRoot = FormatUtils::BytesToInt32 ( bytes, 588, size );
|
||||
//unused 2
|
||||
|
||||
istdTableDflt = FormatUtils::BytesToUInt16( bytes, 550, size );
|
||||
verCompat = FormatUtils::BytesToUInt16( bytes, 552, size );
|
||||
grfFmtFilter = FormatUtils::BytesToUInt16( bytes, 554, size );
|
||||
iFolioPages = FormatUtils::BytesToInt16( bytes, 556, size );
|
||||
cpgText = FormatUtils::BytesToUInt16( bytes, 558, size );
|
||||
cpMinRMText = FormatUtils::BytesToInt32( bytes, 560, size );
|
||||
cpMinRMFtn = FormatUtils::BytesToInt32( bytes, 564, size );
|
||||
cpMinRMHdd = FormatUtils::BytesToInt32( bytes, 568, size );
|
||||
cpMinRMAtn = FormatUtils::BytesToInt32( bytes, 572, size );
|
||||
cpMinRMEdn = FormatUtils::BytesToInt32( bytes, 576, size );
|
||||
cpMinRMTxbx = FormatUtils::BytesToInt32( bytes, 580, size );
|
||||
cpMinRMHdrTxbx = FormatUtils::BytesToInt32( bytes, 584, size );
|
||||
rsidRoot = FormatUtils::BytesToInt32( bytes, 588, size );
|
||||
if ( size > 594/* && fib->m_FibNew.nFibNew > Fib2002*/)
|
||||
{
|
||||
//split bytes 592,593,594,595 into bits
|
||||
fTreatLockAtnAsReadOnly = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 0 );
|
||||
fStyleLock = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 1 );
|
||||
fAutoFmtOverride = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 2 );
|
||||
fRemoveWordML = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 3 );
|
||||
fApplyCustomXForm = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 4 );
|
||||
fStyeLockEnforced = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 5 );
|
||||
fFakeLockAtn = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 6 );
|
||||
fIgnoreMixedContent = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 7 );
|
||||
fShowPlaceholderText = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 8 );
|
||||
grf = FormatUtils::GetUIntFromBytesBits( ( bytes + 592 ), 4, 9, 23 );
|
||||
|
||||
if ( size == 610 )
|
||||
{
|
||||
//split bytes 592,593,594,595 into bits
|
||||
fTreatLockAtnAsReadOnly = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 0 );
|
||||
fStyleLock = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 1 );
|
||||
fAutoFmtOverride = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 2 );
|
||||
fRemoveWordML = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 3 );
|
||||
fApplyCustomXForm = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 4 );
|
||||
fStyeLockEnforced = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 5 );
|
||||
fFakeLockAtn = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 6 );
|
||||
fIgnoreMixedContent = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 7 );
|
||||
fShowPlaceholderText = FormatUtils::GetBitFromBytes( ( bytes + 592 ), 4, 8 );
|
||||
grf = FormatUtils::GetUIntFromBytesBits( ( bytes + 592 ), 4, 9, 23 );
|
||||
//split bytes 596 and 597 into bits
|
||||
fReadingModeInkLockDown = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 0 );
|
||||
fAcetateShowInkAtn = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 1 );
|
||||
fFilterDttm = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 2 );
|
||||
fEnforceDocProt = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 3 );
|
||||
iDocProtCur = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 596 ), 2, 4, 3 );
|
||||
fDispBkSpSaved = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 7 );
|
||||
|
||||
//split bytes 596 and 597 into bits
|
||||
fReadingModeInkLockDown = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 0 );
|
||||
fAcetateShowInkAtn = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 1 );
|
||||
fFilterDttm = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 2 );
|
||||
fEnforceDocProt = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 3 );
|
||||
iDocProtCur = (unsigned short)FormatUtils::GetUIntFromBytesBits( ( bytes + 596 ), 2, 4, 3 );
|
||||
fDispBkSpSaved = FormatUtils::GetBitFromBytes( ( bytes + 596 ), 2, 7 );
|
||||
|
||||
dxaPageLock = FormatUtils::BytesToInt16( bytes, 598, size );
|
||||
dyaPageLock = FormatUtils::BytesToInt16( bytes, 600, size );
|
||||
pctFontLock = FormatUtils::BytesToInt32( bytes, 602, size );
|
||||
grfitbid = bytes[606];
|
||||
//unsigned char 607 is unused
|
||||
ilfoMacAtCleanup = FormatUtils::BytesToUInt16( bytes, 608, size );
|
||||
}
|
||||
dxaPageLock = FormatUtils::BytesToInt16( bytes, 598, size );
|
||||
dyaPageLock = FormatUtils::BytesToInt16( bytes, 600, size );
|
||||
pctFontLock = FormatUtils::BytesToInt32( bytes, 602, size );
|
||||
grfitbid = bytes[606];
|
||||
//unsigned char 607 is unused
|
||||
ilfoMacAtCleanup = FormatUtils::BytesToUInt16( bytes, 608, size );
|
||||
|
||||
if ( size > 616/* && fib->m_FibNew.nFibNew > Fib2003*/)
|
||||
{
|
||||
//4 bytes reserved
|
||||
bool fRMTrackFormatting = FormatUtils::GetBitFromBytes( ( bytes + 620 ), 2, 0 );
|
||||
bool fRMTrackMoves = FormatUtils::GetBitFromBytes( ( bytes + 620 ), 2, 1 );
|
||||
//dopMth = 34 bytes from 624 = 658
|
||||
|
||||
if ( size > 674/* && fib->m_FibNew.nFibNew > Fib2007*/)
|
||||
{
|
||||
if ( size > 690/* && fib->m_FibNew.nFibNew > Fib2010*/)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -54,6 +54,7 @@ namespace DocFileFormat
|
||||
|
||||
friend class SettingsMapping;
|
||||
|
||||
bool bDisplayBackgroundShape;
|
||||
private:
|
||||
// True when facing pages should be printed
|
||||
bool fFacingPages;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -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)
|
||||
@ -49,39 +49,46 @@ namespace DocFileFormat
|
||||
unsigned char fNested:1;
|
||||
unsigned char fHasSep:1;
|
||||
};
|
||||
|
||||
public:
|
||||
static const int STRUCTURE_SIZE = 2;
|
||||
|
||||
FieldCharacter():
|
||||
fldch(0), grffld(0)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~FieldCharacter()
|
||||
{
|
||||
}
|
||||
FieldCharacter() : fldch(0), grffld(0) {}
|
||||
virtual ~FieldCharacter() {}
|
||||
|
||||
virtual ByteStructure* ConstructObject (VirtualStreamReader* pReader, int length)
|
||||
{
|
||||
FieldCharacter* pFldChar = new FieldCharacter();
|
||||
FieldCharacter* pFldChar = new FieldCharacter();
|
||||
if (pFldChar)
|
||||
{
|
||||
pFldChar->fldch = pReader->ReadByte();
|
||||
pFldChar->grffld = pReader->ReadByte();
|
||||
|
||||
#ifdef _DEBUG
|
||||
grffldEnd* __grffldEnd = (grffldEnd*)(&pFldChar->grffld);
|
||||
int dbg = 0;
|
||||
#endif
|
||||
pFldChar->fldch = pReader->ReadByte();
|
||||
pFldChar->grffld = pReader->ReadByte();
|
||||
}
|
||||
|
||||
return static_cast<ByteStructure*>(pFldChar);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
unsigned char fldch;
|
||||
unsigned char grffld;
|
||||
};
|
||||
|
||||
class ListNumCache: public ByteStructure
|
||||
{
|
||||
public:
|
||||
static const int STRUCTURE_SIZE = 4;
|
||||
|
||||
ListNumCache() : value(-1) {}
|
||||
virtual ~ListNumCache() {}
|
||||
|
||||
virtual ByteStructure* ConstructObject (VirtualStreamReader* pReader, int length)
|
||||
{
|
||||
ListNumCache* pList = new ListNumCache();
|
||||
if (pList)
|
||||
{
|
||||
pList->value = pReader->ReadInt32();
|
||||
}
|
||||
|
||||
return static_cast<ByteStructure*>(pList);
|
||||
}
|
||||
|
||||
int value;
|
||||
};
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -1162,6 +1162,8 @@ namespace DocFileFormat
|
||||
{
|
||||
//Read the FibRgCswNew
|
||||
m_FibNew.nFibNew = (FibVersion)reader.ReadUInt16();
|
||||
|
||||
if (m_FibNew.nFibNew == 0) m_FibNew.nFibNew = Fib1997;
|
||||
m_FibNew.cQuickSavesNew = reader.ReadUInt16();
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
@ -40,7 +40,7 @@ namespace DocFileFormat
|
||||
_type = type;
|
||||
}
|
||||
|
||||
LanguageIdMapping::LanguageIdMapping (XMLTools::XMLElement<wchar_t>* parentElement, LanguageType type) : PropertiesMapping(NULL)
|
||||
LanguageIdMapping::LanguageIdMapping (XMLTools::XMLElement* parentElement, LanguageType type) : PropertiesMapping(NULL)
|
||||
{
|
||||
_parent = parentElement;
|
||||
_type = type;
|
||||
@ -59,31 +59,31 @@ namespace DocFileFormat
|
||||
{
|
||||
std::wstring langcode = getLanguageCode( dynamic_cast<LanguageId*>( lid ) );
|
||||
|
||||
XMLTools::XMLAttribute<wchar_t>* att = NULL;
|
||||
XMLTools::XMLAttribute* att = NULL;
|
||||
|
||||
switch ( _type )
|
||||
{
|
||||
case Default:
|
||||
{
|
||||
att = new XMLTools::XMLAttribute<wchar_t>( L"w:val", langcode.c_str() );
|
||||
att = new XMLTools::XMLAttribute( L"w:val", langcode);
|
||||
}
|
||||
break;
|
||||
|
||||
case EastAsian:
|
||||
{
|
||||
att = new XMLTools::XMLAttribute<wchar_t>( L"w:eastAsia", langcode.c_str() );
|
||||
att = new XMLTools::XMLAttribute( L"w:eastAsia", langcode);
|
||||
}
|
||||
break;
|
||||
|
||||
case Complex:
|
||||
{
|
||||
att = new XMLTools::XMLAttribute<wchar_t>( L"w:bidi", langcode.c_str() );
|
||||
att = new XMLTools::XMLAttribute( L"w:bidi", langcode);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
att = new XMLTools::XMLAttribute<wchar_t>( L"w:val", langcode.c_str() );
|
||||
att = new XMLTools::XMLAttribute( L"w:val", langcode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -91,7 +91,7 @@ namespace DocFileFormat
|
||||
if (m_pXmlWriter)
|
||||
{
|
||||
// !!!TODO!!!
|
||||
m_pXmlWriter->WriteString( att->GetXMLString().c_str() );
|
||||
m_pXmlWriter->WriteString( att->GetXMLString());
|
||||
}
|
||||
else if ( _parent != NULL )
|
||||
{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -49,14 +49,14 @@ namespace DocFileFormat
|
||||
{
|
||||
public:
|
||||
LanguageIdMapping( XMLTools::CStringXmlWriter* writer, LanguageType type );
|
||||
LanguageIdMapping( XMLTools::XMLElement<wchar_t>* parentElement, LanguageType type );
|
||||
LanguageIdMapping( XMLTools::XMLElement* parentElement, LanguageType type );
|
||||
virtual ~LanguageIdMapping();
|
||||
void Apply( IVisitable* lid );
|
||||
|
||||
static std::wstring getLanguageCode( LanguageId* lid );
|
||||
|
||||
private:
|
||||
LanguageType _type;
|
||||
XMLTools::XMLElement<wchar_t>* _parent;
|
||||
LanguageType _type;
|
||||
XMLTools::XMLElement* _parent;
|
||||
};
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
@ -53,33 +53,47 @@ namespace DocFileFormat
|
||||
m_context->_docx->RegisterDocument();
|
||||
|
||||
// Header
|
||||
m_pXmlWriter->WriteNodeBegin(_T("?xml version=\"1.0\" encoding=\"UTF-8\"?"));
|
||||
m_pXmlWriter->WriteNodeBegin(_T("w:document"), TRUE );
|
||||
m_pXmlWriter->WriteNodeBegin(L"?xml version=\"1.0\" encoding=\"UTF-8\"?");
|
||||
m_pXmlWriter->WriteNodeBegin(L"w:document", TRUE );
|
||||
|
||||
// Namespaces
|
||||
m_pXmlWriter->WriteAttribute(_T("xmlns:w"), OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute(_T("xmlns:v"), OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute(_T("xmlns:o"), OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute(_T("xmlns:w10"), OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute(_T("xmlns:r"), OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteAttribute(_T("xmlns:m"), _T("http://schemas.openxmlformats.org/officeDocument/2006/math"));
|
||||
m_pXmlWriter->WriteAttribute(L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_pXmlWriter->WriteAttribute(L"xmlns:v", OpenXmlNamespaces::VectorML );
|
||||
m_pXmlWriter->WriteAttribute(L"xmlns:o", OpenXmlNamespaces::Office );
|
||||
m_pXmlWriter->WriteAttribute(L"xmlns:w10", OpenXmlNamespaces::OfficeWord );
|
||||
m_pXmlWriter->WriteAttribute(L"xmlns:r", OpenXmlNamespaces::Relationships );
|
||||
m_pXmlWriter->WriteAttribute(L"xmlns:m", L"http://schemas.openxmlformats.org/officeDocument/2006/math");
|
||||
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpc"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:mc"), _T("http://schemas.openxmlformats.org/markup-compatibility/2006"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wp14"),_T("http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wp"), _T("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:w14"), _T("http://schemas.microsoft.com/office/word/2010/wordml"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpg"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wpi"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingInk"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wne"), _T("http://schemas.microsoft.com/office/word/2006/wordml"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("xmlns:wps"), _T("http://schemas.microsoft.com/office/word/2010/wordprocessingShape"));
|
||||
//m_pXmlWriter->WriteAttribute(_T("mc:Ignorable"), _T("w14 wp14"));
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wpc", L"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wp14", L"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wp", L"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:w14", L"http://schemas.microsoft.com/office/word/2010/wordml");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wpg", L"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wpi", L"http://schemas.microsoft.com/office/word/2010/wordprocessingInk");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wne", L"http://schemas.microsoft.com/office/word/2006/wordml");
|
||||
//m_pXmlWriter->WriteAttribute(L"xmlns:wps", L"http://schemas.microsoft.com/office/word/2010/wordprocessingShape");
|
||||
//m_pXmlWriter->WriteAttribute(L"mc:Ignorable", L"w14 wp14");
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "" ), TRUE, FALSE );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( _T("w:body"), FALSE );
|
||||
if ((m_document->GetOfficeArt()) && (m_document->GetOfficeArt()->GetShapeBackgound()))
|
||||
{
|
||||
m_document->DocProperties->bDisplayBackgroundShape = true;
|
||||
ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeBackgound();
|
||||
|
||||
// Convert the document
|
||||
m_pXmlWriter->WriteNodeBegin ( L"w:background", TRUE);
|
||||
m_pXmlWriter->WriteAttribute ( L"w:color", L"FFFFFF");
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, NULL, NULL, _caller);
|
||||
pShape->Convert(&oVmlWriter);
|
||||
m_pXmlWriter->WriteNodeEnd (L"w:background");
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:body", FALSE );
|
||||
|
||||
// Convert the document
|
||||
_lastValidPapx = NULL;
|
||||
if (m_document->AllPapxFkps->empty() == false)
|
||||
{
|
||||
@ -175,8 +189,8 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:body" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( _T( "w:document" ) );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:body" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:document" );
|
||||
|
||||
m_context->_docx->DocumentXML = std::wstring(m_pXmlWriter->GetXmlString());
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -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)
|
||||
@ -34,6 +34,7 @@
|
||||
#include "OfficeDrawing/RecordFactory.h"
|
||||
|
||||
#include "OfficeDrawing/DrawingContainer.h"
|
||||
#include "OfficeDrawing/DrawingRecord.h"
|
||||
#include "OfficeDrawing/DrawingGroup.h"
|
||||
#include "OfficeDrawing/GroupContainer.h"
|
||||
#include "OfficeDrawing/Shape.h"
|
||||
@ -57,7 +58,7 @@ namespace DocFileFormat
|
||||
|
||||
public:
|
||||
|
||||
OfficeArtContent (const FileInformationBlock* pFIB, POLE::Stream* pStream): m_pDrawingGroupData(NULL)
|
||||
OfficeArtContent (const FileInformationBlock* pFIB, POLE::Stream* pStream): m_pDrawingGroupData(NULL), m_pBackgroud(NULL)
|
||||
{
|
||||
VirtualStreamReader oStearmReader(pStream, 0 , pFIB->m_bOlderVersion);
|
||||
|
||||
@ -87,15 +88,23 @@ namespace DocFileFormat
|
||||
{
|
||||
// the child is a subgroup
|
||||
GroupContainer* group = static_cast<GroupContainer*>(groupChild);
|
||||
group->Index = i;
|
||||
drawing.container->Children[i] = group;
|
||||
if (group)
|
||||
{
|
||||
group->Index = i;
|
||||
}
|
||||
}
|
||||
else if (ShapeContainer::TYPE_CODE_0xF004 == groupChild->TypeCode)
|
||||
{
|
||||
// the child is a shape
|
||||
ShapeContainer* shape = static_cast<ShapeContainer*>(groupChild);
|
||||
shape->Index = i;
|
||||
drawing.container->Children[i] = shape;
|
||||
if (shape)
|
||||
{
|
||||
shape->Index = i;
|
||||
if (shape->isBackground())
|
||||
{
|
||||
m_pBackgroud = shape;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -112,7 +121,10 @@ namespace DocFileFormat
|
||||
for ( std::list<OfficeArtWordDrawing>::iterator iter = m_arrDrawings.begin(); iter != m_arrDrawings.end(); ++iter)
|
||||
RELEASEOBJECT(iter->container);
|
||||
}
|
||||
|
||||
inline ShapeContainer* GetShapeBackgound()
|
||||
{
|
||||
return m_pBackgroud;
|
||||
}
|
||||
inline ShapeContainer* GetShapeContainer (int spid)
|
||||
{
|
||||
ShapeContainer* ret = NULL;
|
||||
@ -138,7 +150,6 @@ namespace DocFileFormat
|
||||
if (shape->GetShapeID() == spid)
|
||||
{
|
||||
ret = container;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -150,7 +161,7 @@ namespace DocFileFormat
|
||||
|
||||
if (shape->GetShapeID() == spid)
|
||||
{
|
||||
ret = container;
|
||||
ret = container;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -174,7 +185,7 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
ShapeContainer* m_pBackgroud;
|
||||
DrawingGroup* m_pDrawingGroupData;
|
||||
std::list<OfficeArtWordDrawing> m_arrDrawings;
|
||||
};
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2016
|
||||
* (c) Copyright Ascensio System SIA 2010-2017
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
|
||||
@ -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)
|
||||
@ -39,11 +39,9 @@ namespace DocFileFormat
|
||||
{
|
||||
public:
|
||||
static const unsigned short TYPE_CODE_0xF008 = 0xF008;
|
||||
|
||||
/// The number of shapes in this drawing
|
||||
unsigned int csp;
|
||||
/// The last MSOSPID given to an SP in this DG
|
||||
int spidCur;
|
||||
|
||||
unsigned int csp; // The number of shapes in this drawing
|
||||
int spidCur; // The last MSOSPID given to an SP in this DG
|
||||
|
||||
DrawingRecord():
|
||||
Record(), csp(0), spidCur(0)
|
||||
@ -53,8 +51,8 @@ namespace DocFileFormat
|
||||
DrawingRecord( IBinaryReader* _reader, unsigned int size, unsigned int typeCode, unsigned int version, unsigned int instance ):
|
||||
Record( _reader, size, typeCode, version, instance )
|
||||
{
|
||||
this->csp = this->Reader->ReadUInt32();
|
||||
this->spidCur = this->Reader->ReadInt32();
|
||||
csp = Reader->ReadUInt32();
|
||||
spidCur = Reader->ReadInt32();
|
||||
}
|
||||
|
||||
virtual ~DrawingRecord()
|
||||
|
||||
@ -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