Commit 9ecf5b78 authored by Alexey Golubev's avatar Alexey Golubev Committed by GitHub

Merge pull request #23 from ONLYOFFICE/hotfix/v4.3.2

Hotfix/v4.3.2
parents 1d003863 774561bd
......@@ -45,13 +45,11 @@ namespace Writers
int index;
};
std::vector<_chartElem> m_aCharts;
int nChartCount;
public:
std::wstring m_sDir;
ChartWriter(std::wstring sDir) : m_sDir(sDir)
{
nChartCount = 0;
}
~ChartWriter()
{
......@@ -80,30 +78,20 @@ namespace Writers
}
return true;
}
void AddChart(std::wstring& content, std::wstring& sRelsName, std::wstring& sFileName, int& index)
void AddChart(std::wstring& content, std::wstring& sRelsName, std::wstring& sFileName, int index)
{
_chartElem oChartElem;
oChartElem.content = content;
oChartElem.index = nChartCount + 1;
nChartCount++;
oChartElem.index = index;
oChartElem.filename = L"chart" + std::to_wstring(oChartElem.index) + L".xml";
sRelsName = L"charts/" + oChartElem.filename;
sFileName = oChartElem.filename;
index = oChartElem.index;
m_aCharts.push_back(oChartElem);
}
int getChartCount()
{
return nChartCount;
}
void setChartCount(int val)
{
nChartCount = val;
}
};
}
#endif // #ifndef CHART_WRITER
......@@ -6292,15 +6292,11 @@ public:
std::wstring sDrawingProperty = oCDrawingProperty.Write();
if(false == sDrawingProperty.empty())
{
m_oFileWriter.m_pDrawingConverter->SetDocumentChartsCount(m_oFileWriter.m_oChartWriter.getChartCount());
long nCurPos = m_oBufferedStream.GetPos();
std::wstring sDrawingXml;
m_oFileWriter.m_pDrawingConverter->SaveObjectEx(oCDrawingProperty.DataPos, oCDrawingProperty.DataLength, sDrawingProperty, XMLWRITER_DOC_TYPE_DOCX, sDrawingXml);
m_oBufferedStream.Seek(nCurPos);
m_oFileWriter.m_oChartWriter.setChartCount(m_oFileWriter.m_pDrawingConverter->GetDocumentChartsCount());
if( false == sDrawingXml.empty())
{
GetRunStringWriter().WriteString(sDrawingXml);
......@@ -6606,8 +6602,11 @@ public:
OOX::Spreadsheet::CChartSpace* pChartSpace = new OOX::Spreadsheet::CChartSpace();
oBinaryChartReader.ReadCT_ChartSpace(length, &pChartSpace->m_oChartSpace);
//save xlsx
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(m_oFileWriter.m_oChartWriter.getChartCount() + 1) + L".xlsx";
//save xlsx
_INT32 nChartCount = m_oFileWriter.m_pDrawingConverter->GetDocumentChartsCount();
_INT32 nChartIndex = nChartCount + 1;
m_oFileWriter.m_pDrawingConverter->SetDocumentChartsCount(nChartCount + 1);
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(nChartIndex) + L".xlsx";
std::wstring sXlsxPath = pathChartsWorksheetDir.GetPath() + FILE_SEPARATOR_STR + sXlsxFilename;
BinXlsxRW::CXlsxSerializer oXlsxSerializer;
oXlsxSerializer.writeChartXlsx(sXlsxPath, *pChartSpace);
......@@ -6632,7 +6631,6 @@ public:
std::wstring sFilename;
std::wstring sRelsName;
int nChartIndex;
std::wstring sContent = sw.GetData();
m_oFileWriter.m_oChartWriter.AddChart(sContent, sRelsName, sFilename, nChartIndex);
......
......@@ -23,7 +23,7 @@ if "%platform%" == "win_64" (
if exist "%SCRIPTPATH%%platform%\icu.zip" (
echo "icu already downloaded"
) else (
Powershell.exe Invoke-WebRequest -OutFile %platform%\icu.zip "%URL%"
Powershell.exe Invoke-WebRequest -OutFile %platform%\icu.zip -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox "%URL%"
)
SET UNSIP_PROGRAMM="C:\Program Files\7-Zip\7z.exe"
......
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