Commit 6b3594b5 authored by ElenaSubbotina's avatar ElenaSubbotina

fix bug #33397

parent 7195d442
...@@ -342,6 +342,7 @@ namespace DocFileFormat ...@@ -342,6 +342,7 @@ namespace DocFileFormat
int DocumentMapping::writeRun (std::vector<wchar_t>* chars, CharacterPropertyExceptions* chpx, int initialCp) int DocumentMapping::writeRun (std::vector<wchar_t>* chars, CharacterPropertyExceptions* chpx, int initialCp)
{ {
int cp = initialCp; int cp = initialCp;
int result_cp = cp + chars->size();
if ((_skipRuns <= 0) && (chars->size() > 0)) if ((_skipRuns <= 0) && (chars->size() > 0))
{ {
...@@ -408,7 +409,9 @@ namespace DocFileFormat ...@@ -408,7 +409,9 @@ namespace DocFileFormat
} }
else else
{ {
writeText(chars, cp, chpx, false); int new_result_cp = writeText(chars, cp, chpx, false);
if (new_result_cp > result_cp)
result_cp = new_result_cp;
} }
//end run //end run
...@@ -434,11 +437,11 @@ namespace DocFileFormat ...@@ -434,11 +437,11 @@ namespace DocFileFormat
--_skipRuns; --_skipRuns;
} }
return cp + (int)chars->size(); return result_cp;
} }
// Writes the given text to the document // Writes the given text to the document
void DocumentMapping::writeText(std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText) int DocumentMapping::writeText(std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText)
{ {
int cp = initialCp; int cp = initialCp;
...@@ -728,8 +731,14 @@ namespace DocFileFormat ...@@ -728,8 +731,14 @@ namespace DocFileFormat
} }
} }
if (bEMBED) _skipRuns = 3; if (bEMBED)
else _skipRuns = 5; {
//Приложения_011015.doc(9 стр) ellipt_eq.doc конфликтные
cp = cpFieldEnd;
_skipRuns = 3;
}
else
_skipRuns = 5;
} }
else else
{ {
...@@ -833,7 +842,10 @@ namespace DocFileFormat ...@@ -833,7 +842,10 @@ namespace DocFileFormat
} }
else if ((oPicture.mfp.mm > 98) && (NULL != oPicture.shapeContainer)) else if ((oPicture.mfp.mm > 98) && (NULL != oPicture.shapeContainer))
{ {
m_pXmlWriter->WriteNodeBegin (_T("w:pict")); bool bFormula = false;
XMLTools::CStringXmlWriter pictWriter;
pictWriter.WriteNodeBegin (_T("w:pict"));
bool picture = true; bool picture = true;
...@@ -846,13 +858,13 @@ namespace DocFileFormat ...@@ -846,13 +858,13 @@ namespace DocFileFormat
if (picture) if (picture)
{ {
VMLPictureMapping oVmlMapper(m_context, m_pXmlWriter, false, _caller, isInline); VMLPictureMapping oVmlMapper(m_context, &pictWriter, false, _caller, isInline);
oPicture.Convert (&oVmlMapper); oPicture.Convert (&oVmlMapper);
if (oVmlMapper.m_isEmbedded) if (oVmlMapper.m_isEmbedded)
{ {
OleObject ole ( chpx, m_document->GetStorage(), m_document->bOlderVersion); OleObject ole ( chpx, m_document->GetStorage(), m_document->bOlderVersion);
OleObjectMapping oleObjectMapping( m_pXmlWriter, m_context, &oPicture, _caller, oVmlMapper.GetShapeId() ); OleObjectMapping oleObjectMapping( &pictWriter, m_context, &oPicture, _caller, oVmlMapper.GetShapeId() );
ole.isEquation = oVmlMapper.m_isEquation; ole.isEquation = oVmlMapper.m_isEquation;
ole.isEmbedded = oVmlMapper.m_isEmbedded; ole.isEmbedded = oVmlMapper.m_isEmbedded;
...@@ -860,13 +872,24 @@ namespace DocFileFormat ...@@ -860,13 +872,24 @@ namespace DocFileFormat
ole.Convert( &oleObjectMapping ); ole.Convert( &oleObjectMapping );
} }
else if (oVmlMapper.m_isEquation)
{
//нельзя в Run писать oMath
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml.c_str());
_writeAfterRun = oVmlMapper.m_equationXml;
bFormula = true;
}
}else }else
{ {
VMLShapeMapping oVmlMapper(m_context, m_pXmlWriter, NULL, &oPicture, _caller, isInline); VMLShapeMapping oVmlMapper(m_context, &pictWriter, NULL, &oPicture, _caller, isInline);
oPicture.shapeContainer->Convert(&oVmlMapper); oPicture.shapeContainer->Convert(&oVmlMapper);
} }
m_pXmlWriter->WriteNodeEnd (_T("w:pict")); pictWriter.WriteNodeEnd (_T("w:pict"));
if (!bFormula)
m_pXmlWriter->WriteString(pictWriter.GetXmlString());
} }
} }
else if ((TextMark::AutoNumberedFootnoteReference == code) && fSpec) else if ((TextMark::AutoNumberedFootnoteReference == code) && fSpec)
...@@ -929,6 +952,7 @@ namespace DocFileFormat ...@@ -929,6 +952,7 @@ namespace DocFileFormat
writeTextEnd(textType); writeTextEnd(textType);
} }
return cp;
} }
void DocumentMapping::writeTextElement(const std::wstring& text, const std::wstring& textType) void DocumentMapping::writeTextElement(const std::wstring& text, const std::wstring& textType)
......
...@@ -91,7 +91,7 @@ namespace DocFileFormat ...@@ -91,7 +91,7 @@ namespace DocFileFormat
int writeRun( std::vector<wchar_t>* chars, CharacterPropertyExceptions* chpx, int initialCp ); int writeRun( std::vector<wchar_t>* chars, CharacterPropertyExceptions* chpx, int initialCp );
/// Writes the given text to the document /// Writes the given text to the document
void writeText( std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText ); int writeText( std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText );
void writeTextElement( const std::wstring& text, const std::wstring& textType ); void writeTextElement( const std::wstring& text, const std::wstring& textType );
void writeTextStart( const std::wstring& textType, bool preserve_space); void writeTextStart( const std::wstring& textType, bool preserve_space);
void writeTextEnd( const std::wstring& textType ); void writeTextEnd( const std::wstring& textType );
......
...@@ -55,17 +55,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsFormat", "..\..\ASCOffic ...@@ -55,17 +55,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XlsFormat", "..\..\ASCOffic
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatTest", "..\DocFormatTest\DocFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocFormatTest", "..\DocFormatTest\DocFormatTest.vcproj", "{0F49D5D1-A8D3-4F97-8BC1-E2F65BB00C10}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{C5371405-338F-4B70-83BD-2A5CDF64F383} = {C5371405-338F-4B70-83BD-2A5CDF64F383}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
{C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C} {C27E9A9F-3A17-4482-9C5F-BF15C01E747C} = {C27E9A9F-3A17-4482-9C5F-BF15C01E747C}
{3423EC9A-52E4-4A4D-9753-EDEBC38785EF} = {3423EC9A-52E4-4A4D-9753-EDEBC38785EF} {3423EC9A-52E4-4A4D-9753-EDEBC38785EF} = {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}
{C5371405-338F-4B70-83BD-2A5CDF64F383} = {C5371405-338F-4B70-83BD-2A5CDF64F383}
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363} {F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0} {21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
{A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0} {A100103A-353E-45E8-A9B8-90B87CC5C0B0} = {A100103A-353E-45E8-A9B8-90B87CC5C0B0}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36} {BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D} = {77DDC8D7-5B12-4FF2-9629-26AEBCA8436D}
{36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302} {36636678-AE25-4BE6-9A34-2561D1BCF302} = {36636678-AE25-4BE6-9A34-2561D1BCF302}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\..\Common\DocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\..\Common\DocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"
......
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