Commit 45231b82 authored by ElenaSubbotina's avatar ElenaSubbotina

RtfFormat - fix croping image, ...

parent e0591675
......@@ -85,7 +85,7 @@ int OOXGraphicReader::Parse( ReaderParameter oParam , RtfShapePtr & pOutput)
OOX::Drawing::CPicture *picture = dynamic_cast<OOX::Drawing::CPicture *>(m_ooxGraphic->m_arrItems[i]);
if (picture)
if (OOXShapeReader::Parse(oParam, &picture->m_oBlipFill, pOutput))
if (OOXShapeReader::Parse(oParam, pOutput, &picture->m_oBlipFill))
return 1;
}
}
......
......@@ -304,20 +304,6 @@ public:
result = oGraphicReader.Parse( oParam, pOutput);
}
//изменяем scale в соответсявии с выходным размером
if (pOutput->m_oPicture)
{
if( PROP_DEF != nWidth && PROP_DEF != pOutput->m_oPicture->m_nWidthGoal )
{
int nNewScale = (int)(100 * ( 1.0 * nWidth / pOutput->m_oPicture->m_nWidthGoal ));
pOutput->m_oPicture->m_dScaleX = nNewScale;
}
if( PROP_DEF != nHeight && PROP_DEF != pOutput->m_oPicture->m_nHeightGoal )
{
int nNewScale = (int)(100 * ( 1.0 * nHeight / pOutput->m_oPicture->m_nHeightGoal ));
pOutput->m_oPicture->m_dScaleY = nNewScale;
}
}
if( PROP_DEF == pOutput->m_nBottom && pOutput->m_nTop !=PROP_DEF )
{
pOutput->m_nBottom = pOutput->m_nTop + nHeight;
......
......@@ -85,20 +85,6 @@ public:
result = oGraphicReader.Parse( oParam, pOutput);
}
//изменяем scale в соответсявии с выходным размером
if (pOutput->m_oPicture)
{
if( PROP_DEF != nWidth && PROP_DEF != pOutput->m_oPicture->m_nWidthGoal )
{
double dNewScale = 100 * ( 1.0 * nWidth / pOutput->m_oPicture->m_nWidthGoal ) ;
pOutput->m_oPicture->m_dScaleX = dNewScale;
}
if( PROP_DEF != nHeight && PROP_DEF != pOutput->m_oPicture->m_nHeightGoal )
{
double dNewScale = 100 * ( 1.0 * nHeight / pOutput->m_oPicture->m_nHeightGoal );
pOutput->m_oPicture->m_dScaleY = dNewScale;
}
}
return result;
}
};
......@@ -64,9 +64,10 @@ public:
bool Parse ( ReaderParameter oParam , RtfShapePtr& oOutput);
bool ParseVmlChild ( ReaderParameter oParam , RtfShapePtr& oOutput);
bool ParseVml ( ReaderParameter oParam , RtfShapePtr& oOutput);
void ParseAdjustment(RtfShape& oShape, std::wstring sAdjustment);
static bool Parse(ReaderParameter oParam, OOX::Drawing::CBlipFillProperties *oox_bitmap_fill, RtfShapePtr& pOutput);
static bool Parse(ReaderParameter oParam, RtfShapePtr& pOutput, OOX::Drawing::CBlipFillProperties *oox_bitmap_fill);
private:
bool Parse(ReaderParameter oParam, int indexSchemeColor, BYTE& ucA, BYTE& ucG, BYTE& ucB, BYTE& ucR);
......@@ -75,12 +76,12 @@ private:
void Parse(ReaderParameter oParam, OOX::Drawing::Colors::CColorTransform *oox_ScrgbClr, unsigned int & nColor, _CP_OPT(double) &opacity);
void Parse(ReaderParameter oParam, OOX::Drawing::CSolidColorFillProperties *oox_solid_fill, unsigned int & nColor, _CP_OPT(double) &opacity);
void Parse(ReaderParameter oParam, OOX::Drawing::CLineProperties *oox_line_prop , RtfShapePtr& pOutput);
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, OOX::Drawing::CStyleMatrixReference *style_matrix_ref);
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, OOX::Drawing::CLineProperties *oox_line_prop, std::wstring *change_sheme_color = NULL);
void Parse(ReaderParameter oParam, OOX::Drawing::CGradientFillProperties *oox_grad_fill, RtfShapePtr& pOutput);
void Parse(ReaderParameter oParam, OOX::Drawing::CPatternFillProperties *oox_pattern_fill, RtfShapePtr& pOutput);
void Parse(ReaderParameter oParam, OOX::Drawing::CSolidColorFillProperties *oox_solid_fill, RtfShapePtr& pOutput);
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, OOX::Drawing::CGradientFillProperties *oox_grad_fill, std::wstring *change_sheme_color = NULL);
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, OOX::Drawing::CPatternFillProperties *oox_pattern_fill, std::wstring *change_sheme_color = NULL);
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, OOX::Drawing::CSolidColorFillProperties *oox_solid_fill, std::wstring *change_sheme_color = NULL);
//---------------------------------------------------------------------------
OOX::Vml::CVmlCommonElements *m_vmlElement;
OOX::WritingElementWithChilds<OOX::WritingElement> *m_arrElement;
......
......@@ -360,7 +360,7 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
sResult += m_oPicture->RenderToRtf( oRenderParameter );
sResult += L"}}";
}
else if (m_nFillType == 1 || m_nFillType == 2 || m_nFillType == 9)
else if (m_nFillType == 1 || m_nFillType == 2 || m_nFillType == 3 || m_nFillType == 9)
{
sResult += L"{\\sp{\\sn fillType}{\\sv 2}}";
sResult += L"{\\sp{\\sn fillBlip}{\\sv ";
......@@ -846,7 +846,8 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
//sStyle += L"right: " + std::to_wstring() + L";" , m_nRelRight);
sStyle += L"width: " + std::to_wstring(nWidth) + L";height: " + std::to_wstring(nHeight) + L";";
}
else if( 0 != m_oPicture && PROP_DEF != m_oPicture->m_nWidthGoal && PROP_DEF != m_oPicture->m_nHeightGoal && PROP_DEF != (int)m_oPicture->m_dScaleX && PROP_DEF != (int)m_oPicture->m_dScaleY )
else if( 0 != m_oPicture && PROP_DEF != m_oPicture->m_nWidthGoal && PROP_DEF != m_oPicture->m_nHeightGoal
&& PROP_DEF != (int)m_oPicture->m_dScaleX && PROP_DEF != (int)m_oPicture->m_dScaleY )
{
float nWidth = (int)(m_oPicture->m_nWidthGoal * m_oPicture->m_dScaleX / 100.);
if( PROP_DEF != m_oPicture->m_nCropL )
......
......@@ -314,7 +314,7 @@ namespace SimpleTypes
bool bResult = true;
unResult = 0;
for ( size_t nIndex = sValue.length() - 1, nMult = 0; nIndex >= 0; nIndex--, nMult += 4 )
for ( int nIndex = (int)sValue.length() - 1, nMult = 0; nIndex >= 0; nIndex--, nMult += 4 )
{
unResult += HexToInt( (int)sValue[nIndex], bResult ) << nMult;
}
......
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