Commit 48185ed4 authored by ElenaSubbotina's avatar ElenaSubbotina

DocxFormat - fix vml single geom position

RtfFormat - read/write background page (solid, pattern, gradient, image)
parent 7bea0867
......@@ -63,8 +63,7 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
if (odf_context()->drawing_context()->m_mapVmlShapeTypes.find( sId ) ==
odf_context()->drawing_context()->m_mapVmlShapeTypes.end())
{
odf_context()->drawing_context()->m_mapVmlShapeTypes.insert(odf_context()->drawing_context()->m_mapVmlShapeTypes.begin(),
std::pair<std::wstring, OOX::Vml::CShapeType*>(sId, vml_shape_type));
odf_context()->drawing_context()->m_mapVmlShapeTypes.insert(std::make_pair(sId, vml_shape_type));
}
}
......@@ -80,9 +79,9 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
}
//o:spt
//nullable<std::wstring> m_oAdj;
//nullable<SimpleTypes::Vml::CVmlPath> m_oPath;
//SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oMaster;
//nullable<std::wstring> m_oAdj;
//nullable<SimpleTypes::Vml::CVmlPath> m_oPath;
//SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oMaster;
//m_arrItems
//CVmlCommonElements
}
......
......@@ -1676,20 +1676,21 @@ void DocxConverter::convert(OOX::Logic::CBackground *oox_background, int type)
{
if (oox_background == NULL) return;
_CP_OPT(odf_types::color) color;
convert ( oox_background->m_oColor.GetPointer(),
oox_background->m_oThemeColor.GetPointer(),
oox_background->m_oThemeTint.GetPointer(),
oox_background->m_oThemeShade.GetPointer(), color);
odt_context->set_background(color, type);
if (oox_background->m_oDrawing.IsInit())
{
//подложка
convert(oox_background->m_oDrawing.GetPointer());
}
else
else if (oox_background->m_oBackground.IsInit())
{
//цветовая подложка
_CP_OPT(odf_types::color) color;
convert ( oox_background->m_oColor.GetPointer(),
oox_background->m_oThemeColor.GetPointer(),
oox_background->m_oThemeTint.GetPointer(),
oox_background->m_oThemeShade.GetPointer(), color);
odt_context->set_background(color, type);
convert(oox_background->m_oBackground.GetPointer());
}
}
......
......@@ -38,6 +38,8 @@ class OOXReader;
class RtfWriter;
class RtfReader;
namespace OOX { namespace Vml { class CShapeType; } }
class RtfConvertationManager
{
public:
......@@ -58,6 +60,7 @@ public:
void OnCompleteItemRtf();
void OnCompleteItemOOX();
private:
OOXWriter* m_poOOXWriter;
OOXReader* m_poOOXReader;
......
......@@ -155,7 +155,7 @@ bool RtfDocumentCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
oReader.m_oCurSectionProp.m_bSwitchMargin = 1;
}
}
else if ( "gutter" == sCommand )
else if ( "gutter" == sCommand )
{
if ( hasParameter )
{
......@@ -163,12 +163,12 @@ bool RtfDocumentCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
oReader.m_oCurSectionProp.m_nGutterMarginWidth = parameter;
}
}
else if ( "ogutter" == sCommand )
else if ( "ogutter" == sCommand )
{
if ( hasParameter )
oDocument.m_oProperty.m_nGutterWidthOutside = parameter;
}
else if ( "margmirror" == sCommand )
else if ( "margmirror" == sCommand )
{
if ( hasParameter && 0 == parameter )
{
......@@ -194,7 +194,7 @@ bool RtfDocumentCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
COMMAND_RTF_BOOL( "useltbaln", oDocument.m_oProperty.m_bUseTabAlignment, sCommand, hasParameter, parameter )
//Footnotes and Endnotes
COMMAND_RTF_INT ( "endnotes", oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_EndSection )
COMMAND_RTF_INT ( "enddoc", oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_EndDocument )
COMMAND_RTF_INT ( "enddoc", oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_EndDocument )
COMMAND_RTF_INT ( "ftntj", oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_BeneathText )
COMMAND_RTF_INT ( "ftnbj", oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_BottomPage )
......@@ -309,6 +309,15 @@ bool RtfNormalReader::ExecuteCommand( RtfDocument& oDocument, RtfReader& oReader
RtfInfoReader oInfoReader;
return StartSubReader( oInfoReader, oDocument, oReader );
}
else if ( "background" == sCommand )
{
oDocument.m_pBackground = RtfShapePtr( new RtfShape() );
oDocument.m_pBackground->m_bBackground = true;
RtfBackgroundReader oBackgroundReader( *oDocument.m_pBackground );
return StartSubReader( oBackgroundReader, oDocument, oReader );
}
//else if ( "colorschememapping" == sCommand )
//{
// RtfColorSchemeReader oSchemeReader;
......
......@@ -509,9 +509,9 @@ public:
else if( "author" == sCommand ) m_eInternalState = is_author;
else if( "manager" == sCommand ) m_eInternalState = is_manager;
else if( "company" == sCommand ) m_eInternalState = is_company;
else if( "operator" == sCommand ) m_eInternalState = is_operator;
else if( "category" == sCommand ) m_eInternalState = is_category;
else if( "keywords" == sCommand ) m_eInternalState = is_keywords;
else if( "operator" == sCommand ) m_eInternalState = is_operator;
else if( "category" == sCommand ) m_eInternalState = is_category;
else if( "keywords" == sCommand ) m_eInternalState = is_keywords;
else if( "comment" == sCommand ) m_eInternalState = is_comment;
else if( "doccomm" == sCommand ) m_eInternalState = is_doccomm;
else if( "hlinkbase" == sCommand ) m_eInternalState = is_hlinkbase;
......@@ -720,12 +720,12 @@ class RtfPictureReader : public RtfAbstractReader
};
private:
RtfShape& m_oShape;
std::wstring m_sFile;
std::wstring m_sData;
bool m_bBin;
BYTE* m_pbBin;
int m_nBinLength;
RtfShape& m_oShape;
std::wstring m_sFile;
std::wstring m_sData;
bool m_bBin;
BYTE* m_pbBin;
int m_nBinLength;
public:
RtfPictureReader( RtfReader& oReader, RtfShape& oShape ) : m_oShape(oShape)
......@@ -983,7 +983,31 @@ public:
return true;
}
};
class RtfBackgroundReader : public RtfShapeReader
{
public:
RtfShape& m_oShape;
RtfBackgroundReader( RtfShape& oShape ) : RtfShapeReader(oShape), m_oShape(oShape)
{
}
bool ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, std::string sCommand, bool hasParameter, int parameter)
{
if( "background" == sCommand )
{
return true;
}
else if( "shp" == sCommand )
{
RtfShapeReader oShapeReader( m_oShape );
StartSubReader( oShapeReader, oDocument, oReader );
}
else
return RtfShapeReader::ExecuteCommand( oDocument, oReader, sCommand, hasParameter, parameter);
return true;
}
};
class RtfOldShapeReader : public RtfAbstractReader
{
private:
......
......@@ -31,7 +31,9 @@
*/
#pragma once
#include "OOXShapeReader.h"
#include "OOXTextItemReader.h"
#include "../../../../Common/DocxFormat/Source/DocxFormat/Document.h"
class OOXDocumentReader
......@@ -58,6 +60,13 @@ public:
m_poReader = oParam.oReader;
m_poDocument = oParam.oRtf;
if ( m_ooxDocument->m_oBackground.IsInit())
{
m_poDocument->m_pBackground = RtfShapePtr(new RtfShape());
OOXBackgroundReader oBackgroundReader(m_ooxDocument->m_oBackground.GetPointer());
oBackgroundReader.Parse( oParam, m_poDocument->m_pBackground);
}
int last_section_start = 0;
......
......@@ -745,17 +745,24 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
RtfShapePtr pNewShape ( new RtfShape() );
pNewShape->m_oCharProperty = oNewProperty;
OOXShapeReader *pShapeReader = NULL;
if (ooxPicture->m_oShape.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShape.GetPointer());
else if (ooxPicture->m_oShapeType.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeType.GetPointer());
else if (ooxPicture->m_oShapeArc.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeArc.GetPointer());
OOXShapeReader* pShapeReader = NULL;
if (ooxPicture->m_oShapeType.IsInit())
{
pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeType.GetPointer());
if(pShapeReader)
{
pShapeReader->Parse( oParam, pNewShape );
delete pShapeReader; pShapeReader = NULL;
}
}
if (ooxPicture->m_oShapeArc.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeArc.GetPointer());
else if (ooxPicture->m_oShapeRect.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeRect.GetPointer());
else if (ooxPicture->m_oShapeRoundRect.IsInit())pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeRoundRect.GetPointer());
else if (ooxPicture->m_oShapeOval.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeOval.GetPointer());
else if (ooxPicture->m_oShapeLine.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeLine.GetPointer());
else if (ooxPicture->m_oShapePolyLine.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapePolyLine.GetPointer());
else if (ooxPicture->m_oShapeCurve.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeCurve.GetPointer());
else if (ooxPicture->m_oShape.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShape.GetPointer());
if (pShapeReader)
{
......
......@@ -41,7 +41,7 @@ class OOXReader
public:
RtfConvertationManager* m_convertationManager;
std::wstring m_sPath;
std::wstring m_sPath;
int m_nCurItap; //для определение вложенности таблицы
......
......@@ -249,7 +249,7 @@ bool ParseStyle(RtfShape* pShape, SimpleTypes::Vml::CCssProperty* prop)
}
OOXShapeReader::OOXShapeReader(OOX::WritingElementWithChilds<OOX::WritingElement> * elem)
OOXShapeReader::OOXShapeReader(OOX::WritingElementWithChilds<OOX::WritingElement> * elem)
{
m_arrElement = elem;
......@@ -328,7 +328,7 @@ bool OOXShapeReader::Parse2( ReaderParameter oParam , RtfShapePtr& oOutput)
case SimpleTypes::filltypeFrame : oOutput->m_nFillType = 3; break;
case SimpleTypes::filltypeGradient: oOutput->m_nFillType = 4; break;
case SimpleTypes::filltypeGradientCenter: oOutput->m_nFillType = 4; break;
case SimpleTypes::filltypeGradientRadial: oOutput->m_nFillType = 4; break;
case SimpleTypes::filltypeGradientRadial: oOutput->m_nFillType = 6; break;
case SimpleTypes::filltypeGradientUnscaled: oOutput->m_nFillType = 4; break;
case SimpleTypes::filltypePattern: oOutput->m_nFillType = 1; break;
case SimpleTypes::filltypeTile: oOutput->m_nFillType = 2; break;
......@@ -346,6 +346,21 @@ bool OOXShapeReader::Parse2( ReaderParameter oParam , RtfShapePtr& oOutput)
{
oOutput->m_nFillFocus = fill->m_oFocus->GetValue();
}
if (fill->m_oFocusPosition.IsInit())
{
if (fill->m_oFocusPosition->GetY() > 0.99 || fill->m_oFocusPosition->GetX() > 0.99)
oOutput->m_nFillType = 5;
int toBottom = (1. - fill->m_oFocusPosition->GetY()) * 65535;
int toTop = (fill->m_oFocusPosition->GetY()) * 65535;
int toRight = (1. - fill->m_oFocusPosition->GetX()) * 65535;
int toLeft = (fill->m_oFocusPosition->GetX()) * 65535;
if (toBottom > 0) oOutput->m_nFillToBottom = toBottom;
if (toTop > 0) oOutput->m_nFillToTop = toTop;
if (toRight > 0) oOutput->m_nFillToRight = toRight;
if (toLeft > 0) oOutput->m_nFillToLeft = toLeft;
}
}break;
case OOX::et_v_stroke:
{
......@@ -825,3 +840,58 @@ void OOXShapeReader::ParseAdjustment(RtfShape& oShape, std::wstring sAdjustment)
}
}
}
bool OOXBackgroundReader::Parse( ReaderParameter oParam , RtfShapePtr& oOutput)
{
if (!m_ooxBackground) return false;
oOutput->m_nShapeType = 1;
oOutput->m_bBackground = true;
oOutput->m_bFilled = true;
if (m_ooxBackground->m_oColor.IsInit() && m_ooxBackground->m_oColor->GetValue() == SimpleTypes::hexcolorRGB)
{
unsigned char ucR = m_ooxBackground->m_oColor->Get_R();
unsigned char ucB = m_ooxBackground->m_oColor->Get_B();
unsigned char ucG = m_ooxBackground->m_oColor->Get_G();
unsigned char ucA = m_ooxBackground->m_oColor->Get_A();
oOutput->m_nFillColor = RGB(ucR, ucG , ucB);
if (ucA != 0xff)
oOutput->m_nFillOpacity = ucA / 255. * 100;
}
else if (m_ooxBackground->m_oThemeColor.IsInit())
{
//nullable<SimpleTypes::CUcharHexNumber<> > m_oThemeShade;
//nullable<SimpleTypes::CUcharHexNumber<> > m_oThemeTint;
}
if (m_ooxBackground->m_oBackground.IsInit())
{
OOXShapeReader sub_reader(m_ooxBackground->m_oBackground.GetPointer());
sub_reader.Parse(oParam, oOutput);
}
else if (m_ooxBackground->m_oDrawing.IsInit())
{
OOXDrawingReader oDrawingReader(m_ooxBackground->m_oDrawing.GetPointer());
if( false == oDrawingReader.Parse( oParam, *oOutput ) )
{
if (!m_ooxBackground->m_oDrawing->m_sXml.IsInit())
{
OOXDrawingGraphicReader oGraphiceReader(*m_ooxBackground->m_oDrawing->m_sXml);
OOX::Logic::CPicture *ooxPicture = oGraphiceReader.Parse( oParam, *oOutput );
if (ooxPicture)
{
OOXShapeReader sub_reader(ooxPicture);
sub_reader.Parse(oParam, oOutput);
delete ooxPicture;
}
}
}
}
return true;
}
......@@ -69,7 +69,6 @@ private:
}
};
class OOXShapeGroupReader
{
private:
......@@ -91,3 +90,16 @@ public:
bool Parse( ReaderParameter oParam , RtfShapeGroupPtr& oOutput);
};
class OOXBackgroundReader
{
private:
OOX::Logic::CBackground *m_ooxBackground;
public:
OOXBackgroundReader(OOX::Logic::CBackground *oox_background)
{
m_ooxBackground = oox_background;
}
bool Parse( ReaderParameter oParam , RtfShapePtr& oOutput);
};
......@@ -35,6 +35,7 @@
#include "RtfGlobalTables.h"
#include "RtfSection.h"
#include "RtfMath.h"
#include "RtfShape.h"
struct _section
{
......@@ -56,6 +57,7 @@ public:
RtfStyleTable m_oStyleTable;
RtfRevisionTable m_oRevisionTable;
RtfInformation m_oInformation;
RtfShapePtr m_pBackground;
RtfListTable m_oListTable;
RtfListOverrideTable m_oListOverrideTable;
......@@ -80,8 +82,10 @@ public:
void SetShapeId( int nShapeId )
{
for( int i = 0; i < (int)m_aShapeId.size(); i++ )
{
if( nShapeId == m_aShapeId[i] )
return;
}
m_aShapeId.push_back( nShapeId );
}
int GetShapeId( int& nShapeId )
......
......@@ -146,6 +146,10 @@ void RtfShape::SetDefault()
DEFAULT_PROPERTY( m_nFillOpacity )
DEFAULT_PROPERTY( m_nFillFocus )
DEFAULT_PROPERTY( m_nFillAngle )
DEFAULT_PROPERTY( m_nFillToBottom )
DEFAULT_PROPERTY( m_nFillToTop )
DEFAULT_PROPERTY( m_nFillToRight )
DEFAULT_PROPERTY( m_nFillToLeft )
//Line
DEFAULT_PROPERTY_DEF( m_bLine, true )
DEFAULT_PROPERTY( m_nLineColor )
......@@ -168,7 +172,7 @@ void RtfShape::SetDefault()
m_aTextItems = TextItemContainerPtr();
m_oPicture = RtfPicturePtr();
m_bBackground = false;
m_bIsOle = false;
m_bInGroup = false;
......@@ -234,6 +238,9 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
}
else
{
if (m_bBackground)
sResult += L"{\\*\\background";
sResult += L"{\\shp";
sResult += L"{\\*\\shpinst";
......@@ -281,7 +288,7 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
sResult += L"{\\sp{\\sn fLockRotation}{\\sv 1}}";
//picture
if( 0 != m_oPicture && m_nFillType == 1 || m_nFillType == 2 || m_nFillType == 9)
if( 0 != m_oPicture && m_nFillType == 1 || m_nFillType == 2 || m_nFillType == 3 || m_nFillType == 9)
{
sResult += L"{\\sp{\\sn fillBlip}{\\sv ";
sResult += m_oPicture->RenderToRtf( oRenderParameter );
......@@ -296,6 +303,9 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
}
sResult += L"}";
sResult += L"}";
if (m_bBackground)
sResult += L"}";
}
}
else // anchor
......@@ -400,14 +410,14 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
RENDER_RTF_SHAPE_PROP(L"fAllowOverlap", sResult, m_bAllowOverlap);
//Position relative
RENDER_RTF_SHAPE_PROP(L"pctHorizPos", sResult, m_nPositionHPct);
RENDER_RTF_SHAPE_PROP(L"pctVertPos", sResult, m_nPositionVPct);
RENDER_RTF_SHAPE_PROP(L"pctHoriz", sResult, m_nPctWidth);
RENDER_RTF_SHAPE_PROP(L"pctVert", sResult, m_nPctHeight);
RENDER_RTF_SHAPE_PROP(L"sizerelh", sResult, m_nPctWidthRelative);
RENDER_RTF_SHAPE_PROP(L"sizerelv", sResult, m_nPctHeightRelative);
RENDER_RTF_SHAPE_PROP(L"colStart", sResult, m_nColStart);
RENDER_RTF_SHAPE_PROP(L"colSpan", sResult, m_nColSpan);
RENDER_RTF_SHAPE_PROP(L"pctHorizPos", sResult, m_nPositionHPct);
RENDER_RTF_SHAPE_PROP(L"pctVertPos", sResult, m_nPositionVPct);
RENDER_RTF_SHAPE_PROP(L"pctHoriz", sResult, m_nPctWidth);
RENDER_RTF_SHAPE_PROP(L"pctVert", sResult, m_nPctHeight);
RENDER_RTF_SHAPE_PROP(L"sizerelh", sResult, m_nPctWidthRelative);
RENDER_RTF_SHAPE_PROP(L"sizerelv", sResult, m_nPctHeightRelative);
RENDER_RTF_SHAPE_PROP(L"colStart", sResult, m_nColStart);
RENDER_RTF_SHAPE_PROP(L"colSpan", sResult, m_nColSpan);
//Rehydration
//RENDER_RTF_SHAPE_PROP(L"metroBlob", sResult, m_sMetroBlob);
......@@ -419,6 +429,7 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
RENDER_RTF_SHAPE_PROP(L"shapeType", sResult, m_nShapeType);
RENDER_RTF_SHAPE_PROP(L"fBehindDocument",sResult, m_nZOrderRelative);
RENDER_RTF_SHAPE_PROP(L"fHidden", sResult, m_bHidden);
RENDER_RTF_SHAPE_PROP(L"fBackground", sResult, m_bBackground);
//Text
//sResult += L"{\\sp{\\sn fLockText}{\\sv 0}}";
......@@ -430,10 +441,10 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
RENDER_RTF_SHAPE_PROP(L"anchorText", sResult, m_nAnchorText);
//else
{
RENDER_RTF_SHAPE_PROP(L"dxWrapDistLeft", sResult, RtfUtility::Twips2Emu( m_nWrapDistLeft ));
RENDER_RTF_SHAPE_PROP(L"dyWrapDistTop", sResult, RtfUtility::Twips2Emu( m_nWrapDistTop ));
RENDER_RTF_SHAPE_PROP(L"dxWrapDistRight", sResult, RtfUtility::Twips2Emu( m_nWrapDistRight ));
RENDER_RTF_SHAPE_PROP(L"dyWrapDistBottom", sResult, RtfUtility::Twips2Emu( m_nWrapDistBottom ));
RENDER_RTF_SHAPE_PROP(L"dxWrapDistLeft", sResult, RtfUtility::Twips2Emu( m_nWrapDistLeft ));
RENDER_RTF_SHAPE_PROP(L"dyWrapDistTop", sResult, RtfUtility::Twips2Emu( m_nWrapDistTop ));
RENDER_RTF_SHAPE_PROP(L"dxWrapDistRight", sResult, RtfUtility::Twips2Emu( m_nWrapDistRight ));
RENDER_RTF_SHAPE_PROP(L"dyWrapDistBottom", sResult, RtfUtility::Twips2Emu( m_nWrapDistBottom ));
}
RENDER_RTF_SHAPE_PROP(L"fFitShapeToText", sResult, m_bFitShapeToText);
RENDER_RTF_SHAPE_PROP(L"fFitTextToShape", sResult, m_bFitTextToShape);
......@@ -503,11 +514,16 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
if (PROP_DEF != m_nFillOpacity)
RENDER_RTF_SHAPE_PROP(L"fillOpacity", sResult, ( m_nFillOpacity * 65536 /100 ) );
RENDER_RTF_SHAPE_PROP(L"fillFocus", sResult, m_nFillFocus );
RENDER_RTF_SHAPE_PROP(L"fillFocus", sResult, m_nFillFocus );
if (PROP_DEF != m_nFillAngle)
RENDER_RTF_SHAPE_PROP(L"fillAngle", sResult, m_nFillAngle * 65536 );
//Line
RENDER_RTF_SHAPE_PROP(L"fillToBottom", sResult, m_nFillToBottom )
RENDER_RTF_SHAPE_PROP(L"fillToTop", sResult, m_nFillToTop )
RENDER_RTF_SHAPE_PROP(L"fillToRight", sResult, m_nFillToRight )
RENDER_RTF_SHAPE_PROP(L"fillToLeft", sResult, m_nFillToLeft )
//Line
if( 0 == m_bLine )
sResult += L"{\\sp{\\sn fLine}{\\sv 0}}";
RENDER_RTF_SHAPE_PROP(L"lineColor", sResult, m_nLineColor );
......@@ -642,9 +658,11 @@ std::wstring RtfShape::RenderToOOX(RenderParameter oRenderParameter)
return sResult;
}
std::wstring RtfShape::GetShapeNodeName(int type)
std::wstring RtfShape::GetShapeNodeName()
{
switch(type)
if (m_bBackground) return L"v:background";
switch(m_nShapeType)
{
case NSOfficeDrawing::sptRectangle: return L"v:rect";
case NSOfficeDrawing::sptEllipse: return L"v:oval";
......@@ -707,7 +725,9 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
}
if (oRenderParameter.sValue.empty())
oRenderParameter.sValue = GetShapeNodeName(m_nShapeType);
{
oRenderParameter.sValue = GetShapeNodeName();
}
sResult += L"<" + oRenderParameter.sValue;
......@@ -1285,7 +1305,9 @@ std::wstring RtfShape::RenderToOOXEnd(RenderParameter oRenderParameter)
std::wstring sResult;
if (oRenderParameter.sValue.empty())
oRenderParameter.sValue = GetShapeNodeName(m_nShapeType);
{
oRenderParameter.sValue = GetShapeNodeName();
}
sResult += L"</" + oRenderParameter.sValue + L">";
......
......@@ -39,6 +39,7 @@ private:
bool m_bDelete;
public:
bool m_bBackground;
bool m_bIsOle;
bool m_bInGroup; //local anchor
......@@ -166,6 +167,10 @@ public:
int m_nFillOpacity;
int m_nFillFocus;
int m_nFillAngle;
int m_nFillToBottom;
int m_nFillToTop;
int m_nFillToRight;
int m_nFillToLeft;
//int m_bFillShape; //есть копия заливки картинкой
//Line
int m_bLine; //fLine Has a line
......@@ -251,7 +256,7 @@ public:
}
}
std::wstring RenderToRtfShapeProperty(RenderParameter oRenderParameter);
std::wstring GetShapeNodeName(int type);
std::wstring GetShapeNodeName();
};
......
......@@ -274,28 +274,37 @@ int RtfWriter::GetCount()
std::wstring RtfWriter::CreateRtfStart()
{
RenderParameter oRenderParameter;
oRenderParameter.poDocument = &m_oDocument;
oRenderParameter.poWriter = this;
oRenderParameter.nType = RENDER_TO_RTF_PARAM_UNKNOWN;
oRenderParameter.poWriter = this;
oRenderParameter.nType = RENDER_TO_RTF_PARAM_UNKNOWN;
std::wstring sResult;
sResult += L"{\\rtf1\\ulc1";
sResult += m_oDocument.m_oProperty.RenderToRtf( oRenderParameter );
sResult += m_oDocument.m_oFontTable.RenderToRtf( oRenderParameter );
sResult += m_oDocument.m_oColorTable.RenderToRtf( oRenderParameter );
//---------- test
std::wstring sDefCharProp = m_oDocument.m_oDefaultCharProp.RenderToRtf( oRenderParameter );
if( false == sDefCharProp.empty() )
if( false == sDefCharProp.empty() )
sResult += L"{\\*\\defchp " + sDefCharProp + L"}";
std::wstring sDefParProp = m_oDocument.m_oDefaultParagraphProp.RenderToRtf( oRenderParameter );
if( false == sDefParProp.empty() )
if( false == sDefParProp.empty() )
sResult += L"{\\*\\defpap " + sDefParProp+ L"}";
sResult += m_oDocument.m_oStyleTable.RenderToRtf( oRenderParameter );
//---------- test
sResult += m_oDocument.m_oListTable.RenderToRtf ( oRenderParameter );
sResult += m_oDocument.m_oListOverrideTable.RenderToRtf ( oRenderParameter );
sResult += m_oDocument.m_oRevisionTable.RenderToRtf ( oRenderParameter );
sResult += m_oDocument.m_oInformation.RenderToRtf ( oRenderParameter );
if (m_oDocument.m_pBackground)
{
sResult += m_oDocument.m_pBackground->RenderToRtf ( oRenderParameter );
}
sResult += L"\\fet2";//0 Footnotes only or nothing at all (the default). 1 Endnotes only. 2 Both footnotes and endnotes
std::wstring sFootnote;
......@@ -323,7 +332,6 @@ std::wstring RtfWriter::CreateRtfStart()
if( !sFootnote.empty() )
sResult += L"{\\*\\aftnsepc " + sFootnote + L"}";
}
sResult += L"\n\n";
return sResult;
}
......
......@@ -30,7 +30,6 @@
*
*/
#include "OOXDocumentWriter.h"
//#include "OOXContentTypesWriter.h"
#include "OOXRelsWriter.h"
#include "OOXDocumentWriter.h"
#include "OOXNumberingWriter.h"
......@@ -41,33 +40,42 @@
#include "OOXFootnoteWriter.h"
#include "OOXStylesWriter.h"
//#include "../../../../ASCOfficeDocxFile2/BinReader/ContentTypesWriter.h"
std::wstring OOXDocumentWriter::CreateXmlStart()
{
//пишем Footnotes
RenderParameter oNewParam;
oNewParam.poDocument = &m_oDocument;
oNewParam.poWriter = &m_oWriter;
oNewParam.poRels = &m_oWriter.m_oDocRels;
oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
oNewParam.poDocument = &m_oDocument;
oNewParam.poWriter = &m_oWriter;
oNewParam.poRels = &m_oWriter.m_oDocRels;
oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
//пишем document.xml
std::wstring sResult = L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n";
sResult += L"<w:document";
sResult += L" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"";
sResult += L" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"";
sResult += L" xmlns:v=\"urn:schemas-microsoft-com:vml\"";
sResult += L" xmlns:o=\"urn:schemas-microsoft-com:office:office\"";
sResult += L" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\"";
sResult += L" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\"";
sResult += L" xmlns:w10=\"urn:schemas-microsoft-com:office:word\"";
sResult += L" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"";
sResult += L">";
if (m_oDocument.m_pBackground)
{
RtfColor color(m_oDocument.m_pBackground->m_nFillColor);
sResult += L"<w:background w:color=\"" + color.ToHexColor() + L"\">";
{
oNewParam.nType = RENDER_TO_OOX_PARAM_SHAPE_WSHAPE2;
sResult += m_oDocument.m_pBackground->RenderToOOX(oNewParam);
oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
}
sResult += L"</w:background>";
}
//пишем document.xml
std::wstring sResult = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n");
sResult += _T("<w:document");
sResult += _T(" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\"");
sResult += _T(" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\"");
sResult += _T(" xmlns:v=\"urn:schemas-microsoft-com:vml\"");
sResult += _T(" xmlns:o=\"urn:schemas-microsoft-com:office:office\"");
sResult += _T(" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\"");
sResult += _T(" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\"");
sResult += _T(" xmlns:w10=\"urn:schemas-microsoft-com:office:word\"");
sResult += _T(" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"");
sResult += _T(">");
sResult += _T("<w:body>");
sResult += L"<w:body>";
return sResult;
}
std::wstring OOXDocumentWriter::CreateXmlEnd( )
......@@ -88,25 +96,25 @@ std::wstring OOXDocumentWriter::CreateXmlEnd( )
{
oNewParam.poRels = poFootnoteWriter->m_oRelsWriter.get();
oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
poFootnoteWriter->AddFootnoteBegin( _T("continuationSeparator"), 1, m_oDocument.m_oFootnoteCon->RenderToOOX( oNewParam ) );
poFootnoteWriter->AddFootnoteBegin( L"continuationSeparator", 1, m_oDocument.m_oFootnoteCon->RenderToOOX( oNewParam ) );
}
if( NULL != m_oDocument.m_oFootnoteSep )
{
oNewParam.poRels = poFootnoteWriter->m_oRelsWriter.get();
oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
poFootnoteWriter->AddFootnoteBegin( _T("separator"), 0, m_oDocument.m_oFootnoteSep->RenderToOOX(oNewParam) );
poFootnoteWriter->AddFootnoteBegin( L"separator", 0, m_oDocument.m_oFootnoteSep->RenderToOOX(oNewParam) );
}
if( NULL != m_oDocument.m_oEndnoteCon )
{
oNewParam.poRels = poEndnoteWriter->m_oRelsWriter.get();
oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
poEndnoteWriter->AddEndnoteBegin( _T("continuationSeparator"), 1, m_oDocument.m_oEndnoteSep->RenderToOOX(oNewParam) );
poEndnoteWriter->AddEndnoteBegin( L"continuationSeparator", 1, m_oDocument.m_oEndnoteSep->RenderToOOX(oNewParam) );
}
if( NULL != m_oDocument.m_oEndnoteSep )
{
oNewParam.poRels = poEndnoteWriter->m_oRelsWriter.get();
oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
poEndnoteWriter->AddEndnoteBegin( _T("separator"), 0, m_oDocument.m_oEndnoteSep->RenderToOOX(oNewParam) );
poEndnoteWriter->AddEndnoteBegin( L"separator", 0, m_oDocument.m_oEndnoteSep->RenderToOOX(oNewParam) );
}
//fontTable.xml
......@@ -142,20 +150,20 @@ std::wstring OOXDocumentWriter::CreateXmlEnd( )
if( false == sTempParaDef.empty() || false == sTempCharDef.empty() )
{
sStyles += _T("<w:docDefaults>");
sStyles += L"<w:docDefaults>";
if( false == sTempCharDef.empty() )
{
sStyles += _T("<w:rPrDefault><w:rPr>");
sStyles += L"<w:rPrDefault><w:rPr>";
sStyles += sTempCharDef ;
sStyles += _T("</w:rPr></w:rPrDefault>");
sStyles += L"</w:rPr></w:rPrDefault>";
}
if( false == sTempParaDef.empty() )
{
sStyles += _T("<w:pPrDefault><w:pPr>");
sStyles += L"<w:pPrDefault><w:pPr>";
sStyles += sTempParaDef;
sStyles += _T("</w:pPr></w:pPrDefault>");
sStyles += L"</w:pPr></w:pPrDefault>";
}
sStyles += _T("</w:docDefaults>");
sStyles += L"</w:docDefaults>";
}
sStyles += m_oDocument.m_oStyleTable.RenderToOOX(oNewParam);
......@@ -182,28 +190,28 @@ std::wstring OOXDocumentWriter::CreateXmlEnd( )
sResult += m_oDocument[0].props->m_oProperty.RenderToOOX(oNewParam);
sResult += _T("</w:body>");
sResult += _T("</w:document>");
sResult += L"</w:body>";
sResult += L"</w:document>";
return sResult;
}
bool OOXDocumentWriter::SaveByItemStart( std::wstring sFolder )
{
std::wstring pathWord = sFolder + FILE_SEPARATOR_STR + _T("word");
std::wstring pathWord = sFolder + FILE_SEPARATOR_STR + L"word";
NSDirectory::CreateDirectory(pathWord) ;
try
{
std::wstring sFilename = pathWord + FILE_SEPARATOR_STR + _T("document.xml");
std::wstring sFilename = pathWord + FILE_SEPARATOR_STR + L"document.xml";
m_oFileWriter = new NFileWriter::CBufferedFileWriter( sFilename );
}
catch(...)
{
return false;
}
m_oWriter.m_oRels.AddRelationship( _T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"), _T("word/document.xml") );
m_oWriter.m_oContentTypes.AddContent( _T("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"), _T("/word/document.xml") );
m_oWriter.m_oRels.AddRelationship( L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", L"word/document.xml" );
m_oWriter.m_oContentTypes.AddContent( L"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml", L"/word/document.xml" );
std::wstring sXml = CreateXmlStart( );
std::string sXmlUTF = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(sXml);
......@@ -261,7 +269,7 @@ bool OOXDocumentWriter::SaveByItem()
else
{
//генерация ???
sXml = _T("<w:p><w:pPr>") + sectPr + _T("</w:pPr></w:p>");
sXml = L"<w:p><w:pPr>" + sectPr + L"</w:pPr></w:p>";
}
std::string sXmlUTF = NSFile::CUtf8Converter::GetUtf8StringFromUnicode(sXml);
......
......@@ -38,10 +38,10 @@
class OOXDocumentWriter
{
private:
OOXWriter& m_oWriter;
RtfDocument& m_oDocument;
NFileWriter::CBufferedFileWriter* m_oFileWriter;
bool m_bFirst; //один параграф пишем другой храним в памяти
OOXWriter& m_oWriter;
RtfDocument& m_oDocument;
NFileWriter::CBufferedFileWriter* m_oFileWriter;
bool m_bFirst; //один параграф пишем другой храним в памяти
public:
OOXDocumentWriter( OOXWriter& oWriter,RtfDocument& oDocument ): m_oWriter(oWriter), m_oDocument(oDocument)
{
......@@ -64,7 +64,9 @@ public:
{
int nCount = 0;
for( int i = 0; i < m_oDocument.GetCount(); i++ )
{
nCount += m_oDocument[i].props->GetCount();
}
return nCount;
}
};
......@@ -112,21 +112,21 @@ namespace SimpleTypes
virtual ECalendarType FromString(std::wstring &sValue)
{
if ( _T("gregorian") == sValue ) this->m_eValue = calendartypeGregorian;
else if ( _T("gregorianArabic") == sValue ) this->m_eValue = calendartypeGregorianArabic;
else if ( _T("gregorianMeFrench") == sValue ) this->m_eValue = calendartypeGregorianMeFrench;
else if ( _T("gregorianUs") == sValue ) this->m_eValue = calendartypeGregorianUs;
else if ( _T("gregorianXlitEnglish") == sValue ) this->m_eValue = calendartypeGregorianXlitEnglish;
else if ( _T("gregorianXlitFrench") == sValue ) this->m_eValue = calendartypeGregorianXlitFrench;
else if ( _T("hebrew") == sValue ) this->m_eValue = calendartypeHebrew;
else if ( _T("hijri") == sValue ) this->m_eValue = calendartypeHijri;
else if ( _T("japan") == sValue ) this->m_eValue = calendartypeJapan;
else if ( _T("korea") == sValue ) this->m_eValue = calendartypeKorea;
else if ( _T("none") == sValue ) this->m_eValue = calendartypeNone;
else if ( _T("saka") == sValue ) this->m_eValue = calendartypeSaka;
else if ( _T("taiwan") == sValue ) this->m_eValue = calendartypeTaiwan;
else if ( _T("thai") == sValue ) this->m_eValue = calendartypeThai;
else this->m_eValue = eDefValue;
if ( L"gregorian" == sValue ) this->m_eValue = calendartypeGregorian;
else if ( L"gregorianArabic" == sValue ) this->m_eValue = calendartypeGregorianArabic;
else if ( L"gregorianMeFrench" == sValue ) this->m_eValue = calendartypeGregorianMeFrench;
else if ( L"gregorianUs" == sValue ) this->m_eValue = calendartypeGregorianUs;
else if ( L"gregorianXlitEnglish" == sValue ) this->m_eValue = calendartypeGregorianXlitEnglish;
else if ( L"gregorianXlitFrench" == sValue ) this->m_eValue = calendartypeGregorianXlitFrench;
else if ( L"hebrew" == sValue ) this->m_eValue = calendartypeHebrew;
else if ( L"hijri" == sValue ) this->m_eValue = calendartypeHijri;
else if ( L"japan" == sValue ) this->m_eValue = calendartypeJapan;
else if ( L"korea" == sValue ) this->m_eValue = calendartypeKorea;
else if ( L"none" == sValue ) this->m_eValue = calendartypeNone;
else if ( L"saka" == sValue ) this->m_eValue = calendartypeSaka;
else if ( L"taiwan" == sValue ) this->m_eValue = calendartypeTaiwan;
else if ( L"thai" == sValue ) this->m_eValue = calendartypeThai;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
......@@ -135,21 +135,21 @@ namespace SimpleTypes
{
switch(this->m_eValue)
{
case calendartypeGregorian : return _T("gregorian");
case calendartypeGregorianArabic : return _T("gregorianArabic");
case calendartypeGregorianMeFrench : return _T("gregorianMeFrench");
case calendartypeGregorianUs : return _T("gregorianUs");
case calendartypeGregorianXlitEnglish : return _T("gregorianXlitEnglish");
case calendartypeGregorianXlitFrench : return _T("gregorianXlitFrench");
case calendartypeHebrew : return _T("hebrew");
case calendartypeHijri : return _T("hijri");
case calendartypeJapan : return _T("japan");
case calendartypeKorea : return _T("korea");
case calendartypeNone : return _T("none");
case calendartypeSaka : return _T("saka");
case calendartypeTaiwan : return _T("taiwan");
case calendartypeThai : return _T("thai");
default : return _T("none");
case calendartypeGregorian : return L"gregorian";
case calendartypeGregorianArabic : return L"gregorianArabic";
case calendartypeGregorianMeFrench : return L"gregorianMeFrench";
case calendartypeGregorianUs : return L"gregorianUs";
case calendartypeGregorianXlitEnglish : return L"gregorianXlitEnglish";
case calendartypeGregorianXlitFrench : return L"gregorianXlitFrench";
case calendartypeHebrew : return L"hebrew";
case calendartypeHijri : return L"hijri";
case calendartypeJapan : return L"japan";
case calendartypeKorea : return L"korea";
case calendartypeNone : return L"none";
case calendartypeSaka : return L"saka";
case calendartypeTaiwan : return L"taiwan";
case calendartypeThai : return L"thai";
default : return L"none";
}
}
......@@ -174,9 +174,9 @@ namespace SimpleTypes
virtual EConformanceClass FromString(std::wstring &sValue)
{
if ( _T("strict") == sValue ) this->m_eValue = conformanceclassStrict;
else if ( _T("transitional") == sValue ) this->m_eValue = conformanceclassTransitional;
else this->m_eValue = eDefValue;
if ( L"strict" == sValue ) this->m_eValue = conformanceclassStrict;
else if ( L"transitional" == sValue ) this->m_eValue = conformanceclassTransitional;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
......@@ -185,9 +185,9 @@ namespace SimpleTypes
{
switch(this->m_eValue)
{
case conformanceclassStrict : return _T("strict");
case conformanceclassTransitional : return _T("transitional");
default : return _T("strict");
case conformanceclassStrict : return L"strict";
case conformanceclassTransitional : return L"transitional";
default : return L"strict";
}
}
......@@ -514,16 +514,16 @@ namespace SimpleTypes
virtual EOnOff FromString(std::wstring &sValue)
{
if ( _T("true") == sValue ) this->m_eValue = onoffTrue;
else if ( _T("True") == sValue ) this->m_eValue = onoffTrue;
else if ( _T("1") == sValue ) this->m_eValue = onoffTrue;
else if ( _T("t") == sValue ) this->m_eValue = onoffTrue;
else if ( _T("on") == sValue ) this->m_eValue = onoffTrue;
else if ( _T("f") == sValue ) this->m_eValue = onoffFalse;
else if ( _T("0") == sValue ) this->m_eValue = onoffFalse;
else if ( _T("false") == sValue ) this->m_eValue = onoffFalse;
else if ( _T("False") == sValue ) this->m_eValue = onoffFalse;
else if ( _T("off") == sValue ) this->m_eValue = onoffFalse;
if ( L"true" == sValue ) this->m_eValue = onoffTrue;
else if ( L"True" == sValue ) this->m_eValue = onoffTrue;
else if ( L"1" == sValue ) this->m_eValue = onoffTrue;
else if ( L"t" == sValue ) this->m_eValue = onoffTrue;
else if ( L"on" == sValue ) this->m_eValue = onoffTrue;
else if ( L"f" == sValue ) this->m_eValue = onoffFalse;
else if ( L"0" == sValue ) this->m_eValue = onoffFalse;
else if ( L"false" == sValue ) this->m_eValue = onoffFalse;
else if ( L"False" == sValue ) this->m_eValue = onoffFalse;
else if ( L"off" == sValue ) this->m_eValue = onoffFalse;
else this->m_eValue = eDefValue;
return this->m_eValue;
......@@ -533,9 +533,9 @@ namespace SimpleTypes
{
switch(this->m_eValue)
{
case onoffFalse : return _T("false");
case onoffTrue : return _T("true");
default : return _T("false");
case onoffFalse : return L"false";
case onoffTrue : return L"true";
default : return L"false";
}
}
std::wstring ToString2(EOnOffToString eType) const
......@@ -544,39 +544,39 @@ namespace SimpleTypes
{
switch (this->m_eValue)
{
case onoffFalse: return _T("false");
case onoffTrue: return _T("true");
default: return _T("false");
case onoffFalse: return L"false";
case onoffTrue: return L"true";
default: return L"false";
}
}
else if (onofftostring1 == eType)
{
switch (this->m_eValue)
{
case onoffFalse: return _T("0");
case onoffTrue: return _T("1");
default: return _T("0");
case onoffFalse: return L"0";
case onoffTrue: return L"1";
default: return L"0";
}
}
else if (onofftostringOn == eType)
{
switch (this->m_eValue)
{
case onoffFalse: return _T("off");
case onoffTrue: return _T("on");
default: return _T("off");
case onoffFalse: return L"off";
case onoffTrue: return L"on";
default: return L"off";
}
}
else if (onofftostringT == eType)
{
switch (this->m_eValue)
{
case onoffFalse: return _T("f");
case onoffTrue: return _T("t");
default: return _T("f");
case onoffFalse: return L"f";
case onoffTrue: return L"t";
default: return L"f";
}
}
return _T("false");
return L"false";
}
std::wstring ToString3(EOnOffToString eType) const
{
......@@ -584,39 +584,39 @@ namespace SimpleTypes
{
switch(this->m_eValue)
{
case onoffFalse : return _T("false");
case onoffTrue : return _T("true");
default : return _T("false");
case onoffFalse : return L"false";
case onoffTrue : return L"true";
default : return L"false";
}
}
else if(onofftostring1 == eType)
{
switch(this->m_eValue)
{
case onoffFalse : return _T("0");
case onoffTrue : return _T("1");
default : return _T("0");
case onoffFalse : return L"0";
case onoffTrue : return L"1";
default : return L"0";
}
}
else if(onofftostringOn == eType)
{
switch(this->m_eValue)
{
case onoffFalse : return _T("off");
case onoffTrue : return _T("on");
default : return _T("off");
case onoffFalse : return L"off";
case onoffTrue : return L"on";
default : return L"off";
}
}
else if(onofftostringT == eType)
{
switch(this->m_eValue)
{
case onoffFalse : return _T("f");
case onoffTrue : return _T("t");
default : return _T("f");
case onoffFalse : return L"f";
case onoffTrue : return L"t";
default : return L"f";
}
}
return _T("false");
return L"false";
}
bool ToBool()
{
......@@ -658,7 +658,7 @@ namespace SimpleTypes
m_sValue = sValue;
for ( size_t nIndex = 0; nIndex < 20 - sValue.length(); nIndex++ )
{
m_sValue += _T("0");
m_sValue += L"0";
}
}
else if ( 20 == sValue.length() )
......@@ -826,9 +826,9 @@ namespace SimpleTypes
virtual EVerticalAlignRun FromString(std::wstring &sValue)
{
if ( _T("baseline") == sValue ) this->m_eValue = verticalalignrunBaseline;
else if ( _T("subscript") == sValue ) this->m_eValue = verticalalignrunSubscript;
else if ( _T("superscript") == sValue ) this->m_eValue = verticalalignrunSuperscript;
if ( L"baseline" == sValue ) this->m_eValue = verticalalignrunBaseline;
else if ( L"subscript" == sValue ) this->m_eValue = verticalalignrunSubscript;
else if ( L"superscript" == sValue ) this->m_eValue = verticalalignrunSuperscript;
else this->m_eValue = eDefValue;
return this->m_eValue;
......@@ -838,10 +838,10 @@ namespace SimpleTypes
{
switch(this->m_eValue)
{
case verticalalignrunBaseline : return _T("baseline");
case verticalalignrunSubscript : return _T("subscript");
case verticalalignrunSuperscript : return _T("superscript");
default : return _T("baseline");
case verticalalignrunBaseline : return L"baseline";
case verticalalignrunSubscript : return L"subscript";
case verticalalignrunSuperscript : return L"superscript";
default : return L"baseline";
}
}
......@@ -871,12 +871,12 @@ namespace SimpleTypes
virtual EXAlign FromString(std::wstring &sValue)
{
if ( _T("center") == sValue ) this->m_eValue = xalignCenter;
else if ( _T("inside") == sValue ) this->m_eValue = xalignInside;
else if ( _T("left") == sValue ) this->m_eValue = xalignLeft;
else if ( _T("outside") == sValue ) this->m_eValue = xalignOutside;
else if ( _T("right") == sValue ) this->m_eValue = xalignRight;
else this->m_eValue = eDefValue;
if ( L"center" == sValue ) this->m_eValue = xalignCenter;
else if ( L"inside" == sValue ) this->m_eValue = xalignInside;
else if ( L"left" == sValue ) this->m_eValue = xalignLeft;
else if ( L"outside" == sValue ) this->m_eValue = xalignOutside;
else if ( L"right" == sValue ) this->m_eValue = xalignRight;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
......@@ -885,12 +885,12 @@ namespace SimpleTypes
{
switch(this->m_eValue)
{
case xalignCenter : return _T("center");
case xalignInside : return _T("inside");
case xalignLeft : return _T("left");
case xalignOutside : return _T("outside");
case xalignRight : return _T("right");
default : return _T("left");
case xalignCenter : return L"center";
case xalignInside : return L"inside";
case xalignLeft : return L"left";
case xalignOutside : return L"outside";
case xalignRight : return L"right";
default : return L"left";
}
}
......@@ -923,14 +923,14 @@ namespace SimpleTypes
virtual EYAlign FromString(std::wstring &sValue)
{
if ( _T("bottom") == sValue ) this->m_eValue = yalignBottom;
else if ( _T("bot") == sValue ) this->m_eValue = yalignBottom;
else if ( _T("center") == sValue ) this->m_eValue = yalignCenter;
else if ( _T("inline") == sValue ) this->m_eValue = yalignInline;
else if ( _T("inside") == sValue ) this->m_eValue = yalignInside;
else if ( _T("outside") == sValue ) this->m_eValue = yalignOutside;
else if ( _T("top") == sValue ) this->m_eValue = yalignTop;
else this->m_eValue = eDefValue;
if ( L"bottom" == sValue ) this->m_eValue = yalignBottom;
else if ( L"bot" == sValue ) this->m_eValue = yalignBottom;
else if ( L"center" == sValue ) this->m_eValue = yalignCenter;
else if ( L"inline" == sValue ) this->m_eValue = yalignInline;
else if ( L"inside" == sValue ) this->m_eValue = yalignInside;
else if ( L"outside" == sValue ) this->m_eValue = yalignOutside;
else if ( L"top" == sValue ) this->m_eValue = yalignTop;
else this->m_eValue = eDefValue;
return this->m_eValue;
}
......@@ -939,13 +939,13 @@ namespace SimpleTypes
{
switch(this->m_eValue)
{
case yalignBottom : return _T("bottom");
case yalignCenter : return _T("center");
case yalignInline : return _T("inline");
case yalignInside : return _T("inside");
case yalignOutside : return _T("outside");
case yalignTop : return _T("top");
default : return _T("top");
case yalignBottom : return L"bottom";
case yalignCenter : return L"center";
case yalignInline : return L"inline";
case yalignInside : return L"inside";
case yalignOutside : return L"outside";
case yalignTop : return L"top";
default : return L"top";
}
}
......@@ -1180,22 +1180,22 @@ namespace SimpleTypes
}
void ByColorName(std::wstring& sValue)
{
if (sValue.find(_T("aqua")) >= 0)this->m_eValue = colortypeAqua;
else if (sValue.find(_T("black")) >= 0)this->m_eValue = colortypeBlack;
else if (sValue.find(_T("blue")) >= 0)this->m_eValue = colortypeBlue;
else if (sValue.find(_T("fuchsia")) >= 0)this->m_eValue = colortypeFuchsia;
else if (sValue.find(_T("gray")) >= 0)this->m_eValue = colortypeGray;
else if (sValue.find(_T("green")) >= 0)this->m_eValue = colortypeGreen;
else if (sValue.find(_T("lime")) >= 0)this->m_eValue = colortypeLime;
else if (sValue.find(_T("maroon")) >= 0)this->m_eValue = colortypeMaroon;
else if (sValue.find(_T("navy")) >= 0)this->m_eValue = colortypeNavy;
else if (sValue.find(_T("olive")) >= 0)this->m_eValue = colortypeOlive;
else if (sValue.find(_T("purple")) >= 0)this->m_eValue = colortypePurple;
else if (sValue.find(_T("red")) >= 0)this->m_eValue = colortypeRed;
else if (sValue.find(_T("silver")) >= 0)this->m_eValue = colortypeSilver;
else if (sValue.find(_T("teal")) >= 0)this->m_eValue = colortypeTeal;
else if (sValue.find(_T("white")) >= 0)this->m_eValue = colortypeWhite;
else if (sValue.find(_T("yellow")) >= 0)this->m_eValue = colortypeYellow;
if (std::wstring::npos != sValue.find(L"aqua")) this->m_eValue = colortypeAqua;
else if (std::wstring::npos != sValue.find(L"black")) this->m_eValue = colortypeBlack;
else if (std::wstring::npos != sValue.find(L"blue")) this->m_eValue = colortypeBlue;
else if (std::wstring::npos != sValue.find(L"fuchsia")) this->m_eValue = colortypeFuchsia;
else if (std::wstring::npos != sValue.find(L"gray")) this->m_eValue = colortypeGray;
else if (std::wstring::npos != sValue.find(L"green")) this->m_eValue = colortypeGreen;
else if (std::wstring::npos != sValue.find(L"lime")) this->m_eValue = colortypeLime;
else if (std::wstring::npos != sValue.find(L"maroon")) this->m_eValue = colortypeMaroon;
else if (std::wstring::npos != sValue.find(L"navy")) this->m_eValue = colortypeNavy;
else if (std::wstring::npos != sValue.find(L"olive")) this->m_eValue = colortypeOlive;
else if (std::wstring::npos != sValue.find(L"purple")) this->m_eValue = colortypePurple;
else if (std::wstring::npos != sValue.find(L"red")) this->m_eValue = colortypeRed;
else if (std::wstring::npos != sValue.find(L"silver")) this->m_eValue = colortypeSilver;
else if (std::wstring::npos != sValue.find(L"teal")) this->m_eValue = colortypeTeal;
else if (std::wstring::npos != sValue.find(L"white")) this->m_eValue = colortypeWhite;
else if (std::wstring::npos != sValue.find(L"yellow")) this->m_eValue = colortypeYellow;
else this->m_eValue = colortypeNone;
SetRGB();
......@@ -1227,14 +1227,14 @@ namespace SimpleTypes
virtual ETrueFalse FromString(std::wstring &sValue)
{
if ( _T("t") == sValue ) this->m_eValue = booleanTrue;
else if ( _T("true") == sValue ) this->m_eValue = booleanTrue;
else if ( _T("True") == sValue ) this->m_eValue = booleanTrue;
else if ( _T("") == sValue ) this->m_eValue = booleanFalse;
else if ( _T("f") == sValue ) this->m_eValue = booleanFalse;
else if ( _T("false") == sValue ) this->m_eValue = booleanFalse;
else if ( _T("False") == sValue ) this->m_eValue = booleanFalse;
else this->m_eValue = booleanFalse;
if ( L"t" == sValue ) this->m_eValue = booleanTrue;
else if ( L"true" == sValue ) this->m_eValue = booleanTrue;
else if ( L"True" == sValue ) this->m_eValue = booleanTrue;
else if ( L"" == sValue ) this->m_eValue = booleanFalse;
else if ( L"f" == sValue ) this->m_eValue = booleanFalse;
else if ( L"false" == sValue ) this->m_eValue = booleanFalse;
else if ( L"False" == sValue ) this->m_eValue = booleanFalse;
else this->m_eValue = booleanFalse;
return this->m_eValue;
}
......@@ -1243,9 +1243,9 @@ namespace SimpleTypes
{
switch(this->m_eValue)
{
case booleanFalse : return _T("f");
case booleanTrue : return _T("t");
default : return _T("f");
case booleanFalse : return L"f";
case booleanTrue : return L"t";
default : return L"f";
}
}
......
......@@ -2889,26 +2889,35 @@ namespace SimpleTypes
int nPos = (int)sValue.find( _T(",") );
if ( -1 == nPos )
return 0;
std::wstring strX = sValue.substr( 0, nPos );
{//only x position
std::wstring strX = sValue;
XmlUtils::replace_all(strX, L"@", L"");
m_nX = strX.empty() ? 0 : _wtoi(strX.c_str() );
m_nX = strX.empty() ? 0 : _wtoi(strX.c_str() );
return 0;
}
std::wstring strX = sValue.substr( 0, nPos );
XmlUtils::replace_all(strX, L"@", L"");
m_nX = strX.empty() ? 0 : _wtoi(strX.c_str() );
int nPos2 = (int)sValue.find( _T(","), nPos + 1 );
if ( -1 == nPos2 )
{// only x, y position
std::wstring strY = sValue.substr( nPos + 1);
XmlUtils::replace_all(strY, L"@", L"");
m_nY = strY.empty() ? 0 : _wtoi(strY.c_str() );
return 0;
}
std::wstring strY = sValue.substr( nPos + 1, nPos2 - nPos - 1);
std::wstring strZ = sValue.substr( nPos2 + 1, nLen - nPos2 - 1 ) ;
XmlUtils::replace_all(strY, L"@", L"");
XmlUtils::replace_all(strZ, L"@", L"");
std::wstring strY = sValue.substr( nPos + 1, nPos2 - nPos - 1);
std::wstring strZ = sValue.substr( nPos2 + 1, nLen - nPos2 - 1 ) ;
m_nY = strY.empty() ? 0 : _wtoi(strY.c_str() );
m_nZ = strZ.empty() ? 0 : _wtoi(strZ.c_str() );
XmlUtils::replace_all(strY, L"@", L"");
XmlUtils::replace_all(strZ, L"@", L"");
m_nY = strY.empty() ? 0 : _wtoi(strY.c_str() );
m_nZ = strZ.empty() ? 0 : _wtoi(strZ.c_str() );
return 0;
}
......@@ -2964,24 +2973,22 @@ namespace SimpleTypes
return 0;
int nPos = (int)sValue.find( _T(",") );
std::wstring strX, strY;
if ( -1 == nPos )
{
//only x coord
XmlUtils::replace_all(sValue, L"@", L"");
m_nX = sValue.empty() ? 0 : _wtoi(sValue.c_str() );
{//only x coord
strX = sValue;
}
else
{
std::wstring strX = sValue.substr( 0, nPos );
std::wstring strY = sValue.substr( nPos + 1, nLen - nPos - 1 ) ;
XmlUtils::replace_all(strY, L"@", L"");
XmlUtils::replace_all(strX, L"@", L"");
m_nX = strX.empty() ? 0 : _wtoi(strX.c_str() );
m_nY = strY.empty() ? 0 : _wtoi(strY.c_str() );
strX = sValue.substr( 0, nPos );
strY = sValue.substr( nPos + 1, nLen - nPos - 1 ) ;
}
XmlUtils::replace_all(strY, L"@", L"");
XmlUtils::replace_all(strX, L"@", L"");
m_nX = strX.empty() ? 0 : _wtoi(strX.c_str() );
m_nY = strY.empty() ? 0 : _wtoi(strY.c_str() );
return 0;
}
......@@ -3036,14 +3043,20 @@ namespace SimpleTypes
return 0;
int nPos = (int)sValue.find( _T(",") );
if ( -1 == nPos )
return 0;
std::wstring strX = sValue.substr( 0, nPos );
std::wstring strY = sValue.substr( nPos + 1, nLen - nPos - 1 ) ;
std::wstring strX, strY;
if ( -1 == nPos )
{
strX = sValue.substr( 0, nPos );
}
else
{
strX = sValue.substr( 0, nPos );
strY = sValue.substr( nPos + 1, nLen - nPos - 1 ) ;
}
m_dX = strX.empty() ? 0 : _wtof(strX.c_str() );
m_dY = strY.empty() ? 0 : _wtof(strY.c_str() );
m_dX = strX.empty() ? 0 : _wtof(strX.c_str() );
m_dY = strY.empty() ? 0 : _wtof(strY.c_str() );
return 0;
}
......@@ -3188,62 +3201,62 @@ namespace SimpleTypes
enum ECssPropertyType
{
cssptUnknown = 0000,
cssptUnknown = 0000,
cssptFlip = 1000,
cssptHeight = 1001,
cssptLeft = 1002,
cssptMarginBottom = 1003,
cssptMarginLeft = 1004,
cssptMarginRight = 1005,
cssptMarginTop = 1006,
cssptFlip = 1000,
cssptHeight = 1001,
cssptLeft = 1002,
cssptMarginBottom = 1003,
cssptMarginLeft = 1004,
cssptMarginRight = 1005,
cssptMarginTop = 1006,
cssptMsoPositionHorizontal = 1007,
cssptMsoPositionHorizontalRelative = 1008,
cssptMsoPositionVertical = 1009,
cssptMsoPositionVerticalRelative = 1010,
cssptMsoWrapDistanceBottom = 1011,
cssptMsoWrapDistanceLeft = 1012,
cssptMsoWrapDistanceRight = 1013,
cssptMsoWrapDistanceTop = 1014,
cssptMsoWrapEdited = 1015,
cssptMsoWrapStyle = 1016,
cssptPosition = 1017,
cssptRotation = 1018,
cssptTop = 1019,
cssptVisibility = 1020,
cssptWidth = 1021,
cssptMsoPositionHorizontalRelative = 1008,
cssptMsoPositionVertical = 1009,
cssptMsoPositionVerticalRelative = 1010,
cssptMsoWrapDistanceBottom = 1011,
cssptMsoWrapDistanceLeft = 1012,
cssptMsoWrapDistanceRight = 1013,
cssptMsoWrapDistanceTop = 1014,
cssptMsoWrapEdited = 1015,
cssptMsoWrapStyle = 1016,
cssptPosition = 1017,
cssptRotation = 1018,
cssptTop = 1019,
cssptVisibility = 1020,
cssptWidth = 1021,
cssptZIndex = 1022,
csspctMsoWidthPercent = 1023,
csspctMsoHeightPercent = 1024,
csspctMsoWidthPercent = 1023,
csspctMsoHeightPercent = 1024,
// Для элемента Textbox 14.1.2.22
cssptDirection = 1100,
cssptLayoutFlow = 1101,
cssptMsoDirectionAlt = 1102,
cssptMsoFitShapeToText = 1103,
cssptMsoFitTextToShape = 1104,
cssptMsoLayoutFlowAlt = 1105,
cssptMsoNextTextbox = 1106,
cssptMsoRotate = 1107,
cssptMsoTextScale = 1108,
cssptVTextAnchor = 1109,
cssptDirection = 1100,
cssptLayoutFlow = 1101,
cssptMsoDirectionAlt = 1102,
cssptMsoFitShapeToText = 1103,
cssptMsoFitTextToShape = 1104,
cssptMsoLayoutFlowAlt = 1105,
cssptMsoNextTextbox = 1106,
cssptMsoRotate = 1107,
cssptMsoTextScale = 1108,
cssptVTextAnchor = 1109,
// Для элемента Textpath 14.1.2.23
cssptFont = 1200,
cssptFontFamily = 1201,
cssptFontSize = 1202,
cssptFontStyle = 1203,
cssptFontVariant = 1204,
cssptFontWeight = 1205,
cssptMsoTextShadow = 1206,
cssptTextDecoration = 1207,
cssptVRotateLetters = 1208,
cssptVSameLetterHeights = 1209,
cssptVTextAlign = 1210,
cssptVTextKern = 1211,
cssptVTextReverse = 1212,
cssptVTextSpacingMode = 1213,
cssptVTextSpacing = 1214,
cssptFont = 1200,
cssptFontFamily = 1201,
cssptFontSize = 1202,
cssptFontStyle = 1203,
cssptFontVariant = 1204,
cssptFontWeight = 1205,
cssptMsoTextShadow = 1206,
cssptTextDecoration = 1207,
cssptVRotateLetters = 1208,
cssptVSameLetterHeights = 1209,
cssptVTextAlign = 1210,
cssptVTextKern = 1211,
cssptVTextReverse = 1212,
cssptVTextSpacingMode = 1213,
cssptVTextSpacing = 1214,
};
enum ECssFlip
......@@ -3334,10 +3347,10 @@ namespace SimpleTypes
};
enum ECssLayoutFlow
{
csslayoutflowHorizontal = 0,
csslayoutflowVertical = 1,
csslayoutflowVerticalIdeographic = 2,
csslayoutflowHorizontalIdeographic = 3,
csslayoutflowHorizontal = 0,
csslayoutflowVertical = 1,
csslayoutflowVerticalIdeographic = 2,
csslayoutflowHorizontalIdeographic = 3,
};
enum ECssDirectionAlt
{
......@@ -3421,23 +3434,23 @@ namespace SimpleTypes
union UCssValue
{
ECssFlip eFlip;
TCssUnitsValue oValue;
ECssMsoPosHor eMsoPosHor;
ECssMsoPosHorRel eMsoPosHorRel;
ECssMsoPosVer eMsoPosVer;
ECssMsoPosVerRel eMsoPosVerRel;
double dValue;
bool bValue;
ECssMsoWrapStyle eMsoWrapStyle;
ECssPosition ePosition;
ECssVisibility eVisibility;
TCssZIndexValue oZIndex;
ECssDirection eDirection;
ECssLayoutFlow eLayoutFlow;
ECssDirectionAlt eDirectionAlt;
ECssLayoutFlowAlt eLayoutFlowAlt;
wchar_t wsValue[CSS_MAX_NAME_LEN + 1];
ECssFlip eFlip;
TCssUnitsValue oValue;
ECssMsoPosHor eMsoPosHor;
ECssMsoPosHorRel eMsoPosHorRel;
ECssMsoPosVer eMsoPosVer;
ECssMsoPosVerRel eMsoPosVerRel;
double dValue;
bool bValue;
ECssMsoWrapStyle eMsoWrapStyle;
ECssPosition ePosition;
ECssVisibility eVisibility;
TCssZIndexValue oZIndex;
ECssDirection eDirection;
ECssLayoutFlow eLayoutFlow;
ECssDirectionAlt eDirectionAlt;
ECssLayoutFlowAlt eLayoutFlowAlt;
wchar_t wsValue[CSS_MAX_NAME_LEN + 1];
ECssMsoRotate eRotate;
ECssVTextAnchor eVTextAnchor;
ECssFontStyle eFontStyle;
......@@ -4176,12 +4189,16 @@ namespace SimpleTypes
int nPos = (int)sValue.find( _T(",") );
if ( -1 == nPos )
{//only x position
SimpleTypes::CPoint oPt1 = sValue;
m_dX = oPt1.GetValue();
return 0;
}
SimpleTypes::CPoint oPt1 = sValue.substr( 0, nPos );
SimpleTypes::CPoint oPt1 = sValue.substr( 0, nPos );
m_dX = oPt1.GetValue();
SimpleTypes::CPoint oPt2 = sValue.substr( nPos + 1, nLen - nPos - 1 );
SimpleTypes::CPoint oPt2 = sValue.substr( nPos + 1, nLen - nPos - 1 );
m_dY = oPt2.GetValue();
return 0;
......@@ -4238,12 +4255,16 @@ namespace SimpleTypes
int nPos = (int)sValue.find( _T(",") );
if ( -1 == nPos )
{//only x position
SimpleTypes::CPercentage oPerc1 = sValue;
m_dX = oPerc1.GetValue();
return 0;
}
SimpleTypes::CPercentage oPerc1 = sValue.substr( 0, nPos );
SimpleTypes::CPercentage oPerc1 = sValue.substr( 0, nPos );
m_dX = oPerc1.GetValue();
SimpleTypes::CPercentage oPerc2 = sValue.substr( nPos + 1, nLen - nPos - 1 );
SimpleTypes::CPercentage oPerc2 = sValue.substr( nPos + 1, nLen - nPos - 1 );
m_dY = oPerc2.GetValue();
return 0;
......@@ -4300,12 +4321,16 @@ namespace SimpleTypes
int nPos = (int)sValue.find( _T(",") );
if ( -1 == nPos )
{//only x position
SimpleTypes::Vml::CVml_1_65536 oFraction1 = sValue;
m_dX = oFraction1.GetValue();
return 0;
}
SimpleTypes::Vml::CVml_1_65536 oFraction1 = sValue.substr( 0, nPos );
SimpleTypes::Vml::CVml_1_65536 oFraction1 = sValue.substr( 0, nPos );
m_dX = oFraction1.GetValue();
SimpleTypes::Vml::CVml_1_65536 oFraction2 = sValue.substr( nPos + 1, nLen - nPos - 1 );
SimpleTypes::Vml::CVml_1_65536 oFraction2 = sValue.substr( nPos + 1, nLen - nPos - 1 );
m_dY = oFraction2.GetValue();
return 0;
......
......@@ -643,7 +643,7 @@ namespace OOX
nullable<OOX::Logic::CBackground > m_oBackground;
std::vector<WritingElement *> m_arrItems;
std::vector<std::wstring> m_arrShapeTypes;
std::vector<std::wstring> m_arrShapeTypes;
};
......
......@@ -60,77 +60,77 @@ namespace OOX
virtual ~CVmlCommonElements(){}
virtual void fromXML(XmlUtils::CXmlNode& oNode){}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlNode& oNode){}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes (oReader);
ReadElements (oReader);
}
virtual std::wstring toXML() const;
virtual EElementType getType() const
virtual std::wstring toXML() const;
virtual EElementType getType() const
{
return et_v_shape_elements;
}
// 1 AG_AllCoreAttributes
// 1.1 AG_CoreAttributes
nullable<std::wstring> m_sId;
nullable<SimpleTypes::Vml::CCssStyle> m_oStyle;
nullable<std::wstring> m_sHref;
nullable<std::wstring> m_sTarget;
nullable<std::wstring> m_sClass;
nullable<std::wstring> m_sTitle;
nullable<std::wstring> m_sAlt;
nullable<SimpleTypes::Vml::CVml_Vector2D> m_oCoordSize;
nullable<SimpleTypes::Vml::CVml_Vector2D> m_oCoordOrigin;
nullable<SimpleTypes::Vml::CVml_Polygon2D> m_oWrapCoords;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oPrint;
// 1.2 AG_OfficeCoreAttributes
nullable<std::wstring> m_sSpId;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oOned;
nullable<SimpleTypes::CDecimalNumber<>> m_oRegroupId;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oDoubleClickNotify;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oButton;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oUserHidden;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oBullet;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oHr;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oHrStd;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oHrNoShade;
SimpleTypes::CDouble m_oHrPct;
SimpleTypes::CHrAlign<SimpleTypes::hralignLeft> m_oHrAlign;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oAllowInCell;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oAllowOverlap;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oUserDrawn;
nullable<SimpleTypes::CColorType<>> m_oBorderTopColor;
nullable<SimpleTypes::CColorType<>> m_oBorderLeftColor;
nullable<SimpleTypes::CColorType<>> m_oBorderBottomColor;
nullable<SimpleTypes::CColorType<>> m_oBorderRightColor;
nullable<SimpleTypes::CDiagramLayout<>> m_oDgmLayout;
nullable<std::wstring> m_oDgmNodeKind;
nullable<SimpleTypes::CDiagramLayout<>> m_oDgmLayoutMru;
SimpleTypes::CInsetMode<SimpleTypes::insetmodeAuto> m_oInsetMode;
// 2 AG_AllShapeAttributes
// 2.1 AG_ShapeAttributes
nullable<SimpleTypes::CColorType<>> m_oChromaKey;
nullable<SimpleTypes::CTrueFalse<>> m_oFilled;
nullable<SimpleTypes::CColorType<>> m_oFillColor;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oOpacity;
nullable<SimpleTypes::CTrueFalse<>> m_oStroked;
nullable<SimpleTypes::CColorType<>> m_oStrokeColor;
nullable<SimpleTypes::CEmu> m_oStrokeWeight;
nullable<SimpleTypes::CTrueFalse<>> m_oInsetPen;
// 2.2 AG_OfficeShapeAttributes
nullable<SimpleTypes::CDecimalNumber<>> m_oSpt;
nullable<SimpleTypes::CConnectorType<>> m_oConnectorType;
nullable<SimpleTypes::CBWMode<>> m_oBwMode;
nullable<SimpleTypes::CBWMode<>> m_oBwPure;
nullable<SimpleTypes::CBWMode<>> m_oBwNormal;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oForceDash;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oOleIcon;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oOle;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oPreferRelative;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oClipToWrap;
nullable<SimpleTypes::CTrueFalse<>> m_oClip;
// 1 AG_AllCoreAttributes
// 1.1 AG_CoreAttributes
nullable<std::wstring> m_sId;
nullable<SimpleTypes::Vml::CCssStyle> m_oStyle;
nullable<std::wstring> m_sHref;
nullable<std::wstring> m_sTarget;
nullable<std::wstring> m_sClass;
nullable<std::wstring> m_sTitle;
nullable<std::wstring> m_sAlt;
nullable<SimpleTypes::Vml::CVml_Vector2D> m_oCoordSize;
nullable<SimpleTypes::Vml::CVml_Vector2D> m_oCoordOrigin;
nullable<SimpleTypes::Vml::CVml_Polygon2D> m_oWrapCoords;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oPrint;
// 1.2 AG_OfficeCoreAttributes
nullable<std::wstring> m_sSpId;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oOned;
nullable<SimpleTypes::CDecimalNumber<>> m_oRegroupId;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oDoubleClickNotify;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oButton;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oUserHidden;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oBullet;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oHr;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oHrStd;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oHrNoShade;
SimpleTypes::CDouble m_oHrPct;
SimpleTypes::CHrAlign<SimpleTypes::hralignLeft> m_oHrAlign;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oAllowInCell;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oAllowOverlap;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oUserDrawn;
nullable<SimpleTypes::CColorType<>> m_oBorderTopColor;
nullable<SimpleTypes::CColorType<>> m_oBorderLeftColor;
nullable<SimpleTypes::CColorType<>> m_oBorderBottomColor;
nullable<SimpleTypes::CColorType<>> m_oBorderRightColor;
nullable<SimpleTypes::CDiagramLayout<>> m_oDgmLayout;
nullable<std::wstring> m_oDgmNodeKind;
nullable<SimpleTypes::CDiagramLayout<>> m_oDgmLayoutMru;
SimpleTypes::CInsetMode<SimpleTypes::insetmodeAuto> m_oInsetMode;
// 2 AG_AllShapeAttributes
// 2.1 AG_ShapeAttributes
nullable<SimpleTypes::CColorType<>> m_oChromaKey;
nullable<SimpleTypes::CTrueFalse<>> m_oFilled;
nullable<SimpleTypes::CColorType<>> m_oFillColor;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oOpacity;
nullable<SimpleTypes::CTrueFalse<>> m_oStroked;
nullable<SimpleTypes::CColorType<>> m_oStrokeColor;
nullable<SimpleTypes::CEmu> m_oStrokeWeight;
nullable<SimpleTypes::CTrueFalse<>> m_oInsetPen;
// 2.2 AG_OfficeShapeAttributes
nullable<SimpleTypes::CDecimalNumber<>> m_oSpt;
nullable<SimpleTypes::CConnectorType<>> m_oConnectorType;
nullable<SimpleTypes::CBWMode<>> m_oBwMode;
nullable<SimpleTypes::CBWMode<>> m_oBwPure;
nullable<SimpleTypes::CBWMode<>> m_oBwNormal;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oForceDash;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oOleIcon;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oOle;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oPreferRelative;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oClipToWrap;
nullable<SimpleTypes::CTrueFalse<>> m_oClip;
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader);
void ReadElements(XmlUtils::CXmlLiteReader& oReader) ;
......@@ -150,18 +150,18 @@ namespace OOX
virtual ~CArc(){}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CArc::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
CVmlCommonElements::ReadAttributes( oReader );
CVmlCommonElements::ReadElements( oReader );
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<v:arc ");
......@@ -233,17 +233,17 @@ namespace OOX
virtual ~CCurve(){}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CCurve::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
CVmlCommonElements::ReadAttributes( oReader );
CVmlCommonElements::ReadElements( oReader );
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<v:curve ");
......@@ -404,11 +404,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CFill::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -597,7 +597,7 @@ namespace OOX
// Attributes
nullable<SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue>> m_oAlignShape;
nullable<std::wstring> m_sAltHref;
nullable<std::wstring> m_sAltHref;
nullable<SimpleTypes::CDecimalNumber<>> m_oAngle;
nullable<SimpleTypes::CImageAspect<SimpleTypes::imageaspectIgnore>> m_oAspect;
nullable<SimpleTypes::CColorType<>> m_oColor;
......@@ -607,9 +607,9 @@ namespace OOX
nullable<SimpleTypes::CFixedPercentage > m_oFocus;
nullable<SimpleTypes::Vml::CVml_Vector2D_Percentage> m_oFocusPosition;
nullable<SimpleTypes::Vml::CVml_Vector2D_Percentage> m_oFocusSize;
nullable<std::wstring> m_sHref;
nullable<std::wstring> m_sHref;
nullable<SimpleTypes::CRelationshipId> m_rId;
nullable<std::wstring> m_sId;
nullable<std::wstring> m_sId;
nullable<SimpleTypes::CFillMethod<SimpleTypes::fillmethodSigma>> m_oMethod;
nullable<SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue>> m_oOn;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oOpacity;
......@@ -620,8 +620,8 @@ namespace OOX
nullable<SimpleTypes::CRelationshipId> m_oRelId;
nullable<SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse>> m_oRotate;
nullable<SimpleTypes::Vml::CVml_Vector2D_Units> m_oSize;
nullable<std::wstring> m_sSrc;
nullable<std::wstring> m_sTitle;
nullable<std::wstring> m_sSrc;
nullable<std::wstring> m_sTitle;
SimpleTypes::CFillType<SimpleTypes::filltypeSolid, 0> m_oType;
// Childs
......@@ -631,7 +631,7 @@ namespace OOX
//--------------------------------------------------------------------------------
// CBackground 14.1.2.2 (Part4)
//--------------------------------------------------------------------------------
class CBackground : public WritingElement
class CBackground : public CVmlCommonElements
{
public:
WritingElement_AdditionConstructors(CBackground)
......@@ -644,35 +644,24 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CBackground::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
CVmlCommonElements::ReadAttributes( oReader );
CVmlCommonElements::ReadElements( oReader );
int nCurDepth = oReader.GetDepth();
while ( oReader.ReadNextSiblingNode( nCurDepth ) )
{
std::wstring sName = oReader.GetName();
if ( _T("v:fill") == sName )
m_oFill = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<v:background ");
ComplexTypes_WriteAttribute2( _T("id=\""), m_sId );
if ( SimpleTypes::booleanTrue != m_oFilled.GetValue() )
sResult += _T("filled=\"false\" ");
ComplexTypes_WriteAttribute ( _T("fillcolor=\""), m_oFillColor );
sResult += CVmlCommonElements::WriteAttributes();
ComplexTypes_WriteAttribute ( _T("o:bwmode=\""), m_oBwMode );
ComplexTypes_WriteAttribute ( _T("o:bwpure=\""), m_oBwPure );
ComplexTypes_WriteAttribute ( _T("o:bwnormal=\""), m_oBwNormal );
......@@ -680,8 +669,7 @@ namespace OOX
sResult += _T(">");
if ( m_oFill.IsInit() )
sResult += m_oFill->toXML();
sResult += CVmlCommonElements::WriteElements();
sResult += _T("</v:background>");
......@@ -709,15 +697,6 @@ namespace OOX
wchar_t wsChar = wsName[0];
switch ( wsChar )
{
case 'f':
if ( _T("fillcolor") == wsName ) m_oFillColor = oReader.GetText();
else if ( _T("filled") == wsName ) m_oFilled = oReader.GetText();
break;
case 'i':
if ( _T("id") == wsName ) m_sId = oReader.GetText();
break;
case 'o':
if ( _T("o:bwmode") == wsName ) m_oBwMode = oReader.GetText();
else if ( _T("o:bwnormal") == wsName ) m_oBwNormal = oReader.GetText();
......@@ -739,17 +718,11 @@ namespace OOX
public:
// Attributes
nullable<SimpleTypes::CBWMode<>> m_oBwMode;
nullable<SimpleTypes::CBWMode<>> m_oBwNormal;
nullable<SimpleTypes::CBWMode<>> m_oBwPure;
nullable<SimpleTypes::CColorType<>> m_oFillColor;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oFilled;
nullable<std::wstring> m_sId;
nullable<SimpleTypes::CScreenSize<>> m_oTargetScreenSize;
// Childs
nullable<OOX::Vml::CFill> m_oFill;
// Attributes
nullable<SimpleTypes::CBWMode<>> m_oBwMode;
nullable<SimpleTypes::CBWMode<>> m_oBwNormal;
nullable<SimpleTypes::CBWMode<>> m_oBwPure;
nullable<SimpleTypes::CScreenSize<>> m_oTargetScreenSize;
};
//--------------------------------------------------------------------------------
......@@ -768,11 +741,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CFormulas::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
if ( oReader.IsEmptyNode() )
return;
......@@ -788,7 +761,7 @@ namespace OOX
}
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<v:formulas>");
......@@ -1029,17 +1002,17 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CImage::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
CVmlCommonElements::ReadAttributes( oReader );
CVmlCommonElements::ReadElements( oReader );
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<v:image ");
......@@ -1176,18 +1149,18 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CImageData::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<v:imagedata ");
......@@ -1343,16 +1316,16 @@ namespace OOX
public:
// Attributes
nullable<std::wstring> m_sAltHref;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oBiLevel;
SimpleTypes::CDouble m_oBlackLevel;
nullable<SimpleTypes::CColorType<>> m_oChromaKey;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oCropLeft;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oCropTop;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oCropRight;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oCropBottom;
nullable<SimpleTypes::CTrueFalse<>> m_oDetectMouseClick;
nullable<SimpleTypes::CColorType<>> m_oEmbossColor;
nullable<std::wstring> m_sAltHref;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oBiLevel;
SimpleTypes::CDouble m_oBlackLevel;
nullable<SimpleTypes::CColorType<>> m_oChromaKey;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oCropLeft;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oCropTop;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oCropRight;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oCropBottom;
nullable<SimpleTypes::CTrueFalse<>> m_oDetectMouseClick;
nullable<SimpleTypes::CColorType<>> m_oEmbossColor;
SimpleTypes::CDouble m_oGain;
SimpleTypes::CDouble m_oGamma;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oGrayscale;
......@@ -1379,17 +1352,17 @@ namespace OOX
virtual ~CLine(){}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CLine::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
CVmlCommonElements::ReadAttributes( oReader );
CVmlCommonElements::ReadElements( oReader );
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<v:line ");
......@@ -1465,16 +1438,16 @@ namespace OOX
virtual ~COval(){}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать COval::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
CVmlCommonElements::ReadAttributes( oReader );
CVmlCommonElements::ReadElements( oReader );
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<v:oval ");
......@@ -1510,18 +1483,18 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CPath::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<v:path ");
......@@ -1788,17 +1761,17 @@ namespace OOX
virtual ~CRoundRect(){}
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CRoundRect::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
CVmlCommonElements::ReadAttributes( oReader );
CVmlCommonElements::ReadElements( oReader );
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<v:roundrect ");
......@@ -1872,11 +1845,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CShadow::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -1987,17 +1960,17 @@ namespace OOX
public:
// Attributes
SimpleTypes::CColorType<SimpleTypes::colortypeRGB> m_oColor;
SimpleTypes::CColorType<SimpleTypes::colortypeRGB> m_oColor2;
nullable<std::wstring> m_oId;
nullable<SimpleTypes::Vml::CVml_Matrix> m_oMatrix;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oObscured;
SimpleTypes::Vml::CVml_Vector2D_Units_Or_Percentage m_oOffset;
SimpleTypes::Vml::CVml_Vector2D_Units_Or_Percentage m_oOffset2;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oOn;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oOpacity;
SimpleTypes::Vml::CVml_Vector2D_Percentage m_oOrigin;
SimpleTypes::CShadowType<SimpleTypes::shadowtypeSingle> m_oType;
SimpleTypes::CColorType<SimpleTypes::colortypeRGB> m_oColor;
SimpleTypes::CColorType<SimpleTypes::colortypeRGB> m_oColor2;
nullable<std::wstring> m_oId;
nullable<SimpleTypes::Vml::CVml_Matrix> m_oMatrix;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oObscured;
SimpleTypes::Vml::CVml_Vector2D_Units_Or_Percentage m_oOffset;
SimpleTypes::Vml::CVml_Vector2D_Units_Or_Percentage m_oOffset2;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oOn;
nullable<SimpleTypes::Vml::CVml_1_65536> m_oOpacity;
SimpleTypes::Vml::CVml_Vector2D_Percentage m_oOrigin;
SimpleTypes::CShadowType<SimpleTypes::shadowtypeSingle> m_oType;
};
//--------------------------------------------------------------------------------
// CShape 14.1.2.19 (Part4)
......@@ -2011,14 +1984,14 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode){}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlNode& oNode){}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
CVmlCommonElements::ReadAttributes( oReader );
CVmlCommonElements::ReadElements( oReader );
}
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const
{
return OOX::et_v_shape;
......@@ -2089,14 +2062,14 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode){}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlNode& oNode){}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
CVmlCommonElements::ReadAttributes( oReader );
CVmlCommonElements::ReadElements( oReader );
}
virtual std::wstring toXML() const;
virtual std::wstring toXML() const;
virtual EElementType getType() const
{
return OOX::et_v_shapetype;
......@@ -2161,9 +2134,9 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual EElementType getType() const
{
return OOX::et_v_ClientData;
......@@ -2197,13 +2170,13 @@ namespace OOX
public:
// Attributes
nullable<SimpleTypes::Vml::CVmlClientDataObjectType<>> m_oObjectType;
nullable<SimpleTypes::Vml::CVmlClientDataObjectType<>> m_oObjectType;
nullable<SimpleTypes::COnOff<SimpleTypes::onoffTrue>> m_oMoveWithCells;
nullable<SimpleTypes::COnOff<SimpleTypes::onoffTrue>> m_oSizeWithCells;
nullable<std::wstring> m_oAnchor;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oRow;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oColumn;
nullable<SimpleTypes::COnOff<SimpleTypes::onoffTrue>> m_oMoveWithCells;
nullable<SimpleTypes::COnOff<SimpleTypes::onoffTrue>> m_oSizeWithCells;
nullable<std::wstring> m_oAnchor;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oRow;
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oColumn;
};
//--------------------------------------------------------------------------------
// CStroke 14.1.2.21 (Part4)
......@@ -2221,11 +2194,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CStroke::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -2249,7 +2222,7 @@ namespace OOX
m_oColumn = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<v:stroke ");
......@@ -2440,35 +2413,35 @@ namespace OOX
public:
// Attributes
nullable<std::wstring> m_oId;
nullable<std::wstring> m_sAltHref;
nullable<SimpleTypes::CColorType<SimpleTypes::colortypeBlack>> m_oColor;
nullable<SimpleTypes::CColorType<SimpleTypes::colortypeBlack>> m_oColor2;
SimpleTypes::Vml::CVmlDashStyle<SimpleTypes::Vml::vmldashstyleSolid> m_oDahsStyle;
SimpleTypes::CStrokeArrowType<SimpleTypes::strokearrowtypeNone> m_oEndArrow;
SimpleTypes::CStrokeArrowLength<SimpleTypes::strokearrowlengthMedium> m_oEndArrowLength;
SimpleTypes::CStrokeArrowWidth<SimpleTypes::strokearrowwidthMedium> m_oEndArrowWidth;
SimpleTypes::CStrokeEndCap<SimpleTypes::strokeendcapFlat> m_oEndCap;
SimpleTypes::CFillType<SimpleTypes::filltypeSolid, 0> m_oFillType;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oForceDash;
nullable<std::wstring> m_sHref;
nullable<SimpleTypes::CRelationshipId> m_rId;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oImageAlignShape;
SimpleTypes::CImageAspect<SimpleTypes::imageaspectIgnore> m_oImageAspect;
nullable<SimpleTypes::Vml::CVml_Vector2D_Units> m_oImageSize;
nullable<SimpleTypes::CTrueFalse<>> m_oInsetPen;
SimpleTypes::CStrokeJoinStyle<SimpleTypes::strokejoinstyleRound> m_oJoinStyle;
nullable<std::wstring> m_oId;
nullable<std::wstring> m_sAltHref;
nullable<SimpleTypes::CColorType<SimpleTypes::colortypeBlack>> m_oColor;
nullable<SimpleTypes::CColorType<SimpleTypes::colortypeBlack>> m_oColor2;
SimpleTypes::Vml::CVmlDashStyle<SimpleTypes::Vml::vmldashstyleSolid> m_oDahsStyle;
SimpleTypes::CStrokeArrowType<SimpleTypes::strokearrowtypeNone> m_oEndArrow;
SimpleTypes::CStrokeArrowLength<SimpleTypes::strokearrowlengthMedium> m_oEndArrowLength;
SimpleTypes::CStrokeArrowWidth<SimpleTypes::strokearrowwidthMedium> m_oEndArrowWidth;
SimpleTypes::CStrokeEndCap<SimpleTypes::strokeendcapFlat> m_oEndCap;
SimpleTypes::CFillType<SimpleTypes::filltypeSolid, 0> m_oFillType;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oForceDash;
nullable<std::wstring> m_sHref;
nullable<SimpleTypes::CRelationshipId> m_rId;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oImageAlignShape;
SimpleTypes::CImageAspect<SimpleTypes::imageaspectIgnore> m_oImageAspect;
nullable<SimpleTypes::Vml::CVml_Vector2D_Units> m_oImageSize;
nullable<SimpleTypes::CTrueFalse<>> m_oInsetPen;
SimpleTypes::CStrokeJoinStyle<SimpleTypes::strokejoinstyleRound> m_oJoinStyle;
nullable<SimpleTypes::CStrokeLineStyle<SimpleTypes::strokelinestyleSingle>> m_oLineStyle;
SimpleTypes::CDecimalNumber<8> m_oMiterLimit;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oOn;
nullable<SimpleTypes::CDouble> m_oOpacity;
nullable<SimpleTypes::CRelationshipId> m_oRelId;
nullable<std::wstring> m_sSrc;
SimpleTypes::CStrokeArrowType<SimpleTypes::strokearrowtypeNone> m_oStartArrow;
SimpleTypes::CStrokeArrowLength<SimpleTypes::strokearrowlengthMedium> m_oStartArrowLength;
SimpleTypes::CStrokeArrowWidth<SimpleTypes::strokearrowwidthMedium> m_oStartArrowWidth;
nullable<std::wstring> m_sTitle;
SimpleTypes::CDouble m_oWeight;
SimpleTypes::CDecimalNumber<8> m_oMiterLimit;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oOn;
nullable<SimpleTypes::CDouble> m_oOpacity;
nullable<SimpleTypes::CRelationshipId> m_oRelId;
nullable<std::wstring> m_sSrc;
SimpleTypes::CStrokeArrowType<SimpleTypes::strokearrowtypeNone> m_oStartArrow;
SimpleTypes::CStrokeArrowLength<SimpleTypes::strokearrowlengthMedium> m_oStartArrowLength;
SimpleTypes::CStrokeArrowWidth<SimpleTypes::strokearrowwidthMedium> m_oStartArrowWidth;
nullable<std::wstring> m_sTitle;
SimpleTypes::CDouble m_oWeight;
// Childs
nullable<OOX::VmlOffice::CStrokeChild> m_oLeft;
......@@ -2494,11 +2467,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CTextbox::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -2612,11 +2585,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CTextPath::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -2625,7 +2598,7 @@ namespace OOX
if ( !oReader.IsEmptyNode() )
oReader.ReadTillEnd();
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<v:textpath ");
......@@ -2707,16 +2680,16 @@ namespace OOX
public:
// Attributes
nullable<SimpleTypes::CTrueFalse<>> m_oFitPath;
nullable<SimpleTypes::CTrueFalse<>> m_oFitShape;
nullable<std::wstring> m_oId;
nullable<SimpleTypes::CTrueFalse<>> m_oOn;
nullable<std::wstring> m_sString;
nullable<SimpleTypes::Vml::CCssStyle> m_oStyle;
nullable<SimpleTypes::CTrueFalse<>> m_oTrim;
nullable<SimpleTypes::CTrueFalse<>> m_oXScale;
nullable<SimpleTypes::CTrueFalse<>> m_oFitPath;
nullable<SimpleTypes::CTrueFalse<>> m_oFitShape;
nullable<std::wstring> m_oId;
nullable<SimpleTypes::CTrueFalse<>> m_oOn;
nullable<std::wstring> m_sString;
nullable<SimpleTypes::Vml::CCssStyle> m_oStyle;
nullable<SimpleTypes::CTrueFalse<>> m_oTrim;
nullable<SimpleTypes::CTrueFalse<>> m_oXScale;
nullable<std::wstring> m_sStringOriginal;
nullable<std::wstring> m_sStringOriginal;
};
//--------------------------------------------------------------------------------
// CGroup 14.1.2.7 (Part4)
......@@ -2731,9 +2704,9 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual void fromXML(XmlUtils::CXmlNode& oNode);
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
virtual std::wstring toXML() const;
virtual EElementType getType() const
{
return OOX::et_v_group;
......@@ -2865,51 +2838,49 @@ namespace OOX
}
public:
// Attributes
// AG_AllCoreAttributes
nullable<std::wstring> m_sId;
nullable<SimpleTypes::Vml::CCssStyle> m_oStyle;
nullable<std::wstring> m_sHref;
nullable<std::wstring> m_sTarget;
nullable<std::wstring> m_sClass;
nullable<std::wstring> m_sTitle;
nullable<std::wstring> m_sAlt;
nullable<SimpleTypes::Vml::CVml_Vector2D> m_oCoordSize;
nullable<SimpleTypes::Vml::CVml_Vector2D> m_oCoordOrigin;
nullable<SimpleTypes::Vml::CVml_Polygon2D> m_oWrapCoords;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oPrint;
nullable<std::wstring> m_sSpId;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oOned;
nullable<SimpleTypes::CDecimalNumber<>> m_oRegroupId;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oDoubleClickNotify;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oButton;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oUserHidden;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oBullet;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oHr;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oHrStd;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oHrNoShade;
SimpleTypes::CDouble m_oHrPct;
SimpleTypes::CHrAlign<SimpleTypes::hralignLeft> m_oHrAlign;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oAllowInCell;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oAllowOverlap;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oUserDrawn;
nullable<SimpleTypes::CColorType<>> m_oBorderTopColor;
nullable<SimpleTypes::CColorType<>> m_oBorderLeftColor;
nullable<SimpleTypes::CColorType<>> m_oBorderBottomColor;
nullable<SimpleTypes::CColorType<>> m_oBorderRightColor;
nullable<SimpleTypes::CDiagramLayout<>> m_oDgmLayout;
nullable<std::wstring> m_oDgmNodeKind;
nullable<SimpleTypes::CDiagramLayout<>> m_oDgmLayoutMru;
SimpleTypes::CInsetMode<SimpleTypes::insetmodeCustom> m_oInsetMode;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oFilled;
nullable<SimpleTypes::CColorType<>> m_oFillColor;
nullable<SimpleTypes::CEditAs<>> m_oEditAs;
nullable<SimpleTypes::Vml::CVml_TableLimits> m_oTableLimits;
SimpleTypes::Vml::CVml_TableProperties<0> m_oTableProperties;
nullable<std::wstring> m_sId;
nullable<SimpleTypes::Vml::CCssStyle> m_oStyle;
nullable<std::wstring> m_sHref;
nullable<std::wstring> m_sTarget;
nullable<std::wstring> m_sClass;
nullable<std::wstring> m_sTitle;
nullable<std::wstring> m_sAlt;
nullable<SimpleTypes::Vml::CVml_Vector2D> m_oCoordSize;
nullable<SimpleTypes::Vml::CVml_Vector2D> m_oCoordOrigin;
nullable<SimpleTypes::Vml::CVml_Polygon2D> m_oWrapCoords;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oPrint;
nullable<std::wstring> m_sSpId;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oOned;
nullable<SimpleTypes::CDecimalNumber<>> m_oRegroupId;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oDoubleClickNotify;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oButton;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oUserHidden;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oBullet;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oHr;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oHrStd;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oHrNoShade;
SimpleTypes::CDouble m_oHrPct;
SimpleTypes::CHrAlign<SimpleTypes::hralignLeft> m_oHrAlign;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oAllowInCell;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oAllowOverlap;
SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oUserDrawn;
nullable<SimpleTypes::CColorType<>> m_oBorderTopColor;
nullable<SimpleTypes::CColorType<>> m_oBorderLeftColor;
nullable<SimpleTypes::CColorType<>> m_oBorderBottomColor;
nullable<SimpleTypes::CColorType<>> m_oBorderRightColor;
nullable<SimpleTypes::CDiagramLayout<>> m_oDgmLayout;
nullable<std::wstring> m_oDgmNodeKind;
nullable<SimpleTypes::CDiagramLayout<>> m_oDgmLayoutMru;
SimpleTypes::CInsetMode<SimpleTypes::insetmodeCustom> m_oInsetMode;
SimpleTypes::CTrueFalse<SimpleTypes::booleanTrue> m_oFilled;
nullable<SimpleTypes::CColorType<>> m_oFillColor;
nullable<SimpleTypes::CEditAs<>> m_oEditAs;
nullable<SimpleTypes::Vml::CVml_TableLimits> m_oTableLimits;
SimpleTypes::Vml::CVml_TableProperties<0> m_oTableProperties;
};
} // namespace Vml
} // namespace OOX
......@@ -2934,11 +2905,11 @@ namespace OOX
public:
virtual void fromXML(XmlUtils::CXmlNode& oNode)
virtual void fromXML(XmlUtils::CXmlNode& oNode)
{
// TO DO: Реализовать CShapeDefaults::fromXML(XmlUtils::CXmlNode& oNode)
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
......@@ -2971,7 +2942,7 @@ namespace OOX
m_oColorMenu = oReader;
}
}
virtual std::wstring toXML() const
virtual std::wstring toXML() const
{
std::wstring sResult = _T("<o:shapedefaults ");
......
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