Compare commits

..

38 Commits

Author SHA1 Message Date
2d219d5a74 PptxFormat - fix bug #40690 2019-02-22 16:44:47 +03:00
9d30e3ecab XlsxFormat - connections & query tables 2019-02-22 16:44:06 +03:00
c6de9b9e52 [x2t] Add GradientFill to Editor.bin 2019-02-22 16:04:40 +03:00
affc65c679 [ios][x2t] up formats 2019-02-21 17:34:38 +03:00
2cff8d9804 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-02-21 14:58:47 +03:00
28f8de794f . 2019-02-21 14:58:36 +03:00
daac90f8dc OdfFormatWriter - fix bullet char 2019-02-21 14:57:11 +03:00
30adbb0a24 . 2019-02-21 14:53:21 +03:00
94e59cfc82 [ios][x2t] up formats 2019-02-20 18:59:27 +03:00
9794d714d3 OdfFormat -fix table content 2019-02-20 16:07:37 +03:00
8d80005bab . 2019-02-19 19:46:37 +03:00
a4d22be862 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2019-02-19 14:26:12 +03:00
3f615c2ece XlsxFormat - condit.format ext with dxf 2019-02-19 14:24:47 +03:00
95e1a1edf9 [x2t] Fix typo 2019-02-19 12:06:13 +03:00
f7f9346286 Enable curl/wget external downloaders in linux/ (remove dependency to libcurl by default) 2019-02-19 11:35:56 +03:00
c0c6baf636 XlsxFormat - read/write iconSet ext 2019-02-18 19:24:00 +03:00
ccbc044f11 . 2019-02-18 17:38:05 +03:00
a8668df5fd XlsxFormat - read/write dataBar ext 2019-02-18 12:52:55 +03:00
cc228f3393 XlsxFormat - read/write ext conditional formating 2019-02-18 11:25:09 +03:00
19904acd30 XlsFormat - fix bug #40601 2019-02-15 18:02:02 +03:00
30d175144a . 2019-02-15 11:14:23 +03:00
acf15abe41 XlsxFormat - add threaded comments 2019-02-13 18:38:25 +03:00
5a7fc7f548 Skip build error for tests 2019-02-13 16:11:50 +03:00
e7326556e0 PptFormat - fix bug #40393 2019-02-13 14:29:21 +03:00
c589d8fe8a [ios][x2t] up formats 2019-02-13 13:59:04 +03:00
a28e8f1357 [ios][x2t] up formats 2019-02-13 13:48:07 +03:00
8b7bb944bc Rework GM_Compatible mode, fix bug with flipped images, fix bug with storing matrix transform for the clip 2019-02-12 17:51:05 +03:00
14ee946069 . 2019-02-12 17:30:58 +03:00
7aebdd8ec5 . 2019-02-12 17:15:07 +03:00
977baafc03 x2t - fix bug #40531 2019-02-12 16:22:41 +03:00
31b854bc70 [x2t] Add decimalSymbol, listSeparator to Editor.bin 2019-02-12 12:20:47 +03:00
e274dc50d7 [x2t] Save comment to document and to text into different files(docx) 2019-02-11 20:11:50 +03:00
d153db627b [ios][x2t] up formats 2019-02-11 19:09:33 +03:00
9cc6bc14c5 [ios][x2t] up formats 2019-02-11 18:36:35 +03:00
775c57be5d . 2019-02-11 17:26:05 +03:00
da37aeb039 . 2019-02-11 17:13:19 +03:00
751c6647a2 OdfFormatWrite - write templates 2019-02-11 15:05:44 +03:00
ec2344ccd5 OdfFormat - fix bug #40149 2019-02-10 16:02:20 +03:00
124 changed files with 8554 additions and 2795 deletions

View File

@ -33,6 +33,7 @@
#define COMMENTS_WRITER
#include "../../XlsxSerializerCom/Common/Common.h"
#include "../../Common/DocxFormat/Source/DocxFormat/FileTypes.h"
namespace Writers
{
@ -50,21 +51,28 @@ namespace Writers
std::wstring m_sComment;
std::wstring m_sCommentExt;
std::wstring m_sPeople;
std::wstring m_sDocumentComment;
std::wstring m_sDocumentCommentExt;
std::wstring m_sDocumentPeople;
CommentsWriter(std::wstring sDir) : m_sDir(sDir)
{
}
void setElements(std::wstring& sComment, std::wstring& sCommentExt, std::wstring& sPeople)
void setElements(std::wstring& sComment, std::wstring& sCommentExt, std::wstring& sPeople, std::wstring& sDocumentComment, std::wstring& sDocumentCommentExt, std::wstring& sDocumentPeople)
{
m_sComment = sComment;
m_sCommentExt = sCommentExt;
m_sPeople = sPeople;
m_sDocumentComment = sDocumentComment;
m_sDocumentCommentExt = sDocumentCommentExt;
m_sDocumentPeople = sDocumentPeople;
}
void Write()
{
std::wstring sDir = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR;
if(false == m_sComment.empty())
{
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("comments.xml");
OOX::CPath filePath = sDir + OOX::FileTypes::Comments.DefaultFileName().GetPath();
NSFile::CFileBinary oFile;
oFile.CreateFileW(filePath.GetPath());
@ -76,7 +84,7 @@ namespace Writers
if(false == m_sCommentExt.empty())
{
NSFile::CFileBinary oFile;
oFile.CreateFileW(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("commentsExtended.xml"));
oFile.CreateFileW(sDir + OOX::FileTypes::CommentsExt.DefaultFileName().GetPath());
oFile.WriteStringUTF8(g_string_commentExt_Start);
oFile.WriteStringUTF8(m_sCommentExt);
oFile.WriteStringUTF8(g_string_commentExt_End);
@ -85,12 +93,43 @@ namespace Writers
if(false == m_sPeople.empty())
{
NSFile::CFileBinary oFile;
oFile.CreateFileW(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("people.xml"));
oFile.CreateFileW(sDir + OOX::FileTypes::People.DefaultFileName().GetPath());
oFile.WriteStringUTF8(g_string_people_Start);
oFile.WriteStringUTF8(m_sPeople);
oFile.WriteStringUTF8(g_string_people_End);
oFile.CloseFile();
}
if(false == m_sDocumentComment.empty())
{
OOX::CPath filePath = sDir + OOX::FileTypes::DocumentComments.DefaultFileName().GetPath();
NSFile::CFileBinary oFile;
oFile.CreateFileW(filePath.GetPath());
oFile.WriteStringUTF8(g_string_comment_Start);
oFile.WriteStringUTF8(m_sDocumentComment);
oFile.WriteStringUTF8(g_string_comment_End);
oFile.CloseFile();
}
if(false == m_sDocumentCommentExt.empty())
{
NSFile::CFileBinary oFile;
oFile.CreateFileW(sDir + OOX::FileTypes::DocumentCommentsExt.DefaultFileName().GetPath());
oFile.WriteStringUTF8(g_string_commentExt_Start);
oFile.WriteStringUTF8(m_sDocumentCommentExt);
oFile.WriteStringUTF8(g_string_commentExt_End);
oFile.CloseFile();
}
if(false == m_sDocumentPeople.empty())
{
NSFile::CFileBinary oFile;
oFile.CreateFileW(sDir + OOX::FileTypes::DocumentPeople.DefaultFileName().GetPath());
oFile.WriteStringUTF8(g_string_people_Start);
oFile.WriteStringUTF8(m_sDocumentPeople);
oFile.WriteStringUTF8(g_string_people_End);
oFile.CloseFile();
}
}
};
}

View File

@ -3486,6 +3486,16 @@ public:
READ1_DEF(length, res, this->ReadEndnotePr, &oEdnProps);
m_oFileWriter.m_oSettingWriter.AddSetting(oEdnProps.toXML());
}
else if( c_oSer_SettingsType::DecimalSymbol == type )
{
std::wstring sDecimalSymbol = m_oBufferedStream.GetString3(length);
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:decimalSymbol w:val=\"" + XmlUtils::EncodeXmlString(sDecimalSymbol) + L"\"/>");
}
else if( c_oSer_SettingsType::ListSeparator == type )
{
std::wstring sListSeparator = m_oBufferedStream.GetString3(length);
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:listSeparator w:val=\"" + XmlUtils::EncodeXmlString(sListSeparator) + L"\"/>");
}
else if( c_oSer_SettingsType::SdtGlobalColor == type )
{
rPr oRPr(m_oFileWriter.m_oFontTableWriter.m_mapFonts);
@ -8703,6 +8713,7 @@ public:
long nSettingsOffset = -1;
long nDocumentOffset = -1;
long nCommentsOffset = -1;
long nDocumentCommentsOffset = -1;
std::vector<BYTE> aTypes;
std::vector<long> aOffBits;
@ -8737,6 +8748,10 @@ public:
{
nCommentsOffset = mtiOffBits;
}
else if(c_oSerTableTypes::DocumentComments == mtiType)
{
nDocumentCommentsOffset = mtiOffBits;
}
else
{
aTypes.push_back(mtiType);
@ -8786,6 +8801,15 @@ public:
if(c_oSerConstants::ReadOk != res)
return res;
}
Binary_CommentsTableReader oBinary_DocumentCommentsTableReader(m_oBufferedStream, m_oFileWriter);
if(-1 != nDocumentCommentsOffset)
{
int nOldPos = m_oBufferedStream.GetPos();
m_oBufferedStream.Seek(nDocumentCommentsOffset);
res = oBinary_DocumentCommentsTableReader.Read();
if(c_oSerConstants::ReadOk != res)
return res;
}
for(size_t i = 0; i < aTypes.size(); ++i)
{
@ -8936,6 +8960,7 @@ public:
+ FILE_SEPARATOR_STR + L"_rels"
+ FILE_SEPARATOR_STR + L"document.xml.rels";
//comments
CComments& oComments= oBinary_CommentsTableReader.m_oComments;
Writers::CommentsWriter& oCommentsWriter = m_oFileWriter.m_oCommentsWriter;
@ -8943,25 +8968,47 @@ public:
std::wstring sContentEx = oComments.writeContentExt(); //важно чтобы writeContentExt вызывался после writeContent
std::wstring sPeople = oComments.writePeople();
oCommentsWriter.setElements(sContent, sContentEx, sPeople);
std::wstring sDocumentContent = oBinary_DocumentCommentsTableReader.m_oComments.writeContent();
std::wstring sDocumentContentEx = oBinary_DocumentCommentsTableReader.m_oComments.writeContentExt(); //важно чтобы writeContentExt вызывался после writeContent
std::wstring sDocumentPeople = oBinary_DocumentCommentsTableReader.m_oComments.writePeople();
oCommentsWriter.setElements(sContent, sContentEx, sPeople, sDocumentContent, sDocumentContentEx, sDocumentPeople);
if(false == oCommentsWriter.m_sComment.empty())
{
unsigned int 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");
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::Comments.RelationType(), OOX::FileTypes::Comments.DefaultFileName().GetPath(), std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->Registration(OOX::FileTypes::Comments.OverrideType(), L"/word", OOX::FileTypes::Comments.DefaultFileName().GetPath());
}
if(false == oCommentsWriter.m_sCommentExt.empty())
{
unsigned int 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");
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::CommentsExt.RelationType(), OOX::FileTypes::CommentsExt.DefaultFileName().GetPath(), std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->Registration(OOX::FileTypes::CommentsExt.OverrideType(), L"/word", OOX::FileTypes::CommentsExt.DefaultFileName().GetPath());
}
if(false == oCommentsWriter.m_sPeople.empty())
{
unsigned int 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");
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::People.RelationType(), OOX::FileTypes::People.DefaultFileName().GetPath(), std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->Registration(OOX::FileTypes::People.OverrideType(), L"/word", OOX::FileTypes::People.DefaultFileName().GetPath());
}
if(false == oCommentsWriter.m_sDocumentComment.empty())
{
unsigned int rId;
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::DocumentComments.RelationType(), OOX::FileTypes::DocumentComments.DefaultFileName().GetPath(), std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->Registration(OOX::FileTypes::DocumentComments.OverrideType(), L"/word", OOX::FileTypes::DocumentComments.DefaultFileName().GetPath());
}
if(false == oCommentsWriter.m_sDocumentCommentExt.empty())
{
unsigned int rId;
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::DocumentCommentsExt.RelationType(), OOX::FileTypes::DocumentCommentsExt.DefaultFileName().GetPath(), std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->Registration(OOX::FileTypes::DocumentCommentsExt.OverrideType(), L"/word", OOX::FileTypes::DocumentCommentsExt.DefaultFileName().GetPath());
}
if(false == oCommentsWriter.m_sDocumentPeople.empty())
{
unsigned int rId;
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::DocumentPeople.RelationType(), OOX::FileTypes::DocumentPeople.DefaultFileName().GetPath(), std::wstring(), &rId);
m_oFileWriter.m_pDrawingConverter->Registration(OOX::FileTypes::DocumentPeople.OverrideType(), L"/word", OOX::FileTypes::DocumentPeople.DefaultFileName().GetPath());
}
m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(fileRelsPath.GetPath());

View File

@ -37,7 +37,7 @@
namespace Writers
{
static std::wstring g_string_set_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><w:settings xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\">");
static std::wstring g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:compat><w:compatSetting w:name=\"compatibilityMode\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"15\"/><w:compatSetting w:name=\"overrideTableStyleFontSizeAndJustification\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"enableOpenTypeFeatures\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"doNotFlipMirrorIndents\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/></w:compat><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults><w:decimalSymbol w:val=\".\"/><w:listSeparator w:val=\",\"/>");
static std::wstring g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:compat><w:compatSetting w:name=\"compatibilityMode\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"15\"/><w:compatSetting w:name=\"overrideTableStyleFontSizeAndJustification\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"enableOpenTypeFeatures\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"doNotFlipMirrorIndents\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/></w:compat><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults>");
static std::wstring g_string_set_End = _T("</w:settings>");
class SettingWriter

View File

@ -146,7 +146,8 @@ extern int g_nCurFormatVersion;
Background = 12,
VbaProject = 13,
App = 15,
Core = 16
Core = 16,
DocumentComments = 17
};}
namespace c_oSerSigTypes{enum c_oSerSigTypes
{
@ -809,7 +810,9 @@ extern int g_nCurFormatVersion;
SdtGlobalColor = 6,
SdtGlobalShowHighlight = 7,
Compat = 8,
DefaultTabStopTwips = 9
DefaultTabStopTwips = 9,
DecimalSymbol = 10,
ListSeparator = 11
};}
namespace c_oSer_MathPrType{enum c_oSer_SettingsType
{

View File

@ -7535,6 +7535,18 @@ namespace BinDocxRW
WriteCompat(oSettings.m_oCompat.get());
m_oBcw.WriteItemEnd(nCurPos);
}
if(oSettings.m_oDecimalSymbol.IsInit() && oSettings.m_oDecimalSymbol->m_sVal.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::DecimalSymbol);
m_oBcw.m_oStream.WriteStringW3(oSettings.m_oDecimalSymbol->m_sVal.get());
m_oBcw.WriteItemEnd(nCurPos);
}
if(oSettings.m_oListSeparator.IsInit() && oSettings.m_oListSeparator->m_sVal.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::ListSeparator);
m_oBcw.m_oStream.WriteStringW3(oSettings.m_oListSeparator->m_sVal.get());
m_oBcw.WriteItemEnd(nCurPos);
}
if(oSettingsCustom.m_oSdtGlobalColor.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::SdtGlobalColor);
@ -8081,6 +8093,13 @@ namespace BinDocxRW
oBinaryCommentsTableWriter.Write(*oDocx.m_pComments, oDocx.m_pCommentsExt, oDocx.m_pPeople, m_oParamsWriter.m_mapIgnoreComments);
this->WriteTableEnd(nCurPos);
}
if(NULL != oDocx.m_pDocumentComments)
{
BinDocxRW::BinaryCommentsTableWriter oBinaryCommentsTableWriter(m_oParamsWriter);
int nCurPos = this->WriteTableStart(BinDocxRW::c_oSerTableTypes::DocumentComments);
oBinaryCommentsTableWriter.Write(*oDocx.m_pDocumentComments, oDocx.m_pDocumentCommentsExt, oDocx.m_pDocumentPeople, m_oParamsWriter.m_mapIgnoreComments);
this->WriteTableEnd(nCurPos);
}
//Write StyleTable
BinDocxRW::BinaryStyleTableWriter oBinaryStyleTableWriter(m_oParamsWriter);

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -14,8 +14,8 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17E17EDB1AC453F800BEA2EA"
BuildableName = "libASCOfficeDocxFile2Lib.a"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
@ -23,27 +23,30 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17E17EDB1AC453F800BEA2EA"
BuildableName = "libASCOfficeDocxFile2Lib.a"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>
@ -52,16 +55,16 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17E17EDB1AC453F800BEA2EA"
BuildableName = "libASCOfficeDocxFile2Lib.a"
BlueprintIdentifier = "17C1FE921ACC42C4006B99B3"
BuildableName = "libASCOfficeDocxFile2Lib_ios.a"
BlueprintName = "ASCOfficeDocxFile2Lib"
ReferencedContainer = "container:ASCOfficeDocxFile2Lib.xcodeproj">
</BuildableReference>

View File

@ -146,6 +146,7 @@ docx_conversion_context::docx_conversion_context(odf_reader::odf_document * OdfD
process_note_ (noNote),
new_list_style_number_ (0),
current_margin_left_ (0),
current_outline_level_ (-1),
is_rtl_ (false),
is_delete_text_ (false),
delayed_converting_ (false),
@ -369,6 +370,9 @@ void docx_conversion_context::start_index_content()
sInstrText += L" \\n "+ std::to_wstring(table_content_context_.min_outline_level) + L"-" +
std::to_wstring(table_content_context_.max_outline_level);
}
else if (table_content_context_.type_table_content == 1)
sInstrText += L" \\o";
if (false == table_content_context_.outline_level_styles.empty())
{
sInstrText += L" \\t \"";
@ -933,8 +937,8 @@ mc:Ignorable=\"w14 wp14\">";
for (size_t i = 0; i < numIds.size(); i++)
{
strm << L"<w:num w:numId=\"" << numIds[i] << L"\" >";
strm << L"<w:abstractNumId w:val=\"" << numIds[i] << "\" />";
strm << L"<w:num w:numId=\"" << numIds[i] << L"\">";
strm << L"<w:abstractNumId w:val=\"" << numIds[i] << "\"/>";
strm << L"</w:num>";
}
@ -960,19 +964,19 @@ void docx_conversion_context::process_fonts()
if (!arFonts[i]) continue;
if (arFonts[i]->name().empty()) continue;
strm << L"<w:font w:name=\"" << arFonts[i]->name() << L"\" >";
strm << L"<w:font w:name=\"" << arFonts[i]->name() << L"\">";
if (!arFonts[i]->charset().empty())
strm << L"<w:charset w:val=\"" << arFonts[i]->charset() <<"\" />";
strm << L"<w:charset w:val=\"" << arFonts[i]->charset() <<"\"/>";
if (!arFonts[i]->family().empty())
strm << L"<w:family w:val=\"" << arFonts[i]->family() << "\" />";
strm << L"<w:family w:val=\"" << arFonts[i]->family() << "\"/>";
if (!arFonts[i]->pitch().empty())
strm << L"<w:pitch w:val=\"" << arFonts[i]->pitch() << "\" />";
strm << L"<w:pitch w:val=\"" << arFonts[i]->pitch() << "\"/>";
if (!arFonts[i]->alt_name().empty())
strm << L"<w:altName w:val=\"" << arFonts[i]->alt_name() << "\" />";
strm << L"<w:altName w:val=\"" << arFonts[i]->alt_name() << "\"/>";
strm << L"</w:font>";
}
@ -995,7 +999,7 @@ void docx_conversion_context::process_styles()
_Wostream << L"xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" ";
_Wostream << L"xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" ";
_Wostream << L"xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" ";
_Wostream << L"mc:Ignorable=\"w14\"> ";
_Wostream << L"mc:Ignorable=\"w14\">";
if (odf_reader::odf_document * doc = root())
{
@ -1067,28 +1071,32 @@ void docx_conversion_context::process_styles()
const std::wstring displayName = StyleDisplayName(arStyles[i]->name(), arStyles[i]->display_name(), arStyles[i]->type());
_Wostream << L"<w:name w:val=\"" << displayName << L"\" />";
_Wostream << L"<w:name w:val=\"" << displayName << L"\"/>";
if (odf_reader::style_instance * baseOn = arStyles[i]->parent())
{
const std::wstring basedOnId = styles_map_.get(baseOn->name(), baseOn->type());
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\" />";
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\"/>";
}
else if (!arStyles[i]->is_default() && styles_map_.check(L"", arStyles[i]->type()))
{
const std::wstring basedOnId = styles_map_.get(L"", arStyles[i]->type());
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\" />";
_Wostream << L"<w:basedOn w:val=\"" << basedOnId << "\"/>";
}
else
{
_Wostream << L"<w:qFormat/>";
}
if (odf_reader::style_instance * next = arStyles[i]->next())
{
const std::wstring nextId = styles_map_.get(next->name(), next->type());
_Wostream << L"<w:next w:val=\"" << nextId << "\" />";
_Wostream << L"<w:next w:val=\"" << nextId << "\"/>";
}
else if (arStyles[i]->is_default())
{
// self
_Wostream << L"<w:next w:val=\"" << id << "\" />";
_Wostream << L"<w:next w:val=\"" << id << "\"/>";
}
if (odf_reader::style_content * content = arStyles[i]->content())
@ -1337,6 +1345,7 @@ void docx_conversion_context::end_automatic_style()
in_automatic_style_ = false;
automatic_parent_style_.clear();
tabs_context_.clear();
current_outline_level_ = -1;
}
bool docx_conversion_context::in_automatic_style()
@ -1597,13 +1606,12 @@ int docx_conversion_context::process_paragraph_attr(odf_reader::text::paragraph_
}
}
set_margin_left(properties.fo_margin_left_? 20.0 * properties.fo_margin_left_->get_length().get_value_unit(odf_types::length::pt) : 0);
styleContent->docx_convert(*this);
if ((Attr->outline_level_) && (*Attr->outline_level_ > 0))
{
std::wstringstream & _pPr = get_styles_context().paragraph_nodes();
_pPr << L"<w:outlineLvl w:val=\"" << *Attr->outline_level_ - 1 << L"\"/>";
}
set_outline_level(*Attr->outline_level_ - 1);
}
styleContent->docx_convert(*this);
end_automatic_style();
push_text_properties(styleContent->get_style_text_properties());

View File

@ -916,6 +916,9 @@ public:
void set_margin_left(int val) {current_margin_left_ = val;}
int get_margin_left() {return current_margin_left_;}
void set_outline_level(int val) {current_outline_level_ = val;}
int get_outline_level() {return current_outline_level_;}
void set_process_note (NoteType Val) { process_note_ = Val; }
NoteType get_process_note () const { return process_note_; }
void add_note_reference ();
@ -1031,6 +1034,7 @@ private:
std::wstring current_alphabetic_index_;
int current_margin_left_;
int current_outline_level_;
int new_list_style_number_; // счетчик для нумерации имен созданных в процессе конвертации стилей
NoteType process_note_;

View File

@ -123,16 +123,17 @@ public:
if (sExt == L"wmv") return typeVideo;
if (sExt == L"avi") return typeVideo;
if (sExt == L"wmv") return typeVideo;
if (sExt == L"wma") return typeAudio;
if (sExt == L"wav") return typeAudio;
if (sExt == L"mp3") return typeAudio;
if (sExt == L"m4a") return typeAudio;
if (sExt == L"m4v") return typeVideo;
if (sExt == L"mp4") return typeVideo;
if (sExt == L"mov") return typeVideo;
if (sExt == L"mkv") return typeVideo;
if (sExt == L"webm") return typeVideo;
if (sExt == L"wmv") return typeVideo;
if (sExt == L"wma") return typeAudio;
if (sExt == L"wav") return typeAudio;
if (sExt == L"mp3") return typeAudio;
if (sExt == L"m4a") return typeAudio;
return typeMedia;
}

View File

@ -375,7 +375,7 @@ void _oox_drawing::serialize_bodyPr(std::wostream & strm, const std::wstring & n
{
CP_XML_NODE(L"a:spAutoFit");
}
else if ((bFitToSize) && (*bFitToSize))
if ((bFitToSize) && (*bFitToSize))
{
CP_XML_NODE(L"a:normAutofit");
//{

View File

@ -75,6 +75,7 @@ static std::wstring get_mime_type(const std::wstring & extension)
else if (L"tiff" == extension) return L"image/x-tiff";
else if (L"pdf" == extension) return L"application/pdf";
else if (L"bmp" == extension) return L"image/bmp";
else if (L"wdp" == extension) return L"image/vnd.ms-photo";
else if (L"wav" == extension) return L"audio/wav";
else if (L"mp3" == extension) return L"audio/mpeg";

View File

@ -145,8 +145,11 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
{
style_instance * defaultStyle = Context.root()->odf_context().styleContainer().style_default_by_type(odf_types::style_family::Presentation);
if (defaultStyle)instances.push_back(defaultStyle);
instances.push_back(baseStyleInst);
instances.push_back(baseStyleInst);
}
else if (common_presentation_attlist_.presentation_class_)
{
instances.push_back(baseStyleInst);
}
if (grStyleInst)//обычная векторная фигура
{

View File

@ -56,6 +56,7 @@ void graphic_format_properties::add_attributes( const xml::attributes_wc_ptr & A
CP_APPLY_ATTR(L"draw:fit-to-size", draw_fit_to_size_);
CP_APPLY_ATTR(L"draw:fit-to-contour", draw_fit_to_contour_);
CP_APPLY_ATTR(L"style:shrink-to-fit", style_shrink_to_fit_);
CP_APPLY_ATTR(L"draw:fit-to-size", draw_fit_to_size_str_);
CP_APPLY_ATTR(L"draw:stroke", draw_stroke_);
CP_APPLY_ATTR(L"draw:stroke-dash", draw_stroke_dash_);
@ -100,7 +101,12 @@ void graphic_format_properties::add_attributes( const xml::attributes_wc_ptr & A
common_padding_attlist_.add_attributes(Attributes);
common_shadow_attlist_.add_attributes(Attributes);
common_background_color_attlist_.add_attributes(Attributes);
if (draw_fit_to_size_str_ && !style_shrink_to_fit_)
{//https://bugs.documentfoundation.org/show_bug.cgi?id=97630
if (*draw_fit_to_size_str_ == L"shrink-to-fit")
style_shrink_to_fit_ = true;
}
}
void graphic_format_properties::apply_to(std::vector<_property> & properties)

View File

@ -95,6 +95,7 @@ public:
_CP_OPT(bool) draw_auto_grow_width_;
_CP_OPT(bool) style_shrink_to_fit_;
_CP_OPT(std::wstring) draw_fit_to_size_str_;
_CP_OPT(bool) draw_fit_to_size_; // draw:fit-to-size="shrink-to-fit" style:shrink-to-fit="true" - cebre_1.odp
_CP_OPT(bool) draw_fit_to_contour_;
_CP_OPT(std::wstring) draw_wrap_influence_on_position_;

View File

@ -159,6 +159,12 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
{
_pPr << L"<w:bidi/>";
}
int level = Context.get_outline_level();
if (level >= 0)
{
_pPr << L"<w:outlineLvl w:val=\"" << level << L"\"/>";
}
if (fo_text_align_)
{

View File

@ -65,18 +65,28 @@ HRESULT convert_single(std::wstring srcFileName)
std::wstring dstPath = srcFileName;// + ....
bool bTemplate = false;
std::wstring type;
switch(fileChecker.nFileType)
{
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX:
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCM: dstPath += L"-my.odt"; type = L"text"; break;
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTX:
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOTM: dstPath += L"-my.ott"; type = L"text"; bTemplate = true; break;
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX:
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSM: dstPath += L"-my.ods"; type = L"spreadsheet"; break;
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTX:
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLTM: dstPath += L"-my.ots"; type = L"spreadsheet"; bTemplate = true; break;
case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX:
case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTM: dstPath += L"-my.odp"; type = L"presentation"; break;
case AVS_OFFICESTUDIO_FILE_PRESENTATION_POTX:
case AVS_OFFICESTUDIO_FILE_PRESENTATION_POTM: dstPath += L"-my.otp"; type = L"presentation"; bTemplate = true; break;
default:
return S_FALSE;
}
@ -94,7 +104,7 @@ HRESULT convert_single(std::wstring srcFileName)
if (S_OK != oCOfficeUtils.ExtractToDirectory(srcFileName.c_str(), srcTempPath.c_str(), NULL, 0))
return S_FALSE;
Oox2Odf::Converter converter(srcTempPath, type, L"C:\\Windows\\Fonts", NULL);
Oox2Odf::Converter converter(srcTempPath, type, L"C:\\Windows\\Fonts", bTemplate);
std::wstring sPassword;// = L"password";

View File

@ -123,9 +123,9 @@ namespace odf_writer
rels_.add(r.relationships_[i]);
}
}
manifect_file::manifect_file(std::wstring t)
manifect_file::manifect_file(const std::wstring & type)
{
type_ = t;
type_ = type;
}
binary_file::binary_file(const std::wstring &file_name, const std::string &value)
{
@ -137,9 +137,9 @@ namespace odf_writer
simple_element elm(file_name_, value_);
elm.write(RootPath, false);
}
mimetype_file::mimetype_file(std::wstring t)
mimetype_file::mimetype_file(const std::wstring & type)
{
type_ = t;
type_ = type;
}
void mimetype_file::write(const std::wstring & RootPath, bool add_padding)
{
@ -316,11 +316,17 @@ namespace odf_writer
set_rels(rels_);
}
odf_document::odf_document(std::wstring type)
odf_document::odf_document(std::wstring type, bool bTemplate)
{
manifest_ = element_ptr(new manifect_file(type));
mimetype_ = element_ptr(new mimetype_file(type));
manifest_ = element_ptr(new manifect_file(type + (bTemplate ? L"-template" : L"")));
mimetype_ = element_ptr(new mimetype_file(type + (bTemplate ? L"-template" : L"")));
}
std::wstring odf_document::get_type()
{
return dynamic_cast<manifect_file*>(manifest_.get())->get_type();
}
void odf_document::write_manifest(const std::wstring & RootPath)
{
if (mimetype_)

View File

@ -91,8 +91,6 @@ namespace odf_writer
virtual void write(const std::wstring & RootPath, bool add_padding = false) = 0;
std::wstring local_path;
private:
element * element_;
};
inline element::~element()
@ -151,11 +149,13 @@ namespace odf_writer
class manifect_file : public element
{
public:
manifect_file(std::wstring type);
manifect_file(const std::wstring & type);
virtual void write(const std::wstring & RootPath, bool add_padding = false);
void add_rels(rels & r);
std::wstring get_type() {return type_;}
rels *get_rels() {return &rels_;}
private:
@ -178,7 +178,7 @@ namespace odf_writer
class mimetype_file : public element
{
public:
mimetype_file(std::wstring type);
mimetype_file(const std::wstring & type);
virtual void write(const std::wstring & RootPath, bool add_padding = false);
@ -201,7 +201,7 @@ namespace odf_writer
class object_files : public element
{
public:
object_files(){}
object_files() {}
void set_content (content_content_ptr & _content);
@ -227,14 +227,16 @@ namespace odf_writer
class odf_document : public element
{
public:
odf_document(std::wstring type);
odf_document(std::wstring type, bool bTemplate);
void add_object(element_ptr _object,bool root = false);
void add_binary(const std::wstring &file_name, const std::string &value);
void set_rels(rels & r);
std::wstring get_type();
virtual void write(const std::wstring & RootPath, bool add_padding = false);
virtual void write(const std::wstring & RootPath, bool add_padding);
void write_manifest(const std::wstring & RootPath);
manifect_file* get_manifest() {return dynamic_cast<manifect_file*>(manifest_.get());}

View File

@ -163,8 +163,15 @@ void odf_conversion_context::end_document()
rels_.add(relationship(std::wstring(L"text/xml"), object_files->local_path + L"meta.xml"));
rels_.add(relationship(std::wstring(L"text/xml"), object_files->local_path + L"settings.xml"));
if (isRoot)object_files->local_path = L"/";
rels_.add(relationship(std::wstring(L"application/vnd.oasis.opendocument.") + object.content->get_name(), object_files->local_path));
if (isRoot)
{
object_files->local_path = L"/";
rels_.add(relationship(std::wstring(L"application/vnd.oasis.opendocument.") + output_document_->get_type(), object_files->local_path));
}
else
{
rels_.add(relationship(std::wstring(L"application/vnd.oasis.opendocument.") + object.content->get_name(), object_files->local_path));
}
output_document_->add_object(package::element_ptr(object_files), isRoot);
}

View File

@ -452,7 +452,7 @@ wchar_t convert_bullet_char(wchar_t c)
switch(c)
{
case L'\xf075': res = L'\xE00C';; break;
case L'\xf0A7': res = L'\xE00A'; break;
//case L'\xf0A7': res = L'\xE00A'; break;
case L'\xf0FE': res = L'\x2611'; break;
case L'\xf0B7': res = L'\x25CF'; break;
case L'\xf0D8': res = L'\x27A2'; break;
@ -546,8 +546,10 @@ void odf_lists_styles_context::set_bullet_char(std::wstring val)
text_list_level_style_bullet *style_bullet_ = dynamic_cast<text_list_level_style_bullet *>(lists_format_array_.back().elements.back().get());
if (style_bullet_ == NULL) return;
wchar_t char_ = convert_bullet_char(val.at(0));
style_bullet_->text_list_level_style_bullet_attr_.text_bullet_char_ = char_;
style_bullet_->text_list_level_style_bullet_attr_.text_bullet_char_ = val;//char_;
}
void odf_lists_styles_context::set_bullet_image_size(double size)
{

View File

@ -63,7 +63,7 @@ odf_text_context::odf_text_context(odf_conversion_context *odf_context, odf_styl
paragraph_properties_ = NULL;
text_properties_ = NULL;
current_outline_ = 0;
current_outline_ = -1;
in_field_ = false;
keep_next_paragraph_ = false;
list_state_.started_list = false;
@ -78,7 +78,7 @@ void odf_text_context::clear_params()
paragraph_properties_ = NULL;
text_properties_ = NULL;
current_outline_ = 0;
current_outline_ = -1;
in_field_ = false;
keep_next_paragraph_ = false;
@ -208,7 +208,7 @@ void odf_text_context::set_symbol_text(int sym)
void odf_text_context::start_paragraph(bool styled)
{
office_element_ptr paragr_elm;
if (current_outline_ > 0)
if (current_outline_ >= 0)
{
create_element(L"text", L"h", paragr_elm, odf_context_);
@ -219,7 +219,7 @@ void odf_text_context::start_paragraph(bool styled)
{
create_element(L"text", L"p", paragr_elm, odf_context_);
}
current_outline_ = 0;
current_outline_ = -1;
start_paragraph(paragr_elm, styled);

View File

@ -63,7 +63,7 @@ void text_list_level_style_bullet_attr::serialize(CP_ATTR_NODE)
CP_XML_ATTR_OPT(L"text:bullet-char", text_bullet_char_);
CP_XML_ATTR_OPT(L"text:bullet-relative-size", text_bullet_relative_size_);
common_num_format_prefix_suffix_attlist_.serialize(CP_GET_XML_NODE());
prefix_suffix_attlist_.serialize(CP_GET_XML_NODE());
}
void text_list_level_style_attr::serialize(CP_ATTR_NODE)
{

View File

@ -199,21 +199,22 @@ public:
CP_REGISTER_OFFICE_ELEMENT2(text_list_level_style_number);
/// text-list-level-style-bullet-attr
// text:list-level-style-bullet-attr
class text_list_level_style_bullet_attr
{
public:
_CP_OPT(std::wstring) text_style_name_;
_CP_OPT(wchar_t) text_bullet_char_;
_CP_OPT(odf_types::percent) text_bullet_relative_size_;
//_CP_OPT(wchar_t) text_bullet_char_;
_CP_OPT(std::wstring) text_bullet_char_;
_CP_OPT(odf_types::percent) text_bullet_relative_size_;
odf_types::common_num_format_prefix_suffix_attlist common_num_format_prefix_suffix_attlist_;
odf_types::common_num_format_prefix_suffix_attlist prefix_suffix_attlist_;
void serialize(CP_ATTR_NODE);
};
/// text:list-level-style-bullet
// text:list-level-style-bullet
class text_list_level_style_bullet : public office_element_impl<text_list_level_style_bullet>
{
public:

View File

@ -70,23 +70,17 @@
#include "../../../DesktopEditor/common/Directory.h"
#include "../../../DesktopEditor/common/SystemUtils.h"
#define PROGRESSEVENT_ID 0
using namespace cpdoccore;
namespace Oox2Odf
{
static double pt2emu(double Val)
{
return (Val * 360000 * 2.54) / 72;
}
Converter::Converter(const std::wstring & path, const std::wstring & type, const std::wstring & fontsPath, const ProgressCallback* CallBack)
Converter::Converter(const std::wstring & path, const std::wstring & type, const std::wstring & fontsPath, bool bTemplate)
{
impl_ = NULL;
if (type == _T("text")) impl_ = new DocxConverter(path, CallBack);
if (type == _T("spreadsheet")) impl_ = new XlsxConverter(path, CallBack);
if (type == _T("presentation")) impl_ = new PptxConverter(path, CallBack);
if (type == _T("text")) impl_ = new DocxConverter(path, bTemplate);
if (type == _T("spreadsheet")) impl_ = new XlsxConverter(path, bTemplate);
if (type == _T("presentation")) impl_ = new PptxConverter(path, bTemplate);
if (impl_)
impl_->set_fonts_directory(fontsPath);
@ -100,36 +94,16 @@ namespace Oox2Odf
void Converter::convert()
{
if (!impl_)return;
if (impl_->bUserStopConvert) return;
impl_->convertDocument();
}
void Converter::write(const std::wstring & out_path, const std::wstring & temp_path, const std::wstring & password, const std::wstring & documentID) const
{
if (!impl_)return;
if (impl_->bUserStopConvert) return;
return impl_->write(out_path, temp_path, password, documentID);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool OoxConverter::UpdateProgress(long nComplete)
{
if (pCallBack)
{
pCallBack->OnProgress (pCallBack->caller, PROGRESSEVENT_ID, nComplete);
bUserStopConvert = 0;
pCallBack->OnProgressEx (pCallBack->caller, PROGRESSEVENT_ID, nComplete, &bUserStopConvert);
if (bUserStopConvert !=0 ) return TRUE;
}
return FALSE;
}
void OoxConverter::write(const std::wstring & out_path, const std::wstring & temp_path, const std::wstring & password, const std::wstring & documentID)
{
if (!output_document)return;
@ -141,7 +115,7 @@ void OoxConverter::write(const std::wstring & out_path, const std::wstring & tem
if (password.empty())
{
output_document->write(out_path);
output_document->write(out_path, false);
}
else
{
@ -155,8 +129,6 @@ void OoxConverter::write(const std::wstring & out_path, const std::wstring & tem
NSDirectory::DeleteDirectory(temp_folder);
}
if (UpdateProgress(1000000))return;
}
std::wstring EncodeBase64(const std::string & value)
{

View File

@ -356,19 +356,14 @@ public:
void write(const std::wstring & out_path, const std::wstring & temp_path, const std::wstring & password, const std::wstring & documentID);
OoxConverter(const ProgressCallback* CallBack = NULL){
oox_current_child_document = NULL;
pCallBack = CallBack;
bUserStopConvert = 0;
}
OoxConverter()
{
oox_current_child_document = NULL;
}
virtual ~OoxConverter(){}
void set_fonts_directory (const std::wstring & fontsPath);
const ProgressCallback* pCallBack;
short bUserStopConvert;
bool UpdateProgress(long nComplete);
bool encrypt_document (const std::wstring &password, const std::wstring & srcPath, const std::wstring & dstPath);
bool encrypt_file (const std::wstring &password, const std::wstring & srcPath, const std::wstring & dstPath, std::wstring &encrypt_info, int &size);

View File

@ -103,22 +103,18 @@ namespace Oox2Odf
}
return cols_1 == cols_2;
}
DocxConverter::DocxConverter(const std::wstring & path, const ProgressCallback* CallBack)
DocxConverter::DocxConverter(const std::wstring & path, bool bTemplate)
{
const OOX::CPath oox_path(std::wstring(path.c_str()));
docx_document = new OOX::CDocx(oox_path);
output_document = new odf_writer::package::odf_document(L"text");
output_document = new odf_writer::package::odf_document(L"text", bTemplate);
odt_context = new odf_writer::odt_conversion_context(output_document);
pCallBack = CallBack;
//set flags to default
current_section_properties = NULL;
last_section_properties = NULL;
if (UpdateProgress(290000))return;
}
DocxConverter::~DocxConverter()
{
@ -190,19 +186,14 @@ void DocxConverter::convertDocument()
convert_lists_styles();
convert_styles();
if (UpdateProgress(300000))return;
convert_settings();
convert_document();
if (UpdateProgress(800000))return;
//удалим уже ненужный документ docx
delete docx_document; docx_document = NULL;
odt_context->end_document();
if (UpdateProgress(850000))return;
}
void DocxConverter::convert_document()
@ -3390,14 +3381,12 @@ void DocxConverter::convert(OOX::Numbering::CAbstractNum* oox_num_style)
odt_context->styles_context()->lists_styles().start_style(true, oox_num_style->m_oAbstractNumId->GetValue());
//// Childs
//std::vector<OOX::Numbering::CLvl > m_arrLvl;
//nullable<ComplexTypes::Word::CMultiLevelType > m_oMultiLevelType;
//nullable<ComplexTypes::Word::std::wstring_ > m_oName;
//nullable<ComplexTypes::Word::CLongHexNumber > m_oNsid;
//nullable<ComplexTypes::Word::std::wstring_ > m_oNumStyleLink;
//nullable<ComplexTypes::Word::std::wstring_ > m_oStyleLink;
//nullable<ComplexTypes::Word::CLongHexNumber > m_oTmpl;
//nullable<ComplexTypes::Word::CMultiLevelType> m_oMultiLevelType;
//nullable<ComplexTypes::Word::std::wstring_> m_oName;
//nullable<ComplexTypes::Word::CLongHexNumber> m_oNsid;
//nullable<ComplexTypes::Word::std::wstring_> m_oNumStyleLink;
//nullable<ComplexTypes::Word::std::wstring_> m_oStyleLink;
//nullable<ComplexTypes::Word::CLongHexNumber> m_oTmpl;
for (size_t i=0; i < oox_num_style->m_arrLvl.size(); i++)
{
@ -3431,9 +3420,9 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
//nullable<SimpleTypes::CLongHexNumber<> > m_oTplc;
//// Childs
//nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oIsLgl;
//nullable<ComplexTypes::Word::CLvlLegacy > m_oLegacy;
//nullable<ComplexTypes::Word::std::wstring_ > m_oPStyle;
//nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oIsLgl;
//nullable<ComplexTypes::Word::CLvlLegacy> m_oLegacy;
//nullable<ComplexTypes::Word::std::wstring_> m_oPStyle;
double size_bullet_number_marker = 0;
if (oox_num_lvl->m_oLvlJc.IsInit())

View File

@ -143,7 +143,7 @@ namespace Oox2Odf
class DocxConverter : public OoxConverter
{
public:
DocxConverter(const std::wstring & path, const ProgressCallback* ffCallBack);
DocxConverter(const std::wstring & path, bool bTemplate);
~DocxConverter();
virtual void convertDocument();

View File

@ -31,7 +31,6 @@
*/
#pragma once
#include "../progressCallback.h"
#include <string>
namespace Oox2Odf
@ -41,7 +40,7 @@ namespace Oox2Odf
class Converter
{
public:
Converter(const std::wstring & path, const std::wstring & type, const std::wstring & fontsPath, const ProgressCallback* ffCallBack);
Converter(const std::wstring & path, const std::wstring & type, const std::wstring & fontsPath, bool bTemplate);
virtual ~Converter();
void convert();

View File

@ -73,7 +73,7 @@ using namespace cpdoccore;
namespace Oox2Odf
{
PptxConverter::PptxConverter(const std::wstring & path, const ProgressCallback* CallBack)
PptxConverter::PptxConverter(const std::wstring & path, bool bTemplate)
{
current_clrMap = NULL;
current_slide = NULL;
@ -84,8 +84,6 @@ PptxConverter::PptxConverter(const std::wstring & path, const ProgressCallback*
output_document = NULL;
odp_context = NULL;
pCallBack = CallBack;
const OOX::CPath oox_path(std::wstring(path.c_str()));
pptx_document = new PPTX::Document();
@ -105,10 +103,8 @@ PptxConverter::PptxConverter(const std::wstring & path, const ProgressCallback*
}
presentation = presentation_ptr.operator->();
output_document = new odf_writer::package::odf_document(L"presentation");
output_document = new odf_writer::package::odf_document(L"presentation", bTemplate);
odp_context = new odf_writer::odp_conversion_context(output_document);
if (UpdateProgress(290000))return;
}
PptxConverter::~PptxConverter()
{
@ -186,20 +182,15 @@ void PptxConverter::convertDocument()
odp_context->start_document();
if (UpdateProgress(300000))return;
convert_styles();
convert_settings();
convert_slides();
if (UpdateProgress(800000))return;
//удалим уже ненужный документ pptx
delete pptx_document; pptx_document = NULL;
odp_context->end_document();
if (UpdateProgress(850000))return;
}
void PptxConverter::convert_styles()
{

View File

@ -110,7 +110,7 @@ namespace Oox2Odf
class PptxConverter : public OoxConverter
{
public:
PptxConverter(const std::wstring & path, const ProgressCallback* ffCallBack);
PptxConverter(const std::wstring & path, bool bTemplate);
~PptxConverter();
virtual void convertDocument();

View File

@ -65,20 +65,16 @@ using namespace cpdoccore;
namespace Oox2Odf
{
XlsxConverter::XlsxConverter(const std::wstring & path, const ProgressCallback* CallBack)
XlsxConverter::XlsxConverter(const std::wstring & path, bool bTemplate)
{
const OOX::CPath oox_path(std::wstring(path.c_str()));
xlsx_document = new OOX::Spreadsheet::CXlsx(oox_path);
output_document = new odf_writer::package::odf_document(L"spreadsheet");
output_document = new odf_writer::package::odf_document(L"spreadsheet", bTemplate);
ods_context = new odf_writer::ods_conversion_context(output_document);
pCallBack = CallBack;
xlsx_current_container = NULL;
if (UpdateProgress(400000))return;
}
XlsxConverter::~XlsxConverter()
{
@ -147,16 +143,12 @@ void XlsxConverter::convertDocument()
ods_context->start_document();
convert_styles();
if (UpdateProgress(500000))return;
convert_sheets();
if (UpdateProgress(800000))return;
delete xlsx_document; xlsx_document = NULL;
ods_context->end_document();
if (UpdateProgress(850000))return;
}
void XlsxConverter::convert_sheets()
@ -2353,27 +2345,30 @@ void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormattingRule *oox_co
{
if (!oox_cond_rule)return;
if (oox_cond_rule->m_oType.IsInit())
if (false == oox_cond_rule->m_oType.IsInit()) return;
ods_context->current_table().start_conditional_rule(oox_cond_rule->m_oType->GetValue());
{
ods_context->current_table().start_conditional_rule(oox_cond_rule->m_oType->GetValue());
if (oox_cond_rule->m_oDxfId.IsInit())
{
if (oox_cond_rule->m_oDxfId.IsInit())
{
std::wstring odf_style_name = odf_context()->styles_context()->find_conditional_style_name(oox_cond_rule->m_oDxfId->GetValue(), odf_types::style_family::TableCell);
std::wstring odf_style_name = odf_context()->styles_context()->find_conditional_style_name(oox_cond_rule->m_oDxfId->GetValue(), odf_types::style_family::TableCell);
ods_context->current_table().set_conditional_style_name(odf_style_name);
}
if (oox_cond_rule->m_oOperator.IsInit())
ods_context->current_table().set_conditional_operator(oox_cond_rule->m_oOperator->GetValue());
ods_context->current_table().set_conditional_style_name(odf_style_name);
}
if (oox_cond_rule->m_oOperator.IsInit())
ods_context->current_table().set_conditional_operator(oox_cond_rule->m_oOperator->GetValue());
if (oox_cond_rule->m_oText.IsInit())
ods_context->current_table().set_conditional_text(oox_cond_rule->m_oText.get2());
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();
}
if (oox_cond_rule->m_oText.IsInit())
ods_context->current_table().set_conditional_text(oox_cond_rule->m_oText.get2());
convert(oox_cond_rule->m_oIconSet.GetPointer());
convert(oox_cond_rule->m_oColorScale.GetPointer());
convert(oox_cond_rule->m_oDataBar.GetPointer());
for (size_t i = 0; i < oox_cond_rule->m_arrFormula.size(); ++i)
convert(oox_cond_rule->m_arrFormula[i].GetPointer());
}
ods_context->current_table().end_conditional_rule();
}
void XlsxConverter::convert(OOX::Spreadsheet::CDataBar *oox_cond_databar)
{
@ -2386,33 +2381,26 @@ 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 (size_t i=0; i< oox_cond_databar->m_arrItems.size(); i++)
convert(oox_cond_databar->m_arrItems[i]);
for (size_t i=0; i< oox_cond_databar->m_arrValues.size(); i++)
convert(oox_cond_databar->m_arrValues[i].GetPointer());
}
void XlsxConverter::convert(OOX::Spreadsheet::CColorScale *oox_cond_colorscale)
{
if (!oox_cond_colorscale)return;
int index = 0;
for (std::vector<OOX::Spreadsheet::WritingElement*>::iterator it = oox_cond_colorscale->m_arrItems.begin();
it != oox_cond_colorscale->m_arrItems.end(); ++it)
for (size_t i = 0; i < oox_cond_colorscale->m_arrValues.size(); ++i)
{
if (*it == NULL )continue;
OOX::EElementType type = (*it)->getType();
if (type == OOX::et_x_ConditionalFormatValueObject)
{
convert(*it);
}
else
{
_CP_OPT(odf_types::color) color;
convert(dynamic_cast<OOX::Spreadsheet::CColor*>(*it), color);
ods_context->current_table().add_conditional_colorscale( index++, color );
}
convert(oox_cond_colorscale->m_arrValues[i].GetPointer());
}
for (size_t i = 0; i < oox_cond_colorscale->m_arrColors.size(); ++i)
{
_CP_OPT(odf_types::color) color;
convert(dynamic_cast<OOX::Spreadsheet::CColor*>(oox_cond_colorscale->m_arrColors[i].GetPointer()), color);
ods_context->current_table().add_conditional_colorscale( index++, color );
}
}
void XlsxConverter::convert(OOX::Spreadsheet::CIconSet *oox_cond_iconset)
{
@ -2423,8 +2411,10 @@ 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 (size_t i=0; i< oox_cond_iconset->m_arrItems.size(); i++)
convert(oox_cond_iconset->m_arrItems[i]);
for (size_t i=0; i< oox_cond_iconset->m_arrValues.size(); i++)
{
convert(oox_cond_iconset->m_arrValues[i].GetPointer());
}
}
void XlsxConverter::convert(OOX::Spreadsheet::CConditionalFormatValueObject *oox_cond_value)
{

View File

@ -135,7 +135,7 @@ namespace Oox2Odf
public:
friend class OoxConverter;
XlsxConverter(const std::wstring & path, const ProgressCallback* ffCallBack);
XlsxConverter(const std::wstring & path, bool bTemplate);
~XlsxConverter();
virtual void convertDocument();

View File

@ -676,12 +676,12 @@ void PPT_FORMAT::CShapeWriter::WriteImageInfo()
m_oWriter.WriteStringXML(pImageElement->m_sName);
m_oWriter.WriteString(std::wstring(L"\""));
//if (!pImageElement->m_sDescription.empty())
//{//бывает всякая разная бяка сохранена
// m_oWriter.WriteString(std::wstring(L" descr=\""));
// m_oWriter.WriteStringXML(pImageElement->m_sDescription);
// m_oWriter.WriteString(std::wstring(L"\""));
//}
if (!pImageElement->m_sDescription.empty())
{//бывает всякая разная бяка сохранена
m_oWriter.WriteString(std::wstring(L" descr=\""));
m_oWriter.WriteString(XmlUtils::EncodeXmlStringExtend(pImageElement->m_sDescription, true));
m_oWriter.WriteString(std::wstring(L"\""));
}
m_oWriter.WriteString(std::wstring(L">"));
if (pVideoElement || pAudioElement)

View File

@ -1464,8 +1464,7 @@ void CPPTUserInfo::LoadMainMaster(_UINT32 dwMasterID)
CSlideInfo* pMasterWrapper = &m_arMasterWrapper[lIndexTheme];
// записываем шрифты ---------------------------------------------------------------
int nCountFonts = m_arrFonts.size();
for (int i = 0; i < nCountFonts; ++i)
for (size_t i = 0; i < m_arrFonts.size(); ++i)
{
pTheme->m_arFonts.push_back(m_arrFonts[i]);
}
@ -1713,8 +1712,7 @@ void CPPTUserInfo::LoadMaster(_typeMaster type, CRecordSlide* pMaster, CSlideInf
pMasterWrapper = new CSlideInfo();
// записываем шрифты ---------------------------------------------------------------
int nCountFonts = m_arrFonts.size();
for (int i = 0; i < nCountFonts; ++i)
for (size_t i = 0; i < m_arrFonts.size(); ++i)
{
pTheme->m_arFonts.push_back(m_arrFonts[i]);
}
@ -2474,7 +2472,7 @@ void CPPTUserInfo::CreateDefaultStyle(PPT_FORMAT::CTextStyles& pStyle, PPT_FORMA
pCF->Size = 18;
pCF->font.font = new PPT_FORMAT::CFontProperty(pTheme->m_arFonts[0]);
pCF->font.font = new PPT_FORMAT::CFontProperty(pTheme->m_arFonts.size() > 1 ? pTheme->m_arFonts[1] : pTheme->m_arFonts[0]);
}
}

View File

@ -72,7 +72,6 @@ public:
// original id -> natural id
std::map<_UINT32, _UINT32> m_mapMasterOriginalIds;
// это как бы ППT-шная обертка над слайдом
std::vector<CSlideInfo> m_arSlideWrapper;
std::vector<CSlideInfo> m_arMasterWrapper;
std::vector<CSlideInfo> m_arNotesWrapper;
@ -80,11 +79,10 @@ public:
CSlideInfo* m_pNotesMasterWrapper;
CSlideInfo* m_pHandoutMasterWrapper;
// эти параметры - одни на весь документ.
// чтобы поддержать нашу схему (пптх) - копируем их в темы
std::vector<CRecordBlipStoreContainer*> m_arrBlipStore;
std::vector<CFontProperty> m_arrFonts;
PPT_FORMAT::CTextStyles m_oDefaultTextStyle;
PPT_FORMAT::CTextStyles m_oDefaultTextStyle;
vector_string m_PlaceholdersReplaceString[3]; //0-dates, 1 - headers, 2 - footers
@ -93,12 +91,10 @@ public:
bool m_bHasFooter;
int m_nFormatDate;
// чтобы загружать неизмененные элементы от других юзеров (предыдущих)
CPPTDocumentInfo* m_pDocumentInfo;
CRecordVbaProjectStg* m_VbaProjectStg;
int m_lIndexThisUser;
// Animations structures
std::map <_UINT32, Animations::CSlideTimeLine*> m_mapAnimations;
double m_nWriteSlideTimeOffset;
@ -106,7 +102,6 @@ public:
std::map<_UINT32, CSlideShowSlideInfoAtom> m_mapTransitions;
// номера "пустых" картинок - в эти пути не будем сохранять
std::vector<int> m_arOffsetPictures;
bool m_bIsSetupEmpty;

View File

@ -2319,8 +2319,8 @@ void CRecordShapeContainer::SetUpTextStyle(std::wstring& strText, CTheme* pTheme
pTextSettings->m_oStyles.ApplyAfter(pThemeWrapper->m_pStyles[nIndexType].get());
}
}
if (eTypeOwn != NoPresent/* && eTypeOwn != Other*/ && eTypeOwn != eTypePersist && eTypeOwn != eTypeMaster)
{
if (eTypeOwn != NoPresent && eTypeOwn != Tx_TYPE_OTHER && eTypeOwn != eTypePersist && eTypeOwn != eTypeMaster)
{//齐孟尧-2015年度职工考核报告.ppt
int nIndexType = (int)eTypeOwn;
if (0 <= nIndexType && nIndexType < 9 && pLayout)

View File

@ -211,6 +211,7 @@ namespace PPTX
pWriter->WriteAttribute(_T("xmlns:cp"), PPTX::g_Namespaces.cp.m_strLink);
pWriter->WriteAttribute(_T("xmlns:dc"), PPTX::g_Namespaces.dc.m_strLink);
pWriter->WriteAttribute(_T("xmlns:dcterms"), PPTX::g_Namespaces.dcterms.m_strLink);
pWriter->WriteAttribute(_T("xmlns:dcmitype"), PPTX::g_Namespaces.dcmitype.m_strLink);
pWriter->WriteAttribute(_T("xmlns:xsi"), PPTX::g_Namespaces.xsi.m_strLink);
pWriter->EndAttributes();
@ -224,14 +225,18 @@ namespace PPTX
pWriter->WriteNodeValue2(_T("dc:language"), language);
pWriter->WriteNodeValue2(_T("cp:lastModifiedBy"), lastModifiedBy);
pWriter->WriteNodeValue2(_T("cp:revision"), revision);
pWriter->WriteNodeValue2(_T("cp:lastPrinted"), lastPrinted);
if (created.IsInit())
if ((lastPrinted.IsInit()) && (false == lastPrinted->empty()))
{
pWriter->WriteNodeValue2(_T("cp:lastPrinted"), lastPrinted);
}
if ((created.IsInit()) && (false == created->empty()))
{
pWriter->WriteNodeBegin(_T("dcterms:created xsi:type=\"dcterms:W3CDTF\""));
pWriter->WriteStringXML(*created);
pWriter->WriteNodeEnd(_T("dcterms:created"));
}
if (modified.IsInit())
if ((modified.IsInit()) && (false == modified->empty()))
{
pWriter->WriteNodeBegin(_T("dcterms:modified xsi:type=\"dcterms:W3CDTF\""));
pWriter->WriteStringXML(*modified);

View File

@ -1083,7 +1083,7 @@ namespace PPTX
file = parentFileAs<Slide>().Find(nvPicPr.nvPr.media.as<MediaFile>().link.get());
smart_ptr<OOX::Media> mediaFile = file.smart_dynamic_cast<OOX::Media>();
if ( mediaFile.IsInit() == false && !nvPicPr.nvPr.extLst.empty())
if ( (mediaFile.IsInit() == false || mediaFile->filename().GetPath() == L"NULL") && !nvPicPr.nvPr.extLst.empty())
{
//todooo - почему везде нулевой то? - сделать поиск по всем uri
file = parentFileAs<Slide>().Find(nvPicPr.nvPr.extLst[0].link.get());

View File

@ -78,6 +78,8 @@ namespace PPTX
}
Theme(OOX::Document *pMain, const OOX::CPath& filename) : WrapperFile(pMain), PPTX::FileContainer(pMain)
{
IFileContainer::Read( filename, filename );
FileMap map;
isThemeOverride = false;

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FCA31ACC429D006B99B3"
BuildableName = "libPPTXFormatLib_ios.a"
BlueprintName = "PPTXFormatLib"
ReferencedContainer = "container:PPTXFormatLib.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FCA31ACC429D006B99B3"
BuildableName = "libPPTXFormatLib_ios.a"
BlueprintName = "PPTXFormatLib"
ReferencedContainer = "container:PPTXFormatLib.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FCA31ACC429D006B99B3"
BuildableName = "libPPTXFormatLib_ios.a"
BlueprintName = "PPTXFormatLib"
ReferencedContainer = "container:PPTXFormatLib.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -14,8 +14,8 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17063B621AC5708F0056A3F1"
BuildableName = "libPPTXFormatLib.a"
BlueprintIdentifier = "17C1FCA31ACC429D006B99B3"
BuildableName = "libPPTXFormatLib_ios.a"
BlueprintName = "PPTXFormatLib"
ReferencedContainer = "container:PPTXFormatLib.xcodeproj">
</BuildableReference>
@ -23,27 +23,30 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17063B621AC5708F0056A3F1"
BuildableName = "libPPTXFormatLib.a"
BlueprintIdentifier = "17C1FCA31ACC429D006B99B3"
BuildableName = "libPPTXFormatLib_ios.a"
BlueprintName = "PPTXFormatLib"
ReferencedContainer = "container:PPTXFormatLib.xcodeproj">
</BuildableReference>
@ -52,16 +55,16 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17063B621AC5708F0056A3F1"
BuildableName = "libPPTXFormatLib.a"
BlueprintIdentifier = "17C1FCA31ACC429D006B99B3"
BuildableName = "libPPTXFormatLib_ios.a"
BlueprintName = "PPTXFormatLib"
ReferencedContainer = "container:PPTXFormatLib.xcodeproj">
</BuildableReference>

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6967B1281E27B44D00A129E2"
BuildableName = "libRtfFormatLib.a"
BlueprintName = "RtfFormatLib"
ReferencedContainer = "container:RtfFormatLib.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6967B1281E27B44D00A129E2"
BuildableName = "libRtfFormatLib.a"
BlueprintName = "RtfFormatLib"
ReferencedContainer = "container:RtfFormatLib.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6967B1281E27B44D00A129E2"
BuildableName = "libRtfFormatLib.a"
BlueprintName = "RtfFormatLib"
ReferencedContainer = "container:RtfFormatLib.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -7,9 +7,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\..\Common\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RtfFormatTest", "RtfFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
ProjectSection(ProjectDependencies) = postProject
{AF2D00A7-A351-4700-AE88-C1D9ADE29345} = {AF2D00A7-A351-4700-AE88-C1D9ADE29345}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{AF2D00A7-A351-4700-AE88-C1D9ADE29345} = {AF2D00A7-A351-4700-AE88-C1D9ADE29345}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PPTXFormat", "..\..\ASCOfficePPTXFile\PPTXLib\PPTXFormat.vcproj", "{36636678-AE25-4BE6-9A34-2561D1BCF302}"

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6967AFBE1E2798B900A129E2"
BuildableName = "libTxtXmlFormatLib.a"
BlueprintName = "TxtXmlFormatLib"
ReferencedContainer = "container:TxtXmlFormatLib.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6967AFBE1E2798B900A129E2"
BuildableName = "libTxtXmlFormatLib.a"
BlueprintName = "TxtXmlFormatLib"
ReferencedContainer = "container:TxtXmlFormatLib.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "6967AFBE1E2798B900A129E2"
BuildableName = "libTxtXmlFormatLib.a"
BlueprintName = "TxtXmlFormatLib"
ReferencedContainer = "container:TxtXmlFormatLib.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -36,8 +36,6 @@
namespace XLS
{
// Logical representation of HCenter record in BIFF8
class HCenter: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(HCenter)
@ -47,11 +45,10 @@ public:
~HCenter();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeHCenter;
static const ElementType type = typeHCenter;
//-----------------------------
Boolean<unsigned short> hcenter;

View File

@ -46,11 +46,10 @@ public:
~Setup();
BaseObjectPtr clone();
void readFields(CFRecord& record);
static const ElementType type = typeSetup;
static const ElementType type = typeSetup;
//-----------------------------
_UINT16 iPaperSize;

View File

@ -39,12 +39,10 @@ VCenter::VCenter()
{
}
VCenter::~VCenter()
{
}
BaseObjectPtr VCenter::clone()
{
return BaseObjectPtr(new VCenter(*this));

View File

@ -36,8 +36,6 @@
namespace XLS
{
// Logical representation of VCenter record in BIFF8
class VCenter: public BiffRecord
{
BIFF_RECORD_DEFINE_TYPE_INFO(VCenter)
@ -50,7 +48,7 @@ public:
void readFields(CFRecord& record);
static const ElementType type = typeVCenter;
static const ElementType type = typeVCenter;
//-----------------------------
Boolean<unsigned short> vcenter;

View File

@ -118,16 +118,35 @@ const bool PAGESETUP::loadContent(BinProcessor& proc)
m_Footer = elements_.back();
elements_.pop_back();
}
}break;
case rt_HCenter: proc.optional<HCenter>(); break;
case rt_VCenter: proc.optional<VCenter>(); break;
case rt_BottomMargin: proc.optional<BottomMargin>(); break;
}break;
case rt_HCenter:
{
if (proc.optional<HCenter>())
{
m_HCenter = elements_.back();
elements_.pop_back();
}
}break;
case rt_VCenter:
{
if (proc.optional<VCenter>())
{
m_VCenter = elements_.back();
elements_.pop_back();
}
}break;
case rt_BottomMargin: proc.optional<BottomMargin>(); break;
case rt_TopMargin: proc.optional<TopMargin>(); break;
case rt_LeftMargin: proc.optional<LeftMargin>(); break;
case rt_RightMargin: proc.optional<RightMargin>(); break;
case rt_Pls: proc.optional<Pls>(); break;
case rt_Pls:
{
if (proc.optional<Pls>())
{
m_Pls = elements_.back();
elements_.pop_back();
}
}break;
case rt_Setup:
{
if (proc.optional<Setup>())
@ -219,9 +238,34 @@ int PAGESETUP::serialize(std::wostream & stream)
if (!r) CP_XML_ATTR(L"right" , 0.75);
}
//CP_XML_NODE(L"pageSetup") - для chartsheet аккуратнее
//{
//}
if (setup->iFitHeight > 0 && setup->iFitWidth == 1 && setup->iScale == 100)
{
setup->iScale = 90;
}
if (false == setup->fNoPls)
{
CP_XML_NODE(L"pageSetup")// - для chartsheet аккуратнее
{
CP_XML_ATTR(L"paperSize", setup->iPaperSize);
CP_XML_ATTR(L"firstPageNumber", setup->iPageStart);
CP_XML_ATTR(L"scale", setup->iScale);
CP_XML_ATTR(L"orientation", setup->fPortrait ? L"portrait" : L"landscape");
CP_XML_ATTR(L"horizontalDpi", setup->iRes);
CP_XML_ATTR(L"verticalDpi", setup->iVRes);
if (setup->fUsePage)
CP_XML_ATTR(L"useFirstPageNumber", true);
if (setup->iFitWidth > 0 && setup->iFitWidth < 32767)
CP_XML_ATTR(L"fitToWidth", setup->iFitWidth);
if (setup->iFitHeight > 0 && setup->iFitHeight < 32767)
CP_XML_ATTR(L"fitToHeight", setup->iFitHeight);
}
}
if (m_Header || m_Footer)
{

View File

@ -35,9 +35,6 @@
namespace XLS
{
// Logical representation of PAGESETUP union of records
class PAGESETUP: public CompositeObject
{
BASE_OBJECT_DEFINE_CLASS_NAME(PAGESETUP)
@ -51,13 +48,19 @@ public:
int serialize(std::wostream & stream);
static const ElementType type = typePAGESETUP;
static const ElementType type = typePAGESETUP;
BaseObjectPtr m_HeaderFooter;
BaseObjectPtr m_Setup;
BaseObjectPtr m_Header;
BaseObjectPtr m_Footer;
BaseObjectPtr m_HCenter;
BaseObjectPtr m_VCenter;
BaseObjectPtr m_Pls;
};
} // namespace XLS

View File

@ -34,4 +34,4 @@ if [ ! -f Makefile ]; then
./config no-shared no-asm
fi
make
make build_libs

View File

@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
1732414A1BBEC90000E67992 /* pole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 173241431BBEC90000E67992 /* pole.cpp */; };
1732414C1BBEC90000E67992 /* pole.h in Headers */ = {isa = PBXBuildFile; fileRef = 173241441BBEC90000E67992 /* pole.h */; };
17ADFF1E2215FD50002B6005 /* ThreadedComments.h in Headers */ = {isa = PBXBuildFile; fileRef = 17ADFF1D2215FD50002B6005 /* ThreadedComments.h */; };
17C1FB941ACC4250006B99B3 /* Hyperlink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A0621AC4262700F28F8B /* Hyperlink.cpp */; };
17C1FB951ACC4250006B99B3 /* Sdt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A06D1AC4262700F28F8B /* Sdt.cpp */; };
17C1FB961ACC4250006B99B3 /* oMathContent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17E6A0801AC4262700F28F8B /* oMathContent.cpp */; };
@ -230,6 +231,7 @@
/* Begin PBXFileReference section */
173241431BBEC90000E67992 /* pole.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pole.cpp; sourceTree = "<group>"; };
173241441BBEC90000E67992 /* pole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pole.h; sourceTree = "<group>"; };
17ADFF1D2215FD50002B6005 /* ThreadedComments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadedComments.h; sourceTree = "<group>"; };
17C1FC9C1ACC4250006B99B3 /* libDocxFormatLib_ios.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDocxFormatLib_ios.a; sourceTree = BUILT_PRODUCTS_DIR; };
17E69FEE1AC4262700F28F8B /* ASCWinAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASCWinAPI.h; sourceTree = "<group>"; };
17E69FEF1AC4262700F28F8B /* Base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base.h; sourceTree = "<group>"; };
@ -821,6 +823,7 @@
isa = PBXGroup;
children = (
17E6A1521AC4262800F28F8B /* Comments.h */,
17ADFF1D2215FD50002B6005 /* ThreadedComments.h */,
);
path = Comments;
sourceTree = "<group>";
@ -1114,6 +1117,7 @@
17C1FC941ACC4250006B99B3 /* Styles.h in Headers */,
17C1FC961ACC4250006B99B3 /* oMathBottomNodes.h in Headers */,
17C1FC971ACC4250006B99B3 /* CalcChain.h in Headers */,
17ADFF1E2215FD50002B6005 /* ThreadedComments.h in Headers */,
17C1FC981ACC4250006B99B3 /* Common.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FB8E1ACC4250006B99B3"
BuildableName = "libDocxFormatLib_ios.a"
BlueprintName = "DocxFormatLib"
ReferencedContainer = "container:DocxFormatLib.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FB8E1ACC4250006B99B3"
BuildableName = "libDocxFormatLib_ios.a"
BlueprintName = "DocxFormatLib"
ReferencedContainer = "container:DocxFormatLib.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FB8E1ACC4250006B99B3"
BuildableName = "libDocxFormatLib_ios.a"
BlueprintName = "DocxFormatLib"
ReferencedContainer = "container:DocxFormatLib.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -14,8 +14,8 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17E69FDB1AC4259800F28F8B"
BuildableName = "libDocxFormatLib.a"
BlueprintIdentifier = "17C1FB8E1ACC4250006B99B3"
BuildableName = "libDocxFormatLib_ios.a"
BlueprintName = "DocxFormatLib"
ReferencedContainer = "container:DocxFormatLib.xcodeproj">
</BuildableReference>
@ -23,27 +23,30 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17E69FDB1AC4259800F28F8B"
BuildableName = "libDocxFormatLib.a"
BlueprintIdentifier = "17C1FB8E1ACC4250006B99B3"
BuildableName = "libDocxFormatLib_ios.a"
BlueprintName = "DocxFormatLib"
ReferencedContainer = "container:DocxFormatLib.xcodeproj">
</BuildableReference>
@ -52,16 +55,16 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17E69FDB1AC4259800F28F8B"
BuildableName = "libDocxFormatLib.a"
BlueprintIdentifier = "17C1FB8E1ACC4250006B99B3"
BuildableName = "libDocxFormatLib_ios.a"
BlueprintName = "DocxFormatLib"
ReferencedContainer = "container:DocxFormatLib.xcodeproj">
</BuildableReference>

View File

@ -1520,6 +1520,14 @@
RelativePath="..\Source\XlsxFormat\Comments\Comments.h"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\Comments\ThreadedComments.h"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\WorkbookComments.h"
>
</File>
</Filter>
<Filter
Name="Drawing"
@ -1628,6 +1636,14 @@
RelativePath="..\Source\XlsxFormat\Table\Autofilter.h"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\Table\Connections.h"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\Table\QueryTable.h"
>
</File>
<File
RelativePath="..\Source\XlsxFormat\Table\Table.h"
>

View File

@ -138,6 +138,13 @@ namespace NSCommon
this->m_pPointer = NULL;
}
nullable(XmlUtils::CXmlLiteReader& oReader)
{
if (oReader.IsValid())
this->m_pPointer = new Type(oReader);
else
this->m_pPointer = NULL;
}
nullable<Type>& operator=(XmlUtils::CXmlNode& oNode)
{
RELEASEOBJECT(this->m_pPointer);

View File

@ -582,11 +582,9 @@ namespace SimpleTypes
return this->m_eValue;
}
virtual std::wstring ToString () const
virtual std::wstring ToString () const
{
std::wstring sResult = std::to_wstring( this->m_eValue);
return sResult;
return std::to_wstring( this->m_eValue);
}
SimpleType_FromString (unsigned int)

View File

@ -369,6 +369,34 @@ namespace OOX
std::map<int, int> m_mapComments; //id, index
};
class CDocumentComments : public CComments
{
public:
CDocumentComments(OOX::Document *pMain) : CComments(NULL)
{
File::m_pMainDocument = pMain;
CDocx* docx = dynamic_cast<CDocx*>(File::m_pMainDocument);
if (docx) docx->m_pDocumentComments = this;
}
CDocumentComments(OOX::Document *pMain, const CPath& oPath) : CComments(NULL, oPath)
{
File::m_pMainDocument = pMain;
CDocx* docx = dynamic_cast<CDocx*>(File::m_pMainDocument);
if (docx) docx->m_pDocumentComments = this;
}
virtual const OOX::FileType type() const
{
return FileTypes::DocumentComments;
}
virtual const CPath DefaultDirectory() const
{
return type().DefaultDirectory();
}
virtual const CPath DefaultFileName() const
{
return type().DefaultFileName();
}
};
class CCommentExt : public WritingElement
{
public:
@ -488,6 +516,26 @@ namespace OOX
std::vector<CCommentExt*> m_arrComments;
std::map<int, int> m_mapComments; //paraId, index
};
class CDocumentCommentsExt : public CCommentsExt
{
public:
CDocumentCommentsExt(OOX::Document *pMain) : CCommentsExt(NULL)
{
File::m_pMainDocument = pMain;
CDocx* docx = dynamic_cast<CDocx*>(File::m_pMainDocument);
if (docx) docx->m_pDocumentCommentsExt = this;
}
CDocumentCommentsExt(OOX::Document *pMain, const CPath& oPath) : CCommentsExt(NULL, oPath)
{
File::m_pMainDocument = pMain;
CDocx* docx = dynamic_cast<CDocx*>(File::m_pMainDocument);
if (docx) docx->m_pDocumentCommentsExt = this;
}
virtual const OOX::FileType type() const
{
return FileTypes::DocumentCommentsExt;
}
};
class CPresenceInfo : public WritingElement
{
@ -648,6 +696,27 @@ namespace OOX
std::vector<CPerson*> m_arrPeoples;
};
class CDocumentPeople : public CPeople
{
public:
CDocumentPeople(OOX::Document *pMain) : CPeople(NULL)
{
File::m_pMainDocument = pMain;
CDocx* docx = dynamic_cast<CDocx*>(File::m_pMainDocument);
if (docx) docx->m_pDocumentPeople = this;
}
CDocumentPeople(OOX::Document *pMain, const CPath& oPath) : CPeople(NULL, oPath)
{
File::m_pMainDocument = pMain;
CDocx* docx = dynamic_cast<CDocx*>(File::m_pMainDocument);
if (docx) docx->m_pDocumentPeople = this;
}
virtual const OOX::FileType type() const
{
return FileTypes::DocumentPeople;
}
};
} // namespace OOX
#endif // OOX_COMMENTS_FILE_INCLUDE_H_

View File

@ -64,8 +64,9 @@ namespace OOX
m_mTable.insert( std::make_pair( _T("emf"), _T("image/x-emf")));
m_mTable.insert( std::make_pair( _T("emz"), _T("image/x-emz")));
m_mTable.insert( std::make_pair( _T("wmf"), _T("image/x-wmf")));
m_mTable.insert( std::make_pair( _T("svg"), _T("image/svg+xml")));
m_mTable.insert( std::make_pair( _T("svg"), _T("image/svg+xml")));
m_mTable.insert( std::make_pair( _T("svm"), _T("image/svm")));
m_mTable.insert( std::make_pair( _T("wdp"), _T("image/vnd.ms-photo")));
m_mTable.insert( std::make_pair( _T("wav"), _T("audio/wav")));
m_mTable.insert( std::make_pair( _T("wma"), _T("audio/x-wma")));
m_mTable.insert( std::make_pair( _T("m4a"), _T("audio/unknown")));
@ -76,6 +77,7 @@ namespace OOX
m_mTable.insert( std::make_pair( _T("mkv"), _T("video/unknown")));
m_mTable.insert( std::make_pair( _T("avi"), _T("video/avi")));
m_mTable.insert( std::make_pair( _T("wmv"), _T("video/x-wmv")));
m_mTable.insert( std::make_pair( _T("webm"), _T("video/webm")));
m_mTable.insert( std::make_pair( _T("xls"), _T("application/vnd.ms-excel")));
m_mTable.insert( std::make_pair( _T("xlsm"), _T("application/vnd.ms-excel.sheet.macroEnabled.12")));
m_mTable.insert( std::make_pair( _T("xlsb"), _T("application/vnd.ms-excel.sheet.binary.macroEnabled.12")));

View File

@ -110,8 +110,13 @@ namespace OOX
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
std::wstring sXml;
sXml = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><cp:coreProperties xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");
sXml = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<cp:coreProperties \
xmlns:cp=\"http://schemas.openxmlformats.org/package/2006/metadata/core-properties\" \
xmlns:dc=\"http://purl.org/dc/elements/1.1/\" \
xmlns:dcterms=\"http://purl.org/dc/terms/\" \
xmlns:dcmitype=\"http://purl.org/dc/dcmitype/\" \
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">");
if ( m_sTitle.IsInit() )
{
sXml += _T("<dc:title>");
@ -166,19 +171,19 @@ namespace OOX
sXml += XmlUtils::EncodeXmlString(m_sRevision.get());
sXml += _T("</cp:revision>");
}
if ( m_sLastPrinted.IsInit() )
if ( (m_sLastPrinted.IsInit()) && (!m_sLastPrinted->empty()))
{
sXml += _T("<cp:lastPrinted>");
sXml += XmlUtils::EncodeXmlString(m_sLastPrinted.get());
sXml += _T("</cp:lastPrinted>");
}
if ( m_sCreated.IsInit() )
if ( (m_sCreated.IsInit()) && (!m_sCreated->empty()))
{
sXml += _T("<dcterms:created xsi:type=\"dcterms:W3CDTF\">");
sXml += XmlUtils::EncodeXmlString(m_sCreated.get());
sXml += _T("</dcterms:created>");
}
if ( m_sModified.IsInit() )
if ( (m_sModified.IsInit()) && (!m_sModified->empty()))
{
sXml += _T("<dcterms:modified xsi:type=\"dcterms:W3CDTF\">");
sXml += XmlUtils::EncodeXmlString(m_sModified.get());

View File

@ -61,8 +61,33 @@ namespace OOX {
OOX::CRels oRels( oFilePath / FILE_SEPARATOR_STR );
IFileContainer::Read( oRels, oFilePath, oFilePath );
FixAfterRead();
return true;
}
void CDocx::FixAfterRead()
{
//solve id conflict between comments and documentComments
if(NULL != m_pComments && m_pComments->m_arrComments.size() > 0 && NULL != m_pDocumentComments && NULL != m_pDocumentComments->m_arrComments.size() > 0)
{
int maxId = INT_MIN;
for (size_t i = 0; i < m_pComments->m_arrComments.size(); ++i)
{
OOX::CComment* pComment = m_pComments->m_arrComments[i];
if (pComment->m_oId.IsInit() && maxId < pComment->m_oId->GetValue())
{
maxId = pComment->m_oId->GetValue();
}
}
m_pDocumentComments->m_mapComments.clear();
for (size_t i = 0; i < m_pDocumentComments->m_arrComments.size(); ++i)
{
OOX::CComment* pComment = m_pDocumentComments->m_arrComments[i];
pComment->m_oId.Init();
pComment->m_oId->SetValue(++maxId);
m_pDocumentComments->m_mapComments.insert( std::make_pair( pComment->m_oId->GetValue(), i));
}
}
}
OOX::CHdrFtr *CDocx::GetHeaderOrFooter(const OOX::RId& rId) const
{
if ( m_pDocument )

View File

@ -61,6 +61,9 @@ namespace OOX
class CComments;
class CCommentsExt;
class CPeople;
class CDocumentComments;
class CDocumentCommentsExt;
class CDocumentPeople;
class VbaProject;
class JsaProject;
class CHdrFtr;
@ -79,6 +82,7 @@ namespace OOX
Read( oFilePath );
}
bool Read(const CPath& oFilePath);
void FixAfterRead();
bool Write(const CPath& oFilePath)
{
@ -115,6 +119,9 @@ namespace OOX
OOX::CComments *m_pComments; // word/comments.xml
OOX::CCommentsExt *m_pCommentsExt;// word/commentsExtended.xml
OOX::CPeople *m_pPeople; // word/people.xml
OOX::CDocumentComments *m_pDocumentComments; // word/documentComments.xml
OOX::CDocumentCommentsExt *m_pDocumentCommentsExt;// word/documentCommentsExtended.xml
OOX::CDocumentPeople *m_pDocumentPeople; // word/documentPeople.xml
OOX::VbaProject *m_pVbaProject;
OOX::JsaProject *m_pJsaProject;
@ -137,6 +144,9 @@ private:
m_pComments = NULL;
m_pCommentsExt = NULL;
m_pPeople = NULL;
m_pDocumentComments = NULL;
m_pDocumentCommentsExt = NULL;
m_pDocumentPeople = NULL;
m_pVbaProject = NULL;
m_pJsaProject = NULL;
}

View File

@ -65,6 +65,7 @@ namespace OOX
*m_sUri == L"{05C60535-1F16-4fd2-B633-F4F36F0B64E0}" ||
*m_sUri == L"{504A1905-F514-4f6f-8877-14C23A59335A}" ||
*m_sUri == L"{78C0D931-6437-407d-A8EE-F0AAD7539E65}" ||
*m_sUri == L"{B025F937-C7B1-47D3-B67F-A62EFF666E3E}" ||
*m_sUri == L"http://schemas.microsoft.com/office/drawing/2008/diagram"))
{
int nCurDepth = oReader.GetDepth();
@ -83,7 +84,7 @@ namespace OOX
{
m_oDataModelExt = oReader;
}
else if (sName == _T("table"))
else if (sName == L"table")
{
m_oAltTextTable = oReader;
}
@ -98,6 +99,10 @@ namespace OOX
m_arrConditionalFormatting.push_back(new OOX::Spreadsheet::CConditionalFormatting(oReader));
}
}
else if (sName == L"id")
{
m_oId = oReader.GetText2();
}
}
}
else
@ -108,13 +113,11 @@ namespace OOX
}
std::wstring COfficeArtExtension::toXML() const
{
return toXMLWithNS(_T("a:"));
return toXMLWithNS(L"a:");
}
std::wstring COfficeArtExtension::toXMLWithNS(const std::wstring& sNamespace) const
{
std::wstring sResult = _T("<");
sResult += sNamespace;
sResult += _T("ext");
std::wstring sResult = L"<" + sNamespace + L"ext";
if ( m_sUri.IsInit() )
{
@ -125,8 +128,8 @@ namespace OOX
{
sResult += L" " + m_sAdditionalNamespace;
}
sResult += _T(">");
sResult += L">";
if(m_oCompatExt.IsInit())
{
@ -143,11 +146,23 @@ namespace OOX
NSStringUtils::CStringBuilder writer;
m_oAltTextTable->toXML(writer);
sResult += writer.GetData().c_str();
}
if (false == m_arrConditionalFormatting.empty())
{
sResult += L"<x14:conditionalFormattings>";
NSStringUtils::CStringBuilder writer;
for (size_t i = 0; i < m_arrConditionalFormatting.size(); i++)
{
m_arrConditionalFormatting[i]->toXML2(writer, true);
}
sResult += writer.GetData().c_str();
sResult += L"</x14:conditionalFormattings>";
}
sResult += _T("</");
sResult += sNamespace;
sResult += _T("ext>");
if (m_oId.IsInit())
{
sResult += L"<" + sNamespace + L"id>" + m_oId.get2() + L"</" + sNamespace + L"id>";
}
sResult += L"</" + sNamespace + L"ext>";
return sResult;
}

View File

@ -79,7 +79,6 @@ namespace OOX
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start_No_NS( oReader )
WritingElement_ReadAttributes_Read_if( oReader, _T("spid"), m_sSpId )
WritingElement_ReadAttributes_End_No_NS( oReader )
@ -125,7 +124,6 @@ namespace OOX
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start_No_NS( oReader )
WritingElement_ReadAttributes_Read_if( oReader, _T("relId"), m_oRelId )
WritingElement_ReadAttributes_End_No_NS( oReader )
@ -133,10 +131,7 @@ namespace OOX
public:
// Attributes
nullable<std::wstring> m_oRelId;
// Childs
};
@ -168,23 +163,21 @@ namespace OOX
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start_No_NS( oReader )
WritingElement_ReadAttributes_Read_if( oReader, _T("uri"), m_sUri )
WritingElement_ReadAttributes_Read_if ( oReader, L"uri", m_sUri )
WritingElement_ReadAttributes_End_No_NS( oReader )
}
public:
// Attributes
nullable<std::wstring> m_sUri;
std::wstring m_sAdditionalNamespace;
// Childs
nullable<CCompatExt> m_oCompatExt;
nullable<OOX::Spreadsheet::CSparklineGroups> m_oSparklineGroups;
nullable<CDataModelExt> m_oDataModelExt;
nullable<OOX::Spreadsheet::CAltTextTable> m_oAltTextTable;
nullable<std::wstring> m_oId;
std::vector<OOX::Spreadsheet::CConditionalFormatting*> m_arrConditionalFormatting;
};
@ -200,16 +193,13 @@ namespace OOX
}
virtual ~COfficeArtExtensionList()
{
for ( unsigned int nIndex = 0; nIndex < m_arrExt.size(); nIndex++ )
for ( size_t nIndex = 0; nIndex < m_arrExt.size(); nIndex++ )
{
if ( m_arrExt[nIndex] ) delete m_arrExt[nIndex];
m_arrExt[nIndex] = NULL;
}
m_arrExt.clear();
}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать
@ -230,25 +220,23 @@ namespace OOX
}
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
return toXMLWithNS(_T("a:"));
return toXMLWithNS(L"a:");
}
std::wstring toXMLWithNS(const std::wstring& sNamespace) const
{
std::wstring sResult = _T("<");
sResult += sNamespace;
sResult += _T("extLst>");
if (m_arrExt.empty()) return L"";
std::wstring sResult = L"<" + sNamespace + L"extLst>";
for ( unsigned int nIndex = 0; nIndex < m_arrExt.size(); nIndex++ )
for ( size_t nIndex = 0; nIndex < m_arrExt.size(); nIndex++ )
{
if (m_arrExt[nIndex])
sResult += m_arrExt[nIndex]->toXMLWithNS(sNamespace);
}
sResult += _T("</");
sResult += sNamespace;
sResult += _T("extLst>");
sResult += L"</" + sNamespace + L"extLst>";
return sResult;
}
@ -257,9 +245,6 @@ namespace OOX
return OOX::et_a_extLst;
}
public:
// Childs
std::vector<OOX::Drawing::COfficeArtExtension*> m_arrExt;
};
} // namespace Drawing

View File

@ -97,10 +97,16 @@ namespace OOX
return smart_ptr<OOX::File>(new CHdrFtr( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == FileTypes::Comments)
return smart_ptr<OOX::File>(new CComments( pMain, oFileName ));
else if ( oRelation.Type() == FileTypes::DocumentComments)
return smart_ptr<OOX::File>(new CDocumentComments( pMain, oFileName ));
else if ( oRelation.Type() == FileTypes::CommentsExt )
return smart_ptr<OOX::File>(new CCommentsExt( pMain, oFileName ));
else if ( oRelation.Type() == FileTypes::DocumentCommentsExt )
return smart_ptr<OOX::File>(new CDocumentCommentsExt( pMain, oFileName ));
else if ( oRelation.Type() == FileTypes::People )
return smart_ptr<OOX::File>(new CPeople( pMain, oFileName ));
else if ( oRelation.Type() == FileTypes::DocumentPeople )
return smart_ptr<OOX::File>(new CDocumentPeople( pMain, oFileName ));
//common
else if ( oRelation.Type() == FileTypes::Setting)
return smart_ptr<OOX::File>(new CSettings( pMain, oFileName ));
@ -214,10 +220,16 @@ namespace OOX
return smart_ptr<OOX::File>(new CHdrFtr( pMain, oRootPath, oFileName ));
else if ( pRelation->Type() == FileTypes::Comments)
return smart_ptr<OOX::File>(new CComments( pMain, oFileName ));
else if ( pRelation->Type() == FileTypes::DocumentComments)
return smart_ptr<OOX::File>(new CDocumentComments( pMain, oFileName ));
else if ( pRelation->Type() == FileTypes::CommentsExt )
return smart_ptr<OOX::File>(new CCommentsExt( pMain, oFileName ));
else if ( pRelation->Type() == FileTypes::DocumentCommentsExt )
return smart_ptr<OOX::File>(new CDocumentCommentsExt( pMain, oFileName ));
else if ( pRelation->Type() == FileTypes::People )
return smart_ptr<OOX::File>(new CPeople( pMain, oFileName ));
else if ( pRelation->Type() == FileTypes::DocumentPeople )
return smart_ptr<OOX::File>(new CDocumentPeople( pMain, oFileName ));
else if (pRelation->Type() == FileTypes::Data)
return smart_ptr<OOX::File>(new CDiagramData( pMain, oRootPath, oFileName ));
else if (pRelation->Type() == FileTypes::DiagDrawing)

View File

@ -110,14 +110,26 @@ namespace OOX
L"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments");
const FileType DocumentComments (L"", L"commentsDocument.xml",
L"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",
L"http://schemas.onlyoffice.com/commentsDocument");
const FileType CommentsExt (L"", L"commentsExtended.xml",
L"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",
L"http://schemas.microsoft.com/office/2011/relationships/commentsExtended");
const FileType DocumentCommentsExt (L"", L"commentsExtendedDocument.xml",
L"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",
L"http://schemas.onlyoffice.com/commentsExtendedDocument");
const FileType People (L"", L"people.xml",
L"application/vnd.openxmlformats-officedocument.wordprocessingml.people+xml",
L"http://schemas.microsoft.com/office/2011/relationships/people");
const FileType DocumentPeople (L"", L"peopleDocument.xml",
L"application/vnd.openxmlformats-officedocument.wordprocessingml.people+xml",
L"http://schemas.onlyoffice.com/peopleDocument");
const FileType CustomXml (L"customXml", L"item.xml",
L"",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml");

View File

@ -1083,6 +1083,16 @@ namespace OOX
et_x_QueryTableRefresh,
et_x_QueryTableDeletedFields,
et_x_QueryTableDeletedField,
et_x_Connections,
et_x_Connection,
et_x_dbPr,
et_x_textPr,
et_x_olapPr,
et_x_webPr,
et_x_parameter,
et_x_parameters,
et_x_textFields,
et_x_textField,
et_x_TableParts,
et_x_TablePart,
et_x_Table,
@ -1103,6 +1113,10 @@ namespace OOX
et_x_Authors,
et_x_CommentList,
et_x_Comment,
et_x_ThreadedComments,
et_x_ThreadedComment,
et_x_PersonList,
et_x_Person,
et_x_ConditionalFormatting,
et_x_ConditionalFormattingRule,
et_x_ColorScale,
@ -1110,6 +1124,7 @@ namespace OOX
et_x_FormulaCF,
et_x_IconSet,
et_x_ConditionalFormatValueObject,
et_x_ConditionalFormatIconSet,
et_x_SheetPr,
et_x_Pane,
et_x_ExternalBook,

View File

@ -281,6 +281,29 @@ namespace XmlUtils
sstream << boost::format(format) % value;
return sstream.str();
}
static std::wstring GenerateGuid()
{
std::wstring result;
//#if defined (_WIN32) || defined(_WIN64)
// GUID guid;
// CoCreateGuid(&guid);
//
// OLECHAR* guidString;
// StringFromCLSID(guid, &guidString);
//
// result = std::wstring(guidString);
//
// CoTaskMemFree(guidString);
//#else
srand(time(NULL));
std::wstringstream sstream;
sstream << boost::wformat(L"%X%X-%X-%X-%X-%X%X%X") % std::rand() % std::rand() % std::rand() % ((std::rand() & 0x0fff) | 0x4000) % ((rand() % 0x3fff) + 0x8000) % rand() % rand() % rand();
result = sstream.str();
//#endif
return result;
}
AVSINLINE static std::wstring DoubleToString( double value, wchar_t* format )
{
if ( format == NULL ) return L"";

View File

@ -0,0 +1,447 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef OOX_XLSXTREADEDCOMMENTS_FILE_INCLUDE_H_
#define OOX_XLSXTREADEDCOMMENTS_FILE_INCLUDE_H_
#include "../Xlsx.h"
#include "../Worksheets/Worksheet.h"
#include "../SharedStrings/Si.h"
namespace OOX
{
namespace Spreadsheet
{
class CPerson : public WritingElement
{
public:
WritingElement_AdditionConstructors(CPerson)
CPerson()
{
}
virtual ~CPerson()
{
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<person");
WritingStringNullableAttrEncodeXmlString(L"displayName", displayName, *displayName);
WritingStringNullableAttrString(L"userId", userId, *userId);
WritingStringNullableAttrString(L"providerId", providerId, *providerId);
WritingStringNullableAttrString(L"id", id, *id);
writer.WriteString(L">");
//writer.WriteString(L"<text>");
//m_oText->toXML2(writer);
//writer.WriteString(L"</text>");
writer.WriteString(L"</person>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"extLst" == sName )
{
extLst = oReader;
}
}
}
virtual EElementType getType () const
{
return et_x_ThreadedComment;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"displayName", displayName )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"userId", userId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"providerId", providerId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"id", id )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable_string displayName;
nullable_string userId;
nullable_string providerId;
nullable_string id;
nullable<OOX::Drawing::COfficeArtExtensionList> extLst;
};
class CPersonList : public OOX::File, public WritingElementWithChilds<CPerson>
{
public:
CPersonList(OOX::Document* pMain) : OOX::File(pMain)
{
CXlsx* xlsx = dynamic_cast<CXlsx*>(pMain);
if ((xlsx) && (!xlsx->m_arWorksheets.empty()))
{
xlsx->m_arWorksheets.back()->m_pPersonList = this;
}
}
CPersonList(OOX::Document* pMain, const CPath& oRootPath, const CPath& oPath) : OOX::File(pMain)
{
CXlsx* xlsx = dynamic_cast<CXlsx*>(pMain);
if ((xlsx) && (!xlsx->m_arWorksheets.empty()))
{
xlsx->m_arWorksheets.back()->m_pPersonList = this;
}
read( oRootPath, oPath );
}
virtual ~CPersonList()
{
ClearItems();
}
virtual void read(const CPath& oPath)
{
//don't use this. use read(const CPath& oRootPath, const CPath& oFilePath)
CPath oRootPath;
read(oRootPath, oPath);
}
virtual void read(const CPath& oRootPath, const CPath& oPath)
{
m_oReadPath = oPath;
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )
return;
if ( !oReader.ReadNextNode() )
return;
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"personList" == sName )
{
fromXML(oReader);
}
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<personList ");
writer.WriteString(L" xmlns=\"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments\"");
writer.WriteString(L" xmlns:x=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"");
writer.WriteString(L">");
for ( size_t i = 0; i < m_arrItems.size(); ++i)
{
if ( m_arrItems[i] )
{
m_arrItems[i]->toXML(writer);
}
}
writer.WriteString(L"</personList>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"person" == sName )
{
m_arrItems.push_back(new CPerson(oReader));
}
}
}
virtual EElementType getType () const
{
return et_x_PersonList;
}
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
NSStringUtils::CStringBuilder sXml;
sXml.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
toXML(sXml);
std::wstring sPath = oPath.GetPath();
NSFile::CFileBinary::SaveToFile(sPath, sXml.GetData());
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
}
virtual const OOX::FileType type() const
{
return OOX::Spreadsheet::FileTypes::Persons;
}
virtual const CPath DefaultDirectory() const
{
return type().DefaultDirectory();
}
virtual const CPath DefaultFileName() const
{
return type().DefaultFileName();
}
const CPath& GetReadPath()
{
return m_oReadPath;
}
private:
CPath m_oReadPath;
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
};
class CThreadedComment : public WritingElement
{
public:
WritingElement_AdditionConstructors(CThreadedComment)
CThreadedComment()
{
}
virtual ~CThreadedComment()
{
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<threadedComment");
WritingStringNullableAttrEncodeXmlString(L"ref", ref, ref->ToString());
WritingStringNullableAttrString(L"personId", personId, *personId);
WritingStringNullableAttrString(L"id", id, *id);
WritingStringNullableAttrString(L"dT", dT, *dT);
writer.WriteString(L">");
writer.WriteString(L"<text>");
m_oText->toXML2(writer);
writer.WriteString(L"</text>");
writer.WriteString(L"</threadedComment>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( _T("text") == sName )
m_oText = oReader;
}
}
virtual EElementType getType () const
{
return et_x_ThreadedComment;
}
private:
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"ref", ref )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"personId", personId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"id", id )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"dT", dT )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::CRelationshipId> ref;
nullable_string personId;
nullable_string id;
nullable_string dT;
nullable<CSi> m_oText;
};
class CThreadedComments : public OOX::FileGlobalEnumerated, public OOX::IFileContainer, public WritingElementWithChilds<CThreadedComment>
{
public:
CThreadedComments(OOX::Document* pMain) : OOX::IFileContainer(pMain), OOX::FileGlobalEnumerated(pMain)
{
CXlsx* xlsx = dynamic_cast<CXlsx*>(pMain);
if ((xlsx) && (!xlsx->m_arWorksheets.empty()))
{
xlsx->m_arWorksheets.back()->m_pThreadedComments = this;
}
}
CThreadedComments(OOX::Document* pMain, const CPath& oRootPath, const CPath& oPath) : OOX::IFileContainer(pMain), OOX::FileGlobalEnumerated(pMain)
{
CXlsx* xlsx = dynamic_cast<CXlsx*>(pMain);
if ((xlsx) && (!xlsx->m_arWorksheets.empty()))
{
xlsx->m_arWorksheets.back()->m_pThreadedComments = this;
}
read( oRootPath, oPath );
}
virtual ~CThreadedComments()
{
}
virtual void read(const CPath& oPath)
{
//don't use this. use read(const CPath& oRootPath, const CPath& oFilePath)
CPath oRootPath;
read(oRootPath, oPath);
}
virtual void read(const CPath& oRootPath, const CPath& oPath)
{
m_oReadPath = oPath;
IFileContainer::Read( oRootPath, oPath );
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )
return;
if ( !oReader.ReadNextNode() )
return;
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"ThreadedComments" == sName )
{
fromXML(oReader);
}
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<ThreadedComments");
writer.WriteString(L" xmlns=\"http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments\"");
writer.WriteString(L" xmlns:x=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"");
writer.WriteString(L">");
for ( size_t i = 0; i < m_arrItems.size(); ++i)
{
if ( m_arrItems[i] )
{
m_arrItems[i]->toXML(writer);
}
}
writer.WriteString(L"</ThreadedComments>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"threadedComment" == sName )
m_arrItems.push_back(new CThreadedComment(oReader));
}
}
virtual EElementType getType () const
{
return et_x_ThreadedComments;
}
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
NSStringUtils::CStringBuilder sXml;
sXml.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
toXML(sXml);
std::wstring sPath = oPath.GetPath();
NSFile::CFileBinary::SaveToFile(sPath, sXml.GetData());
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
}
virtual const OOX::FileType type() const
{
return OOX::Spreadsheet::FileTypes::ThreadedComments;
}
virtual const CPath DefaultDirectory() const
{
return type().DefaultDirectory();
}
virtual const CPath DefaultFileName() const
{
return type().DefaultFileName();
}
const CPath& GetReadPath()
{
return m_oReadPath;
}
private:
CPath m_oReadPath;
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
};
} //Spreadsheet
} // namespace OOX
#endif // OOX_XLSXTREADEDCOMMENTS_FILE_INCLUDE_H_

View File

@ -188,10 +188,9 @@ namespace ComplexTypes
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("val"), m_sVal )
WritingElement_ReadAttributes_End( oReader )
WritingElement_ReadAttributes_End( oReader )
}
public:
@ -300,18 +299,18 @@ namespace ComplexTypes
{
public:
ComplexTypes_AdditionConstructors(CChartLayoutTarget)
CChartLayoutTarget()
CChartLayoutTarget()
{
}
virtual ~CChartLayoutTarget()
{
}
virtual void FromXML(XmlUtils::CXmlNode& oNode)
virtual void FromXML(XmlUtils::CXmlNode& oNode)
{
XmlMacroReadAttributeBase( oNode, _T("val"), m_oVal );
}
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
@ -335,32 +334,30 @@ namespace ComplexTypes
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("val"), m_oVal )
WritingElement_ReadAttributes_End( oReader )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::Spreadsheet::CChartLayoutTarget<> > m_oVal;
nullable<SimpleTypes::Spreadsheet::CChartLayoutTarget<>> m_oVal;
};
class CChartHMode : public ComplexType
{
public:
ComplexTypes_AdditionConstructors(CChartHMode)
CChartHMode()
CChartHMode()
{
}
virtual ~CChartHMode()
{
}
virtual void FromXML(XmlUtils::CXmlNode& oNode)
virtual void FromXML(XmlUtils::CXmlNode& oNode)
{
XmlMacroReadAttributeBase( oNode, _T("val"), m_oVal );
}
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void FromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes(oReader);
@ -384,15 +381,14 @@ namespace ComplexTypes
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("val"), m_oVal )
WritingElement_ReadAttributes_End( oReader )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::Spreadsheet::CChartHMode<> > m_oVal;
nullable<SimpleTypes::Spreadsheet::CChartHMode<>> m_oVal;
};
class CChartAxPos : public ComplexType
{
@ -433,15 +429,14 @@ namespace ComplexTypes
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("val"), m_oVal )
WritingElement_ReadAttributes_End( oReader )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::Spreadsheet::CChartAxPos<> > m_oVal;
nullable<SimpleTypes::Spreadsheet::CChartAxPos<>> m_oVal;
};
class CChartBarGrouping : public ComplexType
{
@ -531,15 +526,14 @@ namespace ComplexTypes
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("val"), m_oVal )
WritingElement_ReadAttributes_End( oReader )
WritingElement_ReadAttributes_End( oReader )
}
public:
nullable<SimpleTypes::Spreadsheet::CChartBarDerection<> > m_oVal;
nullable<SimpleTypes::Spreadsheet::CChartBarDirection<> > m_oVal;
};
class CChartSymbol : public ComplexType
{

View File

@ -46,8 +46,12 @@
#include "Worksheets/Worksheet.h"
#include "CalcChain/CalcChain.h"
#include "WorkbookComments.h"
#include "Comments/ThreadedComments.h"
#include "Comments/Comments.h"
#include "Table/Table.h"
#include "Table/QueryTable.h"
#include "Table/Connections.h"
#include "ExternalLinks/ExternalLinks.h"
#include "ExternalLinks/ExternalLinkPath.h"
#include "../DocxFormat/Diagram/DiagramDrawing.h"
@ -93,10 +97,16 @@ namespace OOX
return smart_ptr<OOX::File>(new CQueryTableFile( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == FileTypes::Comments )
return smart_ptr<OOX::File>(new CComments( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == FileTypes::ThreadedComments )
return smart_ptr<OOX::File>(new CThreadedComments( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == FileTypes::Persons)
return smart_ptr<OOX::File>(new CPersonList( pMain, oRootPath, oFileName));
else if ( oRelation.Type() == FileTypes::WorkbookComments)
return smart_ptr<OOX::File>(new WorkbookComments( pMain, oRootPath, oFileName));
else if ( oRelation.Type() == FileTypes::ExternalLinks )
return smart_ptr<OOX::File>(new CExternalLink( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == FileTypes::Connections )
return smart_ptr<OOX::File>(new CConnectionsFile( pMain, oRootPath, oFileName ));
else if ( oRelation.Type() == OOX::FileTypes::Chart )
return smart_ptr<OOX::File>(new CChartSpace( pMain, oRootPath, oFileName ));
@ -190,6 +200,10 @@ namespace OOX
return smart_ptr<OOX::File>(new CChartDrawing( pMain, oRootPath, oFileName ));
else if ( pRelation->Type() == FileTypes::Comments )
return smart_ptr<OOX::File>(new CComments( pMain, oRootPath, oFileName ));
else if ( pRelation->Type() == FileTypes::ThreadedComments )
return smart_ptr<OOX::File>(new CThreadedComments( pMain, oRootPath, oFileName ));
else if ( pRelation->Type() == FileTypes::Persons)
return smart_ptr<OOX::File>(new CPersonList( pMain, oRootPath, oFileName));
else if ( pRelation->Type() == OOX::FileTypes::Chart )
return smart_ptr<OOX::File>(new CChartSpace( pMain, oRootPath, oFileName ));
else if ( pRelation->Type() == FileTypes::ExternalLinks )
@ -202,6 +216,8 @@ namespace OOX
{// https://msdn.microsoft.com/en-us/library/ff531845(v=office.12).aspx)
return smart_ptr<OOX::File>(new ExternalLinkPath( pMain, oRelationFilename ));
}
else if ( pRelation->Type() == FileTypes::Connections )
return smart_ptr<OOX::File>(new CConnectionsFile( pMain, oRootPath, oFileName ));
else if ( pRelation->Type() == OOX::FileTypes::OleObject)
{
if (pRelation->IsExternal())

View File

@ -72,6 +72,15 @@ namespace OOX
L"application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/calcChain");
const FileType ThreadedComments (L"../threadedComments", L"threadedComment.xml",
L"application/vnd.ms-excel.threadedcomments+xml",
L"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",
L"threadedComments/threadedComment", true, true);
const FileType Persons (L"../persons", L"person.xml",
L"application/vnd.ms-excel.person+xml",
L"http://schemas.microsoft.com/office/2017/10/relationships/person");
const FileType Comments (L"../", L"comments.xml",
L"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",
@ -85,7 +94,11 @@ namespace OOX
const FileType QueryTable (L"../queryTables", L"queryTable.xml",
L"application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/queryTable",
L"queryTables/table", true, true);
L"queryTables/queryTable", true, true);
const FileType Connections (L"", L"connections.xml",
L"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml",
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections");
const FileType Drawings (L"../drawings", L"drawing.xml",
L"application/vnd.openxmlformats-officedocument.drawing+xml",

View File

@ -45,22 +45,17 @@ namespace SimpleTypes
{
m_eValue = DefValue;
}
virtual E GetValue() const
{
return m_eValue;
}
virtual void SetValue(E eValue)
{
m_eValue = eValue;
}
virtual E FromString(std::wstring &sValue) = 0;
virtual std::wstring ToString() const = 0;
protected:
E m_eValue;
};
@ -78,9 +73,9 @@ namespace SimpleTypes
virtual ETableType FromString(std::wstring &sValue)
{
if ( _T("queryTable") == sValue ) this->m_eValue = typeQueryTable;
else if ( _T("worksheet") == sValue ) this->m_eValue = typeWorksheet;
else if ( _T("xml") == sValue ) this->m_eValue = typeXml;
if ( L"queryTable" == sValue ) this->m_eValue = typeQueryTable;
else if ( L"worksheet" == sValue ) this->m_eValue = typeWorksheet;
else if ( L"xml" == sValue ) this->m_eValue = typeXml;
else this->m_eValue = eDefValue;
return this->m_eValue;
@ -90,10 +85,10 @@ namespace SimpleTypes
{
switch(this->m_eValue)
{
case typeQueryTable : return _T("queryTable");break;
case typeWorksheet : return _T("worksheet");break;
case typeXml : return _T("xml");break;
default : return _T("typeWorksheet");
case typeQueryTable : return L"queryTable";
case typeXml : return L"xml";
case typeWorksheet :
default : return L"worksheet";
}
}
@ -101,6 +96,111 @@ namespace SimpleTypes
SimpleType_FromString (ETableType)
SimpleType_Operator_Equal (CTableType)
};
enum EDatabaseSourceType
{
typeODBCBasedSource = 1,
typeDAOBasedSource = 2,
typeFileBasedDatabaseSource = 3,
typeWebQuery = 4,
typeOLEDBBasedSource = 5,
typeTextBasedSource = 6,
typeADORecordSet = 7,
typeDSP
};
enum EExternalConnectionType
{
extConnTypeGeneral = 0,
extConnTypeText = 1,
extConnTypeMDY = 2,
extConnTypeDMY = 3,
extConnTypeYMD = 4,
extConnTypeMYD = 5,
extConnTypeDYM = 6,
extConnTypeYDM = 7,
extConnTypeSkip = 8,
extConnTypeEMD = 9
};
template<EExternalConnectionType eDefValue = extConnTypeGeneral>
class CExternalConnectionType : public CSimpleType<EExternalConnectionType, eDefValue>
{
public:
CExternalConnectionType() {}
virtual EExternalConnectionType FromString(std::wstring &sValue)
{
if ( L"general" == sValue ) this->m_eValue = extConnTypeGeneral;
else if ( L"text" == sValue ) this->m_eValue = extConnTypeText;
else if ( L"MDY" == sValue ) this->m_eValue = extConnTypeMDY;
else if ( L"DMY" == sValue ) this->m_eValue = extConnTypeDMY;
else if ( L"YMD" == sValue ) this->m_eValue = extConnTypeYMD;
else if ( L"MYD" == sValue ) this->m_eValue = extConnTypeMYD;
else if ( L"DYM" == sValue ) this->m_eValue = extConnTypeDYM;
else if ( L"YDM" == sValue ) this->m_eValue = extConnTypeYDM;
else if ( L"skip" == sValue ) this->m_eValue = extConnTypeSkip;
else if ( L"EMD" == sValue ) this->m_eValue = extConnTypeEMD;
else this->m_eValue = extConnTypeGeneral;
return this->m_eValue;
}
virtual std::wstring ToString () const
{
switch(this->m_eValue)
{
case extConnTypeText: return L"text";
case extConnTypeMDY: return L"MDY";
case extConnTypeDMY: return L"DMY";
case extConnTypeYMD: return L"YMD";
case extConnTypeMYD: return L"MYD";
case extConnTypeDYM: return L"DYM";
case extConnTypeYDM: return L"YDM";
case extConnTypeSkip: return L"stored";
case extConnTypeGeneral:
default : return L"general";
}
}
SimpleType_FromString (EExternalConnectionType)
SimpleType_Operator_Equal (CExternalConnectionType)
};
enum ECredMethod
{
integrated_method = 0,
none_method = 1,
prompt_method = 2,
stored_method = 3
};
template<ECredMethod eDefValue = integrated_method>
class CCredMethod : public CSimpleType<ECredMethod, eDefValue>
{
public:
CCredMethod() {}
virtual ECredMethod FromString(std::wstring &sValue)
{
if ( L"integrated" == sValue ) this->m_eValue = integrated_method;
else if ( L"none" == sValue ) this->m_eValue = none_method;
else if ( L"prompt" == sValue ) this->m_eValue = prompt_method;
else if ( L"stored" == sValue ) this->m_eValue = stored_method;
else this->m_eValue = integrated_method;
return this->m_eValue;
}
virtual std::wstring ToString () const
{
switch(this->m_eValue)
{
case none_method: return L"none";
case prompt_method: return L"prompt";
case stored_method: return L"stored";
case integrated_method:
default : return L"integrated";
}
}
SimpleType_FromString (ECredMethod)
SimpleType_Operator_Equal (CCredMethod)
};
enum EVisibleType
{
@ -116,30 +216,169 @@ namespace SimpleTypes
virtual EVisibleType FromString(std::wstring &sValue)
{
if ( _T("hidden") == sValue ) this->m_eValue = visibleHidden;
else if ( _T("veryHidden") == sValue ) this->m_eValue = visibleVeryHidden;
else if ( _T("visible") == sValue ) this->m_eValue = visibleVisible;
if ( L"hidden" == sValue ) this->m_eValue = visibleHidden;
else if ( L"veryHidden" == sValue ) this->m_eValue = visibleVeryHidden;
else if ( L"visible" == sValue ) this->m_eValue = visibleVisible;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
virtual std::wstring ToString () const
{
switch(this->m_eValue)
{
case visibleHidden : return _T("hidden");break;
case visibleVeryHidden : return _T("veryHidden");break;
case visibleVisible : return _T("visible");break;
default : return _T("visible");
case visibleHidden : return L"hidden";
case visibleVeryHidden : return L"veryHidden";
case visibleVisible :
default : return L"visible";
}
}
SimpleType_FromString (EVisibleType)
SimpleType_Operator_Equal (CVisibleType)
};
enum EHtmlFormat
{
htmlNone = 0,
htmlRtf = 1,
htmlAll = 2
};
template<EHtmlFormat eDefValue = htmlNone>
class CHtmlFormat : public CSimpleType<EHtmlFormat, eDefValue>
{
public:
CHtmlFormat() {}
virtual EHtmlFormat FromString(std::wstring &sValue)
{
if ( L"none" == sValue ) this->m_eValue = htmlNone;
else if ( L"veryHidden" == sValue ) this->m_eValue = htmlRtf;
else if ( L"visible" == sValue ) this->m_eValue = htmlAll;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
virtual std::wstring ToString () const
{
switch(this->m_eValue)
{
case htmlNone : return L"none";
case htmlRtf : return L"rtf";
case htmlAll : return L"all";
default : return L"none";
}
}
SimpleType_FromString (EHtmlFormat)
SimpleType_Operator_Equal (CHtmlFormat)
};
enum EParameterType
{
parameterPrompt = 0,
parameterValue = 1,
parameterCell = 2
};
template<EParameterType eDefValue = parameterPrompt>
class CParameterType : public CSimpleType<EParameterType, eDefValue>
{
public:
CParameterType() {}
virtual EParameterType FromString(std::wstring &sValue)
{
if ( L"promt" == sValue ) this->m_eValue = parameterPrompt;
else if ( L"value" == sValue ) this->m_eValue = parameterValue;
else if ( L"cell" == sValue ) this->m_eValue = parameterCell;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
virtual std::wstring ToString () const
{
switch(this->m_eValue)
{
case parameterValue : return L"value";
case parameterCell : return L"cell";
case parameterPrompt :
default : return L"promt";
}
}
SimpleType_FromString (EParameterType)
SimpleType_Operator_Equal (CParameterType)
};
enum EQualifier
{
doubleQuote = 0,
singleQuote = 1,
noneQuote = 2
};
template<EQualifier eDefValue = doubleQuote>
class CQualifier : public CSimpleType<EQualifier, eDefValue>
{
public:
CQualifier() {}
virtual EQualifier FromString(std::wstring &sValue)
{
if ( L"doubleQuote" == sValue ) this->m_eValue = doubleQuote;
else if ( L"singleQuote" == sValue ) this->m_eValue = singleQuote;
else if ( L"none" == sValue ) this->m_eValue = noneQuote;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
virtual std::wstring ToString () const
{
switch(this->m_eValue)
{
case noneQuote : return L"none";
case singleQuote : return L"singleQuote";
case doubleQuote :
default : return L"doubleQuote";
}
}
SimpleType_FromString (EQualifier)
SimpleType_Operator_Equal (CQualifier)
};
enum EFileType
{
fileTypeMac = 0,
fileTypeWin = 1,
fileTypeDos = 2,
fileTypeLin = 3,
fileTypeOther = 4
};
template<EFileType eDefValue = fileTypeWin>
class CFileType : public CSimpleType<EFileType, eDefValue>
{
public:
CFileType() {}
virtual EFileType FromString(std::wstring &sValue)
{
if ( L"win" == sValue ) this->m_eValue = fileTypeWin;
else if ( L"mac" == sValue ) this->m_eValue = fileTypeMac;
else if ( L"lin" == sValue ) this->m_eValue = fileTypeLin;
else if ( L"dos" == sValue ) this->m_eValue = fileTypeDos;
else if ( L"other" == sValue ) this->m_eValue = fileTypeOther;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
virtual std::wstring ToString () const
{
switch(this->m_eValue)
{
case fileTypeMac : return L"mac";
case fileTypeDos : return L"dos";
case fileTypeLin : return L"lin";
case fileTypeOther : return L"other";
case fileTypeWin :
default : return L"win";
}
}
SimpleType_FromString (EFileType)
SimpleType_Operator_Equal (CFileType)
};
enum EPhoneticAlignmentType
{
phoneticalignmentCenter = 0,
@ -156,10 +395,10 @@ namespace SimpleTypes
virtual EPhoneticAlignmentType FromString(std::wstring &sValue)
{
if ( _T("center") == sValue ) this->m_eValue = phoneticalignmentCenter;
else if ( _T("distributed") == sValue ) this->m_eValue = phoneticalignmentDistributed;
else if ( _T("left") == sValue ) this->m_eValue = phoneticalignmentLeft;
else if ( _T("noControl") == sValue ) this->m_eValue = phoneticalignmentNoControl;
if ( L"center" == sValue ) this->m_eValue = phoneticalignmentCenter;
else if ( L"distributed"== sValue ) this->m_eValue = phoneticalignmentDistributed;
else if ( L"left" == sValue ) this->m_eValue = phoneticalignmentLeft;
else if ( L"noControl" == sValue ) this->m_eValue = phoneticalignmentNoControl;
else this->m_eValue = eDefValue;
return this->m_eValue;
@ -167,7 +406,14 @@ namespace SimpleTypes
virtual std::wstring ToString () const
{
return _T("noControl");
switch(this->m_eValue)
{
case phoneticalignmentCenter : return L"center";
case phoneticalignmentDistributed : return L"distributed";
case phoneticalignmentLeft : return L"left";
case phoneticalignmentNoControl :
default : return L"noControl";
}
}
SimpleType_FromString (EPhoneticAlignmentType)
@ -190,10 +436,10 @@ namespace SimpleTypes
virtual EPhoneticTypeType FromString(std::wstring &sValue)
{
if ( _T("fullwidthKatakana") == sValue ) this->m_eValue = phonetictypeFullwidthKatakana;
else if ( _T("halfwidthKatakana") == sValue ) this->m_eValue = phonetictypeHalfwidthKatakana;
else if ( _T("hiragana") == sValue ) this->m_eValue = phonetictypeHiragana;
else if ( _T("noConversion") == sValue ) this->m_eValue = phonetictypeNoConversion;
if ( L"fullwidthKatakana" == sValue ) this->m_eValue = phonetictypeFullwidthKatakana;
else if ( L"halfwidthKatakana" == sValue ) this->m_eValue = phonetictypeHalfwidthKatakana;
else if ( L"hiragana" == sValue ) this->m_eValue = phonetictypeHiragana;
else if ( L"noConversion" == sValue ) this->m_eValue = phonetictypeNoConversion;
else this->m_eValue = eDefValue;
return this->m_eValue;
@ -201,7 +447,14 @@ namespace SimpleTypes
virtual std::wstring ToString () const
{
return _T("noConversion");
switch(this->m_eValue)
{
case phonetictypeFullwidthKatakana : return L"fullwidthKatakana";
case phonetictypeHalfwidthKatakana : return L"halfwidthKatakana";
case phonetictypeHiragana : return L"hiragana";
case phonetictypeNoConversion :
default : return L"noConversion";
}
}
SimpleType_FromString (EPhoneticTypeType)
@ -881,7 +1134,12 @@ namespace SimpleTypes
virtual std::wstring ToString () const
{
return _T("line");
switch(this->m_eValue)
{
case gradienttypeLine : return _T("line"); break;
case gradienttypePath : return _T("path"); break;
default:return _T("line");
}
}
SimpleType_FromString (EGradientType)
@ -1552,18 +1810,18 @@ namespace SimpleTypes
SimpleType_FromString (EChartBarGrouping)
SimpleType_Operator_Equal (CChartBarGrouping)
};
enum EChartBarDerection
enum EChartBarDirection
{
chartbardirectionBar = 0,
chartbardirectionCol = 1
};
template<EChartBarDerection eDefValue = chartbardirectionBar>
class CChartBarDerection : public CSimpleType<EChartBarDerection, eDefValue>
template<EChartBarDirection eDefValue = chartbardirectionBar>
class CChartBarDirection : public CSimpleType<EChartBarDirection, eDefValue>
{
public:
CChartBarDerection() {}
CChartBarDirection() {}
virtual EChartBarDerection FromString(std::wstring &sValue)
virtual EChartBarDirection FromString(std::wstring &sValue)
{
if(_T("bar") == sValue)
this->m_eValue = chartbardirectionBar;
@ -1578,14 +1836,14 @@ namespace SimpleTypes
{
switch(this->m_eValue)
{
case chartbardirectionBar: return _T("bar"); break;
case chartbardirectionCol: return _T("col"); break;
default: return _T("bar");
case chartbardirectionBar: return L"bar"; break;
case chartbardirectionCol: return L"col"; break;
default: return L"bar";
}
}
SimpleType_FromString (EChartBarDerection)
SimpleType_Operator_Equal (CChartBarDerection)
SimpleType_FromString (EChartBarDirection)
SimpleType_Operator_Equal (CChartBarDirection)
};
enum EChartSymbol
{
@ -2200,7 +2458,13 @@ namespace SimpleTypes
Arrows5 = 13,
Arrows5Gray = 14,
Quarters5 = 15,
Rating5 = 16
Rating5 = 16,
Triangles3 = 17,
Stars3 = 18,
Boxes5 = 19,
NoIcons = 20
};
template<EIconSetType eDefValue = Arrows3>
class ST_IconSetType : public CSimpleType<EIconSetType, eDefValue>
@ -2210,23 +2474,27 @@ namespace SimpleTypes
virtual EIconSetType FromString(std::wstring &sValue)
{
if(_T("3Arrows") == sValue) this->m_eValue = Arrows3;
else if(_T("3ArrowsGray") == sValue) this->m_eValue = Arrows3Gray;
else if(_T("3Flags") == sValue) this->m_eValue = Flags3;
else if(_T("3Signs") == sValue) this->m_eValue = Signs3;
else if(_T("3Symbols") == sValue) this->m_eValue = Symbols3;
else if(_T("3Symbols2") == sValue) this->m_eValue = Symbols3_2;
else if(_T("3TrafficLights1") == sValue)this->m_eValue = Traffic3Lights1;
else if(_T("3TrafficLights2") == sValue)this->m_eValue = Traffic3Lights2;
else if(_T("4Arrows") == sValue) this->m_eValue = Arrows4;
else if(_T("4ArrowsGray") == sValue) this->m_eValue = Arrows4Gray;
else if(_T("4Rating") == sValue) this->m_eValue = Rating4;
else if(_T("4RedToBlack") == sValue) this->m_eValue = RedToBlack4;
else if(_T("4TrafficLights") == sValue) this->m_eValue = Traffic4Lights;
else if(_T("5Arrows") == sValue) this->m_eValue = Arrows5;
else if(_T("5ArrowsGray") == sValue) this->m_eValue = Arrows5Gray;
else if(_T("5Quarters") == sValue) this->m_eValue = Quarters5;
else if(_T("5Rating") == sValue) this->m_eValue = Rating5;
if(L"3Arrows" == sValue) this->m_eValue = Arrows3;
else if(L"3ArrowsGray" == sValue) this->m_eValue = Arrows3Gray;
else if(L"3Flags" == sValue) this->m_eValue = Flags3;
else if(L"3Signs" == sValue) this->m_eValue = Signs3;
else if(L"3Symbols" == sValue) this->m_eValue = Symbols3;
else if(L"3Symbols2" == sValue) this->m_eValue = Symbols3_2;
else if(L"3TrafficLights1" == sValue) this->m_eValue = Traffic3Lights1;
else if(L"3TrafficLights2" == sValue) this->m_eValue = Traffic3Lights2;
else if(L"4Arrows" == sValue) this->m_eValue = Arrows4;
else if(L"4ArrowsGray" == sValue) this->m_eValue = Arrows4Gray;
else if(L"4Rating" == sValue) this->m_eValue = Rating4;
else if(L"4RedToBlack" == sValue) this->m_eValue = RedToBlack4;
else if(L"4TrafficLights" == sValue) this->m_eValue = Traffic4Lights;
else if(L"5Arrows" == sValue) this->m_eValue = Arrows5;
else if(L"5ArrowsGray" == sValue) this->m_eValue = Arrows5Gray;
else if(L"5Quarters" == sValue) this->m_eValue = Quarters5;
else if(L"5Rating" == sValue) this->m_eValue = Rating5;
else if(L"3Triangles" == sValue) this->m_eValue = Triangles3;
else if(L"3Stars" == sValue) this->m_eValue = Stars3;
else if(L"5Boxes" == sValue) this->m_eValue = Boxes5;
else if(L"NoIcons" == sValue) this->m_eValue = NoIcons;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
@ -2235,30 +2503,112 @@ namespace SimpleTypes
{
switch(this->m_eValue)
{
case Arrows3 : return _T("3Arrows"); break;
case Arrows3Gray : return _T("3ArrowsGray"); break;
case Flags3 : return _T("3Flags"); break;
case Signs3 : return _T("3Signs"); break;
case Symbols3 : return _T("3Symbols"); break;
case Symbols3_2 : return _T("3Symbols2"); break;
case Traffic3Lights1: return _T("3TrafficLights1");break;
case Traffic3Lights2: return _T("3TrafficLights2");break;
case Arrows4 : return _T("4Arrows"); break;
case Arrows4Gray : return _T("4ArrowsGray"); break;
case Rating4 : return _T("4Rating"); break;
case RedToBlack4 : return _T("4RedToBlack"); break;
case Traffic4Lights : return _T("4TrafficLights");break;
case Arrows5 : return _T("5Arrows"); break;
case Arrows5Gray : return _T("5ArrowsGray"); break;
case Quarters5 : return _T("5Quarters"); break;
case Rating5 : return _T("5Rating"); break;
default : return _T("3Arrows");
case Arrows3 : return L"3Arrows"; break;
case Arrows3Gray : return L"3ArrowsGray"; break;
case Flags3 : return L"3Flags"; break;
case Signs3 : return L"3Signs"; break;
case Symbols3 : return L"3Symbols"; break;
case Symbols3_2 : return L"3Symbols2"; break;
case Traffic3Lights1: return L"3TrafficLights1"; break;
case Traffic3Lights2: return L"3TrafficLights2"; break;
case Arrows4 : return L"4Arrows"; break;
case Arrows4Gray : return L"4ArrowsGray"; break;
case Rating4 : return L"4Rating"; break;
case RedToBlack4 : return L"4RedToBlack"; break;
case Traffic4Lights : return L"4TrafficLights"; break;
case Arrows5 : return L"5Arrows"; break;
case Arrows5Gray : return L"5ArrowsGray"; break;
case Quarters5 : return L"5Quarters"; break;
case Rating5 : return L"5Rating"; break;
case Triangles3 : return L"3Triangles"; break;
case Stars3 : return L"3Stars"; break;
case Boxes5 : return L"5Boxes"; break;
case NoIcons : return L"NoIcons"; break;
default : return L"3Arrows";
}
}
SimpleType_FromString (EIconSetType)
SimpleType_Operator_Equal (ST_IconSetType)
};
};
//--------------------------------------------------------
// ST_DataBarAxisPosition
//--------------------------------------------------------
enum EDataBarAxisPosition
{
automatic_pos = 0,
middle_pos = 1,
none_pos = 2
};
template<EDataBarAxisPosition eDefValue = automatic_pos>
class ST_DataBarAxisPosition : public CSimpleType<EDataBarAxisPosition, eDefValue>
{
public:
ST_DataBarAxisPosition() {}
virtual EDataBarAxisPosition FromString(std::wstring &sValue)
{
if(L"automatic" == sValue) this->m_eValue = automatic_pos;
else if(L"middle" == sValue) this->m_eValue = middle_pos;
else if(L"none" == sValue) this->m_eValue = none_pos;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
virtual std::wstring ToString () const
{
switch(this->m_eValue)
{
case automatic_pos : return L"automatic";break;
case middle_pos : return L"middle"; break;
case none_pos : return L"none"; break;
default : return L"automatic";
}
}
SimpleType_FromString (EDataBarAxisPosition)
SimpleType_Operator_Equal (ST_DataBarAxisPosition)
};
//--------------------------------------------------------
// ST_DataBarDirection
//--------------------------------------------------------
enum EDataBarDirection
{
context_direction = 0,
leftToRight = 1,
rightToLeft = 2
};
template<EDataBarDirection eDefValue = context_direction>
class ST_DataBarDirection : public CSimpleType<EDataBarDirection, eDefValue>
{
public:
ST_DataBarDirection() {}
virtual EDataBarDirection FromString(std::wstring &sValue)
{
if(L"context" == sValue) this->m_eValue = context_direction;
else if(L"leftToRight" == sValue) this->m_eValue = leftToRight;
else if(L"rightToLeft" == sValue) this->m_eValue = rightToLeft;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
virtual std::wstring ToString () const
{
switch(this->m_eValue)
{
case context_direction : return L"context";
case leftToRight : return L"leftToRight";
case rightToLeft : return L"rightToLeft";
default : return L"automatic";
}
}
SimpleType_FromString (EDataBarDirection)
SimpleType_Operator_Equal (ST_DataBarDirection)
};
//----------------------------------------------------
// 18.18.15 ST_CfOperator (Conditional Format Operators)
//----------------------------------------------------
@ -2417,6 +2767,8 @@ namespace SimpleTypes
Number = 3,
Percent = 4,
Percentile = 5,
autoMin = 6,
autoMax = 7
};
template<ECfvoType eDefValue = Number>
class ST_CfvoType : public CSimpleType<ECfvoType, eDefValue>
@ -2432,7 +2784,9 @@ namespace SimpleTypes
else if(_T("num") == sValue) this->m_eValue = Number;
else if(_T("percent") == sValue) this->m_eValue = Percent;
else if(_T("percentile") == sValue) this->m_eValue = Percentile;
else this->m_eValue = eDefValue;
else if(_T("autoMin") == sValue) this->m_eValue = autoMin;
else if(_T("autoMax") == sValue) this->m_eValue = autoMax;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
@ -2446,6 +2800,8 @@ namespace SimpleTypes
case Number: return _T("num"); break;
case Percent: return _T("percent"); break;
case Percentile:return _T("percentile"); break;
case autoMin: return _T("autoMin"); break;
case autoMax: return _T("autoMax"); break;
default : return _T("num");
}
}

View File

@ -141,6 +141,14 @@ namespace OOX
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<stop");
WritingStringNullableAttrDouble(L"position", m_oPosition, m_oPosition->GetValue());
writer.WriteString(L">");
if (m_oColor.IsInit())
{
m_oColor->toXML(writer);
}
writer.WriteString(L"</stop>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
@ -194,6 +202,19 @@ namespace OOX
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<gradientFill");
WritingStringNullableAttrString(L"type", m_oType, m_oType->ToString());
WritingStringNullableAttrDouble(L"left", m_oLeft, m_oLeft->GetValue());
WritingStringNullableAttrDouble(L"right", m_oRight, m_oRight->GetValue());
WritingStringNullableAttrDouble(L"top", m_oTop, m_oTop->GetValue());
WritingStringNullableAttrDouble(L"bottom", m_oBottom, m_oBottom->GetValue());
WritingStringNullableAttrDouble(L"degree", m_oDegree, m_oDegree->GetValue());
writer.WriteString(L">");
for(size_t i = 0; i < m_arrItems.size(); ++i)
{
m_arrItems[i]->toXML(writer);
}
writer.WriteString(L"</gradientFill>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
@ -259,6 +280,8 @@ namespace OOX
writer.WriteString(L"<fill>");
if(m_oPatternFill.IsInit())
m_oPatternFill->toXML(writer);
if(m_oGradientFill.IsInit())
m_oGradientFill->toXML(writer);
writer.WriteString(L"</fill>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)

View File

@ -64,7 +64,11 @@ namespace OOX
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<dxf>");
toXML2(writer, L"dxf");
}
void toXML2(NSStringUtils::CStringBuilder& writer, const std::wstring &node_name) const
{
writer.WriteString(L"<" + node_name + L">");
if(m_oFont.IsInit())
m_oFont->toXML(writer);
if(m_oNumFmt.IsInit())
@ -77,8 +81,9 @@ namespace OOX
m_oBorder->toXML(writer);
if(m_oProtection.IsInit())
m_oProtection->toXML(writer);
writer.WriteString(L"</dxf>");
writer.WriteString(L"</" + node_name + L">");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );

View File

@ -0,0 +1,831 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef OOX_CONNECTIONS_INCLUDE_H_
#define OOX_CONNECTIONS_INCLUDE_H_
#include "../CommonInclude.h"
namespace OOX
{
namespace Spreadsheet
{
class CTextField : public WritingElement
{
public:
WritingElement_AdditionConstructors(CTextField)
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<textField");
WritingStringNullableAttrString (L"type", m_oType, m_oType->ToString())
WritingStringNullableAttrInt (L"position", m_oPosition, *m_oPosition)
writer.WriteString(L"</>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
}
virtual EElementType getType () const
{
return et_x_textField;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"type", m_oType )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"position", m_oPosition )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::Spreadsheet::CExternalConnectionType<>> m_oType;
nullable_int m_oPosition;
};
class CTextFields : public WritingElementWithChilds<CTextField>
{
public:
WritingElement_AdditionConstructors(CTextFields)
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<textField ");
WritingStringAttrInt(L"count", (int)m_arrItems.size());
writer.WriteString(L">");
for (size_t i = 0; i < m_arrItems.size(); i++)
{
if (m_arrItems[i])
m_arrItems[i]->toXML(writer);
}
writer.WriteString(L"</textField>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"textField" == sName )
{
CTextField *pPara = new CTextField(oReader);
m_arrItems.push_back(pPara);
}
}
}
virtual EElementType getType () const
{
return et_x_textFields;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if( oReader, L"count", m_oCount )
WritingElement_ReadAttributes_End( oReader )
}
nullable_int m_oCount;
};
class CParameter : public WritingElement
{
public:
WritingElement_AdditionConstructors(CParameter)
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<parameter");
WritingStringNullableAttrString (L"name", m_oName, *m_oName)
WritingStringNullableAttrString (L"parameterType", m_oParameterType, m_oParameterType->ToString())
WritingStringNullableAttrString (L"prompt", m_oPrompt, *m_oPrompt)
WritingStringNullableAttrInt (L"sqlType", m_oSqlType, *m_oSqlType)
WritingStringNullableAttrString (L"string", m_oString, *m_oString)
WritingStringNullableAttrString (L"cell", m_oCell, *m_oCell)
WritingStringNullableAttrInt (L"integer", m_oInteger, *m_oInteger)
WritingStringNullableAttrDouble (L"double", m_oDouble, *m_oDouble)
WritingStringNullableAttrBool (L"boolean", m_oBoolean)
WritingStringNullableAttrBool (L"refreshOnChange",m_oRefreshOnChange)
writer.WriteString(L"</>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
}
virtual EElementType getType () const
{
return et_x_parameter;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"name", m_oName )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"prompt", m_oPrompt )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"sqlType", m_oSqlType )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"refreshOnChange", m_oRefreshOnChange )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"parameterType", m_oParameterType )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"integer", m_oInteger )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"cell", m_oCell )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"string", m_oString )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"boolean", m_oBoolean )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"double", m_oDouble )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::Spreadsheet::CParameterType<>> m_oParameterType;
nullable_string m_oName;
nullable_string m_oPrompt;
nullable_int m_oSqlType;
nullable<SimpleTypes::COnOff<>> m_oRefreshOnChange;
nullable_string m_oString;
nullable_string m_oCell;
nullable_int m_oInteger;
nullable_double m_oDouble;
nullable<SimpleTypes::COnOff<>> m_oBoolean;
};
class CParameters : public WritingElementWithChilds<CParameter>
{
public:
WritingElement_AdditionConstructors(CParameters)
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<parameters ");
WritingStringAttrInt(L"count", (int)m_arrItems.size());
writer.WriteString(L">");
for (size_t i = 0; i < m_arrItems.size(); i++)
{
if (m_arrItems[i])
m_arrItems[i]->toXML(writer);
}
writer.WriteString(L"</parameters>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"Parameter" == sName )
{
CParameter *pPara = new CParameter(oReader);
m_arrItems.push_back(pPara);
}
}
}
virtual EElementType getType () const
{
return et_x_parameters;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if( oReader, L"count", m_oCount )
WritingElement_ReadAttributes_End( oReader )
}
nullable_int m_oCount;
};
class CDbPr : public WritingElement
{
public:
WritingElement_AdditionConstructors(CDbPr)
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<dbPr");
WritingStringNullableAttrString (L"connection", m_oConnection, *m_oConnection)
WritingStringNullableAttrString (L"command", m_oCommand, *m_oCommand)
WritingStringNullableAttrString (L"serverCommand", m_oServerCommand, *m_oServerCommand)
WritingStringNullableAttrInt (L"commandType", m_oCommandType, *m_oCommandType)
writer.WriteString(L"</>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
}
virtual EElementType getType () const
{
return et_x_dbPr;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"connection", m_oConnection )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"command", m_oCommand )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"serverCommand", m_oServerCommand )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"commandType", m_oCommandType )
WritingElement_ReadAttributes_End( oReader )
}
nullable_string m_oConnection;
nullable_string m_oCommand;
nullable_string m_oServerCommand;
nullable_int m_oCommandType;
};
class COlapPr : public WritingElement
{
public:
WritingElement_AdditionConstructors(COlapPr)
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<olapPr");
WritingStringNullableAttrString (L"localConnection", m_oLocalConnection, *m_oLocalConnection)
WritingStringNullableAttrInt (L"rowDrillCount", m_oRowDrillCount, *m_oRowDrillCount)
WritingStringNullableAttrBool (L"local", m_oLocal)
WritingStringNullableAttrBool (L"localRefresh", m_oLocalRefresh)
WritingStringNullableAttrBool (L"sendLocale", m_oSendLocale)
WritingStringNullableAttrBool (L"serverNumberFormat", m_oServerNumberFormat)
WritingStringNullableAttrBool (L"serverFont", m_oServerFont)
WritingStringNullableAttrBool (L"serverFontColor", m_oServerFontColor)
writer.WriteString(L"</>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
}
virtual EElementType getType () const
{
return et_x_olapPr;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"localConnection", m_oLocalConnection )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"rowDrillCount", m_oRowDrillCount )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"local", m_oLocal )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"localRefresh", m_oLocalRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"sendLocale", m_oSendLocale )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"serverNumberFormat",m_oServerNumberFormat )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"serverFont", m_oServerFont )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"serverFontColor", m_oServerFontColor )
WritingElement_ReadAttributes_End( oReader )
}
nullable_string m_oLocalConnection;
nullable_int m_oRowDrillCount;
nullable<SimpleTypes::COnOff<>> m_oLocal;
nullable<SimpleTypes::COnOff<>> m_oLocalRefresh;
nullable<SimpleTypes::COnOff<>> m_oSendLocale;
nullable<SimpleTypes::COnOff<>> m_oServerNumberFormat;
nullable<SimpleTypes::COnOff<>> m_oServerFont;
nullable<SimpleTypes::COnOff<>> m_oServerFontColor;
};
class CWebPr : public WritingElement
{
public:
WritingElement_AdditionConstructors(CWebPr)
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<webPr");
WritingStringNullableAttrString (L"url", m_oUrl, *m_oUrl)
WritingStringNullableAttrString (L"post", m_oPost, *m_oPost)
WritingStringNullableAttrString (L"editPage", m_oEditPage, *m_oEditPage)
WritingStringNullableAttrString (L"htmlFormat", m_oHtmlFormat, m_oHtmlFormat->ToString())
WritingStringNullableAttrBool (L"xml", m_oXml)
WritingStringNullableAttrBool (L"sourceData", m_oSourceData)
WritingStringNullableAttrBool (L"consecutive",m_oConsecutive)
WritingStringNullableAttrBool (L"firstRow", m_oFirstRow)
WritingStringNullableAttrBool (L"xl97", m_oXl97)
WritingStringNullableAttrBool (L"textDates", m_oTextDates)
WritingStringNullableAttrBool (L"xl2000", m_oXl2000)
WritingStringNullableAttrBool (L"htmlTables", m_oHtmlTables)
//if (m_oTables.IsInit())
//{
// writer.WriteString(L">");
// m_oTables->toXML(writer);
// writer.WriteString(L"</webPr>");
//}
//else
{
writer.WriteString(L"</>");
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while (oReader.ReadNextSiblingNode(nCurDepth))
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
//if (L"tables" == sName)
// m_oTables = oReader;
}
}
virtual EElementType getType () const
{
return et_x_webPr;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"url", m_oUrl )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"post", m_oPost )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"editPage", m_oEditPage )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"htmlFormat", m_oHtmlFormat )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"xml", m_oXml )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"sourceData", m_oSourceData )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"consecutive", m_oConsecutive )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"firstRow", m_oFirstRow )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"xl97", m_oXl97 )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"textDates", m_oTextDates )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"xl2000", m_oXl2000 )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"htmlTables", m_oHtmlTables )
WritingElement_ReadAttributes_End( oReader )
}
nullable_string m_oUrl;
nullable_string m_oPost;
nullable_string m_oEditPage;
nullable<SimpleTypes::COnOff<>> m_oXml;
nullable<SimpleTypes::COnOff<>> m_oSourceData;
nullable<SimpleTypes::COnOff<>> m_oConsecutive;
nullable<SimpleTypes::COnOff<>> m_oFirstRow;
nullable<SimpleTypes::COnOff<>> m_oXl97;
nullable<SimpleTypes::COnOff<>> m_oTextDates;
nullable<SimpleTypes::COnOff<>> m_oXl2000;
nullable<SimpleTypes::COnOff<>> m_oHtmlTables;
nullable<SimpleTypes::Spreadsheet::CHtmlFormat<>> m_oHtmlFormat;
//nullable<CTables> m_oTables;
};
class CTextPr : public WritingElement
{
public:
WritingElement_AdditionConstructors(CTextPr)
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<textPr");
WritingStringNullableAttrString (L"characterSet",m_oCharacterSet, *m_oCharacterSet)
WritingStringNullableAttrString (L"sourceFile", m_oSourceFile, *m_oSourceFile)
WritingStringNullableAttrString (L"decimal", m_oDecimal, *m_oDecimal)
WritingStringNullableAttrString (L"delimiter", m_oDelimiter, *m_oDelimiter)
WritingStringNullableAttrString (L"thousands", m_oThousands, *m_oThousands)
WritingStringNullableAttrString (L"qualifier", m_oQualifier, m_oQualifier->ToString())
WritingStringNullableAttrString (L"fileType", m_oFileType, m_oFileType->ToString())
WritingStringNullableAttrInt (L"firstRow", m_oFirstRow, *m_oFirstRow)
WritingStringNullableAttrBool (L"prompt", m_oPrompt)
WritingStringNullableAttrBool (L"delimited", m_oDelimited)
WritingStringNullableAttrBool (L"tab", m_oTab)
WritingStringNullableAttrBool (L"space", m_oSpace)
WritingStringNullableAttrBool (L"comma", m_oComma)
WritingStringNullableAttrBool (L"semicolon", m_oSemicolon)
WritingStringNullableAttrBool (L"consecutive",m_oConsecutive)
if (m_oTextFields.IsInit())
{
writer.WriteString(L">");
m_oTextFields->toXML(writer);
writer.WriteString(L"</textPr>");
}
else
{
writer.WriteString(L"</>");
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while (oReader.ReadNextSiblingNode(nCurDepth))
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if (L"textFields" == sName)
m_oTextFields = oReader;
}
}
virtual EElementType getType () const
{
return et_x_textPr;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"characterSet", m_oCharacterSet )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"decimal", m_oDecimal )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"delimiter", m_oDelimiter )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"thousands", m_oThousands )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"sourceFile", m_oSourceFile )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"firstRow", m_oFirstRow )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"qualifier", m_oQualifier )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"fileType", m_oFileType )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"prompt", m_oPrompt )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"delimited", m_oDelimited )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"tab", m_oTab )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"space", m_oSpace )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"comma", m_oComma )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"semicolon", m_oSemicolon )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"consecutive", m_oConsecutive )
WritingElement_ReadAttributes_End( oReader )
}
nullable_string m_oCharacterSet;
nullable_string m_oSourceFile;
nullable_string m_oDecimal;
nullable_string m_oDelimiter;
nullable_string m_oThousands;
nullable_int m_oFirstRow;
nullable<SimpleTypes::Spreadsheet::CQualifier<>> m_oQualifier;
nullable<SimpleTypes::Spreadsheet::CFileType<>> m_oFileType;
nullable<SimpleTypes::COnOff<>> m_oPrompt;
nullable<SimpleTypes::COnOff<>> m_oDelimited;
nullable<SimpleTypes::COnOff<>> m_oTab;
nullable<SimpleTypes::COnOff<>> m_oSpace;
nullable<SimpleTypes::COnOff<>> m_oComma;
nullable<SimpleTypes::COnOff<>> m_oSemicolon;
nullable<SimpleTypes::COnOff<>> m_oConsecutive;
nullable<CTextFields> m_oTextFields;
};
class CConnection : public WritingElement
{
public:
WritingElement_AdditionConstructors(CConnection)
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
if(false == m_oName.IsInit()) return;
writer.WriteString(L"<connection");
WritingStringNullableAttrString(L"name", m_oName, *m_oName)
WritingStringNullableAttrString(L"description", m_oDescription, *m_oDescription)
WritingStringNullableAttrInt(L"type", m_oType, *m_oType)
WritingStringNullableAttrInt(L"id", m_oId, m_oId->GetValue())
WritingStringNullableAttrInt(L"interval", m_oInterval, *m_oInterval)
WritingStringNullableAttrBool(L"background", m_oBackground)
WritingStringNullableAttrBool(L"deleted", m_oDeleted)
WritingStringNullableAttrBool(L"keepAlive", m_oKeepAlive)
WritingStringNullableAttrBool(L"new", m_oNew)
WritingStringNullableAttrBool(L"refreshOnLoad", m_oRefreshOnLoad)
WritingStringNullableAttrBool(L"saveData", m_oSaveData)
WritingStringNullableAttrBool(L"savePassword", m_oSavePassword)
WritingStringNullableAttrInt(L"minRefreshableVersion", m_oMinRefreshableVersion, *m_oMinRefreshableVersion)
WritingStringNullableAttrInt(L"refreshedVersion", m_RefreshedVersion, *m_RefreshedVersion)
WritingStringNullableAttrInt(L"reconnectionMethod", m_oReconnectionMethod, *m_oReconnectionMethod)
WritingStringNullableAttrString(L"odcFile", m_oOdcFile, *m_oOdcFile)
WritingStringNullableAttrString(L"onlyUseConnectionFile", m_oOnlyUseConnectionFile, *m_oOnlyUseConnectionFile)
WritingStringNullableAttrString(L"singleSignOnId", m_oSingleSignOnId, *m_oSingleSignOnId)
WritingStringNullableAttrString(L"sourceFile", m_oSourceFile, *m_oSourceFile)
writer.WriteString(L">");
if (m_oDbPr.IsInit()) m_oDbPr->toXML(writer);
if (m_oOlapPr.IsInit()) m_oOlapPr->toXML(writer);
if (m_oTextPr.IsInit()) m_oTextPr->toXML(writer);
if (m_oWebPr.IsInit()) m_oWebPr->toXML(writer);
//if (m_oExtLst.IsInit()) m_oExtLst->toXML(writer);
writer.WriteString(L"</connection>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"dbPr" == sName )
m_oDbPr = oReader;
else if ( L"olapPr" == sName )
m_oOlapPr = oReader;
else if ( L"textPr" == sName )
m_oTextPr = oReader;
else if ( L"webPr" == sName )
m_oWebPr = oReader;
else if (L"extLst" == sName)
m_oExtLst = oReader;
}
}
virtual EElementType getType () const
{
return et_x_Connection;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"type", m_oType )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"name", m_oName )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"id", m_oId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"background", m_oBackground )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"credentials", m_oCredentials )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"deleted", m_oDeleted )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"description", m_oDescription )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"interval", m_oInterval )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"keepAlive", m_oKeepAlive )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"minRefreshableVersion", m_oMinRefreshableVersion )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"new", m_oNew )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"odcFile", m_oOdcFile )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"onlyUseConnectionFile", m_oOnlyUseConnectionFile )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"reconnectionMethod", m_oReconnectionMethod )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"refreshOnLoad", m_oRefreshOnLoad )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"saveData", m_oSaveData )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"savePassword", m_oSavePassword )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"singleSignOnId", m_oSingleSignOnId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"sourceFile", m_oSourceFile )
WritingElement_ReadAttributes_End( oReader )
}
nullable_int m_oType; //EDatabaseSourceType
nullable_string m_oName;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oId;
nullable<CDbPr> m_oDbPr;
nullable<COlapPr> m_oOlapPr;
nullable<CTextPr> m_oTextPr;
nullable<CWebPr> m_oWebPr;
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
nullable<SimpleTypes::Spreadsheet::CCredMethod<>> m_oCredentials;
nullable<SimpleTypes::COnOff<>> m_oBackground;
nullable<SimpleTypes::COnOff<>> m_oDeleted;
nullable_string m_oDescription;
nullable_int m_oInterval;
nullable<SimpleTypes::COnOff<>> m_oKeepAlive;
nullable_int m_oMinRefreshableVersion;
nullable<SimpleTypes::COnOff<>> m_oNew;
nullable_string m_oOdcFile;
nullable_string m_oOnlyUseConnectionFile;
nullable_int m_oReconnectionMethod;
nullable_int m_RefreshedVersion;
nullable<SimpleTypes::COnOff<>> m_oRefreshOnLoad;
nullable<SimpleTypes::COnOff<>> m_oSaveData;
nullable<SimpleTypes::COnOff<>> m_oSavePassword;
nullable_string m_oSingleSignOnId;
nullable_string m_oSourceFile;
};
class CConnections : public WritingElementWithChilds<CConnection>
{
public:
WritingElement_AdditionConstructors(CConnections)
CConnections()
{
}
virtual ~CConnections()
{
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<connections \
xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
mc:Ignorable=\"xr16\" \
xmlns:xr16=\"http://schemas.microsoft.com/office/spreadsheetml/2017/revision16\"");
WritingStringAttrInt(L"count", (int)m_arrItems.size());
writer.WriteString(L">");
for (size_t i = 0; i < m_arrItems.size(); i++)
{
if (m_arrItems[i])
m_arrItems[i]->toXML(writer);
}
writer.WriteString(L"</connections>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"connection" == sName )
{
CConnection *pConn = new CConnection(oReader);
m_arrItems.push_back(pConn);
}
}
}
virtual EElementType getType () const
{
return et_x_Connections;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if( oReader, L"count", m_oCount )
WritingElement_ReadAttributes_End( oReader )
}
nullable_int m_oCount;
};
class CConnectionsFile : public OOX::FileGlobalEnumerated, public OOX::IFileContainer
{
public:
CConnectionsFile(OOX::Document* pMain) : OOX::FileGlobalEnumerated(pMain), OOX::IFileContainer(pMain)
{
m_bSpreadsheets = true;
}
CConnectionsFile(OOX::Document* pMain, const CPath& oRootPath, const CPath& oPath) : OOX::FileGlobalEnumerated(pMain), OOX::IFileContainer(pMain)
{
m_bSpreadsheets = true;
read( oRootPath, oPath );
}
virtual ~CConnectionsFile()
{
}
virtual void read(const CPath& oPath)
{
//don't use this. use read(const CPath& oRootPath, const CPath& oFilePath)
CPath oRootPath;
read(oRootPath, oPath);
}
virtual void read(const CPath& oRootPath, const CPath& oPath)
{
m_oReadPath = oPath;
IFileContainer::Read( oRootPath, oPath );
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )
return;
if ( !oReader.ReadNextNode() )
return;
m_oConnections = oReader;
}
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
if(false == m_oConnections.IsInit()) return;
NSStringUtils::CStringBuilder sXml;
sXml.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
m_oConnections->toXML(sXml);
std::wstring sPath = oPath.GetPath();
NSFile::CFileBinary::SaveToFile(sPath, sXml.GetData());
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
IFileContainer::Write( oPath, oDirectory, oContent );
}
virtual const OOX::FileType type() const
{
return OOX::Spreadsheet::FileTypes::Connections;
}
virtual const CPath DefaultDirectory() const
{
return type().DefaultDirectory();
}
virtual const CPath DefaultFileName() const
{
return type().DefaultFileName();
}
const CPath& GetReadPath()
{
return m_oReadPath;
}
nullable<CConnections> m_oConnections;
private:
CPath m_oReadPath;
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
};
} //Spreadsheet
} // namespace OOX
#endif // OOX_TABLE_FILE_INCLUDE_H_

View File

@ -0,0 +1,600 @@
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef OOX_QUERYTABLE_FILE_INCLUDE_H_
#define OOX_QUERYTABLE_FILE_INCLUDE_H_
#include "../CommonInclude.h"
#include "Autofilter.h"
namespace OOX
{
namespace Spreadsheet
{
class CQueryTableField : public WritingElement
{
public:
WritingElement_AdditionConstructors(CQueryTableField)
CQueryTableField(){}
virtual ~CQueryTableField() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<queryTableField");
WritingStringNullableAttrEncodeXmlString(L"name", m_oName, m_oName.get());
WritingStringNullableAttrInt(L"id", m_oId, m_oId->GetValue());
WritingStringNullableAttrInt(L"tableColumnId", m_oTableColumnId, m_oTableColumnId->GetValue());
if (m_oRowNumbers.IsInit()) WritingStringAttrString(L"rowNumbers", *m_oRowNumbers ? L"1" : L"0");
if (m_oFillFormulas.IsInit()) WritingStringAttrString(L"fillFormulas",*m_oFillFormulas ? L"1" : L"0");
if (m_oDataBound.IsInit()) WritingStringAttrString(L"dataBound", *m_oDataBound ? L"1" : L"0");
if (m_oClipped.IsInit()) WritingStringAttrString(L"clipped", *m_oClipped ? L"1" : L"0");
writer.WriteString(L"/>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if (_T("extLst") == sName)
m_oExtLst = oReader;
}
}
virtual EElementType getType () const
{
return et_x_QueryTableField;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("id"), m_oId )
WritingElement_ReadAttributes_Read_if ( oReader, _T("tableColumnId"), m_oTableColumnId )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("name"), m_oName )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("rowNumbers"), m_oRowNumbers )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("fillFormulas"), m_oFillFormulas )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("dataBound"), m_oDataBound )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("clipped"), m_oClipped )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oId;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oTableColumnId;
nullable<std::wstring> m_oName;
nullable_bool m_oRowNumbers;
nullable_bool m_oFillFormulas;
nullable_bool m_oDataBound;
nullable_bool m_oClipped;
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
};
class CQueryTableFields : public WritingElementWithChilds<CQueryTableField>
{
public:
WritingElement_AdditionConstructors(CQueryTableFields)
CQueryTableFields(){}
virtual ~CQueryTableFields() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return _T("");
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
if(m_arrItems.empty()) return;
writer.WriteString(L"<queryTableFields");
WritingStringAttrInt(L"count", (int)m_arrItems.size());
writer.WriteString(L">");
for ( size_t i = 0; i < m_arrItems.size(); ++i)
{
if ( m_arrItems[i] )
{
m_arrItems[i]->toXML(writer);
}
}
writer.WriteString(L"</queryTableFields>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"queryTableField" == sName )
m_arrItems.push_back(new CQueryTableField(oReader));
}
}
virtual EElementType getType () const
{
return et_x_QueryTableFields;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::CUnsignedDecimalNumber<> > m_oCount;
};
class CQueryTableDeletedField : public WritingElement
{
public:
WritingElement_AdditionConstructors(CQueryTableDeletedField)
CQueryTableDeletedField(){}
virtual ~CQueryTableDeletedField() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<deletedField");
WritingStringNullableAttrEncodeXmlString(L"name", m_oName, m_oName.get());
writer.WriteString(L"/>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
}
virtual EElementType getType () const
{
return et_x_QueryTableDeletedField;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("name"), m_oName )
WritingElement_ReadAttributes_End( oReader )
}
nullable<std::wstring> m_oName;
};
class CQueryTableDeletedFields : public WritingElementWithChilds<CQueryTableDeletedField>
{
public:
WritingElement_AdditionConstructors(CQueryTableDeletedFields)
CQueryTableDeletedFields(){}
virtual ~CQueryTableDeletedFields() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return _T("");
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
if(m_arrItems.empty()) return;
writer.WriteString(L"<queryTableDeletedFields");
WritingStringAttrInt(L"count", (int)m_arrItems.size());
writer.WriteString(L">");
for ( size_t i = 0; i < m_arrItems.size(); ++i)
{
if ( m_arrItems[i] )
{
m_arrItems[i]->toXML(writer);
}
}
writer.WriteString(L"</queryTableDeletedFields>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"deletedField" == sName )
m_arrItems.push_back(new CQueryTableDeletedField(oReader));
}
}
virtual EElementType getType () const
{
return et_x_QueryTableFields;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::CUnsignedDecimalNumber<> > m_oCount;
};
class CQueryTableRefresh : public WritingElement
{
public:
WritingElement_AdditionConstructors(CQueryTableRefresh)
CQueryTableRefresh(){}
virtual ~CQueryTableRefresh() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<queryTableRefresh");
WritingStringNullableAttrInt(L"nextId", m_oNextId, m_oNextId->GetValue());
WritingStringNullableAttrInt(L"unboundColumnsLeft", m_UnboundColumnsLeft, m_UnboundColumnsLeft->GetValue());
WritingStringNullableAttrInt(L"unboundColumnsRight", m_UnboundColumnsRight, m_UnboundColumnsRight->GetValue());
if (m_FieldIdWrapped.IsInit()) WritingStringAttrString(L"fieldIdWrapped", *m_FieldIdWrapped ? L"1" : L"0");
if (m_HeadersInLastRefresh.IsInit()) WritingStringAttrString(L"headersInLastRefresh", *m_HeadersInLastRefresh ? L"1" : L"0");
if (m_PreserveSortFilterLayout.IsInit())WritingStringAttrString(L"preserveSortFilterLayout", *m_PreserveSortFilterLayout ? L"1" : L"0");
if (m_oMinimumVersion.IsInit()) WritingStringAttrInt(L"minimumVersion", m_oMinimumVersion->GetValue());
writer.WriteString(L">");
if (m_oQueryTableFields.IsInit())
m_oQueryTableFields->toXML(writer);
if (m_oQueryTableDeletedFields.IsInit())
m_oQueryTableDeletedFields->toXML(writer);
if (m_oSortState.IsInit())
m_oSortState->toXML(writer);
writer.WriteString(L"</queryTableRefresh");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if (_T("queryTableFields") == sName)
m_oQueryTableFields = oReader;
else if (_T("queryTableDeletedFields") == sName)
m_oQueryTableDeletedFields = oReader;
else if (_T("sortState") == sName)
m_oSortState = oReader;
else if (_T("extLst") == sName)
m_oExtLst = oReader;
}
}
virtual EElementType getType () const
{
return et_x_QueryTableRefresh;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("id"), m_oNextId )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("minimumVersion"), m_oMinimumVersion )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("fieldIdWrapped"), m_FieldIdWrapped )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("headersInLastRefresh"), m_HeadersInLastRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("preserveSortFilterLayout"), m_PreserveSortFilterLayout )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("unboundColumnsLeft"), m_UnboundColumnsLeft )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("unboundColumnsRight"), m_UnboundColumnsRight )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oNextId;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMinimumVersion;
nullable_bool m_FieldIdWrapped;
nullable_bool m_HeadersInLastRefresh;
nullable_bool m_PreserveSortFilterLayout;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_UnboundColumnsLeft;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_UnboundColumnsRight;
nullable<CQueryTableFields> m_oQueryTableFields;
nullable<CQueryTableDeletedFields> m_oQueryTableDeletedFields;
nullable<CSortState> m_oSortState;
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
};
class CQueryTable : public WritingElement
{
public:
WritingElement_AdditionConstructors(CQueryTable)
CQueryTable()
{
}
virtual ~CQueryTable()
{
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
if(false == m_oName.IsInit()) return;
writer.WriteString(L"<queryTable \
xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
mc:Ignorable=\"xr16\" \
xmlns:xr16=\"http://schemas.microsoft.com/office/spreadsheetml/2017/revision16\"");
if (m_oAdjustColumnWidth.IsInit()) WritingStringAttrString(L"adjustColumnWidth", *m_oAdjustColumnWidth ? L"1" : L"0");
if (m_oApplyAlignmentFormats.IsInit()) WritingStringAttrString(L"applyAlignmentFormats", *m_oApplyAlignmentFormats ? L"1" : L"0");
if (m_oApplyBorderFormats.IsInit()) WritingStringAttrString(L"applyBorderFormats", *m_oApplyBorderFormats ? L"1" : L"0");
if (m_oApplyFontFormats.IsInit()) WritingStringAttrString(L"applyFontFormats", *m_oApplyFontFormats ? L"1" : L"0");
if (m_oApplyNumberFormats.IsInit()) WritingStringAttrString(L"applyNumberFormats", *m_oApplyNumberFormats ? L"1" : L"0");
if (m_oApplyPatternFormats.IsInit()) WritingStringAttrString(L"applyPatternFormats", *m_oApplyPatternFormats ? L"1" : L"0");
if (m_oApplyWidthHeightFormats.IsInit()) WritingStringAttrString(L"applyWidthHeightFormats", *m_oApplyWidthHeightFormats ? L"1" : L"0");
if (m_oBackgroundRefresh.IsInit()) WritingStringAttrString(L"backgroundRefresh", *m_oBackgroundRefresh ? L"1" : L"0");
WritingStringNullableAttrEncodeXmlString(L"name", m_oName, m_oName.get());
WritingStringNullableAttrInt(L"connectionId", m_oConnectionId, m_oConnectionId->GetValue());
WritingStringNullableAttrInt(L"autoFormatId", m_oAutoFormatId, m_oAutoFormatId->GetValue());
if (m_oDisableEdit.IsInit()) WritingStringAttrString(L"disableEdit", *m_oDisableEdit ? L"1" : L"0");
if (m_oDisableRefresh.IsInit()) WritingStringAttrString(L"disableRefresh", *m_oDisableRefresh ? L"1" : L"0");
if (m_oFillFormulas.IsInit()) WritingStringAttrString(L"fillFormulas", *m_oFillFormulas ? L"1" : L"0");
if (m_oFirstBackgroundRefresh.IsInit()) WritingStringAttrString(L"firstBackgroundRefresh", *m_oFirstBackgroundRefresh ? L"1" : L"0");
WritingStringNullableAttrEncodeXmlString(L"growShrinkType", m_oGrowShrinkType, m_oGrowShrinkType.get());
if (m_oHeaders.IsInit()) WritingStringAttrString(L"headers", *m_oHeaders ? L"1" : L"0");
if (m_oIntermediate.IsInit()) WritingStringAttrString(L"intermediate", *m_oIntermediate ? L"1" : L"0");
if (m_oPreserveFormatting.IsInit()) WritingStringAttrString(L"preserveFormatting", *m_oPreserveFormatting ? L"1" : L"0");
if (m_oRefreshOnLoad.IsInit()) WritingStringAttrString(L"refreshOnLoad", *m_oRefreshOnLoad ? L"1" : L"0");
if (m_oRemoveDataOnSave.IsInit()) WritingStringAttrString(L"removeDataOnSave", *m_oRemoveDataOnSave ? L"1" : L"0");
if (m_oRowNumbers.IsInit()) WritingStringAttrString(L"rowNumbers", *m_oRowNumbers ? L"1" : L"0");
writer.WriteString(L">");
if(m_oQueryTableRefresh.IsInit())
m_oQueryTableRefresh->toXML(writer);
if(m_oExtLst.IsInit())
{
writer.WriteString(m_oExtLst->toXMLWithNS(_T("")));
}
writer.WriteString(L"</queryTable>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( _T("queryTableRefresh") == sName )
m_oQueryTableRefresh = oReader;
else if (_T("extLst") == sName)
m_oExtLst = oReader;
}
}
virtual EElementType getType () const
{
return et_x_QueryTable;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"adjustColumnWidth", m_oAdjustColumnWidth )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyAlignmentFormats", m_oApplyAlignmentFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyBorderFormats", m_oApplyBorderFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyFontFormats", m_oApplyFontFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyNumberFormats", m_oApplyNumberFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyPatternFormats", m_oApplyPatternFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyWidthHeightFormats", m_oApplyWidthHeightFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"autoFormatId", m_oAutoFormatId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"backgroundRefresh", m_oBackgroundRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"connectionId", m_oConnectionId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"disableEdit", m_oDisableEdit )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"disableRefresh", m_oDisableRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"fillFormulas", m_oFillFormulas )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"firstBackgroundRefresh",m_oFirstBackgroundRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"growShrinkType", m_oGrowShrinkType )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"headers", m_oHeaders )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"intermediate", m_oIntermediate )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"name", m_oName )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"preserveFormatting", m_oPreserveFormatting )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"refreshOnLoad", m_oRefreshOnLoad )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"removeDataOnSave", m_oRemoveDataOnSave )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"rowNumbers", m_oRowNumbers )
WritingElement_ReadAttributes_End( oReader )
}
nullable_bool m_oAdjustColumnWidth;
nullable_bool m_oApplyAlignmentFormats;
nullable_bool m_oApplyBorderFormats;
nullable_bool m_oApplyFontFormats;
nullable_bool m_oApplyNumberFormats;
nullable_bool m_oApplyPatternFormats;
nullable_bool m_oApplyWidthHeightFormats;
nullable_bool m_oBackgroundRefresh;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oAutoFormatId;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oConnectionId;
nullable_bool m_oDisableEdit;
nullable_bool m_oDisableRefresh;
nullable_bool m_oFillFormulas;
nullable_bool m_oFirstBackgroundRefresh;
nullable_string m_oGrowShrinkType;
nullable_bool m_oHeaders;
nullable_bool m_oIntermediate;
nullable_string m_oName;
nullable_bool m_oPreserveFormatting;
nullable_bool m_oRefreshOnLoad;
nullable_bool m_oRemoveDataOnSave;
nullable_bool m_oRowNumbers;
nullable<CQueryTableRefresh> m_oQueryTableRefresh;
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
};
class CQueryTableFile : public OOX::FileGlobalEnumerated, public OOX::IFileContainer
{
public:
CQueryTableFile(OOX::Document* pMain) : OOX::FileGlobalEnumerated(pMain), OOX::IFileContainer(pMain)
{
m_bSpreadsheets = true;
}
CQueryTableFile(OOX::Document* pMain, const CPath& oRootPath, const CPath& oPath) : OOX::FileGlobalEnumerated(pMain), OOX::IFileContainer(pMain)
{
m_bSpreadsheets = true;
read( oRootPath, oPath );
}
virtual ~CQueryTableFile()
{
}
virtual void read(const CPath& oPath)
{
//don't use this. use read(const CPath& oRootPath, const CPath& oFilePath)
CPath oRootPath;
read(oRootPath, oPath);
}
virtual void read(const CPath& oRootPath, const CPath& oPath)
{
m_oReadPath = oPath;
IFileContainer::Read( oRootPath, oPath );
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )
return;
if ( !oReader.ReadNextNode() )
return;
m_oQueryTable = oReader;
}
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
if(false == m_oQueryTable.IsInit()) return;
NSStringUtils::CStringBuilder sXml;
sXml.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
m_oQueryTable->toXML(sXml);
std::wstring sPath = oPath.GetPath();
NSFile::CFileBinary::SaveToFile(sPath, sXml.GetData());
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
IFileContainer::Write( oPath, oDirectory, oContent );
}
virtual const OOX::FileType type() const
{
return OOX::Spreadsheet::FileTypes::QueryTable;
}
virtual const CPath DefaultDirectory() const
{
return type().DefaultDirectory();
}
virtual const CPath DefaultFileName() const
{
return type().DefaultFileName();
}
const CPath& GetReadPath()
{
return m_oReadPath;
}
nullable<CQueryTable> m_oQueryTable;
private:
CPath m_oReadPath;
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
};
} //Spreadsheet
} // namespace OOX
#endif // OOX_TABLE_FILE_INCLUDE_H_

View File

@ -351,8 +351,7 @@ namespace OOX
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<table \
writer.WriteString(L"<table \
xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
mc:Ignorable=\"xr xr3\" \
@ -671,19 +670,19 @@ xmlns:xr3=\"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3\"")
}
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
if(m_oTable.IsInit())
{
NSStringUtils::CStringBuilder sXml;
int nGlobalNumber = OOX::FileGlobalEnumerated::GetGlobalNumber();
if(false == m_oTable.IsInit()) return;
m_oTable->toXML2(sXml, nGlobalNumber);
NSStringUtils::CStringBuilder sXml;
int nGlobalNumber = OOX::FileGlobalEnumerated::GetGlobalNumber();
std::wstring sPath = oPath.GetPath();
NSFile::CFileBinary::SaveToFile(sPath, sXml.GetData());
sXml.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
m_oTable->toXML2(sXml, nGlobalNumber);
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
IFileContainer::Write( oPath, oDirectory, oContent );
}
std::wstring sPath = oPath.GetPath();
NSFile::CFileBinary::SaveToFile(sPath, sXml.GetData());
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
IFileContainer::Write( oPath, oDirectory, oContent );
}
virtual const OOX::FileType type() const
{
@ -709,560 +708,6 @@ xmlns:xr3=\"http://schemas.microsoft.com/office/spreadsheetml/2016/revision3\"")
{
}
};
//-------------------------------------------------------------------------------------------------
class CQueryTableField : public WritingElement
{
public:
WritingElement_AdditionConstructors(CQueryTableField)
CQueryTableField(){}
virtual ~CQueryTableField() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<queryTableField");
WritingStringNullableAttrEncodeXmlString(L"name", m_oName, m_oName.get());
WritingStringNullableAttrInt(L"id", m_oId, m_oId->GetValue());
WritingStringNullableAttrInt(L"tableColumnId", m_oTableColumnId, m_oTableColumnId->GetValue());
if (m_oRowNumbers.IsInit()) WritingStringAttrString(L"rowNumbers", *m_oRowNumbers ? L"1" : L"0");
if (m_oFillFormulas.IsInit()) WritingStringAttrString(L"fillFormulas",*m_oFillFormulas ? L"1" : L"0");
if (m_oDataBound.IsInit()) WritingStringAttrString(L"dataBound", *m_oDataBound ? L"1" : L"0");
if (m_oClipped.IsInit()) WritingStringAttrString(L"clipped", *m_oClipped ? L"1" : L"0");
writer.WriteString(L"/>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if (_T("extLst") == sName)
m_oExtLst = oReader;
}
}
virtual EElementType getType () const
{
return et_x_QueryTableField;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("id"), m_oId )
WritingElement_ReadAttributes_Read_if ( oReader, _T("tableColumnId"), m_oTableColumnId )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("name"), m_oName )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("rowNumbers"), m_oRowNumbers )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("fillFormulas"), m_oFillFormulas )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("dataBound"), m_oDataBound )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("clipped"), m_oClipped )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oId;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oTableColumnId;
nullable<std::wstring> m_oName;
nullable_bool m_oRowNumbers;
nullable_bool m_oFillFormulas;
nullable_bool m_oDataBound;
nullable_bool m_oClipped;
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
};
class CQueryTableFields : public WritingElementWithChilds<CQueryTableField>
{
public:
WritingElement_AdditionConstructors(CQueryTableFields)
CQueryTableFields(){}
virtual ~CQueryTableFields() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return _T("");
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
if(m_arrItems.empty()) return;
writer.WriteString(L"<queryTableFields");
WritingStringAttrInt(L"count", (int)m_arrItems.size());
writer.WriteString(L">");
for ( size_t i = 0; i < m_arrItems.size(); ++i)
{
if ( m_arrItems[i] )
{
m_arrItems[i]->toXML(writer);
}
}
writer.WriteString(L"</queryTableFields>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"queryTableField" == sName )
m_arrItems.push_back(new CQueryTableField(oReader));
}
}
virtual EElementType getType () const
{
return et_x_QueryTableFields;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::CUnsignedDecimalNumber<> > m_oCount;
};
class CQueryTableDeletedField : public WritingElement
{
public:
WritingElement_AdditionConstructors(CQueryTableDeletedField)
CQueryTableDeletedField(){}
virtual ~CQueryTableDeletedField() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<deletedField");
WritingStringNullableAttrEncodeXmlString(L"name", m_oName, m_oName.get());
writer.WriteString(L"/>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
}
virtual EElementType getType () const
{
return et_x_QueryTableDeletedField;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("name"), m_oName )
WritingElement_ReadAttributes_End( oReader )
}
nullable<std::wstring> m_oName;
};
class CQueryTableDeletedFields : public WritingElementWithChilds<CQueryTableDeletedField>
{
public:
WritingElement_AdditionConstructors(CQueryTableDeletedFields)
CQueryTableDeletedFields(){}
virtual ~CQueryTableDeletedFields() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return _T("");
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
if(m_arrItems.empty()) return;
writer.WriteString(L"<queryTableDeletedFields");
WritingStringAttrInt(L"count", (int)m_arrItems.size());
writer.WriteString(L">");
for ( size_t i = 0; i < m_arrItems.size(); ++i)
{
if ( m_arrItems[i] )
{
m_arrItems[i]->toXML(writer);
}
}
writer.WriteString(L"</queryTableDeletedFields>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"deletedField" == sName )
m_arrItems.push_back(new CQueryTableDeletedField(oReader));
}
}
virtual EElementType getType () const
{
return et_x_QueryTableFields;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::CUnsignedDecimalNumber<> > m_oCount;
};
class CQueryTableRefresh : public WritingElement
{
public:
WritingElement_AdditionConstructors(CQueryTableRefresh)
CQueryTableRefresh(){}
virtual ~CQueryTableRefresh() {}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
writer.WriteString(L"<queryTableRefresh");
WritingStringNullableAttrInt(L"nextId", m_oNextId, m_oNextId->GetValue());
WritingStringNullableAttrInt(L"unboundColumnsLeft", m_UnboundColumnsLeft, m_UnboundColumnsLeft->GetValue());
WritingStringNullableAttrInt(L"unboundColumnsRight", m_UnboundColumnsRight, m_UnboundColumnsRight->GetValue());
if (m_FieldIdWrapped.IsInit()) WritingStringAttrString(L"fieldIdWrapped", *m_FieldIdWrapped ? L"1" : L"0");
if (m_HeadersInLastRefresh.IsInit()) WritingStringAttrString(L"headersInLastRefresh", *m_HeadersInLastRefresh ? L"1" : L"0");
if (m_PreserveSortFilterLayout.IsInit())WritingStringAttrString(L"preserveSortFilterLayout", *m_PreserveSortFilterLayout ? L"1" : L"0");
if (m_oMinimumVersion.IsInit()) WritingStringAttrInt(L"minimumVersion", m_oMinimumVersion->GetValue());
writer.WriteString(L">");
if (m_oQueryTableFields.IsInit())
m_oQueryTableFields->toXML(writer);
if (m_oQueryTableDeletedFields.IsInit())
m_oQueryTableDeletedFields->toXML(writer);
if (m_oSortState.IsInit())
m_oSortState->toXML(writer);
writer.WriteString(L"</queryTableRefresh");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if (_T("queryTableFields") == sName)
m_oQueryTableFields = oReader;
else if (_T("queryTableDeletedFields") == sName)
m_oQueryTableDeletedFields = oReader;
else if (_T("sortState") == sName)
m_oSortState = oReader;
else if (_T("extLst") == sName)
m_oExtLst = oReader;
}
}
virtual EElementType getType () const
{
return et_x_QueryTableRefresh;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("id"), m_oNextId )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("minimumVersion"), m_oMinimumVersion )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("fieldIdWrapped"), m_FieldIdWrapped )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("headersInLastRefresh"), m_HeadersInLastRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("preserveSortFilterLayout"), m_PreserveSortFilterLayout )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("unboundColumnsLeft"), m_UnboundColumnsLeft )
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("unboundColumnsRight"), m_UnboundColumnsRight )
WritingElement_ReadAttributes_End( oReader )
}
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oNextId;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oMinimumVersion;
nullable_bool m_FieldIdWrapped;
nullable_bool m_HeadersInLastRefresh;
nullable_bool m_PreserveSortFilterLayout;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_UnboundColumnsLeft;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_UnboundColumnsRight;
nullable<CQueryTableFields> m_oQueryTableFields;
nullable<CQueryTableDeletedFields> m_oQueryTableDeletedFields;
nullable<CSortState> m_oSortState;
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
};
class CQueryTable : public WritingElement
{
public:
WritingElement_AdditionConstructors(CQueryTable)
CQueryTable()
{
}
virtual ~CQueryTable()
{
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
}
virtual std::wstring toXML() const
{
return L"";
}
virtual void toXML(NSStringUtils::CStringBuilder& writer) const
{
if(false == m_oName.IsInit()) return;
writer.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<queryTable \
xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
mc:Ignorable=\"xr16\" \
xmlns:xr16=\"http://schemas.microsoft.com/office/spreadsheetml/2017/revision16\"");
if (m_oAdjustColumnWidth.IsInit()) WritingStringAttrString(L"adjustColumnWidth", *m_oAdjustColumnWidth ? L"1" : L"0");
if (m_oApplyAlignmentFormats.IsInit()) WritingStringAttrString(L"applyAlignmentFormats", *m_oApplyAlignmentFormats ? L"1" : L"0");
if (m_oApplyBorderFormats.IsInit()) WritingStringAttrString(L"applyBorderFormats", *m_oApplyBorderFormats ? L"1" : L"0");
if (m_oApplyFontFormats.IsInit()) WritingStringAttrString(L"applyFontFormats", *m_oApplyFontFormats ? L"1" : L"0");
if (m_oApplyNumberFormats.IsInit()) WritingStringAttrString(L"applyNumberFormats", *m_oApplyNumberFormats ? L"1" : L"0");
if (m_oApplyPatternFormats.IsInit()) WritingStringAttrString(L"applyPatternFormats", *m_oApplyPatternFormats ? L"1" : L"0");
if (m_oApplyWidthHeightFormats.IsInit()) WritingStringAttrString(L"applyWidthHeightFormats", *m_oApplyWidthHeightFormats ? L"1" : L"0");
if (m_oBackgroundRefresh.IsInit()) WritingStringAttrString(L"backgroundRefresh", *m_oBackgroundRefresh ? L"1" : L"0");
WritingStringNullableAttrEncodeXmlString(L"name", m_oName, m_oName.get());
WritingStringNullableAttrInt(L"connectionId", m_oConnectionId, m_oConnectionId->GetValue());
WritingStringNullableAttrInt(L"autoFormatId", m_oAutoFormatId, m_oAutoFormatId->GetValue());
if (m_oDisableEdit.IsInit()) WritingStringAttrString(L"disableEdit", *m_oDisableEdit ? L"1" : L"0");
if (m_oDisableRefresh.IsInit()) WritingStringAttrString(L"disableRefresh", *m_oDisableRefresh ? L"1" : L"0");
if (m_oFillFormulas.IsInit()) WritingStringAttrString(L"fillFormulas", *m_oFillFormulas ? L"1" : L"0");
if (m_oFirstBackgroundRefresh.IsInit()) WritingStringAttrString(L"firstBackgroundRefresh", *m_oFirstBackgroundRefresh ? L"1" : L"0");
WritingStringNullableAttrEncodeXmlString(L"growShrinkType", m_oGrowShrinkType, m_oGrowShrinkType.get());
if (m_oHeaders.IsInit()) WritingStringAttrString(L"headers", *m_oHeaders ? L"1" : L"0");
if (m_oIntermediate.IsInit()) WritingStringAttrString(L"intermediate", *m_oIntermediate ? L"1" : L"0");
if (m_oPreserveFormatting.IsInit()) WritingStringAttrString(L"preserveFormatting", *m_oPreserveFormatting ? L"1" : L"0");
if (m_oRefreshOnLoad.IsInit()) WritingStringAttrString(L"refreshOnLoad", *m_oRefreshOnLoad ? L"1" : L"0");
if (m_oRemoveDataOnSave.IsInit()) WritingStringAttrString(L"removeDataOnSave", *m_oRemoveDataOnSave ? L"1" : L"0");
if (m_oRowNumbers.IsInit()) WritingStringAttrString(L"rowNumbers", *m_oRowNumbers ? L"1" : L"0");
writer.WriteString(L">");
if(m_oQueryTableRefresh.IsInit())
m_oQueryTableRefresh->toXML(writer);
if(m_oExtLst.IsInit())
{
writer.WriteString(m_oExtLst->toXMLWithNS(_T("")));
}
writer.WriteString(L"</queryTable>");
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( _T("queryTableRefresh") == sName )
m_oQueryTableRefresh = oReader;
else if (_T("extLst") == sName)
m_oExtLst = oReader;
}
}
virtual EElementType getType () const
{
return et_x_QueryTable;
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, L"adjustColumnWidth", m_oAdjustColumnWidth )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyAlignmentFormats", m_oApplyAlignmentFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyBorderFormats", m_oApplyBorderFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyFontFormats", m_oApplyFontFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyNumberFormats", m_oApplyNumberFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyPatternFormats", m_oApplyPatternFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"applyWidthHeightFormats", m_oApplyWidthHeightFormats )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"autoFormatId", m_oAutoFormatId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"backgroundRefresh", m_oBackgroundRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"connectionId", m_oConnectionId )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"disableEdit", m_oDisableEdit )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"disableRefresh", m_oDisableRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"fillFormulas", m_oFillFormulas )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"firstBackgroundRefresh",m_oFirstBackgroundRefresh )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"growShrinkType", m_oGrowShrinkType )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"headers", m_oHeaders )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"intermediate", m_oIntermediate )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"name", m_oName )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"preserveFormatting", m_oPreserveFormatting )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"refreshOnLoad", m_oRefreshOnLoad )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"removeDataOnSave", m_oRemoveDataOnSave )
WritingElement_ReadAttributes_Read_else_if ( oReader, L"rowNumbers", m_oRowNumbers )
WritingElement_ReadAttributes_End( oReader )
}
nullable_bool m_oAdjustColumnWidth;
nullable_bool m_oApplyAlignmentFormats;
nullable_bool m_oApplyBorderFormats;
nullable_bool m_oApplyFontFormats;
nullable_bool m_oApplyNumberFormats;
nullable_bool m_oApplyPatternFormats;
nullable_bool m_oApplyWidthHeightFormats;
nullable_bool m_oBackgroundRefresh;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oAutoFormatId;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oConnectionId;
nullable_bool m_oDisableEdit;
nullable_bool m_oDisableRefresh;
nullable_bool m_oFillFormulas;
nullable_bool m_oFirstBackgroundRefresh;
nullable_string m_oGrowShrinkType;
nullable_bool m_oHeaders;
nullable_bool m_oIntermediate;
nullable_string m_oName;
nullable_bool m_oPreserveFormatting;
nullable_bool m_oRefreshOnLoad;
nullable_bool m_oRemoveDataOnSave;
nullable_bool m_oRowNumbers;
nullable<CQueryTableRefresh> m_oQueryTableRefresh;
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
};
class CQueryTableFile : public OOX::FileGlobalEnumerated, public OOX::IFileContainer
{
public:
CQueryTableFile(OOX::Document* pMain) : OOX::FileGlobalEnumerated(pMain), OOX::IFileContainer(pMain)
{
m_bSpreadsheets = true;
}
CQueryTableFile(OOX::Document* pMain, const CPath& oRootPath, const CPath& oPath) : OOX::FileGlobalEnumerated(pMain), OOX::IFileContainer(pMain)
{
m_bSpreadsheets = true;
read( oRootPath, oPath );
}
virtual ~CQueryTableFile()
{
}
virtual void read(const CPath& oPath)
{
//don't use this. use read(const CPath& oRootPath, const CPath& oFilePath)
CPath oRootPath;
read(oRootPath, oPath);
}
virtual void read(const CPath& oRootPath, const CPath& oPath)
{
m_oReadPath = oPath;
IFileContainer::Read( oRootPath, oPath );
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oPath.GetPath() ) )
return;
if ( !oReader.ReadNextNode() )
return;
m_oQueryTable = oReader;
}
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
if(false == m_oQueryTable.IsInit()) return;
NSStringUtils::CStringBuilder sXml;
m_oQueryTable->toXML(sXml);
std::wstring sPath = oPath.GetPath();
NSFile::CFileBinary::SaveToFile(sPath, sXml.GetData());
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
IFileContainer::Write( oPath, oDirectory, oContent );
}
virtual const OOX::FileType type() const
{
return OOX::Spreadsheet::FileTypes::QueryTable;
}
virtual const CPath DefaultDirectory() const
{
return type().DefaultDirectory();
}
virtual const CPath DefaultFileName() const
{
return type().DefaultFileName();
}
const CPath& GetReadPath()
{
return m_oReadPath;
}
nullable<CQueryTable> m_oQueryTable;
private:
CPath m_oReadPath;
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
}
};
} //Spreadsheet
} // namespace OOX

View File

@ -96,21 +96,20 @@ namespace OOX
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("aca"), m_oAca )
WritingElement_ReadAttributes_Read_if ( oReader, _T("aca"), m_oAca )
WritingElement_ReadAttributes_Read_if ( oReader, _T("bx"), m_oBx )
WritingElement_ReadAttributes_Read_if ( oReader, _T("ca"), m_oCa )
WritingElement_ReadAttributes_Read_if ( oReader, _T("del1"), m_oDel1 )
WritingElement_ReadAttributes_Read_if ( oReader, _T("del2"), m_oDel2 )
WritingElement_ReadAttributes_Read_if ( oReader, _T("dt2D"), m_oDt2D )
WritingElement_ReadAttributes_Read_if ( oReader, _T("dtr"), m_oDtr )
WritingElement_ReadAttributes_Read_if ( oReader, _T("r1"), m_oR1 )
WritingElement_ReadAttributes_Read_if ( oReader, _T("r2"), m_oR2 )
WritingElement_ReadAttributes_Read_if ( oReader, _T("ref"), m_oRef )
WritingElement_ReadAttributes_Read_if ( oReader, _T("si"), m_oSi )
WritingElement_ReadAttributes_Read_if ( oReader, _T("t"), m_oT )
WritingElement_ReadAttributes_Read_if ( oReader, _T("del1"), m_oDel1 )
WritingElement_ReadAttributes_Read_if ( oReader, _T("del2"), m_oDel2 )
WritingElement_ReadAttributes_Read_if ( oReader, _T("dt2D"), m_oDt2D )
WritingElement_ReadAttributes_Read_if ( oReader, _T("dtr"), m_oDtr )
WritingElement_ReadAttributes_Read_if ( oReader, _T("r1"), m_oR1 )
WritingElement_ReadAttributes_Read_if ( oReader, _T("r2"), m_oR2 )
WritingElement_ReadAttributes_Read_if ( oReader, _T("ref"), m_oRef )
WritingElement_ReadAttributes_Read_if ( oReader, _T("si"), m_oSi )
WritingElement_ReadAttributes_Read_if ( oReader, _T("t"), m_oT )
WritingElement_ReadAttributes_End( oReader )
}
@ -123,9 +122,9 @@ namespace OOX
nullable<SimpleTypes::COnOff<>> m_oDel2;
nullable<SimpleTypes::COnOff<>> m_oDt2D;
nullable<SimpleTypes::COnOff<>> m_oDtr;
nullable<std::wstring> m_oR1;
nullable<std::wstring> m_oR2;
nullable<std::wstring> m_oRef;
nullable<std::wstring> m_oR1;
nullable<std::wstring> m_oR2;
nullable<std::wstring> m_oRef;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oSi;
nullable<SimpleTypes::Spreadsheet::CCellFormulaType<>> m_oT;
@ -328,7 +327,6 @@ namespace OOX
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("cm"), m_oCellMetadata )
@ -443,7 +441,6 @@ namespace OOX
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
// Читаем атрибуты
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("collapsed"), m_oCollapsed )

View File

@ -33,6 +33,7 @@
#include "Worksheet.h"
#include "../Comments/Comments.h"
#include "../Comments/ThreadedComments.h"
#include "../../DocxFormat/External/HyperLink.h"
#include "../../DocxFormat/Media/Image.h"
@ -47,6 +48,8 @@ namespace OOX
m_bSpreadsheets = true;
m_bWriteDirectlyToFile = false;
m_pComments = NULL;
m_pPersonList = NULL;
m_pThreadedComments = NULL;
CXlsx* xlsx = dynamic_cast<CXlsx*>(pMain);
if (xlsx)
@ -64,6 +67,8 @@ namespace OOX
m_bSpreadsheets = true;
m_bWriteDirectlyToFile = false;
m_pComments = NULL;
m_pPersonList = NULL;
m_pThreadedComments = NULL;
CXlsx* xlsx = dynamic_cast<CXlsx*>(pMain);
if (xlsx)
@ -96,7 +101,7 @@ namespace OOX
return;
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( _T("worksheet") == sName || _T("chartsheet") == sName)
if ( L"worksheet" == sName || L"chartsheet" == sName)
{
read(oReader);
}
@ -114,9 +119,8 @@ namespace OOX
PrepareComments(m_pComments, pVmlDrawing);
}
}
if (m_oHeaderFooter.IsInit() && m_oLegacyDrawing.IsInit() && m_oLegacyDrawing.IsInit())
{
}
PrepareConditionalFormatting();
}
void CWorksheet::read(XmlUtils::CXmlLiteReader& oReader)
{
@ -203,6 +207,30 @@ namespace OOX
}
void CWorksheet::PrepareConditionalFormatting()
{
if (m_oExtLst.IsInit() == false) return;
for (size_t i = 0; i < m_oExtLst->m_arrExt.size(); ++i)
{
for (size_t j = 0; j < m_oExtLst->m_arrExt[i]->m_arrConditionalFormatting.size(); ++j)
{
if (!m_oExtLst->m_arrExt[i]->m_arrConditionalFormatting[j]) continue;
for (size_t k = 0; k < m_oExtLst->m_arrExt[i]->m_arrConditionalFormatting[j]->m_arrItems.size(); ++k)
{
if (!m_oExtLst->m_arrExt[i]->m_arrConditionalFormatting[j]->m_arrItems[k]) continue;
if (m_oExtLst->m_arrExt[i]->m_arrConditionalFormatting[j]->m_arrItems[k]->m_oId.IsInit())
{
std::wstring id = m_oExtLst->m_arrExt[i]->m_arrConditionalFormatting[j]->m_arrItems[k]->m_oId.get2();
m_mapConditionalFormattingEx.insert(std::make_pair(id, m_oExtLst->m_arrExt[i]->m_arrConditionalFormatting[j]->m_arrItems[k]));
}
}
}
}
}
void CWorksheet::PrepareComments(OOX::Spreadsheet::CComments* pComments, OOX::CVmlDrawing* pVmlDrawing)
{
std::vector<std::wstring> & arAuthors = pComments->m_oAuthors->m_arrItems;
@ -479,6 +507,8 @@ namespace OOX
m_mapComments.clear();
m_mapConditionalFormattingEx.clear();
// delete Conditional Formatting
for (size_t nIndex = 0, nLength = m_arrConditionalFormatting.size(); nIndex < nLength; ++nIndex)
{

View File

@ -57,6 +57,8 @@ namespace OOX
class CComments;
class CCommentItem;
class CLegacyDrawingWorksheet;
class CThreadedComments;
class CPersonList;
//необработанные child:
//<cellWatches>
//<customProperties>
@ -82,8 +84,7 @@ namespace OOX
read(oRootPath, oPath);
}
virtual void read(const CPath& oRootPath, const CPath& oPath);
void PrepareComments(OOX::Spreadsheet::CComments* pComments, OOX::CVmlDrawing* pVmlDrawing);
void PrepareToWrite();
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const;
void toXMLStart(NSStringUtils::CStringBuilder& writer) const;
void toXMLEnd(NSStringUtils::CStringBuilder& writer) const;
@ -107,9 +108,12 @@ namespace OOX
void ClearItems();
CPath m_oReadPath;
public:
void read(XmlUtils::CXmlLiteReader& oReader);
void PrepareConditionalFormatting();
void PrepareComments(OOX::Spreadsheet::CComments* pComments, OOX::CVmlDrawing* pVmlDrawing);
void PrepareToWrite();
bool m_bPrepareForBinaryWriter;
bool m_bWriteDirectlyToFile;
@ -144,7 +148,11 @@ namespace OOX
nullable<OOX::Drawing::COfficeArtExtensionList> m_oExtLst;
//--------------------------------------------------------------------------------------------
CComments *m_pComments;
CComments *m_pComments;
CPersonList *m_pPersonList;
CThreadedComments *m_pThreadedComments;
std::map<std::wstring, CConditionalFormattingRule*> m_mapConditionalFormattingEx;
};
} //Spreadsheet
} // namespace OOX

View File

@ -72,48 +72,7 @@ bool OOX::Spreadsheet::CXlsx::Read(const CPath& oFilePath)
if (!m_pWorkbook) return false;
//Theme
//smart_ptr<OOX::File> pFile = m_pWorkbook->Find(OOX::FileTypes::Theme);
//m_pTheme = pFile.smart_dynamic_cast<PPTX::Theme>();
for (size_t i = 0; i < m_arWorksheets.size(); i++)
{
OOX::Spreadsheet::CWorksheet* sheet = m_arWorksheets[i];
//dxf from x14:... to styles
if (sheet->m_oExtLst.IsInit() && m_pStyles)
{
for(size_t i = 0; i < sheet->m_oExtLst->m_arrExt.size(); ++i)
{
OOX::Drawing::COfficeArtExtension* pExt = sheet->m_oExtLst->m_arrExt[i];
if ( !pExt->m_arrConditionalFormatting.empty() )
{
for (size_t j = 0; j < pExt->m_arrConditionalFormatting.size(); j++)
{
if (!pExt->m_arrConditionalFormatting[j]) continue;
for ( size_t i = 0; i < pExt->m_arrConditionalFormatting[j]->m_arrItems.size(); ++i)
{
OOX::Spreadsheet::CConditionalFormattingRule *rule = pExt->m_arrConditionalFormatting[j]->m_arrItems[i];
if (!rule) continue;
if (rule->m_oDxf.IsInit())
{
if (!m_pStyles->m_oDxfs.IsInit())
m_pStyles->m_oDxfs.Init();
//DxfId starts from 0
rule->m_oDxfId = std::to_wstring((unsigned int)m_pStyles->m_oDxfs->m_arrItems.size());
m_pStyles->m_oDxfs->m_arrItems.push_back(rule->m_oDxf.GetPointerEmptyNullable());
}
}
}
}
}
}
}
return true;
return true;
}
bool OOX::Spreadsheet::CXlsx::Write(const CPath& oDirPath, OOX::CContentTypes &oContentTypes)
{

View File

@ -35,14 +35,114 @@
#include <unistd.h>
#include "../../DesktopEditor/common/Directory.h"
#include<fcntl.h>
#include <string>
#include <stdio.h>
#ifndef USE_EXTERNAL_DOWNLOAD
#include <fcntl.h>
#include <curl/curl.h>
#include <curl/easy.h>
#include <stdio.h>
#else
#include <unistd.h>
#include <sys/wait.h>
int download_external(const std::wstring& sUrl, const std::wstring& sOutput)
{
int nReturnCode = -1;
std::string sUrlA = U_TO_UTF8(sUrl);
//sUrlA =("\"" + sUrlA + "\"");
std::string sOutputA = U_TO_UTF8(sOutput);
//sOutputA =("\"" + sOutputA + "\"");
if (0 != nReturnCode && NSFile::CFileBinary::Exists(L"/usr/bin/curl"))
{
pid_t pid = fork(); // create child process
int status;
switch (pid)
{
case -1: // error
break;
case 0: // child process
{
const char* nargs[6];
nargs[0] = "/usr/bin/curl";
nargs[1] = sUrlA.c_str();
nargs[2] = "--output";
nargs[3] = sOutputA.c_str();
nargs[4] = "--silent";
nargs[5] = NULL;
const char* nenv[3];
nenv[0] = "LD_PRELOAD=";
nenv[1] = "LD_LIBRARY_PATH=";
nenv[2] = NULL;
execve("/usr/bin/curl", (char * const *)nargs, (char * const *)nenv);
exit(EXIT_SUCCESS);
break;
}
default: // parent process, pid now contains the child pid
while (-1 == waitpid(pid, &status, 0)); // wait for child to complete
if (WIFEXITED(status))
{
nReturnCode = WEXITSTATUS(status);
}
break;
}
}
if (0 != nReturnCode && NSFile::CFileBinary::Exists(L"/usr/bin/wget"))
{
pid_t pid = fork(); // create child process
int status;
switch (pid)
{
case -1: // error
break;
case 0: // child process
{
const char* nargs[6];
nargs[0] = "/usr/bin/wget";
nargs[1] = sUrlA.c_str();
nargs[2] = "-O";
nargs[3] = sOutputA.c_str();
nargs[4] = "-q";
nargs[5] = NULL;
const char* nenv[2];
nenv[0] = "LD_PRELOAD=";
nenv[1] = NULL;
execve("/usr/bin/wget", (char * const *)nargs, (char * const *)nenv);
exit(EXIT_SUCCESS);
break;
}
default: // parent process, pid now contains the child pid
while (-1 == waitpid(pid, &status, 0)); // wait for child to complete
if (WIFEXITED(status))
{
nReturnCode = WEXITSTATUS(status);
}
break;
}
}
if (0 == nReturnCode)
{
if (!NSFile::CFileBinary::Exists(sOutput))
nReturnCode = -1;
}
return nReturnCode;
}
#endif
class CFileDownloaderBaseCURL : public CFileDownloaderBase
{
@ -60,6 +160,7 @@ public :
}
}
#ifndef USE_EXTERNAL_DOWNLOAD
static size_t write_data(void *ptr, size_t size, size_t nmemb, int fd) {
size_t written = write(fd, ptr, size * nmemb);
return written;
@ -119,6 +220,19 @@ protected:
filename = sTempPath;
return fd;
}
#else
virtual int DownloadFile()
{
if (m_sFilePath.empty())
{
m_sFilePath = NSFile::CFileBinary::CreateTempFileWithUniqueName(NSDirectory::GetTempPath(), L"DW");
if (NSFile::CFileBinary::Exists(m_sFilePath))
NSFile::CFileBinary::Remove(m_sFilePath);
}
return download_external(m_sFileUrl, m_sFilePath);
}
#endif
};
CFileDownloader_private::CFileDownloader_private(std::wstring sFileUrl, bool bDelete)

View File

@ -25,8 +25,6 @@ include(../OfficeUtils/OfficeUtils.pri)
CONFIG += core_static_link_xml_full
include(../DesktopEditor/xml/build/qt/libxml2.pri)
include(../Common/3dParty/curl/curl.pri)
# DOWNLOADER
HEADERS += \
./FileDownloader/FileDownloader.h \
@ -44,6 +42,14 @@ core_windows {
LIBS += -lShell32
}
core_linux {
CONFIG += use_external_download
use_external_download {
DEFINES += USE_EXTERNAL_DOWNLOAD
} else {
include(../Common/3dParty/curl/curl.pri)
}
SOURCES += \
./FileDownloader/FileDownloader_curl.cpp
}

View File

@ -1 +1 @@
2.5.562.0
2.5.565.0

View File

@ -36,13 +36,13 @@
#include <iostream>
#include "../graphics/pro/Fonts.h"
#include "../../graphics/Timer.h"
#include "../../common/Directory.h"
#include "../../common/Array.h"
#include "../../../OfficeUtils/src/OfficeUtils.h"
#include "../graphics/Timer.h"
#include "../common/Directory.h"
#include "../common/Array.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "memorystream.h"
#include "../../fontengine/application_generate_fonts_common.h"
#include "../fontengine/application_generate_fonts_common.h"
#if defined(CreateDirectory)
#undef CreateDirectory

View File

@ -1,4 +1,4 @@
/*
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
@ -29,13 +29,6 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
//
// AscEditorPDFPrinter.h
// PdfWriter
//
// Created by Oleg Korshul on 04.03.15.
// Copyright (c) 2015 Ascensio System. All rights reserved.
//
#ifndef PdfWriter_AscEditorPDFPrinter_h
#define PdfWriter_AscEditorPDFPrinter_h
@ -62,6 +55,8 @@ public:
bool m_bUseSystemFonts;
std::vector<std::wstring> m_arFontsDirectory;
bool m_bIsPDFA;
public:
CAscEditorPDFPrinter()
{
@ -72,6 +67,8 @@ public:
m_bUseSystemFonts = false;
m_bUseFontsDirectory = false;
m_bIsPDFA = false;
}
public:

View File

@ -1,10 +1,34 @@
//
// AscEditorPDFPrinter.cpp
// PdfWriter
//
// Created by Oleg Korshul on 04.03.15.
// Copyright (c) 2015 Ascensio System. All rights reserved.
//
/*
* (c) Copyright Ascensio System SIA 2010-2019
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "AscEditorPDFPrinter.h"
@ -48,7 +72,7 @@ bool CAscEditorPDFPrinter::Print(std::string strBase64, std::wstring strDstFile)
oFonts.InitializeFromFolder(m_strFontsDirectory);
pFontManager = (CFontManager*)oFonts.GenerateFontManager();
CPdfRenderer oRender(&oFonts);
CPdfRenderer oRender(&oFonts, m_bIsPDFA);
oRender.SetTempFolder(GetTempPath());
HRESULT hr = S_FALSE;

View File

@ -464,8 +464,8 @@
7C560F841AA71A91000E5860 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
CLANG_CXX_LIBRARY = "compiler-default";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
@ -504,8 +504,8 @@
7C560F851AA71A91000E5860 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_CXX_LANGUAGE_STANDARD = "compiler-default";
CLANG_CXX_LIBRARY = "compiler-default";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_PREPROCESSOR_DEFINITIONS = (

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FF0B1ACC4AF7006B99B3"
BuildableName = "libfontengine_ios.a"
BlueprintName = "fontengine"
ReferencedContainer = "container:fontengine.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FF0B1ACC4AF7006B99B3"
BuildableName = "libfontengine_ios.a"
BlueprintName = "fontengine"
ReferencedContainer = "container:fontengine.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FF0B1ACC4AF7006B99B3"
BuildableName = "libfontengine_ios.a"
BlueprintName = "fontengine"
ReferencedContainer = "container:fontengine.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FECF1ACC4A67006B99B3"
BuildableName = "libgraphics_ios.a"
BlueprintName = "graphics"
ReferencedContainer = "container:graphics.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FECF1ACC4A67006B99B3"
BuildableName = "libgraphics_ios.a"
BlueprintName = "graphics"
ReferencedContainer = "container:graphics.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "17C1FECF1ACC4A67006B99B3"
BuildableName = "libgraphics_ios.a"
BlueprintName = "graphics"
ReferencedContainer = "container:graphics.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -75,6 +75,8 @@ namespace MetaFile
virtual unsigned int GetRop2Mode() = 0;
virtual IClip* GetClip() = 0;
virtual int GetCharSpace() = 0;
virtual bool IsWindowFlippedY() = 0;
virtual bool IsWindowFlippedX() = 0;
bool OpenFromFile(const wchar_t* wsFilePath)
{

View File

@ -138,7 +138,40 @@ namespace MetaFile
TPointD oTL = TranslatePoint(dX, dY);
TPointD oBR = TranslatePoint(dX + dW, dY + dH);
m_pRenderer->DrawImage(&oImage, oTL.x, oTL.y, oBR.x - oTL.x, oBR.y - oTL.y);
double dImageX = oTL.x;
double dImageY = oTL.y;
double dImageW = oBR.x - oTL.x;
double dImageH = oBR.y - oTL.y;
if (dImageH < 0 || dImageW < 0)
{
double dM11, dM12, dM21, dM22, dMx, dMy;
m_pRenderer->GetTransform(&dM11, &dM12, &dM21, &dM22, &dMx, &dMy);
double dKx = 1, dKy = 1, dShiftKoefX = 0, dShiftKoefY = 0;
if (dImageW < 0)
{
dKx = -1;
dShiftKoefX = 2 * dImageX + dImageW;
dImageW = -dImageW;
dImageX -= dImageW;
}
if (dImageH < 0)
{
dKy = -1;
dShiftKoefY = 2 * dImageY + dImageH;
dImageH = -dImageH;
dImageY -= dImageH;
}
m_pRenderer->SetTransform(dKx * dM11, dKx * dM12, dKy * dM21, dKy * dM22, dShiftKoefX * dM11 + dShiftKoefY * dM21 + dMx, dShiftKoefX * dM12 + dShiftKoefY * dM22 + dMy);
}
m_pRenderer->DrawImage(&oImage, dImageX, dImageY, dImageW, dImageH);
}
void DrawString(std::wstring& wsText, unsigned int unCharsCount, double _dX, double _dY, double* pDx, int iGraphicsMode)
{
@ -303,13 +336,40 @@ namespace MetaFile
double dM11, dM12, dM21, dM22, dRx, dRy;
m_pRenderer->GetTransform(&dM11, &dM12, &dM21, &dM22, &dRx, &dRy);
double dShiftX = (dM11 < -0.001 ? (2 * dX - 2 * fW) * dM11 : 0);
double dShiftY = (dM22 < -0.001 ? (2 * dY - 2 * fH) * dM22 : 0);
double dShiftX = 0;
double dShiftY = 0;
// Нам нужно знать в следствие чего происходит флип, из-за Window или Viewport
if (dM11 < -0.00001)
{
dX -= fabs(fW);
if (m_pFile->IsWindowFlippedX())
{
dShiftX = (2 * dX + fabs(fW)) * dM11;
}
else
{
dShiftX = (2 * dX - fabs(fW)) * dM11;
}
}
if (dM22 < - 0.00001)
{
dY -= fabs(fH);
if (m_pFile->IsWindowFlippedY())
{
dShiftY = (2 * dY + fabs(fH)) * dM22;
}
else
{
dShiftY = (2 * dY - fabs(fH)) * dM22;
}
}
m_pRenderer->ResetTransform();
m_pRenderer->SetTransform(fabs(dM11), 0, 0, fabs(dM22), dShiftX + dRx, dShiftY + dRy);
bChangeCTM = true;
}

View File

@ -36,7 +36,7 @@ namespace MetaFile
{
CEmfClipCommandPath::CEmfClipCommandPath(CEmfPath* pPath, unsigned int unMode, TEmfXForm* pTransform) : m_oPath(pPath), m_unMode(unMode)
{
pTransform->Copy(&m_oTransform);
m_oTransform.Copy(pTransform);
}
CEmfClip::CEmfClip()

View File

@ -215,7 +215,6 @@ static const struct ActionNamesEmf
break;
}
if (0 == ulRecordIndex && EMR_HEADER != ulType)
return SetError();

View File

@ -171,6 +171,16 @@ namespace MetaFile
{
return 0;
}
bool IsWindowFlippedY()
{
TEmfWindow* pWindow = m_pDC->GetWindow();
return (pWindow->ulH < 0);
}
bool IsWindowFlippedX()
{
TEmfWindow* pWindow = m_pDC->GetWindow();
return (pWindow->ulW < 0);
}
private:

View File

@ -585,33 +585,8 @@ namespace MetaFile
TEmfWindow* pWindow = GetWindow();
TEmfWindow* pViewPort = GetViewport();
int nWindowX = pWindow->lX;
int nWindowY = pWindow->lY;
double dPixelW = GetPixelWidth();
double dPixelH = GetPixelHeight();
// Вообще отрицательных высоты и ширины быть не должно, но если так встречается, то
// мы считаем, что это не перевернутая система координат, а просто сдвинутая
if (pWindow->ulH < 0)
{
if (dPixelH < 0)
dPixelH = -dPixelH;
nWindowY += pWindow->ulH;
}
if (pWindow->ulW < 0)
{
if (dPixelW < 0)
dPixelW = -dPixelW;
nWindowY += pWindow->ulW;
}
TEmfXForm oWindowXForm(1, 0, 0, 1, -nWindowX, -nWindowY);
TEmfXForm oViewportXForm(dPixelW, 0, 0, dPixelH, pViewPort->lX, pViewPort->lY);
TEmfXForm oWindowXForm(1, 0, 0, 1, -pWindow->lX, -pWindow->lY);
TEmfXForm oViewportXForm((double)GetPixelWidth(), 0, 0, (double)GetPixelHeight(), pViewPort->lX, pViewPort->lY);
m_oFinalTransform.Init();
m_oFinalTransform.Multiply(oWindowXForm, MWT_RIGHTMULTIPLY);

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