Commit 80863ae2 authored by Alexey Golubev's avatar Alexey Golubev

v5.0.4

parents 6da196e4 f53c3d9f
...@@ -7125,21 +7125,22 @@ public: ...@@ -7125,21 +7125,22 @@ public:
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(nChartIndex) + L".xlsx"; 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); if (oXlsxSerializer.writeChartXlsx(sXlsxPath, *pChartSpace))
{
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
long rIdXlsx;
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename; m_oFileWriter.m_pDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rIdXlsx);
long rIdXlsx; m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_pContentTypes->AddDefault(L"xlsx");
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
pChartSpace->m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData();
m_oFileWriter.m_pDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rIdXlsx); pChartSpace->m_oChartSpace.m_externalData->m_id = new std::wstring();
m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_pContentTypes->AddDefault(L"xlsx"); pChartSpace->m_oChartSpace.m_externalData->m_id->append(L"rId");
pChartSpace->m_oChartSpace.m_externalData->m_id->append(std::to_wstring(rIdXlsx));
pChartSpace->m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData(); pChartSpace->m_oChartSpace.m_externalData->m_autoUpdate = new OOX::Spreadsheet::CT_Boolean();
pChartSpace->m_oChartSpace.m_externalData->m_id = new std::wstring(); pChartSpace->m_oChartSpace.m_externalData->m_autoUpdate->m_val = new bool(false);
pChartSpace->m_oChartSpace.m_externalData->m_id->append(L"rId"); }
pChartSpace->m_oChartSpace.m_externalData->m_id->append(std::to_wstring(rIdXlsx));
pChartSpace->m_oChartSpace.m_externalData->m_autoUpdate = new OOX::Spreadsheet::CT_Boolean();
pChartSpace->m_oChartSpace.m_externalData->m_autoUpdate->m_val = new bool(false);
//save chart.xml //save chart.xml
NSStringUtils::CStringBuilder sw; NSStringUtils::CStringBuilder sw;
......
...@@ -658,8 +658,7 @@ namespace BinXlsxRW{ ...@@ -658,8 +658,7 @@ namespace BinXlsxRW{
std::wstring wb, sheetFrom, sheetTo; std::wstring wb, sheetFrom, sheetTo;
int nRow1, nCol1, nRow2, nCol2; int nRow1, nCol1, nRow2, nCol2;
if(OOX::Spreadsheet::CCell::parse3DRef(*pStrRef->m_f, wb, sheetFrom, sheetTo, nRow1, nCol1, nRow2, nCol2) && if(OOX::Spreadsheet::CCell::parse3DRef(*pStrRef->m_f, wb, sheetFrom, sheetTo, nRow1, nCol1, nRow2, nCol2) &&
sheetFrom.length() > 0 && 0 == wb.length() && 0 == sheetTo.length() && sheetFrom.length() > 0 && 0 == sheetTo.length() && NULL != pStrRef->m_strCache)
NULL != pStrRef->m_strCache)
{ {
bool bRow = nRow1 == nRow2; bool bRow = nRow1 == nRow2;
if(bUpdateRange) if(bUpdateRange)
...@@ -727,7 +726,7 @@ namespace BinXlsxRW{ ...@@ -727,7 +726,7 @@ namespace BinXlsxRW{
std::wstring wb, sheetFrom, sheetTo; std::wstring wb, sheetFrom, sheetTo;
int nRow1, nCol1, nRow2, nCol2; int nRow1, nCol1, nRow2, nCol2;
if(OOX::Spreadsheet::CCell::parse3DRef(*pNumRef->m_f, wb, sheetFrom, sheetTo, nRow1, nCol1, nRow2, nCol2) && if(OOX::Spreadsheet::CCell::parse3DRef(*pNumRef->m_f, wb, sheetFrom, sheetTo, nRow1, nCol1, nRow2, nCol2) &&
sheetFrom.length() > 0 && 0 == wb.length() && 0 == sheetTo.length() && NULL != pNumRef->m_numCache) sheetFrom.length() > 0 && 0 == sheetTo.length() && NULL != pNumRef->m_numCache)
{ {
bool bRow = nRow1 == nRow2; bool bRow = nRow1 == nRow2;
if(bUpdateRange) if(bUpdateRange)
......
...@@ -181,20 +181,22 @@ namespace BinXlsxRW{ ...@@ -181,20 +181,22 @@ namespace BinXlsxRW{
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(lChartNumber) + L".xlsx"; std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(lChartNumber) + L".xlsx";
std::wstring sXlsxPath = sEmbedingPath + FILE_SEPARATOR_STR + sXlsxFilename; std::wstring sXlsxPath = sEmbedingPath + FILE_SEPARATOR_STR + sXlsxFilename;
writeChartXlsx(sXlsxPath, oChartSpace); if (writeChartXlsx(sXlsxPath, oChartSpace))
pReader->m_pRels->m_pManager->m_pContentTypes->AddDefault(L"xlsx"); {
pReader->m_pRels->m_pManager->m_pContentTypes->AddDefault(L"xlsx");
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
long rId; std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType(); long rId;
m_pExternalDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rId); std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
m_pExternalDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rId);
oChartSpace.m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData();
oChartSpace.m_oChartSpace.m_externalData->m_id = new std::wstring(); oChartSpace.m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData();
oChartSpace.m_oChartSpace.m_externalData->m_id->append(L"rId"); oChartSpace.m_oChartSpace.m_externalData->m_id = new std::wstring();
oChartSpace.m_oChartSpace.m_externalData->m_id->append(std::to_wstring(rId)); oChartSpace.m_oChartSpace.m_externalData->m_id->append(L"rId");
oChartSpace.m_oChartSpace.m_externalData->m_autoUpdate = new OOX::Spreadsheet::CT_Boolean(); oChartSpace.m_oChartSpace.m_externalData->m_id->append(std::to_wstring(rId));
oChartSpace.m_oChartSpace.m_externalData->m_autoUpdate->m_val = new bool(false); oChartSpace.m_oChartSpace.m_externalData->m_autoUpdate = new OOX::Spreadsheet::CT_Boolean();
oChartSpace.m_oChartSpace.m_externalData->m_autoUpdate->m_val = new bool(false);
}
} }
std::wstring strFilepath = sFilepath; std::wstring strFilepath = sFilepath;
...@@ -233,7 +235,7 @@ namespace BinXlsxRW{ ...@@ -233,7 +235,7 @@ namespace BinXlsxRW{
m_bIsNoBase64 = bIsNoBase64; m_bIsNoBase64 = bIsNoBase64;
} }
void CXlsxSerializer::writeChartXlsx(const std::wstring& sDstFile, const OOX::Spreadsheet::CChartSpace& oChart) bool CXlsxSerializer::writeChartXlsx(const std::wstring& sDstFile, const OOX::Spreadsheet::CChartSpace& oChart)
{ {
//анализируем chart //анализируем chart
BinXlsxRW::ChartWriter helper; BinXlsxRW::ChartWriter helper;
...@@ -252,11 +254,15 @@ namespace BinXlsxRW{ ...@@ -252,11 +254,15 @@ namespace BinXlsxRW{
helper.toXlsx(oXlsx); helper.toXlsx(oXlsx);
//write //write
OOX::CContentTypes oContentTypes; OOX::CContentTypes oContentTypes;
oXlsx.Write(oPath, oContentTypes); bool res = oXlsx.Write(oPath, oContentTypes);
//zip if (res)
COfficeUtils oOfficeUtils(NULL); {
oOfficeUtils.CompressFileOrDirectory(sTempDir, sDstFile, true); //zip
COfficeUtils oOfficeUtils(NULL);
oOfficeUtils.CompressFileOrDirectory(sTempDir, sDstFile, true);
}
//clean //clean
NSDirectory::DeleteDirectory(sTempDir); NSDirectory::DeleteDirectory(sTempDir);
return res;
} }
}; };
...@@ -72,7 +72,7 @@ namespace BinXlsxRW { ...@@ -72,7 +72,7 @@ namespace BinXlsxRW {
void setDrawingConverter(NSBinPptxRW::CDrawingConverter* pDrawingConverter); void setDrawingConverter(NSBinPptxRW::CDrawingConverter* pDrawingConverter);
void setIsNoBase64 (bool bIsNoBase64); void setIsNoBase64 (bool bIsNoBase64);
void writeChartXlsx (const std::wstring& sDstFile ,const OOX::Spreadsheet::CChartSpace& oChart); bool writeChartXlsx (const std::wstring& sDstFile ,const OOX::Spreadsheet::CChartSpace& oChart);
}; };
} }
#endif // #ifndef XLSX_SERIALIZER #endif // #ifndef XLSX_SERIALIZER
...@@ -158,6 +158,8 @@ namespace PdfReader ...@@ -158,6 +158,8 @@ namespace PdfReader
} }
else else
{ {
if (!seName)
seName = new StringExt("");
// TO DO: Error "Unknown font type" // TO DO: Error "Unknown font type"
pFont = new Gr8BitFont(pXref, sTag, oID, seName, fontUnknownType, pFontDict, pGlobalParams); pFont = new Gr8BitFont(pXref, sTag, oID, seName, fontUnknownType, pFontDict, pGlobalParams);
} }
......
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