Compare commits

..

29 Commits

Author SHA1 Message Date
65e7372cf7 Merge remote-tracking branch 'origin/release/v5.0.0' into develop 2017-08-18 16:07:56 +03:00
2ce5708599 Odf, xls, doc - fix users files 2017-08-18 15:51:55 +03:00
1ea27ad7f8 Added multithread flag 2017-08-18 15:45:06 +03:00
48d94d24eb cache xlsx file to support pivot in xls, ods...; don't send jwt signature; and save in doctrenderer; 2017-08-18 14:49:56 +03:00
f5c569ab2a DocFormatReader ... 2017-08-18 12:01:45 +03:00
2e61fcfdd9 read/write pptm 2017-08-17 20:18:57 +03:00
3df883cbe8 return errors 2017-08-17 09:38:03 +03:00
0ed3f740b7 read/write docm 2017-08-16 18:05:59 +03:00
af2e76aea6 OdfFormatWriter - fix convert notes 2017-08-16 16:21:19 +03:00
6593230d48 . 2017-08-15 19:56:00 +03:00
e02c72b564 x2t version up. read/write xlsm. 2017-08-15 17:23:17 +03:00
c2964f92af . 2017-08-15 16:10:34 +03:00
15fb3a4f4e Revert "."
This reverts commit cff1836571.
2017-08-15 16:09:09 +03:00
cff1836571 . 2017-08-15 16:08:40 +03:00
cb57db3c8a . 2017-08-15 16:05:27 +03:00
d22fb105b6 OoxFormat - vbaProject, ... 2017-08-15 15:18:28 +03:00
89aba918bc OoxFormat - read/write vbaProject in binary 2017-08-14 19:24:21 +03:00
47c1e6f637 Merge branch 'develop' of github.com:ONLYOFFICE/core into develop 2017-08-14 16:36:45 +03:00
f5284c967b . 2017-08-14 16:32:41 +03:00
d465e29a0f v4.4.3 2017-08-14 16:30:52 +03:00
f43ef621cb OoxFormat - add vba & activeX controls 2017-08-14 16:26:30 +03:00
2f9a8eb77f OdfFormatReader - pilots converting .. 2017-08-11 09:47:20 +03:00
a70087e1f2 no base 64 data 2017-08-09 19:44:57 +03:00
c3da9a66a1 OdfFormatReader - convert pilots ... 2017-08-09 18:23:25 +03:00
f907a90be7 . 2017-08-09 18:22:42 +03:00
f65a27cf86 Build the v8 in multithreaded mode 2017-08-09 17:06:52 +03:00
ed59c2b998 . 2017-08-09 14:55:02 +03:00
925bca7149 OdfFormatWriter - small refactoring, fix chart size (from xls) 2017-08-09 13:36:00 +03:00
89ce79dafc v4.4.2 2017-07-24 15:25:00 +03:00
139 changed files with 3715 additions and 2122 deletions

View File

@ -75,6 +75,8 @@ namespace DocFileFormat
while ( ( cp - m_document->FIB->m_RgLw97.ccpText ) < (*m_document->IndividualFootnotesPlex)[id + 1] )
{
int cpStart = cp;
int fc = m_document->FindFileCharPos(cp);
if (fc < 0) break;
@ -93,6 +95,8 @@ namespace DocFileFormat
//this PAPX is for a normal paragraph
cp = writeParagraph( cp );
}
while (cp <= cpStart) //conv_fQioC665ib4ngHkDGY4__docx.doc
cp++;
}
m_pXmlWriter->WriteNodeEnd( L"w:footnote");

View File

