Commit 95c472c1 authored by Alexey Golubev's avatar Alexey Golubev

Merge branch 'hotfix/v4.3.2'

parents 2dcef226 51c77c3a
...@@ -47,13 +47,11 @@ namespace Writers ...@@ -47,13 +47,11 @@ namespace Writers
}; };
std::vector<ChartElem*> m_aCharts; std::vector<ChartElem*> m_aCharts;
ContentTypesWriter& m_oContentTypesWriter; ContentTypesWriter& m_oContentTypesWriter;
int nChartCount;
public: public:
std::wstring m_sDir; std::wstring m_sDir;
public: public:
ChartWriter(std::wstring sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter) ChartWriter(std::wstring sDir, ContentTypesWriter& oContentTypesWriter):m_sDir(sDir),m_oContentTypesWriter(oContentTypesWriter)
{ {
nChartCount = 0;
} }
~ChartWriter() ~ChartWriter()
{ {
...@@ -91,28 +89,18 @@ namespace Writers ...@@ -91,28 +89,18 @@ namespace Writers
} }
} }
} }
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* pChartElem = new ChartElem(); ChartElem* pChartElem = new ChartElem();
pChartElem->content = content; pChartElem->content = content;
pChartElem->index = nChartCount + 1; pChartElem->index = index;
nChartCount++;
pChartElem->filename = L"chart" + std::to_wstring(pChartElem->index) + L".xml"; pChartElem->filename = L"chart" + std::to_wstring(pChartElem->index) + L".xml";
sRelsName = L"charts/" + pChartElem->filename; sRelsName = L"charts/" + pChartElem->filename;
sFileName = pChartElem->filename; sFileName = pChartElem->filename;
index = pChartElem->index;
m_aCharts.push_back(pChartElem); m_aCharts.push_back(pChartElem);
} }
int getChartCount()
{
return nChartCount;
}
void setChartCount(int val)
{
nChartCount = val;
}
}; };
} }
#endif // #ifndef CHART_WRITER #endif // #ifndef CHART_WRITER
...@@ -6287,15 +6287,11 @@ public: ...@@ -6287,15 +6287,11 @@ public:
std::wstring sDrawingProperty = oCDrawingProperty.Write(); std::wstring sDrawingProperty = oCDrawingProperty.Write();
if(false == sDrawingProperty.empty()) if(false == sDrawingProperty.empty())
{ {
m_oFileWriter.m_pDrawingConverter->SetDocumentChartsCount(m_oFileWriter.m_oChartWriter.getChartCount());
long nCurPos = m_oBufferedStream.GetPos(); long nCurPos = m_oBufferedStream.GetPos();
std::wstring sDrawingXml; std::wstring sDrawingXml;
m_oFileWriter.m_pDrawingConverter->SaveObjectEx(oCDrawingProperty.DataPos, oCDrawingProperty.DataLength, sDrawingProperty, XMLWRITER_DOC_TYPE_DOCX, sDrawingXml); m_oFileWriter.m_pDrawingConverter->SaveObjectEx(oCDrawingProperty.DataPos, oCDrawingProperty.DataLength, sDrawingProperty, XMLWRITER_DOC_TYPE_DOCX, sDrawingXml);
m_oBufferedStream.Seek(nCurPos); m_oBufferedStream.Seek(nCurPos);
m_oFileWriter.m_oChartWriter.setChartCount(m_oFileWriter.m_pDrawingConverter->GetDocumentChartsCount());
if( false == sDrawingXml.empty()) if( false == sDrawingXml.empty())
{ {
GetRunStringWriter().WriteString(sDrawingXml); GetRunStringWriter().WriteString(sDrawingXml);
...@@ -6606,7 +6602,10 @@ public: ...@@ -6606,7 +6602,10 @@ public:
oBinaryChartReader.ReadCT_ChartSpace(length, &pChartSpace->m_oChartSpace); oBinaryChartReader.ReadCT_ChartSpace(length, &pChartSpace->m_oChartSpace);
//save xlsx //save xlsx
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(m_oFileWriter.m_oChartWriter.getChartCount() + 1) + L".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; std::wstring sXlsxPath = pathChartsWorksheetDir.GetPath() + FILE_SEPARATOR_STR + sXlsxFilename;
BinXlsxRW::CXlsxSerializer oXlsxSerializer; BinXlsxRW::CXlsxSerializer oXlsxSerializer;
oXlsxSerializer.writeChartXlsx(sXlsxPath, *pChartSpace); oXlsxSerializer.writeChartXlsx(sXlsxPath, *pChartSpace);
...@@ -6629,7 +6628,6 @@ public: ...@@ -6629,7 +6628,6 @@ public:
std::wstring sFilename; std::wstring sFilename;
std::wstring sRelsName; std::wstring sRelsName;
int nChartIndex;
std::wstring sContent = sw.GetData(); std::wstring sContent = sw.GetData();
m_oFileWriter.m_oChartWriter.AddChart(sContent, sRelsName, sFilename, nChartIndex); m_oFileWriter.m_oChartWriter.AddChart(sContent, sRelsName, sFilename, nChartIndex);
......
...@@ -23,7 +23,7 @@ if "%platform%" == "win_64" ( ...@@ -23,7 +23,7 @@ if "%platform%" == "win_64" (
if exist "%SCRIPTPATH%%platform%\icu.zip" ( if exist "%SCRIPTPATH%%platform%\icu.zip" (
echo "icu already downloaded" echo "icu already downloaded"
) else ( ) 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" 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