Compare commits

..

8 Commits

Author SHA1 Message Date
f86579d601 PDFReader: text clip 2017-02-03 13:02:26 +03:00
de7511f243 . 2017-02-03 12:42:06 +03:00
9a68a75f70 fix... 2017-02-02 18:43:38 +03:00
e04388aa32 . 2017-02-02 16:53:20 +03:00
cee61e7a92 x2t version up 2017-02-02 16:31:02 +03:00
48185ed4e9 DocxFormat - fix vml single geom position
RtfFormat - read/write background page (solid, pattern, gradient, image)
2017-02-02 15:44:03 +03:00
7bea086784 Fixed bugs with reading pdf files. 2017-02-02 14:53:01 +03:00
774f9c42cb PDF bugs 2017-02-01 19:20:12 +03:00
45 changed files with 4891 additions and 4564 deletions

View File

@ -232,7 +232,8 @@ namespace DocFileFormat
case sprmOldCIss:
case sprmCIss:
appendValueElement( parent, L"vertAlign", FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ), true );
if (iter->argumentsSize > 0 && iter->Arguments[0] < 3) //Metaevan.doc
appendValueElement( parent, L"vertAlign", FormatUtils::MapValueToWideString( iter->Arguments[0], &SuperscriptIndex[0][0], 3, 12 ), true );
break;
case sprmCRgLid0_80:

View File

@ -250,10 +250,6 @@ public:
{
pFile->WriteFile((BYTE*)m_pMetaHeader, m_lMetaHeaderSize);
}
if (NULL != m_pMetaFile)
{
pFile->WriteFile((BYTE*)m_pMetaFile, m_lMetaFileSize);
}
}
};

View File

