mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
fix bug
This commit is contained in:
@ -76,7 +76,7 @@ namespace NSDoctRenderer
|
||||
JSSmart<CJSValue> m_value;
|
||||
|
||||
public:
|
||||
CDocBuilderValue_Private() { m_context = NULL; }
|
||||
CDocBuilderValue_Private() : m_context(NULL) {}
|
||||
~CDocBuilderValue_Private() {}
|
||||
void Clear() { m_value.Release(); }
|
||||
};
|
||||
@ -124,13 +124,7 @@ namespace NSDoctRenderer
|
||||
class CDocBuilderParams
|
||||
{
|
||||
public:
|
||||
CDocBuilderParams()
|
||||
{
|
||||
m_bCheckFonts = false;
|
||||
m_sWorkDir = L"";
|
||||
m_bSaveWithDoctrendererMode = false;
|
||||
m_sArgumentJSON = "";
|
||||
}
|
||||
CDocBuilderParams() : m_bCheckFonts(false), m_sWorkDir(L""), m_bSaveWithDoctrendererMode(false), m_sArgumentJSON("") {}
|
||||
|
||||
public:
|
||||
bool m_bCheckFonts;
|
||||
@ -177,28 +171,13 @@ namespace NSDoctRenderer
|
||||
|
||||
NSDoctRenderer::CDocBuilder* m_pParent;
|
||||
public:
|
||||
CDocBuilder_Private()
|
||||
{
|
||||
m_pParent = NULL;
|
||||
m_pWorker = NULL;
|
||||
|
||||
m_nFileType = -1;
|
||||
|
||||
m_sTmpFolder = NSFile::CFileBinary::GetTempPath();
|
||||
|
||||
CDocBuilder_Private() : m_bIsNotUseConfigAllFontsDir(false), m_sTmpFolder(NSFile::CFileBinary::GetTempPath()), m_nFileType(-1),
|
||||
m_pWorker(NULL), m_pAdditionalData(NULL), m_bIsInit(false), m_bIsCacheScript(true), m_bIsServerSafeVersion(false),
|
||||
m_sGlobalVariable(""), m_bIsGlobalVariableUse(false), m_pParent(NULL)
|
||||
{
|
||||
// под линуксом предыдущая функция создает файл!!!
|
||||
if (NSFile::CFileBinary::Exists(m_sTmpFolder))
|
||||
NSFile::CFileBinary::Remove(m_sTmpFolder);
|
||||
|
||||
m_pAdditionalData = NULL;
|
||||
m_bIsInit = false;
|
||||
m_bIsCacheScript = true;
|
||||
|
||||
m_sGlobalVariable = "";
|
||||
m_bIsGlobalVariableUse = false;
|
||||
|
||||
m_bIsNotUseConfigAllFontsDir = false;
|
||||
m_bIsServerSafeVersion = false;
|
||||
}
|
||||
|
||||
void Init()
|
||||
@ -444,7 +423,7 @@ namespace NSDoctRenderer
|
||||
|
||||
BYTE* pDataDst = NULL;
|
||||
int nDataDstLen = 0;
|
||||
if (NSFile::CBase64Converter::Decode(sBase64.c_str(), (int)sBase64.length(), pDataDst, nDataLen))
|
||||
if (NSFile::CBase64Converter::Decode(sBase64.c_str(), (int)sBase64.length(), pDataDst, nDataDstLen))
|
||||
{
|
||||
NSFile::CFileBinary oFileDst;
|
||||
if (oFileDst.CreateFileW(to))
|
||||
@ -951,7 +930,6 @@ namespace NSDoctRenderer
|
||||
{
|
||||
std::vector<std::wstring>* arSdkFiles = NULL;
|
||||
|
||||
std::wstring sResourceFile;
|
||||
switch (m_nFileType)
|
||||
{
|
||||
case 0:
|
||||
@ -982,9 +960,9 @@ namespace NSDoctRenderer
|
||||
|
||||
if (NULL != arSdkFiles)
|
||||
{
|
||||
for (std::vector<std::wstring>::iterator i = arSdkFiles->begin(); i != arSdkFiles->end(); i++)
|
||||
for (const std::wstring& i : *arSdkFiles)
|
||||
{
|
||||
strScript += ReadScriptFile(*i);
|
||||
strScript += ReadScriptFile(i);
|
||||
strScript += "\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ public:
|
||||
CGraphicsEmbed() : m_pInternal(new NSGraphics::CGraphics()) {}
|
||||
~CGraphicsEmbed() { RELEASEOBJECT(m_pInternal); }
|
||||
|
||||
virtual void* getObject() { return (void*)m_pInternal; }
|
||||
virtual void* getObject() override { return (void*)m_pInternal; }
|
||||
|
||||
public:
|
||||
JSSmart<CJSValue> init(JSSmart<CJSValue> context, JSSmart<CJSValue> width_px, JSSmart<CJSValue> height_px, JSSmart<CJSValue> width_mm, JSSmart<CJSValue> height_mm);
|
||||
|
||||
@ -14,7 +14,7 @@ public:
|
||||
CMemoryStreamEmbed() : m_pInternal(new NSMemoryStream::CMemoryStream()) {}
|
||||
~CMemoryStreamEmbed() { RELEASEOBJECT(m_pInternal); }
|
||||
|
||||
virtual void* getObject() { return (void*)m_pInternal; }
|
||||
virtual void* getObject() override { return (void*)m_pInternal; }
|
||||
|
||||
public:
|
||||
JSSmart<CJSValue> Copy(JSSmart<CJSValue> stream, JSSmart<CJSValue> pos, JSSmart<CJSValue> len);
|
||||
|
||||
@ -14,7 +14,7 @@ public:
|
||||
CNativeControlEmbed() : m_pInternal(new NSNativeControl::CNativeControl()) {}
|
||||
~CNativeControlEmbed() { RELEASEOBJECT(m_pInternal); }
|
||||
|
||||
virtual void* getObject() { return (void*)m_pInternal; }
|
||||
virtual void* getObject() override { return (void*)m_pInternal; }
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -68,10 +68,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
CZipWorker()
|
||||
{
|
||||
m_sWorkerFolder = L"";
|
||||
}
|
||||
CZipWorker() : m_sWorkerFolder(L"") {}
|
||||
|
||||
~CZipWorker()
|
||||
{
|
||||
@ -137,9 +134,9 @@ public:
|
||||
|
||||
url_correct2(m_sTmpFolder);
|
||||
int nStart = (int)m_sTmpFolder.length();
|
||||
for (std::vector<std::wstring>::iterator i = arFiles.begin(); i != arFiles.end(); i++)
|
||||
for (const std::wstring& i : arFiles)
|
||||
{
|
||||
std::wstring sTmp = *i;
|
||||
std::wstring sTmp = i;
|
||||
url_correct2(sTmp);
|
||||
|
||||
m_arFiles.push_back(sTmp.substr(nStart + 1));
|
||||
@ -235,27 +232,21 @@ public:
|
||||
// для добавления картинок -------------------------------------
|
||||
CImagesWorker* m_pWorker;
|
||||
|
||||
public:
|
||||
CMemoryStreamEmbed* m_pStream;
|
||||
|
||||
CNativeControl()
|
||||
{
|
||||
m_pStream = NULL;
|
||||
m_pChanges = NULL;
|
||||
|
||||
m_nCurrentChangesNumber = -1;
|
||||
m_nMaxChangesNumber = -1;
|
||||
|
||||
m_pSaveBinary = NULL;
|
||||
m_nSaveLen = 0;
|
||||
m_nSaveBinaryLen = 0;
|
||||
|
||||
m_sConsoleLogFile = L"";
|
||||
|
||||
m_nCurrentChangesBuilderIndex = 0;
|
||||
|
||||
m_pWorker = NULL;
|
||||
}
|
||||
public:
|
||||
CNativeControl() :
|
||||
m_pChanges(NULL),
|
||||
m_nCurrentChangesNumber(-1),
|
||||
m_nMaxChangesNumber(-1),
|
||||
m_pSaveBinary(NULL),
|
||||
m_nSaveLen(0),
|
||||
m_nSaveBinaryLen(0),
|
||||
m_sConsoleLogFile(L""),
|
||||
m_nCurrentChangesBuilderIndex(0),
|
||||
m_pWorker(NULL),
|
||||
m_pStream(NULL)
|
||||
{}
|
||||
~CNativeControl()
|
||||
{
|
||||
RELEASEOBJECT(m_pStream);
|
||||
@ -415,9 +406,9 @@ public:
|
||||
|
||||
std::vector<NSFonts::CFontInfo*>* pFonts = pApplication->GetList()->GetFonts();
|
||||
|
||||
for (std::vector<NSFonts::CFontInfo*>::iterator i = pFonts->begin(); i < pFonts->end(); i++)
|
||||
for (NSFonts::CFontInfo* i : *pFonts)
|
||||
{
|
||||
NSFonts::CFontInfo* pCurrent = *i;
|
||||
NSFonts::CFontInfo* pCurrent = i;
|
||||
|
||||
size_t pos1 = pCurrent->m_wsFontPath.find_last_of(wchar_t('/'));
|
||||
size_t pos2 = pCurrent->m_wsFontPath.find_last_of(wchar_t('\\'));
|
||||
@ -494,7 +485,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
void CheckFiles(CArray<std::wstring>& oFiles)
|
||||
void CheckFiles(const CArray<std::wstring>& oFiles)
|
||||
{
|
||||
int nMax = 0;
|
||||
int nLen = 0;
|
||||
@ -537,7 +528,7 @@ public:
|
||||
return Open_excel(oFiles, nStart);
|
||||
}
|
||||
|
||||
int Open_docx(CArray<std::wstring>& oFiles, int nStart)
|
||||
int Open_docx(const CArray<std::wstring>& oFiles, int nStart)
|
||||
{
|
||||
m_pDataCur = m_pData;
|
||||
m_pDataCur += 4;
|
||||
@ -592,7 +583,7 @@ public:
|
||||
return i;
|
||||
}
|
||||
|
||||
int Open_excel(CArray<std::wstring>& oFiles, int nStart)
|
||||
int Open_excel(const CArray<std::wstring>& oFiles, int nStart)
|
||||
{
|
||||
m_pDataCur = m_pData;
|
||||
m_pDataCur += 4;
|
||||
@ -645,7 +636,7 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
void OpenFull(CArray<std::wstring>& oFiles)
|
||||
void OpenFull(const CArray<std::wstring>& oFiles)
|
||||
{
|
||||
// определяем размер
|
||||
int nCount = (int)oFiles.GetCount();
|
||||
@ -703,7 +694,7 @@ public:
|
||||
*((int*)m_pData) = nCountData;
|
||||
}
|
||||
|
||||
void OpenFull_excel(CArray<std::wstring>& oFiles)
|
||||
void OpenFull_excel(const CArray<std::wstring>& oFiles)
|
||||
{
|
||||
// определяем размер
|
||||
int nCount = (int)oFiles.GetCount();
|
||||
|
||||
Reference in New Issue
Block a user