Commit 599ff507 authored by ElenaSubbotina's avatar ElenaSubbotina

Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop

parents 037e2efa 4fb3327e
......@@ -1969,6 +1969,13 @@ namespace NSFontConverter
{
nPos = m_pTables[nIndex].nOffset + 2;
m_nCMapsCount = GetU16BE( nPos, &m_bSuccess);
if (0 == m_nCMapsCount)
{
m_bSuccess = false;
return;
}
nPos += 2;
if ( !m_bSuccess )
return;
......
......@@ -380,12 +380,13 @@ namespace NSOnlineOfficeBinToPdf
}
}
pRenderer->PenDashPattern(pDash, nCountDash);
delete[] pDash;
pRenderer->PenDashPattern(pDash, nCountDash);
delete[] pDash;
}
}
default:
pRenderer->put_PenDashStyle(nDashType);
pRenderer->put_PenDashStyle(nDashType);
break;
}
break;
......@@ -518,20 +519,7 @@ namespace NSOnlineOfficeBinToPdf
for (LONG lIndex = 0; lIndex < lColorsCount; lIndex++)
{
pPositions[lIndex] = ReadInt(current, curindex) / 100000.0;
if (c_nPDFWriter == lRendererType)
pColors[lIndex] = ReadInt(current, curindex);
else
{
BYTE _b = *current++;
BYTE _g = *current++;
BYTE _r = *current++;
BYTE _a = *current++;
curindex += 4;
pColors[lIndex] = ((_b << 24) & 0xFF000000) | ((_g << 16) & 0xFF0000) | ((_r << 8) & 0xFF00) | _a;
}
pColors[lIndex] = ReadInt(current, curindex);
}
pRenderer->put_BrushGradientColors(pColors, pPositions, lColorsCount);
......
......@@ -488,10 +488,21 @@ void CPdfRenderer::SetTempFolder(const std::wstring& wsPath)
NSDirectory::DeleteDirectory(m_wsTempFolder);
int nCounter = 0;
m_wsTempFolder = wsPath + L"\\PDF\\";
m_wsTempFolder = wsPath;
int nPathLen = (int)m_wsTempFolder.length();
if (nPathLen > 0)
{
const wchar_t* pData = m_wsTempFolder.c_str();
if ((pData[nPathLen - 1] != '/') && (pData[nPathLen - 1] != '\\'))
m_wsTempFolder += L"/";
m_wsTempFolder += L"PDF";
}
std::wstring sTest = m_wsTempFolder;
while (NSDirectory::Exists(m_wsTempFolder))
{
m_wsTempFolder = wsPath + L"\\PDF_" + std::to_wstring(nCounter) + L"\\";
m_wsTempFolder = sTest + L"/PDF_" + std::to_wstring(nCounter);
nCounter++;
}
NSDirectory::CreateDirectory(m_wsTempFolder);
......
......@@ -195,12 +195,24 @@ namespace PdfWriter
if (m_pPattern)
delete[] m_pPattern;
}
CDashMode(const CDashMode& oSrc)
{
m_pPattern = NULL;
Set(oSrc.m_pPattern, oSrc.m_unCount, oSrc.m_dPhase);
}
CDashMode& operator=(const CDashMode& oSrc)
{
m_pPattern = NULL;
Set(oSrc.m_pPattern, oSrc.m_unCount, oSrc.m_dPhase);
return *this;
}
void Set(const double* pPattern, unsigned int unCount, double dPhase)
{
if (!pPattern || !unCount)
return;
if (m_pPattern)
if (m_pPattern && m_pPattern != pPattern)
delete[] m_pPattern;
m_pPattern = new double[unCount];
......
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