mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-15 20:36:10 +08:00
Compare commits
210 Commits
core-linux
...
core-linux
| Author | SHA1 | Date | |
|---|---|---|---|
| 7014faa9a1 | |||
| 93287c84c8 | |||
| dafcbacfaf | |||
| 1c73ff0c3f | |||
| 5a8c9069be | |||
| 4ba2e1fa6d | |||
| 95af281145 | |||
| 00fb2ba7bb | |||
| 0f65e36517 | |||
| aa1af73fda | |||
| 1610978821 | |||
| 20faf24556 | |||
| ae90e4ae96 | |||
| 6fae9115ea | |||
| c14a21b2da | |||
| b952692225 | |||
| 23249e69f9 | |||
| 09f6c3f4e8 | |||
| 111ceff368 | |||
| 867b0634f3 | |||
| f9c27275a7 | |||
| dd12ee0b9e | |||
| de83971832 | |||
| 0d158e46b5 | |||
| dde6b8bdc7 | |||
| b66bb0d63f | |||
| d666da2697 | |||
| 8e35f9b063 | |||
| 25268b706d | |||
| 97ff1efba8 | |||
| 1879ce8dbb | |||
| 50ff5fc0b2 | |||
| 537e774f79 | |||
| 6d3761c20b | |||
| ee41b4ccb2 | |||
| 7b0f902c0f | |||
| e6039f7f6f | |||
| 1c2b86519e | |||
| 755119c825 | |||
| 3a73480437 | |||
| 323d1b44cd | |||
| a99a195c68 | |||
| 0d979b8033 | |||
| dd3b671e57 | |||
| 74bd059607 | |||
| 83fa44edcd | |||
| 80fe4c0164 | |||
| 04f7527f9e | |||
| d92aa1f793 | |||
| af4e135fe2 | |||
| a5ef8c01b3 | |||
| 1b7f35b317 | |||
| 4079dea224 | |||
| 2ead42a513 | |||
| 427046cb8f | |||
| f4c112d523 | |||
| b082ffe20c | |||
| c589a6c947 | |||
| e60cc05b6e | |||
| 15b08aeebf | |||
| 672129c242 | |||
| 92689a7a57 | |||
| 31ebd7b14c | |||
| 1695668a6f | |||
| 77dfd5c12a | |||
| e600fe93b7 | |||
| 889a1f827a | |||
| 8cd55fb9c4 | |||
| 01b9309f09 | |||
| d3a4f00f76 | |||
| f65196d95b | |||
| 3ee5d685c2 | |||
| c0cd75dbd5 | |||
| a69453af4b | |||
| 3adcfecfb9 | |||
| a7d2191649 | |||
| db50e87fe0 | |||
| 36bdc7376a | |||
| 1321211336 | |||
| 8c834c5041 | |||
| c75aacaed8 | |||
| a4445cacaa | |||
| d6ad9e84e2 | |||
| d9687387f9 | |||
| eaa01c7995 | |||
| 597f360336 | |||
| d502206726 | |||
| d0d90c641c | |||
| 14fa14de3f | |||
| cced8f4912 | |||
| 2e40b96ed9 | |||
| 50ee7d7cc1 | |||
| f9b54bffd4 | |||
| a52a8e982e | |||
| 128529ba80 | |||
| a571c88798 | |||
| 34bb84a792 | |||
| 92d0d0d7ea | |||
| 449e3fc131 | |||
| ce9fdb33b5 | |||
| 2591f0a202 | |||
| 6bc04fc06f | |||
| 047850dbd6 | |||
| 465b903ec5 | |||
| 6afa54ebef | |||
| 27a0e77ef1 | |||
| c7b45910f8 | |||
| ab1abb96fe | |||
| 566d9e68e4 | |||
| 243b8eccdd | |||
| 76b682063e | |||
| effdab1ff4 | |||
| 658040f77b | |||
| 48aa99af83 | |||
| a1b738fc42 | |||
| 00e9ce56df | |||
| 2a4ce1f93f | |||
| 261e48227d | |||
| 29e3f90ebf | |||
| d4a70d306f | |||
| b9b843f25d | |||
| d7e2bedc6b | |||
| 234459f37c | |||
| 58cd45f4ee | |||
| 33f7ee49df | |||
| e7ed48af49 | |||
| cbd79c902e | |||
| 40c24b1577 | |||
| 95a49140cb | |||
| aad12cf471 | |||
| f0ffb7f14c | |||
| da329135e1 | |||
| 60ca9a2347 | |||
| 5fdace28d2 | |||
| 85549c5b20 | |||
| 4c8bc2227a | |||
| 23ca735f23 | |||
| 4acefb020f | |||
| 684d697cae | |||
| 1aa604c584 | |||
| 51569b626f | |||
| 89d7eb559d | |||
| f6b3a78fe8 | |||
| 1900e2f0a0 | |||
| d0e1785086 | |||
| 221d1ecbb5 | |||
| 2fc3b140d0 | |||
| bdb2ca8241 | |||
| 4055201322 | |||
| 5b305ec75d | |||
| 433686c01f | |||
| ccfc921883 | |||
| 6b0d6fe890 | |||
| 5ae20c58ed | |||
| 7b45fb8931 | |||
| d0ffc6f555 | |||
| 54e5bb8419 | |||
| f7bb1766c0 | |||
| f0bb87ba14 | |||
| a484dc1fd7 | |||
| 19cc78060c | |||
| 2682eda9c6 | |||
| 8d750adb7b | |||
| c517b3ac19 | |||
| f57b28cd24 | |||
| b8215e9e82 | |||
| f6305fca21 | |||
| 4cb984684d | |||
| 903d903aad | |||
| fe53ae9b11 | |||
| 8ca218d600 | |||
| 48a1f01220 | |||
| 8a2923e534 | |||
| 0ab7e55add | |||
| cb1cb43a0b | |||
| 0ca3432d05 | |||
| 50208be48d | |||
| c796f4a0f6 | |||
| 618da3c8cc | |||
| 9b4568e81a | |||
| 752acf1e46 | |||
| d9afc49bb3 | |||
| 4c6ba8ed41 | |||
| a0b32c1523 | |||
| a2cc70233e | |||
| 42c35a9803 | |||
| 8100a2860f | |||
| c4abf6d149 | |||
| c749cbf081 | |||
| c7accf4370 | |||
| 322bc72ad1 | |||
| 33bf2df39d | |||
| aa344408b0 | |||
| 2a5d29c874 | |||
| 3e9e70655c | |||
| ed9a6e7e5c | |||
| 284b04574a | |||
| 67eb5ac139 | |||
| 563014f8d7 | |||
| 290d845d7a | |||
| 935e9396af | |||
| 4de2649dcd | |||
| a8bcd38bce | |||
| 46bc4e5e96 | |||
| 56475b7e8a | |||
| 69a69d9fc2 | |||
| 7d2f96d284 | |||
| e753476826 | |||
| 983873d010 | |||
| af037642dd |
7
.gitignore
vendored
7
.gitignore
vendored
@ -13,6 +13,11 @@ Common/3dParty/cef/win_32
|
||||
Common/3dParty/cef/linux_64
|
||||
Common/3dParty/cef/linux_32
|
||||
Common/3dParty/cef/mac_64
|
||||
Common/3dParty/curl/win_64
|
||||
Common/3dParty/curl/win_32
|
||||
Common/3dParty/curl/linux_64
|
||||
Common/3dParty/curl/linux_32
|
||||
Common/3dParty/curl/mac_64
|
||||
Common/3dParty/v8/v8
|
||||
Common/3dParty/v8/depot_tools
|
||||
Common/3dParty/v8/win_64
|
||||
@ -40,6 +45,8 @@ ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_i.c
|
||||
ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_p.c
|
||||
ASCOfficeXlsFile2/win32/dlldata.c
|
||||
OfficeUtils/win32/OfficeUtilsLib/OfficeUtilsLib/ReadMe.txt
|
||||
X2tConverter/**/Makefile.*
|
||||
*.7z
|
||||
*.obj
|
||||
*.pdb
|
||||
*.tlb
|
||||
|
||||
@ -58,6 +58,9 @@
|
||||
|
||||
#include <boost/format.hpp>
|
||||
|
||||
#define GETBITS(from, numL, numH) ((from & (((1 << (numH - numL + 1)) - 1) << numL)) >> numL)
|
||||
#define GETBIT(from, num) ((from & (1 << num)) != 0)
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
typedef unsigned char Bool8;
|
||||
@ -638,14 +641,12 @@ namespace DocFileFormat
|
||||
else
|
||||
{
|
||||
std::string sCodePage;
|
||||
for (int i = 0; i < UNICODE_CONVERTER_ENCODINGS_COUNT; ++i)
|
||||
std::map<int, std::string>::const_iterator pFind = NSUnicodeConverter::mapEncodingsICU.find(code_page);
|
||||
if (pFind != NSUnicodeConverter::mapEncodingsICU.end())
|
||||
{
|
||||
if (code_page == NSUnicodeConverter::Encodings[i].WindowsCodePage)
|
||||
{
|
||||
sCodePage = NSUnicodeConverter::Encodings[i].Name;
|
||||
break;
|
||||
}
|
||||
sCodePage = pFind->second;
|
||||
}
|
||||
|
||||
if (sCodePage.empty())
|
||||
sCodePage = "CP1250"/* + std::to_string(code_page)*/;
|
||||
|
||||
|
||||
@ -72,10 +72,14 @@ namespace DocFileFormat
|
||||
{
|
||||
AnnotationReferenceDescriptor* atrdPre10 = static_cast<AnnotationReferenceDescriptor*>(m_document->AnnotationsReferencePlex->Elements[index]);
|
||||
|
||||
unsigned short index_author = atrdPre10->GetAuthorIndex();
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:comment", TRUE );
|
||||
m_pXmlWriter->WriteAttribute( L"w:id", FormatUtils::IntToWideString( index + 1 ));
|
||||
m_pXmlWriter->WriteAttribute( L"w:author",
|
||||
FormatUtils::XmlEncode(m_document->AnnotationOwners->at( atrdPre10->GetAuthorIndex() ) ));
|
||||
if (index_author < m_document->AnnotationOwners->size()) //conv_253l2H1CehgKwsxCtNk__docx.doc
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"w:author",
|
||||
FormatUtils::XmlEncode(m_document->AnnotationOwners->at( index_author ) ));
|
||||
}
|
||||
m_pXmlWriter->WriteAttribute( L"w:initials", atrdPre10->GetUserInitials());
|
||||
|
||||
//!!!TODO!!!
|
||||
|
||||
@ -1294,46 +1294,65 @@ namespace DocFileFormat
|
||||
ParagraphPropertyExceptions* papx_prev = NULL;
|
||||
|
||||
short max_boundary = -1;
|
||||
short count_column = 0;
|
||||
|
||||
bool fEndNestingLevel = false;
|
||||
|
||||
unsigned int iTap_current = 1;
|
||||
|
||||
while ( tai.fInTable )
|
||||
{
|
||||
short current_count_column = 0;
|
||||
//check all SPRMs of this TAPX
|
||||
iTap_current = 1;
|
||||
|
||||
for ( std::list<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); iter != papx->grpprl->end(); iter++ )
|
||||
{
|
||||
//find the tDef SPRM
|
||||
DWORD code = iter->OpCode;
|
||||
|
||||
switch(iter->OpCode)
|
||||
{
|
||||
case sprmTDefTable:
|
||||
case sprmOldTDefTable:
|
||||
case sprmPFInnerTableCell:
|
||||
case sprmPFInnerTtp:
|
||||
{
|
||||
//SprmTDefTable tdef(iter->Arguments, iter->argumentsSize);
|
||||
//int itcMac = tdef.numberOfColumns;
|
||||
fEndNestingLevel = ( iter->Arguments[0] == 1 ) ? (true) : (false);
|
||||
}break;
|
||||
|
||||
unsigned char itcMac = iter->Arguments[0];
|
||||
|
||||
short boundary1, boundary2;
|
||||
for (unsigned char i = 0; i < itcMac; i++)
|
||||
{
|
||||
boundary1 = FormatUtils::BytesToInt16( iter->Arguments + 1, i * 2 , iter->argumentsSize );
|
||||
boundary2 = FormatUtils::BytesToInt16( iter->Arguments + 1, ( i + 1 ) * 2, iter->argumentsSize );
|
||||
|
||||
AddBoundary(boundary1, boundary2, boundaries);
|
||||
}
|
||||
if (max_boundary < boundary2)
|
||||
max_boundary = boundary2;
|
||||
|
||||
AddBoundary(boundary2, max_boundary, boundaries);
|
||||
case sprmPItap:
|
||||
{
|
||||
iTap_current = FormatUtils::BytesToUInt32( iter->Arguments, 0, iter->argumentsSize );
|
||||
}break;
|
||||
}
|
||||
}
|
||||
if (nestingLevel == iTap_current)
|
||||
{
|
||||
for ( std::list<SinglePropertyModifier>::iterator iter = papx->grpprl->begin(); iter != papx->grpprl->end(); iter++ )
|
||||
{
|
||||
//find the tDef SPRM
|
||||
DWORD code = iter->OpCode;
|
||||
|
||||
if (current_count_column > count_column)
|
||||
count_column = current_count_column;
|
||||
switch(iter->OpCode)
|
||||
{
|
||||
case sprmTDefTable:
|
||||
case sprmOldTDefTable:
|
||||
{
|
||||
unsigned char itcMac = iter->Arguments[0];
|
||||
|
||||
short boundary1, boundary2;
|
||||
for (unsigned char i = 0; i < itcMac; i++)
|
||||
{
|
||||
boundary1 = FormatUtils::BytesToInt16( iter->Arguments + 1, i * 2 , iter->argumentsSize );
|
||||
boundary2 = FormatUtils::BytesToInt16( iter->Arguments + 1, ( i + 1 ) * 2, iter->argumentsSize );
|
||||
|
||||
AddBoundary(boundary1, boundary2, boundaries);
|
||||
}
|
||||
if (max_boundary < boundary2)
|
||||
max_boundary = boundary2;
|
||||
|
||||
AddBoundary(boundary2, max_boundary, boundaries);
|
||||
}break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nestingLevel > 1 && fEndNestingLevel && !boundaries.empty())
|
||||
break;
|
||||
//get the next papx
|
||||
papx = findValidPapx( fcRowEnd );
|
||||
tai = TableInfo( papx, m_document->nWordVersion );
|
||||
@ -1342,6 +1361,7 @@ namespace DocFileFormat
|
||||
if (papx_prev && papx_prev == papx )
|
||||
break;//file(12).doc
|
||||
papx_prev = papx;
|
||||
|
||||
}
|
||||
|
||||
if ( !boundaries.empty() )
|
||||
@ -1358,7 +1378,7 @@ namespace DocFileFormat
|
||||
|
||||
void DocumentMapping::AddBoundary(short boundary1, short boundary2, std::map<short, short> &boundaries)
|
||||
{
|
||||
if (boundary2 - boundary1 < 10)
|
||||
if (boundary2 - boundary1 < 3)
|
||||
return;
|
||||
|
||||
std::map<short, short>::iterator pFind = boundaries.find(boundary1);
|
||||
@ -1582,10 +1602,8 @@ namespace DocFileFormat
|
||||
int cp = initialCp;
|
||||
int cpCellEnd = findCellEndCp( initialCp, nestingLevel );
|
||||
|
||||
//start w:tc
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:tc" );
|
||||
|
||||
TableCellPropertiesMapping* tcpMapping = new TableCellPropertiesMapping( m_pXmlWriter, grid, gridIndex, cellIndex );
|
||||
XMLTools::CStringXmlWriter writerTcPr;
|
||||
TableCellPropertiesMapping* tcpMapping = new TableCellPropertiesMapping( &writerTcPr, grid, gridIndex, cellIndex, nestingLevel );
|
||||
|
||||
if ( tapx != NULL )
|
||||
{
|
||||
@ -1594,8 +1612,19 @@ namespace DocFileFormat
|
||||
|
||||
gridIndex = gridIndex + tcpMapping->GetGridSpan();
|
||||
|
||||
bool bCoverCell = tcpMapping->IsCoverCell();
|
||||
|
||||
RELEASEOBJECT( tcpMapping );
|
||||
|
||||
if (bCoverCell)
|
||||
{
|
||||
return cpCellEnd;
|
||||
}
|
||||
|
||||
//start w:tc
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:tc" );
|
||||
m_pXmlWriter->WriteString(writerTcPr.GetXmlString());
|
||||
|
||||
//write the paragraphs of the cell
|
||||
while ( cp < cpCellEnd )
|
||||
{
|
||||
|
||||
@ -53,7 +53,7 @@ namespace DocFileFormat
|
||||
/*========================================================================================================*/
|
||||
|
||||
FormattedDiskPageCHPX::FormattedDiskPageCHPX( POLE::Stream* wordStream, int offset, int nWordVersion ):
|
||||
FormattedDiskPage(), rgb(NULL), grpchpxSize(NULL), grpchpx(NULL)
|
||||
FormattedDiskPage(), rgb(NULL), grpchpxSize(0), grpchpx(NULL)
|
||||
{
|
||||
Type = Character;
|
||||
WordStream = wordStream;
|
||||
|
||||
@ -34,8 +34,8 @@
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
std::map<unsigned char, std::wstring> PropertiesMapping::brcTypeMap;
|
||||
OfficeCriticalSection PropertiesMapping::brcTypeMapLock;
|
||||
std::map<unsigned char, std::wstring> PropertiesMapping::brcTypeMap;
|
||||
NSCriticalSection::CRITICAL_SECTION_SMART PropertiesMapping::brcTypeMapLock;
|
||||
|
||||
void PropertiesMapping::init()
|
||||
{
|
||||
|
||||
@ -39,8 +39,7 @@
|
||||
#include "ShadingDescriptor.h"
|
||||
#include "SinglePropertyModifier.h"
|
||||
|
||||
|
||||
#include "../../OfficeUtils/src/ASCOfficeCriticalSection.h" //for linux make inside
|
||||
#include "../../DesktopEditor/graphics/TemporaryCS.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
@ -75,7 +74,7 @@ namespace DocFileFormat
|
||||
|
||||
XMLTools::CStringXmlWriter* m_pXmlWriter;
|
||||
|
||||
static std::map<unsigned char, std::wstring> brcTypeMap;
|
||||
static OfficeCriticalSection brcTypeMapLock;
|
||||
static std::map<unsigned char, std::wstring> brcTypeMap;
|
||||
static NSCriticalSection::CRITICAL_SECTION_SMART brcTypeMapLock;
|
||||
};
|
||||
}
|
||||
|
||||
@ -35,8 +35,8 @@
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
std::map<std::wstring, std::wstring> StyleSheetMapping::m_mapStyleId;
|
||||
OfficeCriticalSection StyleSheetMapping::m_mapStyleIdLock;
|
||||
std::map<std::wstring, std::wstring> StyleSheetMapping::m_mapStyleId;
|
||||
NSCriticalSection::CRITICAL_SECTION_SMART StyleSheetMapping::m_mapStyleIdLock;
|
||||
|
||||
StyleSheetMapping::StyleSheetMapping( ConversionContext* ctx ) : AbstractOpenXmlMapping( new XMLTools::CStringXmlWriter() )
|
||||
{
|
||||
|
||||
@ -55,7 +55,7 @@ namespace DocFileFormat
|
||||
/// Generates a style id for custom style names or returns the build-in identifier for build-in styles.
|
||||
static std::wstring MakeStyleId( StyleSheetDescription* std );
|
||||
static std::map<std::wstring, std::wstring> m_mapStyleId;
|
||||
static OfficeCriticalSection m_mapStyleIdLock;
|
||||
static NSCriticalSection::CRITICAL_SECTION_SMART m_mapStyleIdLock;
|
||||
virtual ~StyleSheetMapping();
|
||||
|
||||
private:
|
||||
@ -67,4 +67,4 @@ namespace DocFileFormat
|
||||
/// Writes the "NormalTable" default style
|
||||
void writeNormalTableStyle();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,9 +35,11 @@
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
TableCellPropertiesMapping::TableCellPropertiesMapping (XMLTools::CStringXmlWriter* pWriter, const std::vector<short>* grid, int gridIndex, int cellIndex) :
|
||||
TableCellPropertiesMapping::TableCellPropertiesMapping (XMLTools::CStringXmlWriter* pWriter,
|
||||
const std::vector<short>* grid, int gridIndex, int cellIndex, unsigned int depth) :
|
||||
PropertiesMapping(pWriter)
|
||||
{
|
||||
_depth = depth;
|
||||
_width = 0;
|
||||
|
||||
_gridIndex = gridIndex;
|
||||
@ -75,9 +77,25 @@ namespace DocFileFormat
|
||||
TablePropertyExceptions* tapx = static_cast<TablePropertyExceptions*>(visited);
|
||||
int nComputedCellWidth = 0;
|
||||
|
||||
_gridSpan = 1;
|
||||
_gridSpan = 0;
|
||||
_bCoverCell = false;
|
||||
|
||||
unsigned int iTap_current = 1;
|
||||
|
||||
for ( std::list<SinglePropertyModifier>::iterator iter = tapx->grpprl->begin(); iter != tapx->grpprl->end(); iter++ )
|
||||
{
|
||||
DWORD code = iter->OpCode;
|
||||
|
||||
switch(iter->OpCode)
|
||||
{
|
||||
case sprmPItap:
|
||||
{
|
||||
iTap_current = FormatUtils::BytesToUInt32( iter->Arguments, 0, iter->argumentsSize );
|
||||
}break;
|
||||
}
|
||||
}
|
||||
std::list<SinglePropertyModifier>::const_reverse_iterator rend = tapx->grpprl->rend();
|
||||
|
||||
for (std::list<SinglePropertyModifier>::const_reverse_iterator iter = tapx->grpprl->rbegin(); iter != rend; ++iter)
|
||||
{
|
||||
switch (iter->OpCode)
|
||||
@ -113,16 +131,39 @@ namespace DocFileFormat
|
||||
{
|
||||
appendValueElement( _tcPr, L"noWrap", L"", true );
|
||||
}
|
||||
int ind = (std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1);
|
||||
int ind1 = ind;
|
||||
while (ind1 < tdef.rgdxaCenter.size() - 1)
|
||||
//int ind = (std::min)(_cellIndex, (int)tdef.rgTc80.size() - 1);
|
||||
//int ind1 = ind;
|
||||
//while (ind1 < tdef.rgdxaCenter.size() - 1)
|
||||
//{
|
||||
// int sz = tdef.rgdxaCenter[ ind1 + 1] - tdef.rgdxaCenter[ ind1 ] ;
|
||||
// if (sz > 1)
|
||||
// break;
|
||||
// ind1++;
|
||||
//}
|
||||
|
||||
if (tdef.rgTc80[_cellIndex].horzMerge == 1)
|
||||
{
|
||||
int sz = tdef.rgdxaCenter[ ind1 + 1] - tdef.rgdxaCenter[ ind1 ] ;
|
||||
if (sz > 1)
|
||||
break;
|
||||
ind1++;
|
||||
for (size_t i = _cellIndex; i < tdef.rgTc80.size(); i++)
|
||||
{
|
||||
if (tdef.rgTc80[i].horzMerge < 1)
|
||||
break;
|
||||
|
||||
nComputedCellWidth += tdef.rgdxaCenter[ i + 1] - tdef.rgdxaCenter[ i ] ;
|
||||
_gridSpan++;
|
||||
}
|
||||
}
|
||||
else if (tdef.rgTc80[_cellIndex].horzMerge == 2)
|
||||
{//skip cover cell
|
||||
_gridSpan = 1;
|
||||
nComputedCellWidth = 0;
|
||||
_bCoverCell = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
_gridSpan = 1;
|
||||
nComputedCellWidth += tdef.rgdxaCenter[ _cellIndex + 1] - tdef.rgdxaCenter[ _cellIndex ] ;
|
||||
}
|
||||
nComputedCellWidth = tdef.rgdxaCenter[ ind1 + 1] - tdef.rgdxaCenter[ ind ] ;
|
||||
|
||||
if (!IsTableBordersDefined(tapx->grpprl))
|
||||
{
|
||||
@ -292,23 +333,24 @@ namespace DocFileFormat
|
||||
_tcPr->AppendChild( tcW );
|
||||
|
||||
|
||||
if ( ( _gridIndex < (int)_grid->size() ) && ( nComputedCellWidth > _grid->at( _gridIndex ) ) )
|
||||
//if ( ( _gridIndex < (int)_grid->size() ) && ( nComputedCellWidth > _grid->at( _gridIndex ) ) )
|
||||
//{
|
||||
// //check the number of merged cells
|
||||
// int w = _grid->at( _gridIndex );
|
||||
|
||||
// for ( size_t i = _gridIndex + 1; i < _grid->size(); i++ )
|
||||
// {
|
||||
// _gridSpan++;
|
||||
|
||||
// w += _grid->at( i );
|
||||
|
||||
// if ( w >= nComputedCellWidth )
|
||||
// {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
if (_gridSpan > 1)
|
||||
{
|
||||
//check the number of merged cells
|
||||
int w = _grid->at( _gridIndex );
|
||||
|
||||
for ( size_t i = _gridIndex + 1; i < _grid->size(); i++ )
|
||||
{
|
||||
_gridSpan++;
|
||||
|
||||
w += _grid->at( i );
|
||||
|
||||
if ( w >= nComputedCellWidth )
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
appendValueElement( _tcPr, L"gridSpan", FormatUtils::IntToWideString( _gridSpan ), true );
|
||||
}
|
||||
|
||||
|
||||
@ -58,7 +58,7 @@ namespace DocFileFormat
|
||||
public:
|
||||
|
||||
virtual ~TableCellPropertiesMapping();
|
||||
TableCellPropertiesMapping (XMLTools::CStringXmlWriter* pWriter, const std::vector<short>* grid, int gridIndex, int cellIndex);
|
||||
TableCellPropertiesMapping (XMLTools::CStringXmlWriter* pWriter, const std::vector<short>* grid, int gridIndex, int cellIndex, unsigned int depth);
|
||||
virtual void Apply( IVisitable* visited );
|
||||
|
||||
inline int GetGridSpan() const
|
||||
@ -66,6 +66,11 @@ namespace DocFileFormat
|
||||
return _gridSpan;
|
||||
}
|
||||
|
||||
inline bool IsCoverCell() const
|
||||
{
|
||||
return _bCoverCell;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
void apppendCellShading (unsigned char* sprmArg, int size, int cellIndex);
|
||||
@ -79,18 +84,20 @@ namespace DocFileFormat
|
||||
XMLTools::XMLElement* _tcMar;
|
||||
XMLTools::XMLElement* _tcBorders;
|
||||
|
||||
const std::vector<short>* _grid;
|
||||
std::vector<short> _tGrid;
|
||||
const std::vector<short>* _grid;
|
||||
std::vector<short> _tGrid;
|
||||
|
||||
short _width;
|
||||
Global::CellWidthType _ftsWidth;
|
||||
TC80 _tcDef;
|
||||
short _width;
|
||||
Global::CellWidthType _ftsWidth;
|
||||
TC80 _tcDef;
|
||||
unsigned int _depth;
|
||||
|
||||
BorderCode* _brcTop;
|
||||
BorderCode* _brcLeft;
|
||||
BorderCode* _brcRight;
|
||||
BorderCode* _brcBottom;
|
||||
|
||||
int _gridSpan;
|
||||
int _gridSpan;
|
||||
bool _bCoverCell;
|
||||
};
|
||||
}
|
||||
|
||||
@ -118,12 +118,10 @@ namespace DocFileFormat
|
||||
|
||||
//find cell end
|
||||
int cpCellEnd = documentMapping->findCellEndCp(cp, depth);
|
||||
|
||||
//start w:tc
|
||||
documentMapping->GetXMLWriter()->WriteNodeBegin( L"w:tc" );
|
||||
|
||||
//convert the properties
|
||||
TableCellPropertiesMapping tcpMapping(documentMapping->GetXMLWriter(), grid, gridIndex, nCellIndex);
|
||||
XMLTools::CStringXmlWriter writerTcPr;
|
||||
TableCellPropertiesMapping tcpMapping(&writerTcPr, grid, gridIndex, nCellIndex, depth);
|
||||
|
||||
if ( tapx != NULL )
|
||||
{
|
||||
@ -131,6 +129,15 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
gridIndex += tcpMapping.GetGridSpan();
|
||||
|
||||
if (tcpMapping.IsCoverCell())
|
||||
{
|
||||
return;
|
||||
}
|
||||
//start w:tc
|
||||
documentMapping->GetXMLWriter()->WriteNodeBegin( L"w:tc" );
|
||||
|
||||
documentMapping->GetXMLWriter()->WriteString(writerTcPr.GetXmlString());
|
||||
|
||||
documentMapping->_lastValidPapx = papxBackup;
|
||||
documentMapping->_lastValidSepx = sepxBackup;
|
||||
|
||||
@ -21,13 +21,7 @@ include($$PWD/../../../Common/3dParty/boost/boost.pri)
|
||||
|
||||
DEFINES += UNICODE \
|
||||
_UNICODE \
|
||||
_USE_LIBXML2_READER_ \
|
||||
LIBXML_READER_ENABLED \
|
||||
DONT_WRITE_EMBEDDED_FONTS \
|
||||
|
||||
INCLUDEPATH += \
|
||||
../../../DesktopEditor/freetype-2.5.2/include \
|
||||
../../../DesktopEditor/xml/libxml2/include
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
|
||||
core_mac {
|
||||
#QMAKE_MAC_SDK = macosx10.11
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
|
||||
@ -7,66 +7,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatLib", "..\DocForma
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OfficeUtilsLib", "..\..\OfficeUtils\win32\OfficeUtilsLib.vcproj", "{F8274B05-168E-4D6E-B843-AA7510725363}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raster", "..\..\DesktopEditor\raster\raster_vs2005.vcproj", "{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cximage", "..\..\DesktopEditor\cximage\CxImage\cximage_vs2005.vcproj", "{BC52A07C-A797-423D-8C4F-8678805BBB36}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
|
||||
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jasper", "..\..\DesktopEditor\cximage\jasper\jasper_vs2005.vcproj", "{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig", "..\..\DesktopEditor\cximage\jbig\jbig_vs2005.vcproj", "{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg", "..\..\DesktopEditor\cximage\jpeg\Jpeg_vs2005.vcproj", "{818753F2-DBB9-4D3B-898A-A604309BE470}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpsd", "..\..\DesktopEditor\cximage\libpsd\libpsd_vs2005.vcproj", "{9A037A69-D1DF-4505-AB2A-6CB3641C476E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mng", "..\..\DesktopEditor\cximage\mng\mng_vs2005.vcproj", "{40A69F40-063E-43FD-8543-455495D8733E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "png", "..\..\DesktopEditor\cximage\png\png_vs2005.vcproj", "{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdcr", "..\..\DesktopEditor\cximage\raw\libdcr_vs2005.vcproj", "{DF861D33-9BC1-418C-82B1-581F590FE169}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\DesktopEditor\cximage\tiff\Tiff_vs2005.vcproj", "{0588563C-F05C-428C-B21A-DD74756628B3}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig2", "..\..\DesktopEditor\raster\JBig2\win32\jbig2.vcproj", "{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsFormat", "..\..\ASCOfficeXlsFile2\source\win32\XlsFormat.vcproj", "{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatTest", "DocFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
|
||||
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF} = {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C}
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
|
||||
{C5371405-338F-4B70-83BD-2A5CDF64F383} = {C5371405-338F-4B70-83BD-2A5CDF64F383}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
@ -78,17 +26,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "..\..\Common\3d
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTXFormat", "..\..\ASCOfficePPTXFile\PPTXLib\PPTXFormat.vcproj", "{36636678-AE25-4BE6-9A34-2561D1BCF302}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "agg2d", "..\..\DesktopEditor\agg-2.4\agg_vs2005.vcproj", "{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "font_engine", "..\..\DesktopEditor\fontengine\font_engine_vs2005.vcproj", "{C739151F-5384-41DF-A1A6-F089E2C1AD56}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "..\..\DesktopEditor\freetype-2.5.2\builds\windows\vc2005\freetype.vcproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\..\DesktopEditor\xml\build\vs2005\libxml2.vcproj", "{21663823-DE45-479B-91D0-B4FEF4916EF0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@ -105,110 +42,6 @@ Global
|
||||
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Release|Win32.Build.0 = Release|Win32
|
||||
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Release|x64.ActiveCfg = Release|x64
|
||||
{C5371405-338F-4B70-83BD-2A5CDF64F383}.Release|x64.Build.0 = Release|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|x64.Build.0 = Debug|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Win32.Build.0 = Release|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|x64.ActiveCfg = Release|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|x64.Build.0 = Release|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|x64.Build.0 = Debug|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|Win32.Build.0 = Release|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|x64.ActiveCfg = Release|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|x64.Build.0 = Release|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|x64.Build.0 = Debug|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|Win32.Build.0 = Release|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|x64.ActiveCfg = Release|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|x64.Build.0 = Release|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|x64.Build.0 = Debug|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|Win32.Build.0 = Release|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|x64.ActiveCfg = Release|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|x64.Build.0 = Release|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|x64.Build.0 = Debug|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|Win32.Build.0 = Release|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|x64.ActiveCfg = Release|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|x64.Build.0 = Release|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|x64.Build.0 = Debug|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|Win32.Build.0 = Release|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|x64.ActiveCfg = Release|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|x64.Build.0 = Release|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|x64.Build.0 = Debug|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|Win32.Build.0 = Release|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|x64.ActiveCfg = Release|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|x64.Build.0 = Release|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|x64.Build.0 = Debug|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|Win32.Build.0 = Release|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|x64.ActiveCfg = Release|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|x64.Build.0 = Release|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|x64.Build.0 = Debug|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|Win32.Build.0 = Release|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|x64.ActiveCfg = Release|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|x64.Build.0 = Release|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|x64.Build.0 = Debug|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|Win32.Build.0 = Release|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|x64.ActiveCfg = Release|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|x64.Build.0 = Release|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|x64.Build.0 = Debug|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|Win32.Build.0 = Release|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|x64.ActiveCfg = Release|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|x64.Build.0 = Release|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|x64.Build.0 = Debug|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|Win32.Build.0 = Release|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|x64.ActiveCfg = Release|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|x64.Build.0 = Release|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|x64.Build.0 = Debug|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|Win32.Build.0 = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|x64.ActiveCfg = Release|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|x64.Build.0 = Release|x64
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
@ -255,38 +88,6 @@ Global
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|Win32.Build.0 = Release|Win32
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|x64.ActiveCfg = Release|x64
|
||||
{36636678-AE25-4BE6-9A34-2561D1BCF302}.Release|x64.Build.0 = Release|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|x64.Build.0 = Debug|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|Win32.Build.0 = Release|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|x64.ActiveCfg = Release|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|x64.Build.0 = Release|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|x64.Build.0 = Debug|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|Win32.Build.0 = Release|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|x64.ActiveCfg = Release|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|x64.Build.0 = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.Build.0 = Debug|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.Build.0 = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.ActiveCfg = Release|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@ -46,6 +46,16 @@
|
||||
#if defined(_WIN64)
|
||||
#pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib")
|
||||
#elif defined (_WIN32)
|
||||
|
||||
#if defined(_DEBUG)
|
||||
#pragma comment(lib, "../../build/lib/win_32/DEBUG/graphics.lib")
|
||||
#pragma comment(lib, "../../build/lib/win_32/DEBUG/kernel.lib")
|
||||
#pragma comment(lib, "../../build/lib/win_32/DEBUG/UnicodeConverter.lib")
|
||||
#else
|
||||
#pragma comment(lib, "../../build/lib/win_32/graphics.lib")
|
||||
#pragma comment(lib, "../../build/lib/win_32/kernel.lib")
|
||||
#pragma comment(lib, "../../build/lib/win_32/UnicodeConverter.lib")
|
||||
#endif
|
||||
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
|
||||
#endif
|
||||
|
||||
@ -83,7 +93,7 @@ HRESULT convert_single(std::wstring srcFileName)
|
||||
if (hRes == S_OK)
|
||||
{
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
hRes = oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), dstPath, -1);
|
||||
hRes = oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), dstPath, true);
|
||||
}
|
||||
|
||||
NSDirectory::DeleteDirectory(dstTempPath);
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ATL_CSTRINGS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
|
||||
MinimalRebuild="false"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
@ -341,6 +341,10 @@
|
||||
<Filter
|
||||
Name="Common"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\DesktopEditor\common\Base64.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ASCOfficeDocxFile2\BinWriter\BinWriters.cpp"
|
||||
>
|
||||
@ -385,6 +389,10 @@
|
||||
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\FontProcessor.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\3dParty\pole\pole.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\ASCOfficeDocxFile2\BinReader\Readers.cpp"
|
||||
>
|
||||
@ -442,30 +450,10 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\FileDownloader\FileDownloader_win.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\OfficeFileFormatChecker2.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\3dParty\pole\pole.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\build\lib\win_32\DEBUG\UnicodeConverter.lib"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DesktopEditor\xml\src\xmldom.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DesktopEditor\xml\src\xmllight.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
||||
@ -39,7 +39,7 @@ namespace Writers
|
||||
{
|
||||
class DocumentWriter : public ContentWriter
|
||||
{
|
||||
XmlUtils::CStringWriter m_oWriter;
|
||||
NSStringUtils::CStringBuilder m_oWriter;
|
||||
HeaderFooterWriter& m_oHeaderFooterWriter;
|
||||
public:
|
||||
std::wstring m_sDir;
|
||||
|
||||
@ -40,9 +40,9 @@ namespace Writers
|
||||
class ContentWriter
|
||||
{
|
||||
public:
|
||||
XmlUtils::CStringWriter m_oBackground;
|
||||
XmlUtils::CStringWriter m_oContent;
|
||||
XmlUtils::CStringWriter m_oSecPr;
|
||||
NSStringUtils::CStringBuilder m_oBackground;
|
||||
NSStringUtils::CStringBuilder m_oContent;
|
||||
NSStringUtils::CStringBuilder m_oSecPr;
|
||||
};
|
||||
class HdrFtrItem
|
||||
{
|
||||
|
||||
@ -38,7 +38,7 @@ namespace Writers
|
||||
{
|
||||
class MediaWriter
|
||||
{
|
||||
XmlUtils::CStringWriter m_oWriter;
|
||||
NSStringUtils::CStringBuilder m_oWriter;
|
||||
std::wstring m_sDir;
|
||||
std::wstring m_sMediaDir;
|
||||
public:
|
||||
|
||||
@ -41,11 +41,11 @@ namespace Writers
|
||||
|
||||
class NumberingWriter
|
||||
{
|
||||
XmlUtils::CStringWriter m_oWriter;
|
||||
NSStringUtils::CStringBuilder m_oWriter;
|
||||
std::wstring m_sDir;
|
||||
public:
|
||||
XmlUtils::CStringWriter m_oANum;
|
||||
XmlUtils::CStringWriter m_oNumList;
|
||||
NSStringUtils::CStringBuilder m_oANum;
|
||||
NSStringUtils::CStringBuilder m_oNumList;
|
||||
|
||||
NumberingWriter( std::wstring sDir) : m_sDir(sDir)
|
||||
{
|
||||
|
||||
@ -516,7 +516,7 @@ public:
|
||||
bRStyle || bSpacing || bDStrikeout || bCaps || bSmallCaps || bPosition || bFontHint || bBoldCs || bItalicCs || bFontSizeCs || bCs || bRtl || bLang || bLangBidi || bLangEA || bThemeColor || bVanish ||
|
||||
!Outline.empty() || !Fill.empty() || !Del.empty() || !Ins.empty() || !MoveFrom.empty() || !MoveTo.empty() || !rPrChange.empty();
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter* pCStringWriter)
|
||||
void Write(NSStringUtils::CStringBuilder* pCStringWriter)
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:rPr>");
|
||||
if(bRStyle)
|
||||
@ -780,7 +780,9 @@ public:
|
||||
std::wstring Name;
|
||||
std::wstring Id;
|
||||
BYTE byteType;
|
||||
bool bDefault;
|
||||
bool Default;
|
||||
bool Custom;
|
||||
std::wstring Aliases;
|
||||
std::wstring BasedOn;
|
||||
std::wstring NextId;
|
||||
std::wstring Link;
|
||||
@ -789,6 +791,11 @@ public:
|
||||
bool hidden;
|
||||
bool semiHidden;
|
||||
bool unhideWhenUsed;
|
||||
bool autoRedefine;
|
||||
bool locked;
|
||||
bool personal;
|
||||
bool personalCompose;
|
||||
bool personalReply;
|
||||
std::wstring TextPr;
|
||||
std::wstring ParaPr;
|
||||
std::wstring TablePr;
|
||||
@ -796,24 +803,38 @@ public:
|
||||
std::wstring CellPr;
|
||||
std::vector<std::wstring> TblStylePr;
|
||||
|
||||
bool bDefault;
|
||||
bool bCustom;
|
||||
bool bqFormat;
|
||||
bool buiPriority;
|
||||
bool bhidden;
|
||||
bool bsemiHidden;
|
||||
bool bunhideWhenUsed;
|
||||
bool bautoRedefine;
|
||||
bool blocked;
|
||||
bool bpersonal;
|
||||
bool bpersonalCompose;
|
||||
bool bpersonalReply;
|
||||
|
||||
public:
|
||||
docStyle()
|
||||
{
|
||||
byteType = styletype_Paragraph;
|
||||
bDefault = false;
|
||||
bCustom = false;
|
||||
|
||||
bqFormat = false;
|
||||
buiPriority = false;
|
||||
bhidden = false;
|
||||
bsemiHidden = false;
|
||||
bunhideWhenUsed = false;
|
||||
bautoRedefine = false;
|
||||
blocked = false;
|
||||
bpersonal = false;
|
||||
bpersonalCompose = false;
|
||||
bpersonalReply = false;
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter* pCStringWriter)
|
||||
void Write(NSStringUtils::CStringBuilder* pCStringWriter)
|
||||
{
|
||||
std::wstring sType;
|
||||
switch(byteType)
|
||||
@ -827,10 +848,35 @@ public:
|
||||
{
|
||||
std::wstring sStyle = L"<w:style w:type=\"" + sType + L"\" w:styleId=\"" + Id + L"\"";
|
||||
if(bDefault)
|
||||
sStyle += L" w:default=\"1\"";
|
||||
{
|
||||
if(Default)
|
||||
sStyle += L" w:default=\"1\"";
|
||||
else
|
||||
sStyle += L" w:default=\"0\"";
|
||||
}
|
||||
if(bCustom)
|
||||
{
|
||||
if(Custom)
|
||||
sStyle += L" w:customStyle=\"1\"";
|
||||
else
|
||||
sStyle += L" w:customStyle=\"0\"";
|
||||
}
|
||||
|
||||
sStyle += L">";
|
||||
pCStringWriter->WriteString(sStyle);
|
||||
if(!Aliases.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:aliases w:val=\"");
|
||||
pCStringWriter->WriteEncodeXmlString(Aliases);
|
||||
pCStringWriter->WriteString(L"\"/>");
|
||||
}
|
||||
if(bautoRedefine)
|
||||
{
|
||||
if(autoRedefine)
|
||||
pCStringWriter->WriteString(L"<w:autoRedefine/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:autoRedefine val=\"false\"/>");
|
||||
}
|
||||
if(!Name.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:name w:val=\"" + Name + L"\"/>");
|
||||
@ -843,12 +889,40 @@ public:
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:next w:val=\"" + NextId + L"\"/>");
|
||||
}
|
||||
if(bpersonal)
|
||||
{
|
||||
if(personal)
|
||||
pCStringWriter->WriteString(L"<w:personal/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:personal val=\"false\"/>");
|
||||
}
|
||||
if(bpersonalCompose)
|
||||
{
|
||||
if(personalCompose)
|
||||
pCStringWriter->WriteString(L"<w:personalCompose/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:personalCompose val=\"false\"/>");
|
||||
}
|
||||
if(bpersonalReply)
|
||||
{
|
||||
if(personalReply)
|
||||
pCStringWriter->WriteString(L"<w:personalReply/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:personalReply val=\"false\"/>");
|
||||
}
|
||||
if(!Link.empty())
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:link w:val=\"");
|
||||
pCStringWriter->WriteEncodeXmlString(Link);
|
||||
pCStringWriter->WriteString(L"\"/>");
|
||||
}
|
||||
if(blocked)
|
||||
{
|
||||
if(locked)
|
||||
pCStringWriter->WriteString(L"<w:locked/>");
|
||||
else
|
||||
pCStringWriter->WriteString(L"<w:locked val=\"false\"/>");
|
||||
}
|
||||
if(bqFormat)
|
||||
{
|
||||
if(qFormat)
|
||||
@ -916,7 +990,7 @@ public:
|
||||
class tblStylePr
|
||||
{
|
||||
public:
|
||||
XmlUtils::CStringWriter Writer;
|
||||
NSStringUtils::CStringBuilder Writer;
|
||||
BYTE Type;
|
||||
bool bType;
|
||||
public:
|
||||
@ -976,7 +1050,7 @@ public:
|
||||
bHeight = false;
|
||||
bPaddings = false;
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter* pCStringWriter)
|
||||
void Write(NSStringUtils::CStringBuilder* pCStringWriter)
|
||||
{
|
||||
if(bType)
|
||||
{
|
||||
@ -1037,7 +1111,7 @@ public:
|
||||
// tblPr()
|
||||
// {
|
||||
// }
|
||||
// void Write(CStringWriter* pCStringWriter)
|
||||
// void Write(NSStringUtils::CStringBuilder* pCStringWriter)
|
||||
// {
|
||||
// }
|
||||
//};
|
||||
@ -1057,7 +1131,7 @@ public:
|
||||
bW = false;
|
||||
bWDocx = false;
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter& pCStringWriter, const std::wstring& sName)
|
||||
void Write(NSStringUtils::CStringBuilder& pCStringWriter, const std::wstring& sName)
|
||||
{
|
||||
pCStringWriter.WriteString(Write(sName));
|
||||
}
|
||||
@ -1111,7 +1185,7 @@ public:
|
||||
bValue = false;
|
||||
bThemeColor = false;
|
||||
}
|
||||
void Write(std::wstring sName, XmlUtils::CStringWriter* pCStringWriter, bool bCell)
|
||||
void Write(std::wstring sName, NSStringUtils::CStringBuilder* pCStringWriter, bool bCell)
|
||||
{
|
||||
if(bValue)
|
||||
{
|
||||
@ -1202,7 +1276,7 @@ public:
|
||||
{
|
||||
return !(bLeft || bTop || bRight || bBottom || bInsideV || bInsideH || bBetween);
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter* pCStringWriter, bool bCell)
|
||||
void Write(NSStringUtils::CStringBuilder* pCStringWriter, bool bCell)
|
||||
{
|
||||
if(bLeft)
|
||||
oLeft.Write(L"w:left", pCStringWriter, bCell);
|
||||
@ -1237,16 +1311,18 @@ public:
|
||||
class docLvl
|
||||
{
|
||||
public:
|
||||
long ILvl;
|
||||
long Format;
|
||||
BYTE Jc;
|
||||
std::vector<docLvlText*> Text;
|
||||
long Restart;
|
||||
long Start;
|
||||
BYTE Suff;
|
||||
XmlUtils::CStringWriter ParaPr;
|
||||
XmlUtils::CStringWriter TextPr;
|
||||
NSStringUtils::CStringBuilder ParaPr;
|
||||
NSStringUtils::CStringBuilder TextPr;
|
||||
std::wstring PStyle;
|
||||
|
||||
bool bILvl;
|
||||
bool bFormat;
|
||||
bool bJc;
|
||||
bool bText;
|
||||
@ -1258,6 +1334,7 @@ public:
|
||||
bool bPStyle;
|
||||
docLvl()
|
||||
{
|
||||
bILvl = false;
|
||||
bFormat = false;
|
||||
bJc = false;
|
||||
bText = false;
|
||||
@ -1275,9 +1352,14 @@ public:
|
||||
delete Text[i];
|
||||
}
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter& oWriter, int index)
|
||||
void Write(NSStringUtils::CStringBuilder& oWriter)
|
||||
{
|
||||
oWriter.WriteString(L"<w:lvl w:ilvl=\"" + std::to_wstring(index) + L"\">");
|
||||
oWriter.WriteString(L"<w:lvl");
|
||||
if(bILvl)
|
||||
{
|
||||
oWriter.WriteString(L" w:ilvl=\"" + std::to_wstring(ILvl) + L"\"");
|
||||
}
|
||||
oWriter.WriteString(L">");
|
||||
if(bStart)
|
||||
{
|
||||
oWriter.WriteString(L"<w:start w:val=\"" + std::to_wstring(Start) + L"\"/>");
|
||||
@ -1374,6 +1456,48 @@ public:
|
||||
oWriter.WriteString(L"</w:lvl>");
|
||||
}
|
||||
};
|
||||
class docLvlOverride
|
||||
{
|
||||
public:
|
||||
long ILvl;
|
||||
long StartOverride;
|
||||
docLvl* Lvl;
|
||||
|
||||
bool bILvl;
|
||||
bool bStartOverride;
|
||||
docLvlOverride()
|
||||
{
|
||||
bILvl = false;
|
||||
bStartOverride = false;
|
||||
Lvl = NULL;
|
||||
}
|
||||
~docLvlOverride()
|
||||
{
|
||||
RELEASEOBJECT(Lvl);
|
||||
}
|
||||
void Write(NSStringUtils::CStringBuilder& oWriter)
|
||||
{
|
||||
oWriter.WriteString(L"<w:lvlOverride");
|
||||
if (bILvl)
|
||||
{
|
||||
oWriter.WriteString(L" w:ilvl=\"");
|
||||
oWriter.WriteString(std::to_wstring(ILvl));
|
||||
oWriter.WriteString(L"\"");
|
||||
}
|
||||
oWriter.WriteString(L">");
|
||||
if (bStartOverride)
|
||||
{
|
||||
oWriter.WriteString(L"<w:startOverride w:val=\"");
|
||||
oWriter.WriteString(std::to_wstring(StartOverride));
|
||||
oWriter.WriteString(L"\"/>");
|
||||
}
|
||||
if(NULL != Lvl)
|
||||
{
|
||||
Lvl->Write(oWriter);
|
||||
}
|
||||
oWriter.WriteString(L"</w:lvlOverride>");
|
||||
}
|
||||
};
|
||||
class docANum
|
||||
{
|
||||
public:
|
||||
@ -1394,7 +1518,7 @@ public:
|
||||
delete Lvls[i];
|
||||
}
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter& oWriterANum)
|
||||
void Write(NSStringUtils::CStringBuilder& oWriterANum)
|
||||
{
|
||||
if(bId)
|
||||
{
|
||||
@ -1411,7 +1535,7 @@ public:
|
||||
}
|
||||
for(int i = 0, length = (int)Lvls.size(); i < length; ++i)
|
||||
{
|
||||
Lvls[i]->Write(oWriterANum, i);
|
||||
Lvls[i]->Write(oWriterANum);
|
||||
}
|
||||
oWriterANum.WriteString(L"</w:abstractNum>");
|
||||
}
|
||||
@ -1422,6 +1546,7 @@ class docNum
|
||||
public:
|
||||
long AId;
|
||||
long Id;
|
||||
std::vector<docLvlOverride*> LvlOverrides;
|
||||
|
||||
bool bAId;
|
||||
bool bId;
|
||||
@ -1430,12 +1555,21 @@ public:
|
||||
bAId = false;
|
||||
bId = false;
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter& oWriterNumList)
|
||||
~docNum()
|
||||
{
|
||||
for(size_t i = 0; i < LvlOverrides.size(); ++i){
|
||||
RELEASEOBJECT(LvlOverrides[i]);
|
||||
}
|
||||
}
|
||||
void Write(NSStringUtils::CStringBuilder& oWriterNumList)
|
||||
{
|
||||
if(bAId && bId)
|
||||
{
|
||||
oWriterNumList.WriteString(L"<w:num w:numId=\"" + std::to_wstring(Id) + L"\"><w:abstractNumId w:val=\"" +
|
||||
std::to_wstring(AId) + L"\"/></w:num>");
|
||||
oWriterNumList.WriteString(L"<w:num w:numId=\"" + std::to_wstring(Id) + L"\"><w:abstractNumId w:val=\"" + std::to_wstring(AId) + L"\"/>");
|
||||
for(size_t i = 0; i < LvlOverrides.size(); ++i){
|
||||
LvlOverrides[i]->Write(oWriterNumList);
|
||||
}
|
||||
oWriterNumList.WriteString(L"</w:num>");
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -1451,7 +1585,7 @@ public:
|
||||
sName = name;
|
||||
bGridAfter = false;
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter& writer)
|
||||
void Write(NSStringUtils::CStringBuilder& writer)
|
||||
{
|
||||
if(bGridAfter && nGridAfter > 0)
|
||||
{
|
||||
@ -1468,7 +1602,7 @@ public:
|
||||
std::wstring href;
|
||||
std::wstring anchor;
|
||||
std::wstring tooltip;
|
||||
XmlUtils::CStringWriter writer;
|
||||
NSStringUtils::CStringBuilder writer;
|
||||
static WriteHyperlink* Parse(std::wstring fld)
|
||||
{
|
||||
WriteHyperlink* res = NULL;
|
||||
@ -1547,7 +1681,7 @@ public:
|
||||
}
|
||||
return res;
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter& wr)
|
||||
void Write(NSStringUtils::CStringBuilder& wr)
|
||||
{
|
||||
if(false == rId.empty())
|
||||
{
|
||||
@ -1593,7 +1727,6 @@ public:
|
||||
};
|
||||
class CComment{
|
||||
private:
|
||||
typedef std::wstring (*funcArg)(CComment* pComment);
|
||||
IdCounter& m_oParaIdCounter;
|
||||
IdCounter& m_oFormatIdCounter;
|
||||
public:
|
||||
@ -1654,13 +1787,13 @@ public:
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
std::wstring writeTemplates(funcArg fReadFunction)
|
||||
std::wstring writeTemplates(bool isExt)
|
||||
{
|
||||
std::wstring sRes;
|
||||
sRes += (fReadFunction(this));
|
||||
sRes += isExt ? writeContentExt(this) : writeContent(this);
|
||||
|
||||
for(size_t i = 0; i < replies.size(); ++i)
|
||||
sRes += (fReadFunction(replies[i]));
|
||||
sRes += isExt ? writeContentExt(replies[i]) : writeContent(replies[i]);
|
||||
return sRes;
|
||||
}
|
||||
static std::wstring writeRef(CComment* pComment, const std::wstring& sBefore, const std::wstring& sRef, const std::wstring& sAfter)
|
||||
@ -1744,25 +1877,22 @@ public:
|
||||
sRes += L"\"";
|
||||
}
|
||||
sRes += L">";
|
||||
if(false == pComment->Text.empty())
|
||||
std::wstring sText = pComment->Text;
|
||||
|
||||
XmlUtils::replace_all(sText, L"\r", L"");
|
||||
|
||||
bool bFirst = true;
|
||||
int nPrevIndex = 0;
|
||||
for (int i = 0; i < (int)sText.length(); i++)
|
||||
{
|
||||
std::wstring sText = pComment->Text;
|
||||
|
||||
XmlUtils::replace_all(sText, L"\r", L"");
|
||||
|
||||
bool bFirst = true;
|
||||
int nPrevIndex = 0;
|
||||
for (int i = 0; i < (int)sText.length(); i++)
|
||||
wchar_t cToken = sText[i];
|
||||
if('\n' == cToken)
|
||||
{
|
||||
wchar_t cToken = sText[i];
|
||||
if('\n' == cToken)
|
||||
{
|
||||
bFirst = writeContentWritePart(pComment, sText, nPrevIndex, i, bFirst, sRes);
|
||||
nPrevIndex = i + 1;
|
||||
}
|
||||
bFirst = writeContentWritePart(pComment, sText, nPrevIndex, i, bFirst, sRes);
|
||||
nPrevIndex = i + 1;
|
||||
}
|
||||
writeContentWritePart(pComment, sText, nPrevIndex, (int)sText.length(), bFirst, sRes);
|
||||
}
|
||||
writeContentWritePart(pComment, sText, nPrevIndex, (int)sText.length(), bFirst, sRes);
|
||||
sRes += L"</w:comment>";
|
||||
return sRes;
|
||||
}
|
||||
@ -1852,7 +1982,7 @@ public:
|
||||
std::wstring sRes;
|
||||
for (boost::unordered_map<int, CComment*>::const_iterator it = m_mapComments.begin(); it != m_mapComments.end(); ++it)
|
||||
{
|
||||
sRes += (it->second->writeTemplates(CComment::writeContent));
|
||||
sRes += it->second->writeTemplates(false);
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
@ -1861,7 +1991,7 @@ public:
|
||||
std::wstring sRes;
|
||||
for (boost::unordered_map<int, CComment*>::const_iterator it = m_mapComments.begin(); it != m_mapComments.end(); ++it)
|
||||
{
|
||||
sRes += (it->second->writeTemplates(CComment::writeContentExt));
|
||||
sRes += it->second->writeTemplates(true);
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
@ -2457,7 +2587,7 @@ public: CFramePr()
|
||||
{
|
||||
return !(bDropCap || bH || bHAnchor || bHRule || bHSpace || bLines || bVAnchor || bVSpace || bW || bWrap || bX || bXAlign || bY || bYAlign);
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter& oStringWriter)
|
||||
void Write(NSStringUtils::CStringBuilder& oStringWriter)
|
||||
{
|
||||
oStringWriter.WriteString(L"<w:framePr");
|
||||
if(bDropCap)
|
||||
@ -2595,7 +2725,7 @@ public:
|
||||
std::wstring sDocLocation;
|
||||
std::wstring sTgtFrame;
|
||||
|
||||
XmlUtils::CStringWriter writer;
|
||||
NSStringUtils::CStringBuilder writer;
|
||||
|
||||
bool bHistory;
|
||||
public:
|
||||
@ -2603,7 +2733,7 @@ public:
|
||||
{
|
||||
bHistory = false;
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter& wr)
|
||||
void Write(NSStringUtils::CStringBuilder& wr)
|
||||
{
|
||||
if(false == rId.empty())
|
||||
{
|
||||
@ -2634,12 +2764,12 @@ public:
|
||||
class CFldSimple{
|
||||
public:
|
||||
std::wstring sInstr;
|
||||
XmlUtils::CStringWriter writer;
|
||||
NSStringUtils::CStringBuilder writer;
|
||||
public:
|
||||
CFldSimple()
|
||||
{
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter& wr)
|
||||
void Write(NSStringUtils::CStringBuilder& wr)
|
||||
{
|
||||
if(false == sInstr.empty())
|
||||
{
|
||||
@ -2664,14 +2794,14 @@ public:
|
||||
long* vMergeOrigin;
|
||||
|
||||
rPr* RPr;
|
||||
XmlUtils::CStringWriter* PPr;
|
||||
NSStringUtils::CStringBuilder* PPr;
|
||||
SectPr* sectPr;
|
||||
CWiterTblPr* tblPr;
|
||||
XmlUtils::CStringWriter* tblGridChange;
|
||||
XmlUtils::CStringWriter* trPr;
|
||||
XmlUtils::CStringWriter* tcPr;
|
||||
XmlUtils::CStringWriter* content;
|
||||
XmlUtils::CStringWriter* contentRun;
|
||||
NSStringUtils::CStringBuilder* tblGridChange;
|
||||
NSStringUtils::CStringBuilder* trPr;
|
||||
NSStringUtils::CStringBuilder* tcPr;
|
||||
NSStringUtils::CStringBuilder* content;
|
||||
NSStringUtils::CStringBuilder* contentRun;
|
||||
TrackRevision()
|
||||
{
|
||||
Id = NULL;
|
||||
@ -2708,11 +2838,11 @@ public:
|
||||
}
|
||||
std::wstring ToString(std::wstring sName)
|
||||
{
|
||||
XmlUtils::CStringWriter writer;
|
||||
NSStringUtils::CStringBuilder writer;
|
||||
Write(&writer, sName);
|
||||
return writer.GetData();
|
||||
}
|
||||
void Write(XmlUtils::CStringWriter* pCStringWriter, std::wstring sName)
|
||||
void Write(NSStringUtils::CStringBuilder* pCStringWriter, std::wstring sName)
|
||||
{
|
||||
if(IsNoEmpty())
|
||||
{
|
||||
|
||||
@ -47,7 +47,9 @@ Binary_HdrFtrTableReader::Binary_HdrFtrTableReader(NSBinPptxRW::CBinaryFileReade
|
||||
}
|
||||
int Binary_HdrFtrTableReader::Read()
|
||||
{
|
||||
return ReadTable(&Binary_HdrFtrTableReader::ReadHdrFtrContent, this);
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
READ_TABLE_DEF(res, this->ReadHdrFtrContent, NULL);
|
||||
return res;
|
||||
}
|
||||
int Binary_HdrFtrTableReader::ReadHdrFtrContent(BYTE type, long length, void* poResult)
|
||||
{
|
||||
@ -55,7 +57,7 @@ int Binary_HdrFtrTableReader::ReadHdrFtrContent(BYTE type, long length, void* po
|
||||
if ( c_oSerHdrFtrTypes::Header == type || c_oSerHdrFtrTypes::Footer == type )
|
||||
{
|
||||
nCurType = type;
|
||||
res = Read1(length, &Binary_HdrFtrTableReader::ReadHdrFtrFEO, this, poResult);
|
||||
READ1_DEF(length, res, this->ReadHdrFtrFEO, poResult);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
@ -67,7 +69,7 @@ int Binary_HdrFtrTableReader::ReadHdrFtrFEO(BYTE type, long length, void* poResu
|
||||
if ( c_oSerHdrFtrTypes::HdrFtr_First == type || c_oSerHdrFtrTypes::HdrFtr_Even == type || c_oSerHdrFtrTypes::HdrFtr_Odd == type )
|
||||
{
|
||||
nCurHeaderType = type;
|
||||
res = Read1(length, &Binary_HdrFtrTableReader::ReadHdrFtrItem, this, poResult);
|
||||
READ1_DEF(length, res, this->ReadHdrFtrItem, poResult);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
@ -99,7 +101,7 @@ int Binary_HdrFtrTableReader::ReadHdrFtrItem(BYTE type, long length, void* poRes
|
||||
}
|
||||
m_oFileWriter.m_pDrawingConverter->SetDstContentRels();
|
||||
Binary_DocumentTableReader oBinary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, poHdrFtrItem->Header, m_pComments);
|
||||
res = Read1(length, &Binary_HdrFtrTableReader::ReadHdrFtrItemContent, this, &oBinary_DocumentTableReader);
|
||||
READ1_DEF(length, res, this->ReadHdrFtrItemContent, &oBinary_DocumentTableReader);
|
||||
|
||||
OOX::CPath fileRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + L"word" +
|
||||
FILE_SEPARATOR_STR + L"_rels"+
|
||||
@ -118,4 +120,4 @@ int Binary_HdrFtrTableReader::ReadHdrFtrItemContent(BYTE type, long length, void
|
||||
return pBinary_DocumentTableReader->ReadDocumentContent(type, length, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -37,13 +37,13 @@
|
||||
namespace Writers
|
||||
{
|
||||
static std::wstring g_string_set_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><w:settings xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\">");
|
||||
static std::wstring g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:compat><w:compatSetting w:name=\"compatibilityMode\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"14\"/><w:compatSetting w:name=\"overrideTableStyleFontSizeAndJustification\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"enableOpenTypeFeatures\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"doNotFlipMirrorIndents\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/></w:compat><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults><w:decimalSymbol w:val=\".\"/><w:listSeparator w:val=\",\"/>");
|
||||
static std::wstring g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:compat><w:compatSetting w:name=\"compatibilityMode\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"15\"/><w:compatSetting w:name=\"overrideTableStyleFontSizeAndJustification\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"enableOpenTypeFeatures\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"doNotFlipMirrorIndents\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/></w:compat><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults><w:decimalSymbol w:val=\".\"/><w:listSeparator w:val=\",\"/>");
|
||||
static std::wstring g_string_set_End = _T("</w:settings>");
|
||||
|
||||
class SettingWriter
|
||||
{
|
||||
std::wstring m_sDir;
|
||||
XmlUtils::CStringWriter m_oSettingWriter;
|
||||
NSStringUtils::CStringBuilder m_oSettingWriter;
|
||||
HeaderFooterWriter& m_oHeaderFooterWriter;
|
||||
public:
|
||||
SettingWriter(std::wstring sDir, HeaderFooterWriter& oHeaderFooterWriter):m_sDir(sDir),m_oHeaderFooterWriter(oHeaderFooterWriter)
|
||||
|
||||
@ -46,12 +46,12 @@ namespace Writers
|
||||
|
||||
class StylesWriter
|
||||
{
|
||||
XmlUtils::CStringWriter m_oWriter;
|
||||
NSStringUtils::CStringBuilder m_oWriter;
|
||||
std::wstring m_sDir;
|
||||
public:
|
||||
XmlUtils::CStringWriter m_Styles;
|
||||
XmlUtils::CStringWriter m_rPrDefault;
|
||||
XmlUtils::CStringWriter m_pPrDefault;
|
||||
NSStringUtils::CStringBuilder m_Styles;
|
||||
NSStringUtils::CStringBuilder m_rPrDefault;
|
||||
NSStringUtils::CStringBuilder m_pPrDefault;
|
||||
int m_nVersion;
|
||||
StylesWriter(std::wstring sDir, int nVersion):m_sDir(sDir),m_nVersion(nVersion)
|
||||
{
|
||||
|
||||
@ -33,8 +33,7 @@
|
||||
#define FONT_TABLE_WRITER
|
||||
|
||||
#include "../../XlsxSerializerCom/Common/Common.h"
|
||||
#include "../../DesktopEditor/fontengine/FontManager.h"
|
||||
#include "../../DesktopEditor/fontengine/ApplicationFonts.h"
|
||||
#include "../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
namespace Writers
|
||||
@ -44,34 +43,30 @@ namespace Writers
|
||||
|
||||
class FontTableWriter
|
||||
{
|
||||
XmlUtils::CStringWriter m_oWriter;
|
||||
NSStringUtils::CStringBuilder m_oWriter;
|
||||
std::wstring m_sDir;
|
||||
CApplicationFonts m_oApplicationFonts;
|
||||
CFontManager* m_pFontManager;
|
||||
NSFonts::IApplicationFonts* m_pApplicationFonts;
|
||||
NSFonts::IFontManager* m_pFontManager;
|
||||
public:
|
||||
boost::unordered_map<std::wstring, int> m_mapFonts;
|
||||
|
||||
FontTableWriter(std::wstring sDir, std::wstring sFontDir, bool bNoFontDir):m_sDir(sDir)
|
||||
{
|
||||
m_pApplicationFonts = NSFonts::NSApplication::Create();
|
||||
m_pFontManager = NULL;
|
||||
if(!bNoFontDir)
|
||||
{
|
||||
if(sFontDir.empty())
|
||||
m_oApplicationFonts.Initialize();
|
||||
m_pApplicationFonts->Initialize();
|
||||
else
|
||||
m_oApplicationFonts.InitializeFromFolder(sFontDir);
|
||||
CFontList* pFontList = m_oApplicationFonts.GetList();
|
||||
if(NULL != pFontList)
|
||||
{
|
||||
std::wstring sDefaultFont(_T("Arial"));
|
||||
pFontList->SetDefaultFont(sDefaultFont);
|
||||
}
|
||||
m_pFontManager = m_oApplicationFonts.GenerateFontManager();
|
||||
m_pApplicationFonts->InitializeFromFolder(sFontDir);
|
||||
m_pFontManager = m_pApplicationFonts->GenerateFontManager();
|
||||
}
|
||||
}
|
||||
~FontTableWriter()
|
||||
{
|
||||
RELEASEOBJECT(m_pFontManager);
|
||||
RELEASEOBJECT(m_pApplicationFonts);
|
||||
}
|
||||
|
||||
void Write()
|
||||
@ -116,11 +111,11 @@ namespace Writers
|
||||
bool bUsePanose = false;
|
||||
if(NULL != m_pFontManager)
|
||||
{
|
||||
CFontSelectFormat oFontSelectFormat;
|
||||
NSFonts::CFontSelectFormat oFontSelectFormat;
|
||||
oFontSelectFormat.wsName = new std::wstring;
|
||||
*oFontSelectFormat.wsName = sFontName;
|
||||
|
||||
CFontInfo* pFontInfo = m_pFontManager->GetFontInfoByParams(oFontSelectFormat);
|
||||
NSFonts::CFontInfo* pFontInfo = m_pFontManager->GetFontInfoByParams(oFontSelectFormat);
|
||||
if(NULL != pFontInfo)
|
||||
{
|
||||
for (size_t i = 0; i < 10; ++i)
|
||||
|
||||
@ -201,7 +201,10 @@ extern int g_nCurFormatVersion;
|
||||
StyleLink = 23,
|
||||
lvl_NumFmt = 24,
|
||||
NumFmtVal = 25,
|
||||
NumFmtFormat = 26
|
||||
NumFmtFormat = 26,
|
||||
Num_LvlOverride = 27,
|
||||
StartOverride = 28,
|
||||
ILvl = 29
|
||||
};}
|
||||
namespace c_oSerOtherTableTypes{enum c_oSerOtherTableTypes
|
||||
{
|
||||
@ -262,7 +265,14 @@ extern int g_nCurFormatVersion;
|
||||
Style_RowPr = 15,
|
||||
Style_CellPr = 16,
|
||||
Style_TblStylePr = 17,
|
||||
Style_Link = 18
|
||||
Style_Link = 18,
|
||||
Style_CustomStyle = 19,
|
||||
Style_Aliases = 20,
|
||||
Style_AutoRedefine = 21,
|
||||
Style_Locked = 22,
|
||||
Style_Personal = 23,
|
||||
Style_PersonalCompose = 24,
|
||||
Style_PersonalReply = 25
|
||||
};}
|
||||
namespace c_oSerProp_tblStylePrType{enum c_oSerProp_tblStylePrType
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -599,7 +599,7 @@ namespace BinXlsxRW{
|
||||
//как в CsvReader - подозрительный код
|
||||
WCHAR *pEndPtr;
|
||||
wcstod(val.c_str(), &pEndPtr);
|
||||
if (NULL != *pEndPtr)
|
||||
if (0 != *pEndPtr)
|
||||
{
|
||||
// Не число
|
||||
aSharedStrings.push_back(val);
|
||||
|
||||
@ -67,7 +67,7 @@ bool BinDocxRW::CDocxSerializer::saveToFile(const std::wstring& sSrcFileName, co
|
||||
|
||||
COfficeFontPicker* pFontPicker = new COfficeFontPicker();
|
||||
pFontPicker->Init(m_sFontDir);
|
||||
CFontManager* pFontManager = pFontPicker->get_FontManager();
|
||||
NSFonts::IFontManager* pFontManager = pFontPicker->get_FontManager();
|
||||
DocWrapper::FontProcessor fp;
|
||||
fp.setFontManager(pFontManager);
|
||||
|
||||
@ -341,7 +341,7 @@ bool BinDocxRW::CDocxSerializer::getXmlContent(NSBinPptxRW::CBinaryFileReader& o
|
||||
long nLength = oBufferedStream.GetLong();
|
||||
Writers::ContentWriter oTempContentWriter;
|
||||
BinDocxRW::Binary_DocumentTableReader oBinary_DocumentTableReader(oBufferedStream, *m_pCurFileWriter, oTempContentWriter, m_pCurFileWriter->m_pComments);
|
||||
int res = oBinary_DocumentTableReader.Read1(nLength, &BinDocxRW::Binary_DocumentTableReader::ReadDocumentContent, &oBinary_DocumentTableReader, NULL);
|
||||
oBinary_DocumentTableReader.ReadDocumentContentOut(nLength);
|
||||
|
||||
sOutputXml = oTempContentWriter.m_oContent.GetData();
|
||||
return true;
|
||||
@ -433,13 +433,13 @@ bool BinDocxRW::CDocxSerializer::getXmlContentElem(OOX::EElementType eType, NSBi
|
||||
if(OOX::et_m_oMathPara == eType)
|
||||
{
|
||||
oTempContentWriter.m_oContent.WriteString(std::wstring(_T("<m:oMathPara>")));
|
||||
oBinary_DocumentTableReader.Read1(nLength, &BinDocxRW::Binary_DocumentTableReader::ReadMathOMathPara, &oBinary_DocumentTableReader, NULL);
|
||||
oBinary_DocumentTableReader.ReadMathOMathParaOut(nLength);
|
||||
oTempContentWriter.m_oContent.WriteString(std::wstring(_T("</m:oMathPara>")));
|
||||
}
|
||||
else if(OOX::et_m_oMath == eType)
|
||||
{
|
||||
oTempContentWriter.m_oContent.WriteString(std::wstring(_T("<m:oMath>")));
|
||||
oBinary_DocumentTableReader.Read1(nLength, &BinDocxRW::Binary_DocumentTableReader::ReadMathArg, &oBinary_DocumentTableReader, NULL);
|
||||
oBinary_DocumentTableReader.ReadMathArgOut(nLength);
|
||||
oTempContentWriter.m_oContent.WriteString(std::wstring(_T("</m:oMath>")));
|
||||
}
|
||||
|
||||
|
||||
@ -52,11 +52,11 @@ namespace DocWrapper {
|
||||
{
|
||||
}
|
||||
|
||||
void FontProcessor::setFontManager(CFontManager* pFontManager)
|
||||
void FontProcessor::setFontManager(NSFonts::IFontManager* pFontManager)
|
||||
{
|
||||
m_pFontManager = pFontManager;
|
||||
}
|
||||
CFontManager* FontProcessor::getFontManager()
|
||||
NSFonts::IFontManager* FontProcessor::getFontManager()
|
||||
{
|
||||
return m_pFontManager;
|
||||
}
|
||||
@ -88,7 +88,7 @@ namespace DocWrapper {
|
||||
|
||||
std::wstring FontProcessor::getFont(const NSCommon::nullable<OOX::Spreadsheet::CFontScheme>& oScheme, const NSCommon::nullable<ComplexTypes::Spreadsheet::String>& oRFont, const NSCommon::nullable<OOX::Spreadsheet::CCharset>& oCharset, const NSCommon::nullable<OOX::Spreadsheet::CFontFamily >& oFamily, PPTX::Theme* pTheme)
|
||||
{
|
||||
CFontSelectFormat oFontSelectFormat;
|
||||
NSFonts::CFontSelectFormat oFontSelectFormat;
|
||||
std::wstring sFontName;
|
||||
if(NULL != pTheme && oScheme.IsInit() && oScheme->m_oFontScheme.IsInit())
|
||||
{
|
||||
@ -125,7 +125,7 @@ namespace DocWrapper {
|
||||
}
|
||||
|
||||
std::wstring sRes;
|
||||
CFontInfo* pFontInfo = m_pFontManager->GetFontInfoByParams(oFontSelectFormat);
|
||||
NSFonts::CFontInfo* pFontInfo = m_pFontManager->GetFontInfoByParams(oFontSelectFormat);
|
||||
if(NULL != pFontInfo)
|
||||
sRes = pFontInfo->m_wsFontName;
|
||||
else
|
||||
@ -135,7 +135,7 @@ namespace DocWrapper {
|
||||
}
|
||||
void FontProcessor::addToFontMap(OOX::CFont& font)
|
||||
{
|
||||
CFontSelectFormat oFontSelectFormat;
|
||||
NSFonts::CFontSelectFormat oFontSelectFormat;
|
||||
std::wstring sFontName;
|
||||
|
||||
if(font.m_sName.empty())
|
||||
@ -221,7 +221,7 @@ namespace DocWrapper {
|
||||
*oFontSelectFormat.ulCodeRange2 = ulCodeRange2;
|
||||
}
|
||||
|
||||
CFontInfo* pFontInfo = m_pFontManager->GetFontInfoByParams(oFontSelectFormat);
|
||||
NSFonts::CFontInfo* pFontInfo = m_pFontManager->GetFontInfoByParams(oFontSelectFormat);
|
||||
if(NULL != pFontInfo)
|
||||
fontMap[sFontName] = pFontInfo->m_wsFontName;
|
||||
else
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#include "../../DesktopEditor/fontengine/ApplicationFonts.h"
|
||||
#include "../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
|
||||
namespace NSCommon{
|
||||
template<class Type> class nullable;
|
||||
@ -68,15 +68,15 @@ namespace DocWrapper
|
||||
{
|
||||
class FontProcessor
|
||||
{
|
||||
CFontManager* m_pFontManager;
|
||||
NSFonts::IFontManager* m_pFontManager;
|
||||
std::map<std::wstring, std::wstring> fontMap;
|
||||
|
||||
public:
|
||||
FontProcessor();
|
||||
~FontProcessor();
|
||||
|
||||
void setFontManager(CFontManager* pFontManager);
|
||||
CFontManager* getFontManager();
|
||||
void setFontManager(NSFonts::IFontManager* pFontManager);
|
||||
NSFonts::IFontManager* getFontManager();
|
||||
void setFontTable(OOX::CFontTable* fontTable);
|
||||
|
||||
std::wstring getFont(const std::wstring& name);
|
||||
|
||||
@ -104,7 +104,7 @@ namespace BinXlsxRW{
|
||||
{
|
||||
COfficeFontPicker* pFontPicker = new COfficeFontPicker();
|
||||
pFontPicker->Init(m_sFontDir);
|
||||
CFontManager* pFontManager = pFontPicker->get_FontManager();
|
||||
NSFonts::IFontManager* pFontManager = pFontPicker->get_FontManager();
|
||||
DocWrapper::FontProcessor fp;
|
||||
fp.setFontManager(pFontManager);
|
||||
|
||||
|
||||
@ -16,17 +16,9 @@ include($$PWD/../../Common/3dParty/boost/boost.pri)
|
||||
|
||||
DEFINES += UNICODE \
|
||||
_UNICODE \
|
||||
USE_AVSOFFICESTUDIO_XMLUTILS \
|
||||
SOLUTION_ASCOFFICEDOCXFILE2 \
|
||||
#DISABLE_FILE_DOWNLOADER \
|
||||
_USE_LIBXML2_READER_ \
|
||||
LIBXML_READER_ENABLED \
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
|
||||
|
||||
INCLUDEPATH += \
|
||||
../../DesktopEditor/freetype-2.5.2/include \
|
||||
../../DesktopEditor/xml/libxml2/include \
|
||||
#DISABLE_FILE_DOWNLOADER \
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
|
||||
|
||||
SOURCES += \
|
||||
|
||||
@ -51,6 +51,8 @@
|
||||
6967917F1D9E8AEE002CA4BA /* BinWriters.h in Headers */ = {isa = PBXBuildFile; fileRef = 6967917B1D9E8AEE002CA4BA /* BinWriters.h */; };
|
||||
69BBDF251F0B8AAC00EB1BF7 /* FileDownloader_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 69BBDF241F0B8AAC00EB1BF7 /* FileDownloader_mac.mm */; };
|
||||
69F181AF1C77274E00B2952B /* FileDownloader.h in Headers */ = {isa = PBXBuildFile; fileRef = 69F181AD1C77274E00B2952B /* FileDownloader.h */; };
|
||||
8A404FD3208A01AF00F2D5CF /* FileDownloader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A404FD2208A01AF00F2D5CF /* FileDownloader.cpp */; };
|
||||
8A404FD5208A01CE00F2D5CF /* FileDownloader_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@ -99,6 +101,8 @@
|
||||
6967917B1D9E8AEE002CA4BA /* BinWriters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BinWriters.h; path = ../../BinWriter/BinWriters.h; sourceTree = "<group>"; };
|
||||
69BBDF241F0B8AAC00EB1BF7 /* FileDownloader_mac.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp.preprocessed; fileEncoding = 4; name = FileDownloader_mac.mm; path = ../../../Common/FileDownloader/FileDownloader_mac.mm; sourceTree = "<group>"; };
|
||||
69F181AD1C77274E00B2952B /* FileDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileDownloader.h; path = ../../../Common/FileDownloader/FileDownloader.h; sourceTree = "<group>"; };
|
||||
8A404FD2208A01AF00F2D5CF /* FileDownloader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileDownloader.cpp; path = ../../../Common/FileDownloader/FileDownloader.cpp; sourceTree = "<group>"; };
|
||||
8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileDownloader_private.h; path = ../../../Common/FileDownloader/FileDownloader_private.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -231,6 +235,8 @@
|
||||
children = (
|
||||
69F181AD1C77274E00B2952B /* FileDownloader.h */,
|
||||
69BBDF241F0B8AAC00EB1BF7 /* FileDownloader_mac.mm */,
|
||||
8A404FD2208A01AF00F2D5CF /* FileDownloader.cpp */,
|
||||
8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */,
|
||||
);
|
||||
name = Common;
|
||||
sourceTree = "<group>";
|
||||
@ -273,6 +279,7 @@
|
||||
69F181AF1C77274E00B2952B /* FileDownloader.h in Headers */,
|
||||
17C1FEB01ACC42C4006B99B3 /* BinaryCommonReader.h in Headers */,
|
||||
17C1FEB11ACC42C4006B99B3 /* Common.h in Headers */,
|
||||
8A404FD5208A01CE00F2D5CF /* FileDownloader_private.h in Headers */,
|
||||
17C1FEB21ACC42C4006B99B3 /* XlsxSerializer.h in Headers */,
|
||||
17C1FEB31ACC42C4006B99B3 /* CSVReader.h in Headers */,
|
||||
6967917D1D9E8AEE002CA4BA /* BinReaderWriterDefines.h in Headers */,
|
||||
@ -351,6 +358,7 @@
|
||||
17C1FE9C1ACC42C4006B99B3 /* XlsxSerializer.cpp in Sources */,
|
||||
690FE0851E9BBD68004B26D0 /* Readers.cpp in Sources */,
|
||||
17C1FE9D1ACC42C4006B99B3 /* FontProcessor.cpp in Sources */,
|
||||
8A404FD3208A01AF00F2D5CF /* FileDownloader.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@ -2,14 +2,12 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml_wrapper", "..\win32\cpxml.vcproj", "{41BED424-4EAF-4053-8A5F-1E2A387D53D1}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFormatReaderLib", "..\win32\cpodf.vcproj", "{50E20601-4A8D-4AFB-8870-63828D328429}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{94954A67-A853-43B1-A727-6EF2774C5A6A} = {94954A67-A853-43B1-A727-6EF2774C5A6A}
|
||||
{41BED424-4EAF-4053-8A5F-1E2A387D53D1} = {41BED424-4EAF-4053-8A5F-1E2A387D53D1}
|
||||
{609ED938-3CA8-4BED-B363-25096D4C4812} = {609ED938-3CA8-4BED-B363-25096D4C4812}
|
||||
{94954A67-A853-43B1-A727-6EF2774C5A6A} = {94954A67-A853-43B1-A727-6EF2774C5A6A}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfCommon", "..\win32\cpcommon.vcproj", "{609ED938-3CA8-4BED-B363-25096D4C4812}"
|
||||
@ -21,74 +19,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFormulasConvert", "..\wi
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFileReaderTest", "OdfFileTest.vcproj", "{C2882DDD-07E6-4314-AD4B-48F43F38D722}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C}
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
|
||||
{41BED424-4EAF-4053-8A5F-1E2A387D53D1} = {41BED424-4EAF-4053-8A5F-1E2A387D53D1}
|
||||
{50E20601-4A8D-4AFB-8870-63828D328429} = {50E20601-4A8D-4AFB-8870-63828D328429}
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
|
||||
{609ED938-3CA8-4BED-B363-25096D4C4812} = {609ED938-3CA8-4BED-B363-25096D4C4812}
|
||||
{94954A67-A853-43B1-A727-6EF2774C5A6A} = {94954A67-A853-43B1-A727-6EF2774C5A6A}
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "font_engine", "..\..\DesktopEditor\fontengine\font_engine_vs2005.vcproj", "{C739151F-5384-41DF-A1A6-F089E2C1AD56}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "freetype", "..\..\DesktopEditor\freetype-2.5.2\builds\windows\vc2005\freetype.vcproj", "{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "raster", "..\..\DesktopEditor\raster\raster_vs2005.vcproj", "{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cximage", "..\..\DesktopEditor\cximage\CxImage\cximage_vs2005.vcproj", "{BC52A07C-A797-423D-8C4F-8678805BBB36}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239} = {764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169} = {DF861D33-9BC1-418C-82B1-581F590FE169}
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3} = {0588563C-F05C-428C-B21A-DD74756628B3}
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
|
||||
{40A69F40-063E-43FD-8543-455495D8733E} = {40A69F40-063E-43FD-8543-455495D8733E}
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E} = {9A037A69-D1DF-4505-AB2A-6CB3641C476E}
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D} = {FFDA5DA1-BB65-4695-B678-BE59B4A1355D}
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470} = {818753F2-DBB9-4D3B-898A-A604309BE470}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jasper", "..\..\DesktopEditor\cximage\jasper\jasper_vs2005.vcproj", "{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig", "..\..\DesktopEditor\cximage\jbig\jbig_vs2005.vcproj", "{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg", "..\..\DesktopEditor\cximage\jpeg\Jpeg_vs2005.vcproj", "{818753F2-DBB9-4D3B-898A-A604309BE470}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpsd", "..\..\DesktopEditor\cximage\libpsd\libpsd_vs2005.vcproj", "{9A037A69-D1DF-4505-AB2A-6CB3641C476E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mng", "..\..\DesktopEditor\cximage\mng\mng_vs2005.vcproj", "{40A69F40-063E-43FD-8543-455495D8733E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "png", "..\..\DesktopEditor\cximage\png\png_vs2005.vcproj", "{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdcr", "..\..\DesktopEditor\cximage\raw\libdcr_vs2005.vcproj", "{DF861D33-9BC1-418C-82B1-581F590FE169}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff", "..\..\DesktopEditor\cximage\tiff\Tiff_vs2005.vcproj", "{0588563C-F05C-428C-B21A-DD74756628B3}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jbig2", "..\..\DesktopEditor\raster\JBig2\win32\jbig2.vcproj", "{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "agg2d", "..\..\DesktopEditor\agg-2.4\agg_vs2005.vcproj", "{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OfficeUtilsLib", "..\..\OfficeUtils\win32\OfficeUtilsLib.vcproj", "{F8274B05-168E-4D6E-B843-AA7510725363}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libxml2", "..\..\DesktopEditor\xml\build\vs2005\libxml2.vcproj", "{21663823-DE45-479B-91D0-B4FEF4916EF0}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OfficeFileCrypt", "..\..\OfficeCryptReader\win32\ECMACryptReader.vcproj", "{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF} = {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}
|
||||
@ -188,278 +124,6 @@ Global
|
||||
{C2882DDD-07E6-4314-AD4B-48F43F38D722}.Release|Win32.Build.0 = Release|Win32
|
||||
{C2882DDD-07E6-4314-AD4B-48F43F38D722}.Release|x64.ActiveCfg = Release|x64
|
||||
{C2882DDD-07E6-4314-AD4B-48F43F38D722}.Release|x64.Build.0 = Release|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Debug|x64.Build.0 = Debug|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|Win32.Build.0 = Release|Win32
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|x64.ActiveCfg = Release|x64
|
||||
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}.Release|x64.Build.0 = Release|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Debug|x64.Build.0 = Debug|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|Win32.Build.0 = Release|Win32
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|x64.ActiveCfg = Release|x64
|
||||
{C739151F-5384-41DF-A1A6-F089E2C1AD56}.Release|x64.Build.0 = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Debug|x64.Build.0 = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|Win32.Build.0 = Release|Win32
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.ActiveCfg = Release|x64
|
||||
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}.Release|x64.Build.0 = Release|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Debug|x64.Build.0 = Debug|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|Win32.Build.0 = Release|Win32
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|x64.ActiveCfg = Release|x64
|
||||
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}.Release|x64.Build.0 = Release|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Debug|x64.Build.0 = Debug|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|Win32.Build.0 = Release|Win32
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|x64.ActiveCfg = Release|x64
|
||||
{BC52A07C-A797-423D-8C4F-8678805BBB36}.Release|x64.Build.0 = Release|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Debug|x64.Build.0 = Debug|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|Win32.Build.0 = Release|Win32
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|x64.ActiveCfg = Release|x64
|
||||
{FFDA5DA1-BB65-4695-B678-BE59B4A1355D}.Release|x64.Build.0 = Release|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Debug|x64.Build.0 = Debug|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|Win32.Build.0 = Release|Win32
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|x64.ActiveCfg = Release|x64
|
||||
{764C3A2D-FB0F-428E-B1C7-62D1DD2CE239}.Release|x64.Build.0 = Release|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Debug|x64.Build.0 = Debug|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|Win32.Build.0 = Release|Win32
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|x64.ActiveCfg = Release|x64
|
||||
{818753F2-DBB9-4D3B-898A-A604309BE470}.Release|x64.Build.0 = Release|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Debug|x64.Build.0 = Debug|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|Win32.Build.0 = Release|Win32
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|x64.ActiveCfg = Release|x64
|
||||
{9A037A69-D1DF-4505-AB2A-6CB3641C476E}.Release|x64.Build.0 = Release|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Debug|x64.Build.0 = Debug|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|Win32.Build.0 = Release|Win32
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|x64.ActiveCfg = Release|x64
|
||||
{40A69F40-063E-43FD-8543-455495D8733E}.Release|x64.Build.0 = Release|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Debug|x64.Build.0 = Debug|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|Win32.Build.0 = Release|Win32
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|x64.ActiveCfg = Release|x64
|
||||
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7}.Release|x64.Build.0 = Release|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Debug|x64.Build.0 = Debug|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|Win32.Build.0 = Release|Win32
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|x64.ActiveCfg = Release|x64
|
||||
{DF861D33-9BC1-418C-82B1-581F590FE169}.Release|x64.Build.0 = Release|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Debug|x64.Build.0 = Debug|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|Win32.Build.0 = Release|Win32
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|x64.ActiveCfg = Release|x64
|
||||
{0588563C-F05C-428C-B21A-DD74756628B3}.Release|x64.Build.0 = Release|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Debug|x64.Build.0 = Debug|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|Win32.Build.0 = Release|Win32
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|x64.ActiveCfg = Release|x64
|
||||
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}.Release|x64.Build.0 = Release|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Debug|x64.Build.0 = Debug|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|Win32.Build.0 = Release|Win32
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|x64.ActiveCfg = Release|x64
|
||||
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}.Release|x64.Build.0 = Release|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Debug|x64.Build.0 = Debug|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|Win32.Build.0 = Release|Win32
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|x64.ActiveCfg = Release|x64
|
||||
{F8274B05-168E-4D6E-B843-AA7510725363}.Release|x64.Build.0 = Release|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Debug|x64.Build.0 = Debug|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|Win32.Build.0 = Debug|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|x64.ActiveCfg = Debug|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Debug|x64.Build.0 = Debug|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|Win32.ActiveCfg = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|Win32.Build.0 = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|x64.ActiveCfg = Release|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.DLL-Import Release|x64.Build.0 = Release|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|Win32.Build.0 = Release|Win32
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.ActiveCfg = Release|x64
|
||||
{21663823-DE45-479B-91D0-B4FEF4916EF0}.Release|x64.Build.0 = Release|x64
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
|
||||
@ -44,6 +44,14 @@
|
||||
#if defined(_WIN64)
|
||||
#pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib")
|
||||
#elif defined (_WIN32)
|
||||
|
||||
#if defined(_DEBUG)
|
||||
#pragma comment(lib, "../../build/lib/win_32/DEBUG/graphics.lib")
|
||||
#pragma comment(lib, "../../build/lib/win_32/DEBUG/kernel.lib")
|
||||
#else
|
||||
#pragma comment(lib, "../../build/lib/win_32/graphics.lib")
|
||||
#pragma comment(lib, "../../build/lib/win_32/kernel.lib")
|
||||
#endif
|
||||
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
|
||||
#endif
|
||||
|
||||
@ -107,7 +115,7 @@ HRESULT convert_single(std::wstring srcFileName)
|
||||
|
||||
if (nResult == 0)
|
||||
{
|
||||
if (S_OK != oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), dstPath.c_str(), true))
|
||||
if (S_OK != oCOfficeUtils.CompressFileOrDirectory(dstTempPath, dstPath, true))
|
||||
nResult = -2;
|
||||
}
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_UNICODE;UNICODE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
@ -357,46 +357,6 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\DocxFormat\Source\Base\unicode_util.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\UnicodeConverter\UnicodeConverter.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DesktopEditor\xml\src\xmldom.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\DesktopEditor\xml\src\xmllight.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="OdfFileTest.cpp"
|
||||
@ -410,6 +370,10 @@
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\DocxFormat\Source\Base\unicode_util.cpp"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
||||
@ -21,14 +21,9 @@ include($$PWD/../../Common/3dParty/boost/boost.pri)
|
||||
|
||||
DEFINES += UNICODE \
|
||||
_UNICODE \
|
||||
_USE_LIBXML2_READER_ \
|
||||
LIBXML_READER_ENABLED \
|
||||
DONT_WRITE_EMBEDDED_FONTS
|
||||
|
||||
INCLUDEPATH += ../include
|
||||
INCLUDEPATH += ../../DesktopEditor/freetype-2.5.2/include
|
||||
INCLUDEPATH += ../../DesktopEditor/xml/libxml2/include
|
||||
INCLUDEPATH += ../../DesktopEditor/xml/build/qt
|
||||
|
||||
CONFIG(debug, debug|release){
|
||||
DEFINES += _DEBUG
|
||||
@ -78,9 +73,11 @@ SOURCES += \
|
||||
../src/odf/office_event_listeners.cpp \
|
||||
../src/odf/office_presentation.cpp \
|
||||
../src/odf/office_scripts.cpp \
|
||||
../src/odf/office_forms.cpp \
|
||||
../src/odf/office_settings.cpp \
|
||||
../src/odf/office_spreadsheet.cpp \
|
||||
../src/odf/office_text.cpp \
|
||||
../src/odf/office_meta.cpp \
|
||||
../src/odf/paragraph_elements.cpp \
|
||||
../src/odf/ruby.cpp \
|
||||
../src/odf/search_table_cell.cpp \
|
||||
@ -189,6 +186,7 @@ SOURCES += \
|
||||
../src/odf/datatypes/styleverticalrel.cpp \
|
||||
../src/odf/datatypes/stylewrap.cpp \
|
||||
../src/odf/datatypes/stylewrapcontourmode.cpp \
|
||||
../src/odf/datatypes/stylenumformat.cpp \
|
||||
../src/odf/datatypes/tablealign.cpp \
|
||||
../src/odf/datatypes/tablecentering.cpp \
|
||||
../src/odf/datatypes/tablemode.cpp \
|
||||
@ -216,6 +214,7 @@ SOURCES += \
|
||||
../src/odf/datatypes/tablefunction.cpp \
|
||||
../src/odf/datatypes/tableorder.cpp \
|
||||
../src/odf/datatypes/dategroup.cpp \
|
||||
../src/odfcommandtype.cpp \
|
||||
../src/docx/xlsx_conditionalFormatting.cpp \
|
||||
../src/docx/xlsx_dxfs.cpp \
|
||||
../src/docx/docx_content_type.cpp \
|
||||
@ -340,9 +339,11 @@ HEADERS += \
|
||||
../src/odf/office_event_listeners.h \
|
||||
../src/odf/office_presentation.h \
|
||||
../src/odf/office_scripts.h \
|
||||
../src/odf/office_forms.h \
|
||||
../src/odf/office_settings.h \
|
||||
../src/odf/office_spreadsheet.h \
|
||||
../src/odf/office_text.h \
|
||||
../src/odf/office_meta.h \
|
||||
../src/odf/paragraph_elements.h \
|
||||
../src/odf/ruby.h \
|
||||
../src/odf/search_table_cell.h \
|
||||
@ -377,6 +378,7 @@ HEADERS += \
|
||||
../src/odf/datatypes/mathvariant.h \
|
||||
../src/odf/calcext_elements.h \
|
||||
../src/odf/table_database_ranges.h \
|
||||
../src/odfcommandtype.h \
|
||||
../src/odf/datatypes/anchortype.h \
|
||||
../src/odf/datatypes/backgroundcolor.h \
|
||||
../src/odf/datatypes/bool.h \
|
||||
@ -450,6 +452,7 @@ HEADERS += \
|
||||
../src/odf/datatypes/styleverticalpos.h \
|
||||
../src/odf/datatypes/styleverticalrel.h \
|
||||
../src/odf/datatypes/stylewrap.h \
|
||||
../src/odf/datatypes/stylenumformat.h \
|
||||
../src/odf/datatypes/stylewrapcontourmode.h \
|
||||
../src/odf/datatypes/tablealign.h \
|
||||
../src/odf/datatypes/tablecentering.h \
|
||||
|
||||
@ -63,9 +63,11 @@
|
||||
#include "../src/odf/office_event_listeners.cpp"
|
||||
#include "../src/odf/office_presentation.cpp"
|
||||
#include "../src/odf/office_scripts.cpp"
|
||||
#include "../src/odf/office_forms.cpp"
|
||||
#include "../src/odf/office_settings.cpp"
|
||||
#include "../src/odf/office_spreadsheet.cpp"
|
||||
#include "../src/odf/office_text.cpp"
|
||||
#include "../src/odf/office_meta.cpp"
|
||||
#include "../src/odf/paragraph_elements.cpp"
|
||||
#include "../src/odf/ruby.cpp"
|
||||
#include "../src/odf/search_table_cell.cpp"
|
||||
|
||||
@ -127,3 +127,5 @@
|
||||
#include "../src/odf/datatypes/tablefunction.cpp"
|
||||
#include "../src/odf/datatypes/tableorder.cpp"
|
||||
#include "../src/odf/datatypes/dategroup.cpp"
|
||||
#include "../src/odf/datatypes/commandtype.cpp"
|
||||
#include "../src/odf/datatypes/stylenumformat.cpp"
|
||||
|
||||
@ -42,6 +42,8 @@
|
||||
#include "docx_conversion_context.h"
|
||||
|
||||
#include "../odf/odfcontext.h"
|
||||
#include "../odf/text_content.h"
|
||||
#include "../odf/calcs_styles.h"
|
||||
#include "../odf/style_paragraph_properties.h"
|
||||
#include "../odf/style_text_properties.h"
|
||||
#include "../odf/style_table_properties.h"
|
||||
@ -51,7 +53,7 @@
|
||||
#include "oox_rels.h"
|
||||
#include "logging.h"
|
||||
|
||||
#include "../../../DesktopEditor/fontengine/ApplicationFonts.h"
|
||||
#include "../../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
#include "../../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
|
||||
static int current_id_changes = 0;
|
||||
@ -100,7 +102,7 @@ void text_tracked_context::start_change (std::wstring id)
|
||||
}
|
||||
void text_tracked_context::end_change ()
|
||||
{
|
||||
mapChanges_.insert( std::pair<std::wstring, _state>(current_state_.id, current_state_));
|
||||
mapChanges_.insert( std::make_pair(current_state_.id, current_state_));
|
||||
|
||||
current_state_.clear();
|
||||
}
|
||||
@ -130,7 +132,54 @@ text_tracked_context::_state & text_tracked_context::get_tracked_change(std::wst
|
||||
return current_state_; //empty
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
void text_forms_context::start_element (int type)
|
||||
{
|
||||
current_state_.clear();
|
||||
|
||||
current_state_.type = type;
|
||||
}
|
||||
void text_forms_context::set_id (const std::wstring& id)
|
||||
{
|
||||
current_state_.id = id;
|
||||
}
|
||||
void text_forms_context::set_name (const std::wstring& name)
|
||||
{
|
||||
current_state_.name = name;
|
||||
}
|
||||
void text_forms_context::set_label (const std::wstring& label)
|
||||
{
|
||||
current_state_.label = label;
|
||||
}
|
||||
void text_forms_context::set_uuid (const std::wstring& uuid)
|
||||
{
|
||||
current_state_.uuid = uuid;
|
||||
}
|
||||
void text_forms_context::set_value (const std::wstring &value)
|
||||
{
|
||||
current_state_.value = value;
|
||||
}
|
||||
void text_forms_context::set_element(odf_reader::form_element *elm)
|
||||
{
|
||||
current_state_.element = elm;
|
||||
}
|
||||
void text_forms_context::end_element ()
|
||||
{
|
||||
mapElements_.insert( std::make_pair(current_state_.id, current_state_));
|
||||
|
||||
current_state_.clear();
|
||||
}
|
||||
text_forms_context::_state& text_forms_context::get_state_element (std::wstring id)
|
||||
{
|
||||
std::map<std::wstring, _state>::iterator it = mapElements_.find(id);
|
||||
|
||||
if (it != mapElements_.end())
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
else
|
||||
return current_state_; //empty
|
||||
}
|
||||
//----------------------------------------------------------------------------------------------------------------
|
||||
docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfDocument) :
|
||||
next_dump_page_properties_ (false),
|
||||
page_break_ (false),
|
||||
@ -141,6 +190,7 @@ docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfD
|
||||
in_paragraph_ (false),
|
||||
in_header_ (false),
|
||||
in_drawing_content_ (false),
|
||||
in_table_content_ (false),
|
||||
text_tracked_context_ (*this),
|
||||
table_context_ (*this),
|
||||
output_document_ (NULL),
|
||||
@ -158,7 +208,7 @@ docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfD
|
||||
odf_document_ (OdfDocument)
|
||||
{
|
||||
streams_man_ = streams_man::create(temp_stream_);
|
||||
applicationFonts_ = new CApplicationFonts();
|
||||
applicationFonts_ = NSFonts::NSApplication::Create();
|
||||
}
|
||||
docx_conversion_context::~docx_conversion_context()
|
||||
{
|
||||
@ -254,20 +304,21 @@ void docx_conversion_context::finish_paragraph()
|
||||
|
||||
void docx_conversion_context::finish_run()
|
||||
{
|
||||
if (in_run_)
|
||||
{
|
||||
output_stream() << L"</w:r>";
|
||||
in_run_ = false;
|
||||
if (get_comments_context().state()==2)
|
||||
{
|
||||
output_stream()<< L"<w:commentRangeEnd w:id=\"" << get_comments_context().current_id() << L"\" />";
|
||||
|
||||
add_element_to_run();
|
||||
output_stream()<< L"<w:commentReference w:id=\"" << get_comments_context().current_id() << L"\" />";
|
||||
get_comments_context().state(0);
|
||||
finish_run();
|
||||
}
|
||||
}
|
||||
if (false == in_run_) return;
|
||||
|
||||
output_stream() << L"</w:r>";
|
||||
in_run_ = false;
|
||||
|
||||
if (get_comments_context().state()==2)
|
||||
{
|
||||
output_stream()<< L"<w:commentRangeEnd w:id=\"" << get_comments_context().current_id() << L"\"/>";
|
||||
|
||||
add_element_to_run();
|
||||
output_stream()<< L"<w:commentReference w:id=\"" << get_comments_context().current_id() << L"\"/>";
|
||||
get_comments_context().state(0);
|
||||
finish_run();
|
||||
}
|
||||
|
||||
}
|
||||
void docx_conversion_context::start_math_formula()
|
||||
{
|
||||
@ -283,6 +334,73 @@ void docx_conversion_context::end_math_formula()
|
||||
output_stream() << L"<m:oMath>" << math_content << L"</m:oMath>";
|
||||
}
|
||||
}
|
||||
void docx_conversion_context::start_table_content(int type)
|
||||
{
|
||||
in_table_content_ = true;
|
||||
|
||||
std::wstring sType;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case 1: sType = L"Table of Contents"; break;
|
||||
case 2: sType = L"List od Illustrations"; break;
|
||||
}
|
||||
|
||||
output_stream() << L"<w:sdt>";
|
||||
output_stream() << L"<w:sdtPr>";
|
||||
//output_stream() << L"<w:id w:val=\"-505364165\"/>";
|
||||
output_stream() << L"<w:docPartObj>";
|
||||
output_stream() << L"<w:docPartGallery w:val=\"" << sType << L"\"/>";
|
||||
output_stream() << L"<w:docPartUnique/>";
|
||||
output_stream() << L"</w:docPartObj>";
|
||||
output_stream() << L"</w:sdtPr>";
|
||||
output_stream() << L"<w:sdtContent>";
|
||||
}
|
||||
|
||||
void docx_conversion_context::end_table_content()
|
||||
{
|
||||
if (!in_table_content_) return;
|
||||
|
||||
output_stream() << L"</w:sdtContent>";
|
||||
output_stream() << L"</w:sdt>";
|
||||
|
||||
in_table_content_ = false;
|
||||
}
|
||||
void docx_conversion_context::start_bookmark (const std::wstring &name)
|
||||
{
|
||||
std::map<std::wstring, int>::iterator pFind = mapBookmarks.find(name);
|
||||
|
||||
int id = -1;
|
||||
if (pFind == mapBookmarks.end())
|
||||
{
|
||||
id = mapBookmarks.size() + 1;
|
||||
mapBookmarks.insert(std::make_pair(name, id));
|
||||
}
|
||||
else
|
||||
{
|
||||
id = pFind->second;
|
||||
}
|
||||
|
||||
finish_run();
|
||||
output_stream() << L"<w:bookmarkStart w:id=\"" << std::to_wstring(id) << L"\" w:name=\"" << name << L"\"/>";
|
||||
}
|
||||
|
||||
void docx_conversion_context::end_bookmark (const std::wstring &name)
|
||||
{
|
||||
std::map<std::wstring, int>::iterator pFind = mapBookmarks.find(name);
|
||||
|
||||
int id = -1;
|
||||
if (pFind == mapBookmarks.end())
|
||||
{
|
||||
return; //???
|
||||
}
|
||||
else
|
||||
{
|
||||
id = pFind->second;
|
||||
}
|
||||
finish_run();
|
||||
output_stream() << L"<w:bookmarkEnd w:id=\"" << std::to_wstring(id) << L"\"/>";
|
||||
}
|
||||
|
||||
void docx_conversion_context::start_chart(std::wstring name)
|
||||
{
|
||||
@ -333,17 +451,11 @@ hyperlinks::_ref docx_conversion_context::last_hyperlink()
|
||||
return hyperlinks_.last();
|
||||
}
|
||||
|
||||
|
||||
void docx_conversion_context::dump_hyperlinks(rels & Rels, hyperlinks::_type_place type)
|
||||
{
|
||||
hyperlinks_.dump_rels(Rels, type);
|
||||
}
|
||||
|
||||
void docx_conversion_context::dump_mediaitems(rels & Rels)
|
||||
{
|
||||
mediaitems_.dump_rels(Rels);
|
||||
}
|
||||
|
||||
void docx_conversion_context::dump_headers_footers(rels & Rels) const
|
||||
{
|
||||
headers_footers_.dump_rels(Rels);
|
||||
@ -353,12 +465,6 @@ void docx_conversion_context::dump_notes(rels & Rels) const
|
||||
{
|
||||
notes_context_.dump_rels(Rels);
|
||||
}
|
||||
|
||||
std::wstring docx_conversion_context::add_mediaitem(const std::wstring & uri, RelsType type, bool & isInternal, std::wstring & ref)
|
||||
{
|
||||
return mediaitems_.add_or_find(uri, type, isInternal, ref);
|
||||
}
|
||||
|
||||
void docx_conversion_context::start_document()
|
||||
{
|
||||
streams_man_ = streams_man::create(document_xml_);
|
||||
@ -381,7 +487,11 @@ void docx_conversion_context::start_document()
|
||||
output_stream() << L"xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" ";
|
||||
output_stream() << L"xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" ";
|
||||
output_stream() << L"xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" ";
|
||||
output_stream() << L"mc:Ignorable=\"w14 wp14\">";
|
||||
output_stream() << L"xmlns:cx=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" ";
|
||||
output_stream() << L"xmlns:cx1=\"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex\" ";
|
||||
output_stream() << L"xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" ";
|
||||
output_stream() << L"xmlns:w16se=\"http://schemas.microsoft.com/office/word/2015/wordml/symex\" ";
|
||||
output_stream() << L"mc:Ignorable=\"w14 w15 w16se wne wp14\">";
|
||||
|
||||
|
||||
//apply page-default prop
|
||||
@ -868,13 +978,13 @@ bool docx_conversion_context::process_page_properties(std::wostream & strm)
|
||||
|
||||
void docx_conversion_context::end_process_style_content(bool in_styles)
|
||||
{
|
||||
docx_serialize_paragraph_style(output_stream(), automatic_parent_style_, in_styles);
|
||||
serialize_paragraph_style(output_stream(), automatic_parent_style_, in_styles);
|
||||
|
||||
if (automatic_parent_style_.empty())
|
||||
styles_context_.docx_serialize_text_style( output_stream(), L"", text_tracked_context_.dumpRPr_);
|
||||
}
|
||||
|
||||
void docx_conversion_context::docx_serialize_paragraph_style(std::wostream & strm, const std::wstring & ParentId, bool in_styles)
|
||||
void docx_conversion_context::serialize_paragraph_style(std::wostream & strm, const std::wstring & ParentId, bool in_styles)
|
||||
//in_styles = true -> styles.xml
|
||||
//почему то конструкция <pPr><rPr/></pPr><rPr/> "не работает" в части в rPr в ms2010 )
|
||||
{
|
||||
@ -919,7 +1029,7 @@ void docx_conversion_context::docx_serialize_paragraph_style(std::wostream & str
|
||||
}
|
||||
}
|
||||
CP_XML_STREAM() << paragraph_style.str();
|
||||
docx_serialize_list_properties(CP_XML_STREAM());
|
||||
serialize_list_properties(CP_XML_STREAM());
|
||||
|
||||
|
||||
if ((run_style.tellp() > 0 && in_styles == false) || !get_text_tracked_context().dumpRPrInsDel_.empty())
|
||||
@ -952,7 +1062,8 @@ void docx_conversion_context::start_automatic_style(const std::wstring & ParentI
|
||||
void docx_conversion_context::end_automatic_style()
|
||||
{
|
||||
in_automatic_style_ = false;
|
||||
automatic_parent_style_ = L"";
|
||||
automatic_parent_style_.clear();
|
||||
tabs_context_.clear();
|
||||
}
|
||||
|
||||
bool docx_conversion_context::in_automatic_style()
|
||||
@ -1125,8 +1236,208 @@ std::wstring docx_conversion_context::find_list_rename(const std::wstring & List
|
||||
void docx_conversion_context::end_list_item()
|
||||
{
|
||||
}
|
||||
int docx_conversion_context::process_text_attr(odf_reader::text::paragraph_attrs *Attr)
|
||||
{
|
||||
if ( Attr->text_style_name_.empty() ) return 0;
|
||||
|
||||
void docx_conversion_context::docx_serialize_list_properties(std::wostream & strm)
|
||||
odf_reader::style_instance * styleInst =
|
||||
root()->odf_context().styleContainer().style_by_name(Attr->text_style_name_, odf_types::style_family::Paragraph, process_headers_footers_);
|
||||
|
||||
if (!styleInst) return 0;
|
||||
|
||||
if (false == styleInst->is_automatic()) return 0;
|
||||
|
||||
odf_reader::style_content *styleContent = styleInst->content();
|
||||
|
||||
if (!styleContent) return 0;
|
||||
|
||||
push_text_properties(styleContent->get_style_text_properties());
|
||||
return 1;
|
||||
}
|
||||
int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_attrs *Attr)
|
||||
{
|
||||
if (!Attr) return 0;
|
||||
|
||||
bool in_drawing = false;
|
||||
|
||||
if (get_drawing_context().get_current_shape() || get_drawing_context().get_current_frame())
|
||||
{
|
||||
in_drawing = true;
|
||||
}
|
||||
|
||||
if (false == Attr->text_style_name_.empty())
|
||||
{
|
||||
if (odf_reader::style_instance * styleInst =
|
||||
root()->odf_context().styleContainer().style_by_name(Attr->text_style_name_, odf_types::style_family::Paragraph, process_headers_footers_)
|
||||
)
|
||||
{
|
||||
process_page_break_after(styleInst);
|
||||
if (styleInst->is_automatic())
|
||||
{
|
||||
if (odf_reader::style_content * styleContent = styleInst->content())
|
||||
{
|
||||
std::wstring id;
|
||||
//office_element_ptr parent_tab_stops_;
|
||||
if (const odf_reader::style_instance * parentStyleContent = styleInst->parent())
|
||||
{
|
||||
id = styles_map_.get( parentStyleContent->name(), parentStyleContent->type() );
|
||||
|
||||
//odf_reader::paragraph_format_properties parent_properties = odf_reader::calc_paragraph_properties_content(styleInst);
|
||||
//parent_tab_stops_ = parent_properties.style_tab_stops_;
|
||||
}
|
||||
|
||||
start_automatic_style(id);
|
||||
|
||||
odf_reader::calc_tab_stops(styleInst, get_tabs_context());
|
||||
|
||||
//вытаскивает rtl c цепочки стилей !! - просто прописать в наследуемом НЕЛЬЗЯ !!
|
||||
odf_reader::paragraph_format_properties properties = odf_reader::calc_paragraph_properties_content(styleInst);
|
||||
if (properties.style_writing_mode_)
|
||||
{
|
||||
odf_types::writing_mode::type type = properties.style_writing_mode_->get_type();
|
||||
switch(type)
|
||||
{
|
||||
case odf_types::writing_mode::RlTb:
|
||||
case odf_types::writing_mode::TbRl:
|
||||
case odf_types::writing_mode::Rl:
|
||||
set_rtl(true);
|
||||
break;
|
||||
default:
|
||||
set_rtl(false);
|
||||
}
|
||||
}
|
||||
set_margin_left(properties.fo_margin_left_? 20.0 * properties.fo_margin_left_->get_length().get_value_unit(odf_types::length::pt) : 0);
|
||||
|
||||
styleContent->docx_convert(*this);
|
||||
|
||||
end_automatic_style();
|
||||
|
||||
push_text_properties(styleContent->get_style_text_properties());
|
||||
|
||||
if (!get_section_context().dump_.empty()
|
||||
&& !get_table_context().in_table()
|
||||
&& (get_process_note() == oox::docx_conversion_context::noNote)
|
||||
&& !in_drawing)
|
||||
{
|
||||
output_stream() << L"<w:pPr>";
|
||||
if (is_paragraph_header() )
|
||||
{
|
||||
output_stream() << get_section_context().dump_;
|
||||
get_section_context().dump_.clear();
|
||||
|
||||
output_stream() << L"</w:pPr>";
|
||||
finish_paragraph();
|
||||
start_paragraph();
|
||||
}
|
||||
else
|
||||
{
|
||||
output_stream() << get_section_context().dump_;
|
||||
get_section_context().dump_.clear();
|
||||
output_stream() << L"</w:pPr>";
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const std::wstring id = styles_map_.get( styleInst->name(), styleInst->type() );
|
||||
output_stream() << L"<w:pPr>";
|
||||
//todooo причесать
|
||||
if (!get_section_context().dump_.empty()
|
||||
&& !get_table_context().in_table()
|
||||
&& (get_process_note() == oox::docx_conversion_context::noNote)
|
||||
&& !in_drawing)
|
||||
{
|
||||
if (is_paragraph_header() )
|
||||
{
|
||||
output_stream() << get_section_context().dump_;
|
||||
get_section_context().dump_.clear();
|
||||
|
||||
output_stream() << L"</w:pPr>";
|
||||
finish_paragraph();
|
||||
start_paragraph();
|
||||
output_stream() << L"<w:pPr>";
|
||||
}
|
||||
else
|
||||
{
|
||||
output_stream() << get_section_context().dump_;
|
||||
get_section_context().dump_.clear();
|
||||
}
|
||||
}
|
||||
|
||||
output_stream() << L"<w:pStyle w:val=\"" << id << L"\" />";
|
||||
|
||||
if (!get_text_tracked_context().dumpPPr_.empty())
|
||||
{
|
||||
output_stream() << get_text_tracked_context().dumpPPr_;
|
||||
get_text_tracked_context().dumpPPr_.clear();
|
||||
}
|
||||
|
||||
serialize_list_properties(output_stream());
|
||||
|
||||
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
|
||||
{
|
||||
output_stream() << L"<w:outlineLvl w:val=\"" << *Attr->outline_level_ - 1 << L"\" />";
|
||||
}
|
||||
|
||||
if (!get_text_tracked_context().dumpRPrInsDel_.empty())
|
||||
{
|
||||
output_stream() << L"<w:rPr>";
|
||||
output_stream() << get_text_tracked_context().dumpRPrInsDel_;
|
||||
get_text_tracked_context().dumpRPrInsDel_.clear();
|
||||
output_stream() << L"</w:rPr>";
|
||||
}
|
||||
output_stream() << L"</w:pPr>";
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!get_section_context().dump_.empty()
|
||||
&& !get_table_context().in_table()
|
||||
&& (get_process_note() == oox::docx_conversion_context::noNote)
|
||||
&& !in_drawing)
|
||||
{
|
||||
output_stream() << L"<w:pPr>";
|
||||
output_stream() << get_section_context().dump_;
|
||||
get_section_context().dump_.clear();
|
||||
//todooo выяснить реальны ли заголовки без стилей и свойств
|
||||
output_stream() << L"</w:pPr>";
|
||||
return 3;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void docx_conversion_context::process_page_break_after(const odf_reader::style_instance * styleInst)
|
||||
{
|
||||
if (styleInst)
|
||||
{
|
||||
const odf_reader::style_instance * inst = styleInst;
|
||||
while (inst)
|
||||
{
|
||||
if (inst->content() && inst->content()->get_style_paragraph_properties())
|
||||
{
|
||||
_CP_OPT(odf_types::fo_break) fo_break_val = inst->content()->get_style_paragraph_properties()->content_.fo_break_after_;
|
||||
if (fo_break_val)
|
||||
{
|
||||
if (fo_break_val->get_type() == odf_types::fo_break::Page)
|
||||
{
|
||||
set_page_break_after(true);
|
||||
break;
|
||||
}
|
||||
else if (fo_break_val->get_type() == odf_types::fo_break::Auto)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
inst = inst->parent();
|
||||
}
|
||||
}
|
||||
}
|
||||
void docx_conversion_context::serialize_list_properties(std::wostream & strm)
|
||||
{
|
||||
if (!list_style_stack_.empty())
|
||||
{
|
||||
@ -1203,7 +1514,7 @@ namespace
|
||||
//слить если есть mediaitems, добавить релсы и обнулить их для основного документа.
|
||||
rels internal_rels;
|
||||
|
||||
Context.dump_mediaitems(internal_rels);
|
||||
Context.get_mediaitems().dump_rels(internal_rels);
|
||||
Context.dump_hyperlinks(internal_rels, hyperlinks::document_place);
|
||||
|
||||
Context.get_headers_footers().add(styleName, dbgStr, type, internal_rels);
|
||||
@ -1504,6 +1815,7 @@ void docx_conversion_context::add_user_field(const std::wstring & name, const st
|
||||
{
|
||||
map_user_fields.insert(std::make_pair(name, value));
|
||||
}
|
||||
|
||||
std::wstring docx_conversion_context::get_user_field(const std::wstring & name)
|
||||
{
|
||||
std::map<std::wstring, std::wstring>::iterator pFind = map_user_fields.find(name);
|
||||
|
||||
@ -33,21 +33,21 @@
|
||||
|
||||
#include "../odf/datatypes/stylefamily.h"
|
||||
#include "../odf/datatypes/length.h"
|
||||
#include "../odf/datatypes/noteclass.h"
|
||||
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <list>
|
||||
|
||||
#include "hyperlinks.h"
|
||||
#include "mediaitems.h"
|
||||
#include "headers_footers.h"
|
||||
#include "docx_table_context.h"
|
||||
#include "../odf/datatypes/noteclass.h"
|
||||
|
||||
#include "oox_conversion_context.h"
|
||||
#include "oox_chart_context.h"
|
||||
|
||||
class CApplicationFonts;
|
||||
#include "headers_footers.h"
|
||||
#include "hyperlinks.h"
|
||||
#include "mediaitems.h"
|
||||
|
||||
#include "../../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -62,12 +62,15 @@ namespace cpdoccore {
|
||||
class style_text_properties;
|
||||
class draw_frame;
|
||||
class draw_shape;
|
||||
class draw_control;
|
||||
class office_element;
|
||||
class style_columns;
|
||||
class form_element;
|
||||
|
||||
namespace text
|
||||
{
|
||||
class note_citation;
|
||||
class paragraph_attrs;
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,8 +120,6 @@ private:
|
||||
std::wstring name(const std::wstring & Name, odf_types::style_family::type Type);
|
||||
|
||||
size_t count_;
|
||||
//boost::unordered_map<std::wstring, std::wstring> map_;
|
||||
|
||||
std::multimap<std::wstring, std::wstring> map_;
|
||||
};
|
||||
|
||||
@ -164,7 +165,16 @@ public:
|
||||
current_object_name_ = L"";
|
||||
current_shape_ = drawShape;
|
||||
}
|
||||
void start_group()
|
||||
void start_control(odf_reader::draw_control * drawControl)
|
||||
{
|
||||
current_level_++;
|
||||
objects_count_++;
|
||||
|
||||
current_shape_id_ = objects_count_;
|
||||
current_object_name_ = L"";
|
||||
current_control_ = drawControl;
|
||||
}
|
||||
void start_group()
|
||||
{
|
||||
current_level_++;
|
||||
objects_count_++;
|
||||
@ -212,6 +222,7 @@ public:
|
||||
{
|
||||
current_level_--;
|
||||
frames_.pop_back();
|
||||
caption_.clear();
|
||||
}
|
||||
|
||||
std::wstring & get_text_stream_frame()
|
||||
@ -228,7 +239,6 @@ public:
|
||||
else
|
||||
throw;
|
||||
}
|
||||
|
||||
std::wstring & get_text_stream_shape()
|
||||
{
|
||||
return shape_text_content_;
|
||||
@ -239,15 +249,24 @@ public:
|
||||
}
|
||||
void clear_stream_frame()
|
||||
{
|
||||
if (frames_.size()>0)
|
||||
frames_.back().text_content=L"";
|
||||
if (!frames_.empty())
|
||||
frames_.back().text_content.clear();
|
||||
}
|
||||
void stop_shape()
|
||||
{
|
||||
current_level_--;
|
||||
current_shape_ = NULL;
|
||||
shape_text_content_=L"";
|
||||
current_shape_id_ =0;
|
||||
shape_text_content_.clear();
|
||||
current_shape_id_ = 0;
|
||||
caption_.clear();
|
||||
}
|
||||
void stop_control()
|
||||
{
|
||||
current_level_--;
|
||||
current_control_ = NULL;
|
||||
shape_text_content_.clear();
|
||||
current_shape_id_ = 0;
|
||||
caption_.clear();
|
||||
}
|
||||
void stop_group()
|
||||
{
|
||||
@ -257,10 +276,10 @@ public:
|
||||
|
||||
int get_current_frame_id() const
|
||||
{
|
||||
if (frames_.size()>0) return frames_.back().id;
|
||||
if (!frames_.empty()) return frames_.back().id;
|
||||
else return 0;
|
||||
}
|
||||
bool in_group() { return groups_.size() > 0; }
|
||||
bool in_group() { return !groups_.empty(); }
|
||||
int get_current_level() const { return current_level_; }
|
||||
int get_current_shape_id() const { return current_shape_id_; }
|
||||
|
||||
@ -268,10 +287,15 @@ public:
|
||||
|
||||
odf_reader::draw_frame * get_current_frame() const
|
||||
{
|
||||
if (frames_.size()>0) return frames_.back().ptr;
|
||||
if (!frames_.empty()) return frames_.back().ptr;
|
||||
else return NULL;
|
||||
}
|
||||
odf_reader::draw_shape * get_current_shape() const { return current_shape_; }
|
||||
|
||||
void set_next_object_caption(const std::wstring & value)
|
||||
{
|
||||
caption_ = value;
|
||||
}
|
||||
|
||||
private:
|
||||
std::wstring shape_text_content_;
|
||||
@ -284,10 +308,13 @@ private:
|
||||
std::vector<_group> groups_;
|
||||
std::vector<_frame> frames_;
|
||||
|
||||
odf_reader::draw_shape * current_shape_;
|
||||
odf_reader::draw_shape *current_shape_;
|
||||
size_t current_shape_id_;
|
||||
|
||||
odf_reader::draw_control*current_control_;
|
||||
|
||||
std::wstring zero_string_;
|
||||
std::wstring caption_;
|
||||
|
||||
};
|
||||
|
||||
@ -544,6 +571,48 @@ private:
|
||||
|
||||
std::map<std::wstring, _state> mapChanges_;
|
||||
};
|
||||
|
||||
class text_forms_context
|
||||
{
|
||||
public:
|
||||
struct _state
|
||||
{
|
||||
std::wstring id;
|
||||
std::wstring name;
|
||||
int type = 0; //enum?
|
||||
std::wstring label;
|
||||
std::wstring uuid;
|
||||
std::wstring value;
|
||||
odf_reader::form_element* element = NULL;
|
||||
|
||||
void clear()
|
||||
{
|
||||
type = 0;
|
||||
id.clear();
|
||||
name.clear();
|
||||
label.clear();
|
||||
value.clear();
|
||||
uuid.clear();
|
||||
element = NULL;
|
||||
}
|
||||
};
|
||||
text_forms_context(){}
|
||||
|
||||
void start_element (int type);
|
||||
void set_id (const std::wstring& id);
|
||||
void set_name (const std::wstring& name);
|
||||
void set_label (const std::wstring& label);
|
||||
void set_uuid (const std::wstring& uuid);
|
||||
void set_value (const std::wstring& value);
|
||||
void set_element(odf_reader::form_element *elm);
|
||||
void end_element ();
|
||||
|
||||
_state& get_state_element (std::wstring id);
|
||||
|
||||
private:
|
||||
_state current_state_;
|
||||
std::map<std::wstring, _state> mapElements_;
|
||||
};
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
class docx_conversion_context : boost::noncopyable
|
||||
{
|
||||
@ -567,7 +636,7 @@ public:
|
||||
void add_user_field (const std::wstring & name, const std::wstring & value);
|
||||
std::wstring get_user_field (const std::wstring & name);
|
||||
|
||||
void add_element_to_run (std::wstring parenStyleId = _T(""));
|
||||
void add_element_to_run (std::wstring parenStyleId = _T(""));
|
||||
void finish_run ();
|
||||
void add_new_run (std::wstring parentStyleId = _T(""));
|
||||
bool get_run_state () { return in_run_; }
|
||||
@ -576,11 +645,13 @@ public:
|
||||
void start_paragraph (bool is_header = false);
|
||||
void finish_paragraph ();
|
||||
|
||||
bool is_table_content () { return in_table_content_; }
|
||||
bool is_paragraph_header () { return in_header_; }
|
||||
bool get_paragraph_state () { return in_paragraph_; }
|
||||
void set_paragraph_state (bool val) { in_paragraph_ = val; }
|
||||
bool get_paragraph_keep () { return is_paragraph_keep_;}
|
||||
void set_paragraph_keep (bool val) { is_paragraph_keep_ = val; }
|
||||
|
||||
bool get_delete_text_state () { return is_delete_text_; }
|
||||
void set_delete_text_state (bool Val) { is_delete_text_ = Val; }
|
||||
|
||||
@ -591,9 +662,6 @@ public:
|
||||
hyperlinks::_ref last_hyperlink ();
|
||||
void dump_hyperlinks (rels & Rels, hyperlinks::_type_place type);
|
||||
|
||||
std::wstring add_mediaitem(const std::wstring & uri, RelsType type, bool & isInternal, std::wstring & ref);
|
||||
|
||||
void dump_mediaitems (rels & Rels);
|
||||
void dump_headers_footers (rels & Rels) const;
|
||||
void dump_notes (rels & Rels) const;
|
||||
|
||||
@ -616,7 +684,10 @@ public:
|
||||
void start_office_text ();
|
||||
void end_office_text ();
|
||||
|
||||
void process_styles ();
|
||||
void start_table_content (int type);
|
||||
void end_table_content ();
|
||||
|
||||
void process_styles ();
|
||||
void process_fonts ();
|
||||
|
||||
void process_list_styles ();
|
||||
@ -624,6 +695,10 @@ public:
|
||||
void process_comments ();
|
||||
bool process_page_properties(std::wostream & strm);
|
||||
void process_section (std::wostream & strm, odf_reader::style_columns * columns = NULL);
|
||||
|
||||
int process_paragraph_attr (odf_reader::text::paragraph_attrs *attr);
|
||||
int process_text_attr (odf_reader::text::paragraph_attrs *Attr);
|
||||
void process_page_break_after(const odf_reader::style_instance *styleInst);
|
||||
|
||||
std::vector<odf_reader::_property> & get_settings_properties ();
|
||||
void set_settings_property (const odf_reader::_property & prop);
|
||||
@ -670,13 +745,14 @@ public:
|
||||
void start_list_item (bool restart = false);
|
||||
void end_list_item ();
|
||||
|
||||
void docx_serialize_list_properties(std::wostream & strm);
|
||||
void docx_serialize_paragraph_style(std::wostream & strm, const std::wstring & ParentId, bool in_styles = false);
|
||||
void serialize_list_properties(std::wostream & strm);
|
||||
void serialize_paragraph_style(std::wostream & strm, const std::wstring & ParentId, bool in_styles = false);
|
||||
|
||||
std::wstring find_list_rename(const std::wstring & ListStyleName) const;
|
||||
|
||||
styles_map * get_style_map() { return &styles_map_; }
|
||||
|
||||
mediaitems & get_mediaitems() {return mediaitems_;}
|
||||
styles_context & get_styles_context() { return styles_context_; }
|
||||
drawing_context & get_drawing_context() { return drawing_context_; }
|
||||
comments_context & get_comments_context() { return comments_context_; }
|
||||
@ -684,6 +760,8 @@ public:
|
||||
section_context & get_section_context() { return section_context_; }
|
||||
notes_context & get_notes_context() { return notes_context_; }
|
||||
text_tracked_context& get_text_tracked_context(){ return text_tracked_context_; }
|
||||
text_forms_context & get_forms_context() { return text_forms_context_; }
|
||||
tabs_context & get_tabs_context() { return tabs_context_;}
|
||||
|
||||
void docx_convert_delayed ();
|
||||
void add_delayed_element (odf_reader::office_element * Elm);
|
||||
@ -717,6 +795,9 @@ public:
|
||||
void start_text_changes (std::wstring id);
|
||||
void end_text_changes (std::wstring id);
|
||||
|
||||
void start_bookmark (const std::wstring &name);
|
||||
void end_bookmark (const std::wstring &name);
|
||||
|
||||
void set_process_headers_footers(bool Val) { process_headers_footers_ = Val; }
|
||||
headers_footers & get_headers_footers() { return headers_footers_; }
|
||||
header_footer_context & get_header_footer_context() { return header_footer_context_; }
|
||||
@ -742,6 +823,7 @@ private:
|
||||
std::wstringstream footer_xml_;
|
||||
std::wstringstream header_xml_;
|
||||
std::wstringstream settings_xml_;
|
||||
std::wstringstream meta_xml_;
|
||||
|
||||
styles_context styles_context_;
|
||||
math_context math_context_;
|
||||
@ -753,12 +835,14 @@ private:
|
||||
header_footer_context header_footer_context_;
|
||||
notes_context notes_context_;
|
||||
text_tracked_context text_tracked_context_;
|
||||
text_forms_context text_forms_context_;
|
||||
tabs_context tabs_context_;
|
||||
|
||||
boost::shared_ptr<streams_man> streams_man_;
|
||||
|
||||
package::docx_document * output_document_;
|
||||
odf_reader::odf_document * odf_document_;
|
||||
CApplicationFonts * applicationFonts_;
|
||||
NSFonts::IApplicationFonts * applicationFonts_;
|
||||
|
||||
std::vector<odf_reader::_property> settings_properties_;
|
||||
|
||||
@ -779,6 +863,7 @@ private:
|
||||
|
||||
bool in_automatic_style_;
|
||||
bool in_drawing_content_;
|
||||
bool in_table_content_;
|
||||
bool in_paragraph_;
|
||||
bool in_run_;
|
||||
bool in_header_;
|
||||
@ -797,6 +882,7 @@ private:
|
||||
boost::unordered_map<std::wstring, std::wstring> list_style_renames_;// цепочки переименований нумераций
|
||||
|
||||
std::map<std::wstring, std::wstring> map_user_fields;
|
||||
std::map<std::wstring, int> mapBookmarks;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -607,6 +607,42 @@ void docx_serialize_object(std::wostream & strm, _docx_drawing & val)
|
||||
}
|
||||
}
|
||||
|
||||
void docx_serialize_control(std::wostream & strm, _docx_drawing & val)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"w:pict")
|
||||
{
|
||||
CP_XML_NODE(L"v:shape")
|
||||
{
|
||||
CP_XML_ATTR(L"id", L"control_" + val.objectId);
|
||||
|
||||
std::wstring style_str; // = L"width:730.6pt; height:261.8pt";
|
||||
|
||||
style_str += L"width:" + boost::lexical_cast<std::wstring>(val.cx / 12700.) + L"pt;";
|
||||
style_str += L"height:" + boost::lexical_cast<std::wstring>(val.cy / 12700.) + L"pt;";
|
||||
|
||||
CP_XML_ATTR(L"style", style_str);
|
||||
|
||||
if (val.fill.bitmap)
|
||||
{
|
||||
CP_XML_NODE(L"v:imagedata")
|
||||
{
|
||||
CP_XML_ATTR(L"o:title", val.name);
|
||||
CP_XML_ATTR(L"r:id", val.fill.bitmap->rId);
|
||||
}
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"w:control")
|
||||
{
|
||||
CP_XML_ATTR(L"w:name", val.name);
|
||||
CP_XML_ATTR(L"w:shapeid", L"control_" + val.objectId);
|
||||
CP_XML_ATTR(L"r:id", val.objectId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _docx_drawing::serialize(std::wostream & strm/*, bool insideOtherDrawing*/)
|
||||
{
|
||||
if (type == typeUnknown) return;
|
||||
@ -619,6 +655,10 @@ void _docx_drawing::serialize(std::wostream & strm/*, bool insideOtherDrawing*/)
|
||||
{
|
||||
docx_serialize_object(strm, *this);
|
||||
}
|
||||
else if (type == typeControl)
|
||||
{
|
||||
docx_serialize_control(strm, *this);
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (insideOtherDrawing)
|
||||
|
||||
@ -134,13 +134,14 @@ void word_files::write(const std::wstring & RootPath)
|
||||
|
||||
void word_files::update_rels(docx_conversion_context & Context)
|
||||
{
|
||||
Context.get_mediaitems().dump_rels(rels_files_.get_rel_file()->get_rels());
|
||||
|
||||
Context.dump_hyperlinks (rels_files_.get_rel_file()->get_rels(), hyperlinks::document_place);
|
||||
Context.dump_mediaitems (rels_files_.get_rel_file()->get_rels());
|
||||
Context.dump_headers_footers(rels_files_.get_rel_file()->get_rels());
|
||||
Context.dump_notes (rels_files_.get_rel_file()->get_rels());
|
||||
}
|
||||
|
||||
void word_files::set_media(mediaitems & _Mediaitems, CApplicationFonts *pAppFonts)
|
||||
void word_files::set_media(mediaitems & _Mediaitems, NSFonts::IApplicationFonts *pAppFonts)
|
||||
{
|
||||
if (_Mediaitems.count_image + _Mediaitems.count_media > 0)
|
||||
{
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
#include "docx_content_type.h"
|
||||
#include "oox_package.h"
|
||||
|
||||
class CApplicationFonts;
|
||||
#include "../../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
@ -130,7 +130,7 @@ public:
|
||||
void set_numbering (element_ptr Element);
|
||||
void set_settings (element_ptr Element);
|
||||
bool has_numbering ();
|
||||
void set_media (mediaitems & _Mediaitems, CApplicationFonts *pAppFonts);
|
||||
void set_media (mediaitems & _Mediaitems, NSFonts::IApplicationFonts *pAppFonts);
|
||||
void set_headers_footers(headers_footers & HeadersFooters);
|
||||
void set_notes (notes_context & notesContext);
|
||||
void set_comments (comments_context & commentsContext);
|
||||
|
||||
@ -39,10 +39,9 @@
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
/**/
|
||||
|
||||
docx_table_state::docx_table_state(docx_conversion_context & Context,
|
||||
const std::wstring & StyleName) : context_(Context),
|
||||
docx_table_state::docx_table_state(docx_conversion_context & Context, const std::wstring & StyleName) :
|
||||
context_(Context),
|
||||
table_style_(StyleName),
|
||||
current_table_column_(-1),
|
||||
columns_spanned_num_(0),
|
||||
@ -93,6 +92,19 @@ std::wstring docx_table_state::current_row_style() const
|
||||
return L"";
|
||||
}
|
||||
|
||||
double docx_table_state::get_current_cell_width()
|
||||
{
|
||||
if (current_table_column_ < columns_width_.size())
|
||||
return columns_width_[current_table_column_];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
void docx_table_state::add_column_width(double width)
|
||||
{
|
||||
columns_width_.push_back(width);
|
||||
}
|
||||
|
||||
void docx_table_state::start_cell()
|
||||
{
|
||||
current_table_column_++;
|
||||
@ -102,7 +114,6 @@ void docx_table_state::start_cell()
|
||||
|
||||
void docx_table_state::end_cell()
|
||||
{}
|
||||
|
||||
bool docx_table_state::start_covered_cell(docx_conversion_context & Context)
|
||||
{
|
||||
std::wostream & _Wostream = context_.output_stream();
|
||||
|
||||
@ -70,6 +70,8 @@ public:
|
||||
void set_rows_spanned(unsigned int Column, unsigned int Val, unsigned int ColumnsSpanned, const std::wstring & Style);
|
||||
unsigned int current_rows_spanned(unsigned int Column) const;
|
||||
|
||||
double get_current_cell_width();
|
||||
void add_column_width(double width);
|
||||
private:
|
||||
docx_conversion_context & context_;
|
||||
std::wstring table_style_;
|
||||
@ -81,7 +83,8 @@ private:
|
||||
std::vector<table_row_spanned> rows_spanned_;
|
||||
bool close_table_covered_cell_;
|
||||
std::vector<unsigned int> columns_;
|
||||
std::vector<std::wstring> columnsDefaultCellStyleName_;
|
||||
std::vector<double> columns_width_;
|
||||
std::vector<std::wstring> columnsDefaultCellStyleName_;
|
||||
|
||||
};
|
||||
|
||||
@ -135,6 +138,14 @@ public:
|
||||
{
|
||||
return table_states_.back().start_cell();
|
||||
}
|
||||
double get_current_cell_width()
|
||||
{
|
||||
return table_states_.back().get_current_cell_width();
|
||||
}
|
||||
void add_column_width(double width)
|
||||
{
|
||||
table_states_.back().add_column_width(width);
|
||||
}
|
||||
|
||||
void end_cell()
|
||||
{
|
||||
|
||||
@ -36,8 +36,7 @@
|
||||
|
||||
#include <float.h>
|
||||
|
||||
#include "../../DesktopEditor/fontengine/FontManager.h"
|
||||
#include "../../DesktopEditor/fontengine/ApplicationFonts.h"
|
||||
#include "../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace utils {
|
||||
@ -49,7 +48,7 @@ namespace
|
||||
class MeasureError : public Error {};
|
||||
}
|
||||
|
||||
std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, CFontManager *pFontManager)
|
||||
std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, NSFonts::IFontManager *pFontManager)
|
||||
{
|
||||
if (pFontManager == NULL) return std::pair<float, float>(7,8);
|
||||
|
||||
@ -102,7 +101,7 @@ std::pair<float, float> GetMaxDigitSizePixelsImpl(const std::wstring & fontName,
|
||||
}
|
||||
|
||||
|
||||
std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, CApplicationFonts *appFonts)
|
||||
std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, NSFonts::IApplicationFonts *appFonts)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -110,13 +109,12 @@ std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, dou
|
||||
|
||||
if (appFonts)
|
||||
{
|
||||
CFontManager *pFontManager = appFonts->GenerateFontManager();
|
||||
NSFonts::IFontManager *pFontManager = appFonts->GenerateFontManager();
|
||||
|
||||
std::pair<float, float> val = GetMaxDigitSizePixelsImpl(fontName, fontSize, dpi, fontStyle, pFontManager);
|
||||
|
||||
if (pFontManager)
|
||||
{
|
||||
pFontManager->m_pApplication = NULL;
|
||||
{
|
||||
delete pFontManager;
|
||||
}
|
||||
|
||||
|
||||
@ -34,12 +34,15 @@
|
||||
#include <utility>
|
||||
#include <string>
|
||||
|
||||
class CApplicationFonts;
|
||||
namespace NSFonts
|
||||
{
|
||||
class IApplicationFonts;
|
||||
}
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace utils {
|
||||
|
||||
std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, CApplicationFonts *appFonts);
|
||||
std::pair<float, float> GetMaxDigitSizePixels(const std::wstring & fontName, double fontSize, double dpi, long fontStyle, NSFonts::IApplicationFonts *appFonts);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,7 +70,14 @@ void oox_chart_context::reset_fill(oox::_oox_fill &f)
|
||||
rels_.push_back(_rel(isInternal, f.bitmap->rId, ref, typeImage));
|
||||
}
|
||||
}
|
||||
|
||||
void oox_chart_context::set_externalData(const std::wstring & href)
|
||||
{
|
||||
bool isInternal = true;
|
||||
std::wstring href_out;
|
||||
|
||||
externalDataId_ = mediaitems_.add_or_find(href, typeMsObject, isInternal, href_out);
|
||||
rels_.push_back(_rel(isInternal, externalDataId_, href_out, typeMsObject));
|
||||
}
|
||||
std::wostream & oox_chart_context::chartData()
|
||||
{
|
||||
return impl_->chartData_;
|
||||
@ -78,7 +85,7 @@ std::wostream & oox_chart_context::chartData()
|
||||
|
||||
void oox_chart_context::dump_rels(rels & Rels)
|
||||
{
|
||||
for (int i = 0; i < rels_.size(); i++)
|
||||
for (size_t i = 0; i < rels_.size(); i++)
|
||||
{
|
||||
_rel & r = rels_[i];
|
||||
|
||||
@ -88,8 +95,7 @@ void oox_chart_context::dump_rels(rels & Rels)
|
||||
r.rid,
|
||||
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",
|
||||
r.is_internal ? std::wstring(L"../") + r.ref : r.ref,
|
||||
(r.is_internal ? L"" : L"External")
|
||||
)
|
||||
(r.is_internal ? L"" : L"External"))
|
||||
);
|
||||
}
|
||||
else if (r.type == typeHyperlink)
|
||||
@ -101,6 +107,15 @@ void oox_chart_context::dump_rels(rels & Rels)
|
||||
L"External")
|
||||
);
|
||||
}
|
||||
else if (r.type == typeMsObject)
|
||||
{
|
||||
Rels.add(relationship(
|
||||
r.rid,
|
||||
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",
|
||||
r.is_internal ? std::wstring(L"../") + r.ref : r.ref,
|
||||
(r.is_internal ? L"" : L"External"))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,10 +214,21 @@ void oox_chart_context::serialize(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (externalDataId_.empty() == false)
|
||||
{
|
||||
CP_XML_NODE(L"c:externalData")
|
||||
{
|
||||
CP_XML_ATTR(L"r:id", externalDataId_);
|
||||
CP_XML_NODE(L"c:autoUpdate")
|
||||
{
|
||||
CP_XML_ATTR(L"val", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
oox_chart_context::~oox_chart_context()
|
||||
{
|
||||
}
|
||||
|
||||
@ -82,6 +82,7 @@ public:
|
||||
plot_area_.charts_[i]->is3D_ = val;
|
||||
}
|
||||
}
|
||||
void set_externalData(const std::wstring & href);
|
||||
void add_chart(int type)
|
||||
{
|
||||
plot_area_.add_chart(type);
|
||||
@ -135,6 +136,7 @@ private:
|
||||
cpdoccore::oox::oox_chart_legend legend_;
|
||||
|
||||
std::wstring pivot_source_;
|
||||
std::wstring externalDataId_;
|
||||
|
||||
std::vector<odf_reader::_property> graphic_properties_;
|
||||
_oox_fill fill_;
|
||||
|
||||
@ -70,17 +70,12 @@ void oox_chart_series::setFormula(int ind, std::wstring &value, std::wstring & f
|
||||
|
||||
if (ind == 0)
|
||||
{
|
||||
if (std::wstring::npos != value.find(L"local-table")) return;
|
||||
|
||||
values_[ind].strRef_.formula = converter.convert_chart_distance(value);
|
||||
values_[ind].strRef_.present = true;
|
||||
values_[ind].present = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (std::wstring::npos != value.find(L"local-table") && !bLocalTable_ ) return;
|
||||
//в xlsx низя .... нужно сделать тогда отдельную table.xml
|
||||
|
||||
values_[ind].numRef_.formula = converter.convert_chart_distance(value);
|
||||
values_[ind].numRef_.present = true;
|
||||
values_[ind].numRef_.formatCode = formatCode;
|
||||
|
||||
@ -39,9 +39,58 @@
|
||||
|
||||
#include "../odf/odfcontext.h"
|
||||
#include "../odf/style_text_properties.h"
|
||||
#include "../odf/style_paragraph_properties.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
void tabs_context::reset()
|
||||
{
|
||||
for (size_t i = 0; i < tabs.size(); i++)
|
||||
{
|
||||
odf_reader::style_tab_stop *tab_stop = dynamic_cast<odf_reader::style_tab_stop*>(tabs[i].get());
|
||||
if (tab_stop)
|
||||
{
|
||||
clear_tabs.insert(std::make_pair(tab_stop->style_position_.get_value(), tabs[i]));
|
||||
}
|
||||
}
|
||||
tabs.clear();
|
||||
}
|
||||
void tabs_context::add(const odf_reader::office_element_ptr & element)
|
||||
{
|
||||
odf_reader::style_tab_stop *tab_stop = dynamic_cast<odf_reader::style_tab_stop*>(element.get());
|
||||
if (tab_stop)
|
||||
{
|
||||
std::map<double, odf_reader::office_element_ptr>::iterator pFind = clear_tabs.find(tab_stop->style_position_.get_value());
|
||||
|
||||
if (pFind != clear_tabs.end())
|
||||
{
|
||||
clear_tabs.erase(pFind);
|
||||
}
|
||||
tabs.push_back(element);
|
||||
}
|
||||
}
|
||||
void tabs_context::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
if (clear_tabs.empty() && tabs.empty()) return;
|
||||
|
||||
std::wstringstream & _pPr = Context.get_styles_context().paragraph_nodes();
|
||||
|
||||
_pPr << L"<w:tabs>";
|
||||
|
||||
for (std::map<double, odf_reader::office_element_ptr>::iterator it = clear_tabs.begin(); it != clear_tabs.end(); ++it)
|
||||
{
|
||||
odf_reader::style_tab_stop * tab_stop = dynamic_cast<odf_reader::style_tab_stop*>(it->second.get());
|
||||
tab_stop->docx_convert(Context, true);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < tabs.size(); i++)
|
||||
{
|
||||
odf_reader::style_tab_stop * tab_stop = dynamic_cast<odf_reader::style_tab_stop*>(tabs[i].get());
|
||||
tab_stop->docx_convert(Context, false);
|
||||
}
|
||||
_pPr << L"</w:tabs>";
|
||||
}
|
||||
|
||||
void styles_context::start_process_style(const odf_reader::style_instance * Instance)
|
||||
{
|
||||
current_processed_style_ = Instance;
|
||||
|
||||
@ -33,6 +33,8 @@
|
||||
|
||||
#include <sstream>
|
||||
#include <iosfwd>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
@ -40,14 +42,41 @@
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
namespace oox{
|
||||
|
||||
class docx_conversion_context;
|
||||
class pptx_conversion_context;
|
||||
};
|
||||
|
||||
namespace odf_reader
|
||||
{
|
||||
class style_instance;
|
||||
class style_text_properties;
|
||||
class fonts_container;
|
||||
typedef boost::shared_ptr<style_text_properties> style_text_properties_ptr;
|
||||
|
||||
class office_element;
|
||||
typedef boost::shared_ptr<office_element> office_element_ptr;
|
||||
};
|
||||
|
||||
class tabs_context : boost::noncopyable
|
||||
{
|
||||
public:
|
||||
|
||||
std::vector<odf_reader::office_element_ptr> tabs;
|
||||
std::map<double, odf_reader::office_element_ptr> clear_tabs;
|
||||
|
||||
void clear()
|
||||
{
|
||||
tabs.clear();
|
||||
clear_tabs.clear();
|
||||
}
|
||||
|
||||
void reset();
|
||||
|
||||
void add(const odf_reader::office_element_ptr & element);
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
};
|
||||
class styles_context : boost::noncopyable
|
||||
{
|
||||
public:
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
#include "mediaitems.h"
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
#include "../../DesktopEditor/raster/Metafile/MetaFile.h"
|
||||
#include "../../DesktopEditor/graphics/pro/Image.h"
|
||||
#include "../../DesktopEditor/raster/ImageFileFormatChecker.h"
|
||||
#include "../../Common/DocxFormat/Source/Base/Base.h"
|
||||
|
||||
@ -46,17 +46,19 @@ namespace cpdoccore {
|
||||
namespace oox {
|
||||
namespace package {
|
||||
|
||||
static void ConvertSvmToImage(std::wstring &file_svm, std::wstring &file_png, CApplicationFonts *pAppFonts)
|
||||
static void ConvertSvmToImage(std::wstring &file_svm, std::wstring &file_png, NSFonts::IApplicationFonts *pAppFonts)
|
||||
{
|
||||
MetaFile::CMetaFile oMetaFile(pAppFonts);
|
||||
MetaFile::IMetaFile* pMetaFile = MetaFile::Create(pAppFonts);
|
||||
|
||||
if (oMetaFile.LoadFromFile(file_svm.c_str()))
|
||||
if (pMetaFile->LoadFromFile(file_svm.c_str()))
|
||||
{
|
||||
double w, h, x, y;
|
||||
oMetaFile.GetBounds(&x, &y, &w, &h);
|
||||
oMetaFile.ConvertToRaster(file_png.c_str(), 4, w);
|
||||
oMetaFile.Close();
|
||||
pMetaFile->GetBounds(&x, &y, &w, &h);
|
||||
pMetaFile->ConvertToRaster(file_png.c_str(), 4, w);
|
||||
pMetaFile->Close();
|
||||
}
|
||||
|
||||
RELEASEOBJECT(pMetaFile);
|
||||
}
|
||||
|
||||
static std::wstring get_mime_type(const std::wstring & extension)
|
||||
@ -331,7 +333,7 @@ void docProps_files::write(const std::wstring & RootPath)
|
||||
////////////
|
||||
|
||||
|
||||
media::media(mediaitems & _Mediaitems, CApplicationFonts *pAppFonts) : mediaitems_(_Mediaitems), appFonts_(pAppFonts)
|
||||
media::media(mediaitems & _Mediaitems, NSFonts::IApplicationFonts *pAppFonts) : mediaitems_(_Mediaitems), appFonts_(pAppFonts)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,10 @@
|
||||
#include "../../../Common/DocxFormat/Source/Base/Base.h"
|
||||
#include "../../../DesktopEditor/common/Directory.h"
|
||||
|
||||
class CApplicationFonts;
|
||||
namespace NSFonts
|
||||
{
|
||||
class IApplicationFonts;
|
||||
}
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
@ -202,14 +205,14 @@ private:
|
||||
class media : public element
|
||||
{
|
||||
public:
|
||||
media(mediaitems & _Mediaitems, CApplicationFonts *pAppFonts);
|
||||
media(mediaitems & _Mediaitems, NSFonts::IApplicationFonts *pAppFonts);
|
||||
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
private:
|
||||
mediaitems & mediaitems_;
|
||||
CApplicationFonts * appFonts_;
|
||||
NSFonts::IApplicationFonts * appFonts_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -55,7 +55,8 @@ enum RelsType
|
||||
typeOleObject,
|
||||
typeSlide,
|
||||
typeVideo,
|
||||
typeAudio
|
||||
typeAudio,
|
||||
typeControl
|
||||
};
|
||||
|
||||
struct _rel
|
||||
|
||||
@ -184,7 +184,7 @@ void oox_bar_chart::oox_serialize(std::wostream & _Wostream)
|
||||
}
|
||||
CP_XML_NODE(L"c:varyColors")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
|
||||
}
|
||||
oox_serialize_common(CP_XML_STREAM());
|
||||
|
||||
@ -226,7 +226,7 @@ void oox_line_chart::oox_serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE(L"c:varyColors")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
|
||||
}
|
||||
oox_serialize_common(CP_XML_STREAM());
|
||||
|
||||
@ -259,7 +259,7 @@ void oox_area_chart::oox_serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE(L"c:varyColors")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
|
||||
}
|
||||
oox_serialize_common(CP_XML_STREAM());
|
||||
|
||||
@ -289,7 +289,7 @@ void oox_bubble_chart::oox_serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE(L"c:varyColors")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
|
||||
}
|
||||
oox_serialize_common(CP_XML_STREAM());
|
||||
//CP_XML_NODE(L"c:bubbleScale")
|
||||
@ -326,7 +326,7 @@ void oox_doughnut_chart::oox_serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE(L"c:varyColors")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
|
||||
}
|
||||
oox_serialize_common(CP_XML_STREAM());
|
||||
|
||||
@ -366,7 +366,7 @@ void oox_pie_chart::oox_serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE(L"c:varyColors")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
|
||||
}
|
||||
oox_serialize_common(CP_XML_STREAM());
|
||||
}
|
||||
@ -398,7 +398,7 @@ void oox_radar_chart::oox_serialize(std::wostream & _Wostream)
|
||||
}
|
||||
CP_XML_NODE(L"c:varyColors")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
|
||||
}
|
||||
oox_serialize_common(CP_XML_STREAM());
|
||||
|
||||
@ -436,7 +436,7 @@ void oox_scatter_chart::oox_serialize(std::wostream & _Wostream)
|
||||
}
|
||||
CP_XML_NODE(L"c:varyColors")
|
||||
{
|
||||
CP_XML_ATTR(L"val", 1);
|
||||
CP_XML_ATTR(L"val", varyColors_ ? L"1" : L"0");
|
||||
}
|
||||
oox_serialize_common(CP_XML_STREAM());
|
||||
|
||||
|
||||
@ -67,6 +67,7 @@ public:
|
||||
is3D_ = false;
|
||||
type_ = 0;
|
||||
dispBlanksAs_ = L"zero";
|
||||
varyColors_ = true;
|
||||
}
|
||||
~oox_chart(){}
|
||||
|
||||
@ -99,6 +100,7 @@ public:
|
||||
|
||||
int type_;
|
||||
bool is3D_;
|
||||
bool varyColors_;
|
||||
std::wstring dispBlanksAs_;
|
||||
std::vector<int> axisId_; // axId (Axis ID) §21.2.2.9
|
||||
std::wstring grouping_; // clustered | percentStacked | stacked | standard
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
#include "pptx_default_serializes.h"
|
||||
|
||||
#include "../../DesktopEditor/fontengine/ApplicationFonts.h"
|
||||
#include "../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -72,7 +72,7 @@ pptx_conversion_context::pptx_conversion_context( odf_reader::odf_document * odf
|
||||
,last_idx_placeHolder (1)
|
||||
,last_uniq_big_id (1)
|
||||
{
|
||||
applicationFonts_ = new CApplicationFonts();
|
||||
applicationFonts_ = NSFonts::NSApplication::Create();
|
||||
}
|
||||
|
||||
pptx_conversion_context::~pptx_conversion_context()
|
||||
|
||||
@ -44,7 +44,10 @@
|
||||
|
||||
#include "mediaitems.h"
|
||||
|
||||
class CApplicationFonts;
|
||||
namespace NSFonts
|
||||
{
|
||||
class IApplicationFonts;
|
||||
}
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -152,7 +155,7 @@ private:
|
||||
|
||||
package::pptx_document * output_document_;
|
||||
odf_reader::odf_document * odf_document_;
|
||||
CApplicationFonts * applicationFonts_;
|
||||
NSFonts::IApplicationFonts * applicationFonts_;
|
||||
|
||||
pptx_slide_context pptx_slide_context_;
|
||||
pptx_text_context pptx_text_context_;
|
||||
|
||||
@ -504,7 +504,7 @@ void ppt_files::add_notesMaster(slide_content_ptr slide)
|
||||
{
|
||||
notesMaster_files_.add_slide(slide);
|
||||
}
|
||||
void ppt_files::set_media(mediaitems & _Mediaitems, CApplicationFonts *pAppFonts)
|
||||
void ppt_files::set_media(mediaitems & _Mediaitems, NSFonts::IApplicationFonts *pAppFonts)
|
||||
{
|
||||
if (_Mediaitems.count_image + _Mediaitems.count_media > 0)
|
||||
{
|
||||
|
||||
@ -35,7 +35,10 @@
|
||||
#include <cpdoccore/CPNoncopyable.h>
|
||||
#include "pptx_comments.h"
|
||||
|
||||
class CApplicationFonts;
|
||||
namespace NSFonts
|
||||
{
|
||||
class IApplicationFonts;
|
||||
}
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
@ -214,7 +217,7 @@ public:
|
||||
void add_notes (slide_content_ptr sheet);
|
||||
void add_notesMaster(slide_content_ptr sheet);
|
||||
|
||||
void set_media(mediaitems & _Mediaitems, CApplicationFonts *pAppFonts);
|
||||
void set_media(mediaitems & _Mediaitems, NSFonts::IApplicationFonts *pAppFonts);
|
||||
void add_charts(chart_content_ptr chart);
|
||||
void add_theme (pptx_xml_theme_ptr theme);
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ void xlsx_serialize_text(std::wostream & strm, _xlsx_drawing & val)
|
||||
odf_reader::GetProperty ( val.additional ,L"text-content", strTextContent);
|
||||
|
||||
if (!strTextContent)return;
|
||||
if (strTextContent.get().length()<1)return;
|
||||
if (strTextContent->empty())return;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -65,7 +65,7 @@ void xlsx_serialize_text(std::wostream & strm, _xlsx_drawing & val)
|
||||
CP_XML_NODE(L"a:lstStyle");
|
||||
if (strTextContent)
|
||||
{
|
||||
CP_XML_STREAM() << strTextContent.get();
|
||||
CP_XML_STREAM() << *strTextContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,6 +36,8 @@
|
||||
|
||||
#include <cpdoccore/utf8cpp/utf8.h>
|
||||
|
||||
#include "../../../DesktopEditor/common/Directory.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
namespace package {
|
||||
@ -275,7 +277,7 @@ void xl_files::add_sheet(sheet_content_ptr sheet)
|
||||
sheets_files_.add_sheet(sheet);
|
||||
}
|
||||
|
||||
void xl_files::set_media(mediaitems & _Mediaitems, CApplicationFonts *pAppFonts)
|
||||
void xl_files::set_media(mediaitems & _Mediaitems, NSFonts::IApplicationFonts *pAppFonts)
|
||||
{
|
||||
if (_Mediaitems.count_image + _Mediaitems.count_media > 0)
|
||||
{
|
||||
|
||||
@ -38,7 +38,10 @@
|
||||
#include "xlsx_drawings.h"
|
||||
#include "xlsx_comments.h"
|
||||
|
||||
class CApplicationFonts;
|
||||
namespace NSFonts
|
||||
{
|
||||
class IApplicationFonts;
|
||||
}
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
@ -222,7 +225,7 @@ public:
|
||||
void set_sharedStrings (element_ptr Element);
|
||||
void set_connections (element_ptr Element);
|
||||
void add_sheet (sheet_content_ptr sheet);
|
||||
void set_media (mediaitems & _Mediaitems, CApplicationFonts *pAppFonts);
|
||||
void set_media (mediaitems & _Mediaitems, NSFonts::IApplicationFonts *pAppFonts);
|
||||
void set_drawings (element_ptr Element);
|
||||
void set_vml_drawings (element_ptr Element);
|
||||
void set_comments (element_ptr Element);
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
#include "../odf/odfcontext.h"
|
||||
#include "../odf/calcs_styles.h"
|
||||
|
||||
#include "../../DesktopEditor/fontengine/ApplicationFonts.h"
|
||||
#include "../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
|
||||
|
||||
namespace cpdoccore {
|
||||
@ -76,7 +76,7 @@ xlsx_conversion_context::xlsx_conversion_context(odf_reader::odf_document * odfD
|
||||
mediaitems_ (odf_document_->get_folder()),
|
||||
xlsx_drawing_context_handle_(mediaitems_)
|
||||
{
|
||||
applicationFonts_ = new CApplicationFonts();
|
||||
applicationFonts_ = NSFonts::NSApplication::Create();
|
||||
}
|
||||
|
||||
void xlsx_conversion_context::set_output_document (package::xlsx_document * document)
|
||||
|
||||
@ -54,7 +54,10 @@
|
||||
|
||||
#include "mediaitems.h"
|
||||
|
||||
class CApplicationFonts;
|
||||
namespace NSFonts
|
||||
{
|
||||
class IApplicationFonts;
|
||||
}
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -194,7 +197,7 @@ private:
|
||||
const odf_reader::office_element *spreadsheet_;
|
||||
odf_reader::odf_document *odf_document_;
|
||||
|
||||
CApplicationFonts *applicationFonts_;
|
||||
NSFonts::IApplicationFonts *applicationFonts_;
|
||||
|
||||
std::vector<xlsx_xml_worksheet_ptr> sheets_;
|
||||
std::vector<oox_chart_context_ptr> charts_;
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
#include "office_spreadsheet.h"
|
||||
#include "office_presentation.h"
|
||||
#include "office_scripts.h"
|
||||
#include "office_forms.h"
|
||||
#include "office_settings.h"
|
||||
#include "paragraph_elements.h"
|
||||
#include "office_binary_data.h"
|
||||
|
||||
@ -31,8 +31,6 @@
|
||||
*/
|
||||
|
||||
#include "calcs_styles.h"
|
||||
#include <boost/foreach.hpp>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
namespace cpdoccore {
|
||||
@ -44,10 +42,10 @@ namespace odf_reader {
|
||||
text_format_properties_content calc_text_properties_content(const std::vector<const style_text_properties*> & textProps)
|
||||
{
|
||||
text_format_properties_content result;
|
||||
BOOST_FOREACH(const style_text_properties* v, textProps)
|
||||
for (size_t i = 0; i < textProps.size(); i++)
|
||||
{
|
||||
if (v)
|
||||
result.apply_from(v->content());
|
||||
if (textProps[i])
|
||||
result.apply_from(textProps[i]->content());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -60,20 +58,21 @@ text_format_properties_content calc_text_properties_content(const style_instance
|
||||
{
|
||||
if (const style_content * content = styleInstance->content())
|
||||
if (const style_text_properties * textProp = content->get_style_text_properties())
|
||||
textProps.push_back(textProp);
|
||||
{
|
||||
textProps.insert(textProps.begin(), textProp);
|
||||
}
|
||||
|
||||
styleInstance = styleInstance->parent();
|
||||
}
|
||||
reverse(textProps.begin(), textProps.end());
|
||||
return calc_text_properties_content(textProps);
|
||||
}
|
||||
|
||||
text_format_properties_content calc_text_properties_content(const std::vector<const style_instance *> & styleInstances)
|
||||
{
|
||||
text_format_properties_content result;
|
||||
BOOST_FOREACH(const style_instance * inst, styleInstances)
|
||||
for (size_t i = 0; i < styleInstances.size(); i++)
|
||||
{
|
||||
result.apply_from(calc_text_properties_content(inst));
|
||||
result.apply_from(calc_text_properties_content(styleInstances[i]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -82,10 +81,10 @@ text_format_properties_content calc_text_properties_content(const std::vector<co
|
||||
graphic_format_properties calc_graphic_properties_content(const std::vector<const graphic_format_properties*> & graphicProps)
|
||||
{
|
||||
graphic_format_properties result;
|
||||
BOOST_FOREACH(const graphic_format_properties* v, graphicProps)
|
||||
for (size_t i = 0; i < graphicProps.size(); i++)
|
||||
{
|
||||
if (v)
|
||||
result.apply_from(v);
|
||||
if (graphicProps[i])
|
||||
result.apply_from(graphicProps[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -97,20 +96,22 @@ graphic_format_properties calc_graphic_properties_content(const style_instance *
|
||||
{
|
||||
if (const style_content * content = styleInstance->content())
|
||||
if (const graphic_format_properties * graphicProp = content->get_graphic_properties())
|
||||
graphicProps.push_back(graphicProp);
|
||||
{
|
||||
graphicProps.insert(graphicProps.begin(), graphicProp);
|
||||
}
|
||||
|
||||
styleInstance = styleInstance->parent();
|
||||
}
|
||||
reverse(graphicProps.begin(), graphicProps.end());
|
||||
return calc_graphic_properties_content(graphicProps);
|
||||
}
|
||||
|
||||
graphic_format_properties calc_graphic_properties_content(const std::vector<const style_instance *> & styleInstances)
|
||||
{
|
||||
graphic_format_properties result;
|
||||
BOOST_FOREACH(const style_instance * inst, styleInstances)
|
||||
{
|
||||
graphic_format_properties f = calc_graphic_properties_content(inst);
|
||||
|
||||
for (size_t i = 0; i < styleInstances.size(); i++)
|
||||
{
|
||||
graphic_format_properties f = calc_graphic_properties_content(styleInstances[i]);
|
||||
result.apply_from(&f);
|
||||
}
|
||||
return result;
|
||||
@ -121,10 +122,11 @@ graphic_format_properties calc_graphic_properties_content(const std::vector<cons
|
||||
paragraph_format_properties calc_paragraph_properties_content(const std::vector<const style_paragraph_properties*> & parProps)
|
||||
{
|
||||
paragraph_format_properties result;
|
||||
BOOST_FOREACH(const style_paragraph_properties* v, parProps)
|
||||
|
||||
for (size_t i = 0; i < parProps.size(); i++)
|
||||
{
|
||||
if (v)
|
||||
result.apply_from(v->content());
|
||||
if (parProps[i])
|
||||
result.apply_from(parProps[i]->content_);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -136,32 +138,60 @@ paragraph_format_properties calc_paragraph_properties_content(const style_instan
|
||||
{
|
||||
if (const style_content * content = styleInstance->content())
|
||||
if (const style_paragraph_properties * parProp = content->get_style_paragraph_properties())
|
||||
parProps.push_back(parProp);
|
||||
{
|
||||
parProps.insert(parProps.begin(), parProp);
|
||||
}
|
||||
styleInstance = styleInstance->parent();
|
||||
}
|
||||
reverse(parProps.begin(), parProps.end());
|
||||
return calc_paragraph_properties_content(parProps);
|
||||
}
|
||||
|
||||
paragraph_format_properties calc_paragraph_properties_content(const std::vector<const style_instance *> & styleInstances)
|
||||
{
|
||||
paragraph_format_properties result;
|
||||
BOOST_FOREACH(const style_instance * inst, styleInstances)
|
||||
for (size_t i = 0; i < styleInstances.size(); i++)
|
||||
{
|
||||
result.apply_from(calc_paragraph_properties_content(inst));
|
||||
result.apply_from(calc_paragraph_properties_content(styleInstances[i]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void calc_tab_stops(const style_instance * styleInstance, tabs_context & context)
|
||||
{
|
||||
std::vector<const style_paragraph_properties*> parProps;
|
||||
while (styleInstance)
|
||||
{
|
||||
if (const style_content * content = styleInstance->content())
|
||||
if (const style_paragraph_properties * parProp = content->get_style_paragraph_properties())
|
||||
{
|
||||
parProps.insert(parProps.begin(), parProp);
|
||||
}
|
||||
styleInstance = styleInstance->parent();
|
||||
}
|
||||
for (size_t i = 0; i < parProps.size(); i++)
|
||||
{
|
||||
if (parProps[i]->content_.style_tab_stops_)
|
||||
{
|
||||
style_tab_stops *tab_stops = dynamic_cast<style_tab_stops*>(parProps[i]->content_.style_tab_stops_.get());
|
||||
context.reset();
|
||||
for (size_t j = 0; j < tab_stops->content_.size(); j++)
|
||||
{
|
||||
context.add(tab_stops->content_[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////
|
||||
|
||||
style_table_cell_properties_attlist calc_table_cell_properties(const std::vector<const style_table_cell_properties*> & props)
|
||||
{
|
||||
style_table_cell_properties_attlist result;
|
||||
BOOST_FOREACH(const style_table_cell_properties* v, props)
|
||||
for (size_t i = 0; i < props.size(); i++)
|
||||
{
|
||||
if (v)
|
||||
result.apply_from(v->attlist_);
|
||||
if (props[i])
|
||||
result.apply_from(props[i]->attlist_);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -173,19 +203,20 @@ style_table_cell_properties_attlist calc_table_cell_properties(const style_insta
|
||||
{
|
||||
if (const style_content * content = styleInstance->content())
|
||||
if (const style_table_cell_properties * prop = content->get_style_table_cell_properties())
|
||||
props.push_back(prop);
|
||||
{
|
||||
props.insert(props.begin(), prop);
|
||||
}
|
||||
styleInstance = styleInstance->parent();
|
||||
}
|
||||
reverse(props.begin(), props.end());
|
||||
return calc_table_cell_properties(props);
|
||||
}
|
||||
|
||||
style_table_cell_properties_attlist calc_table_cell_properties(const std::vector<const style_instance *> & styleInstances)
|
||||
{
|
||||
style_table_cell_properties_attlist result;
|
||||
BOOST_FOREACH(const style_instance * inst, styleInstances)
|
||||
for (size_t i = 0; i < styleInstances.size(); i++)
|
||||
{
|
||||
result.apply_from(calc_table_cell_properties(inst));
|
||||
result.apply_from(calc_table_cell_properties(styleInstances[i]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -41,6 +41,7 @@
|
||||
#include <vector>
|
||||
|
||||
namespace cpdoccore {
|
||||
class tabs_context;
|
||||
namespace odf_reader {
|
||||
|
||||
graphic_format_properties calc_graphic_properties_content(const style_instance * styleInstance);
|
||||
@ -55,5 +56,6 @@ paragraph_format_properties calc_paragraph_properties_content(const std::vector<
|
||||
style_table_cell_properties_attlist calc_table_cell_properties(const style_instance * styleInstance);
|
||||
style_table_cell_properties_attlist calc_table_cell_properties(const std::vector<const style_instance *> & styleInstances);
|
||||
|
||||
void calc_tab_stops(const style_instance * styleInstance, tabs_context & context);
|
||||
}
|
||||
}
|
||||
|
||||
@ -212,7 +212,14 @@ void object_odf_context::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
oox_convert(chart_context);
|
||||
|
||||
chart_context.set_cache_only(true);
|
||||
if (embeddedData.empty())
|
||||
{
|
||||
chart_context.set_cache_only(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
chart_context.set_externalData(embeddedData);
|
||||
}
|
||||
|
||||
Context.end_chart();
|
||||
}
|
||||
@ -259,7 +266,14 @@ void object_odf_context::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
|
||||
oox_convert(chart_context);
|
||||
|
||||
chart_context.set_cache_only(true);
|
||||
if (embeddedData.empty())
|
||||
{
|
||||
chart_context.set_cache_only(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
chart_context.set_externalData(embeddedData);
|
||||
}
|
||||
Context.end_chart();
|
||||
}
|
||||
else if (object_type_ == 2 && office_text_)
|
||||
@ -382,6 +396,11 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
|
||||
|
||||
if (!current) continue;
|
||||
|
||||
if (1 == series_.size())
|
||||
{
|
||||
current->varyColors_ = false;
|
||||
}
|
||||
|
||||
current->set_properties(plot_area_.properties_);
|
||||
current->set_additional_properties(chart_graphic_properties_);
|
||||
|
||||
@ -420,7 +439,8 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
|
||||
formatCode = *strVal;
|
||||
}
|
||||
|
||||
if (domain_cell_range_adress_.empty() == false)
|
||||
if (domain_cell_range_adress_.empty() == false ||
|
||||
last_set_type == chart_scatter)
|
||||
{
|
||||
if (last_set_type == chart_bubble)
|
||||
{ //bubble(x)
|
||||
@ -434,13 +454,19 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
|
||||
}
|
||||
else
|
||||
{ //x
|
||||
if (!bPivotChart_)
|
||||
current->set_formula_series(2, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_values_series (2, domain_cash);
|
||||
if (false == domain_cash.empty())
|
||||
{
|
||||
if (!bPivotChart_)
|
||||
current->set_formula_series(2, domain_cell_range_adress_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_values_series (2, domain_cash);
|
||||
}
|
||||
//y
|
||||
if (!bPivotChart_)
|
||||
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_values_series (3, cell_cash);
|
||||
if (false == cell_cash.empty())
|
||||
{
|
||||
if (!bPivotChart_)
|
||||
current->set_formula_series(3, series_[i].cell_range_address_, formatCode, boolVal.get_value_or(true));
|
||||
current->set_values_series (3, cell_cash);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -476,7 +502,7 @@ void object_odf_context::oox_convert(oox::oox_chart_context & chart_context)
|
||||
is3D = true;
|
||||
}
|
||||
|
||||
for (int i = 0; i < axises_.size(); i++)
|
||||
for (size_t i = 0; i < axises_.size(); i++)
|
||||
{
|
||||
axis & a = axises_[i];
|
||||
|
||||
@ -667,7 +693,7 @@ void process_build_object::visit(office_body& val)
|
||||
}
|
||||
void process_build_object::visit(office_chart& val)
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.content_);
|
||||
ACCEPT_ALL_CONTENT(val.content_);
|
||||
}
|
||||
void process_build_object::visit(office_text& val)
|
||||
{
|
||||
@ -684,7 +710,7 @@ void process_build_object::visit(office_spreadsheet& val)
|
||||
object_odf_context_.object_type_ = 4;
|
||||
object_odf_context_.office_spreadsheet_ = &val; //конвертация будет уровнем выше
|
||||
}
|
||||
void process_build_object::visit(const chart_chart& val)
|
||||
void process_build_object::visit(chart_chart& val)
|
||||
{
|
||||
object_odf_context_.object_type_ = 1;
|
||||
|
||||
@ -704,11 +730,11 @@ void process_build_object::visit(const chart_chart& val)
|
||||
if (val.attlist_.loext_data_pilot_source_)
|
||||
object_odf_context_.set_pivot_source(*val.attlist_.loext_data_pilot_source_);
|
||||
|
||||
ACCEPT_ALL_CONTENT_CONST(val.content_);
|
||||
ACCEPT_ALL_CONTENT(val.content_);
|
||||
|
||||
}
|
||||
|
||||
void process_build_object::visit(const chart_title& val)
|
||||
void process_build_object::visit(chart_title& val)
|
||||
{
|
||||
title t;
|
||||
|
||||
@ -735,7 +761,7 @@ void process_build_object::visit(const chart_title& val)
|
||||
|
||||
}
|
||||
|
||||
void process_build_object::visit(const chart_subtitle & val)
|
||||
void process_build_object::visit(chart_subtitle & val)
|
||||
{
|
||||
title t;
|
||||
std::wstringstream v;
|
||||
@ -751,7 +777,7 @@ void process_build_object::visit(const chart_subtitle & val)
|
||||
object_odf_context_.sub_title_ = t;
|
||||
}
|
||||
|
||||
void process_build_object::visit(const chart_footer& val)
|
||||
void process_build_object::visit(chart_footer& val)
|
||||
{
|
||||
object_odf_context_.footer_.bEnabled = true;
|
||||
|
||||
@ -760,7 +786,7 @@ void process_build_object::visit(const chart_footer& val)
|
||||
ApplyTextProperties (val.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.footer_.text_properties_);
|
||||
}
|
||||
|
||||
void process_build_object::visit(const chart_legend& val)
|
||||
void process_build_object::visit(chart_legend& val)
|
||||
{
|
||||
object_odf_context_.legend_.bEnabled = true;
|
||||
object_odf_context_.legend_.position = L"r";
|
||||
@ -791,9 +817,9 @@ void process_build_object::visit(const chart_legend& val)
|
||||
ApplyTextProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.legend_.text_properties_);
|
||||
}
|
||||
|
||||
void process_build_object::visit(const chart_plot_area& val)
|
||||
void process_build_object::visit(chart_plot_area& val)
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.content_);
|
||||
ACCEPT_ALL_CONTENT(val.content_);
|
||||
|
||||
object_odf_context_.plot_area_.cell_range_address_ = val.attlist_.table_cell_range_address_.get_value_or(L"");
|
||||
|
||||
@ -803,13 +829,13 @@ void process_build_object::visit(const chart_plot_area& val)
|
||||
}
|
||||
|
||||
|
||||
void process_build_object::visit(const chart_axis& val)
|
||||
void process_build_object::visit(chart_axis& val)
|
||||
{
|
||||
object_odf_context_.start_axis(val.attlist_.chart_dimension_.get_value_or(L""),
|
||||
val.attlist_.chart_name_.get_value_or(L""),
|
||||
val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""));
|
||||
|
||||
ACCEPT_ALL_CONTENT_CONST(val.content_);
|
||||
ACCEPT_ALL_CONTENT(val.content_);
|
||||
|
||||
std::wstring style_name = val.attlist_.common_attlist_.chart_style_name_.get_value_or(L"");
|
||||
|
||||
@ -820,7 +846,7 @@ void process_build_object::visit(const chart_axis& val)
|
||||
object_odf_context_.end_axis();
|
||||
}
|
||||
|
||||
void process_build_object::visit(const chart_series& val)
|
||||
void process_build_object::visit(chart_series& val)
|
||||
{
|
||||
const chart_series_attlist & att = val.attlist_;
|
||||
|
||||
@ -834,7 +860,7 @@ void process_build_object::visit(const chart_series& val)
|
||||
att.common_attlist_.chart_style_name_.get_value_or(L"")
|
||||
);
|
||||
|
||||
ACCEPT_ALL_CONTENT_CONST(val.content_);
|
||||
ACCEPT_ALL_CONTENT(val.content_);
|
||||
|
||||
ApplyChartProperties (att.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.series_.back().properties_);
|
||||
ApplyGraphicProperties (att.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.series_.back().graphic_properties_,object_odf_context_.series_.back().fill_);
|
||||
@ -842,14 +868,14 @@ void process_build_object::visit(const chart_series& val)
|
||||
|
||||
}
|
||||
|
||||
void process_build_object::visit(const chart_domain& val)
|
||||
void process_build_object::visit(chart_domain& val)
|
||||
{
|
||||
if (object_odf_context_.domain_cell_range_adress_.empty())
|
||||
object_odf_context_.domain_cell_range_adress_ = val.table_cell_range_address_.get_value_or(L"");
|
||||
else
|
||||
object_odf_context_.domain_cell_range_adress2_ = val.table_cell_range_address_.get_value_or(L"");
|
||||
}
|
||||
void process_build_object::visit(const chart_grid& val)
|
||||
void process_build_object::visit(chart_grid& val)
|
||||
{
|
||||
object_odf_context_.add_grid(val.attlist_.chart_class_.get_value_or(L""),
|
||||
val.attlist_.common_attlist_.chart_style_name_.get_value_or(L"") );
|
||||
@ -859,7 +885,7 @@ void process_build_object::visit(const chart_grid& val)
|
||||
ApplyGraphicProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), (object_odf_context_.axises_.back()).grids_.back().graphic_properties_, fill);
|
||||
|
||||
}
|
||||
void process_build_object::visit(const chart_wall& val)
|
||||
void process_build_object::visit(chart_wall& val)
|
||||
{
|
||||
object_odf_context_.wall_.bEnabled = true;
|
||||
|
||||
@ -868,7 +894,7 @@ void process_build_object::visit(const chart_wall& val)
|
||||
ApplyTextProperties (val.attlist_.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.wall_.text_properties_);
|
||||
}
|
||||
|
||||
void process_build_object::visit(const chart_floor& val)
|
||||
void process_build_object::visit(chart_floor& val)
|
||||
{
|
||||
object_odf_context_.floor_.bEnabled = true;
|
||||
|
||||
@ -877,7 +903,7 @@ void process_build_object::visit(const chart_floor& val)
|
||||
ApplyTextProperties (val.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.floor_.text_properties_);
|
||||
}
|
||||
|
||||
void process_build_object::visit(const chart_data_point & val)
|
||||
void process_build_object::visit(chart_data_point & val)
|
||||
{
|
||||
object_odf_context_.add_point( val.attlist_.chart_repeated_.get_value_or(1));
|
||||
|
||||
@ -892,16 +918,16 @@ void process_build_object::visit(const chart_data_point & val)
|
||||
}
|
||||
|
||||
}
|
||||
void process_build_object::visit(const chart_mean_value & val)
|
||||
void process_build_object::visit(chart_mean_value & val)
|
||||
{
|
||||
ApplyChartProperties (val.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.series_.back().mean_value_.properties_);
|
||||
ApplyGraphicProperties (val.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.series_.back().mean_value_.graphic_properties_, object_odf_context_.series_.back().mean_value_.fill_);
|
||||
}
|
||||
void process_build_object::visit(const chart_error_indicator & val)
|
||||
void process_build_object::visit(chart_error_indicator & val)
|
||||
{
|
||||
ApplyGraphicProperties (val.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.series_.back().error_indicator_.graphic_properties_,object_odf_context_.series_.back().error_indicator_.fill_ );
|
||||
}
|
||||
void process_build_object::visit(const chart_regression_curve & val)
|
||||
void process_build_object::visit(chart_regression_curve & val)
|
||||
{
|
||||
oox::_oox_fill fill;
|
||||
ApplyGraphicProperties (val.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.series_.back().regression_curve_.line_properties_, fill);
|
||||
@ -913,7 +939,7 @@ void process_build_object::visit(const chart_regression_curve & val)
|
||||
val.chart_equation_->accept(*this);
|
||||
}
|
||||
}
|
||||
void process_build_object::visit(const chart_equation & val)
|
||||
void process_build_object::visit(chart_equation & val)
|
||||
{
|
||||
if (object_odf_context_.series_.back().regression_curve_.bEquation == false)return;
|
||||
|
||||
@ -925,7 +951,7 @@ void process_build_object::visit(const chart_equation & val)
|
||||
ApplyTextProperties (val.common_attlist_.chart_style_name_.get_value_or(L""), object_odf_context_.series_.back().regression_curve_.equation_properties_.text_properties_);
|
||||
|
||||
}
|
||||
void process_build_object::visit(const chart_categories& val)
|
||||
void process_build_object::visit(chart_categories& val)
|
||||
{
|
||||
if (object_odf_context_.in_axis_)
|
||||
{
|
||||
@ -936,49 +962,48 @@ void process_build_object::visit(const chart_categories& val)
|
||||
if (val.table_cell_range_address_)
|
||||
object_odf_context_.add_categories(*val.table_cell_range_address_);
|
||||
}
|
||||
void process_build_object::visit(const table_table& val)
|
||||
void process_build_object::visit(table_table& val)
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_columns_and_groups_.content_);
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_rows_and_groups_.content_);
|
||||
object_odf_context_.table_table_ = &val;
|
||||
|
||||
ACCEPT_ALL_CONTENT(val.table_columns_and_groups_.content_);
|
||||
ACCEPT_ALL_CONTENT(val.table_rows_and_groups_.content_);
|
||||
}
|
||||
void process_build_object::visit(const table_table_rows& val)
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_table_row_);
|
||||
}
|
||||
void process_build_object::visit(table_table_rows& val)
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_table_row_);
|
||||
ACCEPT_ALL_CONTENT(val.table_table_row_);
|
||||
}
|
||||
void process_build_object::visit(const table_table_row & val)
|
||||
|
||||
void process_build_object::visit(table_table_row & val)
|
||||
{
|
||||
unsigned int repeated = val.attlist_.table_number_rows_repeated_;
|
||||
ACCEPT_ALL_CONTENT_CONST(val.content_);
|
||||
ACCEPT_ALL_CONTENT(val.content_);
|
||||
visit_rows(repeated);
|
||||
}
|
||||
void process_build_object::visit(const table_table_column& val)
|
||||
void process_build_object::visit(table_table_column& val)
|
||||
{
|
||||
const unsigned int columnsRepeated = val.table_table_column_attlist_.table_number_columns_repeated_;
|
||||
|
||||
visit_column(columnsRepeated);
|
||||
}
|
||||
void process_build_object::visit(const table_table_row_group& val)
|
||||
void process_build_object::visit(table_table_row_group& val)
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_rows_and_groups_.content_);
|
||||
ACCEPT_ALL_CONTENT(val.table_rows_and_groups_.content_);
|
||||
}
|
||||
void process_build_object::visit(const table_table_column_group& val)
|
||||
void process_build_object::visit(table_table_column_group& val)
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_columns_and_groups_.content_);
|
||||
ACCEPT_ALL_CONTENT(val.table_columns_and_groups_.content_);
|
||||
}
|
||||
void process_build_object::visit(table_table_columns& val)
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_table_column_);
|
||||
ACCEPT_ALL_CONTENT(val.table_table_column_);
|
||||
}
|
||||
void process_build_object::visit(const table_columns_no_group& val)
|
||||
void process_build_object::visit(table_columns_no_group& val)
|
||||
{
|
||||
if (val.table_columns_1_.table_table_columns_)
|
||||
val.table_columns_1_.table_table_columns_->accept(*this);
|
||||
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_columns_1_.table_table_column_);
|
||||
ACCEPT_ALL_CONTENT(val.table_columns_1_.table_table_column_);
|
||||
|
||||
if (val.table_table_header_columns_)
|
||||
val.table_table_header_columns_->accept(*this);
|
||||
@ -986,14 +1011,14 @@ void process_build_object::visit(const table_columns_no_group& val)
|
||||
if (val.table_columns_2_.table_table_columns_)
|
||||
val.table_columns_2_.table_table_columns_->accept(*this);
|
||||
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_columns_2_.table_table_column_);
|
||||
ACCEPT_ALL_CONTENT(val.table_columns_2_.table_table_column_);
|
||||
}
|
||||
void process_build_object::visit(const table_rows_no_group& val)
|
||||
void process_build_object::visit(table_rows_no_group& val)
|
||||
{
|
||||
if (val.table_rows_1_.table_table_rows_)
|
||||
val.table_rows_1_.table_table_rows_->accept(*this);
|
||||
else
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_rows_1_.table_table_row_);
|
||||
ACCEPT_ALL_CONTENT(val.table_rows_1_.table_table_row_);
|
||||
|
||||
if (val.table_table_header_rows_)
|
||||
val.table_table_header_rows_->accept(*this);
|
||||
@ -1001,9 +1026,9 @@ void process_build_object::visit(const table_rows_no_group& val)
|
||||
if (val.table_rows_2_.table_table_rows_)
|
||||
val.table_rows_2_.table_table_rows_->accept(*this);
|
||||
else
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_rows_2_.table_table_row_);
|
||||
ACCEPT_ALL_CONTENT(val.table_rows_2_.table_table_row_);
|
||||
}
|
||||
void process_build_object::visit(const table_table_cell& val)
|
||||
void process_build_object::visit(table_table_cell& val)
|
||||
{
|
||||
const table_table_cell_attlist & attlist = val.attlist_;
|
||||
|
||||
@ -1046,7 +1071,7 @@ void process_build_object::visit(const table_table_cell& val)
|
||||
object_odf_context_.cash_pivot.insert(std::make_pair(cell_desc, cell_));
|
||||
}
|
||||
}
|
||||
void process_build_object::visit(const table_covered_table_cell& val)
|
||||
void process_build_object::visit(table_covered_table_cell& val)
|
||||
{
|
||||
unsigned int repeated = val.attlist_.table_number_columns_repeated_;
|
||||
|
||||
@ -1055,15 +1080,11 @@ void process_build_object::visit(const table_covered_table_cell& val)
|
||||
}
|
||||
void process_build_object::visit(table_table_header_columns& val)
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_table_column_);
|
||||
}
|
||||
void process_build_object::visit(const table_table_header_rows& val)
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_table_row_);
|
||||
ACCEPT_ALL_CONTENT(val.table_table_column_);
|
||||
}
|
||||
void process_build_object::visit(table_table_header_rows& val)
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_table_row_);
|
||||
ACCEPT_ALL_CONTENT(val.table_table_row_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,6 +120,7 @@ public:
|
||||
office_text_ (NULL),
|
||||
office_math_ (NULL),
|
||||
office_spreadsheet_ (NULL),
|
||||
table_table_ (NULL),
|
||||
baseRef_ (ref),
|
||||
baseFontHeight_ (12)
|
||||
{
|
||||
@ -164,6 +165,7 @@ public:
|
||||
office_text *office_text_;
|
||||
office_math *office_math_;
|
||||
office_spreadsheet *office_spreadsheet_;
|
||||
table_table *table_table_;
|
||||
|
||||
int baseFontHeight_;
|
||||
std::wstring baseRef_;
|
||||
@ -203,6 +205,7 @@ public:
|
||||
std::vector<_cell> cash_values;
|
||||
std::map<std::wstring, _cell>cash_pivot;
|
||||
|
||||
std::wstring embeddedData;
|
||||
//---------------------------------------
|
||||
std::wstring target_table_;
|
||||
std::wstring table_name_;
|
||||
@ -234,48 +237,45 @@ class process_build_object
|
||||
public visitor<office_math>,
|
||||
public visitor<office_spreadsheet>,
|
||||
|
||||
public const_visitor<chart_chart>,
|
||||
public visitor<chart_chart>,
|
||||
|
||||
public const_visitor<chart_title>,
|
||||
public const_visitor<chart_subtitle>,
|
||||
public const_visitor<chart_footer>,
|
||||
public const_visitor<chart_legend>,
|
||||
public visitor<chart_title>,
|
||||
public visitor<chart_subtitle>,
|
||||
public visitor<chart_footer>,
|
||||
public visitor<chart_legend>,
|
||||
|
||||
public const_visitor<chart_plot_area>,
|
||||
public visitor<chart_plot_area>,
|
||||
|
||||
public const_visitor<chart_axis>,
|
||||
public const_visitor<chart_categories>,
|
||||
public const_visitor<chart_grid>,
|
||||
public visitor<chart_axis>,
|
||||
public visitor<chart_categories>,
|
||||
public visitor<chart_grid>,
|
||||
|
||||
public const_visitor<chart_series>,
|
||||
public const_visitor<chart_domain>,
|
||||
public const_visitor<chart_data_point>,
|
||||
public const_visitor<chart_mean_value>,
|
||||
public const_visitor<chart_regression_curve>,
|
||||
public const_visitor<chart_equation>,
|
||||
public const_visitor<chart_error_indicator>,
|
||||
public const_visitor<chart_wall>,
|
||||
public const_visitor<chart_floor>,
|
||||
public visitor<chart_series>,
|
||||
public visitor<chart_domain>,
|
||||
public visitor<chart_data_point>,
|
||||
public visitor<chart_mean_value>,
|
||||
public visitor<chart_regression_curve>,
|
||||
public visitor<chart_equation>,
|
||||
public visitor<chart_error_indicator>,
|
||||
public visitor<chart_wall>,
|
||||
public visitor<chart_floor>,
|
||||
|
||||
public const_visitor<table_table>,
|
||||
public visitor<table_table>,
|
||||
|
||||
public const_visitor<table_table_row_group>,
|
||||
public const_visitor<table_rows_no_group>,
|
||||
public const_visitor<table_table_header_rows>,
|
||||
public const_visitor<table_table_rows>,
|
||||
public const_visitor<table_table_row>,
|
||||
|
||||
public visitor<table_table_rows>,
|
||||
public visitor<table_table_row_group>,
|
||||
public visitor<table_rows_no_group>,
|
||||
public visitor<table_table_header_rows>,
|
||||
public visitor<table_table_rows>,
|
||||
public visitor<table_table_row>,
|
||||
|
||||
public const_visitor<table_table_cell>,
|
||||
public const_visitor<table_covered_table_cell>,
|
||||
public visitor<table_table_cell>,
|
||||
public visitor<table_covered_table_cell>,
|
||||
|
||||
public const_visitor<table_table_column_group>,
|
||||
public visitor<table_table_column_group>,
|
||||
public visitor<table_table_header_columns>,
|
||||
public visitor<table_table_columns>,
|
||||
public const_visitor<table_table_column>,
|
||||
public const_visitor<table_columns_no_group>
|
||||
public visitor<table_table_column>,
|
||||
public visitor<table_columns_no_group>
|
||||
{
|
||||
public:
|
||||
|
||||
@ -303,44 +303,39 @@ public:
|
||||
virtual void visit(office_math & val);
|
||||
virtual void visit(office_spreadsheet & val);
|
||||
|
||||
virtual void visit(const chart_chart & val);
|
||||
virtual void visit(const chart_title & val);
|
||||
virtual void visit(const chart_subtitle & val);
|
||||
virtual void visit(const chart_footer & val);
|
||||
virtual void visit(const chart_legend & val);
|
||||
virtual void visit(const chart_plot_area& val);
|
||||
virtual void visit(const chart_axis & val);
|
||||
virtual void visit(const chart_series & val);
|
||||
virtual void visit(const chart_domain & val);
|
||||
virtual void visit(const chart_data_point & val);
|
||||
virtual void visit(const chart_mean_value & val);
|
||||
virtual void visit(const chart_error_indicator & val);
|
||||
virtual void visit(const chart_regression_curve & val);
|
||||
virtual void visit(const chart_equation & val);
|
||||
virtual void visit(const chart_categories & val);
|
||||
virtual void visit(const chart_grid & val);
|
||||
virtual void visit(const chart_wall & val);
|
||||
virtual void visit(const chart_floor & val);
|
||||
virtual void visit(const table_table & val);
|
||||
virtual void visit(chart_chart & val);
|
||||
virtual void visit(chart_title & val);
|
||||
virtual void visit(chart_subtitle & val);
|
||||
virtual void visit(chart_footer & val);
|
||||
virtual void visit(chart_legend & val);
|
||||
virtual void visit(chart_plot_area& val);
|
||||
virtual void visit(chart_axis & val);
|
||||
virtual void visit(chart_series & val);
|
||||
virtual void visit(chart_domain & val);
|
||||
virtual void visit(chart_data_point & val);
|
||||
virtual void visit(chart_mean_value & val);
|
||||
virtual void visit(chart_error_indicator & val);
|
||||
virtual void visit(chart_regression_curve & val);
|
||||
virtual void visit(chart_equation & val);
|
||||
virtual void visit(chart_categories & val);
|
||||
virtual void visit(chart_grid & val);
|
||||
virtual void visit(chart_wall & val);
|
||||
virtual void visit(chart_floor & val);
|
||||
virtual void visit(table_table & val);
|
||||
|
||||
virtual void visit(const table_table_rows & val);
|
||||
virtual void visit(const table_rows_no_group & val);
|
||||
virtual void visit(const table_table_row_group & val);
|
||||
virtual void visit(const table_table_header_rows& val);
|
||||
virtual void visit(table_table_header_rows & val);
|
||||
virtual void visit(table_table_rows & val);
|
||||
virtual void visit(table_table_row & val);
|
||||
virtual void visit(table_rows_no_group & val);
|
||||
virtual void visit(table_table_row_group & val);
|
||||
virtual void visit(table_table_header_rows & val);
|
||||
|
||||
virtual void visit(table_table_rows & val);
|
||||
virtual void visit(const table_table_row & val);
|
||||
|
||||
virtual void visit(const table_columns_no_group & val);
|
||||
virtual void visit(table_columns_no_group & val);
|
||||
virtual void visit(table_table_header_columns & val);
|
||||
virtual void visit(table_table_columns & val);
|
||||
virtual void visit(const table_table_column_group& val);
|
||||
virtual void visit(const table_table_column & val);
|
||||
|
||||
|
||||
virtual void visit(const table_table_cell& val);
|
||||
virtual void visit(const table_covered_table_cell& val);
|
||||
virtual void visit(table_table_columns & val);
|
||||
virtual void visit(table_table_column_group & val);
|
||||
virtual void visit(table_table_column & val);
|
||||
virtual void visit(table_table_cell & val);
|
||||
virtual void visit(table_covered_table_cell & val);
|
||||
|
||||
private:
|
||||
bool stop_;
|
||||
|
||||
76
ASCOfficeOdfFile/src/odf/datatypes/commandtype.cpp
Normal file
76
ASCOfficeOdfFile/src/odf/datatypes/commandtype.cpp
Normal file
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include "commandtype.h"
|
||||
|
||||
#include <ostream>
|
||||
|
||||
namespace cpdoccore { namespace odf_types {
|
||||
|
||||
std::wostream & operator << (std::wostream & _Wostream, const command_type & _Val)
|
||||
{
|
||||
switch(_Val.get_type())
|
||||
{
|
||||
case command_type::command:
|
||||
_Wostream << L"command";
|
||||
break;
|
||||
case command_type::query:
|
||||
_Wostream << L"query";
|
||||
break;
|
||||
case command_type::table:
|
||||
_Wostream << L"table";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return _Wostream;
|
||||
}
|
||||
|
||||
command_type command_type::parse(const std::wstring & Str)
|
||||
{
|
||||
std::wstring tmp = Str;
|
||||
boost::algorithm::to_lower(tmp);
|
||||
|
||||
if (tmp == L"command")
|
||||
return command_type( command );
|
||||
else if (tmp == L"query")
|
||||
return command_type( query );
|
||||
else if (tmp == L"table")
|
||||
return command_type( table );
|
||||
else
|
||||
{
|
||||
return command_type( command );
|
||||
}
|
||||
}
|
||||
|
||||
} }
|
||||
@ -1,57 +1,74 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
// zlib - договорились держать в аддонах.
|
||||
// чтобы компилить - прописать в проекте пути к аддонам
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
#pragma comment(lib, "zlib.lib")
|
||||
|
||||
namespace NSZLib
|
||||
{
|
||||
static BOOL Decompress(const BYTE* pSrcBuffer, const ULONG& lSrcBufferLen,
|
||||
BYTE* pDstBuffer, ULONG& lDstBufferLen)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Z_OK == uncompress(pDstBuffer, &lDstBufferLen, pSrcBuffer, lSrcBufferLen))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
#include "odfattributes.h"
|
||||
|
||||
|
||||
namespace cpdoccore { namespace odf_types {
|
||||
|
||||
class command_type
|
||||
{
|
||||
public:
|
||||
enum type
|
||||
{
|
||||
command,
|
||||
query,
|
||||
table
|
||||
};
|
||||
|
||||
command_type() {}
|
||||
|
||||
command_type(type _Type) : type_(_Type)
|
||||
{}
|
||||
|
||||
type get_type() const
|
||||
{
|
||||
return type_;
|
||||
};
|
||||
|
||||
static command_type parse(const std::wstring & Str);
|
||||
|
||||
private:
|
||||
type type_;
|
||||
|
||||
};
|
||||
|
||||
std::wostream & operator << (std::wostream & _Wostream, const command_type & _Val);
|
||||
|
||||
}
|
||||
|
||||
APPLY_PARSE_XML_ATTRIBUTES(odf_types::command_type);
|
||||
|
||||
}
|
||||
@ -49,6 +49,7 @@
|
||||
#include "styleverticalpos.h"
|
||||
#include "stylehorizontalpos.h"
|
||||
#include "stylehorizontalrel.h"
|
||||
#include "stylenumformat.h"
|
||||
#include "percentorscale.h"
|
||||
#include "anchortype.h"
|
||||
#include "linewidth.h"
|
||||
@ -331,8 +332,8 @@ public:
|
||||
void apply_from(const common_num_format_attlist & Other);
|
||||
void serialize(CP_ATTR_NODE);
|
||||
|
||||
_CP_OPT(std::wstring) style_num_format_;
|
||||
_CP_OPT(Bool) style_num_letter_sync_;
|
||||
_CP_OPT(odf_types::style_numformat) style_num_format_;
|
||||
_CP_OPT(Bool) style_num_letter_sync_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
140
ASCOfficeOdfFile/src/odf/datatypes/stylenumformat.cpp
Normal file
140
ASCOfficeOdfFile/src/odf/datatypes/stylenumformat.cpp
Normal file
@ -0,0 +1,140 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
|
||||
#include "stylenumformat.h"
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <ostream>
|
||||
|
||||
namespace cpdoccore { namespace odf_types {
|
||||
|
||||
std::wostream & operator << (std::wostream & _Wostream, const style_numformat & _Val)
|
||||
{
|
||||
switch(_Val.get_type())
|
||||
{
|
||||
case style_numformat::arabic:
|
||||
_Wostream << L"1";
|
||||
break;
|
||||
case style_numformat::romanUc:
|
||||
_Wostream << L"I";
|
||||
break;
|
||||
case style_numformat::romanLc:
|
||||
_Wostream << L"i";
|
||||
break;
|
||||
case style_numformat::alphaUc:
|
||||
_Wostream << L"A";
|
||||
break;
|
||||
case style_numformat::alphaLc:
|
||||
_Wostream << L"a";
|
||||
break;
|
||||
case style_numformat::aiueo:
|
||||
_Wostream << L"ア, イ, ウ, ...";
|
||||
break;
|
||||
case style_numformat::chineseCounting:
|
||||
_Wostream << L"イ, ロ, ハ, ...";
|
||||
break;
|
||||
case style_numformat::chineseLegal:
|
||||
_Wostream << L"一, 二, 三, ...";
|
||||
break;
|
||||
case style_numformat::ideographLegal:
|
||||
_Wostream << L"壹, 貳, 參, ...";
|
||||
break;
|
||||
case style_numformat::ideographTraditional:
|
||||
_Wostream << L"甲, 乙, 丙, ...";
|
||||
break;
|
||||
case style_numformat::ideographZodiac:
|
||||
_Wostream << L"子, 丑, 寅, ...";
|
||||
break;
|
||||
case style_numformat::ideographZodiacTraditional:
|
||||
_Wostream << L"甲子, 乙丑, 丙寅, ...";
|
||||
break;
|
||||
case style_numformat::iroha:
|
||||
_Wostream << L"イ, ロ, ハ, ...";
|
||||
break;
|
||||
case style_numformat::koreanDigital:
|
||||
_Wostream << L"일, 이, 삼, ...";
|
||||
break;
|
||||
case style_numformat::russianLo:
|
||||
_Wostream << L"А, Б, .., Аа, Аб, ... (ru)";
|
||||
break;
|
||||
case style_numformat::russianUp:
|
||||
_Wostream << L"А, Б, .., Аа, Аб, ... (ru)";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return _Wostream;
|
||||
}
|
||||
|
||||
style_numformat style_numformat::parse(const std::wstring & Str)
|
||||
{
|
||||
std::wstring tmp = Str;
|
||||
boost::algorithm::to_lower(tmp);
|
||||
|
||||
if (tmp == L"1")
|
||||
return style_numformat( arabic );
|
||||
else if (tmp == L"I")
|
||||
return style_numformat( romanUc );
|
||||
else if (tmp == L"i")
|
||||
return style_numformat( romanLc );
|
||||
else if (tmp == L"A")
|
||||
return style_numformat( alphaUc );
|
||||
else if (tmp == L"a")
|
||||
return style_numformat( alphaLc );
|
||||
else if (tmp == L"А, Б, .., Аа, Аб, ... (ru)")
|
||||
return style_numformat( russianUp );
|
||||
else if (tmp == L"일, 이, 삼, ...")
|
||||
return style_numformat( koreanDigital );
|
||||
else if (tmp == L"イ, ロ, ハ, ...")
|
||||
return style_numformat( iroha );
|
||||
else if (tmp == L"甲, 乙, 丙, ...")
|
||||
return style_numformat( ideographTraditional );
|
||||
else if (tmp == L"甲子, 乙丑, 丙寅, ...")
|
||||
return style_numformat( ideographZodiacTraditional );
|
||||
else if (tmp == L"子, 丑, 寅, ...")
|
||||
return style_numformat( ideographZodiac );
|
||||
else if (tmp == L"壹, 貳, 參, ...")
|
||||
return style_numformat( ideographLegal );
|
||||
else if (tmp == L"一, 二, 三, ...")
|
||||
return style_numformat( chineseLegal );
|
||||
else if (tmp == L"イ, ロ, ハ, ...")
|
||||
return style_numformat( chineseCounting );
|
||||
else if (tmp == L"ア, イ, ウ, ...")
|
||||
return style_numformat( aiueo );
|
||||
|
||||
else
|
||||
{
|
||||
return style_numformat( arabic );
|
||||
}
|
||||
}
|
||||
|
||||
} }
|
||||
94
ASCOfficeOdfFile/src/odf/datatypes/stylenumformat.h
Normal file
94
ASCOfficeOdfFile/src/odf/datatypes/stylenumformat.h
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#ifndef _CPDOCCORE_ODF_STYLENUMFORMAT_H_
|
||||
#define _CPDOCCORE_ODF_STYLENUMFORMAT_H_
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include <iosfwd>
|
||||
#include <string>
|
||||
#include "odfattributes.h"
|
||||
|
||||
|
||||
namespace cpdoccore { namespace odf_types {
|
||||
|
||||
class style_numformat
|
||||
{
|
||||
public:
|
||||
enum type
|
||||
{
|
||||
arabic,
|
||||
romanUc,
|
||||
romanLc,
|
||||
alphaUc,
|
||||
alphaLc,
|
||||
aiueo,
|
||||
chineseCounting,
|
||||
chineseLegal,
|
||||
ideographLegal,
|
||||
ideographTraditional,
|
||||
ideographZodiac,
|
||||
ideographZodiacTraditional,
|
||||
iroha,
|
||||
koreanDigital,
|
||||
russianLo,
|
||||
russianUp
|
||||
};
|
||||
|
||||
style_numformat() {}
|
||||
|
||||
style_numformat(type _Type) : type_(_Type)
|
||||
{}
|
||||
|
||||
type get_type() const
|
||||
{
|
||||
return type_;
|
||||
};
|
||||
|
||||
static style_numformat parse(const std::wstring & Str);
|
||||
|
||||
private:
|
||||
type type_;
|
||||
|
||||
};
|
||||
|
||||
std::wostream & operator << (std::wostream & _Wostream, const style_numformat & _Val);
|
||||
|
||||
}
|
||||
|
||||
APPLY_PARSE_XML_ATTRIBUTES(odf_types::style_numformat);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -51,20 +51,21 @@
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "../../../DesktopEditor/raster/BgraFrame.h"
|
||||
#include "../../../DesktopEditor/raster/Metafile/MetaFile.h"
|
||||
#include "../../../DesktopEditor/graphics/pro/Image.h"
|
||||
#include "../../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
|
||||
namespace _image_file_
|
||||
{
|
||||
bool GetResolution(const wchar_t* fileName, int & Width, int &Height, CApplicationFonts * appFonts)
|
||||
bool GetResolution(const wchar_t* fileName, int & Width, int &Height, NSFonts::IApplicationFonts* appFonts)
|
||||
{
|
||||
CBgraFrame image;
|
||||
MetaFile::CMetaFile meta_file(appFonts);
|
||||
MetaFile::IMetaFile* meta_file = MetaFile::Create(appFonts);
|
||||
|
||||
if ( meta_file.LoadFromFile(fileName))
|
||||
bool bRet = false;
|
||||
if ( meta_file->LoadFromFile(fileName))
|
||||
{
|
||||
double dX = 0, dY = 0, dW = 0, dH = 0;
|
||||
meta_file.GetBounds(&dX, &dY, &dW, &dH);
|
||||
meta_file->GetBounds(&dX, &dY, &dW, &dH);
|
||||
|
||||
Width = dW;
|
||||
Height = dH;
|
||||
@ -74,13 +75,13 @@ namespace _image_file_
|
||||
Width = image.get_Width();
|
||||
Height = image.get_Height();
|
||||
|
||||
return true;
|
||||
bRet = true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
RELEASEOBJECT(meta_file);
|
||||
return bRet;
|
||||
}
|
||||
};
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -98,7 +99,7 @@ int get_value_emu(double pt)
|
||||
{
|
||||
return static_cast<int>((pt* 360000 * 2.54) / 72);
|
||||
}
|
||||
bool parse_clipping(std::wstring strClipping,std::wstring fileName, double_4 & clip_rect, CApplicationFonts * appFonts)
|
||||
bool parse_clipping(std::wstring strClipping,std::wstring fileName, double_4 & clip_rect, NSFonts::IApplicationFonts * appFonts)
|
||||
{
|
||||
memset(clip_rect, 0, 4*sizeof(double));
|
||||
|
||||
@ -411,11 +412,11 @@ void Compute_GraphicFill(const common_draw_fill_attlist & props, const office_el
|
||||
{
|
||||
if (style_background_image * image = dynamic_cast<style_background_image *>(style_image.get()))
|
||||
{
|
||||
if ((image) && (image->common_xlink_attlist_))
|
||||
if ((image) && (image->xlink_attlist_))
|
||||
{
|
||||
fill.type = 2;
|
||||
fill.bitmap = oox::oox_bitmap_fill::create();
|
||||
fill.bitmap->xlink_href_ = image->common_xlink_attlist_->href_.get_value_or(L"");
|
||||
fill.bitmap->xlink_href_ = image->xlink_attlist_->href_.get_value_or(L"");
|
||||
if (image->style_repeat_)
|
||||
{
|
||||
switch(image->style_repeat_->get_type())
|
||||
@ -549,7 +550,7 @@ void draw_a::add_child_element( xml::sax * Reader, const std::wstring & Ns, cons
|
||||
}
|
||||
void draw_a::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
common_xlink_attlist_.add_attributes(Attributes);
|
||||
xlink_attlist_.add_attributes(Attributes);
|
||||
|
||||
CP_APPLY_ATTR(L"office:name" , office_name_ , std::wstring(L""));
|
||||
CP_APPLY_ATTR(L"office:target-frame-name" , office_target_frame_name_);
|
||||
@ -561,7 +562,7 @@ void draw_a::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
void draw_a::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
Context.get_drawing_context().start_action(L"");
|
||||
Context.get_drawing_context().set_link(common_xlink_attlist_.href_.get_value_or(L""));
|
||||
Context.get_drawing_context().set_link(xlink_attlist_.href_.get_value_or(L""));
|
||||
Context.get_drawing_context().end_action();
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
@ -572,7 +573,7 @@ void draw_a::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
void draw_a::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
Context.get_slide_context().start_action(L"");
|
||||
Context.get_slide_context().set_link(common_xlink_attlist_.href_.get_value_or(L""));
|
||||
Context.get_slide_context().set_link(xlink_attlist_.href_.get_value_or(L""));
|
||||
Context.get_slide_context().end_action();
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
@ -582,7 +583,7 @@ void draw_a::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
}
|
||||
void draw_a::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
std::wstring rId = Context.add_hyperlink(common_xlink_attlist_.href_.get_value_or(L""), true);//гиперлинк с объекта, а не с текста ..
|
||||
std::wstring rId = Context.add_hyperlink(xlink_attlist_.href_.get_value_or(L""), true);//гиперлинк с объекта, а не с текста ..
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
|
||||
@ -50,11 +50,9 @@
|
||||
#include "datatypes/targetframename.h"
|
||||
#include "datatypes/common_attlists.h"
|
||||
|
||||
//class CApplicationFonts;
|
||||
|
||||
namespace _image_file_
|
||||
{
|
||||
bool GetResolution(const wchar_t* fileName, int & Width, int &Height, CApplicationFonts * appFonts);
|
||||
bool GetResolution(const wchar_t* fileName, int & Width, int &Height, NSFonts::IApplicationFonts * appFonts);
|
||||
}
|
||||
|
||||
namespace cpdoccore {
|
||||
@ -76,7 +74,7 @@ void Compute_GraphicFill(const odf_types::common_draw_fill_attlist & props,
|
||||
const office_element_ptr & style_image, styles_lite_container &styles, oox::_oox_fill & fill, bool txbx = false);
|
||||
|
||||
typedef double double_4[4];
|
||||
bool parse_clipping(std::wstring strClipping,std::wstring fileName,double_4 & clip_rect, CApplicationFonts * appFonts);
|
||||
bool parse_clipping(std::wstring strClipping,std::wstring fileName,double_4 & clip_rect, NSFonts::IApplicationFonts * appFonts);
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
class draw_a : public office_element_impl<draw_a>
|
||||
{
|
||||
@ -101,7 +99,7 @@ public:
|
||||
friend class odf_document;
|
||||
|
||||
private:
|
||||
odf_types::common_xlink_attlist common_xlink_attlist_;
|
||||
odf_types::common_xlink_attlist xlink_attlist_;
|
||||
|
||||
std::wstring office_name_;
|
||||
_CP_OPT(odf_types::target_frame_name) office_target_frame_name_;
|
||||
@ -118,4 +116,4 @@ void oox_convert_transforms(std::wstring transformStr,std::vector<odf_reader::_p
|
||||
//void docx_convert_transforms(std::wstring transformStr, oox::xlsx_conversion_context & Context);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ const wchar_t * draw_image::name = L"image";
|
||||
void draw_image::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
draw_image_attlist_.add_attributes(Attributes);
|
||||
common_xlink_attlist_.add_attributes(Attributes);
|
||||
xlink_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void draw_image::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -122,7 +122,7 @@ std::wostream & draw_chart::text_to_stream(std::wostream & _Wostream) const
|
||||
void draw_chart::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
draw_chart_attlist_.add_attributes(Attributes);
|
||||
common_xlink_attlist_.add_attributes(Attributes);
|
||||
xlink_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void draw_chart::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -266,7 +266,7 @@ const wchar_t * draw_object::name = L"object";
|
||||
void draw_object::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
draw_object_attlist_.add_attributes(Attributes);
|
||||
common_xlink_attlist_.add_attributes(Attributes);
|
||||
xlink_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void draw_object::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -278,7 +278,7 @@ void draw_object::add_child_element( xml::sax * Reader, const std::wstring & Ns,
|
||||
}
|
||||
}
|
||||
|
||||
// draw:object
|
||||
// draw:object-ole
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * draw_object_ole::ns = L"draw";
|
||||
const wchar_t * draw_object_ole::name = L"object-ole";
|
||||
@ -287,7 +287,7 @@ void draw_object_ole::add_attributes( const xml::attributes_wc_ptr & Attributes
|
||||
{
|
||||
CP_APPLY_ATTR(L"draw:class-id", draw_class_id_);
|
||||
|
||||
common_xlink_attlist_.add_attributes(Attributes);
|
||||
xlink_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void draw_object_ole::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -362,7 +362,7 @@ std::wstring draw_object::office_convert(odf_document_ptr odfDocument, int type)
|
||||
{
|
||||
outputDocx.write(objectOutPath);
|
||||
|
||||
href_result = common_xlink_attlist_.href_.get_value_or(L"Object");
|
||||
href_result = xlink_attlist_.href_.get_value_or(L"Object");
|
||||
int pos = href_result.find(L"./");
|
||||
if (pos >= 0) href_result = href_result.substr(2);
|
||||
|
||||
@ -381,7 +381,7 @@ std::wstring draw_object::office_convert(odf_document_ptr odfDocument, int type)
|
||||
{
|
||||
outputXlsx.write(objectOutPath);
|
||||
|
||||
href_result = common_xlink_attlist_.href_.get_value_or(L"Object");
|
||||
href_result = xlink_attlist_.href_.get_value_or(L"Object");
|
||||
int pos = href_result.find(L"./");
|
||||
if (pos >= 0) href_result = href_result.substr(2);
|
||||
|
||||
@ -393,7 +393,7 @@ std::wstring draw_object::office_convert(odf_document_ptr odfDocument, int type)
|
||||
std::wstring temp_file = folderPath + FILE_SEPARATOR_STR + href_result;
|
||||
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
oCOfficeUtils.CompressFileOrDirectory(objectOutPath.c_str(), temp_file.c_str(), true);
|
||||
oCOfficeUtils.CompressFileOrDirectory(objectOutPath, temp_file, true);
|
||||
}
|
||||
NSDirectory::DeleteDirectory(objectOutPath);
|
||||
|
||||
@ -423,14 +423,36 @@ void draw_plugin::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"draw:mime-type", draw_mime_type_);
|
||||
|
||||
common_xlink_attlist_.add_attributes(Attributes);
|
||||
xlink_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void draw_plugin::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
// draw:control
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * draw_control::ns = L"draw";
|
||||
const wchar_t * draw_control::name = L"control";
|
||||
|
||||
void draw_control::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"xml:id", xml_id_);
|
||||
CP_APPLY_ATTR(L"draw:caption-id", caption_id_);
|
||||
CP_APPLY_ATTR(L"draw:control", control_id_);
|
||||
|
||||
draw_attlists_.shape_with_text_and_styles_.add_attributes(Attributes);
|
||||
draw_attlists_.position_.add_attributes(Attributes);
|
||||
draw_attlists_.rel_size_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void draw_control::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
if CP_CHECK_NAME(L"draw", L"glue-point")
|
||||
{
|
||||
CP_CREATE_ELEMENT(draw_glue_point_);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
draw_image_attlist draw_image_attlist_;
|
||||
odf_types::common_xlink_attlist common_xlink_attlist_;
|
||||
odf_types::common_xlink_attlist xlink_attlist_;
|
||||
|
||||
office_element_ptr office_binary_data_;
|
||||
|
||||
@ -121,7 +121,7 @@ private:
|
||||
|
||||
private:
|
||||
draw_chart_attlist draw_chart_attlist_;
|
||||
odf_types::common_xlink_attlist common_xlink_attlist_;
|
||||
odf_types::common_xlink_attlist xlink_attlist_;
|
||||
office_element_ptr_array content_;
|
||||
|
||||
//office_element_ptr title_;
|
||||
@ -294,7 +294,7 @@ public:
|
||||
virtual void pptx_convert (oox::pptx_conversion_context & Context);
|
||||
|
||||
draw_object_attlist draw_object_attlist_;
|
||||
odf_types::common_xlink_attlist common_xlink_attlist_;
|
||||
odf_types::common_xlink_attlist xlink_attlist_;
|
||||
|
||||
odf_document_ptr odf_document_;
|
||||
|
||||
@ -320,7 +320,7 @@ public:
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
odf_types::common_xlink_attlist common_xlink_attlist_;
|
||||
odf_types::common_xlink_attlist xlink_attlist_;
|
||||
_CP_OPT(std::wstring) draw_class_id_;
|
||||
|
||||
private:
|
||||
@ -331,7 +331,7 @@ private:
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_object_ole);
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
class draw_param : public office_element_impl<draw_param>
|
||||
{
|
||||
public:
|
||||
@ -354,7 +354,7 @@ private:
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_param);
|
||||
|
||||
//----------------------------------------------------------------------------------------------
|
||||
class draw_plugin : public office_element_impl<draw_plugin>
|
||||
{
|
||||
public:
|
||||
@ -368,7 +368,7 @@ public:
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
odf_types::common_xlink_attlist common_xlink_attlist_;
|
||||
odf_types::common_xlink_attlist xlink_attlist_;
|
||||
_CP_OPT(std::wstring) draw_mime_type_;
|
||||
|
||||
office_element_ptr_array content_;
|
||||
@ -377,9 +377,34 @@ private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_plugin);
|
||||
//----------------------------------------------------------------------------------------------
|
||||
class draw_control : public office_element_impl<draw_control>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeDrawControl;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context);
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context){}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context){}
|
||||
|
||||
odf_types::union_common_draw_attlists draw_attlists_;
|
||||
_CP_OPT(std::wstring) xml_id_;
|
||||
_CP_OPT(std::wstring) caption_id_;
|
||||
_CP_OPT(std::wstring) control_id_;
|
||||
|
||||
office_element_ptr draw_glue_point_;
|
||||
//<svg:desc>
|
||||
//<svg:title>
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_control);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "office_forms.h"
|
||||
#include "draw_frame.h"
|
||||
|
||||
#include <ostream>
|
||||
@ -39,6 +40,7 @@
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
#include <cpdoccore/xml/utils.h>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
|
||||
@ -46,7 +48,10 @@
|
||||
#include "odf_document_impl.h"
|
||||
|
||||
#include "draw_common.h"
|
||||
|
||||
#include "../docx/docx_drawing.h"
|
||||
#include "../docx/xlsx_package.h"
|
||||
|
||||
#include "chart_build_oox.h"
|
||||
|
||||
#include "calcs_styles.h"
|
||||
@ -55,6 +60,7 @@
|
||||
#include "datatypes/borderstyle.h"
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
#include "../../../OfficeUtils/src/OfficeUtils.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -880,7 +886,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
if ((drawing->fill.bitmap) && (drawing->fill.bitmap->rId.empty()))
|
||||
{
|
||||
std::wstring href = drawing->fill.bitmap->xlink_href_;
|
||||
drawing->fill.bitmap->rId = Context.add_mediaitem(href, oox::typeImage, drawing->fill.bitmap->isInternal, href);
|
||||
drawing->fill.bitmap->rId = Context.get_mediaitems().add_or_find(href, oox::typeImage, drawing->fill.bitmap->isInternal, href);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
@ -1093,10 +1099,10 @@ void draw_shape::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
void draw_image::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
if (!common_xlink_attlist_.href_)
|
||||
if (!xlink_attlist_.href_)
|
||||
return;
|
||||
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
|
||||
int pos_replaicement = href.find(L"ObjectReplacements");
|
||||
|
||||
const draw_frame * frame = Context.get_drawing_context().get_current_frame();//owner
|
||||
@ -1155,7 +1161,7 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
|
||||
drawing->fill.bitmap = oox::oox_bitmap_fill::create();
|
||||
drawing->fill.type = 2;
|
||||
drawing->fill.bitmap->isInternal = false;
|
||||
drawing->fill.bitmap->rId = Context.add_mediaitem(href, oox::typeImage, drawing->fill.bitmap->isInternal, href);
|
||||
drawing->fill.bitmap->rId = Context.get_mediaitems().add_or_find(href, oox::typeImage, drawing->fill.bitmap->isInternal, href);
|
||||
drawing->fill.bitmap->bStretch = true;
|
||||
|
||||
const std::wstring styleName = frame->common_draw_attlists_.shape_with_text_and_styles_.
|
||||
@ -1241,10 +1247,13 @@ void draw_text_box::docx_convert(oox::docx_conversion_context & Context)
|
||||
size_t min_y = get_value_emu(draw_text_box_attlist_.fo_min_height_->get_length());
|
||||
if (drawing->cy < min_y)
|
||||
{
|
||||
auto_fit_text = true;
|
||||
drawing->cy = min_y;
|
||||
}
|
||||
if (drawing->cy < 36000) auto_fit_shape = true;
|
||||
//if (drawing->cy < 36000)
|
||||
//{
|
||||
// auto_fit_shape = true;
|
||||
//}
|
||||
auto_fit_shape = true;
|
||||
}
|
||||
|
||||
|
||||
@ -1256,7 +1265,11 @@ void draw_text_box::docx_convert(oox::docx_conversion_context & Context)
|
||||
auto_fit_text = true;
|
||||
drawing->cx = min_x;
|
||||
}
|
||||
if (drawing->cx < 36000) auto_fit_shape = true;
|
||||
if (drawing->cx < 36000)
|
||||
{
|
||||
auto_fit_text = false;
|
||||
auto_fit_shape = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1457,13 +1470,13 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring tempPath = Context.root()->get_temp_folder();
|
||||
std::wstring odfPath = Context.root()->get_folder();
|
||||
|
||||
if (!odf_document_ && !href.empty())
|
||||
{
|
||||
std::wstring tempPath = Context.root()->get_temp_folder();
|
||||
std::wstring folderPath = Context.root()->get_folder();
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
std::wstring objectPath = odfPath + FILE_SEPARATOR_STR + href;
|
||||
|
||||
// normalize path ???? todooo
|
||||
XmlUtils::replace_all( objectPath, FILE_SEPARATOR_STR + std::wstring(L"./"), FILE_SEPARATOR_STR);
|
||||
@ -1481,6 +1494,30 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
|
||||
process_build_object process_build_object_(objectBuild, odf_document_->odf_context());
|
||||
contentSubDoc->accept(process_build_object_);
|
||||
|
||||
if (objectBuild.table_table_)
|
||||
{
|
||||
oox::xlsx_conversion_context xlsx_context(odf_document_.get());
|
||||
cpdoccore::oox::package::xlsx_document outputXlsx;
|
||||
|
||||
xlsx_context.set_output_document (&outputXlsx);
|
||||
|
||||
xlsx_context.start_document();
|
||||
objectBuild.table_table_->xlsx_convert(xlsx_context);
|
||||
xlsx_context.end_document();
|
||||
|
||||
std::wstring href_folder = tempPath + FILE_SEPARATOR_STR + L"temp_xlsx";
|
||||
NSDirectory::CreateDirectory(href_folder);
|
||||
outputXlsx.write(href_folder);
|
||||
|
||||
std::wstring href = L"Microsoft_Excel_Worksheet_" + std::to_wstring(Context.get_mediaitems().count_object + 1) + L".xlsx";
|
||||
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
if (S_OK == oCOfficeUtils.CompressFileOrDirectory(href_folder, odfPath + FILE_SEPARATOR_STR + href, true))
|
||||
{
|
||||
objectBuild.embeddedData = href;
|
||||
}
|
||||
}
|
||||
|
||||
objectBuild.docx_convert(Context);
|
||||
|
||||
frame = Context.get_drawing_context().get_current_frame(); //owner
|
||||
@ -1498,7 +1535,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
|
||||
drawing->type = oox::typeChart;
|
||||
|
||||
bool isMediaInternal = true;
|
||||
drawing->objectId = Context.add_mediaitem(href, drawing->type, isMediaInternal, href);
|
||||
drawing->objectId = Context.get_mediaitems().add_or_find(href, drawing->type, isMediaInternal, href);
|
||||
}
|
||||
else if (objectBuild.object_type_ == 2 ) //embedded text
|
||||
{
|
||||
@ -1556,7 +1593,7 @@ void draw_object::docx_convert(oox::docx_conversion_context & Context)
|
||||
bool isMediaInternal = true;
|
||||
|
||||
href += FILE_SEPARATOR_STR + href_new;
|
||||
drawing->objectId = Context.add_mediaitem(href, drawing->type, isMediaInternal, href);
|
||||
drawing->objectId = Context.get_mediaitems().add_or_find(href, drawing->type, isMediaInternal, href);
|
||||
drawing->objectProgId = L"Excel.Sheet.12";
|
||||
}
|
||||
}
|
||||
@ -1579,7 +1616,7 @@ void draw_object_ole::docx_convert(oox::docx_conversion_context & Context)
|
||||
use_image_replace = true;
|
||||
|
||||
//------------------------------------------------
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring folderPath = Context.root()->get_folder();
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
|
||||
@ -1594,10 +1631,141 @@ void draw_object_ole::docx_convert(oox::docx_conversion_context & Context)
|
||||
drawing->type = oox::typeOleObject;
|
||||
|
||||
bool isMediaInternal = true;
|
||||
drawing->objectId = Context.add_mediaitem(href, drawing->type, isMediaInternal, href);
|
||||
drawing->objectId = Context.get_mediaitems().add_or_find(href, drawing->type, isMediaInternal, href);
|
||||
|
||||
drawing->objectProgId = detectObject(objectPath);
|
||||
}
|
||||
void draw_control::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
if (!control_id_) return;
|
||||
|
||||
oox::text_forms_context::_state & state = Context.get_forms_context().get_state_element(*control_id_);
|
||||
if (state.id.empty()) return;
|
||||
|
||||
Context.get_drawing_context().start_shape(NULL);
|
||||
Context.get_drawing_context().add_name_object(state.name.empty() ? L"Control" : state.name);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
oox::_docx_drawing drawing = oox::_docx_drawing();
|
||||
|
||||
drawing.type = oox::typeShape;
|
||||
drawing.id = Context.get_drawing_context().get_current_shape_id();
|
||||
drawing.name = Context.get_drawing_context().get_current_object_name();
|
||||
drawing.inGroup = Context.get_drawing_context().in_group();
|
||||
drawing.sub_type = 1;
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
oox::StreamsManPtr prev = Context.get_stream_man();
|
||||
|
||||
std::wstringstream temp_stream(Context.get_drawing_context().get_text_stream_shape());
|
||||
Context.set_stream_man( boost::shared_ptr<oox::streams_man>( new oox::streams_man(temp_stream) ));
|
||||
|
||||
bool pState = Context.get_paragraph_state ();
|
||||
bool runState = Context.get_run_state ();
|
||||
bool keepState = Context.get_paragraph_keep ();
|
||||
|
||||
Context.set_run_state (false);
|
||||
Context.set_paragraph_state (false);
|
||||
|
||||
bool drState = Context.get_drawing_state_content();
|
||||
|
||||
Context.set_drawing_state_content(true);
|
||||
|
||||
Context.start_paragraph(false);
|
||||
|
||||
if (draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_text_style_name_)
|
||||
{
|
||||
text::paragraph_attrs attrs_;
|
||||
attrs_.text_style_name_ = *draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_text_style_name_;
|
||||
|
||||
int textStyle = Context.process_paragraph_attr(&attrs_);
|
||||
}
|
||||
|
||||
if (state.element)
|
||||
{
|
||||
state.element->docx_convert_sdt(Context, this);
|
||||
//state.element->docx_convert_field(Context, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring text;
|
||||
if (!state.label.empty()) text = state.label;
|
||||
else if (!state.value.empty()) text = state.value;
|
||||
|
||||
Context.add_new_run(L"");
|
||||
Context.output_stream() << L"<w:t xml:space=\"preserve\">";
|
||||
Context.output_stream() << xml::utils::replace_text_to_xml( text );
|
||||
Context.output_stream() << L"</w:t>";
|
||||
Context.finish_run();
|
||||
}
|
||||
Context.finish_paragraph();
|
||||
|
||||
Context.get_drawing_context().get_text_stream_shape() = temp_stream.str();
|
||||
Context.set_stream_man(prev);
|
||||
|
||||
Context.set_run_state (runState);
|
||||
Context.set_paragraph_state (pState);
|
||||
Context.set_drawing_state_content (drState);
|
||||
Context.set_paragraph_keep (keepState);
|
||||
|
||||
const std::wstring & content = Context.get_drawing_context().get_text_stream_shape();
|
||||
|
||||
drawing.additional.push_back(_property(L"text-content",content));
|
||||
Context.get_drawing_context().clear_stream_shape();
|
||||
|
||||
drawing.additional.push_back(_property(L"text-padding-left", 0.));
|
||||
drawing.additional.push_back(_property(L"text-padding-top", 0.));
|
||||
drawing.additional.push_back(_property(L"text-padding-right", 0.));
|
||||
drawing.additional.push_back(_property(L"text-padding-bottom", 0.));
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
|
||||
/////////
|
||||
common_draw_docx_convert(Context, draw_attlists_, &drawing);
|
||||
/////////
|
||||
|
||||
std::wostream & strm = Context.output_stream();
|
||||
|
||||
pState = Context.get_paragraph_state();
|
||||
runState = Context.get_run_state();
|
||||
keepState = Context.get_paragraph_keep();
|
||||
|
||||
//Context.set_run_state (false);
|
||||
Context.set_paragraph_state (false);
|
||||
|
||||
bool new_run = false;
|
||||
|
||||
if ((pState == false && Context.get_drawing_context().get_current_level() == 1) || (Context.get_drawing_context().in_group()))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Context.get_drawing_context().in_group() && !runState)
|
||||
{
|
||||
if (!pState)
|
||||
{
|
||||
Context.start_paragraph();
|
||||
}
|
||||
Context.add_new_run(L"");
|
||||
|
||||
new_run = true;
|
||||
}
|
||||
}
|
||||
|
||||
drawing.serialize(strm/*, Context.get_drawing_state_content()*/);
|
||||
|
||||
if (new_run)
|
||||
{
|
||||
Context.finish_run();
|
||||
if (!pState)
|
||||
{
|
||||
Context.finish_paragraph();
|
||||
}
|
||||
}
|
||||
|
||||
Context.set_paragraph_state(pState);
|
||||
|
||||
Context.get_drawing_context().stop_shape();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,11 +39,10 @@
|
||||
#include <boost/regex.h>
|
||||
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
|
||||
#include "style_graphic_properties.h"
|
||||
|
||||
@ -53,9 +52,11 @@
|
||||
#include "odf_document_impl.h"
|
||||
|
||||
#include "calcs_styles.h"
|
||||
#include "../docx/pptx_drawing.h"
|
||||
#include "chart_build_oox.h"
|
||||
|
||||
#include "../docx/pptx_drawing.h"
|
||||
#include "../docx/xlsx_package.h"
|
||||
|
||||
#include "datatypes/length.h"
|
||||
#include "datatypes/borderstyle.h"
|
||||
|
||||
@ -208,7 +209,7 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
|
||||
void draw_image::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
const std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
const std::wstring href = xlink_attlist_.href_.get_value_or(L"");
|
||||
|
||||
Context.get_slide_context().set_image(href);
|
||||
////////////////////////////////////в принципе достаточно общая часть ...
|
||||
@ -227,7 +228,7 @@ void draw_image::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
}
|
||||
void draw_chart::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
const std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
const std::wstring href = xlink_attlist_.href_.get_value_or(L"");
|
||||
Context.get_slide_context().set_chart(href);
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
@ -257,13 +258,13 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring tempPath = Context.root()->get_temp_folder();
|
||||
std::wstring odfPath = Context.root()->get_folder();
|
||||
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
|
||||
|
||||
if (!odf_document_ && !href.empty())
|
||||
{
|
||||
std::wstring tempPath = Context.root()->get_temp_folder();
|
||||
std::wstring folderPath = Context.root()->get_folder();
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
std::wstring objectPath = odfPath + FILE_SEPARATOR_STR + href;
|
||||
|
||||
// normalize path ???? todooo
|
||||
XmlUtils::replace_all( objectPath, FILE_SEPARATOR_STR + std::wstring(L"./"), FILE_SEPARATOR_STR);
|
||||
@ -282,11 +283,34 @@ void draw_object::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
|
||||
process_build_object process_build_object_(objectBuild, odf_document_->odf_context() );
|
||||
contentSubDoc->accept(process_build_object_);
|
||||
|
||||
if (objectBuild.table_table_)
|
||||
{
|
||||
oox::xlsx_conversion_context xlsx_context(odf_document_.get());
|
||||
cpdoccore::oox::package::xlsx_document outputXlsx;
|
||||
|
||||
xlsx_context.set_output_document (&outputXlsx);
|
||||
|
||||
xlsx_context.start_document();
|
||||
objectBuild.table_table_->xlsx_convert(xlsx_context);
|
||||
xlsx_context.end_document();
|
||||
|
||||
std::wstring href_folder = tempPath + FILE_SEPARATOR_STR + L"temp_xlsx";
|
||||
NSDirectory::CreateDirectory(href_folder);
|
||||
outputXlsx.write(href_folder);
|
||||
|
||||
std::wstring href = L"Microsoft_Excel_Worksheet_" + std::to_wstring(Context.get_mediaitems().count_object + 1) + L".xlsx";
|
||||
|
||||
COfficeUtils oCOfficeUtils(NULL);
|
||||
if (S_OK == oCOfficeUtils.CompressFileOrDirectory(href_folder, odfPath + FILE_SEPARATOR_STR + href, true))
|
||||
{
|
||||
objectBuild.embeddedData = href;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
if (objectBuild.object_type_ == 1)//диаграмма
|
||||
{
|
||||
const std::wstring href_draw = common_xlink_attlist_.href_.get_value_or(L"Chart");
|
||||
const std::wstring href_draw = xlink_attlist_.href_.get_value_or(L"Chart");
|
||||
objectBuild.pptx_convert(Context);
|
||||
|
||||
Context.get_slide_context().set_chart(href_draw); // в рисовательной части только место объекта, рамочки ... и релсы
|
||||
@ -355,7 +379,7 @@ void draw_object_ole::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
Context.get_slide_context().set_use_image_replacement();
|
||||
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring folderPath = Context.root()->get_folder();
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
|
||||
@ -374,7 +398,7 @@ void draw_plugin::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
Context.get_slide_context().set_use_image_replacement();
|
||||
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring folderPath = Context.root()->get_folder();
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
|
||||
|
||||
@ -203,7 +203,7 @@ void draw_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
void draw_image::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
|
||||
|
||||
if (href.empty() && office_binary_data_)
|
||||
{
|
||||
@ -234,7 +234,7 @@ void draw_image::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
void draw_chart::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
const std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
const std::wstring href = xlink_attlist_.href_.get_value_or(L"");
|
||||
Context.get_drawing_context().set_chart(href);
|
||||
|
||||
for (size_t i = 0 ; i < content_.size(); i++)
|
||||
@ -264,7 +264,7 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
|
||||
|
||||
if (!odf_document_ && !href.empty())
|
||||
{
|
||||
@ -291,7 +291,7 @@ void draw_object::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
if (objectBuild.object_type_ == 1) //диаграмма
|
||||
{
|
||||
const std::wstring href_draw = common_xlink_attlist_.href_.get_value_or(L"chart");
|
||||
const std::wstring href_draw = xlink_attlist_.href_.get_value_or(L"chart");
|
||||
objectBuild.xlsx_convert(Context);
|
||||
|
||||
Context.get_drawing_context().set_chart(href_draw); // в рисовательной части только место объекта, рамочки ... и релсы
|
||||
@ -352,7 +352,7 @@ void draw_object_ole::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
Context.get_drawing_context().set_use_image_replacement();
|
||||
|
||||
std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring href = xlink_attlist_.href_.get_value_or(L"");
|
||||
std::wstring folderPath = Context.root()->get_folder();
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
|
||||
|
||||
@ -65,6 +65,9 @@ public:
|
||||
|
||||
draw_shape() : bad_shape_(false), word_art_(false), idx_in_owner(-1) {}
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
friend class odf_document;
|
||||
//----------------------------------------------------------------------------------------------
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
@ -79,14 +82,11 @@ public:
|
||||
odf_types::union_common_draw_attlists common_draw_attlists_;
|
||||
|
||||
draw_shape_attlist draw_shape_attlist_;
|
||||
odf_types::common_xlink_attlist common_xlink_attlist_;
|
||||
odf_types::common_xlink_attlist xlink_attlist_;
|
||||
_CP_OPT(std::wstring) draw_id_; //используется для анимашек
|
||||
|
||||
office_element_ptr_array content_;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
friend class odf_document;
|
||||
//----------------------------------------------------------------------------------------------
|
||||
bool bad_shape_;
|
||||
bool word_art_;
|
||||
int sub_type_;
|
||||
|
||||
@ -134,7 +134,7 @@ void svg_font_face_name::add_text(const std::wstring & Text)
|
||||
|
||||
void common_svg_font_face_xlink_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
common_xlink_attlist_.add_attributes(Attributes);
|
||||
xlink_attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
// svg:definition-src
|
||||
|
||||
@ -56,7 +56,7 @@ class common_svg_font_face_xlink_attlist
|
||||
public:
|
||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
odf_types::common_xlink_attlist common_xlink_attlist_;
|
||||
odf_types::common_xlink_attlist xlink_attlist_;
|
||||
};
|
||||
// svg:font-face-uri
|
||||
class svg_font_face_uri : public office_element_impl<svg_font_face_uri>
|
||||
|
||||
@ -77,6 +77,10 @@ void content_xml_t::add_child_element( xml::sax * Reader, const std::wstring & N
|
||||
create_element_and_read(Reader, Ns, Name, content_, &context_, true);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"office", L"document-settings")
|
||||
{
|
||||
create_element_and_read(Reader, Ns, Name, content_, &context_, true);
|
||||
}
|
||||
else if CP_CHECK_NAME(L"office", L"document-meta")
|
||||
{
|
||||
create_element_and_read(Reader, Ns, Name, content_, &context_, true);
|
||||
}
|
||||
@ -88,6 +92,7 @@ void content_xml_t::add_child_element( xml::sax * Reader, const std::wstring & N
|
||||
{
|
||||
create_element_and_read(Reader, Ns, Name, content_, &context_, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void content_xml_t::add_text(const std::wstring & Text)
|
||||
|
||||
@ -54,7 +54,9 @@
|
||||
#include "office_annotation.h"
|
||||
#include "office_settings.h"
|
||||
#include "office_scripts.h"
|
||||
#include "office_forms.h"
|
||||
#include "office_event_listeners.h"
|
||||
#include "office_meta.h"
|
||||
|
||||
#include "styles.h"
|
||||
#include "style_regions.h"
|
||||
@ -141,6 +143,9 @@ odf_document::Impl::Impl(xml::sax * Reader, const std::wstring & tempPath):
|
||||
_CP_LOG << L"[info] parse manifest" << std::endl;
|
||||
parse_manifests(content_xml_->get_content());
|
||||
|
||||
_CP_LOG << L"[info] parse meta" << std::endl;
|
||||
parse_meta(content_xml_->get_content());
|
||||
|
||||
_CP_LOG << L"[info] parse settings" << std::endl;
|
||||
parse_settings(content_xml_->get_content());
|
||||
|
||||
@ -148,8 +153,8 @@ odf_document::Impl::Impl(xml::sax * Reader, const std::wstring & tempPath):
|
||||
}
|
||||
}
|
||||
|
||||
odf_document::Impl::Impl(const std::wstring & srcPath, const std::wstring & tempPath, const std::wstring & Password, const ProgressCallback* CallBack) :
|
||||
context_(new odf_read_context()), pCallBack(CallBack), bUserStopConvert (0), bError(false)
|
||||
odf_document::Impl::Impl(const std::wstring & srcPath, const std::wstring & tempPath, const std::wstring & password, const ProgressCallback* callBack) :
|
||||
context_(new odf_read_context()), pCallBack(callBack), bUserStopConvert (0), bError(false)
|
||||
{
|
||||
office_mime_type_ = 0;
|
||||
|
||||
@ -178,12 +183,12 @@ odf_document::Impl::Impl(const std::wstring & srcPath, const std::wstring & temp
|
||||
|
||||
if (false == map_encryptions_.empty())
|
||||
{
|
||||
if (Password.empty()) return;
|
||||
if (password.empty()) return;
|
||||
|
||||
//decrypt files
|
||||
tmp_folder_ = NSDirectory::CreateDirectoryWithUniqueName(tempPath);
|
||||
|
||||
bError = !decrypt_folder(base_folder_, tmp_folder_);
|
||||
bError = !decrypt_folder(password, base_folder_, tmp_folder_);
|
||||
|
||||
if (bError)
|
||||
return;
|
||||
@ -206,6 +211,8 @@ odf_document::Impl::Impl(const std::wstring & srcPath, const std::wstring & temp
|
||||
_CP_LOG << L"[info] read styles.xml" << std::endl;
|
||||
styles_xml_ = read_file_content(styles_xml);
|
||||
|
||||
_CP_LOG << L"[info] read meta.xml" << std::endl;
|
||||
meta_xml_ = read_file_content(meta_xml);
|
||||
//----------------------------------------------------------------------------------------
|
||||
_CP_LOG << L"[info] parse fonts" << std::endl;
|
||||
parse_fonts(content_xml_ ? content_xml_->get_content() : NULL);
|
||||
@ -216,6 +223,8 @@ odf_document::Impl::Impl(const std::wstring & srcPath, const std::wstring & temp
|
||||
_CP_LOG << L"[info] parse settings" << std::endl;
|
||||
parse_settings(settings_xml_ ? settings_xml_->get_content() : NULL);
|
||||
|
||||
_CP_LOG << L"[info] parse meta" << std::endl;
|
||||
parse_meta(meta_xml_ ? meta_xml_->get_content() : NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -248,7 +257,7 @@ odf_document::Impl::~Impl()
|
||||
NSDirectory::DeleteDirectory(tmp_folder_);
|
||||
}
|
||||
|
||||
bool odf_document::Impl::decrypt_folder (const std::wstring & srcPath, const std::wstring & dstPath)
|
||||
bool odf_document::Impl::decrypt_folder (const std::wstring &password, const std::wstring & srcPath, const std::wstring & dstPath)
|
||||
{
|
||||
std::vector<std::wstring> arFiles = NSDirectory::GetFiles(srcPath, false);
|
||||
std::vector<std::wstring> arDirectories = NSDirectory::GetDirectories(srcPath);
|
||||
@ -261,7 +270,7 @@ bool odf_document::Impl::decrypt_folder (const std::wstring & srcPath, const std
|
||||
std::map<std::wstring, std::pair<office_element_ptr, int>>::iterator pFind = map_encryptions_.find(arFiles[i]);
|
||||
if ( pFind != map_encryptions_.end() )
|
||||
{
|
||||
result = decrypt_file(arFiles[i], dstPath + FILE_SEPARATOR_STR + sFileName, pFind->second.first, pFind->second.second);
|
||||
result = decrypt_file(password, arFiles[i], dstPath + FILE_SEPARATOR_STR + sFileName, pFind->second.first, pFind->second.second);
|
||||
|
||||
if (false == result)
|
||||
break;
|
||||
@ -277,7 +286,7 @@ bool odf_document::Impl::decrypt_folder (const std::wstring & srcPath, const std
|
||||
|
||||
NSDirectory::CreateDirectory(dstPath + FILE_SEPARATOR_STR + sDirName);
|
||||
|
||||
result = decrypt_folder(arDirectories[i], dstPath + FILE_SEPARATOR_STR + sDirName);
|
||||
result = decrypt_folder(password, arDirectories[i], dstPath + FILE_SEPARATOR_STR + sDirName);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -297,72 +306,120 @@ std::string DecodeBase64(const std::wstring & value1)
|
||||
}
|
||||
return result;
|
||||
}
|
||||
bool odf_document::Impl::decrypt_file (const std::wstring & srcPath, const std::wstring & dstPath, office_element_ptr data, int size )
|
||||
bool odf_document::Impl::decrypt_file (const std::wstring &password, const std::wstring & srcPath, const std::wstring & dstPath, office_element_ptr element, int file_size )
|
||||
{
|
||||
manifest_encryption_data* encryption_data = dynamic_cast<manifest_encryption_data*>(data.get());
|
||||
manifest_encryption_data* encryption_data = dynamic_cast<manifest_encryption_data*>(element.get());
|
||||
if (!encryption_data) return false;
|
||||
|
||||
//std::wstring checksum_;
|
||||
//std::wstring checksum_type_;
|
||||
|
||||
manifest_algorithm* algorithm = dynamic_cast<manifest_algorithm*>(encryption_data->algorithm_.get());
|
||||
manifest_key_derivation* key_derivation = dynamic_cast<manifest_key_derivation*>(encryption_data->key_derivation_.get());
|
||||
manifest_start_key_generation* start_key_generation = dynamic_cast<manifest_start_key_generation*>(encryption_data->start_key_generation_.get());
|
||||
|
||||
CRYPT::ODFDecryptor decryptor;
|
||||
CRYPT::_odfCryptData cryptData;
|
||||
|
||||
cryptData.saltValue = DecodeBase64(key_derivation->salt_);
|
||||
cryptData.saltSize = cryptData.saltValue.length();
|
||||
|
||||
cryptData.hashSize = start_key_generation->key_size_;
|
||||
|
||||
cryptData.checksumData = DecodeBase64(encryption_data->checksum_);
|
||||
cryptData.initializationVector = DecodeBase64(algorithm->initialisation_vector_);
|
||||
|
||||
//------------------------------------------------------------------------------------------
|
||||
cryptData.hashAlgorithm = CRYPT_METHOD::SHA256;
|
||||
cryptData.spinCount = key_derivation->iteration_count_;
|
||||
cryptData.cipherAlgorithm = CRYPT_METHOD::AES_CBC;
|
||||
cryptData.keySize = 256 /8;
|
||||
|
||||
decryptor.SetCryptData(cryptData);
|
||||
|
||||
if (!decryptor.SetPassword(L"password"))
|
||||
if (key_derivation)
|
||||
{
|
||||
return false;
|
||||
cryptData.saltValue = DecodeBase64(key_derivation->salt_);
|
||||
cryptData.spinCount = key_derivation->iteration_count_;
|
||||
cryptData.keySize = key_derivation->key_size_;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------
|
||||
if (start_key_generation)
|
||||
{
|
||||
if (std::wstring::npos != start_key_generation->start_key_generation_name_.find(L"sha"))
|
||||
{
|
||||
if (std::wstring::npos != start_key_generation->start_key_generation_name_.find(L"512"))
|
||||
{
|
||||
cryptData.start_hashAlgorithm = CRYPT_METHOD::SHA512;
|
||||
}
|
||||
if (std::wstring::npos != start_key_generation->start_key_generation_name_.find(L"256"))
|
||||
{
|
||||
cryptData.start_hashAlgorithm = CRYPT_METHOD::SHA256;
|
||||
}
|
||||
}
|
||||
cryptData.start_hashSize = start_key_generation->key_size_;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------
|
||||
if (algorithm)
|
||||
{
|
||||
cryptData.initializationVector = DecodeBase64(algorithm->initialisation_vector_);
|
||||
|
||||
if (std::wstring::npos != algorithm->algorithm_name_.find(L"aes"))
|
||||
{
|
||||
if (std::wstring::npos != algorithm->algorithm_name_.find(L"cbc"))
|
||||
cryptData.cipherAlgorithm = CRYPT_METHOD::AES_CBC;
|
||||
else
|
||||
cryptData.cipherAlgorithm = CRYPT_METHOD::AES_ECB;//??
|
||||
}
|
||||
else if (std::wstring::npos != algorithm->algorithm_name_.find(L"blowfish"))
|
||||
{
|
||||
cryptData.cipherAlgorithm = CRYPT_METHOD::Blowfish_CFB;
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------
|
||||
if (encryption_data)
|
||||
{
|
||||
cryptData.checksum = DecodeBase64(encryption_data->checksum_);
|
||||
|
||||
cryptData.checksum_hashAlgorithm = CRYPT_METHOD::SHA1;
|
||||
if (std::wstring::npos != encryption_data->checksum_type_.find(L"sha"))
|
||||
{
|
||||
if (std::wstring::npos != encryption_data->checksum_type_.find(L"512"))
|
||||
{
|
||||
cryptData.checksum_hashAlgorithm = CRYPT_METHOD::SHA512;
|
||||
}
|
||||
if (std::wstring::npos != encryption_data->checksum_type_.find(L"256"))
|
||||
{
|
||||
cryptData.checksum_hashAlgorithm = CRYPT_METHOD::SHA256;
|
||||
}
|
||||
}
|
||||
|
||||
size_t nPosChecksumSize = encryption_data->checksum_type_.find(L"-");
|
||||
if (std::wstring::npos == nPosChecksumSize)
|
||||
nPosChecksumSize = encryption_data->checksum_type_.find(L"/");
|
||||
if (std::wstring::npos != nPosChecksumSize)
|
||||
{
|
||||
std::wstring strSize = encryption_data->checksum_type_.substr(nPosChecksumSize + 1);
|
||||
if (strSize == L"1k")
|
||||
{
|
||||
cryptData.checksum_size = 1024;
|
||||
}
|
||||
else
|
||||
{
|
||||
//???
|
||||
}
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
bool result = false;
|
||||
|
||||
NSFile::CFileBinary file_inp;
|
||||
if (file_inp.OpenFile(srcPath))
|
||||
|
||||
if (false == file_inp.OpenFile(srcPath))
|
||||
return false;
|
||||
|
||||
DWORD dwSizeRead = 0;
|
||||
_UINT64 lengthRead = file_inp.GetFileSize();
|
||||
|
||||
unsigned char* data = new unsigned char[lengthRead];
|
||||
unsigned char* data_out = NULL;
|
||||
|
||||
file_inp.ReadFile(data, lengthRead, dwSizeRead);
|
||||
file_inp.CloseFile();
|
||||
//------------------------------------------------------------------------------------------
|
||||
CRYPT::ODFDecryptor decryptor;
|
||||
decryptor.SetCryptData(cryptData);
|
||||
|
||||
bool result = decryptor.Decrypt(password, data, dwSizeRead, data_out, file_size);
|
||||
delete []data;
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
if (result && data_out)
|
||||
{
|
||||
_UINT64 lengthData, lengthRead = file_inp.GetFileSize();
|
||||
|
||||
unsigned char* data = new unsigned char[lengthRead];
|
||||
unsigned char* data_out = NULL;
|
||||
DWORD dwSizeRead = 0;
|
||||
|
||||
int readTrue = file_inp.ReadFile(data, lengthRead, dwSizeRead);
|
||||
int readData = readTrue - 8;
|
||||
|
||||
lengthData = *((_UINT64*)data);
|
||||
|
||||
decryptor.Decrypt(data + 8, readData, data_out, 0);//todoo сделать покусочное чтение декриптование
|
||||
|
||||
if (data_out)
|
||||
{
|
||||
NSFile::CFileBinary file_out;
|
||||
file_out.CreateFileW(dstPath);
|
||||
file_out.WriteFile(data_out, lengthData);
|
||||
file_out.CloseFile();
|
||||
|
||||
delete []data_out;
|
||||
result = true;
|
||||
}
|
||||
|
||||
delete []data;
|
||||
NSFile::CFileBinary file_out;
|
||||
file_out.CreateFileW(dstPath);
|
||||
file_out.WriteFile(data_out, file_size);
|
||||
file_out.CloseFile();
|
||||
|
||||
delete []data_out;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -587,7 +644,26 @@ void odf_document::Impl::parse_settings(office_element *element)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void odf_document::Impl::parse_meta(office_element *element)
|
||||
{
|
||||
office_document_base * document = dynamic_cast<office_document_base *>( element );
|
||||
if (!document) return;
|
||||
|
||||
office_meta * meta = dynamic_cast<office_meta*>(document->office_meta_.get());
|
||||
if (!meta) return;
|
||||
|
||||
for (size_t i = 0; i < meta->meta_user_defined_.size(); i++)
|
||||
{
|
||||
meta_user_defined * user_defined = dynamic_cast<meta_user_defined*>(meta->meta_user_defined_[i].get());
|
||||
if (!user_defined) continue;
|
||||
|
||||
if (user_defined->meta_name_.empty()) continue;
|
||||
|
||||
context_->Settings().add_user_defined(user_defined->meta_name_, user_defined->content_);
|
||||
}
|
||||
}
|
||||
|
||||
void odf_document::Impl::parse_styles(office_element *element)
|
||||
@ -642,12 +718,13 @@ void odf_document::Impl::parse_styles(office_element *element)
|
||||
( L"common:" + styleInst->style_name_,
|
||||
styleInst->style_display_name_.get_value_or(L""),
|
||||
styleInst->style_family_.get_type(),
|
||||
&(styleInst->style_content_),
|
||||
&(styleInst->content_),
|
||||
true,
|
||||
false,
|
||||
styleInst->style_parent_style_name_.get_value_or(L""),
|
||||
styleInst->style_next_style_name_.get_value_or(L""),
|
||||
styleInst->style_data_style_name_.get_value_or(L"")
|
||||
styleInst->style_data_style_name_.get_value_or(L""),
|
||||
styleInst->style_class_.get_value_or(L"")
|
||||
);
|
||||
}
|
||||
// list styles
|
||||
@ -721,12 +798,13 @@ void odf_document::Impl::parse_styles(office_element *element)
|
||||
context_->styleContainer().add_style(L"",
|
||||
L"",
|
||||
styleInst->style_family_.get_type(),
|
||||
&(styleInst->style_content_),
|
||||
&(styleInst->content_),
|
||||
false,
|
||||
true,
|
||||
L"",
|
||||
L"",
|
||||
L"");
|
||||
L"",
|
||||
L"");
|
||||
}
|
||||
for (size_t i = 0; i < docStyles->style_presentation_page_layout_.size(); i++)
|
||||
{
|
||||
@ -758,12 +836,13 @@ void odf_document::Impl::parse_styles(office_element *element)
|
||||
context_->styleContainer().add_style(styleInst->style_name_,
|
||||
styleInst->style_display_name_.get_value_or(L""),
|
||||
styleInst->style_family_.get_type(),
|
||||
&(styleInst->style_content_),
|
||||
&(styleInst->content_),
|
||||
false,
|
||||
false,
|
||||
styleInst->style_parent_style_name_.get_value_or(L""),
|
||||
styleInst->style_next_style_name_.get_value_or(L""),
|
||||
styleInst->style_data_style_name_.get_value_or(L"")
|
||||
styleInst->style_data_style_name_.get_value_or(L""),
|
||||
styleInst->style_class_.get_value_or(L"")
|
||||
);
|
||||
}
|
||||
|
||||
@ -908,12 +987,13 @@ void odf_document::Impl::parse_styles(office_element *element)
|
||||
context_->styleContainer().add_style(styleInst->style_name_,
|
||||
styleInst->style_display_name_.get_value_or(L""),
|
||||
styleInst->style_family_.get_type(),
|
||||
&(styleInst->style_content_),
|
||||
&(styleInst->content_),
|
||||
true,
|
||||
false,
|
||||
styleInst->style_parent_style_name_.get_value_or(L""),
|
||||
styleInst->style_next_style_name_.get_value_or(L""),
|
||||
styleInst->style_data_style_name_.get_value_or(L"")
|
||||
styleInst->style_data_style_name_.get_value_or(L""),
|
||||
styleInst->style_class_.get_value_or(L"")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -96,9 +96,10 @@ private:
|
||||
void parse_fonts (office_element *elemen);
|
||||
void parse_manifests(office_element *element);
|
||||
void parse_settings (office_element *element);
|
||||
void parse_meta (office_element *element);
|
||||
|
||||
bool decrypt_folder (const std::wstring & srcPath, const std::wstring & dstPath);
|
||||
bool decrypt_file (const std::wstring & srcPath, const std::wstring & dstPath, office_element_ptr data, int size );
|
||||
bool decrypt_folder (const std::wstring &password, const std::wstring & srcPath, const std::wstring & dstPath);
|
||||
bool decrypt_file (const std::wstring &password, const std::wstring & srcPath, const std::wstring & dstPath, office_element_ptr data, int size );
|
||||
|
||||
content_xml_t_ptr content_xml_;
|
||||
content_xml_t_ptr styles_xml_;
|
||||
|
||||
@ -47,7 +47,8 @@ style_instance::style_instance(
|
||||
bool IsDefault,
|
||||
const std::wstring & ParentStyleName,
|
||||
const std::wstring & NextStyleName,
|
||||
const std::wstring & DataStyleName
|
||||
const std::wstring & DataStyleName,
|
||||
const std::wstring & StyleClass
|
||||
) :
|
||||
container_ (Container),
|
||||
name_ (Name),
|
||||
@ -56,6 +57,7 @@ style_instance::style_instance(
|
||||
is_automatic_ (IsAutomatic),
|
||||
is_default_ (IsDefault),
|
||||
next_name_ (NextStyleName),
|
||||
style_class_ (StyleClass),
|
||||
next_ (Container->style_by_name(NextStyleName, style_type_, false)),
|
||||
data_style_name_(DataStyleName)
|
||||
{
|
||||
@ -83,7 +85,8 @@ void styles_container::add_style( const std::wstring & Name,
|
||||
bool IsDefault,
|
||||
const std::wstring & ParentStyleName_,
|
||||
const std::wstring & NextStyleName,
|
||||
const std::wstring & DataStyleName)
|
||||
const std::wstring & DataStyleName,
|
||||
const std::wstring & StyleClass)
|
||||
{
|
||||
std::wstring ParentStyleName = ParentStyleName_;
|
||||
|
||||
@ -91,9 +94,8 @@ void styles_container::add_style( const std::wstring & Name,
|
||||
{
|
||||
ParentStyleName = L"";//иначе в коде возможно зацикливание.
|
||||
}
|
||||
style_instance_ptr newStyle = style_instance_ptr(
|
||||
new style_instance(this, Name, Type, Content, IsAutomatic, IsDefault, ParentStyleName, NextStyleName, DataStyleName)
|
||||
);
|
||||
style_instance_ptr newStyle = style_instance_ptr( new style_instance(this, Name, Type, Content, IsAutomatic, IsDefault,
|
||||
ParentStyleName, NextStyleName, DataStyleName, StyleClass));
|
||||
|
||||
instances_.push_back(newStyle);
|
||||
int pos = static_cast<int>(instances_.size() - 1);
|
||||
@ -180,6 +182,10 @@ const std::wstring & style_instance::data_style_name() const
|
||||
{
|
||||
return data_style_name_;
|
||||
}
|
||||
const std::wstring & style_instance::style_class() const
|
||||
{
|
||||
return style_class_;
|
||||
}
|
||||
|
||||
style_instance * styles_container::style_by_name(const std::wstring & Name, style_family::type Type, bool object_in_styles) const
|
||||
{
|
||||
|
||||
@ -64,7 +64,8 @@ public:
|
||||
bool IsDefault,
|
||||
const std::wstring & ParentStyleName,
|
||||
const std::wstring & NextStyleName,
|
||||
const std::wstring & DataStyleName
|
||||
const std::wstring & DataStyleName,
|
||||
const std::wstring & StyleClass
|
||||
);
|
||||
|
||||
|
||||
@ -77,6 +78,7 @@ public:
|
||||
const std::wstring & next_name() const;
|
||||
const styles_container * container() const { return container_; }
|
||||
const std::wstring & data_style_name() const;
|
||||
const std::wstring & style_class() const;
|
||||
|
||||
bool is_automatic() const;
|
||||
bool is_default() const;
|
||||
@ -90,6 +92,7 @@ private:
|
||||
bool is_automatic_;
|
||||
bool is_default_;
|
||||
|
||||
std::wstring style_class_;
|
||||
std::wstring parent_name_;
|
||||
std::wstring next_name_;
|
||||
mutable style_instance * parent_;
|
||||
@ -145,7 +148,8 @@ public:
|
||||
bool IsDefault,
|
||||
const std::wstring & ParentStyleName,
|
||||
const std::wstring & NextStyleName,
|
||||
const std::wstring & DataStyleName);
|
||||
const std::wstring & DataStyleName,
|
||||
const std::wstring & StyleClass);
|
||||
|
||||
void add_master_page_name(const std::wstring & StyleName, const std::wstring & MasterPageName);
|
||||
|
||||
|
||||
@ -67,7 +67,6 @@ std::wstring office_binary_data::write_to(const std::wstring & path)
|
||||
{
|
||||
std::wstring result;
|
||||
|
||||
NSFile::CBase64Converter base64;
|
||||
int nLength = 0;
|
||||
unsigned char *pData = NULL;
|
||||
|
||||
|
||||
@ -126,7 +126,7 @@ void office_body::docx_convert(oox::docx_conversion_context & Context)
|
||||
if ((fill.bitmap) && (fill.bitmap->rId.empty()))
|
||||
{
|
||||
std::wstring href = fill.bitmap->xlink_href_;
|
||||
fill.bitmap->rId = Context.add_mediaitem(href, oox::typeImage, fill.bitmap->isInternal, href);
|
||||
fill.bitmap->rId = Context.get_mediaitems().add_or_find(href, oox::typeImage, fill.bitmap->isInternal, href);
|
||||
}
|
||||
int id = Context.get_drawing_context().get_current_shape_id();
|
||||
if (layout_properties->docx_background_serialize(Context.output_stream(), Context, fill, id))
|
||||
|
||||
@ -74,7 +74,9 @@ void office_document_base::add_child_element( xml::sax * Reader, const std::wstr
|
||||
CP_CREATE_ELEMENT(office_scripts_);
|
||||
else if CP_CHECK_NAME(L"office", L"settings")
|
||||
CP_CREATE_ELEMENT(office_settings_);
|
||||
else if CP_CHECK_NAME(L"manifest", L"file-entry")
|
||||
else if CP_CHECK_NAME(L"office", L"meta")
|
||||
CP_CREATE_ELEMENT(office_meta_);
|
||||
else if CP_CHECK_NAME(L"manifest", L"file-entry")
|
||||
CP_CREATE_ELEMENT(manifests_);
|
||||
else
|
||||
CP_NOT_APPLICABLE_ELM();
|
||||
@ -158,6 +160,13 @@ void manifest_encryption_data::add_attributes( const xml::attributes_wc_ptr & At
|
||||
{
|
||||
CP_APPLY_ATTR(L"manifest:checksum", checksum_, std::wstring(L""));
|
||||
CP_APPLY_ATTR(L"manifest:checksum-type", checksum_type_, std::wstring(L""));
|
||||
|
||||
size_t nFind = checksum_type_.find(L"#");
|
||||
if (nFind != std::wstring::npos)
|
||||
{
|
||||
checksum_type_ = checksum_type_.substr(nFind + 1);
|
||||
}
|
||||
checksum_type_ = XmlUtils::GetLower(checksum_type_);
|
||||
}
|
||||
void manifest_encryption_data::add_child_element(cpdoccore::xml::sax *Reader, const std::wstring &Ns, const std::wstring &Name)
|
||||
{
|
||||
@ -181,8 +190,15 @@ const wchar_t * manifest_algorithm::name = L"algorithm";
|
||||
|
||||
void manifest_algorithm::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"manifest:algorithm-name", algorithm_name, std::wstring(L""));
|
||||
CP_APPLY_ATTR(L"manifest:algorithm-name", algorithm_name_, std::wstring(L""));
|
||||
CP_APPLY_ATTR(L"manifest:initialisation-vector", initialisation_vector_, std::wstring(L""));
|
||||
|
||||
size_t nFind = algorithm_name_.find(L"#");
|
||||
if (nFind != std::wstring::npos)
|
||||
{
|
||||
algorithm_name_ = algorithm_name_.substr(nFind + 1);
|
||||
}
|
||||
algorithm_name_ = XmlUtils::GetLower(algorithm_name_);
|
||||
}
|
||||
// manifest:key-derivation
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -193,8 +209,15 @@ void manifest_key_derivation::add_attributes( const xml::attributes_wc_ptr & Att
|
||||
{
|
||||
CP_APPLY_ATTR(L"manifest:key-derivation-name", key_derivation_name_, std::wstring(L""));
|
||||
CP_APPLY_ATTR(L"manifest:key-size", key_size_, 16);
|
||||
CP_APPLY_ATTR(L"manifest:iteration-count", iteration_count_, 100000);
|
||||
CP_APPLY_ATTR(L"manifest:iteration-count", iteration_count_, 1024);
|
||||
CP_APPLY_ATTR(L"manifest:salt", salt_, std::wstring(L""));
|
||||
|
||||
size_t nFind = key_derivation_name_.find(L"#");
|
||||
if (nFind != std::wstring::npos)
|
||||
{
|
||||
key_derivation_name_ = key_derivation_name_.substr(nFind + 1);
|
||||
}
|
||||
key_derivation_name_ = XmlUtils::GetLower(key_derivation_name_);
|
||||
}
|
||||
// manifest:start-key-generation
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -205,6 +228,13 @@ void manifest_start_key_generation::add_attributes( const xml::attributes_wc_ptr
|
||||
{
|
||||
CP_APPLY_ATTR(L"manifest:start-key-generation-name", start_key_generation_name_, std::wstring(L""));
|
||||
CP_APPLY_ATTR(L"manifest:key-size", key_size_, 20);
|
||||
|
||||
size_t nFind = start_key_generation_name_.find(L"#");
|
||||
if (nFind != std::wstring::npos)
|
||||
{
|
||||
start_key_generation_name_ = start_key_generation_name_.substr(nFind + 1);
|
||||
}
|
||||
start_key_generation_name_ = XmlUtils::GetLower(start_key_generation_name_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -253,7 +253,7 @@ public:
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
std::wstring algorithm_name;
|
||||
std::wstring algorithm_name_;
|
||||
std::wstring initialisation_vector_;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(manifest_algorithm);
|
||||
|
||||
@ -46,9 +46,14 @@ enum ElementType
|
||||
typeTextBookmark,
|
||||
typeTextBookmarkStart,
|
||||
typeTextBookmarkEnd,
|
||||
typeTextBookmarkRef,
|
||||
typeTextReferenceMark,
|
||||
typeTextReferenceMarkStart,
|
||||
typeTextReferenceMarkEnd,
|
||||
|
||||
typeTextFieldFieldmarkStart,
|
||||
typeTextFieldFieldmarkEnd,
|
||||
|
||||
typeTextSpan,
|
||||
typeTextA,
|
||||
typeTextNote,
|
||||
@ -99,6 +104,9 @@ enum ElementType
|
||||
|
||||
typeDcCreator,
|
||||
typeDcDate,
|
||||
typeDcDescription,
|
||||
typeDcSubject,
|
||||
typeDcTitle,
|
||||
|
||||
typeDrawA,
|
||||
|
||||
@ -151,6 +159,8 @@ enum ElementType
|
||||
typeTextUserFieldSet,
|
||||
typeTextUserFieldInput,
|
||||
|
||||
typeTextUserDefined,
|
||||
|
||||
typeTextTrackedChanges,
|
||||
typeTextChangedRegion,
|
||||
typeTextChangeStart,
|
||||
@ -369,6 +379,15 @@ enum ElementType
|
||||
typeOfficeSettingsConfigItemMapNamed,
|
||||
typeOfficeSettingsConfigItemMapEntry,
|
||||
|
||||
typeOfficeMeta,
|
||||
typeOfficeMetaUserDefined,
|
||||
typeOfficeMetaDocumentStatistic,
|
||||
typeOfficeMetaGenerator,
|
||||
typeOfficeMetaCreationDate,
|
||||
typeOfficeMetaKeyword,
|
||||
typeOfficeMetaEditingCycles,
|
||||
typeOfficeMetaEditingDuration,
|
||||
|
||||
typeDrawG,
|
||||
typeDrawFrame,
|
||||
typeDrawImage,
|
||||
@ -408,6 +427,36 @@ enum ElementType
|
||||
typeDr3dRotate,
|
||||
typeDr3dSphere,
|
||||
|
||||
typeOfficeForms,
|
||||
typeFormForm,
|
||||
typeFormProperties,
|
||||
typeFormProperty,
|
||||
typeFormListProperty,
|
||||
typeFormListValue,
|
||||
typeFormElement,
|
||||
typeFormButton,
|
||||
typeFormCheckbox,
|
||||
typeFormText,
|
||||
typeFormCombobox,
|
||||
typeFormListbox,
|
||||
typeFormConnectionResource,
|
||||
typeFormDate,
|
||||
typeFormFile,
|
||||
typeFormFixedText,
|
||||
typeFormFormattedText,
|
||||
typeFormFrame,
|
||||
typeFormGenericControl,
|
||||
typeFormGrid,
|
||||
typeFormHidden,
|
||||
typeFormImage,
|
||||
typeFormImageFrame,
|
||||
typeFormNumber,
|
||||
typeFormPassword,
|
||||
typeFormRadio,
|
||||
typeFormTextarea,
|
||||
typeFormTime,
|
||||
typeFormValueRange,
|
||||
|
||||
typeDrawPage,
|
||||
typePresentationFooterDecl,
|
||||
typePresentationDateTimeDecl,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user