@ -124,11 +124,14 @@ namespace DocFileFormat
TableInfo tai(papx);
if (tai.fInTable)
{
int cpStart = cp;
//this PAPX is for a table
//cp = writeTable( cp, tai.iTap );
Table table( this, cp, ( ( tai.iTap > 0 ) ? ( 1 ) : ( 0 ) ) );
table.Convert(this);
cp = table.GetCPEnd();
while (cp <= cpStart) //conv_eznHsm8em2unSv6_2QE__docx.doc
cp++;
}
else
{

View File

@ -107,7 +107,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="C:\_WORK\trunk\ServerComponents\Common\DocxFormat\Source\XML\libxml2\XML\include"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="_DEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"

View File

@ -2,34 +2,38 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatLib", "..\DocFormatLib\Win32\DocFormatLib.vcproj", "{C5371405-338F-4B70-83BD-2A5CDF64F383}"
ProjectSection(ProjectDependencies) = postProject
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C}
{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
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
{617F9069-5E37-4B80-9A3A-E77AFC4CC7AD} = {617F9069-5E37-4B80-9A3A-E77AFC4CC7AD}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{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
{EE1B576A-07C5-4ACC-920F-81C41DD0C8C1} = {EE1B576A-07C5-4ACC-920F-81C41DD0C8C1}
{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
{43A0E60E-5C4A-4C09-A29B-7683F503BBD7} = {43A0E60E-5C4A-4C09-A29B-7683F503BBD7}
{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}
{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}
{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}"
@ -54,17 +58,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsFormat", "..\..\ASCOffic
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatTest", "DocFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
ProjectSection(ProjectDependencies) = postProject
{C5371405-338F-4B70-83BD-2A5CDF64F383} = {C5371405-338F-4B70-83BD-2A5CDF64F383}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C}
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF} = {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{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
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\..\Common\DocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"

View File

@ -44,7 +44,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\Common\OfficeDrawing;&quot;..\..\..\..\..\DesktopEditor\freetype-2.5.2\include&quot;;..\..\..\..\..\Common\OfficeDrawing\Shapes"
AdditionalIncludeDirectories="../../DesktopEditor/xml/build/vs2005;../../DesktopEditor/xml/libxml2/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ATL_CSTRINGS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="false"
BasicRuntimeChecks="3"

View File

@ -40,11 +40,11 @@ namespace Writers
class DocumentWriter : public ContentWriter
{
XmlUtils::CStringWriter m_oWriter;
HeaderFooterWriter& m_oHeaderFooterWriter;
HeaderFooterWriter& m_oHeaderFooterWriter;
public:
std::wstring m_sDir;
public:
DocumentWriter( std::wstring sDir, HeaderFooterWriter& oHeaderFooterWriter):m_sDir(sDir), m_oHeaderFooterWriter(oHeaderFooterWriter)
std::wstring m_sDir;
DocumentWriter( std::wstring sDir, HeaderFooterWriter& oHeaderFooterWriter):m_sDir(sDir), m_oHeaderFooterWriter(oHeaderFooterWriter)
{
}
void Write()

View File

@ -31,7 +31,9 @@
*/
#ifndef FILE_WRITER
#define FILE_WRITER
#include "../../DesktopEditor/common/Path.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/VbaProject.h"
#include "NumberingWriter.h"
#include "fontTableWriter.h"
@ -75,6 +77,8 @@ namespace Writers
DocumentRelsWriter m_oDocumentRelsWriter;
WebSettingsWriter m_oWebSettingsWriter;
DefaultThemeWriter m_oTheme;
smart_ptr<OOX::VbaProject> m_pVbaProject;
NSBinPptxRW::CDrawingConverter* m_pDrawingConverter;
bool m_bSaveChartAsImg;

View File

@ -34,6 +34,30 @@
namespace BinDocxRW {
int Binary_VbaProjectTableReader::Read()
{
return ReadTable(&Binary_VbaProjectTableReader::ReadContent, this);
}
int Binary_VbaProjectTableReader::ReadContent(BYTE type, long length, void* poResult)
{
int res = c_oSerConstants::ReadOk;
if ( c_oSerVbaProjectTypes::Name == type )
{
std::wstring file_name = m_oBufferedStream.GetString4(length);
OOX::CPath inputPath = m_oBufferedStream.m_strFolder + FILE_SEPARATOR_STR + L"media" + FILE_SEPARATOR_STR + file_name;
OOX::CPath outputPath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR + L"vbaProject.bin";
NSFile::CFileBinary::Copy(inputPath.GetPath(), outputPath.GetPath());
m_oFileWriter.m_pVbaProject = new OOX::VbaProject();
m_oFileWriter.m_pVbaProject->set_filename(outputPath.GetPath());
}
else
res = c_oSerConstants::ReadUnknown;
return res;
}
//-------------------------------------------------------------------------------------
Binary_HdrFtrTableReader::Binary_HdrFtrTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, CComments* pComments):Binary_CommonReader(poBufferedStream),m_oFileWriter(oFileWriter),m_oHeaderFooterWriter(oFileWriter.m_oHeaderFooterWriter),m_pComments(pComments)
{
}
@ -93,9 +117,9 @@ int Binary_HdrFtrTableReader::ReadHdrFtrItem(BYTE type, long length, void* poRes
Binary_DocumentTableReader oBinary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, poHdrFtrItem->Header, m_pComments);
res = Read1(length, &Binary_HdrFtrTableReader::ReadHdrFtrItemContent, this, &oBinary_DocumentTableReader);
OOX::CPath fileRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + _T("word") +
FILE_SEPARATOR_STR + _T("_rels")+
FILE_SEPARATOR_STR + poHdrFtrItem->m_sFilename + _T(".rels");
OOX::CPath fileRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + L"word" +
FILE_SEPARATOR_STR + L"_rels"+
FILE_SEPARATOR_STR + poHdrFtrItem->m_sFilename + L".rels";
m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(fileRelsPath.GetPath());
}

View File

@ -273,6 +273,21 @@ private:
return res;
}
};
class Binary_VbaProjectTableReader : public Binary_CommonReader<Binary_VbaProjectTableReader>
{
Writers::FileWriter& m_oFileWriter;
public:
Binary_VbaProjectTableReader (NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter)
: Binary_CommonReader(poBufferedStream), m_oFileWriter(oFileWriter)
{
}
int Read ();
int ReadContent (BYTE type, long length, void* poResult);
};
class Binary_HdrFtrTableReader : public Binary_CommonReader<Binary_HdrFtrTableReader>
{
Writers::FileWriter& m_oFileWriter;
@ -282,12 +297,12 @@ class Binary_HdrFtrTableReader : public Binary_CommonReader<Binary_HdrFtrTableRe
int nCurHeaderType;
public:
Writers::HeaderFooterWriter& m_oHeaderFooterWriter;
public:
Binary_HdrFtrTableReader(NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter, CComments* pComments);
int Read();
int ReadHdrFtrContent(BYTE type, long length, void* poResult);
int ReadHdrFtrFEO(BYTE type, long length, void* poResult);
int ReadHdrFtrItem(BYTE type, long length, void* poResult);
int ReadHdrFtrContent (BYTE type, long length, void* poResult);
int ReadHdrFtrFEO (BYTE type, long length, void* poResult);
int ReadHdrFtrItem (BYTE type, long length, void* poResult);
int ReadHdrFtrItemContent(BYTE type, long length, void* poResult);
};
class Binary_rPrReader : public Binary_CommonReader<Binary_rPrReader>
@ -551,7 +566,7 @@ public:
std::wstring strXml;
HRESULT hRes = m_oFileWriter.m_pDrawingConverter->GetRecordXml(nCurPos, length, XMLWRITER_RECORD_TYPE_TEXT_FILL, XMLWRITER_DOC_TYPE_WORDART, strXml);
if (S_OK == hRes)
orPr->Fill = _T("<w14:textFill>") + strXml + _T("</w14:textFill>");
orPr->Fill = L"<w14:textFill>" + strXml + L"</w14:textFill>";
m_oBufferedStream.Seek(nCurPos + length);
}
}
@ -560,35 +575,35 @@ public:
{
TrackRevision oDel;
oBinary_CommonReader2.ReadTrackRevision(length, &oDel);
orPr->Del = oDel.ToString(_T("w:del"));
orPr->Del = oDel.ToString(L"w:del");
}
break;
case c_oSerProp_rPrType::Ins:
{
TrackRevision oIns;
oBinary_CommonReader2.ReadTrackRevision(length, &oIns);
orPr->Ins = oIns.ToString(_T("w:ins"));
orPr->Ins = oIns.ToString(L"w:ins");
}
break;
case c_oSerProp_rPrType::MoveFrom:
{
TrackRevision oMoveFrom;
oBinary_CommonReader2.ReadTrackRevision(length, &oMoveFrom);
orPr->MoveFrom = oMoveFrom.ToString(_T("w:moveFrom"));
orPr->MoveFrom = oMoveFrom.ToString(L"w:moveFrom");
}
break;
case c_oSerProp_rPrType::MoveTo:
{
TrackRevision oMoveTo;
oBinary_CommonReader2.ReadTrackRevision(length, &oMoveTo);
orPr->MoveTo = oMoveTo.ToString(_T("w:moveTo"));
orPr->MoveTo = oMoveTo.ToString(L"w:moveTo");
}
break;
case c_oSerProp_rPrType::rPrChange:
{
TrackRevision oRPrChange;
res = Read1(length, &Binary_rPrReader::ReadrPrChange, this, &oRPrChange);
orPr->rPrChange = oRPrChange.ToString(_T("w:rPrChange"));
orPr->rPrChange = oRPrChange.ToString(L"w:rPrChange");
}
break;
default:
@ -647,9 +662,9 @@ public:
{
BYTE contextualSpacing = m_oBufferedStream.GetUChar();
if(0 != contextualSpacing)
pCStringWriter->WriteString(std::wstring(_T("<w:contextualSpacing w:val=\"true\"/>")));
pCStringWriter->WriteString(std::wstring(L"<w:contextualSpacing w:val=\"true\"/>"));
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(std::wstring(_T("<w:contextualSpacing w:val=\"false\"/>")));
pCStringWriter->WriteString(std::wstring(L"<w:contextualSpacing w:val=\"false\"/>"));
}break;
case c_oSerProp_pPrType::Ind:
{
@ -657,9 +672,9 @@ public:
res = Read2(length, &Binary_pPrReader::ReadInd, this, &oTempWriter);
if(oTempWriter.GetCurSize() > 0)
{
pCStringWriter->WriteString(std::wstring(_T("<w:ind")));
pCStringWriter->WriteString(std::wstring(L"<w:ind"));
pCStringWriter->Write(oTempWriter);
pCStringWriter->WriteString(std::wstring(_T("/>")));
pCStringWriter->WriteString(std::wstring(L"/>"));
}
break;
}
@ -668,35 +683,35 @@ public:
BYTE jc = m_oBufferedStream.GetUChar();
switch(jc)
{
case align_Right: pCStringWriter->WriteString(std::wstring(_T("<w:jc w:val=\"right\" />")));break;
case align_Left: pCStringWriter->WriteString(std::wstring(_T("<w:jc w:val=\"left\" />")));break;
case align_Center: pCStringWriter->WriteString(std::wstring(_T("<w:jc w:val=\"center\" />")));break;
case align_Justify: pCStringWriter->WriteString(std::wstring(_T("<w:jc w:val=\"both\" />")));break;
case align_Right: pCStringWriter->WriteString(std::wstring(L"<w:jc w:val=\"right\" />"));break;
case align_Left: pCStringWriter->WriteString(std::wstring(L"<w:jc w:val=\"left\" />"));break;
case align_Center: pCStringWriter->WriteString(std::wstring(L"<w:jc w:val=\"center\" />"));break;
case align_Justify: pCStringWriter->WriteString(std::wstring(L"<w:jc w:val=\"both\" />"));break;
}
}break;
case c_oSerProp_pPrType::KeepLines:
{
BYTE KeepLines = m_oBufferedStream.GetUChar();
if(0 != KeepLines)
pCStringWriter->WriteString(std::wstring(_T("<w:keepLines/>")));
pCStringWriter->WriteString(std::wstring(L"<w:keepLines/>"));
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(std::wstring(_T("<w:keepLines w:val=\"false\"/>")));
pCStringWriter->WriteString(std::wstring(L"<w:keepLines w:val=\"false\"/>"));
}break;
case c_oSerProp_pPrType::KeepNext:
{
BYTE KeepNext = m_oBufferedStream.GetUChar();
if(0 != KeepNext)
pCStringWriter->WriteString(std::wstring(_T("<w:keepNext/>")));
pCStringWriter->WriteString(std::wstring(L"<w:keepNext/>"));
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(std::wstring(_T("<w:keepNext w:val=\"false\"/>")));
pCStringWriter->WriteString(std::wstring(L"<w:keepNext w:val=\"false\"/>"));
}break;
case c_oSerProp_pPrType::PageBreakBefore:
{
BYTE pageBreakBefore = m_oBufferedStream.GetUChar();
if(0 != pageBreakBefore)
pCStringWriter->WriteString(std::wstring(_T("<w:pageBreakBefore/>")));
pCStringWriter->WriteString(std::wstring(L"<w:pageBreakBefore/>"));
else if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(std::wstring(_T("<w:pageBreakBefore w:val=\"false\"/>")));
pCStringWriter->WriteString(std::wstring(L"<w:pageBreakBefore w:val=\"false\"/>"));
break;
}
case c_oSerProp_pPrType::Spacing:
@ -705,7 +720,7 @@ public:
res = Read2(length, &Binary_pPrReader::ReadSpacing, this, &oSpacing);
if(oSpacing.bLine || oSpacing.bAfter || oSpacing.bAfterAuto || oSpacing.bBefore || oSpacing.bBeforeAuto)
{
pCStringWriter->WriteString(std::wstring(_T("<w:spacing")));
pCStringWriter->WriteString(std::wstring(L"<w:spacing"));
BYTE bLineRule = linerule_Auto;
//проверяется bLine, а не bLineRule чтобы всегда писать LineRule, если есть w:line
if(oSpacing.bLine)
@ -745,9 +760,9 @@ public:
if(oSpacing.bAfterAuto)
{
if(true == oSpacing.AfterAuto)
pCStringWriter->WriteString(std::wstring(_T(" w:afterAutospacing=\"1\"")));
pCStringWriter->WriteString(std::wstring(L" w:afterAutospacing=\"1\""));
else
pCStringWriter->WriteString(std::wstring(_T(" w:afterAutospacing=\"0\"")));
pCStringWriter->WriteString(std::wstring(L" w:afterAutospacing=\"0\""));
}
if(oSpacing.bBefore)
{
@ -758,11 +773,11 @@ public:
if(oSpacing.bBeforeAuto)
{
if(true == oSpacing.BeforeAuto)
pCStringWriter->WriteString(std::wstring(_T(" w:beforeAutospacing=\"1\"")));
pCStringWriter->WriteString(std::wstring(L" w:beforeAutospacing=\"1\""));
else
pCStringWriter->WriteString(std::wstring(_T(" w:beforeAutospacing=\"0\"")));
pCStringWriter->WriteString(std::wstring(L" w:beforeAutospacing=\"0\""));
}
pCStringWriter->WriteString(std::wstring(_T("/>")));
pCStringWriter->WriteString(std::wstring(L"/>"));
}
break;
}
@ -776,7 +791,7 @@ public:
}
else
{
std::wstring sShd(_T("<w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"auto\"/>"));
std::wstring sShd(L"<w:shd w:val=\"clear\" w:color=\"auto\" w:fill=\"auto\"/>");
pCStringWriter->WriteString(sShd);
}
break;
@ -787,10 +802,10 @@ public:
if(0 != WidowControl)
{
if(false == bDoNotWriteNullProp)
pCStringWriter->WriteString(std::wstring(_T("<w:widowControl/>")));
pCStringWriter->WriteString(std::wstring(L"<w:widowControl/>"));
}
else
pCStringWriter->WriteString(std::wstring(_T("<w:widowControl w:val=\"off\" />")));
pCStringWriter->WriteString(std::wstring(L"<w:widowControl w:val=\"off\" />"));
break;
}
case c_oSerProp_pPrType::Tab:
@ -800,7 +815,7 @@ public:
size_t nLen = oTabs.m_aTabs.size();
if(nLen > 0)
{
pCStringWriter->WriteString(std::wstring(_T("<w:tabs>")));
pCStringWriter->WriteString(std::wstring(L"<w:tabs>"));
for(size_t i = 0; i < nLen; ++i)
{
Tab& oTab = oTabs.m_aTabs[i];
@ -808,14 +823,14 @@ public:
std::wstring sVal;
switch(oTab.Val)
{
case g_tabtype_right: sVal=_T("right"); break;
case g_tabtype_center: sVal=_T("center"); break;
case g_tabtype_clear: sVal=_T("clear"); break;
default: sVal=_T("left"); break;
case g_tabtype_right: sVal = L"right"; break;
case g_tabtype_center: sVal = L"center"; break;
case g_tabtype_clear: sVal = L"clear"; break;
default: sVal = L"left"; break;
}
pCStringWriter->WriteString(L"<w:tab w:val=\"" + sVal + L"\" w:pos=\"" + std::to_wstring(nTab) + L"\"/>");
}
pCStringWriter->WriteString(std::wstring(_T("</w:tabs>")));
pCStringWriter->WriteString(std::wstring(L"</w:tabs>"));
}
}break;
case c_oSerProp_pPrType::ParaStyle:
@ -826,9 +841,9 @@ public:
}break;
case c_oSerProp_pPrType::numPr:
{
pCStringWriter->WriteString(std::wstring(_T("<w:numPr>")));
pCStringWriter->WriteString(std::wstring(L"<w:numPr>"));
res = Read2(length, &Binary_pPrReader::ReadNumPr, this, poResult);
pCStringWriter->WriteString(std::wstring(_T("</w:numPr>")));
pCStringWriter->WriteString(std::wstring(L"</w:numPr>"));
}break;
case c_oSerProp_pPrType::pPr_rPr:
{
@ -2917,7 +2932,8 @@ class Binary_OtherTableReader : public Binary_CommonReader<Binary_OtherTableRead
Writers::FileWriter& m_oFileWriter;
std::wstring m_sFileInDir;
public:
Binary_OtherTableReader(std::wstring sFileInDir, NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter):m_sFileInDir(sFileInDir),Binary_CommonReader(poBufferedStream),m_oFileWriter(oFileWriter)
Binary_OtherTableReader(std::wstring sFileInDir, NSBinPptxRW::CBinaryFileReader& poBufferedStream, Writers::FileWriter& oFileWriter)
: m_sFileInDir(sFileInDir), Binary_CommonReader(poBufferedStream), m_oFileWriter(oFileWriter)
{
}
int Read()
@ -7022,13 +7038,13 @@ public:
{
if(false == m_oFileWriter.m_bSaveChartAsImg)
{
OOX::CPath pathChartsDir = m_oFileWriter.m_oChartWriter.m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR +_T("charts");
OOX::CPath pathChartsDir = m_oFileWriter.m_oChartWriter.m_sDir + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR + L"charts";
OOX::CSystemUtility::CreateDirectories(pathChartsDir.GetPath());
OOX::CPath pathChartsRelsDir = pathChartsDir.GetPath() + FILE_SEPARATOR_STR + _T("_rels");
OOX::CPath pathChartsRelsDir = pathChartsDir.GetPath() + FILE_SEPARATOR_STR + L"_rels";
OOX::CSystemUtility::CreateDirectories(pathChartsRelsDir.GetPath());
OOX::CPath pathChartsWorksheetDir = m_oFileWriter.m_oChartWriter.m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR +_T("embeddings");
OOX::CPath pathChartsWorksheetDir = m_oFileWriter.m_oChartWriter.m_sDir + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR + L"embeddings";
OOX::CSystemUtility::CreateDirectories(pathChartsWorksheetDir.GetPath());
int nativeDocumentType = m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_nDocumentType;
@ -7922,9 +7938,9 @@ public:
int res = ReadTable(&Binary_NotesTableReader::ReadNotes, this, &oBinary_DocumentTableReader);
OOX::CPath fileRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + _T("word") +
FILE_SEPARATOR_STR + _T("_rels")+
FILE_SEPARATOR_STR + sFilename + _T(".rels");
OOX::CPath fileRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + L"word" +
FILE_SEPARATOR_STR + L"_rels"+
FILE_SEPARATOR_STR + sFilename + L".rels";
m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(fileRelsPath.GetPath());
return res;
@ -7961,33 +7977,33 @@ public:
XmlUtils::CStringWriter& writer = pBinary_DocumentTableReader->m_oDocumentWriter.m_oContent;
if(m_bIsFootnote)
{
writer.WriteString(_T("<w:footnote"));
writer.WriteString(L"<w:footnote");
}
else
{
writer.WriteString(_T("<w:endnote"));
writer.WriteString(L"<w:endnote");
}
if(m_oType.IsInit())
{
writer.WriteString(_T(" w:type=\""));
writer.WriteString(L" w:type=\"");
writer.WriteString(m_oType->ToString());
writer.WriteString(_T("\""));
writer.WriteString(L"\"");
}
if(m_oId.IsInit())
{
writer.WriteString(_T(" w:id=\""));
writer.WriteString(L" w:id=\"");
writer.WriteString(m_oId->ToString());
writer.WriteString(_T("\""));
writer.WriteString(L"\"");
}
writer.WriteString(_T(">"));
writer.WriteString(L">");
res = Read1(length, &Binary_NotesTableReader::ReadNoteContent, this, poResult);
if(m_bIsFootnote)
{
writer.WriteString(_T("</w:footnote>"));
writer.WriteString(L"</w:footnote>");
}
else
{
writer.WriteString(_T("</w:endnote>"));
writer.WriteString(L"</w:endnote>");
}
}
else
@ -8087,8 +8103,8 @@ public:
}
else
{
m_oFileWriter.m_oSettingWriter.AddSetting(_T("<w:defaultTabStop w:val=\"708\"/>"));
std::wstring sClrMap(_T("<w:clrSchemeMapping w:bg1=\"light1\" w:t1=\"dark1\" w:bg2=\"light2\" w:t2=\"dark2\" w:accent1=\"accent1\" w:accent2=\"accent2\" w:accent3=\"accent3\" w:accent4=\"accent4\" w:accent5=\"accent5\" w:accent6=\"accent6\" w:hyperlink=\"hyperlink\" w:followedHyperlink=\"followedHyperlink\"/>"));
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:defaultTabStop w:val=\"708\"/>");
std::wstring sClrMap(L"<w:clrSchemeMapping w:bg1=\"light1\" w:t1=\"dark1\" w:bg2=\"light2\" w:t2=\"dark2\" w:accent1=\"accent1\" w:accent2=\"accent2\" w:accent3=\"accent3\" w:accent4=\"accent4\" w:accent5=\"accent5\" w:accent6=\"accent6\" w:hyperlink=\"hyperlink\" w:followedHyperlink=\"followedHyperlink\"/>");
m_oFileWriter.m_oSettingWriter.AddSetting(sClrMap);
m_oFileWriter.m_pDrawingConverter->LoadClrMap(sClrMap);
}
@ -8140,9 +8156,12 @@ public:
case c_oSerTableTypes::Endnotes:
res = Binary_NotesTableReader(m_oBufferedStream, m_oFileWriter, m_oFileWriter.m_pComments, false).Read();
break;
case c_oSerTableTypes::VbaProject:
res = Binary_VbaProjectTableReader(m_oBufferedStream, m_oFileWriter).Read();
break;
//Comments должны читаться раньше чем c_oSerTableTypes::Document
//case c_oSerTableTypes::Comments:
//case c_oSerTableTypes::Comments
// res = oBinary_CommentsTableReader.Read();
// break;
//case c_oSerTableTypes::Other:
@ -8165,7 +8184,18 @@ public:
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable", L"fontTable.xml", L"", &stamdartRId);
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme", L"theme/theme1.xml",L"", &stamdartRId);
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml", L"/word", L"document.xml");
if (m_oFileWriter.m_pVbaProject.IsInit())
{
//m_oFileWriter.m_pVbaProject->write();
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.microsoft.com/office/2006/relationships/vbaProject", L"vbaProject.bin", L"", &stamdartRId);
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.ms-word.document.macroEnabled.main+xml", L"/word", L"document.xml");
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.ms-office.vbaProject", L"/word", L"vbaProject.bin");
}
else
{
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml", L"/word", L"document.xml");
}
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml", L"/word", L"styles.xml");
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml", L"/word", L"settings.xml");
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml", L"/word", L"webSettings.xml");
@ -8175,19 +8205,19 @@ public:
if(false == m_oFileWriter.m_oNumberingWriter.IsEmpty())
{
long rId;
m_oFileWriter.m_pDrawingConverter->WriteRels(std::wstring(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering")), std::wstring(_T("numbering.xml")), std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering", L"numbering.xml", std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml", L"/word", L"numbering.xml");
}
if(false == m_oFileWriter.m_oFootnotesWriter.IsEmpty())
{
long rId;
m_oFileWriter.m_pDrawingConverter->WriteRels(std::wstring(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes")), std::wstring(_T("footnotes.xml")), std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes", L"footnotes.xml", std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml", L"/word", L"footnotes.xml");
}
if(false == m_oFileWriter.m_oEndnotesWriter.IsEmpty())
{
long rId;
m_oFileWriter.m_pDrawingConverter->WriteRels(std::wstring(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes")), std::wstring(_T("endnotes.xml")), std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes", L"endnotes.xml", std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml", L"/word", L"endnotes.xml");
}
for(size_t i = 0; i < m_oFileWriter.m_oHeaderFooterWriter.m_aHeaders.size(); ++i)
@ -8196,7 +8226,7 @@ public:
if(false == pHeader->IsEmpty())
{
long rId;
m_oFileWriter.m_pDrawingConverter->WriteRels(std::wstring(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/header")), pHeader->m_sFilename, std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", pHeader->m_sFilename, std::wstring(), &rId);
pHeader->rId = L"rId" + std::to_wstring( rId );
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml", L"/word", pHeader->m_sFilename);
@ -8208,7 +8238,7 @@ public:
if(false == pFooter->IsEmpty())
{
long rId;
m_oFileWriter.m_pDrawingConverter->WriteRels(std::wstring(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer")), pFooter->m_sFilename, std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", pFooter->m_sFilename, std::wstring(), &rId);
pFooter->rId = L"rId" + std::to_wstring( rId );
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml", L"/word", pFooter->m_sFilename);
@ -8216,9 +8246,9 @@ public:
}
res = Binary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, m_oFileWriter.m_oDocumentWriter, &oBinary_CommentsTableReader.m_oComments).Read();
OOX::CPath fileRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + _T("word")
+ FILE_SEPARATOR_STR + _T("_rels")
+ FILE_SEPARATOR_STR + _T("document.xml.rels");
OOX::CPath fileRelsPath = m_oFileWriter.m_oDocumentWriter.m_sDir + FILE_SEPARATOR_STR + L"word"
+ FILE_SEPARATOR_STR + L"_rels"
+ FILE_SEPARATOR_STR + L"document.xml.rels";
CComments& oComments= oBinary_CommentsTableReader.m_oComments;
Writers::CommentsWriter& oCommentsWriter = m_oFileWriter.m_oCommentsWriter;
@ -8232,19 +8262,19 @@ public:
if(false == oCommentsWriter.m_sComment.empty())
{
long rId;
m_oFileWriter.m_pDrawingConverter->WriteRels(std::wstring(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments")), std::wstring(_T("comments.xml")), std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments", L"comments.xml", std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml", L"/word", L"comments.xml");
}
if(false == oCommentsWriter.m_sCommentExt.empty())
{
long rId;
m_oFileWriter.m_pDrawingConverter->WriteRels(std::wstring(_T("http://schemas.microsoft.com/office/2011/relationships/commentsExtended")), std::wstring(_T("commentsExtended.xml")), std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.microsoft.com/office/2011/relationships/commentsExtended", L"commentsExtended.xml", std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml", L"/word", L"commentsExtended.xml");
}
if(false == oCommentsWriter.m_sPeople.empty())
{
long rId;
m_oFileWriter.m_pDrawingConverter->WriteRels(std::wstring(_T("http://schemas.microsoft.com/office/2011/relationships/people")), std::wstring(_T("people.xml")), std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.microsoft.com/office/2011/relationships/people", L"people.xml", std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.people+xml", L"/word", L"people.xml");
}

View File

@ -142,19 +142,20 @@ extern int g_nCurFormatVersion;
};}
namespace c_oSerTableTypes{enum c_oSerTableTypes
{
Signature = 0,
Info = 1,
Media = 2,
Numbering = 3,
HdrFtr = 4,
Style = 5,
Document = 6,
Other = 7,
Comments = 8,
Settings = 9,
Footnotes = 10,
Endnotes = 11,
Background
Signature = 0,
Info = 1,
Media = 2,
Numbering = 3,
HdrFtr = 4,
Style = 5,
Document = 6,
Other = 7,
Comments = 8,
Settings = 9,
Footnotes = 10,
Endnotes = 11,
Background = 12,
VbaProject = 13
};}
namespace c_oSerSigTypes{enum c_oSerSigTypes
{
@ -203,10 +204,10 @@ extern int g_nCurFormatVersion;
};}
namespace c_oSerOtherTableTypes{enum c_oSerOtherTableTypes
{
ImageMap = 0,
ImageMap_Src = 1,
EmbeddedFonts = 2,
DocxTheme = 3
ImageMap = 0,
ImageMap_Src = 1,
EmbeddedFonts = 2,
DocxTheme = 3
};}
namespace c_oSerFontsTypes{enum c_oSerFontsTypes
{
@ -521,6 +522,10 @@ extern int g_nCurFormatVersion;
endnoteReference = 27,
arPr = 28
};}
namespace c_oSerVbaProjectTypes{enum c_oSerVbaProjectType
{
Name = 0
};}
namespace c_oSerBackgroundType{enum c_oSerBackgroundType
{
Color = 0,

View File

@ -82,11 +82,11 @@ namespace BinDocxRW
int m_nType;
public:
std::wstring m_sFld;
public: FldStruct(std::wstring sFld, int nType):m_sFld(sFld),m_nType(nType){}
public: int GetType()
{
return m_nType;
}
FldStruct(std::wstring sFld, int nType):m_sFld(sFld),m_nType(nType){}
int GetType()
{
return m_nType;
}
};
class BinaryCommonWriter
{
@ -3027,6 +3027,26 @@ namespace BinDocxRW
}
pOfficeDrawingConverter->SetRels(oldRels);
}
void WriteVbaProjectContent(OOX::VbaProject& oVbaProject)
{
std::wstring file_name = oVbaProject.filename().GetFilename();
m_oBcw.m_oStream.WriteBYTE(c_oSerVbaProjectTypes::Name);
m_oBcw.m_oStream.WriteStringW(file_name);
//... todooo write parsing vba project
//write vbaData.... todooo
//copy file bin
oVbaProject.copy_to(m_oBcw.m_oStream.m_pCommon->m_pImageManager->m_strDstMedia);
}
void WriteVbaProject(OOX::VbaProject& oVbaProject)
{
int nStart = m_oBcw.WriteItemWithLengthStart();
WriteVbaProjectContent(oVbaProject);
m_oBcw.WriteItemWithLengthEnd(nStart);
}
void Write(std::vector<OOX::WritingElement*>& aElems)
{
int nStart = m_oBcw.WriteItemWithLengthStart();
@ -7866,9 +7886,8 @@ namespace BinDocxRW
//Write DocumentTable
ParamsDocumentWriter oParamsDocumentWriter(poDocument);
m_oParamsWriter.m_pCurRels = oParamsDocumentWriter.m_pRels;
//DocumentTable всегда пишем последней, чтобы сначала заполнить все вспомогательные структуры, а при заполении документа, вызывать методы типа Style_Add...
nCurPos = this->WriteTableStart(BinDocxRW::c_oSerTableTypes::Document);
BinDocxRW::BinaryDocumentTableWriter oBinaryDocumentTableWriter(m_oParamsWriter, oParamsDocumentWriter, &m_oParamsWriter.m_mapIgnoreComments, &oBinaryHeaderFooterTableWriter);
oBinaryDocumentTableWriter.prepareOfficeDrawingConverter(m_oParamsWriter.m_pOfficeDrawingConverter, oParamsDocumentWriter.m_pRels, poDocument->m_arrShapeTypes);
@ -7876,7 +7895,15 @@ namespace BinDocxRW
oBinaryDocumentTableWriter.pBackground = poDocument->m_oBackground.GetPointer();
oBinaryDocumentTableWriter.m_bWriteSectPr = true;
//Write Vba
if(NULL != oDocx.m_pVbaProject)
{
nCurPos = this->WriteTableStart(BinDocxRW::c_oSerTableTypes::VbaProject);
oBinaryDocumentTableWriter.WriteVbaProject(*oDocx.m_pVbaProject);
this->WriteTableEnd(nCurPos);
}
// Write content
nCurPos = this->WriteTableStart(BinDocxRW::c_oSerTableTypes::Document);
oBinaryDocumentTableWriter.Write(poDocument->m_arrItems);
this->WriteTableEnd(nCurPos);

View File

@ -292,7 +292,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
if (pApp)
{
pApp->SetApplication(_T("OnlyOffice"));
pApp->SetAppVersion(_T("4.3000"));
pApp->SetAppVersion(_T("5.0"));
pApp->SetDocSecurity(0);
pApp->SetScaleCrop(false);
pApp->SetLinksUpToDate(false);

View File

@ -43,6 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../DesktopEditor/xml/build/vs2005;../../DesktopEditor/xml/libxml2/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_UNICODE;UNICODE"
MinimalRebuild="true"
BasicRuntimeChecks="3"

View File

@ -51,6 +51,7 @@ public:
// $Лист1.$A$1 -> Лист1!$A$1
std::wstring convert_named_ref(std::wstring const & expr, bool withTableName = true, std::wstring separator = L" ");
std::wstring get_table_name();
//a-la convert without check formula
std::wstring convert_named_expr(std::wstring const & expr, bool withTableName = true);
@ -90,7 +91,7 @@ public:
std::wstring convert_named_ref (std::wstring const & expr);
std::wstring convert_named_formula(std::wstring const & expr);
std::wstring get_base_cell_formula(std::wstring const & expr);
std::wstring get_table_name();
//Sheet2!C3:C19 -> Sheet2.C3:Sheet2.C19
std::wstring convert_chart_distance(std::wstring const & expr);

View File

@ -43,7 +43,6 @@ namespace formulasconvert {
class odf2oox_converter::Impl
{
public:
static bool convert_with_TableName;
std::wstring convert(const std::wstring& expr);
std::wstring convert_chart_distance(const std::wstring& expr);
@ -61,8 +60,12 @@ namespace formulasconvert {
void replace_named_ref(std::wstring & expr, bool w = true);
bool find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref);
bool find_first_last_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref_first,std::wstring & ref_last);
static bool convert_with_TableName;
static std::wstring table_name_;
};
bool odf2oox_converter::Impl::convert_with_TableName = true;
bool odf2oox_converter::Impl::convert_with_TableName = true;
std::wstring odf2oox_converter::Impl::table_name_ = L"";
bool odf2oox_converter::Impl::find_first_last_ref(std::wstring const & expr, std::wstring & table,std::wstring & ref_first,std::wstring & ref_last)
{
@ -152,6 +155,8 @@ namespace formulasconvert {
std::wstring sheet1 = what[1].str();
XmlUtils::replace_all( sheet1, L"$", L"");
table_name_ = sheet1;
const std::wstring c1 = what[2].str();
const std::wstring c2 = what[3].str();
@ -180,6 +185,8 @@ namespace formulasconvert {
const std::wstring c2 = what[3].str(); //sheet name 2
const std::wstring c3 = what[4].str();
table_name_ = sheet1;
if (convert_with_TableName)
{
return (sheet1 + L"!") + c1 + (c2.empty() ? L"" : (L":" + c3) );
@ -189,6 +196,14 @@ namespace formulasconvert {
return c1 + (c3.empty() ? L"" : (L":" + c3) );
}
}
else if (sz == 5 && !what[1].matched)
{
const std::wstring c1 = what[2].str();
const std::wstring c2 = what[3].str(); //sheet name 2
const std::wstring c3 = what[4].str();
return c1 + (c3.empty() ? L"" : (L":" + c3) );
}
return L"";
}
std::wstring odf2oox_converter::Impl::replace_named_ref_formater1(boost::wsmatch const & what)
@ -216,10 +231,10 @@ namespace formulasconvert {
void odf2oox_converter::Impl::replace_cells_range(std::wstring& expr, bool withTableName)
{
convert_with_TableName = withTableName;
//boost::wregex simpleRef(L"\\[\\.([a-zA-Z]+\\d+)(?::\\.([a-zA-Z]+\\d+)){0,1}\\]");
boost::wregex complexRef(L"\\[(?:\\$)?([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)(?::\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)){0,1}\\]");
boost::wregex complexRef(L"\\[(?:\$)?([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)(?::(\\${0,1}[^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)){0,1}\\]");
/*
[ $ Sheet2 . A1 : . B5 ]
[ $ Sheet2 . A1 : ( $ Sheet2)? . B5 ]
*/
const std::wstring res = boost::regex_replace(
@ -235,7 +250,7 @@ namespace formulasconvert {
//boost::wregex complexRef(L"\\${0,1}([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)(?::\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)){0,1}");
boost::wregex complexRef(L"\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)(?::\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)){0,1}");
const std::wstring res = boost::regex_replace(
expr,
complexRef,
@ -551,6 +566,11 @@ namespace formulasconvert {
{
}
std::wstring odf2oox_converter::get_table_name()
{
return impl_->table_name_;
}
std::wstring odf2oox_converter::convert(const std::wstring& expr)
{
return impl_->convert(expr);
@ -582,6 +602,13 @@ namespace formulasconvert {
XmlUtils::replace_all( workstr, L"PROBEL" , L" ");
XmlUtils::replace_all( workstr, L"APOSTROF" , L"'");
XmlUtils::replace_all( workstr, L"TOCHKA" , L".");
if (impl_->table_name_.empty() == false)
{
XmlUtils::replace_all( impl_->table_name_, L"PROBEL" , L" ");
XmlUtils::replace_all( impl_->table_name_, L"APOSTROF" , L"'");
XmlUtils::replace_all( impl_->table_name_, L"TOCHKA" , L".");
}
return workstr;
}
std::wstring odf2oox_converter::convert_named_expr(const std::wstring& expr, bool withTableName)
@ -590,34 +617,44 @@ namespace formulasconvert {
bool isFormula = impl_->check_formula(workstr);
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там
workstr = boost::regex_replace(
workstr,
complexRef,
&replace_point_space,
boost::match_default | boost::format_all);
XmlUtils::replace_all( workstr, L"'", L"APOSTROF");
impl_->replace_cells_range(workstr, withTableName);
impl_->replace_semicolons(workstr);
impl_->replace_vertical(workstr);
int res_find=0;
if ((res_find = workstr.find(L"CONCATINATE")) > 0)
if (isFormula)
{
//могут быть частично заданы диапазоны
//todooo
workstr = impl_->convert(expr);
}
XmlUtils::replace_all( workstr, L"PROBEL" , L" ");
XmlUtils::replace_all( workstr, L"APOSTROF" , L"'");
XmlUtils::replace_all( workstr, L"TOCHKA" , L".");
if (!isFormula)
else
{
workstr = L"\"" + workstr + L"\"";
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там
workstr = boost::regex_replace(
workstr,
complexRef,
&replace_point_space,
boost::match_default | boost::format_all);
XmlUtils::replace_all( workstr, L"'", L"APOSTROF");
impl_->replace_cells_range(workstr, withTableName);
impl_->replace_semicolons(workstr);
impl_->replace_vertical(workstr);
int res_find=0;
if ((res_find = workstr.find(L"CONCATINATE")) > 0)
{
//могут быть частично заданы диапазоны
//todooo
}
XmlUtils::replace_all( workstr, L"PROBEL" , L" ");
XmlUtils::replace_all( workstr, L"APOSTROF" , L"'");
XmlUtils::replace_all( workstr, L"TOCHKA" , L".");
if (impl_->table_name_.empty() == false)
{
XmlUtils::replace_all( impl_->table_name_, L"PROBEL" , L" ");
XmlUtils::replace_all( impl_->table_name_, L"APOSTROF" , L"'");
XmlUtils::replace_all( impl_->table_name_, L"TOCHKA" , L".");
}
}
return workstr;
}

View File

@ -65,11 +65,11 @@ public:
static bool isFindBaseCell_;
static std::wstring base_cell_formula_;
static std::wstring table_name_;
};
bool oox2odf_converter::Impl::isFindBaseCell_ = false;
std::wstring oox2odf_converter::Impl::base_cell_formula_ = L"";
std::wstring oox2odf_converter::Impl::table_name_ = L"";
void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr)
{
@ -117,9 +117,9 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmat
{
XmlUtils::replace_all( sheet, L"!", L"");
if (isFindBaseCell_ && base_cell_formula_.empty() && !sheet.empty())
if (isFindBaseCell_ && table_name_.empty() && !sheet.empty())
{
base_cell_formula_ = sheet + L".$A$1";
table_name_ = sheet + L".$A$1";
}
if (!sheet.empty() && (std::wstring::npos != c1.find(L"$"))) sheet = L"$" + sheet;
@ -161,7 +161,7 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater2(boost::wsmat
void oox2odf_converter::Impl::replace_named_formula(std::wstring & expr)
{
base_cell_formula_.clear();
table_name_.clear();
isFindBaseCell_ = true;
expr = convert_formula(expr);
@ -171,7 +171,7 @@ void oox2odf_converter::Impl::replace_named_formula(std::wstring & expr)
// Лист1!$A$1 -> $Лист1.$A$1
void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
{
base_cell_formula_.clear();
table_name_.clear();
isFindBaseCell_ = true;
std::wstring workstr = expr, out;
@ -207,6 +207,15 @@ void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
if (!out.empty()) expr = out.substr(0, out.length() - 1);
isFindBaseCell_ = false;
if (table_name_.empty() == false)
{
XmlUtils::replace_all( table_name_, L"SCOBCAIN", L"(");
XmlUtils::replace_all( table_name_, L"SCOBCAOUT", L")");
XmlUtils::replace_all( table_name_, L"PROBEL", L" ");
XmlUtils::replace_all( table_name_, L"APOSTROF", L"'");
XmlUtils::replace_all( table_name_, L"KAVYCHKA", L"\"");
}
}
@ -471,6 +480,21 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
XmlUtils::replace_all( res, L"PROBEL", L" ");
if (table_name_.empty() == false)
{
XmlUtils::replace_all( table_name_, L"SCOBCAIN", L"(");
XmlUtils::replace_all( table_name_, L"SCOBCAOUT", L")");
XmlUtils::replace_all( table_name_, L"KVADRATIN", L"[");
XmlUtils::replace_all( table_name_, L"KVADRATOUT", L"]");
XmlUtils::replace_all( table_name_, L"APOSTROF", L"'");
XmlUtils::replace_all( table_name_, L"KAVYCHKA", L"\"");
XmlUtils::replace_all( table_name_, L"PROBEL", L" ");
}
return std::wstring(L"of:=") + res;
}
@ -614,9 +638,9 @@ std::wstring oox2odf_converter::convert_named_formula(const std::wstring& expr)
impl_->replace_named_formula(workstr);
return workstr;
}
std::wstring oox2odf_converter::get_base_cell_formula(const std::wstring& expr)
std::wstring oox2odf_converter::get_table_name()
{
return impl_->base_cell_formula_;
return impl_->table_name_;
}

View File

@ -74,6 +74,8 @@ xlsx_document::xlsx_document()
void xlsx_document::write(const std::wstring & RootPath)
{
_CP_LOG << L"[info][xlsx] process writing" << std::endl;
xl_files_.write (RootPath);
docProps_files_.write (RootPath);
rels_files_.write (RootPath);

View File

@ -40,111 +40,70 @@ namespace oox {
class xlsx_pivots_context::Impl
{
public:
struct _pivot_cache
struct _pivot_xml
{
std::wstring definitionsData_;
std::wstring recordsData_;
};
struct _pivot_view
{
std::wstring data_;
int indexCache_;
};
struct _pivot_field
{
std::wstring view_;
std::wstring cache_;
std::wstring definitionsData_; //cacheData
std::wstring recordsData_; //cacheRecorda
std::wstring viewData_; //tableView
};
Impl() {}
std::vector<_pivot_cache> caches_;
std::vector<_pivot_view> views_;
std::vector<_pivot_xml> pivot_xmls_;
std::wstring connections_;
std::vector<_pivot_field> fields_;
std::wstringstream view_;
std::wstringstream cache_;
struct _field
{
std::wstring name;
int type = -1;
int function = -1;
std::wstring user_function;
std::vector<int> subtotals;
std::vector<std::wstring> caches;
};
struct _desc
{
void clear()
{
name.clear();
location_ref.clear();
source_ref.clear();
fields.clear();
row_fields.clear();
page_fields.clear();
col_fields.clear();
data_fields.clear();
}
std::wstring name;
std::wstring location_ref;
std::wstring source_ref;
std::wstring source_table_name;
std::vector<_field> fields;
std::vector<int> row_fields;
std::vector<int> page_fields;
std::vector<int> col_fields;
std::vector<int> data_fields;
}current_;
void serialize_view(std::wostream & strm);
void serialize_cache(std::wostream & strm);
};
xlsx_pivots_context::xlsx_pivots_context() : impl_(new xlsx_pivots_context::Impl())
{
}
void xlsx_pivots_context::add_cache(std::wstring definitions, std::wstring records)
void xlsx_pivots_context::Impl::serialize_view(std::wostream & strm)
{
Impl::_pivot_cache c = {definitions, records};
impl_->caches_.push_back(c);
}
int xlsx_pivots_context::get_cache_count()
{
return (int)impl_->caches_.size();
}
bool xlsx_pivots_context::is_connections()
{
return !impl_->connections_.empty();
}
void xlsx_pivots_context::dump_rels_cache(int index, rels & Rels)
{
if (impl_->caches_[index].recordsData_.empty() == false)
{
Rels.add(relationship(L"rId1",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords",
L"pivotCacheRecords" + std::to_wstring(index + 1) + L".xml", L""));
}
}
void xlsx_pivots_context::dump_rels_view(int index, rels & Rels)
{
if (impl_->views_[index].indexCache_ >= 0)
{
Rels.add(relationship(L"rId1",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",
L"../pivotCache/pivotCacheDefinition" + std::to_wstring(impl_->views_[index].indexCache_ + 1) + L".xml", L""));
}
}
void xlsx_pivots_context::write_cache_definitions_to(int index, std::wostream & strm)
{
strm << impl_->caches_[index].definitionsData_;
}
void xlsx_pivots_context::write_connections_to(std::wostream & strm)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"connections")
{
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/spreadsheetml/2006/main");
CP_XML_STREAM() << impl_->connections_;
}
}
}
void xlsx_pivots_context::write_cache_records_to(int index, std::wostream & strm)
{
strm << impl_->caches_[index].recordsData_;
}
void xlsx_pivots_context::write_table_view_to(int index, std::wostream & strm)
{
strm << impl_->views_[index].data_;
}
void xlsx_pivots_context::start_table()
{
impl_->fields_.clear();
}
int xlsx_pivots_context::end_table()
{
std::wstringstream strm;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"pivotTableDefinition")
{
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/spreadsheetml/2006/main");
//CP_XML_ATTR(L"name", view->stTable.value());
//CP_XML_ATTR(L"cacheId", view->iCache);
CP_XML_ATTR(L"name", current_.name);
CP_XML_ATTR(L"cacheId", pivot_xmls_.size());
//CP_XML_ATTR(L"dataOnRows", view->sxaxis4Data.bRw);
//CP_XML_ATTR(L"applyNumberFormats", view->fAtrNum);
//CP_XML_ATTR(L"applyBorderFormats", view->fAtrBdr);
@ -168,7 +127,7 @@ int xlsx_pivots_context::end_table()
CP_XML_NODE(L"location")
{
//CP_XML_ATTR(L"ref", view->ref.toString());
CP_XML_ATTR(L"ref", current_.location_ref);
//CP_XML_ATTR(L"firstHeaderRow", view->rwFirstHead - view->ref.rowFirst );
//CP_XML_ATTR(L"firstDataRow", view->rwFirstData - view->ref.rowFirst);
//CP_XML_ATTR(L"firstDataCol", view->colFirstData - view->ref.columnFirst);
@ -177,36 +136,307 @@ int xlsx_pivots_context::end_table()
}
CP_XML_NODE(L"pivotFields")
{
CP_XML_ATTR(L"count", impl_->fields_.size());
for (size_t i = 0; i < impl_->fields_.size(); i++)
CP_XML_ATTR(L"count", current_.fields.size());
for (size_t i = 0; i < current_.fields.size(); i++)
{
impl_->fields_[i].view_;
CP_XML_NODE(L"pivotField")
{
switch(current_.fields[i].type)
{
case 0: CP_XML_ATTR(L"axis", L"axisCol"); break;
case 1: break;// data,
case 2: break;// hidden,
case 3: CP_XML_ATTR(L"axis", L"axisPage"); break;
case 4: CP_XML_ATTR(L"axis", L"axisRow"); break;
}
CP_XML_ATTR(L"defaultSubtotal", 0);
//compact="0" outline="0" subtotalTop="0" showAll="0" includeNewItemsInFilter="1" sortType="ascending"
CP_XML_NODE(L"items")
{
CP_XML_ATTR(L"count", current_.fields[i].caches.size());
for (size_t j = 0; j < current_.fields[i].caches.size(); j++)
{
CP_XML_NODE(L"item")
{
CP_XML_ATTR(L"x", j);
}
}
}
}
//CP_XML_STREAM() << fields_[i].view_;
}
}
CP_XML_NODE(L"rowFields")
{
CP_XML_ATTR(L"count", current_.row_fields.size());
for (size_t i = 0; i < current_.row_fields.size(); i++)
{
CP_XML_NODE(L"field")
{
CP_XML_ATTR(L"x", current_.row_fields[i]);
}
}
}
CP_XML_NODE(L"colFields")
{
CP_XML_ATTR(L"count", current_.col_fields.size());
for (size_t i = 0; i < current_.col_fields.size(); i++)
{
CP_XML_NODE(L"field")
{
CP_XML_ATTR(L"x", current_.col_fields[i]);
}
}
}
CP_XML_NODE(L"pageFields")
{
CP_XML_ATTR(L"count", current_.page_fields.size());
for (size_t i = 0; i < current_.page_fields.size(); i++)
{
CP_XML_NODE(L"pageField")
{
CP_XML_ATTR(L"fld", current_.page_fields[i]);
CP_XML_ATTR(L"item", 0);
CP_XML_ATTR(L"hier", -1);
}
}
}
CP_XML_NODE(L"dataFields")
{
CP_XML_ATTR(L"count", current_.data_fields.size());
for (size_t i = 0; i < current_.data_fields.size(); i++)
{
CP_XML_NODE(L"dataField")
{
CP_XML_ATTR(L"fld", current_.data_fields[i]);
CP_XML_ATTR(L"baseField", 0);
//CP_XML_ATTR(L"baseItem", -1);
//CP_XML_ATTR(L"name", L"");
}
}
}
}
}
Impl::_pivot_view v = {strm.str(), impl_->views_.size() + 1};
impl_->views_.push_back(v);
return impl_->views_.size();
}
void xlsx_pivots_context::Impl::serialize_cache(std::wostream & strm)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"pivotCacheDefinition")
{
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/spreadsheetml/2006/main");
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
//{ records file
// CP_XML_ATTR(L"r:id", L"rId1" );
//}
CP_XML_ATTR(L"enableRefresh", 1);
//CP_XML_ATTR(L"refreshedBy", db->rgb.value());
//CP_XML_ATTR(L"refreshedDate", db_ex->numDate.data.value);
CP_XML_ATTR(L"recordCount", 0);
//createdVersion="1"
//refreshedVersion="2"
//upgradeOnRefresh="1">
if (true)
{
CP_XML_NODE(L"cacheSource")
{
CP_XML_ATTR(L"type", L"worksheet");
CP_XML_NODE(L"worksheetSource")
{
CP_XML_ATTR(L"ref", current_.source_ref);
CP_XML_ATTR(L"sheet", current_.source_table_name);
}
}
}
if (current_.fields.empty() == false)
{
CP_XML_NODE(L"cacheFields")
{
CP_XML_ATTR(L"count", current_.fields.size());
for (size_t i = 0; i < current_.fields.size(); i++)
{
CP_XML_NODE(L"cacheField")
{
CP_XML_ATTR(L"name", current_.fields[i].name);
CP_XML_ATTR(L"numFmtId", 0);
if (current_.fields[i].caches.empty() == false)
{
CP_XML_NODE(L"sharedItems")
{
CP_XML_ATTR(L"count", current_.fields[i].caches.size());
//CP_XML_ATTR(L"containsSemiMixedTypes", );
CP_XML_ATTR(L"containsNonDate", 1);
CP_XML_ATTR(L"containsDate", 0);
CP_XML_ATTR(L"containsBlank", 0);
//CP_XML_ATTR(L"containsString", );
for (size_t j = 0; j < current_.fields[i].caches.size(); j++)
{
std::wstring node_name = L"s";
//switch(current_.fields[i].caches[j].type)
//{
//}
CP_XML_NODE(node_name)
{
CP_XML_ATTR(L"v", current_.fields[i].caches[j]);
}
}
}
}
}
}
}
}
//if (pivot_cache->m_arSXFORMULA.empty() == false)
//{
// CP_XML_NODE(L"calculatedItems")
// {
// CP_XML_ATTR(L"count", pivot_cache->m_arSXFORMULA.size());
// for (size_t i = 0; i < pivot_cache->m_arSXFORMULA.size(); i++)
// {
// pivot_cache->m_arSXFORMULA[i]->serialize(CP_XML_STREAM());
// }
// }
//}
}
}
}
int xlsx_pivots_context::get_count()
{
return (int)impl_->pivot_xmls_.size();
}
bool xlsx_pivots_context::is_connections()
{
return !impl_->connections_.empty();
}
void xlsx_pivots_context::dump_rels_cache(int index, rels & Rels)
{
if (impl_->pivot_xmls_[index].recordsData_.empty() == false)
{
Rels.add(relationship(L"rId1",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords",
L"pivotCacheRecords" + std::to_wstring(index + 1) + L".xml", L""));
}
}
void xlsx_pivots_context::dump_rels_view(int index, rels & Rels)
{
Rels.add(relationship(L"rId1",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",
L"../pivotCache/pivotCacheDefinition" + std::to_wstring(index + 1) + L".xml", L""));
}
void xlsx_pivots_context::write_cache_definitions_to(int index, std::wostream & strm)
{
strm << impl_->pivot_xmls_[index].definitionsData_;
}
void xlsx_pivots_context::write_connections_to(std::wostream & strm)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"connections")
{
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/spreadsheetml/2006/main");
CP_XML_STREAM() << impl_->connections_;
}
}
}
void xlsx_pivots_context::write_cache_records_to(int index, std::wostream & strm)
{
strm << impl_->pivot_xmls_[index].recordsData_;
}
void xlsx_pivots_context::write_table_view_to(int index, std::wostream & strm)
{
strm << impl_->pivot_xmls_[index].viewData_;
}
void xlsx_pivots_context::start_table()
{
impl_->current_.clear();
}
int xlsx_pivots_context::end_table()
{
std::wstringstream view_strm;
std::wstringstream cache_strm;
std::wstringstream rec_strm;
impl_->serialize_view(view_strm);
impl_->serialize_cache(cache_strm);
Impl::_pivot_xml v = {cache_strm.str(), rec_strm.str(), view_strm.str()};
impl_->pivot_xmls_.push_back(v);
return impl_->pivot_xmls_.size();
}
void xlsx_pivots_context::set_view_name(std::wstring name)
{
impl_->current_.name = name;
}
void xlsx_pivots_context::set_view_target_range(std::wstring ref)
{
impl_->current_.location_ref = ref;
}
void xlsx_pivots_context::start_field()
{
Impl::_field f;
impl_->current_.fields.push_back(f);
}
void xlsx_pivots_context::set_field_name(std::wstring name)
{
impl_->current_.fields.back().name = name;
}
void xlsx_pivots_context::set_field_type(int type)
{
impl_->current_.fields.back().type = type;
switch(type)
{
case 0: impl_->current_.col_fields.push_back(impl_->current_.fields.size() - 1); break;// column,
case 1: impl_->current_.data_fields.push_back(impl_->current_.fields.size() - 1); break;// data,
case 2: break;// hidden,
case 3: impl_->current_.page_fields.push_back(impl_->current_.fields.size() - 1); break;// page,
case 4: impl_->current_.row_fields.push_back(impl_->current_.fields.size() - 1); break;// row
}
}
void xlsx_pivots_context::set_field_function(int type)
{
impl_->current_.fields.back().function = type;
}
void xlsx_pivots_context::set_field_user_function(std::wstring f)
{
impl_->current_.fields.back().user_function = f;
}
void xlsx_pivots_context::add_field_subtotal(int function_type)
{
impl_->current_.fields.back().subtotals.push_back(function_type);
}
void xlsx_pivots_context::add_field_cache(int index, std::wstring value)
{
while (index > impl_->current_.fields.back().caches.size())
{
impl_->current_.fields.back().caches.push_back(L"");
}
impl_->current_.fields.back().caches.push_back(value);
}
void xlsx_pivots_context::end_field()
{
std::wstringstream strm;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"pivotField")
{
}
}
Impl::_pivot_field f = {strm.str(), L""};
impl_->fields_.push_back(f);
}
void xlsx_pivots_context::set_source_range(std::wstring table_name, std::wstring ref)
{
impl_->current_.source_table_name = table_name;
impl_->current_.source_ref = ref;
}
void xlsx_pivots_context::add_connections(std::wstring connections)
@ -216,25 +446,10 @@ void xlsx_pivots_context::add_connections(std::wstring connections)
impl_->connections_ = connections;
}
int xlsx_pivots_context::get_view_count()
{
return (int)impl_->views_.size();
}
xlsx_pivots_context::~xlsx_pivots_context()
{
}
std::wostream & xlsx_pivots_context::stream_view()
{
return impl_->view_;
}
std::wostream & xlsx_pivots_context::stream_cache()
{
return impl_->cache_;
}
}
}

View File

@ -50,13 +50,20 @@ public:
int end_table();
void start_field();
void set_field_name(std::wstring name);
void set_field_type(int type);
void set_field_function(int type);
void set_field_user_function(std::wstring f);
void add_field_subtotal(int function_type);
void add_field_cache(int index, std::wstring value);
void end_field();
//int add_view(int indexCache);
int get_view_count();
int get_count();
void add_cache(std::wstring definitions, std::wstring records);
int get_cache_count();
void set_view_name(std::wstring name);
void set_view_target_range(std::wstring ref);
void set_source_range(std::wstring table_name, std::wstring ref);
void write_cache_definitions_to (int index, std::wostream & strm);
void write_cache_records_to (int index, std::wostream & strm);
@ -70,9 +77,6 @@ public:
void add_connections(std::wstring connections);
bool is_connections();
std::wostream & stream_view();
std::wostream & stream_cache();
private:
class Impl;
_CP_PTR(Impl) impl_;

View File

@ -160,7 +160,10 @@ void xlsx_table_state::set_table_row_group(int count, bool collapsed, int level)
group_row_.collapsed = collapsed;
group_row_.level = level;
}
void xlsx_table_state::add_empty_row(int count)
{
current_table_row_ += count;
}
void xlsx_table_state::start_row(const std::wstring & StyleName, const std::wstring & defaultCellStyleName)
{
empty_row_ = true;

View File

@ -89,6 +89,8 @@ public:
void non_empty_row ();
bool is_empty_row () const;
void end_row ();
void add_empty_row(int count);
std::wstring current_row_style () const;
std::wstring default_row_cell_style () const;

View File

@ -148,9 +148,9 @@ void xlsx_table_context::start_table(std::wstring tableName, std::wstring tableS
void xlsx_table_context::end_table()
{
xlsx_table_states_.pop_back();
//xlsx_table_states_.pop_back();
}
void xlsx_table_context::start_cell(const std::wstring & formula, size_t columnsSpanned, size_t rowsSpanned)
{
state()->start_cell(columnsSpanned, rowsSpanned);

View File

@ -48,7 +48,6 @@ class xlsx_table_context
public:
xlsx_table_context(xlsx_conversion_context * Context, xlsx_text_context & textCotnext);
public:
void start_table(std::wstring tableName, std::wstring tableStyleName, int id);
void end_table();

View File

@ -232,7 +232,7 @@ void xlsx_conversion_context::end_document()
get_xlsx_defined_names().xlsx_serialize(CP_XML_STREAM());
int pivot_cache_count = xlsx_pivots_context_.get_cache_count();
int pivot_cache_count = xlsx_pivots_context_.get_count();
if (pivot_cache_count > 0)
{
CP_XML_NODE(L"pivotCaches")
@ -259,7 +259,7 @@ void xlsx_conversion_context::end_document()
}
}
}
int pivot_view_count = xlsx_pivots_context_.get_view_count();
int pivot_view_count = xlsx_pivots_context_.get_count();
if (pivot_view_count > 0)
{
for (int i = 0; i < pivot_view_count; i++)
@ -363,17 +363,33 @@ oox_chart_context & xlsx_conversion_context::current_chart()
throw std::runtime_error("internal error");
}
}
xlsx_xml_worksheet & xlsx_conversion_context::current_sheet()
xlsx_xml_worksheet & xlsx_conversion_context::current_sheet(int index)
{
if (!sheets_.empty())
{
return *sheets_.back().get();
if (index < 0) return *sheets_.back().get();
else return *sheets_[index].get();
}
else
{
throw std::runtime_error("internal error");
}
}
int xlsx_conversion_context::find_sheet_by_name(std::wstring tableName)
{
if (tableName.empty()) return -1;
if (0 == tableName.find(L"'"))
{
tableName = tableName.substr(1, tableName.length() - 2);
}
for (size_t i = 0; i < sheets_.size(); i++)
{
if (sheets_[i]->name() == tableName)
return i;
}
return -1;
}
void xlsx_conversion_context::create_new_sheet(std::wstring const & name)
{
sheets_.push_back(xlsx_xml_worksheet::create(name));

View File

@ -102,7 +102,10 @@ public:
bool start_table (std::wstring tableName, std::wstring tableStyleName);
void end_table ();
void start_table_column (unsigned int repeated, const std::wstring & defaultCellStyleName, int & cMin, int & cMax);
int find_sheet_by_name(std::wstring tableName);
xlsx_xml_worksheet & current_sheet(int index = -1);
void start_table_column (unsigned int repeated, const std::wstring & defaultCellStyleName, int & cMin, int & cMax);
void table_column_last_width (double w);
double table_column_last_width ();
void end_table_column ();
@ -162,7 +165,6 @@ public:
xlsx_table_context & get_table_context() { return xlsx_table_context_; }
const xlsx_table_context & get_table_context() const { return xlsx_table_context_; }
xlsx_style_manager & get_style_manager() { return xlsx_style_; }
xlsx_xml_worksheet & current_sheet();
oox_chart_context & current_chart();
math_context & get_math_context() { return math_context_; }

View File

@ -356,7 +356,6 @@ void table_columns_and_groups::add_child_element( xml::sax * Reader, const std::
*/
}
// table-table-cell-content
//////////////////////////////////////////////////////////////////////////////////////////////////
std::wostream & table_table_cell_content::text_to_stream(std::wostream & _Wostream) const
@ -393,9 +392,14 @@ void table_table_cell::add_child_element( xml::sax * Reader, const std::wstring
void table_table_cell::add_text(const std::wstring & Text)
{
}
bool table_table_cell::empty()
{
if (!content_.elements_.empty()) return false;
if (attlist_.table_formula_) return false;
return true;
}
// table:covered-table-cell
// table-covered-table-cell
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * table_covered_table_cell::ns = L"table";
const wchar_t * table_covered_table_cell::name = L"covered-table-cell";
@ -412,13 +416,19 @@ void table_covered_table_cell::add_attributes( const xml::attributes_wc_ptr & At
void table_covered_table_cell::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
empty_ = false;
content_.add_child_element(Reader, Ns, Name, getContext());
}
void table_covered_table_cell::add_text(const std::wstring & Text)
{
}
bool table_covered_table_cell::empty()
{
if (!content_.elements_.empty()) return false;
if (attlist_.table_formula_) return false;
return true;
}
//////////////////////////////////////////////////////////////////////////////////////////////////
// table:table-row
@ -445,7 +455,38 @@ void table_table_row::add_child_element( xml::sax * Reader, const std::wstring &
else
CP_NOT_APPLICABLE_ELM();
}
bool table_table_row::empty()
{
if (content_.empty() && !attlist_.table_style_name_ && !attlist_.table_default_cell_style_name_) return true;
return false;
}
bool table_table_row::empty_content_cells()
{
bool res = true;
for (size_t i = 0 ; i < content_.size(); i++)
{
table_table_cell *cell = dynamic_cast<table_table_cell*>(content_[i].get());
table_covered_table_cell *cover_cell = dynamic_cast<table_covered_table_cell*>(content_[i].get());
if (!cell && !cover_cell)
{
res = false;
break;
}
if (cell && cell->empty() == false)
{
res = false;
break;
}
if (cover_cell && cover_cell->empty() == false)
{
res = false;
break;
}
}
return res;
}
// table:table-rows
//////////////////////////////////////////////////////////////////////////////////////////////////
const wchar_t * table_table_rows::ns = L"table";

View File

@ -361,6 +361,9 @@ private:
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
public:
bool empty();
bool empty_content_cells();
table_table_row_attlist attlist_;
office_element_ptr_array content_; // table-table-cell or table-covered-table-cell
@ -408,6 +411,7 @@ private:
public:
bool last_cell_;
bool empty();
table_table_cell_attlist attlist_;
table_table_cell_attlist_extra attlist_extra_;
@ -427,7 +431,7 @@ public:
CPDOCCORE_DEFINE_VISITABLE();
table_covered_table_cell() : last_cell_(false), empty_(true) {}
table_covered_table_cell() : last_cell_(false){}
virtual void docx_convert(oox::docx_conversion_context & Context) ;
virtual void pptx_convert(oox::pptx_conversion_context & Context) ;
@ -443,7 +447,7 @@ private:
public:
bool last_cell_;
bool empty_;
bool empty();
table_table_cell_attlist attlist_;
table_table_cell_content content_;

View File

@ -31,6 +31,7 @@
*/
#include "table_data_pilot_tables.h"
#include "../formulasconvert/formulasconvert.h"
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
@ -53,6 +54,7 @@ void table_data_pilot_tables::add_child_element( xml::sax * Reader, const std::w
}
void table_data_pilot_tables::xlsx_convert(oox::xlsx_conversion_context & Context)
{
return;
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
@ -72,7 +74,7 @@ void table_data_pilot_table::add_attributes( const xml::attributes_wc_ptr & Attr
CP_APPLY_ATTR(L"table:identify-categories" , table_identify_categories_);
CP_APPLY_ATTR(L"table:ignore-empty-rows" , table_ignore_empty_rows_);
CP_APPLY_ATTR(L"table:show-filter-button" , table_show_filter_button_);
CP_APPLY_ATTR(L"table:show-target-range-address", table_show_target_range_address_);
CP_APPLY_ATTR(L"table:target-range-address" , table_target_range_address_);
}
@ -88,10 +90,26 @@ void table_data_pilot_table::xlsx_convert(oox::xlsx_conversion_context & Context
{
if (!source_) return;
int table_index = -1;
Context.get_pivots_context().start_table();
source_->xlsx_convert(Context);
if (table_name_) Context.get_pivots_context().set_view_name(*table_name_);
if (table_target_range_address_)
{
formulasconvert::odf2oox_converter formulas_converter;
std::wstring ref = formulas_converter.convert_named_ref(*table_target_range_address_, false);
std::wstring table_name = formulas_converter.get_table_name();
table_index = Context.find_sheet_by_name(table_name);
Context.get_pivots_context().set_view_target_range(ref);
//Context.get_pivots_context().set_view_target_table(table_index);
}
for (size_t i = 0; i < fields_.size(); i++)
{
fields_[i]->xlsx_convert(Context);
@ -101,7 +119,7 @@ void table_data_pilot_table::xlsx_convert(oox::xlsx_conversion_context & Context
if (index_view > 0)
{
Context.current_sheet().sheet_rels().add(oox::relationship(L"pvId" + std::to_wstring(index_view),
Context.current_sheet(table_index).sheet_rels().add(oox::relationship(L"pvId" + std::to_wstring(index_view),
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",
L"../pivotTables/pivotTable" + std::to_wstring(index_view) + L".xml"));
}
@ -123,16 +141,37 @@ void table_data_pilot_field::add_attributes( const xml::attributes_wc_ptr & Attr
void table_data_pilot_field::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT (content_);
if (L"table" == Ns && L"data-pilot-field-reference" == Name)
CP_CREATE_ELEMENT (reference_);
else if (L"table" == Ns && L"data-pilot-level" == Name)
CP_CREATE_ELEMENT (level_);
else if (L"table" == Ns && L"data-pilot-groups" == Name)
CP_CREATE_ELEMENT (groups_);
}
void table_data_pilot_field::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.get_pivots_context().start_field();
Context.get_pivots_context().set_field_name(table_source_field_name_.get_value_or(L""));
Context.get_pivots_context().set_field_type(table_orientation_.get_value_or(table_orientation::hidden).get_type());
for (size_t i = 0; i < content_.size(); i++)
if (table_function_)
{
content_[i]->xlsx_convert(Context);
}
table_function::type type = table_function_->get_type();
if (type == table_function::String)
{
Context.get_pivots_context().set_field_user_function(table_function_->get_string());
}
else
{
Context.get_pivots_context().set_field_function(type);
}
}
if (reference_) reference_->xlsx_convert(Context);
if (groups_) groups_->xlsx_convert(Context);
if (level_) level_->xlsx_convert(Context);
Context.get_pivots_context().end_field();
}
@ -202,7 +241,7 @@ const wchar_t * table_source_cell_range::name = L"source-cell-range";
void table_source_cell_range::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:cellrange-address", table_cellrange_address_);
CP_APPLY_ATTR(L"table:cell-range-address", table_cell_range_address_);
}
void table_source_cell_range::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
@ -211,9 +250,14 @@ void table_source_cell_range::add_child_element( xml::sax * Reader, const std::w
}
void table_source_cell_range::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
if (table_cell_range_address_)
{
formulasconvert::odf2oox_converter formulas_converter;
std::wstring ref = formulas_converter.convert_named_ref(*table_cell_range_address_, false);
std::wstring table_name = formulas_converter.get_table_name();
Context.get_pivots_context().set_source_range(table_name, ref);
}
}
//-------------------------------------------------------------------------------------------------
@ -242,15 +286,36 @@ void table_data_pilot_level::add_attributes( const xml::attributes_wc_ptr & Attr
}
void table_data_pilot_level::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT (content_);
if (L"table" == Ns && L"data-pilot-members" == Name)
CP_CREATE_ELEMENT (members_);
else if (L"table" == Ns && L"data-pilot-subtotals" == Name)
CP_CREATE_ELEMENT (subtotals_);
else if (L"table" == Ns && L"data-pilot-display-info" == Name)
CP_CREATE_ELEMENT ( display_info_);
else if (L"table" == Ns && L"data-pilot-layout-info" == Name)
CP_CREATE_ELEMENT ( layout_info_);
else if (L"table" == Ns && L"data-pilot-sort-info" == Name)
CP_CREATE_ELEMENT (sort_info_);
}
void table_data_pilot_level::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
table_data_pilot_members* members = dynamic_cast<table_data_pilot_members*>(members_.get());
table_data_pilot_subtotals* subtotals = dynamic_cast<table_data_pilot_subtotals*>(subtotals_.get());
for (size_t i = 0; members && i < members->content_.size(); i++)
{
table_data_pilot_member* member = dynamic_cast<table_data_pilot_member*>(members->content_[i].get());
if (member)
Context.get_pivots_context().add_field_cache(i, member->table_name_.get_value_or(L""));
}
for (size_t i = 0; subtotals && i < subtotals->content_.size(); i++)
{
table_data_pilot_subtotal* subtotal = dynamic_cast<table_data_pilot_subtotal*>(subtotals->content_[i].get());
if (subtotal)
{
Context.get_pivots_context().add_field_subtotal(subtotal->table_function_.get_value_or(table_function::Auto).get_type());
}
}
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_data_pilot_groups::ns = L"table";

View File

@ -65,8 +65,8 @@ 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);
office_element_ptr_array content_;
public:
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_tables);
@ -87,7 +87,9 @@ 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);
public:
_CP_OPT(std::wstring) table_name_;
_CP_OPT(std::wstring) table_target_range_address_;
_CP_OPT(std::wstring) table_application_data_;
_CP_OPT(std::wstring) table_buttons_;
_CP_OPT(odf_types::Bool) table_drill_down_ondouble_click_;
@ -95,7 +97,6 @@ private:
_CP_OPT(odf_types::Bool) table_identify_categories_;
_CP_OPT(odf_types::Bool) table_ignore_empty_rows_;
_CP_OPT(odf_types::Bool) table_show_filter_button_;
_CP_OPT(odf_types::Bool) table_show_target_range_address_;
office_element_ptr source_;
office_element_ptr_array fields_;
@ -119,6 +120,7 @@ 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);
public:
_CP_OPT(std::wstring) table_source_field_name_;
_CP_OPT(odf_types::table_orientation) table_orientation_;
_CP_OPT(int) table_used_hierarchy_;
@ -127,7 +129,9 @@ private:
_CP_OPT(std::wstring) table_selected_page_;
_CP_OPT(odf_types::Bool) table_is_data_layout_field_;
office_element_ptr_array content_;
office_element_ptr reference_;
office_element_ptr level_;
office_element_ptr groups_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_field);
@ -147,6 +151,7 @@ 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){}
public:
_CP_OPT(std::wstring) table_field_name_;
_CP_OPT(std::wstring) table_member_name_;
_CP_OPT(odf_types::member_type) table_member_type_;
@ -171,6 +176,7 @@ 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){}
public:
_CP_OPT(std::wstring) table_database_name_;
_CP_OPT(std::wstring) table_database_table_name_;
};
@ -193,6 +199,7 @@ 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){}
public:
_CP_OPT(std::wstring) table_database_name_;
_CP_OPT(std::wstring) table_query_name_;
};
@ -215,6 +222,7 @@ 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){}
public:
_CP_OPT(std::wstring) table_database_name_;
_CP_OPT(odf_types::Bool)table_parse_sql_statement_;
_CP_OPT(std::wstring) table_sql_statement_;
@ -238,8 +246,9 @@ 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_OPT(std::wstring) table_cellrange_address_;
office_element_ptr_array content_;
public:
_CP_OPT(std::wstring) table_cell_range_address_;
office_element_ptr_array content_; //filters
};
CP_REGISTER_OFFICE_ELEMENT2(table_source_cell_range);
@ -260,6 +269,7 @@ 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){}
public:
_CP_OPT(std::wstring) table_name_;
_CP_OPT(std::wstring) table_object_name_;
_CP_OPT(std::wstring) table_password_;
@ -285,8 +295,14 @@ 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);
public:
_CP_OPT(odf_types::Bool) table_show_empty_;
office_element_ptr_array content_;
office_element_ptr members_;
office_element_ptr subtotals_;
office_element_ptr display_info_;
office_element_ptr layout_info_;
office_element_ptr sort_info_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_level);
//-------------------------------------------------------------------------------------
@ -306,6 +322,7 @@ 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);
public:
_CP_OPT(std::wstring) table_date_end_;
_CP_OPT(std::wstring) table_date_start_;
_CP_OPT(std::wstring) table_start; //double 18.2 or auto.
@ -334,6 +351,7 @@ 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);
public:
_CP_OPT(std::wstring) table_name_;
office_element_ptr_array content_;
};
@ -356,7 +374,8 @@ 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);
office_element_ptr_array content_;
public:
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_members);
@ -377,8 +396,9 @@ 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_OPT(odf_types::Bool) table_display_;
public:
_CP_OPT(std::wstring) table_name_;
_CP_OPT(odf_types::Bool) table_display_;
_CP_OPT(odf_types::Bool) table_show_details_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_member);
@ -399,6 +419,7 @@ 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){}
public:
_CP_OPT(std::wstring) table_name_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_group_member);
@ -419,6 +440,7 @@ 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);
public:
office_element_ptr_array content_;
};
@ -440,6 +462,7 @@ 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){}
public:
_CP_OPT(odf_types::table_function) table_function_;
};
@ -461,6 +484,7 @@ 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){}
public:
_CP_OPT(odf_types::Bool) table_add_empty_lines_;
_CP_OPT(std::wstring) table_layout_mode_; //tabular-layout, outlinesubtotals-top or outline-subtotals-bottom.
};
@ -482,6 +506,7 @@ 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){}
public:
_CP_OPT(std::wstring) table_data_field_;
_CP_OPT(odf_types::table_order) table_order_;
_CP_OPT(std::wstring) table_sort_mode_; //data, none, manual or name.
@ -504,6 +529,7 @@ 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){}
public:
_CP_OPT(std::wstring) table_data_field_;
_CP_OPT(std::wstring) table_display_member_mode_; //from-top or from-bottom.
_CP_OPT(odf_types::Bool) table_enabled_;
@ -512,6 +538,5 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_display_info);
//-------------------------------------------------------------------------------------
}
}