@ -71,26 +71,26 @@ namespace DocFileFormat
{
struct __BITMAPINFOHEADER
{
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
_UINT32 biSize;
_INT32 biWidth;
_INT32 biHeight;
_UINT16 biPlanes;
_UINT16 biBitCount;
_UINT32 biCompression;
_UINT32 biSizeImage;
_INT32 biXPelsPerMeter;
_INT32 biYPelsPerMeter;
_UINT32 biClrUsed;
_UINT32 biClrImportant;
};
struct __BITMAPCOREHEADER
{
DWORD bcSize; /* used to get to color table */
WORD bcWidth;
WORD bcHeight;
WORD bcPlanes;
WORD bcBitCount;
_UINT32 bcSize; /* used to get to color table */
_UINT16 bcWidth;
_UINT16 bcHeight;
_UINT16 bcPlanes;
_UINT16 bcBitCount;
};
Global::BlipType GetFormatPict(unsigned char* data, int size)
{

View File

@ -37,29 +37,29 @@
namespace ImageHelper
{
struct __BITMAPINFOHEADER
{
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
};
struct __BITMAPINFOHEADER
{
_UINT32 biSize;
_INT32 biWidth;
_INT32 biHeight;
_UINT16 biPlanes;
_UINT16 biBitCount;
_UINT32 biCompression;
_UINT32 biSizeImage;
_INT32 biXPelsPerMeter;
_INT32 biYPelsPerMeter;
_UINT32 biClrUsed;
_UINT32 biClrImportant;
};
struct __BITMAPCOREHEADER
{
DWORD bcSize; /* used to get to color table */
WORD bcWidth;
WORD bcHeight;
WORD bcPlanes;
WORD bcBitCount;
};
struct __BITMAPCOREHEADER
{
_UINT32 bcSize; /* used to get to color table */
_UINT16 bcWidth;
_UINT16 bcHeight;
_UINT16 bcPlanes;
_UINT16 bcBitCount;
};
inline Global::_BlipType SaveImageToFileFromDIB(unsigned char* data, int size, const std::wstring& file_name)//without ext
{
@ -152,10 +152,10 @@ namespace ImageHelper
NSFile::CFileBinary file;
if (file.CreateFileW(file_name + L".bmp"))
{
WORD vtType = 0x4D42; file.WriteFile((BYTE*)&vtType, 2);
DWORD dwLen = biSizeImage; file.WriteFile((BYTE*)&dwLen, 4);
DWORD dwRes = 0; file.WriteFile((BYTE*)&dwRes, 4);
DWORD dwOffset = 2; file.WriteFile((BYTE*)&dwOffset, 4);
_UINT16 vtType = 0x4D42; file.WriteFile((BYTE*)&vtType, 2);
_UINT32 dwLen = biSizeImage; file.WriteFile((BYTE*)&dwLen, 4);
_UINT32 dwRes = 0; file.WriteFile((BYTE*)&dwRes, 4);
_UINT32 dwOffset = 2; file.WriteFile((BYTE*)&dwOffset, 4);
file.WriteFile((BYTE*)data, size);
file.CloseFile();

View File

@ -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
}

View File

@ -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());
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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:

View File

@ -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;

View File

@ -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)
{

View File

@ -41,7 +41,7 @@ class OOXReader
public:
RtfConvertationManager* m_convertationManager;
std::wstring m_sPath;
std::wstring m_sPath;
int m_nCurItap; //для определение вложенности таблицы

View File

@ -36,6 +36,9 @@
#include <boost/algorithm/string.hpp>
#ifndef RGB
#define RGB(r,g,b) ((_UINT32)(((BYTE)(r)|((_UINT16)((BYTE)(g))<<8))|(((_UINT32)(BYTE)(b))<<16)))
#endif
bool ParseStyle(RtfShape* pShape, SimpleTypes::Vml::CCssProperty* prop)
{
if (pShape == NULL) return false;
@ -249,7 +252,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 +331,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 +349,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 +843,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;
}

View File

@ -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);
};

View File

@ -125,20 +125,20 @@ std::wstring RtfChar::renderTextToXML( std::wstring sParam, bool bDelete )
if (bDelete == false)
{
sResult += L"<w:t xml:space= \"preserve\">";
sResult += XmlUtils::EncodeXmlString( m_sChars );
sResult += XmlUtils::EncodeXmlString( m_sChars, true );
sResult += L"</w:t>";
}
else
{
sResult += L"<w:delText>";
sResult += XmlUtils::EncodeXmlString( m_sChars );
sResult += XmlUtils::EncodeXmlString( m_sChars, true );
sResult += L"</w:delText>";
}
}
else if( L"Math" == sParam && !m_sChars.empty())
{
sResult += L"<m:t>";
sResult += XmlUtils::EncodeXmlString( m_sChars );
sResult += XmlUtils::EncodeXmlString( m_sChars, true );
sResult += L"</m:t>";
}
return sResult;
@ -210,7 +210,7 @@ std::wstring RtfChar::renderRtfText( std::wstring& sText, void* poDocument, int
while (sTextBack.length() < sText.length())
sTextBack += L"-";
for( int i = 0; i < sText.length() ; i++ )
for( size_t i = 0; i < sText.length() ; i++ )
{
bool bWriteUnicode = true;
@ -222,7 +222,7 @@ std::wstring RtfChar::renderRtfText( std::wstring& sText, void* poDocument, int
// -> sTempAnsiChars
std::string sTempAnsiChars = RtfUtility::convert_string(unicodeStr.begin()+i, unicodeStr.begin() + i + 1, nCodePage);
for( int k = 0; k < sTempAnsiChars.length(); k++ )
for( size_t k = 0; k < sTempAnsiChars.length(); k++ )
{
unsigned char nCharCode = sTempAnsiChars[k];
bWriteUnicode = false;

View File

@ -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 )

View File

@ -237,7 +237,7 @@ std::wstring RtfField::RenderToOOX(RenderParameter oRenderParameter)
if (m_pInsert->m_pTextItems)
{
sResult += XmlUtils::EncodeXmlString( m_pInsert->m_pTextItems->RenderToOOX(oNewParametr) );
sResult += XmlUtils::EncodeXmlString( m_pInsert->m_pTextItems->RenderToOOX(oNewParametr), true );
}
sResult += L"</w:instrText></w:r>";

View File

@ -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">";

View File

@ -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();
};

View File

@ -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;
}

View File

@ -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 = _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(">");
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">";
sResult += _T("<w:body>");
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>";
}
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);

