#pragma once #include "../OfficeDrawing/Document.h" #include "../../Common/DocxFormat/Source/SystemUtility/File.h" #include "../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h" #include "ShapeWriter.h" #include "StylesWriter.h" #include "../../Common/DocxFormat/Source/SystemUtility/SystemUtility.h" #include "../../ASCOfficePPTXFile/Editor/DefaultNotesMaster.h" #include "../../ASCOfficePPTXFile/Editor/DefaultNotesTheme.h" #include "Converter.h" namespace NSPresentationEditor { namespace NSPPTXWriterConst { static CString g_string_rels_presentation = _T("\ \ \ \ \ "); static CString g_string_core = _T("\ \ Slide 1\ OnlyOffice\ OnlyOffice\ 1\ "); } }; 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_pDocument = NULL; m_pShapeWriter = new CShapeWriter(); } NSPresentationEditor::CPPTXWriter::~CPPTXWriter() { RELEASEOBJECT(m_pShapeWriter); } void NSPresentationEditor::CPPTXWriter::CreateFile(CDocument* pDocument) { m_pDocument = pDocument; m_oManager.Clear(); m_oManager.SetDstMedia(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("media") + FILE_SEPARATOR_STR); m_pShapeWriter->InitNextId(); FileSystem::Directory::CreateDirectory(m_strTempDirectory); CFile oFile; CString strMemory = _T(""); // _rels FileSystem::Directory::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; oFile.WriteStringUTF8(strMemory); oFile.CloseFile(); // docProps FileSystem::Directory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("docProps")); // core oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("docProps") + FILE_SEPARATOR_STR + _T("core.xml")); strMemory = NSPPTXWriterConst::g_string_core; oFile.WriteStringUTF8(strMemory); oFile.CloseFile(); // app oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("docProps") + FILE_SEPARATOR_STR + _T("app.xml")); WriteApp(oFile); oFile.CloseFile(); // content types WriteContentTypes(); // ppt FileSystem::Directory::CreateDirectory(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt")); WritePresInfo(); WriteAll(); } void NSPresentationEditor::CPPTXWriter::CloseFile() { m_oManager.Clear(); } void NSPresentationEditor::CPPTXWriter::WriteContentTypes() { CString strContentTypes = _T("\ \ \ \ \ \ \ \ \ "); strContentTypes += _T("\ \ \ \ \ "); int nThemes = (int)m_pDocument->m_arThemes.size(); int nIndexLayout = 0; for (int nT = 0; nT < nThemes; ++nT) { CString strTheme = _T(""); strTheme.Format(_T("\ "), nT + 1, nT + 1); 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(""), nIndexLayout + 1); strContentTypes += strL; } } CString strNotesTheme = _T(""); strNotesTheme.Format(_T(""), nThemes + 1); strContentTypes += strNotesTheme; strContentTypes += _T(""); int nCountS = (int)m_pDocument->m_arSlides.size(); for (int nS = 0; nS < nCountS; ++nS) { CString strS = _T(""); strS.Format(_T(""), nS + 1); strContentTypes += strS; CString strN = _T(""); strN.Format(_T(""), nS + 1); strContentTypes += strN; } strContentTypes += _T(""); CFile oFile; oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("[Content_Types].xml")); oFile.WriteStringUTF8(strContentTypes); oFile.CloseFile(); } void NSPresentationEditor::CPPTXWriter::WriteApp(CFile& oFile) { CString str1 = _T("\ \ 0\ 0\ OnlyOffice\ On-screen Show (4:3)\ 0"); oFile.WriteStringUTF8(str1); CString str2 = _T(""); str2.Format(_T("%d"), (int)m_pDocument->m_arSlides.size()); oFile.WriteStringUTF8(str2); CString str3 = _T("0\ 0\ 2\ false\ \ "); oFile.WriteStringUTF8(str3); int nCountThemes = (int)m_pDocument->m_arThemes.size(); int nCountSlides = (int)m_pDocument->m_arSlides.size(); CString strThemes = _T(""); strThemes.Format(_T("Theme%d"), nCountThemes); CString strSlides = _T(""); strSlides.Format(_T("Slide Titles%d"), nCountSlides); CString str4 = _T(""); str4.Format(_T(""), nCountSlides + nCountThemes); str4 = strThemes + strSlides + str4; oFile.WriteStringUTF8(str4); CString strMemory = _T(""); for (int i = 1; i <= nCountThemes; ++i) { CString strMem = _T(""); strMem.Format(_T("Theme %d"), i); strMemory += strMem; } for (int i = 1; i <= nCountSlides; ++i) { CString strMem = _T(""); strMem.Format(_T("Slide %d"), i); strMemory += strMem; } CString str5 = _T("\ \ \ false\ false\ false\ 1.0000\ "); strMemory += str5; oFile.WriteStringUTF8(strMemory); } void NSPresentationEditor::CPPTXWriter::WritePresInfo() { CFile oFile; // tableStyles.xml oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("tableStyles.xml")); CString str = _T("\ "); oFile.WriteStringUTF8(str); oFile.CloseFile(); // presProps.xml str = _T("\ \ \ \ \ \ "); oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("presProps.xml")); oFile.WriteStringUTF8(str); oFile.CloseFile(); // viewProps.xml str = _T("\ \ \ \ \ "); oFile.CreateFile(m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("viewProps.xml")); oFile.WriteStringUTF8(str); oFile.CloseFile(); // presentation.xml + _rels/presentation.xml.rels CString strPresRels; CString strPresMasters = _T(""); CString 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(""), 2 * nIndexTheme + 1, nIndexTheme + 1); strPresRels += strRels; strRels = _T(""); strRels.Format(_T(""), 2 * nIndexTheme + 2, nIndexTheme + 1); strPresRels += strRels; strRels = _T(""); strRels.Format(_T(""), 0x80000000 + nCountLayouts, 2 * nIndexTheme + 1); 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(""), nCurrentRels, nIndexSlide + 1); strPresRels += strRels; strRels = _T(""); strRels.Format(_T(""), 256 + nIndexSlide, nCurrentRels); strPresSlides += strRels; } CString strNotesIDs = _T(""); strNotesIDs.Format(_T(""), nCurrentRels); CString strRels0 = _T(""); strRels0.Format(_T(""), nCurrentRels); ++nCurrentRels; CString strRels1 = _T(""); strRels1.Format(_T(""), nCurrentRels++); CString strRels2 = _T(""); strRels2.Format(_T(""), nCurrentRels++); CString strRels3 = _T(""); strRels3.Format(_T(""), nCurrentRels++); strPresRels = _T("") + strPresRels + strRels0 + strRels1 + strRels2 + strRels3 + _T(""); CString strPptRels = m_strTempDirectory + FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("_rels"); FileSystem::Directory::CreateDirectory(strPptRels); oFile.CreateFile(strPptRels + FILE_SEPARATOR_STR + _T("presentation.xml.rels")); oFile.WriteStringUTF8(strPresRels); oFile.CloseFile(); CString strSizePres = _T(""); strSizePres.Format(_T(""), m_pDocument->m_oInfo.m_lUnitsHor, m_pDocument->m_oInfo.m_lUnitsVer, m_pDocument->m_oInfo.m_lUnitsVer, m_pDocument->m_oInfo.m_lUnitsHor); CString strDefaultTextStyle = _T(""); 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(""); CString strPres = _T("\ \ ") + strPresMasters + _T("") + strNotesIDs + _T("") + strPresSlides + _T("") + strSizePres + strDefaultTextStyle + _T(""); oFile.CreateFile(m_strTempDirectory+ FILE_SEPARATOR_STR + _T("ppt") + FILE_SEPARATOR_STR + _T("presentation.xml")); oFile.WriteStringUTF8(strPres); oFile.CloseFile(); } void NSPresentationEditor::CPPTXWriter::WriteAll() { CString 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")); CString strNotesTheme = _T(""); strNotesTheme.Format(_T("theme%d.xml"), (int)m_pDocument->m_arThemes.size() + 1); 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"); Writers::DefaultNotesMasterWriter writerNotesMaster; writerNotesMaster.Write(strNotesMaster); CString strNotesMasterRels = strPptDirectory + _T("notesMasters") + FILE_SEPARATOR_STR +_T("_rels"); FileSystem::Directory::CreateDirectory(strNotesMasterRels); CString strThemeNotesNum = _T(""); strThemeNotesNum.Format(_T("%d"), (int)m_pDocument->m_arThemes.size() + 1); CString strVal = _T("\ \ "); CString strNotesMasterRelsFile = strNotesMasterRels+ FILE_SEPARATOR_STR + _T("notesMaster1.xml.rels"); CFile oFileRels; oFileRels.CreateFile(strNotesMasterRelsFile); oFileRels.WriteStringUTF8(strVal); oFileRels.CloseFile(); // ----------------------------------------------------- int nCount = (int)m_pDocument->m_arThemes.size(); int nStartLayout = 0; for (int nIndexTheme = 0; nIndexTheme < nCount; ++nIndexTheme) { CString strThemeXml = _T("\ \ "); CTheme* pTheme = &m_pDocument->m_arThemes[nIndexTheme]; CString strVal; strVal = _T(""); strVal.Format(_T(""), pTheme->m_arColorScheme[14].GetLONG_RGB()); strThemeXml += strVal; strVal = _T(""); strVal.Format(_T(""), pTheme->m_arColorScheme[13].GetLONG_RGB()); strThemeXml += strVal; strVal = _T(""); strVal.Format(_T(""), pTheme->m_arColorScheme[16].GetLONG_RGB()); strThemeXml += strVal; strVal = _T(""); strVal.Format(_T(""), pTheme->m_arColorScheme[15].GetLONG_RGB()); strThemeXml += strVal; strVal = _T(""); strVal.Format(_T(""), pTheme->m_arColorScheme[5].GetLONG_RGB()); strThemeXml += strVal; strVal = _T(""); strVal.Format(_T(""), pTheme->m_arColorScheme[6].GetLONG_RGB()); strThemeXml += strVal; strVal = _T(""); strVal.Format(_T(""), pTheme->m_arColorScheme[7].GetLONG_RGB()); strThemeXml += strVal; strVal = _T(""); strVal.Format(_T(""), pTheme->m_arColorScheme[8].GetLONG_RGB()); strThemeXml += strVal; strVal = _T(""); strVal.Format(_T(""), pTheme->m_arColorScheme[9].GetLONG_RGB()); strThemeXml += strVal; strVal = _T(""); strVal.Format(_T(""), pTheme->m_arColorScheme[10].GetLONG_RGB()); strThemeXml += strVal; strVal = _T(""); strVal.Format(_T(""), pTheme->m_arColorScheme[11].GetLONG_RGB()); strThemeXml += strVal; strVal = _T(""); strVal.Format(_T(""), pTheme->m_arColorScheme[12].GetLONG_RGB()); strThemeXml += strVal; strThemeXml += _T(""); _T(""); CString sFont1 = _T(""); if (0 < pTheme->m_arFonts.size()) sFont1 = pTheme->m_arFonts[0].Name; CString sFont2 = _T(""); if (1 < pTheme->m_arFonts.size()) sFont2 = pTheme->m_arFonts[1].Name; CString strFonts = _T(""); strThemeXml += strFonts; strThemeXml += _T("\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ "); strThemeXml += _T(""); CString strThemeFile; strThemeFile.Format(_T("theme%d.xml"), nIndexTheme + 1); strThemeFile = strPptDirectory + _T("theme") + FILE_SEPARATOR_STR + strThemeFile; CFile oFile; oFile.CreateFile(strThemeFile); oFile.WriteStringUTF8(strThemeXml); oFile.CloseFile(); // теперь masterslide CRelsGenerator oRels(&m_oManager); int nCountLayouts = (int)pTheme->m_arLayouts.size(); oRels.StartMaster(nIndexTheme, nStartLayout, nCountLayouts); CStringWriter oWriter; CString str1 = _T("\ \ "); oWriter.WriteString(str1); if (pTheme->m_bIsBackground) { WriteBackground(oWriter, oRels, pTheme->m_oBackground); } CString strElems = _T("\ "); oWriter.WriteString(strElems); size_t nElements = pTheme->m_arElements.size(); for (size_t nEl = 0; nEl < nElements; ++nEl) WriteElement(oWriter, oRels, pTheme->m_arElements[nEl]); oWriter.WriteString(_T("")); CString strOverrideColorScheme = _T(""); oWriter.WriteString(strOverrideColorScheme); oWriter.WriteString(_T("")); size_t __nCountLayouts = 0; for (int nIndexLayout = 0; nIndexLayout < nCountLayouts; ++nIndexLayout) { CString strMasterLayout = _T(""); strMasterLayout.Format(_T(""), 0x80000000 + nIndexTheme + 1 + nStartLayout + nIndexLayout, nIndexLayout + 1); oWriter.WriteString(strMasterLayout); WriteLayout(pTheme->m_arLayouts[nIndexLayout], nIndexLayout, nStartLayout, nIndexTheme); } oWriter.WriteString(_T("")); oWriter.WriteString(_T("")); oWriter.WriteString(_T("")); CStylesWriter::ConvertStyles(pTheme->m_pStyles[1], pTheme->m_oInfo, oWriter, 9); oWriter.WriteString(_T("")); oWriter.WriteString(_T("")); CStylesWriter::ConvertStyles(pTheme->m_pStyles[2], pTheme->m_oInfo, oWriter, 9); oWriter.WriteString(_T("")); oWriter.WriteString(_T("")); CStylesWriter::ConvertStyles(pTheme->m_pStyles[3], pTheme->m_oInfo, oWriter, 9); oWriter.WriteString(_T("")); oWriter.WriteString(_T("")); CString strSlideMasterFile; strSlideMasterFile.Format(_T("slideMaster%d.xml"), nIndexTheme + 1); strSlideMasterFile = strPptDirectory + _T("slideMasters") + FILE_SEPARATOR_STR + strSlideMasterFile; oFile.CreateFile(strSlideMasterFile); CString strMaster = oWriter.GetData(); oFile.WriteStringUTF8(strMaster); oFile.CloseFile(); oRels.CloseRels(); CString strSlideMasterRelsFile; strSlideMasterRelsFile.Format(_T("slideMaster%d.xml.rels"), nIndexTheme + 1); strSlideMasterRelsFile = strPptDirectory + _T("slideMasters") + FILE_SEPARATOR_STR + _T("_rels") + FILE_SEPARATOR_STR + strSlideMasterRelsFile; oRels.SaveRels(strSlideMasterRelsFile); nStartLayout += nCountLayouts; } size_t nCountSlides = m_pDocument->m_arSlides.size(); for (size_t nIndexS = 0; nIndexS < nCountSlides; ++nIndexS) { CRelsGenerator::StartNotes((int)nIndexS, m_strTempDirectory, m_pDocument->m_arSlides[nIndexS].m_strComment); WriteSlide((int)nIndexS); } } void NSPresentationEditor::CPPTXWriter::WriteBackground(CStringWriter& oWriter, CRelsGenerator& oRels, CBrush& oBackground) { if (oBackground.Type == c_BrushTypeTexture) { CString strRid = oRels.WriteImage(oBackground.TexturePath); CString strWrite = _T(""); oWriter.WriteString(strWrite); return; } if (oBackground.Color1.m_lSchemeIndex == -1) { CString str = _T(""); str.Format(_T(""), oBackground.Color1.GetLONG_RGB()); str = _T("") + str + _T(""); oWriter.WriteString(str); } else { CString str = _T(""); str = _T("") + str + _T(""); oWriter.WriteString(str); } } void NSPresentationEditor::CPPTXWriter::WriteElement(CStringWriter& oWriter, CRelsGenerator& oRels, IElement* pElement, CLayout* pLayout) { if (etShape != pElement->m_etType) return; CShapeElement* pShapeElem = dynamic_cast(pElement); m_pShapeWriter->SetShape(pShapeElem); m_pShapeWriter->SetRelsGenerator(&oRels); if (NULL != pLayout) { if (-1 != pElement->m_lPlaceholderType) { size_t nCountElements = pLayout->m_arElements.size(); for (size_t nIndex = 0; nIndex < nCountElements; ++nIndex) { if ((pElement->m_lPlaceholderType == pLayout->m_arElements[nIndex]->m_lPlaceholderType) && (pElement->m_lPlaceholderID == pLayout->m_arElements[nIndex]->m_lPlaceholderID)) { IElement* pElLayout = pLayout->m_arElements[nIndex]; bool bIsEqualTransform = ((pElement->m_dRotate == pElLayout->m_dRotate) && (pElement->m_bFlipH == pElLayout->m_bFlipH) && (pElement->m_bFlipV == pElLayout->m_bFlipV)); if (bIsEqualTransform) { if (pElement->m_rcBounds.IsEqual(pElLayout->m_rcBounds, 0.5)) m_pShapeWriter->SetIsWriteGeom(false); } break; } } } } oWriter.WriteString(m_pShapeWriter->ConvertShape()); } void NSPresentationEditor::CPPTXWriter::WriteLayout(CLayout& oLayout, int nIndexLayout, int nStartLayout, int nIndexTheme) { CStringWriter oWriter; CRelsGenerator oRels(&m_oManager); oRels.StartLayout(nIndexTheme); CString str1 = _T(""); str1 += _T(""); oWriter.WriteString(str1); if (oLayout.m_bIsBackground) { WriteBackground(oWriter, oRels, oLayout.m_oBackground); } CString strElems = _T("\ "); oWriter.WriteString(strElems); size_t nElements = oLayout.m_arElements.size(); for (size_t nEl = 0; nEl < nElements; ++nEl) WriteElement(oWriter, oRels, oLayout.m_arElements[nEl]); oWriter.WriteString(_T("")); oWriter.WriteString(_T("")); oWriter.WriteString(_T("")); oRels.CloseRels(); CString strXml = oWriter.GetData(); CString strFile = _T(""); strFile.Format(_T("slideLayout%d.xml"), nIndexLayout + nStartLayout + 1); CFile oFile; CString 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); oRels.SaveRels(strFileLayoutPath + _T("_rels") + FILE_SEPARATOR_STR + strFile); } void NSPresentationEditor::CPPTXWriter::WriteSlide(int nIndexSlide) { CStringWriter oWriter; CRelsGenerator oRels(&m_oManager); CSlide& oSlide = m_pDocument->m_arSlides[nIndexSlide]; if (0 == oSlide.m_lThemeID) oRels.StartSlide(oSlide.m_lLayoutID, nIndexSlide); else { int nLayout = oSlide.m_lLayoutID; for (int i = 0; i < oSlide.m_lThemeID; ++i) nLayout += (int)m_pDocument->m_arThemes[i].m_arLayouts.size(); oRels.StartSlide(nLayout, nIndexSlide); } CString str1 = _T(""); oWriter.WriteString(str1); if (oSlide.m_bIsBackground) { WriteBackground(oWriter, oRels, oSlide.m_oBackground); } CString strElems = _T("\ "); oWriter.WriteString(strElems); size_t nElements = oSlide.m_arElements.size(); for (size_t nEl = 0; nEl < nElements; ++nEl) { WriteElement(oWriter, oRels, oSlide.m_arElements[nEl], &m_pDocument->m_arThemes[oSlide.m_lThemeID].m_arLayouts[oSlide.m_lLayoutID]); } oWriter.WriteString(_T("")); oWriter.WriteString(_T("")); oWriter.WriteString(_T("")); oWriter.WriteString(_T("")); 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; CFile oFile; oFile.CreateFile(strFileSlidePath + strFile); oFile.WriteStringUTF8(strXml); oFile.CloseFile(); strFile = _T(""); strFile.Format(_T("slide%d.xml.rels"), nIndexSlide + 1); oRels.SaveRels(strFileSlidePath + _T("_rels") + FILE_SEPARATOR_STR + strFile); }