Commit dc81f97b authored by ElenaSubbotina's avatar ElenaSubbotina

fix bugs after refactoring

parent d194249f
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
int pos =target.find(L"."); int pos =target.find(L".");
if (pos < 0) if (pos < 0)
{ {
target = target + std::wstring(L".A1"); target = L"\"" + target + std::wstring(L"\".A1");
} }
r.location = converter_.convert_ref(std::wstring(target.begin() + 1, target.end())); r.location = converter_.convert_ref(std::wstring(target.begin() + 1, target.end()));
r.type = L"Internal" ; r.type = L"Internal" ;
......
...@@ -100,7 +100,7 @@ namespace PPTX ...@@ -100,7 +100,7 @@ namespace PPTX
{ {
std::wstring sName = oReader.GetName(); std::wstring sName = oReader.GetName();
if (sName == L"a:pos") if (sName == L"a:pt")
{ {
ReadAttributes2(oReader, x[count], y[count]); ReadAttributes2(oReader, x[count], y[count]);
count++; count++;
......
...@@ -70,7 +70,7 @@ namespace PPTX ...@@ -70,7 +70,7 @@ namespace PPTX
{ {
std::wstring sName = oReader.GetName(); std::wstring sName = oReader.GetName();
if (sName == L"a:pos") if (sName == L"a:pt")
{ {
ReadAttributes2(oReader); ReadAttributes2(oReader);
} }
......
...@@ -69,7 +69,7 @@ namespace PPTX ...@@ -69,7 +69,7 @@ namespace PPTX
{ {
std::wstring sName = oReader.GetName(); std::wstring sName = oReader.GetName();
if (sName == L"a:pos") if (sName == L"a:pt")
{ {
ReadAttributes2(oReader); ReadAttributes2(oReader);
} }
......
...@@ -73,7 +73,7 @@ namespace PPTX ...@@ -73,7 +73,7 @@ namespace PPTX
{ {
std::wstring sName = oReader.GetName(); std::wstring sName = oReader.GetName();
if (sName == L"a:pos") if (sName == L"a:pt")
{ {
ReadAttributes2(oReader, x[count], y[count]); ReadAttributes2(oReader, x[count], y[count]);
count++; count++;
......
...@@ -50,17 +50,25 @@ namespace PPTX ...@@ -50,17 +50,25 @@ namespace PPTX
} }
void MathParaWrapper::fromXML(XmlUtils::CXmlLiteReader& oReader) void MathParaWrapper::fromXML(XmlUtils::CXmlLiteReader& oReader)
{ {
std::wstring name = oReader.GetName(); if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
if(L"oMathPara" == name) if(L"oMathPara" == strName)
{ {
m_oMathPara = oReader; m_oMathPara = oReader;
} }
else if(L"oMath" == name) else if(L"oMath" == strName)
{ {
m_oMath = oReader; m_oMath = oReader;
} }
} }
FillParentPointersForChilds();
}
void MathParaWrapper::fromXML(XmlUtils::CXmlNode& node) void MathParaWrapper::fromXML(XmlUtils::CXmlNode& node)
{ {
std::wstring sBegin(_T("<root xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:p=\"urn:schemas-microsoft-com:office:powerpoint\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/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\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:a14=\"http://schemas.microsoft.com/office/drawing/2010/main\" xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\" xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\">")); std::wstring sBegin(_T("<root xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:p=\"urn:schemas-microsoft-com:office:powerpoint\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/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\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:a14=\"http://schemas.microsoft.com/office/drawing/2010/main\" xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\" xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\">"));
...@@ -151,8 +159,7 @@ namespace PPTX ...@@ -151,8 +159,7 @@ namespace PPTX
oDrawingConverter.m_pBinaryWriter = pWriter; oDrawingConverter.m_pBinaryWriter = pWriter;
DocWrapper::FontProcessor fp; DocWrapper::FontProcessor fp;
BinDocxRW::ParamsWriter oParamsWriter(pWriter, &fp, &oDrawingConverter, NULL); oDocxSerializer.m_pParamsWriter = new BinDocxRW::ParamsWriter(pWriter, &fp, &oDrawingConverter, NULL);
oDocxSerializer.m_pParamsWriter = &oParamsWriter;
oDocxSerializer.getBinaryContentElem(eElemType, pElem, *pWriter, lDataSize); oDocxSerializer.getBinaryContentElem(eElemType, pElem, *pWriter, lDataSize);
//*oDrawingConverter.m_pBinaryWriter->m_pCommonRels = pOldRels; //*oDrawingConverter.m_pBinaryWriter->m_pCommonRels = pOldRels;
oDrawingConverter.m_pBinaryWriter = pOldWriter; oDrawingConverter.m_pBinaryWriter = pOldWriter;
......
...@@ -247,19 +247,28 @@ namespace PPTX ...@@ -247,19 +247,28 @@ namespace PPTX
m_elem.reset(new Logic::GraphicFrame(oReader)); m_elem.reset(new Logic::GraphicFrame(oReader));
else if (name == _T("AlternateContent")) else if (name == _T("AlternateContent"))
{ {
bool isEmpty = true; if ( oReader.IsEmptyNode() )
return;
int nCurDepth = oReader.GetDepth(); int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) ) while( oReader.ReadNextSiblingNode( nCurDepth ) )
{ {
std::wstring strName = oReader.GetName(); std::wstring strName = oReader.GetName();
if ( oReader.IsEmptyNode() )
continue;
if (strName == L"mc:Choice") if (strName == L"mc:Choice")
{ {
oReader.ReadNextSiblingNode(nCurDepth + 1);
//GetAttributeIfExist(L"Requires", sRequires) && L"a14" == sRequires) //GetAttributeIfExist(L"Requires", sRequires) && L"a14" == sRequires)
fromXML(oReader); fromXML(oReader);
if (m_elem.is_init())
break; break;
} }
else if (strName == L"mc:Fallback") else if (strName == L"mc:Fallback")
{ {
oReader.ReadNextSiblingNode(nCurDepth + 1);
fromXML(oReader); fromXML(oReader);
} }
} }
......
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