View File

@ -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;
}
};

View File

@ -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";
}
}

View File

@ -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 )
return 0;
std::wstring strY = sValue.substr( nPos + 1, nPos2 - nPos - 1);
std::wstring strZ = sValue.substr( nPos2 + 1, nLen - nPos2 - 1 ) ;
{// only x, y position
std::wstring strY = sValue.substr( nPos + 1);
XmlUtils::replace_all(strY, L"@", L"");
XmlUtils::replace_all(strZ, L"@", L"");
m_nY = strY.empty() ? 0 : _wtoi(strY.c_str() );
return 0;
}
m_nY = strY.empty() ? 0 : _wtoi(strY.c_str() );
m_nZ = strZ.empty() ? 0 : _wtoi(strZ.c_str() );
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"");
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(",") );
std::wstring strX, strY;
if ( -1 == nPos )
return 0;
{
strX = sValue.substr( 0, nPos );
}
else
{
strX = sValue.substr( 0, nPos );
strY = sValue.substr( nPos + 1, nLen - nPos - 1 ) ;
}
std::wstring strX = sValue.substr( 0, nPos );
std::wstring 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;

View File

@ -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;
};

View File

@ -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;
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;
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 ");

View File

@ -1017,7 +1017,7 @@ namespace NSFile
size_t sz = 0;
if ( (0 == _wdupenv_s(&wsTempDir, &sz, L"TEMP")) && (wsFolder == NULL))
{
wsTemp = std::wstring(wsTempDir, sz);
wsTemp = std::wstring(wsTempDir, sz-1);
#else
char *wsTempDirA;
if ((wsTempDirA = getenv("TEMP")) && (wsFolder == NULL))

View File

@ -0,0 +1,92 @@
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef _BUILD_IGROBJECT_CROSSPLATFORM_H_
#define _BUILD_IGROBJECT_CROSSPLATFORM_H_
#include "Types.h"
#ifdef __APPLE__
#include <libkern/OSAtomic.h>
#endif
class IGrObject
{
protected:
#ifdef __APPLE__
volatile int32_t m_lRef;
#else
ULONG m_lRef;
#endif
public:
IGrObject()
{
m_lRef = 1;
}
virtual ~IGrObject()
{
}
#ifdef __APPLE__
virtual ULONG AddRef()
{
OSAtomicIncrement32(&m_lRef);
return (ULONG)m_lRef;
}
virtual ULONG Release()
{
int32_t ret = OSAtomicDecrement32(&m_lRef);
if (0 == m_lRef)
delete this;
return (ULONG)ret;
}
#else
virtual ULONG AddRef()
{
++m_lRef;
return m_lRef;
}
virtual ULONG Release()
{
ULONG ret = --m_lRef;
if (0 == m_lRef)
delete this;
return ret;
}
#endif
};
#endif //_BUILD_IGROBJECT_CROSSPLATFORM_H_

View File

@ -96,7 +96,7 @@ namespace NSFontConverter
// BE = big endian
int GetS8 (int nPos, bool *pbSuccess)
{
*pbSuccess = true;
//*pbSuccess = true;
if ( nPos < 0 || nPos >= m_nLen )
{
@ -111,7 +111,7 @@ namespace NSFontConverter
int GetU8 (int nPos, bool *pbSuccess)
{
*pbSuccess = true;
//*pbSuccess = true;
if ( nPos < 0 || nPos >= m_nLen )
{
*pbSuccess = false;
@ -122,7 +122,7 @@ namespace NSFontConverter
int GetS16BE (int nPos, bool *pbSuccess)
{
*pbSuccess = true;
//*pbSuccess = true;
if ( nPos < 0 || nPos + 1 >= m_nLen )
{
@ -138,7 +138,7 @@ namespace NSFontConverter
int GetU16BE (int nPos, bool *pbSuccess)
{
*pbSuccess = true;
//*pbSuccess = true;
if ( nPos < 0 || nPos + 1 >= m_nLen)
{
@ -152,7 +152,7 @@ namespace NSFontConverter
int GetS32BE (int nPos, bool *pbSuccess)
{
*pbSuccess = true;
//*pbSuccess = true;
if ( nPos < 0 || nPos + 3 >= m_nLen )
{
@ -171,7 +171,7 @@ namespace NSFontConverter
unsigned int GetU32BE (int nPos, bool *pbSuccess)
{
*pbSuccess = true;
//*pbSuccess = true;
if ( nPos < 0 || nPos + 3 >= m_nLen )
{
@ -186,7 +186,7 @@ namespace NSFontConverter
}
unsigned int GetU32LE (int nPos, bool *pbSuccess)
{
*pbSuccess = true;
//*pbSuccess = true;
if ( nPos < 0 || nPos + 3 >= m_nLen )
{
@ -201,7 +201,7 @@ namespace NSFontConverter
}
unsigned int GetUVarBE(int nPos, int nSize, bool *pbSuccess)
{
*pbSuccess = true;
//*pbSuccess = true;
if ( nPos < 0 || nPos + nSize > m_nLen )
{

View File

@ -477,7 +477,7 @@ namespace Aggplus
Status CGraphics::CombineClip(CGraphicsPath* pPath, agg::sbool_op_e op)
{
Aggplus::CMatrix m;
return InternalClip(pPath, m_bIntegerGrid ? &m : &m_oFullTransform, op);
return InternalClip(pPath, (m_bIntegerGrid || pPath->m_pTransform != NULL) ? &m : &m_oFullTransform, op);
}
Status CGraphics::InternalClip(CGraphicsPath* pPath, CMatrix* pTransform, agg::sbool_op_e op)

View File

@ -38,6 +38,7 @@ namespace Aggplus
CGraphicsPath::CGraphicsPath() : ISimpleGraphicsPath()
{
m_bEvenOdd = false;
m_pTransform = NULL;
}
CGraphicsPath::~CGraphicsPath()
@ -406,14 +407,28 @@ namespace Aggplus
bool CGraphicsPath::_MoveTo(double x, double y)
{
if (NULL != m_pTransform)
{
m_pTransform->TransformPoint(x, y);
}
return (Ok == MoveTo(x, y));
}
bool CGraphicsPath::_LineTo(double x, double y)
{
if (NULL != m_pTransform)
{
m_pTransform->TransformPoint(x, y);
}
return (Ok == LineTo(x, y));
}
bool CGraphicsPath::_CurveTo(double x1, double y1, double x2, double y2, double x3, double y3)
{
if (NULL != m_pTransform)
{
m_pTransform->TransformPoint(x1, y1);
m_pTransform->TransformPoint(x2, y2);
m_pTransform->TransformPoint(x3, y3);
}
return (Ok == CurveTo(x1, y1, x2, y2, x3, y3));
}
bool CGraphicsPath::_Close()

View File

@ -113,6 +113,8 @@ public:
bool m_bEvenOdd;
bool m_bIsMoveTo;
CMatrix* m_pTransform;
public:
int EllipseArc(double fX, double fY, double fXRad, double fYRad, double fAngle1, double fAngle2, INT bClockDirection);

View File

@ -33,6 +33,21 @@
#include <algorithm>
#include "../raster/Metafile/MetaFile.h"
#if 0
static void LOGGING(char* buffer, ...)
{
FILE* f = fopen("path_to_log.txt", "a+");
va_list args;
va_start(args, buffer);
vfprintf(f, buffer, args);
fprintf(f, "\n");
fclose(f);
va_end(args);
}
#endif
////////////////////////////////////////////////////////////////////////////////
Aggplus::CBrush* CGraphicsRenderer::CreateBrush(NSStructures::CBrush* pBrush)
@ -687,7 +702,7 @@ HRESULT CGraphicsRenderer::CommandDrawTextEx(const std::wstring& bsUnicodeText,
HRESULT CGraphicsRenderer::BeginCommand(const DWORD& lType)
{
m_lCurrentCommandType = lType;
switch (lType)
{
case c_nPageType:
@ -1114,6 +1129,19 @@ HRESULT CGraphicsRenderer::CommandString(const LONG& lType, const std::wstring&
return S_OK;
}
HRESULT CGraphicsRenderer::StartConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = true;
m_pPath->m_pTransform = m_pRenderer->GetFullTransform();
return S_OK;
}
HRESULT CGraphicsRenderer::EndConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = false;
m_pPath->m_pTransform = NULL;
return S_OK;
}
// common
void CGraphicsRenderer::_SetFont()
{

View File

@ -247,6 +247,9 @@ public:
virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand);
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand);
virtual HRESULT StartConvertCoordsToIdentity();
virtual HRESULT EndConvertCoordsToIdentity();
void put_GlobalAlphaEnabled(const bool& bEnabled, const double& dVal);
inline void put_IntegerGrid(const bool& bEnabled)
{

View File

@ -34,65 +34,10 @@
#pragma once
#include "../common/Types.h"
#include "../common/IGrObject.h"
#include "Matrix.h"
#include <string>
#ifdef __APPLE__
#include <libkern/OSAtomic.h>
#endif
class IGrObject
{
protected:
#ifdef __APPLE__
volatile int32_t m_lRef;
#else
ULONG m_lRef;
#endif
public:
IGrObject()
{
m_lRef = 1;
}
virtual ~IGrObject()
{
}
#ifdef __APPLE__
virtual ULONG AddRef()
{
OSAtomicIncrement32(&m_lRef);
return (ULONG)m_lRef;
}
virtual ULONG Release()
{
int32_t ret = OSAtomicDecrement32(&m_lRef);
if (0 == m_lRef)
delete this;
return (ULONG)ret;
}
#else
virtual ULONG AddRef()
{
++m_lRef;
return m_lRef;
}
virtual ULONG Release()
{
ULONG ret = --m_lRef;
if (0 == m_lRef)
delete this;
return ret;
}
#endif
};
// тип в DrawPath
const long c_nStroke = 0x0001;
const long c_nWindingFillMode = 0x0100;
@ -177,6 +122,15 @@ const long c_nHtmlRendrerer3 = 0x0011;
// IRenderer
class IRenderer : public IGrObject
{
public:
bool m_bUseTransformCoordsToIdentity;
public:
IRenderer()
{
m_bUseTransformCoordsToIdentity = false;
}
public:
// тип рендерера-----------------------------------------------------------------------------
virtual HRESULT get_Type(LONG* lType) = 0;
@ -332,7 +286,18 @@ public:
// additiaonal params ----------------------------------------------------------------------
virtual HRESULT CommandLong(const LONG& lType, const LONG& lCommand) = 0;
virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand) = 0;
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand) = 0;
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand) = 0;
virtual HRESULT StartConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = true;
return S_OK;
}
virtual HRESULT EndConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = false;
return S_OK;
}
};
#define PROPERTY_RENDERER(NameBase, Name, Type) \

View File

@ -173,6 +173,9 @@ namespace NSHtmlRenderer
virtual HRESULT CommandDouble(const LONG& lType, const double& dCommand);
virtual HRESULT CommandString(const LONG& lType, const std::wstring& sCommand);
virtual HRESULT StartConvertCoordsToIdentity();
virtual HRESULT EndConvertCoordsToIdentity();
// owner params ----------------------------------------------------------------------
virtual HRESULT get_Mode(LONG *plMode);
virtual HRESULT put_Mode(LONG lMode);

View File

@ -1206,6 +1206,21 @@ namespace NSHtmlRenderer
return S_OK;
}
HRESULT CASCHTMLRenderer3::StartConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = true;
if (m_pInternal->m_bIsGraphicsDumperMode)
return m_pInternal->m_oDumper.StartConvertCoordsToIdentity();
return S_OK;
}
HRESULT CASCHTMLRenderer3::EndConvertCoordsToIdentity()
{
m_bUseTransformCoordsToIdentity = false;
if (m_pInternal->m_bIsGraphicsDumperMode)
return m_pInternal->m_oDumper.EndConvertCoordsToIdentity();
return S_OK;
}
// owner params ----------------------------------------------------------------------
HRESULT CASCHTMLRenderer3::get_Mode(LONG *plMode)
{
@ -1261,6 +1276,10 @@ namespace NSHtmlRenderer
m_pInternal->m_bPageOpened = false;
m_pInternal->m_pFontManager = m_pInternal->m_oApplicationFonts.GenerateFontManager();
CFontsCache* pGraphicsFontCache = new CFontsCache();
pGraphicsFontCache->SetStreams(m_pInternal->m_oApplicationFonts.GetStreams());
pGraphicsFontCache->SetCacheSize(16);
m_pInternal->m_pFontManager->SetOwnerCache(pGraphicsFontCache);
m_pInternal->m_oFont.SetDefaultParams();
m_pInternal->m_oInstalledFont.SetDefaultParams();

View File

@ -811,6 +811,19 @@ namespace NSHtmlRenderer
return m_pRenderer->put_ClipMode(lMode);
return S_OK;
}
inline virtual HRESULT StartConvertCoordsToIdentity()
{
if (m_pRenderer)
m_pRenderer->StartConvertCoordsToIdentity();
return S_OK;
}
inline virtual HRESULT EndConvertCoordsToIdentity()
{
if (m_pRenderer)
m_pRenderer->EndConvertCoordsToIdentity();
return S_OK;
}
};

View File

@ -46,7 +46,7 @@
//#define ONLINE_WORD_TO_PDF
//#define TO_PDF
#define TO_HTML_RENDERER
#define ONLY_TEXT
//#define ONLY_TEXT
int main(int argc, char *argv[])
{
@ -97,8 +97,18 @@ int main(int argc, char *argv[])
//std::wstring sFile = L"D:\\bankomats.xps";
//std::wstring sFile = L"\\\\kirillov8\\_Office\\DJVU\\Основы разработки приложений на платформе Microsoft .NET Framework. Учебный курс Microsoft экзамен 70-536.djvu";
//std::wstring sFile = L"D:\\TESTFILES\\Алгоритмы - построение и анализ.djvu";
std::wstring sFile = L"D:\\TESTFILES\\PDF 1-7 (756p).pdf";
#ifndef WIN32
std::wstring sFile = L"/home/oleg/GIT/ddd/ZfAvCwDsowJALpClgmE_/source/ZfAvCwDsowJALpClgmE_.pdf";
#else
//std::wstring sFile = L"D:\\ddd\\ZfAvCwDsowJALpClgmE_\\source\\ZfAvCwDsowJALpClgmE_.pdf";
std::wstring sFile = L"D:\\ddd\\knopk5_0.pdf";
#endif
#ifdef WIN32
std::wstring sDst = L"D:\\test\\Document";
#else
std::wstring sDst = L"/home/oleg/test/Document";
#endif
//std::wstring sFile = L"/home/oleg/activex/Android intro(2p).pdf";
//std::wstring sFile = L"/home/oleg/activex/Pi(1p).pdf";
@ -114,6 +124,8 @@ int main(int argc, char *argv[])
pReader->SetTempDirectory(sDst);
pReader->LoadFromFile(sFile);
//pReader->ConvertToRaster(0, L"D:\\111.png", 4);
#ifdef TO_HTML_RENDERER
NSHtmlRenderer::CASCHTMLRenderer3 oRenderer;
#ifdef ONLY_TEXT

View File

@ -25,42 +25,20 @@ INCLUDEPATH += \
TEMPLATE = app
############### destination path ###############
DESTINATION_SDK_PATH = $$PWD/../../build/lib
CORE_ROOT_DIR = $$PWD/../..
PWD_ROOT_DIR = $$PWD
include($$CORE_ROOT_DIR/Common/base.pri)
# WINDOWS
win32:contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_64/DEBUG
} else {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_64
}
}
win32:!contains(QMAKE_TARGET.arch, x86_64):{
CONFIG(debug, debug|release) {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_32/DEBUG
} else {
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/win_32
}
}
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lgraphics
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lOfficeUtils
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lHtmlRenderer
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPdfReader
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lDjVuFile
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lXpsFile
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lPdfWriter
LIBS += -L$$CORE_BUILDS_LIBRARIES_PATH -lUnicodeConverter
linux-g++:contains(QMAKE_HOST.arch, x86_64):{
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/linux_64
}
linux-g++:!contains(QMAKE_HOST.arch, x86_64):{
DESTINATION_SDK_PATH = $$DESTINATION_SDK_PATH/linux_32
}
LIBS += -L$$DESTINATION_SDK_PATH -lgraphics
LIBS += -L$$DESTINATION_SDK_PATH -lOfficeUtils
LIBS += -L$$DESTINATION_SDK_PATH -lHtmlRenderer
LIBS += -L$$DESTINATION_SDK_PATH -lPdfReader
LIBS += -L$$DESTINATION_SDK_PATH -lDjVuFile
LIBS += -L$$DESTINATION_SDK_PATH -lXpsFile
LIBS += -L$$DESTINATION_SDK_PATH -lPdfWriter
LIBS += -L$$DESTINATION_SDK_PATH -lUnicodeConverter
LIBS += -L$$PWD/../../build/bin/icu/win_64
include($$PWD/../../Common/3dParty/icu/icu.pri)
win32 {
LIBS += -lgdi32 \

View File

@ -1646,7 +1646,7 @@ namespace PdfReader
MemUtilsFree(punRefSegs);
if (m_pCurStream->GetPos() - unDataStartPos != unSegLength)
if (unSegLength != 0xFFFFFFFF && m_pCurStream->GetPos() - unDataStartPos != unSegLength)
m_pCurStream->SetPos(unDataStartPos + unSegLength);
}

File diff suppressed because it is too large Load Diff

View File

@ -240,6 +240,7 @@ namespace PdfReader
virtual void ClipToStrokePath(GrState *pGState);
virtual void ClipToPath(GrState *pGState, GrPath *pPath, double *pMatrix, bool bEO);
//----- Вывод текста
virtual void EndTextObject(GrState *pGState);
virtual void BeginStringOperator(GrState *pGState);
virtual void EndStringOperator(GrState *pGState);
virtual void DrawString(GrState *pGState, StringExt *seString);

View File

@ -803,7 +803,7 @@ namespace PdfReader
if (!bLimited || unStart + unLength > m_unStart + m_unLength)
{
unNewLength = m_unStart + m_unLength - unStart;
if (unStart >= m_unLength)
if (unStart >= m_unStart + m_unLength)
unNewLength = 0;
}
else

View File

@ -7,7 +7,7 @@
QT -= core
QT -= gui
VERSION = 2.0.3.432
VERSION = 2.0.3.434
DEFINES += INTVER=$$VERSION
TARGET = x2t