Commit 5c3b05f4 authored by ElenaSubbotina's avatar ElenaSubbotina

DocFormatReader - fix bugs user files

parent 43cee9c3
...@@ -607,7 +607,11 @@ namespace DocFileFormat ...@@ -607,7 +607,11 @@ namespace DocFileFormat
{ {
if ( istd < styleSheet->Styles->size() ) if ( istd < styleSheet->Styles->size() )
{ {
CharacterPropertyExceptions* baseChpx = styleSheet->Styles->at( istd )->chpx; StyleSheetDescription* style = styleSheet->Styles->at( istd );
if (!style)
break;
CharacterPropertyExceptions* baseChpx = style->chpx;
if ( baseChpx != NULL ) if ( baseChpx != NULL )
{ {
......
...@@ -95,6 +95,9 @@ namespace DocFileFormat ...@@ -95,6 +95,9 @@ namespace DocFileFormat
} }
current++; current++;
} }
if (current + 1 >= m_document->SectionPlex->CharacterPositions.size())
current = m_document->SectionPlex->CharacterPositions.size() - 2;
return m_document->SectionPlex->CharacterPositions[current + 1]; return m_document->SectionPlex->CharacterPositions[current + 1];
} }
bool DocumentMapping::isSectionEnd(int cp) bool DocumentMapping::isSectionEnd(int cp)
......
...@@ -71,7 +71,7 @@ namespace DocFileFormat ...@@ -71,7 +71,7 @@ namespace DocFileFormat
RELEASEARRAYOBJECTS( stshi ); RELEASEARRAYOBJECTS( stshi );
//create list of STDs //create list of STDs
this->Styles = new std::vector<StyleSheetDescription*>(); Styles = new std::vector<StyleSheetDescription*>();
for ( int i = 0; i < this->stshi->cstd; i++ ) for ( int i = 0; i < this->stshi->cstd; i++ )
{ {
...@@ -84,13 +84,13 @@ namespace DocFileFormat ...@@ -84,13 +84,13 @@ namespace DocFileFormat
unsigned char* std = tableReader.ReadBytes( cbStd, true ); unsigned char* std = tableReader.ReadBytes( cbStd, true );
//parse the STD bytes //parse the STD bytes
this->Styles->push_back( new StyleSheetDescription( std, cbStd, (int)this->stshi->cbSTDBaseInFile, dataStream, fib->m_bOlderVersion) ); Styles->push_back( new StyleSheetDescription( std, cbStd, (int)this->stshi->cbSTDBaseInFile, dataStream, fib->m_bOlderVersion) );
RELEASEARRAYOBJECTS( std ); RELEASEARRAYOBJECTS( std );
} }
else else
{ {
this->Styles->push_back( NULL ); Styles->push_back( NULL );
} }
} }
} }
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\..\Common\OfficeDrawing;&quot;..\..\..\..\..\DesktopEditor\freetype-2.5.2\include&quot;;..\..\..\..\..\Common\OfficeDrawing\Shapes" AdditionalIncludeDirectories="..\..\..\..\..\Common\OfficeDrawing;&quot;..\..\..\..\..\DesktopEditor\freetype-2.5.2\include&quot;;..\..\..\..\..\Common\OfficeDrawing\Shapes"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ATL_CSTRINGS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;USE_ATL_CSTRINGS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="false" MinimalRebuild="false"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
...@@ -378,6 +378,10 @@ ...@@ -378,6 +378,10 @@
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath="..\..\Common\FileDownloader\FileDownloader_win.cpp"
>
</File>
<File <File
RelativePath="..\..\Common\DocxFormat\Source\XML\libxml2\libxml2.cpp" RelativePath="..\..\Common\DocxFormat\Source\XML\libxml2\libxml2.cpp"
> >
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -340,6 +340,10 @@ ...@@ -340,6 +340,10 @@
<References> <References>
</References> </References>
<Files> <Files>
<File
RelativePath="..\..\..\ASCOfficeDocxFile2\BinWriter\BinWriters.cpp"
>
</File>
<File <File
RelativePath="..\..\..\build\bin\icu\win_32\icuuc.lib" RelativePath="..\..\..\build\bin\icu\win_32\icuuc.lib"
> >
......
...@@ -68,11 +68,13 @@ public: ...@@ -68,11 +68,13 @@ public:
int nWidth = PROP_DEF; int nWidth = PROP_DEF;
int nHeight = PROP_DEF; int nHeight = PROP_DEF;
int nLeft = PROP_DEF;
int nTop = PROP_DEF;
if( m_ooxAnchor->m_oSimplePos.IsInit()) if( m_ooxAnchor->m_oSimplePos.IsInit())
{ {
int nLeft = m_ooxAnchor->m_oSimplePos->m_oX.ToTwips() ; nLeft = m_ooxAnchor->m_oSimplePos->m_oX.ToTwips() ;
int nTop = m_ooxAnchor->m_oSimplePos->m_oY.ToTwips(); nTop = m_ooxAnchor->m_oSimplePos->m_oY.ToTwips();
} }
if( m_ooxAnchor->m_oExtent.IsInit() ) if( m_ooxAnchor->m_oExtent.IsInit() )
...@@ -210,6 +212,7 @@ public: ...@@ -210,6 +212,7 @@ public:
if(m_ooxAnchor->m_oPositionV->m_oPosOffset.IsInit()) if(m_ooxAnchor->m_oPositionV->m_oPosOffset.IsInit())
oOutput.m_nTop = m_ooxAnchor->m_oPositionV->m_oPosOffset->ToTwips(); oOutput.m_nTop = m_ooxAnchor->m_oPositionV->m_oPosOffset->ToTwips();
} }
if(m_ooxAnchor->m_oWrapNone.IsInit()) if(m_ooxAnchor->m_oWrapNone.IsInit())
oOutput.m_nWrapType = 3; oOutput.m_nWrapType = 3;
if(m_ooxAnchor->m_oWrapSquare.IsInit()) if(m_ooxAnchor->m_oWrapSquare.IsInit())
...@@ -305,12 +308,12 @@ public: ...@@ -305,12 +308,12 @@ public:
if( PROP_DEF != nWidth && PROP_DEF != oOutput.m_oPicture->m_nWidthGoal ) if( PROP_DEF != nWidth && PROP_DEF != oOutput.m_oPicture->m_nWidthGoal )
{ {
int nNewScale = (int)(100 * ( 1.0 * nWidth / oOutput.m_oPicture->m_nWidthGoal )); int nNewScale = (int)(100 * ( 1.0 * nWidth / oOutput.m_oPicture->m_nWidthGoal ));
oOutput.m_oPicture->m_dScaleX = nNewScale; oOutput.m_oPicture->m_dScaleX = nNewScale;
} }
if( PROP_DEF != nHeight && PROP_DEF != oOutput.m_oPicture->m_nHeightGoal ) if( PROP_DEF != nHeight && PROP_DEF != oOutput.m_oPicture->m_nHeightGoal )
{ {
int nNewScale = (int)(100 * ( 1.0 * nHeight / oOutput.m_oPicture->m_nHeightGoal )); int nNewScale = (int)(100 * ( 1.0 * nHeight / oOutput.m_oPicture->m_nHeightGoal ));
oOutput.m_oPicture->m_dScaleY = nNewScale; oOutput.m_oPicture->m_dScaleY = nNewScale;
} }
return true; return true;
......
...@@ -663,10 +663,8 @@ bool OOXShapeReader::Parse( ReaderParameter oParam , RtfShapePtr& oOutput) ...@@ -663,10 +663,8 @@ bool OOXShapeReader::Parse( ReaderParameter oParam , RtfShapePtr& oOutput)
if( m_vmlElement->m_oCoordSize.IsInit()) if( m_vmlElement->m_oCoordSize.IsInit())
{// shapeType content only size {// shapeType content only size
if (oOutput->m_nGroupLeft != PROP_DEF) oOutput->m_nGroupRight = (oOutput->m_nGroupLeft != PROP_DEF ? oOutput->m_nGroupLeft : 0) + m_vmlElement->m_oCoordSize->GetX();
oOutput->m_nGroupRight = oOutput->m_nGroupLeft + m_vmlElement->m_oCoordSize->GetX(); oOutput->m_nGroupBottom = (oOutput->m_nGroupTop != PROP_DEF ? oOutput->m_nGroupTop : 0) + m_vmlElement->m_oCoordSize->GetY();
if (oOutput->m_nGroupTop != PROP_DEF)
oOutput->m_nGroupBottom = oOutput->m_nGroupTop + m_vmlElement->m_oCoordSize->GetY();
} }
if (m_vmlElement->m_oConnectorType.IsInit()) if (m_vmlElement->m_oConnectorType.IsInit())
...@@ -725,14 +723,14 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapeGroupPtr& oOut ...@@ -725,14 +723,14 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapeGroupPtr& oOut
if( m_vmlGroup->m_oCoordOrigin.IsInit() ) if( m_vmlGroup->m_oCoordOrigin.IsInit() )
{ {
oOutput->m_nGroupLeft = m_vmlGroup->m_oCoordOrigin->GetX(); oOutput->m_nGroupLeft = m_vmlGroup->m_oCoordOrigin->GetX();
oOutput->m_nGroupTop = m_vmlGroup->m_oCoordOrigin->GetY(); oOutput->m_nGroupTop = m_vmlGroup->m_oCoordOrigin->GetY();
} }
if( m_vmlGroup->m_oCoordSize.IsInit()) if( m_vmlGroup->m_oCoordSize.IsInit())
{ {
oOutput->m_nGroupRight = oOutput->m_nGroupLeft + m_vmlGroup->m_oCoordSize->GetX(); oOutput->m_nGroupRight = (oOutput->m_nGroupLeft != PROP_DEF ? oOutput->m_nGroupLeft : 0) + m_vmlGroup->m_oCoordSize->GetX();
oOutput->m_nGroupBottom = oOutput->m_nGroupTop + m_vmlGroup->m_oCoordSize->GetY(); oOutput->m_nGroupBottom =(oOutput->m_nGroupTop != PROP_DEF ? oOutput->m_nGroupTop : 0) + m_vmlGroup->m_oCoordSize->GetY();
} }
for( int i = 0; i < m_vmlGroup->m_arrItems.size() ; i++ ) for( int i = 0; i < m_vmlGroup->m_arrItems.size() ; i++ )
......
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