Skip to content

Commit 5e8422b

Browse files
Merge pull request ONLYOFFICE#881 from ONLYOFFICE/fix/v7.1.0-fix-bugs3
fix bug #56300
2 parents f201a55 + b0fd733 commit 5e8422b

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

Common/DocxFormat/Source/DocxFormat/Logic/Paragraph.cpp

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,20 +172,27 @@ namespace OOX
172172
}
173173
}
174174

175-
176175
void CParagraph::fromXML(XmlUtils::CXmlLiteReader& oReader)
177176
{
178177
m_oParagraphProperty = NULL;
179-
180-
ReadAttributes( oReader );
181178

179+
ReadAttributes(oReader);
180+
181+
if (oReader.IsEmptyNode())
182+
return;
183+
184+
int nParentDepth = oReader.GetDepth();
185+
186+
fromXML(nParentDepth, oReader);
187+
}
188+
void CParagraph::fromXML(int nDepth, XmlUtils::CXmlLiteReader& oReader)
189+
{
182190
if ( oReader.IsEmptyNode() )
183191
return;
184192

185193
OOX::Document* document = WritingElement::m_pMainDocument;
186194

187-
int nParentDepth = oReader.GetDepth();
188-
while( oReader.ReadNextSiblingNode( nParentDepth ) )
195+
while( oReader.ReadNextSiblingNode(nDepth) )
189196
{
190197
std::wstring sName = oReader.GetName();
191198
WritingElement *pItem = NULL;
@@ -307,6 +314,11 @@ namespace OOX
307314
pItem = new CSmartTag( document );
308315
//else if ( _T("w:subDoc") == sName )
309316
// pItem = new CSubDoc( document );
317+
else if (_T("w:sdtContent") == sName)
318+
{
319+
int nDepthChild = oReader.GetDepth();
320+
fromXML(nDepthChild, oReader);
321+
}
310322

311323
if ( pItem )
312324
{

Common/DocxFormat/Source/DocxFormat/Logic/Paragraph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ namespace OOX
119119
}
120120

121121
private:
122-
122+
void fromXML(int nDepth, XmlUtils::CXmlLiteReader& oReader);
123123
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
124124

125125
public:

0 commit comments

Comments
 (0)