mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
.
This commit is contained in:
@ -201,14 +201,14 @@ bool CFontConverter::ToOTF(std::wstring sFontIn, std::wstring sFontOut, unsigned
|
||||
{
|
||||
// error parse font
|
||||
// Просто копируем файл
|
||||
NSFile::CFileBinary::Copy(sFontIn, sFontOut);
|
||||
oFileBinary.Copy(sFontIn, sFontOut);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Просто копируем файл
|
||||
NSFile::CFileBinary::Copy(sFontIn, sFontOut);
|
||||
oFileBinary.Copy(sFontIn, sFontOut);
|
||||
}
|
||||
|
||||
FT_Done_Face( pFace );
|
||||
|
||||
@ -75,7 +75,8 @@ public:
|
||||
oMetafile.ConvertToRaster(sTempFile.c_str(), 4, 1000, -1);
|
||||
m_oImage.Create(sTempFile);
|
||||
|
||||
NSFile::CFileBinary::Remove(sTempFile);
|
||||
NSFile::CFileBinary file;
|
||||
file.Remove(sTempFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,11 +80,13 @@ namespace NSOnlineOfficeBinToPdf
|
||||
|
||||
~CMetafileToRenderterRaster_private()
|
||||
{
|
||||
NSFile::CFileBinary file;
|
||||
for (std::vector<std::wstring>::iterator i = m_arTempFiles.begin(); i != m_arTempFiles.end(); i++)
|
||||
{
|
||||
std::wstring sPath = *i;
|
||||
if (NSFile::CFileBinary::Exists(sPath))
|
||||
NSFile::CFileBinary::Remove(sPath);
|
||||
|
||||
if (file.Exists(sPath))
|
||||
file.Remove(sPath);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -50,13 +50,14 @@ namespace MetaFile
|
||||
}
|
||||
CEmfLogBrushEx::~CEmfLogBrushEx()
|
||||
{
|
||||
if (BS_DIBPATTERN == BrushStyle && L"" != DibPatternPath)
|
||||
{
|
||||
NSFile::CFileBinary::Remove(DibPatternPath);
|
||||
}
|
||||
if (BS_DIBPATTERN == BrushStyle && L"" != DibPatternPath)
|
||||
{
|
||||
NSFile::CFileBinary file;
|
||||
file.Remove(DibPatternPath);
|
||||
}
|
||||
|
||||
if (DibBuffer)
|
||||
delete[] DibBuffer;
|
||||
if (DibBuffer)
|
||||
delete[] DibBuffer;
|
||||
}
|
||||
void CEmfLogBrushEx::SetDibPattern(unsigned char* pBuffer, unsigned int ulWidth, unsigned int ulHeight)
|
||||
{
|
||||
|
||||
@ -57,53 +57,54 @@ namespace MetaFile
|
||||
DibWidth = 0;
|
||||
DibHeigth = 0;
|
||||
}
|
||||
CWmfBrush::~CWmfBrush()
|
||||
{
|
||||
if (BS_DIBPATTERN == BrushStyle && L"" != DibPatternPath)
|
||||
{
|
||||
NSFile::CFileBinary::Remove(DibPatternPath);
|
||||
}
|
||||
CWmfBrush::~CWmfBrush()
|
||||
{
|
||||
if (BS_DIBPATTERN == BrushStyle && L"" != DibPatternPath)
|
||||
{
|
||||
NSFile::CFileBinary file;
|
||||
file.Remove(DibPatternPath);
|
||||
}
|
||||
|
||||
if (DibBuffer)
|
||||
delete[] DibBuffer;
|
||||
if (DibBuffer)
|
||||
delete[] DibBuffer;
|
||||
}
|
||||
void CWmfBrush::SetDibPattern(unsigned char* pBuffer, unsigned int ulWidth, unsigned int ulHeight)
|
||||
{
|
||||
DibBuffer = pBuffer;
|
||||
DibWidth = ulWidth;
|
||||
DibHeigth = ulHeight;
|
||||
void CWmfBrush::SetDibPattern(unsigned char* pBuffer, unsigned int ulWidth, unsigned int ulHeight)
|
||||
{
|
||||
DibBuffer = pBuffer;
|
||||
DibWidth = ulWidth;
|
||||
DibHeigth = ulHeight;
|
||||
|
||||
if (ulWidth <= 0 || ulHeight <= 0)
|
||||
return;
|
||||
if (ulWidth <= 0 || ulHeight <= 0)
|
||||
return;
|
||||
|
||||
unsigned int ulBufferSize = 4 * ulWidth * ulHeight;
|
||||
Aggplus::CImage oImage;
|
||||
BYTE* pBufferPtr = new BYTE[ulBufferSize];
|
||||
oImage.Create(pBufferPtr, ulWidth, ulHeight, 4 * ulWidth);
|
||||
unsigned int ulBufferSize = 4 * ulWidth * ulHeight;
|
||||
Aggplus::CImage oImage;
|
||||
BYTE* pBufferPtr = new BYTE[ulBufferSize];
|
||||
oImage.Create(pBufferPtr, ulWidth, ulHeight, 4 * ulWidth);
|
||||
|
||||
// Пишем данные в pBufferPtr
|
||||
for (unsigned int ulIndex = 0; ulIndex < ulBufferSize; ulIndex += 4)
|
||||
{
|
||||
pBufferPtr[0] = (unsigned char)pBuffer[ulIndex + 0];
|
||||
pBufferPtr[1] = (unsigned char)pBuffer[ulIndex + 1];
|
||||
pBufferPtr[2] = (unsigned char)pBuffer[ulIndex + 2];
|
||||
pBufferPtr[3] = (unsigned char)pBuffer[ulIndex + 3];
|
||||
pBufferPtr += 4;
|
||||
}
|
||||
// Пишем данные в pBufferPtr
|
||||
for (unsigned int ulIndex = 0; ulIndex < ulBufferSize; ulIndex += 4)
|
||||
{
|
||||
pBufferPtr[0] = (unsigned char)pBuffer[ulIndex + 0];
|
||||
pBufferPtr[1] = (unsigned char)pBuffer[ulIndex + 1];
|
||||
pBufferPtr[2] = (unsigned char)pBuffer[ulIndex + 2];
|
||||
pBufferPtr[3] = (unsigned char)pBuffer[ulIndex + 3];
|
||||
pBufferPtr += 4;
|
||||
}
|
||||
|
||||
FILE *pTempFile = NULL;
|
||||
std::wstring wsTempFileName;
|
||||
if (!OpenTempFile(&wsTempFileName, &pTempFile, L"wb", L".emf0", NULL))
|
||||
return;
|
||||
FILE *pTempFile = NULL;
|
||||
std::wstring wsTempFileName;
|
||||
if (!OpenTempFile(&wsTempFileName, &pTempFile, L"wb", L".emf0", NULL))
|
||||
return;
|
||||
|
||||
::fclose(pTempFile);
|
||||
::fclose(pTempFile);
|
||||
|
||||
oImage.SaveFile(wsTempFileName, _CXIMAGE_FORMAT_PNG);
|
||||
oImage.SaveFile(wsTempFileName, _CXIMAGE_FORMAT_PNG);
|
||||
|
||||
BrushStyle = BS_DIBPATTERN;
|
||||
DibPatternPath = wsTempFileName;
|
||||
}
|
||||
int CWmfBrush::GetColor()
|
||||
BrushStyle = BS_DIBPATTERN;
|
||||
DibPatternPath = wsTempFileName;
|
||||
}
|
||||
int CWmfBrush::GetColor()
|
||||
{
|
||||
return METAFILE_RGBA(Color.r, Color.g, Color.b);
|
||||
}
|
||||
|
||||
@ -4548,7 +4548,8 @@ namespace SVG
|
||||
|
||||
if (!m_sLivePath.empty())
|
||||
{
|
||||
NSFile::CFileBinary::Remove(m_sLivePath);
|
||||
NSFile::CFileBinary file;
|
||||
file.Remove(m_sLivePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -346,6 +346,8 @@ int CHtmlFile::Convert(const std::vector<std::wstring>& arFiles, const std::wstr
|
||||
|
||||
oBuilder.WriteString(L"</destination>");
|
||||
|
||||
NSFile::CFileBinary file;
|
||||
|
||||
std::vector<std::wstring> arTmpFiles;
|
||||
for (std::vector<std::wstring>::const_iterator iter = arFiles.begin(); iter != arFiles.end(); iter++)
|
||||
{
|
||||
@ -373,12 +375,14 @@ int CHtmlFile::Convert(const std::vector<std::wstring>& arFiles, const std::wstr
|
||||
}
|
||||
|
||||
std::wstring sTmpFile = NSFile::CFileBinary::CreateTempFileWithUniqueName(sTmpDir, L"HTM");
|
||||
if (NSFile::CFileBinary::Exists(sTmpFile))
|
||||
NSFile::CFileBinary::Remove(sTmpFile);
|
||||
|
||||
NSFile::CFileBinary file;
|
||||
if (file.Exists(sTmpFile))
|
||||
file.Remove(sTmpFile);
|
||||
|
||||
sTmpFile = sTmpFile + L".html";
|
||||
|
||||
NSFile::CFileBinary::Copy(sFilePath, sTmpFile);
|
||||
file.Copy(sFilePath, sTmpFile);
|
||||
oBuilder.WriteEncodeXmlString(CorrectHtmlPath(sTmpFile));
|
||||
arTmpFiles.push_back(sTmpFile);
|
||||
}
|
||||
@ -472,7 +476,7 @@ int CHtmlFile::Convert(const std::vector<std::wstring>& arFiles, const std::wstr
|
||||
CloseHandle(processinfo.hProcess);
|
||||
CloseHandle(processinfo.hThread);
|
||||
|
||||
NSFile::CFileBinary::Remove(sTempFileForParams);
|
||||
file.Remove(sTempFileForParams);
|
||||
#endif
|
||||
|
||||
#ifdef LINUX
|
||||
@ -557,11 +561,12 @@ int CHtmlFile::Convert(const std::vector<std::wstring>& arFiles, const std::wstr
|
||||
|
||||
for (std::vector<std::wstring>::iterator i = arTmpFiles.begin(); i != arTmpFiles.end(); i++)
|
||||
{
|
||||
NSFile::CFileBinary::Remove(*i);
|
||||
NSFile::CFileBinary file;
|
||||
file.Remove(*i);
|
||||
}
|
||||
arTmpFiles.clear();
|
||||
|
||||
NSFile::CFileBinary::Remove(sTempFileForParams);
|
||||
file.Remove(sTempFileForParams);
|
||||
return nReturnCode;
|
||||
}
|
||||
|
||||
@ -1069,8 +1074,9 @@ namespace NSMht
|
||||
#endif
|
||||
|
||||
// под линуксом предыдущая функция создает файл!!!
|
||||
if (NSFile::CFileBinary::Exists(m_sFolder))
|
||||
NSFile::CFileBinary::Remove(m_sFolder);
|
||||
NSFile::CFileBinary file;
|
||||
if (file.Exists(m_sFolder))
|
||||
file.Remove(m_sFolder);
|
||||
|
||||
NSDirectory::CreateDirectory(m_sFolder);
|
||||
|
||||
|
||||
@ -1175,7 +1175,8 @@ namespace NSHtmlRenderer
|
||||
RELEASEARRAYOBJECTS(pOutput);
|
||||
RELEASEARRAYOBJECTS(pData);
|
||||
|
||||
NSFile::CFileBinary::Remove(strTempFont);
|
||||
NSFile::CFileBinary file;
|
||||
file.Remove(strTempFont);
|
||||
}
|
||||
|
||||
NSFile::CFileBinary oFileFontFileJS_type;
|
||||
@ -2090,7 +2091,8 @@ namespace NSHtmlRenderer
|
||||
|
||||
oFilePages.CloseFile();
|
||||
|
||||
NSFile::CFileBinary::Remove(m_strDstDirectoryFiles + L"/document_temp.bin");
|
||||
NSFile::CFileBinary file;
|
||||
file.Remove(m_strDstDirectoryFiles + L"/document_temp.bin");
|
||||
|
||||
if (bIsNoBase64)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user