mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-11 10:26:00 +08:00
Compare commits
105 Commits
core/devel
...
core/devel
| Author | SHA1 | Date | |
|---|---|---|---|
| 9a9ba4cc62 | |||
| 5b4c6363bb | |||
| 2026d064ef | |||
| 42257ca447 | |||
| 6f2fdcd971 | |||
| 9b4b7a26fd | |||
| 4d688b3922 | |||
| be8d427e26 | |||
| 7e0749ddda | |||
| 9f2324d208 | |||
| 6e258b85d7 | |||
| 24e55018a0 | |||
| 2352ae5d88 | |||
| 2cba43e6f3 | |||
| abcf8d0246 | |||
| c18b955467 | |||
| 7896b75001 | |||
| 7d188b2213 | |||
| 79ead484cc | |||
| be65f18a0e | |||
| 60f61109a1 | |||
| 4201bcecc6 | |||
| 7b7bfbc5dd | |||
| a70255e500 | |||
| 7e9dede9b3 | |||
| 9b7ad03465 | |||
| 3162bb0bfe | |||
| ec95648c43 | |||
| 72ac11ac07 | |||
| f70ea2b74f | |||
| db834666ba | |||
| 6ed0e13178 | |||
| 446e519110 | |||
| fb1fc01963 | |||
| 4651ae1bbb | |||
| 18606e23c6 | |||
| ed6d070d1f | |||
| f00cecbcaf | |||
| c9aee26fd6 | |||
| 32d3c0e65c | |||
| 33aeef2c02 | |||
| 7c97941acc | |||
| 01a4cd2289 | |||
| 202b58fb10 | |||
| b221150797 | |||
| 2084587e9a | |||
| 8332c28ac2 | |||
| 435a11d75c | |||
| 9a5329f5d6 | |||
| 8eecbf5fa5 | |||
| 9e1773df65 | |||
| 39e4140524 | |||
| bd90de857e | |||
| 57f2ec7b96 | |||
| 634098a6fa | |||
| bdbf208f6c | |||
| a652f5d73f | |||
| 1602843aa6 | |||
| cdb7fb8ea6 | |||
| 6387e9fa69 | |||
| 4e8097c93d | |||
| 65254b57b2 | |||
| 95899e23a8 | |||
| 5c8757d346 | |||
| 234e19d68a | |||
| 62145b7204 | |||
| 8bcc6d1501 | |||
| 09ef46f333 | |||
| 1839350526 | |||
| d7587e91b1 | |||
| 7b0a342cf9 | |||
| 3d01b0782e | |||
| fecfcfa7d2 | |||
| 29b5fa513a | |||
| f9a19badbf | |||
| d2630ea73c | |||
| a4a58c4782 | |||
| 29a3d80071 | |||
| 598bb419c0 | |||
| 087da9d2ce | |||
| c505aced48 | |||
| 959d5e5fcd | |||
| 8ee0cf4b2c | |||
| 426342074e | |||
| d2c092fe62 | |||
| a336917338 | |||
| 8925ddeee5 | |||
| 84824631b2 | |||
| dc3ecb1fc0 | |||
| 266cef8c49 | |||
| a5e821cd21 | |||
| cb5d92334e | |||
| f6dbc6b9f0 | |||
| c2c6430495 | |||
| 9ecf5b7834 | |||
| 1d003863dd | |||
| 774561bd00 | |||
| d356a305b9 | |||
| 95c472c15c | |||
| 2dbec241f7 | |||
| f3c66cab50 | |||
| 11e6fc3e06 | |||
| cdf8c0a11b | |||
| 51c77c3a85 | |||
| 4326a7d258 |
@ -35,11 +35,23 @@
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
struct _guides
|
||||
{
|
||||
unsigned char type;
|
||||
|
||||
unsigned char param_type1;
|
||||
unsigned char param_type2;
|
||||
unsigned char param_type3;
|
||||
|
||||
WORD param1;
|
||||
WORD param2;
|
||||
WORD param3;
|
||||
};
|
||||
class PathParser
|
||||
{
|
||||
public:
|
||||
|
||||
PathParser (const unsigned char* pSegmentInfo, unsigned int pSegmentInfoSize, const unsigned char* pVertices, unsigned int pVerticesSize)
|
||||
PathParser (const unsigned char* pSegmentInfo, unsigned int pSegmentInfoSize, const unsigned char* pVertices, unsigned int pVerticesSize, std::vector<_guides> & guides)
|
||||
{
|
||||
if ((pSegmentInfo != NULL) && (pSegmentInfoSize > 0))
|
||||
{
|
||||
@ -105,31 +117,40 @@ namespace DocFileFormat
|
||||
unsigned short nElemsAlloc = FormatUtils::BytesToUInt16(pVertices, 2, pVerticesSize);
|
||||
unsigned short cb = FormatUtils::BytesToUInt16(pVertices, 4, pVerticesSize);
|
||||
|
||||
if (0xfff0 == cb)
|
||||
{
|
||||
cb = 4;
|
||||
|
||||
for (unsigned short i = 0; i < nElems; ++i)
|
||||
for (unsigned short i = 0; i < nElems; ++i)
|
||||
{
|
||||
POINT point;
|
||||
if (0xfff0 == cb)
|
||||
{
|
||||
POINT point;
|
||||
|
||||
cb = 4;
|
||||
point.x = FormatUtils::BytesToInt16(pVertices + 6, (i * cb), pVerticesSize);
|
||||
point.y = FormatUtils::BytesToInt16(pVertices + 6, (i * cb) + (cb / 2), pVerticesSize);
|
||||
|
||||
m_arPoints.push_back(point);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned short i = 0; i < nElems; ++i)
|
||||
else
|
||||
{
|
||||
POINT point;
|
||||
|
||||
point.x = FormatUtils::BytesToInt32(pVertices + 6, (i * cb), pVerticesSize);
|
||||
point.y = FormatUtils::BytesToInt32(pVertices + 6, (i * cb) + (cb / 2), pVerticesSize);
|
||||
|
||||
m_arPoints.push_back(point);
|
||||
}
|
||||
|
||||
LONG lMinF = (LONG)0x80000000;
|
||||
if (lMinF <= point.x)
|
||||
{
|
||||
int index = (DWORD)point.x - 0x80000000;
|
||||
if (index >= 0 && index < guides.size())
|
||||
{
|
||||
point.x = guides[index].param3;
|
||||
}
|
||||
}
|
||||
if (lMinF <= point.y)
|
||||
{
|
||||
int index = (DWORD)point.y - 0x80000000;
|
||||
if (index >= 0 && index < guides.size())
|
||||
{
|
||||
point.y = guides[index].param3;
|
||||
}
|
||||
}
|
||||
|
||||
m_arPoints.push_back(point);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,21 +106,20 @@ namespace DocFileFormat
|
||||
return new ShapeContainer( _reader, bodySize, typeCode, version, instance );
|
||||
}
|
||||
|
||||
std::list<OptionEntry> ExtractOptions() const
|
||||
std::vector<OptionEntryPtr> ExtractOptions() const
|
||||
{
|
||||
std::list<OptionEntry> ret;
|
||||
std::vector<OptionEntryPtr> ret;
|
||||
|
||||
//build the list of all option entries of this shape
|
||||
for ( std::vector<Record*>::const_iterator iter = this->Children.begin(); iter != this->Children.end(); iter++ )
|
||||
{
|
||||
ShapeOptions* opt = dynamic_cast<ShapeOptions*>( *iter );
|
||||
|
||||
if ( opt != NULL )
|
||||
if ( opt == NULL ) continue;
|
||||
|
||||
for ( size_t i = 0; i < opt->Options.size(); i++)
|
||||
{
|
||||
for ( std::vector<OptionEntry>::iterator oeIter = opt->Options.begin(); oeIter != opt->Options.end(); oeIter++ )
|
||||
{
|
||||
ret.push_back( *oeIter );
|
||||
}
|
||||
ret.push_back( opt->Options[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -568,18 +568,19 @@ namespace DocFileFormat
|
||||
|
||||
struct OptionEntry
|
||||
{
|
||||
OptionEntry() : pid(PropertyId_left), fBid(false), fComplex(false), op(0), opComplex(NULL)
|
||||
OptionEntry() : pid(PropertyId_left), fBid(false), fComplex(false), op(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
PropertyId pid;
|
||||
bool fBid;
|
||||
bool fComplex;
|
||||
unsigned int op;
|
||||
unsigned char* opComplex;
|
||||
std::shared_ptr<unsigned char> opComplex;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<OptionEntry> OptionEntryPtr;
|
||||
|
||||
class ShapeOptions: public Record
|
||||
{
|
||||
public:
|
||||
@ -587,8 +588,8 @@ namespace DocFileFormat
|
||||
static const unsigned short TYPE_CODE_0xF121 = 0xF121;
|
||||
static const unsigned short TYPE_CODE_0xF122 = 0xF122;
|
||||
|
||||
std::vector<OptionEntry> Options;
|
||||
std::map<PropertyId, OptionEntry> OptionsByID;
|
||||
std::vector<OptionEntryPtr> Options;
|
||||
std::map<PropertyId, OptionEntryPtr> OptionsByID;
|
||||
|
||||
ShapeOptions() : Record()
|
||||
{
|
||||
@ -596,8 +597,8 @@ namespace DocFileFormat
|
||||
|
||||
virtual ~ShapeOptions()
|
||||
{
|
||||
for (std::vector<OptionEntry>::iterator iter = Options.begin(); iter != Options.end(); ++iter)
|
||||
RELEASEARRAYOBJECTS( iter->opComplex );
|
||||
//for (std::vector<OptionEntry>::iterator iter = Options.begin(); iter != Options.end(); ++iter)
|
||||
// RELEASEARRAYOBJECTS( iter->opComplex );
|
||||
}
|
||||
|
||||
ShapeOptions (IBinaryReader* _reader, unsigned int size, unsigned int typeCode, unsigned int version, unsigned int instance) : Record (_reader, size, typeCode, version, instance)
|
||||
@ -606,16 +607,16 @@ namespace DocFileFormat
|
||||
|
||||
//instance is the count of properties stored in this record
|
||||
|
||||
OptionEntry entry;
|
||||
//parse the flags and the simple values
|
||||
for (unsigned int i = 0; i < instance; ++i)
|
||||
{
|
||||
OptionEntryPtr entry = std::shared_ptr<OptionEntry>(new OptionEntry());
|
||||
unsigned short flag = Reader->ReadUInt16();
|
||||
|
||||
entry.pid = (PropertyId)FormatUtils::BitmaskToInt (flag, 0x3FFF);
|
||||
entry.fBid = FormatUtils::BitmaskToBool (flag, 0x4000);
|
||||
entry.fComplex = FormatUtils::BitmaskToBool (flag, 0x8000);
|
||||
entry.op = Reader->ReadUInt32();
|
||||
entry->pid = (PropertyId)FormatUtils::BitmaskToInt (flag, 0x3FFF);
|
||||
entry->fBid = FormatUtils::BitmaskToBool (flag, 0x4000);
|
||||
entry->fComplex = FormatUtils::BitmaskToBool (flag, 0x8000);
|
||||
entry->op = Reader->ReadUInt32();
|
||||
|
||||
Options.push_back( entry );
|
||||
}
|
||||
@ -625,21 +626,12 @@ namespace DocFileFormat
|
||||
//of the OptionEntry arry, sorted by pid
|
||||
for (unsigned int i = 0; i < instance; ++i)
|
||||
{
|
||||
if (Options[i].fComplex)
|
||||
{
|
||||
int read_size = (int)Options[i].op + 6 ; //????
|
||||
//todooo !!!! проверить все остальные !! тут размер в зависимости от типа Complex!!!
|
||||
switch(Options[i].pid)
|
||||
{
|
||||
case PropertyId::gtextUNICODE:
|
||||
case PropertyId::gtextFont:
|
||||
read_size = (int)Options[i].op;
|
||||
break;
|
||||
}
|
||||
Options[i].opComplex = Reader->ReadBytes( read_size, true );
|
||||
if (Options[i]->fComplex && Options[i]->op > 0)
|
||||
{
|
||||
Options[i]->opComplex = std::shared_ptr<unsigned char>(Reader->ReadBytes( Options[i]->op, true ));
|
||||
}
|
||||
|
||||
OptionsByID.insert(std::pair<PropertyId, OptionEntry>(Options[i].pid, Options[i]));
|
||||
OptionsByID.insert(std::make_pair(Options[i]->pid, Options[i]));
|
||||
}
|
||||
|
||||
Reader->Seek(( pos + size ), 0/*STREAM_SEEK_SET*/);
|
||||
|
||||
@ -136,14 +136,18 @@ namespace DocFileFormat
|
||||
}
|
||||
return btWin32;
|
||||
}
|
||||
bool ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString)
|
||||
bool VMLPictureMapping::ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString)
|
||||
{
|
||||
newXmlString.clear();
|
||||
std::wstring sTempXmlFile = NSDirectory::CreateTempFileWithUniqueName(
|
||||
NSDirectory::GetTempPath(), L"emb");
|
||||
|
||||
sTempXmlFile += L".xml";
|
||||
|
||||
std::wstring sTempFolder = m_ctx->_doc->m_sTempFolder;
|
||||
if (sTempFolder.empty())
|
||||
{
|
||||
sTempFolder = NSFile::CFileBinary::GetTempPath();
|
||||
}
|
||||
|
||||
std::wstring sTempXmlFile = NSDirectory::CreateTempFileWithUniqueName(sTempFolder, L"emb");
|
||||
|
||||
NSFile::CFileBinary file;
|
||||
file.CreateFileW(sTempXmlFile);
|
||||
file.WriteFile((BYTE*)xmlString.c_str(), xmlString.size());
|
||||
@ -186,6 +190,7 @@ namespace DocFileFormat
|
||||
if (res) break;
|
||||
}
|
||||
}
|
||||
NSFile::CFileBinary::Remove(sTempXmlFile);
|
||||
return res;
|
||||
}
|
||||
//---------------------------------------------------------------
|
||||
@ -236,7 +241,7 @@ namespace DocFileFormat
|
||||
std::wstring strHeight = FormatUtils::DoubleToWideString( height.ToPoints() );
|
||||
std::wstring strStyle;
|
||||
|
||||
std::list<OptionEntry> options;
|
||||
std::vector<OptionEntryPtr> options;
|
||||
|
||||
PictureFrameType type;
|
||||
if ((pict->shapeContainer || pict->blipStoreEntry) && pict->shapeContainer->Children.size() > 0)
|
||||
@ -277,9 +282,9 @@ namespace DocFileFormat
|
||||
}
|
||||
//todooo oбъединить с shape_mapping
|
||||
|
||||
std::list<OptionEntry>::iterator end = options.end();
|
||||
for (std::list<OptionEntry>::iterator iter = options.begin(); iter != end; ++iter)
|
||||
for (size_t i = 0; i < options.size(); i++)
|
||||
{
|
||||
OptionEntryPtr & iter = options[i];
|
||||
switch ( iter->pid )
|
||||
{
|
||||
case wzEquationXML:
|
||||
@ -287,7 +292,7 @@ namespace DocFileFormat
|
||||
m_isEquation = true;
|
||||
m_isEmbedded = true;
|
||||
|
||||
m_embeddedData = std::string((char*)iter->opComplex, iter->op);
|
||||
m_embeddedData = std::string((char*)iter->opComplex.get(), iter->op);
|
||||
|
||||
if (ParseEmbeddedEquation( m_embeddedData, m_equationXml))
|
||||
{
|
||||
@ -297,8 +302,13 @@ namespace DocFileFormat
|
||||
case metroBlob:
|
||||
{
|
||||
//встроенная неведомая хуйня
|
||||
m_isEmbedded = true;
|
||||
m_embeddedData = std::string((char*)iter->opComplex, iter->op);
|
||||
m_isEmbedded = true;
|
||||
m_embeddedData = std::string((char*)iter->opComplex.get(), iter->op);
|
||||
|
||||
//if (ParseEmbeddedBlob( m_embeddedData, m_blobXml)) // todoooo
|
||||
//{
|
||||
// m_isEmbedded = false;
|
||||
//}
|
||||
}break;
|
||||
//BORDERS
|
||||
case borderBottomColor:
|
||||
|
||||
@ -46,7 +46,6 @@ namespace DocFileFormat
|
||||
{
|
||||
class OleObject;
|
||||
|
||||
bool ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString );
|
||||
|
||||
class VMLPictureMapping: public PropertiesMapping, public IMapping
|
||||
{
|
||||
@ -58,6 +57,7 @@ namespace DocFileFormat
|
||||
/// Writes a border element
|
||||
void writePictureBorder (const std::wstring & name, const BorderCode* brc);
|
||||
void appendStyleProperty( std::wstring* b, const std::wstring& propName, const std::wstring& propValue ) const;
|
||||
bool ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString );
|
||||
protected:
|
||||
/// Copies the picture from the binary stream to the zip archive
|
||||
/// and creates the relationships for the image.
|
||||
|
||||
@ -143,8 +143,9 @@ namespace DocFileFormat
|
||||
ShapeContainer* groupShape = static_cast<ShapeContainer*>(container->Children[0]);
|
||||
GroupShapeRecord* gsr = static_cast<GroupShapeRecord*>(groupShape->Children[0]);
|
||||
Shape* shape = static_cast<Shape*>(groupShape->Children[1]);
|
||||
std::list<OptionEntry> options = groupShape->ExtractOptions();
|
||||
ChildAnchor* anchor = groupShape->FirstChildWithType<ChildAnchor>();
|
||||
|
||||
ChildAnchor* anchor = groupShape->FirstChildWithType<ChildAnchor>();
|
||||
std::vector<OptionEntryPtr> options = groupShape->ExtractOptions();
|
||||
|
||||
m_shapeId = GetShapeID(shape);
|
||||
|
||||
@ -155,14 +156,13 @@ namespace DocFileFormat
|
||||
m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString(gsr->rcgBounds.size.cx) + L"," + FormatUtils::IntToWideString(gsr->rcgBounds.size.cy)));
|
||||
|
||||
// Write wrap coords
|
||||
std::list<OptionEntry>::const_iterator end = options.end();
|
||||
for (std::list<OptionEntry>::const_iterator iter = options.begin(); iter != end; ++iter)
|
||||
for (size_t i = 0; i < options.size(); i++)
|
||||
{
|
||||
switch (iter->pid)
|
||||
switch (options[i]->pid)
|
||||
{
|
||||
case pWrapPolygonVertices:
|
||||
case pWrapPolygonVertices:
|
||||
{
|
||||
std::wstring wrapCoords = getWrapCoords(*iter);
|
||||
std::wstring wrapCoords = GetWrapCoords(options[i]);
|
||||
if (wrapCoords.length())
|
||||
m_pXmlWriter->WriteAttribute(L"wrapcoords", wrapCoords);
|
||||
}
|
||||
@ -226,9 +226,9 @@ namespace DocFileFormat
|
||||
bool freeform = true;
|
||||
std::wstring sShapeId;
|
||||
|
||||
std::list<OptionEntry> options = pContainer->ExtractOptions();
|
||||
ChildAnchor* pAnchor = pContainer->FirstChildWithType<ChildAnchor>();
|
||||
ClientAnchor* clientAnchor = pContainer->FirstChildWithType<ClientAnchor>();
|
||||
std::vector<OptionEntryPtr> options = pContainer->ExtractOptions();
|
||||
ChildAnchor* pAnchor = pContainer->FirstChildWithType<ChildAnchor>();
|
||||
ClientAnchor* clientAnchor = pContainer->FirstChildWithType<ClientAnchor>();
|
||||
|
||||
WriteBeginShapeNode (pShape);
|
||||
|
||||
@ -294,13 +294,17 @@ namespace DocFileFormat
|
||||
|
||||
std::wstring sTextboxStyle;
|
||||
|
||||
std::wstring adjValues[8];
|
||||
ShadowStyleBooleanProperties shadowBoolean(0);
|
||||
std::vector<std::wstring> arrInscribe;
|
||||
|
||||
OptionEntryPtr opSegmentInfo;
|
||||
OptionEntryPtr opVerticles;
|
||||
OptionEntryPtr opInscribe;
|
||||
OptionEntryPtr opConnectAngles;
|
||||
OptionEntryPtr opConnectLocs;
|
||||
|
||||
std::list<OptionEntry>::const_iterator end = options.end();
|
||||
for (std::list<OptionEntry>::const_iterator iter = options.begin(); iter != end; ++iter)
|
||||
for (size_t i = 0; i < options.size(); i++)
|
||||
{
|
||||
OptionEntryPtr & iter = options[i];
|
||||
switch (iter->pid)
|
||||
{
|
||||
//BOOLEANS
|
||||
@ -335,19 +339,16 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case protectionBooleans:
|
||||
{
|
||||
ProtectionBooleanProperties booleans(iter->op);
|
||||
}
|
||||
break;
|
||||
|
||||
case diagramBooleans:
|
||||
{
|
||||
DiagramBooleanProperties booleans(iter->op);
|
||||
}
|
||||
break;
|
||||
|
||||
case groupShapeBooleans:
|
||||
{
|
||||
GroupShapeBooleanProperties booleans(iter->op);
|
||||
@ -357,56 +358,80 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
// GEOMETRY
|
||||
|
||||
// GEOMETRY
|
||||
case shapePath :
|
||||
{
|
||||
bHavePath = true;
|
||||
}break;
|
||||
case pVertices:
|
||||
{
|
||||
opVerticles = iter;
|
||||
}break;
|
||||
case pSegmentInfo:
|
||||
{
|
||||
opSegmentInfo = iter;
|
||||
}break;
|
||||
case pGuides:
|
||||
{
|
||||
GetGuides(iter);
|
||||
}break;
|
||||
case pConnectionSites:
|
||||
{
|
||||
opConnectLocs = iter;
|
||||
}break;
|
||||
case pConnectionSitesDir:
|
||||
{
|
||||
opConnectAngles = iter;
|
||||
}break;
|
||||
case pInscribe:
|
||||
{
|
||||
opInscribe = iter;
|
||||
}break;
|
||||
case adjustValue:
|
||||
{
|
||||
adjValues[0] = FormatUtils::IntToWideString( (int)iter->op );
|
||||
nAdjValues = (std::max)(nAdjValues,1);
|
||||
m_nAdjValues[0] = (int)iter->op;
|
||||
nAdjValues = (std::max)(nAdjValues,1);
|
||||
}
|
||||
break;
|
||||
|
||||
case adjust2Value:
|
||||
{
|
||||
adjValues[1] = FormatUtils::IntToWideString( (int)iter->op );
|
||||
nAdjValues = (std::max)(nAdjValues,2);
|
||||
m_nAdjValues[1] = (int)iter->op;
|
||||
nAdjValues = (std::max)(nAdjValues, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case adjust3Value:
|
||||
{
|
||||
adjValues[2] = FormatUtils::IntToWideString( (int)iter->op );
|
||||
nAdjValues = (std::max)(nAdjValues,3);
|
||||
m_nAdjValues[2] = (int)iter->op;
|
||||
nAdjValues =(std::max)(nAdjValues, 3);
|
||||
}break;
|
||||
case adjust4Value:
|
||||
{
|
||||
adjValues[3] = FormatUtils::IntToWideString( (int)iter->op );
|
||||
nAdjValues = (std::max)(nAdjValues,4);
|
||||
m_nAdjValues[3] = (int)iter->op;
|
||||
nAdjValues = (std::max)(nAdjValues, 4);
|
||||
}break;
|
||||
case adjust5Value:
|
||||
{
|
||||
adjValues[4] = FormatUtils::IntToWideString( (int)iter->op );
|
||||
nAdjValues = (std::max)(nAdjValues,5);
|
||||
m_nAdjValues[4] = (int)iter->op;
|
||||
nAdjValues = (std::max)(nAdjValues, 5);
|
||||
}break;
|
||||
case adjust6Value:
|
||||
{
|
||||
adjValues[5] = FormatUtils::IntToWideString( (int)iter->op );
|
||||
nAdjValues = (std::max)(nAdjValues,6);
|
||||
m_nAdjValues[5] = (int)iter->op;
|
||||
nAdjValues = (std::max)(nAdjValues, 6);
|
||||
}break;
|
||||
case adjust7Value:
|
||||
{
|
||||
adjValues[6] = FormatUtils::IntToWideString( (int)iter->op );
|
||||
nAdjValues = (std::max)(nAdjValues,7);
|
||||
m_nAdjValues[6] = (int)iter->op;
|
||||
nAdjValues = (std::max)(nAdjValues, 7);
|
||||
}break;
|
||||
case adjust8Value:
|
||||
{
|
||||
adjValues[7] = FormatUtils::IntToWideString( (int)iter->op );
|
||||
nAdjValues = (std::max)(nAdjValues,8);
|
||||
m_nAdjValues[7] = (int)iter->op;
|
||||
nAdjValues = (std::max)(nAdjValues, 8);
|
||||
}break;
|
||||
case pWrapPolygonVertices:
|
||||
{
|
||||
std::wstring wrapCoords = getWrapCoords(*iter);
|
||||
std::wstring wrapCoords = GetWrapCoords(iter);
|
||||
|
||||
if (!wrapCoords.empty())
|
||||
{
|
||||
@ -421,13 +446,6 @@ namespace DocFileFormat
|
||||
{
|
||||
yCoord = iter->op;
|
||||
}break;
|
||||
case pGuides:
|
||||
{
|
||||
}break;
|
||||
case pInscribe:
|
||||
{
|
||||
arrInscribe = GetTextRectangles(*iter);
|
||||
}break;
|
||||
// OUTLINE
|
||||
case lineColor:
|
||||
{
|
||||
@ -497,7 +515,7 @@ namespace DocFileFormat
|
||||
}break;
|
||||
case fillShadeColors:
|
||||
{
|
||||
appendValueAttribute(&m_fill, L"colors", getFillColorString( iter->opComplex, iter->op ));
|
||||
appendValueAttribute(&m_fill, L"colors", getFillColorString( iter->opComplex.get(), iter->op ));
|
||||
}break;
|
||||
case fillFocus:
|
||||
{
|
||||
@ -602,7 +620,7 @@ namespace DocFileFormat
|
||||
case pibName:
|
||||
{
|
||||
std::wstring name;
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>(&name, iter->opComplex, iter->op, ENCODING_UTF16);
|
||||
FormatUtils::GetSTLCollectionFromBytes<std::wstring>(&name, iter->opComplex.get(), iter->op, ENCODING_UTF16);
|
||||
if (!name.empty())
|
||||
appendValueAttribute(&m_imagedata, L"o:title", FormatUtils::XmlEncode(name));
|
||||
}break;
|
||||
@ -676,10 +694,10 @@ namespace DocFileFormat
|
||||
hasTextbox = true;
|
||||
nLTxID = (((iter->op) >> 16) & 0xFFFF);
|
||||
}break;
|
||||
case dxTextLeft: {ndxTextLeft = (int)iter->op;break;}
|
||||
case dyTextTop: {ndyTextTop = (int)iter->op;break;}
|
||||
case dxTextRight: {ndxTextRight = (int)iter->op;break;}
|
||||
case dyTextBottom: {ndyTextBottom = (int)iter->op;break;}
|
||||
case dxTextLeft: {ndxTextLeft = (int)iter->op; break;}
|
||||
case dyTextTop: {ndyTextTop = (int)iter->op; break;}
|
||||
case dxTextRight: {ndxTextRight = (int)iter->op; break;}
|
||||
case dyTextBottom: {ndyTextBottom = (int)iter->op; break;}
|
||||
case txflTextFlow:
|
||||
{
|
||||
switch(iter->op)
|
||||
@ -700,7 +718,7 @@ namespace DocFileFormat
|
||||
// Word Art
|
||||
case gtextUNICODE:
|
||||
{
|
||||
std::wstring text = NSStringExt::CConverter::GetUnicodeFromUTF16((unsigned short*)iter->opComplex, (iter->op)/2);
|
||||
std::wstring text = NSStringExt::CConverter::GetUnicodeFromUTF16((unsigned short*)iter->opComplex.get(), (iter->op)/2);
|
||||
|
||||
text = FormatUtils::XmlEncode(text);
|
||||
|
||||
@ -713,7 +731,7 @@ namespace DocFileFormat
|
||||
}break;
|
||||
case gtextFont:
|
||||
{
|
||||
std::wstring font = NSStringExt::CConverter::GetUnicodeFromUTF16((unsigned short*)iter->opComplex, (iter->op)/2);
|
||||
std::wstring font = NSStringExt::CConverter::GetUnicodeFromUTF16((unsigned short*)iter->opComplex.get(), (iter->op)/2);
|
||||
int i = font.size();
|
||||
while (i > 0)
|
||||
{
|
||||
@ -764,31 +782,31 @@ namespace DocFileFormat
|
||||
appendStyleProperty(&m_textPathStyle, L"font-weight", L"bold");
|
||||
}
|
||||
}break;
|
||||
// PATH
|
||||
case shapePath :
|
||||
{
|
||||
bHavePath = true;
|
||||
|
||||
std::wstring path = ParsePath(options);
|
||||
|
||||
if (false == path.empty())
|
||||
m_pXmlWriter->WriteAttribute (L"path", path);
|
||||
}break;
|
||||
default:
|
||||
default:
|
||||
{
|
||||
int val = iter->op;
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
if (false == bHavePath) // фигура может быть задана только наборами вершин и индексов
|
||||
if (opVerticles && opSegmentInfo)
|
||||
{
|
||||
std::wstring path = ParsePath(options);
|
||||
const unsigned char* pVP = opVerticles->opComplex.get();
|
||||
unsigned int nVP = opVerticles->op;
|
||||
const unsigned char* pSI = opSegmentInfo->opComplex.get();
|
||||
unsigned int nSI = opSegmentInfo->op;
|
||||
|
||||
PathParser oParser (pSI, nSI, pVP, nVP, m_arrGuides);
|
||||
std::wstring path = oParser.GetVmlPath();
|
||||
|
||||
if (false == path.empty())
|
||||
m_pXmlWriter->WriteAttribute (L"path", path);
|
||||
}
|
||||
|
||||
if (freeform && (xCoord == 0 || yCoord == 0 ))
|
||||
{
|
||||
xCoord = 21600;
|
||||
yCoord = 21600;
|
||||
}
|
||||
if ( !filled )
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"filled", L"f" );
|
||||
@ -804,10 +822,10 @@ namespace DocFileFormat
|
||||
m_pXmlWriter->WriteAttribute(L"o:allowincell", L"f");
|
||||
}
|
||||
|
||||
if ( ( xCoord > 0 ) && ( yCoord > 0 ) )
|
||||
if ( xCoord > 0 && yCoord > 0 )
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"coordsize", ( FormatUtils::IntToWideString( xCoord ) + L"," + FormatUtils::IntToWideString( yCoord ) ));
|
||||
}
|
||||
}
|
||||
|
||||
int nCode = 0;
|
||||
if (pShape->GetShapeType())
|
||||
@ -819,17 +837,17 @@ namespace DocFileFormat
|
||||
{
|
||||
if (nAdjValues)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute(L"arcsize", adjValues[0]);
|
||||
m_pXmlWriter->WriteAttribute(L"arcsize", m_nAdjValues[0]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nAdjValues)
|
||||
if (nAdjValues > 0)
|
||||
{
|
||||
std::wstring adjTag = adjValues[0];
|
||||
std::wstring adjTag = std::to_wstring(m_nAdjValues[0]);
|
||||
|
||||
for (int i = 1; i < nAdjValues; ++i)
|
||||
adjTag += std::wstring(L",") + adjValues[i];
|
||||
adjTag += L"," + std::to_wstring(m_nAdjValues[i]);
|
||||
|
||||
m_pXmlWriter->WriteAttribute(L"adj", adjTag);
|
||||
}
|
||||
@ -982,10 +1000,24 @@ namespace DocFileFormat
|
||||
}
|
||||
if (freeform)
|
||||
{
|
||||
if (arrInscribe.size())
|
||||
if (opInscribe || opConnectAngles || opConnectLocs)
|
||||
{
|
||||
std::vector<std::wstring> arrInscribe = GetTextRectangles(opInscribe);
|
||||
std::wstring strConnectAngles = GetConnectAngles(opConnectAngles);
|
||||
std::wstring strConnectLocs = GetConnectLocs(opConnectLocs);
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin(L"v:path", true);
|
||||
m_pXmlWriter->WriteAttribute(L"textboxrect", arrInscribe[0]);
|
||||
if (!arrInscribe.empty())
|
||||
m_pXmlWriter->WriteAttribute(L"textboxrect", arrInscribe[0]);
|
||||
if (!strConnectAngles.empty() || !strConnectLocs.empty())
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute(L"o:connecttype", L"custom");
|
||||
if (!strConnectLocs.empty())
|
||||
m_pXmlWriter->WriteAttribute(L"o:connectlocs", strConnectLocs);
|
||||
if (!strConnectAngles.empty())
|
||||
m_pXmlWriter->WriteAttribute(L"o:connectangles", strConnectAngles);
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd(L"", true);
|
||||
}
|
||||
}
|
||||
@ -1182,11 +1214,13 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
/// Build the VML wrapcoords string for a given pWrapPolygonVertices
|
||||
std::wstring VMLShapeMapping::getWrapCoords(const OptionEntry& pWrapPolygonVertices) const
|
||||
std::wstring VMLShapeMapping::GetWrapCoords(const OptionEntryPtr& pWrapPolygonVertices) const
|
||||
{
|
||||
if (!pWrapPolygonVertices) return L"";
|
||||
|
||||
std::wstring coords;
|
||||
|
||||
MemoryStream oStream(pWrapPolygonVertices.opComplex, pWrapPolygonVertices.op);
|
||||
MemoryStream oStream(pWrapPolygonVertices->opComplex.get(), pWrapPolygonVertices->op);
|
||||
std::list<int> arrVertices;
|
||||
|
||||
unsigned short nElems = oStream.ReadUInt16();
|
||||
@ -1498,7 +1532,7 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
|
||||
void VMLShapeMapping::AppendOptionsToStyle (std::wstring* oStyle, const std::list<OptionEntry>& options, int zIndex) const
|
||||
void VMLShapeMapping::AppendOptionsToStyle (std::wstring* oStyle, const std::vector<OptionEntryPtr>& options, int zIndex) const
|
||||
{
|
||||
bool bRelH = false;
|
||||
bool bRelV = false;
|
||||
@ -1508,9 +1542,9 @@ namespace DocFileFormat
|
||||
|
||||
bool bZIndex = false;
|
||||
|
||||
std::list<OptionEntry>::const_iterator end = options.end();
|
||||
for (std::list<OptionEntry>::const_iterator iter = options.begin(); iter != end; ++iter)
|
||||
for (size_t i = 0; i < options.size(); i++)
|
||||
{
|
||||
const OptionEntryPtr & iter = options[i];
|
||||
switch (iter->pid)
|
||||
{
|
||||
// POSITIONING
|
||||
@ -1616,15 +1650,16 @@ namespace DocFileFormat
|
||||
}
|
||||
|
||||
//
|
||||
std::wstring VMLShapeMapping::buildStyle (const Shape* shape, const ChildAnchor* anchor, const std::list<OptionEntry>& options, int zIndex) const
|
||||
std::wstring VMLShapeMapping::buildStyle (const Shape* shape, const ChildAnchor* anchor, const std::vector<OptionEntryPtr>& options, int zIndex) const
|
||||
{
|
||||
std::wstring style;
|
||||
|
||||
// Check if some properties are set that cause the dimensions to be twisted
|
||||
bool twistDimensions = false;
|
||||
std::list<OptionEntry>::const_iterator end = options.end();
|
||||
for (std::list<OptionEntry>::const_iterator iter = options.begin(); iter != end; ++iter)
|
||||
|
||||
for (size_t i = 0; i < options.size(); i++)
|
||||
{
|
||||
const OptionEntryPtr & iter = options[i];
|
||||
|
||||
if (geometryTextBooleanProperties == iter->pid)
|
||||
{
|
||||
GeometryTextBooleanProperties props(iter->op);
|
||||
@ -1860,61 +1895,210 @@ namespace DocFileFormat
|
||||
|
||||
return wrapType;
|
||||
}
|
||||
|
||||
std::wstring VMLShapeMapping::ParsePath (const std::list<OptionEntry>& options) const
|
||||
std::wstring VMLShapeMapping::GetConnectAngles(const OptionEntryPtr& opAngles) const
|
||||
{
|
||||
const unsigned char* pVP = NULL;
|
||||
unsigned int nVP = 0;
|
||||
const unsigned char* pSI = NULL;
|
||||
unsigned int nSI = 0;
|
||||
if (!opAngles) return L"";
|
||||
if (!opAngles->opComplex) return L"";
|
||||
|
||||
std::list<OptionEntry>::const_iterator end = options.end();
|
||||
for (std::list<OptionEntry>::const_iterator iter = options.begin(); iter != end; ++iter)
|
||||
MemoryStream reader(opAngles->opComplex.get(), opAngles->op);
|
||||
|
||||
unsigned short nElems = reader.ReadUInt16();
|
||||
unsigned short nElemsAlloc = reader.ReadUInt16();
|
||||
unsigned short nElemSize = reader.ReadUInt16();
|
||||
|
||||
bool bTruncated = false;
|
||||
|
||||
if (0xFFF0 == nElemSize)
|
||||
{
|
||||
nElemSize = 4;
|
||||
bTruncated = true;
|
||||
}
|
||||
|
||||
long dwSize = nElems * nElemSize;
|
||||
|
||||
if (opAngles->op - 6 != (dwSize))
|
||||
{
|
||||
bool b = false;
|
||||
}
|
||||
if (nElemSize < 1) return L"";
|
||||
|
||||
int count = dwSize / nElemSize;
|
||||
|
||||
std::wstring angles;
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
if (iter->pid == pVertices)
|
||||
{
|
||||
pVP = iter->opComplex;
|
||||
nVP = iter->op;
|
||||
}
|
||||
|
||||
if (iter->pid == pSegmentInfo)
|
||||
{
|
||||
pSI = iter->opComplex;
|
||||
nSI = iter->op;
|
||||
}
|
||||
DWORD v = reader.ReadUInt32();
|
||||
double val = (double)((WORD)(v >> 16) + ((WORD)(v) / 65536.0));
|
||||
angles += std::to_wstring((int)val) + (i < (count - 1) ? L"," : L"");
|
||||
}
|
||||
return angles;
|
||||
}
|
||||
int VMLShapeMapping::UpdateFromGuides(const int val) const
|
||||
{
|
||||
int new_val = val;
|
||||
LONG lMinF = (LONG)0x80000000;
|
||||
if (lMinF <= val)
|
||||
{
|
||||
int index = (DWORD)val - 0x80000000;
|
||||
|
||||
if (index >= 0 && index < m_arrGuides.size())
|
||||
{
|
||||
new_val = m_arrGuides[index].param3;
|
||||
}
|
||||
|
||||
PathParser oParser (pSI, nSI, pVP, nVP);
|
||||
return oParser.GetVmlPath();
|
||||
}
|
||||
return new_val;
|
||||
}
|
||||
void VMLShapeMapping::GetGuides( const OptionEntryPtr& opGuides )
|
||||
{
|
||||
if (!opGuides) return;
|
||||
if (!opGuides->opComplex) return;
|
||||
|
||||
MemoryStream reader(opGuides->opComplex.get(), opGuides->op);
|
||||
|
||||
unsigned short nElems = reader.ReadUInt16();
|
||||
unsigned short nElemsAlloc = reader.ReadUInt16();
|
||||
unsigned short nElemSize = reader.ReadUInt16();
|
||||
|
||||
bool bTruncated = false;
|
||||
|
||||
if (0xFFF0 == nElemSize)
|
||||
{
|
||||
nElemSize = 4;
|
||||
bTruncated = true;
|
||||
}
|
||||
long dwSize = nElems * nElemSize;
|
||||
|
||||
if (opGuides->op - 6 != (dwSize))
|
||||
{
|
||||
bool b = false;
|
||||
}
|
||||
int count = dwSize / nElemSize; //1x (int or short)
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
_guides g;
|
||||
WORD flags = reader.ReadUInt16();
|
||||
|
||||
g.type = flags & 0x1FFF;
|
||||
|
||||
g.param_type1 = (unsigned char)(flags & 0x04);
|
||||
g.param_type2 = (unsigned char)(flags & 0x02);
|
||||
g.param_type3 = (unsigned char)(flags & 0x01);
|
||||
|
||||
g.param1 = reader.ReadUInt16();
|
||||
g.param2 = reader.ReadUInt16();
|
||||
g.param3 = reader.ReadUInt16();
|
||||
|
||||
m_arrGuides.push_back(g);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
std::vector<std::wstring> VMLShapeMapping::GetTextRectangles(const OptionEntry& inscribe) const
|
||||
std::wstring VMLShapeMapping::GetConnectLocs( const OptionEntryPtr& opLocs ) const
|
||||
{
|
||||
MemoryStream reader(inscribe.opComplex, inscribe.op + 6);
|
||||
if (!opLocs) return L"";
|
||||
if (!opLocs->opComplex) return L"";
|
||||
|
||||
unsigned short elems = reader.ReadUInt16();
|
||||
unsigned short allocElems = reader.ReadUInt16();
|
||||
unsigned short cb = reader.ReadUInt16();
|
||||
|
||||
MemoryStream reader(opLocs->opComplex.get(), opLocs->op);
|
||||
|
||||
unsigned short nElems = reader.ReadUInt16();
|
||||
unsigned short nElemsAlloc = reader.ReadUInt16();
|
||||
unsigned short nElemSize = reader.ReadUInt16();
|
||||
|
||||
bool bTruncated = false;
|
||||
|
||||
if (0xFFF0 == nElemSize)
|
||||
{
|
||||
nElemSize = 4;
|
||||
bTruncated = true;
|
||||
}
|
||||
|
||||
long dwSize = nElems * nElemSize;
|
||||
|
||||
if (opLocs->op - 6 != (dwSize))
|
||||
{
|
||||
bool b = false;
|
||||
}
|
||||
int count = dwSize / nElemSize; //2x (int or short)
|
||||
|
||||
std::wstring locs;
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
POINT pt;
|
||||
|
||||
if (bTruncated)
|
||||
{
|
||||
pt.x = reader.ReadInt16();
|
||||
pt.y = reader.ReadInt16();
|
||||
}
|
||||
else
|
||||
{
|
||||
pt.x = reader.ReadInt32();
|
||||
pt.y = reader.ReadInt32();
|
||||
}
|
||||
|
||||
pt.x = UpdateFromGuides(pt.x);
|
||||
pt.y = UpdateFromGuides(pt.y);
|
||||
|
||||
locs += std::to_wstring(pt.x) + L"," + std::to_wstring(pt.y) + (i < (count - 1) ? L";" : L"");
|
||||
}
|
||||
|
||||
return locs;
|
||||
}
|
||||
|
||||
std::vector<std::wstring> VMLShapeMapping::GetTextRectangles( const OptionEntryPtr& opInscribe ) const
|
||||
{
|
||||
std::vector<std::wstring> rectangles;
|
||||
|
||||
if (!opInscribe) return rectangles;
|
||||
if (!opInscribe->opComplex) return rectangles;
|
||||
|
||||
if (16 != cb) return rectangles; // TODO: доделать
|
||||
MemoryStream reader(opInscribe->opComplex.get(), opInscribe->op);
|
||||
|
||||
int count = (inscribe.op) / 16;
|
||||
unsigned short nElems = reader.ReadUInt16();
|
||||
unsigned short nElemsAlloc = reader.ReadUInt16();
|
||||
unsigned short nElemSize = reader.ReadUInt16();
|
||||
|
||||
bool bTruncated = false;
|
||||
|
||||
if (0xFFF0 == nElemSize)
|
||||
{
|
||||
nElemSize = 4;
|
||||
bTruncated = true;
|
||||
}
|
||||
|
||||
long dwSize = nElems * nElemSize;
|
||||
|
||||
if (opInscribe->op - 6 != (dwSize))
|
||||
{
|
||||
bool b = false;
|
||||
}
|
||||
int count = dwSize / nElemSize; //4x (int or short)
|
||||
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
RECT rc;
|
||||
|
||||
rc.top = reader.ReadInt32();
|
||||
rc.left = reader.ReadInt32();
|
||||
rc.right = reader.ReadInt32();
|
||||
rc.bottom = reader.ReadInt32();
|
||||
if (bTruncated)
|
||||
{
|
||||
rc.top = reader.ReadInt16();
|
||||
rc.left = reader.ReadInt16();
|
||||
rc.right = reader.ReadInt16();
|
||||
rc.bottom = reader.ReadInt16();
|
||||
}
|
||||
else
|
||||
{
|
||||
rc.top = reader.ReadInt32();
|
||||
rc.left = reader.ReadInt32();
|
||||
rc.right = reader.ReadInt32();
|
||||
rc.bottom = reader.ReadInt32();
|
||||
}
|
||||
rc.top = UpdateFromGuides(rc.top);
|
||||
rc.left = UpdateFromGuides(rc.left);
|
||||
rc.right = UpdateFromGuides(rc.right);
|
||||
rc.bottom = UpdateFromGuides(rc.bottom);
|
||||
|
||||
std::wstringstream sstream;
|
||||
sstream << boost::wformat(L"%d,%d,%d,%d") % rc.top % rc.left % rc.right % rc.bottom;
|
||||
rectangles.push_back(sstream.str());
|
||||
rectangles.push_back( std::to_wstring(rc.top) + L"," + std::to_wstring(rc.left) + L"," +
|
||||
std::to_wstring(rc.right) + L"," + std::to_wstring(rc.bottom));
|
||||
}
|
||||
|
||||
return rectangles;
|
||||
|
||||
@ -77,17 +77,10 @@ namespace DocFileFormat
|
||||
|
||||
void WritePrimitiveProps(DrawingPrimitive * primitive, bool root);
|
||||
|
||||
// Converts a group of shapes
|
||||
void WriteGroup(const GroupContainer* pContainer);
|
||||
// Converts a single shape
|
||||
void WriteShape (const ShapeContainer* pContainer);
|
||||
|
||||
/// Generates a string id for the given shape
|
||||
std::wstring GenShapeId(const Shape* pShape) const;
|
||||
/// Build the VML wrapcoords string for a given pWrapPolygonVertices
|
||||
std::wstring getWrapCoords( const OptionEntry& pWrapPolygonVertices ) const;
|
||||
/// Copies the picture from the binary stream to the zip archive
|
||||
/// and creates the relationships for the image.
|
||||
bool copyPicture( const BlipStoreEntry* bse );
|
||||
std::wstring GetTargetExt( Global::BlipType _type ) const;
|
||||
|
||||
@ -98,21 +91,22 @@ namespace DocFileFormat
|
||||
|
||||
std::wstring getTextboxAnchor( unsigned int anchor ) const;
|
||||
|
||||
void AppendOptionsToStyle( std::wstring* style, const std::list<OptionEntry>& options, int zIndex ) const;
|
||||
std::wstring buildStyle ( const Shape* shape, const ChildAnchor* anchor, const std::vector<OptionEntryPtr>& options, int zIndex ) const;
|
||||
void AppendOptionsToStyle ( std::wstring* style, const std::vector<OptionEntryPtr>& options, int zIndex ) const;
|
||||
|
||||
std::wstring buildStyle ( const Shape* shape, const ChildAnchor* anchor, const std::list<OptionEntry>& options, int zIndex ) const;
|
||||
int UpdateFromGuides(const int val) const;
|
||||
|
||||
std::wstring getLineStyle ( unsigned int p ) const;
|
||||
std::wstring getArrowStyle ( unsigned int op ) const;
|
||||
std::wstring getArrowLength ( unsigned int op ) const;
|
||||
std::wstring getArrowWidth ( unsigned int op ) const;
|
||||
std::wstring getFillMethod ( unsigned int p ) const;
|
||||
std::wstring getFillColorString( const unsigned char* p, unsigned int size ) const;
|
||||
/// Returns the OpenXML fill type of a fill effect
|
||||
|
||||
std::wstring getFillType ( unsigned int p ) const;
|
||||
std::wstring getShadowType ( unsigned int p ) const;
|
||||
/// Returns the OpenXML wrap type of the shape
|
||||
|
||||
std::wstring getWrapType (const Spa* pSpa) const;
|
||||
std::wstring ParsePath (const std::list<OptionEntry>& options) const;
|
||||
|
||||
void WriteBeginShapeNode (const Shape* pShape);
|
||||
void WriteEndShapeNode (const Shape* pShape);
|
||||
@ -121,9 +115,15 @@ namespace DocFileFormat
|
||||
std::wstring GetLineFrom (const ChildAnchor* pAnchor) const;
|
||||
std::wstring GetLineTo (const ChildAnchor* pAnchor) const;
|
||||
|
||||
std::vector<std::wstring> GetTextRectangles(const OptionEntry& inscribe) const;
|
||||
std::wstring GetWrapCoords ( const OptionEntryPtr& pOpt ) const;
|
||||
std::vector<std::wstring> GetTextRectangles ( const OptionEntryPtr& pOpt ) const;
|
||||
std::wstring GetConnectAngles ( const OptionEntryPtr& pOpt ) const;
|
||||
std::wstring GetConnectLocs ( const OptionEntryPtr& pOpt ) const;
|
||||
void GetGuides ( const OptionEntryPtr& pOpt );
|
||||
|
||||
private:
|
||||
int m_nAdjValues[8];
|
||||
std::vector<_guides> m_arrGuides;
|
||||
|
||||
bool m_isInlineShape;
|
||||
Spa* m_pSpa;
|
||||
IMapping* m_pCaller;
|
||||
|
||||
@ -86,6 +86,7 @@ namespace DocFileFormat
|
||||
friend class Table;
|
||||
friend class TableRow;
|
||||
friend class VMLShapeMapping;
|
||||
friend class VMLPictureMapping;
|
||||
friend class OpenXmlPackage;
|
||||
friend class TextboxMapping;
|
||||
|
||||
|
||||
@ -45,13 +45,13 @@ namespace Writers
|
||||
int index;
|
||||
};
|
||||
std::vector<_chartElem> m_aCharts;
|
||||
int nChartCount;
|
||||
public:
|
||||
std::wstring m_sDir;
|
||||
int nEmbeddedCount;
|
||||
|
||||
ChartWriter(std::wstring sDir) : m_sDir(sDir)
|
||||
{
|
||||
nChartCount = 0;
|
||||
nEmbeddedCount = 1000;
|
||||
}
|
||||
~ChartWriter()
|
||||
{
|
||||
@ -80,30 +80,20 @@ namespace Writers
|
||||
}
|
||||
return true;
|
||||
}
|
||||
void AddChart(std::wstring& content, std::wstring& sRelsName, std::wstring& sFileName, int& index)
|
||||
void AddChart(std::wstring& content, std::wstring& sRelsName, std::wstring& sFileName, int index)
|
||||
{
|
||||
_chartElem oChartElem;
|
||||
|
||||
oChartElem.content = content;
|
||||
oChartElem.index = nChartCount + 1;
|
||||
nChartCount++;
|
||||
oChartElem.index = index;
|
||||
|
||||
oChartElem.filename = L"chart" + std::to_wstring(oChartElem.index) + L".xml";
|
||||
|
||||
sRelsName = L"charts/" + oChartElem.filename;
|
||||
sFileName = oChartElem.filename;
|
||||
index = oChartElem.index;
|
||||
|
||||
m_aCharts.push_back(oChartElem);
|
||||
}
|
||||
int getChartCount()
|
||||
{
|
||||
return nChartCount;
|
||||
}
|
||||
void setChartCount(int val)
|
||||
{
|
||||
nChartCount = val;
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif // #ifndef CHART_WRITER
|
||||
|
||||
@ -61,6 +61,26 @@ enum ETblStyleOverrideType
|
||||
tblstyleoverridetypeSwCell = 11,
|
||||
tblstyleoverridetypeWholeTable = 12
|
||||
};
|
||||
class SdtWraper
|
||||
{
|
||||
public:
|
||||
|
||||
OOX::Logic::CSdt m_oSdt;
|
||||
rPr* m_oEndPr;
|
||||
rPr* m_oRPr;
|
||||
int m_nType;
|
||||
SdtWraper(int nType)
|
||||
{
|
||||
m_nType = nType;
|
||||
m_oEndPr = NULL;
|
||||
m_oRPr = NULL;
|
||||
}
|
||||
~SdtWraper()
|
||||
{
|
||||
RELEASEOBJECT(m_oEndPr)
|
||||
RELEASEOBJECT(m_oRPr)
|
||||
}
|
||||
};
|
||||
|
||||
#define READ1_DEF(stLen, fReadFunction, arg, res) {\
|
||||
res = c_oSerConstants::ReadOk;\
|
||||
@ -3635,6 +3655,11 @@ public:
|
||||
//сбрасываем Shd
|
||||
oBinary_tblPrReader.m_sCurTableShd.clear();
|
||||
}
|
||||
else if(c_oSerParType::Sdt == type)
|
||||
{
|
||||
SdtWraper oSdt(0);
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdt, this, &oSdt);
|
||||
}
|
||||
else if ( c_oSerParType::sectPr == type )
|
||||
{
|
||||
SectPr oSectPr;
|
||||
@ -3746,6 +3771,11 @@ public:
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadDelIns, this, &oTrackRevision);
|
||||
oTrackRevision.Write(&GetRunStringWriter(), _T("w:del"));
|
||||
}
|
||||
else if(c_oSerParType::Sdt == type)
|
||||
{
|
||||
SdtWraper oSdt(1);
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdt, this, &oSdt);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -6292,15 +6322,11 @@ public:
|
||||
std::wstring sDrawingProperty = oCDrawingProperty.Write();
|
||||
if(false == sDrawingProperty.empty())
|
||||
{
|
||||
m_oFileWriter.m_pDrawingConverter->SetDocumentChartsCount(m_oFileWriter.m_oChartWriter.getChartCount());
|
||||
|
||||
long nCurPos = m_oBufferedStream.GetPos();
|
||||
std::wstring sDrawingXml;
|
||||
m_oFileWriter.m_pDrawingConverter->SaveObjectEx(oCDrawingProperty.DataPos, oCDrawingProperty.DataLength, sDrawingProperty, XMLWRITER_DOC_TYPE_DOCX, sDrawingXml);
|
||||
m_oBufferedStream.Seek(nCurPos);
|
||||
|
||||
m_oFileWriter.m_oChartWriter.setChartCount(m_oFileWriter.m_pDrawingConverter->GetDocumentChartsCount());
|
||||
|
||||
if( false == sDrawingXml.empty())
|
||||
{
|
||||
GetRunStringWriter().WriteString(sDrawingXml);
|
||||
@ -6416,6 +6442,11 @@ public:
|
||||
res = Read1(length, &Binary_DocumentTableReader::Read_Row, this, poResult);
|
||||
pCStringWriter->WriteString(std::wstring(_T("</w:tr>")));
|
||||
}
|
||||
else if(c_oSerDocTableType::Sdt == type)
|
||||
{
|
||||
SdtWraper oSdt(2);
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdt, this, &oSdt);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -6448,6 +6479,11 @@ public:
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadCell, this, poResult);
|
||||
pCStringWriter->WriteString(std::wstring(_T("</w:tc>")));
|
||||
}
|
||||
else if(c_oSerDocTableType::Sdt == type)
|
||||
{
|
||||
SdtWraper oSdt(3);
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdt, this, &oSdt);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -6606,8 +6642,11 @@ public:
|
||||
OOX::Spreadsheet::CChartSpace* pChartSpace = new OOX::Spreadsheet::CChartSpace();
|
||||
oBinaryChartReader.ReadCT_ChartSpace(length, &pChartSpace->m_oChartSpace);
|
||||
|
||||
//save xlsx
|
||||
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(m_oFileWriter.m_oChartWriter.getChartCount() + 1) + L".xlsx";
|
||||
//save xlsx
|
||||
_INT32 nChartCount = m_oFileWriter.m_pDrawingConverter->GetDocumentChartsCount();
|
||||
_INT32 nChartIndex = nChartCount + 1;
|
||||
m_oFileWriter.m_pDrawingConverter->SetDocumentChartsCount(nChartCount + 1);
|
||||
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring(nChartIndex) + L".xlsx";
|
||||
std::wstring sXlsxPath = pathChartsWorksheetDir.GetPath() + FILE_SEPARATOR_STR + sXlsxFilename;
|
||||
BinXlsxRW::CXlsxSerializer oXlsxSerializer;
|
||||
oXlsxSerializer.writeChartXlsx(sXlsxPath, *pChartSpace);
|
||||
@ -6632,7 +6671,6 @@ public:
|
||||
|
||||
std::wstring sFilename;
|
||||
std::wstring sRelsName;
|
||||
int nChartIndex;
|
||||
std::wstring sContent = sw.GetData();
|
||||
|
||||
m_oFileWriter.m_oChartWriter.AddChart(sContent, sRelsName, sFilename, nChartIndex);
|
||||
@ -6826,8 +6864,7 @@ public:
|
||||
std::wstring strDstEmbeddedTemp = strDstEmbedded + FILE_SEPARATOR_STR + L"Temp";
|
||||
NSDirectory::CreateDirectory(strDstEmbeddedTemp);
|
||||
|
||||
int id = m_oFileWriter.m_oChartWriter.getChartCount();
|
||||
m_oFileWriter.m_oChartWriter.setChartCount(id + 1);
|
||||
int id = m_oFileWriter.m_oChartWriter.nEmbeddedCount++;
|
||||
|
||||
std::wstring sXlsxFilename = L"Microsoft_Excel_Worksheet" + std::to_wstring( id + 1) + L".xlsx";
|
||||
BinXlsxRW::SaveParams oSaveParams(m_oFileWriter.m_sThemePath, m_oFileWriter.m_pDrawingConverter->GetContentTypes());//???
|
||||
@ -7150,6 +7187,309 @@ public:
|
||||
{
|
||||
return oBinary_pPrReader.Read_SecPr(type, length, poResult);
|
||||
}
|
||||
int ReadSdt(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = 0;
|
||||
SdtWraper* pSdt = static_cast<SdtWraper*>(poResult);
|
||||
if (c_oSerSdt::Pr == type)
|
||||
{
|
||||
pSdt->m_oSdt.m_oSdtPr.Init();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdtPr, this, pSdt);
|
||||
}
|
||||
else if (c_oSerSdt::EndPr == type)
|
||||
{
|
||||
pSdt->m_oEndPr = new rPr(m_oFontTableWriter.m_mapFonts);
|
||||
res = oBinary_rPrReader.Read(length, pSdt->m_oEndPr);
|
||||
}
|
||||
else if (c_oSerSdt::Content == type)
|
||||
{
|
||||
m_oDocumentWriter.m_oContent.WriteString(L"<w:sdt>");
|
||||
if ( pSdt->m_oSdt.m_oSdtPr.IsInit() )
|
||||
{
|
||||
m_oDocumentWriter.m_oContent.WriteString(pSdt->m_oSdt.m_oSdtPr->toXMLStart());
|
||||
if (NULL != pSdt->m_oRPr)
|
||||
{
|
||||
pSdt->m_oRPr->Write(&m_oDocumentWriter.m_oContent);
|
||||
}
|
||||
m_oDocumentWriter.m_oContent.WriteString(pSdt->m_oSdt.m_oSdtPr->toXMLEnd());
|
||||
}
|
||||
if (NULL != pSdt->m_oEndPr)
|
||||
{
|
||||
m_oDocumentWriter.m_oContent.WriteString(L"<w:sdtEndPr>");
|
||||
pSdt->m_oEndPr->Write(&m_oDocumentWriter.m_oContent);
|
||||
m_oDocumentWriter.m_oContent.WriteString(L"</w:sdtEndPr>");
|
||||
}
|
||||
|
||||
m_oDocumentWriter.m_oContent.WriteString(L"<w:sdtContent>");
|
||||
switch(pSdt->m_nType)
|
||||
{
|
||||
case 0:
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadDocumentContent, this, this);
|
||||
break;
|
||||
case 1:
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadParagraphContent, this, this);
|
||||
break;
|
||||
case 2:
|
||||
res = Read1(length, &Binary_DocumentTableReader::Read_TableContent, this, &m_oDocumentWriter.m_oContent);
|
||||
break;
|
||||
case 3:
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadRowContent, this, &m_oDocumentWriter.m_oContent);
|
||||
break;
|
||||
}
|
||||
m_oDocumentWriter.m_oContent.WriteString(L"</w:sdtContent>");
|
||||
m_oDocumentWriter.m_oContent.WriteString(L"</w:sdt>");
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadSdtPr(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = 0;
|
||||
SdtWraper* pSdtWraper = static_cast<SdtWraper*>(poResult);
|
||||
OOX::Logic::CSdtPr* pSdtPr = pSdtWraper->m_oSdt.m_oSdtPr.GetPointer();
|
||||
if (c_oSerSdt::Type == type)
|
||||
{
|
||||
pSdtPr->m_eType = (OOX::Logic::ESdtType)m_oBufferedStream.GetUChar();
|
||||
}
|
||||
else if (c_oSerSdt::Alias == type)
|
||||
{
|
||||
pSdtPr->m_oAlias.Init();
|
||||
pSdtPr->m_oAlias->m_sVal.Init();
|
||||
pSdtPr->m_oAlias->m_sVal->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if (c_oSerSdt::ComboBox == type)
|
||||
{
|
||||
pSdtPr->m_oComboBox.Init();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdtComboBox, this, pSdtPr->m_oComboBox.GetPointer());
|
||||
}
|
||||
else if (c_oSerSdt::DataBinding == type)
|
||||
{
|
||||
pSdtPr->m_oDataBinding.Init();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdtPrDataBinding, this, pSdtPr->m_oDataBinding.GetPointer());
|
||||
}
|
||||
else if (c_oSerSdt::PrDate == type)
|
||||
{
|
||||
pSdtPr->m_oDate.Init();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdtPrDate, this, pSdtPr->m_oDate.GetPointer());
|
||||
}
|
||||
else if (c_oSerSdt::DocPartList == type)
|
||||
{
|
||||
pSdtPr->m_oDocPartList.Init();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadDocPartList, this, pSdtPr->m_oDocPartList.GetPointer());
|
||||
}
|
||||
else if (c_oSerSdt::DocPartObj == type)
|
||||
{
|
||||
pSdtPr->m_oDocPartObj.Init();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadDocPartList, this, pSdtPr->m_oDocPartObj.GetPointer());
|
||||
}
|
||||
else if (c_oSerSdt::DropDownList == type)
|
||||
{
|
||||
pSdtPr->m_oDropDownList.Init();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadDropDownList, this, pSdtPr->m_oDropDownList.GetPointer());
|
||||
}
|
||||
else if (c_oSerSdt::Id == type)
|
||||
{
|
||||
pSdtPr->m_oId.Init();
|
||||
pSdtPr->m_oId->m_oVal.Init();
|
||||
pSdtPr->m_oId->m_oVal->SetValue(m_oBufferedStream.GetULong());
|
||||
}
|
||||
else if (c_oSerSdt::Label == type)
|
||||
{
|
||||
pSdtPr->m_oLabel.Init();
|
||||
pSdtPr->m_oLabel->m_oVal.Init();
|
||||
pSdtPr->m_oLabel->m_oVal->SetValue(m_oBufferedStream.GetULong());
|
||||
}
|
||||
else if (c_oSerSdt::Lock == type)
|
||||
{
|
||||
pSdtPr->m_oLock.Init();
|
||||
pSdtPr->m_oLock->m_oVal.SetValue((SimpleTypes::ELock)m_oBufferedStream.GetUChar());
|
||||
}
|
||||
else if (c_oSerSdt::PlaceHolder == type)
|
||||
{
|
||||
pSdtPr->m_oPlaceHolder.Init();
|
||||
pSdtPr->m_oPlaceHolder->m_oDocPart.Init();
|
||||
pSdtPr->m_oPlaceHolder->m_oDocPart->m_sVal.Init();
|
||||
pSdtPr->m_oPlaceHolder->m_oDocPart->m_sVal->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if (c_oSerSdt::RPr == type)
|
||||
{
|
||||
pSdtWraper->m_oRPr = new rPr(m_oFontTableWriter.m_mapFonts);
|
||||
res = oBinary_rPrReader.Read(length, pSdtWraper->m_oRPr);
|
||||
}
|
||||
else if (c_oSerSdt::ShowingPlcHdr == type)
|
||||
{
|
||||
pSdtPr->m_oShowingPlcHdr.Init();
|
||||
pSdtPr->m_oShowingPlcHdr->m_oVal.FromBool(m_oBufferedStream.GetBool());
|
||||
}
|
||||
else if (c_oSerSdt::TabIndex == type)
|
||||
{
|
||||
pSdtPr->m_oTabIndex.Init();
|
||||
pSdtPr->m_oTabIndex->m_oVal.Init();
|
||||
pSdtPr->m_oTabIndex->m_oVal->SetValue(m_oBufferedStream.GetULong());
|
||||
}
|
||||
else if (c_oSerSdt::Tag == type)
|
||||
{
|
||||
pSdtPr->m_oTag.Init();
|
||||
pSdtPr->m_oTag->m_sVal.Init();
|
||||
pSdtPr->m_oTag->m_sVal->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if (c_oSerSdt::Temporary == type)
|
||||
{
|
||||
pSdtPr->m_oTemporary.Init();
|
||||
pSdtPr->m_oTemporary->m_oVal.FromBool(m_oBufferedStream.GetBool());
|
||||
}
|
||||
else if (c_oSerSdt::MultiLine == type)
|
||||
{
|
||||
pSdtPr->m_oText.Init();
|
||||
pSdtPr->m_oText->m_oMultiLine.Init();
|
||||
pSdtPr->m_oText->m_oMultiLine->FromBool(m_oBufferedStream.GetBool());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadSdtComboBox(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = 0;
|
||||
OOX::Logic::CSdtComboBox* pSdtComboBox = static_cast<OOX::Logic::CSdtComboBox*>(poResult);
|
||||
if (c_oSerSdt::LastValue == type)
|
||||
{
|
||||
pSdtComboBox->m_sLastValue.Init();
|
||||
pSdtComboBox->m_sLastValue->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if (c_oSerSdt::SdtListItem == type)
|
||||
{
|
||||
ComplexTypes::Word::CSdtListItem* pSdtListItem = new ComplexTypes::Word::CSdtListItem();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdtListItem, this, pSdtListItem);
|
||||
pSdtComboBox->m_arrListItem.push_back(pSdtListItem); }
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadSdtListItem(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = 0;
|
||||
ComplexTypes::Word::CSdtListItem* pSdtListItem = static_cast<ComplexTypes::Word::CSdtListItem*>(poResult);
|
||||
if (c_oSerSdt::DisplayText == type)
|
||||
{
|
||||
pSdtListItem->m_sDisplayText.Init();
|
||||
pSdtListItem->m_sDisplayText->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if (c_oSerSdt::Value == type)
|
||||
{
|
||||
pSdtListItem->m_sValue.Init();
|
||||
pSdtListItem->m_sValue->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadSdtPrDataBinding(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = 0;
|
||||
ComplexTypes::Word::CDataBinding* pDataBinding = static_cast<ComplexTypes::Word::CDataBinding*>(poResult);
|
||||
if (c_oSerSdt::PrefixMappings == type)
|
||||
{
|
||||
pDataBinding->m_sPrefixMappings.Init();
|
||||
pDataBinding->m_sPrefixMappings->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if (c_oSerSdt::StoreItemID == type)
|
||||
{
|
||||
pDataBinding->m_sStoreItemID.Init();
|
||||
pDataBinding->m_sStoreItemID->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if (c_oSerSdt::XPath == type)
|
||||
{
|
||||
pDataBinding->m_sXPath.Init();
|
||||
pDataBinding->m_sXPath->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadSdtPrDate(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = 0;
|
||||
OOX::Logic::CDate* pDate = static_cast<OOX::Logic::CDate*>(poResult);
|
||||
if (c_oSerSdt::FullDate == type)
|
||||
{
|
||||
std::wstring sVal = m_oBufferedStream.GetString3(length);
|
||||
|
||||
pDate->m_oFullDate.Init();
|
||||
pDate->m_oFullDate->SetValue(sVal);
|
||||
}
|
||||
else if (c_oSerSdt::Calendar == type)
|
||||
{
|
||||
pDate->m_oCalendar.Init();
|
||||
pDate->m_oCalendar->m_oVal.SetValue((SimpleTypes::ECalendarType)m_oBufferedStream.GetUChar());
|
||||
}
|
||||
else if (c_oSerSdt::DateFormat == type)
|
||||
{
|
||||
pDate->m_oDateFormat.Init();
|
||||
pDate->m_oDateFormat->m_sVal.Init();
|
||||
pDate->m_oDateFormat->m_sVal->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if (c_oSerSdt::Lid == type)
|
||||
{
|
||||
pDate->m_oLid.Init();
|
||||
pDate->m_oLid->m_oVal.Init();
|
||||
std::wstring sVal = m_oBufferedStream.GetString3(length);
|
||||
pDate->m_oLid->m_oVal->SetValue(sVal);
|
||||
}
|
||||
else if (c_oSerSdt::StoreMappedDataAs == type)
|
||||
{
|
||||
pDate->m_oStoreMappedDateAs.Init();
|
||||
pDate->m_oStoreMappedDateAs->m_oVal.SetValue((SimpleTypes::ESdtDateMappingType)m_oBufferedStream.GetUChar());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadDocPartList(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = 0;
|
||||
OOX::Logic::CSdtDocPart* pDocPart = static_cast<OOX::Logic::CSdtDocPart*>(poResult);
|
||||
if (c_oSerSdt::DocPartCategory == type)
|
||||
{
|
||||
pDocPart->m_oDocPartCategory.Init();
|
||||
pDocPart->m_oDocPartCategory->m_sVal.Init();
|
||||
pDocPart->m_oDocPartCategory->m_sVal->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if (c_oSerSdt::DocPartGallery == type)
|
||||
{
|
||||
pDocPart->m_oDocPartGallery.Init();
|
||||
pDocPart->m_oDocPartGallery->m_sVal.Init();
|
||||
pDocPart->m_oDocPartGallery->m_sVal->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if (c_oSerSdt::DocPartUnique == type)
|
||||
{
|
||||
pDocPart->m_oDocPartUnique.Init();
|
||||
pDocPart->m_oDocPartUnique->m_oVal.FromBool(m_oBufferedStream.GetBool());
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadDropDownList(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = 0;
|
||||
OOX::Logic::CSdtDropDownList* pDropDownList = static_cast<OOX::Logic::CSdtDropDownList*>(poResult);
|
||||
if (c_oSerSdt::LastValue == type)
|
||||
{
|
||||
pDropDownList->m_sLastValue.Init();
|
||||
pDropDownList->m_sLastValue->append(m_oBufferedStream.GetString3(length));
|
||||
}
|
||||
else if (c_oSerSdt::SdtListItem == type)
|
||||
{
|
||||
ComplexTypes::Word::CSdtListItem* pSdtListItem = new ComplexTypes::Word::CSdtListItem();
|
||||
res = Read1(length, &Binary_DocumentTableReader::ReadSdtListItem, this, pSdtListItem);
|
||||
pDropDownList->m_arrListItem.push_back(pSdtListItem);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
};
|
||||
class Binary_NotesTableReader : public Binary_CommonReader<Binary_NotesTableReader>
|
||||
{
|
||||
|
||||
@ -463,7 +463,8 @@ extern int g_nCurFormatVersion;
|
||||
FldSimple = 11,
|
||||
Del = 12,
|
||||
Ins = 13,
|
||||
Background = 14
|
||||
Background = 14,
|
||||
Sdt = 15
|
||||
};}
|
||||
namespace c_oSerDocTableType{enum c_oSerDocTableType
|
||||
{
|
||||
@ -477,7 +478,8 @@ extern int g_nCurFormatVersion;
|
||||
Cell = 6,
|
||||
Cell_Pr = 7,
|
||||
Cell_Content = 8,
|
||||
tblGridChange = 9
|
||||
tblGridChange = 9,
|
||||
Sdt = 10
|
||||
};}
|
||||
namespace c_oSerRunType{enum c_oSerRunType
|
||||
{
|
||||
@ -1003,6 +1005,45 @@ extern int g_nCurFormatVersion;
|
||||
Data = 1,
|
||||
Program = 2
|
||||
};}
|
||||
namespace c_oSerSdt{enum c_oSerSdt
|
||||
{
|
||||
Pr = 0,
|
||||
EndPr = 1,
|
||||
Content = 2,
|
||||
Type = 3,
|
||||
Alias = 4,
|
||||
ComboBox = 5,
|
||||
LastValue = 6,
|
||||
SdtListItem = 7,
|
||||
DisplayText = 8,
|
||||
Value = 9,
|
||||
DataBinding = 10,
|
||||
PrefixMappings = 11,
|
||||
StoreItemID = 12,
|
||||
XPath = 13,
|
||||
PrDate = 14,
|
||||
FullDate = 15,
|
||||
Calendar = 16,
|
||||
DateFormat = 17,
|
||||
Lid = 18,
|
||||
StoreMappedDataAs = 19,
|
||||
DocPartList = 20,
|
||||
DocPartObj = 21,
|
||||
DocPartCategory = 22,
|
||||
DocPartGallery = 23,
|
||||
DocPartUnique = 24,
|
||||
DropDownList = 25,
|
||||
Id = 26,
|
||||
Label = 27,
|
||||
Lock = 28,
|
||||
PlaceHolder = 29,
|
||||
RPr = 30,
|
||||
ShowingPlcHdr = 31,
|
||||
TabIndex = 32,
|
||||
Tag = 33,
|
||||
Temporary = 34,
|
||||
MultiLine = 35
|
||||
};}
|
||||
}
|
||||
|
||||
#endif // #ifndef DOCX_BIN_READER_WRITER_DEFINES
|
||||
|
||||
@ -3047,8 +3047,9 @@ namespace BinDocxRW
|
||||
case OOX::et_w_sdt:
|
||||
{
|
||||
OOX::Logic::CSdt* pStd = static_cast<OOX::Logic::CSdt*>(item);
|
||||
if(pStd->m_oSdtContent.IsInit())
|
||||
WriteDocumentContent(pStd->m_oSdtContent.get().m_arrItems);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::Sdt);
|
||||
WriteSdt(pStd, 0, NULL, 0, 0, 0);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}break;
|
||||
case OOX::et_w_smartTag:
|
||||
{
|
||||
@ -3189,8 +3190,9 @@ namespace BinDocxRW
|
||||
case OOX::et_w_sdt:
|
||||
{
|
||||
OOX::Logic::CSdt* pStd = static_cast<OOX::Logic::CSdt*>(item);
|
||||
if(pStd->m_oSdtContent.IsInit())
|
||||
WriteParagraphContent(pStd->m_oSdtContent.get().m_arrItems);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::Sdt);
|
||||
WriteSdt(pStd, 1, NULL, 0, 0, 0);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
case OOX::et_w_smartTag:
|
||||
@ -6366,8 +6368,9 @@ namespace BinDocxRW
|
||||
else if(OOX::et_w_sdt == item->getType())
|
||||
{
|
||||
OOX::Logic::CSdt* pStd = static_cast<OOX::Logic::CSdt*>(item);
|
||||
if(pStd->m_oSdtContent.IsInit())
|
||||
WriteTableContent(pStd->m_oSdtContent->m_arrItems, pTblPr, nRows, nCols);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::Sdt);
|
||||
WriteSdt(pStd, 2, pTblPr, 0, nRows, nCols);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
else if(OOX::et_w_smartTag == item->getType())
|
||||
{
|
||||
@ -6425,8 +6428,9 @@ namespace BinDocxRW
|
||||
else if(OOX::et_w_sdt == item->getType())
|
||||
{
|
||||
OOX::Logic::CSdt* pStd = static_cast<OOX::Logic::CSdt*>(item);
|
||||
if(pStd->m_oSdtContent.IsInit())
|
||||
WriteRowContent(pStd->m_oSdtContent.get().m_arrItems, pTblPr, nCurRowIndex, nRows, nCols);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerDocTableType::Sdt);
|
||||
WriteSdt(pStd, 3, pTblPr, nCurRowIndex, nRows, nCols);
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
else if(OOX::et_w_smartTag == item->getType())
|
||||
{
|
||||
@ -6462,6 +6466,287 @@ namespace BinDocxRW
|
||||
oBinaryDocumentTableWriter.WriteDocumentContent(tc.m_arrItems);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
void WriteSdt(OOX::Logic::CSdt* pStd, int type, OOX::Logic::CTableProperty* pTblPr, int nCurRowIndex, int nRows, int nCols)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(pStd->m_oSdtPr.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::Pr);
|
||||
WriteSdtPr(pStd->m_oSdtPr.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(pStd->m_oSdtEndPr.IsInit() && pStd->m_oSdtEndPr->m_oRPr.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::EndPr);
|
||||
brPrs.Write_rPr(pStd->m_oSdtEndPr->m_oRPr.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(pStd->m_oSdtContent.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::Content);
|
||||
switch(type)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
BinaryDocumentTableWriter oBinaryDocumentTableWriter(m_oParamsWriter, m_oParamsDocumentWriter, m_mapIgnoreComments, bpPrs.m_oBinaryHeaderFooterTableWriter);
|
||||
oBinaryDocumentTableWriter.WriteDocumentContent(pStd->m_oSdtContent.get().m_arrItems);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
WriteParagraphContent(pStd->m_oSdtContent.get().m_arrItems);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
WriteTableContent(pStd->m_oSdtContent->m_arrItems, pTblPr, nRows, nCols);
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
WriteRowContent(pStd->m_oSdtContent.get().m_arrItems, pTblPr, nCurRowIndex, nRows, nCols);
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteSdtPr(const OOX::Logic::CSdtPr& oStdPr)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::Type);
|
||||
m_oBcw.m_oStream.WriteBYTE(oStdPr.m_eType);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
|
||||
if(oStdPr.m_oAlias.IsInit() && oStdPr.m_oAlias->m_sVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::Alias);
|
||||
m_oBcw.m_oStream.WriteStringW3(oStdPr.m_oAlias->m_sVal.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oComboBox.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::ComboBox);
|
||||
WriteSdtComboBox(oStdPr.m_oComboBox.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oDataBinding.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::DataBinding);
|
||||
WriteSdtPrDataBinding(oStdPr.m_oDataBinding.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oDate.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::PrDate);
|
||||
WriteSdtPrDate(oStdPr.m_oDate.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oDocPartList.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::DocPartList);
|
||||
WriteDocPartList(oStdPr.m_oDocPartList.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oDocPartObj.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::DocPartObj);
|
||||
WriteDocPartList(oStdPr.m_oDocPartObj.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oDropDownList.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::DropDownList);
|
||||
WriteDropDownList(oStdPr.m_oDropDownList.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oId.IsInit() && oStdPr.m_oId->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::Id);
|
||||
m_oBcw.m_oStream.WriteULONG(oStdPr.m_oId->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oLabel.IsInit() && oStdPr.m_oLabel->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::Label);
|
||||
m_oBcw.m_oStream.WriteULONG(oStdPr.m_oLabel->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oLock.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::Lock);
|
||||
m_oBcw.m_oStream.WriteBYTE(oStdPr.m_oLock->m_oVal.GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oPlaceHolder.IsInit() && oStdPr.m_oPlaceHolder->m_oDocPart.IsInit() && oStdPr.m_oPlaceHolder->m_oDocPart->m_sVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::PlaceHolder);
|
||||
m_oBcw.m_oStream.WriteStringW3(oStdPr.m_oPlaceHolder->m_oDocPart->m_sVal.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oRPr.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::RPr);
|
||||
brPrs.Write_rPr(oStdPr.m_oRPr.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oShowingPlcHdr.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::ShowingPlcHdr);
|
||||
m_oBcw.m_oStream.WriteBOOL(oStdPr.m_oShowingPlcHdr->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oTabIndex.IsInit() && oStdPr.m_oTabIndex->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::TabIndex);
|
||||
m_oBcw.m_oStream.WriteULONG(oStdPr.m_oTabIndex->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oTag.IsInit() && oStdPr.m_oTag->m_sVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::Tag);
|
||||
m_oBcw.m_oStream.WriteStringW3(oStdPr.m_oTag->m_sVal.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oTemporary.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::Temporary);
|
||||
m_oBcw.m_oStream.WriteBOOL(oStdPr.m_oTemporary->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oStdPr.m_oText.IsInit() && oStdPr.m_oText->m_oMultiLine.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::MultiLine);
|
||||
m_oBcw.m_oStream.WriteBOOL(oStdPr.m_oText->m_oMultiLine->ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteSdtComboBox(const OOX::Logic::CSdtComboBox& oSdtComboBox)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oSdtComboBox.m_sLastValue.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::LastValue);
|
||||
m_oBcw.m_oStream.WriteStringW3(oSdtComboBox.m_sLastValue.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
for(size_t i = 0; i < oSdtComboBox.m_arrListItem.size(); ++i)
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::SdtListItem);
|
||||
WriteSdtListItem(*oSdtComboBox.m_arrListItem[i]);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteSdtListItem(const ComplexTypes::Word::CSdtListItem& oSdtListItem)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oSdtListItem.m_sDisplayText.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::DisplayText);
|
||||
m_oBcw.m_oStream.WriteStringW3(oSdtListItem.m_sDisplayText.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSdtListItem.m_sValue.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::Value);
|
||||
m_oBcw.m_oStream.WriteStringW3(oSdtListItem.m_sValue.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteSdtPrDataBinding(const ComplexTypes::Word::CDataBinding& oDataBinding)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oDataBinding.m_sPrefixMappings.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::PrefixMappings);
|
||||
m_oBcw.m_oStream.WriteStringW3(oDataBinding.m_sPrefixMappings.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oDataBinding.m_sStoreItemID.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::StoreItemID);
|
||||
m_oBcw.m_oStream.WriteStringW3(oDataBinding.m_sStoreItemID.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oDataBinding.m_sXPath.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::XPath);
|
||||
m_oBcw.m_oStream.WriteStringW3(oDataBinding.m_sXPath.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteSdtPrDate(const OOX::Logic::CDate& oDate)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oDate.m_oFullDate.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::FullDate);
|
||||
m_oBcw.m_oStream.WriteStringW3(oDate.m_oFullDate->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oDate.m_oCalendar.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::Calendar);
|
||||
m_oBcw.m_oStream.WriteBYTE(oDate.m_oCalendar->m_oVal.GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oDate.m_oDateFormat.IsInit() && oDate.m_oDateFormat->m_sVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::DateFormat);
|
||||
m_oBcw.m_oStream.WriteStringW3(oDate.m_oDateFormat->m_sVal.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oDate.m_oLid.IsInit() && oDate.m_oLid->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::Lid);
|
||||
m_oBcw.m_oStream.WriteStringW3(oDate.m_oLid->m_oVal->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oDate.m_oStoreMappedDateAs.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::StoreMappedDataAs);
|
||||
m_oBcw.m_oStream.WriteBYTE(oDate.m_oStoreMappedDateAs->m_oVal.GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteDocPartList(const OOX::Logic::CSdtDocPart& oSdtDocPart)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oSdtDocPart.m_oDocPartCategory.IsInit() && oSdtDocPart.m_oDocPartCategory->m_sVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::DocPartCategory);
|
||||
m_oBcw.m_oStream.WriteStringW3(oSdtDocPart.m_oDocPartCategory->m_sVal.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSdtDocPart.m_oDocPartGallery.IsInit() && oSdtDocPart.m_oDocPartGallery->m_sVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::DocPartGallery);
|
||||
m_oBcw.m_oStream.WriteStringW3(oSdtDocPart.m_oDocPartGallery->m_sVal.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSdtDocPart.m_oDocPartUnique.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::DocPartUnique);
|
||||
m_oBcw.m_oStream.WriteBOOL(oSdtDocPart.m_oDocPartUnique->m_oVal.ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteDropDownList(const OOX::Logic::CSdtDropDownList& oDropDownList)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oDropDownList.m_sLastValue.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::LastValue);
|
||||
m_oBcw.m_oStream.WriteStringW3(oDropDownList.m_sLastValue.get());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
for(size_t i = 0; i < oDropDownList.m_arrListItem.size(); ++i)
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerSdt::SdtListItem);
|
||||
WriteSdtListItem(*oDropDownList.m_arrListItem[i]);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
};
|
||||
class BinaryCommentsTableWriter
|
||||
{
|
||||
@ -6909,80 +7194,96 @@ namespace BinDocxRW
|
||||
}
|
||||
}
|
||||
}
|
||||
void WriteColorSchemeMapping(const OOX::Settings::CColorSchemeMapping& oColorSchemeMapping)
|
||||
void WriteColorSchemeMapping(const PPTX::Logic::ClrMap& oColorSchemeMapping)
|
||||
{
|
||||
int re_index[] = {0, 1, 2, 3, 4, 5, 10, 11, 6, 7, 8, 9, 10, 11, 10, 6, 7};
|
||||
|
||||
int nCurPos = 0;
|
||||
if(oColorSchemeMapping.m_oAccent1.IsInit())
|
||||
std::map<std::wstring, PPTX::Limit::ColorSchemeIndex>::const_iterator pFind;
|
||||
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"accent1");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent1);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oColorSchemeMapping.m_oAccent1->GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
if(oColorSchemeMapping.m_oAccent2.IsInit())
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"accent2");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent2);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oColorSchemeMapping.m_oAccent2->GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
if(oColorSchemeMapping.m_oAccent3.IsInit())
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"accent3");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent3);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oColorSchemeMapping.m_oAccent3->GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
if(oColorSchemeMapping.m_oAccent4.IsInit())
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"accent4");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent4);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oColorSchemeMapping.m_oAccent4->GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
if(oColorSchemeMapping.m_oAccent5.IsInit())
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"accent5");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent5);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oColorSchemeMapping.m_oAccent5->GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
if(oColorSchemeMapping.m_oAccent6.IsInit())
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"accent6");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Accent6);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oColorSchemeMapping.m_oAccent6->GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
if(oColorSchemeMapping.m_oBg1.IsInit())
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"bg1");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Bg1);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oColorSchemeMapping.m_oBg1->GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
if(oColorSchemeMapping.m_oBg2.IsInit())
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"bg2");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Bg2);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oColorSchemeMapping.m_oBg2->GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
if(oColorSchemeMapping.m_oFollowedHyperlink.IsInit())
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"folHlink");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::FollowedHyperlink);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oColorSchemeMapping.m_oFollowedHyperlink->GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
if(oColorSchemeMapping.m_oHyperlink.IsInit())
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"hlink");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::Hyperlink);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oColorSchemeMapping.m_oHyperlink->GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
if(oColorSchemeMapping.m_oT1.IsInit())
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"tx1");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::T1);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oColorSchemeMapping.m_oT1->GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
if(oColorSchemeMapping.m_oT2.IsInit())
|
||||
pFind = oColorSchemeMapping.ColorMap.find(L"tx2");
|
||||
if(pFind != oColorSchemeMapping.ColorMap.end())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_ClrSchemeMappingType::T2);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(oColorSchemeMapping.m_oT2->GetValue());
|
||||
m_oBcw.m_oStream.WriteBYTE(re_index[pFind->second.GetBYTECode()]);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@ -54,7 +54,7 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
HRESULT hr = S_OK;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
std::wstring srcFileName = argv[1];
|
||||
std::wstring dstPath = argc > 2 ? argv[2] : srcFileName + L"-my.pptx"; //xlsx pptx docx
|
||||
std::wstring dstPath = argc > 2 ? argv[2] : srcFileName + L"-my.docx"; //xlsx pptx docx
|
||||
|
||||
std::wstring outputDir = NSDirectory::GetFolderPath(dstPath);
|
||||
|
||||
|
||||
@ -1195,7 +1195,7 @@ void docx_conversion_context::process_headers_footers()
|
||||
// проходим по всем page layout
|
||||
BOOST_FOREACH(const odf_reader::style_master_page* page, pageLayouts.master_pages())
|
||||
{
|
||||
const std::wstring & styleName = page->style_master_page_attlist_.style_name_.get_value_or( L"" );
|
||||
const std::wstring & styleName = page->attlist_.style_name_.get_value_or( L"" );
|
||||
const std::wstring masterPageNameLayout =context.pageLayoutContainer().page_layout_name_by_style(styleName);
|
||||
add_page_properties(masterPageNameLayout);
|
||||
|
||||
|
||||
@ -49,6 +49,8 @@ struct _rect
|
||||
|
||||
struct drawing_object_description
|
||||
{
|
||||
bool bNotes_;
|
||||
|
||||
oox::RelsType type_;
|
||||
|
||||
std::wstring name_;
|
||||
|
||||
@ -144,7 +144,8 @@ void styles_context::docx_serialize_table_style(std::wostream & strm, std::wstri
|
||||
}
|
||||
namespace oox
|
||||
{
|
||||
math_context::math_context(odf_reader::fonts_container & fonts, bool graphic) : base_font_size_(12), fonts_container_(fonts)
|
||||
math_context::math_context(odf_reader::fonts_container & fonts, bool graphic) :
|
||||
base_font_size_(12), fonts_container_(fonts)
|
||||
{
|
||||
graphRPR_ = graphic;
|
||||
|
||||
|
||||
@ -57,9 +57,25 @@ namespace svg_path
|
||||
{
|
||||
CP_XML_NODE(val.command)
|
||||
{
|
||||
for (size_t i = 0; i < val.points.size(); i++)
|
||||
{
|
||||
oox_serialize(CP_XML_STREAM(), val.points[i]);
|
||||
if (val.command == L"a:ArcTo")
|
||||
{
|
||||
if (val.points.size() > 0)
|
||||
{
|
||||
CP_XML_ATTR(L"wR", (int)(val.points[0].x.get()));
|
||||
CP_XML_ATTR(L"hR", (int)(val.points[0].y.get()));
|
||||
}
|
||||
if (val.points.size() > 1)
|
||||
{
|
||||
CP_XML_ATTR(L"stAng", (int)(val.points[1].x.get() * 60000));
|
||||
CP_XML_ATTR(L"swAng", (int)(val.points[1].y.get() * 60000));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 0; i < val.points.size(); i++)
|
||||
{
|
||||
oox_serialize(CP_XML_STREAM(), val.points[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -112,7 +128,7 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
|
||||
_CP_OPT(std::wstring) strStrokeColor;
|
||||
_CP_OPT(int) iStroke;
|
||||
_CP_OPT(double) dStrokeWidth;
|
||||
_CP_OPT(double) dStrokeOpacity;
|
||||
_CP_OPT(double) dStrokeOpacity;
|
||||
_CP_OPT(bool) bWordArt;
|
||||
|
||||
odf_reader::GetProperty(prop, L"wordArt", bWordArt);
|
||||
@ -151,15 +167,23 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
|
||||
{
|
||||
if (fill != L"a:noFill")
|
||||
{
|
||||
if (color.length() < 1 && always_draw) color = L"000000";
|
||||
else if (color.length() <1 ) color = L"ffffff";
|
||||
if ( color.empty() )
|
||||
{
|
||||
if (always_draw) color = L"000000";
|
||||
else color = L"ffffff";
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"a:srgbClr")
|
||||
{
|
||||
CP_XML_ATTR(L"val",color);
|
||||
|
||||
if (dStrokeOpacity) CP_XML_NODE(L"a:alpha"){CP_XML_ATTR(L"val", *dStrokeOpacity);}
|
||||
|
||||
if (dStrokeOpacity)
|
||||
{
|
||||
CP_XML_NODE(L"a:alpha")
|
||||
{
|
||||
CP_XML_ATTR(L"val", (int)(*dStrokeOpacity * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -187,69 +211,33 @@ void oox_serialize_ln(std::wostream & strm, const std::vector<odf_reader::_prope
|
||||
}
|
||||
void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_property> & prop)
|
||||
{
|
||||
_CP_OPT(int) iShapeIndex;
|
||||
_CP_OPT(bool) bWordArt;
|
||||
|
||||
odf_reader::GetProperty(prop, L"wordArt" , bWordArt);
|
||||
odf_reader::GetProperty(prop, L"odf-custom-draw-index" , iShapeIndex);
|
||||
|
||||
int count_values = 0, min_value = 0, max_value = 0;
|
||||
|
||||
if (!bWordArt && iShapeIndex)
|
||||
{
|
||||
count_values = _OO_OOX_custom_shapes[*iShapeIndex].count_values;
|
||||
min_value = _OO_OOX_custom_shapes[*iShapeIndex].min;
|
||||
max_value = _OO_OOX_custom_shapes[*iShapeIndex].max;
|
||||
}
|
||||
else if (iShapeIndex)
|
||||
{
|
||||
count_values = _OO_OOX_wordart[*iShapeIndex].count_values;
|
||||
min_value = _OO_OOX_wordart[*iShapeIndex].min;
|
||||
max_value = _OO_OOX_wordart[*iShapeIndex].max;
|
||||
}
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"a:avLst")
|
||||
{
|
||||
_CP_OPT(std::wstring) strVal;
|
||||
if (odf_reader::GetProperty(prop,L"draw-modifiers",strVal) && iShapeIndex)
|
||||
_CP_OPT(bool) bModifiers;
|
||||
_CP_OPT(std::wstring) strModifiers;
|
||||
odf_reader::GetProperty(prop, L"bModifiers", bModifiers);
|
||||
odf_reader::GetProperty(prop, L"oox-draw-modifiers", strModifiers);
|
||||
if (strModifiers)
|
||||
{
|
||||
std::vector< std::wstring > values;
|
||||
boost::algorithm::split(values, strVal.get(), boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
boost::algorithm::split(values, strModifiers.get(), boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
|
||||
if( count_values >0 && values.size()>0 && count_values < 3)//временное ограниечение .. хз как там свойства путаются
|
||||
{//если не заданы доп свойства - нефиг мучится
|
||||
int i=1;
|
||||
if (!values.empty() && values.back().empty()) values.pop_back();
|
||||
|
||||
_CP_OPT(int) iMax,iMin;
|
||||
odf_reader::GetProperty(prop,L"draw-modifiers-min",iMin);
|
||||
odf_reader::GetProperty(prop,L"draw-modifiers-max",iMax);
|
||||
values.resize(count_values);
|
||||
|
||||
BOOST_FOREACH(std::wstring & v, values)
|
||||
for (size_t i = 0; i < values.size(); i++)
|
||||
{
|
||||
if (values[i].empty()) continue;
|
||||
CP_XML_NODE(L"a:gd")
|
||||
{
|
||||
CP_XML_NODE(L"a:gd")
|
||||
{
|
||||
if (values.size() >1)
|
||||
CP_XML_ATTR(L"name",(L"adj" + boost::lexical_cast<std::wstring>(i++)));
|
||||
else
|
||||
CP_XML_ATTR(L"name",L"adj");
|
||||
double val=0;
|
||||
if (v.length()>0)val= boost::lexical_cast<double>(v);
|
||||
|
||||
if (iMin && iMax && iShapeIndex)
|
||||
{
|
||||
if (min_value < max_value)
|
||||
{
|
||||
double W = *iMax - *iMin;
|
||||
val = (val- (*iMin))/W * (max_value - min_value) + min_value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CP_XML_ATTR(L"fmla",L"val " + boost::lexical_cast<std::wstring>(static_cast<int>(val)));
|
||||
}
|
||||
if (values.size() > 1 || bModifiers)
|
||||
//весьма странное .. для некоторых модификаторов (напр math...) нужно указывать множественность их
|
||||
CP_XML_ATTR(L"name", L"adj" + std::to_wstring(i+1));
|
||||
else
|
||||
CP_XML_ATTR(L"name", L"adj");
|
||||
|
||||
CP_XML_ATTR(L"fmla", L"val " + values[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -342,37 +330,39 @@ void _oox_drawing::serialize_bodyPr(std::wostream & strm, const std::wstring & n
|
||||
|
||||
void _oox_drawing::serialize_shape(std::wostream & strm)
|
||||
{
|
||||
_CP_OPT(std::wstring) strVal;
|
||||
_CP_OPT(double) dVal;
|
||||
_CP_OPT(int) iOoxShapeIndex;
|
||||
_CP_OPT(bool) bWordArt, bOoxShape;
|
||||
_CP_OPT(std::wstring) sCustomPath;
|
||||
|
||||
odf_reader::GetProperty(additional, L"wordArt", bWordArt);
|
||||
odf_reader::GetProperty(additional, L"oox-geom-index", iOoxShapeIndex);
|
||||
odf_reader::GetProperty(additional, L"oox-geom", bOoxShape);
|
||||
|
||||
std::wstring shapeType;
|
||||
_CP_OPT(bool) bWordArt;
|
||||
|
||||
odf_reader::GetProperty(additional,L"wordArt", bWordArt);
|
||||
odf_reader::GetProperty(additional, L"custom_path", sCustomPath);
|
||||
|
||||
std::wstring shapeGeomPreset;
|
||||
|
||||
if (sub_type == 7)//custom
|
||||
{
|
||||
_CP_OPT(int) iVal;
|
||||
odf_reader::GetProperty(additional, L"odf-custom-draw-index",iVal);
|
||||
|
||||
if (iVal)
|
||||
shapeType = _OO_OOX_custom_shapes[*iVal].oox;
|
||||
else
|
||||
if (iOoxShapeIndex)
|
||||
shapeGeomPreset = _OO_OOX_custom_shapes[*iOoxShapeIndex].oox;
|
||||
else if (sCustomPath)
|
||||
sub_type = 6; //path
|
||||
|
||||
if (shapeType == L"textBox")
|
||||
if (shapeGeomPreset == L"textBox")
|
||||
{
|
||||
sub_type = 1;
|
||||
shapeType = L"rect";
|
||||
shapeGeomPreset = L"rect";
|
||||
}
|
||||
}
|
||||
else if (sub_type < 9 && sub_type >= 0)
|
||||
{
|
||||
shapeType = _ooxShapeType[sub_type];
|
||||
shapeGeomPreset = _ooxShapeType[sub_type]; //odf -> oox
|
||||
}
|
||||
|
||||
if (bWordArt) sub_type = 1;
|
||||
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
if (sub_type == 6 || sub_type == 8)
|
||||
@ -391,36 +381,44 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
|
||||
CP_XML_ATTR(L"t", 0);
|
||||
}
|
||||
//<a:rect b="b" l="0" r="r" t="0"/>
|
||||
if (odf_reader::GetProperty(additional, L"custom_path", strVal))
|
||||
{
|
||||
_CP_OPT(int) w, h;
|
||||
odf_reader::GetProperty(additional, L"custom_path_w", w);
|
||||
odf_reader::GetProperty(additional, L"custom_path_h", h);
|
||||
_CP_OPT(int) w, h;
|
||||
odf_reader::GetProperty(additional, L"custom_path_w", w);
|
||||
odf_reader::GetProperty(additional, L"custom_path_h", h);
|
||||
|
||||
CP_XML_NODE(L"a:pathLst")
|
||||
{
|
||||
CP_XML_NODE(L"a:path")
|
||||
{
|
||||
CP_XML_ATTR(L"w", w ? *w : cx);
|
||||
CP_XML_ATTR(L"h", h ? *h : cy);
|
||||
|
||||
CP_XML_STREAM() << strVal.get();
|
||||
|
||||
CP_XML_NODE(L"a:pathLst")
|
||||
{
|
||||
CP_XML_NODE(L"a:path")
|
||||
{
|
||||
CP_XML_ATTR(L"w", w ? *w : cx);
|
||||
CP_XML_ATTR(L"h", h ? *h : cy);
|
||||
|
||||
if (sCustomPath)
|
||||
{
|
||||
CP_XML_STREAM() << *sCustomPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (shapeType.length() < 1)
|
||||
if (shapeGeomPreset.empty())
|
||||
{
|
||||
shapeType = L"rect";
|
||||
sub_type = 2;
|
||||
shapeGeomPreset = L"rect";
|
||||
sub_type = 2;
|
||||
}
|
||||
CP_XML_NODE(L"a:prstGeom")//автофигура
|
||||
{
|
||||
CP_XML_ATTR(L"prst", shapeType);
|
||||
if (!bWordArt) oox_serialize_aLst(CP_XML_STREAM(), additional);
|
||||
CP_XML_ATTR(L"prst", shapeGeomPreset);
|
||||
if (!bWordArt)
|
||||
{
|
||||
if (std::wstring::npos != shapeGeomPreset.find(L"mathPlus"))
|
||||
{
|
||||
additional.push_back(odf_reader::_property(L"bModifiers", true));
|
||||
}
|
||||
oox_serialize_aLst(CP_XML_STREAM(), additional);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bWordArt)
|
||||
|
||||
@ -153,7 +153,9 @@ void pptx_conversion_context::process_master_pages()
|
||||
get_text_context().set_process_layouts(true);
|
||||
|
||||
//берем только актуальные
|
||||
for (size_t master_index =0; master_index < masters.content.size();master_index++)
|
||||
odf_reader::office_element_ptr master_notes_;
|
||||
|
||||
for (size_t master_index = 0; master_index < masters.content.size(); master_index++)
|
||||
{
|
||||
start_master(master_index);
|
||||
|
||||
@ -163,10 +165,21 @@ void pptx_conversion_context::process_master_pages()
|
||||
if (master)
|
||||
{
|
||||
master->pptx_convert(*this);
|
||||
|
||||
if (!master_notes_ && master->presentation_notes_)
|
||||
master_notes_ = master->presentation_notes_;
|
||||
}
|
||||
|
||||
|
||||
end_master();
|
||||
}
|
||||
|
||||
if (master_notes_)
|
||||
{
|
||||
start_master_notes();
|
||||
master_notes_->pptx_convert(*this);
|
||||
end_master_notes();
|
||||
}
|
||||
process_masters_ = false;
|
||||
get_text_context().set_process_layouts(false);
|
||||
|
||||
@ -180,15 +193,15 @@ void pptx_conversion_context::process_theme(std::wstring name)
|
||||
{
|
||||
int current = themes_.size() + 1;
|
||||
|
||||
if (name.length()<1)
|
||||
if (name.empty())
|
||||
{
|
||||
name = L"User Theme: " + boost::lexical_cast<std::wstring>(current);
|
||||
}
|
||||
start_theme(name);
|
||||
//
|
||||
pptx_serialize_clrScheme(current_theme().clrSchemeData());
|
||||
pptx_serialize_fmtScheme(current_theme().fmtSchemeData());
|
||||
pptx_serialize_fontScheme(current_theme().fontSchemeData());
|
||||
pptx_serialize_clrScheme (current_theme().clrSchemeData());
|
||||
pptx_serialize_fmtScheme (current_theme().fmtSchemeData());
|
||||
pptx_serialize_fontScheme (current_theme().fontSchemeData());
|
||||
//
|
||||
end_theme();
|
||||
|
||||
@ -209,8 +222,6 @@ void pptx_conversion_context::start_document()
|
||||
|
||||
void pptx_conversion_context::end_document()
|
||||
{
|
||||
unsigned int count = 1;
|
||||
|
||||
for (size_t i = 0; i < slideMasters_.size(); i++)
|
||||
{
|
||||
pptx_xml_slideMaster_ptr& slideM = slideMasters_[i];
|
||||
@ -230,10 +241,11 @@ void pptx_conversion_context::end_document()
|
||||
CP_XML_ATTR(L"r:id", slideM->rId());
|
||||
}
|
||||
}
|
||||
count++;
|
||||
}
|
||||
if (!slideMasters_.empty())
|
||||
presentation_.slidesProperties() << slideMasters_[0]->Sizes().str();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
count=0;
|
||||
for (size_t i = 0; i < slides_.size(); i++)
|
||||
{
|
||||
pptx_xml_slide_ptr& slide = slides_[i];
|
||||
@ -249,13 +261,12 @@ void pptx_conversion_context::end_document()
|
||||
{
|
||||
CP_XML_NODE(L"p:sldId")
|
||||
{
|
||||
CP_XML_ATTR(L"id", 0x100 + count);
|
||||
CP_XML_ATTR(L"id", 0x100 + i);
|
||||
CP_XML_ATTR(L"r:id", slide->rId());
|
||||
}
|
||||
}
|
||||
count++;
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
//----------------------------------------------------------------------------------
|
||||
for (size_t i = 0; i < slideLayouts_.size(); i++)
|
||||
{
|
||||
pptx_xml_slideLayout_ptr& slideL = slideLayouts_[i];
|
||||
@ -267,30 +278,42 @@ void pptx_conversion_context::end_document()
|
||||
|
||||
output_document_->get_ppt_files().add_slideLayout(content);//slideMaster.xml
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//размеры страниц в презентации
|
||||
odf_reader::odf_read_context & context = root()->odf_context();
|
||||
odf_reader::page_layout_container & pageLayouts = context.pageLayoutContainer();
|
||||
|
||||
if ((pageLayouts.master_pages().size() > 0) && (pageLayouts.master_pages()[0]->style_master_page_attlist_.style_name_))//default
|
||||
{
|
||||
const std::wstring masterStyleName = pageLayouts.master_pages()[0]->style_master_page_attlist_.style_name_.get();
|
||||
const std::wstring pageProperties = root()->odf_context().pageLayoutContainer().page_layout_name_by_style(masterStyleName);
|
||||
//----------------------------------------------------------------------------------
|
||||
for (size_t i = 0; i < notes_.size(); i++)
|
||||
{
|
||||
pptx_xml_slideNotes_ptr& slideN = notes_[i];
|
||||
|
||||
odf_reader::page_layout_instance *pages_layouts = root()->odf_context().pageLayoutContainer().page_layout_by_name(pageProperties);
|
||||
|
||||
if (pages_layouts)pages_layouts->pptx_convert(*this);
|
||||
package::slide_content_ptr content = package::slide_content::create();
|
||||
|
||||
slideN->write_to(content->content());
|
||||
content->add_rels(slideN->Rels());//media & links rels
|
||||
|
||||
output_document_->get_ppt_files().add_notes(content);
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
pptx_serialize_size(current_presentation().notesSlidesSize(),6858000,9144000,L"p:notesSz");
|
||||
if (slideNotesMaster_)
|
||||
{
|
||||
package::slide_content_ptr content = package::slide_content::create();
|
||||
|
||||
slideNotesMaster_->write_to(content->content());
|
||||
content->add_rels(slideNotesMaster_->Rels());//media & links rels
|
||||
|
||||
output_document_->get_ppt_files().add_notesMaster(content);
|
||||
|
||||
CP_XML_WRITER(presentation_.slideNotesMastersData())//presentation.xml
|
||||
{
|
||||
CP_XML_NODE(L"p:notesMasterId")
|
||||
{
|
||||
CP_XML_ATTR(L"r:id", slideNotesMaster_->rId());
|
||||
}
|
||||
}
|
||||
}
|
||||
//else
|
||||
pptx_serialize_size(current_presentation().slidesNotesProperties(), 6858000, 9144000, L"p:notesSz");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//добавляем диаграммы
|
||||
|
||||
count = 0;
|
||||
for (size_t i = 0; i < charts_.size(); i++)
|
||||
{
|
||||
count++;
|
||||
package::chart_content_ptr content = package::chart_content::create();
|
||||
|
||||
charts_[i]->serialize(content->content());
|
||||
@ -300,7 +323,6 @@ void pptx_conversion_context::end_document()
|
||||
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//добавляем темы
|
||||
for (size_t i=0; i < themes_.size(); i++)
|
||||
{
|
||||
output_document_->get_ppt_files().add_theme(themes_[i]);
|
||||
@ -308,10 +330,10 @@ void pptx_conversion_context::end_document()
|
||||
}
|
||||
package::ppt_comments_files_ptr comments = package::ppt_comments_files::create(comments_context_handle_.content());
|
||||
|
||||
output_document_->get_ppt_files().set_presentation(presentation_);
|
||||
output_document_->get_ppt_files().set_comments(comments);
|
||||
output_document_->get_ppt_files().set_authors_comments(authors_comments_);
|
||||
output_document_->get_ppt_files().set_media(get_mediaitems(), applicationFonts_);
|
||||
output_document_->get_ppt_files().set_presentation (presentation_);
|
||||
output_document_->get_ppt_files().set_comments (comments);
|
||||
output_document_->get_ppt_files().set_authors_comments (authors_comments_);
|
||||
output_document_->get_ppt_files().set_media (get_mediaitems(), applicationFonts_);
|
||||
|
||||
output_document_->get_content_types_file().set_media(get_mediaitems());
|
||||
}
|
||||
@ -321,7 +343,28 @@ void pptx_conversion_context::start_body()
|
||||
|
||||
void pptx_conversion_context::end_body()
|
||||
{}
|
||||
|
||||
pptx_xml_slideNotesMaster & pptx_conversion_context::current_notesMaster()
|
||||
{
|
||||
if (slideNotesMaster_)
|
||||
{
|
||||
return *slideNotesMaster_;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw std::runtime_error("internal error");
|
||||
}
|
||||
}
|
||||
pptx_xml_slideNotes & pptx_conversion_context::current_notes()
|
||||
{
|
||||
if (!notes_.empty())
|
||||
{
|
||||
return *notes_.back().get();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw std::runtime_error("internal error");
|
||||
}
|
||||
}
|
||||
pptx_xml_slide & pptx_conversion_context::current_slide()
|
||||
{
|
||||
if (!slides_.empty())
|
||||
@ -384,9 +427,18 @@ pptx_xml_slideMaster & pptx_conversion_context::current_master()
|
||||
}
|
||||
void pptx_conversion_context::create_new_slide(std::wstring const & name)
|
||||
{
|
||||
pptx_xml_slide_ptr s = pptx_xml_slide::create(name,slides_.size()+1);
|
||||
pptx_xml_slide_ptr s = pptx_xml_slide::create(name,slides_.size() + 1);
|
||||
slides_.push_back(s);
|
||||
}
|
||||
void pptx_conversion_context::create_new_slideNotes()
|
||||
{
|
||||
pptx_xml_slideNotes_ptr s = pptx_xml_slideNotes::create( notes_.size() + 1);
|
||||
notes_.push_back(s);
|
||||
}
|
||||
void pptx_conversion_context::create_new_slideNotesMaster()
|
||||
{
|
||||
slideNotesMaster_ = pptx_xml_slideNotesMaster::create();
|
||||
}
|
||||
void pptx_conversion_context::create_new_slideLayout(int id)
|
||||
{
|
||||
pptx_xml_slideLayout_ptr s = pptx_xml_slideLayout::create(id);
|
||||
@ -397,7 +449,6 @@ void pptx_conversion_context::create_new_slideMaster(int id)
|
||||
pptx_xml_slideMaster_ptr s = pptx_xml_slideMaster::create(id);
|
||||
slideMasters_.push_back(s);
|
||||
}
|
||||
|
||||
bool pptx_conversion_context::start_page(const std::wstring & pageName, const std::wstring & pageStyleName,
|
||||
const std::wstring & pageLayoutName,
|
||||
const std::wstring & pageMasterName)
|
||||
@ -414,7 +465,7 @@ bool pptx_conversion_context::start_page(const std::wstring & pageName, const st
|
||||
root()->odf_context().styleContainer().presentation_layouts().add_or_find(pageLayoutName,pageMasterName);
|
||||
|
||||
current_slide().Rels().add(relationship(layout_id.second, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",
|
||||
std::wstring(L"../slideLayouts/slideLayout") + boost::lexical_cast<std::wstring>(layout_id.first) + L".xml"));
|
||||
std::wstring(L"../slideLayouts/slideLayout") + std::to_wstring(layout_id.first) + L".xml"));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -506,6 +557,14 @@ bool pptx_conversion_context::start_master(int master_index)
|
||||
current_master().add_layout(masters.content[master_index].layouts[i].Id, masters.content[master_index].layouts[i].rId, 0x80000000 + last_uniq_big_id++);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
//размеры страниц в презентации
|
||||
const std::wstring pageProperties = root()->odf_context().pageLayoutContainer().page_layout_name_by_style(masters.content[master_index].master_name);
|
||||
|
||||
odf_reader::page_layout_instance *pages_layouts = root()->odf_context().pageLayoutContainer().page_layout_by_name(pageProperties);
|
||||
|
||||
if (pages_layouts)
|
||||
pages_layouts->pptx_serialize(current_master().Sizes(), *this);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -530,6 +589,59 @@ void pptx_conversion_context::end_page()
|
||||
|
||||
get_slide_context().end_slide();
|
||||
}
|
||||
bool pptx_conversion_context::start_page_notes()
|
||||
{
|
||||
create_new_slideNotes( );
|
||||
|
||||
current_slide().Rels().add(relationship(notes_.back()->rId(), L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",
|
||||
L"../notesSlides/notesSlide" + std::to_wstring(notes_.size()) + L".xml"));
|
||||
|
||||
get_slide_context().start_slide();
|
||||
|
||||
current_notes().Rels().add(relationship(L"nId1", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide",
|
||||
L"../slides/slide" + std::to_wstring(slides_.size()) + L".xml"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void pptx_conversion_context::end_page_notes()
|
||||
{
|
||||
get_slide_context().serialize_background(current_notes().Background());
|
||||
get_slide_context().serialize_objects(current_notes().Data());
|
||||
|
||||
get_slide_context().dump_rels(current_notes().Rels());//hyperlinks, mediaitems, ...
|
||||
|
||||
get_slide_context().end_slide();
|
||||
}
|
||||
bool pptx_conversion_context::start_master_notes()
|
||||
{
|
||||
create_new_slideNotesMaster( );
|
||||
|
||||
get_slide_context().start_slide();
|
||||
|
||||
process_theme(L"");//add default theme - одинаковые но под разными именами
|
||||
current_notesMaster().add_theme(current_theme().id(), L"tId1");
|
||||
|
||||
get_slide_context().start_slide();
|
||||
return true;
|
||||
}
|
||||
|
||||
void pptx_conversion_context::end_master_notes()
|
||||
{
|
||||
get_slide_context().serialize_background(current_notesMaster().Background());
|
||||
get_slide_context().serialize_objects(current_notesMaster().Data());
|
||||
|
||||
get_slide_context().dump_rels(current_notesMaster().Rels());//hyperlinks, mediaitems, ...
|
||||
|
||||
get_slide_context().end_slide();
|
||||
|
||||
for (size_t i = 0; i < notes_.size(); i++)
|
||||
{
|
||||
notes_[i]->Rels().add(relationship(L"nmId1",
|
||||
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster",
|
||||
L"../notesMasters/notesMaster1.xml"));
|
||||
}
|
||||
}
|
||||
void pptx_conversion_context::end_layout()
|
||||
{
|
||||
get_slide_context().serialize_objects(current_layout().Data());
|
||||
|
||||
@ -88,6 +88,12 @@ public:
|
||||
const std::wstring & pageMasterName);
|
||||
void end_page();
|
||||
|
||||
bool start_page_notes();
|
||||
void end_page_notes();
|
||||
|
||||
bool start_master_notes();
|
||||
void end_master_notes();
|
||||
|
||||
bool start_layout( int layout_index);
|
||||
void end_layout();
|
||||
|
||||
@ -107,10 +113,13 @@ public:
|
||||
return odf_document_;
|
||||
}
|
||||
|
||||
pptx_xml_slide & current_slide();
|
||||
pptx_xml_slideLayout & current_layout();
|
||||
pptx_xml_slideMaster & current_master();
|
||||
pptx_xml_theme & current_theme();
|
||||
pptx_xml_slide & current_slide();
|
||||
pptx_xml_slideLayout & current_layout();
|
||||
pptx_xml_slideMaster & current_master();
|
||||
pptx_xml_theme & current_theme();
|
||||
pptx_xml_slideNotes & current_notes();
|
||||
pptx_xml_slideNotesMaster & current_notesMaster();
|
||||
|
||||
pptx_xml_presentation & current_presentation();//собственно она одна
|
||||
|
||||
oox_chart_context & current_chart();
|
||||
@ -138,6 +147,8 @@ private:
|
||||
void create_new_slide(std::wstring const & name);
|
||||
void create_new_slideLayout(int id);
|
||||
void create_new_slideMaster(int id);
|
||||
void create_new_slideNotes();
|
||||
void create_new_slideNotesMaster();
|
||||
|
||||
package::pptx_document * output_document_;
|
||||
odf_reader::odf_document * odf_document_;
|
||||
@ -152,10 +163,12 @@ private:
|
||||
std::vector<oox_chart_context_ptr> charts_;
|
||||
|
||||
std::vector<pptx_xml_slide_ptr> slides_;
|
||||
std::vector<pptx_xml_slideNotes_ptr> notes_;
|
||||
std::vector<pptx_xml_slideMaster_ptr> slideMasters_;
|
||||
std::vector<pptx_xml_slideLayout_ptr> slideLayouts_;
|
||||
std::vector<pptx_xml_theme_ptr> themes_;
|
||||
|
||||
pptx_xml_slideNotesMaster_ptr slideNotesMaster_;
|
||||
pptx_xml_authors_comments_ptr authors_comments_;
|
||||
pptx_xml_presentation presentation_;
|
||||
|
||||
|
||||
@ -155,8 +155,11 @@ void pptx_serialize_shape(std::wostream & strm, _pptx_drawing & val)
|
||||
odf_reader::GetProperty(val.additional,L"no_rect",bNoRect);
|
||||
|
||||
if (!bNoRect)
|
||||
{
|
||||
val.serialize_xfrm(CP_XML_STREAM(), L"a", true);
|
||||
{
|
||||
if (val.cx != 0 || val.cy != 0) //layout
|
||||
{
|
||||
val.serialize_xfrm(CP_XML_STREAM(), L"a", true);
|
||||
}
|
||||
val.serialize_shape(CP_XML_STREAM());
|
||||
|
||||
oox_serialize_ln(CP_XML_STREAM(), val.additional);
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
std::wstring pptx_xml_slide::name() const
|
||||
{
|
||||
return name_;
|
||||
@ -53,7 +53,7 @@ std::wstring pptx_xml_slide::rId() const
|
||||
|
||||
pptx_xml_slide_ptr pptx_xml_slide::create(std::wstring const & name,int id)
|
||||
{
|
||||
const std::wstring rId = std::wstring(L"sId") + boost::lexical_cast<std::wstring>(id);
|
||||
const std::wstring rId = std::wstring(L"sId") + std::to_wstring(id);
|
||||
return boost::make_shared<pptx_xml_slide>(name,rId);
|
||||
}
|
||||
|
||||
@ -68,15 +68,15 @@ pptx_xml_slide::~pptx_xml_slide()
|
||||
}
|
||||
std::wostream & pptx_xml_slide::Data()
|
||||
{
|
||||
return slideData_;
|
||||
return strmData_;
|
||||
}
|
||||
std::wostream & pptx_xml_slide::Background()
|
||||
{
|
||||
return slideBackground_;
|
||||
return strmBackground_;
|
||||
}
|
||||
std::wostream & pptx_xml_slide::Timing()
|
||||
{
|
||||
return slideTiming_;
|
||||
return strmTiming_;
|
||||
}
|
||||
rels & pptx_xml_slide::Rels()
|
||||
{
|
||||
@ -100,14 +100,14 @@ void pptx_xml_slide::write_to(std::wostream & strm)
|
||||
{
|
||||
CP_XML_ATTR(L"name", name());
|
||||
|
||||
CP_XML_STREAM() << slideBackground_.str();
|
||||
CP_XML_STREAM() << strmBackground_.str();
|
||||
|
||||
CP_XML_NODE(L"p:spTree")
|
||||
{
|
||||
CP_XML_STREAM() << slideData_.str();
|
||||
CP_XML_STREAM() << strmData_.str();
|
||||
}
|
||||
}
|
||||
CP_XML_STREAM() << slideTiming_.str();
|
||||
CP_XML_STREAM() << strmTiming_.str();
|
||||
CP_XML_NODE(L"p:clrMapOvr")
|
||||
{
|
||||
CP_XML_NODE(L"a:masterClrMapping");
|
||||
@ -115,7 +115,7 @@ void pptx_xml_slide::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
std::wstring pptx_xml_slideLayout::rId() const
|
||||
{
|
||||
return rId_;
|
||||
@ -123,7 +123,7 @@ std::wstring pptx_xml_slideLayout::rId() const
|
||||
|
||||
pptx_xml_slideLayout_ptr pptx_xml_slideLayout::create(int id)
|
||||
{
|
||||
const std::wstring rId = std::wstring(L"lrId") + boost::lexical_cast<std::wstring>(id);
|
||||
const std::wstring rId = std::wstring(L"lrId") + std::to_wstring(id);
|
||||
return boost::make_shared<pptx_xml_slideLayout>(rId);
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ pptx_xml_slideLayout::~pptx_xml_slideLayout()
|
||||
}
|
||||
std::wostream & pptx_xml_slideLayout::Data()
|
||||
{
|
||||
return slideLayoutData_;
|
||||
return strmData_;
|
||||
}
|
||||
rels & pptx_xml_slideLayout::Rels()
|
||||
{
|
||||
@ -166,7 +166,7 @@ void pptx_xml_slideLayout::write_to(std::wostream & strm)
|
||||
{
|
||||
CP_XML_NODE(L"p:spTree")
|
||||
{
|
||||
CP_XML_STREAM() << slideLayoutData_.str();
|
||||
CP_XML_STREAM() << strmData_.str();
|
||||
|
||||
//в slideLayoutData_
|
||||
//contentPart (Content Part) §19.3.1.14
|
||||
@ -189,7 +189,7 @@ void pptx_xml_slideLayout::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
std::wstring pptx_xml_slideMaster::rId() const
|
||||
{
|
||||
return rId_;
|
||||
@ -197,7 +197,7 @@ std::wstring pptx_xml_slideMaster::rId() const
|
||||
|
||||
pptx_xml_slideMaster_ptr pptx_xml_slideMaster::create(int id)
|
||||
{
|
||||
const std::wstring rId = std::wstring(L"smId") + boost::lexical_cast<std::wstring>(id);
|
||||
const std::wstring rId = std::wstring(L"smId") + std::to_wstring(id);
|
||||
return boost::make_shared<pptx_xml_slideMaster>(rId,id);
|
||||
}
|
||||
|
||||
@ -212,15 +212,19 @@ pptx_xml_slideMaster::~pptx_xml_slideMaster()
|
||||
}
|
||||
std::wostream & pptx_xml_slideMaster::Data()
|
||||
{
|
||||
return slideMasterData_;
|
||||
return strmData_;
|
||||
}
|
||||
std::wostream & pptx_xml_slideMaster::DataExtra()
|
||||
{
|
||||
return slideMasterDataExtra_;
|
||||
return strmDataExtra_;
|
||||
}
|
||||
std::wostream & pptx_xml_slideMaster::Background()
|
||||
{
|
||||
return slideMasterBackground_;
|
||||
return strmBackground_;
|
||||
}
|
||||
std::wstringstream & pptx_xml_slideMaster::Sizes()
|
||||
{
|
||||
return strmSizes_;
|
||||
}
|
||||
rels & pptx_xml_slideMaster::Rels()
|
||||
{
|
||||
@ -229,7 +233,7 @@ rels & pptx_xml_slideMaster::Rels()
|
||||
void pptx_xml_slideMaster::add_theme(int id, const std::wstring & tId)
|
||||
{
|
||||
rels_.add(relationship( tId, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
|
||||
std::wstring(L"../theme/theme") + boost::lexical_cast<std::wstring>(id) + L".xml"));
|
||||
std::wstring(L"../theme/theme") + std::to_wstring(id) + L".xml"));
|
||||
}
|
||||
|
||||
void pptx_xml_slideMaster::add_layout(int id, const std::wstring & rId, const unsigned int & uniqId)
|
||||
@ -237,7 +241,7 @@ void pptx_xml_slideMaster::add_layout(int id, const std::wstring & rId, const un
|
||||
layoutsId_.push_back(std::pair<std::wstring, unsigned int>(rId, uniqId));
|
||||
|
||||
rels_.add(relationship( rId,L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",
|
||||
std::wstring(L"../slideLayouts/slideLayout") + boost::lexical_cast<std::wstring>(id) + L".xml"));
|
||||
std::wstring(L"../slideLayouts/slideLayout") + std::to_wstring(id) + L".xml"));
|
||||
}
|
||||
|
||||
void pptx_xml_slideMaster::write_to(std::wostream & strm)
|
||||
@ -255,11 +259,11 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
|
||||
|
||||
CP_XML_NODE(L"p:cSld")
|
||||
{
|
||||
CP_XML_STREAM() << slideMasterBackground_.str();
|
||||
CP_XML_STREAM() << strmBackground_.str();
|
||||
|
||||
CP_XML_NODE(L"p:spTree")
|
||||
{
|
||||
CP_XML_STREAM() << slideMasterData_.str();
|
||||
CP_XML_STREAM() << strmData_.str();
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"p:clrMap")
|
||||
@ -288,7 +292,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
CP_XML_STREAM() << slideMasterDataExtra_.str();
|
||||
CP_XML_STREAM() << strmDataExtra_.str();
|
||||
CP_XML_NODE(L"p:txStyles")
|
||||
{
|
||||
CP_XML_NODE(L"p:titleStyle");
|
||||
@ -299,6 +303,7 @@ void pptx_xml_slideMaster::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
pptx_xml_theme_ptr pptx_xml_theme::create(std::wstring const & name,int id)
|
||||
{
|
||||
return boost::make_shared<pptx_xml_theme>(name,id);
|
||||
@ -336,6 +341,7 @@ void pptx_xml_theme::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
pptx_xml_authors_comments_ptr pptx_xml_authors_comments::create()
|
||||
{
|
||||
return boost::make_shared<pptx_xml_authors_comments>();
|
||||
@ -399,6 +405,7 @@ void pptx_xml_authors_comments::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
void pptx_xml_presentation::write_to(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
@ -412,14 +419,18 @@ void pptx_xml_presentation::write_to(std::wostream & strm)
|
||||
CP_XML_NODE(L"p:sldMasterIdLst")
|
||||
{
|
||||
CP_XML_STREAM() << slideMastersData_.str();
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"p:notesMasterIdLst")
|
||||
{
|
||||
CP_XML_STREAM() << slideNotesMastersData_.str();
|
||||
}
|
||||
CP_XML_NODE(L"p:sldIdLst")
|
||||
{
|
||||
CP_XML_STREAM() << slidesData_.str();
|
||||
}
|
||||
CP_XML_STREAM() << slidesProperties_.str();
|
||||
|
||||
CP_XML_STREAM() << notesSlidesSize_.str();
|
||||
CP_XML_STREAM() << slidesNotesProperties_.str();
|
||||
|
||||
CP_XML_NODE(L"p:defaultTextStyle")//??
|
||||
{
|
||||
@ -428,5 +439,155 @@ void pptx_xml_presentation::write_to(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
std::wstring pptx_xml_slideNotes::rId() const
|
||||
{
|
||||
return rId_;
|
||||
}
|
||||
|
||||
pptx_xml_slideNotes_ptr pptx_xml_slideNotes::create(int id)
|
||||
{
|
||||
const std::wstring rId = std::wstring(L"nId") + std::to_wstring(id);
|
||||
return boost::make_shared<pptx_xml_slideNotes>(rId);
|
||||
}
|
||||
|
||||
pptx_xml_slideNotes::pptx_xml_slideNotes(std::wstring const & id)
|
||||
{
|
||||
rId_ = id;
|
||||
}
|
||||
|
||||
pptx_xml_slideNotes::~pptx_xml_slideNotes()
|
||||
{
|
||||
}
|
||||
std::wostream & pptx_xml_slideNotes::Data()
|
||||
{
|
||||
return strmData_;
|
||||
}
|
||||
std::wostream & pptx_xml_slideNotes::Background()
|
||||
{
|
||||
return strmBackground_;
|
||||
}
|
||||
|
||||
rels & pptx_xml_slideNotes::Rels()
|
||||
{
|
||||
return rels_;
|
||||
}
|
||||
|
||||
void pptx_xml_slideNotes::write_to(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"p:notes")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:a", L"http://schemas.openxmlformats.org/drawingml/2006/main");
|
||||
CP_XML_ATTR(L"xmlns:p", L"http://schemas.openxmlformats.org/presentationml/2006/main");
|
||||
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
CP_XML_ATTR(L"xmlns:p14", L"http://schemas.microsoft.com/office/powerpoint/2010/main");
|
||||
CP_XML_ATTR(L"xmlns:p15", L"http://schemas.microsoft.com/office/powerpoint/2012/main");
|
||||
CP_XML_ATTR(L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006");
|
||||
|
||||
CP_XML_NODE(L"p:cSld")
|
||||
{
|
||||
CP_XML_STREAM() << strmBackground_.str();
|
||||
|
||||
CP_XML_NODE(L"p:spTree")
|
||||
{
|
||||
CP_XML_STREAM() << strmData_.str();
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"p:clrMapOvr")
|
||||
{
|
||||
CP_XML_NODE(L"a:masterClrMapping");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
std::wstring pptx_xml_slideNotesMaster::rId() const
|
||||
{
|
||||
return rId_;
|
||||
}
|
||||
|
||||
pptx_xml_slideNotesMaster_ptr pptx_xml_slideNotesMaster::create()
|
||||
{
|
||||
const std::wstring rId = std::wstring(L"nmId1");
|
||||
return boost::make_shared<pptx_xml_slideNotesMaster>(rId, 1);
|
||||
}
|
||||
|
||||
pptx_xml_slideNotesMaster::pptx_xml_slideNotesMaster(std::wstring const & rId, int id)
|
||||
{
|
||||
rId_ = rId;
|
||||
id_ = id;
|
||||
}
|
||||
|
||||
pptx_xml_slideNotesMaster::~pptx_xml_slideNotesMaster()
|
||||
{
|
||||
}
|
||||
std::wostream & pptx_xml_slideNotesMaster::Data()
|
||||
{
|
||||
return strmData_;
|
||||
}
|
||||
std::wostream & pptx_xml_slideNotesMaster::Background()
|
||||
{
|
||||
return strmBackground_;
|
||||
}
|
||||
std::wostream & pptx_xml_slideNotesMaster::Sizes()
|
||||
{
|
||||
return strmSizes_;
|
||||
}
|
||||
rels & pptx_xml_slideNotesMaster::Rels()
|
||||
{
|
||||
return rels_;
|
||||
}
|
||||
void pptx_xml_slideNotesMaster::add_theme(int id, const std::wstring & tId)
|
||||
{
|
||||
rels_.add(relationship( tId, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
|
||||
std::wstring(L"../theme/theme") + std::to_wstring(id) + L".xml"));
|
||||
}
|
||||
|
||||
void pptx_xml_slideNotesMaster::write_to(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"p:notesMaster")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:a", L"http://schemas.openxmlformats.org/drawingml/2006/main");
|
||||
CP_XML_ATTR(L"xmlns:p", L"http://schemas.openxmlformats.org/presentationml/2006/main");
|
||||
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
CP_XML_ATTR(L"xmlns:p14", L"http://schemas.microsoft.com/office/powerpoint/2010/main");
|
||||
CP_XML_ATTR(L"xmlns:p15", L"http://schemas.microsoft.com/office/powerpoint/2012/main");
|
||||
CP_XML_ATTR(L"xmlns:mc", L"http://schemas.openxmlformats.org/markup-compatibility/2006");
|
||||
|
||||
CP_XML_NODE(L"p:cSld")
|
||||
{
|
||||
CP_XML_STREAM() << strmBackground_.str();
|
||||
|
||||
CP_XML_NODE(L"p:spTree")
|
||||
{
|
||||
CP_XML_STREAM() << strmData_.str();
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"p:clrMap")
|
||||
{
|
||||
CP_XML_ATTR(L"folHlink",L"folHlink");
|
||||
CP_XML_ATTR(L"hlink",L"hlink");
|
||||
CP_XML_ATTR(L"accent6",L"accent6");
|
||||
CP_XML_ATTR(L"accent5",L"accent5");
|
||||
CP_XML_ATTR(L"accent4",L"accent4");
|
||||
CP_XML_ATTR(L"accent3",L"accent5");
|
||||
CP_XML_ATTR(L"accent2",L"accent2");
|
||||
CP_XML_ATTR(L"accent1",L"accent1");
|
||||
CP_XML_ATTR(L"tx2",L"dk2");
|
||||
CP_XML_ATTR(L"tx1",L"dk1");
|
||||
CP_XML_ATTR(L"bg2",L"lt2");
|
||||
CP_XML_ATTR(L"bg1",L"lt1");
|
||||
}
|
||||
CP_XML_NODE(L"p:notesStyle")
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ class pptx_xml_slide: noncopyable
|
||||
public:
|
||||
pptx_xml_slide(std::wstring const & name,std::wstring const & id);
|
||||
~pptx_xml_slide();
|
||||
public:
|
||||
|
||||
std::wstring name() const;
|
||||
std::wstring rId() const;
|
||||
|
||||
@ -65,41 +65,68 @@ public:
|
||||
|
||||
private:
|
||||
std::wstring name_;
|
||||
std::wstringstream slideData_;
|
||||
std::wstringstream slideBackground_;
|
||||
std::wstringstream slideTiming_;
|
||||
std::wstringstream strmData_;
|
||||
std::wstringstream strmBackground_;
|
||||
std::wstringstream strmTiming_;
|
||||
std::wstring rId_;
|
||||
|
||||
rels rels_;
|
||||
};
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_slideNotes;
|
||||
typedef _CP_PTR(pptx_xml_slideNotes) pptx_xml_slideNotes_ptr;
|
||||
|
||||
class pptx_xml_slideNotes: noncopyable
|
||||
{
|
||||
public:
|
||||
pptx_xml_slideNotes(std::wstring const & id);
|
||||
~pptx_xml_slideNotes();
|
||||
|
||||
std::wstring rId() const;
|
||||
|
||||
std::wostream & Data();
|
||||
std::wostream & Background();
|
||||
|
||||
rels & Rels();
|
||||
|
||||
void write_to(std::wostream & strm);
|
||||
|
||||
static pptx_xml_slideNotes_ptr create(int id);
|
||||
|
||||
private:
|
||||
std::wstringstream strmData_;
|
||||
std::wstringstream strmBackground_;
|
||||
std::wstring rId_;
|
||||
|
||||
rels rels_;
|
||||
};
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_presentation: noncopyable
|
||||
{
|
||||
public:
|
||||
pptx_xml_presentation(){}
|
||||
~pptx_xml_presentation(){}
|
||||
|
||||
std::wstringstream & slidesData(){return slidesData_;}
|
||||
std::wstringstream & slideMastersData(){return slideMastersData_;}
|
||||
std::wstringstream & notesSlidesData(){return notesSlidesData_;}
|
||||
std::wstringstream & slidesData() {return slidesData_;}
|
||||
std::wstringstream & slideMastersData() {return slideMastersData_;}
|
||||
std::wstringstream & slideNotesMastersData() {return slideNotesMastersData_;}
|
||||
|
||||
std::wstringstream & slidesProperties(){return slidesProperties_;}
|
||||
std::wstringstream & notesSlidesSize(){return notesSlidesSize_;}
|
||||
std::wstringstream & slidesProperties() {return slidesProperties_;}
|
||||
std::wstringstream & slidesNotesProperties() {return slidesNotesProperties_;}
|
||||
|
||||
void write_to(std::wostream & strm);
|
||||
|
||||
private:
|
||||
std::wstringstream slidesProperties_;
|
||||
std::wstringstream notesSlidesSize_;
|
||||
|
||||
std::wstringstream slidesNotesProperties_;
|
||||
|
||||
std::wstringstream slidesData_;
|
||||
std::wstringstream slideMastersData_;
|
||||
std::wstringstream notesSlidesData_;
|
||||
std::wstringstream handoutMasterData_;
|
||||
std::wstringstream slideNotesMastersData_;
|
||||
std::wstringstream slideHandoutMasterData_;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_slideLayout;
|
||||
typedef _CP_PTR(pptx_xml_slideLayout) pptx_xml_slideLayout_ptr;
|
||||
|
||||
@ -121,12 +148,12 @@ public:
|
||||
static pptx_xml_slideLayout_ptr create(int id);
|
||||
|
||||
private:
|
||||
std::wstringstream slideLayoutData_;
|
||||
std::wstringstream strmData_;
|
||||
std::wstring rId_;
|
||||
|
||||
rels rels_;
|
||||
};
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_slideMaster;
|
||||
typedef _CP_PTR(pptx_xml_slideMaster) pptx_xml_slideMaster_ptr;
|
||||
|
||||
@ -135,12 +162,13 @@ class pptx_xml_slideMaster: noncopyable
|
||||
public:
|
||||
pptx_xml_slideMaster(std::wstring const & rId, int id);
|
||||
~pptx_xml_slideMaster();
|
||||
public:
|
||||
|
||||
std::wstring rId() const;
|
||||
|
||||
std::wostream & Data();
|
||||
std::wostream & DataExtra();
|
||||
std::wostream & Background();
|
||||
std::wostream & Data();
|
||||
std::wostream & DataExtra();
|
||||
std::wostream & Background();
|
||||
std::wstringstream & Sizes();
|
||||
rels & Rels();
|
||||
|
||||
void add_layout(int id, const std::wstring & rId, const unsigned int & uniqId);
|
||||
@ -151,9 +179,10 @@ public:
|
||||
static pptx_xml_slideMaster_ptr create(int id);
|
||||
|
||||
private:
|
||||
std::wstringstream slideMasterData_;
|
||||
std::wstringstream slideMasterDataExtra_;
|
||||
std::wstringstream slideMasterBackground_;
|
||||
std::wstringstream strmData_;
|
||||
std::wstringstream strmDataExtra_;
|
||||
std::wstringstream strmBackground_;
|
||||
std::wstringstream strmSizes_;
|
||||
|
||||
std::vector<std::pair<std::wstring, unsigned int>> layoutsId_;
|
||||
std::wstring rId_;
|
||||
@ -163,7 +192,42 @@ private:
|
||||
|
||||
rels rels_;
|
||||
};
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_slideNotesMaster;
|
||||
typedef _CP_PTR(pptx_xml_slideNotesMaster) pptx_xml_slideNotesMaster_ptr;
|
||||
|
||||
class pptx_xml_slideNotesMaster: noncopyable
|
||||
{
|
||||
public:
|
||||
pptx_xml_slideNotesMaster(std::wstring const & rId, int id);
|
||||
~pptx_xml_slideNotesMaster();
|
||||
|
||||
std::wstring rId() const;
|
||||
|
||||
std::wostream & Data();
|
||||
std::wostream & Background();
|
||||
std::wostream & Sizes();
|
||||
rels & Rels();
|
||||
|
||||
void add_theme(int id, const std::wstring & tId);
|
||||
|
||||
void write_to(std::wostream & strm);
|
||||
|
||||
static pptx_xml_slideNotesMaster_ptr create();
|
||||
|
||||
private:
|
||||
std::wstringstream strmData_;
|
||||
std::wstringstream strmBackground_;
|
||||
std::wstringstream strmSizes_;
|
||||
|
||||
std::wstring rId_;
|
||||
int id_;
|
||||
|
||||
std::wstring themeId_;
|
||||
|
||||
rels rels_;
|
||||
};
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_theme;
|
||||
typedef _CP_PTR(pptx_xml_theme) pptx_xml_theme_ptr;
|
||||
|
||||
@ -192,7 +256,7 @@ private:
|
||||
std::wstring name_;
|
||||
int id_;
|
||||
};
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------------
|
||||
class pptx_xml_authors_comments;
|
||||
typedef _CP_PTR(pptx_xml_authors_comments) pptx_xml_authors_comments_ptr;
|
||||
|
||||
|
||||
@ -105,10 +105,11 @@ void slide_content::add_rels(rels & _r)
|
||||
rels_->get_rels().add(r[i]);
|
||||
}
|
||||
}
|
||||
////////////
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
slides_files::slides_files()
|
||||
{}
|
||||
{
|
||||
rels_ = NULL;
|
||||
}
|
||||
|
||||
void slides_files::add_slide(slide_content_ptr slide)
|
||||
{
|
||||
@ -127,13 +128,13 @@ void slides_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (!slides_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"slide") + boost::lexical_cast<std::wstring>( i + 1 ) + L".xml";
|
||||
const std::wstring fileName = std::wstring(L"slide") + std::to_wstring( i + 1 ) + L".xml";
|
||||
|
||||
contentTypes->add_override(std::wstring(L"/ppt/slides/") + fileName, kWSConType);
|
||||
|
||||
if (rels_)
|
||||
{
|
||||
const std::wstring id = std::wstring(L"sId") + boost::lexical_cast<std::wstring>( i + 1);
|
||||
const std::wstring id = std::wstring(L"sId") + std::to_wstring( i + 1);
|
||||
static const std::wstring kWSRel = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide";
|
||||
const std::wstring fileRef = std::wstring(L"slides/") + fileName;
|
||||
rels_->add(id, kWSRel, fileRef);
|
||||
@ -149,7 +150,42 @@ void slides_files::write(const std::wstring & RootPath)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////
|
||||
//---------------------------------------------------------------------------
|
||||
void notes_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"notesSlides" ;
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
content_type_content * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
static const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml";
|
||||
|
||||
for (int i = 0; i < slides_.size(); i++)
|
||||
{
|
||||
if (!slides_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"notesSlide") + std::to_wstring( i + 1 ) + L".xml";
|
||||
|
||||
contentTypes->add_override(std::wstring(L"/ppt/notesSlides/") + fileName, kWSConType);
|
||||
|
||||
if (rels_)
|
||||
{
|
||||
const std::wstring id = std::wstring(L"nId") + std::to_wstring( i + 1);
|
||||
static const std::wstring kWSRel = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide";
|
||||
const std::wstring fileRef = std::wstring(L"notesSlides/") + fileName;
|
||||
rels_->add(id, kWSRel, fileRef);
|
||||
}
|
||||
|
||||
slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//внитренние релсы
|
||||
|
||||
rels_files relFiles;
|
||||
relFiles.add_rel_file(slides_[i]->get_rel_file());
|
||||
relFiles.write(path);
|
||||
|
||||
package::simple_element(fileName, slides_[i]->str()).write(path);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
slideMasters_files::slideMasters_files()
|
||||
{}
|
||||
|
||||
@ -170,12 +206,12 @@ void slideMasters_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (!slides_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"slideMaster") + boost::lexical_cast<std::wstring>( i + 1 ) + L".xml";
|
||||
const std::wstring fileName = std::wstring(L"slideMaster") + std::to_wstring( i + 1 ) + L".xml";
|
||||
contentTypes->add_override(std::wstring(L"/ppt/slideMasters/") + fileName, kWSConType);
|
||||
|
||||
if (rels_)
|
||||
{
|
||||
const std::wstring id = std::wstring(L"smId") + boost::lexical_cast<std::wstring>( i + 1);
|
||||
const std::wstring id = std::wstring(L"smId") + std::to_wstring( i + 1);
|
||||
static const std::wstring kWSRel = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster";
|
||||
const std::wstring fileRef = std::wstring(L"slideMasters/") + fileName;
|
||||
rels_->add(id, kWSRel, fileRef);
|
||||
@ -191,7 +227,41 @@ void slideMasters_files::write(const std::wstring & RootPath)
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////
|
||||
//---------------------------------------------------------------------------
|
||||
void notesMaster_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"notesMasters" ;
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
content_type_content * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
static const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml";
|
||||
|
||||
for (int i = 0; i < slides_.size(); i++)
|
||||
{
|
||||
if (!slides_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"notesMaster") + std::to_wstring( i + 1 ) + L".xml";
|
||||
contentTypes->add_override(std::wstring(L"/ppt/notesMasters/") + fileName, kWSConType);
|
||||
|
||||
if (rels_)
|
||||
{
|
||||
const std::wstring id = std::wstring(L"nmId") + std::to_wstring( i + 1);
|
||||
static const std::wstring kWSRel = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster";
|
||||
const std::wstring fileRef = std::wstring(L"notesMasters/") + fileName;
|
||||
rels_->add(id, kWSRel, fileRef);
|
||||
}
|
||||
|
||||
slides_[i]->get_rel_file()->set_file_name(fileName + L".rels");//внитренние релсы
|
||||
|
||||
rels_files relFiles;
|
||||
relFiles.add_rel_file(slides_[i]->get_rel_file());
|
||||
relFiles.write(path);
|
||||
|
||||
package::simple_element(fileName, slides_[i]->str()).write(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
slideLayouts_files::slideLayouts_files()
|
||||
{}
|
||||
|
||||
@ -209,7 +279,7 @@ void slideLayouts_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (!slides_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"slideLayout") + boost::lexical_cast<std::wstring>( i + 1 ) + L".xml";
|
||||
const std::wstring fileName = std::wstring(L"slideLayout") + std::to_wstring( i + 1 ) + L".xml";
|
||||
const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml";
|
||||
|
||||
content_type_content * contentTypes = get_main_document()->get_content_types_file().content();
|
||||
@ -225,7 +295,7 @@ void slideLayouts_files::write(const std::wstring & RootPath)
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------------
|
||||
authors_comments_element::authors_comments_element(pptx_xml_authors_comments_ptr & authors_comments) : authors_comments_(authors_comments)
|
||||
{
|
||||
}
|
||||
@ -261,7 +331,7 @@ void ppt_charts_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (!charts_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"chart") + boost::lexical_cast<std::wstring>( i + 1 ) + L".xml";
|
||||
const std::wstring fileName = std::wstring(L"chart") + std::to_wstring( i + 1 ) + L".xml";
|
||||
content_type_content * contentTypes = get_main_document()->get_content_types_file().content();
|
||||
|
||||
static const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.drawingml.chart+xml";
|
||||
@ -291,7 +361,7 @@ void ppt_themes_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (!themes_[i]) continue;
|
||||
|
||||
const std::wstring fileName = std::wstring(L"theme") + boost::lexical_cast<std::wstring>( i + 1) + L".xml";
|
||||
const std::wstring fileName = std::wstring(L"theme") + std::to_wstring( i + 1) + L".xml";
|
||||
const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.theme+xml";
|
||||
|
||||
content_type_content * contentTypes = get_main_document()->get_content_types_file().content();
|
||||
@ -345,6 +415,12 @@ void ppt_files::write(const std::wstring & RootPath)
|
||||
slideMasters_files_.set_main_document( this->get_main_document() );
|
||||
slideMasters_files_.write(path);
|
||||
|
||||
notes_files_.set_main_document( this->get_main_document() );
|
||||
notes_files_.write(path);
|
||||
|
||||
notesMaster_files_.set_rels(&rels_files_);
|
||||
notesMaster_files_.set_main_document( this->get_main_document() );
|
||||
notesMaster_files_.write(path);
|
||||
|
||||
//rels_files_.add( relationship( L"hId1", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", L"ppt/presentation.xml" ) );
|
||||
|
||||
@ -412,6 +488,10 @@ void ppt_files::add_slide(slide_content_ptr slide)
|
||||
{
|
||||
slides_files_.add_slide(slide);
|
||||
}
|
||||
void ppt_files::add_notes(slide_content_ptr slide)
|
||||
{
|
||||
notes_files_.add_slide(slide);
|
||||
}
|
||||
void ppt_files::add_slideLayout(slide_content_ptr slide)
|
||||
{
|
||||
slideLayouts_files_.add_slide(slide);
|
||||
@ -420,7 +500,10 @@ void ppt_files::add_slideMaster(slide_content_ptr slide)
|
||||
{
|
||||
slideMasters_files_.add_slide(slide);
|
||||
}
|
||||
|
||||
void ppt_files::add_notesMaster(slide_content_ptr slide)
|
||||
{
|
||||
notesMaster_files_.add_slide(slide);
|
||||
}
|
||||
void ppt_files::set_media(mediaitems & _Mediaitems, CApplicationFonts *pAppFonts)
|
||||
{
|
||||
if (_Mediaitems.count_image + _Mediaitems.count_media > 0)
|
||||
|
||||
@ -41,8 +41,10 @@ namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
class pptx_xml_presentation;
|
||||
|
||||
class pptx_xml_theme;
|
||||
typedef _CP_PTR(pptx_xml_theme) pptx_xml_theme_ptr;
|
||||
|
||||
class pptx_xml_authors_comments;
|
||||
typedef _CP_PTR(pptx_xml_authors_comments) pptx_xml_authors_comments_ptr;
|
||||
|
||||
@ -55,7 +57,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------
|
||||
class slide_content;
|
||||
typedef _CP_PTR(slide_content) slide_content_ptr;
|
||||
|
||||
@ -72,11 +74,10 @@ public:
|
||||
static _CP_PTR(slide_content) create();
|
||||
|
||||
private:
|
||||
std::wstringstream content_;
|
||||
rels_file_ptr rels_;
|
||||
std::wstringstream content_;
|
||||
rels_file_ptr rels_;
|
||||
};
|
||||
|
||||
// slides_files
|
||||
//------------------------------------------------------------------------------
|
||||
class slides_files : public element
|
||||
{
|
||||
public:
|
||||
@ -92,12 +93,18 @@ public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
void set_slide_ref(const std::wstring & ref_file_path,const std::wstring & ref_file_name);
|
||||
|
||||
public:
|
||||
std::vector<slide_content_ptr> slides_;
|
||||
rels_files * rels_;
|
||||
|
||||
};
|
||||
// slideLayouts_files
|
||||
//------------------------------------------------------------------------------
|
||||
class notes_files : public slides_files
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
class slideLayouts_files : public element
|
||||
{
|
||||
public:
|
||||
@ -107,12 +114,9 @@ public:
|
||||
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
public:
|
||||
std::vector<slide_content_ptr> slides_;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
class authors_comments_element : public element
|
||||
{
|
||||
public:
|
||||
@ -123,9 +127,7 @@ private:
|
||||
pptx_xml_authors_comments_ptr & authors_comments_;
|
||||
|
||||
};
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// slideMasters_files
|
||||
//------------------------------------------------------------------------------
|
||||
class slideMasters_files : public element
|
||||
{
|
||||
public:
|
||||
@ -140,16 +142,19 @@ public:
|
||||
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
public:
|
||||
std::vector<slide_content_ptr> slides_;
|
||||
rels_files * rels_;
|
||||
};
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
class notesMaster_files : public slideMasters_files
|
||||
{
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
};
|
||||
//------------------------------------------------------------------------------
|
||||
class ppt_comments_files;
|
||||
typedef _CP_PTR(ppt_comments_files) ppt_comments_files_ptr;
|
||||
|
||||
// ppt_comments
|
||||
class ppt_comments_files: public element
|
||||
{
|
||||
public:
|
||||
@ -165,9 +170,7 @@ private:
|
||||
const std::vector<pptx_comment_elm> & comments_;
|
||||
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ppt_charts_files
|
||||
//------------------------------------------------------------------------------
|
||||
class ppt_charts_files : public element
|
||||
{
|
||||
public:
|
||||
@ -179,8 +182,8 @@ public:
|
||||
std::vector<chart_content_ptr> charts_;
|
||||
|
||||
};
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ppt_theme_files
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class ppt_themes_files : public element
|
||||
{
|
||||
public:
|
||||
@ -192,13 +195,12 @@ public:
|
||||
std::vector<pptx_xml_theme_ptr> themes_;
|
||||
|
||||
};
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------------------------------
|
||||
class ppt_files : public element
|
||||
{
|
||||
public:
|
||||
ppt_files();
|
||||
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
void set_presentation(pptx_xml_presentation & presentation);
|
||||
@ -206,9 +208,11 @@ public:
|
||||
void set_styles(element_ptr Element);
|
||||
void set_comments(element_ptr Element);
|
||||
|
||||
void add_slide(slide_content_ptr sheet);
|
||||
void add_slide (slide_content_ptr sheet);
|
||||
void add_slideLayout(slide_content_ptr sheet);
|
||||
void add_slideMaster(slide_content_ptr sheet);
|
||||
void add_notes (slide_content_ptr sheet);
|
||||
void add_notesMaster(slide_content_ptr sheet);
|
||||
|
||||
void set_media(mediaitems & _Mediaitems, CApplicationFonts *pAppFonts);
|
||||
void add_charts(chart_content_ptr chart);
|
||||
@ -217,25 +221,21 @@ public:
|
||||
void set_authors_comments(pptx_xml_authors_comments_ptr & authors_comments);
|
||||
|
||||
private:
|
||||
rels_files rels_files_;
|
||||
rels_files rels_files_;
|
||||
|
||||
slides_files slides_files_;
|
||||
slideLayouts_files slideLayouts_files_;
|
||||
slideMasters_files slideMasters_files_;
|
||||
slides_files slides_files_;
|
||||
slideLayouts_files slideLayouts_files_;
|
||||
slideMasters_files slideMasters_files_;
|
||||
notes_files notes_files_;
|
||||
notesMaster_files notesMaster_files_;
|
||||
|
||||
//slides_files handoutMasters_files_;
|
||||
ppt_themes_files themes_files_;
|
||||
|
||||
ppt_charts_files charts_files_;
|
||||
//slides_files notesSlides_files_;
|
||||
//slides_files notesMasters_files_;
|
||||
//slides_files handoutMasters_files_;
|
||||
|
||||
element_ptr authors_comments_;
|
||||
|
||||
element_ptr authors_comments_;
|
||||
element_ptr presentation_;
|
||||
|
||||
element_ptr tableStyles_;
|
||||
|
||||
element_ptr comments_;
|
||||
element_ptr media_;
|
||||
element_ptr embeddings_;
|
||||
@ -247,7 +247,6 @@ class pptx_document : public document
|
||||
public:
|
||||
pptx_document();
|
||||
|
||||
public:
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
virtual content_types_file & get_content_types_file() { return content_type_file_; }
|
||||
|
||||
@ -53,7 +53,6 @@ typedef _CP_PTR(pptx_drawings) pptx_drawings_ptr;
|
||||
class pptx_slide_context::Impl
|
||||
{
|
||||
public:
|
||||
|
||||
struct _transition
|
||||
{
|
||||
bool Enabled;
|
||||
@ -66,7 +65,7 @@ public:
|
||||
bool onClick;
|
||||
};
|
||||
|
||||
Impl(const std::wstring & odfPacket) : mediaitems_(odfPacket),odfPacket_(odfPacket)
|
||||
Impl(const std::wstring & odfPacket) : mediaitems_(odfPacket), odfPacket_(odfPacket)
|
||||
{
|
||||
clear();
|
||||
}
|
||||
@ -75,24 +74,17 @@ public:
|
||||
std::vector<drawing_object_description> objects_;
|
||||
|
||||
_CP_OPT(_oox_fill) background_fill_;
|
||||
|
||||
_transition transition_;
|
||||
bool use_image_replacement_;
|
||||
|
||||
bool header, footer, date_time, slideNum;
|
||||
|
||||
void add_drawing(_pptx_drawing const & d,
|
||||
bool isInternal,
|
||||
std::wstring const & rid,
|
||||
std::wstring const & ref,
|
||||
RelsType type)
|
||||
void add_drawing(_pptx_drawing const & d, bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type)
|
||||
{
|
||||
pptx_drawings_->add(d, isInternal, rid, ref, type);
|
||||
}
|
||||
void add_additional_rels(
|
||||
bool isInternal,
|
||||
std::wstring const & rid,
|
||||
std::wstring const & ref,
|
||||
RelsType type)
|
||||
void add_additional_rels (bool isInternal, std::wstring const & rid, std::wstring const & ref, RelsType type)
|
||||
{
|
||||
pptx_drawings_->add(isInternal, rid, ref, type);
|
||||
}
|
||||
@ -107,16 +99,16 @@ public:
|
||||
{
|
||||
objects_.clear();
|
||||
|
||||
background_fill_ = boost::none;
|
||||
background_fill_ = boost::none;
|
||||
|
||||
header=false;
|
||||
footer=false;
|
||||
date_time=false;
|
||||
slideNum=false;
|
||||
header = false;
|
||||
footer = false;
|
||||
date_time = false;
|
||||
slideNum = false;
|
||||
|
||||
rId_ = 1;
|
||||
|
||||
pptx_drawings_ = pptx_drawings::create();
|
||||
pptx_drawings_ = pptx_drawings::create();
|
||||
|
||||
transition_.Enabled = false;
|
||||
transition_.Speed = boost::none;
|
||||
@ -127,7 +119,6 @@ public:
|
||||
{
|
||||
return rId_++;;
|
||||
}
|
||||
|
||||
pptx_drawings_ptr get_drawings()
|
||||
{
|
||||
return pptx_drawings_;
|
||||
@ -137,7 +128,7 @@ public:
|
||||
void process_drawings();
|
||||
|
||||
private:
|
||||
void process_common_properties(drawing_object_description& obj,_pptx_drawing & drawing);
|
||||
void process_common_properties(drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
|
||||
void process_shape (drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
void process_image (drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
@ -145,14 +136,15 @@ private:
|
||||
void process_table (drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
void process_object (drawing_object_description& obj, _pptx_drawing & drawing);
|
||||
|
||||
size_t rId_;
|
||||
mediaitems mediaitems_;
|
||||
pptx_drawings_ptr pptx_drawings_;
|
||||
size_t rId_;
|
||||
mediaitems mediaitems_;
|
||||
pptx_drawings_ptr pptx_drawings_;
|
||||
pptx_drawings_ptr pptx_notes_drawings_;
|
||||
};
|
||||
|
||||
void pptx_slide_context::Impl::process_drawings()
|
||||
{
|
||||
for (int i = 0; i < objects_.size(); i++)
|
||||
for (size_t i = 0; i < objects_.size(); i++)
|
||||
{
|
||||
_pptx_drawing drawing =_pptx_drawing();
|
||||
|
||||
@ -175,17 +167,19 @@ void pptx_slide_context::Impl::process_drawings()
|
||||
}
|
||||
|
||||
pptx_slide_context::pptx_slide_context(pptx_conversion_context & Context)
|
||||
: impl_(new pptx_slide_context::Impl(Context.root()->get_folder()))
|
||||
: impl_(new pptx_slide_context::Impl(Context.root()->get_folder()))
|
||||
{
|
||||
hlinks_size_ = 0;
|
||||
hlinks_size_ = 0;
|
||||
}
|
||||
void pptx_slide_context::start_slide()
|
||||
{
|
||||
impl_->clear(); // objects
|
||||
hlinks_size_ = 0;
|
||||
|
||||
hlinks_size_ = 0;
|
||||
|
||||
default_set(); //for current object
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void pptx_slide_context::start_slide_animation()
|
||||
{
|
||||
@ -202,10 +196,10 @@ void pptx_slide_context::start_slide_animation()
|
||||
|
||||
void pptx_slide_context::set_transitionFilter(std::wstring & type,_CP_OPT(std::wstring) & dir,_CP_OPT(std::wstring) & dop,_CP_OPT(int) & time)
|
||||
{
|
||||
impl_->transition_.Type = type;
|
||||
impl_->transition_.Time = time; // не путать длительность перехода с длительностью эффекта перехода (в oo его нет)
|
||||
impl_->transition_.Dir = dir;
|
||||
impl_->transition_.Param = dop;
|
||||
impl_->transition_.Type = type;
|
||||
impl_->transition_.Time = time; // не путать длительность перехода с длительностью эффекта перехода (в oo его нет)
|
||||
impl_->transition_.Dir = dir;
|
||||
impl_->transition_.Param = dop;
|
||||
}
|
||||
|
||||
void pptx_slide_context::set_transitionAction(bool val)
|
||||
@ -215,8 +209,8 @@ void pptx_slide_context::set_transitionAction(bool val)
|
||||
|
||||
void pptx_slide_context::set_transitionSpeed(std::wstring val)
|
||||
{
|
||||
if (val == L"medium")impl_->transition_.Speed=L"med";
|
||||
else impl_->transition_.Speed= val;//fast / slow
|
||||
if (val == L"medium") impl_->transition_.Speed = L"med";
|
||||
else impl_->transition_.Speed = val;//fast / slow
|
||||
}
|
||||
|
||||
|
||||
@ -227,6 +221,7 @@ void pptx_slide_context::default_set()
|
||||
impl_->object_description_.name_ = L"";
|
||||
impl_->object_description_.descriptor_ = L"";
|
||||
impl_->object_description_.anchor_ = L"";
|
||||
|
||||
impl_->object_description_.additional_.clear();
|
||||
|
||||
impl_->object_description_.clipping_string_= L"";
|
||||
@ -247,10 +242,10 @@ void pptx_slide_context::set_use_image_replacement()
|
||||
|
||||
void pptx_slide_context::set_placeHolder_type(std::wstring typeHolder)
|
||||
{
|
||||
if (typeHolder == L"ftr") impl_->footer= true;
|
||||
if (typeHolder == L"hdr") impl_->header= true;
|
||||
if (typeHolder == L"dt") impl_->date_time= true;
|
||||
if (typeHolder == L"sldNum")impl_->slideNum= true;
|
||||
if (typeHolder == L"ftr") impl_->footer = true;
|
||||
if (typeHolder == L"hdr") impl_->header = true;
|
||||
if (typeHolder == L"dt") impl_->date_time = true;
|
||||
if (typeHolder == L"sldNum")impl_->slideNum = true;
|
||||
|
||||
impl_->object_description_.additional_.push_back(odf_reader::_property(L"PlaceHolderType",typeHolder));
|
||||
}
|
||||
@ -445,7 +440,7 @@ void pptx_slide_context::process_drawings()
|
||||
return impl_->process_drawings();
|
||||
}
|
||||
|
||||
void pptx_slide_context::Impl::process_image(drawing_object_description& pic, _pptx_drawing & drawing)
|
||||
void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _pptx_drawing & drawing)
|
||||
{
|
||||
int pos_replaicement = 0, pos_preview = 0;
|
||||
|
||||
@ -453,22 +448,22 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& pic, _p
|
||||
drawing.fill.type = 2;
|
||||
|
||||
_CP_OPT(std::wstring) sTextContent;
|
||||
GetProperty(pic.additional_, L"text-content", sTextContent);
|
||||
GetProperty(obj.additional_, L"text-content", sTextContent);
|
||||
if (sTextContent)//в ms office на картинке нельзя сделать надпись - меняем тип на рект с заливкой картинкой
|
||||
{
|
||||
drawing.type = typeShape;
|
||||
drawing.sub_type = 2;//rect
|
||||
}
|
||||
|
||||
std::wstring fileName = odfPacket_ + FILE_SEPARATOR_STR + pic.xlink_href_;
|
||||
drawing.fill.bitmap->bCrop = odf_reader::parse_clipping(pic.clipping_string_,fileName,drawing.fill.bitmap->cropRect, NULL);
|
||||
std::wstring fileName = odfPacket_ + FILE_SEPARATOR_STR + obj.xlink_href_;
|
||||
drawing.fill.bitmap->bCrop = odf_reader::parse_clipping(obj.clipping_string_, fileName, drawing.fill.bitmap->cropRect, NULL);
|
||||
drawing.fill.bitmap->bStretch = true;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
std::wstring ref;/// это ссылка на выходной внешний объект
|
||||
bool isMediaInternal = false;
|
||||
|
||||
drawing.fill.bitmap->rId = get_mediaitems().add_or_find(pic.xlink_href_, typeImage, isMediaInternal, ref);
|
||||
drawing.fill.bitmap->rId = get_mediaitems().add_or_find(obj.xlink_href_, typeImage, isMediaInternal, ref);
|
||||
|
||||
if (drawing.type == typeShape)
|
||||
{
|
||||
@ -476,11 +471,13 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& pic, _p
|
||||
|
||||
isMediaInternal = true;
|
||||
std::wstring rId = get_mediaitems().add_or_find(L"", typeShape, isMediaInternal, ref);
|
||||
|
||||
add_drawing(drawing, isMediaInternal, rId, ref, typeShape);//объект
|
||||
|
||||
}else if (!drawing.fill.bitmap->rId.empty())
|
||||
}
|
||||
else if (!drawing.fill.bitmap->rId.empty())
|
||||
{
|
||||
add_drawing(drawing, isMediaInternal, drawing.fill.bitmap->rId , ref, drawing.type);//объект
|
||||
add_drawing(drawing, isMediaInternal, drawing.fill.bitmap->rId, ref, drawing.type);//объект
|
||||
}
|
||||
}
|
||||
void pptx_slide_context::Impl::process_chart(drawing_object_description & obj, _pptx_drawing & drawing)
|
||||
@ -488,8 +485,9 @@ void pptx_slide_context::Impl::process_chart(drawing_object_description & obj, _
|
||||
std::wstring ref;
|
||||
bool isMediaInternal = true;
|
||||
|
||||
drawing.objectId = get_mediaitems().add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
add_drawing(drawing, isMediaInternal, drawing.objectId, ref, drawing.type);
|
||||
drawing.objectId = get_mediaitems().add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
|
||||
add_drawing(drawing, isMediaInternal, drawing.objectId, ref, drawing.type);
|
||||
}
|
||||
|
||||
void pptx_slide_context::Impl::process_table(drawing_object_description & obj, _pptx_drawing & drawing)
|
||||
@ -499,6 +497,7 @@ void pptx_slide_context::Impl::process_table(drawing_object_description & obj, _
|
||||
std::wstring rId = get_mediaitems().add_or_find(L"", obj.type_, isMediaInternal, ref);
|
||||
|
||||
add_drawing(drawing, isMediaInternal, rId, ref, drawing.type);
|
||||
|
||||
}
|
||||
|
||||
void pptx_slide_context::Impl::process_shape(drawing_object_description & obj, _pptx_drawing & drawing)
|
||||
@ -511,6 +510,7 @@ void pptx_slide_context::Impl::process_shape(drawing_object_description & obj, _
|
||||
if (drawing.fill.bitmap)
|
||||
{
|
||||
drawing.fill.bitmap->rId = get_mediaitems().add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
|
||||
|
||||
add_additional_rels(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);
|
||||
}
|
||||
|
||||
@ -541,11 +541,12 @@ void pptx_slide_context::Impl::process_object(drawing_object_description& obj, _
|
||||
drawing.objectId = get_mediaitems().add_or_find(obj.xlink_href_, obj.type_, isMediaInternal, ref);
|
||||
drawing.objectProgId = obj.descriptor_;
|
||||
|
||||
add_drawing(drawing, isMediaInternal, drawing.objectId, ref, drawing.type);
|
||||
add_drawing(drawing, isMediaInternal, drawing.objectId, ref, drawing.type);
|
||||
|
||||
if (drawing.fill.bitmap)
|
||||
{
|
||||
drawing.fill.bitmap->rId = get_mediaitems().add_or_find(drawing.fill.bitmap->xlink_href_, typeImage, isMediaInternal, ref);
|
||||
|
||||
add_additional_rels(isMediaInternal, drawing.fill.bitmap->rId, ref, typeImage);
|
||||
}
|
||||
}
|
||||
@ -575,7 +576,6 @@ void pptx_slide_context::Impl::process_common_properties(drawing_object_descript
|
||||
drawing.fill = pic.fill_;
|
||||
}
|
||||
|
||||
|
||||
void pptx_slide_context::dump_rels(rels & Rels)
|
||||
{
|
||||
impl_->get_drawings()->dump_rels(Rels);
|
||||
@ -590,6 +590,7 @@ void pptx_slide_context::add_rels( bool isInternal, std::wstring const & rid, st
|
||||
{
|
||||
impl_->add_additional_rels(isInternal, rid, ref, type);
|
||||
}
|
||||
|
||||
void pptx_slide_context::set_footer()
|
||||
{
|
||||
impl_->footer = true;
|
||||
@ -608,7 +609,7 @@ void pptx_slide_context::set_date_time()
|
||||
}
|
||||
void pptx_slide_context::serialize_background(std::wostream & strm, bool always)
|
||||
{
|
||||
if (!always && ( (!impl_->background_fill_) || (impl_->background_fill_->type==0))) return;
|
||||
if (!always && ( (!impl_->background_fill_) || (impl_->background_fill_->type == 0))) return;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -618,7 +619,7 @@ void pptx_slide_context::serialize_background(std::wostream & strm, bool always)
|
||||
{
|
||||
if (impl_->background_fill_)
|
||||
{
|
||||
oox_serialize_fill(CP_XML_STREAM(),impl_->background_fill_.get());
|
||||
oox_serialize_fill(CP_XML_STREAM(), impl_->background_fill_.get());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -689,7 +690,6 @@ void pptx_slide_context::serialize_HeaderFooter(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pptx_slide_context::serialize_objects(std::wostream & strm)
|
||||
{
|
||||
int next_id = impl_->next_rId();
|
||||
@ -701,8 +701,8 @@ void pptx_slide_context::serialize_objects(std::wostream & strm)
|
||||
{
|
||||
CP_XML_NODE(L"p:cNvPr")
|
||||
{
|
||||
CP_XML_ATTR(L"name",L"noGroup");
|
||||
CP_XML_ATTR(L"id",next_id);
|
||||
CP_XML_ATTR(L"name", L"noGroup");
|
||||
CP_XML_ATTR(L"id", next_id);
|
||||
}
|
||||
CP_XML_NODE(L"p:cNvGrpSpPr");
|
||||
CP_XML_NODE(L"p:nvPr");
|
||||
|
||||
@ -89,16 +89,19 @@ public:
|
||||
void end_table();
|
||||
|
||||
void start_shape(int type);
|
||||
void end_shape();
|
||||
void end_shape ();
|
||||
|
||||
void set_use_image_replacement();
|
||||
|
||||
bool empty() const;
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void serialize_objects(std::wostream & strm);
|
||||
void serialize_HeaderFooter(std::wostream & strm);
|
||||
void serialize_background(std::wostream & strm, bool always=false);
|
||||
void serialize_animations(std::wostream & strm);
|
||||
|
||||
void serialize_HeaderFooter (std::wostream & strm);
|
||||
void serialize_animations (std::wostream & strm);
|
||||
|
||||
void serialize_objects (std::wostream & strm);
|
||||
|
||||
void serialize_background (std::wostream & strm, bool always = false);
|
||||
|
||||
void dump_rels(rels & Rels);
|
||||
|
||||
@ -106,7 +109,7 @@ public:
|
||||
|
||||
mediaitems & get_mediaitems();
|
||||
|
||||
void add_background(_oox_fill & fill);
|
||||
void add_background (_oox_fill & fill);
|
||||
|
||||
void add_rels( bool isInternal,
|
||||
std::wstring const & rid,
|
||||
|
||||
@ -72,8 +72,8 @@ public:
|
||||
void start_base_style(const std::wstring baseStyleName, const odf_types::style_family::type baseStyleType);
|
||||
void end_base_style();
|
||||
|
||||
void ApplyTextProperties (std::wstring style,odf_reader::text_format_properties_content & propertiesOut, odf_types::style_family::type Type);
|
||||
void ApplyParagraphProperties (std::wstring style,odf_reader::paragraph_format_properties & propertiesOut, odf_types::style_family::type Type);
|
||||
void ApplyTextProperties (std::wstring style, std::wstring para_style, odf_reader::text_format_properties_content & propertiesOut);
|
||||
void ApplyParagraphProperties (std::wstring para_style, odf_reader::paragraph_format_properties & propertiesOut);
|
||||
void ApplyListProperties (odf_reader::paragraph_format_properties & propertiesOut, int Level);
|
||||
|
||||
void set_local_styles_container(odf_reader::styles_container* local_styles_);//это если стили объектов содержатся в другом документе
|
||||
@ -239,32 +239,37 @@ void pptx_text_context::Impl::end_hyperlink(std::wstring hId)
|
||||
dump_run();
|
||||
hyperlink_hId = L"";
|
||||
}
|
||||
void pptx_text_context::Impl::ApplyTextProperties(std::wstring style_name,odf_reader::text_format_properties_content & propertiesOut, odf_types::style_family::type Type)
|
||||
void pptx_text_context::Impl::ApplyTextProperties(std::wstring style_name, std::wstring para_style_name, odf_reader::text_format_properties_content & propertiesOut)
|
||||
{
|
||||
std::vector<const odf_reader::style_instance *> instances;
|
||||
|
||||
odf_reader::style_instance* defaultStyle = NULL;
|
||||
odf_reader::style_instance* style = NULL;
|
||||
odf_reader::style_instance* baseStyle = NULL;
|
||||
odf_reader::style_instance* defaultStyle = NULL;
|
||||
odf_reader::style_instance* para_style = NULL;
|
||||
odf_reader::style_instance* text_style = NULL;
|
||||
odf_reader::style_instance* baseStyle = NULL;
|
||||
|
||||
if (local_styles_ptr_)
|
||||
{
|
||||
style = local_styles_ptr_->style_by_name(style_name, Type,false/*process_headers_footers_*/);
|
||||
defaultStyle = local_styles_ptr_->style_default_by_type(Type);
|
||||
baseStyle = local_styles_ptr_->style_by_name(base_style_name_, base_style_family_,false/*process_headers_footers_*/);
|
||||
para_style = local_styles_ptr_->style_by_name (para_style_name, odf_types::style_family::Paragraph, false/*process_headers_footers_*/);
|
||||
text_style = local_styles_ptr_->style_by_name (style_name, odf_types::style_family::Text, false/*process_headers_footers_*/);
|
||||
defaultStyle = local_styles_ptr_->style_default_by_type (odf_types::style_family::Text);
|
||||
baseStyle = local_styles_ptr_->style_by_name (base_style_name_, base_style_family_, false/*process_headers_footers_*/);
|
||||
}
|
||||
else
|
||||
{
|
||||
style = odf_context_.styleContainer().style_by_name(style_name, Type,false/*process_headers_footers_*/);
|
||||
defaultStyle = odf_context_.styleContainer().style_default_by_type(Type);
|
||||
baseStyle = odf_context_.styleContainer().style_by_name(base_style_name_, base_style_family_,false/*process_headers_footers_*/);
|
||||
para_style = odf_context_.styleContainer().style_by_name (para_style_name, odf_types::style_family::Paragraph, false/*process_headers_footers_*/);
|
||||
text_style = odf_context_.styleContainer().style_by_name (style_name, odf_types::style_family::Text, false/*process_headers_footers_*/);
|
||||
defaultStyle = odf_context_.styleContainer().style_default_by_type (odf_types::style_family::Text);
|
||||
baseStyle = odf_context_.styleContainer().style_by_name (base_style_name_, base_style_family_, false/*process_headers_footers_*/);
|
||||
}
|
||||
if (defaultStyle) instances.push_back(defaultStyle);
|
||||
if (baseStyle) instances.push_back(baseStyle);
|
||||
if (style) instances.push_back(style);
|
||||
if (para_style) instances.push_back(para_style);
|
||||
if (text_style) instances.push_back(text_style);
|
||||
|
||||
if (style)get_styles_context().start_process_style(style);
|
||||
else get_styles_context().start_process_style(baseStyle);
|
||||
if (text_style) get_styles_context().start_process_style(text_style);
|
||||
else if (para_style) get_styles_context().start_process_style(para_style);
|
||||
else get_styles_context().start_process_style(baseStyle);
|
||||
|
||||
propertiesOut.apply_from(calc_text_properties_content(instances));
|
||||
}
|
||||
@ -323,33 +328,33 @@ void pptx_text_context::Impl::ApplyListProperties(odf_reader::paragraph_format_p
|
||||
|
||||
}
|
||||
|
||||
void pptx_text_context::Impl::ApplyParagraphProperties(std::wstring style_name,odf_reader::paragraph_format_properties & propertiesOut, odf_types::style_family::type Type)
|
||||
void pptx_text_context::Impl::ApplyParagraphProperties(std::wstring style_name, odf_reader::paragraph_format_properties & propertiesOut)
|
||||
{
|
||||
std::vector<const odf_reader::style_instance *> instances;
|
||||
|
||||
odf_reader::style_instance* style = NULL;
|
||||
odf_reader::style_instance * defaultStyle = NULL;
|
||||
odf_reader::style_instance * baseStyle = NULL;
|
||||
odf_reader::style_instance* style = NULL;
|
||||
odf_reader::style_instance* defaultStyle = NULL;
|
||||
odf_reader::style_instance* baseStyle = NULL;
|
||||
|
||||
if (local_styles_ptr_)
|
||||
{
|
||||
style = local_styles_ptr_->style_by_name(style_name, Type,false/*process_headers_footers_*/);
|
||||
defaultStyle = local_styles_ptr_->style_default_by_type(Type);
|
||||
baseStyle = local_styles_ptr_->style_by_name(base_style_name_, base_style_family_,false/*process_headers_footers_*/);
|
||||
style = local_styles_ptr_->style_by_name (style_name, odf_types::style_family::Paragraph, false/*process_headers_footers_*/);
|
||||
defaultStyle = local_styles_ptr_->style_default_by_type (odf_types::style_family::Paragraph);
|
||||
baseStyle = local_styles_ptr_->style_by_name (base_style_name_, base_style_family_, false/*process_headers_footers_*/);
|
||||
}
|
||||
else
|
||||
{
|
||||
style = odf_context_.styleContainer().style_by_name(style_name, Type,false/*process_headers_footers_*/);
|
||||
defaultStyle = odf_context_.styleContainer().style_default_by_type(Type);
|
||||
baseStyle= odf_context_.styleContainer().style_by_name(base_style_name_, base_style_family_,false/*process_headers_footers_*/);
|
||||
style = odf_context_.styleContainer().style_by_name (style_name, odf_types::style_family::Paragraph, false/*process_headers_footers_*/);
|
||||
defaultStyle = odf_context_.styleContainer().style_default_by_type (odf_types::style_family::Paragraph);
|
||||
baseStyle = odf_context_.styleContainer().style_by_name (base_style_name_, base_style_family_,false/*process_headers_footers_*/);
|
||||
}
|
||||
|
||||
if (defaultStyle) instances.push_back(defaultStyle);
|
||||
if (baseStyle) instances.push_back(baseStyle);
|
||||
if (style) instances.push_back(style);
|
||||
|
||||
if (style)get_styles_context().start_process_style(style);
|
||||
else get_styles_context().start_process_style(baseStyle);
|
||||
if (style) get_styles_context().start_process_style(style);
|
||||
else get_styles_context().start_process_style(baseStyle);
|
||||
|
||||
propertiesOut.apply_from(calc_paragraph_properties_content(instances));
|
||||
}
|
||||
@ -360,9 +365,9 @@ void pptx_text_context::Impl::write_pPr(std::wostream & strm)
|
||||
|
||||
int level = list_style_stack_.size()-1;
|
||||
|
||||
odf_reader::paragraph_format_properties paragraph_properties_;
|
||||
odf_reader::paragraph_format_properties paragraph_properties_;
|
||||
|
||||
ApplyParagraphProperties (paragraph_style_name_, paragraph_properties_,odf_types::style_family::Paragraph);
|
||||
ApplyParagraphProperties (paragraph_style_name_, paragraph_properties_);
|
||||
ApplyListProperties (paragraph_properties_, level);//выравнивания листа накатим на свойства параграфа
|
||||
|
||||
paragraph_properties_.pptx_convert(pptx_context_);
|
||||
@ -403,16 +408,9 @@ void pptx_text_context::Impl::write_rPr(std::wostream & strm)
|
||||
if (paragraph_style_name_.empty() && span_style_name_.empty() && !(!hyperlink_hId.empty()) && base_style_name_.empty())
|
||||
return;
|
||||
|
||||
odf_reader::text_format_properties_content text_properties_paragraph_;
|
||||
ApplyTextProperties (paragraph_style_name_, text_properties_paragraph_,odf_types::style_family::Paragraph);
|
||||
|
||||
odf_reader::text_format_properties_content text_properties_span_;
|
||||
ApplyTextProperties(span_style_name_, text_properties_span_,odf_types::style_family::Text);
|
||||
|
||||
odf_reader::text_format_properties_content text_properties_;
|
||||
|
||||
text_properties_.apply_from(text_properties_paragraph_);
|
||||
text_properties_.apply_from(text_properties_span_);
|
||||
|
||||
ApplyTextProperties(span_style_name_, paragraph_style_name_, text_properties_);
|
||||
|
||||
get_styles_context().start();
|
||||
|
||||
|
||||
@ -55,6 +55,7 @@ public:
|
||||
std::wstringstream autofilter_;
|
||||
std::wstringstream conditionalFormatting_;
|
||||
std::wstringstream ole_objects_;
|
||||
std::wstringstream page_props_;
|
||||
|
||||
rels hyperlinks_rels_;
|
||||
rels ole_objects_rels_;
|
||||
@ -134,6 +135,11 @@ std::wostream & xlsx_xml_worksheet::ole_objects()
|
||||
{
|
||||
return impl_->ole_objects_;
|
||||
}
|
||||
std::wostream & xlsx_xml_worksheet::page_properties()
|
||||
{
|
||||
return impl_->page_props_;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------
|
||||
rels & xlsx_xml_worksheet::hyperlinks_rels()
|
||||
{
|
||||
@ -196,9 +202,13 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
{
|
||||
CP_XML_NODE(L"oleObjects")
|
||||
{
|
||||
CP_XML_STREAM() << impl_->ole_objects_.str();
|
||||
CP_XML_STREAM() << impl_->ole_objects_.str();
|
||||
}
|
||||
}
|
||||
if (!impl_->page_props_.str().empty())
|
||||
{
|
||||
CP_XML_STREAM() << impl_->page_props_.str();
|
||||
}
|
||||
//CP_XML_NODE(L"headerFooter){}
|
||||
|
||||
//CP_XML_NODE(L"rowBreaks){}
|
||||
|
||||
@ -63,6 +63,7 @@ public:
|
||||
std::wostream & conditionalFormatting();
|
||||
std::wostream & sort();
|
||||
std::wostream & ole_objects();
|
||||
std::wostream & page_properties();
|
||||
|
||||
rels & hyperlinks_rels();
|
||||
rels & ole_objects_rels();
|
||||
|
||||
@ -341,11 +341,26 @@ double charsToSize(unsigned int charsCount, double maxDigitSize)
|
||||
return 1.0 * int((maxDigitSize * charsCount + 5.0) / maxDigitSize * 256.0) / 256.0;
|
||||
}
|
||||
|
||||
void xlsx_table_state::serialize_table_format(std::wostream & _Wostream)
|
||||
void xlsx_table_state::serialize_page_properties (std::wostream & strm)
|
||||
{
|
||||
_CP_OPT(std::wstring) masterPageName = context_->root()->odf_context().styleContainer().master_page_name_by_name(table_style_);
|
||||
if (!masterPageName) return;
|
||||
|
||||
odf_reader::style_master_page* master_style_ = context_->root()->odf_context().pageLayoutContainer().master_page_by_name(*masterPageName);
|
||||
if (!master_style_) return;
|
||||
if (!master_style_->attlist_.style_page_layout_name_) return;
|
||||
|
||||
odf_reader::page_layout_instance * page_layout = context_->root()->odf_context().pageLayoutContainer().page_layout_by_name(*master_style_->attlist_.style_page_layout_name_);
|
||||
if (!page_layout) return;
|
||||
|
||||
page_layout->xlsx_serialize(strm, *context_);
|
||||
}
|
||||
|
||||
void xlsx_table_state::serialize_table_format (std::wostream & strm)
|
||||
{
|
||||
odf_reader::odf_read_context & odfContext = context_->root()->odf_context();
|
||||
|
||||
CP_XML_WRITER(_Wostream)
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
odf_reader::style_table_properties * table_prop = NULL;
|
||||
odf_reader::style_instance * tableStyle = odfContext.styleContainer().style_by_name(table_style_, odf_types::style_family::Table, false);
|
||||
@ -406,8 +421,8 @@ void xlsx_table_state::serialize_table_format(std::wostream & _Wostream)
|
||||
int col = -1, row = -1;
|
||||
try
|
||||
{
|
||||
col = boost::lexical_cast<int>(s_col);
|
||||
row = boost::lexical_cast<int>(s_row);
|
||||
if (!s_col.empty()) col = boost::lexical_cast<int>(s_col);
|
||||
if (!s_row.empty()) row = boost::lexical_cast<int>(s_row);
|
||||
}
|
||||
catch(...){}
|
||||
|
||||
@ -435,9 +450,9 @@ void xlsx_table_state::serialize_table_format(std::wostream & _Wostream)
|
||||
{
|
||||
const odf_reader::style_table_row_properties * prop = rowDefStyle->content()->get_style_table_row_properties();
|
||||
|
||||
if ( (prop) && (prop->style_table_row_properties_attlist_.style_row_height_))
|
||||
if ( (prop) && (prop->attlist_.style_row_height_))
|
||||
{
|
||||
default_height = prop->style_table_row_properties_attlist_.style_row_height_->get_value_unit(odf_types::length::pt);
|
||||
default_height = prop->attlist_.style_row_height_->get_value_unit(odf_types::length::pt);
|
||||
}
|
||||
std::wstringstream ht_s;
|
||||
ht_s.precision(1);
|
||||
@ -451,21 +466,21 @@ void xlsx_table_state::serialize_table_format(std::wostream & _Wostream)
|
||||
}
|
||||
|
||||
}
|
||||
void xlsx_table_state::serialize_merge_cells(std::wostream & _Wostream)
|
||||
void xlsx_table_state::serialize_merge_cells(std::wostream & strm)
|
||||
{
|
||||
return xlsx_merge_cells_.xlsx_serialize(_Wostream);
|
||||
return xlsx_merge_cells_.xlsx_serialize(strm);
|
||||
}
|
||||
void xlsx_table_state::serialize_ole_objects(std::wostream & _Wostream)
|
||||
void xlsx_table_state::serialize_ole_objects(std::wostream & strm)
|
||||
{
|
||||
return xlsx_drawing_context_.get_drawings()->serialize_objects(_Wostream);
|
||||
return xlsx_drawing_context_.get_drawings()->serialize_objects(strm);
|
||||
}
|
||||
void xlsx_table_state::serialize_hyperlinks(std::wostream & _Wostream)
|
||||
void xlsx_table_state::serialize_hyperlinks(std::wostream & strm)
|
||||
{
|
||||
return xlsx_hyperlinks_.xlsx_serialize(_Wostream);
|
||||
return xlsx_hyperlinks_.xlsx_serialize(strm);
|
||||
}
|
||||
void xlsx_table_state::serialize_conditionalFormatting(std::wostream & _Wostream)
|
||||
void xlsx_table_state::serialize_conditionalFormatting(std::wostream & strm)
|
||||
{
|
||||
return xlsx_conditionalFormatting_context_.serialize(_Wostream);
|
||||
return xlsx_conditionalFormatting_context_.serialize(strm);
|
||||
}
|
||||
void xlsx_table_state::dump_rels_hyperlinks(rels & Rels)
|
||||
{
|
||||
|
||||
@ -128,7 +128,8 @@ public:
|
||||
void serialize_merge_cells (std::wostream & _Wostream);
|
||||
void serialize_hyperlinks (std::wostream & _Wostream);
|
||||
void serialize_ole_objects (std::wostream & _Wostream);
|
||||
|
||||
void serialize_page_properties (std::wostream & _Wostream);
|
||||
|
||||
void dump_rels_hyperlinks (rels & Rels);
|
||||
void dump_rels_ole_objects (rels & Rels);
|
||||
|
||||
|
||||
@ -317,6 +317,10 @@ void xlsx_table_context::serialize_table_format(std::wostream & _Wostream)
|
||||
{
|
||||
return state()->serialize_table_format(_Wostream);
|
||||
}
|
||||
void xlsx_table_context::serialize_page_properties(std::wostream & _Wostream)
|
||||
{
|
||||
return state()->serialize_page_properties(_Wostream);
|
||||
}
|
||||
void xlsx_table_context::serialize_hyperlinks(std::wostream & _Wostream)
|
||||
{
|
||||
return state()->serialize_hyperlinks(_Wostream);
|
||||
|
||||
@ -90,6 +90,7 @@ public:
|
||||
void serialize_conditionalFormatting(std::wostream & _Wostream);
|
||||
void serialize_hyperlinks (std::wostream & _Wostream);
|
||||
void serialize_ole_objects (std::wostream & _Wostream);
|
||||
void serialize_page_properties (std::wostream & _Wostream);
|
||||
|
||||
xlsx_table_metrics & get_table_metrics();
|
||||
|
||||
|
||||
@ -84,10 +84,10 @@ public:
|
||||
|
||||
void serialize_shared_strings(std::wostream & strm);
|
||||
|
||||
void ApplyTextProperties (std::wstring style, odf_reader::text_format_properties_content & propertiesOut, odf_types::style_family::type Type);
|
||||
void ApplyParagraphProperties (std::wstring style, odf_reader::paragraph_format_properties & propertiesOut, odf_types::style_family::type Type);
|
||||
void ApplyTextProperties (std::wstring style, std::wstring para_style, odf_reader::text_format_properties_content & propertiesOut);
|
||||
void ApplyParagraphProperties (std::wstring style, odf_reader::paragraph_format_properties & propertiesOut);
|
||||
|
||||
void set_local_styles_container(odf_reader::styles_container* local_styles_);//это если стили объектов содержатся в другом документе
|
||||
void set_local_styles_container (odf_reader::styles_container* local_styles_);//это если стили объектов содержатся в другом документе
|
||||
|
||||
bool is_drawing_context(){return in_draw;}
|
||||
|
||||
@ -136,7 +136,8 @@ void xlsx_text_context::Impl::serialize_shared_strings(std::wostream & strm)
|
||||
xlsx_text_context::Impl::Impl(odf_reader::styles_container & styles): paragraphs_cout_(0),styles_(styles),
|
||||
in_comment(false),in_draw(false),in_paragraph(false),in_span(false),in_cell_content(false)
|
||||
{
|
||||
text_properties_cell_ = NULL;
|
||||
local_styles_ptr_ = NULL;
|
||||
text_properties_cell_ = NULL;
|
||||
}
|
||||
|
||||
void xlsx_text_context::Impl::add_text(const std::wstring & text)
|
||||
@ -236,48 +237,54 @@ void xlsx_text_context::Impl::end_hyperlink(std::wstring hId)
|
||||
hyperlink_hId = hId;
|
||||
}
|
||||
|
||||
void xlsx_text_context::Impl::ApplyParagraphProperties (std::wstring style, odf_reader::paragraph_format_properties & propertiesOut, odf_types::style_family::type Type)
|
||||
void xlsx_text_context::Impl::ApplyParagraphProperties (std::wstring style, odf_reader::paragraph_format_properties & propertiesOut)
|
||||
{
|
||||
std::vector<const odf_reader::style_instance *> instances;
|
||||
|
||||
odf_reader::style_instance* defaultStyle = NULL;
|
||||
odf_reader::style_instance* paraStyle = NULL;
|
||||
|
||||
if (local_styles_ptr_)
|
||||
{
|
||||
odf_reader::style_instance * defaultStyle = local_styles_ptr_->style_default_by_type(Type);
|
||||
if (defaultStyle)instances.push_back(defaultStyle);
|
||||
|
||||
odf_reader::style_instance* styleInst = local_styles_ptr_->style_by_name(style, Type,false/*process_headers_footers_*/);
|
||||
if(styleInst)instances.push_back(styleInst);
|
||||
defaultStyle = local_styles_ptr_->style_default_by_type(odf_types::style_family::Paragraph);
|
||||
paraStyle = local_styles_ptr_->style_by_name(style, odf_types::style_family::Paragraph, false/*process_headers_footers_*/);
|
||||
}
|
||||
else
|
||||
{
|
||||
odf_reader::style_instance * defaultStyle = styles_.style_default_by_type(Type);
|
||||
if (defaultStyle)instances.push_back(defaultStyle);
|
||||
|
||||
odf_reader::style_instance* styleInst = styles_.style_by_name(style, Type,false/*process_headers_footers_*/);
|
||||
if(styleInst)instances.push_back(styleInst);
|
||||
defaultStyle = styles_.style_default_by_type(odf_types::style_family::Paragraph);
|
||||
paraStyle = styles_.style_by_name(style, odf_types::style_family::Paragraph, false/*process_headers_footers_*/);
|
||||
}
|
||||
|
||||
if (defaultStyle) instances.push_back(defaultStyle);
|
||||
if (paraStyle) instances.push_back(paraStyle);
|
||||
|
||||
propertiesOut.apply_from(calc_paragraph_properties_content(instances));
|
||||
}
|
||||
void xlsx_text_context::Impl::ApplyTextProperties(std::wstring style, odf_reader::text_format_properties_content & propertiesOut, odf_types::style_family::type Type)
|
||||
void xlsx_text_context::Impl::ApplyTextProperties(std::wstring style, std::wstring para_style, odf_reader::text_format_properties_content & propertiesOut)
|
||||
{
|
||||
std::vector<const odf_reader::style_instance *> instances;
|
||||
|
||||
odf_reader::style_instance* defaultStyle = NULL;
|
||||
odf_reader::style_instance* textStyle = NULL;
|
||||
odf_reader::style_instance* paraStyle = NULL;
|
||||
|
||||
if (local_styles_ptr_)
|
||||
{
|
||||
odf_reader::style_instance * defaultStyle = local_styles_ptr_->style_default_by_type(Type);
|
||||
if (defaultStyle)instances.push_back(defaultStyle);
|
||||
|
||||
odf_reader::style_instance* styleInst = local_styles_ptr_->style_by_name(style, Type,false/*process_headers_footers_*/);
|
||||
if(styleInst)instances.push_back(styleInst);
|
||||
defaultStyle = local_styles_ptr_->style_default_by_type(odf_types::style_family::Text);
|
||||
paraStyle = local_styles_ptr_->style_by_name(para_style, odf_types::style_family::Paragraph, false/*process_headers_footers_*/);
|
||||
textStyle = local_styles_ptr_->style_by_name(style, odf_types::style_family::Text, false/*process_headers_footers_*/);
|
||||
}
|
||||
else
|
||||
{
|
||||
odf_reader::style_instance * defaultStyle = styles_.style_default_by_type(Type);
|
||||
if (defaultStyle)instances.push_back(defaultStyle);
|
||||
|
||||
odf_reader::style_instance* styleInst = styles_.style_by_name(style, Type,false/*process_headers_footers_*/);
|
||||
if(styleInst)instances.push_back(styleInst);
|
||||
defaultStyle = styles_.style_default_by_type(odf_types::style_family::Text);
|
||||
paraStyle = styles_.style_by_name(para_style, odf_types::style_family::Paragraph, false/*process_headers_footers_*/);
|
||||
textStyle = styles_.style_by_name(style, odf_types::style_family::Text, false/*process_headers_footers_*/);
|
||||
}
|
||||
|
||||
if (defaultStyle) instances.push_back(defaultStyle);
|
||||
if (paraStyle) instances.push_back(paraStyle);
|
||||
if (textStyle) instances.push_back(textStyle);
|
||||
|
||||
propertiesOut.apply_from(calc_text_properties_content(instances));
|
||||
}
|
||||
|
||||
@ -290,10 +297,10 @@ void xlsx_text_context::Impl::write_pPr (std::wostream & strm)
|
||||
{
|
||||
if (paragraph_style_name_.empty())return;
|
||||
|
||||
odf_reader::paragraph_format_properties paragraph_format_properties_;
|
||||
odf_reader::paragraph_format_properties paragraph_format_properties_;
|
||||
|
||||
ApplyParagraphProperties (paragraph_style_name_, paragraph_format_properties_ , odf_types::style_family::Paragraph);
|
||||
paragraph_format_properties_.xlsx_convert(strm, in_draw);
|
||||
ApplyParagraphProperties (paragraph_style_name_, paragraph_format_properties_);
|
||||
paragraph_format_properties_.xlsx_convert (strm, in_draw);
|
||||
}
|
||||
|
||||
void xlsx_text_context::Impl::write_rPr(std::wostream & strm)
|
||||
@ -302,92 +309,66 @@ void xlsx_text_context::Impl::write_rPr(std::wostream & strm)
|
||||
&& !(!hyperlink_hId.empty() && in_draw)
|
||||
&& !(text_properties_cell_ && in_cell_content))return;
|
||||
|
||||
odf_reader::text_format_properties_content text_properties_paragraph_;
|
||||
odf_reader::text_format_properties_content text_properties_span_;
|
||||
|
||||
ApplyTextProperties (paragraph_style_name_, text_properties_paragraph_ , odf_types::style_family::Paragraph);
|
||||
ApplyTextProperties (span_style_name_, text_properties_span_ , odf_types::style_family::Text);
|
||||
|
||||
odf_reader::text_format_properties_content text_properties_;
|
||||
|
||||
if (in_cell_content && text_properties_cell_)
|
||||
{
|
||||
text_properties_.apply_from(*text_properties_cell_);
|
||||
}
|
||||
text_properties_.apply_from(text_properties_paragraph_);
|
||||
text_properties_.apply_from(text_properties_span_);
|
||||
}
|
||||
|
||||
_CP_OPT(double) dValFontSize;
|
||||
if (text_properties_.fo_font_size_)
|
||||
dValFontSize=text_properties_.fo_font_size_->get_length().get_value();
|
||||
|
||||
_CP_OPT(std::wstring) sValFontFamily;
|
||||
if (text_properties_.fo_font_family_)
|
||||
ApplyTextProperties (span_style_name_, paragraph_style_name_, text_properties_);
|
||||
|
||||
if (in_draw)
|
||||
{
|
||||
std::wstring val =text_properties_.fo_font_family_.get();
|
||||
//'Arial' глючит
|
||||
removeCharsFromString(val, _T("'"));
|
||||
|
||||
sValFontFamily=text_properties_.fo_font_family_.get();
|
||||
odf_reader::fonts_container fonts;
|
||||
text_properties_.drawing_serialize(strm, L"a:rPr", fonts);
|
||||
}
|
||||
//else if (text_properties_.style_font_name_) - тут может быть отсылка к font_face)decl !!!!
|
||||
// sValFontFamily=text_properties_.style_font_name_.get();
|
||||
|
||||
_CP_OPT(std::wstring) sValFontColor;
|
||||
if (text_properties_.fo_color_)
|
||||
sValFontColor=text_properties_.fo_color_->get_hex_value();
|
||||
|
||||
_CP_OPT(int) iValFontWeight;
|
||||
if (text_properties_.fo_font_weight_)
|
||||
iValFontWeight=text_properties_.fo_font_weight_->get_type();
|
||||
|
||||
_CP_OPT(int) iValFontStyle;
|
||||
if(text_properties_.fo_font_style_)
|
||||
iValFontStyle=text_properties_.fo_font_style_->get_type();
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
if (in_draw)
|
||||
{
|
||||
//oox_serialize_style_text(strm,text_properties_);
|
||||
//oox_serialize_style_text(strm,odf_reader::text_format_properties_content & properties);
|
||||
CP_XML_NODE(L"a:rPr")
|
||||
{
|
||||
//стр 3197
|
||||
if (dValFontSize) {CP_XML_ATTR(L"sz", (int)(dValFontSize.get()*100));}
|
||||
if ((iValFontStyle) && (iValFontStyle.get() >0)) {CP_XML_ATTR(L"i", "1");} //"true");} Exercícios de Aprendizagem.ods
|
||||
if ((iValFontWeight) && (iValFontWeight.get() >0)) {CP_XML_ATTR(L"b", "1");} //"true");} Exercícios de Aprendizagem.ods
|
||||
if (sValFontColor)
|
||||
{
|
||||
CP_XML_NODE(L"a:solidFill") {CP_XML_NODE(L"a:srgbClr"){CP_XML_ATTR(L"val", sValFontColor.get());}}
|
||||
}
|
||||
if (sValFontFamily)
|
||||
{
|
||||
CP_XML_NODE(L"a:latin"){CP_XML_ATTR(L"typeface", sValFontFamily.get());}
|
||||
}
|
||||
|
||||
|
||||
if (hyperlink_hId.length()>0)
|
||||
{
|
||||
CP_XML_NODE(L"a:hlinkClick ")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
CP_XML_ATTR(L"r:id", hyperlink_hId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"rPr")
|
||||
{
|
||||
if (sValFontFamily) {CP_XML_NODE(L"rFont") {CP_XML_ATTR(L"val", sValFontFamily.get());}}
|
||||
if (dValFontSize) {CP_XML_NODE(L"sz") {CP_XML_ATTR(L"val", (int)(dValFontSize.get()));}}
|
||||
if (sValFontColor) {CP_XML_NODE(L"color") {CP_XML_ATTR(L"rgb", sValFontColor.get());}}
|
||||
if ((iValFontStyle) &&
|
||||
(iValFontStyle.get() >0)) {CP_XML_NODE(L"i") {CP_XML_ATTR(L"val", "true");}}
|
||||
if ((iValFontWeight) &&
|
||||
(iValFontWeight.get() >0)) {CP_XML_NODE(L"b") {CP_XML_ATTR(L"val", "true");}}
|
||||
if (text_properties_.fo_font_family_)
|
||||
{
|
||||
CP_XML_NODE(L"rFont")
|
||||
{
|
||||
CP_XML_ATTR(L"val", text_properties_.fo_font_family_.get());
|
||||
}
|
||||
}
|
||||
if (text_properties_.fo_font_size_)
|
||||
{
|
||||
CP_XML_NODE(L"sz")
|
||||
{
|
||||
CP_XML_ATTR(L"val", (int)text_properties_.fo_font_size_->get_length().get_value());
|
||||
}
|
||||
}
|
||||
if (text_properties_.fo_color_)
|
||||
{
|
||||
CP_XML_NODE(L"color")
|
||||
{
|
||||
CP_XML_ATTR(L"rgb", text_properties_.fo_color_->get_hex_value());
|
||||
}
|
||||
}
|
||||
if (text_properties_.fo_font_style_)
|
||||
{
|
||||
CP_XML_NODE(L"i")
|
||||
{
|
||||
if (text_properties_.fo_font_style_->get_type() > 0)
|
||||
CP_XML_ATTR(L"val", "true");
|
||||
else
|
||||
CP_XML_ATTR(L"val", "false");
|
||||
}
|
||||
}
|
||||
if (text_properties_.fo_font_weight_)
|
||||
{
|
||||
CP_XML_NODE(L"b")
|
||||
{
|
||||
if (text_properties_.fo_font_weight_->get_type() > 0)
|
||||
CP_XML_ATTR(L"val", "true");
|
||||
else
|
||||
CP_XML_ATTR(L"val", "false");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,10 +54,9 @@ class xlsx_conversion_context;
|
||||
class xlsx_text_context: boost::noncopyable
|
||||
{
|
||||
public:
|
||||
//xlsx_text_context();
|
||||
xlsx_text_context(odf_reader::styles_container & styles_);
|
||||
~xlsx_text_context();
|
||||
public:
|
||||
xlsx_text_context (odf_reader::styles_container & styles_);
|
||||
~xlsx_text_context ();
|
||||
|
||||
void set_local_styles_container (odf_reader::styles_container *local_styles_);
|
||||
void set_cell_text_properties (odf_reader::text_format_properties_content *text_properties);
|
||||
|
||||
|
||||
@ -369,6 +369,7 @@ void xlsx_conversion_context::end_table()
|
||||
current_sheet().cols() << L"</cols>";
|
||||
|
||||
get_table_context().serialize_table_format (current_sheet().sheetFormat());
|
||||
get_table_context().serialize_page_properties (current_sheet().page_properties());
|
||||
get_table_context().serialize_conditionalFormatting (current_sheet().conditionalFormatting());
|
||||
get_table_context().serialize_autofilter (current_sheet().autofilter());
|
||||
get_table_context().serialize_sort (current_sheet().sort());
|
||||
@ -420,7 +421,7 @@ void xlsx_conversion_context::end_table()
|
||||
current_sheet().set_comments_link(commentsName.first, commentsName.second);
|
||||
current_sheet().set_vml_drawing_link(vml_drawingName.first, vml_drawingName.second);
|
||||
}
|
||||
|
||||
//background picture
|
||||
get_table_context().end_table();
|
||||
}
|
||||
|
||||
|
||||
@ -32,18 +32,14 @@
|
||||
|
||||
#include "anim_elements.h"
|
||||
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
#include "odfcontext.h"
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
|
||||
|
||||
#include "draw_common.h"
|
||||
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
@ -74,16 +70,16 @@ void anim_par::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
}
|
||||
///////////////////////// последовательности .. (если один элемент - основная последовательность, иное - взаимодействующая анимация)
|
||||
//slide_context().animation_context().start_sequence();
|
||||
BOOST_FOREACH(const office_element_ptr& elm, anim_seq_array_)
|
||||
for (size_t i = 0; i < anim_seq_array_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
anim_seq_array_[i]->pptx_convert(Context);
|
||||
}
|
||||
//slide_context().animation_context().end_sequence();
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//внутренние эффекты - те что внутри одной последовательности
|
||||
BOOST_FOREACH(const office_element_ptr& elm, content_)
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
}
|
||||
void anim_par::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -106,9 +102,9 @@ void anim_seq::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
|
||||
void anim_seq::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
BOOST_FOREACH(const office_element_ptr& elm, anim_par_array_)
|
||||
for (size_t i = 0; i < anim_par_array_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
anim_par_array_[i]->pptx_convert(Context);
|
||||
}
|
||||
}
|
||||
void anim_seq::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -133,8 +129,7 @@ const wchar_t * anim_transitionFilter::name = L"transitionFilter";
|
||||
|
||||
void anim_transitionFilter::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
common_anim_smil_attlist_.add_attributes(Attributes);
|
||||
anim_transition_filter_attlist_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
@ -146,20 +141,20 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
|
||||
_CP_OPT(std::wstring) param;
|
||||
|
||||
if (anim_transition_filter_attlist_.smil_dur_)
|
||||
if (attlist_.smil_dur_)
|
||||
{
|
||||
time = anim_transition_filter_attlist_.smil_dur_->get_value();
|
||||
time = attlist_.smil_dur_->get_value();
|
||||
}
|
||||
if (anim_transition_filter_attlist_.smil_fadeColor_)
|
||||
if (attlist_.smil_fadeColor_)
|
||||
{
|
||||
color =anim_transition_filter_attlist_.smil_fadeColor_->get_hex_value();
|
||||
color =attlist_.smil_fadeColor_->get_hex_value();
|
||||
}
|
||||
|
||||
smil_transition_type::type transition_type;
|
||||
|
||||
if (anim_transition_filter_attlist_.smil_type_)
|
||||
if (attlist_.smil_type_)
|
||||
{
|
||||
transition_type = anim_transition_filter_attlist_.smil_type_->get_type();
|
||||
transition_type = attlist_.smil_type_->get_type();
|
||||
}
|
||||
|
||||
switch(transition_type)
|
||||
@ -168,13 +163,13 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
type = L"split";
|
||||
break;
|
||||
case smil_transition_type::irisWipe:
|
||||
if ((anim_transition_filter_attlist_.smil_subtype_) && (anim_transition_filter_attlist_.smil_subtype_.get()==L"diamond"))
|
||||
if ((attlist_.smil_subtype_) && (attlist_.smil_subtype_.get()==L"diamond"))
|
||||
type = L"diamond";
|
||||
else
|
||||
type = L"zoom";
|
||||
break;
|
||||
case smil_transition_type::miscDiagonalWipe:
|
||||
if ((anim_transition_filter_attlist_.smil_subtype_) && (anim_transition_filter_attlist_.smil_subtype_.get()==L"doubleDiamond"))
|
||||
if ((attlist_.smil_subtype_) && (attlist_.smil_subtype_.get()==L"doubleDiamond"))
|
||||
type = L"diamond";
|
||||
else
|
||||
type = L"zoom";
|
||||
@ -201,10 +196,10 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
case smil_transition_type::singleSweepWipe: //
|
||||
case smil_transition_type::doubleFanWipe: //
|
||||
type = L"wheel";
|
||||
if ((anim_transition_filter_attlist_.smil_subtype_) && (anim_transition_filter_attlist_.smil_subtype_.get()==L"oneBlade")) param = L"1";
|
||||
if ((anim_transition_filter_attlist_.smil_subtype_) && (anim_transition_filter_attlist_.smil_subtype_.get()==L"threeBlade"))param = L"3";
|
||||
if ((anim_transition_filter_attlist_.smil_subtype_) && (anim_transition_filter_attlist_.smil_subtype_.get()==L"fourBlade")) param = L"4";
|
||||
if ((anim_transition_filter_attlist_.smil_subtype_) && (anim_transition_filter_attlist_.smil_subtype_.get()==L"eightBlade"))param = L"8";
|
||||
if ((attlist_.smil_subtype_) && (attlist_.smil_subtype_.get()==L"oneBlade")) param = L"1";
|
||||
if ((attlist_.smil_subtype_) && (attlist_.smil_subtype_.get()==L"threeBlade")) param = L"3";
|
||||
if ((attlist_.smil_subtype_) && (attlist_.smil_subtype_.get()==L"fourBlade")) param = L"4";
|
||||
if ((attlist_.smil_subtype_) && (attlist_.smil_subtype_.get()==L"eightBlade")) param = L"8";
|
||||
break;
|
||||
case smil_transition_type::fanWipe:
|
||||
type = L"wedge";
|
||||
@ -215,22 +210,22 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
break;
|
||||
case smil_transition_type::checkerBoardWipe:
|
||||
type = L"checker";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"across") dir = L"horz";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"down") dir = L"vert";
|
||||
if (attlist_.smil_subtype_.get()==L"across") dir = L"horz";
|
||||
if (attlist_.smil_subtype_.get()==L"down") dir = L"vert";
|
||||
break;
|
||||
case smil_transition_type::blindsWipe:
|
||||
type = L"blinds";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"vertical") dir = L"vert";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"horizontal") dir = L"horz";
|
||||
if (attlist_.smil_subtype_.get()==L"vertical") dir = L"vert";
|
||||
if (attlist_.smil_subtype_.get()==L"horizontal") dir = L"horz";
|
||||
break;
|
||||
case smil_transition_type::diagonalWipe:
|
||||
case smil_transition_type::waterfallWipe:
|
||||
type = L"strips";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_)
|
||||
if (attlist_.smil_subtype_)
|
||||
{
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"horizontalLeft") dir = L"rd";
|
||||
else if(anim_transition_filter_attlist_.smil_subtype_.get()==L"horizontalRight")dir = L"lu";
|
||||
else if(anim_transition_filter_attlist_.smil_subtype_.get()==L"verticalRight") dir = L"ld";
|
||||
if (attlist_.smil_subtype_.get() == L"horizontalLeft") dir = L"rd";
|
||||
else if (attlist_.smil_subtype_.get() == L"horizontalRight") dir = L"lu";
|
||||
else if (attlist_.smil_subtype_.get() == L"verticalRight") dir = L"ld";
|
||||
else dir = L"ru";
|
||||
}
|
||||
break;
|
||||
@ -239,13 +234,13 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
break;
|
||||
case smil_transition_type::randomBarWipe:
|
||||
type = L"randomBar";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"vertical") dir = L"vert";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"horizontal") dir = L"horz";
|
||||
if (attlist_.smil_subtype_.get() == L"vertical") dir = L"vert";
|
||||
if (attlist_.smil_subtype_.get() == L"horizontal")dir = L"horz";
|
||||
break;
|
||||
case smil_transition_type::pushWipe:
|
||||
type = L"push";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"combVertical") {type = L"comb"; dir = L"vert";};
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"combHorizontal") {type = L"comb"; dir = L"horz";};
|
||||
if (attlist_.smil_subtype_.get()==L"combVertical") {type = L"comb"; dir = L"vert";};
|
||||
if (attlist_.smil_subtype_.get()==L"combHorizontal") {type = L"comb"; dir = L"horz";};
|
||||
break;
|
||||
case smil_transition_type::slideWipe:
|
||||
type = L"pull";
|
||||
@ -255,19 +250,19 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
break;
|
||||
case smil_transition_type::barnDoorWipe:
|
||||
type = L"split";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"vertical") param = L"vert";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"horizontal") param = L"horz";
|
||||
if (attlist_.smil_subtype_.get()==L"vertical") param = L"vert";
|
||||
if (attlist_.smil_subtype_.get()==L"horizontal") param = L"horz";
|
||||
break;
|
||||
case smil_transition_type::barWipe:
|
||||
type = L"wipe";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_)
|
||||
if (attlist_.smil_subtype_)
|
||||
{
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fromTopLeft") {type = L"strips"; dir = L"rd";}
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fromBottomLeft") {type = L"strips"; dir = L"ru";}
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fromTopRight") {type = L"strips"; dir = L"ld";}
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fromBottomRight"){type = L"strips"; dir = L"lu";}
|
||||
if (attlist_.smil_subtype_.get()==L"fromTopLeft") {type = L"strips"; dir = L"rd";}
|
||||
if (attlist_.smil_subtype_.get()==L"fromBottomLeft"){type = L"strips"; dir = L"ru";}
|
||||
if (attlist_.smil_subtype_.get()==L"fromTopRight") {type = L"strips"; dir = L"ld";}
|
||||
if (attlist_.smil_subtype_.get()==L"fromBottomRight"){type = L"strips"; dir = L"lu";}
|
||||
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fadeOverColor") {type = L"fade"; param = L"0";}
|
||||
if (attlist_.smil_subtype_.get()==L"fadeOverColor") {type = L"fade"; param = L"0";}
|
||||
}
|
||||
break;
|
||||
///////////////////////////////////////////////////////
|
||||
@ -285,39 +280,39 @@ void anim_transitionFilter::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
break;
|
||||
//////////////////////////////////////////////////////
|
||||
}
|
||||
if (anim_transition_filter_attlist_.smil_subtype_)
|
||||
if (attlist_.smil_subtype_)
|
||||
{
|
||||
if (!dir)
|
||||
{
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"leftToRight")
|
||||
if (attlist_.smil_subtype_.get()==L"leftToRight")
|
||||
{
|
||||
if ((anim_transition_filter_attlist_.smil_direction_) && (anim_transition_filter_attlist_.smil_direction_.get()==L"reverse"))dir = L"l";
|
||||
if ((attlist_.smil_direction_) && (attlist_.smil_direction_.get()==L"reverse"))dir = L"l";
|
||||
else dir = L"r";
|
||||
}
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"topToBottom")
|
||||
if (attlist_.smil_subtype_.get()==L"topToBottom")
|
||||
{
|
||||
if ((anim_transition_filter_attlist_.smil_direction_) && (anim_transition_filter_attlist_.smil_direction_.get()==L"reverse"))dir = L"u";
|
||||
if ((attlist_.smil_direction_) && (attlist_.smil_direction_.get()==L"reverse"))dir = L"u";
|
||||
else dir = L"d";
|
||||
}
|
||||
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fromTop") dir = L"d";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fromLeft") dir = L"r";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fromRight") dir = L"l";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fromBottom") dir = L"u";
|
||||
if (attlist_.smil_subtype_.get()==L"fromTop") dir = L"d";
|
||||
if (attlist_.smil_subtype_.get()==L"fromLeft") dir = L"r";
|
||||
if (attlist_.smil_subtype_.get()==L"fromRight") dir = L"l";
|
||||
if (attlist_.smil_subtype_.get()==L"fromBottom") dir = L"u";
|
||||
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"topRight") dir = L"ld";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"bottomLeft") dir = L"lu";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"bottomRight") dir = L"ru";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"topLeft") dir = L"rd";
|
||||
if (attlist_.smil_subtype_.get()==L"topRight") dir = L"ld";
|
||||
if (attlist_.smil_subtype_.get()==L"bottomLeft") dir = L"lu";
|
||||
if (attlist_.smil_subtype_.get()==L"bottomRight") dir = L"ru";
|
||||
if (attlist_.smil_subtype_.get()==L"topLeft") dir = L"rd";
|
||||
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fromTopLeft") dir = L"rd";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fromBottomLeft") dir = L"ru";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fromTopRight") dir = L"ld";
|
||||
if (anim_transition_filter_attlist_.smil_subtype_.get()==L"fromBottomRight")dir = L"lu";
|
||||
if (attlist_.smil_subtype_.get()==L"fromTopLeft") dir = L"rd";
|
||||
if (attlist_.smil_subtype_.get()==L"fromBottomLeft") dir = L"ru";
|
||||
if (attlist_.smil_subtype_.get()==L"fromTopRight") dir = L"ld";
|
||||
if (attlist_.smil_subtype_.get()==L"fromBottomRight")dir = L"lu";
|
||||
|
||||
}
|
||||
|
||||
if (!dir && (anim_transition_filter_attlist_.smil_direction_) && (anim_transition_filter_attlist_.smil_direction_.get()==L"reverse"))
|
||||
if (!dir && (attlist_.smil_direction_) && (attlist_.smil_direction_.get()==L"reverse"))
|
||||
dir = L"in";
|
||||
}
|
||||
|
||||
|
||||
@ -56,9 +56,11 @@ public:
|
||||
static const ElementType type = typeAnimPar;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
office_element_ptr anim_par_;
|
||||
office_element_ptr_array anim_seq_array_;
|
||||
office_element_ptr_array content_;
|
||||
odf_types::common_anim_smil_attlist attlist_;
|
||||
|
||||
office_element_ptr anim_par_;
|
||||
office_element_ptr_array anim_seq_array_;
|
||||
office_element_ptr_array content_;
|
||||
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
@ -79,7 +81,8 @@ public:
|
||||
static const ElementType type = typeAnimSeq;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
office_element_ptr_array anim_par_array_;
|
||||
odf_types::common_anim_smil_attlist attlist_;
|
||||
office_element_ptr_array anim_par_array_;
|
||||
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
@ -103,12 +106,12 @@ class anim_transition_filter_attlist
|
||||
public:
|
||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
_CP_OPT(std::wstring) smil_direction_;
|
||||
_CP_OPT(std::wstring) smil_subtype_;
|
||||
_CP_OPT(std::wstring) smil_direction_;
|
||||
_CP_OPT(std::wstring) smil_subtype_;
|
||||
_CP_OPT(odf_types::smil_transition_type) smil_type_;
|
||||
_CP_OPT(std::wstring) smil_mode_;
|
||||
_CP_OPT(odf_types::color) smil_fadeColor_;
|
||||
_CP_OPT(odf_types::clockvalue) smil_dur_;
|
||||
_CP_OPT(std::wstring) smil_mode_;
|
||||
_CP_OPT(odf_types::color) smil_fadeColor_;
|
||||
_CP_OPT(odf_types::clockvalue) smil_dur_;
|
||||
};
|
||||
|
||||
//anim:transitionFilter
|
||||
@ -122,11 +125,8 @@ public:
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
///////////////////////////////////////////////////////////
|
||||
odf_types::common_anim_smil_attlist common_anim_smil_attlist_;
|
||||
anim_transition_filter_attlist anim_transition_filter_attlist_;
|
||||
|
||||
|
||||
anim_transition_filter_attlist attlist_;
|
||||
private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
@ -161,7 +161,7 @@ style_table_cell_properties_attlist calc_table_cell_properties(const std::vector
|
||||
BOOST_FOREACH(const style_table_cell_properties* v, props)
|
||||
{
|
||||
if (v)
|
||||
result.apply_from(v->style_table_cell_properties_attlist_);
|
||||
result.apply_from(v->attlist_);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -804,18 +804,28 @@ void common_presentation_attlist::serialize(CP_ATTR_NODE)
|
||||
|
||||
void common_anim_smil_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
//CP_APPLY_ATTR(L"smil:direction", smil_direction_);
|
||||
// CP_APPLY_ATTR(L"smil:subtype", smil_subtype_);
|
||||
// CP_APPLY_ATTR(L"smil:type", smil_type_);
|
||||
//CP_APPLY_ATTR(L"smil:dur", smil_dur_);
|
||||
CP_APPLY_ATTR(L"smil:direction", smil_direction_);
|
||||
CP_APPLY_ATTR(L"smil:subtype", smil_subtype_);
|
||||
CP_APPLY_ATTR(L"smil:type", smil_type_);
|
||||
CP_APPLY_ATTR(L"smil:dur", smil_dur_);
|
||||
|
||||
}
|
||||
void common_anim_smil_attlist::apply_from(const common_anim_smil_attlist & Other)
|
||||
{
|
||||
//_CP_APPLY_PROP(smil_direction_, Other.smil_direction_);
|
||||
//_CP_APPLY_PROP(smil_subtype_, Other.smil_subtype_);
|
||||
//_CP_APPLY_PROP(smil_type_, Other.smil_type_);
|
||||
// _CP_APPLY_PROP(smil_dur_, Other.smil_dur_);
|
||||
_CP_APPLY_PROP(smil_direction_, Other.smil_direction_);
|
||||
_CP_APPLY_PROP(smil_subtype_, Other.smil_subtype_);
|
||||
_CP_APPLY_PROP(smil_type_, Other.smil_type_);
|
||||
_CP_APPLY_PROP(smil_dur_, Other.smil_dur_);
|
||||
}
|
||||
void common_anim_smil_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"smil:direction", smil_direction_);
|
||||
CP_XML_ATTR_OPT(L"smil:subtype", smil_subtype_);
|
||||
CP_XML_ATTR_OPT(L"smil:type", smil_type_);
|
||||
CP_XML_ATTR_OPT(L"smil:restart", smil_restart_);
|
||||
CP_XML_ATTR_OPT(L"smil:dur", smil_dur_);
|
||||
CP_XML_ATTR_OPT(L"presentation:node-type", presentation_node_type_);
|
||||
CP_XML_ATTR_OPT(L"smil:begin", smil_begin_);
|
||||
}
|
||||
void union_common_draw_attlists::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
|
||||
@ -575,14 +575,18 @@ class common_anim_smil_attlist
|
||||
public:
|
||||
void add_attributes ( const xml::attributes_wc_ptr & Attributes );
|
||||
void apply_from (const common_anim_smil_attlist & Other);
|
||||
void serialize (CP_ATTR_NODE){}
|
||||
void serialize (CP_ATTR_NODE);
|
||||
|
||||
//_CP_OPT(std::wstring) smil_direction_;
|
||||
//_CP_OPT(std::wstring) smil_subtype_;
|
||||
//_CP_OPT(std::wstring) smil_type_;
|
||||
//_CP_OPT(std::wstring) smil_dur_;
|
||||
_CP_OPT(std::wstring) presentation_node_type_;
|
||||
_CP_OPT(std::wstring) smil_direction_;
|
||||
_CP_OPT(std::wstring) smil_restart_;
|
||||
_CP_OPT(std::wstring) smil_subtype_;
|
||||
_CP_OPT(std::wstring) smil_type_;
|
||||
_CP_OPT(std::wstring) smil_dur_;
|
||||
|
||||
//_CP_OPT(color) smil_fadeColor;
|
||||
_CP_OPT(std::wstring) smil_begin_;
|
||||
|
||||
_CP_OPT(color) smil_fadeColor;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -251,7 +251,11 @@ static const _shape_converter _OO_OOX_custom_shapes[]=
|
||||
{L"" ,L"accentBorderCallout3",0 ,0 ,0 },
|
||||
{L"" ,L"accentBorderCallout2",0 ,0 ,0 },
|
||||
{L"" ,L"accentBorderCallout1",0 ,0 ,0 },
|
||||
{L"" ,L"halfFrame" ,0 ,0 ,0 }
|
||||
{L"" ,L"halfFrame" ,0 ,0 ,0 },
|
||||
{L"" ,L"leftCircularArrow",0 ,0 ,0 },
|
||||
{L"" ,L"leftRightRibbon",0 ,0 ,0 },
|
||||
{L"" ,L"pieWedge",0 ,0 ,0 },
|
||||
{L"" ,L"swooshArrow",0 ,0 ,0 }
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -200,7 +200,11 @@ double pt_to_cm(double Val)
|
||||
return Val / 28.34467120181406;
|
||||
|
||||
}
|
||||
|
||||
double pt_to_mm(double Val)
|
||||
{
|
||||
return Val / 2.834467120181406;
|
||||
|
||||
}
|
||||
double to_pt(const length & Val)
|
||||
{
|
||||
switch(Val.get_unit())
|
||||
@ -247,7 +251,11 @@ double length::get_value_unit(unit Unit) const
|
||||
{
|
||||
return pt_to_cm( to_pt(*this) );
|
||||
}
|
||||
else
|
||||
else if (Unit == mm)
|
||||
{
|
||||
return pt_to_mm( to_pt(*this) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@ -41,22 +41,22 @@ std::wostream & operator << (std::wostream & _Wostream, const presentation_class
|
||||
std::wstring res = L"";
|
||||
switch(_Val.get_type())
|
||||
{
|
||||
case presentation_class::title: _Wostream << L"title" ; break;
|
||||
case presentation_class::subtitle: _Wostream << L"subtitle" ; break;
|
||||
case presentation_class::graphic: _Wostream << L"graphic" ; break;
|
||||
case presentation_class::object: _Wostream << L"object" ; break;
|
||||
case presentation_class::chart: _Wostream << L"chart" ; break;
|
||||
case presentation_class::table: _Wostream << L"table" ; break;
|
||||
case presentation_class::orgchart: _Wostream << L"orgchart" ; break;
|
||||
case presentation_class::header: _Wostream << L"header" ; break;
|
||||
case presentation_class::footer: _Wostream << L"footer" ; break;
|
||||
case presentation_class::date_time: _Wostream << L"date_time" ; break;
|
||||
case presentation_class::page_number: _Wostream << L"page_number" ; break;
|
||||
case presentation_class::page: _Wostream << L"page" ; break;
|
||||
case presentation_class::notes: _Wostream << L"notes" ; break;
|
||||
case presentation_class::handout: _Wostream << L"handout" ; break;
|
||||
case presentation_class::outline: _Wostream << L"outline" ; break;
|
||||
case presentation_class::text: _Wostream << L"text" ; break;
|
||||
case presentation_class::title: _Wostream << L"title"; break;
|
||||
case presentation_class::subtitle: _Wostream << L"subtitle"; break;
|
||||
case presentation_class::graphic: _Wostream << L"graphic"; break;
|
||||
case presentation_class::object: _Wostream << L"object"; break;
|
||||
case presentation_class::chart: _Wostream << L"chart"; break;
|
||||
case presentation_class::table: _Wostream << L"table"; break;
|
||||
case presentation_class::orgchart: _Wostream << L"orgchart"; break;
|
||||
case presentation_class::header: _Wostream << L"header"; break;
|
||||
case presentation_class::footer: _Wostream << L"footer"; break;
|
||||
case presentation_class::date_time: _Wostream << L"date-time"; break;
|
||||
case presentation_class::page_number: _Wostream << L"page-number";break;
|
||||
case presentation_class::page: _Wostream << L"page"; break;
|
||||
case presentation_class::notes: _Wostream << L"notes"; break;
|
||||
case presentation_class::handout: _Wostream << L"handout"; break;
|
||||
case presentation_class::outline: _Wostream << L"outline"; break;
|
||||
case presentation_class::text: _Wostream << L"text"; break;
|
||||
}
|
||||
return _Wostream;
|
||||
}
|
||||
@ -65,41 +65,24 @@ presentation_class presentation_class::parse(const std::wstring & Str)
|
||||
std::wstring tmp = Str;
|
||||
boost::algorithm::to_lower(tmp);
|
||||
|
||||
if (tmp == L"page")
|
||||
return presentation_class( page );
|
||||
else if (tmp == L"title")
|
||||
return presentation_class( title);
|
||||
else if (tmp == L"outline")
|
||||
return presentation_class( outline );
|
||||
else if (tmp == L"subtitle")
|
||||
return presentation_class( subtitle);
|
||||
else if (tmp == L"text")
|
||||
return presentation_class( text);
|
||||
else if (tmp == L"graphic")
|
||||
return presentation_class( graphic );
|
||||
else if (tmp == L"object")
|
||||
return presentation_class( object );
|
||||
else if (tmp == L"chart")
|
||||
return presentation_class( chart );
|
||||
else if (tmp == L"table")
|
||||
return presentation_class( table );
|
||||
else if (tmp == L"orgchart")
|
||||
return presentation_class( orgchart );
|
||||
else if (tmp == L"notes")
|
||||
return presentation_class( notes );
|
||||
else if (tmp == L"handout")
|
||||
return presentation_class( handout );
|
||||
else if (tmp == L"header")
|
||||
return presentation_class( header );
|
||||
else if (tmp == L"footer")
|
||||
return presentation_class( footer );
|
||||
else if (tmp == L"date-time")
|
||||
return presentation_class( date_time );
|
||||
else if (tmp == L"page-number")
|
||||
return presentation_class( page_number );
|
||||
else
|
||||
if (tmp == L"page") return presentation_class( page );
|
||||
else if (tmp == L"title") return presentation_class( title);
|
||||
else if (tmp == L"outline") return presentation_class( outline );
|
||||
else if (tmp == L"subtitle") return presentation_class( subtitle);
|
||||
else if (tmp == L"text") return presentation_class( text);
|
||||
else if (tmp == L"graphic") return presentation_class( graphic );
|
||||
else if (tmp == L"object") return presentation_class( object );
|
||||
else if (tmp == L"chart") return presentation_class( chart );
|
||||
else if (tmp == L"table") return presentation_class( table );
|
||||
else if (tmp == L"orgchart") return presentation_class( orgchart );
|
||||
else if (tmp == L"notes") return presentation_class( notes );
|
||||
else if (tmp == L"handout") return presentation_class( handout );
|
||||
else if (tmp == L"header") return presentation_class( header );
|
||||
else if (tmp == L"footer") return presentation_class( footer );
|
||||
else if (tmp == L"date-time") return presentation_class( date_time );
|
||||
else if (tmp == L"page-number") return presentation_class( page_number );
|
||||
else
|
||||
{
|
||||
BOOST_THROW_EXCEPTION( errors::invalid_attribute() );
|
||||
return presentation_class( page );
|
||||
}
|
||||
}
|
||||
@ -143,13 +126,15 @@ std::wstring presentation_class::get_type_ms()
|
||||
res = L"sldNum";
|
||||
break;
|
||||
case subtitle:
|
||||
case page:
|
||||
case notes:
|
||||
case handout:
|
||||
case outline:
|
||||
case text:
|
||||
res = L"body";
|
||||
break;
|
||||
case page:
|
||||
res = L"sldImg";
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ length ComputeContextWidth(const style_page_layout_properties * pageProperties
|
||||
if (pagePropertiesNode)
|
||||
{
|
||||
if (const style_columns * styleColumns
|
||||
= dynamic_cast<const style_columns*>( pagePropertiesNode->style_page_layout_properties_elements_.style_columns_.get()))
|
||||
= dynamic_cast<const style_columns*>( pagePropertiesNode->elements_.style_columns_.get()))
|
||||
{
|
||||
columnsCount = styleColumns->fo_column_count_.get_value_or(1);
|
||||
if (!columnsCount)
|
||||
@ -784,7 +784,7 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, const unio
|
||||
style_page_layout_properties_attlist emptyPageProperties;
|
||||
|
||||
const style_page_layout_properties_attlist & pageProperties =
|
||||
pagePropertiesNode ? pagePropertiesNode->style_page_layout_properties_attlist_ : emptyPageProperties;
|
||||
pagePropertiesNode ? pagePropertiesNode->attlist_ : emptyPageProperties;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@ -32,13 +32,9 @@
|
||||
|
||||
#include "draw_page.h"
|
||||
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <cpdoccore/xml/xmlchar.h>
|
||||
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include "serialize_elements.h"
|
||||
#include "odfcontext.h"
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
@ -78,13 +74,15 @@ void draw_page::add_child_element( xml::sax * Reader, const std::wstring & Ns, c
|
||||
{
|
||||
if CP_CHECK_NAME(L"anim", L"par")
|
||||
CP_CREATE_ELEMENT(animation_);
|
||||
else if (L"presentation" == Ns && L"notes" == Name)
|
||||
CP_CREATE_ELEMENT(presentation_notes_);
|
||||
else
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
|
||||
void draw_page::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
draw_page_attr_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void draw_page::pptx_convert_placeHolder(oox::pptx_conversion_context & Context, std::wstring styleName, presentation_class::type PresentationClass)
|
||||
@ -96,7 +94,7 @@ void draw_page::pptx_convert_placeHolder(oox::pptx_conversion_context & Context,
|
||||
|
||||
int index=-1;
|
||||
|
||||
const std::wstring masterName = draw_page_attr_.master_page_name_.get_value_or(L"");
|
||||
const std::wstring masterName = attlist_.master_page_name_.get_value_or(L"");
|
||||
style_master_page * master = Context.root()->odf_context().pageLayoutContainer().master_page_by_name(masterName);
|
||||
|
||||
if (master)
|
||||
@ -129,16 +127,16 @@ void draw_page::pptx_convert_placeHolder(oox::pptx_conversion_context & Context,
|
||||
|
||||
void draw_page::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
const std::wstring pageStyleName = draw_page_attr_.draw_style_name_.get_value_or(L"");
|
||||
const std::wstring pageName = draw_page_attr_.draw_name_.get_value_or(L"");
|
||||
const std::wstring layoutName = draw_page_attr_.page_layout_name_.get_value_or(L"");
|
||||
const std::wstring masterName = draw_page_attr_.master_page_name_.get_value_or(L"");
|
||||
const std::wstring pageStyleName = attlist_.draw_style_name_.get_value_or(L"");
|
||||
const std::wstring pageName = attlist_.draw_name_.get_value_or(L"");
|
||||
const std::wstring layoutName = attlist_.page_layout_name_.get_value_or(L"");
|
||||
const std::wstring masterName = attlist_.master_page_name_.get_value_or(L"");
|
||||
|
||||
_CP_LOG << L"[info][xlsx] process page(slide) \"" << pageName /*L"" */<< L"\"" << std::endl;
|
||||
_CP_LOG << L"[info][pptx] process page(slide) \"" << pageName /*L"" */<< L"\"" << std::endl;
|
||||
|
||||
Context.start_page(pageName, pageStyleName, layoutName,masterName);
|
||||
|
||||
if (draw_page_attr_.draw_style_name_)
|
||||
if (attlist_.draw_style_name_)
|
||||
{
|
||||
style_instance * style_inst = Context.root()->odf_context().styleContainer().style_by_name(pageStyleName,style_family::DrawingPage,false);
|
||||
|
||||
@ -191,23 +189,30 @@ void draw_page::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
animation_->pptx_convert(Context);
|
||||
}
|
||||
/////////////////////////
|
||||
BOOST_FOREACH(const office_element_ptr& elm, content_)
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
|
||||
if (draw_page_attr_.use_footer_name_)//from master_page
|
||||
if (attlist_.use_footer_name_)//from master_page
|
||||
{
|
||||
std::wstring name = L"footer:" + *draw_page_attr_.use_footer_name_;
|
||||
std::wstring name = L"footer:" + *attlist_.use_footer_name_;
|
||||
pptx_convert_placeHolder(Context, name, presentation_class::footer);
|
||||
}
|
||||
if (draw_page_attr_.use_date_time_name_)//from master_page
|
||||
if (attlist_.use_date_time_name_)//from master_page
|
||||
{
|
||||
std::wstring name = L"datetime:" + *draw_page_attr_.use_date_time_name_;
|
||||
std::wstring name = L"datetime:" + *attlist_.use_date_time_name_;
|
||||
pptx_convert_placeHolder(Context, name, presentation_class::date_time);
|
||||
}
|
||||
|
||||
Context.end_page();
|
||||
|
||||
Context.end_page();
|
||||
if (presentation_notes_)
|
||||
{
|
||||
Context.start_page_notes();
|
||||
presentation_notes_->pptx_convert(Context);
|
||||
Context.end_page_notes();
|
||||
}
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * presentation_footer_decl::ns = L"presentation";
|
||||
@ -243,6 +248,117 @@ void presentation_date_time_decl::pptx_convert(oox::pptx_conversion_context & Co
|
||||
{
|
||||
Context.get_text_context().add_text(text_);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * presentation_notes::ns = L"presentation";
|
||||
const wchar_t * presentation_notes::name = L"notes";
|
||||
|
||||
void presentation_notes::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
|
||||
void presentation_notes::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void presentation_notes::pptx_convert_placeHolder(oox::pptx_conversion_context & Context, std::wstring styleName, presentation_class::type PresentationClass)
|
||||
{
|
||||
office_element_ptr elm = Context.root()->odf_context().drawStyles().find_by_style_name(styleName);
|
||||
//todooo если это элемент datatime -нужно вытащить формат поля
|
||||
|
||||
if (!elm)return;
|
||||
|
||||
int index=-1;
|
||||
|
||||
const std::wstring masterName = attlist_.master_page_name_.get_value_or(L"");
|
||||
style_master_page * master = Context.root()->odf_context().pageLayoutContainer().master_page_by_name(masterName);
|
||||
|
||||
//if (master)
|
||||
// index = master->find_placeHolderIndex(PresentationClass, Context.last_idx_placeHolder);
|
||||
|
||||
|
||||
Context.get_slide_context().start_shape(1);
|
||||
Context.get_slide_context().set_placeHolder_type(presentation_class(PresentationClass).get_type_ms());
|
||||
Context.get_slide_context().set_placeHolder_idx(index);
|
||||
|
||||
Context.get_text_context().start_object();
|
||||
|
||||
if (PresentationClass == presentation_class::date_time)
|
||||
{
|
||||
Context.get_text_context().start_field(oox::datetime, L"");
|
||||
}
|
||||
|
||||
elm->pptx_convert(Context);
|
||||
|
||||
std::wstring text_content_ = Context.get_text_context().end_object();
|
||||
|
||||
if (text_content_.length()>0)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"text-content",text_content_));
|
||||
}
|
||||
Context.get_slide_context().set_property(_property(L"no_rect",true));
|
||||
Context.get_slide_context().end_shape();
|
||||
|
||||
}
|
||||
|
||||
void presentation_notes::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
const std::wstring pageStyleName = attlist_.draw_style_name_.get_value_or(L"");
|
||||
const std::wstring layoutName = attlist_.page_layout_name_.get_value_or(L"");
|
||||
const std::wstring masterName = attlist_.master_page_name_.get_value_or(L"");
|
||||
|
||||
_CP_LOG << L"[info][pptx] process note slide" << std::endl;
|
||||
|
||||
if (attlist_.draw_style_name_)
|
||||
{
|
||||
style_instance * style_inst = Context.root()->odf_context().styleContainer().style_by_name(pageStyleName, style_family::DrawingPage, Context.process_masters_);
|
||||
|
||||
if ((style_inst) && (style_inst->content()))
|
||||
{
|
||||
const style_drawing_page_properties * properties = style_inst->content()->get_style_drawing_page_properties();
|
||||
|
||||
if (properties)
|
||||
{
|
||||
oox::_oox_fill fill;
|
||||
Compute_GraphicFill(properties->content().common_draw_fill_attlist_, office_element_ptr(),
|
||||
Context.root()->odf_context().drawStyles() ,fill);
|
||||
Context.get_slide_context().add_background(fill);
|
||||
|
||||
////////////////////////////////////////////////
|
||||
if ((properties->content().presentation_display_footer_) && (*properties->content().presentation_display_footer_))
|
||||
Context.get_slide_context().set_footer();
|
||||
|
||||
if ((properties->content().presentation_display_header_) && (*properties->content().presentation_display_header_))
|
||||
Context.get_slide_context().set_header();
|
||||
|
||||
if ((properties->content().presentation_display_page_number_) && (*properties->content().presentation_display_page_number_))
|
||||
Context.get_slide_context().set_page_number();
|
||||
|
||||
if ((properties->content().presentation_display_date_time_) && (*properties->content().presentation_display_date_time_))
|
||||
Context.get_slide_context().set_date_time();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
|
||||
if (attlist_.use_footer_name_)//from master_page_notes
|
||||
{
|
||||
std::wstring name = L"footer:" + *attlist_.use_footer_name_;
|
||||
pptx_convert_placeHolder(Context, name, presentation_class::footer);
|
||||
}
|
||||
if (attlist_.use_date_time_name_)//from master_page_notes
|
||||
{
|
||||
std::wstring name = L"datetime:" + *attlist_.use_date_time_name_;
|
||||
pptx_convert_placeHolder(Context, name, presentation_class::date_time);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,11 +79,11 @@ private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
private:
|
||||
office_element_ptr_array content_;
|
||||
office_element_ptr animation_;
|
||||
office_element_ptr_array content_;
|
||||
office_element_ptr animation_;
|
||||
office_element_ptr presentation_notes_;
|
||||
|
||||
draw_page_attr draw_page_attr_;
|
||||
draw_page_attr attlist_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_page);
|
||||
@ -139,5 +139,28 @@ private:
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(presentation_date_time_decl);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//presentation:date-time-decl
|
||||
class presentation_notes : public office_element_impl<presentation_notes>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typePresentationNotes;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
private:
|
||||
void pptx_convert_placeHolder(oox::pptx_conversion_context & Context, std::wstring styleName, odf_types::presentation_class::type PresentationClass);
|
||||
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
office_element_ptr_array content_;
|
||||
draw_page_attr attlist_;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(presentation_notes);
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,10 +163,10 @@ void draw_line::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
}
|
||||
void draw_line::reset_svg_attributes()
|
||||
{
|
||||
double x1=draw_line_attlist_.svg_x1_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double y1=draw_line_attlist_.svg_y1_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double x2=draw_line_attlist_.svg_x2_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double y2=draw_line_attlist_.svg_y2_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double x1 = draw_line_attlist_.svg_x1_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double y1 = draw_line_attlist_.svg_y1_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double x2 = draw_line_attlist_.svg_x2_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
double y2 = draw_line_attlist_.svg_y2_.get_value_or(length(0)).get_value_unit(length::pt);
|
||||
|
||||
if (x1 > x2)
|
||||
{
|
||||
@ -431,8 +431,8 @@ void draw_equation::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
}
|
||||
int draw_enhanced_geometry::parsing(_CP_OPT(std::wstring) val)
|
||||
{
|
||||
int pos=0, res=-1;
|
||||
if (!val)return res;
|
||||
int pos = 0, res = -1;
|
||||
if (!val) return res;
|
||||
|
||||
BOOST_FOREACH(wchar_t c, val.get())
|
||||
{
|
||||
@ -453,6 +453,7 @@ void draw_enhanced_geometry_attlist::add_attributes( const xml::attributes_wc_pt
|
||||
CP_APPLY_ATTR(L"draw:modifiers" , draw_modifiers_);
|
||||
CP_APPLY_ATTR(L"draw:text-path" , draw_text_path_);
|
||||
CP_APPLY_ATTR(L"draw:enhanced-path" , draw_enhanced_path_);
|
||||
CP_APPLY_ATTR(L"drawooo:enhanced-path" , drawooo_enhanced_path_);
|
||||
CP_APPLY_ATTR(L"drawooo:sub-view-size" , drawooo_sub_view_size_);
|
||||
}
|
||||
// draw:enhanced_geometry
|
||||
@ -485,6 +486,9 @@ void draw_enhanced_geometry::add_child_element( xml::sax * Reader, const std::ws
|
||||
}
|
||||
void draw_enhanced_geometry::find_draw_type_oox()
|
||||
{
|
||||
word_art_ = false;
|
||||
bOoxType_ = false;
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.draw_text_path_ &&
|
||||
*draw_enhanced_geometry_attlist_.draw_text_path_ == true)
|
||||
{
|
||||
@ -501,7 +505,7 @@ void draw_enhanced_geometry::find_draw_type_oox()
|
||||
{
|
||||
int count = sizeof(_OO_OOX_wordart) / sizeof(_shape_converter);
|
||||
|
||||
for (long i=0; i< count; i++)
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (_OO_OOX_wordart[i].odf_reader == odf_type)
|
||||
{
|
||||
@ -518,7 +522,7 @@ void draw_enhanced_geometry::find_draw_type_oox()
|
||||
|
||||
if (pos < 0)
|
||||
{
|
||||
for (long i=0; i< count; i++)
|
||||
for (long i = 0; i< count; i++)
|
||||
{
|
||||
if (_OO_OOX_custom_shapes[i].odf_reader == odf_type)
|
||||
{
|
||||
@ -530,10 +534,11 @@ void draw_enhanced_geometry::find_draw_type_oox()
|
||||
else
|
||||
{
|
||||
std::wstring oox_type = odf_type.substr(pos + 6);
|
||||
for (long i=0; i< count; i++)
|
||||
for (long i = 0; i< count; i++)
|
||||
{
|
||||
if (_OO_OOX_custom_shapes[i].oox == oox_type)
|
||||
{
|
||||
bOoxType_ = true;
|
||||
draw_type_oox_index_ = i;
|
||||
break;
|
||||
}
|
||||
@ -545,38 +550,36 @@ void draw_enhanced_geometry::find_draw_type_oox()
|
||||
}
|
||||
}
|
||||
}
|
||||
std::wstringstream str;
|
||||
// for (size_t i = 0; i < draw_handle_.size(); i++)
|
||||
// {
|
||||
//draw_handle * handle = dynamic_cast<draw_handle *>(draw_handle_[i].get());
|
||||
//if (!handle) continue;
|
||||
|
||||
BOOST_FOREACH(const office_element_ptr & parElement, draw_handle_)
|
||||
{
|
||||
draw_handle * handle = dynamic_cast<draw_handle *>(parElement.get());
|
||||
|
||||
int min = -1;
|
||||
int max = -1;
|
||||
|
||||
try
|
||||
{
|
||||
min = parsing(handle->draw_handle_attlist_.draw_handle_range_y_minimum_);//пока статик .. и выдается только цыфровое значение
|
||||
if (min<0)min = parsing(handle->draw_handle_attlist_.draw_handle_range_x_minimum_);
|
||||
if (min<0)min = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_minimum_);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
}
|
||||
if (min < 0 ) min=0;
|
||||
//int min = -1, max = -1;
|
||||
//
|
||||
//try
|
||||
//{
|
||||
// min = parsing(handle->draw_handle_attlist_.draw_handle_range_y_minimum_);//пока статик .. и выдается только цыфровое значение
|
||||
// if (min < 0) min = parsing(handle->draw_handle_attlist_.draw_handle_range_x_minimum_);
|
||||
// if (min < 0) min = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_minimum_);
|
||||
//}
|
||||
//catch(...)
|
||||
//{
|
||||
//}
|
||||
//if (min < 0 ) min=0;
|
||||
|
||||
try
|
||||
{
|
||||
max = parsing(handle->draw_handle_attlist_.draw_handle_range_y_maximum_);
|
||||
if (max < 0) max = parsing(handle->draw_handle_attlist_.draw_handle_range_x_maximum_);
|
||||
if (max < 0) max = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_maximum_);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
}
|
||||
draw_handle_geometry elm={min, max};
|
||||
draw_handle_geometry_.push_back(elm);
|
||||
}
|
||||
//try
|
||||
//{
|
||||
// max = parsing(handle->draw_handle_attlist_.draw_handle_range_y_maximum_);
|
||||
// if (max < 0) max = parsing(handle->draw_handle_attlist_.draw_handle_range_x_maximum_);
|
||||
// if (max < 0) max = parsing(handle->draw_handle_attlist_.draw_handle_radius_range_maximum_);
|
||||
//}
|
||||
//catch(...)
|
||||
//{
|
||||
//}
|
||||
//draw_handle_geometry elm = {min, max};
|
||||
//draw_handle_geometry_.push_back(elm);
|
||||
// }
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// draw-caption-attlist
|
||||
|
||||
@ -437,6 +437,7 @@ public:
|
||||
_CP_OPT(std::wstring) draw_modifiers_;
|
||||
_CP_OPT(bool) draw_text_path_;
|
||||
_CP_OPT(std::wstring) draw_enhanced_path_;
|
||||
_CP_OPT(std::wstring) drawooo_enhanced_path_;
|
||||
_CP_OPT(std::wstring) drawooo_sub_view_size_;
|
||||
};
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
@ -464,7 +465,9 @@ public:
|
||||
_CP_OPT(int) sub_type_;
|
||||
_CP_OPT(int) draw_type_oox_index_;
|
||||
_CP_OPT(std::wstring) svg_viewbox_;
|
||||
|
||||
bool word_art_;
|
||||
bool bOoxType_;
|
||||
|
||||
typedef std::pair<std::wstring,std::wstring> pair_string_value;
|
||||
|
||||
|
||||
@ -246,20 +246,27 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
|
||||
|
||||
if (draw_type_oox_index_)
|
||||
{
|
||||
shape->additional_.push_back(_property(L"odf-custom-draw-index", draw_type_oox_index_.get()));
|
||||
shape->additional_.push_back(_property(L"oox-geom-index", draw_type_oox_index_.get()));
|
||||
shape->additional_.push_back(_property(L"oox-geom", bOoxType_));
|
||||
|
||||
if (shape->word_art_ == true)
|
||||
shape->additional_.push_back(_property(L"wordArt", true));
|
||||
|
||||
set_shape = true;
|
||||
}
|
||||
|
||||
if (sub_type_)
|
||||
{
|
||||
shape->sub_type_ = sub_type_.get();
|
||||
set_shape = true;
|
||||
}
|
||||
std::wstring odf_path; //общая часть - объединить ...
|
||||
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
|
||||
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
if (!odf_path.empty())
|
||||
{
|
||||
std::vector<::svg_path::_polyline> o_Polyline;
|
||||
|
||||
@ -267,14 +274,14 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
|
||||
|
||||
try
|
||||
{
|
||||
res = ::svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
|
||||
res = ::svg_path::parseSvgD(o_Polyline, odf_path, true);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
res = false;
|
||||
}
|
||||
|
||||
if (o_Polyline.size() > 1 && res )
|
||||
if (!o_Polyline.empty() && res )
|
||||
{
|
||||
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
|
||||
std::wstringstream output_;
|
||||
@ -311,14 +318,10 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
|
||||
{
|
||||
shape->additional_.push_back(_property(L"draw-modifiers",draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
if (draw_handle_geometry_.size()>0)
|
||||
if (bOoxType_)
|
||||
shape->additional_.push_back(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
else
|
||||
{
|
||||
if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
|
||||
{
|
||||
shape->additional_.push_back(_property(L"draw-modifiers-min",draw_handle_geometry_[0].min));
|
||||
shape->additional_.push_back(_property(L"draw-modifiers-max",draw_handle_geometry_[0].max));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -326,7 +329,6 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
|
||||
{
|
||||
shape->bad_shape_ = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -312,8 +312,9 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
|
||||
|
||||
if (draw_type_oox_index_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"odf-custom-draw-index", draw_type_oox_index_.get()));
|
||||
|
||||
Context.get_slide_context().set_property(_property(L"oox-geom-index", draw_type_oox_index_.get()));
|
||||
Context.get_slide_context().set_property(_property(L"oox-geom", bOoxType_));
|
||||
|
||||
if (word_art_ == true)
|
||||
Context.get_slide_context().set_property(_property(L"wordArt", true));
|
||||
|
||||
@ -325,7 +326,13 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
|
||||
set_shape = true;
|
||||
}
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
std::wstring odf_path;
|
||||
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
|
||||
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
|
||||
|
||||
if (!odf_path.empty())
|
||||
{
|
||||
std::vector<::svg_path::_polyline> o_Polyline;
|
||||
|
||||
@ -333,7 +340,7 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
|
||||
|
||||
try
|
||||
{
|
||||
res = ::svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
|
||||
res = ::svg_path::parseSvgD(o_Polyline, odf_path, true);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@ -375,16 +382,20 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
|
||||
}
|
||||
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"draw-modifiers",draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
|
||||
if (draw_handle_geometry_.size()>0)
|
||||
if (bOoxType_)
|
||||
Context.get_slide_context().set_property(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
else
|
||||
{
|
||||
if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
|
||||
{
|
||||
Context.get_slide_context().set_property(_property(L"draw-modifiers-min",draw_handle_geometry_[0].min));
|
||||
Context.get_slide_context().set_property(_property(L"draw-modifiers-max",draw_handle_geometry_[0].max));
|
||||
}
|
||||
}
|
||||
|
||||
//if (draw_handle_geometry_.size()>0)
|
||||
//{
|
||||
// if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
|
||||
// {
|
||||
// Context.get_slide_context().set_property(_property(L"draw-modifiers-min",draw_handle_geometry_[0].min));
|
||||
// Context.get_slide_context().set_property(_property(L"draw-modifiers-max",draw_handle_geometry_[0].max));
|
||||
// }
|
||||
//}
|
||||
}
|
||||
if (!set_shape)
|
||||
{
|
||||
|
||||
@ -258,7 +258,8 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
|
||||
if (draw_type_oox_index_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"odf-custom-draw-index", draw_type_oox_index_.get()));
|
||||
Context.get_drawing_context().set_property(_property(L"oox-geom-index", draw_type_oox_index_.get()));
|
||||
Context.get_drawing_context().set_property(_property(L"oox-geom", bOoxType_));
|
||||
|
||||
if (word_art_ == true)
|
||||
Context.get_drawing_context().set_property(_property(L"wordArt", true));
|
||||
@ -269,7 +270,13 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
Context.get_drawing_context().start_shape(sub_type_.get());
|
||||
}
|
||||
|
||||
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
std::wstring odf_path;
|
||||
if (draw_enhanced_geometry_attlist_.drawooo_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.drawooo_enhanced_path_.get();
|
||||
else if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
|
||||
odf_path = draw_enhanced_geometry_attlist_.draw_enhanced_path_.get();
|
||||
|
||||
if (!odf_path.empty())
|
||||
{
|
||||
std::vector<::svg_path::_polyline> o_Polyline;
|
||||
|
||||
@ -277,7 +284,7 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
|
||||
try
|
||||
{
|
||||
res = ::svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
|
||||
res = ::svg_path::parseSvgD(o_Polyline, odf_path, true);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
@ -321,15 +328,10 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
}
|
||||
if (draw_enhanced_geometry_attlist_.draw_modifiers_)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"draw-modifiers",draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
|
||||
if (draw_handle_geometry_.size()>0)
|
||||
if (bOoxType_)
|
||||
Context.get_drawing_context().set_property(_property(L"oox-draw-modifiers", draw_enhanced_geometry_attlist_.draw_modifiers_.get()));
|
||||
else
|
||||
{
|
||||
if (draw_handle_geometry_[0].min < draw_handle_geometry_[0].max)
|
||||
{
|
||||
Context.get_drawing_context().set_property(_property(L"draw-modifiers-min",draw_handle_geometry_[0].min));
|
||||
Context.get_drawing_context().set_property(_property(L"draw-modifiers-max",draw_handle_geometry_[0].max));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -292,7 +292,7 @@ void math_mstyle::oox_convert(oox::math_context & Context)
|
||||
{
|
||||
CP_XML_NODE(L"m:ctrlPr")
|
||||
{
|
||||
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -317,7 +317,7 @@ void math_mstyle::oox_convert(oox::math_context & Context)
|
||||
{
|
||||
CP_XML_NODE(L"m:ctrlPr")
|
||||
{
|
||||
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ void math_mi::oox_convert(oox::math_context & Context)
|
||||
}
|
||||
}
|
||||
|
||||
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
|
||||
CP_XML_NODE(L"m:t")
|
||||
{
|
||||
@ -162,7 +162,7 @@ void math_mo::oox_convert(oox::math_context & Context)
|
||||
{
|
||||
// + доп стили текста ... todoooo
|
||||
|
||||
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
|
||||
CP_XML_NODE(L"m:t")
|
||||
{
|
||||
@ -203,7 +203,7 @@ void math_mn::oox_convert(oox::math_context & Context)
|
||||
{
|
||||
// + доп стили текста ... todoooo
|
||||
|
||||
Context.text_properties_->content().oox_convert(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
Context.text_properties_->content().oox_serialize(CP_XML_STREAM(), Context.graphRPR_, Context.fonts_container_);
|
||||
|
||||
CP_XML_NODE(L"m:t")
|
||||
{
|
||||
|
||||
@ -462,8 +462,8 @@ void odf_document::Impl::parse_styles()
|
||||
continue;
|
||||
}
|
||||
|
||||
const std::wstring styleName = masterPage->style_master_page_attlist_.style_name_.get_value_or(L"");
|
||||
const std::wstring pageLayoutName = masterPage->style_master_page_attlist_.style_page_layout_name_.get_value_or(L"");
|
||||
const std::wstring styleName = masterPage->attlist_.style_name_.get_value_or(L"");
|
||||
const std::wstring pageLayoutName = masterPage->attlist_.style_page_layout_name_.get_value_or(L"");
|
||||
|
||||
context_->pageLayoutContainer().add_master_page(styleName, pageLayoutName, masterPage);
|
||||
}
|
||||
|
||||
@ -40,23 +40,24 @@ namespace cpdoccore {
|
||||
namespace odf_reader {
|
||||
|
||||
style_instance::style_instance(
|
||||
styles_container *Container,
|
||||
const std::wstring &Name,
|
||||
style_family::type Type,
|
||||
style_content *Content,
|
||||
bool IsAutomatic,
|
||||
bool IsDefault,
|
||||
const std::wstring & ParentStyleName,
|
||||
const std::wstring & NextStyleName,
|
||||
const std::wstring & DataStyleName
|
||||
) : container_(Container),
|
||||
name_(Name),
|
||||
style_type_(Type),
|
||||
content_(Content),
|
||||
is_automatic_(IsAutomatic),
|
||||
is_default_(IsDefault),
|
||||
next_name_(NextStyleName),
|
||||
next_(Container->style_by_name(NextStyleName, style_type_,false)),
|
||||
styles_container *Container,
|
||||
const std::wstring &Name,
|
||||
style_family::type Type,
|
||||
style_content *Content,
|
||||
bool IsAutomatic,
|
||||
bool IsDefault,
|
||||
const std::wstring & ParentStyleName,
|
||||
const std::wstring & NextStyleName,
|
||||
const std::wstring & DataStyleName
|
||||
) :
|
||||
container_ (Container),
|
||||
name_ (Name),
|
||||
style_type_ (Type),
|
||||
content_ (Content),
|
||||
is_automatic_ (IsAutomatic),
|
||||
is_default_ (IsDefault),
|
||||
next_name_ (NextStyleName),
|
||||
next_ (Container->style_by_name(NextStyleName, style_type_, false)),
|
||||
data_style_name_(DataStyleName)
|
||||
{
|
||||
parent_name_ = ParentStyleName;
|
||||
@ -64,8 +65,7 @@ style_instance::style_instance(
|
||||
{
|
||||
parent_name_ = L"Standard";
|
||||
}
|
||||
parent_ = Container->style_by_name(parent_name_, style_type_,false);
|
||||
|
||||
parent_ = Container->style_by_name(parent_name_, style_type_, false);
|
||||
}
|
||||
|
||||
style_instance * styles_container::hyperlink_style()
|
||||
@ -325,6 +325,13 @@ style_page_layout_properties * page_layout_instance::properties() const
|
||||
return dynamic_cast<style_page_layout_properties *>(style_page_layout_->style_page_layout_properties_.get());
|
||||
}
|
||||
|
||||
void page_layout_instance::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
style_page_layout_properties * props = properties();
|
||||
if (props)
|
||||
props->xlsx_serialize(strm, Context);
|
||||
}
|
||||
|
||||
void page_layout_instance::docx_convert_serialize(std::wostream & strm, oox::docx_conversion_context & Context)
|
||||
{
|
||||
const style_header_style * headerStyle = dynamic_cast<style_header_style *>(style_page_layout_->style_header_style_.get());
|
||||
@ -348,14 +355,16 @@ void page_layout_instance::docx_convert_serialize(std::wostream & strm, oox::doc
|
||||
_CP_OPT(length) bottom = attr.fo_min_height_ ? attr.fo_min_height_ : attr.svg_height_;
|
||||
Context.get_header_footer_context().set_footer(bottom);
|
||||
}
|
||||
|
||||
properties()->docx_convert_serialize(strm, Context);
|
||||
|
||||
style_page_layout_properties * props = properties();
|
||||
if (props)
|
||||
props->docx_convert_serialize(strm, Context);
|
||||
}
|
||||
void page_layout_instance::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
void page_layout_instance::pptx_serialize(std::wostream & strm, oox::pptx_conversion_context & Context)
|
||||
{
|
||||
style_page_layout_properties * props = properties();
|
||||
if (props)
|
||||
props->pptx_convert(Context);
|
||||
props->pptx_serialize(strm, Context);
|
||||
}
|
||||
|
||||
void page_layout_container::add_page_layout(const style_page_layout * StylePageLayout)
|
||||
|
||||
@ -193,8 +193,9 @@ public:
|
||||
const std::wstring & name() const;
|
||||
style_page_layout_properties * properties() const;
|
||||
|
||||
void docx_convert_serialize(std::wostream & strm, oox::docx_conversion_context & Context);
|
||||
void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
void docx_convert_serialize (std::wostream & strm, oox::docx_conversion_context & Context);
|
||||
void xlsx_serialize (std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
void pptx_serialize (std::wostream & strm, oox::pptx_conversion_context & Context);
|
||||
|
||||
const style_page_layout * style_page_layout_;
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ void office_body::docx_convert(oox::docx_conversion_context & Context)
|
||||
std::vector<style_master_page*> & masterPages = Context.root()->odf_context().pageLayoutContainer().master_pages();
|
||||
if (!masterPages.empty())
|
||||
{
|
||||
Context.set_master_page_name(masterPages[0]->style_master_page_attlist_.style_name_.get_value_or(L"Standard"));
|
||||
Context.set_master_page_name(masterPages[0]->attlist_.style_name_.get_value_or(L"Standard"));
|
||||
}
|
||||
|
||||
const page_layout_instance * layout = Context.root()->odf_context().pageLayoutContainer().page_layout_first();
|
||||
@ -116,15 +116,15 @@ void office_body::docx_convert(oox::docx_conversion_context & Context)
|
||||
//background (for all pages)
|
||||
if (page_layout_instance * firtsPageLayout = Context.root()->odf_context().pageLayoutContainer().page_layout_by_name(Context.get_page_properties()))
|
||||
{
|
||||
if (style_page_layout_properties * prop = firtsPageLayout->properties())
|
||||
if (style_page_layout_properties * layout_properties = firtsPageLayout->properties())
|
||||
{
|
||||
oox::_oox_fill fill;
|
||||
|
||||
Compute_GraphicFill(prop->style_page_layout_properties_attlist_.common_draw_fill_attlist_,
|
||||
prop->style_page_layout_properties_elements_.style_background_image_,
|
||||
Compute_GraphicFill(layout_properties->attlist_.common_draw_fill_attlist_,
|
||||
layout_properties->elements_.style_background_image_,
|
||||
Context.root()->odf_context().drawStyles(), fill);
|
||||
|
||||
if (prop->style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_ || fill.type != 0)
|
||||
if (layout_properties->attlist_.common_background_color_attlist_.fo_background_color_ || fill.type != 0)
|
||||
{
|
||||
if ((fill.bitmap) && (fill.bitmap->rId.empty()))
|
||||
{
|
||||
@ -132,7 +132,7 @@ void office_body::docx_convert(oox::docx_conversion_context & Context)
|
||||
fill.bitmap->rId = Context.add_mediaitem(href, oox::typeImage, fill.bitmap->isInternal, href);
|
||||
}
|
||||
int id = Context.get_drawing_context().get_current_shape_id();
|
||||
if (prop->docx_background_serialize(Context.output_stream(), Context, fill, id))
|
||||
if (layout_properties->docx_background_serialize(Context.output_stream(), Context, fill, id))
|
||||
{
|
||||
Context.set_settings_property(odf_reader::_property(L"displayBackgroundShape", true));
|
||||
}
|
||||
|
||||
@ -316,6 +316,7 @@ enum ElementType
|
||||
typeDrawPage,
|
||||
typePresentationFooterDecl,
|
||||
typePresentationDateTimeDecl,
|
||||
typePresentationNotes,
|
||||
|
||||
typeAnimPar,
|
||||
typeAnimSeq,
|
||||
|
||||
@ -225,7 +225,7 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
|
||||
{
|
||||
CP_XML_NODE(L"a:spcBef")
|
||||
{
|
||||
if (fo_margin_bottom_->get_type() == length_or_percent::Length)
|
||||
if (fo_margin_top_->get_type() == length_or_percent::Length)
|
||||
{
|
||||
std::wstring w_before = pptx_process_margin(fo_margin_top_, length::pt, 100.0);
|
||||
CP_XML_NODE(L"a:spcPts")
|
||||
@ -235,11 +235,10 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstringstream s;
|
||||
s << fo_margin_top_;
|
||||
double pct = fo_margin_top_->get_percent().get_value();
|
||||
CP_XML_NODE(L"a:spcPct")
|
||||
{
|
||||
CP_XML_ATTR(L"val", s.str());
|
||||
CP_XML_ATTR(L"val", (int)(pct * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -258,11 +257,11 @@ void paragraph_format_properties::xlsx_convert(std::wostream & strm, bool in_dra
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstringstream s;
|
||||
s << fo_margin_bottom_;
|
||||
double pct = fo_margin_bottom_->get_percent().get_value();
|
||||
|
||||
CP_XML_NODE(L"a:spcPct")
|
||||
{
|
||||
CP_XML_ATTR(L"val", s.str());
|
||||
CP_XML_ATTR(L"val", (int)(pct * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -458,7 +457,7 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
|
||||
{
|
||||
CP_XML_NODE(L"a:spcBef")
|
||||
{
|
||||
if (fo_margin_bottom_->get_type() == length_or_percent::Length)
|
||||
if (fo_margin_top_->get_type() == length_or_percent::Length)
|
||||
{
|
||||
std::wstring w_before = pptx_process_margin(fo_margin_top_, length::pt, 100.0);
|
||||
CP_XML_NODE(L"a:spcPts")
|
||||
@ -468,11 +467,11 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstringstream s;
|
||||
s << fo_margin_top_;
|
||||
double pct = fo_margin_top_->get_percent().get_value();
|
||||
|
||||
CP_XML_NODE(L"a:spcPct")
|
||||
{
|
||||
CP_XML_ATTR(L"val", s.str());
|
||||
CP_XML_ATTR(L"val", (int)(pct * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -491,11 +490,11 @@ void paragraph_format_properties::pptx_convert(oox::pptx_conversion_context & Co
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstringstream s;
|
||||
s << fo_margin_bottom_;
|
||||
double pct = fo_margin_bottom_->get_percent().get_value();
|
||||
|
||||
CP_XML_NODE(L"a:spcPct")
|
||||
{
|
||||
CP_XML_ATTR(L"val", s.str());
|
||||
CP_XML_ATTR(L"val", (int)(pct * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,17 +155,17 @@ const wchar_t * style_table_properties::name = L"table-properties";
|
||||
|
||||
void style_table_properties::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
table_format_properties_.add_attributes(Attributes);
|
||||
content_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_table_properties::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
table_format_properties_.add_child_element(Reader, Ns, Name, getContext());
|
||||
content_.add_child_element(Reader, Ns, Name, getContext());
|
||||
}
|
||||
|
||||
void style_table_properties::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
table_format_properties_.docx_convert(Context);
|
||||
content_.docx_convert(Context);
|
||||
}
|
||||
|
||||
// style-table-column-properties-attlist
|
||||
@ -186,7 +186,7 @@ const wchar_t * style_table_column_properties::name = L"table-column-properties"
|
||||
|
||||
void style_table_column_properties::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
style_table_column_properties_attlist_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_table_column_properties::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -199,14 +199,14 @@ void style_table_column_properties::docx_convert(oox::docx_conversion_context &
|
||||
std::wostream & strm = Context.output_stream();
|
||||
|
||||
|
||||
if (style_table_column_properties_attlist_.style_column_width_)
|
||||
if (attlist_.style_column_width_)
|
||||
{
|
||||
double kf_max_width_ms =1.;
|
||||
|
||||
const page_layout_instance * pp = Context.root()->odf_context().pageLayoutContainer().page_layout_first();//
|
||||
if (pp)
|
||||
{
|
||||
style_page_layout_properties_attlist & attr_page = pp->properties()->style_page_layout_properties_attlist_;
|
||||
style_page_layout_properties_attlist & attr_page = pp->properties()->attlist_;
|
||||
if (attr_page.fo_page_width_)
|
||||
{
|
||||
int val = 0.5 + 20.0 * attr_page.fo_page_width_->get_value_unit(length::pt);
|
||||
@ -215,7 +215,7 @@ void style_table_column_properties::docx_convert(oox::docx_conversion_context &
|
||||
}
|
||||
}
|
||||
|
||||
int val = style_table_column_properties_attlist_.style_column_width_->get_value_unit(length::pt);
|
||||
int val = attlist_.style_column_width_->get_value_unit(length::pt);
|
||||
|
||||
|
||||
//_CP_OPT(int) iUnormalWidth;
|
||||
@ -236,9 +236,9 @@ void style_table_column_properties::pptx_convert(oox::pptx_conversion_context &
|
||||
std::wostream & strm = Context.get_table_context().tableData();
|
||||
|
||||
|
||||
if (style_table_column_properties_attlist_.style_column_width_)
|
||||
if (attlist_.style_column_width_)
|
||||
{
|
||||
int val = style_table_column_properties_attlist_.style_column_width_->get_value_unit(length::emu);
|
||||
int val = attlist_.style_column_width_->get_value_unit(length::emu);
|
||||
|
||||
strm << L"<a:gridCol w=\"" << val << "\"/>";
|
||||
}
|
||||
@ -289,7 +289,7 @@ const wchar_t * style_table_cell_properties::name = L"table-cell-properties";
|
||||
|
||||
void style_table_cell_properties::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
style_table_cell_properties_attlist_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_table_cell_properties::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -351,7 +351,7 @@ const wchar_t * style_table_row_properties::name = L"table-row-properties";
|
||||
|
||||
void style_table_row_properties::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
style_table_row_properties_attlist_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_table_row_properties::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -368,7 +368,7 @@ void style_table_row_properties::add_child_element( xml::sax * Reader, const std
|
||||
|
||||
void style_table_row_properties::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
style_table_row_properties_attlist_.docx_convert(Context);
|
||||
attlist_.docx_convert(Context);
|
||||
}
|
||||
|
||||
/////
|
||||
@ -654,7 +654,7 @@ void style_table_cell_properties_attlist::pptx_serialize(oox::pptx_conversion_co
|
||||
|
||||
void style_table_cell_properties::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
style_table_cell_properties_attlist_.docx_convert(Context);
|
||||
attlist_.docx_convert(Context);
|
||||
}
|
||||
|
||||
void style_table_cell_properties_attlist::apply_from(const style_table_cell_properties_attlist & Other)
|
||||
|
||||
@ -89,7 +89,6 @@ public:
|
||||
|
||||
};
|
||||
|
||||
/// style:table-properties
|
||||
class style_table_properties : public office_element_impl<style_table_properties>
|
||||
{
|
||||
public:
|
||||
@ -101,19 +100,17 @@ public:
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) ;
|
||||
|
||||
table_format_properties & content() {return table_format_properties_;}
|
||||
table_format_properties & content() {return content_;}
|
||||
|
||||
private:
|
||||
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
table_format_properties table_format_properties_;
|
||||
|
||||
table_format_properties content_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_table_properties);
|
||||
|
||||
// style-table-column-properties-attlist
|
||||
class style_table_column_properties_attlist
|
||||
{
|
||||
public:
|
||||
@ -126,7 +123,6 @@ public:
|
||||
|
||||
};
|
||||
|
||||
/// style:table-column-properties
|
||||
class style_table_column_properties : public office_element_impl<style_table_column_properties>
|
||||
{
|
||||
public:
|
||||
@ -146,13 +142,12 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
style_table_column_properties_attlist style_table_column_properties_attlist_;
|
||||
style_table_column_properties_attlist attlist_;
|
||||
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_table_column_properties);
|
||||
|
||||
// style-table-row-properties-attlist
|
||||
class style_table_row_properties_attlist
|
||||
{
|
||||
public:
|
||||
@ -161,7 +156,6 @@ public:
|
||||
void docx_convert(oox::docx_conversion_context & Context);
|
||||
void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
public:
|
||||
_CP_OPT(odf_types::length) style_row_height_;
|
||||
_CP_OPT(odf_types::length) style_min_row_height_;
|
||||
_CP_OPT(bool) style_use_optimal_row_height_;
|
||||
@ -171,7 +165,6 @@ public:
|
||||
|
||||
};
|
||||
|
||||
/// style:table-row-properties
|
||||
class style_table_row_properties : public office_element_impl<style_table_row_properties>
|
||||
{
|
||||
public:
|
||||
@ -189,14 +182,13 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
style_table_row_properties_attlist style_table_row_properties_attlist_;
|
||||
style_table_row_properties_attlist attlist_;
|
||||
office_element_ptr style_background_image_;
|
||||
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_table_row_properties);
|
||||
|
||||
// style-table-cell-properties-attlist
|
||||
class style_table_cell_properties_attlist
|
||||
{
|
||||
public:
|
||||
@ -207,7 +199,6 @@ public:
|
||||
|
||||
void apply_from(const style_table_cell_properties_attlist & Other);
|
||||
|
||||
public:
|
||||
odf_types::common_shadow_attlist common_shadow_attlist_;
|
||||
odf_types::common_background_color_attlist common_background_color_attlist_;
|
||||
odf_types::common_border_attlist common_border_attlist_;
|
||||
@ -227,26 +218,21 @@ public:
|
||||
_CP_OPT(std::wstring) style_cell_protect_;
|
||||
_CP_OPT(bool) style_print_content_;
|
||||
_CP_OPT(unsigned int) style_decimal_places_;
|
||||
_CP_OPT(bool) style_repeat_content_;
|
||||
_CP_OPT(bool) style_shrink_to_fit_;
|
||||
_CP_OPT(bool) style_repeat_content_;
|
||||
_CP_OPT(bool) style_shrink_to_fit_;
|
||||
|
||||
_CP_OPT(odf_types::wrap_option) fo_wrap_option_;
|
||||
};
|
||||
|
||||
// style-table-cell-properties-elements
|
||||
class style_table_cell_properties_elements
|
||||
{
|
||||
public:
|
||||
void add_attributes( const xml::attributes_wc_ptr & Attributes );
|
||||
|
||||
private:
|
||||
// 15.11.6
|
||||
office_element_ptr style_background_image_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/// style:table-cell-properties
|
||||
class style_table_cell_properties : public office_element_impl<style_table_cell_properties>
|
||||
{
|
||||
public:
|
||||
@ -264,8 +250,8 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
style_table_cell_properties_attlist style_table_cell_properties_attlist_;
|
||||
office_element_ptr style_background_image_;
|
||||
style_table_cell_properties_attlist attlist_;
|
||||
office_element_ptr style_background_image_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -80,7 +80,9 @@ public:
|
||||
void pptx_convert (oox::pptx_conversion_context & Context);
|
||||
void pptx_convert_as_list (oox::pptx_conversion_context & Context);
|
||||
|
||||
void oox_convert (std::wostream & stream, bool graphic, fonts_container & fonts);
|
||||
void oox_serialize (std::wostream & stream, bool graphic, fonts_container & fonts);
|
||||
void docx_serialize (std::wostream & stream, fonts_container & fonts);
|
||||
void drawing_serialize (std::wostream & stream, std::wstring node, fonts_container & fonts, const odf_reader::style_instance *current_style = NULL, std::wstring hlink = L"");
|
||||
|
||||
void apply_from (const text_format_properties_content & Other);
|
||||
void apply_to (std::vector<_property> & properties);
|
||||
|
||||
@ -722,7 +722,6 @@ void style_footer_left::add_child_element( xml::sax * Reader, const std::wstring
|
||||
content().header_footer_content_.add_child_element(Reader, Ns, Name, getContext());
|
||||
}
|
||||
|
||||
/// style:columns
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_columns::ns = L"style";
|
||||
const wchar_t * style_columns::name = L"columns";
|
||||
@ -745,7 +744,6 @@ void style_columns::add_child_element( xml::sax * Reader, const std::wstring & N
|
||||
}
|
||||
}
|
||||
|
||||
/// style:column
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_column::ns = L"style";
|
||||
const wchar_t * style_column::name = L"column";
|
||||
@ -765,7 +763,6 @@ void style_column::add_child_element( xml::sax * Reader, const std::wstring & Ns
|
||||
CP_NOT_APPLICABLE_ELM();
|
||||
}
|
||||
|
||||
/// style:column-sep
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_column_sep::ns = L"style";
|
||||
const wchar_t * style_column_sep::name = L":column-sep";
|
||||
@ -784,8 +781,6 @@ void style_column_sep::add_child_element( xml::sax * Reader, const std::wstring
|
||||
CP_NOT_APPLICABLE_ELM();
|
||||
}
|
||||
|
||||
|
||||
/// style:section-properties
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_section_properties::ns = L"style";
|
||||
const wchar_t * style_section_properties::name = L"section-properties";
|
||||
@ -811,7 +806,6 @@ void style_section_properties::add_child_element( xml::sax * Reader, const std::
|
||||
}
|
||||
}
|
||||
|
||||
/// style:header-style
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_header_style::ns = L"style";
|
||||
const wchar_t * style_header_style::name = L"header-style";
|
||||
@ -837,7 +831,6 @@ void style_header_style::add_child_element( xml::sax * Reader, const std::wstrin
|
||||
}
|
||||
}
|
||||
|
||||
/// style:footer-style
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_footer_style::ns = L"style";
|
||||
const wchar_t * style_footer_style::name = L"footer-style";
|
||||
@ -863,15 +856,12 @@ void style_footer_style::add_child_element( xml::sax * Reader, const std::wstrin
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// style-page-layout-attlist
|
||||
void style_page_layout_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"style:name", style_name_, std::wstring(L""));
|
||||
CP_APPLY_ATTR(L"style:page-usage", style_page_usage_, page_usage(page_usage::All));
|
||||
}
|
||||
|
||||
/// style:page-layout
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
const wchar_t * style_page_layout::ns = L"style";
|
||||
const wchar_t * style_page_layout::name = L"page-layout";
|
||||
@ -906,16 +896,15 @@ void style_page_layout::add_child_element( xml::sax * Reader, const std::wstring
|
||||
}
|
||||
}
|
||||
|
||||
// style-page-layout-properties-attlist
|
||||
void style_page_layout_properties_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"fo:page-width", fo_page_width_);
|
||||
CP_APPLY_ATTR(L"fo:page-height", fo_page_height_);
|
||||
common_num_format_attlist_.add_attributes(Attributes);
|
||||
common_num_format_prefix_suffix_attlist_.add_attributes(Attributes);
|
||||
CP_APPLY_ATTR(L"style:paper-tray-name", style_paper_tray_name_);
|
||||
CP_APPLY_ATTR(L"style:print-orientation", style_print_orientation_);
|
||||
|
||||
common_num_format_attlist_.add_attributes(Attributes);
|
||||
common_num_format_prefix_suffix_attlist_.add_attributes(Attributes);
|
||||
common_horizontal_margin_attlist_.add_attributes(Attributes);
|
||||
common_vertical_margin_attlist_.add_attributes(Attributes);
|
||||
common_margin_attlist_.add_attributes(Attributes);
|
||||
@ -947,34 +936,6 @@ void style_page_layout_properties_attlist::add_attributes( const xml::attributes
|
||||
CP_APPLY_ATTR(L"style:layout-grid-display", style_layout_grid_display_);
|
||||
}
|
||||
|
||||
/*
|
||||
Choice [0..6]
|
||||
[ ] w:headerReference Header Reference
|
||||
[ ] w:footerReference Footer Reference
|
||||
[ ] from group w:EG_SectPrContents
|
||||
[ ] Sequence
|
||||
[ ] w:footnotePr Section-Wide Footnote Properties
|
||||
[ ] w:endnotePr Section-Wide Endnote Properties
|
||||
[ ] w:type Section Type
|
||||
[x] w:pgSz Page Size
|
||||
[ ] w:pgMar Page Margins
|
||||
[ ] w:paperSrc Paper Source Information
|
||||
[ ] w:pgBorders Page Borders
|
||||
[ ] w:lnNumType Line Numbering Settings
|
||||
[ ] w:pgNumType Page Numbering Settings
|
||||
[ ] w:cols Column Definitions
|
||||
[ ] w:formProt Only Allow Editing of Form Fields
|
||||
[ ] w:vAlign Vertical Text Alignment on Page
|
||||
[ ] w:noEndnote Suppress Endnotes In Document
|
||||
[ ] w:titlePg Different First Page Headers and Footers
|
||||
[ ] w:textDirection Text Flow Direction
|
||||
[ ] w:bidi Right to Left Section Layout
|
||||
[ ] w:rtlGutter Gutter on Right Side of Page
|
||||
[ ] w:docGrid Document Grid
|
||||
[ ] w:printerSettings Reference to Printer Settings Data
|
||||
[ ] w:sectPrChange Revision Information for Section Properties
|
||||
*/
|
||||
|
||||
namespace {
|
||||
|
||||
std::wstring process_page_margin(const _CP_OPT(length_or_percent) & Val,
|
||||
@ -1012,7 +973,7 @@ void style_page_layout_properties_attlist::docx_convert_serialize(std::wostream
|
||||
//Context.set_settings_property(odf_reader::_property(L"UnormalWidthPage",val));
|
||||
val =31680;//22"
|
||||
}
|
||||
w_w = boost::lexical_cast<std::wstring>(val);
|
||||
w_w = std::to_wstring(val);
|
||||
}
|
||||
if (fo_page_height_)
|
||||
{
|
||||
@ -1199,7 +1160,7 @@ void style_page_layout_properties_attlist::pptx_convert(oox::pptx_conversion_con
|
||||
h = fo_page_height_->get_value_unit(length::emu);
|
||||
if (h < 914400) h = 914400;
|
||||
|
||||
w_h = boost::lexical_cast<std::wstring>(h);
|
||||
w_h = std::to_wstring(h);
|
||||
}
|
||||
|
||||
std::wstring w_orient = L"custom";
|
||||
@ -1259,18 +1220,18 @@ const wchar_t * style_page_layout_properties::name = L"page-layout-properties";
|
||||
|
||||
void style_page_layout_properties::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
style_page_layout_properties_attlist_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_page_layout_properties::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
style_page_layout_properties_elements_.add_child_element(Reader, Ns, Name, getContext());
|
||||
elements_.add_child_element(Reader, Ns, Name, getContext());
|
||||
}
|
||||
|
||||
bool style_page_layout_properties::docx_background_serialize(std::wostream & strm, oox::docx_conversion_context & Context, oox::_oox_fill & fill, int id)
|
||||
{
|
||||
if (style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_ &&
|
||||
style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_->get_type() == background_color::Transparent)
|
||||
if (attlist_.common_background_color_attlist_.fo_background_color_ &&
|
||||
attlist_.common_background_color_attlist_.fo_background_color_->get_type() == background_color::Transparent)
|
||||
return true; //??
|
||||
//прозрачный фон
|
||||
|
||||
@ -1280,8 +1241,8 @@ bool style_page_layout_properties::docx_background_serialize(std::wostream & str
|
||||
{
|
||||
std::wstring color = L"ffffff";
|
||||
|
||||
if (style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_)
|
||||
color = style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_->get_color().get_hex_value();
|
||||
if (attlist_.common_background_color_attlist_.fo_background_color_)
|
||||
color = attlist_.common_background_color_attlist_.fo_background_color_->get_color().get_hex_value();
|
||||
|
||||
CP_XML_ATTR(L"w:color", color);
|
||||
|
||||
@ -1290,9 +1251,91 @@ bool style_page_layout_properties::docx_background_serialize(std::wostream & str
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void style_page_layout_properties::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
}
|
||||
|
||||
void style_page_layout_properties::xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
odf_types::common_horizontal_margin_attlist horizontal_margins = attlist_.common_horizontal_margin_attlist_;
|
||||
odf_types::common_vertical_margin_attlist vertical_margins = attlist_.common_vertical_margin_attlist_;
|
||||
|
||||
if (horizontal_margins.fo_margin_left_ || horizontal_margins.fo_margin_right_ ||
|
||||
vertical_margins.fo_margin_top_ || vertical_margins.fo_margin_bottom_ )
|
||||
{
|
||||
//_CP_OPT(odf_types::length) margin_top, margin_bottom;
|
||||
|
||||
//margin_top = Context.get_header_footer_context().header();
|
||||
//margin_bottom = Context.get_header_footer_context().footer();
|
||||
|
||||
CP_XML_NODE(L"pageMargins")
|
||||
{
|
||||
if (horizontal_margins.fo_margin_left_ && horizontal_margins.fo_margin_left_->get_type() == odf_types::length_or_percent::Length)
|
||||
CP_XML_ATTR(L"left" , horizontal_margins.fo_margin_left_->get_length().get_value_unit(odf_types::length::inch));
|
||||
if (horizontal_margins.fo_margin_right_ && horizontal_margins.fo_margin_right_->get_type() == odf_types::length_or_percent::Length)
|
||||
CP_XML_ATTR(L"right" , horizontal_margins.fo_margin_right_->get_length().get_value_unit(odf_types::length::inch));
|
||||
|
||||
if (vertical_margins.fo_margin_top_ && vertical_margins.fo_margin_top_->get_type() == odf_types::length_or_percent::Length)
|
||||
CP_XML_ATTR(L"top" , vertical_margins.fo_margin_top_->get_length().get_value_unit(odf_types::length::inch));
|
||||
if (vertical_margins.fo_margin_bottom_ && vertical_margins.fo_margin_bottom_->get_type() == odf_types::length_or_percent::Length)
|
||||
CP_XML_ATTR(L"bottom" , vertical_margins.fo_margin_bottom_->get_length().get_value_unit(odf_types::length::inch));
|
||||
|
||||
CP_XML_ATTR(L"header" , vertical_margins.fo_margin_top_->get_length().get_value_unit(odf_types::length::inch));
|
||||
CP_XML_ATTR(L"footer" , vertical_margins.fo_margin_bottom_->get_length().get_value_unit(odf_types::length::inch));
|
||||
}
|
||||
}
|
||||
if (attlist_.fo_page_width_ || attlist_.fo_page_height_ || attlist_.style_print_orientation_)
|
||||
{
|
||||
CP_XML_NODE(L"pageSetup")
|
||||
{
|
||||
double h = 0, w = 0;
|
||||
if (attlist_.fo_page_width_)
|
||||
{
|
||||
w = attlist_.fo_page_width_->get_value_unit(length::mm);
|
||||
CP_XML_ATTR(L"paperWidth", (int)w);
|
||||
}
|
||||
if (attlist_.fo_page_height_)
|
||||
{
|
||||
h = attlist_.fo_page_height_->get_value_unit(length::mm);
|
||||
CP_XML_ATTR(L"paperHeight", (int)h);
|
||||
}
|
||||
CP_XML_ATTR(L"paperUnits", L"mm");
|
||||
if (attlist_.style_print_orientation_)
|
||||
{
|
||||
CP_XML_ATTR(L"orientation", *attlist_.style_print_orientation_);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (elements_.style_background_image_)
|
||||
{
|
||||
oox::_oox_fill fill;
|
||||
|
||||
Compute_GraphicFill(attlist_.common_draw_fill_attlist_, elements_.style_background_image_, Context.root()->odf_context().drawStyles(), fill);
|
||||
if (fill.bitmap)
|
||||
{
|
||||
if ( fill.bitmap->rId.empty())
|
||||
{
|
||||
std::wstring href = fill.bitmap->xlink_href_;
|
||||
fill.bitmap->rId = Context.get_mediaitems().add_or_find(href, oox::typeImage, fill.bitmap->isInternal, href);
|
||||
|
||||
Context.get_drawing_context().get_drawings()->add(fill.bitmap->isInternal, fill.bitmap->rId, href, oox::typeImage, true);
|
||||
}
|
||||
|
||||
CP_XML_NODE(L"picture")
|
||||
{
|
||||
CP_XML_ATTR(L"r:id", fill.bitmap->rId );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void style_page_layout_properties::docx_convert_serialize(std::wostream & strm, oox::docx_conversion_context & Context)
|
||||
{
|
||||
style_columns * columns = dynamic_cast<style_columns *>( style_page_layout_properties_elements_.style_columns_.get());
|
||||
style_columns * columns = dynamic_cast<style_columns *>( elements_.style_columns_.get());
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
@ -1325,16 +1368,60 @@ void style_page_layout_properties::docx_convert_serialize(std::wostream & strm,
|
||||
|
||||
oox::section_context::_section & section = Context.get_section_context().get();
|
||||
|
||||
style_page_layout_properties_attlist_.docx_convert_serialize(strm, Context, section.margin_left_, section.margin_right_);
|
||||
attlist_.docx_convert_serialize(strm, Context, section.margin_left_, section.margin_right_);
|
||||
//todooo при появлении еще накладок - переписать !!
|
||||
}
|
||||
}
|
||||
}
|
||||
void style_page_layout_properties::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
style_page_layout_properties_attlist_.pptx_convert(Context);
|
||||
attlist_.pptx_convert(Context);
|
||||
}
|
||||
|
||||
void style_page_layout_properties::pptx_serialize(std::wostream & strm, oox::pptx_conversion_context & Context)
|
||||
{
|
||||
if (attlist_.fo_page_width_ || attlist_.fo_page_height_ || attlist_.style_print_orientation_)
|
||||
{
|
||||
std::wstring w_w, w_h;
|
||||
|
||||
_INT64 h = 0, w = 0;
|
||||
|
||||
if (attlist_.fo_page_width_)
|
||||
{
|
||||
w = attlist_.fo_page_width_->get_value_unit(length::emu);
|
||||
if (w < 914400) w = 914400;
|
||||
|
||||
w_w = boost::lexical_cast<std::wstring>(w);
|
||||
}
|
||||
if (attlist_.fo_page_height_)
|
||||
{
|
||||
h = attlist_.fo_page_height_->get_value_unit(length::emu);
|
||||
if (h < 914400) h = 914400;
|
||||
|
||||
w_h = std::to_wstring(h);
|
||||
}
|
||||
|
||||
std::wstring w_orient = L"custom";
|
||||
|
||||
//if (w && h)
|
||||
//{
|
||||
// double ratio = (double)w/(double)h;
|
||||
// if (abs(ratio - 16./9.)<0.01) w_orient = L"screen16x9";
|
||||
// if (abs(ratio - 4./3.)<0.01) w_orient = L"screen4x3";
|
||||
//}
|
||||
|
||||
strm << L"<p:sldSz ";
|
||||
if (!w_h.empty())
|
||||
strm << L"cy=\"" << w_h << L"\" ";
|
||||
|
||||
if (!w_w.empty())
|
||||
strm << L"cx=\"" << w_w << L"\" ";
|
||||
|
||||
strm << L"type=\"" << w_orient << L"\" ";
|
||||
|
||||
strm << L"/>";
|
||||
}
|
||||
}
|
||||
|
||||
// style-page-layout-properties-elements
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -1363,10 +1450,10 @@ void style_page_layout_properties_elements::add_child_element( xml::sax * Reader
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void style_master_page_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"style:name", style_name_);
|
||||
CP_APPLY_ATTR(L"style:display-name", style_display_name_);
|
||||
CP_APPLY_ATTR(L"style:page-layout-name", style_page_layout_name_);
|
||||
CP_APPLY_ATTR(L"draw:style-name", draw_style_name_);
|
||||
CP_APPLY_ATTR(L"style:name", style_name_);
|
||||
CP_APPLY_ATTR(L"style:display-name", style_display_name_);
|
||||
CP_APPLY_ATTR(L"style:page-layout-name",style_page_layout_name_);
|
||||
CP_APPLY_ATTR(L"draw:style-name", draw_style_name_);
|
||||
CP_APPLY_ATTR(L"style:next-style-name", style_next_style_name_);
|
||||
}
|
||||
|
||||
@ -1382,7 +1469,7 @@ std::wostream & style_master_page::text_to_stream(std::wostream & _Wostream) con
|
||||
|
||||
void style_master_page::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
style_master_page_attlist_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void style_master_page::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -1457,9 +1544,9 @@ int style_master_page::find_placeHolderIndex(presentation_class::type placeHolde
|
||||
|
||||
void style_master_page::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
if (style_master_page_attlist_.draw_style_name_)
|
||||
if (attlist_.draw_style_name_)
|
||||
{
|
||||
std::wstring style_name = style_master_page_attlist_.draw_style_name_.get();
|
||||
std::wstring style_name = attlist_.draw_style_name_.get();
|
||||
style_instance * style_inst = Context.root()->odf_context().styleContainer().style_by_name(style_name,style_family::DrawingPage,true);
|
||||
|
||||
if ((style_inst) && (style_inst->content()))
|
||||
@ -1476,10 +1563,11 @@ void style_master_page::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_FOREACH(office_element_ptr elm, content_)
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
|
||||
}
|
||||
////////////////
|
||||
|
||||
@ -1655,9 +1743,9 @@ void style_presentation_page_layout::add_child_element( xml::sax * Reader, const
|
||||
}
|
||||
void style_presentation_page_layout::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
BOOST_FOREACH(office_element_ptr elm, content_)
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
elm->pptx_convert(Context);
|
||||
content_[i]->pptx_convert(Context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -442,7 +442,6 @@ public:
|
||||
_CP_OPT(std::wstring) style_next_style_name_;
|
||||
};
|
||||
|
||||
// style:master-page
|
||||
class style_master_page;
|
||||
typedef boost::shared_ptr<style_master_page> style_master_page_ptr;
|
||||
|
||||
@ -465,7 +464,7 @@ private:
|
||||
public:
|
||||
int find_placeHolderIndex(odf_types::presentation_class::type placeHolder,int & last_idx);
|
||||
|
||||
style_master_page_attlist style_master_page_attlist_;
|
||||
style_master_page_attlist attlist_;
|
||||
|
||||
office_element_ptr style_header_;
|
||||
office_element_ptr style_header_left_;
|
||||
@ -975,15 +974,18 @@ public:
|
||||
static const ElementType type = typeStylePageLayout;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
void docx_convert_serialize(std::wostream & strm, oox::docx_conversion_context & Context);
|
||||
void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
void docx_convert_serialize (std::wostream & strm, oox::docx_conversion_context & Context);
|
||||
void pptx_convert (oox::pptx_conversion_context & Context);
|
||||
void xlsx_convert (oox::xlsx_conversion_context & Context);
|
||||
|
||||
bool docx_background_serialize(std::wostream & strm, oox::docx_conversion_context & Context, oox::_oox_fill & fill, int id);
|
||||
void xlsx_serialize(std::wostream & strm, oox::xlsx_conversion_context & Context);
|
||||
void pptx_serialize(std::wostream & strm, oox::pptx_conversion_context & Context);
|
||||
|
||||
style_page_layout_properties() { }
|
||||
|
||||
style_page_layout_properties_attlist style_page_layout_properties_attlist_;
|
||||
style_page_layout_properties_elements style_page_layout_properties_elements_;
|
||||
style_page_layout_properties_attlist attlist_;
|
||||
style_page_layout_properties_elements elements_;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@ -455,6 +455,45 @@ namespace svg_path
|
||||
}
|
||||
}break;
|
||||
|
||||
case 'G':
|
||||
{
|
||||
nPos++;
|
||||
skipSpaces(nPos, rSvgDStatement, nLen);
|
||||
|
||||
while(nPos < nLen && isOnNumberChar(rSvgDStatement, nPos))
|
||||
{
|
||||
double nX, nY;
|
||||
double A1, A2;
|
||||
|
||||
if(!importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
||||
if(!importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
||||
if(!importDoubleAndSpaces(A1, nPos, rSvgDStatement, nLen)) return false;
|
||||
if(!importDoubleAndSpaces(A2, nPos, rSvgDStatement, nLen)) return false;
|
||||
|
||||
if(bRelative)
|
||||
{
|
||||
nX += nLastX;
|
||||
nY += nLastY;
|
||||
}
|
||||
|
||||
aCurrPoly.command = L"a:ArcTo";
|
||||
// append curved edge
|
||||
aCurrPoly.points.push_back(_point(nX, nY));
|
||||
aCurrPoly.points.push_back(_point(A1, A2));
|
||||
|
||||
Polyline.push_back(aCurrPoly);
|
||||
aCurrPoly.points.clear();
|
||||
|
||||
// set last position
|
||||
nLastX = nX;
|
||||
nLastY = nY;
|
||||
|
||||
//keep control point
|
||||
nLastControlX = nX;
|
||||
nLastControlY = nY;
|
||||
}
|
||||
}break;
|
||||
|
||||
// #100617# quadratic beziers are imported as cubic ones
|
||||
//case 'q' :
|
||||
//{
|
||||
|
||||
@ -81,7 +81,7 @@ void table_table_row::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
|
||||
if ((inst) && (inst->content()) && (inst->content()->get_style_table_row_properties()))
|
||||
{
|
||||
style_table_row_properties_attlist & row_attlist = inst->content()->get_style_table_row_properties()->style_table_row_properties_attlist_;
|
||||
style_table_row_properties_attlist & row_attlist = inst->content()->get_style_table_row_properties()->attlist_;
|
||||
if (row_attlist.style_row_height_)
|
||||
{
|
||||
height = (int)( 0.5 +row_attlist.style_row_height_->get_value_unit(length::emu) );
|
||||
|
||||
@ -120,12 +120,12 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
if ((rowStyle) && (rowStyle->content()))
|
||||
{
|
||||
const odf_reader::style_table_row_properties * prop = rowStyle->content()->get_style_table_row_properties();
|
||||
if ((prop) && (prop->style_table_row_properties_attlist_.style_row_height_))
|
||||
if ((prop) && (prop->attlist_.style_row_height_))
|
||||
{
|
||||
row_height = prop->style_table_row_properties_attlist_.style_row_height_->get_value_unit(odf_types::length::pt);
|
||||
row_height = prop->attlist_.style_row_height_->get_value_unit(odf_types::length::pt);
|
||||
|
||||
if ((prop->style_table_row_properties_attlist_.style_use_optimal_row_height_) &&
|
||||
(*prop->style_table_row_properties_attlist_.style_use_optimal_row_height_==true))
|
||||
if ((prop->attlist_.style_use_optimal_row_height_) &&
|
||||
(*prop->attlist_.style_use_optimal_row_height_==true))
|
||||
{
|
||||
//автоматическая подстройка высоты.
|
||||
//нету в оох
|
||||
@ -478,11 +478,11 @@ void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (const style_table_column_properties * prop = inst->content()->get_style_table_column_properties())
|
||||
{
|
||||
if (prop->style_table_column_properties_attlist_.style_column_width_)
|
||||
if (prop->attlist_.style_column_width_)
|
||||
{
|
||||
pt_width = prop->style_table_column_properties_attlist_.style_column_width_->get_value_unit(length::pt);
|
||||
cm_width = prop->style_table_column_properties_attlist_.style_column_width_->get_value_unit(length::cm);
|
||||
in_width = prop->style_table_column_properties_attlist_.style_column_width_->get_value_unit(length::inch);
|
||||
pt_width = prop->attlist_.style_column_width_->get_value_unit(length::pt);
|
||||
cm_width = prop->attlist_.style_column_width_->get_value_unit(length::cm);
|
||||
in_width = prop->attlist_.style_column_width_->get_value_unit(length::inch);
|
||||
|
||||
if (collapsed)
|
||||
{
|
||||
@ -492,7 +492,7 @@ void table_table_column::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
const double pixDpi = in_width * 96.;
|
||||
width = pixToSize(pixDpi, Context.getMaxDigitSize().first);
|
||||
|
||||
//const double width = cmToChars(prop->style_table_column_properties_attlist_.style_column_width_->get_value_unit(length::cm));
|
||||
//const double width = cmToChars(prop->attlist_.style_column_width_->get_value_unit(length::cm));
|
||||
|
||||
// see ECMA-376 page 1768
|
||||
if (in_width > 0)
|
||||
|
||||
@ -57,15 +57,15 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"mso-spt200" , 7}, // shapetypeActionButtonMovie,
|
||||
{ L"mso-spt197" , 7}, // shapetypeActionButtonReturn,
|
||||
{ L"mso-spt199" , 7}, // shapetypeActionButtonSound,
|
||||
{ L"ooxml-arc" , 7}, // shapetypeArc,
|
||||
{ L"" , 7}, // shapetypeArc,
|
||||
{ L"mso-spt91" , 7}, // shapetypeBentArrow,
|
||||
{ L"mso-spt33" , 7}, // shapetypeBentConnector2,
|
||||
{ L"mso-spt34" , 7}, // shapetypeBentConnector3,
|
||||
{ L"mso-spt35" , 7}, // shapetypeBentConnector4,
|
||||
{ L"mso-spt36" , 7}, // shapetypeBentConnector5,
|
||||
{ L"mso-spt90" , 7}, // shapetypeBentUpArrow,
|
||||
{ L"" , 7}, // shapetypeBentUpArrow,
|
||||
{ L"quad-bevel" , 7}, // shapetypeBevel,
|
||||
{ L"block-arc" , 7}, // shapetypeBlockArc,
|
||||
{ L"" , 7}, // shapetypeBlockArc,
|
||||
{ L"mso-spt49" , 7}, // shapetypeBorderCallout1,
|
||||
{ L"mso-spt50" , 7}, // shapetypeBorderCallout2,
|
||||
{ L"mso-spt51" , 7}, // shapetypeBorderCallout3,
|
||||
@ -78,7 +78,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeChartPlus,
|
||||
{ L"" , 7}, // shapetypeChartStar,
|
||||
{ L"" , 7}, // shapetypeChartX,
|
||||
{ L"chevron" , 7}, // shapetypeChevron,
|
||||
{ L"" , 7}, // shapetypeChevron,
|
||||
{ L"" , 7}, // shapetypeChord,
|
||||
{ L"" , 7}, // shapetypeCircularArrow,
|
||||
{ L"cloud" , 7}, // shapetypeCloud,
|
||||
@ -92,16 +92,16 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"mso-spt40" , 7}, // shapetypeCurvedConnector5,
|
||||
{ L"" , 7}, // shapetypeCurvedDownArrow,
|
||||
{ L"" , 7}, // shapetypeCurvedLeftArrow,
|
||||
{ L"mso-spt102" , 7}, // shapetypeCurvedRightArrow,
|
||||
{ L"" , 7}, // shapetypeCurvedRightArrow,
|
||||
{ L"mso-spt104" , 7}, // shapetypeCurvedUpArrow,
|
||||
{ L"" , 7}, // shapetypeDecagon,
|
||||
{ L"" , 7}, // shapetypeDiagStripe,
|
||||
{ L"diamond" , 7}, // shapetypeDiamond,
|
||||
{ L"" , 7}, // shapetypeDiamond,
|
||||
{ L"" , 7}, // shapetypeDodecagon,
|
||||
{ L"ring" , 7}, // shapetypeDonut,
|
||||
{ L"" , 7}, // shapetypeDonut,
|
||||
{ L"" , 7}, // shapetypeDoubleWave,
|
||||
{ L"down-arrow" , 7}, // shapetypeDownArrow,
|
||||
{ L"down-arrow-callout" , 7}, // shapetypeDownArrowCallout,
|
||||
{ L"" , 7}, // shapetypeDownArrow,
|
||||
{ L"" , 7}, // shapetypeDownArrowCallout,
|
||||
{ L"ellipse" , 3}, // shapetypeEllipse,
|
||||
{ L"mso-spt107" , 7}, // shapetypeEllipseRibbon,
|
||||
{ L"mso-spt108" , 7}, // shapetypeEllipseRibbon2,
|
||||
@ -112,7 +112,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"flowchart-delay" , 7}, // shapetypeFlowChartDelay,
|
||||
{ L"flowchart-display" , 7}, // shapetypeFlowChartDisplay,
|
||||
{ L"flowchart-document" , 7}, // shapetypeFlowChartDocument,
|
||||
{ L"flowchart-extract" , 7}, // shapetypeFlowChartExtract,
|
||||
{ L"" , 7}, // shapetypeFlowChartExtract,
|
||||
{ L"flowchart-data" , 7}, // shapetypeFlowChartInputOutput,
|
||||
{ L"flowchart-internal-storage" , 7}, // shapetypeFlowChartInternalStorage,
|
||||
{ L"flowchart-magnetic-disk" , 7}, // shapetypeFlowChartMagneticDisk,
|
||||
@ -135,7 +135,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"flowchart-summing-junction" , 7}, // shapetypeFlowChartSummingJunction,
|
||||
{ L"flowchart-terminator" , 7}, // shapetypeFlowChartTerminator,
|
||||
{ L"paper" , 7}, // shapetypeFoldedCorner,
|
||||
{ L"frame" , 7}, // shapetypeFrame,
|
||||
{ L"" , 7}, // shapetypeFrame,
|
||||
{ L"" , 7}, // shapetypeFunnel,
|
||||
{ L"" , 7}, // shapetypeGear6,
|
||||
{ L"" , 7}, // shapetypeGear9,
|
||||
@ -143,21 +143,21 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"heart" , 7}, // shapetypeHeart,
|
||||
{ L"" , 7}, // shapetypeHeptagon,
|
||||
{ L"hexagon" , 7}, // shapetypeHexagon,
|
||||
{ L"pentagon-right" , 7}, // shapetypeHomePlate,
|
||||
{ L"" , 7}, // shapetypeHomePlate,
|
||||
{ L"horizontal-scroll" , 7}, // shapetypeHorizontalScroll,
|
||||
{ L"" , 7}, // shapetypeIrregularSeal1,
|
||||
{ L"" , 7}, // shapetypeIrregularSeal2,
|
||||
{ L"left-arrow" , 7}, // shapetypeLeftArrow,
|
||||
{ L"left-arrow-callout" , 7}, // shapetypeLeftArrowCallout,
|
||||
{ L"" , 7}, // shapetypeLeftArrow,
|
||||
{ L"" , 7}, // shapetypeLeftArrowCallout,
|
||||
{ L"left-brace" , 7}, // shapetypeLeftBrace,
|
||||
{ L"left-bracket" , 7}, // shapetypeLeftBracket,
|
||||
{ L"" , 7}, // shapetypeLeftCircularArrow,
|
||||
{ L"left-right-arrow" , 7}, // shapetypeLeftRightArrow,
|
||||
{ L"" , 7}, // shapetypeLeftRightArrow,
|
||||
{ L"left-right-arrow-callout" , 7}, // shapetypeLeftRightArrowCallout,
|
||||
{ L"" , 7}, // shapetypeLeftRightCircularArrow,
|
||||
{ L"" , 7}, // shapetypeLeftRightRibbon,
|
||||
{ L"mso-spt182" , 7}, // shapetypeLeftRightUpArrow,
|
||||
{ L"mso-spt89" , 7}, // shapetypeLeftUpArrow,
|
||||
{ L"" , 7}, // shapetypeLeftUpArrow,
|
||||
{ L"lightning" , 7}, // shapetypeLightningBolt,
|
||||
{ L"" , 5}, // shapetypeLine,
|
||||
{ L"" , 7}, // shapetypeLineInv,
|
||||
@ -166,33 +166,33 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeMathMinus,
|
||||
{ L"" , 7}, // shapetypeMathMultiply,
|
||||
{ L"" , 7}, // shapetypeMathNotEqual,
|
||||
{ L"cross" , 7}, // shapetypeMathPlus,
|
||||
{ L"" , 7}, // shapetypeMathPlus,
|
||||
{ L"moon" , 7}, // shapetypeMoon,
|
||||
{ L"" , 7}, // shapetypeNonIsoscelesTrapezoid,
|
||||
{ L"forbidden" , 7}, // shapetypeNoSmoking,
|
||||
{ L"notched-right-arrow" , 7}, // shapetypeNotchedRightArrow,
|
||||
{ L"" , 7}, // shapetypeNotchedRightArrow,
|
||||
{ L"octagon" , 7}, // shapetypeOctagon,
|
||||
{ L"parallelogram" , 7}, // shapetypeParallelogram,
|
||||
{ L"" , 7}, // shapetypeParallelogram,
|
||||
{ L"pentagon" , 7}, // shapetypePentagon,
|
||||
{ L"mso-spt100" , 7}, // shapetypePie,
|
||||
{ L"" , 7}, // shapetypePie,
|
||||
{ L"" , 7}, // shapetypePieWedge,
|
||||
{ L"" , 7}, // shapetypePlaque,
|
||||
{ L"" , 7}, // shapetypePlaqueTabs,
|
||||
{ L"cross" , 7}, // shapetypePlus,
|
||||
{ L"" , 7}, // shapetypePlus,
|
||||
{ L"quad-arrow" , 7}, // shapetypeQuadArrow,
|
||||
{ L"quad-arrow-callout" , 7}, // shapetypeQuadArrowCallout,
|
||||
{ L"rectangle" , 2}, // shapetypeRect,
|
||||
{ L"mso-spt53" , 7}, // shapetypeRibbon,
|
||||
{ L"mso-spt54" , 7}, // shapetypeRibbon2,
|
||||
{ L"right-arrow" , 7}, // shapetypeRightArrow,
|
||||
{ L"right-arrow-callout" , 7}, // shapetypeRightArrowCallout,
|
||||
{ L"" , 7}, // shapetypeRightArrow,
|
||||
{ L"" , 7}, // shapetypeRightArrowCallout,
|
||||
{ L"right-brace" , 7}, // shapetypeRightBrace,
|
||||
{ L"right-bracket" , 7}, // shapetypeRightBracket,
|
||||
{ L"" , 7}, // shapetypeRound1Rect,
|
||||
{ L"" , 7}, // shapetypeRound2DiagRect,
|
||||
{ L"" , 7}, // shapetypeRound2SameRect,
|
||||
{ L"round-rectangle" , 7}, // shapetypeRoundRect,
|
||||
{ L"right-triangle" , 7}, // shapetypeRtTriangle,
|
||||
{ L"" , 7}, // shapetypeRoundRect,
|
||||
{ L"" , 7}, // shapetypeRtTriangle,
|
||||
{ L"smiley" , 7}, // shapetypeSmileyFace,
|
||||
{ L"" , 7}, // shapetypeSnip1Rect,
|
||||
{ L"" , 7}, // shapetypeSnip2DiagRect,
|
||||
@ -214,11 +214,11 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeSun,
|
||||
{ L"" , 7}, // shapetypeSwooshArrow,
|
||||
{ L"" , 7}, // shapetypeTeardrop,
|
||||
{ L"trapezoid" , 7}, // shapetypeTrapezoid,
|
||||
{ L"isosceles-triangle" , 7}, // shapetypeTriangle,
|
||||
{ L"up-arrow" , 7}, // shapetypeUpArrow,
|
||||
{ L"up-arrow-callout" , 7}, // shapetypeUpArrowCallout,
|
||||
{ L"up-down-arrow" , 7}, // shapetypeUpDownArrow,
|
||||
{ L"" , 7}, // shapetypeTrapezoid,
|
||||
{ L"" , 7}, // shapetypeTriangle,
|
||||
{ L"" , 7}, // shapetypeUpArrow,
|
||||
{ L"" , 7}, // shapetypeUpArrowCallout,
|
||||
{ L"" , 7}, // shapetypeUpDownArrow,
|
||||
{ L"up-down-arrow-callout" , 7}, // shapetypeUpDownArrowCallout,
|
||||
{ L"mso-spt101" , 7}, // shapetypeUturnArrow,
|
||||
{ L"vertical-scroll" , 7}, // shapetypeVerticalScroll,
|
||||
|
||||
@ -30,6 +30,12 @@
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
// shapetypeAccentBorderCallout1,
|
||||
// shapetypeAccentBorderCallout2,
|
||||
// shapetypeAccentBorderCallout3,
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
|
||||
}
|
||||
@ -29,3 +29,9 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -29,3 +29,67 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
//+ shapetypeBentUpArrow
|
||||
// shapetypeBentArrow,
|
||||
// shapetypeBentConnector2,
|
||||
// shapetypeBentConnector3,
|
||||
// shapetypeBentConnector4,
|
||||
// shapetypeBentConnector5,
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_BentUpArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_BentUpArrow()
|
||||
{
|
||||
odf_type_name =L"ooxml-bentUpArrow";
|
||||
|
||||
enhanced_path = L"M 0 ?f13 L ?f10 ?f13 ?f10 ?f4 ?f6 ?f4 ?f8 0 ?f18 ?f4 ?f11 ?f4 ?f11 ?f17 0 ?f17 Z N";
|
||||
text_areas = L"0 ?f13 ?f11 ?f17";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 25000 25000";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
|
||||
add(L"f1", L"if(0-$1 ,0,if(50000-$1 ,$1 ,50000))");
|
||||
add(L"f2", L"if(0-$2 ,0,if(50000-$2 ,$2 ,50000))");
|
||||
add(L"f3", L"min(logwidth,logheight)");
|
||||
add(L"f4", L"?f3 *?f2 /100000");
|
||||
add(L"f5", L"?f3 *?f1 /50000");
|
||||
add(L"f6", L"logwidth+0-?f5 ");
|
||||
add(L"f7", L"?f3 *?f1 /100000");
|
||||
add(L"f8", L"logwidth+0-?f7 ");
|
||||
add(L"f9", L"?f3 *?f0 /200000");
|
||||
add(L"f10", L"?f8 +0-?f9 ");
|
||||
add(L"f11", L"?f8 +?f9 -0");
|
||||
add(L"f12", L"?f3 *?f0 /100000");
|
||||
add(L"f13", L"logheight+0-?f12 ");
|
||||
add(L"f14", L"?f11 *1/2");
|
||||
add(L"f15", L"(?f13 +logheight)/2");
|
||||
add(L"f16", L"(?f4 +logheight)/2");
|
||||
add(L"f17", L"logheight");
|
||||
add(L"f18", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"0 ?f13";
|
||||
h1.y_maximum= L"50000";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f6 0";
|
||||
h2.x_maximum= L"50000";
|
||||
h2.x_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h1.position = L"?f10 ?f4";
|
||||
h1.y_maximum= L"50000";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
@ -29,3 +29,253 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
//+ shapetypeLeftArrowCallout
|
||||
//+ shapetypeRightArrowCallout
|
||||
//+ shapetypeUpArrowCallout
|
||||
//+ shapetypeDownArrowCallout
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_LeftArrowCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_LeftArrowCallout()
|
||||
{
|
||||
odf_type_name =L"ooxml-leftArrowCallout";
|
||||
|
||||
enhanced_path = L"M 0 ?f12 L ?f17 ?f13 ?f17 ?f14 ?f19 ?f14 ?f19 0 ?f22 0 ?f22 ?f21 ?f19 ?f21 ?f19 ?f15 ?f17 ?f15 ?f17 ?f16 Z N";
|
||||
text_areas = L"?f19 0 ?f22 ?f21";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 25000 25000 64977";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logheight/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"?f2 *2/1");
|
||||
add(L"f4", L"if(0-$0 ,0,if(?f3 -$0 ,$0 ,?f3 ))");
|
||||
add(L"f5", L"100000*logwidth/?f0 ");
|
||||
add(L"f6", L"if(0-$2 ,0,if(?f5 -$2 ,$2 ,?f5 ))");
|
||||
add(L"f7", L"?f6 *?f0 /logwidth");
|
||||
add(L"f8", L"100000+0-?f7 ");
|
||||
add(L"f9", L"if(0-$3 ,0,if(?f8 -$3 ,$3 ,?f8 ))");
|
||||
add(L"f10", L"?f0 *?f2 /100000");
|
||||
add(L"f11", L"?f0 *?f4 /200000");
|
||||
add(L"f12", L"logheight/2");
|
||||
add(L"f13", L"?f12 +0-?f10 ");
|
||||
add(L"f14", L"?f12 +0-?f11 ");
|
||||
add(L"f15", L"?f12 +?f11 -0");
|
||||
add(L"f16", L"?f12 +?f10 -0");
|
||||
add(L"f17", L"?f0 *?f6 /100000");
|
||||
add(L"f18", L"logwidth*?f9 /100000");
|
||||
add(L"f19", L"logwidth+0-?f18 ");
|
||||
add(L"f20", L"(?f19 +logwidth)/2");
|
||||
add(L"f21", L"logheight");
|
||||
add(L"f22", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h2.position = L"?f17 ?f14";
|
||||
h2.y_maximum= L"?f3";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h2.position = L"0 ?f13";
|
||||
h2.y_maximum= L"?f1";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h1.position = L"?f17 0";
|
||||
h1.x_maximum= L"?f5";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f19 ?f21";
|
||||
h1.x_maximum= L"?f8";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_RightArrowCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_RightArrowCallout()
|
||||
{
|
||||
odf_type_name = L"ooxml-rightArrowCallout";
|
||||
|
||||
enhanced_path = L"M 0 0 L ?f19 0 ?f19 ?f14 ?f18 ?f14 ?f18 ?f13 ?f21 ?f12 ?f18 ?f16 ?f18 ?f15 ?f19 ?f15 ?f19 ?f22 0 ?f22 Z N";
|
||||
text_areas = L"0 0 ?f19 ?f22";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 25000 25000 64977";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logheight/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"?f2 *2/1");
|
||||
add(L"f4", L"if(0-$0 ,0,if(?f3 -$0 ,$0 ,?f3 ))");
|
||||
add(L"f5", L"100000*logwidth/?f0 ");
|
||||
add(L"f6", L"if(0-$2 ,0,if(?f5 -$2 ,$2 ,?f5 ))");
|
||||
add(L"f7", L"?f6 *?f0 /logwidth");
|
||||
add(L"f8", L"100000+0-?f7 ");
|
||||
add(L"f9", L"if(0-$3 ,0,if(?f8 -$3 ,$3 ,?f8 ))");
|
||||
add(L"f10", L"?f0 *?f2 /100000");
|
||||
add(L"f11", L"?f0 *?f4 /200000");
|
||||
add(L"f12", L"logheight/2");
|
||||
add(L"f13", L"?f12 +0-?f10 ");
|
||||
add(L"f14", L"?f12 +0-?f11 ");
|
||||
add(L"f15", L"?f12 +?f11 -0");
|
||||
add(L"f16", L"?f12 +?f10 -0");
|
||||
add(L"f17", L"?f0 *?f6 /100000");
|
||||
add(L"f18", L"logwidth+0-?f17 ");
|
||||
add(L"f19", L"logwidth*?f9 /100000");
|
||||
add(L"f20", L"?f19 *1/2");
|
||||
add(L"f21", L"logwidth");
|
||||
add(L"f22", L"logheight");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h2.position = L"?f18 ?f14";
|
||||
h2.y_maximum= L"?f3";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h2.position = L"?f21 ?f13";
|
||||
h2.y_maximum= L"?f1";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h1.position = L"?f18 0";
|
||||
h1.x_maximum= L"?f5";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f19 ?f22";
|
||||
h1.x_maximum= L"?f8";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_UpArrowCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_UpArrowCallout()
|
||||
{
|
||||
odf_type_name =L"ooxml-upArrowCallout";
|
||||
|
||||
enhanced_path = L"M 0 ?f19 L ?f14 ?f19 ?f14 ?f17 ?f13 ?f17 ?f12 0 ?f16 ?f17 ?f15 ?f17 ?f15 ?f19 ?f21 ?f19 ?f21 ?f22 0 ?f22 Z N";
|
||||
text_areas = L"0 ?f19 ?f21 ?f22";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 25000 25000 64977";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"?f2 *2/1");
|
||||
add(L"f4", L"if(0-$0 ,0,if(?f3 -$0 ,$0 ,?f3 ))");
|
||||
add(L"f5", L"100000*logheight/?f0 ");
|
||||
add(L"f6", L"if(0-$2 ,0,if(?f5 -$2 ,$2 ,?f5 ))");
|
||||
add(L"f7", L"?f6 *?f0 /logheight");
|
||||
add(L"f8", L"100000+0-?f7 ");
|
||||
add(L"f9", L"if(0-$3 ,0,if(?f8 -$3 ,$3 ,?f8 ))");
|
||||
add(L"f10", L"?f0 *?f2 /100000");
|
||||
add(L"f11", L"?f0 *?f4 /200000");
|
||||
add(L"f12", L"logwidth/2");
|
||||
add(L"f13", L"?f12 +0-?f10 ");
|
||||
add(L"f14", L"?f12 +0-?f11 ");
|
||||
add(L"f15", L"?f12 +?f11 -0");
|
||||
add(L"f16", L"?f12 +?f10 -0");
|
||||
add(L"f17", L"?f0 *?f6 /100000");
|
||||
add(L"f18", L"logheight*?f9 /100000");
|
||||
add(L"f19", L"logheight+0-?f18 ");
|
||||
add(L"f20", L"(?f19 +logheight)/2");
|
||||
add(L"f21", L"logwidth");
|
||||
add(L"f22", L"logheight");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f14 ?f17";
|
||||
h1.x_maximum= L"?f3";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f13 0";
|
||||
h1.x_maximum= L"?f1";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f21 ?f17";
|
||||
h2.y_maximum= L"?f5";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h2.position = L"0 ?f19";
|
||||
h2.y_maximum= L"?f8";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_DownArrowCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_DownArrowCallout()
|
||||
{
|
||||
odf_type_name =L"ooxml-downArrowCallout";
|
||||
|
||||
enhanced_path = L"M 0 0 L ?f22 0 ?f22 ?f19 ?f15 ?f19 ?f15 ?f18 ?f16 ?f18 ?f12 ?f21 ?f13 ?f18 ?f14 ?f18 ?f14 ?f19 0 ?f19 Z N";
|
||||
text_areas = L"0 0 ?f22 ?f19";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 25000 25000 64977";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"?f2 *2/1");
|
||||
add(L"f4", L"if(0-$0 ,0,if(?f3 -$0 ,$0 ,?f3 ))");
|
||||
add(L"f5", L"100000*logheight/?f0 ");
|
||||
add(L"f6", L"if(0-$2 ,0,if(?f5 -$2 ,$2 ,?f5 ))");
|
||||
add(L"f7", L"?f6 *?f0 /logheight");
|
||||
add(L"f8", L"100000+0-?f7 ");
|
||||
add(L"f9", L"if(0-$3 ,0,if(?f8 -$3 ,$3 ,?f8 ))");
|
||||
add(L"f10", L"?f0 *?f2 /100000");
|
||||
add(L"f11", L"?f0 *?f4 /200000");
|
||||
add(L"f12", L"logwidth/2");
|
||||
add(L"f13", L"?f12 +0-?f10 ");
|
||||
add(L"f14", L"?f12 +0-?f11 ");
|
||||
add(L"f15", L"?f12 +?f11 -0");
|
||||
add(L"f16", L"?f12 +?f10 -0");
|
||||
add(L"f17", L"?f0 *?f6 /100000");
|
||||
add(L"f18", L"logheight+0-?f17 ");
|
||||
add(L"f19", L"logheight*?f9 /100000");
|
||||
add(L"f20", L"?f19 *1/2");
|
||||
add(L"f21", L"logheight");
|
||||
add(L"f22", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f14 ?f18";
|
||||
h1.x_maximum= L"?f3";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f13 ?f21";
|
||||
h1.x_maximum= L"?f1";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f22 ?f18";
|
||||
h2.y_maximum= L"?f5";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h2.position = L"0 ?f19";
|
||||
h2.y_maximum= L"?f8";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@ -29,6 +29,32 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
// shapetypeChartPlus,
|
||||
// shapetypeChartStar,
|
||||
// shapetypeChartX,
|
||||
// shapetypeChartX
|
||||
//+ shapetypeFlowChartExtract
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_FlowChartExtract : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_FlowChartExtract()
|
||||
{
|
||||
odf_type_name =L"ooxml-flowChartExtract";
|
||||
|
||||
enhanced_path = L"M 0 2 L 1 0 2 2 Z N";
|
||||
text_areas = L"?f2 ?f3 ?f0 ?f4";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"logwidth*3/4");
|
||||
add(L"f1", L"logwidth/2");
|
||||
add(L"f2", L"logwidth/4");
|
||||
add(L"f3", L"logheight/2");
|
||||
add(L"f4", L"logheight");
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@ -29,3 +29,9 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
|
||||
}
|
||||
@ -35,202 +35,386 @@
|
||||
// shapetypeCurvedConnector5,
|
||||
//+ shapetypeCurvedDownArrow,
|
||||
//+ shapetypeCurvedLeftArrow,
|
||||
// shapetypeCurvedRightArrow,
|
||||
// shapetypeCurvedUpArrow,
|
||||
//+ shapetypeCurvedRightArrow,
|
||||
//+ shapetypeCurvedUpArrow,
|
||||
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_curvedLeftArrow : public oox_shape
|
||||
class oox_shape_CurvedLeftArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_curvedLeftArrow()
|
||||
oox_shape_CurvedLeftArrow()
|
||||
{
|
||||
odf_type_name =L"ooxml-curvedLeftArrow";
|
||||
|
||||
//modifiers = L"23520";
|
||||
enhanced_path = L"M ?f2 ?f8 A ?f65 ?f66 ?f67 ?f68 ?f2 ?f8 ?f62 ?f64 W ?f69 ?f70 ?f71 ?f72 ?f2 ?f8 ?f62 ?f64 Z N";
|
||||
text_areas = L"?f22 ?f24 ?f23 ?f25";
|
||||
glue_points = L"?f22 ?f24 ?f22 ?f25 ?f23 ?f25 ?f23 ?f24";
|
||||
view_box = L"0 0 21600 21600";
|
||||
enhanced_path = L"M 0 ?f31 L ?f32 ?f28 ?f32 ?f24 G ?f44 ?f8 ?f45 ?f46 ?f44 ?f8 ?f47 ?f48 L ?f32 ?f29 Z S N M ?f42 ?f18 G ?f44 ?f8 ?f49 ?f50 L 0 0 G ?f44 ?f8 ?f51 ?f52 Z I S N M ?f42 ?f18 G ?f44 ?f8 ?f53 ?f54 L 0 0 G ?f44 ?f8 ?f55 ?f56 L ?f42 ?f18 G ?f44 ?f8 ?f57 ?f58 L ?f32 ?f29 0 ?f31 ?f32 ?f28 ?f32 ?f24 G ?f44 ?f8 ?f59 ?f60 F N";
|
||||
text_areas = L"0 0 ?f42 ?f43";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 50000 25000";
|
||||
|
||||
add(L"f0", L"10800000");
|
||||
add(L"f0", L"10800000");
|
||||
add(L"f1", L"5400000");
|
||||
add(L"f2", L"left");
|
||||
add(L"f3", L"right");
|
||||
add(L"f4", L"top");
|
||||
add(L"f5", L"bottom");
|
||||
add(L"f6", L"?f5 - ?f4");
|
||||
add(L"f7", L"?f6 / 2");
|
||||
add(L"f8", L"?f4 + ?f7");
|
||||
add(L"f9", L"?f3 - ?f2");
|
||||
add(L"f10", L"?f9 / 2");
|
||||
add(L"f11", L"?f2 + ?f10");
|
||||
add(L"f12", L"5419351 / 1725033");
|
||||
add(L"f13", L"2700000 + ?f1");
|
||||
add(L"f14", L"?f13 * ?f12 / ?f0");
|
||||
add(L"f15", L"0 - ?f14");
|
||||
add(L"f16", L"sin(?f15)");
|
||||
add(L"f17", L"0 - ?f16");
|
||||
add(L"f18", L"?f17 * ?f10");
|
||||
add(L"f19", L"cos(?f15)");
|
||||
add(L"f20", L"0 - ?f19");
|
||||
add(L"f21", L"?f20 * ?f7");
|
||||
add(L"f22", L"?f11 - ?f18");
|
||||
add(L"f23", L"?f11 + ?f18");
|
||||
add(L"f24", L"?f8 - ?f21");
|
||||
add(L"f25", L"?f8 + ?f21");
|
||||
add(L"f26", L"21550000 - 21600000");
|
||||
add(L"f27", L"if(?f26, 21600000, 21550000)");
|
||||
add(L"f28", L"-21550000 - ?f27");
|
||||
add(L"f29", L"if(?f28, -21550000, ?f27)");
|
||||
add(L"f30", L"?f0 + ?f29");
|
||||
add(L"f31", L"?f0 + ?f1");
|
||||
add(L"f32", L"?f31 * ?f12 / ?f0");
|
||||
add(L"f33", L"0 - ?f32");
|
||||
add(L"f34", L"cos(?f33)");
|
||||
add(L"f35", L"0 - ?f34");
|
||||
add(L"f36", L"?f35 * ?f10");
|
||||
add(L"f37", L"sin(?f33)");
|
||||
add(L"f38", L"0 - ?f37");
|
||||
add(L"f39", L"?f38 * ?f7");
|
||||
add(L"f40", L"sqrt(?f36 * ?f36 + ?f39 * ?f39 + 0 * 0)");
|
||||
add(L"f41", L"?f10 * ?f7 / ?f40");
|
||||
add(L"f42", L"?f38 * ?f41");
|
||||
add(L"f43", L"?f2 - ?f42");
|
||||
add(L"f44", L"?f35 * ?f41");
|
||||
add(L"f45", L"?f8 - ?f44");
|
||||
add(L"f46", L"?f43 - ?f10");
|
||||
add(L"f47", L"?f45 - ?f7");
|
||||
add(L"f48", L"?f43 + ?f10");
|
||||
add(L"f49", L"?f45 + ?f7");
|
||||
add(L"f50", L"?f30 + ?f1");
|
||||
add(L"f51", L"?f50 * ?f12 / ?f0");
|
||||
add(L"f52", L"0 - ?f51");
|
||||
add(L"f53", L"cos(?f52)");
|
||||
add(L"f54", L"0 - ?f53");
|
||||
add(L"f55", L"?f54 * ?f10");
|
||||
add(L"f56", L"sin(?f52)");
|
||||
add(L"f57", L"0 - ?f56");
|
||||
add(L"f58", L"?f57 * ?f7");
|
||||
add(L"f59", L"sqrt(?f55 * ?f55 + ?f58 * ?f58 + 0 * 0)");
|
||||
add(L"f60", L"?f10 * ?f7 / ?f59");
|
||||
add(L"f61", L"?f57 * ?f60");
|
||||
add(L"f62", L"?f43 + ?f61");
|
||||
add(L"f63", L"?f54 * ?f60");
|
||||
add(L"f64", L"?f45 + ?f63");
|
||||
add(L"f65", L"if(?f29, ?f2, ?f46)");
|
||||
add(L"f66", L"if(?f29, ?f8, ?f47)");
|
||||
add(L"f67", L"if(?f29, ?f2, ?f48)");
|
||||
add(L"f68", L"if(?f29, ?f8, ?f49)");
|
||||
add(L"f69", L"if(?f29, ?f46, ?f62)");
|
||||
add(L"f70", L"if(?f29, ?f47, ?f64)");
|
||||
add(L"f71", L"if(?f29, ?f48, ?f62)");
|
||||
add(L"f72", L"if(?f29, ?f49, ?f64)");
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logheight/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"if(0-$0 ,0,if(?f2 -$0 ,$0 ,?f2 ))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"?f0 *?f2 /100000");
|
||||
add(L"f6", L"(?f4 +?f5 )/4");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f8 *2/1");
|
||||
add(L"f10", L"?f9 *?f9 /1");
|
||||
add(L"f11", L"?f4 *?f4 /1");
|
||||
add(L"f12", L"?f10 +0-?f11 ");
|
||||
add(L"f13", L"sqrt(?f12 )");
|
||||
add(L"f14", L"?f13 *logwidth/?f9 ");
|
||||
add(L"f15", L"100000*?f14 /?f0 ");
|
||||
add(L"f16", L"if(0-$2 ,0,if(?f15 -$2 ,$2 ,?f15 ))");
|
||||
add(L"f17", L"?f0 *?f16 /100000");
|
||||
add(L"f18", L"?f8 +?f4 -0");
|
||||
add(L"f19", L"logwidth*logwidth/1");
|
||||
add(L"f20", L"?f17 *?f17 /1");
|
||||
add(L"f21", L"?f19 +0-?f20 ");
|
||||
add(L"f22", L"sqrt(?f21 )");
|
||||
add(L"f23", L"?f22 *?f8 /logwidth");
|
||||
add(L"f24", L"?f8 +?f23 -0");
|
||||
add(L"f25", L"?f18 +?f23 -0");
|
||||
add(L"f26", L"?f5 +0-?f4 ");
|
||||
add(L"f27", L"?f26 *1/2");
|
||||
add(L"f28", L"?f24 +0-?f27 ");
|
||||
add(L"f29", L"?f25 +?f27 -0");
|
||||
add(L"f30", L"?f5 *1/2");
|
||||
add(L"f31", L"logheight+0-?f30 ");
|
||||
add(L"f32", L"0+?f17 -0");
|
||||
add(L"f33", L"(10800000*atan2(?f23 ,?f17 ))/pi");
|
||||
add(L"f34", L"0+0-?f33 ");
|
||||
add(L"f35", L"0+?f14 -0");
|
||||
add(L"f36", L"(?f8 +?f18 )/2");
|
||||
add(L"f37", L"?f4 *1/2");
|
||||
add(L"f38", L"(10800000*atan2(?f37 ,?f14 ))/pi");
|
||||
add(L"f39", L"?f38 +0-?f33 ");
|
||||
add(L"f40", L"?f33 +?f38 -0");
|
||||
add(L"f41", L"0+0-?f38 ");
|
||||
add(L"f42", L"logwidth");
|
||||
add(L"f43", L"logheight");
|
||||
add(L"f44", L"logwidth");
|
||||
add(L"f45", L"(?f33 )/60000.0");
|
||||
add(L"f46", L"(?f39 )/60000.0");
|
||||
add(L"f47", L"(?f41 )/60000.0");
|
||||
add(L"f48", L"(?f40 )/60000.0");
|
||||
add(L"f49", L"(0)/60000.0");
|
||||
add(L"f50", L"(-5400000)/60000.0");
|
||||
add(L"f51", L"(16200000)/60000.0");
|
||||
add(L"f52", L"(5400000)/60000.0");
|
||||
add(L"f53", L"(0)/60000.0");
|
||||
add(L"f54", L"(-5400000)/60000.0");
|
||||
add(L"f55", L"(16200000)/60000.0");
|
||||
add(L"f56", L"(5400000)/60000.0");
|
||||
add(L"f57", L"(0)/60000.0");
|
||||
add(L"f58", L"(?f33 )/60000.0");
|
||||
add(L"f59", L"(?f33 )/60000.0");
|
||||
add(L"f60", L"(?f39 )/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
h.position = L"0 ?f2";
|
||||
h.y_maximum= L"51965";
|
||||
h.y_minimum= L"0";
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f32 ?f24";
|
||||
h1.y_maximum= L"?f2";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
handles.push_back(h);
|
||||
h1.position = L"?f42 ?f28";
|
||||
h1.y_maximum= L"?f1";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f32 ?f43";
|
||||
h2.x_maximum= L"?f15";
|
||||
h2.x_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
class oox_shape_curvedDownArrow : public oox_shape
|
||||
class oox_shape_CurvedRightArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_curvedDownArrow()
|
||||
oox_shape_CurvedRightArrow()
|
||||
{
|
||||
odf_type_name =L"ooxml-curvedRightArrow";
|
||||
|
||||
enhanced_path = L"M 0 ?f8 G ?f45 ?f8 ?f46 ?f47 L ?f32 ?f28 ?f43 ?f31 ?f32 ?f29 ?f32 ?f25 G ?f45 ?f8 ?f48 ?f49 Z S N M ?f43 ?f4 G ?f45 ?f8 ?f50 ?f51 ?f45 ?f8 ?f52 ?f53 Z I S N M 0 ?f8 G ?f45 ?f8 ?f54 ?f55 L ?f32 ?f28 ?f43 ?f31 ?f32 ?f29 ?f32 ?f25 G ?f45 ?f8 ?f56 ?f57 L 0 ?f8 G ?f45 ?f8 ?f58 ?f59 L ?f43 ?f4 G ?f45 ?f8 ?f60 ?f61 F N";
|
||||
text_areas = L"0 0 ?f43 ?f44";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 50000 25000";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logheight/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"if(0-$0 ,0,if(?f2 -$0 ,$0 ,?f2 ))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"?f0 *?f2 /100000");
|
||||
add(L"f6", L"(?f4 +?f5 )/4");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f8 *2/1");
|
||||
add(L"f10", L"?f9 *?f9 /1");
|
||||
add(L"f11", L"?f4 *?f4 /1");
|
||||
add(L"f12", L"?f10 +0-?f11 ");
|
||||
add(L"f13", L"sqrt(?f12 )");
|
||||
add(L"f14", L"?f13 *logwidth/?f9 ");
|
||||
add(L"f15", L"100000*?f14 /?f0 ");
|
||||
add(L"f16", L"if(0-$2 ,0,if(?f15 -$2 ,$2 ,?f15 ))");
|
||||
add(L"f17", L"?f0 *?f16 /100000");
|
||||
add(L"f18", L"?f8 +?f4 -0");
|
||||
add(L"f19", L"logwidth*logwidth/1");
|
||||
add(L"f20", L"?f17 *?f17 /1");
|
||||
add(L"f21", L"?f19 +0-?f20 ");
|
||||
add(L"f22", L"sqrt(?f21 )");
|
||||
add(L"f23", L"?f22 *?f8 /logwidth");
|
||||
add(L"f24", L"?f8 +?f23 -0");
|
||||
add(L"f25", L"?f18 +?f23 -0");
|
||||
add(L"f26", L"?f5 +0-?f4 ");
|
||||
add(L"f27", L"?f26 *1/2");
|
||||
add(L"f28", L"?f24 +0-?f27 ");
|
||||
add(L"f29", L"?f25 +?f27 -0");
|
||||
add(L"f30", L"?f5 *1/2");
|
||||
add(L"f31", L"logheight+0-?f30 ");
|
||||
add(L"f32", L"logwidth+0-?f17 ");
|
||||
add(L"f33", L"(10800000*atan2(?f23 ,?f17 ))/pi");
|
||||
add(L"f34", L"10800000+0-?f33 ");
|
||||
add(L"f35", L"0+0-?f33 ");
|
||||
add(L"f36", L"logwidth+0-?f14 ");
|
||||
add(L"f37", L"(?f8 +?f18 )/2");
|
||||
add(L"f38", L"?f4 *1/2");
|
||||
add(L"f39", L"(10800000*atan2(?f38 ,?f14 ))/pi");
|
||||
add(L"f40", L"?f39 +0-5400000");
|
||||
add(L"f41", L"5400000+?f39 -0");
|
||||
add(L"f42", L"10800000+0-?f39 ");
|
||||
add(L"f43", L"logwidth");
|
||||
add(L"f44", L"logheight");
|
||||
add(L"f45", L"logwidth");
|
||||
add(L"f46", L"(10800000)/60000.0");
|
||||
add(L"f47", L"(?f35 )/60000.0");
|
||||
add(L"f48", L"(?f34 )/60000.0");
|
||||
add(L"f49", L"(?f33 )/60000.0");
|
||||
add(L"f50", L"(16200000)/60000.0");
|
||||
add(L"f51", L"(?f40 )/60000.0");
|
||||
add(L"f52", L"(?f42 )/60000.0");
|
||||
add(L"f53", L"(?f41 )/60000.0");
|
||||
add(L"f54", L"(10800000)/60000.0");
|
||||
add(L"f55", L"(?f35 )/60000.0");
|
||||
add(L"f56", L"(?f34 )/60000.0");
|
||||
add(L"f57", L"(?f33 )/60000.0");
|
||||
add(L"f58", L"(10800000)/60000.0");
|
||||
add(L"f59", L"(5400000)/60000.0");
|
||||
add(L"f60", L"(16200000)/60000.0");
|
||||
add(L"f61", L"(?f40 )/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f32 ?f24";
|
||||
h1.y_maximum= L"?f2";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f43 ?f28";
|
||||
h1.y_maximum= L"?f1";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f32 ?f43";
|
||||
h2.x_maximum= L"?f15";
|
||||
h2.x_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
class oox_shape_CurvedDownArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_CurvedDownArrow()
|
||||
{
|
||||
odf_type_name =L"ooxml-curvedDownArrow";
|
||||
|
||||
//modifiers = L"23520";
|
||||
enhanced_path = L"M ?f2 ?f8 A ?f65 ?f66 ?f67 ?f68 ?f2 ?f8 ?f62 ?f64 W ?f69 ?f70 ?f71 ?f72 ?f2 ?f8 ?f62 ?f64 Z N";
|
||||
text_areas = L"?f22 ?f24 ?f23 ?f25";
|
||||
glue_points = L"?f22 ?f24 ?f22 ?f25 ?f23 ?f25 ?f23 ?f24";
|
||||
view_box = L"0 0 21600 21600";
|
||||
enhanced_path = L"M ?f31 ?f43 L ?f28 ?f32 ?f24 ?f32 G ?f8 ?f45 ?f46 ?f47 L ?f18 0 G ?f8 ?f45 ?f48 ?f49 L ?f29 ?f32 Z S N M ?f36 ?f35 G ?f8 ?f45 ?f50 ?f51 L 0 ?f43 G ?f8 ?f45 ?f52 ?f53 Z I S N M ?f36 ?f35 G ?f8 ?f45 ?f54 ?f55 L 0 ?f43 G ?f8 ?f45 ?f56 ?f57 L ?f18 0 G ?f8 ?f45 ?f58 ?f59 L ?f29 ?f32 ?f31 ?f43 ?f28 ?f32 ?f24 ?f32 G ?f8 ?f45 ?f60 ?f61 F N";
|
||||
text_areas = L"0 0 ?f44 ?f43";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 50000 25000";
|
||||
|
||||
add(L"f0", L"10800000");
|
||||
add(L"f1", L"5400000");
|
||||
add(L"f2", L"left");
|
||||
add(L"f3", L"right");
|
||||
add(L"f4", L"top");
|
||||
add(L"f5", L"bottom");
|
||||
add(L"f6", L"?f5 - ?f4");
|
||||
add(L"f7", L"?f6 / 2");
|
||||
add(L"f8", L"?f4 + ?f7");
|
||||
add(L"f9", L"?f3 - ?f2");
|
||||
add(L"f10", L"?f9 / 2");
|
||||
add(L"f11", L"?f2 + ?f10");
|
||||
add(L"f12", L"5419351 / 1725033");
|
||||
add(L"f13", L"2700000 + ?f1");
|
||||
add(L"f14", L"?f13 * ?f12 / ?f0");
|
||||
add(L"f15", L"0 - ?f14");
|
||||
add(L"f16", L"sin(?f15)");
|
||||
add(L"f17", L"0 - ?f16");
|
||||
add(L"f18", L"?f17 * ?f10");
|
||||
add(L"f19", L"cos(?f15)");
|
||||
add(L"f20", L"0 - ?f19");
|
||||
add(L"f21", L"?f20 * ?f7");
|
||||
add(L"f22", L"?f11 - ?f18");
|
||||
add(L"f23", L"?f11 + ?f18");
|
||||
add(L"f24", L"?f8 - ?f21");
|
||||
add(L"f25", L"?f8 + ?f21");
|
||||
add(L"f26", L"21550000 - 21600000");
|
||||
add(L"f27", L"if(?f26, 21600000, 21550000)");
|
||||
add(L"f28", L"-21550000 - ?f27");
|
||||
add(L"f29", L"if(?f28, -21550000, ?f27)");
|
||||
add(L"f30", L"?f0 + ?f29");
|
||||
add(L"f31", L"?f0 + ?f1");
|
||||
add(L"f32", L"?f31 * ?f12 / ?f0");
|
||||
add(L"f33", L"0 - ?f32");
|
||||
add(L"f34", L"cos(?f33)");
|
||||
add(L"f35", L"0 - ?f34");
|
||||
add(L"f36", L"?f35 * ?f10");
|
||||
add(L"f37", L"sin(?f33)");
|
||||
add(L"f38", L"0 - ?f37");
|
||||
add(L"f39", L"?f38 * ?f7");
|
||||
add(L"f40", L"sqrt(?f36 * ?f36 + ?f39 * ?f39 + 0 * 0)");
|
||||
add(L"f41", L"?f10 * ?f7 / ?f40");
|
||||
add(L"f42", L"?f38 * ?f41");
|
||||
add(L"f43", L"?f2 - ?f42");
|
||||
add(L"f44", L"?f35 * ?f41");
|
||||
add(L"f45", L"?f8 - ?f44");
|
||||
add(L"f46", L"?f43 - ?f10");
|
||||
add(L"f47", L"?f45 - ?f7");
|
||||
add(L"f48", L"?f43 + ?f10");
|
||||
add(L"f49", L"?f45 + ?f7");
|
||||
add(L"f50", L"?f30 + ?f1");
|
||||
add(L"f51", L"?f50 * ?f12 / ?f0");
|
||||
add(L"f52", L"0 - ?f51");
|
||||
add(L"f53", L"cos(?f52)");
|
||||
add(L"f54", L"0 - ?f53");
|
||||
add(L"f55", L"?f54 * ?f10");
|
||||
add(L"f56", L"sin(?f52)");
|
||||
add(L"f57", L"0 - ?f56");
|
||||
add(L"f58", L"?f57 * ?f7");
|
||||
add(L"f59", L"sqrt(?f55 * ?f55 + ?f58 * ?f58 + 0 * 0)");
|
||||
add(L"f60", L"?f10 * ?f7 / ?f59");
|
||||
add(L"f61", L"?f57 * ?f60");
|
||||
add(L"f62", L"?f43 + ?f61");
|
||||
add(L"f63", L"?f54 * ?f60");
|
||||
add(L"f64", L"?f45 + ?f63");
|
||||
add(L"f65", L"if(?f29, ?f2, ?f46)");
|
||||
add(L"f66", L"if(?f29, ?f8, ?f47)");
|
||||
add(L"f67", L"if(?f29, ?f2, ?f48)");
|
||||
add(L"f68", L"if(?f29, ?f8, ?f49)");
|
||||
add(L"f69", L"if(?f29, ?f46, ?f62)");
|
||||
add(L"f70", L"if(?f29, ?f47, ?f64)");
|
||||
add(L"f71", L"if(?f29, ?f48, ?f62)");
|
||||
add(L"f72", L"if(?f29, ?f49, ?f64)");
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"?f0 *?f2 /100000");
|
||||
add(L"f6", L"(?f4 +?f5 )/4");
|
||||
add(L"f7", L"logwidth/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f8 *2/1");
|
||||
add(L"f10", L"?f9 *?f9 /1");
|
||||
add(L"f11", L"?f4 *?f4 /1");
|
||||
add(L"f12", L"?f10 +0-?f11 ");
|
||||
add(L"f13", L"sqrt(?f12 )");
|
||||
add(L"f14", L"?f13 *logheight/?f9 ");
|
||||
add(L"f15", L"100000*?f14 /?f0 ");
|
||||
add(L"f16", L"if(0-$2 ,0,if(?f15 -$2 ,$2 ,?f15 ))");
|
||||
add(L"f17", L"?f0 *$2 /100000");
|
||||
add(L"f18", L"?f8 +?f4 -0");
|
||||
add(L"f19", L"logheight*logheight/1");
|
||||
add(L"f20", L"?f17 *?f17 /1");
|
||||
add(L"f21", L"?f19 +0-?f20 ");
|
||||
add(L"f22", L"sqrt(?f21 )");
|
||||
add(L"f23", L"?f22 *?f8 /logheight");
|
||||
add(L"f24", L"?f8 +?f23 -0");
|
||||
add(L"f25", L"?f18 +?f23 -0");
|
||||
add(L"f26", L"?f5 +0-?f4 ");
|
||||
add(L"f27", L"?f26 *1/2");
|
||||
add(L"f28", L"?f24 +0-?f27 ");
|
||||
add(L"f29", L"?f25 +?f27 -0");
|
||||
add(L"f30", L"?f5 *1/2");
|
||||
add(L"f31", L"logwidth+0-?f30 ");
|
||||
add(L"f32", L"logheight+0-?f17 ");
|
||||
add(L"f33", L"(10800000*atan2(?f23 ,?f17 ))/pi");
|
||||
add(L"f34", L"0+0-?f33 ");
|
||||
add(L"f35", L"logheight+0-?f14 ");
|
||||
add(L"f36", L"(?f8 +?f18 )/2");
|
||||
add(L"f37", L"?f4 *1/2");
|
||||
add(L"f38", L"(10800000*atan2(?f37 ,?f14 ))/pi");
|
||||
add(L"f39", L"16200000+?f33 -0");
|
||||
add(L"f40", L"16200000+0-?f38 ");
|
||||
add(L"f41", L"?f38 +0-5400000");
|
||||
add(L"f42", L"5400000+?f38 -0");
|
||||
add(L"f43", L"logheight");
|
||||
add(L"f44", L"logwidth");
|
||||
add(L"f45", L"logheight");
|
||||
add(L"f46", L"(?f39 )/60000.0");
|
||||
add(L"f47", L"(?f34 )/60000.0");
|
||||
add(L"f48", L"(16200000)/60000.0");
|
||||
add(L"f49", L"(?f33 )/60000.0");
|
||||
add(L"f50", L"(?f40 )/60000.0");
|
||||
add(L"f51", L"(?f41 )/60000.0");
|
||||
add(L"f52", L"(10800000)/60000.0");
|
||||
add(L"f53", L"(?f42 )/60000.0");
|
||||
add(L"f54", L"(?f40 )/60000.0");
|
||||
add(L"f55", L"(?f41 )/60000.0");
|
||||
add(L"f56", L"(10800000)/60000.0");
|
||||
add(L"f57", L"(5400000)/60000.0");
|
||||
add(L"f58", L"(16200000)/60000.0");
|
||||
add(L"f59", L"(?f33 )/60000.0");
|
||||
add(L"f60", L"(?f39 )/60000.0");
|
||||
add(L"f61", L"(?f34 )/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
h.position = L"0 ?f2";
|
||||
h.y_maximum= L"51965";
|
||||
h.y_minimum= L"0";
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f25 ?f32";
|
||||
h1.x_maximum= L"$1";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f28 ?f43";
|
||||
h1.x_maximum= L"?f1";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f44 ?f32";
|
||||
h2.y_maximum= L"?f15";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
class oox_shape_CurvedUpArrow : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_CurvedUpArrow()
|
||||
{
|
||||
odf_type_name =L"ooxml-curvedUpArrow";
|
||||
|
||||
enhanced_path = L"M ?f31 0 L ?f29 ?f32 ?f25 ?f32 G ?f8 ?f46 ?f47 ?f48 ?f8 ?f46 ?f49 ?f50 L ?f28 ?f32 Z S N M ?f8 ?f45 G ?f8 ?f46 ?f51 ?f52 L ?f4 0 G ?f8 ?f46 ?f53 ?f54 Z I S N M ?f36 ?f35 G ?f8 ?f46 ?f55 ?f56 L ?f28 ?f32 ?f31 0 ?f29 ?f32 ?f25 ?f32 G ?f8 ?f46 ?f57 ?f58 L ?f8 ?f45 G ?f8 ?f46 ?f59 ?f60 L ?f4 0 G ?f8 ?f46 ?f61 ?f62 F N";
|
||||
text_areas = L"0 0 ?f44 ?f45";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000 50000 25000";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$1 ,0,if(?f1 -$1 ,$1 ,?f1 ))");
|
||||
add(L"f3", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f4", L"?f0 *?f3 /100000");
|
||||
add(L"f5", L"?f0 *?f2 /100000");
|
||||
add(L"f6", L"(?f4 +?f5 )/4");
|
||||
add(L"f7", L"logwidth/2");
|
||||
add(L"f8", L"?f7 +0-?f6 ");
|
||||
add(L"f9", L"?f8 *2/1");
|
||||
add(L"f10", L"?f9 *?f9 /1");
|
||||
add(L"f11", L"?f4 *?f4 /1");
|
||||
add(L"f12", L"?f10 +0-?f11 ");
|
||||
add(L"f13", L"sqrt(?f12 )");
|
||||
add(L"f14", L"?f13 *logheight/?f9 ");
|
||||
add(L"f15", L"100000*?f14 /?f0 ");
|
||||
add(L"f16", L"if(0-$2 ,0,if(?f15 -$2 ,$2 ,?f15 ))");
|
||||
add(L"f17", L"?f0 *$2 /100000");
|
||||
add(L"f18", L"?f8 +?f4 -0");
|
||||
add(L"f19", L"logheight*logheight/1");
|
||||
add(L"f20", L"?f17 *?f17 /1");
|
||||
add(L"f21", L"?f19 +0-?f20 ");
|
||||
add(L"f22", L"sqrt(?f21 )");
|
||||
add(L"f23", L"?f22 *?f8 /logheight");
|
||||
add(L"f24", L"?f8 +?f23 -0");
|
||||
add(L"f25", L"?f18 +?f23 -0");
|
||||
add(L"f26", L"?f5 +0-?f4 ");
|
||||
add(L"f27", L"?f26 *1/2");
|
||||
add(L"f28", L"?f24 +0-?f27 ");
|
||||
add(L"f29", L"?f25 +?f27 -0");
|
||||
add(L"f30", L"?f5 *1/2");
|
||||
add(L"f31", L"logwidth+0-?f30 ");
|
||||
add(L"f32", L"0+?f17 -0");
|
||||
add(L"f33", L"(10800000*atan2(?f23 ,?f17 ))/pi");
|
||||
add(L"f34", L"0+0-?f33 ");
|
||||
add(L"f35", L"0+?f14 -0");
|
||||
add(L"f36", L"(?f8 +?f18 )/2");
|
||||
add(L"f37", L"?f4 *1/2");
|
||||
add(L"f38", L"(10800000*atan2(?f37 ,?f14 ))/pi");
|
||||
add(L"f39", L"?f38 +0-?f33 ");
|
||||
add(L"f40", L"0+0-?f39 ");
|
||||
add(L"f41", L"5400000+0-?f33 ");
|
||||
add(L"f42", L"?f33 +?f38 -0");
|
||||
add(L"f43", L"5400000+0-?f38 ");
|
||||
add(L"f44", L"logwidth");
|
||||
add(L"f45", L"logheight");
|
||||
add(L"f46", L"logheight");
|
||||
add(L"f47", L"(?f41 )/60000.0");
|
||||
add(L"f48", L"(?f42 )/60000.0");
|
||||
add(L"f49", L"(?f43 )/60000.0");
|
||||
add(L"f50", L"(?f39 )/60000.0");
|
||||
add(L"f51", L"(5400000)/60000.0");
|
||||
add(L"f52", L"(5400000)/60000.0");
|
||||
add(L"f53", L"(10800000)/60000.0");
|
||||
add(L"f54", L"(-5400000)/60000.0");
|
||||
add(L"f55", L"(?f43 )/60000.0");
|
||||
add(L"f56", L"(?f39 )/60000.0");
|
||||
add(L"f57", L"(?f41 )/60000.0");
|
||||
add(L"f58", L"(?f33 )/60000.0");
|
||||
add(L"f59", L"(5400000)/60000.0");
|
||||
add(L"f60", L"(5400000)/60000.0");
|
||||
add(L"f61", L"(10800000)/60000.0");
|
||||
add(L"f62", L"(-5400000)/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f25 ?f32";
|
||||
h1.x_maximum= L"?f2";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h1.position = L"?f28 0";
|
||||
h1.x_maximum= L"?f1";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f44 ?f32";
|
||||
h2.y_maximum= L"?f15";
|
||||
h2.y_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -30,11 +30,12 @@
|
||||
*
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
// shapetypeMathDivide,
|
||||
// shapetypeMathEqual,
|
||||
// shapetypeMathMinus,
|
||||
//+ // shapetypeMathMultiply,
|
||||
// shapetypeMathNotEqual,
|
||||
//+ shapetypeMathDivide,
|
||||
//+ shapetypeMathEqual,
|
||||
//+ shapetypeMathMinus,
|
||||
//+ shapetypeMathMultiply,
|
||||
//+ shapetypeMathPlus,
|
||||
//+ shapetypeMathNotEqual,
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_mathMultiply : public oox_shape
|
||||
@ -117,4 +118,259 @@ public:
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
class oox_shape_mathEqual : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_mathEqual()
|
||||
{
|
||||
odf_type_name =L"ooxml-mathEqual";
|
||||
|
||||
enhanced_path = L"M ?f13 ?f10 L ?f14 ?f10 ?f14 ?f8 ?f13 ?f8 Z M ?f13 ?f9 L ?f14 ?f9 ?f14 ?f11 ?f13 ?f11 Z N";
|
||||
text_areas = L"?f13 ?f10 ?f14 ?f11";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"23520 11760";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(36745-$0 ,$0 ,36745))");
|
||||
add(L"f1", L"?f0 *2/1");
|
||||
add(L"f2", L"100000+0-2");
|
||||
add(L"f3", L"if(0-$1 ,0,if(?f2 -$1 ,$1 ,?f2 ))");
|
||||
add(L"f4", L"logheight*?f0 /100000");
|
||||
add(L"f5", L"logheight*?f3 /200000");
|
||||
add(L"f6", L"logwidth*73490/200000");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 +0-?f5 ");
|
||||
add(L"f9", L"?f7 +?f5 -0");
|
||||
add(L"f10", L"?f8 +0-?f4 ");
|
||||
add(L"f11", L"?f9 +?f4 -0");
|
||||
add(L"f12", L"logwidth/2");
|
||||
add(L"f13", L"?f12 +0-?f6 ");
|
||||
add(L"f14", L"?f12 +?f6 -0");
|
||||
add(L"f15", L"(?f10 +?f8 )/2");
|
||||
add(L"f16", L"(?f9 +?f11 )/2");
|
||||
add(L"f17", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
h.position = L"0 ?f10";
|
||||
h.y_maximum= L"36745";
|
||||
h.y_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
|
||||
h.position = L"?f17 ?f8";
|
||||
h.y_maximum= L"?f2";
|
||||
h.y_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
class oox_shape_mathDivide : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_mathDivide()
|
||||
{
|
||||
odf_type_name =L"ooxml-mathDivide";
|
||||
|
||||
enhanced_path = L"M ?f20 ?f18 G ?f11 ?f11 ?f25 ?f26 Z M ?f20 ?f19 G ?f11 ?f11 ?f27 ?f28 Z M ?f21 ?f14 L ?f22 ?f14 ?f22 ?f15 ?f21 ?f15 Z N";
|
||||
text_areas = L"?f21 ?f14 ?f22 ?f15";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"23520 5880 11760";
|
||||
|
||||
add(L"f0", L"if(1000-$0 ,1000,if(36745-$0 ,$0 ,36745))");
|
||||
add(L"f1", L"0+0-?f0 ");
|
||||
add(L"f2", L"(73490+?f1 )/4");
|
||||
add(L"f3", L"36745*logwidth/logheight");
|
||||
add(L"f4", L"min(?f2 ,?f3 )");
|
||||
add(L"f5", L"if(1000-$2 ,1000,if(?f4 -$2 ,$2 ,?f4 ))");
|
||||
add(L"f6", L"-4*?f5 /1");
|
||||
add(L"f7", L"73490+?f6 -?f0 ");
|
||||
add(L"f8", L"if(0-$1 ,0,if(?f7 -$1 ,$1 ,?f7 ))");
|
||||
add(L"f9", L"logheight*?f0 /200000");
|
||||
add(L"f10", L"logheight*?f8 /100000");
|
||||
add(L"f11", L"logheight*?f5 /100000");
|
||||
add(L"f12", L"logwidth*73490/200000");
|
||||
add(L"f13", L"logheight/2");
|
||||
add(L"f14", L"?f13 +0-?f9 ");
|
||||
add(L"f15", L"?f13 +?f9 -0");
|
||||
add(L"f16", L"?f10 +?f11 -0");
|
||||
add(L"f17", L"?f14 +0-?f16 ");
|
||||
add(L"f18", L"?f17 +0-?f11 ");
|
||||
add(L"f19", L"logheight+0-?f18 ");
|
||||
add(L"f20", L"logwidth/2");
|
||||
add(L"f21", L"?f20 +0-?f12 ");
|
||||
add(L"f22", L"?f20 +?f12 -0");
|
||||
add(L"f23", L"?f20 +0-?f11 ");
|
||||
add(L"f24", L"logwidth");
|
||||
add(L"f25", L"(16200000)/60000.0");
|
||||
add(L"f26", L"(21600000)/60000.0");
|
||||
add(L"f27", L"(5400000)/60000.0");
|
||||
add(L"f28", L"(21600000)/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h, h1;
|
||||
h.position = L"0 ?f14";
|
||||
h.y_maximum= L"36745";
|
||||
h.y_minimum= L"1000";
|
||||
handles.push_back(h);
|
||||
|
||||
h.position = L"?f24 ?f17";
|
||||
h.y_maximum= L"?f7";
|
||||
h.y_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
|
||||
h1.position = L"?f23 0";
|
||||
h1.x_maximum= L"?f4";
|
||||
h1.x_minimum= L"1000";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
class oox_shape_mathNotEqual : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_mathNotEqual()
|
||||
{
|
||||
odf_type_name =L"ooxml-mathNotEqual";
|
||||
|
||||
enhanced_path = L"M ?f9 ?f14 L ?f24 ?f14 ?f43 ?f47 ?f42 ?f46 ?f34 ?f14 ?f10 ?f14 ?f10 ?f12 ?f35 ?f12 ?f36 ?f13 ?f10 ?f13 ?f10 ?f15 ?f37 ?f15 ?f49 ?f51 ?f48 ?f50 ?f30 ?f15 ?f9 ?f15 ?f9 ?f13 ?f28 ?f13 ?f26 ?f12 ?f9 ?f12 Z N";
|
||||
text_areas = L"?f9 ?f14 ?f10 ?f15";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"23520 6600000 11760";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
|
||||
add(L"f1", L"if(4200000-$1 ,4200000,if(6600000-$1 ,$1 ,6600000))");
|
||||
add(L"f2", L"?f0 *2/1");
|
||||
add(L"f3", L"100000+0-2");
|
||||
add(L"f4", L"if(0-$2 ,0,if(?f3 -$2 ,$2 ,?f3 ))");
|
||||
add(L"f5", L"logheight*?f0 /100000");
|
||||
add(L"f6", L"logheight*?f4 /200000");
|
||||
add(L"f7", L"logwidth*73490/200000");
|
||||
add(L"f8", L"logwidth/2");
|
||||
add(L"f9", L"?f8 +0-?f7 ");
|
||||
add(L"f10", L"?f8 +?f7 -0");
|
||||
add(L"f11", L"logheight/2");
|
||||
add(L"f12", L"?f11 +0-?f6 ");
|
||||
add(L"f13", L"?f11 +?f6 -0");
|
||||
add(L"f14", L"?f12 +0-?f5 ");
|
||||
add(L"f15", L"?f13 +?f5 -0");
|
||||
add(L"f16", L"?f1 +0-5400000");
|
||||
add(L"f17", L"logheight/2");
|
||||
add(L"f18", L"?f17 *tan(pi*(?f16 )/10800000)");
|
||||
add(L"f19", L"sqrt(?f18 *?f18 +?f17 *?f17 +0*0)");
|
||||
add(L"f20", L"?f19 *?f5 /?f17 ");
|
||||
add(L"f21", L"?f20 *1/2");
|
||||
add(L"f22", L"?f8 +?f18 -?f21 ");
|
||||
add(L"f23", L"?f18 *?f14 /?f17 ");
|
||||
add(L"f24", L"?f22 +0-?f23 ");
|
||||
add(L"f25", L"?f18 *?f12 /?f17 ");
|
||||
add(L"f26", L"?f22 +0-?f25 ");
|
||||
add(L"f27", L"?f18 *?f13 /?f17 ");
|
||||
add(L"f28", L"?f22 +0-?f27 ");
|
||||
add(L"f29", L"?f18 *?f15 /?f17 ");
|
||||
add(L"f30", L"?f22 +0-?f29 ");
|
||||
add(L"f31", L"?f18 *2/1");
|
||||
add(L"f32", L"?f22 +0-?f31 ");
|
||||
add(L"f33", L"?f22 +?f20 -0");
|
||||
add(L"f34", L"?f24 +?f20 -0");
|
||||
add(L"f35", L"?f26 +?f20 -0");
|
||||
add(L"f36", L"?f28 +?f20 -0");
|
||||
add(L"f37", L"?f30 +?f20 -0");
|
||||
add(L"f38", L"?f32 +?f20 -0");
|
||||
add(L"f39", L"?f5 *?f17 /?f19 ");
|
||||
add(L"f40", L"?f22 +?f39 -0");
|
||||
add(L"f41", L"?f33 +0-?f39 ");
|
||||
add(L"f42", L"if(?f16 ,?f40 ,?f33 )");
|
||||
add(L"f43", L"if(?f16 ,?f22 ,?f41 )");
|
||||
add(L"f44", L"?f5 *?f18 /?f19 ");
|
||||
add(L"f45", L"0+0-?f44 ");
|
||||
add(L"f46", L"if(?f16 ,?f44 ,0)");
|
||||
add(L"f47", L"if(?f16 ,0,?f45 )");
|
||||
add(L"f48", L"logwidth+0-?f42 ");
|
||||
add(L"f49", L"logwidth+0-?f43 ");
|
||||
add(L"f50", L"logheight+0-?f46 ");
|
||||
add(L"f51", L"logheight+0-?f47 ");
|
||||
add(L"f52", L"(?f42 +?f43 )/2");
|
||||
add(L"f53", L"(?f49 +?f48 )/2");
|
||||
add(L"f54", L"(?f46 +?f47 )/2");
|
||||
add(L"f55", L"(?f14 +?f12 )/2");
|
||||
add(L"f56", L"(?f13 +?f15 )/2");
|
||||
add(L"f57", L"(?f51 +?f50 )/2");
|
||||
add(L"f58", L"logwidth");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h, h1;
|
||||
h.position = L"0 ?f14";
|
||||
h.y_maximum= L"50000";
|
||||
h.y_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
|
||||
h1.position = L"?f43 0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h.position = L"?f58 ?f12";
|
||||
h.y_maximum= L"?f3";
|
||||
h.y_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
class oox_shape_mathPlus : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_mathPlus()
|
||||
{
|
||||
odf_type_name =L"ooxml-mathPlus";
|
||||
|
||||
enhanced_path = L"?f6 ?f12 L ?f7 ?f12 ?f7 ?f11 ?f8 ?f11 ?f8 ?f12 ?f9 ?f12 ?f9 ?f13 ?f8 ?f13 ?f8 ?f14 ?f7 ?f14 ?f7 ?f13 ?f6 ?f13 Z N";
|
||||
text_areas = L"?f6 ?f12 ?f9 ?f13";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"23520";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(73490-$0 ,$0 ,73490))");
|
||||
add(L"f1", L"logwidth*73490/200000");
|
||||
add(L"f2", L"logheight*73490/200000");
|
||||
add(L"f3", L"min(logwidth,logheight)");
|
||||
add(L"f4", L"?f3 *?f0 /200000");
|
||||
add(L"f5", L"logwidth/2");
|
||||
add(L"f6", L"?f5 +0-?f1 ");
|
||||
add(L"f7", L"?f5 +0-?f4 ");
|
||||
add(L"f8", L"?f5 +?f4 -0");
|
||||
add(L"f9", L"?f5 +?f1 -0");
|
||||
add(L"f10", L"logheight/2");
|
||||
add(L"f11", L"?f10 +0-?f2 ");
|
||||
add(L"f12", L"?f10 +0-?f4 ");
|
||||
add(L"f13", L"?f10 +?f4 -0");
|
||||
add(L"f14", L"?f10 +?f2 -0");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
h.position = L"0 ?f12";
|
||||
h.y_maximum= L"73490";
|
||||
h.y_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_mathMinus : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_mathMinus()
|
||||
{
|
||||
odf_type_name =L"ooxml-mathMinus";
|
||||
|
||||
enhanced_path = L"M ?f7 ?f4 L ?f8 ?f4 ?f8 ?f5 ?f7 ?f5 Z N";
|
||||
text_areas = L"?f7 ?f4 ?f8 ?f5";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"23520";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f1", L"logheight*?f0 /200000");
|
||||
add(L"f2", L"logwidth*73490/200000");
|
||||
add(L"f3", L"logheight/2");
|
||||
add(L"f4", L"?f3 +0-?f1 ");
|
||||
add(L"f5", L"?f3 +?f1 -0");
|
||||
add(L"f6", L"logwidth/2");
|
||||
add(L"f7", L"?f6 +0-?f2 ");
|
||||
add(L"f8", L"?f6 +?f2 -0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
h.position = L"0 ?f4";
|
||||
h.y_maximum= L"100000";
|
||||
h.y_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -29,12 +29,15 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
// shapetypeArc,
|
||||
// shapetypeChord,
|
||||
// shapetypeCorner,
|
||||
//+ shapetypeArc,
|
||||
//+ shapetypeBevel,
|
||||
//+ shapetypeChevron,
|
||||
//+ shapetypeChord,
|
||||
//+ shapetypeCorner,
|
||||
// shapetypeCornerTabs,
|
||||
// shapetypeDecagon,
|
||||
// shapetypeDiagStripe,
|
||||
//+ shapetypeDiamond
|
||||
// shapetypeDodecagon,
|
||||
//+ shapetypeDoubleWave,
|
||||
//+ shapetypeFunnel,
|
||||
@ -42,13 +45,19 @@
|
||||
//+ shapetypeGear9,
|
||||
// shapetypeHalfFrame,
|
||||
// shapetypeHeptagon,
|
||||
//+ shapetypeHomePlate,
|
||||
// shapetypeNonIsoscelesTrapezoid,
|
||||
// shapetypePie,
|
||||
//+ shapetypeParallelogram
|
||||
//+ shapetypePie,
|
||||
//+ shapetypePieWedge,
|
||||
//+ shapetypePlaque,
|
||||
// shapetypePlaqueTabs,
|
||||
// shapetypeSquareTabs,
|
||||
// shapetypeTeardrop,
|
||||
// shapetypeTeardrop
|
||||
//+ shapetypeTriangle
|
||||
//+ shapetypeTrapezoid
|
||||
//+ shapetypeBlockArc
|
||||
//+ shapetypeDonut
|
||||
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
@ -764,7 +773,7 @@ class oox_shape_PieWedge : public oox_shape
|
||||
public:
|
||||
oox_shape_PieWedge()
|
||||
{
|
||||
odf_type_name =L"ooxml-PieWedge";
|
||||
odf_type_name =L"ooxml-pieWedge";
|
||||
|
||||
enhanced_path = L"M 0 ?f7 G ?f8 ?f9 ?f10 ?f11 L ?f4 ?f7 Z N";
|
||||
text_areas = L"?f2 ?f3 ?f4 ?f7";
|
||||
@ -785,4 +794,692 @@ public:
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
}
|
||||
class oox_shape_Pie : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Pie()
|
||||
{
|
||||
odf_type_name =L"ooxml-pie";
|
||||
|
||||
enhanced_path = L"M ?f12 ?f14 G ?f5 ?f7 ?f29 ?f30 L ?f11 ?f13 Z N";
|
||||
text_areas = L"?f23 ?f24 ?f25 ?f26";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"9000000 16200000";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(21599999-$0 ,$0 ,21599999))");
|
||||
add(L"f1", L"if(0-$1 ,0,if(21599999-$1 ,$1 ,21599999))");
|
||||
add(L"f2", L"?f1 +0-?f0 ");
|
||||
add(L"f3", L"?f2 +21600000-0");
|
||||
add(L"f4", L"if(?f2 ,?f2 ,?f3 )");
|
||||
add(L"f5", L"logwidth/2");
|
||||
add(L"f6", L"?f5 *sin(pi*(?f0 )/10800000)");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 *cos(pi*(?f0 )/10800000)");
|
||||
add(L"f9", L"?f5 *(cos(atan2(?f6 ,?f8 )))");
|
||||
add(L"f10", L"?f7 *(sin(atan2(?f6 ,?f8 )))");
|
||||
add(L"f11", L"logwidth/2");
|
||||
add(L"f12", L"?f11 +?f9 -0");
|
||||
add(L"f13", L"logheight/2");
|
||||
add(L"f14", L"?f13 +?f10 -0");
|
||||
add(L"f15", L"?f5 *sin(pi*(?f1 )/10800000)");
|
||||
add(L"f16", L"?f7 *cos(pi*(?f1 )/10800000)");
|
||||
add(L"f17", L"?f5 *(cos(atan2(?f15 ,?f16 )))");
|
||||
add(L"f18", L"?f7 *(sin(atan2(?f15 ,?f16 )))");
|
||||
add(L"f19", L"?f11 +?f17 -0");
|
||||
add(L"f20", L"?f13 +?f18 -0");
|
||||
add(L"f21", L"?f5 *cos(pi*(2700000)/10800000)");
|
||||
add(L"f22", L"?f7 *sin(pi*(2700000)/10800000)");
|
||||
add(L"f23", L"?f11 +0-?f21 ");
|
||||
add(L"f24", L"?f11 +?f21 -0");
|
||||
add(L"f25", L"?f13 +0-?f22 ");
|
||||
add(L"f26", L"?f13 +?f22 -0");
|
||||
add(L"f27", L"logwidth");
|
||||
add(L"f28", L"logheight");
|
||||
add(L"f29", L"(?f0 )/60000.0");
|
||||
add(L"f30", L"(?f4 )/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f12 ?f14";
|
||||
handles.push_back(h);
|
||||
|
||||
h.position = L"?f19 ?f20";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
class oox_shape_BlockArc : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_BlockArc()
|
||||
{
|
||||
odf_type_name =L"ooxml-blockArc";
|
||||
|
||||
enhanced_path = L"M ?f18 ?f20 G ?f7 ?f9 ?f76 ?f77 L ?f35 ?f36 G ?f25 ?f26 ?f78 ?f79 Z N";
|
||||
text_areas = L"f60 ?f68 ?f44 ?f52";
|
||||
modifiers = L"13500000 10800000 12740";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(21599999-$0 ,$0 ,21599999))");
|
||||
add(L"f1", L"if(0-$1 ,0,if(21599999-$1 ,$1 ,21599999))");
|
||||
add(L"f2", L"if(0-$2 ,0,if(50000-$2 ,$2 ,50000))");
|
||||
add(L"f3", L"?f1 +0-?f0 ");
|
||||
add(L"f4", L"?f3 +21600000-0");
|
||||
add(L"f5", L"if(?f3 ,?f3 ,?f4 )");
|
||||
add(L"f6", L"0+0-?f5 ");
|
||||
add(L"f7", L"logwidth/2");
|
||||
add(L"f8", L"?f7 *sin(pi*(?f0 )/10800000)");
|
||||
add(L"f9", L"logheight/2");
|
||||
add(L"f10", L"?f9 *cos(pi*(?f0 )/10800000)");
|
||||
add(L"f11", L"?f7 *sin(pi*(?f1 )/10800000)");
|
||||
add(L"f12", L"?f9 *cos(pi*(?f1 )/10800000)");
|
||||
add(L"f13", L"?f7 *(cos(atan2(?f8 ,?f10 )))");
|
||||
add(L"f14", L"?f9 *(sin(atan2(?f8 ,?f10 )))");
|
||||
add(L"f15", L"?f7 *(cos(atan2(?f11 ,?f12 )))");
|
||||
add(L"f16", L"?f9 *(sin(atan2(?f11 ,?f12 )))");
|
||||
add(L"f17", L"logwidth/2");
|
||||
add(L"f18", L"?f17 +?f13 -0");
|
||||
add(L"f19", L"logheight/2");
|
||||
add(L"f20", L"?f19 +?f14 -0");
|
||||
add(L"f21", L"?f17 +?f15 -0");
|
||||
add(L"f22", L"?f19 +?f16 -0");
|
||||
add(L"f23", L"min(logwidth,logheight)");
|
||||
add(L"f24", L"?f23 *?f2 /100000");
|
||||
add(L"f25", L"?f7 +0-?f24 ");
|
||||
add(L"f26", L"?f9 +0-?f24 ");
|
||||
add(L"f27", L"?f25 *sin(pi*(?f1 )/10800000)");
|
||||
add(L"f28", L"?f26 *cos(pi*(?f1 )/10800000)");
|
||||
add(L"f29", L"?f25 *sin(pi*(?f0 )/10800000)");
|
||||
add(L"f30", L"?f26 *cos(pi*(?f0 )/10800000)");
|
||||
add(L"f31", L"?f25 *(cos(atan2(?f27 ,?f28 )))");
|
||||
add(L"f32", L"?f26 *(sin(atan2(?f27 ,?f28 )))");
|
||||
add(L"f33", L"?f25 *(cos(atan2(?f29 ,?f30 )))");
|
||||
add(L"f34", L"?f26 *(sin(atan2(?f29 ,?f30 )))");
|
||||
add(L"f35", L"?f17 +?f31 -0");
|
||||
add(L"f36", L"?f19 +?f32 -0");
|
||||
add(L"f37", L"?f17 +?f33 -0");
|
||||
add(L"f38", L"?f19 +?f34 -0");
|
||||
add(L"f39", L"21600000+0-?f0 ");
|
||||
add(L"f40", L"?f5 +0-?f39 ");
|
||||
add(L"f41", L"max(?f18 ,?f35 )");
|
||||
add(L"f42", L"max(?f21 ,?f37 )");
|
||||
add(L"f43", L"max(?f41 ,?f42 )");
|
||||
add(L"f44", L"if(?f40 ,logwidth,?f43 )");
|
||||
add(L"f45", L"5400000+0-?f0 ");
|
||||
add(L"f46", L"27000000+0-?f0 ");
|
||||
add(L"f47", L"if(?f45 ,?f45 ,?f46 )");
|
||||
add(L"f48", L"?f5 +0-?f47 ");
|
||||
add(L"f49", L"max(?f20 ,?f36 )");
|
||||
add(L"f50", L"max(?f22 ,?f38 )");
|
||||
add(L"f51", L"max(?f49 ,?f50 )");
|
||||
add(L"f52", L"if(?f48 ,logheight,?f51 )");
|
||||
add(L"f53", L"10800000+0-?f0 ");
|
||||
add(L"f54", L"32400000+0-?f0 ");
|
||||
add(L"f55", L"if(?f53 ,?f53 ,?f54 )");
|
||||
add(L"f56", L"?f5 +0-?f55 ");
|
||||
add(L"f57", L"min(?f18 ,?f35 )");
|
||||
add(L"f58", L"min(?f21 ,?f37 )");
|
||||
add(L"f59", L"min(?f57 ,?f58 )");
|
||||
add(L"f60", L"if(?f56 ,0,?f59 )");
|
||||
add(L"f61", L"16200000+0-?f0 ");
|
||||
add(L"f62", L"37800000+0-?f0 ");
|
||||
add(L"f63", L"if(?f61 ,?f61 ,?f62 )");
|
||||
add(L"f64", L"?f5 +0-?f63 ");
|
||||
add(L"f65", L"min(?f20 ,?f36 )");
|
||||
add(L"f66", L"min(?f22 ,?f38 )");
|
||||
add(L"f67", L"min(?f65 ,?f66 )");
|
||||
add(L"f68", L"if(?f64 ,0,?f67 )");
|
||||
add(L"f69", L"(?f18 +?f37 )/2");
|
||||
add(L"f70", L"(?f20 +?f38 )/2");
|
||||
add(L"f71", L"(?f21 +?f35 )/2");
|
||||
add(L"f72", L"(?f22 +?f36 )/2");
|
||||
add(L"f73", L"?f0 +0-5400000");
|
||||
add(L"f74", L"?f1 +5400000-0");
|
||||
add(L"f75", L"(?f73 +?f74 )/2");
|
||||
add(L"f76", L"(?f0 )/60000.0");
|
||||
add(L"f77", L"(?f5 )/60000.0");
|
||||
add(L"f78", L"(?f1 )/60000.0");
|
||||
add(L"f79", L"(?f6 )/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f18 ?f20";
|
||||
handles.push_back(h);
|
||||
|
||||
h.position = L"?f35 ?f36";
|
||||
h.r_minimum = L"0";
|
||||
h.r_maximum = L"50000";
|
||||
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
class oox_shape_Corner : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Corner()
|
||||
{
|
||||
odf_type_name =L"ooxml-corner";
|
||||
|
||||
enhanced_path = L"M 0 0 L ?f5 0 ?f5 ?f7 ?f13 ?f7 ?f13 ?f15 0 ?f15 Z N";
|
||||
text_areas = L"0 ?f11 ?f12 ?f15";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"16120 16110";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"100000*logheight/?f0 ");
|
||||
add(L"f2", L"100000*logwidth/?f0 ");
|
||||
add(L"f3", L"if(0-$0 ,0,if(?f1 -$0 ,$0 ,?f1 ))");
|
||||
add(L"f4", L"if(0-$1 ,0,if(?f2 -$1 ,$1 ,?f2 ))");
|
||||
add(L"f5", L"?f0 *?f4 /100000");
|
||||
add(L"f6", L"?f0 *?f3 /100000");
|
||||
add(L"f7", L"logheight+0-?f6 ");
|
||||
add(L"f8", L"?f5 *1/2");
|
||||
add(L"f9", L"(?f7 +logheight)/2");
|
||||
add(L"f10", L"logwidth+0-logheight");
|
||||
add(L"f11", L"if(?f10 ,?f7 ,0)");
|
||||
add(L"f12", L"if(?f10 ,logwidth,?f5 )");
|
||||
add(L"f13", L"logwidth");
|
||||
add(L"f14", L"logwidth/2");
|
||||
add(L"f15", L"logheight");
|
||||
add(L"f16", L"logheight/2");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"0 ?f7";
|
||||
h1.y_minimum = L"0";
|
||||
h1.y_maximum = L"?f1";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f5 0";
|
||||
h2.x_minimum = L"0";
|
||||
h2.x_maximum = L"?f2";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class oox_shape_Chord : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Chord()
|
||||
{
|
||||
odf_type_name =L"ooxml-chord";
|
||||
|
||||
enhanced_path = L"M ?f16 ?f18 G ?f5 ?f7 ?f31 ?f32 Z N";
|
||||
text_areas = L"?f27 ?f29 ?f28 ?f30";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"1168272 9631728";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(21599999-$0 ,$0 ,21599999))");
|
||||
add(L"f1", L"if(0-$1 ,0,if(21599999-$1 ,$1 ,21599999))");
|
||||
add(L"f2", L"?f1 +0-?f0 ");
|
||||
add(L"f3", L"?f2 +21600000-0");
|
||||
add(L"f4", L"if(?f2 ,?f2 ,?f3 )");
|
||||
add(L"f5", L"logwidth/2");
|
||||
add(L"f6", L"?f5 *sin(pi*(?f0 )/10800000)");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 *cos(pi*(?f0 )/10800000)");
|
||||
add(L"f9", L"?f5 *(cos(atan2(?f6 ,?f8 )))");
|
||||
add(L"f10", L"?f7 *(sin(atan2(?f6 ,?f8 )))");
|
||||
add(L"f11", L"?f5 *sin(pi*(?f1 )/10800000)");
|
||||
add(L"f12", L"?f7 *cos(pi*(?f1 )/10800000)");
|
||||
add(L"f13", L"?f5 *(cos(atan2(?f11 ,?f12 )))");
|
||||
add(L"f14", L"?f7 *(sin(atan2(?f11 ,?f12 )))");
|
||||
add(L"f15", L"logwidth/2");
|
||||
add(L"f16", L"?f15 +?f9 -0");
|
||||
add(L"f17", L"logheight/2");
|
||||
add(L"f18", L"?f17 +?f10 -0");
|
||||
add(L"f19", L"?f15 +?f13 -0");
|
||||
add(L"f20", L"?f17 +?f14 -0");
|
||||
add(L"f21", L"(?f16 +?f19 )/2");
|
||||
add(L"f22", L"(?f18 +?f20 )/2");
|
||||
add(L"f23", L"?f4 *1/2");
|
||||
add(L"f24", L"?f0 +?f23 -10800000");
|
||||
add(L"f25", L"?f5 *cos(pi*(2700000)/10800000)");
|
||||
add(L"f26", L"?f7 *sin(pi*(2700000)/10800000)");
|
||||
add(L"f27", L"?f15 +0-?f25 ");
|
||||
add(L"f28", L"?f15 +?f25 -0");
|
||||
add(L"f29", L"?f17 +0-?f26 ");
|
||||
add(L"f30", L"?f17 +?f26 -0");
|
||||
add(L"f31", L"(?f0 )/60000.0");
|
||||
add(L"f32", L"(?f4 )/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f16 ?f18";
|
||||
handles.push_back(h);
|
||||
|
||||
h.position = L"?f19 ?f20";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class oox_shape_Donut : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Donut()
|
||||
{
|
||||
odf_type_name =L"ooxml-donut";
|
||||
|
||||
enhanced_path = L"M 0 ?f12 G ?f3 ?f5 ?f17 ?f18 ?f3 ?f5 ?f19 ?f20 ?f3 ?f5 ?f21 ?f22 ?f3 ?f5 ?f23 ?f24 Z M ?f2 ?f12 G ?f4 ?f6 ?f25 ?f26 ?f4 ?f6 ?f27 ?f28 ?f4 ?f6 ?f29 ?f30 ?f4 ?f6 ?f31 ?f32 Z N";
|
||||
text_areas = L"?f10 ?f13 ?f11 ?f14";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"20000";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
|
||||
add(L"f1", L"min(logwidth,logheight)");
|
||||
add(L"f2", L"?f1 *?f0 /100000");
|
||||
add(L"f3", L"logwidth/2");
|
||||
add(L"f4", L"?f3 +0-?f2 ");
|
||||
add(L"f5", L"logheight/2");
|
||||
add(L"f6", L"?f5 +0-?f2 ");
|
||||
add(L"f7", L"?f3 *cos(pi*(2700000)/10800000)");
|
||||
add(L"f8", L"?f5 *sin(pi*(2700000)/10800000)");
|
||||
add(L"f9", L"logwidth/2");
|
||||
add(L"f10", L"?f9 +0-?f7 ");
|
||||
add(L"f11", L"?f9 +?f7 -0");
|
||||
add(L"f12", L"logheight/2");
|
||||
add(L"f13", L"?f12 +0-?f8 ");
|
||||
add(L"f14", L"?f12 +?f8 -0");
|
||||
add(L"f15", L"logheight");
|
||||
add(L"f16", L"logwidth");
|
||||
add(L"f17", L"(10800000)/60000.0");
|
||||
add(L"f18", L"(5400000)/60000.0");
|
||||
add(L"f19", L"(16200000)/60000.0");
|
||||
add(L"f20", L"(5400000)/60000.0");
|
||||
add(L"f21", L"(0)/60000.0");
|
||||
add(L"f22", L"(5400000)/60000.0");
|
||||
add(L"f23", L"(5400000)/60000.0");
|
||||
add(L"f24", L"(5400000)/60000.0");
|
||||
add(L"f25", L"(10800000)/60000.0");
|
||||
add(L"f26", L"(-5400000)/60000.0");
|
||||
add(L"f27", L"(5400000)/60000.0");
|
||||
add(L"f28", L"(-5400000)/60000.0");
|
||||
add(L"f29", L"(0)/60000.0");
|
||||
add(L"f30", L"(-5400000)/60000.0");
|
||||
add(L"f31", L"(16200000)/60000.0");
|
||||
add(L"f32", L"(-5400000)/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f2 ?f12";
|
||||
h.r_minimum = L"0";
|
||||
h.r_maximum = L"50000";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class oox_shape_Chevron : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Chevron()
|
||||
{
|
||||
odf_type_name =L"ooxml-chevron";
|
||||
|
||||
enhanced_path = L"M 0 0 L ?f4 0 ?f11 ?f9 ?f4 ?f10 0 ?f10 ?f3 ?f9 Z N";
|
||||
text_areas = L"?f7 0 ?f8 ?f10";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"50000";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"100000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$0 ,0,if(?f1 -$0 ,$0 ,?f1 ))");
|
||||
add(L"f3", L"?f0 *?f2 /100000");
|
||||
add(L"f4", L"logwidth+0-?f3 ");
|
||||
add(L"f5", L"?f4 *1/2");
|
||||
add(L"f6", L"?f4 +0-?f3 ");
|
||||
add(L"f7", L"if(?f6 ,?f3 ,0)");
|
||||
add(L"f8", L"if(?f6 ,?f4 ,logwidth)");
|
||||
add(L"f9", L"logheight/2");
|
||||
add(L"f10", L"logheight");
|
||||
add(L"f11", L"logwidth");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f4 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"?f1";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
class oox_shape_Arc : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Arc()
|
||||
{
|
||||
odf_type_name =L"ooxml-arc";
|
||||
|
||||
enhanced_path = L"M ?f16 ?f18 G ?f5 ?f7 ?f46 ?f47 L ?f15 ?f17 Z S N M ?f16 ?f18 G ?f5 ?f7 ?f48 ?f49 F N";
|
||||
text_areas = L"?f36 ?f42 ?f24 ?f30";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"16200000 0";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(21599999-$0 ,$0 ,21599999))");
|
||||
add(L"f1", L"if(0-$1 ,0,if(21599999-$1 ,$1 ,21599999))");
|
||||
add(L"f2", L"?f1 +0-?f0 ");
|
||||
add(L"f3", L"?f2 +21600000-0");
|
||||
add(L"f4", L"if(?f2 ,?f2 ,?f3 )");
|
||||
add(L"f5", L"logwidth/2");
|
||||
add(L"f6", L"?f5 *sin(pi*(?f0 )/10800000)");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"?f7 *cos(pi*(?f0 )/10800000)");
|
||||
add(L"f9", L"?f5 *(cos(atan2(?f6 ,?f8 )))");
|
||||
add(L"f10", L"?f7 *(sin(atan2(?f6 ,?f8 )))");
|
||||
add(L"f11", L"?f5 *sin(pi*(?f1 )/10800000)");
|
||||
add(L"f12", L"?f7 *cos(pi*(?f1 )/10800000)");
|
||||
add(L"f13", L"?f5 *(cos(atan2(?f11 ,?f12 )))");
|
||||
add(L"f14", L"?f7 *(sin(atan2(?f11 ,?f12 )))");
|
||||
add(L"f15", L"logwidth/2");
|
||||
add(L"f16", L"?f15 +?f9 -0");
|
||||
add(L"f17", L"logheight/2");
|
||||
add(L"f18", L"?f17 +?f10 -0");
|
||||
add(L"f19", L"?f15 +?f13 -0");
|
||||
add(L"f20", L"?f17 +?f14 -0");
|
||||
add(L"f21", L"21600000+0-?f0 ");
|
||||
add(L"f22", L"?f4 +0-?f21 ");
|
||||
add(L"f23", L"max(?f16 ,?f19 )");
|
||||
add(L"f24", L"if(?f22 ,logwidth,?f23 )");
|
||||
add(L"f25", L"5400000+0-?f0 ");
|
||||
add(L"f26", L"27000000+0-?f0 ");
|
||||
add(L"f27", L"if(?f25 ,?f25 ,?f26 )");
|
||||
add(L"f28", L"?f4 +0-?f27 ");
|
||||
add(L"f29", L"max(?f18 ,?f20 )");
|
||||
add(L"f30", L"if(?f28 ,logheight,?f29 )");
|
||||
add(L"f31", L"10800000+0-?f0 ");
|
||||
add(L"f32", L"32400000+0-?f0 ");
|
||||
add(L"f33", L"if(?f31 ,?f31 ,?f32 )");
|
||||
add(L"f34", L"?f4 +0-?f33 ");
|
||||
add(L"f35", L"min(?f16 ,?f19 )");
|
||||
add(L"f36", L"if(?f34 ,0,?f35 )");
|
||||
add(L"f37", L"16200000+0-?f0 ");
|
||||
add(L"f38", L"37800000+0-?f0 ");
|
||||
add(L"f39", L"if(?f37 ,?f37 ,?f38 )");
|
||||
add(L"f40", L"?f4 +0-?f39 ");
|
||||
add(L"f41", L"min(?f18 ,?f20 )");
|
||||
add(L"f42", L"if(?f40 ,0,?f41 )");
|
||||
add(L"f43", L"?f0 +0-5400000");
|
||||
add(L"f44", L"?f1 +5400000-0");
|
||||
add(L"f45", L"(?f43 +?f44 )/2");
|
||||
add(L"f46", L"(?f0 )/60000.0");
|
||||
add(L"f47", L"(?f4 )/60000.0");
|
||||
add(L"f48", L"(?f0 )/60000.0");
|
||||
add(L"f49", L"(?f4 )/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f16 ?f18";
|
||||
handles.push_back(h);
|
||||
|
||||
h.position = L"?f19 ?f20";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class oox_shape_HomePlate : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_HomePlate()
|
||||
{
|
||||
odf_type_name =L"ooxml-homePlate";
|
||||
|
||||
enhanced_path = L"M 0 0 L ?f4 0 ?f9 ?f7 ?f4 ?f8 0 ?f8 Z N";
|
||||
text_areas = L"0 0 ?f5 ?f8";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"50000";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"100000*logwidth/?f0 ");
|
||||
add(L"f2", L"if(0-$0 ,0,if(?f1 -$0 ,$0 ,?f1 ))");
|
||||
add(L"f3", L"?f0 *?f2 /100000");
|
||||
add(L"f4", L"logwidth+0-?f3 ");
|
||||
add(L"f5", L"(?f4 +logwidth)/2");
|
||||
add(L"f6", L"?f4 *1/2");
|
||||
add(L"f7", L"logheight/2");
|
||||
add(L"f8", L"logheight");
|
||||
add(L"f9", L"logwidth");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f4 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"?f1";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_Bevel : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Bevel()
|
||||
{
|
||||
odf_type_name =L"ooxml-bevel";
|
||||
|
||||
enhanced_path = L"M ?f2 ?f2 L ?f3 ?f2 ?f3 ?f4 ?f2 ?f4 Z S N M 0 0 L ?f5 0 ?f3 ?f2 ?f2 ?f2 Z K S N M 0 ?f8 L ?f2 ?f4 ?f3 ?f4 ?f5 ?f8 Z I S N M 0 0 L ?f2 ?f2 ?f2 ?f4 0 ?f8 Z J S N M ?f5 0 L ?f5 ?f8 ?f3 ?f4 ?f3 ?f2 Z H S N M 0 0 L ?f5 0 ?f5 ?f8 0 ?f8 Z M ?f2 ?f2 L ?f3 ?f2 ?f3 ?f4 ?f2 ?f4 Z M 0 0 L ?f2 ?f2 M 0 ?f8 L ?f2 ?f4 M ?f5 0 L ?f3 ?f2 M ?f5 ?f8 L ?f3 ?f4 F N";
|
||||
text_areas = L"?f2 ?f2 ?f3 ?f4";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"12500";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
|
||||
add(L"f1", L"min(logwidth,logheight)");
|
||||
add(L"f2", L"?f1 *?f0 /100000");
|
||||
add(L"f3", L"logwidth+0-?f2 ");
|
||||
add(L"f4", L"logheight+0-?f2 ");
|
||||
add(L"f5", L"logwidth");
|
||||
add(L"f6", L"logheight/2");
|
||||
add(L"f7", L"logwidth/2");
|
||||
add(L"f8", L"logheight");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f2 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"50000";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class oox_shape_Trapezoid : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Trapezoid()
|
||||
{
|
||||
odf_type_name =L"ooxml-trapezoid";
|
||||
|
||||
enhanced_path = L"M 0 ?f14 L ?f4 0 ?f5 0 ?f15 ?f14 Z N";
|
||||
text_areas = L"?f8 ?f10 ?f11 ?f14";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"50000*logwidth/?f0");
|
||||
add(L"f2", L"if(0-$0 ,0,if(?f1 -$0 ,$0 ,?f1 ))");
|
||||
add(L"f3", L"?f0 *?f2 /200000");
|
||||
add(L"f4", L"?f0 *?f2 /100000");
|
||||
add(L"f5", L"logwidth+0-?f4");
|
||||
add(L"f6", L"logwidth+0-?f3");
|
||||
add(L"f7", L"logwidth/3");
|
||||
add(L"f8", L"?f7 *?f2 /?f1");
|
||||
add(L"f9", L"logheight/3");
|
||||
add(L"f10", L"?f9 *?f2 /?f1");
|
||||
add(L"f11", L"logwidth+0-?f8");
|
||||
add(L"f12", L"logwidth/2");
|
||||
add(L"f13", L"logheight/2");
|
||||
add(L"f14", L"logheight");
|
||||
add(L"f15", L"logwidth");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f4 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"?f1";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class oox_shape_Triangle : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Triangle()
|
||||
{
|
||||
odf_type_name =L"ooxml-triangle";
|
||||
|
||||
enhanced_path = L"M 0 ?f6 L ?f2 0 ?f7 ?f6 Z N";
|
||||
text_areas = L"?f1 ?f5 ?f4 ?f6";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"50000";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(100000-$0 ,$0 ,100000))");
|
||||
add(L"f1", L"logwidth*?f0 /200000");
|
||||
add(L"f2", L"logwidth*?f0 /100000");
|
||||
add(L"f3", L"logwidth/2");
|
||||
add(L"f4", L"?f1 +?f3 -0");
|
||||
add(L"f5", L"logheight/2");
|
||||
add(L"f6", L"logheight");
|
||||
add(L"f7", L"logwidth");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f2 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"100000";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_Diamond : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Diamond()
|
||||
{
|
||||
odf_type_name =L"ooxml-diamond";
|
||||
|
||||
enhanced_path = L"M 0 ?f3 L ?f2 0 ?f5 ?f3 ?f2 ?f4 Z N";
|
||||
text_areas = L"?f6 ?f7 ?f0 ?f1";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"logwidth*3/4");
|
||||
add(L"f1", L"logheight*3/4");
|
||||
add(L"f2", L"logwidth/2");
|
||||
add(L"f3", L"logheight/2");
|
||||
add(L"f4", L"logheight");
|
||||
add(L"f5", L"logwidth");
|
||||
add(L"f6", L"logwidth/4");
|
||||
add(L"f7", L"logheight/4");
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_Parallelogram : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Parallelogram()
|
||||
{
|
||||
odf_type_name =L"ooxml-parallelogram";
|
||||
|
||||
enhanced_path = L"M 0 ?f22 L ?f4 0 ?f23 0 ?f6 ?f22 Z N";
|
||||
text_areas = L"?f13 ?f14 ?f15 ?f16";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000";
|
||||
|
||||
add(L"f0", L"min(logwidth,logheight)");
|
||||
add(L"f1", L"100000*logwidth/?f0");
|
||||
add(L"f2", L"if(0-$0 ,0,if(?f1 -$0 ,$0 ,?f1 ))");
|
||||
add(L"f3", L"?f0 *?f2 /200000");
|
||||
add(L"f4", L"?f0 *?f2 /100000");
|
||||
add(L"f5", L"logwidth+0-?f3");
|
||||
add(L"f6", L"logwidth+0-?f4");
|
||||
add(L"f7", L"?f6 *1/2");
|
||||
add(L"f8", L"logwidth+0-?f7");
|
||||
add(L"f9", L"logwidth/2");
|
||||
add(L"f10", L"?f9 *?f2 /?f1");
|
||||
add(L"f11", L"5*?f2 /?f1 ");
|
||||
add(L"f12", L"(1+?f11 )/12");
|
||||
add(L"f13", L"?f12 *logwidth/1");
|
||||
add(L"f14", L"?f12 *logheight/1");
|
||||
add(L"f15", L"logwidth+0-?f13");
|
||||
add(L"f16", L"logheight+0-?f14");
|
||||
add(L"f17", L"logwidth/2");
|
||||
add(L"f18", L"logheight*?f17 /?f4");
|
||||
add(L"f19", L"if(0-?f18 ,0,if(logheight-?f18 ,?f18 ,logheight))");
|
||||
add(L"f20", L"logheight+0-?f19");
|
||||
add(L"f21", L"logheight/2");
|
||||
add(L"f22", L"logheight");
|
||||
add(L"f23", L"logwidth");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f4 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"?f1";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_RtTriangle : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_RtTriangle()
|
||||
{
|
||||
odf_type_name =L"ooxml-rtTriangle";
|
||||
|
||||
enhanced_path = L"M 0 ?f4 L 0 0 ?f6 ?f4 Z N";
|
||||
text_areas = L"?f7 ?f0 ?f1 ?f2";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"logheight*7/12");
|
||||
add(L"f1", L"logwidth*7/12");
|
||||
add(L"f2", L"logheight*11/12");
|
||||
add(L"f3", L"logheight/2");
|
||||
add(L"f4", L"logheight");
|
||||
add(L"f5", L"logwidth/2");
|
||||
add(L"f6", L"logwidth");
|
||||
add(L"f7", L"logwidth/12");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class oox_shape_Plus : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Plus()
|
||||
{
|
||||
odf_type_name =L"ooxml-plus";
|
||||
|
||||
enhanced_path = L"M 0 ?f2 L ?f2 ?f2 ?f2 0 ?f3 0 ?f3 ?f2 ?f13 ?f2 ?f13 ?f4 ?f3 ?f4 ?f3 ?f12 ?f2 ?f12 ?f2 ?f4 0 ?f4 Z N";
|
||||
text_areas = L"?f6 ?f8 ?f7 ?f9";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"25000";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
|
||||
add(L"f1", L"min(logwidth,logheight)");
|
||||
add(L"f2", L"?f1 *?f0 /100000");
|
||||
add(L"f3", L"logwidth+0-?f2 ");
|
||||
add(L"f4", L"logheight+0-?f2 ");
|
||||
add(L"f5", L"logwidth+0-logheight");
|
||||
add(L"f6", L"if(?f5 ,0,?f2 )");
|
||||
add(L"f7", L"if(?f5 ,logwidth,?f3 )");
|
||||
add(L"f8", L"if(?f5 ,?f2 ,0)");
|
||||
add(L"f9", L"if(?f5 ,?f4 ,logheight)");
|
||||
add(L"f10", L"logwidth/2");
|
||||
add(L"f11", L"logheight/2");
|
||||
add(L"f12", L"logheight");
|
||||
add(L"f13", L"logwidth");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f2 0";
|
||||
h.x_minimum = L"0";
|
||||
h.x_maximum = L"50000";
|
||||
handles.push_back(h);
|
||||
}
|
||||
};}
|
||||
|
||||
@ -29,4 +29,83 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
//{ L"" , 7}, // shapetypeLeftRightRibbon,
|
||||
//+ shapetypeLeftRightRibbon
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_LeftRightRibbon : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_LeftRightRibbon()
|
||||
{
|
||||
odf_type_name =L"ooxml-leftRightRibbon";
|
||||
|
||||
enhanced_path = L"M 0 ?f16 L ?f9 0 ?f9 ?f14 ?f23 ?f14 G ?f4 ?f22 ?f30 ?f31 ?f4 ?f22 ?f32 ?f33 L ?f10 ?f21 ?f10 ?f19 ?f28 ?f17 ?f10 ?f29 ?f10 ?f15 ?f23 ?f15 G ?f4 ?f22 ?f34 ?f35 L ?f24 ?f20 ?f9 ?f20 ?f9 ?f18 Z S N M ?f25 ?f26 G ?f4 ?f22 ?f36 ?f37 ?f4 ?f22 ?f38 ?f39 L ?f25 ?f21 Z I S N M 0 ?f16 L ?f9 0 ?f9 ?f14 ?f23 ?f14 G ?f4 ?f22 ?f40 ?f41 ?f4 ?f22 ?f42 ?f43 L ?f10 ?f21 ?f10 ?f19 ?f28 ?f17 ?f10 ?f29 ?f10 ?f15 ?f23 ?f15 G ?f4 ?f22 ?f44 ?f45 L ?f24 ?f20 ?f9 ?f20 ?f9 ?f18 Z M ?f25 ?f26 L ?f25 ?f21 M ?f24 ?f27 L ?f24 ?f20 F N";
|
||||
text_areas = L"?f9 ?f14 ?f10 ?f15";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"50000 50000 16667";
|
||||
|
||||
add(L"f0", L"if(0-$2 ,0,if(33333-$2 ,$2 ,33333))");
|
||||
add(L"f1", L"100000+0-?f0 ");
|
||||
add(L"f2", L"if(0-$0 ,0,if(?f1 -$0 ,$0 ,?f1 ))");
|
||||
add(L"f3", L"logwidth/2");
|
||||
add(L"f4", L"logwidth/32");
|
||||
add(L"f5", L"?f3 +0-?f4 ");
|
||||
add(L"f6", L"min(logwidth,logheight)");
|
||||
add(L"f7", L"100000*?f5 /?f6 ");
|
||||
add(L"f8", L"if(0-$1 ,0,if(?f7 -$1 ,$1 ,?f7 ))");
|
||||
add(L"f9", L"?f6 *?f8 /100000");
|
||||
add(L"f10", L"logwidth+0-?f9 ");
|
||||
add(L"f11", L"logheight*?f2 /200000");
|
||||
add(L"f12", L"logheight*?f0 /-200000");
|
||||
add(L"f13", L"logheight/2");
|
||||
add(L"f14", L"?f13 +?f12 -?f11 ");
|
||||
add(L"f15", L"?f13 +?f11 -?f12 ");
|
||||
add(L"f16", L"?f14 +?f11 -0");
|
||||
add(L"f17", L"logheight+0-?f16 ");
|
||||
add(L"f18", L"?f16 *2/1");
|
||||
add(L"f19", L"logheight+0-?f18 ");
|
||||
add(L"f20", L"?f18 +0-?f14 ");
|
||||
add(L"f21", L"logheight+0-?f20 ");
|
||||
add(L"f22", L"?f0 *?f6 /400000");
|
||||
add(L"f23", L"logwidth/2");
|
||||
add(L"f24", L"?f23 +0-?f4 ");
|
||||
add(L"f25", L"?f23 +?f4 -0");
|
||||
add(L"f26", L"?f14 +?f22 -0");
|
||||
add(L"f27", L"?f21 +0-?f22 ");
|
||||
add(L"f28", L"logwidth");
|
||||
add(L"f29", L"logheight");
|
||||
add(L"f30", L"(16200000)/60000.0");
|
||||
add(L"f31", L"(10800000)/60000.0");
|
||||
add(L"f32", L"(16200000)/60000.0");
|
||||
add(L"f33", L"(-10800000)/60000.0");
|
||||
add(L"f34", L"(5400000)/60000.0");
|
||||
add(L"f35", L"(5400000)/60000.0");
|
||||
add(L"f36", L"(0)/60000.0");
|
||||
add(L"f37", L"(5400000)/60000.0");
|
||||
add(L"f38", L"(16200000)/60000.0");
|
||||
add(L"f39", L"(-10800000)/60000.0");
|
||||
add(L"f40", L"(16200000)/60000.0");
|
||||
add(L"f41", L"(10800000)/60000.0");
|
||||
add(L"f42", L"(16200000)/60000.0");
|
||||
add(L"f43", L"(-10800000)/60000.0");
|
||||
add(L"f44", L"(5400000)/60000.0");
|
||||
add(L"f45", L"(5400000)/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2, h3;
|
||||
h1.position = L"??f10 ?f21";
|
||||
h1.y_maximum= L"?f1";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f9 0";
|
||||
h2.x_maximum= L"?f7";
|
||||
h2.x_minimum= L"0";
|
||||
handles.push_back(h2);
|
||||
|
||||
h3.position = L"?f25 ?f21";
|
||||
h3.y_maximum= L"33333";
|
||||
h3.y_minimum= L"0";
|
||||
handles.push_back(h3);
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -67,30 +67,41 @@ public:
|
||||
odf_type_name =L"ooxml-snip2DiagRect";
|
||||
|
||||
modifiers = L"0 16667";
|
||||
enhanced_path = L"M ?f9 ?f2 L ?f13 ?f2 ?f1 ?f12 ?f1 ?f11 ?f10 ?f3 ?f12 ?f3 ?f0 ?f14 ?f0 ?f9 Z N";
|
||||
text_areas = L"?f17 ?f17 ?f18 ?f19";
|
||||
view_box = L"0 0 21600 21600";
|
||||
enhanced_path = L"M ?f3 0 L ?f7 0 ?f14 ?f6 ?f14 ?f5 ?f4 ?f17 ?f6 ?f17 0 ?f8 0 ?f3 Z N";
|
||||
text_areas = L"?f11 ?f11 ?f12 ?f13";
|
||||
view_box = L"0 0 0 0";
|
||||
|
||||
add(L"f0", L"left");
|
||||
add(L"f1", L"right");
|
||||
add(L"f2", L"top");
|
||||
add(L"f3", L"bottom");
|
||||
add(L"f4", L"?f3 - ?f2");
|
||||
add(L"f5", L"?f1 - ?f0");
|
||||
add(L"f6", L"min(?f5, ?f4)");
|
||||
add(L"f7", L"$0");
|
||||
add(L"f8", L"$1");
|
||||
add(L"f9", L"?f6 * ?f7 / 100000");
|
||||
add(L"f10", L"?f1 - ?f9");
|
||||
add(L"f11", L"?f3 - ?f9");
|
||||
add(L"f12", L"?f6 * ?f8 / 100000");
|
||||
add(L"f13", L"?f1 - ?f12");
|
||||
add(L"f14", L"?f3 - ?f12");
|
||||
add(L"f15", L"?f9 - ?f12");
|
||||
add(L"f16", L"if(?f15, ?f9, ?f12)");
|
||||
add(L"f17", L"?f16 / 2");
|
||||
add(L"f18", L"?f1 - ?f17");
|
||||
add(L"f19", L"?f3 - ?f17");
|
||||
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
|
||||
add(L"f1", L"if(0-$1 ,0,if(50000-$1 ,$1 ,50000))");
|
||||
add(L"f2", L"min(logwidth,logheight)");
|
||||
add(L"f3", L"?f2 *?f0 /100000");
|
||||
add(L"f4", L"logwidth+0-?f3 ");
|
||||
add(L"f5", L"logheight+0-?f3 ");
|
||||
add(L"f6", L"?f2 *?f1 /100000");
|
||||
add(L"f7", L"logwidth+0-?f6 ");
|
||||
add(L"f8", L"logheight+0-?f6 ");
|
||||
add(L"f9", L"?f3 +0-?f6 ");
|
||||
add(L"f10", L"if(?f9 ,?f3 ,?f6 )");
|
||||
add(L"f11", L"?f10 *1/2");
|
||||
add(L"f12", L"logwidth+0-?f11 ");
|
||||
add(L"f13", L"logheight+0-?f11 ");
|
||||
add(L"f14", L"logwidth");
|
||||
add(L"f15", L"logheight/2");
|
||||
add(L"f16", L"logwidth/2");
|
||||
add(L"f17", L"logheight");
|
||||
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f3 0";
|
||||
h.x_maximum= L"50000";
|
||||
h.x_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
|
||||
h.position = L"?f7 0";
|
||||
h.x_maximum= L"50000";
|
||||
h.x_minimum= L"0";
|
||||
handles.push_back(h);
|
||||
|
||||
}
|
||||
};
|
||||
class oox_shape_snip2SameRect : public oox_shape
|
||||
@ -708,4 +719,45 @@ public:
|
||||
add(L"f198", L"if(?f26, ?f175, ?f190)");
|
||||
}
|
||||
};
|
||||
class oox_shape_roundRect : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_roundRect()
|
||||
{
|
||||
odf_type_name =L"ooxml-roundRect";
|
||||
|
||||
enhanced_path = L"M 0 ?f2 G ?f2 ?f2 ?f12 ?f13 L ?f3 0 G ?f2 ?f2 ?f14 ?f15 L ?f11 ?f4 G ?f2 ?f2 ?f16 ?f17 L ?f2 ?f10 G ?f2 ?f2 ?f18 ?f19 Z N";
|
||||
text_areas = L"?f5 ?f5 ?f6 ?f7";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"16667";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(50000-$0 ,$0 ,50000))");
|
||||
add(L"f1", L"min(logwidth,logheight)");
|
||||
add(L"f2", L"?f1 *?f0 /100000");
|
||||
add(L"f3", L"logwidth+0-?f2 ");
|
||||
add(L"f4", L"logheight+0-?f2 ");
|
||||
add(L"f5", L"?f2 *29289/100000");
|
||||
add(L"f6", L"logwidth+0-?f5 ");
|
||||
add(L"f7", L"logheight+0-?f5 ");
|
||||
add(L"f8", L"logwidth/2");
|
||||
add(L"f9", L"logheight/2");
|
||||
add(L"f10", L"logheight");
|
||||
add(L"f11", L"logwidth");
|
||||
add(L"f12", L"(10800000)/60000.0");
|
||||
add(L"f13", L"(5400000)/60000.0");
|
||||
add(L"f14", L"(16200000)/60000.0");
|
||||
add(L"f15", L"(5400000)/60000.0");
|
||||
add(L"f16", L"(0)/60000.0");
|
||||
add(L"f17", L"(5400000)/60000.0");
|
||||
add(L"f18", L"(5400000)/60000.0");
|
||||
add(L"f19", L"(5400000)/60000.0");
|
||||
//-----------------------------------------------------------------
|
||||
_handle h1;
|
||||
|
||||
h1.position = L"?f2 0";
|
||||
h1.x_maximum= L"50000";
|
||||
h1.x_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -74,6 +74,8 @@ void anim_par::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
|
||||
if (anim_par_)
|
||||
anim_par_->serialize(CP_XML_STREAM());
|
||||
|
||||
@ -98,6 +100,8 @@ void anim_seq::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
|
||||
for (size_t i = 0; i < anim_par_array_.size(); i++)
|
||||
{
|
||||
anim_par_array_[i]->serialize(CP_XML_STREAM());
|
||||
@ -136,8 +140,7 @@ void anim_transitionFilter::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
common_anim_smil_attlist_.serialize(CP_GET_XML_NODE());
|
||||
anim_transition_filter_attlist_.serialize(CP_GET_XML_NODE());
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,9 +53,10 @@ public:
|
||||
static const ElementType type = typeAnimPar;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
office_element_ptr anim_par_;
|
||||
office_element_ptr_array anim_seq_array_;
|
||||
office_element_ptr_array content_;
|
||||
odf_types::common_anim_smil_attlist attlist_;
|
||||
office_element_ptr anim_par_;
|
||||
office_element_ptr_array anim_seq_array_;
|
||||
office_element_ptr_array content_;
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child);
|
||||
@ -73,7 +74,8 @@ public:
|
||||
static const ElementType type = typeAnimSeq;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
office_element_ptr_array anim_par_array_;
|
||||
odf_types::common_anim_smil_attlist attlist_;
|
||||
office_element_ptr_array anim_par_array_;
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child);
|
||||
@ -81,14 +83,11 @@ public:
|
||||
virtual void serialize(std::wostream & strm);
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(anim_seq);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//anim:iterate
|
||||
//class anim_iterate : public office_element_impl<anim_iterate>//Итеративные анимации
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//----------------------------------------------------------------------------------------------------------------/
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class anim_transition_filter_attlist
|
||||
{
|
||||
public:
|
||||
@ -117,8 +116,7 @@ public:
|
||||
|
||||
virtual void serialize(std::wostream & strm);
|
||||
///////////////////////////////////////////////////////////
|
||||
odf_types::common_anim_smil_attlist common_anim_smil_attlist_;
|
||||
anim_transition_filter_attlist anim_transition_filter_attlist_;
|
||||
anim_transition_filter_attlist attlist_;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(anim_transitionFilter);
|
||||
|
||||
|
||||
@ -46,17 +46,17 @@ namespace odf_writer {
|
||||
|
||||
void draw_page_attr::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"draw:id", draw_id_);
|
||||
CP_XML_ATTR_OPT(L"draw:id", draw_id_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"draw:name", draw_name_);
|
||||
CP_XML_ATTR_OPT(L"draw:style-name", draw_style_name_);
|
||||
CP_XML_ATTR_OPT(L"draw:name", draw_name_);
|
||||
CP_XML_ATTR_OPT(L"draw:style-name", draw_style_name_);
|
||||
CP_XML_ATTR_OPT(L"draw:master-page-name", draw_master_page_name_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"presentation:presentation-page-layout-name", page_layout_name_);
|
||||
CP_XML_ATTR_OPT(L"draw:master-page-name", master_page_name_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"presentation:use-date-time-name", use_date_time_name_);
|
||||
CP_XML_ATTR_OPT(L"presentation:use-footer-name", use_footer_name_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"style:page-layout-name", style_page_layout_name_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"presentation:presentation-page-layout-name", presentation_page_layout_name_);
|
||||
CP_XML_ATTR_OPT(L"presentation:use-date-time-name", presentation_use_date_time_name_);
|
||||
CP_XML_ATTR_OPT(L"presentation:use-footer-name", presentation_use_footer_name_);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -85,7 +85,7 @@ void draw_page::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
draw_page_attr_.serialize(CP_GET_XML_NODE());
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
for (int i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->serialize(CP_XML_STREAM());
|
||||
@ -107,7 +107,7 @@ const wchar_t * presentation_footer_decl::name = L"footer-decl";
|
||||
// CP_XML_ATTR_OPT(L"presentation:name", presentation_name_);
|
||||
//}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//------------------------------------------------------
|
||||
const wchar_t * presentation_date_time_decl::ns = L"presentation";
|
||||
const wchar_t * presentation_date_time_decl::name = L"date-time-decl";
|
||||
//
|
||||
@ -119,5 +119,33 @@ const wchar_t * presentation_date_time_decl::name = L"date-time-decl";
|
||||
//}
|
||||
//
|
||||
|
||||
//------------------------------------------------------
|
||||
const wchar_t * presentation_notes::ns = L"presentation";
|
||||
const wchar_t * presentation_notes::name = L"notes";
|
||||
|
||||
void presentation_notes::create_child_element( const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
void presentation_notes::add_child_element( const office_element_ptr & child_element)
|
||||
{
|
||||
content_.push_back(child_element);
|
||||
}
|
||||
|
||||
void presentation_notes::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
for (int i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,12 +54,13 @@ public:
|
||||
_CP_OPT(std::wstring) draw_name_;
|
||||
_CP_OPT(std::wstring) draw_id_;
|
||||
_CP_OPT(std::wstring) draw_style_name_;
|
||||
_CP_OPT(std::wstring) draw_master_page_name_;
|
||||
|
||||
_CP_OPT(std::wstring) page_layout_name_;
|
||||
_CP_OPT(std::wstring) master_page_name_;
|
||||
_CP_OPT(std::wstring) style_page_layout_name_;
|
||||
|
||||
_CP_OPT(std::wstring) use_footer_name_;
|
||||
_CP_OPT(std::wstring) use_date_time_name_;
|
||||
_CP_OPT(std::wstring) presentation_use_footer_name_;
|
||||
_CP_OPT(std::wstring) presentation_use_date_time_name_;
|
||||
_CP_OPT(std::wstring) presentation_page_layout_name_;
|
||||
};
|
||||
|
||||
class draw_page : public office_element_impl<draw_page>
|
||||
@ -79,7 +80,7 @@ public:
|
||||
office_element_ptr_array content_;
|
||||
office_element_ptr animation_;
|
||||
|
||||
draw_page_attr draw_page_attr_;
|
||||
draw_page_attr attlist_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_page);
|
||||
@ -127,6 +128,26 @@ public:
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(presentation_date_time_decl);
|
||||
//---------------------------------------------------------------------
|
||||
class presentation_notes : public office_element_impl<presentation_notes>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typePresentationNotes;
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void create_child_element(const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element( const office_element_ptr & child_element);
|
||||
|
||||
virtual void serialize(std::wostream & _Wostream);
|
||||
|
||||
office_element_ptr_array content_;
|
||||
draw_page_attr attlist_;
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(presentation_notes);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -403,9 +403,11 @@ int draw_enhanced_geometry::parsing(_CP_OPT(std::wstring) val)
|
||||
void draw_enhanced_geometry_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"draw:type", draw_type_);
|
||||
CP_XML_ATTR_OPT(L"draw:text-areas", draw_text_areas_);
|
||||
CP_XML_ATTR_OPT(L"drawooo:sub-view-size", draw_sub_view_size_);
|
||||
CP_XML_ATTR_OPT(L"draw:text-areas", draw_text_areas_);
|
||||
CP_XML_ATTR_OPT(L"draw:modifiers", draw_modifiers_);
|
||||
CP_XML_ATTR_OPT(L"draw:enhanced-path", draw_enhanced_path_);
|
||||
CP_XML_ATTR_OPT(L"drawooo:enhanced-path", draw_enhanced_path_);
|
||||
//CP_XML_ATTR_OPT(L"draw:enhanced-path", draw_enhanced_path_);
|
||||
CP_XML_ATTR_OPT(L"draw:glue-points", draw_glue_points_);
|
||||
CP_XML_ATTR_OPT(L"draw:mirror-vertical", draw_mirror_vertical_);
|
||||
CP_XML_ATTR_OPT(L"draw:mirror-horizontal", draw_mirror_horizontal_);
|
||||
|
||||
@ -316,19 +316,21 @@ CP_REGISTER_OFFICE_ELEMENT2(draw_handle);
|
||||
class draw_enhanced_geometry_attlist
|
||||
{
|
||||
public:
|
||||
_CP_OPT(std::wstring) draw_type_;
|
||||
_CP_OPT(std::wstring) draw_modifiers_;
|
||||
_CP_OPT(std::wstring) draw_enhanced_path_;
|
||||
_CP_OPT(std::wstring) draw_text_areas_;
|
||||
_CP_OPT(std::wstring) draw_glue_points_;
|
||||
_CP_OPT(std::wstring) draw_type_;
|
||||
_CP_OPT(std::wstring) draw_modifiers_;
|
||||
_CP_OPT(std::wstring) draw_enhanced_path_;
|
||||
_CP_OPT(std::wstring) draw_text_areas_;
|
||||
_CP_OPT(std::wstring) draw_glue_points_;
|
||||
|
||||
_CP_OPT(odf_types::Bool) draw_mirror_vertical_;
|
||||
_CP_OPT(odf_types::Bool) draw_mirror_horizontal_;
|
||||
_CP_OPT(std::wstring) draw_sub_view_size_;
|
||||
|
||||
_CP_OPT(odf_types::Bool) draw_mirror_vertical_;
|
||||
_CP_OPT(odf_types::Bool) draw_mirror_horizontal_;
|
||||
|
||||
_CP_OPT(odf_types::Bool) draw_text_path_;
|
||||
_CP_OPT(odf_types::Bool) draw_text_path_same_letter_heights_;
|
||||
_CP_OPT(std::wstring) draw_text_path_mode_;
|
||||
_CP_OPT(std::wstring) draw_text_path_scale_;
|
||||
_CP_OPT(odf_types::Bool) draw_text_path_;
|
||||
_CP_OPT(odf_types::Bool) draw_text_path_same_letter_heights_;
|
||||
_CP_OPT(std::wstring) draw_text_path_mode_;
|
||||
_CP_OPT(std::wstring) draw_text_path_scale_;
|
||||
|
||||
void serialize(CP_ATTR_NODE);
|
||||
};
|
||||
|
||||
@ -96,7 +96,7 @@ void odf_comment_context::start_comment(office_element_ptr &elm, int oox_id)
|
||||
|
||||
impl_->comments_.push_back(state);
|
||||
impl_->comments_.back().elements_.push_back(elm);//"0" - root comment eleemnt
|
||||
impl_->comments_.back().oox_id = oox_id;
|
||||
impl_->comments_.back().oox_id = oox_id < 0 ? impl_->comments_.back().elements_.size() : oox_id;
|
||||
impl_->comments_.back().odf_name = L"comment_" + boost::lexical_cast<std::wstring>(oox_id);
|
||||
|
||||
impl_->comments_.back().is_started = false;
|
||||
@ -159,14 +159,14 @@ std::wstring odf_comment_context::find_name_by_id(int oox_id)
|
||||
}
|
||||
bool odf_comment_context::is_started()
|
||||
{
|
||||
if (impl_->comments_.size()>0)
|
||||
if (!impl_->comments_.empty())
|
||||
return impl_->comments_.back().is_started;
|
||||
else return false;
|
||||
|
||||
}
|
||||
void odf_comment_context::set_author(std::wstring author)
|
||||
{
|
||||
if ((impl_->comments_.size()<1) || !is_started()) return;
|
||||
if ((impl_->comments_.empty()) || !is_started()) return;
|
||||
|
||||
office_element_ptr elm;
|
||||
create_element(L"dc", L"creator", elm, impl_->odf_context_);
|
||||
@ -178,11 +178,15 @@ void odf_comment_context::set_author(std::wstring author)
|
||||
|
||||
impl_->comments_.back().elements_[0]->add_child_element(elm);
|
||||
impl_->comments_.back().elements_.push_back(elm);
|
||||
}
|
||||
void odf_comment_context::set_initials(std::wstring initials)
|
||||
{
|
||||
if ((impl_->comments_.empty()) || !is_started()) return;
|
||||
|
||||
}
|
||||
void odf_comment_context::set_date(std::wstring _date)
|
||||
{
|
||||
if ((impl_->comments_.size()<1) || !is_started()) return;
|
||||
if ((impl_->comments_.empty()) || !is_started()) return;
|
||||
|
||||
office_element_ptr elm;
|
||||
create_element(L"dc", L"date", elm, impl_->odf_context_);
|
||||
@ -195,5 +199,18 @@ void odf_comment_context::set_date(std::wstring _date)
|
||||
impl_->comments_.back().elements_[0]->add_child_element(elm);
|
||||
impl_->comments_.back().elements_.push_back(elm);
|
||||
}
|
||||
void odf_comment_context::set_position (double x, double y)
|
||||
{
|
||||
if ((impl_->comments_.empty()) || !is_started()) return;
|
||||
|
||||
office_annotation* comm = dynamic_cast<office_annotation*>(impl_->comments_.back().elements_.back().get());
|
||||
|
||||
if (comm)
|
||||
{
|
||||
comm->office_annotation_attr_.svg_x_ = odf_types::length(x, odf_types::length::pt);
|
||||
comm->office_annotation_attr_.svg_y_ = odf_types::length(y, odf_types::length::pt);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -66,8 +66,11 @@ public:
|
||||
void start_comment_content ();
|
||||
void end_comment_content ();
|
||||
|
||||
void set_author (std::wstring author);
|
||||
void set_date (std::wstring author);
|
||||
void set_author (std::wstring author);
|
||||
void set_initials (std::wstring author);
|
||||
void set_date (std::wstring author);
|
||||
|
||||
void set_position (double x, double y);
|
||||
|
||||
private:
|
||||
std::wstring find_name_by_id(int oox_id);
|
||||
|
||||
@ -262,6 +262,7 @@ void odf_conversion_context::process_settings(_object & object, bool isRoot)
|
||||
void odf_conversion_context::process_styles(_object & object, bool isRoot)
|
||||
{
|
||||
create_element(L"office", L"styles", object.styles, this, true);//общие стили
|
||||
|
||||
object.style_context->process_office_styles(object.styles.back());
|
||||
page_layout_context()->process_office_styles(object.styles.back());
|
||||
|
||||
@ -288,7 +289,15 @@ office_element_ptr odf_conversion_context::start_tabs()
|
||||
create_element(L"style", L"tab-stops", temporary_.elm, this,true);
|
||||
return temporary_.elm;
|
||||
}
|
||||
std::wstring odf_conversion_context::add_image(const std::wstring & image_file_name)
|
||||
{
|
||||
if (image_file_name.empty()) return L"";
|
||||
|
||||
std::wstring odf_ref_name ;
|
||||
mediaitems()->add_or_find(image_file_name,_mediaitems::typeImage, odf_ref_name);
|
||||
|
||||
return odf_ref_name;
|
||||
}
|
||||
void odf_conversion_context::add_tab(_CP_OPT(int) type, _CP_OPT(length) _length, _CP_OPT(int) leader)
|
||||
{
|
||||
if (!temporary_.elm) return;
|
||||
|
||||
@ -95,7 +95,7 @@ public:
|
||||
virtual void start_text_context() = 0;
|
||||
virtual void end_text_context() = 0;
|
||||
|
||||
virtual void start_image(const std::wstring & image_file_name) = 0;
|
||||
std::wstring add_image(const std::wstring & image_file_name);
|
||||
|
||||
virtual odf_style_context * styles_context();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -52,6 +52,7 @@ namespace odf_writer
|
||||
class odf_conversion_context;
|
||||
class odf_style_context;
|
||||
class odf_text_context;
|
||||
class style_paragraph_properties;
|
||||
|
||||
class odf_drawing_context
|
||||
{
|
||||
@ -59,7 +60,8 @@ public:
|
||||
odf_drawing_context (odf_conversion_context *odf_context);
|
||||
~odf_drawing_context ();
|
||||
|
||||
void set_presentation (bool bMaster);
|
||||
void set_presentation (int type);
|
||||
_CP_OPT(int) get_presentation ();
|
||||
|
||||
void set_drawings_rect (_CP_OPT(double) x_pt, _CP_OPT(double) y_pt, _CP_OPT(double) width_pt, _CP_OPT(double) height_pt);
|
||||
void clear ();
|
||||
@ -102,6 +104,7 @@ public:
|
||||
void end_drawing();
|
||||
void end_drawing_background(odf_types::common_draw_fill_attlist & common_draw_attlist);
|
||||
|
||||
int get_group_level();
|
||||
void start_group();
|
||||
void set_group_flip_H (bool bVal);
|
||||
void set_group_flip_V (bool bVal);
|
||||
@ -124,21 +127,24 @@ public:
|
||||
void start_frame ();
|
||||
void end_frame ();
|
||||
|
||||
bool change_text_box_2_wordart();
|
||||
|
||||
void start_image (std::wstring file_path);
|
||||
void start_image (std::wstring odf_file_path);
|
||||
void end_image ();
|
||||
|
||||
bool change_text_box_2_wordart ();
|
||||
bool is_wordart ();
|
||||
void set_paragraph_properties (style_paragraph_properties *paragraph_properties);
|
||||
|
||||
void start_text_box ();
|
||||
void set_text_box_min_size (bool val);
|
||||
void set_text_box_min_size (double w_pt, double h_pt);
|
||||
void set_text_box_parent_style (std::wstring style_name);
|
||||
void set_text_box_tableframe (bool val);
|
||||
void set_text_box_tableframe (bool val);
|
||||
void end_text_box ();
|
||||
|
||||
void start_object(std::wstring name);
|
||||
void end_object();
|
||||
|
||||
bool isLineShape();
|
||||
void corrected_line_fill();
|
||||
|
||||
office_element_ptr & get_root_element();
|
||||
@ -149,16 +155,18 @@ public:
|
||||
bool is_exist_content();
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
void set_path (std::wstring path_string);
|
||||
void add_path_element (std::wstring command, const std::wstring & elm);
|
||||
void add_path_element (std::wstring command, std::wstring elm);
|
||||
void add_modifier (std::wstring modifier);
|
||||
void add_formula (std::wstring name, std::wstring fmla);
|
||||
void set_textarea (std::wstring l, std::wstring t, std::wstring r, std::wstring b);
|
||||
void add_handle (std::wstring x, std::wstring y, std::wstring refX, std::wstring refY,
|
||||
std::wstring minX, std::wstring maxX, std::wstring minY, std::wstring maxY);
|
||||
|
||||
void set_viewBox (double W, double H);
|
||||
|
||||
void finalize(office_element_ptr & root_elm);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
void get_position (_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt);
|
||||
void set_position (_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt);
|
||||
void set_position_line (_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt, _CP_OPT(double) & x1_pt, _CP_OPT(double) & y1_pt);
|
||||
|
||||
@ -54,11 +54,12 @@ void odf_lists_styles_context::set_odf_context(odf_conversion_context * Context)
|
||||
odf_context_ = Context;
|
||||
}
|
||||
|
||||
void odf_lists_styles_context::process_styles(office_element_ptr root )
|
||||
void odf_lists_styles_context::process_styles(office_element_ptr root, bool automatic)
|
||||
{
|
||||
for (size_t i = 0; i < lists_format_array_.size(); i++)
|
||||
{
|
||||
if (lists_format_array_[i].elements.size() < 1) continue;
|
||||
if (lists_format_array_[i].elements.size() < 1) continue;
|
||||
if (lists_format_array_[i].automatic != automatic) continue;
|
||||
|
||||
root->add_child_element(lists_format_array_[i].elements[0]);
|
||||
}
|
||||
@ -92,7 +93,13 @@ std::wstring odf_lists_styles_context::get_style_name1(int oox_style_num)
|
||||
}
|
||||
std::wstring odf_lists_styles_context::get_style_name(int oox_style_num)
|
||||
{
|
||||
if (link_format_map_.count(oox_style_num) > 0)
|
||||
if (lists_format_array_.empty()) return L"";
|
||||
|
||||
if (oox_style_num < 0)
|
||||
{
|
||||
return lists_format_array_.back().odf_list_style_name;
|
||||
}
|
||||
else if (link_format_map_.count(oox_style_num) > 0)
|
||||
{
|
||||
return link_format_map_.at(oox_style_num);
|
||||
}
|
||||
@ -101,7 +108,7 @@ std::wstring odf_lists_styles_context::get_style_name(int oox_style_num)
|
||||
return L"";
|
||||
}
|
||||
}
|
||||
void odf_lists_styles_context::start_style(int based_number)
|
||||
void odf_lists_styles_context::start_style(bool bMaster, int based_number)
|
||||
{
|
||||
list_format_state state;
|
||||
|
||||
@ -109,21 +116,29 @@ void odf_lists_styles_context::start_style(int based_number)
|
||||
create_element(L"text", L"list-style", elm, odf_context_);
|
||||
state.elements.push_back(elm);
|
||||
|
||||
state.oox_based_number = based_number;
|
||||
state.odf_list_style_name = std::wstring(L"WWNum") + boost::lexical_cast<std::wstring>(based_number + 1);
|
||||
if (based_number < 0)
|
||||
{
|
||||
state.oox_based_number = lists_format_array_.size();
|
||||
state.odf_list_style_name = std::wstring(L"L") + boost::lexical_cast<std::wstring>(state.oox_based_number + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
state.oox_based_number = based_number;
|
||||
state.odf_list_style_name = std::wstring(L"WWNum") + boost::lexical_cast<std::wstring>(state.oox_based_number + 1);
|
||||
}
|
||||
state.automatic = !bMaster;
|
||||
|
||||
text_list_style *style = dynamic_cast<text_list_style *>(elm.get());
|
||||
if (style == NULL)return;
|
||||
|
||||
style->text_list_style_attr_.style_name_ = state.odf_list_style_name;
|
||||
|
||||
lists_format_array_.push_back(state); //перенести в end??
|
||||
}
|
||||
|
||||
style_list_level_properties * odf_lists_styles_context::get_list_level_properties()
|
||||
{
|
||||
if (lists_format_array_.size() < 1) return NULL;
|
||||
if (lists_format_array_.back().elements.size() <1) return NULL;
|
||||
if (lists_format_array_.empty()) return NULL;
|
||||
if (lists_format_array_.back().elements.empty()) return NULL;
|
||||
|
||||
text_list_level_style_number *style_number_ = dynamic_cast<text_list_level_style_number *>(lists_format_array_.back().elements.back().get());
|
||||
text_list_level_style_bullet *style_bullet_ = dynamic_cast<text_list_level_style_bullet *>(lists_format_array_.back().elements.back().get());
|
||||
@ -156,8 +171,8 @@ style_list_level_properties * odf_lists_styles_context::get_list_level_propertie
|
||||
}
|
||||
style_text_properties * odf_lists_styles_context::get_text_properties()
|
||||
{
|
||||
if (lists_format_array_.size() < 1) return NULL;
|
||||
if (lists_format_array_.back().elements.size() <1) return NULL;
|
||||
if (lists_format_array_.empty()) return NULL;
|
||||
if (lists_format_array_.back().elements.empty()) return NULL;
|
||||
|
||||
text_list_level_style_number *style_number_ = dynamic_cast<text_list_level_style_number *>(lists_format_array_.back().elements.back().get());
|
||||
text_list_level_style_bullet *style_bullet_ = dynamic_cast<text_list_level_style_bullet *>(lists_format_array_.back().elements.back().get());
|
||||
@ -167,14 +182,14 @@ style_text_properties * odf_lists_styles_context::get_text_properties()
|
||||
if (style_number_)
|
||||
{
|
||||
if (!style_number_->style_text_properties_)
|
||||
create_element(L"style", L"text-properties",style_number_->style_text_properties_,odf_context_);
|
||||
create_element(L"style", L"text-properties", style_number_->style_text_properties_, odf_context_);
|
||||
|
||||
props = dynamic_cast<style_text_properties *>(style_number_->style_text_properties_.get());
|
||||
}
|
||||
if (style_bullet_)
|
||||
{
|
||||
if (!style_bullet_->style_text_properties_)
|
||||
create_element(L"style", L"text-properties",style_bullet_->style_text_properties_,odf_context_);
|
||||
create_element(L"style", L"text-properties", style_bullet_->style_text_properties_, odf_context_);
|
||||
|
||||
props = dynamic_cast<style_text_properties *>(style_bullet_->style_text_properties_.get());
|
||||
}
|
||||
@ -190,8 +205,8 @@ style_text_properties * odf_lists_styles_context::get_text_properties()
|
||||
|
||||
style_list_level_label_alignment * odf_lists_styles_context::get_list_level_alignment_properties()
|
||||
{
|
||||
if (lists_format_array_.size() < 1) return NULL;
|
||||
if (lists_format_array_.back().elements.size() <1) return NULL;
|
||||
if (lists_format_array_.empty()) return NULL;
|
||||
if (lists_format_array_.back().elements.empty()) return NULL;
|
||||
|
||||
text_list_level_style_number *style_number_ = dynamic_cast<text_list_level_style_number *>(lists_format_array_.back().elements.back().get());
|
||||
text_list_level_style_bullet *style_bullet_ = dynamic_cast<text_list_level_style_bullet *>(lists_format_array_.back().elements.back().get());
|
||||
@ -201,21 +216,21 @@ style_list_level_label_alignment * odf_lists_styles_context::get_list_level_alig
|
||||
if (style_number_)
|
||||
{
|
||||
if (!style_number_->style_list_level_properties_)
|
||||
create_element(L"style", L"list-level-properties",style_number_->style_list_level_properties_,odf_context_);
|
||||
create_element(L"style", L"list-level-properties", style_number_->style_list_level_properties_, odf_context_);
|
||||
|
||||
props = dynamic_cast<style_list_level_properties *>(style_number_->style_list_level_properties_.get());
|
||||
}
|
||||
if (style_bullet_)
|
||||
{
|
||||
if (!style_bullet_->style_list_level_properties_)
|
||||
create_element(L"style", L"list-level-properties",style_bullet_->style_list_level_properties_,odf_context_);
|
||||
create_element(L"style", L"list-level-properties", style_bullet_->style_list_level_properties_, odf_context_);
|
||||
|
||||
props = dynamic_cast<style_list_level_properties *>(style_bullet_->style_list_level_properties_.get());
|
||||
}
|
||||
if (style_image_)
|
||||
{
|
||||
if (!style_image_->style_list_level_properties_)
|
||||
create_element(L"style", L"list-level-properties",style_image_->style_list_level_properties_,odf_context_);
|
||||
create_element(L"style", L"list-level-properties", style_image_->style_list_level_properties_, odf_context_);
|
||||
|
||||
props = dynamic_cast<style_list_level_properties *>(style_image_->style_list_level_properties_.get());
|
||||
}
|
||||
@ -223,14 +238,15 @@ style_list_level_label_alignment * odf_lists_styles_context::get_list_level_alig
|
||||
|
||||
if (!props->style_list_level_label_alignment_)
|
||||
{
|
||||
create_element(L"style", L"list-level-label-alignment" ,props->style_list_level_label_alignment_,odf_context_);
|
||||
create_element(L"style", L"list-level-label-alignment" , props->style_list_level_label_alignment_, odf_context_);
|
||||
}
|
||||
return dynamic_cast<style_list_level_label_alignment *>(props->style_list_level_label_alignment_.get());
|
||||
}
|
||||
|
||||
int odf_lists_styles_context::start_style_level(int level, int type)
|
||||
{
|
||||
if (lists_format_array_.size() < 1) return -1;
|
||||
if (lists_format_array_.empty()) return -1;
|
||||
|
||||
int odf_type =1;
|
||||
int format_type = -1;
|
||||
|
||||
@ -451,10 +467,10 @@ wchar_t convert_bullet_char(wchar_t c)
|
||||
}
|
||||
void odf_lists_styles_context::set_numeric_format(std::wstring val)
|
||||
{
|
||||
if (lists_format_array_.size() < 1) return;
|
||||
if (lists_format_array_.back().elements.size() <1) return ;
|
||||
if ( val.length() <1 )
|
||||
return;
|
||||
if ( lists_format_array_.empty() ) return;
|
||||
if ( lists_format_array_.back().elements.empty() ) return;
|
||||
|
||||
if ( val.empty() ) return;
|
||||
|
||||
text_list_level_style_number *style_number_ = dynamic_cast<text_list_level_style_number *>(lists_format_array_.back().elements.back().get());
|
||||
if (style_number_)
|
||||
@ -522,10 +538,10 @@ void odf_lists_styles_context::set_numeric_format(std::wstring val)
|
||||
}
|
||||
void odf_lists_styles_context::set_bullet_char(std::wstring val)
|
||||
{
|
||||
if (lists_format_array_.size() < 1) return;
|
||||
if (lists_format_array_.back().elements.size() <1) return ;
|
||||
if ( val.length() <1 )
|
||||
return;
|
||||
if ( lists_format_array_.empty() ) return;
|
||||
if ( lists_format_array_.back().elements.empty() ) return ;
|
||||
|
||||
if ( val.empty() ) return;
|
||||
|
||||
text_list_level_style_bullet *style_bullet_ = dynamic_cast<text_list_level_style_bullet *>(lists_format_array_.back().elements.back().get());
|
||||
|
||||
@ -536,20 +552,20 @@ void odf_lists_styles_context::set_bullet_char(std::wstring val)
|
||||
void odf_lists_styles_context::set_bullet_image_size(double size)
|
||||
{
|
||||
if (size < 0.1) return;
|
||||
if (lists_format_array_.size() < 1) return;
|
||||
if (lists_format_array_.back().elements.size() <1) return ;
|
||||
if (lists_format_array_.empty()) return;
|
||||
if (lists_format_array_.back().elements.empty()) return ;
|
||||
|
||||
style_list_level_properties *props = get_list_level_properties();
|
||||
|
||||
if(!props) return;
|
||||
|
||||
props->fo_width_ = length(length(size,length::pt).get_value_unit(length::cm),length::cm);
|
||||
props->fo_height_ = length(length(size,length::pt).get_value_unit(length::cm),length::cm);
|
||||
props->fo_width_ = length(length(size, length::pt).get_value_unit(length::cm), length::cm);
|
||||
props->fo_height_ = length(length(size, length::pt).get_value_unit(length::cm), length::cm);
|
||||
}
|
||||
void odf_lists_styles_context::set_bullet_image (std::wstring ref)
|
||||
{
|
||||
if (lists_format_array_.size() < 1) return;
|
||||
if (lists_format_array_.back().elements.size() <1) return ;
|
||||
if (lists_format_array_.empty()) return;
|
||||
if (lists_format_array_.back().elements.empty()) return ;
|
||||
|
||||
text_list_level_style_image *style_image_ = dynamic_cast<text_list_level_style_image *>(lists_format_array_.back().elements.back().get());
|
||||
|
||||
@ -557,14 +573,14 @@ void odf_lists_styles_context::set_bullet_image (std::wstring ref)
|
||||
|
||||
style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.href_ = ref;
|
||||
|
||||
style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.type_= xlink_type::Simple;
|
||||
style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.show_ = xlink_show::Embed;
|
||||
style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.actuate_= xlink_actuate::OnLoad;
|
||||
style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.type_ = xlink_type::Simple;
|
||||
style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.show_ = xlink_show::Embed;
|
||||
style_image_->text_list_level_style_image_attr_.common_xlink_attlist_.actuate_ = xlink_actuate::OnLoad;
|
||||
}
|
||||
void odf_lists_styles_context::set_start_number(int val)
|
||||
{
|
||||
if (lists_format_array_.size() < 1) return;
|
||||
if (lists_format_array_.back().elements.size() <1) return ;
|
||||
if (lists_format_array_.empty()) return;
|
||||
if (lists_format_array_.back().elements.empty()) return ;
|
||||
|
||||
text_list_level_style_number *style_number_ = dynamic_cast<text_list_level_style_number *>(lists_format_array_.back().elements.back().get());
|
||||
|
||||
@ -574,8 +590,8 @@ void odf_lists_styles_context::set_start_number(int val)
|
||||
}
|
||||
void odf_lists_styles_context::set_text_style_name(std::wstring name)
|
||||
{
|
||||
if (lists_format_array_.size() < 1) return;
|
||||
if (lists_format_array_.back().elements.size() <1) return ;
|
||||
if (lists_format_array_.empty()) return;
|
||||
if (lists_format_array_.back().elements.empty()) return ;
|
||||
|
||||
text_list_level_style_number *style_number_ = dynamic_cast<text_list_level_style_number *>(lists_format_array_.back().elements.back().get());
|
||||
text_list_level_style_bullet *style_bullet_ = dynamic_cast<text_list_level_style_bullet *>(lists_format_array_.back().elements.back().get());
|
||||
|
||||
@ -55,7 +55,7 @@ struct list_format_state
|
||||
std::vector<office_element_ptr> elements;
|
||||
|
||||
std::wstring odf_list_style_name;
|
||||
|
||||
bool automatic;
|
||||
};
|
||||
|
||||
class odf_lists_styles_context
|
||||
@ -64,7 +64,7 @@ public:
|
||||
odf_lists_styles_context();
|
||||
void set_odf_context(odf_conversion_context * Context);
|
||||
|
||||
void start_style(int abstract_number);
|
||||
void start_style(bool bMaster, int abstract_number = -1);
|
||||
int start_style_level(int level, int type);
|
||||
style_list_level_properties * get_list_level_properties();
|
||||
style_list_level_label_alignment * get_list_level_alignment_properties();
|
||||
@ -84,9 +84,9 @@ public:
|
||||
|
||||
void add_style(int oox_style_num, int oox_based_num);
|
||||
|
||||
void process_styles(office_element_ptr root );
|
||||
void process_styles(office_element_ptr root, bool automatic);
|
||||
|
||||
std::wstring get_style_name(int oox_style_num);
|
||||
std::wstring get_style_name(int oox_style_num = -1);
|
||||
std::wstring get_style_name1(int oox_style_num);
|
||||
private:
|
||||
std::vector<list_format_state> lists_format_array_;
|
||||
|
||||
@ -584,7 +584,8 @@ void odf_page_layout_context::set_pages_mirrored(bool val)
|
||||
|
||||
style_page_layout_properties * odf_page_layout_context::get_properties()
|
||||
{
|
||||
if (layout_state_list_.size() < 1) return NULL;
|
||||
if (layout_state_list_.empty()) return NULL;
|
||||
|
||||
style_page_layout_properties * props = layout_state_list_.back().get_properties();
|
||||
if (props == NULL)
|
||||
{
|
||||
|
||||
@ -84,7 +84,7 @@ void odf_master_state::set_name(std::wstring & name)
|
||||
|
||||
if (!style_)return;
|
||||
|
||||
style_->style_master_page_attlist_.style_name_ = name;
|
||||
style_->attlist_.style_name_ = name;
|
||||
}
|
||||
void odf_master_state::set_display_name(std::wstring & name)
|
||||
{
|
||||
@ -92,7 +92,7 @@ void odf_master_state::set_display_name(std::wstring & name)
|
||||
|
||||
if (!style_)return;
|
||||
|
||||
style_->style_master_page_attlist_.style_display_name_ = name;
|
||||
style_->attlist_.style_display_name_ = name;
|
||||
}
|
||||
|
||||
void odf_master_state::set_layout_style_name(std::wstring name)
|
||||
@ -101,14 +101,14 @@ void odf_master_state::set_layout_style_name(std::wstring name)
|
||||
|
||||
if (!style_)return;
|
||||
|
||||
style_->style_master_page_attlist_.style_page_layout_name_ = name;
|
||||
style_->attlist_.style_page_layout_name_ = name;
|
||||
}
|
||||
std::wstring odf_master_state::get_name()
|
||||
{
|
||||
style_master_page* style_ = dynamic_cast<style_master_page*>(elements_[0].elm.get());
|
||||
if (!style_)return L"";
|
||||
|
||||
return style_->style_master_page_attlist_.style_name_.get_value_or(L"");
|
||||
return style_->attlist_.style_name_.get_value_or(L"");
|
||||
}
|
||||
void odf_master_state::add_footer(office_element_ptr & elm)
|
||||
{
|
||||
|
||||
@ -161,6 +161,7 @@ void odf_style_context::process_automatic_styles(office_element_ptr root )
|
||||
if (/*it->automatic_== true && */style_state_list_[i]->root_== false && style_state_list_[i]->odf_style_)
|
||||
root->add_child_element(style_state_list_[i]->odf_style_);
|
||||
}
|
||||
lists_styles_context_.process_styles(root, true);
|
||||
}
|
||||
|
||||
void odf_style_context::process_office_styles(office_element_ptr root )
|
||||
@ -175,7 +176,7 @@ void odf_style_context::process_office_styles(office_element_ptr root )
|
||||
root->add_child_element(style_state_list_[i]->odf_style_);
|
||||
}
|
||||
|
||||
lists_styles_context_.process_styles(root );
|
||||
lists_styles_context_.process_styles(root, false);
|
||||
}
|
||||
std::wstring odf_style_context::find_odf_style_name(int oox_id_style, style_family::type family, bool root, bool automatic)
|
||||
{
|
||||
|
||||
@ -154,13 +154,35 @@ void odf_text_context::add_text_content(const std::wstring & text)
|
||||
std::wstring last = text.substr(pos);
|
||||
if (last.length() > 0)current_level_.back().elm->add_text(last);
|
||||
}
|
||||
void odf_text_context::add_text_date(const std::wstring & text)
|
||||
{
|
||||
office_element_ptr s_elm;
|
||||
create_element(L"text", L"date", s_elm, odf_context_);
|
||||
|
||||
text_date* s = dynamic_cast<text_date*>(s_elm.get());
|
||||
if (s) s->add_text(text);
|
||||
|
||||
if (current_level_.size()>0)
|
||||
current_level_.back().elm->add_child_element(s_elm);
|
||||
}
|
||||
void odf_text_context::add_text_page_number(const std::wstring & text)
|
||||
{
|
||||
office_element_ptr s_elm;
|
||||
create_element(L"text", L"page-number", s_elm, odf_context_);
|
||||
|
||||
text_page_number* s = dynamic_cast<text_page_number*>(s_elm.get());
|
||||
if (s) s->add_text(text);
|
||||
|
||||
if (current_level_.size()>0)
|
||||
current_level_.back().elm->add_child_element(s_elm);
|
||||
}
|
||||
void odf_text_context::add_text_space(int count)
|
||||
{
|
||||
office_element_ptr s_elm;
|
||||
create_element(L"text", L"s", s_elm, odf_context_);
|
||||
|
||||
text_s* s = dynamic_cast<text_s*>(s_elm.get());
|
||||
if (s)s->text_c_ = count;
|
||||
if (s) s->text_c_ = count;
|
||||
|
||||
//необязательно хранить..
|
||||
//int level = current_level_.size();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user