Commit 8e17291c authored by ElenaSubbotina's avatar ElenaSubbotina

RtfFormatWriter

parent b7fb3d89
...@@ -72,100 +72,70 @@ ...@@ -72,100 +72,70 @@
#include "math.h" #include "math.h"
class RtfBorderCommand class RtfBorderCommand
{ {
public:static bool ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CString sCommand, bool hasParameter, int parameter,RtfBorder& oOutput) public:
{ static bool ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader,CString sCommand, bool hasParameter, int parameter,RtfBorder& oOutput)
if( _T("brdrs") == sCommand ) {
oOutput.m_eType = RtfBorder::bt_brdrs; if( _T("brdrs") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrs;
else if( _T("brdrth") == sCommand ) else if( _T("brdrth") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrth;
oOutput.m_eType = RtfBorder::bt_brdrth; else if( _T("brdrsh") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrsh;
else if( _T("brdrsh") == sCommand ) else if( _T("brdrdb") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrdb;
oOutput.m_eType = RtfBorder::bt_brdrsh; else if( _T("brdrdot") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrdot;
else if( _T("brdrdb") == sCommand ) else if( _T("brdrdash") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrdash;
oOutput.m_eType = RtfBorder::bt_brdrdb; else if( _T("brdrhair") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrhair;
else if( _T("brdrdot") == sCommand ) else if( _T("brdrdashsm") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrdashsm;
oOutput.m_eType = RtfBorder::bt_brdrdot; else if( _T("brdrdashd") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrdashd;
else if( _T("brdrdash") == sCommand ) else if( _T("brdrdashdd") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrdashdd;
oOutput.m_eType = RtfBorder::bt_brdrdash; else if( _T("brdrdashdot") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrdashdot;
else if( _T("brdrhair") == sCommand ) else if( _T("brdrdashdotdot") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrdashdot;
oOutput.m_eType = RtfBorder::bt_brdrhair; else if( _T("brdrtriple") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrtriple;
else if( _T("brdrdashsm") == sCommand ) else if( _T("brdrtnthsg") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrtnthsg;
oOutput.m_eType = RtfBorder::bt_brdrdashsm; else if( _T("brdrthtnsg") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrthtnsg;
else if( _T("brdrdashd") == sCommand ) else if( _T("brdrtnthtnsg") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrtnthtnsg;
oOutput.m_eType = RtfBorder::bt_brdrdashd; else if( _T("brdrtnthmg") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrtnthmg;
else if( _T("brdrdashdd") == sCommand ) else if( _T("brdrthtnmg") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrthtnmg;
oOutput.m_eType = RtfBorder::bt_brdrdashdd; else if( _T("brdrtnthtnmg") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrtnthtnmg;
else if( _T("brdrdashdot") == sCommand ) else if( _T("brdrtnthlg") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrtnthlg;
oOutput.m_eType = RtfBorder::bt_brdrdashdot; else if( _T("brdrthtnlg") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrthtnlg;
else if( _T("brdrdashdotdot") == sCommand ) else if( _T("brdrtnthtnlg") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrtnthtnlg;
oOutput.m_eType = RtfBorder::bt_brdrdashdot; else if( _T("brdrwavy") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrwavy;
else if( _T("brdrtriple") == sCommand ) else if( _T("brdrwavydb") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrwavydb;
oOutput.m_eType = RtfBorder::bt_brdrtriple; else if( _T("brdrdashdotstr") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrdashdotstr;
else if( _T("brdrtnthsg") == sCommand ) else if( _T("brdremboss") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdremboss;
oOutput.m_eType = RtfBorder::bt_brdrtnthsg; else if( _T("brdrengrave") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrengrave;
else if( _T("brdrthtnsg") == sCommand ) else if( _T("brdroutset") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdroutset;
oOutput.m_eType = RtfBorder::bt_brdrthtnsg; else if( _T("brdrinset") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrinset;
else if( _T("brdrtnthtnsg") == sCommand ) else if( _T("brdrnone") == sCommand ) oOutput.m_eType = RtfBorder::bt_brdrnone;
oOutput.m_eType = RtfBorder::bt_brdrtnthtnsg; else if( _T("brdrw") == sCommand )
else if( _T("brdrtnthmg") == sCommand ) {
oOutput.m_eType = RtfBorder::bt_brdrtnthmg; if( true == hasParameter )
else if( _T("brdrthtnmg") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdrthtnmg;
else if( _T("brdrtnthtnmg") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdrtnthtnmg;
else if( _T("brdrtnthlg") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdrtnthlg;
else if( _T("brdrthtnlg") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdrthtnlg;
else if( _T("brdrtnthtnlg") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdrtnthtnlg;
else if( _T("brdrwavy") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdrwavy;
else if( _T("brdrwavydb") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdrwavydb;
else if( _T("brdrdashdotstr") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdrdashdotstr;
else if( _T("brdremboss") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdremboss;
else if( _T("brdrengrave") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdrengrave;
else if( _T("brdroutset") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdroutset;
else if( _T("brdrinset") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdrinset;
else if( _T("brdrnone") == sCommand )
oOutput.m_eType = RtfBorder::bt_brdrnone;
else if( _T("brdrw") == sCommand )
{ {
if( true == hasParameter ) oOutput.m_nWidth = parameter;
{ if( RtfBorder::bt_none == oOutput.m_eType )
oOutput.m_nWidth = parameter; oOutput.m_eType = RtfBorder::bt_brdrs;
if( RtfBorder::bt_none == oOutput.m_eType )
oOutput.m_eType = RtfBorder::bt_brdrs;
}
} }
else if( _T("brsp") == sCommand ) }
else if( _T("brsp") == sCommand )
{
if( true == hasParameter )
{ {
if( true == hasParameter ) oOutput.m_nSpace = parameter;
{ if( RtfBorder::bt_none == oOutput.m_eType )
oOutput.m_nSpace = parameter; oOutput.m_eType = RtfBorder::bt_brdrs;
if( RtfBorder::bt_none == oOutput.m_eType )
oOutput.m_eType = RtfBorder::bt_brdrs;
}
} }
else if( _T("brdrcf") == sCommand ) }
else if( _T("brdrcf") == sCommand )
{
if( true == hasParameter )
{ {
if( true == hasParameter ) oOutput.m_nColor = parameter;
{ if( RtfBorder::bt_none == oOutput.m_eType )
oOutput.m_nColor = parameter; oOutput.m_eType = RtfBorder::bt_brdrs;
if( RtfBorder::bt_none == oOutput.m_eType )
oOutput.m_eType = RtfBorder::bt_brdrs;
}
} }
else
return false;
return true;
} }
else
return false;
return true;
}
}; };
class RtfShadingCommand class RtfShadingCommand
{ {
......
...@@ -282,7 +282,7 @@ public: ...@@ -282,7 +282,7 @@ public:
} }
} }
if (oOutputBorder.m_eType != RtfBorder::bt_brdrnone) if (oOutputBorder.m_eType != RtfBorder::bt_none)
{ {
if ((m_ooxBorder->m_oColor.IsInit()) && (m_ooxBorder->m_oColor->GetValue() == SimpleTypes::hexcolorRGB)) if ((m_ooxBorder->m_oColor.IsInit()) && (m_ooxBorder->m_oColor->GetValue() == SimpleTypes::hexcolorRGB))
{ {
......
...@@ -370,11 +370,11 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap ...@@ -370,11 +370,11 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
if (ooxText) if (ooxText)
{ {
CString sValue; CString sValue;
if ((ooxText->m_oSpace.IsInit()) && (ooxText->m_oSpace->GetValue() == SimpleTypes::xmlspacePreserve)) //if ((ooxText->m_oSpace.IsInit()) && (ooxText->m_oSpace->GetValue() == SimpleTypes::xmlspacePreserve))
{ //{
sValue = RtfUtility::Preserve(ooxText->m_sText); // sValue = RtfUtility::Preserve(ooxText->m_sText);
} //}
else //else
sValue = ooxText->m_sText; sValue = ooxText->m_sText;
RtfCharPtr oNewChar = RtfCharPtr( new RtfChar() ); RtfCharPtr oNewChar = RtfCharPtr( new RtfChar() );
......
...@@ -51,11 +51,11 @@ public: ...@@ -51,11 +51,11 @@ public:
oOutput.m_eAnchorTypeShape = RtfShape::st_anchor; oOutput.m_eAnchorTypeShape = RtfShape::st_anchor;
oOutput.m_nShapeType = 75;//NSOfficeDrawing::sptPictureFrame; oOutput.m_nShapeType = 75;//NSOfficeDrawing::sptPictureFrame;
oOutput.m_bAllowOverlap = m_ooxAnchor->m_oAllowOverlap.IsInit() ? m_ooxAnchor->m_oAllowOverlap->ToBool() : false; oOutput.m_bAllowOverlap = m_ooxAnchor->m_oAllowOverlap.IsInit() ? m_ooxAnchor->m_oAllowOverlap->ToBool() : false;
oOutput.m_nZOrderRelative = m_ooxAnchor->m_oBehindDoc.IsInit() ? m_ooxAnchor->m_oBehindDoc->ToBool() : false; oOutput.m_nZOrderRelative = m_ooxAnchor->m_oBehindDoc.IsInit() ? m_ooxAnchor->m_oBehindDoc->ToBool() : false;
oOutput.m_bHidden = m_ooxAnchor->m_oHidden.IsInit() ? m_ooxAnchor->m_oHidden->ToBool() : false; oOutput.m_bHidden = m_ooxAnchor->m_oHidden.IsInit() ? m_ooxAnchor->m_oHidden->ToBool() : false;
oOutput.m_bLayoutInCell = m_ooxAnchor->m_oLayoutInCell.IsInit() ? m_ooxAnchor->m_oLayoutInCell->ToBool() : false; oOutput.m_bLayoutInCell = m_ooxAnchor->m_oLayoutInCell.IsInit() ? m_ooxAnchor->m_oLayoutInCell->ToBool() : false;
oOutput.m_bLockAnchor = m_ooxAnchor->m_oLocked.IsInit() ? m_ooxAnchor->m_oLocked->ToBool() : false; oOutput.m_bLockAnchor = m_ooxAnchor->m_oLocked.IsInit() ? m_ooxAnchor->m_oLocked->ToBool() : false;
oOutput.m_nZOrder = m_ooxAnchor->m_oRelativeHeight.IsInit() ? true : false; oOutput.m_nZOrder = m_ooxAnchor->m_oRelativeHeight.IsInit() ? true : false;
int nDistLeft = m_ooxAnchor->m_oDistL.IsInit() ? m_ooxAnchor->m_oDistL->ToTwips() : PROP_DEF; int nDistLeft = m_ooxAnchor->m_oDistL.IsInit() ? m_ooxAnchor->m_oDistL->ToTwips() : PROP_DEF;
...@@ -94,46 +94,46 @@ public: ...@@ -94,46 +94,46 @@ public:
{ {
switch(m_ooxAnchor->m_oPositionH->m_oRelativeFrom->GetValue()) switch(m_ooxAnchor->m_oPositionH->m_oRelativeFrom->GetValue())
{ {
case SimpleTypes::relfromhCharacter : case SimpleTypes::relfromhCharacter:
{ {
oOutput.m_nPositionHRelative = 3; oOutput.m_nPositionHRelative = 3;
oOutput.m_eXAnchor = RtfShape::ax_margin; oOutput.m_eXAnchor = RtfShape::ax_margin;
}break; }break;
case SimpleTypes::relfromhColumn : case SimpleTypes::relfromhColumn:
{ {
oOutput.m_nPositionHRelative = 2; oOutput.m_nPositionHRelative = 2;
oOutput.m_eXAnchor = RtfShape::ax_column; oOutput.m_eXAnchor = RtfShape::ax_column;
}break; }break;
case SimpleTypes::relfromhInsideMargin : case SimpleTypes::relfromhInsideMargin:
{ {
oOutput.m_nPositionHRelative = 6; oOutput.m_nPositionHRelative = 6;
oOutput.m_eXAnchor = RtfShape::ax_margin; oOutput.m_eXAnchor = RtfShape::ax_margin;
}break; }break;
case SimpleTypes::relfromhLeftMargin : case SimpleTypes::relfromhLeftMargin:
{ {
oOutput.m_nPositionHRelative = 4; oOutput.m_nPositionHRelative = 4;
oOutput.m_eXAnchor = RtfShape::ax_margin; oOutput.m_eXAnchor = RtfShape::ax_margin;
}break; }break;
case SimpleTypes::relfromhMargin : case SimpleTypes::relfromhMargin:
{ {
oOutput.m_nPositionHRelative = 0; oOutput.m_nPositionHRelative = 0;
oOutput.m_eXAnchor = RtfShape::ax_margin; oOutput.m_eXAnchor = RtfShape::ax_margin;
}break; }break;
case SimpleTypes::relfromhOutsideMargin : case SimpleTypes::relfromhOutsideMargin:
{ {
oOutput.m_nPositionHRelative = 7; oOutput.m_nPositionHRelative = 7;
oOutput.m_eXAnchor = RtfShape::ax_margin; oOutput.m_eXAnchor = RtfShape::ax_margin;
}break; }break;
case SimpleTypes::relfromhPage : case SimpleTypes::relfromhPage :
{ {
oOutput.m_nPositionHRelative = 1; oOutput.m_nPositionHRelative = 1;
oOutput.m_eXAnchor = RtfShape::ax_page; oOutput.m_eXAnchor = RtfShape::ax_page;
}break; }break;
case SimpleTypes::relfromhRightMargin : case SimpleTypes::relfromhRightMargin :
{ {
oOutput.m_nPositionHRelative = 5; oOutput.m_nPositionHRelative = 5;
oOutput.m_eXAnchor = RtfShape::ax_margin; oOutput.m_eXAnchor = RtfShape::ax_margin;
}break; }break;
} }
} }
if (m_ooxAnchor->m_oPositionH->m_oAlign.IsInit()) if (m_ooxAnchor->m_oPositionH->m_oAlign.IsInit())
......
...@@ -170,7 +170,10 @@ bool ParseStyle(RtfShape* pShape, SimpleTypes::Vml::CCssProperty* prop) ...@@ -170,7 +170,10 @@ bool ParseStyle(RtfShape* pShape, SimpleTypes::Vml::CCssProperty* prop)
case SimpleTypes::Vml::cssptRotation: case SimpleTypes::Vml::cssptRotation:
{ {
pShape->m_nRotation = 65536 * prop->get_Value().dValue; pShape->m_nRotation = 65536 * prop->get_Value().dValue;
if( PROP_DEF != pShape->m_nRelRight || PROP_DEF != pShape->m_nRelLeft || PROP_DEF != pShape->m_nRelTop || PROP_DEF != pShape->m_nRelBottom ) if( PROP_DEF != pShape->m_nRelRight
|| PROP_DEF != pShape->m_nRelLeft
|| PROP_DEF != pShape->m_nRelTop
|| PROP_DEF != pShape->m_nRelBottom )
pShape->m_nRelRotation = pShape->m_nRotation; pShape->m_nRelRotation = pShape->m_nRotation;
}break; }break;
case SimpleTypes::Vml::cssptVisibility : case SimpleTypes::Vml::cssptVisibility :
...@@ -207,11 +210,19 @@ bool ParseStyle(RtfShape* pShape, SimpleTypes::Vml::CCssProperty* prop) ...@@ -207,11 +210,19 @@ bool ParseStyle(RtfShape* pShape, SimpleTypes::Vml::CCssProperty* prop)
}break; }break;
case SimpleTypes::Vml::csspctMsoWidthPercent: case SimpleTypes::Vml::csspctMsoWidthPercent:
{ {
pShape->m_nPctWidth = prop->get_Value().oValue.dValue; pShape->m_nPctWidth = prop->get_Value().dValue;
}break; }break;
case SimpleTypes::Vml::csspctMsoHeightPercent: case SimpleTypes::Vml::csspctMsoHeightPercent:
{ {
pShape->m_nPctHeight = prop->get_Value().oValue.dValue; pShape->m_nPctHeight = prop->get_Value().dValue;
}break;
case SimpleTypes::Vml::cssptVRotateLetters:
{
pShape->m_bGtextFVertical = prop->get_Value().bValue;
}break;
case SimpleTypes::Vml::cssptVTextKern:
{
pShape->m_bGtextFKern = prop->get_Value().bValue;
}break; }break;
case SimpleTypes::Vml::cssptDirection : break; case SimpleTypes::Vml::cssptDirection : break;
case SimpleTypes::Vml::cssptLayoutFlow : break; case SimpleTypes::Vml::cssptLayoutFlow : break;
...@@ -228,10 +239,8 @@ bool ParseStyle(RtfShape* pShape, SimpleTypes::Vml::CCssProperty* prop) ...@@ -228,10 +239,8 @@ bool ParseStyle(RtfShape* pShape, SimpleTypes::Vml::CCssProperty* prop)
case SimpleTypes::Vml::cssptFontWeight : break; case SimpleTypes::Vml::cssptFontWeight : break;
case SimpleTypes::Vml::cssptMsoTextShadow : break; case SimpleTypes::Vml::cssptMsoTextShadow : break;
case SimpleTypes::Vml::cssptTextDecoration : break; case SimpleTypes::Vml::cssptTextDecoration : break;
case SimpleTypes::Vml::cssptVRotateLetters : break;
case SimpleTypes::Vml::cssptVSameLetterHeights : break; case SimpleTypes::Vml::cssptVSameLetterHeights : break;
case SimpleTypes::Vml::cssptVTextAlign : break; case SimpleTypes::Vml::cssptVTextAlign : break;
case SimpleTypes::Vml::cssptVTextKern : break;
case SimpleTypes::Vml::cssptVTextReverse : break; case SimpleTypes::Vml::cssptVTextReverse : break;
case SimpleTypes::Vml::cssptVTextSpacingMode : break; case SimpleTypes::Vml::cssptVTextSpacingMode : break;
case SimpleTypes::Vml::cssptVTextSpacing : break; case SimpleTypes::Vml::cssptVTextSpacing : break;
...@@ -298,13 +307,17 @@ bool OOXShapeReader::Parse2( ReaderParameter oParam , RtfShapePtr& oOutput) ...@@ -298,13 +307,17 @@ bool OOXShapeReader::Parse2( ReaderParameter oParam , RtfShapePtr& oOutput)
oOutput->m_oPicture = RtfPicturePtr( new RtfPicture() ); oOutput->m_oPicture = RtfPicturePtr( new RtfPicture() );
//todooo проверить что за путь тут выставляется //todooo проверить что за путь тут выставляется
OOXPictureGraphicReader::WriteDataToPicture( sImagePath, *oOutput->m_oPicture, oParam.oReader->m_sPath ); OOXPictureGraphicReader::WriteDataToPicture( sImagePath, *oOutput->m_oPicture, oParam.oReader->m_sPath );
oOutput->m_nFillType = 2;
} }
} }
if (fill->m_oColor.IsInit()) if (fill->m_oColor.IsInit())
oOutput->m_nFillColor = (fill->m_oColor->Get_B() << 16) + (fill->m_oColor->Get_G() << 8) + fill->m_oColor->Get_R(); oOutput->m_nFillColor = (fill->m_oColor->Get_B() << 16) + (fill->m_oColor->Get_G() << 8) + fill->m_oColor->Get_R();
if (fill->m_oColor2.IsInit()) if (fill->m_oColor2.IsInit())
oOutput->m_nFillColor2 = (fill->m_oColor2->Get_B() << 16) + (fill->m_oColor2->Get_G() << 8) + fill->m_oColor2->Get_R(); {
oOutput->m_nFillColor2 = (fill->m_oColor2->Get_B() << 16) + (fill->m_oColor2->Get_G() << 8) + fill->m_oColor2->Get_R();
}
if (fill->m_oOpacity.IsInit()) if (fill->m_oOpacity.IsInit())
oOutput->m_nFillOpacity = fill->m_oOpacity->GetValue() * 100; oOutput->m_nFillOpacity = fill->m_oOpacity->GetValue() * 100;
...@@ -479,6 +492,15 @@ bool OOXShapeReader::Parse2( ReaderParameter oParam , RtfShapePtr& oOutput) ...@@ -479,6 +492,15 @@ bool OOXShapeReader::Parse2( ReaderParameter oParam , RtfShapePtr& oOutput)
{ {
oOutput->m_sGtextUNICODE = text_path->m_sString.get(); oOutput->m_sGtextUNICODE = text_path->m_sString.get();
} }
if ((text_path->m_oFitPath.IsInit()) && (text_path->m_oFitPath->GetValue()))
{
oOutput->m_bGtextFStretch = 1;
oOutput->m_bGtextFBestFit = 1;
oOutput->m_bGtextFShrinkFit = 1;
}
if (text_path->m_oTrim.IsInit())
{
}
if (text_path->m_oStyle.IsInit()) if (text_path->m_oStyle.IsInit())
{ {
ParseStyles( oOutput, text_path->m_oStyle->m_arrProperties ); ParseStyles( oOutput, text_path->m_oStyle->m_arrProperties );
...@@ -706,6 +728,8 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapeGroupPtr& oOut ...@@ -706,6 +728,8 @@ bool OOXShapeGroupReader::Parse( ReaderParameter oParam , RtfShapeGroupPtr& oOut
oOutput->m_bLayoutInCell = m_vmlGroup->m_oAllowInCell.GetValue(); oOutput->m_bLayoutInCell = m_vmlGroup->m_oAllowInCell.GetValue();
oOutput->m_bAllowOverlap = m_vmlGroup->m_oAllowOverlap.GetValue(); oOutput->m_bAllowOverlap = m_vmlGroup->m_oAllowOverlap.GetValue();
oOutput->m_nZOrderRelative = 0;
oOutput->m_nWrapType = 3; //def oOutput->m_nWrapType = 3; //def
......
...@@ -2320,20 +2320,22 @@ CString RtfTableProperty::RenderToRtf(RenderParameter oRenderParameter) ...@@ -2320,20 +2320,22 @@ CString RtfTableProperty::RenderToRtf(RenderParameter oRenderParameter)
CString sResult; CString sResult;
RENDER_RTF_BOOL( m_bBidi, sResult, _T("taprtl") ) RENDER_RTF_BOOL( m_bBidi, sResult, _T("taprtl") )
if( PROP_DEF == m_nAutoFit || 1 == m_nAutoFit )
if( PROP_DEF == m_nAutoFit || 1 == m_nAutoFit )
sResult += _T("\\trautofit1"); sResult += _T("\\trautofit1");
else if( 0 == m_nAutoFit ) else if( 0 == m_nAutoFit )
sResult += _T("\\trautofit0"); sResult += _T("\\trautofit0");
RENDER_RTF_INT( m_nAutoFit, sResult, _T("trautofit") )
RENDER_RTF_INT( m_nGraph, sResult, _T("trgaph") ) RENDER_RTF_INT( m_nAutoFit, sResult, _T("trautofit") )
RENDER_RTF_INT( nTableIndent, sResult, _T("tblind") ) RENDER_RTF_INT( m_nGraph, sResult, _T("trgaph") )
RENDER_RTF_INT( nTableIndentUnits, sResult, _T("tblindtype") ) RENDER_RTF_INT( nTableIndent, sResult, _T("tblind") )
RENDER_RTF_INT( nTableIndentUnits, sResult, _T("tblindtype") )
RENDER_RTF_INT( m_nWrapLeft, sResult, _T("tdfrmtxtLeft") ) RENDER_RTF_INT( m_nWrapLeft, sResult, _T("tdfrmtxtLeft") )
RENDER_RTF_INT( m_nWrapRight, sResult, _T("tdfrmtxtRight") ) RENDER_RTF_INT( m_nWrapRight, sResult, _T("tdfrmtxtRight") )
RENDER_RTF_INT( m_nWrapTop, sResult, _T("tdfrmtxtTop") ) RENDER_RTF_INT( m_nWrapTop, sResult, _T("tdfrmtxtTop") )
RENDER_RTF_INT( m_nWrapBottom, sResult, _T("tdfrmtxtBottom") ) RENDER_RTF_INT( m_nWrapBottom, sResult, _T("tdfrmtxtBottom") )
RENDER_RTF_BOOL( m_bOverlap, sResult, _T("tabsnoovrlp") ) RENDER_RTF_BOOL( m_bOverlap, sResult, _T("tabsnoovrlp") )
switch ( m_eHRef ) switch ( m_eHRef )
{ {
...@@ -2381,22 +2383,22 @@ CString RtfTableProperty::RenderToRtf(RenderParameter oRenderParameter) ...@@ -2381,22 +2383,22 @@ CString RtfTableProperty::RenderToRtf(RenderParameter oRenderParameter)
} }
RENDER_RTF_INT( m_nLeft, sResult, _T("trleft") ) RENDER_RTF_INT( m_nLeft, sResult, _T("trleft") )
RENDER_RTF_INT( m_nDefCellMarLeft, sResult, _T("trpaddl") ); RENDER_RTF_INT( m_nDefCellMarLeft, sResult, _T("trpaddl") );
RENDER_RTF_INT( m_nDefCellMarRight, sResult, _T("trpaddr") ); RENDER_RTF_INT( m_nDefCellMarRight, sResult, _T("trpaddr") );
RENDER_RTF_INT( m_nDefCellMarTop, sResult, _T("trpaddt") ); RENDER_RTF_INT( m_nDefCellMarTop, sResult, _T("trpaddt") );
RENDER_RTF_INT( m_nDefCellMarBottom, sResult, _T("trpaddb") ); RENDER_RTF_INT( m_nDefCellMarBottom, sResult, _T("trpaddb") );
RENDER_RTF_INT( m_nDefCellMarLeftUnits, sResult, _T("trpaddfl") ); RENDER_RTF_INT( m_nDefCellMarLeftUnits, sResult, _T("trpaddfl") );
RENDER_RTF_INT( m_nDefCellMarRightUnits, sResult, _T("trpaddfr") ); RENDER_RTF_INT( m_nDefCellMarRightUnits, sResult, _T("trpaddfr") );
RENDER_RTF_INT( m_nDefCellMarTopUnits, sResult, _T("trpaddft") ); RENDER_RTF_INT( m_nDefCellMarTopUnits, sResult, _T("trpaddft") );
RENDER_RTF_INT( m_nDefCellMarBottomUnits, sResult, _T("trpaddfb") ); RENDER_RTF_INT( m_nDefCellMarBottomUnits, sResult, _T("trpaddfb") );
RENDER_RTF_INT( m_nDefCellSpBottom, sResult, _T("trspdb") ); RENDER_RTF_INT( m_nDefCellSpBottom, sResult, _T("trspdb") );
RENDER_RTF_INT( m_nDefCellSpLeft, sResult, _T("trspdl") ); RENDER_RTF_INT( m_nDefCellSpLeft, sResult, _T("trspdl") );
RENDER_RTF_INT( m_nDefCellSpRight, sResult, _T("trspdr") ); RENDER_RTF_INT( m_nDefCellSpRight, sResult, _T("trspdr") );
RENDER_RTF_INT( m_nDefCellSpTop, sResult, _T("trspdt") ); RENDER_RTF_INT( m_nDefCellSpTop, sResult, _T("trspdt") );
RENDER_RTF_INT( m_nDefCellSpBottomUnits, sResult, _T("trspdfb") ); RENDER_RTF_INT( m_nDefCellSpBottomUnits, sResult, _T("trspdfb") );
RENDER_RTF_INT( m_nDefCellSpLeftUnits, sResult, _T("trspdfl") ); RENDER_RTF_INT( m_nDefCellSpLeftUnits, sResult, _T("trspdfl") );
RENDER_RTF_INT( m_nDefCellSpRightUnits, sResult, _T("trspdfr") ); RENDER_RTF_INT( m_nDefCellSpRightUnits, sResult, _T("trspdfr") );
RENDER_RTF_INT( m_nDefCellSpTopUnits, sResult, _T("trspdft") ); RENDER_RTF_INT( m_nDefCellSpTopUnits, sResult, _T("trspdft") );
if( m_oBorderLeft.IsValid() == true ) if( m_oBorderLeft.IsValid() == true )
{ {
...@@ -2433,15 +2435,15 @@ CString RtfTableProperty::RenderToRtf(RenderParameter oRenderParameter) ...@@ -2433,15 +2435,15 @@ CString RtfTableProperty::RenderToRtf(RenderParameter oRenderParameter)
//RENDER_RTF_INT( m_nStyle, sResult, _T("ts") ) //RENDER_RTF_INT( m_nStyle, sResult, _T("ts") )
RENDER_RTF_BOOL( m_bAutoFirstRow, sResult, _T("tbllkhdrrows") ) RENDER_RTF_BOOL( m_bAutoFirstRow, sResult, _T("tbllkhdrrows") )
RENDER_RTF_BOOL( m_bAutoLastRow, sResult, _T("tbllklastrow") ) RENDER_RTF_BOOL( m_bAutoLastRow, sResult, _T("tbllklastrow") )
RENDER_RTF_BOOL( m_bAutoFirstCol, sResult, _T("tbllkhdrcols") ) RENDER_RTF_BOOL( m_bAutoFirstCol, sResult, _T("tbllkhdrcols") )
RENDER_RTF_BOOL( m_bAutoLastCol, sResult, _T("tbllklastcol") ) RENDER_RTF_BOOL( m_bAutoLastCol, sResult, _T("tbllklastcol") )
RENDER_RTF_BOOL( m_bAutoNoRowBand, sResult, _T("tbllknorowband") ) RENDER_RTF_BOOL( m_bAutoNoRowBand, sResult, _T("tbllknorowband") )
RENDER_RTF_BOOL( m_bAutoNoColBand, sResult, _T("tbllknocolband") ) RENDER_RTF_BOOL( m_bAutoNoColBand, sResult, _T("tbllknocolband") )
RENDER_RTF_INT( m_nRowBandSize, sResult, _T("tscbandsh") ) RENDER_RTF_INT( m_nRowBandSize, sResult, _T("tscbandsh") )
RENDER_RTF_INT( m_nColBandSize, sResult, _T("tscbandsv") ) RENDER_RTF_INT( m_nColBandSize, sResult, _T("tscbandsv") )
return sResult; return sResult;
} }
......
...@@ -915,26 +915,26 @@ public: ...@@ -915,26 +915,26 @@ public:
void SetDefault( ) void SetDefault( )
{ {
DEFAULT_PROPERTY_DEF( m_eType, bt_none ) DEFAULT_PROPERTY_DEF( m_eType, bt_none )
DEFAULT_PROPERTY( m_nWidth ) DEFAULT_PROPERTY ( m_nWidth )
DEFAULT_PROPERTY( m_nSpace ) DEFAULT_PROPERTY ( m_nSpace )
DEFAULT_PROPERTY( m_nColor ) DEFAULT_PROPERTY ( m_nColor )
} }
void SetEmpty( ) void SetEmpty( )
{ {
m_eType = bt_brdrnone; m_eType = bt_brdrnone;
m_nWidth = 0; m_nWidth = 0;
m_nSpace = 0; m_nSpace = 0;
m_nColor = PROP_DEF; m_nColor = PROP_DEF;
} }
void Merge( RtfBorder& oBorPr ) void Merge( RtfBorder& oBorPr )
{ {
//свойство должно быть как единое целое, поэтому если oBorPr задано, то переписыватся целиком //свойство должно быть как единое целое, поэтому если oBorPr задано, то переписыватся целиком
if( bt_none != oBorPr.m_eType || PROP_DEF != oBorPr.m_nWidth || PROP_DEF != oBorPr.m_nSpace || PROP_DEF != oBorPr.m_nColor ) if( bt_none != oBorPr.m_eType || PROP_DEF != oBorPr.m_nWidth || PROP_DEF != oBorPr.m_nSpace || PROP_DEF != oBorPr.m_nColor )
{ {
m_eType = oBorPr.m_eType; m_eType = oBorPr.m_eType;
m_nWidth = oBorPr.m_nWidth; m_nWidth = oBorPr.m_nWidth;
m_nSpace = oBorPr.m_nSpace; m_nSpace = oBorPr.m_nSpace;
m_nColor = oBorPr.m_nColor; m_nColor = oBorPr.m_nColor;
} }
} }
CString RenderToRtf(RenderParameter oRenderParameter); CString RenderToRtf(RenderParameter oRenderParameter);
...@@ -2016,56 +2016,56 @@ public: ...@@ -2016,56 +2016,56 @@ public:
} }
void Merge( RtfTableProperty& oTablePr ) void Merge( RtfTableProperty& oTablePr )
{ {
MERGE_PROPERTY( m_bBidi, oTablePr ) MERGE_PROPERTY( m_bBidi, oTablePr )
MERGE_PROPERTY( m_nAutoFit, oTablePr ) MERGE_PROPERTY( m_nAutoFit, oTablePr )
MERGE_PROPERTY( m_nGraph, oTablePr ) MERGE_PROPERTY( m_nGraph, oTablePr )
MERGE_PROPERTY( nTableIndent, oTablePr ) MERGE_PROPERTY( nTableIndent, oTablePr )
MERGE_PROPERTY( nTableIndentUnits, oTablePr ) MERGE_PROPERTY( nTableIndentUnits, oTablePr )
MERGE_PROPERTY_DEF( m_eJust, oTablePr, rj_none ) MERGE_PROPERTY_DEF( m_eJust, oTablePr, rj_none )
MERGE_PROPERTY( m_nWrapLeft, oTablePr ) MERGE_PROPERTY( m_nWrapLeft, oTablePr )
MERGE_PROPERTY( m_nWrapRight, oTablePr ) MERGE_PROPERTY( m_nWrapRight, oTablePr )
MERGE_PROPERTY( m_nWrapTop, oTablePr ) MERGE_PROPERTY( m_nWrapTop, oTablePr )
MERGE_PROPERTY( m_nWrapBottom, oTablePr ) MERGE_PROPERTY( m_nWrapBottom, oTablePr )
MERGE_PROPERTY( m_bOverlap, oTablePr ) MERGE_PROPERTY( m_bOverlap, oTablePr )
MERGE_PROPERTY_DEF( m_eHRef, oTablePr, hr_none ) MERGE_PROPERTY_DEF( m_eHRef, oTablePr, hr_none )
MERGE_PROPERTY_DEF( m_eVRef, oTablePr, vr_none ) MERGE_PROPERTY_DEF( m_eVRef, oTablePr, vr_none )
MERGE_PROPERTY_DEF( m_eHPos, oTablePr, hp_none ) MERGE_PROPERTY_DEF( m_eHPos, oTablePr, hp_none )
MERGE_PROPERTY_DEF( m_eVPos, oTablePr, vp_none ) MERGE_PROPERTY_DEF( m_eVPos, oTablePr, vp_none )
MERGE_PROPERTY( m_nHPos, oTablePr ) MERGE_PROPERTY( m_nHPos, oTablePr )
MERGE_PROPERTY( m_nVPos, oTablePr ) MERGE_PROPERTY( m_nVPos, oTablePr )
MERGE_PROPERTY( m_nLeft, oTablePr ) MERGE_PROPERTY( m_nLeft, oTablePr )
MERGE_PROPERTY( m_nWidth, oTablePr ) MERGE_PROPERTY( m_nWidth, oTablePr )
MERGE_PROPERTY_DEF( m_eMUWidth, oTablePr, mu_none ) MERGE_PROPERTY_DEF( m_eMUWidth, oTablePr, mu_none )
MERGE_PROPERTY( m_nDefCellMarBottom, oTablePr ) MERGE_PROPERTY( m_nDefCellMarBottom, oTablePr )
MERGE_PROPERTY( m_nDefCellMarRight, oTablePr ) MERGE_PROPERTY( m_nDefCellMarRight, oTablePr )
MERGE_PROPERTY( m_nDefCellMarLeft, oTablePr ) MERGE_PROPERTY( m_nDefCellMarLeft, oTablePr )
MERGE_PROPERTY( m_nDefCellMarTop, oTablePr ) MERGE_PROPERTY( m_nDefCellMarTop, oTablePr )
MERGE_PROPERTY( m_nDefCellMarBottomUnits, oTablePr ) MERGE_PROPERTY( m_nDefCellMarBottomUnits, oTablePr )
MERGE_PROPERTY( m_nDefCellMarRightUnits, oTablePr ) MERGE_PROPERTY( m_nDefCellMarRightUnits, oTablePr )
MERGE_PROPERTY( m_nDefCellMarLeftUnits, oTablePr ) MERGE_PROPERTY( m_nDefCellMarLeftUnits, oTablePr )
MERGE_PROPERTY( m_nDefCellMarTopUnits, oTablePr ) MERGE_PROPERTY( m_nDefCellMarTopUnits, oTablePr )
MERGE_PROPERTY( m_nDefCellSpBottom, oTablePr ) MERGE_PROPERTY( m_nDefCellSpBottom, oTablePr )
MERGE_PROPERTY( m_nDefCellSpLeft, oTablePr ) MERGE_PROPERTY( m_nDefCellSpLeft, oTablePr )
MERGE_PROPERTY( m_nDefCellSpRight, oTablePr ) MERGE_PROPERTY( m_nDefCellSpRight, oTablePr )
MERGE_PROPERTY( m_nDefCellSpTop, oTablePr ) MERGE_PROPERTY( m_nDefCellSpTop, oTablePr )
MERGE_PROPERTY( m_nDefCellSpBottomUnits, oTablePr ) MERGE_PROPERTY( m_nDefCellSpBottomUnits, oTablePr )
MERGE_PROPERTY( m_nDefCellSpLeftUnits, oTablePr ) MERGE_PROPERTY( m_nDefCellSpLeftUnits, oTablePr )
MERGE_PROPERTY( m_nDefCellSpRightUnits, oTablePr ) MERGE_PROPERTY( m_nDefCellSpRightUnits, oTablePr )
MERGE_PROPERTY( m_nDefCellSpTopUnits, oTablePr ) MERGE_PROPERTY( m_nDefCellSpTopUnits, oTablePr )
m_oBorderLeft.Merge( oTablePr.m_oBorderLeft ); m_oBorderLeft.Merge ( oTablePr.m_oBorderLeft );
m_oBorderRight.Merge( oTablePr.m_oBorderRight ); m_oBorderRight.Merge( oTablePr.m_oBorderRight );
m_oBorderTop.Merge( oTablePr.m_oBorderTop ); m_oBorderTop.Merge ( oTablePr.m_oBorderTop );
m_oBorderBottom.Merge( oTablePr.m_oBorderBottom ); m_oBorderBottom.Merge( oTablePr.m_oBorderBottom );
m_oBorderVert.Merge( oTablePr.m_oBorderVert ); m_oBorderVert.Merge ( oTablePr.m_oBorderVert );
m_oBorderHor.Merge( oTablePr.m_oBorderHor ); m_oBorderHor.Merge ( oTablePr.m_oBorderHor );
m_oShading.Merge( oTablePr.m_oShading ); m_oShading.Merge ( oTablePr.m_oShading );
MERGE_PROPERTY( m_nStyle, oTablePr ) MERGE_PROPERTY( m_nStyle, oTablePr )
...@@ -2507,6 +2507,13 @@ public: ...@@ -2507,6 +2507,13 @@ public:
void SetDefault() void SetDefault()
{ {
RtfTableProperty::SetDefault(); RtfTableProperty::SetDefault();
//не SetEmpty() !!!
m_oBorderLeft.SetDefault();
m_oBorderRight.SetDefault();
m_oBorderTop.SetDefault();
m_oBorderBottom.SetDefault();
m_oBorderVert.SetDefault();
m_oBorderHor.SetDefault();
DEFAULT_PROPERTY( m_nIndex ) DEFAULT_PROPERTY( m_nIndex )
DEFAULT_PROPERTY( m_nBandIndex ) DEFAULT_PROPERTY( m_nBandIndex )
......
...@@ -179,6 +179,12 @@ public: ...@@ -179,6 +179,12 @@ public:
CString m_sGtextFont; CString m_sGtextFont;
int m_nGtextSize; int m_nGtextSize;
int m_bGtext; int m_bGtext;
int m_bGtextFVertical;
int m_bGtextFKern;
int m_bGtextFStretch;
int m_bGtextFShrinkFit;
int m_bGtextFBestFit;
//pWrapPolygonVertices Points of the text wrap polygon. //pWrapPolygonVertices Points of the text wrap polygon.
std::vector< std::pair<int, int> > m_aWrapPoints; std::vector< std::pair<int, int> > m_aWrapPoints;
...@@ -212,24 +218,26 @@ public: ...@@ -212,24 +218,26 @@ public:
void ToRtfRotation( int nAngel , int &nLeft, int &nTop, int& nRight, int& nBottom ) void ToRtfRotation( int nAngel , int &nLeft, int &nTop, int& nRight, int& nBottom )
{ {
nAngel = nAngel/ 65536;
//поворачиваем на 45 градусов //поворачиваем на 45 градусов
nAngel -= 45; nAngel -= 45;
//делаем угол от 0 до 360 //делаем угол от 0 до 360
nAngel = nAngel % 360; nAngel = nAngel % 360;
if( nAngel < 0 )
nAngel += 360; if( nAngel < 0 ) nAngel += 360;
int nQuater = nAngel / 90; // определяем четверть int nQuater = nAngel / 90; // определяем четверть
if( 0 == nQuater || 2 == nQuater ) if( 0 == nQuater || 2 == nQuater )
{ {
//поворачиваем относительно центра на 90 градусов обратно //поворачиваем относительно центра на 90 градусов обратно
int nCenterX = ( nLeft + nRight ) / 2; int nCenterX = ( nLeft + nRight ) / 2;
int nCenterY = ( nTop + nBottom ) / 2; int nCenterY = ( nTop + nBottom ) / 2;
int nWidth = nRight - nLeft; int nWidth = nRight - nLeft;
int nHeight = nBottom - nTop; int nHeight = nBottom - nTop;
nLeft = nCenterX - nHeight / 2; nLeft = nCenterX - nHeight / 2;
nRight = nCenterX + nHeight / 2; nRight = nCenterX + nHeight / 2;
nTop = nCenterY - nWidth / 2; nTop = nCenterY - nWidth / 2;
nBottom = nCenterY + nWidth / 2; nBottom = nCenterY + nWidth / 2;
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2635,19 +2635,19 @@ namespace OOX ...@@ -2635,19 +2635,19 @@ namespace OOX
ComplexTypes_WriteAttribute2( _T("id=\""), m_oId ); ComplexTypes_WriteAttribute2( _T("id=\""), m_oId );
ComplexTypes_WriteAttribute ( _T("style=\""), m_oStyle ); ComplexTypes_WriteAttribute ( _T("style=\""), m_oStyle );
if ( SimpleTypes::booleanFalse != m_oOn.GetValue() ) if ( (m_oOn.IsInit()) && (SimpleTypes::booleanFalse != m_oOn->GetValue()) )
sResult += _T("on=\"true\" "); sResult += _T("on=\"true\" ");
if ( SimpleTypes::booleanFalse != m_oFitShape.GetValue() ) if ( (m_oFitShape.IsInit()) && ( SimpleTypes::booleanFalse != m_oFitShape->GetValue()) )
sResult += _T("fitshape=\"true\" "); sResult += _T("fitshape=\"true\" ");
if ( SimpleTypes::booleanFalse != m_oFitPath.GetValue() ) if ( (m_oFitPath.IsInit()) && ( SimpleTypes::booleanFalse != m_oFitPath->GetValue()) )
sResult += _T("fitpath=\"true\" "); sResult += _T("fitpath=\"true\" ");
if ( SimpleTypes::booleanFalse != m_oTrim.GetValue() ) if ( (m_oTrim.IsInit()) && ( SimpleTypes::booleanFalse != m_oTrim->GetValue()) )
sResult += _T("trim=\"true\" "); sResult += _T("trim=\"true\" ");
if ( SimpleTypes::booleanFalse != m_oXScale.GetValue() ) if ( (m_oXScale.IsInit()) && ( SimpleTypes::booleanFalse != m_oXScale->GetValue()) )
sResult += _T("xscale=\"true\" "); sResult += _T("xscale=\"true\" ");
ComplexTypes_WriteAttribute2( _T("string=\""), m_sString ); ComplexTypes_WriteAttribute2( _T("string=\""), m_sString );
...@@ -2710,14 +2710,14 @@ namespace OOX ...@@ -2710,14 +2710,14 @@ namespace OOX
public: public:
// Attributes // Attributes
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oFitPath; nullable<SimpleTypes::CTrueFalse<>> m_oFitPath;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oFitShape; nullable<SimpleTypes::CTrueFalse<>> m_oFitShape;
nullable<CString> m_oId; nullable<CString> m_oId;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oOn; nullable<SimpleTypes::CTrueFalse<>> m_oOn;
nullable<CString> m_sString; nullable<CString> m_sString;
nullable<SimpleTypes::Vml::CCssStyle> m_oStyle; nullable<SimpleTypes::Vml::CCssStyle> m_oStyle;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oTrim; nullable<SimpleTypes::CTrueFalse<>> m_oTrim;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oXScale; nullable<SimpleTypes::CTrueFalse<>> m_oXScale;
nullable<CString> m_sStringOriginal; nullable<CString> m_sStringOriginal;
}; };
......
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