Commit 5c3b05f4 authored by ElenaSubbotina's avatar ElenaSubbotina

DocFormatReader - fix bugs user files

parent 43cee9c3
......@@ -607,7 +607,11 @@ namespace DocFileFormat
{
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 )
{
......
......@@ -95,6 +95,9 @@ namespace DocFileFormat
}
current++;
}
if (current + 1 >= m_document->SectionPlex->CharacterPositions.size())
current = m_document->SectionPlex->CharacterPositions.size() - 2;
return m_document->SectionPlex->CharacterPositions[current + 1];
}
bool DocumentMapping::isSectionEnd(int cp)
......
......@@ -71,7 +71,7 @@ namespace DocFileFormat
RELEASEARRAYOBJECTS( stshi );
//create list of STDs
this->Styles = new std::vector<StyleSheetDescription*>();
Styles = new std::vector<StyleSheetDescription*>();
for ( int i = 0; i < this->stshi->cstd; i++ )
{
......@@ -84,13 +84,13 @@ namespace DocFileFormat
unsigned char* std = tableReader.ReadBytes( cbStd, true );
//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 );
}
else
{
this->Styles->push_back( NULL );
Styles->push_back( NULL );
}
}
}
......
......@@ -45,7 +45,7 @@
Name="VCCLCompilerTool"
Optimization="0"
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"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......@@ -378,6 +378,10 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\Common\FileDownloader\FileDownloader_win.cpp"
>
</File>
<File
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 @@
<References>
</References>
<Files>
<File
RelativePath="..\..\..\ASCOfficeDocxFile2\BinWriter\BinWriters.cpp"
>
</File>
<File
RelativePath="..\..\..\build\bin\icu\win_32\icuuc.lib"
>
......
......@@ -68,11 +68,13 @@ public:
int nWidth = PROP_DEF;
int nHeight = PROP_DEF;
int nLeft = PROP_DEF;
int nTop = PROP_DEF;
if( m_ooxAnchor->m_oSimplePos.IsInit())
{
int nLeft = m_ooxAnchor->m_oSimplePos->m_oX.ToTwips() ;
int nTop = m_ooxAnchor->m_oSimplePos->m_oY.ToTwips();
nLeft = m_ooxAnchor->m_oSimplePos->m_oX.ToTwips() ;
nTop = m_ooxAnchor->m_oSimplePos->m_oY.ToTwips();
}
if( m_ooxAnchor->m_oExtent.IsInit() )
......@@ -210,6 +212,7 @@ public:
if(m_ooxAnchor->m_oPositionV->m_oPosOffset.IsInit())
oOutput.m_nTop = m_ooxAnchor->m_oPositionV->m_oPosOffset->ToTwips();
}
if(m_ooxAnchor->m_oWrapNone.IsInit())
oOutput.m_nWrapType = 3;
if(m_ooxAnchor->m_oWrapSquare.IsInit())
......@@ -305,12 +308,12 @@ public:
if( PROP_DEF != nWidth && PROP_DEF != 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 )
{
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;
......
......@@ -663,10 +663,8 @@ bool OOXShapeReader::Parse( ReaderParameter oParam , RtfShapePtr& oOutput)
if( m_vmlElement->m_oCoordSize.IsInit())
{// shapeType content only size
if (oOutput->m_nGroupLeft != PROP_DEF)
oOutput->m_nGroupRight = oOutput->m_nGroupLeft + m_vmlElement->m_oCoordSize->GetX();
if (oOutput->m_nGroupTop != PROP_DEF)
oOutput->m_nGroupBottom = oOutput->m_nGroupTop + m_vmlElement->m_oCoordSize->GetY();
oOutput->m_nGroupRight = (oOutput->m_nGroupLeft != PROP_DEF ? oOutput->m_nGroupLeft : 0) + m_vmlElement->m_oCoordSize->GetX();
oOutput->m_nGroupBottom = (oOutput->m_nGroupTop != PROP_DEF ? oOutput->m_nGroupTop : 0) + m_vmlElement->m_oCoordSize->GetY();
}
if (m_vmlElement->m_oConnectorType.IsInit())
......@@ -725,14 +723,14 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapeGroupPtr& oOut
if( m_vmlGroup->m_oCoordOrigin.IsInit() )
{
oOutput->m_nGroupLeft = m_vmlGroup->m_oCoordOrigin->GetX();
oOutput->m_nGroupTop = m_vmlGroup->m_oCoordOrigin->GetY();
oOutput->m_nGroupLeft = m_vmlGroup->m_oCoordOrigin->GetX();
oOutput->m_nGroupTop = m_vmlGroup->m_oCoordOrigin->GetY();
}
if( m_vmlGroup->m_oCoordSize.IsInit())
{
oOutput->m_nGroupRight = oOutput->m_nGroupLeft + m_vmlGroup->m_oCoordSize->GetX();
oOutput->m_nGroupBottom = oOutput->m_nGroupTop + m_vmlGroup->m_oCoordSize->GetY();
oOutput->m_nGroupRight = (oOutput->m_nGroupLeft != PROP_DEF ? oOutput->m_nGroupLeft : 0) + m_vmlGroup->m_oCoordSize->GetX();
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++ )
......
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