Commit a0d32619 authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander Trofimov

Bug 30175 - Ошибка в консоли при переоткрытии презентации с определенной темой.

оишбка в mailmerge

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64387 954022d7-b5bf-4e40-9824-e11837661b57
parent 9356a5c3
#include "BinaryFileReaderWriter.h" #include "BinaryFileReaderWriter.h"
#include "../../Common/DocxFormat/Source/Base/Nullable.h" #include "../../Common/DocxFormat/Source/Base/Nullable.h"
#include "BinReaderWriterDefines.h" #include "BinReaderWriterDefines.h"
...@@ -123,7 +123,7 @@ namespace NSBinPptxRW ...@@ -123,7 +123,7 @@ namespace NSBinPptxRW
int CImageManager2::IsDisplayedImage(const CString& strInput) int CImageManager2::IsDisplayedImage(const CString& strInput)
{ {
int nRes = 0; int nRes = 0;
// display[N]image.ext //шаблон display[N]image.ext
CString sFind1 = _T("display"); CString sFind1 = _T("display");
int nIndex1 = strInput.Find(sFind1); int nIndex1 = strInput.Find(sFind1);
if(-1 != nIndex1) if(-1 != nIndex1)
...@@ -214,7 +214,7 @@ namespace NSBinPptxRW ...@@ -214,7 +214,7 @@ namespace NSBinPptxRW
if ((_T(".jpg") == strExts) || (_T(".jpeg") == strExts) || (_T(".png") == strExts) || (_T(".emf") == strExts) || (_T(".wmf") == strExts)) if ((_T(".jpg") == strExts) || (_T(".jpeg") == strExts) || (_T(".png") == strExts) || (_T(".emf") == strExts) || (_T(".wmf") == strExts))
{ {
OOX::CPath pathOutput = m_strDstMedia + FILE_SEPARATOR_STR + strImage + strExts; OOX::CPath pathOutput = m_strDstMedia + FILE_SEPARATOR_STR + strImage + strExts;
// // теперь нужно скопировать картинку
if (pathOutput.GetPath() != strInput) if (pathOutput.GetPath() != strInput)
CDirectory::CopyFile(strInput, pathOutput.GetPath(), NULL, NULL); CDirectory::CopyFile(strInput, pathOutput.GetPath(), NULL, NULL);
} }
...@@ -276,7 +276,9 @@ namespace NSBinPptxRW ...@@ -276,7 +276,9 @@ namespace NSBinPptxRW
int n3 = strFile.Find(_T("ftp")); int n3 = strFile.Find(_T("ftp"));
int n4 = strFile.Find(_T("https://")); int n4 = strFile.Find(_T("https://"));
if (((n1 >= 0) && (n1 < 10)) || ((n2 >= 0) && (n2 < 10)) || ((n3 >= 0) && (n3 < 10)) || ((n4 >= 0) && (n4 < 10))) //если nI сранивать не с 0, то будут проблемы
//потому что в инсталяции мы кладем файлы в /var/www...
if (0 == n1 || 0 == n2 || 0 == n3 || 0 == n4)
return true; return true;
return false; return false;
} }
...@@ -1089,7 +1091,7 @@ namespace NSBinPptxRW ...@@ -1089,7 +1091,7 @@ namespace NSBinPptxRW
StartMainRecord(NSBinPptxRW::NSMainTables::FontsEmbedded); StartMainRecord(NSBinPptxRW::NSMainTables::FontsEmbedded);
// // добавим мега шрифт
m_pCommon->m_pNativePicker->m_oEmbeddedFonts.CheckString(_T(".)abcdefghijklmnopqrstuvwxyz")); m_pCommon->m_pNativePicker->m_oEmbeddedFonts.CheckString(_T(".)abcdefghijklmnopqrstuvwxyz"));
m_pCommon->m_pNativePicker->m_oEmbeddedFonts.CheckFont(_T("Wingdings 3"), m_pCommon->m_pNativePicker->m_pFontManager); m_pCommon->m_pNativePicker->m_oEmbeddedFonts.CheckFont(_T("Wingdings 3"), m_pCommon->m_pNativePicker->m_pFontManager);
m_pCommon->m_pNativePicker->m_oEmbeddedFonts.CheckFont(_T("Arial"), m_pCommon->m_pNativePicker->m_pFontManager); m_pCommon->m_pNativePicker->m_oEmbeddedFonts.CheckFont(_T("Arial"), m_pCommon->m_pNativePicker->m_pFontManager);
......
#pragma once #pragma once
#include "math.h" #include "math.h"
#include "CalculatorCRC32.h" #include "CalculatorCRC32.h"
...@@ -268,7 +268,9 @@ namespace NSShapeImageGen ...@@ -268,7 +268,9 @@ namespace NSShapeImageGen
int n3 = strFile.Find(_T("ftp")); int n3 = strFile.Find(_T("ftp"));
int n4 = strFile.Find(_T("https")); int n4 = strFile.Find(_T("https"));
if (((n1 >= 0) && (n1 < 10)) || ((n2 >= 0) && (n2 < 10)) || ((n3 >= 0) && (n3 < 10)) || ((n4 >= 0) && (n4 < 10))) //если nI сранивать не с 0, то будут проблемы
//потому что в инсталяции мы кладем файлы в /var/www...
if (0 == n1 || 0 == n2 || 0 == n3 || 0 == n4)
bIsDownload = true; bIsDownload = true;
if (bIsDownload) if (bIsDownload)
...@@ -388,7 +390,7 @@ namespace NSShapeImageGen ...@@ -388,7 +390,7 @@ namespace NSShapeImageGen
} }
else else
{ {
// - //конвертация неудачная - берем оригинальный файл
OOX::CPath pathOriginal = strFileSrc; OOX::CPath pathOriginal = strFileSrc;
CString strSaveItem = oInfo.GetPathWithoutExtension(); CString strSaveItem = oInfo.GetPathWithoutExtension();
...@@ -462,7 +464,7 @@ namespace NSShapeImageGen ...@@ -462,7 +464,7 @@ namespace NSShapeImageGen
std::map<DWORD, CImageInfo>::iterator pPair = m_mapImageData.find(dwSum); std::map<DWORD, CImageInfo>::iterator pPair = m_mapImageData.find(dwSum);
if (m_mapImageData.end() == pPair) if (m_mapImageData.end() == pPair)
{ {
// // нужно добавить
++m_lNextIDImage; ++m_lNextIDImage;
oInfo.m_lID = m_lNextIDImage; oInfo.m_lID = m_lNextIDImage;
...@@ -536,7 +538,7 @@ namespace NSShapeImageGen ...@@ -536,7 +538,7 @@ namespace NSShapeImageGen
if (metaFileRaster.LoadFromFile(strFileName)) if (metaFileRaster.LoadFromFile(strFileName))
{ {
// wmf/emf //случай растрового wmf/emf
CString strSaveItem = strSaveItemWE + _T(".png"); CString strSaveItem = strSaveItemWE + _T(".png");
metaFileRaster.ConvertToRaster(strSaveItem, 4 /*CXIMAGE_FORMAT_PNG*/, lWidth, lHeight); metaFileRaster.ConvertToRaster(strSaveItem, 4 /*CXIMAGE_FORMAT_PNG*/, lWidth, lHeight);
...@@ -569,7 +571,7 @@ namespace NSShapeImageGen ...@@ -569,7 +571,7 @@ namespace NSShapeImageGen
oBgraFrame.put_Stride(pImage->GetStride()); oBgraFrame.put_Stride(pImage->GetStride());
oBgraFrame.put_Data(pImage->GetData()); oBgraFrame.put_Data(pImage->GetData());
SaveImage(oBgraFrame, oInfo, lWidth, lHeight); SaveImage(oBgraFrame, oInfo, lWidth, lHeight);
// //чтобы в деструкторе не удалялось
oBgraFrame.put_Data(NULL); oBgraFrame.put_Data(NULL);
m_mapImagesFile.insert(std::pair<CString,CImageInfo>(sMapKey, oInfo)); m_mapImagesFile.insert(std::pair<CString,CImageInfo>(sMapKey, oInfo));
......
//#include "./stdafx.h" //#include "./stdafx.h"
#include "FileFactory.h" #include "FileFactory.h"
#include "DocxFormat/File.h" #include "DocxFormat/File.h"
...@@ -86,12 +86,12 @@ namespace PPTX ...@@ -86,12 +86,12 @@ namespace PPTX
return smart_ptr<PPTX::File>(new PPTX::Video(filename)); return smart_ptr<PPTX::File>(new PPTX::Video(filename));
else if (relation.type() == PPTX::FileTypes::Media) // FOR NONE OPTIMIZED PPTX FILES else if (relation.type() == PPTX::FileTypes::Media) // FOR NONE OPTIMIZED PPTX FILES
return smart_ptr<PPTX::File>(new PPTX::HyperLink(filename)); return smart_ptr<PPTX::File>(new PPTX::HyperLink(filename));
else if (relation.type() == PPTX::FileTypes::Data) // filepath else if (relation.type() == PPTX::FileTypes::Data) // нужен только filepath
return smart_ptr<PPTX::File>(new PPTX::Image(filename)); return smart_ptr<PPTX::File>(new PPTX::Image(filename));
else if (relation.type() == PPTX::FileTypes::DrawingDiag) else if (relation.type() == PPTX::FileTypes::DrawingDiag)
return smart_ptr<PPTX::File>(new PPTX::Image(filename)); // filepath return smart_ptr<PPTX::File>(new PPTX::Image(filename)); // нужен только filepath
else if (relation.type() == PPTX::FileTypes::Chart) else if (relation.type() == PPTX::FileTypes::Chart)
return smart_ptr<PPTX::File>(new PPTX::Image(filename)); // filepath return smart_ptr<PPTX::File>(new PPTX::Image(filename)); // нужен только filepath
else if (relation.type() == PPTX::FileTypes::CommentAuthors) else if (relation.type() == PPTX::FileTypes::CommentAuthors)
return smart_ptr<PPTX::File>(new PPTX::Authors(filename, map)); return smart_ptr<PPTX::File>(new PPTX::Authors(filename, map));
else if (relation.type() == PPTX::FileTypes::SlideComments) else if (relation.type() == PPTX::FileTypes::SlideComments)
...@@ -111,7 +111,9 @@ namespace PPTX ...@@ -111,7 +111,9 @@ namespace PPTX
int n3 = strFile.Find(_T("ftp")); int n3 = strFile.Find(_T("ftp"));
int n4 = strFile.Find(_T("https://")); int n4 = strFile.Find(_T("https://"));
if (((n1 >= 0) && (n1 < 10)) || ((n2 >= 0) && (n2 < 10)) || ((n3 >= 0) && (n3 < 10)) || ((n4 >= 0) && (n4 < 10))) //если nI сранивать не с 0, то будут проблемы
//потому что в инсталяции мы кладем файлы в /var/www...
if (0 == n1 || 0 == n2 || 0 == n3 || 0 == n4)
bIsDownload = true; bIsDownload = true;
OOX::CPath filename = path / relation.filename(); OOX::CPath filename = path / relation.filename();
...@@ -140,4 +142,4 @@ namespace PPTX ...@@ -140,4 +142,4 @@ namespace PPTX
return smart_ptr<PPTX::File>(new PPTX::UnknowTypeFile()); return smart_ptr<PPTX::File>(new PPTX::UnknowTypeFile());
} }
} // namespace PPTX } // namespace PPTX
\ No newline at end of file
This diff is collapsed.
...@@ -16,12 +16,16 @@ namespace NSSystemPath ...@@ -16,12 +16,16 @@ namespace NSSystemPath
static std::wstring GetDirectoryName(const std::wstring& strFileName) static std::wstring GetDirectoryName(const std::wstring& strFileName)
{ {
std::wstring sRes; std::wstring sRes;
//_wsplitpath return directory path, including trailing slash.
//dirname() returns the string up to, but not including, the final '/',
#if defined(_WIN32) || defined (_WIN64) #if defined(_WIN32) || defined (_WIN64)
wchar_t tDrive[256]; wchar_t tDrive[256];
wchar_t tFolder[256]; wchar_t tFolder[256];
_wsplitpath( strFileName.c_str(), tDrive, tFolder, NULL, NULL ); _wsplitpath( strFileName.c_str(), tDrive, tFolder, NULL, NULL );
sRes.append(tDrive); sRes.append(tDrive);
sRes.append(tFolder); sRes.append(tFolder);
if(sRes.length() > 0)
sRes.erase(sRes.length()-1);
#elif __linux__ || MAC #elif __linux__ || MAC
BYTE* pUtf8 = NULL; BYTE* pUtf8 = NULL;
LONG lLen = 0; LONG lLen = 0;
......
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