Compare commits

..

6 Commits

Author SHA1 Message Date
96cea25bca x2t version up 2017-01-16 11:09:55 +03:00
1a57f62773 x2t refactoring (delete AscString, ...) 2017-01-16 10:30:00 +03:00
9d1f83b1ce Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  miss dashDotDot in xlsx border style
2017-01-13 15:47:58 +03:00
6653e8ef82 fixed deployment target 2017-01-13 15:47:48 +03:00
fd121841a9 miss dashDotDot in xlsx border style 2017-01-13 15:40:47 +03:00
00255297c8 stable iOS converter 2017-01-13 12:15:39 +03:00
881 changed files with 42005 additions and 41622 deletions

View File

@ -505,6 +505,7 @@ namespace DocFormatUtils
{
STLCollection->push_back(result[i]);
}
return true;
}
template<class T> static bool GetSTLCollectionFromUtf8( T *STLCollection, unsigned char *bytes, int size)

View File

@ -139,8 +139,8 @@ namespace DocFileFormat
bool ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString)
{
newXmlString.clear();
std::wstring sTempXmlFile = FileSystem::Directory::CreateTempFileWithUniqueName(
FileSystem::Directory::GetTempPath(), L"emb");
std::wstring sTempXmlFile = NSDirectory::CreateTempFileWithUniqueName(
NSDirectory::GetTempPath(), L"emb");
sTempXmlFile += L".xml";
@ -164,7 +164,7 @@ namespace DocFileFormat
if (paragraph->m_arrItems[j]->getType() == OOX::et_m_oMath)
{
res = true;
newXmlString = paragraph->m_arrItems[j]->toXML().GetBuffer();
newXmlString = paragraph->m_arrItems[j]->toXML();
break;
}
else if (paragraph->m_arrItems[j]->getType() == OOX::et_m_oMathPara)
@ -176,7 +176,7 @@ namespace DocFileFormat
if (mathPara->m_arrItems[k]->getType() == OOX::et_m_oMath)
{
res = true;
newXmlString = mathPara->m_arrItems[k]->toXML().GetBuffer();
newXmlString = mathPara->m_arrItems[k]->toXML();
break;
}
}

View File

@ -0,0 +1,920 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
6967B2F91E27C26800A129E2 /* DocFormatLib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B2F71E27C26800A129E2 /* DocFormatLib.cpp */; };
6967B3E11E27C2D500A129E2 /* pole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B3DF1E27C2D500A129E2 /* pole.cpp */; };
6967B4C31E27C52700A129E2 /* AnnotationReferenceDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B3E71E27C52700A129E2 /* AnnotationReferenceDescriptor.cpp */; };
6967B4C41E27C52700A129E2 /* CharacterPropertiesMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B3ED1E27C52700A129E2 /* CharacterPropertiesMapping.cpp */; };
6967B4C51E27C52700A129E2 /* Converter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B3F41E27C52700A129E2 /* Converter.cpp */; };
6967B4C61E27C52700A129E2 /* DocumentMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B3F71E27C52700A129E2 /* DocumentMapping.cpp */; };
6967B4C71E27C52700A129E2 /* DocumentProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B3F91E27C52700A129E2 /* DocumentProperties.cpp */; };
6967B4C81E27C52700A129E2 /* DrawingPrimitives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B3FD1E27C52700A129E2 /* DrawingPrimitives.cpp */; };
6967B4C91E27C52700A129E2 /* EncryptionHeader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4001E27C52700A129E2 /* EncryptionHeader.cpp */; };
6967B4CA1E27C52700A129E2 /* FontFamilyName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4071E27C52700A129E2 /* FontFamilyName.cpp */; };
6967B4CB1E27C52700A129E2 /* FontTableMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4091E27C52700A129E2 /* FontTableMapping.cpp */; };
6967B4CC1E27C52700A129E2 /* FooterMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B40B1E27C52700A129E2 /* FooterMapping.cpp */; };
6967B4CD1E27C52700A129E2 /* FormattedDiskPageCHPX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4101E27C52700A129E2 /* FormattedDiskPageCHPX.cpp */; };
6967B4CE1E27C52700A129E2 /* FormattedDiskPagePAPX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4121E27C52700A129E2 /* FormattedDiskPagePAPX.cpp */; };
6967B4CF1E27C52700A129E2 /* HeaderAndFooterTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4151E27C52700A129E2 /* HeaderAndFooterTable.cpp */; };
6967B4D01E27C52700A129E2 /* HeaderMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4171E27C52700A129E2 /* HeaderMapping.cpp */; };
6967B4D11E27C52700A129E2 /* LanguageIdMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B41D1E27C52700A129E2 /* LanguageIdMapping.cpp */; };
6967B4D21E27C52700A129E2 /* ListData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4201E27C52700A129E2 /* ListData.cpp */; };
6967B4D31E27C52700A129E2 /* ListLevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4251E27C52700A129E2 /* ListLevel.cpp */; };
6967B4D41E27C52700A129E2 /* ListTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4271E27C52700A129E2 /* ListTable.cpp */; };
6967B4D51E27C52700A129E2 /* MainDocumentMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4291E27C52700A129E2 /* MainDocumentMapping.cpp */; };
6967B4D61E27C52700A129E2 /* NumberingMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B42C1E27C52700A129E2 /* NumberingMapping.cpp */; };
6967B4D71E27C52700A129E2 /* Record.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4471E27C52700A129E2 /* Record.cpp */; };
6967B4D81E27C52700A129E2 /* RecordFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4491E27C52700A129E2 /* RecordFactory.cpp */; };
6967B4D91E27C52700A129E2 /* ShapeTypeFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4511E27C52700A129E2 /* ShapeTypeFactory.cpp */; };
6967B4DA1E27C52700A129E2 /* OleObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B47A1E27C52700A129E2 /* OleObject.cpp */; };
6967B4DB1E27C52700A129E2 /* OpenXmlPackage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B47D1E27C52700A129E2 /* OpenXmlPackage.cpp */; };
6967B4DC1E27C52700A129E2 /* ParagraphHeight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B47F1E27C52700A129E2 /* ParagraphHeight.cpp */; };
6967B4DD1E27C52700A129E2 /* ParagraphPropertiesMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4811E27C52700A129E2 /* ParagraphPropertiesMapping.cpp */; };
6967B4DE1E27C52700A129E2 /* ParagraphPropertyExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4831E27C52700A129E2 /* ParagraphPropertyExceptions.cpp */; };
6967B4DF1E27C52700A129E2 /* PictureDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4851E27C52700A129E2 /* PictureDescriptor.cpp */; };
6967B4E01E27C52700A129E2 /* PieceTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4881E27C52700A129E2 /* PieceTable.cpp */; };
6967B4E11E27C52700A129E2 /* PropertiesMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B48B1E27C52700A129E2 /* PropertiesMapping.cpp */; };
6967B4E21E27C52700A129E2 /* PropertyExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B48D1E27C52700A129E2 /* PropertyExceptions.cpp */; };
6967B4E31E27C52700A129E2 /* RevisionData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B48F1E27C52700A129E2 /* RevisionData.cpp */; };
6967B4E41E27C52700A129E2 /* SectionPropertiesMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4931E27C52700A129E2 /* SectionPropertiesMapping.cpp */; };
6967B4E51E27C52700A129E2 /* SettingsMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4961E27C52700A129E2 /* SettingsMapping.cpp */; };
6967B4E61E27C52700A129E2 /* SinglePropertyModifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4991E27C52700A129E2 /* SinglePropertyModifier.cpp */; };
6967B4E71E27C52700A129E2 /* Spa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B49B1E27C52700A129E2 /* Spa.cpp */; };
6967B4E81E27C52700A129E2 /* StyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4A01E27C52700A129E2 /* StyleSheet.cpp */; };
6967B4E91E27C52700A129E2 /* StyleSheetDescription.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4A21E27C52700A129E2 /* StyleSheetDescription.cpp */; };
6967B4EA1E27C52700A129E2 /* StyleSheetInformation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4A41E27C52700A129E2 /* StyleSheetInformation.cpp */; };
6967B4EB1E27C52700A129E2 /* StyleSheetMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4A61E27C52700A129E2 /* StyleSheetMapping.cpp */; };
6967B4EC1E27C52700A129E2 /* TableCellPropertiesMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4A91E27C52700A129E2 /* TableCellPropertiesMapping.cpp */; };
6967B4ED1E27C52700A129E2 /* TableMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4AC1E27C52700A129E2 /* TableMapping.cpp */; };
6967B4EE1E27C52700A129E2 /* TablePropertiesMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4AE1E27C52700A129E2 /* TablePropertiesMapping.cpp */; };
6967B4EF1E27C52700A129E2 /* TableRowPropertiesMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4B11E27C52700A129E2 /* TableRowPropertiesMapping.cpp */; };
6967B4F01E27C52700A129E2 /* TextboxMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4B41E27C52700A129E2 /* TextboxMapping.cpp */; };
6967B4F11E27C52700A129E2 /* VMLPictureMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4B81E27C52700A129E2 /* VMLPictureMapping.cpp */; };
6967B4F21E27C52700A129E2 /* VMLShapeMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4BA1E27C52700A129E2 /* VMLShapeMapping.cpp */; };
6967B4F31E27C52700A129E2 /* VMLShapeTypeMapping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4BC1E27C52700A129E2 /* VMLShapeTypeMapping.cpp */; };
6967B4F41E27C52700A129E2 /* WordDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4BF1E27C52700A129E2 /* WordDocument.cpp */; };
6967B4F51E27C52700A129E2 /* WordprocessingDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B4C11E27C52700A129E2 /* WordprocessingDocument.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
6967B2E91E27C23A00A129E2 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "include/$(PRODUCT_NAME)";
dstSubfolderSpec = 16;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
6967B2EB1E27C23A00A129E2 /* libDocFormatLib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDocFormatLib.a; sourceTree = BUILT_PRODUCTS_DIR; };
6967B2F71E27C26800A129E2 /* DocFormatLib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DocFormatLib.cpp; path = ../../DocFormatLib.cpp; sourceTree = "<group>"; };
6967B2F81E27C26800A129E2 /* DocFormatLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DocFormatLib.h; path = ../../DocFormatLib.h; sourceTree = "<group>"; };
6967B2FB1E27C2A100A129E2 /* Aggregat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Aggregat.h; sourceTree = "<group>"; };
6967B2FC1E27C2A100A129E2 /* Callback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Callback.h; sourceTree = "<group>"; };
6967B2FD1E27C2A100A129E2 /* FormatUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormatUtils.h; sourceTree = "<group>"; };
6967B2FE1E27C2A100A129E2 /* IOperand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOperand.h; sourceTree = "<group>"; };
6967B2FF1E27C2A100A129E2 /* IVirtualConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IVirtualConstructor.h; sourceTree = "<group>"; };
6967B3001E27C2A100A129E2 /* LanguageCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LanguageCodes.h; sourceTree = "<group>"; };
6967B3011E27C2A100A129E2 /* Singleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Singleton.h; sourceTree = "<group>"; };
6967B3021E27C2A100A129E2 /* SPRMCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPRMCodes.h; sourceTree = "<group>"; };
6967B3031E27C2A100A129E2 /* TargetOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TargetOptions.h; sourceTree = "<group>"; };
6967B3041E27C2A100A129E2 /* TextMark.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextMark.h; sourceTree = "<group>"; };
6967B3051E27C2A100A129E2 /* utf8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utf8.h; sourceTree = "<group>"; };
6967B3061E27C2A100A129E2 /* XmlTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XmlTools.h; sourceTree = "<group>"; };
6967B3DF1E27C2D500A129E2 /* pole.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pole.cpp; path = ../../../../Common/3dParty/pole/pole.cpp; sourceTree = "<group>"; };
6967B3E01E27C2D500A129E2 /* pole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pole.h; path = ../../../../Common/3dParty/pole/pole.h; sourceTree = "<group>"; };
6967B3E51E27C52700A129E2 /* AbstractOpenXmlMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractOpenXmlMapping.h; sourceTree = "<group>"; };
6967B3E61E27C52700A129E2 /* AnnotationOwnerList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnnotationOwnerList.h; sourceTree = "<group>"; };
6967B3E71E27C52700A129E2 /* AnnotationReferenceDescriptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnnotationReferenceDescriptor.cpp; sourceTree = "<group>"; };
6967B3E81E27C52700A129E2 /* AnnotationReferenceDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnnotationReferenceDescriptor.h; sourceTree = "<group>"; };
6967B3E91E27C52700A129E2 /* AutoSummaryInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoSummaryInfo.h; sourceTree = "<group>"; };
6967B3EA1E27C52700A129E2 /* BookmarkFirst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BookmarkFirst.h; sourceTree = "<group>"; };
6967B3EB1E27C52700A129E2 /* BorderCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BorderCode.h; sourceTree = "<group>"; };
6967B3EC1E27C52700A129E2 /* ByteStructure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteStructure.h; sourceTree = "<group>"; };
6967B3ED1E27C52700A129E2 /* CharacterPropertiesMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CharacterPropertiesMapping.cpp; sourceTree = "<group>"; };
6967B3EE1E27C52700A129E2 /* CharacterPropertiesMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterPropertiesMapping.h; sourceTree = "<group>"; };
6967B3EF1E27C52700A129E2 /* CharacterPropertyExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterPropertyExceptions.h; sourceTree = "<group>"; };
6967B3F01E27C52700A129E2 /* CharacterRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterRange.h; sourceTree = "<group>"; };
6967B3F11E27C52700A129E2 /* CommentsMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommentsMapping.h; sourceTree = "<group>"; };
6967B3F21E27C52700A129E2 /* ContentTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentTypes.h; sourceTree = "<group>"; };
6967B3F31E27C52700A129E2 /* ConversionContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConversionContext.h; sourceTree = "<group>"; };
6967B3F41E27C52700A129E2 /* Converter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Converter.cpp; sourceTree = "<group>"; };
6967B3F51E27C52700A129E2 /* Converter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Converter.h; sourceTree = "<group>"; };
6967B3F61E27C52700A129E2 /* DateAndTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateAndTime.h; sourceTree = "<group>"; };
6967B3F71E27C52700A129E2 /* DocumentMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentMapping.cpp; sourceTree = "<group>"; };
6967B3F81E27C52700A129E2 /* DocumentMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentMapping.h; sourceTree = "<group>"; };
6967B3F91E27C52700A129E2 /* DocumentProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentProperties.cpp; sourceTree = "<group>"; };
6967B3FA1E27C52700A129E2 /* DocumentProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentProperties.h; sourceTree = "<group>"; };
6967B3FB1E27C52700A129E2 /* DocumentTypographyInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentTypographyInfo.h; sourceTree = "<group>"; };
6967B3FC1E27C52700A129E2 /* DrawingObjectGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingObjectGrid.h; sourceTree = "<group>"; };
6967B3FD1E27C52700A129E2 /* DrawingPrimitives.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DrawingPrimitives.cpp; sourceTree = "<group>"; };
6967B3FE1E27C52700A129E2 /* DrawingPrimitives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingPrimitives.h; sourceTree = "<group>"; };
6967B3FF1E27C52700A129E2 /* EmuValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmuValue.h; sourceTree = "<group>"; };
6967B4001E27C52700A129E2 /* EncryptionHeader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EncryptionHeader.cpp; sourceTree = "<group>"; };
6967B4011E27C52700A129E2 /* EncryptionHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EncryptionHeader.h; sourceTree = "<group>"; };
6967B4021E27C52700A129E2 /* EndnoteDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EndnoteDescriptor.h; sourceTree = "<group>"; };
6967B4031E27C52700A129E2 /* EndnotesMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EndnotesMapping.h; sourceTree = "<group>"; };
6967B4041E27C52700A129E2 /* FieldCharacter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FieldCharacter.h; sourceTree = "<group>"; };
6967B4051E27C52700A129E2 /* FileInformationBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileInformationBlock.h; sourceTree = "<group>"; };
6967B4061E27C52700A129E2 /* FixedPointNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FixedPointNumber.h; sourceTree = "<group>"; };
6967B4071E27C52700A129E2 /* FontFamilyName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFamilyName.cpp; sourceTree = "<group>"; };
6967B4081E27C52700A129E2 /* FontFamilyName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontFamilyName.h; sourceTree = "<group>"; };
6967B4091E27C52700A129E2 /* FontTableMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontTableMapping.cpp; sourceTree = "<group>"; };
6967B40A1E27C52700A129E2 /* FontTableMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontTableMapping.h; sourceTree = "<group>"; };
6967B40B1E27C52700A129E2 /* FooterMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FooterMapping.cpp; sourceTree = "<group>"; };
6967B40C1E27C52700A129E2 /* FooterMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FooterMapping.h; sourceTree = "<group>"; };
6967B40D1E27C52700A129E2 /* FootnoteDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootnoteDescriptor.h; sourceTree = "<group>"; };
6967B40E1E27C52700A129E2 /* FootnotesMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FootnotesMapping.h; sourceTree = "<group>"; };
6967B40F1E27C52700A129E2 /* FormattedDiskPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormattedDiskPage.h; sourceTree = "<group>"; };
6967B4101E27C52700A129E2 /* FormattedDiskPageCHPX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormattedDiskPageCHPX.cpp; sourceTree = "<group>"; };
6967B4111E27C52700A129E2 /* FormattedDiskPageCHPX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormattedDiskPageCHPX.h; sourceTree = "<group>"; };
6967B4121E27C52700A129E2 /* FormattedDiskPagePAPX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormattedDiskPagePAPX.cpp; sourceTree = "<group>"; };
6967B4131E27C52700A129E2 /* FormattedDiskPagePAPX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormattedDiskPagePAPX.h; sourceTree = "<group>"; };
6967B4141E27C52700A129E2 /* Global.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Global.h; sourceTree = "<group>"; };
6967B4151E27C52700A129E2 /* HeaderAndFooterTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeaderAndFooterTable.cpp; sourceTree = "<group>"; };
6967B4161E27C52700A129E2 /* HeaderAndFooterTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeaderAndFooterTable.h; sourceTree = "<group>"; };
6967B4171E27C52700A129E2 /* HeaderMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeaderMapping.cpp; sourceTree = "<group>"; };
6967B4181E27C52700A129E2 /* HeaderMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeaderMapping.h; sourceTree = "<group>"; };
6967B4191E27C52700A129E2 /* IBinaryReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IBinaryReader.h; sourceTree = "<group>"; };
6967B41A1E27C52700A129E2 /* IMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IMapping.h; sourceTree = "<group>"; };
6967B41B1E27C52700A129E2 /* IVisitable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IVisitable.h; sourceTree = "<group>"; };
6967B41C1E27C52700A129E2 /* LanguageId.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LanguageId.h; sourceTree = "<group>"; };
6967B41D1E27C52700A129E2 /* LanguageIdMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LanguageIdMapping.cpp; sourceTree = "<group>"; };
6967B41E1E27C52700A129E2 /* LanguageIdMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LanguageIdMapping.h; sourceTree = "<group>"; };
6967B41F1E27C52700A129E2 /* LineSpacingDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineSpacingDescriptor.h; sourceTree = "<group>"; };
6967B4201E27C52700A129E2 /* ListData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ListData.cpp; sourceTree = "<group>"; };
6967B4211E27C52700A129E2 /* ListData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListData.h; sourceTree = "<group>"; };
6967B4221E27C52700A129E2 /* ListFormatOverride.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListFormatOverride.h; sourceTree = "<group>"; };
6967B4231E27C52700A129E2 /* ListFormatOverrideLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListFormatOverrideLevel.h; sourceTree = "<group>"; };
6967B4241E27C52700A129E2 /* ListFormatOverrideTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListFormatOverrideTable.h; sourceTree = "<group>"; };
6967B4251E27C52700A129E2 /* ListLevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ListLevel.cpp; sourceTree = "<group>"; };
6967B4261E27C52700A129E2 /* ListLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListLevel.h; sourceTree = "<group>"; };
6967B4271E27C52700A129E2 /* ListTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ListTable.cpp; sourceTree = "<group>"; };
6967B4281E27C52700A129E2 /* ListTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListTable.h; sourceTree = "<group>"; };
6967B4291E27C52700A129E2 /* MainDocumentMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainDocumentMapping.cpp; sourceTree = "<group>"; };
6967B42A1E27C52700A129E2 /* MainDocumentMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainDocumentMapping.h; sourceTree = "<group>"; };
6967B42B1E27C52700A129E2 /* MemoryStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryStream.h; sourceTree = "<group>"; };
6967B42C1E27C52700A129E2 /* NumberingMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NumberingMapping.cpp; sourceTree = "<group>"; };
6967B42D1E27C52700A129E2 /* NumberingMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NumberingMapping.h; sourceTree = "<group>"; };
6967B42E1E27C52700A129E2 /* OfficeArtContent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OfficeArtContent.h; sourceTree = "<group>"; };
6967B4301E27C52700A129E2 /* BitmapBlip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitmapBlip.h; sourceTree = "<group>"; };
6967B4311E27C52700A129E2 /* BlipStoreContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlipStoreContainer.h; sourceTree = "<group>"; };
6967B4321E27C52700A129E2 /* BlipStoreEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlipStoreEntry.h; sourceTree = "<group>"; };
6967B4331E27C52700A129E2 /* ChildAnchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChildAnchor.h; sourceTree = "<group>"; };
6967B4341E27C52700A129E2 /* ClientAnchor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientAnchor.h; sourceTree = "<group>"; };
6967B4351E27C52700A129E2 /* ClientData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ClientData.h; sourceTree = "<group>"; };
6967B4361E27C52700A129E2 /* DiagramBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagramBooleanProperties.h; sourceTree = "<group>"; };
6967B4371E27C52700A129E2 /* DrawingContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingContainer.h; sourceTree = "<group>"; };
6967B4381E27C52700A129E2 /* DrawingGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingGroup.h; sourceTree = "<group>"; };
6967B4391E27C52700A129E2 /* DrawingGroupRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingGroupRecord.h; sourceTree = "<group>"; };
6967B43A1E27C52700A129E2 /* DrawingRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingRecord.h; sourceTree = "<group>"; };
6967B43B1E27C52700A129E2 /* FillStyleBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FillStyleBooleanProperties.h; sourceTree = "<group>"; };
6967B43C1E27C52700A129E2 /* GeometryBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeometryBooleanProperties.h; sourceTree = "<group>"; };
6967B43D1E27C52700A129E2 /* GeometryTextBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeometryTextBooleanProperties.h; sourceTree = "<group>"; };
6967B43E1E27C52700A129E2 /* GroupContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupContainer.h; sourceTree = "<group>"; };
6967B43F1E27C52700A129E2 /* GroupShapeBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupShapeBooleanProperties.h; sourceTree = "<group>"; };
6967B4401E27C52700A129E2 /* GroupShapeRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupShapeRecord.h; sourceTree = "<group>"; };
6967B4411E27C52700A129E2 /* LineStyleBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineStyleBooleanProperties.h; sourceTree = "<group>"; };
6967B4421E27C52700A129E2 /* MetafilePictBlip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MetafilePictBlip.h; sourceTree = "<group>"; };
6967B4431E27C52700A129E2 /* OfficeArtClientTextbox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OfficeArtClientTextbox.h; sourceTree = "<group>"; };
6967B4441E27C52700A129E2 /* PathParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathParser.h; sourceTree = "<group>"; };
6967B4451E27C52700A129E2 /* PathSegment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathSegment.h; sourceTree = "<group>"; };
6967B4461E27C52700A129E2 /* ProtectionBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProtectionBooleanProperties.h; sourceTree = "<group>"; };
6967B4471E27C52700A129E2 /* Record.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Record.cpp; sourceTree = "<group>"; };
6967B4481E27C52700A129E2 /* Record.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Record.h; sourceTree = "<group>"; };
6967B4491E27C52700A129E2 /* RecordFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RecordFactory.cpp; sourceTree = "<group>"; };
6967B44A1E27C52700A129E2 /* RecordFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RecordFactory.h; sourceTree = "<group>"; };
6967B44B1E27C52700A129E2 /* RegularContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegularContainer.h; sourceTree = "<group>"; };
6967B44C1E27C52700A129E2 /* ShadowStyleBooleanProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadowStyleBooleanProperties.h; sourceTree = "<group>"; };
6967B44D1E27C52700A129E2 /* Shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shape.h; sourceTree = "<group>"; };
6967B44E1E27C52700A129E2 /* ShapeContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeContainer.h; sourceTree = "<group>"; };
6967B44F1E27C52700A129E2 /* ShapeOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeOptions.h; sourceTree = "<group>"; };
6967B4501E27C52700A129E2 /* ShapeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeType.h; sourceTree = "<group>"; };
6967B4511E27C52700A129E2 /* ShapeTypeFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShapeTypeFactory.cpp; sourceTree = "<group>"; };
6967B4521E27C52700A129E2 /* ShapeTypeFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShapeTypeFactory.h; sourceTree = "<group>"; };
6967B4541E27C52700A129E2 /* ArcType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArcType.h; sourceTree = "<group>"; };
6967B4551E27C52700A129E2 /* ArrowType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArrowType.h; sourceTree = "<group>"; };
6967B4561E27C52700A129E2 /* BevelType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BevelType.h; sourceTree = "<group>"; };
6967B4571E27C52700A129E2 /* BlockArcType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockArcType.h; sourceTree = "<group>"; };
6967B4581E27C52700A129E2 /* BracketsType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BracketsType.h; sourceTree = "<group>"; };
6967B4591E27C52700A129E2 /* CalloutsType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CalloutsType.h; sourceTree = "<group>"; };
6967B45A1E27C52700A129E2 /* CanType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CanType.h; sourceTree = "<group>"; };
6967B45B1E27C52700A129E2 /* Connector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Connector.h; sourceTree = "<group>"; };
6967B45C1E27C52700A129E2 /* CubeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CubeType.h; sourceTree = "<group>"; };
6967B45D1E27C52700A129E2 /* DiamondType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiamondType.h; sourceTree = "<group>"; };
6967B45E1E27C52700A129E2 /* DonutType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DonutType.h; sourceTree = "<group>"; };
6967B45F1E27C52700A129E2 /* FlowChartType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlowChartType.h; sourceTree = "<group>"; };
6967B4601E27C52700A129E2 /* FoldedCornerlType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoldedCornerlType.h; sourceTree = "<group>"; };
6967B4611E27C52700A129E2 /* HeartType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HeartType.h; sourceTree = "<group>"; };
6967B4621E27C52700A129E2 /* HexagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HexagonType.h; sourceTree = "<group>"; };
6967B4631E27C52700A129E2 /* IsoscelesTriangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IsoscelesTriangleType.h; sourceTree = "<group>"; };
6967B4641E27C52700A129E2 /* LightningBoltType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LightningBoltType.h; sourceTree = "<group>"; };
6967B4651E27C52700A129E2 /* LineType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineType.h; sourceTree = "<group>"; };
6967B4661E27C52700A129E2 /* MoonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MoonType.h; sourceTree = "<group>"; };
6967B4671E27C52700A129E2 /* NoSmokingType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoSmokingType.h; sourceTree = "<group>"; };
6967B4681E27C52700A129E2 /* OctagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OctagonType.h; sourceTree = "<group>"; };
6967B4691E27C52700A129E2 /* OvalType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OvalType.h; sourceTree = "<group>"; };
6967B46A1E27C52700A129E2 /* ParallelogramType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParallelogramType.h; sourceTree = "<group>"; };
6967B46B1E27C52700A129E2 /* PentagonType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PentagonType.h; sourceTree = "<group>"; };
6967B46C1E27C52700A129E2 /* PictureFrameType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureFrameType.h; sourceTree = "<group>"; };
6967B46D1E27C52700A129E2 /* PlaqueType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaqueType.h; sourceTree = "<group>"; };
6967B46E1E27C52700A129E2 /* PlusType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlusType.h; sourceTree = "<group>"; };
6967B46F1E27C52700A129E2 /* RectangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RectangleType.h; sourceTree = "<group>"; };
6967B4701E27C52700A129E2 /* RightTriangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RightTriangleType.h; sourceTree = "<group>"; };
6967B4711E27C52700A129E2 /* RoundedRectangleType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RoundedRectangleType.h; sourceTree = "<group>"; };
6967B4721E27C52700A129E2 /* SmileyFaceType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmileyFaceType.h; sourceTree = "<group>"; };
6967B4731E27C52700A129E2 /* StarType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StarType.h; sourceTree = "<group>"; };
6967B4741E27C52700A129E2 /* SunType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SunType.h; sourceTree = "<group>"; };
6967B4751E27C52700A129E2 /* TextboxType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextboxType.h; sourceTree = "<group>"; };
6967B4761E27C52700A129E2 /* TrapezoidType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrapezoidType.h; sourceTree = "<group>"; };
6967B4771E27C52700A129E2 /* WordArtText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordArtText.h; sourceTree = "<group>"; };
6967B4781E27C52700A129E2 /* SplitMenuColorContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplitMenuColorContainer.h; sourceTree = "<group>"; };
6967B4791E27C52700A129E2 /* UnknownRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnknownRecord.h; sourceTree = "<group>"; };
6967B47A1E27C52700A129E2 /* OleObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OleObject.cpp; sourceTree = "<group>"; };
6967B47B1E27C52700A129E2 /* OleObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OleObject.h; sourceTree = "<group>"; };
6967B47C1E27C52700A129E2 /* OleObjectMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OleObjectMapping.h; sourceTree = "<group>"; };
6967B47D1E27C52700A129E2 /* OpenXmlPackage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OpenXmlPackage.cpp; sourceTree = "<group>"; };
6967B47E1E27C52700A129E2 /* OpenXmlPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenXmlPackage.h; sourceTree = "<group>"; };
6967B47F1E27C52700A129E2 /* ParagraphHeight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParagraphHeight.cpp; sourceTree = "<group>"; };
6967B4801E27C52700A129E2 /* ParagraphHeight.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParagraphHeight.h; sourceTree = "<group>"; };
6967B4811E27C52700A129E2 /* ParagraphPropertiesMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParagraphPropertiesMapping.cpp; sourceTree = "<group>"; };
6967B4821E27C52700A129E2 /* ParagraphPropertiesMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParagraphPropertiesMapping.h; sourceTree = "<group>"; };
6967B4831E27C52700A129E2 /* ParagraphPropertyExceptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParagraphPropertyExceptions.cpp; sourceTree = "<group>"; };
6967B4841E27C52700A129E2 /* ParagraphPropertyExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParagraphPropertyExceptions.h; sourceTree = "<group>"; };
6967B4851E27C52700A129E2 /* PictureDescriptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PictureDescriptor.cpp; sourceTree = "<group>"; };
6967B4861E27C52700A129E2 /* PictureDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PictureDescriptor.h; sourceTree = "<group>"; };
6967B4871E27C52700A129E2 /* PieceDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PieceDescriptor.h; sourceTree = "<group>"; };
6967B4881E27C52700A129E2 /* PieceTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PieceTable.cpp; sourceTree = "<group>"; };
6967B4891E27C52700A129E2 /* PieceTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PieceTable.h; sourceTree = "<group>"; };
6967B48A1E27C52700A129E2 /* Plex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Plex.h; sourceTree = "<group>"; };
6967B48B1E27C52700A129E2 /* PropertiesMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PropertiesMapping.cpp; sourceTree = "<group>"; };
6967B48C1E27C52700A129E2 /* PropertiesMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertiesMapping.h; sourceTree = "<group>"; };
6967B48D1E27C52700A129E2 /* PropertyExceptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PropertyExceptions.cpp; sourceTree = "<group>"; };
6967B48E1E27C52700A129E2 /* PropertyExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PropertyExceptions.h; sourceTree = "<group>"; };
6967B48F1E27C52700A129E2 /* RevisionData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RevisionData.cpp; sourceTree = "<group>"; };
6967B4901E27C52700A129E2 /* RevisionData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RevisionData.h; sourceTree = "<group>"; };
6967B4911E27C52700A129E2 /* RGBColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RGBColor.h; sourceTree = "<group>"; };
6967B4921E27C52700A129E2 /* SectionDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SectionDescriptor.h; sourceTree = "<group>"; };
6967B4931E27C52700A129E2 /* SectionPropertiesMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SectionPropertiesMapping.cpp; sourceTree = "<group>"; };
6967B4941E27C52700A129E2 /* SectionPropertiesMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SectionPropertiesMapping.h; sourceTree = "<group>"; };
6967B4951E27C52700A129E2 /* SectionPropertyExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SectionPropertyExceptions.h; sourceTree = "<group>"; };
6967B4961E27C52700A129E2 /* SettingsMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SettingsMapping.cpp; sourceTree = "<group>"; };
6967B4971E27C52700A129E2 /* SettingsMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsMapping.h; sourceTree = "<group>"; };
6967B4981E27C52700A129E2 /* ShadingDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShadingDescriptor.h; sourceTree = "<group>"; };
6967B4991E27C52700A129E2 /* SinglePropertyModifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SinglePropertyModifier.cpp; sourceTree = "<group>"; };
6967B49A1E27C52700A129E2 /* SinglePropertyModifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SinglePropertyModifier.h; sourceTree = "<group>"; };
6967B49B1E27C52700A129E2 /* Spa.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Spa.cpp; sourceTree = "<group>"; };
6967B49C1E27C52700A129E2 /* Spa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Spa.h; sourceTree = "<group>"; };
6967B49D1E27C52700A129E2 /* SprmTDefTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SprmTDefTable.h; sourceTree = "<group>"; };
6967B49E1E27C52700A129E2 /* StringTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringTable.h; sourceTree = "<group>"; };
6967B49F1E27C52700A129E2 /* StructuredStorageReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructuredStorageReader.h; sourceTree = "<group>"; };
6967B4A01E27C52700A129E2 /* StyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheet.cpp; sourceTree = "<group>"; };
6967B4A11E27C52700A129E2 /* StyleSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleSheet.h; sourceTree = "<group>"; };
6967B4A21E27C52700A129E2 /* StyleSheetDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheetDescription.cpp; sourceTree = "<group>"; };
6967B4A31E27C52700A129E2 /* StyleSheetDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleSheetDescription.h; sourceTree = "<group>"; };
6967B4A41E27C52700A129E2 /* StyleSheetInformation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheetInformation.cpp; sourceTree = "<group>"; };
6967B4A51E27C52700A129E2 /* StyleSheetInformation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleSheetInformation.h; sourceTree = "<group>"; };
6967B4A61E27C52700A129E2 /* StyleSheetMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheetMapping.cpp; sourceTree = "<group>"; };
6967B4A71E27C52700A129E2 /* StyleSheetMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleSheetMapping.h; sourceTree = "<group>"; };
6967B4A81E27C52700A129E2 /* TabDescriptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TabDescriptor.h; sourceTree = "<group>"; };
6967B4A91E27C52700A129E2 /* TableCellPropertiesMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TableCellPropertiesMapping.cpp; sourceTree = "<group>"; };
6967B4AA1E27C52700A129E2 /* TableCellPropertiesMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableCellPropertiesMapping.h; sourceTree = "<group>"; };
6967B4AB1E27C52700A129E2 /* TableInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableInfo.h; sourceTree = "<group>"; };
6967B4AC1E27C52700A129E2 /* TableMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TableMapping.cpp; sourceTree = "<group>"; };
6967B4AD1E27C52700A129E2 /* TableMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableMapping.h; sourceTree = "<group>"; };
6967B4AE1E27C52700A129E2 /* TablePropertiesMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TablePropertiesMapping.cpp; sourceTree = "<group>"; };
6967B4AF1E27C52700A129E2 /* TablePropertiesMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TablePropertiesMapping.h; sourceTree = "<group>"; };
6967B4B01E27C52700A129E2 /* TablePropertyExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TablePropertyExceptions.h; sourceTree = "<group>"; };
6967B4B11E27C52700A129E2 /* TableRowPropertiesMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TableRowPropertiesMapping.cpp; sourceTree = "<group>"; };
6967B4B21E27C52700A129E2 /* TableRowPropertiesMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableRowPropertiesMapping.h; sourceTree = "<group>"; };
6967B4B31E27C52700A129E2 /* Tbkd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tbkd.h; sourceTree = "<group>"; };
6967B4B41E27C52700A129E2 /* TextboxMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextboxMapping.cpp; sourceTree = "<group>"; };
6967B4B51E27C52700A129E2 /* TextboxMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextboxMapping.h; sourceTree = "<group>"; };
6967B4B61E27C52700A129E2 /* TwipsValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TwipsValue.h; sourceTree = "<group>"; };
6967B4B71E27C52700A129E2 /* VirtualStreamReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VirtualStreamReader.h; sourceTree = "<group>"; };
6967B4B81E27C52700A129E2 /* VMLPictureMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMLPictureMapping.cpp; sourceTree = "<group>"; };
6967B4B91E27C52700A129E2 /* VMLPictureMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMLPictureMapping.h; sourceTree = "<group>"; };
6967B4BA1E27C52700A129E2 /* VMLShapeMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMLShapeMapping.cpp; sourceTree = "<group>"; };
6967B4BB1E27C52700A129E2 /* VMLShapeMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMLShapeMapping.h; sourceTree = "<group>"; };
6967B4BC1E27C52700A129E2 /* VMLShapeTypeMapping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMLShapeTypeMapping.cpp; sourceTree = "<group>"; };
6967B4BD1E27C52700A129E2 /* VMLShapeTypeMapping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMLShapeTypeMapping.h; sourceTree = "<group>"; };
6967B4BE1E27C52700A129E2 /* WideString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WideString.h; sourceTree = "<group>"; };
6967B4BF1E27C52700A129E2 /* WordDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WordDocument.cpp; sourceTree = "<group>"; };
6967B4C01E27C52700A129E2 /* WordDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordDocument.h; sourceTree = "<group>"; };
6967B4C11E27C52700A129E2 /* WordprocessingDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WordprocessingDocument.cpp; sourceTree = "<group>"; };
6967B4C21E27C52700A129E2 /* WordprocessingDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WordprocessingDocument.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
6967B2E81E27C23A00A129E2 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
6967B2E21E27C23A00A129E2 = {
isa = PBXGroup;
children = (
6967B2ED1E27C23A00A129E2 /* DocFormatLib */,
6967B2EC1E27C23A00A129E2 /* Products */,
);
sourceTree = "<group>";
};
6967B2EC1E27C23A00A129E2 /* Products */ = {
isa = PBXGroup;
children = (
6967B2EB1E27C23A00A129E2 /* libDocFormatLib.a */,
);
name = Products;
sourceTree = "<group>";
};
6967B2ED1E27C23A00A129E2 /* DocFormatLib */ = {
isa = PBXGroup;
children = (
6967B3E41E27C52700A129E2 /* DocDocxConverter */,
6967B3E21E27C2D700A129E2 /* pole */,
6967B2FA1E27C2A100A129E2 /* Common */,
6967B2F71E27C26800A129E2 /* DocFormatLib.cpp */,
6967B2F81E27C26800A129E2 /* DocFormatLib.h */,
);
path = DocFormatLib;
sourceTree = "<group>";
};
6967B2FA1E27C2A100A129E2 /* Common */ = {
isa = PBXGroup;
children = (
6967B2FB1E27C2A100A129E2 /* Aggregat.h */,
6967B2FC1E27C2A100A129E2 /* Callback.h */,
6967B2FD1E27C2A100A129E2 /* FormatUtils.h */,
6967B2FE1E27C2A100A129E2 /* IOperand.h */,
6967B2FF1E27C2A100A129E2 /* IVirtualConstructor.h */,
6967B3001E27C2A100A129E2 /* LanguageCodes.h */,
6967B3011E27C2A100A129E2 /* Singleton.h */,
6967B3021E27C2A100A129E2 /* SPRMCodes.h */,
6967B3031E27C2A100A129E2 /* TargetOptions.h */,
6967B3041E27C2A100A129E2 /* TextMark.h */,
6967B3051E27C2A100A129E2 /* utf8.h */,
6967B3061E27C2A100A129E2 /* XmlTools.h */,
);
name = Common;
path = ../../../Common;
sourceTree = "<group>";
};
6967B3E21E27C2D700A129E2 /* pole */ = {
isa = PBXGroup;
children = (
6967B3DF1E27C2D500A129E2 /* pole.cpp */,
6967B3E01E27C2D500A129E2 /* pole.h */,
);
name = pole;
sourceTree = "<group>";
};
6967B3E41E27C52700A129E2 /* DocDocxConverter */ = {
isa = PBXGroup;
children = (
6967B3E51E27C52700A129E2 /* AbstractOpenXmlMapping.h */,
6967B3E61E27C52700A129E2 /* AnnotationOwnerList.h */,
6967B3E71E27C52700A129E2 /* AnnotationReferenceDescriptor.cpp */,
6967B3E81E27C52700A129E2 /* AnnotationReferenceDescriptor.h */,
6967B3E91E27C52700A129E2 /* AutoSummaryInfo.h */,
6967B3EA1E27C52700A129E2 /* BookmarkFirst.h */,
6967B3EB1E27C52700A129E2 /* BorderCode.h */,
6967B3EC1E27C52700A129E2 /* ByteStructure.h */,
6967B3ED1E27C52700A129E2 /* CharacterPropertiesMapping.cpp */,
6967B3EE1E27C52700A129E2 /* CharacterPropertiesMapping.h */,
6967B3EF1E27C52700A129E2 /* CharacterPropertyExceptions.h */,
6967B3F01E27C52700A129E2 /* CharacterRange.h */,
6967B3F11E27C52700A129E2 /* CommentsMapping.h */,
6967B3F21E27C52700A129E2 /* ContentTypes.h */,
6967B3F31E27C52700A129E2 /* ConversionContext.h */,
6967B3F41E27C52700A129E2 /* Converter.cpp */,
6967B3F51E27C52700A129E2 /* Converter.h */,
6967B3F61E27C52700A129E2 /* DateAndTime.h */,
6967B3F71E27C52700A129E2 /* DocumentMapping.cpp */,
6967B3F81E27C52700A129E2 /* DocumentMapping.h */,
6967B3F91E27C52700A129E2 /* DocumentProperties.cpp */,
6967B3FA1E27C52700A129E2 /* DocumentProperties.h */,
6967B3FB1E27C52700A129E2 /* DocumentTypographyInfo.h */,
6967B3FC1E27C52700A129E2 /* DrawingObjectGrid.h */,
6967B3FD1E27C52700A129E2 /* DrawingPrimitives.cpp */,
6967B3FE1E27C52700A129E2 /* DrawingPrimitives.h */,
6967B3FF1E27C52700A129E2 /* EmuValue.h */,
6967B4001E27C52700A129E2 /* EncryptionHeader.cpp */,
6967B4011E27C52700A129E2 /* EncryptionHeader.h */,
6967B4021E27C52700A129E2 /* EndnoteDescriptor.h */,
6967B4031E27C52700A129E2 /* EndnotesMapping.h */,
6967B4041E27C52700A129E2 /* FieldCharacter.h */,
6967B4051E27C52700A129E2 /* FileInformationBlock.h */,
6967B4061E27C52700A129E2 /* FixedPointNumber.h */,
6967B4071E27C52700A129E2 /* FontFamilyName.cpp */,
6967B4081E27C52700A129E2 /* FontFamilyName.h */,
6967B4091E27C52700A129E2 /* FontTableMapping.cpp */,
6967B40A1E27C52700A129E2 /* FontTableMapping.h */,
6967B40B1E27C52700A129E2 /* FooterMapping.cpp */,
6967B40C1E27C52700A129E2 /* FooterMapping.h */,
6967B40D1E27C52700A129E2 /* FootnoteDescriptor.h */,
6967B40E1E27C52700A129E2 /* FootnotesMapping.h */,
6967B40F1E27C52700A129E2 /* FormattedDiskPage.h */,
6967B4101E27C52700A129E2 /* FormattedDiskPageCHPX.cpp */,
6967B4111E27C52700A129E2 /* FormattedDiskPageCHPX.h */,
6967B4121E27C52700A129E2 /* FormattedDiskPagePAPX.cpp */,
6967B4131E27C52700A129E2 /* FormattedDiskPagePAPX.h */,
6967B4141E27C52700A129E2 /* Global.h */,
6967B4151E27C52700A129E2 /* HeaderAndFooterTable.cpp */,
6967B4161E27C52700A129E2 /* HeaderAndFooterTable.h */,
6967B4171E27C52700A129E2 /* HeaderMapping.cpp */,
6967B4181E27C52700A129E2 /* HeaderMapping.h */,
6967B4191E27C52700A129E2 /* IBinaryReader.h */,
6967B41A1E27C52700A129E2 /* IMapping.h */,
6967B41B1E27C52700A129E2 /* IVisitable.h */,
6967B41C1E27C52700A129E2 /* LanguageId.h */,
6967B41D1E27C52700A129E2 /* LanguageIdMapping.cpp */,
6967B41E1E27C52700A129E2 /* LanguageIdMapping.h */,
6967B41F1E27C52700A129E2 /* LineSpacingDescriptor.h */,
6967B4201E27C52700A129E2 /* ListData.cpp */,
6967B4211E27C52700A129E2 /* ListData.h */,
6967B4221E27C52700A129E2 /* ListFormatOverride.h */,
6967B4231E27C52700A129E2 /* ListFormatOverrideLevel.h */,
6967B4241E27C52700A129E2 /* ListFormatOverrideTable.h */,
6967B4251E27C52700A129E2 /* ListLevel.cpp */,
6967B4261E27C52700A129E2 /* ListLevel.h */,
6967B4271E27C52700A129E2 /* ListTable.cpp */,
6967B4281E27C52700A129E2 /* ListTable.h */,
6967B4291E27C52700A129E2 /* MainDocumentMapping.cpp */,
6967B42A1E27C52700A129E2 /* MainDocumentMapping.h */,
6967B42B1E27C52700A129E2 /* MemoryStream.h */,
6967B42C1E27C52700A129E2 /* NumberingMapping.cpp */,
6967B42D1E27C52700A129E2 /* NumberingMapping.h */,
6967B42E1E27C52700A129E2 /* OfficeArtContent.h */,
6967B42F1E27C52700A129E2 /* OfficeDrawing */,
6967B47A1E27C52700A129E2 /* OleObject.cpp */,
6967B47B1E27C52700A129E2 /* OleObject.h */,
6967B47C1E27C52700A129E2 /* OleObjectMapping.h */,
6967B47D1E27C52700A129E2 /* OpenXmlPackage.cpp */,
6967B47E1E27C52700A129E2 /* OpenXmlPackage.h */,
6967B47F1E27C52700A129E2 /* ParagraphHeight.cpp */,
6967B4801E27C52700A129E2 /* ParagraphHeight.h */,
6967B4811E27C52700A129E2 /* ParagraphPropertiesMapping.cpp */,
6967B4821E27C52700A129E2 /* ParagraphPropertiesMapping.h */,
6967B4831E27C52700A129E2 /* ParagraphPropertyExceptions.cpp */,
6967B4841E27C52700A129E2 /* ParagraphPropertyExceptions.h */,
6967B4851E27C52700A129E2 /* PictureDescriptor.cpp */,
6967B4861E27C52700A129E2 /* PictureDescriptor.h */,
6967B4871E27C52700A129E2 /* PieceDescriptor.h */,
6967B4881E27C52700A129E2 /* PieceTable.cpp */,
6967B4891E27C52700A129E2 /* PieceTable.h */,
6967B48A1E27C52700A129E2 /* Plex.h */,
6967B48B1E27C52700A129E2 /* PropertiesMapping.cpp */,
6967B48C1E27C52700A129E2 /* PropertiesMapping.h */,
6967B48D1E27C52700A129E2 /* PropertyExceptions.cpp */,
6967B48E1E27C52700A129E2 /* PropertyExceptions.h */,
6967B48F1E27C52700A129E2 /* RevisionData.cpp */,
6967B4901E27C52700A129E2 /* RevisionData.h */,
6967B4911E27C52700A129E2 /* RGBColor.h */,
6967B4921E27C52700A129E2 /* SectionDescriptor.h */,
6967B4931E27C52700A129E2 /* SectionPropertiesMapping.cpp */,
6967B4941E27C52700A129E2 /* SectionPropertiesMapping.h */,
6967B4951E27C52700A129E2 /* SectionPropertyExceptions.h */,
6967B4961E27C52700A129E2 /* SettingsMapping.cpp */,
6967B4971E27C52700A129E2 /* SettingsMapping.h */,
6967B4981E27C52700A129E2 /* ShadingDescriptor.h */,
6967B4991E27C52700A129E2 /* SinglePropertyModifier.cpp */,
6967B49A1E27C52700A129E2 /* SinglePropertyModifier.h */,
6967B49B1E27C52700A129E2 /* Spa.cpp */,
6967B49C1E27C52700A129E2 /* Spa.h */,
6967B49D1E27C52700A129E2 /* SprmTDefTable.h */,
6967B49E1E27C52700A129E2 /* StringTable.h */,
6967B49F1E27C52700A129E2 /* StructuredStorageReader.h */,
6967B4A01E27C52700A129E2 /* StyleSheet.cpp */,
6967B4A11E27C52700A129E2 /* StyleSheet.h */,
6967B4A21E27C52700A129E2 /* StyleSheetDescription.cpp */,
6967B4A31E27C52700A129E2 /* StyleSheetDescription.h */,
6967B4A41E27C52700A129E2 /* StyleSheetInformation.cpp */,
6967B4A51E27C52700A129E2 /* StyleSheetInformation.h */,
6967B4A61E27C52700A129E2 /* StyleSheetMapping.cpp */,
6967B4A71E27C52700A129E2 /* StyleSheetMapping.h */,
6967B4A81E27C52700A129E2 /* TabDescriptor.h */,
6967B4A91E27C52700A129E2 /* TableCellPropertiesMapping.cpp */,
6967B4AA1E27C52700A129E2 /* TableCellPropertiesMapping.h */,
6967B4AB1E27C52700A129E2 /* TableInfo.h */,
6967B4AC1E27C52700A129E2 /* TableMapping.cpp */,
6967B4AD1E27C52700A129E2 /* TableMapping.h */,
6967B4AE1E27C52700A129E2 /* TablePropertiesMapping.cpp */,
6967B4AF1E27C52700A129E2 /* TablePropertiesMapping.h */,
6967B4B01E27C52700A129E2 /* TablePropertyExceptions.h */,
6967B4B11E27C52700A129E2 /* TableRowPropertiesMapping.cpp */,
6967B4B21E27C52700A129E2 /* TableRowPropertiesMapping.h */,
6967B4B31E27C52700A129E2 /* Tbkd.h */,
6967B4B41E27C52700A129E2 /* TextboxMapping.cpp */,
6967B4B51E27C52700A129E2 /* TextboxMapping.h */,
6967B4B61E27C52700A129E2 /* TwipsValue.h */,
6967B4B71E27C52700A129E2 /* VirtualStreamReader.h */,
6967B4B81E27C52700A129E2 /* VMLPictureMapping.cpp */,
6967B4B91E27C52700A129E2 /* VMLPictureMapping.h */,
6967B4BA1E27C52700A129E2 /* VMLShapeMapping.cpp */,
6967B4BB1E27C52700A129E2 /* VMLShapeMapping.h */,
6967B4BC1E27C52700A129E2 /* VMLShapeTypeMapping.cpp */,
6967B4BD1E27C52700A129E2 /* VMLShapeTypeMapping.h */,
6967B4BE1E27C52700A129E2 /* WideString.h */,
6967B4BF1E27C52700A129E2 /* WordDocument.cpp */,
6967B4C01E27C52700A129E2 /* WordDocument.h */,
6967B4C11E27C52700A129E2 /* WordprocessingDocument.cpp */,
6967B4C21E27C52700A129E2 /* WordprocessingDocument.h */,
);
name = DocDocxConverter;
path = ../../../DocDocxConverter;
sourceTree = "<group>";
};
6967B42F1E27C52700A129E2 /* OfficeDrawing */ = {
isa = PBXGroup;
children = (
6967B4301E27C52700A129E2 /* BitmapBlip.h */,
6967B4311E27C52700A129E2 /* BlipStoreContainer.h */,
6967B4321E27C52700A129E2 /* BlipStoreEntry.h */,
6967B4331E27C52700A129E2 /* ChildAnchor.h */,
6967B4341E27C52700A129E2 /* ClientAnchor.h */,
6967B4351E27C52700A129E2 /* ClientData.h */,
6967B4361E27C52700A129E2 /* DiagramBooleanProperties.h */,
6967B4371E27C52700A129E2 /* DrawingContainer.h */,
6967B4381E27C52700A129E2 /* DrawingGroup.h */,
6967B4391E27C52700A129E2 /* DrawingGroupRecord.h */,
6967B43A1E27C52700A129E2 /* DrawingRecord.h */,
6967B43B1E27C52700A129E2 /* FillStyleBooleanProperties.h */,
6967B43C1E27C52700A129E2 /* GeometryBooleanProperties.h */,
6967B43D1E27C52700A129E2 /* GeometryTextBooleanProperties.h */,
6967B43E1E27C52700A129E2 /* GroupContainer.h */,
6967B43F1E27C52700A129E2 /* GroupShapeBooleanProperties.h */,
6967B4401E27C52700A129E2 /* GroupShapeRecord.h */,
6967B4411E27C52700A129E2 /* LineStyleBooleanProperties.h */,
6967B4421E27C52700A129E2 /* MetafilePictBlip.h */,
6967B4431E27C52700A129E2 /* OfficeArtClientTextbox.h */,
6967B4441E27C52700A129E2 /* PathParser.h */,
6967B4451E27C52700A129E2 /* PathSegment.h */,
6967B4461E27C52700A129E2 /* ProtectionBooleanProperties.h */,
6967B4471E27C52700A129E2 /* Record.cpp */,
6967B4481E27C52700A129E2 /* Record.h */,
6967B4491E27C52700A129E2 /* RecordFactory.cpp */,
6967B44A1E27C52700A129E2 /* RecordFactory.h */,
6967B44B1E27C52700A129E2 /* RegularContainer.h */,
6967B44C1E27C52700A129E2 /* ShadowStyleBooleanProperties.h */,
6967B44D1E27C52700A129E2 /* Shape.h */,
6967B44E1E27C52700A129E2 /* ShapeContainer.h */,
6967B44F1E27C52700A129E2 /* ShapeOptions.h */,
6967B4501E27C52700A129E2 /* ShapeType.h */,
6967B4511E27C52700A129E2 /* ShapeTypeFactory.cpp */,
6967B4521E27C52700A129E2 /* ShapeTypeFactory.h */,
6967B4531E27C52700A129E2 /* Shapetypes */,
6967B4781E27C52700A129E2 /* SplitMenuColorContainer.h */,
6967B4791E27C52700A129E2 /* UnknownRecord.h */,
);
path = OfficeDrawing;
sourceTree = "<group>";
};
6967B4531E27C52700A129E2 /* Shapetypes */ = {
isa = PBXGroup;
children = (
6967B4541E27C52700A129E2 /* ArcType.h */,
6967B4551E27C52700A129E2 /* ArrowType.h */,
6967B4561E27C52700A129E2 /* BevelType.h */,
6967B4571E27C52700A129E2 /* BlockArcType.h */,
6967B4581E27C52700A129E2 /* BracketsType.h */,
6967B4591E27C52700A129E2 /* CalloutsType.h */,
6967B45A1E27C52700A129E2 /* CanType.h */,
6967B45B1E27C52700A129E2 /* Connector.h */,
6967B45C1E27C52700A129E2 /* CubeType.h */,
6967B45D1E27C52700A129E2 /* DiamondType.h */,
6967B45E1E27C52700A129E2 /* DonutType.h */,
6967B45F1E27C52700A129E2 /* FlowChartType.h */,
6967B4601E27C52700A129E2 /* FoldedCornerlType.h */,
6967B4611E27C52700A129E2 /* HeartType.h */,
6967B4621E27C52700A129E2 /* HexagonType.h */,
6967B4631E27C52700A129E2 /* IsoscelesTriangleType.h */,
6967B4641E27C52700A129E2 /* LightningBoltType.h */,
6967B4651E27C52700A129E2 /* LineType.h */,
6967B4661E27C52700A129E2 /* MoonType.h */,
6967B4671E27C52700A129E2 /* NoSmokingType.h */,
6967B4681E27C52700A129E2 /* OctagonType.h */,
6967B4691E27C52700A129E2 /* OvalType.h */,
6967B46A1E27C52700A129E2 /* ParallelogramType.h */,
6967B46B1E27C52700A129E2 /* PentagonType.h */,
6967B46C1E27C52700A129E2 /* PictureFrameType.h */,
6967B46D1E27C52700A129E2 /* PlaqueType.h */,
6967B46E1E27C52700A129E2 /* PlusType.h */,
6967B46F1E27C52700A129E2 /* RectangleType.h */,
6967B4701E27C52700A129E2 /* RightTriangleType.h */,
6967B4711E27C52700A129E2 /* RoundedRectangleType.h */,
6967B4721E27C52700A129E2 /* SmileyFaceType.h */,
6967B4731E27C52700A129E2 /* StarType.h */,
6967B4741E27C52700A129E2 /* SunType.h */,
6967B4751E27C52700A129E2 /* TextboxType.h */,
6967B4761E27C52700A129E2 /* TrapezoidType.h */,
6967B4771E27C52700A129E2 /* WordArtText.h */,
);
path = Shapetypes;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
6967B2EA1E27C23A00A129E2 /* DocFormatLib */ = {
isa = PBXNativeTarget;
buildConfigurationList = 6967B2F41E27C23A00A129E2 /* Build configuration list for PBXNativeTarget "DocFormatLib" */;
buildPhases = (
6967B2E71E27C23A00A129E2 /* Sources */,
6967B2E81E27C23A00A129E2 /* Frameworks */,
6967B2E91E27C23A00A129E2 /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = DocFormatLib;
productName = DocFormatLib;
productReference = 6967B2EB1E27C23A00A129E2 /* libDocFormatLib.a */;
productType = "com.apple.product-type.library.static";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
6967B2E31E27C23A00A129E2 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = OnlyOffce;
TargetAttributes = {
6967B2EA1E27C23A00A129E2 = {
CreatedOnToolsVersion = 8.2;
DevelopmentTeam = 2WH24U26GJ;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 6967B2E61E27C23A00A129E2 /* Build configuration list for PBXProject "DocFormatLib" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 6967B2E21E27C23A00A129E2;
productRefGroup = 6967B2EC1E27C23A00A129E2 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
6967B2EA1E27C23A00A129E2 /* DocFormatLib */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
6967B2E71E27C23A00A129E2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6967B4D11E27C52700A129E2 /* LanguageIdMapping.cpp in Sources */,
6967B4E61E27C52700A129E2 /* SinglePropertyModifier.cpp in Sources */,
6967B4C91E27C52700A129E2 /* EncryptionHeader.cpp in Sources */,
6967B4D71E27C52700A129E2 /* Record.cpp in Sources */,
6967B4ED1E27C52700A129E2 /* TableMapping.cpp in Sources */,
6967B4F31E27C52700A129E2 /* VMLShapeTypeMapping.cpp in Sources */,
6967B4E31E27C52700A129E2 /* RevisionData.cpp in Sources */,
6967B4D41E27C52700A129E2 /* ListTable.cpp in Sources */,
6967B4F41E27C52700A129E2 /* WordDocument.cpp in Sources */,
6967B4CD1E27C52700A129E2 /* FormattedDiskPageCHPX.cpp in Sources */,
6967B4F11E27C52700A129E2 /* VMLPictureMapping.cpp in Sources */,
6967B4D21E27C52700A129E2 /* ListData.cpp in Sources */,
6967B4E21E27C52700A129E2 /* PropertyExceptions.cpp in Sources */,
6967B4C31E27C52700A129E2 /* AnnotationReferenceDescriptor.cpp in Sources */,
6967B4D31E27C52700A129E2 /* ListLevel.cpp in Sources */,
6967B4CB1E27C52700A129E2 /* FontTableMapping.cpp in Sources */,
6967B4EC1E27C52700A129E2 /* TableCellPropertiesMapping.cpp in Sources */,
6967B4D81E27C52700A129E2 /* RecordFactory.cpp in Sources */,
6967B4C61E27C52700A129E2 /* DocumentMapping.cpp in Sources */,
6967B4CA1E27C52700A129E2 /* FontFamilyName.cpp in Sources */,
6967B4F21E27C52700A129E2 /* VMLShapeMapping.cpp in Sources */,
6967B4C71E27C52700A129E2 /* DocumentProperties.cpp in Sources */,
6967B4EF1E27C52700A129E2 /* TableRowPropertiesMapping.cpp in Sources */,
6967B4E01E27C52700A129E2 /* PieceTable.cpp in Sources */,
6967B4E81E27C52700A129E2 /* StyleSheet.cpp in Sources */,
6967B4EA1E27C52700A129E2 /* StyleSheetInformation.cpp in Sources */,
6967B4D91E27C52700A129E2 /* ShapeTypeFactory.cpp in Sources */,
6967B4D01E27C52700A129E2 /* HeaderMapping.cpp in Sources */,
6967B4DA1E27C52700A129E2 /* OleObject.cpp in Sources */,
6967B4D61E27C52700A129E2 /* NumberingMapping.cpp in Sources */,
6967B4CE1E27C52700A129E2 /* FormattedDiskPagePAPX.cpp in Sources */,
6967B4DF1E27C52700A129E2 /* PictureDescriptor.cpp in Sources */,
6967B4C41E27C52700A129E2 /* CharacterPropertiesMapping.cpp in Sources */,
6967B4F01E27C52700A129E2 /* TextboxMapping.cpp in Sources */,
6967B4DC1E27C52700A129E2 /* ParagraphHeight.cpp in Sources */,
6967B4DD1E27C52700A129E2 /* ParagraphPropertiesMapping.cpp in Sources */,
6967B4E11E27C52700A129E2 /* PropertiesMapping.cpp in Sources */,
6967B4C51E27C52700A129E2 /* Converter.cpp in Sources */,
6967B4E91E27C52700A129E2 /* StyleSheetDescription.cpp in Sources */,
6967B4E41E27C52700A129E2 /* SectionPropertiesMapping.cpp in Sources */,
6967B4EE1E27C52700A129E2 /* TablePropertiesMapping.cpp in Sources */,
6967B4D51E27C52700A129E2 /* MainDocumentMapping.cpp in Sources */,
6967B4E51E27C52700A129E2 /* SettingsMapping.cpp in Sources */,
6967B4DB1E27C52700A129E2 /* OpenXmlPackage.cpp in Sources */,
6967B4CF1E27C52700A129E2 /* HeaderAndFooterTable.cpp in Sources */,
6967B4F51E27C52700A129E2 /* WordprocessingDocument.cpp in Sources */,
6967B2F91E27C26800A129E2 /* DocFormatLib.cpp in Sources */,
6967B4CC1E27C52700A129E2 /* FooterMapping.cpp in Sources */,
6967B4C81E27C52700A129E2 /* DrawingPrimitives.cpp in Sources */,
6967B4E71E27C52700A129E2 /* Spa.cpp in Sources */,
6967B3E11E27C2D500A129E2 /* pole.cpp in Sources */,
6967B4EB1E27C52700A129E2 /* StyleSheetMapping.cpp in Sources */,
6967B4DE1E27C52700A129E2 /* ParagraphPropertyExceptions.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
6967B2F21E27C23A00A129E2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
6967B2F31E27C23A00A129E2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
6967B2F51E27C23A00A129E2 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = 2WH24U26GJ;
GCC_PREPROCESSOR_DEFINITIONS = (
UNICODE,
_UNICODE,
_USE_XMLLITE_READER_,
USE_LITE_READER,
USE_ATL_CSTRING,
_USE_LIBXML2_READER_,
LIBXML_READER_ENABLED,
_IOS,
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
/usr/include/,
/usr/include/libxml2/,
"$(PROJECT_DIR)/../../../DesktopEditor/freetype-2.5.2/include",
"$(PROJECT_DIR)/../../../DesktopEditor/freetype-2.5.2/devel",
"$(PROJECT_DIR)/../../../DesktopEditor/agg-2.4/include",
"$(PROJECT_DIR)/../../../Common/3dParty/pole",
"$(PROJECT_DIR)/../../../Common/3dParty/boost/boost_1_58_0",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Debug;
};
6967B2F61E27C23A00A129E2 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
DEVELOPMENT_TEAM = 2WH24U26GJ;
GCC_PREPROCESSOR_DEFINITIONS = (
UNICODE,
_UNICODE,
_USE_XMLLITE_READER_,
USE_LITE_READER,
USE_ATL_CSTRING,
_USE_LIBXML2_READER_,
LIBXML_READER_ENABLED,
_IOS,
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
/usr/include/,
/usr/include/libxml2/,
"$(PROJECT_DIR)/../../../DesktopEditor/freetype-2.5.2/include",
"$(PROJECT_DIR)/../../../DesktopEditor/freetype-2.5.2/devel",
"$(PROJECT_DIR)/../../../DesktopEditor/agg-2.4/include",
"$(PROJECT_DIR)/../../../Common/3dParty/pole",
"$(PROJECT_DIR)/../../../Common/3dParty/boost/boost_1_58_0",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
6967B2E61E27C23A00A129E2 /* Build configuration list for PBXProject "DocFormatLib" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6967B2F21E27C23A00A129E2 /* Debug */,
6967B2F31E27C23A00A129E2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
6967B2F41E27C23A00A129E2 /* Build configuration list for PBXNativeTarget "DocFormatLib" */ = {
isa = XCConfigurationList;
buildConfigurations = (
6967B2F51E27C23A00A129E2 /* Debug */,
6967B2F61E27C23A00A129E2 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 6967B2E31E27C23A00A129E2 /* Project object */;
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:DocFormatLib.xcodeproj">
</FileRef>
</Workspace>

View File

@ -0,0 +1 @@
DO NOT REMOVE FOLDER FOR XCODE

View File

@ -71,7 +71,7 @@ namespace Writers
if(false == IsEmpty())
{
OOX::CPath pathChartDir = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("charts");
FileSystem::Directory::CreateDirectory(pathChartDir.GetPath());
NSDirectory::CreateDirectory(pathChartDir.GetPath());
for(int i = 0, length = m_aCharts.size(); i < length; ++i)
{

View File

@ -36,26 +36,26 @@
namespace Writers
{
static CString g_string_comment_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:comments xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\">");
static CString g_string_comment_End = _T("</w:comments>");
static CString g_string_commentExt_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w15:commentsEx xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\">");
static CString g_string_commentExt_End = _T("</w15:commentsEx>");
static CString g_string_people_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w15:people xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\">");
static CString g_string_people_End = _T("</w15:people>");
static std::wstring g_string_comment_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:comments xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\">");
static std::wstring g_string_comment_End = _T("</w:comments>");
static std::wstring g_string_commentExt_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w15:commentsEx xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\">");
static std::wstring g_string_commentExt_End = _T("</w15:commentsEx>");
static std::wstring g_string_people_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w15:people xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 wp14\">");
static std::wstring g_string_people_End = _T("</w15:people>");
class CommentsWriter
{
CString m_sDir;
std::wstring m_sDir;
ContentTypesWriter& m_oContentTypesWriter;
public:
CString m_sComment;
CString m_sCommentExt;
CString m_sPeople;
std::wstring m_sComment;
std::wstring m_sCommentExt;
std::wstring m_sPeople;
public:
CommentsWriter(CString sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
CommentsWriter(std::wstring sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
{
}
void setElements(CString& sComment, CString& sCommentExt, CString& sPeople)
void setElements(std::wstring& sComment, std::wstring& sCommentExt, std::wstring& sPeople)
{
m_sComment = sComment;
m_sCommentExt = sCommentExt;
@ -63,7 +63,7 @@ namespace Writers
}
void Write()
{
if(false == m_sComment.IsEmpty())
if(false == m_sComment.empty())
{
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("comments.xml");
@ -75,12 +75,12 @@ namespace Writers
oFile.CloseFile();
//Content_Types
m_oContentTypesWriter.AddOverride(CString(_T("/word/comments.xml")), CString(_T("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml")));
m_oContentTypesWriter.AddOverride(std::wstring(_T("/word/comments.xml")), std::wstring(_T("application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml")));
//Rels
//m_oDocumentRelsWriter.AddRels(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"), _T("comments.xml"));
}
if(false == m_sCommentExt.IsEmpty())
if(false == m_sCommentExt.empty())
{
CFile oFile;
oFile.CreateFile(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("commentsExtended.xml"));
@ -90,9 +90,9 @@ namespace Writers
oFile.CloseFile();
//Content_Types
m_oContentTypesWriter.AddOverride(CString(_T("/word/commentsExtended.xml")), CString(_T("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml")));
m_oContentTypesWriter.AddOverride(std::wstring(_T("/word/commentsExtended.xml")), std::wstring(_T("application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml")));
}
if(false == m_sPeople.IsEmpty())
if(false == m_sPeople.empty())
{
CFile oFile;
oFile.CreateFile(m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("people.xml"));
@ -102,7 +102,7 @@ namespace Writers
oFile.CloseFile();
//Content_Types
m_oContentTypesWriter.AddOverride(CString(_T("/word/people.xml")), CString(_T("application/vnd.openxmlformats-officedocument.wordprocessingml.people+xml")));
m_oContentTypesWriter.AddOverride(std::wstring(_T("/word/people.xml")), std::wstring(_T("application/vnd.openxmlformats-officedocument.wordprocessingml.people+xml")));
}
}
};

View File

@ -68,7 +68,7 @@ namespace Writers
}
void AddOverride(const std::wstring& PartName, const std::wstring& ContentType)
{
std::wstring sOverride = L"<Override PartName=\"" + PartName+ L"\ ContentType=\"" + ContentType + L"\"/>";
std::wstring sOverride = L"<Override PartName=\"" + PartName+ L"\" ContentType=\"" + ContentType + L"\"/>";
m_oAdditional.WriteString(sOverride);
}
void AddOverrideRaw(const std::wstring& sXml)

View File

@ -42,9 +42,9 @@ namespace Writers
DefaultThemeWriter()
{
}
void Write(CString sThemeFilePath)
void Write(std::wstring sThemeFilePath)
{
CString s_Common;
std::wstring s_Common;
s_Common = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?> \
<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\"> \

View File

@ -38,14 +38,14 @@ namespace Writers
{
class DocumentRelsWriter
{
CString m_sDir;
std::wstring m_sDir;
public:
DocumentRelsWriter(CString sDir):m_sDir(sDir)
DocumentRelsWriter(std::wstring sDir):m_sDir(sDir)
{
}
void Write()
{
CString s_Common;
std::wstring s_Common;
s_Common = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?> \
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"> \

View File

@ -42,9 +42,9 @@ namespace Writers
XmlUtils::CStringWriter m_oWriter;
HeaderFooterWriter& m_oHeaderFooterWriter;
public:
CString m_sDir;
std::wstring m_sDir;
public:
DocumentWriter(CString sDir, HeaderFooterWriter& oHeaderFooterWriter):m_sDir(sDir), m_oHeaderFooterWriter(oHeaderFooterWriter)
DocumentWriter( std::wstring sDir, HeaderFooterWriter& oHeaderFooterWriter):m_sDir(sDir), m_oHeaderFooterWriter(oHeaderFooterWriter)
{
}
void Write()
@ -53,34 +53,35 @@ namespace Writers
CFile oFile;
oFile.CreateFile(filePath.GetPath());
oFile.WriteStringUTF8(CString(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>")));
oFile.WriteStringUTF8(CString(_T("<w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">")));
oFile.WriteStringUTF8( std::wstring(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>")));
oFile.WriteStringUTF8( std::wstring(_T("<w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">")));
oFile.WriteStringUTF8(m_oBackground.GetData());
oFile.WriteStringUTF8(CString(_T("<w:body>")));
oFile.WriteStringUTF8( std::wstring(_T("<w:body>")));
oFile.WriteStringUTF8(m_oContent.GetData());
oFile.WriteStringUTF8(CString(_T("<w:sectPr >")));
oFile.WriteStringUTF8( std::wstring(_T("<w:sectPr >")));
oFile.WriteStringUTF8(WriteSectPrHdrFtr());
oFile.WriteStringUTF8(m_oSecPr.GetData());
oFile.WriteStringUTF8(CString(_T("</w:sectPr>")));
oFile.WriteStringUTF8( std::wstring(_T("</w:sectPr>")));
oFile.WriteStringUTF8(CString(_T("</w:body>")));
oFile.WriteStringUTF8( std::wstring(_T("</w:body>")));
oFile.WriteStringUTF8(CString(_T("</w:document>")));
oFile.WriteStringUTF8( std::wstring(_T("</w:document>")));
oFile.CloseFile();
}
CString WriteSectPrHdrFtr()
std::wstring WriteSectPrHdrFtr()
{
CString sResult;
std::wstring sResult;
if(BinDocxRW::g_nCurFormatVersion < 5)
{
bool bTitlePage = false;
for(int i = 0, length = m_oHeaderFooterWriter.m_aHeaders.size(); i < length; ++i)
{
HdrFtrItem* pHeader = m_oHeaderFooterWriter.m_aHeaders[i];
if(false == pHeader->rId.IsEmpty())
if(false == pHeader->rId.empty())
{
if(SimpleTypes::hdrftrFirst == pHeader->eType)
{
@ -100,7 +101,7 @@ namespace Writers
for(int i = 0, length = m_oHeaderFooterWriter.m_aFooters.size(); i < length; ++i)
{
HdrFtrItem* pFooter = m_oHeaderFooterWriter.m_aFooters[i];
if(false == pFooter->rId.IsEmpty())
if(false == pFooter->rId.empty())
{
if(SimpleTypes::hdrftrFirst == pFooter->eType)
{

View File

@ -54,7 +54,7 @@ namespace Writers
{
public:
NSBinPptxRW::CDrawingConverter* m_pDrawingConverter;
CString m_sThemePath;
std::wstring m_sThemePath;
bool m_bSaveChartAsImg;
ContentTypesWriter m_oContentTypesWriter;
@ -76,7 +76,7 @@ namespace Writers
int m_nDocPrIndex;
BinDocxRW::CComments* m_pComments;
public:
FileWriter(CString sDirOutput,CString sFontDir, bool bNoFontDir, int nVersion, bool bSaveChartAsImg, NSBinPptxRW::CDrawingConverter* pDrawingConverter, CString sThemePath):
FileWriter(std::wstring sDirOutput,std::wstring sFontDir, bool bNoFontDir, int nVersion, bool bSaveChartAsImg, NSBinPptxRW::CDrawingConverter* pDrawingConverter, std::wstring sThemePath):
m_pDrawingConverter(pDrawingConverter),m_sThemePath(sThemePath),m_bSaveChartAsImg(bSaveChartAsImg),
m_oContentTypesWriter(sDirOutput), m_oFontTableWriter(sDirOutput, sFontDir, bNoFontDir),
m_oHeaderFooterWriter(sDirOutput, m_oContentTypesWriter),

View File

@ -41,7 +41,7 @@ namespace Writers
public:
XmlUtils::CStringWriter m_oBackground;
XmlUtils::CStringWriter m_oContent;
XmlUtils::CStringWriter m_oSecPr;
XmlUtils::CStringWriter m_oSecPr;
};
class HdrFtrItem
{
@ -52,34 +52,34 @@ namespace Writers
}
bool IsEmpty()
{
return m_sFilename.IsEmpty();
return m_sFilename.empty();
}
CString m_sFilename;
std::wstring m_sFilename;
ContentWriter Header;
CString rId;
std::wstring rId;
SimpleTypes::EHdrFtr eType;
};
static CString g_string_hdr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:hdr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static CString g_string_hdr_End = _T("</w:hdr>");
static std::wstring g_string_hdr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:hdr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_hdr_End = _T("</w:hdr>");
static CString g_string_ftr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:ftr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static CString g_string_ftr_End = _T("</w:ftr>");
static std::wstring g_string_ftr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:ftr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_ftr_End = _T("</w:ftr>");
static CString g_string_footnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:footnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static CString g_string_footnotes_End = _T("</w:footnotes>");
static std::wstring g_string_footnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:footnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_footnotes_End = _T("</w:footnotes>");
static CString g_string_endnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:endnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static CString g_string_endnotes_End = _T("</w:endnotes>");
static std::wstring g_string_endnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:endnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_endnotes_End = _T("</w:endnotes>");
class HeaderFooterWriter
{
CString m_sDir;
std::wstring m_sDir;
ContentTypesWriter& m_oContentTypesWriter;
public:
std::vector<HdrFtrItem*> m_aHeaders;
std::vector<HdrFtrItem*> m_aFooters;
public:
HeaderFooterWriter(CString sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
HeaderFooterWriter( std::wstring sDir, ContentTypesWriter& oContentTypesWriter) : m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
{
}
~HeaderFooterWriter()
@ -104,7 +104,7 @@ namespace Writers
WriteItem(_T("footer"), pFooter->m_sFilename, pFooter->Header, false);
}
}
void WriteItem(CString sHeader, CString& sFilename, ContentWriter& m_oWriter, bool bHeader)
void WriteItem( std::wstring sHeader, std::wstring& sFilename, ContentWriter& m_oWriter, bool bHeader)
{
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + sFilename;
@ -123,7 +123,7 @@ namespace Writers
oFile.CloseFile();
//Content_Types
m_oContentTypesWriter.AddOverride(_T("/word/") + sFilename, _T("application/vnd.openxmlformats-officedocument.wordprocessingml.")+sHeader+_T("+xml"));
m_oContentTypesWriter.AddOverride(L"/word/" + sFilename, L"application/vnd.openxmlformats-officedocument.wordprocessingml." + sHeader + L"+xml");
//Rels
//return m_oDocumentRelsWriter.AddRels(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/") + sHeader, sFilename);
@ -131,20 +131,20 @@ namespace Writers
};
class FootnotesWriter
{
CString m_sDir;
std::wstring m_sDir;
ContentTypesWriter& m_oContentTypesWriter;
public:
ContentWriter m_oNotesWriter;
FootnotesWriter(CString sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
FootnotesWriter( std::wstring sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
{
}
void Write()
{
if(!IsEmpty())
{
CString sFilename = getFilename();
std::wstring sFilename = getFilename();
CString filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + sFilename;
std::wstring filePath = m_sDir + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR + sFilename;
CFile oFile;
oFile.CreateFile(filePath);
@ -154,10 +154,10 @@ namespace Writers
oFile.CloseFile();
//ContentType
m_oContentTypesWriter.AddOverride(_T("/word/") + sFilename, _T("application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml"));
m_oContentTypesWriter.AddOverride(L"/word/" + sFilename, L"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml");
}
}
CString getFilename()
std::wstring getFilename()
{
return _T("footnotes.xml");
}
@ -168,20 +168,20 @@ namespace Writers
};
class EndnotesWriter
{
CString m_sDir;
std::wstring m_sDir;
ContentTypesWriter& m_oContentTypesWriter;
public:
ContentWriter m_oNotesWriter;
EndnotesWriter(CString sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
EndnotesWriter( std::wstring sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
{
}
void Write()
{
if(!IsEmpty())
{
CString sFilename = getFilename();
std::wstring sFilename = getFilename();
CString filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + sFilename;
std::wstring filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + sFilename;
CFile oFile;
oFile.CreateFile(filePath);
@ -194,7 +194,7 @@ namespace Writers
m_oContentTypesWriter.AddOverride(_T("/word/") + sFilename, _T("application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"));
}
}
CString getFilename()
std::wstring getFilename()
{
return _T("endnotes.xml");
}

View File

@ -37,19 +37,19 @@
namespace Writers
{
static CString g_string_n_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:numbering xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static CString g_string_n_End = _T("</w:numbering>");
static std::wstring g_string_n_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:numbering xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_n_End = _T("</w:numbering>");
class NumberingWriter
{
XmlUtils::CStringWriter m_oWriter;
CString m_sDir;
std::wstring m_sDir;
ContentTypesWriter& m_oContentTypesWriter;
public:
XmlUtils::CStringWriter m_oANum;
XmlUtils::CStringWriter m_oNumList;
public:
NumberingWriter(CString sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
NumberingWriter( std::wstring sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
{
}
bool IsEmpty()
@ -74,7 +74,7 @@ namespace Writers
oFile.CloseFile();
//ContentType
m_oContentTypesWriter.AddOverride(CString(_T("/word/numbering.xml")), CString(_T("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml")));
m_oContentTypesWriter.AddOverride( std::wstring(_T("/word/numbering.xml")), std::wstring(_T("application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml")));
//Rels
//m_oDocumentRelsWriter.AddRels(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"), _T("numbering.xml"));
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -36,23 +36,23 @@
namespace Writers
{
static CString 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 CString g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:compat><w:compatSetting w:name=\"compatibilityMode\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"14\"/><w:compatSetting w:name=\"overrideTableStyleFontSizeAndJustification\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"enableOpenTypeFeatures\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"doNotFlipMirrorIndents\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/></w:compat><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults><w:decimalSymbol w:val=\".\"/><w:listSeparator w:val=\",\"/>");
static CString g_string_set_End = _T("</w:settings>");
static std::wstring g_string_set_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><w:settings xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:v=\"urn:schemas-microsoft-com:vml\">");
static std::wstring g_string_set_Default = _T("<w:zoom w:percent=\"100\"/><w:characterSpacingControl w:val=\"doNotCompress\"/><w:compat><w:compatSetting w:name=\"compatibilityMode\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"14\"/><w:compatSetting w:name=\"overrideTableStyleFontSizeAndJustification\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"enableOpenTypeFeatures\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/><w:compatSetting w:name=\"doNotFlipMirrorIndents\" w:uri=\"http://schemas.microsoft.com/office/word\" w:val=\"1\"/></w:compat><w:themeFontLang w:val=\"en-US\" w:eastAsia=\"zh-CN\"/><w:shapeDefaults><o:shapedefaults v:ext=\"edit\" spidmax=\"1026\"/><o:shapelayout v:ext=\"edit\"><o:idmap v:ext=\"edit\" data=\"1\"/></o:shapelayout></w:shapeDefaults><w:decimalSymbol w:val=\".\"/><w:listSeparator w:val=\",\"/>");
static std::wstring g_string_set_End = _T("</w:settings>");
class SettingWriter
{
CString m_sDir;
std::wstring m_sDir;
XmlUtils::CStringWriter m_oSettingWriter;
HeaderFooterWriter& m_oHeaderFooterWriter;
public:
SettingWriter(CString sDir, HeaderFooterWriter& oHeaderFooterWriter):m_sDir(sDir),m_oHeaderFooterWriter(oHeaderFooterWriter)
SettingWriter(std::wstring sDir, HeaderFooterWriter& oHeaderFooterWriter):m_sDir(sDir),m_oHeaderFooterWriter(oHeaderFooterWriter)
{
}
void Write()
{
Prepare();
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR +_T("word") + FILE_SEPARATOR_STR + _T("settings.xml");
OOX::CPath filePath = m_sDir + FILE_SEPARATOR_STR + L"word" + FILE_SEPARATOR_STR + L"settings.xml";
CFile oFile;
oFile.CreateFile(filePath.GetPath());
@ -63,7 +63,7 @@ namespace Writers
oFile.CloseFile();
}
void AddSetting(CString sSetting)
void AddSetting(std::wstring sSetting)
{
m_oSettingWriter.WriteString(sSetting);
}
@ -85,7 +85,7 @@ namespace Writers
bevenAndOddHeaders = true;
}
if(bevenAndOddHeaders)
AddSetting(_T("<w:evenAndOddHeaders/>"));
AddSetting(L"<w:evenAndOddHeaders/>");
}
}
};

File diff suppressed because one or more lines are too long

View File

@ -37,24 +37,24 @@
namespace Writers
{
static CString g_string_ft_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:fonts xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" mc:Ignorable=\"w14\">");
static CString g_string_ft_End = _T("</w:fonts>");
static std::wstring g_string_ft_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:fonts xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" mc:Ignorable=\"w14\">");
static std::wstring g_string_ft_End = _T("</w:fonts>");
class FontTableWriter
{
XmlUtils::CStringWriter m_oWriter;
CString m_sDir;
CApplicationFonts m_oApplicationFonts;
CFontManager* m_pFontManager;
XmlUtils::CStringWriter m_oWriter;
std::wstring m_sDir;
CApplicationFonts m_oApplicationFonts;
CFontManager* m_pFontManager;
public:
std::map<CString, int> m_mapFonts;
std::map<std::wstring, int> m_mapFonts;
public:
FontTableWriter(CString sDir, CString sFontDir, bool bNoFontDir):m_sDir(sDir)
FontTableWriter(std::wstring sDir, std::wstring sFontDir, bool bNoFontDir):m_sDir(sDir)
{
m_pFontManager = NULL;
if(!bNoFontDir)
{
if(sFontDir.IsEmpty())
if(sFontDir.empty())
m_oApplicationFonts.Initialize();
else
m_oApplicationFonts.InitializeFromFolder(sFontDir);
@ -80,9 +80,9 @@ namespace Writers
bool bCalibri = false;
bool bTimes = false;
bool bCambria = false;
for (std::map<CString, int>::const_iterator it = m_mapFonts.begin(); it != m_mapFonts.end(); ++it)
for (std::map<std::wstring, int>::const_iterator it = m_mapFonts.begin(); it != m_mapFonts.end(); ++it)
{
const CString& sFontName = it->first;
const std::wstring& sFontName = it->first;
if(_T("Calibri") == sFontName)
bCalibri = true;
else if(_T("Times New Roman") == sFontName)
@ -108,15 +108,16 @@ namespace Writers
oFile.WriteStringUTF8(m_oWriter.GetData());
oFile.CloseFile();
}
void WriteFont(CString sFontName)
void WriteFont(std::wstring sFontName)
{
CString sPanose;
std::wstring sPanose;
bool bUsePanose = false;
if(NULL != m_pFontManager)
{
CFontSelectFormat oFontSelectFormat;
oFontSelectFormat.wsName = new std::wstring;
*oFontSelectFormat.wsName = std::wstring(sFontName.GetString());
*oFontSelectFormat.wsName = sFontName;
CFontInfo* pFontInfo = m_pFontManager->GetFontInfoByParams(oFontSelectFormat);
if(NULL != pFontInfo)
{
@ -126,9 +127,9 @@ namespace Writers
if(0 != cElem)
bUsePanose = true;
if(cElem > 0xF)
sPanose.AppendFormat(_T("%X"), cElem);
sPanose += XmlUtils::IntToString(cElem, L"%X");
else
sPanose.AppendFormat(_T("0%X"), cElem);
sPanose+= XmlUtils::IntToString(cElem, L"0%X");
}
}
@ -136,9 +137,9 @@ namespace Writers
sFontName = XmlUtils::EncodeXmlString(sFontName);
m_oWriter.WriteString(_T("<w:font w:name=\"") + sFontName + _T("\">"));
if(bUsePanose && !sPanose.IsEmpty())
if(bUsePanose && !sPanose.empty())
m_oWriter.WriteString(_T("<w:panose1 w:val=\"")+sPanose+_T("\"/>"));
m_oWriter.WriteString(CString(_T("</w:font>")));
m_oWriter.WriteString(std::wstring(_T("</w:font>")));
}
};
}

View File

@ -38,14 +38,14 @@ namespace Writers
{
class WebSettingsWriter
{
CString m_sDir;
std::wstring m_sDir;
public:
WebSettingsWriter(CString sDir):m_sDir(sDir)
WebSettingsWriter(std::wstring sDir):m_sDir(sDir)
{
}
void Write()
{
CString s_Common;
std::wstring s_Common;
s_Common = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?> \
<w:webSettings xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"> \

View File

@ -45,7 +45,7 @@ namespace MathEquation
class EquationRun
{
public:
CString str;
std::wstring str;
TMathFont* pFont;
LONG nTextSize;
bool bAccent;
@ -57,7 +57,7 @@ namespace MathEquation
{
bNormal = false;
}
void AddChar(CString sChar, TMathFont* pNewFont, LONG lSize)
void AddChar(std::wstring sChar, TMathFont* pNewFont, LONG lSize)
{
str = sChar;
pFont = pNewFont;
@ -197,10 +197,7 @@ namespace MathEquation
//else
// nCurPos = WriteItemStart(BinDocxRW::c_oSerRunType::rPr);
CString sFontName;
sFontName.Insert(0, _T("Cambria Math"));
if (sFontName)
std::wstring sFontName = L"Cambria Math";
{
m_oStream.WriteBYTE(BinDocxRW::c_oSerProp_rPrType::FontAscii);
m_oStream.WriteBYTE(BinDocxRW::c_oSerPropLenType::Variable);
@ -285,7 +282,7 @@ namespace MathEquation
else
bIsOpen = true;
CString sText;
std::wstring sText;
LONG lSize = oRManager.GetSize();
if (bLast)
@ -308,12 +305,12 @@ namespace MathEquation
{
int nCurPos = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::SSup);
int nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::SSupPr);
CString str;
std::wstring str;
switch (oRun.eType)
{
case embelPrime: str.Insert(0, 0x2032); break;
case embelDPrime: str.Insert(0, 0x2033); break;
case embelTPrime: str.Insert(0, 0x2034); break;
case embelPrime: str = 0x2032; break;
case embelDPrime: str = 0x2033; break;
case embelTPrime: str = 0x2034; break;
}
WriteItemEnd(nCurPos1);
@ -332,8 +329,8 @@ namespace MathEquation
{
int nCurPos = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::SPre);
int nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::SPrePr);
CString str;
str.Insert(0, 0x0060);
std::wstring str;
str = 0x0060;
WriteItemEnd(nCurPos1);
nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::Sup);
@ -351,24 +348,24 @@ namespace MathEquation
{
int nCurPos = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::Acc);
int nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::AccPr);
CString str;
std::wstring str;
switch (oRun.eType)
{
case embelDot: str.Insert(0, 0x0307); break;
case embelDDot: str.Insert(0, 0x0308); break;
case embelDDDot: str.Insert(0, 0x20DB); break;
case embelTilde: str.Insert(0, 0x0303); break;
case embelHat: str.Insert(0, 0x0302); break;
case embelSlash: str.Insert(0, 0x002F); break;
case embelLArrow: str.Insert(0, 0x20D6); break;
case embelRArrow: str.Insert(0, 0x20D7); break;
case embelDArrow: str.Insert(0, 0x20E1); break;
case embelLHarpoon: str.Insert(0, 0x20D0); break;
case embelRHarpoon: str.Insert(0, 0x20D1); break;
case embelStrikeout: str.Insert(0, 0x0336); break;
case embelBar: str.Insert(0, 0x0305); break;
case embelFrown: str.Insert(0, 0x0311); break;
case embelSmile: str.Insert(0, 0x0306); break;
case embelDot: str = 0x0307; break;
case embelDDot: str = 0x0308; break;
case embelDDDot: str = 0x20DB; break;
case embelTilde: str = 0x0303; break;
case embelHat: str = 0x0302; break;
case embelSlash: str = 0x002F; break;
case embelLArrow: str = 0x20D6; break;
case embelRArrow: str = 0x20D7; break;
case embelDArrow: str = 0x20E1; break;
case embelLHarpoon: str = 0x20D0; break;
case embelRHarpoon: str = 0x20D1; break;
case embelStrikeout: str = 0x0336; break;
case embelBar: str = 0x0305; break;
case embelFrown: str = 0x0311; break;
case embelSmile: str = 0x0306; break;
}
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemEnd(nCurPos1);
@ -468,25 +465,25 @@ namespace MathEquation
EquationRun oRun;
if (uChar)
{
CString str;
std::wstring str;
if (bSpecialSymbol)
{
switch(uChar)
{
case specialsymAlignment:
{
str.Insert(0, 0x0026);
str = 0x0026;
if (oRManager.GetAlligment())
oRun.bNormal = true;
else
oRManager.SetAlligment(true);
}
break;
case specialsymZeroSpace: str.Insert(0,0x200B); break;
case specialsymThinSpace: str.Insert(0,0x2009); break;
case specialsymThickSpace: str.Insert(0,0x2005); break;
case specialsymLargeSpace: str.Insert(0,0x2003); break;
case specialsymOnePtSpace: str.Insert(0,0x200A); break;
case specialsymZeroSpace: str = 0x200B; break;
case specialsymThinSpace: str = 0x2009; break;
case specialsymThickSpace: str = 0x2005; break;
case specialsymLargeSpace: str = 0x2003; break;
case specialsymOnePtSpace: str = 0x200A; break;
}
}
else
@ -502,7 +499,7 @@ namespace MathEquation
uChar = 0x03D5;
else if (uChar == 0x03D5)
uChar = 0x03C6;
str.Insert(0, uChar);
str = uChar;
}
oRun.AddChar(str, pFont, nTextSize);
@ -663,22 +660,22 @@ namespace MathEquation
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::BegChr, _T(""));
else
{
CString strOpen;
std::wstring strOpen;
switch(eType)
{
case bracketsAngle: strOpen.Insert(0, 0x27E8); break;
case bracketsRound: strOpen.Insert(0, 0x0028); break;
case bracketsCurve: strOpen.Insert(0, 0x007B); break;
case bracketsSquare: strOpen.Insert(0, 0x005B); break;
case bracketsLine: strOpen.Insert(0, 0x007C); break;
case bracketsDLine: strOpen.Insert(0, 0x2016); break;
case bracketsFloor: strOpen.Insert(0, 0x230A); break;
case bracketsCeil: strOpen.Insert(0, 0x2308); break;
case bracketsSquareOpenOpen: strOpen.Insert(0, 0x005B); break;
case bracketsSquareCloseClose: strOpen.Insert(0, 0x005D); break;
case bracketsSquareCloseOpen: strOpen.Insert(0, 0x005D); break;
case bracketsSquareRound: strOpen.Insert(0, 0x005B); break;
case bracketsRoundSquare: strOpen.Insert(0, 0x0028); break;
case bracketsAngle: strOpen = 0x27E8; break;
case bracketsRound: strOpen = 0x0028; break;
case bracketsCurve: strOpen = 0x007B; break;
case bracketsSquare: strOpen = 0x005B; break;
case bracketsLine: strOpen = 0x007C; break;
case bracketsDLine: strOpen = 0x2016; break;
case bracketsFloor: strOpen = 0x230A; break;
case bracketsCeil: strOpen = 0x2308; break;
case bracketsSquareOpenOpen: strOpen = 0x005B; break;
case bracketsSquareCloseClose: strOpen = 0x005D; break;
case bracketsSquareCloseOpen: strOpen = 0x005D; break;
case bracketsSquareRound: strOpen = 0x005B; break;
case bracketsRoundSquare: strOpen = 0x0028; break;
}
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::BegChr, strOpen);
}
@ -687,22 +684,22 @@ namespace MathEquation
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::EndChr, _T(""));
else
{
CString strEnd;
std::wstring strEnd;
switch(eType)
{
case bracketsAngle: strEnd.Insert(0, 0x27E9); break;
case bracketsRound: strEnd.Insert(0, 0x0029); break;
case bracketsCurve: strEnd.Insert(0, 0x007D); break;
case bracketsSquare: strEnd.Insert(0, 0x005D); break;
case bracketsLine: strEnd.Insert(0, 0x007C); break;
case bracketsDLine: strEnd.Insert(0, 0x2016); break;
case bracketsFloor: strEnd.Insert(0, 0x230B); break;
case bracketsCeil: strEnd.Insert(0, 0x2309); break;
case bracketsSquareOpenOpen: strEnd.Insert(0, 0x005B); break;
case bracketsSquareCloseClose: strEnd.Insert(0, 0x005D); break;
case bracketsSquareCloseOpen: strEnd.Insert(0, 0x005B); break;
case bracketsSquareRound: strEnd.Insert(0, 0x0029); break;
case bracketsRoundSquare: strEnd.Insert(0, 0x005D); break;
case bracketsAngle: strEnd = 0x27E9; break;
case bracketsRound: strEnd = 0x0029; break;
case bracketsCurve: strEnd = 0x007D; break;
case bracketsSquare: strEnd = 0x005D; break;
case bracketsLine: strEnd = 0x007C; break;
case bracketsDLine: strEnd = 0x2016; break;
case bracketsFloor: strEnd = 0x230B; break;
case bracketsCeil: strEnd = 0x2309; break;
case bracketsSquareOpenOpen: strEnd = 0x005B; break;
case bracketsSquareCloseClose: strEnd = 0x005D; break;
case bracketsSquareCloseOpen: strEnd = 0x005B; break;
case bracketsSquareRound: strEnd = 0x0029; break;
case bracketsRoundSquare: strEnd = 0x005D; break;
}
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::EndChr, strEnd);
}
@ -889,14 +886,14 @@ namespace MathEquation
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::Pos, pos);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::VertJc, vertJc);
CString str;
std::wstring str;
switch(eType)
{
case bartypeLine: str.Insert(0,0x0305);break;
case bartypeDoubleLine: str.Insert(0,0x033F);break;
case bartypeArrowLeft: str.Insert(0,0x20D6);break;
case bartypeArrowRight: str.Insert(0,0x20D7);break;
case bartypeArrowDouble: str.Insert(0,0x20E1);break;
case bartypeLine: str = 0x0305;break;
case bartypeDoubleLine: str = 0x033F;break;
case bartypeArrowLeft: str = 0x20D6;break;
case bartypeArrowRight: str = 0x20D7;break;
case bartypeArrowDouble: str = 0x20E1;break;
}
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
@ -941,12 +938,12 @@ namespace MathEquation
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::Pos, pos);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::VertJc, vertJc);
CString str;
std::wstring str;
switch(eType)
{
case arrowtypeLeft: str.Insert(0,0x2190);break;
case arrowtypeRight: str.Insert(0,0x2192);break;
case arrowtypeDouble: str.Insert(0,0x2194);break;
case arrowtypeLeft: str = 0x2190;break;
case arrowtypeRight: str = 0x2192;break;
case arrowtypeDouble: str = 0x2194;break;
}
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
@ -975,12 +972,12 @@ namespace MathEquation
int lCount = 0;
int nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::NaryPr);
CString str;
std::wstring str;
switch(eType)
{
//todooo проверить запись .. (BYTE)SimpleTypes::ххх
case integraltypeSingle:
str.Insert(0,0x222B);
str = 0x222B;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
@ -988,20 +985,20 @@ namespace MathEquation
lCount = 1;
break;
case integraltypeSingleRSub:
str.Insert(0,0x222B);
str = 0x222B;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
lCount = 1;
break;
case integraltypeSingleRSubSup:
str.Insert(0,0x222B);
str = 0x222B;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
lCount = 1;
break;
case integraltypeSingleOriented:
str.Insert(0,0x222E);
str = 0x222E;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
@ -1009,7 +1006,7 @@ namespace MathEquation
lCount = 1;
break;
case integraltypeSingleOrientedRSub:
str.Insert(0,0x222E);
str = 0x222E;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
@ -1017,7 +1014,7 @@ namespace MathEquation
break;
case integraltypeDouble:
str.Insert(0,0x222C);
str = 0x222C;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
@ -1025,14 +1022,14 @@ namespace MathEquation
lCount = 2;
break;
case integraltypeDoubleRSub:
str.Insert(0,0x222C);
str = 0x222C;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
lCount = 2;
break;
case integraltypeDoubleOriented:
str.Insert(0,0x222F);
str = 0x222F;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
@ -1040,7 +1037,7 @@ namespace MathEquation
lCount = 2;
break;
case integraltypeDoubleOrientedRSub:
str.Insert(0,0x222F);
str = 0x222F;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
@ -1048,7 +1045,7 @@ namespace MathEquation
break;
case integraltypeTriple:
str.Insert(0,0x222D);
str = 0x222D;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
@ -1056,14 +1053,14 @@ namespace MathEquation
lCount = 3;
break;
case integraltypeTripleRSub:
str.Insert(0,0x222D);
str = 0x222D;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
lCount = 3;
break;
case integraltypeTripleOriented:
str.Insert(0,0x2230);
str = 0x2230;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
@ -1071,7 +1068,7 @@ namespace MathEquation
lCount = 3;
break;
case integraltypeTripleOrientedRSub:
str.Insert(0,0x2230);
str = 0x2230;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
@ -1079,20 +1076,20 @@ namespace MathEquation
break;
case integraltypeSingleCSubSup:
str.Insert(0,0x222B);
str = 0x222B;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
lCount = 1;
break;
case integraltypeSingleCSub:
str.Insert(0,0x222B);
str = 0x222B;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
lCount = 1;
break;
case integraltypeSingleOrientedCSub:
str.Insert(0,0x222E);
str = 0x222E;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
@ -1100,14 +1097,14 @@ namespace MathEquation
break;
case integraltypeDoubleOrientedCSub:
str.Insert(0,0x222F);
str = 0x222F;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
lCount = 2;
break;
case integraltypeDoubleCSub:
str.Insert(0,0x222C);
str = 0x222C;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
@ -1115,14 +1112,14 @@ namespace MathEquation
break;
case integraltypeTripleOrientedCSub:
str.Insert(0,0x2230);
str = 0x2230;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
lCount = 3;
break;
case integraltypeTripleCSub:
str.Insert(0,0x222D);
str = 0x222D;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
@ -1159,10 +1156,10 @@ namespace MathEquation
WriteRun();
BYTE pos, vertJc;
CString chr;
std::wstring chr;
if (bTop)
{
chr.Insert(0,0x23DE);
chr = 0x23DE;
vertJc = SimpleTypes::verticaljcTop;
pos = SimpleTypes::tbTop;
int nCurPos = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::LimUpp);
@ -1174,7 +1171,7 @@ namespace MathEquation
}
else
{
chr.Insert(0,0x23DF);
chr = 0x23DF;
vertJc = SimpleTypes::verticaljcBottom;
pos = SimpleTypes::tbBot;
int nCurPos = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::LimLow);
@ -1223,155 +1220,155 @@ namespace MathEquation
m_aNArrayStack.push(nCurPos);
int nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::NaryPr);
CString str;
std::wstring str;
switch(eType)
{
case narySumCSub:
str.Insert(0,0x2211);
str = 0x2211;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
break;
case narySumCSubSup:
str.Insert(0,0x2211);
str = 0x2211;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
break;
case narySum:
str.Insert(0,0x2211);
str = 0x2211;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SubHide, true);
break;
case narySumRSub:
str.Insert(0,0x2211);
str = 0x2211;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
break;
case narySumRSubSup:
str.Insert(0,0x2211);
str = 0x2211;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
break;
case naryProdCSub:
str.Insert(0,0x220F);
str = 0x220F;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
break;
case naryProdCSubSup:
str.Insert(0,0x220F);
str = 0x220F;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
break;
case naryProd:
str.Insert(0,0x220F);
str = 0x220F;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SubHide, true);
break;
case naryProdRSub:
str.Insert(0,0x220F);
str = 0x220F;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
break;
case naryProdRSubSup:
str.Insert(0,0x220F);
str = 0x220F;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
break;
case naryCoProdCSub:
str.Insert(0,0x2210);
str = 0x2210;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
break;
case naryCoProdCSubSup:
str.Insert(0,0x2210);
str = 0x2210;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
break;
case naryCoProd:
str.Insert(0,0x2210);
str = 0x2210;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SubHide, true);
break;
case naryCoProdRSub:
str.Insert(0,0x2210);
str = 0x2210;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
break;
case naryCoProdRSubSup:
str.Insert(0,0x2210);
str = 0x2210;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
break;
case naryUnionCSub:
str.Insert(0,0x22C3);
str = 0x22C3;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
break;
case naryUnionCSubSup:
str.Insert(0,0x22C3);
str = 0x22C3;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
break;
case naryUnion:
str.Insert(0,0x22C3);
str = 0x22C3;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SubHide, true);
break;
case naryUnionRSub:
str.Insert(0,0x22C3);
str = 0x22C3;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
break;
case naryUnionRSubSup:
str.Insert(0,0x22C3);
str = 0x22C3;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
break;
case naryIntersectCSub:
str.Insert(0,0x22C2);
str = 0x22C2;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
break;
case naryIntersectCSubSup:
str.Insert(0,0x22C2);
str = 0x22C2;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
break;
case naryIntersect:
str.Insert(0,0x22C2);
str = 0x22C2;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocUndOvr);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SubHide, true);
break;
case naryIntersectRSub:
str.Insert(0,0x22C2);
str = 0x22C2;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::SupHide, true);
break;
case naryIntersectRSubSup:
str.Insert(0,0x22C2);
str = 0x22C2;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::Chr, str);
WriteItemVal(BinDocxRW::c_oSer_OMathBottomNodesType::LimLoc, (BYTE)SimpleTypes::limLocSubSup);
break;
@ -1452,24 +1449,24 @@ namespace MathEquation
m_aDelimiterStack.push(nCurPos);
int nCurPos1 = WriteItemStart(BinDocxRW::c_oSer_OMathContentType::DelimiterPr);
CString beg, sep, end;
std::wstring beg, sep, end;
switch (eType)
{
case angbrwithsepBoth: // < | >
beg.Insert(0,0x27E8); sep.Insert(0, 0x007C); end.Insert(0, 0x27E9);
beg = 0x27E8; sep = 0x007C; end = 0x27E9;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::BegChr, beg);
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::SepChr, sep);
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::EndChr, end);
WriteItemValLong(BinDocxRW::c_oSer_OMathBottomNodesType::Column, 2);
break;
case angbrwithsepLeft: // < |
beg.Insert(0,0x27E8); end.Insert(0, 0x007C);
beg = 0x27E8; end = 0x007C;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::BegChr, beg);
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::EndChr, end);
WriteItemValLong(BinDocxRW::c_oSer_OMathBottomNodesType::Column, 1);
break;
case angbrwithsepRight: // | >
beg.Insert(0,0x007C); end.Insert(0, 0x27E9);
beg = 0x007C; end = 0x27E9;
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::BegChr, beg);
WriteItemValStr(BinDocxRW::c_oSer_OMathBottomNodesType::EndChr, end);
WriteItemValLong(BinDocxRW::c_oSer_OMathBottomNodesType::Column, 1);
@ -1528,7 +1525,7 @@ namespace MathEquation
WriteItemEnd(nCurPos);
}
void WriteItemValStr(BYTE name, CString val)
void WriteItemValStr(BYTE name, std::wstring val)
{
int nCurPos = WriteItemStart(name);
@ -2415,7 +2412,7 @@ namespace MathEquation
private:
CString rRet;
std::wstring rRet;
bool bEmbel;
std::stack<CBaseCommand*> m_aCommandStack;

View File

@ -54,7 +54,7 @@ namespace BinDocxRW
OOX::CTheme* m_poTheme;
OOX::IFileContainer* m_pCurRels;
CString m_sCurDocumentPath;
std::wstring m_sCurDocumentPath;
std::map<int, bool> m_mapIgnoreComments;
public: ParamsWriter(NSBinPptxRW::CBinaryFileWriter* pCBufferedStream, DocWrapper::FontProcessor* pFontProcessor, NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager):
m_pCBufferedStream(pCBufferedStream),m_pFontProcessor(pFontProcessor),m_pOfficeDrawingConverter(pOfficeDrawingConverter),m_pEmbeddedFontsManager(pEmbeddedFontsManager)
@ -67,9 +67,9 @@ namespace BinDocxRW
class ParamsDocumentWriter {
public:
OOX::IFileContainer* m_pRels;
CString m_sDocumentPath;
std::wstring m_sDocumentPath;
public:
ParamsDocumentWriter(OOX::IFileContainer* pRels, const CString& sDocumentPath):m_pRels(pRels), m_sDocumentPath(sDocumentPath)
ParamsDocumentWriter(OOX::IFileContainer* pRels, const std::wstring& sDocumentPath):m_pRels(pRels), m_sDocumentPath(sDocumentPath)
{
}
};
@ -77,8 +77,8 @@ namespace BinDocxRW
protected:
int m_nType;
public:
CString m_sFld;
public: FldStruct(CString sFld, int nType):m_sFld(sFld),m_nType(nType){}
std::wstring m_sFld;
public: FldStruct(std::wstring sFld, int nType):m_sFld(sFld),m_nType(nType){}
public: int GetType()
{
return m_nType;
@ -381,9 +381,9 @@ namespace BinDocxRW
m_oStream.WriteDouble(bottom.get().ToMm());
}
}
void WriteFont(CString& sFontName, BYTE bType, DocWrapper::FontProcessor& m_oFontProcessor)
void WriteFont(std::wstring& sFontName, BYTE bType, DocWrapper::FontProcessor& m_oFontProcessor)
{
if(!sFontName.IsEmpty())
if(!sFontName.empty())
{
//Подбор шрифтов
sFontName = m_oFontProcessor.getFont(sFontName);
@ -407,7 +407,7 @@ namespace BinDocxRW
if(elem.m_sAuthor.IsInit())
{
nCurPos = WriteItemStart(c_oSerProp_RevisionType::Author);
m_oStream.WriteStringW3(elem.m_sAuthor.get());
m_oStream.WriteStringW3(elem.m_sAuthor->c_str());
WriteItemWithLengthEnd(nCurPos);
}
if(elem.m_oDate.IsInit())
@ -425,7 +425,7 @@ namespace BinDocxRW
if(elem.m_sUserId.IsInit())
{
nCurPos = WriteItemStart(c_oSerProp_RevisionType::UserId);
m_oStream.WriteStringW3(elem.m_sUserId.get());
m_oStream.WriteStringW3(elem.m_sUserId->c_str());
WriteItemWithLengthEnd(nCurPos);
}
}
@ -520,10 +520,10 @@ namespace BinDocxRW
//FontFamily
if(false != rPr.m_oRFonts.IsInit())
{
CString sFontAscii;
CString sFontHAnsi;
CString sFontAE;
CString sFontCS;
std::wstring sFontAscii;
std::wstring sFontHAnsi;
std::wstring sFontAE;
std::wstring sFontCS;
const ComplexTypes::Word::CFonts& oFont = rPr.m_oRFonts.get();
if(NULL != m_poTheme && oFont.m_oAsciiTheme.IsInit())
{
@ -776,10 +776,11 @@ namespace BinDocxRW
}
if (false != rPr.m_sTextOutline.IsInit())
{
CString sTextOutline = rPr.m_sTextOutline.get2();
std::wstring sTextOutline = rPr.m_sTextOutline.get2();
//делаем replace потому что читать имена node без namespace можем а атрибуты нет, потому что храним их в map
sTextOutline.Replace(_T("w14:"), _T(""));
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::TextOutline);
boost::algorithm::replace_all(sTextOutline, L"w14:", L"");
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::TextOutline);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
int nCurPos = m_oBcw.WriteItemWithLengthStart();
m_pOfficeDrawingConverter->GetRecordBinary(XMLWRITER_RECORD_TYPE_TEXT_OUTLINE, sTextOutline);
@ -787,10 +788,11 @@ namespace BinDocxRW
}
if (false != rPr.m_sTextFill.IsInit())
{
CString sTextFill = rPr.m_sTextFill.get2();
std::wstring sTextFill = rPr.m_sTextFill.get2();
//делаем replace потому что читать имена node без namespace можем а атрибуты нет, потому что храним их в map
sTextFill.Replace(_T("w14:"), _T(""));
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::TextFill);
boost::algorithm::replace_all(sTextFill, L"w14:", L"");
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::TextFill);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
int nCurPos = m_oBcw.WriteItemWithLengthStart();
m_pOfficeDrawingConverter->GetRecordBinary(XMLWRITER_RECORD_TYPE_TEXT_FILL, sTextFill);
@ -849,7 +851,7 @@ namespace BinDocxRW
int nCurPos = 0;
//Стили надо писать первыми, потому что применение стиля при открытии уничтажаются настройки параграфа
//ParaStyle
CString sStyleId;
std::wstring sStyleId;
if(false != pPr.m_oPStyle.IsInit())
{
sStyleId = pPr.m_oPStyle.get().ToString2();
@ -1716,8 +1718,8 @@ namespace BinDocxRW
}
if(oNumFmt.m_sFormat.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerNumTypes::NumFmtFormat);
m_oBcw.m_oStream.WriteStringW3(oNumFmt.m_sFormat.get());
nCurPos = m_oBcw.WriteItemStart (c_oSerNumTypes::NumFmtFormat);
m_oBcw.m_oStream.WriteStringW3 (*oNumFmt.m_sFormat);
m_oBcw.WriteItemEnd(nCurPos);
}
}
@ -2364,7 +2366,7 @@ namespace BinDocxRW
OOX::Logic::CRunProperty oWordDefTextPr;
oWordDefTextPr.m_oRFonts.Init();
oWordDefTextPr.m_oRFonts->m_sAscii.Init();
CString sAscii = brPrs.m_oFontProcessor.getFont(CString(_T("Times New Roman")));
std::wstring sAscii = brPrs.m_oFontProcessor.getFont(std::wstring(_T("Times New Roman")));
oWordDefTextPr.m_oRFonts->m_sAscii = sAscii;
if(NULL != m_oBcw.m_pEmbeddedFontsManager)
m_oBcw.m_pEmbeddedFontsManager->CheckFont(sAscii, brPrs.m_oFontProcessor.getFontManager());
@ -2407,11 +2409,11 @@ namespace BinDocxRW
m_oBcw.m_oStream.WriteStringW(style.m_sStyleId.get2());
}
//Name
CString sName;
std::wstring sName;
if(false != style.m_oName.IsInit())
sName = style.m_oName->ToString2();
else
sName.Format(_T("StGen%d"), m_nReaderGenName++);
sName = L"StGen" + std::to_wstring( m_nReaderGenName++ );
m_oBcw.m_oStream.WriteBYTE(c_oSer_sts::Style_Name);
m_oBcw.m_oStream.WriteStringW(sName);
//Type
@ -2840,10 +2842,10 @@ namespace BinDocxRW
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
}
void WriteLevelText(const CString& text)
void WriteLevelText(const std::wstring& text)
{
int nCurPos = 0;
for(int i = 0, length = text.GetLength(); i < length; ++i)
for(int i = 0, length = text.length(); i < length; ++i)
{
if('%' == text[i] && i + 1 < length && '0' <= text[i + 1] && text[i + 1] <= '9')
{
@ -2865,8 +2867,7 @@ namespace BinDocxRW
nCurPos = m_oBcw.WriteItemStart(c_oSerNumTypes::lvl_LvlTextItem);
m_oBcw.m_oStream.WriteBYTE(c_oSerNumTypes::lvl_LvlTextItemText);
CString strChar;
strChar.AppendChar(text[i]);
std::wstring strChar (text.c_str() + i, 1);
m_oBcw.m_oStream.WriteStringW(strChar);
if(NULL != m_oBcw.m_pEmbeddedFontsManager)
m_oBcw.m_pEmbeddedFontsManager->CheckString(strChar);
@ -2888,7 +2889,7 @@ namespace BinDocxRW
{
m_oStream.WriteBYTE(btVal);
}
public: void WriteString(CString& sVal)
public: void WriteString(std::wstring& sVal)
{
m_oStream.WriteStringW2(sVal);
}
@ -2939,13 +2940,13 @@ namespace BinDocxRW
BinaryCommonWriter m_oBcw;
Binary_pPrWriter bpPrs;
Binary_rPrWriter brPrs;
CString m_sCurParStyle;
std::wstring m_sCurParStyle;
OOX::CSettings* m_oSettings;
//для fldChar
//todo в документации описан случай если нет fldchartypeEnd, у нас работает не так.
std::vector<FldStruct*> m_aFldChars;
CString m_sFldChar;
std::wstring m_sFldChar;
SimpleTypes::EFldCharType m_eFldState;
NSBinPptxRW::CDrawingConverter* m_pOfficeDrawingConverter;
std::map<int, bool>* m_mapIgnoreComments;
@ -2971,12 +2972,12 @@ namespace BinDocxRW
RELEASEOBJECT(m_aFldChars[i]);
}
}
void prepareOfficeDrawingConverter(NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, CString& sDocumentPath, std::vector<CString>& aShapeTypes)
void prepareOfficeDrawingConverter(NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, std::wstring& sDocumentPath, std::vector<std::wstring>& aShapeTypes)
{
pOfficeDrawingConverter->SetRelsPath(sDocumentPath);
for(int i = 0, length = aShapeTypes.size(); i < length; ++i)
{
CString& sShapeType = aShapeTypes[i];
std::wstring& sShapeType = aShapeTypes[i];
pOfficeDrawingConverter->AddShapeType(sShapeType);
}
}
@ -3057,7 +3058,7 @@ namespace BinDocxRW
{
if (pBackground == NULL) return;
CString sXml;
std::wstring sXml;
if (pBackground->m_oDrawing.IsInit())
{
sXml = pBackground->m_oDrawing->m_sXml.get2();
@ -3077,7 +3078,7 @@ namespace BinDocxRW
m_oBcw.WriteThemeColor(c_oSerBackgroundType::ColorTheme, pBackground->m_oColor, pBackground->m_oThemeColor, pBackground->m_oThemeTint, pBackground->m_oThemeShade);
}
if (!sXml.IsEmpty())
if (!sXml.empty())
{
m_oBcw.m_oStream.WriteBYTE(c_oSerBackgroundType::pptxDrawing);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
@ -3105,16 +3106,18 @@ namespace BinDocxRW
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
FldStruct* ParseField(const CString& sFld)
FldStruct* ParseField(const std::wstring& sFld)
{
CString sFldCopy = sFld;
sFldCopy.Trim();
sFldCopy.MakeUpper();
FldStruct* pRes = NULL;
std::wstring sFldCopy = sFld;
boost::algorithm::trim (sFldCopy);
boost::algorithm::to_upper (sFldCopy);
FldStruct* pRes = NULL;
int nIndex = 0;
if(-1 != (nIndex = sFldCopy.Find(_T("TOC"))))
if(-1 != (nIndex = sFldCopy.find(_T("TOC"))))
pRes = new FldStruct(sFldCopy, fieldstruct_toc);
else if(-1 != (nIndex = sFldCopy.Find(_T("HYPERLINK"))))
else if(-1 != (nIndex = sFldCopy.find(_T("HYPERLINK"))))
pRes = new FldStruct(sFldCopy, fieldstruct_hyperlink);
else
pRes = new FldStruct(sFldCopy, fieldstruct_none);
@ -3261,7 +3264,7 @@ namespace BinDocxRW
void WriteFldSimple(OOX::Logic::CFldSimple* pFldSimple)
{
int nCurPos = 0;
if(pFldSimple->m_sInstr.IsInit() && !pFldSimple->m_sInstr->IsEmpty())
if(pFldSimple->m_sInstr.IsInit() && !pFldSimple->m_sInstr->empty())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::FldSimple);
WriteFldSimpleContent(pFldSimple);
@ -3276,7 +3279,7 @@ namespace BinDocxRW
//порядок записи важен
//Instr
nCurPos = m_oBcw.WriteItemStart(c_oSer_FldSimpleType::Instr);
m_oBcw.m_oStream.WriteStringW3(pFldSimple->m_sInstr.get());
m_oBcw.m_oStream.WriteStringW3(*pFldSimple->m_sInstr);
m_oBcw.WriteItemWithLengthEnd(nCurPos);
//Content
nCurPos = m_oBcw.WriteItemStart(c_oSer_FldSimpleType::Content);
@ -3287,8 +3290,8 @@ namespace BinDocxRW
void WriteHyperlink(OOX::Logic::CHyperlink* pHyperlink)
{
int nCurPos = 0;
CString sField;
CString sLink;
std::wstring sField;
std::wstring sLink;
if(pHyperlink->m_oId.IsInit())
{
OOX::Rels::CRelationShip* oRels = NULL;
@ -3300,7 +3303,7 @@ namespace BinDocxRW
}
}
if(!sLink.IsEmpty())
if(!sLink.empty())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::Hyperlink);
WriteHyperlinkContent(sLink, pHyperlink);
@ -3311,7 +3314,7 @@ namespace BinDocxRW
WriteParagraphContent(pHyperlink->m_arrItems, true);
}
}
void WriteHyperlinkContent(CString& sLink, OOX::Logic::CHyperlink* pHyperlink)
void WriteHyperlinkContent(std::wstring& sLink, OOX::Logic::CHyperlink* pHyperlink)
{
int nCurPos = 0;
//Link
@ -3945,7 +3948,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
CString str = pChr.m_val->GetValue();
std::wstring str = pChr.m_val->GetValue();
m_oBcw.m_oStream.WriteStringW(pChr.m_val->GetValue());
}
m_oBcw.WriteItemEnd(nCurPos);
@ -4929,11 +4932,11 @@ namespace BinDocxRW
void WriteMathText(const OOX::Logic::CMText &pMText)
{
int nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::MText);
if(!pMText.m_sText.IsEmpty())
if(!pMText.m_sText.empty())
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
m_oBcw.m_oStream.WriteStringW(pMText.m_sText);
m_oBcw.m_oStream.WriteStringW(pMText.m_sText.c_str());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -5059,19 +5062,19 @@ namespace BinDocxRW
OOX::Logic::CSym* oSym = static_cast<OOX::Logic::CSym*>(pRun->m_arrItems[nIndexStart]);
if(oSym->m_oFont.IsInit())
{
const CString& sFont = oSym->m_oFont.get();
const std::wstring& sFont = oSym->m_oFont.get();
if(NULL == oCur_rPr)
oCur_rPr = new OOX::Logic::CRunProperty();
oCur_rPr->m_oRFonts.Init();
oCur_rPr->m_oRFonts->m_sAscii.Init();
oCur_rPr->m_oRFonts->m_sAscii->Append(sFont);
oCur_rPr->m_oRFonts->m_sAscii->append(sFont);
oCur_rPr->m_oRFonts->m_sCs.Init();
oCur_rPr->m_oRFonts->m_sCs->Append(sFont);
oCur_rPr->m_oRFonts->m_sCs->append(sFont);
oCur_rPr->m_oRFonts->m_sEastAsia.Init();
oCur_rPr->m_oRFonts->m_sEastAsia->Append(sFont);
oCur_rPr->m_oRFonts->m_sEastAsia->append(sFont);
oCur_rPr->m_oRFonts->m_sHAnsi.Init();
oCur_rPr->m_oRFonts->m_sHAnsi->Append(sFont);
oCur_rPr->m_oRFonts->m_sHAnsi->append(sFont);
}
}
//пишем rPr
@ -5132,7 +5135,7 @@ namespace BinDocxRW
if(SimpleTypes::fldchartypeBegin == pFldChar->m_oFldCharType.get().GetValue())
{
m_eFldState = SimpleTypes::fldchartypeBegin;
m_sFldChar.Empty();
m_sFldChar.clear();
}
else if(SimpleTypes::fldchartypeEnd == pFldChar->m_oFldCharType.get().GetValue())
{
@ -5167,7 +5170,7 @@ namespace BinDocxRW
m_sFldChar += pInstrText->m_sText;
else
{
if(!pInstrText->m_sText.IsEmpty())
if(!pInstrText->m_sText.empty())
{
WriteText(pInstrText->m_sText);
}
@ -5201,15 +5204,15 @@ namespace BinDocxRW
case OOX::et_w_sym:
{
OOX::Logic::CSym* oSym = static_cast<OOX::Logic::CSym*>(item);
CString sText;
sText.AppendChar(0x0FFF & oSym->m_oChar->GetValue());
wchar_t ch = 0x0FFF & oSym->m_oChar->GetValue();
std::wstring sText(&ch, 1);
WriteText(sText);
break;
}
case OOX::et_w_delText:
{
CString& sText = static_cast<OOX::Logic::CDelText*>(item)->m_sText;
if(!sText.IsEmpty())
std::wstring& sText = static_cast<OOX::Logic::CDelText*>(item)->m_sText;
if(!sText.empty())
{
WriteDelText(sText);
}
@ -5217,8 +5220,8 @@ namespace BinDocxRW
break;
case OOX::et_w_t:
{
CString& sText = static_cast<OOX::Logic::CText*>(item)->m_sText;
if(!sText.IsEmpty())
std::wstring& sText = static_cast<OOX::Logic::CText*>(item)->m_sText;
if(!sText.empty())
{
WriteText(sText);
}
@ -5252,12 +5255,12 @@ namespace BinDocxRW
{
OOX::Logic::CObject* pObject = static_cast<OOX::Logic::CObject*>(item);
CString* pXml = pObject ? pObject->m_sXml.GetPointer() : NULL;
std::wstring* pXml = pObject ? pObject->m_sXml.GetPointer() : NULL;
int nPosObject = m_oBcw.WriteItemStart(c_oSerRunType::object);
if(pObject && pObject->m_oOleObject.IsInit() && pObject->m_oOleObject->m_sProgId.IsInit() && pObject->m_oOleObject->m_oId.IsInit())
{
CString sProgID = pObject->m_oOleObject->m_sProgId.get().GetString();
std::wstring sProgID = pObject->m_oOleObject->m_sProgId.get();
if ( _T("Word.Document") == sProgID)
{
int nPosEmbedded = m_oBcw.WriteItemStart(c_oSerImageType2::Embedded);
@ -5265,7 +5268,7 @@ namespace BinDocxRW
OOX::Rels::CRelationShip* oRels = NULL;
smart_ptr<OOX::File> pFile = m_oParamsDocumentWriter.m_pRels->Find( OOX::RId(pObject->m_oOleObject->m_oId.get().GetValue()));
CString sLink;
std::wstring sLink;
if (pFile.IsInit() && OOX::FileTypes::OleObject == pFile->type())
{
OOX::HyperLink* pHyperlinkFile = static_cast<OOX::HyperLink*>(pFile.operator ->());
@ -5282,7 +5285,7 @@ namespace BinDocxRW
OOX::Rels::CRelationShip* oRels = NULL;
smart_ptr<OOX::File> pFile = m_oParamsDocumentWriter.m_pRels->Find( OOX::RId(pObject->m_oOleObject->m_oId.get().GetValue()));
CString sLink;
std::wstring sLink;
if (pFile.IsInit() && OOX::FileTypes::OleObject == pFile->type())
{
OOX::HyperLink* pHyperlinkFile = static_cast<OOX::HyperLink*>(pFile.operator ->());
@ -5290,7 +5293,7 @@ namespace BinDocxRW
}
MathEquation::BinaryEquationWriter oBinEqWriter(m_oBcw.m_oStream);
MathEquation::CEquationReader oReader(sLink);
MathEquation::CEquationReader oReader(sLink.c_str());
oReader.SetOutputDev(&oBinEqWriter);
oReader.Parse();
}
@ -5350,24 +5353,24 @@ namespace BinDocxRW
m_oBcw.WriteItemEnd(nCurPos);
}
}
void WriteDelText(const CString& text)
void WriteDelText(const std::wstring& text)
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::delText);
m_oBcw.m_oStream.WriteStringW(text);
m_oBcw.m_oStream.WriteStringW(text.c_str());
if(NULL != m_oBcw.m_pEmbeddedFontsManager)
m_oBcw.m_pEmbeddedFontsManager->CheckString(text);
}
void WriteText(const CString& text)
void WriteText(const std::wstring& text)
{
m_oBcw.m_oStream.WriteBYTE(c_oSerRunType::run);
m_oBcw.m_oStream.WriteStringW(text);
m_oBcw.m_oStream.WriteStringW(text);
if(NULL != m_oBcw.m_pEmbeddedFontsManager)
m_oBcw.m_pEmbeddedFontsManager->CheckString(text);
}
void WriteDrawingPptx(OOX::WritingElement* item)
{
OOX::EElementType pElementType = item->getType();
CString* pXml = NULL;
std::wstring* pXml = NULL;
OOX::Logic::CDrawing* pChartDrawing = NULL;
OOX::Drawing::CGraphic* pGraphic = NULL;
@ -5437,8 +5440,8 @@ namespace BinDocxRW
if (pFile.IsInit() && OOX::FileTypes::Chart == pFile->type())
{
OOX::Spreadsheet::CChartSpace* pChartFile = static_cast<OOX::Spreadsheet::CChartSpace*>(pFile.operator ->());
CString sOldRelsPath = m_pOfficeDrawingConverter->GetRelsPath();
CString sChartPath = pChartFile->GetReadPath().GetPath();
std::wstring sOldRelsPath = m_pOfficeDrawingConverter->GetRelsPath();
std::wstring sChartPath = pChartFile->GetReadPath().GetPath();
m_pOfficeDrawingConverter->SetRelsPath(sChartPath);
int nCurPos = m_oBcw.WriteItemStart(c_oSerRunType::pptxDrawing);
@ -5457,14 +5460,14 @@ namespace BinDocxRW
}
}
}
void WriteDrawing(CString* pXml, OOX::Logic::CDrawing* pDrawing, OOX::Spreadsheet::CChartSpace* pChart)
void WriteDrawing(std::wstring* pXml, OOX::Logic::CDrawing* pDrawing, OOX::Spreadsheet::CChartSpace* pChart)
{
int nCurPos = 0;
bool bDeleteDrawing = false;
//pptxdata
if(NULL != pXml)
{
CString* bstrOutputXml = NULL;
std::wstring* bstrOutputXml = NULL;
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::PptxData);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
@ -5474,10 +5477,10 @@ namespace BinDocxRW
if(S_OK == hRes && NULL != bstrOutputXml)
{
CString sBegin(_T("<root xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\"><w:drawing>"));
std::wstring sBegin(_T("<root xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\"><w:drawing>"));
CString sEnd(_T("</w:drawing></root>"));
CString sDrawingXml = sBegin + *bstrOutputXml + sEnd;
std::wstring sEnd(_T("</w:drawing></root>"));
std::wstring sDrawingXml = sBegin + *bstrOutputXml + sEnd;
XmlUtils::CXmlLiteReader oReader;
@ -5789,7 +5792,7 @@ namespace BinDocxRW
if(oDocPr.m_sName.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerDocPr::Name);
m_oBcw.m_oStream.WriteStringW3(oDocPr.m_sName.get());
m_oBcw.m_oStream.WriteStringW3(oDocPr.m_sName.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if(oDocPr.m_oHidden.IsInit())
@ -5801,13 +5804,13 @@ namespace BinDocxRW
if(oDocPr.m_sTitle.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerDocPr::Title);
m_oBcw.m_oStream.WriteStringW3(oDocPr.m_sTitle.get());
m_oBcw.m_oStream.WriteStringW3(oDocPr.m_sTitle.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
if(oDocPr.m_sDescr.IsInit())
{
nCurPos = m_oBcw.WriteItemStart(c_oSerDocPr::Descr);
m_oBcw.m_oStream.WriteStringW3(oDocPr.m_sDescr.get());
m_oBcw.m_oStream.WriteStringW3(oDocPr.m_sDescr.get());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
}
@ -6459,7 +6462,7 @@ namespace BinDocxRW
public:
OOX::CComment* pComment;
nullable<bool> bDone;
nullable<CString> sUserId;
nullable<std::wstring> sUserId;
std::vector<CCommentWriteTemp*> aReplies;
};
BinaryCommonWriter m_oBcw;
@ -6475,7 +6478,7 @@ namespace BinDocxRW
}
void WriteCommentsContent(OOX::CComments& oComments, OOX::CCommentsExt* pCommentsExt, OOX::CPeople* pPeople, std::map<int, bool>& mapIgnoreComments)
{
std::map<CString, CString> mapAuthorToUserId;
std::map<std::wstring, std::wstring> mapAuthorToUserId;
std::map<int, CCommentWriteTemp*> mapParaIdToComment;
std::map<int, bool> mapCommentsIgnore;
std::vector<CCommentWriteTemp*> aCommentsToWrite;
@ -6497,7 +6500,7 @@ namespace BinDocxRW
pNewCommentWriteTemp->pComment = pComment;
if(pComment->m_oAuthor.IsInit())
{
std::map<CString, CString>::const_iterator pPair = mapAuthorToUserId.find(pComment->m_oAuthor.get2());
std::map<std::wstring, std::wstring>::const_iterator pPair = mapAuthorToUserId.find(pComment->m_oAuthor.get2());
if(mapAuthorToUserId.end() != pPair)
pNewCommentWriteTemp->sUserId = pPair->second;
}
@ -7003,7 +7006,7 @@ namespace BinDocxRW
WriteNotes(oEndnotes.m_arrEndnote, oParamsDocumentWriter, oEndnotes.m_arrShapeTypes);
m_oBcw.WriteItemWithLengthEnd(nStart);
}
void WriteNotes(const std::vector<OOX::CFtnEdn*>& arrNotes, ParamsDocumentWriter& oParamsDocumentWriter, std::vector<CString>& arrShapeTypes)
void WriteNotes(const std::vector<OOX::CFtnEdn*>& arrNotes, ParamsDocumentWriter& oParamsDocumentWriter, std::vector<std::wstring>& arrShapeTypes)
{
int nCurPos = 0;
for(size_t i = 0 ; i < arrNotes.size(); ++i)
@ -7013,7 +7016,7 @@ namespace BinDocxRW
m_oBcw.WriteItemEnd(nCurPos);
}
}
void WriteNote(const OOX::CFtnEdn& oFtnEdn, ParamsDocumentWriter& oParamsDocumentWriter, std::vector<CString>& arrShapeTypes)
void WriteNote(const OOX::CFtnEdn& oFtnEdn, ParamsDocumentWriter& oParamsDocumentWriter, std::vector<std::wstring>& arrShapeTypes)
{
int nCurPos = 0;
if(oFtnEdn.m_oType.IsInit())
@ -7050,10 +7053,9 @@ namespace BinDocxRW
m_nLastFilePos = 0;
m_nRealTableCount = 0;
}
static CString WriteFileHeader(long nDataSize)
static std::wstring WriteFileHeader(long nDataSize)
{
CString sHeader;
sHeader.Format(_T("%ls;v%d;%d;"), g_sFormatSignature, g_nFormatVersion, nDataSize);
std::wstring sHeader = std::wstring(g_sFormatSignature) + L";v" + std::to_wstring(g_nFormatVersion) + L";" + std::to_wstring(nDataSize) + L";";
return sHeader;
}
void WriteMainTableStart()
@ -7113,7 +7115,7 @@ namespace BinDocxRW
//Seek вобратно в MainTable
m_oBcw.m_oStream.SetPosition(nCurPos);
}
void intoBindoc(const CString& sDir) {
void intoBindoc(const std::wstring& sDir) {
NSBinPptxRW::CBinaryFileWriter& oBufferedStream = m_oBcw.m_oStream;
OOX::CDocx oDocx = OOX::CDocx(OOX::CPath(sDir));

View File

@ -32,8 +32,6 @@
#ifndef CHART_WRITER
#define CHART_WRITER
#include "../../Common/DocxFormat/Source/Base/ASCString.h"
#include <string>
#include <map>
#include <vector>

View File

@ -48,7 +48,7 @@ BinDocxRW::CDocxSerializer::CDocxSerializer()
m_bIsNoBase64Save = false;
m_bSaveChartAsImg = false;
}
bool BinDocxRW::CDocxSerializer::ConvertDocxToDoct(const CString& sSrcFileName, const CString& sDstFileName, const CString& sTmpDir, const CString& sXMLOptions)
bool BinDocxRW::CDocxSerializer::ConvertDocxToDoct(const std::wstring& sSrcFileName, const std::wstring& sDstFileName, const std::wstring& sTmpDir, const std::wstring& sXMLOptions)
{
std::wstring strDirSrc = NSSystemPath::Combine(sTmpDir, L"from");
std::wstring strDirDst = NSSystemPath::Combine(sTmpDir, L"to");
@ -65,7 +65,7 @@ bool BinDocxRW::CDocxSerializer::ConvertDocxToDoct(const CString& sSrcFileName,
return true;
return false;
}
bool BinDocxRW::CDocxSerializer::ConvertDoctToDocx(const CString& sSrcFileName, const CString& sDstFileName, const CString& sTmpDir, const CString& sXMLOptions)
bool BinDocxRW::CDocxSerializer::ConvertDoctToDocx(const std::wstring& sSrcFileName, const std::wstring& sDstFileName, const std::wstring& sTmpDir, const std::wstring& sXMLOptions)
{
std::wstring strDirSrc = NSSystemPath::Combine(sTmpDir, L"from");
std::wstring strEditorBin = NSSystemPath::Combine(strDirSrc, L"Editor.bin");
@ -74,15 +74,15 @@ bool BinDocxRW::CDocxSerializer::ConvertDoctToDocx(const CString& sSrcFileName,
NSDirectory::CreateDirectory(strDirSrc);
NSDirectory::CreateDirectory(strDirDst);
CString sEditorBin = strEditorBin;
std::wstring sEditorBin = strEditorBin;
COfficeUtils oCOfficeUtils(NULL);
if(S_OK == oCOfficeUtils.ExtractToDirectory(sSrcFileName, strDirSrc, NULL, 0))
{
CString sMediaPath;
CString sThemePath;
CString sEmbedPath;
std::wstring sMediaPath;
std::wstring sThemePath;
std::wstring sEmbedPath;
CreateDocxFolders(strDirDst, sThemePath, sMediaPath, sEmbedPath);
@ -94,7 +94,7 @@ bool BinDocxRW::CDocxSerializer::ConvertDoctToDocx(const CString& sSrcFileName,
}
return false;
}
bool BinDocxRW::CDocxSerializer::saveToFile(const CString& sSrcFileName, const CString& sDstPath, const CString& sXMLOptions)
bool BinDocxRW::CDocxSerializer::saveToFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions)
{
OOX::CPath pathMain(sSrcFileName);
@ -111,7 +111,7 @@ bool BinDocxRW::CDocxSerializer::saveToFile(const CString& sSrcFileName, const C
NSBinPptxRW::CBinaryFileWriter& oBufferedStream = *oDrawingConverter.m_pBinaryWriter;
NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager = NULL;
if(false == m_sEmbeddedFontsDir.IsEmpty())
if(false == m_sEmbeddedFontsDir.empty())
{
NSDirectory::CreateDirectory(m_sEmbeddedFontsDir);
@ -120,7 +120,7 @@ bool BinDocxRW::CDocxSerializer::saveToFile(const CString& sSrcFileName, const C
pEmbeddedFontsManager = pFontPicker->GetNativeCutter();
//добавляем весь латинский алфавит для списков.
pEmbeddedFontsManager->CheckString(CString(_T("abcdefghijklmnopqrstuvwxyz")));
pEmbeddedFontsManager->CheckString(std::wstring(_T("abcdefghijklmnopqrstuvwxyz")));
//добавим мега шрифт
pEmbeddedFontsManager->CheckFont(_T("Wingdings 3"), fp.getFontManager());
@ -167,7 +167,7 @@ bool BinDocxRW::CDocxSerializer::saveToFile(const CString& sSrcFileName, const C
return true;
}
bool BinDocxRW::CDocxSerializer::CreateDocxFolders(CString strDirectory, CString& sThemePath, CString& sMediaPath, CString& sEmbedPath)
bool BinDocxRW::CDocxSerializer::CreateDocxFolders(std::wstring strDirectory, std::wstring& sThemePath, std::wstring& sMediaPath, std::wstring& sEmbedPath)
{
bool res = true;
// rels
@ -204,7 +204,7 @@ bool BinDocxRW::CDocxSerializer::CreateDocxFolders(CString strDirectory, CString
return res;
}
bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const CString& sDstPath, const CString& sXMLOptions, const CString& sThemePath, const CString& sMediaPath, const CString& sEmbedPath)
bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sThemePath, const std::wstring& sMediaPath, const std::wstring& sEmbedPath)
{
bool bResultOk = false;
@ -218,12 +218,12 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const
//проверяем формат
bool bValidFormat = false;
CString sSignature(g_sFormatSignature);
int nSigLength = sSignature.GetLength();
std::wstring sSignature(g_sFormatSignature);
int nSigLength = sSignature.length();
if(nBase64DataSize > nSigLength)
{
CStringA sCurSig((char*)pBase64Data, nSigLength);
if((CStringA)sSignature == sCurSig)
std::string sCurSig((char*)pBase64Data, nSigLength);
if(sSignature == std::wstring(sCurSig.begin(), sCurSig.end()))
{
bValidFormat = true;
}
@ -233,8 +233,8 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const
//Читаем из файла версию и длину base64
int nIndex = nSigLength;
int nType = 0;
CStringA version = "";
CStringA dst_len = "";
std::string version = "";
std::string dst_len = "";
while (true)
{
nIndex++;
@ -253,12 +253,12 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const
}
}
if(0 == nType)
version.AppendChar(_c);
version += _c;
else
dst_len.AppendChar(_c);
dst_len += _c;
}
int nDataSize = atoi(dst_len);
int nDataSize = atoi(dst_len.c_str());
BYTE* pData = new BYTE[nDataSize];
if(false != Base64::Base64Decode((LPCSTR)(pBase64Data + nIndex), nBase64DataSize - nIndex, pData, &nDataSize))
@ -268,10 +268,10 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const
oBufferedStream.Init(pData, 0, nDataSize);
int nVersion = g_nFormatVersion;
if(version.GetLength() > 0)
if(!version.empty())
{
version = version.Right(version.GetLength() - 1);
int nTempVersion = atoi(version);
version = version.substr(1);
int nTempVersion = atoi(version.c_str());
if(0 != nTempVersion)
{
g_nCurFormatVersion = nVersion = nTempVersion;
@ -284,7 +284,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const
//папка с картинками
std::wstring strFileInDir = NSSystemPath::GetDirectoryName(sSrcFileName);
CString sFileInDir = strFileInDir.c_str();
std::wstring sFileInDir = strFileInDir.c_str();
oDrawingConverter.SetSourceFileDir(sFileInDir);
//default theme
@ -296,9 +296,9 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const
OOX::CContentTypes oContentTypes;
//docProps
OOX::CPath pathDocProps = sDstPath + FILE_SEPARATOR_STR + _T("docProps");
FileSystem::Directory::CreateDirectory(pathDocProps.GetPath());
NSDirectory::CreateDirectory(pathDocProps.GetPath());
OOX::CPath DocProps = CString(_T("docProps"));
OOX::CPath DocProps = std::wstring(_T("docProps"));
OOX::CApp* pApp = new OOX::CApp();
if (pApp)
@ -353,17 +353,17 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const
}
return bResultOk;
}
bool BinDocxRW::CDocxSerializer::getXmlContent(NSBinPptxRW::CBinaryFileReader& oBufferedStream, long lLength, CString& sOutputXml)
bool BinDocxRW::CDocxSerializer::getXmlContent(NSBinPptxRW::CBinaryFileReader& oBufferedStream, long lLength, std::wstring& sOutputXml)
{
long nLength = oBufferedStream.GetLong();
Writers::ContentWriter oTempContentWriter;
BinDocxRW::Binary_DocumentTableReader oBinary_DocumentTableReader(oBufferedStream, *m_pCurFileWriter, oTempContentWriter, m_pCurFileWriter->m_pComments);
int res = oBinary_DocumentTableReader.Read1(nLength, &BinDocxRW::Binary_DocumentTableReader::ReadDocumentContent, &oBinary_DocumentTableReader, NULL);
sOutputXml = oTempContentWriter.m_oContent.GetData().GetString();
sOutputXml = oTempContentWriter.m_oContent.GetData();
return true;
}
bool BinDocxRW::CDocxSerializer::getBinaryContent(const CString& bsTxContent, NSBinPptxRW::CBinaryFileWriter& oBufferedStream, long& lDataSize)
bool BinDocxRW::CDocxSerializer::getBinaryContent(const std::wstring& bsTxContent, NSBinPptxRW::CBinaryFileWriter& oBufferedStream, long& lDataSize)
{
if(NULL == m_pParamsWriter)
return false;
@ -371,15 +371,15 @@ bool BinDocxRW::CDocxSerializer::getBinaryContent(const CString& bsTxContent, NS
XmlUtils::CXmlLiteReader oReader;
// CString bsTxContentTemp = _T("<root xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\">");
// std::wstring bsTxContentTemp = _T("<root xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\">");
//
// bsTxContentTemp += bsTxContent;
// bsTxContentTemp + _T("</root>");
CString sBegin(_T("<root xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\">"));
std::wstring sBegin(_T("<root xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\">"));
CString sEnd(_T("</root>"));
CString bsTxContentTemp = sBegin + bsTxContent + sEnd;
std::wstring sEnd(_T("</root>"));
std::wstring bsTxContentTemp = sBegin + bsTxContent + sEnd;
OOX::Logic::CSdtContent oSdtContent;
if (oReader.FromString(bsTxContentTemp))
@ -439,7 +439,7 @@ bool BinDocxRW::CDocxSerializer::getBinaryContentElem(OOX::EElementType eElemTyp
return true;
}
bool BinDocxRW::CDocxSerializer::getXmlContentElem(OOX::EElementType eType, NSBinPptxRW::CBinaryFileReader& oBufferedStream, CString& sOutputXml)
bool BinDocxRW::CDocxSerializer::getXmlContentElem(OOX::EElementType eType, NSBinPptxRW::CBinaryFileReader& oBufferedStream, std::wstring& sOutputXml)
{
long nLength = oBufferedStream.GetLong();
Writers::ContentWriter oTempContentWriter;
@ -447,15 +447,15 @@ bool BinDocxRW::CDocxSerializer::getXmlContentElem(OOX::EElementType eType, NSBi
if(OOX::et_m_oMathPara == eType)
{
oTempContentWriter.m_oContent.WriteString(CString(_T("<m:oMathPara>")));
oTempContentWriter.m_oContent.WriteString(std::wstring(_T("<m:oMathPara>")));
oBinary_DocumentTableReader.Read1(nLength, &BinDocxRW::Binary_DocumentTableReader::ReadMathOMathPara, &oBinary_DocumentTableReader, NULL);
oTempContentWriter.m_oContent.WriteString(CString(_T("</m:oMathPara>")));
oTempContentWriter.m_oContent.WriteString(std::wstring(_T("</m:oMathPara>")));
}
else if(OOX::et_m_oMath == eType)
{
oTempContentWriter.m_oContent.WriteString(CString(_T("<m:oMath>")));
oTempContentWriter.m_oContent.WriteString(std::wstring(_T("<m:oMath>")));
oBinary_DocumentTableReader.Read1(nLength, &BinDocxRW::Binary_DocumentTableReader::ReadMathArg, &oBinary_DocumentTableReader, NULL);
oTempContentWriter.m_oContent.WriteString(CString(_T("</m:oMath>")));
oTempContentWriter.m_oContent.WriteString(std::wstring(_T("</m:oMath>")));
}
@ -463,11 +463,11 @@ bool BinDocxRW::CDocxSerializer::getXmlContentElem(OOX::EElementType eType, NSBi
return true;
}
void BinDocxRW::CDocxSerializer::setFontDir(const CString& sFontDir)
void BinDocxRW::CDocxSerializer::setFontDir(const std::wstring& sFontDir)
{
m_sFontDir = sFontDir;
}
void BinDocxRW::CDocxSerializer::setEmbeddedFontsDir(const CString& sEmbeddedFontsDir)
void BinDocxRW::CDocxSerializer::setEmbeddedFontsDir(const std::wstring& sEmbeddedFontsDir)
{
m_sEmbeddedFontsDir = sEmbeddedFontsDir;
}

View File

@ -32,7 +32,6 @@
#ifndef DOCX_SERIALIZER
#define DOCX_SERIALIZER
#include "../../Common/DocxFormat/Source/Base/ASCString.h"
#include "../../Common/DocxFormat/Source/DocxFormat/WritingElement.h"
namespace Writers
@ -52,32 +51,32 @@ namespace BinDocxRW
class CDocxSerializer
{
public:
CString m_sFontDir;
CString m_sEmbeddedFontsDir;
std::wstring m_sFontDir;
std::wstring m_sEmbeddedFontsDir;
bool m_bIsNoBase64Save;
bool m_bSaveChartAsImg;
ParamsWriter* m_pParamsWriter;
Writers::FileWriter* m_pCurFileWriter;
public:
CDocxSerializer();
bool ConvertDocxToDoct(const CString& sSrcFileName, const CString& sDstFileName, const CString& sTmpDir, const CString& sXMLOptions);
bool ConvertDoctToDocx(const CString& sSrcFileName, const CString& sDstFileName, const CString& sTmpDir, const CString& sXMLOptions);
bool ConvertDocxToDoct(const std::wstring& sSrcFileName, const std::wstring& sDstFileName, const std::wstring& sTmpDir, const std::wstring& sXMLOptions);
bool ConvertDoctToDocx(const std::wstring& sSrcFileName, const std::wstring& sDstFileName, const std::wstring& sTmpDir, const std::wstring& sXMLOptions);
bool loadFromFile(const CString& sSrcFileName, const CString& sDstPath, const CString& sXMLOptions, const CString& sThemePath, const CString& sMediaPath, const CString& sEmbedPath);
bool saveToFile(const CString& sSrcFileName, const CString& sDstPath, const CString& sXMLOptions);
bool loadFromFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sThemePath, const std::wstring& sMediaPath, const std::wstring& sEmbedPath);
bool saveToFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions);
bool CreateDocxFolders(CString strDirectory, CString& sThemePath, CString& sMediaPath, CString& sEmbedPath);
bool CreateDocxFolders(std::wstring strDirectory, std::wstring& sThemePath, std::wstring& sMediaPath, std::wstring& sEmbedPath);
bool getXmlContent(NSBinPptxRW::CBinaryFileReader& oBufferedStream, long lLength, CString& sOutputXml);
bool getBinaryContent(const CString& bsTxContent, NSBinPptxRW::CBinaryFileWriter& oBufferedStream, long& lDataSize);
bool getXmlContent (NSBinPptxRW::CBinaryFileReader& oBufferedStream, long lLength, std::wstring& sOutputXml);
bool getBinaryContent (const std::wstring& bsTxContent, NSBinPptxRW::CBinaryFileWriter& oBufferedStream, long& lDataSize);
bool getBinaryContentElem(OOX::EElementType eElemType, void* pElem, NSBinPptxRW::CBinaryFileWriter& oBufferedStream, long& lDataSize);
bool getXmlContentElem(OOX::EElementType eType, NSBinPptxRW::CBinaryFileReader& oBufferedStream, CString& sOutputXml);
bool getBinaryContentElem (OOX::EElementType eElemType, void* pElem, NSBinPptxRW::CBinaryFileWriter& oBufferedStream, long& lDataSize);
bool getXmlContentElem (OOX::EElementType eType, NSBinPptxRW::CBinaryFileReader& oBufferedStream, std::wstring& sOutputXml);
void setFontDir(const CString& sFontDir);
void setEmbeddedFontsDir(const CString& sEmbeddedFontsDir);
void setIsNoBase64Save(bool bIsNoBase64Save);
void setSaveChartAsImg(bool bSaveChartAsImg);
void setFontDir (const std::wstring& sFontDir);
void setEmbeddedFontsDir(const std::wstring& sEmbeddedFontsDir);
void setIsNoBase64Save (bool bIsNoBase64Save);
void setSaveChartAsImg (bool bSaveChartAsImg);
};
}
#endif // #ifndef DOCX_SERIALIZER

View File

@ -63,11 +63,11 @@ namespace DocWrapper {
addToFontMap(*fontTable->m_arrFonts[i]);
}
CString FontProcessor::getFont(const CString& name)
std::wstring FontProcessor::getFont(const std::wstring& name)
{
//подбор перенесен в js
return name;
CString fontName = gc_sDefaultFontName;
std::wstring fontName = gc_sDefaultFontName;
if (fontMap.find(name) != fontMap.end())
fontName = fontMap[name];
else
@ -81,10 +81,10 @@ namespace DocWrapper {
return fontName;
}
CString FontProcessor::getFont(const NSCommon::nullable<OOX::Spreadsheet::CFontScheme>& oScheme, const NSCommon::nullable<ComplexTypes::Spreadsheet::CString_>& oRFont, const NSCommon::nullable<OOX::Spreadsheet::CCharset>& oCharset, const NSCommon::nullable<OOX::Spreadsheet::CFontFamily >& oFamily, OOX::CTheme* pTheme)
std::wstring FontProcessor::getFont(const NSCommon::nullable<OOX::Spreadsheet::CFontScheme>& oScheme, const NSCommon::nullable<ComplexTypes::Spreadsheet::String>& oRFont, const NSCommon::nullable<OOX::Spreadsheet::CCharset>& oCharset, const NSCommon::nullable<OOX::Spreadsheet::CFontFamily >& oFamily, OOX::CTheme* pTheme)
{
CFontSelectFormat oFontSelectFormat;
CString sFontName;
std::wstring sFontName;
if(NULL != pTheme && oScheme.IsInit() && oScheme->m_oFontScheme.IsInit())
{
//берем шрифт из темы
@ -94,10 +94,10 @@ namespace DocWrapper {
else if(SimpleTypes::Spreadsheet::fontschemeMinor == eFontScheme)
sFontName = pTheme->GetMinorFont();
}
if(sFontName.IsEmpty() && oRFont.IsInit() && oRFont->m_sVal.IsInit())
if(sFontName.empty() && oRFont.IsInit() && oRFont->m_sVal.IsInit())
sFontName = oRFont->ToString2();
if(sFontName.IsEmpty())
sFontName = CString(gc_sNoNameFont);
if(sFontName.empty())
sFontName = std::wstring(gc_sNoNameFont);
//подбор перенесен в js
return sFontName;
@ -119,7 +119,7 @@ namespace DocWrapper {
*oFontSelectFormat.wsFamilyClass = oFamily->m_oFontFamily->ToStringWord();
}
CString sRes;
std::wstring sRes;
CFontInfo* pFontInfo = m_pFontManager->GetFontInfoByParams(oFontSelectFormat);
if(NULL != pFontInfo)
sRes = pFontInfo->m_wsFontName;
@ -131,15 +131,16 @@ namespace DocWrapper {
void FontProcessor::addToFontMap(OOX::CFont& font)
{
CFontSelectFormat oFontSelectFormat;
CString sFontName;
if(font.m_sName.IsEmpty())
sFontName = CString(gc_sNoNameFont);
std::wstring sFontName;
if(font.m_sName.empty())
sFontName = std::wstring(gc_sNoNameFont);
else
sFontName = font.m_sName;
oFontSelectFormat.wsName = new std::wstring(sFontName);
if (font.m_oAltName.IsInit() && font.m_oAltName->GetLength() > 0)
if (font.m_oAltName.IsInit() && font.m_oAltName->length() > 0)
{
oFontSelectFormat.wsAltName = new std::wstring(*font.m_oAltName);
}

View File

@ -34,7 +34,6 @@
#include <map>
#include "../../Common/DocxFormat/Source/Base/ASCString.h"
#include "../../DesktopEditor/fontengine/ApplicationFonts.h"
//#include "DocWrapper/Base.h"
@ -43,7 +42,7 @@ namespace NSCommon{
}
namespace ComplexTypes{
namespace Spreadsheet{
class CString_;
class String;
}
}
namespace OOX
@ -56,7 +55,7 @@ namespace OOX
class CFont;
class CFontTable;
class CFontScheme;
class CString_;
class String;
class CCharset;
class CFontFamily;
}
@ -66,7 +65,7 @@ namespace DocWrapper {
class FontProcessor {
CFontManager* m_pFontManager;
std::map<CString, CString> fontMap;
std::map<std::wstring, std::wstring> fontMap;
public:
FontProcessor();
@ -76,8 +75,8 @@ namespace DocWrapper {
CFontManager* getFontManager();
void setFontTable(OOX::CFontTable* fontTable);
CString getFont(const CString& name);
CString getFont(const NSCommon::nullable<OOX::Spreadsheet::CFontScheme>& oScheme, const NSCommon::nullable<ComplexTypes::Spreadsheet::CString_>& oRFont, const NSCommon::nullable<OOX::Spreadsheet::CCharset>& oCharset, const NSCommon::nullable<OOX::Spreadsheet::CFontFamily >& oFamily, OOX::CTheme* pTheme);
std::wstring getFont(const std::wstring& name);
std::wstring getFont(const NSCommon::nullable<OOX::Spreadsheet::CFontScheme>& oScheme, const NSCommon::nullable<ComplexTypes::Spreadsheet::String>& oRFont, const NSCommon::nullable<OOX::Spreadsheet::CCharset>& oCharset, const NSCommon::nullable<OOX::Spreadsheet::CFontFamily >& oFamily, OOX::CTheme* pTheme);
private:
void addToFontMap(OOX::CFont& font);
};

View File

@ -107,7 +107,7 @@ namespace BinXlsxRW{
fp.setFontManager(pFontManager);
NSFontCutter::CEmbeddedFontsManager* pEmbeddedFontsManager = NULL;
if(false == m_sEmbeddedFontsDir.IsEmpty())
if(false == m_sEmbeddedFontsDir.empty())
{
NSDirectory::CreateDirectory(m_sEmbeddedFontsDir);
@ -120,12 +120,12 @@ namespace BinXlsxRW{
//pEmbeddedFontsManager добавляются все цифры
//для заголовков
pEmbeddedFontsManager->CheckFont(_T("Calibri"), pFontManager);
pEmbeddedFontsManager->CheckString(CString(_T("ABCDEFGHIJKLMNOPQRSTUVWXYZ")));
pEmbeddedFontsManager->CheckString(std::wstring(_T("ABCDEFGHIJKLMNOPQRSTUVWXYZ")));
//дополнение для ошибок "#NULL!", "#DIV/0!"...
pEmbeddedFontsManager->CheckString(CString(_T("#!/?")));
pEmbeddedFontsManager->CheckString(std::wstring(_T("#!/?")));
//дополнение для num форматов по умолчанию с id от 0 до 49
pEmbeddedFontsManager->CheckString(CString(_T(".%E+-():")));
pEmbeddedFontsManager->CheckString(std::wstring(_T(".%E+-():")));
}
NSBinPptxRW::CDrawingConverter oOfficeDrawingConverter;
@ -150,7 +150,7 @@ namespace BinXlsxRW{
long nStartPos = oBufferedStream.GetPosition();
BinXlsxRW::BinaryCommonWriter oBcw(oBufferedStream);
CString sOldRelsPath = m_pExternalDrawingConverter->GetRelsPath();
std::wstring sOldRelsPath = m_pExternalDrawingConverter->GetRelsPath();
m_pExternalDrawingConverter->SetRelsPath(sChartPath);
BinXlsxRW::BinaryChartWriter oBinaryChartWriter(oBufferedStream, m_pExternalDrawingConverter);
@ -176,13 +176,11 @@ namespace BinXlsxRW{
std::wstring sThemePath;
std::wstring sEmbedingPath;
CString sFilenameReverse = sFilepath; sFilenameReverse.MakeReverse();
int nIndex = sFilenameReverse.Find(FILE_SEPARATOR_CHAR);
nIndex = sFilenameReverse.Find(FILE_SEPARATOR_CHAR, nIndex + 1);
int nIndex = sFilepath.rfind(FILE_SEPARATOR_CHAR);
nIndex = sFilepath.rfind(FILE_SEPARATOR_CHAR, nIndex - 1);
if(-1 != nIndex)
{
CString sFilepathLeft = sFilepath.substr(0, sFilepath.length() - nIndex);
std::wstring sFilepathLeft = sFilepath.substr(0, nIndex + 1);
sThemePath = sFilepathLeft + L"theme";
sEmbedingPath = sFilepathLeft + L"embeddings";
}
@ -206,8 +204,8 @@ namespace BinXlsxRW{
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
long rId;
CString bstrChartsWorksheetRelType = OOX::Spreadsheet::FileTypes::ChartsWorksheet.RelationType();
m_pExternalDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, CString(), &rId);
std::wstring bstrChartsWorksheetRelType = OOX::Spreadsheet::FileTypes::ChartsWorksheet.RelationType();
m_pExternalDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rId);
oChartSpace.m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData();
oChartSpace.m_oChartSpace.m_externalData->m_id = new std::wstring();
@ -218,8 +216,8 @@ namespace BinXlsxRW{
}
std::wstring strFilepath = sFilepath;
CString strDir = NSSystemPath::GetDirectoryName(strFilepath);
CString strFilename = NSSystemPath::GetFileName(strFilepath);
std::wstring strDir = NSSystemPath::GetDirectoryName(strFilepath);
std::wstring strFilename = NSSystemPath::GetFileName(strFilepath);
OOX::CPath pathRelsDir = strDir + FILE_SEPARATOR_STR + _T("_rels");
@ -230,7 +228,7 @@ namespace BinXlsxRW{
OOX::CPath pathRelsFile = pathRelsDir + FILE_SEPARATOR_STR + strFilename + _T(".rels");
m_pExternalDrawingConverter->SaveDstContentRels(pathRelsFile.GetPath());
CString sContentType(sContentTypePath);
std::wstring sContentType(sContentTypePath);
sContentType += strFilename;
std::wstring sContent = L"<Override PartName=\"" + sContentType + L"\" ContentType=\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\"/>";
@ -265,15 +263,15 @@ namespace BinXlsxRW{
NSDirectory::CreateDirectory(sTempDir);
OOX::CPath oPath(sTempDir.c_str());
//шиблонные папки
CString sXmlOptions = _T("");
CString sMediaPath;// will be filled by 'CreateXlsxFolders' method
CString sEmbedPath; // will be filled by 'CreateXlsxFolders' method
std::wstring sXmlOptions = _T("");
std::wstring sMediaPath;// will be filled by 'CreateXlsxFolders' method
std::wstring sEmbedPath; // will be filled by 'CreateXlsxFolders' method
CreateXlsxFolders (sXmlOptions, sTempDir, sMediaPath, sEmbedPath);
//заполняем Xlsx
OOX::Spreadsheet::CXlsx oXlsx;
helper.toXlsx(oXlsx);
//write
CString sAdditionalContentTypes;
std::wstring sAdditionalContentTypes;
oXlsx.Write(oPath, sAdditionalContentTypes);
//zip
COfficeUtils oOfficeUtils(NULL);

View File

@ -32,7 +32,6 @@
#ifndef XLSX_SERIALIZER
#define XLSX_SERIALIZER
#include "../../Common/DocxFormat/Source/Base/ASCString.h"
#include <string>
namespace OOX
@ -53,8 +52,8 @@ namespace BinXlsxRW {
class CXlsxSerializer{
private:
CString m_sFontDir;
CString m_sEmbeddedFontsDir;
std::wstring m_sFontDir;
std::wstring m_sEmbeddedFontsDir;
NSBinPptxRW::CDrawingConverter* m_pExternalDrawingConverter;
public:
CXlsxSerializer();

View File

@ -387,7 +387,7 @@
"$(PROJECT_DIR)/../../DesktopEditor/freetype-2.5.2/include",
"$(PROJECT_DIR)/../../Common/3dParty/boost/boost_1_58_0",
);
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
PRODUCT_NAME = ASCOfficeDocxFile2Lib_ios;
SDKROOT = iphoneos;
};
@ -423,7 +423,7 @@
"$(PROJECT_DIR)/../../DesktopEditor/freetype-2.5.2/include",
"$(PROJECT_DIR)/../../Common/3dParty/boost/boost_1_58_0",
);
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
PRODUCT_NAME = ASCOfficeDocxFile2Lib_ios;
SDKROOT = iphoneos;
};
@ -463,6 +463,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
@ -498,6 +499,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;

View File

@ -29,6 +29,7 @@ DEFINES += UNICODE \
INCLUDEPATH += ../include
INCLUDEPATH += ../../DesktopEditor/freetype-2.5.2/include
INCLUDEPATH += ../../DesktopEditor/xml/libxml2/include
INCLUDEPATH += ../../DesktopEditor/xml/build/qt
CONFIG(debug, debug|release){
DEFINES += _DEBUG

View File

@ -69,7 +69,7 @@ word_files::word_files()
void word_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"word";
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
if (document_)
document_->write( path );
@ -214,7 +214,7 @@ void docx_charts_files::add_chart(chart_content_ptr chart)
void docx_charts_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"charts";
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
size_t count = 0;

View File

@ -41,8 +41,8 @@
#include "../../Common/DocxFormat/Source/Base/Base.h"
#include "../../Common/DocxFormat/Source/SystemUtility/File.h"
#include "../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../../DesktopEditor/raster/ImageFileFormatChecker.h"
namespace cpdoccore {
@ -58,7 +58,7 @@ bool is_internal(const std::wstring & uri, const std::wstring & packetRoot)
std::wstring resultPath = packetRoot + FILE_SEPARATOR_STR + mediaPath;
return FileSystem::Directory::IsExist(resultPath) || FileSystem::Directory::IsExist(mediaPath);
return NSDirectory::Exists(resultPath) || NSDirectory::Exists(mediaPath);
}
mediaitems::item::item( std::wstring const & _href,

View File

@ -214,7 +214,7 @@ void rels_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"_rels";
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
if (rels_file_)
rels_file_->write(path);
@ -301,7 +301,7 @@ docProps_files::docProps_files()
void docProps_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"docProps";
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
core_.write(path);
app_.write(path);
@ -317,7 +317,7 @@ media::media(mediaitems & _Mediaitems, CApplicationFonts *pAppFonts) : mediaitem
void media::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"media";
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
mediaitems::items_array & items = mediaitems_.items();
for (int i = 0; i < items.size(); i++ )
@ -354,7 +354,7 @@ embeddings::embeddings(mediaitems & _EmbeddingsItems) : embeddingsitems_(_Embedd
void embeddings::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"embeddings";
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
content_types_file & content_types = get_main_document()->get_content_types_file();

View File

@ -40,7 +40,7 @@
#include "oox_rels.h"
#include "../../../Common/DocxFormat/Source/Base/Base.h"
#include "../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../../../DesktopEditor/common/Directory.h"
class CApplicationFonts;

View File

@ -117,7 +117,7 @@ void slides_files::add_slide(slide_content_ptr slide)
void slides_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"slides" ;
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
content_type_content * contentTypes = this->get_main_document()->get_content_types_file().content();
static const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.presentationml.slide+xml";
@ -160,7 +160,7 @@ void slideMasters_files::add_slide(slide_content_ptr slide)
void slideMasters_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"slideMasters" ;
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
content_type_content * contentTypes = this->get_main_document()->get_content_types_file().content();
static const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml";
@ -202,7 +202,7 @@ void slideLayouts_files::add_slide(slide_content_ptr slide)
void slideLayouts_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"slideLayouts" ;
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
for (int i = 0; i < slides_.size(); i++)
{
@ -254,7 +254,7 @@ void ppt_charts_files::add_chart(chart_content_ptr chart)
void ppt_charts_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"charts";
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
for (int i = 0; i < charts_.size(); i++)
{
@ -284,7 +284,7 @@ void ppt_themes_files::add_theme(pptx_xml_theme_ptr theme)
void ppt_themes_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"theme" ;
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
for (int i = 0; i < themes_.size(); i++)
{
@ -310,7 +310,7 @@ ppt_comments_files_ptr ppt_comments_files::create(const std::vector<pptx_comment
void ppt_comments_files::write(const std::wstring & RootPath)
{
std::wstring comm_path = RootPath + FILE_SEPARATOR_STR + L"comments";
FileSystem::Directory::CreateDirectory(comm_path.c_str());
NSDirectory::CreateDirectory(comm_path.c_str());
for (int i = 0; i < comments_.size(); i++)
{
@ -331,7 +331,7 @@ ppt_files::ppt_files()
void ppt_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"ppt";
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
slides_files_.set_rels(&rels_files_);
slides_files_.set_main_document( this->get_main_document() );

View File

@ -119,7 +119,7 @@ void sheets_files::add_sheet(sheet_content_ptr sheet)
void sheets_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"worksheets";
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
size_t count = 0;
@ -164,7 +164,7 @@ xl_files::xl_files()
void xl_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"xl";
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
sheets_files_.set_rels(&rels_files_);
sheets_files_.set_main_document( this->get_main_document() );
@ -277,7 +277,7 @@ void xl_charts_files::add_chart(chart_content_ptr chart)
void xl_charts_files::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"charts";
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
size_t count = 0;
@ -312,7 +312,7 @@ xl_drawings_ptr xl_drawings::create(const std::vector<drawing_elm> & elms)
void xl_drawings::write(const std::wstring & RootPath)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"drawings";
FileSystem::Directory::CreateDirectory(path.c_str());
NSDirectory::CreateDirectory(path.c_str());
BOOST_FOREACH(drawing_elm const & e, drawings_)
{
@ -342,7 +342,7 @@ xl_comments_ptr xl_comments::create(const std::vector<comment_elm> & elms)
void xl_comments::write(const std::wstring & RootPath)
{
std::wstring vml_path = RootPath + FILE_SEPARATOR_STR + L"drawings";
FileSystem::Directory::CreateDirectory(vml_path.c_str());
NSDirectory::CreateDirectory(vml_path.c_str());
BOOST_FOREACH(comment_elm const & e, comments_)
{

View File

@ -337,7 +337,7 @@ std::wstring draw_object::office_convert(odf_document * odfDocument, int type)
{
std::wstring href_result;
std::wstring folderPath = odfDocument->get_folder();
std::wstring objectOutPath = FileSystem::Directory::CreateDirectoryWithUniqueName(folderPath);
std::wstring objectOutPath = NSDirectory::CreateDirectoryWithUniqueName(folderPath);
if (type == 1)
{
@ -381,10 +381,10 @@ std::wstring draw_object::office_convert(odf_document * odfDocument, int type)
{
std::wstring temp_file = folderPath + FILE_SEPARATOR_STR + href_result;
COfficeUtils oCOfficeUtils(NULL);
COfficeUtils oCOfficeUtils(NULL);
oCOfficeUtils.CompressFileOrDirectory(objectOutPath.c_str(), temp_file.c_str(), -1);
}
FileSystem::Directory::DeleteDirectory(objectOutPath);
NSDirectory::DeleteDirectory(objectOutPath);
return href_result;
}

View File

@ -32,8 +32,9 @@
#include <string>
#include "../../../Common/DocxFormat/Source/Base/Nullable.h"
#include "../../../Common/DocxFormat/Source/XML/libxml2/libxml2.h"
#include "../../../DesktopEditor/xml/include/xmlutils.h"
#include "../../../DesktopEditor/xml/src/xmllight_private.h"
#include "../../include/cpdoccore/xml/sax.h"
@ -72,7 +73,7 @@ public:
virtual NodeType next(int Depth);
private:
smart_ptr< XmlUtils::CXmlLiteReader > xml_;
smart_ptr< XmlUtils::CXmlLiteReader_Private > xml_;
};
@ -112,7 +113,7 @@ namespace
saxXmlLiteReader::saxXmlLiteReader(const wchar_t * FileName)
{
xml_ = new XmlUtils::CXmlLiteReader();
xml_ = new XmlUtils::CXmlLiteReader_Private();
xml_->FromFile(FileName);
@ -156,7 +157,7 @@ std::wstring saxXmlLiteReader::namespacePrefix()
{
if (xml_.IsInit() == false) return _T("");
xmlChar* pName = xmlTextReaderPrefix(xml_->getNativeReader());
xmlChar* pName = xmlTextReaderPrefix(xml_->getNativeReader());
if (NULL == pName)
return L"";

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Version="8.00"
Name="OdfFormatReaderLib"
ProjectGUID="{50E20601-4A8D-4AFB-8870-63828D328429}"
RootNamespace="cpodf"
@ -1474,6 +1474,14 @@
<File
RelativePath="..\src\odf\odf_document_impl.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|x64"
>
@ -1615,14 +1623,6 @@
RelativePath="..\src\odf\ruby.cpp"
>
</File>
<File
RelativePath="..\src\odf\ruby.h"
>
</File>
<File
RelativePath="..\src\odf\search_table_cell.cpp"
>
</File>
<File
RelativePath="..\src\odf\search_table_cell.h"
>
@ -1716,10 +1716,6 @@
RelativePath="..\src\ConvertOO2OOX.h"
>
</File>
<File
RelativePath="..\..\Common\DocxFormat\Source\SystemUtility\FileSystem\Directory.cpp"
>
</File>
</Files>
<Globals>
</Globals>

View File

@ -42,8 +42,8 @@
#include <string>
#include "../../Common/DocxFormat/Source/Base/Base.h"
#include "../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../../Common/DocxFormat/Source/SystemUtility/File.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../../DesktopEditor/common/File.h"
#include "../source/Oox2OdfConverter/Oox2OdfConverter.h"
@ -57,16 +57,16 @@ std::wstring DetectTypeDocument(const std::wstring & pathOOX)
{
std::wstring sRes;
CFile file;
NSFile::CFileBinary file;
CString fileContentType = std_string2string(pathOOX + FILE_SEPARATOR_STR + L"[Content_Types].xml");
std::wstring fileContentType = pathOOX + FILE_SEPARATOR_STR + L"[Content_Types].xml";
if (file.OpenFile(fileContentType) != S_OK) return sRes;
if (file.OpenFile(fileContentType) ==false) return sRes;
int nBufferSize = min (file.GetFileSize(), 10000);
DWORD nBufferSize = min (file.GetFileSize(), 10000);
BYTE *pBuffer = new BYTE[nBufferSize];
file.ReadFile(pBuffer, nBufferSize);
file.ReadFile(pBuffer, nBufferSize, nBufferSize);
file.CloseFile();
if (pBuffer != NULL)
@ -128,10 +128,10 @@ int _tmain(int argc, _TCHAR* argv[])
//////////////////////////////////////////////////////////////////////////
std::wstring srcFileName = argv[1];
std::wstring dstPath = argv[2];
std::wstring outputDir = FileSystem::Directory::GetFolderPath(dstPath);
std::wstring outputDir = NSDirectory::GetFolderPath(dstPath);
std::wstring srcTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
std::wstring dstTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
std::wstring srcTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
// распаковываем исходник во временную директорию
COfficeUtils oCOfficeUtils(NULL);
@ -145,14 +145,14 @@ int _tmain(int argc, _TCHAR* argv[])
converter.convert();
converter.write(dstTempPath);
FileSystem::Directory::DeleteDirectory(srcTempPath);
NSDirectory::DeleteDirectory(srcTempPath);
if (hr != S_OK) return hr;
if (S_OK != oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), dstPath.c_str(), -1))
return hr;
FileSystem::Directory::DeleteDirectory(dstTempPath);
NSDirectory::DeleteDirectory(dstTempPath);
////////////////////////////////////////////////////////////////////////
std::cout << "\n\nTime : " << t1.elapsed() << "\n";

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Version="8.00"
Name="ASCOfficeOdfFileWTest"
ProjectGUID="{FBA8446A-150F-4A10-B4DA-1022048D6473}"
RootNamespace="ASCOfficeOdfFileWTest"
@ -63,6 +63,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="&#x0D;&#x0A;Rpcrt4.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
@ -385,6 +386,30 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\DesktopEditor\xml\src\xmldom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\DesktopEditor\xml\src\xmllight.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
</Filter>
</Files>
<Globals>

View File

@ -39,9 +39,9 @@
#include "mediaitems.h"
#include "../../../DesktopEditor/common/File.h"
#include "../../../DesktopEditor/common/Directory.h"
#include "../../../Common/DocxFormat/Source/Base/Base.h"
#include "../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
namespace cpdoccore
{
@ -129,7 +129,7 @@ namespace odf_writer
}
}
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"META-INF";
FileSystem::Directory::CreateDirectory(path);
NSDirectory::CreateDirectory(path);
simple_element elm(L"manifest.xml", resStream.str());
elm.write(path);
}
@ -186,7 +186,7 @@ namespace odf_writer
if (mediaitems_.count_media < 1)return;
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"media";
FileSystem::Directory::CreateDirectory(path);
NSDirectory::CreateDirectory(path);
BOOST_FOREACH( _mediaitems::item & item, mediaitems_.items() )
{
@ -210,7 +210,7 @@ namespace odf_writer
if (mediaitems_.count_image < 1 )return;
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"Pictures";
FileSystem::Directory::CreateDirectory(path);
NSDirectory::CreateDirectory(path);
BOOST_FOREACH( _mediaitems::item & item, mediaitems_.items() )
{
@ -295,7 +295,7 @@ namespace odf_writer
BOOST_FOREACH(const element_ptr & item, objects_)
{
std::wstring path = RootPath + FILE_SEPARATOR_STR + item->local_path;
FileSystem::Directory::CreateDirectory(path);
NSDirectory::CreateDirectory(path);
item->write(path);
}

View File

@ -75,12 +75,12 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
convert(vml_shape_type->m_arrItems[i]);
}
if (vml_shape_type->m_oAdj.IsInit())//настройка дл фигуры заданной формулами
if (vml_shape_type->m_sAdj.IsInit())//настройка дл фигуры заданной формулами
{
}
//o:spt
//nullable<CString> m_oAdj;
//nullable<std::wstring> m_oAdj;
//nullable<SimpleTypes::Vml::CVmlPath> m_oPath;
//SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oMaster;
//m_arrItems
@ -336,18 +336,19 @@ void OoxConverter::convert(OOX::Vml::CImageData *vml_image_data)
{
if (vml_image_data == NULL) return;
CString pathImage;
std::wstring pathImage;
double Width=0, Height = 0;
if (vml_image_data->m_rId.IsInit())
{
CString sID = vml_image_data->m_rId->GetValue();
std::wstring sID = vml_image_data->m_rId->GetValue();
pathImage = find_link_by_id(sID,1);
}
//что именно нужно заливка объекта или картинка - разрулится внутри drawing_context
if (pathImage.GetLength() < 1)return;
_graphics_utils_::GetResolution(pathImage, Width, Height);
if (pathImage.empty())return;
_graphics_utils_::GetResolution(pathImage.c_str(), Width, Height);
odf_context()->drawing_context()->start_area_properties();
odf_context()->drawing_context()->start_bitmap_style();
@ -400,13 +401,13 @@ void OoxConverter::convert(OOX::Vml::CFill *vml_fill)
odf_context()->drawing_context()->start_bitmap_style();
{
double Width=0, Height = 0;
CString sID = vml_fill->m_rId->GetValue();
CString pathImage = find_link_by_id(sID,1);
std::wstring sID = vml_fill->m_rId->GetValue();
std::wstring pathImage = find_link_by_id(sID,1);
if (pathImage.GetLength() > 0)
if (!pathImage.empty())
{
odf_context()->drawing_context()->set_bitmap_link(pathImage);
_graphics_utils_::GetResolution(pathImage, Width, Height);
_graphics_utils_::GetResolution(pathImage.c_str(), Width, Height);
}
odf_context()->drawing_context()->set_image_style_repeat(1);
}
@ -508,13 +509,13 @@ void OoxConverter::convert(OOX::Vml::CPath *vml_path)
if (vml_path == NULL) return;
//SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oArrowOk;
//nullable<CString> m_oConnectAngles;
//nullable<CString> m_oConnectLocs;
//nullable<std::wstring> m_oConnectAngles;
//nullable<std::wstring> m_oConnectLocs;
//SimpleTypes::CConnectType<SimpleTypes::connecttypeNone> m_oConnectType;
//SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oExtrusionOk;
//SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oFillOk;
//SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oGradientShapeOk;
//nullable<CString> m_oId;
//nullable<std::wstring> m_oId;
//SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oInsetPenOk;
//SimpleTypes::Vml::CVml_Vector2D_Units m_oLimo;
//SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oShadowOk;
@ -792,10 +793,11 @@ void OoxConverter::convert(OOX::Vml::CVmlCommonElements *vml_common)
ucR = vml_common->m_oStrokeColor->Get_R();
ucB = vml_common->m_oStrokeColor->Get_B();
ucG = vml_common->m_oStrokeColor->Get_G();
SimpleTypes::CHexColor<> *oRgbColor = new SimpleTypes::CHexColor<>(ucR,ucG,ucB);
if (oRgbColor)
SimpleTypes::CHexColor<> *oRgbColor = new SimpleTypes::CHexColor<>(ucR,ucG,ucB);
if (oRgbColor)
{
odf_context()->drawing_context()->set_solid_fill(oRgbColor->ToString().Right(6));
odf_context()->drawing_context()->set_solid_fill(oRgbColor->ToString().substr(2));//.Right(6));
delete oRgbColor;
}
}
@ -808,11 +810,13 @@ void OoxConverter::convert(OOX::Vml::CVmlCommonElements *vml_common)
ucR = vml_common->m_oFillColor->Get_R();
ucB = vml_common->m_oFillColor->Get_B();
ucG = vml_common->m_oFillColor->Get_G();
SimpleTypes::CHexColor<> *oRgbColor = new SimpleTypes::CHexColor<>(ucR,ucG,ucB);
if (oRgbColor)
SimpleTypes::CHexColor<> *oRgbColor = new SimpleTypes::CHexColor<>(ucR,ucG,ucB);
if (oRgbColor)
{
odf_context()->drawing_context()->start_area_properties();
odf_context()->drawing_context()->set_solid_fill(oRgbColor->ToString().Right(6));
odf_context()->drawing_context()->set_solid_fill(oRgbColor->ToString().substr(2));//.Right(6));
odf_context()->drawing_context()->end_area_properties();
delete oRgbColor;
}

View File

@ -395,7 +395,7 @@ void OoxConverter::convert(OOX::Drawing::CFontReference *style_font_ref)
OOX::CTheme *theme = oox_theme();
if (!theme) return;
CString color;
std::wstring color;
if (style_font_ref->m_eType == OOX::Drawing::colorSheme)
{
@ -411,9 +411,9 @@ void OoxConverter::convert(OOX::Drawing::CFontReference *style_font_ref)
convert(&theme->m_oThemeElements.m_oFontScheme.m_oMinorFont, &color);
}
}
void OoxConverter::convert(OOX::Drawing::CFontCollection *style_font, CString *sheme_color)
void OoxConverter::convert(OOX::Drawing::CFontCollection *style_font, std::wstring *sheme_color)
{
if ((sheme_color) && (sheme_color->GetLength() >0))
if ((sheme_color) && (sheme_color->length() >0))
{
std::wstring hexColor;
_CP_OPT(double) opacity;
@ -445,7 +445,7 @@ void OoxConverter::convert(OOX::Drawing::CStyleMatrixReference *style_matrix_ref
OOX::CTheme *theme = oox_theme();
if (!theme || fmt_index <0) return;
CString color = style_matrix_ref->m_oShemeClr.m_oVal.ToString();
std::wstring color = style_matrix_ref->m_oShemeClr.m_oVal.ToString();
if (style_matrix_ref->getType() == OOX::et_a_fillRef)
{
@ -599,9 +599,9 @@ void OoxConverter::convert(OOX::Drawing::CNonVisualDrawingProps * oox_cnvPr)
odf_context()->drawing_context()->set_name(name);
}
//nullable<CString> m_sDescr;
//nullable<std::wstring> m_sDescr;
//nullable<SimpleTypes::COnOff<>> m_oHidden;
//nullable<CString> m_sTitle;
//nullable<std::wstring> m_sTitle;
}
void OoxConverter::convert(OOX::Drawing::CCustomGeometry2D *oox_cust_geom)
@ -613,7 +613,7 @@ void OoxConverter::convert(OOX::Drawing::CCustomGeometry2D *oox_cust_geom)
convert(oox_cust_geom->m_oPthLst.m_arrPath[i]);
}
}
void OoxConverter::convert(OOX::Drawing::CLineProperties *oox_line_prop, CString *change_sheme_color )
void OoxConverter::convert(OOX::Drawing::CLineProperties *oox_line_prop, std::wstring *change_sheme_color )
{
if (!oox_line_prop)return;
@ -704,7 +704,7 @@ void OoxConverter::convert(OOX::Drawing::CPath2D *oox_geom_path)
}
//-----------------------------------------------------------------------------------------------------------------
void OoxConverter::convert(OOX::Drawing::CEffectList *oox_effect_list, CString *change_sheme_color)
void OoxConverter::convert(OOX::Drawing::CEffectList *oox_effect_list, std::wstring *change_sheme_color)
{
if (oox_effect_list == NULL) return;
@ -735,21 +735,21 @@ void OoxConverter::convert(OOX::Drawing::CEffectList *oox_effect_list, CString *
}
}
}
void OoxConverter::convert(OOX::Drawing::COuterShadowEffect *oox_shadow, CString *change_sheme_color)
void OoxConverter::convert(OOX::Drawing::COuterShadowEffect *oox_shadow, std::wstring *change_sheme_color)
{
if (oox_shadow == NULL) return;
std::wstring hexColor;
_CP_OPT(double) opacity;
CString keep_sheme_color;
std::wstring keep_sheme_color;
if (oox_shadow->m_eType == OOX::Drawing::colorSheme && change_sheme_color)
{
keep_sheme_color = oox_shadow->m_oShemeClr.m_oVal.ToString();
oox_shadow->m_oShemeClr.m_oVal.FromString(*change_sheme_color);
}
convert(static_cast<OOX::Drawing::CColor*>(oox_shadow), hexColor, opacity);
if (keep_sheme_color.GetLength() > 0) oox_shadow->m_oShemeClr.m_oVal.FromString(keep_sheme_color);
if (keep_sheme_color.length() > 0) oox_shadow->m_oShemeClr.m_oVal.FromString(keep_sheme_color);
odf_context()->drawing_context()->set_shadow(1, hexColor, opacity, oox_shadow->m_oDist.ToPoints());
@ -764,27 +764,27 @@ void OoxConverter::convert(OOX::Drawing::COuterShadowEffect *oox_shadow, CString
//SimpleTypes::CPercentage m_oSy;
}
void OoxConverter::convert(OOX::Drawing::CInnerShadowEffect *oox_shadow, CString *change_sheme_color)
void OoxConverter::convert(OOX::Drawing::CInnerShadowEffect *oox_shadow, std::wstring *change_sheme_color)
{
if (oox_shadow == NULL) return;
std::wstring hexColor;
_CP_OPT(double) opacity;
CString keep_sheme_color;
std::wstring keep_sheme_color;
if (oox_shadow->m_eType == OOX::Drawing::colorSheme && change_sheme_color)
{
keep_sheme_color = oox_shadow->m_oShemeClr.m_oVal.ToString();
oox_shadow->m_oShemeClr.m_oVal.FromString(*change_sheme_color);
}
convert(static_cast<OOX::Drawing::CColor*>(oox_shadow), hexColor, opacity);
if (keep_sheme_color.GetLength() > 0) oox_shadow->m_oShemeClr.m_oVal.FromString(keep_sheme_color);
if (keep_sheme_color.length() > 0) oox_shadow->m_oShemeClr.m_oVal.FromString(keep_sheme_color);
odf_context()->drawing_context()->set_shadow(2, hexColor, opacity, oox_shadow->m_oDist.ToPoints());
}
//-----------------------------------------------------------------------------------------------------------------
void OoxConverter::convert(OOX::Drawing::CBlipFillProperties *oox_bitmap_fill, CString *change_sheme_color)
void OoxConverter::convert(OOX::Drawing::CBlipFillProperties *oox_bitmap_fill, std::wstring *change_sheme_color)
{
if (oox_bitmap_fill == NULL)return;
@ -793,13 +793,13 @@ void OoxConverter::convert(OOX::Drawing::CBlipFillProperties *oox_bitmap_fill, C
double Width=0, Height = 0;
if (oox_bitmap_fill->m_oBlip.IsInit())
{
CString sID = oox_bitmap_fill->m_oBlip->m_oEmbed.GetValue();
CString pathImage = find_link_by_id(sID,1);
std::wstring sID = oox_bitmap_fill->m_oBlip->m_oEmbed.GetValue();
std::wstring pathImage = find_link_by_id(sID,1);
if (pathImage.GetLength() > 0)
if (pathImage.length() > 0)
{
odf_context()->drawing_context()->set_bitmap_link(pathImage);
_graphics_utils_::GetResolution(pathImage, Width, Height);
_graphics_utils_::GetResolution(pathImage.c_str(), Width, Height);
}
else
{
@ -852,7 +852,7 @@ void OoxConverter::convert(OOX::Drawing::CBlipFillProperties *oox_bitmap_fill, C
odf_context()->drawing_context()->end_bitmap_style();
}
void OoxConverter::convert(OOX::Drawing::CGradientFillProperties *oox_grad_fill, CString *change_sheme_color)
void OoxConverter::convert(OOX::Drawing::CGradientFillProperties *oox_grad_fill, std::wstring *change_sheme_color)
{
if (!oox_grad_fill)return;
@ -935,7 +935,7 @@ void OoxConverter::convert(OOX::Drawing::CGradientFillProperties *oox_grad_fill,
}
odf_context()->drawing_context()->end_gradient_style();
}
void OoxConverter::convert(OOX::Drawing::CPatternFillProperties *oox_pattern_fill, CString *change_sheme_color)
void OoxConverter::convert(OOX::Drawing::CPatternFillProperties *oox_pattern_fill, std::wstring *change_sheme_color)
{
if (!oox_pattern_fill)return;
@ -992,7 +992,7 @@ void OoxConverter::convert(OOX::Drawing::CColor *oox_color,std::wstring & hexCol
case OOX::Drawing::colorSys: convert(&oox_color->m_oSysClr, hexColor, opacity); break;
}
}
void OoxConverter::convert(OOX::Drawing::CSolidColorFillProperties *oox_solid_fill, CString *change_sheme_color)
void OoxConverter::convert(OOX::Drawing::CSolidColorFillProperties *oox_solid_fill, std::wstring *change_sheme_color)
{
if (!oox_solid_fill)return;
@ -1019,9 +1019,9 @@ void OoxConverter::convert(OOX::Drawing::Colors::CColorTransform *oox_Clr, s
oox_Clr->GetRGBA(ucR,ucG,ucB,ucA);
SimpleTypes::CHexColor<SimpleTypes::hexcolorRGB> *oRgbColor = new SimpleTypes::CHexColor<SimpleTypes::hexcolorRGB>(ucR,ucG,ucB);
if (oRgbColor)
if ((oRgbColor) && (oRgbColor->GetValue() == SimpleTypes::hexcolorRGB ))
{
hexString = oRgbColor->ToString().Right(6);
hexString = oRgbColor->ToString().substr(2);//.Right(6);
delete oRgbColor;
}
if (ucA !=255)opacity = (ucA/255.)* 100.;
@ -1074,9 +1074,9 @@ void OoxConverter::convert(OOX::Drawing::CSchemeColor *oox_ShemeClr, std::ws
oox_ShemeClr->GetRGBA(ucR,ucG,ucB,ucA);
SimpleTypes::CHexColor<SimpleTypes::hexcolorRGB> *oRgbColor = new SimpleTypes::CHexColor<SimpleTypes::hexcolorRGB>(ucR,ucG,ucB);
if (oRgbColor)
if (oRgbColor)
{
hexString = oRgbColor->ToString().Right(6);
hexString = oRgbColor->ToString().substr(2);//.Right(6);
delete oRgbColor;
}
if (ucA !=255)opacity = (ucA/255.)* 100.;
@ -1244,16 +1244,16 @@ void OoxConverter::convert(OOX::Drawing::CRunProperty * oox_run_pr, odf_writer::
}
if (oox_run_pr->m_oLanguage.IsInit())
{
CString oox_language = oox_run_pr->m_oLanguage->GetValue(), oox_country;
int res = oox_language.Find(L"-");
if (res >=0)
std::wstring oox_language = oox_run_pr->m_oLanguage->GetValue(), oox_country;
int res = oox_language.find(L"-");
if (res >= 0)
{
oox_country = oox_language.Right(oox_language.GetLength() - res -1);
oox_language = oox_language.Left(res);
oox_country = oox_language.substr(res);
oox_language = oox_language.substr(0, res);
}
text_properties->content().fo_language_ = oox_language;
if (oox_country.GetLength() > 0)
if (oox_country.length() > 0)
text_properties->content().fo_country_ = oox_country;
}

View File

@ -35,9 +35,8 @@
#include "../progressCallback.h"
#include "../../../Common/DocxFormat/Source/Base/ASCString.h"
#include <vector>
#include <string>
namespace cpdoccore
{
@ -341,7 +340,7 @@ public:
//.......................................................................................................................
virtual cpdoccore::odf_writer::odf_conversion_context *odf_context() = 0;
virtual OOX::CTheme *oox_theme() = 0;
virtual CString find_link_by_id(CString sId, int t) = 0;
virtual std::wstring find_link_by_id(std::wstring sId, int t) = 0;
OOX::Spreadsheet::IFileContainer *oox_current_child_document_spreadsheet;
OOX::IFileContainer *oox_current_child_document;
@ -361,18 +360,18 @@ public:
void convert(OOX::Drawing::CPresetGeometry2D *oox_prst_geom);
int convert(OOX::Drawing::CPresetTextShape *oox_text_preset);
void convert(OOX::Drawing::CLineProperties *oox_line_prop, CString *change_sheme_color = NULL);
void convert(OOX::Drawing::CLineProperties *oox_line_prop, std::wstring *change_sheme_color = NULL);
void convert(OOX::Drawing::CBlipFillProperties *oox_bitmap_fill, CString *change_sheme_color = NULL);
void convert(OOX::Drawing::CGradientFillProperties *oox_grad_fill , CString *change_sheme_color = NULL);
void convert(OOX::Drawing::CPatternFillProperties *oox_pattern_fill, CString *change_sheme_color = NULL);
void convert(OOX::Drawing::CSolidColorFillProperties *oox_solid_fill , CString *change_sheme_color = NULL);
void convert(OOX::Drawing::CBlipFillProperties *oox_bitmap_fill, std::wstring *change_sheme_color = NULL);
void convert(OOX::Drawing::CGradientFillProperties *oox_grad_fill , std::wstring *change_sheme_color = NULL);
void convert(OOX::Drawing::CPatternFillProperties *oox_pattern_fill, std::wstring *change_sheme_color = NULL);
void convert(OOX::Drawing::CSolidColorFillProperties *oox_solid_fill , std::wstring *change_sheme_color = NULL);
void convert(OOX::Drawing::CEffectList *oox_effect_list, CString *change_sheme_color = NULL);
void convert(OOX::Drawing::COuterShadowEffect *oox_shadow, CString *change_sheme_color = NULL);
void convert(OOX::Drawing::CInnerShadowEffect *oox_shadow, CString *change_sheme_color = NULL);
void convert(OOX::Drawing::CEffectList *oox_effect_list, std::wstring *change_sheme_color = NULL);
void convert(OOX::Drawing::COuterShadowEffect *oox_shadow, std::wstring *change_sheme_color = NULL);
void convert(OOX::Drawing::CInnerShadowEffect *oox_shadow, std::wstring *change_sheme_color = NULL);
void convert(OOX::Drawing::CFontCollection *style_font, CString *change_sheme_color = NULL);
void convert(OOX::Drawing::CFontCollection *style_font, std::wstring *change_sheme_color = NULL);
void convert(OOX::Drawing::CFontReference *style_font_ref);
void convert(OOX::Drawing::CStyleMatrixReference *style_matrix_ref);
void convert(OOX::Drawing::CPath2D *oox_geom_path);

View File

@ -62,7 +62,7 @@ namespace Oox2Odf
{
DocxConverter::DocxConverter(const std::wstring & path, const ProgressCallback* CallBack)
{
const OOX::CPath oox_path(CString(path.c_str()));
const OOX::CPath oox_path(std::wstring(path.c_str()));
docx_document = new OOX::CDocx(oox_path);
@ -102,15 +102,15 @@ OOX::CTheme* DocxConverter::oox_theme()
else
return NULL;
}
CString DocxConverter::find_link_by_id (CString sId, int type)
std::wstring DocxConverter::find_link_by_id (std::wstring sId, int type)
{
OOX::CDocument *oox_doc = docx_document->GetDocument();
if (oox_doc == NULL)return L"";
CString ref;
std::wstring ref;
if (ref.GetLength() < 1 && oox_current_child_document_spreadsheet)
if (ref.empty() && oox_current_child_document_spreadsheet)
{
smart_ptr<OOX::File> oFile = oox_current_child_document_spreadsheet->Find(sId);
if (oFile.IsInit())
@ -129,7 +129,7 @@ CString DocxConverter::find_link_by_id (CString sId, int type)
}
}
}
if (ref.GetLength() < 1 && oox_current_child_document)
if (ref.empty() && oox_current_child_document)
{
smart_ptr<OOX::File> oFile = oox_current_child_document->Find(sId);
if (oFile.IsInit())
@ -150,7 +150,7 @@ CString DocxConverter::find_link_by_id (CString sId, int type)
}
smart_ptr<OOX::File> oFile = docx_document->GetDocument()->Find(sId);
if (ref.GetLength() < 1 && oFile.IsInit())
if (ref.empty() && oFile.IsInit())
{
if (type==1 && OOX::FileTypes::Image == oFile->type())
{
@ -2168,7 +2168,7 @@ void DocxConverter::convert(OOX::Logic::CRunProperty *oox_run_pr, odf_writer::st
text_properties->content().style_font_family_asian_= oox_run_pr->m_oRFonts->m_sEastAsia.get();
else convert(oox_run_pr->m_oRFonts->m_oEastAsiaTheme.GetPointer(), text_properties->content().style_font_family_asian_);
//nullable<CString > m_sHAnsi;
//nullable<std::wstring > m_sHAnsi;
//nullable<SimpleTypes::CTheme<>> m_oHAnsiTheme;
//nullable<SimpleTypes::CHint<> > m_oHint;
}
@ -2206,9 +2206,10 @@ void DocxConverter::convert(OOX::Logic::CRunProperty *oox_run_pr, odf_writer::st
BYTE ucB = oox_run_pr->m_oHighlight->m_oVal->Get_B();
BYTE ucG = oox_run_pr->m_oHighlight->m_oVal->Get_G();
SimpleTypes::CHexColor<> *oRgbColor = new SimpleTypes::CHexColor<>(ucR,ucG,ucB);
if (oRgbColor)
if (oRgbColor)
{
std::wstring strColor = L"#" + oRgbColor->ToString().Right(6);
std::wstring strColor = L"#" + oRgbColor->ToString().substr(2);//.Right(6);
text_properties->content().fo_background_color_ = odf_types::color(strColor);
delete oRgbColor;
}
@ -2503,10 +2504,10 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
}
if (!bSet)
{
int pos = oox_pic->m_oShape->m_sType->Find(_T("#_x0000_t"));
int pos = oox_pic->m_oShape->m_sType->find(_T("#_x0000_t"));
if (pos >= 0)
{
sptType = (OOX::Vml::SptType)_wtoi(oox_pic->m_oShape->m_sType->Mid(pos + 9, oox_pic->m_oShape->m_sType->GetLength() - pos - 9).GetString());
sptType = (OOX::Vml::SptType)_wtoi(oox_pic->m_oShape->m_sType->substr(pos + 9, oox_pic->m_oShape->m_sType->length() - pos - 9).c_str());
odf_context()->drawing_context()->start_shape(OOX::Spt2ShapeType(sptType));
bSet = true;
}
@ -2765,20 +2766,20 @@ void DocxConverter::convert(OOX::Drawing::CPicture * oox_picture)
odt_context->drawing_context()->start_drawing();
CString pathImage;
std::wstring pathImage;
double Width=0, Height = 0;
if (oox_picture->m_oBlipFill.m_oBlip.IsInit())
{
CString sID = oox_picture->m_oBlipFill.m_oBlip->m_oEmbed.GetValue();
std::wstring sID = oox_picture->m_oBlipFill.m_oBlip->m_oEmbed.GetValue();
pathImage = find_link_by_id(sID,1);
if (pathImage.GetLength() < 1)
if (pathImage.empty())
{
sID = oox_picture->m_oBlipFill.m_oBlip->m_oLink.GetValue();
//???
}
_graphics_utils_::GetResolution(pathImage, Width, Height);
_graphics_utils_::GetResolution(pathImage.c_str(), Width, Height);
}
odt_context->start_image(pathImage);
{
@ -2839,10 +2840,10 @@ void DocxConverter::convert(OOX::Drawing::CDiagrammParts *oox_diagramm)
if (pDiagData.IsInit())
{
CString strDiagDataPath = pDiagData->filename().m_strFilename;
std::wstring strDiagDataPath = pDiagData->filename().m_strFilename;
XmlUtils::CXmlNode oNodeDiagData;
if (oNodeDiagData.FromXmlFile2(strDiagDataPath))
if (oNodeDiagData.FromXmlFile(strDiagDataPath))
{
XmlUtils::CXmlNode oNode2 = oNodeDiagData.ReadNode(_T("dgm:extLst"));
if (oNode2.IsValid())
@ -3105,9 +3106,10 @@ void DocxConverter::convert(SimpleTypes::CHexColor<> *color,
if (result == true)
{
SimpleTypes::CHexColor<> *oRgbColor = new SimpleTypes::CHexColor<>(ucR,ucG,ucB);
if (oRgbColor)
if ((oRgbColor) && (oRgbColor->GetValue() == SimpleTypes::hexcolorRGB ))
{
std::wstring strColor = L"#" + oRgbColor->ToString().Right(6);
std::wstring strColor = L"#" + oRgbColor->ToString().substr(2);//.Right(6);
odf_color = odf_types::color(strColor);
delete oRgbColor;
@ -3264,11 +3266,11 @@ void DocxConverter::convert(OOX::Logic::CHyperlink *oox_hyperlink)
convert(oox_hyperlink->m_arrItems[i]);
}
}
//nullable<CString > m_sAnchor;
//nullable<CString > m_sDocLocation;
//nullable<std::wstring > m_sAnchor;
//nullable<std::wstring > m_sDocLocation;
//nullable<SimpleTypes::COnOff<SimpleTypes::onoffFalse> > m_oHistory;
//nullable<CString > m_sTgtFrame;
//nullable<CString > m_sTooltip;
//nullable<std::wstring > m_sTgtFrame;
//nullable<std::wstring > m_sTooltip;
}
void DocxConverter::convert(OOX::CDocDefaults *def_style)
@ -3359,10 +3361,10 @@ void DocxConverter::convert(OOX::Numbering::CAbstractNum* oox_num_style)
//// Childs
//std::vector<OOX::Numbering::CLvl > m_arrLvl;
//nullable<ComplexTypes::Word::CMultiLevelType > m_oMultiLevelType;
//nullable<ComplexTypes::Word::CString_ > m_oName;
//nullable<ComplexTypes::Word::std::wstring_ > m_oName;
//nullable<ComplexTypes::Word::CLongHexNumber > m_oNsid;
//nullable<ComplexTypes::Word::CString_ > m_oNumStyleLink;
//nullable<ComplexTypes::Word::CString_ > m_oStyleLink;
//nullable<ComplexTypes::Word::std::wstring_ > m_oNumStyleLink;
//nullable<ComplexTypes::Word::std::wstring_ > m_oStyleLink;
//nullable<ComplexTypes::Word::CLongHexNumber > m_oTmpl;
for (unsigned int i=0; i < oox_num_style->m_arrLvl.size(); i++)
@ -3399,7 +3401,7 @@ void DocxConverter::convert(OOX::Numbering::CLvl* oox_num_lvl)
//// Childs
//nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oIsLgl;
//nullable<ComplexTypes::Word::CLvlLegacy > m_oLegacy;
//nullable<ComplexTypes::Word::CString_ > m_oPStyle;
//nullable<ComplexTypes::Word::std::wstring_ > m_oPStyle;
double size_bullet_number_marker = 0;
if (oox_num_lvl->m_oLvlJc.IsInit())
@ -3715,7 +3717,7 @@ void DocxConverter::convert(OOX::CStyle *oox_style)
odt_context->styles_context()->last_state()->set_parent_style_name(*oox_style->m_oBasedOn->m_sVal);
//nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue>> m_oQFormat;
//nullable<ComplexTypes::Word::CString_ > m_oAliases;
//nullable<ComplexTypes::Word::std::wstring_ > m_oAliases;
}
@ -3861,7 +3863,7 @@ void DocxConverter::convert_endnote(int oox_ref_id)
}
odt_context->end_note();
}
void DocxConverter::convert_hdr_ftr (CString sId)
void DocxConverter::convert_hdr_ftr (std::wstring sId)
{
OOX::CHdrFtr * oox_hdr_ftr = docx_document->GetHeaderOrFooter(sId);
if (oox_hdr_ftr == NULL ) return;
@ -4313,10 +4315,10 @@ bool DocxConverter::convert(OOX::Logic::CTableProperty *oox_table_pr, odf_writer
//}
//nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oBidiVisual;
//nullable<ComplexTypes::Word::CShading > m_oShade;
//nullable<ComplexTypes::Word::CString_ > m_oTblCaption;
//nullable<ComplexTypes::Word::std::wstring_ > m_oTblCaption;
//nullable<OOX::Logic::CTblCellMar > m_oTblCellMar;
//nullable<ComplexTypes::Word::CTblWidth > m_oTblCellSpacing;
//nullable<ComplexTypes::Word::CString_ > m_oTblDescription;
//nullable<ComplexTypes::Word::std::wstring_ > m_oTblDescription;
//nullable<ComplexTypes::Word::CTblLayoutType > m_oTblLayout;
//nullable<ComplexTypes::Word::CTblOverlap > m_oTblOverlap;

View File

@ -147,7 +147,7 @@ namespace Oox2Odf
virtual odf_writer::odf_conversion_context *odf_context();
virtual OOX::CTheme *oox_theme();
virtual CString find_link_by_id (CString sId, int t);
virtual std::wstring find_link_by_id (std::wstring sId, int t);
void convert(OOX::WritingElement *oox_unknown);
private:
@ -179,7 +179,7 @@ namespace Oox2Odf
void convert_footnote (int oox_ref_id);
void convert_endnote (int oox_ref_id);
void convert_comment (int oox_comm_id);
void convert_hdr_ftr (CString sId);
void convert_hdr_ftr (std::wstring sId);
void convert(OOX::Logic::CBackground *oox_background, int type);
void convert(OOX::Logic::CSdt *oox_sdt);

View File

@ -55,7 +55,7 @@ namespace Oox2Odf
XlsxConverter::XlsxConverter(const std::wstring & path, const ProgressCallback* CallBack)
{
const OOX::CPath oox_path(CString(path.c_str()));
const OOX::CPath oox_path(std::wstring(path.c_str()));
xlsx_document = new OOX::Spreadsheet::CXlsx(oox_path);
@ -95,9 +95,9 @@ OOX::CTheme* XlsxConverter::oox_theme()
return NULL;
}
CString XlsxConverter::find_link_by_id (CString sId, int type)
std::wstring XlsxConverter::find_link_by_id (std::wstring sId, int type)
{
CString ref;
std::wstring ref;
if (type==1)
{
if (xlsx_current_drawing)
@ -110,7 +110,7 @@ CString XlsxConverter::find_link_by_id (CString sId, int type)
ref = pImage->filename().GetPath();
}
}
if (ref.GetLength() < 1 && oox_current_child_document)
if (ref.empty() && oox_current_child_document)
{
smart_ptr<OOX::File> oFile = oox_current_child_document->Find(sId);
if (oFile.IsInit() && OOX::Spreadsheet::FileTypes::Image == oFile->type())
@ -120,7 +120,7 @@ CString XlsxConverter::find_link_by_id (CString sId, int type)
ref = pImage->filename().GetPath();
}
}
if (ref.GetLength() < 1 && oox_current_child_document_spreadsheet)
if (ref.empty() && oox_current_child_document_spreadsheet)
{
smart_ptr<OOX::File> oFile = oox_current_child_document_spreadsheet->Find(sId);
if (oFile.IsInit() && OOX::Spreadsheet::FileTypes::Image == oFile->type())
@ -180,7 +180,7 @@ void XlsxConverter::convert_sheets()
if(pSheet->m_oRid.IsInit())
{
CString sSheetRId = pSheet->m_oRid.get2().ToString();
std::wstring sSheetRId = pSheet->m_oRid.get2().ToString();
std::map<std::wstring, OOX::Spreadsheet::CWorksheet*>::iterator pItWorksheet = arrWorksheets.find(sSheetRId);
if (pItWorksheet->second)
@ -741,8 +741,8 @@ void XlsxConverter::convert(OOX::Spreadsheet::CFormula *oox_formula)
//nullable<SimpleTypes::COnOff<>> m_oDt2D;
//nullable<SimpleTypes::COnOff<>> m_oDtr;
//nullable<CString> m_oR1;
//nullable<CString> m_oR2;
//nullable<std::wstring> m_oR1;
//nullable<std::wstring> m_oR2;
}
void XlsxConverter::convert(OOX::Spreadsheet::CCol *oox_column)
{
@ -802,12 +802,12 @@ void XlsxConverter::convert(OOX::Spreadsheet::CCol *oox_column)
void XlsxConverter::convert(OOX::Spreadsheet::CSheetPr *oox_sheet_pr)
{
if (!oox_sheet_pr)return;
//nullable<CString> m_oCodeName;
//nullable<std::wstring> m_oCodeName;
//nullable<SimpleTypes::COnOff<>> m_oEnableFormatConditionsCalculation;
//nullable<SimpleTypes::COnOff<>> m_oFilterMode;
//nullable<SimpleTypes::COnOff<>> m_oPublished;
//nullable<SimpleTypes::COnOff<>> m_oSyncHorizontal;
//nullable<CString> m_oSyncRef;
//nullable<std::wstring> m_oSyncRef;
//nullable<SimpleTypes::COnOff<>> m_oSyncVertical;
//nullable<SimpleTypes::COnOff<>> m_oTransitionEntry;
//nullable<SimpleTypes::COnOff<>> m_oTransitionEvaluation;
@ -902,7 +902,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetViews *oox_sheet_views)
ods_context->settings_context()->add_property(L"ZoomType", L"short", L"0");
if (sheet_view->m_oZoomScale.IsInit())
{
ods_context->settings_context()->add_property(L"ZoomValue", L"int", sheet_view->m_oZoomScale->ToString().GetBuffer());
ods_context->settings_context()->add_property(L"ZoomValue", L"int", sheet_view->m_oZoomScale->ToString());
}else
{
ods_context->settings_context()->add_property(L"ZoomValue", L"int", L"100");
@ -910,7 +910,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetViews *oox_sheet_views)
if (sheet_view->m_oColorId.IsInit() && !sheet_view->m_oDefaultGridColor.IsInit())
{
ods_context->settings_context()->add_property(L"GridColor", L"int", sheet_view->m_oColorId->ToString().GetBuffer());
ods_context->settings_context()->add_property(L"GridColor", L"int", sheet_view->m_oColorId->ToString());
}
bool bPaneX = false;
bool bPaneY = false;
@ -997,12 +997,12 @@ void XlsxConverter::convert(OOX::Spreadsheet::CSheetViews *oox_sheet_views)
}
if (sheet_view->m_oZoomScalePageLayoutView.IsInit())
{
ods_context->settings_context()->add_property(L"PageViewZoomValue", L"int", sheet_view->m_oZoomScalePageLayoutView->ToString().GetBuffer());
ods_context->settings_context()->add_property(L"PageViewZoomValue", L"int", sheet_view->m_oZoomScalePageLayoutView->ToString());
}
//nullable<SimpleTypes::COnOff<>> m_oDefaultGridColor;
//nullable<SimpleTypes::COnOff<>> m_oShowRuler;
//nullable<SimpleTypes::COnOff<>> m_oShowWhiteSpace;
//nullable<CString> m_oTopLeftCell;
//nullable<std::wstring> m_oTopLeftCell;
//nullable<SimpleTypes::Spreadsheet::CSheetViewType<>> m_oView;
//nullable<SimpleTypes::COnOff<>> m_oWindowProtection;
//nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oZoomScaleNormal;
@ -1923,7 +1923,7 @@ void XlsxConverter::convert(OOX::Spreadsheet::CGraphicFrame* oox_graphic_frame)
if (oox_graphic_frame->m_oChartGraphic->m_oGraphicData->m_oChart.IsInit() && oox_graphic_frame->m_oChartGraphic->m_oGraphicData->m_oChart->m_oRId.IsInit())
{
//диаграмма
CString sId = oox_graphic_frame->m_oChartGraphic->m_oGraphicData->m_oChart->m_oRId->GetValue();
std::wstring sId = oox_graphic_frame->m_oChartGraphic->m_oGraphicData->m_oChart->m_oRId->GetValue();
smart_ptr<OOX::File> oFile = xlsx_current_drawing->Find(sId);
if (oFile.IsInit() && OOX::Spreadsheet::FileTypes::Charts == oFile->type())
@ -2009,20 +2009,20 @@ void XlsxConverter::convert(OOX::Spreadsheet::CPic* oox_picture)
ods_context->drawing_context()->start_drawing();
CString pathImage;
std::wstring pathImage;
double Width=0, Height = 0;
if (oox_picture->m_oBlipFill->m_oBlip.IsInit())
{
CString sID = oox_picture->m_oBlipFill->m_oBlip->m_oEmbed.GetValue();
std::wstring sID = oox_picture->m_oBlipFill->m_oBlip->m_oEmbed.GetValue();
pathImage = find_link_by_id(sID,1);
if (pathImage.GetLength() < 1)
if (pathImage.empty())
{
sID = oox_picture->m_oBlipFill->m_oBlip->m_oLink.GetValue();
//???
}
_graphics_utils_::GetResolution(pathImage, Width, Height);
_graphics_utils_::GetResolution(pathImage.c_str(), Width, Height);
}
ods_context->start_image(pathImage);
{

View File

@ -137,7 +137,7 @@ namespace Oox2Odf
virtual odf_writer::odf_conversion_context *odf_context();
virtual OOX::CTheme *oox_theme();
virtual CString find_link_by_id (CString sId, int t);
virtual std::wstring find_link_by_id (std::wstring sId, int t);
void convert(OOX::Spreadsheet::WritingElement *oox_unknown);
private:
@ -215,4 +215,4 @@ namespace Oox2Odf
void convert_sharing_string(int number);
};
}
}

View File

@ -472,7 +472,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@ -513,7 +513,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;

View File

@ -90,7 +90,7 @@ HRESULT COfficePPTFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDs
{
if (m_strTempDirectory.length() < 1)
{
m_strTempDirectory = FileSystem::Directory::GetTempPath().GetBuffer();
m_strTempDirectory = NSDirectory::GetTempPath();
}
bool bRes = OpenFile(sSrcFileName);
@ -113,14 +113,12 @@ HRESULT COfficePPTFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDs
return S_OK;
}
CString COfficePPTFile::GetDirectory(CString strFileName)
std::wstring COfficePPTFile::GetDirectory(std::wstring strFileName)
{
int nIndex = strFileName.ReverseFind(FILE_SEPARATOR_CHAR);
int nIndex = strFileName.rfind(FILE_SEPARATOR_CHAR);
if (-1 != nIndex)
{
return strFileName.Mid(0, nIndex + 1);
return strFileName.substr(0, nIndex + 1);
}
return strFileName;
}

View File

@ -54,7 +54,7 @@ private:
void* m_pReader;
std::vector<CString> m_arUserSources;
std::vector<std::wstring> m_arUserSources;
std::wstring m_strTempDirectory;
@ -78,6 +78,6 @@ private:
bool CloseFile();
CString GetDirectory(CString strFileName);
std::wstring GetDirectory(std::wstring strFileName);
};

View File

@ -36,9 +36,8 @@
#include "../../../ASCOfficePPTXFile/Editor/DefaultNotesMaster.h"
#include "../../../ASCOfficePPTXFile/Editor/DefaultNotesTheme.h"
#include "../../../Common/DocxFormat/Source/SystemUtility/File.h"
#include "../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h"
#include "../../../DesktopEditor/common/Directory.h"
#include "../Reader/PPTDocumentInfo.h"
@ -51,14 +50,14 @@ namespace NSPresentationEditor
{
namespace NSPPTXWriterConst
{
static CString g_string_rels_presentation = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
static std::wstring g_string_rels_presentation = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
<Relationship Id=\"rId3\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"docProps/core.xml\"/>\
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"ppt/presentation.xml\"/>\
<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties\" Target=\"docProps/app.xml\"/>\
</Relationships>");
static CString g_string_core = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
static std::wstring g_string_core = _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\">\
<dc:title>Slide 1</dc:title>\
<dc:creator>OnlyOffice</dc:creator>\
@ -71,8 +70,8 @@ namespace NSPresentationEditor
NSPresentationEditor::CPPTXWriter::CPPTXWriter()
{
m_strTempDirectory = FileSystem::Directory::GetTempPath() + FILE_SEPARATOR_STR + _T("TempPPTX");
m_strDstFileName = FileSystem::Directory::GetTempPath() + FILE_SEPARATOR_STR + _T("Test.pptx");
m_strTempDirectory = NSDirectory::GetTempPath() + FILE_SEPARATOR_STR + _T("TempPPTX");
m_strDstFileName = NSDirectory::GetTempPath() + FILE_SEPARATOR_STR + _T("Test.pptx");
m_pDocument = NULL;
m_pUserInfo = NULL;
@ -99,12 +98,12 @@ void NSPresentationEditor::CPPTXWriter::CreateFile(CPPTUserInfo* pUserInfo )
m_pShapeWriter->InitNextId();
FileSystem::Directory::CreateDirectory(m_strTempDirectory);
NSDirectory::CreateDirectory(m_strTempDirectory);
CFile oFile;
CString strMemory = _T("");
std::wstring strMemory = _T("");
// _rels
FileSystem::Directory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("_rels"));
NSDirectory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("_rels"));
oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR + _T(".rels"));
strMemory = NSPPTXWriterConst::g_string_rels_presentation;
@ -112,7 +111,7 @@ void NSPresentationEditor::CPPTXWriter::CreateFile(CPPTUserInfo* pUserInfo )
oFile.CloseFile();
// docProps
FileSystem::Directory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("docProps"));
NSDirectory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("docProps"));
// core
oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("docProps") + FILE_SEPARATOR_STR + _T("core.xml"));
@ -129,7 +128,7 @@ void NSPresentationEditor::CPPTXWriter::CreateFile(CPPTUserInfo* pUserInfo )
WriteContentTypes();
// ppt
FileSystem::Directory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt"));
NSDirectory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt"));
WritePresInfo();
WriteAll();
@ -143,12 +142,12 @@ void NSPresentationEditor::CPPTXWriter::CreateFile(CDocument* pDocument)
m_pShapeWriter->InitNextId();
FileSystem::Directory::CreateDirectory(m_strTempDirectory);
NSDirectory::CreateDirectory(m_strTempDirectory);
CFile oFile;
CString strMemory = _T("");
std::wstring strMemory = _T("");
// _rels
FileSystem::Directory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("_rels"));
NSDirectory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("_rels"));
oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR + _T(".rels"));
strMemory = NSPPTXWriterConst::g_string_rels_presentation;
@ -156,7 +155,7 @@ void NSPresentationEditor::CPPTXWriter::CreateFile(CDocument* pDocument)
oFile.CloseFile();
// docProps
FileSystem::Directory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("docProps"));
NSDirectory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("docProps"));
// core
oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("docProps") + FILE_SEPARATOR_STR + _T("core.xml"));
@ -173,7 +172,7 @@ void NSPresentationEditor::CPPTXWriter::CreateFile(CDocument* pDocument)
WriteContentTypes();
// ppt
FileSystem::Directory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt"));
NSDirectory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt"));
WritePresInfo();
WriteAll();
@ -187,7 +186,7 @@ void NSPresentationEditor::CPPTXWriter::CloseFile()
void NSPresentationEditor::CPPTXWriter::WriteContentTypes()
{
CString strContentTypes = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
std::wstring strContentTypes = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\">\
<Default Extension=\"bmp\" ContentType=\"image/bmp\" />\
<Default Extension=\"png\" ContentType=\"image/png\" />\
@ -211,24 +210,22 @@ void NSPresentationEditor::CPPTXWriter::WriteContentTypes()
int nIndexLayout = 0;
for (int nT = 0; nT < nThemes; ++nT)
{
CString strTheme = _T("");
strTheme.Format(_T("<Override PartName=\"/ppt/theme/theme%d.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\" />\
<Override PartName=\"/ppt/slideMasters/slideMaster%d.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml\" />"),
nT + 1, nT + 1);
strContentTypes += L"<Override PartName=\"/ppt/theme/theme" + std::to_wstring(nT + 1) +
L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\" />\
<Override PartName=\"/ppt/slideMasters/slideMaster" + std::to_wstring(nT + 1) +
L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml\"/>";
strContentTypes += strTheme;
int nCountL = (int)m_pDocument->m_arThemes[nT].m_arLayouts.size();
for (int nL = 0; nL < nCountL; ++nL, ++nIndexLayout)
{
CString strL = _T("");
strL.Format(_T("<Override PartName=\"/ppt/slideLayouts/slideLayout%d.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\" />"), nIndexLayout + 1);
strContentTypes += strL;
strContentTypes += L"<Override PartName=\"/ppt/slideLayouts/slideLayout" + std::to_wstring(nIndexLayout + 1) +
L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml\"/>";
}
}
CString strNotesTheme = _T("");
strNotesTheme.Format(_T("<Override PartName=\"/ppt/theme/theme%d.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\" />"),
nThemes + 1);
std::wstring strNotesTheme = L"<Override PartName=\"/ppt/theme/theme" + std::to_wstring(nThemes + 1) + L".xml\" \
ContentType=\"application/vnd.openxmlformats-officedocument.theme+xml\"/>";
strContentTypes += strNotesTheme;
strContentTypes += _T("<Override PartName=\"/ppt/notesMasters/notesMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml\"/>");
@ -236,13 +233,11 @@ void NSPresentationEditor::CPPTXWriter::WriteContentTypes()
int nCountS = (int)m_pDocument->m_arSlides.size();
for (int nS = 0; nS < nCountS; ++nS)
{
CString strS = _T("");
strS.Format(_T("<Override PartName=\"/ppt/slides/slide%d.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\" />"), nS + 1);
strContentTypes += strS;
strContentTypes += L"<Override PartName=\"/ppt/slides/slide" + std::to_wstring( nS + 1)
+ L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.slide+xml\"/>";
CString strN = _T("");
strN.Format(_T("<Override PartName=\"/ppt/notesSlides/notesSlide%d.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml\"/>"), nS + 1);
strContentTypes += strN;
strContentTypes += L"<Override PartName=\"/ppt/notesSlides/notesSlide" + std::to_wstring( nS + 1)
+ L".xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml\"/>";
}
strContentTypes += _T("</Types>");
@ -256,7 +251,7 @@ void NSPresentationEditor::CPPTXWriter::WriteContentTypes()
void NSPresentationEditor::CPPTXWriter::WriteApp(CFile& oFile)
{
CString str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
std::wstring str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<Properties xmlns=\"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\" xmlns:vt=\"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes\">\
<TotalTime>0</TotalTime>\
<Words>0</Words>\
@ -266,48 +261,39 @@ void NSPresentationEditor::CPPTXWriter::WriteApp(CFile& oFile)
oFile.WriteStringUTF8(str1);
CString str2 = _T("");
str2.Format(_T("<Slides>%d</Slides>"), (int)m_pDocument->m_arSlides.size());
oFile.WriteStringUTF8(str2);
oFile.WriteStringUTF8(L"<Slides>" + std::to_wstring(m_pDocument->m_arSlides.size()) + L"</Slides>");
CString str3 = _T("<Notes>0</Notes>\
<HiddenSlides>0</HiddenSlides>\
<MMClips>2</MMClips>\
<ScaleCrop>false</ScaleCrop>\
<HeadingPairs>\
<vt:vector size=\"4\" baseType=\"variant\">");
oFile.WriteStringUTF8(str3);
oFile.WriteStringUTF8(L"<Notes>0</Notes>\
<HiddenSlides>0</HiddenSlides>\
<MMClips>2</MMClips>\
<ScaleCrop>false</ScaleCrop>\
<HeadingPairs>\
<vt:vector size=\"4\" baseType=\"variant\">");
int nCountThemes = (int)m_pDocument->m_arThemes.size();
int nCountSlides = (int)m_pDocument->m_arSlides.size();
CString strThemes = _T("");
strThemes.Format(_T("<vt:variant><vt:lpstr>Theme</vt:lpstr></vt:variant><vt:variant><vt:i4>%d</vt:i4></vt:variant>"), nCountThemes);
std::wstring strThemes = L"<vt:variant><vt:lpstr>Theme</vt:lpstr></vt:variant><vt:variant><vt:i4>" +std::to_wstring(nCountThemes) +
L"</vt:i4></vt:variant>";
CString strSlides = _T("");
strSlides.Format(_T("<vt:variant><vt:lpstr>Slide Titles</vt:lpstr></vt:variant><vt:variant><vt:i4>%d</vt:i4></vt:variant></vt:vector></HeadingPairs>"), nCountSlides);
std::wstring strSlides = L"<vt:variant><vt:lpstr>Slide Titles</vt:lpstr></vt:variant><vt:variant><vt:i4>" +
std::to_wstring(nCountSlides) + L"</vt:i4></vt:variant></vt:vector></HeadingPairs>";
CString str4 = _T("");
str4.Format(_T("<TitlesOfParts><vt:vector size=\"%d\" baseType=\"lpstr\">"), nCountSlides + nCountThemes);
std::wstring strTitles = L"<TitlesOfParts><vt:vector size=\"" + std::to_wstring(nCountSlides + nCountThemes) + L"\" baseType=\"lpstr\">";
str4 = strThemes + strSlides + str4;
oFile.WriteStringUTF8(str4);
oFile.WriteStringUTF8(strThemes + strSlides + strTitles);
CString strMemory = _T("");
std::wstring strMemory = _T("");
for (int i = 1; i <= nCountThemes; ++i)
{
CString strMem = _T("");
strMem.Format(_T("<vt:lpstr>Theme %d</vt:lpstr>"), i);
strMemory += strMem;
strMemory += L"<vt:lpstr>Theme " + std::to_wstring(i) + L"</vt:lpstr>";
}
for (int i = 1; i <= nCountSlides; ++i)
{
CString strMem = _T("");
strMem.Format(_T("<vt:lpstr>Slide %d</vt:lpstr>"), i);
strMemory += strMem;
strMemory += L"<vt:lpstr>Slide " + std::to_wstring(i) + L"</vt:lpstr>";
}
CString str5 = _T("</vt:vector>\
std::wstring str5 = _T("</vt:vector>\
</TitlesOfParts>\
<Company></Company>\
<LinksUpToDate>false</LinksUpToDate>\
@ -325,113 +311,101 @@ void NSPresentationEditor::CPPTXWriter::WritePresInfo()
{
CFile oFile;
// tableStyles.xml
// tableStyles.xml
oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("tableStyles.xml"));
CString str = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<a:tblStyleLst xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" def=\"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}\" />");
oFile.WriteStringUTF8(str);
oFile.WriteStringUTF8(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<a:tblStyleLst xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" def=\"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}\"/>");
oFile.CloseFile();
// presProps.xml
str = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<p:presentationPr xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\
<p:extLst><p:ext uri=\"{E76CE94A-603C-4142-B9EB-6D1370010A27}\">\
<p14:discardImageEditData xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"0\" /></p:ext>\
<p:ext uri=\"{D31A062A-798A-4329-ABDD-BBA856620510}\">\
<p14:defaultImageDpi xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"220\" />\
</p:ext></p:extLst></p:presentationPr>");
// presProps.xml
oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("presProps.xml"));
oFile.WriteStringUTF8(str);
oFile.WriteStringUTF8(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<p:presentationPr xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\
<p:extLst><p:ext uri=\"{E76CE94A-603C-4142-B9EB-6D1370010A27}\">\
<p14:discardImageEditData xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"0\" /></p:ext>\
<p:ext uri=\"{D31A062A-798A-4329-ABDD-BBA856620510}\">\
<p14:defaultImageDpi xmlns:p14=\"http://schemas.microsoft.com/office/powerpoint/2010/main\" val=\"220\" />\
</p:ext></p:extLst></p:presentationPr>");
oFile.CloseFile();
// viewProps.xml
str = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<p:viewPr xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\
<p:normalViewPr><p:restoredLeft sz=\"15620\"/><p:restoredTop sz=\"94660\"/></p:normalViewPr><p:slideViewPr><p:cSldViewPr><p:cViewPr varScale=\"1\">\
<p:scale><a:sx n=\"104\" d=\"100\"/><a:sy n=\"104\" d=\"100\"/></p:scale><p:origin x=\"-1236\" y=\"-90\"/></p:cViewPr><p:guideLst>\
<p:guide orient=\"horz\" pos=\"2160\"/><p:guide pos=\"2880\"/></p:guideLst></p:cSldViewPr></p:slideViewPr><p:notesTextViewPr><p:cViewPr><p:scale>\
<a:sx n=\"1\" d=\"1\"/><a:sy n=\"1\" d=\"1\"/></p:scale><p:origin x=\"0\" y=\"0\"/></p:cViewPr></p:notesTextViewPr><p:gridSpacing cx=\"72008\" cy=\"72008\"/></p:viewPr>");
// viewProps.xml
oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("viewProps.xml"));
oFile.WriteStringUTF8(str);
oFile.WriteStringUTF8(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<p:viewPr xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\
<p:normalViewPr><p:restoredLeft sz=\"15620\"/><p:restoredTop sz=\"94660\"/></p:normalViewPr><p:slideViewPr><p:cSldViewPr><p:cViewPr varScale=\"1\">\
<p:scale><a:sx n=\"104\" d=\"100\"/><a:sy n=\"104\" d=\"100\"/></p:scale><p:origin x=\"-1236\" y=\"-90\"/></p:cViewPr><p:guideLst>\
<p:guide orient=\"horz\" pos=\"2160\"/><p:guide pos=\"2880\"/></p:guideLst></p:cSldViewPr></p:slideViewPr><p:notesTextViewPr><p:cViewPr><p:scale>\
<a:sx n=\"1\" d=\"1\"/><a:sy n=\"1\" d=\"1\"/></p:scale><p:origin x=\"0\" y=\"0\"/></p:cViewPr></p:notesTextViewPr><p:gridSpacing cx=\"72008\" cy=\"72008\"/></p:viewPr>");
oFile.CloseFile();
// presentation.xml + _rels/presentation.xml.rels
CString strPresRels;
std::wstring strPresRels;
CString strPresMasters = _T("");
CString strPresSlides = _T("");
std::wstring strPresMasters = _T("");
std::wstring strPresSlides = _T("");
size_t nCountLayouts = 0;
size_t nCountThemes = m_pDocument->m_arThemes.size();
for (size_t nIndexTheme = 0; nIndexTheme < nCountThemes; ++nIndexTheme)
{
CString strRels = _T("");
strRels.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"slideMasters/slideMaster%d.xml\" />"), 2 * nIndexTheme + 1, nIndexTheme + 1);
strPresRels += strRels;
strPresRels += L"<Relationship Id=\"rId" + std::to_wstring(2 * nIndexTheme + 1) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"slideMasters/slideMaster" +
std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
strRels = _T("");
strRels.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"theme/theme%d.xml\" />"), 2 * nIndexTheme + 2, nIndexTheme + 1);
strPresRels += strRels;
strPresRels += L"<Relationship Id=\"rId" + std::to_wstring(2 * nIndexTheme + 2) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"theme/theme" +
std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
strRels = _T("");
strRels.Format(_T("<p:sldMasterId id=\"%u\" r:id=\"rId%d\" />"), 0x80000000 + nCountLayouts, 2 * nIndexTheme + 1);
nCountLayouts += m_pDocument->m_arThemes[nIndexTheme].m_arLayouts.size();
strPresMasters += L"<p:sldMasterId id=\"" + std::to_wstring(0x80000000 + nCountLayouts) + L"\" r:id=\"rId" + std::to_wstring(2 * nIndexTheme + 1) + L"\"/>";
nCountLayouts += m_pDocument->m_arThemes[nIndexTheme].m_arLayouts.size();
nCountLayouts += 1;
strPresMasters += strRels;
}
int nCurrentRels = (int)(2 * nCountThemes + 1);
size_t nCountSlides = m_pDocument->m_arSlides.size();
for (size_t nIndexSlide = 0; nIndexSlide < nCountSlides; ++nIndexSlide, ++nCurrentRels)
{
CString strRels = _T("");
strRels.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slides/slide%d.xml\" />"), nCurrentRels, nIndexSlide + 1);
strPresRels += strRels;
strPresRels += L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slides/slide" +
std::to_wstring(nIndexSlide + 1) + L".xml\" />";
strRels = _T("");
strRels.Format(_T("<p:sldId id=\"%d\" r:id=\"rId%d\" />"), 256 + nIndexSlide, nCurrentRels);
strPresSlides += strRels;
strPresSlides += L"<p:sldId id=\"" + std::to_wstring(256 + nIndexSlide) + L"\" r:id=\"rId" + std::to_wstring(nCurrentRels) + L"\"/>";
}
CString strNotesIDs = _T("");
strNotesIDs.Format(_T("<p:notesMasterIdLst><p:notesMasterId r:id=\"rId%d\"/></p:notesMasterIdLst>"), nCurrentRels);
std::wstring strNotesIDs = L"<p:notesMasterIdLst><p:notesMasterId r:id=\"rId" + std::to_wstring(nCurrentRels) + L"\"/></p:notesMasterIdLst>";
CString strRels0 = _T("");
strRels0.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>"), nCurrentRels);
std::wstring strRels0 = L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>";
++nCurrentRels;
CString strRels1 = _T("");
strRels1.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\" Target=\"presProps.xml\" />"), nCurrentRels++);
CString strRels2 = _T("");
strRels2.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles\" Target=\"tableStyles.xml\" />"), nCurrentRels++);
CString strRels3 = _T("");
strRels3.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\" Target=\"viewProps.xml\" />"), nCurrentRels++);
std::wstring strRels1 = L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\" Target=\"presProps.xml\"/>";
std::wstring strRels2 = L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles\" Target=\"tableStyles.xml\"/>";
std::wstring strRels3 = L"<Relationship Id=\"rId" + std::to_wstring(nCurrentRels++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\" Target=\"viewProps.xml\"/>";
strPresRels = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">") + strPresRels + strRels0 + strRels1 + strRels2 + strRels3 + _T("</Relationships>");
CString strPptRels = m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("_rels");
FileSystem::Directory::CreateDirectory(strPptRels);
std::wstring strPptRels = m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("_rels");
NSDirectory::CreateDirectory(strPptRels);
oFile.CreateFile(strPptRels + FILE_SEPARATOR_STR + _T("presentation.xml.rels"));
oFile.WriteStringUTF8(strPresRels);
oFile.CloseFile();
CString strSizePres = _T("");
strSizePres.Format(_T("<p:sldSz cx=\"%d\" cy=\"%d\" type=\"screen4x3\" /><p:notesSz cx=\"%d\" cy=\"%d\" />"),
m_pDocument->m_oInfo.m_lUnitsHor, m_pDocument->m_oInfo.m_lUnitsVer, m_pDocument->m_oInfo.m_lUnitsVer, m_pDocument->m_oInfo.m_lUnitsHor);
std::wstring strSizePres = L"<p:sldSz cx=\"" + std::to_wstring(m_pDocument->m_oInfo.m_lUnitsHor) +
L"\" cy=\"" + std::to_wstring(m_pDocument->m_oInfo.m_lUnitsVer) +
L"\" type=\"screen4x3\" /><p:notesSz cx=\"" + std::to_wstring(m_pDocument->m_oInfo.m_lUnitsVer) +
L"\" cy=\"" + std::to_wstring(m_pDocument->m_oInfo.m_lUnitsHor) + L"\"/>";
CString strDefaultTextStyle = _T("<p:defaultTextStyle>");
if (m_pDocument->m_arThemes.size()>0)
std::wstring strDefaultTextStyle = _T("<p:defaultTextStyle>");
if (m_pDocument->m_arThemes.size() > 0)
{
strDefaultTextStyle += CStylesWriter::ConvertStyles(m_pDocument->m_arThemes[0].m_pStyles[0], m_pDocument->m_oInfo, 9);
}
strDefaultTextStyle += _T("</p:defaultTextStyle>");
CString strPres = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>");
std::wstring strPres = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>");
strPres += _T("<p:presentation xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\" saveSubsetFonts=\"1\"");
if ((m_pUserInfo) && (m_pUserInfo->m_bRtl))
{
@ -452,44 +426,41 @@ void NSPresentationEditor::CPPTXWriter::WritePresInfo()
void NSPresentationEditor::CPPTXWriter::WriteAll()
{
CString strPptDirectory = m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR ;
std::wstring strPptDirectory = m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR ;
FileSystem::Directory::CreateDirectory(strPptDirectory + _T("media"));
FileSystem::Directory::CreateDirectory(strPptDirectory + _T("theme"));
FileSystem::Directory::CreateDirectory(strPptDirectory + _T("slideMasters"));
FileSystem::Directory::CreateDirectory(strPptDirectory + _T("slideMasters") + FILE_SEPARATOR_STR + _T("_rels"));
FileSystem::Directory::CreateDirectory(strPptDirectory + _T("slideLayouts"));
FileSystem::Directory::CreateDirectory(strPptDirectory + _T("slideLayouts") + FILE_SEPARATOR_STR + _T("_rels"));
FileSystem::Directory::CreateDirectory(strPptDirectory + _T("slides"));
FileSystem::Directory::CreateDirectory(strPptDirectory + _T("slides") + FILE_SEPARATOR_STR + _T("_rels"));
FileSystem::Directory::CreateDirectory(strPptDirectory + _T("notesMasters"));
FileSystem::Directory::CreateDirectory(strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR + _T("_rels"));
FileSystem::Directory::CreateDirectory(strPptDirectory + _T("notesSlides"));
FileSystem::Directory::CreateDirectory(strPptDirectory + _T("notesSlides") + FILE_SEPARATOR_STR + _T("_rels"));
NSDirectory::CreateDirectory(strPptDirectory + _T("media"));
NSDirectory::CreateDirectory(strPptDirectory + _T("theme"));
NSDirectory::CreateDirectory(strPptDirectory + _T("slideMasters"));
NSDirectory::CreateDirectory(strPptDirectory + _T("slideMasters") + FILE_SEPARATOR_STR + _T("_rels"));
NSDirectory::CreateDirectory(strPptDirectory + _T("slideLayouts"));
NSDirectory::CreateDirectory(strPptDirectory + _T("slideLayouts") + FILE_SEPARATOR_STR + _T("_rels"));
NSDirectory::CreateDirectory(strPptDirectory + _T("slides"));
NSDirectory::CreateDirectory(strPptDirectory + _T("slides") + FILE_SEPARATOR_STR + _T("_rels"));
NSDirectory::CreateDirectory(strPptDirectory + _T("notesMasters"));
NSDirectory::CreateDirectory(strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR + _T("_rels"));
NSDirectory::CreateDirectory(strPptDirectory + _T("notesSlides"));
NSDirectory::CreateDirectory(strPptDirectory + _T("notesSlides") + FILE_SEPARATOR_STR + _T("_rels"));
CString strNotesTheme = _T("");
strNotesTheme.Format(_T("theme%d.xml"), (int)m_pDocument->m_arThemes.size() + 1);
std::wstring strNotesTheme = L"theme" + std::to_wstring((int)m_pDocument->m_arThemes.size() + 1) + L".xml";
strNotesTheme = strPptDirectory + _T("theme") + FILE_SEPARATOR_STR + strNotesTheme;
Writers::DefaultNotesThemeWriter writerNotesTheme;
writerNotesTheme.Write( strNotesTheme);
CString strNotesMaster = strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR + _T("notesMaster1.xml");
std::wstring strNotesMaster = strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR + _T("notesMaster1.xml");
Writers::DefaultNotesMasterWriter writerNotesMaster;
writerNotesMaster.Write(strNotesMaster);
CString strNotesMasterRels = strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR +_T("_rels");
FileSystem::Directory::CreateDirectory(strNotesMasterRels);
std::wstring strNotesMasterRels = strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR +_T("_rels");
NSDirectory::CreateDirectory(strNotesMasterRels);
CString strThemeNotesNum = _T("");
strThemeNotesNum.Format(_T("%d"), (int)m_pDocument->m_arThemes.size() + 1);
std::wstring strThemeNotesNum = std::to_wstring((int)m_pDocument->m_arThemes.size() + 1);
CString strVal = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
std::wstring strVal = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme") + strThemeNotesNum + _T(".xml\"/></Relationships>");
CString strNotesMasterRelsFile = strNotesMasterRels+ FILE_SEPARATOR_STR + _T("notesMaster1.xml.rels");
std::wstring strNotesMasterRelsFile = strNotesMasterRels+ FILE_SEPARATOR_STR + _T("notesMaster1.xml.rels");
CFile oFileRels;
oFileRels.CreateFile(strNotesMasterRelsFile);
oFileRels.WriteStringUTF8(strVal);
@ -503,7 +474,7 @@ void NSPresentationEditor::CPPTXWriter::WriteAll()
void NSPresentationEditor::CPPTXWriter::WriteThemes()
{
CString strPptDirectory = m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR ;
std::wstring strPptDirectory = m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR ;
int nCount = (int)m_pDocument->m_arThemes.size();
int nStartLayout = 0;
@ -512,8 +483,7 @@ void NSPresentationEditor::CPPTXWriter::WriteThemes()
{
CTheme* pTheme = &m_pDocument->m_arThemes[nIndexTheme];
CString strThemeFile;
strThemeFile.Format(_T("theme%d.xml"), nIndexTheme + 1);
std::wstring strThemeFile = L"theme" + std::to_wstring(nIndexTheme + 1) + L".xml";
strThemeFile = strPptDirectory + _T("theme") + FILE_SEPARATOR_STR + strThemeFile;
CFile oFile;
@ -588,7 +558,7 @@ void NSPresentationEditor::CPPTXWriter::WriteThemes()
oRels.StartMaster(nIndexTheme, nStartLayout, nCountLayouts);
CStringWriter oWriter;
CString str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
std::wstring str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<p:sldMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\
<p:cSld>");
oWriter.WriteString(str1);
@ -597,7 +567,7 @@ void NSPresentationEditor::CPPTXWriter::WriteThemes()
{
WriteBackground(oWriter, oRels, pTheme->m_oBackground);
}
CString strElems = _T("<p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr>\
std::wstring strElems = _T("<p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr>\
<a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>");
oWriter.WriteString(strElems);
@ -615,7 +585,7 @@ void NSPresentationEditor::CPPTXWriter::WriteThemes()
oWriter.WriteString(std::wstring(L"</p:spTree></p:cSld>"));
CString strOverrideColorScheme = _T("<p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/>");
std::wstring strOverrideColorScheme = _T("<p:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/>");
oWriter.WriteString(strOverrideColorScheme);
oWriter.WriteString(std::wstring(L"<p:sldLayoutIdLst>"));
@ -623,9 +593,7 @@ void NSPresentationEditor::CPPTXWriter::WriteThemes()
size_t __nCountLayouts = 0;
for (int nIndexLayout = 0; nIndexLayout < nCountLayouts; ++nIndexLayout)
{
CString strMasterLayout = _T("");
strMasterLayout.Format(_T("<p:sldLayoutId id=\"%u\" r:id=\"rId%d\"/>"), 0x80000000 + nIndexTheme + 1 + nStartLayout + nIndexLayout, nIndexLayout + 1);
oWriter.WriteString(strMasterLayout);
oWriter.WriteString(L"<p:sldLayoutId id=\"" + std::to_wstring(0x80000000 + nIndexTheme + 1 + nStartLayout + nIndexLayout) + L"\" r:id=\"rId" + std::to_wstring(nIndexLayout + 1) + L"\"/>");
WriteLayout(pTheme->m_arLayouts[nIndexLayout], nIndexLayout, nStartLayout, nIndexTheme);
}
@ -658,19 +626,17 @@ void NSPresentationEditor::CPPTXWriter::WriteThemes()
oWriter.WriteString(std::wstring(L"</p:txStyles></p:sldMaster>"));
CString strSlideMasterFile;
strSlideMasterFile.Format(_T("slideMaster%d.xml"), nIndexTheme + 1);
std::wstring strSlideMasterFile = L"slideMaster" + std::to_wstring(nIndexTheme + 1) + L".xml";
strSlideMasterFile = strPptDirectory + _T("slideMasters") + FILE_SEPARATOR_STR + strSlideMasterFile;
oFile.CreateFile(strSlideMasterFile);
CString strMaster = oWriter.GetData();
std::wstring strMaster = oWriter.GetData();
oFile.WriteStringUTF8(strMaster);
oFile.CloseFile();
oRels.CloseRels();
CString strSlideMasterRelsFile;
strSlideMasterRelsFile.Format(_T("slideMaster%d.xml.rels"), nIndexTheme + 1);
std::wstring strSlideMasterRelsFile = L"slideMaster" + std::to_wstring(nIndexTheme + 1) + L".xml.rels";
strSlideMasterRelsFile = strPptDirectory + _T("slideMasters") + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR + strSlideMasterRelsFile;
oRels.SaveRels(strSlideMasterRelsFile);
@ -683,66 +649,53 @@ void NSPresentationEditor::CPPTXWriter::WriteColorScheme(CStringWriter& oStringW
{
if (colors.size() < 1)
{
oStringWriter.WriteString(std::wstring(L"<a:clrScheme name=\"Default\"><a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/>\
oStringWriter.WriteString(L"<a:clrScheme name=\"Default\"><a:dk1><a:sysClr val=\"windowText\" lastClr=\"000000\"/>\
</a:dk1><a:lt1><a:sysClr val=\"window\" lastClr=\"FFFFFF\"/></a:lt1><a:dk2><a:srgbClr val=\"1F497D\"/></a:dk2><a:lt2>\
<a:srgbClr val=\"EEECE1\"/></a:lt2><a:accent1><a:srgbClr val=\"4F81BD\"/></a:accent1><a:accent2><a:srgbClr val=\"C0504D\"/>\
</a:accent2><a:accent3><a:srgbClr val=\"9BBB59\"/></a:accent3><a:accent4><a:srgbClr val=\"8064A2\"/></a:accent4><a:accent5>\
<a:srgbClr val=\"4BACC6\"/></a:accent5><a:accent6><a:srgbClr val=\"F79646\"/></a:accent6><a:hlink><a:srgbClr val=\"0000FF\"/>\
</a:hlink><a:folHlink><a:srgbClr val=\"800080\"/></a:folHlink></a:clrScheme>"));
</a:hlink><a:folHlink><a:srgbClr val=\"800080\"/></a:folHlink></a:clrScheme>");
return;
}
if (extra)
oStringWriter.WriteString(std::wstring(L"<a:extraClrScheme>"));
oStringWriter.WriteString(L"<a:extraClrScheme>");
oStringWriter.WriteString(std::wstring(L"<a:clrScheme name=\""));
oStringWriter.WriteString(L"<a:clrScheme name=\"");
oStringWriter.WriteStringXML(name);
oStringWriter.WriteString(std::wstring(L"\">"));
CString strVal;
oStringWriter.WriteString(L"\">");
strVal.Format(_T("<a:dk1><a:srgbClr val=\"%06X\"/></a:dk1>"), colors[14].GetLONG_RGB());
oStringWriter.WriteString(strVal);
oStringWriter.WriteString(L"<a:dk1><a:srgbClr val=\"" + XmlUtils::IntToString(colors[14].GetLONG_RGB(), L"%06X") + L"\"/></a:dk1>");
strVal.Format(_T("<a:lt1><a:srgbClr val=\"%06X\"/></a:lt1>"), colors[13].GetLONG_RGB());
oStringWriter.WriteString(strVal);
oStringWriter.WriteString(L"<a:lt1><a:srgbClr val=\"%" + XmlUtils::IntToString(colors[13].GetLONG_RGB(), L"%06X") + L"\"/></a:lt1>");
strVal.Format(_T("<a:dk2><a:srgbClr val=\"%06X\"/></a:dk2>"), colors[16].GetLONG_RGB());
oStringWriter.WriteString(strVal);
oStringWriter.WriteString(L"<a:dk2><a:srgbClr val=\"%" + XmlUtils::IntToString(colors[16].GetLONG_RGB(), L"%06X") + L"\"/></a:dk2>");
strVal.Format(_T("<a:lt2><a:srgbClr val=\"%06X\"/></a:lt2>"), colors[15].GetLONG_RGB());
oStringWriter.WriteString(strVal);
oStringWriter.WriteString(L"<a:lt2><a:srgbClr val=\"%" + XmlUtils::IntToString(colors[15].GetLONG_RGB(), L"%06X") + L"\"/></a:lt2>");
strVal.Format(_T("<a:accent1><a:srgbClr val=\"%06X\"/></a:accent1>"), colors[5].GetLONG_RGB());
oStringWriter.WriteString(strVal);
oStringWriter.WriteString(L"<a:accent1><a:srgbClr val=\"%" + XmlUtils::IntToString(colors[5].GetLONG_RGB(), L"%06X") + L"\"/></a:accent1>");
strVal.Format(_T("<a:accent2><a:srgbClr val=\"%06X\"/></a:accent2>"), colors[6].GetLONG_RGB());
oStringWriter.WriteString(strVal);
oStringWriter.WriteString(L"<a:accent2><a:srgbClr val=\"%" + XmlUtils::IntToString(colors[6].GetLONG_RGB(), L"%06X") + L"\"/></a:accent2>");
strVal.Format(_T("<a:accent3><a:srgbClr val=\"%06X\"/></a:accent3>"), colors[7].GetLONG_RGB());
oStringWriter.WriteString(strVal);
oStringWriter.WriteString(L"<a:accent3><a:srgbClr val=\"%" + XmlUtils::IntToString(colors[7].GetLONG_RGB(), L"%06X") + L"\"/></a:accent3>");
strVal.Format(_T("<a:accent4><a:srgbClr val=\"%06X\"/></a:accent4>"), colors[8].GetLONG_RGB());
oStringWriter.WriteString(strVal);
oStringWriter.WriteString(L"<a:accent4><a:srgbClr val=\"%" + XmlUtils::IntToString(colors[8].GetLONG_RGB(), L"%06X") + L"\"/></a:accent4>");
strVal.Format(_T("<a:accent5><a:srgbClr val=\"%06X\"/></a:accent5>"), colors[9].GetLONG_RGB());
oStringWriter.WriteString(strVal);
oStringWriter.WriteString(L"<a:accent5><a:srgbClr val=\"%" + XmlUtils::IntToString(colors[9].GetLONG_RGB(), L"%06X") + L"\"/></a:accent5>");
strVal.Format(_T("<a:accent6><a:srgbClr val=\"%06X\"/></a:accent6>"), colors[10].GetLONG_RGB());
oStringWriter.WriteString(strVal);
oStringWriter.WriteString(L"<a:accent6><a:srgbClr val=\"%" + XmlUtils::IntToString(colors[10].GetLONG_RGB(), L"%06X") + L"\"/></a:accent6>");
strVal.Format(_T("<a:hlink><a:srgbClr val=\"%06X\"/></a:hlink>"), colors[11].GetLONG_RGB());
oStringWriter.WriteString(strVal);
oStringWriter.WriteString(L"<a:hlink><a:srgbClr val=\"%" + XmlUtils::IntToString(colors[11].GetLONG_RGB(), L"%06X") + L"\"/></a:hlink>");
strVal.Format(_T("<a:folHlink><a:srgbClr val=\"%06X\"/></a:folHlink>"), colors[12].GetLONG_RGB());
oStringWriter.WriteString(strVal);
oStringWriter.WriteString(L"<a:folHlink><a:srgbClr val=\"%" + XmlUtils::IntToString(colors[12].GetLONG_RGB(), L"%06X") + L"\"/></a:folHlink>");
oStringWriter.WriteString(std::wstring(L"</a:clrScheme>"));
oStringWriter.WriteString(L"</a:clrScheme>");
if (extra)
{
oStringWriter.WriteString(std::wstring(L"<a:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" \
accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/>"));
oStringWriter.WriteString(std::wstring(L"</a:extraClrScheme>"));
oStringWriter.WriteString(L"<a:clrMap bg1=\"lt1\" tx1=\"dk1\" bg2=\"lt2\" tx2=\"dk2\" accent1=\"accent1\" \
accent2=\"accent2\" accent3=\"accent3\" accent4=\"accent4\" accent5=\"accent5\" accent6=\"accent6\" hlink=\"hlink\" folHlink=\"folHlink\"/>");
oStringWriter.WriteString(L"</a:extraClrScheme>");
}
}
@ -833,7 +786,7 @@ void NSPresentationEditor::CPPTXWriter::WriteLayout(CLayout& oLayout, int nIndex
WriteBackground(oWriter, oRels, oLayout.m_oBackground);
}
CString strElems = _T("<p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr>\
std::wstring strElems = _T("<p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr>\
<a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>");
oWriter.WriteString(strElems);
@ -850,18 +803,16 @@ void NSPresentationEditor::CPPTXWriter::WriteLayout(CLayout& oLayout, int nIndex
oRels.CloseRels();
CString strXml = oWriter.GetData();
CString strFile = _T("");
strFile.Format(_T("slideLayout%d.xml"), nIndexLayout + nStartLayout + 1);
std::wstring strXml = oWriter.GetData();
std::wstring strFile = L"slideLayout" + std::to_wstring(nIndexLayout + nStartLayout + 1) + L".xml";
CFile oFile;
CString strFileLayoutPath= m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("slideLayouts") + FILE_SEPARATOR_STR;
std::wstring strFileLayoutPath= m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("slideLayouts") + FILE_SEPARATOR_STR;
oFile.CreateFile(strFileLayoutPath + strFile);
oFile.WriteStringUTF8(strXml);
oFile.CloseFile();
strFile = _T("");
strFile.Format(_T("slideLayout%d.xml.rels"), nIndexLayout + nStartLayout + 1);
strFile = L"slideLayout" + std::to_wstring(nIndexLayout + nStartLayout + 1) + L".xml.rels";
oRels.SaveRels(strFileLayoutPath + _T("_rels") + FILE_SEPARATOR_STR + strFile);
}
void NSPresentationEditor::CPPTXWriter::WriteSlide(int nIndexSlide)
@ -915,18 +866,16 @@ void NSPresentationEditor::CPPTXWriter::WriteSlide(int nIndexSlide)
oRels.CloseRels();
CString strXml = oWriter.GetData();
CString strFile = _T("");
strFile.Format(_T("slide%d.xml"), nIndexSlide + 1);
CString strFileSlidePath= m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("slides") + FILE_SEPARATOR_STR;
std::wstring strXml = oWriter.GetData();
std::wstring strFile = L"slide" + std::to_wstring(nIndexSlide + 1) + L".xml";
std::wstring strFileSlidePath= m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("slides") + FILE_SEPARATOR_STR;
CFile oFile;
oFile.CreateFile(strFileSlidePath + strFile);
oFile.WriteStringUTF8(strXml);
oFile.CloseFile();
strFile = _T("");
strFile.Format(_T("slide%d.xml.rels"), nIndexSlide + 1);
strFile = L"slide" + std::to_wstring(nIndexSlide + 1) + L".xml.rels";
oRels.SaveRels(strFileSlidePath + _T("_rels") + FILE_SEPARATOR_STR + strFile);
}

View File

@ -45,8 +45,8 @@ namespace NSPresentationEditor
class CPPTXWriter
{
public:
CString m_strTempDirectory;
CString m_strDstFileName;
std::wstring m_strTempDirectory;
std::wstring m_strDstFileName;
CDocument * m_pDocument;
CPPTUserInfo* m_pUserInfo;
@ -84,4 +84,4 @@ namespace NSPresentationEditor
};
}
}

View File

@ -52,18 +52,18 @@ namespace NSPresentationEditor
~CImageManager()
{
}
AVSINLINE void Clear()
inline void Clear()
{
m_mapImages.clear();
m_lIndexNextImage = 0;
}
AVSINLINE void SetDstMedia(const CString& strDst)
inline void SetDstMedia(const std::wstring& strDst)
{
m_strDstMedia = strDst;
}
public:
AVSINLINE std::wstring GenerateImage(const std::wstring& strInput)
inline std::wstring GenerateImage(const std::wstring& strInput)
{
std::map<std::wstring, std::wstring>::iterator pPair = m_mapImages.find(strInput);
if (m_mapImages.end() != pPair)
@ -98,7 +98,7 @@ namespace NSPresentationEditor
return strImage;
}
AVSINLINE bool IsNeedDownload(const std::wstring& strFile)
inline bool IsNeedDownload(const std::wstring& strFile)
{
int n1 = strFile.find(L"www");
int n2 = strFile.find(L"http");
@ -108,7 +108,7 @@ namespace NSPresentationEditor
return true;
return false;
}
AVSINLINE std::wstring DownloadImage(const std::wstring& strFile)
inline std::wstring DownloadImage(const std::wstring& strFile)
{
#ifndef DISABLE_FILE_DOWNLOADER
CFileDownloader oDownloader(strFile, TRUE);
@ -155,7 +155,7 @@ namespace NSPresentationEditor
~CRelsGenerator()
{
}
AVSINLINE void Clear()
inline void Clear()
{
m_oWriter.ClearNoAttack();
m_lNextRelsID = 1;
@ -163,9 +163,9 @@ namespace NSPresentationEditor
m_mapHyperlinks.clear();
}
AVSINLINE void StartMaster(int nIndexTheme, int nStartLayoutIndex, int nCountLayouts)
inline void StartMaster(int nIndexTheme, int nStartLayoutIndex, int nCountLayouts)
{
CString str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
std::wstring str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
m_oWriter.WriteString(str1);
@ -173,58 +173,52 @@ namespace NSPresentationEditor
int nCurrent = nStartLayoutIndex;
for (int i = 0; i < nCountLayouts; ++i)
{
CString str = _T("");
str.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout%d.xml\"/>"),
m_lNextRelsID++, nCurrent + 1);
std::wstring str = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout"
+ std::to_wstring(nCurrent + 1) + L".xml\"/>";
++nCurrent;
m_oWriter.WriteString(str);
}
CString s = _T("");
s.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme%d.xml\"/>" ),
m_lNextRelsID++, nIndexTheme + 1);
std::wstring s = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme"
+ std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
m_oWriter.WriteString(s);
}
AVSINLINE void StartLayout(int nIndexTheme)
inline void StartLayout(int nIndexTheme)
{
CString str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
std::wstring str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
m_oWriter.WriteString(str1);
CString str = _T("");
str.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster%d.xml\"/>"),
m_lNextRelsID++, nIndexTheme + 1);
std::wstring str = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster"
+ std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
m_oWriter.WriteString(str);
}
AVSINLINE void StartSlide(int nIndexLayout, int nIndexSlide)
inline void StartSlide(int nIndexLayout, int nIndexSlide)
{
CString str1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
m_oWriter.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
m_oWriter.WriteString(str1);
m_oWriter.WriteString(L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) + L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout"
+ std::to_wstring(nIndexLayout + 1) + L".xml\"/>");
CString str = _T("");
str.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout%d.xml\"/>"),
m_lNextRelsID++, nIndexLayout + 1);
m_oWriter.WriteString(str);
str = _T("");
str.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide%d.xml\"/>"), m_lNextRelsID++, nIndexSlide + 1);
m_oWriter.WriteString(str);
m_oWriter.WriteString(L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide"
+ std::to_wstring(nIndexSlide + 1) + L".xml\"/>");
}
static AVSINLINE void StartNotes(int nIndexSlide, CString strDirectory, std::wstring strComment)
static inline void StartNotes(int nIndexSlide, std::wstring strDirectory, std::wstring strComment)
{
CString sNum = _T("");
sNum.Format(_T("%d"), nIndexSlide + 1);
std::wstring sNum = std::to_wstring( nIndexSlide + 1);
CString strNoteSlideRels = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
std::wstring strNoteSlideRels = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"../slides/slide") + sNum + _T(".xml\"/>\
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"../notesMasters/notesMaster1.xml\"/>\
</Relationships>");
CString strNoteRels = strDirectory + FILE_SEPARATOR_STR + _T("ppt") +
std::wstring strNoteRels = strDirectory + FILE_SEPARATOR_STR + _T("ppt") +
+ FILE_SEPARATOR_STR + _T("notesSlides")
+ FILE_SEPARATOR_STR + _T("_rels")
+ FILE_SEPARATOR_STR + _T("notesSlide") + sNum + _T(".xml.rels");
@ -233,18 +227,18 @@ namespace NSPresentationEditor
oFile.WriteStringUTF8(strNoteSlideRels);
oFile.CloseFile();
CString strNoteSlide = strDirectory + FILE_SEPARATOR_STR + _T("ppt") +
std::wstring strNoteSlide = strDirectory + FILE_SEPARATOR_STR + _T("ppt") +
+ FILE_SEPARATOR_STR + _T("notesSlides")
+ FILE_SEPARATOR_STR + _T("notesSlide") + sNum + _T(".xml");
oFile.CreateFile(strNoteSlide);
CString strW1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
std::wstring strW1 = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<p:notes xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\
<p:cSld><p:spTree><p:nvGrpSpPr><p:cNvPr id=\"1\" name=\"\"/><p:cNvGrpSpPr/><p:nvPr/></p:nvGrpSpPr><p:grpSpPr><a:xfrm><a:off x=\"0\" y=\"0\"/>\
<a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr><p:sp><p:nvSpPr><p:cNvPr id=\"100000\" name=\"\"/>\
<p:cNvSpPr><a:spLocks noGrp=\"1\" noChangeArrowheads=\"1\"/></p:cNvSpPr><p:nvPr><p:ph type=\"body\" idx=\"1\"/></p:nvPr></p:nvSpPr><p:spPr/>\
<p:txBody><a:bodyPr/><a:lstStyle/><a:p><a:r><a:rPr smtClean=\"0\"/><a:t>");
CString strW2 = _T("</a:t></a:r><a:endParaRPr/></a:p></p:txBody></p:sp></p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:notes>");
std::wstring strW2 = _T("</a:t></a:r><a:endParaRPr/></a:p></p:txBody></p:sp></p:spTree></p:cSld><p:clrMapOvr><a:masterClrMapping/></p:clrMapOvr></p:notes>");
CorrectXmlString(strComment);
@ -254,33 +248,31 @@ namespace NSPresentationEditor
oFile.CloseFile();
}
AVSINLINE void CloseRels()
inline void CloseRels()
{
CString str = _T("</Relationships>");
std::wstring str = _T("</Relationships>");
m_oWriter.WriteString(str);
}
AVSINLINE void SaveRels(const CString& strFile)
inline void SaveRels(const std::wstring& strFile)
{
CFile oFile;
oFile.CreateFile(strFile);
CString strMem = m_oWriter.GetData();
std::wstring strMem = m_oWriter.GetData();
oFile.WriteStringUTF8(strMem);
oFile.CloseFile();
}
AVSINLINE CString WriteHyperlink(const std::wstring& strHyperlink)
inline std::wstring WriteHyperlink(const std::wstring& strHyperlink)
{
std::map<std::wstring, std::wstring>::iterator pPair = m_mapHyperlinks.find(strHyperlink);
if (m_mapHyperlinks.end() != pPair)
{
CString strRid = _T("");
strRid.Format(_T("rId%d"), pPair->second);
std::wstring strRid = L"rId" + pPair->second;
return strRid;
}
m_mapHyperlinks[strHyperlink] = m_lNextRelsID;
CString strRid;
strRid.Format(L"rId%d", m_lNextRelsID++);
std::wstring strRid = L"rId" + std::to_wstring( m_lNextRelsID++);
std::wstring strRels = L"<Relationship Id=\"";
@ -292,14 +284,13 @@ namespace NSPresentationEditor
return strRid;
}
AVSINLINE CString WriteHyperlinkImage(const std::wstring& strImage, bool bExternal = true)
inline std::wstring WriteHyperlinkImage(const std::wstring& strImage, bool bExternal = true)
{
std::map<std::wstring, int>::iterator pPair = m_mapImages.find(strImage);
if (m_mapImages.end() != pPair)
{
CString strRid = _T("");
strRid.Format(_T("rId%d"), pPair->second);
std::wstring strRid = L"rId" + std::to_wstring(pPair->second);
return strRid;
}
@ -319,7 +310,7 @@ namespace NSPresentationEditor
return strRid;
}
AVSINLINE CString WriteImage(const std::wstring& strImagePath)
inline std::wstring WriteImage(const std::wstring& strImagePath)
{
std::wstring strImage = m_pManager->GenerateImage(strImagePath);

View File

@ -42,7 +42,7 @@
void CStylesWriter::ConvertStyleLevel(NSPresentationEditor::CTextStyleLevel& oLevel, NSPresentationEditor::CMetricInfo& oMetricInfo,
NSPresentationEditor::CStringWriter& oWriter, const int& nLevel)
{//дублирование CTextPFRun и CTextCFRun с ShapeWriter - todooo - вынести отдельно
CString str1;
std::wstring str1;
if (nLevel == 9)
str1 = _T("<a:defPPr");
else
@ -231,8 +231,7 @@ void CStylesWriter::ConvertStyleLevel(NSPresentationEditor::CTextStyleLevel& oLe
}
else
{
CString strColor;
strColor.Format(_T("%06x"), pCF->Color->GetLONG_RGB());
std::wstring strColor = XmlUtils::IntToString(pCF->Color->GetLONG_RGB(), L"%06x");
oWriter.WriteString(L"<a:solidFill><a:srgbClr val=\"" + strColor + L"\"/></a:solidFill>");
}
@ -262,7 +261,7 @@ void CStylesWriter::ConvertStyleLevel(NSPresentationEditor::CTextStyleLevel& oLe
}
oWriter.WriteString(L"</a:defRPr>");
CString str3;
std::wstring str3;
if (nLevel == 9)
str3 = L"</a:defPPr>";
else
@ -297,7 +296,7 @@ NSPresentationEditor::CShapeWriter::CShapeWriter()
m_pImageElement = NULL;
m_pShapeElement = NULL;
}
CString NSPresentationEditor::CShapeWriter::ConvertLine(CPen & pen)
std::wstring NSPresentationEditor::CShapeWriter::ConvertLine(CPen & pen)
{
NSPresentationEditor::CStringWriter line_writer;
@ -312,7 +311,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertLine(CPen & pen)
return line_writer.GetData();
}
CString NSPresentationEditor::CShapeWriter::ConvertBrush(CBrush & brush)
std::wstring NSPresentationEditor::CShapeWriter::ConvertBrush(CBrush & brush)
{
NSPresentationEditor::CStringWriter brush_writer;
@ -404,7 +403,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertBrush(CBrush & brush)
return brush_writer.GetData();
}
CString NSPresentationEditor::CShapeWriter::ConvertShadow(CShadow & shadow)
std::wstring NSPresentationEditor::CShapeWriter::ConvertShadow(CShadow & shadow)
{
std::wstring Preset;
bool Inner = false;
@ -521,22 +520,19 @@ CString NSPresentationEditor::CShapeWriter::ConvertShadow(CShadow & shadow)
return shadow_writer.GetData();
}
CString NSPresentationEditor::CShapeWriter::ConvertColor(CColor & color, long alpha)
std::wstring NSPresentationEditor::CShapeWriter::ConvertColor(CColor & color, long alpha)
{
NSPresentationEditor::CStringWriter color_writer;
if (color.m_lSchemeIndex == -1)
{
{
if (255 == alpha)
{
CString str;
str.Format(L"<a:srgbClr val=\"%06X\"/>", color.GetLONG_RGB());
color_writer.WriteString(str);
color_writer.WriteString(L"<a:srgbClr val=\"" + XmlUtils::IntToString(color.GetLONG_RGB(), L"%06X") + L"\"/>");
}
else
{
CString str;
str.Format(L"<a:srgbClr val=\"%06X\"><a:alpha val=\"%d\"/></a:srgbClr>", color.GetLONG_RGB(), (int)(alpha * 100000 / 255));
color_writer.WriteString(str);
color_writer.WriteString(L"<a:srgbClr val=\"" + XmlUtils::IntToString(color.GetLONG_RGB(), L"%06X") + L"\">" +
L"<a:alpha val=\"" + std::to_wstring((int)(alpha * 100000 / 255)) + L"\"/></a:srgbClr>");
}
}
else
@ -600,7 +596,7 @@ void NSPresentationEditor::CShapeWriter::WriteImageInfo()
m_oWriter.WriteString(std::wstring(L"<p:nvPr/>"));
}
CString str2 = _T("</p:nvPicPr>");
std::wstring str2 = _T("</p:nvPicPr>");
m_oWriter.WriteString(str2);
}
@ -632,7 +628,7 @@ void NSPresentationEditor::CShapeWriter::WriteShapeInfo()
m_oWriter.WriteString(std::wstring(L">"));
if (!m_pShapeElement->m_sHyperlink.empty())
{
std::wstring rId = (m_pRels->WriteHyperlink(m_pShapeElement->m_sHyperlink)).GetBuffer();
std::wstring rId = m_pRels->WriteHyperlink(m_pShapeElement->m_sHyperlink);
m_oWriter.WriteString(std::wstring(L"<a:hlinkClick"));
m_oWriter.WriteString(std::wstring(L" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\""));
@ -683,7 +679,7 @@ void NSPresentationEditor::CShapeWriter::WriteShapeInfo()
m_oWriter.WriteString(std::wstring(L"<p:nvPr/>"));
}
CString str2 = _T("</p:nvSpPr>");
std::wstring str2 = _T("</p:nvSpPr>");
m_oWriter.WriteString(str2);
}
void NSPresentationEditor::CShapeWriter::WriteTextInfo()
@ -699,8 +695,8 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
int __r = (int)(( m_oBounds.right - m_oTextRect.right )* EMU_MM);
int __b = (int)(( m_oBounds.bottom - m_oTextRect.bottom)* EMU_MM);
CString str;
str.Format(L" lIns=\"%d\" tIns=\"%d\" rIns=\"%d\" bIns=\"%d\"",__l, __t, __r, __b);
std::wstring str = L" lIns=\"" + std::to_wstring(__l) + L"\" tIns=\"" + std::to_wstring(__t) +
L"\" rIns=\"" + std::to_wstring(__r) + L"\" bIns=\"" + std::to_wstring(__b) + L"\"";
m_oWriter.WriteString(str);
// m_oWriter.WriteString(std::wstring(L" lIns=\"0\" tIns=\"0\" rIns=\"0\" bIns=\"0\""));
@ -733,7 +729,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
m_oWriter.WriteString(std::wstring(L"<a:avLst>"));//модификаторы
CPPTShape *pPPTShape = dynamic_cast<CPPTShape *>(m_pShapeElement->m_oShape.m_pShape);
CString strVal;
std::wstring strVal;
for (int i = 0 ; (pPPTShape) && (i < pPPTShape->m_arAdjustments.size()); i++)
{
@ -801,7 +797,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
}
if (pPF->leftMargin.is_init())
{
CString strProp = std::to_wstring( pPF->leftMargin.get() );
std::wstring strProp = std::to_wstring( pPF->leftMargin.get() );
m_oWriter.WriteString(L" marL=\"" + strProp + L"\"");
if (pPF->indent.is_init() == false)
@ -815,7 +811,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
}
if (pPF->textAlignment.is_init())
{
CString strProp = CStylesWriter::GetTextAlign(pPF->textAlignment.get());
std::wstring strProp = CStylesWriter::GetTextAlign(pPF->textAlignment.get());
m_oWriter.WriteString(L" algn=\"" + strProp + L"\"");
}
if (pPF->defaultTabSize.is_init())
@ -944,9 +940,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
NSPresentationEditor::CTextCFRun* pCF = &pParagraph->m_arSpans[nSpan].m_oRun;
if ((pCF->Size.is_init()) && (pCF->Size.get() > 0) && (pCF->Size.get() < 4001))
{
CString strProp;
strProp.Format(_T("<a:endParaRPr lang=\"en-US\" sz=\"%d\"/>"), (int)(100 * pCF->Size.get()));
m_oWriter.WriteString(strProp);
m_oWriter.WriteString(L"<a:endParaRPr lang=\"en-US\" sz=\"" + std::to_wstring((int)(100 * pCF->Size.get())) + L"\"/>");
}
else
{
@ -989,13 +983,11 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
if ((pCF->Size.is_init()) && (pCF->Size.get() > 0) && (pCF->Size.get() < 4001))
{
CString strProp; strProp.Format(_T(" sz=\"%d\""), (int)(100 * pCF->Size.get()));
m_oWriter.WriteString(strProp);
m_oWriter.WriteString(L" sz=\"" + std::to_wstring((int)(100 * pCF->Size.get())) + L"\"");
}
if (pCF->BaseLineOffset.is_init())
{
CString strProp; strProp.Format(_T(" baseline=\"%d\""), (int)(1000 * pCF->BaseLineOffset.get()));
m_oWriter.WriteString(strProp);
m_oWriter.WriteString(L" baseline=\"" + std::to_wstring((int)(1000 * pCF->BaseLineOffset.get())) + L"\"");
}
if (pCF->FontBold.is_init())
{
@ -1043,16 +1035,14 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
{
if (pCF->Color->m_lSchemeIndex != -1)
{
CString strProp = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(pCF->Color->m_lSchemeIndex) + _T("\"/></a:solidFill>");
std::wstring strProp = _T("<a:solidFill><a:schemeClr val=\"") + CStylesWriter::GetColorInScheme(pCF->Color->m_lSchemeIndex) + _T("\"/></a:solidFill>");
m_oWriter.WriteString(strProp);
}
else
{
CString strColor = _T("");
strColor.Format(_T("%06x"), pCF->Color->GetLONG_RGB());
std::wstring strColor = XmlUtils::IntToString(pCF->Color->GetLONG_RGB(), L"%06x");
CString strProp = _T("<a:solidFill><a:srgbClr val=\"") + strColor + _T("\"/></a:solidFill>");
m_oWriter.WriteString(strProp);
m_oWriter.WriteString(L"<a:solidFill><a:srgbClr val=\"" + strColor + L"\"/></a:solidFill>");
}
}
}
@ -1061,12 +1051,12 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
{
if (0 == pCF->Typeface.get())
{
CString strProp = _T("<a:latin typeface=\"+mj-lt\"/>");
std::wstring strProp = _T("<a:latin typeface=\"+mj-lt\"/>");
m_oWriter.WriteString(strProp);
}
else
{
CString strProp = _T("<a:latin typeface=\"+mn-lt\"/>");
std::wstring strProp = _T("<a:latin typeface=\"+mn-lt\"/>");
m_oWriter.WriteString(strProp);
}
}
@ -1090,14 +1080,14 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
}
else
{
CString strT1 = _T("<a:t>");
std::wstring strT1 = _T("<a:t>");
m_oWriter.WriteString(strT1);
std::wstring strT = pParagraph->m_arSpans[nSpan].m_strText;
NSPresentationEditor::CorrectXmlString(strT);
m_oWriter.WriteString(strT);
CString strT2 = _T("</a:t>");
std::wstring strT2 = _T("</a:t>");
m_oWriter.WriteString(strT2);
if ((m_pShapeElement->m_lPlaceholderType == PT_MasterSlideNumber ||
@ -1110,15 +1100,15 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
}
}
CString strEndPar = _T("</a:p>");
std::wstring strEndPar = _T("</a:p>");
m_oWriter.WriteString(strEndPar);
}
CString str5 = _T("</p:txBody>");
std::wstring str5 = _T("</p:txBody>");
m_oWriter.WriteString(str5);
}
CString NSPresentationEditor::CShapeWriter::ConvertShape()
std::wstring NSPresentationEditor::CShapeWriter::ConvertShape()
{
if (m_pImageElement) return ConvertImage();
@ -1165,7 +1155,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
if (m_pShapeElement->m_bBoundsEnabled)
{
CString str;
std::wstring str;
m_oWriter.WriteString(std::wstring(L"<a:xfrm"));
if (0 != m_pShapeElement->m_dRotate)
@ -1173,8 +1163,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
if (m_pShapeElement->m_bFlipH && m_pShapeElement->m_dRotate < 180)
m_pShapeElement->m_dRotate += 180; //Тікбұрышты үшбұрыштарды.ppt slide-7
str.Format(L" rot=\"%d\"", (int)(m_pShapeElement->m_dRotate * 60000));
m_oWriter.WriteString(str);
m_oWriter.WriteString(L" rot=\"" + std::to_wstring((int)(m_pShapeElement->m_dRotate * 60000)) + L"\"");
}
if (m_pShapeElement->m_bFlipH)
{
@ -1186,15 +1175,13 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
}
m_oWriter.WriteString(std::wstring(L">"));
str.Format(_T("<a:off x=\"%d\" y=\"%d\"/>"), (int)m_pShapeElement->m_rcBoundsOriginal.left, (int)m_pShapeElement->m_rcBoundsOriginal.top);
m_oWriter.WriteString(str);
m_oWriter.WriteString(L"<a:off x=\"" + std::to_wstring((int)m_pShapeElement->m_rcBoundsOriginal.left) + L"\" y=\"" + std::to_wstring((int)m_pShapeElement->m_rcBoundsOriginal.top) + L"\"/>");
int width = m_pShapeElement->m_rcBoundsOriginal.right - m_pShapeElement->m_rcBoundsOriginal.left;
int height = m_pShapeElement->m_rcBoundsOriginal.bottom - m_pShapeElement->m_rcBoundsOriginal.top;
if ( width > 0 || height > 0 )
{
str.Format(_T("<a:ext cx=\"%d\" cy=\"%d\"/>"), width, height);
m_oWriter.WriteString(str);
m_oWriter.WriteString(L"<a:ext cx=\"" + std::to_wstring(width) + L"\" cy=\"" + std::to_wstring(height) + L"\"/>");
}
m_oWriter.WriteString(std::wstring(L"</a:xfrm>"));
}
@ -1247,7 +1234,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
return m_oWriter.GetData();
}
CString NSPresentationEditor::CShapeWriter::ConvertImage()
std::wstring NSPresentationEditor::CShapeWriter::ConvertImage()
{
if (m_pImageElement->m_bImagePresent == false)
{
@ -1257,7 +1244,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertImage()
m_pImageElement->m_strImageFileName.clear();
m_pImageElement->m_bImagePresent = true;
}
CString strRid;
std::wstring strRid;
if (!m_pImageElement->m_strImageFileName.empty())
{
strRid = m_pRels->WriteImage(m_pImageElement->m_strImageFileName);
@ -1267,7 +1254,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertImage()
strRid = m_pRels->WriteHyperlinkImage(CorrectXmlString3(m_pImageElement->m_sImageName));
}
if (strRid.IsEmpty()) return _T("");
if (strRid.empty()) return _T("");
m_oWriter.WriteString(std::wstring(L"<p:pic>"));
@ -1285,21 +1272,16 @@ CString NSPresentationEditor::CShapeWriter::ConvertImage()
m_oWriter.WriteString(std::wstring(L"<p:blipFill>"));
CString strWrite = _T("<a:blip r:embed=\"") + strRid + _T("\"/>");
std::wstring strWrite = _T("<a:blip r:embed=\"") + strRid + _T("\"/>");
m_oWriter.WriteString(strWrite);
m_oWriter.WriteString(std::wstring(L"<a:srcRect"));
if (m_pImageElement->m_bCropEnabled)
{
CString sCrop;
sCrop.Format(L" l=\"%d\"", (size_t)(m_pImageElement->m_lcropFromLeft*1.5));
m_oWriter.WriteString(sCrop);
sCrop.Format(L" t=\"%d\"", (size_t)(m_pImageElement->m_lcropFromTop*1.5));
m_oWriter.WriteString(sCrop);
sCrop.Format(L" r=\"%d\"", (size_t)(m_pImageElement->m_lcropFromRight*1.5));
m_oWriter.WriteString(sCrop);
sCrop.Format(L" b=\"%d\"", (size_t)(m_pImageElement->m_lcropFromBottom*1.5));
m_oWriter.WriteString(sCrop);
m_oWriter.WriteString(L" l=\"" + std::to_wstring((size_t)(m_pImageElement->m_lcropFromLeft *1.5)) + L"\"");
m_oWriter.WriteString(L" t=\"" + std::to_wstring((size_t)(m_pImageElement->m_lcropFromTop *1.5)) + L"\"");
m_oWriter.WriteString(L" r=\"" + std::to_wstring((size_t)(m_pImageElement->m_lcropFromRight *1.5)) + L"\"");
m_oWriter.WriteString(L" b=\"" + std::to_wstring((size_t)(m_pImageElement->m_lcropFromBottom*1.5)) + L"\"");
}
m_oWriter.WriteString(std::wstring(L"/>"));
@ -1318,13 +1300,12 @@ CString NSPresentationEditor::CShapeWriter::ConvertImage()
if (m_pImageElement->m_bBoundsEnabled)
{
CString str;
std::wstring str;
m_oWriter.WriteString(std::wstring(L"<a:xfrm"));
if (0 != m_pImageElement->m_dRotate)
{
str.Format(L" rot=\"%d\"", m_pImageElement->m_dRotate * 60000);
m_oWriter.WriteString(str);
m_oWriter.WriteString(L" rot=\"" + std::to_wstring(m_pImageElement->m_dRotate * 60000) + L"\"");
}
if (m_pImageElement->m_bFlipH)
{
@ -1336,15 +1317,13 @@ CString NSPresentationEditor::CShapeWriter::ConvertImage()
}
m_oWriter.WriteString(std::wstring(L">"));
str.Format(_T("<a:off x=\"%d\" y=\"%d\"/>"), (int)m_pImageElement->m_rcBoundsOriginal.left, (int)m_pImageElement->m_rcBoundsOriginal.top);
m_oWriter.WriteString(str);
m_oWriter.WriteString(L"<a:off x=\"" + std::to_wstring((int)m_pImageElement->m_rcBoundsOriginal.left) + L"\" y=\"" + std::to_wstring((int)m_pImageElement->m_rcBoundsOriginal.top) + L"\"/>");
int width = m_pImageElement->m_rcBoundsOriginal.right - m_pImageElement->m_rcBoundsOriginal.left;
int height = m_pImageElement->m_rcBoundsOriginal.bottom - m_pImageElement->m_rcBoundsOriginal.top;
if ( width > 0 || height > 0 )
{
str.Format(_T("<a:ext cx=\"%d\" cy=\"%d\"/>"), width, height);
m_oWriter.WriteString(str);
m_oWriter.WriteString(L"<a:ext cx=\"" + std::to_wstring(width) + L"\" cy=\"" + std::to_wstring(height) + L"\"/>");
}
m_oWriter.WriteString(std::wstring(L"</a:xfrm>"));
}
@ -1434,7 +1413,7 @@ HRESULT NSPresentationEditor::CShapeWriter::get_DpiY(double* dDpiY)
// pen --------------------------------------------------------------------------------------
HRESULT NSPresentationEditor::CShapeWriter::SetPen(std::wstring bsXML)
{
//m_oPen.FromXmlString((CString)bsXML);
//m_oPen.FromXmlString((std::wstring)bsXML);
return S_OK;
}
HRESULT NSPresentationEditor::CShapeWriter::get_PenColor(LONG* lColor)
@ -1552,7 +1531,7 @@ HRESULT NSPresentationEditor::CShapeWriter::PenDashPattern(double* pPattern, LON
// brush ------------------------------------------------------------------------------------
HRESULT NSPresentationEditor::CShapeWriter::SetBrush(std::wstring bsXML)
{
//m_oBrush.FromXmlString((CString)bsXML);
//m_oBrush.FromXmlString((std::wstring)bsXML);
return S_OK;
}
HRESULT NSPresentationEditor::CShapeWriter::get_BrushType(LONG* lType)
@ -1672,7 +1651,7 @@ HRESULT NSPresentationEditor::CShapeWriter::put_BrushGradientColors(LONG* lColor
// font -------------------------------------------------------------------------------------
HRESULT NSPresentationEditor::CShapeWriter::SetFont(std::wstring bsXML)
{
//m_oFont.FromXmlString((CString)bsXML);
//m_oFont.FromXmlString((std::wstring)bsXML);
return S_OK;
}
HRESULT NSPresentationEditor::CShapeWriter::get_FontName(std::wstring* bsName)
@ -1749,7 +1728,7 @@ HRESULT NSPresentationEditor::CShapeWriter::put_FontFaceIndex(const int& lFaceIn
// shadow -----------------------------------------------------------------------------------
HRESULT NSPresentationEditor::CShapeWriter::SetShadow(std::wstring bsXML)
{
//m_oShadow.FromXmlString((CString)bsXML);
//m_oShadow.FromXmlString((std::wstring)bsXML);
return S_OK;
}
HRESULT NSPresentationEditor::CShapeWriter::get_ShadowDistanceX(double* val)
@ -1815,7 +1794,7 @@ HRESULT NSPresentationEditor::CShapeWriter::put_ShadowVisible(bool val)
// edge -------------------------------------------------------------------------------------
HRESULT NSPresentationEditor::CShapeWriter::SetEdgeText(std::wstring bsXML)
{
//m_oEdge.FromXmlString((CString)bsXML);
//m_oEdge.FromXmlString((std::wstring)bsXML);
return S_OK;
}
HRESULT NSPresentationEditor::CShapeWriter::get_EdgeVisible(LONG* val)
@ -2032,25 +2011,19 @@ HRESULT NSPresentationEditor::CShapeWriter::DrawPath(const LONG& nType)
if (bIsStroke && bIsFill)
{
CString str = _T("");
str.Format(_T("<a:path w=\"43200\" h=\"43200\">"));
m_oWriterVML.WriteString(str);
m_oWriterVML.WriteString(L"<a:path w=\"43200\" h=\"43200\">");
m_oWriterVML.Write(m_oWriterPath);
m_oWriterVML.WriteString(std::wstring(L"</a:path>"));
}
else if (bIsStroke)
{
CString str = _T("");
str.Format(_T("<a:path w=\"43200\" h=\"43200\" fill=\"none\">"));
m_oWriterVML.WriteString(str);
m_oWriterVML.WriteString(L"<a:path w=\"43200\" h=\"43200\" fill=\"none\">");
m_oWriterVML.Write(m_oWriterPath);
m_oWriterVML.WriteString(std::wstring(L"</a:path>"));
}
else if (bIsFill)
{
CString str = _T("");
str.Format(_T("<a:path w=\"43200\" h=\"43200\" stroke=\"0\">"));
m_oWriterVML.WriteString(str);
m_oWriterVML.WriteString(L"<a:path w=\"43200\" h=\"43200\" stroke=\"0\">");
m_oWriterVML.Write(m_oWriterPath);
m_oWriterVML.WriteString(std::wstring(L"</a:path>"));
}

View File

@ -207,12 +207,12 @@ namespace NSPresentationEditor
m_oWriterVML.ClearNoAttack();
}
//--------------------------------------------------------------------
CString ConvertShape ();
CString ConvertImage ();
CString ConvertLine (CPen & pen);
CString ConvertShadow (CShadow & shadow);
CString ConvertBrush (CBrush & brush);
static CString ConvertColor (CColor & color, long alpha);
std::wstring ConvertShape ();
std::wstring ConvertImage ();
std::wstring ConvertLine (CPen & pen);
std::wstring ConvertShadow (CShadow & shadow);
std::wstring ConvertBrush (CBrush & brush);
static std::wstring ConvertColor (CColor & color, long alpha);
// тип рендерера-----------------------------------------------------------------------------
virtual HRESULT get_Type(LONG* lType) ;
//-------- Функции для работы со страницей --------------------------------------------------
@ -439,9 +439,7 @@ namespace NSPresentationEditor
double y = dY;
m_oFullTransform.TransformPoint(x, y);
CString str = _T("");
str.Format(_T("<a:moveTo><a:pt x=\"%d\" y=\"%d\"/></a:moveTo>"), (LONG)x, (LONG)y);
m_oWriterPath.WriteString(str);
m_oWriterPath.WriteString(L"<a:moveTo><a:pt x=\"" + std::to_wstring((int)x) + L"\" y=\"" + std::to_wstring((int)y) + L"\"/></a:moveTo>");
}
inline void LineTo(const double& dX, const double& dY)
{
@ -449,9 +447,7 @@ namespace NSPresentationEditor
double y = dY;
m_oFullTransform.TransformPoint(x, y);
CString str = _T("");
str.Format(_T("<a:lnTo><a:pt x=\"%d\" y=\"%d\"/></a:lnTo>"), (LONG)x, (LONG)y);
m_oWriterPath.WriteString(str);
m_oWriterPath.WriteString(L"<a:lnTo><a:pt x=\"" + std::to_wstring((int)x) + L"\" y=\"" +std::to_wstring((int)y) + L"\"/></a:lnTo>");
}
inline void CurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3)
{
@ -467,10 +463,9 @@ namespace NSPresentationEditor
double _y3 = y3;
m_oFullTransform.TransformPoint(_x3, _y3);
CString str = _T("");
str.Format(_T("<a:cubicBezTo><a:pt x=\"%d\" y=\"%d\"/><a:pt x=\"%d\" y=\"%d\"/><a:pt x=\"%d\" y=\"%d\"/></a:cubicBezTo>"),
(LONG)_x1, (LONG)_y1, (LONG)_x2, (LONG)_y2, (LONG)_x3, (LONG)_y3);
m_oWriterPath.WriteString(str);
m_oWriterPath.WriteString(L"<a:cubicBezTo><a:pt x=\"" + std::to_wstring((int)x1) + L"\" y=\"" + std::to_wstring((int)y1)
+ L"\"/><a:pt x=\"" + std::to_wstring((int)x2) + L"\" y=\"" + std::to_wstring((int)y2) + L"\"/><a:pt x=\""
+ std::to_wstring((int)x3) + L"\" y=\"" + std::to_wstring((int)y3) + L"\"/></a:cubicBezTo>");
}
void Start()
{
@ -482,7 +477,7 @@ namespace NSPresentationEditor
}
void Close()
{
CString str = _T("<a:close/>");
std::wstring str = _T("<a:close/>");
m_oWriterPath.WriteString(str);
}

View File

@ -88,7 +88,7 @@ public:
return L"auto";
}
static CString ConvertStyles(NSPresentationEditor::CTextStyles& oStyles, NSPresentationEditor::CMetricInfo& oMetricInfo, int nCount = 10)
static std::wstring ConvertStyles(NSPresentationEditor::CTextStyles& oStyles, NSPresentationEditor::CMetricInfo& oMetricInfo, int nCount = 10)
{
NSPresentationEditor::CStringWriter oWriter;
ConvertStyles(oStyles, oMetricInfo, oWriter, nCount);
@ -103,7 +103,7 @@ public:
ConvertStyleLevel(oStyles.m_pLevels[i].get(), oMetricInfo, oWriter, i);
}
}
static CString ConvertStyleLevel(NSPresentationEditor::CTextStyleLevel& oLevel, NSPresentationEditor::CMetricInfo& oMetricInfo, const int& nLevel)
static std::wstring ConvertStyleLevel(NSPresentationEditor::CTextStyleLevel& oLevel, NSPresentationEditor::CMetricInfo& oMetricInfo, const int& nLevel)
{
NSPresentationEditor::CStringWriter oWriter;
ConvertStyleLevel(oLevel, oMetricInfo, oWriter, nLevel);

View File

@ -107,7 +107,7 @@ public:
m_strName = pAtom->m_strUNICODEUserName;
}
CString ToString()
std::wstring ToString()
{
return L"";
}

View File

@ -38,7 +38,7 @@ class CPPTDocumentInfo
public:
CCurrentUser m_oCurrentUser;
std::vector<CPPTUserInfo*> m_arUsers;
CString m_strFileDirectory;
std::wstring m_strFileDirectory;
std::map<int, std::wstring> m_mapStoreImageFile;
public:
@ -66,7 +66,7 @@ public:
}
}
void ReadFromStream(CRecordCurrentUserAtom* pCurrentUser, POLE::Stream* pStream, CStringW strFolderMem)
void ReadFromStream(CRecordCurrentUserAtom* pCurrentUser, POLE::Stream* pStream, std::wstring strFolderMem)
{
m_oCurrentUser.FromAtom(pCurrentUser);

View File

@ -111,7 +111,7 @@ void CPPTUserInfo::Clear()
m_arOffsetPictures.clear();
}
bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream, CStringW strFolderMem)
bool CPPTUserInfo::ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream, std::wstring strFolderMem)
{
m_oUser.FromAtom(pUser);

View File

@ -96,7 +96,7 @@ public:
std::vector<int> m_arOffsetPictures;
bool m_bIsSetupEmpty;
CString m_strFileDirectory;
std::wstring m_strFileDirectory;
// вся инфа о ex - файлах
CExMedia m_oExMedia;
@ -113,7 +113,7 @@ public:
void Clear();
bool ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream, CStringW strFolderMem);
bool ReadFromStream(CRecordUserEditAtom* pUser, POLE::Stream* pStream, std::wstring strFolderMem);
void FromDocument();
void NormalizeCoords(long lWidth, long lHeight);

View File

@ -31,7 +31,7 @@
*/
#pragma once
#include "../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../../../DesktopEditor/common/Directory.h"
#include "../Records/Drawing/ArtBlip.h"
#include "PPTDocumentInfo.h"
@ -48,7 +48,7 @@
class CPPTFileReader
{
public:
CPPTFileReader(POLE::Storage *pStg, CStringW strTemp):
CPPTFileReader(POLE::Storage *pStg, std::wstring strTemp):
m_pPowerPointStg(pStg),
m_bIsPPTFile(false),
m_pDocStream(NULL),
@ -84,12 +84,12 @@ public:
RELEASEOBJECT(pStm);
if (0 == m_strMemoryForder.GetLength())
if (0 == m_strMemoryForder.length())
{
m_strMemoryForder = FileSystem::Directory::GetTempPath();
m_strMemoryForder = NSDirectory::GetTempPath();
}
m_strMemoryForder = FileSystem::Directory::CreateDirectoryWithUniqueName(m_strMemoryForder);
m_strMemoryForder = NSDirectory::CreateDirectoryWithUniqueName(m_strMemoryForder);
}
~CPPTFileReader()
@ -99,7 +99,7 @@ public:
RELEASEOBJECT(m_pPowerPointStg);
FileSystem::Directory::DeleteDirectory(m_strMemoryForder);
NSDirectory::DeleteDirectory(m_strMemoryForder);
}
bool IsPowerPoint()
@ -222,7 +222,7 @@ private:
public:
// для картинок
CStringW m_strMemoryForder;
std::wstring m_strMemoryForder;
std::vector<bool> m_arLoadImageFlags;
DWORD m_lImagesCount;

View File

@ -42,12 +42,12 @@ SSlidePersist::SSlidePersist(const SSlidePersist& oSrc)
*this = oSrc;
}
CString SSlidePersist::ToString()
{
CString str = _T("");
str.Format(_T("<SlideInfo PsrRef='%d' SlideID='%d' />"), m_nPsrRef, m_nSlideID);
return str;
}
//std::wstring SSlidePersist::ToString()
//{
// std::wstring str = _T("");
// str.Format(_T("<SlideInfo PsrRef='%d' SlideID='%d' />"), m_nPsrRef, m_nSlideID);
// return str;
//}
SSlidePersist& SSlidePersist::operator =(const SSlidePersist& oSrc)
{
@ -56,4 +56,4 @@ SSlidePersist& SSlidePersist::operator =(const SSlidePersist& oSrc)
m_arTextAttrs = oSrc.m_arTextAttrs;
return (*this);
}
}

View File

@ -48,6 +48,6 @@ struct SSlidePersist
SSlidePersist();
SSlidePersist(const SSlidePersist& oSrc);
CString ToString();
std::wstring ToString();
SSlidePersist& operator =(const SSlidePersist& oSrc);
};

View File

@ -73,206 +73,200 @@ static const wchar_t EffectBehaviorWipeDown [] = L"wipe(down)";
#pragma region _MACROSES_
#define GET_ENUM_STRING(NAMEE,VALUEE) \
case TL_##NAMEE##VALUEE: \
return CString(_T("TL_")) + CString(_T(#NAMEE)) + CString(#VALUEE); \
break;
#define GET_ENUM_STRING(NAMEE, VALUEE)\
case TL_##NAMEE##VALUEE: \
return std::wstring(_T("TL_")) + std::wstring(_T(#NAMEE)) + std::wstring(_T(#VALUEE)); \
break;
#if defined(_WIN32) || defined (_WIN64)
#define GET_EFFECT_NAME_BY_ID(VALUE,DESCRIPTION) \
case (##VALUE) : return CString(_T(#DESCRIPTION)); break;
case (##VALUE) : return std::wstring(_T(#DESCRIPTION)); break;
#else
#define GET_EFFECT_NAME_BY_ID(VALUE,DESCRIPTION) \
case ##VALUE : return CString(_T(#DESCRIPTION)); break;
case ##VALUE : return std::wstring(_T(#DESCRIPTION)); break;
#endif
#pragma endregion
namespace Animations
{
CString Helpers::GetTimePropertyID4TimeNode ( TimePropertyID4TimeNode Value )
std::wstring Helpers::GetTimePropertyID4TimeNode ( TimePropertyID4TimeNode Value )
{
switch ( Value )
{
GET_ENUM_STRING ( TPID_, Display );
GET_ENUM_STRING ( TPID_, MasterPos );
GET_ENUM_STRING ( TPID_, SlaveType );
GET_ENUM_STRING ( TPID_, EffectID );
GET_ENUM_STRING ( TPID_, EffectDir );
GET_ENUM_STRING ( TPID_, AfterEffect );
GET_ENUM_STRING ( TPID_, SlideCount );
GET_ENUM_STRING ( TPID_, TimeFilter );
GET_ENUM_STRING ( TPID_, EventFilter );
GET_ENUM_STRING ( TPID_, HideWhenStopped );
GET_ENUM_STRING ( TPID_, GroupID );
GET_ENUM_STRING ( TPID_, EffectNodeType );
GET_ENUM_STRING ( TPID_, PlaceholderNode );
GET_ENUM_STRING ( TPID_, MediaVolume );
GET_ENUM_STRING ( TPID_, MediaMute );
GET_ENUM_STRING ( TPID_, ZoomToFullScreen );
GET_ENUM_STRING( TPID_, Display );
GET_ENUM_STRING( TPID_, MasterPos );
GET_ENUM_STRING( TPID_, SlaveType );
GET_ENUM_STRING( TPID_, EffectID );
GET_ENUM_STRING( TPID_, EffectDir );
GET_ENUM_STRING( TPID_, AfterEffect );
GET_ENUM_STRING( TPID_, SlideCount );
GET_ENUM_STRING( TPID_, TimeFilter );
GET_ENUM_STRING( TPID_, EventFilter );
GET_ENUM_STRING( TPID_, HideWhenStopped );
GET_ENUM_STRING( TPID_, GroupID );
GET_ENUM_STRING( TPID_, EffectNodeType );
GET_ENUM_STRING( TPID_, PlaceholderNode );
GET_ENUM_STRING( TPID_, MediaVolume );
GET_ENUM_STRING( TPID_, MediaMute );
GET_ENUM_STRING( TPID_, ZoomToFullScreen );
default:
return CString ( _T("TimePropertyID4TimeNode : Unknown Enum") );
return std::wstring ( _T("TimePropertyID4TimeNode : Unknown Enum") );
}
};
CString Helpers::GetTimeVariantTypeEnum ( TimeVariantTypeEnum Value )
std::wstring Helpers::GetTimeVariantTypeEnum ( TimeVariantTypeEnum Value )
{
switch ( Value )
{
GET_ENUM_STRING ( TVT_, Bool );
GET_ENUM_STRING ( TVT_, Int );
GET_ENUM_STRING ( TVT_, Float );
GET_ENUM_STRING ( TVT_, String );
GET_ENUM_STRING( TVT_, Bool );
GET_ENUM_STRING( TVT_, Int );
GET_ENUM_STRING( TVT_, Float );
GET_ENUM_STRING( TVT_, String );
default:
return CString ( _T("TimeVariantTypeEnum : Unknown Enum") );
return std::wstring ( _T("TimeVariantTypeEnum : Unknown Enum") );
}
};
CString Helpers::GetTimeNodeTypeEnum ( TimeNodeTypeEnum Value )
std::wstring Helpers::GetTimeNodeTypeEnum ( TimeNodeTypeEnum Value )
{
switch ( Value )
{
GET_ENUM_STRING ( TNT_, Parallel );
GET_ENUM_STRING ( TNT_, Sequential );
GET_ENUM_STRING ( TNT_, Behavior );
GET_ENUM_STRING ( TNT_, Media );
GET_ENUM_STRING( TNT_, Parallel );
GET_ENUM_STRING( TNT_, Sequential );
GET_ENUM_STRING( TNT_, Behavior );
GET_ENUM_STRING( TNT_, Media );
default:
return CString ( _T("TimeNodeTypeEnum : Unknown Enum") );
return std::wstring ( _T("TimeNodeTypeEnum : Unknown Enum") );
}
};
CString Helpers::GetTriggerObjectEnum ( TriggerObjectEnum Value )
std::wstring Helpers::GetTriggerObjectEnum ( TriggerObjectEnum Value )
{
switch ( Value )
{
GET_ENUM_STRING ( TOT_, None ); // None
GET_ENUM_STRING ( TOT_, VisualElement ); // An animatable object.
GET_ENUM_STRING ( TOT_, TimeNode ); // A time node.
GET_ENUM_STRING ( TOT_, RuntimeNodeRef ); // Runtime child time nodes.
GET_ENUM_STRING( TOT_, None ); // None
GET_ENUM_STRING( TOT_, VisualElement ); // An animatable object.
GET_ENUM_STRING( TOT_, TimeNode ); // A time node.
GET_ENUM_STRING( TOT_, RuntimeNodeRef ); // Runtime child time nodes.
default:
return CString ( _T("TriggerObjectEnum : Unknown Enum") );
return std::wstring ( _T("TriggerObjectEnum : Unknown Enum") );
}
}
CString Helpers::GetTimeVisualElementEnum ( TimeVisualElementEnum Value )
std::wstring Helpers::GetTimeVisualElementEnum ( TimeVisualElementEnum Value )
{
switch ( Value )
{
GET_ENUM_STRING ( TVET_, Shape );
GET_ENUM_STRING ( TVET_, Page );
GET_ENUM_STRING ( TVET_, TextRange );
GET_ENUM_STRING ( TVET_, Audio );
GET_ENUM_STRING ( TVET_, Video );
GET_ENUM_STRING ( TVET_, ChartElement );
GET_ENUM_STRING ( TVET_, ShapeOnly );
GET_ENUM_STRING ( TVET_, AllTextRange );
GET_ENUM_STRING( TVET_, Shape );
GET_ENUM_STRING( TVET_, Page );
GET_ENUM_STRING( TVET_, TextRange );
GET_ENUM_STRING( TVET_, Audio );
GET_ENUM_STRING( TVET_, Video );
GET_ENUM_STRING( TVET_, ChartElement );
GET_ENUM_STRING( TVET_, ShapeOnly );
GET_ENUM_STRING( TVET_, AllTextRange );
default:
return CString ( _T("TimeVisualElementEnum : Unknown Enum") );
return std::wstring ( _T("TimeVisualElementEnum : Unknown Enum") );
}
}
CString Helpers::GetElementTypeEnum ( ElementTypeEnum Value )
std::wstring Helpers::GetElementTypeEnum ( ElementTypeEnum Value )
{
switch ( Value )
{
GET_ENUM_STRING ( ET_, ShapeType );
GET_ENUM_STRING ( ET_, SoundType );
GET_ENUM_STRING( ET_, ShapeType );
GET_ENUM_STRING( ET_, SoundType );
default:
return CString ( _T("ElementTypeEnum : Unknown Enum") );
return std::wstring ( _T("ElementTypeEnum : Unknown Enum") );
}
}
CString Helpers::GetTimeAnimateBehaviorValueTypeEnum ( TimeAnimateBehaviorValueTypeEnum Value )
std::wstring Helpers::GetTimeAnimateBehaviorValueTypeEnum ( TimeAnimateBehaviorValueTypeEnum Value )
{
switch ( Value )
{
GET_ENUM_STRING ( TABVT_, String );
GET_ENUM_STRING ( TABVT_, Number );
GET_ENUM_STRING ( TABVT_, Color );
GET_ENUM_STRING( TABVT_, String );
GET_ENUM_STRING( TABVT_, Number );
GET_ENUM_STRING( TABVT_, Color );
default:
return CString ( _T("TimeAnimateBehaviorValueTypeEnum : Unknown Enum") );
return std::wstring ( _T("TimeAnimateBehaviorValueTypeEnum : Unknown Enum") );
}
}
CString Helpers::IntToHexString ( DWORD dwValue )
std::wstring Helpers::IntToHexString ( DWORD dwValue )
{
CString sFormat;
sFormat.Format (_T("0x%.8x"), dwValue);
return sFormat;
return XmlUtils::IntToString(dwValue, L"0x%.8x");
}
CString Helpers::DoubleToString ( double dValue )
std::wstring Helpers::DoubleToString ( double dValue )
{
CString sFormat;
sFormat.Format (_T("%f"), dValue);
return sFormat;
return std::to_wstring(dValue);
}
CString Helpers::IntToString ( int nValue )
std::wstring Helpers::IntToString ( int nValue )
{
CString sFormat;
sFormat.Format (_T("%d"), nValue);
return sFormat;
return std::to_wstring(nValue);
}
CString Helpers::GetAnimationClassName ( AnimationsClassType Value )
std::wstring Helpers::GetAnimationClassName ( AnimationsClassType Value )
{
switch ( Value )
{
case Animations::RT_TimeNode:
return CString (_T("TimeNodeAtom") );
return std::wstring (_T("TimeNodeAtom") );
case Animations::RT_TimePropertyList: // Specifies a TimePropertyList4TimeNodeContainer or TimePropertyList4TimeBehavior.
return CString (_T("TimePropertyList4TimeNodeContainer"));
return std::wstring (_T("TimePropertyList4TimeNodeContainer"));
case Animations::RT_TimeExtTimeNodeContainer:
return CString (_T("ExtTimeNodeContainer"));
return std::wstring (_T("ExtTimeNodeContainer"));
case Animations::RT_SlideTime10Atom :
return CString (_T("SlideTime10Atom"));
return std::wstring (_T("SlideTime10Atom"));
case Animations::RT_SlideFlags10Atom:
return CString (_T("SlideFlags10Atom"));
return std::wstring (_T("SlideFlags10Atom"));
case Animations::RT_HashCodeAtom:
return CString (_T("HashCode10Atom"));
return std::wstring (_T("HashCode10Atom"));
case Animations::RT_TimeSequenceData:
return CString (_T("TimeSequenceDataAtom"));
return std::wstring (_T("TimeSequenceDataAtom"));
case Animations::RT_TimeConditionContainer:
return CString (_T("TimeConditionContainer"));
return std::wstring (_T("TimeConditionContainer"));
case Animations::RT_TimeCondition:
return CString (_T("TimeConditionAtom"));
return std::wstring (_T("TimeConditionAtom"));
}
return CString (_T(""));
return std::wstring (_T(""));
}
CString Helpers::GetEffectTypeOfGroup ( DWORD Value )
std::wstring Helpers::GetEffectTypeOfGroup ( DWORD Value )
{
if ( 0x00000001 == Value )
return CString ( _T("Entrance") );
return std::wstring ( _T("Entrance") );
if ( 0x00000002 == Value )
return CString ( _T("Exit") );
return std::wstring ( _T("Exit") );
if ( 0x00000003 == Value )
return CString ( _T("Emphasis") );
return std::wstring ( _T("Emphasis") );
if ( 0x00000004 == Value )
return CString ( _T("MotionPath") );
return std::wstring ( _T("MotionPath") );
if ( 0x00000005 == Value )
return CString ( _T("ActionVerb") );
return std::wstring ( _T("ActionVerb") );
if ( 0x00000006 == Value )
return CString ( _T("MediaCommand") );
return std::wstring ( _T("MediaCommand") );
return CString ( _T("") );
return std::wstring ( _T("") );
}
// the corresponding effect type is an entrance or an exit effect
CString Helpers::GetEffectEntranceOrExitNameByID ( DWORD EffectID )
std::wstring Helpers::GetEffectEntranceOrExitNameByID ( DWORD EffectID )
{
switch ( EffectID )
{
@ -338,11 +332,11 @@ namespace Animations
default :
break;
}
return CString(_T("Unknown EffectID"));
return std::wstring(_T("Unknown EffectID"));
}
// the corresponding effect type is an emphasis effect
CString Helpers::GetEffectEmphasisNameByID ( DWORD EffectID )
std::wstring Helpers::GetEffectEmphasisNameByID ( DWORD EffectID )
{
switch ( EffectID )
{
@ -385,10 +379,10 @@ namespace Animations
default :
break;
}
return CString(_T("Unknown EffectID"));
return std::wstring(_T("Unknown EffectID"));
}
// the corresponding effect type is a motion path effect
CString Helpers::GetEffectMotionPathNameByID ( DWORD EffectID )
std::wstring Helpers::GetEffectMotionPathNameByID ( DWORD EffectID )
{
switch ( EffectID )
{
@ -460,10 +454,10 @@ namespace Animations
default :
break;
}
return CString(_T("Unknown EffectID"));
return std::wstring(_T("Unknown EffectID"));
}
CString Helpers::GetEffectNameByID ( DWORD EffectType, DWORD EffectID )
std::wstring Helpers::GetEffectNameByID ( DWORD EffectType, DWORD EffectID )
{
switch ( EffectType )
{
@ -483,7 +477,7 @@ namespace Animations
break;
}
return CString ( _T("") );
return std::wstring ( _T("") );
}
}

View File

@ -194,20 +194,22 @@ namespace Animations
double X[3];
double Y[3];
WCHAR TYPE; // // M = move to // L = line to // C = curve to // Z = close loop // E = end
wchar_t TYPE; // // M = move to // L = line to // C = curve to // Z = close loop // E = end
};
public:
inline bool Create ( CStringW MovePath )
inline bool Create ( std::wstring MovePath )
{
m_Points.clear ();
int Pos = 0;
while ( Pos < MovePath.GetLength () )
std::vector<std::wstring> arMovePath;
boost::algorithm::split(arMovePath, MovePath, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
for (int i = 0 ; i < arMovePath.size(); i++)
{
ActionPoint aPoint;
aPoint.TYPE = MovePath.Tokenize ( L" ", Pos )[0];
aPoint.TYPE = arMovePath[i++][0];
if ( L'm' == aPoint.TYPE ) aPoint.TYPE = MOVE_TO;
if ( L'l' == aPoint.TYPE ) aPoint.TYPE = LINE_TO;
@ -217,20 +219,20 @@ namespace Animations
if ( MOVE_TO == aPoint.TYPE || LINE_TO == aPoint.TYPE )
{
aPoint.X[0] = _wtof ( MovePath.Tokenize ( L" ", Pos ) );
aPoint.Y[0] = _wtof ( MovePath.Tokenize ( L" ", Pos ) );
aPoint.X[0] = _wtof ( arMovePath[i++].c_str() );
aPoint.Y[0] = _wtof ( arMovePath[i++].c_str() );
}
if ( CURVE_TO == aPoint.TYPE )
{
aPoint.X[0] = _wtof ( MovePath.Tokenize ( L" ", Pos ) );
aPoint.Y[0] = _wtof ( MovePath.Tokenize ( L" ", Pos ) );
aPoint.X[0] = _wtof ( arMovePath[i++].c_str() );
aPoint.Y[0] = _wtof ( arMovePath[i++].c_str() );
aPoint.X[1] = _wtof ( MovePath.Tokenize ( L" ", Pos ) );
aPoint.Y[1] = _wtof ( MovePath.Tokenize ( L" ", Pos ) );
aPoint.X[1] = _wtof ( arMovePath[i++].c_str() );
aPoint.Y[1] = _wtof ( arMovePath[i++].c_str() );
aPoint.X[2] = _wtof ( MovePath.Tokenize ( L" ", Pos ) );
aPoint.Y[2] = _wtof ( MovePath.Tokenize ( L" ", Pos ) );
aPoint.X[2] = _wtof ( arMovePath[i++].c_str() );
aPoint.Y[2] = _wtof ( arMovePath[i++].c_str() );
}
m_Points.push_back ( aPoint );
@ -239,52 +241,37 @@ namespace Animations
return ( m_Points.size() >= 2 );
}
inline CStringW Recalculate ( double ScaleX, double ScaleY )
inline std::wstring Recalculate ( double ScaleX, double ScaleY )
{
CStringW MovePath;
std::wstring MovePath;
for ( int i = 0; i < m_Points.size(); ++i )
{
CStringW NextPoint;
std::wstring NextPoint;
if ( MOVE_TO == m_Points[i].TYPE )
{
NextPoint.Format ( L"M %f %f",
m_Points[i].X[0] * ScaleX, m_Points[i].Y[0] * ScaleY );
if ( MOVE_TO == m_Points[i].TYPE ) NextPoint = L"M";
if ( LINE_TO == m_Points[i].TYPE ) NextPoint = L"L";
if ( CURVE_TO == m_Points[i].TYPE ) NextPoint = L"C";
if ( CLOSE_LOOP == m_Points[i].TYPE ) NextPoint = L"Z";
if ( END == m_Points[i].TYPE ) NextPoint = L"E";
MovePath += NextPoint;
}
if ( CURVE_TO == m_Points[i].TYPE ||
MOVE_TO == m_Points[i].TYPE ||
LINE_TO == m_Points[i].TYPE)
{
NextPoint += L" " + std::to_wstring(m_Points[i].X[0] * ScaleX) + L" " + std::to_wstring(m_Points[i].Y[0] * ScaleY);
}
if ( LINE_TO == m_Points[i].TYPE )
{
NextPoint.Format ( L"L %f %f",
m_Points[i].X[0] * ScaleX, m_Points[i].Y[0] * ScaleY );
if ( CURVE_TO == m_Points[i].TYPE )
{
NextPoint += L" " + std::to_wstring(m_Points[i].X[1] * ScaleX) + L" " + std::to_wstring(m_Points[i].Y[1] * ScaleY);
NextPoint += L" " + std::to_wstring(m_Points[i].X[2] * ScaleX) + L" " + std::to_wstring(m_Points[i].Y[2] * ScaleY);
}
MovePath += NextPoint;
MovePath += NextPoint;
}
if ( CURVE_TO == m_Points[i].TYPE )
{
NextPoint.Format ( L"C %f %f %f %f %f %f",
m_Points[i].X[0] * ScaleX, m_Points[i].Y[0] * ScaleY,
m_Points[i].X[1] * ScaleX, m_Points[i].Y[1] * ScaleY,
m_Points[i].X[2] * ScaleX, m_Points[i].Y[2] * ScaleY );
MovePath += NextPoint;
}
if ( CLOSE_LOOP == m_Points[i].TYPE )
{
MovePath += CStringW ( L"Z" );
}
if ( END == m_Points[i].TYPE )
{
MovePath += CStringW ( L"E" );
}
if ( i != m_Points.size() - 1 )
MovePath += CStringW ( L" ");
MovePath += std::wstring ( L" ");
}
return MovePath;
@ -305,27 +292,27 @@ namespace Animations
class Helpers
{
public:
static CString GetTimePropertyID4TimeNode ( TimePropertyID4TimeNode Value );
static CString GetTimeVariantTypeEnum ( TimeVariantTypeEnum Value );
static CString GetTimeNodeTypeEnum ( TimeNodeTypeEnum Value );
static CString GetTriggerObjectEnum ( TriggerObjectEnum Value );
static CString GetTimeVisualElementEnum ( TimeVisualElementEnum Value );
static CString GetElementTypeEnum ( ElementTypeEnum Value );
static CString GetTimeAnimateBehaviorValueTypeEnum ( TimeAnimateBehaviorValueTypeEnum Value );
static CString IntToHexString ( DWORD Value );
static CString DoubleToString ( double Value );
static CString IntToString ( int Value );
static CString GetAnimationClassName ( AnimationsClassType Value );
static std::wstring GetTimePropertyID4TimeNode ( TimePropertyID4TimeNode Value );
static std::wstring GetTimeVariantTypeEnum ( TimeVariantTypeEnum Value );
static std::wstring GetTimeNodeTypeEnum ( TimeNodeTypeEnum Value );
static std::wstring GetTriggerObjectEnum ( TriggerObjectEnum Value );
static std::wstring GetTimeVisualElementEnum ( TimeVisualElementEnum Value );
static std::wstring GetElementTypeEnum ( ElementTypeEnum Value );
static std::wstring GetTimeAnimateBehaviorValueTypeEnum ( TimeAnimateBehaviorValueTypeEnum Value );
static std::wstring IntToHexString ( DWORD Value );
static std::wstring DoubleToString ( double Value );
static std::wstring IntToString ( int Value );
static std::wstring GetAnimationClassName ( AnimationsClassType Value );
static CString GetEffectTypeOfGroup ( DWORD Value );
static std::wstring GetEffectTypeOfGroup ( DWORD Value );
// the corresponding effect type is an entrance or an exit effect
static CString GetEffectEntranceOrExitNameByID ( DWORD EffectID );
static std::wstring GetEffectEntranceOrExitNameByID ( DWORD EffectID );
// the corresponding effect type is an emphasis effect
static CString GetEffectEmphasisNameByID ( DWORD EffectID );
static std::wstring GetEffectEmphasisNameByID ( DWORD EffectID );
// the corresponding effect type is a motion path effect
static CString GetEffectMotionPathNameByID ( DWORD EffectID );
static std::wstring GetEffectMotionPathNameByID ( DWORD EffectID );
static CString GetEffectNameByID ( DWORD EffectType, DWORD EffectID );
static std::wstring GetEffectNameByID ( DWORD EffectType, DWORD EffectID );
};
}
@ -699,7 +686,7 @@ namespace Animations
//todoooo
}
else
stringValue = CStringW ( pString );
stringValue = std::wstring ( pString );
}
RELEASEARRAYOBJECTS ( pString );
@ -716,7 +703,7 @@ namespace Animations
public:
TimeVariantTypeEnum m_Type;
CStringW stringValue;
std::wstring stringValue;
};
struct TimeStringListContainer : public IRecord
@ -3273,10 +3260,10 @@ namespace Animations
if (pTimeNode->haveSetBehavior)
{
if (9 == oEffect.m_nEffectID) // TransparencyEffect = 9, // временная прозрачность
oEffect.m_dTransparency = _tstof (pTimeNode->timeSetBehavior->varTo.stringValue);
oEffect.m_dTransparency = _tstof (pTimeNode->timeSetBehavior->varTo.stringValue.c_str());
}
if (m_ComposeEffectMothionPath.GetLength())
if (m_ComposeEffectMothionPath.length())
{
oEffect.m_MotionPath = m_ComposeEffectMothionPath; // составной эффект может иметь траекторию для движения
}
@ -3754,7 +3741,7 @@ namespace Animations
TimeArray m_arDurations;
TimeArray m_arBeginTimes;
CString m_ComposeEffectMothionPath;
std::wstring m_ComposeEffectMothionPath;
bool m_HaveAfterEffect;
EffectsMap m_oAnimation;
@ -3877,9 +3864,9 @@ public:
pStream->read ((unsigned char*) Name, 16 );
Name[8] = L'\0';
tagName = CStringW ( Name );
tagName = std::wstring ( Name );
if ( CStringW ( L"___PPT10" ) == tagName )
if ( std::wstring ( L"___PPT10" ) == tagName )
{
SRecordHeader rhData;
rhData.ReadFromStream(pStream) ;
@ -3915,7 +3902,7 @@ public:
public:
CStringW tagName;
std::wstring tagName;
PP10SlideBinaryTagExtension m_PP10SlideBinaryTagExtension;

View File

@ -35,7 +35,7 @@
class CRecordBookmarkEntityAtom : public CUnknownRecord
{
UINT m_nID;
CStringW m_strName;
std::wstring m_strName;
public:
@ -52,4 +52,4 @@ public:
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
};
};

View File

@ -36,9 +36,9 @@ class CRecordDocRoutingSlipAtom : public CUnknownRecord
{
struct SDocRoutingSlipAtom
{
USHORT m_nType;
USHORT m_nLength;
CString m_strText;
USHORT m_nType;
USHORT m_nLength;
std::wstring m_strText;
};
UINT m_nLength;
@ -66,4 +66,4 @@ public:
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
};
};

View File

@ -31,7 +31,7 @@
*/
#include "ArtBlip.h"
#include "../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../../../DesktopEditor/common/Directory.h"
#include "../../Reader/PPTDocumentInfo.h"

View File

@ -1867,12 +1867,12 @@ public:
return etShape;
}
AVSINLINE CString GetFileName(CString strFilePath)
AVSINLINE std::wstring GetFileName(std::wstring strFilePath)
{
int nIndex = strFilePath.ReverseFind(TCHAR('\\'));
int nIndex = strFilePath.rfind(TCHAR('\\'));
if (-1 != nIndex)
{
return strFilePath.Mid(nIndex + 1);
return strFilePath.substr(nIndex + 1);
}
return strFilePath;
}

View File

@ -35,7 +35,7 @@
class CRecordFontEntityAtom : public CUnknownRecord
{
public:
CStringW m_strFaceName;
std::wstring m_strFaceName;
BYTE m_lfCharSet;
@ -84,13 +84,13 @@ public:
, &pStrUtf32_Conv, &pStrUtf32 [lLen]
, strictConversion))
{
m_strFaceName = CString((wchar_t*)pStrUtf32/*, lLen*/);
m_strFaceName = std::wstring((wchar_t*)pStrUtf32/*, lLen*/);
}
delete [] pStrUtf32;
}
else
{
m_strFaceName = CString((wchar_t*)utf16FaceName/*, lReadByte/2*/); // по факту .. нули нам не нужны
m_strFaceName = std::wstring((wchar_t*)utf16FaceName/*, lReadByte/2*/); // по факту .. нули нам не нужны
}
m_lfCharSet = StreamUtils::ReadBYTE(pStream);

View File

@ -34,7 +34,7 @@
class CRecordRoundTripColorMappingAtom : public CUnknownRecord
{
CStringW m_pString;
std::wstring m_pString;
public:
@ -50,4 +50,4 @@ public:
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
};
};

View File

@ -34,7 +34,7 @@
class CRecordRoundTripThemeAtom : public CUnknownRecord
{
CString m_strData;
std::wstring m_strData;
public:
@ -50,4 +50,4 @@ public:
{
return CUnknownRecord::ReadFromStream(oHeader, pStream);
}
};
};

File diff suppressed because it is too large Load Diff

View File

@ -83,7 +83,7 @@ namespace PPTX
class CStringTrimmer
{
public:
std::vector<CString> m_arParams;
std::vector<std::wstring> m_arParams;
TCHAR m_Separator;
public:
@ -91,7 +91,7 @@ namespace PPTX
~CStringTrimmer();
public:
void LoadFromString(CString& strParams);
void LoadFromString(std::wstring& strParams);
double GetParameter(int nIndex, double dDefault);
};
@ -99,8 +99,8 @@ namespace PPTX
class CCSS
{
public:
std::map<CString, CString> m_mapSettings;
CString m_strClassName;
std::map<std::wstring, std::wstring> m_mapSettings;
std::wstring m_strClassName;
public:
CCSS();
@ -108,8 +108,8 @@ namespace PPTX
AVSINLINE void Clear();
public:
void LoadFromString(CString& strParams);
void LoadFromString2(CString& strParams);
void LoadFromString(std::wstring& strParams);
void LoadFromString2(std::wstring& strParams);
};
class CStylesCSS
@ -123,7 +123,7 @@ namespace PPTX
AVSINLINE void Clear();
public:
void LoadStyles(CString& strParams);
void LoadStyles(std::wstring& strParams);
};
}
class CSpTreeElemProps
@ -181,9 +181,9 @@ namespace NSBinPptxRW
};
std::map<CString, CShape*> m_mapShapeTypes;
std::map<CString, NSCommon::smart_ptr<PPTX::CCommonRels>> m_mapRels;
CString m_strCurrentRelsPath;
std::map<std::wstring, CShape*> m_mapShapeTypes;
std::map<std::wstring, NSCommon::smart_ptr<PPTX::CCommonRels>> m_mapRels;
std::wstring m_strCurrentRelsPath;
NSBinPptxRW::CBinaryFileWriter* m_pBinaryWriter;
int m_lNextId;
@ -200,45 +200,47 @@ namespace NSBinPptxRW
NSCommon::smart_ptr<PPTX::WrapperFile>* m_pTheme;
NSCommon::smart_ptr<PPTX::WrapperWritingElement>* m_pClrMap;
CString m_strFontDirectory;
std::wstring m_strFontDirectory;
CDrawingConverter();
~CDrawingConverter();
HRESULT SetMainDocument (BinDocxRW::CDocxSerializer* pDocument);
HRESULT SetRelsPath (const CString& bsRelsPath);
CString GetRelsPath ();
HRESULT SetMediaDstPath (const CString& bsMediaPath);
HRESULT SetEmbedDstPath (const CString& bsEmbedPath);
HRESULT SetRelsPath (const std::wstring& bsRelsPath);
std::wstring GetRelsPath ();
HRESULT SetMediaDstPath (const std::wstring& bsMediaPath);
HRESULT SetEmbedDstPath (const std::wstring& bsEmbedPath);
HRESULT AddShapeType (const CString& bsXml);
HRESULT AddObject (const CString& bsXml, CString** pMainProps);
HRESULT GetThemeBinary (BYTE** ppBinary, long& lBinarySize, const CString& bsThemeFilePath);
HRESULT AddShapeType (const std::wstring& bsXml);
HRESULT AddObject (const std::wstring& bsXml, std::wstring** pMainProps);
HRESULT GetThemeBinary (BYTE** ppBinary, long& lBinarySize, const std::wstring& bsThemeFilePath);
HRESULT SaveThemeXml (long lStart, long lLength, const CString& bsThemePath);
HRESULT SaveObject (long lStart, long lLength, const CString& bsMainProps, CString** bsXml);
HRESULT SaveObjectEx (long lStart, long lLength, const CString& bsMainProps, long lDocType, CString** bsXml);
void SaveObjectExWriterInit(NSBinPptxRW::CXmlWriter& oXmlWriter, LONG lDocType);
void SaveObjectExWriterRelease(NSBinPptxRW::CXmlWriter& oXmlWriter);
std::wstring SaveObjectBackground(LONG lStart, LONG lLength);
HRESULT SaveThemeXml (long lStart, long lLength, const std::wstring& bsThemePath);
HRESULT SaveObject (long lStart, long lLength, const std::wstring& bsMainProps, std::wstring & sXml);
HRESULT SaveObjectEx (long lStart, long lLength, const std::wstring& bsMainProps, long lDocType, std::wstring & sXml);
HRESULT GetRecordBinary (long lRecordType, const CString& bsXml);
HRESULT GetRecordXml (long lStart, long lLength, long lRecType, long lDocType, CString** bsXml);
void SaveObjectExWriterInit (NSBinPptxRW::CXmlWriter& oXmlWriter, LONG lDocType);
void SaveObjectExWriterRelease (NSBinPptxRW::CXmlWriter& oXmlWriter);
std::wstring SaveObjectBackground(LONG lStart, LONG lLength);
HRESULT GetRecordBinary (long lRecordType, const std::wstring& bsXml);
HRESULT GetRecordXml (long lStart, long lLength, long lRecType, long lDocType, std::wstring & sXml);
HRESULT SetDstContentRels ();
HRESULT SaveDstContentRels (const CString& bsRelsPath);
HRESULT WriteRels (const CString& bsType, const CString& bsTarget, const CString& bsTargetMode, long* lId);
HRESULT LoadClrMap (const CString& bsXml);
HRESULT SaveDstContentRels (const std::wstring& bsRelsPath);
HRESULT WriteRels (const std::wstring& bsType, const std::wstring& bsTarget, const std::wstring& bsTargetMode, long* lId);
HRESULT LoadClrMap (const std::wstring& bsXml);
HRESULT(GetTxBodyBinary) (const CString& bsXml);
HRESULT(GetTxBodyXml) (long lStart, long lLength, CString** pbstrXml);
HRESULT(SetFontDir) (const CString& bsFontDir);
HRESULT(GetTxBodyBinary) (const std::wstring& bsXml);
HRESULT(GetTxBodyXml) (long lStart, std::wstring & Xml);
HRESULT(SetFontDir) (const std::wstring& bsFontDir);
HRESULT SetFontPicker (COfficeFontPicker* pFontPicker);
HRESULT SetAdditionalParam(const CString& ParamName, BYTE *pArray, size_t szCount);
HRESULT GetAdditionalParam(const CString& ParamName, BYTE **pArray, size_t& szCount);
HRESULT SetAdditionalParam(const std::wstring& ParamName, BYTE *pArray, size_t szCount);
HRESULT GetAdditionalParam(const std::wstring& ParamName, BYTE **pArray, size_t& szCount);
void SetFontManager (CFontManager* pFontManager);
@ -256,25 +258,25 @@ namespace NSBinPptxRW
protected:
nullable<PPTX::Logic::Xfrm> m_oxfrm_override;
bool ParceObject (const CString& strXml, CString** pMainProps);
void SendMainProps (const CString& strMainProps, CString**& pMainProps);
bool ParceObject (const std::wstring& strXml, std::wstring** pMainProps);
void SendMainProps (const std::wstring& strMainProps, std::wstring**& pMainProps);
PPTX::Logic::SpTreeElem doc_LoadShape(XmlUtils::CXmlNode& oNodeShape, CString**& pMainProps, bool bIsTop = true);
PPTX::Logic::SpTreeElem doc_LoadGroup(XmlUtils::CXmlNode& oNode, CString**& pMainProps, bool bIsTop = true);
PPTX::Logic::SpTreeElem doc_LoadShape(XmlUtils::CXmlNode& oNodeShape, std::wstring**& pMainProps, bool bIsTop = true);
PPTX::Logic::SpTreeElem doc_LoadGroup(XmlUtils::CXmlNode& oNode, std::wstring**& pMainProps, bool bIsTop = true);
CString GetVMLShapeXml (CPPTShape* pPPTShape);
CString GetVMLShapeXml (PPTX::Logic::SpTreeElem& oElem);
std::wstring GetVMLShapeXml (CPPTShape* pPPTShape);
std::wstring GetVMLShapeXml (PPTX::Logic::SpTreeElem& oElem);
void CheckBrushShape (PPTX::Logic::SpTreeElem& oElem, XmlUtils::CXmlNode& oNode, PPTShapes::ShapeType eType, CPPTShape* pPPTShape);
void CheckPenShape (PPTX::Logic::SpTreeElem& oElem, XmlUtils::CXmlNode& oNode, PPTShapes::ShapeType eType, CPPTShape* pPPTShape);
void LoadCoordSize (XmlUtils::CXmlNode& oNode, ::CShape* pShape);
CString GetDrawingMainProps (XmlUtils::CXmlNode& oNode, PPTX::CCSS& oCssStyles, CSpTreeElemProps& oProps);
std::wstring GetDrawingMainProps (XmlUtils::CXmlNode& oNode, PPTX::CCSS& oCssStyles, CSpTreeElemProps& oProps);
void ConvertMainPropsToVML (const CString& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter, PPTX::Logic::SpTreeElem& oElem);
void ConvertPicVML (PPTX::Logic::SpTreeElem& oElem, const CString& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter);
void ConvertShapeVML (PPTX::Logic::SpTreeElem& oShape, const CString& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter);
void ConvertGroupVML (PPTX::Logic::SpTreeElem& oGroup, const CString& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter);
void ConvertMainPropsToVML (const std::wstring& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter, PPTX::Logic::SpTreeElem& oElem);
void ConvertPicVML (PPTX::Logic::SpTreeElem& oElem, const std::wstring& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter);
void ConvertShapeVML (PPTX::Logic::SpTreeElem& oShape, const std::wstring& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter);
void ConvertGroupVML (PPTX::Logic::SpTreeElem& oGroup, const std::wstring& bsMainProps, NSBinPptxRW::CXmlWriter& oWriter);
void ConvertTextVML (XmlUtils::CXmlNode &nodeTextBox, PPTX::Logic::Shape* pShape);

View File

@ -52,16 +52,16 @@ class CPPTXFile : public PPTX::IPPTXEvent
{
private:
PPTX::Folder* m_pFolder;
CString m_strTempDir;
CString m_strDirectory;
std::wstring m_strTempDir;
std::wstring m_strDirectory;
// writer to ppty
CString m_strFontDirectory;
CString m_strMediaDirectory;
std::wstring m_strFontDirectory;
std::wstring m_strMediaDirectory;
bool m_bIsUseSystemFonts;
CString m_strEmbeddedFontsDirectory;
std::wstring m_strEmbeddedFontsDirectory;
CString m_strFolderThemes;
std::wstring m_strFolderThemes;
//load_from_resource m_fCallbackResource;
extract_to_directory m_fCallbackExtract;

View File

@ -37,7 +37,9 @@
#include <shellapi.h>
#include <shlobj.h>
#include <shlwapi.h>
#pragma comment( lib, "Rpcrt4.lib" )
#pragma comment( lib, "shell32.lib" ) // добавить shell32.lib
#pragma comment( lib, "Shlwapi.lib" )
#else
#endif
@ -51,13 +53,13 @@ CPPTXFile::CPPTXFile(extract_to_directory fCallbackExtract, compress_from_direct
#if defined(_WIN32) || defined (_WIN64)
WCHAR buffer[4096];
GetTempPathW(4096, buffer);
m_strTempDir = CStringW(buffer);
m_strTempDir = std::wstring(buffer);
GetLongPathName(m_strTempDir.GetString(), buffer, 4096);
m_strTempDir = CStringW(buffer) + CStringW("_PPTX\\");
GetLongPathName(m_strTempDir.c_str(), buffer, 4096);
m_strTempDir = std::wstring(buffer) + std::wstring(L"_PPTX\\");
#else
m_strTempDir = FileSystem::Directory::GetTempPath();
m_strTempDir = FileSystem::Directory::GetLongPathName_(m_strTempDir) + CString("_PPTX/");
m_strTempDir = NSDirectory::GetTempPath();
m_strTempDir = NSDirectory::GetLongPathName_(m_strTempDir) + std::wstring("_PPTX/");
#endif
//
m_strFontDirectory = _T("");
@ -89,7 +91,7 @@ HRESULT CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath
std::wstring localTempDir(sDstPath);
if(!localTempDir.empty())
{
bool res = FileSystem::Directory::CreateDirectory(localTempDir);
bool res = NSDirectory::CreateDirectory(localTempDir);
if (res == false) return S_FALSE;
//int res = SHCreateDirectoryExW(NULL, localTempDir.GetString(), NULL);
//if((res != ERROR_SUCCESS) && (res != ERROR_ALREADY_EXISTS) && (res != ERROR_FILE_EXISTS))
@ -98,7 +100,7 @@ HRESULT CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath
}
else
{
bool res = FileSystem::Directory::CreateDirectory(m_strTempDir);
bool res = NSDirectory::CreateDirectory(m_strTempDir);
if (res == false) return S_FALSE;
// int res = SHCreateDirectoryExW(NULL, m_strTempDir, NULL);
// if((res != ERROR_SUCCESS) && (res != ERROR_ALREADY_EXISTS) && (res != ERROR_FILE_EXISTS))
@ -110,7 +112,7 @@ HRESULT CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath
SHFILEOPSTRUCTW shfos;
ZeroMemory(&shfos, sizeof(shfos));
shfos.wFunc = FO_DELETE;
CStringW _local = localTempDir + CStringW(L"*.*");
std::wstring _local = localTempDir + std::wstring(L"*.*");
_local.AppendChar(0);
_local.AppendChar(0);
shfos.pFrom = _local.GetString();
@ -146,14 +148,14 @@ HRESULT CPPTXFile::LoadFromFile(std::wstring sSrcFileName, std::wstring sDstPath
smart_ptr<PPTX::Presentation> presentation = m_pFolder->get(PPTX::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
if (!presentation.is_init())
{
FileSystem::Directory::DeleteDirectory(m_strTempDir, false);
NSDirectory::DeleteDirectory(m_strTempDir, false);
return S_FALSE;
}
m_strDirectory = (CString)sSrcFileName;
int nIndex = m_strDirectory.ReverseFind(FILE_SEPARATOR_CHAR);
m_strDirectory = sSrcFileName;
int nIndex = m_strDirectory.rfind(FILE_SEPARATOR_CHAR);
if (-1 != nIndex)
m_strDirectory = m_strDirectory.Mid(0, nIndex);
m_strDirectory = m_strDirectory.substr(0, nIndex);
return S_OK;
}
@ -163,36 +165,32 @@ HRESULT CPPTXFile::SaveToFile(std::wstring sDstFileName, std::wstring sSrcPath,
return S_FALSE;
OOX::CPath oPath;
oPath.m_strFilename = CString(sSrcPath);
oPath.m_strFilename = std::wstring(sSrcPath);
m_pFolder->write(oPath);
CString srcFilePath = sSrcPath;
CString dstFileName = sDstFileName;
std::wstring srcFilePath = sSrcPath;
std::wstring dstFileName = sDstFileName;
return m_fCallbackCompress ? (m_fCallbackCompress(m_pCallbackArg, srcFilePath, dstFileName) ? S_OK : S_FALSE) : S_OK;
}
HRESULT CPPTXFile::get_TempDirectory(std::wstring* pVal)
{
#if defined(_WIN32) || defined (_WIN64)
*pVal = m_strTempDir.AllocSysString();
#else
*pVal = m_strTempDir;
#endif
return S_OK;
}
HRESULT CPPTXFile::put_TempDirectory(std::wstring newVal)
{
CStringW TempStr(newVal);
std::wstring TempStr(newVal);
#if defined(_WIN32) || defined (_WIN64)
if(PathIsDirectoryW(TempStr.GetString()))
if(PathIsDirectoryW(TempStr.c_str()))
{
if(TempStr.Right(1) != L"\\")
if(TempStr.substr(TempStr.length() - 2, 1) != L"\\")
TempStr += L"\\";
m_strTempDir = TempStr;
return S_OK;
}
#else
if(FileSystem::Directory::PathIsDirectory(TempStr))
if(NSDirectory::PathIsDirectory(TempStr))
{
if(TempStr.Right(1) != _T("/"))
TempStr += _T("/");
@ -258,21 +256,21 @@ HRESULT CPPTXFile::SetUseSystemFonts(bool val)
}
HRESULT CPPTXFile::OpenFileToPPTY(std::wstring bsInput, std::wstring bsOutput)
{
if (m_strTempDir.GetLength() < 1)
if (m_strTempDir.empty())
{
m_strTempDir = FileSystem::Directory::GetTempPath();
m_strTempDir = NSDirectory::GetTempPath();
}
FileSystem::Directory::CreateDirectory(m_strTempDir);
NSDirectory::CreateDirectory(m_strTempDir);
OOX::CPath pathLocalInputTemp = FileSystem::Directory::CreateDirectoryWithUniqueName(m_strTempDir);
OOX::CPath pathLocalInputTemp = NSDirectory::CreateDirectoryWithUniqueName(m_strTempDir);
bool notDeleteInput = false;
if (m_fCallbackExtract)
{
CString strInput = bsInput;
CString strOutput = pathLocalInputTemp.GetPath();
std::wstring strInput = bsInput;
std::wstring strOutput = pathLocalInputTemp.GetPath();
if(!m_fCallbackExtract(m_pCallbackArg, strInput , strOutput))
{
@ -290,7 +288,7 @@ HRESULT CPPTXFile::OpenFileToPPTY(std::wstring bsInput, std::wstring bsOutput)
HRESULT hr = OpenDirectoryToPPTY(bsLocalInputTemp, bsOutput);
if (notDeleteInput == false)
FileSystem::Directory::DeleteDirectory(pathLocalInputTemp.GetPath());
NSDirectory::DeleteDirectory(pathLocalInputTemp.GetPath());
return hr;
}
@ -316,7 +314,7 @@ HRESULT CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutp
smart_ptr<PPTX::Presentation> presentation = m_pFolder->get(PPTX::FileTypes::Presentation).smart_dynamic_cast<PPTX::Presentation>();
if (!presentation.is_init())
{
FileSystem::Directory::DeleteDirectory(m_strTempDir, false);
NSDirectory::DeleteDirectory(m_strTempDir, false);
return S_FALSE;
}
@ -336,11 +334,11 @@ HRESULT CPPTXFile::OpenDirectoryToPPTY(std::wstring bsInput, std::wstring bsOutp
oBinaryWriter.m_pCommon->m_pImageManager->m_strDstMedia = m_strMediaDirectory;
oBinaryWriter.m_pCommon->m_pImageManager->SetFontManager(oBinaryWriter.m_pCommon->m_pNativePicker->m_pFontManager);
FileSystem::Directory::CreateDirectory(m_strMediaDirectory);
NSDirectory::CreateDirectory(m_strMediaDirectory);
if (_T("") != m_strEmbeddedFontsDirectory)
{
FileSystem::Directory::CreateDirectory(m_strEmbeddedFontsDirectory);
NSDirectory::CreateDirectory(m_strEmbeddedFontsDirectory);
if (NULL != oBinaryWriter.m_pCommon->m_pFontPicker)
{
@ -375,14 +373,14 @@ HRESULT CPPTXFile::ConvertPPTYToPPTX(std::wstring bsInput, std::wstring bsOutput
oWriter.Init(pathLocalTempDirectory.GetPath());
CFile oFileBinary;
oFileBinary.OpenFile((CString)bsInput);
oFileBinary.OpenFile((std::wstring)bsInput);
LONG lFileSize = (LONG)oFileBinary.GetFileSize();
BYTE* pSrcBuffer = new BYTE[lFileSize];
oFileBinary.ReadFile(pSrcBuffer, (DWORD)lFileSize);
oFileBinary.CloseFile();
CString strBsInput = bsInput;
CString srcFolder = FileSystem::Directory::GetFolderPath(strBsInput);
std::wstring strBsInput = bsInput;
std::wstring srcFolder = NSDirectory::GetFolderPath(strBsInput);
oWriter.OpenPPTY(pSrcBuffer, lFileSize, srcFolder, bsThemesFolder);
@ -391,12 +389,12 @@ HRESULT CPPTXFile::ConvertPPTYToPPTX(std::wstring bsInput, std::wstring bsOutput
if (m_fCallbackCompress)
{
CString strOutput = bsOutput;
CString strInput = pathLocalTempDirectory.GetPath();
std::wstring strOutput = bsOutput;
std::wstring strInput = pathLocalTempDirectory.GetPath();
hRes = m_fCallbackCompress(m_pCallbackArg, strInput, strOutput) ? S_OK : S_FALSE;
FileSystem::Directory::DeleteDirectory(strInput);
NSDirectory::DeleteDirectory(strInput);
}
return hRes;
}

View File

@ -52,6 +52,6 @@ namespace FileSystem {
static StringArray GetFilesInDirectory(LPCTSTR path, const bool& andSubdirectories = false);
static StringArray GetFilesInDirectory(const String& path, const bool& andSubdirectories = false);
static int GetFilesCount(const CString& path, const bool& recursive = false);
static int GetFilesCount(const std::wstring& path, const bool& recursive = false);
};
}

View File

@ -184,84 +184,84 @@ namespace NSBinPptxRW
#define SPTREE_TYPE_GRFRAME 5
#define SPTREE_TYPE_OLE 6
static BYTE SchemeClr_GetBYTECode(const CString& sValue)
static BYTE SchemeClr_GetBYTECode(const std::wstring& sValue)
{
if (_T("accent1") == sValue)
if ((L"accent1") == sValue)
return 0;
if (_T("accent2") == sValue)
if ((L"accent2") == sValue)
return 1;
if (_T("accent3") == sValue)
if ((L"accent3") == sValue)
return 2;
if (_T("accent4") == sValue)
if ((L"accent4") == sValue)
return 3;
if (_T("accent5") == sValue)
if ((L"accent5") == sValue)
return 4;
if (_T("accent6") == sValue)
if ((L"accent6") == sValue)
return 5;
if (_T("bg1") == sValue)
if ((L"bg1") == sValue)
return 6;
if (_T("bg2") == sValue)
if ((L"bg2") == sValue)
return 7;
if (_T("dk1") == sValue)
if ((L"dk1") == sValue)
return 8;
if (_T("dk2") == sValue)
if ((L"dk2") == sValue)
return 9;
if (_T("folHlink") == sValue)
if ((L"folHlink") == sValue)
return 10;
if (_T("hlink") == sValue)
if ((L"hlink") == sValue)
return 11;
if (_T("lt1") == sValue)
if ((L"lt1") == sValue)
return 12;
if (_T("lt2") == sValue)
if ((L"lt2") == sValue)
return 13;
if (_T("phClr") == sValue)
if ((L"phClr") == sValue)
return 14;
if (_T("tx1") == sValue)
if ((L"tx1") == sValue)
return 15;
if (_T("tx2") == sValue)
if ((L"tx2") == sValue)
return 16;
return 0;
}
static CString SchemeClr_GetStringCode(const BYTE& val)
static std::wstring SchemeClr_GetStringCode(const BYTE& val)
{
switch (val)
{
case 0:
return _T("accent1");
return (L"accent1");
case 1:
return _T("accent2");
return (L"accent2");
case 2:
return _T("accent3");
return (L"accent3");
case 3:
return _T("accent4");
return (L"accent4");
case 4:
return _T("accent5");
return (L"accent5");
case 5:
return _T("accent6");
return (L"accent6");
case 6:
return _T("bg1");
return (L"bg1");
case 7:
return _T("bg2");
return (L"bg2");
case 8:
return _T("dk1");
return (L"dk1");
case 9:
return _T("dk2");
return (L"dk2");
case 10:
return _T("folHlink");
return (L"folHlink");
case 11:
return _T("hlink");
return (L"hlink");
case 12:
return _T("lt1");
return (L"lt1");
case 13:
return _T("lt2");
return (L"lt2");
case 14:
return _T("phClr");
return (L"phClr");
case 15:
return _T("tx1");
return (L"tx1");
case 16:
return _T("tx2");
return (L"tx2");
}
return _T("accent1");
return (L"accent1");
}
#define XMLWRITER_DOC_TYPE_PPTX 0

View File

@ -138,37 +138,37 @@ namespace NSBinPptxRW
m_lIndexNextImage = 1;
m_lIndexNextOle = 1;
}
void CImageManager2::SetDstMedia(const CString& strDst)
void CImageManager2::SetDstMedia(const std::wstring& strDst)
{
m_strDstMedia = strDst;
}
CString CImageManager2::GetDstMedia()
std::wstring CImageManager2::GetDstMedia()
{
return m_strDstMedia;
}
void CImageManager2::SetDstEmbed(const CString& strDst)
void CImageManager2::SetDstEmbed(const std::wstring& strDst)
{
m_strDstEmbed = strDst;
}
CString CImageManager2::GetDstEmbed()
std::wstring CImageManager2::GetDstEmbed()
{
return m_strDstEmbed;
}
int CImageManager2::IsDisplayedImage(const CString& strInput)
int CImageManager2::IsDisplayedImage(const std::wstring& strInput)
{
int nRes = 0;
//шаблон display[N]image.ext
CString sFind1 = _T("display");
int nIndex1 = strInput.Find(sFind1);
std::wstring sFind1 = _T("display");
int nIndex1 = strInput.find(sFind1);
if(-1 != nIndex1)
{
if(nIndex1 + sFind1.GetLength() < strInput.GetLength())
if(nIndex1 + sFind1.length() < strInput.length())
{
TCHAR cRes = strInput[nIndex1 + sFind1.GetLength()];
TCHAR cRes = strInput[nIndex1 + sFind1.length()];
if('1' <= cRes && cRes <= '6')
{
int nImageIndex = nIndex1 + sFind1.GetLength() + 1;
if(nImageIndex == strInput.Find(_T("image"), nImageIndex))
int nImageIndex = nIndex1 + sFind1.length() + 1;
if(nImageIndex == strInput.find(_T("image"), nImageIndex))
nRes = cRes - '0';
}
@ -176,35 +176,35 @@ namespace NSBinPptxRW
}
return nRes;
}
CImageManager2Info CImageManager2::GenerateImage(const CString& strInput, const CString& oleData, CString strBase64Image)
CImageManager2Info CImageManager2::GenerateImage(const std::wstring& strInput, const std::wstring& oleData, std::wstring strBase64Image)
{
if (IsNeedDownload(strInput))
return DownloadImage(strInput);
std::map<CString, CImageManager2Info>::const_iterator pPair = m_mapImages.find ((_T("") == strBase64Image) ? strInput : strBase64Image);
std::map<std::wstring, CImageManager2Info>::const_iterator pPair = m_mapImages.find ((_T("") == strBase64Image) ? strInput : strBase64Image);
if (pPair != m_mapImages.end())
return pPair->second;
CString strExts = _T(".jpg");
int nIndexExt = strInput.ReverseFind(TCHAR('.'));
std::wstring strExts = _T(".jpg");
int nIndexExt = strInput.rfind(TCHAR('.'));
if (-1 != nIndexExt)
strExts = strInput.Mid(nIndexExt);
strExts = strInput.substr(nIndexExt);
CString strOleImage = _T("");
CString strImage = strInput;
std::wstring strOleImage = _T("");
std::wstring strImage = strInput;
int nDisplayType = IsDisplayedImage(strInput);
if (0 != nDisplayType)
{
OOX::CPath oPath = strInput;
CString strFolder = oPath.GetDirectory();
CString strFileName = oPath.GetFilename();
std::wstring strFolder = oPath.GetDirectory();
std::wstring strFileName = oPath.GetFilename();
strFileName.Delete(strFileName.GetLength() - 4, 4);
strFileName.erase(strFileName.length() - 4, 4);
if(0 != (nDisplayType & 1))
{
CString strVector = strFolder + strFileName + _T(".wmf");
std::wstring strVector = strFolder + strFileName + _T(".wmf");
if (OOX::CSystemUtility::IsFileExist(strVector))
{
strImage = strVector;
@ -213,7 +213,7 @@ namespace NSBinPptxRW
}
if(0 != (nDisplayType & 2))
{
CString strVector = strFolder + strFileName + _T(".emf");
std::wstring strVector = strFolder + strFileName + _T(".emf");
if (OOX::CSystemUtility::IsFileExist(strVector))
{
strImage = strVector;
@ -222,7 +222,7 @@ namespace NSBinPptxRW
}
if(0 != (nDisplayType & 4))
{
CString strOle = strFolder + strFileName + _T(".bin");
std::wstring strOle = strFolder + strFileName + _T(".bin");
if (OOX::CSystemUtility::IsFileExist(strOle))
strOleImage = strOle;
}
@ -269,12 +269,11 @@ namespace NSBinPptxRW
}
return bRes;
}
CImageManager2Info CImageManager2::GenerateImageExec(const CString& strInput, const CString& sExts, const CString& strOleImage, const CString& oleData)
CImageManager2Info CImageManager2::GenerateImageExec(const std::wstring& strInput, const std::wstring& sExts, const std::wstring& strOleImage, const std::wstring& oleData)
{
CImageManager2Info oImageManagerInfo;
CString strExts = sExts;
CString strImage;
strImage.Format(_T("image%d"), m_lIndexNextImage++);
std::wstring strExts = sExts;
std::wstring strImage = L"image" + std::to_wstring(m_lIndexNextImage++);
OOX::CPath pathOutput;
if ((_T(".jpg") == strExts) || (_T(".jpeg") == strExts) || (_T(".png") == strExts) || (_T(".emf") == strExts) || (_T(".wmf") == strExts))
{
@ -296,13 +295,13 @@ namespace NSBinPptxRW
else
strImage = _T("media/") + strImage + strExts;
if (!strOleImage.IsEmpty() || !oleData.IsEmpty() )
if (!strOleImage.empty() || !oleData.empty() )
{
CString strImageOle;
strImageOle.Format(_T("oleObject%d.bin"), m_lIndexNextOle++);
std::wstring strImageOle = L"oleObject" + std::to_wstring(m_lIndexNextOle++) + L".bin";
OOX::CPath pathOutputOle = m_strDstEmbed + FILE_SEPARATOR_STR + strImageOle;
CString strOleImageOut = pathOutputOle.GetPath();
if(!oleData.IsEmpty())
std::wstring strOleImageOut = pathOutputOle.GetPath();
if(!oleData.empty())
{
WriteOleData(strOleImageOut, oleData);
}
@ -322,26 +321,26 @@ namespace NSBinPptxRW
oImageManagerInfo.m_sImagePath = strImage;
return oImageManagerInfo;
}
void CImageManager2::SaveImageAsPng(const CString& strFileSrc, const CString& strFileDst)
void CImageManager2::SaveImageAsPng(const std::wstring& strFileSrc, const std::wstring& strFileDst)
{
CBgraFrame oBgraFrame;
if(oBgraFrame.OpenFile(strFileSrc))
oBgraFrame.SaveFile(strFileDst, _CXIMAGE_FORMAT_PNG);
}
void CImageManager2::SaveImageAsJPG(const CString& strFileSrc, const CString& strFileDst)
void CImageManager2::SaveImageAsJPG(const std::wstring& strFileSrc, const std::wstring& strFileDst)
{
CBgraFrame oBgraFrame;
if(oBgraFrame.OpenFile(strFileSrc))
oBgraFrame.SaveFile(strFileDst, _CXIMAGE_FORMAT_JPG);
}
bool CImageManager2::IsNeedDownload(const CString& strFile)
bool CImageManager2::IsNeedDownload(const std::wstring& strFile)
{
int n1 = strFile.Find(_T("www"));
int n2 = strFile.Find(_T("http"));
int n3 = strFile.Find(_T("ftp"));
int n4 = strFile.Find(_T("https://"));
int n1 = strFile.find(_T("www"));
int n2 = strFile.find(_T("http"));
int n3 = strFile.find(_T("ftp"));
int n4 = strFile.find(_T("https://"));
//если nI сранивать не с 0, то будут проблемы
//потому что в инсталяции мы кладем файлы в /var/www...
@ -349,25 +348,25 @@ namespace NSBinPptxRW
return true;
return false;
}
CImageManager2Info CImageManager2::DownloadImage(const CString& strUrl)
CImageManager2Info CImageManager2::DownloadImage(const std::wstring& strUrl)
{
std::map<CString, CImageManager2Info>::const_iterator pPair = m_mapImages.find (strUrl);
std::map<std::wstring, CImageManager2Info>::const_iterator pPair = m_mapImages.find (strUrl);
if (pPair != m_mapImages.end())
return pPair->second;
CString strExts = _T(".jpg");
int nIndexExt = strUrl.ReverseFind(TCHAR('.'));
std::wstring strExts = _T(".jpg");
int nIndexExt = strUrl.rfind(TCHAR('.'));
if (-1 != nIndexExt)
strExts = strUrl.Mid(nIndexExt);
strExts = strUrl.substr(nIndexExt);
CString strImage;
CString strOleImage;
std::wstring strImage;
std::wstring strOleImage;
int nDisplayType = IsDisplayedImage(strUrl);
if(0 != nDisplayType)
{
CString strInputMetafile = strUrl.Left(strUrl.GetLength() - strExts.GetLength());
CString sDownloadRes;
std::wstring strInputMetafile = strUrl.substr(0, strUrl.length() - strExts.length());
std::wstring sDownloadRes;
//todo
if(0 != (nDisplayType & 4))
{
@ -390,18 +389,18 @@ namespace NSBinPptxRW
else
strImage = DownloadImageExec(strUrl);
CImageManager2Info oImageManagerInfo;
if (!strImage.IsEmpty())
if (!strImage.empty())
{
oImageManagerInfo = GenerateImageExec(strImage, strExts, strOleImage, L"");
CDirectory::DeleteFile(strImage);
}
if (!strOleImage.IsEmpty())
if (!strOleImage.empty())
CDirectory::DeleteFile(strOleImage);
m_mapImages[strUrl] = oImageManagerInfo;
return oImageManagerInfo;
}
CString CImageManager2::DownloadImageExec(const CString& strFile)
std::wstring CImageManager2::DownloadImageExec(const std::wstring& strFile)
{
#ifndef DISABLE_FILE_DOWNLOADER
CFileDownloader oDownloader(strFile, false);
@ -632,14 +631,6 @@ namespace NSBinPptxRW
m_lPosition += DOUBLE_SIZEOF;
m_pStreamCur += DOUBLE_SIZEOF;
}
void CBinaryFileWriter::WriteStringW(const WCHAR* sBuffer)
{
_WriteStringWithLength(sBuffer, __wstrlen(sBuffer), true);
}
void CBinaryFileWriter::WriteStringWStd(const std::wstring& sBuffer)
{
WriteStringW(sBuffer.c_str());
}
void CBinaryFileWriter::WriteBYTEArray(const BYTE* pBuffer, size_t len)
{
CheckBufferSize(len);
@ -647,9 +638,9 @@ namespace NSBinPptxRW
m_lPosition += (_UINT32)len;
m_pStreamCur += len;
}
void CBinaryFileWriter::WriteStringA(const char* sBuffer)
void CBinaryFileWriter::WriteStringA(std::string& sBuffer)
{
_INT32 lSize = __strlen(sBuffer);
_INT32 lSize = sBuffer.length();
_INT32 lSizeMem = lSize * sizeof(char);
CheckBufferSize(UINT32_SIZEOF + lSizeMem);
@ -661,58 +652,51 @@ namespace NSBinPptxRW
m_lPosition += UINT32_SIZEOF;
m_pStreamCur += UINT32_SIZEOF;
memcpy(m_pStreamCur, sBuffer, lSizeMem);
memcpy(m_pStreamCur, sBuffer.c_str(), lSizeMem);
m_lPosition += lSizeMem;
m_pStreamCur += lSizeMem;
}
void CBinaryFileWriter::WriteStringA(CStringA& sBuffer)
void CBinaryFileWriter::WriteStringW(std::wstring& sBuffer)
{
char* pChars = sBuffer.GetBuffer();
WriteStringA(pChars);
_WriteStringWithLength(sBuffer.c_str(), sBuffer.length(), true);
}
void CBinaryFileWriter::WriteStringW(CString& sBuffer)
void CBinaryFileWriter::WriteStringW(const std::wstring& sBuffer)
{
WCHAR* pChars = sBuffer.GetBuffer();
WriteStringW(pChars);
_WriteStringWithLength(sBuffer.c_str(), sBuffer.length(), true);
}
void CBinaryFileWriter::WriteStringW2(const WCHAR* sBuffer)
{
_WriteStringWithLength(sBuffer, __wstrlen(sBuffer), false);
}
void CBinaryFileWriter::WriteStringW2(CString& sBuffer)
void CBinaryFileWriter::WriteStringW2(std::wstring& sBuffer)
{
WriteStringW2(sBuffer.GetBuffer());
_WriteStringWithLength(sBuffer.c_str(), sBuffer.length(), false);
}
void CBinaryFileWriter::WriteStringW3(const WCHAR* sBuffer)
{
_WriteString(sBuffer, __wstrlen(sBuffer));
}
void CBinaryFileWriter::WriteStringW3(CString& sBuffer)
void CBinaryFileWriter::WriteStringW3(std::wstring& sBuffer)
{
WriteStringW3(sBuffer.GetBuffer());
_WriteString(sBuffer.c_str(), sBuffer.length());
}
void CBinaryFileWriter::WriteStringW3(const std::wstring& sBuffer)
{
_WriteString(sBuffer.c_str(), sBuffer.length());
}
void CBinaryFileWriter::WriteStringW4(const std::wstring& sBuffer)
{
WriteStringW3(sBuffer.c_str());
_WriteString(sBuffer.c_str(), sBuffer.length());
}
CBinaryFileWriter::CBinaryFileWriter()
{
m_strMainFolder = _T("");
m_pMainDocument = NULL;
m_pCommon = new CCommonWriter();
m_pCommonRels = new NSCommon::smart_ptr<PPTX::CCommonRels>();
ThemeDoc = new NSCommon::smart_ptr<PPTX::FileContainer>();
ClrMapDoc = new NSCommon::smart_ptr<PPTX::WritingElement>();
m_pCommon = new CCommonWriter();
m_pCommonRels = new NSCommon::smart_ptr<PPTX::CCommonRels>();
ThemeDoc = new NSCommon::smart_ptr<PPTX::FileContainer>();
ClrMapDoc = new NSCommon::smart_ptr<PPTX::WritingElement>();
Clear();
}
CBinaryFileWriter::~CBinaryFileWriter()
{
RELEASEARRAYOBJECTS(m_pStreamData);
//RELEASEINTERFACE(m_pMainDocument);
RELEASEOBJECT(m_pCommon);
RELEASEOBJECT(m_pCommonRels);
RELEASEOBJECT(ThemeDoc);
RELEASEOBJECT(ClrMapDoc);
RELEASEARRAYOBJECTS (m_pStreamData);
RELEASEOBJECT (m_pCommon);
RELEASEOBJECT (m_pCommonRels);
RELEASEOBJECT (ThemeDoc);
RELEASEOBJECT (ClrMapDoc);
}
void CBinaryFileWriter::StartRecord(_INT32 lType)
@ -765,23 +749,23 @@ namespace NSBinPptxRW
}
}
void CBinaryFileWriter::WriteString1(int type, const CString& val)
void CBinaryFileWriter::WriteString1(int type, const std::wstring& val)
{
BYTE bType = (BYTE)type;
WriteBYTE(bType);
CString* s = const_cast<CString*>(&val);
_WriteStringWithLength(s->GetBuffer(), s->GetLength(), false);
std::wstring* s = const_cast<std::wstring*>(&val);
_WriteStringWithLength(s->c_str(), s->length(), false);
}
void CBinaryFileWriter::WriteString2(int type, const NSCommon::nullable_string& val)
{
if (val.is_init())
WriteString1(type, *val);
}
void CBinaryFileWriter::WriteString(const CString& val)
void CBinaryFileWriter::WriteString(const std::wstring& val)
{
CString* s = const_cast<CString*>(&val);
_WriteStringWithLength(s->GetBuffer(), s->GetLength(), false);
std::wstring* s = const_cast<std::wstring*>(&val);
_WriteStringWithLength(s->c_str(), s->length(), false);
}
void CBinaryFileWriter::WriteString1Data(int type, const WCHAR* pData, _UINT32 len)
@ -840,7 +824,7 @@ namespace NSBinPptxRW
WriteSize_t1(type, *val);
}
void CBinaryFileWriter::GetBase64File(const CString& sFile, CStringA& strDst64)
void CBinaryFileWriter::GetBase64File(const std::wstring& sFile, std::string& strDst64)
{
CFile oFile;
HRESULT hr = oFile.OpenFile(sFile);
@ -874,17 +858,17 @@ namespace NSBinPptxRW
//DeleteFile(sFile);
}
void CBinaryFileWriter::WriteTheme64(_INT32 lIndex, const CString& sFile)
void CBinaryFileWriter::WriteTheme64(_INT32 lIndex, const std::wstring& sFile)
{
GetBase64File(sFile, m_pCommon->m_oRels[lIndex].m_strImageBase64);
}
void CBinaryFileWriter::WriteLayoutTheme64(_INT32 lIndexTheme, _INT32 lIndexLayout, const CString& sFile)
void CBinaryFileWriter::WriteLayoutTheme64(_INT32 lIndexTheme, _INT32 lIndexLayout, const std::wstring& sFile)
{
GetBase64File(sFile, m_pCommon->m_oRels[lIndexTheme].m_arLayoutImagesBase64[lIndexLayout]);
}
CString CBinaryFileWriter::GetFolderForGenerateImages()
std::wstring CBinaryFileWriter::GetFolderForGenerateImages()
{
return m_strMainFolder + _T("\\extract_themes");
}
@ -985,22 +969,6 @@ namespace NSBinPptxRW
m_pStreamCur += lSizeMem;
}
/*
LPSAFEARRAY CBinaryFileWriter::GetSafearray()
{
_UINT32 lBinarySize = this->GetPosition();
if (0 == lBinarySize)
return NULL;
SAFEARRAY* pArray = SafeArrayCreateVector(VT_UI1, lBinarySize);
BYTE* pDataD = (BYTE*)pArray->pvData;
BYTE* pDataS = this->GetBuffer();
memcpy(pDataD, pDataS, lBinarySize);
return pArray;
}
*/
CSlideMasterInfo::CSlideMasterInfo() : m_arLayouts()
{
m_lThemeIndex = -1;
@ -1048,15 +1016,17 @@ namespace NSBinPptxRW
int nCountLayouts = (int)oInfo.m_arLayouts.size();
for (int i = 0; i < nCountLayouts; ++i)
{
CString str = _T("");
str.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout%d.xml\"/>"),
m_lNextRelsID++, oInfo.m_arLayouts[i] + 1);
std::wstring str = L"<Relationship Id=\"rId" +
std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout" +
std::to_wstring(oInfo.m_arLayouts[i] + 1) +
L".xml\"/>";
m_pWriter->WriteString(str);
}
CString s = _T("");
s.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme%d.xml\"/>" ),
m_lNextRelsID++, nIndexTheme + 1);
std::wstring s = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme" +
std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
m_pWriter->WriteString(s);
}
void CRelsGenerator::StartLayout(int nIndexTheme)
@ -1064,9 +1034,9 @@ namespace NSBinPptxRW
m_pWriter->WriteString(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"));
m_pWriter->WriteString(_T("<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"));
CString str = _T("");
str.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster%d.xml\"/>"),
m_lNextRelsID++, nIndexTheme + 1);
std::wstring str = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"../slideMasters/slideMaster" +
std::to_wstring(nIndexTheme + 1) + L".xml\"/>";
m_pWriter->WriteString(str);
}
void CRelsGenerator::StartSlide(int nIndexSlide, int nIndexLayout)
@ -1074,13 +1044,14 @@ namespace NSBinPptxRW
m_pWriter->WriteString(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"));
m_pWriter->WriteString(_T("<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">"));
CString str = _T("");
str.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout%d.xml\"/>"),
m_lNextRelsID++, nIndexLayout + 1);
std::wstring str = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout\" Target=\"../slideLayouts/slideLayout" +
std::to_wstring(nIndexLayout + 1) + L".xml\"/>";
m_pWriter->WriteString(str);
str = _T("");
str.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide%d.xml\"/>"), m_lNextRelsID++, nIndexSlide + 1);
str = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide\" Target=\"../notesSlides/notesSlide" +
std::to_wstring(nIndexSlide + 1) + L".xml\"/>";
m_pWriter->WriteString(str);
}
void CRelsGenerator::StartNote(int nIndexSlide)
@ -1100,8 +1071,9 @@ namespace NSBinPptxRW
{
for (int i = 0; i < nCount; ++i)
{
CString strRels = _T("");
strRels.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"slideMasters/slideMaster%d.xml\" />"), m_lNextRelsID++, i + 1);
std::wstring strRels = L"<Relationship Id=\"rId" + std::to_wstring( m_lNextRelsID++ ) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster\" Target=\"slideMasters/slideMaster" +
std::to_wstring(i + 1) + L".xml\"/>";
m_pWriter->WriteString(strRels);
}
}
@ -1109,8 +1081,9 @@ namespace NSBinPptxRW
{
for (int i = 0; i < nCount; ++i)
{
CString strRels = _T("");
strRels.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"theme/theme%d.xml\" />"), m_lNextRelsID++, i + 1);
std::wstring strRels = L"<Relationship Id=\"rId" + std::to_wstring( m_lNextRelsID++ ) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"theme/theme" +
std::to_wstring(i + 1) + L".xml\"/>";
m_pWriter->WriteString(strRels);
}
}
@ -1118,27 +1091,30 @@ namespace NSBinPptxRW
{
for (int i = 0; i < nCount; ++i)
{
CString strRels = _T("");
strRels.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slides/slide%d.xml\" />"), m_lNextRelsID++, i + 1);
std::wstring strRels = L"<Relationship Id=\"rId" + std::to_wstring( m_lNextRelsID++ ) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"slides/slide" +
std::to_wstring(i + 1) + L".xml\"/>";
m_pWriter->WriteString(strRels);
}
}
void CRelsGenerator::WriteSlideComments(int nComment)
{
CString strRels = _T("");
strRels.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments\" Target=\"../comments/comment%d.xml\"/>"), m_lNextRelsID++, nComment);
std::wstring strRels = L"<Relationship Id=\"rId" + std::to_wstring( m_lNextRelsID++ ) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments\" Target=\"../comments/comment" +
std::to_wstring(nComment) + L".xml\"/>";
m_pWriter->WriteString(strRels);
}
void CRelsGenerator::EndPresentationRels(const bool& bIsCommentsAuthors = false)
{
CString strRels0 = _T("");
strRels0.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>"), m_lNextRelsID++);
CString strRels1 = _T("");
strRels1.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\" Target=\"presProps.xml\" />"), m_lNextRelsID++);
CString strRels2 = _T("");
strRels2.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles\" Target=\"tableStyles.xml\" />"), m_lNextRelsID++);
CString strRels3 = _T("");
strRels3.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\" Target=\"viewProps.xml\" />"), m_lNextRelsID++);
std::wstring strRels0 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster\" Target=\"notesMasters/notesMaster1.xml\"/>";
std::wstring strRels1 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps\" Target=\"presProps.xml\" />";
std::wstring strRels2 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles\" Target=\"tableStyles.xml\" />";
std::wstring strRels3 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps\" Target=\"viewProps.xml\" />";
m_pWriter->WriteString(strRels0);
m_pWriter->WriteString(strRels1);
@ -1147,8 +1123,8 @@ namespace NSBinPptxRW
if (bIsCommentsAuthors)
{
CString strRels4 = _T("");
strRels4.Format(_T("<Relationship Id=\"rId%d\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors\" Target=\"commentAuthors.xml\"/>"), m_lNextRelsID++);
std::wstring strRels4 = L"<Relationship Id=\"rId" + std::to_wstring(m_lNextRelsID++) +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors\" Target=\"commentAuthors.xml\"/>";
m_pWriter->WriteString(strRels4);
}
}
@ -1160,24 +1136,24 @@ namespace NSBinPptxRW
{
m_pWriter->WriteString(_T("</Relationships>"));
}
void CRelsGenerator::AddRels(const CString& strRels)
void CRelsGenerator::AddRels(const std::wstring& strRels)
{
m_pWriter->WriteString(strRels);
}
void CRelsGenerator::SaveRels(const CString& strFile)
void CRelsGenerator::SaveRels(const std::wstring& strFile)
{
CFile oFile;
oFile.CreateFile(strFile);
CString strMem = m_pWriter->GetData();
std::wstring strMem = m_pWriter->GetData();
oFile.WriteStringUTF8(strMem);
oFile.CloseFile();
}
CRelsGeneratorInfo CRelsGenerator::WriteImage(const CString& strImagePath, const CString& oleData, CString strBase64Image = _T(""))
CRelsGeneratorInfo CRelsGenerator::WriteImage(const std::wstring& strImagePath, const std::wstring& oleData, std::wstring strBase64Image = _T(""))
{
CImageManager2Info oImageManagerInfo = m_pManager->GenerateImage(strImagePath, oleData, strBase64Image);
CString strImage = oImageManagerInfo.m_sImagePath;
std::map<CString, CRelsGeneratorInfo>::iterator pPair = m_mapImages.find(strImage);
std::wstring strImage = oImageManagerInfo.m_sImagePath;
std::map<std::wstring, CRelsGeneratorInfo>::iterator pPair = m_mapImages.find(strImage);
if (m_mapImages.end() != pPair)
{
@ -1186,104 +1162,94 @@ namespace NSBinPptxRW
CRelsGeneratorInfo oRelsGeneratorInfo;
oRelsGeneratorInfo.m_sFilepathImg = oImageManagerInfo.m_sFilepathImg;
oRelsGeneratorInfo.m_nImageRId = m_lNextRelsID++;
CString strRid = _T("");
strRid.Format(_T("rId%d"), oRelsGeneratorInfo.m_nImageRId);
std::wstring strRid = L"rId" + std::to_wstring(oRelsGeneratorInfo.m_nImageRId);
CString strRels = _T("");
strRels.Format(_T("<Relationship Id=\"%ls\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"%ls\"/>"),
strRid, strImage);
std::wstring strRels = L"<Relationship Id=\"" + strRid +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\" Target=\"" + strImage +
L"\"/>";
m_pWriter->WriteString(strRels);
if(!oImageManagerInfo.m_sOlePath.IsEmpty())
if(!oImageManagerInfo.m_sOlePath.empty())
{
oRelsGeneratorInfo.m_nOleRId = m_lNextRelsID++;
oRelsGeneratorInfo.m_sFilepathBin = oImageManagerInfo.m_sFilepathBin;
CString strRid = _T("");
strRid.Format(_T("rId%d"), oRelsGeneratorInfo.m_nOleRId);
std::wstring strRid = L"rId" + std::to_wstring(oRelsGeneratorInfo.m_nOleRId);
std::wstring strRels = L"<Relationship Id=\"" + strRid
+ L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject\" Target=\"" +
oImageManagerInfo.m_sOlePath + L"\"/>";
CString strRels = _T("");
strRels.Format(_T("<Relationship Id=\"%ls\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject\" Target=\"%ls\"/>"),
strRid, oImageManagerInfo.m_sOlePath);
m_pWriter->WriteString(strRels);
}
m_mapImages.insert(std::pair<CString, CRelsGeneratorInfo>(strImage, oRelsGeneratorInfo));
m_mapImages.insert(std::pair<std::wstring, CRelsGeneratorInfo>(strImage, oRelsGeneratorInfo));
return oRelsGeneratorInfo;
}
int CRelsGenerator::WriteChart(int nChartNumber, _INT32 lDocType = XMLWRITER_DOC_TYPE_PPTX)
{
CString strChart = _T("");
std::wstring strChart = L"charts/chart" + std::to_wstring(nChartNumber) + L".xml";
if (lDocType == XMLWRITER_DOC_TYPE_DOCX)
if (lDocType != XMLWRITER_DOC_TYPE_DOCX)
{
strChart.Format(_T("charts/chart%d.xml"), nChartNumber);
}
else
{
strChart.Format(_T("../charts/chart%d.xml"), nChartNumber);
strChart = L"../" + strChart;
}
CString strRid = _T("");
strRid.Format(_T("rId%d"), m_lNextRelsID++);
std::wstring strRid = L"rId" + std::to_wstring(m_lNextRelsID++);
CString strRels = _T("");
strRels.Format(_T("<Relationship Id=\"%ls\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart\" Target=\"%ls\"/>"),
strRid, strChart);
std::wstring strRels = L"<Relationship Id=\"" + strRid +
L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart\" Target=\"" +
strChart + L"\"/>";
m_pWriter->WriteString(strRels);
return m_lNextRelsID - 1;
}
int CRelsGenerator::WriteRels(const CString& bsType, const CString& bsTarget, const CString& bsTargetMode)
int CRelsGenerator::WriteRels(const std::wstring& bsType, const std::wstring& bsTarget, const std::wstring& bsTargetMode)
{
CString strRid = _T("");
strRid.Format(_T("rId%d"), m_lNextRelsID++);
std::wstring strRid = L"rId" + std::to_wstring(m_lNextRelsID++);
CString strType = _T("Type=\"") + bsType + _T("\" ");
CString strTarget = _T("Target=\"") + bsTarget + _T("\" ");
CString strTargetMode = bsTargetMode.IsEmpty() ? _T("") : (_T("TargetMode=\"") + (CString)bsTargetMode + _T("\""));
std::wstring strType = _T("Type=\"") + bsType + _T("\" ");
std::wstring strTarget = _T("Target=\"") + bsTarget + _T("\" ");
std::wstring strTargetMode = bsTargetMode.empty() ? _T("") : (_T("TargetMode=\"") + bsTargetMode + _T("\""));
CString strRels = _T("<Relationship Id=\"") + strRid + _T("\" ") + strType + strTarget + strTargetMode + _T("/>");
std::wstring strRels = _T("<Relationship Id=\"") + strRid + _T("\" ") + strType + strTarget + strTargetMode + _T("/>");
m_pWriter->WriteString(strRels);
return m_lNextRelsID - 1;
}
int CRelsGenerator::WriteHyperlink(const CString& strLink, const bool& bIsActionInit)
int CRelsGenerator::WriteHyperlink(const std::wstring& strLink, const bool& bIsActionInit)
{
std::map<CString, int>::iterator pPair = m_mapLinks.find(strLink);
std::map<std::wstring, int>::iterator pPair = m_mapLinks.find(strLink);
if (m_mapLinks.end() != pPair)
{
return pPair->second;
}
m_mapLinks.insert(std::pair<CString, int>(strLink, m_lNextRelsID));
CString strRid = _T("");
strRid.Format(_T("rId%d"), m_lNextRelsID++);
m_mapLinks.insert(std::pair<std::wstring, int>(strLink, m_lNextRelsID));
std::wstring strRid = L"rId" + std::to_wstring(m_lNextRelsID++);
CString sLink = strLink;
sLink.Replace(L"&", L"&amp;");
sLink.Replace(L"'", L"&apos;");
sLink.Replace(L"<", L"&lt;");
sLink.Replace(L">", L"&gt;");
sLink.Replace(L"\"",L"&quot;");
std::wstring sLink = XmlUtils::EncodeXmlString(strLink);
bool bIsSlide = (0 == sLink.Find(_T("slide")));
bool bIsSlide = (0 == sLink.find(_T("slide")));
if (!bIsActionInit)
bIsSlide = false;
CString strRels = _T("");
std::wstring strRels;
if (!bIsSlide)
{
strRels.Format(_T("<Relationship Id=\"%ls\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\" Target=\"%ls\" TargetMode=\"External\"/>"),
strRid, sLink);
strRels = L"<Relationship Id=\"" + strRid
+ L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\" Target=\"" + sLink
+ L"\" TargetMode=\"External\"/>";
}
else
{
strRels.Format(_T("<Relationship Id=\"%ls\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"%ls\"/>"),
strRid ,sLink);
strRels = L"<Relationship Id=\"" + strRid
+ L"\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide\" Target=\"" + sLink
+ L"\"/>";
}
m_pWriter->WriteString(strRels);
@ -1473,29 +1439,29 @@ namespace NSBinPptxRW
}
//String
CString CBinaryFileReader::GetString(_INT32 len)
std::wstring CBinaryFileReader::GetString(_INT32 len)
{
len *= 2;
return GetString3(len);
}
CStringA CBinaryFileReader::GetString1(_INT32 len)
std::string CBinaryFileReader::GetString1(_INT32 len)
{
if (len < 1 )
return "";
if (m_lPos + len > m_lSize)
return "";
CStringA res((CHAR*)m_pDataCur, len);
std::string res((CHAR*)m_pDataCur, len);
m_lPos += len;
m_pDataCur += len;
return res;
}
CString CBinaryFileReader::GetString2()
std::wstring CBinaryFileReader::GetString2()
{
_INT32 len = GetLong();
return GetString(len);
}
CString CBinaryFileReader::GetString3(_INT32 len)//len in byte for utf16
std::wstring CBinaryFileReader::GetString3(_INT32 len)//len in byte for utf16
{
if (len < 1 )
return _T("");
@ -1507,7 +1473,7 @@ namespace NSBinPptxRW
if (sizeof(wchar_t) == 4)
{
std::wstring val = NSFile::CUtf8Converter::GetWStringFromUTF16((unsigned short*)m_pDataCur, lSize);
CString res(val.c_str(), val.length());
std::wstring res(val.c_str(), val.length());
m_lPos += len;
m_pDataCur += len;
@ -1516,7 +1482,7 @@ namespace NSBinPptxRW
}
else
{
CString res((WCHAR*)m_pDataCur, lSize);
std::wstring res((WCHAR*)m_pDataCur, lSize);
m_lPos += len;
m_pDataCur += len;
@ -1575,7 +1541,7 @@ namespace NSBinPptxRW
}
*/
CStringA CBinaryFileReader::GetString2A()
std::string CBinaryFileReader::GetString2A()
{
_INT32 len = GetULong();
return GetString1(len);

View File

@ -35,7 +35,6 @@
#else
#endif
#include "../../Common/DocxFormat/Source/Base/ASCString.h"
#include "../../DesktopEditor/common/Types.h"
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
@ -82,18 +81,18 @@ namespace NSBinPptxRW
class CImageManager2Info
{
public:
CString m_sImagePath;
CString m_sOlePath;
CString m_sFilepathBin;
CString m_sFilepathImg;
std::wstring m_sImagePath;
std::wstring m_sOlePath;
std::wstring m_sFilepathBin;
std::wstring m_sFilepathImg;
};
class CRelsGeneratorInfo
{
public:
int m_nImageRId;
int m_nOleRId;
CString m_sFilepathBin;
CString m_sFilepathImg;
std::wstring m_sFilepathBin;
std::wstring m_sFilepathImg;
CRelsGeneratorInfo()
{
m_nImageRId = -1;
@ -107,10 +106,10 @@ namespace NSBinPptxRW
public:
_INT32 m_lThemeIndex;
CStringA m_strImageBase64;
std::string m_strImageBase64;
std::vector<LONG> m_arLayoutIndexes;
std::vector<CStringA> m_arLayoutImagesBase64;
std::vector<std::string> m_arLayoutImagesBase64;
};
class CCommonWriter
@ -146,11 +145,11 @@ namespace NSBinPptxRW
class CImageManager2
{
private:
std::map<CString, CImageManager2Info> m_mapImages;
std::map<std::wstring, CImageManager2Info> m_mapImages;
_INT32 m_lIndexNextImage;
_INT32 m_lIndexNextOle;
CString m_strDstMedia;
CString m_strDstEmbed;
std::wstring m_strDstMedia;
std::wstring m_strDstEmbed;
public:
bool m_bIsWord;
@ -158,11 +157,11 @@ namespace NSBinPptxRW
CImageManager2();
~CImageManager2();
void Clear();
void SetDstMedia(const CString& strDst);
CString GetDstMedia();
void SetDstEmbed(const CString& strDst);
CString GetDstEmbed();
int IsDisplayedImage(const CString& strInput);
void SetDstMedia(const std::wstring& strDst);
std::wstring GetDstMedia();
void SetDstEmbed(const std::wstring& strDst);
std::wstring GetDstEmbed();
int IsDisplayedImage(const std::wstring& strInput);
public:
template <typename T>
@ -176,7 +175,7 @@ namespace NSBinPptxRW
int lCount = (int)m_mapImages.size();
pWriter->WriteINT(lCount);
//for (std::map<CString, CString>::const_iterator pPair = m_mapImages.begin(); pPair != m_mapImages.end(); ++pPair)
//for (std::map<std::wstring, std::wstring>::const_iterator pPair = m_mapImages.begin(); pPair != m_mapImages.end(); ++pPair)
//{
// pWriter->WriteString(pPair->first);
// pWriter->WriteString(pPair->second);
@ -196,24 +195,24 @@ namespace NSBinPptxRW
//for (_INT32 i = 0; i < lCount; ++i)
//{
// CString s1 = pReader->GetString2();
// CString s2 = pReader->GetString2();
// std::wstring s1 = pReader->GetString2();
// std::wstring s2 = pReader->GetString2();
// m_mapImages [s1] = s2;
//}
}
public:
CImageManager2Info GenerateImage(const CString& strInput, const CString& oleData, CString strBase64Image);
CImageManager2Info GenerateImageExec(const CString& strInput, const CString& strExts, const CString& strOleImage, const CString& oleData);
CImageManager2Info GenerateImage(const std::wstring& strInput, const std::wstring& oleData, std::wstring strBase64Image);
CImageManager2Info GenerateImageExec(const std::wstring& strInput, const std::wstring& strExts, const std::wstring& strOleImage, const std::wstring& oleData);
void SaveImageAsPng(const CString& strFileSrc, const CString& strFileDst);
void SaveImageAsPng(const std::wstring& strFileSrc, const std::wstring& strFileDst);
void SaveImageAsJPG(const CString& strFileSrc, const CString& strFileDst);
void SaveImageAsJPG(const std::wstring& strFileSrc, const std::wstring& strFileDst);
bool IsNeedDownload(const CString& strFile);
CImageManager2Info DownloadImage(const CString& strFile);
CString DownloadImageExec(const CString& strFile);
bool IsNeedDownload(const std::wstring& strFile);
CImageManager2Info DownloadImage(const std::wstring& strFile);
std::wstring DownloadImageExec(const std::wstring& strFile);
bool WriteOleData(const std::wstring& sFilePath, const std::wstring& sData);
};
@ -231,7 +230,7 @@ namespace NSBinPptxRW
};
CCommonWriter* m_pCommon;
CString m_strMainFolder;
std::wstring m_strMainFolder;
NSCommon::smart_ptr<PPTX::CCommonRels> * m_pCommonRels;
BinDocxRW::CDocxSerializer * m_pMainDocument;
@ -273,32 +272,33 @@ namespace NSBinPptxRW
void CheckBufferSize(_UINT32 lPlus);
void WriteBYTE(const BYTE& lValue);
void WriteSBYTE(const signed char& lValue);
void WriteBOOL(const bool& bValue);
void WriteBYTE (const BYTE& lValue);
void WriteSBYTE (const signed char& lValue);
void WriteBOOL (const bool& bValue);
void WriteUSHORT(const _UINT16& lValue);
void WriteULONG(const _UINT32& lValue);
void WriteLONG(const _INT32& lValue);
void WriteINT(const _INT32& lValue);
void WriteULONG (const _UINT32& lValue);
void WriteLONG (const _INT32& lValue);
void WriteINT (const _INT32& lValue);
void WriteDouble(const double& dValue);
void WriteDouble (const double& dValue);
void WriteDoubleReal(const double& dValue);
void WriteStringW(const WCHAR* sBuffer);
void WriteStringWStd(const std::wstring& sBuffer);
void WriteBYTEArray(const BYTE* pBuffer, size_t len);
void WriteStringA(const char* sBuffer);
void WriteStringA(CStringA& sBuffer);
void WriteStringW(CString& sBuffer);
void WriteStringW2(const WCHAR* sBuffer);
void WriteStringW2(CString& sBuffer);
void WriteStringW3(const WCHAR* sBuffer);
void WriteStringW3(CString& sBuffer);
void WriteStringW4(const std::wstring& sBuffer);
void WriteBYTEArray (const BYTE* pBuffer, size_t len);
void WriteStringA (std::string& sBuffer);
void WriteStringW (std::wstring& sBuffer);
void WriteStringW (const std::wstring& sBuffer);
void WriteStringW2 (std::wstring& sBuffer);
void WriteStringW3 (std::wstring& sBuffer);
void WriteStringW3 (const std::wstring& sBuffer);
void WriteStringW4 (const std::wstring& sBuffer);
// --------------------------------------------------------
void WriteLONG64(const _INT64& lValue);
void WriteDouble64(const double& dValue);
void WriteLONG64 (const _INT64& lValue);
void WriteDouble64 (const double& dValue);
// --------------------------------------------------------
public:
@ -315,9 +315,9 @@ namespace NSBinPptxRW
public:
void WriteString1(int type, const CString& val);
void WriteString2(int type, const NSCommon::nullable_string& val);
void WriteString(const CString& val);
void WriteString1 (int type, const std::wstring& val);
void WriteString2 (int type, const NSCommon::nullable_string& val);
void WriteString (const std::wstring& val);
void WriteString1Data(int type, const WCHAR* pData, _UINT32 len);
@ -379,13 +379,13 @@ namespace NSBinPptxRW
EndRecord();
}
void GetBase64File(const CString& sFile, CStringA& strDst64);
void GetBase64File(const std::wstring& sFile, std::string& strDst64);
void WriteTheme64(_INT32 lIndex, const CString& sFile);
void WriteTheme64(_INT32 lIndex, const std::wstring& sFile);
void WriteLayoutTheme64(_INT32 lIndexTheme, _INT32 lIndexLayout, const CString& sFile);
void WriteLayoutTheme64(_INT32 lIndexTheme, _INT32 lIndexLayout, const std::wstring& sFile);
CString GetFolderForGenerateImages();
std::wstring GetFolderForGenerateImages();
// embedded fonts
void WriteEmbeddedFonts();
@ -415,9 +415,9 @@ namespace NSBinPptxRW
private:
CStringWriter* m_pWriter;
int m_lNextRelsID;
std::map<CString, CRelsGeneratorInfo> m_mapImages;
std::map<std::wstring, CRelsGeneratorInfo> m_mapImages;
std::map<CString, int> m_mapLinks;
std::map<std::wstring, int> m_mapLinks;
public:
CImageManager2* m_pManager;
@ -442,15 +442,15 @@ namespace NSBinPptxRW
void EndPresentationRels(const bool& bIsCommentsAuthors);
int GetNextId();
void CloseRels();
void AddRels(const CString& strRels);
void SaveRels(const CString& strFile);
void AddRels(const std::wstring& strRels);
void SaveRels(const std::wstring& strFile);
CRelsGeneratorInfo WriteImage(const CString& strImagePath, const CString& oleData, CString strBase64Image);
CRelsGeneratorInfo WriteImage(const std::wstring& strImagePath, const std::wstring& oleData, std::wstring strBase64Image);
int WriteChart(int nChartNumber, _INT32 lDocType);
int WriteRels(const CString& bsType, const CString& bsTarget, const CString& bsTargetMode);
int WriteRels(const std::wstring& bsType, const std::wstring& bsTarget, const std::wstring& bsTargetMode);
int WriteHyperlink(const CString& strLink, const bool& bIsActionInit);
int WriteHyperlink(const std::wstring& strLink, const bool& bIsActionInit);
};
class CBinaryFileReader
@ -465,12 +465,12 @@ namespace NSBinPptxRW
public:
//CRelsGenerator m_oRels;
CString m_strFolder;
CString m_strFolderThemes;
CString m_strFolderExternalThemes;
std::wstring m_strFolder;
std::wstring m_strFolderThemes;
std::wstring m_strFolderExternalThemes;
_INT32 m_lChartNumber;
CString m_strContentTypes;
std::wstring m_strContentTypes;
BinDocxRW::CDocxSerializer* m_pMainDocument;
@ -515,16 +515,16 @@ namespace NSBinPptxRW
double GetDouble64();
double GetDoubleReal();
//String
CString GetString(_INT32 len);
CStringA GetString1(_INT32 len);
CString GetString2();
CString GetString3(_INT32 len);
std::wstring GetString(_INT32 len);
std::string GetString1(_INT32 len);
std::wstring GetString2();
std::wstring GetString3(_INT32 len);
std::wstring GetString4(_INT32 len);
//LPSAFEARRAY GetArray(_INT32 len);
bool GetArray(BYTE **pBuffer, _INT32 len);
CStringA GetString2A();
std::string GetString2A();
void SkipRecord();
_INT32 GetPos();

View File

@ -55,11 +55,11 @@ public:
return dwRes;
}
DWORD Calc(const CString &sStream)
DWORD Calc(const std::wstring &sStream)
{
InitCRCTable();
DWORD dwRes = m_dwInitCrc;
int nSize = sStream.GetLength();
int nSize = sStream.length();
for (int i=0;i<nSize;i++)
{
dwRes = m_arCRCTable[(dwRes ^ (BYTE)sStream[i]) & 0xFF] ^ (dwRes >> 8);
@ -68,7 +68,7 @@ public:
dwRes = dwRes ^ 0xFFFFFFFF;
return dwRes;
}
DWORD CalcPartFile(const CString &sFilepath)
DWORD CalcPartFile(const std::wstring &sFilepath)
{
DWORD dwRet = 0xFFFFFFFF;
//LPBYTE pBuffer = new BYTE[g_clFilePartSize];

View File

@ -38,7 +38,7 @@ namespace PPTX2EditorAdvanced
{
using namespace NSBinPptxRW;
DWORD Convert(NSBinPptxRW::CBinaryFileWriter& oBinaryWriter, PPTX::Folder& oFolder, const CString& strSourceDirectory, const CString& strDstFile)
DWORD Convert(NSBinPptxRW::CBinaryFileWriter& oBinaryWriter, PPTX::Folder& oFolder, const std::wstring& strSourceDirectory, const std::wstring& strDstFile)
{
// сначала соберем все объекты для конвертации и сформируем main-таблицы
NSBinPptxRW::CCommonWriter* pCommon = oBinaryWriter.m_pCommon;
@ -100,7 +100,7 @@ namespace PPTX2EditorAdvanced
size_t nCountLayouts = slideMaster->sldLayoutIdLst.size();
for (size_t iLayout = 0; iLayout < nCountLayouts; ++iLayout)
{
CString rId = slideMaster->sldLayoutIdLst[iLayout].rid.get();
std::wstring rId = slideMaster->sldLayoutIdLst[iLayout].rid.get();
smart_ptr<PPTX::SlideLayout> slideLayout = ((*slideMaster)[rId]).smart_dynamic_cast<PPTX::SlideLayout>();
// проверяем layout
@ -160,7 +160,7 @@ namespace PPTX2EditorAdvanced
size_t nCount = presentation->sldIdLst.size();
for (size_t i = 0; i < nCount; ++i)
{
CString rId = presentation->sldIdLst[i].rid.get();
std::wstring rId = presentation->sldIdLst[i].rid.get();
smart_ptr<PPTX::Slide> slide = ((*presentation)[rId]).smart_dynamic_cast<PPTX::Slide>();
if (slide.IsInit() == false)
@ -356,12 +356,12 @@ namespace PPTX2EditorAdvanced
oBinaryWriter.StartRecord(NSMainTables::FontMap);
oBinaryWriter.WriteBYTE(NSBinPptxRW::g_nodeAttributeStart);
std::map<CString, CString>* pFMaps = &oBinaryWriter.m_pCommon->m_pNativePicker->m_mapPicks;
std::map<std::wstring, std::wstring>* pFMaps = &oBinaryWriter.m_pCommon->m_pNativePicker->m_mapPicks;
LONG lIndexF = 0;
for (std::map<CString, CString>::iterator pPair = pFMaps->begin(); pPair != pFMaps->end(); ++pPair)
for (std::map<std::wstring, std::wstring>::iterator pPair = pFMaps->begin(); pPair != pFMaps->end(); ++pPair)
{
CString& oRec = pPair->second;
std::wstring& oRec = pPair->second;
oBinaryWriter.WriteString1(lIndexF++, oRec);
}
@ -448,10 +448,8 @@ namespace PPTX2EditorAdvanced
#else
oFile.CreateFile(strDstFile);
#endif
CString strPrefix = _T("");
strPrefix.Format(_T("PPTY;v1;%d;"), nBinBufferLen);
CStringA sW = (CStringA)strPrefix;
oFile.WriteFile(sW.GetBuffer(), (DWORD)sW.GetLength());
std::string strPrefix = "PPTY;v1;" + std::to_string(nBinBufferLen) + ";";
oFile.WriteFile((void*)strPrefix.c_str(), strPrefix.length());
oFile.WriteFile(pbBase64Buffer, nBase64BufferLen);
oFile.CloseFile();
}

View File

@ -41,9 +41,9 @@ namespace Writers
DefaultNotesMasterWriter()
{
}
void Write(CString fileName)
void Write(std::wstring fileName)
{
CString s_Common = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
std::wstring s_Common = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
s_Common += _T("<p:notesMaster xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:p=\"http://schemas.openxmlformats.org/presentationml/2006/main\">\
<p:cSld>\

View File

@ -41,9 +41,9 @@ namespace Writers
DefaultNotesThemeWriter()
{
}
void Write(CString fileName)
void Write(std::wstring fileName)
{
CString s_Common = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
std::wstring s_Common = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
s_Common += _T("<a:theme xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" name=\"Office Theme\">\
<a:themeElements>\

View File

@ -34,432 +34,432 @@
namespace NSPresentationEditor
{
enum PointPathType
{
etMoveTo = 0,
etLineTo = 1,
etCurveTo = 2,
etCloseLoop = 3,
etHorzTo = 4,
etVertTo = 5,
etEnd = 6
// add arc, c3, c2 ????
};
enum EffectType
{
FadeInType = 1,
FadeExitType = 2,
EmphasisEffect = 3,
MotionEffect = 4,
VerbEffect = 5,
MediaCallEffect = 6
};
class CMotionPath
{
private:
struct PathPoint
{
int Type;
double X [ 4 ];
double Y [ 4 ];
};
public:
inline bool FromStr (const CString& Str)
{
m_Points.clear();
int To = 0;
CString Tokens = _T(" mlczevh");
double dEndX = 0.0;
double dEndY = 0.0;
PathPoint oPoint;
for ( int i = 0; i < Str.GetLength (); ++i )
{
if ( _T('m') == Str [ i ] ) oPoint.Type = etMoveTo;
else if ( _T('l') == Str [ i ] ) oPoint.Type = etLineTo;
else if ( _T('c') == Str [ i ] ) oPoint.Type = etCurveTo;
else if ( _T('z') == Str [ i ] ) oPoint.Type = etCloseLoop; // This action requires no points.
else if ( _T('e') == Str [ i ] ) oPoint.Type = etEnd; // This action requires no points.
else if ( _T('h') == Str [ i ] ) oPoint.Type = etHorzTo; //
else if ( _T('v') == Str [ i ] ) oPoint.Type = etVertTo; //
else if ( _T('M') == Str [ i ] ) oPoint.Type = etMoveTo;
else if ( _T('L') == Str [ i ] ) oPoint.Type = etLineTo;
else if ( _T('C') == Str [ i ] ) oPoint.Type = etCurveTo;
else if ( _T('Z') == Str [ i ] ) oPoint.Type = etCloseLoop;
else if ( _T('E') == Str [ i ] ) oPoint.Type = etEnd;
else continue;
To = i + 1;
if ( etMoveTo == oPoint.Type )
{
oPoint.X [ 0 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
oPoint.Y [ 0 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
dEndX = oPoint.X [ 0 ];
dEndY = oPoint.Y [ 0 ];
continue;
}
if ( etLineTo == oPoint.Type )
{
oPoint.X [ 0 ] = dEndX;
oPoint.Y [ 0 ] = dEndY;
oPoint.X [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
oPoint.Y [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
dEndX = oPoint.X [ 1 ];
dEndY = oPoint.Y [ 1 ];
}
if ( etHorzTo == oPoint.Type )
{
oPoint.Type = etLineTo;
oPoint.X [ 0 ] = dEndX;
oPoint.Y [ 0 ] = dEndY;
oPoint.X [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
oPoint.Y [ 1 ] = oPoint.Y [ 0 ];
dEndX = oPoint.X [ 1 ];
dEndY = oPoint.Y [ 1 ];
}
if ( etVertTo == oPoint.Type )
{
oPoint.Type = etLineTo;
oPoint.X [ 0 ] = dEndX;
oPoint.Y [ 0 ] = dEndY;
enum PointPathType
{
etMoveTo = 0,
etLineTo = 1,
etCurveTo = 2,
etCloseLoop = 3,
etHorzTo = 4,
etVertTo = 5,
etEnd = 6
// add arc, c3, c2 ????
};
enum EffectType
{
FadeInType = 1,
FadeExitType = 2,
EmphasisEffect = 3,
MotionEffect = 4,
VerbEffect = 5,
MediaCallEffect = 6
};
class CMotionPath
{
private:
struct PathPoint
{
int Type;
double X [ 4 ];
double Y [ 4 ];
};
public:
// inline bool FromStr (const std::wstring& Str)
// {
// m_Points.clear();
// int To = 0;
// std::wstring Tokens = _T(" mlczevh");
// double dEndX = 0.0;
// double dEndY = 0.0;
// PathPoint oPoint;
// for ( int i = 0; i < Str.length (); ++i )
// {
// if ( _T('m') == Str [ i ] ) oPoint.Type = etMoveTo;
// else if ( _T('l') == Str [ i ] ) oPoint.Type = etLineTo;
// else if ( _T('c') == Str [ i ] ) oPoint.Type = etCurveTo;
// else if ( _T('z') == Str [ i ] ) oPoint.Type = etCloseLoop; // This action requires no points.
// else if ( _T('e') == Str [ i ] ) oPoint.Type = etEnd; // This action requires no points.
// else if ( _T('h') == Str [ i ] ) oPoint.Type = etHorzTo; //
// else if ( _T('v') == Str [ i ] ) oPoint.Type = etVertTo; //
// else if ( _T('M') == Str [ i ] ) oPoint.Type = etMoveTo;
// else if ( _T('L') == Str [ i ] ) oPoint.Type = etLineTo;
// else if ( _T('C') == Str [ i ] ) oPoint.Type = etCurveTo;
// else if ( _T('Z') == Str [ i ] ) oPoint.Type = etCloseLoop;
// else if ( _T('E') == Str [ i ] ) oPoint.Type = etEnd;
// else continue;
// To = i + 1;
// if ( etMoveTo == oPoint.Type )
// {
// oPoint.X [ 0 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 0 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// dEndX = oPoint.X [ 0 ];
// dEndY = oPoint.Y [ 0 ];
// continue;
// }
// if ( etLineTo == oPoint.Type )
// {
// oPoint.X [ 0 ] = dEndX;
// oPoint.Y [ 0 ] = dEndY;
// oPoint.X [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// dEndX = oPoint.X [ 1 ];
// dEndY = oPoint.Y [ 1 ];
// }
// if ( etHorzTo == oPoint.Type )
// {
// oPoint.Type = etLineTo;
// oPoint.X [ 0 ] = dEndX;
// oPoint.Y [ 0 ] = dEndY;
// oPoint.X [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 1 ] = oPoint.Y [ 0 ];
// dEndX = oPoint.X [ 1 ];
// dEndY = oPoint.Y [ 1 ];
// }
// if ( etVertTo == oPoint.Type )
// {
// oPoint.Type = etLineTo;
// oPoint.X [ 0 ] = dEndX;
// oPoint.Y [ 0 ] = dEndY;
oPoint.X [ 1 ] = oPoint.X [ 0 ];
oPoint.Y [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.X [ 1 ] = oPoint.X [ 0 ];
// oPoint.Y [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
dEndX = oPoint.X [ 1 ];
dEndY = oPoint.Y [ 1 ];
}
// dEndX = oPoint.X [ 1 ];
// dEndY = oPoint.Y [ 1 ];
// }
if ( etCurveTo == oPoint.Type )
{
oPoint.X [ 0 ] = dEndX;
oPoint.Y [ 0 ] = dEndY;
// if ( etCurveTo == oPoint.Type )
// {
// oPoint.X [ 0 ] = dEndX;
// oPoint.Y [ 0 ] = dEndY;
oPoint.X [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
oPoint.Y [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.X [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 1 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
oPoint.X [ 2 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
oPoint.Y [ 2 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.X [ 2 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 2 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
oPoint.X [ 3 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
oPoint.Y [ 3 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.X [ 3 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
// oPoint.Y [ 3 ] = _tstof ( Str.Tokenize ( Tokens, To ) ); if ( -1 == To ) break;
dEndX = oPoint.X [ 3 ];
dEndY = oPoint.Y [ 3 ];
}
// dEndX = oPoint.X [ 3 ];
// dEndY = oPoint.Y [ 3 ];
// }
m_Points.push_back ( oPoint );
}
// m_Points.push_back ( oPoint );
// }
return ( m_Points.size() >= 2 );
}
// return ( m_Points.size() >= 2 );
// }
inline CString ToXml (double dW, double dH)
{
CString Xml;
// inline std::wstring ToXml (double dW, double dH)
// {
// std::wstring Xml;
for ( long i = 0; i < (long)m_Points.size(); ++i )
{
CString Fmt;
// for ( long i = 0; i < (long)m_Points.size(); ++i )
// {
// std::wstring Fmt;
if ( etMoveTo == m_Points [ i ].Type )
{
Fmt.Format ( _T("<move x = '%f' y = '%f' />"),
m_Points [ i ].X [ 0 ] * dW, m_Points [ i ].Y [ 0 ] * dH );
}
// if ( etMoveTo == m_Points [ i ].Type )
// {
// Fmt.Format ( _T("<move x = '%f' y = '%f' />"),
// m_Points [ i ].X [ 0 ] * dW, m_Points [ i ].Y [ 0 ] * dH );
// }
if ( etLineTo == m_Points [ i ].Type )
{
Fmt.Format ( _T("<line x0 = '%f' y0 = '%f' x1 = '%f' y1 = '%f' />"),
m_Points [ i ].X [ 0 ] * dW, m_Points [ i ].Y [ 0 ] * dH,
m_Points [ i ].X [ 1 ] * dW, m_Points [ i ].Y [ 1 ] * dH );
}
// if ( etLineTo == m_Points [ i ].Type )
// {
// Fmt.Format ( _T("<line x0 = '%f' y0 = '%f' x1 = '%f' y1 = '%f' />"),
// m_Points [ i ].X [ 0 ] * dW, m_Points [ i ].Y [ 0 ] * dH,
// m_Points [ i ].X [ 1 ] * dW, m_Points [ i ].Y [ 1 ] * dH );
// }
if ( etCurveTo == m_Points [ i ].Type )
{
Fmt.Format ( _T("<curve x0 = '%f' y0 = '%f' x1 = '%f' y1 = '%f' x2 = '%f' y2 = '%f' x3 = '%f' y3 = '%f' />"),
m_Points [ i ].X [ 0 ] * dW, m_Points [ i ].Y [ 0 ] * dH,
m_Points [ i ].X [ 1 ] * dW, m_Points [ i ].Y [ 1 ] * dH,
m_Points [ i ].X [ 2 ] * dW, m_Points [ i ].Y [ 2 ] * dH,
m_Points [ i ].X [ 3 ] * dW, m_Points [ i ].Y [ 3 ] * dH );
}
// if ( etCurveTo == m_Points [ i ].Type )
// {
// Fmt.Format ( _T("<curve x0 = '%f' y0 = '%f' x1 = '%f' y1 = '%f' x2 = '%f' y2 = '%f' x3 = '%f' y3 = '%f' />"),
// m_Points [ i ].X [ 0 ] * dW, m_Points [ i ].Y [ 0 ] * dH,
// m_Points [ i ].X [ 1 ] * dW, m_Points [ i ].Y [ 1 ] * dH,
// m_Points [ i ].X [ 2 ] * dW, m_Points [ i ].Y [ 2 ] * dH,
// m_Points [ i ].X [ 3 ] * dW, m_Points [ i ].Y [ 3 ] * dH );
// }
Xml += Fmt;
}
// Xml += Fmt;
// }
return Xml;
}
// return Xml;
// }
inline CString ToStr ()
{
return _T("");
}
inline std::wstring ToStr ()
{
return _T("");
}
private:
private:
std::vector <PathPoint> m_Points;
};
std::vector <PathPoint> m_Points;
};
class CAnimationSimple
{
public:
CAnimationSimple()
{
m_nRefID = -1;
class CAnimationSimple
{
public:
CAnimationSimple()
{
m_nRefID = -1;
m_nBeginTime = 0;
m_nDuration = 0;
m_nBeginTime = 0;
m_nDuration = 0;
m_nEffectID = 0;
m_nEffectDir = 0;
m_nEffectType = 0;
m_nEffectNodeType = 0;
m_nEffectID = 0;
m_nEffectDir = 0;
m_nEffectType = 0;
m_nEffectNodeType = 0;
m_dSX = 1.0;
m_dSY = 1.0;
m_dSX = 1.0;
m_dSY = 1.0;
m_dRotateAngle = 0.0;
m_dRotateAngle = 0.0;
m_dTransparency = 1.0;
m_dTransparency = 1.0;
m_nSchemeColor = 0;
m_nColorTo = 0;
m_nSchemeColor = 0;
m_nColorTo = 0;
m_dTimeAccel = 0.0;
m_dTimeDecel = 0.0;
m_dTimeAccel = 0.0;
m_dTimeDecel = 0.0;
m_bIgnoreShape = false;
m_nTextSequence = -1;
m_bRemoveEmptyBlocks = false;
m_bIgnoreShape = false;
m_nTextSequence = -1;
m_bRemoveEmptyBlocks = false;
m_nMediaCMD = -1;
}
m_nMediaCMD = -1;
}
public:
public:
unsigned long m_nRefID;
unsigned long m_nRefID;
double m_nBeginTime;
double m_nDuration;
double m_nBeginTime;
double m_nDuration;
unsigned long m_nEffectID;
unsigned long m_nEffectDir;
unsigned long m_nEffectType;
unsigned long m_nEffectNodeType;
unsigned long m_nEffectID;
unsigned long m_nEffectDir;
unsigned long m_nEffectType;
unsigned long m_nEffectNodeType;
CString m_MotionPath;
std::wstring m_MotionPath;
double m_dSX;
double m_dSY;
double m_dSX;
double m_dSY;
double m_dRotateAngle;
double m_dTransparency;
double m_dRotateAngle;
int m_nSchemeColor;
unsigned long m_nColorTo;
double m_dTimeAccel;
double m_dTimeDecel;
int m_nTextSequence;
bool m_bIgnoreShape;
bool m_bRemoveEmptyBlocks;
long m_nMediaCMD;
};
class CAnimationInfo
{
public:
std::vector<CAnimationSimple> m_arAnimations;
double m_dSlideWidth;
double m_dSlideHeight;
std::vector <CString> m_oQuery;
public:
CAnimationInfo() : m_arAnimations()
{
}
CAnimationInfo& operator=(const CAnimationInfo& oSrc)
{
m_dSlideWidth = oSrc.m_dSlideWidth;
m_dSlideHeight = oSrc.m_dSlideHeight;
m_arAnimations.insert(m_arAnimations.end(), oSrc.m_arAnimations.begin(), oSrc.m_arAnimations.end());
return *this;
}
CAnimationInfo(const CAnimationInfo& oSrc)
{
*this = oSrc;
}
~CAnimationInfo()
{
}
public:
CString ToXml(const double& dStartTime, const double& dEndTime, bool bIgnore = false)
{
CString baseXML;
baseXML.Format ( _T("<animations width = '%f' height = '%f'>"), m_dSlideWidth, m_dSlideHeight );
CString Source;
for ( long i = 0; i < (long)m_arAnimations.size(); ++i )
{
CAnimationSimple* pEffect = &m_arAnimations[i];
if (NULL==pEffect)
continue;
if (bIgnore)
{
if (pEffect->m_bIgnoreShape)
continue;
}
double dEffectBegin = dStartTime + pEffect->m_nBeginTime;
m_oQuery.clear ();
m_oQuery.push_back ( _T(" id = '") + NSPresentationEditor::ToString (pEffect->m_nEffectID) + _T("' "));
m_oQuery.push_back ( _T(" type = '") + NSPresentationEditor::ToString (pEffect->m_nEffectType) + _T("' "));
m_oQuery.push_back ( _T(" dir = '") + NSPresentationEditor::ToString (pEffect->m_nEffectDir) + _T("' "));
m_oQuery.push_back ( _T(" begin = '") + NSPresentationEditor::ToString (dEffectBegin) + _T("' "));
m_oQuery.push_back ( _T(" dur = '") + NSPresentationEditor::ToString (pEffect->m_nDuration) + _T("' "));
m_oQuery.push_back ( _T(" accel = '") + NSPresentationEditor::ToString (pEffect->m_dTimeAccel) + _T("' "));
m_oQuery.push_back ( _T(" decel = '") + NSPresentationEditor::ToString (pEffect->m_dTimeDecel) + _T("' "));
m_oQuery.push_back ( _T(" sx = '") + NSPresentationEditor::ToString (pEffect->m_dSX) + _T("' "));
m_oQuery.push_back ( _T(" sy = '") + NSPresentationEditor::ToString (pEffect->m_dSY) + _T("' "));
m_oQuery.push_back ( _T(" alpha = '") + NSPresentationEditor::ToString (pEffect->m_dTransparency) + _T("' "));
m_oQuery.push_back ( _T(" angle = '") + NSPresentationEditor::ToString (pEffect->m_dRotateAngle) + _T("' "));
m_oQuery.push_back ( _T(" color = '") + NSPresentationEditor::ToString (pEffect->m_nColorTo) + _T("' "));
m_oQuery.push_back ( _T(" block = '") + NSPresentationEditor::ToString (pEffect->m_nTextSequence) + _T("' "));
m_oQuery.push_back ( _T(" removeemptyblocks = '") + NSPresentationEditor::ToString (pEffect->m_bRemoveEmptyBlocks) + _T("' "));
CString Effect;
if (MotionEffect == pEffect->m_nEffectType || pEffect->m_MotionPath.GetLength())
{
CMotionPath oPath;
if ( oPath.FromStr ( pEffect->m_MotionPath ) )
{
Effect.Format ( _T("<animateMotion %s >%s</animateMotion>"), FormatXml (), oPath.ToXml(1.0,1.0));
Source += Effect;
}
}
if ( FadeInType == pEffect->m_nEffectType )
{
Effect.Format ( _T("<animateFadeIn %s />"), FormatXml ());
Source += Effect;
}
if ( FadeExitType == pEffect->m_nEffectType )
{
Effect.Format ( _T("<animateFadeExit %s />"), FormatXml ());
Source += Effect;
}
if (EmphasisEffect == pEffect->m_nEffectType )
{
if (6 == pEffect->m_nEffectID) // GrowAndShrink Effect
{
Effect.Format ( _T("<animateScale %s />"), FormatXml ());
}
else if (8 == pEffect->m_nEffectID || 32 == pEffect->m_nEffectID) // Spin Effect || Teeter Effect
{
Effect.Format ( _T("<animateRotate %s />"), FormatXml ());
}
else if (9 == pEffect->m_nEffectID || 35 == pEffect->m_nEffectID) // Blink - 36 - мигание
{
Effect.Format ( _T("<animateAlpha %s />"), FormatXml ());
}
else if (26 == pEffect->m_nEffectID) // FlashBulb Effect ( Пульсация )
{
Effect.Format ( _T("<animateAlpha %s />"), FormatXml ());
Source += Effect;
Effect.Format ( _T("<animateScale %s />"), FormatXml ());
Source += Effect;
continue;
}
else if (27 == pEffect->m_nEffectID // Flicker (÷ветовая пульсация)
|| 1 == pEffect->m_nEffectID // ChangeFillColor - fill color
|| 3 == pEffect->m_nEffectID // ChangeFillColor - font color
|| 7 == pEffect->m_nEffectID // ChangeFillColor - fill lines
|| 19 == pEffect->m_nEffectID) // ColorBlend - object fill color
{
Effect.Format ( _T("<animateColor %s />"), FormatXml ());
}
else
{
Effect.Format ( _T("<animateEmphasis %s />"), FormatXml ());
}
Source += Effect;
}
if (MediaCallEffect == pEffect->m_nEffectType )
{
CString sTime;
sTime.Format(_T(" begin='%f' dur='%f' accel='%f' decel='%f' "), dStartTime + pEffect->m_nBeginTime, pEffect->m_nDuration, pEffect->m_dTimeAccel, pEffect->m_dTimeDecel);
Effect.Format(_T("<mediaCall id='%d' %s event='%d' />"), pEffect->m_nEffectID, sTime, pEffect->m_nMediaCMD);
Source += Effect;
}
}
if (bIgnore)
{
if (0 == Source.GetLength())
return _T("");
}
baseXML += Source;
baseXML += CString(_T("</animations>"));
return baseXML;
}
inline CString FormatXml ()
{
CString Xml;
for ( long i = 0; i < (long)m_oQuery.size(); ++i )
Xml += m_oQuery[i];
return Xml;
}
};
double m_dTransparency;
int m_nSchemeColor;
unsigned long m_nColorTo;
double m_dTimeAccel;
double m_dTimeDecel;
int m_nTextSequence;
bool m_bIgnoreShape;
bool m_bRemoveEmptyBlocks;
long m_nMediaCMD;
};
class CAnimationInfo
{
public:
std::vector<CAnimationSimple> m_arAnimations;
double m_dSlideWidth;
double m_dSlideHeight;
std::vector <std::wstring> m_oQuery;
public:
CAnimationInfo() : m_arAnimations()
{
}
CAnimationInfo& operator=(const CAnimationInfo& oSrc)
{
m_dSlideWidth = oSrc.m_dSlideWidth;
m_dSlideHeight = oSrc.m_dSlideHeight;
m_arAnimations.insert(m_arAnimations.end(), oSrc.m_arAnimations.begin(), oSrc.m_arAnimations.end());
return *this;
}
CAnimationInfo(const CAnimationInfo& oSrc)
{
*this = oSrc;
}
~CAnimationInfo()
{
}
public:
// std::wstring ToXml(const double& dStartTime, const double& dEndTime, bool bIgnore = false)
// {
// std::wstring baseXML;
// baseXML.Format ( _T("<animations width = '%f' height = '%f'>"), m_dSlideWidth, m_dSlideHeight );
// std::wstring Source;
// for ( long i = 0; i < (long)m_arAnimations.size(); ++i )
// {
// CAnimationSimple* pEffect = &m_arAnimations[i];
// if (NULL==pEffect)
// continue;
// if (bIgnore)
// {
// if (pEffect->m_bIgnoreShape)
// continue;
// }
// double dEffectBegin = dStartTime + pEffect->m_nBeginTime;
// m_oQuery.clear ();
// m_oQuery.push_back ( _T(" id = '") + NSPresentationEditor::ToString (pEffect->m_nEffectID) + _T("' "));
// m_oQuery.push_back ( _T(" type = '") + NSPresentationEditor::ToString (pEffect->m_nEffectType) + _T("' "));
// m_oQuery.push_back ( _T(" dir = '") + NSPresentationEditor::ToString (pEffect->m_nEffectDir) + _T("' "));
// m_oQuery.push_back ( _T(" begin = '") + NSPresentationEditor::ToString (dEffectBegin) + _T("' "));
// m_oQuery.push_back ( _T(" dur = '") + NSPresentationEditor::ToString (pEffect->m_nDuration) + _T("' "));
// m_oQuery.push_back ( _T(" accel = '") + NSPresentationEditor::ToString (pEffect->m_dTimeAccel) + _T("' "));
// m_oQuery.push_back ( _T(" decel = '") + NSPresentationEditor::ToString (pEffect->m_dTimeDecel) + _T("' "));
// m_oQuery.push_back ( _T(" sx = '") + NSPresentationEditor::ToString (pEffect->m_dSX) + _T("' "));
// m_oQuery.push_back ( _T(" sy = '") + NSPresentationEditor::ToString (pEffect->m_dSY) + _T("' "));
// m_oQuery.push_back ( _T(" alpha = '") + NSPresentationEditor::ToString (pEffect->m_dTransparency) + _T("' "));
// m_oQuery.push_back ( _T(" angle = '") + NSPresentationEditor::ToString (pEffect->m_dRotateAngle) + _T("' "));
// m_oQuery.push_back ( _T(" color = '") + NSPresentationEditor::ToString (pEffect->m_nColorTo) + _T("' "));
// m_oQuery.push_back ( _T(" block = '") + NSPresentationEditor::ToString (pEffect->m_nTextSequence) + _T("' "));
// m_oQuery.push_back ( _T(" removeemptyblocks = '") + NSPresentationEditor::ToString (pEffect->m_bRemoveEmptyBlocks) + _T("' "));
// std::wstring Effect;
// if (MotionEffect == pEffect->m_nEffectType || pEffect->m_MotionPath.length())
// {
// CMotionPath oPath;
// if ( oPath.FromStr ( pEffect->m_MotionPath ) )
// {
// Effect.Format ( _T("<animateMotion %s >%s</animateMotion>"), FormatXml (), oPath.ToXml(1.0,1.0));
// Source += Effect;
// }
// }
// if ( FadeInType == pEffect->m_nEffectType )
// {
// Effect.Format ( _T("<animateFadeIn %s />"), FormatXml ());
// Source += Effect;
// }
// if ( FadeExitType == pEffect->m_nEffectType )
// {
// Effect.Format ( _T("<animateFadeExit %s />"), FormatXml ());
// Source += Effect;
// }
// if (EmphasisEffect == pEffect->m_nEffectType )
// {
// if (6 == pEffect->m_nEffectID) // GrowAndShrink Effect
// {
// Effect.Format ( _T("<animateScale %s />"), FormatXml ());
// }
// else if (8 == pEffect->m_nEffectID || 32 == pEffect->m_nEffectID) // Spin Effect || Teeter Effect
// {
// Effect.Format ( _T("<animateRotate %s />"), FormatXml ());
// }
// else if (9 == pEffect->m_nEffectID || 35 == pEffect->m_nEffectID) // Blink - 36 - мигание
// {
// Effect.Format ( _T("<animateAlpha %s />"), FormatXml ());
// }
// else if (26 == pEffect->m_nEffectID) // FlashBulb Effect ( Пульсация )
// {
// Effect.Format ( _T("<animateAlpha %s />"), FormatXml ());
// Source += Effect;
// Effect.Format ( _T("<animateScale %s />"), FormatXml ());
// Source += Effect;
// continue;
// }
// else if (27 == pEffect->m_nEffectID // Flicker (÷ветовая пульсация)
// || 1 == pEffect->m_nEffectID // ChangeFillColor - fill color
// || 3 == pEffect->m_nEffectID // ChangeFillColor - font color
// || 7 == pEffect->m_nEffectID // ChangeFillColor - fill lines
// || 19 == pEffect->m_nEffectID) // ColorBlend - object fill color
// {
// Effect.Format ( _T("<animateColor %s />"), FormatXml ());
// }
// else
// {
// Effect.Format ( _T("<animateEmphasis %s />"), FormatXml ());
// }
// Source += Effect;
// }
// if (MediaCallEffect == pEffect->m_nEffectType )
// {
// std::wstring sTime;
// sTime.Format(_T(" begin='%f' dur='%f' accel='%f' decel='%f' "), dStartTime + pEffect->m_nBeginTime, pEffect->m_nDuration, pEffect->m_dTimeAccel, pEffect->m_dTimeDecel);
// Effect.Format(_T("<mediaCall id='%d' %s event='%d' />"), pEffect->m_nEffectID, sTime, pEffect->m_nMediaCMD);
// Source += Effect;
// }
// }
// if (bIgnore)
// {
// if (0 == Source.length())
// return _T("");
// }
// baseXML += Source;
// baseXML += std::wstring(_T("</animations>"));
// return baseXML;
// }
inline std::wstring FormatXml ()
{
std::wstring Xml;
for ( long i = 0; i < (long)m_oQuery.size(); ++i )
Xml += m_oQuery[i];
return Xml;
}
};
}

File diff suppressed because it is too large Load Diff

View File

@ -34,267 +34,263 @@
namespace NSPresentationEditor
{
class CAudioPart
{
public:
std::wstring m_strFile;
class CAudioPart
{
public:
std::wstring m_strFile;
double m_dStartTime;
double m_dEndTime;
double m_dStartTime;
double m_dEndTime;
double m_dClipStartTime;
double m_dClipEndTime;
double m_dClipStartTime;
double m_dClipEndTime;
double m_dAudioDuration;
bool m_bLoop;
bool m_bStop;
double m_dAudioDuration;
bool m_bIsTransition;
bool m_bLoop;
bool m_bStop;
double m_dAmplify;
bool m_bIsTransition;
public:
CAudioPart()
{
m_strFile = _T("");
double m_dAmplify;
m_dStartTime = 0.0;
m_dEndTime = -1.0;
public:
CAudioPart()
{
m_dStartTime = 0.0;
m_dEndTime = -1.0;
m_dClipStartTime = 0.0;
m_dClipEndTime = -1.0;
m_dClipStartTime = 0.0;
m_dClipEndTime = -1.0;
m_dAudioDuration = 0.0;
m_dAudioDuration = 0.0;
m_bLoop = false;
m_bStop = false;
m_bLoop = false;
m_bStop = false;
m_bIsTransition = false;
m_bIsTransition = false;
m_dAmplify = 100.0;
}
m_dAmplify = 100.0;
}
~CAudioPart()
{
}
~CAudioPart()
{
}
CAudioPart(const CAudioPart& oSrc)
{
*this = oSrc;
}
CAudioPart(const CAudioPart& oSrc)
{
*this = oSrc;
}
CAudioPart& operator=(const CAudioPart& oSrc)
{
m_strFile = oSrc.m_strFile;
m_dStartTime = oSrc.m_dStartTime;
m_dEndTime = oSrc.m_dEndTime;
CAudioPart& operator=(const CAudioPart& oSrc)
{
m_strFile = oSrc.m_strFile;
m_dClipStartTime = oSrc.m_dClipStartTime;
m_dClipEndTime = oSrc.m_dClipEndTime;
m_dStartTime = oSrc.m_dStartTime;
m_dEndTime = oSrc.m_dEndTime;
m_dAudioDuration = oSrc.m_dAudioDuration;
m_dClipStartTime = oSrc.m_dClipStartTime;
m_dClipEndTime = oSrc.m_dClipEndTime;
m_bLoop = oSrc.m_bLoop;
m_bStop = oSrc.m_bStop;
m_dAudioDuration = oSrc.m_dAudioDuration;
m_bIsTransition = oSrc.m_bIsTransition;
m_bLoop = oSrc.m_bLoop;
m_bStop = oSrc.m_bStop;
m_dAmplify = oSrc.m_dAmplify;
m_bIsTransition = oSrc.m_bIsTransition;
return *this;
}
m_dAmplify = oSrc.m_dAmplify;
CAudioPart(CAudioElement* pAudioElem)
{
if (NULL == pAudioElem)
{
m_strFile = _T("");
return *this;
}
m_dStartTime = 0.0;
m_dEndTime = -1.0;
CAudioPart(CAudioElement* pAudioElem)
{
if (NULL == pAudioElem)
{
m_strFile = _T("");
m_dClipStartTime = 0.0;
m_dClipEndTime = -1.0;
m_dStartTime = 0.0;
m_dEndTime = -1.0;
m_dAudioDuration = 0.0;
m_dClipStartTime = 0.0;
m_dClipEndTime = -1.0;
m_bLoop = false;
m_bStop = false;
m_dAudioDuration = 0.0;
m_bIsTransition = false;
m_bLoop = false;
m_bStop = false;
m_dAmplify = 100.0;
}
else
{
m_strFile = pAudioElem->m_strAudioFileName;
m_bIsTransition = false;
m_dStartTime = pAudioElem->m_dStartTime;
m_dEndTime = pAudioElem->m_dEndTime;
m_dAmplify = 100.0;
}
else
{
m_strFile = pAudioElem->m_strAudioFileName;
m_dClipStartTime = pAudioElem->m_dClipStartTime;
m_dClipEndTime = pAudioElem->m_dClipEndTime;
m_dStartTime = pAudioElem->m_dStartTime;
m_dEndTime = pAudioElem->m_dEndTime;
m_dAudioDuration = pAudioElem->m_dAudioDuration;
m_dClipStartTime = pAudioElem->m_dClipStartTime;
m_dClipEndTime = pAudioElem->m_dClipEndTime;
m_bLoop = ( pAudioElem->m_bLoop == TRUE) ? true : false;;
m_bStop = false;
m_dAudioDuration = pAudioElem->m_dAudioDuration;
m_bIsTransition = false;
m_bLoop = ( pAudioElem->m_bLoop == TRUE) ? true : false;;
m_bStop = false;
m_dAmplify = 100.0;
}
}
m_bIsTransition = false;
public:
void CalculateDuration()
{
if (0.0 < m_dAudioDuration || _T("") == m_strFile)
return;
}
};
m_dAmplify = 100.0;
}
}
class CAudioOverlay
{
public:
std::vector<CAudioPart> m_arParts;
double m_dAllDuration;
public:
void CalculateDuration()
{
if (0.0 < m_dAudioDuration || _T("") == m_strFile)
return;
}
};
public:
CAudioOverlay() : m_arParts(), m_dAllDuration(0.0)
{
}
~CAudioOverlay()
{
}
CAudioOverlay(const CAudioOverlay& oSrc)
{
*this = oSrc;
}
CAudioOverlay& operator=(const CAudioOverlay& oSrc)
{
m_arParts.insert(m_arParts.end(), oSrc.m_arParts.begin(), oSrc.m_arParts.end());
m_dAllDuration = oSrc.m_dAllDuration;
return *this;
}
class CAudioOverlay
{
public:
std::vector<CAudioPart> m_arParts;
double m_dAllDuration;
public:
void Calculate()
{
size_t nCount = m_arParts.size();
public:
CAudioOverlay() : m_arParts(), m_dAllDuration(0.0)
{
}
~CAudioOverlay()
{
}
CAudioOverlay(const CAudioOverlay& oSrc)
{
*this = oSrc;
}
CAudioOverlay& operator=(const CAudioOverlay& oSrc)
{
m_arParts.insert(m_arParts.end(), oSrc.m_arParts.begin(), oSrc.m_arParts.end());
m_dAllDuration = oSrc.m_dAllDuration;
return *this;
}
// нормализуем для начала
for (size_t i = 0; i < nCount; ++i)
{
CAudioPart* pPart = &m_arParts[i];
public:
pPart->CalculateDuration();
void Calculate()
{
size_t nCount = m_arParts.size();
if (pPart->m_dStartTime < 0.0)
pPart->m_dStartTime = 0.0;
// нормализуем для начала
for (size_t i = 0; i < nCount; ++i)
{
CAudioPart* pPart = &m_arParts[i];
pPart->m_dEndTime = pPart->m_dStartTime + pPart->m_dAudioDuration;
if (pPart->m_dEndTime > m_dAllDuration)
{
pPart->m_dEndTime = m_dAllDuration;
}
if (pPart->m_bLoop)
{
pPart->m_dEndTime = m_dAllDuration;
}
}
pPart->CalculateDuration();
// пересчет
for (size_t i = 0; i < nCount; ++i)
{
CAudioPart* pPart = &m_arParts[i];
if (pPart->m_dStartTime < 0.0)
pPart->m_dStartTime = 0.0;
if (pPart->m_bIsTransition)
{
if (pPart->m_bStop)
{
// нужно остановить всю музыку до этого
for (size_t j = 0; j < nCount; ++j)
{
if (j == i)
continue;
pPart->m_dEndTime = pPart->m_dStartTime + pPart->m_dAudioDuration;
if (pPart->m_dEndTime > m_dAllDuration)
{
pPart->m_dEndTime = m_dAllDuration;
}
if (pPart->m_bLoop)
{
pPart->m_dEndTime = m_dAllDuration;
}
}
CAudioPart* pMem = &m_arParts[j];
if (pMem->m_dStartTime <= pPart->m_dStartTime && pMem->m_dEndTime > pPart->m_dStartTime)
{
pMem->m_dEndTime = pPart->m_dStartTime;
}
}
}
if (pPart->m_bLoop)
{
// зацикливаем до первого встречания аудио
// пересчет
for (size_t i = 0; i < nCount; ++i)
{
CAudioPart* pPart = &m_arParts[i];
double dMin = m_dAllDuration;
for (size_t j = 0; j < nCount; ++j)
{
if (j == i)
continue;
if (pPart->m_bIsTransition)
{
if (pPart->m_bStop)
{
// нужно остановить всю музыку до этого
for (size_t j = 0; j < nCount; ++j)
{
if (j == i)
continue;
CAudioPart* pMem = &m_arParts[j];
if (pMem->m_dStartTime > pPart->m_dEndTime)
{
if (dMin > pMem->m_dStartTime)
dMin = pMem->m_dStartTime;
}
}
CAudioPart* pMem = &m_arParts[j];
if (pMem->m_dStartTime <= pPart->m_dStartTime && pMem->m_dEndTime > pPart->m_dStartTime)
{
pMem->m_dEndTime = pPart->m_dStartTime;
}
}
}
if (pPart->m_bLoop)
{
// зацикливаем до первого встречания аудио
pPart->m_dEndTime = dMin;
}
}
else
{
if (pPart->m_bLoop)
{
pPart->m_dEndTime = m_dAllDuration;
}
}
}
}
double dMin = m_dAllDuration;
for (size_t j = 0; j < nCount; ++j)
{
if (j == i)
continue;
CString GetAudioOverlay()
{
CString strRes = _T("");
size_t nCount = m_arParts.size();
CAudioPart* pMem = &m_arParts[j];
if (pMem->m_dStartTime > pPart->m_dEndTime)
{
if (dMin > pMem->m_dStartTime)
dMin = pMem->m_dStartTime;
}
}
for (size_t i = 0; i < nCount; ++i)
{
CAudioPart* pPart = &m_arParts[i];
CString strOverlay1 = _T("");
CString strOverlay2 = _T("");
strOverlay1.Format(_T("<AudioSource StartTime='%lf' Duration='%lf' Amplify='%lf'>"),
pPart->m_dStartTime, pPart->m_dEndTime - pPart->m_dStartTime, pPart->m_dAmplify);
pPart->m_dEndTime = dMin;
}
}
else
{
if (pPart->m_bLoop)
{
pPart->m_dEndTime = m_dAllDuration;
}
}
}
}
int lIndex = pPart->m_strFile.find(L"file:///");
if (0 == lIndex)
{
pPart->m_strFile = pPart->m_strFile.substr(8);
//pPart->m_strFile.Replace('/', '\\');
//pPart->m_strFile.Replace(L"%20", L" ");
}
std::wstring GetAudioOverlay()
{
std::wstring strRes = _T("");
CString strFile_ = pPart->m_strFile;
CorrectXmlString(strFile_);
size_t nCount = m_arParts.size();
strOverlay2.Format(_T("<Source StartTime='%lf' EndTime='%lf' FilePath='%s'/></AudioSource>"),
pPart->m_dClipStartTime, pPart->m_dClipEndTime, strFile_);
for (size_t i = 0; i < nCount; ++i)
{
CAudioPart* pPart = &m_arParts[i];
strOverlay1 += strOverlay2;
std::wstring strOverlay1 = L"<AudioSource StartTime='" + std::to_wstring(pPart->m_dStartTime)
+ L"' Duration='" + std::to_wstring(pPart->m_dEndTime - pPart->m_dStartTime)
+ L"' Amplify='" + std::to_wstring(pPart->m_dAmplify) + L"'>";
strRes += strOverlay1;
}
int lIndex = pPart->m_strFile.find(L"file:///");
if (0 == lIndex)
{
pPart->m_strFile = pPart->m_strFile.substr(8);
//pPart->m_strFile.Replace('/', '\\');
//pPart->m_strFile.Replace(L"%20", L" ");
}
return strRes;
}
};
}
std::wstring strFile_ = pPart->m_strFile;
CorrectXmlString(strFile_);
std::wstring strOverlay2 = L"<Source StartTime='" + std::to_wstring(pPart->m_dClipStartTime)
+ L"' EndTime='" + std::to_wstring(pPart->m_dClipEndTime)
+ L"' FilePath='" + strFile_+ L"'/></AudioSource>";
strRes += strOverlay1 + strOverlay2;
}
return strRes;
}
};
}

View File

@ -114,9 +114,9 @@ namespace NSPresentationEditor
public:
// функция производит расчет по теме и слайдам
CString GetXmlSlideTransition ( CSlide& oSlide/*, CAudioOverlay& oAudioOverlay*/ )
std::wstring GetXmlSlideTransition ( CSlide& oSlide/*, CAudioOverlay& oAudioOverlay*/ )
{
CString Source = CString ( _T("") );
std::wstring Source = std::wstring ( _T("") );
int EffectID = 1;
int lEffectDirection = oSlide.m_oSlideShow.m_oTransition.m_nEffectDirection;
@ -314,7 +314,7 @@ namespace NSPresentationEditor
break;
}
Source.Format ( _T("<VideoCompose Time = \"%lf\" effectid=\"%d\" />"), oSlide.m_oSlideShow.m_oTransition.m_dSpeed, EffectID );
Source = L"<VideoCompose Time=\"" + std::to_wstring(oSlide.m_oSlideShow.m_oTransition.m_dSpeed) + L"\" effectid=\"" + std::to_wstring(EffectID) + L"\"/>";
/*

View File

@ -32,55 +32,53 @@
#pragma once
#include <vector>
#include "../../../Common/DocxFormat/Source/Base/ASCString.h"
#include <string>
namespace NSPresentationEditor
{
class CEffect
{
public:
CString m_strEffect;
class CEffect
{
public:
std::wstring m_strEffect;
public:
CEffect() : m_strEffect(_T(""))
{
}
CEffect& operator=(const CEffect& oSrc)
{
m_strEffect = oSrc.m_strEffect;
return *this;
}
CEffect(const CEffect& oSrc)
{
*this = oSrc;
}
~CEffect()
{
}
};
public:
CEffect() : m_strEffect((L""))
{
}
CEffect& operator=(const CEffect& oSrc)
{
m_strEffect = oSrc.m_strEffect;
return *this;
}
CEffect(const CEffect& oSrc)
{
*this = oSrc;
}
~CEffect()
{
}
};
class CEffects
{
public:
std::vector<CEffect> m_arEffects;
class CEffects
{
public:
std::vector<CEffect> m_arEffects;
public:
CEffects() : m_arEffects()
{
}
CEffects& operator=(const CEffects& oSrc)
{
m_arEffects.insert(m_arEffects.end(), oSrc.m_arEffects.begin(), oSrc.m_arEffects.end());
return *this;
}
CEffects(const CEffects& oSrc)
{
*this = oSrc;
}
~CEffects()
{
}
};
public:
CEffects() : m_arEffects()
{
}
CEffects& operator=(const CEffects& oSrc)
{
m_arEffects.insert(m_arEffects.end(), oSrc.m_arEffects.begin(), oSrc.m_arEffects.end());
return *this;
}
CEffects(const CEffects& oSrc)
{
*this = oSrc;
}
~CEffects()
{
}
};
}

View File

@ -338,12 +338,12 @@ namespace NSPresentationEditor
virtual void SetupProperty(CSlide* pSlide, CTheme* pTheme, CLayout* pLayout, CElementProperty* pProperty) = 0;
virtual IElement* CreateDublicate() = 0;
virtual CString SerializeToXml()
virtual std::wstring SerializeToXml()
{
CString strElement = _T("");
strElement.Format(_T("<Element type='%d' id='%d' lid='%d' pid='%d' ptp='%d' />"),
(int)m_etType, m_lID, m_lLayoutID, m_lPlaceholderID, m_lPlaceholderType);
std::wstring strElement;
// strElement.Format(_T("<Element type='%d' id='%d' lid='%d' pid='%d' ptp='%d' />"),
// (int)m_etType, m_lID, m_lLayoutID, m_lPlaceholderID, m_lPlaceholderType);
return strElement;
}
};
}
}

View File

@ -45,7 +45,7 @@
#if defined(PPTX_DEF)
namespace PPTX2EditorAdvanced
{
AVSINLINE OOXMLShapes::ShapeType GetShapeTypeFromStr(const CString& str)//const
AVSINLINE OOXMLShapes::ShapeType GetShapeTypeFromStr(const std::wstring& str)//const
{
if(str == _T(""))
return OOXMLShapes::sptNil;
@ -341,64 +341,65 @@ namespace NSPresentationEditor
virtual void WriteToXml(XmlUtils::CXmlWriter& oWriter)
{
CString strXml = SaveToXML();
std::wstring strXml = SaveToXML();
oWriter.WriteString(strXml);
}
virtual void ReadFromXml(XmlUtils::CXmlNode& oNode)
{
}
virtual CString SaveToXML()
virtual std::wstring SaveToXML()
{
if (!m_oAnimations.m_arAnimations.empty())
return ToAnimationXml();
std::wstring strEffect;
// if (!m_oAnimations.m_arAnimations.empty())
// return ToAnimationXml();
LONG lFlags = 0;
if (m_bFlipH)
lFlags |= 0x0001;
if (m_bFlipV)
lFlags |= 0x0002;
// LONG lFlags = 0;
// if (m_bFlipH)
// lFlags |= 0x0001;
// if (m_bFlipV)
// lFlags |= 0x0002;
CString strEffect = _T("");
strEffect.Format(_T("<ImagePaint-DrawImageFromFile left='%d' top='%d' right='%d' bottom='%d' angle='%lf' flags='%d' filepath='%ls' metric='0' backcolor='-1' scaletype='-1' scalecolor='255' widthmetric='%d' heightmetric='%d'>\
<timeline type='1' begin='%lf' end='%lf' fadein='0' fadeout='0' completeness='1.0' /></ImagePaint-DrawImageFromFile>"),
(LONG)m_rcBounds.left, (LONG)m_rcBounds.top, (LONG)m_rcBounds.right, (LONG)m_rcBounds.bottom,
m_dRotate, lFlags, m_strImageFileName,
m_oMetric.m_lMillimetresHor, m_oMetric.m_lMillimetresVer,
m_dStartTime, m_dEndTime);
// strEffect.Format(_T("<ImagePaint-DrawImageFromFile left='%d' top='%d' right='%d' bottom='%d' angle='%lf' flags='%d' filepath='%ls' metric='0' backcolor='-1' scaletype='-1' scalecolor='255' widthmetric='%d' heightmetric='%d'>\
// <timeline type='1' begin='%lf' end='%lf' fadein='0' fadeout='0' completeness='1.0' /></ImagePaint-DrawImageFromFile>"),
// (LONG)m_rcBounds.left, (LONG)m_rcBounds.top, (LONG)m_rcBounds.right, (LONG)m_rcBounds.bottom,
// m_dRotate, lFlags, m_strImageFileName,
// m_oMetric.m_lMillimetresHor, m_oMetric.m_lMillimetresVer,
// m_dStartTime, m_dEndTime);
return strEffect;
}
CString ToAnimationXml()
{
LONG lFlags = 0;
if (m_bFlipH)
lFlags |= 0x0001;
if (m_bFlipV)
lFlags |= 0x0002;
// std::wstring ToAnimationXml()
// {
// LONG lFlags = 0;
// if (m_bFlipH)
// lFlags |= 0x0001;
// if (m_bFlipV)
// lFlags |= 0x0002;
CString strEffect = _T("");
strEffect.Format(_T("<ImagePaint-DrawImageFromFile left='%d' top='%d' right='%d' bottom='%d' angle='%lf' flags='%d' filepath='%ls' metric='0' backcolor='-1' scaletype='-1' scalecolor='255' widthmetric='%d' heightmetric='%d'>\
<timeline type='1' begin='%lf' end='%lf' fadein='0' fadeout='0' completeness='1.0' /></ImagePaint-DrawImageFromFile>"),
(LONG)m_rcBounds.left, (LONG)m_rcBounds.top, (LONG)m_rcBounds.right, (LONG)m_rcBounds.bottom,
m_dRotate, lFlags, m_strImageFileName,
m_oMetric.m_lMillimetresHor, m_oMetric.m_lMillimetresVer,
m_dStartTime, m_dEndTime);
// std::wstring strEffect = _T("");
// strEffect.Format(_T("<ImagePaint-DrawImageFromFile left='%d' top='%d' right='%d' bottom='%d' angle='%lf' flags='%d' filepath='%ls' metric='0' backcolor='-1' scaletype='-1' scalecolor='255' widthmetric='%d' heightmetric='%d'>\
// <timeline type='1' begin='%lf' end='%lf' fadein='0' fadeout='0' completeness='1.0' /></ImagePaint-DrawImageFromFile>"),
// (LONG)m_rcBounds.left, (LONG)m_rcBounds.top, (LONG)m_rcBounds.right, (LONG)m_rcBounds.bottom,
// m_dRotate, lFlags, m_strImageFileName,
// m_oMetric.m_lMillimetresHor, m_oMetric.m_lMillimetresVer,
// m_dStartTime, m_dEndTime);
CString TimeLine;
TimeLine.Format ( _T("<timeline type = \"1\" begin=\"%f\" end=\"%f\" fadein=\"0\" fadeout=\"0\" completeness=\"1.0\"/> "),
m_dStartTime, m_dEndTime );
// std::wstring TimeLine;
// TimeLine.Format ( _T("<timeline type = \"1\" begin=\"%f\" end=\"%f\" fadein=\"0\" fadeout=\"0\" completeness=\"1.0\"/> "),
// m_dStartTime, m_dEndTime );
CString Source = m_oAnimations.ToXml(m_dStartTime, m_dEndTime);
Source += TimeLine;
Source += _T("</ImagePaint-DrawImageFromFileAnimate>");
// std::wstring Source = m_oAnimations.ToXml(m_dStartTime, m_dEndTime);
// Source += TimeLine;
// Source += _T("</ImagePaint-DrawImageFromFileAnimate>");
strEffect.Replace ( _T("</ImagePaint-DrawImageFromFile>"), Source );
strEffect.Replace ( _T("<ImagePaint-DrawImageFromFile"), _T("<ImagePaint-DrawImageFromFileAnimate") );
// strEffect.Replace ( _T("</ImagePaint-DrawImageFromFile>"), Source );
// strEffect.Replace ( _T("<ImagePaint-DrawImageFromFile"), _T("<ImagePaint-DrawImageFromFileAnimate") );
return strEffect;
}
// return strEffect;
// }
virtual IElement* CreateDublicate()
{
@ -430,7 +431,7 @@ namespace NSPresentationEditor
#ifdef ENABLE_PPT_TO_PPTX_CONVERT
AVSINLINE CString ConvertPPTShapeToPPTX(bool bIsNamespace = false)
AVSINLINE std::wstring ConvertPPTShapeToPPTX(bool bIsNamespace = false)
{
NSGuidesVML::CFormParam pParamCoef;
pParamCoef.m_eType = ptValue;
@ -441,7 +442,7 @@ namespace NSPresentationEditor
}
CString ConvertPPTtoPPTX(/*CPPTShape* pPPTShape, */const NSGuidesVML::CFormParam& pCoef, bool bIsNamespace = false)
std::wstring ConvertPPTtoPPTX(/*CPPTShape* pPPTShape, */const NSGuidesVML::CFormParam& pCoef, bool bIsNamespace = false)
{
if (bIsNamespace)
{
@ -449,7 +450,7 @@ namespace NSPresentationEditor
}
return _T("<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>");
CString strXmlPPTX = bIsNamespace ? _T("<a:custGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") : _T("<a:custGeom>");
std::wstring strXmlPPTX = bIsNamespace ? _T("<a:custGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") : _T("<a:custGeom>");
strXmlPPTX += _T("</a:custGeom>");
return strXmlPPTX;
@ -498,7 +499,7 @@ namespace NSPresentationEditor
m_bShapePreset = false;
}
CShapeElement(const CString& str) : IElement(), m_oShape(NSBaseShape::unknown, 0x1000)
CShapeElement(const std::wstring& str) : IElement(), m_oShape(NSBaseShape::unknown, 0x1000)
{
m_lShapeType = 0x1000;
m_bShapePreset = false;
@ -727,7 +728,7 @@ namespace NSPresentationEditor
#ifdef ENABLE_PPT_TO_PPTX_CONVERT
AVSINLINE CString ConvertPPTShapeToPPTX(bool bIsNamespace = false)
AVSINLINE std::wstring ConvertPPTShapeToPPTX(bool bIsNamespace = false)
{
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(m_oShape.m_pShape);
if (NULL == pPPTShape)
@ -746,7 +747,7 @@ namespace NSPresentationEditor
#ifndef OPTIMIZE_COMPILE_CONVERT_PPT_TO_PPTX
CString ConvertPPTtoPPTX(CPPTShape* pPPTShape, const NSGuidesVML::CFormParam& pCoef, bool bIsNamespace = false)
std::wstring ConvertPPTtoPPTX(CPPTShape* pPPTShape, const NSGuidesVML::CFormParam& pCoef, bool bIsNamespace = false)
{
if (pPPTShape->m_eType == PPTShapes::sptCRect)
{
@ -757,7 +758,7 @@ namespace NSPresentationEditor
return _T("<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>");
}
CString strXmlPPTX = bIsNamespace ? _T("<a:custGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") : _T("<a:custGeom>");
std::wstring strXmlPPTX = bIsNamespace ? _T("<a:custGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") : _T("<a:custGeom>");
CFormulaConverter pFormulaConverter;
@ -829,7 +830,7 @@ namespace NSPresentationEditor
return strXmlPPTX;
}
#else
CString ConvertPPTtoPPTX(CPPTShape* pPPTShape, const NSGuidesVML::CFormParam& pCoef, bool bIsNamespace = false)
std::wstring ConvertPPTtoPPTX(CPPTShape* pPPTShape, const NSGuidesVML::CFormParam& pCoef, bool bIsNamespace = false)
{
if (pPPTShape->m_eType == PPTShapes::sptCRect)
{
@ -848,7 +849,7 @@ namespace NSPresentationEditor
return _T("<a:prstGeom prst=\"line\"><a:avLst/></a:prstGeom>");
}
CString strXmlPPTX = bIsNamespace ? _T("<a:custGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") : _T("<a:custGeom>");
std::wstring strXmlPPTX = bIsNamespace ? _T("<a:custGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">") : _T("<a:custGeom>");
CFormulaConverter pFormulaConverter;
@ -863,7 +864,7 @@ namespace NSPresentationEditor
}
//path------------------------------------------
int nPathCount = pPPTShape->m_strPath.GetLength();
int nPathCount = pPPTShape->m_strPath.length();
if (0 != nPathCount && pPPTShape->m_eType != 1)
{
pFormulaConverter.ConvertPath(pPPTShape->m_strPath, pPPTShape->m_oPath);
@ -960,48 +961,48 @@ namespace NSPresentationEditor
{
}
virtual CString SaveToXML()
virtual std::wstring SaveToXML()
{
CString element = _T("");
element.Format(_T("<AudioSource StartTime='%lf' Duration='%lf' Amplify='%lf'>"), m_dStartTime, m_dEndTime-m_dStartTime, (double)m_nAmplify);
std::wstring element;
// element.Format(_T("<AudioSource StartTime='%lf' Duration='%lf' Amplify='%lf'>"), m_dStartTime, m_dEndTime-m_dStartTime, (double)m_nAmplify);
int lIndex = m_strAudioFileName.find(L"file:///");
if (0 == lIndex)
{
m_strAudioFileName = m_strAudioFileName.substr(8);
//m_strFileName.Replace('/', '\\');
//m_strFileName.Replace(L"%20", L" ");
}
// int lIndex = m_strAudioFileName.find(L"file:///");
// if (0 == lIndex)
// {
// m_strAudioFileName = m_strAudioFileName.substr(8);
// //m_strFileName.Replace('/', '\\');
// //m_strFileName.Replace(L"%20", L" ");
// }
std::wstring strFileName = m_strAudioFileName;
CorrectXmlString(strFileName);
// std::wstring strFileName = m_strAudioFileName;
// CorrectXmlString(strFileName);
CString source;
source.Format(_T("<Source StartTime='%lf' EndTime='%lf' FilePath='%ls' loop='%d' />"), m_dClipStartTime, m_dClipEndTime, strFileName, m_bLoop);
element += source;
// std::wstring source;
// source.Format(_T("<Source StartTime='%lf' EndTime='%lf' FilePath='%ls' loop='%d' />"), m_dClipStartTime, m_dClipEndTime, strFileName, m_bLoop);
// element += source;
CString animations;
if(!m_oAnimations.m_arAnimations.empty()) // для audio только "media call's" - play - pause - stop
{
m_oAnimations.m_dSlideWidth = m_oMetric.m_lMillimetresHor;
m_oAnimations.m_dSlideHeight = m_oMetric.m_lMillimetresVer;
animations = m_oAnimations.ToXml(m_dStartTime, m_dEndTime);
// std::wstring animations;
// if(!m_oAnimations.m_arAnimations.empty()) // для audio только "media call's" - play - pause - stop
// {
// m_oAnimations.m_dSlideWidth = m_oMetric.m_lMillimetresHor;
// m_oAnimations.m_dSlideHeight = m_oMetric.m_lMillimetresVer;
// animations = m_oAnimations.ToXml(m_dStartTime, m_dEndTime);
element += animations;
}
// element += animations;
// }
CString timeLine;
timeLine.Format ( _T("<timeline type = \"1\" begin=\"%f\" end=\"%f\" fadein=\"0\" fadeout=\"0\" completeness=\"1.0\"/> "), m_dStartTime, m_dEndTime );
// std::wstring timeLine;
// timeLine.Format ( _T("<timeline type = \"1\" begin=\"%f\" end=\"%f\" fadein=\"0\" fadeout=\"0\" completeness=\"1.0\"/> "), m_dStartTime, m_dEndTime );
element += timeLine;
element += _T("</AudioSource>");
// element += timeLine;
// element += _T("</AudioSource>");
return element;
}
virtual void WriteToXml(XmlUtils::CXmlWriter& oWriter)
{
CString strXml = SaveToXML();
std::wstring strXml = SaveToXML();
oWriter.WriteString(strXml);
}
@ -1063,21 +1064,21 @@ namespace NSPresentationEditor
virtual void WriteToXml(XmlUtils::CXmlWriter& oWriter)
{
CString strXml = SaveToXML();
std::wstring strXml = SaveToXML();
oWriter.WriteString(strXml);
}
virtual void ReadFromXml(XmlUtils::CXmlNode& oNode)
{
}
virtual CString SaveToXML()
virtual std::wstring SaveToXML()
{
return GetVideoStream () + GetAudioStream ();
return L""; //GetVideoStream () + GetAudioStream ();
}
CString ToAnimationXml()
std::wstring ToAnimationXml()
{
return _T("");
return L"";
}
virtual IElement* CreateDublicate()
@ -1102,82 +1103,82 @@ namespace NSPresentationEditor
{
}
inline CString GetVideoStream ()
{
int lIndex = m_strVideoFileName.find(L"file:///");
if (0 == lIndex)
{
m_strVideoFileName = m_strVideoFileName.substr(8);
/*m_strFileName.Replace('/', '\\');*/
}
// inline std::wstring GetVideoStream ()
// {
// int lIndex = m_strVideoFileName.find(L"file:///");
// if (0 == lIndex)
// {
// m_strVideoFileName = m_strVideoFileName.substr(8);
// /*m_strFileName.Replace('/', '\\');*/
// }
std::wstring strFileName = m_strVideoFileName;
CorrectXmlString(strFileName);
// std::wstring strFileName = m_strVideoFileName;
// CorrectXmlString(strFileName);
CString element;
element.Format ( L"<VideoStream left='%d' top='%d' right='%d' bottom='%d' angle='%f' loop='%d' \
widthmetric='%d' heightmetric='%d' file='%ls' begin='%f' end='%f' >",
(LONG)m_rcBounds.left, (LONG)m_rcBounds.top, (LONG)m_rcBounds.right, (LONG)m_rcBounds.bottom, m_dRotate, m_bLoop,
m_oMetric.m_lMillimetresHor, m_oMetric.m_lMillimetresVer,
strFileName, m_dClipStartTime, m_dClipEndTime );
// std::wstring element;
// element.Format ( L"<VideoStream left='%d' top='%d' right='%d' bottom='%d' angle='%f' loop='%d' \
//widthmetric='%d' heightmetric='%d' file='%ls' begin='%f' end='%f' >",
// (LONG)m_rcBounds.left, (LONG)m_rcBounds.top, (LONG)m_rcBounds.right, (LONG)m_rcBounds.bottom, m_dRotate, m_bLoop,
// m_oMetric.m_lMillimetresHor, m_oMetric.m_lMillimetresVer,
// strFileName, m_dClipStartTime, m_dClipEndTime );
CString animations;
if(!m_oAnimations.m_arAnimations.empty())
{
m_oAnimations.m_dSlideWidth = m_oMetric.m_lMillimetresHor;
m_oAnimations.m_dSlideHeight = m_oMetric.m_lMillimetresVer;
animations = m_oAnimations.ToXml(m_dStartTime, m_dEndTime);
// std::wstring animations;
// if(!m_oAnimations.m_arAnimations.empty())
// {
// m_oAnimations.m_dSlideWidth = m_oMetric.m_lMillimetresHor;
// m_oAnimations.m_dSlideHeight = m_oMetric.m_lMillimetresVer;
// animations = m_oAnimations.ToXml(m_dStartTime, m_dEndTime);
element += animations;
}
// element += animations;
// }
CString timeLine;
timeLine.Format ( L"<timeline type = \"1\" begin=\"%f\" end=\"%f\" fadein=\"0\" fadeout=\"0\" completeness=\"1.0\"/> ", m_dStartTime, m_dEndTime );
// std::wstring timeLine;
// timeLine.Format ( L"<timeline type = \"1\" begin=\"%f\" end=\"%f\" fadein=\"0\" fadeout=\"0\" completeness=\"1.0\"/> ", m_dStartTime, m_dEndTime );
element += timeLine;
element += L"</VideoStream>";
// element += timeLine;
// element += L"</VideoStream>";
return element;
}
// return element;
// }
inline CString GetAudioStream ()
{
CString element;
element.Format(L"<AudioSource StartTime='%lf' Duration='%lf' Amplify='%lf' loop='%d' >", m_dStartTime, m_dEndTime - m_dStartTime, 100.0, m_bLoop);
// inline std::wstring GetAudioStream ()
// {
// std::wstring element;
// element.Format(L"<AudioSource StartTime='%lf' Duration='%lf' Amplify='%lf' loop='%d' >", m_dStartTime, m_dEndTime - m_dStartTime, 100.0, m_bLoop);
int lIndex = m_strVideoFileName.find(L"file:///");
if (0 == lIndex)
{
m_strVideoFileName = m_strVideoFileName.substr(8);
//m_strFileName.Replace('/', '\\');
//m_strFileName.Replace(L"%20", L" ");
}
// int lIndex = m_strVideoFileName.find(L"file:///");
// if (0 == lIndex)
// {
// m_strVideoFileName = m_strVideoFileName.substr(8);
// //m_strFileName.Replace('/', '\\');
// //m_strFileName.Replace(L"%20", L" ");
// }
std::wstring strFileName = m_strVideoFileName;
CorrectXmlString(strFileName);
// std::wstring strFileName = m_strVideoFileName;
// CorrectXmlString(strFileName);
CString source;
source.Format(L"<Source StartTime='%lf' EndTime='%lf' FilePath='%ls'/>", m_dClipStartTime, m_dClipEndTime, strFileName);
element += source;
// std::wstring source;
// source.Format(L"<Source StartTime='%lf' EndTime='%lf' FilePath='%ls'/>", m_dClipStartTime, m_dClipEndTime, strFileName);
// element += source;
CString animations;
if(!m_oAnimations.m_arAnimations.empty()) // для audio только "media call's" - play - pause - stop
{
m_oAnimations.m_dSlideWidth = m_oMetric.m_lMillimetresHor;
m_oAnimations.m_dSlideHeight = m_oMetric.m_lMillimetresVer;
animations = m_oAnimations.ToXml(m_dStartTime, m_dEndTime);
// std::wstring animations;
// if(!m_oAnimations.m_arAnimations.empty()) // для audio только "media call's" - play - pause - stop
// {
// m_oAnimations.m_dSlideWidth = m_oMetric.m_lMillimetresHor;
// m_oAnimations.m_dSlideHeight = m_oMetric.m_lMillimetresVer;
// animations = m_oAnimations.ToXml(m_dStartTime, m_dEndTime);
element += animations;
}
// element += animations;
// }
CString timeLine;
timeLine.Format ( L"<timeline type = \"1\" begin=\"%f\" end=\"%f\" fadein=\"0\" fadeout=\"0\" completeness=\"1.0\"/> ", m_dStartTime, m_dEndTime );
// std::wstring timeLine;
// timeLine.Format ( L"<timeline type = \"1\" begin=\"%f\" end=\"%f\" fadein=\"0\" fadeout=\"0\" completeness=\"1.0\"/> ", m_dStartTime, m_dEndTime );
element += timeLine;
element += L"</AudioSource>";
// element += timeLine;
// element += L"</AudioSource>";
return element;
}
// return element;
// }
};
}
@ -1311,23 +1312,11 @@ namespace NSStrings
{
WriteString(oTemp.m_pData, oTemp.m_lSizeCur);
}
#if defined(_WIN32) || defined (_WIN64)
AVSINLINE void operator+=(_bstr_t& oTemp)
AVSINLINE void operator+=(std::wstring& oTemp)
{
size_t nLen = oTemp.length();
WriteString(oTemp.GetBSTR(), nLen);
}
#endif
AVSINLINE void operator+=(CString& oTemp)
{
size_t nLen = (size_t)oTemp.GetLength();
size_t nLen = (size_t)oTemp.length();
#ifdef _UNICODE
WriteString(oTemp.GetBuffer(), nLen);
#else
CStringW str = (CStringW)oTemp;
WriteString(str.GetBuffer(), nLen);
#endif
WriteString(oTemp.c_str(), nLen);
}
AVSINLINE wchar_t operator[](const size_t& nIndex)
{
@ -1429,9 +1418,9 @@ namespace NSStrings
return (size_t)(s - pData);
}
AVSINLINE CString GetCString()
AVSINLINE std::wstring GetCString()
{
CString str(m_pData, (int)m_lSizeCur);
std::wstring str(m_pData, (int)m_lSizeCur);
return str;
}
AVSINLINE wchar_t* GetBuffer()
@ -1451,24 +1440,10 @@ namespace NSStrings
}
public:
#if defined(_WIN32) || defined (_WIN64)
AVSINLINE void WriteString(_bstr_t& bsString)
AVSINLINE void WriteString(std::wstring& sString)
{
size_t nLen = bsString.length();
CTextItem::WriteString(bsString.GetBSTR(), nLen);
}
#endif
AVSINLINE void WriteString(CString& sString)
{
size_t nLen = (size_t)sString.GetLength();
#ifdef _UNICODE
CTextItem::WriteString(sString.GetBuffer(), nLen);
#else
CStringW str = (CStringW)sString;
WriteString(str.GetBuffer(), nLen);
#endif
size_t nLen = (size_t)sString.length();
CTextItem::WriteString(sString.c_str(), nLen);
}
AVSINLINE void WriteString(wchar_t* pString, const size_t& nLen)
{

View File

@ -222,36 +222,36 @@ namespace NSPresentationEditor
return NSPresentationEditor::CColor();
}
static void CheckPlaceholderStyle(CString strStyleName, LONG& lType, LONG& lLevel, LONG& lTypeStyle)
static void CheckPlaceholderStyle(std::wstring strStyleName, LONG& lType, LONG& lLevel, LONG& lTypeStyle)
{
int nLen = strStyleName.GetLength();
TCHAR* pData = strStyleName.GetBuffer();
int nLen = strStyleName.length();
wchar_t* pData = (wchar_t*)strStyleName.c_str();
lType = 0;
lLevel = 0;
lTypeStyle = -1;
TCHAR* pDataEnd = pData + nLen;
TCHAR* pDataMem = pData + 1;
wchar_t* pDataEnd = pData + nLen;
wchar_t* pDataMem = pData + 1;
for (; ((pDataMem < pDataEnd) && XmlUtils::IsDigit(*pDataMem)); ++pDataMem)
{
lType *= 10;
lType += (*pDataMem - ((TCHAR)'0'));
lType += (*pDataMem - ((wchar_t)'0'));
}
pDataMem += 4;
for (; ((pDataMem < pDataEnd) && XmlUtils::IsDigit(*pDataMem)); ++pDataMem)
{
lLevel *= 10;
lLevel += (*pDataMem - ((TCHAR)'0'));
lLevel += (*pDataMem - ((wchar_t)'0'));
}
++pDataMem;
if (pDataMem + 1 < pDataEnd)
{
if ((TCHAR('c') == pDataMem[0]) && (TCHAR('f') == pDataMem[1]))
if ((wchar_t('c') == pDataMem[0]) && (wchar_t('f') == pDataMem[1]))
lTypeStyle = 1;
if ((TCHAR('p') == pDataMem[0]) && (TCHAR('f') == pDataMem[1]))
if ((wchar_t('p') == pDataMem[0]) && (wchar_t('f') == pDataMem[1]))
lTypeStyle = 0;
}
}

View File

@ -37,248 +37,213 @@
namespace NSPresentationEditor
{
const double c_dMasterUnitsToInchKoef = 1.0 / 576;
const double c_dInchToMillimetreKoef = 25.4;
const double c_dMasterUnitsToMillimetreKoef = c_dMasterUnitsToInchKoef * c_dInchToMillimetreKoef;
const double c_dMasterUnitsToInchKoef = 1.0 / 576;
const double c_dInchToMillimetreKoef = 25.4;
const double c_dMasterUnitsToMillimetreKoef = c_dMasterUnitsToInchKoef * c_dInchToMillimetreKoef;
class CMetricInfo
{
public:
DWORD m_lUnitsHor;
DWORD m_lUnitsVer;
class CMetricInfo
{
public:
DWORD m_lUnitsHor;
DWORD m_lUnitsVer;
DWORD m_lMillimetresHor;
DWORD m_lMillimetresVer;
DWORD m_lMillimetresHor;
DWORD m_lMillimetresVer;
public:
CMetricInfo()
{
m_lUnitsHor = 5000;
m_lUnitsVer = 5000;
public:
CMetricInfo()
{
m_lUnitsHor = 5000;
m_lUnitsVer = 5000;
m_lMillimetresHor = 5000;
m_lMillimetresVer = 5000;
}
m_lMillimetresHor = 5000;
m_lMillimetresVer = 5000;
}
CMetricInfo& operator =(const CMetricInfo& oSrc)
{
m_lUnitsHor = oSrc.m_lUnitsHor;
m_lUnitsVer = oSrc.m_lUnitsVer;
m_lMillimetresHor = oSrc.m_lMillimetresHor;
m_lMillimetresVer = oSrc.m_lMillimetresVer;
CMetricInfo& operator =(const CMetricInfo& oSrc)
{
m_lUnitsHor = oSrc.m_lUnitsHor;
m_lUnitsVer = oSrc.m_lUnitsVer;
m_lMillimetresHor = oSrc.m_lMillimetresHor;
m_lMillimetresVer = oSrc.m_lMillimetresVer;
return *this;
}
return *this;
}
void SetUnitsContainerSize(DWORD lSizeX, DWORD lSizeY)
{
m_lUnitsHor = lSizeX;
m_lUnitsVer = lSizeY;
void SetUnitsContainerSize(DWORD lSizeX, DWORD lSizeY)
{
m_lUnitsHor = lSizeX;
m_lUnitsVer = lSizeY;
m_lMillimetresHor = (DWORD)(m_lUnitsHor * c_dMasterUnitsToMillimetreKoef);
m_lMillimetresVer = (DWORD)(m_lUnitsVer * c_dMasterUnitsToMillimetreKoef);
}
};
m_lMillimetresHor = (DWORD)(m_lUnitsHor * c_dMasterUnitsToMillimetreKoef);
m_lMillimetresVer = (DWORD)(m_lUnitsVer * c_dMasterUnitsToMillimetreKoef);
}
};
class CDoubleRect
{
public:
double left;
double top;
double right;
double bottom;
class CDoubleRect
{
public:
double left;
double top;
double right;
double bottom;
public:
CDoubleRect()
{
left = 0;
top = 0;
right = 0;
bottom = 0;
}
CDoubleRect& operator=(const CDoubleRect& oSrc)
{
left = oSrc.left;
top = oSrc.top;
right = oSrc.right;
bottom = oSrc.bottom;
public:
CDoubleRect()
{
left = 0;
top = 0;
right = 0;
bottom = 0;
}
CDoubleRect& operator=(const CDoubleRect& oSrc)
{
left = oSrc.left;
top = oSrc.top;
right = oSrc.right;
bottom = oSrc.bottom;
return *this;
}
CDoubleRect(const CDoubleRect& oSrc)
{
*this = oSrc;
}
inline bool IsEqual(const CDoubleRect& oSrc, double dEps = 0.01)
{
return ((fabs(left - oSrc.left) < dEps) && (fabs(top - oSrc.top) < dEps) &&
(fabs(right - oSrc.right) < dEps) && (fabs(bottom - oSrc.bottom) < dEps));
}
return *this;
}
CDoubleRect(const CDoubleRect& oSrc)
{
*this = oSrc;
}
inline bool IsEqual(const CDoubleRect& oSrc, double dEps = 0.01)
{
return ((fabs(left - oSrc.left) < dEps) && (fabs(top - oSrc.top) < dEps) &&
(fabs(right - oSrc.right) < dEps) && (fabs(bottom - oSrc.bottom) < dEps));
}
inline double GetWidth() const
{
return right - left;
}
inline double GetHeight() const
{
return bottom - top;
}
inline void Scale(const double& dKoef)
{
left *= dKoef;
top *= dKoef;
right *= dKoef;
bottom *= dKoef;
}
};
inline double GetWidth() const
{
return right - left;
}
inline double GetHeight() const
{
return bottom - top;
}
inline void Scale(const double& dKoef)
{
left *= dKoef;
top *= dKoef;
right *= dKoef;
bottom *= dKoef;
}
};
//class CRectF
//{
//public:
// float X;
// float Y;
// float Width;
// float Height;
class CGeomShapeInfo
{
public:
class CPointD
{
public:
double dX;
double dY;
public:
CPointD()
{
dX = 0;
dY = 0;
}
//public:
// CRectF()
// {
// X = 0;
// Y = 0;
// Width = 0;
// Height = 0;
// }
// CRectF(const CRectF& oSrc)
// {
// *this = oSrc;
// }
// CRectF& operator=(const CRectF& oSrc)
// {
// X = oSrc.X;
// Y = oSrc.Y;
// Width = oSrc.Width;
// Height = oSrc.Height;
CPointD& operator= (const CPointD& oSrc)
{
dX = oSrc.dX;
dY = oSrc.dY;
// return *this;
// }
// bool Equals(const CRect& oSrc)
// {
// return ((X == oSrc.X) && (Y == oSrc.Y) && (Width == oSrc.Width) && (Height == oSrc.Height));
// }
//};
return *this;
}
class CGeomShapeInfo
{
public:
class CPointD
{
public:
double dX;
double dY;
public:
CPointD()
{
dX = 0;
dY = 0;
}
CPointD(const CPointD& oSrc)
{
*this = oSrc;
}
};
CPointD& operator= (const CPointD& oSrc)
{
dX = oSrc.dX;
dY = oSrc.dY;
public:
double m_dLeft;
double m_dTop;
double m_dWidth;
double m_dHeight;
return *this;
}
double m_dLimoX;
double m_dLimoY;
CPointD(const CPointD& oSrc)
{
*this = oSrc;
}
};
// нужен для регулировки по аспекту (limo)
CPointD m_oCurPoint;
public:
double m_dLeft;
double m_dTop;
double m_dWidth;
double m_dHeight;
double m_dRotate;
bool m_bFlipH;
bool m_bFlipV;
double m_dLimoX;
double m_dLimoY;
LONG m_lOriginalWidth;
LONG m_lOriginalHeight;
// нужен для регулировки по аспекту (limo)
CPointD m_oCurPoint;
public:
CGeomShapeInfo()
{
m_dLeft = 0;
m_dTop = 0;
m_dWidth = 720;
m_dHeight = 576;
double m_dRotate;
bool m_bFlipH;
bool m_bFlipV;
m_dLimoX = 0;
m_dLimoY = 0;
LONG m_lOriginalWidth;
LONG m_lOriginalHeight;
m_oCurPoint.dX = 0;
m_oCurPoint.dY = 0;
public:
CGeomShapeInfo()
{
m_dLeft = 0;
m_dTop = 0;
m_dWidth = 720;
m_dHeight = 576;
m_dLimoX = 0;
m_dLimoY = 0;
m_dRotate = 0.0;
m_bFlipH = false;
m_bFlipV = false;
m_oCurPoint.dX = 0;
m_oCurPoint.dY = 0;
m_lOriginalWidth = 0;
m_lOriginalHeight = 0;
}
~CGeomShapeInfo()
{
}
m_dRotate = 0.0;
m_bFlipH = false;
m_bFlipV = false;
CGeomShapeInfo& operator =(const CGeomShapeInfo& oSrc)
{
m_dLeft = oSrc.m_dLeft;
m_dTop = oSrc.m_dTop;
m_dWidth = oSrc.m_dWidth;
m_dHeight = oSrc.m_dHeight;
m_lOriginalWidth = 0;
m_lOriginalHeight = 0;
}
~CGeomShapeInfo()
{
}
m_dLimoX = oSrc.m_dLimoX;
m_dLimoY = oSrc.m_dLimoY;
CGeomShapeInfo& operator =(const CGeomShapeInfo& oSrc)
{
m_dLeft = oSrc.m_dLeft;
m_dTop = oSrc.m_dTop;
m_dWidth = oSrc.m_dWidth;
m_dHeight = oSrc.m_dHeight;
m_dLimoX = oSrc.m_dLimoX;
m_dLimoY = oSrc.m_dLimoY;
m_oCurPoint = oSrc.m_oCurPoint;
m_oCurPoint = oSrc.m_oCurPoint;
m_dRotate = oSrc.m_dRotate;
m_bFlipH = oSrc.m_bFlipH;
m_bFlipV = oSrc.m_bFlipV;
m_dRotate = oSrc.m_dRotate;
m_bFlipH = oSrc.m_bFlipH;
m_bFlipV = oSrc.m_bFlipV;
m_lOriginalWidth = oSrc.m_lOriginalWidth;
m_lOriginalHeight = oSrc.m_lOriginalHeight;
m_lOriginalWidth = oSrc.m_lOriginalWidth;
m_lOriginalHeight = oSrc.m_lOriginalHeight;
return (*this);
}
return (*this);
}
inline void SetBounds(const CDoubleRect& oRect)
{
m_dLeft = oRect.left;
m_dTop = oRect.top;
m_dWidth = oRect.GetWidth();
m_dHeight = oRect.GetHeight();
}
inline void SetBounds(const CDoubleRect& oRect)
{
m_dLeft = oRect.left;
m_dTop = oRect.top;
m_dWidth = oRect.GetWidth();
m_dHeight = oRect.GetHeight();
}
inline LONG GetFlags()
{
LONG lFlags = 0;
if (m_bFlipH)
lFlags |= 0x0001;
if (m_bFlipV)
lFlags |= 0x0002;
inline LONG GetFlags()
{
LONG lFlags = 0;
if (m_bFlipH)
lFlags |= 0x0001;
if (m_bFlipV)
lFlags |= 0x0002;
return lFlags;
}
};
return lFlags;
}
};
}

View File

@ -32,185 +32,180 @@
#pragma once
#include "Path.h"
#include "../../../Common/DocxFormat/Source/Common/SimpleTypes_Base.h"
namespace NSPresentationEditor
{
using namespace NSBaseShape;
class CHandle_
{
public:
CString position;
CString xrange;
CString yrange;
CString switchHandle;
CString polar;
CString radiusrange;
using namespace NSBaseShape;
class CHandle_
{
public:
std::wstring position;
std::wstring xrange;
std::wstring yrange;
std::wstring switchHandle;
std::wstring polar;
std::wstring radiusrange;
public:
CHandle_()
{
position = _T("");
xrange = _T("");
yrange = _T("");
switchHandle = _T("");
polar = _T("");
radiusrange = _T("");
}
CHandle_& operator =(const CHandle_& oSrc)
{
position = oSrc.position;
xrange = oSrc.xrange;
yrange = oSrc.yrange;
switchHandle = oSrc.switchHandle;
polar = oSrc.polar;
radiusrange = oSrc.radiusrange;
return (*this);
}
};
//
class CBaseShape
{
public:
std::vector<long> m_arAdjustments;
std::vector<double> m_arGuides;
LONG m_eJoin;
bool m_bConcentricFill;
bool m_bCustomShape;
public:
CHandle_()
{
}
CHandle_& operator =(const CHandle_& oSrc)
{
position = oSrc.position;
xrange = oSrc.xrange;
yrange = oSrc.yrange;
switchHandle = oSrc.switchHandle;
polar = oSrc.polar;
radiusrange = oSrc.radiusrange;
return (*this);
}
};
//
class CBaseShape
{
public:
std::vector<long> m_arAdjustments;
std::vector<double> m_arGuides;
LONG m_eJoin;
bool m_bConcentricFill;
bool m_bCustomShape;
std::vector<SimpleTypes::CPoint> m_arConnectors;
std::vector<LONG> m_arConnectorAngles;
std::vector<LONG> m_arConnectorAngles;
std::vector<Aggplus::RECT> m_arTextRects;
std::vector<CHandle_> m_arHandles;
std::vector<Aggplus::RECT> m_arTextRects;
CString m_strTransformXml;
std::vector<CHandle_> m_arHandles;
CString m_strPath;
CString m_strRect;
std::wstring m_strTransformXml;
LONG m_lLimoX;
LONG m_lLimoY;
CPath m_oPath;
std::wstring m_strPath;
std::wstring m_strRect;
CBaseShape()
{
m_bCustomShape = false;
}
LONG m_lLimoX;
LONG m_lLimoY;
virtual bool LoadFromXML(const CString& xml) = 0;
virtual bool LoadFromXML(XmlUtils::CXmlNode& xmlNode) = 0;
virtual bool LoadAdjustValuesList(const CString& xml) = 0;
virtual bool LoadGuidesList(const CString& xml) = 0;
virtual bool LoadAdjustHandlesList(const CString& xml) = 0;
virtual bool LoadConnectorsList(const CString& xml) = 0;
virtual bool LoadTextRect(const CString& xml) = 0;
virtual bool LoadPathList(const CString& xml) = 0;
virtual bool SetAdjustment(long index, long value) = 0;
virtual void ReCalculate() = 0;
CPath m_oPath;
virtual CString ToXML(CGeomShapeInfo& GeomInfo, CMetricInfo& MetricInfo, double StartTime, double EndTime, CBrush& Brush, CPen& Pen) = 0;
virtual void ToRenderer(IRenderer* pRenderer, CGeomShapeInfo& pGeomInfo, double dStartTime, double dEndTime, CPen& pPen, CBrush& pFore, CMetricInfo& pInfo)
{
m_oPath.ToRenderer(pRenderer, pGeomInfo, dStartTime, dEndTime, pPen, pFore, pInfo, GetClassType());
}
CBaseShape()
{
m_bCustomShape = false;
}
virtual void SetWidthHeightLogic(const double& dWidth, const double& dHeight)
{
// none
}
virtual void GetWidthHeightLogic(double& dWidth, double& dHeight)
{
// none
}
virtual bool LoadFromXML(const std::wstring& xml) = 0;
virtual bool LoadFromXML(XmlUtils::CXmlNode& xmlNode) = 0;
virtual bool LoadAdjustValuesList(const std::wstring& xml) = 0;
virtual bool LoadGuidesList(const std::wstring& xml) = 0;
virtual bool LoadAdjustHandlesList(const std::wstring& xml) = 0;
virtual bool LoadConnectorsList(const std::wstring& xml) = 0;
virtual bool LoadTextRect(const std::wstring& xml) = 0;
virtual bool LoadPathList(const std::wstring& xml) = 0;
virtual bool SetAdjustment(long index, long value) = 0;
virtual void ReCalculate() = 0;
virtual void AddGuide(const CString& strGuide) {}
virtual std::wstring ToXML(CGeomShapeInfo& GeomInfo, CMetricInfo& MetricInfo, double StartTime, double EndTime, CBrush& Brush, CPen& Pen) = 0;
virtual void ToRenderer(IRenderer* pRenderer, CGeomShapeInfo& pGeomInfo, double dStartTime, double dEndTime, CPen& pPen, CBrush& pFore, CMetricInfo& pInfo)
{
m_oPath.ToRenderer(pRenderer, pGeomInfo, dStartTime, dEndTime, pPen, pFore, pInfo, GetClassType());
}
static CBaseShape* CreateByType(ClassType ClassType, int ShapeType);
virtual const ClassType GetClassType()const = 0;
bool SetType(ClassType ClassType, int ShapeType);
virtual void SetWidthHeightLogic(const double& dWidth, const double& dHeight)
{
// none
}
virtual void GetWidthHeightLogic(double& dWidth, double& dHeight)
{
// none
}
virtual bool SetProperties(CBaseShape* Shape)
{
if( Shape == NULL)
return false;
virtual void AddGuide(const std::wstring& strGuide) {}
m_oPath = Shape->m_oPath;
m_strPath = Shape->m_strPath;
m_strRect = Shape->m_strRect;
m_arAdjustments.clear();
for(int i = 0; i < Shape->m_arAdjustments.size(); i++)
m_arAdjustments.push_back(Shape->m_arAdjustments[i]);
static CBaseShape* CreateByType(ClassType ClassType, int ShapeType);
m_arGuides.clear();
for(int i = 0; i < Shape->m_arGuides.size(); i++)
m_arGuides.push_back(Shape->m_arGuides[i]);
virtual const ClassType GetClassType()const = 0;
bool SetType(ClassType ClassType, int ShapeType);
m_eJoin = Shape->m_eJoin;
m_bConcentricFill = Shape->m_bConcentricFill;
virtual bool SetProperties(CBaseShape* Shape)
{
if( Shape == NULL)
return false;
m_arConnectors.clear();
for(int i = 0; i < Shape->m_arConnectors.size(); i++)
m_arConnectors.push_back(Shape->m_arConnectors[i]);
m_oPath = Shape->m_oPath;
m_strPath = Shape->m_strPath;
m_strRect = Shape->m_strRect;
m_arConnectorAngles.clear();
for(int i = 0; i < Shape->m_arConnectorAngles.size(); i++)
m_arConnectorAngles.push_back(Shape->m_arConnectorAngles[i]);
m_arAdjustments.clear();
for(int i = 0; i < Shape->m_arAdjustments.size(); i++)
m_arAdjustments.push_back(Shape->m_arAdjustments[i]);
m_arTextRects.clear();
for(int i = 0; i < Shape->m_arTextRects.size(); i++)
m_arTextRects.push_back(Shape->m_arTextRects[i]);
m_arGuides.clear();
for(int i = 0; i < Shape->m_arGuides.size(); i++)
m_arGuides.push_back(Shape->m_arGuides[i]);
m_arHandles.clear();
for(int i = 0; i < Shape->m_arHandles.size(); i++)
m_arHandles.push_back(Shape->m_arHandles[i]);
m_eJoin = Shape->m_eJoin;
m_bConcentricFill = Shape->m_bConcentricFill;
m_arConnectors.clear();
for(int i = 0; i < Shape->m_arConnectors.size(); i++)
m_arConnectors.push_back(Shape->m_arConnectors[i]);
m_arConnectorAngles.clear();
for(int i = 0; i < Shape->m_arConnectorAngles.size(); i++)
m_arConnectorAngles.push_back(Shape->m_arConnectorAngles[i]);
m_arTextRects.clear();
for(int i = 0; i < Shape->m_arTextRects.size(); i++)
m_arTextRects.push_back(Shape->m_arTextRects[i]);
m_arHandles.clear();
for(int i = 0; i < Shape->m_arHandles.size(); i++)
m_arHandles.push_back(Shape->m_arHandles[i]);
m_strRect = Shape->m_strRect;
m_strTransformXml = Shape->m_strTransformXml;
return true;
}
m_strRect = Shape->m_strRect;
m_strTransformXml = Shape->m_strTransformXml;
return true;
}
virtual bool SetToDublicate(CBaseShape* Shape)
{
if( Shape == NULL)
return false;
virtual bool SetToDublicate(CBaseShape* Shape)
{
if( Shape == NULL)
return false;
Shape->m_oPath = m_oPath;
Shape->m_strPath = m_strPath;
Shape->m_strRect = m_strRect;
Shape->m_arAdjustments.clear();
for(int i = 0; i < m_arAdjustments.size(); i++)
Shape->m_arAdjustments.push_back(m_arAdjustments[i]);
Shape->m_oPath = m_oPath;
Shape->m_strPath = m_strPath;
Shape->m_strRect = m_strRect;
Shape->m_arGuides.clear();
for(int i = 0; i < m_arGuides.size(); i++)
Shape->m_arGuides.push_back(m_arGuides[i]);
Shape->m_arAdjustments.clear();
for(int i = 0; i < m_arAdjustments.size(); i++)
Shape->m_arAdjustments.push_back(m_arAdjustments[i]);
Shape->m_eJoin = m_eJoin;
Shape->m_bConcentricFill = m_bConcentricFill;
Shape->m_arGuides.clear();
for(int i = 0; i < m_arGuides.size(); i++)
Shape->m_arGuides.push_back(m_arGuides[i]);
Shape->m_arConnectors.clear();
for(int i = 0; i < m_arConnectors.size(); i++)
Shape->m_arConnectors.push_back(m_arConnectors[i]);
Shape->m_eJoin = m_eJoin;
Shape->m_bConcentricFill = m_bConcentricFill;
Shape->m_arConnectorAngles.clear();
for(int i = 0; i < m_arConnectorAngles.size(); i++)
Shape->m_arConnectorAngles.push_back(m_arConnectorAngles[i]);
Shape->m_arConnectors.clear();
for(int i = 0; i < m_arConnectors.size(); i++)
Shape->m_arConnectors.push_back(m_arConnectors[i]);
Shape->m_arTextRects.clear();
for(int i = 0; i < m_arTextRects.size(); i++)
Shape->m_arTextRects.push_back(m_arTextRects[i]);
Shape->m_strRect = m_strRect;
Shape->m_arConnectorAngles.clear();
for(int i = 0; i < m_arConnectorAngles.size(); i++)
Shape->m_arConnectorAngles.push_back(m_arConnectorAngles[i]);
Shape->m_arHandles.clear();
for(int i = 0; i < m_arHandles.size(); i++)
Shape->m_arHandles.push_back(m_arHandles[i]);
Shape->m_arTextRects.clear();
for(int i = 0; i < m_arTextRects.size(); i++)
Shape->m_arTextRects.push_back(m_arTextRects[i]);
Shape->m_strRect = m_strRect;
Shape->m_strTransformXml = m_strTransformXml;
return true;
}
};
Shape->m_arHandles.clear();
for(int i = 0; i < m_arHandles.size(); i++)
Shape->m_arHandles.push_back(m_arHandles[i]);
Shape->m_strTransformXml = m_strTransformXml;
return true;
}
};
}

View File

@ -34,7 +34,6 @@
#include <algorithm>
#include <vector>
#include "../../../../../Common/DocxFormat/Source/Base/ASCString.h"
#include "../../../../../Common/DocxFormat/Source/Base/Base.h"
#include "../../../../../DesktopEditor/graphics/GraphicsPath.h"
@ -53,371 +52,362 @@ const double RadKoef = M_PI/10800000.0;
namespace NSMath
{
inline LONG round(double dVal)
{
return (LONG)(2 * dVal) - (LONG)(dVal);
}
inline LONG round(double dVal)
{
return (LONG)(2 * dVal) - (LONG)(dVal);
}
}
namespace NSStringUtils
{
#define IS_ALPHA(c) (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')))
#define IS_DIGIT(c) (((c >= '0') && (c <= '9')) || (c == '-'))
#define IS_ALPHA(c) (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')))
#define IS_DIGIT(c) (((c >= '0') && (c <= '9')) || (c == '-'))
static bool IsDigit(const TCHAR& c)
{
return (((c >= '0') && (c <= '9')) || (c == '-'));
}
static bool IsAlpha(const TCHAR& c)
{
return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')));
}
static bool IsNumber(CString str)
{
for (int nIndex = 0; nIndex < str.GetLength(); ++nIndex)
{
if (!IsDigit(str[nIndex]))
{
return false;
}
}
return true;
}
static CString ToString(LONG val)
{
CString str = _T("");
str.Format(_T("%d"), val);
return str;
}
static void ParseString(CString strDelimeters, CString strSource,
std::vector<CString>* pArrayResults, bool bIsCleared = true)
{
if (NULL == pArrayResults)
return;
if (bIsCleared)
pArrayResults->clear();
CString resToken;
int curPos= 0;
resToken = strSource.Tokenize(strDelimeters, curPos);
while (resToken != _T(""))
{
pArrayResults->push_back(resToken);
resToken = strSource.Tokenize(strDelimeters, curPos);
};
}
static void ParseString(std::vector<char>* pArrayDelimeters, CString strSource,
std::vector<CString>* pArrayResults, bool bIsCleared = true)
{
if (NULL == pArrayDelimeters)
return;
CString strDelimeters = _T("");
for (int nIndex = 0; nIndex < pArrayDelimeters->size(); ++nIndex)
strDelimeters += (*pArrayDelimeters)[nIndex];
return ParseString(strDelimeters, strSource, pArrayResults, bIsCleared);
}
static void ParsePath(CString strSource, std::vector<CString>* pArrayResults, bool bIsCleared = true)
{
if (NULL == pArrayResults)
return;
CString strPath = strSource;
//strPath.Replace(_T(" "), _T(","));
for (int nIndex = 0; nIndex < strPath.GetLength(); ++nIndex)
{
if (nIndex == (strPath.GetLength() - 1))
continue;
if (IsAlpha(strPath[nIndex]) && (',' == strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, ',');
++nIndex;
strPath.Insert(nIndex + 1, '0');
++nIndex;
}
else if ((',' == strPath[nIndex]) && (',' == strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, '0');
++nIndex;
}
else if ((',' == strPath[nIndex]) && IsAlpha(strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, '0');
++nIndex;
strPath.Insert(nIndex + 1, ',');
++nIndex;
}
else if (IsAlpha(strPath[nIndex]) && IsDigit(strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, ',');
++nIndex;
}
else if (IsDigit(strPath[nIndex]) && IsAlpha(strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, ',');
++nIndex;
}
else if (IsDigit(strPath[nIndex]) && ('@' == strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, ',');
++nIndex;
}
else if (IsDigit(strPath[nIndex]) && ('#' == strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, ',');
++nIndex;
}
else if (IsAlpha(strPath[nIndex]) && ('@' == strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, ',');
++nIndex;
}
else if (IsAlpha(strPath[nIndex]) && ('#' == strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, ',');
++nIndex;
}
else if (IsDigit(strPath[nIndex]) && ('$' == strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, ',');
++nIndex;
}
else if (IsDigit(strPath[nIndex]) && ('?' == strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, ',');
++nIndex;
}
else if (IsAlpha(strPath[nIndex]) && ('$' == strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, ',');
++nIndex;
}
else if (IsAlpha(strPath[nIndex]) && ('?' == strPath[nIndex + 1]))
{
strPath.Insert(nIndex + 1, ',');
++nIndex;
}
else if ((IsAlpha(strPath[nIndex]) && IsAlpha(strPath[nIndex + 1])) && ('x' == strPath[nIndex]))
{
strPath.Insert(nIndex + 1, ',');
++nIndex;
}
}
ParseString(_T(","), strPath, pArrayResults, bIsCleared);
return;
}
static void ParsePath2(CString strSource, std::vector<CString>* pArrayResults, bool bIsCleared = true)
static bool IsDigit(const TCHAR& c)
{
if (NULL == pArrayResults)
return;
CString strPath = strSource;
int nLength = strPath.GetLength();
return (((c >= '0') && (c <= '9')) || (c == '-'));
}
static bool IsAlpha(const TCHAR& c)
{
return (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')));
}
static bool IsNumber(std::wstring str)
{
for (int nIndex = 0; nIndex < str.length(); ++nIndex)
{
if (!IsDigit(str[nIndex]))
{
return false;
}
}
return true;
}
static std::wstring ToString(LONG val)
{
return std::to_wstring(val);
}
// static void ParseString(std::wstring strDelimeters, std::wstring strSource,
// std::vector<std::wstring>* pArrayResults, bool bIsCleared = true)
// {
// if (NULL == pArrayResults)
// return;
// if (bIsCleared)
// ArrayResults.clear();
// std::wstring resToken;
// int curPos= 0;
// resToken = strSource.Tokenize(strDelimeters, curPos);
// while (resToken != _T(""))
// {
// ArrayResults.push_back(resToken);
// resToken = strSource.Tokenize(strDelimeters, curPos);
// };
// }
// static void ParseString(std::vector<char>* pArrayDelimeters, std::wstring strSource,
// std::vector<std::wstring>* pArrayResults, bool bIsCleared = true)
// {
// if (NULL == pArrayDelimeters)
// return;
// std::wstring strDelimeters = _T("");
// for (int nIndex = 0; nIndex < pArrayDelimeters->size(); ++nIndex)
// strDelimeters += (*pArrayDelimeters)[nIndex];
// return ParseString(strDelimeters, strSource, pArrayResults, bIsCleared);
// }
static void ParsePath(std::wstring strSource, std::vector<std::wstring>& ArrayResults)
{
std::wstring strPath = strSource;
for (int nIndex = 0; nIndex < strPath.length(); ++nIndex)
{
if (nIndex == (strPath.length() - 1))
continue;
if (IsAlpha(strPath[nIndex]) && (',' == strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
strPath.insert(strPath.begin() + nIndex + 1, '0');
++nIndex;
}
else if ((',' == strPath[nIndex]) && (',' == strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, '0');
++nIndex;
}
else if ((',' == strPath[nIndex]) && IsAlpha(strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, '0');
++nIndex;
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
}
else if (IsAlpha(strPath[nIndex]) && IsDigit(strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
}
else if (IsDigit(strPath[nIndex]) && IsAlpha(strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
}
else if (IsDigit(strPath[nIndex]) && ('@' == strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
}
else if (IsDigit(strPath[nIndex]) && ('#' == strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
}
else if (IsAlpha(strPath[nIndex]) && ('@' == strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
}
else if (IsAlpha(strPath[nIndex]) && ('#' == strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
}
else if (IsDigit(strPath[nIndex]) && ('$' == strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
}
else if (IsDigit(strPath[nIndex]) && ('?' == strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
}
else if (IsAlpha(strPath[nIndex]) && ('$' == strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
}
else if (IsAlpha(strPath[nIndex]) && ('?' == strPath[nIndex + 1]))
{
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
}
else if ((IsAlpha(strPath[nIndex]) && IsAlpha(strPath[nIndex + 1])) && ('x' == strPath[nIndex]))
{
strPath.insert(strPath.begin() + nIndex + 1, ',');
++nIndex;
}
}
boost::algorithm::split(ArrayResults, strPath, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
return;
}
static void ParsePath2(std::wstring strSource, std::vector<std::wstring> & ArrayResults)
{
std::wstring strPath = strSource;
int nLength = strPath.length();
//strPath.Replace(_T(" "), _T(","));
if (strPath.Find(TCHAR('h')) != -1)
{
TCHAR* pBuff = new TCHAR[nLength + 1];
int nCur = 0;
for (int i = 1; i < nLength; ++i)
{
TCHAR _c = strPath[i - 1];
if (_c != TCHAR('h'))
{
pBuff[nCur++] = _c;
}
else
{
TCHAR _c1 = strPath[i];
if (_c1 == TCHAR('a') ||
_c1 == TCHAR('b') ||
_c1 == TCHAR('c') ||
_c1 == TCHAR('d') ||
_c1 == TCHAR('e') ||
_c1 == TCHAR('f') ||
_c1 == TCHAR('g') ||
_c1 == TCHAR('h') ||
_c1 == TCHAR('i'))
{
++i;
}
}
}
if (strPath.find(TCHAR('h')) != -1)
{
TCHAR* pBuff = new TCHAR[nLength + 1];
int nCur = 0;
for (int i = 1; i < nLength; ++i)
{
TCHAR _c = strPath[i - 1];
if (_c != TCHAR('h'))
{
pBuff[nCur++] = _c;
}
else
{
TCHAR _c1 = strPath[i];
if (_c1 == TCHAR('a') ||
_c1 == TCHAR('b') ||
_c1 == TCHAR('c') ||
_c1 == TCHAR('d') ||
_c1 == TCHAR('e') ||
_c1 == TCHAR('f') ||
_c1 == TCHAR('g') ||
_c1 == TCHAR('h') ||
_c1 == TCHAR('i'))
{
++i;
}
}
}
if (nLength > 0)
pBuff[nCur++] = strPath[nLength - 1];
if (nLength > 0)
pBuff[nCur++] = strPath[nLength - 1];
pBuff[nCur] = 0;
pBuff[nCur] = 0;
strPath = CString(pBuff, nCur);
nLength = strPath.GetLength();
strPath = std::wstring(pBuff, nCur);
nLength = strPath.length();
if (NULL != pBuff)
{
delete []pBuff;
pBuff = NULL;
}
}
if (NULL != pBuff)
{
delete []pBuff;
pBuff = NULL;
}
}
if (nLength > 0 && strPath[nLength - 1] == TCHAR(','))
{
strPath += _T("0");
++nLength;
}
if (nLength > 0 && strPath[nLength - 1] == TCHAR(','))
{
strPath += _T("0");
++nLength;
}
int nIndexOld = 0;
for (int nIndex = 0; nIndex < nLength; ++nIndex)
{
if (nIndex == (nLength - 1))
{
pArrayResults->push_back(strPath.Mid(nIndexOld));
//continue;
}
{
ArrayResults.push_back(strPath.substr(nIndexOld));
//continue;
}
TCHAR _c = strPath[nIndex];
TCHAR _c1 = strPath[nIndex + 1];
TCHAR _c = strPath[nIndex];
TCHAR _c1 = strPath[nIndex + 1];
if (_c1 == ',')
{
if (',' == _c)
{
pArrayResults->push_back(_T("0"));
}
else if (IS_ALPHA(_c))
{
pArrayResults->push_back(strPath.Mid(nIndexOld, nIndex - nIndexOld + 1));
pArrayResults->push_back(_T("0"));
}
else if (IS_DIGIT(_c))
{
pArrayResults->push_back(strPath.Mid(nIndexOld, nIndex - nIndexOld + 1));
}
}
else if (',' == _c)
{
if (IS_ALPHA(_c1))
{
pArrayResults->push_back(_T("0"));
nIndexOld = nIndex + 1;
}
else if (IS_DIGIT(_c1))
{
nIndexOld = nIndex + 1;
}
}
else
{
bool _isA = IS_ALPHA(_c);
bool _isD = _isA ? false : IS_DIGIT(_c);
if (_c1 == ',')
{
if (',' == _c)
{
ArrayResults.push_back(_T("0"));
}
else if (IS_ALPHA(_c))
{
ArrayResults.push_back(strPath.substr(nIndexOld, nIndex - nIndexOld + 1));
ArrayResults.push_back(_T("0"));
}
else if (IS_DIGIT(_c))
{
ArrayResults.push_back(strPath.substr(nIndexOld, nIndex - nIndexOld + 1));
}
}
else if (',' == _c)
{
if (IS_ALPHA(_c1))
{
ArrayResults.push_back(_T("0"));
nIndexOld = nIndex + 1;
}
else if (IS_DIGIT(_c1))
{
nIndexOld = nIndex + 1;
}
}
else
{
bool _isA = IS_ALPHA(_c);
bool _isD = _isA ? false : IS_DIGIT(_c);
bool _isA1 = IS_ALPHA(_c1);
bool _isD1 = _isA1 ? false : IS_DIGIT(_c1);
bool _isA1 = IS_ALPHA(_c1);
bool _isD1 = _isA1 ? false : IS_DIGIT(_c1);
if (_isA && _isD1)
{
pArrayResults->push_back(strPath.Mid(nIndexOld, nIndex - nIndexOld + 1));
nIndexOld = nIndex + 1;
}
else if (_isD && _isA1)
{
pArrayResults->push_back(strPath.Mid(nIndexOld, nIndex - nIndexOld + 1));
nIndexOld = nIndex + 1;
}
else if (_isD && ('@' == _c1))
{
pArrayResults->push_back(strPath.Mid(nIndexOld, nIndex - nIndexOld + 1));
if (_isA && _isD1)
{
ArrayResults.push_back(strPath.substr(nIndexOld, nIndex - nIndexOld + 1));
nIndexOld = nIndex + 1;
}
else if (_isD && _isA1)
{
ArrayResults.push_back(strPath.substr(nIndexOld, nIndex - nIndexOld + 1));
nIndexOld = nIndex + 1;
}
else if (_isD && ('@' == _c1))
{
ArrayResults.push_back(strPath.substr(nIndexOld, nIndex - nIndexOld + 1));
++nIndex;
nIndexOld = nIndex;
}
else if (_isD && ('#' == _c1))
{
pArrayResults->push_back(strPath.Mid(nIndexOld, nIndex - nIndexOld + 1));
++nIndex;
nIndexOld = nIndex;
}
else if (_isD && ('#' == _c1))
{
ArrayResults.push_back(strPath.substr(nIndexOld, nIndex - nIndexOld + 1));
++nIndex;
nIndexOld = nIndex;
}
else if (_isA && ('@' == _c1))
{
pArrayResults->push_back(strPath.Mid(nIndexOld, nIndex - nIndexOld + 1));
++nIndex;
nIndexOld = nIndex;
}
else if (_isA && ('@' == _c1))
{
ArrayResults.push_back(strPath.substr(nIndexOld, nIndex - nIndexOld + 1));
++nIndex;
nIndexOld = nIndex;
}
else if (_isA && ('#' == _c1))
{
pArrayResults->push_back(strPath.Mid(nIndexOld, nIndex - nIndexOld + 1));
++nIndex;
nIndexOld = nIndex;
}
else if (_isA && ('#' == _c1))
{
ArrayResults.push_back(strPath.substr(nIndexOld, nIndex - nIndexOld + 1));
++nIndex;
nIndexOld = nIndex;
}
else if (('x' == _c) && _isA1)
{
pArrayResults->push_back(_T("x"));
nIndexOld = nIndex + 1;
}
}
++nIndex;
nIndexOld = nIndex;
}
else if (('x' == _c) && _isA1)
{
ArrayResults.push_back(_T("x"));
nIndexOld = nIndex + 1;
}
}
}
//ParseString(_T(","), strPath, pArrayResults, bIsCleared);
//boost::algorithm::split(ArrayResults, strPath, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
return;
}
static void CheckPathOn_Fill_Stroke(CString& strPath, bool& bFill, bool& bStroke)
{
bFill = true;
bStroke = true;
int nIndex = strPath.Find(_T("nf"));
if (-1 != nIndex)
{
bFill = false;
while (-1 != nIndex)
{
strPath.Delete(nIndex, 2);
nIndex = strPath.Find(_T("nf"));
}
}
nIndex = strPath.Find(_T("ns"));
if (-1 != nIndex)
{
bStroke = false;
while (-1 != nIndex)
{
strPath.Delete(nIndex, 2);
nIndex = strPath.Find(_T("ns"));
}
}
static void CheckPathOn_Fill_Stroke(std::wstring& strPath, bool& bFill, bool& bStroke)
{
bFill = true;
bStroke = true;
int nIndex = strPath.find(_T("nf"));
if (-1 != nIndex)
{
bFill = false;
while (-1 != nIndex)
{
strPath.erase(nIndex, 2);
nIndex = strPath.find(_T("nf"));
}
}
nIndex = strPath.find(_T("ns"));
if (-1 != nIndex)
{
bStroke = false;
while (-1 != nIndex)
{
strPath.erase(nIndex, 2);
nIndex = strPath.find(_T("ns"));
}
}
nIndex = strPath.Find(_T("F"));
if (-1 != nIndex)
{
bFill = false;
while (-1 != nIndex)
{
strPath.Delete(nIndex, 2);
nIndex = strPath.Find(_T("F"));
}
}
nIndex = strPath.find(_T("F"));
if (-1 != nIndex)
{
bFill = false;
while (-1 != nIndex)
{
strPath.erase(nIndex, 2);
nIndex = strPath.find(_T("F"));
}
}
nIndex = strPath.Find(_T("S"));
if (-1 != nIndex)
{
bStroke = false;
while (-1 != nIndex)
{
strPath.Delete(nIndex, 2);
nIndex = strPath.Find(_T("S"));
}
}
}
nIndex = strPath.find(_T("S"));
if (-1 != nIndex)
{
bStroke = false;
while (-1 != nIndex)
{
strPath.erase(nIndex, 2);
nIndex = strPath.find(_T("S"));
}
}
}
}
#ifdef AVS_USE_CONVERT_PPTX_TOCUSTOM_VML
@ -508,9 +498,9 @@ private:
m_lSizeCur = 0;
}
AVSINLINE CString GetData()
AVSINLINE std::wstring GetData()
{
CString str(m_pData, (int)m_lSizeCur);
std::wstring str(m_pData, (int)m_lSizeCur);
return str;
}
@ -821,7 +811,7 @@ public:
m_oWriter.ClearNoAttack();
return S_OK;
}
HRESULT ResultPath(CString* bstrVal)
HRESULT ResultPath(std::wstring* bstrVal)
{
*bstrVal = m_oWriter.GetData();
return S_OK;

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