RtfFormat - extended drawing

This commit is contained in:
ElenaSubbotina
2017-02-09 17:20:02 +03:00
parent 67a849f110
commit e0591675d2
82 changed files with 2547 additions and 1712 deletions

View File

@ -1802,7 +1802,7 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
boost::algorithm::split(splitted, sValue, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
for (int i = 2 ; i < splitted.size(); i++)
for (size_t i = 2 ; i < splitted.size(); i++)
{
XmlUtils::replace_all(splitted[i], L")", L"");
XmlUtils::replace_all(splitted[i], L"(", L"");
@ -1829,7 +1829,7 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
boost::algorithm::split(splitted, sValue, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
for (int i = 2 ; i < splitted.size(); i++)
for (size_t i = 2 ; i < splitted.size(); i++)
{
XmlUtils::replace_all(splitted[i], L")", L"");
XmlUtils::replace_all(splitted[i], L"(", L"");
@ -1847,7 +1847,7 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
}
catch(...){}
m_oShape.m_aPVerticles.push_back( std::pair<int, int>(x, y) );
m_oShape.m_aPVerticles.push_back( std::make_pair(x, y) );
}
}
else if ( L"pSegmentInfo" == m_sPropName )
@ -1856,7 +1856,7 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
boost::algorithm::split(splitted, sValue, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
for (int i = 2 ; i < splitted.size(); i++)
for (size_t i = 2 ; i < splitted.size(); i++)
{
int val = 0;
try
@ -1922,6 +1922,34 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
else if ( L"fillOpacity" == m_sPropName ) m_oShape.m_nFillOpacity = nValue * 100 / 65536;
else if ( L"fillAngle" == m_sPropName ) m_oShape.m_nFillAngle = nValue / 65536;
else if ( L"fillFocus" == m_sPropName ) m_oShape.m_nFillFocus = nValue;
else if ( L"fillShadeType" == m_sPropName ) m_oShape.m_nFillShadeType = nValue;
else if ( L"fillShadeColors"== m_sPropName )
{
std::vector< std::wstring > splitted;
boost::algorithm::split(splitted, sValue, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
for (size_t i = 2 ; i < splitted.size(); i++)
{
XmlUtils::replace_all(splitted[i], L")", L"");
XmlUtils::replace_all(splitted[i], L"(", L"");
int pos = splitted[i].find(L",");
int col = 0, pos_col = 0;
try
{
col = _wtoi(splitted[i].substr(0, pos).c_str());
}
catch(...){}
try
{
pos_col = _wtoi(splitted[i].substr(pos + 1, splitted[i].length() - 1).c_str()) * 100 / 65536;
}
catch(...){}
m_oShape.m_aFillShadeColors.push_back( std::make_pair(col, pos_col) );
}
}
else if ( L"fGtext" == m_sPropName ) m_oShape.m_bGtext = nValue;
else if ( L"gtextSize" == m_sPropName ) m_oShape.m_nGtextSize = nValue;
@ -2350,7 +2378,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
oReader.m_oState->m_oCurOldList = oOldList;
bool bExist = false;
for( int i = 0; i < (int)oDocument.m_aOldLists.size(); i++ )
for (size_t i = 0; i < oDocument.m_aOldLists.size(); i++ )
if ( oReader.m_oState->m_oCurOldList == *oDocument.m_aOldLists[i] )
{
bExist = true;
@ -2535,7 +2563,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
}
else if ( "shpgrp" == sCommand )
{
RtfShapeGroupPtr oNewShape ( new RtfShapeGroup() );
RtfShapePtr oNewShape ( new RtfShape() );
oNewShape->m_oCharProperty = oReader.m_oState->m_oCharProp;
RtfShapeGroupReader oShapeGroupReader( *oNewShape );