Commit 6f58c483 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

Doct->Docx - проблема с CreateDirectory

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@67468 954022d7-b5bf-4e40-9824-e11837661b57
parent fd650e7e
......@@ -138,39 +138,43 @@ bool BinDocxRW::CDocxSerializer::saveToFile(const CString& sSrcFileName, const C
RELEASEOBJECT(pFontPicker);
return true;
}
void BinDocxRW::CDocxSerializer::CreateDocxFolders(CString strDirectory, CString& sThemePath, CString& sMediaPath, CString& sEmbedPath)
bool BinDocxRW::CDocxSerializer::CreateDocxFolders(CString strDirectory, CString& sThemePath, CString& sMediaPath, CString& sEmbedPath)
{
bool res = true;
// rels
OOX::CPath pathRels = strDirectory + FILE_SEPARATOR_STR + _T("_rels");
FileSystem::Directory::CreateDirectory(pathRels.GetPath());
if (!NSDirectory::CreateDirectory(pathRels.GetPath().GetBuffer())) res = false;
// word
OOX::CPath pathWord = strDirectory + FILE_SEPARATOR_STR + _T("word");
FileSystem::Directory::CreateDirectory(pathWord.GetPath());
if (!NSDirectory::CreateDirectory(pathWord.GetPath().GetBuffer())) res = false;
// documentRels
OOX::CPath pathWordRels = pathWord + FILE_SEPARATOR_STR + _T("_rels");
FileSystem::Directory::CreateDirectory(pathWordRels.GetPath());
if (!NSDirectory::CreateDirectory(pathWordRels.GetPath().GetBuffer()))res = false;
//media
OOX::CPath pathMedia = pathWord + FILE_SEPARATOR_STR + _T("media");
FileSystem::Directory::CreateDirectory(pathMedia.GetPath());
if (!NSDirectory::CreateDirectory(pathMedia.GetPath().GetBuffer())) res = false;
sMediaPath = pathMedia.GetPath();
//embeddings
OOX::CPath pathEmbeddings = pathWord + FILE_SEPARATOR_STR + _T("embeddings");
FileSystem::Directory::CreateDirectory(pathEmbeddings.GetPath());
if (!NSDirectory::CreateDirectory(pathEmbeddings.GetPath().GetBuffer()))res = false;
sEmbedPath = pathEmbeddings.GetPath();
// theme
OOX::CPath pathTheme = pathWord + FILE_SEPARATOR_STR + _T("theme");
FileSystem::Directory::CreateDirectory(pathTheme.GetPath());
if (!NSDirectory::CreateDirectory(pathTheme.GetPath().GetBuffer())) res = false;
OOX::CPath pathThemeRels = pathTheme + FILE_SEPARATOR_STR + _T("_rels");
FileSystem::Directory::CreateDirectory(pathThemeRels.GetPath());
if (!NSDirectory::CreateDirectory(pathThemeRels.GetPath().GetBuffer())) res = false;
pathTheme = pathTheme + FILE_SEPARATOR_STR + _T("theme1.xml");
sThemePath = pathTheme.GetPath();
return res;
}
bool BinDocxRW::CDocxSerializer::loadFromFile(const CString& sSrcFileName, const CString& sDstPath, const CString& sXMLOptions, const CString& sThemePath, const CString& sMediaPath, const CString& sEmbedPath)
{
......
......@@ -37,7 +37,7 @@ namespace BinDocxRW
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);
void CreateDocxFolders(CString strDirectory, CString& sThemePath, CString& sMediaPath, CString& sEmbedPath);
bool CreateDocxFolders(CString strDirectory, CString& sThemePath, CString& sMediaPath, CString& sEmbedPath);
bool getXmlContent(NSBinPptxRW::CBinaryFileReader& oBufferedStream, long lLength, CString& sOutputXml);
bool getBinaryContent(const CString& bsTxContent, NSBinPptxRW::CBinaryFileWriter& oBufferedStream, long& lDataSize);
......
......@@ -136,7 +136,8 @@ public:
CString sMediaPath;
CString sEmbedPath;
m_oCDocxSerializer.CreateDocxFolders(sDirectoryOut, sThemePath, sMediaPath, sEmbedPath);
if (!m_oCDocxSerializer.CreateDocxFolders(sDirectoryOut, sThemePath, sMediaPath, sEmbedPath))
return S_FALSE;
bool bRes = m_oCDocxSerializer.loadFromFile(CString(bstrFileIn), CString(bstrDirectoryOut), CString(_T("")), CString(sThemePath.GetString()), CString(sMediaPath.GetString()), sEmbedPath);
return bRes ? S_OK : S_FALSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment