Commit b48eb11b authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

RtfFormat - fix DPIConfig_SmallPCs.docx ( HexAuto)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@67690 954022d7-b5bf-4e40-9824-e11837661b57
parent 2179da0f
......@@ -26,7 +26,7 @@ public:
if (m_ooxPageBorder)
{
if (m_ooxPageBorder->m_oColor.IsInit())
if ((m_ooxPageBorder->m_oColor.IsInit()) && (m_ooxPageBorder->m_oColor->GetValue() == SimpleTypes::hexcolorRGB))
{
RtfColor oColor(m_ooxPageBorder->m_oColor->Get_R(), m_ooxPageBorder->m_oColor->Get_G(), m_ooxPageBorder->m_oColor->Get_B());
oOutputBorder.m_nColor = oParam.oRtf->m_oColorTable.AddItem( oColor );
......@@ -43,7 +43,7 @@ public:
if (m_ooxBorder)
{
if (m_ooxBorder->m_oColor.IsInit())
if ((m_ooxBorder->m_oColor.IsInit()) && (m_ooxBorder->m_oColor->GetValue() == SimpleTypes::hexcolorRGB))
{
RtfColor oColor(m_ooxBorder->m_oColor->Get_R(), m_ooxBorder->m_oColor->Get_G(), m_ooxBorder->m_oColor->Get_B());
oOutputBorder.m_nColor = oParam.oRtf->m_oColorTable.AddItem( oColor );
......
......@@ -58,23 +58,28 @@ public:
}
bool Parse (ReaderParameter oParam, ComplexTypes::Word::CColor ooxColor, RtfColor & oOutputColor)
{
bool res = false;
if (ooxColor.m_oThemeColor.IsInit())
{
oParam.oRtf->m_oColorTable.GetColor( ooxColor.m_oThemeColor->GetValue() , oOutputColor );
if (oOutputColor.m_eTheme != RtfColor::TC_NONE) res = true;
}
if (ooxColor.m_oThemeShade.IsInit())
{
oOutputColor.SetShade( ooxColor.m_oThemeShade->GetValue() );
res = true;
}
if (ooxColor.m_oThemeTint.IsInit())
{
oOutputColor.SetTint( ooxColor.m_oThemeTint->GetValue() );
res = true;
}
if (ooxColor.m_oVal.IsInit())
if ((ooxColor.m_oVal.IsInit()) && (ooxColor.m_oVal->GetValue() == SimpleTypes::hexcolorRGB))
{
oOutputColor.SetRGB(ooxColor.m_oVal->Get_R(), ooxColor.m_oVal->Get_G(), ooxColor.m_oVal->Get_B());
res = true;
}
return true;
return res;
}
};
......@@ -321,7 +321,10 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
oNewProperty.SetDefaultOOX();
//применяем default
oNewProperty = oParam.oRtf->m_oDefaultCharProp;
//применяем внешний стиль
oNewProperty.Merge( oOutputParagraph.m_oProperty.m_oCharProperty );
if( NULL != poStyle && TYPE_RTF_PROPERTY_STYLE_CHAR == poStyle->GetType() )
{
RtfCharStylePtr oCharStyle = boost::static_pointer_cast<RtfCharStyle, RtfStyle>( poStyle );
......@@ -1189,7 +1192,9 @@ bool OOXrPrReader::Parse( ReaderParameter oParam ,RtfCharProperty& oOutputProper
OOXColorReader oColorReader;
RtfColor oColor;
if( true == oColorReader.Parse( oParam, m_ooxRunProps->m_oColor.get2(), oColor ) )
{
oOutputProperty.m_nForeColor = oParam.oRtf->m_oColorTable.AddItem( oColor );
}
}
if( m_ooxRunProps->m_oU.IsInit() && m_ooxRunProps->m_oU->m_oVal.IsInit())
{
......@@ -1215,7 +1220,7 @@ bool OOXrPrReader::Parse( ReaderParameter oParam ,RtfCharProperty& oOutputProper
case SimpleTypes::underlineWords : oOutputProperty.m_eUnderStyle = RtfCharProperty::uls_Word; break;
}
if (m_ooxRunProps->m_oU->m_oColor.IsInit())
if ((m_ooxRunProps->m_oU->m_oColor.IsInit()) && (m_ooxRunProps->m_oU->m_oColor->GetValue() == SimpleTypes::hexcolorRGB))
{
RtfColor oColor(m_ooxRunProps->m_oU->m_oColor->Get_R(), m_ooxRunProps->m_oU->m_oColor->Get_G(), m_ooxRunProps->m_oU->m_oColor->Get_B());
oOutputProperty.m_nUnderlineColor = oParam.oRtf->m_oColorTable.AddItem( oColor );
......
......@@ -15,12 +15,12 @@ public:
{
if (m_ooxShading == NULL) return false;
if (m_ooxShading->m_oColor.IsInit())
if ((m_ooxShading->m_oColor.IsInit()) && (m_ooxShading->m_oColor->GetValue() == SimpleTypes::hexcolorRGB))
{
RtfColor oColor(m_ooxShading->m_oColor->Get_R(), m_ooxShading->m_oColor->Get_G(), m_ooxShading->m_oColor->Get_B());
oOutputShading.m_nForeColor = oParam.oRtf->m_oColorTable.AddItem( oColor );
}
if (m_ooxShading->m_oFill.IsInit())
if ((m_ooxShading->m_oFill.IsInit()) && (m_ooxShading->m_oFill->GetValue() == SimpleTypes::hexcolorRGB))
{
RtfColor oColor(m_ooxShading->m_oFill->Get_R(), m_ooxShading->m_oFill->Get_G(), m_ooxShading->m_oFill->Get_B());
oOutputShading.m_nBackColor = oParam.oRtf->m_oColorTable.AddItem( oColor );
......
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