View File

@ -78,6 +78,17 @@ int table_table_cell_content::xlsx_convert(oox::xlsx_conversion_context & Contex
void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
{
if (attlist_.table_number_rows_repeated_ > 1 && empty())
{
Context.get_table_context().state()->add_empty_row(attlist_.table_number_rows_repeated_);
return;
}
if (attlist_.table_number_rows_repeated_ > 0xf000 && empty_content_cells())
{
Context.get_table_context().state()->add_empty_row(attlist_.table_number_rows_repeated_);
return; //conv_hSX8n3lVbhALjt0aafg__xlsx.ods, conv_MA2CauoNfX_7ejKS5eg__xlsx.ods
}
std::wostream & strm = Context.current_sheet().sheetData();
///обработка чтилей для роу -
size_t Default_Cell_style_in_row_ = 0;
@ -259,20 +270,22 @@ void table_rows::xlsx_convert(oox::xlsx_conversion_context & Context)
table_table_row* row_last = dynamic_cast<table_table_row*>(table_table_row_[table_table_row_.size() - 1].get());
table_table_row* row_last_1 = dynamic_cast<table_table_row*>(table_table_row_[table_table_row_.size() - 2].get());
if (row_last->attlist_.table_number_rows_repeated_ > 1000 &&
row_last_1->attlist_.table_number_rows_repeated_ > 1000 ||
row_last_1->attlist_.table_number_rows_repeated_ > 0xf000)
if (row_last->empty_content_cells() && row_last_1->empty_content_cells())
{
std::wstring style = row_last->attlist_.table_style_name_.get_value_or(L"");
std::wstring style_1 = row_last->attlist_.table_style_name_.get_value_or(L"");
if (style == style_1)//check for empty also ????
if (row_last->attlist_.table_number_rows_repeated_ > 1000 &&
row_last_1->attlist_.table_number_rows_repeated_ > 1000 ||
row_last_1->attlist_.table_number_rows_repeated_ > 0xf000)
{
row_last_1->attlist_.table_number_rows_repeated_ = 1024;
table_table_row_.pop_back();
std::wstring style = row_last->attlist_.table_style_name_.get_value_or(L"");
std::wstring style_1 = row_last->attlist_.table_style_name_.get_value_or(L"");
if (style == style_1)//check for empty also ????
{
row_last_1->attlist_.table_number_rows_repeated_ = 1024;
table_table_row_.pop_back();
}
}
}
}
for (size_t i = 0; i < table_table_row_.size(); i++)
{

View File

@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;&quot;../../DesktopEditor/freetype-2.5.2/include&quot;"
AdditionalIncludeDirectories="../include;&quot;../../DesktopEditor/freetype-2.5.2/include&quot;;../../DesktopEditor/xml/libxml2/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"

View File

@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
AdditionalIncludeDirectories="../../DesktopEditor/xml/libxml2/include;../../DesktopEditor/xml/build/vs2005"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="8,00"
Name="OdfFileWriterTest"
ProjectGUID="{FBA8446A-150F-4A10-B4DA-1022048D6473}"
RootNamespace="ASCOfficeOdfFileWTest"
@ -43,6 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../DesktopEditor/xml/libxml2/include;../../DesktopEditor/xml/build/vs2005"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;__WORDSIZE=32;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"

View File

@ -32,8 +32,6 @@
#include "abstract_xml.h"
#include <boost/foreach.hpp>
namespace cpdoccore {
namespace odf_writer {

View File

@ -31,8 +31,6 @@
*/
#include "calcext_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
@ -86,9 +84,9 @@ void calcext_conditional_formats::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & item, content_)
for (size_t i = 0; i < content_.size(); i++)
{
item->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -115,9 +113,9 @@ void calcext_conditional_format::serialize(std::wostream & _Wostream)
{
CP_XML_ATTR_OPT(L"calcext:target-range-address",calcext_target_range_address_);
BOOST_REVERSE_FOREACH(const office_element_ptr & item, content_)
for (size_t i = content_.size() - 1; i >= 0; i--)
{
item->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -144,9 +142,9 @@ void calcext_data_bar::serialize(std::wostream & _Wostream)
{
calcext_data_bar_attr_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & item, content_)
for (size_t i = 0; i < content_.size(); i++)
{
item->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -170,9 +168,9 @@ void calcext_color_scale::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & item, content_)
for (size_t i = 0; i < content_.size(); i++)
{
item->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -198,9 +196,9 @@ void calcext_icon_set::serialize(std::wostream & _Wostream)
{
calcext_icon_set_attr_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & item, content_)
for (size_t i = 0; i < content_.size(); i++)
{
item->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -36,7 +36,6 @@
#include <sstream>
#include <string>
#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <cpdoccore/xml/xmlchar.h>
@ -68,11 +67,11 @@ void draw_base::add_child_element( const office_element_ptr & child_element)
{
content_.push_back(child_element);
}
void draw_base::serialize(std::wostream & _Wostream)
void draw_base::serialize(std::wostream & strm)
{
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(_Wostream);
content_[i]->serialize(strm);
}
}
void draw_base::serialize_attlist(CP_ATTR_NODE)

View File

@ -36,7 +36,6 @@
#include <sstream>
#include <string>
#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/regex.h>
@ -88,9 +87,9 @@ void draw_image::serialize(std::wostream & _Wostream)
if (office_binary_data_)office_binary_data_->serialize(CP_XML_STREAM());
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -136,9 +135,9 @@ void draw_chart::serialize(std::wostream & _Wostream)
draw_chart_attlist_.serialize(CP_GET_XML_NODE());
common_xlink_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -167,9 +166,9 @@ void draw_g::serialize(std::wostream & _Wostream)
{
common_draw_attlists_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -430,16 +430,15 @@ void draw_enhanced_geometry::serialize(std::wostream & _Wostream)
CP_XML_ATTR_OPT(L"svg:viewBox", svg_viewbox_);
draw_enhanced_geometry_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(office_element_ptr & elm, draw_equation_)
for (size_t i = 0; i < draw_equation_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
draw_equation_[i]->serialize(CP_XML_STREAM());
}
BOOST_FOREACH(office_element_ptr & elm, draw_handle_)
for (size_t i = 0; i < draw_handle_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
draw_handle_[i]->serialize(CP_XML_STREAM());
}
}
}
}

View File

@ -32,8 +32,6 @@
#include "list.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
@ -80,9 +78,9 @@ void text_list_item::serialize(std::wostream & _Wostream)
{
if (text_number_)text_number_->serialize(CP_XML_STREAM());
BOOST_FOREACH(const office_element_ptr & parElement, content_)
for (size_t i = 0; i < content_.size(); i++)
{
parElement->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -129,9 +127,9 @@ void text_list_header::serialize(std::wostream & _Wostream)
{
if (text_number_)text_number_->serialize(CP_XML_STREAM());
BOOST_FOREACH(const office_element_ptr & parElement, content_)
for (size_t i = 0; i < content_.size(); i++)
{
parElement->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -34,7 +34,6 @@
#include "odf_rels.h"
#include <boost/regex.h>
#include <boost/foreach.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <cpdoccore/xml/utils.h>
@ -85,11 +84,11 @@ void _mediaitems::add_or_find(const std::wstring & oox_ref, Type type, std::wst
std::wstring output_path ;
BOOST_FOREACH(item const & elm, items_)
for (size_t i = 0; i < items_.size(); i++)
{
if (elm.oox_ref == input_path)
if (items_[i].oox_ref == input_path)
{
output_path = elm.odf_ref;
output_path = items_[i].odf_ref;
break;
}
}
@ -110,12 +109,11 @@ void _mediaitems::add_or_find(const std::wstring & oox_ref, Type type, std::wst
}
void _mediaitems::dump_rels(rels & Rels, std::wstring local_path)
{
size_t i = 0;
BOOST_FOREACH(item & elm, items_)
for (size_t i = 0; i < items_.size(); i++)
{
Rels.add( relationship(
utils::media::get_rel_type(elm.type),
local_path + elm.odf_ref)
Rels.add( relationship(
utils::media::get_rel_type(items_[i].type),
local_path + items_[i].odf_ref)
);
}

View File

@ -33,7 +33,6 @@
#include "mediaitems_utils.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
namespace cpdoccore {

View File

@ -30,9 +30,6 @@
*
*/
#include <boost/foreach.hpp>
#include <cpdoccore/xml/simple_xml_writer.h>
#include <cpdoccore/xml/xmlchar.h>
@ -67,13 +64,13 @@ void number_style_base::serialize(std::wostream & strm)
if (style_text_properties_)
style_text_properties_->serialize(strm);
BOOST_FOREACH(office_element_ptr & elm, style_map_)
{
elm->serialize(strm);
for (size_t i = 0; i < style_map_.size(); i++)
{
style_map_[i]->serialize(strm);
}
BOOST_FOREACH(office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(strm);
content_[i]->serialize(strm);
}
}
void number_style_base::serialize(CP_ATTR_NODE)
@ -166,9 +163,9 @@ void number_text::serialize(std::wostream & strm)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(office_element_ptr & elm, text_)
{
elm->serialize(CP_XML_STREAM());
for (size_t i = 0; i < text_.size(); i++)
{
text_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -194,10 +191,10 @@ void number_embedded_text::serialize(std::wostream & strm)
{
CP_XML_ATTR_OPT(L"number:position", number_position_);
BOOST_FOREACH(office_element_ptr & elm, text_)
{
elm->serialize(CP_XML_STREAM());
}
for (size_t i = 0; i < text_.size(); i++)
{
text_[i]->serialize(CP_XML_STREAM());
}
}
}
}
@ -228,10 +225,10 @@ void number_number::serialize(std::wostream & strm)
CP_XML_ATTR_OPT(L"number:min-integer-digits", number_min_integer_digits_);
CP_XML_ATTR_OPT(L"number:grouping", number_grouping_);
BOOST_FOREACH(office_element_ptr & elm, number_embedded_text_)
{
elm->serialize(CP_XML_STREAM());
for (size_t i = 0; i < number_embedded_text_.size(); i++)
{
number_embedded_text_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -336,9 +333,9 @@ void number_text_content::serialize(std::wostream & strm)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(office_element_ptr & elm, text_)
{
elm->serialize(CP_XML_STREAM());
for (size_t i = 0; i < text_.size(); i++)
{
text_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -30,8 +30,6 @@
*
*/
#include <boost/foreach.hpp>
#include <cpdoccore/utf8cpp/utf8.h>
#include <cpdoccore/xml/simple_xml_writer.h>
@ -92,9 +90,10 @@ namespace odf_writer
///////////////
void manifect_file::add_rels(rels & r)
{
BOOST_FOREACH(relationship & item, r.relationships())
std::vector<relationship> & rels = r.relationships();
for (size_t i = 0; i < rels.size(); i++)
{
rels_.add(item);
rels_.add(rels[i]);
}
}
manifect_file::manifect_file(std::wstring t)
@ -188,13 +187,14 @@ namespace odf_writer
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"Media";
NSDirectory::CreateDirectory(path);
BOOST_FOREACH( _mediaitems::item & item, mediaitems_.items() )
std::vector< _mediaitems::item > & items = mediaitems_.items();
for (size_t i = 0; i < items.size(); i++)
{
if (item.type == _mediaitems::typeMedia)
if (items[i].type == _mediaitems::typeMedia)
{
std::wstring file_name_out = RootPath + FILE_SEPARATOR_STR + item.odf_ref;
std::wstring file_name_out = RootPath + FILE_SEPARATOR_STR + items[i].odf_ref;
NSFile::CFileBinary::Copy(item.oox_ref, file_name_out);
NSFile::CFileBinary::Copy(items[i].oox_ref, file_name_out);
}
}
@ -212,15 +212,16 @@ namespace odf_writer
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"Pictures";
NSDirectory::CreateDirectory(path);
BOOST_FOREACH( _mediaitems::item & item, mediaitems_.items() )
std::vector< _mediaitems::item > & items = mediaitems_.items();
for (size_t i = 0; i < items.size(); i++)
{
if (item.type == _mediaitems::typeImage && item.oox_ref.length()>0)
if (items[i].type == _mediaitems::typeImage && items[i].oox_ref.length()>0)
{
std::wstring file_name_out = RootPath + FILE_SEPARATOR_STR + item.odf_ref;
std::wstring file_name_out = RootPath + FILE_SEPARATOR_STR + items[i].odf_ref;
try
{
NSFile::CFileBinary::Copy(item.oox_ref, file_name_out);
NSFile::CFileBinary::Copy(items[i].oox_ref, file_name_out);
}catch (...)
{
}
@ -289,13 +290,12 @@ namespace odf_writer
{
if (base_)base_->write(RootPath);
long count = 0;
BOOST_FOREACH(const element_ptr & item, objects_)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + item->local_path;
for (size_t i = 0; i < objects_.size(); i++)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + objects_[i]->local_path;
NSDirectory::CreateDirectory(path);
item->write(path);
objects_[i]->write(path);
}
if (manifest_) manifest_->write(RootPath);
if (mimetype_) mimetype_->write(RootPath);

View File

@ -32,7 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include "../../../ASCOfficeOdfFile/formulasconvert/formulasconvert.h"

View File

@ -32,7 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <iostream>

View File

@ -30,8 +30,6 @@
*
*/
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include "office_spreadsheet.h"
@ -134,16 +132,15 @@ void odf_conversion_context::end_document()
objects_.back().scripts->serialize(content_root_->styles());
object.content->serialize(content_root_->content());
BOOST_FOREACH(const office_element_ptr & elm, object.content_styles)
for (size_t i = 0; i < object.content_styles.size(); i++)
{
elm->serialize(content_root_->styles());
object.content_styles[i]->serialize(content_root_->styles());
}
package::content_simple_ptr content_style_ = package::content_simple::create();
BOOST_FOREACH(const office_element_ptr & elm, object.styles)
for (size_t i = 0; i < object.styles.size(); i++)
{// мастер-пейджы, заданные заливки (градиенты, битмапы), дефолтные стили, колонтитулы, разметки, заметки,...
elm->serialize(content_style_->content());
object.styles[i]->serialize(content_style_->content());
}
package::content_simple_ptr content_settings_ = package::content_simple::create();
object.settings->serialize(content_settings_->content());

View File

@ -32,7 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>

View File

@ -32,7 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <iostream>

View File

@ -32,7 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <iostream>
#include "odf_page_layout_context.h"

View File

@ -30,9 +30,6 @@
*
*/
#include <boost/foreach.hpp>
#include "odf_rels.h"
#include <cpdoccore/xml/attributes.h>
@ -54,11 +51,11 @@ void relationship::serialize(std::wostream & _Wostream)
}
}
void rels::serialize(std::wostream & _Wostream)
void rels::serialize(std::wostream & strm)
{
BOOST_FOREACH(relationship & r, relationship_)
for (size_t i = 0; i < relationship_.size(); i++)
{
r.serialize(_Wostream);
relationship_[i].serialize(strm);
}
}

View File

@ -40,7 +40,6 @@
#include "style_paragraph_properties.h"
#include <boost/foreach.hpp>
#include <iostream>
namespace cpdoccore {
@ -56,10 +55,10 @@ void calc_paragraph_properties_content(std::vector<style_paragraph_properties*>
{
if (result == NULL)return;
BOOST_REVERSE_FOREACH(style_paragraph_properties* v, parProps)
for (size_t i = parProps.size() - 1; i >= 0; i--)
{
if (v)
result->apply_from(v->content_);
if (parProps[i])
result->apply_from(parProps[i]->content_);
}
}
@ -93,7 +92,7 @@ void odf_style_context::create_style(std::wstring oox_name, style_family::type f
{
std::wstring odf_name = oox_name;
if (odf_name.length() <1)odf_name = find_free_name(family);
if (odf_name.empty()) odf_name = find_free_name(family);
office_element_ptr elm;
create_element(L"style", L"style", elm, odf_context_);

View File

@ -32,8 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <iostream>
#include "odf_conversion_context.h"

View File

@ -32,7 +32,6 @@
#include "logging.h"
#include <boost/foreach.hpp>
#include <boost/regex.hpp>
#include <iostream>

View File

@ -37,7 +37,6 @@
#include "ods_conversion_context.h"
#include "logging.h"
#include <boost/foreach.hpp>
#include <iostream>
#include "../../../ASCOfficeOdfFile/formulasconvert/formulasconvert.h"
@ -139,7 +138,7 @@ void ods_table_context::add_defined_range(const std::wstring & name, const std::
XmlUtils::replace_all( odf_range, L"[", L"");
XmlUtils::replace_all( odf_range, L"]", L"");
std::wstring odf_base_cell = formulas_converter.get_base_cell_formula(cell_range);
std::wstring odf_base_cell = formulas_converter.get_table_name() + L".$A$1";
named_range->table_name_ = name;
named_range->table_cell_range_address_ = odf_range;
@ -183,7 +182,7 @@ void ods_table_context::add_defined_expression(const std::wstring & name, const
formulasconvert::oox2odf_converter formulas_converter;
std::wstring odf_value = formulas_converter.convert_named_formula(value);
std::wstring odf_base_cell = formulas_converter.get_base_cell_formula(value);
std::wstring odf_base_cell = formulas_converter.get_table_name() + L".$A$1";
named_expression->table_name_ = name;
named_expression->table_expression_ = odf_value;

View File

@ -32,8 +32,6 @@
#include "office_annotation.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
@ -159,9 +157,9 @@ void office_annotation::serialize(std::wostream & _Wostream)
if (dc_creator_)dc_creator_->serialize(CP_XML_STREAM());
if (dc_date_) dc_date_->serialize(CP_XML_STREAM());
BOOST_FOREACH(const office_element_ptr & item, content_)
for (size_t i = 0; i < content_.size(); i++)
{
item->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -210,9 +208,9 @@ void officeooo_annotation::serialize(std::wostream & _Wostream)
if (dc_creator_)dc_creator_->serialize(CP_XML_STREAM());
if (dc_date_) dc_date_->serialize(CP_XML_STREAM());
BOOST_FOREACH(const office_element_ptr & item, content_)
for (size_t i = 0; i < content_.size(); i++)
{
item->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -32,8 +32,6 @@
#include "office_body.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>

View File

@ -33,10 +33,7 @@
#include "office_chart.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
namespace cpdoccore {
@ -61,9 +58,9 @@ void office_chart::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -101,9 +98,9 @@ void chart_chart::serialize(std::wostream & _Wostream)
{
chart_chart_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -271,9 +268,9 @@ void chart_plot_area::serialize(std::wostream & _Wostream)
{
chart_plot_area_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -349,9 +346,9 @@ void chart_axis::serialize(std::wostream & _Wostream)
{
chart_axis_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -427,9 +424,9 @@ void chart_series::serialize(std::wostream & _Wostream)
{
chart_series_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -32,8 +32,6 @@
#include "office_settings.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
@ -56,9 +54,9 @@ void office_settings::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -88,9 +86,9 @@ void settings_config_item_set::serialize(std::wostream & _Wostream)
{
CP_XML_ATTR( L"config:name", config_name_);
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -145,9 +143,9 @@ void settings_config_item_map_indexed::serialize(std::wostream & _Wostream)
{
CP_XML_ATTR_OPT( L"config:name", config_name_);
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -174,9 +172,9 @@ void settings_config_item_map_named::serialize(std::wostream & _Wostream)
{
CP_XML_ATTR_OPT( L"config:name", config_name_);
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -203,9 +201,9 @@ void settings_config_item_map_entry::serialize(std::wostream & _Wostream)
{
CP_XML_ATTR_OPT( L"config:name", config_name_);
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -32,8 +32,6 @@
#include "office_spreadsheet.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
@ -63,9 +61,9 @@ void office_spreadsheet::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -32,10 +32,7 @@
#include "office_text.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
namespace cpdoccore {

View File

@ -35,7 +35,6 @@
#include <ostream>
#include <string>
#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <cpdoccore/xml/xmlchar.h>
@ -250,9 +249,9 @@ void text_span::serialize(std::wostream & _Wostream)
{
CP_XML_ATTR_OPT(L"text:style-name", text_style_name_);
BOOST_FOREACH(const office_element_ptr & parElement, paragraph_content_)
for (size_t i = 0; i < paragraph_content_.size(); i++)
{
if (parElement) parElement->serialize(CP_XML_STREAM());
paragraph_content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -547,9 +546,9 @@ void text_placeholder::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -585,12 +584,12 @@ void text_page_number::serialize(std::wostream & _Wostream)
common_num_format_attlist_.serialize(CP_GET_XML_NODE());
common_field_fixed_attlist_.serialize(CP_GET_XML_NODE());
CP_XML_ATTR_OPT(L"text:page-adjust",text_page_adjust_);
CP_XML_ATTR_OPT(L"text:select-page",text_select_page_);
CP_XML_ATTR_OPT(L"text:page-adjust", text_page_adjust_);
CP_XML_ATTR_OPT(L"text:select-page", text_select_page_);
BOOST_FOREACH(const office_element_ptr & elm, text_)
for (size_t i = 0; i < text_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
text_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -625,9 +624,9 @@ void text_page_count::serialize(std::wostream & _Wostream)
{
common_field_fixed_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, text_)
for (size_t i = 0; i < text_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
text_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -662,9 +661,9 @@ void text_date::serialize(std::wostream & _Wostream)
{
common_field_fixed_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, text_)
for (size_t i = 0; i < text_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
text_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -701,9 +700,9 @@ void text_time::serialize(std::wostream & _Wostream)
CP_XML_ATTR_OPT(L"style:data-style-name", style_data_style_name_);
CP_XML_ATTR_OPT(L"text:time-value", text_time_value_);
BOOST_FOREACH(const office_element_ptr & elm, text_)
for (size_t i = 0; i < text_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
text_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -740,9 +739,9 @@ void text_file_name::serialize(std::wostream & _Wostream)
{
common_field_fixed_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, text_)
for (size_t i = 0; i < text_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
text_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -776,9 +775,9 @@ void text_sequence::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & elm, text_)
for (size_t i = 0; i < text_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
text_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -823,9 +822,9 @@ void text_sheet_name::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & elm, text_)
for (size_t i = 0; i < text_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
text_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -36,7 +36,6 @@
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include <iostream>
#include <boost/foreach.hpp>
#include "office_elements_create.h"

View File

@ -38,9 +38,6 @@
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/utils.h>
#include <boost/foreach.hpp>
#include "borderstyle.h"
namespace cpdoccore {
@ -85,9 +82,9 @@ void style_tab_stops::serialize(std::wostream & strm)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(office_element_ptr & elm, style_tab_stops_)
{
elm->serialize(CP_XML_STREAM());
for (size_t i = 0; i < style_tab_stops_.size(); i++)
{
style_tab_stops_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -36,7 +36,6 @@
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include <iostream>
#include <boost/foreach.hpp>
#include "office_elements_create.h"
@ -91,9 +90,9 @@ void style_columns::serialize(std::wostream & strm)
if(style_column_sep_) style_column_sep_->serialize(CP_XML_STREAM());
BOOST_FOREACH(const office_element_ptr & elm, style_column_)
{
elm->serialize(CP_XML_STREAM());
for (size_t i = 0; i < style_column_.size(); i++)
{
style_column_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -37,7 +37,6 @@
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/xml/simple_xml_writer.h>
#include <iostream>
#include <boost/foreach.hpp>
#include "office_elements_create.h"
@ -543,18 +542,18 @@ void styles::add_child_element( const office_element_ptr & child, odf_conversion
}
void styles::serialize(std::wostream & strm)//content from different element
{
BOOST_FOREACH(office_element_ptr & elm, number_styles_)
{
elm->serialize(strm);
for (size_t i = 0; i < number_styles_.size(); i++)
{
number_styles_[i]->serialize(strm);
}
BOOST_FOREACH(office_element_ptr & elm, style_style_)
{
elm->serialize(strm);
}
BOOST_FOREACH(office_element_ptr & elm, text_list_style_)
{
elm->serialize(strm);
for (size_t i = 0; i < style_style_.size(); i++)
{
style_style_[i]->serialize(strm);
}
for (size_t i = 0; i < text_list_style_.size(); i++)
{
text_list_style_[i]->serialize(strm);
}
}
void templates::create_child_element( const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context)
{
@ -576,10 +575,10 @@ void templates::add_child_element( const office_element_ptr & child)
}
void templates::serialize(std::wostream & strm)
{
BOOST_FOREACH(office_element_ptr & elm, table_templates_)
{
elm->serialize(strm);
}
for (size_t i = 0; i < table_templates_.size(); i++)
{
table_templates_[i]->serialize(strm);
}
}
void draw_styles::create_child_element(const std::wstring & Ns, const std::wstring & Name, odf_conversion_context * Context)
{
@ -632,29 +631,29 @@ void draw_styles::add_child_element( const office_element_ptr & child, odf_conve
void draw_styles::serialize(std::wostream & strm)
{
BOOST_FOREACH(office_element_ptr & elm, draw_fill_image_)
{
elm->serialize(strm);
for (size_t i = 0; i < draw_fill_image_.size(); i++)
{
draw_fill_image_[i]->serialize(strm);
}
BOOST_FOREACH(office_element_ptr & elm, draw_hatch_)
{
elm->serialize(strm);
for (size_t i = 0; i < draw_hatch_.size(); i++)
{
draw_hatch_[i]->serialize(strm);
}
BOOST_FOREACH(office_element_ptr & elm, draw_gradient_)
{
elm->serialize(strm);
}
BOOST_FOREACH(office_element_ptr & elm, draw_opacity_)
{
elm->serialize(strm);
}
BOOST_FOREACH(office_element_ptr & elm, draw_marker_)
{
elm->serialize(strm);
for (size_t i = 0; i < draw_gradient_.size(); i++)
{
draw_gradient_[i]->serialize(strm);
}
BOOST_FOREACH(office_element_ptr & elm, draw_stroke_dash_)
{
elm->serialize(strm);
for (size_t i = 0; i < draw_opacity_.size(); i++)
{
draw_opacity_[i]->serialize(strm);
}
for (size_t i = 0; i < draw_marker_.size(); i++)
{
draw_marker_[i]->serialize(strm);
}
for (size_t i = 0; i < draw_stroke_dash_.size(); i++)
{
draw_stroke_dash_[i]->serialize(strm);
}
}
// office:automatic-styles
@ -696,11 +695,10 @@ void office_automatic_styles::serialize(std::wostream & strm)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(office_element_ptr elm, style_page_layout_)
{
elm->serialize(CP_XML_STREAM());
}
for (size_t i = 0; i < style_page_layout_.size(); i++)
{
style_page_layout_[i]->serialize(CP_XML_STREAM());
}
styles_.serialize(CP_XML_STREAM());
}
}
@ -762,11 +760,10 @@ void office_master_styles::serialize(std::wostream & strm)
if (draw_layer_set_)
draw_layer_set_->serialize(CP_XML_STREAM());
BOOST_FOREACH(office_element_ptr elm, style_master_page_)
{
elm->serialize(CP_XML_STREAM());
}
for (size_t i = 0; i < style_master_page_.size(); i++)
{
style_master_page_[i]->serialize(CP_XML_STREAM());
}
if (style_handout_master_)
style_handout_master_->serialize(CP_XML_STREAM());

View File

@ -33,7 +33,6 @@
#include "table.h"
#include <boost/make_shared.hpp>
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
@ -272,7 +271,7 @@ void table_table_columns::create_child_element(const std::wstring & Ns, const st
{
if CP_CHECK_NAME(L"table", L"table-column")
{
CP_CREATE_ELEMENT(table_table_column_);
CP_CREATE_ELEMENT(content_);
}
else
CP_NOT_APPLICABLE_ELM();
@ -284,7 +283,7 @@ void table_table_columns::add_child_element( const office_element_ptr & child_el
ElementType type = child_element->get_type();
if (type == typeTableTableColumn)
table_table_column_.push_back(child_element);
content_.push_back(child_element);
}
void table_table_columns::serialize(std::wostream & _Wostream)
{
@ -292,9 +291,9 @@ void table_table_columns::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & elm, table_table_column_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -309,7 +308,7 @@ void table_table_header_columns::create_child_element( const std::wstring & Ns,
{
if CP_CHECK_NAME(L"table", L"table-column")
{
CP_CREATE_ELEMENT(table_table_column_);
CP_CREATE_ELEMENT(content_);
}
else
CP_NOT_APPLICABLE_ELM();
@ -321,7 +320,7 @@ void table_table_header_columns::add_child_element( const office_element_ptr & c
ElementType type = child_element->get_type();
if (type == typeTableTableColumn)
table_table_column_.push_back(child_element);
content_.push_back(child_element);
}
void table_table_header_columns::serialize(std::wostream & _Wostream)
{
@ -329,9 +328,9 @@ void table_table_header_columns::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & elm, table_table_column_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -347,7 +346,7 @@ void table_columns::create_child_element( const std::wstring & Ns, const std::ws
}
else if CP_CHECK_NAME(L"table", L"table-column")
{
CP_CREATE_ELEMENT_SIMPLE(table_table_column_);
CP_CREATE_ELEMENT_SIMPLE(content_);
}
else
not_applicable_element(L"table-columns", Ns, Name);
@ -367,15 +366,15 @@ void table_columns::add_child_element( const office_element_ptr & child_element)
table_table_columns_ = child_element;
}
else if (type == typeTableTableColumn)
table_table_column_.push_back(child_element);
content_.push_back(child_element);
}
void table_columns::serialize(std::wostream & _Wostream)
void table_columns::serialize(std::wostream & strm)
{
if (table_table_columns_) table_table_columns_->serialize(_Wostream);
if (table_table_columns_) table_table_columns_->serialize(strm);
BOOST_FOREACH(const office_element_ptr & elm, table_table_column_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(_Wostream);
content_[i]->serialize(strm);
}
}
// table-columns-no-group
@ -521,11 +520,11 @@ void table_columns_and_groups::add_child_element( const office_element_ptr & chi
not_applicable_element(L"table-columns-and-groups", L"", L"");
}
}
void table_columns_and_groups::serialize(std::wostream & _Wostream)
void table_columns_and_groups::serialize(std::wostream & strm)
{
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(_Wostream);
content_[i]->serialize(strm);
}
}
// table-table-cell-content
@ -539,11 +538,11 @@ void table_table_cell_content::add_child_element( const office_element_ptr & chi
{
text_content_.push_back(child_element);
}
void table_table_cell_content::serialize(std::wostream & _Wostream)
void table_table_cell_content::serialize(std::wostream & strm)
{
BOOST_FOREACH(const office_element_ptr & elm, text_content_)
for (size_t i = 0; i < text_content_.size(); i++)
{
if (elm) elm->serialize(_Wostream);
text_content_[i]->serialize(strm);
}
}
// table:table-cell
@ -635,9 +634,9 @@ void table_table_row::serialize(std::wostream & _Wostream)
{
table_table_row_attlist_.serialize(CP_GET_XML_NODE());
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -650,21 +649,21 @@ const wchar_t * table_table_rows::name = L"table-rows";
void table_table_rows::create_child_element( const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(table_table_row_);
CP_CREATE_ELEMENT(content_);
}
void table_table_rows::add_child_element( const office_element_ptr & child_element)
{
table_table_row_.push_back(child_element);
content_.push_back(child_element);
}
void table_table_rows::serialize(std::wostream & _Wostream)
void table_table_rows::serialize(std::wostream & strm)
{
CP_XML_WRITER(_Wostream)
CP_XML_WRITER(strm)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & elm, table_table_row_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(strm);
}
}
}
@ -679,7 +678,7 @@ void table_table_header_rows::create_child_element( const std::wstring & Ns, con
{
if CP_CHECK_NAME(L"table", L"table-row")
{
CP_CREATE_ELEMENT(table_table_row_);
CP_CREATE_ELEMENT(content_);
}
else
CP_NOT_APPLICABLE_ELM();
@ -691,7 +690,7 @@ void table_table_header_rows::add_child_element( const office_element_ptr & chil
ElementType type = child_element->get_type();
if (type == typeTableTableRow)
table_table_row_.push_back(child_element);
content_.push_back(child_element);
}
void table_table_header_rows::serialize(std::wostream & _Wostream)
{
@ -699,9 +698,9 @@ void table_table_header_rows::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & elm, table_table_row_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}
@ -716,7 +715,7 @@ void table_rows::create_child_element(const std::wstring & Ns, const std::wstrin
}
else if CP_CHECK_NAME(L"table", L"table-row")
{
CP_CREATE_ELEMENT_SIMPLE(table_table_row_);
CP_CREATE_ELEMENT_SIMPLE(content_);
}
else
{
@ -733,16 +732,16 @@ void table_rows::add_child_element( const office_element_ptr & child_element)
table_table_rows_ = child_element;
else if (type == typeTableTableRow)
table_table_row_.push_back(child_element);
content_.push_back(child_element);
}
void table_rows::serialize(std::wostream & _Wostream)
void table_rows::serialize(std::wostream & strm)
{
if (table_table_rows_)
table_table_rows_->serialize(_Wostream);
table_table_rows_->serialize(strm);
BOOST_FOREACH(const office_element_ptr & elm, table_table_row_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(_Wostream);
content_[i]->serialize(strm);
}
}
// table-rows-no-group
@ -851,11 +850,11 @@ void table_rows_and_groups::add_child_element( const office_element_ptr & child_
content_.push_back(elm);
}
}
void table_rows_and_groups::serialize(std::wostream & _Wostream)
void table_rows_and_groups::serialize(std::wostream & strm)
{
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(_Wostream);
content_[i]->serialize(strm);
}
}
// table:table-row-group
@ -911,9 +910,9 @@ void table_shapes::serialize(std::wostream & _Wostream)
{
CP_XML_NODE_SIMPLE()
{
BOOST_FOREACH(const office_element_ptr & elm, content_)
for (size_t i = 0; i < content_.size(); i++)
{
elm->serialize(CP_XML_STREAM());
content_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -186,8 +186,8 @@ public:
virtual void serialize(std::wostream & _Wostream);
public:
office_element_ptr table_table_columns_;
office_element_ptr_array table_table_column_;
office_element_ptr table_table_columns_;
office_element_ptr_array content_;
};
@ -296,7 +296,7 @@ public:
virtual void serialize(std::wostream & _Wostream);
office_element_ptr_array table_table_column_;
office_element_ptr_array content_;
};
@ -318,7 +318,7 @@ public:
virtual void serialize(std::wostream & _Wostream);
office_element_ptr_array table_table_column_;
office_element_ptr_array content_;
};
@ -472,7 +472,7 @@ public:
{
}
office_element_ptr_array table_table_row_;
office_element_ptr_array content_;
};
@ -494,7 +494,7 @@ public:
virtual void serialize(std::wostream & _Wostream);
office_element_ptr_array table_table_row_;
office_element_ptr_array content_;
};
@ -509,7 +509,7 @@ public:
virtual void serialize(std::wostream & _Wostream);
office_element_ptr table_table_rows_;
office_element_ptr_array table_table_row_;
office_element_ptr_array content_;
};

View File

@ -32,10 +32,7 @@
#include "text_elements.h"
#include <boost/foreach.hpp>
#include <cpdoccore/xml/xmlchar.h>
#include <cpdoccore/xml/attributes.h>
#include "paragraph_elements.h"
@ -76,11 +73,11 @@ void paragraph::add_text(const std::wstring & Text)
office_element_ptr elm = text_text::create(Text) ;
paragraph_content_.push_back( elm );
}
void paragraph::serialize(std::wostream & _Wostream)
void paragraph::serialize(std::wostream & strm)
{
BOOST_FOREACH(const office_element_ptr & elm, paragraph_content_)
{
elm->serialize(_Wostream);
for (size_t i = 0; i < paragraph_content_.size(); i++)
{
paragraph_content_[i]->serialize(strm);
}
}
void paragraph::serialize_attr(CP_ATTR_NODE)
@ -95,11 +92,10 @@ void paragraph_attrs::serialize(CP_ATTR_NODE)
std::wstring text_class_names_all;
BOOST_FOREACH(const std::wstring & elm, text_class_names_)
{
text_class_names_all = elm + std::wstring(L" ");
}
for (size_t i = 0; i < text_class_names_.size(); i++)
{
text_class_names_all = text_class_names_[i] + std::wstring(L" ");
}
if (!text_class_names_all.empty())
CP_XML_ATTR(L"text:class-names", text_class_names_all);
}
@ -186,9 +182,9 @@ void text_list::serialize(std::wostream & _Wostream)
if (text_list_header_) text_list_header_->serialize(CP_XML_STREAM());
BOOST_FOREACH(const office_element_ptr & listItem, text_list_items_)
for (size_t i = 0; i < text_list_items_.size(); i++)
{
listItem->serialize(CP_XML_STREAM());
text_list_items_[i]->serialize(CP_XML_STREAM());
}
}
}

View File

@ -36,8 +36,6 @@
#include "../utils.h"
#include <boost/lexical_cast.hpp>
#include "XlsxConverter.h"
#include "DocxConverter.h"
#include "PptxConverter.h"

View File

@ -39,9 +39,6 @@
#include "VmlShapeTypes2Oox.h"
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include "../OdfFormat/odt_conversion_context.h"
#include "../OdfFormat/odf_text_context.h"
@ -187,7 +184,7 @@ void DocxConverter::convert_document()
int last_section_start = 0;
//считаем количесво секций и запоминаем их свойства ..
for (long i = 0; i < document->m_arrItems.size(); i++)
for (size_t i = 0; i < document->m_arrItems.size(); i++)
{
if (document->m_arrItems[i] == NULL) continue;
@ -199,18 +196,18 @@ void DocxConverter::convert_document()
{
if (para->m_oParagraphProperty->m_oSectPr.IsInit() )
{
sections.push_back(_section(para->m_oParagraphProperty->m_oSectPr.GetPointer(), last_section_start, i + 1));
last_section_start = i + 1;
sections.push_back(_section(para->m_oParagraphProperty->m_oSectPr.GetPointer(), last_section_start, (int)i + 1));
last_section_start = (int)i + 1;
}
}
}
}
sections.push_back(_section(document->m_oSectPr.GetPointer(), last_section_start, document->m_arrItems.size(), true));
sections.push_back(_section(document->m_oSectPr.GetPointer(), last_section_start, (int)document->m_arrItems.size(), true));
//----------------------------------------------------------------------------------------------------------
odt_context->text_context()->clear_params();
for (int sect = 0; sect < sections.size(); sect++)
for (size_t sect = 0; sect < sections.size(); sect++)
{
current_section_properties = &sections[sect];
@ -522,7 +519,7 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph)
{//rapcomnat12.docx - стр 185
bool empty_para = true;
for (unsigned int nIndex = 0; empty_para && nIndex < oox_paragraph->m_arrItems.size(); nIndex++ )
for (size_t nIndex = 0; empty_para && nIndex < oox_paragraph->m_arrItems.size(); nIndex++ )
{
switch(oox_paragraph->m_arrItems[nIndex]->getType())
{
@ -546,7 +543,7 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph)
}
//---------------------------------------------------------------------------------------------------------------------
for (unsigned int nIndex = 0; nIndex < oox_paragraph->m_arrItems.size(); nIndex++ )
for (size_t nIndex = 0; nIndex < oox_paragraph->m_arrItems.size(); nIndex++ )
{
//те элементы которые тока для Paragraph - здесь - остальные в общей куче
switch(oox_paragraph->m_arrItems[nIndex]->getType())
@ -573,7 +570,7 @@ void DocxConverter::convert(OOX::Logic::CParagraph *oox_paragraph)
//---------------------------------------------------------------------------------------------------------------------
//std::sort(id_change_properties.begin(), id_change_properties.end());
for (int i = 0; i < id_change_properties.size(); i++)
for (size_t i = 0; i < id_change_properties.size(); i++)
{
odt_context->end_change(id_change_properties[i].second, id_change_properties[i].first);
}
@ -584,7 +581,7 @@ void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87
//хм разобраться а нужен ли он ... частенько бывает в неправильном месте!!! - A GRUBU.docx
//https://forums.asp.net/t/1951556.aspx?Facing+problem+finding+out+page+end+in+Ms+Word+Open+XML+SDK+Asp+net+c+We+can+t+get+a+lastRenderedPageBreak
////test for break - 2 first element ЭТОТ элемент НУЖНО вытащить отдельно !!!
//for(unsigned int i = 0; i < (std::min) ( (size_t)2, oox_run->m_arrItems.size()); ++i)
//for(size_t i = 0; i < (std::min) ( (size_t)2, oox_run->m_arrItems.size()); ++i)
//{
// if (oox_run->m_arrItems[i]->getType() == OOX::et_w_lastRenderedPageBreak)
// {
@ -608,7 +605,7 @@ void DocxConverter::convert(OOX::Logic::CRun *oox_run)//wordprocessing 22.1.2.87
odt_context->start_run(styled);
for(unsigned int i = 0; i < oox_run->m_arrItems.size(); ++i)
for(size_t i = 0; i < oox_run->m_arrItems.size(); ++i)
{
//те элементы которые тока для Run - здесь - остальные в общей куче
switch(oox_run->m_arrItems[i]->getType())
@ -778,7 +775,7 @@ void DocxConverter::convert(OOX::Logic::CFldSimple *oox_fld)
if (oox_fld->m_sInstr.IsInit())
odt_context->set_field_instr(oox_fld->m_sInstr.get2());
for (unsigned int i=0; i< oox_fld->m_arrItems.size(); i++)
for (size_t i=0; i< oox_fld->m_arrItems.size(); i++)
{
convert(oox_fld->m_arrItems[i]);
}
@ -815,7 +812,7 @@ void DocxConverter::convert(OOX::Logic::CIns *oox_ins)
bool start_change = odt_context->start_change(id, 1, author, userId, date);
for (unsigned int i=0; i< oox_ins->m_arrItems.size(); i++)
for (size_t i=0; i< oox_ins->m_arrItems.size(); i++)
{
convert(oox_ins->m_arrItems[i]);
}
@ -1019,7 +1016,7 @@ void DocxConverter::convert(OOX::Logic::CDel *oox_del)
std::wstring date = oox_del->m_oDate.IsInit() ? oox_del->m_oDate->GetValue() : L"";
bool res_change = odt_context->start_change(id, 2, author, userId, date);
for (unsigned int i=0; i< oox_del->m_arrItems.size(); i++)
for (size_t i=0; i< oox_del->m_arrItems.size(); i++)
{
convert(oox_del->m_arrItems[i]);
}
@ -1030,7 +1027,7 @@ void DocxConverter::convert(OOX::Logic::CSmartTag *oox_tag)
{
if (oox_tag == NULL) return;
for (unsigned int i=0; i< oox_tag->m_arrItems.size(); i++)
for (size_t i=0; i< oox_tag->m_arrItems.size(); i++)
{
convert(oox_tag->m_arrItems[i]);
}
@ -1250,7 +1247,7 @@ void DocxConverter::convert(OOX::Logic::CParagraphProperty *oox_paragraph_pr, cp
if (oox_paragraph_pr->m_oTabs.IsInit())
{
paragraph_properties->add_child_element(odf_context()->start_tabs());
for (unsigned int i = 0; i < oox_paragraph_pr->m_oTabs->m_arrTabs.size(); i++)
for (size_t i = 0; i < oox_paragraph_pr->m_oTabs->m_arrTabs.size(); i++)
{
if (oox_paragraph_pr->m_oTabs->m_arrTabs[i] == NULL) continue;
@ -1279,14 +1276,14 @@ void DocxConverter::apply_HF_from(OOX::Logic::CSectionProperty *props, OOX::Logi
if (other->m_arrFooterReference.size() > 0)
{
for (unsigned int i =0 ; i < props->m_arrFooterReference.size() ; i++)
for (size_t i =0 ; i < props->m_arrFooterReference.size() ; i++)
{
if (props->m_arrFooterReference[i]) delete props->m_arrFooterReference[i];
props->m_arrFooterReference[i] = NULL;
}
props->m_arrFooterReference.clear();
for (unsigned int i =0 ; i < other->m_arrFooterReference.size() ; i++)
for (size_t i =0 ; i < other->m_arrFooterReference.size() ; i++)
{
ComplexTypes::Word::CHdrFtrRef* ref = new ComplexTypes::Word::CHdrFtrRef();
@ -1299,14 +1296,14 @@ void DocxConverter::apply_HF_from(OOX::Logic::CSectionProperty *props, OOX::Logi
}
if (other->m_arrHeaderReference.size() > 0)
{
for (unsigned int i =0 ; i < props->m_arrHeaderReference.size() ; i++)
for (size_t i =0 ; i < props->m_arrHeaderReference.size() ; i++)
{
if (props->m_arrHeaderReference[i]) delete props->m_arrHeaderReference[i];
props->m_arrHeaderReference[i] = NULL;
}
props->m_arrHeaderReference.clear();
for (unsigned int i =0 ; i < other->m_arrHeaderReference.size() ; i++)
for (size_t i =0 ; i < other->m_arrHeaderReference.size() ; i++)
{
ComplexTypes::Word::CHdrFtrRef* ref = new ComplexTypes::Word::CHdrFtrRef();
@ -1501,7 +1498,7 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
std::vector<int> types;
for (unsigned int i = 0; i < s->m_arrHeaderReference.size(); i++)
for (size_t i = 0; i < s->m_arrHeaderReference.size(); i++)
{
if (s->m_arrHeaderReference[i] == NULL) continue;
@ -1529,7 +1526,7 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
if (!add_odd_even_pages_header && present_odd_even_pages) odt_context->add_empty_header(1);
if (!add_default_header && (present_odd_even_pages || present_title_page)) odt_context->add_empty_header(0);
for (unsigned int i=0; i< s->m_arrFooterReference.size(); i++)
for (size_t i=0; i< s->m_arrFooterReference.size(); i++)
{
if (s->m_arrFooterReference[i] == NULL) continue;
@ -1607,7 +1604,7 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
std::vector<std::pair<double,double>> width_space;
for (unsigned int i =0; i< oox_section_pr->m_oCols->m_arrColumns.size(); i++)
for (size_t i =0; i< oox_section_pr->m_oCols->m_arrColumns.size(); i++)
{
if (oox_section_pr->m_oCols->m_arrColumns[i] == NULL) continue;
double space = default_space_pt;
@ -1620,7 +1617,7 @@ void DocxConverter::convert(OOX::Logic::CSectionProperty *oox_section_pr, bool r
width_space.push_back(std::pair<double,double>(w, space));
}
//for (unsigned int i= oox_section_pr->m_oCols->m_arrColumns.size(); i< num_columns; i ++)
//for (size_t i= oox_section_pr->m_oCols->m_arrColumns.size(); i< num_columns; i ++)
//{
// width_space.push_back(std::pair<double,double>(-1, default_space_pt));
//}
@ -2262,13 +2259,13 @@ void DocxConverter::convert(OOX::Logic::CAlternateContent *oox_alt_content)
{
if (oox_alt_content == NULL)return;
for(unsigned int i = 0; i < oox_alt_content->m_arrChoiceItems.size(); ++i) // правильный выбор
for(size_t i = 0; i < oox_alt_content->m_arrChoiceItems.size(); ++i) // правильный выбор
{
convert(oox_alt_content->m_arrChoiceItems[i]);
}
if (oox_alt_content->m_arrChoiceItems.size() > 0) return; //чтоб не было дубляжа
for(unsigned int i = 0; i < oox_alt_content->m_arrFallbackItems.size(); ++i) // альтернативный
for(size_t i = 0; i < oox_alt_content->m_arrFallbackItems.size(); ++i) // альтернативный
// todooo нужно сверять по инддексно что нормально сконвертилось ... или делать ВСЕ по choice ( это правильнее)
{
convert(oox_alt_content->m_arrFallbackItems[i]);
@ -2458,7 +2455,7 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
}
if (!bSet)
{
int pos = oox_pic->m_oShape->m_sType->find(_T("#_x0000_t"));
int pos = (int)oox_pic->m_oShape->m_sType->find(_T("#_x0000_t"));
if (pos >= 0)
{
sptType = (SimpleTypes::Vml::SptType)_wtoi(oox_pic->m_oShape->m_sType->substr(pos + 9, oox_pic->m_oShape->m_sType->length() - pos - 9).c_str());
@ -2823,13 +2820,13 @@ void DocxConverter::convert_lists_styles()
oox_current_child_document = dynamic_cast<OOX::IFileContainer*>(lists_styles);
//базовые
for (unsigned int i=0; i < lists_styles->m_arrAbstractNum.size(); i++)
for (size_t i=0; i < lists_styles->m_arrAbstractNum.size(); i++)
{
convert(lists_styles->m_arrAbstractNum[i]);
}
//используемые в документе, используют базовые + могут поменяться - Override
for (unsigned int i=0; i < lists_styles->m_arrNum.size(); i++)
for (size_t i=0; i < lists_styles->m_arrNum.size(); i++)
{
if (lists_styles->m_arrNum[i] == NULL) continue;
@ -2864,7 +2861,7 @@ void DocxConverter::convert_styles()
convert(docx_styles->m_oDocDefaults.GetPointer());
for (unsigned int i=0; i< docx_styles->m_arrStyle.size(); i++)
for (size_t i=0; i< docx_styles->m_arrStyle.size(); i++)
{
if (docx_styles->m_arrStyle[i] == NULL) continue;
@ -2902,7 +2899,7 @@ void DocxConverter::convert(OOX::Logic::CHyperlink *oox_hyperlink)
odt_context->start_hyperlink(ref);
for (unsigned int i=0; i< oox_hyperlink->m_arrItems.size(); i++)
for (size_t i=0; i< oox_hyperlink->m_arrItems.size(); i++)
{
convert(oox_hyperlink->m_arrItems[i]);
}
@ -2911,7 +2908,7 @@ void DocxConverter::convert(OOX::Logic::CHyperlink *oox_hyperlink)
else
{//ссылка внутри дока
//anchor todooo
for (unsigned int i=0; i< oox_hyperlink->m_arrItems.size(); i++)
for (size_t i=0; i< oox_hyperlink->m_arrItems.size(); i++)
{
convert(oox_hyperlink->m_arrItems[i]);
}
@ -3017,7 +3014,7 @@ void DocxConverter::convert(OOX::Numbering::CAbstractNum* oox_num_style)
//nullable<ComplexTypes::Word::std::wstring_ > m_oStyleLink;
//nullable<ComplexTypes::Word::CLongHexNumber > m_oTmpl;
for (unsigned int i=0; i < oox_num_style->m_arrLvl.size(); i++)
for (size_t i=0; i < oox_num_style->m_arrLvl.size(); i++)
{
convert(oox_num_style->m_arrLvl[i]);
}
@ -3153,7 +3150,7 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
int id = oox_num_lvl->m_oLvlPicBulletId->m_oVal->GetValue();
OOX::CNumbering * lists_styles = docx_document->GetNumbering();
for (unsigned int i = 0; (lists_styles) && (i< lists_styles->m_arrNumPicBullet.size()); i++)
for (size_t i = 0; (lists_styles) && (i< lists_styles->m_arrNumPicBullet.size()); i++)
{
if ((lists_styles->m_arrNumPicBullet[i]) && (lists_styles->m_arrNumPicBullet[i]->m_oNumPicBulletId.GetValue() == id))
{
@ -3245,7 +3242,7 @@ void DocxConverter::convert_table_style(OOX::CStyle *oox_style)
// convert(oox_style->m_oTrPr.GetPointer(), table_row_properties);
//}
//отдельные
for (unsigned int i = 0 ; i <oox_style->m_arrTblStylePr.size() ; i++)
for (size_t i = 0 ; i <oox_style->m_arrTblStylePr.size() ; i++)
{
if (oox_style->m_arrTblStylePr[i] == NULL) continue;
@ -3437,7 +3434,7 @@ void DocxConverter::convert_comment(int oox_comm_id)
OOX::CComments * docx_comments = docx_document->GetComments();
if (!docx_comments)return;
for (unsigned int comm = 0 ; comm < docx_comments->m_arrComments.size(); comm++)
for (size_t comm = 0 ; comm < docx_comments->m_arrComments.size(); comm++)
{
OOX::CComment* oox_comment = docx_comments->m_arrComments[comm];
@ -3452,7 +3449,7 @@ void DocxConverter::convert_comment(int oox_comm_id)
if (oox_comment->m_oDate.IsInit()) odt_context->comment_context()->set_date (oox_comment->m_oDate->GetValue());
if (oox_comment->m_oInitials.IsInit()) {}
for (unsigned int i = 0; i <oox_comment->m_arrItems.size(); i++)
for (size_t i = 0; i <oox_comment->m_arrItems.size(); i++)
{
convert(oox_comment->m_arrItems[i]);
}
@ -3468,7 +3465,7 @@ void DocxConverter::convert_footnote(int oox_ref_id)
odt_context->start_note(oox_ref_id, 1);
for (unsigned int n = 0 ; n < footnotes->m_arrFootnote.size(); n++)
for (size_t n = 0 ; n < footnotes->m_arrFootnote.size(); n++)
{
OOX::CFtnEdn* oox_note = footnotes->m_arrFootnote[n];
@ -3479,7 +3476,7 @@ void DocxConverter::convert_footnote(int oox_ref_id)
{
odt_context->start_note_content();
{
for (unsigned int i = 0; i < oox_note->m_arrItems.size(); i++)
for (size_t i = 0; i < oox_note->m_arrItems.size(); i++)
{
convert(oox_note->m_arrItems[i]);
}
@ -3496,7 +3493,7 @@ void DocxConverter::convert_endnote(int oox_ref_id)
odt_context->start_note(oox_ref_id, 2);
for (unsigned int n = 0 ; n < endnotes->m_arrEndnote.size(); n++)
for (size_t n = 0 ; n < endnotes->m_arrEndnote.size(); n++)
{
OOX::CFtnEdn* oox_note = endnotes->m_arrEndnote[n];
@ -3507,7 +3504,7 @@ void DocxConverter::convert_endnote(int oox_ref_id)
{
odt_context->start_note_content();
{
for (unsigned int i = 0; i < oox_note->m_arrItems.size(); i++)
for (size_t i = 0; i < oox_note->m_arrItems.size(); i++)
{
convert(oox_note->m_arrItems[i]);
}
@ -3524,7 +3521,7 @@ void DocxConverter::convert_hdr_ftr (std::wstring sId)
oox_current_child_document = dynamic_cast<OOX::IFileContainer*>(oox_hdr_ftr);
for ( unsigned int nIndex = 0; nIndex < oox_hdr_ftr->m_arrItems.size(); nIndex++ )
for ( size_t nIndex = 0; nIndex < oox_hdr_ftr->m_arrItems.size(); nIndex++ )
{
convert(oox_hdr_ftr->m_arrItems[nIndex]);
}
@ -3695,7 +3692,7 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
odt_context->table_context()->set_table_inside_h(border_inside_h);
int count_rows = oox_table->m_nCountRow;
int count_columns = oox_table->m_oTblGrid.IsInit() ? oox_table->m_oTblGrid->m_arrGridCol.size() : 0;
int count_columns = oox_table->m_oTblGrid.IsInit() ? (int)oox_table->m_oTblGrid->m_arrGridCol.size() : 0;
odt_context->styles_context()->table_styles().set_current_dimension(count_columns, count_rows);
odt_context->table_context()->count_rows(count_rows);
@ -3703,7 +3700,7 @@ void DocxConverter::convert(OOX::Logic::CTbl *oox_table)
convert(oox_table->m_oTblGrid.GetPointer());
//------ строки
for (unsigned int i =0 ; i < oox_table->m_arrItems.size(); i++)
for (size_t i =0 ; i < oox_table->m_arrItems.size(); i++)
{
switch(oox_table->m_arrItems[i]->getType())
{
@ -3753,7 +3750,7 @@ void DocxConverter::convert(OOX::Logic::CTblGrid *oox_table_grid)
odt_context->start_table_columns();
for (int i =0 ; i < oox_table_grid->m_arrGridCol.size(); i++)
for (size_t i =0 ; i < oox_table_grid->m_arrGridCol.size(); i++)
{
if (oox_table_grid->m_arrGridCol[i] == NULL) continue;
double width = -1;
@ -3819,7 +3816,7 @@ void DocxConverter::convert(OOX::Logic::CTr *oox_table_row)
convert(oox_table_row->m_oTableRowProperties);
for (unsigned int i =0 ; i < oox_table_row->m_arrItems.size(); i++)
for (size_t i =0 ; i < oox_table_row->m_arrItems.size(); i++)
{
switch(oox_table_row->m_arrItems[i]->getType())
{
@ -3879,7 +3876,7 @@ void DocxConverter::convert(OOX::Logic::CTc *oox_table_cell)
odt_context->table_context()->set_cell_column_span(oox_table_cell->m_oTableCellProperties->m_oGridSpan->m_oVal->GetValue());
}
for (unsigned int i =0 ; i < oox_table_cell->m_arrItems.size(); i++)
for (size_t i =0 ; i < oox_table_cell->m_arrItems.size(); i++)
{
switch(oox_table_cell->m_arrItems[i]->getType())
{
@ -4238,7 +4235,7 @@ bool DocxConverter::convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr,
//если нет убрать, если да - добавить
if (border_inside_h)
{
int del_border = border_inside_h->find(L"none");
int del_border = (int)border_inside_h->find(L"none");
if (row != 1)
{
if (cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_top_ && del_border>=0)
@ -4258,7 +4255,7 @@ bool DocxConverter::convert(OOX::Logic::CTableCellProperties *oox_table_cell_pr,
}
if (border_inside_v)
{
int del_border = border_inside_v->find(L"none");
int del_border = (int)border_inside_v->find(L"none");
if (col != 1)
{
if (cell_properties->style_table_cell_properties_attlist_.common_border_attlist_.fo_border_left_ && del_border>=0)

View File

@ -33,7 +33,6 @@
#include "Converter.h"
#include <boost/foreach.hpp>
#include <cpdoccore/CPSharedPtr.h>
#include <cpdoccore/CPOptional.h>

View File

@ -52,8 +52,6 @@
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/SplitTransition.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Transitions/ZoomTransition.h"
#include <boost/lexical_cast.hpp>
#include "../OdfFormat/odp_conversion_context.h"
#include "../OdfFormat/odf_text_context.h"
@ -1347,6 +1345,10 @@ void PptxConverter::convert_slide(PPTX::Logic::CSld *oox_slide, PPTX::Logic::TxS
{
if (pShape->nvSpPr.nvPr.ph.is_init())
{
if (type == Notes || type == NotesMaster)
{
pShape->nvSpPr.nvPr.ph->idx.reset();
}
if (bFillUp)
pShape->FillLevelUp();

View File

@ -33,7 +33,6 @@
#include "Converter.h"
#include <boost/foreach.hpp>
#include <cpdoccore/CPSharedPtr.h>
#include <cpdoccore/CPOptional.h>

View File

@ -51,7 +51,7 @@ using namespace cpdoccore;
namespace Oox2Odf
{
XlsxConverter::XlsxConverter(const std::wstring & path, const ProgressCallback* CallBack)
{
const OOX::CPath oox_path(std::wstring(path.c_str()));
@ -166,7 +166,7 @@ void XlsxConverter::convert_sheets()
if(Workbook->m_oBookViews.IsInit())
{
for (unsigned int i = 0; i < Workbook->m_oBookViews->m_arrItems.size(); i++)
for (size_t i = 0; i < Workbook->m_oBookViews->m_arrItems.size(); i++)
{
convert(Workbook->m_oBookViews->m_arrItems[i]);
}
@ -198,7 +198,7 @@ void XlsxConverter::convert_sheets()
}
if (Workbook->m_oDefinedNames.IsInit())
{
for (unsigned int i = 0; i < Workbook->m_oDefinedNames->m_arrItems.size(); i++)
for (size_t i = 0; i < Workbook->m_oDefinedNames->m_arrItems.size(); i++)
{
convert(Workbook->m_oDefinedNames->m_arrItems[i]);
}
@ -219,6 +219,8 @@ void XlsxConverter::convert(OOX::Spreadsheet::CDefinedName *oox_defined)
bool printable = false;
if (name == L"_xlnm.Print_Area")printable = true;
//todoooo !!!! сделать анализ на функцию, диапазон, константы .... !!!
if (false)//если простой - range, составной - выражение
ods_context->add_defined_range (name, oox_defined->m_oRef.get2(), sheet_id, printable);
else
@ -243,7 +245,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Предобработка
//гиперлинки
for (unsigned int hyp = 0; oox_sheet->m_oHyperlinks.IsInit() && hyp < oox_sheet->m_oHyperlinks->m_arrItems.size(); hyp++)
for (size_t hyp = 0; oox_sheet->m_oHyperlinks.IsInit() && hyp < oox_sheet->m_oHyperlinks->m_arrItems.size(); hyp++)
{
convert(oox_sheet->m_oHyperlinks->m_arrItems[hyp],oox_sheet);
}
@ -258,7 +260,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//колонки
ods_context->start_columns();
for (unsigned int col = 0 ; oox_sheet->m_oCols.IsInit() && col < oox_sheet->m_oCols->m_arrItems.size(); col++)
for (size_t col = 0 ; oox_sheet->m_oCols.IsInit() && col < oox_sheet->m_oCols->m_arrItems.size(); col++)
{
convert(oox_sheet->m_oCols->m_arrItems[col]);
}
@ -268,7 +270,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
if (oox_sheet->m_oSheetData.IsInit() )
{
ods_context->start_rows();
for (unsigned int row = 0 ; row < oox_sheet->m_oSheetData->m_arrItems.size(); row++)
for (size_t row = 0 ; row < oox_sheet->m_oSheetData->m_arrItems.size(); row++)
{
convert(oox_sheet->m_oSheetData->m_arrItems[row]);
@ -281,7 +283,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
}
//мержи
for (unsigned int mrg = 0 ; oox_sheet->m_oMergeCells.IsInit() && mrg < oox_sheet->m_oMergeCells->m_arrItems.size(); mrg++)
for (size_t mrg = 0 ; oox_sheet->m_oMergeCells.IsInit() && mrg < oox_sheet->m_oMergeCells->m_arrItems.size(); mrg++)
{
if (oox_sheet->m_oMergeCells->m_arrItems[mrg]->m_oRef.IsInit())
ods_context->add_merge_cells(oox_sheet->m_oMergeCells->m_arrItems[mrg]->m_oRef.get());
@ -306,7 +308,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
if (oox_sheet->m_arrConditionalFormatting.size() >0)
{
ods_context->start_conditional_formats();
for (unsigned int fmt =0; fmt < oox_sheet->m_arrConditionalFormatting.size(); fmt++)
for (size_t fmt =0; fmt < oox_sheet->m_arrConditionalFormatting.size(); fmt++)
{
convert(oox_sheet->m_arrConditionalFormatting[fmt]);
}
@ -315,7 +317,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CWorksheet *oox_sheet)
//выносные части таблицы
if (oox_sheet->m_oTableParts.IsInit())
{
for (unsigned int i=0 ; i < oox_sheet->m_oTableParts->m_arrItems.size(); i++)
for (size_t i=0 ; i < oox_sheet->m_oTableParts->m_arrItems.size(); i++)
{
OOX::Spreadsheet::CTablePart *oox_table_part = oox_sheet->m_oTableParts->m_arrItems[i];
if (!oox_table_part)continue;
@ -421,7 +423,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CCommentItem * oox_comment)
if (oox_comment->m_oText.IsInit())
{
for(unsigned int i = 0; i < oox_comment->m_oText->m_arrItems.size(); ++i)
for(size_t i = 0; i < oox_comment->m_oText->m_arrItems.size(); ++i)
{
convert(oox_comment->m_oText->m_arrItems[i]);
}
@ -501,7 +503,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CRow *oox_row)
}else
ods_context->current_table().set_row_optimal_height(true);
for (unsigned int cell = 0 ; cell < oox_row->m_arrItems.size();cell++)
for (size_t cell = 0 ; cell < oox_row->m_arrItems.size();cell++)
{
convert(oox_row->m_arrItems[cell]);
}
@ -626,7 +628,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CRun *oox_text_run)
convert(oox_text_run->m_oRPr.GetPointer());
ods_context->text_context()->start_span(oox_text_run->m_oRPr.GetPointer() ? true : false);
for(unsigned int i = 0; i < oox_text_run->m_arrItems.size(); ++i)
for(size_t i = 0; i < oox_text_run->m_arrItems.size(); ++i)
{
convert(oox_text_run->m_arrItems[i]);
}
@ -965,8 +967,8 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetViews *oox_sheet_views)
if (ActiveCellX >= 0 && ActiveCellY >= 0)
{
ods_context->settings_context()->add_property(L"CursorPositionX", L"int", boost::lexical_cast<std::wstring>(ActiveCellX));
ods_context->settings_context()->add_property(L"CursorPositionY", L"int", boost::lexical_cast<std::wstring>(ActiveCellY));
ods_context->settings_context()->add_property(L"CursorPositionX", L"int", std::to_wstring(ActiveCellX));
ods_context->settings_context()->add_property(L"CursorPositionY", L"int", std::to_wstring(ActiveCellY));
}
}
if (selection->m_oSqref.IsInit())
@ -981,7 +983,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetViews *oox_sheet_views)
if (sheet_view->m_oPane->m_oXSplit.IsInit())
{
std::wstring sVal = boost::lexical_cast<std::wstring>((int)sheet_view->m_oPane->m_oXSplit->GetValue());
std::wstring sVal = std::to_wstring((int)sheet_view->m_oPane->m_oXSplit->GetValue());
ods_context->settings_context()->add_property(L"HorizontalSplitMode", L"short", L"2");
ods_context->settings_context()->add_property(L"HorizontalSplitPosition", L"int", sVal);
@ -991,7 +993,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetViews *oox_sheet_views)
}
if (sheet_view->m_oPane->m_oYSplit.IsInit())
{
std::wstring sVal = boost::lexical_cast<std::wstring>((int)sheet_view->m_oPane->m_oYSplit->GetValue());
std::wstring sVal = std::to_wstring((int)sheet_view->m_oPane->m_oYSplit->GetValue());
ods_context->settings_context()->add_property(L"VerticalSplitMode", L"short", L"2");
ods_context->settings_context()->add_property(L"VerticalSplitPosition", L"int", sVal);
ods_context->settings_context()->add_property(L"PositionTop", L"int", L"0");
@ -1198,31 +1200,31 @@ void XlsxConverter::convert_styles()
if (!xlsx_styles)return;
//todooo ?? стоит ли обращать на параметр Count ??
////////////форматы данных
for (unsigned int i = 0; xlsx_styles->m_oNumFmts.IsInit() && i < xlsx_styles->m_oNumFmts->m_arrItems.size(); i++)
for (size_t i = 0; xlsx_styles->m_oNumFmts.IsInit() && i < xlsx_styles->m_oNumFmts->m_arrItems.size(); i++)
{
convert(xlsx_styles->m_oNumFmts->m_arrItems[i]);
}
/////////////стили ячеек
for (unsigned int i = 0; xlsx_styles->m_oCellStyleXfs.IsInit() && i < xlsx_styles->m_oCellStyleXfs->m_arrItems.size(); i++)
for (size_t i = 0; xlsx_styles->m_oCellStyleXfs.IsInit() && i < xlsx_styles->m_oCellStyleXfs->m_arrItems.size(); i++)
{
//automatical, root - noname - они тока для named
convert(xlsx_styles->m_oCellStyleXfs->m_arrItems[i] , i, true, true);
}
for (unsigned int i = 0; xlsx_styles->m_oCellStyles.IsInit() && i < xlsx_styles->m_oCellStyles->m_arrItems.size(); i++)//styles.xml
for (size_t i = 0; xlsx_styles->m_oCellStyles.IsInit() && i < xlsx_styles->m_oCellStyles->m_arrItems.size(); i++)//styles.xml
{
//non automatical, root - named
convert(xlsx_styles->m_oCellStyles->m_arrItems[i]);
}
//кастомные стили ячеек
for (unsigned int i = 0; xlsx_styles->m_oCellXfs.IsInit() && i < xlsx_styles->m_oCellXfs->m_arrItems.size(); i++)
for (size_t i = 0; xlsx_styles->m_oCellXfs.IsInit() && i < xlsx_styles->m_oCellXfs->m_arrItems.size(); i++)
{
//automatical, non root
convert(xlsx_styles->m_oCellXfs->m_arrItems[i], i, true, false);
}
////////////стили условного форматирования
for (unsigned int i=0; xlsx_styles->m_oDxfs.IsInit() && i < xlsx_styles->m_oDxfs->m_arrItems.size(); i++)
for (size_t i=0; xlsx_styles->m_oDxfs.IsInit() && i < xlsx_styles->m_oDxfs->m_arrItems.size(); i++)
{
convert(xlsx_styles->m_oDxfs->m_arrItems[i], i);
}
@ -1338,10 +1340,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFill * fill, odf_writer::style_ta
{
}
if (fill->m_oPatternFill.IsInit())
{//solid, gradient
if (fill->m_oPatternFill->m_oPatternType.IsInit())
{}
{//solid, gradient, none
if (fill->m_oPatternFill->m_oFgColor.IsInit())
{
convert(fill->m_oPatternFill->m_oFgColor.GetPointer(),
@ -1351,7 +1350,37 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFill * fill, odf_writer::style_ta
{
convert(fill->m_oPatternFill->m_oBgColor.GetPointer(),
cell_properties->style_table_cell_properties_attlist_.common_background_color_attlist_.fo_background_color_);
}
}
else if (fill->m_oPatternFill->m_oPatternType.IsInit())
{
switch(fill->m_oPatternFill->m_oPatternType->GetValue())
{
case SimpleTypes::Spreadsheet::patterntypeNone:
cell_properties->style_table_cell_properties_attlist_.common_background_color_attlist_.fo_background_color_ =
odf_types::background_color::Transparent;
break;
case SimpleTypes::Spreadsheet::patterntypeDarkDown:
case SimpleTypes::Spreadsheet::patterntypeDarkGray:
case SimpleTypes::Spreadsheet::patterntypeDarkGrid:
case SimpleTypes::Spreadsheet::patterntypeDarkHorizontal:
case SimpleTypes::Spreadsheet::patterntypeDarkTrellis:
case SimpleTypes::Spreadsheet::patterntypeDarkUp:
case SimpleTypes::Spreadsheet::patterntypeDarkVertical:
case SimpleTypes::Spreadsheet::patterntypeGray0625:
case SimpleTypes::Spreadsheet::patterntypeGray125:
case SimpleTypes::Spreadsheet::patterntypeLightDown:
case SimpleTypes::Spreadsheet::patterntypeLightGray:
case SimpleTypes::Spreadsheet::patterntypeLightGrid:
case SimpleTypes::Spreadsheet::patterntypeLightHorizontal:
case SimpleTypes::Spreadsheet::patterntypeLightTrellis:
case SimpleTypes::Spreadsheet::patterntypeLightUp:
case SimpleTypes::Spreadsheet::patterntypeLightVertical:
case SimpleTypes::Spreadsheet::patterntypeMediumGray:
// todooo
break;
}
}
}
}
@ -1541,7 +1570,12 @@ void XlsxConverter::convert(OOX::Spreadsheet::CBorderProp *borderProp, std::wstr
break;
}
}
else return;
else
{
border_style = L"none";
if (borderProp->m_oColor.IsInit())
return;
}
if (borderProp->m_oColor.IsInit())
{
@ -1549,8 +1583,9 @@ void XlsxConverter::convert(OOX::Spreadsheet::CBorderProp *borderProp, std::wstr
convert(borderProp->m_oColor.GetPointer(), odf_color);
if (odf_color)
border_color = L" #" + odf_color->get_hex_value();
if (border_color.empty())border_color = L" #000000";
}
if (border_color.length()<1)border_color = L" #000000";
odf_border_prop = border_style + border_color;
}
@ -1800,14 +1835,26 @@ void XlsxConverter::convert(OOX::Spreadsheet::CCellAnchor *oox_anchor)
}
//////////////
if (oox_anchor->m_oPos.IsInit())
{
}
if (oox_anchor->m_oExt.IsInit())
{
}
odf_context()->drawing_context()->start_drawing();
if (oox_anchor->m_oPos.IsInit())
{
_CP_OPT(double) x, y;
if (oox_anchor->m_oPos->m_oX.IsInit()) x = oox_anchor->m_oPos->m_oX->GetValue();
if (oox_anchor->m_oPos->m_oY.IsInit()) y = oox_anchor->m_oPos->m_oY->GetValue();
odf_context()->drawing_context()->set_position( x, y);
}
if (oox_anchor->m_oExt.IsInit())
{
_CP_OPT(double) width, height;
if (oox_anchor->m_oExt->m_oCx.IsInit()) width = oox_anchor->m_oExt->m_oCx->GetValue();
if (oox_anchor->m_oExt->m_oCy.IsInit()) height = oox_anchor->m_oExt->m_oCy->GetValue();
odf_context()->drawing_context()->set_size( width, height);
}
OoxConverter::convert(oox_anchor->m_oElement.GetPointer());
odf_context()->drawing_context()->end_drawing();
}
@ -1819,7 +1866,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CDrawing *oox_drawing)
OOX::IFileContainer* old_container = xlsx_current_container;
xlsx_current_container = dynamic_cast<OOX::IFileContainer*>(oox_drawing);
for (unsigned int dr = 0 ; dr < oox_drawing->m_arrItems.size(); dr++)
for (size_t dr = 0 ; dr < oox_drawing->m_arrItems.size(); dr++)
{
ods_context->start_drawings();
convert(oox_drawing->m_arrItems[dr]);
@ -1848,7 +1895,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatting *oox_cond_f
{
ods_context->current_table().start_conditional_format(oox_cond_fmt->m_oSqRef.get());
for (unsigned int i=0; i< oox_cond_fmt->m_arrItems.size(); i++)
for (size_t i=0; i< oox_cond_fmt->m_arrItems.size(); i++)
convert(oox_cond_fmt->m_arrItems[i]);//rule
ods_context->current_table().end_conditional_format();
@ -1871,7 +1918,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormattingRule *oox_co
if (oox_cond_rule->m_oOperator.IsInit())
ods_context->current_table().set_conditional_operator(oox_cond_rule->m_oOperator->GetValue());
for (unsigned int i=0; i< oox_cond_rule->m_arrItems.size(); i++)
for (size_t i=0; i< oox_cond_rule->m_arrItems.size(); i++)
convert(oox_cond_rule->m_arrItems[i]);
}
ods_context->current_table().end_conditional_rule();
@ -1888,14 +1935,14 @@ void XlsxConverter::convert(OOX::Spreadsheet::CDataBar *oox_cond_databar)
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMaxLength;
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMinLength;
//nullable<SimpleTypes::COnOff<>> m_oShowValue;
for (unsigned int i=0; i< oox_cond_databar->m_arrItems.size(); i++)
for (size_t i=0; i< oox_cond_databar->m_arrItems.size(); i++)
convert(oox_cond_databar->m_arrItems[i]);
}
void XlsxConverter::convert(OOX::Spreadsheet::CColorScale *oox_cond_colorscale)
{
if (!oox_cond_colorscale)return;
for (unsigned int i=0; i< oox_cond_colorscale->m_arrItems.size(); i++)
for (size_t i=0; i< oox_cond_colorscale->m_arrItems.size(); i++)
{
if (!oox_cond_colorscale->m_arrItems[i])continue;
@ -1921,7 +1968,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CIconSet *oox_cond_iconset)
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMaxLength;
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMinLength;
//nullable<SimpleTypes::COnOff<>> m_oShowValue;
for (unsigned int i=0; i< oox_cond_iconset->m_arrItems.size(); i++)
for (size_t i=0; i< oox_cond_iconset->m_arrItems.size(); i++)
convert(oox_cond_iconset->m_arrItems[i]);
}
void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatValueObject *oox_cond_value)
@ -1970,7 +2017,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CAutofilter *oox_filter)
}
ods_context->add_autofilter(ref);//target
//for (unsigned int i=0; i < oox_filter->m_arrItems.size(); i++)//set items todooo
//for (size_t i=0; i < oox_filter->m_arrItems.size(); i++)//set items todooo
//{
//}
}

View File

@ -32,7 +32,7 @@
#pragma once
#include "Converter.h"
#include <boost/foreach.hpp>
#include <cpdoccore/CPSharedPtr.h>
#include <cpdoccore/CPOptional.h>

View File

@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../ASCOfficeOdfFile/include;../../../ASCOfficeOdfFile/src/odf/datatypes;&quot;../../../DesktopEditor/freetype-2.5.2/include&quot;"
AdditionalIncludeDirectories="../../../ASCOfficeOdfFile/include;../../../ASCOfficeOdfFile/src/odf/datatypes;../../../DesktopEditor/xml/libxml2/include"
PreprocessorDefinitions="_DEBUG;_LIB;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"

View File

@ -55,7 +55,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;../../../DesktopEditor/freetype-2.5.2/include&quot;"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;_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"
@ -134,7 +134,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;../../../DesktopEditor/freetype-2.5.2/include&quot;"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_"
MinimalRebuild="true"
BasicRuntimeChecks="3"

View File

@ -36,8 +36,10 @@
#include "../../Common/DocxFormat/Source/DocxFormat/WritingElement.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/ActiveX.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Video.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/VbaProject.h"
#include "../../Common/Base64.h"
@ -123,6 +125,19 @@ namespace NSBinPptxRW
m_lIndexNextImage = 0;
m_lIndexCounter = 0;
}
void CImageManager2::SetDstFolder(const std::wstring& strDst)
{
m_strDstFolder = strDst;
m_strDstMedia = m_strDstFolder + FILE_SEPARATOR_STR + _T("media");
m_strDstEmbed = m_strDstFolder + FILE_SEPARATOR_STR + _T("embeddings");
NSDirectory::CreateDirectory(m_strDstMedia);
NSDirectory::CreateDirectory(m_strDstEmbed);
}
std::wstring CImageManager2::GetDstFolder()
{
return m_strDstFolder;
}
void CImageManager2::SetDstMedia(const std::wstring& strDst)
{
m_strDstMedia = strDst;
@ -1220,7 +1235,7 @@ namespace NSBinPptxRW
m_pWriter->WriteString(strRels);
}
void CRelsGenerator::EndPresentationRels(const bool& bIsCommentsAuthors = false, const bool& bIsNotesMaster)
void CRelsGenerator::EndPresentationRels(bool bIsCommentsAuthors, bool bIsNotesMaster, bool bIsVbaProject)
{
if (bIsNotesMaster)
{
@ -1245,6 +1260,12 @@ namespace NSBinPptxRW
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors\" Target=\"commentAuthors.xml\"/>";
m_pWriter->WriteString(strRels4);
}
if (bIsVbaProject)
{
std::wstring strRels4 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.microsoft.com/office/2006/relationships/vbaProject\" Target=\"vbaProject.bin\"/>";
m_pWriter->WriteString(strRels4);
}
}
int CRelsGenerator::GetNextId()
{

View File

@ -178,8 +178,10 @@ namespace NSBinPptxRW
std::map<std::wstring, _imageManager2Info> m_mapImages;
_INT32 m_lIndexNextImage;
_INT32 m_lIndexCounter;
std::wstring m_strDstMedia;
std::wstring m_strDstEmbed;
std::wstring m_strDstFolder;
public:
int m_nDocumentType;
OOX::CContentTypes* m_pContentTypes;
@ -194,6 +196,9 @@ namespace NSBinPptxRW
void SetDstEmbed(const std::wstring& strDst);
std::wstring GetDstEmbed();
void SetDstFolder(const std::wstring& strDst);
std::wstring GetDstFolder();
int IsDisplayedImage(const std::wstring& strInput);
_imageManager2Info GenerateImage(const std::wstring& strInput, NSCommon::smart_ptr<OOX::File> & additionalFile, const std::wstring& oleData, std::wstring strBase64Image);
@ -419,8 +424,8 @@ namespace NSBinPptxRW
int WriteChart (int nChartNumber, _INT32 lDocType);
int WriteRels (const std::wstring& bsType, const std::wstring& bsTarget, const std::wstring& bsTargetMode);
int WriteHyperlink (const std::wstring& strLink, const bool& bIsActionInit);
void EndPresentationRels (const bool& bIsCommentsAuthors, const bool& bIsNotesMaster = false);
void EndPresentationRels (bool bIsCommentsAuthors = false, bool bIsNotesMaster = false, bool bIsVbaProject = false );
int GetNextId ();
void CloseRels ();

View File

@ -31,7 +31,7 @@
*/
#pragma once
#include "Path.h"
#include "../../../Common/DocxFormat/Source/Common/SimpleTypes_Base.h"
#include "../../../../../Common/DocxFormat/Source/Common/SimpleTypes_Base.h"
namespace NSPresentationEditor
{

View File

@ -100,7 +100,9 @@ namespace NSBinPptxRW
m_oImageManager.Clear();
OOX::CPath pathMedia = pathPPT / _T("media");
m_oImageManager.SetDstFolder(pathPPT.GetPath());
OOX::CPath pathMedia = pathPPT / _T("media");
NSDirectory::CreateDirectory(pathMedia.GetPath());
m_oImageManager.SetDstMedia(pathMedia.GetPath());
@ -809,7 +811,8 @@ namespace NSBinPptxRW
m_oPresentation.notesMasterIdLst[0].rid = (size_t)nCurrentRels;
++nCurrentRels;
}
m_oReader.m_pRels->EndPresentationRels(m_oPresentation.commentAuthors.is_init(), bNotesMasterPresent);
m_oReader.m_pRels->EndPresentationRels(m_oPresentation.commentAuthors.is_init(), bNotesMasterPresent, m_oPresentation.m_pVbaProject.is_init());
m_oReader.m_pRels->CloseRels();
oXmlWriter.ClearNoAttack();
@ -840,7 +843,16 @@ namespace NSBinPptxRW
// content types
OOX::CContentTypes *pContentTypes = m_oImageManager.m_pContentTypes;
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml", L"/ppt", L"presentation.xml");
pContentTypes->Registration(m_oPresentation.type().OverrideType(),
m_oPresentation.type().DefaultDirectory(),
m_oPresentation.type().DefaultFileName());
if (m_oPresentation.m_pVbaProject.IsInit())
{
pContentTypes->Registration(m_oPresentation.m_pVbaProject->type().OverrideType(),
m_oPresentation.type().DefaultDirectory() / m_oPresentation.m_pVbaProject->type().DefaultDirectory(),
m_oPresentation.m_pVbaProject->type().DefaultFileName());
}
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml", L"/ppt", L"presProps.xml");
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml", L"/ppt", L"viewProps.xml");
pContentTypes->Registration(L"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml", L"/ppt", L"tableStyles.xml");

View File

@ -31,10 +31,7 @@
*/
#include "FileFactory.h"
#include "../../Common/DocxFormat/Source/DocxFormat/File.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Rels.h"
#include "../../Common/DocxFormat/Source/DocxFormat/FileTypes.h"
#include "FileMap.h"
#include "FileTypes.h"
#include "App.h"
@ -54,6 +51,8 @@
#include "NotesMaster.h"
#include "LegacyDiagramText.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Rels.h"
#include "../../Common/DocxFormat/Source/DocxFormat/FileTypes.h"
#include "../../Common/DocxFormat/Source/XlsxFormat/Chart/Chart.h"
#include "../../Common/DocxFormat/Source/DocxFormat/VmlDrawing.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Diagram/DiagramData.h"
@ -62,13 +61,14 @@
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/Video.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/ActiveX.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/VbaProject.h"
#include "../../Common/DocxFormat/Source/DocxFormat/External/HyperLink.h"
#include "../../Common/DocxFormat/Source/DocxFormat/External/ExternalImage.h"
#include "../../Common/DocxFormat/Source/DocxFormat/External/ExternalAudio.h"
#include "../../Common/DocxFormat/Source/DocxFormat/External/ExternalVideo.h"
#include "../../Common/DocxFormat/Source/DocxFormat/UnknowTypeFile.h"
#include "FileMap.h"
//
namespace PPTX
@ -84,7 +84,8 @@ namespace PPTX
return smart_ptr<OOX::File>(new PPTX::App(filename, map));
else if (relation.Type() == OOX::FileTypes::Core)
return smart_ptr<OOX::File>(new PPTX::Core(filename, map));
else if (relation.Type() == OOX::Presentation::FileTypes::Presentation)
else if (relation.Type() == OOX::Presentation::FileTypes::Presentation ||
relation.Type() == OOX::Presentation::FileTypes::PresentationMacro)
return smart_ptr<OOX::File>(new PPTX::Presentation(filename, map));
else if (relation.Type() == OOX::FileTypes::Theme)
return smart_ptr<OOX::File>(new PPTX::Theme(filename, map));
@ -141,6 +142,8 @@ namespace PPTX
return smart_ptr<OOX::File>(new OOX::OleObject(filename));
else if (relation.Type() == OOX::FileTypes::MicrosoftOfficeUnknown) //ms package
return smart_ptr<OOX::File>(new OOX::OleObject( filename, true ));
else if (relation.Type() == OOX::FileTypes::VbaProject)
return smart_ptr<OOX::File>(new OOX::VbaProject( filename, filename ));
return smart_ptr<OOX::File>(new OOX::UnknowTypeFile());
}

View File

@ -30,6 +30,10 @@
*
*/
#pragma once
#ifndef PPTX_FILEFACTORY_PPTX_INCLUDE_H_
#define PPTX_FILEFACTORY_PPTX_INCLUDE_H_
#include "../../Common/DocxFormat/Source/DocxFormat/File.h"
namespace OOX {namespace Rels {class CRelationShip;}}
@ -44,3 +48,4 @@ namespace PPTX
static const smart_ptr<OOX::File> CreateFilePPTX(const OOX::CPath& path, OOX::Rels::CRelationShip& relation, FileMap& map);
};
} // namespace PPTX
#endif // PPTX_FILEFACTORY_PPTX_INCLUDE_H_

View File

@ -44,6 +44,9 @@ namespace Presentation
const FileType Presentation (L"ppt", L"presentation.xml",
_T("application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"),
_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"));
const FileType PresentationMacro(L"ppt", L"presentation.xml",
_T("application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml"),
_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"));
const FileType Slide (L"slides", L"slide.xml",
_T("application/vnd.openxmlformats-officedocument.presentationml.slide+xml"),
_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide"));

View File

@ -75,6 +75,12 @@ namespace PPTX
if (_presentation.is_init())
{
_presentation->commentAuthors = _presentation->Get(OOX::Presentation::FileTypes::CommentAuthors).smart_dynamic_cast<PPTX::Authors>();
if (_presentation->IsExist(OOX::FileTypes::VbaProject))
{
_presentation->m_bMacroEnabled = true;
_presentation->m_pVbaProject = _presentation->Get(OOX::FileTypes::VbaProject).smart_dynamic_cast<OOX::VbaProject>();
}
}
for (std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = map.m_map.begin(); pPair != map.m_map.end(); ++pPair)

View File

@ -32,7 +32,6 @@
#pragma once
#include "../../../../Common/DocxFormat/Source/DocxFormat/File.h"
#include "../../../../Common/DocxFormat/Source/SystemUtility/File.h"
#include "../../../../Common/DocxFormat/Source/Base/Types_32.h"
#include "Logic/TextParagraphPr.h"

View File

@ -118,6 +118,8 @@ namespace PPTX
return parentFileAs<SlideMaster>().GetMediaFullPathNameFromRId(*embed);
else if(parentFileIs<Theme>())
return parentFileAs<Theme>().GetMediaFullPathNameFromRId(*embed);
else if(parentFileIs<NotesSlide>())
return parentFileAs<NotesSlide>().GetMediaFullPathNameFromRId(*embed);
return _T("");
}
else if(link.IsInit())
@ -137,6 +139,8 @@ namespace PPTX
return parentFileAs<SlideMaster>().GetMediaFullPathNameFromRId(*link);
else if(parentFileIs<Theme>())
return parentFileAs<Theme>().GetMediaFullPathNameFromRId(*link);
else if(parentFileIs<NotesSlide>())
return parentFileAs<NotesSlide>().GetMediaFullPathNameFromRId(*link);
return _T("");
}
return _T("");
@ -150,6 +154,7 @@ namespace PPTX
else if(parentFileIs<SlideLayout>()) pOleObject = parentFileAs<SlideLayout>().GetOleObject(oRId);
else if(parentFileIs<SlideMaster>()) pOleObject = parentFileAs<SlideMaster>().GetOleObject(oRId);
else if(parentFileIs<Theme>()) pOleObject = parentFileAs<Theme>().GetOleObject(oRId);
else if(parentFileIs<NotesSlide>()) pOleObject = parentFileAs<NotesSlide>().GetOleObject(oRId);
if (pOleObject.IsInit())
return pOleObject->filename().m_strFilename;

View File

@ -64,6 +64,8 @@ namespace PPTX
sLink = parentFileAs<SlideMaster>().GetFullHyperlinkNameFromRId(rid);
else if(parentFileIs<Theme>())
sLink = parentFileAs<Theme>().GetFullHyperlinkNameFromRId(rid);
else if(parentFileIs<NotesSlide>())
sLink = parentFileAs<NotesSlide>().GetFullHyperlinkNameFromRId(rid);
}
XmlUtils::replace_all(sLink, L"\\", L"/");

View File

@ -44,6 +44,7 @@
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/Video.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/OleObject.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/ActiveX.h"
#include "../../../Common/DocxFormat/Source/MathEquation/MathEquation.h"
@ -367,7 +368,7 @@ namespace PPTX
if (pApp)
{
pApp->SetApplication(_T("OnlyOffice"));
pApp->SetAppVersion(_T("4.3000"));
pApp->SetAppVersion(_T("5.0"));
pApp->SetDocSecurity(0);
pApp->SetScaleCrop(false);
pApp->SetLinksUpToDate(false);

View File

@ -42,6 +42,8 @@
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/Audio.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/Video.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/Media/ActiveX.h"
namespace PPTX
{
namespace Logic

View File

@ -88,7 +88,33 @@ namespace PPTX
{
return type().DefaultFileName();
}
virtual std::wstring GetMediaFullPathNameFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::Image> p = GetImage(rid);
if (!p.is_init())
return _T("");
return p->filename().m_strFilename;
}
virtual std::wstring GetFullHyperlinkNameFromRId(const OOX::RId& rid)const
{
smart_ptr<OOX::HyperLink> p = GetHyperlink(rid);
if (!p.is_init())
return _T("");
return p->Uri().m_strFilename;
}
virtual std::wstring GetLinkFromRId(const OOX::RId& rid)const
{
//return relsTable.Links.GetTargetById(rid);
smart_ptr<OOX::External> pExt = Find(rid).smart_dynamic_cast<OOX::External>();
if (pExt.IsInit())
return pExt->Uri().m_strFilename;
smart_ptr<OOX::Media> pMedia = Find(rid).smart_dynamic_cast<OOX::Media>();
if (pMedia.IsInit())
return pMedia->filename().m_strFilename;
return _T("");
}
virtual void toPPTY(NSBinPptxRW::CBinaryFileWriter* pWriter) const
{
pWriter->StartRecord(NSBinPptxRW::NSMainTables::NotesSlides);

View File

@ -50,6 +50,8 @@
#include "Logic/ExtP.h"
#include "Theme/ClrScheme.h"
#include "../../Common/DocxFormat/Source/DocxFormat/Media/VbaProject.h"
namespace PPTX
{
class Presentation : public WrapperFile, public PPTX::FileContainer
@ -57,16 +59,16 @@ namespace PPTX
public:
Presentation()
{
m_bMacroEnabled = false;
}
Presentation(const OOX::CPath& filename, FileMap& map)
{
m_bMacroEnabled = false;
read(filename, map);
}
virtual ~Presentation()
{
}
public:
virtual void read(const OOX::CPath& filename, FileMap& map)
{
//FileContainer::read(filename, map);
@ -182,6 +184,7 @@ namespace PPTX
}
}
}
//smartTags (Smart Tags)
Normalize();
}
@ -222,6 +225,15 @@ namespace PPTX
pWriter->WriteRecord2(6, commentAuthors);
pWriter->WriteRecord2(7, sectionLst);
if (m_pVbaProject.IsInit())
{
pWriter->StartRecord(8);
{
m_pVbaProject->toPPTY(pWriter);
}
pWriter->EndRecord();
}
pWriter->EndRecord();
}
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
@ -318,22 +330,28 @@ namespace PPTX
default:
return;
}
}
break;
}
}
}break;
case 6:
{
commentAuthors = new PPTX::Authors();
commentAuthors->fromPPTY(pReader);
break;
}
commentAuthors->fromPPTY(pReader);
}break;
case 7:
{
sectionLst = new nsPresentation::SectionLst();
sectionLst->fromPPTY(pReader);
break;
}
sectionLst->fromPPTY(pReader);
}break;
case 8:
{
m_pVbaProject = new OOX::VbaProject();
m_pVbaProject->fromPPTY(pReader);
smart_ptr<OOX::File> file = m_pVbaProject.smart_dynamic_cast<OOX::File>();
FileContainer::Add(file);
m_bMacroEnabled = true;
}break;
default:
{
pReader->Seek(_end_pos);
@ -397,10 +415,10 @@ namespace PPTX
pWriter->EndNode(L"p:presentation");
}
public:
virtual const OOX::FileType type() const
{
return OOX::Presentation::FileTypes::Presentation;
if (m_bMacroEnabled) return OOX::Presentation::FileTypes::PresentationMacro;
else return OOX::Presentation::FileTypes::Presentation;
}
virtual const OOX::CPath DefaultDirectory() const
{
@ -411,7 +429,6 @@ namespace PPTX
return type().DefaultFileName();
}
public:
//Childs
//custDataLst (Customer Data List)
//property<std::list<Presentation::CustShow> > custShowLst (List of Custom Shows)
@ -446,9 +463,12 @@ namespace PPTX
smart_ptr<PPTX::Authors> commentAuthors;
private:
Logic::ClrMap m_clrMap;
nsTheme::ClrScheme m_clrScheme;
Logic::ClrMap m_clrMap;
nsTheme::ClrScheme m_clrScheme;
public:
bool m_bMacroEnabled;
smart_ptr<OOX::VbaProject> m_pVbaProject;
void SetClrMap(Logic::ClrMap map) {m_clrMap = map;};
void SetClrScheme(nsTheme::ClrScheme scheme) {m_clrScheme = scheme;};

View File

@ -363,7 +363,7 @@ namespace PPTX
}
if (IsExist(OOX::FileTypes::VmlDrawing))
{
Vml = FileContainer::Get(OOX::FileTypes::VmlDrawing).smart_dynamic_cast<OOX::CVmlDrawing>();//boost::shared_dynamic_cast<PPTX::VmlDrawing, PPTX::File>(FileContainer::get(OOX::Presentation::FileTypes::VmlDrawing));
Vml = FileContainer::Get(OOX::FileTypes::VmlDrawing).smart_dynamic_cast<OOX::CVmlDrawing>();
}
}
}

View File

@ -44,7 +44,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\Common\ASCDocxFormat\Source\Utility;..\..\Common\ASCDocxFormat\Source\XML;..\..\Common\ASCDocxFormat\Source\;.\;..\..\Common\DocxFormat\Source\XML\libxml2\XML\include;&quot;../../DesktopEditor/freetype-2.5.2/include&quot;"
AdditionalIncludeDirectories="&quot;../../DesktopEditor/freetype-2.5.2/include&quot;;../../DesktopEditor/xml/build/vs2005"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_MATH_DEFINES;_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"
@ -112,7 +112,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\Common\DocxFormat\Source\XML\libxml2\XML\include;&quot;..\..\DesktopEditor\freetype-2.5.2\include&quot;"
AdditionalIncludeDirectories="&quot;..\..\DesktopEditor\freetype-2.5.2\include&quot;"
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;NODOCX;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;_AVS_PPT_SHAPE_INCLUDE_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;BUILD_CONFIG_FULL_VERSION;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"

View File

@ -33,9 +33,9 @@
#include "OOXMathReader.h"
#include "OOXParagraphReader.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/Math/OMath.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/Math/oMathContent.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/Math/oMathBottomNodes.h"
#include "../../../../Common/DocxFormat/Source/DocxFormat/Math/OMath.h"
#include "../../../../Common/DocxFormat/Source/DocxFormat/Math/oMathContent.h"
#include "../../../../Common/DocxFormat/Source/DocxFormat/Math/oMathBottomNodes.h"
bool OOXMathReader::ParseElement(ReaderParameter oParam , OOX::WritingElement * ooxMath, RtfMathPtr & rtfMath)
{

View File

@ -35,7 +35,7 @@
#include "../RtfMath.h"
#include "../../../Common/DocxFormat/Source/DocxFormat/WritingElement.h"
#include "../../../../Common/DocxFormat/Source/DocxFormat/WritingElement.h"
class OOXMathReader
{

View File

@ -32,12 +32,12 @@
#include "OOXShapeReader.h"
#include "OOXTextItemReader.h"
#include "../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/Shape.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Shape.h"
#include "../../../ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SchemeClr.h"
#include "../../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/Shape.h"
#include "../../../../ASCOfficePPTXFile/PPTXFormat/Logic/SpTree.h"
#include "../../../../ASCOfficePPTXFile/PPTXFormat/Logic/Shape.h"
#include "../../../../ASCOfficePPTXFile/PPTXFormat/Logic/Colors/SchemeClr.h"
#include "../../../ASCOfficeOdfFile/src/odf/svg_parser.h"
#include "../../../../ASCOfficeOdfFile/src/odf/svg_parser.h"
#include <boost/algorithm/string.hpp>
#ifndef RGB

View File

@ -146,7 +146,7 @@ bool OOXWriter::SaveByItemEnd()
if (m_poDocPropsApp)
{
((OOX::CApp*)m_poDocPropsApp)->SetApplication ( L"OnlyOffice" );
((OOX::CApp*)m_poDocPropsApp)->SetAppVersion ( L"4.3" );
((OOX::CApp*)m_poDocPropsApp)->SetAppVersion ( L"5.0" );
((OOX::CApp*)m_poDocPropsApp)->write(pathDocProps + FILE_SEPARATOR_STR + L"app.xml", pathDocProps.GetDirectory(), oContentTypes);

View File

@ -216,7 +216,7 @@ void CTxtXmlFile::CreateDocxEmpty(const std::wstring & _strDirectory, Writers::F
if (pApp)
{
pApp->SetApplication(_T("OnlyOffice"));
pApp->SetAppVersion(_T("4.3000"));
pApp->SetAppVersion(_T("5.0"));
pApp->SetDocSecurity(0);
pApp->SetScaleCrop(false);
pApp->SetLinksUpToDate(false);

View File

@ -43,7 +43,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\Common\DocxFormat\Source\DocxFormat;&quot;D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\DesktopEditor\freetype-2.5.2\include&quot;"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -107,7 +107,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\Common\DocxFormat\Source\DocxFormat;&quot;D:\WORK\AVS\Sources\TeamlabOffice\branches\Docx2DoctConverter\ServerComponents\DesktopEditor\freetype-2.5.2\include&quot;"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;USE_LITE_READER;_USE_XMLLITE_READER_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED"
MinimalRebuild="true"
BasicRuntimeChecks="3"

Some files were not shown because too many files have changed in this diff Show More