Compare commits

...

9 Commits

Author SHA1 Message Date
21f7f6ed5b fix bug #36335 2017-11-15 13:28:19 +03:00
80863ae25b v5.0.4 2017-11-13 17:46:10 +03:00
6da196e426 fix bug #36311 2017-11-13 11:48:28 +03:00
d220cc8c79 removed stubs on writing tblLayout 2017-11-09 19:56:04 +03:00
f53c3d9f50 Merge pull request #51 from ONLYOFFICE/feature/pre5.0.4
pdf reader bug
2017-11-07 10:40:46 +03:00
b0f0f656af Merge pull request #50 from ONLYOFFICE/feature/bug36176
fix bug 36176
2017-11-02 18:00:26 +03:00
e69c1677b2 v5.0.3 2017-10-31 18:49:25 +03:00
e1340c63ec pdf reader bug 2017-10-30 15:06:43 +03:00
867438833b fix bug 36176 2017-10-30 13:40:57 +03:00
16 changed files with 2824 additions and 1612 deletions

View File

@ -55,7 +55,9 @@ namespace Writers
oFile.CreateFileW(filePath.GetPath());
oFile.WriteStringUTF8( std::wstring(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>")));
oFile.WriteStringUTF8( std::wstring(_T("<w:document \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \

View File

@ -60,10 +60,44 @@ namespace Writers
std::wstring rId;
SimpleTypes::EHdrFtr eType;
};
static std::wstring g_string_hdr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:hdr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_hdr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<w:hdr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_hdr_End = _T("</w:hdr>");
static std::wstring g_string_ftr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:ftr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_ftr_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<w:ftr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
mc:Ignorable=\"w14 wp14\">");
static std::wstring g_string_ftr_End = _T("</w:ftr>");
static std::wstring g_string_footnotes_Start = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:footnotes xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");

View File

@ -2340,7 +2340,7 @@ public:
{
return Jc.empty() && TableInd.empty() && TableW.empty() && TableCellMar.empty() && TableBorders.empty() && Shd.empty() && tblpPr.empty()&& Style.empty() && Look.empty() && tblPrChange.empty() && TableCellSpacing.empty() && RowBandSize.empty() && ColBandSize.empty();
}
std::wstring Write(bool bBandSize, bool bLayout)
std::wstring Write()
{
std::wstring sRes;
sRes += L"<w:tblPr>";
@ -2364,13 +2364,8 @@ public:
sRes += (TableBorders);
if(false == Shd.empty())
sRes += (Shd);
if(bLayout)
{
if(false == Layout.empty())
sRes += (Layout);
else if(g_nCurFormatVersion < 4)
sRes += L"<w:tblLayout w:type=\"fixed\"/>";
}
if(false == Layout.empty())
sRes += (Layout);
if(false == TableCellMar.empty())
sRes += (TableCellMar);
if(false == Look.empty())
@ -2758,7 +2753,7 @@ public:
}
if(NULL != tblPr)
{
pCStringWriter->WriteString(tblPr->Write(false, true));
pCStringWriter->WriteString(tblPr->Write());
}
if(NULL != tblGridChange)
{

View File

@ -2826,7 +2826,7 @@ public:
{
CWiterTblPr oWiterTblPr;
oBinary_tblPrReader.Read_tblPrOut(length, &oWiterTblPr);
odocStyle->TablePr = oWiterTblPr.Write(true, false);
odocStyle->TablePr = oWiterTblPr.Write();
}
else if(c_oSer_sts::Style_RowPr == type)
{
@ -2922,7 +2922,7 @@ public:
oBinary_tblPrReader.Read_tblPrOut(length, &oWiterTblPr);
if(false == oWiterTblPr.IsEmpty())
ptblStylePr->Writer.WriteString(oWiterTblPr.Write(false, false));
ptblStylePr->Writer.WriteString(oWiterTblPr.Write());
}
else if(c_oSerProp_tblStylePrType::TrPr == type)
{
@ -6851,7 +6851,7 @@ public:
{
CWiterTblPr oWiterTblPr;
oBinary_tblPrReader.Read_tblPrOut(length, &oWiterTblPr);
pCStringWriter->WriteString(oWiterTblPr.Write(false, true));
pCStringWriter->WriteString(oWiterTblPr.Write());
}
else if( c_oSerDocTableType::tblGrid == type )
{
@ -7125,21 +7125,22 @@ public:
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);
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;
long rIdXlsx;
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
m_oFileWriter.m_pDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rIdXlsx);
m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_pContentTypes->AddDefault(L"xlsx");
pChartSpace->m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData();
pChartSpace->m_oChartSpace.m_externalData->m_id = new std::wstring();
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);
m_oFileWriter.m_pDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rIdXlsx);
m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_pContentTypes->AddDefault(L"xlsx");
pChartSpace->m_oChartSpace.m_externalData = new OOX::Spreadsheet::CT_ExternalData();
pChartSpace->m_oChartSpace.m_externalData->m_id = new std::wstring();
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
NSStringUtils::CStringBuilder sw;

View File

@ -658,8 +658,7 @@ namespace BinXlsxRW{
std::wstring wb, sheetFrom, sheetTo;
int 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() &&
NULL != pStrRef->m_strCache)
sheetFrom.length() > 0 && 0 == sheetTo.length() && NULL != pStrRef->m_strCache)
{
bool bRow = nRow1 == nRow2;
if(bUpdateRange)
@ -727,7 +726,7 @@ namespace BinXlsxRW{
std::wstring wb, sheetFrom, sheetTo;
int 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;
if(bUpdateRange)

View File

@ -181,20 +181,22 @@ namespace BinXlsxRW{
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(lChartNumber) + L".xlsx";
std::wstring sXlsxPath = sEmbedingPath + FILE_SEPARATOR_STR + sXlsxFilename;
writeChartXlsx(sXlsxPath, oChartSpace);
pReader->m_pRels->m_pManager->m_pContentTypes->AddDefault(L"xlsx");
if (writeChartXlsx(sXlsxPath, oChartSpace))
{
pReader->m_pRels->m_pManager->m_pContentTypes->AddDefault(L"xlsx");
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
long rId;
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
m_pExternalDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rId);
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
long 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->m_id->append(L"rId");
oChartSpace.m_oChartSpace.m_externalData->m_id->append(std::to_wstring(rId));
oChartSpace.m_oChartSpace.m_externalData->m_autoUpdate = new OOX::Spreadsheet::CT_Boolean();
oChartSpace.m_oChartSpace.m_externalData->m_autoUpdate->m_val = new bool(false);
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->m_id->append(L"rId");
oChartSpace.m_oChartSpace.m_externalData->m_id->append(std::to_wstring(rId));
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;
@ -233,7 +235,7 @@ namespace BinXlsxRW{
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
BinXlsxRW::ChartWriter helper;
@ -252,11 +254,15 @@ namespace BinXlsxRW{
helper.toXlsx(oXlsx);
//write
OOX::CContentTypes oContentTypes;
oXlsx.Write(oPath, oContentTypes);
//zip
COfficeUtils oOfficeUtils(NULL);
oOfficeUtils.CompressFileOrDirectory(sTempDir, sDstFile, true);
bool res = oXlsx.Write(oPath, oContentTypes);
if (res)
{
//zip
COfficeUtils oOfficeUtils(NULL);
oOfficeUtils.CompressFileOrDirectory(sTempDir, sDstFile, true);
}
//clean
NSDirectory::DeleteDirectory(sTempDir);
return res;
}
};

View File

@ -72,7 +72,7 @@ namespace BinXlsxRW {
void setDrawingConverter(NSBinPptxRW::CDrawingConverter* pDrawingConverter);
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

View File

@ -608,7 +608,7 @@ namespace NSPresentationEditor
{
if (bIsNamespace)
{
return _T("<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"line\"><a:avLst/></a:prstGeom>");
return _T("<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"ellipse\"><a:avLst/></a:prstGeom>");
}
return _T("<a:prstGeom prst=\"ellipse\"><a:avLst/></a:prstGeom>");
}

View File

@ -459,18 +459,31 @@ namespace OOX
}
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
{
std::wstring sXml;
std::wstring sXml = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:document";
if ( SimpleTypes::conformanceclassTransitional != m_oConformance.GetValue() )
{
sXml += _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:document w:conformance=\"");
{
sXml += L" w:conformance=\"";
sXml += m_oConformance.ToString();
sXml += _T("\" xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
}
else
{
sXml = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
sXml += L"\"";
}
sXml += L" xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
mc:Ignorable=\"w14 wp14\">";
if ( m_oBackground.IsInit() )
sXml += m_oBackground->toXML();

View File

@ -281,9 +281,43 @@ namespace OOX
std::wstring sXml;
if ( et_w_ftr == m_eType )
sXml = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:ftr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
sXml = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<w:ftr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
mc:Ignorable=\"w14 wp14\">");
else if ( et_w_hdr == m_eType )
sXml = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:hdr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 wp14\">");
sXml = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<w:hdr xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" \
xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" \
xmlns:o=\"urn:schemas-microsoft-com:office:office\" \
xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" \
xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" \
xmlns:v=\"urn:schemas-microsoft-com:vml\" \
xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" \
xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
xmlns:w10=\"urn:schemas-microsoft-com:office:word\" \
xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" \
xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" \
xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" \
xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" \
xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" \
xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" \
xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" \
mc:Ignorable=\"w14 wp14\">");
else
return;

View File

@ -60,9 +60,6 @@ namespace OOX
virtual ~CMathArgNodes()
{
}
public:
const CMathArgNodes &operator =(const XmlUtils::CXmlNode& oNode)
{
ClearItems();
@ -75,12 +72,9 @@ namespace OOX
fromXML( (XmlUtils::CXmlLiteReader&)oReader );
return *this;
}
virtual void fromXML(XmlUtils::CXmlNode& oNode);
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const
{

View File

@ -39,29 +39,166 @@ namespace OOX
{
namespace Logic
{
void CMathArgNodes::fromXML(XmlUtils::CXmlLiteReader& oReader)
void CMathArgNodes::fromXML(XmlUtils::CXmlNode& oNode)
{
sNodeName = oNode.GetName();
if(sNodeName == _T("m:deg"))
eType = et_m_deg;
else if (sNodeName == _T("m:den"))
eType = et_m_den;
else if (sNodeName == _T("m:e"))
eType = et_m_e;
else if (sNodeName == _T("m:fName"))
eType = et_m_fName;
else if (sNodeName == _T("m:lim"))
eType = et_m_lim;
else if (sNodeName == _T("m:num"))
eType = et_m_num;
else if (sNodeName == _T("m:oMath"))
eType = et_m_oMath;
else if (sNodeName == _T("m:sub"))
eType = et_m_sub;
else if (sNodeName == _T("m:sup"))
eType = et_m_sup;
else
eType = et_Unknown;
XmlUtils::CXmlNodes oChilds;
if ( oNode.GetNodes( _T("*"), oChilds ) )
{
XmlUtils::CXmlNode oItem;
for ( int nIndex = 0; nIndex < oChilds.GetCount(); nIndex++ )
{
if ( oChilds.GetAt( nIndex, oItem ) )
{
std::wstring sName = oItem.GetName();
WritingElement *pItem = NULL;
if ( _T("m:acc") == sName )
pItem = new OOX::Logic::CAcc( oItem );
else if ( _T("m:argPr") == sName )
pItem = new OOX::Logic::CArgPr( oItem );
else if ( _T("m:bar") == sName )
pItem = new OOX::Logic::CBar( oItem );
else if ( _T("w:bookmarkEnd") == sName )
pItem = new OOX::Logic::CBookmarkEnd( oItem );
else if ( _T("w:bookmarkStart") == sName )
pItem = new OOX::Logic::CBookmarkStart( oItem );
else if ( _T("m:borderBox") == sName )
pItem = new OOX::Logic::CBorderBox( oItem );
else if ( _T("m:box") == sName )
pItem = new OOX::Logic::CBox( oItem );
else if ( _T("w:commentRangeEnd") == sName )
pItem = new OOX::Logic::CCommentRangeEnd( oItem );
else if ( _T("w:commentRangeStart") == sName )
pItem = new OOX::Logic::CCommentRangeStart( oItem );
else if ( _T("m:ctrlPr") == sName )
pItem = new OOX::Logic::CCtrlPr( oItem );
else if ( _T("w:customXmlDelRangeEnd") == sName )
pItem = new OOX::Logic::CCustomXmlDelRangeEnd( oItem );
else if ( _T("w:customXmlDelRangeStart") == sName )
pItem = new OOX::Logic::CCustomXmlDelRangeStart( oItem );
else if ( _T("w:customXmlInsRangeEnd") == sName )
pItem = new OOX::Logic::CCustomXmlInsRangeEnd( oItem );
else if ( _T("w:customXmlInsRangeStart") == sName )
pItem = new OOX::Logic::CCustomXmlInsRangeStart( oItem );
else if ( _T("w:customXmlMoveFromRangeEnd") == sName )
pItem = new OOX::Logic::CCustomXmlMoveFromRangeEnd( oItem );
else if ( _T("w:customXmlMoveFromRangeStart") == sName )
pItem = new OOX::Logic::CCustomXmlMoveFromRangeStart( oItem );
else if ( _T("w:customXmlMoveToRangeEnd") == sName )
pItem = new OOX::Logic::CCustomXmlMoveToRangeEnd( oItem );
else if ( _T("w:customXmlMoveToRangeStart") == sName )
pItem = new OOX::Logic::CCustomXmlMoveToRangeStart( oItem );
else if ( _T("m:d") == sName )
pItem = new OOX::Logic::CDelimiter( oItem );
else if ( _T("w:del") == sName )
pItem = new CDel( oItem );
else if ( _T("m:eqArr") == sName )
pItem = new OOX::Logic::CEqArr( oItem );
else if ( _T("m:f") == sName )
pItem = new OOX::Logic::CFraction( oItem );
else if ( _T("m:func") == sName )
pItem = new OOX::Logic::CFunc( oItem );
else if ( _T("m:groupChr") == sName )
pItem = new CGroupChr( oItem );
else if ( _T("w:ins") == sName )
pItem = new CIns( oItem );
else if ( _T("m:limLow") == sName )
pItem = new OOX::Logic::CLimLow( oItem );
else if ( _T("m:limUpp") == sName )
pItem = new OOX::Logic::CLimUpp( oItem );
else if ( _T("m:m") == sName )
pItem = new OOX::Logic::CMatrix( oItem );
else if ( _T("w:moveFrom") == sName )
pItem = new OOX::Logic::CMoveFrom( oItem );
else if ( _T("w:moveFromRangeEnd") == sName )
pItem = new OOX::Logic::CMoveFromRangeEnd( oItem );
else if ( _T("w:moveFromRangeStart") == sName )
pItem = new OOX::Logic::CMoveFromRangeStart( oItem );
else if ( _T("w:moveTo") == sName )
pItem = new CMoveTo( oItem );
else if ( _T("w:moveToRangeEnd") == sName )
pItem = new OOX::Logic::CMoveToRangeEnd( oItem );
else if ( _T("w:moveToRangeStart") == sName )
pItem = new OOX::Logic::CMoveToRangeStart( oItem );
else if ( _T("m:nary") == sName )
pItem = new OOX::Logic::CNary( oItem );
else if ( _T("m:oMath") == sName )
pItem = new OOX::Logic::COMath( oItem );
else if ( _T("m:oMathPara") == sName )
pItem = new OOX::Logic::COMathPara( oItem );
else if ( _T("w:permEnd") == sName )
pItem = new OOX::Logic::CPermEnd( oItem );
else if ( _T("w:permStart") == sName )
pItem = new OOX::Logic::CPermStart( oItem );
else if ( _T("m:phant") == sName )
pItem = new OOX::Logic::CPhant( oItem );
else if ( _T("w:proofErr") == sName )
pItem = new OOX::Logic::CProofErr( oItem );
else if ( _T("m:r") == sName )
pItem = new OOX::Logic::CMRun( oItem );
else if ( _T("m:rad") == sName )
pItem = new OOX::Logic::CRad( oItem );
else if ( _T("m:sPre") == sName )
pItem = new OOX::Logic::CSPre( oItem );
else if ( _T("m:sSub") == sName )
pItem = new OOX::Logic::CSSub( oItem );
else if ( _T("m:sSubSup") == sName )
pItem = new OOX::Logic::CSSubSup( oItem );
else if ( _T("m:sSup") == sName )
pItem = new OOX::Logic::CSSup( oItem );
if ( pItem )
m_arrItems.push_back( pItem );
}
}
}
}
void CMathArgNodes::fromXML(XmlUtils::CXmlLiteReader& oReader)
{
sNodeName = std::wstring(oReader.GetName().c_str());
if(sNodeName == _T("m:deg"))
eType = et_m_deg;
else if (sNodeName == _T("m:den"))
eType = et_m_den;
else if (sNodeName == _T("m:e"))
eType = et_m_e;
else if (sNodeName == _T("m:fName"))
eType = et_m_fName;
else if (sNodeName == _T("m:lim"))
eType = et_m_lim;
else if (sNodeName == _T("m:num"))
eType = et_m_num;
else if (sNodeName == _T("m:oMath"))
eType = et_m_oMath;
else if (sNodeName == _T("m:sub"))
eType = et_m_sub;
else if (sNodeName == _T("m:sup"))
eType = et_m_sup;
else
eType = et_Unknown;
eType = et_m_deg;
else if (sNodeName == _T("m:den"))
eType = et_m_den;
else if (sNodeName == _T("m:e"))
eType = et_m_e;
else if (sNodeName == _T("m:fName"))
eType = et_m_fName;
else if (sNodeName == _T("m:lim"))
eType = et_m_lim;
else if (sNodeName == _T("m:num"))
eType = et_m_num;
else if (sNodeName == _T("m:oMath"))
eType = et_m_oMath;
else if (sNodeName == _T("m:sub"))
eType = et_m_sub;
else if (sNodeName == _T("m:sup"))
eType = et_m_sup;
else
eType = et_Unknown;
if ( oReader.IsEmptyNode())
return;

View File

@ -34,7 +34,7 @@ namespace OOX
{
namespace Logic
{
std::wstring CAcc::toXML() const
std::wstring CAcc::toXML() const
{
std::wstring sResult = _T("<m:acc>");
@ -49,402 +49,402 @@ namespace OOX
return sResult;
}
std::wstring CAccPr::toXML() const
{
std::wstring sResult = _T("<m:accPr>");
if ( m_oChr.IsInit() )
sResult += m_oChr->toXML();
std::wstring CAccPr::toXML() const
{
std::wstring sResult = _T("<m:accPr>");
if ( m_oChr.IsInit() )
sResult += m_oChr->toXML();
if ( m_oCtrlPr.IsInit() )
sResult += m_oCtrlPr->toXML();
sResult += _T("</m:accPr>");
if ( m_oCtrlPr.IsInit() )
sResult += m_oCtrlPr->toXML();
sResult += _T("</m:accPr>");
return sResult;
}
return sResult;
}
std::wstring CBar::toXML() const
{
std::wstring sResult = _T("<m:bar>");
if ( m_oBarPr.IsInit() )
sResult += m_oBarPr->toXML();
std::wstring CBar::toXML() const
{
std::wstring sResult = _T("<m:bar>");
if ( m_oBarPr.IsInit() )
sResult += m_oBarPr->toXML();
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
sResult += _T("</m:bar>");
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
sResult += _T("</m:bar>");
return sResult;
}
return sResult;
}
std::wstring CBarPr::toXML() const
{
std::wstring sResult = _T("<m:barPr>");
if ( m_oCtrlPr.IsInit() )
sResult += m_oCtrlPr->toXML();
std::wstring CBarPr::toXML() const
{
std::wstring sResult = _T("<m:barPr>");
if ( m_oCtrlPr.IsInit() )
sResult += m_oCtrlPr->toXML();
if ( m_oPos.IsInit() )
sResult += m_oPos->toXML();
sResult += _T("</m:barPr>");
if ( m_oPos.IsInit() )
sResult += m_oPos->toXML();
sResult += _T("</m:barPr>");
return sResult;
}
return sResult;
}
std::wstring CBorderBox::toXML() const
{
std::wstring sResult = _T("<m:borderBox>");
if ( m_oBorderBoxPr.IsInit() )
sResult += m_oBorderBoxPr->toXML();
std::wstring CBorderBox::toXML() const
{
std::wstring sResult = _T("<m:borderBox>");
if ( m_oBorderBoxPr.IsInit() )
sResult += m_oBorderBoxPr->toXML();
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
sResult += _T("</m:borderBox>");
sResult += _T("</m:borderBox>");
return sResult;
}
return sResult;
}
std::wstring CBorderBoxPr::toXML() const
{
std::wstring sResult = _T("<m:borderBoxPr>");
std::wstring CBorderBoxPr::toXML() const
{
std::wstring sResult = _T("<m:borderBoxPr>");
if ( m_oCtrlPr.IsInit() )
sResult += m_oCtrlPr->toXML();
if ( m_oCtrlPr.IsInit() )
sResult += m_oCtrlPr->toXML();
if ( m_oHideBot.IsInit() )
sResult += m_oHideBot->toXML();
if ( m_oHideBot.IsInit() )
sResult += m_oHideBot->toXML();
if ( m_oHideLeft.IsInit() )
sResult += m_oHideLeft->toXML();
if ( m_oHideLeft.IsInit() )
sResult += m_oHideLeft->toXML();
if ( m_oHideRight.IsInit() )
sResult += m_oHideRight->toXML();
if ( m_oHideRight.IsInit() )
sResult += m_oHideRight->toXML();
if ( m_oHideTop.IsInit() )
sResult += m_oHideTop->toXML();
if ( m_oHideTop.IsInit() )
sResult += m_oHideTop->toXML();
if ( m_oStrikeBLTR.IsInit() )
sResult += m_oStrikeBLTR->toXML();
if ( m_oStrikeBLTR.IsInit() )
sResult += m_oStrikeBLTR->toXML();
if ( m_oStrikeH.IsInit() )
sResult += m_oStrikeH->toXML();
if ( m_oStrikeH.IsInit() )
sResult += m_oStrikeH->toXML();
if ( m_oStrikeTLBR.IsInit() )
sResult += m_oStrikeTLBR->toXML();
if ( m_oStrikeTLBR.IsInit() )
sResult += m_oStrikeTLBR->toXML();
if ( m_oStrikeV.IsInit() )
sResult += m_oStrikeV->toXML();
sResult += _T("</m:borderBoxPr>");
if ( m_oStrikeV.IsInit() )
sResult += m_oStrikeV->toXML();
sResult += _T("</m:borderBoxPr>");
return sResult;
}
return sResult;
}
std::wstring CBox::toXML() const
{
std::wstring sResult = _T("<m:box>");
std::wstring CBox::toXML() const
{
std::wstring sResult = _T("<m:box>");
if ( m_oBoxPr.IsInit() )
sResult += m_oBoxPr->toXML();
if ( m_oBoxPr.IsInit() )
sResult += m_oBoxPr->toXML();
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
sResult += _T("</m:box>");
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
sResult += _T("</m:box>");
return sResult;
}
return sResult;
}
std::wstring CBoxPr::toXML() const
{
std::wstring sResult = _T("<m:boxPr>");
if ( m_oAln.IsInit() )
sResult += m_oAln->toXML();
std::wstring CBoxPr::toXML() const
{
std::wstring sResult = _T("<m:boxPr>");
if ( m_oAln.IsInit() )
sResult += m_oAln->toXML();
if ( m_oBrk.IsInit() )
sResult += m_oBrk->toXML();
if ( m_oBrk.IsInit() )
sResult += m_oBrk->toXML();
if ( m_oCtrlPr.IsInit() )
sResult += m_oCtrlPr->toXML();
if ( m_oCtrlPr.IsInit() )
sResult += m_oCtrlPr->toXML();
if ( m_oDiff.IsInit() )
sResult += m_oDiff->toXML();
if ( m_oDiff.IsInit() )
sResult += m_oDiff->toXML();
if ( m_oNoBreak.IsInit() )
sResult += m_oNoBreak->toXML();
if ( m_oNoBreak.IsInit() )
sResult += m_oNoBreak->toXML();
if ( m_oOpEmu.IsInit() )
sResult += m_oOpEmu->toXML();
sResult += _T("</m:boxPr>");
if ( m_oOpEmu.IsInit() )
sResult += m_oOpEmu->toXML();
sResult += _T("</m:boxPr>");
return sResult;
}
return sResult;
}
std::wstring CFraction::toXML() const
{
std::wstring sResult = _T("<m:f>");
std::wstring CFraction::toXML() const
{
std::wstring sResult = _T("<m:f>");
if ( m_oDen.IsInit() )
sResult += m_oDen->toXML();
if ( m_oDen.IsInit() )
sResult += m_oDen->toXML();
if ( m_oFPr.IsInit() )
sResult += m_oFPr->toXML();
if ( m_oFPr.IsInit() )
sResult += m_oFPr->toXML();
if ( m_oNum.IsInit() )
sResult += m_oNum->toXML();
sResult += _T("</m:f>");
if ( m_oNum.IsInit() )
sResult += m_oNum->toXML();
sResult += _T("</m:f>");
return sResult;
}
return sResult;
}
std::wstring CFunc::toXML() const
{
std::wstring sResult = _T("<m:func>");
std::wstring CFunc::toXML() const
{
std::wstring sResult = _T("<m:func>");
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oFName.IsInit() )
sResult += m_oFName->toXML();
if ( m_oFName.IsInit() )
sResult += m_oFName->toXML();
if ( m_oFuncPr.IsInit() )
sResult += m_oFuncPr->toXML();
sResult += _T("</m:func>");
if ( m_oFuncPr.IsInit() )
sResult += m_oFuncPr->toXML();
sResult += _T("</m:func>");
return sResult;
}
return sResult;
}
std::wstring CGroupChr::toXML() const
{
std::wstring sResult = _T("<m:groupChr>");
std::wstring CGroupChr::toXML() const
{
std::wstring sResult = _T("<m:groupChr>");
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oGroupChrPr.IsInit() )
sResult += m_oGroupChrPr->toXML();
sResult += _T("</m:groupChr>");
if ( m_oGroupChrPr.IsInit() )
sResult += m_oGroupChrPr->toXML();
sResult += _T("</m:groupChr>");
return sResult;
}
return sResult;
}
std::wstring CLimLow::toXML() const
{
std::wstring sResult = _T("<m:limLow>");
std::wstring CLimLow::toXML() const
{
std::wstring sResult = _T("<m:limLow>");
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oLim.IsInit() )
sResult += m_oLim->toXML();
if ( m_oLim.IsInit() )
sResult += m_oLim->toXML();
if ( m_oLimLowPr.IsInit() )
sResult += m_oLimLowPr->toXML();
sResult += _T("</m:limLow>");
if ( m_oLimLowPr.IsInit() )
sResult += m_oLimLowPr->toXML();
sResult += _T("</m:limLow>");
return sResult;
}
return sResult;
}
std::wstring CLimUpp::toXML() const
{
std::wstring sResult = _T("<m:limUpp>");
std::wstring CLimUpp::toXML() const
{
std::wstring sResult = _T("<m:limUpp>");
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oLim.IsInit() )
sResult += m_oLim->toXML();
if ( m_oLim.IsInit() )
sResult += m_oLim->toXML();
if ( m_oLimUppPr.IsInit() )
sResult += m_oLimUppPr->toXML();
sResult += _T("</m:limUpp>");
if ( m_oLimUppPr.IsInit() )
sResult += m_oLimUppPr->toXML();
sResult += _T("</m:limUpp>");
return sResult;
}
return sResult;
}
std::wstring CMc::toXML() const
{
std::wstring sResult = _T("<m:mc>");
std::wstring CMc::toXML() const
{
std::wstring sResult = _T("<m:mc>");
if ( m_oMcPr.IsInit() )
sResult += m_oMcPr->toXML();
sResult += _T("</m:mc>");
if ( m_oMcPr.IsInit() )
sResult += m_oMcPr->toXML();
sResult += _T("</m:mc>");
return sResult;
}
return sResult;
}
std::wstring CNary::toXML() const
{
std::wstring sResult = _T("<m:nary>");
std::wstring CNary::toXML() const
{
std::wstring sResult = _T("<m:nary>");
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oNaryPr.IsInit() )
sResult += m_oNaryPr->toXML();
if ( m_oNaryPr.IsInit() )
sResult += m_oNaryPr->toXML();
if ( m_oSub.IsInit() )
sResult += m_oSub->toXML();
if ( m_oSub.IsInit() )
sResult += m_oSub->toXML();
if ( m_oSup.IsInit() )
sResult += m_oSup->toXML();
sResult += _T("</m:nary>");
if ( m_oSup.IsInit() )
sResult += m_oSup->toXML();
sResult += _T("</m:nary>");
return sResult;
}
return sResult;
}
std::wstring CPhant::toXML() const
{
std::wstring sResult = _T("<m:phant>");
std::wstring CPhant::toXML() const
{
std::wstring sResult = _T("<m:phant>");
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oElement.IsInit() )
sResult += m_oElement->toXML();
if ( m_oPhantPr.IsInit() )
sResult += m_oPhantPr->toXML();
sResult += _T("</m:phant>");
if ( m_oPhantPr.IsInit() )
sResult += m_oPhantPr->toXML();
sResult += _T("</m:phant>");
return sResult;
}
return sResult;
}
std::wstring CMRun::toXML() const
{
std::wstring sResult = _T("<m:r>");
std::wstring CMRun::toXML() const
{
std::wstring sResult = _T("<m:r>");
sResult += toXMLInner();
sResult += _T("</m:r>");
sResult += toXMLInner();
sResult += _T("</m:r>");
return sResult;
}
std::wstring CMRun::toXMLInner() const
{
std::wstring sResult;
return sResult;
}
std::wstring CMRun::toXMLInner() const
{
std::wstring sResult;
if ( m_oAnnotationRef.IsInit() )
sResult += m_oAnnotationRef->toXML();
if ( m_oAnnotationRef.IsInit() )
sResult += m_oAnnotationRef->toXML();
if ( m_oBr.IsInit() )
sResult += m_oBr->toXML();
if ( m_oBr.IsInit() )
sResult += m_oBr->toXML();
if ( m_oCommentReference.IsInit() )
sResult += m_oCommentReference->toXML();
if ( m_oCommentReference.IsInit() )
sResult += m_oCommentReference->toXML();
if ( m_oContentPart.IsInit() )
sResult += m_oContentPart->toXML();
if ( m_oContentPart.IsInit() )
sResult += m_oContentPart->toXML();
if ( m_oContinuationSeparator.IsInit() )
sResult += m_oContinuationSeparator->toXML();
if ( m_oContinuationSeparator.IsInit() )
sResult += m_oContinuationSeparator->toXML();
if ( m_oCr.IsInit() )
sResult += m_oCr->toXML();
if ( m_oCr.IsInit() )
sResult += m_oCr->toXML();
if ( m_oDayLong.IsInit() )
sResult += m_oDayLong->toXML();
if ( m_oDayLong.IsInit() )
sResult += m_oDayLong->toXML();
if ( m_oDayShort.IsInit() )
sResult += m_oDayShort->toXML();
if ( m_oDayShort.IsInit() )
sResult += m_oDayShort->toXML();
if ( m_oDelInstrText.IsInit() )
sResult += m_oDelInstrText->toXML();
if ( m_oDelInstrText.IsInit() )
sResult += m_oDelInstrText->toXML();
if ( m_oDelText.IsInit() )
sResult += m_oDelText->toXML();
if ( m_oDelText.IsInit() )
sResult += m_oDelText->toXML();
if ( m_oDrawing.IsInit() )
sResult += m_oDrawing->toXML();
if ( m_oDrawing.IsInit() )
sResult += m_oDrawing->toXML();
if ( m_oEndnoteRef.IsInit() )
sResult += m_oEndnoteRef->toXML();
if ( m_oEndnoteRef.IsInit() )
sResult += m_oEndnoteRef->toXML();
if ( m_oEndnoteReference.IsInit() )
sResult += m_oEndnoteReference->toXML();
if ( m_oEndnoteReference.IsInit() )
sResult += m_oEndnoteReference->toXML();
if ( m_oFldChar.IsInit() )
sResult += m_oFldChar->toXML();
if ( m_oFldChar.IsInit() )
sResult += m_oFldChar->toXML();
if ( m_oFootnoteRef.IsInit() )
sResult += m_oFootnoteRef->toXML();
if ( m_oFootnoteRef.IsInit() )
sResult += m_oFootnoteRef->toXML();
if ( m_oFootnoteReference.IsInit() )
sResult += m_oFootnoteReference->toXML();
if ( m_oFootnoteReference.IsInit() )
sResult += m_oFootnoteReference->toXML();
if ( m_oInstrText.IsInit() )
sResult += m_oInstrText->toXML();
if ( m_oInstrText.IsInit() )
sResult += m_oInstrText->toXML();
if ( m_oLastRenderedPageBreak.IsInit() )
sResult += m_oLastRenderedPageBreak->toXML();
if ( m_oLastRenderedPageBreak.IsInit() )
sResult += m_oLastRenderedPageBreak->toXML();
if ( m_oMonthLong.IsInit() )
sResult += m_oMonthLong->toXML();
if ( m_oMonthLong.IsInit() )
sResult += m_oMonthLong->toXML();
if ( m_oMonthShort.IsInit() )
sResult += m_oMonthShort->toXML();
if ( m_oMonthShort.IsInit() )
sResult += m_oMonthShort->toXML();
if ( m_oNoBreakHyphen.IsInit() )
sResult += m_oNoBreakHyphen->toXML();
if ( m_oNoBreakHyphen.IsInit() )
sResult += m_oNoBreakHyphen->toXML();
if ( m_oObject.IsInit() )
sResult += m_oObject->toXML();
if ( m_oObject.IsInit() )
sResult += m_oObject->toXML();
if ( m_oPgNum.IsInit() )
sResult += m_oPgNum->toXML();
if ( m_oPgNum.IsInit() )
sResult += m_oPgNum->toXML();
if ( m_oPtab.IsInit() )
sResult += m_oPtab->toXML();
if ( m_oPtab.IsInit() )
sResult += m_oPtab->toXML();
if ( m_oMRPr.IsInit() )
sResult += m_oMRPr->toXML();
if ( m_oMRPr.IsInit() )
sResult += m_oMRPr->toXML();
if ( m_oARPr.IsInit() )
sResult += m_oARPr->toXML();
if ( m_oARPr.IsInit() )
sResult += m_oARPr->toXML();
if ( m_oRPr.IsInit() )
sResult += m_oRPr->toXML();
if ( m_oRPr.IsInit() )
sResult += m_oRPr->toXML();
if ( m_oRuby.IsInit() )
sResult += m_oRuby->toXML();
if ( m_oRuby.IsInit() )
sResult += m_oRuby->toXML();
if ( m_oSeparator.IsInit() )
sResult += m_oSeparator->toXML();
if ( m_oSeparator.IsInit() )
sResult += m_oSeparator->toXML();
if ( m_oSoftHyphen.IsInit() )
sResult += m_oSoftHyphen->toXML();
if ( m_oSoftHyphen.IsInit() )
sResult += m_oSoftHyphen->toXML();
if ( m_oSym.IsInit() )
sResult += m_oSym->toXML();
if ( m_oSym.IsInit() )
sResult += m_oSym->toXML();
if ( m_oMText.IsInit() )
sResult += m_oMText->toXML();
if ( m_oMText.IsInit() )
sResult += m_oMText->toXML();
if ( m_oText.IsInit() )
sResult += m_oText->toXML();
if ( m_oText.IsInit() )
sResult += m_oText->toXML();
if ( m_oTab.IsInit() )
sResult += m_oTab->toXML();
if ( m_oTab.IsInit() )
sResult += m_oTab->toXML();
if ( m_oYearLong.IsInit() )
sResult += m_oYearLong->toXML();
if ( m_oYearLong.IsInit() )
sResult += m_oYearLong->toXML();
if ( m_oYearShort.IsInit() )
sResult += m_oYearShort->toXML();
if ( m_oYearShort.IsInit() )
sResult += m_oYearShort->toXML();
return sResult;
}
return sResult;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -52,12 +52,33 @@ namespace OOX
virtual ~COMathPara()
{
}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
XmlUtils::CXmlNodes oChilds;
if ( oNode.GetNodes( _T("*"), oChilds ) )
{
XmlUtils::CXmlNode oItem;
for ( int nIndex = 0; nIndex < oChilds.GetCount(); nIndex++ )
{
if ( oChilds.GetAt( nIndex, oItem ) )
{
std::wstring sName = oItem.GetName();
WritingElement *pItem = NULL;
if ( _T("w:r") == sName )
pItem = new CRun( oItem );
else if ( _T("m:oMath") == sName )
pItem = new COMath( oItem );
else if ( _T("m:oMathParaPr") == sName )
pItem = new COMathParaPr( oItem );
if ( pItem )
m_arrItems.push_back( pItem );
}
}
}
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;

View File

@ -158,6 +158,8 @@ namespace PdfReader
}
else
{
if (!seName)
seName = new StringExt("");
// TO DO: Error "Unknown font type"
pFont = new Gr8BitFont(pXref, sTag, oID, seName, fontUnknownType, pFontDict, pGlobalParams);
}